@dudousxd/nestjs-durable-dashboard 0.49.0 → 0.50.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/dist/client/durable-client.d.ts +21 -1
- package/dist/client/durable-client.d.ts.map +1 -1
- package/dist/client/durable-client.js +13 -0
- package/dist/client/durable-client.js.map +1 -1
- package/dist/client/fan-pages.d.ts +8 -0
- package/dist/client/fan-pages.d.ts.map +1 -0
- package/dist/client/fan-pages.js +16 -0
- package/dist/client/fan-pages.js.map +1 -0
- package/dist/client/group-parallel-spans.d.ts +39 -4
- package/dist/client/group-parallel-spans.d.ts.map +1 -1
- package/dist/client/group-parallel-spans.js +65 -1
- package/dist/client/group-parallel-spans.js.map +1 -1
- package/dist/client/merge-live-events.d.ts +6 -1
- package/dist/client/merge-live-events.d.ts.map +1 -1
- package/dist/client/merge-live-events.js +15 -0
- package/dist/client/merge-live-events.js.map +1 -1
- package/dist/client/throttle.d.ts +11 -0
- package/dist/client/throttle.d.ts.map +1 -0
- package/dist/client/throttle.js +30 -0
- package/dist/client/throttle.js.map +1 -0
- package/dist/server/index.cjs +44 -4
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +11 -3
- package/dist/server/index.d.ts +11 -3
- package/dist/server/index.js +44 -4
- package/dist/server/index.js.map +1 -1
- package/dist/spa/assets/{bench-DH4bTOwJ.js → bench-bNSq4C-e.js} +1 -1
- package/dist/spa/assets/{index-DCWWFODc.js → index-CMQJ1rjL.js} +1 -1
- package/dist/spa/assets/index-CwX0J7uV.js +66 -0
- package/dist/spa/assets/index-DYEe8Ag-.css +1 -0
- package/dist/spa/assets/{preview-DeC52LPJ.js → preview-CehDLs8M.js} +1 -1
- package/dist/spa/bench.html +3 -3
- package/dist/spa/index.html +3 -3
- package/dist/spa/preview.html +3 -3
- package/package.json +2 -2
- package/dist/spa/assets/index-LBQc7d3p.css +0 -1
- package/dist/spa/assets/index-xUQjm-z_.js +0 -66
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var ON=Object.defineProperty;var S0=e=>{throw TypeError(e)};var _N=(e,t,n)=>t in e?ON(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var xe=(e,t,n)=>_N(e,typeof t!="symbol"?t+"":t,n),Yd=(e,t,n)=>t.has(e)||S0("Cannot "+n);var D=(e,t,n)=>(Yd(e,t,"read from private field"),n?n.call(e):t.get(e)),oe=(e,t,n)=>t.has(e)?S0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ee=(e,t,n,r)=>(Yd(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),he=(e,t,n)=>(Yd(e,t,"access private method"),n);var Fa=(e,t,n,r)=>({set _(s){ee(e,t,s,n)},get _(){return D(e,t,r)}});function MN(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 mw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yw={exports:{}},Yu={},xw={exports:{}},Ne={};/**
|
|
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 xa=Symbol.for("react.element"),jN=Symbol.for("react.portal"),AN=Symbol.for("react.fragment"),zN=Symbol.for("react.strict_mode"),DN=Symbol.for("react.profiler"),FN=Symbol.for("react.provider"),$N=Symbol.for("react.context"),LN=Symbol.for("react.forward_ref"),HN=Symbol.for("react.suspense"),BN=Symbol.for("react.memo"),VN=Symbol.for("react.lazy"),E0=Symbol.iterator;function WN(e){return e===null||typeof e!="object"?null:(e=E0&&e[E0]||e["@@iterator"],typeof e=="function"?e:null)}var vw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ww=Object.assign,bw={};function Di(e,t,n){this.props=e,this.context=t,this.refs=bw,this.updater=n||vw}Di.prototype.isReactComponent={};Di.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")};Di.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Sw(){}Sw.prototype=Di.prototype;function Xp(e,t,n){this.props=e,this.context=t,this.refs=bw,this.updater=n||vw}var Zp=Xp.prototype=new Sw;Zp.constructor=Xp;ww(Zp,Di.prototype);Zp.isPureReactComponent=!0;var k0=Array.isArray,Ew=Object.prototype.hasOwnProperty,Jp={current:null},kw={key:!0,ref:!0,__self:!0,__source:!0};function Cw(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)Ew.call(t,r)&&!kw.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:xa,type:e,key:o,ref:i,props:s,_owner:Jp.current}}function UN(e,t){return{$$typeof:xa,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function eg(e){return typeof e=="object"&&e!==null&&e.$$typeof===xa}function qN(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var C0=/\/+/g;function Gd(e,t){return typeof e=="object"&&e!==null&&e.key!=null?qN(""+e.key):t.toString(36)}function Nc(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 xa:case jN:i=!0}}if(i)return i=e,s=s(i),e=r===""?"."+Gd(i,0):r,k0(s)?(n="",e!=null&&(n=e.replace(C0,"$&/")+"/"),Nc(s,t,n,"",function(c){return c})):s!=null&&(eg(s)&&(s=UN(s,n+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(C0,"$&/")+"/")+e)),t.push(s)),1;if(i=0,r=r===""?".":r+":",k0(e))for(var l=0;l<e.length;l++){o=e[l];var a=r+Gd(o,l);i+=Nc(o,t,n,a,s)}else if(a=WN(e),typeof a=="function")for(e=a.call(e),l=0;!(o=e.next()).done;)o=o.value,a=r+Gd(o,l++),i+=Nc(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 $a(e,t,n){if(e==null)return e;var r=[],s=0;return Nc(e,r,"","",function(o){return t.call(n,o,s++)}),r}function KN(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 Lt={current:null},Rc={transition:null},YN={ReactCurrentDispatcher:Lt,ReactCurrentBatchConfig:Rc,ReactCurrentOwner:Jp};function Nw(){throw Error("act(...) is not supported in production builds of React.")}Ne.Children={map:$a,forEach:function(e,t,n){$a(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return $a(e,function(){t++}),t},toArray:function(e){return $a(e,function(t){return t})||[]},only:function(e){if(!eg(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ne.Component=Di;Ne.Fragment=AN;Ne.Profiler=DN;Ne.PureComponent=Xp;Ne.StrictMode=zN;Ne.Suspense=HN;Ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=YN;Ne.act=Nw;Ne.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=ww({},e.props),s=e.key,o=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,i=Jp.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)Ew.call(t,a)&&!kw.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:xa,type:e.type,key:s,ref:o,props:r,_owner:i}};Ne.createContext=function(e){return e={$$typeof:$N,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:FN,_context:e},e.Consumer=e};Ne.createElement=Cw;Ne.createFactory=function(e){var t=Cw.bind(null,e);return t.type=e,t};Ne.createRef=function(){return{current:null}};Ne.forwardRef=function(e){return{$$typeof:LN,render:e}};Ne.isValidElement=eg;Ne.lazy=function(e){return{$$typeof:VN,_payload:{_status:-1,_result:e},_init:KN}};Ne.memo=function(e,t){return{$$typeof:BN,type:e,compare:t===void 0?null:t}};Ne.startTransition=function(e){var t=Rc.transition;Rc.transition={};try{e()}finally{Rc.transition=t}};Ne.unstable_act=Nw;Ne.useCallback=function(e,t){return Lt.current.useCallback(e,t)};Ne.useContext=function(e){return Lt.current.useContext(e)};Ne.useDebugValue=function(){};Ne.useDeferredValue=function(e){return Lt.current.useDeferredValue(e)};Ne.useEffect=function(e,t){return Lt.current.useEffect(e,t)};Ne.useId=function(){return Lt.current.useId()};Ne.useImperativeHandle=function(e,t,n){return Lt.current.useImperativeHandle(e,t,n)};Ne.useInsertionEffect=function(e,t){return Lt.current.useInsertionEffect(e,t)};Ne.useLayoutEffect=function(e,t){return Lt.current.useLayoutEffect(e,t)};Ne.useMemo=function(e,t){return Lt.current.useMemo(e,t)};Ne.useReducer=function(e,t,n){return Lt.current.useReducer(e,t,n)};Ne.useRef=function(e){return Lt.current.useRef(e)};Ne.useState=function(e){return Lt.current.useState(e)};Ne.useSyncExternalStore=function(e,t,n){return Lt.current.useSyncExternalStore(e,t,n)};Ne.useTransition=function(){return Lt.current.useTransition()};Ne.version="18.3.1";xw.exports=Ne;var S=xw.exports;const Rw=mw(S),GN=MN({__proto__:null,default:Rw},[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 QN=S,XN=Symbol.for("react.element"),ZN=Symbol.for("react.fragment"),JN=Object.prototype.hasOwnProperty,eR=QN.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,tR={key:!0,ref:!0,__self:!0,__source:!0};function Tw(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)JN.call(t,r)&&!tR.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:XN,type:e,key:o,ref:i,props:s,_owner:eR.current}}Yu.Fragment=ZN;Yu.jsx=Tw;Yu.jsxs=Tw;yw.exports=Yu;var h=yw.exports;const Pw=S.createContext(void 0),fo=e=>{const t=S.useContext(Pw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},t6=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(Pw.Provider,{value:e,children:t})),nR={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var Gr,Qp,rw,rR=(rw=class{constructor(){oe(this,Gr,nR);oe(this,Qp,!1)}setTimeoutProvider(e){ee(this,Gr,e)}setTimeout(e,t){return D(this,Gr).setTimeout(e,t)}clearTimeout(e){D(this,Gr).clearTimeout(e)}setInterval(e,t){return D(this,Gr).setInterval(e,t)}clearInterval(e){D(this,Gr).clearInterval(e)}},Gr=new WeakMap,Qp=new WeakMap,rw);const js=new rR;function sR(e){setTimeout(e,0)}const oR=typeof window>"u"||"Deno"in globalThis;function Pt(){}function iR(e,t){return typeof e=="function"?e(t):e}function Iw(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ow(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ze(e,t){return typeof e=="function"?e(t):e}function N0(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:i,stale:l}=e;if(i){if(r){if(t.queryHash!==tg(i,t.options))return!1}else if(!mi(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 R0(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(eo(t.options.mutationKey)!==eo(o))return!1}else if(!mi(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function tg(e,t){return((t==null?void 0:t.queryKeyHashFn)||eo)(e)}function eo(e){return JSON.stringify(e,(t,n)=>Xf(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function mi(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(!mi(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!mi(e[r],t[r]))return!1;return!0}return!1}const lR=Object.prototype.hasOwnProperty;function ng(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=T0(e)&&T0(t);if(!r&&!(Xf(e)&&Xf(t)))return t;const s=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),i=o.length,l=r?new Array(i):{};let a=0;for(let c=0;c<i;c++){const u=r?c:o[c],d=e[u],f=t[u];if(d===f){l[u]=d,(r?c<s:lR.call(e,u))&&a++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){l[u]=f;continue}const p=ng(d,f,n+1);l[u]=p,p===d&&a++}return s===i&&a===s?e:l}function ml(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 T0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Xf(e){if(!P0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!P0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function P0(e){return Object.prototype.toString.call(e)==="[object Object]"}function aR(e){return new Promise(t=>{js.setTimeout(t,e)})}function Zf(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?ng(e,t):t}function cR(e){return e}function uR(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function dR(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}const rg=Symbol();function _w(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===rg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function sg(e,t){return typeof e=="function"?e(...t):!!e}function fR(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}let hR=()=>oR;const og=()=>hR();var 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(){}},$s,Qr,ti,sw,pR=(sw=class extends ho{constructor(){super();oe(this,$s);oe(this,Qr);oe(this,ti);ee(this,ti,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){D(this,Qr)||this.setEventListener(D(this,ti))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,Qr))==null||t.call(this),ee(this,Qr,void 0))}setEventListener(t){var n;ee(this,ti,t),(n=D(this,Qr))==null||n.call(this),ee(this,Qr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){D(this,$s)!==t&&(ee(this,$s,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof D(this,$s)=="boolean"?D(this,$s):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},$s=new WeakMap,Qr=new WeakMap,ti=new WeakMap,sw);const ig=new pR,gR=sR;function mR(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=gR;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}}}const et=mR();var ni,Xr,ri,ow,yR=(ow=class extends ho{constructor(){super();oe(this,ni,!0);oe(this,Xr);oe(this,ri);ee(this,ri,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(){D(this,Xr)||this.setEventListener(D(this,ri))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,Xr))==null||t.call(this),ee(this,Xr,void 0))}setEventListener(t){var n;ee(this,ri,t),(n=D(this,Xr))==null||n.call(this),ee(this,Xr,t(this.setOnline.bind(this)))}setOnline(t){D(this,ni)!==t&&(ee(this,ni,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return D(this,ni)}},ni=new WeakMap,Xr=new WeakMap,ri=new WeakMap,ow);const Kc=new yR;function xR(e){return Math.min(1e3*2**e,3e4)}function Mw(e){return(e??"online")==="online"?Kc.isOnline():!0}var Jf=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function jw(e){let t=!1,n=0,r,s="pending",o,i;const l=new Promise((g,y)=>{o=g,i=y});l.catch(Pt);const a=()=>s!=="pending",c=g=>{var y;if(!a()){const w=new Jf(g);v(w),(y=e.onCancel)==null||y.call(e,w)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>ig.isFocused()&&(e.networkMode==="always"||Kc.isOnline())&&e.canRun(),p=()=>Mw(e.networkMode)&&e.canRun(),x=g=>{a()||(r==null||r(),s="resolved",o(g))},v=g=>{a()||(r==null||r(),s="rejected",i(g))},b=()=>new Promise(g=>{var y;r=w=>{(a()||f())&&g(w)},(y=e.onPause)==null||y.call(e)}).then(()=>{var g;r=void 0,a()||(g=e.onContinue)==null||g.call(e)}),m=()=>{if(a())return;let g;const y=n===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(w){g=Promise.reject(w)}Promise.resolve(g).then(x).catch(w=>{var I;if(a())return;const E=e.retry??(og()?0:3),N=e.retryDelay??xR,k=typeof N=="function"?N(n,w):N,C=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,w);if(t||!C){v(w);return}n++,(I=e.onFail)==null||I.call(e,n,w),aR(k).then(()=>f()?void 0:b()).then(()=>{t?v(w):m()})})};return{promise:l,status:()=>s,cancel:c,continue:()=>(r==null||r(),l),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?m():b().then(m),l)}}var Ls,iw,Aw=(iw=class{constructor(){oe(this,Ls)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Iw(this.gcTime)&&ee(this,Ls,js.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(og()?1/0:3e5))}clearGcTimeout(){D(this,Ls)!==void 0&&(js.clearTimeout(D(this,Ls)),ee(this,Ls,void 0))}},Ls=new WeakMap,iw);function vR(e){return{onFetch:(t,n)=>{var u,d,f,p,x;const r=t.options,s=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,o=((p=t.state.data)==null?void 0:p.pages)||[],i=((x=t.state.data)==null?void 0:x.pageParams)||[];let l={pages:[],pageParams:[]},a=0;const c=async()=>{let v=!1;const b=y=>{fR(y,()=>t.signal,()=>v=!0)},m=_w(t.options,t.fetchOptions),g=async(y,w,E)=>{if(v)return Promise.reject(t.signal.reason);if(w==null&&y.pages.length)return Promise.resolve(y);const k=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:w,direction:E?"backward":"forward",meta:t.options.meta};return b(A),A})(),C=await m(k),{maxPages:I}=t.options,P=E?dR:uR;return{pages:P(y.pages,C,I),pageParams:P(y.pageParams,w,I)}};if(s&&o.length){const y=s==="backward",w=y?zw:eh,E={pages:o,pageParams:i};l=await g(E,w(r,E),y)}else{const y=e??o.length;do{const w=a===0?i[0]??r.initialPageParam:eh(r,l);if(a>0&&w==null)break;l=await g(l,w),a++}while(a<y)}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 eh(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 zw(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 wR(e,t){return t?eh(e,t)!=null:!1}function bR(e,t){return!t||!e.getPreviousPageParam?!1:zw(e,t)!=null}var si,Hs,oi,fn,Bs,at,ca,Vs,Tn,ar,lw,SR=(lw=class extends Aw{constructor(t){super();oe(this,Tn);oe(this,si);oe(this,Hs);oe(this,oi);oe(this,fn);oe(this,Bs);oe(this,at);oe(this,ca);oe(this,Vs);ee(this,Vs,!1),ee(this,ca,t.defaultOptions),this.setOptions(t.options),this.observers=[],ee(this,Bs,t.client),ee(this,fn,D(this,Bs).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,Hs,O0(this.options)),this.state=t.state??D(this,Hs),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return D(this,si)}get promise(){var t;return(t=D(this,at))==null?void 0:t.promise}setOptions(t){if(this.options={...D(this,ca),...t},t!=null&&t._type&&ee(this,si,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=O0(this.options);n.data!==void 0&&(this.setState(I0(n.data,n.dataUpdatedAt)),ee(this,Hs,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&D(this,fn).remove(this)}setData(t,n){const r=Zf(this.state.data,t,this.options);return he(this,Tn,ar).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){he(this,Tn,ar).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=D(this,at))==null?void 0:r.promise;return(s=D(this,at))==null||s.cancel(t),n?n.then(Pt).catch(Pt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return D(this,Hs)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ze(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===rg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ze(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:!Ow(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=D(this,at))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=D(this,at))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),D(this,fn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&(this.observers.splice(n,1),this.observers.length||(D(this,at)&&(D(this,Vs)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?D(this,at).cancel({revert:!0}):D(this,at).cancelRetry()),this.scheduleGc()),D(this,fn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||he(this,Tn,ar).call(this,{type:"invalidate"})}async fetch(t,n){var c,u,d,f,p,x,v,b,m,g,y,w;if(this.state.fetchStatus!=="idle"&&((c=D(this,at))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(D(this,at))return D(this,at).continueRetry(),D(this,at).promise}if(t&&this.setOptions(t),!this.options.queryFn){const E=this.observers.find(N=>N.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,s=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(ee(this,Vs,!0),r.signal)})},o=()=>{const E=_w(this.options,n),k=(()=>{const C={client:D(this,Bs),queryKey:this.queryKey,meta:this.meta};return s(C),C})();return ee(this,Vs,!1),this.options.persister?this.options.persister(E,k,this):E(k)},l=(()=>{const E={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:D(this,Bs),state:this.state,fetchFn:o};return s(E),E})();(u=D(this,si)==="infinite"?vR(this.options.pages):this.options.behavior)==null||u.onFetch(l,this),ee(this,oi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&he(this,Tn,ar).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const a=ee(this,at,jw({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:E=>{E instanceof Jf&&E.revert&&this.setState({...D(this,oi),fetchStatus:"idle"}),r.abort()},onFail:(E,N)=>{he(this,Tn,ar).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{he(this,Tn,ar).call(this,{type:"pause"})},onContinue:()=>{he(this,Tn,ar).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const E=await a.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(x=(p=D(this,fn).config).onSuccess)==null||x.call(p,E,this),(b=(v=D(this,fn).config).onSettled)==null||b.call(v,E,this.state.error,this),E}catch(E){if(E instanceof Jf){if(E.silent)return D(this,at).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw he(this,Tn,ar).call(this,{type:"error",error:E}),(g=(m=D(this,fn).config).onError)==null||g.call(m,E,this),(w=(y=D(this,fn).config).onSettled)==null||w.call(y,this.state.data,E,this),E}finally{D(this,at)===a&&ee(this,at,void 0),this.scheduleGc()}}},si=new WeakMap,Hs=new WeakMap,oi=new WeakMap,fn=new WeakMap,Bs=new WeakMap,at=new WeakMap,ca=new WeakMap,Vs=new WeakMap,Tn=new WeakSet,ar=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,...Dw(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...I0(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,oi,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),et.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),D(this,fn).notify({query:this,type:"updated",action:t})})},lw);function Dw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Mw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function I0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function O0(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 jt,Te,ua,At,Ws,ii,fr,da,li,ai,Us,qs,Zr,ci,Me,ll,th,nh,rh,sh,oh,ih,lh,ah,aw,Gu=(aw=class extends ho{constructor(t,n){super();oe(this,Me);oe(this,jt);oe(this,Te);oe(this,ua);oe(this,At);oe(this,Ws);oe(this,ii);oe(this,fr);oe(this,da);oe(this,li);oe(this,ai);oe(this,Us);oe(this,qs);oe(this,Zr);oe(this,ci,new Set);this.options=n,ee(this,jt,t),ee(this,fr,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(D(this,Te).addObserver(this),_0(D(this,Te),this.options)?he(this,Me,ll).call(this):this.updateResult(),he(this,Me,oh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ch(D(this,Te),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ch(D(this,Te),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,he(this,Me,ih).call(this),he(this,Me,lh).call(this),D(this,Te).removeObserver(this)}setOptions(t){const n=this.options,r=D(this,Te);if(this.options=D(this,jt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ze(this.options.enabled,D(this,Te))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");he(this,Me,ah).call(this),D(this,Te).setOptions(this.options),n._defaulted&&!ml(this.options,n)&&D(this,jt).getQueryCache().notify({type:"observerOptionsUpdated",query:D(this,Te),observer:this});const s=this.hasListeners();s&&M0(D(this,Te),r,this.options,n)&&he(this,Me,ll).call(this),this.updateResult(),s&&(D(this,Te)!==r||Ze(this.options.enabled,D(this,Te))!==Ze(n.enabled,D(this,Te))||Ze(this.options.staleTime,D(this,Te))!==Ze(n.staleTime,D(this,Te)))&&he(this,Me,nh).call(this);const o=he(this,Me,rh).call(this);s&&(D(this,Te)!==r||Ze(this.options.enabled,D(this,Te))!==Ze(n.enabled,D(this,Te))||o!==D(this,Zr))&&he(this,Me,sh).call(this,o)}getOptimisticResult(t){const n=D(this,jt).getQueryCache().build(D(this,jt),t),r=this.createResult(n,t);return ml(this.getCurrentResult(),r)||(ee(this,At,r),ee(this,ii,this.options),ee(this,Ws,D(this,Te).state)),r}getCurrentResult(){return D(this,At)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(t){D(this,ci).add(t)}getCurrentQuery(){return D(this,Te)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=D(this,jt).defaultQueryOptions(t),r=D(this,jt).getQueryCache().build(D(this,jt),n);let s=()=>{},o;const i=new Promise(l=>{o=l,s=D(this,jt).getQueryCache().subscribe(a=>{a.type==="updated"&&a.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),l(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const l=this.createResult(r,n);return o==null||o(l),l}).finally(()=>{s()}),i])}fetch(t){return he(this,Me,ll).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),D(this,At)))}createResult(t,n){var N;const r=D(this,Te),s=this.options,o=D(this,At),i=D(this,Ws),l=D(this,ii),a=t!==r?t.state:D(this,ua),{state:c}=t;let u={...c},d=!1,f;if(n._optimisticResults){const k=this.hasListeners(),C=!k&&_0(t,n),I=k&&M0(t,r,n,s);(C||I)&&(u={...u,...Dw(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:p,errorUpdatedAt:x,status:v}=u;f=u.data;let b=!1;if(n.placeholderData!==void 0&&f===void 0&&v==="pending"){let k;o!=null&&o.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(k=o.data,b=!0):k=typeof n.placeholderData=="function"?n.placeholderData((N=D(this,ai))==null?void 0:N.state.data,D(this,ai)):n.placeholderData,k!==void 0&&(v="success",f=Zf(o==null?void 0:o.data,k,n),d=!0)}if(n.select&&f!==void 0&&!b)if(o&&f===(i==null?void 0:i.data)&&n.select===D(this,da))f=D(this,li);else try{ee(this,da,n.select),f=n.select(f),f=Zf(o==null?void 0:o.data,f,n),ee(this,li,f),ee(this,fr,null)}catch(k){ee(this,fr,k)}else f===void 0&&ee(this,fr,null);D(this,fr)&&(p=D(this,fr),f=D(this,li),x=Date.now(),v="error",d=!1);const m=u.fetchStatus==="fetching",g=v==="pending",y=v==="error",w=g&&m,E=f!==void 0;return{status:v,fetchStatus:u.fetchStatus,isPending:g,isSuccess:v==="success",isError:y,isInitialLoading:w,isLoading:w,data:f,dataUpdatedAt:u.dataUpdatedAt,error:p,errorUpdatedAt:x,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:m,isRefetching:m&&!g,isLoadingError:y&&!E,isPaused:u.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:y&&E,isStale:lg(t,n),refetch:this.refetch,isEnabled:Ze(n.enabled,t)!==!1}}updateResult(){const t=D(this,At),n=this.createResult(D(this,Te),this.options);if(ee(this,Ws,D(this,Te).state),ee(this,ii,this.options),D(this,Ws).data!==void 0&&ee(this,ai,D(this,Te)),ml(n,t))return;ee(this,At,n);const s=(()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,i=typeof o=="function"?o():o;if(i==="all"||!i&&!D(this,ci).size)return!0;const l=new Set(i??D(this,ci));return this.options.throwOnError&&l.add("error"),Object.keys(D(this,At)).some(a=>{const c=a;return D(this,At)[c]!==t[c]&&l.has(c)})})();et.batch(()=>{s&&this.listeners.forEach(o=>{o(D(this,At))}),D(this,jt).getQueryCache().notify({query:D(this,Te),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&he(this,Me,oh).call(this)}},jt=new WeakMap,Te=new WeakMap,ua=new WeakMap,At=new WeakMap,Ws=new WeakMap,ii=new WeakMap,fr=new WeakMap,da=new WeakMap,li=new WeakMap,ai=new WeakMap,Us=new WeakMap,qs=new WeakMap,Zr=new WeakMap,ci=new WeakMap,Me=new WeakSet,ll=function(t){he(this,Me,ah).call(this);let n=D(this,Te).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Pt)),n},th=function(t){return!og()&&Ze(this.options.enabled,D(this,Te))!==!1&&Iw(t)},nh=function(){he(this,Me,ih).call(this);const t=Ze(this.options.staleTime,D(this,Te));if(D(this,At).isStale||!he(this,Me,th).call(this,t))return;const n=Ow(D(this,At).dataUpdatedAt,t)+1;ee(this,Us,js.setTimeout(()=>{D(this,At).isStale||this.updateResult()},n))},rh=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(D(this,Te)):this.options.refetchInterval)??!1},sh=function(t){he(this,Me,lh).call(this),ee(this,Zr,t),!(D(this,Zr)===0||!he(this,Me,th).call(this,D(this,Zr)))&&ee(this,qs,js.setInterval(()=>{(this.options.refetchIntervalInBackground||ig.isFocused())&&he(this,Me,ll).call(this)},D(this,Zr)))},oh=function(){he(this,Me,nh).call(this),he(this,Me,sh).call(this,he(this,Me,rh).call(this))},ih=function(){D(this,Us)!==void 0&&(js.clearTimeout(D(this,Us)),ee(this,Us,void 0))},lh=function(){D(this,qs)!==void 0&&(js.clearInterval(D(this,qs)),ee(this,qs,void 0))},ah=function(){const t=D(this,jt).getQueryCache().build(D(this,jt),this.options);if(t===D(this,Te))return;const n=D(this,Te);ee(this,Te,t),ee(this,ua,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},aw);function ER(e,t){return Ze(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ze(t.retryOnMount,e)===!1)}function _0(e,t){return ER(e,t)||e.state.data!==void 0&&ch(e,t,t.refetchOnMount)}function ch(e,t,n){if(Ze(t.enabled,e)!==!1&&Ze(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&lg(e,t)}return!1}function M0(e,t,n,r){return(e!==t||Ze(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&lg(e,n)}function lg(e,t){return Ze(t.enabled,e)!==!1&&e.isStaleByTime(Ze(t.staleTime,e))}var kR=class extends Gu{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 p,x;const{state:n}=e,r=super.createResult(e,t),{isFetching:s,isRefetching:o,isError:i,isRefetchError:l}=r,a=(x=(p=n.fetchMeta)==null?void 0:p.fetchMore)==null?void 0:x.direction,c=i&&a==="forward",u=s&&a==="forward",d=i&&a==="backward",f=s&&a==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:wR(t,n.data),hasPreviousPage:bR(t,n.data),isFetchNextPageError:c,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:l&&!c&&!d,isRefetching:o&&!u&&!f}}},fa,Kn,Rt,Ks,Yn,Br,cw,CR=(cw=class extends Aw{constructor(t){super();oe(this,Yn);oe(this,fa);oe(this,Kn);oe(this,Rt);oe(this,Ks);ee(this,fa,t.client),this.mutationId=t.mutationId,ee(this,Rt,t.mutationCache),ee(this,Kn,[]),this.state=t.state||Fw(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){D(this,Kn).includes(t)||(D(this,Kn).push(t),this.clearGcTimeout(),D(this,Rt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,Kn,D(this,Kn).filter(n=>n!==t)),this.scheduleGc(),D(this,Rt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){D(this,Kn).length||(this.state.status==="pending"?this.scheduleGc():D(this,Rt).remove(this))}continue(){var t;return((t=D(this,Ks))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var l,a,c,u,d,f,p,x,v,b,m,g,y,w,E,N,k,C;const n=()=>{he(this,Yn,Br).call(this,{type:"continue"})},r={client:D(this,fa),meta:this.options.meta,mutationKey:this.options.mutationKey},s=ee(this,Ks,jw({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(I,P)=>{he(this,Yn,Br).call(this,{type:"failed",failureCount:I,error:P})},onPause:()=>{he(this,Yn,Br).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>D(this,Rt).canRun(this)})),o=this.state.status==="pending",i=!s.canStart();try{if(o)n();else{he(this,Yn,Br).call(this,{type:"pending",variables:t,isPaused:i}),D(this,Rt).config.onMutate&&await D(this,Rt).config.onMutate(t,this,r);const P=await((a=(l=this.options).onMutate)==null?void 0:a.call(l,t,r));P!==this.state.context&&he(this,Yn,Br).call(this,{type:"pending",context:P,variables:t,isPaused:i})}const I=await s.start();return await((u=(c=D(this,Rt).config).onSuccess)==null?void 0:u.call(c,I,t,this.state.context,this,r)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,I,t,this.state.context,r)),await((x=(p=D(this,Rt).config).onSettled)==null?void 0:x.call(p,I,null,this.state.variables,this.state.context,this,r)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,I,null,t,this.state.context,r)),he(this,Yn,Br).call(this,{type:"success",data:I}),I}catch(I){try{await((g=(m=D(this,Rt).config).onError)==null?void 0:g.call(m,I,t,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((w=(y=this.options).onError)==null?void 0:w.call(y,I,t,this.state.context,r))}catch(P){Promise.reject(P)}try{await((N=(E=D(this,Rt).config).onSettled)==null?void 0:N.call(E,void 0,I,this.state.variables,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((C=(k=this.options).onSettled)==null?void 0:C.call(k,void 0,I,t,this.state.context,r))}catch(P){Promise.reject(P)}throw he(this,Yn,Br).call(this,{type:"error",error:I}),I}finally{D(this,Ks)===s&&ee(this,Ks,void 0),D(this,Rt).runNext(this)}}},fa=new WeakMap,Kn=new WeakMap,Rt=new WeakMap,Ks=new WeakMap,Yn=new WeakSet,Br=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),et.batch(()=>{D(this,Kn).forEach(r=>{r.onMutationUpdate(t)}),D(this,Rt).notify({mutation:this,type:"updated",action:t})})},cw);function Fw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var hr,Pn,ha,uw,NR=(uw=class extends ho{constructor(t={}){super();oe(this,hr);oe(this,Pn);oe(this,ha);this.config=t,ee(this,hr,new Set),ee(this,Pn,new Map),ee(this,ha,0)}build(t,n,r){const s=new CR({client:t,mutationCache:this,mutationId:++Fa(this,ha)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){D(this,hr).add(t);const n=La(t);if(typeof n=="string"){const r=D(this,Pn).get(n);r?r.push(t):D(this,Pn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(D(this,hr).delete(t)){const n=La(t);if(typeof n=="string"){const r=D(this,Pn).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&D(this,Pn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=La(t);if(typeof n=="string"){const s=(r=D(this,Pn).get(n))==null?void 0:r.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r,s;const n=La(t);return typeof n=="string"?((s=(r=D(this,Pn).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){et.batch(()=>{D(this,hr).forEach(t=>{this.notify({type:"removed",mutation:t})}),D(this,hr).clear(),D(this,Pn).clear()})}getAll(){return Array.from(D(this,hr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>R0(n,r))}findAll(t={}){return this.getAll().filter(n=>R0(t,n))}notify(t){et.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return et.batch(()=>Promise.all(t.map(n=>n.continue().catch(Pt))))}},hr=new WeakMap,Pn=new WeakMap,ha=new WeakMap,uw);function La(e){var t;return(t=e.options.scope)==null?void 0:t.id}var pr,Jr,Tt,gr,Zn,al,uh,dw,RR=(dw=class extends ho{constructor(n,r){super();oe(this,Zn);oe(this,pr);oe(this,Jr);oe(this,Tt);oe(this,gr);ee(this,pr,n),this.setOptions(r),this.bindMethods(),he(this,Zn,al).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=D(this,pr).defaultMutationOptions(n),ml(this.options,r)||D(this,pr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:D(this,Tt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&eo(r.mutationKey)!==eo(this.options.mutationKey)?this.reset():((s=D(this,Tt))==null?void 0:s.state.status)==="pending"&&D(this,Tt).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&D(this,Tt)&&(D(this,Tt).addObserver(this),he(this,Zn,al).call(this))}onUnsubscribe(){var n;this.hasListeners()||(n=D(this,Tt))==null||n.removeObserver(this)}onMutationUpdate(n){he(this,Zn,al).call(this),he(this,Zn,uh).call(this,n)}getCurrentResult(){return D(this,Jr)}reset(){var n;(n=D(this,Tt))==null||n.removeObserver(this),ee(this,Tt,void 0),he(this,Zn,al).call(this),he(this,Zn,uh).call(this)}mutate(n,r){var s;return ee(this,gr,r),(s=D(this,Tt))==null||s.removeObserver(this),ee(this,Tt,D(this,pr).getMutationCache().build(D(this,pr),this.options)),D(this,Tt).addObserver(this),D(this,Tt).execute(n)}},pr=new WeakMap,Jr=new WeakMap,Tt=new WeakMap,gr=new WeakMap,Zn=new WeakSet,al=function(){var r;const n=((r=D(this,Tt))==null?void 0:r.state)??Fw();ee(this,Jr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},uh=function(n){et.batch(()=>{var r,s,o,i,l,a,c,u;if(D(this,gr)&&this.hasListeners()){const d=D(this,Jr).variables,f=D(this,Jr).context,p={client:D(this,pr),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=D(this,gr)).onSuccess)==null||s.call(r,n.data,d,f,p)}catch(x){Promise.reject(x)}try{(i=(o=D(this,gr)).onSettled)==null||i.call(o,n.data,null,d,f,p)}catch(x){Promise.reject(x)}}else if((n==null?void 0:n.type)==="error"){try{(a=(l=D(this,gr)).onError)==null||a.call(l,n.error,d,f,p)}catch(x){Promise.reject(x)}try{(u=(c=D(this,gr)).onSettled)==null||u.call(c,void 0,n.error,d,f,p)}catch(x){Promise.reject(x)}}}this.listeners.forEach(d=>{d(D(this,Jr))})})},dw);function j0(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}var ui,zt,di,Ys,Zt,Gs,pa,ga,ma,ya,dt,dh,fh,$w,hh,ph,gh,fw,TR=(fw=class extends ho{constructor(t,n,r){super();oe(this,dt);oe(this,ui);oe(this,zt);oe(this,di);oe(this,Ys);oe(this,Zt);oe(this,Gs);oe(this,pa);oe(this,ga);oe(this,ma);oe(this,ya,[]);ee(this,ui,t),ee(this,Ys,r),ee(this,di,[]),ee(this,Zt,[]),ee(this,zt,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&D(this,Zt).forEach(t=>{t.subscribe(n=>{he(this,dt,ph).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,D(this,Zt).forEach(t=>{t.destroy()})}setQueries(t,n){ee(this,di,t),ee(this,Ys,n),et.batch(()=>{const r=D(this,Zt),s=he(this,dt,hh).call(this,D(this,di));s.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const o=s.map(d=>d.observer),i=o.map(d=>d.getCurrentResult()),l=r.length!==o.length,a=o.some((d,f)=>d!==r[f]),c=l||a,u=c?!0:i.some((d,f)=>{const p=D(this,zt)[f];return!p||!ml(d,p)});!c&&!u||(c&&(ee(this,ya,s),ee(this,Zt,o)),ee(this,zt,i),this.hasListeners()&&(c&&(j0(r,o).forEach(d=>{d.destroy()}),j0(o,r).forEach(d=>{d.subscribe(f=>{he(this,dt,ph).call(this,d,f)})})),he(this,dt,gh).call(this)))})}getCurrentResult(){return D(this,zt)}getQueries(){return D(this,Zt).map(t=>t.getCurrentQuery())}getObservers(){return D(this,Zt)}getOptimisticResult(t,n){const r=he(this,dt,hh).call(this,t),s=r.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions)),o=r.map(i=>i.defaultedQueryOptions.queryHash);return[s,i=>he(this,dt,fh).call(this,i??s,n,o),()=>he(this,dt,dh).call(this,s,r)]}},ui=new WeakMap,zt=new WeakMap,di=new WeakMap,Ys=new WeakMap,Zt=new WeakMap,Gs=new WeakMap,pa=new WeakMap,ga=new WeakMap,ma=new WeakMap,ya=new WeakMap,dt=new WeakSet,dh=function(t,n){const r=new Set;return n.map((s,o)=>{const i=t[o];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,l=>{r.has(l)||(r.add(l),n.forEach(a=>{a.observer.trackProp(l)}))})})},fh=function(t,n,r){if(n){const s=D(this,ma),o=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((i,l)=>i!==s[l]));return(D(this,zt)!==D(this,ga)||o||n!==D(this,pa))&&(ee(this,pa,n),ee(this,ga,D(this,zt)),r!==void 0&&ee(this,ma,r),ee(this,Gs,ng(D(this,Gs),n(t)))),D(this,Gs)}return t},$w=function(){var t;return!((t=D(this,Ys))!=null&&t.combine)||D(this,Zt).some((n,r)=>{var s;return n.options.suspense&&((s=D(this,zt)[r])==null?void 0:s.data)===void 0})},hh=function(t){const n=new Map;D(this,Zt).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 l;const o=D(this,ui).defaultQueryOptions(s),i=((l=n.get(o.queryHash))==null?void 0:l.shift())??new Gu(D(this,ui),o);r.push({defaultedQueryOptions:o,observer:i})}),r},ph=function(t,n){const r=D(this,Zt).indexOf(t);r!==-1&&(ee(this,zt,D(this,zt).slice()),D(this,zt)[r]=n,he(this,dt,gh).call(this))},gh=function(){var t;if(this.hasListeners()){const n=he(this,dt,$w).call(this),r=D(this,Gs),s=n?r:he(this,dt,fh).call(this,he(this,dt,dh).call(this,D(this,zt),D(this,ya)),(t=D(this,Ys))==null?void 0:t.combine);(n||r!==s)&&et.batch(()=>{this.listeners.forEach(o=>{o(D(this,zt))})})}},fw),Gn,hw,PR=(hw=class extends ho{constructor(t={}){super();oe(this,Gn);this.config=t,ee(this,Gn,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??tg(s,n);let i=this.get(o);return i||(i=new SR({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(i)),i}add(t){D(this,Gn).has(t.queryHash)||(D(this,Gn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=D(this,Gn).get(t.queryHash);n&&(t.destroy(),n===t&&D(this,Gn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){et.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return D(this,Gn).get(t)}getAll(){return[...D(this,Gn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>N0(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>N0(t,r)):n}notify(t){et.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){et.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){et.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Gn=new WeakMap,hw),Ke,es,ts,fi,hi,ns,pi,gi,pw,r6=(pw=class{constructor(e={}){oe(this,Ke);oe(this,es);oe(this,ts);oe(this,fi);oe(this,hi);oe(this,ns);oe(this,pi);oe(this,gi);ee(this,Ke,e.queryCache||new PR),ee(this,es,e.mutationCache||new NR),ee(this,ts,e.defaultOptions||{}),ee(this,fi,new Map),ee(this,hi,new Map),ee(this,ns,0)}mount(){Fa(this,ns)._++,D(this,ns)===1&&(ee(this,pi,ig.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,Ke).onFocus())})),ee(this,gi,Kc.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,Ke).onOnline())})))}unmount(){var e,t;Fa(this,ns)._--,D(this,ns)===0&&((e=D(this,pi))==null||e.call(this),ee(this,pi,void 0),(t=D(this,gi))==null||t.call(this),ee(this,gi,void 0))}isFetching(e){return D(this,Ke).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return D(this,es).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=D(this,Ke).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=D(this,Ke).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ze(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return D(this,Ke).findAll(e).map(({queryKey:t,state:n})=>[t,n.data])}setQueryData(e,t,n){var i;const r=this.defaultQueryOptions({queryKey:e}),s=(i=D(this,Ke).get(r.queryHash))==null?void 0:i.state.data,o=iR(t,s);if(o!==void 0)return D(this,Ke).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return et.batch(()=>D(this,Ke).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=D(this,Ke).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=D(this,Ke);et.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=D(this,Ke);return et.batch(()=>{const r=n.findAll(e),s=new Set(r);return r.forEach(o=>{o.reset()}),this.refetchQueries({type:"active",predicate:o=>s.has(o)},t)})}cancelQueries(e,t={}){const n={revert:!0,...t},r=et.batch(()=>D(this,Ke).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Pt).catch(Pt)}invalidateQueries(e,t={}){return et.batch(()=>(D(this,Ke).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=et.batch(()=>D(this,Ke).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Pt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Pt)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=D(this,Ke).build(this,t),r=n.isStaleByTime(Ze(t.staleTime,n))?await n.fetch(t):n.state.data,s=t.select;return s?s(r):r}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=D(this,Ke).build(this,t);return n.isStaleByTime(Ze(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Pt).catch(Pt)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Pt).catch(Pt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Kc.isOnline()?D(this,es).resumePausedMutations():Promise.resolve()}getQueryCache(){return D(this,Ke)}getMutationCache(){return D(this,es)}getDefaultOptions(){return D(this,ts)}setDefaultOptions(e){ee(this,ts,e)}setQueryDefaults(e,t){D(this,fi).set(eo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...D(this,fi).values()],n={};return t.forEach(r=>{mi(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){D(this,hi).set(eo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...D(this,hi).values()],n={};return t.forEach(r=>{mi(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...D(this,ts).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=tg(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===rg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...D(this,ts).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){D(this,Ke).clear(),D(this,es).clear()}},Ke=new WeakMap,es=new WeakMap,ts=new WeakMap,fi=new WeakMap,hi=new WeakMap,ns=new WeakMap,pi=new WeakMap,gi=new WeakMap,pw);const Lw=S.createContext(!1),Hw=()=>S.useContext(Lw);Lw.Provider;function IR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const OR=S.createContext(IR()),Bw=()=>S.useContext(OR),Vw=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?sg(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Ww=e=>{S.useEffect(()=>{e.clearReset()},[e])},Uw=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||sg(n,[e.error,r])),qw=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))}},mh=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Kw=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ag({queries:e,...t},n){const r=fo(),s=Hw(),o=Bw(),i=t.subscribed!==!1,l=S.useMemo(()=>e.map(v=>{const b=r.defaultQueryOptions(v);return b._optimisticResults=s?"isRestoring":i?"optimistic":void 0,b}),[e,r,s,i]);l.forEach(v=>{qw(v);const b=r.getQueryCache().get(v.queryHash);Vw(v,o,b)}),Ww(o);const[a]=S.useState(()=>new TR(r,l,t)),[c,u,d]=a.getOptimisticResult(l,t.combine),f=!s&&i;S.useSyncExternalStore(S.useCallback(v=>f?a.subscribe(et.batchCalls(v)):Pt,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),S.useEffect(()=>{a.setQueries(l,t)},[l,t,a]);const p=c.some((v,b)=>mh(l[b],v))?c.flatMap((v,b)=>{const m=l[b];if(m&&mh(m,v)){const g=new Gu(r,m);return Kw(m,g,o)}return[]}):[];if(p.length>0)throw Promise.all(p);const x=c.find((v,b)=>{const m=l[b];return m&&Uw({result:v,errorResetBoundary:o,throwOnError:m.throwOnError,query:r.getQueryCache().get(m.queryHash),suspense:m.suspense})});if(x)throw x.error;return u(d())}function Yw(e,t,n){const r=Hw(),s=Bw(),o=fo(),i=o.defaultQueryOptions(e),l=o.getQueryCache().get(i.queryHash),a=e.subscribed!==!1;i._optimisticResults=r?"isRestoring":a?"optimistic":void 0,qw(i),Vw(i,s,l),Ww(s);const[c]=S.useState(()=>new t(o,i)),u=c.getOptimisticResult(i),d=!r&&a;if(S.useSyncExternalStore(S.useCallback(f=>{const p=d?c.subscribe(et.batchCalls(f)):Pt;return c.updateResult(),p},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),S.useEffect(()=>{c.setOptions(i)},[i,c]),mh(i,u))throw Kw(i,c,s);if(Uw({result:u,errorResetBoundary:s,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw u.error;return i.notifyOnChangeProps?u:c.trackResult(u)}function nn(e,t){return Yw(e,Gu)}function Ms(e,t){const n=fo(),[r]=S.useState(()=>new RR(n,e));S.useEffect(()=>{r.setOptions(e)},[r,e]);const s=S.useSyncExternalStore(S.useCallback(i=>r.subscribe(et.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=S.useCallback((...i)=>{r.mutate(i[0],i[1]).catch(Pt)},[r]);if(s.error&&sg(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}function _R(e,t){return Yw(e,kR)}var Gw={exports:{}},cn={},Qw={exports:{}},Xw={};/**
|
|
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,j){var M=T.length;T.push(j);e:for(;0<M;){var U=M-1>>>1,H=T[U];if(0<s(H,j))T[U]=j,T[M]=H,M=U;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var j=T[0],M=T.pop();if(M!==j){T[0]=M;e:for(var U=0,H=T.length,V=H>>>1;U<V;){var W=2*(U+1)-1,q=T[W],B=W+1,K=T[B];if(0>s(q,M))B<H&&0>s(K,q)?(T[U]=K,T[B]=M,U=B):(T[U]=q,T[W]=M,U=W);else if(B<H&&0>s(K,M))T[U]=K,T[B]=M,U=B;else break e}}return j}function s(T,j){var M=T.sortIndex-j.sortIndex;return M!==0?M:T.id-j.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,d=null,f=3,p=!1,x=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(T){for(var j=n(c);j!==null;){if(j.callback===null)r(c);else if(j.startTime<=T)r(c),j.sortIndex=j.expirationTime,t(a,j);else break;j=n(c)}}function w(T){if(v=!1,y(T),!x)if(n(a)!==null)x=!0,_(E);else{var j=n(c);j!==null&&$(w,j.startTime-T)}}function E(T,j){x=!1,v&&(v=!1,m(C),C=-1),p=!0;var M=f;try{for(y(j),d=n(a);d!==null&&(!(d.expirationTime>j)||T&&!A());){var U=d.callback;if(typeof U=="function"){d.callback=null,f=d.priorityLevel;var H=U(d.expirationTime<=j);j=e.unstable_now(),typeof H=="function"?d.callback=H:d===n(a)&&r(a),y(j)}else r(a);d=n(a)}if(d!==null)var V=!0;else{var W=n(c);W!==null&&$(w,W.startTime-j),V=!1}return V}finally{d=null,f=M,p=!1}}var N=!1,k=null,C=-1,I=5,P=-1;function A(){return!(e.unstable_now()-P<I)}function F(){if(k!==null){var T=e.unstable_now();P=T;var j=!0;try{j=k(!0,T)}finally{j?z():(N=!1,k=null)}}else N=!1}var z;if(typeof g=="function")z=function(){g(F)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,O=R.port2;R.port1.onmessage=F,z=function(){O.postMessage(null)}}else z=function(){b(F,0)};function _(T){k=T,N||(N=!0,z())}function $(T,j){C=b(function(){T(e.unstable_now())},j)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_continueExecution=function(){x||p||(x=!0,_(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"):I=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(T){switch(f){case 1:case 2:case 3:var j=3;break;default:j=f}var M=f;f=j;try{return T()}finally{f=M}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,j){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var M=f;f=T;try{return j()}finally{f=M}},e.unstable_scheduleCallback=function(T,j,M){var U=e.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?U+M:U):M=U,T){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=M+H,T={id:u++,callback:j,priorityLevel:T,startTime:M,expirationTime:H,sortIndex:-1},M>U?(T.sortIndex=M,t(c,T),n(a)===null&&T===n(c)&&(v?(m(C),C=-1):v=!0,$(w,M-U))):(T.sortIndex=H,t(a,T),x||p||(x=!0,_(E))),T},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(T){var j=f;return function(){var M=f;f=j;try{return T.apply(this,arguments)}finally{f=M}}}})(Xw);Qw.exports=Xw;var MR=Qw.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 jR=S,sn=MR;function Z(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 Zw=new Set,Ol={};function po(e,t){yi(e,t),yi(e+"Capture",t)}function yi(e,t){for(Ol[e]=t,e=0;e<t.length;e++)Zw.add(t[e])}var kr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yh=Object.prototype.hasOwnProperty,AR=/^[: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]*$/,A0={},z0={};function zR(e){return yh.call(z0,e)?!0:yh.call(A0,e)?!1:AR.test(e)?z0[e]=!0:(A0[e]=!0,!1)}function DR(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 FR(e,t,n,r){if(t===null||typeof t>"u"||DR(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 Ht(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 St={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){St[e]=new Ht(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];St[t]=new Ht(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){St[e]=new Ht(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){St[e]=new Ht(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){St[e]=new Ht(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){St[e]=new Ht(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){St[e]=new Ht(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){St[e]=new Ht(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){St[e]=new Ht(e,5,!1,e.toLowerCase(),null,!1,!1)});var cg=/[\-:]([a-z])/g;function ug(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(cg,ug);St[t]=new Ht(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(cg,ug);St[t]=new Ht(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(cg,ug);St[t]=new Ht(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){St[e]=new Ht(e,1,!1,e.toLowerCase(),null,!1,!1)});St.xlinkHref=new Ht("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){St[e]=new Ht(e,1,!1,e.toLowerCase(),null,!0,!0)});function dg(e,t,n,r){var s=St.hasOwnProperty(t)?St[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(FR(t,n,s,r)&&(n=null),r||s===null?zR(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 Or=jR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ha=Symbol.for("react.element"),Io=Symbol.for("react.portal"),Oo=Symbol.for("react.fragment"),fg=Symbol.for("react.strict_mode"),xh=Symbol.for("react.profiler"),Jw=Symbol.for("react.provider"),eb=Symbol.for("react.context"),hg=Symbol.for("react.forward_ref"),vh=Symbol.for("react.suspense"),wh=Symbol.for("react.suspense_list"),pg=Symbol.for("react.memo"),Vr=Symbol.for("react.lazy"),tb=Symbol.for("react.offscreen"),D0=Symbol.iterator;function Ki(e){return e===null||typeof e!="object"?null:(e=D0&&e[D0]||e["@@iterator"],typeof e=="function"?e:null)}var Qe=Object.assign,Qd;function cl(e){if(Qd===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Qd=t&&t[1]||""}return`
|
|
34
|
+
`+Qd+e}var Xd=!1;function Zd(e,t){if(!e||Xd)return"";Xd=!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{Xd=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?cl(e):""}function $R(e){switch(e.tag){case 5:return cl(e.type);case 16:return cl("Lazy");case 13:return cl("Suspense");case 19:return cl("SuspenseList");case 0:case 2:case 15:return e=Zd(e.type,!1),e;case 11:return e=Zd(e.type.render,!1),e;case 1:return e=Zd(e.type,!0),e;default:return""}}function bh(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 Oo:return"Fragment";case Io:return"Portal";case xh:return"Profiler";case fg:return"StrictMode";case vh:return"Suspense";case wh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case eb:return(e.displayName||"Context")+".Consumer";case Jw:return(e._context.displayName||"Context")+".Provider";case hg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case pg:return t=e.displayName||null,t!==null?t:bh(e.type)||"Memo";case Vr:t=e._payload,e=e._init;try{return bh(e(t))}catch{}}return null}function LR(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 bh(t);case 8:return t===fg?"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 ms(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function nb(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function HR(e){var t=nb(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 Ba(e){e._valueTracker||(e._valueTracker=HR(e))}function rb(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=nb(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Yc(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 Sh(e,t){var n=t.checked;return Qe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function F0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ms(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 sb(e,t){t=t.checked,t!=null&&dg(e,"checked",t,!1)}function Eh(e,t){sb(e,t);var n=ms(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")?kh(e,t.type,n):t.hasOwnProperty("defaultValue")&&kh(e,t.type,ms(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 kh(e,t,n){(t!=="number"||Yc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ul=Array.isArray;function Uo(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=""+ms(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 Ch(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Z(91));return Qe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function L0(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Z(92));if(ul(n)){if(1<n.length)throw Error(Z(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ms(n)}}function ob(e,t){var n=ms(t.value),r=ms(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 H0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ib(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 Nh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ib(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Va,lb=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(Va=Va||document.createElement("div"),Va.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Va.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function _l(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var yl={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},BR=["Webkit","ms","Moz","O"];Object.keys(yl).forEach(function(e){BR.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),yl[t]=yl[e]})});function ab(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||yl.hasOwnProperty(e)&&yl[e]?(""+t).trim():t+"px"}function cb(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=ab(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var VR=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 Rh(e,t){if(t){if(VR[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Z(62))}}function Th(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 gg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ih=null,qo=null,Ko=null;function B0(e){if(e=ba(e)){if(typeof Ih!="function")throw Error(Z(280));var t=e.stateNode;t&&(t=ed(t),Ih(e.stateNode,e.type,t))}}function ub(e){qo?Ko?Ko.push(e):Ko=[e]:qo=e}function db(){if(qo){var e=qo,t=Ko;if(Ko=qo=null,B0(e),t)for(e=0;e<t.length;e++)B0(t[e])}}function fb(e,t){return e(t)}function hb(){}var Jd=!1;function pb(e,t,n){if(Jd)return e(t,n);Jd=!0;try{return fb(e,t,n)}finally{Jd=!1,(qo!==null||Ko!==null)&&(hb(),db())}}function Ml(e,t){var n=e.stateNode;if(n===null)return null;var r=ed(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(Z(231,t,typeof n));return n}var Oh=!1;if(kr)try{var Yi={};Object.defineProperty(Yi,"passive",{get:function(){Oh=!0}}),window.addEventListener("test",Yi,Yi),window.removeEventListener("test",Yi,Yi)}catch{Oh=!1}function WR(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 xl=!1,Gc=null,Qc=!1,_h=null,UR={onError:function(e){xl=!0,Gc=e}};function qR(e,t,n,r,s,o,i,l,a){xl=!1,Gc=null,WR.apply(UR,arguments)}function KR(e,t,n,r,s,o,i,l,a){if(qR.apply(this,arguments),xl){if(xl){var c=Gc;xl=!1,Gc=null}else throw Error(Z(198));Qc||(Qc=!0,_h=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 gb(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 V0(e){if(go(e)!==e)throw Error(Z(188))}function YR(e){var t=e.alternate;if(!t){if(t=go(e),t===null)throw Error(Z(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 V0(s),e;if(o===r)return V0(s),t;o=o.sibling}throw Error(Z(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(Z(189))}}if(n.alternate!==r)throw Error(Z(190))}if(n.tag!==3)throw Error(Z(188));return n.stateNode.current===n?e:t}function mb(e){return e=YR(e),e!==null?yb(e):null}function yb(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=yb(e);if(t!==null)return t;e=e.sibling}return null}var xb=sn.unstable_scheduleCallback,W0=sn.unstable_cancelCallback,GR=sn.unstable_shouldYield,QR=sn.unstable_requestPaint,rt=sn.unstable_now,XR=sn.unstable_getCurrentPriorityLevel,mg=sn.unstable_ImmediatePriority,vb=sn.unstable_UserBlockingPriority,Xc=sn.unstable_NormalPriority,ZR=sn.unstable_LowPriority,wb=sn.unstable_IdlePriority,Qu=null,Jn=null;function JR(e){if(Jn&&typeof Jn.onCommitFiberRoot=="function")try{Jn.onCommitFiberRoot(Qu,e,void 0,(e.current.flags&128)===128)}catch{}}var An=Math.clz32?Math.clz32:nT,eT=Math.log,tT=Math.LN2;function nT(e){return e>>>=0,e===0?32:31-(eT(e)/tT|0)|0}var Wa=64,Ua=4194304;function dl(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 Zc(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=dl(l):(o&=i,o!==0&&(r=dl(o)))}else i=n&~s,i!==0?r=dl(i):o!==0&&(r=dl(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-An(t),s=1<<n,r|=e[n],t&=~s;return r}function rT(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 sT(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-An(o),l=1<<i,a=s[i];a===-1?(!(l&n)||l&r)&&(s[i]=rT(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 bb(){var e=Wa;return Wa<<=1,!(Wa&4194240)&&(Wa=64),e}function ef(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function va(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-An(t),e[t]=n}function oT(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-An(n),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function yg(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-An(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var ze=0;function Sb(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Eb,xg,kb,Cb,Nb,jh=!1,qa=[],is=null,ls=null,as=null,jl=new Map,Al=new Map,qr=[],iT="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 U0(e,t){switch(e){case"focusin":case"focusout":is=null;break;case"dragenter":case"dragleave":ls=null;break;case"mouseover":case"mouseout":as=null;break;case"pointerover":case"pointerout":jl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Al.delete(t.pointerId)}}function Gi(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=ba(t),t!==null&&xg(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function lT(e,t,n,r,s){switch(t){case"focusin":return is=Gi(is,e,t,n,r,s),!0;case"dragenter":return ls=Gi(ls,e,t,n,r,s),!0;case"mouseover":return as=Gi(as,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return jl.set(o,Gi(jl.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,Al.set(o,Gi(Al.get(o)||null,e,t,n,r,s)),!0}return!1}function Rb(e){var t=As(e.target);if(t!==null){var n=go(t);if(n!==null){if(t=n.tag,t===13){if(t=gb(n),t!==null){e.blockedOn=t,Nb(e.priority,function(){kb(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 Tc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ah(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=ba(n),t!==null&&xg(t),e.blockedOn=n,!1;t.shift()}return!0}function q0(e,t,n){Tc(e)&&n.delete(t)}function aT(){jh=!1,is!==null&&Tc(is)&&(is=null),ls!==null&&Tc(ls)&&(ls=null),as!==null&&Tc(as)&&(as=null),jl.forEach(q0),Al.forEach(q0)}function Qi(e,t){e.blockedOn===t&&(e.blockedOn=null,jh||(jh=!0,sn.unstable_scheduleCallback(sn.unstable_NormalPriority,aT)))}function zl(e){function t(s){return Qi(s,e)}if(0<qa.length){Qi(qa[0],e);for(var n=1;n<qa.length;n++){var r=qa[n];r.blockedOn===e&&(r.blockedOn=null)}}for(is!==null&&Qi(is,e),ls!==null&&Qi(ls,e),as!==null&&Qi(as,e),jl.forEach(t),Al.forEach(t),n=0;n<qr.length;n++)r=qr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<qr.length&&(n=qr[0],n.blockedOn===null);)Rb(n),n.blockedOn===null&&qr.shift()}var Yo=Or.ReactCurrentBatchConfig,Jc=!0;function cT(e,t,n,r){var s=ze,o=Yo.transition;Yo.transition=null;try{ze=1,vg(e,t,n,r)}finally{ze=s,Yo.transition=o}}function uT(e,t,n,r){var s=ze,o=Yo.transition;Yo.transition=null;try{ze=4,vg(e,t,n,r)}finally{ze=s,Yo.transition=o}}function vg(e,t,n,r){if(Jc){var s=Ah(e,t,n,r);if(s===null)df(e,t,r,eu,n),U0(e,r);else if(lT(s,e,t,n,r))r.stopPropagation();else if(U0(e,r),t&4&&-1<iT.indexOf(e)){for(;s!==null;){var o=ba(s);if(o!==null&&Eb(o),o=Ah(e,t,n,r),o===null&&df(e,t,r,eu,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else df(e,t,r,null,n)}}var eu=null;function Ah(e,t,n,r){if(eu=null,e=gg(r),e=As(e),e!==null)if(t=go(e),t===null)e=null;else if(n=t.tag,n===13){if(e=gb(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 eu=e,null}function Tb(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(XR()){case mg:return 1;case vb:return 4;case Xc:case ZR:return 16;case wb:return 536870912;default:return 16}default:return 16}}var rs=null,wg=null,Pc=null;function Pb(){if(Pc)return Pc;var e,t=wg,n=t.length,r,s="value"in rs?rs.value:rs.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 Pc=s.slice(e,1<r?1-r:void 0)}function Ic(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 K0(){return!1}function un(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:K0,this.isPropagationStopped=K0,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 Fi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bg=un(Fi),wa=Qe({},Fi,{view:0,detail:0}),dT=un(wa),tf,nf,Xi,Xu=Qe({},wa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sg,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!==Xi&&(Xi&&e.type==="mousemove"?(tf=e.screenX-Xi.screenX,nf=e.screenY-Xi.screenY):nf=tf=0,Xi=e),tf)},movementY:function(e){return"movementY"in e?e.movementY:nf}}),Y0=un(Xu),fT=Qe({},Xu,{dataTransfer:0}),hT=un(fT),pT=Qe({},wa,{relatedTarget:0}),rf=un(pT),gT=Qe({},Fi,{animationName:0,elapsedTime:0,pseudoElement:0}),mT=un(gT),yT=Qe({},Fi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xT=un(yT),vT=Qe({},Fi,{data:0}),G0=un(vT),wT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bT={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"},ST={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ET(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ST[e])?!!t[e]:!1}function Sg(){return ET}var kT=Qe({},wa,{key:function(e){if(e.key){var t=wT[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ic(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?bT[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sg,charCode:function(e){return e.type==="keypress"?Ic(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ic(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),CT=un(kT),NT=Qe({},Xu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Q0=un(NT),RT=Qe({},wa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sg}),TT=un(RT),PT=Qe({},Fi,{propertyName:0,elapsedTime:0,pseudoElement:0}),IT=un(PT),OT=Qe({},Xu,{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}),_T=un(OT),MT=[9,13,27,32],Eg=kr&&"CompositionEvent"in window,vl=null;kr&&"documentMode"in document&&(vl=document.documentMode);var jT=kr&&"TextEvent"in window&&!vl,Ib=kr&&(!Eg||vl&&8<vl&&11>=vl),X0=" ",Z0=!1;function Ob(e,t){switch(e){case"keyup":return MT.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _b(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _o=!1;function AT(e,t){switch(e){case"compositionend":return _b(t);case"keypress":return t.which!==32?null:(Z0=!0,X0);case"textInput":return e=t.data,e===X0&&Z0?null:e;default:return null}}function zT(e,t){if(_o)return e==="compositionend"||!Eg&&Ob(e,t)?(e=Pb(),Pc=wg=rs=null,_o=!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 Ib&&t.locale!=="ko"?null:t.data;default:return null}}var DT={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 J0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!DT[e.type]:t==="textarea"}function Mb(e,t,n,r){ub(r),t=tu(t,"onChange"),0<t.length&&(n=new bg("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var wl=null,Dl=null;function FT(e){Wb(e,0)}function Zu(e){var t=Ao(e);if(rb(t))return e}function $T(e,t){if(e==="change")return t}var jb=!1;if(kr){var sf;if(kr){var of="oninput"in document;if(!of){var ey=document.createElement("div");ey.setAttribute("oninput","return;"),of=typeof ey.oninput=="function"}sf=of}else sf=!1;jb=sf&&(!document.documentMode||9<document.documentMode)}function ty(){wl&&(wl.detachEvent("onpropertychange",Ab),Dl=wl=null)}function Ab(e){if(e.propertyName==="value"&&Zu(Dl)){var t=[];Mb(t,Dl,e,gg(e)),pb(FT,t)}}function LT(e,t,n){e==="focusin"?(ty(),wl=t,Dl=n,wl.attachEvent("onpropertychange",Ab)):e==="focusout"&&ty()}function HT(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zu(Dl)}function BT(e,t){if(e==="click")return Zu(t)}function VT(e,t){if(e==="input"||e==="change")return Zu(t)}function WT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dn=typeof Object.is=="function"?Object.is:WT;function Fl(e,t){if(Dn(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(!yh.call(t,s)||!Dn(e[s],t[s]))return!1}return!0}function ny(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ry(e,t){var n=ny(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=ny(n)}}function zb(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zb(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Db(){for(var e=window,t=Yc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Yc(e.document)}return t}function kg(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 UT(e){var t=Db(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&zb(n.ownerDocument.documentElement,n)){if(r!==null&&kg(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=ry(n,o);var i=ry(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 qT=kr&&"documentMode"in document&&11>=document.documentMode,Mo=null,zh=null,bl=null,Dh=!1;function sy(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Dh||Mo==null||Mo!==Yc(r)||(r=Mo,"selectionStart"in r&&kg(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}),bl&&Fl(bl,r)||(bl=r,r=tu(zh,"onSelect"),0<r.length&&(t=new bg("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Mo)))}function Ya(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var jo={animationend:Ya("Animation","AnimationEnd"),animationiteration:Ya("Animation","AnimationIteration"),animationstart:Ya("Animation","AnimationStart"),transitionend:Ya("Transition","TransitionEnd")},lf={},Fb={};kr&&(Fb=document.createElement("div").style,"AnimationEvent"in window||(delete jo.animationend.animation,delete jo.animationiteration.animation,delete jo.animationstart.animation),"TransitionEvent"in window||delete jo.transitionend.transition);function Ju(e){if(lf[e])return lf[e];if(!jo[e])return e;var t=jo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Fb)return lf[e]=t[n];return e}var $b=Ju("animationend"),Lb=Ju("animationiteration"),Hb=Ju("animationstart"),Bb=Ju("transitionend"),Vb=new Map,oy="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){Vb.set(e,t),po(t,[e])}for(var af=0;af<oy.length;af++){var cf=oy[af],KT=cf.toLowerCase(),YT=cf[0].toUpperCase()+cf.slice(1);Es(KT,"on"+YT)}Es($b,"onAnimationEnd");Es(Lb,"onAnimationIteration");Es(Hb,"onAnimationStart");Es("dblclick","onDoubleClick");Es("focusin","onFocus");Es("focusout","onBlur");Es(Bb,"onTransitionEnd");yi("onMouseEnter",["mouseout","mouseover"]);yi("onMouseLeave",["mouseout","mouseover"]);yi("onPointerEnter",["pointerout","pointerover"]);yi("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 fl="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(" "),GT=new Set("cancel close invalid load scroll toggle".split(" ").concat(fl));function iy(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,KR(r,t,void 0,e),e.currentTarget=null}function Wb(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;iy(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;iy(s,l,c),o=a}}}if(Qc)throw e=_h,Qc=!1,_h=null,e}function Be(e,t){var n=t[Bh];n===void 0&&(n=t[Bh]=new Set);var r=e+"__bubble";n.has(r)||(Ub(t,e,2,!1),n.add(r))}function uf(e,t,n){var r=0;t&&(r|=4),Ub(n,e,r,t)}var Ga="_reactListening"+Math.random().toString(36).slice(2);function $l(e){if(!e[Ga]){e[Ga]=!0,Zw.forEach(function(n){n!=="selectionchange"&&(GT.has(n)||uf(n,!1,e),uf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ga]||(t[Ga]=!0,uf("selectionchange",!1,t))}}function Ub(e,t,n,r){switch(Tb(t)){case 1:var s=cT;break;case 4:s=uT;break;default:s=vg}n=s.bind(null,t,n,e),s=void 0,!Oh||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 df(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=As(l),i===null)return;if(a=i.tag,a===5||a===6){r=o=i;continue e}l=l.parentNode}}r=r.return}pb(function(){var c=o,u=gg(n),d=[];e:{var f=Vb.get(e);if(f!==void 0){var p=bg,x=e;switch(e){case"keypress":if(Ic(n)===0)break e;case"keydown":case"keyup":p=CT;break;case"focusin":x="focus",p=rf;break;case"focusout":x="blur",p=rf;break;case"beforeblur":case"afterblur":p=rf;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=Y0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=hT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=TT;break;case $b:case Lb:case Hb:p=mT;break;case Bb:p=IT;break;case"scroll":p=dT;break;case"wheel":p=_T;break;case"copy":case"cut":case"paste":p=xT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Q0}var v=(t&4)!==0,b=!v&&e==="scroll",m=v?f!==null?f+"Capture":null:f;v=[];for(var g=c,y;g!==null;){y=g;var w=y.stateNode;if(y.tag===5&&w!==null&&(y=w,m!==null&&(w=Ml(g,m),w!=null&&v.push(Ll(g,w,y)))),b)break;g=g.return}0<v.length&&(f=new p(f,x,null,n,u),d.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==Ph&&(x=n.relatedTarget||n.fromElement)&&(As(x)||x[Cr]))break e;if((p||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,p?(x=n.relatedTarget||n.toElement,p=c,x=x?As(x):null,x!==null&&(b=go(x),x!==b||x.tag!==5&&x.tag!==6)&&(x=null)):(p=null,x=c),p!==x)){if(v=Y0,w="onMouseLeave",m="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(v=Q0,w="onPointerLeave",m="onPointerEnter",g="pointer"),b=p==null?f:Ao(p),y=x==null?f:Ao(x),f=new v(w,g+"leave",p,n,u),f.target=b,f.relatedTarget=y,w=null,As(u)===c&&(v=new v(m,g+"enter",x,n,u),v.target=y,v.relatedTarget=b,w=v),b=w,p&&x)t:{for(v=p,m=x,g=0,y=v;y;y=To(y))g++;for(y=0,w=m;w;w=To(w))y++;for(;0<g-y;)v=To(v),g--;for(;0<y-g;)m=To(m),y--;for(;g--;){if(v===m||m!==null&&v===m.alternate)break t;v=To(v),m=To(m)}v=null}else v=null;p!==null&&ly(d,f,p,v,!1),x!==null&&b!==null&&ly(d,b,x,v,!0)}}e:{if(f=c?Ao(c):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var E=$T;else if(J0(f))if(jb)E=VT;else{E=HT;var N=LT}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(E=BT);if(E&&(E=E(e,c))){Mb(d,E,n,u);break e}N&&N(e,f,c),e==="focusout"&&(N=f._wrapperState)&&N.controlled&&f.type==="number"&&kh(f,"number",f.value)}switch(N=c?Ao(c):window,e){case"focusin":(J0(N)||N.contentEditable==="true")&&(Mo=N,zh=c,bl=null);break;case"focusout":bl=zh=Mo=null;break;case"mousedown":Dh=!0;break;case"contextmenu":case"mouseup":case"dragend":Dh=!1,sy(d,n,u);break;case"selectionchange":if(qT)break;case"keydown":case"keyup":sy(d,n,u)}var k;if(Eg)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else _o?Ob(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(Ib&&n.locale!=="ko"&&(_o||C!=="onCompositionStart"?C==="onCompositionEnd"&&_o&&(k=Pb()):(rs=u,wg="value"in rs?rs.value:rs.textContent,_o=!0)),N=tu(c,C),0<N.length&&(C=new G0(C,e,null,n,u),d.push({event:C,listeners:N}),k?C.data=k:(k=_b(n),k!==null&&(C.data=k)))),(k=jT?AT(e,n):zT(e,n))&&(c=tu(c,"onBeforeInput"),0<c.length&&(u=new G0("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=k))}Wb(d,t)})}function Ll(e,t,n){return{instance:e,listener:t,currentTarget:n}}function tu(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=Ml(e,n),o!=null&&r.unshift(Ll(e,o,s)),o=Ml(e,t),o!=null&&r.push(Ll(e,o,s))),e=e.return}return r}function To(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ly(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=Ml(n,o),a!=null&&i.unshift(Ll(n,a,l))):s||(a=Ml(n,o),a!=null&&i.push(Ll(n,a,l)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var QT=/\r\n?/g,XT=/\u0000|\uFFFD/g;function ay(e){return(typeof e=="string"?e:""+e).replace(QT,`
|
|
38
|
+
`).replace(XT,"")}function Qa(e,t,n){if(t=ay(t),ay(e)!==t&&n)throw Error(Z(425))}function nu(){}var Fh=null,$h=null;function Lh(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 Hh=typeof setTimeout=="function"?setTimeout:void 0,ZT=typeof clearTimeout=="function"?clearTimeout:void 0,cy=typeof Promise=="function"?Promise:void 0,JT=typeof queueMicrotask=="function"?queueMicrotask:typeof cy<"u"?function(e){return cy.resolve(null).then(e).catch(eP)}:Hh;function eP(e){setTimeout(function(){throw e})}function ff(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),zl(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);zl(t)}function cs(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 uy(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 $i=Math.random().toString(36).slice(2),Xn="__reactFiber$"+$i,Hl="__reactProps$"+$i,Cr="__reactContainer$"+$i,Bh="__reactEvents$"+$i,tP="__reactListeners$"+$i,nP="__reactHandles$"+$i;function As(e){var t=e[Xn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Cr]||n[Xn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=uy(e);e!==null;){if(n=e[Xn])return n;e=uy(e)}return t}e=n,n=e.parentNode}return null}function ba(e){return e=e[Xn]||e[Cr],!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(Z(33))}function ed(e){return e[Hl]||null}var Vh=[],zo=-1;function ks(e){return{current:e}}function Ve(e){0>zo||(e.current=Vh[zo],Vh[zo]=null,zo--)}function He(e,t){zo++,Vh[zo]=e.current,e.current=t}var ys={},_t=ks(ys),Kt=ks(!1),to=ys;function xi(e,t){var n=e.type.contextTypes;if(!n)return ys;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 Yt(e){return e=e.childContextTypes,e!=null}function ru(){Ve(Kt),Ve(_t)}function dy(e,t,n){if(_t.current!==ys)throw Error(Z(168));He(_t,t),He(Kt,n)}function qb(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(Z(108,LR(e)||"Unknown",s));return Qe({},n,r)}function su(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ys,to=_t.current,He(_t,e),He(Kt,Kt.current),!0}function fy(e,t,n){var r=e.stateNode;if(!r)throw Error(Z(169));n?(e=qb(e,t,to),r.__reactInternalMemoizedMergedChildContext=e,Ve(Kt),Ve(_t),He(_t,e)):Ve(Kt),He(Kt,n)}var dr=null,td=!1,hf=!1;function Kb(e){dr===null?dr=[e]:dr.push(e)}function rP(e){td=!0,Kb(e)}function Cs(){if(!hf&&dr!==null){hf=!0;var e=0,t=ze;try{var n=dr;for(ze=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}dr=null,td=!1}catch(s){throw dr!==null&&(dr=dr.slice(e+1)),xb(mg,Cs),s}finally{ze=t,hf=!1}}return null}var Do=[],Fo=0,ou=null,iu=0,pn=[],gn=0,no=null,mr=1,yr="";function Is(e,t){Do[Fo++]=iu,Do[Fo++]=ou,ou=e,iu=t}function Yb(e,t,n){pn[gn++]=mr,pn[gn++]=yr,pn[gn++]=no,no=e;var r=mr;e=yr;var s=32-An(r)-1;r&=~(1<<s),n+=1;var o=32-An(t)+s;if(30<o){var i=s-s%5;o=(r&(1<<i)-1).toString(32),r>>=i,s-=i,mr=1<<32-An(t)+s|n<<s|r,yr=o+e}else mr=1<<o|n<<s|r,yr=e}function Cg(e){e.return!==null&&(Is(e,1),Yb(e,1,0))}function Ng(e){for(;e===ou;)ou=Do[--Fo],Do[Fo]=null,iu=Do[--Fo],Do[Fo]=null;for(;e===no;)no=pn[--gn],pn[gn]=null,yr=pn[--gn],pn[gn]=null,mr=pn[--gn],pn[gn]=null}var rn=null,tn=null,We=!1,_n=null;function Gb(e,t){var n=yn(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 hy(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,rn=e,tn=cs(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,rn=e,tn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=no!==null?{id:mr,overflow:yr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=yn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,rn=e,tn=null,!0):!1;default:return!1}}function Wh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Uh(e){if(We){var t=tn;if(t){var n=t;if(!hy(e,t)){if(Wh(e))throw Error(Z(418));t=cs(n.nextSibling);var r=rn;t&&hy(e,t)?Gb(r,n):(e.flags=e.flags&-4097|2,We=!1,rn=e)}}else{if(Wh(e))throw Error(Z(418));e.flags=e.flags&-4097|2,We=!1,rn=e}}}function py(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;rn=e}function Xa(e){if(e!==rn)return!1;if(!We)return py(e),We=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Lh(e.type,e.memoizedProps)),t&&(t=tn)){if(Wh(e))throw Qb(),Error(Z(418));for(;t;)Gb(e,t),t=cs(t.nextSibling)}if(py(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Z(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){tn=cs(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}tn=null}}else tn=rn?cs(e.stateNode.nextSibling):null;return!0}function Qb(){for(var e=tn;e;)e=cs(e.nextSibling)}function vi(){tn=rn=null,We=!1}function Rg(e){_n===null?_n=[e]:_n.push(e)}var sP=Or.ReactCurrentBatchConfig;function Zi(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(Z(309));var r=n.stateNode}if(!r)throw Error(Z(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(Z(284));if(!n._owner)throw Error(Z(290,e))}return e}function Za(e,t){throw e=Object.prototype.toString.call(t),Error(Z(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function gy(e){var t=e._init;return t(e._payload)}function Xb(e){function t(m,g){if(e){var y=m.deletions;y===null?(m.deletions=[g],m.flags|=16):y.push(g)}}function n(m,g){if(!e)return null;for(;g!==null;)t(m,g),g=g.sibling;return null}function r(m,g){for(m=new Map;g!==null;)g.key!==null?m.set(g.key,g):m.set(g.index,g),g=g.sibling;return m}function s(m,g){return m=hs(m,g),m.index=0,m.sibling=null,m}function o(m,g,y){return m.index=y,e?(y=m.alternate,y!==null?(y=y.index,y<g?(m.flags|=2,g):y):(m.flags|=2,g)):(m.flags|=1048576,g)}function i(m){return e&&m.alternate===null&&(m.flags|=2),m}function l(m,g,y,w){return g===null||g.tag!==6?(g=wf(y,m.mode,w),g.return=m,g):(g=s(g,y),g.return=m,g)}function a(m,g,y,w){var E=y.type;return E===Oo?u(m,g,y.props.children,w,y.key):g!==null&&(g.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Vr&&gy(E)===g.type)?(w=s(g,y.props),w.ref=Zi(m,g,y),w.return=m,w):(w=Dc(y.type,y.key,y.props,null,m.mode,w),w.ref=Zi(m,g,y),w.return=m,w)}function c(m,g,y,w){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=bf(y,m.mode,w),g.return=m,g):(g=s(g,y.children||[]),g.return=m,g)}function u(m,g,y,w,E){return g===null||g.tag!==7?(g=Xs(y,m.mode,w,E),g.return=m,g):(g=s(g,y),g.return=m,g)}function d(m,g,y){if(typeof g=="string"&&g!==""||typeof g=="number")return g=wf(""+g,m.mode,y),g.return=m,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Ha:return y=Dc(g.type,g.key,g.props,null,m.mode,y),y.ref=Zi(m,null,g),y.return=m,y;case Io:return g=bf(g,m.mode,y),g.return=m,g;case Vr:var w=g._init;return d(m,w(g._payload),y)}if(ul(g)||Ki(g))return g=Xs(g,m.mode,y,null),g.return=m,g;Za(m,g)}return null}function f(m,g,y,w){var E=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return E!==null?null:l(m,g,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ha:return y.key===E?a(m,g,y,w):null;case Io:return y.key===E?c(m,g,y,w):null;case Vr:return E=y._init,f(m,g,E(y._payload),w)}if(ul(y)||Ki(y))return E!==null?null:u(m,g,y,w,null);Za(m,y)}return null}function p(m,g,y,w,E){if(typeof w=="string"&&w!==""||typeof w=="number")return m=m.get(y)||null,l(g,m,""+w,E);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ha:return m=m.get(w.key===null?y:w.key)||null,a(g,m,w,E);case Io:return m=m.get(w.key===null?y:w.key)||null,c(g,m,w,E);case Vr:var N=w._init;return p(m,g,y,N(w._payload),E)}if(ul(w)||Ki(w))return m=m.get(y)||null,u(g,m,w,E,null);Za(g,w)}return null}function x(m,g,y,w){for(var E=null,N=null,k=g,C=g=0,I=null;k!==null&&C<y.length;C++){k.index>C?(I=k,k=null):I=k.sibling;var P=f(m,k,y[C],w);if(P===null){k===null&&(k=I);break}e&&k&&P.alternate===null&&t(m,k),g=o(P,g,C),N===null?E=P:N.sibling=P,N=P,k=I}if(C===y.length)return n(m,k),We&&Is(m,C),E;if(k===null){for(;C<y.length;C++)k=d(m,y[C],w),k!==null&&(g=o(k,g,C),N===null?E=k:N.sibling=k,N=k);return We&&Is(m,C),E}for(k=r(m,k);C<y.length;C++)I=p(k,m,C,y[C],w),I!==null&&(e&&I.alternate!==null&&k.delete(I.key===null?C:I.key),g=o(I,g,C),N===null?E=I:N.sibling=I,N=I);return e&&k.forEach(function(A){return t(m,A)}),We&&Is(m,C),E}function v(m,g,y,w){var E=Ki(y);if(typeof E!="function")throw Error(Z(150));if(y=E.call(y),y==null)throw Error(Z(151));for(var N=E=null,k=g,C=g=0,I=null,P=y.next();k!==null&&!P.done;C++,P=y.next()){k.index>C?(I=k,k=null):I=k.sibling;var A=f(m,k,P.value,w);if(A===null){k===null&&(k=I);break}e&&k&&A.alternate===null&&t(m,k),g=o(A,g,C),N===null?E=A:N.sibling=A,N=A,k=I}if(P.done)return n(m,k),We&&Is(m,C),E;if(k===null){for(;!P.done;C++,P=y.next())P=d(m,P.value,w),P!==null&&(g=o(P,g,C),N===null?E=P:N.sibling=P,N=P);return We&&Is(m,C),E}for(k=r(m,k);!P.done;C++,P=y.next())P=p(k,m,C,P.value,w),P!==null&&(e&&P.alternate!==null&&k.delete(P.key===null?C:P.key),g=o(P,g,C),N===null?E=P:N.sibling=P,N=P);return e&&k.forEach(function(F){return t(m,F)}),We&&Is(m,C),E}function b(m,g,y,w){if(typeof y=="object"&&y!==null&&y.type===Oo&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Ha:e:{for(var E=y.key,N=g;N!==null;){if(N.key===E){if(E=y.type,E===Oo){if(N.tag===7){n(m,N.sibling),g=s(N,y.props.children),g.return=m,m=g;break e}}else if(N.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Vr&&gy(E)===N.type){n(m,N.sibling),g=s(N,y.props),g.ref=Zi(m,N,y),g.return=m,m=g;break e}n(m,N);break}else t(m,N);N=N.sibling}y.type===Oo?(g=Xs(y.props.children,m.mode,w,y.key),g.return=m,m=g):(w=Dc(y.type,y.key,y.props,null,m.mode,w),w.ref=Zi(m,g,y),w.return=m,m=w)}return i(m);case Io:e:{for(N=y.key;g!==null;){if(g.key===N)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(m,g.sibling),g=s(g,y.children||[]),g.return=m,m=g;break e}else{n(m,g);break}else t(m,g);g=g.sibling}g=bf(y,m.mode,w),g.return=m,m=g}return i(m);case Vr:return N=y._init,b(m,g,N(y._payload),w)}if(ul(y))return x(m,g,y,w);if(Ki(y))return v(m,g,y,w);Za(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(n(m,g.sibling),g=s(g,y),g.return=m,m=g):(n(m,g),g=wf(y,m.mode,w),g.return=m,m=g),i(m)):n(m,g)}return b}var wi=Xb(!0),Zb=Xb(!1),lu=ks(null),au=null,$o=null,Tg=null;function Pg(){Tg=$o=au=null}function Ig(e){var t=lu.current;Ve(lu),e._currentValue=t}function qh(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 Go(e,t){au=e,Tg=$o=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ut=!0),e.firstContext=null)}function bn(e){var t=e._currentValue;if(Tg!==e)if(e={context:e,memoizedValue:t,next:null},$o===null){if(au===null)throw Error(Z(308));$o=e,au.dependencies={lanes:0,firstContext:e}}else $o=$o.next=e;return t}var zs=null;function Og(e){zs===null?zs=[e]:zs.push(e)}function Jb(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Og(t)):(n.next=s.next,s.next=n),t.interleaved=n,Nr(e,r)}function Nr(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 Wr=!1;function _g(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function e1(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 vr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function us(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Pe&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Nr(e,n)}return s=r.interleaved,s===null?(t.next=t,Og(r)):(t.next=s.next,s.next=t),r.interleaved=t,Nr(e,n)}function Oc(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,yg(e,n)}}function my(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 cu(e,t,n,r){var s=e.updateQueue;Wr=!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 d=s.baseState;i=0,u=c=a=null,l=o;do{var f=l.lane,p=l.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,v=l;switch(f=t,p=n,v.tag){case 1:if(x=v.payload,typeof x=="function"){d=x.call(p,d,f);break e}d=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=v.payload,f=typeof x=="function"?x.call(p,d,f):x,f==null)break e;d=Qe({},d,f);break e;case 2:Wr=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(c=u=p,a=d):u=u.next=p,i|=f;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;f=l,l=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(u===null&&(a=d),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);so|=i,e.lanes=i,e.memoizedState=d}}function yy(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(Z(191,s));s.call(r)}}}var Sa={},er=ks(Sa),Bl=ks(Sa),Vl=ks(Sa);function Ds(e){if(e===Sa)throw Error(Z(174));return e}function Mg(e,t){switch(He(Vl,t),He(Bl,e),He(er,Sa),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Nh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Nh(t,e)}Ve(er),He(er,t)}function bi(){Ve(er),Ve(Bl),Ve(Vl)}function t1(e){Ds(Vl.current);var t=Ds(er.current),n=Nh(t,e.type);t!==n&&(He(Bl,e),He(er,n))}function jg(e){Bl.current===e&&(Ve(er),Ve(Bl))}var Ye=ks(0);function uu(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 pf=[];function Ag(){for(var e=0;e<pf.length;e++)pf[e]._workInProgressVersionPrimary=null;pf.length=0}var _c=Or.ReactCurrentDispatcher,gf=Or.ReactCurrentBatchConfig,ro=0,Ge=null,ct=null,ht=null,du=!1,Sl=!1,Wl=0,oP=0;function Ct(){throw Error(Z(321))}function zg(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Dn(e[n],t[n]))return!1;return!0}function Dg(e,t,n,r,s,o){if(ro=o,Ge=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,_c.current=e===null||e.memoizedState===null?cP:uP,e=n(r,s),Sl){o=0;do{if(Sl=!1,Wl=0,25<=o)throw Error(Z(301));o+=1,ht=ct=null,t.updateQueue=null,_c.current=dP,e=n(r,s)}while(Sl)}if(_c.current=fu,t=ct!==null&&ct.next!==null,ro=0,ht=ct=Ge=null,du=!1,t)throw Error(Z(300));return e}function Fg(){var e=Wl!==0;return Wl=0,e}function qn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ht===null?Ge.memoizedState=ht=e:ht=ht.next=e,ht}function Sn(){if(ct===null){var e=Ge.alternate;e=e!==null?e.memoizedState:null}else e=ct.next;var t=ht===null?Ge.memoizedState:ht.next;if(t!==null)ht=t,ct=e;else{if(e===null)throw Error(Z(310));ct=e,e={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},ht===null?Ge.memoizedState=ht=e:ht=ht.next=e}return ht}function Ul(e,t){return typeof t=="function"?t(e):t}function mf(e){var t=Sn(),n=t.queue;if(n===null)throw Error(Z(311));n.lastRenderedReducer=e;var r=ct,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((ro&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 d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};a===null?(l=a=d,i=r):a=a.next=d,Ge.lanes|=u,so|=u}c=c.next}while(c!==null&&c!==o);a===null?i=r:a.next=l,Dn(r,t.memoizedState)||(Ut=!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,Ge.lanes|=o,so|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function yf(e){var t=Sn(),n=t.queue;if(n===null)throw Error(Z(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);Dn(o,t.memoizedState)||(Ut=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function n1(){}function r1(e,t){var n=Ge,r=Sn(),s=t(),o=!Dn(r.memoizedState,s);if(o&&(r.memoizedState=s,Ut=!0),r=r.queue,$g(i1.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||ht!==null&&ht.memoizedState.tag&1){if(n.flags|=2048,ql(9,o1.bind(null,n,r,s,t),void 0,null),pt===null)throw Error(Z(349));ro&30||s1(n,t,s)}return s}function s1(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ge.updateQueue,t===null?(t={lastEffect:null,stores:null},Ge.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function o1(e,t,n,r){t.value=n,t.getSnapshot=r,l1(t)&&a1(e)}function i1(e,t,n){return n(function(){l1(t)&&a1(e)})}function l1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dn(e,n)}catch{return!0}}function a1(e){var t=Nr(e,1);t!==null&&zn(t,e,1,-1)}function xy(e){var t=qn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ul,lastRenderedState:e},t.queue=e,e=e.dispatch=aP.bind(null,Ge,e),[t.memoizedState,e]}function ql(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ge.updateQueue,t===null?(t={lastEffect:null,stores:null},Ge.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 c1(){return Sn().memoizedState}function Mc(e,t,n,r){var s=qn();Ge.flags|=e,s.memoizedState=ql(1|t,n,void 0,r===void 0?null:r)}function nd(e,t,n,r){var s=Sn();r=r===void 0?null:r;var o=void 0;if(ct!==null){var i=ct.memoizedState;if(o=i.destroy,r!==null&&zg(r,i.deps)){s.memoizedState=ql(t,n,o,r);return}}Ge.flags|=e,s.memoizedState=ql(1|t,n,o,r)}function vy(e,t){return Mc(8390656,8,e,t)}function $g(e,t){return nd(2048,8,e,t)}function u1(e,t){return nd(4,2,e,t)}function d1(e,t){return nd(4,4,e,t)}function f1(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 h1(e,t,n){return n=n!=null?n.concat([e]):null,nd(4,4,f1.bind(null,t,e),n)}function Lg(){}function p1(e,t){var n=Sn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zg(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function g1(e,t){var n=Sn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zg(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function m1(e,t,n){return ro&21?(Dn(n,t)||(n=bb(),Ge.lanes|=n,so|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ut=!0),e.memoizedState=n)}function iP(e,t){var n=ze;ze=n!==0&&4>n?n:4,e(!0);var r=gf.transition;gf.transition={};try{e(!1),t()}finally{ze=n,gf.transition=r}}function y1(){return Sn().memoizedState}function lP(e,t,n){var r=fs(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},x1(e))v1(t,n);else if(n=Jb(e,t,n,r),n!==null){var s=$t();zn(n,e,r,s),w1(n,t,r)}}function aP(e,t,n){var r=fs(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(x1(e))v1(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,Dn(l,i)){var a=t.interleaved;a===null?(s.next=s,Og(t)):(s.next=a.next,a.next=s),t.interleaved=s;return}}catch{}finally{}n=Jb(e,t,s,r),n!==null&&(s=$t(),zn(n,e,r,s),w1(n,t,r))}}function x1(e){var t=e.alternate;return e===Ge||t!==null&&t===Ge}function v1(e,t){Sl=du=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function w1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yg(e,n)}}var fu={readContext:bn,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useInsertionEffect:Ct,useLayoutEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useMutableSource:Ct,useSyncExternalStore:Ct,useId:Ct,unstable_isNewReconciler:!1},cP={readContext:bn,useCallback:function(e,t){return qn().memoizedState=[e,t===void 0?null:t],e},useContext:bn,useEffect:vy,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Mc(4194308,4,f1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Mc(4194308,4,e,t)},useInsertionEffect:function(e,t){return Mc(4,2,e,t)},useMemo:function(e,t){var n=qn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=qn();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=lP.bind(null,Ge,e),[r.memoizedState,e]},useRef:function(e){var t=qn();return e={current:e},t.memoizedState=e},useState:xy,useDebugValue:Lg,useDeferredValue:function(e){return qn().memoizedState=e},useTransition:function(){var e=xy(!1),t=e[0];return e=iP.bind(null,e[1]),qn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ge,s=qn();if(We){if(n===void 0)throw Error(Z(407));n=n()}else{if(n=t(),pt===null)throw Error(Z(349));ro&30||s1(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,vy(i1.bind(null,r,o,e),[e]),r.flags|=2048,ql(9,o1.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=qn(),t=pt.identifierPrefix;if(We){var n=yr,r=mr;n=(r&~(1<<32-An(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Wl++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=oP++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},uP={readContext:bn,useCallback:p1,useContext:bn,useEffect:$g,useImperativeHandle:h1,useInsertionEffect:u1,useLayoutEffect:d1,useMemo:g1,useReducer:mf,useRef:c1,useState:function(){return mf(Ul)},useDebugValue:Lg,useDeferredValue:function(e){var t=Sn();return m1(t,ct.memoizedState,e)},useTransition:function(){var e=mf(Ul)[0],t=Sn().memoizedState;return[e,t]},useMutableSource:n1,useSyncExternalStore:r1,useId:y1,unstable_isNewReconciler:!1},dP={readContext:bn,useCallback:p1,useContext:bn,useEffect:$g,useImperativeHandle:h1,useInsertionEffect:u1,useLayoutEffect:d1,useMemo:g1,useReducer:yf,useRef:c1,useState:function(){return yf(Ul)},useDebugValue:Lg,useDeferredValue:function(e){var t=Sn();return ct===null?t.memoizedState=e:m1(t,ct.memoizedState,e)},useTransition:function(){var e=yf(Ul)[0],t=Sn().memoizedState;return[e,t]},useMutableSource:n1,useSyncExternalStore:r1,useId:y1,unstable_isNewReconciler:!1};function Rn(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 Kh(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 rd={isMounted:function(e){return(e=e._reactInternals)?go(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=$t(),s=fs(e),o=vr(r,s);o.payload=t,n!=null&&(o.callback=n),t=us(e,o,s),t!==null&&(zn(t,e,s,r),Oc(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=$t(),s=fs(e),o=vr(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=us(e,o,s),t!==null&&(zn(t,e,s,r),Oc(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=$t(),r=fs(e),s=vr(n,r);s.tag=2,t!=null&&(s.callback=t),t=us(e,s,r),t!==null&&(zn(t,e,r,n),Oc(t,e,r))}};function wy(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?!Fl(n,r)||!Fl(s,o):!0}function b1(e,t,n){var r=!1,s=ys,o=t.contextType;return typeof o=="object"&&o!==null?o=bn(o):(s=Yt(t)?to:_t.current,r=t.contextTypes,o=(r=r!=null)?xi(e,s):ys),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=rd,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function by(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&&rd.enqueueReplaceState(t,t.state,null)}function Yh(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},_g(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=bn(o):(o=Yt(t)?to:_t.current,s.context=xi(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Kh(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&&rd.enqueueReplaceState(s,s.state,null),cu(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Si(e,t){try{var n="",r=t;do n+=$R(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 xf(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Gh(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var fP=typeof WeakMap=="function"?WeakMap:Map;function S1(e,t,n){n=vr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){pu||(pu=!0,op=r),Gh(e,t)},n}function E1(e,t,n){n=vr(-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(){Gh(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Gh(e,t),typeof r!="function"&&(ds===null?ds=new Set([this]):ds.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function Sy(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new fP;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=NP.bind(null,e,t,n),t.then(e,e))}function Ey(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 ky(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=vr(-1,1),t.tag=2,us(n,t,1))),n.lanes|=1),e)}var hP=Or.ReactCurrentOwner,Ut=!1;function Dt(e,t,n,r){t.child=e===null?Zb(t,null,n,r):wi(t,e.child,n,r)}function Cy(e,t,n,r,s){n=n.render;var o=t.ref;return Go(t,s),r=Dg(e,t,n,r,o,s),n=Fg(),e!==null&&!Ut?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Rr(e,t,s)):(We&&n&&Cg(t),t.flags|=1,Dt(e,t,r,s),t.child)}function Ny(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!Yg(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,k1(e,t,o,r,s)):(e=Dc(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:Fl,n(i,r)&&e.ref===t.ref)return Rr(e,t,s)}return t.flags|=1,e=hs(o,r),e.ref=t.ref,e.return=t,t.child=e}function k1(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if(Fl(o,r)&&e.ref===t.ref)if(Ut=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(Ut=!0);else return t.lanes=e.lanes,Rr(e,t,s)}return Qh(e,t,n,r,s)}function C1(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(Ho,Jt),Jt|=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(Ho,Jt),Jt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,He(Ho,Jt),Jt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,He(Ho,Jt),Jt|=r;return Dt(e,t,s,n),t.child}function N1(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=Yt(n)?to:_t.current;return o=xi(t,o),Go(t,s),n=Dg(e,t,n,r,o,s),r=Fg(),e!==null&&!Ut?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Rr(e,t,s)):(We&&r&&Cg(t),t.flags|=1,Dt(e,t,n,s),t.child)}function Ry(e,t,n,r,s){if(Yt(n)){var o=!0;su(t)}else o=!1;if(Go(t,s),t.stateNode===null)jc(e,t),b1(t,n,r),Yh(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=bn(c):(c=Yt(n)?to:_t.current,c=xi(t,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function";d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==r||a!==c)&&by(t,i,r,c),Wr=!1;var f=t.memoizedState;i.state=f,cu(t,r,i,s),a=t.memoizedState,l!==r||f!==a||Kt.current||Wr?(typeof u=="function"&&(Kh(t,n,u,r),a=t.memoizedState),(l=Wr||wy(t,n,l,r,f,a,c))?(d||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,e1(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:Rn(t.type,l),i.props=c,d=t.pendingProps,f=i.context,a=n.contextType,typeof a=="object"&&a!==null?a=bn(a):(a=Yt(n)?to:_t.current,a=xi(t,a));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==d||f!==a)&&by(t,i,r,a),Wr=!1,f=t.memoizedState,i.state=f,cu(t,r,i,s);var x=t.memoizedState;l!==d||f!==x||Kt.current||Wr?(typeof p=="function"&&(Kh(t,n,p,r),x=t.memoizedState),(c=Wr||wy(t,n,c,r,f,x,a)||!1)?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,x,a),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,x,a)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),i.props=r,i.state=x,i.context=a,r=c):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Xh(e,t,n,r,o,s)}function Xh(e,t,n,r,s,o){N1(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return s&&fy(t,n,!1),Rr(e,t,o);r=t.stateNode,hP.current=t;var l=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=wi(t,e.child,null,o),t.child=wi(t,null,l,o)):Dt(e,t,l,o),t.memoizedState=r.state,s&&fy(t,n,!0),t.child}function R1(e){var t=e.stateNode;t.pendingContext?dy(e,t.pendingContext,t.pendingContext!==t.context):t.context&&dy(e,t.context,!1),Mg(e,t.containerInfo)}function Ty(e,t,n,r,s){return vi(),Rg(s),t.flags|=256,Dt(e,t,n,r),t.child}var Zh={dehydrated:null,treeContext:null,retryLane:0};function Jh(e){return{baseLanes:e,cachePool:null,transitions:null}}function T1(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 Uh(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=id(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=Jh(n),t.memoizedState=Zh,e):Hg(t,i));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return pP(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=hs(s,a),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?o=hs(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?Jh(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=Zh,r}return o=e.child,e=o.sibling,r=hs(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 Hg(e,t){return t=id({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ja(e,t,n,r){return r!==null&&Rg(r),wi(t,e.child,null,n),e=Hg(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function pP(e,t,n,r,s,o,i){if(n)return t.flags&256?(t.flags&=-257,r=xf(Error(Z(422))),Ja(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=id({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&&wi(t,e.child,null,i),t.child.memoizedState=Jh(i),t.memoizedState=Zh,o);if(!(t.mode&1))return Ja(e,t,i,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(Z(419)),r=xf(o,r,void 0),Ja(e,t,i,r)}if(l=(i&e.childLanes)!==0,Ut||l){if(r=pt,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,Nr(e,s),zn(r,e,s,-1))}return Kg(),r=xf(Error(Z(421))),Ja(e,t,i,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=RP.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,tn=cs(s.nextSibling),rn=t,We=!0,_n=null,e!==null&&(pn[gn++]=mr,pn[gn++]=yr,pn[gn++]=no,mr=e.id,yr=e.overflow,no=t),t=Hg(t,r.children),t.flags|=4096,t)}function Py(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),qh(e.return,t,n)}function vf(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 P1(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(Dt(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&&Py(e,n,t);else if(e.tag===19)Py(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&&uu(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),vf(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&&uu(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}vf(t,!0,n,null,o);break;case"together":vf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function jc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Rr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),so|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Z(153));if(t.child!==null){for(e=t.child,n=hs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=hs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function gP(e,t,n){switch(t.tag){case 3:R1(t),vi();break;case 5:t1(t);break;case 1:Yt(t.type)&&su(t);break;case 4:Mg(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;He(lu,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?T1(e,t,n):(He(Ye,Ye.current&1),e=Rr(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 P1(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,C1(e,t,n)}return Rr(e,t,n)}var I1,ep,O1,_1;I1=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}};ep=function(){};O1=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Ds(er.current);var o=null;switch(n){case"input":s=Sh(e,s),r=Sh(e,r),o=[];break;case"select":s=Qe({},s,{value:void 0}),r=Qe({},r,{value:void 0}),o=[];break;case"textarea":s=Ch(e,s),r=Ch(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=nu)}Rh(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"&&(Ol.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"&&(Ol.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)}};_1=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ji(e,t){if(!We)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 Nt(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 mP(e,t,n){var r=t.pendingProps;switch(Ng(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(t),null;case 1:return Yt(t.type)&&ru(),Nt(t),null;case 3:return r=t.stateNode,bi(),Ve(Kt),Ve(_t),Ag(),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,_n!==null&&(ap(_n),_n=null))),ep(e,t),Nt(t),null;case 5:jg(t);var s=Ds(Vl.current);if(n=t.type,e!==null&&t.stateNode!=null)O1(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Z(166));return Nt(t),null}if(e=Ds(er.current),Xa(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Xn]=t,r[Hl]=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<fl.length;s++)Be(fl[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":F0(r,o),Be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Be("invalid",r);break;case"textarea":L0(r,o),Be("invalid",r)}Rh(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]):Ol.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&Be("scroll",r)}switch(n){case"input":Ba(r),$0(r,o,!0);break;case"textarea":Ba(r),H0(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=nu)}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=ib(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[Hl]=r,I1(e,t,!1,!1),t.stateNode=e;e:{switch(i=Th(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<fl.length;s++)Be(fl[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":F0(e,r),s=Sh(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":L0(e,r),s=Ch(e,r),Be("invalid",e);break;default:s=r}Rh(n,s),l=s;for(o in l)if(l.hasOwnProperty(o)){var a=l[o];o==="style"?cb(e,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&lb(e,a)):o==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&_l(e,a):typeof a=="number"&&_l(e,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Ol.hasOwnProperty(o)?a!=null&&o==="onScroll"&&Be("scroll",e):a!=null&&dg(e,o,a,i))}switch(n){case"input":Ba(e),$0(e,r,!1);break;case"textarea":Ba(e),H0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ms(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Uo(e,!!r.multiple,o,!1):r.defaultValue!=null&&Uo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=nu)}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 Nt(t),null;case 6:if(e&&t.stateNode!=null)_1(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Z(166));if(n=Ds(Vl.current),Ds(er.current),Xa(t)){if(r=t.stateNode,n=t.memoizedProps,r[Xn]=t,(o=r.nodeValue!==n)&&(e=rn,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 Nt(t),null;case 13:if(Ve(Ye),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(We&&tn!==null&&t.mode&1&&!(t.flags&128))Qb(),vi(),t.flags|=98560,o=!1;else if(o=Xa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(Z(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(Z(317));o[Xn]=t}else vi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nt(t),o=!1}else _n!==null&&(ap(_n),_n=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?ut===0&&(ut=3):Kg())),t.updateQueue!==null&&(t.flags|=4),Nt(t),null);case 4:return bi(),ep(e,t),e===null&&$l(t.stateNode.containerInfo),Nt(t),null;case 10:return Ig(t.type._context),Nt(t),null;case 17:return Yt(t.type)&&ru(),Nt(t),null;case 19:if(Ve(Ye),o=t.memoizedState,o===null)return Nt(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Ji(o,!1);else{if(ut!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=uu(e),i!==null){for(t.flags|=128,Ji(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&&rt()>Ei&&(t.flags|=128,r=!0,Ji(o,!1),t.lanes=4194304)}else{if(!r)if(e=uu(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ji(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!We)return Nt(t),null}else 2*rt()-o.renderingStartTime>Ei&&n!==1073741824&&(t.flags|=128,r=!0,Ji(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=rt(),t.sibling=null,n=Ye.current,He(Ye,r?n&1|2:n&1),t):(Nt(t),null);case 22:case 23:return qg(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Jt&1073741824&&(Nt(t),t.subtreeFlags&6&&(t.flags|=8192)):Nt(t),null;case 24:return null;case 25:return null}throw Error(Z(156,t.tag))}function yP(e,t){switch(Ng(t),t.tag){case 1:return Yt(t.type)&&ru(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bi(),Ve(Kt),Ve(_t),Ag(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return jg(t),null;case 13:if(Ve(Ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Z(340));vi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ve(Ye),null;case 4:return bi(),null;case 10:return Ig(t.type._context),null;case 22:case 23:return qg(),null;case 24:return null;default:return null}}var ec=!1,It=!1,xP=typeof WeakSet=="function"?WeakSet:Set,ae=null;function Lo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Je(e,t,r)}else n.current=null}function tp(e,t,n){try{n()}catch(r){Je(e,t,r)}}var Iy=!1;function vP(e,t){if(Fh=Jc,e=Db(),kg(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,d=e,f=null;t:for(;;){for(var p;d!==n||s!==0&&d.nodeType!==3||(l=i+s),d!==o||r!==0&&d.nodeType!==3||(a=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++c===s&&(l=i),f===o&&++u===r&&(a=i),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for($h={focusedElem:e,selectionRange:n},Jc=!1,ae=t;ae!==null;)if(t=ae,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ae=e;else for(;ae!==null;){t=ae;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var v=x.memoizedProps,b=x.memoizedState,m=t.stateNode,g=m.getSnapshotBeforeUpdate(t.elementType===t.type?v:Rn(t.type,v),b);m.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Z(163))}}catch(w){Je(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,ae=e;break}ae=t.return}return x=Iy,Iy=!1,x}function El(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&&tp(t,n,o)}s=s.next}while(s!==r)}}function sd(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 np(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 M1(e){var t=e.alternate;t!==null&&(e.alternate=null,M1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xn],delete t[Hl],delete t[Bh],delete t[tP],delete t[nP])),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 j1(e){return e.tag===5||e.tag===3||e.tag===4}function Oy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||j1(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 rp(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=nu));else if(r!==4&&(e=e.child,e!==null))for(rp(e,t,n),e=e.sibling;e!==null;)rp(e,t,n),e=e.sibling}function sp(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(sp(e,t,n),e=e.sibling;e!==null;)sp(e,t,n),e=e.sibling}var yt=null,In=!1;function Dr(e,t,n){for(n=n.child;n!==null;)A1(e,t,n),n=n.sibling}function A1(e,t,n){if(Jn&&typeof Jn.onCommitFiberUnmount=="function")try{Jn.onCommitFiberUnmount(Qu,n)}catch{}switch(n.tag){case 5:It||Lo(n,t);case 6:var r=yt,s=In;yt=null,Dr(e,t,n),yt=r,In=s,yt!==null&&(In?(e=yt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):yt.removeChild(n.stateNode));break;case 18:yt!==null&&(In?(e=yt,n=n.stateNode,e.nodeType===8?ff(e.parentNode,n):e.nodeType===1&&ff(e,n),zl(e)):ff(yt,n.stateNode));break;case 4:r=yt,s=In,yt=n.stateNode.containerInfo,In=!0,Dr(e,t,n),yt=r,In=s;break;case 0:case 11:case 14:case 15:if(!It&&(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)&&tp(n,t,i),s=s.next}while(s!==r)}Dr(e,t,n);break;case 1:if(!It&&(Lo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Je(n,t,l)}Dr(e,t,n);break;case 21:Dr(e,t,n);break;case 22:n.mode&1?(It=(r=It)||n.memoizedState!==null,Dr(e,t,n),It=r):Dr(e,t,n);break;default:Dr(e,t,n)}}function _y(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new xP),t.forEach(function(r){var s=TP.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Nn(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:yt=l.stateNode,In=!1;break e;case 3:yt=l.stateNode.containerInfo,In=!0;break e;case 4:yt=l.stateNode.containerInfo,In=!0;break e}l=l.return}if(yt===null)throw Error(Z(160));A1(o,i,s),yt=null,In=!1;var a=s.alternate;a!==null&&(a.return=null),s.return=null}catch(c){Je(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)z1(t,e),t=t.sibling}function z1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Nn(t,e),Wn(e),r&4){try{El(3,e,e.return),sd(3,e)}catch(v){Je(e,e.return,v)}try{El(5,e,e.return)}catch(v){Je(e,e.return,v)}}break;case 1:Nn(t,e),Wn(e),r&512&&n!==null&&Lo(n,n.return);break;case 5:if(Nn(t,e),Wn(e),r&512&&n!==null&&Lo(n,n.return),e.flags&32){var s=e.stateNode;try{_l(s,"")}catch(v){Je(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&&sb(s,o),Th(l,i);var c=Th(l,o);for(i=0;i<a.length;i+=2){var u=a[i],d=a[i+1];u==="style"?cb(s,d):u==="dangerouslySetInnerHTML"?lb(s,d):u==="children"?_l(s,d):dg(s,u,d,c)}switch(l){case"input":Eh(s,o);break;case"textarea":ob(s,o);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var p=o.value;p!=null?Uo(s,!!o.multiple,p,!1):f!==!!o.multiple&&(o.defaultValue!=null?Uo(s,!!o.multiple,o.defaultValue,!0):Uo(s,!!o.multiple,o.multiple?[]:"",!1))}s[Hl]=o}catch(v){Je(e,e.return,v)}}break;case 6:if(Nn(t,e),Wn(e),r&4){if(e.stateNode===null)throw Error(Z(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(v){Je(e,e.return,v)}}break;case 3:if(Nn(t,e),Wn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{zl(t.containerInfo)}catch(v){Je(e,e.return,v)}break;case 4:Nn(t,e),Wn(e);break;case 13:Nn(t,e),Wn(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Wg=rt())),r&4&&_y(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(It=(c=It)||u,Nn(t,e),It=c):Nn(t,e),Wn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(ae=e,u=e.child;u!==null;){for(d=ae=u;ae!==null;){switch(f=ae,p=f.child,f.tag){case 0:case 11:case 14:case 15:El(4,f,f.return);break;case 1:Lo(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(v){Je(r,n,v)}}break;case 5:Lo(f,f.return);break;case 22:if(f.memoizedState!==null){jy(d);continue}}p!==null?(p.return=f,ae=p):jy(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{s=d.stateNode,c?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=d.stateNode,a=d.memoizedProps.style,i=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=ab("display",i))}catch(v){Je(e,e.return,v)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(v){Je(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Nn(t,e),Wn(e),r&4&&_y(e);break;case 21:break;default:Nn(t,e),Wn(e)}}function Wn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(j1(n)){var r=n;break e}n=n.return}throw Error(Z(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(_l(s,""),r.flags&=-33);var o=Oy(e);sp(e,o,s);break;case 3:case 4:var i=r.stateNode.containerInfo,l=Oy(e);rp(e,l,i);break;default:throw Error(Z(161))}}catch(a){Je(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wP(e,t,n){ae=e,D1(e)}function D1(e,t,n){for(var r=(e.mode&1)!==0;ae!==null;){var s=ae,o=s.child;if(s.tag===22&&r){var i=s.memoizedState!==null||ec;if(!i){var l=s.alternate,a=l!==null&&l.memoizedState!==null||It;l=ec;var c=It;if(ec=i,(It=a)&&!c)for(ae=s;ae!==null;)i=ae,a=i.child,i.tag===22&&i.memoizedState!==null?Ay(s):a!==null?(a.return=i,ae=a):Ay(s);for(;o!==null;)ae=o,D1(o),o=o.sibling;ae=s,ec=l,It=c}My(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,ae=o):My(e)}}function My(e){for(;ae!==null;){var t=ae;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:It||sd(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!It)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Rn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&yy(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}yy(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 d=u.dehydrated;d!==null&&zl(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Z(163))}It||t.flags&512&&np(t)}catch(f){Je(t,t.return,f)}}if(t===e){ae=null;break}if(n=t.sibling,n!==null){n.return=t.return,ae=n;break}ae=t.return}}function jy(e){for(;ae!==null;){var t=ae;if(t===e){ae=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ae=n;break}ae=t.return}}function Ay(e){for(;ae!==null;){var t=ae;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{sd(4,t)}catch(a){Je(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(a){Je(t,s,a)}}var o=t.return;try{np(t)}catch(a){Je(t,o,a)}break;case 5:var i=t.return;try{np(t)}catch(a){Je(t,i,a)}}}catch(a){Je(t,t.return,a)}if(t===e){ae=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ae=l;break}ae=t.return}}var bP=Math.ceil,hu=Or.ReactCurrentDispatcher,Bg=Or.ReactCurrentOwner,vn=Or.ReactCurrentBatchConfig,Pe=0,pt=null,st=null,bt=0,Jt=0,Ho=ks(0),ut=0,Kl=null,so=0,od=0,Vg=0,kl=null,Wt=null,Wg=0,Ei=1/0,ur=null,pu=!1,op=null,ds=null,tc=!1,ss=null,gu=0,Cl=0,ip=null,Ac=-1,zc=0;function $t(){return Pe&6?rt():Ac!==-1?Ac:Ac=rt()}function fs(e){return e.mode&1?Pe&2&&bt!==0?bt&-bt:sP.transition!==null?(zc===0&&(zc=bb()),zc):(e=ze,e!==0||(e=window.event,e=e===void 0?16:Tb(e.type)),e):1}function zn(e,t,n,r){if(50<Cl)throw Cl=0,ip=null,Error(Z(185));va(e,n,r),(!(Pe&2)||e!==pt)&&(e===pt&&(!(Pe&2)&&(od|=n),ut===4&&Kr(e,bt)),Gt(e,r),n===1&&Pe===0&&!(t.mode&1)&&(Ei=rt()+500,td&&Cs()))}function Gt(e,t){var n=e.callbackNode;sT(e,t);var r=Zc(e,e===pt?bt:0);if(r===0)n!==null&&W0(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&W0(n),t===1)e.tag===0?rP(zy.bind(null,e)):Kb(zy.bind(null,e)),JT(function(){!(Pe&6)&&Cs()}),n=null;else{switch(Sb(r)){case 1:n=mg;break;case 4:n=vb;break;case 16:n=Xc;break;case 536870912:n=wb;break;default:n=Xc}n=U1(n,F1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function F1(e,t){if(Ac=-1,zc=0,Pe&6)throw Error(Z(327));var n=e.callbackNode;if(Qo()&&e.callbackNode!==n)return null;var r=Zc(e,e===pt?bt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=mu(e,r);else{t=r;var s=Pe;Pe|=2;var o=L1();(pt!==e||bt!==t)&&(ur=null,Ei=rt()+500,Qs(e,t));do try{kP();break}catch(l){$1(e,l)}while(!0);Pg(),hu.current=o,Pe=s,st!==null?t=0:(pt=null,bt=0,t=ut)}if(t!==0){if(t===2&&(s=Mh(e),s!==0&&(r=s,t=lp(e,s))),t===1)throw n=Kl,Qs(e,0),Kr(e,r),Gt(e,rt()),n;if(t===6)Kr(e,r);else{if(s=e.current.alternate,!(r&30)&&!SP(s)&&(t=mu(e,r),t===2&&(o=Mh(e),o!==0&&(r=o,t=lp(e,o))),t===1))throw n=Kl,Qs(e,0),Kr(e,r),Gt(e,rt()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(Z(345));case 2:Os(e,Wt,ur);break;case 3:if(Kr(e,r),(r&130023424)===r&&(t=Wg+500-rt(),10<t)){if(Zc(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){$t(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Hh(Os.bind(null,e,Wt,ur),t);break}Os(e,Wt,ur);break;case 4:if(Kr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var i=31-An(r);o=1<<i,i=t[i],i>s&&(s=i),r&=~o}if(r=s,r=rt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*bP(r/1960))-r,10<r){e.timeoutHandle=Hh(Os.bind(null,e,Wt,ur),r);break}Os(e,Wt,ur);break;case 5:Os(e,Wt,ur);break;default:throw Error(Z(329))}}}return Gt(e,rt()),e.callbackNode===n?F1.bind(null,e):null}function lp(e,t){var n=kl;return e.current.memoizedState.isDehydrated&&(Qs(e,t).flags|=256),e=mu(e,t),e!==2&&(t=Wt,Wt=n,t!==null&&ap(t)),e}function ap(e){Wt===null?Wt=e:Wt.push.apply(Wt,e)}function SP(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(!Dn(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 Kr(e,t){for(t&=~Vg,t&=~od,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-An(t),r=1<<n;e[n]=-1,t&=~r}}function zy(e){if(Pe&6)throw Error(Z(327));Qo();var t=Zc(e,0);if(!(t&1))return Gt(e,rt()),null;var n=mu(e,t);if(e.tag!==0&&n===2){var r=Mh(e);r!==0&&(t=r,n=lp(e,r))}if(n===1)throw n=Kl,Qs(e,0),Kr(e,t),Gt(e,rt()),n;if(n===6)throw Error(Z(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Os(e,Wt,ur),Gt(e,rt()),null}function Ug(e,t){var n=Pe;Pe|=1;try{return e(t)}finally{Pe=n,Pe===0&&(Ei=rt()+500,td&&Cs())}}function oo(e){ss!==null&&ss.tag===0&&!(Pe&6)&&Qo();var t=Pe;Pe|=1;var n=vn.transition,r=ze;try{if(vn.transition=null,ze=1,e)return e()}finally{ze=r,vn.transition=n,Pe=t,!(Pe&6)&&Cs()}}function qg(){Jt=Ho.current,Ve(Ho)}function Qs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,ZT(n)),st!==null)for(n=st.return;n!==null;){var r=n;switch(Ng(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ru();break;case 3:bi(),Ve(Kt),Ve(_t),Ag();break;case 5:jg(r);break;case 4:bi();break;case 13:Ve(Ye);break;case 19:Ve(Ye);break;case 10:Ig(r.type._context);break;case 22:case 23:qg()}n=n.return}if(pt=e,st=e=hs(e.current,null),bt=Jt=t,ut=0,Kl=null,Vg=od=so=0,Wt=kl=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 $1(e,t){do{var n=st;try{if(Pg(),_c.current=fu,du){for(var r=Ge.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}du=!1}if(ro=0,ht=ct=Ge=null,Sl=!1,Wl=0,Bg.current=null,n===null||n.return===null){ut=1,Kl=t,st=null;break}e:{var o=e,i=n.return,l=n,a=t;if(t=bt,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var c=a,u=l,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=Ey(i);if(p!==null){p.flags&=-257,ky(p,i,l,o,t),p.mode&1&&Sy(o,c,t),t=p,a=c;var x=t.updateQueue;if(x===null){var v=new Set;v.add(a),t.updateQueue=v}else x.add(a);break e}else{if(!(t&1)){Sy(o,c,t),Kg();break e}a=Error(Z(426))}}else if(We&&l.mode&1){var b=Ey(i);if(b!==null){!(b.flags&65536)&&(b.flags|=256),ky(b,i,l,o,t),Rg(Si(a,l));break e}}o=a=Si(a,l),ut!==4&&(ut=2),kl===null?kl=[o]:kl.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var m=S1(o,a,t);my(o,m);break e;case 1:l=a;var g=o.type,y=o.stateNode;if(!(o.flags&128)&&(typeof g.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ds===null||!ds.has(y)))){o.flags|=65536,t&=-t,o.lanes|=t;var w=E1(o,l,t);my(o,w);break e}}o=o.return}while(o!==null)}B1(n)}catch(E){t=E,st===n&&n!==null&&(st=n=n.return);continue}break}while(!0)}function L1(){var e=hu.current;return hu.current=fu,e===null?fu:e}function Kg(){(ut===0||ut===3||ut===2)&&(ut=4),pt===null||!(so&268435455)&&!(od&268435455)||Kr(pt,bt)}function mu(e,t){var n=Pe;Pe|=2;var r=L1();(pt!==e||bt!==t)&&(ur=null,Qs(e,t));do try{EP();break}catch(s){$1(e,s)}while(!0);if(Pg(),Pe=n,hu.current=r,st!==null)throw Error(Z(261));return pt=null,bt=0,ut}function EP(){for(;st!==null;)H1(st)}function kP(){for(;st!==null&&!GR();)H1(st)}function H1(e){var t=W1(e.alternate,e,Jt);e.memoizedProps=e.pendingProps,t===null?B1(e):st=t,Bg.current=null}function B1(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=yP(n,t),n!==null){n.flags&=32767,st=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ut=6,st=null;return}}else if(n=mP(n,t,Jt),n!==null){st=n;return}if(t=t.sibling,t!==null){st=t;return}st=t=e}while(t!==null);ut===0&&(ut=5)}function Os(e,t,n){var r=ze,s=vn.transition;try{vn.transition=null,ze=1,CP(e,t,n,r)}finally{vn.transition=s,ze=r}return null}function CP(e,t,n,r){do Qo();while(ss!==null);if(Pe&6)throw Error(Z(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(Z(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(oT(e,o),e===pt&&(st=pt=null,bt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||tc||(tc=!0,U1(Xc,function(){return Qo(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=vn.transition,vn.transition=null;var i=ze;ze=1;var l=Pe;Pe|=4,Bg.current=null,vP(e,n),z1(n,e),UT($h),Jc=!!Fh,$h=Fh=null,e.current=n,wP(n),QR(),Pe=l,ze=i,vn.transition=o}else e.current=n;if(tc&&(tc=!1,ss=e,gu=s),o=e.pendingLanes,o===0&&(ds=null),JR(n.stateNode),Gt(e,rt()),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(pu)throw pu=!1,e=op,op=null,e;return gu&1&&e.tag!==0&&Qo(),o=e.pendingLanes,o&1?e===ip?Cl++:(Cl=0,ip=e):Cl=0,Cs(),null}function Qo(){if(ss!==null){var e=Sb(gu),t=vn.transition,n=ze;try{if(vn.transition=null,ze=16>e?16:e,ss===null)var r=!1;else{if(e=ss,ss=null,gu=0,Pe&6)throw Error(Z(331));var s=Pe;for(Pe|=4,ae=e.current;ae!==null;){var o=ae,i=o.child;if(ae.flags&16){var l=o.deletions;if(l!==null){for(var a=0;a<l.length;a++){var c=l[a];for(ae=c;ae!==null;){var u=ae;switch(u.tag){case 0:case 11:case 15:El(8,u,o)}var d=u.child;if(d!==null)d.return=u,ae=d;else for(;ae!==null;){u=ae;var f=u.sibling,p=u.return;if(M1(u),u===c){ae=null;break}if(f!==null){f.return=p,ae=f;break}ae=p}}}var x=o.alternate;if(x!==null){var v=x.child;if(v!==null){x.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==null)}}ae=o}}if(o.subtreeFlags&2064&&i!==null)i.return=o,ae=i;else e:for(;ae!==null;){if(o=ae,o.flags&2048)switch(o.tag){case 0:case 11:case 15:El(9,o,o.return)}var m=o.sibling;if(m!==null){m.return=o.return,ae=m;break e}ae=o.return}}var g=e.current;for(ae=g;ae!==null;){i=ae;var y=i.child;if(i.subtreeFlags&2064&&y!==null)y.return=i,ae=y;else e:for(i=g;ae!==null;){if(l=ae,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:sd(9,l)}}catch(E){Je(l,l.return,E)}if(l===i){ae=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,ae=w;break e}ae=l.return}}if(Pe=s,Cs(),Jn&&typeof Jn.onPostCommitFiberRoot=="function")try{Jn.onPostCommitFiberRoot(Qu,e)}catch{}r=!0}return r}finally{ze=n,vn.transition=t}}return!1}function Dy(e,t,n){t=Si(n,t),t=S1(e,t,1),e=us(e,t,1),t=$t(),e!==null&&(va(e,1,t),Gt(e,t))}function Je(e,t,n){if(e.tag===3)Dy(e,e,n);else for(;t!==null;){if(t.tag===3){Dy(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ds===null||!ds.has(r))){e=Si(n,e),e=E1(t,e,1),t=us(t,e,1),e=$t(),t!==null&&(va(t,1,e),Gt(t,e));break}}t=t.return}}function NP(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=$t(),e.pingedLanes|=e.suspendedLanes&n,pt===e&&(bt&n)===n&&(ut===4||ut===3&&(bt&130023424)===bt&&500>rt()-Wg?Qs(e,0):Vg|=n),Gt(e,t)}function V1(e,t){t===0&&(e.mode&1?(t=Ua,Ua<<=1,!(Ua&130023424)&&(Ua=4194304)):t=1);var n=$t();e=Nr(e,t),e!==null&&(va(e,t,n),Gt(e,n))}function RP(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),V1(e,n)}function TP(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(Z(314))}r!==null&&r.delete(t),V1(e,n)}var W1;W1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Kt.current)Ut=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ut=!1,gP(e,t,n);Ut=!!(e.flags&131072)}else Ut=!1,We&&t.flags&1048576&&Yb(t,iu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;jc(e,t),e=t.pendingProps;var s=xi(t,_t.current);Go(t,n),s=Dg(null,t,r,e,s,n);var o=Fg();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,Yt(r)?(o=!0,su(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,_g(t),s.updater=rd,t.stateNode=s,s._reactInternals=t,Yh(t,r,e,n),t=Xh(null,t,r,!0,o,n)):(t.tag=0,We&&o&&Cg(t),Dt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(jc(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=IP(r),e=Rn(r,e),s){case 0:t=Qh(null,t,r,e,n);break e;case 1:t=Ry(null,t,r,e,n);break e;case 11:t=Cy(null,t,r,e,n);break e;case 14:t=Ny(null,t,r,Rn(r.type,e),n);break e}throw Error(Z(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Rn(r,s),Qh(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Rn(r,s),Ry(e,t,r,s,n);case 3:e:{if(R1(t),e===null)throw Error(Z(387));r=t.pendingProps,o=t.memoizedState,s=o.element,e1(e,t),cu(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=Si(Error(Z(423)),t),t=Ty(e,t,r,n,s);break e}else if(r!==s){s=Si(Error(Z(424)),t),t=Ty(e,t,r,n,s);break e}else for(tn=cs(t.stateNode.containerInfo.firstChild),rn=t,We=!0,_n=null,n=Zb(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(vi(),r===s){t=Rr(e,t,n);break e}Dt(e,t,r,n)}t=t.child}return t;case 5:return t1(t),e===null&&Uh(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,Lh(r,s)?i=null:o!==null&&Lh(r,o)&&(t.flags|=32),N1(e,t),Dt(e,t,i,n),t.child;case 6:return e===null&&Uh(t),null;case 13:return T1(e,t,n);case 4:return Mg(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=wi(t,null,r,n):Dt(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Rn(r,s),Cy(e,t,r,s,n);case 7:return Dt(e,t,t.pendingProps,n),t.child;case 8:return Dt(e,t,t.pendingProps.children,n),t.child;case 12:return Dt(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(lu,r._currentValue),r._currentValue=i,o!==null)if(Dn(o.value,i)){if(o.children===s.children&&!Kt.current){t=Rr(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=vr(-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),qh(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(Z(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),qh(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}Dt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Go(t,n),s=bn(s),r=r(s),t.flags|=1,Dt(e,t,r,n),t.child;case 14:return r=t.type,s=Rn(r,t.pendingProps),s=Rn(r.type,s),Ny(e,t,r,s,n);case 15:return k1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Rn(r,s),jc(e,t),t.tag=1,Yt(r)?(e=!0,su(t)):e=!1,Go(t,n),b1(t,r,s),Yh(t,r,s,n),Xh(null,t,r,!0,e,n);case 19:return P1(e,t,n);case 22:return C1(e,t,n)}throw Error(Z(156,t.tag))};function U1(e,t){return xb(e,t)}function PP(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 yn(e,t,n,r){return new PP(e,t,n,r)}function Yg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function IP(e){if(typeof e=="function")return Yg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===hg)return 11;if(e===pg)return 14}return 2}function hs(e,t){var n=e.alternate;return n===null?(n=yn(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 Dc(e,t,n,r,s,o){var i=2;if(r=e,typeof e=="function")Yg(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Oo:return Xs(n.children,s,o,t);case fg:i=8,s|=8;break;case xh:return e=yn(12,n,t,s|2),e.elementType=xh,e.lanes=o,e;case vh:return e=yn(13,n,t,s),e.elementType=vh,e.lanes=o,e;case wh:return e=yn(19,n,t,s),e.elementType=wh,e.lanes=o,e;case tb:return id(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Jw:i=10;break e;case eb:i=9;break e;case hg:i=11;break e;case pg:i=14;break e;case Vr:i=16,r=null;break e}throw Error(Z(130,e==null?e:typeof e,""))}return t=yn(i,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function Xs(e,t,n,r){return e=yn(7,e,r,t),e.lanes=n,e}function id(e,t,n,r){return e=yn(22,e,r,t),e.elementType=tb,e.lanes=n,e.stateNode={isHidden:!1},e}function wf(e,t,n){return e=yn(6,e,null,t),e.lanes=n,e}function bf(e,t,n){return t=yn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function OP(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=ef(0),this.expirationTimes=ef(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ef(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Gg(e,t,n,r,s,o,i,l,a){return e=new OP(e,t,n,l,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=yn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},_g(o),e}function _P(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Io,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function q1(e){if(!e)return ys;e=e._reactInternals;e:{if(go(e)!==e||e.tag!==1)throw Error(Z(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Yt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Z(171))}if(e.tag===1){var n=e.type;if(Yt(n))return qb(e,n,t)}return t}function K1(e,t,n,r,s,o,i,l,a){return e=Gg(n,r,!0,e,s,o,i,l,a),e.context=q1(null),n=e.current,r=$t(),s=fs(n),o=vr(r,s),o.callback=t??null,us(n,o,s),e.current.lanes=s,va(e,s,r),Gt(e,r),e}function ld(e,t,n,r){var s=t.current,o=$t(),i=fs(s);return n=q1(n),t.context===null?t.context=n:t.pendingContext=n,t=vr(o,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=us(s,t,i),e!==null&&(zn(e,s,i,o),Oc(e,s,i)),i}function yu(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 Fy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Qg(e,t){Fy(e,t),(e=e.alternate)&&Fy(e,t)}function MP(){return null}var Y1=typeof reportError=="function"?reportError:function(e){console.error(e)};function Xg(e){this._internalRoot=e}ad.prototype.render=Xg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Z(409));ld(e,t,null,null)};ad.prototype.unmount=Xg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;oo(function(){ld(null,e,null,null)}),t[Cr]=null}};function ad(e){this._internalRoot=e}ad.prototype.unstable_scheduleHydration=function(e){if(e){var t=Cb();e={blockedOn:null,target:e,priority:t};for(var n=0;n<qr.length&&t!==0&&t<qr[n].priority;n++);qr.splice(n,0,e),n===0&&Rb(e)}};function Zg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function cd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function $y(){}function jP(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var c=yu(i);o.call(c)}}var i=K1(t,r,e,0,null,!1,!1,"",$y);return e._reactRootContainer=i,e[Cr]=i.current,$l(e.nodeType===8?e.parentNode:e),oo(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var c=yu(a);l.call(c)}}var a=Gg(e,0,!1,null,null,!1,!1,"",$y);return e._reactRootContainer=a,e[Cr]=a.current,$l(e.nodeType===8?e.parentNode:e),oo(function(){ld(t,a,n,r)}),a}function ud(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=yu(i);l.call(a)}}ld(t,i,e,s)}else i=jP(n,t,e,s,r);return yu(i)}Eb=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=dl(t.pendingLanes);n!==0&&(yg(t,n|1),Gt(t,rt()),!(Pe&6)&&(Ei=rt()+500,Cs()))}break;case 13:oo(function(){var r=Nr(e,1);if(r!==null){var s=$t();zn(r,e,1,s)}}),Qg(e,1)}};xg=function(e){if(e.tag===13){var t=Nr(e,134217728);if(t!==null){var n=$t();zn(t,e,134217728,n)}Qg(e,134217728)}};kb=function(e){if(e.tag===13){var t=fs(e),n=Nr(e,t);if(n!==null){var r=$t();zn(n,e,t,r)}Qg(e,t)}};Cb=function(){return ze};Nb=function(e,t){var n=ze;try{return ze=e,t()}finally{ze=n}};Ih=function(e,t,n){switch(t){case"input":if(Eh(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=ed(r);if(!s)throw Error(Z(90));rb(r),Eh(r,s)}}}break;case"textarea":ob(e,n);break;case"select":t=n.value,t!=null&&Uo(e,!!n.multiple,t,!1)}};fb=Ug;hb=oo;var AP={usingClientEntryPoint:!1,Events:[ba,Ao,ed,ub,db,Ug]},el={findFiberByHostInstance:As,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},zP={bundleType:el.bundleType,version:el.version,rendererPackageName:el.rendererPackageName,rendererConfig:el.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Or.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=mb(e),e===null?null:e.stateNode},findFiberByHostInstance:el.findFiberByHostInstance||MP,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 nc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nc.isDisabled&&nc.supportsFiber)try{Qu=nc.inject(zP),Jn=nc}catch{}}cn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=AP;cn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Zg(t))throw Error(Z(200));return _P(e,t,null,n)};cn.createRoot=function(e,t){if(!Zg(e))throw Error(Z(299));var n=!1,r="",s=Y1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Gg(e,1,!1,null,null,n,!1,r,s),e[Cr]=t.current,$l(e.nodeType===8?e.parentNode:e),new Xg(t)};cn.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(Z(188)):(e=Object.keys(e).join(","),Error(Z(268,e)));return e=mb(t),e=e===null?null:e.stateNode,e};cn.flushSync=function(e){return oo(e)};cn.hydrate=function(e,t,n){if(!cd(t))throw Error(Z(200));return ud(null,e,t,!0,n)};cn.hydrateRoot=function(e,t,n){if(!Zg(e))throw Error(Z(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",i=Y1;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=K1(t,null,e,1,n??null,s,!1,o,i),e[Cr]=t.current,$l(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 ad(t)};cn.render=function(e,t,n){if(!cd(t))throw Error(Z(200));return ud(null,e,t,!1,n)};cn.unmountComponentAtNode=function(e){if(!cd(e))throw Error(Z(40));return e._reactRootContainer?(oo(function(){ud(null,null,e,!1,function(){e._reactRootContainer=null,e[Cr]=null})}),!0):!1};cn.unstable_batchedUpdates=Ug;cn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!cd(n))throw Error(Z(200));if(e==null||e._reactInternals===void 0)throw Error(Z(38));return ud(e,t,n,!1,r)};cn.version="18.3.1-next-f1338f8080-20240426";function G1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(G1)}catch(e){console.error(e)}}G1(),Gw.exports=cn;var on=Gw.exports,DP,Ly=on;DP=Ly.createRoot,Ly.hydrateRoot;function FP(e){return typeof e=="object"?e.key:e}function $P(e,t){const n=e.length;return new Proxy(e,{get(r,s,o){if(typeof s=="string"){const i=s.charCodeAt(0);if(i>=48&&i<=57){const l=+s;if(Number.isInteger(l)&&l>=0&&l<n){let a=r[l];if(typeof a!="object"){const c=t[l*2];a=r[l]={index:l,key:a,start:c,size:t[l*2+1],end:c+t[l*2+1],lane:0}}return a}}if(s==="length")return n}return Reflect.get(r,s,o)}})}function Po(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 Hy(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const By=(e,t)=>Math.abs(e-t)<1.01,LP=(e,t,n)=>{let r;return Object.assign(function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)},{cancel:()=>{e.clearTimeout(r)}})};let tl;const Sf=()=>{if(tl!==void 0)return tl;if(typeof navigator>"u")return tl=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return tl=!0;const e=navigator.maxTouchPoints;return tl=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Vy=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},HP=e=>e,BP=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},VP=(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(Vy(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(Vy(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},xu={passive:!0},WP=typeof window>"u"?!0:"onscrollend"in window,UP=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const o=e.options.useScrollendEvent&&WP;let i=0;const l=o?null:LP(s,()=>t(n(r),!1),e.options.isScrollingResetDelay),a=d=>()=>{i=n(r),l==null||l(),t(i,d)},c=a(!0),u=a(!1);return r.addEventListener("scroll",c,xu),o&&r.addEventListener("scrollend",u,xu),()=>{r.removeEventListener("scroll",c),o&&r.removeEventListener("scrollend",u),l==null||l.cancel()}},qP=(e,t)=>UP(e,t,n=>{const{horizontal:r,isRtl:s}=e.options;return r?n.scrollLeft*(s&&-1||1):n.scrollTop}),KP=(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"]},YP=(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})},GP=YP;function QP(e,t,n,r){if(t===0)return!1;const s=r(0),o=new Set;let i=0;for(;i<e;){const a=n(i);if(a===s)break;o.add(a),i++}const l=e-i;if(l===0||l>=t)return!1;for(let a=0;a<l;a++)if(r(a)!==n(i+a))return!1;for(let a=l;a<t;a++)if(o.has(r(a)))return!1;return!0}class XP{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=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._clampedAdjustment=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.isIndexInRange(a)&&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;const s={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:HP,rangeExtractor:BP,onChange:()=>{},measureElement:KP,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 f=n[d];f!==void 0&&(s[d]=f)}const o=this.options;let i=null,l=null,a=!1;if(o!==void 0&&o.enabled&&s.enabled&&s.anchorTo==="end"&&this.scrollElement!==null){const d=o.count,f=s.count,p=this.getMeasurements(),x=((r=this._singleLaneMeasurements)==null?void 0:r.items)??p,v=w=>FP(x[w]),b=d>0?v(0):null,m=d>0?v(d-1):null;if(f!==d||d>0&&f>0&&(s.getItemKey(0)!==b||s.getItemKey(f-1)!==m)){a=!0;const w=d>0?this.getVirtualItemForOffset(this.getScrollOffset())??p[0]:null;w&&(i=[w.key,this.getScrollOffset()-w.start]);const E=s.followOnAppend===!0?"auto":s.followOnAppend||null;E&&f>0&&this.isAtEnd(o.scrollEndThreshold)&&(d===0||s.getItemKey(f-1)!==m)&&(f>d||QP(d,f,v,s.getItemKey))&&(l=E)}}this.options=s,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let c=!1,u=0;if(i&&this.scrollOffset!==null){const[d,f]=i,p=this.getMeasurements(),{count:x,getItemKey:v}=this.options;let b=0;for(;b<x&&v(b)!==d;)b++;if(b<x){const m=p[b];if(m){const g=Math.max(0,m.start+f);!l&&g!==this.scrollOffset&&(u=g-this.scrollOffset,this.scrollOffset=g,c=!0)}}}(c||l)&&(this.pendingScrollAnchor=[c?i[0]:null,c?i[1]:0,l,u])},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=Po(()=>(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.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n,r;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}if(this.scrollElement=s,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(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,l)=>{if(l&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(i-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const a=this.getScrollOffset();this.scrollDirection=l?a===i?this.scrollDirection:a<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=l,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const i=this.scrollElement,l=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},a=()=>{this._iosTouching=!1,!(!Sf()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",l,xu),i.addEventListener("touchend",a,xu),this.unsubs.push(()=>{i.removeEventListener("touchstart",l),i.removeEventListener("touchend",a),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 o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled){const[i,l,a,c]=o;i!==null&&!a&&(Sf()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?c!==0&&(this._iosDeferredAdjustment+=c):((r=this.scrollState)==null?void 0:r.behavior)==="smooth"&&!By(this.getScrollOffset()-c,this.scrollState.lastTargetOffset)||this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),a&&this.scrollToEnd({behavior:a})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:n,maxAtWrite:r}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>r+.5&&(this._clampedAdjustment=n>s+.5?{target:n,maxAtWrite:s}:null,this._scrollToOffset(n,{adjustments:void 0,behavior:void 0}))},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=Po(()=>[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.isIndexInRange=n=>n>=0&&n<this.options.count,this.getMeasurements=Po(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:l,laneAssignmentMode:a,gap:c},u)=>{var d;const f=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const g of this.laneAssignments.keys())g>=n&&this.laneAssignments.delete(g);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(g=>{this.itemSizeCache.set(g.key,g.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),l===1){const g=n*2;let y=(d=this._singleLaneMeasurements)==null?void 0:d.flat;if(!y||y.length<g){const k=new Float64Array(g);y&&p>0&&k.set(y.subarray(0,p*2)),y=k}const w=p===0?new Array(n):this._singleLaneMeasurements.items.slice();let E;if(p===0)E=r+s;else{const k=p-1;E=y[k*2]+y[k*2+1]+c}for(let k=p;k<n;k++){const C=o(k);w[k]=C;const I=f.get(C),P=typeof I=="number"?I:this.options.estimateSize(k);y[k*2]=E,y[k*2+1]=P,E+=P+c}this._singleLaneMeasurements={flat:y,items:w};const N=$P(w,y);return this.measurementsCache=N,N}const x=this.measurementsCache.slice(0,p),v=new Array(l).fill(void 0),b=new Float64Array(l);let m=0;for(let g=0;g<p;g++){const y=x[g];y&&(v[y.lane]===void 0&&m++,v[y.lane]=g,b[y.lane]=y.end)}for(let g=p;g<n;g++){const y=o(g),w=this.laneAssignments.get(g);let E,N;const k=a==="estimate"||f.has(y);if(w!==void 0&&this.options.lanes>1){E=w;const A=v[E],F=A!==void 0?x[A]:void 0;N=F?F.end+c:r+s}else if(m===l){let A=0,F=b[0],z=v[0];for(let R=1;R<l;R++){const O=b[R];(O<F||O===F&&v[R]<z)&&(A=R,F=O,z=v[R])}E=A,N=F+c,k&&this.laneAssignments.set(g,E)}else E=g%this.options.lanes,N=r+s,k&&this.laneAssignments.set(g,E);const C=f.get(y),I=typeof C=="number"?C:this.options.estimateSize(g),P=N+I;x[g]={index:g,start:N,size:I,end:P,key:y,lane:E},v[E]===void 0&&m++,v[E]=g,b[E]=P}return this.measurementsCache=x,x},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Po(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,o)=>n.length===0||r===0?(this.range=null,null):(this.range=JP(n,r,s,o,o===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Po(()=>{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);if(!this.isIndexInRange(r))return;const 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,i;if(!this.isIndexInRange(n))return;let l,a,c;const u=(s=this._singleLaneMeasurements)==null?void 0:s.flat;if(this.options.lanes===1&&u!=null)c=this.options.getItemKey(n),a=u[n*2],l=u[n*2+1];else{const p=this.measurementsCache[n];if(!p)return;c=p.key,a=p.start,l=p.size}const d=this.itemSizeCache.get(c)??l,f=r-d;if(f!==0){const p=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,x=p?this.getTotalSize():0,v=this.getScrollOffset()+this.scrollAdjustments,m=!this.itemSizeCache.has(c)?a<v:a+d<=v&&this.scrollDirection!=="backward",g=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:c,start:a,size:l,end:a+l,lane:0},f,this):m);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(c,r),this.itemSizeCacheVersion++;let y=!1;p?y=this.applyScrollAdjustment(this.getTotalSize()-x):g&&(y=this.applyScrollAdjustment(f)),this.notify(y),this._retryClampedAdjustment()}},this.getVirtualItems=Po(()=>[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=>{var r;const s=this.getMeasurements();if(s.length===0)return;const o=(r=this._singleLaneMeasurements)==null?void 0:r.flat,i=this.options.lanes===1&&o!=null,l=Q1(0,s.length-1,i?a=>o[a*2]:a=>Hy(s[a]).start,n);return Hy(s[l])},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,r;const s=this.getMeasurements();let o;if(s.length===0)o=this.options.paddingStart;else if(this.options.lanes===1){const i=s.length-1,l=(n=this._singleLaneMeasurements)==null?void 0:n.flat;l!=null?o=l[i*2]+l[i*2+1]:o=((r=s[i])==null?void 0:r.end)??0}else{const i=Array(this.options.lanes).fill(null);let l=s.length-1;for(;l>=0&&i.some(a=>a===null);){const a=s[l];i[a.lane]===null&&(i[a.lane]=a.end),l--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-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){if(t===0)return!1;if(Sf()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=t,!1;{const r=this.getScrollOffset()+this.scrollAdjustments+t,s=this.scrollElement,o=s!==null&&("scrollHeight"in s||"document"in s)?this.getMaxScrollOffset():null;return this._clampedAdjustment=o!==null&&r>o+.5?{target:r,maxAtWrite:o}:null,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&&By(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 Q1=(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 ZP(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 JP(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=ZP(s,o,n);let u=c;const d=n+t;for(;u<o&&s[u*2]+s[u*2+1]<d;)u++;return{startIndex:c,endIndex:u}}let l=Q1(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(d=>d<n+t);){const d=e[a];c[d.lane]=d.end,a++}const u=Array(r).fill(n+t);for(;l>=0&&u.some(d=>d>=n);){const d=e[l];u[d.lane]=d.start,l--}l=Math.max(0,l-l%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:l,endIndex:a}}const Ef=typeof document<"u"?S.useLayoutEffect:S.useEffect;function eI({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const s=S.useReducer(d=>d+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=S.useRef(!1),l=d=>{const f=o.current;if(!f.enabled||!f.container)return;const p=d.getTotalSize();if(p!==f.lastSize){f.lastSize=p;const x=d.options.horizontal?"width":"height";f.container.style[x]=`${p}px`}},a=d=>{const f=o.current;if(!f.enabled||!f.container)return;l(d);const p=!!d.options.horizontal,x=f.mode==="transform",v=p?"left":"top",b=d.options.scrollMargin,m=d.getVirtualItems();for(const g of m){const y=g.start-b,w=d.elementsCache.get(g.key);w&&f.lastPositions.get(w)!==y&&(f.lastPositions.set(w,y),x?w.style.transform=p?`translate3d(${y}px, 0, 0)`:`translate3d(0, ${y}px, 0)`:w.style[v]=`${y}px`)}},c={...r,onChange:(d,f)=>{var p;const x=o.current;let v=!0;if(x.enabled){a(d);const b=d.range,m=x.prevRange;v=!m||m.isScrolling!==d.isScrolling||m.startIndex!==(b==null?void 0:b.startIndex)||m.endIndex!==(b==null?void 0:b.endIndex),v&&(x.prevRange=b?{startIndex:b.startIndex,endIndex:b.endIndex,isScrolling:d.isScrolling}:null)}v&&(e&&f&&!i.current?on.flushSync(s):s()),(p=r.onChange)==null||p.call(r,d,f)}},[u]=S.useState(()=>{const d=new XP(c),f=d.measureElement;return d.measureElement=p=>{i.current=!0;try{f(p)}finally{i.current=!1}},Object.assign(d,{containerRef:p=>{const x=o.current;if(x.container=p,x.lastSize=null,p&&x.enabled){const v=d.getTotalSize();x.lastSize=v;const b=d.options.horizontal?"width":"height";p.style[b]=`${v}px`}}})});return u.setOptions(c),Ef(()=>u._didMount(),[]),Ef(()=>(l(u),u._willUpdate())),Ef(()=>{a(u)}),u}function Jg(e){return eI({observeElementRect:VP,observeElementOffset:qP,scrollToFn:GP,...e})}function mn(e){return encodeURIComponent(String(e))}function Bo(e,t){const n=[],r=s=>t!=null&&t.prefix?`${t.prefix}[${mn(s)}]`:mn(s);for(const[s,o]of Object.entries(e))if(o!=null)if(Array.isArray(o))for(const i of o)n.push(`${r(s)}[]=${mn(i)}`);else if(typeof o=="object")for(const[i,l]of Object.entries(o))l!=null&&n.push(`${r(s)}[${mn(i)}]=${mn(l)}`);else n.push(`${r(s)}=${mn(o)}`);return n.join("&")}function X1(e,t){const n=[];return cp(e,(t==null?void 0:t.prefix)??"where",n),n.join("&")}function tI(e){var s;const t=[],{where:n,...r}=e.filter??{};if(n!=null&&n.length&&t.push(X1(n,{prefix:"filter[where]"})),t.push(Bo(r,{prefix:"filter"})),e.search&&t.push(`search=${mn(e.search)}`),(s=e.sort)!=null&&s.length){const o=e.sort.map(i=>`${i.direction==="desc"?"-":""}${i.field}`).join(",");t.push(`sort=${mn(o)}`)}for(const o of["include","distinct","extent"]){const i=e[o];i!=null&&i.length&&t.push(Bo({[o]:i}))}return e.groupByCount&&t.push(Bo({groupByCount:e.groupByCount})),e.paginate&&t.push(Bo({paginate:e.paginate})),t.filter(Boolean).join("&")}function cp(e,t,n){for(let r=0;r<e.length;r++){const s=e[r],o=`${t}[${r}]`;if(s.field!==void 0&&n.push(`${o}[field]=${mn(s.field)}`),s.operator!==void 0&&n.push(`${o}[operator]=${mn(s.operator)}`),s.value!==void 0)if(Array.isArray(s.value))for(let i=0;i<s.value.length;i++)n.push(`${o}[value][${i}]=${mn(s.value[i])}`);else n.push(`${o}[value]=${mn(s.value)}`);s.AND&&s.AND.length>0&&cp(s.AND,`${o}[AND]`,n),s.OR&&s.OR.length>0&&cp(s.OR,`${o}[OR]`,n)}}const nI=["equals","notEquals","contains","notContains","iContains","startsWith","endsWith","gt","gte","lt","lte","between","notBetween","in","notIn","isAnyOf","isEmpty","isNotEmpty","isNull","isNotNull","exists","notExists"],rI=["equals","notEquals","gt","gte","lt","lte"],sI=["contains","notContains","iContains","startsWith","endsWith"],oI=["in","notIn","isAnyOf"],iI=["between","notBetween"],lI=["isNull","isNotNull","isEmpty","isNotEmpty","exists","notExists"],aI=["gt","gte","lt","lte"],cI=new Set(rI),uI=new Set(sI),dI=new Set(oI),fI=new Set(iI),up=new Set(lI),hI=new Set(aI);function rc(e,t){if(!up.has(e)){if(uI.has(e)){if(typeof t!="string")throw new Error(`Operator "${e}" expects a string value.`);return}if(fI.has(e)){if(!Array.isArray(t)||t.length!==2)throw new Error(`Operator "${e}" expects [low, high] tuple.`);return}if(dI.has(e)){if(!Array.isArray(t))throw new Error(`Operator "${e}" expects an array value.`);return}if(cI.has(e)){if(Array.isArray(t))throw new Error(`Operator "${e}" expects a scalar value, not an array. Use "in" for arrays.`);return}}}function pI(e){if(!hI.has(e))throw new Error(`Operator "${e}" should use where() (replace), not add(). add() is for range operators (gt, gte, lt, lte) on the same field.`)}class vu{constructor(){xe(this,"conditions",[]);xe(this,"groups",[]);xe(this,"extra",{});xe(this,"includes",[]);xe(this,"searchTerm");xe(this,"sorts",[]);xe(this,"distinctFields",[]);xe(this,"extentFields",[]);xe(this,"groupByCountSpec");xe(this,"pagination");xe(this,"version",0);xe(this,"snapshot",null);xe(this,"listeners",new Set);xe(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));xe(this,"getSnapshot",()=>(this.snapshot===null&&(this.snapshot=this.build()),this.snapshot))}where(t,n,r){if(this.conditions=this.conditions.filter(s=>s.field!==t),r!==void 0){const s=n;rc(s,r),this.conditions.push({field:t,operator:s,value:up.has(s)?void 0:r})}else Array.isArray(n)?this.conditions.push({field:t,operator:"in",value:n}):typeof n=="string"&&["isNull","isNotNull","isEmpty","isNotEmpty","exists","notExists"].includes(n)?(rc(n,void 0),this.conditions.push({field:t,operator:n,value:void 0})):this.conditions.push({field:t,operator:"equals",value:n});return this.notify(),this}whereDynamic(t,n,r){if(!nI.includes(n))throw new Error(`Unknown filter operator "${String(n)}".`);return rc(n,r),this.conditions=this.conditions.filter(s=>s.field!==t),this.conditions.push({field:t,operator:n,value:up.has(n)?void 0:r}),this.notify(),this}fromFilters(t,n){for(const r of t)r.field&&((n==null?void 0:n.skip)!==void 0&&r.field===n.skip||this.whereDynamic(r.field,r.operator,r.value));return this}add(t,n,r){return pI(n),rc(n,r),this.conditions.push({field:t,operator:n,value:r}),this.notify(),this}remove(t){return this.conditions=this.conditions.filter(n=>n.field!==t),this.notify(),this}clear(){return this.conditions=[],this.groups.length=0,this.extra={},this.includes=[],this.searchTerm=void 0,this.sorts=[],this.distinctFields=[],this.extentFields=[],this.groupByCountSpec=void 0,this.pagination=void 0,this.notify(),this}or(t){const n=new vu;return t(n),this.groups.push({type:"OR",conditions:n.conditions}),this.notify(),this}and(t){const n=new vu;return t(n),this.groups.push({type:"AND",conditions:n.conditions}),this.notify(),this}equals(t,n){return this.where(t,"equals",n)}notEquals(t,n){return this.where(t,"notEquals",n)}contains(t,n){return this.where(t,"contains",n)}in(t,n){return this.where(t,"in",n)}notIn(t,n){return this.where(t,"notIn",n)}between(t,n,r){return this.where(t,"between",[n,r])}gt(t,n){return this.where(t,"gt",n)}gte(t,n){return this.where(t,"gte",n)}lt(t,n){return this.where(t,"lt",n)}lte(t,n){return this.where(t,"lte",n)}isNull(t){return this.where(t,"isNull")}isNotNull(t){return this.where(t,"isNotNull")}isEmpty(t){return this.where(t,"isEmpty")}isNotEmpty(t){return this.where(t,"isNotEmpty")}startsWith(t,n){return this.where(t,"startsWith",n)}endsWith(t,n){return this.where(t,"endsWith",n)}addGte(t,n){return this.add(t,"gte",n)}addLte(t,n){return this.add(t,"lte",n)}addGt(t,n){return this.add(t,"gt",n)}addLt(t,n){return this.add(t,"lt",n)}set(t,n){return this.extra[t]=n,this.notify(),this}include(...t){for(const n of t)typeof n=="string"&&(this.includes.includes(n)||this.includes.push(n));return this.notify(),this}search(t){return typeof t!="string"?this:(this.searchTerm=t,this.notify(),this)}distinct(...t){for(const n of t)typeof n=="string"&&(this.distinctFields.includes(n)||this.distinctFields.push(n));return this.notify(),this}extent(...t){for(const n of t)typeof n=="string"&&(this.extentFields.includes(n)||this.extentFields.push(n));return this.notify(),this}groupByCount(t,n){return this.groupByCountSpec={field:t,...(n==null?void 0:n.bucket)!==void 0&&{bucket:n.bucket},...(n==null?void 0:n.limit)!==void 0&&{limit:n.limit},...(n==null?void 0:n.offset)!==void 0&&{offset:n.offset},...(n==null?void 0:n.search)!==void 0&&{search:n.search}},this.notify(),this}sort(t,n="asc"){return this.sorts=this.sorts.filter(r=>r.field!==t),this.sorts.push({field:t,direction:n}),this.notify(),this}sortDesc(t){return this.sort(t,"desc")}sortAsc(t){return this.sort(t,"asc")}sortDynamic(t,n){return this.sort(t,n)}page(t,n=25){return this.pagination={page:t,size:n},this.notify(),this}notify(){this.version++,this.snapshot=null;for(const t of this.listeners)t()}getVersion(){return this.version}build(){const t=[];for(const r of this.conditions)t.push({field:r.field,operator:r.operator,value:r.value});for(const r of this.groups){const s=r.conditions.map(o=>({field:o.field,operator:o.operator,value:o.value}));r.type==="OR"?t.push({field:"",operator:"equals",value:void 0,OR:s}):t.push({field:"",operator:"equals",value:void 0,AND:s})}const n={...this.extra,filter:{where:t}};return this.includes.length>0&&(n.include=[...this.includes]),this.searchTerm!==void 0&&(n.search=this.searchTerm),this.sorts.length>0&&(n.sort=[...this.sorts]),this.distinctFields.length>0&&(n.distinct=[...this.distinctFields]),this.extentFields.length>0&&(n.extent=[...this.extentFields]),this.groupByCountSpec!==void 0&&(n.groupByCount={...this.groupByCountSpec}),this.pagination!==void 0&&(n.paginate={...this.pagination}),n}toQueryString(){const t=[];let n;if(this.groups.length===0){const s=this.toFlatObject();n=Bo(Object.fromEntries(Object.entries(s).map(([o,i])=>[`filter[${o}]`,i])))}else n=X1(this.build().filter.where);if(n&&t.push(n),this.includes.length>0&&t.push(`include=${encodeURIComponent(this.includes.join(","))}`),this.searchTerm!==void 0&&t.push(`search=${encodeURIComponent(this.searchTerm)}`),this.sorts.length>0){const s=this.sorts.map(o=>o.direction==="desc"?`-${o.field}`:o.field).join(",");t.push(`sort=${encodeURIComponent(s)}`)}this.distinctFields.length>0&&t.push(`distinct=${encodeURIComponent(this.distinctFields.join(","))}`),this.extentFields.length>0&&t.push(`extent=${encodeURIComponent(this.extentFields.join(","))}`),this.pagination!==void 0&&(t.push(`page=${encodeURIComponent(String(this.pagination.page))}`),t.push(`size=${encodeURIComponent(String(this.pagination.size))}`));const r=Bo(this.extra);return r&&t.push(r),t.join("&")}toFlatObject(){const t={};for(const n of this.conditions)if(n.operator==="equals")t[n.field]=n.value;else if(n.operator==="in")t[n.field]=n.value;else{const r=t[n.field];r!=null&&typeof r=="object"&&!Array.isArray(r)?r[n.operator]=n.value:t[n.field]={[n.operator]:n.value}}return t}}function gI(){return new vu}const mI={eq:"equals",ne:"notEquals",gt:"gt",gte:"gte",lt:"lt",lte:"lte",in:"in"};function Wy(e){return e==="true"?!0:e==="false"?!1:e!==""&&!Number.isNaN(Number(e))?Number(e):e}function sc(e,t={},n){const r=gI(),s=(i,l)=>{if(l!==void 0){if(Array.isArray(l)){if(l.length===0)return;l.length===1?r.where(i,"equals",l[0]):r.where(i,"in",l);return}l!==""&&r.where(i,"equals",l)}};s("status",e.status),s("workflow",e.workflow),s("tag",e.tag),s("namespace",e.namespace),e.origin===null?r.where("origin","isNull",!0):e.origin&&r.where("origin","equals",e.origin);for(const i of e.attr??[]){const[l,a,...c]=i.split(":"),u=a?mI[a]:void 0;if(!l||!u||c.length===0)continue;const d=c.join(":");r.where(`attr.${l}`,u,a==="in"?d.split("|").filter(Boolean).map(Wy):Wy(d))}const o=r.build();return tI({...o,filter:{...o.filter,...t.limit!==void 0&&{limit:t.limit},...t.offset!==void 0&&{offset:t.offset}},...n&&{groupByCount:n}})}function yI(e){if(typeof e=="object"&&e!==null&&"durationMs"in e){const t=e.durationMs;if(typeof t=="number")return t}}function em(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(d=>d.at),l=i.length?i.reduce((d,f)=>f<d?f:d,Number.POSITIVE_INFINITY):void 0,c=yI((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 Z1={kind:"all"},dd="unknown";function Li(e){const t=e==null?void 0:e.trim();return t||void 0}function xI(e){return Li(e)===void 0}function Ea(e){const t=Li(e);if(t===void 0)return dd;const n=t.lastIndexOf("/");return n===-1?t:t.slice(n+1)||t}function vI(e,t){return e.kind!==t.kind?!1:e.kind==="origin"&&t.kind==="origin"?e.origin===t.origin:!0}function J1(e){return e.kind==="origin"?`origin:${e.origin}`:e.kind}function wI(e,t){if(t.kind==="all")return!0;const n=Li(e.origin);return t.kind==="unknown"?n===void 0:n===t.origin}const tm="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 bI(e){const t=new Map;let n=0,r=0;for(const o of e){r+=o.count;const i=Li(o.origin??void 0);if(i===void 0){n+=o.count;continue}t.set(i,(t.get(i)??0)+o.count)}const s=[{filter:Z1,label:"all",title:"Every origin, including runs that have none",count:r}];for(const o of[...t.keys()].sort())s.push({filter:{kind:"origin",origin:o},label:Ea(o),title:o,count:t.get(o)??0});return n>0&&s.push({filter:{kind:"unknown"},label:dd,title:tm,count:n}),s}function SI(e){return e.reduce((t,n)=>t+(xI(n.origin??void 0)?n.count:0),0)}function EI(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 ${Ea(e.origin.origin)} match these filters.`,unclassified:e.unknownCount}:{message:"No runs match these filters."}:{message:"No runs yet."}}const Uy="compensate:";function kI(e){return e.startsWith(Uy)?e.slice(Uy.length):e}function CI(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 NI(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 RI=10*60*1e3;function TI(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>RI}const eS=["running","suspended","cancelling"],PI=new Set(eS);function dp(e){const t=e.lastIndexOf("@");return t===-1?e:e.slice(0,t)}function kf(e,t){const n=dp(e),r=t.filter(i=>dp(i.group)===n),s=r.some(i=>i.depth>0),o=r.some(i=>i.liveWorkers.length>0);return s&&!o}function II(e){return e.startsWith("wh:")?`webhook ${e}`:e.startsWith("child:")?`child ${e.slice(6)}`:`signal ${e}`}function OI(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 PI.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 _I(e){return`${e.on} ${e.name}`}function tS(e,t){var s;if(e.status!=="suspended")return e.status==="pending"&&kf(e.workflow,t.health)?{status:"no-worker",detail:e.workflow}:e.status==="blocked"?{status:"no-worker",detail:e.workflow}:{status:e.status};const n=OI(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:II(r.name)}:r.kind==="sleep"?{status:"sleeping"}:r.workerGroup&&kf(r.workerGroup,t.health)?{status:"no-worker",detail:dp(r.workerGroup)}:{status:"running"}:e.waiting?{status:"awaiting",detail:_I(e.waiting)}:kf(e.workflow,t.health)?{status:"no-worker",detail:e.workflow}:{status:"running"}}function MI(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 nS(){return typeof window<"u"&&window.__DURABLE_BASE__||"/durable"}function rS(){return typeof window<"u"&&window.__DURABLE_API__?window.__DURABLE_API__:`${nS()}/api`}async function jI(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 AI(e){if(typeof window>"u")return;const t=nS();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 mt(e,t){const n=await fetch(rS()+e,t);if(n.status===401)throw AI(await jI(n)),new Error("Session expired; redirecting to sign-in.");if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return await n.json()}const $e={runs(e,t,n,r){const s=sc({status:e??(r==null?void 0:r.statuses),tag:t,attr:n,namespace:r==null?void 0:r.namespace,origin:r==null?void 0:r.origin},{limit:r==null?void 0:r.limit,offset:r==null?void 0:r.offset});return mt(s?`/runs?${s}`:"/runs")},facets(e,t,n){const r=sc({tag:e,attr:t,namespace:n});return mt(r?`/runs/facets?${r}`:"/runs/facets")},values(e,t={},n){var s;const r=sc(t,{},{field:e,...(n==null?void 0:n.limit)&&{limit:n.limit},...(n==null?void 0:n.offset)&&{offset:n.offset},...((s=n==null?void 0:n.search)==null?void 0:s.trim())&&{search:n.search.trim()}});return mt(`/runs/values?${r}`)},run(e){return mt(`/runs/${encodeURIComponent(e)}`)},fanMembers(e,t,n={}){const r=new URLSearchParams;n.offset!==void 0&&r.set("offset",String(n.offset)),n.limit!==void 0&&r.set("limit",String(n.limit)),n.failed&&r.set("failed","true");const s=r.toString(),o=`/runs/${encodeURIComponent(e)}/fans/${encodeURIComponent(t)}`;return mt(s?`${o}?${s}`:o)},workers(){return mt("/workers")},schedules(){return mt("/schedules")},pauseSchedule(e){return mt(`/schedules/${encodeURIComponent(e)}/pause`,{method:"POST"})},resumeSchedule(e){return mt(`/schedules/${encodeURIComponent(e)}/resume`,{method:"POST"})},triggerSchedule(e){return mt(`/schedules/${encodeURIComponent(e)}/trigger`,{method:"POST"})},topology(){return mt("/topology")},retry(e){return mt(`/runs/${encodeURIComponent(e)}/retry`,{method:"POST"})},retryWithInput(e,t){return mt(`/runs/${encodeURIComponent(e)}/retry-with-input`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:t})})},bulk(e,t){const n=sc(t);return mt(`/bulk/${e}${n?`?${n}`:""}`,{method:"POST"})},cancel(e,t){const n=t!=null&&t.compensate?"?compensate=true":"";return mt(`/runs/${encodeURIComponent(e)}/cancel${n}`,{method:"POST"})},continue(e){return mt(`/runs/${encodeURIComponent(e)}/continue`,{method:"POST"})},redispatch(e){return mt(`/runs/${encodeURIComponent(e)}/redispatch`,{method:"POST"})},streamRun(e,t){const n=new EventSource(`${rS()}/runs/${encodeURIComponent(e)}/stream`);return n.onmessage=r=>{try{t(JSON.parse(r.data))}catch{}},()=>n.close()}};function wu(e){const t=e.lastIndexOf("@");return t===-1?"default":e.slice(t+1)}function bu(e){const t=e.lastIndexOf("@");return t===-1?e:e.slice(0,t)}function zI(e){const t=new Map;for(const r of e){const s=wu(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 DI(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 FI(e,t,n){if(!e)return e;const r=e.timeline.findIndex(i=>i.seq===t),s=e.timeline[r];if(s===void 0)return e;const o=[...e.timeline];return o[r]={...s,events:[...s.events??[],n]},{...e,timeline:o}}function $I(e){var n,r;const t=new Map;for(const s of e)for(const o of s.liveWorkers){const i=bu(o.group),l=t.get(o.instanceId);if(l===void 0){t.set(o.instanceId,{instanceId:o.instanceId,partition:wu(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=wu(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 LI(e){const t=new Set,n=new Set;for(const r of e){if(r.kind!=="workflow")continue;const s=bu(r.group);r.depth>0&&t.add(s),r.liveWorkers.length>0&&n.add(s)}return[...t].filter(r=>!n.has(r)).sort()}function HI(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(bu(o.group)):o.kind==="step"&&r.add(bu(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 BI(e,t,n=Date.now){let r=Number.NEGATIVE_INFINITY,s;const o=()=>{s=void 0,r=n(),e()};return{call(){if(s!==void 0)return;const i=r+t-n();i<=0?o():s=setTimeout(o,i)},cancel(){s!==void 0&&clearTimeout(s),s=void 0}}}const Fn={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round"};function sS(e){return h.jsxs("svg",{...Fn,...e,"aria-hidden":"true",children:[h.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"1.5"}),h.jsx("path",{d:"M9 3v2M15 3v2M9 19v2M15 19v2M3 9h2M3 15h2M19 9h2M19 15h2"})]})}function VI(e){return h.jsxs("svg",{...Fn,...e,"aria-hidden":"true",children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"})]})}function WI(e){return h.jsxs("svg",{...Fn,...e,"aria-hidden":"true",children:[h.jsx("circle",{cx:"12",cy:"13",r:"8"}),h.jsx("path",{d:"M12 13V9M9 2h6"})]})}function UI(e){return h.jsxs("svg",{...Fn,...e,"aria-hidden":"true",children:[h.jsx("circle",{cx:"12",cy:"12",r:"2"}),h.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 nm(e){return h.jsx("svg",{...Fn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"m4 12 5 5L20 6"})})}function xs(e){return h.jsx("svg",{...Fn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function qI(e){return h.jsxs("svg",{...Fn,...e,"aria-hidden":"true",children:[h.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),h.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h8"})]})}function Cf(e){return h.jsx("svg",{...Fn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"M21 12a9 9 0 1 1-2.6-6.3M21 4v5h-5"})})}function rm(e){return h.jsx("svg",{...Fn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"M13 2 4 14h7l-1 8 9-12h-7l1-8z"})})}function KI(e){return h.jsx("svg",{...Fn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"M6 4l14 8-14 8z"})})}function sm(e){return h.jsxs("svg",{...Fn,...e,"aria-hidden":"true",children:[h.jsx("circle",{cx:"6",cy:"5",r:"2"}),h.jsx("path",{d:"M6 7v6a4 4 0 004 4h4"}),h.jsx("circle",{cx:"18",cy:"17",r:"2"})]})}const YI={local:sS,remote:VI,sleep:WI,signal:UI,child:sm};function om(e){return YI[e]??sS}const fp={local:"In-process step",remote:"Remote worker step",sleep:"Durable timer",signal:"External signal",child:"Child workflow — click to open its run"};function oS(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=oS(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function iS(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=oS(e))&&(r&&(r+=" "),r+=t);return r}const qy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ky=iS,lS=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Ky(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],d=o==null?void 0:o[c];if(u===null)return null;const f=qy(u)||qy(d);return s[c][f]}),l=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(x=>{let[v,b]=x;return Array.isArray(b)?b.includes({...o,...l}[v]):{...o,...l}[v]===b})?[...c,d,f]:c},[]);return Ky(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},QI=(e,t)=>({classGroupId:e,validator:t}),aS=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Su="-",Yy=[],XI="arbitrary..",ZI=e=>{const t=eO(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return JI(i);const l=i.split(Su),a=l[0]===""&&l.length>1?1:0;return cS(l,a,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const a=r[i],c=n[i];return a?c?GI(c,a):a:c||Yy}return n[i]||Yy}}},cS=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const c=cS(e,t+1,o);if(c)return c}const i=n.validators;if(i===null)return;const l=t===0?e.join(Su):e.slice(t).join(Su),a=i.length;for(let c=0;c<a;c++){const u=i[c];if(u.validator(l))return u.classGroupId}},JI=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?XI+r:void 0})(),eO=e=>{const{theme:t,classGroups:n}=e;return tO(n,t)},tO=(e,t)=>{const n=aS();for(const r in e){const s=e[r];im(s,n,r,t)}return n},im=(e,t,n,r)=>{const s=e.length;for(let o=0;o<s;o++){const i=e[o];nO(i,t,n,r)}},nO=(e,t,n,r)=>{if(typeof e=="string"){rO(e,t,n);return}if(typeof e=="function"){sO(e,t,n,r);return}oO(e,t,n,r)},rO=(e,t,n)=>{const r=e===""?t:uS(t,e);r.classGroupId=n},sO=(e,t,n,r)=>{if(iO(e)){im(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(QI(n,e))},oO=(e,t,n,r)=>{const s=Object.entries(e),o=s.length;for(let i=0;i<o;i++){const[l,a]=s[i];im(a,uS(t,l),n,r)}},uS=(e,t)=>{let n=e;const r=t.split(Su),s=r.length;for(let o=0;o<s;o++){const i=r[o];let l=n.nextPart.get(i);l||(l=aS(),n.nextPart.set(i,l)),n=l}return n},iO=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,lO=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)}}},hp="!",Gy=":",aO=[],Qy=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),cO=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===Gy){o.push(s.slice(a,v)),a=v+1;continue}if(b==="/"){c=v;continue}}b==="["?i++:b==="]"?i--:b==="("?l++:b===")"&&l--}const d=o.length===0?s:s.slice(a);let f=d,p=!1;d.endsWith(hp)?(f=d.slice(0,-1),p=!0):d.startsWith(hp)&&(f=d.slice(1),p=!0);const x=c&&c>a?c-a:void 0;return Qy(o,p,f,x)};if(t){const s=t+Gy,o=r;r=i=>i.startsWith(s)?o(i.slice(s.length)):Qy(aO,!1,i,void 0,!0)}if(n){const s=r;r=o=>n({className:o,parseClassName:s})}return r},uO=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}},dO=e=>({cache:lO(e.cacheSize),parseClassName:cO(e),sortModifiers:uO(e),postfixLookupClassGroupIds:fO(e),...ZI(e)}),fO=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},hO=/\s+/,pO=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o,postfixLookupClassGroupIds:i}=t,l=[],a=e.trim().split(hO);let c="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:f,modifiers:p,hasImportantModifier:x,baseClassName:v,maybePostfixModifierPosition:b}=n(d);if(f){c=d+(c.length>0?" "+c:c);continue}let m=!!b,g;if(m){const k=v.substring(0,b);g=r(k);const C=g&&i[g]?r(v):void 0;C&&C!==g&&(g=C,m=!1)}else g=r(v);if(!g){if(!m){c=d+(c.length>0?" "+c:c);continue}if(g=r(v),!g){c=d+(c.length>0?" "+c:c);continue}m=!1}const y=p.length===0?"":p.length===1?p[0]:o(p).join(":"),w=x?y+hp:y,E=w+g;if(l.indexOf(E)>-1)continue;l.push(E);const N=s(g,m);for(let k=0;k<N.length;++k){const C=N[k];l.push(w+C)}c=d+(c.length>0?" "+c:c)}return c},gO=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=dS(n))&&(s&&(s+=" "),s+=r);return s},dS=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=dS(e[r]))&&(n&&(n+=" "),n+=t);return n},mO=(e,...t)=>{let n,r,s,o;const i=a=>{const c=t.reduce((u,d)=>d(u),e());return n=dO(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=pO(a,n);return s(a,u),u};return o=i,(...a)=>o(gO(...a))},yO=[],lt=e=>{const t=n=>n[e]||yO;return t.isThemeGetter=!0,t},fS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xO=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,vO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wO=/\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$/,bO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,SO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,EO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fr=e=>xO.test(e),be=e=>!!e&&!Number.isNaN(Number(e)),Un=e=>!!e&&Number.isInteger(Number(e)),Nf=e=>e.endsWith("%")&&be(e.slice(0,-1)),ir=e=>vO.test(e),pS=()=>!0,kO=e=>wO.test(e)&&!bO.test(e),lm=()=>!1,CO=e=>SO.test(e),NO=e=>EO.test(e),RO=e=>!ie(e)&&!le(e),TO=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)),PO=e=>Ns(e,yS,lm),ie=e=>fS.test(e),Ts=e=>Ns(e,xS,kO),Xy=e=>Ns(e,DO,be),IO=e=>Ns(e,wS,pS),OO=e=>Ns(e,vS,lm),Zy=e=>Ns(e,gS,lm),_O=e=>Ns(e,mS,NO),oc=e=>Ns(e,bS,CO),le=e=>hS.test(e),nl=e=>mo(e,xS),MO=e=>mo(e,vS),Jy=e=>mo(e,gS),jO=e=>mo(e,yS),AO=e=>mo(e,mS),ic=e=>mo(e,bS,!0),zO=e=>mo(e,wS,!0),Ns=(e,t,n)=>{const r=fS.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},mo=(e,t,n=!1)=>{const r=hS.exec(e);return r?r[1]?t(r[1]):n:!1},gS=e=>e==="position"||e==="percentage",mS=e=>e==="image"||e==="url",yS=e=>e==="length"||e==="size"||e==="bg-size",xS=e=>e==="length",DO=e=>e==="number",vS=e=>e==="family-name",wS=e=>e==="number"||e==="weight",bS=e=>e==="shadow",FO=()=>{const e=lt("color"),t=lt("font"),n=lt("text"),r=lt("font-weight"),s=lt("tracking"),o=lt("leading"),i=lt("breakpoint"),l=lt("container"),a=lt("spacing"),c=lt("radius"),u=lt("shadow"),d=lt("inset-shadow"),f=lt("text-shadow"),p=lt("drop-shadow"),x=lt("blur"),v=lt("perspective"),b=lt("aspect"),m=lt("ease"),g=lt("animate"),y=()=>["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(),le,ie],N=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],C=()=>[le,ie,a],I=()=>[Fr,"full","auto",...C()],P=()=>[Un,"none","subgrid",le,ie],A=()=>["auto",{span:["full",Un,le,ie]},Un,le,ie],F=()=>[Un,"auto",le,ie],z=()=>["auto","min","max","fr",le,ie],R=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],O=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...C()],$=()=>[Fr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],T=()=>[Fr,"screen","full","dvw","lvw","svw","min","max","fit",...C()],j=()=>[Fr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],M=()=>[e,le,ie],U=()=>[...w(),Jy,Zy,{position:[le,ie]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",jO,PO,{size:[le,ie]}],W=()=>[Nf,nl,Ts],q=()=>["","none","full",c,le,ie],B=()=>["",be,nl,Ts],K=()=>["solid","dashed","dotted","double"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[be,Nf,Jy,Zy],J=()=>["","none",x,le,ie],X=()=>["none",be,le,ie],G=()=>["none",be,le,ie],Q=()=>[be,le,ie],te=()=>[Fr,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ir],breakpoint:[ir],color:[pS],container:[ir],"drop-shadow":[ir],ease:["in","out","in-out"],font:[RO],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ir],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ir],shadow:[ir],spacing:["px",be],text:[ir],"text-shadow":[ir],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Fr,ie,le,b]}],container:["container"],"container-type":[{"@container":["","normal","size",le,ie]}],"container-named":[TO],columns:[{columns:[be,ie,le,l]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Un,"auto",le,ie]}],basis:[{basis:[Fr,"full","auto",l,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[be,Fr,"auto","initial","none",ie]}],grow:[{grow:["",be,le,ie]}],shrink:[{shrink:["",be,le,ie]}],order:[{order:[Un,"first","last","none",le,ie]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:A()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:A()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":z()}],"auto-rows":[{"auto-rows":z()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...R(),"normal"]}],"justify-items":[{"justify-items":[...O(),"normal"]}],"justify-self":[{"justify-self":["auto",...O()]}],"align-content":[{content:["normal",...R()]}],"align-items":[{items:[...O(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...O(),{baseline:["","last"]}]}],"place-content":[{"place-content":R()}],"place-items":[{"place-items":[...O(),"baseline"]}],"place-self":[{"place-self":["auto",...O()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mbs:[{mbs:_()}],mbe:[{mbe:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...T()]}],"min-inline-size":[{"min-inline":["auto",...T()]}],"max-inline-size":[{"max-inline":["none",...T()]}],"block-size":[{block:["auto",...j()]}],"min-block-size":[{"min-block":["auto",...j()]}],"max-block-size":[{"max-block":["none",...j()]}],w:[{w:[l,"screen",...$()]}],"min-w":[{"min-w":[l,"screen","none",...$()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,nl,Ts]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,zO,IO]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Nf,ie]}],"font-family":[{font:[MO,OO,t]}],"font-features":[{"font-features":[ie]}],"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,le,ie]}],"line-clamp":[{"line-clamp":[be,"none",le,Xy]}],leading:[{leading:[o,...C()]}],"list-image":[{"list-image":["none",le,ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",le,ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[be,"from-font","auto",le,Ts]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[be,"auto",le,ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"tab-size":[{tab:[Un,le,ie]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le,ie]}],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",le,ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Un,le,ie],radial:["",le,ie],conic:[Un,le,ie]},AO,_O]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-bs":[{"border-bs":B()}],"border-w-be":[{"border-be":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":B()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[be,le,ie]}],"outline-w":[{outline:["",be,nl,Ts]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",u,ic,oc]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",d,ic,oc]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[be,Ts]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",f,ic,oc]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[be,le,ie]}],"mix-blend":[{"mix-blend":[...L(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":L()}],"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":[be]}],"mask-image-linear-from-pos":[{"mask-linear-from":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[le,ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"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":[be]}],"mask-image-conic-from-pos":[{"mask-conic-from":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",le,ie]}],filter:[{filter:["","none",le,ie]}],blur:[{blur:J()}],brightness:[{brightness:[be,le,ie]}],contrast:[{contrast:[be,le,ie]}],"drop-shadow":[{"drop-shadow":["","none",p,ic,oc]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",be,le,ie]}],"hue-rotate":[{"hue-rotate":[be,le,ie]}],invert:[{invert:["",be,le,ie]}],saturate:[{saturate:[be,le,ie]}],sepia:[{sepia:["",be,le,ie]}],"backdrop-filter":[{"backdrop-filter":["","none",le,ie]}],"backdrop-blur":[{"backdrop-blur":J()}],"backdrop-brightness":[{"backdrop-brightness":[be,le,ie]}],"backdrop-contrast":[{"backdrop-contrast":[be,le,ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",be,le,ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[be,le,ie]}],"backdrop-invert":[{"backdrop-invert":["",be,le,ie]}],"backdrop-opacity":[{"backdrop-opacity":[be,le,ie]}],"backdrop-saturate":[{"backdrop-saturate":[be,le,ie]}],"backdrop-sepia":[{"backdrop-sepia":["",be,le,ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",le,ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[be,"initial",le,ie]}],ease:[{ease:["linear","initial",m,le,ie]}],delay:[{delay:[be,le,ie]}],animate:[{animate:["none",g,le,ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,le,ie]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:X()}],"rotate-x":[{"rotate-x":X()}],"rotate-y":[{"rotate-y":X()}],"rotate-z":[{"rotate-z":X()}],scale:[{scale:G()}],"scale-x":[{"scale-x":G()}],"scale-y":[{"scale-y":G()}],"scale-z":[{"scale-z":G()}],"scale-3d":["scale-3d"],skew:[{skew:Q()}],"skew-x":[{"skew-x":Q()}],"skew-y":[{"skew-y":Q()}],transform:[{transform:[le,ie,"","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:[Un,le,ie]}],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"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",le,ie]}],"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":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"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",le,ie]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[be,nl,Ts,Xy]}],stroke:[{stroke:["none",...M()]}],"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"]}},$O=mO(FO);function ot(...e){return $O(iS(e))}const SS=lS("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"}}),xt=S.forwardRef(({className:e,variant:t,...n},r)=>h.jsx("span",{ref:r,className:ot(SS({variant:t}),e),...n}));xt.displayName="Badge";const LO=lS("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"}}),je=S.forwardRef(({className:e,variant:t,size:n,type:r,...s},o)=>h.jsx("button",{ref:o,type:r??"button",className:ot(LO({variant:t,size:n}),e),...s}));je.displayName="Button";const am=S.forwardRef(({className:e,...t},n)=>h.jsx("input",{ref:n,className:ot("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}));am.displayName="Input";const ex={};function En(e,t){const n=S.useRef(ex);return n.current===ex&&(n.current=e(t)),n}const pp=[];let gp;function HO(){return gp}function BO(e){pp.push(e)}function fd(e){const t=(n,r)=>{const s=En(VO).current;let o;try{gp=s;for(const i of pp)i.before(s);o=e(n,r);for(const i of pp)i.after(s);s.didInitialize=!0}finally{gp=void 0}return o};return t.displayName=e.displayName||e.name,t}function ES(e){return S.forwardRef(fd(e))}function VO(){return{didInitialize:!1}}function cm(){}const Yl=Object.freeze([]),wt=Object.freeze({});function um(e){S.useEffect(e,Yl)}const rl=0;class kn{constructor(){xe(this,"currentId",rl);xe(this,"clear",()=>{this.currentId!==rl&&(clearTimeout(this.currentId),this.currentId=rl)});xe(this,"disposeEffect",()=>this.clear)}static create(){return new kn}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=rl,n()},t)}isStarted(){return this.currentId!==rl}}function Tr(){const e=En(kn.create).current;return um(e.disposeEffect),e}const WO=()=>{},fe=typeof document<"u"?S.useLayoutEffect:WO;function UO(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:qO,platform:KO,maxTouchPoints:YO}=UO(),hd=qO.toLowerCase(),Gl=KO.toLowerCase(),pd=/^i(os$|p)/.test(Gl)||Gl==="macintel"&&YO>1,tx="android",mp=Gl===tx||hd.includes(tx),kS=!pd&&Gl.startsWith("mac");Gl.startsWith("win");const GO=kS||pd;var gw;const yo=typeof CSS<"u"&&!!((gw=CSS.supports)!=null&&gw.call(CSS,"-webkit-backdrop-filter:none"));!yo&&hd.includes("firefox");!yo&&hd.includes("chrom");const QO=GO,CS=/jsdom|happydom/.test(hd);function XO(e){e.preventDefault(),e.stopPropagation()}function ZO(e){return"nativeEvent"in e}function NS(e){return e.pointerType===""&&e.isTrusted?!0:mp&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function RS(e){return CS?!1:!mp&&e.width===0&&e.height===0||mp&&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 JO(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function gd(){return typeof window<"u"}function Et(e){return dm(e)?(e.nodeName||"").toLowerCase():"#document"}function tt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _r(e){var t;return(t=(dm(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dm(e){return gd()?e instanceof Node||e instanceof tt(e).Node:!1}function Ce(e){return gd()?e instanceof Element||e instanceof tt(e).Element:!1}function Le(e){return gd()?e instanceof HTMLElement||e instanceof tt(e).HTMLElement:!1}function ki(e){return!gd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof tt(e).ShadowRoot}function ka(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=ln(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function e_(e){return/^(table|td|th)$/.test(Et(e))}function md(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const t_=/transform|translate|scale|rotate|perspective|filter/,n_=/paint|layout|strict|content/,Ps=e=>!!e&&e!=="none";let Rf;function fm(e){const t=Ce(e)?ln(e):e;return Ps(t.transform)||Ps(t.translate)||Ps(t.scale)||Ps(t.rotate)||Ps(t.perspective)||!hm()&&(Ps(t.backdropFilter)||Ps(t.filter))||t_.test(t.willChange||"")||n_.test(t.contain||"")}function r_(e){let t=vs(e);for(;Le(t)&&!gs(t);){if(fm(t))return t;if(md(t))return null;t=vs(t)}return null}function hm(){return Rf==null&&(Rf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Rf}function gs(e){return/^(html|body|#document)$/.test(Et(e))}function ln(e){return tt(e).getComputedStyle(e)}function yd(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vs(e){if(Et(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ki(e)&&e.host||_r(e);return ki(t)?t.host:t}function TS(e){const t=vs(e);return gs(t)?(e.ownerDocument||e).body:Le(t)&&ka(t)?t:TS(t)}function Ql(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=TS(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=tt(s);if(o){const l=yp(i);return t.concat(i,i.visualViewport||[],ka(s)?s:[],l&&n?Ql(l):[])}else return t.concat(s,Ql(s,[],n))}function yp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function hn(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 me(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&&ki(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Ot(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const xp="data-base-ui-focusable",PS="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",IS="data-starting-style",s_="data-ending-style",o_={[IS]:""},i_={[s_]:""},pm={transitionStatus(e){return e==="starting"?o_:e==="ending"?i_:null}},l_="data-open",a_="data-closed",c_="data-anchor-hidden",OS="data-popup-open",u_="data-pressed",d_={[OS]:""},f_={[OS]:"",[u_]:""},h_={[l_]:""},p_={[a_]:""},g_={[c_]:""},_S={open(e){return e?d_:null}},m_={open(e){return e?f_:null}},gm={open(e){return e?h_:p_},anchorHidden(e){return e?g_:null}},mm={...gm,...pm},vp="data-trigger-disabled";function Eu(e,t){if(!Ce(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute(vp);for(const[,r]of t.entries())if(me(r,n))return!r.hasAttribute(vp);return!1}function Tf(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 y_(e){return e.matches("html,body")}function xd(e){return Le(e)&&e.matches(PS)}function x_(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${PS}`))!=null}function nx(e){return e?e.getAttribute("role")==="combobox"&&xd(e):!1}function v_(e){if(!e||CS)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function rx(e){return e?e.hasAttribute(xp)?e:e.querySelector(`[${xp}]`)||e:null}function w_(e,t){return t!=null&&!ps(t)?0:typeof e=="function"?e():e}function io(e,t,n){const r=w_(e,n);return typeof r=="number"?r:r==null?void 0:r[t]}function sx(e){return typeof e=="function"?e():e}function MS(e,t){return t||e==="click"||e==="mousedown"}function b_(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}const vd="none",ws="trigger-press",vt="trigger-hover",Fc="trigger-focus",jS="outside-press",AS="close-press",Xl="focus-out",wd="escape-key",zS="disabled",ox="missing",ix="initial",ym="imperative-action";function _e(e,t,n,r){let s=!1,o=!1;const i=r??wt;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 DS=S.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new kn,currentIdRef:{current:null},currentContextRef:{current:null}});function S_(e,t){e.current=t.current}function E_(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=Tr();return fe(()=>{if(o.current=n,!i.current){s.current=n;return}s.current={open:io(s.current,"open"),close:io(n,"close")}},[n,i,s,o]),h.jsx(DS.Provider,{value:S.useMemo(()=>({hasProvider:!0,delayRef:s,initialDelayRef:o,currentIdRef:i,timeoutMs:r,currentContextRef:l,timeout:a}),[r,a]),children:t})}function k_(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,s=r.useState("floatingId"),o=S.useContext(DS),{currentIdRef:i,delayRef:l,timeoutMs:a,initialDelayRef:c,currentContextRef:u,hasProvider:d,timeout:f}=o,[p,x]=S.useState(!1),v=S.useRef(n);return fe(()=>{v.current=n},[n]),fe(()=>{function b(){var m;(m=u.current)==null||m.setIsInstantPhase(!1),i.current=null,u.current=null,l.current=c.current,f.clear()}if(i.current&&!n&&i.current===s){if(x(!1),a){const m=s;return f.start(a,()=>{r.select("open")||i.current&&i.current!==m||b()}),()=>{(v.current||i.current!==m)&&f.clear()}}b()}},[n,s,i,l,a,c,u,f,r]),fe(()=>{if(!n)return;const b=u.current,m=i.current;f.clear(),u.current={onOpenChange:r.setOpen,setIsInstantPhase:x},i.current=s,l.current={open:0,close:io(c.current,"close")},m!==null&&m!==s?(x(!0),b==null||b.setIsInstantPhase(!0),b==null||b.onOpenChange(!1,_e(vd))):(x(!1),b==null||b.setIsInstantPhase(!1))},[n,s,r,i,l,c,u,f]),fe(()=>()=>{if(i.current===s){if(u.current=null,!v.current)return;i.current=null,S_(l,c),f.clear()}},[u,i,l,s,c,f]),S.useMemo(()=>({activeIdRef:i,hasProvider:d,delayRef:l,isInstantPhase:p}),[i,d,l,p])}function Se(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 Ci(e,t,n,r){const s=En(FS).current;return N_(s,e,t,n,r)&&$S(s,[e,t,n,r]),s.callback}function C_(e){const t=En(FS).current;return R_(t,e)&&$S(t,e),t.callback}function FS(){return{callback:null,cleanup:null,refs:[]}}function N_(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function R_(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function $S(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}}}}}}}function Ft(e){const t=En(T_,e).current;return t.next=e,fe(t.effect),t}function T_(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const xm={...GN},Pf=xm.useInsertionEffect,P_=Pf&&Pf!==xm.useLayoutEffect?Pf:e=>e();function pe(e){const t=En(I_).current;return t.next=e,P_(t.effect),t.trampoline}function I_(){const e={next:void 0,callback:O_,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function O_(){}const lc=null;class __{constructor(){xe(this,"callbacks",[]);xe(this,"callbacksCount",0);xe(this,"nextId",1);xe(this,"startId",1);xe(this,"isScheduled",!1);xe(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.callbacks[n]=null,this.callbacksCount-=1)}}let ac=new __;class Qn{constructor(){xe(this,"currentId",lc);xe(this,"cancel",()=>{this.currentId!==lc&&(ac.cancel(this.currentId),this.currentId=lc)});xe(this,"disposeEffect",()=>this.cancel)}static create(){return new Qn}static request(t){return ac.request(t)}static cancel(t){return ac.cancel(t)}request(t){this.cancel(),this.currentId=ac.request(()=>{this.currentId=lc,t()})}}function vm(){const e=En(Qn.create).current;return um(e.disposeEffect),e}function Ae(e){return(e==null?void 0:e.ownerDocument)||document}const M_={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},j_={...M_,position:"fixed",top:0,left:0},Ni=S.forwardRef(function(t,n){const[r,s]=S.useState();fe(()=>{QO&&yo&&s("button")},[]);const o={tabIndex:0,role:r};return h.jsx("span",{...t,ref:n,style:j_,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})}),Ri=Math.min,wr=Math.max,ku=Math.round,cc=Math.floor,br=e=>({x:e,y:e}),A_={left:"right",right:"left",bottom:"top",top:"bottom"};function LS(e,t,n){return wr(e,Ri(t,n))}function bs(e,t){return typeof e=="function"?e(t):e}function wn(e){return e.split("-")[0]}function Pr(e){return e.split("-")[1]}function wm(e){return e==="x"?"y":"x"}function bm(e){return e==="y"?"height":"width"}function xn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Sm(e){return wm(xn(e))}function z_(e,t,n){n===void 0&&(n=!1);const r=Pr(e),s=Sm(e),o=bm(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Cu(i)),[i,Cu(i)]}function D_(e){const t=Cu(e);return[wp(e),t,wp(t)]}function wp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const lx=["left","right"],ax=["right","left"],F_=["top","bottom"],$_=["bottom","top"];function L_(e,t,n){switch(e){case"top":case"bottom":return n?t?ax:lx:t?lx:ax;case"left":case"right":return t?F_:$_;default:return[]}}function H_(e,t,n,r){const s=Pr(e);let o=L_(wn(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(wp)))),o}function Cu(e){const t=wn(e);return A_[t]+e.slice(t.length)}function B_(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 HS(e){return typeof e!="number"?B_(e):{top:e,right:e,bottom:e,left:e}}function Nu(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 If(e,t){return t<0||t>=e.length}function V_(e,t){return Nl(e.current,{disabledIndices:t})}function W_(e,t){return Nl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Nl(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&&Rl(e,o,r));return o}function Rl(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?!Em(s)||s.matches(":disabled")?!0:!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!1}function U_(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Em(e,t=e?ln(e):null){return!e||!e.isConnected||!t||U_(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const q_='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function K_(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return ki(n)?n.host:null}function bp(e){for(const t of Array.from(e.children))if(Et(t)==="summary")return t;return null}function Y_(e,t){const n=bp(t);return!!n&&(e===n||me(n,e))}function BS(e){const t=e?Et(e):"";return e!=null&&e.matches(q_)&&(t!=="summary"||e.parentElement!=null&&Et(e.parentElement)==="details"&&bp(e.parentElement)===e)&&(t!=="details"||bp(e)==null)&&(t!=="input"||e.type!=="hidden")}function VS(e){if(!BS(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=K_(t)){const n=t!==e,r=Et(t)==="slot";if(t.hasAttribute("inert")||n&&Et(t)==="details"&&!t.open&&!Y_(e,t)||t.hasAttribute("hidden")||!r&&!G_(t,n))return!1}return!0}function G_(e,t){const n=ln(e);return t?n.display!=="none":Em(e,n)}function WS(e){const t=e.tabIndex;if(t<0){const n=Et(e);if(n==="details"||n==="audio"||n==="video"||Le(e)&&e.isContentEditable)return 0}return t}function Of(e){if(Et(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function Q_(e,t){const n=Of(e);if(!n)return!0;const r=t.find(s=>{const o=Of(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=Of(s);return(o==null?void 0:o.name)===n.name&&o.form===n.form})===n}function US(e){if(Le(e)&&Et(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Le(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function qS(e,t){US(e).forEach(n=>{BS(n)&&t.push(n),qS(n,t)})}function KS(e,t,n){US(e).forEach(r=>{Le(r)&&r.matches(t)&&n.push(r),KS(r,t,n)})}function km(e){return VS(e)&&WS(e)>=0}function YS(e){const t=[];return qS(e,t),t.filter(VS)}function Ca(e){const t=YS(e);return t.filter(n=>WS(n)>=0&&Q_(n,t))}function GS(e,t){const n=Ca(e),r=n.length;if(r===0)return;const s=hn(Ae(e)),o=n.indexOf(s),i=o===-1?t===1?0:r-1:o+t;return n[i]}function Cm(e){return GS(Ae(e).body,1)||e}function QS(e){return GS(Ae(e).body,-1)||e}function XS(e,t){if(!e)return null;const n=Ca(Ae(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 X_(e){return XS(e,1)}function Z_(e){return XS(e,-1)}function Xo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!me(n,r)}function J_(e){Ca(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function cx(e){const t=[];KS(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 ux(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 Zl(e){return`data-base-ui-${e}`}let uc=0;function _f(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(uc);function o(){s&&!s()||e==null||e.focus({preventScroll:n})}if(r)return o(),cm;const i=requestAnimationFrame(o);return uc=i,()=>{uc===i&&(cancelAnimationFrame(i),uc=0)}}const Mf={inert:new WeakMap,"aria-hidden":new WeakMap},dx="data-base-ui-inert",Sp={inert:new WeakSet,"aria-hidden":new WeakSet};let sl=new WeakMap,jf=0;function eM(e){return Sp[e]}function ZS(e){return e?ki(e)?e.host:ZS(e.parentNode):null}const fx=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=ZS(n);return e.contains(r)?r:null}).filter(n=>n!=null),hx=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},px=(e,t,n)=>{const r=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(i=>{Et(i)!=="script"&&(t.has(i)?s(i):r.push(i))})};return s(e),r};function tM(e,t,n,r,{mark:s=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let i=null,l=null;const a=fx(t,e),c=s?px(t,hx(a),new Set(a)):[],u=[],d=[];if(o){const f=Mf[o],p=eM(o);l=p,i=f;const x=fx(t,Array.from(t.querySelectorAll("[aria-live]"))),v=a.concat(x);px(t,hx(v),new Set(v)).forEach(m=>{const g=m.getAttribute(o),y=g!==null&&g!=="false",w=(f.get(m)||0)+1;f.set(m,w),u.push(m),w===1&&y&&p.add(m),y||m.setAttribute(o,o==="inert"?"":"true")})}return s&&c.forEach(f=>{const p=(sl.get(f)||0)+1;sl.set(f,p),d.push(f),p===1&&f.setAttribute(dx,"")}),jf+=1,()=>{i&&u.forEach(f=>{const x=(i.get(f)||0)-1;i.set(f,x),x||(!(l!=null&&l.has(f))&&o&&f.removeAttribute(o),l==null||l.delete(f))}),s&&d.forEach(f=>{const p=(sl.get(f)||0)-1;sl.set(f,p),p||f.removeAttribute(dx)}),jf-=1,jf||(Mf.inert=new WeakMap,Mf["aria-hidden"]=new WeakMap,Sp.inert=new WeakSet,Sp["aria-hidden"]=new WeakSet,sl=new WeakMap)}}function gx(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,o=Ae(e[0]).body;return tM(e,o,n,r,{mark:s})}let mx=0;function nM(e,t="mui"){const[n,r]=S.useState(e),s=e||n;return S.useEffect(()=>{n==null&&(mx+=1,r(`${t}-${mx}`))},[n,t]),s}const yx=xm.useId;function bd(e,t){if(yx!==void 0){const n=yx();return e??(t?`${t}-${n}`:n)}return nM(e,t)}function rM(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 Qt=rM("https://base-ui.com/production-error","Base UI"),sM=parseInt(S.version,10);function Nm(e){return sM>=e}function xx(e){if(!S.isValidElement(e))return null;const t=e,n=t.props;return(Nm(19)?n==null?void 0:n.ref:t.ref)??null}function Ep(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function oM(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 iM(e,t){return typeof e=="function"?e(t):e}function lM(e,t){return typeof e=="function"?e(t):e}const Rm={};function Sd(e,t,n,r,s){if(!n&&!r&&!e)return Ru(t);let o=Ru(e);return t&&(o=$c(o,t)),n&&(o=$c(o,n)),r&&(o=$c(o,r)),o}function aM(e){if(e.length===0)return Rm;if(e.length===1)return Ru(e[0]);let t=Ru(e[0]);for(let n=1;n<e.length;n+=1)t=$c(t,e[n]);return t}function Ru(e){return Tm(e)?{...eE(e,Rm)}:cM(e)}function $c(e,t){return Tm(t)?eE(t,e):uM(e,t)}function cM(e){const t={...e};for(const n in t){const r=t[n];JS(n,r)&&(t[n]=tE(r))}return t}function uM(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Ep(e.style,r);break}case"className":{e[n]=nE(e.className,r);break}default:JS(n,r)?e[n]=dM(e[n],r):e[n]=r}}return e}function JS(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 Tm(e){return typeof e=="function"}function eE(e,t){return Tm(e)?e(t):e??Rm}function dM(e,t){return t?e?(...n)=>{const r=n[0];if(rE(r)){const o=r;Tu(o);const i=t(...n);return o.baseUIHandlerPrevented||e==null||e(...n),i}const s=t(...n);return e==null||e(...n),s}:tE(t):e}function tE(e){return e&&((...t)=>{const n=t[0];return rE(n)&&Tu(n),e(...t)})}function Tu(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function nE(e,t){return t?e?t+" "+e:t:e}function rE(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Bt(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=gM(r));const s=fM(t,n,r);if(n.enabled===!1)return null;const o=n.state??wt;return mM(e,r,s,o)}function fM(e,t,n){const{className:r,style:s}=e,{state:o=wt,ref:i,props:l,stateAttributesMapping:a,enabled:c=!0}=t,u=c?iM(r,o):void 0,d=c?lM(s,o):void 0,f=c?oM(o,a):wt,p=c&&l?hM(l):void 0,x=c?Ep(f,p)??{}:wt;return typeof document<"u"&&(c?Array.isArray(i)?x.ref=C_([x.ref,xx(n),...i]):x.ref=Ci(x.ref,xx(n),i):Ci(null,null)),c?(u!==void 0&&(x.className=nE(x.className,u)),d!==void 0&&(x.style=Ep(x.style,d)),x):wt}function hM(e){return Array.isArray(e)?aM(e):Sd(void 0,e)}const pM=Symbol.for("react.lazy");function gM(e){if((e==null?void 0:e.$$typeof)!==pM)return e;const t=S.Children.toArray(e)[0];return S.isValidElement(t)?t:e}function mM(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=Sd(n,t.props);return s.ref=n.ref,S.cloneElement(t,s)}if(e&&typeof e=="string")return yM(e,n);throw new Error(Qt(8))}function yM(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)}const xM=500,vM={style:{transition:"none"}},sE="data-base-ui-click-trigger",oE={fallbackAxisSide:"end"},wM={clipPath:"inset(50%)",position:"fixed",top:0,left:0},iE=S.createContext(null),lE=()=>S.useContext(iE),bM=Zl("portal");function aE(e={}){const{ref:t,container:n,componentProps:r=wt,elementProps:s}=e,o=bd(),i=lE(),l=i==null?void 0:i.portalNode,[a,c]=S.useState(null),[u,d]=S.useState(null),f=pe(b=>{b!==null&&d(b)}),p=S.useRef(null);fe(()=>{if(n===null){p.current&&(p.current=null,d(null),c(null));return}const b=(n&&(dm(n)?n:n.current))??l??document.body;if(b==null){p.current&&(p.current=null,d(null),c(null));return}p.current!==b&&(p.current=b,d(null),c(b))},[n,l]);const x=Bt("div",r,{ref:[t,f],props:[{id:o,[bM]:""},s]}),v=a&&x?on.createPortal(x,a):null;return{node:u,nodeId:S.isValidElement(x)?x.props.id:void 0,subtree:v}}const cE=S.forwardRef(function(t,n){const{render:r,className:s,style:o,children:i,container:l,portalOwnerRole:a,...c}=t,{node:u,nodeId:d,subtree:f}=aE({container:l,ref:n,componentProps:t,elementProps:c}),p=S.useRef(null),x=S.useRef(null),v=S.useRef(null),b=S.useRef(null),[m,g]=S.useState(null),y=S.useRef(!1),w=m==null?void 0:m.modal,E=m==null?void 0:m.open,N=!!m&&!m.modal&&m.open&&!!u;S.useEffect(()=>{if(!u||w)return;function C(I){u&&I.relatedTarget&&Xo(I)&&(I.type==="focusin"?y.current&&(cx(u),y.current=!1):(J_(u),y.current=!0))}return tr(Se(u,"focusin",C,!0),Se(u,"focusout",C,!0))},[u,w]),fe(()=>{!u||E!==!0||!y.current||(cx(u),y.current=!1)},[E,u]);const k=S.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:x,beforeInsideRef:v,afterInsideRef:b,portalNode:u,setFocusManagerState:g}),[u]);return h.jsxs(S.Fragment,{children:[f,h.jsxs(iE.Provider,{value:k,children:[N&&u&&h.jsx(Ni,{"data-type":"outside",ref:p,onFocus:C=>{var I;if(Xo(C,u))(I=v.current)==null||I.focus();else{const P=m?m.domReference:null,A=QS(P);A==null||A.focus()}}}),N&&u&&h.jsx("span",{role:a,"aria-owns":d,style:wM}),u&&on.createPortal(i,u),N&&u&&h.jsx(Ni,{"data-type":"outside",ref:x,onFocus:C=>{var I;if(Xo(C,u))(I=b.current)==null||I.focus();else{const P=m?m.domReference:null,A=Cm(P);A==null||A.focus(),m!=null&&m.closeOnFocusOut&&(m==null||m.onOpenChange(!1,_e(Xl,C.nativeEvent)))}}})]})]})});function uE(){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 SM{constructor(){xe(this,"nodesRef",{current:[]});xe(this,"events",uE())}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 dE=S.createContext(null),fE=S.createContext(null),Ed=()=>{var e;return((e=S.useContext(dE))==null?void 0:e.id)||null},Hi=e=>{const t=S.useContext(fE);return e??t};function EM(e){const t=bd(),n=Hi(e),r=Ed();return fe(()=>{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 kM(e){const{children:t,id:n}=e,r=Ed();return h.jsx(dE.Provider,{value:S.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function CM(e){const{children:t,externalTree:n}=e,r=En(()=>n??new SM).current;return h.jsx(fE.Provider,{value:r,children:t})}function cr(e){return e==null?e:"current"in e?e.current:e}function NM(e,t){const n=tt(Ot(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 vx=20;let os=[];function Pm(){os=os.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function wx(e){Pm(),e&&Et(e)!=="body"&&(os.push(new WeakRef(e)),os.length>vx&&(os=os.slice(-vx)))}function bx(){var e;return Pm(),(e=os[os.length-1])==null?void 0:e.deref()}function RM(e){return e?km(e)?e:Ca(e)[0]||e:null}function Sx(e){var s;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((s=e.getAttribute("role"))!=null&&s.includes("dialog")))return;const n=YS(e).filter(o=>{const i=o.getAttribute("data-tabindex")||"";return km(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 hE(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:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:x}=e,v="rootStore"in t?t.rootStore:t,b=v.useState("open"),m=v.useState("domReferenceElement"),g=v.useState("floatingElement"),{events:y,dataRef:w}=v.context,E=pe(()=>{var G;return(G=w.current.floatingContext)==null?void 0:G.nodeId}),N=s===!1,k=nx(m)&&N,C=Ft(s),I=Ft(o),P=Ft(c),A=Ft(b),F=Hi(p),z=lE(),R=S.useRef(!1),O=S.useRef(!1),_=S.useRef(!1),$=S.useRef(null),T=S.useRef(""),j=S.useRef(""),M=S.useRef(null),U=S.useRef(null),H=Ci(M,f,z==null?void 0:z.beforeInsideRef),V=Ci(U,z==null?void 0:z.afterInsideRef),W=Tr(),q=Tr(),B=vm(),K=z!=null,L=rx(g),Y=pe((G=L)=>G?Ca(G):[]),J=pe(()=>(x==null?void 0:x().filter(G=>G!=null))??[]);S.useEffect(()=>{if(r||!l)return;function G(te){te.key==="Tab"&&me(L,hn(Ae(L)))&&Y().length===0&&!k&&XO(te)}const Q=Ae(L);return Se(Q,"keydown",G)},[r,L,l,k,Y]),S.useEffect(()=>{if(r||!b)return;const G=Ae(L);function Q(){_.current=!1}function te(Oe){const ce=Ot(Oe),we=J(),de=me(g,ce)||me(m,ce)||me(z==null?void 0:z.portalNode,ce)||we.some(Ee=>Ee===ce||me(Ee,ce));_.current=!de,j.current=Oe.pointerType||"keyboard",ce!=null&&ce.closest(`[${sE}]`)&&(O.current=!0,q.start(0,()=>{O.current=!1}))}function ge(){j.current="keyboard"}return tr(Se(G,"pointerdown",te,!0),Se(G,"pointerup",Q,!0),Se(G,"pointercancel",Q,!0),Se(G,"keydown",ge,!0),Q)},[r,g,m,L,b,z,q,J]),S.useEffect(()=>{if(r||!a)return;const G=Ae(L);function Q(){O.current=!0,q.start(0,()=>{O.current=!1})}function te(we){const de=Ot(we);km(de)&&($.current=de)}function ge(we){const de=we.relatedTarget,Ee=we.currentTarget,ne=Ot(we);l&&de==null&&ne!=null&&me(g,ne)&&wx(ne),queueMicrotask(()=>{const ye=E(),ve=v.context.triggerElements,Xe=J(),qe=(de==null?void 0:de.hasAttribute(Zl("focus-guard")))&&[M.current,U.current,z==null?void 0:z.beforeInsideRef.current,z==null?void 0:z.afterInsideRef.current,z==null?void 0:z.beforeOutsideRef.current,z==null?void 0:z.afterOutsideRef.current,cr(d),cr(u)].includes(de),re=!(me(m,de)||me(g,de)||me(de,g)||me(z==null?void 0:z.portalNode,de)||Xe.some(se=>se===de||me(se,de))||ve.hasMatchingElement(se=>me(se,de))||qe||F&&(Ss(F.nodesRef.current,ye).find(se=>{var De,Re;return me((De=se.context)==null?void 0:De.elements.floating,de)||me((Re=se.context)==null?void 0:Re.elements.domReference,de)})||ux(F.nodesRef.current,ye).find(se=>{var De,Re,Mt;return[(De=se.context)==null?void 0:De.elements.floating,rx((Re=se.context)==null?void 0:Re.elements.floating)].includes(de)||((Mt=se.context)==null?void 0:Mt.elements.domReference)===de})));if(Ee===m&&L&&Sx(L),i&&Ee!==m&&!Em(ne)&&hn(G)===G.body){if(Le(L)&&(L.focus(),i==="popup")){B.request(()=>{L.focus()});return}const se=Y(),De=$.current,Re=(De&&se.includes(De)?De:null)||se[se.length-1]||L;Le(Re)&&Re.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(k||!l)&&de&&re&&!O.current&&(k||de!==bx())&&(R.current=!0,v.setOpen(!1,_e(Xl,we)))})}function Oe(){_.current||(w.current.insideReactTree=!0,W.start(0,()=>{w.current.insideReactTree=!1}))}const ce=Le(m)?m:null;if(!(!g&&!ce))return tr(ce&&Se(ce,"focusout",ge),ce&&Se(ce,"pointerdown",Q),g&&Se(g,"focusin",te),g&&Se(g,"focusout",ge),g&&z&&Se(g,"focusout",Oe,!0))},[r,m,g,L,l,F,z,v,a,i,Y,k,E,w,W,q,B,u,d,J]),S.useEffect(()=>{var Ee,ne,ye;if(r||!g||!b)return;const G=Array.from(((Ee=z==null?void 0:z.portalNode)==null?void 0:Ee.querySelectorAll(`[${Zl("portal")}]`))||[]),te=(ye=(ne=(F?ux(F.nodesRef.current,E()):[]).find(ve=>{var Xe;return nx(((Xe=ve.context)==null?void 0:Xe.elements.domReference)||null)}))==null?void 0:ne.context)==null?void 0:ye.elements.domReference,Oe=[...[g,...G,M.current,U.current,z==null?void 0:z.beforeOutsideRef.current,z==null?void 0:z.afterOutsideRef.current,...J()],te,cr(d),cr(u),k?m:null].filter(ve=>ve!=null),ce=gx(Oe,{ariaHidden:l||k,mark:!1}),we=[g,...G].filter(ve=>ve!=null),de=gx(we);return()=>{de(),ce()}},[b,r,m,g,l,z,k,F,E,u,d,J]),fe(()=>{if(!b||r||!Le(L))return;T.current="",j.current="";const G=Ae(L),Q=hn(G);queueMicrotask(()=>{const te=C.current,ge=typeof te=="function"?te(P.current||""):te;if(ge===void 0||ge===!1||me(L,Q))return;let ce=null;const we=()=>(ce==null&&(ce=Y(L)),ce[0]||L);let de;ge===!0||ge===null?de=we():de=cr(ge),de=de||we();const Ee=me(L,hn(G));_f(de,{preventScroll:de===L,shouldFocus(){if(!A.current)return!1;if(Ee)return!0;const ne=hn(G);return!(ne!==de&&me(L,ne))}})})},[r,b,L,Y,C,P,A]),fe(()=>{if(r||!L)return;const G=Ae(L),Q=hn(G),te=P.current==null;wx(Q);function ge(ce){if(ce.open||(T.current=NM(ce.nativeEvent,j.current)),ce.reason===vt&&ce.nativeEvent.type==="mouseleave"&&(R.current=!0),ce.reason===jS)if(ce.nested)R.current=!1;else if(NS(ce.nativeEvent)||RS(ce.nativeEvent))R.current=!1;else{let we=!1;Ae(L).createElement("div").focus({get preventScroll(){return we=!0,!1}}),we?R.current=!1:R.current=!0}}y.on("openchange",ge);function Oe(ce){const we=I.current;let de=typeof we=="function"?we(ce):we;if(de===void 0||de===!1)return null;de===null&&(de=!0);const Ee=m!=null&&m.isConnected?m:null,ne=Q!=null&&Q.isConnected&&Et(Q)!=="body"?Q:null;let ye=te?ne||Ee:Ee||ne;return ye||(ye=bx()||null),typeof de=="boolean"?ye:cr(de)||ye||null}return()=>{y.off("openchange",ge);const ce=hn(G),we=J(),de=me(g,ce)||we.some(ve=>ve===ce||me(ve,ce))||F&&Ss(F.nodesRef.current,E(),!1).some(ve=>{var Xe;return me((Xe=ve.context)==null?void 0:Xe.elements.floating,ce)}),Ee=I.current,ne=T.current,ye=Oe(ne);queueMicrotask(()=>{const ve=RM(ye),Xe=typeof Ee!="boolean";if(Ee&&!R.current&&Le(ve)&&(!(!Xe&&ve!==ce&&ce!==G.body)||de)){const qe={preventScroll:!0};ne==="keyboard"&&(qe.focusVisible=!0),ve.focus(qe)}R.current=!1})}},[r,g,L,I,P,y,F,m,E,J]),fe(()=>{if(!yo||b||!g)return;const G=hn(Ae(g));!Le(G)||!xd(G)||me(g,G)&&G.blur()},[b,g]),fe(()=>{if(!(r||!z))return z.setFocusManagerState({modal:l,closeOnFocusOut:a,open:b,onOpenChange:v.setOpen,domReference:m}),()=>{z.setFocusManagerState(null)}},[r,z,l,b,v,a,m]),fe(()=>{if(!(r||!L))return Sx(L),()=>{queueMicrotask(Pm)}},[r,L]);const X=!r&&(l?!k:!0)&&(K||l);return h.jsxs(S.Fragment,{children:[X&&h.jsx(Ni,{"data-type":"inside",ref:H,onFocus:G=>{var Q;if(l){const te=Y();_f(te[te.length-1])}else if(z!=null&&z.portalNode)if(R.current=!1,Xo(G,z.portalNode)){const te=Cm(m);te==null||te.focus()}else(Q=cr(d??z.beforeOutsideRef))==null||Q.focus()}}),n,X&&h.jsx(Ni,{"data-type":"inside",ref:V,onFocus:G=>{var Q;if(l)_f(Y()[0]);else if(z!=null&&z.portalNode)if(a&&(R.current=!0),Xo(G,z.portalNode)){const te=QS(m);te==null||te.focus()}else(Q=cr(u??z.afterOutsideRef))==null||Q.focus()}})]})}function TM(e,t={}){const{enabled:n=!0,event:r="click",toggle:s=!0,ignoreMouse:o=!1,stickIfOpen:i=!0,touchOpenDelay:l=0,reason:a=ws}=t,c="rootStore"in e?e.rootStore:e,u=c.context.dataRef,d=S.useRef(void 0),f=vm(),p=Tr(),x=S.useMemo(()=>{function v(m,g,y,w){const E=_e(a,g,y);m&&w==="touch"&&l>0?p.start(l,()=>{c.setOpen(!0,E)}):c.setOpen(m,E)}function b(m,g,y){const w=u.current.openEvent,E=c.select("domReferenceElement")!==g;return m&&E||!m||!s?!0:w&&i?!y(w.type):!1}return{onPointerDown(m){d.current=ps(m.pointerType,!0)&&RS(m.nativeEvent)?"virtual":m.pointerType},onMouseDown(m){const g=d.current,y=m.nativeEvent,w=c.select("open");if(m.button!==0||r==="click"||ps(g,!0)&&o)return;const E=b(w,m.currentTarget,C=>C==="click"||C==="mousedown"),N=Ot(y);if(xd(N)){v(E,y,N,g);return}const k=m.currentTarget;f.request(()=>{v(E,y,k,g)})},onClick(m){if(r==="mousedown-only")return;const g=d.current;if(r==="mousedown"&&g){d.current=void 0;return}if(ps(g,!0)&&o)return;const y=c.select("open"),w=b(y,m.currentTarget,E=>E==="click"||E==="mousedown"||E==="keydown"||E==="keyup");v(w,m.nativeEvent,m.currentTarget,g)},onKeyDown(){d.current=void 0}}},[u,r,o,a,c,i,s,f,p,l]);return S.useMemo(()=>n?{reference:x}:wt,[n,x])}function PM(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,d=o.x,f=o.y;return n==null&&t.x&&i&&(n=o.x-t.x),r==null&&t.y&&l&&(r=o.y-t.y),d-=n||0,f-=r||0,c=0,u=0,!s||a?(c=t.axis==="y"?o.width:0,u=t.axis==="x"?o.height:0,d=i&&t.x!=null?t.x:d,f=l&&t.y!=null?t.y:f):s&&!a&&(u=t.axis==="x"?o.height:u,c=t.axis==="y"?o.width:c),s=!0,{width:c,height:u,x:d,y:f,top:f,right:d+c,bottom:f+u,left:d}}}}function Ex(e){return e!=null&&e.clientX!=null}function IM(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),[d,f]=S.useState(),[p,x]=S.useState([]),v=pe(w=>{s.set("positionReference",w)}),b=pe((w,E,N)=>{c.current||a.current.openEvent&&!Ex(a.current.openEvent)||s.set("positionReference",PM(N??l,{x:w,y:E,axis:r,dataRef:a,pointerType:d}))}),m=pe(w=>{o?u.current||(b(w.clientX,w.clientY,w.currentTarget),x([])):b(w.clientX,w.clientY,w.currentTarget)}),g=ps(d)?i:o;S.useEffect(()=>{if(!n){v(l);return}if(!g)return;function w(){var k;(k=u.current)==null||k.call(u),u.current=null}const E=tt(i);function N(k){const C=Ot(k);me(i,C)?w():b(k.clientX,k.clientY)}return!a.current.openEvent||Ex(a.current.openEvent)?u.current=Se(E,"mousemove",N):v(l),w},[g,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 y=S.useMemo(()=>{function w(E){f(E.pointerType)}return{onPointerDown:w,onPointerEnter:w,onMouseMove:m,onMouseEnter:m}},[m]);return S.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function OM(){return!1}function _M(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 Im(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:o="sloppy",referencePress:i=OM,bubbles:l,externalTree:a}=t,c="rootStore"in e?e.rootStore:e,u=c.useState("open"),d=c.useState("floatingElement"),{dataRef:f,events:p}=c.context,x=Hi(a),v=pe(typeof s=="function"?s:()=>!1),b=typeof s=="function"?v:s,m=b!==!1,g=pe(()=>o),{escapeKey:y,outsidePress:w}=_M(l),E=S.useRef(!1),N=S.useRef(!1),k=S.useRef(!1),C=S.useRef(!1),I=S.useRef(!1),P=S.useRef(""),A=S.useRef(null),F=Tr(),z=Tr(),R=pe(()=>{z.clear(),f.current.insideReactTree=!1}),O=pe(W=>{var K;const q=(K=f.current.floatingContext)==null?void 0:K.nodeId;return(x?Ss(x.nodesRef.current,q):[]).some(L=>{var Y;return((Y=L.context)==null?void 0:Y.open)&&!L.context.dataRef.current[W]})}),_=pe(W=>Tf(W,c.select("floatingElement"))||Tf(W,c.select("domReferenceElement"))),$=pe(W=>{i()&&c.setOpen(!1,_e(ws,W.nativeEvent))}),T=pe(W=>{if(!u||!n||!r||W.key!=="Escape"||I.current||!y&&O("__escapeKeyBubbles"))return;const q=ZO(W)?W.nativeEvent:W,B=_e(wd,q);c.setOpen(!1,B),B.isCanceled||W.preventDefault(),!y&&!B.isPropagationAllowed&&W.stopPropagation()}),j=pe(()=>{f.current.insideReactTree=!0,z.start(0,R)}),M=pe(W=>{if(!u||!n||W.button!==0)return;const q=Ot(W.nativeEvent);me(c.select("floatingElement"),q)&&(E.current||(E.current=!0,N.current=!1))}),U=pe(W=>{!u||!n||(W.defaultPrevented||W.nativeEvent.defaultPrevented)&&E.current&&(N.current=!0)});S.useEffect(()=>{function W(q){q.open||(C.current=!1)}return p.on("openchange",W),()=>{p.off("openchange",W)}},[p]),S.useEffect(()=>{if(!u||!n)return u||(C.current=!1),R;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=w;const W=new kn,q=new kn,B=Ae(d);function K(){W.clear(),I.current=!0}function L(){W.start(yo?5:0,()=>{I.current=!1})}function Y(){k.current=!0,q.start(0,()=>{k.current=!1})}function J(){E.current=!1,N.current=!1}function X(){const re=P.current,se=re==="pen"||!re?"mouse":re,De=g(),Re=typeof De=="function"?De():De;return typeof Re=="string"?Re:Re[se]}function G(re){const se=X();return se==="intentional"&&re.type!=="click"||se==="sloppy"&&re.type==="click"}function Q(re){var Re;const se=(Re=f.current.floatingContext)==null?void 0:Re.nodeId,De=x&&Ss(x.nodesRef.current,se).some(Mt=>{var Ln;return Tf(re,(Ln=Mt.context)==null?void 0:Ln.elements.floating)});return _(re)||De}function te(re){if(G(re)){re.type!=="click"&&!_(re)&&(q.clear(),k.current=!1),R();return}if(f.current.insideReactTree){R();return}const se=Ot(re),De=`[${Zl("inert")}]`,Re=Ce(se)?se.getRootNode():null,Mt=Array.from((ki(Re)?Re:Ae(c.select("floatingElement"))).querySelectorAll(De)),Ln=c.context.triggerElements;if(se&&(Ln.hasElement(se)||Ln.hasMatchingElement(gt=>me(gt,se))))return;let Hn=Ce(se)?se:null;for(;Hn&&!gs(Hn);){const gt=vs(Hn);if(gs(gt)||!Ce(gt))break;Hn=gt}if(!(Mt.length&&Ce(se)&&!y_(se)&&!me(se,c.select("floatingElement"))&&Mt.every(gt=>!me(Hn,gt)))){if(Le(se)&&!("touches"in re)){const gt=gs(se),Ar=ln(se),or=/auto|scroll/,Bn=gt||or.test(Ar.overflowX),vo=gt||or.test(Ar.overflowY),wo=Bn&&se.clientWidth>0&&se.scrollWidth>se.clientWidth,bo=vo&&se.clientHeight>0&&se.scrollHeight>se.clientHeight,So=Ar.direction==="rtl",Eo=bo&&(So?re.offsetX<=se.offsetWidth-se.clientWidth:re.offsetX>se.clientWidth),ko=wo&&re.offsetY>se.clientHeight;if(Eo||ko)return}if(!Q(re)){if(X()==="intentional"){if(re.detail!==0&&!NS(re)&&!C.current)return;if(k.current){q.clear(),k.current=!1;return}}typeof b=="function"&&!b(re)||O("__outsidePressBubbles")||(c.setOpen(!1,_e(jS,re)),R())}}}function ge(re){X()!=="sloppy"||re.pointerType==="touch"||!c.select("open")||!n||_(re)||te(re)}function Oe(re){if(X()!=="sloppy"||!c.select("open")||!n||_(re))return;const se=re.touches[0];se&&(A.current={startTime:Date.now(),startX:se.clientX,startY:se.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},F.start(1e3,()=>{A.current&&(A.current.dismissOnTouchEnd=!1,A.current.dismissOnMouseDown=!1)}))}function ce(re,se){const De=Ot(re);if(!De)return;const Re=Se(De,re.type,()=>{se(re),Re()})}function we(re){P.current="touch",ce(re,Oe)}function de(re){F.clear(),re.type==="pointerdown"&&(re.button===0&&(C.current=!0),P.current=re.pointerType),!(re.type==="mousedown"&&A.current&&!A.current.dismissOnMouseDown)&&ce(re,se=>{se.type==="pointerdown"?ge(se):te(se)})}function Ee(re){if(re.type==="pointercancel"&&(C.current=!1),!E.current)return;const se=N.current;if(J(),X()==="intentional"){if(re.type==="pointercancel"){se&&Y();return}if(!Q(re)){if(se){Y();return}typeof b=="function"&&!b(re)||(q.clear(),k.current=!0,R())}}}function ne(re){if(X()!=="sloppy"||!A.current||_(re))return;const se=re.touches[0];if(!se)return;const De=Math.abs(se.clientX-A.current.startX),Re=Math.abs(se.clientY-A.current.startY),Mt=Math.sqrt(De*De+Re*Re);Mt>5&&(A.current.dismissOnTouchEnd=!0),Mt>10&&(te(re),F.clear(),A.current=null)}function ye(re){ce(re,ne)}function ve(re){X()!=="sloppy"||!A.current||_(re)||(A.current.dismissOnTouchEnd&&te(re),F.clear(),A.current=null)}function Xe(re){ce(re,ve)}const qe=tr(r&&tr(Se(B,"keydown",T),Se(B,"compositionstart",K),Se(B,"compositionend",L)),m&&tr(Se(B,"click",de,!0),Se(B,"pointerdown",de,!0),Se(B,"pointerup",Ee,!0),Se(B,"pointercancel",Ee,!0),Se(B,"mousedown",de,!0),Se(B,"mouseup",Ee,!0),Se(B,"touchstart",we,{capture:!0,passive:!0}),Se(B,"touchmove",ye,{capture:!0,passive:!0}),Se(B,"touchend",Xe,{capture:!0,passive:!0})));return()=>{qe(),W.clear(),q.clear(),J(),k.current=!1,R()}},[f,d,r,m,b,u,n,y,w,T,R,g,O,_,x,c,F]);const H=S.useMemo(()=>({onKeyDown:T,onPointerDown:$,onClick:$}),[T,$]),V=S.useMemo(()=>({onKeyDown:T,onPointerDown:U,onMouseDown:U,onClickCapture:j,onMouseDownCapture(W){j(),M(W)},onPointerDownCapture(W){j(),M(W)},onMouseUpCapture:j,onTouchEndCapture:j,onTouchMoveCapture:j}),[T,j,M,U]);return S.useMemo(()=>n?{reference:H,floating:V,trigger:H}:{},[n,H,V])}function kx(e,t,n){let{reference:r,floating:s}=e;const o=xn(t),i=Sm(t),l=bm(i),a=wn(t),c=o==="y",u=r.x+r.width/2-s.width/2,d=r.y+r.height/2-s.height/2,f=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:d};break;case"left":p={x:r.x-s.width,y:d};break;default:p={x:r.x,y:r.y}}const x=Pr(t);return x&&(p[i]+=f*(x==="end"?1:-1)*(n&&c?-1:1)),p}async function MM(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:d="floating",altBoundary:f=!1,padding:p=0}=bs(t,e),x=HS(p),b=l[f?d==="floating"?"reference":"floating":d],m=Nu(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})),g=d==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,y=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),w=await(o.isElement==null?void 0:o.isElement(y))&&await(o.getScale==null?void 0:o.getScale(y))||{x:1,y:1},E=Nu(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:a}):g);return{top:(m.top-E.top+x.top)/w.y,bottom:(E.bottom-m.bottom+x.bottom)/w.y,left:(m.left-E.left+x.left)/w.x,right:(E.right-m.right+x.right)/w.x}}const jM=50,AM=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:MM},a=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:d}=kx(c,r,a),f=r,p=0;const x={};for(let v=0;v<o.length;v++){const b=o[v];if(!b)continue;const{name:m,fn:g}=b,{x:y,y:w,data:E,reset:N}=await g({x:u,y:d,initialPlacement:r,placement:f,strategy:s,middlewareData:x,rects:c,platform:l,elements:{reference:e,floating:t}});u=y??u,d=w??d,x[m]={...x[m],...E},N&&p<jM&&(p++,typeof N=="object"&&(N.placement&&(f=N.placement),N.rects&&(c=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):N.rects),{x:u,y:d}=kx(c,f,a)),v=-1)}return{x:u,y:d,placement:f,strategy:s,middlewareData:x}},zM=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:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,...b}=bs(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const m=wn(s),g=xn(l),y=wn(l)===l,w=await(a.isRTL==null?void 0:a.isRTL(c.floating)),E=f||(y||!v?[Cu(l)]:D_(l)),N=x!=="none";!f&&N&&E.push(...H_(l,v,x,w));const k=[l,...E],C=await a.detectOverflow(t,b),I=[];let P=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&I.push(C[m]),d){const R=z_(s,i,w);I.push(C[R[0]],C[R[1]])}if(P=[...P,{placement:s,overflows:I}],!I.every(R=>R<=0)){var A,F;const R=(((A=o.flip)==null?void 0:A.index)||0)+1,O=k[R];if(O&&(!(d==="alignment"?g!==xn(O):!1)||P.every(T=>xn(T.placement)===g?T.overflows[0]>0:!0)))return{data:{index:R,overflows:P},reset:{placement:O}};let _=(F=P.filter($=>$.overflows[0]<=0).sort(($,T)=>$.overflows[1]-T.overflows[1])[0])==null?void 0:F.placement;if(!_)switch(p){case"bestFit":{var z;const $=(z=P.filter(T=>{if(N){const j=xn(T.placement);return j===g||j==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(j=>j>0).reduce((j,M)=>j+M,0)]).sort((T,j)=>T[1]-j[1])[0])==null?void 0:z[0];$&&(_=$);break}case"initialPlacement":_=l;break}if(s!==_)return{reset:{placement:_}}}return{}}}},pE=new Set(["left","top"]);async function DM(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=wn(n),l=Pr(n),a=xn(n)==="y",c=pE.has(i)?-1:1,u=o&&a?-1:1,d=bs(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof x=="number"&&(p=l==="end"?x*-1:x),a?{x:p*u,y:f*c}:{x:f*c,y:p*u}}const FM=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 DM(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}}}}},$M=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:g=>{let{x:y,y:w}=g;return{x:y,y:w}}},...c}=bs(e,t),u={x:n,y:r},d=await o.detectOverflow(t,c),f=xn(s),p=wm(f);let x=u[p],v=u[f];const b=(g,y)=>LS(y+d[g==="y"?"top":"left"],y,y-d[g==="y"?"bottom":"right"]);i&&(x=b(p,x)),l&&(v=b(f,v));const m=a.fn({...t,[p]:x,[f]:v});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:i,[f]:l}}}}}},LM=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:d=!0}=bs(e,t),f={x:s,y:o},p=xn(i),x=wm(p);let v=f[x],b=f[p];const m=bs(c,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:(n=m.mainAxis)!=null?n:0,crossAxis:(r=m.crossAxis)!=null?r:0};if(u){const E=x==="y"?"height":"width",N=l.reference[x]-l.floating[E]+g.mainAxis,k=l.reference[x]+l.reference[E]-g.mainAxis;v<N?v=N:v>k&&(v=k)}if(d){var y,w;const E=x==="y"?"width":"height",N=pE.has(wn(i)),k=l.reference[p]-l.floating[E]+(N&&((y=a.offset)==null?void 0:y[p])||0)+(N?0:g.crossAxis),C=l.reference[p]+l.reference[E]+(N?0:((w=a.offset)==null?void 0:w[p])||0)-(N?g.crossAxis:0);b<k?b=k:b>C&&(b=C)}return{[x]:v,[p]:b}}}},HM=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=wn(n),u=Pr(n),d=xn(n)==="y",{width:f,height:p}=r.floating;let x,v;c==="top"||c==="bottom"?(x=c,v=u===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(v=c,x=u==="end"?"top":"bottom");const b=p-a.top-a.bottom,m=f-a.left-a.right,g=Ri(p-a[x],b),y=Ri(f-a[v],m),w=t.middlewareData.shift,E=!w;let N=g,k=y;w!=null&&w.enabled.x&&(k=m),w!=null&&w.enabled.y&&(N=b),E&&!u&&(d?k=f-2*wr(a.left,a.right):N=p-2*wr(a.top,a.bottom)),await i({...t,availableWidth:k,availableHeight:N});const C=await s.getDimensions(o.floating);return f!==C.width||p!==C.height?{reset:{rects:!0}}:{}}}};function gE(e){const t=ln(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Le(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,l=ku(n)!==o||ku(r)!==i;return l&&(n=o,r=i),{width:n,height:r,$:l}}function Om(e){return Ce(e)?e:e.contextElement}function Zo(e){const t=Om(e);if(!Le(t))return br(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=gE(t);let i=(o?ku(n.width):n.width)/r,l=(o?ku(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const BM=br(0);function mE(e){const t=tt(e);return!hm()||!t.visualViewport?BM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function VM(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===tt(e)}function lo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Om(e);let i=br(1);t&&(r?Ce(r)&&(i=Zo(r)):i=Zo(e));const l=VM(o,n,r)?mE(o):br(0);let a=(s.left+l.x)/i.x,c=(s.top+l.y)/i.y,u=s.width/i.x,d=s.height/i.y;if(o&&r){const f=tt(o),p=Ce(r)?tt(r):r;let x=f,v=yp(x);for(;v&&p!==x;){const b=Zo(v),m=v.getBoundingClientRect(),g=ln(v),y=m.left+(v.clientLeft+parseFloat(g.paddingLeft))*b.x,w=m.top+(v.clientTop+parseFloat(g.paddingTop))*b.y;a*=b.x,c*=b.y,u*=b.x,d*=b.y,a+=y,c+=w,x=tt(v),v=yp(x)}}return Nu({width:u,height:d,x:a,y:c})}function kd(e,t){const n=yd(e).scrollLeft;return t?t.left+n:lo(_r(e)).left+n}function yE(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-kd(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function WM(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=_r(r),l=t?md(t.floating):!1;if(r===i||l&&o)return n;let a={scrollLeft:0,scrollTop:0},c=br(1);const u=br(0),d=Le(r);if((d||!o)&&((Et(r)!=="body"||ka(i))&&(a=yd(r)),d)){const p=lo(r);c=Zo(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const f=i&&!d&&!o?yE(i,a):br(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-a.scrollTop*c.y+u.y+f.y}}function UM(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function qM(e){const t=yd(e),n=e.ownerDocument.body,r=wr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=wr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+kd(e);const i=-t.scrollTop;return ln(n).direction==="rtl"&&(o+=wr(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:o,y:i}}const KM=25;function YM(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=tt(e),o=_r(e),i=s.visualViewport;let l=o.clientWidth,a=o.clientHeight,c=0,u=0;if(i){const f=!hm()||t==="fixed";r?f||(c=-i.offsetLeft,u=-i.offsetTop):(l=i.width,a=i.height,f&&(c=i.offsetLeft,u=i.offsetTop))}if(kd(o)<=0){const f=o.ownerDocument,p=f.body,x=getComputedStyle(p),v=f.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,b=Math.abs(o.clientWidth-p.clientWidth-v),m=getComputedStyle(o).scrollbarGutter==="stable both-edges"?b/2:b;m<=KM&&(l-=m)}return{width:l,height:a,x:c,y:u}}function GM(e,t){const n=lo(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Zo(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 Cx(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=YM(e,n,t);else if(t==="document")r=qM(_r(e));else if(Ce(t))r=GM(t,n);else{const s=mE(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Nu(r)}function QM(e,t){const n=t.get(e);if(n)return n;let r=Ql(e,[],!1).filter(l=>Ce(l)&&Et(l)!=="body"),s=null;const o=ln(e).position==="fixed";let i=o?vs(e):e;for(;Ce(i)&&!gs(i);){const l=ln(i),a=fm(i),c=s?s.position:o?"fixed":"";!a&&(c==="fixed"||c==="absolute"&&l.position==="static")?r=r.filter(d=>d!==i):s=l,i=vs(i)}return t.set(e,r),r}function XM(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?md(t)?[]:QM(t,this._c):[].concat(n),r],l=Cx(t,i[0],s);let a=l.top,c=l.right,u=l.bottom,d=l.left;for(let f=1;f<i.length;f++){const p=Cx(t,i[f],s);a=wr(p.top,a),c=Ri(p.right,c),u=Ri(p.bottom,u),d=wr(p.left,d)}return{width:c-d,height:u-a,x:d,y:a}}function ZM(e){const{width:t,height:n}=gE(e);return{width:t,height:n}}function JM(e,t,n){const r=Le(t),s=_r(t),o=n==="fixed",i=lo(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const a=br(0);if((r||!o)&&((Et(t)!=="body"||ka(s))&&(l=yd(t)),r)){const f=lo(t,!0,o,t);a.x=f.x+t.clientLeft,a.y=f.y+t.clientTop}!r&&s&&(a.x=kd(s));const c=s&&!r&&!o?yE(s,l):br(0),u=i.left+l.scrollLeft-a.x-c.x,d=i.top+l.scrollTop-a.y-c.y;return{x:u,y:d,width:i.width,height:i.height}}function Af(e){return ln(e).position==="static"}function Nx(e,t){if(!Le(e)||ln(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return _r(e)===n&&(n=n.ownerDocument.body),n}function xE(e,t){const n=tt(e);if(md(e))return n;if(!Le(e)){let s=vs(e);for(;s&&!gs(s);){if(Ce(s)&&!Af(s))return s;s=vs(s)}return n}let r=Nx(e,t);for(;r&&e_(r)&&Af(r);)r=Nx(r,t);return r&&gs(r)&&Af(r)&&!fm(r)?n:r||r_(e)||n}const e2=async function(e){const t=this.getOffsetParent||xE,n=this.getDimensions,r=await n(e.floating);return{reference:JM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function t2(e){return ln(e).direction==="rtl"}const n2={convertOffsetParentRelativeRectToViewportRelativeRect:WM,getDocumentElement:_r,getClippingRect:XM,getOffsetParent:xE,getElementRects:e2,getClientRects:UM,getDimensions:ZM,getScale:Zo,isElement:Ce,isRTL:t2};function vE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function r2(e,t,n){let r=null,s;const o=_r(e);function i(){var u;clearTimeout(s),(u=r)==null||u.disconnect(),r=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),i();const f=e.getBoundingClientRect(),{left:p,top:x,width:v,height:b}=f;if(u||t(),!v||!b)return;const m=cc(x),g=cc(o.clientWidth-(p+v)),y=cc(o.clientHeight-(x+b)),w=cc(p),N={rootMargin:-m+"px "+-g+"px "+-y+"px "+-w+"px",threshold:wr(0,Ri(1,d))||1};let k=!0;function C(I){const P=I[0].intersectionRatio;if(!vE(f,e.getBoundingClientRect()))return l();if(P!==d){if(!k)return l();P?l(!1,P):s=setTimeout(()=>{l(!1,1e-7)},1e3)}k=!1}try{r=new IntersectionObserver(C,{...N,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,N)}r.observe(e)}const a=tt(e),c=()=>l(n);return a.addEventListener("resize",c),l(!0),()=>{a.removeEventListener("resize",c),i()}}function Rx(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=Om(e),u=s||o?[...c?Ql(c):[],...t?Ql(t):[]]:[];u.forEach(m=>{s&&m.addEventListener("scroll",n),o&&m.addEventListener("resize",n)});const d=c&&l?r2(c,n,o):null;let f=-1,p=null;i&&(p=new ResizeObserver(m=>{let[g]=m;g&&g.target===c&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=p)==null||y.observe(t)})),n()}),c&&!a&&p.observe(c),t&&p.observe(t));let x,v=a?lo(e):null;a&&b();function b(){const m=lo(e);v&&!vE(v,m)&&n(),v=m,x=requestAnimationFrame(b)}return n(),()=>{var m;u.forEach(g=>{s&&g.removeEventListener("scroll",n),o&&g.removeEventListener("resize",n)}),d==null||d(),(m=p)==null||m.disconnect(),p=null,a&&cancelAnimationFrame(x)}}const s2=FM,o2=$M,i2=zM,l2=HM,a2=LM,c2=(e,t,n)=>{const r=new Map,s=n??{},o={...n2,...s.platform,_c:r};return AM(e,t,{...s,platform:o})};var u2=typeof document<"u",d2=function(){},Lc=u2?S.useLayoutEffect:d2;function Pu(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(!Pu(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)&&!Pu(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function wE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Tx(e,t){const n=wE(e);return Math.round(t*n)/n}function zf(e){const t=S.useRef(e);return Lc(()=>{t.current=e}),t}function f2(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,d]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=S.useState(r);Pu(f,r)||p(r);const[x,v]=S.useState(null),[b,m]=S.useState(null),g=S.useCallback(T=>{T!==N.current&&(N.current=T,v(T))},[]),y=S.useCallback(T=>{T!==k.current&&(k.current=T,m(T))},[]),w=o||x,E=i||b,N=S.useRef(null),k=S.useRef(null),C=S.useRef(u),I=a!=null,P=zf(a),A=zf(s),F=zf(c),z=S.useCallback(()=>{if(!N.current||!k.current)return;const T={placement:t,strategy:n,middleware:f};A.current&&(T.platform=A.current),c2(N.current,k.current,T).then(j=>{const M={...j,isPositioned:F.current!==!1};R.current&&!Pu(C.current,M)&&(C.current=M,on.flushSync(()=>{d(M)}))})},[f,t,n,A,F]);Lc(()=>{c===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,d(T=>({...T,isPositioned:!1})))},[c]);const R=S.useRef(!1);Lc(()=>(R.current=!0,()=>{R.current=!1}),[]),Lc(()=>{if(w&&(N.current=w),E&&(k.current=E),w&&E){if(P.current)return P.current(w,E,z);z()}},[w,E,z,P,I]);const O=S.useMemo(()=>({reference:N,floating:k,setReference:g,setFloating:y}),[g,y]),_=S.useMemo(()=>({reference:w,floating:E}),[w,E]),$=S.useMemo(()=>{const T={position:n,left:0,top:0};if(!_.floating)return T;const j=Tx(_.floating,u.x),M=Tx(_.floating,u.y);return l?{...T,transform:"translate("+j+"px, "+M+"px)",...wE(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:M}},[n,l,_.floating,u.x,u.y]);return S.useMemo(()=>({...u,update:z,refs:O,elements:_,floatingStyles:$}),[u,z,O,_,$])}const h2=(e,t)=>{const n=s2(e);return{name:n.name,fn:n.fn,options:[e,t]}},p2=(e,t)=>{const n=o2(e);return{name:n.name,fn:n.fn,options:[e,t]}},g2=(e,t)=>({fn:a2(e).fn,options:[e,t]}),m2=(e,t)=>{const n=i2(e);return{name:n.name,fn:n.fn,options:[e,t]}},y2=(e,t)=>{const n=l2(e);return{name:n.name,fn:n.fn,options:[e,t]}};var bE={exports:{}},SE={};/**
|
|
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 Ti=S;function x2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var v2=typeof Object.is=="function"?Object.is:x2,w2=Ti.useState,b2=Ti.useEffect,S2=Ti.useLayoutEffect,E2=Ti.useDebugValue;function k2(e,t){var n=t(),r=w2({inst:{value:n,getSnapshot:t}}),s=r[0].inst,o=r[1];return S2(function(){s.value=n,s.getSnapshot=t,Df(s)&&o({inst:s})},[e,n,t]),b2(function(){return Df(s)&&o({inst:s}),e(function(){Df(s)&&o({inst:s})})},[e]),E2(n),n}function Df(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!v2(e,n)}catch{return!0}}function C2(e,t){return t()}var N2=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?C2:k2;SE.useSyncExternalStore=Ti.useSyncExternalStore!==void 0?Ti.useSyncExternalStore:N2;bE.exports=SE;var Cd=bE.exports,EE={exports:{}},kE={};/**
|
|
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 Nd=S,R2=Cd;function T2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var P2=typeof Object.is=="function"?Object.is:T2,I2=R2.useSyncExternalStore,O2=Nd.useRef,_2=Nd.useEffect,M2=Nd.useMemo,j2=Nd.useDebugValue;kE.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var o=O2(null);if(o.current===null){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=M2(function(){function a(p){if(!c){if(c=!0,u=p,p=r(p),s!==void 0&&i.hasValue){var x=i.value;if(s(x,p))return d=x}return d=p}if(x=d,P2(u,p))return x;var v=r(p);return s!==void 0&&s(x,v)?(u=p,x):(u=p,d=v)}var c=!1,u,d,f=n===void 0?null:n;return[function(){return a(t())},f===null?void 0:function(){return a(f())}]},[t,n,r,s]);var l=I2(e,o[0],o[1]);return _2(function(){i.hasValue=!0,i.value=l},[l]),j2(l),l};EE.exports=kE;var CE=EE.exports;const A2=mw(CE),z2=Nm(19),D2=z2?$2:L2;function NE(e,t,n,r,s){return D2(e,t,n,r,s)}function F2(e,t,n,r,s){const o=S.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return Cd.useSyncExternalStore(e.subscribe,o,o)}BO({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()}}),Cd.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function $2(e,t,n,r,s){const o=HO();if(!o)return F2(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 L2(e,t,n,r,s){return CE.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,s))}class H2{constructor(t){xe(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));xe(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}static create(t){return new this(t)}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 NE(this,t,n,r,s)}}class Rd extends H2{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){S.useDebugValue(t);const r=this;fe(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;fe(()=>(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);fe(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){S.useDebugValue(t);const r=this,s=n!==void 0;fe(()=>{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),NE(this,this.selectors[t],n,r,s)}useContextCallback(t,n){S.useDebugValue(t);const r=pe(n??cm);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 B2={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 RE extends Rd{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:uE(),nested:s,triggerElements:i},B2);xe(this,"syncOpenEvent",(n,r)=>{(!n||!this.state.open||r!=null&&JO(r))&&(this.context.dataRef.current.openEvent=n?r:void 0)});xe(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)});xe(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 V2(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,d=i,f=S.useRef(null);r===void 0&&f.current===null&&(f.current=new RE({open:l,transitionStatus:void 0,referenceElement:a,floatingElement:c,triggerElements:u,onOpenChange:d,floatingId:s,syncOnly:!0,nested:o}));const p=r??f.current;return t.useSyncedValue("floatingId",s),fe(()=>{const x={open:l,floatingId:s,referenceElement:a,floatingElement:c};Ce(a)&&(x.domReferenceElement=a),p.state.positionReference===p.state.referenceElement&&(x.positionReference=a),p.update(x)},[l,s,a,c,p]),p.context.onOpenChange=d,p.context.nested=o,p}function TE(e,t=!1,n=!1,r=!1){const[s,o]=S.useState(e&&t?"idle":void 0),[i,l]=S.useState(e&&!r);return e&&!i&&(l(!0),o("starting")),!e&&i&&s!=="ending"&&!n&&o("ending"),!e&&!i&&s==="ending"&&o(void 0),fe(()=>{if(!e&&i&&s!=="ending"&&n){const a=Qn.request(()=>{o("ending")});return()=>{Qn.cancel(a)}}},[e,i,s,n]),fe(()=>{if(!e||t)return;const a=Qn.request(()=>{o(void 0)});return()=>{Qn.cancel(a)}},[t,e]),fe(()=>{if(!e||!t)return;e&&i&&s!=="idle"&&o("starting");const a=Qn.request(()=>{o("idle")});return()=>{Qn.cancel(a)}},[t,e,i,s]),{mounted:i,setMounted:l,transitionStatus:s}}let dc=null;function W2(e){if(!dc){const t=[];dc=t,queueMicrotask(()=>{dc=null,on.flushSync(()=>{for(const n of t)n()})})}dc.push(e)}function PE(e,t=!1,n=!1){const r=vm();return pe((s,o=null)=>{r.cancel();const i=cr(e);if(i==null)return;const l=i,a=()=>{if(!n){on.flushSync(s);return}W2(()=>{o!=null&&o.aborted||s()})};if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function c(){Promise.all(l.getAnimations().map(u=>u.finished)).then(()=>{o!=null&&o.aborted||a()},()=>{if(o!=null&&o.aborted)return;if(l.getAnimations().some(d=>d.pending||d.playState!=="finished")){c();return}a()})}if(t){const u=IS;if(!l.hasAttribute(u)){r.request(c);return}const d=new MutationObserver(()=>{l.hasAttribute(u)||(d.disconnect(),c())});d.observe(l,{attributes:!0,attributeFilter:[u]}),o==null||o.addEventListener("abort",()=>d.disconnect(),{once:!0});return}r.request(c)})}function Na(e){const{enabled:t=!0,open:n,ref:r,batch:s=!1,onComplete:o}=e,i=pe(o),l=PE(r,n,s);S.useEffect(()=>{if(!t)return;const a=new AbortController;return l(i,a.signal),()=>{a.abort()}},[t,n,i,l])}const _m={tabIndex:-1,[xp]:""};function IE(e){return t=>t==="touch"?e.current:!0}function Mm(e,t=!1){const n=bd(),r=Ed()!=null,s=En(()=>e(n,r)).current;return V2({popupStore:s,treatPopupAsFloatingElement:t,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:s.setOpen}),s}function jm({handle:e,store:t}){return fe(()=>e.attachStore(t),[e,t]),null}function Px(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function U2(e,t){const n=S.useRef(null);return pe(r=>{const s=n.current;if(s!==null){if(s.element===r&&s.store===t&&s.id===e)return;n.current=null;const o=s.store;o.context.triggerElements.getById(s.id)===s.element&&(o.context.triggerElements.delete(s.id),Px(o))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Px(t))})}function Am(e,t,n,r=!1){let s=e.preventUnmountingOnClose;t?s=!1:r&&(s=!0);const o=(n==null?void 0:n.id)??null;let i=e.activeTriggerId,l=e.activeTriggerElement;return(o||t)&&(i=o,l=n??null),{open:t,preventUnmountingOnClose:s,activeTriggerId:i,activeTriggerElement:l}}function OE(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function q2(e,t,n,r={}){var u,d,f;const s=n.reason,o=s===vt,i=t&&s===Fc,l=!t&&(s===ws||s===wd),a=OE(n);if((d=(u=e.context).onOpenChange)==null||d.call(u,t,n),n.isCanceled)return;(f=r.onBeforeDispatch)==null||f.call(r),e.state.floatingRootContext.dispatchOpenChange(t,n);const c=()=>{const p=Am(e.state,t,n.trigger,a()),x={...r.extraState,...p};i?x.instantType="focus":l?x.instantType="dismiss":o&&(x.instantType=void 0),e.update(x)};o?on.flushSync(c):c()}function _E(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=U2(e,n),i=pe(a=>{const c=n.select("open"),u=n.select("activeTriggerId");if(u===e){const d={activeTriggerElement:a,...c?r:null};n.update(d);return}if(u==null&&c){const d={activeTriggerId:e??null,activeTriggerElement:a,...r};n.update(d)}}),l=pe(a=>{o(a),a&&i(a)});return fe(()=>(l(t.current),()=>l(null)),[l,t,n,e]),fe(()=>{if(s){const a={activeTriggerElement:t.current,...r};n.update(a)}},[s,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:s}}function zm(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");fe(()=>{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 d=null;if(u){const f=e.context.triggerElements.getById(u);if(f)r.current=u,f!==e.state.activeTriggerElement&&(c.activeTriggerElement=f);else{for(const[p,x]of e.context.triggerElements.entries())if(x===e.state.activeTriggerElement){c.activeTriggerId=p,c.activeTriggerElement=x,r.current=p;break}c.activeTriggerId===void 0&&(r.current===u?d=u:r.current=null)}}else r.current=null;if(!d&&!u&&a===1){const f=e.context.triggerElements.entries().next();if(!f.done){const[p,x]=f.value;c.activeTriggerId=p,c.activeTriggerElement=x,r.current=p}}(c.triggerCount!==void 0||c.activeTriggerId!==void 0||c.activeTriggerElement!==void 0)&&e.update(c),d&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===d&&!e.context.triggerElements.getById(d)){const f=_e(vd);e.setOpen(!1,f),f.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,e,o,i,l,n])}function Dm(e,t,n,r){const{mounted:s,setMounted:o,transitionStatus:i}=TE(e,!1,!1,r),l=t.useState("preventUnmountingOnClose"),a=e?!1:l;t.useSyncedValues({mounted:s,transitionStatus:i,preventUnmountingOnClose:a});const c=pe(()=>{var u,d;o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(d=(u=t.context).onOpenChangeComplete)==null||d.call(u,!1)});return Na({enabled:s&&!e&&!a,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:i}}function Fm(e,t){e.useSyncedValues(t),fe(()=>()=>{e.update({activeTriggerProps:wt,inactiveTriggerProps:wt,popupProps:wt})},[e])}function ME(e,t){fe(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),fe(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class $m{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 Lm(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new RE({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:wt,inactiveTriggerProps:wt,popupProps:wt}}const Tl=e=>e.triggerIdProp??e.activeTriggerId,Hm=e=>e.openProp??e.open,Ix=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function jE(e,t){return t!==void 0&&Hm(e)&&Tl(e)===t}function K2(e,t){return jE(e,t)?!0:t!==void 0&&Hm(e)&&Tl(e)==null&&e.triggerCount===1}const Bm={open:Hm,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:Tl,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Ix,isTriggerActive:(e,t)=>t!==void 0&&Tl(e)===t,isOpenedByTrigger:(e,t)=>jE(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Tl(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>K2(e,t)?Ix(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function AE(e){const t=S.useCallback(r=>e===void 0?cm:e.subscribeStore(r),[e]),n=S.useCallback(()=>e===void 0?void 0:e.store,[e]);return Cd.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function Y2(e){return G2(e,e.rootContext)}function G2(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),[d,f]=S.useState(void 0),[p,x]=S.useState(void 0),v=S.useRef(null),b=Hi(r),m=S.useMemo(()=>({reference:s,floating:o,domReference:i}),[s,o,i]),g=f2({...e,elements:{...m,...c&&{reference:c}}}),y=Ce(d)?d:null,w=p===void 0?t.state.floatingElement:p;t.useSyncedValue("referenceElement",d??null),t.useSyncedValue("domReferenceElement",d===void 0?i:y),t.useSyncedValue("floatingElement",w);const E=S.useCallback(A=>{const F=Ce(A)?{getBoundingClientRect:()=>A.getBoundingClientRect(),getClientRects:()=>A.getClientRects(),contextElement:A}:A;u(F),g.refs.setReference(F)},[g.refs]),N=S.useCallback(A=>{(Ce(A)||A===null)&&(v.current=A,f(A)),(Ce(g.refs.reference.current)||g.refs.reference.current===null||A!==null&&!Ce(A))&&g.refs.setReference(A)},[g.refs,f]),k=S.useCallback(A=>{x(A),g.refs.setFloating(A)},[g.refs]),C=S.useMemo(()=>({...g.refs,setReference:N,setFloating:k,setPositionReference:E,domReference:v}),[g.refs,N,k,E]),I=S.useMemo(()=>({...g.elements,domReference:i}),[g.elements,i]),P=S.useMemo(()=>({...g,dataRef:t.context.dataRef,open:l,onOpenChange:t.setOpen,events:t.context.events,floatingId:a,refs:C,elements:I,nodeId:n,rootStore:t}),[g,C,I,n,t,l,a]);return fe(()=>{i&&(v.current=i)},[i]),fe(()=>{t.context.dataRef.current.floatingContext=P;const A=b==null?void 0:b.nodesRef.current.find(F=>F.id===n);A&&(A.context=P)}),S.useMemo(()=>({...g,context:P,refs:C,elements:I,rootStore:t}),[g,C,I,P,t])}const Ff=kS&&yo;function Q2(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=Tr();S.useEffect(()=>{const f=s.select("domReferenceElement");if(!n)return;const p=tt(f);function x(){const m=s.select("domReferenceElement");!s.select("open")&&Le(m)&&m===hn(Ae(m))&&(l.current=!0,a.current=m)}function v(){c.current=!0}function b(){c.current=!1}return tr(Se(p,"blur",x),Ff&&Se(p,"keydown",v,!0),Ff&&Se(p,"pointerdown",b,!0))},[s,n]),S.useEffect(()=>{if(!n)return;function f(p){if(p.reason===ws||p.reason===wd){const x=s.select("domReferenceElement");Ce(x)&&(a.current=x,l.current=!0)}}return o.on("openchange",f),()=>{o.off("openchange",f)}},[o,n,s]);const d=S.useMemo(()=>{function f(){l.current=!1,a.current=null}return{onMouseLeave(){f()},onFocus(p){const x=p.currentTarget;if(l.current){if(a.current===x)return;f()}const v=Ot(p.nativeEvent);if(Ce(v)){if(Ff&&!p.relatedTarget){if(!c.current&&!xd(v))return}else if(!v_(v))return}const b=Eu(p.relatedTarget,s.context.triggerElements),{nativeEvent:m,currentTarget:g}=p,y=typeof r=="function"?r():r;if(s.select("open")&&b||y===0||y===void 0){s.setOpen(!0,_e(Fc,m,g));return}u.start(y,()=>{l.current||s.setOpen(!0,_e(Fc,m,g))})},onBlur(p){f();const x=p.relatedTarget,v=p.nativeEvent,b=Ce(x)&&x.hasAttribute(Zl("focus-guard"))&&x.getAttribute("data-type")==="outside";u.start(0,()=>{var w;const m=s.select("domReferenceElement"),g=hn(Ae(m));!x&&g===m||me((w=i.current.floatingContext)==null?void 0:w.refs.floating.current,g)||me(m,g)||b||Eu(x??g,s.context.triggerElements)||s.setOpen(!1,_e(Fc,v))})}}},[i,r,s,u]);return S.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}class Vm{constructor(){xe(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});xe(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 kn,this.restTimeout=new kn,this.handleCloseOptions=void 0}static create(){return new Vm}}const Iu=new WeakMap;function Ou(e){var n,r,s;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Iu.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"),Iu.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function zE(e,t){const{scopeElement:n,referenceElement:r,floatingElement:s}=t,o=Iu.get(n);o&&o!==e&&Ou(o),Ou(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=s,Iu.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",s.style.pointerEvents="auto"}function Wm(e){const t=e.context.dataRef.current,n=En(()=>t.hoverInteractionState??Vm.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),um(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function DE(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=Hi(),d=Ed(),f=Wm(o),p=Tr(),x=pe(()=>{var m;return MS((m=c.current.openEvent)==null?void 0:m.type,f.interactedInside)}),v=pe(()=>{var m;return b_((m=c.current.openEvent)==null?void 0:m.type)}),b=pe(()=>{Ou(f)});fe(()=>{i||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,b())},[i,f,b]),S.useEffect(()=>b,[b]),fe(()=>{var m,g,y,w,E;if(n&&i&&(m=f.handleCloseOptions)!=null&&m.blockPointerEvents&&v()&&Ce(a)&&l){const N=a,k=l,C=Ae(l),I=(y=(g=u==null?void 0:u.nodesRef.current.find(z=>z.id===d))==null?void 0:g.context)==null?void 0:y.elements.floating;I&&(I.style.pointerEvents="");const P=f.pointerEventsScopeElement!==k?f.pointerEventsScopeElement:null,A=I!==k?I:null,F=((E=(w=f.handleCloseOptions)==null?void 0:w.getScope)==null?void 0:E.call(w))??P??A??N.closest("[data-rootownerid]")??C.body;return zE(f,{scopeElement:F,referenceElement:N,floatingElement:k}),()=>{b()}}},[n,i,a,l,f,v,u,d,b]),S.useEffect(()=>{if(!n)return;function m(){return!!(u&&d&&Ss(u.nodesRef.current,d).length>0)}function g(C){const I=io(r,"close",f.pointerType),P=()=>{o.setOpen(!1,_e(vt,C)),u==null||u.events.emit("floating.closed",C)};I?f.openChangeTimeout.start(I,P):(f.openChangeTimeout.clear(),P())}function y(C){const I=Ot(C);if(!x_(I)){f.interactedInside=!1;return}f.interactedInside=(I==null?void 0:I.closest("[aria-haspopup]"))!=null}function w(){f.openChangeTimeout.clear(),p.clear(),u==null||u.events.off("floating.closed",N),b()}function E(C){var F;if(m()&&u){u.events.on("floating.closed",N);return}if(Eu(C.relatedTarget,o.context.triggerElements))return;const I=((F=c.current.floatingContext)==null?void 0:F.nodeId)??s,P=C.relatedTarget;if(!(u&&I&&Ce(P)&&Ss(u.nodesRef.current,I,!1).some(z=>{var R;return me((R=z.context)==null?void 0:R.elements.floating,P)}))){if(f.handler){f.handler(C);return}b(),v()&&!x()&&g(C)}}function N(C){!u||!d||m()||p.start(0,()=>{u.events.off("floating.closed",N),o.setOpen(!1,_e(vt,C)),u.events.emit("floating.closed",C)})}const k=l;return tr(k&&Se(k,"mouseenter",w),k&&Se(k,"mouseleave",E),k&&Se(k,"pointerdown",y,!0),()=>{u==null||u.events.off("floating.closed",N)})},[n,l,o,c,r,s,v,x,b,f,u,d,p])}const X2={current:null};function FE(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:s=null,mouseOnly:o=!1,restMs:i=0,move:l=!0,triggerElementRef:a=X2,externalTree:c,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:x=!1}=t,v="rootStore"in e?e.rootStore:e,{dataRef:b,events:m}=v.context,g=Hi(c),y=Wm(v),w=S.useRef(!1),E=Ft(s),N=Ft(r),k=Ft(i),C=Ft(n),I=Ft(p),P=Ft(f),A=pe(()=>{var _;return MS((_=b.current.openEvent)==null?void 0:_.type,y.interactedInside)}),F=pe(()=>{var _;return((_=I.current)==null?void 0:_.call(I))!==!1}),z=pe((_,$,T)=>{const j=v.context.triggerElements;if(j.hasElement($))return!_||!me(_,$);if(!Ce(T))return!1;const M=T;return j.hasMatchingElement(U=>me(U,M))&&(!_||!me(_,M))}),R=pe(()=>{if(!y.handler)return;Ae(v.select("domReferenceElement")).removeEventListener("mousemove",y.handler),y.handler=void 0}),O=pe(()=>{Ou(y)});return u&&(y.handleCloseOptions=s==null?void 0:s.__options),S.useEffect(()=>R,[R]),S.useEffect(()=>{if(!n)return;function _($){$.open?w.current=!1:(w.current=$.reason===vt,R(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return m.on("openchange",_),()=>{m.off("openchange",_)}},[n,m,y,R]),S.useEffect(()=>{if(!n)return;function _(H,V=!0){const W=io(N.current,"close",y.pointerType);W?y.openChangeTimeout.start(W,()=>{v.setOpen(!1,_e(vt,H)),g==null||g.events.emit("floating.closed",H)}):V&&(y.openChangeTimeout.clear(),v.setOpen(!1,_e(vt,H)),g==null||g.events.emit("floating.closed",H))}const $=a.current??(u?v.select("domReferenceElement"):null);if(!Ce($))return;function T(H){var ce;if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,o&&!ps(y.pointerType))return;const V=sx(k.current),W=io(N.current,"open",y.pointerType),q=Ot(H),B=H.currentTarget??null,K=v.select("domReferenceElement");let L=B;if(Ce(q)&&!v.context.triggerElements.hasElement(q)){for(const we of v.context.triggerElements.elements())if(me(we,q)){L=we;break}}Ce(B)&&Ce(K)&&!v.context.triggerElements.hasElement(B)&&me(B,K)&&(L=K);const Y=L==null?!1:z(K,L,q),J=v.select("open"),X=((ce=P.current)==null?void 0:ce.call(P))??v.select("transitionStatus")==="ending",G=!J&&X&&w.current,Q=!Y&&Ce(L)&&Ce(K)&&me(K,L)&&G,te=V>0&&!W,ge=Y&&(J||G)||Q,Oe=!J||Y;if(ge){F()&&v.setOpen(!0,_e(vt,H,L));return}te||(W?y.openChangeTimeout.start(W,()=>{Oe&&F()&&v.setOpen(!0,_e(vt,H,L))}):Oe&&F()&&v.setOpen(!0,_e(vt,H,L)))}function j(H){if(A()){O();return}R();const V=v.select("domReferenceElement"),W=Ae(V);y.restTimeout.clear(),y.restTimeoutPending=!1;const q=b.current.floatingContext??(d==null?void 0:d());if(Eu(H.relatedTarget,v.context.triggerElements))return;if(E.current&&q){v.select("open")||y.openChangeTimeout.clear();const K=a.current;y.handler=E.current({...q,tree:g,x:H.clientX,y:H.clientY,onClose(){O(),R(),C.current&&!A()&&K===v.select("domReferenceElement")&&_(H,!0)}}),W.addEventListener("mousemove",y.handler),y.handler(H);return}(y.pointerType==="touch"?!me(v.select("floatingElement"),H.relatedTarget):!0)&&_(H)}function M(H){me($,H.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}const U=x?Se($,"mouseout",M):void 0;return l?tr(Se($,"mousemove",T,{once:!0}),Se($,"mouseenter",T),Se($,"mouseleave",j),U):tr(Se($,"mouseenter",T),Se($,"mouseleave",j),U)},[R,O,b,N,v,n,E,y,u,z,A,o,l,k,a,g,C,d,P,F,x]),S.useMemo(()=>{if(!n)return;function _($){y.pointerType=$.pointerType}return{onPointerDown:_,onPointerEnter:_,onMouseMove($){var q,B,K;const{nativeEvent:T}=$,j=$.currentTarget,M=v.select("domReferenceElement"),U=v.select("open"),H=z(M,j,$.target);if(o&&!ps(y.pointerType))return;if(U&&H&&((q=y.handleCloseOptions)!=null&&q.blockPointerEvents)){const L=v.select("floatingElement");if(L){const Y=((K=(B=y.handleCloseOptions)==null?void 0:B.getScope)==null?void 0:K.call(B))??j.ownerDocument.body;zE(y,{scopeElement:Y,referenceElement:j,floatingElement:L})}}const V=sx(k.current);if(U&&!H||V===0||!H&&y.restTimeoutPending&&$.movementX**2+$.movementY**2<2)return;y.restTimeout.clear();function W(){if(y.restTimeoutPending=!1,A())return;const L=v.select("open");!y.blockMouseMove&&(!L||H)&&F()&&v.setOpen(!0,_e(vt,T,j))}y.pointerType==="touch"?on.flushSync(()=>{W()}):H&&U?W():(y.restTimeoutPending=!0,y.restTimeout.start(V,W))}}},[n,y,A,z,o,v,k,F])}const Ox=.1,Z2=Ox*Ox,Fe=.5;function fc(e,t,n,r,s,o){return r>=t!=o>=t&&e<=(s-n)*(t-r)/(o-r)+n}function hc(e,t,n,r,s,o,i,l,a,c){let u=!1;return fc(e,t,n,r,s,o)&&(u=!u),fc(e,t,s,o,i,l)&&(u=!u),fc(e,t,i,l,a,c)&&(u=!u),fc(e,t,a,c,n,r)&&(u=!u),u}function J2(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function pc(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 $E(e={}){const{blockPointerEvents:t=!1}=e,n=new kn,r=({x:s,y:o,placement:i,elements:l,onClose:a,nodeId:c,tree:u})=>{const d=i==null?void 0:i.split("-")[0];let f=!1,p=null,x=null,v=typeof performance<"u"?performance.now():0;function b(g,y){const w=performance.now(),E=w-v;if(p===null||x===null||E===0)return p=g,x=y,v=w,!1;const N=g-p,k=y-x,C=N*N+k*k,I=E*E*Z2;return p=g,x=y,v=w,C<I}function m(){n.clear(),a()}return function(y){n.clear();const w=l.domReference,E=l.floating;if(!w||!E||d==null||s==null||o==null)return;const{clientX:N,clientY:k}=y,C=Ot(y),I=y.type==="mouseleave",P=me(E,C),A=me(w,C);if(P&&(f=!0,!I))return;if(A&&(f=!1,!I)){f=!0;return}if(I&&Ce(y.relatedTarget)&&me(E,y.relatedTarget))return;function F(){return!!(u&&Ss(u.nodesRef.current,c).length>0)}function z(){F()||m()}if(F())return;const R=w.getBoundingClientRect(),O=E.getBoundingClientRect(),_=s>O.right-O.width/2,$=o>O.bottom-O.height/2,T=O.width>R.width,j=O.height>R.height,M=(T?R:O).left,U=(T?R:O).right,H=(j?R:O).top,V=(j?R:O).bottom;if(d==="top"&&o>=R.bottom-1||d==="bottom"&&o<=R.top+1||d==="left"&&s>=R.right-1||d==="right"&&s<=R.left+1){z();return}let W=!1;switch(d){case"top":W=pc(N,k,M,R.top+1,U,O.bottom-1);break;case"bottom":W=pc(N,k,M,O.top+1,U,R.bottom-1);break;case"left":W=pc(N,k,O.right-1,V,R.left+1,H);break;case"right":W=pc(N,k,R.right-1,V,O.left+1,H);break}if(W)return;if(f&&!J2(N,k,R)){z();return}if(!I&&b(N,k)){z();return}let q=!1;switch(d){case"top":{const B=T?Fe/2:Fe*4,K=T||_?s+B:s-B,L=T?s-B:_?s+B:s-B,Y=o+Fe+1,J=_||T?O.bottom-Fe:O.top,X=_?T?O.bottom-Fe:O.top:O.bottom-Fe;q=hc(N,k,K,Y,L,Y,O.left,J,O.right,X);break}case"bottom":{const B=T?Fe/2:Fe*4,K=T||_?s+B:s-B,L=T?s-B:_?s+B:s-B,Y=o-Fe,J=_||T?O.top+Fe:O.bottom,X=_?T?O.top+Fe:O.bottom:O.top+Fe;q=hc(N,k,K,Y,L,Y,O.left,J,O.right,X);break}case"left":{const B=j?Fe/2:Fe*4,K=j||$?o+B:o-B,L=j?o-B:$?o+B:o-B,Y=s+Fe+1,J=$||j?O.right-Fe:O.left,X=$?j?O.right-Fe:O.left:O.right-Fe;q=hc(N,k,J,O.top,X,O.bottom,Y,K,Y,L);break}case"right":{const B=j?Fe/2:Fe*4,K=j||$?o+B:o-B,L=j?o-B:$?o+B:o-B,Y=s-Fe,J=$||j?O.left+Fe:O.right,X=$?j?O.left+Fe:O.right:O.left+Fe;q=hc(N,k,Y,K,Y,L,J,O.top,X,O.bottom);break}}q?f||n.start(40,z):z()}};return r.__options={...e,blockPointerEvents:t},r}const LE=S.createContext(void 0);function Ra(e){const t=S.useContext(LE);if(t===void 0&&!e)throw new Error(Qt(47));return t}const ej={...Bm,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 tj extends Rd{constructor(n,r,s){const o=new $m;super(nj(n,o,r,s),rj(o),ej);xe(this,"setOpen",(n,r)=>{var d,f;const s=r.reason===vt,o=r.reason===ws&&r.event.detail===0,i=!n&&(r.reason===wd||r.reason==null),l=OE(r),a=this.select("activeTriggerId");if(!n&&r.reason===AS&&r.trigger==null&&a!=null&&(r.trigger=this.context.triggerElements.getById(a)??this.select("activeTriggerElement")??void 0),(f=(d=this.context).onOpenChange)==null||f.call(d,n,r),r.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,r);const c=()=>{const p=Am(this.state,n,r.trigger,l());p.openChangeReason=r.reason,this.update(p)};s?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(xM,()=>{this.set("stickIfOpen",!1)}),on.flushSync(c)):c();let u;o?u="click":i?u="dismiss":r.reason===Xl&&(u="focus"),this.set("instantType",u)})}}function nj(e,t,n,r=!1){const s={...Lm(t,n,r),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}function rj(e){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:S.createRef(),beforeContentFocusGuardRef:S.createRef(),stickIfOpenTimeout:new kn,triggerElements:e}}const _x=fd(function({props:t}){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:i,modal:l=!1,handle:a,triggerId:c,defaultTriggerId:u=null}=t,d=oj(a,{modal:l,open:s,openProp:r,activeTriggerId:u,triggerIdProp:c});d.useControlledProp("openProp",r),d.useControlledProp("triggerIdProp",c);const f=d.useState("open"),p=d.useState("mounted"),x=d.useState("payload");d.useContextCallback("onOpenChange",o),d.useContextCallback("onOpenChangeComplete",i),ME(d,f),zm(d);const{forceUnmount:v}=Dm(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:l}),S.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]),S.useImperativeHandle(t.actionsRef,()=>({unmount:v,close:()=>d.setOpen(!1,_e(ym))}),[v,d]);const b=f||p;return h.jsxs(LE.Provider,{value:d,children:[a&&h.jsx(jm,{handle:a,store:d}),b&&h.jsx(ij,{store:d,modal:l}),typeof n=="function"?n({payload:x}):n]})});function sj(e){return Ra(!0)?h.jsx(_x,{props:e}):h.jsx(CM,{children:h.jsx(_x,{props:e})})}function oj(e,t){const n=Mm((r,s)=>new tj(t,r,s));return S.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function ij({store:e,modal:t}){const n=e.useState("floatingRootContext"),r=Im(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),s=r.reference,o=r.floating;return Fm(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:o}),null}const HE=S.createContext(void 0);function Um(e=!1){const t=S.useContext(HE);if(t===void 0&&!e)throw new Error(Qt(16));return t}function lj(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 $f(e,t,{detail:n=0}={}){e.dispatchEvent(new(tt(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function qm(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:o}=e,i=S.useRef(null),l=Um(!0),a=o??l!==void 0,{props:c}=lj({focusableWhenDisabled:n,disabled:t,composite:a,tabIndex:r,isNativeButton:s}),u=S.useCallback(()=>{const p=i.current;Lf(p)&&a&&t&&c.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,c.disabled,a]);fe(u,[u]);const d=S.useCallback((p={})=>{const{onClick:x,onMouseDown:v,onKeyUp:b,onKeyDown:m,onPointerDown:g,...y}=p;return Sd({onClick(w){if(t){w.preventDefault();return}x==null||x(w)},onMouseDown(w){t||v==null||v(w)},onKeyDown(w){if(t||(Tu(w),m==null||m(w),w.baseUIHandlerPrevented))return;const E=w.target===w.currentTarget,N=w.currentTarget,k=Lf(N),C=!s&&aj(N),I=E&&(s?k:!C),P=w.key==="Enter",A=w.key===" ",F=N.getAttribute("role"),z=(F==null?void 0:F.startsWith("menuitem"))||F==="option"||F==="gridcell";if(E&&a&&A){if(w.defaultPrevented&&z)return;w.preventDefault(),(!s||k)&&(w.preventBaseUIHandler(),$f(N,w));return}if(!I||s||!A&&!P){E&&C&&A&&w.preventDefault();return}w.defaultPrevented||(w.preventDefault(),P&&(w.preventBaseUIHandler(),$f(N,w)))},onKeyUp(w){if(!t){if(Tu(w),b==null||b(w),w.target===w.currentTarget&&s&&a&&Lf(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!s&&!a&&!w.defaultPrevented&&w.key===" "&&(w.preventBaseUIHandler(),$f(w.currentTarget,w))}},onPointerDown(w){if(t){w.preventDefault();return}g==null||g(w)}},s?{type:"button"}:{role:"button"},c,y)},[t,c,a,s]),f=pe(p=>{i.current=p,u()});return{getButtonProps:d,buttonRef:f}}function Lf(e){return Le(e)&&e.tagName==="BUTTON"}function aj(e){return Le(e)&&e.tagName==="A"&&!!e.href}const cj=300;function Bi(e){return bd(e,"base-ui")}function uj(e,t){const n=S.useRef(null);function r(o){on.flushSync(()=>{e.setOpen(!1,_e(Xl,o.nativeEvent,o.currentTarget))});const i=Z_(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{on.flushSync(()=>{e.setOpen(!1,_e(Xl,o.nativeEvent,o.currentTarget))});let a=X_(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&me(i,a);){const c=a;if(a=Cm(a),a===c)break}a==null||a.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:s}}function dj(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 fj(e,t){const n=pe((o,i)=>{(typeof e=="function"?e():e)||t(i||(pd?"touch":""))}),{onClick:r,onPointerDown:s}=dj(n);return S.useMemo(()=>({onClick:r,onPointerDown:s}),[r,s])}const hj=ES(function(t,n){const{render:r,className:s,style:o,disabled:i=!1,nativeButton:l=!0,handle:a,payload:c,openOnHover:u=!1,delay:d=cj,closeDelay:f=0,id:p,...x}=t,v=Ra(!0),m=AE(a)??v;if(!m)throw new Error(Qt(74));const g=Bi(p),y=m.useState("isTriggerActive",g),w=m.useState("floatingRootContext"),E=m.useState("isOpenedByTrigger",g),N=m.useState("triggerPopupId",g),k=S.useRef(null),{registerTrigger:C,isMountedByThisTrigger:I}=_E(g,k,m,{payload:c,disabled:i,openOnHover:u,closeDelay:f}),P=m.useState("openChangeReason"),A=m.useState("stickIfOpen"),F=m.useState("openMethod"),z=m.useState("focusManagerModal"),R=FE(w,{enabled:!i&&u&&(F!=="touch"||P!==ws),mouseOnly:!0,move:!1,handleClose:$E(),restMs:d,delay:{close:f},triggerElementRef:k,isActiveTrigger:y,isClosing:()=>m.select("transitionStatus")==="ending"}),O=TM(w,{stickIfOpen:A}),_=fj(()=>m.select("open"),K=>{m.set("openMethod",K)}),$=m.useState("triggerProps",I),{getButtonProps:T,buttonRef:j}=qm({disabled:i,native:l}),M={open(K){return K&&P===ws?m_.open(K):_S.open(K)}},{preFocusGuardRef:U,handlePreFocusGuardFocus:H,handleFocusTargetFocus:V}=uj(m,k),q=Bt("button",t,{state:{disabled:i,open:E},ref:[j,n,C,k],props:[O.reference,R,$,_,{[sE]:"",id:g,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":N},x,T],stateAttributesMapping:M}),B=h.jsx(S.Fragment,{children:q},g);return I&&!z?h.jsxs(S.Fragment,{children:[h.jsx(Ni,{ref:U,onFocus:H}),B,h.jsx(Ni,{ref:m.context.triggerFocusTargetRef,onFocus:V})]}):B}),BE=S.createContext(void 0);function pj(){const e=S.useContext(BE);if(e===void 0)throw new Error(Qt(45));return e}const gj=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Ra().useState("mounted")||r?h.jsx(BE.Provider,{value:r,children:h.jsx(cE,{ref:n,...s})}):null});function Km(e){return Nm(19)?e:e?"true":void 0}const VE=S.createContext(void 0);function mj(){const e=S.useContext(VE);if(!e)throw new Error(Qt(46));return e}const yj=S.createContext(void 0);function WE(){const e=S.useContext(yj);return(e==null?void 0:e.direction)??"ltr"}const xj=e=>({name:"arrow",options:e,async fn(t){var j,M;const{x:n,y:r,placement:s,rects:o,platform:i,elements:l,middlewareData:a}=t,{element:c,padding:u=0,offsetParent:d="real"}=bs(e,t)||{};if(c==null)return{};const f=HS(u),p={x:n,y:r},x=Sm(s),v=bm(x),b=await i.getDimensions(c),m=x==="y",g=m?"top":"left",y=m?"bottom":"right",w=m?"clientHeight":"clientWidth",E=o.reference[v]+o.reference[x]-p[x]-o.floating[v],N=p[x]-o.reference[x],k=d==="real"?await((j=i.getOffsetParent)==null?void 0:j.call(i,c)):l.floating;let C=l.floating[w]||o.floating[v];(!C||!await((M=i.isElement)==null?void 0:M.call(i,k)))&&(C=l.floating[w]||o.floating[v]);const I=E/2-N/2,P=C/2-b[v]/2-1,A=Math.min(f[g],P),F=Math.min(f[y],P),z=A,R=C-b[v]-F,O=C/2-b[v]/2+I,_=LS(z,O,R),$=!a.arrow&&Pr(s)!=null&&O!==_&&o.reference[v]/2-(O<z?A:F)-b[v]/2<0,T=$?O<z?O-z:O-R:0;return{[x]:p[x]+T,data:{[x]:_,centerOffset:O-_-T,...$&&{alignmentOffset:T}},reset:$}}}),vj=(e,t)=>{const{name:n,fn:r}=xj(e);return{name:n,fn:r,options:[e,t]}},wj={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}}}},bj={sideX:"left",sideY:"top"},Sj="--available-width",Ej="--available-height",kj="--anchor-width",Cj="--anchor-height",Nj="--transform-origin",Mx=Sj,jx=Ej;function UE(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 Ax(e,t,n){const{rects:r,placement:s}=e;return{side:UE(t,wn(s),n),align:Pr(s)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function qE(e){return Rj(e,Y2)}function Rj(e,t){var ko,Ma;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:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:x=!1,floatingRootContext:v,mounted:b,collisionAvoidance:m,shift:g,nodeId:y,adaptiveOrigin:w,lazyFlip:E=!1,externalTree:N}=e,[k,C]=S.useState(null);!b&&k!==null&&C(null);const I=m.side||"flip",P=m.align||"flip",A=m.fallbackAxisSide||"end",F=(g==null?void 0:g.crossAxis)??!1,z=g==null?void 0:g.rootBoundary,R=typeof n=="function"?n:void 0,O=pe(R),_=R?O:n,$=Ft(n),T=Ft(b),M=WE()==="rtl",U=k||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":M?"left":"right","inline-start":M?"right":"left"}[s],H=i==="center"?U:`${U}-${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 W=1,q=s==="bottom"?W:0,B=s==="top"?W:0,K=s==="right"?W:0,L=s==="left"?W:0,Y={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:V},J=S.useRef(null),X=Ft(o),G=Ft(l),Q=typeof o!="function"?o:0,te=typeof l!="function"?l:0,ge=[];p&&ge.push(p),ge.push(h2(ke=>{const ft=Ax(ke,s,M),Vt=typeof X.current=="function"?X.current(ft):X.current,kt=typeof G.current=="function"?G.current(ft):G.current;return{mainAxis:Vt,crossAxis:kt,alignmentAxis:kt}},[Q,te,M,s]));const Oe=P==="none"&&I!=="shift",ce=!Oe&&(u||F||I==="shift"),we=I==="none"?null:m2({...Y,padding:{top:V.top+W+q,right:V.right+W+L,bottom:V.bottom+W+B,left:V.left+W+K},mainAxis:!F&&I==="flip",crossAxis:P==="flip"?"alignment":!1,fallbackAxisSideDirection:A}),de=Oe?null:p2({...Y,rootBoundary:z,mainAxis:P!=="none",crossAxis:ce,limiter:u||F?void 0:g2(ke=>{if(!J.current)return{};const{width:ft,height:Vt}=J.current.getBoundingClientRect(),kt=xn(wn(ke.placement)),dn=kt==="y"?ft:Vt,Xt=kt==="y"?V.left+V.right:V.top+V.bottom;return{offset:dn/2+Xt/2}})},[Y,u,F,z,V,P]);I==="shift"||P==="shift"||i==="center"?ge.push(de,we):ge.push(we,de),ge.push(y2({...Y,apply({elements:{floating:ke},availableWidth:ft,availableHeight:Vt,rects:kt}){if(!T.current)return;const dn=ke.style;dn.setProperty(Mx,`${ft}px`),dn.setProperty(jx,`${Vt}px`);const Xt=tt(ke).devicePixelRatio||1,{x:Co,y:zr,width:No,height:Vn}=kt.reference,Cn=(Math.round((Co+No)*Xt)-Math.round(Co*Xt))/Xt,Rs=(Math.round((zr+Vn)*Xt)-Math.round(zr*Xt))/Xt;dn.setProperty(kj,`${Cn}px`),dn.setProperty(Cj,`${Rs}px`)}}),vj(ke=>({element:J.current||Ae(ke.elements.floating).createElement("div"),padding:J.current?d:0,offsetParent:"floating"}),[d]),{name:"transformOrigin",fn(ke){var ja,Aa,Ui,qi,za,Da;const{elements:{floating:ft},middlewareData:Vt,placement:kt,platform:dn,rects:Xt,y:Co}=ke,zr=wn(kt),No=Pr(kt),Vn=xn(zr)==="y",Cn=J.current,Rs=typeof o=="function"?o(Ax(ke,s,M)):o;let Ro;if(!Cn&&No&&Math.abs(Vn?((ja=Vt.shift)==null?void 0:ja.x)||0:((Aa=Vt.shift)==null?void 0:Aa.y)||0)<=1)Ro=No==="start"===(Vn&&((Ui=dn.isRTL)==null?void 0:Ui.call(dn,ft))===!0)?"100%":"0%";else{const Ud=Vn?((qi=Vt.arrow)==null?void 0:qi.x)||0:((za=Vt.arrow)==null?void 0:za.y)||0,qd=Vn?(Cn==null?void 0:Cn.clientWidth)||0:(Cn==null?void 0:Cn.clientHeight)||0;Ro=`${Ud+qd/2}px`}let Wi=zr==="top"||zr==="left"?`calc(100% + ${Rs}px)`:`${-Rs}px`;return ce&&Vn&&Math.abs(((Da=Vt.shift)==null?void 0:Da.y)||0)>Rs&&(Wi=`${Xt.reference.y+Xt.reference.height/2-Co}px`),ft.style.setProperty(Nj,Vn?`${Ro} ${Wi}`:`${Wi} ${Ro}`),{}}},wj,w),fe(()=>{!b&&v&&v.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[b,v]);const Ee=S.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:ne,elements:ye,x:ve,y:Xe,middlewareData:qe,update:re,placement:se,context:De,isPositioned:Re,floatingStyles:Mt}=t({rootContext:v,open:x?b:void 0,placement:H,middleware:ge,strategy:r,whileElementsMounted:x?void 0:(...ke)=>Rx(...ke,Ee),nodeId:y,externalTree:N}),{sideX:Ln,sideY:Hn}=qe.adaptiveOrigin||bj,gt=Re?r:"fixed",Ar=S.useMemo(()=>{let ke;return Re?w?ke={position:gt,[Ln]:ve,[Hn]:Xe}:ke={...Mt,position:gt}:ke={position:gt,top:0,left:0},ke[Mx]="100vw",ke[jx]="100vh",Re||(ke.opacity=0),ke},[w,gt,Ln,ve,Hn,Xe,Mt,Re]),or=S.useRef(null);fe(()=>{if(!b)return;const ke=$.current,ft=typeof ke=="function"?ke():ke,kt=(zx(ft)?ft.current:ft)||null||null;kt!==or.current&&(ne.setPositionReference(kt),or.current=kt)},[b,ne,_,$]),S.useEffect(()=>{if(!b)return;const ke=$.current;typeof ke!="function"&&zx(ke)&&ke.current!==or.current&&(ne.setPositionReference(ke.current),or.current=ke.current)},[b,ne,_,$]),S.useEffect(()=>{if(x&&b&&ye.reference&&ye.floating)return Rx(ye.reference,ye.floating,re,Ee)},[x,b,ye,re,Ee]);const Bn=wn(se),vo=UE(s,Bn,M),wo=Pr(se)||"center",bo=!!((ko=qe.hide)!=null&&ko.referenceHidden);fe(()=>{E&&b&&Re&&Bn!==U&&C(Bn)},[E,b,Re,Bn,U]);const So=S.useMemo(()=>{var ke,ft;return{position:"absolute",top:(ke=qe.arrow)==null?void 0:ke.y,left:(ft=qe.arrow)==null?void 0:ft.x}},[qe.arrow]),Eo=((Ma=qe.arrow)==null?void 0:Ma.centerOffset)!==0;return S.useMemo(()=>({positionerStyles:Ar,arrowStyles:So,arrowRef:J,arrowUncentered:Eo,side:vo,align:wo,physicalSide:Bn,anchorHidden:bo,refs:ne,context:De,isPositioned:Re,update:re}),[Ar,So,J,Eo,vo,wo,Bn,bo,ne,De,Re,re])}function zx(e){return e!=null&&"current"in e}const KE=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 h.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});function Ym(e){return e==="starting"?vM:wt}function YE(e,t,{styles:n,transitionStatus:r,props:s,refs:o,hidden:i,inert:l=!1}){const a={...n};return l&&(a.pointerEvents="none"),Bt("div",e,{state:t,ref:o,props:[{role:"presentation",hidden:i,style:a},Ym(r),s],stateAttributesMapping:gm})}let Dx={},Fx={},$x="";function Td(e,t){return ka(e)?e:t}function Lx(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Td(t,n)).overflowY)}function Tj(e){if(typeof document>"u")return!1;const t=Ae(e);return tt(t).innerWidth-t.documentElement.clientWidth>0}function Pj(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Ae(e),r=n.documentElement,s=n.body,o=Td(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 Ij(e){const t=Ae(e),n=t.documentElement,r=t.body,s=Td(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 Oj(e){var p;const t=Ae(e),n=t.documentElement,r=t.body,s=tt(n);let o=0,i=0,l=!1;const a=Qn.create();if(yo&&(((p=s.visualViewport)==null?void 0:p.scale)??1)!==1)return()=>{};function c(){const x=s.getComputedStyle(n),v=s.getComputedStyle(r),g=(x.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,Dx={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},$x=n.style.scrollBehavior,Fx={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 y=n.scrollHeight>n.clientHeight,w=n.scrollWidth>n.clientWidth,E=x.overflowY==="scroll"||v.overflowY==="scroll",N=x.overflowX==="scroll"||v.overflowX==="scroll",k=Math.max(0,s.innerWidth-r.clientWidth),C=Math.max(0,s.innerHeight-r.clientHeight),I=parseFloat(v.marginTop)+parseFloat(v.marginBottom),P=parseFloat(v.marginLeft)+parseFloat(v.marginRight),A=Td(n,r);if(l=Pj(e),l){n.style.scrollbarGutter=g,A.style.overflowY="hidden",A.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:g,overflowY:"hidden",overflowX:"hidden"}),(y||E)&&(n.style.overflowY="scroll"),(w||N)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:I||C?`calc(100dvh - ${I+C}px)`:"100dvh",width:P||k?`calc(100vw - ${P+k}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,Dx),Object.assign(r.style,Fx),l||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=$x)}function d(){u(),a.request(c)}c();const f=Se(s,"resize",d);return()=>{a.cancel(),u(),typeof s.removeEventListener=="function"&&f()}}class _j{constructor(){xe(this,"lockCount",0);xe(this,"restore",null);xe(this,"timeoutLock",kn.create());xe(this,"timeoutUnlock",kn.create());xe(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});xe(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=Ae(t),r=n.documentElement,s=n.body,o=tt(r);if(Lx(o,r,s)){const l=new o.MutationObserver(()=>{Lx(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=pd||!Tj(t);this.restore=i?Ij(t):Oj(t)}}const Mj=new _j;function GE(e=!0,t=null){fe(()=>{if(e)return Mj.acquire(t)},[e,t])}const jj=20;function Aj(e,t,n,r){const[s,o]=S.useState(!1);fe(()=>{if(!e||!t||n==null){o(!1);return}const i=Ae(n).documentElement.clientWidth,l=n.offsetWidth;o(i>0&&l>0&&l>=i-jj)},[e,t,n]),GE(e&&(!t||s),r)}const zj=S.forwardRef(function(t,n){const{render:r,className:s,style:o,anchor:i,positionMethod:l,side:a,align:c,sideOffset:u,alignOffset:d,collisionBoundary:f="clipping-ancestors",collisionPadding:p,arrowPadding:x,sticky:v,disableAnchorTracking:b=!1,collisionAvoidance:m=oE,...g}=t,y=Ra(),w=pj(),E=EM(),N=y.useState("floatingRootContext"),k=y.useState("mounted"),C=y.useState("open"),I=y.useState("openChangeReason"),P=y.useState("activeTriggerElement"),A=y.useState("modal"),F=y.useState("openMethod"),z=y.useState("positionerElement"),R=y.useState("instantType"),O=y.useState("transitionStatus"),_=y.useState("adaptiveOrigin"),$=S.useRef(null),T=PE(z),j=qE({anchor:i,floatingRootContext:N,positionMethod:l,mounted:k,side:a,sideOffset:u,align:c,alignOffset:d,arrowPadding:x,collisionBoundary:f,collisionPadding:p,sticky:v,disableAnchorTracking:b,keepMounted:w,nodeId:E,collisionAvoidance:m,adaptiveOrigin:_}),M=N.useState("domReferenceElement");fe(()=>{const q=M,B=$.current;if(q&&($.current=q),B&&q&&q!==B){y.set("instantType",void 0);const K=new AbortController;return T(()=>{y.set("instantType","trigger-change")},K.signal),()=>{K.abort()}}},[M,T,y]);const U=A===!0&&I!==vt;Aj(C&&U,F==="touch",z,P);const H=y.useStateSetter("positionerElement"),V={open:C,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:R},W=YE(t,V,{styles:j.positionerStyles,transitionStatus:O,props:g,refs:[n,H],hidden:!k,inert:!C});return h.jsxs(VE.Provider,{value:j,children:[k&&U&&h.jsx(KE,{inert:Km(!C),cutout:P}),h.jsx(kM,{id:E,children:W})]})}),kp="ArrowUp",Cp="ArrowDown",Np="ArrowLeft",Rp="ArrowRight",Tp="Home",Pp="End",Gm=new Set([kp,Cp,Np,Rp,Tp,Pp]),Dj="Shift",Fj=[Dj,"Control","Alt","Meta"];function $j(e){return Le(e)&&e.tagName==="INPUT"}function Hx(e){return!!($j(e)&&e.selectionStart!=null||Le(e)&&e.tagName==="TEXTAREA")}function Bx(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=Vx(e,t,"left"),c=gc(e),u=gc(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=Vx(e,t,"top"),c=gc(e),u=gc(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 Vx(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 gc(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 Lj=S.createContext(void 0);function Hj(e){return S.useContext(Lj)}const Bj=S.createContext(void 0);function Vj(){const[e,t]=S.useState(0),n=pe(()=>(t(s=>s+1),()=>{t(s=>Math.max(0,s-1))}));return{context:S.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const Wj=S.forwardRef(function(t,n){const{render:r,className:s,style:o,initialFocus:i,finalFocus:l,...a}=t,c=Ra(),u=mj(),d=Hj()!=null,{context:f,hasClosePart:p}=Vj(),x=c.useState("open"),v=c.useState("openMethod"),b=c.useState("instantType"),m=c.useState("transitionStatus"),g=c.useState("popupProps"),y=c.useState("titleElementId"),w=c.useState("descriptionElementId"),E=c.useState("modal"),N=c.useState("mounted"),k=c.useState("openChangeReason"),C=c.useState("activeTriggerElement"),I=c.useState("floatingRootContext"),P=I.useState("floatingId"),A=c.useState("disabled"),F=c.useState("openOnHover"),z=c.useState("closeDelay");Na({open:x,ref:c.context.popupRef,onComplete(){var j,M;x&&((M=(j=c.context).onOpenChangeComplete)==null||M.call(j,!0))}}),DE(I,{enabled:F&&!A,closeDelay:z});const R=i===void 0?IE(c.context.popupRef):i,O=E!==!1&&p;c.useSyncedValue("focusManagerModal",O);const _=c.useStateSetter("popupElement"),$={open:x,side:u.side,align:u.align,instant:b,transitionStatus:m},T=Bt("div",t,{state:$,ref:[n,c.context.popupRef,_],props:[g,{id:P,role:"dialog",..._m,"aria-labelledby":y,"aria-describedby":w,onKeyDown(j){d&&Gm.has(j.key)&&j.stopPropagation()}},Ym(m),a],stateAttributesMapping:mm});return h.jsx(hE,{context:I,openInteractionType:v,modal:O,disabled:!N||k===vt,initialFocus:R,returnFocus:l,restoreFocus:"popup",previousFocusableElement:Le(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:h.jsx(Bj.Provider,{value:f,children:T})})}),Pi=sj,Ii=hj,ao=S.forwardRef(({className:e,side:t="bottom",align:n="end",sideOffset:r=4,...s},o)=>h.jsx(gj,{children:h.jsx(zj,{side:t,align:n,sideOffset:r,collisionPadding:8,className:"z-40",children:h.jsx(Wj,{ref:o,className:ot("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})})}));ao.displayName="PopoverContent";const Uj=48,qj=60,Kj=24;function Yj({glyph:e,label:t,placeholder:n,value:r,onChange:s,options:o,loading:i,failed:l,search:a,onSearchChange:c,hasMore:u,loadingMore:d,onLoadMore:f,allowCustom:p=!0,title:x}){const[v,b]=S.useState(!1),[m,g]=S.useState(""),y=c!==void 0,w=y?a??"":m,E=y?c:g,N=S.useMemo(()=>{const O=w.trim().toLowerCase(),_=O&&!y?o.filter(T=>T.value.toLowerCase().includes(O)):o;return[...r.filter(T=>!_.some(j=>j.value===T)).filter(T=>!O||T.toLowerCase().includes(O)).map(T=>({value:T,count:0})),..._]},[o,w,y,r]),k=S.useRef(null),C=()=>{const O=k.current;!O||!u||d||!f||O.scrollTop+O.clientHeight>=O.scrollHeight-Uj&&f()},I=O=>{s(r.includes(O)?r.filter(_=>_!==O):[...r,O])},P=N.length>qj,A=Jg({count:N.length,getScrollElement:()=>k.current,estimateSize:()=>Kj,overscan:8,enabled:P}),F=O=>{const _=r.includes(O.value);return h.jsxs("button",{type:"button",role:"option","aria-selected":_,onClick:()=>I(O.value),className:ot("mono flex w-full items-center gap-2 px-2 py-1 text-left text-xs hover:bg-zinc-800",_?"text-zinc-100":"text-zinc-400"),children:[h.jsx("span",{className:"w-3 shrink-0",children:_&&h.jsx(nm,{width:12,height:12})}),h.jsx("span",{className:"truncate",children:O.value}),h.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-zinc-600",children:O.count})]},O.value)},z=w.trim(),R=p&&z!==""&&!N.some(O=>O.value===z)&&!r.includes(z);return h.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-line px-2 py-1 transition-colors focus-within:border-zinc-600",children:[e!==void 0&&h.jsx("span",{className:"shrink-0 text-zinc-600","aria-hidden":!0,children:e}),h.jsxs(Pi,{open:v,onOpenChange:b,children:[h.jsx(Ii,{render:h.jsx("button",{type:"button","aria-label":t,title:x??t,className:"mono flex min-w-0 flex-1 flex-wrap items-center gap-1 py-0.5 text-left text-xs text-zinc-200 focus:outline-none"}),children:r.length===0?h.jsx("span",{className:"text-zinc-600",children:n}):r.map(O=>h.jsx(xt,{className:"mono max-w-[10rem] truncate",children:O},O))}),h.jsxs(ao,{align:"start",className:"w-72 p-0",children:[h.jsx("div",{className:"border-b border-line px-2",children:h.jsx(am,{autoFocus:!0,value:w,onChange:O=>E(O.target.value),placeholder:p?"search, or type a value…":"search…",onKeyDown:O=>{O.key!=="Enter"||!R||(O.preventDefault(),I(z),E(""))}})}),h.jsxs("div",{ref:k,onScroll:C,className:"max-h-64 overflow-auto py-1",role:"listbox",tabIndex:-1,"aria-multiselectable":!0,"aria-label":t,children:[R&&h.jsxs("button",{type:"button","aria-label":`use ${z} as typed`,onClick:()=>{I(z),E("")},className:"mono flex w-full items-center gap-2 px-2 py-1 text-left text-xs text-zinc-300 hover:bg-zinc-800",children:[h.jsx("span",{className:"w-3 shrink-0 text-zinc-600",children:"+"}),h.jsx("span",{className:"truncate",children:z}),h.jsx("span",{className:"ml-auto text-[10px] text-zinc-600",children:"use as typed"})]}),d&&N.length>0&&h.jsx("p",{className:"px-2 py-1 text-[10px] text-zinc-600",children:"loading more…"}),N.length===0&&!R&&h.jsx("p",{className:ot("px-2 py-2 text-[11px]",l?"text-rose-300":"text-zinc-600"),children:l?"couldn't load values — type one instead":i?"loading…":"no values here"}),P?h.jsx("div",{className:"relative w-full",style:{height:`${A.getTotalSize()}px`},children:A.getVirtualItems().map(O=>{var _;return h.jsx("div",{ref:A.measureElement,"data-index":O.index,className:"absolute top-0 left-0 w-full",style:{transform:`translateY(${O.start}px)`},children:F(N[O.index])},((_=N[O.index])==null?void 0:_.value)??O.key)})}):N.map(F)]})]})]}),r.length>0&&h.jsx(je,{variant:"ghost",size:"icon",onClick:()=>s([]),title:`clear ${t}`,"aria-label":`clear ${t}`,className:"h-4 w-4",children:h.jsx(xs,{width:12,height:12})})]})}const Wx=50,Gj=200;function Qj(e,t){const[n,r]=S.useState(e);return S.useEffect(()=>{const s=setTimeout(()=>r(e),t);return()=>clearTimeout(s)},[e,t]),n}function Xj(e){return e.filter(t=>t.value!==null).map(t=>({value:t.value,count:t.count}))}function _u({field:e,scope:t,value:n,onChange:r,glyph:s,label:o,placeholder:i,title:l,single:a}){const[c,u]=S.useState(""),d=Qj(c,Gj),f=_R({queryKey:["run-values",e,t,d],queryFn:({pageParam:x})=>$e.values(e,t,{limit:Wx,offset:x,search:d}),initialPageParam:0,getNextPageParam:(x,v)=>x.length<Wx?void 0:v.reduce((b,m)=>b+m.length,0),staleTime:1e4}),p=S.useMemo(()=>{var x;return Xj(((x=f.data)==null?void 0:x.pages.flat())??[])},[f.data]);return h.jsx(Yj,{label:o,placeholder:i,...l!==void 0&&{title:l},...s!==void 0&&{glyph:s},value:n,onChange:x=>r(a?x.slice(-1):x),options:p,search:c,onSearchChange:u,loading:f.isLoading,failed:f.isError,hasMore:f.hasNextPage,loadingMore:f.isFetchingNextPage,onLoadMore:()=>void f.fetchNextPage()})}const QE=[{op:"eq",label:"is"},{op:"in",label:"is any of"},{op:"ne",label:"is not"},{op:"gte",label:"≥"},{op:"gt",label:">"},{op:"lte",label:"≤"},{op:"lt",label:"<"}];function Zj(e){const[t,n,...r]=e.split(":");return!t||!n||r.length===0?null:{key:t,op:n,operand:r.join(":")}}function mc(e){var r;const t=Zj(e);if(!t)return e;const n=((r=QE.find(s=>s.op===t.op))==null?void 0:r.label)??t.op;return`${t.key} ${n} ${t.operand.split("|").join(", ")}`}function Jj({value:e,onChange:t,scope:n}){const[r,s]=S.useState(!1),[o,i]=S.useState(""),[l,a]=S.useState("eq"),[c,u]=S.useState([]),[d,f]=S.useState(""),p=l==="eq"||l==="in",x=p?c.join("|"):d.trim(),v=o!==""&&x!=="",b=()=>{i(""),a("eq"),u([]),f("")},m=()=>{if(!v)return;const g=l==="in"&&c.length===1?"eq":l;t([...e,`${o}:${g}:${x}`]),b(),s(!1)};return h.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5 rounded-md border border-line px-2 py-1 transition-colors focus-within:border-zinc-600",children:[h.jsx("span",{className:"shrink-0 text-zinc-600","aria-hidden":!0,children:"⛃"}),h.jsxs(Pi,{open:r,onOpenChange:g=>{s(g),g||b()},children:[h.jsx(Ii,{render:h.jsx("button",{type:"button","aria-label":"filter by search attribute",title:"Typed search attributes (WorkflowRun.searchAttributes)",className:"mono flex min-w-0 flex-1 flex-wrap items-center gap-1 py-0.5 text-left text-xs text-zinc-200 focus:outline-none"}),children:e.length===0?h.jsx("span",{className:"text-zinc-600",children:"filter by attribute…"}):e.map(g=>h.jsx(xt,{variant:"attr",className:"mono max-w-[12rem] truncate",children:mc(g)},g))}),h.jsx(ao,{align:"start",className:"w-80 p-2",children:h.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1 border-b border-line pb-1.5",children:e.map(g=>h.jsxs(xt,{variant:"attr",className:"mono gap-1 py-0.5",children:[mc(g),h.jsx(je,{variant:"ghost",size:"icon",className:"h-3 w-3 text-indigo-300/70 hover:text-indigo-100",title:`remove ${mc(g)}`,"aria-label":`remove ${mc(g)}`,onClick:()=>t(e.filter(y=>y!==g)),children:h.jsx(xs,{width:10,height:10})})]},g))}),h.jsx(_u,{field:"attr",scope:n,glyph:"⛃",label:"attribute key",placeholder:"key…",single:!0,value:o?[o]:[],onChange:g=>{i(g.at(-1)??""),u([])}}),h.jsx("select",{"aria-label":"operator",value:l,onChange:g=>a(g.target.value),className:"mono rounded-md border border-line bg-transparent px-2 py-1.5 text-xs text-zinc-200 focus:border-zinc-600 focus:outline-none",children:QE.map(g=>h.jsx("option",{value:g.op,className:"bg-zinc-900",children:g.label},g.op))}),p?h.jsx(_u,{field:`attr.${o}`,scope:n,glyph:"=",label:"attribute value",placeholder:o?"value…":"pick a key first",...l!=="in"&&{single:!0},value:c,onChange:u}):h.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-line px-2 focus-within:border-zinc-600",children:[h.jsx("span",{className:"shrink-0 text-zinc-600","aria-hidden":!0,children:"="}),h.jsx(am,{value:d,onChange:g=>f(g.target.value),placeholder:"value…","aria-label":"attribute value",onKeyDown:g=>{g.key==="Enter"&&m()}})]}),h.jsx(je,{variant:"brand",size:"chip",className:"mono self-end rounded",disabled:!v,onClick:m,children:"add filter"})]})})]}),e.length>0&&h.jsx(je,{variant:"ghost",size:"icon",onClick:()=>t([]),title:"clear attribute filters","aria-label":"clear attribute filters",className:"h-4 w-4",children:h.jsx(xs,{width:12,height:12})})]})}function eA({facets:e,value:t,onChange:n}){return e.length<=1?null:h.jsxs("div",{className:"flex flex-wrap items-center gap-1 border-b border-line px-2 py-1.5",children:[h.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-[0.18em] text-zinc-600",children:"origin"}),e.map(r=>{const s=vI(t,r.filter);return h.jsxs(je,{variant:"ghost",size:"chip","aria-pressed":s,title:r.title,onClick:()=>n(r.filter),className:ot("mono max-w-full gap-1 rounded-md",r.filter.kind==="unknown"&&"italic text-zinc-500",s&&"border-zinc-600 bg-zinc-900 text-zinc-100 hover:text-zinc-100"),children:[h.jsx("span",{className:"truncate",children:r.label}),h.jsx("span",{className:"tnum shrink-0 text-zinc-600",children:r.count})]},J1(r.filter))})]})}const hl=100;function tA(e,t,n=hl){if(e===void 0||t===void 0)return[0];const r=[];for(let s=Math.floor(e/n);s<=Math.floor(t/n);s+=1)r.push(s);return r}const nA="fan:";function Ip(e){var n;if(!e.name.startsWith(nA))return;const t=(n=e.output)==null?void 0:n.values;return Array.isArray(t)?t.length:void 0}function XE(e){const t=Ip(e);return t===void 0?e.name:`${t} child run${t===1?"":"s"}`}function rA(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 sA(e){if(e.some(n=>Ip(n)!==void 0))return`child runs ×${e.reduce((r,s)=>r+(Ip(s)??1),0)}`;const t=rA(e.map(n=>n.name));return`${t.length>=2?t:"parallel"} ×${e.length}`}function oA(e){var t;return e.kind==="single"?e.step.seq:e.kind==="fan"?((t=e.steps[0])==null?void 0:t.seq)??Number.POSITIVE_INFINITY:e.fan.firstSeq}function ZE(e,t=[]){const n=iA(e);if(t.length===0)return n;const r=[...t].sort((i,l)=>i.firstSeq-l.firstSeq),s=[];let o=0;for(const i of n){const l=oA(i);for(;o<r.length&&r[o].firstSeq<l;)s.push({kind:"summary",fan:r[o]}),o+=1;s.push(i)}for(;o<r.length;o+=1)s.push({kind:"summary",fan:r[o]});return s}function iA(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:sA(i)}),n=l}return t}function Qm(e,t=!1){const n=e.counts.running??0,r=e.counts.pending??0,s=e.notStarted??0;return{completed:e.counts.completed??0,failed:e.counts.failed??0,running:t?0:n,pending:t?0:r,interrupted:t?n+r:0,notStarted:t?0:s,skipped:t?s:0,started:e.size,total:e.total??e.size}}function Xm(e,t=!1){const n=Qm(e,t);return n.running>0?"running":n.pending>0||n.notStarted>0?"pending":n.failed>0||n.interrupted>0?"failed":"completed"}function JE(e){return e.started<e.total?`${e.started} of ${e.total}`:`×${e.total}`}const lA=new Set(["completed","failed","cancelled","dead"]);function Op(e){return lA.has(e)}function Vi(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 ek=50;function Zm(e,t=ek){const n=new Set;for(const r of e){if(n.size>=t)break;const s=Vi(r);s!==void 0&&n.add(s)}return[...n]}function tk(e,t){const n=`${t}.`;return`child ${e.startsWith(n)?e.slice(n.length):e}`}const aA=12;function cA(e,t,n=aA){const r=e.slice(0,n);return{shown:r,more:Math.max(0,(t??e.length)-r.length)}}function nk(e){const t={};for(const n of e)n.data&&(t[n.data.run.id]=n.data);return t}const Mu=[{key:"completed",className:"bg-emerald-500/60",text:"text-emerald-300",label:"done"},{key:"failed",className:"bg-red-500/70",text:"text-red-300",label:"failed"},{key:"running",className:"bg-live/70",text:"text-live",label:"running"},{key:"pending",className:"bg-zinc-500/60",text:"text-zinc-300",label:"pending"},{key:"interrupted",className:"bg-amber-500/60",text:"text-amber-300",label:"interrupted"},{key:"notStarted",className:"bg-zinc-700/70",text:"text-zinc-400",label:"not started"},{key:"skipped",className:"bg-zinc-700/40",text:"text-zinc-500",label:"never ran"}],uA=9e4;function dA(e,t,n){var o;const r=((t==null?void 0:t.liveWorkers)??[]).filter(i=>n-i.lastBeatAt<=uA).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)}}const rk=[];function fA(e){const t=S.useMemo(()=>Zm(e),[e]);return ag({queries:t.map(n=>({queryKey:["run",n],queryFn:()=>$e.run(n)})),combine:nk})}function sk(e,t,n){var i;if(t){const l=new Date(t.run.createdAt).getTime(),c=t.run.status==="running"||t.run.status==="suspended"?n:new Date(t.run.updatedAt).getTime();return[l,Math.max(c,l)]}const{subs:r}=em(e.events??[]);let s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(const l of r){l.startedAt!==void 0&&(s=Math.min(s,l.startedAt));const a=((i=l.terminal)==null?void 0:i.at)??l.startedAt;a!==void 0&&(o=Math.max(o,a))}return s!==Number.POSITIVE_INFINITY&&o!==Number.NEGATIVE_INFINITY?[s,o]:[new Date(e.startedAt).getTime(),new Date(e.finishedAt).getTime()]}function ok(e,t,n){const r=e.status==="running"||e.status==="suspended",s=Date.now();let o=new Date(e.createdAt).getTime(),i=Number.NEGATIVE_INFINITY;for(const[l,a]of t)o=Math.min(o,l),i=Math.max(i,a);for(const l of n)l.startedAt&&(o=Math.min(o,new Date(l.startedAt).getTime())),l.finishedAt&&(i=Math.max(i,new Date(l.finishedAt).getTime()));return i=Math.max(i,r?s:o+1),{t0:o,span:Math.max(i-o,1),liveNow:s}}function Jm(e,t,n,r=sk(e,t,n.liveNow)){const{t0:s,span:o}=n,[i,l]=r,{subs:a}=em(e.events??[]),c=a.map(u=>{var p;const d=u.startedAt??i,f=((p=u.terminal)==null?void 0:p.at)??d;return{key:u.id,name:u.name,status:u.status??"ok",left:(d-s)/o*100,width:Math.max((f-d)/o*100,.8),ms:u.durationMs??Math.max(f-d,0)}});return{step:e,childId:Vi(e),childRun:t,left:(i-s)/o*100,width:Math.max((l-i)/o*100,.8),ms:l-i,subRows:c}}function ju(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}const hA={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"},pA={ok:"bg-emerald-400",failed:"bg-red-400",skipped:"bg-amber-400"};function Pd({row:e,run:t,childRuns:n,depth:r,selectedKey:s,onSelect:o,onOpenRun:i,onToggleChild:l,expanded:a,collapsedSubs:c,toggleSubs:u}){var A;const{step:d,left:f,width:p,ms:x,subRows:v}=e,b=d.status==="failed",m=Vi(d),g=!!m,y=g?sm:om(d.kind),w=s===`${d.runId}#${d.seq}`,E=g&&m!==void 0&&a.has(m),N=v.length>0&&!g,k=c.has(d.seq),C=TI(d,Date.now()),{data:I}=nn({queryKey:["workers"],queryFn:()=>$e.workers(),refetchInterval:1e4,enabled:C}),P=C?dA(d,I==null?void 0:I.find(F=>F.group===d.workerGroup),Date.now()):void 0;return h.jsxs("div",{children:[h.jsxs("button",{type:"button",onClick:()=>o(d,t),title:g?"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:[h.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[g&&m!==void 0&&h.jsx("button",{type:"button",onClick:F=>{F.stopPropagation(),l(m)},className:"shrink-0 text-indigo-400 hover:text-indigo-200 transition-colors",title:E?"Collapse child run":"Expand child run inline",children:h.jsx("span",{className:"inline-block transition-transform",style:{transform:E?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),N&&h.jsx("button",{type:"button",onClick:F=>{F.stopPropagation(),u(d.seq)},className:"shrink-0 text-zinc-500 transition-colors hover:text-zinc-300",title:k?`Show ${v.length} sub-process(es)`:"Hide sub-processes",children:h.jsx("span",{className:"inline-block transition-transform",style:{transform:k?"rotate(0deg)":"rotate(90deg)"},children:"▸"})}),h.jsx("span",{className:b?"text-red-400":g?"text-indigo-300":"text-emerald-400",children:h.jsx(y,{width:12,height:12})}),h.jsx("span",{className:"truncate text-[12px] text-zinc-300",children:m!==void 0?((A=n[m])==null?void 0:A.run.workflow)??tk(m,d.runId):XE(d)}),g&&m!==void 0&&h.jsx("button",{type:"button",onClick:F=>{F.stopPropagation(),i(m)},title:"Open the child run",className:"shrink-0 text-indigo-300 transition-colors hover:text-indigo-100",children:"↗"})]}),h.jsxs("span",{className:"relative h-5",children:[h.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft"}),h.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:`${f}%`,width:`${p}%`}}),h.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(${f+p}%, calc(100% - 44px))`},children:ju(x)})]})]}),(P==null?void 0:P.kind)==="working"&&h.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:[h.jsx("span",{"aria-hidden":!0,children:"⚙"}),"being worked by ",P.instanceId," — heartbeat ",P.beatAgoS,"s ago",P.inFlight!==void 0?` · ${P.inFlight} in flight`:""]}),(P==null?void 0:P.kind)==="lost"&&h.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:[h.jsx("span",{"aria-hidden":!0,children:"⚠"}),"awaiting worker result — dispatched ",P.minutes,"m ago, no live worker (possibly lost)"]}),v.length>0&&!k&&h.jsx("div",{className:"ml-[18px] mt-0.5 mb-1 space-y-0.5 border-l border-line-soft pl-2",children:v.map(F=>h.jsxs("div",{className:"grid grid-cols-[130px_1fr] items-center gap-3 px-2",title:`${F.name} — ${F.status}`,children:[h.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[h.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${pA[F.status]}`}),h.jsx("span",{className:"truncate text-[10px] text-zinc-400",children:F.name})]}),h.jsxs("span",{className:"relative h-3",children:[h.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft"}),h.jsx("span",{className:`absolute top-1/2 h-2 -translate-y-1/2 rounded-[2px] transition-all duration-500 ease-out ${hA[F.status]}`,style:{left:`${F.left}%`,width:`${F.width}%`}}),h.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(${F.left+F.width}%, calc(100% - 38px))`},children:ju(F.ms)})]})]},F.key))}),g&&m!==void 0&&E&&h.jsx("div",{className:"ml-[18px] mt-0.5 mb-1 border-l border-line-soft pl-2",children:h.jsx(xA,{id:m,depth:r+1,selectedKey:s,onSelect:o,onOpenRun:i,expanded:a,onToggleChild:l})})]})}function gA({label:e,fanFailed:t,memberRows:n,rowProps:r}){return h.jsxs("div",{className:"rounded-md bg-zinc-900/30 ring-1 ring-line-soft",children:[h.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[h.jsx("span",{className:"text-[11px] text-indigo-300/80",title:"parallel fan-out (ctx.gather / ctx.all)",children:"⑃"}),h.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.15em] text-zinc-500",children:"parallel"}),h.jsx("span",{className:`text-[11px] ${t?"text-red-400":"text-zinc-300"}`,children:e})]}),h.jsx("div",{className:"ml-[10px] border-l border-line-soft pl-1",children:n.map(s=>h.jsx(Pd,{row:s,...r},s.step.seq))})]})}const Ux=28;function mA({fan:e,frame:t,rowProps:n}){const[r,s]=S.useState(!1),[o,i]=S.useState(!1),l=Op(n.run.status),a=Qm(e,l),c=Xm(e,l),u=c==="running"||c==="pending",d=n.run.status==="running"||n.run.status==="suspended",f=e.startedAt?new Date(e.startedAt).getTime():void 0,p=e.finishedAt?new Date(e.finishedAt).getTime():u&&d?t.liveNow:f,x=S.useMemo(()=>e.failures.map(v=>Jm(v,void 0,t)),[e.failures,t]);return h.jsxs("div",{className:"rounded-md bg-zinc-900/30 ring-1 ring-line-soft",children:[h.jsxs("div",{className:"grid grid-cols-[150px_1fr] items-center gap-3 px-2 py-1",children:[h.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[h.jsx("button",{type:"button",onClick:()=>s(v=>!v),className:"shrink-0 text-zinc-500 transition-colors hover:text-zinc-300",title:r?"Hide the members":`List the ${e.size} members started`,children:h.jsx("span",{className:"inline-block transition-transform",style:{transform:r?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),h.jsx("span",{className:"text-[11px] text-indigo-300/80",title:"parallel fan-out, summarized",children:"⑃"}),h.jsxs("span",{className:`truncate text-[12px] ${c==="failed"?"text-red-400":"text-zinc-300"}`,title:e.group,children:[e.label," ×",a.total]})]}),h.jsxs("span",{className:"relative h-5",children:[h.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft"}),f!==void 0&&p!==void 0&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:`absolute top-1/2 h-3.5 -translate-y-1/2 rounded-[3px] ${c==="failed"?"bg-red-500/25 ring-1 ring-red-500/40":"bg-indigo-500/20 ring-1 ring-indigo-500/40"} ${u?"pulse":""}`,style:{left:`${(f-t.t0)/t.span*100}%`,width:`${Math.max((p-f)/t.span*100,.8)}%`}}),h.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(${(p-t.t0)/t.span*100}%, calc(100% - 44px))`},children:ju(p-f)})]})]})]}),h.jsxs("div",{className:"flex items-center gap-3 px-2 pb-1.5 pl-[26px]",children:[h.jsx("span",{className:"flex h-1.5 w-40 shrink-0 overflow-hidden rounded-full bg-zinc-800",children:Mu.map(v=>a[v.key]>0?h.jsx("span",{className:v.className,style:{width:`${a[v.key]/Math.max(a.total,1)*100}%`}},v.key):null)}),h.jsxs("span",{className:"mono tnum flex flex-wrap gap-2 text-[10px]",children:[a.started<a.total&&h.jsxs("span",{className:"text-zinc-400",children:[JE(a)," started"]}),Mu.map(v=>a[v.key]>0?h.jsxs("span",{className:v.text,children:[a[v.key]," ",v.label,v.key==="skipped"&&e.failFast?" (failFast)":""]},v.key):null)]})]}),x.length>0&&!r&&h.jsxs("div",{className:"ml-[10px] border-l border-red-500/30 pl-1",children:[h.jsx("div",{className:"mono px-2 text-[10px] text-red-300/70",children:a.failed>x.length?`first ${x.length} of ${a.failed} failed`:`${x.length} failed`}),x.map(v=>h.jsx(Pd,{row:v,...n},v.step.seq))]}),r&&h.jsxs("div",{className:"ml-[10px] border-l border-line-soft pl-1",children:[h.jsx("div",{className:"flex items-center gap-2 px-2 py-0.5",children:h.jsx("button",{type:"button",onClick:()=>i(v=>!v),className:`mono rounded border px-1.5 text-[10px] transition-colors ${o?"border-red-500/40 bg-red-500/15 text-red-300":"border-line text-zinc-500 hover:text-zinc-300"}`,children:"failed only"})}),h.jsx(yA,{group:e.group,failedOnly:o,live:u&&d,frame:t,rowProps:n},o?"failed":"all")]})]})}function yA({group:e,failedOnly:t,live:n,frame:r,rowProps:s}){var b,m,g,y;const o=s.run.id,i=S.useRef(null),[l,a]=S.useState(),c=Jg({count:l??0,getScrollElement:()=>i.current,estimateSize:()=>Ux,measureElement:w=>w.getBoundingClientRect().height,overscan:10}),u=c.getVirtualItems(),d=tA((b=u[0])==null?void 0:b.index,(m=u[u.length-1])==null?void 0:m.index),f=ag({queries:d.map(w=>({queryKey:["fan",o,e,t,w],queryFn:()=>$e.fanMembers(o,e,{offset:w*hl,limit:hl,failed:t}),refetchInterval:n?5e3:!1}))}),p=(y=(g=f.find(w=>w.data!==void 0))==null?void 0:g.data)==null?void 0:y.total;S.useEffect(()=>{p!==void 0&&a(p)},[p]);const x=w=>{var k,C;const E=Math.floor(w/hl),N=d.indexOf(E);return N<0||(C=(k=f[N])==null?void 0:k.data)==null?void 0:C.items[w%hl]},v=f.find(w=>w.isError);return l===void 0&&v?h.jsxs("div",{className:"mono px-2 py-1 text-[10px] text-red-400",children:["couldn't load members:"," ",v.error instanceof Error?v.error.message:String(v.error)]}):l===void 0?h.jsx("div",{className:"mono px-2 py-1 text-[10px] text-zinc-600",children:"loading members…"}):l===0?h.jsx("div",{className:"mono px-2 py-1 text-[10px] text-zinc-600",children:t?"no failed members":"no members"}):h.jsx("div",{ref:i,className:"max-h-[320px] overflow-auto",children:h.jsx("div",{className:"relative w-full",style:{height:c.getTotalSize()},children:u.map(w=>{const E=x(w.index);return h.jsx("div",{"data-index":w.index,ref:c.measureElement,className:"absolute inset-x-0 top-0",style:{transform:`translateY(${w.start}px)`},children:E?h.jsx(Pd,{row:Jm(E,void 0,r),...s}):h.jsxs("div",{className:"mono px-2 text-[10px] leading-7 text-zinc-700",style:{height:Ux},children:["#",w.index+1," loading…"]})},w.key)})})})}function e0({run:e,timeline:t,fans:n=rk,depth:r,selectedKey:s,onSelect:o,onOpenRun:i,expanded:l,onToggleChild:a}){const c=fA(t),{frame:u,rows:d}=S.useMemo(()=>{const g=Date.now(),y=t.map(N=>{const k=Vi(N),C=k!==void 0?c[k]:void 0;return{step:N,childRun:C,window:sk(N,C,g)}}),w=ok(e,y.map(N=>N.window),n),E=y.map(N=>Jm(N.step,N.childRun,w,N.window));return{frame:w,rows:E}},[e,t,n,c]),f=S.useMemo(()=>ZE(t,n),[t,n]),p=S.useMemo(()=>{const g=new Map;for(const y of d)g.set(y.step.seq,y);return g},[d]),[x,v]=S.useState(new Set),m={run:e,childRuns:c,depth:r,selectedKey:s,onSelect:o,onOpenRun:i,onToggleChild:a,expanded:l,collapsedSubs:x,toggleSubs:g=>v(y=>{const w=new Set(y);return w.has(g)?w.delete(g):w.add(g),w})};return h.jsx(h.Fragment,{children:f.map(g=>{if(g.kind==="single"){const w=p.get(g.step.seq);return w?h.jsx(Pd,{row:w,...m},w.step.seq):null}if(g.kind==="summary")return h.jsx(mA,{fan:g.fan,frame:u,rowProps:m},`fan:${g.fan.group}`);const y=g.steps.map(w=>p.get(w.seq)).filter(w=>w!==void 0);return h.jsx(gA,{label:g.label,fanFailed:g.steps.some(w=>w.status==="failed"),memberRows:y,rowProps:m},`fan:${g.group}`)})})}function xA({id:e,depth:t,selectedKey:n,onSelect:r,onOpenRun:s,expanded:o,onToggleChild:i}){const{data:l}=nn({queryKey:["run",e],queryFn:()=>$e.run(e)});return t>6?null:l?h.jsxs("div",{className:"my-1 rounded-md border border-line bg-black/15",children:[h.jsxs("div",{className:"mono flex items-center gap-2 px-2 py-1 text-[10px] text-zinc-500",children:[h.jsxs("span",{className:"text-indigo-300",children:["⌁ ",l.run.workflow]}),h.jsx("span",{className:"tnum text-zinc-600",children:e.slice(0,8)}),h.jsx("span",{className:`s-${l.run.status} uppercase`,children:l.run.status}),h.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 ↗"})]}),h.jsx(e0,{run:l.run,timeline:l.timeline,fans:l.fans,depth:t,selectedKey:n,onSelect:r,onOpenRun:s,expanded:o,onToggleChild:i})]}):h.jsx("div",{className:"mono px-2 py-1 text-[10px] text-zinc-600",children:"loading child run…"})}const vA=S.memo(function({run:t,timeline:n,fans:r,selectedKey:s,onSelect:o,onOpenRun:i,expanded:l,onToggleChild:a}){const c=S.useMemo(()=>ok(t,n.map(f=>[new Date(f.startedAt).getTime(),new Date(f.finishedAt).getTime()]),r??rk).span,[t,n,r]),u=l??new Set,d=a??(()=>{});return h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 pt-3",children:[h.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.2em] text-zinc-500",children:"spans"}),h.jsxs("span",{className:"mono tnum text-[10px] text-zinc-600",children:["total ",ju(c)]})]}),h.jsx("div",{className:"min-h-0 flex-1 space-y-1 overflow-auto px-3 pb-3",children:h.jsx(e0,{run:t,timeline:n,fans:r,depth:0,selectedKey:s,onSelect:o,onOpenRun:i,expanded:u,onToggleChild:d})})]})});function Au(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}function qx(e,t){return Au(new Date(t).getTime()-new Date(e).getTime())}function Kx(e){return t0(new Date(e).getTime())}function t0(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}const ik={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"},wA={debug:"text-zinc-500",info:"text-zinc-300",warn:"text-amber-300",error:"text-red-300"},bA=["ok","failed","skipped"];function lk({e}){return h.jsxs("div",{className:"flex gap-2 py-0.5",children:[h.jsx("span",{className:"shrink-0 text-zinc-600 tnum",children:t0(e.at)}),h.jsx("span",{className:`shrink-0 uppercase ${wA[e.level]}`,children:e.level}),h.jsx("span",{className:"min-w-0 break-words text-zinc-300",children:e.message})]})}function Yx({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?ik[e.status]:"border-amber-500/25 bg-amber-500/10 text-amber-300";return h.jsxs("li",{className:`rounded-md border ${i}`,children:[h.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:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[r&&h.jsx("span",{className:`text-[9px] text-zinc-500 transition-transform duration-150 ${s?"":"-rotate-90"}`,children:"▼"}),h.jsx("span",{className:"mono truncate text-zinc-200",children:e.name}),t&&e.group&&h.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-wider text-zinc-500",children:e.group})]}),h.jsxs("span",{className:"mono flex shrink-0 items-center gap-2 text-[10px] uppercase tracking-wider",children:[e.durationMs!==void 0&&h.jsx("span",{className:"tnum text-zinc-400",children:Au(e.durationMs)}),h.jsx("span",{children:e.status??"running"})]})]}),s&&h.jsxs("div",{className:"border-t border-line/60 px-2.5 py-2",children:[e.phases.length>0&&h.jsx("ul",{className:"mono mb-2 flex flex-col gap-0.5 text-[10.5px]",children:e.phases.map((c,u)=>h.jsxs("li",{className:"flex gap-2",children:[h.jsx("span",{className:"shrink-0 text-zinc-600 tnum",children:t0(c.at)}),h.jsx("span",{className:"text-zinc-400",children:c.phase}),e.startedAt!==void 0&&h.jsxs("span",{className:"text-zinc-600 tnum",children:["+",Au(c.at-e.startedAt)]})]},`${c.at}-${c.phase}-${u}`))}),((a=e.terminal)==null?void 0:a.message)&&e.terminal.message!==e.name&&h.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&&h.jsx("div",{className:"mono flex flex-col gap-0.5 text-[11px]",children:e.logs.map((c,u)=>h.jsx(lk,{e:c},`${c.at}-${u}`))})]})]})}function SA({events:e}){const{subs:t,stepLogs:n}=em(e),r=bA.map(o=>[o,t.filter(i=>i.status===o).length]).filter(([,o])=>o>0),s=t.some(o=>o.group);return h.jsxs(h.Fragment,{children:[t.length>0&&h.jsxs("section",{className:"rise",children:[h.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[h.jsxs("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:["sub-processes · ",t.length]}),h.jsx("span",{className:"mono flex gap-2 text-[10px] uppercase tracking-wider",children:r.map(([o,i])=>h.jsxs("span",{className:ik[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])=>h.jsxs("div",{className:"mb-2",children:[h.jsx("div",{className:"mono mb-1 text-[10px] uppercase tracking-wider text-zinc-500",children:o}),h.jsx("ul",{className:"flex flex-col gap-1",children:i.map(l=>h.jsx(Yx,{sub:l,showGroup:!1},l.id))})]},o)):h.jsx("ul",{className:"flex flex-col gap-1",children:t.map(o=>h.jsx(Yx,{sub:o},o.id))})]}),n.length>0&&h.jsxs("section",{className:"rise",children:[h.jsxs("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:["logs · ",n.length]}),h.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)=>h.jsx(lk,{e:o},`${o.at}-${i}`))})]})]})}function EA({value:e}){const[t,n]=S.useState(!1);return h.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?h.jsx(nm,{width:11,height:11}):h.jsx(qI,{width:11,height:11}),t?"copied":"copy"]})}function zu({label:e,value:t}){const n=typeof t=="string"?t:JSON.stringify(t,null,2);return h.jsxs("section",{className:"rise",children:[h.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[h.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:e}),h.jsx(EA,{value:n})]}),h.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 $r({k:e,v:t,mono:n=!0}){return h.jsxs("div",{className:"flex items-baseline justify-between gap-3 py-1.5",children:[h.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-[0.16em] text-zinc-600",children:e}),h.jsx("span",{className:`truncate text-right text-[12px] text-zinc-200 ${n?"mono tnum":""}`,children:t})]})}function kA({id:e,onOpenRun:t}){const{data:n}=nn({queryKey:["run",e],queryFn:()=>$e.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?h.jsxs("div",{className:"mono px-2 py-2 text-[10px] text-zinc-600",children:["no steps recorded yet — child ",n.run.status]}):h.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:h.jsx(e0,{run:n.run,timeline:n.timeline,depth:0,onSelect:()=>{},onOpenRun:t??(()=>{}),expanded:r,onToggleChild:o})}):h.jsx("div",{className:"mono px-2 py-2 text-[10px] text-zinc-600",children:"loading child run…"})}function CA({step:e,run:t,onClose:n,onOpenRun:r}){const s=Vi(e),[o,i]=S.useState(!1),l=e.status==="failed",a=e.status==="pending"||e.status==="running",c=om(e.kind),u=qx(t.createdAt,e.startedAt),d=e.enqueuedAt?new Date(e.startedAt).getTime()-new Date(e.enqueuedAt).getTime():0;return h.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:[h.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.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:h.jsx(c,{width:13,height:13})}),h.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.name})]}),h.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:[e.status," · ",fp[e.kind]??e.kind]})]}),h.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:h.jsx(xs,{})})]}),h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[h.jsxs("div",{className:"rounded-lg border border-line bg-black/20 px-3.5 py-1",children:[h.jsx($r,{k:"seq",v:`#${e.seq}`}),d>=1&&h.jsx($r,{k:"queued",v:h.jsx("span",{className:"text-sky-300",children:Au(d)})}),h.jsx($r,{k:"duration",v:a?h.jsx("span",{className:"text-amber-300",children:"running…"}):qx(e.startedAt,e.finishedAt)}),h.jsx($r,{k:"attempts",v:h.jsxs("span",{className:e.attempts>1?"text-amber-300":"",children:[e.attempts>1&&h.jsx(rm,{width:11,height:11,className:"mr-1 inline"}),e.attempts]})}),e.workerGroup&&h.jsx($r,{k:"worker",v:`@${e.workerGroup}`}),h.jsx($r,{k:"started",v:Kx(e.startedAt)}),!a&&h.jsx($r,{k:"finished",v:Kx(e.finishedAt)}),h.jsx($r,{k:"offset",v:`+${u}`})]}),l&&e.error&&h.jsxs("section",{className:"rise",children:[h.jsx("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-red-400/80",children:"error"}),h.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&&h.jsx(SA,{events:e.events}),s&&h.jsxs("section",{className:"rise",children:[h.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[h.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:"child run"}),r&&h.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 ↗"})]}),h.jsxs("button",{type:"button",onClick:()=>i(f=>!f),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:[h.jsx("span",{className:"inline-block text-[9px] text-indigo-300 transition-transform",style:{transform:o?"rotate(90deg)":"rotate(0deg)"},children:"▸"}),h.jsx("span",{className:"mono truncate text-[11px] text-indigo-300",children:s})]}),o&&h.jsx(kA,{id:s,onOpenRun:r})]}),e.input!==void 0&&h.jsx(zu,{label:"input",value:e.input}),e.output!==void 0&&h.jsx(zu,{label:"output",value:e.output})]})]})}function NA({run:e,onClose:t}){const n=e.input===void 0&&e.output===void 0&&!e.error;return h.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:[h.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.workflow}),h.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:["run · ",e.status]})]}),h.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:h.jsx(xs,{})})]}),h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[e.error&&h.jsxs("section",{className:"rise",children:[h.jsx("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-red-400/80",children:"error"}),h.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&&h.jsx(zu,{label:"input",value:e.input}),e.output!==void 0&&h.jsx(zu,{label:"output",value:e.output}),n&&h.jsx("div",{className:"text-sm text-zinc-600",children:"No input/output recorded."})]})]})}function RA(e){if(e.cron)return e.timezone&&e.timezone!=="UTC"?`${e.cron} · ${e.timezone}`:e.cron;const t=e.everyMs??0;return t%864e5===0?`every ${t/864e5}d`:t%36e5===0?`every ${t/36e5}h`:t%6e4===0?`every ${t/6e4}m`:t%1e3===0?`every ${t/1e3}s`:`every ${t}ms`}function Gx(e,t=Date.now()){const n=Date.parse(e)-t,r=Math.round(Math.abs(n)/1e3),s=r<60?`${r}s`:r<3600?`${Math.round(r/60)}m`:r<86400?`${Math.round(r/3600)}h`:`${Math.round(r/86400)}d`;return n>=0?`in ${s}`:`${s} ago`}function TA(){const e=fo(),{data:t}=nn({queryKey:["schedules"],queryFn:()=>$e.schedules(),refetchInterval:1e4}),n=Ms({mutationFn:({id:s,action:o})=>o==="pause"?$e.pauseSchedule(s):o==="resume"?$e.resumeSchedule(s):$e.triggerSchedule(s),onSettled:()=>{e.invalidateQueries({queryKey:["schedules"]}),e.invalidateQueries({queryKey:["runs"]})}});if(!t||t.length===0)return null;const r=t.filter(s=>s.paused).length;return h.jsxs(Pi,{children:[h.jsx(Ii,{render:h.jsxs(je,{variant:"chip",size:"xs",className:"mono gap-1",children:[h.jsx("span",{className:"uppercase tracking-wide",children:"schedules"}),h.jsxs("span",{className:"tnum text-zinc-500",children:[t.length,r?` · ${r} paused`:""]})]})}),h.jsx(ao,{className:"w-[34rem] max-h-[60vh] overflow-y-auto",children:h.jsxs("table",{className:"mono w-full text-[10px]",children:[h.jsx("thead",{className:"sticky top-0 bg-popover text-left text-zinc-500",children:h.jsxs("tr",{children:[h.jsx("th",{className:"px-2 py-1.5 font-normal",children:"schedule"}),h.jsx("th",{className:"px-2 py-1.5 font-normal",children:"cadence"}),h.jsx("th",{className:"px-2 py-1.5 font-normal",children:"next"}),h.jsx("th",{className:"px-2 py-1.5 font-normal",children:"last"}),h.jsx("th",{className:"px-2 py-1.5"})]})}),h.jsx("tbody",{children:t.map(s=>h.jsxs("tr",{className:"border-t border-line align-top",children:[h.jsxs("td",{className:"max-w-[10rem] px-2 py-1.5",children:[h.jsx("div",{className:"truncate text-zinc-200",title:s.id,children:s.id}),h.jsxs("div",{className:"truncate text-zinc-500",title:s.workflow,children:[s.workflow,s.namespace!=="default"?` @${s.namespace}`:""]})]}),h.jsx("td",{className:"px-2 py-1.5 text-zinc-400",children:RA(s)}),h.jsx("td",{className:ot("px-2 py-1.5",s.paused?"text-amber-400/80":"text-zinc-300"),children:s.paused?"paused":s.nextFireAt?Gx(s.nextFireAt):"—"}),h.jsxs("td",{className:"max-w-[9rem] px-2 py-1.5 text-zinc-500",children:[s.lastFireAt?Gx(s.lastFireAt):"never",s.lastError&&h.jsx("div",{className:"truncate text-red-400/80",title:s.lastError,children:s.lastError})]}),h.jsxs("td",{className:"whitespace-nowrap px-2 py-1.5 text-right",children:[h.jsx(je,{variant:"ghost",size:"xs",disabled:n.isPending,onClick:()=>n.mutate({id:s.id,action:s.paused?"resume":"pause"}),children:s.paused?"resume":"pause"}),h.jsx(je,{variant:"ghost",size:"xs",disabled:n.isPending,onClick:()=>n.mutate({id:s.id,action:"trigger"}),children:"run now"})]})]},s.id))})]})})]})}function it(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=it(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var PA={value:()=>{}};function Id(){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 Hc(n)}function Hc(e){this._=e}function IA(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}})}Hc.prototype=Id.prototype={constructor:Hc,on:function(e,t){var n=this._,r=IA(e+"",n),s,o=-1,i=r.length;if(arguments.length<2){for(;++o<i;)if((s=(e=r[o]).type)&&(s=OA(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]=Qx(n[s],e.name,t);else if(t==null)for(s in n)n[s]=Qx(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 Hc(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 OA(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function Qx(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=PA,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var _p="http://www.w3.org/1999/xhtml";const Xx={svg:"http://www.w3.org/2000/svg",xhtml:_p,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Od(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Xx.hasOwnProperty(t)?{space:Xx[t],local:e}:e}function _A(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===_p&&t.documentElement.namespaceURI===_p?t.createElement(e):t.createElementNS(n,e)}}function MA(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ak(e){var t=Od(e);return(t.local?MA:_A)(t)}function jA(){}function n0(e){return e==null?jA:function(){return this.querySelector(e)}}function AA(e){typeof e!="function"&&(e=n0(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 an(r,this._parents)}function zA(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function DA(){return[]}function ck(e){return e==null?DA:function(){return this.querySelectorAll(e)}}function FA(e){return function(){return zA(e.apply(this,arguments))}}function $A(e){typeof e=="function"?e=FA(e):e=ck(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 an(r,s)}function uk(e){return function(){return this.matches(e)}}function dk(e){return function(t){return t.matches(e)}}var LA=Array.prototype.find;function HA(e){return function(){return LA.call(this.children,e)}}function BA(){return this.firstElementChild}function VA(e){return this.select(e==null?BA:HA(typeof e=="function"?e:dk(e)))}var WA=Array.prototype.filter;function UA(){return Array.from(this.children)}function qA(e){return function(){return WA.call(this.children,e)}}function KA(e){return this.selectAll(e==null?UA:qA(typeof e=="function"?e:dk(e)))}function YA(e){typeof e!="function"&&(e=uk(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 an(r,this._parents)}function fk(e){return new Array(e.length)}function GA(){return new an(this._enter||this._groups.map(fk),this._parents)}function Du(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Du.prototype={constructor:Du,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 QA(e){return function(){return e}}function XA(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 Du(e,o[i]);for(;i<a;++i)(l=t[i])&&(s[i]=l)}function ZA(e,t,n,r,s,o,i){var l,a,c=new Map,u=t.length,d=o.length,f=new Array(u),p;for(l=0;l<u;++l)(a=t[l])&&(f[l]=p=i.call(a,a.__data__,l,t)+"",c.has(p)?s[l]=a:c.set(p,a));for(l=0;l<d;++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 Du(e,o[l]);for(l=0;l<u;++l)(a=t[l])&&c.get(f[l])===a&&(s[l]=a)}function JA(e){return e.__data__}function ez(e,t){if(!arguments.length)return Array.from(this,JA);var n=t?ZA:XA,r=this._parents,s=this._groups;typeof e!="function"&&(e=QA(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],d=s[c],f=d.length,p=tz(e.call(u,u&&u.__data__,c,r)),x=p.length,v=l[c]=new Array(x),b=i[c]=new Array(x),m=a[c]=new Array(f);n(u,d,v,b,m,p,t);for(var g=0,y=0,w,E;g<x;++g)if(w=v[g]){for(g>=y&&(y=g+1);!(E=b[y])&&++y<x;);w._next=E||null}}return i=new an(i,r),i._enter=l,i._exit=a,i}function tz(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function nz(){return new an(this._exit||this._groups.map(fk),this._parents)}function rz(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 sz(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],d=c.length,f=l[a]=new Array(d),p,x=0;x<d;++x)(p=c[x]||u[x])&&(f[x]=p);for(;a<s;++a)l[a]=n[a];return new an(l,this._parents)}function oz(){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 iz(e){e||(e=lz);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}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 an(s,this._parents).order()}function lz(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function az(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function cz(){return Array.from(this)}function uz(){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 dz(){let e=0;for(const t of this)++e;return e}function fz(){return!this.node()}function hz(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 pz(e){return function(){this.removeAttribute(e)}}function gz(e){return function(){this.removeAttributeNS(e.space,e.local)}}function mz(e,t){return function(){this.setAttribute(e,t)}}function yz(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function xz(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function vz(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 wz(e,t){var n=Od(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?gz:pz:typeof t=="function"?n.local?vz:xz:n.local?yz:mz)(n,t))}function hk(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function bz(e){return function(){this.style.removeProperty(e)}}function Sz(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ez(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function kz(e,t,n){return arguments.length>1?this.each((t==null?bz:typeof t=="function"?Ez:Sz)(e,t,n??"")):Oi(this.node(),e)}function Oi(e,t){return e.style.getPropertyValue(t)||hk(e).getComputedStyle(e,null).getPropertyValue(t)}function Cz(e){return function(){delete this[e]}}function Nz(e,t){return function(){this[e]=t}}function Rz(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Tz(e,t){return arguments.length>1?this.each((t==null?Cz:typeof t=="function"?Rz:Nz)(e,t)):this.node()[e]}function pk(e){return e.trim().split(/^|\s+/)}function r0(e){return e.classList||new gk(e)}function gk(e){this._node=e,this._names=pk(e.getAttribute("class")||"")}gk.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 mk(e,t){for(var n=r0(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function yk(e,t){for(var n=r0(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function Pz(e){return function(){mk(this,e)}}function Iz(e){return function(){yk(this,e)}}function Oz(e,t){return function(){(t.apply(this,arguments)?mk:yk)(this,e)}}function _z(e,t){var n=pk(e+"");if(arguments.length<2){for(var r=r0(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?Oz:t?Pz:Iz)(n,t))}function Mz(){this.textContent=""}function jz(e){return function(){this.textContent=e}}function Az(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function zz(e){return arguments.length?this.each(e==null?Mz:(typeof e=="function"?Az:jz)(e)):this.node().textContent}function Dz(){this.innerHTML=""}function Fz(e){return function(){this.innerHTML=e}}function $z(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Lz(e){return arguments.length?this.each(e==null?Dz:(typeof e=="function"?$z:Fz)(e)):this.node().innerHTML}function Hz(){this.nextSibling&&this.parentNode.appendChild(this)}function Bz(){return this.each(Hz)}function Vz(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Wz(){return this.each(Vz)}function Uz(e){var t=typeof e=="function"?e:ak(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function qz(){return null}function Kz(e,t){var n=typeof e=="function"?e:ak(e),r=t==null?qz:typeof t=="function"?t:n0(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Yz(){var e=this.parentNode;e&&e.removeChild(this)}function Gz(){return this.each(Yz)}function Qz(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Xz(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Zz(e){return this.select(e?Xz:Qz)}function Jz(e){return arguments.length?this.property("__data__",e):this.node().__data__}function e5(e){return function(t){e.call(this,t,this.__data__)}}function t5(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 n5(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 r5(e,t,n){return function(){var r=this.__on,s,o=e5(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 s5(e,t,n){var r=t5(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?r5:n5,s=0;s<o;++s)this.each(l(r[s],t,n));return this}function xk(e,t,n){var r=hk(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 o5(e,t){return function(){return xk(this,e,t)}}function i5(e,t){return function(){return xk(this,e,t.apply(this,arguments))}}function l5(e,t){return this.each((typeof t=="function"?i5:o5)(e,t))}function*a5(){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 vk=[null];function an(e,t){this._groups=e,this._parents=t}function Ta(){return new an([[document.documentElement]],vk)}function c5(){return this}an.prototype=Ta.prototype={constructor:an,select:AA,selectAll:$A,selectChild:VA,selectChildren:KA,filter:YA,data:ez,enter:GA,exit:nz,join:rz,merge:sz,selection:c5,order:oz,sort:iz,call:az,nodes:cz,node:uz,size:dz,empty:fz,each:hz,attr:wz,style:kz,property:Tz,classed:_z,text:zz,html:Lz,raise:Bz,lower:Wz,append:Uz,insert:Kz,remove:Gz,clone:Zz,datum:Jz,on:s5,dispatch:l5,[Symbol.iterator]:a5};function en(e){return typeof e=="string"?new an([[document.querySelector(e)]],[document.documentElement]):new an([[e]],vk)}function u5(e){let t;for(;t=e.sourceEvent;)e=t;return e}function On(e,t){if(e=u5(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 d5={passive:!1},Jl={capture:!0,passive:!1};function Hf(e){e.stopImmediatePropagation()}function Jo(e){e.preventDefault(),e.stopImmediatePropagation()}function wk(e){var t=e.document.documentElement,n=en(e).on("dragstart.drag",Jo,Jl);"onselectstart"in t?n.on("selectstart.drag",Jo,Jl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function bk(e,t){var n=e.document.documentElement,r=en(e).on("dragstart.drag",null);t&&(r.on("click.drag",Jo,Jl),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 yc=e=>()=>e;function Mp(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}})}Mp.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function f5(e){return!e.ctrlKey&&!e.button}function h5(){return this.parentNode}function p5(e,t){return t??{x:e.x,y:e.y}}function g5(){return navigator.maxTouchPoints||"ontouchstart"in this}function Sk(){var e=f5,t=h5,n=p5,r=g5,s={},o=Id("start","drag","end"),i=0,l,a,c,u,d=0;function f(w){w.on("mousedown.drag",p).filter(r).on("touchstart.drag",b).on("touchmove.drag",m,d5).on("touchend.drag touchcancel.drag",g).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 N=y(this,t.call(this,w,E),w,E,"mouse");N&&(en(w.view).on("mousemove.drag",x,Jl).on("mouseup.drag",v,Jl),wk(w.view),Hf(w),c=!1,l=w.clientX,a=w.clientY,N("start",w))}}function x(w){if(Jo(w),!c){var E=w.clientX-l,N=w.clientY-a;c=E*E+N*N>d}s.mouse("drag",w)}function v(w){en(w.view).on("mousemove.drag mouseup.drag",null),bk(w.view,c),Jo(w),s.mouse("end",w)}function b(w,E){if(e.call(this,w,E)){var N=w.changedTouches,k=t.call(this,w,E),C=N.length,I,P;for(I=0;I<C;++I)(P=y(this,k,w,E,N[I].identifier,N[I]))&&(Hf(w),P("start",w,N[I]))}}function m(w){var E=w.changedTouches,N=E.length,k,C;for(k=0;k<N;++k)(C=s[E[k].identifier])&&(Jo(w),C("drag",w,E[k]))}function g(w){var E=w.changedTouches,N=E.length,k,C;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),k=0;k<N;++k)(C=s[E[k].identifier])&&(Hf(w),C("end",w,E[k]))}function y(w,E,N,k,C,I){var P=o.copy(),A=On(I||N,E),F,z,R;if((R=n.call(w,new Mp("beforestart",{sourceEvent:N,target:f,identifier:C,active:i,x:A[0],y:A[1],dx:0,dy:0,dispatch:P}),k))!=null)return F=R.x-A[0]||0,z=R.y-A[1]||0,function O(_,$,T){var j=A,M;switch(_){case"start":s[C]=O,M=i++;break;case"end":delete s[C],--i;case"drag":A=On(T||$,E),M=i;break}P.call(_,w,new Mp(_,{sourceEvent:$,subject:R,target:f,identifier:C,active:M,x:A[0]+F,y:A[1]+z,dx:A[0]-j[0],dy:A[1]-j[1],dispatch:P}),k)}}return f.filter=function(w){return arguments.length?(e=typeof w=="function"?w:yc(!!w),f):e},f.container=function(w){return arguments.length?(t=typeof w=="function"?w:yc(w),f):t},f.subject=function(w){return arguments.length?(n=typeof w=="function"?w:yc(w),f):n},f.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:yc(!!w),f):r},f.on=function(){var w=o.on.apply(o,arguments);return w===o?f:w},f.clickDistance=function(w){return arguments.length?(d=(w=+w)*w,f):Math.sqrt(d)},f}function s0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ek(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Pa(){}var ea=.7,Fu=1/ea,ei="\\s*([+-]?\\d+)\\s*",ta="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",nr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",m5=/^#([0-9a-f]{3,8})$/,y5=new RegExp(`^rgb\\(${ei},${ei},${ei}\\)$`),x5=new RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`),v5=new RegExp(`^rgba\\(${ei},${ei},${ei},${ta}\\)$`),w5=new RegExp(`^rgba\\(${nr},${nr},${nr},${ta}\\)$`),b5=new RegExp(`^hsl\\(${ta},${nr},${nr}\\)$`),S5=new RegExp(`^hsla\\(${ta},${nr},${nr},${ta}\\)$`),Zx={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};s0(Pa,na,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Jx,formatHex:Jx,formatHex8:E5,formatHsl:k5,formatRgb:ev,toString:ev});function Jx(){return this.rgb().formatHex()}function E5(){return this.rgb().formatHex8()}function k5(){return kk(this).formatHsl()}function ev(){return this.rgb().formatRgb()}function na(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=m5.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?tv(t):n===3?new qt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?xc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?xc(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=y5.exec(e))?new qt(t[1],t[2],t[3],1):(t=x5.exec(e))?new qt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=v5.exec(e))?xc(t[1],t[2],t[3],t[4]):(t=w5.exec(e))?xc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=b5.exec(e))?sv(t[1],t[2]/100,t[3]/100,1):(t=S5.exec(e))?sv(t[1],t[2]/100,t[3]/100,t[4]):Zx.hasOwnProperty(e)?tv(Zx[e]):e==="transparent"?new qt(NaN,NaN,NaN,0):null}function tv(e){return new qt(e>>16&255,e>>8&255,e&255,1)}function xc(e,t,n,r){return r<=0&&(e=t=n=NaN),new qt(e,t,n,r)}function C5(e){return e instanceof Pa||(e=na(e)),e?(e=e.rgb(),new qt(e.r,e.g,e.b,e.opacity)):new qt}function jp(e,t,n,r){return arguments.length===1?C5(e):new qt(e,t,n,r??1)}function qt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}s0(qt,jp,Ek(Pa,{brighter(e){return e=e==null?Fu:Math.pow(Fu,e),new qt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ea:Math.pow(ea,e),new qt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qt(Zs(this.r),Zs(this.g),Zs(this.b),$u(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:nv,formatHex:nv,formatHex8:N5,formatRgb:rv,toString:rv}));function nv(){return`#${Fs(this.r)}${Fs(this.g)}${Fs(this.b)}`}function N5(){return`#${Fs(this.r)}${Fs(this.g)}${Fs(this.b)}${Fs((isNaN(this.opacity)?1:this.opacity)*255)}`}function rv(){const e=$u(this.opacity);return`${e===1?"rgb(":"rgba("}${Zs(this.r)}, ${Zs(this.g)}, ${Zs(this.b)}${e===1?")":`, ${e})`}`}function $u(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fs(e){return e=Zs(e),(e<16?"0":"")+e.toString(16)}function sv(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Mn(e,t,n,r)}function kk(e){if(e instanceof Mn)return new Mn(e.h,e.s,e.l,e.opacity);if(e instanceof Pa||(e=na(e)),!e)return new Mn;if(e instanceof Mn)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 Mn(i,l,a,e.opacity)}function R5(e,t,n,r){return arguments.length===1?kk(e):new Mn(e,t,n,r??1)}function Mn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}s0(Mn,R5,Ek(Pa,{brighter(e){return e=e==null?Fu:Math.pow(Fu,e),new Mn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ea:Math.pow(ea,e),new Mn(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 qt(Bf(e>=240?e-240:e+120,s,r),Bf(e,s,r),Bf(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Mn(ov(this.h),vc(this.s),vc(this.l),$u(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=$u(this.opacity);return`${e===1?"hsl(":"hsla("}${ov(this.h)}, ${vc(this.s)*100}%, ${vc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ov(e){return e=(e||0)%360,e<0?e+360:e}function vc(e){return Math.max(0,Math.min(1,e||0))}function Bf(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 Ck=e=>()=>e;function T5(e,t){return function(n){return e+n*t}}function P5(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 I5(e){return(e=+e)==1?Nk:function(t,n){return n-t?P5(t,n,e):Ck(isNaN(t)?n:t)}}function Nk(e,t){var n=t-e;return n?T5(e,n):Ck(isNaN(e)?t:e)}const iv=function e(t){var n=I5(t);function r(s,o){var i=n((s=jp(s)).r,(o=jp(o)).r),l=n(s.g,o.g),a=n(s.b,o.b),c=Nk(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 Ur(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Ap=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Vf=new RegExp(Ap.source,"g");function O5(e){return function(){return e}}function _5(e){return function(t){return e(t)+""}}function M5(e,t){var n=Ap.lastIndex=Vf.lastIndex=0,r,s,o,i=-1,l=[],a=[];for(e=e+"",t=t+"";(r=Ap.exec(e))&&(s=Vf.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:Ur(r,s)})),n=Vf.lastIndex;return n<t.length&&(o=t.slice(n),l[i]?l[i]+=o:l[++i]=o),l.length<2?a[0]?_5(a[0].x):O5(t):(t=a.length,function(c){for(var u=0,d;u<t;++u)l[(d=a[u]).i]=d.x(c);return l.join("")})}var lv=180/Math.PI,zp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Rk(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)*lv,skewX:Math.atan(a)*lv,scaleX:i,scaleY:l}}var wc;function j5(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?zp:Rk(t.a,t.b,t.c,t.d,t.e,t.f)}function A5(e){return e==null||(wc||(wc=document.createElementNS("http://www.w3.org/2000/svg","g")),wc.setAttribute("transform",e),!(e=wc.transform.baseVal.consolidate()))?zp:(e=e.matrix,Rk(e.a,e.b,e.c,e.d,e.e,e.f))}function Tk(e,t,n,r){function s(c){return c.length?c.pop()+" ":""}function o(c,u,d,f,p,x){if(c!==d||u!==f){var v=p.push("translate(",null,t,null,n);x.push({i:v-4,x:Ur(c,d)},{i:v-2,x:Ur(u,f)})}else(d||f)&&p.push("translate("+d+t+f+n)}function i(c,u,d,f){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),f.push({i:d.push(s(d)+"rotate(",null,r)-2,x:Ur(c,u)})):u&&d.push(s(d)+"rotate("+u+r)}function l(c,u,d,f){c!==u?f.push({i:d.push(s(d)+"skewX(",null,r)-2,x:Ur(c,u)}):u&&d.push(s(d)+"skewX("+u+r)}function a(c,u,d,f,p,x){if(c!==d||u!==f){var v=p.push(s(p)+"scale(",null,",",null,")");x.push({i:v-4,x:Ur(c,d)},{i:v-2,x:Ur(u,f)})}else(d!==1||f!==1)&&p.push(s(p)+"scale("+d+","+f+")")}return function(c,u){var d=[],f=[];return c=e(c),u=e(u),o(c.translateX,c.translateY,u.translateX,u.translateY,d,f),i(c.rotate,u.rotate,d,f),l(c.skewX,u.skewX,d,f),a(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,f),c=u=null,function(p){for(var x=-1,v=f.length,b;++x<v;)d[(b=f[x]).i]=b.x(p);return d.join("")}}}var z5=Tk(j5,"px, ","px)","deg)"),D5=Tk(A5,", ",")",")"),F5=1e-12;function av(e){return((e=Math.exp(e))+1/e)/2}function $5(e){return((e=Math.exp(e))-1/e)/2}function L5(e){return((e=Math.exp(2*e))-1)/(e+1)}const H5=function e(t,n,r){function s(o,i){var l=o[0],a=o[1],c=o[2],u=i[0],d=i[1],f=i[2],p=u-l,x=d-a,v=p*p+x*x,b,m;if(v<F5)m=Math.log(f/c)/t,b=function(k){return[l+k*p,a+k*x,c*Math.exp(t*k*m)]};else{var g=Math.sqrt(v),y=(f*f-c*c+r*v)/(2*c*n*g),w=(f*f-c*c-r*v)/(2*f*n*g),E=Math.log(Math.sqrt(y*y+1)-y),N=Math.log(Math.sqrt(w*w+1)-w);m=(N-E)/t,b=function(k){var C=k*m,I=av(E),P=c/(n*g)*(I*L5(t*C+E)-$5(E));return[l+P*p,a+P*x,c*I/av(t*C+E)]}}return b.duration=m*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 _i=0,pl=0,ol=0,Pk=1e3,Lu,gl,Hu=0,co=0,_d=0,ra=typeof performance=="object"&&performance.now?performance:Date,Ik=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function o0(){return co||(Ik(B5),co=ra.now()+_d)}function B5(){co=0}function Bu(){this._call=this._time=this._next=null}Bu.prototype=Ok.prototype={constructor:Bu,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?o0():+n)+(t==null?0:+t),!this._next&&gl!==this&&(gl?gl._next=this:Lu=this,gl=this),this._call=e,this._time=n,Dp()},stop:function(){this._call&&(this._call=null,this._time=1/0,Dp())}};function Ok(e,t,n){var r=new Bu;return r.restart(e,t,n),r}function V5(){o0(),++_i;for(var e=Lu,t;e;)(t=co-e._time)>=0&&e._call.call(void 0,t),e=e._next;--_i}function cv(){co=(Hu=ra.now())+_d,_i=pl=0;try{V5()}finally{_i=0,U5(),co=0}}function W5(){var e=ra.now(),t=e-Hu;t>Pk&&(_d-=t,Hu=e)}function U5(){for(var e,t=Lu,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:Lu=n);gl=e,Dp(r)}function Dp(e){if(!_i){pl&&(pl=clearTimeout(pl));var t=e-co;t>24?(e<1/0&&(pl=setTimeout(cv,e-ra.now()-_d)),ol&&(ol=clearInterval(ol))):(ol||(Hu=ra.now(),ol=setInterval(W5,Pk)),_i=1,Ik(cv))}}function uv(e,t,n){var r=new Bu;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var q5=Id("start","end","cancel","interrupt"),K5=[],_k=0,dv=1,Fp=2,Bc=3,fv=4,$p=5,Vc=6;function Md(e,t,n,r,s,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;Y5(e,n,{name:t,index:r,group:s,on:q5,tween:K5,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:_k})}function i0(e,t){var n=$n(e,t);if(n.state>_k)throw new Error("too late; already scheduled");return n}function sr(e,t){var n=$n(e,t);if(n.state>Bc)throw new Error("too late; already running");return n}function $n(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Y5(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=Ok(o,0,n.time);function o(c){n.state=dv,n.timer.restart(i,n.delay,n.time),n.delay<=c&&i(c-n.delay)}function i(c){var u,d,f,p;if(n.state!==dv)return a();for(u in r)if(p=r[u],p.name===n.name){if(p.state===Bc)return uv(i);p.state===fv?(p.state=Vc,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+u<t&&(p.state=Vc,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[u])}if(uv(function(){n.state===Bc&&(n.state=fv,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=Fp,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Fp){for(n.state=Bc,s=new Array(f=n.tween.length),u=0,d=-1;u<f;++u)(p=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(s[++d]=p);s.length=d+1}}function l(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(a),n.state=$p,1),d=-1,f=s.length;++d<f;)s[d].call(e,u);n.state===$p&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Vc,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Wc(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>Fp&&r.state<$p,r.state=Vc,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}o&&delete e.__transition}}function G5(e){return this.each(function(){Wc(this,e)})}function Q5(e,t){var n,r;return function(){var s=sr(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 X5(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=sr(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 Z5(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=$n(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?Q5:X5)(n,e,t))}function l0(e,t,n){var r=e._id;return e.each(function(){var s=sr(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return $n(s,r).value[t]}}function Mk(e,t){var n;return(typeof t=="number"?Ur:t instanceof na?iv:(n=na(t))?(t=n,iv):M5)(e,t)}function J5(e){return function(){this.removeAttribute(e)}}function eD(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tD(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 nD(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 rD(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 sD(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 oD(e,t){var n=Od(e),r=n==="transform"?D5:Mk;return this.attrTween(e,typeof t=="function"?(n.local?sD:rD)(n,r,l0(this,"attr."+e,t)):t==null?(n.local?eD:J5)(n):(n.local?nD:tD)(n,r,t))}function iD(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function lD(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function aD(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&lD(e,o)),n}return s._value=t,s}function cD(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&iD(e,o)),n}return s._value=t,s}function uD(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=Od(e);return this.tween(n,(r.local?aD:cD)(r,t))}function dD(e,t){return function(){i0(this,e).delay=+t.apply(this,arguments)}}function fD(e,t){return t=+t,function(){i0(this,e).delay=t}}function hD(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?dD:fD)(t,e)):$n(this.node(),t).delay}function pD(e,t){return function(){sr(this,e).duration=+t.apply(this,arguments)}}function gD(e,t){return t=+t,function(){sr(this,e).duration=t}}function mD(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?pD:gD)(t,e)):$n(this.node(),t).duration}function yD(e,t){if(typeof t!="function")throw new Error;return function(){sr(this,e).ease=t}}function xD(e){var t=this._id;return arguments.length?this.each(yD(t,e)):$n(this.node(),t).ease}function vD(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;sr(this,e).ease=n}}function wD(e){if(typeof e!="function")throw new Error;return this.each(vD(this._id,e))}function bD(e){typeof e!="function"&&(e=uk(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 Ir(r,this._parents,this._name,this._id)}function SD(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,d=i[l]=new Array(u),f,p=0;p<u;++p)(f=a[p]||c[p])&&(d[p]=f);for(;l<r;++l)i[l]=t[l];return new Ir(i,this._parents,this._name,this._id)}function ED(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 kD(e,t,n){var r,s,o=ED(t)?i0:sr;return function(){var i=o(this,e),l=i.on;l!==r&&(s=(r=l).copy()).on(t,n),i.on=s}}function CD(e,t){var n=this._id;return arguments.length<2?$n(this.node(),n).on.on(e):this.each(kD(n,e,t))}function ND(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function RD(){return this.on("end.remove",ND(this._id))}function TD(e){var t=this._name,n=this._id;typeof e!="function"&&(e=n0(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,d,f=0;f<a;++f)(u=l[f])&&(d=e.call(u,u.__data__,f,l))&&("__data__"in u&&(d.__data__=u.__data__),c[f]=d,Md(c[f],t,n,f,c,$n(u,n)));return new Ir(o,this._parents,t,n)}function PD(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ck(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,d=0;d<c;++d)if(u=a[d]){for(var f=e.call(u,u.__data__,d,a),p,x=$n(u,n),v=0,b=f.length;v<b;++v)(p=f[v])&&Md(p,t,n,v,f,x);o.push(f),i.push(u)}return new Ir(o,i,t,n)}var ID=Ta.prototype.constructor;function OD(){return new ID(this._groups,this._parents)}function _D(e,t){var n,r,s;return function(){var o=Oi(this,e),i=(this.style.removeProperty(e),Oi(this,e));return o===i?null:o===n&&i===r?s:s=t(n=o,r=i)}}function jk(e){return function(){this.style.removeProperty(e)}}function MD(e,t,n){var r,s=n+"",o;return function(){var i=Oi(this,e);return i===s?null:i===r?o:o=t(r=i,n)}}function jD(e,t,n){var r,s,o;return function(){var i=Oi(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),Oi(this,e))),i===a?null:i===r&&a===s?o:(s=a,o=t(r=i,l))}}function AD(e,t){var n,r,s,o="style."+t,i="end."+o,l;return function(){var a=sr(this,e),c=a.on,u=a.value[o]==null?l||(l=jk(t)):void 0;(c!==n||s!==u)&&(r=(n=c).copy()).on(i,s=u),a.on=r}}function zD(e,t,n){var r=(e+="")=="transform"?z5:Mk;return t==null?this.styleTween(e,_D(e,r)).on("end.style."+e,jk(e)):typeof t=="function"?this.styleTween(e,jD(e,r,l0(this,"style."+e,t))).each(AD(this._id,e)):this.styleTween(e,MD(e,r,t),n).on("end.style."+e,null)}function DD(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function FD(e,t,n){var r,s;function o(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&DD(e,i,n)),r}return o._value=t,o}function $D(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,FD(e,t,n??""))}function LD(e){return function(){this.textContent=e}}function HD(e){return function(){var t=e(this);this.textContent=t??""}}function BD(e){return this.tween("text",typeof e=="function"?HD(l0(this,"text",e)):LD(e==null?"":e+""))}function VD(e){return function(t){this.textContent=e.call(this,t)}}function WD(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&VD(s)),t}return r._value=e,r}function UD(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,WD(e))}function qD(){for(var e=this._name,t=this._id,n=Ak(),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=$n(a,t);Md(a,e,n,c,i,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ir(r,this._parents,e,n)}function KD(){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=sr(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 YD=0;function Ir(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Ak(){return++YD}var lr=Ta.prototype;Ir.prototype={constructor:Ir,select:TD,selectAll:PD,selectChild:lr.selectChild,selectChildren:lr.selectChildren,filter:bD,merge:SD,selection:OD,transition:qD,call:lr.call,nodes:lr.nodes,node:lr.node,size:lr.size,empty:lr.empty,each:lr.each,on:CD,attr:oD,attrTween:uD,style:zD,styleTween:$D,text:BD,textTween:UD,remove:RD,tween:Z5,delay:hD,duration:mD,ease:xD,easeVarying:wD,end:KD,[Symbol.iterator]:lr[Symbol.iterator]};function GD(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var QD={time:null,delay:0,duration:250,ease:GD};function XD(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 ZD(e){var t,n;e instanceof Ir?(t=e._id,e=e._name):(t=Ak(),(n=QD).time=o0(),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])&&Md(a,e,t,c,i,n||XD(a,t));return new Ir(r,this._parents,e,t)}Ta.prototype.interrupt=G5;Ta.prototype.transition=ZD;const bc=e=>()=>e;function JD(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 xr(e,t,n){this.k=e,this.x=t,this.y=n}xr.prototype={constructor:xr,scale:function(e){return e===1?this:new xr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new xr(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 jd=new xr(1,0,0);zk.prototype=xr.prototype;function zk(e){for(;!e.__zoom;)if(!(e=e.parentNode))return jd;return e.__zoom}function Wf(e){e.stopImmediatePropagation()}function il(e){e.preventDefault(),e.stopImmediatePropagation()}function eF(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function tF(){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 hv(){return this.__zoom||jd}function nF(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function rF(){return navigator.maxTouchPoints||"ontouchstart"in this}function sF(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 Dk(){var e=eF,t=tF,n=sF,r=nF,s=rF,o=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,a=H5,c=Id("start","zoom","end"),u,d,f,p=500,x=150,v=0,b=10;function m(R){R.property("__zoom",hv).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",P).filter(s).on("touchstart.zoom",A).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(R,O,_,$){var T=R.selection?R.selection():R;T.property("__zoom",hv),R!==T?E(R,O,_,$):T.interrupt().each(function(){N(this,arguments).event($).start().zoom(null,typeof O=="function"?O.apply(this,arguments):O).end()})},m.scaleBy=function(R,O,_,$){m.scaleTo(R,function(){var T=this.__zoom.k,j=typeof O=="function"?O.apply(this,arguments):O;return T*j},_,$)},m.scaleTo=function(R,O,_,$){m.transform(R,function(){var T=t.apply(this,arguments),j=this.__zoom,M=_==null?w(T):typeof _=="function"?_.apply(this,arguments):_,U=j.invert(M),H=typeof O=="function"?O.apply(this,arguments):O;return n(y(g(j,H),M,U),T,i)},_,$)},m.translateBy=function(R,O,_,$){m.transform(R,function(){return n(this.__zoom.translate(typeof O=="function"?O.apply(this,arguments):O,typeof _=="function"?_.apply(this,arguments):_),t.apply(this,arguments),i)},null,$)},m.translateTo=function(R,O,_,$,T){m.transform(R,function(){var j=t.apply(this,arguments),M=this.__zoom,U=$==null?w(j):typeof $=="function"?$.apply(this,arguments):$;return n(jd.translate(U[0],U[1]).scale(M.k).translate(typeof O=="function"?-O.apply(this,arguments):-O,typeof _=="function"?-_.apply(this,arguments):-_),j,i)},$,T)};function g(R,O){return O=Math.max(o[0],Math.min(o[1],O)),O===R.k?R:new xr(O,R.x,R.y)}function y(R,O,_){var $=O[0]-_[0]*R.k,T=O[1]-_[1]*R.k;return $===R.x&&T===R.y?R:new xr(R.k,$,T)}function w(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function E(R,O,_,$){R.on("start.zoom",function(){N(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event($).end()}).tween("zoom",function(){var T=this,j=arguments,M=N(T,j).event($),U=t.apply(T,j),H=_==null?w(U):typeof _=="function"?_.apply(T,j):_,V=Math.max(U[1][0]-U[0][0],U[1][1]-U[0][1]),W=T.__zoom,q=typeof O=="function"?O.apply(T,j):O,B=a(W.invert(H).concat(V/W.k),q.invert(H).concat(V/q.k));return function(K){if(K===1)K=q;else{var L=B(K),Y=V/L[2];K=new xr(Y,H[0]-L[0]*Y,H[1]-L[1]*Y)}M.zoom(null,K)}})}function N(R,O,_){return!_&&R.__zooming||new k(R,O)}function k(R,O){this.that=R,this.args=O,this.active=0,this.sourceEvent=null,this.extent=t.apply(R,O),this.taps=0}k.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,O){return this.mouse&&R!=="mouse"&&(this.mouse[1]=O.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=O.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=O.invert(this.touch1[0])),this.that.__zoom=O,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var O=en(this.that).datum();c.call(R,this.that,new JD(R,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:c}),O)}};function C(R,...O){if(!e.apply(this,arguments))return;var _=N(this,O).event(R),$=this.__zoom,T=Math.max(o[0],Math.min(o[1],$.k*Math.pow(2,r.apply(this,arguments)))),j=On(R);if(_.wheel)(_.mouse[0][0]!==j[0]||_.mouse[0][1]!==j[1])&&(_.mouse[1]=$.invert(_.mouse[0]=j)),clearTimeout(_.wheel);else{if($.k===T)return;_.mouse=[j,$.invert(j)],Wc(this),_.start()}il(R),_.wheel=setTimeout(M,x),_.zoom("mouse",n(y(g($,T),_.mouse[0],_.mouse[1]),_.extent,i));function M(){_.wheel=null,_.end()}}function I(R,...O){if(f||!e.apply(this,arguments))return;var _=R.currentTarget,$=N(this,O,!0).event(R),T=en(R.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",V,!0),j=On(R,_),M=R.clientX,U=R.clientY;wk(R.view),Wf(R),$.mouse=[j,this.__zoom.invert(j)],Wc(this),$.start();function H(W){if(il(W),!$.moved){var q=W.clientX-M,B=W.clientY-U;$.moved=q*q+B*B>v}$.event(W).zoom("mouse",n(y($.that.__zoom,$.mouse[0]=On(W,_),$.mouse[1]),$.extent,i))}function V(W){T.on("mousemove.zoom mouseup.zoom",null),bk(W.view,$.moved),il(W),$.event(W).end()}}function P(R,...O){if(e.apply(this,arguments)){var _=this.__zoom,$=On(R.changedTouches?R.changedTouches[0]:R,this),T=_.invert($),j=_.k*(R.shiftKey?.5:2),M=n(y(g(_,j),$,T),t.apply(this,O),i);il(R),l>0?en(this).transition().duration(l).call(E,M,$,R):en(this).call(m.transform,M,$,R)}}function A(R,...O){if(e.apply(this,arguments)){var _=R.touches,$=_.length,T=N(this,O,R.changedTouches.length===$).event(R),j,M,U,H;for(Wf(R),M=0;M<$;++M)U=_[M],H=On(U,this),H=[H,this.__zoom.invert(H),U.identifier],T.touch0?!T.touch1&&T.touch0[2]!==H[2]&&(T.touch1=H,T.taps=0):(T.touch0=H,j=!0,T.taps=1+!!u);u&&(u=clearTimeout(u)),j&&(T.taps<2&&(d=H[0],u=setTimeout(function(){u=null},p)),Wc(this),T.start())}}function F(R,...O){if(this.__zooming){var _=N(this,O).event(R),$=R.changedTouches,T=$.length,j,M,U,H;for(il(R),j=0;j<T;++j)M=$[j],U=On(M,this),_.touch0&&_.touch0[2]===M.identifier?_.touch0[0]=U:_.touch1&&_.touch1[2]===M.identifier&&(_.touch1[0]=U);if(M=_.that.__zoom,_.touch1){var V=_.touch0[0],W=_.touch0[1],q=_.touch1[0],B=_.touch1[1],K=(K=q[0]-V[0])*K+(K=q[1]-V[1])*K,L=(L=B[0]-W[0])*L+(L=B[1]-W[1])*L;M=g(M,Math.sqrt(K/L)),U=[(V[0]+q[0])/2,(V[1]+q[1])/2],H=[(W[0]+B[0])/2,(W[1]+B[1])/2]}else if(_.touch0)U=_.touch0[0],H=_.touch0[1];else return;_.zoom("touch",n(y(M,U,H),_.extent,i))}}function z(R,...O){if(this.__zooming){var _=N(this,O).event(R),$=R.changedTouches,T=$.length,j,M;for(Wf(R),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),j=0;j<T;++j)M=$[j],_.touch0&&_.touch0[2]===M.identifier?delete _.touch0:_.touch1&&_.touch1[2]===M.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(M=On(M,this),Math.hypot(d[0]-M[0],d[1]-M[1])<b)){var U=en(this).on("dblclick.zoom");U&&U.apply(this,arguments)}}}return m.wheelDelta=function(R){return arguments.length?(r=typeof R=="function"?R:bc(+R),m):r},m.filter=function(R){return arguments.length?(e=typeof R=="function"?R:bc(!!R),m):e},m.touchable=function(R){return arguments.length?(s=typeof R=="function"?R:bc(!!R),m):s},m.extent=function(R){return arguments.length?(t=typeof R=="function"?R:bc([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),m):t},m.scaleExtent=function(R){return arguments.length?(o[0]=+R[0],o[1]=+R[1],m):[o[0],o[1]]},m.translateExtent=function(R){return arguments.length?(i[0][0]=+R[0][0],i[1][0]=+R[1][0],i[0][1]=+R[0][1],i[1][1]=+R[1][1],m):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},m.constrain=function(R){return arguments.length?(n=R,m):n},m.duration=function(R){return arguments.length?(l=+R,m):l},m.interpolate=function(R){return arguments.length?(a=R,m):a},m.on=function(){var R=c.on.apply(c,arguments);return R===c?m:R},m.clickDistance=function(R){return arguments.length?(v=(R=+R)*R,m):Math.sqrt(v)},m.tapDistance=function(R){return arguments.length?(b=+R,m):b},m}const Mr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`},sa=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Fk=["Enter"," ","Escape"];var Mi;(function(e){e.Strict="strict",e.Loose="loose"})(Mi||(Mi={}));var Js;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Js||(Js={}));var oa;(function(e){e.Partial="partial",e.Full="full"})(oa||(oa={}));const $k={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Yr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Yr||(Yr={}));var Vu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Vu||(Vu={}));var ue;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ue||(ue={}));const pv={[ue.Left]:ue.Right,[ue.Right]:ue.Left,[ue.Top]:ue.Bottom,[ue.Bottom]:ue.Top};function Lk(e){return e===null?null:e?"valid":"invalid"}const Hk=e=>"id"in e&&"source"in e&&"target"in e,oF=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),a0=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ia=(e,t=[0,0])=>{const{width:n,height:r}=jr(e),s=e.origin??t,o=n*s[0],i=r*s[1];return{x:e.position.x-o,y:e.position.y-i}},iF=(e,t={nodeOrigin:[0,0],nodeLookup:void 0})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const o=typeof s=="string";let i=!t.nodeLookup&&!o?s:void 0;t.nodeLookup&&(i=o?t.nodeLookup.get(s):a0(s)?s:t.nodeLookup.get(s.id));const l=i?Wu(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ad(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return zd(n)},Oa=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const s=Wu(r);n=Ad(n,s)}}),zd(n)},Bk=(e,t,[n,r,s]=[0,0,1],o=!1,i=!1)=>{const l={..._a(t,[n,r,s]),width:t.width/s,height:t.height/s},a=[];for(const c of e.values()){const{measured:u,selectable:d=!0,hidden:f=!1}=c;if(i&&!d||f)continue;const p=u.width??c.width??c.initialWidth??null,x=u.height??c.height??c.initialHeight??null,v=ia(l,Ai(c)),b=(p??0)*(x??0),m=o&&v>0;(!c.internals.handleBounds||m||v>=b||c.dragging)&&a.push(c)}return a},lF=(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 Lp(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function Hp({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},i){if(e.size===0)return Promise.resolve(!1);const l=Oa(e),a=c0(l,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(a,{duration:i==null?void 0:i.duration}),Promise.resolve(!0)}function Vk({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 d=s;if(i.extent==="parent"&&!i.expandParent)if(!l)o==null||o("005",Mr.error005());else{const p=l.measured.width,x=l.measured.height;p&&x&&(d=[[a,c],[a+p,c+x]])}else l&&zi(i.extent)&&(d=[[i.extent[0][0]+a,i.extent[0][1]+c],[i.extent[1][0]+a,i.extent[1][1]+c]]);const f=zi(d)?uo(t,d,i.measured):t;return{position:{x:f.x-a+i.measured.width*u[0],y:f.y-c+i.measured.height*u[1]},positionAbsolute:f}}async function aF({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const o=new Set(e.map(f=>f.id)),i=[];for(const f of n){if(f.deletable===!1)continue;const p=o.has(f.id),x=!p&&f.parentId&&i.find(v=>v.id===f.parentId);(p||x)&&i.push(f)}const l=new Set(t.map(f=>f.id)),a=r.filter(f=>f.deletable!==!1),u=lF(i,a);for(const f of a)l.has(f.id)&&!u.find(x=>x.id===f.id)&&u.push(f);if(!s)return{edges:u,nodes:i};const d=await s({nodes:i,edges:u});return typeof d=="boolean"?d?{edges:u,nodes:i}:{edges:[],nodes:[]}:d}const ji=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),uo=(e={x:0,y:0},t,n)=>({x:ji(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ji(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Wk(e,t,n){const{width:r,height:s}=jr(n),{x:o,y:i}=n.internals.positionAbsolute;return uo(e,[[o,i],[o+r,i+s]],t)}const gv=(e,t,n)=>e<t?ji(Math.abs(e-t),1,t)/t:e>n?-ji(Math.abs(e-n),1,t)/t:0,Uk=(e,t,n=15,r=40)=>{const s=gv(e.x,r,t.width-r)*n,o=gv(e.y,r,t.height-r)*n;return[s,o]},Ad=(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)}),Bp=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),zd=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Ai=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=a0(e)?e.internals.positionAbsolute:Ia(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}},Wu=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=a0(e)?e.internals.positionAbsolute:Ia(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)}},qk=(e,t)=>zd(Ad(Bp(e),Bp(t))),ia=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},mv=e=>jn(e.width)&&jn(e.height)&&jn(e.x)&&jn(e.y),jn=e=>!isNaN(e)&&isFinite(e),cF=(e,t)=>{},Dd=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),_a=({x:e,y:t},[n,r,s],o=!1,i=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return o?Dd(l,i):l},Kk=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r}),c0=(e,t,n,r,s,o)=>{const i=t/(e.width*(1+o)),l=n/(e.height*(1+o)),a=Math.min(i,l),c=ji(a,r,s),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*c,p=n/2-d*c;return{x:f,y:p,zoom:c}},Uu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function zi(e){return e!==void 0&&e!=="parent"}function jr(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 Yk(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 Gk(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 Pl(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:i}=Sr(e),l=_a({x:o-((s==null?void 0:s.left)??0),y:i-((s==null?void 0:s.top)??0)},r),{x:a,y:c}=n?Dd(l,t):l;return{xSnapped:a,ySnapped:c,...l}}const Fd=e=>({width:e.offsetWidth,height:e.offsetHeight}),Qk=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},uF=["INPUT","SELECT","TEXTAREA"];function Vp(e){var r,s,o;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return uF.includes(t==null?void 0:t.nodeName)||((o=t==null?void 0:t.hasAttribute)==null?void 0:o.call(t,"contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const Xk=e=>"clientX"in e,Sr=(e,t)=>{var o,i;const n=Xk(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)}},yv=(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,...Fd(i)}})};function Zk({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),d=Math.abs(c-t);return[a,c,u,d]}function Sc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function xv({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case ue.Left:return[t-Sc(t-r,o),n];case ue.Right:return[t+Sc(r-t,o),n];case ue.Top:return[t,n-Sc(n-s,o)];case ue.Bottom:return[t,n+Sc(s-n,o)]}}function Jk({sourceX:e,sourceY:t,sourcePosition:n=ue.Bottom,targetX:r,targetY:s,targetPosition:o=ue.Top,curvature:i=.25}){const[l,a]=xv({pos:n,x1:e,y1:t,x2:r,y2:s,c:i}),[c,u]=xv({pos:o,x1:r,y1:s,x2:e,y2:t,c:i}),[d,f,p,x]=Zk({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}`,d,f,p,x]}function eC({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 dF({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:s=!1}){if(!s)return r;const o=n||t.selected||e.selected,i=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(o?i:0)}function fF({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=Ad(Wu(e),Wu(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 ia(i,zd(o))>0}const hF=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,pF=(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)),gF=(e,t)=>{if(!e.source||!e.target)return t;let n;return Hk(e)?n={...e}:n={...e,id:hF(e)},pF(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function tC({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,i,l]=eC({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,i,l]}const vv={[ue.Left]:{x:-1,y:0},[ue.Right]:{x:1,y:0},[ue.Top]:{x:0,y:-1},[ue.Bottom]:{x:0,y:1}},mF=({source:e,sourcePosition:t=ue.Bottom,target:n})=>t===ue.Left||t===ue.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},wv=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function yF({source:e,sourcePosition:t=ue.Bottom,target:n,targetPosition:r=ue.Top,center:s,offset:o}){const i=vv[t],l=vv[r],a={x:e.x+i.x*o,y:e.y+i.y*o},c={x:n.x+l.x*o,y:n.y+l.y*o},u=mF({source:a,sourcePosition:t,target:c}),d=u.x!==0?"x":"y",f=u[d];let p=[],x,v;const b={x:0,y:0},m={x:0,y:0},[g,y,w,E]=eC({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[d]*l[d]===-1){x=s.x??g,v=s.y??y;const k=[{x,y:a.y},{x,y:c.y}],C=[{x:a.x,y:v},{x:c.x,y:v}];i[d]===f?p=d==="x"?k:C:p=d==="x"?C:k}else{const k=[{x:a.x,y:c.y}],C=[{x:c.x,y:a.y}];if(d==="x"?p=i.x===f?C:k:p=i.y===f?k:C,t===r){const z=Math.abs(e[d]-n[d]);if(z<=o){const R=Math.min(o-1,o-z);i[d]===f?b[d]=(a[d]>e[d]?-1:1)*R:m[d]=(c[d]>n[d]?-1:1)*R}}if(t!==r){const z=d==="x"?"y":"x",R=i[d]===l[z],O=a[z]>c[z],_=a[z]<c[z];(i[d]===1&&(!R&&O||R&&_)||i[d]!==1&&(!R&&_||R&&O))&&(p=d==="x"?k:C)}const I={x:a.x+b.x,y:a.y+b.y},P={x:c.x+m.x,y:c.y+m.y},A=Math.max(Math.abs(I.x-p[0].x),Math.abs(P.x-p[0].x)),F=Math.max(Math.abs(I.y-p[0].y),Math.abs(P.y-p[0].y));A>=F?(x=(I.x+P.x)/2,v=p[0].y):(x=p[0].x,v=(I.y+P.y)/2)}return[[e,{x:a.x+b.x,y:a.y+b.y},...p,{x:c.x+m.x,y:c.y+m.y},n],x,v,w,E]}function xF(e,t,n,r){const s=Math.min(wv(e,t)/2,wv(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 Wp({sourceX:e,sourceY:t,sourcePosition:n=ue.Bottom,targetX:r,targetY:s,targetPosition:o=ue.Top,borderRadius:i=5,centerX:l,centerY:a,offset:c=20}){const[u,d,f,p,x]=yF({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:l,y:a},offset:c});return[u.reduce((b,m,g)=>{let y="";return g>0&&g<u.length-1?y=xF(u[g-1],m,u[g+1],i):y=`${g===0?"M":"L"}${m.x} ${m.y}`,b+=y,b},""),d,f,p,x]}function bv(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function vF(e){var d;const{sourceNode:t,targetNode:n}=e;if(!bv(t)||!bv(n))return null;const r=t.internals.handleBounds||Sv(t.handles),s=n.internals.handleBounds||Sv(n.handles),o=Ev((r==null?void 0:r.source)??[],e.sourceHandle),i=Ev(e.connectionMode===Mi.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(d=e.onError)==null||d.call(e,"008",Mr.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(o==null?void 0:o.position)||ue.Bottom,a=(i==null?void 0:i.position)||ue.Top,c=la(t,o,l),u=la(n,i,a);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:l,targetPosition:a}}function Sv(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 la(e,t,n=ue.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??jr(e);if(r)return{x:s+i/2,y:o+l/2};switch((t==null?void 0:t.position)??n){case ue.Top:return{x:s+i/2,y:o};case ue.Right:return{x:s+i,y:o+l/2};case ue.Bottom:return{x:s+i/2,y:o+l};case ue.Left:return{x:s,y:o+l/2}}}function Ev(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Up(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function wF(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=Up(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 u0={nodeOrigin:[0,0],nodeExtent:sa,elevateNodesOnSelect:!0,defaults:{}},bF={...u0,checkEquality:!0};function d0(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function SF(e,t,n){const r=d0(u0,n);for(const s of e.values())if(s.parentId)f0(s,e,t,r);else{const o=Ia(s,r.nodeOrigin),i=zi(s.extent)?s.extent:r.nodeExtent,l=uo(o,i,jr(s));s.internals.positionAbsolute=l}}function qp(e,t,n,r){var l,a;const s=d0(bF,r),o=new Map(t),i=s!=null&&s.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const c of e){let u=o.get(c.id);if(s.checkEquality&&c===(u==null?void 0:u.internals.userNode))t.set(c.id,u);else{const d=Ia(c,s.nodeOrigin),f=zi(c.extent)?c.extent:s.nodeExtent,p=uo(d,f,jr(c));u={...s.defaults,...c,measured:{width:(l=c.measured)==null?void 0:l.width,height:(a=c.measured)==null?void 0:a.height},internals:{positionAbsolute:p,handleBounds:c.measured?u==null?void 0:u.internals.handleBounds:void 0,z:nC(c,i),userNode:c}},t.set(c.id,u)}c.parentId&&f0(u,t,n,r)}}function EF(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 f0(e,t,n,r){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:i}=d0(u0,r),l=e.parentId,a=t.get(l);if(!a){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}EF(e,n);const c=s?1e3:0,{x:u,y:d,z:f}=kF(e,a,o,i,c),{positionAbsolute:p}=e.internals,x=u!==p.x||d!==p.y;(x||f!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:x?{x:u,y:d}:p,z:f})}function nC(e,t){return(jn(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function kF(e,t,n,r,s){const{x:o,y:i}=t.internals.positionAbsolute,l=jr(e),a=Ia(e,n),c=zi(e.extent)?uo(a,e.extent,l):a;let u=uo({x:o+c.x,y:i+c.y},r,l);e.extent==="parent"&&(u=Wk(u,l,t));const d=nC(e,s),f=t.internals.z??0;return{x:u.x,y:u.y,z:f>d?f:d}}function h0(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)??Ai(a),u=qk(c,l.rect);o.set(l.parentId,{expandedRect:u,parent:a})}return o.size>0&&o.forEach(({expandedRect:l,parent:a},c)=>{var y;const u=a.internals.positionAbsolute,d=jr(a),f=a.origin??r,p=l.x<u.x?Math.round(Math.abs(u.x-l.x)):0,x=l.y<u.y?Math.round(Math.abs(u.y-l.y)):0,v=Math.max(d.width,Math.round(l.width)),b=Math.max(d.height,Math.round(l.height)),m=(v-d.width)*f[0],g=(b-d.height)*f[1];(p>0||x>0||m||g)&&(s.push({id:c,type:"position",position:{x:a.position.x-p+m,y:a.position.y-x+g}}),(y=n.get(c))==null||y.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+x}})})),(d.width<l.width||d.height<l.height||p||x)&&s.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:v+(p?f[0]*p-m:0),height:b+(x?f[1]*x-g:0)}})}),s}function CF(e,t,n,r,s,o){const i=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!i)return{changes:[],updatedInternals:l};const a=[],c=window.getComputedStyle(i),{m22:u}=new window.DOMMatrixReadOnly(c.transform),d=[];for(const f of e.values()){const p=t.get(f.id);if(p)if(p.hidden)p.internals={...p.internals,handleBounds:void 0},l=!0;else{const x=Fd(f.nodeElement),v=p.measured.width!==x.width||p.measured.height!==x.height;if(!!(x.width&&x.height&&(v||!p.internals.handleBounds||f.force))){const m=f.nodeElement.getBoundingClientRect(),g=zi(p.extent)?p.extent:o;let{positionAbsolute:y}=p.internals;p.parentId&&p.extent==="parent"?y=Wk(y,x,t.get(p.parentId)):g&&(y=uo(y,g,x)),p.measured=x,p.internals={...p.internals,positionAbsolute:y,handleBounds:{source:yv("source",f.nodeElement,m,u,p.id),target:yv("target",f.nodeElement,m,u,p.id)}},p.parentId&&f0(p,t,n,{nodeOrigin:s}),l=!0,v&&(a.push({id:p.id,type:"dimensions",dimensions:x}),p.expandParent&&p.parentId&&d.push({id:p.id,parentId:p.parentId,rect:Ai(p,s)}))}}}if(d.length>0){const f=h0(d,t,n,s);a.push(...f)}return{changes:a,updatedInternals:l}}async function NF({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const i=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,o]],r),l=!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2]);return Promise.resolve(l)}function rC(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=`${s}-source-${i}`,c=`${o}-target-${l}`,u=e.get(a)||new Map,d=e.get(c)||new Map,f={edgeId:r.id,source:s,target:o,sourceHandle:i,targetHandle:l};t.set(r.id,r),e.set(a,u.set(`${o}-${l}`,f)),e.set(c,d.set(`${s}-${i}`,f))}}function sC(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:sC(n,t):!1}function kv(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n)return!1;r=r.parentElement}while(r);return!1}function RF(e,t,n,r){const s=new Map;for(const[o,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!sC(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 Uf({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var i,l,a;const s=[];for(const[c,u]of t){const d=(i=n.get(c))==null?void 0:i.internals.userNode;d&&s.push({...d,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 TF({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,d=!1,f=null,p=!1;function x({noDragClassName:b,handleSelector:m,domNode:g,isSelectable:y,nodeId:w,nodeClickDistance:E=0}){f=en(g);function N({x:P,y:A},F){const{nodeLookup:z,nodeExtent:R,snapGrid:O,snapToGrid:_,nodeOrigin:$,onNodeDrag:T,onSelectionDrag:j,onError:M,updateNodePositions:U}=t();o={x:P,y:A};let H=!1,V={x:0,y:0,x2:0,y2:0};if(l.size>1&&R){const W=Oa(l);V=Bp(W)}for(const[W,q]of l){if(!z.has(W))continue;let B={x:P-q.distance.x,y:A-q.distance.y};_&&(B=Dd(B,O));let K=[[R[0][0],R[0][1]],[R[1][0],R[1][1]]];if(l.size>1&&R&&!q.extent){const{positionAbsolute:J}=q.internals,X=J.x-V.x+R[0][0],G=J.x+q.measured.width-V.x2+R[1][0],Q=J.y-V.y+R[0][1],te=J.y+q.measured.height-V.y2+R[1][1];K=[[X,Q],[G,te]]}const{position:L,positionAbsolute:Y}=Vk({nodeId:W,nextPosition:B,nodeLookup:z,nodeExtent:K,nodeOrigin:$,onError:M});H=H||q.position.x!==L.x||q.position.y!==L.y,q.position=L,q.internals.positionAbsolute=Y}if(H&&(U(l,!0),F&&(r||T||!w&&j))){const[W,q]=Uf({nodeId:w,dragItems:l,nodeLookup:z});r==null||r(F,l,W,q),T==null||T(F,W,q),w||j==null||j(F,q)}}async function k(){if(!u)return;const{transform:P,panBy:A,autoPanSpeed:F}=t(),[z,R]=Uk(c,u,F);(z!==0||R!==0)&&(o.x=(o.x??0)-z/P[2],o.y=(o.y??0)-R/P[2],await A({x:z,y:R})&&N(o,null)),i=requestAnimationFrame(k)}function C(P){var H;const{nodeLookup:A,multiSelectionActive:F,nodesDraggable:z,transform:R,snapGrid:O,snapToGrid:_,selectNodesOnDrag:$,onNodeDragStart:T,onSelectionDragStart:j,unselectNodesAndEdges:M}=t();d=!0,(!$||!y)&&!F&&w&&((H=A.get(w))!=null&&H.selected||M()),y&&$&&w&&(e==null||e(w));const U=Pl(P.sourceEvent,{transform:R,snapGrid:O,snapToGrid:_,containerBounds:u});if(o=U,l=RF(A,z,U,w),l.size>0&&(n||T||!w&&j)){const[V,W]=Uf({nodeId:w,dragItems:l,nodeLookup:A});n==null||n(P.sourceEvent,l,V,W),T==null||T(P.sourceEvent,V,W),w||j==null||j(P.sourceEvent,W)}}const I=Sk().clickDistance(E).on("start",P=>{const{domNode:A,nodeDragThreshold:F,transform:z,snapGrid:R,snapToGrid:O}=t();u=(A==null?void 0:A.getBoundingClientRect())||null,p=!1,F===0&&C(P),o=Pl(P.sourceEvent,{transform:z,snapGrid:R,snapToGrid:O,containerBounds:u}),c=Sr(P.sourceEvent,u)}).on("drag",P=>{const{autoPanOnNodeDrag:A,transform:F,snapGrid:z,snapToGrid:R,nodeDragThreshold:O,nodeLookup:_}=t(),$=Pl(P.sourceEvent,{transform:F,snapGrid:z,snapToGrid:R,containerBounds:u});if((P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||w&&!_.has(w))&&(p=!0),!p){if(!a&&A&&d&&(a=!0,k()),!d){const T=$.xSnapped-(o.x??0),j=$.ySnapped-(o.y??0);Math.sqrt(T*T+j*j)>O&&C(P)}(o.x!==$.xSnapped||o.y!==$.ySnapped)&&l&&d&&(c=Sr(P.sourceEvent,u),N($,P.sourceEvent))}}).on("end",P=>{if(!(!d||p)&&(a=!1,d=!1,cancelAnimationFrame(i),l.size>0)){const{nodeLookup:A,updateNodePositions:F,onNodeDragStop:z,onSelectionDragStop:R}=t();if(F(l,!1),s||z||!w&&R){const[O,_]=Uf({nodeId:w,dragItems:l,nodeLookup:A,dragging:!1});s==null||s(P.sourceEvent,l,O,_),z==null||z(P.sourceEvent,O,_),w||R==null||R(P.sourceEvent,_)}}}).filter(P=>{const A=P.target;return!P.button&&(!b||!kv(A,`.${b}`,g))&&(!m||kv(A,m,g))});f.call(I)}function v(){f==null||f.on(".drag",null)}return{update:x,destroy:v}}function PF(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())ia(s,Ai(o))>0&&r.push(o);return r}const IF=250;function OF(e,t,n,r){var l,a;let s=[],o=1/0;const i=PF(e,n,t+IF);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 d of u){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:p}=la(c,d,d.position,!0),x=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(p-e.y,2));x>t||(x<o?(s=[{...d,x:f,y:p}],o=x):x===o&&s.push({...d,x:f,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 oC(e,t,n,r,s,o=!1){var c,u,d;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)??[],...((d=i.internals.handleBounds)==null?void 0:d.target)??[]],a=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return a&&o?{...a,...la(i,a,a.position,!0)}:a}function iC(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function _F(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const lC=()=>!0;function MF(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:i,domNode:l,nodeLookup:a,lib:c,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:x,onConnect:v,onConnectEnd:b,isValidConnection:m=lC,onReconnectEnd:g,updateConnection:y,getTransform:w,getFromHandle:E,autoPanSpeed:N}){const k=Qk(e.target);let C=0,I;const{x:P,y:A}=Sr(e),F=k==null?void 0:k.elementFromPoint(P,A),z=iC(o,F),R=l==null?void 0:l.getBoundingClientRect();if(!R||!z)return;const O=oC(s,z,r,a,t);if(!O)return;let _=Sr(e,R),$=!1,T=null,j=!1,M=null;function U(){if(!u||!R)return;const[Y,J]=Uk(_,R,N);f({x:Y,y:J}),C=requestAnimationFrame(U)}const H={...O,nodeId:s,type:z,position:O.position},V=a.get(s),q={inProgress:!0,isValid:null,from:la(V,H,ue.Left,!0),fromHandle:H,fromPosition:H.position,fromNode:V,to:_,toHandle:null,toPosition:pv[H.position],toNode:null};y(q);let B=q;x==null||x(e,{nodeId:s,handleId:r,handleType:z});function K(Y){if(!E()||!H){L(Y);return}const J=w();_=Sr(Y,R),I=OF(_a(_,J,!1,[1,1]),n,a,H),$||(U(),$=!0);const X=aC(Y,{handle:I,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:i?"target":"source",isValidConnection:m,doc:k,lib:c,flowId:d,nodeLookup:a});M=X.handleDomNode,T=X.connection,j=_F(!!I,X.isValid);const G={...B,isValid:j,to:I&&j?Kk({x:I.x,y:I.y},J):_,toHandle:X.toHandle,toPosition:j&&X.toHandle?X.toHandle.position:pv[H.position],toNode:X.toHandle?a.get(X.toHandle.nodeId):null};j&&I&&B.toHandle&&G.toHandle&&B.toHandle.type===G.toHandle.type&&B.toHandle.nodeId===G.toHandle.nodeId&&B.toHandle.id===G.toHandle.id&&B.to.x===G.to.x&&B.to.y===G.to.y||(y(G),B=G)}function L(Y){(I||M)&&T&&j&&(v==null||v(T));const{inProgress:J,...X}=B,G={...X,toPosition:B.toHandle?B.toPosition:null};b==null||b(Y,G),o&&(g==null||g(Y,G)),p(),cancelAnimationFrame(C),$=!1,j=!1,T=null,M=null,k.removeEventListener("mousemove",K),k.removeEventListener("mouseup",L),k.removeEventListener("touchmove",K),k.removeEventListener("touchend",L)}k.addEventListener("mousemove",K),k.addEventListener("mouseup",L),k.addEventListener("touchmove",K),k.addEventListener("touchend",L)}function aC(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:i,lib:l,flowId:a,isValidConnection:c=lC,nodeLookup:u}){const d=o==="target",f=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:x}=Sr(e),v=i.elementFromPoint(p,x),b=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:f,m={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const g=iC(void 0,b),y=b.getAttribute("data-nodeid"),w=b.getAttribute("data-handleid"),E=b.classList.contains("connectable"),N=b.classList.contains("connectableend");if(!y||!g)return m;const k={source:d?y:r,sourceHandle:d?w:s,target:d?r:y,targetHandle:d?s:w};m.connection=k;const I=E&&N&&(n===Mi.Strict?d&&g==="source"||!d&&g==="target":y!==r||w!==s);m.isValid=I&&c(k),m.toHandle=oC(y,g,w,u,n,!1)}return m}const Kp={onPointerDown:MF,isValid:aC};function jF({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=en(e);function o({translateExtent:l,width:a,height:c,zoomStep:u=10,pannable:d=!0,zoomable:f=!0,inversePan:p=!1}){const x=y=>{const w=n();if(y.sourceEvent.type!=="wheel"||!t)return;const E=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*u,N=w[2]*Math.pow(2,E);t.scaleTo(N)};let v=[0,0];const b=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(v=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},m=y=>{const w=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[E[0]-v[0],E[1]-v[1]];v=E;const k=r()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),C={x:w[0]-N[0]*k,y:w[1]-N[1]*k},I=[[0,0],[a,c]];t.setViewportConstrained({x:C.x,y:C.y,zoom:w[2]},I,l)},g=Dk().on("start",b).on("zoom",d?m:null).on("zoom.wheel",f?x:null);s.call(g,{})}function i(){s.on("zoom",null)}return{update:o,destroy:i,pointer:On}}const AF=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,$d=e=>({x:e.x,y:e.y,zoom:e.k}),qf=({x:e,y:t,zoom:n})=>jd.translate(e,t).scale(n),Vo=(e,t)=>e.target.closest(`.${t}`),cC=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Kf=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},uC=e=>{const t=e.ctrlKey&&Uu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function zF({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:c}){return u=>{if(Vo(u,t))return!1;u.preventDefault(),u.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(u.ctrlKey&&i){const b=On(u),m=uC(u),g=d*Math.pow(2,m);r.scaleTo(n,g,b,u);return}const f=u.deltaMode===1?20:1;let p=s===Js.Vertical?0:u.deltaX*f,x=s===Js.Horizontal?0:u.deltaY*f;!Uu()&&u.shiftKey&&s!==Js.Vertical&&(p=u.deltaY*f,x=0),r.translateBy(n,-(p/d)*o,-(x/d)*o,{internal:!0});const v=$d(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(u,v)),e.isPanScrolling&&(a==null||a(u,v),e.panScrollTimeout=setTimeout(()=>{c==null||c(u,v),e.isPanScrolling=!1},150))}}function DF({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){if(!t&&r.type==="wheel"&&!r.ctrlKey||Vo(r,e))return null;r.preventDefault(),n.call(this,r,s)}}function FF({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,i,l;if((o=r.sourceEvent)!=null&&o.internal)return;const s=$d(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 $F({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var i,l;e.usedRightMouseButton=!!(n&&cC(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,$d(o.transform)))}}function LF({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&&cC(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&o(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),s&&AF(e.prevViewport,i.transform))){const a=$d(i.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(i.sourceEvent,a)},n?150:0)}}}function HF({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:i,noWheelClassName:l,noPanClassName:a,lib:c}){return u=>{var x;const d=e||t,f=n&&u.ctrlKey;if(u.button===1&&u.type==="mousedown"&&(Vo(u,`${c}-flow__node`)||Vo(u,`${c}-flow__edge`)))return!0;if(!r&&!d&&!s&&!o&&!n||i||Vo(u,l)&&u.type==="wheel"||Vo(u,a)&&(u.type!=="wheel"||s&&u.type==="wheel"&&!e)||!n&&u.ctrlKey&&u.type==="wheel")return!1;if(!n&&u.type==="touchstart"&&((x=u.touches)==null?void 0:x.length)>1)return u.preventDefault(),!1;if(!d&&!s&&!f&&u.type==="wheel"||!r&&(u.type==="mousedown"||u.type==="touchstart")||Array.isArray(r)&&!r.includes(u.button)&&u.type==="mousedown")return!1;const p=Array.isArray(r)&&r.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||u.type==="wheel")&&p}}function BF({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:s,viewport:o,onPanZoom:i,onPanZoomStart:l,onPanZoomEnd:a,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=Dk().clickDistance(!jn(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(s),p=en(e).call(f);y({x:o.x,y:o.y,zoom:ji(o.zoom,t,n)},[[0,0],[d.width,d.height]],s);const x=p.on("wheel.zoom"),v=p.on("dblclick.zoom");f.wheelDelta(uC);function b(F,z){return p?new Promise(R=>{f==null||f.transform(Kf(p,z==null?void 0:z.duration,()=>R(!0)),F)}):Promise.resolve(!1)}function m({noWheelClassName:F,noPanClassName:z,onPaneContextMenu:R,userSelectionActive:O,panOnScroll:_,panOnDrag:$,panOnScrollMode:T,panOnScrollSpeed:j,preventScrolling:M,zoomOnPinch:U,zoomOnScroll:H,zoomOnDoubleClick:V,zoomActivationKeyPressed:W,lib:q,onTransformChange:B}){O&&!u.isZoomingOrPanning&&g();const L=_&&!W&&!O?zF({zoomPanValues:u,noWheelClassName:F,d3Selection:p,d3Zoom:f,panOnScrollMode:T,panOnScrollSpeed:j,zoomOnPinch:U,onPanZoomStart:l,onPanZoom:i,onPanZoomEnd:a}):DF({noWheelClassName:F,preventScrolling:M,d3ZoomHandler:x});if(p.on("wheel.zoom",L,{passive:!1}),!O){const J=FF({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:l});f.on("start",J);const X=$F({zoomPanValues:u,panOnDrag:$,onPaneContextMenu:!!R,onPanZoom:i,onTransformChange:B});f.on("zoom",X);const G=LF({zoomPanValues:u,panOnDrag:$,panOnScroll:_,onPaneContextMenu:R,onPanZoomEnd:a,onDraggingChange:c});f.on("end",G)}const Y=HF({zoomActivationKeyPressed:W,panOnDrag:$,zoomOnScroll:H,panOnScroll:_,zoomOnDoubleClick:V,zoomOnPinch:U,userSelectionActive:O,noPanClassName:z,noWheelClassName:F,lib:q});f.filter(Y),V?p.on("dblclick.zoom",v):p.on("dblclick.zoom",null)}function g(){f.on("zoom",null)}async function y(F,z,R){const O=qf(F),_=f==null?void 0:f.constrain()(O,z,R);return _&&await b(_),new Promise($=>$(_))}async function w(F,z){const R=qf(F);return await b(R,z),new Promise(O=>O(R))}function E(F){if(p){const z=qf(F),R=p.property("__zoom");(R.k!==F.zoom||R.x!==F.x||R.y!==F.y)&&(f==null||f.transform(p,z,null,{sync:!0}))}}function N(){const F=p?zk(p.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}function k(F,z){return p?new Promise(R=>{f==null||f.scaleTo(Kf(p,z==null?void 0:z.duration,()=>R(!0)),F)}):Promise.resolve(!1)}function C(F,z){return p?new Promise(R=>{f==null||f.scaleBy(Kf(p,z==null?void 0:z.duration,()=>R(!0)),F)}):Promise.resolve(!1)}function I(F){f==null||f.scaleExtent(F)}function P(F){f==null||f.translateExtent(F)}function A(F){const z=!jn(F)||F<0?0:F;f==null||f.clickDistance(z)}return{update:m,destroy:g,setViewport:w,setViewportConstrained:y,getViewport:N,scaleTo:k,scaleBy:C,setScaleExtent:I,setTranslateExtent:P,syncViewport:E,setClickDistance:A}}var Il;(function(e){e.Line="line",e.Handle="handle"})(Il||(Il={}));function VF({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 WF(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 Lr(e,t){return Math.max(0,t-e)}function Hr(e,t){return Math.max(0,e-t)}function Ec(e,t,n){return Math.max(0,t-e,e-n)}function Cv(e,t){return e?!t:t}function UF(e,t,n,r,s,o,i,l){let{affectsX:a,affectsY:c}=t;const{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:x}=n,{minWidth:v,maxWidth:b,minHeight:m,maxHeight:g}=r,{x:y,y:w,width:E,height:N,aspectRatio:k}=e;let C=Math.floor(u?p-e.pointerX:0),I=Math.floor(d?x-e.pointerY:0);const P=E+(a?-C:C),A=N+(c?-I:I),F=-o[0]*E,z=-o[1]*N;let R=Ec(P,v,b),O=Ec(A,m,g);if(i){let T=0,j=0;a&&C<0?T=Lr(y+C+F,i[0][0]):!a&&C>0&&(T=Hr(y+P+F,i[1][0])),c&&I<0?j=Lr(w+I+z,i[0][1]):!c&&I>0&&(j=Hr(w+A+z,i[1][1])),R=Math.max(R,T),O=Math.max(O,j)}if(l){let T=0,j=0;a&&C>0?T=Hr(y+C,l[0][0]):!a&&C<0&&(T=Lr(y+P,l[1][0])),c&&I>0?j=Hr(w+I,l[0][1]):!c&&I<0&&(j=Lr(w+A,l[1][1])),R=Math.max(R,T),O=Math.max(O,j)}if(s){if(u){const T=Ec(P/k,m,g)*k;if(R=Math.max(R,T),i){let j=0;!a&&!c||a&&!c&&f?j=Hr(w+z+P/k,i[1][1])*k:j=Lr(w+z+(a?C:-C)/k,i[0][1])*k,R=Math.max(R,j)}if(l){let j=0;!a&&!c||a&&!c&&f?j=Lr(w+P/k,l[1][1])*k:j=Hr(w+(a?C:-C)/k,l[0][1])*k,R=Math.max(R,j)}}if(d){const T=Ec(A*k,v,b)/k;if(O=Math.max(O,T),i){let j=0;!a&&!c||c&&!a&&f?j=Hr(y+A*k+F,i[1][0])/k:j=Lr(y+(c?I:-I)*k+F,i[0][0])/k,O=Math.max(O,j)}if(l){let j=0;!a&&!c||c&&!a&&f?j=Lr(y+A*k,l[1][0])/k:j=Hr(y+(c?I:-I)*k,l[0][0])/k,O=Math.max(O,j)}}}I=I+(I<0?O:-O),C=C+(C<0?R:-R),s&&(f?P>A*k?I=(Cv(a,c)?-C:C)/k:C=(Cv(a,c)?-I:I)*k:u?(I=C/k,c=a):(C=I*k,a=c));const _=a?y+C:y,$=c?w+I:w;return{width:E+(a?-C:C),height:N+(c?-I:I),x:o[0]*C*(a?-1:1)+_,y:o[1]*I*(c?-1:1)+$}}const dC={width:0,height:0,x:0,y:0},qF={...dC,pointerX:0,pointerY:0,aspectRatio:1};function KF(e){return[[0,0],[e.measured.width,e.measured.height]]}function YF(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 GF({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=en(e);function i({controlPosition:a,boundaries:c,keepAspectRatio:u,onResizeStart:d,onResize:f,onResizeEnd:p,shouldResize:x}){let v={...dC},b={...qF};const m=WF(a);let g,y=null,w=[],E,N,k;const C=Sk().on("start",I=>{const{nodeLookup:P,transform:A,snapGrid:F,snapToGrid:z,nodeOrigin:R,paneDomNode:O}=n();if(g=P.get(t),!g)return;y=(O==null?void 0:O.getBoundingClientRect())??null;const{xSnapped:_,ySnapped:$}=Pl(I.sourceEvent,{transform:A,snapGrid:F,snapToGrid:z,containerBounds:y});v={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},b={...v,pointerX:_,pointerY:$,aspectRatio:v.width/v.height},E=void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(E=P.get(g.parentId),N=E&&g.extent==="parent"?KF(E):void 0),w=[],k=void 0;for(const[T,j]of P)if(j.parentId===t&&(w.push({id:T,position:{...j.position},extent:j.extent}),j.extent==="parent"||j.expandParent)){const M=YF(j,g,j.origin??R);k?k=[[Math.min(M[0][0],k[0][0]),Math.min(M[0][1],k[0][1])],[Math.max(M[1][0],k[1][0]),Math.max(M[1][1],k[1][1])]]:k=M}d==null||d(I,{...v})}).on("drag",I=>{const{transform:P,snapGrid:A,snapToGrid:F,nodeOrigin:z}=n(),R=Pl(I.sourceEvent,{transform:P,snapGrid:A,snapToGrid:F,containerBounds:y}),O=[];if(!g)return;const{x:_,y:$,width:T,height:j}=v,M={},U=g.origin??z,{width:H,height:V,x:W,y:q}=UF(b,m,R,c,u,U,N,k),B=H!==T,K=V!==j,L=W!==_&&B,Y=q!==$&&K;if(!L&&!Y&&!B&&!K)return;if((L||Y||U[0]===1||U[1]===1)&&(M.x=L?W:v.x,M.y=Y?q:v.y,v.x=M.x,v.y=M.y,w.length>0)){const Q=W-_,te=q-$;for(const ge of w)ge.position={x:ge.position.x-Q+U[0]*(H-T),y:ge.position.y-te+U[1]*(V-j)},O.push(ge)}if((B||K)&&(M.width=B?H:v.width,M.height=K?V:v.height,v.width=M.width,v.height=M.height),E&&g.expandParent){const Q=U[0]*(M.width??0);M.x&&M.x<Q&&(v.x=Q,b.x=b.x-(M.x-Q));const te=U[1]*(M.height??0);M.y&&M.y<te&&(v.y=te,b.y=b.y-(M.y-te))}const J=VF({width:v.width,prevWidth:T,height:v.height,prevHeight:j,affectsX:m.affectsX,affectsY:m.affectsY}),X={...v,direction:J};(x==null?void 0:x(I,X))!==!1&&(f==null||f(I,X),r(M,O))}).on("end",I=>{p==null||p(I,{...v}),s==null||s()});o.call(C)}function l(){o.on(".drag",null)}return{update:i,destroy:l}}const QF={},Nv=e=>{let t;const n=new Set,r=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const p=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(x=>x(t,p))}},s=()=>t,a={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(QF?"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},XF=e=>e?Nv(e):Nv,{useDebugValue:ZF}=Rw,{useSyncExternalStoreWithSelector:JF}=A2,e$=e=>e;function fC(e,t=e$,n){const r=JF(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return ZF(r),r}const Rv=(e,t)=>{const n=XF(e),r=(s,o=t)=>fC(n,s,o);return Object.assign(r,n),r},t$=(e,t)=>e?Rv(e,t):Rv;function nt(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 Ld=S.createContext(null),n$=Ld.Provider,hC=Mr.error001();function Ie(e,t){const n=S.useContext(Ld);if(n===null)throw new Error(hC);return fC(n,e,t)}function Ue(){const e=S.useContext(Ld);if(e===null)throw new Error(hC);return S.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Tv={display:"none"},r$={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},pC="react-flow__node-desc",gC="react-flow__edge-desc",s$="react-flow__aria-live",o$=e=>e.ariaLiveMessage;function i$({rfId:e}){const t=Ie(o$);return h.jsx("div",{id:`${s$}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:r$,children:t})}function l$({rfId:e,disableKeyboardA11y:t}){return h.jsxs(h.Fragment,{children:[h.jsxs("div",{id:`${pC}-${e}`,style:Tv,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),h.jsx("div",{id:`${gC}-${e}`,style:Tv,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&h.jsx(i$,{rfId:e})]})}const a$=e=>e.userSelectionActive?"none":"all",p0=S.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const i=Ie(a$),l=`${e}`.split("-");return h.jsx("div",{className:it(["react-flow__panel",n,...l]),style:{...r,pointerEvents:i},ref:o,...s,children:t})});function c$({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:h.jsx(p0,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:h.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const u$=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}},kc=e=>e.id;function d$(e,t){return nt(e.selectedNodes.map(kc),t.selectedNodes.map(kc))&&nt(e.selectedEdges.map(kc),t.selectedEdges.map(kc))}function f$({onSelectionChange:e}){const t=Ue(),{selectedNodes:n,selectedEdges:r}=Ie(u$,d$);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 h$=e=>!!e.onSelectionChangeHandlers;function p$({onSelectionChange:e}){const t=Ie(h$);return e||t?h.jsx(f$,{onSelectionChange:e}):null}const mC=[0,0],g$={x:0,y:0,zoom:1},m$=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance"],Pv=[...m$,"rfId"],y$=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),Iv={translateExtent:sa,nodeOrigin:mC,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function x$(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:a,setPaneClickDistance:c}=Ie(y$,nt),u=Ue();S.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{d.current=Iv,l()}),[]);const d=S.useRef(Iv);return S.useEffect(()=>{for(const f of Pv){const p=e[f],x=d.current[f];p!==x&&(typeof e[f]>"u"||(f==="nodes"?t(p):f==="edges"?n(p):f==="minZoom"?r(p):f==="maxZoom"?s(p):f==="translateExtent"?o(p):f==="nodeExtent"?i(p):f==="paneClickDistance"?c(p):f==="fitView"?u.setState({fitViewOnInit:p}):f==="fitViewOptions"?u.setState({fitViewOnInitOptions:p}):u.setState({[f]:p})))}d.current=e},Pv.map(f=>e[f])),null}function Ov(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function v$(e){var r;const[t,n]=S.useState(e==="system"?null:e);return S.useEffect(()=>{if(e!=="system"){n(e);return}const s=Ov(),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=Ov())!=null&&r.matches?"dark":"light"}const _v=typeof document<"u"?document:null;function aa(e=null,t={target:_v,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(d=>typeof d=="string").map(d=>d.replace("+",`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),u=c.reduce((d,f)=>d.concat(...f),[]);return[c,u]}return[[],[]]},[e]);return S.useEffect(()=>{const a=(t==null?void 0:t.target)||_v;if(e!==null){const c=f=>{if(s.current=f.ctrlKey||f.metaKey||f.shiftKey,(!s.current||s.current&&!t.actInsideInputWithModifier)&&Vp(f))return!1;const x=jv(f.code,l);o.current.add(f[x]),Mv(i,o.current,!1)&&(f.preventDefault(),r(!0))},u=f=>{if((!s.current||s.current&&!t.actInsideInputWithModifier)&&Vp(f))return!1;const x=jv(f.code,l);Mv(i,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(f[x]),f.key==="Meta"&&o.current.clear(),s.current=!1},d=()=>{o.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",c),a==null||a.addEventListener("keyup",u),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{a==null||a.removeEventListener("keydown",c),a==null||a.removeEventListener("keyup",u),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,r]),n}function Mv(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function jv(e,t){return t.includes(e)?"code":"key"}const w$=()=>{const e=Ue();return S.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,o],panZoom:i}=e.getState();return i?(await i.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??o},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>{const{nodeLookup:n,minZoom:r,maxZoom:s,panZoom:o,domNode:i}=e.getState();if(!o||!i)return Promise.resolve(!1);const l=Lp(n,t),{width:a,height:c}=Fd(i);return Hp({nodes:l,width:a,height:c,minZoom:r,maxZoom:s,panZoom:o},t)},setCenter:async(t,n,r)=>{const{width:s,height:o,maxZoom:i,panZoom:l}=e.getState(),a=typeof(r==null?void 0:r.zoom)<"u"?r.zoom:i,c=s/2-t*a,u=o/2-n*a;return l?(await l.setViewport({x:c,y:u,zoom:a},{duration:r==null?void 0:r.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:o,maxZoom:i,panZoom:l}=e.getState(),a=c0(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}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{const{transform:r,snapGrid:s,domNode:o}=e.getState();if(!o)return t;const{x:i,y:l}=o.getBoundingClientRect(),a={x:t.x-i,y:t.y-l};return _a(a,r,n.snapToGrid,s)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:o}=r.getBoundingClientRect(),i=Kk(t,n);return{x:i.x+s,y:i.y+o}}}),[])};function yC(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)b$(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 b$(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&(t.width=e.dimensions.width,t.height=e.dimensions.height)),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function S$(e,t){return yC(e,t)}function E$(e,t){return yC(e,t)}function _s(e,t){return{id:e,type:"select",selected:t}}function Wo(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(_s(o.id,i)))}return r}function Av({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 zv(e){return{id:e.id,type:"remove"}}const Dv=e=>oF(e),k$=e=>Hk(e);function xC(e){return S.forwardRef(e)}const C$=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Fv(e){const[t,n]=S.useState(BigInt(0)),[r]=S.useState(()=>N$(()=>n(s=>s+BigInt(1))));return C$(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function N$(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const vC=S.createContext(null);function R$({children:e}){const t=Ue(),n=S.useCallback(l=>{const{nodes:a=[],setNodes:c,hasDefaultNodes:u,onNodesChange:d,nodeLookup:f}=t.getState();let p=a;for(const x of l)p=typeof x=="function"?x(p):x;u?c(p):d&&d(Av({items:p,lookup:f}))},[]),r=Fv(n),s=S.useCallback(l=>{const{edges:a=[],setEdges:c,hasDefaultEdges:u,onEdgesChange:d,edgeLookup:f}=t.getState();let p=a;for(const x of l)p=typeof x=="function"?x(p):x;u?c(p):d&&d(Av({items:p,lookup:f}))},[]),o=Fv(s),i=S.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return h.jsx(vC.Provider,{value:i,children:e})}function T$(){const e=S.useContext(vC);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const P$=e=>!!e.panZoom;function g0(){const e=w$(),t=Ue(),n=T$(),r=Ie(P$),s=S.useMemo(()=>{const o=d=>t.getState().nodeLookup.get(d),i=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},a=d=>{var m,g;const{nodeLookup:f,nodeOrigin:p}=t.getState(),x=Dv(d)?d:f.get(d.id),v=x.parentId?Gk(x.position,x.measured,x.parentId,f,p):x.position,b={...x,position:v,width:((m=x.measured)==null?void 0:m.width)??x.width,height:((g=x.measured)==null?void 0:g.height)??x.height};return Ai(b)},c=(d,f,p={replace:!1})=>{i(x=>x.map(v=>{if(v.id===d){const b=typeof f=="function"?f(v):f;return p.replace&&Dv(b)?b:{...v,...b}}return v}))},u=(d,f,p={replace:!1})=>{l(x=>x.map(v=>{if(v.id===d){const b=typeof f=="function"?f(v):f;return p.replace&&k$(b)?b:{...v,...b}}return v}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=o(d))==null?void 0:f.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:i,setEdges:l,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(p=>[...p,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(p=>[...p,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:p}=t.getState(),[x,v,b]=p;return{nodes:d.map(m=>({...m})),edges:f.map(m=>({...m})),viewport:{x,y:v,zoom:b}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:p,edges:x,onNodesDelete:v,onEdgesDelete:b,triggerNodeChanges:m,triggerEdgeChanges:g,onDelete:y,onBeforeDelete:w}=t.getState(),{nodes:E,edges:N}=await aF({nodesToRemove:d,edgesToRemove:f,nodes:p,edges:x,onBeforeDelete:w}),k=N.length>0,C=E.length>0;if(k){const I=N.map(zv);b==null||b(N),g(I)}if(C){const I=E.map(zv);v==null||v(E),m(I)}return(C||k)&&(y==null||y({nodes:E,edges:N})),{deletedNodes:E,deletedEdges:N}},getIntersectingNodes:(d,f=!0,p)=>{const x=mv(d),v=x?d:a(d),b=p!==void 0;return v?(p||t.getState().nodes).filter(m=>{const g=t.getState().nodeLookup.get(m.id);if(g&&!x&&(m.id===d.id||!g.internals.positionAbsolute))return!1;const y=Ai(b?m:g),w=ia(y,v);return f&&w>0||w>=v.width*v.height}):[]},isNodeIntersecting:(d,f,p=!0)=>{const v=mv(d)?d:a(d);if(!v)return!1;const b=ia(v,f);return p&&b>0||b>=v.width*v.height},updateNode:c,updateNodeData:(d,f,p={replace:!1})=>{c(d,x=>{const v=typeof f=="function"?f(x):f;return p.replace?{...x,data:v}:{...x,data:{...x.data,...v}}},p)},updateEdge:u,updateEdgeData:(d,f,p={replace:!1})=>{u(d,x=>{const v=typeof f=="function"?f(x):f;return p.replace?{...x,data:v}:{...x,data:{...x.data,...v}}},p)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:p}=t.getState();return iF(d,{nodeLookup:f,nodeOrigin:p})},getHandleConnections:({type:d,id:f,nodeId:p})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${p}-${d}-${f??null}`))==null?void 0:x.values())??[])}}},[]);return S.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const $v=e=>e.selected,I$={actInsideInputWithModifier:!1},O$=typeof window<"u"?window:void 0;function _$({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Ue(),{deleteElements:r}=g0(),s=aa(e,I$),o=aa(t,{target:O$});S.useEffect(()=>{if(s){const{edges:i,nodes:l}=n.getState();r({nodes:l.filter($v),edges:i.filter($v)}),n.setState({nodesSelectionActive:!1})}},[s]),S.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function M$(e){const t=Ue();S.useEffect(()=>{const n=()=>{var s,o;if(!e.current)return!1;const r=Fd(e.current);(r.height===0||r.width===0)&&((o=(s=t.getState()).onError)==null||o.call(s,"004",Mr.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 Hd={position:"absolute",width:"100%",height:"100%",top:0,left:0},j$=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function A$({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=Js.Free,zoomOnDoubleClick:i=!0,panOnDrag:l=!0,defaultViewport:a,translateExtent:c,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:x,noWheelClassName:v,noPanClassName:b,onViewportChange:m,isControlledViewport:g,paneClickDistance:y}){const w=Ue(),E=S.useRef(null),{userSelectionActive:N,lib:k}=Ie(j$,nt),C=aa(f),I=S.useRef();M$(E);const P=S.useCallback(A=>{m==null||m({x:A[0],y:A[1],zoom:A[2]}),g||w.setState({transform:A})},[m,g]);return S.useEffect(()=>{if(E.current){I.current=BF({domNode:E.current,minZoom:u,maxZoom:d,translateExtent:c,viewport:a,paneClickDistance:y,onDraggingChange:R=>w.setState({paneDragging:R}),onPanZoomStart:(R,O)=>{const{onViewportChangeStart:_,onMoveStart:$}=w.getState();$==null||$(R,O),_==null||_(O)},onPanZoom:(R,O)=>{const{onViewportChange:_,onMove:$}=w.getState();$==null||$(R,O),_==null||_(O)},onPanZoomEnd:(R,O)=>{const{onViewportChangeEnd:_,onMoveEnd:$}=w.getState();$==null||$(R,O),_==null||_(O)}});const{x:A,y:F,zoom:z}=I.current.getViewport();return w.setState({panZoom:I.current,transform:[A,F,z],domNode:E.current.closest(".react-flow")}),()=>{var R;(R=I.current)==null||R.destroy()}}},[]),S.useEffect(()=>{var A;(A=I.current)==null||A.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:i,panOnDrag:l,zoomActivationKeyPressed:C,preventScrolling:p,noPanClassName:b,userSelectionActive:N,noWheelClassName:v,lib:k,onTransformChange:P})},[e,t,n,r,s,o,i,l,C,p,b,N,v,k,P]),h.jsx("div",{className:"react-flow__renderer",ref:E,style:Hd,children:x})}const z$=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function D$(){const{userSelectionActive:e,userSelectionRect:t}=Ie(z$,nt);return e&&t?h.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 Yf=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},F$=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function $$({isSelecting:e,selectionKeyPressed:t,selectionMode:n=oa.Full,panOnDrag:r,selectionOnDrag:s,onSelectionStart:o,onSelectionEnd:i,onPaneClick:l,onPaneContextMenu:a,onPaneScroll:c,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:p}){const x=S.useRef(null),v=Ue(),b=S.useRef(0),m=S.useRef(0),g=S.useRef(),y=S.useRef(new Map),{userSelectionActive:w,elementsSelectable:E,dragging:N}=Ie(F$,nt),k=E&&(e||w),C=S.useRef(!1),I=S.useRef(!1),P=()=>{v.setState({userSelectionActive:!1,userSelectionRect:null}),b.current=0,m.current=0},A=T=>{if(C.current){C.current=!1;return}l==null||l(T),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},F=T=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){T.preventDefault();return}a==null||a(T)},z=c?T=>c(T):void 0,R=T=>{var W,q,B,K;const{resetSelectedElements:j,domNode:M,edgeLookup:U}=v.getState();if(g.current=M==null?void 0:M.getBoundingClientRect(),!E||!e||T.button!==0||T.target!==x.current||!g.current)return;(q=(W=T.target)==null?void 0:W.setPointerCapture)==null||q.call(W,T.pointerId),I.current=!0,C.current=!1,y.current=new Map;for(const[L,Y]of U)y.current.set(Y.source,((B=y.current.get(Y.source))==null?void 0:B.add(L))||new Set([L])),y.current.set(Y.target,((K=y.current.get(Y.target))==null?void 0:K.add(L))||new Set([L]));const{x:H,y:V}=Sr(T.nativeEvent,g.current);j(),v.setState({userSelectionRect:{width:0,height:0,startX:H,startY:V,x:H,y:V}}),o==null||o(T)},O=T=>{const{userSelectionRect:j,edgeLookup:M,transform:U,nodeLookup:H,triggerNodeChanges:V,triggerEdgeChanges:W}=v.getState();if(!g.current||!j)return;C.current=!0;const{x:q,y:B}=Sr(T.nativeEvent,g.current),{startX:K,startY:L}=j,Y={startX:K,startY:L,x:q<K?q:K,y:B<L?B:L,width:Math.abs(q-K),height:Math.abs(B-L)},J=Bk(H,Y,U,n===oa.Partial,!0),X=new Set,G=new Set;for(const Q of J){G.add(Q.id);const te=y.current.get(Q.id);if(te)for(const ge of te)X.add(ge)}if(b.current!==G.size){b.current=G.size;const Q=Wo(H,G,!0);V(Q)}if(m.current!==X.size){m.current=X.size;const Q=Wo(M,X);W(Q)}v.setState({userSelectionRect:Y,userSelectionActive:!0,nodesSelectionActive:!1})},_=T=>{var M,U;if(T.button!==0||!I.current)return;(U=(M=T.target)==null?void 0:M.releasePointerCapture)==null||U.call(M,T.pointerId);const{userSelectionRect:j}=v.getState();!w&&j&&T.target===x.current&&(A==null||A(T)),b.current>0&&v.setState({nodesSelectionActive:!0}),P(),i==null||i(T),(t||s)&&(C.current=!1),I.current=!1},$=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:it(["react-flow__pane",{draggable:$,dragging:N,selection:e}]),onClick:k?void 0:Yf(A,x),onContextMenu:Yf(F,x),onWheel:Yf(z,x),onPointerEnter:k?void 0:u,onPointerDown:k?R:d,onPointerMove:k?O:d,onPointerUp:k?_:void 0,onPointerLeave:f,ref:x,style:Hd,children:[p,h.jsx(D$,{})]})}function Yp({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",Mr.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 wC({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:i}){const l=Ue(),[a,c]=S.useState(!1),u=S.useRef();return S.useEffect(()=>{u.current=TF({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{Yp({id:d,store:l,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),S.useEffect(()=>{var d,f;if(t)(d=u.current)==null||d.destroy();else if(e.current)return(f=u.current)==null||f.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:i}),()=>{var p;(p=u.current)==null||p.destroy()}},[n,r,t,o,e,s]),a}const L$=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function bC(){const e=Ue();return S.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:i,onError:l,updateNodePositions:a,nodeLookup:c,nodeOrigin:u}=e.getState(),d=new Map,f=L$(i),p=s?o[0]:5,x=s?o[1]:5,v=n.direction.x*p*n.factor,b=n.direction.y*x*n.factor;for(const[,m]of c){if(!f(m))continue;let g={x:m.internals.positionAbsolute.x+v,y:m.internals.positionAbsolute.y+b};s&&(g=Dd(g,o));const{position:y,positionAbsolute:w}=Vk({nodeId:m.id,nextPosition:g,nodeLookup:c,nodeExtent:r,nodeOrigin:u,onError:l});m.position=y,m.internals.positionAbsolute=w,d.set(m.id,m)}a(d)},[])}const m0=S.createContext(null),H$=m0.Provider;m0.Consumer;const SC=()=>S.useContext(m0),B$=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),V$=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:i}=r,{fromHandle:l,toHandle:a,isValid:c}=i,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===Mi.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,valid:u&&c}};function W$({type:e="source",position:t=ue.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:i,onConnect:l,children:a,className:c,onMouseDown:u,onTouchStart:d,...f},p){var R,O;const x=i||null,v=e==="target",b=Ue(),m=SC(),{connectOnClick:g,noPanClassName:y,rfId:w}=Ie(B$,nt),{connectingFrom:E,connectingTo:N,clickConnecting:k,isPossibleEndHandle:C,connectionInProcess:I,valid:P}=Ie(V$(m,x,e),nt);m||(O=(R=b.getState()).onError)==null||O.call(R,"010",Mr.error010());const A=_=>{const{defaultEdgeOptions:$,onConnect:T,hasDefaultEdges:j}=b.getState(),M={...$,..._};if(j){const{edges:U,setEdges:H}=b.getState();H(gF(M,U))}T==null||T(M),l==null||l(M)},F=_=>{if(!m)return;const $=Xk(_.nativeEvent);if(s&&($&&_.button===0||!$)){const T=b.getState();Kp.onPointerDown(_.nativeEvent,{autoPanOnConnect:T.autoPanOnConnect,connectionMode:T.connectionMode,connectionRadius:T.connectionRadius,domNode:T.domNode,nodeLookup:T.nodeLookup,lib:T.lib,isTarget:v,handleId:x,nodeId:m,flowId:T.rfId,panBy:T.panBy,cancelConnection:T.cancelConnection,onConnectStart:T.onConnectStart,onConnectEnd:T.onConnectEnd,updateConnection:T.updateConnection,onConnect:A,isValidConnection:n||T.isValidConnection,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:T.autoPanSpeed})}$?u==null||u(_):d==null||d(_)},z=_=>{const{onClickConnectStart:$,onClickConnectEnd:T,connectionClickStartHandle:j,connectionMode:M,isValidConnection:U,lib:H,rfId:V,nodeLookup:W,connection:q}=b.getState();if(!m||!j&&!s)return;if(!j){$==null||$(_.nativeEvent,{nodeId:m,handleId:x,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:m,type:e,id:x}});return}const B=Qk(_.target),K=n||U,{connection:L,isValid:Y}=Kp.isValid(_.nativeEvent,{handle:{nodeId:m,id:x,type:e},connectionMode:M,fromNodeId:j.nodeId,fromHandleId:j.id||null,fromType:j.type,isValidConnection:K,flowId:V,doc:B,lib:H,nodeLookup:W});Y&&L&&A(L);const J=structuredClone(q);delete J.inProgress,J.toPosition=J.toHandle?J.toHandle.position:null,T==null||T(_,J),b.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":x,"data-nodeid":m,"data-handlepos":t,"data-id":`${w}-${m}-${x}-${e}`,className:it(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,c,{source:!v,target:v,connectable:r,connectablestart:s,connectableend:o,clickconnecting:k,connectingfrom:E,connectingto:N,valid:P,connectionindicator:r&&(!I||C)&&(I?o:s)}]),onMouseDown:F,onTouchStart:F,onClick:g?z:void 0,ref:p,...f,children:a})}const rr=S.memo(xC(W$));function U$({data:e,isConnectable:t,sourcePosition:n=ue.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(rr,{type:"source",position:n,isConnectable:t})]})}function q$({data:e,isConnectable:t,targetPosition:n=ue.Top,sourcePosition:r=ue.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(rr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(rr,{type:"source",position:r,isConnectable:t})]})}function K$(){return null}function Y$({data:e,isConnectable:t,targetPosition:n=ue.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(rr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const qu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Lv={input:U$,default:q$,output:Y$,group:K$};function G$(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 Q$=e=>{const{width:t,height:n,x:r,y:s}=Oa(e.nodeLookup,{filter:o=>!!o.selected});return{width:jn(t)?t:null,height:jn(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 X$({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Ue(),{width:s,height:o,transformString:i,userSelectionActive:l}=Ie(Q$,nt),a=bC(),c=S.useRef(null);if(S.useEffect(()=>{var f;n||(f=c.current)==null||f.focus({preventScroll:!0})},[n]),wC({nodeRef:c}),l||!s||!o)return null;const u=e?f=>{const p=r.getState().nodes.filter(x=>x.selected);e(f,p)}:void 0,d=f=>{Object.prototype.hasOwnProperty.call(qu,f.key)&&(f.preventDefault(),a({direction:qu[f.key],factor:f.shiftKey?4:1}))};return h.jsx("div",{className:it(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:h.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:u,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:s,height:o}})})}const Hv=typeof window<"u"?window:void 0,Z$=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function EC({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:c,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:v,zoomActivationKeyCode:b,elementsSelectable:m,zoomOnScroll:g,zoomOnPinch:y,panOnScroll:w,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:k,panOnDrag:C,defaultViewport:I,translateExtent:P,minZoom:A,maxZoom:F,preventScrolling:z,onSelectionContextMenu:R,noWheelClassName:O,noPanClassName:_,disableKeyboardA11y:$,onViewportChange:T,isControlledViewport:j}){const{nodesSelectionActive:M,userSelectionActive:U}=Ie(Z$),H=aa(c,{target:Hv}),V=aa(v,{target:Hv}),W=V||C,q=V||w,B=u&&W!==!0,K=H||U||B;return _$({deleteKeyCode:a,multiSelectionKeyCode:x}),h.jsx(A$,{onPaneContextMenu:o,elementsSelectable:m,zoomOnScroll:g,zoomOnPinch:y,panOnScroll:q,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:k,panOnDrag:!H&&W,defaultViewport:I,translateExtent:P,minZoom:A,maxZoom:F,zoomActivationKeyCode:b,preventScrolling:z,noWheelClassName:O,noPanClassName:_,onViewportChange:T,isControlledViewport:j,paneClickDistance:l,children:h.jsxs($$,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,panOnDrag:W,isSelecting:!!K,selectionMode:d,selectionKeyPressed:H,selectionOnDrag:B,children:[e,M&&h.jsx(X$,{onSelectionContextMenu:R,noPanClassName:_,disableKeyboardA11y:$})]})})}EC.displayName="FlowRenderer";const J$=S.memo(EC),e3=e=>t=>e?Bk(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 t3(e){return Ie(S.useCallback(e3(e),[e]),nt)}const n3=e=>e.updateNodeInternals;function r3(){const e=Ie(n3),[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 s3({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=Ue(),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 d=c.current!==t,f=l.current!==e.sourcePosition,p=a.current!==e.targetPosition;(d||f||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 o3({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:i,nodesDraggable:l,elementsSelectable:a,nodesConnectable:c,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:x,rfId:v,nodeTypes:b,nodeExtent:m,nodeClickDistance:g,onError:y}){const{node:w,internals:E,isParent:N}=Ie(L=>{const Y=L.nodeLookup.get(e),J=L.parentLookup.has(e);return{node:Y,internals:Y.internals,isParent:J}},nt);let k=w.type||"default",C=(b==null?void 0:b[k])||Lv[k];C===void 0&&(y==null||y("003",Mr.error003(k)),k="default",C=Lv.default);const I=!!(w.draggable||l&&typeof w.draggable>"u"),P=!!(w.selectable||a&&typeof w.selectable>"u"),A=!!(w.connectable||c&&typeof w.connectable>"u"),F=!!(w.focusable||u&&typeof w.focusable>"u"),z=Ue(),R=Yk(w),O=s3({node:w,nodeType:k,hasDimensions:R,resizeObserver:d}),_=wC({nodeRef:O,disabled:w.hidden||!I,noDragClassName:f,handleSelector:w.dragHandle,nodeId:e,isSelectable:P,nodeClickDistance:g}),$=bC();if(w.hidden)return null;const T=jr(w),j=G$(w),M=P||I||t||n||r||s,U=n?L=>n(L,{...E.userNode}):void 0,H=r?L=>r(L,{...E.userNode}):void 0,V=s?L=>s(L,{...E.userNode}):void 0,W=o?L=>o(L,{...E.userNode}):void 0,q=i?L=>i(L,{...E.userNode}):void 0,B=L=>{const{selectNodesOnDrag:Y,nodeDragThreshold:J}=z.getState();P&&(!Y||!I||J>0)&&Yp({id:e,store:z,nodeRef:O}),t&&t(L,{...E.userNode})},K=L=>{if(!(Vp(L.nativeEvent)||x))if(Fk.includes(L.key)&&P){const Y=L.key==="Escape";Yp({id:e,store:z,unselect:Y,nodeRef:O})}else I&&w.selected&&Object.prototype.hasOwnProperty.call(qu,L.key)&&(L.preventDefault(),z.setState({ariaLiveMessage:`Moved selected node ${L.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~E.positionAbsolute.x}, y: ${~~E.positionAbsolute.y}`}),$({direction:qu[L.key],factor:L.shiftKey?4:1}))};return h.jsx("div",{className:it(["react-flow__node",`react-flow__node-${k}`,{[p]:I},w.className,{selected:w.selected,selectable:P,parent:N,draggable:I,dragging:_}]),ref:O,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:M?"all":"none",visibility:R?"visible":"hidden",...w.style,...j},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:U,onMouseMove:H,onMouseLeave:V,onContextMenu:W,onClick:B,onDoubleClick:q,onKeyDown:F?K:void 0,tabIndex:F?0:void 0,role:F?"button":void 0,"aria-describedby":x?void 0:`${pC}-${v}`,"aria-label":w.ariaLabel,children:h.jsx(H$,{value:e,children:h.jsx(C,{id:e,data:w.data,type:k,positionAbsoluteX:E.positionAbsolute.x,positionAbsoluteY:E.positionAbsolute.y,selected:w.selected,selectable:P,draggable:I,deletable:w.deletable??!0,isConnectable:A,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:_,dragHandle:w.dragHandle,zIndex:E.z,parentId:w.parentId,...T})})})}const i3=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function kC(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:o}=Ie(i3,nt),i=t3(e.onlyRenderVisibleElements),l=r3();return h.jsx("div",{className:"react-flow__nodes",style:Hd,children:i.map(a=>h.jsx(o3,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:o},a))})}kC.displayName="NodeRenderer";const l3=S.memo(kC);function a3(e){return Ie(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&&fF({sourceNode:o,targetNode:i,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),nt)}const c3=({color:e="none",strokeWidth:t=1})=>h.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),u3=({color:e="none",strokeWidth:t=1})=>h.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Bv={[Vu.Arrow]:c3,[Vu.ArrowClosed]:u3};function d3(e){const t=Ue();return S.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(Bv,e)?Bv[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",Mr.error009(e)),null)},[e])}const f3=({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=d3(t);return a?h.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:h.jsx(a,{color:n,strokeWidth:i})}):null},CC=({defaultColor:e,rfId:t})=>{const n=Ie(o=>o.edges),r=Ie(o=>o.defaultEdgeOptions),s=S.useMemo(()=>wF(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?h.jsx("svg",{className:"react-flow__marker",children:h.jsx("defs",{children:s.map(o=>h.jsx(f3,{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};CC.displayName="MarkerDefinitions";var h3=S.memo(CC);function NC({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[d,f]=S.useState({x:1,y:0,width:0,height:0}),p=it(["react-flow__edge-textwrapper",c]),x=S.useRef(null);return S.useEffect(()=>{if(x.current){const v=x.current.getBBox();f({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),typeof n>"u"||!n?null:h.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?"visible":"hidden",...u,children:[s&&h.jsx("rect",{width:d.width+2*i[0],x:-i[0],y:-i[1],height:d.height+2*i[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),h.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:x,style:r,children:n}),a]})}NC.displayName="EdgeText";const p3=S.memo(NC);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 h.jsxs(h.Fragment,{children:[h.jsx("path",{...u,d:e,fill:"none",className:it(["react-flow__edge-path",u.className])}),c&&h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}),r&&jn(t)&&jn(n)?h.jsx(p3,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function Vv({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===ue.Left||e===ue.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function RC({sourceX:e,sourceY:t,sourcePosition:n=ue.Bottom,targetX:r,targetY:s,targetPosition:o=ue.Top}){const[i,l]=Vv({pos:n,x1:e,y1:t,x2:r,y2:s}),[a,c]=Vv({pos:o,x1:r,y1:s,x2:e,y2:t}),[u,d,f,p]=Zk({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,d,f,p]}function TC(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i=ue.Bottom,targetPosition:l=ue.Top,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:x,markerEnd:v,markerStart:b,interactionWidth:m})=>{const[g,y,w]=RC({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l}),E=e.isInternal?void 0:t;return h.jsx(Bd,{id:E,path:g,labelX:y,labelY:w,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:x,markerEnd:v,markerStart:b,interactionWidth:m})})}const g3=TC({isInternal:!1}),PC=TC({isInternal:!0});g3.displayName="SimpleBezierEdge";PC.displayName="SimpleBezierEdgeInternal";function IC(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:d,style:f,sourcePosition:p=ue.Bottom,targetPosition:x=ue.Top,markerEnd:v,markerStart:b,pathOptions:m,interactionWidth:g})=>{const[y,w,E]=Wp({sourceX:n,sourceY:r,sourcePosition:p,targetX:s,targetY:o,targetPosition:x,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset}),N=e.isInternal?void 0:t;return h.jsx(Bd,{id:N,path:y,labelX:w,labelY:E,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:v,markerStart:b,interactionWidth:g})})}const OC=IC({isInternal:!1}),_C=IC({isInternal:!0});OC.displayName="SmoothStepEdge";_C.displayName="SmoothStepEdgeInternal";function MC(e){return S.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return h.jsx(OC,{...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 m3=MC({isInternal:!1}),jC=MC({isInternal:!0});m3.displayName="StepEdge";jC.displayName="StepEdgeInternal";function AC(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:d,style:f,markerEnd:p,markerStart:x,interactionWidth:v})=>{const[b,m,g]=tC({sourceX:n,sourceY:r,targetX:s,targetY:o}),y=e.isInternal?void 0:t;return h.jsx(Bd,{id:y,path:b,labelX:m,labelY:g,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:x,interactionWidth:v})})}const y3=AC({isInternal:!1}),zC=AC({isInternal:!0});y3.displayName="StraightEdge";zC.displayName="StraightEdgeInternal";function DC(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i=ue.Bottom,targetPosition:l=ue.Top,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:x,markerEnd:v,markerStart:b,pathOptions:m,interactionWidth:g})=>{const[y,w,E]=Jk({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l,curvature:m==null?void 0:m.curvature}),N=e.isInternal?void 0:t;return h.jsx(Bd,{id:N,path:y,labelX:w,labelY:E,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:x,markerEnd:v,markerStart:b,interactionWidth:g})})}const x3=DC({isInternal:!1}),FC=DC({isInternal:!0});x3.displayName="BezierEdge";FC.displayName="BezierEdgeInternal";const Wv={default:FC,straight:zC,step:jC,smoothstep:_C,simplebezier:PC},Uv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},v3=(e,t,n)=>n===ue.Left?e-t:n===ue.Right?e+t:e,w3=(e,t,n)=>n===ue.Top?e-t:n===ue.Bottom?e+t:e,qv="react-flow__edgeupdater";function Kv({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:i,type:l}){return h.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:i,className:it([qv,`${qv}-${l}`]),cx:v3(t,r,e),cy:w3(n,r,e),r,stroke:"transparent",fill:"transparent"})}function b3({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:i,sourcePosition:l,targetPosition:a,onReconnect:c,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){const x=Ue(),v=(w,E)=>{if(w.button!==0)return;const{autoPanOnConnect:N,domNode:k,isValidConnection:C,connectionMode:I,connectionRadius:P,lib:A,onConnectStart:F,onConnectEnd:z,cancelConnection:R,nodeLookup:O,rfId:_,panBy:$,updateConnection:T}=x.getState(),j=E.type==="target";f(!0),u==null||u(w,n,E.type);const M=(H,V)=>{f(!1),d==null||d(H,n,E.type,V)},U=H=>c==null?void 0:c(n,H);Kp.onPointerDown(w.nativeEvent,{autoPanOnConnect:N,connectionMode:I,connectionRadius:P,domNode:k,handleId:E.id,nodeId:E.nodeId,nodeLookup:O,isTarget:j,edgeUpdaterType:E.type,lib:A,flowId:_,cancelConnection:R,panBy:$,isValidConnection:C,onConnect:U,onConnectStart:F,onConnectEnd:z,onReconnectEnd:M,updateConnection:T,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle})},b=w=>v(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=w=>v(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),g=()=>p(!0),y=()=>p(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(Kv,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:b,onMouseEnter:g,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&h.jsx(Kv,{position:a,centerX:o,centerY:i,radius:t,onMouseDown:m,onMouseEnter:g,onMouseOut:y,type:"target"})]})}function S3({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:i,onMouseEnter:l,onMouseMove:a,onMouseLeave:c,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:x,edgeTypes:v,noPanClassName:b,onError:m,disableKeyboardA11y:g}){let y=Ie(G=>G.edgeLookup.get(e));const w=Ie(G=>G.defaultEdgeOptions);y=w?{...w,...y}:y;let E=y.type||"default",N=(v==null?void 0:v[E])||Wv[E];N===void 0&&(m==null||m("011",Mr.error011(E)),E="default",N=Wv.default);const k=!!(y.focusable||t&&typeof y.focusable>"u"),C=typeof d<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),I=!!(y.selectable||r&&typeof y.selectable>"u"),P=S.useRef(null),[A,F]=S.useState(!1),[z,R]=S.useState(!1),O=Ue(),{zIndex:_,sourceX:$,sourceY:T,targetX:j,targetY:M,sourcePosition:U,targetPosition:H}=Ie(S.useCallback(G=>{const Q=G.nodeLookup.get(y.source),te=G.nodeLookup.get(y.target);if(!Q||!te)return{zIndex:y.zIndex,...Uv};const ge=vF({id:e,sourceNode:Q,targetNode:te,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:G.connectionMode,onError:m});return{zIndex:dF({selected:y.selected,zIndex:y.zIndex,sourceNode:Q,targetNode:te,elevateOnSelect:G.elevateEdgesOnSelect}),...ge||Uv}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),nt),V=S.useMemo(()=>y.markerStart?`url('#${Up(y.markerStart,x)}')`:void 0,[y.markerStart,x]),W=S.useMemo(()=>y.markerEnd?`url('#${Up(y.markerEnd,x)}')`:void 0,[y.markerEnd,x]);if(y.hidden||$===null||T===null||j===null||M===null)return null;const q=G=>{var Oe;const{addSelectedEdges:Q,unselectNodesAndEdges:te,multiSelectionActive:ge}=O.getState();I&&(O.setState({nodesSelectionActive:!1}),y.selected&&ge?(te({nodes:[],edges:[y]}),(Oe=P.current)==null||Oe.blur()):Q([e])),s&&s(G,y)},B=o?G=>{o(G,{...y})}:void 0,K=i?G=>{i(G,{...y})}:void 0,L=l?G=>{l(G,{...y})}:void 0,Y=a?G=>{a(G,{...y})}:void 0,J=c?G=>{c(G,{...y})}:void 0,X=G=>{var Q;if(!g&&Fk.includes(G.key)&&I){const{unselectNodesAndEdges:te,addSelectedEdges:ge}=O.getState();G.key==="Escape"?((Q=P.current)==null||Q.blur(),te({edges:[y]})):ge([e])}};return h.jsx("svg",{style:{zIndex:_},children:h.jsxs("g",{className:it(["react-flow__edge",`react-flow__edge-${E}`,y.className,b,{selected:y.selected,animated:y.animated,inactive:!I&&!s,updating:A,selectable:I}]),onClick:q,onDoubleClick:B,onContextMenu:K,onMouseEnter:L,onMouseMove:Y,onMouseLeave:J,onKeyDown:k?X:void 0,tabIndex:k?0:void 0,role:k?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":k?`${gC}-${x}`:void 0,ref:P,children:[!z&&h.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:I,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:$,sourceY:T,targetX:j,targetY:M,sourcePosition:U,targetPosition:H,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:V,markerEnd:W,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),C&&h.jsx(b3,{edge:y,isReconnectable:C,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:$,sourceY:T,targetX:j,targetY:M,sourcePosition:U,targetPosition:H,setUpdateHover:F,setReconnecting:R})]})})}const E3=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function $C({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:c,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:x,disableKeyboardA11y:v}){const{edgesFocusable:b,edgesReconnectable:m,elementsSelectable:g,onError:y}=Ie(E3,nt),w=a3(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(h3,{defaultColor:e,rfId:n}),w.map(E=>h.jsx(S3,{id:E,edgesFocusable:b,edgesReconnectable:m,elementsSelectable:g,noPanClassName:s,onReconnect:o,onContextMenu:i,onMouseEnter:l,onMouseMove:a,onMouseLeave:c,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:x,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:v},E))]})}$C.displayName="EdgeRenderer";const k3=S.memo($C),C3=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function N3({children:e}){const t=Ie(C3);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function R3(e){const t=g0(),n=S.useRef(!1);S.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const T3=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function P3(e){const t=Ie(T3),n=Ue();return S.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function I3(e){return e.connection.inProgress?{...e.connection,to:_a(e.connection.to,e.transform)}:{...e.connection}}function O3(e){return I3}function _3(e){const t=O3();return Ie(t,nt)}const M3=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function j3({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:i,isValid:l,inProgress:a}=Ie(M3,nt);return!(o&&s&&a)?null:h.jsx("svg",{style:e,width:o,height:i,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:it(["react-flow__connection",Lk(l)]),children:h.jsx(LC,{style:t,type:n,CustomComponent:r,isValid:l})})})}const LC=({style:e,type:t=Yr.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:i,fromHandle:l,fromPosition:a,to:c,toNode:u,toHandle:d,toPosition:f}=_3();if(!s)return;if(n)return h.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:f,connectionStatus:Lk(r),toNode:u,toHandle:d});let p="";const x={sourceX:o.x,sourceY:o.y,sourcePosition:a,targetX:c.x,targetY:c.y,targetPosition:f};switch(t){case Yr.Bezier:[p]=Jk(x);break;case Yr.SimpleBezier:[p]=RC(x);break;case Yr.Step:[p]=Wp({...x,borderRadius:0});break;case Yr.SmoothStep:[p]=Wp(x);break;default:[p]=tC(x)}return h.jsx("path",{d:p,fill:"none",className:"react-flow__connection-path",style:e})};LC.displayName="ConnectionLine";const A3={};function Yv(e=A3){S.useRef(e),Ue(),S.useEffect(()=>{},[e])}function z3(){Ue(),S.useRef(!1),S.useEffect(()=>{},[])}function HC({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:c,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:x,connectionLineStyle:v,connectionLineComponent:b,connectionLineContainerStyle:m,selectionKeyCode:g,selectionOnDrag:y,selectionMode:w,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:k,deleteKeyCode:C,onlyRenderVisibleElements:I,elementsSelectable:P,defaultViewport:A,translateExtent:F,minZoom:z,maxZoom:R,preventScrolling:O,defaultMarkerColor:_,zoomOnScroll:$,zoomOnPinch:T,panOnScroll:j,panOnScrollSpeed:M,panOnScrollMode:U,zoomOnDoubleClick:H,panOnDrag:V,onPaneClick:W,onPaneMouseEnter:q,onPaneMouseMove:B,onPaneMouseLeave:K,onPaneScroll:L,onPaneContextMenu:Y,paneClickDistance:J,nodeClickDistance:X,onEdgeContextMenu:G,onEdgeMouseEnter:Q,onEdgeMouseMove:te,onEdgeMouseLeave:ge,reconnectRadius:Oe,onReconnect:ce,onReconnectStart:we,onReconnectEnd:de,noDragClassName:Ee,noWheelClassName:ne,noPanClassName:ye,disableKeyboardA11y:ve,nodeExtent:Xe,rfId:qe,viewport:re,onViewportChange:se}){return Yv(e),Yv(t),z3(),R3(n),P3(re),h.jsx(J$,{onPaneClick:W,onPaneMouseEnter:q,onPaneMouseMove:B,onPaneMouseLeave:K,onPaneContextMenu:Y,onPaneScroll:L,paneClickDistance:J,deleteKeyCode:C,selectionKeyCode:g,selectionOnDrag:y,selectionMode:w,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:k,elementsSelectable:P,zoomOnScroll:$,zoomOnPinch:T,zoomOnDoubleClick:H,panOnScroll:j,panOnScrollSpeed:M,panOnScrollMode:U,panOnDrag:V,defaultViewport:A,translateExtent:F,minZoom:z,maxZoom:R,onSelectionContextMenu:d,preventScrolling:O,noDragClassName:Ee,noWheelClassName:ne,noPanClassName:ye,disableKeyboardA11y:ve,onViewportChange:se,isControlledViewport:!!re,children:h.jsxs(N3,{children:[h.jsx(k3,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:i,onReconnect:ce,onReconnectStart:we,onReconnectEnd:de,onlyRenderVisibleElements:I,onEdgeContextMenu:G,onEdgeMouseEnter:Q,onEdgeMouseMove:te,onEdgeMouseLeave:ge,reconnectRadius:Oe,defaultMarkerColor:_,noPanClassName:ye,disableKeyboardA11y:ve,rfId:qe}),h.jsx(j3,{style:v,type:x,component:b,containerStyle:m}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(l3,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:c,onNodeContextMenu:u,nodeClickDistance:X,onlyRenderVisibleElements:I,noPanClassName:ye,noDragClassName:Ee,disableKeyboardA11y:ve,nodeExtent:Xe,rfId:qe}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}HC.displayName="GraphView";const D3=S.memo(HC),Gv=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a}={})=>{const c=new Map,u=new Map,d=new Map,f=new Map,p=r??t??[],x=n??e??[],v=l??[0,0],b=a??sa;rC(d,f,p),qp(x,c,u,{nodeOrigin:v,nodeExtent:b,elevateNodesOnSelect:!1});let m=[0,0,1];if(i&&s&&o){const g=Oa(c,{filter:N=>!!((N.width||N.initialWidth)&&(N.height||N.initialHeight))}),{x:y,y:w,zoom:E}=c0(g,s,o,.5,2,.1);m=[y,w,E]}return{rfId:"1",width:0,height:0,transform:m,nodes:x,nodeLookup:c,parentLookup:u,edges:p,edgeLookup:f,connectionLookup:d,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:sa,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Mi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:v,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...$k},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:cF,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},F3=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a})=>t$((c,u)=>({...Gv({nodes:e,edges:t,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a,defaultNodes:n,defaultEdges:r}),setNodes:d=>{const{nodeLookup:f,parentLookup:p,nodeOrigin:x,elevateNodesOnSelect:v}=u();qp(d,f,p,{nodeOrigin:x,nodeExtent:a,elevateNodesOnSelect:v,checkEquality:!0}),c({nodes:d})},setEdges:d=>{const{connectionLookup:f,edgeLookup:p}=u();rC(f,p,d),c({edges:d})},setDefaultNodesAndEdges:(d,f)=>{if(d){const{setNodes:p}=u();p(d),c({hasDefaultNodes:!0})}if(f){const{setEdges:p}=u();p(f),c({hasDefaultEdges:!0})}},updateNodeInternals:(d,f={triggerFitView:!0})=>{const{triggerNodeChanges:p,nodeLookup:x,parentLookup:v,fitViewOnInit:b,fitViewDone:m,fitViewOnInitOptions:g,domNode:y,nodeOrigin:w,nodeExtent:E,debug:N,fitViewSync:k}=u(),{changes:C,updatedInternals:I}=CF(d,x,v,y,w,E);if(I){if(SF(x,v,{nodeOrigin:w,nodeExtent:E}),f.triggerFitView){let P=m;!m&&b&&(P=k({...g,nodes:g==null?void 0:g.nodes})),c({fitViewDone:P})}else c({});(C==null?void 0:C.length)>0&&(N&&console.log("React Flow: trigger node changes",C),p==null||p(C))}},updateNodePositions:(d,f=!1)=>{const p=[],x=[];for(const[v,b]of d){const m=!!(b!=null&&b.expandParent&&(b!=null&&b.parentId)&&(b!=null&&b.position)),g={id:v,type:"position",position:m?{x:Math.max(0,b.position.x),y:Math.max(0,b.position.y)}:b.position,dragging:f};m&&p.push({id:v,parentId:b.parentId,rect:{...b.internals.positionAbsolute,width:b.measured.width,height:b.measured.height}}),x.push(g)}if(p.length>0){const{nodeLookup:v,parentLookup:b,nodeOrigin:m}=u(),g=h0(p,v,b,m);x.push(...g)}u().triggerNodeChanges(x)},triggerNodeChanges:d=>{const{onNodesChange:f,setNodes:p,nodes:x,hasDefaultNodes:v,debug:b}=u();if(d!=null&&d.length){if(v){const m=S$(d,x);p(m)}b&&console.log("React Flow: trigger node changes",d),f==null||f(d)}},triggerEdgeChanges:d=>{const{onEdgesChange:f,setEdges:p,edges:x,hasDefaultEdges:v,debug:b}=u();if(d!=null&&d.length){if(v){const m=E$(d,x);p(m)}b&&console.log("React Flow: trigger edge changes",d),f==null||f(d)}},addSelectedNodes:d=>{const{multiSelectionActive:f,edgeLookup:p,nodeLookup:x,triggerNodeChanges:v,triggerEdgeChanges:b}=u();if(f){const m=d.map(g=>_s(g,!0));v(m);return}v(Wo(x,new Set([...d]),!0)),b(Wo(p))},addSelectedEdges:d=>{const{multiSelectionActive:f,edgeLookup:p,nodeLookup:x,triggerNodeChanges:v,triggerEdgeChanges:b}=u();if(f){const m=d.map(g=>_s(g,!0));b(m);return}b(Wo(p,new Set([...d]))),v(Wo(x,new Set,!0))},unselectNodesAndEdges:({nodes:d,edges:f}={})=>{const{edges:p,nodes:x,nodeLookup:v,triggerNodeChanges:b,triggerEdgeChanges:m}=u(),g=d||x,y=f||p,w=g.map(N=>{const k=v.get(N.id);return k&&(k.selected=!1),_s(N.id,!1)}),E=y.map(N=>_s(N.id,!1));b(w),m(E)},setMinZoom:d=>{const{panZoom:f,maxZoom:p}=u();f==null||f.setScaleExtent([d,p]),c({minZoom:d})},setMaxZoom:d=>{const{panZoom:f,minZoom:p}=u();f==null||f.setScaleExtent([p,d]),c({maxZoom:d})},setTranslateExtent:d=>{var f;(f=u().panZoom)==null||f.setTranslateExtent(d),c({translateExtent:d})},setPaneClickDistance:d=>{var f;(f=u().panZoom)==null||f.setClickDistance(d)},resetSelectedElements:()=>{const{edges:d,nodes:f,triggerNodeChanges:p,triggerEdgeChanges:x}=u(),v=f.reduce((m,g)=>g.selected?[...m,_s(g.id,!1)]:m,[]),b=d.reduce((m,g)=>g.selected?[...m,_s(g.id,!1)]:m,[]);p(v),x(b)},setNodeExtent:d=>{const{nodes:f,nodeLookup:p,parentLookup:x,nodeOrigin:v,elevateNodesOnSelect:b,nodeExtent:m}=u();d[0][0]===m[0][0]&&d[0][1]===m[0][1]&&d[1][0]===m[1][0]&&d[1][1]===m[1][1]||(qp(f,p,x,{nodeOrigin:v,nodeExtent:d,elevateNodesOnSelect:b,checkEquality:!1}),c({nodeExtent:d}))},panBy:d=>{const{transform:f,width:p,height:x,panZoom:v,translateExtent:b}=u();return NF({delta:d,panZoom:v,transform:f,translateExtent:b,width:p,height:x})},fitView:d=>{const{panZoom:f,width:p,height:x,minZoom:v,maxZoom:b,nodeLookup:m}=u();if(!f)return Promise.resolve(!1);const g=Lp(m,d);return Hp({nodes:g,width:p,height:x,panZoom:f,minZoom:v,maxZoom:b},d)},fitViewSync:d=>{const{panZoom:f,width:p,height:x,minZoom:v,maxZoom:b,nodeLookup:m}=u();if(!f)return!1;const g=Lp(m,d);return Hp({nodes:g,width:p,height:x,panZoom:f,minZoom:v,maxZoom:b},d),g.size>0},cancelConnection:()=>{c({connection:{...$k}})},updateConnection:d=>{c({connection:d})},reset:()=>c({...Gv()})}),Object.is);function $3({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,fitView:i,nodeOrigin:l,nodeExtent:a,children:c}){const[u]=S.useState(()=>F3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a}));return h.jsx(n$,{value:u,children:h.jsx(R$,{children:c})})}function L3({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:i,fitView:l,nodeOrigin:a,nodeExtent:c}){return S.useContext(Ld)?h.jsx(h.Fragment,{children:e}):h.jsx($3,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:i,fitView:l,nodeOrigin:a,nodeExtent:c,children:e})}const H3={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function B3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:i,onNodeClick:l,onEdgeClick:a,onInit:c,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:x,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:m,onNodeMouseEnter:g,onNodeMouseMove:y,onNodeMouseLeave:w,onNodeContextMenu:E,onNodeDoubleClick:N,onNodeDragStart:k,onNodeDrag:C,onNodeDragStop:I,onNodesDelete:P,onEdgesDelete:A,onDelete:F,onSelectionChange:z,onSelectionDragStart:R,onSelectionDrag:O,onSelectionDragStop:_,onSelectionContextMenu:$,onSelectionStart:T,onSelectionEnd:j,onBeforeDelete:M,connectionMode:U,connectionLineType:H=Yr.Bezier,connectionLineStyle:V,connectionLineComponent:W,connectionLineContainerStyle:q,deleteKeyCode:B="Backspace",selectionKeyCode:K="Shift",selectionOnDrag:L=!1,selectionMode:Y=oa.Full,panActivationKeyCode:J="Space",multiSelectionKeyCode:X=Uu()?"Meta":"Control",zoomActivationKeyCode:G=Uu()?"Meta":"Control",snapToGrid:Q,snapGrid:te,onlyRenderVisibleElements:ge=!1,selectNodesOnDrag:Oe,nodesDraggable:ce,nodesConnectable:we,nodesFocusable:de,nodeOrigin:Ee=mC,edgesFocusable:ne,edgesReconnectable:ye,elementsSelectable:ve=!0,defaultViewport:Xe=g$,minZoom:qe=.5,maxZoom:re=2,translateExtent:se=sa,preventScrolling:De=!0,nodeExtent:Re,defaultMarkerColor:Mt="#b1b1b7",zoomOnScroll:Ln=!0,zoomOnPinch:Hn=!0,panOnScroll:gt=!1,panOnScrollSpeed:Ar=.5,panOnScrollMode:or=Js.Free,zoomOnDoubleClick:Bn=!0,panOnDrag:vo=!0,onPaneClick:wo,onPaneMouseEnter:bo,onPaneMouseMove:So,onPaneMouseLeave:Eo,onPaneScroll:ko,onPaneContextMenu:Ma,paneClickDistance:ke=0,nodeClickDistance:ft=0,children:Vt,onReconnect:kt,onReconnectStart:dn,onReconnectEnd:Xt,onEdgeContextMenu:Co,onEdgeDoubleClick:zr,onEdgeMouseEnter:No,onEdgeMouseMove:Vn,onEdgeMouseLeave:Cn,reconnectRadius:Rs=10,onNodesChange:Ro,onEdgesChange:Wi,noDragClassName:ja="nodrag",noWheelClassName:Aa="nowheel",noPanClassName:Ui="nopan",fitView:qi,fitViewOptions:za,connectOnClick:Da,attributionPosition:Ud,proOptions:qd,defaultEdgeOptions:dN,elevateNodesOnSelect:fN,elevateEdgesOnSelect:hN,disableKeyboardA11y:w0=!1,autoPanOnConnect:pN,autoPanOnNodeDrag:gN,autoPanSpeed:mN,connectionRadius:yN,isValidConnection:xN,onError:vN,style:wN,id:b0,nodeDragThreshold:bN,viewport:SN,onViewportChange:EN,width:kN,height:CN,colorMode:NN="light",debug:RN,...TN},PN){const Kd=b0||"1",IN=v$(NN);return h.jsx("div",{"data-testid":"rf__wrapper",...TN,style:{...wN,...H3},ref:PN,className:it(["react-flow",s,IN]),id:b0,children:h.jsxs(L3,{nodes:e,edges:t,width:kN,height:CN,fitView:qi,nodeOrigin:Ee,nodeExtent:Re,children:[h.jsx(D3,{onInit:c,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:g,onNodeMouseMove:y,onNodeMouseLeave:w,onNodeContextMenu:E,onNodeDoubleClick:N,nodeTypes:o,edgeTypes:i,connectionLineType:H,connectionLineStyle:V,connectionLineComponent:W,connectionLineContainerStyle:q,selectionKeyCode:K,selectionOnDrag:L,selectionMode:Y,deleteKeyCode:B,multiSelectionKeyCode:X,panActivationKeyCode:J,zoomActivationKeyCode:G,onlyRenderVisibleElements:ge,defaultViewport:Xe,translateExtent:se,minZoom:qe,maxZoom:re,preventScrolling:De,zoomOnScroll:Ln,zoomOnPinch:Hn,zoomOnDoubleClick:Bn,panOnScroll:gt,panOnScrollSpeed:Ar,panOnScrollMode:or,panOnDrag:vo,onPaneClick:wo,onPaneMouseEnter:bo,onPaneMouseMove:So,onPaneMouseLeave:Eo,onPaneScroll:ko,onPaneContextMenu:Ma,paneClickDistance:ke,nodeClickDistance:ft,onSelectionContextMenu:$,onSelectionStart:T,onSelectionEnd:j,onReconnect:kt,onReconnectStart:dn,onReconnectEnd:Xt,onEdgeContextMenu:Co,onEdgeDoubleClick:zr,onEdgeMouseEnter:No,onEdgeMouseMove:Vn,onEdgeMouseLeave:Cn,reconnectRadius:Rs,defaultMarkerColor:Mt,noDragClassName:ja,noWheelClassName:Aa,noPanClassName:Ui,rfId:Kd,disableKeyboardA11y:w0,nodeExtent:Re,viewport:SN,onViewportChange:EN}),h.jsx(x$,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:x,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:m,nodesDraggable:ce,nodesConnectable:we,nodesFocusable:de,edgesFocusable:ne,edgesReconnectable:ye,elementsSelectable:ve,elevateNodesOnSelect:fN,elevateEdgesOnSelect:hN,minZoom:qe,maxZoom:re,nodeExtent:Re,onNodesChange:Ro,onEdgesChange:Wi,snapToGrid:Q,snapGrid:te,connectionMode:U,translateExtent:se,connectOnClick:Da,defaultEdgeOptions:dN,fitView:qi,fitViewOptions:za,onNodesDelete:P,onEdgesDelete:A,onDelete:F,onNodeDragStart:k,onNodeDrag:C,onNodeDragStop:I,onSelectionDrag:O,onSelectionDragStart:R,onSelectionDragStop:_,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:Ui,nodeOrigin:Ee,rfId:Kd,autoPanOnConnect:pN,autoPanOnNodeDrag:gN,autoPanSpeed:mN,onError:vN,connectionRadius:yN,isValidConnection:xN,selectNodesOnDrag:Oe,nodeDragThreshold:bN,onBeforeDelete:M,paneClickDistance:ke,debug:RN}),h.jsx(p$,{onSelectionChange:z}),Vt,h.jsx(c$,{proOptions:qd,position:Ud}),h.jsx(l$,{rfId:Kd,disableKeyboardA11y:w0})]})})}var V3=xC(B3);function W3({dimensions:e,lineWidth:t,variant:n,className:r}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:it(["react-flow__background-pattern",n,r])})}function U3({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:it(["react-flow__background-pattern","dots",t])})}var Er;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Er||(Er={}));const q3={[Er.Dots]:1,[Er.Lines]:1,[Er.Cross]:6},K3=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function BC({id:e,variant:t=Er.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:i,bgColor:l,style:a,className:c,patternClassName:u}){const d=S.useRef(null),{transform:f,patternId:p}=Ie(K3,nt),x=r||q3[t],v=t===Er.Dots,b=t===Er.Cross,m=Array.isArray(n)?n:[n,n],g=[m[0]*f[2]||1,m[1]*f[2]||1],y=x*f[2],w=Array.isArray(o)?o:[o,o],E=b?[y,y]:g,N=[w[0]*f[2]||1+E[0]/2,w[1]*f[2]||1+E[1]/2],k=`${p}${e||""}`;return h.jsxs("svg",{className:it(["react-flow__background",c]),style:{...a,...Hd,"--xy-background-color-props":l,"--xy-background-pattern-color-props":i},ref:d,"data-testid":"rf__background",children:[h.jsx("pattern",{id:k,x:f[0]%g[0],y:f[1]%g[1],width:g[0],height:g[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:v?h.jsx(U3,{radius:y/2,className:u}):h.jsx(W3,{dimensions:E,lineWidth:s,variant:t,className:u})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}BC.displayName="Background";const Y3=S.memo(BC);function G3(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Q3(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function X3(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.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 Z3(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 J3(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 Cc({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:it(["react-flow__controls-button",t]),...n,children:e})}const eL=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function VC({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:d="bottom-left",orientation:f="vertical","aria-label":p="React Flow controls"}){const x=Ue(),{isInteractive:v,minZoomReached:b,maxZoomReached:m}=Ie(eL,nt),{zoomIn:g,zoomOut:y,fitView:w}=g0(),E=()=>{g(),o==null||o()},N=()=>{y(),i==null||i()},k=()=>{w(s),l==null||l()},C=()=>{x.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),a==null||a(!v)},I=f==="horizontal"?"horizontal":"vertical";return h.jsxs(p0,{className:it(["react-flow__controls",I,c]),position:d,style:e,"data-testid":"rf__controls","aria-label":p,children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(Cc,{onClick:E,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:m,children:h.jsx(G3,{})}),h.jsx(Cc,{onClick:N,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:b,children:h.jsx(Q3,{})})]}),n&&h.jsx(Cc,{className:"react-flow__controls-fitview",onClick:k,title:"fit view","aria-label":"fit view",children:h.jsx(X3,{})}),r&&h.jsx(Cc,{className:"react-flow__controls-interactive",onClick:C,title:"toggle interactivity","aria-label":"toggle interactivity",children:v?h.jsx(J3,{}):h.jsx(Z3,{})}),u]})}VC.displayName="Controls";const tL=S.memo(VC);function nL({id:e,x:t,y:n,width:r,height:s,style:o,color:i,strokeColor:l,strokeWidth:a,className:c,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){const{background:x,backgroundColor:v}=o||{},b=i||x||v;return h.jsx("rect",{className:it(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:u,ry:u,width:r,height:s,style:{fill:b,stroke:l,strokeWidth:a},shapeRendering:d,onClick:p?m=>p(m,e):void 0})}const rL=S.memo(nL),sL=e=>e.nodes.map(t=>t.id),Gf=e=>e instanceof Function?e:()=>e;function oL({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=rL,onClick:i}){const l=Ie(sL,nt),a=Gf(t),c=Gf(e),u=Gf(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:l.map(f=>h.jsx(lL,{id:f,nodeColorFunc:a,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:i,shapeRendering:d},f))})}function iL({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:i,NodeComponent:l,onClick:a}){const{node:c,x:u,y:d,width:f,height:p}=Ie(x=>{const v=x.nodeLookup.get(e),{x:b,y:m}=v.internals.positionAbsolute,{width:g,height:y}=jr(v);return{node:v,x:b,y:m,width:g,height:y}},nt);return!c||c.hidden||!Yk(c)?null:h.jsx(l,{x:u,y:d,width:f,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 lL=S.memo(iL);var aL=S.memo(oL);const cL=200,uL=150,dL=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?qk(Oa(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},fL="react-flow__minimap-desc";function WC({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:i,nodeComponent:l,bgColor:a,maskColor:c,maskStrokeColor:u,maskStrokeWidth:d,position:f="bottom-right",onClick:p,onNodeClick:x,pannable:v=!1,zoomable:b=!1,ariaLabel:m="React Flow mini map",inversePan:g,zoomStep:y=10,offsetScale:w=5}){const E=Ue(),N=S.useRef(null),{boundingRect:k,viewBB:C,rfId:I,panZoom:P,translateExtent:A,flowWidth:F,flowHeight:z}=Ie(dL,nt),R=(e==null?void 0:e.width)??cL,O=(e==null?void 0:e.height)??uL,_=k.width/R,$=k.height/O,T=Math.max(_,$),j=T*R,M=T*O,U=w*T,H=k.x-(j-k.width)/2-U,V=k.y-(M-k.height)/2-U,W=j+U*2,q=M+U*2,B=`${fL}-${I}`,K=S.useRef(0),L=S.useRef();K.current=T,S.useEffect(()=>{if(N.current&&P)return L.current=jF({domNode:N.current,panZoom:P,getTransform:()=>E.getState().transform,getViewScale:()=>K.current}),()=>{var X;(X=L.current)==null||X.destroy()}},[P]),S.useEffect(()=>{var X;(X=L.current)==null||X.update({translateExtent:A,width:F,height:z,inversePan:g,pannable:v,zoomStep:y,zoomable:b})},[v,b,g,y,A,F,z]);const Y=p?X=>{var te;const[G,Q]=((te=L.current)==null?void 0:te.pointer(X))||[0,0];p(X,{x:G,y:Q})}:void 0,J=x?S.useCallback((X,G)=>{const Q=E.getState().nodeLookup.get(G);x(X,Q)},[]):void 0;return h.jsx(p0,{position:f,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 d=="number"?d*T: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=="string"?i:void 0},className:it(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:R,height:O,viewBox:`${H} ${V} ${W} ${q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":B,ref:N,onClick:Y,children:[m&&h.jsx("title",{id:B,children:m}),h.jsx(aL,{onClick:J,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:i,nodeComponent:l}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${H-U},${V-U}h${W+U*2}v${q+U*2}h${-W-U*2}z
|
|
62
|
+
M${C.x},${C.y}h${C.width}v${C.height}h${-C.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}WC.displayName="MiniMap";S.memo(WC);function hL({nodeId:e,position:t,variant:n=Il.Handle,className:r,style:s={},children:o,color:i,minWidth:l=10,minHeight:a=10,maxWidth:c=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,shouldResize:f,onResizeStart:p,onResize:x,onResizeEnd:v}){const b=SC(),m=typeof e=="string"?e:b,g=Ue(),y=S.useRef(null),w=n===Il.Line?"right":"bottom-right",E=t??w,N=S.useRef(null);S.useEffect(()=>{if(!(!y.current||!m))return N.current||(N.current=GF({domNode:y.current,nodeId:m,getStoreItems:()=>{const{nodeLookup:P,transform:A,snapGrid:F,snapToGrid:z,nodeOrigin:R,domNode:O}=g.getState();return{nodeLookup:P,transform:A,snapGrid:F,snapToGrid:z,nodeOrigin:R,paneDomNode:O}},onChange:(P,A)=>{const{triggerNodeChanges:F,nodeLookup:z,parentLookup:R,nodeOrigin:O}=g.getState(),_=[],$={x:P.x,y:P.y},T=z.get(m);if(T&&T.expandParent&&T.parentId){const j=T.origin??O,M=P.width??T.measured.width,U=P.height??T.measured.height,H={id:T.id,parentId:T.parentId,rect:{width:M,height:U,...Gk({x:P.x??T.position.x,y:P.y??T.position.y},{width:M,height:U},T.parentId,z,j)}},V=h0([H],z,R,O);_.push(...V),$.x=P.x?Math.max(j[0]*M,P.x):void 0,$.y=P.y?Math.max(j[1]*U,P.y):void 0}if($.x!==void 0&&$.y!==void 0){const j={id:m,type:"position",position:{...$}};_.push(j)}if(P.width!==void 0&&P.height!==void 0){const j={id:m,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:P.width,height:P.height}};_.push(j)}for(const j of A){const M={...j,type:"position"};_.push(M)}F(_)},onEnd:()=>{const P={id:m,type:"dimensions",resizing:!1};g.getState().triggerNodeChanges([P])}})),N.current.update({controlPosition:E,boundaries:{minWidth:l,minHeight:a,maxWidth:c,maxHeight:u},keepAspectRatio:d,onResizeStart:p,onResize:x,onResizeEnd:v,shouldResize:f}),()=>{var P;(P=N.current)==null||P.destroy()}},[E,l,a,c,u,d,p,x,v,f]);const k=E.split("-"),C=n===Il.Line?"borderColor":"backgroundColor",I=i?{...s,[C]:i}:s;return h.jsx("div",{className:it(["react-flow__resize-control","nodrag",...k,n,r]),ref:y,style:I,children:o})}S.memo(hL);const pL=new Set,Qv=[];function gL(e){return e.startsWith("signal:child:")}function mL(e){const t=fo(),n=(()=>{const r=new Set(e),s=e.size+ek,o=[...e];for(;o.length>0&&r.size<s;){const i=o.shift();if(i===void 0)continue;const l=t.getQueryData(["run",i]);if(l!==void 0)for(const a of Zm(l.timeline)){if(r.size>=s)break;r.has(a)||(r.add(a),o.push(a))}}return[...r].sort()})();return ag({queries:n.map(r=>({queryKey:["run",r],queryFn:()=>$e.run(r)})),combine:nk})}function yL({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?sm:om(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 h.jsxs("div",{title:o?fp.child:fp[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:[h.jsx("span",{className:`absolute inset-y-0 left-0 w-[3px] ${l.rail} ${n?"animate-pulse":""}`}),h.jsx(rr,{type:"target",position:ue.Left,className:"!border-0 !bg-zinc-600"}),h.jsxs("div",{className:"py-2.5 pl-3.5 pr-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:`grid h-5 w-5 shrink-0 place-items-center rounded ${l.badge}`,children:h.jsx(i,{width:12,height:12})}),h.jsx("span",{className:"truncate text-[13px] font-medium text-zinc-100",children:e.name}),h.jsx("span",{className:`ml-auto grid h-4 w-4 shrink-0 place-items-center rounded-full ${l.pill} ${n?"animate-pulse":""}`,children:t?h.jsx(xs,{width:9,height:9}):n?h.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}):h.jsx(nm,{width:9,height:9})})]}),h.jsxs("div",{className:"mono mt-1.5 flex items-center gap-1.5 text-[10px] text-zinc-500",children:[r?h.jsxs("span",{className:"flex items-center gap-1",children:[!s&&h.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:h.jsx("span",{className:"inline-block text-[9px] transition-transform",style:{transform:e.childExpanded?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),h.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 ↗"})]}):h.jsx("span",{className:"rounded border border-line px-1 text-zinc-400",children:e.kind}),e.attempts>1&&h.jsxs("span",{className:"flex items-center gap-0.5 text-amber-300",children:[h.jsx(rm,{width:9,height:9}),e.attempts]}),e.workerGroup&&h.jsxs("span",{className:"truncate",children:["@",e.workerGroup]}),h.jsxs("span",{className:"tnum ml-auto text-zinc-400",children:["#",e.seq,e.duration&&h.jsxs("span",{className:"text-zinc-600",children:[" · ",e.duration]})]})]}),e.subs&&h.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&&h.jsxs("span",{className:"text-emerald-300",children:[e.subs.ok," ok"]}),e.subs.failed>0&&h.jsxs("span",{className:"text-red-300",children:[e.subs.failed," failed"]}),e.subs.skipped>0&&h.jsxs("span",{className:"text-amber-300",children:[e.subs.skipped," skipped"]})]})]}),h.jsx(rr,{type:"source",position:ue.Right,className:"!border-0 !bg-zinc-600"})]})}function xL({data:e}){const{fan:t}=e,n=Qm(t,e.runFinished),r=Xm(t,e.runFinished),s=r==="failed",o=r==="pending"||r==="running",i=s?"bg-red-400":o?"bg-live":"bg-emerald-400",l=a=>`${a/Math.max(n.total,1)*100}%`;return h.jsxs("div",{title:`parallel fan ${t.group}`,className:`relative w-[208px] overflow-hidden rounded-xl border bg-panel/95 shadow-lg backdrop-blur ${s?"border-red-500/40":"border-indigo-500/40"}`,children:[h.jsx("span",{className:`absolute inset-y-0 left-0 w-[3px] ${i} ${o?"animate-pulse":""}`}),h.jsx(rr,{type:"target",position:ue.Left,className:"!border-0 !bg-zinc-600"}),h.jsxs("div",{className:"py-2.5 pl-3.5 pr-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"grid h-5 w-5 shrink-0 place-items-center rounded bg-indigo-500/15 text-[11px] text-indigo-300",children:"⑃"}),h.jsx("span",{className:"truncate text-[13px] font-medium text-zinc-100",children:t.label}),h.jsx("span",{className:"mono tnum ml-auto shrink-0 text-[11px] text-zinc-400",children:JE(n)})]}),h.jsx("div",{className:"mt-2 flex h-1.5 overflow-hidden rounded-full bg-zinc-800",children:Mu.map(a=>h.jsx("span",{className:a.className,style:{width:l(n[a.key])}},a.key))}),h.jsxs("div",{className:"mono tnum mt-1.5 flex flex-wrap items-center gap-2 text-[10px]",children:[Mu.map(a=>n[a.key]>0?h.jsxs("span",{className:a.text,children:[n[a.key]," ",a.label,a.key==="skipped"&&t.failFast?" (failFast)":""]},a.key):null),h.jsxs("span",{className:"ml-auto text-zinc-500",children:["#",t.firstSeq,"–",t.lastSeq]})]})]}),h.jsx(rr,{type:"source",position:ue.Right,className:"!border-0 !bg-zinc-600"})]})}function vL({data:e}){const t=e.status==="running"||e.status==="awaiting";return h.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:[h.jsx(rr,{type:"target",position:ue.Left,className:"!border-0 !bg-zinc-600"}),h.jsx("span",{className:`dot ${t?"pulse":""}`}),h.jsx("span",{className:"mono text-[11px] uppercase tracking-wider",children:e.label}),h.jsx(rr,{type:"source",position:ue.Right,className:"!border-0 !bg-zinc-600"})]})}const wL={step:yL,fan:xL,terminal:vL};function bL(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}}const SL=S.memo(function({run:t,timeline:n,fans:r=Qv,endStatus:s,selectedKey:o,onSelect:i,onOpenRun:l,fmtDuration:a,expanded:c,onToggleChild:u}){const d=c??pL,f=S.useMemo(()=>{const m=new Set(d);for(const g of Zm(n))m.add(g);return m},[d,n]),p=mL(f),{nodes:x,edges:v}=S.useMemo(()=>{const w=[],E=[],N=t.status==="running"||t.status==="suspended",k=(O,_,$)=>({id:`${O}->${_}`,source:O,target:_,style:{stroke:$?"#f87171":"var(--line)",strokeWidth:1.5}}),C=(O,_)=>({id:`${O}=>${_}`,source:O,target:_,style:{stroke:"#818cf8",strokeWidth:1.5,strokeDasharray:"4 3"}});function I(O,_,$,T,j,M){const U=`${j}s${O.seq}`,H=Vi(O),V=H!==void 0?p[H]:void 0,W=V!==void 0&&V.timeline.length===1&&V.timeline[0]?{step:V.timeline[0],run:V.run}:void 0,q=W!==void 0,B=!q&&H!==void 0&&d.has(H),K=W?W.step:O,L=W?W.run:M,Y=W?W.step.name:H!==void 0?(V==null?void 0:V.run.workflow)??tk(H,O.runId):XE(O),J=K.status==="failed";w.push({id:U,type:"step",draggable:!1,position:{x:_,y:$},data:{seq:K.seq,name:Y,kind:K.kind,status:K.status,workerGroup:K.workerGroup,attempts:K.attempts,duration:a(K.startedAt,K.finishedAt),subs:bL(K),selected:o===`${K.runId}#${K.seq}`,childRunId:H,onOpenRun:l,childExpanded:B,onToggleChild:u,collapsed:q,depth:T,step:K,laneRun:L}});const X=B?V:void 0;if(X){const G=P(X.timeline,X.fans??Qv,T+1,_+248,$+150,`${H}:`,X.run);for(const te of G.firstIds)E.push(C(U,te));const Q=gL(O.name)&&G.connectors.length>0?G.connectors:[{id:U,failed:J}];return{id:U,exits:Q,nextX:Math.max(_+248,G.nextX),bottomY:Math.max($,G.bottomY)}}return{id:U,exits:[{id:U,failed:J}],nextX:_+248,bottomY:$}}function P(O,_,$,T,j,M,U){let H=T;const V=[];let W=[],q=j;for(const B of ZE(O,_)){if(B.kind==="summary"){const G=`${M}fan:${B.fan.group}`;w.push({id:G,type:"fan",draggable:!1,position:{x:H,y:j},data:{fan:B.fan,runFinished:Op(U.status),depth:$}}),V.length===0&&V.push(G);for(const Q of W)E.push(k(Q.id,G,Q.failed));W=[{id:G,failed:Xm(B.fan,Op(U.status))==="failed"}],H+=248;continue}const K=B.kind==="single"?[B.step]:B.steps,L=V.length===0,Y=[];let J=j,X=H;for(const G of K){const Q=I(G,H,J,$,M,U);L&&V.push(Q.id);for(const te of W)E.push(k(te.id,Q.id,te.failed));Y.push(...Q.exits),X=Math.max(X,Q.nextX),J=Q.bottomY+96}W=Y,H=X,q=Math.max(q,J-96)}return{firstIds:V,connectors:W,nextX:H,bottomY:q}}const A=248;w.push({id:"start",type:"terminal",position:{x:0,y:0},draggable:!1,data:{status:"running",label:t.workflow}});const F=P(n,r,0,A,0,"",t);for(const O of F.firstIds)E.push({id:`start->${O}`,source:"start",target:O});const z=s??MI(t,n);w.push({id:"end",type:"terminal",position:{x:Math.max(F.nextX,A),y:0},draggable:!1,data:{status:z,label:z}});const R=F.connectors.length>0?F.connectors:[{id:"start",failed:!1}];for(const O of R)E.push({id:`${O.id}->end`,source:O.id,target:"end",animated:N,style:{stroke:N?"var(--live)":"var(--line)",strokeWidth:N?2:1.5}});return{nodes:w,edges:E}},[t,n,r,s,o,l,a,d,u,p]),b=S.useCallback((m,g)=>{if(g.type!=="step")return;const y=g.data;y.step&&y.laneRun&&i(y.step,y.laneRun)},[i]);return h.jsxs(V3,{nodes:x,edges:v,nodeTypes:wL,onNodeClick:b,fitView:!0,fitViewOptions:{padding:.3,maxZoom:1.1},proOptions:{hideAttribution:!0},nodesConnectable:!1,nodesDraggable:!1,panOnScroll:!0,minZoom:.3,onlyRenderVisibleElements:!0,children:[h.jsx(Y3,{variant:Er.Dots,gap:22,size:1,color:"#1c1c22"}),h.jsx(tL,{showInteractive:!1,position:"bottom-right"})]})});function EL(e){return!e.hasMore||e.loading||e.requestedAtCount===e.loadedCount?!1:e.lastRenderedIndex>=e.loadedCount-1-e.loadAhead}function Uc(e){const t=e.lastIndexOf("~retry~");return t===-1?void 0:e.slice(0,t)}function Qf(e){const n=(Uc(e)??e).match(/^(.*)\.child\.\d+$/);return(n==null?void 0:n[1])||void 0}function kL(e,t){var n;return((n=e[t])==null?void 0:n.id)??t}function CL(e){return JSON.stringify([e.status,e.tag,e.attrs,e.namespace,e.origin])}const UC=S.createContext(void 0);function xo(e){const t=S.useContext(UC);if(!e&&t===void 0)throw new Error(Qt(27));return t}const NL=S.forwardRef(function(t,n){const{render:r,className:s,style:o,forceRender:i=!1,...l}=t,a=xo(),c=a.useState("open"),u=a.useState("nested"),d=a.useState("mounted"),f=a.useState("transitionStatus");return Bt("div",t,{state:{open:c,transitionStatus:f},ref:[a.context.backdropRef,n],stateAttributesMapping:mm,props:[{role:"presentation",hidden:!d,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:i||!u})}),RL=S.forwardRef(function(t,n){const{render:r,className:s,style:o,disabled:i=!1,nativeButton:l=!0,...a}=t,c=xo(),u=c.useState("open"),{getButtonProps:d,buttonRef:f}=qm({disabled:i,native:l}),p={disabled:i};function x(v){u&&c.setOpen(!1,_e(AS,v.nativeEvent))}return Bt("button",t,{state:p,ref:[n,f],props:[{onClick:x},a,d]})}),TL=S.forwardRef(function(t,n){const{render:r,className:s,style:o,id:i,...l}=t,a=xo(),c=Bi(i);return a.useSyncedValueWithCleanup("descriptionElementId",c),Bt("p",t,{ref:n,props:[{id:c},l]})}),qC=S.createContext(void 0);function PL(){const e=S.useContext(qC);if(e===void 0)throw new Error(Qt(26));return e}const IL="--nested-dialogs",OL="data-nested-dialog-open",_L={...gm,...pm,nestedDialogOpen(e){return e?{[OL]:""}:null}},ML=S.forwardRef(function(t,n){const{render:r,className:s,style:o,finalFocus:i,initialFocus:l,...a}=t,c=xo(),u=c.useState("descriptionElementId"),d=c.useState("disablePointerDismissal"),f=c.useState("floatingRootContext"),p=c.useState("popupProps"),x=c.useState("modal"),v=c.useState("mounted"),b=c.useState("nested"),m=c.useState("nestedOpenDialogCount"),g=c.useState("open"),y=c.useState("openMethod"),w=c.useState("titleElementId"),E=c.useState("transitionStatus"),N=c.useState("role"),k=f.useState("floatingId");PL(),Na({open:g,ref:c.context.popupRef,onComplete(){var z,R;g&&((R=(z=c.context).onOpenChangeComplete)==null||R.call(z,!0))}});const C=l===void 0?IE(c.context.popupRef):l,I=m>0,P=c.useStateSetter("popupElement"),F=Bt("div",t,{state:{open:g,nested:b,transitionStatus:E,nestedDialogOpen:I},props:[p,{id:k,"aria-labelledby":w,"aria-describedby":u,role:N,..._m,hidden:!v,onKeyDown(z){Gm.has(z.key)&&z.stopPropagation()},style:{[IL]:m}},a],ref:[n,c.context.popupRef,P],stateAttributesMapping:_L});return h.jsx(hE,{context:f,openInteractionType:y,disabled:!v,closeOnFocusOut:!d,initialFocus:C,returnFocus:i,modal:x!==!1,restoreFocus:"popup",children:F})}),jL=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,o=xo(),i=o.useState("mounted"),l=o.useState("modal"),a=o.useState("open");return i||r?h.jsx(qC.Provider,{value:r,children:h.jsxs(cE,{ref:n,...s,children:[i&&l===!0&&h.jsx(KE,{ref:o.context.internalBackdropRef,inert:Km(!a)}),t.children]})}):null});function AL({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,d]=S.useState(0),f=a===0,p=Im(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:o==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(x){if(!e.context.outsidePressEnabledRef.current||"button"in x&&x.button!==0)return!1;if("touches"in x){if(x.type==="touchend"){if(x.changedTouches.length!==1||x.touches.length!==0)return!1}else if(x.touches.length!==1)return!1}const v=Ot(x);if(f&&!s){if(o){const b=e.context.internalBackdropRef.current,m=e.context.backdropRef.current;return b||m?b===v||m===v||me(v,i)&&!(v!=null&&v.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:f});return GE(r&&o===!0,i),e.useContextCallback("onNestedDialogOpen",(x,v)=>{c(x),d(v)}),fe(()=>(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]),Fm(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:a,nestedOpenDrawerCount:u}),null}const zL={...Bm,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 DL extends Rd{constructor(n,r,s){const o=new $m,i=FL(n,o,r,s);super(i,$L(o),zL);xe(this,"setOpen",(n,r)=>{var s,o;r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(o=(s=this.context).onOpenChange)==null||o.call(s,n,r),!r.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(n,r),this.update(Am(this.state,n,r.trigger)))})}}function FL(e,t,n,r=!1){return{...Lm(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function $L(e){return{popupRef:S.createRef(),backdropRef:S.createRef(),internalBackdropRef:S.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function LL(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:d,defaultTriggerId:f=null}=t,p=e==="drawer",x=a,v=l,b="dialog",m=xo(!0),g=m!=null,y={modal:x,disablePointerDismissal:v,nested:g,role:b},w=Mm((P,A)=>new DL({open:s,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},P,A),!0);w.useControlledProp("openProp",r),w.useControlledProp("triggerIdProp",d),w.useSyncedValues(y),w.useContextCallback("onOpenChange",o),w.useContextCallback("onOpenChangeComplete",i);const E=w.useState("open"),N=w.useState("mounted"),k=w.useState("payload");ME(w,E),zm(w);const{forceUnmount:C}=Dm(E,w);S.useImperativeHandle(c,()=>({unmount:C,close:()=>w.setOpen(!1,_e(ym))}),[C,w]);const I=E||N;return h.jsxs(UC.Provider,{value:w,children:[u&&h.jsx(jm,{handle:u,store:w}),I&&h.jsx(AL,{store:w,parentContext:m==null?void 0:m.context,isDrawer:p}),typeof n=="function"?n({payload:k}):n]})}const HL=fd(function(t){return LL("dialog",t)}),BL=S.forwardRef(function(t,n){const{render:r,className:s,style:o,id:i,...l}=t,a=xo(),c=Bi(i);return a.useSyncedValueWithCleanup("titleElementId",c),Bt("h2",t,{ref:n,props:[{id:c},l]})}),VL=HL,WL=RL;function UL({open:e,onOpenChange:t,title:n,subtitle:r,footer:s,children:o,className:i}){return h.jsx(VL,{open:e,onOpenChange:t,children:h.jsxs(jL,{children:[h.jsx(NL,{className:"fixed inset-0 z-40 bg-black/60 backdrop-blur-sm"}),h.jsxs(ML,{className:ot("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:[h.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx(BL,{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:n}),r&&h.jsx(TL,{className:"mono mt-1 text-[11px] text-zinc-500",children:r})]}),h.jsx(WL,{render:h.jsx(je,{variant:"quiet",size:"icon","aria-label":"Close",children:h.jsx(xs,{})})})]}),h.jsx("div",{className:"px-5 py-4",children:o}),s&&h.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:s})]})]})})}function qL({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!==void 0?e:o,a=S.useCallback(c=>{s||i(c)},[]);return[l,a]}const KC=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function KL(){return S.useContext(KC)}function YC(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:s}=e,o=pe(s),[,i]=S.useState(!1),l=En(GL).current,a=En(YL).current,c=S.useRef(0),u=S.useRef(!0),d=S.useRef(null),f=S.useRef(null),p=pe(()=>{u.current||(u.current=!0,i(E=>!E))}),x=pe((E,N)=>{a.set(E,N),p()}),v=pe(E=>{a.delete(E),p()}),b=pe(E=>{const N=new Map;return n.current.length=0,r&&(r.current.length=0),E.forEach(k=>{var C,I;N.set(k.element,{...k.registration.metadata??{},index:k.index}),n.current[k.index]=k.element,r&&(r.current[k.index]=k.registration.label!==void 0?k.registration.label:((I=(C=k.registration.textRef)==null?void 0:C.current)==null?void 0:I.textContent)??k.element.textContent)}),c.current=n.current.length,N});function m(E){var C;if((C=f.current)==null||C.disconnect(),f.current=null,typeof MutationObserver!="function"||E.length<2)return;const N=new MutationObserver(I=>{if(!ZL(I))return;let P=null;for(const A of E)if(A.isConnected){if(P&&GC(P,A)>0){N.disconnect(),p();return}P=A}});f.current=N;const k=new Set;for(let I=1;I<E.length;I+=1){const P=XL(E[I-1],E[I]);P&&k.add(P)}k.forEach(I=>N.observe(I,{childList:!0}))}const g=pe(()=>{const[E,N]=QL(a),k=b(E),C=d.current,I=!C||C.length!==E.length||E.some((P,A)=>{const F=C[A];return P.index!==F.index||P.element!==F.element||P.registration.index!==F.registration.index||P.registration.metadata!==F.registration.metadata});m(N),d.current=E,u.current=!1,I&&(l.forEach(P=>P(k)),o(k))});fe(()=>(!u.current&&d.current&&b(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,b]),fe(()=>{u.current&&g()}),fe(()=>()=>{var E;(E=f.current)==null||E.disconnect(),u.current=!0},[]);const y=pe(E=>(l.add(E),()=>{l.delete(E)})),w=S.useMemo(()=>({register:x,unregister:v,subscribeMapChange:y,nextIndexRef:c}),[x,v,y,c]);return h.jsx(KC.Provider,{value:w,children:t})}function YL(){return new Map}function GL(){return new Set}function QL(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)=>GC(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 XL(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function ZL(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 GC(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const QC=S.createContext(void 0);function y0(){const e=S.useContext(QC);if(e===void 0)throw new Error(Qt(64));return e}const JL="data-activation-direction",Vd={tabActivationDirection:e=>({[JL]:e})},e4=S.forwardRef(function(t,n){const{className:r,defaultValue:s=0,onValueChange:o,orientation:i="horizontal",render:l,value:a,style:c,...u}=t,d=t.defaultValue!==void 0,f=S.useRef([]),[p,x]=S.useState(()=>new Map),[v,b]=qL({controlled:a,default:s,name:"Tabs",state:"value"}),m=a!==void 0,[g,y]=S.useState(()=>new Map),w=S.useRef(void 0),E=S.useCallback(L=>Gp(g,L),[g]),[N,k]=S.useState(()=>({previousValue:v,tabActivationDirection:"none"})),{previousValue:C,tabActivationDirection:I}=N;let P=I,A=!1;C!==v&&(P=Xv(C,v,i,g),A=C!=null&&v!=null&&E(v)==null);const F=A?C:v,z=C!==F||I!==P;fe(()=>{z&&k({previousValue:F,tabActivationDirection:P})},[F,z,P]);const R=pe((L,Y)=>{const J=Xv(v,L,i,g);Y.activationDirection=J,o==null||o(L,Y),!Y.isCanceled&&b(L)}),O=pe((L,Y)=>{o==null||o(L,_e(Y,void 0,void 0,{activationDirection:"none"}))}),_=pe((L,Y)=>(x(J=>{const X=new Map(J);return X.set(L,Y),X}),()=>{x(J=>{if(J.get(L)!==Y)return J;const X=new Map(J);return X.delete(L),X})})),$=S.useCallback(L=>p.get(L),[p]),T=S.useCallback(L=>{for(const Y of g.values())if(L===Y.value)return Y.id},[g]),j=S.useMemo(()=>({getTabElementBySelectedValue:E,getTabIdByPanelValue:T,getTabPanelIdByValue:$,onValueChange:R,orientation:i,registerMountedTabPanel:_,setTabMap:y,tabActivationDirection:P,value:v}),[E,T,$,R,i,_,y,P,v]),M=S.useMemo(()=>{for(const L of g.values())if(L.value===v)return L},[g,v]),U=S.useMemo(()=>{for(const L of g.values())if(!L.disabled)return L.value},[g]),H=S.useRef(!d),V=S.useRef(s),W=S.useRef(d),q=S.useRef(!1);fe(()=>{var G;if(m)return;function L(Q,te){b(Q),k({previousValue:Q,tabActivationDirection:"none"}),O(Q,te),H.current=!1}if(g.size===0){q.current&&v!==null&&!((G=w.current)!=null&&G.isConnected)&&L(null,ox);return}q.current=!0,w.current=g.keys().next().value;const Y=M==null?void 0:M.disabled,J=M==null&&v!==null;if(!Y&&v===V.current&&(W.current=!1),W.current&&Y&&v===V.current)return;const X=H.current;if(Y||J){const Q=U??null;if(v===Q){H.current=!1;return}let te=ox;X?te=ix:Y&&(te=zS),L(Q,te);return}X&&M!=null&&(O(v,ix),H.current=!1)},[U,m,O,M,b,g,v]);const K=Bt("div",t,{state:{orientation:i,tabActivationDirection:P},ref:n,props:u,stateAttributesMapping:Vd});return h.jsx(QC.Provider,{value:j,children:h.jsx(YC,{elementsRef:f,children:K})})});function Gp(e,t){for(const[n,r]of e.entries())if(t===r.value)return n;return null}function Xv(e,t,n,r){if(e==null||t==null)return"none";const[s,o,i]=n==="horizontal"?["left","left","right"]:["top","up","down"],l=Gp(r,e),a=Gp(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 x0="data-composite-item-active";function XC(e={}){const{guess:t,label:n,metadata:r,textRef:s,index:o}=e,{register:i,unregister:l,subscribeMapChange:a,nextIndexRef:c}=KL(),u=S.useRef(-1),[d,f]=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??d,x=S.useRef(null),v=S.useCallback(b=>{const m=x.current;m&&l(m),x.current=b,b&&i(b,{metadata:r??null,index:o??null,label:n,textRef:s})},[o,i,l,r,n,s]);return fe(()=>{if(o==null)return a(b=>{var g;const m=x.current?(g=b.get(x.current))==null?void 0:g.index:null;m!=null&&f(m)})},[o,a]),{ref:v,index:p}}function t4(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Um(),{ref:s,index:o}=XC(e),i=n===o,l=S.useRef(null),a=Ci(s,l);return{compositeProps:{tabIndex:i?0:-1,onFocus(){r(o)},onMouseMove(){const u=l.current;if(!t||!u)return;const d=u.hasAttribute("disabled")||u.ariaDisabled==="true";!i&&!d&&u.focus()}},compositeRef:a,index:o}}const ZC=S.createContext(void 0);function n4(){const e=S.useContext(ZC);if(e===void 0)throw new Error(Qt(65));return e}const r4=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:d,getTabPanelIdByValue:f,onValueChange:p,orientation:x,tabActivationDirection:v}=y0(),{activateOnFocus:b,registerTabResizeObserverElement:m,tabsListElement:g}=n4(),{highlightedIndex:y,onHighlightedIndexChange:w}=Um(),E=Bi(l),N=S.useMemo(()=>({disabled:s,id:E,value:i}),[s,E,i]),{compositeProps:k,compositeRef:C,index:I}=t4({metadata:N}),P=i===d,A=S.useRef(!1),F=S.useRef(null),z=pe(q=>{var B;(B=F.current)==null||B.call(F),F.current=q?m(q):null});fe(()=>{if(A.current){A.current=!1;return}if(!(P&&I>-1&&y!==I))return;const q=g;if(q!=null){const B=hn(Ae(q));if(B&&me(q,B))return}s||w(I)},[P,I,y,w,s,g]);const{getButtonProps:R,buttonRef:O}=qm({disabled:s,native:a,focusableWhenDisabled:!0}),_=f(i),$=S.useRef(!1),T=S.useRef(!1);function j(q){p(i,_e(vd,q.nativeEvent,void 0,{activationDirection:"none"}))}function M(q){P||s||j(q)}function U(q){P||s||b&&(!$.current||T.current)&&j(q)}function H(q){if(P||s)return;$.current=!0,T.current=q.button===0;const B=Ae(q.currentTarget);function K(){$.current=!1,T.current=!1,B.removeEventListener("pointerup",K),B.removeEventListener("pointercancel",K)}B.addEventListener("pointerup",K),B.addEventListener("pointercancel",K)}return Bt("button",t,{state:{disabled:s,active:P,orientation:x,tabActivationDirection:v},ref:[n,O,C,z],props:[k,{role:"tab","aria-controls":_,"aria-selected":P,id:E,onClick:M,onFocus:U,onPointerDown:H,[x0]:P?"":void 0,onKeyDownCapture(){A.current=!0}},u,R],stateAttributesMapping:Vd})}),s4="data-index",o4={...Vd,...pm},i4=S.forwardRef(function(t,n){const{className:r,value:s,render:o,keepMounted:i=!1,style:l,...a}=t,{value:c,getTabIdByPanelValue:u,orientation:d,tabActivationDirection:f,registerMountedTabPanel:p}=y0(),x=Bi(),{ref:v,index:b}=XC(),m=s===c,{mounted:g,transitionStatus:y,setMounted:w}=TE(m),E=!g,N=u(s),k={hidden:E,orientation:d,tabActivationDirection:f,transitionStatus:y},C=S.useRef(null),I=Bt("div",t,{state:k,ref:[n,v,C],props:[{"aria-labelledby":N,hidden:E,id:x,role:"tabpanel",tabIndex:m?0:-1,inert:Km(!m),[s4]:b},a],stateAttributesMapping:o4});return Na({open:m,ref:C,onComplete(){m||w(!1)}}),fe(()=>{if(!(x==null||E&&!i))return p(s,x)},[E,i,s,x,p]),i||g?I:null});function l4(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function a4(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:d,modifierKeys:f=Yl}=e,[p,x]=S.useState(0),v=r!=null,b=S.useRef(null),m=Ci(b,a),g=S.useRef([]),y=S.useRef(!1),w=S.useRef(null),E=i??p,N=pe((A,F=!1)=>{if(w.current=g.current[A]??null,(l??x)(A),F){const z=g.current[A];Bx(b.current,z,o,n)}}),k=pe(A=>{var O;if(A.size===0)return;if(y.current){const _=g.current,$=_.indexOf(w.current);if($===-1){const T=_[E];!T||Rl(_,E,d)?N(c4(_,d)):w.current=T}else $!==E&&N($);return}y.current=!0;const F=Array.from(A.keys()),z=F.find(_=>_==null?void 0:_.hasAttribute(x0))??null,R=z?((O=A.get(z))==null?void 0:O.index)??-1:-1;if(R!==-1)N(R);else if(Rl(F,E,d)){const _=Nl(F,{disabledIndices:d});If(F,_)||N(_)}Bx(b.current,z,o,n)});fe(()=>{if(d==null||i!=null||!y.current)return;const A=g.current;if(Rl(A,E,d)){const F=Nl(A,{disabledIndices:d});If(A,F)||N(F)}},[d,i,E,g,N]);const C=pe((A,F,z)=>s?s(A,F,z,g):z),I=pe(A=>{const F=A.key===Tp||A.key===Pp;if(!Gm.has(A.key)||!c&&F||u4(A,f)||!b.current)return;const R=o==="rtl",O=R?Np:Rp,_=R?Rp:Np,$=n==="vertical"?Cp:O,T=n==="vertical"?kp:_,j=Ot(A.nativeEvent);if(j!=null&&Hx(j)&&!l4(j)){const q=j.selectionStart,B=j.selectionEnd,K=j.value;if(q==null||A.shiftKey||q!==B||A.key!==T&&q<K.length||A.key!==$&&q>0)return}let M=E;const U=V_(g,d),H=W_(g,d);r!=null&&(M=r({disabledIndices:d,elementsRef:g,event:A,highlightedIndex:E,loopFocus:t,maxIndex:H,minIndex:U,onLoop:C,orientation:n,rtl:R}));const V=n!=="vertical"&&A.key===O||n!=="horizontal"&&A.key===Cp,W=n!=="vertical"&&A.key===_||n!=="horizontal"&&A.key===kp;c&&(A.key===Tp?M=U:A.key===Pp&&(M=H)),M===E&&(V||W)&&(t&&M===H&&V?(M=U,s&&(M=s(A,E,M,g))):t&&M===U&&W?(M=H,s&&(M=s(A,E,M,g))):M=Nl(g.current,{startingIndex:M,decrement:W,disabledIndices:d})),M!==E&&!If(g.current,M)&&(u&&A.stopPropagation(),(v||F||V||W)&&A.preventDefault(),N(M,!0),queueMicrotask(()=>{var q;(q=g.current[M])==null||q.focus()}))});return{props:{ref:m,onFocus(A){const F=b.current,z=Ot(A.nativeEvent);!F||z==null||!Hx(z)||z.setSelectionRange(0,z.value.length)},onKeyDown:I},highlightedIndex:E,onHighlightedIndexChange:N,elementsRef:g,onMapChange:k,relayKeyboardEvent:I}}function c4(e,t){let n=-1;for(let r=0;r<e.length;r+=1){const s=e[r];if(!(!s||Rl(e,r,t))){if(s.hasAttribute(x0))return r;n===-1&&(n=r)}}return Math.max(n,0)}function u4(e,t){for(const n of Fj)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function d4(e){const{render:t,className:n,style:r,refs:s=Yl,props:o=Yl,state:i=wt,stateAttributesMapping:l,highlightedIndex:a,onHighlightedIndexChange:c,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:x,onMapChange:v,stopEventPropagation:b=!0,rootRef:m,disabledIndices:g,modifierKeys:y,highlightItemOnHover:w=!1,tag:E="div",...N}=e,k=WE(),{props:C,highlightedIndex:I,onHighlightedIndexChange:P,elementsRef:A,onMapChange:F,relayKeyboardEvent:z}=a4({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:a,onHighlightedIndexChange:c,rootRef:m,stopEventPropagation:b,enableHomeAndEndKeys:x,direction:k,disabledIndices:g,modifierKeys:y}),R=Bt(E,e,{state:i,ref:s,props:[C,...o,N],stateAttributesMapping:l}),O=S.useMemo(()=>({highlightedIndex:I,onHighlightedIndexChange:P,highlightItemOnHover:w,relayKeyboardEvent:z}),[I,P,w,z]);return h.jsx(HE.Provider,{value:O,children:h.jsx(YC,{elementsRef:A,onMapChange:_=>{v==null||v(_),F(_)},children:R})})}const f4=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:d}=y0(),[f,p]=S.useState(0),[x,v]=S.useState(null),b=S.useRef(new Set),m=S.useRef(new Set),g=S.useRef(null);fe(()=>{if(typeof ResizeObserver>"u")return;const C=new ResizeObserver(()=>{b.current.forEach(I=>{I()})});return g.current=C,x&&C.observe(x),m.current.forEach(I=>{C.observe(I)}),()=>{C.disconnect(),g.current=null}},[x]);const y=pe(C=>(b.current.add(C),()=>{b.current.delete(C)})),w=pe(C=>{var I;return m.current.add(C),(I=g.current)==null||I.observe(C),()=>{var P;m.current.delete(C),(P=g.current)==null||P.unobserve(C)}}),E={orientation:c,tabActivationDirection:d},N={"aria-orientation":c==="vertical"?"vertical":void 0,role:"tablist"},k=S.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:y,registerTabResizeObserverElement:w,tabsListElement:x}),[r,y,w,x]);return h.jsx(ZC.Provider,{value:k,children:h.jsx(d4,{render:i,className:s,style:l,state:E,refs:[n,v],props:[N,a],stateAttributesMapping:Vd,highlightedIndex:f,enableHomeAndEndKeys:!0,loopFocus:o,orientation:c,onHighlightedIndexChange:p,onMapChange:u,disabledIndices:Yl})})}),h4=e4,JC=S.forwardRef(({className:e,...t},n)=>h.jsx(f4,{ref:n,className:ot("flex items-center gap-0.5 rounded border border-line bg-zinc-900/60 p-0.5",e),...t}));JC.displayName="TabsList";const eN=S.forwardRef(({className:e,...t},n)=>h.jsx(r4,{ref:n,className:ot("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}));eN.displayName="TabsTab";const qc=S.forwardRef(({className:e,...t},n)=>h.jsx(i4,{ref:n,className:ot("focus-visible:outline-none",e),...t}));qc.displayName="TabsPanel";const tN=S.createContext(void 0);function Wd(e){const t=S.useContext(tN);if(t===void 0&&!e)throw new Error(Qt(72));return t}const p4={...Bm,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 g4 extends Rd{constructor(n,r,s){const o=new $m;super(m4(n,o,r,s),y4(o),p4);xe(this,"setOpen",(n,r)=>{q2(this,n,r,{extraState:{openChangeReason:r.reason}})})}cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,_e(ws,n))}}function m4(e,t,n,r=!1){return{...Lm(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function y4(e){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const x4=fd(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:d,defaultTriggerId:f=null,children:p}=t,x=Mm((A,F)=>new g4({open:r,openProp:s,activeTriggerId:f,triggerIdProp:d},A,F));x.useControlledProp("openProp",s),x.useControlledProp("triggerIdProp",d),x.useContextCallback("onOpenChange",a),x.useContextCallback("onOpenChangeComplete",c);const v=x.useState("open"),b=!n&&v,m=x.useState("activeTriggerId"),g=x.useState("mounted"),y=x.useState("payload");x.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:o,disabled:n}),zm(x,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:w,transitionStatus:E}=Dm(b,x),N=x.useState("isInstantPhase"),k=x.useState("instantType"),C=x.useState("lastOpenChangeReason"),I=S.useRef(null);fe(()=>{v&&n&&x.setOpen(!1,_e(zS))},[v,n,x]),fe(()=>{E==="ending"&&C===vd||E!=="ending"&&N?(k!=="delay"&&(I.current=k),x.set("instantType","delay")):I.current!==null&&(x.set("instantType",I.current),I.current=null)},[E,N,C,k,x]),fe(()=>{b&&m==null&&x.set("payload",void 0)},[x,m,b]),S.useImperativeHandle(l,()=>({unmount:w,close:()=>x.setOpen(!1,_e(ym))}),[w,x]);const P=b||g||!n&&i!=="none";return h.jsxs(tN.Provider,{value:x,children:[u&&h.jsx(jm,{handle:u,store:x}),P&&h.jsx(v4,{store:x,disabled:n,trackCursorAxis:i}),typeof p=="function"?p({payload:y}):p]})});function v4({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),s=Im(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),o=IM(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),i=S.useMemo(()=>Sd(o.reference,s.reference),[o.reference,s.reference]);return Fm(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:s.floating??wt}),null}const nN=S.createContext(void 0);function w4(){return S.useContext(nN)}const b4=600,rN="data-base-ui-tooltip-trigger";function Zv(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const s=n[r];if(Ce(s))return s}}const t=e.target;return Ce(t)?t:null}function S4(e){let t=e;for(;t;){const n=t.closest(`[${rN}]`);if(n)return n;const r=t.getRootNode();t="host"in r&&Ce(r.host)?r.host:null}return null}const E4=ES(function(t,n){const{render:r,className:s,style:o,handle:i,payload:l,disabled:a,delay:c,closeOnClick:u=!0,closeDelay:d,id:f,...p}=t,x=Wd(!0),b=AE(i)??x;if(!b)throw new Error(Qt(82));const m=Bi(f),g=b.useState("isTriggerActive",m),y=b.useState("isOpenedByTrigger",m),w=b.useState("floatingRootContext"),E=S.useRef(null),N=d??0,{registerTrigger:k,isMountedByThisTrigger:C}=_E(m,E,b,{payload:l,closeOnClick:u,closeDelay:N}),I=w4(),{activeIdRef:P,delayRef:A,isInstantPhase:F,hasProvider:z}=k_(w,{open:y}),R=Wm(w);b.useSyncedValue("isInstantPhase",F);const O=b.useState("disabled"),_=a??O,$=Ft(_),T=b.useState("trackCursorAxis"),j=b.useState("disableHoverablePopup"),M=S.useRef(!1),U=Tr(),H=S.useRef(void 0);function V(){return z&&P.current!=null?0:c??I??b4}function W(Q){const te=E.current;if(!te||!Q)return!1;const ge=S4(Q);return ge!==null&&ge!==te&&me(te,ge)}function q(Q){const te=W(Q);return M.current=te,te&&(R.openChangeTimeout.clear(),R.restTimeout.clear(),R.restTimeoutPending=!1,U.clear()),te}const B=FE(w,{enabled:!_,mouseOnly:!0,move:!1,handleClose:!j&&T!=="both"?$E():null,restMs:V,delay(){return d==null&&z?{close:io(A.current,"close")}:{close:N}},triggerElementRef:E,isActiveTrigger:g,isClosing:()=>b.select("transitionStatus")==="ending",shouldOpen(){return!M.current}}),K=Q2(w,{enabled:!_}).reference,L=Q=>{const te=M.current,ge=Zv(Q),Oe=q(ge),ce=E.current,we=ce&&ge&&me(ce,ge);if(Oe&&b.select("open")&&b.select("lastOpenChangeReason")===vt){b.setOpen(!1,_e(vt,Q));return}if(te&&!Oe&&we&&!$.current&&!b.select("open")&&ce&&ps(H.current)){const de=()=>{!M.current&&!$.current&&!b.select("open")&&b.setOpen(!0,_e(vt,Q,ce))},Ee=V();Ee===0?(U.clear(),de()):U.start(Ee,de)}},Y=b.useState("triggerProps",C);return Bt("button",t,{state:{open:y},ref:[n,k,E],props:[B,K,C||T!=="none"?Y:void 0,{onMouseOver(Q){L(Q.nativeEvent)},onFocus(Q){W(Zv(Q.nativeEvent))&&Q.preventBaseUIHandler()},onMouseLeave(){M.current=!1,U.clear(),H.current=void 0},onPointerEnter(Q){H.current=Q.pointerType},onPointerDown(Q){H.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:m,[vp]:_?"":void 0,[rN]:_?void 0:""},p],stateAttributesMapping:_S})}),sN=S.createContext(void 0);function k4(){const e=S.useContext(sN);if(e===void 0)throw new Error(Qt(70));return e}const C4=S.forwardRef(function(t,n){const{children:r,container:s,className:o,render:i,style:l,...a}=t,{node:c,subtree:u}=aE({container:s,ref:n,componentProps:t,elementProps:a});return!u&&!c?null:h.jsxs(S.Fragment,{children:[u,c&&on.createPortal(r,c)]})}),N4=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Wd().useState("mounted")||r?h.jsx(sN.Provider,{value:r,children:h.jsx(C4,{ref:n,...s})}):null}),oN=S.createContext(void 0);function R4(){const e=S.useContext(oN);if(e===void 0)throw new Error(Qt(71));return e}const T4=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:d="clipping-ancestors",collisionPadding:f=5,arrowPadding:p=5,sticky:x=!1,disableAnchorTracking:v=!1,collisionAvoidance:b=oE,style:m,...g}=t,y=Wd(),w=k4(),E=y.useState("open"),N=y.useState("mounted"),k=y.useState("trackCursorAxis"),C=y.useState("disableHoverablePopup"),I=y.useState("floatingRootContext"),P=y.useState("instantType"),A=y.useState("transitionStatus"),F=y.useState("adaptiveOrigin"),z=qE({anchor:o,positionMethod:i,floatingRootContext:I,mounted:N,side:l,sideOffset:c,align:a,alignOffset:u,collisionBoundary:d,collisionPadding:f,sticky:x,arrowPadding:p,disableAnchorTracking:v,keepMounted:w,collisionAvoidance:b,adaptiveOrigin:F}),R=S.useMemo(()=>({open:E,side:z.side,align:z.align,anchorHidden:z.anchorHidden,instant:k!=="none"?"tracking-cursor":P}),[E,z.side,z.align,z.anchorHidden,k,P]),O=YE(t,R,{styles:z.positionerStyles,transitionStatus:A,props:g,refs:[n,y.useStateSetter("positionerElement")],hidden:!N,inert:!E||k==="both"||C});return h.jsx(oN.Provider,{value:z,children:O})}),P4=S.forwardRef(function(t,n){const{render:r,className:s,style:o,...i}=t,l=Wd(),{side:a,align:c}=R4(),u=l.useState("open"),d=l.useState("instantType"),f=l.useState("transitionStatus"),p=l.useState("popupProps"),x=l.useState("floatingRootContext"),v=l.useState("disabled"),b=l.useState("closeDelay");Na({open:u,ref:l.context.popupRef,onComplete(){var w,E;u&&((E=(w=l.context).onOpenChangeComplete)==null||E.call(w,!0))}}),DE(x,{enabled:!v,closeDelay:b});const m=l.useStateSetter("popupElement");return Bt("div",t,{state:{open:u,side:a,align:c,instant:d,transitionStatus:f},ref:[n,l.context.popupRef,m],props:[_m,p,Ym(f),i],stateAttributesMapping:mm})}),I4=function(t){const{delay:n,closeDelay:r,timeout:s=400}=t,o=S.useMemo(()=>({open:n,close:r}),[n,r]);return h.jsx(nN.Provider,{value:n,children:h.jsx(E_,{delay:o,timeoutMs:s,children:t.children})})};function O4({children:e,...t}){return h.jsx(I4,{delay:150,closeDelay:80,...t,children:e})}const _4=x4,M4=E4,j4="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 Ku({label:e,suppressed:t,side:n="bottom",align:r="end",children:s}){return h.jsxs(_4,{disabled:t??!1,children:[h.jsx(M4,{render:s}),h.jsx(N4,{children:h.jsx(T4,{side:n,align:r,sideOffset:4,collisionPadding:8,children:h.jsx(P4,{className:ot(j4),children:e})})})]})}function iN({className:e}){return h.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:[h.jsx("title",{children:"durable"}),h.jsx("path",{d:"M12 2.5 21.5 12 12 21.5 2.5 12z",opacity:.35}),h.jsx("circle",{cx:"6.4",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),h.jsx("circle",{cx:"12",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),h.jsx("circle",{cx:"17.6",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),h.jsx("path",{d:"M8.1 12h2.2M13.7 12h2.2"})]})}const A4=["pending","running","suspended","completed","failed","cancelling","cancelled","dead"];function z4(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 D4(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 v0({status:e}){const t=e==="running"||e==="awaiting"||e==="cancelling";return h.jsx("span",{className:`dot s-${e} ${t?"pulse":""}`,"aria-hidden":!0})}function lN({status:e}){return h.jsxs(xt,{variant:"status",className:`s-${e} text-[11px]`,children:[h.jsx(v0,{status:e}),e]})}function F4({counts:e,filter:t,onFilter:n}){const r=Object.values(e).reduce((a,c)=>a+c,0),s=(a,c,u)=>h.jsxs(je,{variant:"ghost",size:"chip","aria-pressed":t===a,onClick:()=>n(a),className:ot("rounded-md",t===a&&"border-zinc-600 bg-zinc-900 text-zinc-100 hover:text-zinc-100"),children:[a!=="all"&&h.jsx(v0,{status:a}),h.jsx("span",{className:"uppercase tracking-wide",children:c}),h.jsx("span",{className:"mono tnum text-zinc-600",children:u})]},a),{data:o}=nn({queryKey:["topology"],queryFn:()=>$e.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 h.jsxs("header",{className:"z-10 flex items-center gap-4 border-b border-line px-5 py-3",children:[h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("div",{className:"grid h-7 w-7 place-items-center rounded-md border border-brand/30 bg-brand/10",children:h.jsx(iN,{className:"h-4 w-4 text-brand"})}),h.jsxs("div",{className:"leading-none",children:[h.jsx("div",{className:"text-sm font-semibold tracking-tight",children:"durable"}),h.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})]})]}),h.jsxs("div",{className:"ml-2 flex flex-wrap items-center gap-1",children:[s("all","all",r),A4.map(a=>s(a,a,e[a]??0))]}),h.jsx(H4,{}),!i&&h.jsx(TA,{}),h.jsxs("div",{className:"flex items-center gap-2 text-xs text-zinc-500",children:[h.jsx("span",{className:"dot s-completed pulse","aria-hidden":!0}),"live"]})]})}function $4(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 aN({status:e}){const t=e==null?void 0:e.concurrency;if(!e||!t)return h.jsx("span",{className:"mono text-[9px] text-zinc-600",children:"no status"});const n=t.limit>0&&e.inFlight>=t.limit*.8;return h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsxs("div",{className:"mono flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[10px] text-zinc-500",children:[h.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"}),h.jsxs("span",{className:n?"text-amber-300":"text-zinc-400",children:["in-flight"," ",h.jsxs("span",{className:"tnum",children:[e.inFlight,"/",t.limit]})]}),typeof e.rssPct=="number"&&h.jsxs("span",{className:e.rssPct>=85?"text-rose-300":"",children:["ram ",h.jsxs("span",{className:"tnum",children:[Math.round(e.rssPct),"%"]})]}),typeof e.cpuPct=="number"&&h.jsxs("span",{children:["cpu ",h.jsxs("span",{className:"tnum",children:[Math.round(e.cpuPct),"%"]})]}),typeof e.throughputPerMin=="number"&&h.jsxs("span",{children:[h.jsx("span",{className:"tnum",children:Math.round(e.throughputPerMin)}),"/min"]}),typeof e.p95Ms=="number"&&h.jsxs("span",{children:["p95 ",h.jsxs("span",{className:"tnum",children:[Math.round(e.p95Ms),"ms"]})]})]}),e.lastAdjust&&h.jsxs("div",{className:"mono text-[10px] text-zinc-500",children:[e.lastAdjust.reason," ",h.jsxs("span",{className:"tnum text-zinc-400",children:[e.lastAdjust.from,"→",e.lastAdjust.to]})," ",$4(e.lastAdjust.at)]})]})}function L4({workers:e}){return h.jsx("div",{className:"flex flex-col divide-y divide-line-soft",children:e.map(t=>h.jsxs("div",{className:"flex flex-col gap-1 px-2.5 py-2",children:[h.jsx("span",{className:"mono truncate text-[10px] text-zinc-400",children:t.instanceId}),h.jsx(aN,{status:t.status})]},t.instanceId))})}function H4(){const{data:e}=nn({queryKey:["workers"],queryFn:()=>$e.workers(),refetchInterval:1e4}),[t,n]=S.useState("workers");if(!e||e.length===0)return null;const r=HI(e),s={workers:"pods",partitions:"parts",alerts:"alerts"};return h.jsxs(h4,{value:t,onValueChange:o=>n(o),className:"ml-auto flex flex-nowrap items-center gap-1.5",children:[h.jsx(JC,{children:["workers","partitions","alerts"].map(o=>h.jsxs(eN,{value:o,children:[s[o],o==="alerts"&&r.starved.length>0&&h.jsx("span",{className:"tnum ml-1 rounded bg-rose-500/80 px-1 text-[9px] text-white",children:r.starved.length})]},o))}),h.jsxs("div",{className:"flex w-[300px] flex-nowrap items-center justify-end gap-1.5",children:[h.jsx(qc,{value:"workers",className:"flex flex-nowrap items-center gap-1.5",children:h.jsx(B4,{workers:$I(e)})}),h.jsx(qc,{value:"partitions",className:"flex flex-nowrap items-center gap-1.5",children:h.jsx(V4,{groups:e})}),h.jsx(qc,{value:"alerts",className:"flex flex-nowrap items-center gap-1.5",children:h.jsx(W4,{summary:r})})]})]})}const Jv="__overflow__";function ew(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 tw({w:e}){return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-2.5 py-2",children:h.jsx(aN,{status:e.status})}),h.jsxs("div",{className:"max-h-48 overflow-auto border-t border-line-soft px-2.5 py-1.5",children:[h.jsxs("div",{className:"mono mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:[e.handlers.length," handlers"]}),e.handlers.map(t=>h.jsx("div",{className:"mono truncate text-[10px] text-zinc-400",children:t},t))]})]})}function B4({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===Jv;return h.jsxs(h.Fragment,{children:[i.map(c=>{const u=t===c.instanceId,d=ew(c);return h.jsxs(Pi,{open:u,onOpenChange:f=>n(f?c.instanceId:void 0),children:[h.jsx(Ku,{suppressed:u,label:`${c.instanceId}
|
|
63
|
+
${c.handlers.length} handlers · ${c.partition}${d?` · ${d} in-flight`:""}`,children:h.jsx(Ii,{render:h.jsxs(je,{variant:"chip",size:"xs",className:ot("mono max-w-[120px] gap-1",u&&"border-zinc-500 bg-zinc-800 text-zinc-200"),children:[h.jsx("span",{className:`dot ${c.status?"s-completed":""}`,"aria-hidden":!0}),h.jsx("span",{className:"truncate",children:c.instanceId}),c.partition!=="default"&&h.jsxs("span",{className:"shrink-0 text-zinc-500",children:["@",c.partition]}),h.jsxs("span",{className:"tnum shrink-0 text-zinc-500",children:[c.handlers.length,"h",d?` · ${d}`:""]})]})})}),h.jsxs(ao,{children:[h.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:[h.jsx("span",{className:"truncate text-zinc-300",children:c.instanceId}),h.jsxs("span",{className:"shrink-0",children:[c.runtime??"node"," · ",c.partition]})]}),h.jsx(tw,{w:c})]})]},c.instanceId)}),l.length>0&&h.jsxs(Pi,{open:a,onOpenChange:c=>{n(c?Jv:void 0),s(void 0)},children:[h.jsx(Ii,{render:h.jsxs(je,{variant:"chip",size:"xs",className:ot("mono shrink-0",a&&"border-zinc-500 bg-zinc-800 text-zinc-200"),children:["+",l.length]})}),h.jsxs(ao,{children:[h.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"]}),h.jsx("div",{className:"max-h-80 divide-y divide-line-soft overflow-auto",children:l.map(c=>{const u=ew(c),d=r===c.instanceId;return h.jsxs("div",{children:[h.jsxs("button",{type:"button",onClick:()=>s(d?void 0:c.instanceId),className:ot("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",d?"bg-zinc-800/40 text-zinc-200":"text-zinc-300"),children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[h.jsx("span",{className:`dot ${c.status?"s-completed":""}`,"aria-hidden":!0}),h.jsx("span",{className:"truncate",children:c.instanceId})]}),h.jsxs("span",{className:"tnum shrink-0 text-zinc-500",children:[c.partition!=="default"?`@${c.partition} · `:"",c.handlers.length,"h",u?` · ${u}`:""]})]}),d&&h.jsx("div",{className:"border-t border-line-soft bg-zinc-900/40",children:h.jsx(tw,{w:c})})]},c.instanceId)})})]})]})]})}function V4({groups:e}){const[t,n]=S.useState(void 0),r=zI(e);function s(o){const i=new Map;for(const l of e)if(wu(l.group)===o)for(const a of l.liveWorkers)i.has(a.instanceId)||i.set(a.instanceId,a);return[...i.values()]}return h.jsx(h.Fragment,{children:r.map(o=>{const i=o.starvedCount>0,l=t===o.partition;return h.jsxs(Pi,{open:l&&o.workerCount>0,onOpenChange:a=>n(a?o.partition:void 0),children:[h.jsx(Ku,{suppressed:l,label:`${o.partition}
|
|
64
|
+
${o.workerCount} workers · ${o.handlerCount} handlers · ${o.totalDepth} queued${i?` · ${o.starvedCount} starved`:""}`,children:h.jsx(Ii,{render:h.jsxs(je,{variant:"chip",size:"xs",disabled:o.workerCount===0,className:ot("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:[h.jsx("span",{className:`dot ${i?"s-failed":o.workerCount>0?"s-completed":""}`,"aria-hidden":!0}),o.partition,h.jsxs("span",{className:"tnum text-zinc-500",children:[o.workerCount,"w ",o.handlerCount,"h",o.totalDepth>0?` ${o.totalDepth}q`:"",i?` ${o.starvedCount}!`:""]})]})})}),h.jsxs(ao,{children:[h.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:[h.jsx("span",{className:"text-zinc-300",children:o.partition}),h.jsxs("span",{className:"tnum",children:[o.workerCount," worker(s) · ",o.totalDepth," queued"]})]}),h.jsx(L4,{workers:s(o.partition)})]})]},o.partition)})})}function W4({summary:e}){const t=(n,r)=>`${n} ${n===1?r:`${r}s`}`;return h.jsxs(h.Fragment,{children:[h.jsx(Ku,{label:`Route-by-handler: each @Workflow & @Step is served as its own queue.
|
|
65
|
+
${e.queueCount} queues across ${t(e.workerCount,"worker")}.`,children:h.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?h.jsx("span",{className:"text-good",children:"all draining"}):h.jsxs("span",{className:"text-rose-300",children:[e.starved.length," starved"]})]})}),e.starved.map(n=>h.jsx(Ku,{label:`${n.group}
|
|
66
|
+
${n.depth} queued, no worker consuming`,children:h.jsxs(xt,{variant:"danger",className:"mono gap-1 border-rose-500/50 bg-rose-500/15 py-0.5",children:[h.jsx("span",{className:"dot s-failed","aria-hidden":!0}),h.jsx("span",{className:"max-w-[180px] truncate",children:n.group}),h.jsxs("span",{className:"tnum shrink-0",children:[n.depth,"q · 0w"]})]})},n.group))]})}function U4(){return h.jsx("ul",{className:"divide-y divide-line-soft","aria-hidden":!0,children:[0,1,2,3,4,5].map(e=>h.jsxs("li",{className:"flex flex-col gap-2 px-4 py-3",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx("div",{className:"h-3.5 w-32 animate-pulse rounded bg-zinc-800"}),h.jsx("div",{className:"h-3 w-16 animate-pulse rounded bg-zinc-800/70"})]}),h.jsx("div",{className:"h-2.5 w-48 animate-pulse rounded bg-zinc-800/50"})]},e))})}const q4=S.memo(function({run:t,siblings:n,health:r,selected:s,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a}){const c=tS(t,{runs:n,health:r}),u=t.namespace&&t.namespace!=="default"?t.namespace:void 0,d=Li(t.origin);return h.jsxs("button",{type:"button",onClick:()=>o(t.id),className:`flex w-full flex-col gap-1 px-4 py-3 text-left transition-colors ${s?"bg-zinc-900":"hover:bg-zinc-900/50"}`,children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx("span",{className:"truncate text-sm font-medium text-zinc-200",children:t.workflow}),u&&h.jsx(xt,{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 ${u}`,onClick:f=>{f.stopPropagation(),l(u)},children:u}),d&&h.jsx(xt,{variant:"origin",className:"mono shrink-0 cursor-pointer px-1 text-[9px] hover:border-teal-400/60 hover:text-teal-200",title:`Declared by ${d} — click to show only this library's runs`,onClick:f=>{f.stopPropagation(),a({kind:"origin",origin:d})},children:Ea(d)}),t.id.startsWith("dlq:")&&h.jsx(xt,{variant:"danger",className:"mono shrink-0 px-1 text-[9px] uppercase tracking-wider",children:"dlq"})]}),h.jsx(lN,{status:c.status})]}),c.detail&&h.jsx("div",{className:`mono truncate text-[11px] s-${c.status}`,children:c.detail}),h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx("span",{className:"mono truncate text-[11px] text-zinc-600",children:t.id}),h.jsx("span",{className:"shrink-0 text-[11px] text-zinc-600",children:z4(t.updatedAt)})]}),t.tags&&t.tags.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1",children:t.tags.map(f=>h.jsxs("span",{onClick:p=>{p.stopPropagation(),i(f)},className:ot(SS({variant:"outline"}),"mono cursor-pointer hover:border-zinc-500 hover:text-zinc-200"),children:["#",f]},f))})]})}),K4=86,Y4=12;function G4({runs:e,siblings:t,health:n,loading:r,selected:s,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a,total:c,onLoadMore:u,loadingMore:d,emptyNotice:f}){var w;const p=S.useRef(null),x=S.useCallback(E=>kL(e,E),[e]),v=Jg({count:e.length,getScrollElement:()=>p.current,estimateSize:()=>K4,getItemKey:x,measureElement:E=>E.getBoundingClientRect().height,overscan:8}),b=v.getVirtualItems(),m=c>e.length,g=b.length>0?((w=b[b.length-1])==null?void 0:w.index)??-1:-1,y=S.useRef(-1);return S.useEffect(()=>{EL({hasMore:m,loading:!!d,lastRenderedIndex:g,loadedCount:e.length,requestedAtCount:y.current,loadAhead:Y4})&&(y.current=e.length,u())},[m,d,g,e.length,u]),r&&e.length===0?h.jsx(U4,{}):e.length===0?h.jsxs("div",{className:"flex flex-col items-start gap-2 p-6 text-sm text-zinc-600",children:[h.jsx("span",{children:f.message}),f.unclassified!==void 0&&h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"text-[11px] text-zinc-500",children:[f.unclassified," run",f.unclassified===1?"":"s"," here"," ",f.unclassified===1?"has":"have"," no recorded origin, so no package filter can match ",f.unclassified===1?"it":"them","."]}),h.jsx(je,{variant:"chip",size:"xs",className:"mono rounded",title:tm,onClick:()=>a({kind:"unknown"}),children:"show unclassified"})]})]}):h.jsxs("div",{ref:p,className:"min-h-0 flex-1 overflow-auto",children:[h.jsx("ul",{className:"relative",style:{height:v.getTotalSize()},children:b.map(E=>{const N=e[E.index];return N?h.jsx("li",{"data-index":E.index,ref:v.measureElement,className:"absolute left-0 top-0 w-full border-b border-line-soft",style:{transform:`translateY(${E.start}px)`},children:h.jsx(q4,{run:N,siblings:t,health:n,selected:s===N.id,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a})},N.id):null})}),h.jsxs("div",{className:"flex items-center gap-2 border-t border-line px-4 py-2","aria-live":"polite","aria-busy":m&&d,children:[h.jsxs("span",{className:"mono text-[10px] text-zinc-600",children:[e.length," of ",c]}),m&&h.jsx("span",{className:"mono ml-auto text-[10px] text-zinc-600",children:d?"loading…":"scroll for more"})]})]})}function Q4({compensations:e,selKey:t,onSelect:n}){return h.jsxs("div",{className:"shrink-0 border-t border-amber-500/20 bg-black/20 px-7 py-3",children:[h.jsx("div",{className:"mono mb-2 text-[10px] uppercase tracking-[0.18em] text-amber-400/80",children:"compensation · unwind order"}),h.jsx("ul",{className:"flex flex-col gap-1",children:e.map(r=>{const s=`${r.runId}#${r.seq}`;return h.jsx("li",{children:h.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:[h.jsx(v0,{status:r.status}),h.jsx("span",{className:"truncate text-amber-100",children:kI(r.name)}),h.jsx("span",{className:"ml-auto shrink-0 text-[10px] uppercase tracking-wider text-amber-400/70",children:r.status})]})},s)})})]})}const X4=[],Z4=S.memo(function({id:t,onOpenRun:n}){const r=fo(),{data:s}=nn({queryKey:["run",t],queryFn:async()=>DI(r.getQueryData(["run",t]),await $e.run(t)),refetchInterval:ne=>{var ve;const ye=(ve=ne.state.data)==null?void 0:ve.run.status;return ye==="running"||ye==="suspended"?1500:!1}}),{data:o=[]}=nn({queryKey:["workers"],queryFn:()=>$e.workers(),refetchInterval:5e3}),i=s==null?void 0:s.run,l=uN(i!==void 0&&cN([i])),a=(s==null?void 0:s.run.status)==="dead"?`dlq:${t}`:void 0,{data:c}=nn({queryKey:["run",a],queryFn:()=>$e.run(a),enabled:!!a,retry:!1}),u=()=>{r.invalidateQueries({queryKey:["run",t]}),r.invalidateQueries({queryKey:["runs"]})},d=s==null?void 0:s.run.status,f=d==="running"||d==="suspended";S.useEffect(()=>{if(!f)return;const ne=BI(()=>r.invalidateQueries({queryKey:["run",t]}),1500),ye=$e.streamRun(t,ve=>{if(ve.type==="step.progress"&&ve.event&&ve.seq!=null){const Xe=ve.seq,qe=ve.event;r.setQueryData(["run",t],re=>FI(re,Xe,qe));return}ne.call()});return()=>{ne.cancel(),ye()}},[t,f,r]);const p=Ms({mutationFn:()=>$e.retry(t),onSuccess:u}),x=Ms({mutationFn:ne=>$e.cancel(t,ne!==void 0?{compensate:ne}:{}),onSuccess:u}),v=Ms({mutationFn:()=>$e.continue(t),onSuccess:u}),b=Ms({mutationFn:()=>$e.redispatch(t),onSuccess:u}),m=Ms({mutationFn:ne=>$e.retryWithInput(t,ne),onSuccess:ne=>{r.invalidateQueries({queryKey:["runs"]}),n(ne.runId)}}),[g,y]=S.useState(!1),[w,E]=S.useState(""),[N,k]=S.useState(),C=()=>{E(JSON.stringify((s==null?void 0:s.run.input)??{},null,2)),k(void 0),y(!0)},I=()=>{let ne;try{ne=JSON.parse(w)}catch(ye){k(ye instanceof Error?ye.message:"Invalid JSON");return}y(!1),m.mutate(ne)},[P,A]=S.useState(),[F,z]=S.useState(!1),[R,O]=S.useState(new Set),[_,$]=S.useState(240);function T(ne){ne.preventDefault(),ne.currentTarget.setPointerCapture(ne.pointerId);const ye=Xe=>$(qe=>Math.max(120,Math.min(720,qe-Xe.movementY))),ve=()=>{window.removeEventListener("pointermove",ye),window.removeEventListener("pointerup",ve)};window.addEventListener("pointermove",ye),window.addEventListener("pointerup",ve)}const j=S.useCallback(ne=>{O(ye=>{const ve=new Set(ye);return ve.has(ne)?ve.delete(ne):ve.add(ne),ve})},[]),M=S.useCallback((ne,ye)=>{A({step:ne,run:ye})},[]),U=S.useMemo(()=>CI((s==null?void 0:s.timeline)??[]),[s==null?void 0:s.timeline]),H=(s==null?void 0:s.fans)??X4;if(!s)return h.jsx("div",{className:"p-8 text-sm text-zinc-600",children:"Loading run…"});const{run:V}=s,{body:W,compensations:q}=U,B=H.reduce((ne,ye)=>ne+ye.size,W.length),K=W.length>0||H.length>0,L=cA(s.children??[],s.childCount),Y=NI(q),J=V.id.startsWith("dlq:"),X=J?{id:V.id.slice(4),title:"Dead-letter handler",subtitle:`started because run ${V.id.slice(4)} was dead-lettered`,cta:"open dead run →"}:c?{id:`dlq:${V.id}`,title:"Dead-lettered",subtitle:"this run exceeded recovery and was routed to a DLQ handler",cta:"open DLQ handler →"}:void 0,G=q.length>0?(()=>{const ne=Y.failed>0?` ${Y.failed} undo${Y.failed===1?"":"s"} failed after retries — check ${Y.failed===1?"it":"them"} below.`:"";return Y.pending>0?{title:"Compensating",subtitle:`undoing completed steps in reverse (${Y.done} of ${Y.total} done).${ne}`}:V.status==="cancelled"?{title:"Cancelled with compensation",subtitle:`completed steps were undone before cancelling.${ne}`}:{title:"Saga compensated",subtitle:`the run failed and its ${Y.total} completed step${Y.total===1?"":"s"} were undone in reverse.${ne}`}})():void 0,Q=V.status==="failed"||V.status==="suspended",te=V.status==="running"||V.status==="suspended",ge=V.status==="suspended"||V.status==="running",Oe=W.some(ne=>ne.status==="pending"&&ne.kind==="signal"&&ne.name.startsWith("breakpoint")),ce=P?`${P.step.runId}#${P.step.seq}`:void 0,we=tS(V,{runs:l,health:o,timeline:W}),de=V.namespace&&V.namespace!=="default"?V.namespace:void 0,Ee=Li(V.origin);return h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-line px-7 py-5",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:V.workflow}),Qf(V.id)!==void 0&&h.jsx(je,{variant:"alt",size:"xs",onClick:()=>n(Qf(V.id)),className:"mono uppercase tracking-wider",title:`Open the parent run (${Qf(V.id)}) — the macro view this child belongs to`,children:"↑ parent"}),Uc(V.id)!==void 0&&h.jsx(je,{variant:"chip",size:"xs",onClick:()=>n(Uc(V.id)),className:"mono uppercase tracking-wider text-zinc-300",title:`This is a retry-with-input of ${Uc(V.id)} — open the original run`,children:"↩ original"}),J&&h.jsx(xt,{variant:"danger",className:"mono py-0.5 uppercase tracking-wider",children:"dlq"}),h.jsx(lN,{status:we.status}),we.detail&&h.jsx("span",{className:`mono text-[11px] s-${we.status}`,children:we.detail}),de&&h.jsx(xt,{variant:"tenant",className:"mono py-0.5",title:"Tenant / worker-pool partition this run belongs to",children:de}),Ee?h.jsx(xt,{variant:"origin",className:"mono py-0.5",title:`Declared by ${Ee}`,children:Ea(Ee)}):h.jsxs(xt,{variant:"origin-unknown",className:"mono py-0.5",title:tm,children:["origin ",dd]}),q.length>0&&h.jsx(xt,{variant:"warn",className:ot("mono py-0.5 uppercase tracking-wider",Y.pending>0&&"pulse"),title:Y.pending>0?`compensating: ${Y.done} of ${Y.total} undone`:`${Y.total} step${Y.total===1?"":"s"} compensated`,children:Y.pending>0?"compensating":"compensated"}),h.jsxs(xt,{className:"mono bg-transparent py-0.5 text-zinc-500",children:["v",V.workflowVersion]}),h.jsxs("span",{className:"mono tnum text-[11px] text-zinc-600",children:[B," ",B===1?"step":"steps"]})]}),h.jsx("div",{className:"mono mt-1 truncate text-[11px] text-zinc-600",children:V.id}),V.tags&&V.tags.length>0&&h.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:V.tags.map(ne=>h.jsxs(xt,{className:"mono",children:["#",ne]},ne))}),V.searchAttributes&&Object.keys(V.searchAttributes).length>0&&h.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:Object.entries(V.searchAttributes).map(([ne,ye])=>h.jsxs(xt,{variant:"attr",className:"mono",title:"search attribute",children:[ne,"=",String(ye)]},ne))}),L.shown.length>0?h.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1",children:[h.jsx("span",{className:"text-[10px] text-zinc-600",children:"children:"}),L.shown.map(ne=>h.jsx(je,{variant:"chip",size:"xs",onClick:()=>n(ne),className:"mono px-1.5 py-0",children:ne},ne)),L.more>0&&h.jsxs("span",{className:"mono text-[10px] text-zinc-500",children:["+",L.more," more"]})]}):null]}),h.jsxs("div",{className:"flex shrink-0 gap-2",children:[h.jsx(je,{onClick:()=>z(!0),className:"mono px-2.5 normal-case tracking-normal text-zinc-400",title:"Run input / output",children:"{ }"}),Oe&&h.jsxs(je,{variant:"warn",disabled:v.isPending,onClick:()=>v.mutate(),children:[h.jsx(KI,{width:12,height:12}),"Continue"]}),h.jsxs(je,{variant:"brand",disabled:!Q||p.isPending,onClick:()=>p.mutate(),children:[h.jsx(Cf,{width:12,height:12}),"Retry"]}),ge&&h.jsxs(je,{variant:"info",disabled:b.isPending,onClick:()=>b.mutate(),title:"Re-dispatch stuck `pending` remote steps — recovery for a lost step dispatch (crashed worker or dropped job)",children:[h.jsx(rm,{width:12,height:12}),"Re-dispatch"]}),(V.status==="dead"||V.status==="failed")&&h.jsxs(je,{variant:"alt",disabled:m.isPending,onClick:C,title:"Edit the input and re-run as a fresh linked run",children:[h.jsx(Cf,{width:12,height:12}),"Fix & replay"]}),te&&h.jsxs(je,{variant:"warn",disabled:x.isPending,onClick:()=>x.mutate(!0),title:"Cancel and run saga compensations (undo completed steps in reverse)",className:"bg-transparent",children:[h.jsx(Cf,{width:12,height:12}),"Cancel + Undo"]}),h.jsxs(je,{className:"border-zinc-700",disabled:!te||x.isPending,onClick:()=>x.mutate(!1),children:[h.jsx(xs,{width:12,height:12}),"Cancel"]})]})]}),X&&h.jsxs("div",{className:"flex items-center gap-3 border-b border-rose-500/30 bg-rose-500/10 px-7 py-3",children:[h.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:"⚠"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"text-[13px] font-medium text-rose-200",children:X.title}),h.jsx("div",{className:"mono truncate text-[11px] text-rose-300/70",children:X.subtitle})]}),h.jsx(je,{variant:"danger",onClick:()=>n(X.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:X.cta})]}),G&&h.jsxs("div",{className:"flex items-center gap-3 border-b border-amber-500/30 bg-amber-500/10 px-7 py-3",children:[h.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:"↺"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"text-[13px] font-medium text-amber-200",children:G.title}),h.jsx("div",{className:"mono truncate text-[11px] text-amber-300/70",children:G.subtitle})]})]}),h.jsxs("div",{className:"relative grid min-h-0 flex-1",style:{gridTemplateRows:K?`1fr ${_}px`:"1fr"},children:[h.jsxs("div",{className:"relative min-h-0",children:[K?h.jsx(SL,{run:V,timeline:W,fans:H,endStatus:we.status,selectedKey:ce,onSelect:M,onOpenRun:n,fmtDuration:D4,expanded:R,onToggleChild:j}):h.jsx("div",{className:"grid h-full place-items-center text-sm text-zinc-600",children:"No steps recorded yet."}),(V.status==="failed"||V.status==="cancelled")&&V.error&&h.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:V.error.message})]}),K&&h.jsxs("div",{className:"relative min-h-0 overflow-hidden border-t border-line bg-black/20",children:[h.jsx("div",{onPointerDown:T,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"}),h.jsx(vA,{run:V,timeline:W,fans:H,selectedKey:ce,onSelect:M,onOpenRun:n,expanded:R,onToggleChild:j})]}),P&&h.jsx(CA,{step:P.step,run:P.run,onClose:()=>A(void 0),onOpenRun:n}),F&&h.jsx(NA,{run:V,onClose:()=>z(!1)})]}),q.length>0&&h.jsx(Q4,{compensations:q,selKey:ce,onSelect:ne=>A({step:ne,run:V})}),h.jsxs(UL,{open:g,onOpenChange:y,title:"Fix & replay",subtitle:`re-runs ${V.id} as a fresh linked run`,footer:h.jsxs(h.Fragment,{children:[h.jsx(je,{onClick:()=>y(!1),children:"Cancel"}),h.jsx(je,{variant:"alt",disabled:m.isPending,onClick:I,children:"Replay"})]}),children:[h.jsx("label",{className:"mono mb-1.5 block text-[10px] uppercase tracking-[0.18em] text-zinc-500",htmlFor:"fix-replay-input",children:"input"}),h.jsx("textarea",{id:"fix-replay-input",value:w,spellCheck:!1,onChange:ne=>{E(ne.target.value),k(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"}),N&&h.jsx("p",{className:"mono mt-2 rounded border border-bad/25 bg-bad/10 px-2 py-1 text-[11px] text-bad",children:N})]})]})});function nw(){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 cN(e){return e.some(t=>{var n;return t.status==="suspended"&&((n=t.tags)==null?void 0:n.some(r=>r.startsWith("singleton:")))})}function uN(e){const{data:t=[]}=nn({queryKey:["runs","in-flight"],queryFn:()=>$e.runs(void 0,void 0,void 0,{statuses:eS,limit:500}),enabled:e,refetchInterval:5e3});return t}const J4=100;function s6(){const[e,t]=S.useState("all"),[n,r]=S.useState([]),[s,o]=S.useState([]),[i,l]=S.useState([]),[a,c]=S.useState(Z1),[u,d]=S.useState(()=>nw()),f=S.useCallback(K=>{if(d(K),typeof window>"u")return;const L=K?`#/run/${encodeURIComponent(K)}`:"",Y=L||window.location.pathname+window.location.search;window.location.hash!==L&&window.history.pushState(null,"",Y)},[]);S.useEffect(()=>{const K=()=>d(nw());return window.addEventListener("hashchange",K),window.addEventListener("popstate",K),()=>{window.removeEventListener("hashchange",K),window.removeEventListener("popstate",K)}},[]);const[p,x]=S.useState({key:"",pages:1}),v=fo(),b=s,m=b.join("|"),g=a.kind==="origin"?a.origin:a.kind==="unknown"?null:void 0,y=J1(a),w=CL({status:e,tag:n.join("|"),attrs:m,namespace:i.join("|"),origin:y}),E=p.key===w?p.pages:1,N=J4*E,{data:k=[],isPending:C,isFetching:I}=nn({queryKey:["runs",e,n,m,i,y,N],queryFn:()=>$e.runs(e==="all"?void 0:e,n,b.length?b:void 0,{namespace:i,origin:g,limit:N}),refetchInterval:3e3,placeholderData:cR}),{data:P=[]}=nn({queryKey:["run-facets",n,m,i],queryFn:()=>$e.facets(n,b.length?b:void 0,i),refetchInterval:5e3}),A=a.kind==="unknown"?null:a.kind==="origin"?a.origin:void 0,F=S.useMemo(()=>({namespace:i,attr:s,origin:A}),[i,s,A]),z=S.useMemo(()=>({tag:n,attr:s,origin:A}),[n,s,A]),R=S.useMemo(()=>({tag:n,namespace:i,origin:A}),[n,i,A]),{data:O=[]}=nn({queryKey:["workers"],queryFn:()=>$e.workers(),refetchInterval:5e3}),_=Ms({mutationFn:K=>$e.bulk(K,{status:e!=="all"?e:void 0,tag:n,attr:b.length?b:void 0,namespace:i,origin:g}),onSuccess:()=>v.invalidateQueries({queryKey:["runs"]})}),$=S.useMemo(()=>{const K={};for(const L of P)wI({origin:L.origin??void 0},a)&&(K[L.status]=(K[L.status]??0)+L.count);return K},[P,a]),T=S.useMemo(()=>SI(P),[P]),j=S.useMemo(()=>e==="all"?Object.values($).reduce((K,L)=>K+L,0):$[e]??0,[$,e]),M=e!=="all"||n.length>0||i.length>0||b.length>0||a.kind!=="all",U=S.useMemo(()=>bI(P),[P]),H=S.useMemo(()=>LI(O),[O]),V=uN(S.useMemo(()=>cN(k),[k])),W=S.useCallback(K=>{r(L=>L.includes(K)?L:[...L,K])},[]),q=S.useCallback(K=>{l(L=>L.includes(K)?L:[...L,K])},[]),B=S.useCallback(()=>{x(K=>({key:w,pages:K.key===w?K.pages+1:2}))},[w]);return h.jsxs(O4,{children:[h.jsx("div",{className:"app-bg"}),h.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[h.jsx(F4,{counts:$,filter:e,onFilter:t}),H.length>0&&h.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:[h.jsx("span",{className:"s-no-worker inline-flex items-center gap-1.5",children:h.jsx("span",{className:"dot s-no-worker","aria-hidden":!0})}),h.jsxs("span",{children:["Runs waiting on handlers with no live worker:"," ",h.jsx("span",{className:"mono text-amber-100",children:H.join(", ")}),". Start a worker to unblock."]})]}),h.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-[minmax(300px,360px)_1fr]",children:[h.jsxs("aside",{className:"flex min-h-0 flex-col border-r border-line",children:[h.jsxs("div",{className:"border-b border-line p-2",children:[h.jsx(_u,{field:"tag",scope:F,glyph:"#",label:"filter by tag",placeholder:"filter by tag…",value:n,onChange:r,title:"Tags carried by a run (WorkflowRun.tags). Several match ANY of them."}),h.jsx("div",{className:"mt-1.5",children:h.jsx(_u,{field:"namespace",scope:z,glyph:"@",label:"filter by tenant",placeholder:"filter by tenant / namespace…",value:i,onChange:l,title:"Tenant / worker-pool partition (WorkflowRun.namespace). None selected shows every tenant."})}),h.jsx(Jj,{value:s,onChange:o,scope:R})]}),h.jsx(eA,{facets:U,value:a,onChange:c}),M&&j>0&&h.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-3 py-1.5",children:[h.jsxs("span",{className:"mono text-[10px] text-zinc-500",children:[j," ",e!=="all"?e:"",n.length>0&&` #${n.join(", ")}`,i.length>0&&` @${i.join(", ")}`,a.kind==="origin"&&` ⬡${Ea(a.origin)}`,a.kind==="unknown"&&` ⬡${dd}`,b.length>0&&` ⛃${b.length}`]}),h.jsx(je,{variant:"brand",size:"xs",disabled:_.isPending,onClick:()=>_.mutate("retry"),className:"mono ml-auto rounded",children:"retry all"}),h.jsx(je,{variant:"danger",size:"xs",disabled:_.isPending,onClick:()=>_.mutate("cancel"),className:"mono rounded",children:"cancel all"})]}),h.jsx(G4,{runs:k,siblings:V,health:O,loading:C,selected:u,onSelect:f,onSelectTag:W,onSelectNamespace:q,onSelectOrigin:c,total:j,onLoadMore:B,loadingMore:I,emptyNotice:EI({anyFilter:M,origin:a,unknownCount:T})},w)]}),h.jsx("main",{className:"min-h-0",children:u?h.jsx(Z4,{id:u,onOpenRun:f},u):h.jsx("div",{className:"grid h-full place-items-center text-center",children:h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsx(iN,{className:"h-10 w-10 text-zinc-800"}),h.jsx("p",{className:"mt-3 text-sm text-zinc-600",children:"Select a run to see its timeline."})]})})})]})]})]})}export{s6 as A,t6 as Q,e0 as R,r6 as a,DP as c,h as j,S as r};
|