@dudousxd/nestjs-durable-dashboard 0.46.1 → 0.48.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 +26 -1
- package/dist/client/durable-client.d.ts.map +1 -1
- package/dist/client/durable-client.js +28 -1
- package/dist/client/durable-client.js.map +1 -1
- package/dist/client/run-query-string.d.ts +2 -0
- package/dist/client/run-query-string.d.ts.map +1 -1
- package/dist/client/run-query-string.js.map +1 -1
- package/dist/react/open-console-button.d.ts +1 -1
- package/dist/react/open-console-button.d.ts.map +1 -1
- package/dist/server/index.cjs +238 -39
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +25 -2
- package/dist/server/index.d.ts +25 -2
- package/dist/server/index.js +238 -39
- package/dist/server/index.js.map +1 -1
- package/dist/spa/assets/{bench-C9Wy_W9u.js → bench-DBT4MTjB.js} +1 -1
- package/dist/spa/assets/index-BYg_w0aX.js +66 -0
- package/dist/spa/assets/{index-DTjzfX2h.js → index-D9HzYedm.js} +1 -1
- package/dist/spa/assets/index-LBQc7d3p.css +1 -0
- package/dist/spa/assets/{preview-CepUq-I_.js → preview-BDJd2aOJ.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 +27 -18
- package/dist/spa/assets/index-DyuI-y-B.js +0 -80
- package/dist/spa/assets/index-DzTL9Sp_.css +0 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var fR=Object.defineProperty;var d0=e=>{throw TypeError(e)};var hR=(e,t,n)=>t in e?fR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ye=(e,t,n)=>hR(e,typeof t!="symbol"?t+"":t,n),Wd=(e,t,n)=>t.has(e)||d0("Cannot "+n);var D=(e,t,n)=>(Wd(e,t,"read from private field"),n?n.call(e):t.get(e)),oe=(e,t,n)=>t.has(e)?d0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ee=(e,t,n,r)=>(Wd(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),he=(e,t,n)=>(Wd(e,t,"access private method"),n);var Da=(e,t,n,r)=>({set _(s){ee(e,t,s,n)},get _(){return D(e,t,r)}});function pR(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 nw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rw={exports:{}},Uu={},sw={exports:{}},ke={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var ya=Symbol.for("react.element"),gR=Symbol.for("react.portal"),mR=Symbol.for("react.fragment"),yR=Symbol.for("react.strict_mode"),xR=Symbol.for("react.profiler"),vR=Symbol.for("react.provider"),wR=Symbol.for("react.context"),bR=Symbol.for("react.forward_ref"),SR=Symbol.for("react.suspense"),ER=Symbol.for("react.memo"),kR=Symbol.for("react.lazy"),f0=Symbol.iterator;function CR(e){return e===null||typeof e!="object"?null:(e=f0&&e[f0]||e["@@iterator"],typeof e=="function"?e:null)}var ow={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},iw=Object.assign,lw={};function Fi(e,t,n){this.props=e,this.context=t,this.refs=lw,this.updater=n||ow}Fi.prototype.isReactComponent={};Fi.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")};Fi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function aw(){}aw.prototype=Fi.prototype;function qp(e,t,n){this.props=e,this.context=t,this.refs=lw,this.updater=n||ow}var Kp=qp.prototype=new aw;Kp.constructor=qp;iw(Kp,Fi.prototype);Kp.isPureReactComponent=!0;var h0=Array.isArray,cw=Object.prototype.hasOwnProperty,Yp={current:null},uw={key:!0,ref:!0,__self:!0,__source:!0};function dw(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)cw.call(t,r)&&!uw.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:ya,type:e,key:o,ref:i,props:s,_owner:Yp.current}}function RR(e,t){return{$$typeof:ya,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Gp(e){return typeof e=="object"&&e!==null&&e.$$typeof===ya}function NR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var p0=/\/+/g;function Ud(e,t){return typeof e=="object"&&e!==null&&e.key!=null?NR(""+e.key):t.toString(36)}function Cc(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 ya:case gR:i=!0}}if(i)return i=e,s=s(i),e=r===""?"."+Ud(i,0):r,h0(s)?(n="",e!=null&&(n=e.replace(p0,"$&/")+"/"),Cc(s,t,n,"",function(c){return c})):s!=null&&(Gp(s)&&(s=RR(s,n+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(p0,"$&/")+"/")+e)),t.push(s)),1;if(i=0,r=r===""?".":r+":",h0(e))for(var l=0;l<e.length;l++){o=e[l];var a=r+Ud(o,l);i+=Cc(o,t,n,a,s)}else if(a=CR(e),typeof a=="function")for(e=a.call(e),l=0;!(o=e.next()).done;)o=o.value,a=r+Ud(o,l++),i+=Cc(o,t,n,a,s);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function Fa(e,t,n){if(e==null)return e;var r=[],s=0;return Cc(e,r,"","",function(o){return t.call(n,o,s++)}),r}function PR(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},TR={ReactCurrentDispatcher:Lt,ReactCurrentBatchConfig:Rc,ReactCurrentOwner:Yp};function fw(){throw Error("act(...) is not supported in production builds of React.")}ke.Children={map:Fa,forEach:function(e,t,n){Fa(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Fa(e,function(){t++}),t},toArray:function(e){return Fa(e,function(t){return t})||[]},only:function(e){if(!Gp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ke.Component=Fi;ke.Fragment=mR;ke.Profiler=xR;ke.PureComponent=qp;ke.StrictMode=yR;ke.Suspense=SR;ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=TR;ke.act=fw;ke.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=iw({},e.props),s=e.key,o=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,i=Yp.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)cw.call(t,a)&&!uw.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:ya,type:e.type,key:s,ref:o,props:r,_owner:i}};ke.createContext=function(e){return e={$$typeof:wR,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:vR,_context:e},e.Consumer=e};ke.createElement=dw;ke.createFactory=function(e){var t=dw.bind(null,e);return t.type=e,t};ke.createRef=function(){return{current:null}};ke.forwardRef=function(e){return{$$typeof:bR,render:e}};ke.isValidElement=Gp;ke.lazy=function(e){return{$$typeof:kR,_payload:{_status:-1,_result:e},_init:PR}};ke.memo=function(e,t){return{$$typeof:ER,type:e,compare:t===void 0?null:t}};ke.startTransition=function(e){var t=Rc.transition;Rc.transition={};try{e()}finally{Rc.transition=t}};ke.unstable_act=fw;ke.useCallback=function(e,t){return Lt.current.useCallback(e,t)};ke.useContext=function(e){return Lt.current.useContext(e)};ke.useDebugValue=function(){};ke.useDeferredValue=function(e){return Lt.current.useDeferredValue(e)};ke.useEffect=function(e,t){return Lt.current.useEffect(e,t)};ke.useId=function(){return Lt.current.useId()};ke.useImperativeHandle=function(e,t,n){return Lt.current.useImperativeHandle(e,t,n)};ke.useInsertionEffect=function(e,t){return Lt.current.useInsertionEffect(e,t)};ke.useLayoutEffect=function(e,t){return Lt.current.useLayoutEffect(e,t)};ke.useMemo=function(e,t){return Lt.current.useMemo(e,t)};ke.useReducer=function(e,t,n){return Lt.current.useReducer(e,t,n)};ke.useRef=function(e){return Lt.current.useRef(e)};ke.useState=function(e){return Lt.current.useState(e)};ke.useSyncExternalStore=function(e,t,n){return Lt.current.useSyncExternalStore(e,t,n)};ke.useTransition=function(){return Lt.current.useTransition()};ke.version="18.3.1";sw.exports=ke;var S=sw.exports;const hw=nw(S),IR=pR({__proto__:null,default:hw},[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 OR=S,_R=Symbol.for("react.element"),MR=Symbol.for("react.fragment"),jR=Object.prototype.hasOwnProperty,AR=OR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,zR={key:!0,ref:!0,__self:!0,__source:!0};function pw(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)jR.call(t,r)&&!zR.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:_R,type:e,key:o,ref:i,props:s,_owner:AR.current}}Uu.Fragment=MR;Uu.jsx=pw;Uu.jsxs=pw;rw.exports=Uu;var h=rw.exports;const gw=S.createContext(void 0),ho=e=>{const t=S.useContext(gw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},E4=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(gw.Provider,{value:e,children:t})),DR={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var Yr,Up,Vv,FR=(Vv=class{constructor(){oe(this,Yr,DR);oe(this,Up,!1)}setTimeoutProvider(e){ee(this,Yr,e)}setTimeout(e,t){return D(this,Yr).setTimeout(e,t)}clearTimeout(e){D(this,Yr).clearTimeout(e)}setInterval(e,t){return D(this,Yr).setInterval(e,t)}clearInterval(e){D(this,Yr).clearInterval(e)}},Yr=new WeakMap,Up=new WeakMap,Vv);const js=new FR;function $R(e){setTimeout(e,0)}const LR=typeof window>"u"||"Deno"in globalThis;function Tt(){}function HR(e,t){return typeof e=="function"?e(t):e}function mw(e){return typeof e=="number"&&e>=0&&e!==1/0}function yw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Qe(e,t){return typeof e=="function"?e(t):e}function g0(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:i,stale:l}=e;if(i){if(r){if(t.queryHash!==Qp(i,t.options))return!1}else if(!yi(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 m0(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(!yi(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Qp(e,t){return((t==null?void 0:t.queryKeyHashFn)||eo)(e)}function eo(e){return JSON.stringify(e,(t,n)=>Kf(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function yi(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(!yi(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!yi(e[r],t[r]))return!1;return!0}return!1}const BR=Object.prototype.hasOwnProperty;function Xp(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=y0(e)&&y0(t);if(!r&&!(Kf(e)&&Kf(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],f=e[u],d=t[u];if(f===d){l[u]=f,(r?c<s:BR.call(e,u))&&a++;continue}if(f===null||d===null||typeof f!="object"||typeof d!="object"){l[u]=d;continue}const g=Xp(f,d,n+1);l[u]=g,g===f&&a++}return s===i&&a===s?e:l}function gl(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 y0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Kf(e){if(!x0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!x0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function x0(e){return Object.prototype.toString.call(e)==="[object Object]"}function VR(e){return new Promise(t=>{js.setTimeout(t,e)})}function Yf(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Xp(e,t):t}function WR(e){return e}function UR(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function qR(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}const Zp=Symbol();function xw(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Zp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Jp(e,t){return typeof e=="function"?e(...t):!!e}function KR(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 YR=()=>LR;const eg=()=>YR();var po=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,Gr,ni,Wv,GR=(Wv=class extends po{constructor(){super();oe(this,$s);oe(this,Gr);oe(this,ni);ee(this,ni,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){D(this,Gr)||this.setEventListener(D(this,ni))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,Gr))==null||t.call(this),ee(this,Gr,void 0))}setEventListener(t){var n;ee(this,ni,t),(n=D(this,Gr))==null||n.call(this),ee(this,Gr,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,Gr=new WeakMap,ni=new WeakMap,Wv);const tg=new GR,QR=$R;function XR(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=QR;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 Ze=XR();var ri,Qr,si,Uv,ZR=(Uv=class extends po{constructor(){super();oe(this,ri,!0);oe(this,Qr);oe(this,si);ee(this,si,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,Qr)||this.setEventListener(D(this,si))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,Qr))==null||t.call(this),ee(this,Qr,void 0))}setEventListener(t){var n;ee(this,si,t),(n=D(this,Qr))==null||n.call(this),ee(this,Qr,t(this.setOnline.bind(this)))}setOnline(t){D(this,ri)!==t&&(ee(this,ri,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return D(this,ri)}},ri=new WeakMap,Qr=new WeakMap,si=new WeakMap,Uv);const qc=new ZR;function JR(e){return Math.min(1e3*2**e,3e4)}function vw(e){return(e??"online")==="online"?qc.isOnline():!0}var Gf=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ww(e){let t=!1,n=0,r,s="pending",o,i;const l=new Promise((m,y)=>{o=m,i=y});l.catch(Tt);const a=()=>s!=="pending",c=m=>{var y;if(!a()){const w=new Gf(m);v(w),(y=e.onCancel)==null||y.call(e,w)}},u=()=>{t=!0},f=()=>{t=!1},d=()=>tg.isFocused()&&(e.networkMode==="always"||qc.isOnline())&&e.canRun(),g=()=>vw(e.networkMode)&&e.canRun(),x=m=>{a()||(r==null||r(),s="resolved",o(m))},v=m=>{a()||(r==null||r(),s="rejected",i(m))},b=()=>new Promise(m=>{var y;r=w=>{(a()||d())&&m(w)},(y=e.onPause)==null||y.call(e)}).then(()=>{var m;r=void 0,a()||(m=e.onContinue)==null||m.call(e)}),p=()=>{if(a())return;let m;const y=n===0?e.initialPromise:void 0;try{m=y??e.fn()}catch(w){m=Promise.reject(w)}Promise.resolve(m).then(x).catch(w=>{var I;if(a())return;const E=e.retry??(eg()?0:3),N=e.retryDelay??JR,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),VR(k).then(()=>d()?void 0:b()).then(()=>{t?v(w):p()})})};return{promise:l,status:()=>s,cancel:c,continue:()=>(r==null||r(),l),cancelRetry:u,continueRetry:f,canStart:g,start:()=>(g()?p():b().then(p),l)}}var Ls,qv,bw=(qv=class{constructor(){oe(this,Ls)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mw(this.gcTime)&&ee(this,Ls,js.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(eg()?1/0:3e5))}clearGcTimeout(){D(this,Ls)!==void 0&&(js.clearTimeout(D(this,Ls)),ee(this,Ls,void 0))}},Ls=new WeakMap,qv);function eN(e){return{onFetch:(t,n)=>{var u,f,d,g,x;const r=t.options,s=(d=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:d.direction,o=((g=t.state.data)==null?void 0:g.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=>{KR(y,()=>t.signal,()=>v=!0)},p=xw(t.options,t.fetchOptions),m=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 j={client:t.client,queryKey:t.queryKey,pageParam:w,direction:E?"backward":"forward",meta:t.options.meta};return b(j),j})(),C=await p(k),{maxPages:I}=t.options,P=E?qR:UR;return{pages:P(y.pages,C,I),pageParams:P(y.pageParams,w,I)}};if(s&&o.length){const y=s==="backward",w=y?Sw:Qf,E={pages:o,pageParams:i};l=await m(E,w(r,E),y)}else{const y=e??o.length;do{const w=a===0?i[0]??r.initialPageParam:Qf(r,l);if(a>0&&w==null)break;l=await m(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 Qf(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 Sw(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 tN(e,t){return t?Qf(e,t)!=null:!1}function nN(e,t){return!t||!e.getPreviousPageParam?!1:Sw(e,t)!=null}var oi,Hs,ii,fn,Bs,lt,aa,Vs,Pn,lr,Kv,rN=(Kv=class extends bw{constructor(t){super();oe(this,Pn);oe(this,oi);oe(this,Hs);oe(this,ii);oe(this,fn);oe(this,Bs);oe(this,lt);oe(this,aa);oe(this,Vs);ee(this,Vs,!1),ee(this,aa,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,w0(this.options)),this.state=t.state??D(this,Hs),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return D(this,oi)}get promise(){var t;return(t=D(this,lt))==null?void 0:t.promise}setOptions(t){if(this.options={...D(this,aa),...t},t!=null&&t._type&&ee(this,oi,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=w0(this.options);n.data!==void 0&&(this.setState(v0(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=Yf(this.state.data,t,this.options);return he(this,Pn,lr).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,Pn,lr).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=D(this,lt))==null?void 0:r.promise;return(s=D(this,lt))==null||s.cancel(t),n?n.then(Tt).catch(Tt):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=>Qe(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Zp||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Qe(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:!yw(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=D(this,lt))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=D(this,lt))==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,lt)&&(D(this,Vs)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?D(this,lt).cancel({revert:!0}):D(this,lt).cancelRetry()),this.scheduleGc()),D(this,fn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||he(this,Pn,lr).call(this,{type:"invalidate"})}async fetch(t,n){var c,u,f,d,g,x,v,b,p,m,y,w;if(this.state.fetchStatus!=="idle"&&((c=D(this,lt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(D(this,lt))return D(this,lt).continueRetry(),D(this,lt).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=xw(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,oi)==="infinite"?eN(this.options.pages):this.options.behavior)==null||u.onFetch(l,this),ee(this,ii,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=l.fetchOptions)==null?void 0:f.meta))&&he(this,Pn,lr).call(this,{type:"fetch",meta:(d=l.fetchOptions)==null?void 0:d.meta});const a=ee(this,lt,ww({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:E=>{E instanceof Gf&&E.revert&&this.setState({...D(this,ii),fetchStatus:"idle"}),r.abort()},onFail:(E,N)=>{he(this,Pn,lr).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{he(this,Pn,lr).call(this,{type:"pause"})},onContinue:()=>{he(this,Pn,lr).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=(g=D(this,fn).config).onSuccess)==null||x.call(g,E,this),(b=(v=D(this,fn).config).onSettled)==null||b.call(v,E,this.state.error,this),E}catch(E){if(E instanceof Gf){if(E.silent)return D(this,lt).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw he(this,Pn,lr).call(this,{type:"error",error:E}),(m=(p=D(this,fn).config).onError)==null||m.call(p,E,this),(w=(y=D(this,fn).config).onSettled)==null||w.call(y,this.state.data,E,this),E}finally{D(this,lt)===a&&ee(this,lt,void 0),this.scheduleGc()}}},oi=new WeakMap,Hs=new WeakMap,ii=new WeakMap,fn=new WeakMap,Bs=new WeakMap,lt=new WeakMap,aa=new WeakMap,Vs=new WeakMap,Pn=new WeakSet,lr=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,...Ew(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...v0(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,ii,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),Ze.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),D(this,fn).notify({query:this,type:"updated",action:t})})},Kv);function Ew(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function v0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function w0(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,Re,ca,At,Ws,li,dr,ua,ai,ci,Us,qs,Xr,ui,Me,ll,Xf,Zf,Jf,eh,th,nh,rh,sh,Yv,qu=(Yv=class extends po{constructor(t,n){super();oe(this,Me);oe(this,jt);oe(this,Re);oe(this,ca);oe(this,At);oe(this,Ws);oe(this,li);oe(this,dr);oe(this,ua);oe(this,ai);oe(this,ci);oe(this,Us);oe(this,qs);oe(this,Xr);oe(this,ui,new Set);this.options=n,ee(this,jt,t),ee(this,dr,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(D(this,Re).addObserver(this),b0(D(this,Re),this.options)?he(this,Me,ll).call(this):this.updateResult(),he(this,Me,th).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return oh(D(this,Re),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return oh(D(this,Re),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,he(this,Me,nh).call(this),he(this,Me,rh).call(this),D(this,Re).removeObserver(this)}setOptions(t){const n=this.options,r=D(this,Re);if(this.options=D(this,jt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Qe(this.options.enabled,D(this,Re))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");he(this,Me,sh).call(this),D(this,Re).setOptions(this.options),n._defaulted&&!gl(this.options,n)&&D(this,jt).getQueryCache().notify({type:"observerOptionsUpdated",query:D(this,Re),observer:this});const s=this.hasListeners();s&&S0(D(this,Re),r,this.options,n)&&he(this,Me,ll).call(this),this.updateResult(),s&&(D(this,Re)!==r||Qe(this.options.enabled,D(this,Re))!==Qe(n.enabled,D(this,Re))||Qe(this.options.staleTime,D(this,Re))!==Qe(n.staleTime,D(this,Re)))&&he(this,Me,Zf).call(this);const o=he(this,Me,Jf).call(this);s&&(D(this,Re)!==r||Qe(this.options.enabled,D(this,Re))!==Qe(n.enabled,D(this,Re))||o!==D(this,Xr))&&he(this,Me,eh).call(this,o)}getOptimisticResult(t){const n=D(this,jt).getQueryCache().build(D(this,jt),t),r=this.createResult(n,t);return gl(this.getCurrentResult(),r)||(ee(this,At,r),ee(this,li,this.options),ee(this,Ws,D(this,Re).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,ui).add(t)}getCurrentQuery(){return D(this,Re)}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,Re),s=this.options,o=D(this,At),i=D(this,Ws),l=D(this,li),a=t!==r?t.state:D(this,ca),{state:c}=t;let u={...c},f=!1,d;if(n._optimisticResults){const k=this.hasListeners(),C=!k&&b0(t,n),I=k&&S0(t,r,n,s);(C||I)&&(u={...u,...Ew(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:g,errorUpdatedAt:x,status:v}=u;d=u.data;let b=!1;if(n.placeholderData!==void 0&&d===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,ci))==null?void 0:N.state.data,D(this,ci)):n.placeholderData,k!==void 0&&(v="success",d=Yf(o==null?void 0:o.data,k,n),f=!0)}if(n.select&&d!==void 0&&!b)if(o&&d===(i==null?void 0:i.data)&&n.select===D(this,ua))d=D(this,ai);else try{ee(this,ua,n.select),d=n.select(d),d=Yf(o==null?void 0:o.data,d,n),ee(this,ai,d),ee(this,dr,null)}catch(k){ee(this,dr,k)}else d===void 0&&ee(this,dr,null);D(this,dr)&&(g=D(this,dr),d=D(this,ai),x=Date.now(),v="error",f=!1);const p=u.fetchStatus==="fetching",m=v==="pending",y=v==="error",w=m&&p,E=d!==void 0;return{status:v,fetchStatus:u.fetchStatus,isPending:m,isSuccess:v==="success",isError:y,isInitialLoading:w,isLoading:w,data:d,dataUpdatedAt:u.dataUpdatedAt,error:g,errorUpdatedAt:x,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:p,isRefetching:p&&!m,isLoadingError:y&&!E,isPaused:u.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:y&&E,isStale:ng(t,n),refetch:this.refetch,isEnabled:Qe(n.enabled,t)!==!1}}updateResult(){const t=D(this,At),n=this.createResult(D(this,Re),this.options);if(ee(this,Ws,D(this,Re).state),ee(this,li,this.options),D(this,Ws).data!==void 0&&ee(this,ci,D(this,Re)),gl(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,ui).size)return!0;const l=new Set(i??D(this,ui));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)})})();Ze.batch(()=>{s&&this.listeners.forEach(o=>{o(D(this,At))}),D(this,jt).getQueryCache().notify({query:D(this,Re),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&he(this,Me,th).call(this)}},jt=new WeakMap,Re=new WeakMap,ca=new WeakMap,At=new WeakMap,Ws=new WeakMap,li=new WeakMap,dr=new WeakMap,ua=new WeakMap,ai=new WeakMap,ci=new WeakMap,Us=new WeakMap,qs=new WeakMap,Xr=new WeakMap,ui=new WeakMap,Me=new WeakSet,ll=function(t){he(this,Me,sh).call(this);let n=D(this,Re).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Tt)),n},Xf=function(t){return!eg()&&Qe(this.options.enabled,D(this,Re))!==!1&&mw(t)},Zf=function(){he(this,Me,nh).call(this);const t=Qe(this.options.staleTime,D(this,Re));if(D(this,At).isStale||!he(this,Me,Xf).call(this,t))return;const n=yw(D(this,At).dataUpdatedAt,t)+1;ee(this,Us,js.setTimeout(()=>{D(this,At).isStale||this.updateResult()},n))},Jf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(D(this,Re)):this.options.refetchInterval)??!1},eh=function(t){he(this,Me,rh).call(this),ee(this,Xr,t),!(D(this,Xr)===0||!he(this,Me,Xf).call(this,D(this,Xr)))&&ee(this,qs,js.setInterval(()=>{(this.options.refetchIntervalInBackground||tg.isFocused())&&he(this,Me,ll).call(this)},D(this,Xr)))},th=function(){he(this,Me,Zf).call(this),he(this,Me,eh).call(this,he(this,Me,Jf).call(this))},nh=function(){D(this,Us)!==void 0&&(js.clearTimeout(D(this,Us)),ee(this,Us,void 0))},rh=function(){D(this,qs)!==void 0&&(js.clearInterval(D(this,qs)),ee(this,qs,void 0))},sh=function(){const t=D(this,jt).getQueryCache().build(D(this,jt),this.options);if(t===D(this,Re))return;const n=D(this,Re);ee(this,Re,t),ee(this,ca,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Yv);function sN(e,t){return Qe(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Qe(t.retryOnMount,e)===!1)}function b0(e,t){return sN(e,t)||e.state.data!==void 0&&oh(e,t,t.refetchOnMount)}function oh(e,t,n){if(Qe(t.enabled,e)!==!1&&Qe(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ng(e,t)}return!1}function S0(e,t,n,r){return(e!==t||Qe(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ng(e,n)}function ng(e,t){return Qe(t.enabled,e)!==!1&&e.isStaleByTime(Qe(t.staleTime,e))}var oN=class extends qu{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 g,x;const{state:n}=e,r=super.createResult(e,t),{isFetching:s,isRefetching:o,isError:i,isRefetchError:l}=r,a=(x=(g=n.fetchMeta)==null?void 0:g.fetchMore)==null?void 0:x.direction,c=i&&a==="forward",u=s&&a==="forward",f=i&&a==="backward",d=s&&a==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:tN(t,n.data),hasPreviousPage:nN(t,n.data),isFetchNextPageError:c,isFetchingNextPage:u,isFetchPreviousPageError:f,isFetchingPreviousPage:d,isRefetchError:l&&!c&&!f,isRefetching:o&&!u&&!d}}},da,Kn,Nt,Ks,Yn,Hr,Gv,iN=(Gv=class extends bw{constructor(t){super();oe(this,Yn);oe(this,da);oe(this,Kn);oe(this,Nt);oe(this,Ks);ee(this,da,t.client),this.mutationId=t.mutationId,ee(this,Nt,t.mutationCache),ee(this,Kn,[]),this.state=t.state||kw(),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,Nt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,Kn,D(this,Kn).filter(n=>n!==t)),this.scheduleGc(),D(this,Nt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){D(this,Kn).length||(this.state.status==="pending"?this.scheduleGc():D(this,Nt).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,f,d,g,x,v,b,p,m,y,w,E,N,k,C;const n=()=>{he(this,Yn,Hr).call(this,{type:"continue"})},r={client:D(this,da),meta:this.options.meta,mutationKey:this.options.mutationKey},s=ee(this,Ks,ww({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(I,P)=>{he(this,Yn,Hr).call(this,{type:"failed",failureCount:I,error:P})},onPause:()=>{he(this,Yn,Hr).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>D(this,Nt).canRun(this)})),o=this.state.status==="pending",i=!s.canStart();try{if(o)n();else{he(this,Yn,Hr).call(this,{type:"pending",variables:t,isPaused:i}),D(this,Nt).config.onMutate&&await D(this,Nt).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,Hr).call(this,{type:"pending",context:P,variables:t,isPaused:i})}const I=await s.start();return await((u=(c=D(this,Nt).config).onSuccess)==null?void 0:u.call(c,I,t,this.state.context,this,r)),await((d=(f=this.options).onSuccess)==null?void 0:d.call(f,I,t,this.state.context,r)),await((x=(g=D(this,Nt).config).onSettled)==null?void 0:x.call(g,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,Hr).call(this,{type:"success",data:I}),I}catch(I){try{await((m=(p=D(this,Nt).config).onError)==null?void 0:m.call(p,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,Nt).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,Hr).call(this,{type:"error",error:I}),I}finally{D(this,Ks)===s&&ee(this,Ks,void 0),D(this,Nt).runNext(this)}}},da=new WeakMap,Kn=new WeakMap,Nt=new WeakMap,Ks=new WeakMap,Yn=new WeakSet,Hr=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),Ze.batch(()=>{D(this,Kn).forEach(r=>{r.onMutationUpdate(t)}),D(this,Nt).notify({mutation:this,type:"updated",action:t})})},Gv);function kw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var fr,Tn,fa,Qv,lN=(Qv=class extends po{constructor(t={}){super();oe(this,fr);oe(this,Tn);oe(this,fa);this.config=t,ee(this,fr,new Set),ee(this,Tn,new Map),ee(this,fa,0)}build(t,n,r){const s=new iN({client:t,mutationCache:this,mutationId:++Da(this,fa)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){D(this,fr).add(t);const n=$a(t);if(typeof n=="string"){const r=D(this,Tn).get(n);r?r.push(t):D(this,Tn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(D(this,fr).delete(t)){const n=$a(t);if(typeof n=="string"){const r=D(this,Tn).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,Tn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=$a(t);if(typeof n=="string"){const s=(r=D(this,Tn).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=$a(t);return typeof n=="string"?((s=(r=D(this,Tn).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Ze.batch(()=>{D(this,fr).forEach(t=>{this.notify({type:"removed",mutation:t})}),D(this,fr).clear(),D(this,Tn).clear()})}getAll(){return Array.from(D(this,fr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>m0(n,r))}findAll(t={}){return this.getAll().filter(n=>m0(t,n))}notify(t){Ze.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ze.batch(()=>Promise.all(t.map(n=>n.continue().catch(Tt))))}},fr=new WeakMap,Tn=new WeakMap,fa=new WeakMap,Qv);function $a(e){var t;return(t=e.options.scope)==null?void 0:t.id}var hr,Zr,Pt,pr,Zn,al,ih,Xv,aN=(Xv=class extends po{constructor(n,r){super();oe(this,Zn);oe(this,hr);oe(this,Zr);oe(this,Pt);oe(this,pr);ee(this,hr,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,hr).defaultMutationOptions(n),gl(this.options,r)||D(this,hr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:D(this,Pt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&eo(r.mutationKey)!==eo(this.options.mutationKey)?this.reset():((s=D(this,Pt))==null?void 0:s.state.status)==="pending"&&D(this,Pt).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&D(this,Pt)&&(D(this,Pt).addObserver(this),he(this,Zn,al).call(this))}onUnsubscribe(){var n;this.hasListeners()||(n=D(this,Pt))==null||n.removeObserver(this)}onMutationUpdate(n){he(this,Zn,al).call(this),he(this,Zn,ih).call(this,n)}getCurrentResult(){return D(this,Zr)}reset(){var n;(n=D(this,Pt))==null||n.removeObserver(this),ee(this,Pt,void 0),he(this,Zn,al).call(this),he(this,Zn,ih).call(this)}mutate(n,r){var s;return ee(this,pr,r),(s=D(this,Pt))==null||s.removeObserver(this),ee(this,Pt,D(this,hr).getMutationCache().build(D(this,hr),this.options)),D(this,Pt).addObserver(this),D(this,Pt).execute(n)}},hr=new WeakMap,Zr=new WeakMap,Pt=new WeakMap,pr=new WeakMap,Zn=new WeakSet,al=function(){var r;const n=((r=D(this,Pt))==null?void 0:r.state)??kw();ee(this,Zr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ih=function(n){Ze.batch(()=>{var r,s,o,i,l,a,c,u;if(D(this,pr)&&this.hasListeners()){const f=D(this,Zr).variables,d=D(this,Zr).context,g={client:D(this,hr),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=D(this,pr)).onSuccess)==null||s.call(r,n.data,f,d,g)}catch(x){Promise.reject(x)}try{(i=(o=D(this,pr)).onSettled)==null||i.call(o,n.data,null,f,d,g)}catch(x){Promise.reject(x)}}else if((n==null?void 0:n.type)==="error"){try{(a=(l=D(this,pr)).onError)==null||a.call(l,n.error,f,d,g)}catch(x){Promise.reject(x)}try{(u=(c=D(this,pr)).onSettled)==null||u.call(c,void 0,n.error,f,d,g)}catch(x){Promise.reject(x)}}}this.listeners.forEach(f=>{f(D(this,Zr))})})},Xv);function E0(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}var di,zt,fi,Ys,Zt,Gs,ha,pa,ga,ma,ut,lh,ah,Cw,ch,uh,dh,Zv,cN=(Zv=class extends po{constructor(t,n,r){super();oe(this,ut);oe(this,di);oe(this,zt);oe(this,fi);oe(this,Ys);oe(this,Zt);oe(this,Gs);oe(this,ha);oe(this,pa);oe(this,ga);oe(this,ma,[]);ee(this,di,t),ee(this,Ys,r),ee(this,fi,[]),ee(this,Zt,[]),ee(this,zt,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&D(this,Zt).forEach(t=>{t.subscribe(n=>{he(this,ut,uh).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,fi,t),ee(this,Ys,n),Ze.batch(()=>{const r=D(this,Zt),s=he(this,ut,ch).call(this,D(this,fi));s.forEach(f=>f.observer.setOptions(f.defaultedQueryOptions));const o=s.map(f=>f.observer),i=o.map(f=>f.getCurrentResult()),l=r.length!==o.length,a=o.some((f,d)=>f!==r[d]),c=l||a,u=c?!0:i.some((f,d)=>{const g=D(this,zt)[d];return!g||!gl(f,g)});!c&&!u||(c&&(ee(this,ma,s),ee(this,Zt,o)),ee(this,zt,i),this.hasListeners()&&(c&&(E0(r,o).forEach(f=>{f.destroy()}),E0(o,r).forEach(f=>{f.subscribe(d=>{he(this,ut,uh).call(this,f,d)})})),he(this,ut,dh).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,ut,ch).call(this,t),s=r.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions)),o=r.map(i=>i.defaultedQueryOptions.queryHash);return[s,i=>he(this,ut,ah).call(this,i??s,n,o),()=>he(this,ut,lh).call(this,s,r)]}},di=new WeakMap,zt=new WeakMap,fi=new WeakMap,Ys=new WeakMap,Zt=new WeakMap,Gs=new WeakMap,ha=new WeakMap,pa=new WeakMap,ga=new WeakMap,ma=new WeakMap,ut=new WeakSet,lh=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)}))})})},ah=function(t,n,r){if(n){const s=D(this,ga),o=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((i,l)=>i!==s[l]));return(D(this,zt)!==D(this,pa)||o||n!==D(this,ha))&&(ee(this,ha,n),ee(this,pa,D(this,zt)),r!==void 0&&ee(this,ga,r),ee(this,Gs,Xp(D(this,Gs),n(t)))),D(this,Gs)}return t},Cw=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})},ch=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,di).defaultQueryOptions(s),i=((l=n.get(o.queryHash))==null?void 0:l.shift())??new qu(D(this,di),o);r.push({defaultedQueryOptions:o,observer:i})}),r},uh=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,ut,dh).call(this))},dh=function(){var t;if(this.hasListeners()){const n=he(this,ut,Cw).call(this),r=D(this,Gs),s=n?r:he(this,ut,ah).call(this,he(this,ut,lh).call(this,D(this,zt),D(this,ma)),(t=D(this,Ys))==null?void 0:t.combine);(n||r!==s)&&Ze.batch(()=>{this.listeners.forEach(o=>{o(D(this,zt))})})}},Zv),Gn,Jv,uN=(Jv=class extends po{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??Qp(s,n);let i=this.get(o);return i||(i=new rN({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(){Ze.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=>g0(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>g0(t,r)):n}notify(t){Ze.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ze.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ze.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Gn=new WeakMap,Jv),qe,Jr,es,hi,pi,ts,gi,mi,ew,C4=(ew=class{constructor(e={}){oe(this,qe);oe(this,Jr);oe(this,es);oe(this,hi);oe(this,pi);oe(this,ts);oe(this,gi);oe(this,mi);ee(this,qe,e.queryCache||new uN),ee(this,Jr,e.mutationCache||new lN),ee(this,es,e.defaultOptions||{}),ee(this,hi,new Map),ee(this,pi,new Map),ee(this,ts,0)}mount(){Da(this,ts)._++,D(this,ts)===1&&(ee(this,gi,tg.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,qe).onFocus())})),ee(this,mi,qc.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,qe).onOnline())})))}unmount(){var e,t;Da(this,ts)._--,D(this,ts)===0&&((e=D(this,gi))==null||e.call(this),ee(this,gi,void 0),(t=D(this,mi))==null||t.call(this),ee(this,mi,void 0))}isFetching(e){return D(this,qe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return D(this,Jr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=D(this,qe).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=D(this,qe).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Qe(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return D(this,qe).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,qe).get(r.queryHash))==null?void 0:i.state.data,o=HR(t,s);if(o!==void 0)return D(this,qe).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Ze.batch(()=>D(this,qe).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,qe).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=D(this,qe);Ze.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=D(this,qe);return Ze.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=Ze.batch(()=>D(this,qe).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Tt).catch(Tt)}invalidateQueries(e,t={}){return Ze.batch(()=>(D(this,qe).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=Ze.batch(()=>D(this,qe).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Tt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Tt)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=D(this,qe).build(this,t),r=n.isStaleByTime(Qe(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,qe).build(this,t);return n.isStaleByTime(Qe(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Tt).catch(Tt)}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(Tt).catch(Tt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return qc.isOnline()?D(this,Jr).resumePausedMutations():Promise.resolve()}getQueryCache(){return D(this,qe)}getMutationCache(){return D(this,Jr)}getDefaultOptions(){return D(this,es)}setDefaultOptions(e){ee(this,es,e)}setQueryDefaults(e,t){D(this,hi).set(eo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...D(this,hi).values()],n={};return t.forEach(r=>{yi(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){D(this,pi).set(eo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...D(this,pi).values()],n={};return t.forEach(r=>{yi(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...D(this,es).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Qp(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===Zp&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...D(this,es).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){D(this,qe).clear(),D(this,Jr).clear()}},qe=new WeakMap,Jr=new WeakMap,es=new WeakMap,hi=new WeakMap,pi=new WeakMap,ts=new WeakMap,gi=new WeakMap,mi=new WeakMap,ew);const Rw=S.createContext(!1),Nw=()=>S.useContext(Rw);Rw.Provider;function dN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const fN=S.createContext(dN()),Pw=()=>S.useContext(fN),Tw=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Jp(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Iw=e=>{S.useEffect(()=>{e.clearReset()},[e])},Ow=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||Jp(n,[e.error,r])),_w=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},fh=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Mw=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function jw({queries:e,...t},n){const r=ho(),s=Nw(),o=Pw(),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=>{_w(v);const b=r.getQueryCache().get(v.queryHash);Tw(v,o,b)}),Iw(o);const[a]=S.useState(()=>new cN(r,l,t)),[c,u,f]=a.getOptimisticResult(l,t.combine),d=!s&&i;S.useSyncExternalStore(S.useCallback(v=>d?a.subscribe(Ze.batchCalls(v)):Tt,[a,d]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),S.useEffect(()=>{a.setQueries(l,t)},[l,t,a]);const g=c.some((v,b)=>fh(l[b],v))?c.flatMap((v,b)=>{const p=l[b];if(p&&fh(p,v)){const m=new qu(r,p);return Mw(p,m,o)}return[]}):[];if(g.length>0)throw Promise.all(g);const x=c.find((v,b)=>{const p=l[b];return p&&Ow({result:v,errorResetBoundary:o,throwOnError:p.throwOnError,query:r.getQueryCache().get(p.queryHash),suspense:p.suspense})});if(x)throw x.error;return u(f())}function Aw(e,t,n){const r=Nw(),s=Pw(),o=ho(),i=o.defaultQueryOptions(e),l=o.getQueryCache().get(i.queryHash),a=e.subscribed!==!1;i._optimisticResults=r?"isRestoring":a?"optimistic":void 0,_w(i),Tw(i,s,l),Iw(s);const[c]=S.useState(()=>new t(o,i)),u=c.getOptimisticResult(i),f=!r&&a;if(S.useSyncExternalStore(S.useCallback(d=>{const g=f?c.subscribe(Ze.batchCalls(d)):Tt;return c.updateResult(),g},[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),S.useEffect(()=>{c.setOptions(i)},[i,c]),fh(i,u))throw Mw(i,c,s);if(Ow({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 Aw(e,qu)}function Ms(e,t){const n=ho(),[r]=S.useState(()=>new aN(n,e));S.useEffect(()=>{r.setOptions(e)},[r,e]);const s=S.useSyncExternalStore(S.useCallback(i=>r.subscribe(Ze.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=S.useCallback((...i)=>{r.mutate(i[0],i[1]).catch(Tt)},[r]);if(s.error&&Jp(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}function hN(e,t){return Aw(e,oN)}var zw={exports:{}},cn={},Dw={exports:{}},Fw={};/**
|
|
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,A){var M=T.length;T.push(A);e:for(;0<M;){var W=M-1>>>1,L=T[W];if(0<s(L,A))T[W]=A,T[M]=L,M=W;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var A=T[0],M=T.pop();if(M!==A){T[0]=M;e:for(var W=0,L=T.length,K=L>>>1;W<K;){var U=2*(W+1)-1,V=T[U],B=U+1,q=T[B];if(0>s(V,M))B<L&&0>s(q,V)?(T[W]=q,T[B]=M,W=B):(T[W]=V,T[U]=M,W=U);else if(B<L&&0>s(q,M))T[W]=q,T[B]=M,W=B;else break e}}return A}function s(T,A){var M=T.sortIndex-A.sortIndex;return M!==0?M:T.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var a=[],c=[],u=1,f=null,d=3,g=!1,x=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,m=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 A=n(c);A!==null;){if(A.callback===null)r(c);else if(A.startTime<=T)r(c),A.sortIndex=A.expirationTime,t(a,A);else break;A=n(c)}}function w(T){if(v=!1,y(T),!x)if(n(a)!==null)x=!0,O(E);else{var A=n(c);A!==null&&$(w,A.startTime-T)}}function E(T,A){x=!1,v&&(v=!1,p(C),C=-1),g=!0;var M=d;try{for(y(A),f=n(a);f!==null&&(!(f.expirationTime>A)||T&&!j());){var W=f.callback;if(typeof W=="function"){f.callback=null,d=f.priorityLevel;var L=W(f.expirationTime<=A);A=e.unstable_now(),typeof L=="function"?f.callback=L:f===n(a)&&r(a),y(A)}else r(a);f=n(a)}if(f!==null)var K=!0;else{var U=n(c);U!==null&&$(w,U.startTime-A),K=!1}return K}finally{f=null,d=M,g=!1}}var N=!1,k=null,C=-1,I=5,P=-1;function j(){return!(e.unstable_now()-P<I)}function F(){if(k!==null){var T=e.unstable_now();P=T;var A=!0;try{A=k(!0,T)}finally{A?z():(N=!1,k=null)}}else N=!1}var z;if(typeof m=="function")z=function(){m(F)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,_=R.port2;R.port1.onmessage=F,z=function(){_.postMessage(null)}}else z=function(){b(F,0)};function O(T){k=T,N||(N=!0,z())}function $(T,A){C=b(function(){T(e.unstable_now())},A)}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||g||(x=!0,O(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 d},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(T){switch(d){case 1:case 2:case 3:var A=3;break;default:A=d}var M=d;d=A;try{return T()}finally{d=M}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,A){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var M=d;d=T;try{return A()}finally{d=M}},e.unstable_scheduleCallback=function(T,A,M){var W=e.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?W+M:W):M=W,T){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=M+L,T={id:u++,callback:A,priorityLevel:T,startTime:M,expirationTime:L,sortIndex:-1},M>W?(T.sortIndex=M,t(c,T),n(a)===null&&T===n(c)&&(v?(p(C),C=-1):v=!0,$(w,M-W))):(T.sortIndex=L,t(a,T),x||g||(x=!0,O(E))),T},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(T){var A=d;return function(){var M=d;d=A;try{return T.apply(this,arguments)}finally{d=M}}}})(Fw);Dw.exports=Fw;var pN=Dw.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 gN=S,sn=pN;function J(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 $w=new Set,Il={};function go(e,t){xi(e,t),xi(e+"Capture",t)}function xi(e,t){for(Il[e]=t,e=0;e<t.length;e++)$w.add(t[e])}var Er=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hh=Object.prototype.hasOwnProperty,mN=/^[: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]*$/,k0={},C0={};function yN(e){return hh.call(C0,e)?!0:hh.call(k0,e)?!1:mN.test(e)?C0[e]=!0:(k0[e]=!0,!1)}function xN(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 vN(e,t,n,r){if(t===null||typeof t>"u"||xN(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 bt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){bt[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];bt[t]=new Ht(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){bt[e]=new Ht(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){bt[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){bt[e]=new Ht(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){bt[e]=new Ht(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){bt[e]=new Ht(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){bt[e]=new Ht(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){bt[e]=new Ht(e,5,!1,e.toLowerCase(),null,!1,!1)});var rg=/[\-:]([a-z])/g;function sg(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(rg,sg);bt[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(rg,sg);bt[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(rg,sg);bt[t]=new Ht(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){bt[e]=new Ht(e,1,!1,e.toLowerCase(),null,!1,!1)});bt.xlinkHref=new Ht("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){bt[e]=new Ht(e,1,!1,e.toLowerCase(),null,!0,!0)});function og(e,t,n,r){var s=bt.hasOwnProperty(t)?bt[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(vN(t,n,s,r)&&(n=null),r||s===null?yN(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 Ir=gN.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,La=Symbol.for("react.element"),Oo=Symbol.for("react.portal"),_o=Symbol.for("react.fragment"),ig=Symbol.for("react.strict_mode"),ph=Symbol.for("react.profiler"),Lw=Symbol.for("react.provider"),Hw=Symbol.for("react.context"),lg=Symbol.for("react.forward_ref"),gh=Symbol.for("react.suspense"),mh=Symbol.for("react.suspense_list"),ag=Symbol.for("react.memo"),Br=Symbol.for("react.lazy"),Bw=Symbol.for("react.offscreen"),R0=Symbol.iterator;function Ki(e){return e===null||typeof e!="object"?null:(e=R0&&e[R0]||e["@@iterator"],typeof e=="function"?e:null)}var Ge=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 Kd=!1;function Yd(e,t){if(!e||Kd)return"";Kd=!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{Kd=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?cl(e):""}function wN(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=Yd(e.type,!1),e;case 11:return e=Yd(e.type.render,!1),e;case 1:return e=Yd(e.type,!0),e;default:return""}}function yh(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 _o:return"Fragment";case Oo:return"Portal";case ph:return"Profiler";case ig:return"StrictMode";case gh:return"Suspense";case mh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Hw:return(e.displayName||"Context")+".Consumer";case Lw:return(e._context.displayName||"Context")+".Provider";case lg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ag:return t=e.displayName||null,t!==null?t:yh(e.type)||"Memo";case Br:t=e._payload,e=e._init;try{return yh(e(t))}catch{}}return null}function bN(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 yh(t);case 8:return t===ig?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function gs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Vw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function SN(e){var t=Vw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ha(e){e._valueTracker||(e._valueTracker=SN(e))}function Ww(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Vw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Kc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function xh(e,t){var n=t.checked;return Ge({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function N0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=gs(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Uw(e,t){t=t.checked,t!=null&&og(e,"checked",t,!1)}function vh(e,t){Uw(e,t);var n=gs(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?wh(e,t.type,n):t.hasOwnProperty("defaultValue")&&wh(e,t.type,gs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function P0(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 wh(e,t,n){(t!=="number"||Kc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ul=Array.isArray;function qo(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+gs(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function bh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(J(91));return Ge({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function T0(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(J(92));if(ul(n)){if(1<n.length)throw Error(J(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:gs(n)}}function qw(e,t){var n=gs(t.value),r=gs(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function I0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Kw(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 Sh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Kw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ba,Yw=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ba=Ba||document.createElement("div"),Ba.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ba.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ol(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ml={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},EN=["Webkit","ms","Moz","O"];Object.keys(ml).forEach(function(e){EN.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ml[t]=ml[e]})});function Gw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ml.hasOwnProperty(e)&&ml[e]?(""+t).trim():t+"px"}function Qw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Gw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var kN=Ge({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 Eh(e,t){if(t){if(kN[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(J(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(J(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(J(61))}if(t.style!=null&&typeof t.style!="object")throw Error(J(62))}}function kh(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 Ch=null;function cg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Rh=null,Ko=null,Yo=null;function O0(e){if(e=wa(e)){if(typeof Rh!="function")throw Error(J(280));var t=e.stateNode;t&&(t=Xu(t),Rh(e.stateNode,e.type,t))}}function Xw(e){Ko?Yo?Yo.push(e):Yo=[e]:Ko=e}function Zw(){if(Ko){var e=Ko,t=Yo;if(Yo=Ko=null,O0(e),t)for(e=0;e<t.length;e++)O0(t[e])}}function Jw(e,t){return e(t)}function eb(){}var Gd=!1;function tb(e,t,n){if(Gd)return e(t,n);Gd=!0;try{return Jw(e,t,n)}finally{Gd=!1,(Ko!==null||Yo!==null)&&(eb(),Zw())}}function _l(e,t){var n=e.stateNode;if(n===null)return null;var r=Xu(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(J(231,t,typeof n));return n}var Nh=!1;if(Er)try{var Yi={};Object.defineProperty(Yi,"passive",{get:function(){Nh=!0}}),window.addEventListener("test",Yi,Yi),window.removeEventListener("test",Yi,Yi)}catch{Nh=!1}function CN(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 yl=!1,Yc=null,Gc=!1,Ph=null,RN={onError:function(e){yl=!0,Yc=e}};function NN(e,t,n,r,s,o,i,l,a){yl=!1,Yc=null,CN.apply(RN,arguments)}function PN(e,t,n,r,s,o,i,l,a){if(NN.apply(this,arguments),yl){if(yl){var c=Yc;yl=!1,Yc=null}else throw Error(J(198));Gc||(Gc=!0,Ph=c)}}function mo(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 nb(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 _0(e){if(mo(e)!==e)throw Error(J(188))}function TN(e){var t=e.alternate;if(!t){if(t=mo(e),t===null)throw Error(J(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 _0(s),e;if(o===r)return _0(s),t;o=o.sibling}throw Error(J(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(J(189))}}if(n.alternate!==r)throw Error(J(190))}if(n.tag!==3)throw Error(J(188));return n.stateNode.current===n?e:t}function rb(e){return e=TN(e),e!==null?sb(e):null}function sb(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=sb(e);if(t!==null)return t;e=e.sibling}return null}var ob=sn.unstable_scheduleCallback,M0=sn.unstable_cancelCallback,IN=sn.unstable_shouldYield,ON=sn.unstable_requestPaint,tt=sn.unstable_now,_N=sn.unstable_getCurrentPriorityLevel,ug=sn.unstable_ImmediatePriority,ib=sn.unstable_UserBlockingPriority,Qc=sn.unstable_NormalPriority,MN=sn.unstable_LowPriority,lb=sn.unstable_IdlePriority,Ku=null,Jn=null;function jN(e){if(Jn&&typeof Jn.onCommitFiberRoot=="function")try{Jn.onCommitFiberRoot(Ku,e,void 0,(e.current.flags&128)===128)}catch{}}var An=Math.clz32?Math.clz32:DN,AN=Math.log,zN=Math.LN2;function DN(e){return e>>>=0,e===0?32:31-(AN(e)/zN|0)|0}var Va=64,Wa=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 Xc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var l=i&~s;l!==0?r=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 FN(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 $N(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]=FN(l,t)):a<=t&&(e.expiredLanes|=l),o&=~l}}function Th(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function ab(){var e=Va;return Va<<=1,!(Va&4194240)&&(Va=64),e}function Qd(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function xa(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 LN(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 dg(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 cb(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var ub,fg,db,fb,hb,Ih=!1,Ua=[],os=null,is=null,ls=null,Ml=new Map,jl=new Map,Ur=[],HN="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 j0(e,t){switch(e){case"focusin":case"focusout":os=null;break;case"dragenter":case"dragleave":is=null;break;case"mouseover":case"mouseout":ls=null;break;case"pointerover":case"pointerout":Ml.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":jl.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=wa(t),t!==null&&fg(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function BN(e,t,n,r,s){switch(t){case"focusin":return os=Gi(os,e,t,n,r,s),!0;case"dragenter":return is=Gi(is,e,t,n,r,s),!0;case"mouseover":return ls=Gi(ls,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return Ml.set(o,Gi(Ml.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,jl.set(o,Gi(jl.get(o)||null,e,t,n,r,s)),!0}return!1}function pb(e){var t=As(e.target);if(t!==null){var n=mo(t);if(n!==null){if(t=n.tag,t===13){if(t=nb(n),t!==null){e.blockedOn=t,hb(e.priority,function(){db(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 Nc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Oh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ch=r,n.target.dispatchEvent(r),Ch=null}else return t=wa(n),t!==null&&fg(t),e.blockedOn=n,!1;t.shift()}return!0}function A0(e,t,n){Nc(e)&&n.delete(t)}function VN(){Ih=!1,os!==null&&Nc(os)&&(os=null),is!==null&&Nc(is)&&(is=null),ls!==null&&Nc(ls)&&(ls=null),Ml.forEach(A0),jl.forEach(A0)}function Qi(e,t){e.blockedOn===t&&(e.blockedOn=null,Ih||(Ih=!0,sn.unstable_scheduleCallback(sn.unstable_NormalPriority,VN)))}function Al(e){function t(s){return Qi(s,e)}if(0<Ua.length){Qi(Ua[0],e);for(var n=1;n<Ua.length;n++){var r=Ua[n];r.blockedOn===e&&(r.blockedOn=null)}}for(os!==null&&Qi(os,e),is!==null&&Qi(is,e),ls!==null&&Qi(ls,e),Ml.forEach(t),jl.forEach(t),n=0;n<Ur.length;n++)r=Ur[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Ur.length&&(n=Ur[0],n.blockedOn===null);)pb(n),n.blockedOn===null&&Ur.shift()}var Go=Ir.ReactCurrentBatchConfig,Zc=!0;function WN(e,t,n,r){var s=ze,o=Go.transition;Go.transition=null;try{ze=1,hg(e,t,n,r)}finally{ze=s,Go.transition=o}}function UN(e,t,n,r){var s=ze,o=Go.transition;Go.transition=null;try{ze=4,hg(e,t,n,r)}finally{ze=s,Go.transition=o}}function hg(e,t,n,r){if(Zc){var s=Oh(e,t,n,r);if(s===null)lf(e,t,r,Jc,n),j0(e,r);else if(BN(s,e,t,n,r))r.stopPropagation();else if(j0(e,r),t&4&&-1<HN.indexOf(e)){for(;s!==null;){var o=wa(s);if(o!==null&&ub(o),o=Oh(e,t,n,r),o===null&&lf(e,t,r,Jc,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else lf(e,t,r,null,n)}}var Jc=null;function Oh(e,t,n,r){if(Jc=null,e=cg(r),e=As(e),e!==null)if(t=mo(e),t===null)e=null;else if(n=t.tag,n===13){if(e=nb(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 Jc=e,null}function gb(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(_N()){case ug:return 1;case ib:return 4;case Qc:case MN:return 16;case lb:return 536870912;default:return 16}default:return 16}}var ns=null,pg=null,Pc=null;function mb(){if(Pc)return Pc;var e,t=pg,n=t.length,r,s="value"in ns?ns.value:ns.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 Tc(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 qa(){return!0}function z0(){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)?qa:z0,this.isPropagationStopped=z0,this}return Ge(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=qa)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=qa)},persist:function(){},isPersistent:qa}),t}var $i={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gg=un($i),va=Ge({},$i,{view:0,detail:0}),qN=un(va),Xd,Zd,Xi,Yu=Ge({},va,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mg,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"?(Xd=e.screenX-Xi.screenX,Zd=e.screenY-Xi.screenY):Zd=Xd=0,Xi=e),Xd)},movementY:function(e){return"movementY"in e?e.movementY:Zd}}),D0=un(Yu),KN=Ge({},Yu,{dataTransfer:0}),YN=un(KN),GN=Ge({},va,{relatedTarget:0}),Jd=un(GN),QN=Ge({},$i,{animationName:0,elapsedTime:0,pseudoElement:0}),XN=un(QN),ZN=Ge({},$i,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),JN=un(ZN),eP=Ge({},$i,{data:0}),F0=un(eP),tP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nP={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"},rP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rP[e])?!!t[e]:!1}function mg(){return sP}var oP=Ge({},va,{key:function(e){if(e.key){var t=tP[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Tc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?nP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mg,charCode:function(e){return e.type==="keypress"?Tc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Tc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),iP=un(oP),lP=Ge({},Yu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$0=un(lP),aP=Ge({},va,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mg}),cP=un(aP),uP=Ge({},$i,{propertyName:0,elapsedTime:0,pseudoElement:0}),dP=un(uP),fP=Ge({},Yu,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),hP=un(fP),pP=[9,13,27,32],yg=Er&&"CompositionEvent"in window,xl=null;Er&&"documentMode"in document&&(xl=document.documentMode);var gP=Er&&"TextEvent"in window&&!xl,yb=Er&&(!yg||xl&&8<xl&&11>=xl),L0=" ",H0=!1;function xb(e,t){switch(e){case"keyup":return pP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vb(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Mo=!1;function mP(e,t){switch(e){case"compositionend":return vb(t);case"keypress":return t.which!==32?null:(H0=!0,L0);case"textInput":return e=t.data,e===L0&&H0?null:e;default:return null}}function yP(e,t){if(Mo)return e==="compositionend"||!yg&&xb(e,t)?(e=mb(),Pc=pg=ns=null,Mo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return yb&&t.locale!=="ko"?null:t.data;default:return null}}var xP={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 B0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!xP[e.type]:t==="textarea"}function wb(e,t,n,r){Xw(r),t=eu(t,"onChange"),0<t.length&&(n=new gg("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var vl=null,zl=null;function vP(e){Ob(e,0)}function Gu(e){var t=zo(e);if(Ww(t))return e}function wP(e,t){if(e==="change")return t}var bb=!1;if(Er){var ef;if(Er){var tf="oninput"in document;if(!tf){var V0=document.createElement("div");V0.setAttribute("oninput","return;"),tf=typeof V0.oninput=="function"}ef=tf}else ef=!1;bb=ef&&(!document.documentMode||9<document.documentMode)}function W0(){vl&&(vl.detachEvent("onpropertychange",Sb),zl=vl=null)}function Sb(e){if(e.propertyName==="value"&&Gu(zl)){var t=[];wb(t,zl,e,cg(e)),tb(vP,t)}}function bP(e,t,n){e==="focusin"?(W0(),vl=t,zl=n,vl.attachEvent("onpropertychange",Sb)):e==="focusout"&&W0()}function SP(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Gu(zl)}function EP(e,t){if(e==="click")return Gu(t)}function kP(e,t){if(e==="input"||e==="change")return Gu(t)}function CP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dn=typeof Object.is=="function"?Object.is:CP;function Dl(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(!hh.call(t,s)||!Dn(e[s],t[s]))return!1}return!0}function U0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function q0(e,t){var n=U0(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=U0(n)}}function Eb(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Eb(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kb(){for(var e=window,t=Kc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Kc(e.document)}return t}function xg(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 RP(e){var t=kb(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Eb(n.ownerDocument.documentElement,n)){if(r!==null&&xg(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=q0(n,o);var i=q0(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 NP=Er&&"documentMode"in document&&11>=document.documentMode,jo=null,_h=null,wl=null,Mh=!1;function K0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mh||jo==null||jo!==Kc(r)||(r=jo,"selectionStart"in r&&xg(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}),wl&&Dl(wl,r)||(wl=r,r=eu(_h,"onSelect"),0<r.length&&(t=new gg("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=jo)))}function Ka(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ao={animationend:Ka("Animation","AnimationEnd"),animationiteration:Ka("Animation","AnimationIteration"),animationstart:Ka("Animation","AnimationStart"),transitionend:Ka("Transition","TransitionEnd")},nf={},Cb={};Er&&(Cb=document.createElement("div").style,"AnimationEvent"in window||(delete Ao.animationend.animation,delete Ao.animationiteration.animation,delete Ao.animationstart.animation),"TransitionEvent"in window||delete Ao.transitionend.transition);function Qu(e){if(nf[e])return nf[e];if(!Ao[e])return e;var t=Ao[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Cb)return nf[e]=t[n];return e}var Rb=Qu("animationend"),Nb=Qu("animationiteration"),Pb=Qu("animationstart"),Tb=Qu("transitionend"),Ib=new Map,Y0="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){Ib.set(e,t),go(t,[e])}for(var rf=0;rf<Y0.length;rf++){var sf=Y0[rf],PP=sf.toLowerCase(),TP=sf[0].toUpperCase()+sf.slice(1);Es(PP,"on"+TP)}Es(Rb,"onAnimationEnd");Es(Nb,"onAnimationIteration");Es(Pb,"onAnimationStart");Es("dblclick","onDoubleClick");Es("focusin","onFocus");Es("focusout","onBlur");Es(Tb,"onTransitionEnd");xi("onMouseEnter",["mouseout","mouseover"]);xi("onMouseLeave",["mouseout","mouseover"]);xi("onPointerEnter",["pointerout","pointerover"]);xi("onPointerLeave",["pointerout","pointerover"]);go("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));go("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));go("onBeforeInput",["compositionend","keypress","textInput","paste"]);go("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));go("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));go("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(" "),IP=new Set("cancel close invalid load scroll toggle".split(" ").concat(fl));function G0(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,PN(r,t,void 0,e),e.currentTarget=null}function Ob(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;G0(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;G0(s,l,c),o=a}}}if(Gc)throw e=Ph,Gc=!1,Ph=null,e}function Be(e,t){var n=t[Fh];n===void 0&&(n=t[Fh]=new Set);var r=e+"__bubble";n.has(r)||(_b(t,e,2,!1),n.add(r))}function of(e,t,n){var r=0;t&&(r|=4),_b(n,e,r,t)}var Ya="_reactListening"+Math.random().toString(36).slice(2);function Fl(e){if(!e[Ya]){e[Ya]=!0,$w.forEach(function(n){n!=="selectionchange"&&(IP.has(n)||of(n,!1,e),of(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ya]||(t[Ya]=!0,of("selectionchange",!1,t))}}function _b(e,t,n,r){switch(gb(t)){case 1:var s=WN;break;case 4:s=UN;break;default:s=hg}n=s.bind(null,t,n,e),s=void 0,!Nh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function lf(e,t,n,r,s){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(i===4)for(i=r.return;i!==null;){var a=i.tag;if((a===3||a===4)&&(a=i.stateNode.containerInfo,a===s||a.nodeType===8&&a.parentNode===s))return;i=i.return}for(;l!==null;){if(i=As(l),i===null)return;if(a=i.tag,a===5||a===6){r=o=i;continue e}l=l.parentNode}}r=r.return}tb(function(){var c=o,u=cg(n),f=[];e:{var d=Ib.get(e);if(d!==void 0){var g=gg,x=e;switch(e){case"keypress":if(Tc(n)===0)break e;case"keydown":case"keyup":g=iP;break;case"focusin":x="focus",g=Jd;break;case"focusout":x="blur",g=Jd;break;case"beforeblur":case"afterblur":g=Jd;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=D0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=YN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=cP;break;case Rb:case Nb:case Pb:g=XN;break;case Tb:g=dP;break;case"scroll":g=qN;break;case"wheel":g=hP;break;case"copy":case"cut":case"paste":g=JN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=$0}var v=(t&4)!==0,b=!v&&e==="scroll",p=v?d!==null?d+"Capture":null:d;v=[];for(var m=c,y;m!==null;){y=m;var w=y.stateNode;if(y.tag===5&&w!==null&&(y=w,p!==null&&(w=_l(m,p),w!=null&&v.push($l(m,w,y)))),b)break;m=m.return}0<v.length&&(d=new g(d,x,null,n,u),f.push({event:d,listeners:v}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",d&&n!==Ch&&(x=n.relatedTarget||n.fromElement)&&(As(x)||x[kr]))break e;if((g||d)&&(d=u.window===u?u:(d=u.ownerDocument)?d.defaultView||d.parentWindow:window,g?(x=n.relatedTarget||n.toElement,g=c,x=x?As(x):null,x!==null&&(b=mo(x),x!==b||x.tag!==5&&x.tag!==6)&&(x=null)):(g=null,x=c),g!==x)){if(v=D0,w="onMouseLeave",p="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(v=$0,w="onPointerLeave",p="onPointerEnter",m="pointer"),b=g==null?d:zo(g),y=x==null?d:zo(x),d=new v(w,m+"leave",g,n,u),d.target=b,d.relatedTarget=y,w=null,As(u)===c&&(v=new v(p,m+"enter",x,n,u),v.target=y,v.relatedTarget=b,w=v),b=w,g&&x)t:{for(v=g,p=x,m=0,y=v;y;y=To(y))m++;for(y=0,w=p;w;w=To(w))y++;for(;0<m-y;)v=To(v),m--;for(;0<y-m;)p=To(p),y--;for(;m--;){if(v===p||p!==null&&v===p.alternate)break t;v=To(v),p=To(p)}v=null}else v=null;g!==null&&Q0(f,d,g,v,!1),x!==null&&b!==null&&Q0(f,b,x,v,!0)}}e:{if(d=c?zo(c):window,g=d.nodeName&&d.nodeName.toLowerCase(),g==="select"||g==="input"&&d.type==="file")var E=wP;else if(B0(d))if(bb)E=kP;else{E=SP;var N=bP}else(g=d.nodeName)&&g.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(E=EP);if(E&&(E=E(e,c))){wb(f,E,n,u);break e}N&&N(e,d,c),e==="focusout"&&(N=d._wrapperState)&&N.controlled&&d.type==="number"&&wh(d,"number",d.value)}switch(N=c?zo(c):window,e){case"focusin":(B0(N)||N.contentEditable==="true")&&(jo=N,_h=c,wl=null);break;case"focusout":wl=_h=jo=null;break;case"mousedown":Mh=!0;break;case"contextmenu":case"mouseup":case"dragend":Mh=!1,K0(f,n,u);break;case"selectionchange":if(NP)break;case"keydown":case"keyup":K0(f,n,u)}var k;if(yg)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 Mo?xb(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(yb&&n.locale!=="ko"&&(Mo||C!=="onCompositionStart"?C==="onCompositionEnd"&&Mo&&(k=mb()):(ns=u,pg="value"in ns?ns.value:ns.textContent,Mo=!0)),N=eu(c,C),0<N.length&&(C=new F0(C,e,null,n,u),f.push({event:C,listeners:N}),k?C.data=k:(k=vb(n),k!==null&&(C.data=k)))),(k=gP?mP(e,n):yP(e,n))&&(c=eu(c,"onBeforeInput"),0<c.length&&(u=new F0("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=k))}Ob(f,t)})}function $l(e,t,n){return{instance:e,listener:t,currentTarget:n}}function eu(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=_l(e,n),o!=null&&r.unshift($l(e,o,s)),o=_l(e,t),o!=null&&r.push($l(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 Q0(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=_l(n,o),a!=null&&i.unshift($l(n,a,l))):s||(a=_l(n,o),a!=null&&i.push($l(n,a,l)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var OP=/\r\n?/g,_P=/\u0000|\uFFFD/g;function X0(e){return(typeof e=="string"?e:""+e).replace(OP,`
|
|
38
|
+
`).replace(_P,"")}function Ga(e,t,n){if(t=X0(t),X0(e)!==t&&n)throw Error(J(425))}function tu(){}var jh=null,Ah=null;function zh(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 Dh=typeof setTimeout=="function"?setTimeout:void 0,MP=typeof clearTimeout=="function"?clearTimeout:void 0,Z0=typeof Promise=="function"?Promise:void 0,jP=typeof queueMicrotask=="function"?queueMicrotask:typeof Z0<"u"?function(e){return Z0.resolve(null).then(e).catch(AP)}:Dh;function AP(e){setTimeout(function(){throw e})}function af(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Al(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Al(t)}function as(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function J0(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 Li=Math.random().toString(36).slice(2),Xn="__reactFiber$"+Li,Ll="__reactProps$"+Li,kr="__reactContainer$"+Li,Fh="__reactEvents$"+Li,zP="__reactListeners$"+Li,DP="__reactHandles$"+Li;function As(e){var t=e[Xn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[kr]||n[Xn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=J0(e);e!==null;){if(n=e[Xn])return n;e=J0(e)}return t}e=n,n=e.parentNode}return null}function wa(e){return e=e[Xn]||e[kr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function zo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(J(33))}function Xu(e){return e[Ll]||null}var $h=[],Do=-1;function ks(e){return{current:e}}function Ve(e){0>Do||(e.current=$h[Do],$h[Do]=null,Do--)}function He(e,t){Do++,$h[Do]=e.current,e.current=t}var ms={},_t=ks(ms),Kt=ks(!1),to=ms;function vi(e,t){var n=e.type.contextTypes;if(!n)return ms;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Yt(e){return e=e.childContextTypes,e!=null}function nu(){Ve(Kt),Ve(_t)}function ey(e,t,n){if(_t.current!==ms)throw Error(J(168));He(_t,t),He(Kt,n)}function Mb(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(J(108,bN(e)||"Unknown",s));return Ge({},n,r)}function ru(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ms,to=_t.current,He(_t,e),He(Kt,Kt.current),!0}function ty(e,t,n){var r=e.stateNode;if(!r)throw Error(J(169));n?(e=Mb(e,t,to),r.__reactInternalMemoizedMergedChildContext=e,Ve(Kt),Ve(_t),He(_t,e)):Ve(Kt),He(Kt,n)}var ur=null,Zu=!1,cf=!1;function jb(e){ur===null?ur=[e]:ur.push(e)}function FP(e){Zu=!0,jb(e)}function Cs(){if(!cf&&ur!==null){cf=!0;var e=0,t=ze;try{var n=ur;for(ze=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ur=null,Zu=!1}catch(s){throw ur!==null&&(ur=ur.slice(e+1)),ob(ug,Cs),s}finally{ze=t,cf=!1}}return null}var Fo=[],$o=0,su=null,ou=0,pn=[],gn=0,no=null,gr=1,mr="";function Is(e,t){Fo[$o++]=ou,Fo[$o++]=su,su=e,ou=t}function Ab(e,t,n){pn[gn++]=gr,pn[gn++]=mr,pn[gn++]=no,no=e;var r=gr;e=mr;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,gr=1<<32-An(t)+s|n<<s|r,mr=o+e}else gr=1<<o|n<<s|r,mr=e}function vg(e){e.return!==null&&(Is(e,1),Ab(e,1,0))}function wg(e){for(;e===su;)su=Fo[--$o],Fo[$o]=null,ou=Fo[--$o],Fo[$o]=null;for(;e===no;)no=pn[--gn],pn[gn]=null,mr=pn[--gn],pn[gn]=null,gr=pn[--gn],pn[gn]=null}var rn=null,tn=null,We=!1,_n=null;function zb(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 ny(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=as(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:gr,overflow:mr}: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 Lh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Hh(e){if(We){var t=tn;if(t){var n=t;if(!ny(e,t)){if(Lh(e))throw Error(J(418));t=as(n.nextSibling);var r=rn;t&&ny(e,t)?zb(r,n):(e.flags=e.flags&-4097|2,We=!1,rn=e)}}else{if(Lh(e))throw Error(J(418));e.flags=e.flags&-4097|2,We=!1,rn=e}}}function ry(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;rn=e}function Qa(e){if(e!==rn)return!1;if(!We)return ry(e),We=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!zh(e.type,e.memoizedProps)),t&&(t=tn)){if(Lh(e))throw Db(),Error(J(418));for(;t;)zb(e,t),t=as(t.nextSibling)}if(ry(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(J(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){tn=as(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}tn=null}}else tn=rn?as(e.stateNode.nextSibling):null;return!0}function Db(){for(var e=tn;e;)e=as(e.nextSibling)}function wi(){tn=rn=null,We=!1}function bg(e){_n===null?_n=[e]:_n.push(e)}var $P=Ir.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(J(309));var r=n.stateNode}if(!r)throw Error(J(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(J(284));if(!n._owner)throw Error(J(290,e))}return e}function Xa(e,t){throw e=Object.prototype.toString.call(t),Error(J(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function sy(e){var t=e._init;return t(e._payload)}function Fb(e){function t(p,m){if(e){var y=p.deletions;y===null?(p.deletions=[m],p.flags|=16):y.push(m)}}function n(p,m){if(!e)return null;for(;m!==null;)t(p,m),m=m.sibling;return null}function r(p,m){for(p=new Map;m!==null;)m.key!==null?p.set(m.key,m):p.set(m.index,m),m=m.sibling;return p}function s(p,m){return p=fs(p,m),p.index=0,p.sibling=null,p}function o(p,m,y){return p.index=y,e?(y=p.alternate,y!==null?(y=y.index,y<m?(p.flags|=2,m):y):(p.flags|=2,m)):(p.flags|=1048576,m)}function i(p){return e&&p.alternate===null&&(p.flags|=2),p}function l(p,m,y,w){return m===null||m.tag!==6?(m=mf(y,p.mode,w),m.return=p,m):(m=s(m,y),m.return=p,m)}function a(p,m,y,w){var E=y.type;return E===_o?u(p,m,y.props.children,w,y.key):m!==null&&(m.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Br&&sy(E)===m.type)?(w=s(m,y.props),w.ref=Zi(p,m,y),w.return=p,w):(w=zc(y.type,y.key,y.props,null,p.mode,w),w.ref=Zi(p,m,y),w.return=p,w)}function c(p,m,y,w){return m===null||m.tag!==4||m.stateNode.containerInfo!==y.containerInfo||m.stateNode.implementation!==y.implementation?(m=yf(y,p.mode,w),m.return=p,m):(m=s(m,y.children||[]),m.return=p,m)}function u(p,m,y,w,E){return m===null||m.tag!==7?(m=Xs(y,p.mode,w,E),m.return=p,m):(m=s(m,y),m.return=p,m)}function f(p,m,y){if(typeof m=="string"&&m!==""||typeof m=="number")return m=mf(""+m,p.mode,y),m.return=p,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case La:return y=zc(m.type,m.key,m.props,null,p.mode,y),y.ref=Zi(p,null,m),y.return=p,y;case Oo:return m=yf(m,p.mode,y),m.return=p,m;case Br:var w=m._init;return f(p,w(m._payload),y)}if(ul(m)||Ki(m))return m=Xs(m,p.mode,y,null),m.return=p,m;Xa(p,m)}return null}function d(p,m,y,w){var E=m!==null?m.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return E!==null?null:l(p,m,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case La:return y.key===E?a(p,m,y,w):null;case Oo:return y.key===E?c(p,m,y,w):null;case Br:return E=y._init,d(p,m,E(y._payload),w)}if(ul(y)||Ki(y))return E!==null?null:u(p,m,y,w,null);Xa(p,y)}return null}function g(p,m,y,w,E){if(typeof w=="string"&&w!==""||typeof w=="number")return p=p.get(y)||null,l(m,p,""+w,E);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case La:return p=p.get(w.key===null?y:w.key)||null,a(m,p,w,E);case Oo:return p=p.get(w.key===null?y:w.key)||null,c(m,p,w,E);case Br:var N=w._init;return g(p,m,y,N(w._payload),E)}if(ul(w)||Ki(w))return p=p.get(y)||null,u(m,p,w,E,null);Xa(m,w)}return null}function x(p,m,y,w){for(var E=null,N=null,k=m,C=m=0,I=null;k!==null&&C<y.length;C++){k.index>C?(I=k,k=null):I=k.sibling;var P=d(p,k,y[C],w);if(P===null){k===null&&(k=I);break}e&&k&&P.alternate===null&&t(p,k),m=o(P,m,C),N===null?E=P:N.sibling=P,N=P,k=I}if(C===y.length)return n(p,k),We&&Is(p,C),E;if(k===null){for(;C<y.length;C++)k=f(p,y[C],w),k!==null&&(m=o(k,m,C),N===null?E=k:N.sibling=k,N=k);return We&&Is(p,C),E}for(k=r(p,k);C<y.length;C++)I=g(k,p,C,y[C],w),I!==null&&(e&&I.alternate!==null&&k.delete(I.key===null?C:I.key),m=o(I,m,C),N===null?E=I:N.sibling=I,N=I);return e&&k.forEach(function(j){return t(p,j)}),We&&Is(p,C),E}function v(p,m,y,w){var E=Ki(y);if(typeof E!="function")throw Error(J(150));if(y=E.call(y),y==null)throw Error(J(151));for(var N=E=null,k=m,C=m=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 j=d(p,k,P.value,w);if(j===null){k===null&&(k=I);break}e&&k&&j.alternate===null&&t(p,k),m=o(j,m,C),N===null?E=j:N.sibling=j,N=j,k=I}if(P.done)return n(p,k),We&&Is(p,C),E;if(k===null){for(;!P.done;C++,P=y.next())P=f(p,P.value,w),P!==null&&(m=o(P,m,C),N===null?E=P:N.sibling=P,N=P);return We&&Is(p,C),E}for(k=r(p,k);!P.done;C++,P=y.next())P=g(k,p,C,P.value,w),P!==null&&(e&&P.alternate!==null&&k.delete(P.key===null?C:P.key),m=o(P,m,C),N===null?E=P:N.sibling=P,N=P);return e&&k.forEach(function(F){return t(p,F)}),We&&Is(p,C),E}function b(p,m,y,w){if(typeof y=="object"&&y!==null&&y.type===_o&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case La:e:{for(var E=y.key,N=m;N!==null;){if(N.key===E){if(E=y.type,E===_o){if(N.tag===7){n(p,N.sibling),m=s(N,y.props.children),m.return=p,p=m;break e}}else if(N.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Br&&sy(E)===N.type){n(p,N.sibling),m=s(N,y.props),m.ref=Zi(p,N,y),m.return=p,p=m;break e}n(p,N);break}else t(p,N);N=N.sibling}y.type===_o?(m=Xs(y.props.children,p.mode,w,y.key),m.return=p,p=m):(w=zc(y.type,y.key,y.props,null,p.mode,w),w.ref=Zi(p,m,y),w.return=p,p=w)}return i(p);case Oo:e:{for(N=y.key;m!==null;){if(m.key===N)if(m.tag===4&&m.stateNode.containerInfo===y.containerInfo&&m.stateNode.implementation===y.implementation){n(p,m.sibling),m=s(m,y.children||[]),m.return=p,p=m;break e}else{n(p,m);break}else t(p,m);m=m.sibling}m=yf(y,p.mode,w),m.return=p,p=m}return i(p);case Br:return N=y._init,b(p,m,N(y._payload),w)}if(ul(y))return x(p,m,y,w);if(Ki(y))return v(p,m,y,w);Xa(p,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,m!==null&&m.tag===6?(n(p,m.sibling),m=s(m,y),m.return=p,p=m):(n(p,m),m=mf(y,p.mode,w),m.return=p,p=m),i(p)):n(p,m)}return b}var bi=Fb(!0),$b=Fb(!1),iu=ks(null),lu=null,Lo=null,Sg=null;function Eg(){Sg=Lo=lu=null}function kg(e){var t=iu.current;Ve(iu),e._currentValue=t}function Bh(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 Qo(e,t){lu=e,Sg=Lo=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(Sg!==e)if(e={context:e,memoizedValue:t,next:null},Lo===null){if(lu===null)throw Error(J(308));Lo=e,lu.dependencies={lanes:0,firstContext:e}}else Lo=Lo.next=e;return t}var zs=null;function Cg(e){zs===null?zs=[e]:zs.push(e)}function Lb(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Cg(t)):(n.next=s.next,s.next=n),t.interleaved=n,Cr(e,r)}function Cr(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 Vr=!1;function Rg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Hb(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 xr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function cs(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ie&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Cr(e,n)}return s=r.interleaved,s===null?(t.next=t,Cg(r)):(t.next=s.next,s.next=t),r.interleaved=t,Cr(e,n)}function Ic(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,dg(e,n)}}function oy(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 au(e,t,n,r){var s=e.updateQueue;Vr=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var a=l,c=a.next;a.next=null,i===null?o=c:i.next=c,i=a;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==i&&(l===null?u.firstBaseUpdate=c:l.next=c,u.lastBaseUpdate=a))}if(o!==null){var f=s.baseState;i=0,u=c=a=null,l=o;do{var d=l.lane,g=l.eventTime;if((r&d)===d){u!==null&&(u=u.next={eventTime:g,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,v=l;switch(d=t,g=n,v.tag){case 1:if(x=v.payload,typeof x=="function"){f=x.call(g,f,d);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=v.payload,d=typeof x=="function"?x.call(g,f,d):x,d==null)break e;f=Ge({},f,d);break e;case 2:Vr=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,d=s.effects,d===null?s.effects=[l]:d.push(l))}else g={eventTime:g,lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(c=u=g,a=f):u=u.next=g,i|=d;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;d=l,l=d.next,d.next=null,s.lastBaseUpdate=d,s.shared.pending=null}}while(!0);if(u===null&&(a=f),s.baseState=a,s.firstBaseUpdate=c,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);so|=i,e.lanes=i,e.memoizedState=f}}function iy(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(J(191,s));s.call(r)}}}var ba={},er=ks(ba),Hl=ks(ba),Bl=ks(ba);function Ds(e){if(e===ba)throw Error(J(174));return e}function Ng(e,t){switch(He(Bl,t),He(Hl,e),He(er,ba),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Sh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Sh(t,e)}Ve(er),He(er,t)}function Si(){Ve(er),Ve(Hl),Ve(Bl)}function Bb(e){Ds(Bl.current);var t=Ds(er.current),n=Sh(t,e.type);t!==n&&(He(Hl,e),He(er,n))}function Pg(e){Hl.current===e&&(Ve(er),Ve(Hl))}var Ke=ks(0);function cu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var uf=[];function Tg(){for(var e=0;e<uf.length;e++)uf[e]._workInProgressVersionPrimary=null;uf.length=0}var Oc=Ir.ReactCurrentDispatcher,df=Ir.ReactCurrentBatchConfig,ro=0,Ye=null,at=null,ht=null,uu=!1,bl=!1,Vl=0,LP=0;function kt(){throw Error(J(321))}function Ig(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 Og(e,t,n,r,s,o){if(ro=o,Ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Oc.current=e===null||e.memoizedState===null?WP:UP,e=n(r,s),bl){o=0;do{if(bl=!1,Vl=0,25<=o)throw Error(J(301));o+=1,ht=at=null,t.updateQueue=null,Oc.current=qP,e=n(r,s)}while(bl)}if(Oc.current=du,t=at!==null&&at.next!==null,ro=0,ht=at=Ye=null,uu=!1,t)throw Error(J(300));return e}function _g(){var e=Vl!==0;return Vl=0,e}function qn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ht===null?Ye.memoizedState=ht=e:ht=ht.next=e,ht}function Sn(){if(at===null){var e=Ye.alternate;e=e!==null?e.memoizedState:null}else e=at.next;var t=ht===null?Ye.memoizedState:ht.next;if(t!==null)ht=t,at=e;else{if(e===null)throw Error(J(310));at=e,e={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},ht===null?Ye.memoizedState=ht=e:ht=ht.next=e}return ht}function Wl(e,t){return typeof t=="function"?t(e):t}function ff(e){var t=Sn(),n=t.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=e;var r=at,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 f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};a===null?(l=a=f,i=r):a=a.next=f,Ye.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,Ye.lanes|=o,so|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function hf(e){var t=Sn(),n=t.queue;if(n===null)throw Error(J(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 Vb(){}function Wb(e,t){var n=Ye,r=Sn(),s=t(),o=!Dn(r.memoizedState,s);if(o&&(r.memoizedState=s,Ut=!0),r=r.queue,Mg(Kb.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||ht!==null&&ht.memoizedState.tag&1){if(n.flags|=2048,Ul(9,qb.bind(null,n,r,s,t),void 0,null),pt===null)throw Error(J(349));ro&30||Ub(n,t,s)}return s}function Ub(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ye.updateQueue,t===null?(t={lastEffect:null,stores:null},Ye.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function qb(e,t,n,r){t.value=n,t.getSnapshot=r,Yb(t)&&Gb(e)}function Kb(e,t,n){return n(function(){Yb(t)&&Gb(e)})}function Yb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dn(e,n)}catch{return!0}}function Gb(e){var t=Cr(e,1);t!==null&&zn(t,e,1,-1)}function ly(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:Wl,lastRenderedState:e},t.queue=e,e=e.dispatch=VP.bind(null,Ye,e),[t.memoizedState,e]}function Ul(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ye.updateQueue,t===null?(t={lastEffect:null,stores:null},Ye.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 Qb(){return Sn().memoizedState}function _c(e,t,n,r){var s=qn();Ye.flags|=e,s.memoizedState=Ul(1|t,n,void 0,r===void 0?null:r)}function Ju(e,t,n,r){var s=Sn();r=r===void 0?null:r;var o=void 0;if(at!==null){var i=at.memoizedState;if(o=i.destroy,r!==null&&Ig(r,i.deps)){s.memoizedState=Ul(t,n,o,r);return}}Ye.flags|=e,s.memoizedState=Ul(1|t,n,o,r)}function ay(e,t){return _c(8390656,8,e,t)}function Mg(e,t){return Ju(2048,8,e,t)}function Xb(e,t){return Ju(4,2,e,t)}function Zb(e,t){return Ju(4,4,e,t)}function Jb(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 e1(e,t,n){return n=n!=null?n.concat([e]):null,Ju(4,4,Jb.bind(null,t,e),n)}function jg(){}function t1(e,t){var n=Sn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ig(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function n1(e,t){var n=Sn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ig(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function r1(e,t,n){return ro&21?(Dn(n,t)||(n=ab(),Ye.lanes|=n,so|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ut=!0),e.memoizedState=n)}function HP(e,t){var n=ze;ze=n!==0&&4>n?n:4,e(!0);var r=df.transition;df.transition={};try{e(!1),t()}finally{ze=n,df.transition=r}}function s1(){return Sn().memoizedState}function BP(e,t,n){var r=ds(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},o1(e))i1(t,n);else if(n=Lb(e,t,n,r),n!==null){var s=$t();zn(n,e,r,s),l1(n,t,r)}}function VP(e,t,n){var r=ds(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(o1(e))i1(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,Cg(t)):(s.next=a.next,a.next=s),t.interleaved=s;return}}catch{}finally{}n=Lb(e,t,s,r),n!==null&&(s=$t(),zn(n,e,r,s),l1(n,t,r))}}function o1(e){var t=e.alternate;return e===Ye||t!==null&&t===Ye}function i1(e,t){bl=uu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function l1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,dg(e,n)}}var du={readContext:bn,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useInsertionEffect:kt,useLayoutEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useMutableSource:kt,useSyncExternalStore:kt,useId:kt,unstable_isNewReconciler:!1},WP={readContext:bn,useCallback:function(e,t){return qn().memoizedState=[e,t===void 0?null:t],e},useContext:bn,useEffect:ay,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,_c(4194308,4,Jb.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _c(4194308,4,e,t)},useInsertionEffect:function(e,t){return _c(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=BP.bind(null,Ye,e),[r.memoizedState,e]},useRef:function(e){var t=qn();return e={current:e},t.memoizedState=e},useState:ly,useDebugValue:jg,useDeferredValue:function(e){return qn().memoizedState=e},useTransition:function(){var e=ly(!1),t=e[0];return e=HP.bind(null,e[1]),qn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ye,s=qn();if(We){if(n===void 0)throw Error(J(407));n=n()}else{if(n=t(),pt===null)throw Error(J(349));ro&30||Ub(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,ay(Kb.bind(null,r,o,e),[e]),r.flags|=2048,Ul(9,qb.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=qn(),t=pt.identifierPrefix;if(We){var n=mr,r=gr;n=(r&~(1<<32-An(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Vl++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=LP++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},UP={readContext:bn,useCallback:t1,useContext:bn,useEffect:Mg,useImperativeHandle:e1,useInsertionEffect:Xb,useLayoutEffect:Zb,useMemo:n1,useReducer:ff,useRef:Qb,useState:function(){return ff(Wl)},useDebugValue:jg,useDeferredValue:function(e){var t=Sn();return r1(t,at.memoizedState,e)},useTransition:function(){var e=ff(Wl)[0],t=Sn().memoizedState;return[e,t]},useMutableSource:Vb,useSyncExternalStore:Wb,useId:s1,unstable_isNewReconciler:!1},qP={readContext:bn,useCallback:t1,useContext:bn,useEffect:Mg,useImperativeHandle:e1,useInsertionEffect:Xb,useLayoutEffect:Zb,useMemo:n1,useReducer:hf,useRef:Qb,useState:function(){return hf(Wl)},useDebugValue:jg,useDeferredValue:function(e){var t=Sn();return at===null?t.memoizedState=e:r1(t,at.memoizedState,e)},useTransition:function(){var e=hf(Wl)[0],t=Sn().memoizedState;return[e,t]},useMutableSource:Vb,useSyncExternalStore:Wb,useId:s1,unstable_isNewReconciler:!1};function Nn(e,t){if(e&&e.defaultProps){t=Ge({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Vh(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ge({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ed={isMounted:function(e){return(e=e._reactInternals)?mo(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=$t(),s=ds(e),o=xr(r,s);o.payload=t,n!=null&&(o.callback=n),t=cs(e,o,s),t!==null&&(zn(t,e,s,r),Ic(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=$t(),s=ds(e),o=xr(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=cs(e,o,s),t!==null&&(zn(t,e,s,r),Ic(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=$t(),r=ds(e),s=xr(n,r);s.tag=2,t!=null&&(s.callback=t),t=cs(e,s,r),t!==null&&(zn(t,e,r,n),Ic(t,e,r))}};function cy(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?!Dl(n,r)||!Dl(s,o):!0}function a1(e,t,n){var r=!1,s=ms,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)?vi(e,s):ms),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ed,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function uy(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&&ed.enqueueReplaceState(t,t.state,null)}function Wh(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Rg(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=bn(o):(o=Yt(t)?to:_t.current,s.context=vi(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Vh(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&&ed.enqueueReplaceState(s,s.state,null),au(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Ei(e,t){try{var n="",r=t;do n+=wN(r),r=r.return;while(r);var s=n}catch(o){s=`
|
|
39
|
+
Error generating stack: `+o.message+`
|
|
40
|
+
`+o.stack}return{value:e,source:t,stack:s,digest:null}}function pf(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Uh(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var KP=typeof WeakMap=="function"?WeakMap:Map;function c1(e,t,n){n=xr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){hu||(hu=!0,tp=r),Uh(e,t)},n}function u1(e,t,n){n=xr(-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(){Uh(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Uh(e,t),typeof r!="function"&&(us===null?us=new Set([this]):us.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function dy(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new KP;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=lT.bind(null,e,t,n),t.then(e,e))}function fy(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 hy(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=xr(-1,1),t.tag=2,cs(n,t,1))),n.lanes|=1),e)}var YP=Ir.ReactCurrentOwner,Ut=!1;function Dt(e,t,n,r){t.child=e===null?$b(t,null,n,r):bi(t,e.child,n,r)}function py(e,t,n,r,s){n=n.render;var o=t.ref;return Qo(t,s),r=Og(e,t,n,r,o,s),n=_g(),e!==null&&!Ut?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Rr(e,t,s)):(We&&n&&vg(t),t.flags|=1,Dt(e,t,r,s),t.child)}function gy(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!Bg(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,d1(e,t,o,r,s)):(e=zc(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:Dl,n(i,r)&&e.ref===t.ref)return Rr(e,t,s)}return t.flags|=1,e=fs(o,r),e.ref=t.ref,e.return=t,t.child=e}function d1(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if(Dl(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 f1(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(Bo,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(Bo,Jt),Jt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,He(Bo,Jt),Jt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,He(Bo,Jt),Jt|=r;return Dt(e,t,s,n),t.child}function h1(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=vi(t,o),Qo(t,s),n=Og(e,t,n,r,o,s),r=_g(),e!==null&&!Ut?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Rr(e,t,s)):(We&&r&&vg(t),t.flags|=1,Dt(e,t,n,s),t.child)}function my(e,t,n,r,s){if(Yt(n)){var o=!0;ru(t)}else o=!1;if(Qo(t,s),t.stateNode===null)Mc(e,t),a1(t,n,r),Wh(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=vi(t,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==r||a!==c)&&uy(t,i,r,c),Vr=!1;var d=t.memoizedState;i.state=d,au(t,r,i,s),a=t.memoizedState,l!==r||d!==a||Kt.current||Vr?(typeof u=="function"&&(Vh(t,n,u,r),a=t.memoizedState),(l=Vr||cy(t,n,l,r,d,a,c))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),i.props=r,i.state=a,i.context=c,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Hb(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:Nn(t.type,l),i.props=c,f=t.pendingProps,d=i.context,a=n.contextType,typeof a=="object"&&a!==null?a=bn(a):(a=Yt(n)?to:_t.current,a=vi(t,a));var g=n.getDerivedStateFromProps;(u=typeof g=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==f||d!==a)&&uy(t,i,r,a),Vr=!1,d=t.memoizedState,i.state=d,au(t,r,i,s);var x=t.memoizedState;l!==f||d!==x||Kt.current||Vr?(typeof g=="function"&&(Vh(t,n,g,r),x=t.memoizedState),(c=Vr||cy(t,n,c,r,d,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&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===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&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return Kh(e,t,n,r,o,s)}function Kh(e,t,n,r,s,o){h1(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return s&&ty(t,n,!1),Rr(e,t,o);r=t.stateNode,YP.current=t;var l=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=bi(t,e.child,null,o),t.child=bi(t,null,l,o)):Dt(e,t,l,o),t.memoizedState=r.state,s&&ty(t,n,!0),t.child}function p1(e){var t=e.stateNode;t.pendingContext?ey(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ey(e,t.context,!1),Ng(e,t.containerInfo)}function yy(e,t,n,r,s){return wi(),bg(s),t.flags|=256,Dt(e,t,n,r),t.child}var Yh={dehydrated:null,treeContext:null,retryLane:0};function Gh(e){return{baseLanes:e,cachePool:null,transitions:null}}function g1(e,t,n){var r=t.pendingProps,s=Ke.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(Ke,s&1),e===null)return Hh(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=rd(i,r,0,null),e=Xs(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Gh(n),t.memoizedState=Yh,e):Ag(t,i));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return GP(e,t,i,r,l,s,n);if(o){o=r.fallback,i=t.mode,s=e.child,l=s.sibling;var a={mode:"hidden",children:r.children};return!(i&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=fs(s,a),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?o=fs(l,o):(o=Xs(o,i,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,i=e.child.memoizedState,i=i===null?Gh(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=Yh,r}return o=e.child,e=o.sibling,r=fs(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ag(e,t){return t=rd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Za(e,t,n,r){return r!==null&&bg(r),bi(t,e.child,null,n),e=Ag(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function GP(e,t,n,r,s,o,i){if(n)return t.flags&256?(t.flags&=-257,r=pf(Error(J(422))),Za(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=rd({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&&bi(t,e.child,null,i),t.child.memoizedState=Gh(i),t.memoizedState=Yh,o);if(!(t.mode&1))return Za(e,t,i,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(J(419)),r=pf(o,r,void 0),Za(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,Cr(e,s),zn(r,e,s,-1))}return Hg(),r=pf(Error(J(421))),Za(e,t,i,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=aT.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,tn=as(s.nextSibling),rn=t,We=!0,_n=null,e!==null&&(pn[gn++]=gr,pn[gn++]=mr,pn[gn++]=no,gr=e.id,mr=e.overflow,no=t),t=Ag(t,r.children),t.flags|=4096,t)}function xy(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Bh(e.return,t,n)}function gf(e,t,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=s)}function m1(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(Dt(e,t,r.children,n),r=Ke.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&&xy(e,n,t);else if(e.tag===19)xy(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(Ke,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&&cu(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),gf(t,!1,s,n,o);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&cu(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}gf(t,!0,n,null,o);break;case"together":gf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Mc(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(J(153));if(t.child!==null){for(e=t.child,n=fs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=fs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function QP(e,t,n){switch(t.tag){case 3:p1(t),wi();break;case 5:Bb(t);break;case 1:Yt(t.type)&&ru(t);break;case 4:Ng(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;He(iu,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(He(Ke,Ke.current&1),t.flags|=128,null):n&t.child.childLanes?g1(e,t,n):(He(Ke,Ke.current&1),e=Rr(e,t,n),e!==null?e.sibling:null);He(Ke,Ke.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return m1(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),He(Ke,Ke.current),r)break;return null;case 22:case 23:return t.lanes=0,f1(e,t,n)}return Rr(e,t,n)}var y1,Qh,x1,v1;y1=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}};Qh=function(){};x1=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=xh(e,s),r=xh(e,r),o=[];break;case"select":s=Ge({},s,{value:void 0}),r=Ge({},r,{value:void 0}),o=[];break;case"textarea":s=bh(e,s),r=bh(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=tu)}Eh(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"&&(Il.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"&&(Il.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)}};v1=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 Ct(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 XP(e,t,n){var r=t.pendingProps;switch(wg(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ct(t),null;case 1:return Yt(t.type)&&nu(),Ct(t),null;case 3:return r=t.stateNode,Si(),Ve(Kt),Ve(_t),Tg(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Qa(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,_n!==null&&(sp(_n),_n=null))),Qh(e,t),Ct(t),null;case 5:Pg(t);var s=Ds(Bl.current);if(n=t.type,e!==null&&t.stateNode!=null)x1(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(J(166));return Ct(t),null}if(e=Ds(er.current),Qa(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Xn]=t,r[Ll]=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":N0(r,o),Be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Be("invalid",r);break;case"textarea":T0(r,o),Be("invalid",r)}Eh(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&&Ga(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&Ga(r.textContent,l,e),s=["children",""+l]):Il.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&Be("scroll",r)}switch(n){case"input":Ha(r),P0(r,o,!0);break;case"textarea":Ha(r),I0(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=tu)}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=Kw(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[Ll]=r,y1(e,t,!1,!1),t.stateNode=e;e:{switch(i=kh(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":N0(e,r),s=xh(e,r),Be("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Ge({},r,{value:void 0}),Be("invalid",e);break;case"textarea":T0(e,r),s=bh(e,r),Be("invalid",e);break;default:s=r}Eh(n,s),l=s;for(o in l)if(l.hasOwnProperty(o)){var a=l[o];o==="style"?Qw(e,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Yw(e,a)):o==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Ol(e,a):typeof a=="number"&&Ol(e,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Il.hasOwnProperty(o)?a!=null&&o==="onScroll"&&Be("scroll",e):a!=null&&og(e,o,a,i))}switch(n){case"input":Ha(e),P0(e,r,!1);break;case"textarea":Ha(e),I0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+gs(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?qo(e,!!r.multiple,o,!1):r.defaultValue!=null&&qo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=tu)}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 Ct(t),null;case 6:if(e&&t.stateNode!=null)v1(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(J(166));if(n=Ds(Bl.current),Ds(er.current),Qa(t)){if(r=t.stateNode,n=t.memoizedProps,r[Xn]=t,(o=r.nodeValue!==n)&&(e=rn,e!==null))switch(e.tag){case 3:Ga(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ga(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 Ct(t),null;case 13:if(Ve(Ke),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(We&&tn!==null&&t.mode&1&&!(t.flags&128))Db(),wi(),t.flags|=98560,o=!1;else if(o=Qa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(J(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(J(317));o[Xn]=t}else wi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ct(t),o=!1}else _n!==null&&(sp(_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||Ke.current&1?ct===0&&(ct=3):Hg())),t.updateQueue!==null&&(t.flags|=4),Ct(t),null);case 4:return Si(),Qh(e,t),e===null&&Fl(t.stateNode.containerInfo),Ct(t),null;case 10:return kg(t.type._context),Ct(t),null;case 17:return Yt(t.type)&&nu(),Ct(t),null;case 19:if(Ve(Ke),o=t.memoizedState,o===null)return Ct(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Ji(o,!1);else{if(ct!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=cu(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(Ke,Ke.current&1|2),t.child}e=e.sibling}o.tail!==null&&tt()>ki&&(t.flags|=128,r=!0,Ji(o,!1),t.lanes=4194304)}else{if(!r)if(e=cu(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 Ct(t),null}else 2*tt()-o.renderingStartTime>ki&&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=tt(),t.sibling=null,n=Ke.current,He(Ke,r?n&1|2:n&1),t):(Ct(t),null);case 22:case 23:return Lg(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Jt&1073741824&&(Ct(t),t.subtreeFlags&6&&(t.flags|=8192)):Ct(t),null;case 24:return null;case 25:return null}throw Error(J(156,t.tag))}function ZP(e,t){switch(wg(t),t.tag){case 1:return Yt(t.type)&&nu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Si(),Ve(Kt),Ve(_t),Tg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Pg(t),null;case 13:if(Ve(Ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ve(Ke),null;case 4:return Si(),null;case 10:return kg(t.type._context),null;case 22:case 23:return Lg(),null;case 24:return null;default:return null}}var Ja=!1,It=!1,JP=typeof WeakSet=="function"?WeakSet:Set,ae=null;function Ho(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Xe(e,t,r)}else n.current=null}function Xh(e,t,n){try{n()}catch(r){Xe(e,t,r)}}var vy=!1;function eT(e,t){if(jh=Zc,e=kb(),xg(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,l=-1,a=-1,c=0,u=0,f=e,d=null;t:for(;;){for(var g;f!==n||s!==0&&f.nodeType!==3||(l=i+s),f!==o||r!==0&&f.nodeType!==3||(a=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(g=f.firstChild)!==null;)d=f,f=g;for(;;){if(f===e)break t;if(d===n&&++c===s&&(l=i),d===o&&++u===r&&(a=i),(g=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=g}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ah={focusedElem:e,selectionRange:n},Zc=!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,p=t.stateNode,m=p.getSnapshotBeforeUpdate(t.elementType===t.type?v:Nn(t.type,v),b);p.__reactInternalSnapshotBeforeUpdate=m}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(J(163))}}catch(w){Xe(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,ae=e;break}ae=t.return}return x=vy,vy=!1,x}function Sl(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&&Xh(t,n,o)}s=s.next}while(s!==r)}}function td(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 Zh(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 w1(e){var t=e.alternate;t!==null&&(e.alternate=null,w1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xn],delete t[Ll],delete t[Fh],delete t[zP],delete t[DP])),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 b1(e){return e.tag===5||e.tag===3||e.tag===4}function wy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||b1(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 Jh(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=tu));else if(r!==4&&(e=e.child,e!==null))for(Jh(e,t,n),e=e.sibling;e!==null;)Jh(e,t,n),e=e.sibling}function ep(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(ep(e,t,n),e=e.sibling;e!==null;)ep(e,t,n),e=e.sibling}var mt=null,In=!1;function zr(e,t,n){for(n=n.child;n!==null;)S1(e,t,n),n=n.sibling}function S1(e,t,n){if(Jn&&typeof Jn.onCommitFiberUnmount=="function")try{Jn.onCommitFiberUnmount(Ku,n)}catch{}switch(n.tag){case 5:It||Ho(n,t);case 6:var r=mt,s=In;mt=null,zr(e,t,n),mt=r,In=s,mt!==null&&(In?(e=mt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):mt.removeChild(n.stateNode));break;case 18:mt!==null&&(In?(e=mt,n=n.stateNode,e.nodeType===8?af(e.parentNode,n):e.nodeType===1&&af(e,n),Al(e)):af(mt,n.stateNode));break;case 4:r=mt,s=In,mt=n.stateNode.containerInfo,In=!0,zr(e,t,n),mt=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)&&Xh(n,t,i),s=s.next}while(s!==r)}zr(e,t,n);break;case 1:if(!It&&(Ho(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Xe(n,t,l)}zr(e,t,n);break;case 21:zr(e,t,n);break;case 22:n.mode&1?(It=(r=It)||n.memoizedState!==null,zr(e,t,n),It=r):zr(e,t,n);break;default:zr(e,t,n)}}function by(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new JP),t.forEach(function(r){var s=cT.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Rn(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:mt=l.stateNode,In=!1;break e;case 3:mt=l.stateNode.containerInfo,In=!0;break e;case 4:mt=l.stateNode.containerInfo,In=!0;break e}l=l.return}if(mt===null)throw Error(J(160));S1(o,i,s),mt=null,In=!1;var a=s.alternate;a!==null&&(a.return=null),s.return=null}catch(c){Xe(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)E1(t,e),t=t.sibling}function E1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Rn(t,e),Wn(e),r&4){try{Sl(3,e,e.return),td(3,e)}catch(v){Xe(e,e.return,v)}try{Sl(5,e,e.return)}catch(v){Xe(e,e.return,v)}}break;case 1:Rn(t,e),Wn(e),r&512&&n!==null&&Ho(n,n.return);break;case 5:if(Rn(t,e),Wn(e),r&512&&n!==null&&Ho(n,n.return),e.flags&32){var s=e.stateNode;try{Ol(s,"")}catch(v){Xe(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&&Uw(s,o),kh(l,i);var c=kh(l,o);for(i=0;i<a.length;i+=2){var u=a[i],f=a[i+1];u==="style"?Qw(s,f):u==="dangerouslySetInnerHTML"?Yw(s,f):u==="children"?Ol(s,f):og(s,u,f,c)}switch(l){case"input":vh(s,o);break;case"textarea":qw(s,o);break;case"select":var d=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var g=o.value;g!=null?qo(s,!!o.multiple,g,!1):d!==!!o.multiple&&(o.defaultValue!=null?qo(s,!!o.multiple,o.defaultValue,!0):qo(s,!!o.multiple,o.multiple?[]:"",!1))}s[Ll]=o}catch(v){Xe(e,e.return,v)}}break;case 6:if(Rn(t,e),Wn(e),r&4){if(e.stateNode===null)throw Error(J(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(v){Xe(e,e.return,v)}}break;case 3:if(Rn(t,e),Wn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Al(t.containerInfo)}catch(v){Xe(e,e.return,v)}break;case 4:Rn(t,e),Wn(e);break;case 13:Rn(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||(Fg=tt())),r&4&&by(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(It=(c=It)||u,Rn(t,e),It=c):Rn(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(f=ae=u;ae!==null;){switch(d=ae,g=d.child,d.tag){case 0:case 11:case 14:case 15:Sl(4,d,d.return);break;case 1:Ho(d,d.return);var x=d.stateNode;if(typeof x.componentWillUnmount=="function"){r=d,n=d.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(v){Xe(r,n,v)}}break;case 5:Ho(d,d.return);break;case 22:if(d.memoizedState!==null){Ey(f);continue}}g!==null?(g.return=d,ae=g):Ey(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{s=f.stateNode,c?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=f.stateNode,a=f.memoizedProps.style,i=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=Gw("display",i))}catch(v){Xe(e,e.return,v)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(v){Xe(e,e.return,v)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Rn(t,e),Wn(e),r&4&&by(e);break;case 21:break;default:Rn(t,e),Wn(e)}}function Wn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(b1(n)){var r=n;break e}n=n.return}throw Error(J(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Ol(s,""),r.flags&=-33);var o=wy(e);ep(e,o,s);break;case 3:case 4:var i=r.stateNode.containerInfo,l=wy(e);Jh(e,l,i);break;default:throw Error(J(161))}}catch(a){Xe(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function tT(e,t,n){ae=e,k1(e)}function k1(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||Ja;if(!i){var l=s.alternate,a=l!==null&&l.memoizedState!==null||It;l=Ja;var c=It;if(Ja=i,(It=a)&&!c)for(ae=s;ae!==null;)i=ae,a=i.child,i.tag===22&&i.memoizedState!==null?ky(s):a!==null?(a.return=i,ae=a):ky(s);for(;o!==null;)ae=o,k1(o),o=o.sibling;ae=s,Ja=l,It=c}Sy(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,ae=o):Sy(e)}}function Sy(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||td(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:Nn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&iy(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}iy(t,i,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&Al(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(J(163))}It||t.flags&512&&Zh(t)}catch(d){Xe(t,t.return,d)}}if(t===e){ae=null;break}if(n=t.sibling,n!==null){n.return=t.return,ae=n;break}ae=t.return}}function Ey(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 ky(e){for(;ae!==null;){var t=ae;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{td(4,t)}catch(a){Xe(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(a){Xe(t,s,a)}}var o=t.return;try{Zh(t)}catch(a){Xe(t,o,a)}break;case 5:var i=t.return;try{Zh(t)}catch(a){Xe(t,i,a)}}}catch(a){Xe(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 nT=Math.ceil,fu=Ir.ReactCurrentDispatcher,zg=Ir.ReactCurrentOwner,vn=Ir.ReactCurrentBatchConfig,Ie=0,pt=null,nt=null,wt=0,Jt=0,Bo=ks(0),ct=0,ql=null,so=0,nd=0,Dg=0,El=null,Wt=null,Fg=0,ki=1/0,cr=null,hu=!1,tp=null,us=null,ec=!1,rs=null,pu=0,kl=0,np=null,jc=-1,Ac=0;function $t(){return Ie&6?tt():jc!==-1?jc:jc=tt()}function ds(e){return e.mode&1?Ie&2&&wt!==0?wt&-wt:$P.transition!==null?(Ac===0&&(Ac=ab()),Ac):(e=ze,e!==0||(e=window.event,e=e===void 0?16:gb(e.type)),e):1}function zn(e,t,n,r){if(50<kl)throw kl=0,np=null,Error(J(185));xa(e,n,r),(!(Ie&2)||e!==pt)&&(e===pt&&(!(Ie&2)&&(nd|=n),ct===4&&qr(e,wt)),Gt(e,r),n===1&&Ie===0&&!(t.mode&1)&&(ki=tt()+500,Zu&&Cs()))}function Gt(e,t){var n=e.callbackNode;$N(e,t);var r=Xc(e,e===pt?wt:0);if(r===0)n!==null&&M0(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&M0(n),t===1)e.tag===0?FP(Cy.bind(null,e)):jb(Cy.bind(null,e)),jP(function(){!(Ie&6)&&Cs()}),n=null;else{switch(cb(r)){case 1:n=ug;break;case 4:n=ib;break;case 16:n=Qc;break;case 536870912:n=lb;break;default:n=Qc}n=_1(n,C1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function C1(e,t){if(jc=-1,Ac=0,Ie&6)throw Error(J(327));var n=e.callbackNode;if(Xo()&&e.callbackNode!==n)return null;var r=Xc(e,e===pt?wt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=gu(e,r);else{t=r;var s=Ie;Ie|=2;var o=N1();(pt!==e||wt!==t)&&(cr=null,ki=tt()+500,Qs(e,t));do try{oT();break}catch(l){R1(e,l)}while(!0);Eg(),fu.current=o,Ie=s,nt!==null?t=0:(pt=null,wt=0,t=ct)}if(t!==0){if(t===2&&(s=Th(e),s!==0&&(r=s,t=rp(e,s))),t===1)throw n=ql,Qs(e,0),qr(e,r),Gt(e,tt()),n;if(t===6)qr(e,r);else{if(s=e.current.alternate,!(r&30)&&!rT(s)&&(t=gu(e,r),t===2&&(o=Th(e),o!==0&&(r=o,t=rp(e,o))),t===1))throw n=ql,Qs(e,0),qr(e,r),Gt(e,tt()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(J(345));case 2:Os(e,Wt,cr);break;case 3:if(qr(e,r),(r&130023424)===r&&(t=Fg+500-tt(),10<t)){if(Xc(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){$t(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Dh(Os.bind(null,e,Wt,cr),t);break}Os(e,Wt,cr);break;case 4:if(qr(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=tt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*nT(r/1960))-r,10<r){e.timeoutHandle=Dh(Os.bind(null,e,Wt,cr),r);break}Os(e,Wt,cr);break;case 5:Os(e,Wt,cr);break;default:throw Error(J(329))}}}return Gt(e,tt()),e.callbackNode===n?C1.bind(null,e):null}function rp(e,t){var n=El;return e.current.memoizedState.isDehydrated&&(Qs(e,t).flags|=256),e=gu(e,t),e!==2&&(t=Wt,Wt=n,t!==null&&sp(t)),e}function sp(e){Wt===null?Wt=e:Wt.push.apply(Wt,e)}function rT(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 qr(e,t){for(t&=~Dg,t&=~nd,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 Cy(e){if(Ie&6)throw Error(J(327));Xo();var t=Xc(e,0);if(!(t&1))return Gt(e,tt()),null;var n=gu(e,t);if(e.tag!==0&&n===2){var r=Th(e);r!==0&&(t=r,n=rp(e,r))}if(n===1)throw n=ql,Qs(e,0),qr(e,t),Gt(e,tt()),n;if(n===6)throw Error(J(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Os(e,Wt,cr),Gt(e,tt()),null}function $g(e,t){var n=Ie;Ie|=1;try{return e(t)}finally{Ie=n,Ie===0&&(ki=tt()+500,Zu&&Cs())}}function oo(e){rs!==null&&rs.tag===0&&!(Ie&6)&&Xo();var t=Ie;Ie|=1;var n=vn.transition,r=ze;try{if(vn.transition=null,ze=1,e)return e()}finally{ze=r,vn.transition=n,Ie=t,!(Ie&6)&&Cs()}}function Lg(){Jt=Bo.current,Ve(Bo)}function Qs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,MP(n)),nt!==null)for(n=nt.return;n!==null;){var r=n;switch(wg(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&nu();break;case 3:Si(),Ve(Kt),Ve(_t),Tg();break;case 5:Pg(r);break;case 4:Si();break;case 13:Ve(Ke);break;case 19:Ve(Ke);break;case 10:kg(r.type._context);break;case 22:case 23:Lg()}n=n.return}if(pt=e,nt=e=fs(e.current,null),wt=Jt=t,ct=0,ql=null,Dg=nd=so=0,Wt=El=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 R1(e,t){do{var n=nt;try{if(Eg(),Oc.current=du,uu){for(var r=Ye.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}uu=!1}if(ro=0,ht=at=Ye=null,bl=!1,Vl=0,zg.current=null,n===null||n.return===null){ct=1,ql=t,nt=null;break}e:{var o=e,i=n.return,l=n,a=t;if(t=wt,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var c=a,u=l,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var d=u.alternate;d?(u.updateQueue=d.updateQueue,u.memoizedState=d.memoizedState,u.lanes=d.lanes):(u.updateQueue=null,u.memoizedState=null)}var g=fy(i);if(g!==null){g.flags&=-257,hy(g,i,l,o,t),g.mode&1&&dy(o,c,t),t=g,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)){dy(o,c,t),Hg();break e}a=Error(J(426))}}else if(We&&l.mode&1){var b=fy(i);if(b!==null){!(b.flags&65536)&&(b.flags|=256),hy(b,i,l,o,t),bg(Ei(a,l));break e}}o=a=Ei(a,l),ct!==4&&(ct=2),El===null?El=[o]:El.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var p=c1(o,a,t);oy(o,p);break e;case 1:l=a;var m=o.type,y=o.stateNode;if(!(o.flags&128)&&(typeof m.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(us===null||!us.has(y)))){o.flags|=65536,t&=-t,o.lanes|=t;var w=u1(o,l,t);oy(o,w);break e}}o=o.return}while(o!==null)}T1(n)}catch(E){t=E,nt===n&&n!==null&&(nt=n=n.return);continue}break}while(!0)}function N1(){var e=fu.current;return fu.current=du,e===null?du:e}function Hg(){(ct===0||ct===3||ct===2)&&(ct=4),pt===null||!(so&268435455)&&!(nd&268435455)||qr(pt,wt)}function gu(e,t){var n=Ie;Ie|=2;var r=N1();(pt!==e||wt!==t)&&(cr=null,Qs(e,t));do try{sT();break}catch(s){R1(e,s)}while(!0);if(Eg(),Ie=n,fu.current=r,nt!==null)throw Error(J(261));return pt=null,wt=0,ct}function sT(){for(;nt!==null;)P1(nt)}function oT(){for(;nt!==null&&!IN();)P1(nt)}function P1(e){var t=O1(e.alternate,e,Jt);e.memoizedProps=e.pendingProps,t===null?T1(e):nt=t,zg.current=null}function T1(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=ZP(n,t),n!==null){n.flags&=32767,nt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ct=6,nt=null;return}}else if(n=XP(n,t,Jt),n!==null){nt=n;return}if(t=t.sibling,t!==null){nt=t;return}nt=t=e}while(t!==null);ct===0&&(ct=5)}function Os(e,t,n){var r=ze,s=vn.transition;try{vn.transition=null,ze=1,iT(e,t,n,r)}finally{vn.transition=s,ze=r}return null}function iT(e,t,n,r){do Xo();while(rs!==null);if(Ie&6)throw Error(J(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(J(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(LN(e,o),e===pt&&(nt=pt=null,wt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ec||(ec=!0,_1(Qc,function(){return Xo(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=vn.transition,vn.transition=null;var i=ze;ze=1;var l=Ie;Ie|=4,zg.current=null,eT(e,n),E1(n,e),RP(Ah),Zc=!!jh,Ah=jh=null,e.current=n,tT(n),ON(),Ie=l,ze=i,vn.transition=o}else e.current=n;if(ec&&(ec=!1,rs=e,pu=s),o=e.pendingLanes,o===0&&(us=null),jN(n.stateNode),Gt(e,tt()),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(hu)throw hu=!1,e=tp,tp=null,e;return pu&1&&e.tag!==0&&Xo(),o=e.pendingLanes,o&1?e===np?kl++:(kl=0,np=e):kl=0,Cs(),null}function Xo(){if(rs!==null){var e=cb(pu),t=vn.transition,n=ze;try{if(vn.transition=null,ze=16>e?16:e,rs===null)var r=!1;else{if(e=rs,rs=null,pu=0,Ie&6)throw Error(J(331));var s=Ie;for(Ie|=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:Sl(8,u,o)}var f=u.child;if(f!==null)f.return=u,ae=f;else for(;ae!==null;){u=ae;var d=u.sibling,g=u.return;if(w1(u),u===c){ae=null;break}if(d!==null){d.return=g,ae=d;break}ae=g}}}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:Sl(9,o,o.return)}var p=o.sibling;if(p!==null){p.return=o.return,ae=p;break e}ae=o.return}}var m=e.current;for(ae=m;ae!==null;){i=ae;var y=i.child;if(i.subtreeFlags&2064&&y!==null)y.return=i,ae=y;else e:for(i=m;ae!==null;){if(l=ae,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:td(9,l)}}catch(E){Xe(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(Ie=s,Cs(),Jn&&typeof Jn.onPostCommitFiberRoot=="function")try{Jn.onPostCommitFiberRoot(Ku,e)}catch{}r=!0}return r}finally{ze=n,vn.transition=t}}return!1}function Ry(e,t,n){t=Ei(n,t),t=c1(e,t,1),e=cs(e,t,1),t=$t(),e!==null&&(xa(e,1,t),Gt(e,t))}function Xe(e,t,n){if(e.tag===3)Ry(e,e,n);else for(;t!==null;){if(t.tag===3){Ry(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(us===null||!us.has(r))){e=Ei(n,e),e=u1(t,e,1),t=cs(t,e,1),e=$t(),t!==null&&(xa(t,1,e),Gt(t,e));break}}t=t.return}}function lT(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=$t(),e.pingedLanes|=e.suspendedLanes&n,pt===e&&(wt&n)===n&&(ct===4||ct===3&&(wt&130023424)===wt&&500>tt()-Fg?Qs(e,0):Dg|=n),Gt(e,t)}function I1(e,t){t===0&&(e.mode&1?(t=Wa,Wa<<=1,!(Wa&130023424)&&(Wa=4194304)):t=1);var n=$t();e=Cr(e,t),e!==null&&(xa(e,t,n),Gt(e,n))}function aT(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),I1(e,n)}function cT(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(J(314))}r!==null&&r.delete(t),I1(e,n)}var O1;O1=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,QP(e,t,n);Ut=!!(e.flags&131072)}else Ut=!1,We&&t.flags&1048576&&Ab(t,ou,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Mc(e,t),e=t.pendingProps;var s=vi(t,_t.current);Qo(t,n),s=Og(null,t,r,e,s,n);var o=_g();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,ru(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Rg(t),s.updater=ed,t.stateNode=s,s._reactInternals=t,Wh(t,r,e,n),t=Kh(null,t,r,!0,o,n)):(t.tag=0,We&&o&&vg(t),Dt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Mc(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=dT(r),e=Nn(r,e),s){case 0:t=qh(null,t,r,e,n);break e;case 1:t=my(null,t,r,e,n);break e;case 11:t=py(null,t,r,e,n);break e;case 14:t=gy(null,t,r,Nn(r.type,e),n);break e}throw Error(J(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Nn(r,s),qh(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Nn(r,s),my(e,t,r,s,n);case 3:e:{if(p1(t),e===null)throw Error(J(387));r=t.pendingProps,o=t.memoizedState,s=o.element,Hb(e,t),au(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=Ei(Error(J(423)),t),t=yy(e,t,r,n,s);break e}else if(r!==s){s=Ei(Error(J(424)),t),t=yy(e,t,r,n,s);break e}else for(tn=as(t.stateNode.containerInfo.firstChild),rn=t,We=!0,_n=null,n=$b(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(wi(),r===s){t=Rr(e,t,n);break e}Dt(e,t,r,n)}t=t.child}return t;case 5:return Bb(t),e===null&&Hh(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,zh(r,s)?i=null:o!==null&&zh(r,o)&&(t.flags|=32),h1(e,t),Dt(e,t,i,n),t.child;case 6:return e===null&&Hh(t),null;case 13:return g1(e,t,n);case 4:return Ng(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=bi(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:Nn(r,s),py(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(iu,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=xr(-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),Bh(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(J(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Bh(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,Qo(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=Nn(r,t.pendingProps),s=Nn(r.type,s),gy(e,t,r,s,n);case 15:return d1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Nn(r,s),Mc(e,t),t.tag=1,Yt(r)?(e=!0,ru(t)):e=!1,Qo(t,n),a1(t,r,s),Wh(t,r,s,n),Kh(null,t,r,!0,e,n);case 19:return m1(e,t,n);case 22:return f1(e,t,n)}throw Error(J(156,t.tag))};function _1(e,t){return ob(e,t)}function uT(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 uT(e,t,n,r)}function Bg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function dT(e){if(typeof e=="function")return Bg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===lg)return 11;if(e===ag)return 14}return 2}function fs(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 zc(e,t,n,r,s,o){var i=2;if(r=e,typeof e=="function")Bg(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case _o:return Xs(n.children,s,o,t);case ig:i=8,s|=8;break;case ph:return e=yn(12,n,t,s|2),e.elementType=ph,e.lanes=o,e;case gh:return e=yn(13,n,t,s),e.elementType=gh,e.lanes=o,e;case mh:return e=yn(19,n,t,s),e.elementType=mh,e.lanes=o,e;case Bw:return rd(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Lw:i=10;break e;case Hw:i=9;break e;case lg:i=11;break e;case ag:i=14;break e;case Br:i=16,r=null;break e}throw Error(J(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 rd(e,t,n,r){return e=yn(22,e,r,t),e.elementType=Bw,e.lanes=n,e.stateNode={isHidden:!1},e}function mf(e,t,n){return e=yn(6,e,null,t),e.lanes=n,e}function yf(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 fT(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=Qd(0),this.expirationTimes=Qd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qd(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Vg(e,t,n,r,s,o,i,l,a){return e=new fT(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},Rg(o),e}function hT(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Oo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function M1(e){if(!e)return ms;e=e._reactInternals;e:{if(mo(e)!==e||e.tag!==1)throw Error(J(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(J(171))}if(e.tag===1){var n=e.type;if(Yt(n))return Mb(e,n,t)}return t}function j1(e,t,n,r,s,o,i,l,a){return e=Vg(n,r,!0,e,s,o,i,l,a),e.context=M1(null),n=e.current,r=$t(),s=ds(n),o=xr(r,s),o.callback=t??null,cs(n,o,s),e.current.lanes=s,xa(e,s,r),Gt(e,r),e}function sd(e,t,n,r){var s=t.current,o=$t(),i=ds(s);return n=M1(n),t.context===null?t.context=n:t.pendingContext=n,t=xr(o,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=cs(s,t,i),e!==null&&(zn(e,s,i,o),Ic(e,s,i)),i}function mu(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 Ny(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Wg(e,t){Ny(e,t),(e=e.alternate)&&Ny(e,t)}function pT(){return null}var A1=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ug(e){this._internalRoot=e}od.prototype.render=Ug.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(J(409));sd(e,t,null,null)};od.prototype.unmount=Ug.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;oo(function(){sd(null,e,null,null)}),t[kr]=null}};function od(e){this._internalRoot=e}od.prototype.unstable_scheduleHydration=function(e){if(e){var t=fb();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ur.length&&t!==0&&t<Ur[n].priority;n++);Ur.splice(n,0,e),n===0&&pb(e)}};function qg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function id(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Py(){}function gT(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var c=mu(i);o.call(c)}}var i=j1(t,r,e,0,null,!1,!1,"",Py);return e._reactRootContainer=i,e[kr]=i.current,Fl(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=mu(a);l.call(c)}}var a=Vg(e,0,!1,null,null,!1,!1,"",Py);return e._reactRootContainer=a,e[kr]=a.current,Fl(e.nodeType===8?e.parentNode:e),oo(function(){sd(t,a,n,r)}),a}function ld(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=mu(i);l.call(a)}}sd(t,i,e,s)}else i=gT(n,t,e,s,r);return mu(i)}ub=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=dl(t.pendingLanes);n!==0&&(dg(t,n|1),Gt(t,tt()),!(Ie&6)&&(ki=tt()+500,Cs()))}break;case 13:oo(function(){var r=Cr(e,1);if(r!==null){var s=$t();zn(r,e,1,s)}}),Wg(e,1)}};fg=function(e){if(e.tag===13){var t=Cr(e,134217728);if(t!==null){var n=$t();zn(t,e,134217728,n)}Wg(e,134217728)}};db=function(e){if(e.tag===13){var t=ds(e),n=Cr(e,t);if(n!==null){var r=$t();zn(n,e,t,r)}Wg(e,t)}};fb=function(){return ze};hb=function(e,t){var n=ze;try{return ze=e,t()}finally{ze=n}};Rh=function(e,t,n){switch(t){case"input":if(vh(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Xu(r);if(!s)throw Error(J(90));Ww(r),vh(r,s)}}}break;case"textarea":qw(e,n);break;case"select":t=n.value,t!=null&&qo(e,!!n.multiple,t,!1)}};Jw=$g;eb=oo;var mT={usingClientEntryPoint:!1,Events:[wa,zo,Xu,Xw,Zw,$g]},el={findFiberByHostInstance:As,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},yT={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:Ir.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=rb(e),e===null?null:e.stateNode},findFiberByHostInstance:el.findFiberByHostInstance||pT,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tc.isDisabled&&tc.supportsFiber)try{Ku=tc.inject(yT),Jn=tc}catch{}}cn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mT;cn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!qg(t))throw Error(J(200));return hT(e,t,null,n)};cn.createRoot=function(e,t){if(!qg(e))throw Error(J(299));var n=!1,r="",s=A1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Vg(e,1,!1,null,null,n,!1,r,s),e[kr]=t.current,Fl(e.nodeType===8?e.parentNode:e),new Ug(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(J(188)):(e=Object.keys(e).join(","),Error(J(268,e)));return e=rb(t),e=e===null?null:e.stateNode,e};cn.flushSync=function(e){return oo(e)};cn.hydrate=function(e,t,n){if(!id(t))throw Error(J(200));return ld(null,e,t,!0,n)};cn.hydrateRoot=function(e,t,n){if(!qg(e))throw Error(J(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",i=A1;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=j1(t,null,e,1,n??null,s,!1,o,i),e[kr]=t.current,Fl(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 od(t)};cn.render=function(e,t,n){if(!id(t))throw Error(J(200));return ld(null,e,t,!1,n)};cn.unmountComponentAtNode=function(e){if(!id(e))throw Error(J(40));return e._reactRootContainer?(oo(function(){ld(null,null,e,!1,function(){e._reactRootContainer=null,e[kr]=null})}),!0):!1};cn.unstable_batchedUpdates=$g;cn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!id(n))throw Error(J(200));if(e==null||e._reactInternals===void 0)throw Error(J(38));return ld(e,t,n,!1,r)};cn.version="18.3.1-next-f1338f8080-20240426";function z1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(z1)}catch(e){console.error(e)}}z1(),zw.exports=cn;var on=zw.exports,xT,Ty=on;xT=Ty.createRoot,Ty.hydrateRoot;function vT(e,t,n){const r=new Array(e);return new Proxy(r,{get(s,o,i){if(typeof o=="string"){const l=o.charCodeAt(0);if(l>=48&&l<=57){const a=+o;if(Number.isInteger(a)&&a>=0&&a<e){let c=s[a];if(!c){const u=t[a*2];c=s[a]={index:a,key:n(a),start:u,size:t[a*2+1],end:u+t[a*2+1],lane:0}}return c}}if(o==="length")return e}return Reflect.get(s,o,i)}})}function Io(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 Iy(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const wT=(e,t)=>Math.abs(e-t)<1.01,bT=(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 xf=()=>{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},Oy=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},ST=e=>e,ET=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},kT=(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(Oy(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(Oy(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},yu={passive:!0},CT=typeof window>"u"?!0:"onscrollend"in window,RT=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const o=e.options.useScrollendEvent&&CT;let i=0;const l=o?null:bT(s,()=>t(i,!1),e.options.isScrollingResetDelay),a=f=>()=>{i=n(r),l==null||l(),t(i,f)},c=a(!0),u=a(!1);return r.addEventListener("scroll",c,yu),o&&r.addEventListener("scrollend",u,yu),()=>{r.removeEventListener("scroll",c),o&&r.removeEventListener("scrollend",u),l==null||l.cancel()}},NT=(e,t)=>RT(e,t,n=>{const{horizontal:r,isRtl:s}=e.options;return r?n.scrollLeft*(s&&-1||1):n.scrollTop}),PT=(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"]},TT=(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})},IT=TT;class OT{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._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,s;const o={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ST,rangeExtractor:ET,onChange:()=>{},measureElement:PT,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 g=n[d];g!==void 0&&(o[d]=g)}const i=this.options;let l=null,a=null,c=!1;if(i!==void 0&&i.enabled&&o.enabled&&o.anchorTo==="end"&&this.scrollElement!==null){const d=i.count,g=o.count,x=this.getMeasurements(),v=d>0?((r=x[0])==null?void 0:r.key)??i.getItemKey(0):null,b=d>0?((s=x[d-1])==null?void 0:s.key)??i.getItemKey(d-1):null;if(g!==d||d>0&&g>0&&(o.getItemKey(0)!==v||o.getItemKey(g-1)!==b)){c=!0;const y=d>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;y&&(l=[y.key,this.getScrollOffset()-y.start]);const w=o.followOnAppend===!0?"auto":o.followOnAppend||null;w&&g>d&&this.isAtEnd(i.scrollEndThreshold)&&(d===0||o.getItemKey(g-1)!==b)&&(a=w)}}this.options=o,c&&(this.pendingMin=0,this.itemSizeCacheVersion++);let u=!1,f=0;if(l&&this.scrollOffset!==null){const[d,g]=l,x=this.getMeasurements(),{count:v,getItemKey:b}=this.options;let p=0;for(;p<v&&b(p)!==d;)p++;if(p<v){const m=x[p];if(m){const y=Math.max(0,m.start+g);y!==this.scrollOffset&&(f=y-this.scrollOffset,this.scrollOffset=y,u=!0)}}}(u||a)&&(this.pendingScrollAnchor=[u?l[0]:null,u?l[1]:0,a,f])},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=Io(()=>(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;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{if(i&&this._intendedScrollOffset===null&&o===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(o-this._intendedScrollOffset)<1.5&&(o=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(o-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const l=this.getScrollOffset();this.scrollDirection=i?l===o?this.scrollDirection:l<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const o=this.scrollElement,i=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},l=()=>{this._iosTouching=!1,!(!xf()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};o.addEventListener("touchstart",i,yu),o.addEventListener("touchend",l,yu),this.unsubs.push(()=>{o.removeEventListener("touchstart",i),o.removeEventListener("touchend",l),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[o,i,l,a]=s;o!==null&&!l&&(xf()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?a!==0&&(this._iosDeferredAdjustment+=a):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),l&&this.scrollToEnd({behavior:l})}this._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=Io(()=>[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=Io(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:l,laneAssignmentMode:a,gap:c},u)=>{const f=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const p of this.laneAssignments.keys())p>=n&&this.laneAssignments.delete(p);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(p=>{this.itemSizeCache.set(p.key,p.size)}));const d=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),l===1){const p=n*2;let m=this._flatMeasurements;if(!m||m.length<p){const E=new Float64Array(p);m&&d>0&&E.set(m.subarray(0,d*2)),m=E,this._flatMeasurements=m}let y;if(d===0)y=r+s;else{const E=d-1;y=m[E*2]+m[E*2+1]+c}for(let E=d;E<n;E++){const N=o(E),k=f.get(N),C=typeof k=="number"?k:this.options.estimateSize(E);m[E*2]=y,m[E*2+1]=C,y+=C+c}const w=vT(n,m,o);return this.measurementsCache=w,w}const g=this.measurementsCache.slice(0,d),x=new Array(l).fill(void 0),v=new Float64Array(l);let b=0;for(let p=0;p<d;p++){const m=g[p];m&&(x[m.lane]===void 0&&b++,x[m.lane]=p,v[m.lane]=m.end)}for(let p=d;p<n;p++){const m=o(p),y=this.laneAssignments.get(p);let w,E;const N=a==="estimate"||f.has(m);if(y!==void 0&&this.options.lanes>1){w=y;const P=x[w],j=P!==void 0?g[P]:void 0;E=j?j.end+c:r+s}else if(b===l){let P=0,j=v[0],F=x[0];for(let z=1;z<l;z++){const R=v[z];(R<j||R===j&&x[z]<F)&&(P=z,j=R,F=x[z])}w=P,E=j+c,N&&this.laneAssignments.set(p,w)}else w=p%this.options.lanes,E=r+s,N&&this.laneAssignments.set(p,w);const k=f.get(m),C=typeof k=="number"?k:this.options.estimateSize(p),I=E+C;g[p]={index:p,start:E,size:C,end:I,key:m,lane:w},x[w]===void 0&&b++,x[w]=p,v[w]=I}return this.measurementsCache=g,g},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Io(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,o)=>n.length===0||r===0?(this.range=null,null):(this.range=MT(n,r,s,o,o===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Io(()=>{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;if(!this.isIndexInRange(n))return;let i,l,a;const c=this._flatMeasurements;if(this.options.lanes===1&&c!==null)a=this.options.getItemKey(n),l=c[n*2],i=c[n*2+1];else{const d=this.measurementsCache[n];if(!d)return;a=d.key,l=d.start,i=d.size}const u=this.itemSizeCache.get(a)??i,f=r-u;if(f!==0){const d=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,g=d?this.getTotalSize():0,x=this.getScrollOffset()+this.scrollAdjustments,b=!this.itemSizeCache.has(a)?l<x:l+u<=x&&this.scrollDirection!=="backward",p=((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:a,start:l,size:i,end:l+i,lane:0},f,this):b);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(a,r),this.itemSizeCacheVersion++;let m=!1;d?m=this.applyScrollAdjustment(this.getTotalSize()-g):p&&(m=this.applyScrollAdjustment(f)),this.notify(m),this._retryClampedAdjustment()}},this.getVirtualItems=Io(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let o=0,i=n.length;o<i;o++){const l=n[o],a=r[l];s.push(a)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const s=this._flatMeasurements,o=this.options.lanes===1&&s!=null,i=D1(0,r.length-1,o?l=>s[l*2]:l=>Iy(r[l]).start,n);return Iy(r[i])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,s=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=n>=i+o?"end":"start"),r==="center"?n+=(s-o)/2:r==="end"&&(n-=o);const l=this.getMaxScrollOffset();return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getSize(),o=this.getScrollOffset(),i=this.measurementsCache[n];if(!i)return;if(r==="auto")if(i.end>=o+s-this.options.scrollPaddingEnd)r="end";else if(i.start<=o+this.options.scrollPaddingStart)r="start";else return[o,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const l=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,r,i.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const o=this.getOffsetForAlignment(n,r),i=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:i,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getOffsetForIndex(n,r);if(!o)return;const[i,l]=o,a=this.now();this.scrollState={index:n,align:l,behavior:s,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+n,o=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:o,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const o=r.length-1,i=this._flatMeasurements;i!=null?s=i[o*2]+i[o*2+1]:s=((n=r[o])==null?void 0:n.end)??0}else{const o=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&o.some(l=>l===null);){const l=r[i];o[l.lane]===null&&(o[l.lane]=l.end),i--}s=Math.max(...o.filter(l=>l!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&n.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){if(t===0)return!1;if(xf()&&(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&&wT(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 D1=(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 _T(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 MT(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=_T(s,o,n);let u=c;const f=n+t;for(;u<o&&s[u*2]+s[u*2+1]<f;)u++;return{startIndex:c,endIndex:u}}let l=D1(0,o,c=>e[c].start,n),a=l;if(r===1)for(;a<o&&e[a].end<n+t;)a++;else if(r>1){const c=Array(r).fill(0);for(;a<o&&c.some(f=>f<n+t);){const f=e[a];c[f.lane]=f.end,a++}const u=Array(r).fill(n+t);for(;l>=0&&u.some(f=>f>=n);){const f=e[l];u[f.lane]=f.start,l--}l=Math.max(0,l-l%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:l,endIndex:a}}const vf=typeof document<"u"?S.useLayoutEffect:S.useEffect;function jT({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const s=S.useReducer(u=>u+1,0)[1],o=S.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});o.current.enabled=t,o.current.mode=n;const i=u=>{const f=o.current;if(!f.enabled||!f.container)return;const d=u.getTotalSize();if(d!==f.lastSize){f.lastSize=d;const g=u.options.horizontal?"width":"height";f.container.style[g]=`${d}px`}},l=u=>{const f=o.current;if(!f.enabled||!f.container)return;i(u);const d=!!u.options.horizontal,g=f.mode==="transform",x=d?"left":"top",v=u.options.scrollMargin,b=u.getVirtualItems();for(const p of b){const m=p.start-v,y=u.elementsCache.get(p.key);y&&f.lastPositions.get(y)!==m&&(f.lastPositions.set(y,m),g?y.style.transform=d?`translate3d(${m}px, 0, 0)`:`translate3d(0, ${m}px, 0)`:y.style[x]=`${m}px`)}},a={...r,onChange:(u,f)=>{var d;const g=o.current;let x=!0;if(g.enabled){l(u);const v=u.range,b=g.prevRange;x=!b||b.isScrolling!==u.isScrolling||b.startIndex!==(v==null?void 0:v.startIndex)||b.endIndex!==(v==null?void 0:v.endIndex),x&&(g.prevRange=v?{startIndex:v.startIndex,endIndex:v.endIndex,isScrolling:u.isScrolling}:null)}x&&(e&&f?on.flushSync(s):s()),(d=r.onChange)==null||d.call(r,u,f)}},[c]=S.useState(()=>{const u=new OT(a);return Object.assign(u,{containerRef:f=>{const d=o.current;if(d.container=f,d.lastSize=null,f&&d.enabled){const g=u.getTotalSize();d.lastSize=g;const x=u.options.horizontal?"width":"height";f.style[x]=`${g}px`}}})});return c.setOptions(a),vf(()=>c._didMount(),[]),vf(()=>(i(c),c._willUpdate())),vf(()=>{l(c)}),c}function F1(e){return jT({observeElementRect:kT,observeElementOffset:NT,scrollToFn:IT,...e})}function mn(e){return encodeURIComponent(String(e))}function Vo(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 $1(e,t){const n=[];return op(e,(t==null?void 0:t.prefix)??"where",n),n.join("&")}function AT(e){var s;const t=[],{where:n,...r}=e.filter??{};if(n!=null&&n.length&&t.push($1(n,{prefix:"filter[where]"})),t.push(Vo(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(Vo({[o]:i}))}return e.groupByCount&&t.push(Vo({groupByCount:e.groupByCount})),e.paginate&&t.push(Vo({paginate:e.paginate})),t.filter(Boolean).join("&")}function op(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&&op(s.AND,`${o}[AND]`,n),s.OR&&s.OR.length>0&&op(s.OR,`${o}[OR]`,n)}}const zT=["equals","notEquals","contains","notContains","iContains","startsWith","endsWith","gt","gte","lt","lte","between","notBetween","in","notIn","isAnyOf","isEmpty","isNotEmpty","isNull","isNotNull","exists","notExists"],DT=["equals","notEquals","gt","gte","lt","lte"],FT=["contains","notContains","iContains","startsWith","endsWith"],$T=["in","notIn","isAnyOf"],LT=["between","notBetween"],HT=["isNull","isNotNull","isEmpty","isNotEmpty","exists","notExists"],BT=["gt","gte","lt","lte"],VT=new Set(DT),WT=new Set(FT),UT=new Set($T),qT=new Set(LT),ip=new Set(HT),KT=new Set(BT);function nc(e,t){if(!ip.has(e)){if(WT.has(e)){if(typeof t!="string")throw new Error(`Operator "${e}" expects a string value.`);return}if(qT.has(e)){if(!Array.isArray(t)||t.length!==2)throw new Error(`Operator "${e}" expects [low, high] tuple.`);return}if(UT.has(e)){if(!Array.isArray(t))throw new Error(`Operator "${e}" expects an array value.`);return}if(VT.has(e)){if(Array.isArray(t))throw new Error(`Operator "${e}" expects a scalar value, not an array. Use "in" for arrays.`);return}}}function YT(e){if(!KT.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 xu{constructor(){ye(this,"conditions",[]);ye(this,"groups",[]);ye(this,"extra",{});ye(this,"includes",[]);ye(this,"searchTerm");ye(this,"sorts",[]);ye(this,"distinctFields",[]);ye(this,"extentFields",[]);ye(this,"groupByCountSpec");ye(this,"pagination");ye(this,"version",0);ye(this,"snapshot",null);ye(this,"listeners",new Set);ye(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));ye(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;nc(s,r),this.conditions.push({field:t,operator:s,value:ip.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)?(nc(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(!zT.includes(n))throw new Error(`Unknown filter operator "${String(n)}".`);return nc(n,r),this.conditions=this.conditions.filter(s=>s.field!==t),this.conditions.push({field:t,operator:n,value:ip.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 YT(n),nc(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 xu;return t(n),this.groups.push({type:"OR",conditions:n.conditions}),this.notify(),this}and(t){const n=new xu;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=Vo(Object.fromEntries(Object.entries(s).map(([o,i])=>[`filter[${o}]`,i])))}else n=$1(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=Vo(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 GT(){return new xu}const QT={eq:"equals",ne:"notEquals",gt:"gt",gte:"gte",lt:"lt",lte:"lte",in:"in"};function _y(e){return e==="true"?!0:e==="false"?!1:e!==""&&!Number.isNaN(Number(e))?Number(e):e}function rc(e,t={},n){const r=GT(),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?QT[a]:void 0;if(!l||!u||c.length===0)continue;const f=c.join(":");r.where(`attr.${l}`,u,a==="in"?f.split("|").filter(Boolean).map(_y):_y(f))}const o=r.build();return AT({...o,filter:{...o.filter,...t.limit!==void 0&&{limit:t.limit},...t.offset!==void 0&&{offset:t.offset}},...n&&{groupByCount:n}})}function XT(e){if(typeof e=="object"&&e!==null&&"durationMs"in e){const t=e.durationMs;if(typeof t=="number")return t}}function Kg(e){const t=new Map,n=[];for(const s of e){const o=s.subId??s.name??s.process;if(o===void 0){n.push(s);continue}const i=t.get(o),l=i??{id:o,name:s.name??o,phases:[],logs:[]};i||t.set(o,l),s.name!==void 0&&(l.name=s.name),s.group!==void 0&&(l.group=s.group),s.status!==void 0?(l.terminal=s,l.status=s.status):s.phase!==void 0?l.phases.push(s):l.logs.push(s)}return{subs:[...t.values()].map(s=>{var u;const o=[...s.phases,...s.logs],i=[...o,...s.terminal?[s.terminal]:[]].map(f=>f.at),l=i.length?i.reduce((f,d)=>d<f?d:f,Number.POSITIVE_INFINITY):void 0,c=XT((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 L1={kind:"all"},ad="unknown";function Hi(e){const t=e==null?void 0:e.trim();return t||void 0}function ZT(e){return Hi(e)===void 0}function Sa(e){const t=Hi(e);if(t===void 0)return ad;const n=t.lastIndexOf("/");return n===-1?t:t.slice(n+1)||t}function JT(e,t){return e.kind!==t.kind?!1:e.kind==="origin"&&t.kind==="origin"?e.origin===t.origin:!0}function H1(e){return e.kind==="origin"?`origin:${e.origin}`:e.kind}function eI(e,t){if(t.kind==="all")return!0;const n=Hi(e.origin);return t.kind==="unknown"?n===void 0:n===t.origin}const Yg="Runs with no recorded origin: started before origins were stamped, or registered through a path whose declaring package could not be resolved. Not attributed to any library.";function tI(e){const t=new Map;let n=0,r=0;for(const o of e){r+=o.count;const i=Hi(o.origin??void 0);if(i===void 0){n+=o.count;continue}t.set(i,(t.get(i)??0)+o.count)}const s=[{filter:L1,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:Sa(o),title:o,count:t.get(o)??0});return n>0&&s.push({filter:{kind:"unknown"},label:ad,title:Yg,count:n}),s}function nI(e){return e.reduce((t,n)=>t+(ZT(n.origin??void 0)?n.count:0),0)}function rI(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 ${Sa(e.origin.origin)} match these filters.`,unclassified:e.unknownCount}:{message:"No runs match these filters."}:{message:"No runs yet."}}const My="compensate:";function sI(e){return e.startsWith(My)?e.slice(My.length):e}function oI(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 iI(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 lI=10*60*1e3;function aI(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>lI}const B1=["running","suspended","cancelling"],cI=new Set(B1);function lp(e){const t=e.lastIndexOf("@");return t===-1?e:e.slice(0,t)}function wf(e,t){const n=lp(e),r=t.filter(i=>lp(i.group)===n),s=r.some(i=>i.depth>0),o=r.some(i=>i.liveWorkers.length>0);return s&&!o}function uI(e){return e.startsWith("wh:")?`webhook ${e}`:e.startsWith("child:")?`child ${e.slice(6)}`:`signal ${e}`}function dI(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 cI.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 fI(e){return`${e.on} ${e.name}`}function V1(e,t){var s;if(e.status!=="suspended")return e.status==="pending"&&wf(e.workflow,t.health)?{status:"no-worker",detail:e.workflow}:e.status==="blocked"?{status:"no-worker",detail:e.workflow}:{status:e.status};const n=dI(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:uI(r.name)}:r.kind==="sleep"?{status:"sleeping"}:r.workerGroup&&wf(r.workerGroup,t.health)?{status:"no-worker",detail:lp(r.workerGroup)}:{status:"running"}:e.waiting?{status:"awaiting",detail:fI(e.waiting)}:wf(e.workflow,t.health)?{status:"no-worker",detail:e.workflow}:{status:"running"}}function hI(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 W1(){return typeof window<"u"&&window.__DURABLE_BASE__||"/durable"}function U1(){return typeof window<"u"&&window.__DURABLE_API__?window.__DURABLE_API__:`${W1()}/api`}async function pI(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 gI(e){if(typeof window>"u")return;const t=W1();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 Rt(e,t){const n=await fetch(U1()+e,t);if(n.status===401)throw gI(await pI(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=rc({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 Rt(s?`/runs?${s}`:"/runs")},facets(e,t,n){const r=rc({tag:e,attr:t,namespace:n});return Rt(r?`/runs/facets?${r}`:"/runs/facets")},values(e,t={},n){var s;const r=rc(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 Rt(`/runs/values?${r}`)},run(e){return Rt(`/runs/${encodeURIComponent(e)}`)},workers(){return Rt("/workers")},schedules(){return Rt("/schedules")},pauseSchedule(e){return Rt(`/schedules/${encodeURIComponent(e)}/pause`,{method:"POST"})},resumeSchedule(e){return Rt(`/schedules/${encodeURIComponent(e)}/resume`,{method:"POST"})},triggerSchedule(e){return Rt(`/schedules/${encodeURIComponent(e)}/trigger`,{method:"POST"})},topology(){return Rt("/topology")},retry(e){return Rt(`/runs/${encodeURIComponent(e)}/retry`,{method:"POST"})},retryWithInput(e,t){return Rt(`/runs/${encodeURIComponent(e)}/retry-with-input`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:t})})},bulk(e,t){const n=rc(t);return Rt(`/bulk/${e}${n?`?${n}`:""}`,{method:"POST"})},cancel(e,t){const n=t!=null&&t.compensate?"?compensate=true":"";return Rt(`/runs/${encodeURIComponent(e)}/cancel${n}`,{method:"POST"})},continue(e){return Rt(`/runs/${encodeURIComponent(e)}/continue`,{method:"POST"})},redispatch(e){return Rt(`/runs/${encodeURIComponent(e)}/redispatch`,{method:"POST"})},streamRun(e,t){const n=new EventSource(`${U1()}/runs/${encodeURIComponent(e)}/stream`);return n.onmessage=r=>{try{t(JSON.parse(r.data))}catch{}},()=>n.close()}};function vu(e){const t=e.lastIndexOf("@");return t===-1?"default":e.slice(t+1)}function wu(e){const t=e.lastIndexOf("@");return t===-1?e:e.slice(0,t)}function mI(e){const t=new Map;for(const r of e){const s=vu(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 yI(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 xI(e){var n,r;const t=new Map;for(const s of e)for(const o of s.liveWorkers){const i=wu(o.group),l=t.get(o.instanceId);if(l===void 0){t.set(o.instanceId,{instanceId:o.instanceId,partition:vu(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=vu(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 vI(e){const t=new Set,n=new Set;for(const r of e){if(r.kind!=="workflow")continue;const s=wu(r.group);r.depth>0&&t.add(s),r.liveWorkers.length>0&&n.add(s)}return[...t].filter(r=>!n.has(r)).sort()}function wI(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(wu(o.group)):o.kind==="step"&&r.add(wu(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}}const Fn={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round"};function q1(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 bI(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 SI(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 EI(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 Gg(e){return h.jsx("svg",{...Fn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"m4 12 5 5L20 6"})})}function ys(e){return h.jsx("svg",{...Fn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function kI(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 bf(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 Qg(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 CI(e){return h.jsx("svg",{...Fn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"M6 4l14 8-14 8z"})})}function Xg(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 RI={local:q1,remote:bI,sleep:SI,signal:EI,child:Xg};function Zg(e){return RI[e]??q1}const ap={local:"In-process step",remote:"Remote worker step",sleep:"Durable timer",signal:"External signal",child:"Child workflow — click to open its run"};function K1(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=K1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Y1(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=K1(e))&&(r&&(r+=" "),r+=t);return r}const jy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ay=Y1,G1=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Ay(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(c=>{const u=n==null?void 0:n[c],f=o==null?void 0:o[c];if(u===null)return null;const d=jy(u)||jy(f);return s[c][d]}),l=n&&Object.entries(n).reduce((c,u)=>{let[f,d]=u;return d===void 0||(c[f]=d),c},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:d,...g}=u;return Object.entries(g).every(x=>{let[v,b]=x;return Array.isArray(b)?b.includes({...o,...l}[v]):{...o,...l}[v]===b})?[...c,f,d]:c},[]);return Ay(e,i,a,n==null?void 0:n.class,n==null?void 0:n.className)},NI=(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},PI=(e,t)=>({classGroupId:e,validator:t}),Q1=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),bu="-",zy=[],TI="arbitrary..",II=e=>{const t=_I(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return OI(i);const l=i.split(bu),a=l[0]===""&&l.length>1?1:0;return X1(l,a,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const a=r[i],c=n[i];return a?c?NI(c,a):a:c||zy}return n[i]||zy}}},X1=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const c=X1(e,t+1,o);if(c)return c}const i=n.validators;if(i===null)return;const l=t===0?e.join(bu):e.slice(t).join(bu),a=i.length;for(let c=0;c<a;c++){const u=i[c];if(u.validator(l))return u.classGroupId}},OI=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?TI+r:void 0})(),_I=e=>{const{theme:t,classGroups:n}=e;return MI(n,t)},MI=(e,t)=>{const n=Q1();for(const r in e){const s=e[r];Jg(s,n,r,t)}return n},Jg=(e,t,n,r)=>{const s=e.length;for(let o=0;o<s;o++){const i=e[o];jI(i,t,n,r)}},jI=(e,t,n,r)=>{if(typeof e=="string"){AI(e,t,n);return}if(typeof e=="function"){zI(e,t,n,r);return}DI(e,t,n,r)},AI=(e,t,n)=>{const r=e===""?t:Z1(t,e);r.classGroupId=n},zI=(e,t,n,r)=>{if(FI(e)){Jg(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(PI(n,e))},DI=(e,t,n,r)=>{const s=Object.entries(e),o=s.length;for(let i=0;i<o;i++){const[l,a]=s[i];Jg(a,Z1(t,l),n,r)}},Z1=(e,t)=>{let n=e;const r=t.split(bu),s=r.length;for(let o=0;o<s;o++){const i=r[o];let l=n.nextPart.get(i);l||(l=Q1(),n.nextPart.set(i,l)),n=l}return n},FI=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,$I=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(o,i)=>{n[o]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let i=n[o];if(i!==void 0)return i;if((i=r[o])!==void 0)return s(o,i),i},set(o,i){o in n?n[o]=i:s(o,i)}}},cp="!",Dy=":",LI=[],Fy=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),HI=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===Dy){o.push(s.slice(a,v)),a=v+1;continue}if(b==="/"){c=v;continue}}b==="["?i++:b==="]"?i--:b==="("?l++:b===")"&&l--}const f=o.length===0?s:s.slice(a);let d=f,g=!1;f.endsWith(cp)?(d=f.slice(0,-1),g=!0):f.startsWith(cp)&&(d=f.slice(1),g=!0);const x=c&&c>a?c-a:void 0;return Fy(o,g,d,x)};if(t){const s=t+Dy,o=r;r=i=>i.startsWith(s)?o(i.slice(s.length)):Fy(LI,!1,i,void 0,!0)}if(n){const s=r;r=o=>n({className:o,parseClassName:s})}return r},BI=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}},VI=e=>({cache:$I(e.cacheSize),parseClassName:HI(e),sortModifiers:BI(e),postfixLookupClassGroupIds:WI(e),...II(e)}),WI=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},UI=/\s+/,qI=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o,postfixLookupClassGroupIds:i}=t,l=[],a=e.trim().split(UI);let c="";for(let u=a.length-1;u>=0;u-=1){const f=a[u],{isExternal:d,modifiers:g,hasImportantModifier:x,baseClassName:v,maybePostfixModifierPosition:b}=n(f);if(d){c=f+(c.length>0?" "+c:c);continue}let p=!!b,m;if(p){const k=v.substring(0,b);m=r(k);const C=m&&i[m]?r(v):void 0;C&&C!==m&&(m=C,p=!1)}else m=r(v);if(!m){if(!p){c=f+(c.length>0?" "+c:c);continue}if(m=r(v),!m){c=f+(c.length>0?" "+c:c);continue}p=!1}const y=g.length===0?"":g.length===1?g[0]:o(g).join(":"),w=x?y+cp:y,E=w+m;if(l.indexOf(E)>-1)continue;l.push(E);const N=s(m,p);for(let k=0;k<N.length;++k){const C=N[k];l.push(w+C)}c=f+(c.length>0?" "+c:c)}return c},KI=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=J1(n))&&(s&&(s+=" "),s+=r);return s},J1=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=J1(e[r]))&&(n&&(n+=" "),n+=t);return n},YI=(e,...t)=>{let n,r,s,o;const i=a=>{const c=t.reduce((u,f)=>f(u),e());return n=VI(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=qI(a,n);return s(a,u),u};return o=i,(...a)=>o(KI(...a))},GI=[],it=e=>{const t=n=>n[e]||GI;return t.isThemeGetter=!0,t},eS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,QI=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,XI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZI=/\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$/,JI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,eO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Dr=e=>QI.test(e),we=e=>!!e&&!Number.isNaN(Number(e)),Un=e=>!!e&&Number.isInteger(Number(e)),Sf=e=>e.endsWith("%")&&we(e.slice(0,-1)),or=e=>XI.test(e),nS=()=>!0,nO=e=>ZI.test(e)&&!JI.test(e),em=()=>!1,rO=e=>eO.test(e),sO=e=>tO.test(e),oO=e=>!ie(e)&&!le(e),iO=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)),lO=e=>Rs(e,oS,em),ie=e=>eS.test(e),Ps=e=>Rs(e,iS,nO),$y=e=>Rs(e,gO,we),aO=e=>Rs(e,aS,nS),cO=e=>Rs(e,lS,em),Ly=e=>Rs(e,rS,em),uO=e=>Rs(e,sS,sO),sc=e=>Rs(e,cS,rO),le=e=>tS.test(e),nl=e=>yo(e,iS),dO=e=>yo(e,lS),Hy=e=>yo(e,rS),fO=e=>yo(e,oS),hO=e=>yo(e,sS),oc=e=>yo(e,cS,!0),pO=e=>yo(e,aS,!0),Rs=(e,t,n)=>{const r=eS.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},yo=(e,t,n=!1)=>{const r=tS.exec(e);return r?r[1]?t(r[1]):n:!1},rS=e=>e==="position"||e==="percentage",sS=e=>e==="image"||e==="url",oS=e=>e==="length"||e==="size"||e==="bg-size",iS=e=>e==="length",gO=e=>e==="number",lS=e=>e==="family-name",aS=e=>e==="number"||e==="weight",cS=e=>e==="shadow",mO=()=>{const e=it("color"),t=it("font"),n=it("text"),r=it("font-weight"),s=it("tracking"),o=it("leading"),i=it("breakpoint"),l=it("container"),a=it("spacing"),c=it("radius"),u=it("shadow"),f=it("inset-shadow"),d=it("text-shadow"),g=it("drop-shadow"),x=it("blur"),v=it("perspective"),b=it("aspect"),p=it("ease"),m=it("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=()=>[Dr,"full","auto",...C()],P=()=>[Un,"none","subgrid",le,ie],j=()=>["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"],_=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...C()],$=()=>[Dr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],T=()=>[Dr,"screen","full","dvw","lvw","svw","min","max","fit",...C()],A=()=>[Dr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],M=()=>[e,le,ie],W=()=>[...w(),Hy,Ly,{position:[le,ie]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],K=()=>["auto","cover","contain",fO,lO,{size:[le,ie]}],U=()=>[Sf,nl,Ps],V=()=>["","none","full",c,le,ie],B=()=>["",we,nl,Ps],q=()=>["solid","dashed","dotted","double"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[we,Sf,Hy,Ly],te=()=>["","none",x,le,ie],Z=()=>["none",we,le,ie],G=()=>["none",we,le,ie],X=()=>[we,le,ie],ne=()=>[Dr,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[or],breakpoint:[or],color:[nS],container:[or],"drop-shadow":[or],ease:["in","out","in-out"],font:[oO],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[or],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[or],shadow:[or],spacing:["px",we],text:[or],"text-shadow":[or],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Dr,ie,le,b]}],container:["container"],"container-type":[{"@container":["","normal","size",le,ie]}],"container-named":[iO],columns:[{columns:[we,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:[Dr,"full","auto",l,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[we,Dr,"auto","initial","none",ie]}],grow:[{grow:["",we,le,ie]}],shrink:[{shrink:["",we,le,ie]}],order:[{order:[Un,"first","last","none",le,ie]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:j()}],"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":[..._(),"normal"]}],"justify-self":[{"justify-self":["auto",..._()]}],"align-content":[{content:["normal",...R()]}],"align-items":[{items:[..._(),{baseline:["","last"]}]}],"align-self":[{self:["auto",..._(),{baseline:["","last"]}]}],"place-content":[{"place-content":R()}],"place-items":[{"place-items":[..._(),"baseline"]}],"place-self":[{"place-self":["auto",..._()]}],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:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"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",...A()]}],"min-block-size":[{"min-block":["auto",...A()]}],"max-block-size":[{"max-block":["none",...A()]}],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,Ps]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,pO,aO]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Sf,ie]}],"font-family":[{font:[dO,cO,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":[we,"none",le,$y]}],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:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:[we,"from-font","auto",le,Ps]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[we,"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:W()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:K()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Un,le,ie],radial:["",le,ie],conic:[Un,le,ie]},hO,uO]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"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:[...q(),"hidden","none"]}],"divide-style":[{divide:[...q(),"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:[...q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[we,le,ie]}],"outline-w":[{outline:["",we,nl,Ps]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",u,oc,sc]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",f,oc,sc]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[we,Ps]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",d,oc,sc]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[we,le,ie]}],"mix-blend":[{"mix-blend":[...H(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":H()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[we]}],"mask-image-linear-from-pos":[{"mask-linear-from":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":[we]}],"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:W()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:K()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",le,ie]}],filter:[{filter:["","none",le,ie]}],blur:[{blur:te()}],brightness:[{brightness:[we,le,ie]}],contrast:[{contrast:[we,le,ie]}],"drop-shadow":[{"drop-shadow":["","none",g,oc,sc]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",we,le,ie]}],"hue-rotate":[{"hue-rotate":[we,le,ie]}],invert:[{invert:["",we,le,ie]}],saturate:[{saturate:[we,le,ie]}],sepia:[{sepia:["",we,le,ie]}],"backdrop-filter":[{"backdrop-filter":["","none",le,ie]}],"backdrop-blur":[{"backdrop-blur":te()}],"backdrop-brightness":[{"backdrop-brightness":[we,le,ie]}],"backdrop-contrast":[{"backdrop-contrast":[we,le,ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",we,le,ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[we,le,ie]}],"backdrop-invert":[{"backdrop-invert":["",we,le,ie]}],"backdrop-opacity":[{"backdrop-opacity":[we,le,ie]}],"backdrop-saturate":[{"backdrop-saturate":[we,le,ie]}],"backdrop-sepia":[{"backdrop-sepia":["",we,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:[we,"initial",le,ie]}],ease:[{ease:["linear","initial",p,le,ie]}],delay:[{delay:[we,le,ie]}],animate:[{animate:["none",m,le,ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,le,ie]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Z()}],"rotate-x":[{"rotate-x":Z()}],"rotate-y":[{"rotate-y":Z()}],"rotate-z":[{"rotate-z":Z()}],scale:[{scale:G()}],"scale-x":[{"scale-x":G()}],"scale-y":[{"scale-y":G()}],"scale-z":[{"scale-z":G()}],"scale-3d":["scale-3d"],skew:[{skew:X()}],"skew-x":[{"skew-x":X()}],"skew-y":[{"skew-y":X()}],transform:[{transform:[le,ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ne()}],"translate-x":[{"translate-x":ne()}],"translate-y":[{"translate-y":ne()}],"translate-z":[{"translate-z":ne()}],"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:[we,nl,Ps,$y]}],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"]}},yO=YI(mO);function rt(...e){return yO(Y1(e))}const uS=G1("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"}}),yt=S.forwardRef(({className:e,variant:t,...n},r)=>h.jsx("span",{ref:r,className:rt(uS({variant:t}),e),...n}));yt.displayName="Badge";const xO=G1("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:rt(xO({variant:t,size:n}),e),...s}));je.displayName="Button";const tm=S.forwardRef(({className:e,...t},n)=>h.jsx("input",{ref:n,className:rt("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}));tm.displayName="Input";const By={};function En(e,t){const n=S.useRef(By);return n.current===By&&(n.current=e(t)),n}const up=[];let dp;function vO(){return dp}function wO(e){up.push(e)}function cd(e){const t=(n,r)=>{const s=En(bO).current;let o;try{dp=s;for(const i of up)i.before(s);o=e(n,r);for(const i of up)i.after(s);s.didInitialize=!0}finally{dp=void 0}return o};return t.displayName=e.displayName||e.name,t}function dS(e){return S.forwardRef(cd(e))}function bO(){return{didInitialize:!1}}function nm(){}const Kl=Object.freeze([]),vt=Object.freeze({});function rm(e){S.useEffect(e,Kl)}const rl=0;class kn{constructor(){ye(this,"currentId",rl);ye(this,"clear",()=>{this.currentId!==rl&&(clearTimeout(this.currentId),this.currentId=rl)});ye(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 Nr(){const e=En(kn.create).current;return rm(e.disposeEffect),e}const SO=()=>{},de=typeof document<"u"?S.useLayoutEffect:SO;function EO(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:kO,platform:CO,maxTouchPoints:RO}=EO(),ud=kO.toLowerCase(),Yl=CO.toLowerCase(),dd=/^i(os$|p)/.test(Yl)||Yl==="macintel"&&RO>1,Vy="android",fp=Yl===Vy||ud.includes(Vy),fS=!dd&&Yl.startsWith("mac");Yl.startsWith("win");const NO=fS||dd;var tw;const xo=typeof CSS<"u"&&!!((tw=CSS.supports)!=null&&tw.call(CSS,"-webkit-backdrop-filter:none"));!xo&&ud.includes("firefox");!xo&&ud.includes("chrom");const PO=NO,hS=/jsdom|happydom/.test(ud);function TO(e){e.preventDefault(),e.stopPropagation()}function IO(e){return"nativeEvent"in e}function pS(e){return e.pointerType===""&&e.isTrusted?!0:fp&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function gS(e){return hS?!1:!fp&&e.width===0&&e.height===0||fp&&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 hs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function OO(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function fd(){return typeof window<"u"}function St(e){return sm(e)?(e.nodeName||"").toLowerCase():"#document"}function Je(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Or(e){var t;return(t=(sm(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sm(e){return fd()?e instanceof Node||e instanceof Je(e).Node:!1}function Ee(e){return fd()?e instanceof Element||e instanceof Je(e).Element:!1}function Le(e){return fd()?e instanceof HTMLElement||e instanceof Je(e).HTMLElement:!1}function Ci(e){return!fd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Je(e).ShadowRoot}function Ea(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 _O(e){return/^(table|td|th)$/.test(St(e))}function hd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const MO=/transform|translate|scale|rotate|perspective|filter/,jO=/paint|layout|strict|content/,Ts=e=>!!e&&e!=="none";let Ef;function om(e){const t=Ee(e)?ln(e):e;return Ts(t.transform)||Ts(t.translate)||Ts(t.scale)||Ts(t.rotate)||Ts(t.perspective)||!im()&&(Ts(t.backdropFilter)||Ts(t.filter))||MO.test(t.willChange||"")||jO.test(t.contain||"")}function AO(e){let t=xs(e);for(;Le(t)&&!ps(t);){if(om(t))return t;if(hd(t))return null;t=xs(t)}return null}function im(){return Ef==null&&(Ef=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ef}function ps(e){return/^(html|body|#document)$/.test(St(e))}function ln(e){return Je(e).getComputedStyle(e)}function pd(e){return Ee(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xs(e){if(St(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ci(e)&&e.host||Or(e);return Ci(t)?t.host:t}function mS(e){const t=xs(e);return ps(t)?(e.ownerDocument||e).body:Le(t)&&Ea(t)?t:mS(t)}function Gl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=mS(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=Je(s);if(o){const l=hp(i);return t.concat(i,i.visualViewport||[],Ea(s)?s:[],l&&n?Gl(l):[])}else return t.concat(s,Gl(s,[],n))}function hp(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&&Ci(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 pp="data-base-ui-focusable",yS="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",xS="data-starting-style",zO="data-ending-style",DO={[xS]:""},FO={[zO]:""},lm={transitionStatus(e){return e==="starting"?DO:e==="ending"?FO:null}},$O="data-open",LO="data-closed",HO="data-anchor-hidden",vS="data-popup-open",BO="data-pressed",VO={[vS]:""},WO={[vS]:"",[BO]:""},UO={[$O]:""},qO={[LO]:""},KO={[HO]:""},wS={open(e){return e?VO:null}},YO={open(e){return e?WO:null}},am={open(e){return e?UO:qO},anchorHidden(e){return e?KO:null}},cm={...am,...lm},gp="data-trigger-disabled";function Su(e,t){if(!Ee(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute(gp);for(const[,r]of t.entries())if(me(r,n))return!r.hasAttribute(gp);return!1}function kf(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 GO(e){return e.matches("html,body")}function gd(e){return Le(e)&&e.matches(yS)}function QO(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${yS}`))!=null}function Wy(e){return e?e.getAttribute("role")==="combobox"&&gd(e):!1}function XO(e){if(!e||hS)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Uy(e){return e?e.hasAttribute(pp)?e:e.querySelector(`[${pp}]`)||e:null}function ZO(e,t){return t!=null&&!hs(t)?0:typeof e=="function"?e():e}function io(e,t,n){const r=ZO(e,n);return typeof r=="number"?r:r==null?void 0:r[t]}function qy(e){return typeof e=="function"?e():e}function bS(e,t){return t||e==="click"||e==="mousedown"}function JO(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}const md="none",vs="trigger-press",xt="trigger-hover",Dc="trigger-focus",SS="outside-press",ES="close-press",Ql="focus-out",yd="escape-key",kS="disabled",Ky="missing",Yy="initial",um="imperative-action";function _e(e,t,n,r){let s=!1,o=!1;const i=r??vt;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 CS=S.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new kn,currentIdRef:{current:null},currentContextRef:{current:null}});function e_(e,t){e.current=t.current}function t_(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=Nr();return de(()=>{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(CS.Provider,{value:S.useMemo(()=>({hasProvider:!0,delayRef:s,initialDelayRef:o,currentIdRef:i,timeoutMs:r,currentContextRef:l,timeout:a}),[r,a]),children:t})}function n_(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,s=r.useState("floatingId"),o=S.useContext(CS),{currentIdRef:i,delayRef:l,timeoutMs:a,initialDelayRef:c,currentContextRef:u,hasProvider:f,timeout:d}=o,[g,x]=S.useState(!1),v=S.useRef(n);return de(()=>{v.current=n},[n]),de(()=>{function b(){var p;(p=u.current)==null||p.setIsInstantPhase(!1),i.current=null,u.current=null,l.current=c.current,d.clear()}if(i.current&&!n&&i.current===s){if(x(!1),a){const p=s;return d.start(a,()=>{r.select("open")||i.current&&i.current!==p||b()}),()=>{(v.current||i.current!==p)&&d.clear()}}b()}},[n,s,i,l,a,c,u,d,r]),de(()=>{if(!n)return;const b=u.current,p=i.current;d.clear(),u.current={onOpenChange:r.setOpen,setIsInstantPhase:x},i.current=s,l.current={open:0,close:io(c.current,"close")},p!==null&&p!==s?(x(!0),b==null||b.setIsInstantPhase(!0),b==null||b.onOpenChange(!1,_e(md))):(x(!1),b==null||b.setIsInstantPhase(!1))},[n,s,r,i,l,c,u,d]),de(()=>()=>{if(i.current===s){if(u.current=null,!v.current)return;i.current=null,e_(l,c),d.clear()}},[u,i,l,s,c,d]),S.useMemo(()=>({activeIdRef:i,hasProvider:f,delayRef:l,isInstantPhase:g}),[i,f,l,g])}function be(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function tr(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Ri(e,t,n,r){const s=En(RS).current;return s_(s,e,t,n,r)&&NS(s,[e,t,n,r]),s.callback}function r_(e){const t=En(RS).current;return o_(t,e)&&NS(t,e),t.callback}function RS(){return{callback:null,cleanup:null,refs:[]}}function s_(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function o_(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function NS(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(i_,e).current;return t.next=e,de(t.effect),t}function i_(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const dm={...IR},Cf=dm.useInsertionEffect,l_=Cf&&Cf!==dm.useLayoutEffect?Cf:e=>e();function pe(e){const t=En(a_).current;return t.next=e,l_(t.effect),t.trampoline}function a_(){const e={next:void 0,callback:c_,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function c_(){}const ic=null;class u_{constructor(){ye(this,"callbacks",[]);ye(this,"callbacksCount",0);ye(this,"nextId",1);ye(this,"startId",1);ye(this,"isScheduled",!1);ye(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 lc=new u_;class Qn{constructor(){ye(this,"currentId",ic);ye(this,"cancel",()=>{this.currentId!==ic&&(lc.cancel(this.currentId),this.currentId=ic)});ye(this,"disposeEffect",()=>this.cancel)}static create(){return new Qn}static request(t){return lc.request(t)}static cancel(t){return lc.cancel(t)}request(t){this.cancel(),this.currentId=lc.request(()=>{this.currentId=ic,t()})}}function fm(){const e=En(Qn.create).current;return rm(e.disposeEffect),e}function Ae(e){return(e==null?void 0:e.ownerDocument)||document}const d_={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},f_={...d_,position:"fixed",top:0,left:0},Ni=S.forwardRef(function(t,n){const[r,s]=S.useState();de(()=>{PO&&xo&&s("button")},[]);const o={tabIndex:0,role:r};return h.jsx("span",{...t,ref:n,style:f_,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})}),Pi=Math.min,vr=Math.max,Eu=Math.round,ac=Math.floor,wr=e=>({x:e,y:e}),h_={left:"right",right:"left",bottom:"top",top:"bottom"};function PS(e,t,n){return vr(e,Pi(t,n))}function ws(e,t){return typeof e=="function"?e(t):e}function wn(e){return e.split("-")[0]}function Pr(e){return e.split("-")[1]}function hm(e){return e==="x"?"y":"x"}function pm(e){return e==="y"?"height":"width"}function xn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function gm(e){return hm(xn(e))}function p_(e,t,n){n===void 0&&(n=!1);const r=Pr(e),s=gm(e),o=pm(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=ku(i)),[i,ku(i)]}function g_(e){const t=ku(e);return[mp(e),t,mp(t)]}function mp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Gy=["left","right"],Qy=["right","left"],m_=["top","bottom"],y_=["bottom","top"];function x_(e,t,n){switch(e){case"top":case"bottom":return n?t?Qy:Gy:t?Gy:Qy;case"left":case"right":return t?m_:y_;default:return[]}}function v_(e,t,n,r){const s=Pr(e);let o=x_(wn(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(mp)))),o}function ku(e){const t=wn(e);return h_[t]+e.slice(t.length)}function w_(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 TS(e){return typeof e!="number"?w_(e):{top:e,right:e,bottom:e,left:e}}function Cu(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 Rf(e,t){return t<0||t>=e.length}function b_(e,t){return Cl(e.current,{disabledIndices:t})}function S_(e,t){return Cl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Cl(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?!mm(s)||s.matches(":disabled")?!0:!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!1}function E_(e){return e.visibility==="hidden"||e.visibility==="collapse"}function mm(e,t=e?ln(e):null){return!e||!e.isConnected||!t||E_(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const k_='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function C_(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Ci(n)?n.host:null}function yp(e){for(const t of Array.from(e.children))if(St(t)==="summary")return t;return null}function R_(e,t){const n=yp(t);return!!n&&(e===n||me(n,e))}function IS(e){const t=e?St(e):"";return e!=null&&e.matches(k_)&&(t!=="summary"||e.parentElement!=null&&St(e.parentElement)==="details"&&yp(e.parentElement)===e)&&(t!=="details"||yp(e)==null)&&(t!=="input"||e.type!=="hidden")}function OS(e){if(!IS(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=C_(t)){const n=t!==e,r=St(t)==="slot";if(t.hasAttribute("inert")||n&&St(t)==="details"&&!t.open&&!R_(e,t)||t.hasAttribute("hidden")||!r&&!N_(t,n))return!1}return!0}function N_(e,t){const n=ln(e);return t?n.display!=="none":mm(e,n)}function _S(e){const t=e.tabIndex;if(t<0){const n=St(e);if(n==="details"||n==="audio"||n==="video"||Le(e)&&e.isContentEditable)return 0}return t}function Nf(e){if(St(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function P_(e,t){const n=Nf(e);if(!n)return!0;const r=t.find(s=>{const o=Nf(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=Nf(s);return(o==null?void 0:o.name)===n.name&&o.form===n.form})===n}function MS(e){if(Le(e)&&St(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 jS(e,t){MS(e).forEach(n=>{IS(n)&&t.push(n),jS(n,t)})}function AS(e,t,n){MS(e).forEach(r=>{Le(r)&&r.matches(t)&&n.push(r),AS(r,t,n)})}function ym(e){return OS(e)&&_S(e)>=0}function zS(e){const t=[];return jS(e,t),t.filter(OS)}function ka(e){const t=zS(e);return t.filter(n=>_S(n)>=0&&P_(n,t))}function DS(e,t){const n=ka(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 xm(e){return DS(Ae(e).body,1)||e}function FS(e){return DS(Ae(e).body,-1)||e}function $S(e,t){if(!e)return null;const n=ka(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 T_(e){return $S(e,1)}function I_(e){return $S(e,-1)}function Zo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!me(n,r)}function O_(e){ka(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Xy(e){const t=[];AS(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 bs(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>{var o;return[...!n||(o=s.context)!=null&&o.open?[s]:[],...bs(e,s.id,n)]})}function Zy(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 Xl(e){return`data-base-ui-${e}`}let cc=0;function Pf(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(cc);function o(){s&&!s()||e==null||e.focus({preventScroll:n})}if(r)return o(),nm;const i=requestAnimationFrame(o);return cc=i,()=>{cc===i&&(cancelAnimationFrame(i),cc=0)}}const Tf={inert:new WeakMap,"aria-hidden":new WeakMap},Jy="data-base-ui-inert",xp={inert:new WeakSet,"aria-hidden":new WeakSet};let sl=new WeakMap,If=0;function __(e){return xp[e]}function LS(e){return e?Ci(e)?e.host:LS(e.parentNode):null}const ex=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=LS(n);return e.contains(r)?r:null}).filter(n=>n!=null),tx=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},nx=(e,t,n)=>{const r=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(i=>{St(i)!=="script"&&(t.has(i)?s(i):r.push(i))})};return s(e),r};function M_(e,t,n,r,{mark:s=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let i=null,l=null;const a=ex(t,e),c=s?nx(t,tx(a),new Set(a)):[],u=[],f=[];if(o){const d=Tf[o],g=__(o);l=g,i=d;const x=ex(t,Array.from(t.querySelectorAll("[aria-live]"))),v=a.concat(x);nx(t,tx(v),new Set(v)).forEach(p=>{const m=p.getAttribute(o),y=m!==null&&m!=="false",w=(d.get(p)||0)+1;d.set(p,w),u.push(p),w===1&&y&&g.add(p),y||p.setAttribute(o,o==="inert"?"":"true")})}return s&&c.forEach(d=>{const g=(sl.get(d)||0)+1;sl.set(d,g),f.push(d),g===1&&d.setAttribute(Jy,"")}),If+=1,()=>{i&&u.forEach(d=>{const x=(i.get(d)||0)-1;i.set(d,x),x||(!(l!=null&&l.has(d))&&o&&d.removeAttribute(o),l==null||l.delete(d))}),s&&f.forEach(d=>{const g=(sl.get(d)||0)-1;sl.set(d,g),g||d.removeAttribute(Jy)}),If-=1,If||(Tf.inert=new WeakMap,Tf["aria-hidden"]=new WeakMap,xp.inert=new WeakSet,xp["aria-hidden"]=new WeakSet,sl=new WeakMap)}}function rx(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,o=Ae(e[0]).body;return M_(e,o,n,r,{mark:s})}let sx=0;function j_(e,t="mui"){const[n,r]=S.useState(e),s=e||n;return S.useEffect(()=>{n==null&&(sx+=1,r(`${t}-${sx}`))},[n,t]),s}const ox=dm.useId;function xd(e,t){if(ox!==void 0){const n=ox();return e??(t?`${t}-${n}`:n)}return j_(e,t)}function A_(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=A_("https://base-ui.com/production-error","Base UI"),z_=parseInt(S.version,10);function vm(e){return z_>=e}function ix(e){if(!S.isValidElement(e))return null;const t=e,n=t.props;return(vm(19)?n==null?void 0:n.ref:t.ref)??null}function vp(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function D_(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 F_(e,t){return typeof e=="function"?e(t):e}function $_(e,t){return typeof e=="function"?e(t):e}const wm={};function vd(e,t,n,r,s){if(!n&&!r&&!e)return Ru(t);let o=Ru(e);return t&&(o=Fc(o,t)),n&&(o=Fc(o,n)),r&&(o=Fc(o,r)),o}function L_(e){if(e.length===0)return wm;if(e.length===1)return Ru(e[0]);let t=Ru(e[0]);for(let n=1;n<e.length;n+=1)t=Fc(t,e[n]);return t}function Ru(e){return bm(e)?{...BS(e,wm)}:H_(e)}function Fc(e,t){return bm(t)?BS(t,e):B_(e,t)}function H_(e){const t={...e};for(const n in t){const r=t[n];HS(n,r)&&(t[n]=VS(r))}return t}function B_(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=vp(e.style,r);break}case"className":{e[n]=WS(e.className,r);break}default:HS(n,r)?e[n]=V_(e[n],r):e[n]=r}}return e}function HS(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 bm(e){return typeof e=="function"}function BS(e,t){return bm(e)?e(t):e??wm}function V_(e,t){return t?e?(...n)=>{const r=n[0];if(US(r)){const o=r;Nu(o);const i=t(...n);return o.baseUIHandlerPrevented||e==null||e(...n),i}const s=t(...n);return e==null||e(...n),s}:VS(t):e}function VS(e){return e&&((...t)=>{const n=t[0];return US(n)&&Nu(n),e(...t)})}function Nu(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function WS(e,t){return t?e?t+" "+e:t:e}function US(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Bt(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=K_(r));const s=W_(t,n,r);if(n.enabled===!1)return null;const o=n.state??vt;return Y_(e,r,s,o)}function W_(e,t,n){const{className:r,style:s}=e,{state:o=vt,ref:i,props:l,stateAttributesMapping:a,enabled:c=!0}=t,u=c?F_(r,o):void 0,f=c?$_(s,o):void 0,d=c?D_(o,a):vt,g=c&&l?U_(l):void 0,x=c?vp(d,g)??{}:vt;return typeof document<"u"&&(c?Array.isArray(i)?x.ref=r_([x.ref,ix(n),...i]):x.ref=Ri(x.ref,ix(n),i):Ri(null,null)),c?(u!==void 0&&(x.className=WS(x.className,u)),f!==void 0&&(x.style=vp(x.style,f)),x):vt}function U_(e){return Array.isArray(e)?L_(e):vd(void 0,e)}const q_=Symbol.for("react.lazy");function K_(e){if((e==null?void 0:e.$$typeof)!==q_)return e;const t=S.Children.toArray(e)[0];return S.isValidElement(t)?t:e}function Y_(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=vd(n,t.props);return s.ref=n.ref,S.cloneElement(t,s)}if(e&&typeof e=="string")return G_(e,n);throw new Error(Qt(8))}function G_(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 Q_=500,X_={style:{transition:"none"}},qS="data-base-ui-click-trigger",KS={fallbackAxisSide:"end"},Z_={clipPath:"inset(50%)",position:"fixed",top:0,left:0},YS=S.createContext(null),GS=()=>S.useContext(YS),J_=Xl("portal");function QS(e={}){const{ref:t,container:n,componentProps:r=vt,elementProps:s}=e,o=xd(),i=GS(),l=i==null?void 0:i.portalNode,[a,c]=S.useState(null),[u,f]=S.useState(null),d=pe(b=>{b!==null&&f(b)}),g=S.useRef(null);de(()=>{if(n===null){g.current&&(g.current=null,f(null),c(null));return}const b=(n&&(sm(n)?n:n.current))??l??document.body;if(b==null){g.current&&(g.current=null,f(null),c(null));return}g.current!==b&&(g.current=b,f(null),c(b))},[n,l]);const x=Bt("div",r,{ref:[t,d],props:[{id:o,[J_]:""},s]}),v=a&&x?on.createPortal(x,a):null;return{node:u,nodeId:S.isValidElement(x)?x.props.id:void 0,subtree:v}}const XS=S.forwardRef(function(t,n){const{render:r,className:s,style:o,children:i,container:l,portalOwnerRole:a,...c}=t,{node:u,nodeId:f,subtree:d}=QS({container:l,ref:n,componentProps:t,elementProps:c}),g=S.useRef(null),x=S.useRef(null),v=S.useRef(null),b=S.useRef(null),[p,m]=S.useState(null),y=S.useRef(!1),w=p==null?void 0:p.modal,E=p==null?void 0:p.open,N=!!p&&!p.modal&&p.open&&!!u;S.useEffect(()=>{if(!u||w)return;function C(I){u&&I.relatedTarget&&Zo(I)&&(I.type==="focusin"?y.current&&(Xy(u),y.current=!1):(O_(u),y.current=!0))}return tr(be(u,"focusin",C,!0),be(u,"focusout",C,!0))},[u,w]),de(()=>{!u||E!==!0||!y.current||(Xy(u),y.current=!1)},[E,u]);const k=S.useMemo(()=>({beforeOutsideRef:g,afterOutsideRef:x,beforeInsideRef:v,afterInsideRef:b,portalNode:u,setFocusManagerState:m}),[u]);return h.jsxs(S.Fragment,{children:[d,h.jsxs(YS.Provider,{value:k,children:[N&&u&&h.jsx(Ni,{"data-type":"outside",ref:g,onFocus:C=>{var I;if(Zo(C,u))(I=v.current)==null||I.focus();else{const P=p?p.domReference:null,j=FS(P);j==null||j.focus()}}}),N&&u&&h.jsx("span",{role:a,"aria-owns":f,style:Z_}),u&&on.createPortal(i,u),N&&u&&h.jsx(Ni,{"data-type":"outside",ref:x,onFocus:C=>{var I;if(Zo(C,u))(I=b.current)==null||I.focus();else{const P=p?p.domReference:null,j=xm(P);j==null||j.focus(),p!=null&&p.closeOnFocusOut&&(p==null||p.onOpenChange(!1,_e(Ql,C.nativeEvent)))}}})]})]})});function ZS(){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 eM{constructor(){ye(this,"nodesRef",{current:[]});ye(this,"events",ZS())}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 JS=S.createContext(null),eE=S.createContext(null),wd=()=>{var e;return((e=S.useContext(JS))==null?void 0:e.id)||null},Bi=e=>{const t=S.useContext(eE);return e??t};function tM(e){const t=xd(),n=Bi(e),r=wd();return de(()=>{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 nM(e){const{children:t,id:n}=e,r=wd();return h.jsx(JS.Provider,{value:S.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function rM(e){const{children:t,externalTree:n}=e,r=En(()=>n??new eM).current;return h.jsx(eE.Provider,{value:r,children:t})}function ar(e){return e==null?e:"current"in e?e.current:e}function sM(e,t){const n=Je(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 lx=20;let ss=[];function Sm(){ss=ss.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function ax(e){Sm(),e&&St(e)!=="body"&&(ss.push(new WeakRef(e)),ss.length>lx&&(ss=ss.slice(-lx)))}function cx(){var e;return Sm(),(e=ss[ss.length-1])==null?void 0:e.deref()}function oM(e){return e?ym(e)?e:ka(e)[0]||e:null}function ux(e){var s;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((s=e.getAttribute("role"))!=null&&s.includes("dialog")))return;const n=zS(e).filter(o=>{const i=o.getAttribute("data-tabindex")||"";return ym(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 tE(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:i=!1,modal:l=!0,closeOnFocusOut:a=!0,openInteractionType:c="",nextFocusableElement:u,previousFocusableElement:f,beforeContentFocusGuardRef:d,externalTree:g,getInsideElements:x}=e,v="rootStore"in t?t.rootStore:t,b=v.useState("open"),p=v.useState("domReferenceElement"),m=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=Wy(p)&&N,C=Ft(s),I=Ft(o),P=Ft(c),j=Ft(b),F=Bi(g),z=GS(),R=S.useRef(!1),_=S.useRef(!1),O=S.useRef(!1),$=S.useRef(null),T=S.useRef(""),A=S.useRef(""),M=S.useRef(null),W=S.useRef(null),L=Ri(M,d,z==null?void 0:z.beforeInsideRef),K=Ri(W,z==null?void 0:z.afterInsideRef),U=Nr(),V=Nr(),B=fm(),q=z!=null,H=Uy(m),Y=pe((G=H)=>G?ka(G):[]),te=pe(()=>(x==null?void 0:x().filter(G=>G!=null))??[]);S.useEffect(()=>{if(r||!l)return;function G(ne){ne.key==="Tab"&&me(H,hn(Ae(H)))&&Y().length===0&&!k&&TO(ne)}const X=Ae(H);return be(X,"keydown",G)},[r,H,l,k,Y]),S.useEffect(()=>{if(r||!b)return;const G=Ae(H);function X(){O.current=!1}function ne(Te){const ce=Ot(Te),ve=te(),Q=me(m,ce)||me(p,ce)||me(z==null?void 0:z.portalNode,ce)||ve.some(ge=>ge===ce||me(ge,ce));O.current=!Q,A.current=Te.pointerType||"keyboard",ce!=null&&ce.closest(`[${qS}]`)&&(_.current=!0,V.start(0,()=>{_.current=!1}))}function fe(){A.current="keyboard"}return tr(be(G,"pointerdown",ne,!0),be(G,"pointerup",X,!0),be(G,"pointercancel",X,!0),be(G,"keydown",fe,!0),X)},[r,m,p,H,b,z,V,te]),S.useEffect(()=>{if(r||!a)return;const G=Ae(H);function X(){_.current=!0,V.start(0,()=>{_.current=!1})}function ne(ve){const Q=Ot(ve);ym(Q)&&($.current=Q)}function fe(ve){const Q=ve.relatedTarget,ge=ve.currentTarget,xe=Ot(ve);l&&Q==null&&xe!=null&&me(m,xe)&&ax(xe),queueMicrotask(()=>{const Ne=E(),Pe=v.context.triggerElements,dt=te(),ot=(Q==null?void 0:Q.hasAttribute(Xl("focus-guard")))&&[M.current,W.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,ar(f),ar(u)].includes(Q),re=!(me(p,Q)||me(m,Q)||me(Q,m)||me(z==null?void 0:z.portalNode,Q)||dt.some(se=>se===Q||me(se,Q))||Pe.hasMatchingElement(se=>me(se,Q))||ot||F&&(bs(F.nodesRef.current,Ne).find(se=>{var De,Ce;return me((De=se.context)==null?void 0:De.elements.floating,Q)||me((Ce=se.context)==null?void 0:Ce.elements.domReference,Q)})||Zy(F.nodesRef.current,Ne).find(se=>{var De,Ce,Mt;return[(De=se.context)==null?void 0:De.elements.floating,Uy((Ce=se.context)==null?void 0:Ce.elements.floating)].includes(Q)||((Mt=se.context)==null?void 0:Mt.elements.domReference)===Q})));if(ge===p&&H&&ux(H),i&&ge!==p&&!mm(xe)&&hn(G)===G.body){if(Le(H)&&(H.focus(),i==="popup")){B.request(()=>{H.focus()});return}const se=Y(),De=$.current,Ce=(De&&se.includes(De)?De:null)||se[se.length-1]||H;Le(Ce)&&Ce.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(k||!l)&&Q&&re&&!_.current&&(k||Q!==cx())&&(R.current=!0,v.setOpen(!1,_e(Ql,ve)))})}function Te(){O.current||(w.current.insideReactTree=!0,U.start(0,()=>{w.current.insideReactTree=!1}))}const ce=Le(p)?p:null;if(!(!m&&!ce))return tr(ce&&be(ce,"focusout",fe),ce&&be(ce,"pointerdown",X),m&&be(m,"focusin",ne),m&&be(m,"focusout",fe),m&&z&&be(m,"focusout",Te,!0))},[r,p,m,H,l,F,z,v,a,i,Y,k,E,w,U,V,B,u,f,te]),S.useEffect(()=>{var ge,xe,Ne;if(r||!m||!b)return;const G=Array.from(((ge=z==null?void 0:z.portalNode)==null?void 0:ge.querySelectorAll(`[${Xl("portal")}]`))||[]),ne=(Ne=(xe=(F?Zy(F.nodesRef.current,E()):[]).find(Pe=>{var dt;return Wy(((dt=Pe.context)==null?void 0:dt.elements.domReference)||null)}))==null?void 0:xe.context)==null?void 0:Ne.elements.domReference,Te=[...[m,...G,M.current,W.current,z==null?void 0:z.beforeOutsideRef.current,z==null?void 0:z.afterOutsideRef.current,...te()],ne,ar(f),ar(u),k?p:null].filter(Pe=>Pe!=null),ce=rx(Te,{ariaHidden:l||k,mark:!1}),ve=[m,...G].filter(Pe=>Pe!=null),Q=rx(ve);return()=>{Q(),ce()}},[b,r,p,m,l,z,k,F,E,u,f,te]),de(()=>{if(!b||r||!Le(H))return;T.current="",A.current="";const G=Ae(H),X=hn(G);queueMicrotask(()=>{const ne=C.current,fe=typeof ne=="function"?ne(P.current||""):ne;if(fe===void 0||fe===!1||me(H,X))return;let ce=null;const ve=()=>(ce==null&&(ce=Y(H)),ce[0]||H);let Q;fe===!0||fe===null?Q=ve():Q=ar(fe),Q=Q||ve();const ge=me(H,hn(G));Pf(Q,{preventScroll:Q===H,shouldFocus(){if(!j.current)return!1;if(ge)return!0;const xe=hn(G);return!(xe!==Q&&me(H,xe))}})})},[r,b,H,Y,C,P,j]),de(()=>{if(r||!H)return;const G=Ae(H),X=hn(G),ne=P.current==null;ax(X);function fe(ce){if(ce.open||(T.current=sM(ce.nativeEvent,A.current)),ce.reason===xt&&ce.nativeEvent.type==="mouseleave"&&(R.current=!0),ce.reason===SS)if(ce.nested)R.current=!1;else if(pS(ce.nativeEvent)||gS(ce.nativeEvent))R.current=!1;else{let ve=!1;Ae(H).createElement("div").focus({get preventScroll(){return ve=!0,!1}}),ve?R.current=!1:R.current=!0}}y.on("openchange",fe);function Te(ce){const ve=I.current;let Q=typeof ve=="function"?ve(ce):ve;if(Q===void 0||Q===!1)return null;Q===null&&(Q=!0);const ge=p!=null&&p.isConnected?p:null,xe=X!=null&&X.isConnected&&St(X)!=="body"?X:null;let Ne=ne?xe||ge:ge||xe;return Ne||(Ne=cx()||null),typeof Q=="boolean"?Ne:ar(Q)||Ne||null}return()=>{y.off("openchange",fe);const ce=hn(G),ve=te(),Q=me(m,ce)||ve.some(Pe=>Pe===ce||me(Pe,ce))||F&&bs(F.nodesRef.current,E(),!1).some(Pe=>{var dt;return me((dt=Pe.context)==null?void 0:dt.elements.floating,ce)}),ge=I.current,xe=T.current,Ne=Te(xe);queueMicrotask(()=>{const Pe=oM(Ne),dt=typeof ge!="boolean";if(ge&&!R.current&&Le(Pe)&&(!(!dt&&Pe!==ce&&ce!==G.body)||Q)){const ot={preventScroll:!0};xe==="keyboard"&&(ot.focusVisible=!0),Pe.focus(ot)}R.current=!1})}},[r,m,H,I,P,y,F,p,E,te]),de(()=>{if(!xo||b||!m)return;const G=hn(Ae(m));!Le(G)||!gd(G)||me(m,G)&&G.blur()},[b,m]),de(()=>{if(!(r||!z))return z.setFocusManagerState({modal:l,closeOnFocusOut:a,open:b,onOpenChange:v.setOpen,domReference:p}),()=>{z.setFocusManagerState(null)}},[r,z,l,b,v,a,p]),de(()=>{if(!(r||!H))return ux(H),()=>{queueMicrotask(Sm)}},[r,H]);const Z=!r&&(l?!k:!0)&&(q||l);return h.jsxs(S.Fragment,{children:[Z&&h.jsx(Ni,{"data-type":"inside",ref:L,onFocus:G=>{var X;if(l){const ne=Y();Pf(ne[ne.length-1])}else if(z!=null&&z.portalNode)if(R.current=!1,Zo(G,z.portalNode)){const ne=xm(p);ne==null||ne.focus()}else(X=ar(f??z.beforeOutsideRef))==null||X.focus()}}),n,Z&&h.jsx(Ni,{"data-type":"inside",ref:K,onFocus:G=>{var X;if(l)Pf(Y()[0]);else if(z!=null&&z.portalNode)if(a&&(R.current=!0),Zo(G,z.portalNode)){const ne=FS(p);ne==null||ne.focus()}else(X=ar(u??z.afterOutsideRef))==null||X.focus()}})]})}function iM(e,t={}){const{enabled:n=!0,event:r="click",toggle:s=!0,ignoreMouse:o=!1,stickIfOpen:i=!0,touchOpenDelay:l=0,reason:a=vs}=t,c="rootStore"in e?e.rootStore:e,u=c.context.dataRef,f=S.useRef(void 0),d=fm(),g=Nr(),x=S.useMemo(()=>{function v(p,m,y,w){const E=_e(a,m,y);p&&w==="touch"&&l>0?g.start(l,()=>{c.setOpen(!0,E)}):c.setOpen(p,E)}function b(p,m,y){const w=u.current.openEvent,E=c.select("domReferenceElement")!==m;return p&&E||!p||!s?!0:w&&i?!y(w.type):!1}return{onPointerDown(p){f.current=hs(p.pointerType,!0)&&gS(p.nativeEvent)?"virtual":p.pointerType},onMouseDown(p){const m=f.current,y=p.nativeEvent,w=c.select("open");if(p.button!==0||r==="click"||hs(m,!0)&&o)return;const E=b(w,p.currentTarget,C=>C==="click"||C==="mousedown"),N=Ot(y);if(gd(N)){v(E,y,N,m);return}const k=p.currentTarget;d.request(()=>{v(E,y,k,m)})},onClick(p){if(r==="mousedown-only")return;const m=f.current;if(r==="mousedown"&&m){f.current=void 0;return}if(hs(m,!0)&&o)return;const y=c.select("open"),w=b(y,p.currentTarget,E=>E==="click"||E==="mousedown"||E==="keydown"||E==="keyup");v(w,p.nativeEvent,p.currentTarget,m)},onKeyDown(){f.current=void 0}}},[u,r,o,a,c,i,s,d,g,l]);return S.useMemo(()=>n?{reference:x}:vt,[n,x])}function lM(e,t){let n=null,r=null,s=!1;return{contextElement:e||void 0,getBoundingClientRect(){var g;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(((g=t.dataRef.current.openEvent)==null?void 0:g.type)||"")&&t.pointerType!=="touch";let c=o.width,u=o.height,f=o.x,d=o.y;return n==null&&t.x&&i&&(n=o.x-t.x),r==null&&t.y&&l&&(r=o.y-t.y),f-=n||0,d-=r||0,c=0,u=0,!s||a?(c=t.axis==="y"?o.width:0,u=t.axis==="x"?o.height:0,f=i&&t.x!=null?t.x:f,d=l&&t.y!=null?t.y:d):s&&!a&&(u=t.axis==="x"?o.height:u,c=t.axis==="y"?o.width:c),s=!0,{width:c,height:u,x:f,y:d,top:d,right:f+c,bottom:d+u,left:f}}}}function dx(e){return e!=null&&e.clientX!=null}function aM(e,t={}){const{enabled:n=!0,axis:r="both"}=t,s="rootStore"in e?e.rootStore:e,o=s.useState("open"),i=s.useState("floatingElement"),l=s.useState("domReferenceElement"),a=s.context.dataRef,c=S.useRef(!1),u=S.useRef(null),[f,d]=S.useState(),[g,x]=S.useState([]),v=pe(w=>{s.set("positionReference",w)}),b=pe((w,E,N)=>{c.current||a.current.openEvent&&!dx(a.current.openEvent)||s.set("positionReference",lM(N??l,{x:w,y:E,axis:r,dataRef:a,pointerType:f}))}),p=pe(w=>{o?u.current||(b(w.clientX,w.clientY,w.currentTarget),x([])):b(w.clientX,w.clientY,w.currentTarget)}),m=hs(f)?i:o;S.useEffect(()=>{if(!n){v(l);return}if(!m)return;function w(){var k;(k=u.current)==null||k.call(u),u.current=null}const E=Je(i);function N(k){const C=Ot(k);me(i,C)?w():b(k.clientX,k.clientY)}return!a.current.openEvent||dx(a.current.openEvent)?u.current=be(E,"mousemove",N):v(l),w},[m,n,i,a,l,s,b,v,g]),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){d(E.pointerType)}return{onPointerDown:w,onPointerEnter:w,onMouseMove:p,onMouseEnter:p}},[p]);return S.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function cM(){return!1}function uM(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 Em(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:o="sloppy",referencePress:i=cM,bubbles:l,externalTree:a}=t,c="rootStore"in e?e.rootStore:e,u=c.useState("open"),f=c.useState("floatingElement"),{dataRef:d,events:g}=c.context,x=Bi(a),v=pe(typeof s=="function"?s:()=>!1),b=typeof s=="function"?v:s,p=b!==!1,m=pe(()=>o),{escapeKey:y,outsidePress:w}=uM(l),E=S.useRef(!1),N=S.useRef(!1),k=S.useRef(!1),C=S.useRef(!1),I=S.useRef(!1),P=S.useRef(""),j=S.useRef(null),F=Nr(),z=Nr(),R=pe(()=>{z.clear(),d.current.insideReactTree=!1}),_=pe(U=>{var q;const V=(q=d.current.floatingContext)==null?void 0:q.nodeId;return(x?bs(x.nodesRef.current,V):[]).some(H=>{var Y;return((Y=H.context)==null?void 0:Y.open)&&!H.context.dataRef.current[U]})}),O=pe(U=>kf(U,c.select("floatingElement"))||kf(U,c.select("domReferenceElement"))),$=pe(U=>{i()&&c.setOpen(!1,_e(vs,U.nativeEvent))}),T=pe(U=>{if(!u||!n||!r||U.key!=="Escape"||I.current||!y&&_("__escapeKeyBubbles"))return;const V=IO(U)?U.nativeEvent:U,B=_e(yd,V);c.setOpen(!1,B),B.isCanceled||U.preventDefault(),!y&&!B.isPropagationAllowed&&U.stopPropagation()}),A=pe(()=>{d.current.insideReactTree=!0,z.start(0,R)}),M=pe(U=>{if(!u||!n||U.button!==0)return;const V=Ot(U.nativeEvent);me(c.select("floatingElement"),V)&&(E.current||(E.current=!0,N.current=!1))}),W=pe(U=>{!u||!n||(U.defaultPrevented||U.nativeEvent.defaultPrevented)&&E.current&&(N.current=!0)});S.useEffect(()=>{function U(V){V.open||(C.current=!1)}return g.on("openchange",U),()=>{g.off("openchange",U)}},[g]),S.useEffect(()=>{if(!u||!n)return u||(C.current=!1),R;d.current.__escapeKeyBubbles=y,d.current.__outsidePressBubbles=w;const U=new kn,V=new kn,B=Ae(f);function q(){U.clear(),I.current=!0}function H(){U.start(xo?5:0,()=>{I.current=!1})}function Y(){k.current=!0,V.start(0,()=>{k.current=!1})}function te(){E.current=!1,N.current=!1}function Z(){const re=P.current,se=re==="pen"||!re?"mouse":re,De=m(),Ce=typeof De=="function"?De():De;return typeof Ce=="string"?Ce:Ce[se]}function G(re){const se=Z();return se==="intentional"&&re.type!=="click"||se==="sloppy"&&re.type==="click"}function X(re){var Ce;const se=(Ce=d.current.floatingContext)==null?void 0:Ce.nodeId,De=x&&bs(x.nodesRef.current,se).some(Mt=>{var Ln;return kf(re,(Ln=Mt.context)==null?void 0:Ln.elements.floating)});return O(re)||De}function ne(re){if(G(re)){re.type!=="click"&&!O(re)&&(V.clear(),k.current=!1),R();return}if(d.current.insideReactTree){R();return}const se=Ot(re),De=`[${Xl("inert")}]`,Ce=Ee(se)?se.getRootNode():null,Mt=Array.from((Ci(Ce)?Ce:Ae(c.select("floatingElement"))).querySelectorAll(De)),Ln=c.context.triggerElements;if(se&&(Ln.hasElement(se)||Ln.hasMatchingElement(gt=>me(gt,se))))return;let Hn=Ee(se)?se:null;for(;Hn&&!ps(Hn);){const gt=xs(Hn);if(ps(gt)||!Ee(gt))break;Hn=gt}if(!(Mt.length&&Ee(se)&&!GO(se)&&!me(se,c.select("floatingElement"))&&Mt.every(gt=>!me(Hn,gt)))){if(Le(se)&&!("touches"in re)){const gt=ps(se),jr=ln(se),sr=/auto|scroll/,Bn=gt||sr.test(jr.overflowX),wo=gt||sr.test(jr.overflowY),bo=Bn&&se.clientWidth>0&&se.scrollWidth>se.clientWidth,So=wo&&se.clientHeight>0&&se.scrollHeight>se.clientHeight,Eo=jr.direction==="rtl",ko=So&&(Eo?re.offsetX<=se.offsetWidth-se.clientWidth:re.offsetX>se.clientWidth),Co=bo&&re.offsetY>se.clientHeight;if(ko||Co)return}if(!X(re)){if(Z()==="intentional"){if(re.detail!==0&&!pS(re)&&!C.current)return;if(k.current){V.clear(),k.current=!1;return}}typeof b=="function"&&!b(re)||_("__outsidePressBubbles")||(c.setOpen(!1,_e(SS,re)),R())}}}function fe(re){Z()!=="sloppy"||re.pointerType==="touch"||!c.select("open")||!n||O(re)||ne(re)}function Te(re){if(Z()!=="sloppy"||!c.select("open")||!n||O(re))return;const se=re.touches[0];se&&(j.current={startTime:Date.now(),startX:se.clientX,startY:se.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},F.start(1e3,()=>{j.current&&(j.current.dismissOnTouchEnd=!1,j.current.dismissOnMouseDown=!1)}))}function ce(re,se){const De=Ot(re);if(!De)return;const Ce=be(De,re.type,()=>{se(re),Ce()})}function ve(re){P.current="touch",ce(re,Te)}function Q(re){F.clear(),re.type==="pointerdown"&&(re.button===0&&(C.current=!0),P.current=re.pointerType),!(re.type==="mousedown"&&j.current&&!j.current.dismissOnMouseDown)&&ce(re,se=>{se.type==="pointerdown"?fe(se):ne(se)})}function ge(re){if(re.type==="pointercancel"&&(C.current=!1),!E.current)return;const se=N.current;if(te(),Z()==="intentional"){if(re.type==="pointercancel"){se&&Y();return}if(!X(re)){if(se){Y();return}typeof b=="function"&&!b(re)||(V.clear(),k.current=!0,R())}}}function xe(re){if(Z()!=="sloppy"||!j.current||O(re))return;const se=re.touches[0];if(!se)return;const De=Math.abs(se.clientX-j.current.startX),Ce=Math.abs(se.clientY-j.current.startY),Mt=Math.sqrt(De*De+Ce*Ce);Mt>5&&(j.current.dismissOnTouchEnd=!0),Mt>10&&(ne(re),F.clear(),j.current=null)}function Ne(re){ce(re,xe)}function Pe(re){Z()!=="sloppy"||!j.current||O(re)||(j.current.dismissOnTouchEnd&&ne(re),F.clear(),j.current=null)}function dt(re){ce(re,Pe)}const ot=tr(r&&tr(be(B,"keydown",T),be(B,"compositionstart",q),be(B,"compositionend",H)),p&&tr(be(B,"click",Q,!0),be(B,"pointerdown",Q,!0),be(B,"pointerup",ge,!0),be(B,"pointercancel",ge,!0),be(B,"mousedown",Q,!0),be(B,"mouseup",ge,!0),be(B,"touchstart",ve,{capture:!0,passive:!0}),be(B,"touchmove",Ne,{capture:!0,passive:!0}),be(B,"touchend",dt,{capture:!0,passive:!0})));return()=>{ot(),U.clear(),V.clear(),te(),k.current=!1,R()}},[d,f,r,p,b,u,n,y,w,T,R,m,_,O,x,c,F]);const L=S.useMemo(()=>({onKeyDown:T,onPointerDown:$,onClick:$}),[T,$]),K=S.useMemo(()=>({onKeyDown:T,onPointerDown:W,onMouseDown:W,onClickCapture:A,onMouseDownCapture(U){A(),M(U)},onPointerDownCapture(U){A(),M(U)},onMouseUpCapture:A,onTouchEndCapture:A,onTouchMoveCapture:A}),[T,A,M,W]);return S.useMemo(()=>n?{reference:L,floating:K,trigger:L}:{},[n,L,K])}function fx(e,t,n){let{reference:r,floating:s}=e;const o=xn(t),i=gm(t),l=pm(i),a=wn(t),c=o==="y",u=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,d=r[l]/2-s[l]/2;let g;switch(a){case"top":g={x:u,y:r.y-s.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-s.width,y:f};break;default:g={x:r.x,y:r.y}}const x=Pr(t);return x&&(g[i]+=d*(x==="end"?1:-1)*(n&&c?-1:1)),g}async function dM(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:i,elements:l,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:g=0}=ws(t,e),x=TS(g),b=l[d?f==="floating"?"reference":"floating":f],p=Cu(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})),m=f==="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=Cu(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:m,offsetParent:y,strategy:a}):m);return{top:(p.top-E.top+x.top)/w.y,bottom:(E.bottom-p.bottom+x.bottom)/w.y,left:(p.left-E.left+x.left)/w.x,right:(E.right-p.right+x.right)/w.x}}const fM=50,hM=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:dM},a=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:f}=fx(c,r,a),d=r,g=0;const x={};for(let v=0;v<o.length;v++){const b=o[v];if(!b)continue;const{name:p,fn:m}=b,{x:y,y:w,data:E,reset:N}=await m({x:u,y:f,initialPlacement:r,placement:d,strategy:s,middlewareData:x,rects:c,platform:l,elements:{reference:e,floating:t}});u=y??u,f=w??f,x[p]={...x[p],...E},N&&g<fM&&(g++,typeof N=="object"&&(N.placement&&(d=N.placement),N.rects&&(c=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):N.rects),{x:u,y:f}=fx(c,d,a)),v=-1)}return{x:u,y:f,placement:d,strategy:s,middlewareData:x}},pM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:i,initialPlacement:l,platform:a,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,...b}=ws(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const p=wn(s),m=xn(l),y=wn(l)===l,w=await(a.isRTL==null?void 0:a.isRTL(c.floating)),E=d||(y||!v?[ku(l)]:g_(l)),N=x!=="none";!d&&N&&E.push(...v_(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[p]),f){const R=p_(s,i,w);I.push(C[R[0]],C[R[1]])}if(P=[...P,{placement:s,overflows:I}],!I.every(R=>R<=0)){var j,F;const R=(((j=o.flip)==null?void 0:j.index)||0)+1,_=k[R];if(_&&(!(f==="alignment"?m!==xn(_):!1)||P.every(T=>xn(T.placement)===m?T.overflows[0]>0:!0)))return{data:{index:R,overflows:P},reset:{placement:_}};let O=(F=P.filter($=>$.overflows[0]<=0).sort(($,T)=>$.overflows[1]-T.overflows[1])[0])==null?void 0:F.placement;if(!O)switch(g){case"bestFit":{var z;const $=(z=P.filter(T=>{if(N){const A=xn(T.placement);return A===m||A==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(A=>A>0).reduce((A,M)=>A+M,0)]).sort((T,A)=>T[1]-A[1])[0])==null?void 0:z[0];$&&(O=$);break}case"initialPlacement":O=l;break}if(s!==O)return{reset:{placement:O}}}return{}}}},nE=new Set(["left","top"]);async function gM(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=nE.has(i)?-1:1,u=o&&a?-1:1,f=ws(t,e);let{mainAxis:d,crossAxis:g,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof x=="number"&&(g=l==="end"?x*-1:x),a?{x:g*u,y:d*c}:{x:d*c,y:g*u}}const mM=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 gM(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}}}}},yM=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:m=>{let{x:y,y:w}=m;return{x:y,y:w}}},...c}=ws(e,t),u={x:n,y:r},f=await o.detectOverflow(t,c),d=xn(s),g=hm(d);let x=u[g],v=u[d];const b=(m,y)=>PS(y+f[m==="y"?"top":"left"],y,y-f[m==="y"?"bottom":"right"]);i&&(x=b(g,x)),l&&(v=b(d,v));const p=a.fn({...t,[g]:x,[d]:v});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[g]:i,[d]:l}}}}}},xM=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:o,placement:i,rects:l,middlewareData:a}=t,{offset:c=0,mainAxis:u=!0,crossAxis:f=!0}=ws(e,t),d={x:s,y:o},g=xn(i),x=hm(g);let v=d[x],b=d[g];const p=ws(c,t),m=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:(n=p.mainAxis)!=null?n:0,crossAxis:(r=p.crossAxis)!=null?r:0};if(u){const E=x==="y"?"height":"width",N=l.reference[x]-l.floating[E]+m.mainAxis,k=l.reference[x]+l.reference[E]-m.mainAxis;v<N?v=N:v>k&&(v=k)}if(f){var y,w;const E=x==="y"?"width":"height",N=nE.has(wn(i)),k=l.reference[g]-l.floating[E]+(N&&((y=a.offset)==null?void 0:y[g])||0)+(N?0:m.crossAxis),C=l.reference[g]+l.reference[E]+(N?0:((w=a.offset)==null?void 0:w[g])||0)-(N?m.crossAxis:0);b<k?b=k:b>C&&(b=C)}return{[x]:v,[g]:b}}}},vM=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}=ws(e,t),a=await s.detectOverflow(t,l),c=wn(n),u=Pr(n),f=xn(n)==="y",{width:d,height:g}=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=g-a.top-a.bottom,p=d-a.left-a.right,m=Pi(g-a[x],b),y=Pi(d-a[v],p),w=t.middlewareData.shift,E=!w;let N=m,k=y;w!=null&&w.enabled.x&&(k=p),w!=null&&w.enabled.y&&(N=b),E&&!u&&(f?k=d-2*vr(a.left,a.right):N=g-2*vr(a.top,a.bottom)),await i({...t,availableWidth:k,availableHeight:N});const C=await s.getDimensions(o.floating);return d!==C.width||g!==C.height?{reset:{rects:!0}}:{}}}};function rE(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=Eu(n)!==o||Eu(r)!==i;return l&&(n=o,r=i),{width:n,height:r,$:l}}function km(e){return Ee(e)?e:e.contextElement}function Jo(e){const t=km(e);if(!Le(t))return wr(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=rE(t);let i=(o?Eu(n.width):n.width)/r,l=(o?Eu(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const wM=wr(0);function sE(e){const t=Je(e);return!im()||!t.visualViewport?wM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bM(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Je(e)}function lo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=km(e);let i=wr(1);t&&(r?Ee(r)&&(i=Jo(r)):i=Jo(e));const l=bM(o,n,r)?sE(o):wr(0);let a=(s.left+l.x)/i.x,c=(s.top+l.y)/i.y,u=s.width/i.x,f=s.height/i.y;if(o&&r){const d=Je(o),g=Ee(r)?Je(r):r;let x=d,v=hp(x);for(;v&&g!==x;){const b=Jo(v),p=v.getBoundingClientRect(),m=ln(v),y=p.left+(v.clientLeft+parseFloat(m.paddingLeft))*b.x,w=p.top+(v.clientTop+parseFloat(m.paddingTop))*b.y;a*=b.x,c*=b.y,u*=b.x,f*=b.y,a+=y,c+=w,x=Je(v),v=hp(x)}}return Cu({width:u,height:f,x:a,y:c})}function bd(e,t){const n=pd(e).scrollLeft;return t?t.left+n:lo(Or(e)).left+n}function oE(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-bd(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function SM(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=Or(r),l=t?hd(t.floating):!1;if(r===i||l&&o)return n;let a={scrollLeft:0,scrollTop:0},c=wr(1);const u=wr(0),f=Le(r);if((f||!o)&&((St(r)!=="body"||Ea(i))&&(a=pd(r)),f)){const g=lo(r);c=Jo(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const d=i&&!f&&!o?oE(i,a):wr(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-a.scrollTop*c.y+u.y+d.y}}function EM(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function kM(e){const t=pd(e),n=e.ownerDocument.body,r=vr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=vr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+bd(e);const i=-t.scrollTop;return ln(n).direction==="rtl"&&(o+=vr(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:o,y:i}}const CM=25;function RM(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Je(e),o=Or(e),i=s.visualViewport;let l=o.clientWidth,a=o.clientHeight,c=0,u=0;if(i){const d=!im()||t==="fixed";r?d||(c=-i.offsetLeft,u=-i.offsetTop):(l=i.width,a=i.height,d&&(c=i.offsetLeft,u=i.offsetTop))}if(bd(o)<=0){const d=o.ownerDocument,g=d.body,x=getComputedStyle(g),v=d.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,b=Math.abs(o.clientWidth-g.clientWidth-v),p=getComputedStyle(o).scrollbarGutter==="stable both-edges"?b/2:b;p<=CM&&(l-=p)}return{width:l,height:a,x:c,y:u}}function NM(e,t){const n=lo(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Jo(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 hx(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=RM(e,n,t);else if(t==="document")r=kM(Or(e));else if(Ee(t))r=NM(t,n);else{const s=sE(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Cu(r)}function PM(e,t){const n=t.get(e);if(n)return n;let r=Gl(e,[],!1).filter(l=>Ee(l)&&St(l)!=="body"),s=null;const o=ln(e).position==="fixed";let i=o?xs(e):e;for(;Ee(i)&&!ps(i);){const l=ln(i),a=om(i),c=s?s.position:o?"fixed":"";!a&&(c==="fixed"||c==="absolute"&&l.position==="static")?r=r.filter(f=>f!==i):s=l,i=xs(i)}return t.set(e,r),r}function TM(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?hd(t)?[]:PM(t,this._c):[].concat(n),r],l=hx(t,i[0],s);let a=l.top,c=l.right,u=l.bottom,f=l.left;for(let d=1;d<i.length;d++){const g=hx(t,i[d],s);a=vr(g.top,a),c=Pi(g.right,c),u=Pi(g.bottom,u),f=vr(g.left,f)}return{width:c-f,height:u-a,x:f,y:a}}function IM(e){const{width:t,height:n}=rE(e);return{width:t,height:n}}function OM(e,t,n){const r=Le(t),s=Or(t),o=n==="fixed",i=lo(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const a=wr(0);if((r||!o)&&((St(t)!=="body"||Ea(s))&&(l=pd(t)),r)){const d=lo(t,!0,o,t);a.x=d.x+t.clientLeft,a.y=d.y+t.clientTop}!r&&s&&(a.x=bd(s));const c=s&&!r&&!o?oE(s,l):wr(0),u=i.left+l.scrollLeft-a.x-c.x,f=i.top+l.scrollTop-a.y-c.y;return{x:u,y:f,width:i.width,height:i.height}}function Of(e){return ln(e).position==="static"}function px(e,t){if(!Le(e)||ln(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Or(e)===n&&(n=n.ownerDocument.body),n}function iE(e,t){const n=Je(e);if(hd(e))return n;if(!Le(e)){let s=xs(e);for(;s&&!ps(s);){if(Ee(s)&&!Of(s))return s;s=xs(s)}return n}let r=px(e,t);for(;r&&_O(r)&&Of(r);)r=px(r,t);return r&&ps(r)&&Of(r)&&!om(r)?n:r||AO(e)||n}const _M=async function(e){const t=this.getOffsetParent||iE,n=this.getDimensions,r=await n(e.floating);return{reference:OM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function MM(e){return ln(e).direction==="rtl"}const jM={convertOffsetParentRelativeRectToViewportRelativeRect:SM,getDocumentElement:Or,getClippingRect:TM,getOffsetParent:iE,getElementRects:_M,getClientRects:EM,getDimensions:IM,getScale:Jo,isElement:Ee,isRTL:MM};function lE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function AM(e,t,n){let r=null,s;const o=Or(e);function i(){var u;clearTimeout(s),(u=r)==null||u.disconnect(),r=null}function l(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),i();const d=e.getBoundingClientRect(),{left:g,top:x,width:v,height:b}=d;if(u||t(),!v||!b)return;const p=ac(x),m=ac(o.clientWidth-(g+v)),y=ac(o.clientHeight-(x+b)),w=ac(g),N={rootMargin:-p+"px "+-m+"px "+-y+"px "+-w+"px",threshold:vr(0,Pi(1,f))||1};let k=!0;function C(I){const P=I[0].intersectionRatio;if(!lE(d,e.getBoundingClientRect()))return l();if(P!==f){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=Je(e),c=()=>l(n);return a.addEventListener("resize",c),l(!0),()=>{a.removeEventListener("resize",c),i()}}function gx(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=km(e),u=s||o?[...c?Gl(c):[],...t?Gl(t):[]]:[];u.forEach(p=>{s&&p.addEventListener("scroll",n),o&&p.addEventListener("resize",n)});const f=c&&l?AM(c,n,o):null;let d=-1,g=null;i&&(g=new ResizeObserver(p=>{let[m]=p;m&&m.target===c&&g&&t&&(g.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var y;(y=g)==null||y.observe(t)})),n()}),c&&!a&&g.observe(c),t&&g.observe(t));let x,v=a?lo(e):null;a&&b();function b(){const p=lo(e);v&&!lE(v,p)&&n(),v=p,x=requestAnimationFrame(b)}return n(),()=>{var p;u.forEach(m=>{s&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),f==null||f(),(p=g)==null||p.disconnect(),g=null,a&&cancelAnimationFrame(x)}}const zM=mM,DM=yM,FM=pM,$M=vM,LM=xM,HM=(e,t,n)=>{const r=new Map,s=n??{},o={...jM,...s.platform,_c:r};return hM(e,t,{...s,platform:o})};var BM=typeof document<"u",VM=function(){},$c=BM?S.useLayoutEffect:VM;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 aE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mx(e,t){const n=aE(e);return Math.round(t*n)/n}function _f(e){const t=S.useRef(e);return $c(()=>{t.current=e}),t}function WM(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:i}={},transform:l=!0,whileElementsMounted:a,open:c}=e,[u,f]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,g]=S.useState(r);Pu(d,r)||g(r);const[x,v]=S.useState(null),[b,p]=S.useState(null),m=S.useCallback(T=>{T!==N.current&&(N.current=T,v(T))},[]),y=S.useCallback(T=>{T!==k.current&&(k.current=T,p(T))},[]),w=o||x,E=i||b,N=S.useRef(null),k=S.useRef(null),C=S.useRef(u),I=a!=null,P=_f(a),j=_f(s),F=_f(c),z=S.useCallback(()=>{if(!N.current||!k.current)return;const T={placement:t,strategy:n,middleware:d};j.current&&(T.platform=j.current),HM(N.current,k.current,T).then(A=>{const M={...A,isPositioned:F.current!==!1};R.current&&!Pu(C.current,M)&&(C.current=M,on.flushSync(()=>{f(M)}))})},[d,t,n,j,F]);$c(()=>{c===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(T=>({...T,isPositioned:!1})))},[c]);const R=S.useRef(!1);$c(()=>(R.current=!0,()=>{R.current=!1}),[]),$c(()=>{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 _=S.useMemo(()=>({reference:N,floating:k,setReference:m,setFloating:y}),[m,y]),O=S.useMemo(()=>({reference:w,floating:E}),[w,E]),$=S.useMemo(()=>{const T={position:n,left:0,top:0};if(!O.floating)return T;const A=mx(O.floating,u.x),M=mx(O.floating,u.y);return l?{...T,transform:"translate("+A+"px, "+M+"px)",...aE(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:M}},[n,l,O.floating,u.x,u.y]);return S.useMemo(()=>({...u,update:z,refs:_,elements:O,floatingStyles:$}),[u,z,_,O,$])}const UM=(e,t)=>{const n=zM(e);return{name:n.name,fn:n.fn,options:[e,t]}},qM=(e,t)=>{const n=DM(e);return{name:n.name,fn:n.fn,options:[e,t]}},KM=(e,t)=>({fn:LM(e).fn,options:[e,t]}),YM=(e,t)=>{const n=FM(e);return{name:n.name,fn:n.fn,options:[e,t]}},GM=(e,t)=>{const n=$M(e);return{name:n.name,fn:n.fn,options:[e,t]}};var cE={exports:{}},uE={};/**
|
|
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 QM(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var XM=typeof Object.is=="function"?Object.is:QM,ZM=Ti.useState,JM=Ti.useEffect,e2=Ti.useLayoutEffect,t2=Ti.useDebugValue;function n2(e,t){var n=t(),r=ZM({inst:{value:n,getSnapshot:t}}),s=r[0].inst,o=r[1];return e2(function(){s.value=n,s.getSnapshot=t,Mf(s)&&o({inst:s})},[e,n,t]),JM(function(){return Mf(s)&&o({inst:s}),e(function(){Mf(s)&&o({inst:s})})},[e]),t2(n),n}function Mf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!XM(e,n)}catch{return!0}}function r2(e,t){return t()}var s2=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r2:n2;uE.useSyncExternalStore=Ti.useSyncExternalStore!==void 0?Ti.useSyncExternalStore:s2;cE.exports=uE;var Sd=cE.exports,dE={exports:{}},fE={};/**
|
|
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 Ed=S,o2=Sd;function i2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var l2=typeof Object.is=="function"?Object.is:i2,a2=o2.useSyncExternalStore,c2=Ed.useRef,u2=Ed.useEffect,d2=Ed.useMemo,f2=Ed.useDebugValue;fE.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var o=c2(null);if(o.current===null){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=d2(function(){function a(g){if(!c){if(c=!0,u=g,g=r(g),s!==void 0&&i.hasValue){var x=i.value;if(s(x,g))return f=x}return f=g}if(x=f,l2(u,g))return x;var v=r(g);return s!==void 0&&s(x,v)?(u=g,x):(u=g,f=v)}var c=!1,u,f,d=n===void 0?null:n;return[function(){return a(t())},d===null?void 0:function(){return a(d())}]},[t,n,r,s]);var l=a2(e,o[0],o[1]);return u2(function(){i.hasValue=!0,i.value=l},[l]),f2(l),l};dE.exports=fE;var hE=dE.exports;const h2=nw(hE),p2=vm(19),g2=p2?y2:x2;function pE(e,t,n,r,s){return g2(e,t,n,r,s)}function m2(e,t,n,r,s){const o=S.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return Sd.useSyncExternalStore(e.subscribe,o,o)}wO({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()}}),Sd.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function y2(e,t,n,r,s){const o=vO();if(!o)return m2(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 x2(e,t,n,r,s){return hE.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,s))}class v2{constructor(t){ye(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));ye(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 pE(this,t,n,r,s)}}class kd extends v2{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){S.useDebugValue(t);const r=this;de(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;de(()=>(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);de(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){S.useDebugValue(t);const r=this,s=n!==void 0;de(()=>{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),pE(this,this.selectors[t],n,r,s)}useContextCallback(t,n){S.useDebugValue(t);const r=pe(n??nm);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 w2={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 gE extends kd{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:ZS(),nested:s,triggerElements:i},w2);ye(this,"syncOpenEvent",(n,r)=>{(!n||!this.state.open||r!=null&&OO(r))&&(this.context.dataRef.current.openEvent=n?r:void 0)});ye(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)});ye(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 b2(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:o,onOpenChange:i}=e,l=t.useState("open"),a=t.useState("activeTriggerElement"),c=t.useState(n?"popupElement":"positionerElement"),u=t.context.triggerElements,f=i,d=S.useRef(null);r===void 0&&d.current===null&&(d.current=new gE({open:l,transitionStatus:void 0,referenceElement:a,floatingElement:c,triggerElements:u,onOpenChange:f,floatingId:s,syncOnly:!0,nested:o}));const g=r??d.current;return t.useSyncedValue("floatingId",s),de(()=>{const x={open:l,floatingId:s,referenceElement:a,floatingElement:c};Ee(a)&&(x.domReferenceElement=a),g.state.positionReference===g.state.referenceElement&&(x.positionReference=a),g.update(x)},[l,s,a,c,g]),g.context.onOpenChange=f,g.context.nested=o,g}function mE(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),de(()=>{if(!e&&i&&s!=="ending"&&n){const a=Qn.request(()=>{o("ending")});return()=>{Qn.cancel(a)}}},[e,i,s,n]),de(()=>{if(!e||t)return;const a=Qn.request(()=>{o(void 0)});return()=>{Qn.cancel(a)}},[t,e]),de(()=>{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 uc=null;function S2(e){if(!uc){const t=[];uc=t,queueMicrotask(()=>{uc=null,on.flushSync(()=>{for(const n of t)n()})})}uc.push(e)}function yE(e,t=!1,n=!1){const r=fm();return pe((s,o=null)=>{r.cancel();const i=ar(e);if(i==null)return;const l=i,a=()=>{if(!n){on.flushSync(s);return}S2(()=>{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(f=>f.pending||f.playState!=="finished")){c();return}a()})}if(t){const u=xS;if(!l.hasAttribute(u)){r.request(c);return}const f=new MutationObserver(()=>{l.hasAttribute(u)||(f.disconnect(),c())});f.observe(l,{attributes:!0,attributeFilter:[u]}),o==null||o.addEventListener("abort",()=>f.disconnect(),{once:!0});return}r.request(c)})}function Ca(e){const{enabled:t=!0,open:n,ref:r,batch:s=!1,onComplete:o}=e,i=pe(o),l=yE(r,n,s);S.useEffect(()=>{if(!t)return;const a=new AbortController;return l(i,a.signal),()=>{a.abort()}},[t,n,i,l])}const Cm={tabIndex:-1,[pp]:""};function xE(e){return t=>t==="touch"?e.current:!0}function Rm(e,t=!1){const n=xd(),r=wd()!=null,s=En(()=>e(n,r)).current;return b2({popupStore:s,treatPopupAsFloatingElement:t,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:s.setOpen}),s}function Nm({handle:e,store:t}){return de(()=>e.attachStore(t),[e,t]),null}function yx(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function E2(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),yx(o))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),yx(t))})}function Pm(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 vE(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function k2(e,t,n,r={}){var u,f,d;const s=n.reason,o=s===xt,i=t&&s===Dc,l=!t&&(s===vs||s===yd),a=vE(n);if((f=(u=e.context).onOpenChange)==null||f.call(u,t,n),n.isCanceled)return;(d=r.onBeforeDispatch)==null||d.call(r),e.state.floatingRootContext.dispatchOpenChange(t,n);const c=()=>{const g=Pm(e.state,t,n.trigger,a()),x={...r.extraState,...g};i?x.instantType="focus":l?x.instantType="dismiss":o&&(x.instantType=void 0),e.update(x)};o?on.flushSync(c):c()}function wE(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=E2(e,n),i=pe(a=>{const c=n.select("open"),u=n.select("activeTriggerId");if(u===e){const f={activeTriggerElement:a,...c?r:null};n.update(f);return}if(u==null&&c){const f={activeTriggerId:e??null,activeTriggerElement:a,...r};n.update(f)}}),l=pe(a=>{o(a),a&&i(a)});return de(()=>(l(t.current),()=>l(null)),[l,t,n,e]),de(()=>{if(s){const a={activeTriggerElement:t.current,...r};n.update(a)}},[s,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:s}}function Tm(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");de(()=>{if(!s){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const a=e.context.triggerElements.size,c={};e.state.triggerCount!==a&&(c.triggerCount=a);const u=e.select("activeTriggerId");let f=null;if(u){const d=e.context.triggerElements.getById(u);if(d)r.current=u,d!==e.state.activeTriggerElement&&(c.activeTriggerElement=d);else{for(const[g,x]of e.context.triggerElements.entries())if(x===e.state.activeTriggerElement){c.activeTriggerId=g,c.activeTriggerElement=x,r.current=g;break}c.activeTriggerId===void 0&&(r.current===u?f=u:r.current=null)}}else r.current=null;if(!f&&!u&&a===1){const d=e.context.triggerElements.entries().next();if(!d.done){const[g,x]=d.value;c.activeTriggerId=g,c.activeTriggerElement=x,r.current=g}}(c.triggerCount!==void 0||c.activeTriggerId!==void 0||c.activeTriggerElement!==void 0)&&e.update(c),f&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===f&&!e.context.triggerElements.getById(f)){const d=_e(md);e.setOpen(!1,d),d.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,e,o,i,l,n])}function Im(e,t,n,r){const{mounted:s,setMounted:o,transitionStatus:i}=mE(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,f;o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(f=(u=t.context).onOpenChangeComplete)==null||f.call(u,!1)});return Ca({enabled:s&&!e&&!a,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:i}}function Om(e,t){e.useSyncedValues(t),de(()=>()=>{e.update({activeTriggerProps:vt,inactiveTriggerProps:vt,popupProps:vt})},[e])}function bE(e,t){de(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),de(()=>()=>{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 Mm(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new gE({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:vt,inactiveTriggerProps:vt,popupProps:vt}}const Nl=e=>e.triggerIdProp??e.activeTriggerId,jm=e=>e.openProp??e.open,xx=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function SE(e,t){return t!==void 0&&jm(e)&&Nl(e)===t}function C2(e,t){return SE(e,t)?!0:t!==void 0&&jm(e)&&Nl(e)==null&&e.triggerCount===1}const Am={open:jm,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:Nl,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:xx,isTriggerActive:(e,t)=>t!==void 0&&Nl(e)===t,isOpenedByTrigger:(e,t)=>SE(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Nl(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>C2(e,t)?xx(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function EE(e){const t=S.useCallback(r=>e===void 0?nm:e.subscribeStore(r),[e]),n=S.useCallback(()=>e===void 0?void 0:e.store,[e]);return Sd.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function R2(e){return N2(e,e.rootContext)}function N2(e,t){const{nodeId:n,externalTree:r}=e,s=t.useState("referenceElement"),o=t.useState("floatingElement"),i=t.useState("domReferenceElement"),l=t.useState("open"),a=t.useState("floatingId"),[c,u]=S.useState(null),[f,d]=S.useState(void 0),[g,x]=S.useState(void 0),v=S.useRef(null),b=Bi(r),p=S.useMemo(()=>({reference:s,floating:o,domReference:i}),[s,o,i]),m=WM({...e,elements:{...p,...c&&{reference:c}}}),y=Ee(f)?f:null,w=g===void 0?t.state.floatingElement:g;t.useSyncedValue("referenceElement",f??null),t.useSyncedValue("domReferenceElement",f===void 0?i:y),t.useSyncedValue("floatingElement",w);const E=S.useCallback(j=>{const F=Ee(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),getClientRects:()=>j.getClientRects(),contextElement:j}:j;u(F),m.refs.setReference(F)},[m.refs]),N=S.useCallback(j=>{(Ee(j)||j===null)&&(v.current=j,d(j)),(Ee(m.refs.reference.current)||m.refs.reference.current===null||j!==null&&!Ee(j))&&m.refs.setReference(j)},[m.refs,d]),k=S.useCallback(j=>{x(j),m.refs.setFloating(j)},[m.refs]),C=S.useMemo(()=>({...m.refs,setReference:N,setFloating:k,setPositionReference:E,domReference:v}),[m.refs,N,k,E]),I=S.useMemo(()=>({...m.elements,domReference:i}),[m.elements,i]),P=S.useMemo(()=>({...m,dataRef:t.context.dataRef,open:l,onOpenChange:t.setOpen,events:t.context.events,floatingId:a,refs:C,elements:I,nodeId:n,rootStore:t}),[m,C,I,n,t,l,a]);return de(()=>{i&&(v.current=i)},[i]),de(()=>{t.context.dataRef.current.floatingContext=P;const j=b==null?void 0:b.nodesRef.current.find(F=>F.id===n);j&&(j.context=P)}),S.useMemo(()=>({...m,context:P,refs:C,elements:I,rootStore:t}),[m,C,I,P,t])}const jf=fS&&xo;function P2(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=Nr();S.useEffect(()=>{const d=s.select("domReferenceElement");if(!n)return;const g=Je(d);function x(){const p=s.select("domReferenceElement");!s.select("open")&&Le(p)&&p===hn(Ae(p))&&(l.current=!0,a.current=p)}function v(){c.current=!0}function b(){c.current=!1}return tr(be(g,"blur",x),jf&&be(g,"keydown",v,!0),jf&&be(g,"pointerdown",b,!0))},[s,n]),S.useEffect(()=>{if(!n)return;function d(g){if(g.reason===vs||g.reason===yd){const x=s.select("domReferenceElement");Ee(x)&&(a.current=x,l.current=!0)}}return o.on("openchange",d),()=>{o.off("openchange",d)}},[o,n,s]);const f=S.useMemo(()=>{function d(){l.current=!1,a.current=null}return{onMouseLeave(){d()},onFocus(g){const x=g.currentTarget;if(l.current){if(a.current===x)return;d()}const v=Ot(g.nativeEvent);if(Ee(v)){if(jf&&!g.relatedTarget){if(!c.current&&!gd(v))return}else if(!XO(v))return}const b=Su(g.relatedTarget,s.context.triggerElements),{nativeEvent:p,currentTarget:m}=g,y=typeof r=="function"?r():r;if(s.select("open")&&b||y===0||y===void 0){s.setOpen(!0,_e(Dc,p,m));return}u.start(y,()=>{l.current||s.setOpen(!0,_e(Dc,p,m))})},onBlur(g){d();const x=g.relatedTarget,v=g.nativeEvent,b=Ee(x)&&x.hasAttribute(Xl("focus-guard"))&&x.getAttribute("data-type")==="outside";u.start(0,()=>{var w;const p=s.select("domReferenceElement"),m=hn(Ae(p));!x&&m===p||me((w=i.current.floatingContext)==null?void 0:w.refs.floating.current,m)||me(p,m)||b||Su(x??m,s.context.triggerElements)||s.setOpen(!1,_e(Dc,v))})}}},[i,r,s,u]);return S.useMemo(()=>n?{reference:f,trigger:f}:{},[n,f])}class zm{constructor(){ye(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});ye(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 zm}}const Tu=new WeakMap;function Iu(e){var n,r,s;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Tu.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"),Tu.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function kE(e,t){const{scopeElement:n,referenceElement:r,floatingElement:s}=t,o=Tu.get(n);o&&o!==e&&Iu(o),Iu(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=s,Tu.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",s.style.pointerEvents="auto"}function Dm(e){const t=e.context.dataRef.current,n=En(()=>t.hoverInteractionState??zm.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),rm(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function CE(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=Bi(),f=wd(),d=Dm(o),g=Nr(),x=pe(()=>{var p;return bS((p=c.current.openEvent)==null?void 0:p.type,d.interactedInside)}),v=pe(()=>{var p;return JO((p=c.current.openEvent)==null?void 0:p.type)}),b=pe(()=>{Iu(d)});de(()=>{i||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,b())},[i,d,b]),S.useEffect(()=>b,[b]),de(()=>{var p,m,y,w,E;if(n&&i&&(p=d.handleCloseOptions)!=null&&p.blockPointerEvents&&v()&&Ee(a)&&l){const N=a,k=l,C=Ae(l),I=(y=(m=u==null?void 0:u.nodesRef.current.find(z=>z.id===f))==null?void 0:m.context)==null?void 0:y.elements.floating;I&&(I.style.pointerEvents="");const P=d.pointerEventsScopeElement!==k?d.pointerEventsScopeElement:null,j=I!==k?I:null,F=((E=(w=d.handleCloseOptions)==null?void 0:w.getScope)==null?void 0:E.call(w))??P??j??N.closest("[data-rootownerid]")??C.body;return kE(d,{scopeElement:F,referenceElement:N,floatingElement:k}),()=>{b()}}},[n,i,a,l,d,v,u,f,b]),S.useEffect(()=>{if(!n)return;function p(){return!!(u&&f&&bs(u.nodesRef.current,f).length>0)}function m(C){const I=io(r,"close",d.pointerType),P=()=>{o.setOpen(!1,_e(xt,C)),u==null||u.events.emit("floating.closed",C)};I?d.openChangeTimeout.start(I,P):(d.openChangeTimeout.clear(),P())}function y(C){const I=Ot(C);if(!QO(I)){d.interactedInside=!1;return}d.interactedInside=(I==null?void 0:I.closest("[aria-haspopup]"))!=null}function w(){d.openChangeTimeout.clear(),g.clear(),u==null||u.events.off("floating.closed",N),b()}function E(C){var F;if(p()&&u){u.events.on("floating.closed",N);return}if(Su(C.relatedTarget,o.context.triggerElements))return;const I=((F=c.current.floatingContext)==null?void 0:F.nodeId)??s,P=C.relatedTarget;if(!(u&&I&&Ee(P)&&bs(u.nodesRef.current,I,!1).some(z=>{var R;return me((R=z.context)==null?void 0:R.elements.floating,P)}))){if(d.handler){d.handler(C);return}b(),v()&&!x()&&m(C)}}function N(C){!u||!f||p()||g.start(0,()=>{u.events.off("floating.closed",N),o.setOpen(!1,_e(xt,C)),u.events.emit("floating.closed",C)})}const k=l;return tr(k&&be(k,"mouseenter",w),k&&be(k,"mouseleave",E),k&&be(k,"pointerdown",y,!0),()=>{u==null||u.events.off("floating.closed",N)})},[n,l,o,c,r,s,v,x,b,d,u,f,g])}const T2={current:null};function RE(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:s=null,mouseOnly:o=!1,restMs:i=0,move:l=!0,triggerElementRef:a=T2,externalTree:c,isActiveTrigger:u=!0,getHandleCloseContext:f,isClosing:d,shouldOpen:g,guardStaleOpen:x=!1}=t,v="rootStore"in e?e.rootStore:e,{dataRef:b,events:p}=v.context,m=Bi(c),y=Dm(v),w=S.useRef(!1),E=Ft(s),N=Ft(r),k=Ft(i),C=Ft(n),I=Ft(g),P=Ft(d),j=pe(()=>{var O;return bS((O=b.current.openEvent)==null?void 0:O.type,y.interactedInside)}),F=pe(()=>{var O;return((O=I.current)==null?void 0:O.call(I))!==!1}),z=pe((O,$,T)=>{const A=v.context.triggerElements;if(A.hasElement($))return!O||!me(O,$);if(!Ee(T))return!1;const M=T;return A.hasMatchingElement(W=>me(W,M))&&(!O||!me(O,M))}),R=pe(()=>{if(!y.handler)return;Ae(v.select("domReferenceElement")).removeEventListener("mousemove",y.handler),y.handler=void 0}),_=pe(()=>{Iu(y)});return u&&(y.handleCloseOptions=s==null?void 0:s.__options),S.useEffect(()=>R,[R]),S.useEffect(()=>{if(!n)return;function O($){$.open?w.current=!1:(w.current=$.reason===xt,R(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return p.on("openchange",O),()=>{p.off("openchange",O)}},[n,p,y,R]),S.useEffect(()=>{if(!n)return;function O(L,K=!0){const U=io(N.current,"close",y.pointerType);U?y.openChangeTimeout.start(U,()=>{v.setOpen(!1,_e(xt,L)),m==null||m.events.emit("floating.closed",L)}):K&&(y.openChangeTimeout.clear(),v.setOpen(!1,_e(xt,L)),m==null||m.events.emit("floating.closed",L))}const $=a.current??(u?v.select("domReferenceElement"):null);if(!Ee($))return;function T(L){var ce;if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,o&&!hs(y.pointerType))return;const K=qy(k.current),U=io(N.current,"open",y.pointerType),V=Ot(L),B=L.currentTarget??null,q=v.select("domReferenceElement");let H=B;if(Ee(V)&&!v.context.triggerElements.hasElement(V)){for(const ve of v.context.triggerElements.elements())if(me(ve,V)){H=ve;break}}Ee(B)&&Ee(q)&&!v.context.triggerElements.hasElement(B)&&me(B,q)&&(H=q);const Y=H==null?!1:z(q,H,V),te=v.select("open"),Z=((ce=P.current)==null?void 0:ce.call(P))??v.select("transitionStatus")==="ending",G=!te&&Z&&w.current,X=!Y&&Ee(H)&&Ee(q)&&me(q,H)&&G,ne=K>0&&!U,fe=Y&&(te||G)||X,Te=!te||Y;if(fe){F()&&v.setOpen(!0,_e(xt,L,H));return}ne||(U?y.openChangeTimeout.start(U,()=>{Te&&F()&&v.setOpen(!0,_e(xt,L,H))}):Te&&F()&&v.setOpen(!0,_e(xt,L,H)))}function A(L){if(j()){_();return}R();const K=v.select("domReferenceElement"),U=Ae(K);y.restTimeout.clear(),y.restTimeoutPending=!1;const V=b.current.floatingContext??(f==null?void 0:f());if(Su(L.relatedTarget,v.context.triggerElements))return;if(E.current&&V){v.select("open")||y.openChangeTimeout.clear();const q=a.current;y.handler=E.current({...V,tree:m,x:L.clientX,y:L.clientY,onClose(){_(),R(),C.current&&!j()&&q===v.select("domReferenceElement")&&O(L,!0)}}),U.addEventListener("mousemove",y.handler),y.handler(L);return}(y.pointerType==="touch"?!me(v.select("floatingElement"),L.relatedTarget):!0)&&O(L)}function M(L){me($,L.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}const W=x?be($,"mouseout",M):void 0;return l?tr(be($,"mousemove",T,{once:!0}),be($,"mouseenter",T),be($,"mouseleave",A),W):tr(be($,"mouseenter",T),be($,"mouseleave",A),W)},[R,_,b,N,v,n,E,y,u,z,j,o,l,k,a,m,C,f,P,F,x]),S.useMemo(()=>{if(!n)return;function O($){y.pointerType=$.pointerType}return{onPointerDown:O,onPointerEnter:O,onMouseMove($){var V,B,q;const{nativeEvent:T}=$,A=$.currentTarget,M=v.select("domReferenceElement"),W=v.select("open"),L=z(M,A,$.target);if(o&&!hs(y.pointerType))return;if(W&&L&&((V=y.handleCloseOptions)!=null&&V.blockPointerEvents)){const H=v.select("floatingElement");if(H){const Y=((q=(B=y.handleCloseOptions)==null?void 0:B.getScope)==null?void 0:q.call(B))??A.ownerDocument.body;kE(y,{scopeElement:Y,referenceElement:A,floatingElement:H})}}const K=qy(k.current);if(W&&!L||K===0||!L&&y.restTimeoutPending&&$.movementX**2+$.movementY**2<2)return;y.restTimeout.clear();function U(){if(y.restTimeoutPending=!1,j())return;const H=v.select("open");!y.blockMouseMove&&(!H||L)&&F()&&v.setOpen(!0,_e(xt,T,A))}y.pointerType==="touch"?on.flushSync(()=>{U()}):L&&W?U():(y.restTimeoutPending=!0,y.restTimeout.start(K,U))}}},[n,y,j,z,o,v,k,F])}const vx=.1,I2=vx*vx,Fe=.5;function dc(e,t,n,r,s,o){return r>=t!=o>=t&&e<=(s-n)*(t-r)/(o-r)+n}function fc(e,t,n,r,s,o,i,l,a,c){let u=!1;return dc(e,t,n,r,s,o)&&(u=!u),dc(e,t,s,o,i,l)&&(u=!u),dc(e,t,i,l,a,c)&&(u=!u),dc(e,t,a,c,n,r)&&(u=!u),u}function O2(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function hc(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 NE(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 f=i==null?void 0:i.split("-")[0];let d=!1,g=null,x=null,v=typeof performance<"u"?performance.now():0;function b(m,y){const w=performance.now(),E=w-v;if(g===null||x===null||E===0)return g=m,x=y,v=w,!1;const N=m-g,k=y-x,C=N*N+k*k,I=E*E*I2;return g=m,x=y,v=w,C<I}function p(){n.clear(),a()}return function(y){n.clear();const w=l.domReference,E=l.floating;if(!w||!E||f==null||s==null||o==null)return;const{clientX:N,clientY:k}=y,C=Ot(y),I=y.type==="mouseleave",P=me(E,C),j=me(w,C);if(P&&(d=!0,!I))return;if(j&&(d=!1,!I)){d=!0;return}if(I&&Ee(y.relatedTarget)&&me(E,y.relatedTarget))return;function F(){return!!(u&&bs(u.nodesRef.current,c).length>0)}function z(){F()||p()}if(F())return;const R=w.getBoundingClientRect(),_=E.getBoundingClientRect(),O=s>_.right-_.width/2,$=o>_.bottom-_.height/2,T=_.width>R.width,A=_.height>R.height,M=(T?R:_).left,W=(T?R:_).right,L=(A?R:_).top,K=(A?R:_).bottom;if(f==="top"&&o>=R.bottom-1||f==="bottom"&&o<=R.top+1||f==="left"&&s>=R.right-1||f==="right"&&s<=R.left+1){z();return}let U=!1;switch(f){case"top":U=hc(N,k,M,R.top+1,W,_.bottom-1);break;case"bottom":U=hc(N,k,M,_.top+1,W,R.bottom-1);break;case"left":U=hc(N,k,_.right-1,K,R.left+1,L);break;case"right":U=hc(N,k,R.right-1,K,_.left+1,L);break}if(U)return;if(d&&!O2(N,k,R)){z();return}if(!I&&b(N,k)){z();return}let V=!1;switch(f){case"top":{const B=T?Fe/2:Fe*4,q=T||O?s+B:s-B,H=T?s-B:O?s+B:s-B,Y=o+Fe+1,te=O||T?_.bottom-Fe:_.top,Z=O?T?_.bottom-Fe:_.top:_.bottom-Fe;V=fc(N,k,q,Y,H,Y,_.left,te,_.right,Z);break}case"bottom":{const B=T?Fe/2:Fe*4,q=T||O?s+B:s-B,H=T?s-B:O?s+B:s-B,Y=o-Fe,te=O||T?_.top+Fe:_.bottom,Z=O?T?_.top+Fe:_.bottom:_.top+Fe;V=fc(N,k,q,Y,H,Y,_.left,te,_.right,Z);break}case"left":{const B=A?Fe/2:Fe*4,q=A||$?o+B:o-B,H=A?o-B:$?o+B:o-B,Y=s+Fe+1,te=$||A?_.right-Fe:_.left,Z=$?A?_.right-Fe:_.left:_.right-Fe;V=fc(N,k,te,_.top,Z,_.bottom,Y,q,Y,H);break}case"right":{const B=A?Fe/2:Fe*4,q=A||$?o+B:o-B,H=A?o-B:$?o+B:o-B,Y=s-Fe,te=$||A?_.left+Fe:_.right,Z=$?A?_.left+Fe:_.right:_.left+Fe;V=fc(N,k,Y,q,Y,H,te,_.top,Z,_.bottom);break}}V?d||n.start(40,z):z()}};return r.__options={...e,blockPointerEvents:t},r}const PE=S.createContext(void 0);function Ra(e){const t=S.useContext(PE);if(t===void 0&&!e)throw new Error(Qt(47));return t}const _2={...Am,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 M2 extends kd{constructor(n,r,s){const o=new _m;super(j2(n,o,r,s),A2(o),_2);ye(this,"setOpen",(n,r)=>{var f,d;const s=r.reason===xt,o=r.reason===vs&&r.event.detail===0,i=!n&&(r.reason===yd||r.reason==null),l=vE(r),a=this.select("activeTriggerId");if(!n&&r.reason===ES&&r.trigger==null&&a!=null&&(r.trigger=this.context.triggerElements.getById(a)??this.select("activeTriggerElement")??void 0),(d=(f=this.context).onOpenChange)==null||d.call(f,n,r),r.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,r);const c=()=>{const g=Pm(this.state,n,r.trigger,l());g.openChangeReason=r.reason,this.update(g)};s?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Q_,()=>{this.set("stickIfOpen",!1)}),on.flushSync(c)):c();let u;o?u="click":i?u="dismiss":r.reason===Ql&&(u="focus"),this.set("instantType",u)})}}function j2(e,t,n,r=!1){const s={...Mm(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 A2(e){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:S.createRef(),beforeContentFocusGuardRef:S.createRef(),stickIfOpenTimeout:new kn,triggerElements:e}}const wx=cd(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,f=D2(a,{modal:l,open:s,openProp:r,activeTriggerId:u,triggerIdProp:c});f.useControlledProp("openProp",r),f.useControlledProp("triggerIdProp",c);const d=f.useState("open"),g=f.useState("mounted"),x=f.useState("payload");f.useContextCallback("onOpenChange",o),f.useContextCallback("onOpenChangeComplete",i),bE(f,d),Tm(f);const{forceUnmount:v}=Im(d,f,()=>{f.update({stickIfOpen:!0,openChangeReason:null})});f.useSyncedValues({modal:l}),S.useEffect(()=>{d||f.context.stickIfOpenTimeout.clear()},[f,d]),S.useImperativeHandle(t.actionsRef,()=>({unmount:v,close:()=>f.setOpen(!1,_e(um))}),[v,f]);const b=d||g;return h.jsxs(PE.Provider,{value:f,children:[a&&h.jsx(Nm,{handle:a,store:f}),b&&h.jsx(F2,{store:f,modal:l}),typeof n=="function"?n({payload:x}):n]})});function z2(e){return Ra(!0)?h.jsx(wx,{props:e}):h.jsx(rM,{children:h.jsx(wx,{props:e})})}function D2(e,t){const n=Rm((r,s)=>new M2(t,r,s));return S.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function F2({store:e,modal:t}){const n=e.useState("floatingRootContext"),r=Em(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),s=r.reference,o=r.floating;return Om(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:o}),null}const TE=S.createContext(void 0);function Fm(e=!1){const t=S.useContext(TE);if(t===void 0&&!e)throw new Error(Qt(16));return t}function $2(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 Af(e,t,{detail:n=0}={}){e.dispatchEvent(new(Je(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function $m(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:o}=e,i=S.useRef(null),l=Fm(!0),a=o??l!==void 0,{props:c}=$2({focusableWhenDisabled:n,disabled:t,composite:a,tabIndex:r,isNativeButton:s}),u=S.useCallback(()=>{const g=i.current;zf(g)&&a&&t&&c.disabled===void 0&&g.disabled&&(g.disabled=!1)},[t,c.disabled,a]);de(u,[u]);const f=S.useCallback((g={})=>{const{onClick:x,onMouseDown:v,onKeyUp:b,onKeyDown:p,onPointerDown:m,...y}=g;return vd({onClick(w){if(t){w.preventDefault();return}x==null||x(w)},onMouseDown(w){t||v==null||v(w)},onKeyDown(w){if(t||(Nu(w),p==null||p(w),w.baseUIHandlerPrevented))return;const E=w.target===w.currentTarget,N=w.currentTarget,k=zf(N),C=!s&&L2(N),I=E&&(s?k:!C),P=w.key==="Enter",j=w.key===" ",F=N.getAttribute("role"),z=(F==null?void 0:F.startsWith("menuitem"))||F==="option"||F==="gridcell";if(E&&a&&j){if(w.defaultPrevented&&z)return;w.preventDefault(),(!s||k)&&(w.preventBaseUIHandler(),Af(N,w));return}if(!I||s||!j&&!P){E&&C&&j&&w.preventDefault();return}w.defaultPrevented||(w.preventDefault(),P&&(w.preventBaseUIHandler(),Af(N,w)))},onKeyUp(w){if(!t){if(Nu(w),b==null||b(w),w.target===w.currentTarget&&s&&a&&zf(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!s&&!a&&!w.defaultPrevented&&w.key===" "&&(w.preventBaseUIHandler(),Af(w.currentTarget,w))}},onPointerDown(w){if(t){w.preventDefault();return}m==null||m(w)}},s?{type:"button"}:{role:"button"},c,y)},[t,c,a,s]),d=pe(g=>{i.current=g,u()});return{getButtonProps:f,buttonRef:d}}function zf(e){return Le(e)&&e.tagName==="BUTTON"}function L2(e){return Le(e)&&e.tagName==="A"&&!!e.href}const H2=300;function Vi(e){return xd(e,"base-ui")}function B2(e,t){const n=S.useRef(null);function r(o){on.flushSync(()=>{e.setOpen(!1,_e(Ql,o.nativeEvent,o.currentTarget))});const i=I_(n.current);i==null||i.focus()}function s(o){var l;const i=e.select("positionerElement");if(i&&Zo(o,i))(l=e.context.beforeContentFocusGuardRef.current)==null||l.focus();else{on.flushSync(()=>{e.setOpen(!1,_e(Ql,o.nativeEvent,o.currentTarget))});let a=T_(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&me(i,a);){const c=a;if(a=xm(a),a===c)break}a==null||a.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:s}}function V2(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 W2(e,t){const n=pe((o,i)=>{(typeof e=="function"?e():e)||t(i||(dd?"touch":""))}),{onClick:r,onPointerDown:s}=V2(n);return S.useMemo(()=>({onClick:r,onPointerDown:s}),[r,s])}const U2=dS(function(t,n){const{render:r,className:s,style:o,disabled:i=!1,nativeButton:l=!0,handle:a,payload:c,openOnHover:u=!1,delay:f=H2,closeDelay:d=0,id:g,...x}=t,v=Ra(!0),p=EE(a)??v;if(!p)throw new Error(Qt(74));const m=Vi(g),y=p.useState("isTriggerActive",m),w=p.useState("floatingRootContext"),E=p.useState("isOpenedByTrigger",m),N=p.useState("triggerPopupId",m),k=S.useRef(null),{registerTrigger:C,isMountedByThisTrigger:I}=wE(m,k,p,{payload:c,disabled:i,openOnHover:u,closeDelay:d}),P=p.useState("openChangeReason"),j=p.useState("stickIfOpen"),F=p.useState("openMethod"),z=p.useState("focusManagerModal"),R=RE(w,{enabled:!i&&u&&(F!=="touch"||P!==vs),mouseOnly:!0,move:!1,handleClose:NE(),restMs:f,delay:{close:d},triggerElementRef:k,isActiveTrigger:y,isClosing:()=>p.select("transitionStatus")==="ending"}),_=iM(w,{stickIfOpen:j}),O=W2(()=>p.select("open"),q=>{p.set("openMethod",q)}),$=p.useState("triggerProps",I),{getButtonProps:T,buttonRef:A}=$m({disabled:i,native:l}),M={open(q){return q&&P===vs?YO.open(q):wS.open(q)}},{preFocusGuardRef:W,handlePreFocusGuardFocus:L,handleFocusTargetFocus:K}=B2(p,k),V=Bt("button",t,{state:{disabled:i,open:E},ref:[A,n,C,k],props:[_.reference,R,$,O,{[qS]:"",id:m,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":N},x,T],stateAttributesMapping:M}),B=h.jsx(S.Fragment,{children:V},m);return I&&!z?h.jsxs(S.Fragment,{children:[h.jsx(Ni,{ref:W,onFocus:L}),B,h.jsx(Ni,{ref:p.context.triggerFocusTargetRef,onFocus:K})]}):B}),IE=S.createContext(void 0);function q2(){const e=S.useContext(IE);if(e===void 0)throw new Error(Qt(45));return e}const K2=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Ra().useState("mounted")||r?h.jsx(IE.Provider,{value:r,children:h.jsx(XS,{ref:n,...s})}):null});function Lm(e){return vm(19)?e:e?"true":void 0}const OE=S.createContext(void 0);function Y2(){const e=S.useContext(OE);if(!e)throw new Error(Qt(46));return e}const G2=S.createContext(void 0);function _E(){const e=S.useContext(G2);return(e==null?void 0:e.direction)??"ltr"}const Q2=e=>({name:"arrow",options:e,async fn(t){var A,M;const{x:n,y:r,placement:s,rects:o,platform:i,elements:l,middlewareData:a}=t,{element:c,padding:u=0,offsetParent:f="real"}=ws(e,t)||{};if(c==null)return{};const d=TS(u),g={x:n,y:r},x=gm(s),v=pm(x),b=await i.getDimensions(c),p=x==="y",m=p?"top":"left",y=p?"bottom":"right",w=p?"clientHeight":"clientWidth",E=o.reference[v]+o.reference[x]-g[x]-o.floating[v],N=g[x]-o.reference[x],k=f==="real"?await((A=i.getOffsetParent)==null?void 0:A.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,j=Math.min(d[m],P),F=Math.min(d[y],P),z=j,R=C-b[v]-F,_=C/2-b[v]/2+I,O=PS(z,_,R),$=!a.arrow&&Pr(s)!=null&&_!==O&&o.reference[v]/2-(_<z?j:F)-b[v]/2<0,T=$?_<z?_-z:_-R:0;return{[x]:g[x]+T,data:{[x]:O,centerOffset:_-O-T,...$&&{alignmentOffset:T}},reset:$}}}),X2=(e,t)=>{const{name:n,fn:r}=Q2(e);return{name:n,fn:r,options:[e,t]}},Z2={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}}}},J2={sideX:"left",sideY:"top"},ej="--available-width",tj="--available-height",nj="--anchor-width",rj="--anchor-height",sj="--transform-origin",bx=ej,Sx=tj;function ME(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 Ex(e,t,n){const{rects:r,placement:s}=e;return{side:ME(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 jE(e){return oj(e,R2)}function oj(e,t){var Co,_a;const{anchor:n,positionMethod:r="absolute",side:s="bottom",sideOffset:o=0,align:i="center",alignOffset:l=0,collisionBoundary:a,collisionPadding:c=5,sticky:u=!1,arrowPadding:f=5,disableAnchorTracking:d=!1,inline:g,keepMounted:x=!1,floatingRootContext:v,mounted:b,collisionAvoidance:p,shift:m,nodeId:y,adaptiveOrigin:w,lazyFlip:E=!1,externalTree:N}=e,[k,C]=S.useState(null);!b&&k!==null&&C(null);const I=p.side||"flip",P=p.align||"flip",j=p.fallbackAxisSide||"end",F=(m==null?void 0:m.crossAxis)??!1,z=m==null?void 0:m.rootBoundary,R=typeof n=="function"?n:void 0,_=pe(R),O=R?_:n,$=Ft(n),T=Ft(b),M=_E()==="rtl",W=k||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":M?"left":"right","inline-start":M?"right":"left"}[s],L=i==="center"?W:`${W}-${i}`;let K=c;typeof K=="number"?K={top:K,right:K,bottom:K,left:K}:K&&(K={top:K.top||0,right:K.right||0,bottom:K.bottom||0,left:K.left||0});const U=1,V=s==="bottom"?U:0,B=s==="top"?U:0,q=s==="right"?U:0,H=s==="left"?U:0,Y={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:K},te=S.useRef(null),Z=Ft(o),G=Ft(l),X=typeof o!="function"?o:0,ne=typeof l!="function"?l:0,fe=[];g&&fe.push(g),fe.push(UM(Se=>{const ft=Ex(Se,s,M),Vt=typeof Z.current=="function"?Z.current(ft):Z.current,Et=typeof G.current=="function"?G.current(ft):G.current;return{mainAxis:Vt,crossAxis:Et,alignmentAxis:Et}},[X,ne,M,s]));const Te=P==="none"&&I!=="shift",ce=!Te&&(u||F||I==="shift"),ve=I==="none"?null:YM({...Y,padding:{top:K.top+U+V,right:K.right+U+H,bottom:K.bottom+U+B,left:K.left+U+q},mainAxis:!F&&I==="flip",crossAxis:P==="flip"?"alignment":!1,fallbackAxisSideDirection:j}),Q=Te?null:qM({...Y,rootBoundary:z,mainAxis:P!=="none",crossAxis:ce,limiter:u||F?void 0:KM(Se=>{if(!te.current)return{};const{width:ft,height:Vt}=te.current.getBoundingClientRect(),Et=xn(wn(Se.placement)),dn=Et==="y"?ft:Vt,Xt=Et==="y"?K.left+K.right:K.top+K.bottom;return{offset:dn/2+Xt/2}})},[Y,u,F,z,K,P]);I==="shift"||P==="shift"||i==="center"?fe.push(Q,ve):fe.push(ve,Q),fe.push(GM({...Y,apply({elements:{floating:Se},availableWidth:ft,availableHeight:Vt,rects:Et}){if(!T.current)return;const dn=Se.style;dn.setProperty(bx,`${ft}px`),dn.setProperty(Sx,`${Vt}px`);const Xt=Je(Se).devicePixelRatio||1,{x:Ro,y:Ar,width:No,height:Vn}=Et.reference,Cn=(Math.round((Ro+No)*Xt)-Math.round(Ro*Xt))/Xt,Ns=(Math.round((Ar+Vn)*Xt)-Math.round(Ar*Xt))/Xt;dn.setProperty(nj,`${Cn}px`),dn.setProperty(rj,`${Ns}px`)}}),X2(Se=>({element:te.current||Ae(Se.elements.floating).createElement("div"),padding:te.current?f:0,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(Se){var Ma,ja,Ui,qi,Aa,za;const{elements:{floating:ft},middlewareData:Vt,placement:Et,platform:dn,rects:Xt,y:Ro}=Se,Ar=wn(Et),No=Pr(Et),Vn=xn(Ar)==="y",Cn=te.current,Ns=typeof o=="function"?o(Ex(Se,s,M)):o;let Po;if(!Cn&&No&&Math.abs(Vn?((Ma=Vt.shift)==null?void 0:Ma.x)||0:((ja=Vt.shift)==null?void 0:ja.y)||0)<=1)Po=No==="start"===(Vn&&((Ui=dn.isRTL)==null?void 0:Ui.call(dn,ft))===!0)?"100%":"0%";else{const Hd=Vn?((qi=Vt.arrow)==null?void 0:qi.x)||0:((Aa=Vt.arrow)==null?void 0:Aa.y)||0,Bd=Vn?(Cn==null?void 0:Cn.clientWidth)||0:(Cn==null?void 0:Cn.clientHeight)||0;Po=`${Hd+Bd/2}px`}let Wi=Ar==="top"||Ar==="left"?`calc(100% + ${Ns}px)`:`${-Ns}px`;return ce&&Vn&&Math.abs(((za=Vt.shift)==null?void 0:za.y)||0)>Ns&&(Wi=`${Xt.reference.y+Xt.reference.height/2-Ro}px`),ft.style.setProperty(sj,Vn?`${Po} ${Wi}`:`${Wi} ${Po}`),{}}},Z2,w),de(()=>{!b&&v&&v.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[b,v]);const ge=S.useMemo(()=>({ancestorScroll:!d,elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:xe,elements:Ne,x:Pe,y:dt,middlewareData:ot,update:re,placement:se,context:De,isPositioned:Ce,floatingStyles:Mt}=t({rootContext:v,open:x?b:void 0,placement:L,middleware:fe,strategy:r,whileElementsMounted:x?void 0:(...Se)=>gx(...Se,ge),nodeId:y,externalTree:N}),{sideX:Ln,sideY:Hn}=ot.adaptiveOrigin||J2,gt=Ce?r:"fixed",jr=S.useMemo(()=>{let Se;return Ce?w?Se={position:gt,[Ln]:Pe,[Hn]:dt}:Se={...Mt,position:gt}:Se={position:gt,top:0,left:0},Se[bx]="100vw",Se[Sx]="100vh",Ce||(Se.opacity=0),Se},[w,gt,Ln,Pe,Hn,dt,Mt,Ce]),sr=S.useRef(null);de(()=>{if(!b)return;const Se=$.current,ft=typeof Se=="function"?Se():Se,Et=(kx(ft)?ft.current:ft)||null||null;Et!==sr.current&&(xe.setPositionReference(Et),sr.current=Et)},[b,xe,O,$]),S.useEffect(()=>{if(!b)return;const Se=$.current;typeof Se!="function"&&kx(Se)&&Se.current!==sr.current&&(xe.setPositionReference(Se.current),sr.current=Se.current)},[b,xe,O,$]),S.useEffect(()=>{if(x&&b&&Ne.reference&&Ne.floating)return gx(Ne.reference,Ne.floating,re,ge)},[x,b,Ne,re,ge]);const Bn=wn(se),wo=ME(s,Bn,M),bo=Pr(se)||"center",So=!!((Co=ot.hide)!=null&&Co.referenceHidden);de(()=>{E&&b&&Ce&&Bn!==W&&C(Bn)},[E,b,Ce,Bn,W]);const Eo=S.useMemo(()=>{var Se,ft;return{position:"absolute",top:(Se=ot.arrow)==null?void 0:Se.y,left:(ft=ot.arrow)==null?void 0:ft.x}},[ot.arrow]),ko=((_a=ot.arrow)==null?void 0:_a.centerOffset)!==0;return S.useMemo(()=>({positionerStyles:jr,arrowStyles:Eo,arrowRef:te,arrowUncentered:ko,side:wo,align:bo,physicalSide:Bn,anchorHidden:So,refs:xe,context:De,isPositioned:Ce,update:re}),[jr,Eo,te,ko,wo,bo,Bn,So,xe,De,Ce,re])}function kx(e){return e!=null&&"current"in e}const AE=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 Hm(e){return e==="starting"?X_:vt}function zE(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},Hm(r),s],stateAttributesMapping:am})}let Cx={},Rx={},Nx="";function Cd(e,t){return Ea(e)?e:t}function Px(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Cd(t,n)).overflowY)}function ij(e){if(typeof document>"u")return!1;const t=Ae(e);return Je(t).innerWidth-t.documentElement.clientWidth>0}function lj(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=Cd(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 aj(e){const t=Ae(e),n=t.documentElement,r=t.body,s=Cd(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 cj(e){var g;const t=Ae(e),n=t.documentElement,r=t.body,s=Je(n);let o=0,i=0,l=!1;const a=Qn.create();if(xo&&(((g=s.visualViewport)==null?void 0:g.scale)??1)!==1)return()=>{};function c(){const x=s.getComputedStyle(n),v=s.getComputedStyle(r),m=(x.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,Cx={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Nx=n.style.scrollBehavior,Rx={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),j=Cd(n,r);if(l=lj(e),l){n.style.scrollbarGutter=m,j.style.overflowY="hidden",j.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:m,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,Cx),Object.assign(r.style,Rx),l||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Nx)}function f(){u(),a.request(c)}c();const d=be(s,"resize",f);return()=>{a.cancel(),u(),typeof s.removeEventListener=="function"&&d()}}class uj{constructor(){ye(this,"lockCount",0);ye(this,"restore",null);ye(this,"timeoutLock",kn.create());ye(this,"timeoutUnlock",kn.create());ye(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});ye(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=Je(r);if(Px(o,r,s)){const l=new o.MutationObserver(()=>{Px(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=dd||!ij(t);this.restore=i?aj(t):cj(t)}}const dj=new uj;function DE(e=!0,t=null){de(()=>{if(e)return dj.acquire(t)},[e,t])}const fj=20;function hj(e,t,n,r){const[s,o]=S.useState(!1);de(()=>{if(!e||!t||n==null){o(!1);return}const i=Ae(n).documentElement.clientWidth,l=n.offsetWidth;o(i>0&&l>0&&l>=i-fj)},[e,t,n]),DE(e&&(!t||s),r)}const pj=S.forwardRef(function(t,n){const{render:r,className:s,style:o,anchor:i,positionMethod:l,side:a,align:c,sideOffset:u,alignOffset:f,collisionBoundary:d="clipping-ancestors",collisionPadding:g,arrowPadding:x,sticky:v,disableAnchorTracking:b=!1,collisionAvoidance:p=KS,...m}=t,y=Ra(),w=q2(),E=tM(),N=y.useState("floatingRootContext"),k=y.useState("mounted"),C=y.useState("open"),I=y.useState("openChangeReason"),P=y.useState("activeTriggerElement"),j=y.useState("modal"),F=y.useState("openMethod"),z=y.useState("positionerElement"),R=y.useState("instantType"),_=y.useState("transitionStatus"),O=y.useState("adaptiveOrigin"),$=S.useRef(null),T=yE(z),A=jE({anchor:i,floatingRootContext:N,positionMethod:l,mounted:k,side:a,sideOffset:u,align:c,alignOffset:f,arrowPadding:x,collisionBoundary:d,collisionPadding:g,sticky:v,disableAnchorTracking:b,keepMounted:w,nodeId:E,collisionAvoidance:p,adaptiveOrigin:O}),M=N.useState("domReferenceElement");de(()=>{const V=M,B=$.current;if(V&&($.current=V),B&&V&&V!==B){y.set("instantType",void 0);const q=new AbortController;return T(()=>{y.set("instantType","trigger-change")},q.signal),()=>{q.abort()}}},[M,T,y]);const W=j===!0&&I!==xt;hj(C&&W,F==="touch",z,P);const L=y.useStateSetter("positionerElement"),K={open:C,side:A.side,align:A.align,anchorHidden:A.anchorHidden,instant:R},U=zE(t,K,{styles:A.positionerStyles,transitionStatus:_,props:m,refs:[n,L],hidden:!k,inert:!C});return h.jsxs(OE.Provider,{value:A,children:[k&&W&&h.jsx(AE,{inert:Lm(!C),cutout:P}),h.jsx(nM,{id:E,children:U})]})}),wp="ArrowUp",bp="ArrowDown",Sp="ArrowLeft",Ep="ArrowRight",kp="Home",Cp="End",Bm=new Set([wp,bp,Sp,Ep,kp,Cp]),gj="Shift",mj=[gj,"Control","Alt","Meta"];function yj(e){return Le(e)&&e.tagName==="INPUT"}function Tx(e){return!!(yj(e)&&e.selectionStart!=null||Le(e)&&e.tagName==="TEXTAREA")}function Ix(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=Ox(e,t,"left"),c=pc(e),u=pc(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=Ox(e,t,"top"),c=pc(e),u=pc(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 Ox(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 pc(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 xj=S.createContext(void 0);function vj(e){return S.useContext(xj)}const wj=S.createContext(void 0);function bj(){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 Sj=S.forwardRef(function(t,n){const{render:r,className:s,style:o,initialFocus:i,finalFocus:l,...a}=t,c=Ra(),u=Y2(),f=vj()!=null,{context:d,hasClosePart:g}=bj(),x=c.useState("open"),v=c.useState("openMethod"),b=c.useState("instantType"),p=c.useState("transitionStatus"),m=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"),j=c.useState("disabled"),F=c.useState("openOnHover"),z=c.useState("closeDelay");Ca({open:x,ref:c.context.popupRef,onComplete(){var A,M;x&&((M=(A=c.context).onOpenChangeComplete)==null||M.call(A,!0))}}),CE(I,{enabled:F&&!j,closeDelay:z});const R=i===void 0?xE(c.context.popupRef):i,_=E!==!1&&g;c.useSyncedValue("focusManagerModal",_);const O=c.useStateSetter("popupElement"),$={open:x,side:u.side,align:u.align,instant:b,transitionStatus:p},T=Bt("div",t,{state:$,ref:[n,c.context.popupRef,O],props:[m,{id:P,role:"dialog",...Cm,"aria-labelledby":y,"aria-describedby":w,onKeyDown(A){f&&Bm.has(A.key)&&A.stopPropagation()}},Hm(p),a],stateAttributesMapping:cm});return h.jsx(tE,{context:I,openInteractionType:v,modal:_,disabled:!N||k===xt,initialFocus:R,returnFocus:l,restoreFocus:"popup",previousFocusableElement:Le(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:h.jsx(wj.Provider,{value:d,children:T})})}),Ii=z2,Oi=U2,ao=S.forwardRef(({className:e,side:t="bottom",align:n="end",sideOffset:r=4,...s},o)=>h.jsx(K2,{children:h.jsx(pj,{side:t,align:n,sideOffset:r,collisionPadding:8,className:"z-40",children:h.jsx(Sj,{ref:o,className:rt("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 Ej=48,kj=60,Cj=24;function Rj({glyph:e,label:t,placeholder:n,value:r,onChange:s,options:o,loading:i,failed:l,search:a,onSearchChange:c,hasMore:u,loadingMore:f,onLoadMore:d,allowCustom:g=!0,title:x}){const[v,b]=S.useState(!1),[p,m]=S.useState(""),y=c!==void 0,w=y?a??"":p,E=y?c:m,N=S.useMemo(()=>{const _=w.trim().toLowerCase(),O=_&&!y?o.filter(T=>T.value.toLowerCase().includes(_)):o;return[...r.filter(T=>!O.some(A=>A.value===T)).filter(T=>!_||T.toLowerCase().includes(_)).map(T=>({value:T,count:0})),...O]},[o,w,y,r]),k=S.useRef(null),C=()=>{const _=k.current;!_||!u||f||!d||_.scrollTop+_.clientHeight>=_.scrollHeight-Ej&&d()},I=_=>{s(r.includes(_)?r.filter(O=>O!==_):[...r,_])},P=N.length>kj,j=F1({count:N.length,getScrollElement:()=>k.current,estimateSize:()=>Cj,overscan:8,enabled:P}),F=_=>{const O=r.includes(_.value);return h.jsxs("button",{type:"button",role:"option","aria-selected":O,onClick:()=>I(_.value),className:rt("mono flex w-full items-center gap-2 px-2 py-1 text-left text-xs hover:bg-zinc-800",O?"text-zinc-100":"text-zinc-400"),children:[h.jsx("span",{className:"w-3 shrink-0",children:O&&h.jsx(Gg,{width:12,height:12})}),h.jsx("span",{className:"truncate",children:_.value}),h.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-zinc-600",children:_.count})]},_.value)},z=w.trim(),R=g&&z!==""&&!N.some(_=>_.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(Ii,{open:v,onOpenChange:b,children:[h.jsx(Oi,{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(_=>h.jsx(yt,{className:"mono max-w-[10rem] truncate",children:_},_))}),h.jsxs(ao,{align:"start",className:"w-72 p-0",children:[h.jsx("div",{className:"border-b border-line px-2",children:h.jsx(tm,{autoFocus:!0,value:w,onChange:_=>E(_.target.value),placeholder:g?"search, or type a value…":"search…",onKeyDown:_=>{_.key!=="Enter"||!R||(_.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"})]}),f&&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:rt("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:`${j.getTotalSize()}px`},children:j.getVirtualItems().map(_=>{var O;return h.jsx("div",{ref:j.measureElement,"data-index":_.index,className:"absolute top-0 left-0 w-full",style:{transform:`translateY(${_.start}px)`},children:F(N[_.index])},((O=N[_.index])==null?void 0:O.value)??_.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(ys,{width:12,height:12})})]})}const _x=50,Nj=200;function Pj(e,t){const[n,r]=S.useState(e);return S.useEffect(()=>{const s=setTimeout(()=>r(e),t);return()=>clearTimeout(s)},[e,t]),n}function Tj(e){return e.filter(t=>t.value!==null).map(t=>({value:t.value,count:t.count}))}function Ou({field:e,scope:t,value:n,onChange:r,glyph:s,label:o,placeholder:i,title:l,single:a}){const[c,u]=S.useState(""),f=Pj(c,Nj),d=hN({queryKey:["run-values",e,t,f],queryFn:({pageParam:x})=>$e.values(e,t,{limit:_x,offset:x,search:f}),initialPageParam:0,getNextPageParam:(x,v)=>x.length<_x?void 0:v.reduce((b,p)=>b+p.length,0),staleTime:1e4}),g=S.useMemo(()=>{var x;return Tj(((x=d.data)==null?void 0:x.pages.flat())??[])},[d.data]);return h.jsx(Rj,{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:g,search:c,onSearchChange:u,loading:d.isLoading,failed:d.isError,hasMore:d.hasNextPage,loadingMore:d.isFetchingNextPage,onLoadMore:()=>void d.fetchNextPage()})}const FE=[{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 Ij(e){const[t,n,...r]=e.split(":");return!t||!n||r.length===0?null:{key:t,op:n,operand:r.join(":")}}function gc(e){var r;const t=Ij(e);if(!t)return e;const n=((r=FE.find(s=>s.op===t.op))==null?void 0:r.label)??t.op;return`${t.key} ${n} ${t.operand.split("|").join(", ")}`}function Oj({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([]),[f,d]=S.useState(""),g=l==="eq"||l==="in",x=g?c.join("|"):f.trim(),v=o!==""&&x!=="",b=()=>{i(""),a("eq"),u([]),d("")},p=()=>{if(!v)return;const m=l==="in"&&c.length===1?"eq":l;t([...e,`${o}:${m}:${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(Ii,{open:r,onOpenChange:m=>{s(m),m||b()},children:[h.jsx(Oi,{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(m=>h.jsx(yt,{variant:"attr",className:"mono max-w-[12rem] truncate",children:gc(m)},m))}),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(m=>h.jsxs(yt,{variant:"attr",className:"mono gap-1 py-0.5",children:[gc(m),h.jsx(je,{variant:"ghost",size:"icon",className:"h-3 w-3 text-indigo-300/70 hover:text-indigo-100",title:`remove ${gc(m)}`,"aria-label":`remove ${gc(m)}`,onClick:()=>t(e.filter(y=>y!==m)),children:h.jsx(ys,{width:10,height:10})})]},m))}),h.jsx(Ou,{field:"attr",scope:n,glyph:"⛃",label:"attribute key",placeholder:"key…",single:!0,value:o?[o]:[],onChange:m=>{i(m.at(-1)??""),u([])}}),h.jsx("select",{"aria-label":"operator",value:l,onChange:m=>a(m.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:FE.map(m=>h.jsx("option",{value:m.op,className:"bg-zinc-900",children:m.label},m.op))}),g?h.jsx(Ou,{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(tm,{value:f,onChange:m=>d(m.target.value),placeholder:"value…","aria-label":"attribute value",onKeyDown:m=>{m.key==="Enter"&&p()}})]}),h.jsx(je,{variant:"brand",size:"chip",className:"mono self-end rounded",disabled:!v,onClick:p,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(ys,{width:12,height:12})})]})}function _j({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=JT(t,r.filter);return h.jsxs(je,{variant:"ghost",size:"chip","aria-pressed":s,title:r.title,onClick:()=>n(r.filter),className:rt("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})]},H1(r.filter))})]})}function Mj(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 jj(e){const t=Mj(e.map(n=>n.name));return`${t.length>=2?t:"parallel"} ×${e.length}`}function $E(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:jj(i)}),n=l}return t}function co(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 Aj=9e4;function zj(e,t,n){var o;const r=((t==null?void 0:t.liveWorkers)??[]).filter(i=>n-i.lastBeatAt<=Aj).sort((i,l)=>l.lastBeatAt-i.lastBeatAt)[0];if(r)return{kind:"working",instanceId:r.instanceId,beatAgoS:Math.max(0,Math.round((n-r.lastBeatAt)/1e3)),inFlight:(o=r.status)==null?void 0:o.inFlight};const s=e.enqueuedAt?new Date(e.enqueuedAt).getTime():new Date(e.startedAt).getTime();return{kind:"lost",minutes:Math.round((n-s)/6e4)}}function Dj(e){const t=S.useMemo(()=>{const s=new Set;for(const o of e){const i=co(o);i!==void 0&&s.add(i)}return[...s].sort()},[e]),n=jw({queries:t.map(s=>({queryKey:["run",s],queryFn:()=>$e.run(s)}))}),r={};return t.forEach((s,o)=>{var l;const i=(l=n[o])==null?void 0:l.data;i&&(r[s]=i)}),r}function Fj(e,t,n){if(t){const i=new Date(t.run.createdAt).getTime(),a=t.run.status==="running"||t.run.status==="suspended"?n:new Date(t.run.updatedAt).getTime();return[i,Math.max(a,i)]}const{subs:r}=Kg(e.events??[]),s=r.map(i=>i.startedAt).filter(i=>i!==void 0),o=r.map(i=>{var l;return((l=i.terminal)==null?void 0:l.at)??i.startedAt}).filter(i=>i!==void 0);return s.length>0&&o.length>0?[Math.min(...s),Math.max(...o)]:[new Date(e.startedAt).getTime(),new Date(e.finishedAt).getTime()]}function Rp(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}const $j={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"},Lj={ok:"bg-emerald-400",failed:"bg-red-400",skipped:"bg-amber-400"};function LE({row:e,run:t,childRuns:n,depth:r,selectedKey:s,onSelect:o,onOpenRun:i,onToggleChild:l,expanded:a,collapsedSubs:c,toggleSubs:u}){var j;const{step:f,left:d,width:g,ms:x,subRows:v}=e,b=f.status==="failed",p=co(f),m=!!p,y=m?Xg:Zg(f.kind),w=s===`${f.runId}#${f.seq}`,E=m&&p!==void 0&&a.has(p),N=v.length>0&&!m,k=c.has(f.seq),C=aI(f,Date.now()),{data:I}=nn({queryKey:["workers"],queryFn:()=>$e.workers(),refetchInterval:1e4,enabled:C}),P=C?zj(f,I==null?void 0:I.find(F=>F.group===f.workerGroup),Date.now()):void 0;return h.jsxs("div",{children:[h.jsxs("button",{type:"button",onClick:()=>o(f,t),title:m?"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:[m&&p!==void 0&&h.jsx("button",{type:"button",onClick:F=>{F.stopPropagation(),l(p)},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(f.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":m?"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:p!==void 0?((j=n[p])==null?void 0:j.run.workflow)??"child workflow":f.name}),m&&p!==void 0&&h.jsx("button",{type:"button",onClick:F=>{F.stopPropagation(),i(p)},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:`${d}%`,width:`${g}%`}}),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(${d+g}%, calc(100% - 44px))`},children:Rp(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 ${Lj[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 ${$j[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:Rp(F.ms)})]})]},F.key))}),m&&p!==void 0&&E&&h.jsx("div",{className:"ml-[18px] mt-0.5 mb-1 border-l border-line-soft pl-2",children:h.jsx(Bj,{id:p,depth:r+1,selectedKey:s,onSelect:o,onOpenRun:i,expanded:a,onToggleChild:l})})]})}function Hj({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(LE,{row:s,...r},s.step.seq))})]})}function Vm({run:e,timeline:t,depth:n,selectedKey:r,onSelect:s,onOpenRun:o,expanded:i,onToggleChild:l}){const a=Dj(t),{span:c,rows:u}=S.useMemo(()=>{const p=e.status==="running"||e.status==="suspended",m=Date.now(),y=t.map(C=>{const I=co(C),P=I!==void 0?a[I]:void 0,[j,F]=Fj(C,P,m);return{step:C,childId:I,childRun:P,barStart:j,barEnd:F}}),w=Math.min(new Date(e.createdAt).getTime(),...y.map(C=>C.barStart)),E=Math.max(...y.map(C=>C.barEnd),p?m:w+1),N=Math.max(E-w,1),k=y.map(({step:C,childId:I,childRun:P,barStart:j,barEnd:F})=>{const{subs:z}=Kg(C.events??[]),R=z.map(_=>{var T;const O=_.startedAt??j,$=((T=_.terminal)==null?void 0:T.at)??O;return{key:_.id,name:_.name,status:_.status??"ok",left:(O-w)/N*100,width:Math.max(($-O)/N*100,.8),ms:_.durationMs??Math.max($-O,0)}});return{step:C,childId:I,childRun:P,left:(j-w)/N*100,width:Math.max((F-j)/N*100,.8),ms:F-j,subRows:R}});return{span:N,rows:k}},[e,t,a]),f=S.useMemo(()=>$E(t),[t]),d=S.useMemo(()=>{const p=new Map;for(const m of u)p.set(m.step.seq,m);return p},[u]),[g,x]=S.useState(new Set),b={run:e,childRuns:a,depth:n,selectedKey:r,onSelect:s,onOpenRun:o,onToggleChild:l,expanded:i,collapsedSubs:g,toggleSubs:p=>x(m=>{const y=new Set(m);return y.has(p)?y.delete(p):y.add(p),y})};return h.jsx(h.Fragment,{children:f.map(p=>{if(p.kind==="single"){const y=d.get(p.step.seq);return y?h.jsx(LE,{row:y,...b},y.step.seq):null}const m=p.steps.map(y=>d.get(y.seq)).filter(y=>y!==void 0);return h.jsx(Hj,{label:p.label,fanFailed:p.steps.some(y=>y.status==="failed"),memberRows:m,rowProps:b},`fan:${p.group}`)})})}function Bj({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(Vm,{run:l.run,timeline:l.timeline,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 Vj=S.memo(function({run:t,timeline:n,selectedKey:r,onSelect:s,onOpenRun:o,expanded:i,onToggleChild:l}){const a=S.useMemo(()=>{const f=n.map(b=>new Date(b.startedAt).getTime()),d=n.map(b=>new Date(b.finishedAt).getTime()),g=Math.min(new Date(t.createdAt).getTime(),...f),x=t.status==="running"||t.status==="suspended",v=Math.max(...d,x?Date.now():g+1);return Math.max(v-g,1)},[t,n]),c=i??new Set,u=l??(()=>{});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 ",Rp(a)]})]}),h.jsx("div",{className:"min-h-0 flex-1 space-y-1 overflow-auto px-3 pb-3",children:h.jsx(Vm,{run:t,timeline:n,depth:0,selectedKey:r,onSelect:s,onOpenRun:o,expanded:c,onToggleChild:u})})]})});function _u(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}function Mx(e,t){return _u(new Date(t).getTime()-new Date(e).getTime())}function jx(e){return Wm(new Date(e).getTime())}function Wm(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}const HE={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"},Wj={debug:"text-zinc-500",info:"text-zinc-300",warn:"text-amber-300",error:"text-red-300"},Uj=["ok","failed","skipped"];function BE({e}){return h.jsxs("div",{className:"flex gap-2 py-0.5",children:[h.jsx("span",{className:"shrink-0 text-zinc-600 tnum",children:Wm(e.at)}),h.jsx("span",{className:`shrink-0 uppercase ${Wj[e.level]}`,children:e.level}),h.jsx("span",{className:"min-w-0 break-words text-zinc-300",children:e.message})]})}function Ax({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?HE[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:_u(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:Wm(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:["+",_u(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(BE,{e:c},`${c.at}-${u}`))})]})]})}function qj({events:e}){const{subs:t,stepLogs:n}=Kg(e),r=Uj.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:HE[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(Ax,{sub:l,showGroup:!1},l.id))})]},o)):h.jsx("ul",{className:"flex flex-col gap-1",children:t.map(o=>h.jsx(Ax,{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(BE,{e:o},`${o.at}-${i}`))})]})]})}function Kj({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(Gg,{width:11,height:11}):h.jsx(kI,{width:11,height:11}),t?"copied":"copy"]})}function Mu({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(Kj,{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 Fr({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 Yj({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(Vm,{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 Gj({step:e,run:t,onClose:n,onOpenRun:r}){const s=co(e),[o,i]=S.useState(!1),l=e.status==="failed",a=e.status==="pending"||e.status==="running",c=Zg(e.kind),u=Mx(t.createdAt,e.startedAt),f=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," · ",ap[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(ys,{})})]}),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(Fr,{k:"seq",v:`#${e.seq}`}),f>=1&&h.jsx(Fr,{k:"queued",v:h.jsx("span",{className:"text-sky-300",children:_u(f)})}),h.jsx(Fr,{k:"duration",v:a?h.jsx("span",{className:"text-amber-300",children:"running…"}):Mx(e.startedAt,e.finishedAt)}),h.jsx(Fr,{k:"attempts",v:h.jsxs("span",{className:e.attempts>1?"text-amber-300":"",children:[e.attempts>1&&h.jsx(Qg,{width:11,height:11,className:"mr-1 inline"}),e.attempts]})}),e.workerGroup&&h.jsx(Fr,{k:"worker",v:`@${e.workerGroup}`}),h.jsx(Fr,{k:"started",v:jx(e.startedAt)}),!a&&h.jsx(Fr,{k:"finished",v:jx(e.finishedAt)}),h.jsx(Fr,{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(qj,{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(d=>!d),className:"flex w-full items-center gap-2 rounded-md border border-indigo-500/30 bg-indigo-500/10 px-2.5 py-1.5 text-left transition-colors hover:bg-indigo-500/20",title:o?"Collapse child run":"Expand child run inline",children:[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(Yj,{id:s,onOpenRun:r})]}),e.input!==void 0&&h.jsx(Mu,{label:"input",value:e.input}),e.output!==void 0&&h.jsx(Mu,{label:"output",value:e.output})]})]})}function Qj({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(ys,{})})]}),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(Mu,{label:"input",value:e.input}),e.output!==void 0&&h.jsx(Mu,{label:"output",value:e.output}),n&&h.jsx("div",{className:"text-sm text-zinc-600",children:"No input/output recorded."})]})]})}function Xj(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 zx(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 Zj(){const e=ho(),{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(Ii,{children:[h.jsx(Oi,{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:Xj(s)}),h.jsx("td",{className:rt("px-2 py-1.5",s.paused?"text-amber-400/80":"text-zinc-300"),children:s.paused?"paused":s.nextFireAt?zx(s.nextFireAt):"—"}),h.jsxs("td",{className:"max-w-[9rem] px-2 py-1.5 text-zinc-500",children:[s.lastFireAt?zx(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 st(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=st(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Jj={value:()=>{}};function Rd(){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 Lc(n)}function Lc(e){this._=e}function eA(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}})}Lc.prototype=Rd.prototype={constructor:Lc,on:function(e,t){var n=this._,r=eA(e+"",n),s,o=-1,i=r.length;if(arguments.length<2){for(;++o<i;)if((s=(e=r[o]).type)&&(s=tA(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]=Dx(n[s],e.name,t);else if(t==null)for(s in n)n[s]=Dx(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 Lc(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 tA(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function Dx(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=Jj,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Np="http://www.w3.org/1999/xhtml";const Fx={svg:"http://www.w3.org/2000/svg",xhtml:Np,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Nd(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Fx.hasOwnProperty(t)?{space:Fx[t],local:e}:e}function nA(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Np&&t.documentElement.namespaceURI===Np?t.createElement(e):t.createElementNS(n,e)}}function rA(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function VE(e){var t=Nd(e);return(t.local?rA:nA)(t)}function sA(){}function Um(e){return e==null?sA:function(){return this.querySelector(e)}}function oA(e){typeof e!="function"&&(e=Um(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 iA(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function lA(){return[]}function WE(e){return e==null?lA:function(){return this.querySelectorAll(e)}}function aA(e){return function(){return iA(e.apply(this,arguments))}}function cA(e){typeof e=="function"?e=aA(e):e=WE(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 UE(e){return function(){return this.matches(e)}}function qE(e){return function(t){return t.matches(e)}}var uA=Array.prototype.find;function dA(e){return function(){return uA.call(this.children,e)}}function fA(){return this.firstElementChild}function hA(e){return this.select(e==null?fA:dA(typeof e=="function"?e:qE(e)))}var pA=Array.prototype.filter;function gA(){return Array.from(this.children)}function mA(e){return function(){return pA.call(this.children,e)}}function yA(e){return this.selectAll(e==null?gA:mA(typeof e=="function"?e:qE(e)))}function xA(e){typeof e!="function"&&(e=UE(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 KE(e){return new Array(e.length)}function vA(){return new an(this._enter||this._groups.map(KE),this._parents)}function ju(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ju.prototype={constructor:ju,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 wA(e){return function(){return e}}function bA(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 ju(e,o[i]);for(;i<a;++i)(l=t[i])&&(s[i]=l)}function SA(e,t,n,r,s,o,i){var l,a,c=new Map,u=t.length,f=o.length,d=new Array(u),g;for(l=0;l<u;++l)(a=t[l])&&(d[l]=g=i.call(a,a.__data__,l,t)+"",c.has(g)?s[l]=a:c.set(g,a));for(l=0;l<f;++l)g=i.call(e,o[l],l,o)+"",(a=c.get(g))?(r[l]=a,a.__data__=o[l],c.delete(g)):n[l]=new ju(e,o[l]);for(l=0;l<u;++l)(a=t[l])&&c.get(d[l])===a&&(s[l]=a)}function EA(e){return e.__data__}function kA(e,t){if(!arguments.length)return Array.from(this,EA);var n=t?SA:bA,r=this._parents,s=this._groups;typeof e!="function"&&(e=wA(e));for(var o=s.length,i=new Array(o),l=new Array(o),a=new Array(o),c=0;c<o;++c){var u=r[c],f=s[c],d=f.length,g=CA(e.call(u,u&&u.__data__,c,r)),x=g.length,v=l[c]=new Array(x),b=i[c]=new Array(x),p=a[c]=new Array(d);n(u,f,v,b,p,g,t);for(var m=0,y=0,w,E;m<x;++m)if(w=v[m]){for(m>=y&&(y=m+1);!(E=b[y])&&++y<x;);w._next=E||null}}return i=new an(i,r),i._enter=l,i._exit=a,i}function CA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function RA(){return new an(this._exit||this._groups.map(KE),this._parents)}function NA(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 PA(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,o=r.length,i=Math.min(s,o),l=new Array(s),a=0;a<i;++a)for(var c=n[a],u=r[a],f=c.length,d=l[a]=new Array(f),g,x=0;x<f;++x)(g=c[x]||u[x])&&(d[x]=g);for(;a<s;++a)l[a]=n[a];return new an(l,this._parents)}function TA(){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 IA(e){e||(e=OA);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o){for(var i=n[o],l=i.length,a=s[o]=new Array(l),c,u=0;u<l;++u)(c=i[u])&&(a[u]=c);a.sort(t)}return new an(s,this._parents).order()}function OA(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function _A(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function MA(){return Array.from(this)}function jA(){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 AA(){let e=0;for(const t of this)++e;return e}function zA(){return!this.node()}function DA(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 FA(e){return function(){this.removeAttribute(e)}}function $A(e){return function(){this.removeAttributeNS(e.space,e.local)}}function LA(e,t){return function(){this.setAttribute(e,t)}}function HA(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function BA(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function VA(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 WA(e,t){var n=Nd(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?$A:FA:typeof t=="function"?n.local?VA:BA:n.local?HA:LA)(n,t))}function YE(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function UA(e){return function(){this.style.removeProperty(e)}}function qA(e,t,n){return function(){this.style.setProperty(e,t,n)}}function KA(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function YA(e,t,n){return arguments.length>1?this.each((t==null?UA:typeof t=="function"?KA:qA)(e,t,n??"")):_i(this.node(),e)}function _i(e,t){return e.style.getPropertyValue(t)||YE(e).getComputedStyle(e,null).getPropertyValue(t)}function GA(e){return function(){delete this[e]}}function QA(e,t){return function(){this[e]=t}}function XA(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function ZA(e,t){return arguments.length>1?this.each((t==null?GA:typeof t=="function"?XA:QA)(e,t)):this.node()[e]}function GE(e){return e.trim().split(/^|\s+/)}function qm(e){return e.classList||new QE(e)}function QE(e){this._node=e,this._names=GE(e.getAttribute("class")||"")}QE.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 XE(e,t){for(var n=qm(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function ZE(e,t){for(var n=qm(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function JA(e){return function(){XE(this,e)}}function ez(e){return function(){ZE(this,e)}}function tz(e,t){return function(){(t.apply(this,arguments)?XE:ZE)(this,e)}}function nz(e,t){var n=GE(e+"");if(arguments.length<2){for(var r=qm(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?tz:t?JA:ez)(n,t))}function rz(){this.textContent=""}function sz(e){return function(){this.textContent=e}}function oz(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function iz(e){return arguments.length?this.each(e==null?rz:(typeof e=="function"?oz:sz)(e)):this.node().textContent}function lz(){this.innerHTML=""}function az(e){return function(){this.innerHTML=e}}function cz(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function uz(e){return arguments.length?this.each(e==null?lz:(typeof e=="function"?cz:az)(e)):this.node().innerHTML}function dz(){this.nextSibling&&this.parentNode.appendChild(this)}function fz(){return this.each(dz)}function hz(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function pz(){return this.each(hz)}function gz(e){var t=typeof e=="function"?e:VE(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function mz(){return null}function yz(e,t){var n=typeof e=="function"?e:VE(e),r=t==null?mz:typeof t=="function"?t:Um(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function xz(){var e=this.parentNode;e&&e.removeChild(this)}function vz(){return this.each(xz)}function wz(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function bz(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Sz(e){return this.select(e?bz:wz)}function Ez(e){return arguments.length?this.property("__data__",e):this.node().__data__}function kz(e){return function(t){e.call(this,t,this.__data__)}}function Cz(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 Rz(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 Nz(e,t,n){return function(){var r=this.__on,s,o=kz(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 Pz(e,t,n){var r=Cz(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?Nz:Rz,s=0;s<o;++s)this.each(l(r[s],t,n));return this}function JE(e,t,n){var r=YE(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 Tz(e,t){return function(){return JE(this,e,t)}}function Iz(e,t){return function(){return JE(this,e,t.apply(this,arguments))}}function Oz(e,t){return this.each((typeof t=="function"?Iz:Tz)(e,t))}function*_z(){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 ek=[null];function an(e,t){this._groups=e,this._parents=t}function Na(){return new an([[document.documentElement]],ek)}function Mz(){return this}an.prototype=Na.prototype={constructor:an,select:oA,selectAll:cA,selectChild:hA,selectChildren:yA,filter:xA,data:kA,enter:vA,exit:RA,join:NA,merge:PA,selection:Mz,order:TA,sort:IA,call:_A,nodes:MA,node:jA,size:AA,empty:zA,each:DA,attr:WA,style:YA,property:ZA,classed:nz,text:iz,html:uz,raise:fz,lower:pz,append:gz,insert:yz,remove:vz,clone:Sz,datum:Ez,on:Pz,dispatch:Oz,[Symbol.iterator]:_z};function en(e){return typeof e=="string"?new an([[document.querySelector(e)]],[document.documentElement]):new an([[e]],ek)}function jz(e){let t;for(;t=e.sourceEvent;)e=t;return e}function On(e,t){if(e=jz(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 Az={passive:!1},Zl={capture:!0,passive:!1};function Df(e){e.stopImmediatePropagation()}function ei(e){e.preventDefault(),e.stopImmediatePropagation()}function tk(e){var t=e.document.documentElement,n=en(e).on("dragstart.drag",ei,Zl);"onselectstart"in t?n.on("selectstart.drag",ei,Zl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function nk(e,t){var n=e.document.documentElement,r=en(e).on("dragstart.drag",null);t&&(r.on("click.drag",ei,Zl),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 mc=e=>()=>e;function Pp(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}})}Pp.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function zz(e){return!e.ctrlKey&&!e.button}function Dz(){return this.parentNode}function Fz(e,t){return t??{x:e.x,y:e.y}}function $z(){return navigator.maxTouchPoints||"ontouchstart"in this}function rk(){var e=zz,t=Dz,n=Fz,r=$z,s={},o=Rd("start","drag","end"),i=0,l,a,c,u,f=0;function d(w){w.on("mousedown.drag",g).filter(r).on("touchstart.drag",b).on("touchmove.drag",p,Az).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(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,Zl).on("mouseup.drag",v,Zl),tk(w.view),Df(w),c=!1,l=w.clientX,a=w.clientY,N("start",w))}}function x(w){if(ei(w),!c){var E=w.clientX-l,N=w.clientY-a;c=E*E+N*N>f}s.mouse("drag",w)}function v(w){en(w.view).on("mousemove.drag mouseup.drag",null),nk(w.view,c),ei(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]))&&(Df(w),P("start",w,N[I]))}}function p(w){var E=w.changedTouches,N=E.length,k,C;for(k=0;k<N;++k)(C=s[E[k].identifier])&&(ei(w),C("drag",w,E[k]))}function m(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])&&(Df(w),C("end",w,E[k]))}function y(w,E,N,k,C,I){var P=o.copy(),j=On(I||N,E),F,z,R;if((R=n.call(w,new Pp("beforestart",{sourceEvent:N,target:d,identifier:C,active:i,x:j[0],y:j[1],dx:0,dy:0,dispatch:P}),k))!=null)return F=R.x-j[0]||0,z=R.y-j[1]||0,function _(O,$,T){var A=j,M;switch(O){case"start":s[C]=_,M=i++;break;case"end":delete s[C],--i;case"drag":j=On(T||$,E),M=i;break}P.call(O,w,new Pp(O,{sourceEvent:$,subject:R,target:d,identifier:C,active:M,x:j[0]+F,y:j[1]+z,dx:j[0]-A[0],dy:j[1]-A[1],dispatch:P}),k)}}return d.filter=function(w){return arguments.length?(e=typeof w=="function"?w:mc(!!w),d):e},d.container=function(w){return arguments.length?(t=typeof w=="function"?w:mc(w),d):t},d.subject=function(w){return arguments.length?(n=typeof w=="function"?w:mc(w),d):n},d.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:mc(!!w),d):r},d.on=function(){var w=o.on.apply(o,arguments);return w===o?d:w},d.clickDistance=function(w){return arguments.length?(f=(w=+w)*w,d):Math.sqrt(f)},d}function Km(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function sk(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Pa(){}var Jl=.7,Au=1/Jl,ti="\\s*([+-]?\\d+)\\s*",ea="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",nr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Lz=/^#([0-9a-f]{3,8})$/,Hz=new RegExp(`^rgb\\(${ti},${ti},${ti}\\)$`),Bz=new RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`),Vz=new RegExp(`^rgba\\(${ti},${ti},${ti},${ea}\\)$`),Wz=new RegExp(`^rgba\\(${nr},${nr},${nr},${ea}\\)$`),Uz=new RegExp(`^hsl\\(${ea},${nr},${nr}\\)$`),qz=new RegExp(`^hsla\\(${ea},${nr},${nr},${ea}\\)$`),$x={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};Km(Pa,ta,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Lx,formatHex:Lx,formatHex8:Kz,formatHsl:Yz,formatRgb:Hx,toString:Hx});function Lx(){return this.rgb().formatHex()}function Kz(){return this.rgb().formatHex8()}function Yz(){return ok(this).formatHsl()}function Hx(){return this.rgb().formatRgb()}function ta(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Lz.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Bx(t):n===3?new qt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?yc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?yc(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=Hz.exec(e))?new qt(t[1],t[2],t[3],1):(t=Bz.exec(e))?new qt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Vz.exec(e))?yc(t[1],t[2],t[3],t[4]):(t=Wz.exec(e))?yc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Uz.exec(e))?Ux(t[1],t[2]/100,t[3]/100,1):(t=qz.exec(e))?Ux(t[1],t[2]/100,t[3]/100,t[4]):$x.hasOwnProperty(e)?Bx($x[e]):e==="transparent"?new qt(NaN,NaN,NaN,0):null}function Bx(e){return new qt(e>>16&255,e>>8&255,e&255,1)}function yc(e,t,n,r){return r<=0&&(e=t=n=NaN),new qt(e,t,n,r)}function Gz(e){return e instanceof Pa||(e=ta(e)),e?(e=e.rgb(),new qt(e.r,e.g,e.b,e.opacity)):new qt}function Tp(e,t,n,r){return arguments.length===1?Gz(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}Km(qt,Tp,sk(Pa,{brighter(e){return e=e==null?Au:Math.pow(Au,e),new qt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Jl:Math.pow(Jl,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),zu(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:Vx,formatHex:Vx,formatHex8:Qz,formatRgb:Wx,toString:Wx}));function Vx(){return`#${Fs(this.r)}${Fs(this.g)}${Fs(this.b)}`}function Qz(){return`#${Fs(this.r)}${Fs(this.g)}${Fs(this.b)}${Fs((isNaN(this.opacity)?1:this.opacity)*255)}`}function Wx(){const e=zu(this.opacity);return`${e===1?"rgb(":"rgba("}${Zs(this.r)}, ${Zs(this.g)}, ${Zs(this.b)}${e===1?")":`, ${e})`}`}function zu(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 Ux(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 ok(e){if(e instanceof Mn)return new Mn(e.h,e.s,e.l,e.opacity);if(e instanceof Pa||(e=ta(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 Xz(e,t,n,r){return arguments.length===1?ok(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}Km(Mn,Xz,sk(Pa,{brighter(e){return e=e==null?Au:Math.pow(Au,e),new Mn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Jl:Math.pow(Jl,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(Ff(e>=240?e-240:e+120,s,r),Ff(e,s,r),Ff(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Mn(qx(this.h),xc(this.s),xc(this.l),zu(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=zu(this.opacity);return`${e===1?"hsl(":"hsla("}${qx(this.h)}, ${xc(this.s)*100}%, ${xc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function qx(e){return e=(e||0)%360,e<0?e+360:e}function xc(e){return Math.max(0,Math.min(1,e||0))}function Ff(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 ik=e=>()=>e;function Zz(e,t){return function(n){return e+n*t}}function Jz(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 eD(e){return(e=+e)==1?lk:function(t,n){return n-t?Jz(t,n,e):ik(isNaN(t)?n:t)}}function lk(e,t){var n=t-e;return n?Zz(e,n):ik(isNaN(e)?t:e)}const Kx=function e(t){var n=eD(t);function r(s,o){var i=n((s=Tp(s)).r,(o=Tp(o)).r),l=n(s.g,o.g),a=n(s.b,o.b),c=lk(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 Wr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Ip=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$f=new RegExp(Ip.source,"g");function tD(e){return function(){return e}}function nD(e){return function(t){return e(t)+""}}function rD(e,t){var n=Ip.lastIndex=$f.lastIndex=0,r,s,o,i=-1,l=[],a=[];for(e=e+"",t=t+"";(r=Ip.exec(e))&&(s=$f.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:Wr(r,s)})),n=$f.lastIndex;return n<t.length&&(o=t.slice(n),l[i]?l[i]+=o:l[++i]=o),l.length<2?a[0]?nD(a[0].x):tD(t):(t=a.length,function(c){for(var u=0,f;u<t;++u)l[(f=a[u]).i]=f.x(c);return l.join("")})}var Yx=180/Math.PI,Op={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ak(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)*Yx,skewX:Math.atan(a)*Yx,scaleX:i,scaleY:l}}var vc;function sD(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Op:ak(t.a,t.b,t.c,t.d,t.e,t.f)}function oD(e){return e==null||(vc||(vc=document.createElementNS("http://www.w3.org/2000/svg","g")),vc.setAttribute("transform",e),!(e=vc.transform.baseVal.consolidate()))?Op:(e=e.matrix,ak(e.a,e.b,e.c,e.d,e.e,e.f))}function ck(e,t,n,r){function s(c){return c.length?c.pop()+" ":""}function o(c,u,f,d,g,x){if(c!==f||u!==d){var v=g.push("translate(",null,t,null,n);x.push({i:v-4,x:Wr(c,f)},{i:v-2,x:Wr(u,d)})}else(f||d)&&g.push("translate("+f+t+d+n)}function i(c,u,f,d){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),d.push({i:f.push(s(f)+"rotate(",null,r)-2,x:Wr(c,u)})):u&&f.push(s(f)+"rotate("+u+r)}function l(c,u,f,d){c!==u?d.push({i:f.push(s(f)+"skewX(",null,r)-2,x:Wr(c,u)}):u&&f.push(s(f)+"skewX("+u+r)}function a(c,u,f,d,g,x){if(c!==f||u!==d){var v=g.push(s(g)+"scale(",null,",",null,")");x.push({i:v-4,x:Wr(c,f)},{i:v-2,x:Wr(u,d)})}else(f!==1||d!==1)&&g.push(s(g)+"scale("+f+","+d+")")}return function(c,u){var f=[],d=[];return c=e(c),u=e(u),o(c.translateX,c.translateY,u.translateX,u.translateY,f,d),i(c.rotate,u.rotate,f,d),l(c.skewX,u.skewX,f,d),a(c.scaleX,c.scaleY,u.scaleX,u.scaleY,f,d),c=u=null,function(g){for(var x=-1,v=d.length,b;++x<v;)f[(b=d[x]).i]=b.x(g);return f.join("")}}}var iD=ck(sD,"px, ","px)","deg)"),lD=ck(oD,", ",")",")"),aD=1e-12;function Gx(e){return((e=Math.exp(e))+1/e)/2}function cD(e){return((e=Math.exp(e))-1/e)/2}function uD(e){return((e=Math.exp(2*e))-1)/(e+1)}const dD=function e(t,n,r){function s(o,i){var l=o[0],a=o[1],c=o[2],u=i[0],f=i[1],d=i[2],g=u-l,x=f-a,v=g*g+x*x,b,p;if(v<aD)p=Math.log(d/c)/t,b=function(k){return[l+k*g,a+k*x,c*Math.exp(t*k*p)]};else{var m=Math.sqrt(v),y=(d*d-c*c+r*v)/(2*c*n*m),w=(d*d-c*c-r*v)/(2*d*n*m),E=Math.log(Math.sqrt(y*y+1)-y),N=Math.log(Math.sqrt(w*w+1)-w);p=(N-E)/t,b=function(k){var C=k*p,I=Gx(E),P=c/(n*m)*(I*uD(t*C+E)-cD(E));return[l+P*g,a+P*x,c*I/Gx(t*C+E)]}}return b.duration=p*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 Mi=0,hl=0,ol=0,uk=1e3,Du,pl,Fu=0,uo=0,Pd=0,na=typeof performance=="object"&&performance.now?performance:Date,dk=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ym(){return uo||(dk(fD),uo=na.now()+Pd)}function fD(){uo=0}function $u(){this._call=this._time=this._next=null}$u.prototype=fk.prototype={constructor:$u,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ym():+n)+(t==null?0:+t),!this._next&&pl!==this&&(pl?pl._next=this:Du=this,pl=this),this._call=e,this._time=n,_p()},stop:function(){this._call&&(this._call=null,this._time=1/0,_p())}};function fk(e,t,n){var r=new $u;return r.restart(e,t,n),r}function hD(){Ym(),++Mi;for(var e=Du,t;e;)(t=uo-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Mi}function Qx(){uo=(Fu=na.now())+Pd,Mi=hl=0;try{hD()}finally{Mi=0,gD(),uo=0}}function pD(){var e=na.now(),t=e-Fu;t>uk&&(Pd-=t,Fu=e)}function gD(){for(var e,t=Du,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:Du=n);pl=e,_p(r)}function _p(e){if(!Mi){hl&&(hl=clearTimeout(hl));var t=e-uo;t>24?(e<1/0&&(hl=setTimeout(Qx,e-na.now()-Pd)),ol&&(ol=clearInterval(ol))):(ol||(Fu=na.now(),ol=setInterval(pD,uk)),Mi=1,dk(Qx))}}function Xx(e,t,n){var r=new $u;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var mD=Rd("start","end","cancel","interrupt"),yD=[],hk=0,Zx=1,Mp=2,Hc=3,Jx=4,jp=5,Bc=6;function Td(e,t,n,r,s,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;xD(e,n,{name:t,index:r,group:s,on:mD,tween:yD,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:hk})}function Gm(e,t){var n=$n(e,t);if(n.state>hk)throw new Error("too late; already scheduled");return n}function rr(e,t){var n=$n(e,t);if(n.state>Hc)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 xD(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=fk(o,0,n.time);function o(c){n.state=Zx,n.timer.restart(i,n.delay,n.time),n.delay<=c&&i(c-n.delay)}function i(c){var u,f,d,g;if(n.state!==Zx)return a();for(u in r)if(g=r[u],g.name===n.name){if(g.state===Hc)return Xx(i);g.state===Jx?(g.state=Bc,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[u]):+u<t&&(g.state=Bc,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[u])}if(Xx(function(){n.state===Hc&&(n.state=Jx,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=Mp,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Mp){for(n.state=Hc,s=new Array(d=n.tween.length),u=0,f=-1;u<d;++u)(g=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(s[++f]=g);s.length=f+1}}function l(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(a),n.state=jp,1),f=-1,d=s.length;++f<d;)s[f].call(e,u);n.state===jp&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Bc,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Vc(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>Mp&&r.state<jp,r.state=Bc,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}o&&delete e.__transition}}function vD(e){return this.each(function(){Vc(this,e)})}function wD(e,t){var n,r;return function(){var s=rr(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 bD(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=rr(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 SD(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?wD:bD)(n,e,t))}function Qm(e,t,n){var r=e._id;return e.each(function(){var s=rr(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return $n(s,r).value[t]}}function pk(e,t){var n;return(typeof t=="number"?Wr:t instanceof ta?Kx:(n=ta(t))?(t=n,Kx):rD)(e,t)}function ED(e){return function(){this.removeAttribute(e)}}function kD(e){return function(){this.removeAttributeNS(e.space,e.local)}}function CD(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 RD(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 ND(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 PD(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 TD(e,t){var n=Nd(e),r=n==="transform"?lD:pk;return this.attrTween(e,typeof t=="function"?(n.local?PD:ND)(n,r,Qm(this,"attr."+e,t)):t==null?(n.local?kD:ED)(n):(n.local?RD:CD)(n,r,t))}function ID(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function OD(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function _D(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&OD(e,o)),n}return s._value=t,s}function MD(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 jD(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=Nd(e);return this.tween(n,(r.local?_D:MD)(r,t))}function AD(e,t){return function(){Gm(this,e).delay=+t.apply(this,arguments)}}function zD(e,t){return t=+t,function(){Gm(this,e).delay=t}}function DD(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?AD:zD)(t,e)):$n(this.node(),t).delay}function FD(e,t){return function(){rr(this,e).duration=+t.apply(this,arguments)}}function $D(e,t){return t=+t,function(){rr(this,e).duration=t}}function LD(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?FD:$D)(t,e)):$n(this.node(),t).duration}function HD(e,t){if(typeof t!="function")throw new Error;return function(){rr(this,e).ease=t}}function BD(e){var t=this._id;return arguments.length?this.each(HD(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;rr(this,e).ease=n}}function WD(e){if(typeof e!="function")throw new Error;return this.each(VD(this._id,e))}function UD(e){typeof e!="function"&&(e=UE(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 Tr(r,this._parents,this._name,this._id)}function qD(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,o=Math.min(r,s),i=new Array(r),l=0;l<o;++l)for(var a=t[l],c=n[l],u=a.length,f=i[l]=new Array(u),d,g=0;g<u;++g)(d=a[g]||c[g])&&(f[g]=d);for(;l<r;++l)i[l]=t[l];return new Tr(i,this._parents,this._name,this._id)}function KD(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 YD(e,t,n){var r,s,o=KD(t)?Gm:rr;return function(){var i=o(this,e),l=i.on;l!==r&&(s=(r=l).copy()).on(t,n),i.on=s}}function GD(e,t){var n=this._id;return arguments.length<2?$n(this.node(),n).on.on(e):this.each(YD(n,e,t))}function QD(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function XD(){return this.on("end.remove",QD(this._id))}function ZD(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Um(e));for(var r=this._groups,s=r.length,o=new Array(s),i=0;i<s;++i)for(var l=r[i],a=l.length,c=o[i]=new Array(a),u,f,d=0;d<a;++d)(u=l[d])&&(f=e.call(u,u.__data__,d,l))&&("__data__"in u&&(f.__data__=u.__data__),c[d]=f,Td(c[d],t,n,d,c,$n(u,n)));return new Tr(o,this._parents,t,n)}function JD(e){var t=this._name,n=this._id;typeof e!="function"&&(e=WE(e));for(var r=this._groups,s=r.length,o=[],i=[],l=0;l<s;++l)for(var a=r[l],c=a.length,u,f=0;f<c;++f)if(u=a[f]){for(var d=e.call(u,u.__data__,f,a),g,x=$n(u,n),v=0,b=d.length;v<b;++v)(g=d[v])&&Td(g,t,n,v,d,x);o.push(d),i.push(u)}return new Tr(o,i,t,n)}var e5=Na.prototype.constructor;function t5(){return new e5(this._groups,this._parents)}function n5(e,t){var n,r,s;return function(){var o=_i(this,e),i=(this.style.removeProperty(e),_i(this,e));return o===i?null:o===n&&i===r?s:s=t(n=o,r=i)}}function gk(e){return function(){this.style.removeProperty(e)}}function r5(e,t,n){var r,s=n+"",o;return function(){var i=_i(this,e);return i===s?null:i===r?o:o=t(r=i,n)}}function s5(e,t,n){var r,s,o;return function(){var i=_i(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),_i(this,e))),i===a?null:i===r&&a===s?o:(s=a,o=t(r=i,l))}}function o5(e,t){var n,r,s,o="style."+t,i="end."+o,l;return function(){var a=rr(this,e),c=a.on,u=a.value[o]==null?l||(l=gk(t)):void 0;(c!==n||s!==u)&&(r=(n=c).copy()).on(i,s=u),a.on=r}}function i5(e,t,n){var r=(e+="")=="transform"?iD:pk;return t==null?this.styleTween(e,n5(e,r)).on("end.style."+e,gk(e)):typeof t=="function"?this.styleTween(e,s5(e,r,Qm(this,"style."+e,t))).each(o5(this._id,e)):this.styleTween(e,r5(e,r,t),n).on("end.style."+e,null)}function l5(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function a5(e,t,n){var r,s;function o(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&l5(e,i,n)),r}return o._value=t,o}function c5(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,a5(e,t,n??""))}function u5(e){return function(){this.textContent=e}}function d5(e){return function(){var t=e(this);this.textContent=t??""}}function f5(e){return this.tween("text",typeof e=="function"?d5(Qm(this,"text",e)):u5(e==null?"":e+""))}function h5(e){return function(t){this.textContent=e.call(this,t)}}function p5(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&h5(s)),t}return r._value=e,r}function g5(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,p5(e))}function m5(){for(var e=this._name,t=this._id,n=mk(),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);Td(a,e,n,c,i,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Tr(r,this._parents,e,n)}function y5(){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=rr(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 x5=0;function Tr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function mk(){return++x5}var ir=Na.prototype;Tr.prototype={constructor:Tr,select:ZD,selectAll:JD,selectChild:ir.selectChild,selectChildren:ir.selectChildren,filter:UD,merge:qD,selection:t5,transition:m5,call:ir.call,nodes:ir.nodes,node:ir.node,size:ir.size,empty:ir.empty,each:ir.each,on:GD,attr:TD,attrTween:jD,style:i5,styleTween:c5,text:f5,textTween:g5,remove:XD,tween:SD,delay:DD,duration:LD,ease:BD,easeVarying:WD,end:y5,[Symbol.iterator]:ir[Symbol.iterator]};function v5(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var w5={time:null,delay:0,duration:250,ease:v5};function b5(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 S5(e){var t,n;e instanceof Tr?(t=e._id,e=e._name):(t=mk(),(n=w5).time=Ym(),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])&&Td(a,e,t,c,i,n||b5(a,t));return new Tr(r,this._parents,e,t)}Na.prototype.interrupt=vD;Na.prototype.transition=S5;const wc=e=>()=>e;function E5(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 yr(e,t,n){this.k=e,this.x=t,this.y=n}yr.prototype={constructor:yr,scale:function(e){return e===1?this:new yr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new yr(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 Id=new yr(1,0,0);yk.prototype=yr.prototype;function yk(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Id;return e.__zoom}function Lf(e){e.stopImmediatePropagation()}function il(e){e.preventDefault(),e.stopImmediatePropagation()}function k5(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function C5(){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 ev(){return this.__zoom||Id}function R5(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function N5(){return navigator.maxTouchPoints||"ontouchstart"in this}function P5(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 xk(){var e=k5,t=C5,n=P5,r=R5,s=N5,o=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,a=dD,c=Rd("start","zoom","end"),u,f,d,g=500,x=150,v=0,b=10;function p(R){R.property("__zoom",ev).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",P).filter(s).on("touchstart.zoom",j).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(R,_,O,$){var T=R.selection?R.selection():R;T.property("__zoom",ev),R!==T?E(R,_,O,$):T.interrupt().each(function(){N(this,arguments).event($).start().zoom(null,typeof _=="function"?_.apply(this,arguments):_).end()})},p.scaleBy=function(R,_,O,$){p.scaleTo(R,function(){var T=this.__zoom.k,A=typeof _=="function"?_.apply(this,arguments):_;return T*A},O,$)},p.scaleTo=function(R,_,O,$){p.transform(R,function(){var T=t.apply(this,arguments),A=this.__zoom,M=O==null?w(T):typeof O=="function"?O.apply(this,arguments):O,W=A.invert(M),L=typeof _=="function"?_.apply(this,arguments):_;return n(y(m(A,L),M,W),T,i)},O,$)},p.translateBy=function(R,_,O,$){p.transform(R,function(){return n(this.__zoom.translate(typeof _=="function"?_.apply(this,arguments):_,typeof O=="function"?O.apply(this,arguments):O),t.apply(this,arguments),i)},null,$)},p.translateTo=function(R,_,O,$,T){p.transform(R,function(){var A=t.apply(this,arguments),M=this.__zoom,W=$==null?w(A):typeof $=="function"?$.apply(this,arguments):$;return n(Id.translate(W[0],W[1]).scale(M.k).translate(typeof _=="function"?-_.apply(this,arguments):-_,typeof O=="function"?-O.apply(this,arguments):-O),A,i)},$,T)};function m(R,_){return _=Math.max(o[0],Math.min(o[1],_)),_===R.k?R:new yr(_,R.x,R.y)}function y(R,_,O){var $=_[0]-O[0]*R.k,T=_[1]-O[1]*R.k;return $===R.x&&T===R.y?R:new yr(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,A=arguments,M=N(T,A).event($),W=t.apply(T,A),L=O==null?w(W):typeof O=="function"?O.apply(T,A):O,K=Math.max(W[1][0]-W[0][0],W[1][1]-W[0][1]),U=T.__zoom,V=typeof _=="function"?_.apply(T,A):_,B=a(U.invert(L).concat(K/U.k),V.invert(L).concat(K/V.k));return function(q){if(q===1)q=V;else{var H=B(q),Y=K/H[2];q=new yr(Y,L[0]-H[0]*Y,L[1]-H[1]*Y)}M.zoom(null,q)}})}function N(R,_,O){return!O&&R.__zooming||new k(R,_)}function k(R,_){this.that=R,this.args=_,this.active=0,this.sourceEvent=null,this.extent=t.apply(R,_),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,_){return this.mouse&&R!=="mouse"&&(this.mouse[1]=_.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=_.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=_.invert(this.touch1[0])),this.that.__zoom=_,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var _=en(this.that).datum();c.call(R,this.that,new E5(R,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:c}),_)}};function C(R,..._){if(!e.apply(this,arguments))return;var O=N(this,_).event(R),$=this.__zoom,T=Math.max(o[0],Math.min(o[1],$.k*Math.pow(2,r.apply(this,arguments)))),A=On(R);if(O.wheel)(O.mouse[0][0]!==A[0]||O.mouse[0][1]!==A[1])&&(O.mouse[1]=$.invert(O.mouse[0]=A)),clearTimeout(O.wheel);else{if($.k===T)return;O.mouse=[A,$.invert(A)],Vc(this),O.start()}il(R),O.wheel=setTimeout(M,x),O.zoom("mouse",n(y(m($,T),O.mouse[0],O.mouse[1]),O.extent,i));function M(){O.wheel=null,O.end()}}function I(R,..._){if(d||!e.apply(this,arguments))return;var O=R.currentTarget,$=N(this,_,!0).event(R),T=en(R.view).on("mousemove.zoom",L,!0).on("mouseup.zoom",K,!0),A=On(R,O),M=R.clientX,W=R.clientY;tk(R.view),Lf(R),$.mouse=[A,this.__zoom.invert(A)],Vc(this),$.start();function L(U){if(il(U),!$.moved){var V=U.clientX-M,B=U.clientY-W;$.moved=V*V+B*B>v}$.event(U).zoom("mouse",n(y($.that.__zoom,$.mouse[0]=On(U,O),$.mouse[1]),$.extent,i))}function K(U){T.on("mousemove.zoom mouseup.zoom",null),nk(U.view,$.moved),il(U),$.event(U).end()}}function P(R,..._){if(e.apply(this,arguments)){var O=this.__zoom,$=On(R.changedTouches?R.changedTouches[0]:R,this),T=O.invert($),A=O.k*(R.shiftKey?.5:2),M=n(y(m(O,A),$,T),t.apply(this,_),i);il(R),l>0?en(this).transition().duration(l).call(E,M,$,R):en(this).call(p.transform,M,$,R)}}function j(R,..._){if(e.apply(this,arguments)){var O=R.touches,$=O.length,T=N(this,_,R.changedTouches.length===$).event(R),A,M,W,L;for(Lf(R),M=0;M<$;++M)W=O[M],L=On(W,this),L=[L,this.__zoom.invert(L),W.identifier],T.touch0?!T.touch1&&T.touch0[2]!==L[2]&&(T.touch1=L,T.taps=0):(T.touch0=L,A=!0,T.taps=1+!!u);u&&(u=clearTimeout(u)),A&&(T.taps<2&&(f=L[0],u=setTimeout(function(){u=null},g)),Vc(this),T.start())}}function F(R,..._){if(this.__zooming){var O=N(this,_).event(R),$=R.changedTouches,T=$.length,A,M,W,L;for(il(R),A=0;A<T;++A)M=$[A],W=On(M,this),O.touch0&&O.touch0[2]===M.identifier?O.touch0[0]=W:O.touch1&&O.touch1[2]===M.identifier&&(O.touch1[0]=W);if(M=O.that.__zoom,O.touch1){var K=O.touch0[0],U=O.touch0[1],V=O.touch1[0],B=O.touch1[1],q=(q=V[0]-K[0])*q+(q=V[1]-K[1])*q,H=(H=B[0]-U[0])*H+(H=B[1]-U[1])*H;M=m(M,Math.sqrt(q/H)),W=[(K[0]+V[0])/2,(K[1]+V[1])/2],L=[(U[0]+B[0])/2,(U[1]+B[1])/2]}else if(O.touch0)W=O.touch0[0],L=O.touch0[1];else return;O.zoom("touch",n(y(M,W,L),O.extent,i))}}function z(R,..._){if(this.__zooming){var O=N(this,_).event(R),$=R.changedTouches,T=$.length,A,M;for(Lf(R),d&&clearTimeout(d),d=setTimeout(function(){d=null},g),A=0;A<T;++A)M=$[A],O.touch0&&O.touch0[2]===M.identifier?delete O.touch0:O.touch1&&O.touch1[2]===M.identifier&&delete O.touch1;if(O.touch1&&!O.touch0&&(O.touch0=O.touch1,delete O.touch1),O.touch0)O.touch0[1]=this.__zoom.invert(O.touch0[0]);else if(O.end(),O.taps===2&&(M=On(M,this),Math.hypot(f[0]-M[0],f[1]-M[1])<b)){var W=en(this).on("dblclick.zoom");W&&W.apply(this,arguments)}}}return p.wheelDelta=function(R){return arguments.length?(r=typeof R=="function"?R:wc(+R),p):r},p.filter=function(R){return arguments.length?(e=typeof R=="function"?R:wc(!!R),p):e},p.touchable=function(R){return arguments.length?(s=typeof R=="function"?R:wc(!!R),p):s},p.extent=function(R){return arguments.length?(t=typeof R=="function"?R:wc([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),p):t},p.scaleExtent=function(R){return arguments.length?(o[0]=+R[0],o[1]=+R[1],p):[o[0],o[1]]},p.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],p):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},p.constrain=function(R){return arguments.length?(n=R,p):n},p.duration=function(R){return arguments.length?(l=+R,p):l},p.interpolate=function(R){return arguments.length?(a=R,p):a},p.on=function(){var R=c.on.apply(c,arguments);return R===c?p:R},p.clickDistance=function(R){return arguments.length?(v=(R=+R)*R,p):Math.sqrt(v)},p.tapDistance=function(R){return arguments.length?(b=+R,p):b},p}const _r={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.`},ra=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],vk=["Enter"," ","Escape"];var ji;(function(e){e.Strict="strict",e.Loose="loose"})(ji||(ji={}));var Js;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Js||(Js={}));var sa;(function(e){e.Partial="partial",e.Full="full"})(sa||(sa={}));const wk={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Kr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Kr||(Kr={}));var Lu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Lu||(Lu={}));var ue;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ue||(ue={}));const tv={[ue.Left]:ue.Right,[ue.Right]:ue.Left,[ue.Top]:ue.Bottom,[ue.Bottom]:ue.Top};function bk(e){return e===null?null:e?"valid":"invalid"}const Sk=e=>"id"in e&&"source"in e&&"target"in e,T5=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Xm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ta=(e,t=[0,0])=>{const{width:n,height:r}=Mr(e),s=e.origin??t,o=n*s[0],i=r*s[1];return{x:e.position.x-o,y:e.position.y-i}},I5=(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):Xm(s)?s:t.nodeLookup.get(s.id));const l=i?Hu(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Od(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return _d(n)},Ia=(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=Hu(r);n=Od(n,s)}}),_d(n)},Ek=(e,t,[n,r,s]=[0,0,1],o=!1,i=!1)=>{const l={...Oa(t,[n,r,s]),width:t.width/s,height:t.height/s},a=[];for(const c of e.values()){const{measured:u,selectable:f=!0,hidden:d=!1}=c;if(i&&!f||d)continue;const g=u.width??c.width??c.initialWidth??null,x=u.height??c.height??c.initialHeight??null,v=oa(l,zi(c)),b=(g??0)*(x??0),p=o&&v>0;(!c.internals.handleBounds||p||v>=b||c.dragging)&&a.push(c)}return a},O5=(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 Ap(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 zp({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},i){if(e.size===0)return Promise.resolve(!1);const l=Ia(e),a=Zm(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 kk({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:o}){const i=n.get(e),l=i.parentId?n.get(i.parentId):void 0,{x:a,y:c}=l?l.internals.positionAbsolute:{x:0,y:0},u=i.origin??r;let f=s;if(i.extent==="parent"&&!i.expandParent)if(!l)o==null||o("005",_r.error005());else{const g=l.measured.width,x=l.measured.height;g&&x&&(f=[[a,c],[a+g,c+x]])}else l&&Di(i.extent)&&(f=[[i.extent[0][0]+a,i.extent[0][1]+c],[i.extent[1][0]+a,i.extent[1][1]+c]]);const d=Di(f)?fo(t,f,i.measured):t;return{position:{x:d.x-a+i.measured.width*u[0],y:d.y-c+i.measured.height*u[1]},positionAbsolute:d}}async function _5({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const o=new Set(e.map(d=>d.id)),i=[];for(const d of n){if(d.deletable===!1)continue;const g=o.has(d.id),x=!g&&d.parentId&&i.find(v=>v.id===d.parentId);(g||x)&&i.push(d)}const l=new Set(t.map(d=>d.id)),a=r.filter(d=>d.deletable!==!1),u=O5(i,a);for(const d of a)l.has(d.id)&&!u.find(x=>x.id===d.id)&&u.push(d);if(!s)return{edges:u,nodes:i};const f=await s({nodes:i,edges:u});return typeof f=="boolean"?f?{edges:u,nodes:i}:{edges:[],nodes:[]}:f}const Ai=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),fo=(e={x:0,y:0},t,n)=>({x:Ai(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ai(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Ck(e,t,n){const{width:r,height:s}=Mr(n),{x:o,y:i}=n.internals.positionAbsolute;return fo(e,[[o,i],[o+r,i+s]],t)}const nv=(e,t,n)=>e<t?Ai(Math.abs(e-t),1,t)/t:e>n?-Ai(Math.abs(e-n),1,t)/t:0,Rk=(e,t,n=15,r=40)=>{const s=nv(e.x,r,t.width-r)*n,o=nv(e.y,r,t.height-r)*n;return[s,o]},Od=(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)}),Dp=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),_d=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),zi=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=Xm(e)?e.internals.positionAbsolute:Ta(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}},Hu=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=Xm(e)?e.internals.positionAbsolute:Ta(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)}},Nk=(e,t)=>_d(Od(Dp(e),Dp(t))),oa=(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)},rv=e=>jn(e.width)&&jn(e.height)&&jn(e.x)&&jn(e.y),jn=e=>!isNaN(e)&&isFinite(e),M5=(e,t)=>{},Md=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Oa=({x:e,y:t},[n,r,s],o=!1,i=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return o?Md(l,i):l},Pk=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r}),Zm=(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=Ai(a,r,s),u=e.x+e.width/2,f=e.y+e.height/2,d=t/2-u*c,g=n/2-f*c;return{x:d,y:g,zoom:c}},Bu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Di(e){return e!==void 0&&e!=="parent"}function Mr(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 Tk(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 Ik(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}=br(e),l=Oa({x:o-((s==null?void 0:s.left)??0),y:i-((s==null?void 0:s.top)??0)},r),{x:a,y:c}=n?Md(l,t):l;return{xSnapped:a,ySnapped:c,...l}}const jd=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ok=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},j5=["INPUT","SELECT","TEXTAREA"];function Fp(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 j5.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 _k=e=>"clientX"in e,br=(e,t)=>{var o,i;const n=_k(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)}},sv=(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,...jd(i)}})};function Mk({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:i,targetControlY:l}){const a=e*.125+s*.375+i*.375+n*.125,c=t*.125+o*.375+l*.375+r*.125,u=Math.abs(a-e),f=Math.abs(c-t);return[a,c,u,f]}function bc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ov({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case ue.Left:return[t-bc(t-r,o),n];case ue.Right:return[t+bc(r-t,o),n];case ue.Top:return[t,n-bc(n-s,o)];case ue.Bottom:return[t,n+bc(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]=ov({pos:n,x1:e,y1:t,x2:r,y2:s,c:i}),[c,u]=ov({pos:o,x1:r,y1:s,x2:e,y2:t,c:i}),[f,d,g,x]=Mk({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:a,targetControlX:c,targetControlY:u});return[`M${e},${t} C${l},${a} ${c},${u} ${r},${s}`,f,d,g,x]}function Ak({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 A5({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 z5({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=Od(Hu(e),Hu(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 oa(i,_d(o))>0}const D5=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,F5=(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)),$5=(e,t)=>{if(!e.source||!e.target)return t;let n;return Sk(e)?n={...e}:n={...e,id:D5(e)},F5(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function zk({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,i,l]=Ak({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,i,l]}const iv={[ue.Left]:{x:-1,y:0},[ue.Right]:{x:1,y:0},[ue.Top]:{x:0,y:-1},[ue.Bottom]:{x:0,y:1}},L5=({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},lv=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function H5({source:e,sourcePosition:t=ue.Bottom,target:n,targetPosition:r=ue.Top,center:s,offset:o}){const i=iv[t],l=iv[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=L5({source:a,sourcePosition:t,target:c}),f=u.x!==0?"x":"y",d=u[f];let g=[],x,v;const b={x:0,y:0},p={x:0,y:0},[m,y,w,E]=Ak({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[f]*l[f]===-1){x=s.x??m,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[f]===d?g=f==="x"?k:C:g=f==="x"?C:k}else{const k=[{x:a.x,y:c.y}],C=[{x:c.x,y:a.y}];if(f==="x"?g=i.x===d?C:k:g=i.y===d?k:C,t===r){const z=Math.abs(e[f]-n[f]);if(z<=o){const R=Math.min(o-1,o-z);i[f]===d?b[f]=(a[f]>e[f]?-1:1)*R:p[f]=(c[f]>n[f]?-1:1)*R}}if(t!==r){const z=f==="x"?"y":"x",R=i[f]===l[z],_=a[z]>c[z],O=a[z]<c[z];(i[f]===1&&(!R&&_||R&&O)||i[f]!==1&&(!R&&O||R&&_))&&(g=f==="x"?k:C)}const I={x:a.x+b.x,y:a.y+b.y},P={x:c.x+p.x,y:c.y+p.y},j=Math.max(Math.abs(I.x-g[0].x),Math.abs(P.x-g[0].x)),F=Math.max(Math.abs(I.y-g[0].y),Math.abs(P.y-g[0].y));j>=F?(x=(I.x+P.x)/2,v=g[0].y):(x=g[0].x,v=(I.y+P.y)/2)}return[[e,{x:a.x+b.x,y:a.y+b.y},...g,{x:c.x+p.x,y:c.y+p.y},n],x,v,w,E]}function B5(e,t,n,r){const s=Math.min(lv(e,t)/2,lv(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 $p({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,f,d,g,x]=H5({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,p,m)=>{let y="";return m>0&&m<u.length-1?y=B5(u[m-1],p,u[m+1],i):y=`${m===0?"M":"L"}${p.x} ${p.y}`,b+=y,b},""),f,d,g,x]}function av(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function V5(e){var f;const{sourceNode:t,targetNode:n}=e;if(!av(t)||!av(n))return null;const r=t.internals.handleBounds||cv(t.handles),s=n.internals.handleBounds||cv(n.handles),o=uv((r==null?void 0:r.source)??[],e.sourceHandle),i=uv(e.connectionMode===ji.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!o||!i)return(f=e.onError)==null||f.call(e,"008",_r.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=ia(t,o,l),u=ia(n,i,a);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:l,targetPosition:a}}function cv(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 ia(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??Mr(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 uv(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Lp(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function W5(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=Lp(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 Jm={nodeOrigin:[0,0],nodeExtent:ra,elevateNodesOnSelect:!0,defaults:{}},U5={...Jm,checkEquality:!0};function e0(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function q5(e,t,n){const r=e0(Jm,n);for(const s of e.values())if(s.parentId)t0(s,e,t,r);else{const o=Ta(s,r.nodeOrigin),i=Di(s.extent)?s.extent:r.nodeExtent,l=fo(o,i,Mr(s));s.internals.positionAbsolute=l}}function Hp(e,t,n,r){var l,a;const s=e0(U5,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 f=Ta(c,s.nodeOrigin),d=Di(c.extent)?c.extent:s.nodeExtent,g=fo(f,d,Mr(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:g,handleBounds:c.measured?u==null?void 0:u.internals.handleBounds:void 0,z:Dk(c,i),userNode:c}},t.set(c.id,u)}c.parentId&&t0(u,t,n,r)}}function K5(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 t0(e,t,n,r){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:i}=e0(Jm,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}K5(e,n);const c=s?1e3:0,{x:u,y:f,z:d}=Y5(e,a,o,i,c),{positionAbsolute:g}=e.internals,x=u!==g.x||f!==g.y;(x||d!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:x?{x:u,y:f}:g,z:d})}function Dk(e,t){return(jn(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Y5(e,t,n,r,s){const{x:o,y:i}=t.internals.positionAbsolute,l=Mr(e),a=Ta(e,n),c=Di(e.extent)?fo(a,e.extent,l):a;let u=fo({x:o+c.x,y:i+c.y},r,l);e.extent==="parent"&&(u=Ck(u,l,t));const f=Dk(e,s),d=t.internals.z??0;return{x:u.x,y:u.y,z:d>f?d:f}}function n0(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)??zi(a),u=Nk(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,f=Mr(a),d=a.origin??r,g=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(f.width,Math.round(l.width)),b=Math.max(f.height,Math.round(l.height)),p=(v-f.width)*d[0],m=(b-f.height)*d[1];(g>0||x>0||p||m)&&(s.push({id:c,type:"position",position:{x:a.position.x-g+p,y:a.position.y-x+m}}),(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+g,y:w.position.y+x}})})),(f.width<l.width||f.height<l.height||g||x)&&s.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:v+(g?d[0]*g-p:0),height:b+(x?d[1]*x-m:0)}})}),s}function G5(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),f=[];for(const d of e.values()){const g=t.get(d.id);if(g)if(g.hidden)g.internals={...g.internals,handleBounds:void 0},l=!0;else{const x=jd(d.nodeElement),v=g.measured.width!==x.width||g.measured.height!==x.height;if(!!(x.width&&x.height&&(v||!g.internals.handleBounds||d.force))){const p=d.nodeElement.getBoundingClientRect(),m=Di(g.extent)?g.extent:o;let{positionAbsolute:y}=g.internals;g.parentId&&g.extent==="parent"?y=Ck(y,x,t.get(g.parentId)):m&&(y=fo(y,m,x)),g.measured=x,g.internals={...g.internals,positionAbsolute:y,handleBounds:{source:sv("source",d.nodeElement,p,u,g.id),target:sv("target",d.nodeElement,p,u,g.id)}},g.parentId&&t0(g,t,n,{nodeOrigin:s}),l=!0,v&&(a.push({id:g.id,type:"dimensions",dimensions:x}),g.expandParent&&g.parentId&&f.push({id:g.id,parentId:g.parentId,rect:zi(g,s)}))}}}if(f.length>0){const d=n0(f,t,n,s);a.push(...d)}return{changes:a,updatedInternals:l}}async function Q5({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 Fk(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,f=e.get(c)||new Map,d={edgeId:r.id,source:s,target:o,sourceHandle:i,targetHandle:l};t.set(r.id,r),e.set(a,u.set(`${o}-${l}`,d)),e.set(c,f.set(`${s}-${i}`,d))}}function $k(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:$k(n,t):!1}function dv(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 X5(e,t,n,r){const s=new Map;for(const[o,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!$k(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 Hf({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var i,l,a;const s=[];for(const[c,u]of t){const f=(i=n.get(c))==null?void 0:i.internals.userNode;f&&s.push({...f,position:u.position,dragging:r})}if(!e)return[s[0],s];const o=(l=n.get(e))==null?void 0:l.internals.userNode;return[o?{...o,position:((a=t.get(e))==null?void 0:a.position)||o.position,dragging:r}:s[0],s]}function Z5({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let o={x:null,y:null},i=0,l=new Map,a=!1,c={x:0,y:0},u=null,f=!1,d=null,g=!1;function x({noDragClassName:b,handleSelector:p,domNode:m,isSelectable:y,nodeId:w,nodeClickDistance:E=0}){d=en(m);function N({x:P,y:j},F){const{nodeLookup:z,nodeExtent:R,snapGrid:_,snapToGrid:O,nodeOrigin:$,onNodeDrag:T,onSelectionDrag:A,onError:M,updateNodePositions:W}=t();o={x:P,y:j};let L=!1,K={x:0,y:0,x2:0,y2:0};if(l.size>1&&R){const U=Ia(l);K=Dp(U)}for(const[U,V]of l){if(!z.has(U))continue;let B={x:P-V.distance.x,y:j-V.distance.y};O&&(B=Md(B,_));let q=[[R[0][0],R[0][1]],[R[1][0],R[1][1]]];if(l.size>1&&R&&!V.extent){const{positionAbsolute:te}=V.internals,Z=te.x-K.x+R[0][0],G=te.x+V.measured.width-K.x2+R[1][0],X=te.y-K.y+R[0][1],ne=te.y+V.measured.height-K.y2+R[1][1];q=[[Z,X],[G,ne]]}const{position:H,positionAbsolute:Y}=kk({nodeId:U,nextPosition:B,nodeLookup:z,nodeExtent:q,nodeOrigin:$,onError:M});L=L||V.position.x!==H.x||V.position.y!==H.y,V.position=H,V.internals.positionAbsolute=Y}if(L&&(W(l,!0),F&&(r||T||!w&&A))){const[U,V]=Hf({nodeId:w,dragItems:l,nodeLookup:z});r==null||r(F,l,U,V),T==null||T(F,U,V),w||A==null||A(F,V)}}async function k(){if(!u)return;const{transform:P,panBy:j,autoPanSpeed:F}=t(),[z,R]=Rk(c,u,F);(z!==0||R!==0)&&(o.x=(o.x??0)-z/P[2],o.y=(o.y??0)-R/P[2],await j({x:z,y:R})&&N(o,null)),i=requestAnimationFrame(k)}function C(P){var L;const{nodeLookup:j,multiSelectionActive:F,nodesDraggable:z,transform:R,snapGrid:_,snapToGrid:O,selectNodesOnDrag:$,onNodeDragStart:T,onSelectionDragStart:A,unselectNodesAndEdges:M}=t();f=!0,(!$||!y)&&!F&&w&&((L=j.get(w))!=null&&L.selected||M()),y&&$&&w&&(e==null||e(w));const W=Pl(P.sourceEvent,{transform:R,snapGrid:_,snapToGrid:O,containerBounds:u});if(o=W,l=X5(j,z,W,w),l.size>0&&(n||T||!w&&A)){const[K,U]=Hf({nodeId:w,dragItems:l,nodeLookup:j});n==null||n(P.sourceEvent,l,K,U),T==null||T(P.sourceEvent,K,U),w||A==null||A(P.sourceEvent,U)}}const I=rk().clickDistance(E).on("start",P=>{const{domNode:j,nodeDragThreshold:F,transform:z,snapGrid:R,snapToGrid:_}=t();u=(j==null?void 0:j.getBoundingClientRect())||null,g=!1,F===0&&C(P),o=Pl(P.sourceEvent,{transform:z,snapGrid:R,snapToGrid:_,containerBounds:u}),c=br(P.sourceEvent,u)}).on("drag",P=>{const{autoPanOnNodeDrag:j,transform:F,snapGrid:z,snapToGrid:R,nodeDragThreshold:_,nodeLookup:O}=t(),$=Pl(P.sourceEvent,{transform:F,snapGrid:z,snapToGrid:R,containerBounds:u});if((P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||w&&!O.has(w))&&(g=!0),!g){if(!a&&j&&f&&(a=!0,k()),!f){const T=$.xSnapped-(o.x??0),A=$.ySnapped-(o.y??0);Math.sqrt(T*T+A*A)>_&&C(P)}(o.x!==$.xSnapped||o.y!==$.ySnapped)&&l&&f&&(c=br(P.sourceEvent,u),N($,P.sourceEvent))}}).on("end",P=>{if(!(!f||g)&&(a=!1,f=!1,cancelAnimationFrame(i),l.size>0)){const{nodeLookup:j,updateNodePositions:F,onNodeDragStop:z,onSelectionDragStop:R}=t();if(F(l,!1),s||z||!w&&R){const[_,O]=Hf({nodeId:w,dragItems:l,nodeLookup:j,dragging:!1});s==null||s(P.sourceEvent,l,_,O),z==null||z(P.sourceEvent,_,O),w||R==null||R(P.sourceEvent,O)}}}).filter(P=>{const j=P.target;return!P.button&&(!b||!dv(j,`.${b}`,m))&&(!p||dv(j,p,m))});d.call(I)}function v(){d==null||d.on(".drag",null)}return{update:x,destroy:v}}function J5(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())oa(s,zi(o))>0&&r.push(o);return r}const eF=250;function tF(e,t,n,r){var l,a;let s=[],o=1/0;const i=J5(e,n,t+eF);for(const c of i){const u=[...((l=c.internals.handleBounds)==null?void 0:l.source)??[],...((a=c.internals.handleBounds)==null?void 0:a.target)??[]];for(const f of u){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:d,y:g}=ia(c,f,f.position,!0),x=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(g-e.y,2));x>t||(x<o?(s=[{...f,x:d,y:g}],o=x):x===o&&s.push({...f,x:d,y:g}))}}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 Lk(e,t,n,r,s,o=!1){var c,u,f;const i=r.get(e);if(!i)return null;const l=s==="strict"?(c=i.internals.handleBounds)==null?void 0:c[t]:[...((u=i.internals.handleBounds)==null?void 0:u.source)??[],...((f=i.internals.handleBounds)==null?void 0:f.target)??[]],a=(n?l==null?void 0:l.find(d=>d.id===n):l==null?void 0:l[0])??null;return a&&o?{...a,...ia(i,a,a.position,!0)}:a}function Hk(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function nF(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Bk=()=>!0;function rF(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:i,domNode:l,nodeLookup:a,lib:c,autoPanOnConnect:u,flowId:f,panBy:d,cancelConnection:g,onConnectStart:x,onConnect:v,onConnectEnd:b,isValidConnection:p=Bk,onReconnectEnd:m,updateConnection:y,getTransform:w,getFromHandle:E,autoPanSpeed:N}){const k=Ok(e.target);let C=0,I;const{x:P,y:j}=br(e),F=k==null?void 0:k.elementFromPoint(P,j),z=Hk(o,F),R=l==null?void 0:l.getBoundingClientRect();if(!R||!z)return;const _=Lk(s,z,r,a,t);if(!_)return;let O=br(e,R),$=!1,T=null,A=!1,M=null;function W(){if(!u||!R)return;const[Y,te]=Rk(O,R,N);d({x:Y,y:te}),C=requestAnimationFrame(W)}const L={..._,nodeId:s,type:z,position:_.position},K=a.get(s),V={inProgress:!0,isValid:null,from:ia(K,L,ue.Left,!0),fromHandle:L,fromPosition:L.position,fromNode:K,to:O,toHandle:null,toPosition:tv[L.position],toNode:null};y(V);let B=V;x==null||x(e,{nodeId:s,handleId:r,handleType:z});function q(Y){if(!E()||!L){H(Y);return}const te=w();O=br(Y,R),I=tF(Oa(O,te,!1,[1,1]),n,a,L),$||(W(),$=!0);const Z=Vk(Y,{handle:I,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:i?"target":"source",isValidConnection:p,doc:k,lib:c,flowId:f,nodeLookup:a});M=Z.handleDomNode,T=Z.connection,A=nF(!!I,Z.isValid);const G={...B,isValid:A,to:I&&A?Pk({x:I.x,y:I.y},te):O,toHandle:Z.toHandle,toPosition:A&&Z.toHandle?Z.toHandle.position:tv[L.position],toNode:Z.toHandle?a.get(Z.toHandle.nodeId):null};A&&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 H(Y){(I||M)&&T&&A&&(v==null||v(T));const{inProgress:te,...Z}=B,G={...Z,toPosition:B.toHandle?B.toPosition:null};b==null||b(Y,G),o&&(m==null||m(Y,G)),g(),cancelAnimationFrame(C),$=!1,A=!1,T=null,M=null,k.removeEventListener("mousemove",q),k.removeEventListener("mouseup",H),k.removeEventListener("touchmove",q),k.removeEventListener("touchend",H)}k.addEventListener("mousemove",q),k.addEventListener("mouseup",H),k.addEventListener("touchmove",q),k.addEventListener("touchend",H)}function Vk(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:i,lib:l,flowId:a,isValidConnection:c=Bk,nodeLookup:u}){const f=o==="target",d=t?i.querySelector(`.${l}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:g,y:x}=br(e),v=i.elementFromPoint(g,x),b=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:d,p={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const m=Hk(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||!m)return p;const k={source:f?y:r,sourceHandle:f?w:s,target:f?r:y,targetHandle:f?s:w};p.connection=k;const I=E&&N&&(n===ji.Strict?f&&m==="source"||!f&&m==="target":y!==r||w!==s);p.isValid=I&&c(k),p.toHandle=Lk(y,m,w,u,n,!1)}return p}const Bp={onPointerDown:rF,isValid:Vk};function sF({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=en(e);function o({translateExtent:l,width:a,height:c,zoomStep:u=10,pannable:f=!0,zoomable:d=!0,inversePan:g=!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])},p=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]))*(g?-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)},m=xk().on("start",b).on("zoom",f?p:null).on("zoom.wheel",d?x:null);s.call(m,{})}function i(){s.on("zoom",null)}return{update:o,destroy:i,pointer:On}}const oF=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Ad=e=>({x:e.x,y:e.y,zoom:e.k}),Bf=({x:e,y:t,zoom:n})=>Id.translate(e,t).scale(n),Wo=(e,t)=>e.target.closest(`.${t}`),Wk=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Vf=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},Uk=e=>{const t=e.ctrlKey&&Bu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function iF({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:c}){return u=>{if(Wo(u,t))return!1;u.preventDefault(),u.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(u.ctrlKey&&i){const b=On(u),p=Uk(u),m=f*Math.pow(2,p);r.scaleTo(n,m,b,u);return}const d=u.deltaMode===1?20:1;let g=s===Js.Vertical?0:u.deltaX*d,x=s===Js.Horizontal?0:u.deltaY*d;!Bu()&&u.shiftKey&&s!==Js.Vertical&&(g=u.deltaY*d,x=0),r.translateBy(n,-(g/f)*o,-(x/f)*o,{internal:!0});const v=Ad(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 lF({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){if(!t&&r.type==="wheel"&&!r.ctrlKey||Wo(r,e))return null;r.preventDefault(),n.call(this,r,s)}}function aF({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,i,l;if((o=r.sourceEvent)!=null&&o.internal)return;const s=Ad(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 cF({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var i,l;e.usedRightMouseButton=!!(n&&Wk(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,Ad(o.transform)))}}function uF({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&&Wk(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&o(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),s&&oF(e.prevViewport,i.transform))){const a=Ad(i.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(i.sourceEvent,a)},n?150:0)}}}function dF({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 f=e||t,d=n&&u.ctrlKey;if(u.button===1&&u.type==="mousedown"&&(Wo(u,`${c}-flow__node`)||Wo(u,`${c}-flow__edge`)))return!0;if(!r&&!f&&!s&&!o&&!n||i||Wo(u,l)&&u.type==="wheel"||Wo(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(!f&&!s&&!d&&u.type==="wheel"||!r&&(u.type==="mousedown"||u.type==="touchstart")||Array.isArray(r)&&!r.includes(u.button)&&u.type==="mousedown")return!1;const g=Array.isArray(r)&&r.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||u.type==="wheel")&&g}}function fF({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},f=e.getBoundingClientRect(),d=xk().clickDistance(!jn(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(s),g=en(e).call(d);y({x:o.x,y:o.y,zoom:Ai(o.zoom,t,n)},[[0,0],[f.width,f.height]],s);const x=g.on("wheel.zoom"),v=g.on("dblclick.zoom");d.wheelDelta(Uk);function b(F,z){return g?new Promise(R=>{d==null||d.transform(Vf(g,z==null?void 0:z.duration,()=>R(!0)),F)}):Promise.resolve(!1)}function p({noWheelClassName:F,noPanClassName:z,onPaneContextMenu:R,userSelectionActive:_,panOnScroll:O,panOnDrag:$,panOnScrollMode:T,panOnScrollSpeed:A,preventScrolling:M,zoomOnPinch:W,zoomOnScroll:L,zoomOnDoubleClick:K,zoomActivationKeyPressed:U,lib:V,onTransformChange:B}){_&&!u.isZoomingOrPanning&&m();const H=O&&!U&&!_?iF({zoomPanValues:u,noWheelClassName:F,d3Selection:g,d3Zoom:d,panOnScrollMode:T,panOnScrollSpeed:A,zoomOnPinch:W,onPanZoomStart:l,onPanZoom:i,onPanZoomEnd:a}):lF({noWheelClassName:F,preventScrolling:M,d3ZoomHandler:x});if(g.on("wheel.zoom",H,{passive:!1}),!_){const te=aF({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:l});d.on("start",te);const Z=cF({zoomPanValues:u,panOnDrag:$,onPaneContextMenu:!!R,onPanZoom:i,onTransformChange:B});d.on("zoom",Z);const G=uF({zoomPanValues:u,panOnDrag:$,panOnScroll:O,onPaneContextMenu:R,onPanZoomEnd:a,onDraggingChange:c});d.on("end",G)}const Y=dF({zoomActivationKeyPressed:U,panOnDrag:$,zoomOnScroll:L,panOnScroll:O,zoomOnDoubleClick:K,zoomOnPinch:W,userSelectionActive:_,noPanClassName:z,noWheelClassName:F,lib:V});d.filter(Y),K?g.on("dblclick.zoom",v):g.on("dblclick.zoom",null)}function m(){d.on("zoom",null)}async function y(F,z,R){const _=Bf(F),O=d==null?void 0:d.constrain()(_,z,R);return O&&await b(O),new Promise($=>$(O))}async function w(F,z){const R=Bf(F);return await b(R,z),new Promise(_=>_(R))}function E(F){if(g){const z=Bf(F),R=g.property("__zoom");(R.k!==F.zoom||R.x!==F.x||R.y!==F.y)&&(d==null||d.transform(g,z,null,{sync:!0}))}}function N(){const F=g?yk(g.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}function k(F,z){return g?new Promise(R=>{d==null||d.scaleTo(Vf(g,z==null?void 0:z.duration,()=>R(!0)),F)}):Promise.resolve(!1)}function C(F,z){return g?new Promise(R=>{d==null||d.scaleBy(Vf(g,z==null?void 0:z.duration,()=>R(!0)),F)}):Promise.resolve(!1)}function I(F){d==null||d.scaleExtent(F)}function P(F){d==null||d.translateExtent(F)}function j(F){const z=!jn(F)||F<0?0:F;d==null||d.clickDistance(z)}return{update:p,destroy:m,setViewport:w,setViewportConstrained:y,getViewport:N,scaleTo:k,scaleBy:C,setScaleExtent:I,setTranslateExtent:P,syncViewport:E,setClickDistance:j}}var Tl;(function(e){e.Line="line",e.Handle="handle"})(Tl||(Tl={}));function hF({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 pF(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 $r(e,t){return Math.max(0,t-e)}function Lr(e,t){return Math.max(0,e-t)}function Sc(e,t,n){return Math.max(0,t-e,e-n)}function fv(e,t){return e?!t:t}function gF(e,t,n,r,s,o,i,l){let{affectsX:a,affectsY:c}=t;const{isHorizontal:u,isVertical:f}=t,d=u&&f,{xSnapped:g,ySnapped:x}=n,{minWidth:v,maxWidth:b,minHeight:p,maxHeight:m}=r,{x:y,y:w,width:E,height:N,aspectRatio:k}=e;let C=Math.floor(u?g-e.pointerX:0),I=Math.floor(f?x-e.pointerY:0);const P=E+(a?-C:C),j=N+(c?-I:I),F=-o[0]*E,z=-o[1]*N;let R=Sc(P,v,b),_=Sc(j,p,m);if(i){let T=0,A=0;a&&C<0?T=$r(y+C+F,i[0][0]):!a&&C>0&&(T=Lr(y+P+F,i[1][0])),c&&I<0?A=$r(w+I+z,i[0][1]):!c&&I>0&&(A=Lr(w+j+z,i[1][1])),R=Math.max(R,T),_=Math.max(_,A)}if(l){let T=0,A=0;a&&C>0?T=Lr(y+C,l[0][0]):!a&&C<0&&(T=$r(y+P,l[1][0])),c&&I>0?A=Lr(w+I,l[0][1]):!c&&I<0&&(A=$r(w+j,l[1][1])),R=Math.max(R,T),_=Math.max(_,A)}if(s){if(u){const T=Sc(P/k,p,m)*k;if(R=Math.max(R,T),i){let A=0;!a&&!c||a&&!c&&d?A=Lr(w+z+P/k,i[1][1])*k:A=$r(w+z+(a?C:-C)/k,i[0][1])*k,R=Math.max(R,A)}if(l){let A=0;!a&&!c||a&&!c&&d?A=$r(w+P/k,l[1][1])*k:A=Lr(w+(a?C:-C)/k,l[0][1])*k,R=Math.max(R,A)}}if(f){const T=Sc(j*k,v,b)/k;if(_=Math.max(_,T),i){let A=0;!a&&!c||c&&!a&&d?A=Lr(y+j*k+F,i[1][0])/k:A=$r(y+(c?I:-I)*k+F,i[0][0])/k,_=Math.max(_,A)}if(l){let A=0;!a&&!c||c&&!a&&d?A=$r(y+j*k,l[1][0])/k:A=Lr(y+(c?I:-I)*k,l[0][0])/k,_=Math.max(_,A)}}}I=I+(I<0?_:-_),C=C+(C<0?R:-R),s&&(d?P>j*k?I=(fv(a,c)?-C:C)/k:C=(fv(a,c)?-I:I)*k:u?(I=C/k,c=a):(C=I*k,a=c));const O=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)+O,y:o[1]*I*(c?-1:1)+$}}const qk={width:0,height:0,x:0,y:0},mF={...qk,pointerX:0,pointerY:0,aspectRatio:1};function yF(e){return[[0,0],[e.measured.width,e.measured.height]]}function xF(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 vF({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=en(e);function i({controlPosition:a,boundaries:c,keepAspectRatio:u,onResizeStart:f,onResize:d,onResizeEnd:g,shouldResize:x}){let v={...qk},b={...mF};const p=pF(a);let m,y=null,w=[],E,N,k;const C=rk().on("start",I=>{const{nodeLookup:P,transform:j,snapGrid:F,snapToGrid:z,nodeOrigin:R,paneDomNode:_}=n();if(m=P.get(t),!m)return;y=(_==null?void 0:_.getBoundingClientRect())??null;const{xSnapped:O,ySnapped:$}=Pl(I.sourceEvent,{transform:j,snapGrid:F,snapToGrid:z,containerBounds:y});v={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},b={...v,pointerX:O,pointerY:$,aspectRatio:v.width/v.height},E=void 0,m.parentId&&(m.extent==="parent"||m.expandParent)&&(E=P.get(m.parentId),N=E&&m.extent==="parent"?yF(E):void 0),w=[],k=void 0;for(const[T,A]of P)if(A.parentId===t&&(w.push({id:T,position:{...A.position},extent:A.extent}),A.extent==="parent"||A.expandParent)){const M=xF(A,m,A.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}f==null||f(I,{...v})}).on("drag",I=>{const{transform:P,snapGrid:j,snapToGrid:F,nodeOrigin:z}=n(),R=Pl(I.sourceEvent,{transform:P,snapGrid:j,snapToGrid:F,containerBounds:y}),_=[];if(!m)return;const{x:O,y:$,width:T,height:A}=v,M={},W=m.origin??z,{width:L,height:K,x:U,y:V}=gF(b,p,R,c,u,W,N,k),B=L!==T,q=K!==A,H=U!==O&&B,Y=V!==$&&q;if(!H&&!Y&&!B&&!q)return;if((H||Y||W[0]===1||W[1]===1)&&(M.x=H?U:v.x,M.y=Y?V:v.y,v.x=M.x,v.y=M.y,w.length>0)){const X=U-O,ne=V-$;for(const fe of w)fe.position={x:fe.position.x-X+W[0]*(L-T),y:fe.position.y-ne+W[1]*(K-A)},_.push(fe)}if((B||q)&&(M.width=B?L:v.width,M.height=q?K:v.height,v.width=M.width,v.height=M.height),E&&m.expandParent){const X=W[0]*(M.width??0);M.x&&M.x<X&&(v.x=X,b.x=b.x-(M.x-X));const ne=W[1]*(M.height??0);M.y&&M.y<ne&&(v.y=ne,b.y=b.y-(M.y-ne))}const te=hF({width:v.width,prevWidth:T,height:v.height,prevHeight:A,affectsX:p.affectsX,affectsY:p.affectsY}),Z={...v,direction:te};(x==null?void 0:x(I,Z))!==!1&&(d==null||d(I,Z),r(M,_))}).on("end",I=>{g==null||g(I,{...v}),s==null||s()});o.call(C)}function l(){o.on(".drag",null)}return{update:i,destroy:l}}const wF={},hv=e=>{let t;const n=new Set,r=(u,f)=>{const d=typeof u=="function"?u(t):u;if(!Object.is(d,t)){const g=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(x=>x(t,g))}},s=()=>t,a={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(wF?"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},bF=e=>e?hv(e):hv,{useDebugValue:SF}=hw,{useSyncExternalStoreWithSelector:EF}=h2,kF=e=>e;function Kk(e,t=kF,n){const r=EF(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return SF(r),r}const pv=(e,t)=>{const n=bF(e),r=(s,o=t)=>Kk(n,s,o);return Object.assign(r,n),r},CF=(e,t)=>e?pv(e,t):pv;function et(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 zd=S.createContext(null),RF=zd.Provider,Yk=_r.error001();function Oe(e,t){const n=S.useContext(zd);if(n===null)throw new Error(Yk);return Kk(n,e,t)}function Ue(){const e=S.useContext(zd);if(e===null)throw new Error(Yk);return S.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const gv={display:"none"},NF={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Gk="react-flow__node-desc",Qk="react-flow__edge-desc",PF="react-flow__aria-live",TF=e=>e.ariaLiveMessage;function IF({rfId:e}){const t=Oe(TF);return h.jsx("div",{id:`${PF}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:NF,children:t})}function OF({rfId:e,disableKeyboardA11y:t}){return h.jsxs(h.Fragment,{children:[h.jsxs("div",{id:`${Gk}-${e}`,style:gv,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:`${Qk}-${e}`,style:gv,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&h.jsx(IF,{rfId:e})]})}const _F=e=>e.userSelectionActive?"none":"all",r0=S.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const i=Oe(_F),l=`${e}`.split("-");return h.jsx("div",{className:st(["react-flow__panel",n,...l]),style:{...r,pointerEvents:i},ref:o,...s,children:t})});function MF({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:h.jsx(r0,{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 jF=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}},Ec=e=>e.id;function AF(e,t){return et(e.selectedNodes.map(Ec),t.selectedNodes.map(Ec))&&et(e.selectedEdges.map(Ec),t.selectedEdges.map(Ec))}function zF({onSelectionChange:e}){const t=Ue(),{selectedNodes:n,selectedEdges:r}=Oe(jF,AF);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 DF=e=>!!e.onSelectionChangeHandlers;function FF({onSelectionChange:e}){const t=Oe(DF);return e||t?h.jsx(zF,{onSelectionChange:e}):null}const Xk=[0,0],$F={x:0,y:0,zoom:1},LF=["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"],mv=[...LF,"rfId"],HF=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}),yv={translateExtent:ra,nodeOrigin:Xk,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function BF(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:a,setPaneClickDistance:c}=Oe(HF,et),u=Ue();S.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{f.current=yv,l()}),[]);const f=S.useRef(yv);return S.useEffect(()=>{for(const d of mv){const g=e[d],x=f.current[d];g!==x&&(typeof e[d]>"u"||(d==="nodes"?t(g):d==="edges"?n(g):d==="minZoom"?r(g):d==="maxZoom"?s(g):d==="translateExtent"?o(g):d==="nodeExtent"?i(g):d==="paneClickDistance"?c(g):d==="fitView"?u.setState({fitViewOnInit:g}):d==="fitViewOptions"?u.setState({fitViewOnInitOptions:g}):u.setState({[d]:g})))}f.current=e},mv.map(d=>e[d])),null}function xv(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function VF(e){var r;const[t,n]=S.useState(e==="system"?null:e);return S.useEffect(()=>{if(e!=="system"){n(e);return}const s=xv(),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=xv())!=null&&r.matches?"dark":"light"}const vv=typeof document<"u"?document:null;function la(e=null,t={target:vv,actInsideInputWithModifier:!0}){const[n,r]=S.useState(!1),s=S.useRef(!1),o=S.useRef(new Set([])),[i,l]=S.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),u=c.reduce((f,d)=>f.concat(...d),[]);return[c,u]}return[[],[]]},[e]);return S.useEffect(()=>{const a=(t==null?void 0:t.target)||vv;if(e!==null){const c=d=>{if(s.current=d.ctrlKey||d.metaKey||d.shiftKey,(!s.current||s.current&&!t.actInsideInputWithModifier)&&Fp(d))return!1;const x=bv(d.code,l);o.current.add(d[x]),wv(i,o.current,!1)&&(d.preventDefault(),r(!0))},u=d=>{if((!s.current||s.current&&!t.actInsideInputWithModifier)&&Fp(d))return!1;const x=bv(d.code,l);wv(i,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(d[x]),d.key==="Meta"&&o.current.clear(),s.current=!1},f=()=>{o.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",c),a==null||a.addEventListener("keyup",u),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{a==null||a.removeEventListener("keydown",c),a==null||a.removeEventListener("keyup",u),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function wv(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function bv(e,t){return t.includes(e)?"code":"key"}const WF=()=>{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=Ap(n,t),{width:a,height:c}=jd(i);return zp({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=Zm(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 Oa(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=Pk(t,n);return{x:i.x+s,y:i.y+o}}}),[])};function Zk(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)UF(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 UF(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 qF(e,t){return Zk(e,t)}function KF(e,t){return Zk(e,t)}function _s(e,t){return{id:e,type:"select",selected:t}}function Uo(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 Sv({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 Ev(e){return{id:e.id,type:"remove"}}const kv=e=>T5(e),YF=e=>Sk(e);function Jk(e){return S.forwardRef(e)}const GF=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Cv(e){const[t,n]=S.useState(BigInt(0)),[r]=S.useState(()=>QF(()=>n(s=>s+BigInt(1))));return GF(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function QF(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const eC=S.createContext(null);function XF({children:e}){const t=Ue(),n=S.useCallback(l=>{const{nodes:a=[],setNodes:c,hasDefaultNodes:u,onNodesChange:f,nodeLookup:d}=t.getState();let g=a;for(const x of l)g=typeof x=="function"?x(g):x;u?c(g):f&&f(Sv({items:g,lookup:d}))},[]),r=Cv(n),s=S.useCallback(l=>{const{edges:a=[],setEdges:c,hasDefaultEdges:u,onEdgesChange:f,edgeLookup:d}=t.getState();let g=a;for(const x of l)g=typeof x=="function"?x(g):x;u?c(g):f&&f(Sv({items:g,lookup:d}))},[]),o=Cv(s),i=S.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return h.jsx(eC.Provider,{value:i,children:e})}function ZF(){const e=S.useContext(eC);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const JF=e=>!!e.panZoom;function s0(){const e=WF(),t=Ue(),n=ZF(),r=Oe(JF),s=S.useMemo(()=>{const o=f=>t.getState().nodeLookup.get(f),i=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},a=f=>{var p,m;const{nodeLookup:d,nodeOrigin:g}=t.getState(),x=kv(f)?f:d.get(f.id),v=x.parentId?Ik(x.position,x.measured,x.parentId,d,g):x.position,b={...x,position:v,width:((p=x.measured)==null?void 0:p.width)??x.width,height:((m=x.measured)==null?void 0:m.height)??x.height};return zi(b)},c=(f,d,g={replace:!1})=>{i(x=>x.map(v=>{if(v.id===f){const b=typeof d=="function"?d(v):d;return g.replace&&kv(b)?b:{...v,...b}}return v}))},u=(f,d,g={replace:!1})=>{l(x=>x.map(v=>{if(v.id===f){const b=typeof d=="function"?d(v):d;return g.replace&&YF(b)?b:{...v,...b}}return v}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var d;return(d=o(f))==null?void 0:d.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(d=>({...d}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:i,setEdges:l,addNodes:f=>{const d=Array.isArray(f)?f:[f];n.nodeQueue.push(g=>[...g,...d])},addEdges:f=>{const d=Array.isArray(f)?f:[f];n.edgeQueue.push(g=>[...g,...d])},toObject:()=>{const{nodes:f=[],edges:d=[],transform:g}=t.getState(),[x,v,b]=g;return{nodes:f.map(p=>({...p})),edges:d.map(p=>({...p})),viewport:{x,y:v,zoom:b}}},deleteElements:async({nodes:f=[],edges:d=[]})=>{const{nodes:g,edges:x,onNodesDelete:v,onEdgesDelete:b,triggerNodeChanges:p,triggerEdgeChanges:m,onDelete:y,onBeforeDelete:w}=t.getState(),{nodes:E,edges:N}=await _5({nodesToRemove:f,edgesToRemove:d,nodes:g,edges:x,onBeforeDelete:w}),k=N.length>0,C=E.length>0;if(k){const I=N.map(Ev);b==null||b(N),m(I)}if(C){const I=E.map(Ev);v==null||v(E),p(I)}return(C||k)&&(y==null||y({nodes:E,edges:N})),{deletedNodes:E,deletedEdges:N}},getIntersectingNodes:(f,d=!0,g)=>{const x=rv(f),v=x?f:a(f),b=g!==void 0;return v?(g||t.getState().nodes).filter(p=>{const m=t.getState().nodeLookup.get(p.id);if(m&&!x&&(p.id===f.id||!m.internals.positionAbsolute))return!1;const y=zi(b?p:m),w=oa(y,v);return d&&w>0||w>=v.width*v.height}):[]},isNodeIntersecting:(f,d,g=!0)=>{const v=rv(f)?f:a(f);if(!v)return!1;const b=oa(v,d);return g&&b>0||b>=v.width*v.height},updateNode:c,updateNodeData:(f,d,g={replace:!1})=>{c(f,x=>{const v=typeof d=="function"?d(x):d;return g.replace?{...x,data:v}:{...x,data:{...x.data,...v}}},g)},updateEdge:u,updateEdgeData:(f,d,g={replace:!1})=>{u(f,x=>{const v=typeof d=="function"?d(x):d;return g.replace?{...x,data:v}:{...x,data:{...x.data,...v}}},g)},getNodesBounds:f=>{const{nodeLookup:d,nodeOrigin:g}=t.getState();return I5(f,{nodeLookup:d,nodeOrigin:g})},getHandleConnections:({type:f,id:d,nodeId:g})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${g}-${f}-${d??null}`))==null?void 0:x.values())??[])}}},[]);return S.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const Rv=e=>e.selected,e$={actInsideInputWithModifier:!1},t$=typeof window<"u"?window:void 0;function n$({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Ue(),{deleteElements:r}=s0(),s=la(e,e$),o=la(t,{target:t$});S.useEffect(()=>{if(s){const{edges:i,nodes:l}=n.getState();r({nodes:l.filter(Rv),edges:i.filter(Rv)}),n.setState({nodesSelectionActive:!1})}},[s]),S.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function r$(e){const t=Ue();S.useEffect(()=>{const n=()=>{var s,o;if(!e.current)return!1;const r=jd(e.current);(r.height===0||r.width===0)&&((o=(s=t.getState()).onError)==null||o.call(s,"004",_r.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 Dd={position:"absolute",width:"100%",height:"100%",top:0,left:0},s$=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function o$({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:f,zoomActivationKeyCode:d,preventScrolling:g=!0,children:x,noWheelClassName:v,noPanClassName:b,onViewportChange:p,isControlledViewport:m,paneClickDistance:y}){const w=Ue(),E=S.useRef(null),{userSelectionActive:N,lib:k}=Oe(s$,et),C=la(d),I=S.useRef();r$(E);const P=S.useCallback(j=>{p==null||p({x:j[0],y:j[1],zoom:j[2]}),m||w.setState({transform:j})},[p,m]);return S.useEffect(()=>{if(E.current){I.current=fF({domNode:E.current,minZoom:u,maxZoom:f,translateExtent:c,viewport:a,paneClickDistance:y,onDraggingChange:R=>w.setState({paneDragging:R}),onPanZoomStart:(R,_)=>{const{onViewportChangeStart:O,onMoveStart:$}=w.getState();$==null||$(R,_),O==null||O(_)},onPanZoom:(R,_)=>{const{onViewportChange:O,onMove:$}=w.getState();$==null||$(R,_),O==null||O(_)},onPanZoomEnd:(R,_)=>{const{onViewportChangeEnd:O,onMoveEnd:$}=w.getState();$==null||$(R,_),O==null||O(_)}});const{x:j,y:F,zoom:z}=I.current.getViewport();return w.setState({panZoom:I.current,transform:[j,F,z],domNode:E.current.closest(".react-flow")}),()=>{var R;(R=I.current)==null||R.destroy()}}},[]),S.useEffect(()=>{var j;(j=I.current)==null||j.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:i,panOnDrag:l,zoomActivationKeyPressed:C,preventScrolling:g,noPanClassName:b,userSelectionActive:N,noWheelClassName:v,lib:k,onTransformChange:P})},[e,t,n,r,s,o,i,l,C,g,b,N,v,k,P]),h.jsx("div",{className:"react-flow__renderer",ref:E,style:Dd,children:x})}const i$=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function l$(){const{userSelectionActive:e,userSelectionRect:t}=Oe(i$,et);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 Wf=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},a$=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function c$({isSelecting:e,selectionKeyPressed:t,selectionMode:n=sa.Full,panOnDrag:r,selectionOnDrag:s,onSelectionStart:o,onSelectionEnd:i,onPaneClick:l,onPaneContextMenu:a,onPaneScroll:c,onPaneMouseEnter:u,onPaneMouseMove:f,onPaneMouseLeave:d,children:g}){const x=S.useRef(null),v=Ue(),b=S.useRef(0),p=S.useRef(0),m=S.useRef(),y=S.useRef(new Map),{userSelectionActive:w,elementsSelectable:E,dragging:N}=Oe(a$,et),k=E&&(e||w),C=S.useRef(!1),I=S.useRef(!1),P=()=>{v.setState({userSelectionActive:!1,userSelectionRect:null}),b.current=0,p.current=0},j=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 U,V,B,q;const{resetSelectedElements:A,domNode:M,edgeLookup:W}=v.getState();if(m.current=M==null?void 0:M.getBoundingClientRect(),!E||!e||T.button!==0||T.target!==x.current||!m.current)return;(V=(U=T.target)==null?void 0:U.setPointerCapture)==null||V.call(U,T.pointerId),I.current=!0,C.current=!1,y.current=new Map;for(const[H,Y]of W)y.current.set(Y.source,((B=y.current.get(Y.source))==null?void 0:B.add(H))||new Set([H])),y.current.set(Y.target,((q=y.current.get(Y.target))==null?void 0:q.add(H))||new Set([H]));const{x:L,y:K}=br(T.nativeEvent,m.current);A(),v.setState({userSelectionRect:{width:0,height:0,startX:L,startY:K,x:L,y:K}}),o==null||o(T)},_=T=>{const{userSelectionRect:A,edgeLookup:M,transform:W,nodeLookup:L,triggerNodeChanges:K,triggerEdgeChanges:U}=v.getState();if(!m.current||!A)return;C.current=!0;const{x:V,y:B}=br(T.nativeEvent,m.current),{startX:q,startY:H}=A,Y={startX:q,startY:H,x:V<q?V:q,y:B<H?B:H,width:Math.abs(V-q),height:Math.abs(B-H)},te=Ek(L,Y,W,n===sa.Partial,!0),Z=new Set,G=new Set;for(const X of te){G.add(X.id);const ne=y.current.get(X.id);if(ne)for(const fe of ne)Z.add(fe)}if(b.current!==G.size){b.current=G.size;const X=Uo(L,G,!0);K(X)}if(p.current!==Z.size){p.current=Z.size;const X=Uo(M,Z);U(X)}v.setState({userSelectionRect:Y,userSelectionActive:!0,nodesSelectionActive:!1})},O=T=>{var M,W;if(T.button!==0||!I.current)return;(W=(M=T.target)==null?void 0:M.releasePointerCapture)==null||W.call(M,T.pointerId);const{userSelectionRect:A}=v.getState();!w&&A&&T.target===x.current&&(j==null||j(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:st(["react-flow__pane",{draggable:$,dragging:N,selection:e}]),onClick:k?void 0:Wf(j,x),onContextMenu:Wf(F,x),onWheel:Wf(z,x),onPointerEnter:k?void 0:u,onPointerDown:k?R:f,onPointerMove:k?_:f,onPointerUp:k?O:void 0,onPointerLeave:d,ref:x,style:Dd,children:[g,h.jsx(l$,{})]})}function Vp({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",_r.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 tC({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=Z5({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{Vp({id:f,store:l,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),S.useEffect(()=>{var f,d;if(t)(f=u.current)==null||f.destroy();else if(e.current)return(d=u.current)==null||d.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:i}),()=>{var g;(g=u.current)==null||g.destroy()}},[n,r,t,o,e,s]),a}const u$=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function nC(){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(),f=new Map,d=u$(i),g=s?o[0]:5,x=s?o[1]:5,v=n.direction.x*g*n.factor,b=n.direction.y*x*n.factor;for(const[,p]of c){if(!d(p))continue;let m={x:p.internals.positionAbsolute.x+v,y:p.internals.positionAbsolute.y+b};s&&(m=Md(m,o));const{position:y,positionAbsolute:w}=kk({nodeId:p.id,nextPosition:m,nodeLookup:c,nodeExtent:r,nodeOrigin:u,onError:l});p.position=y,p.internals.positionAbsolute=w,f.set(p.id,p)}a(f)},[])}const o0=S.createContext(null),d$=o0.Provider;o0.Consumer;const rC=()=>S.useContext(o0),f$=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),h$=(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===ji.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 p$({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:f,...d},g){var R,_;const x=i||null,v=e==="target",b=Ue(),p=rC(),{connectOnClick:m,noPanClassName:y,rfId:w}=Oe(f$,et),{connectingFrom:E,connectingTo:N,clickConnecting:k,isPossibleEndHandle:C,connectionInProcess:I,valid:P}=Oe(h$(p,x,e),et);p||(_=(R=b.getState()).onError)==null||_.call(R,"010",_r.error010());const j=O=>{const{defaultEdgeOptions:$,onConnect:T,hasDefaultEdges:A}=b.getState(),M={...$,...O};if(A){const{edges:W,setEdges:L}=b.getState();L($5(M,W))}T==null||T(M),l==null||l(M)},F=O=>{if(!p)return;const $=_k(O.nativeEvent);if(s&&($&&O.button===0||!$)){const T=b.getState();Bp.onPointerDown(O.nativeEvent,{autoPanOnConnect:T.autoPanOnConnect,connectionMode:T.connectionMode,connectionRadius:T.connectionRadius,domNode:T.domNode,nodeLookup:T.nodeLookup,lib:T.lib,isTarget:v,handleId:x,nodeId:p,flowId:T.rfId,panBy:T.panBy,cancelConnection:T.cancelConnection,onConnectStart:T.onConnectStart,onConnectEnd:T.onConnectEnd,updateConnection:T.updateConnection,onConnect:j,isValidConnection:n||T.isValidConnection,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:T.autoPanSpeed})}$?u==null||u(O):f==null||f(O)},z=O=>{const{onClickConnectStart:$,onClickConnectEnd:T,connectionClickStartHandle:A,connectionMode:M,isValidConnection:W,lib:L,rfId:K,nodeLookup:U,connection:V}=b.getState();if(!p||!A&&!s)return;if(!A){$==null||$(O.nativeEvent,{nodeId:p,handleId:x,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:p,type:e,id:x}});return}const B=Ok(O.target),q=n||W,{connection:H,isValid:Y}=Bp.isValid(O.nativeEvent,{handle:{nodeId:p,id:x,type:e},connectionMode:M,fromNodeId:A.nodeId,fromHandleId:A.id||null,fromType:A.type,isValidConnection:q,flowId:K,doc:B,lib:L,nodeLookup:U});Y&&H&&j(H);const te=structuredClone(V);delete te.inProgress,te.toPosition=te.toHandle?te.toHandle.position:null,T==null||T(O,te),b.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":x,"data-nodeid":p,"data-handlepos":t,"data-id":`${w}-${p}-${x}-${e}`,className:st(["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:m?z:void 0,ref:g,...d,children:a})}const Ss=S.memo(Jk(p$));function g$({data:e,isConnectable:t,sourcePosition:n=ue.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(Ss,{type:"source",position:n,isConnectable:t})]})}function m$({data:e,isConnectable:t,targetPosition:n=ue.Top,sourcePosition:r=ue.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(Ss,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(Ss,{type:"source",position:r,isConnectable:t})]})}function y$(){return null}function x$({data:e,isConnectable:t,targetPosition:n=ue.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(Ss,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Vu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Nv={input:g$,default:m$,output:x$,group:y$};function v$(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 w$=e=>{const{width:t,height:n,x:r,y:s}=Ia(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 b$({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Ue(),{width:s,height:o,transformString:i,userSelectionActive:l}=Oe(w$,et),a=nC(),c=S.useRef(null);if(S.useEffect(()=>{var d;n||(d=c.current)==null||d.focus({preventScroll:!0})},[n]),tC({nodeRef:c}),l||!s||!o)return null;const u=e?d=>{const g=r.getState().nodes.filter(x=>x.selected);e(d,g)}:void 0,f=d=>{Object.prototype.hasOwnProperty.call(Vu,d.key)&&(d.preventDefault(),a({direction:Vu[d.key],factor:d.shiftKey?4:1}))};return h.jsx("div",{className:st(["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:f,style:{width:s,height:o}})})}const Pv=typeof window<"u"?window:void 0,S$=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function sC({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:c,selectionOnDrag:u,selectionMode:f,onSelectionStart:d,onSelectionEnd:g,multiSelectionKeyCode:x,panActivationKeyCode:v,zoomActivationKeyCode:b,elementsSelectable:p,zoomOnScroll:m,zoomOnPinch:y,panOnScroll:w,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:k,panOnDrag:C,defaultViewport:I,translateExtent:P,minZoom:j,maxZoom:F,preventScrolling:z,onSelectionContextMenu:R,noWheelClassName:_,noPanClassName:O,disableKeyboardA11y:$,onViewportChange:T,isControlledViewport:A}){const{nodesSelectionActive:M,userSelectionActive:W}=Oe(S$),L=la(c,{target:Pv}),K=la(v,{target:Pv}),U=K||C,V=K||w,B=u&&U!==!0,q=L||W||B;return n$({deleteKeyCode:a,multiSelectionKeyCode:x}),h.jsx(o$,{onPaneContextMenu:o,elementsSelectable:p,zoomOnScroll:m,zoomOnPinch:y,panOnScroll:V,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:k,panOnDrag:!L&&U,defaultViewport:I,translateExtent:P,minZoom:j,maxZoom:F,zoomActivationKeyCode:b,preventScrolling:z,noWheelClassName:_,noPanClassName:O,onViewportChange:T,isControlledViewport:A,paneClickDistance:l,children:h.jsxs(c$,{onSelectionStart:d,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,panOnDrag:U,isSelecting:!!q,selectionMode:f,selectionKeyPressed:L,selectionOnDrag:B,children:[e,M&&h.jsx(b$,{onSelectionContextMenu:R,noPanClassName:O,disableKeyboardA11y:$})]})})}sC.displayName="FlowRenderer";const E$=S.memo(sC),k$=e=>t=>e?Ek(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 C$(e){return Oe(S.useCallback(k$(e),[e]),et)}const R$=e=>e.updateNodeInternals;function N$(){const e=Oe(R$),[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 P$({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 f=c.current!==t,d=l.current!==e.sourcePosition,g=a.current!==e.targetPosition;(f||d||g)&&(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 T$({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:i,nodesDraggable:l,elementsSelectable:a,nodesConnectable:c,nodesFocusable:u,resizeObserver:f,noDragClassName:d,noPanClassName:g,disableKeyboardA11y:x,rfId:v,nodeTypes:b,nodeExtent:p,nodeClickDistance:m,onError:y}){const{node:w,internals:E,isParent:N}=Oe(H=>{const Y=H.nodeLookup.get(e),te=H.parentLookup.has(e);return{node:Y,internals:Y.internals,isParent:te}},et);let k=w.type||"default",C=(b==null?void 0:b[k])||Nv[k];C===void 0&&(y==null||y("003",_r.error003(k)),k="default",C=Nv.default);const I=!!(w.draggable||l&&typeof w.draggable>"u"),P=!!(w.selectable||a&&typeof w.selectable>"u"),j=!!(w.connectable||c&&typeof w.connectable>"u"),F=!!(w.focusable||u&&typeof w.focusable>"u"),z=Ue(),R=Tk(w),_=P$({node:w,nodeType:k,hasDimensions:R,resizeObserver:f}),O=tC({nodeRef:_,disabled:w.hidden||!I,noDragClassName:d,handleSelector:w.dragHandle,nodeId:e,isSelectable:P,nodeClickDistance:m}),$=nC();if(w.hidden)return null;const T=Mr(w),A=v$(w),M=P||I||t||n||r||s,W=n?H=>n(H,{...E.userNode}):void 0,L=r?H=>r(H,{...E.userNode}):void 0,K=s?H=>s(H,{...E.userNode}):void 0,U=o?H=>o(H,{...E.userNode}):void 0,V=i?H=>i(H,{...E.userNode}):void 0,B=H=>{const{selectNodesOnDrag:Y,nodeDragThreshold:te}=z.getState();P&&(!Y||!I||te>0)&&Vp({id:e,store:z,nodeRef:_}),t&&t(H,{...E.userNode})},q=H=>{if(!(Fp(H.nativeEvent)||x))if(vk.includes(H.key)&&P){const Y=H.key==="Escape";Vp({id:e,store:z,unselect:Y,nodeRef:_})}else I&&w.selected&&Object.prototype.hasOwnProperty.call(Vu,H.key)&&(H.preventDefault(),z.setState({ariaLiveMessage:`Moved selected node ${H.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~E.positionAbsolute.x}, y: ${~~E.positionAbsolute.y}`}),$({direction:Vu[H.key],factor:H.shiftKey?4:1}))};return h.jsx("div",{className:st(["react-flow__node",`react-flow__node-${k}`,{[g]:I},w.className,{selected:w.selected,selectable:P,parent:N,draggable:I,dragging:O}]),ref:_,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:M?"all":"none",visibility:R?"visible":"hidden",...w.style,...A},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:W,onMouseMove:L,onMouseLeave:K,onContextMenu:U,onClick:B,onDoubleClick:V,onKeyDown:F?q:void 0,tabIndex:F?0:void 0,role:F?"button":void 0,"aria-describedby":x?void 0:`${Gk}-${v}`,"aria-label":w.ariaLabel,children:h.jsx(d$,{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:j,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:O,dragHandle:w.dragHandle,zIndex:E.z,parentId:w.parentId,...T})})})}const I$=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function oC(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:o}=Oe(I$,et),i=C$(e.onlyRenderVisibleElements),l=N$();return h.jsx("div",{className:"react-flow__nodes",style:Dd,children:i.map(a=>h.jsx(T$,{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))})}oC.displayName="NodeRenderer";const O$=S.memo(oC);function _$(e){return Oe(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&&z5({sourceNode:o,targetNode:i,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),et)}const M$=({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"}),j$=({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"}),Tv={[Lu.Arrow]:M$,[Lu.ArrowClosed]:j$};function A$(e){const t=Ue();return S.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(Tv,e)?Tv[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",_r.error009(e)),null)},[e])}const z$=({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=A$(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},iC=({defaultColor:e,rfId:t})=>{const n=Oe(o=>o.edges),r=Oe(o=>o.defaultEdgeOptions),s=S.useMemo(()=>W5(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(z$,{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};iC.displayName="MarkerDefinitions";var D$=S.memo(iC);function lC({x:e,y:t,label:n,labelStyle:r={},labelShowBg:s=!0,labelBgStyle:o={},labelBgPadding:i=[2,4],labelBgBorderRadius:l=2,children:a,className:c,...u}){const[f,d]=S.useState({x:1,y:0,width:0,height:0}),g=st(["react-flow__edge-textwrapper",c]),x=S.useRef(null);return S.useEffect(()=>{if(x.current){const v=x.current.getBBox();d({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),typeof n>"u"||!n?null:h.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:g,visibility:f.width?"visible":"hidden",...u,children:[s&&h.jsx("rect",{width:f.width+2*i[0],x:-i[0],y:-i[1],height:f.height+2*i[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),h.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:x,style:r,children:n}),a]})}lC.displayName="EdgeText";const F$=S.memo(lC);function Fd({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:st(["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(F$,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function Iv({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 aC({sourceX:e,sourceY:t,sourcePosition:n=ue.Bottom,targetX:r,targetY:s,targetPosition:o=ue.Top}){const[i,l]=Iv({pos:n,x1:e,y1:t,x2:r,y2:s}),[a,c]=Iv({pos:o,x1:r,y1:s,x2:e,y2:t}),[u,f,d,g]=Mk({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:i,sourceControlY:l,targetControlX:a,targetControlY:c});return[`M${e},${t} C${i},${l} ${a},${c} ${r},${s}`,u,f,d,g]}function cC(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:f,labelBgPadding:d,labelBgBorderRadius:g,style:x,markerEnd:v,markerStart:b,interactionWidth:p})=>{const[m,y,w]=aC({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l}),E=e.isInternal?void 0:t;return h.jsx(Fd,{id:E,path:m,labelX:y,labelY:w,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:g,style:x,markerEnd:v,markerStart:b,interactionWidth:p})})}const $$=cC({isInternal:!1}),uC=cC({isInternal:!0});$$.displayName="SimpleBezierEdge";uC.displayName="SimpleBezierEdgeInternal";function dC(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,sourcePosition:g=ue.Bottom,targetPosition:x=ue.Top,markerEnd:v,markerStart:b,pathOptions:p,interactionWidth:m})=>{const[y,w,E]=$p({sourceX:n,sourceY:r,sourcePosition:g,targetX:s,targetY:o,targetPosition:x,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset}),N=e.isInternal?void 0:t;return h.jsx(Fd,{id:N,path:y,labelX:w,labelY:E,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:v,markerStart:b,interactionWidth:m})})}const fC=dC({isInternal:!1}),hC=dC({isInternal:!0});fC.displayName="SmoothStepEdge";hC.displayName="SmoothStepEdgeInternal";function pC(e){return S.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return h.jsx(fC,{...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 L$=pC({isInternal:!1}),gC=pC({isInternal:!0});L$.displayName="StepEdge";gC.displayName="StepEdgeInternal";function mC(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:g,markerStart:x,interactionWidth:v})=>{const[b,p,m]=zk({sourceX:n,sourceY:r,targetX:s,targetY:o}),y=e.isInternal?void 0:t;return h.jsx(Fd,{id:y,path:b,labelX:p,labelY:m,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:g,markerStart:x,interactionWidth:v})})}const H$=mC({isInternal:!1}),yC=mC({isInternal:!0});H$.displayName="StraightEdge";yC.displayName="StraightEdgeInternal";function xC(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:f,labelBgPadding:d,labelBgBorderRadius:g,style:x,markerEnd:v,markerStart:b,pathOptions:p,interactionWidth:m})=>{const[y,w,E]=jk({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l,curvature:p==null?void 0:p.curvature}),N=e.isInternal?void 0:t;return h.jsx(Fd,{id:N,path:y,labelX:w,labelY:E,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:g,style:x,markerEnd:v,markerStart:b,interactionWidth:m})})}const B$=xC({isInternal:!1}),vC=xC({isInternal:!0});B$.displayName="BezierEdge";vC.displayName="BezierEdgeInternal";const Ov={default:vC,straight:yC,step:gC,smoothstep:hC,simplebezier:uC},_v={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},V$=(e,t,n)=>n===ue.Left?e-t:n===ue.Right?e+t:e,W$=(e,t,n)=>n===ue.Top?e-t:n===ue.Bottom?e+t:e,Mv="react-flow__edgeupdater";function jv({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:st([Mv,`${Mv}-${l}`]),cx:V$(t,r,e),cy:W$(n,r,e),r,stroke:"transparent",fill:"transparent"})}function U$({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:i,sourcePosition:l,targetPosition:a,onReconnect:c,onReconnectStart:u,onReconnectEnd:f,setReconnecting:d,setUpdateHover:g}){const x=Ue(),v=(w,E)=>{if(w.button!==0)return;const{autoPanOnConnect:N,domNode:k,isValidConnection:C,connectionMode:I,connectionRadius:P,lib:j,onConnectStart:F,onConnectEnd:z,cancelConnection:R,nodeLookup:_,rfId:O,panBy:$,updateConnection:T}=x.getState(),A=E.type==="target";d(!0),u==null||u(w,n,E.type);const M=(L,K)=>{d(!1),f==null||f(L,n,E.type,K)},W=L=>c==null?void 0:c(n,L);Bp.onPointerDown(w.nativeEvent,{autoPanOnConnect:N,connectionMode:I,connectionRadius:P,domNode:k,handleId:E.id,nodeId:E.nodeId,nodeLookup:_,isTarget:A,edgeUpdaterType:E.type,lib:j,flowId:O,cancelConnection:R,panBy:$,isValidConnection:C,onConnect:W,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"}),p=w=>v(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),m=()=>g(!0),y=()=>g(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(jv,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:b,onMouseEnter:m,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&h.jsx(jv,{position:a,centerX:o,centerY:i,radius:t,onMouseDown:p,onMouseEnter:m,onMouseOut:y,type:"target"})]})}function q$({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:i,onMouseEnter:l,onMouseMove:a,onMouseLeave:c,reconnectRadius:u,onReconnect:f,onReconnectStart:d,onReconnectEnd:g,rfId:x,edgeTypes:v,noPanClassName:b,onError:p,disableKeyboardA11y:m}){let y=Oe(G=>G.edgeLookup.get(e));const w=Oe(G=>G.defaultEdgeOptions);y=w?{...w,...y}:y;let E=y.type||"default",N=(v==null?void 0:v[E])||Ov[E];N===void 0&&(p==null||p("011",_r.error011(E)),E="default",N=Ov.default);const k=!!(y.focusable||t&&typeof y.focusable>"u"),C=typeof f<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),I=!!(y.selectable||r&&typeof y.selectable>"u"),P=S.useRef(null),[j,F]=S.useState(!1),[z,R]=S.useState(!1),_=Ue(),{zIndex:O,sourceX:$,sourceY:T,targetX:A,targetY:M,sourcePosition:W,targetPosition:L}=Oe(S.useCallback(G=>{const X=G.nodeLookup.get(y.source),ne=G.nodeLookup.get(y.target);if(!X||!ne)return{zIndex:y.zIndex,..._v};const fe=V5({id:e,sourceNode:X,targetNode:ne,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:G.connectionMode,onError:p});return{zIndex:A5({selected:y.selected,zIndex:y.zIndex,sourceNode:X,targetNode:ne,elevateOnSelect:G.elevateEdgesOnSelect}),...fe||_v}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),et),K=S.useMemo(()=>y.markerStart?`url('#${Lp(y.markerStart,x)}')`:void 0,[y.markerStart,x]),U=S.useMemo(()=>y.markerEnd?`url('#${Lp(y.markerEnd,x)}')`:void 0,[y.markerEnd,x]);if(y.hidden||$===null||T===null||A===null||M===null)return null;const V=G=>{var Te;const{addSelectedEdges:X,unselectNodesAndEdges:ne,multiSelectionActive:fe}=_.getState();I&&(_.setState({nodesSelectionActive:!1}),y.selected&&fe?(ne({nodes:[],edges:[y]}),(Te=P.current)==null||Te.blur()):X([e])),s&&s(G,y)},B=o?G=>{o(G,{...y})}:void 0,q=i?G=>{i(G,{...y})}:void 0,H=l?G=>{l(G,{...y})}:void 0,Y=a?G=>{a(G,{...y})}:void 0,te=c?G=>{c(G,{...y})}:void 0,Z=G=>{var X;if(!m&&vk.includes(G.key)&&I){const{unselectNodesAndEdges:ne,addSelectedEdges:fe}=_.getState();G.key==="Escape"?((X=P.current)==null||X.blur(),ne({edges:[y]})):fe([e])}};return h.jsx("svg",{style:{zIndex:O},children:h.jsxs("g",{className:st(["react-flow__edge",`react-flow__edge-${E}`,y.className,b,{selected:y.selected,animated:y.animated,inactive:!I&&!s,updating:j,selectable:I}]),onClick:V,onDoubleClick:B,onContextMenu:q,onMouseEnter:H,onMouseMove:Y,onMouseLeave:te,onKeyDown:k?Z: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?`${Qk}-${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:A,targetY:M,sourcePosition:W,targetPosition:L,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:K,markerEnd:U,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),C&&h.jsx(U$,{edge:y,isReconnectable:C,reconnectRadius:u,onReconnect:f,onReconnectStart:d,onReconnectEnd:g,sourceX:$,sourceY:T,targetX:A,targetY:M,sourcePosition:W,targetPosition:L,setUpdateHover:F,setReconnecting:R})]})})}const K$=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function wC({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:c,onEdgeClick:u,reconnectRadius:f,onEdgeDoubleClick:d,onReconnectStart:g,onReconnectEnd:x,disableKeyboardA11y:v}){const{edgesFocusable:b,edgesReconnectable:p,elementsSelectable:m,onError:y}=Oe(K$,et),w=_$(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(D$,{defaultColor:e,rfId:n}),w.map(E=>h.jsx(q$,{id:E,edgesFocusable:b,edgesReconnectable:p,elementsSelectable:m,noPanClassName:s,onReconnect:o,onContextMenu:i,onMouseEnter:l,onMouseMove:a,onMouseLeave:c,onClick:u,reconnectRadius:f,onDoubleClick:d,onReconnectStart:g,onReconnectEnd:x,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:v},E))]})}wC.displayName="EdgeRenderer";const Y$=S.memo(wC),G$=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Q$({children:e}){const t=Oe(G$);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function X$(e){const t=s0(),n=S.useRef(!1);S.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Z$=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function J$(e){const t=Oe(Z$),n=Ue();return S.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function e3(e){return e.connection.inProgress?{...e.connection,to:Oa(e.connection.to,e.transform)}:{...e.connection}}function t3(e){return e3}function n3(e){const t=t3();return Oe(t,et)}const r3=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function s3({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:i,isValid:l,inProgress:a}=Oe(r3,et);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:st(["react-flow__connection",bk(l)]),children:h.jsx(bC,{style:t,type:n,CustomComponent:r,isValid:l})})})}const bC=({style:e,type:t=Kr.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:i,fromHandle:l,fromPosition:a,to:c,toNode:u,toHandle:f,toPosition:d}=n3();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:d,connectionStatus:bk(r),toNode:u,toHandle:f});let g="";const x={sourceX:o.x,sourceY:o.y,sourcePosition:a,targetX:c.x,targetY:c.y,targetPosition:d};switch(t){case Kr.Bezier:[g]=jk(x);break;case Kr.SimpleBezier:[g]=aC(x);break;case Kr.Step:[g]=$p({...x,borderRadius:0});break;case Kr.SmoothStep:[g]=$p(x);break;default:[g]=zk(x)}return h.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};bC.displayName="ConnectionLine";const o3={};function Av(e=o3){S.useRef(e),Ue(),S.useEffect(()=>{},[e])}function i3(){Ue(),S.useRef(!1),S.useEffect(()=>{},[])}function SC({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:c,onNodeContextMenu:u,onSelectionContextMenu:f,onSelectionStart:d,onSelectionEnd:g,connectionLineType:x,connectionLineStyle:v,connectionLineComponent:b,connectionLineContainerStyle:p,selectionKeyCode:m,selectionOnDrag:y,selectionMode:w,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:k,deleteKeyCode:C,onlyRenderVisibleElements:I,elementsSelectable:P,defaultViewport:j,translateExtent:F,minZoom:z,maxZoom:R,preventScrolling:_,defaultMarkerColor:O,zoomOnScroll:$,zoomOnPinch:T,panOnScroll:A,panOnScrollSpeed:M,panOnScrollMode:W,zoomOnDoubleClick:L,panOnDrag:K,onPaneClick:U,onPaneMouseEnter:V,onPaneMouseMove:B,onPaneMouseLeave:q,onPaneScroll:H,onPaneContextMenu:Y,paneClickDistance:te,nodeClickDistance:Z,onEdgeContextMenu:G,onEdgeMouseEnter:X,onEdgeMouseMove:ne,onEdgeMouseLeave:fe,reconnectRadius:Te,onReconnect:ce,onReconnectStart:ve,onReconnectEnd:Q,noDragClassName:ge,noWheelClassName:xe,noPanClassName:Ne,disableKeyboardA11y:Pe,nodeExtent:dt,rfId:ot,viewport:re,onViewportChange:se}){return Av(e),Av(t),i3(),X$(n),J$(re),h.jsx(E$,{onPaneClick:U,onPaneMouseEnter:V,onPaneMouseMove:B,onPaneMouseLeave:q,onPaneContextMenu:Y,onPaneScroll:H,paneClickDistance:te,deleteKeyCode:C,selectionKeyCode:m,selectionOnDrag:y,selectionMode:w,onSelectionStart:d,onSelectionEnd:g,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:k,elementsSelectable:P,zoomOnScroll:$,zoomOnPinch:T,zoomOnDoubleClick:L,panOnScroll:A,panOnScrollSpeed:M,panOnScrollMode:W,panOnDrag:K,defaultViewport:j,translateExtent:F,minZoom:z,maxZoom:R,onSelectionContextMenu:f,preventScrolling:_,noDragClassName:ge,noWheelClassName:xe,noPanClassName:Ne,disableKeyboardA11y:Pe,onViewportChange:se,isControlledViewport:!!re,children:h.jsxs(Q$,{children:[h.jsx(Y$,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:i,onReconnect:ce,onReconnectStart:ve,onReconnectEnd:Q,onlyRenderVisibleElements:I,onEdgeContextMenu:G,onEdgeMouseEnter:X,onEdgeMouseMove:ne,onEdgeMouseLeave:fe,reconnectRadius:Te,defaultMarkerColor:O,noPanClassName:Ne,disableKeyboardA11y:Pe,rfId:ot}),h.jsx(s3,{style:v,type:x,component:b,containerStyle:p}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(O$,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:c,onNodeContextMenu:u,nodeClickDistance:Z,onlyRenderVisibleElements:I,noPanClassName:Ne,noDragClassName:ge,disableKeyboardA11y:Pe,nodeExtent:dt,rfId:ot}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}SC.displayName="GraphView";const l3=S.memo(SC),zv=({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,f=new Map,d=new Map,g=r??t??[],x=n??e??[],v=l??[0,0],b=a??ra;Fk(f,d,g),Hp(x,c,u,{nodeOrigin:v,nodeExtent:b,elevateNodesOnSelect:!1});let p=[0,0,1];if(i&&s&&o){const m=Ia(c,{filter:N=>!!((N.width||N.initialWidth)&&(N.height||N.initialHeight))}),{x:y,y:w,zoom:E}=Zm(m,s,o,.5,2,.1);p=[y,w,E]}return{rfId:"1",width:0,height:0,transform:p,nodes:x,nodeLookup:c,parentLookup:u,edges:g,edgeLookup:d,connectionLookup:f,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:ra,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ji.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:{...wk},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:M5,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},a3=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a})=>CF((c,u)=>({...zv({nodes:e,edges:t,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a,defaultNodes:n,defaultEdges:r}),setNodes:f=>{const{nodeLookup:d,parentLookup:g,nodeOrigin:x,elevateNodesOnSelect:v}=u();Hp(f,d,g,{nodeOrigin:x,nodeExtent:a,elevateNodesOnSelect:v,checkEquality:!0}),c({nodes:f})},setEdges:f=>{const{connectionLookup:d,edgeLookup:g}=u();Fk(d,g,f),c({edges:f})},setDefaultNodesAndEdges:(f,d)=>{if(f){const{setNodes:g}=u();g(f),c({hasDefaultNodes:!0})}if(d){const{setEdges:g}=u();g(d),c({hasDefaultEdges:!0})}},updateNodeInternals:(f,d={triggerFitView:!0})=>{const{triggerNodeChanges:g,nodeLookup:x,parentLookup:v,fitViewOnInit:b,fitViewDone:p,fitViewOnInitOptions:m,domNode:y,nodeOrigin:w,nodeExtent:E,debug:N,fitViewSync:k}=u(),{changes:C,updatedInternals:I}=G5(f,x,v,y,w,E);if(I){if(q5(x,v,{nodeOrigin:w,nodeExtent:E}),d.triggerFitView){let P=p;!p&&b&&(P=k({...m,nodes:m==null?void 0:m.nodes})),c({fitViewDone:P})}else c({});(C==null?void 0:C.length)>0&&(N&&console.log("React Flow: trigger node changes",C),g==null||g(C))}},updateNodePositions:(f,d=!1)=>{const g=[],x=[];for(const[v,b]of f){const p=!!(b!=null&&b.expandParent&&(b!=null&&b.parentId)&&(b!=null&&b.position)),m={id:v,type:"position",position:p?{x:Math.max(0,b.position.x),y:Math.max(0,b.position.y)}:b.position,dragging:d};p&&g.push({id:v,parentId:b.parentId,rect:{...b.internals.positionAbsolute,width:b.measured.width,height:b.measured.height}}),x.push(m)}if(g.length>0){const{nodeLookup:v,parentLookup:b,nodeOrigin:p}=u(),m=n0(g,v,b,p);x.push(...m)}u().triggerNodeChanges(x)},triggerNodeChanges:f=>{const{onNodesChange:d,setNodes:g,nodes:x,hasDefaultNodes:v,debug:b}=u();if(f!=null&&f.length){if(v){const p=qF(f,x);g(p)}b&&console.log("React Flow: trigger node changes",f),d==null||d(f)}},triggerEdgeChanges:f=>{const{onEdgesChange:d,setEdges:g,edges:x,hasDefaultEdges:v,debug:b}=u();if(f!=null&&f.length){if(v){const p=KF(f,x);g(p)}b&&console.log("React Flow: trigger edge changes",f),d==null||d(f)}},addSelectedNodes:f=>{const{multiSelectionActive:d,edgeLookup:g,nodeLookup:x,triggerNodeChanges:v,triggerEdgeChanges:b}=u();if(d){const p=f.map(m=>_s(m,!0));v(p);return}v(Uo(x,new Set([...f]),!0)),b(Uo(g))},addSelectedEdges:f=>{const{multiSelectionActive:d,edgeLookup:g,nodeLookup:x,triggerNodeChanges:v,triggerEdgeChanges:b}=u();if(d){const p=f.map(m=>_s(m,!0));b(p);return}b(Uo(g,new Set([...f]))),v(Uo(x,new Set,!0))},unselectNodesAndEdges:({nodes:f,edges:d}={})=>{const{edges:g,nodes:x,nodeLookup:v,triggerNodeChanges:b,triggerEdgeChanges:p}=u(),m=f||x,y=d||g,w=m.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),p(E)},setMinZoom:f=>{const{panZoom:d,maxZoom:g}=u();d==null||d.setScaleExtent([f,g]),c({minZoom:f})},setMaxZoom:f=>{const{panZoom:d,minZoom:g}=u();d==null||d.setScaleExtent([g,f]),c({maxZoom:f})},setTranslateExtent:f=>{var d;(d=u().panZoom)==null||d.setTranslateExtent(f),c({translateExtent:f})},setPaneClickDistance:f=>{var d;(d=u().panZoom)==null||d.setClickDistance(f)},resetSelectedElements:()=>{const{edges:f,nodes:d,triggerNodeChanges:g,triggerEdgeChanges:x}=u(),v=d.reduce((p,m)=>m.selected?[...p,_s(m.id,!1)]:p,[]),b=f.reduce((p,m)=>m.selected?[...p,_s(m.id,!1)]:p,[]);g(v),x(b)},setNodeExtent:f=>{const{nodes:d,nodeLookup:g,parentLookup:x,nodeOrigin:v,elevateNodesOnSelect:b,nodeExtent:p}=u();f[0][0]===p[0][0]&&f[0][1]===p[0][1]&&f[1][0]===p[1][0]&&f[1][1]===p[1][1]||(Hp(d,g,x,{nodeOrigin:v,nodeExtent:f,elevateNodesOnSelect:b,checkEquality:!1}),c({nodeExtent:f}))},panBy:f=>{const{transform:d,width:g,height:x,panZoom:v,translateExtent:b}=u();return Q5({delta:f,panZoom:v,transform:d,translateExtent:b,width:g,height:x})},fitView:f=>{const{panZoom:d,width:g,height:x,minZoom:v,maxZoom:b,nodeLookup:p}=u();if(!d)return Promise.resolve(!1);const m=Ap(p,f);return zp({nodes:m,width:g,height:x,panZoom:d,minZoom:v,maxZoom:b},f)},fitViewSync:f=>{const{panZoom:d,width:g,height:x,minZoom:v,maxZoom:b,nodeLookup:p}=u();if(!d)return!1;const m=Ap(p,f);return zp({nodes:m,width:g,height:x,panZoom:d,minZoom:v,maxZoom:b},f),m.size>0},cancelConnection:()=>{c({connection:{...wk}})},updateConnection:f=>{c({connection:f})},reset:()=>c({...zv()})}),Object.is);function c3({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,fitView:i,nodeOrigin:l,nodeExtent:a,children:c}){const[u]=S.useState(()=>a3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a}));return h.jsx(RF,{value:u,children:h.jsx(XF,{children:c})})}function u3({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:i,fitView:l,nodeOrigin:a,nodeExtent:c}){return S.useContext(zd)?h.jsx(h.Fragment,{children:e}):h.jsx(c3,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:i,fitView:l,nodeOrigin:a,nodeExtent:c,children:e})}const d3={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function f3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:i,onNodeClick:l,onEdgeClick:a,onInit:c,onMove:u,onMoveStart:f,onMoveEnd:d,onConnect:g,onConnectStart:x,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:p,onNodeMouseEnter:m,onNodeMouseMove:y,onNodeMouseLeave:w,onNodeContextMenu:E,onNodeDoubleClick:N,onNodeDragStart:k,onNodeDrag:C,onNodeDragStop:I,onNodesDelete:P,onEdgesDelete:j,onDelete:F,onSelectionChange:z,onSelectionDragStart:R,onSelectionDrag:_,onSelectionDragStop:O,onSelectionContextMenu:$,onSelectionStart:T,onSelectionEnd:A,onBeforeDelete:M,connectionMode:W,connectionLineType:L=Kr.Bezier,connectionLineStyle:K,connectionLineComponent:U,connectionLineContainerStyle:V,deleteKeyCode:B="Backspace",selectionKeyCode:q="Shift",selectionOnDrag:H=!1,selectionMode:Y=sa.Full,panActivationKeyCode:te="Space",multiSelectionKeyCode:Z=Bu()?"Meta":"Control",zoomActivationKeyCode:G=Bu()?"Meta":"Control",snapToGrid:X,snapGrid:ne,onlyRenderVisibleElements:fe=!1,selectNodesOnDrag:Te,nodesDraggable:ce,nodesConnectable:ve,nodesFocusable:Q,nodeOrigin:ge=Xk,edgesFocusable:xe,edgesReconnectable:Ne,elementsSelectable:Pe=!0,defaultViewport:dt=$F,minZoom:ot=.5,maxZoom:re=2,translateExtent:se=ra,preventScrolling:De=!0,nodeExtent:Ce,defaultMarkerColor:Mt="#b1b1b7",zoomOnScroll:Ln=!0,zoomOnPinch:Hn=!0,panOnScroll:gt=!1,panOnScrollSpeed:jr=.5,panOnScrollMode:sr=Js.Free,zoomOnDoubleClick:Bn=!0,panOnDrag:wo=!0,onPaneClick:bo,onPaneMouseEnter:So,onPaneMouseMove:Eo,onPaneMouseLeave:ko,onPaneScroll:Co,onPaneContextMenu:_a,paneClickDistance:Se=0,nodeClickDistance:ft=0,children:Vt,onReconnect:Et,onReconnectStart:dn,onReconnectEnd:Xt,onEdgeContextMenu:Ro,onEdgeDoubleClick:Ar,onEdgeMouseEnter:No,onEdgeMouseMove:Vn,onEdgeMouseLeave:Cn,reconnectRadius:Ns=10,onNodesChange:Po,onEdgesChange:Wi,noDragClassName:Ma="nodrag",noWheelClassName:ja="nowheel",noPanClassName:Ui="nopan",fitView:qi,fitViewOptions:Aa,connectOnClick:za,attributionPosition:Hd,proOptions:Bd,defaultEdgeOptions:qC,elevateNodesOnSelect:KC,elevateEdgesOnSelect:YC,disableKeyboardA11y:c0=!1,autoPanOnConnect:GC,autoPanOnNodeDrag:QC,autoPanSpeed:XC,connectionRadius:ZC,isValidConnection:JC,onError:eR,style:tR,id:u0,nodeDragThreshold:nR,viewport:rR,onViewportChange:sR,width:oR,height:iR,colorMode:lR="light",debug:aR,...cR},uR){const Vd=u0||"1",dR=VF(lR);return h.jsx("div",{"data-testid":"rf__wrapper",...cR,style:{...tR,...d3},ref:uR,className:st(["react-flow",s,dR]),id:u0,children:h.jsxs(u3,{nodes:e,edges:t,width:oR,height:iR,fitView:qi,nodeOrigin:ge,nodeExtent:Ce,children:[h.jsx(l3,{onInit:c,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:m,onNodeMouseMove:y,onNodeMouseLeave:w,onNodeContextMenu:E,onNodeDoubleClick:N,nodeTypes:o,edgeTypes:i,connectionLineType:L,connectionLineStyle:K,connectionLineComponent:U,connectionLineContainerStyle:V,selectionKeyCode:q,selectionOnDrag:H,selectionMode:Y,deleteKeyCode:B,multiSelectionKeyCode:Z,panActivationKeyCode:te,zoomActivationKeyCode:G,onlyRenderVisibleElements:fe,defaultViewport:dt,translateExtent:se,minZoom:ot,maxZoom:re,preventScrolling:De,zoomOnScroll:Ln,zoomOnPinch:Hn,zoomOnDoubleClick:Bn,panOnScroll:gt,panOnScrollSpeed:jr,panOnScrollMode:sr,panOnDrag:wo,onPaneClick:bo,onPaneMouseEnter:So,onPaneMouseMove:Eo,onPaneMouseLeave:ko,onPaneScroll:Co,onPaneContextMenu:_a,paneClickDistance:Se,nodeClickDistance:ft,onSelectionContextMenu:$,onSelectionStart:T,onSelectionEnd:A,onReconnect:Et,onReconnectStart:dn,onReconnectEnd:Xt,onEdgeContextMenu:Ro,onEdgeDoubleClick:Ar,onEdgeMouseEnter:No,onEdgeMouseMove:Vn,onEdgeMouseLeave:Cn,reconnectRadius:Ns,defaultMarkerColor:Mt,noDragClassName:Ma,noWheelClassName:ja,noPanClassName:Ui,rfId:Vd,disableKeyboardA11y:c0,nodeExtent:Ce,viewport:rR,onViewportChange:sR}),h.jsx(BF,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:x,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:p,nodesDraggable:ce,nodesConnectable:ve,nodesFocusable:Q,edgesFocusable:xe,edgesReconnectable:Ne,elementsSelectable:Pe,elevateNodesOnSelect:KC,elevateEdgesOnSelect:YC,minZoom:ot,maxZoom:re,nodeExtent:Ce,onNodesChange:Po,onEdgesChange:Wi,snapToGrid:X,snapGrid:ne,connectionMode:W,translateExtent:se,connectOnClick:za,defaultEdgeOptions:qC,fitView:qi,fitViewOptions:Aa,onNodesDelete:P,onEdgesDelete:j,onDelete:F,onNodeDragStart:k,onNodeDrag:C,onNodeDragStop:I,onSelectionDrag:_,onSelectionDragStart:R,onSelectionDragStop:O,onMove:u,onMoveStart:f,onMoveEnd:d,noPanClassName:Ui,nodeOrigin:ge,rfId:Vd,autoPanOnConnect:GC,autoPanOnNodeDrag:QC,autoPanSpeed:XC,onError:eR,connectionRadius:ZC,isValidConnection:JC,selectNodesOnDrag:Te,nodeDragThreshold:nR,onBeforeDelete:M,paneClickDistance:Se,debug:aR}),h.jsx(FF,{onSelectionChange:z}),Vt,h.jsx(MF,{proOptions:Bd,position:Hd}),h.jsx(OF,{rfId:Vd,disableKeyboardA11y:c0})]})})}var h3=Jk(f3);function p3({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:st(["react-flow__background-pattern",n,r])})}function g3({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:st(["react-flow__background-pattern","dots",t])})}var Sr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Sr||(Sr={}));const m3={[Sr.Dots]:1,[Sr.Lines]:1,[Sr.Cross]:6},y3=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function EC({id:e,variant:t=Sr.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:i,bgColor:l,style:a,className:c,patternClassName:u}){const f=S.useRef(null),{transform:d,patternId:g}=Oe(y3,et),x=r||m3[t],v=t===Sr.Dots,b=t===Sr.Cross,p=Array.isArray(n)?n:[n,n],m=[p[0]*d[2]||1,p[1]*d[2]||1],y=x*d[2],w=Array.isArray(o)?o:[o,o],E=b?[y,y]:m,N=[w[0]*d[2]||1+E[0]/2,w[1]*d[2]||1+E[1]/2],k=`${g}${e||""}`;return h.jsxs("svg",{className:st(["react-flow__background",c]),style:{...a,...Dd,"--xy-background-color-props":l,"--xy-background-pattern-color-props":i},ref:f,"data-testid":"rf__background",children:[h.jsx("pattern",{id:k,x:d[0]%m[0],y:d[1]%m[1],width:m[0],height:m[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:v?h.jsx(g3,{radius:y/2,className:u}):h.jsx(p3,{dimensions:E,lineWidth:s,variant:t,className:u})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}EC.displayName="Background";const x3=S.memo(EC);function v3(){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 w3(){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 b3(){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 S3(){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 E3(){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 kc({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:st(["react-flow__controls-button",t]),...n,children:e})}const k3=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function kC({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:i,onFitView:l,onInteractiveChange:a,className:c,children:u,position:f="bottom-left",orientation:d="vertical","aria-label":g="React Flow controls"}){const x=Ue(),{isInteractive:v,minZoomReached:b,maxZoomReached:p}=Oe(k3,et),{zoomIn:m,zoomOut:y,fitView:w}=s0(),E=()=>{m(),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=d==="horizontal"?"horizontal":"vertical";return h.jsxs(r0,{className:st(["react-flow__controls",I,c]),position:f,style:e,"data-testid":"rf__controls","aria-label":g,children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(kc,{onClick:E,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:p,children:h.jsx(v3,{})}),h.jsx(kc,{onClick:N,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:b,children:h.jsx(w3,{})})]}),n&&h.jsx(kc,{className:"react-flow__controls-fitview",onClick:k,title:"fit view","aria-label":"fit view",children:h.jsx(b3,{})}),r&&h.jsx(kc,{className:"react-flow__controls-interactive",onClick:C,title:"toggle interactivity","aria-label":"toggle interactivity",children:v?h.jsx(E3,{}):h.jsx(S3,{})}),u]})}kC.displayName="Controls";const C3=S.memo(kC);function R3({id:e,x:t,y:n,width:r,height:s,style:o,color:i,strokeColor:l,strokeWidth:a,className:c,borderRadius:u,shapeRendering:f,selected:d,onClick:g}){const{background:x,backgroundColor:v}=o||{},b=i||x||v;return h.jsx("rect",{className:st(["react-flow__minimap-node",{selected:d},c]),x:t,y:n,rx:u,ry:u,width:r,height:s,style:{fill:b,stroke:l,strokeWidth:a},shapeRendering:f,onClick:g?p=>g(p,e):void 0})}const N3=S.memo(R3),P3=e=>e.nodes.map(t=>t.id),Uf=e=>e instanceof Function?e:()=>e;function T3({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=N3,onClick:i}){const l=Oe(P3,et),a=Uf(t),c=Uf(e),u=Uf(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:l.map(d=>h.jsx(O3,{id:d,nodeColorFunc:a,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:i,shapeRendering:f},d))})}function I3({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:i,NodeComponent:l,onClick:a}){const{node:c,x:u,y:f,width:d,height:g}=Oe(x=>{const v=x.nodeLookup.get(e),{x:b,y:p}=v.internals.positionAbsolute,{width:m,height:y}=Mr(v);return{node:v,x:b,y:p,width:m,height:y}},et);return!c||c.hidden||!Tk(c)?null:h.jsx(l,{x:u,y:f,width:d,height:g,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 O3=S.memo(I3);var _3=S.memo(T3);const M3=200,j3=150,A3=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?Nk(Ia(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},z3="react-flow__minimap-desc";function CC({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:i,nodeComponent:l,bgColor:a,maskColor:c,maskStrokeColor:u,maskStrokeWidth:f,position:d="bottom-right",onClick:g,onNodeClick:x,pannable:v=!1,zoomable:b=!1,ariaLabel:p="React Flow mini map",inversePan:m,zoomStep:y=10,offsetScale:w=5}){const E=Ue(),N=S.useRef(null),{boundingRect:k,viewBB:C,rfId:I,panZoom:P,translateExtent:j,flowWidth:F,flowHeight:z}=Oe(A3,et),R=(e==null?void 0:e.width)??M3,_=(e==null?void 0:e.height)??j3,O=k.width/R,$=k.height/_,T=Math.max(O,$),A=T*R,M=T*_,W=w*T,L=k.x-(A-k.width)/2-W,K=k.y-(M-k.height)/2-W,U=A+W*2,V=M+W*2,B=`${z3}-${I}`,q=S.useRef(0),H=S.useRef();q.current=T,S.useEffect(()=>{if(N.current&&P)return H.current=sF({domNode:N.current,panZoom:P,getTransform:()=>E.getState().transform,getViewScale:()=>q.current}),()=>{var Z;(Z=H.current)==null||Z.destroy()}},[P]),S.useEffect(()=>{var Z;(Z=H.current)==null||Z.update({translateExtent:j,width:F,height:z,inversePan:m,pannable:v,zoomStep:y,zoomable:b})},[v,b,m,y,j,F,z]);const Y=g?Z=>{var ne;const[G,X]=((ne=H.current)==null?void 0:ne.pointer(Z))||[0,0];g(Z,{x:G,y:X})}:void 0,te=x?S.useCallback((Z,G)=>{const X=E.getState().nodeLookup.get(G);x(Z,X)},[]):void 0;return h.jsx(r0,{position:d,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*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:st(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:R,height:_,viewBox:`${L} ${K} ${U} ${V}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":B,ref:N,onClick:Y,children:[p&&h.jsx("title",{id:B,children:p}),h.jsx(_3,{onClick:te,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:i,nodeComponent:l}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${L-W},${K-W}h${U+W*2}v${V+W*2}h${-U-W*2}z
|
|
62
|
+
M${C.x},${C.y}h${C.width}v${C.height}h${-C.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}CC.displayName="MiniMap";S.memo(CC);function D3({nodeId:e,position:t,variant:n=Tl.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:f=!1,shouldResize:d,onResizeStart:g,onResize:x,onResizeEnd:v}){const b=rC(),p=typeof e=="string"?e:b,m=Ue(),y=S.useRef(null),w=n===Tl.Line?"right":"bottom-right",E=t??w,N=S.useRef(null);S.useEffect(()=>{if(!(!y.current||!p))return N.current||(N.current=vF({domNode:y.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:P,transform:j,snapGrid:F,snapToGrid:z,nodeOrigin:R,domNode:_}=m.getState();return{nodeLookup:P,transform:j,snapGrid:F,snapToGrid:z,nodeOrigin:R,paneDomNode:_}},onChange:(P,j)=>{const{triggerNodeChanges:F,nodeLookup:z,parentLookup:R,nodeOrigin:_}=m.getState(),O=[],$={x:P.x,y:P.y},T=z.get(p);if(T&&T.expandParent&&T.parentId){const A=T.origin??_,M=P.width??T.measured.width,W=P.height??T.measured.height,L={id:T.id,parentId:T.parentId,rect:{width:M,height:W,...Ik({x:P.x??T.position.x,y:P.y??T.position.y},{width:M,height:W},T.parentId,z,A)}},K=n0([L],z,R,_);O.push(...K),$.x=P.x?Math.max(A[0]*M,P.x):void 0,$.y=P.y?Math.max(A[1]*W,P.y):void 0}if($.x!==void 0&&$.y!==void 0){const A={id:p,type:"position",position:{...$}};O.push(A)}if(P.width!==void 0&&P.height!==void 0){const A={id:p,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:P.width,height:P.height}};O.push(A)}for(const A of j){const M={...A,type:"position"};O.push(M)}F(O)},onEnd:()=>{const P={id:p,type:"dimensions",resizing:!1};m.getState().triggerNodeChanges([P])}})),N.current.update({controlPosition:E,boundaries:{minWidth:l,minHeight:a,maxWidth:c,maxHeight:u},keepAspectRatio:f,onResizeStart:g,onResize:x,onResizeEnd:v,shouldResize:d}),()=>{var P;(P=N.current)==null||P.destroy()}},[E,l,a,c,u,f,g,x,v,d]);const k=E.split("-"),C=n===Tl.Line?"borderColor":"backgroundColor",I=i?{...s,[C]:i}:s;return h.jsx("div",{className:st(["react-flow__resize-control","nodrag",...k,n,r]),ref:y,style:I,children:o})}S.memo(D3);const F3=new Set;function $3(e){return e.startsWith("signal:child:")}function L3(e){const t=ho(),n=(()=>{const o=new Set(e),i=[...e];for(;i.length>0;){const l=i.shift();if(l===void 0)continue;const a=t.getQueryData(["run",l]);if(a!==void 0)for(const c of a.timeline){const u=co(c);u!==void 0&&!o.has(u)&&(o.add(u),i.push(u))}}return[...o].sort()})(),r=jw({queries:n.map(o=>({queryKey:["run",o],queryFn:()=>$e.run(o)}))}),s={};return n.forEach((o,i)=>{var a;const l=(a=r[i])==null?void 0:a.data;l&&(s[o]=l)}),s}function H3({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?Xg:Zg(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?ap.child:ap[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(Ss,{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(ys,{width:9,height:9}):n?h.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}):h.jsx(Gg,{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(Qg,{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(Ss,{type:"source",position:ue.Right,className:"!border-0 !bg-zinc-600"})]})}function B3({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(Ss,{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(Ss,{type:"source",position:ue.Right,className:"!border-0 !bg-zinc-600"})]})}const V3={step:H3,terminal:B3};function W3(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 U3=S.memo(function({run:t,timeline:n,endStatus:r,selectedKey:s,onSelect:o,onOpenRun:i,fmtDuration:l,expanded:a,onToggleChild:c}){const u=a??F3,f=S.useMemo(()=>{const b=new Set(u);for(const p of n){const m=co(p);m!==void 0&&b.add(m)}return b},[u,n]),d=L3(f),{nodes:g,edges:x}=(()=>{const y=[],w=[],E=t.status==="running"||t.status==="suspended",N=(R,_,O)=>({id:`${R}->${_}`,source:R,target:_,style:{stroke:O?"#f87171":"var(--line)",strokeWidth:1.5}}),k=(R,_)=>({id:`${R}=>${_}`,source:R,target:_,style:{stroke:"#818cf8",strokeWidth:1.5,strokeDasharray:"4 3"}});function C(R,_,O,$,T,A){const M=`${T}s${R.seq}`,W=co(R),L=W!==void 0?d[W]:void 0,K=L!==void 0&&L.timeline.length===1&&L.timeline[0]?{step:L.timeline[0],run:L.run}:void 0,U=K!==void 0,V=!U&&W!==void 0&&u.has(W),B=K?K.step:R,q=K?K.run:A,H=K?K.step.name:W!==void 0?(L==null?void 0:L.run.workflow)??"child workflow":R.name,Y=B.status==="failed";y.push({id:M,type:"step",draggable:!1,position:{x:_,y:O},data:{seq:B.seq,name:H,kind:B.kind,status:B.status,workerGroup:B.workerGroup,attempts:B.attempts,duration:l(B.startedAt,B.finishedAt),subs:W3(B),selected:s===`${B.runId}#${B.seq}`,childRunId:W,onOpenRun:i,childExpanded:V,onToggleChild:c,collapsed:U,depth:$,step:B,laneRun:q}});const te=V?L:void 0;if(te){const Z=I(te.timeline,$+1,_+248,O+150,`${W}:`,te.run);for(const X of Z.firstIds)w.push(k(M,X));const G=$3(R.name)&&Z.connectors.length>0?Z.connectors:[{id:M,failed:Y}];return{id:M,exits:G,nextX:Math.max(_+248,Z.nextX),bottomY:Math.max(O,Z.bottomY)}}return{id:M,exits:[{id:M,failed:Y}],nextX:_+248,bottomY:O}}function I(R,_,O,$,T,A){let M=O;const W=[];let L=[],K=$;for(const U of $E(R)){const V=U.kind==="single"?[U.step]:U.steps,B=W.length===0,q=[];let H=$,Y=M;for(const te of V){const Z=C(te,M,H,_,T,A);B&&W.push(Z.id);for(const G of L)w.push(N(G.id,Z.id,G.failed));q.push(...Z.exits),Y=Math.max(Y,Z.nextX),H=Z.bottomY+96}L=q,M=Y,K=Math.max(K,H-96)}return{firstIds:W,connectors:L,nextX:M,bottomY:K}}const P=248;y.push({id:"start",type:"terminal",position:{x:0,y:0},draggable:!1,data:{status:"running",label:t.workflow}});const j=I(n,0,P,0,"",t);for(const R of j.firstIds)w.push({id:`start->${R}`,source:"start",target:R});const F=r??hI(t,n);y.push({id:"end",type:"terminal",position:{x:Math.max(j.nextX,P),y:0},draggable:!1,data:{status:F,label:F}});const z=j.connectors.length>0?j.connectors:[{id:"start",failed:!1}];for(const R of z)w.push({id:`${R.id}->end`,source:R.id,target:"end",animated:E,style:{stroke:E?"var(--live)":"var(--line)",strokeWidth:E?2:1.5}});return{nodes:y,edges:w}})(),v=S.useCallback((b,p)=>{if(p.type!=="step")return;const m=p.data;m.step&&m.laneRun&&o(m.step,m.laneRun)},[o]);return h.jsxs(h3,{nodes:g,edges:x,nodeTypes:V3,onNodeClick:v,fitView:!0,fitViewOptions:{padding:.3,maxZoom:1.1},proOptions:{hideAttribution:!0},nodesConnectable:!1,nodesDraggable:!1,panOnScroll:!0,minZoom:.3,onlyRenderVisibleElements:!0,children:[h.jsx(x3,{variant:Sr.Dots,gap:22,size:1,color:"#1c1c22"}),h.jsx(C3,{showInteractive:!1,position:"bottom-right"})]})});function q3(e){return!e.hasMore||e.loading||e.requestedAtCount===e.loadedCount?!1:e.lastRenderedIndex>=e.loadedCount-1-e.loadAhead}function Wc(e){const t=e.lastIndexOf("~retry~");return t===-1?void 0:e.slice(0,t)}function qf(e){const n=(Wc(e)??e).match(/^(.*)\.child\.\d+$/);return(n==null?void 0:n[1])||void 0}function K3(e,t){var n;return((n=e[t])==null?void 0:n.id)??t}function Y3(e){return JSON.stringify([e.status,e.tag,e.attrs,e.namespace,e.origin])}const RC=S.createContext(void 0);function vo(e){const t=S.useContext(RC);if(!e&&t===void 0)throw new Error(Qt(27));return t}const G3=S.forwardRef(function(t,n){const{render:r,className:s,style:o,forceRender:i=!1,...l}=t,a=vo(),c=a.useState("open"),u=a.useState("nested"),f=a.useState("mounted"),d=a.useState("transitionStatus");return Bt("div",t,{state:{open:c,transitionStatus:d},ref:[a.context.backdropRef,n],stateAttributesMapping:cm,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:i||!u})}),Q3=S.forwardRef(function(t,n){const{render:r,className:s,style:o,disabled:i=!1,nativeButton:l=!0,...a}=t,c=vo(),u=c.useState("open"),{getButtonProps:f,buttonRef:d}=$m({disabled:i,native:l}),g={disabled:i};function x(v){u&&c.setOpen(!1,_e(ES,v.nativeEvent))}return Bt("button",t,{state:g,ref:[n,d],props:[{onClick:x},a,f]})}),X3=S.forwardRef(function(t,n){const{render:r,className:s,style:o,id:i,...l}=t,a=vo(),c=Vi(i);return a.useSyncedValueWithCleanup("descriptionElementId",c),Bt("p",t,{ref:n,props:[{id:c},l]})}),NC=S.createContext(void 0);function Z3(){const e=S.useContext(NC);if(e===void 0)throw new Error(Qt(26));return e}const J3="--nested-dialogs",eL="data-nested-dialog-open",tL={...am,...lm,nestedDialogOpen(e){return e?{[eL]:""}:null}},nL=S.forwardRef(function(t,n){const{render:r,className:s,style:o,finalFocus:i,initialFocus:l,...a}=t,c=vo(),u=c.useState("descriptionElementId"),f=c.useState("disablePointerDismissal"),d=c.useState("floatingRootContext"),g=c.useState("popupProps"),x=c.useState("modal"),v=c.useState("mounted"),b=c.useState("nested"),p=c.useState("nestedOpenDialogCount"),m=c.useState("open"),y=c.useState("openMethod"),w=c.useState("titleElementId"),E=c.useState("transitionStatus"),N=c.useState("role"),k=d.useState("floatingId");Z3(),Ca({open:m,ref:c.context.popupRef,onComplete(){var z,R;m&&((R=(z=c.context).onOpenChangeComplete)==null||R.call(z,!0))}});const C=l===void 0?xE(c.context.popupRef):l,I=p>0,P=c.useStateSetter("popupElement"),F=Bt("div",t,{state:{open:m,nested:b,transitionStatus:E,nestedDialogOpen:I},props:[g,{id:k,"aria-labelledby":w,"aria-describedby":u,role:N,...Cm,hidden:!v,onKeyDown(z){Bm.has(z.key)&&z.stopPropagation()},style:{[J3]:p}},a],ref:[n,c.context.popupRef,P],stateAttributesMapping:tL});return h.jsx(tE,{context:d,openInteractionType:y,disabled:!v,closeOnFocusOut:!f,initialFocus:C,returnFocus:i,modal:x!==!1,restoreFocus:"popup",children:F})}),rL=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,o=vo(),i=o.useState("mounted"),l=o.useState("modal"),a=o.useState("open");return i||r?h.jsx(NC.Provider,{value:r,children:h.jsxs(XS,{ref:n,...s,children:[i&&l===!0&&h.jsx(AE,{ref:o.context.internalBackdropRef,inert:Lm(!a)}),t.children]})}):null});function sL({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),s=e.useState("disablePointerDismissal"),o=e.useState("modal"),i=e.useState("popupElement"),l=e.useState("floatingRootContext"),[a,c]=S.useState(0),[u,f]=S.useState(0),d=a===0,g=Em(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(d&&!s){if(o){const b=e.context.internalBackdropRef.current,p=e.context.backdropRef.current;return b||p?b===v||p===v||me(v,i)&&!(v!=null&&v.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:d});return DE(r&&o===!0,i),e.useContextCallback("onNestedDialogOpen",(x,v)=>{c(x),f(v)}),de(()=>(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]),Om(e,{activeTriggerProps:g.reference,inactiveTriggerProps:g.trigger,popupProps:g.floating,nestedOpenDialogCount:a,nestedOpenDrawerCount:u}),null}const oL={...Am,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 iL extends kd{constructor(n,r,s){const o=new _m,i=lL(n,o,r,s);super(i,aL(o),oL);ye(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(Pm(this.state,n,r.trigger)))})}}function lL(e,t,n,r=!1){return{...Mm(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 aL(e){return{popupRef:S.createRef(),backdropRef:S.createRef(),internalBackdropRef:S.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function cL(e,t){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:i,disablePointerDismissal:l=!1,modal:a=!0,actionsRef:c,handle:u,triggerId:f,defaultTriggerId:d=null}=t,g=e==="drawer",x=a,v=l,b="dialog",p=vo(!0),m=p!=null,y={modal:x,disablePointerDismissal:v,nested:m,role:b},w=Rm((P,j)=>new iL({open:s,openProp:r,activeTriggerId:d,triggerIdProp:f,...y},P,j),!0);w.useControlledProp("openProp",r),w.useControlledProp("triggerIdProp",f),w.useSyncedValues(y),w.useContextCallback("onOpenChange",o),w.useContextCallback("onOpenChangeComplete",i);const E=w.useState("open"),N=w.useState("mounted"),k=w.useState("payload");bE(w,E),Tm(w);const{forceUnmount:C}=Im(E,w);S.useImperativeHandle(c,()=>({unmount:C,close:()=>w.setOpen(!1,_e(um))}),[C,w]);const I=E||N;return h.jsxs(RC.Provider,{value:w,children:[u&&h.jsx(Nm,{handle:u,store:w}),I&&h.jsx(sL,{store:w,parentContext:p==null?void 0:p.context,isDrawer:g}),typeof n=="function"?n({payload:k}):n]})}const uL=cd(function(t){return cL("dialog",t)}),dL=S.forwardRef(function(t,n){const{render:r,className:s,style:o,id:i,...l}=t,a=vo(),c=Vi(i);return a.useSyncedValueWithCleanup("titleElementId",c),Bt("h2",t,{ref:n,props:[{id:c},l]})}),fL=uL,hL=Q3;function pL({open:e,onOpenChange:t,title:n,subtitle:r,footer:s,children:o,className:i}){return h.jsx(fL,{open:e,onOpenChange:t,children:h.jsxs(rL,{children:[h.jsx(G3,{className:"fixed inset-0 z-40 bg-black/60 backdrop-blur-sm"}),h.jsxs(nL,{className:rt("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(dL,{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:n}),r&&h.jsx(X3,{className:"mono mt-1 text-[11px] text-zinc-500",children:r})]}),h.jsx(hL,{render:h.jsx(je,{variant:"quiet",size:"icon","aria-label":"Close",children:h.jsx(ys,{})})})]}),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 gL({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 PC=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function mL(){return S.useContext(PC)}function TC(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:s}=e,o=pe(s),[,i]=S.useState(!1),l=En(xL).current,a=En(yL).current,c=S.useRef(0),u=S.useRef(!0),f=S.useRef(null),d=S.useRef(null),g=pe(()=>{u.current||(u.current=!0,i(E=>!E))}),x=pe((E,N)=>{a.set(E,N),g()}),v=pe(E=>{a.delete(E),g()}),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 p(E){var C;if((C=d.current)==null||C.disconnect(),d.current=null,typeof MutationObserver!="function"||E.length<2)return;const N=new MutationObserver(I=>{if(!bL(I))return;let P=null;for(const j of E)if(j.isConnected){if(P&&IC(P,j)>0){N.disconnect(),g();return}P=j}});d.current=N;const k=new Set;for(let I=1;I<E.length;I+=1){const P=wL(E[I-1],E[I]);P&&k.add(P)}k.forEach(I=>N.observe(I,{childList:!0}))}const m=pe(()=>{const[E,N]=vL(a),k=b(E),C=f.current,I=!C||C.length!==E.length||E.some((P,j)=>{const F=C[j];return P.index!==F.index||P.element!==F.element||P.registration.index!==F.registration.index||P.registration.metadata!==F.registration.metadata});p(N),f.current=E,u.current=!1,I&&(l.forEach(P=>P(k)),o(k))});de(()=>(!u.current&&f.current&&b(f.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,b]),de(()=>{u.current&&m()}),de(()=>()=>{var E;(E=d.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(PC.Provider,{value:w,children:t})}function yL(){return new Map}function xL(){return new Set}function vL(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)=>IC(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 wL(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function bL(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 IC(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const OC=S.createContext(void 0);function i0(){const e=S.useContext(OC);if(e===void 0)throw new Error(Qt(64));return e}const SL="data-activation-direction",$d={tabActivationDirection:e=>({[SL]:e})},EL=S.forwardRef(function(t,n){const{className:r,defaultValue:s=0,onValueChange:o,orientation:i="horizontal",render:l,value:a,style:c,...u}=t,f=t.defaultValue!==void 0,d=S.useRef([]),[g,x]=S.useState(()=>new Map),[v,b]=gL({controlled:a,default:s,name:"Tabs",state:"value"}),p=a!==void 0,[m,y]=S.useState(()=>new Map),w=S.useRef(void 0),E=S.useCallback(H=>Wp(m,H),[m]),[N,k]=S.useState(()=>({previousValue:v,tabActivationDirection:"none"})),{previousValue:C,tabActivationDirection:I}=N;let P=I,j=!1;C!==v&&(P=Dv(C,v,i,m),j=C!=null&&v!=null&&E(v)==null);const F=j?C:v,z=C!==F||I!==P;de(()=>{z&&k({previousValue:F,tabActivationDirection:P})},[F,z,P]);const R=pe((H,Y)=>{const te=Dv(v,H,i,m);Y.activationDirection=te,o==null||o(H,Y),!Y.isCanceled&&b(H)}),_=pe((H,Y)=>{o==null||o(H,_e(Y,void 0,void 0,{activationDirection:"none"}))}),O=pe((H,Y)=>(x(te=>{const Z=new Map(te);return Z.set(H,Y),Z}),()=>{x(te=>{if(te.get(H)!==Y)return te;const Z=new Map(te);return Z.delete(H),Z})})),$=S.useCallback(H=>g.get(H),[g]),T=S.useCallback(H=>{for(const Y of m.values())if(H===Y.value)return Y.id},[m]),A=S.useMemo(()=>({getTabElementBySelectedValue:E,getTabIdByPanelValue:T,getTabPanelIdByValue:$,onValueChange:R,orientation:i,registerMountedTabPanel:O,setTabMap:y,tabActivationDirection:P,value:v}),[E,T,$,R,i,O,y,P,v]),M=S.useMemo(()=>{for(const H of m.values())if(H.value===v)return H},[m,v]),W=S.useMemo(()=>{for(const H of m.values())if(!H.disabled)return H.value},[m]),L=S.useRef(!f),K=S.useRef(s),U=S.useRef(f),V=S.useRef(!1);de(()=>{var G;if(p)return;function H(X,ne){b(X),k({previousValue:X,tabActivationDirection:"none"}),_(X,ne),L.current=!1}if(m.size===0){V.current&&v!==null&&!((G=w.current)!=null&&G.isConnected)&&H(null,Ky);return}V.current=!0,w.current=m.keys().next().value;const Y=M==null?void 0:M.disabled,te=M==null&&v!==null;if(!Y&&v===K.current&&(U.current=!1),U.current&&Y&&v===K.current)return;const Z=L.current;if(Y||te){const X=W??null;if(v===X){L.current=!1;return}let ne=Ky;Z?ne=Yy:Y&&(ne=kS),H(X,ne);return}Z&&M!=null&&(_(v,Yy),L.current=!1)},[W,p,_,M,b,m,v]);const q=Bt("div",t,{state:{orientation:i,tabActivationDirection:P},ref:n,props:u,stateAttributesMapping:$d});return h.jsx(OC.Provider,{value:A,children:h.jsx(TC,{elementsRef:d,children:q})})});function Wp(e,t){for(const[n,r]of e.entries())if(t===r.value)return n;return null}function Dv(e,t,n,r){if(e==null||t==null)return"none";const[s,o,i]=n==="horizontal"?["left","left","right"]:["top","up","down"],l=Wp(r,e),a=Wp(r,t);if(l==null||a==null)return l!==a&&(typeof e=="number"||typeof e=="string")&&typeof e==typeof t?t>e?i:o:"none";const c=l.getBoundingClientRect()[s],u=a.getBoundingClientRect()[s];return u<c?o:u>c?i:"none"}const l0="data-composite-item-active";function _C(e={}){const{guess:t,label:n,metadata:r,textRef:s,index:o}=e,{register:i,unregister:l,subscribeMapChange:a,nextIndexRef:c}=mL(),u=S.useRef(-1),[f,d]=S.useState(o==null&&t?()=>{if(u.current===-1){const b=c.current;c.current+=1,u.current=b}return u.current}:-1),g=o??f,x=S.useRef(null),v=S.useCallback(b=>{const p=x.current;p&&l(p),x.current=b,b&&i(b,{metadata:r??null,index:o??null,label:n,textRef:s})},[o,i,l,r,n,s]);return de(()=>{if(o==null)return a(b=>{var m;const p=x.current?(m=b.get(x.current))==null?void 0:m.index:null;p!=null&&d(p)})},[o,a]),{ref:v,index:g}}function kL(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Fm(),{ref:s,index:o}=_C(e),i=n===o,l=S.useRef(null),a=Ri(s,l);return{compositeProps:{tabIndex:i?0:-1,onFocus(){r(o)},onMouseMove(){const u=l.current;if(!t||!u)return;const f=u.hasAttribute("disabled")||u.ariaDisabled==="true";!i&&!f&&u.focus()}},compositeRef:a,index:o}}const MC=S.createContext(void 0);function CL(){const e=S.useContext(MC);if(e===void 0)throw new Error(Qt(65));return e}const RL=S.forwardRef(function(t,n){const{className:r,disabled:s=!1,render:o,value:i,id:l,nativeButton:a=!0,style:c,...u}=t,{value:f,getTabPanelIdByValue:d,onValueChange:g,orientation:x,tabActivationDirection:v}=i0(),{activateOnFocus:b,registerTabResizeObserverElement:p,tabsListElement:m}=CL(),{highlightedIndex:y,onHighlightedIndexChange:w}=Fm(),E=Vi(l),N=S.useMemo(()=>({disabled:s,id:E,value:i}),[s,E,i]),{compositeProps:k,compositeRef:C,index:I}=kL({metadata:N}),P=i===f,j=S.useRef(!1),F=S.useRef(null),z=pe(V=>{var B;(B=F.current)==null||B.call(F),F.current=V?p(V):null});de(()=>{if(j.current){j.current=!1;return}if(!(P&&I>-1&&y!==I))return;const V=m;if(V!=null){const B=hn(Ae(V));if(B&&me(V,B))return}s||w(I)},[P,I,y,w,s,m]);const{getButtonProps:R,buttonRef:_}=$m({disabled:s,native:a,focusableWhenDisabled:!0}),O=d(i),$=S.useRef(!1),T=S.useRef(!1);function A(V){g(i,_e(md,V.nativeEvent,void 0,{activationDirection:"none"}))}function M(V){P||s||A(V)}function W(V){P||s||b&&(!$.current||T.current)&&A(V)}function L(V){if(P||s)return;$.current=!0,T.current=V.button===0;const B=Ae(V.currentTarget);function q(){$.current=!1,T.current=!1,B.removeEventListener("pointerup",q),B.removeEventListener("pointercancel",q)}B.addEventListener("pointerup",q),B.addEventListener("pointercancel",q)}return Bt("button",t,{state:{disabled:s,active:P,orientation:x,tabActivationDirection:v},ref:[n,_,C,z],props:[k,{role:"tab","aria-controls":O,"aria-selected":P,id:E,onClick:M,onFocus:W,onPointerDown:L,[l0]:P?"":void 0,onKeyDownCapture(){j.current=!0}},u,R],stateAttributesMapping:$d})}),NL="data-index",PL={...$d,...lm},TL=S.forwardRef(function(t,n){const{className:r,value:s,render:o,keepMounted:i=!1,style:l,...a}=t,{value:c,getTabIdByPanelValue:u,orientation:f,tabActivationDirection:d,registerMountedTabPanel:g}=i0(),x=Vi(),{ref:v,index:b}=_C(),p=s===c,{mounted:m,transitionStatus:y,setMounted:w}=mE(p),E=!m,N=u(s),k={hidden:E,orientation:f,tabActivationDirection:d,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:p?0:-1,inert:Lm(!p),[NL]:b},a],stateAttributesMapping:PL});return Ca({open:p,ref:C,onComplete(){p||w(!1)}}),de(()=>{if(!(x==null||E&&!i))return g(s,x)},[E,i,s,x,g]),i||m?I:null});function IL(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function OL(e){const{loopFocus:t=!0,orientation:n="both",grid:r,onLoop:s,direction:o,highlightedIndex:i,onHighlightedIndexChange:l,rootRef:a,enableHomeAndEndKeys:c=!1,stopEventPropagation:u,disabledIndices:f,modifierKeys:d=Kl}=e,[g,x]=S.useState(0),v=r!=null,b=S.useRef(null),p=Ri(b,a),m=S.useRef([]),y=S.useRef(!1),w=S.useRef(null),E=i??g,N=pe((j,F=!1)=>{if(w.current=m.current[j]??null,(l??x)(j),F){const z=m.current[j];Ix(b.current,z,o,n)}}),k=pe(j=>{var _;if(j.size===0)return;if(y.current){const O=m.current,$=O.indexOf(w.current);if($===-1){const T=O[E];!T||Rl(O,E,f)?N(_L(O,f)):w.current=T}else $!==E&&N($);return}y.current=!0;const F=Array.from(j.keys()),z=F.find(O=>O==null?void 0:O.hasAttribute(l0))??null,R=z?((_=j.get(z))==null?void 0:_.index)??-1:-1;if(R!==-1)N(R);else if(Rl(F,E,f)){const O=Cl(F,{disabledIndices:f});Rf(F,O)||N(O)}Ix(b.current,z,o,n)});de(()=>{if(f==null||i!=null||!y.current)return;const j=m.current;if(Rl(j,E,f)){const F=Cl(j,{disabledIndices:f});Rf(j,F)||N(F)}},[f,i,E,m,N]);const C=pe((j,F,z)=>s?s(j,F,z,m):z),I=pe(j=>{const F=j.key===kp||j.key===Cp;if(!Bm.has(j.key)||!c&&F||ML(j,d)||!b.current)return;const R=o==="rtl",_=R?Sp:Ep,O=R?Ep:Sp,$=n==="vertical"?bp:_,T=n==="vertical"?wp:O,A=Ot(j.nativeEvent);if(A!=null&&Tx(A)&&!IL(A)){const V=A.selectionStart,B=A.selectionEnd,q=A.value;if(V==null||j.shiftKey||V!==B||j.key!==T&&V<q.length||j.key!==$&&V>0)return}let M=E;const W=b_(m,f),L=S_(m,f);r!=null&&(M=r({disabledIndices:f,elementsRef:m,event:j,highlightedIndex:E,loopFocus:t,maxIndex:L,minIndex:W,onLoop:C,orientation:n,rtl:R}));const K=n!=="vertical"&&j.key===_||n!=="horizontal"&&j.key===bp,U=n!=="vertical"&&j.key===O||n!=="horizontal"&&j.key===wp;c&&(j.key===kp?M=W:j.key===Cp&&(M=L)),M===E&&(K||U)&&(t&&M===L&&K?(M=W,s&&(M=s(j,E,M,m))):t&&M===W&&U?(M=L,s&&(M=s(j,E,M,m))):M=Cl(m.current,{startingIndex:M,decrement:U,disabledIndices:f})),M!==E&&!Rf(m.current,M)&&(u&&j.stopPropagation(),(v||F||K||U)&&j.preventDefault(),N(M,!0),queueMicrotask(()=>{var V;(V=m.current[M])==null||V.focus()}))});return{props:{ref:p,onFocus(j){const F=b.current,z=Ot(j.nativeEvent);!F||z==null||!Tx(z)||z.setSelectionRange(0,z.value.length)},onKeyDown:I},highlightedIndex:E,onHighlightedIndexChange:N,elementsRef:m,onMapChange:k,relayKeyboardEvent:I}}function _L(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(l0))return r;n===-1&&(n=r)}}return Math.max(n,0)}function ML(e,t){for(const n of mj)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function jL(e){const{render:t,className:n,style:r,refs:s=Kl,props:o=Kl,state:i=vt,stateAttributesMapping:l,highlightedIndex:a,onHighlightedIndexChange:c,orientation:u,grid:f,loopFocus:d,onLoop:g,enableHomeAndEndKeys:x,onMapChange:v,stopEventPropagation:b=!0,rootRef:p,disabledIndices:m,modifierKeys:y,highlightItemOnHover:w=!1,tag:E="div",...N}=e,k=_E(),{props:C,highlightedIndex:I,onHighlightedIndexChange:P,elementsRef:j,onMapChange:F,relayKeyboardEvent:z}=OL({grid:f,loopFocus:d,onLoop:g,orientation:u,highlightedIndex:a,onHighlightedIndexChange:c,rootRef:p,stopEventPropagation:b,enableHomeAndEndKeys:x,direction:k,disabledIndices:m,modifierKeys:y}),R=Bt(E,e,{state:i,ref:s,props:[C,...o,N],stateAttributesMapping:l}),_=S.useMemo(()=>({highlightedIndex:I,onHighlightedIndexChange:P,highlightItemOnHover:w,relayKeyboardEvent:z}),[I,P,w,z]);return h.jsx(TE.Provider,{value:_,children:h.jsx(TC,{elementsRef:j,onMapChange:O=>{v==null||v(O),F(O)},children:R})})}const AL=S.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:s,loopFocus:o=!0,render:i,style:l,...a}=t,{orientation:c,setTabMap:u,tabActivationDirection:f}=i0(),[d,g]=S.useState(0),[x,v]=S.useState(null),b=S.useRef(new Set),p=S.useRef(new Set),m=S.useRef(null);de(()=>{if(typeof ResizeObserver>"u")return;const C=new ResizeObserver(()=>{b.current.forEach(I=>{I()})});return m.current=C,x&&C.observe(x),p.current.forEach(I=>{C.observe(I)}),()=>{C.disconnect(),m.current=null}},[x]);const y=pe(C=>(b.current.add(C),()=>{b.current.delete(C)})),w=pe(C=>{var I;return p.current.add(C),(I=m.current)==null||I.observe(C),()=>{var P;p.current.delete(C),(P=m.current)==null||P.unobserve(C)}}),E={orientation:c,tabActivationDirection:f},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(MC.Provider,{value:k,children:h.jsx(jL,{render:i,className:s,style:l,state:E,refs:[n,v],props:[N,a],stateAttributesMapping:$d,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:o,orientation:c,onHighlightedIndexChange:g,onMapChange:u,disabledIndices:Kl})})}),zL=EL,jC=S.forwardRef(({className:e,...t},n)=>h.jsx(AL,{ref:n,className:rt("flex items-center gap-0.5 rounded border border-line bg-zinc-900/60 p-0.5",e),...t}));jC.displayName="TabsList";const AC=S.forwardRef(({className:e,...t},n)=>h.jsx(RL,{ref:n,className:rt("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}));AC.displayName="TabsTab";const Uc=S.forwardRef(({className:e,...t},n)=>h.jsx(TL,{ref:n,className:rt("focus-visible:outline-none",e),...t}));Uc.displayName="TabsPanel";const zC=S.createContext(void 0);function Ld(e){const t=S.useContext(zC);if(t===void 0&&!e)throw new Error(Qt(72));return t}const DL={...Am,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 FL extends kd{constructor(n,r,s){const o=new _m;super($L(n,o,r,s),LL(o),DL);ye(this,"setOpen",(n,r)=>{k2(this,n,r,{extraState:{openChangeReason:r.reason}})})}cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,_e(vs,n))}}function $L(e,t,n,r=!1){return{...Mm(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 LL(e){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const HL=cd(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:s,disableHoverablePopup:o=!1,trackCursorAxis:i="none",actionsRef:l,onOpenChange:a,onOpenChangeComplete:c,handle:u,triggerId:f,defaultTriggerId:d=null,children:g}=t,x=Rm((j,F)=>new FL({open:r,openProp:s,activeTriggerId:d,triggerIdProp:f},j,F));x.useControlledProp("openProp",s),x.useControlledProp("triggerIdProp",f),x.useContextCallback("onOpenChange",a),x.useContextCallback("onOpenChangeComplete",c);const v=x.useState("open"),b=!n&&v,p=x.useState("activeTriggerId"),m=x.useState("mounted"),y=x.useState("payload");x.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:o,disabled:n}),Tm(x,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:w,transitionStatus:E}=Im(b,x),N=x.useState("isInstantPhase"),k=x.useState("instantType"),C=x.useState("lastOpenChangeReason"),I=S.useRef(null);de(()=>{v&&n&&x.setOpen(!1,_e(kS))},[v,n,x]),de(()=>{E==="ending"&&C===md||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]),de(()=>{b&&p==null&&x.set("payload",void 0)},[x,p,b]),S.useImperativeHandle(l,()=>({unmount:w,close:()=>x.setOpen(!1,_e(um))}),[w,x]);const P=b||m||!n&&i!=="none";return h.jsxs(zC.Provider,{value:x,children:[u&&h.jsx(Nm,{handle:u,store:x}),P&&h.jsx(BL,{store:x,disabled:n,trackCursorAxis:i}),typeof g=="function"?g({payload:y}):g]})});function BL({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),s=Em(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),o=aM(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),i=S.useMemo(()=>vd(o.reference,s.reference),[o.reference,s.reference]);return Om(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:s.floating??vt}),null}const DC=S.createContext(void 0);function VL(){return S.useContext(DC)}const WL=600,FC="data-base-ui-tooltip-trigger";function Fv(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const s=n[r];if(Ee(s))return s}}const t=e.target;return Ee(t)?t:null}function UL(e){let t=e;for(;t;){const n=t.closest(`[${FC}]`);if(n)return n;const r=t.getRootNode();t="host"in r&&Ee(r.host)?r.host:null}return null}const qL=dS(function(t,n){const{render:r,className:s,style:o,handle:i,payload:l,disabled:a,delay:c,closeOnClick:u=!0,closeDelay:f,id:d,...g}=t,x=Ld(!0),b=EE(i)??x;if(!b)throw new Error(Qt(82));const p=Vi(d),m=b.useState("isTriggerActive",p),y=b.useState("isOpenedByTrigger",p),w=b.useState("floatingRootContext"),E=S.useRef(null),N=f??0,{registerTrigger:k,isMountedByThisTrigger:C}=wE(p,E,b,{payload:l,closeOnClick:u,closeDelay:N}),I=VL(),{activeIdRef:P,delayRef:j,isInstantPhase:F,hasProvider:z}=n_(w,{open:y}),R=Dm(w);b.useSyncedValue("isInstantPhase",F);const _=b.useState("disabled"),O=a??_,$=Ft(O),T=b.useState("trackCursorAxis"),A=b.useState("disableHoverablePopup"),M=S.useRef(!1),W=Nr(),L=S.useRef(void 0);function K(){return z&&P.current!=null?0:c??I??WL}function U(X){const ne=E.current;if(!ne||!X)return!1;const fe=UL(X);return fe!==null&&fe!==ne&&me(ne,fe)}function V(X){const ne=U(X);return M.current=ne,ne&&(R.openChangeTimeout.clear(),R.restTimeout.clear(),R.restTimeoutPending=!1,W.clear()),ne}const B=RE(w,{enabled:!O,mouseOnly:!0,move:!1,handleClose:!A&&T!=="both"?NE():null,restMs:K,delay(){return f==null&&z?{close:io(j.current,"close")}:{close:N}},triggerElementRef:E,isActiveTrigger:m,isClosing:()=>b.select("transitionStatus")==="ending",shouldOpen(){return!M.current}}),q=P2(w,{enabled:!O}).reference,H=X=>{const ne=M.current,fe=Fv(X),Te=V(fe),ce=E.current,ve=ce&&fe&&me(ce,fe);if(Te&&b.select("open")&&b.select("lastOpenChangeReason")===xt){b.setOpen(!1,_e(xt,X));return}if(ne&&!Te&&ve&&!$.current&&!b.select("open")&&ce&&hs(L.current)){const Q=()=>{!M.current&&!$.current&&!b.select("open")&&b.setOpen(!0,_e(xt,X,ce))},ge=K();ge===0?(W.clear(),Q()):W.start(ge,Q)}},Y=b.useState("triggerProps",C);return Bt("button",t,{state:{open:y},ref:[n,k,E],props:[B,q,C||T!=="none"?Y:void 0,{onMouseOver(X){H(X.nativeEvent)},onFocus(X){U(Fv(X.nativeEvent))&&X.preventBaseUIHandler()},onMouseLeave(){M.current=!1,W.clear(),L.current=void 0},onPointerEnter(X){L.current=X.pointerType},onPointerDown(X){L.current=X.pointerType,b.set("closeOnClick",u),u&&!b.select("open")&&b.cancelPendingOpen(X.nativeEvent)},onClick(X){u&&!b.select("open")&&b.cancelPendingOpen(X.nativeEvent)},id:p,[gp]:O?"":void 0,[FC]:O?void 0:""},g],stateAttributesMapping:wS})}),$C=S.createContext(void 0);function KL(){const e=S.useContext($C);if(e===void 0)throw new Error(Qt(70));return e}const YL=S.forwardRef(function(t,n){const{children:r,container:s,className:o,render:i,style:l,...a}=t,{node:c,subtree:u}=QS({container:s,ref:n,componentProps:t,elementProps:a});return!u&&!c?null:h.jsxs(S.Fragment,{children:[u,c&&on.createPortal(r,c)]})}),GL=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Ld().useState("mounted")||r?h.jsx($C.Provider,{value:r,children:h.jsx(YL,{ref:n,...s})}):null}),LC=S.createContext(void 0);function QL(){const e=S.useContext(LC);if(e===void 0)throw new Error(Qt(71));return e}const XL=S.forwardRef(function(t,n){const{render:r,className:s,anchor:o,positionMethod:i="absolute",side:l="top",align:a="center",sideOffset:c=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:d=5,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:v=!1,collisionAvoidance:b=KS,style:p,...m}=t,y=Ld(),w=KL(),E=y.useState("open"),N=y.useState("mounted"),k=y.useState("trackCursorAxis"),C=y.useState("disableHoverablePopup"),I=y.useState("floatingRootContext"),P=y.useState("instantType"),j=y.useState("transitionStatus"),F=y.useState("adaptiveOrigin"),z=jE({anchor:o,positionMethod:i,floatingRootContext:I,mounted:N,side:l,sideOffset:c,align:a,alignOffset:u,collisionBoundary:f,collisionPadding:d,sticky:x,arrowPadding:g,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]),_=zE(t,R,{styles:z.positionerStyles,transitionStatus:j,props:m,refs:[n,y.useStateSetter("positionerElement")],hidden:!N,inert:!E||k==="both"||C});return h.jsx(LC.Provider,{value:z,children:_})}),ZL=S.forwardRef(function(t,n){const{render:r,className:s,style:o,...i}=t,l=Ld(),{side:a,align:c}=QL(),u=l.useState("open"),f=l.useState("instantType"),d=l.useState("transitionStatus"),g=l.useState("popupProps"),x=l.useState("floatingRootContext"),v=l.useState("disabled"),b=l.useState("closeDelay");Ca({open:u,ref:l.context.popupRef,onComplete(){var w,E;u&&((E=(w=l.context).onOpenChangeComplete)==null||E.call(w,!0))}}),CE(x,{enabled:!v,closeDelay:b});const p=l.useStateSetter("popupElement");return Bt("div",t,{state:{open:u,side:a,align:c,instant:f,transitionStatus:d},ref:[n,l.context.popupRef,p],props:[Cm,g,Hm(d),i],stateAttributesMapping:cm})}),JL=function(t){const{delay:n,closeDelay:r,timeout:s=400}=t,o=S.useMemo(()=>({open:n,close:r}),[n,r]);return h.jsx(DC.Provider,{value:n,children:h.jsx(t_,{delay:o,timeoutMs:s,children:t.children})})};function e4({children:e,...t}){return h.jsx(JL,{delay:150,closeDelay:80,...t,children:e})}const t4=HL,n4=qL,r4="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 Wu({label:e,suppressed:t,side:n="bottom",align:r="end",children:s}){return h.jsxs(t4,{disabled:t??!1,children:[h.jsx(n4,{render:s}),h.jsx(GL,{children:h.jsx(XL,{side:n,align:r,sideOffset:4,collisionPadding:8,children:h.jsx(ZL,{className:rt(r4),children:e})})})]})}function HC({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 s4=["pending","running","suspended","completed","failed","cancelling","cancelled","dead"];function o4(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 i4(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 a0({status:e}){const t=e==="running"||e==="awaiting"||e==="cancelling";return h.jsx("span",{className:`dot s-${e} ${t?"pulse":""}`,"aria-hidden":!0})}function BC({status:e}){return h.jsxs(yt,{variant:"status",className:`s-${e} text-[11px]`,children:[h.jsx(a0,{status:e}),e]})}function l4({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:rt("rounded-md",t===a&&"border-zinc-600 bg-zinc-900 text-zinc-100 hover:text-zinc-100"),children:[a!=="all"&&h.jsx(a0,{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(HC,{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),s4.map(a=>s(a,a,e[a]??0))]}),h.jsx(u4,{}),!i&&h.jsx(Zj,{}),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 a4(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 VC({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]})," ",a4(e.lastAdjust.at)]})]})}function c4({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(VC,{status:t.status})]},t.instanceId))})}function u4(){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=wI(e),s={workers:"pods",partitions:"parts",alerts:"alerts"};return h.jsxs(zL,{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(AC,{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(Uc,{value:"workers",className:"flex flex-nowrap items-center gap-1.5",children:h.jsx(d4,{workers:xI(e)})}),h.jsx(Uc,{value:"partitions",className:"flex flex-nowrap items-center gap-1.5",children:h.jsx(f4,{groups:e})}),h.jsx(Uc,{value:"alerts",className:"flex flex-nowrap items-center gap-1.5",children:h.jsx(h4,{summary:r})})]})]})}const $v="__overflow__";function Lv(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 Hv({w:e}){return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-2.5 py-2",children:h.jsx(VC,{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 d4({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===$v;return h.jsxs(h.Fragment,{children:[i.map(c=>{const u=t===c.instanceId,f=Lv(c);return h.jsxs(Ii,{open:u,onOpenChange:d=>n(d?c.instanceId:void 0),children:[h.jsx(Wu,{suppressed:u,label:`${c.instanceId}
|
|
63
|
+
${c.handlers.length} handlers · ${c.partition}${f?` · ${f} in-flight`:""}`,children:h.jsx(Oi,{render:h.jsxs(je,{variant:"chip",size:"xs",className:rt("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",f?` · ${f}`:""]})]})})}),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(Hv,{w:c})]})]},c.instanceId)}),l.length>0&&h.jsxs(Ii,{open:a,onOpenChange:c=>{n(c?$v:void 0),s(void 0)},children:[h.jsx(Oi,{render:h.jsxs(je,{variant:"chip",size:"xs",className:rt("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=Lv(c),f=r===c.instanceId;return h.jsxs("div",{children:[h.jsxs("button",{type:"button",onClick:()=>s(f?void 0:c.instanceId),className:rt("mono flex w-full items-center justify-between gap-2 px-2.5 py-1.5 text-left text-[10px] hover:bg-zinc-800/50",f?"bg-zinc-800/40 text-zinc-200":"text-zinc-300"),children:[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}`:""]})]}),f&&h.jsx("div",{className:"border-t border-line-soft bg-zinc-900/40",children:h.jsx(Hv,{w:c})})]},c.instanceId)})})]})]})]})}function f4({groups:e}){const[t,n]=S.useState(void 0),r=mI(e);function s(o){const i=new Map;for(const l of e)if(vu(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(Ii,{open:l&&o.workerCount>0,onOpenChange:a=>n(a?o.partition:void 0),children:[h.jsx(Wu,{suppressed:l,label:`${o.partition}
|
|
64
|
+
${o.workerCount} workers · ${o.handlerCount} handlers · ${o.totalDepth} queued${i?` · ${o.starvedCount} starved`:""}`,children:h.jsx(Oi,{render:h.jsxs(je,{variant:"chip",size:"xs",disabled:o.workerCount===0,className:rt("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(c4,{workers:s(o.partition)})]})]},o.partition)})})}function h4({summary:e}){const t=(n,r)=>`${n} ${n===1?r:`${r}s`}`;return h.jsxs(h.Fragment,{children:[h.jsx(Wu,{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(Wu,{label:`${n.group}
|
|
66
|
+
${n.depth} queued, no worker consuming`,children:h.jsxs(yt,{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 p4(){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 g4=S.memo(function({run:t,siblings:n,health:r,selected:s,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a}){const c=V1(t,{runs:n,health:r}),u=t.namespace&&t.namespace!=="default"?t.namespace:void 0,f=Hi(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(yt,{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:d=>{d.stopPropagation(),l(u)},children:u}),f&&h.jsx(yt,{variant:"origin",className:"mono shrink-0 cursor-pointer px-1 text-[9px] hover:border-teal-400/60 hover:text-teal-200",title:`Declared by ${f} — click to show only this library's runs`,onClick:d=>{d.stopPropagation(),a({kind:"origin",origin:f})},children:Sa(f)}),t.id.startsWith("dlq:")&&h.jsx(yt,{variant:"danger",className:"mono shrink-0 px-1 text-[9px] uppercase tracking-wider",children:"dlq"})]}),h.jsx(BC,{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:o4(t.updatedAt)})]}),t.tags&&t.tags.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1",children:t.tags.map(d=>h.jsxs("span",{onClick:g=>{g.stopPropagation(),i(d)},className:rt(uS({variant:"outline"}),"mono cursor-pointer hover:border-zinc-500 hover:text-zinc-200"),children:["#",d]},d))})]})}),m4=86,y4=12;function x4({runs:e,siblings:t,health:n,loading:r,selected:s,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a,total:c,onLoadMore:u,loadingMore:f,emptyNotice:d}){var w;const g=S.useRef(null),x=S.useCallback(E=>K3(e,E),[e]),v=F1({count:e.length,getScrollElement:()=>g.current,estimateSize:()=>m4,getItemKey:x,measureElement:E=>E.getBoundingClientRect().height,overscan:8}),b=v.getVirtualItems(),p=c>e.length,m=b.length>0?((w=b[b.length-1])==null?void 0:w.index)??-1:-1,y=S.useRef(-1);return S.useEffect(()=>{q3({hasMore:p,loading:!!f,lastRenderedIndex:m,loadedCount:e.length,requestedAtCount:y.current,loadAhead:y4})&&(y.current=e.length,u())},[p,f,m,e.length,u]),r&&e.length===0?h.jsx(p4,{}):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:d.message}),d.unclassified!==void 0&&h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"text-[11px] text-zinc-500",children:[d.unclassified," run",d.unclassified===1?"":"s"," here"," ",d.unclassified===1?"has":"have"," no recorded origin, so no package filter can match ",d.unclassified===1?"it":"them","."]}),h.jsx(je,{variant:"chip",size:"xs",className:"mono rounded",title:Yg,onClick:()=>a({kind:"unknown"}),children:"show unclassified"})]})]}):h.jsxs("div",{ref:g,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(g4,{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":p&&f,children:[h.jsxs("span",{className:"mono text-[10px] text-zinc-600",children:[e.length," of ",c]}),p&&h.jsx("span",{className:"mono ml-auto text-[10px] text-zinc-600",children:f?"loading…":"scroll for more"})]})]})}function v4({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(a0,{status:r.status}),h.jsx("span",{className:"truncate text-amber-100",children:sI(r.name)}),h.jsx("span",{className:"ml-auto shrink-0 text-[10px] uppercase tracking-wider text-amber-400/70",children:r.status})]})},s)})})]})}const w4=S.memo(function({id:t,onOpenRun:n}){var ce,ve;const r=ho(),{data:s}=nn({queryKey:["run",t],queryFn:async()=>yI(r.getQueryData(["run",t]),await $e.run(t)),refetchInterval:Q=>{var xe;const ge=(xe=Q.state.data)==null?void 0:xe.run.status;return ge==="running"||ge==="suspended"?1500:!1}}),{data:o=[]}=nn({queryKey:["workers"],queryFn:()=>$e.workers(),refetchInterval:5e3}),i=s==null?void 0:s.run,l=UC(i!==void 0&&WC([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"]})},f=s==null?void 0:s.run.status,d=f==="running"||f==="suspended";S.useEffect(()=>{if(d)return $e.streamRun(t,Q=>{if(Q.type==="step.progress"&&Q.event&&Q.seq!=null){const ge=Q.seq,xe=Q.event;r.setQueryData(["run",t],Ne=>Ne&&{...Ne,timeline:Ne.timeline.map(Pe=>Pe.seq===ge?{...Pe,events:[...Pe.events??[],xe]}:Pe)});return}r.invalidateQueries({queryKey:["run",t]})})},[t,d,r]);const g=Ms({mutationFn:()=>$e.retry(t),onSuccess:u}),x=Ms({mutationFn:Q=>$e.cancel(t,Q!==void 0?{compensate:Q}:{}),onSuccess:u}),v=Ms({mutationFn:()=>$e.continue(t),onSuccess:u}),b=Ms({mutationFn:()=>$e.redispatch(t),onSuccess:u}),p=Ms({mutationFn:Q=>$e.retryWithInput(t,Q),onSuccess:Q=>{r.invalidateQueries({queryKey:["runs"]}),n(Q.runId)}}),[m,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 Q;try{Q=JSON.parse(w)}catch(ge){k(ge instanceof Error?ge.message:"Invalid JSON");return}y(!1),p.mutate(Q)},[P,j]=S.useState(),[F,z]=S.useState(!1),[R,_]=S.useState(new Set),[O,$]=S.useState(240);function T(Q){Q.preventDefault(),Q.currentTarget.setPointerCapture(Q.pointerId);const ge=Ne=>$(Pe=>Math.max(120,Math.min(720,Pe-Ne.movementY))),xe=()=>{window.removeEventListener("pointermove",ge),window.removeEventListener("pointerup",xe)};window.addEventListener("pointermove",ge),window.addEventListener("pointerup",xe)}const A=S.useCallback(Q=>{_(ge=>{const xe=new Set(ge);return xe.has(Q)?xe.delete(Q):xe.add(Q),xe})},[]),M=S.useCallback((Q,ge)=>{j({step:Q,run:ge})},[]),W=S.useMemo(()=>oI((s==null?void 0:s.timeline)??[]),[s==null?void 0:s.timeline]);if(!s)return h.jsx("div",{className:"p-8 text-sm text-zinc-600",children:"Loading run…"});const{run:L}=s,{body:K,compensations:U}=W,V=iI(U),B=L.id.startsWith("dlq:"),q=B?{id:L.id.slice(4),title:"Dead-letter handler",subtitle:`started because run ${L.id.slice(4)} was dead-lettered`,cta:"open dead run →"}:c?{id:`dlq:${L.id}`,title:"Dead-lettered",subtitle:"this run exceeded recovery and was routed to a DLQ handler",cta:"open DLQ handler →"}:void 0,H=U.length>0?(()=>{const Q=V.failed>0?` ${V.failed} undo${V.failed===1?"":"s"} failed after retries — check ${V.failed===1?"it":"them"} below.`:"";return V.pending>0?{title:"Compensating",subtitle:`undoing completed steps in reverse (${V.done} of ${V.total} done).${Q}`}:L.status==="cancelled"?{title:"Cancelled with compensation",subtitle:`completed steps were undone before cancelling.${Q}`}:{title:"Saga compensated",subtitle:`the run failed and its ${V.total} completed step${V.total===1?"":"s"} were undone in reverse.${Q}`}})():void 0,Y=L.status==="failed"||L.status==="suspended",te=L.status==="running"||L.status==="suspended",Z=L.status==="suspended"||L.status==="running",G=K.some(Q=>Q.status==="pending"&&Q.kind==="signal"&&Q.name.startsWith("breakpoint")),X=P?`${P.step.runId}#${P.step.seq}`:void 0,ne=V1(L,{runs:l,health:o,timeline:K}),fe=L.namespace&&L.namespace!=="default"?L.namespace:void 0,Te=Hi(L.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:L.workflow}),qf(L.id)!==void 0&&h.jsx(je,{variant:"alt",size:"xs",onClick:()=>n(qf(L.id)),className:"mono uppercase tracking-wider",title:`Open the parent run (${qf(L.id)}) — the macro view this child belongs to`,children:"↑ parent"}),Wc(L.id)!==void 0&&h.jsx(je,{variant:"chip",size:"xs",onClick:()=>n(Wc(L.id)),className:"mono uppercase tracking-wider text-zinc-300",title:`This is a retry-with-input of ${Wc(L.id)} — open the original run`,children:"↩ original"}),B&&h.jsx(yt,{variant:"danger",className:"mono py-0.5 uppercase tracking-wider",children:"dlq"}),h.jsx(BC,{status:ne.status}),ne.detail&&h.jsx("span",{className:`mono text-[11px] s-${ne.status}`,children:ne.detail}),fe&&h.jsx(yt,{variant:"tenant",className:"mono py-0.5",title:"Tenant / worker-pool partition this run belongs to",children:fe}),Te?h.jsx(yt,{variant:"origin",className:"mono py-0.5",title:`Declared by ${Te}`,children:Sa(Te)}):h.jsxs(yt,{variant:"origin-unknown",className:"mono py-0.5",title:Yg,children:["origin ",ad]}),U.length>0&&h.jsx(yt,{variant:"warn",className:rt("mono py-0.5 uppercase tracking-wider",V.pending>0&&"pulse"),title:V.pending>0?`compensating: ${V.done} of ${V.total} undone`:`${V.total} step${V.total===1?"":"s"} compensated`,children:V.pending>0?"compensating":"compensated"}),h.jsxs(yt,{className:"mono bg-transparent py-0.5 text-zinc-500",children:["v",L.workflowVersion]}),h.jsxs("span",{className:"mono tnum text-[11px] text-zinc-600",children:[K.length," ",K.length===1?"step":"steps"]})]}),h.jsx("div",{className:"mono mt-1 truncate text-[11px] text-zinc-600",children:L.id}),L.tags&&L.tags.length>0&&h.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:L.tags.map(Q=>h.jsxs(yt,{className:"mono",children:["#",Q]},Q))}),L.searchAttributes&&Object.keys(L.searchAttributes).length>0&&h.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:Object.entries(L.searchAttributes).map(([Q,ge])=>h.jsxs(yt,{variant:"attr",className:"mono",title:"search attribute",children:[Q,"=",String(ge)]},Q))}),(ce=s==null?void 0:s.children)!=null&&ce.length?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:"}),(ve=s.children)==null?void 0:ve.map(Q=>h.jsx(je,{variant:"chip",size:"xs",onClick:()=>n(Q),className:"mono px-1.5 py-0",children:Q},Q))]}):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:"{ }"}),G&&h.jsxs(je,{variant:"warn",disabled:v.isPending,onClick:()=>v.mutate(),children:[h.jsx(CI,{width:12,height:12}),"Continue"]}),h.jsxs(je,{variant:"brand",disabled:!Y||g.isPending,onClick:()=>g.mutate(),children:[h.jsx(bf,{width:12,height:12}),"Retry"]}),Z&&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(Qg,{width:12,height:12}),"Re-dispatch"]}),(L.status==="dead"||L.status==="failed")&&h.jsxs(je,{variant:"alt",disabled:p.isPending,onClick:C,title:"Edit the input and re-run as a fresh linked run",children:[h.jsx(bf,{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(bf,{width:12,height:12}),"Cancel + Undo"]}),h.jsxs(je,{className:"border-zinc-700",disabled:!te||x.isPending,onClick:()=>x.mutate(!1),children:[h.jsx(ys,{width:12,height:12}),"Cancel"]})]})]}),q&&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:q.title}),h.jsx("div",{className:"mono truncate text-[11px] text-rose-300/70",children:q.subtitle})]}),h.jsx(je,{variant:"danger",onClick:()=>n(q.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:q.cta})]}),H&&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:H.title}),h.jsx("div",{className:"mono truncate text-[11px] text-amber-300/70",children:H.subtitle})]})]}),h.jsxs("div",{className:"relative grid min-h-0 flex-1",style:{gridTemplateRows:K.length>0?`1fr ${O}px`:"1fr"},children:[h.jsxs("div",{className:"relative min-h-0",children:[K.length===0?h.jsx("div",{className:"grid h-full place-items-center text-sm text-zinc-600",children:"No steps recorded yet."}):h.jsx(U3,{run:L,timeline:K,endStatus:ne.status,selectedKey:X,onSelect:M,onOpenRun:n,fmtDuration:i4,expanded:R,onToggleChild:A}),(L.status==="failed"||L.status==="cancelled")&&L.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:L.error.message})]}),K.length>0&&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(Vj,{run:L,timeline:K,selectedKey:X,onSelect:M,onOpenRun:n,expanded:R,onToggleChild:A})]}),P&&h.jsx(Gj,{step:P.step,run:P.run,onClose:()=>j(void 0),onOpenRun:n}),F&&h.jsx(Qj,{run:L,onClose:()=>z(!1)})]}),U.length>0&&h.jsx(v4,{compensations:U,selKey:X,onSelect:Q=>j({step:Q,run:L})}),h.jsxs(pL,{open:m,onOpenChange:y,title:"Fix & replay",subtitle:`re-runs ${L.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:p.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:Q=>{E(Q.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 Bv(){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 WC(e){return e.some(t=>{var n;return t.status==="suspended"&&((n=t.tags)==null?void 0:n.some(r=>r.startsWith("singleton:")))})}function UC(e){const{data:t=[]}=nn({queryKey:["runs","in-flight"],queryFn:()=>$e.runs(void 0,void 0,void 0,{statuses:B1,limit:500}),enabled:e,refetchInterval:5e3});return t}const b4=100;function R4(){const[e,t]=S.useState("all"),[n,r]=S.useState([]),[s,o]=S.useState([]),[i,l]=S.useState([]),[a,c]=S.useState(L1),[u,f]=S.useState(()=>Bv()),d=S.useCallback(q=>{if(f(q),typeof window>"u")return;const H=q?`#/run/${encodeURIComponent(q)}`:"",Y=H||window.location.pathname+window.location.search;window.location.hash!==H&&window.history.pushState(null,"",Y)},[]);S.useEffect(()=>{const q=()=>f(Bv());return window.addEventListener("hashchange",q),window.addEventListener("popstate",q),()=>{window.removeEventListener("hashchange",q),window.removeEventListener("popstate",q)}},[]);const[g,x]=S.useState({key:"",pages:1}),v=ho(),b=s,p=b.join("|"),m=a.kind==="origin"?a.origin:a.kind==="unknown"?null:void 0,y=H1(a),w=Y3({status:e,tag:n.join("|"),attrs:p,namespace:i.join("|"),origin:y}),E=g.key===w?g.pages:1,N=b4*E,{data:k=[],isPending:C,isFetching:I}=nn({queryKey:["runs",e,n,p,i,y,N],queryFn:()=>$e.runs(e==="all"?void 0:e,n,b.length?b:void 0,{namespace:i,origin:m,limit:N}),refetchInterval:3e3,placeholderData:WR}),{data:P=[]}=nn({queryKey:["run-facets",n,p,i],queryFn:()=>$e.facets(n,b.length?b:void 0,i),refetchInterval:5e3}),j=a.kind==="unknown"?null:a.kind==="origin"?a.origin:void 0,F=S.useMemo(()=>({namespace:i,attr:s,origin:j}),[i,s,j]),z=S.useMemo(()=>({tag:n,attr:s,origin:j}),[n,s,j]),R=S.useMemo(()=>({tag:n,namespace:i,origin:j}),[n,i,j]),{data:_=[]}=nn({queryKey:["workers"],queryFn:()=>$e.workers(),refetchInterval:5e3}),O=Ms({mutationFn:q=>$e.bulk(q,{status:e!=="all"?e:void 0,tag:n,attr:b.length?b:void 0,namespace:i,origin:m}),onSuccess:()=>v.invalidateQueries({queryKey:["runs"]})}),$=S.useMemo(()=>{const q={};for(const H of P)eI({origin:H.origin??void 0},a)&&(q[H.status]=(q[H.status]??0)+H.count);return q},[P,a]),T=S.useMemo(()=>nI(P),[P]),A=S.useMemo(()=>e==="all"?Object.values($).reduce((q,H)=>q+H,0):$[e]??0,[$,e]),M=e!=="all"||n.length>0||i.length>0||b.length>0||a.kind!=="all",W=S.useMemo(()=>tI(P),[P]),L=S.useMemo(()=>vI(_),[_]),K=UC(S.useMemo(()=>WC(k),[k])),U=S.useCallback(q=>{r(H=>H.includes(q)?H:[...H,q])},[]),V=S.useCallback(q=>{l(H=>H.includes(q)?H:[...H,q])},[]),B=S.useCallback(()=>{x(q=>({key:w,pages:q.key===w?q.pages+1:2}))},[w]);return h.jsxs(e4,{children:[h.jsx("div",{className:"app-bg"}),h.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[h.jsx(l4,{counts:$,filter:e,onFilter:t}),L.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:L.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(Ou,{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(Ou,{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(Oj,{value:s,onChange:o,scope:R})]}),h.jsx(_j,{facets:W,value:a,onChange:c}),M&&A>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:[A," ",e!=="all"?e:"",n.length>0&&` #${n.join(", ")}`,i.length>0&&` @${i.join(", ")}`,a.kind==="origin"&&` ⬡${Sa(a.origin)}`,a.kind==="unknown"&&` ⬡${ad}`,b.length>0&&` ⛃${b.length}`]}),h.jsx(je,{variant:"brand",size:"xs",disabled:O.isPending,onClick:()=>O.mutate("retry"),className:"mono ml-auto rounded",children:"retry all"}),h.jsx(je,{variant:"danger",size:"xs",disabled:O.isPending,onClick:()=>O.mutate("cancel"),className:"mono rounded",children:"cancel all"})]}),h.jsx(x4,{runs:k,siblings:K,health:_,loading:C,selected:u,onSelect:d,onSelectTag:U,onSelectNamespace:V,onSelectOrigin:c,total:A,onLoadMore:B,loadingMore:I,emptyNotice:rI({anyFilter:M,origin:a,unknownCount:T})},w)]}),h.jsx("main",{className:"min-h-0",children:u?h.jsx(w4,{id:u,onOpenRun:d},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(HC,{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{R4 as A,E4 as Q,Vm as R,C4 as a,xT as c,h as j,S as r};
|