@adonis-agora/durable 0.21.1 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/dist/assets/spa/assets/index-BpH1yTMa.js +81 -0
- package/dist/assets/spa/assets/index-BpH1yTMa.js.map +1 -0
- package/dist/assets/spa/assets/index-CTsYsi6p.css +1 -0
- package/dist/assets/spa/index.html +19 -0
- package/dist/providers/dashboard_provider.d.ts +51 -52
- package/dist/providers/dashboard_provider.d.ts.map +1 -1
- package/dist/providers/dashboard_provider.js +234 -121
- package/dist/providers/dashboard_provider.js.map +1 -1
- package/dist/src/dashboard/attr-filter.d.ts +8 -0
- package/dist/src/dashboard/attr-filter.d.ts.map +1 -0
- package/dist/src/dashboard/attr-filter.js +35 -0
- package/dist/src/dashboard/attr-filter.js.map +1 -0
- package/dist/src/dashboard/auth.d.ts +55 -10
- package/dist/src/dashboard/auth.d.ts.map +1 -1
- package/dist/src/dashboard/auth.js +50 -11
- package/dist/src/dashboard/auth.js.map +1 -1
- package/dist/src/dashboard/gateway-adapter.d.ts +52 -5
- package/dist/src/dashboard/gateway-adapter.d.ts.map +1 -1
- package/dist/src/dashboard/gateway-adapter.js +48 -6
- package/dist/src/dashboard/gateway-adapter.js.map +1 -1
- package/dist/src/dashboard/handlers.d.ts +56 -8
- package/dist/src/dashboard/handlers.d.ts.map +1 -1
- package/dist/src/dashboard/handlers.js +116 -14
- package/dist/src/dashboard/handlers.js.map +1 -1
- package/dist/src/dashboard/index.d.ts +4 -4
- package/dist/src/dashboard/index.d.ts.map +1 -1
- package/dist/src/dashboard/index.js +3 -3
- package/dist/src/dashboard/index.js.map +1 -1
- package/dist/src/dashboard/spa.d.ts +22 -0
- package/dist/src/dashboard/spa.d.ts.map +1 -0
- package/dist/src/dashboard/spa.js +43 -0
- package/dist/src/dashboard/spa.js.map +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/transports/queue-mock-adapter.d.ts +1 -0
- package/dist/src/transports/queue-mock-adapter.d.ts.map +1 -1
- package/dist/src/transports/queue-mock-adapter.js +1 -0
- package/dist/src/transports/queue-mock-adapter.js.map +1 -1
- package/dist/stubs/config/durable_dashboard.stub +19 -0
- package/package.json +18 -17
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var tR=Object.defineProperty;var r0=e=>{throw TypeError(e)};var nR=(e,t,n)=>t in e?tR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Re=(e,t,n)=>nR(e,typeof t!="symbol"?t+"":t,n),Zd=(e,t,n)=>t.has(e)||r0("Cannot "+n);var L=(e,t,n)=>(Zd(e,t,"read from private field"),n?n.call(e):t.get(e)),oe=(e,t,n)=>t.has(e)?r0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ne=(e,t,n,r)=>(Zd(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ge=(e,t,n)=>(Zd(e,t,"access private method"),n);var Wa=(e,t,n,r)=>({set _(s){ne(e,t,s,n)},get _(){return L(e,t,r)}});function rR(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 $x(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bx={exports:{}},Zu={},Hx={exports:{}},we={};/**
|
|
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 ma=Symbol.for("react.element"),sR=Symbol.for("react.portal"),oR=Symbol.for("react.fragment"),iR=Symbol.for("react.strict_mode"),lR=Symbol.for("react.profiler"),aR=Symbol.for("react.provider"),cR=Symbol.for("react.context"),uR=Symbol.for("react.forward_ref"),dR=Symbol.for("react.suspense"),fR=Symbol.for("react.memo"),hR=Symbol.for("react.lazy"),s0=Symbol.iterator;function pR(e){return e===null||typeof e!="object"?null:(e=s0&&e[s0]||e["@@iterator"],typeof e=="function"?e:null)}var Vx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Wx=Object.assign,Ux={};function _i(e,t,n){this.props=e,this.context=t,this.refs=Ux,this.updater=n||Vx}_i.prototype.isReactComponent={};_i.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};_i.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Kx(){}Kx.prototype=_i.prototype;function Gp(e,t,n){this.props=e,this.context=t,this.refs=Ux,this.updater=n||Vx}var Zp=Gp.prototype=new Kx;Zp.constructor=Gp;Wx(Zp,_i.prototype);Zp.isPureReactComponent=!0;var o0=Array.isArray,qx=Object.prototype.hasOwnProperty,Jp={current:null},Yx={key:!0,ref:!0,__self:!0,__source:!0};function Qx(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)qx.call(t,r)&&!Yx.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:ma,type:e,key:o,ref:i,props:s,_owner:Jp.current}}function gR(e,t){return{$$typeof:ma,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function eg(e){return typeof e=="object"&&e!==null&&e.$$typeof===ma}function mR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var i0=/\/+/g;function Jd(e,t){return typeof e=="object"&&e!==null&&e.key!=null?mR(""+e.key):t.toString(36)}function Pc(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 ma:case sR:i=!0}}if(i)return i=e,s=s(i),e=r===""?"."+Jd(i,0):r,o0(s)?(n="",e!=null&&(n=e.replace(i0,"$&/")+"/"),Pc(s,t,n,"",function(c){return c})):s!=null&&(eg(s)&&(s=gR(s,n+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(i0,"$&/")+"/")+e)),t.push(s)),1;if(i=0,r=r===""?".":r+":",o0(e))for(var l=0;l<e.length;l++){o=e[l];var a=r+Jd(o,l);i+=Pc(o,t,n,a,s)}else if(a=pR(e),typeof a=="function")for(e=a.call(e),l=0;!(o=e.next()).done;)o=o.value,a=r+Jd(o,l++),i+=Pc(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 Ua(e,t,n){if(e==null)return e;var r=[],s=0;return Pc(e,r,"","",function(o){return t.call(n,o,s++)}),r}function yR(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 Tt={current:null},Tc={transition:null},vR={ReactCurrentDispatcher:Tt,ReactCurrentBatchConfig:Tc,ReactCurrentOwner:Jp};function Xx(){throw Error("act(...) is not supported in production builds of React.")}we.Children={map:Ua,forEach:function(e,t,n){Ua(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ua(e,function(){t++}),t},toArray:function(e){return Ua(e,function(t){return t})||[]},only:function(e){if(!eg(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};we.Component=_i;we.Fragment=oR;we.Profiler=lR;we.PureComponent=Gp;we.StrictMode=iR;we.Suspense=dR;we.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vR;we.act=Xx;we.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=Wx({},e.props),s=e.key,o=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,i=Jp.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)qx.call(t,a)&&!Yx.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:ma,type:e.type,key:s,ref:o,props:r,_owner:i}};we.createContext=function(e){return e={$$typeof:cR,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:aR,_context:e},e.Consumer=e};we.createElement=Qx;we.createFactory=function(e){var t=Qx.bind(null,e);return t.type=e,t};we.createRef=function(){return{current:null}};we.forwardRef=function(e){return{$$typeof:uR,render:e}};we.isValidElement=eg;we.lazy=function(e){return{$$typeof:hR,_payload:{_status:-1,_result:e},_init:yR}};we.memo=function(e,t){return{$$typeof:fR,type:e,compare:t===void 0?null:t}};we.startTransition=function(e){var t=Tc.transition;Tc.transition={};try{e()}finally{Tc.transition=t}};we.unstable_act=Xx;we.useCallback=function(e,t){return Tt.current.useCallback(e,t)};we.useContext=function(e){return Tt.current.useContext(e)};we.useDebugValue=function(){};we.useDeferredValue=function(e){return Tt.current.useDeferredValue(e)};we.useEffect=function(e,t){return Tt.current.useEffect(e,t)};we.useId=function(){return Tt.current.useId()};we.useImperativeHandle=function(e,t,n){return Tt.current.useImperativeHandle(e,t,n)};we.useInsertionEffect=function(e,t){return Tt.current.useInsertionEffect(e,t)};we.useLayoutEffect=function(e,t){return Tt.current.useLayoutEffect(e,t)};we.useMemo=function(e,t){return Tt.current.useMemo(e,t)};we.useReducer=function(e,t,n){return Tt.current.useReducer(e,t,n)};we.useRef=function(e){return Tt.current.useRef(e)};we.useState=function(e){return Tt.current.useState(e)};we.useSyncExternalStore=function(e,t,n){return Tt.current.useSyncExternalStore(e,t,n)};we.useTransition=function(){return Tt.current.useTransition()};we.version="18.3.1";Hx.exports=we;var S=Hx.exports;const Gx=$x(S),Zx=rR({__proto__:null,default:Gx},[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 xR=S,wR=Symbol.for("react.element"),bR=Symbol.for("react.fragment"),SR=Object.prototype.hasOwnProperty,ER=xR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,kR={key:!0,ref:!0,__self:!0,__source:!0};function Jx(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)SR.call(t,r)&&!kR.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:wR,type:e,key:o,ref:i,props:s,_owner:ER.current}}Zu.Fragment=bR;Zu.jsx=Jx;Zu.jsxs=Jx;Bx.exports=Zu;var v=Bx.exports,fo=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(){}},zs,$r,Xo,Px,CR=(Px=class extends fo{constructor(){super();oe(this,zs);oe(this,$r);oe(this,Xo);ne(this,Xo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){L(this,$r)||this.setEventListener(L(this,Xo))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,$r))==null||t.call(this),ne(this,$r,void 0))}setEventListener(t){var n;ne(this,Xo,t),(n=L(this,$r))==null||n.call(this),ne(this,$r,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){L(this,zs)!==t&&(ne(this,zs,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof L(this,zs)=="boolean"?L(this,zs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},zs=new WeakMap,$r=new WeakMap,Xo=new WeakMap,Px),tg=new CR,RR={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Br,Xp,Tx,NR=(Tx=class{constructor(){oe(this,Br,RR);oe(this,Xp,!1)}setTimeoutProvider(e){ne(this,Br,e)}setTimeout(e,t){return L(this,Br).setTimeout(e,t)}clearTimeout(e){L(this,Br).clearTimeout(e)}setInterval(e,t){return L(this,Br).setInterval(e,t)}clearInterval(e){L(this,Br).clearInterval(e)}},Br=new WeakMap,Xp=new WeakMap,Tx),Ts=new NR;function PR(e){setTimeout(e,0)}var TR=typeof window>"u"||"Deno"in globalThis;function wt(){}function MR(e,t){return typeof e=="function"?e(t):e}function eh(e){return typeof e=="number"&&e>=0&&e!==1/0}function ew(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Jr(e,t){return typeof e=="function"?e(t):e}function Xt(e,t){return typeof e=="function"?e(t):e}function l0(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:i,stale:l}=e;if(i){if(r){if(t.queryHash!==ng(i,t.options))return!1}else if(!di(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 a0(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Gs(t.options.mutationKey)!==Gs(o))return!1}else if(!di(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function ng(e,t){return((t==null?void 0:t.queryKeyHashFn)||Gs)(e)}function Gs(e){return JSON.stringify(e,(t,n)=>th(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function di(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(!di(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!di(e[r],t[r]))return!1;return!0}return!1}var IR=Object.prototype.hasOwnProperty;function rg(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=c0(e)&&c0(t);if(!r&&!(th(e)&&th(t)))return t;const o=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),l=i.length,a=r?new Array(l):{};let c=0;for(let d=0;d<l;d++){const u=r?d:i[d],f=e[u],h=t[u];if(f===h){a[u]=f,(r?d<o:IR.call(e,u))&&c++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){a[u]=h;continue}const g=rg(f,h,n+1);a[u]=g,g===f&&c++}return o===l&&c===o?e:a}function Ml(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function c0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function th(e){if(!u0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!u0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function u0(e){return Object.prototype.toString.call(e)==="[object Object]"}function _R(e){return new Promise(t=>{Ts.setTimeout(t,e)})}function nh(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?rg(e,t):t}function OR(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function AR(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var sg=Symbol();function tw(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===sg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function og(e,t){return typeof e=="function"?e(...t):!!e}function jR(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var Il=(()=>{let e=()=>TR;return{isServer(){return e()},setIsServer(t){e=t}}})();function rh(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var zR=PR;function LR(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=zR;const o=l=>{t?e.push(l):s(()=>{n(l)})},i=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(a=>{n(a)})})})};return{batch:l=>{let a;t++;try{a=l()}finally{t--,t||i()}return a},batchCalls:l=>(...a)=>{o(()=>{l(...a)})},schedule:o,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var qe=LR(),Go,Hr,Zo,Mx,DR=(Mx=class extends fo{constructor(){super();oe(this,Go,!0);oe(this,Hr);oe(this,Zo);ne(this,Zo,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(){L(this,Hr)||this.setEventListener(L(this,Zo))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,Hr))==null||t.call(this),ne(this,Hr,void 0))}setEventListener(t){var n;ne(this,Zo,t),(n=L(this,Hr))==null||n.call(this),ne(this,Hr,t(this.setOnline.bind(this)))}setOnline(t){L(this,Go)!==t&&(ne(this,Go,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return L(this,Go)}},Go=new WeakMap,Hr=new WeakMap,Zo=new WeakMap,Mx),eu=new DR;function FR(e){return Math.min(1e3*2**e,3e4)}function nw(e){return(e??"online")==="online"?eu.isOnline():!0}var sh=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function rw(e){let t=!1,n=0,r;const s=rh(),o=()=>s.status!=="pending",i=x=>{var b;if(!o()){const p=new sh(x);f(p),(b=e.onCancel)==null||b.call(e,p)}},l=()=>{t=!0},a=()=>{t=!1},c=()=>tg.isFocused()&&(e.networkMode==="always"||eu.isOnline())&&e.canRun(),d=()=>nw(e.networkMode)&&e.canRun(),u=x=>{o()||(r==null||r(),s.resolve(x))},f=x=>{o()||(r==null||r(),s.reject(x))},h=()=>new Promise(x=>{var b;r=p=>{(o()||c())&&x(p)},(b=e.onPause)==null||b.call(e)}).then(()=>{var x;r=void 0,o()||(x=e.onContinue)==null||x.call(e)}),g=()=>{if(o())return;let x;const b=n===0?e.initialPromise:void 0;try{x=b??e.fn()}catch(p){x=Promise.reject(p)}Promise.resolve(x).then(u).catch(p=>{var C;if(o())return;const y=e.retry??(Il.isServer()?0:3),m=e.retryDelay??FR,w=typeof m=="function"?m(n,p):m,k=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,p);if(t||!k){f(p);return}n++,(C=e.onFail)==null||C.call(e,n,p),_R(w).then(()=>c()?void 0:h()).then(()=>{t?f(p):g()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(r==null||r(),s),cancelRetry:l,continueRetry:a,canStart:d,start:()=>(d()?g():h().then(g),s)}}var Ls,Ix,sw=(Ix=class{constructor(){oe(this,Ls)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),eh(this.gcTime)&&ne(this,Ls,Ts.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Il.isServer()?1/0:5*60*1e3))}clearGcTimeout(){L(this,Ls)!==void 0&&(Ts.clearTimeout(L(this,Ls)),ne(this,Ls,void 0))}},Ls=new WeakMap,Ix);function $R(e){return{onFetch:(t,n)=>{var d,u,f,h,g;const r=t.options,s=(f=(u=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:u.fetchMore)==null?void 0:f.direction,o=((h=t.state.data)==null?void 0:h.pages)||[],i=((g=t.state.data)==null?void 0:g.pageParams)||[];let l={pages:[],pageParams:[]},a=0;const c=async()=>{let x=!1;const b=m=>{jR(m,()=>t.signal,()=>x=!0)},p=tw(t.options,t.fetchOptions),y=async(m,w,k)=>{if(x)return Promise.reject(t.signal.reason);if(w==null&&m.pages.length)return Promise.resolve(m);const R=(()=>{const j={client:t.client,queryKey:t.queryKey,pageParam:w,direction:k?"backward":"forward",meta:t.options.meta};return b(j),j})(),E=await p(R),{maxPages:M}=t.options,_=k?AR:OR;return{pages:_(m.pages,E,M),pageParams:_(m.pageParams,w,M)}};if(s&&o.length){const m=s==="backward",w=m?ow:oh,k={pages:o,pageParams:i},C=w(r,k);l=await y(k,C,m)}else{const m=e??o.length;do{const w=a===0?i[0]??r.initialPageParam:oh(r,l);if(a>0&&w==null)break;l=await y(l,w),a++}while(a<m)}return l};t.options.persister?t.fetchFn=()=>{var x,b;return(b=(x=t.options).persister)==null?void 0:b.call(x,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function oh(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 ow(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 BR(e,t){return t?oh(e,t)!=null:!1}function HR(e,t){return!t||!e.getPreviousPageParam?!1:ow(e,t)!=null}var Jo,Ds,ei,cn,Fs,at,la,$s,Qt,iw,Jn,_x,VR=(_x=class extends sw{constructor(t){super();oe(this,Qt);oe(this,Jo);oe(this,Ds);oe(this,ei);oe(this,cn);oe(this,Fs);oe(this,at);oe(this,la);oe(this,$s);ne(this,$s,!1),ne(this,la,t.defaultOptions),this.setOptions(t.options),this.observers=[],ne(this,Fs,t.client),ne(this,cn,L(this,Fs).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ne(this,Ds,f0(this.options)),this.state=t.state??L(this,Ds),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return L(this,Jo)}get promise(){var t;return(t=L(this,at))==null?void 0:t.promise}setOptions(t){if(this.options={...L(this,la),...t},t!=null&&t._type&&ne(this,Jo,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=f0(this.options);n.data!==void 0&&(this.setState(d0(n.data,n.dataUpdatedAt)),ne(this,Ds,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&L(this,cn).remove(this)}setData(t,n){const r=nh(this.state.data,t,this.options);return ge(this,Qt,Jn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){ge(this,Qt,Jn).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=L(this,at))==null?void 0:r.promise;return(s=L(this,at))==null||s.cancel(t),n?n.then(wt).catch(wt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return L(this,Ds)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Xt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===sg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Jr(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:!ew(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=L(this,at))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=L(this,at))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),L(this,cn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(L(this,at)&&(L(this,$s)||ge(this,Qt,iw).call(this)?L(this,at).cancel({revert:!0}):L(this,at).cancelRetry()),this.scheduleGc()),L(this,cn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ge(this,Qt,Jn).call(this,{type:"invalidate"})}async fetch(t,n){var c,d,u,f,h,g,x,b,p,y,m;if(this.state.fetchStatus!=="idle"&&((c=L(this,at))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(L(this,at))return L(this,at).continueRetry(),L(this,at).promise}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(k=>k.options.queryFn);w&&this.setOptions(w.options)}const r=new AbortController,s=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(ne(this,$s,!0),r.signal)})},o=()=>{const w=tw(this.options,n),C=(()=>{const R={client:L(this,Fs),queryKey:this.queryKey,meta:this.meta};return s(R),R})();return ne(this,$s,!1),this.options.persister?this.options.persister(w,C,this):w(C)},l=(()=>{const w={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:L(this,Fs),state:this.state,fetchFn:o};return s(w),w})(),a=L(this,Jo)==="infinite"?$R(this.options.pages):this.options.behavior;a==null||a.onFetch(l,this),ne(this,ei,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&ge(this,Qt,Jn).call(this,{type:"fetch",meta:(u=l.fetchOptions)==null?void 0:u.meta}),ne(this,at,rw({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:w=>{w instanceof sh&&w.revert&&this.setState({...L(this,ei),fetchStatus:"idle"}),r.abort()},onFail:(w,k)=>{ge(this,Qt,Jn).call(this,{type:"failed",failureCount:w,error:k})},onPause:()=>{ge(this,Qt,Jn).call(this,{type:"pause"})},onContinue:()=>{ge(this,Qt,Jn).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const w=await L(this,at).start();if(w===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(w),(h=(f=L(this,cn).config).onSuccess)==null||h.call(f,w,this),(x=(g=L(this,cn).config).onSettled)==null||x.call(g,w,this.state.error,this),w}catch(w){if(w instanceof sh){if(w.silent)return L(this,at).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw ge(this,Qt,Jn).call(this,{type:"error",error:w}),(p=(b=L(this,cn).config).onError)==null||p.call(b,w,this),(m=(y=L(this,cn).config).onSettled)==null||m.call(y,this.state.data,w,this),w}finally{this.scheduleGc()}}},Jo=new WeakMap,Ds=new WeakMap,ei=new WeakMap,cn=new WeakMap,Fs=new WeakMap,at=new WeakMap,la=new WeakMap,$s=new WeakMap,Qt=new WeakSet,iw=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Jn=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,...lw(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...d0(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ne(this,ei,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),qe.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),L(this,cn).notify({query:this,type:"updated",action:t})})},_x);function lw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:nw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function d0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function f0(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 Ot,Se,aa,Ct,Bs,ti,nr,Vr,ca,ni,ri,Hs,Vs,Wr,si,Pe,cl,ih,lh,ah,ch,uh,dh,fh,aw,Ox,Ju=(Ox=class extends fo{constructor(t,n){super();oe(this,Pe);oe(this,Ot);oe(this,Se);oe(this,aa);oe(this,Ct);oe(this,Bs);oe(this,ti);oe(this,nr);oe(this,Vr);oe(this,ca);oe(this,ni);oe(this,ri);oe(this,Hs);oe(this,Vs);oe(this,Wr);oe(this,si,new Set);this.options=n,ne(this,Ot,t),ne(this,Vr,null),ne(this,nr,rh()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(L(this,Se).addObserver(this),h0(L(this,Se),this.options)?ge(this,Pe,cl).call(this):this.updateResult(),ge(this,Pe,ch).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return hh(L(this,Se),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return hh(L(this,Se),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ge(this,Pe,uh).call(this),ge(this,Pe,dh).call(this),L(this,Se).removeObserver(this)}setOptions(t){const n=this.options,r=L(this,Se);if(this.options=L(this,Ot).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Xt(this.options.enabled,L(this,Se))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ge(this,Pe,fh).call(this),L(this,Se).setOptions(this.options),n._defaulted&&!Ml(this.options,n)&&L(this,Ot).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,Se),observer:this});const s=this.hasListeners();s&&p0(L(this,Se),r,this.options,n)&&ge(this,Pe,cl).call(this),this.updateResult(),s&&(L(this,Se)!==r||Xt(this.options.enabled,L(this,Se))!==Xt(n.enabled,L(this,Se))||Jr(this.options.staleTime,L(this,Se))!==Jr(n.staleTime,L(this,Se)))&&ge(this,Pe,ih).call(this);const o=ge(this,Pe,lh).call(this);s&&(L(this,Se)!==r||Xt(this.options.enabled,L(this,Se))!==Xt(n.enabled,L(this,Se))||o!==L(this,Wr))&&ge(this,Pe,ah).call(this,o)}getOptimisticResult(t){const n=L(this,Ot).getQueryCache().build(L(this,Ot),t),r=this.createResult(n,t);return UR(this,r)&&(ne(this,Ct,r),ne(this,ti,this.options),ne(this,Bs,L(this,Se).state)),r}getCurrentResult(){return L(this,Ct)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&L(this,nr).status==="pending"&&L(this,nr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){L(this,si).add(t)}getCurrentQuery(){return L(this,Se)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=L(this,Ot).defaultQueryOptions(t),r=L(this,Ot).getQueryCache().build(L(this,Ot),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ge(this,Pe,cl).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),L(this,Ct)))}createResult(t,n){var M;const r=L(this,Se),s=this.options,o=L(this,Ct),i=L(this,Bs),l=L(this,ti),c=t!==r?t.state:L(this,aa),{state:d}=t;let u={...d},f=!1,h;if(n._optimisticResults){const _=this.hasListeners(),j=!_&&h0(t,n),D=_&&p0(t,r,n,s);(j||D)&&(u={...u,...lw(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:g,errorUpdatedAt:x,status:b}=u;h=u.data;let p=!1;if(n.placeholderData!==void 0&&h===void 0&&b==="pending"){let _;o!=null&&o.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(_=o.data,p=!0):_=typeof n.placeholderData=="function"?n.placeholderData((M=L(this,ri))==null?void 0:M.state.data,L(this,ri)):n.placeholderData,_!==void 0&&(b="success",h=nh(o==null?void 0:o.data,_,n),f=!0)}if(n.select&&h!==void 0&&!p)if(o&&h===(i==null?void 0:i.data)&&n.select===L(this,ca))h=L(this,ni);else try{ne(this,ca,n.select),h=n.select(h),h=nh(o==null?void 0:o.data,h,n),ne(this,ni,h),ne(this,Vr,null)}catch(_){ne(this,Vr,_)}L(this,Vr)&&(g=L(this,Vr),h=L(this,ni),x=Date.now(),b="error");const y=u.fetchStatus==="fetching",m=b==="pending",w=b==="error",k=m&&y,C=h!==void 0,E={status:b,fetchStatus:u.fetchStatus,isPending:m,isSuccess:b==="success",isError:w,isInitialLoading:k,isLoading:k,data:h,dataUpdatedAt:u.dataUpdatedAt,error:g,errorUpdatedAt:x,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!m,isLoadingError:w&&!C,isPaused:u.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:w&&C,isStale:ig(t,n),refetch:this.refetch,promise:L(this,nr),isEnabled:Xt(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const _=E.data!==void 0,j=E.status==="error"&&!_,D=T=>{j?T.reject(E.error):_&&T.resolve(E.data)},O=()=>{const T=ne(this,nr,E.promise=rh());D(T)},N=L(this,nr);switch(N.status){case"pending":t.queryHash===r.queryHash&&D(N);break;case"fulfilled":(j||E.data!==N.value)&&O();break;case"rejected":(!j||E.error!==N.reason)&&O();break}}return E}updateResult(){const t=L(this,Ct),n=this.createResult(L(this,Se),this.options);if(ne(this,Bs,L(this,Se).state),ne(this,ti,this.options),L(this,Bs).data!==void 0&&ne(this,ri,L(this,Se)),Ml(n,t))return;ne(this,Ct,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!L(this,si).size)return!0;const i=new Set(o??L(this,si));return this.options.throwOnError&&i.add("error"),Object.keys(L(this,Ct)).some(l=>{const a=l;return L(this,Ct)[a]!==t[a]&&i.has(a)})};ge(this,Pe,aw).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ge(this,Pe,ch).call(this)}},Ot=new WeakMap,Se=new WeakMap,aa=new WeakMap,Ct=new WeakMap,Bs=new WeakMap,ti=new WeakMap,nr=new WeakMap,Vr=new WeakMap,ca=new WeakMap,ni=new WeakMap,ri=new WeakMap,Hs=new WeakMap,Vs=new WeakMap,Wr=new WeakMap,si=new WeakMap,Pe=new WeakSet,cl=function(t){ge(this,Pe,fh).call(this);let n=L(this,Se).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(wt)),n},ih=function(){ge(this,Pe,uh).call(this);const t=Jr(this.options.staleTime,L(this,Se));if(Il.isServer()||L(this,Ct).isStale||!eh(t))return;const r=ew(L(this,Ct).dataUpdatedAt,t)+1;ne(this,Hs,Ts.setTimeout(()=>{L(this,Ct).isStale||this.updateResult()},r))},lh=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,Se)):this.options.refetchInterval)??!1},ah=function(t){ge(this,Pe,dh).call(this),ne(this,Wr,t),!(Il.isServer()||Xt(this.options.enabled,L(this,Se))===!1||!eh(L(this,Wr))||L(this,Wr)===0)&&ne(this,Vs,Ts.setInterval(()=>{(this.options.refetchIntervalInBackground||tg.isFocused())&&ge(this,Pe,cl).call(this)},L(this,Wr)))},ch=function(){ge(this,Pe,ih).call(this),ge(this,Pe,ah).call(this,ge(this,Pe,lh).call(this))},uh=function(){L(this,Hs)!==void 0&&(Ts.clearTimeout(L(this,Hs)),ne(this,Hs,void 0))},dh=function(){L(this,Vs)!==void 0&&(Ts.clearInterval(L(this,Vs)),ne(this,Vs,void 0))},fh=function(){const t=L(this,Ot).getQueryCache().build(L(this,Ot),this.options);if(t===L(this,Se))return;const n=L(this,Se);ne(this,Se,t),ne(this,aa,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},aw=function(t){qe.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(L(this,Ct))}),L(this,Ot).getQueryCache().notify({query:L(this,Se),type:"observerResultsUpdated"})})},Ox);function WR(e,t){return Xt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Xt(t.retryOnMount,e)===!1)}function h0(e,t){return WR(e,t)||e.state.data!==void 0&&hh(e,t,t.refetchOnMount)}function hh(e,t,n){if(Xt(t.enabled,e)!==!1&&Jr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ig(e,t)}return!1}function p0(e,t,n,r){return(e!==t||Xt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ig(e,n)}function ig(e,t){return Xt(t.enabled,e)!==!1&&e.isStaleByTime(Jr(t.staleTime,e))}function UR(e,t){return!Ml(e.getCurrentResult(),t)}var KR=class extends Ju{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",d=s&&a==="forward",u=i&&a==="backward",f=s&&a==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:BR(t,n.data),hasPreviousPage:HR(t,n.data),isFetchNextPageError:c,isFetchingNextPage:d,isFetchPreviousPageError:u,isFetchingPreviousPage:f,isRefetchError:l&&!c&&!u,isRefetching:o&&!d&&!f}}},ua,Fn,xt,Ws,$n,Or,Ax,qR=(Ax=class extends sw{constructor(t){super();oe(this,$n);oe(this,ua);oe(this,Fn);oe(this,xt);oe(this,Ws);ne(this,ua,t.client),this.mutationId=t.mutationId,ne(this,xt,t.mutationCache),ne(this,Fn,[]),this.state=t.state||cw(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){L(this,Fn).includes(t)||(L(this,Fn).push(t),this.clearGcTimeout(),L(this,xt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ne(this,Fn,L(this,Fn).filter(n=>n!==t)),this.scheduleGc(),L(this,xt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){L(this,Fn).length||(this.state.status==="pending"?this.scheduleGc():L(this,xt).remove(this))}continue(){var t;return((t=L(this,Ws))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,l,a,c,d,u,f,h,g,x,b,p,y,m,w,k,C,R;const n=()=>{ge(this,$n,Or).call(this,{type:"continue"})},r={client:L(this,ua),meta:this.options.meta,mutationKey:this.options.mutationKey};ne(this,Ws,rw({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(E,M)=>{ge(this,$n,Or).call(this,{type:"failed",failureCount:E,error:M})},onPause:()=>{ge(this,$n,Or).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>L(this,xt).canRun(this)}));const s=this.state.status==="pending",o=!L(this,Ws).canStart();try{if(s)n();else{ge(this,$n,Or).call(this,{type:"pending",variables:t,isPaused:o}),L(this,xt).config.onMutate&&await L(this,xt).config.onMutate(t,this,r);const M=await((l=(i=this.options).onMutate)==null?void 0:l.call(i,t,r));M!==this.state.context&&ge(this,$n,Or).call(this,{type:"pending",context:M,variables:t,isPaused:o})}const E=await L(this,Ws).start();return await((c=(a=L(this,xt).config).onSuccess)==null?void 0:c.call(a,E,t,this.state.context,this,r)),await((u=(d=this.options).onSuccess)==null?void 0:u.call(d,E,t,this.state.context,r)),await((h=(f=L(this,xt).config).onSettled)==null?void 0:h.call(f,E,null,this.state.variables,this.state.context,this,r)),await((x=(g=this.options).onSettled)==null?void 0:x.call(g,E,null,t,this.state.context,r)),ge(this,$n,Or).call(this,{type:"success",data:E}),E}catch(E){try{await((p=(b=L(this,xt).config).onError)==null?void 0:p.call(b,E,t,this.state.context,this,r))}catch(M){Promise.reject(M)}try{await((m=(y=this.options).onError)==null?void 0:m.call(y,E,t,this.state.context,r))}catch(M){Promise.reject(M)}try{await((k=(w=L(this,xt).config).onSettled)==null?void 0:k.call(w,void 0,E,this.state.variables,this.state.context,this,r))}catch(M){Promise.reject(M)}try{await((R=(C=this.options).onSettled)==null?void 0:R.call(C,void 0,E,t,this.state.context,r))}catch(M){Promise.reject(M)}throw ge(this,$n,Or).call(this,{type:"error",error:E}),E}finally{L(this,xt).runNext(this)}}},ua=new WeakMap,Fn=new WeakMap,xt=new WeakMap,Ws=new WeakMap,$n=new WeakSet,Or=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),qe.batch(()=>{L(this,Fn).forEach(r=>{r.onMutationUpdate(t)}),L(this,xt).notify({mutation:this,type:"updated",action:t})})},Ax);function cw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var rr,wn,da,jx,YR=(jx=class extends fo{constructor(t={}){super();oe(this,rr);oe(this,wn);oe(this,da);this.config=t,ne(this,rr,new Set),ne(this,wn,new Map),ne(this,da,0)}build(t,n,r){const s=new qR({client:t,mutationCache:this,mutationId:++Wa(this,da)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){L(this,rr).add(t);const n=Ka(t);if(typeof n=="string"){const r=L(this,wn).get(n);r?r.push(t):L(this,wn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(L(this,rr).delete(t)){const n=Ka(t);if(typeof n=="string"){const r=L(this,wn).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&L(this,wn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ka(t);if(typeof n=="string"){const r=L(this,wn).get(n),s=r==null?void 0:r.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=Ka(t);if(typeof n=="string"){const s=(r=L(this,wn).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){qe.batch(()=>{L(this,rr).forEach(t=>{this.notify({type:"removed",mutation:t})}),L(this,rr).clear(),L(this,wn).clear()})}getAll(){return Array.from(L(this,rr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>a0(n,r))}findAll(t={}){return this.getAll().filter(n=>a0(t,n))}notify(t){qe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return qe.batch(()=>Promise.all(t.map(n=>n.continue().catch(wt))))}},rr=new WeakMap,wn=new WeakMap,da=new WeakMap,jx);function Ka(e){var t;return(t=e.options.scope)==null?void 0:t.id}var sr,Ur,At,or,pr,Mc,ph,zx,QR=(zx=class extends fo{constructor(n,r){super();oe(this,pr);oe(this,sr);oe(this,Ur);oe(this,At);oe(this,or);ne(this,sr,n),this.setOptions(r),this.bindMethods(),ge(this,pr,Mc).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=L(this,sr).defaultMutationOptions(n),Ml(this.options,r)||L(this,sr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:L(this,At),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Gs(r.mutationKey)!==Gs(this.options.mutationKey)?this.reset():((s=L(this,At))==null?void 0:s.state.status)==="pending"&&L(this,At).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=L(this,At))==null||n.removeObserver(this)}onMutationUpdate(n){ge(this,pr,Mc).call(this),ge(this,pr,ph).call(this,n)}getCurrentResult(){return L(this,Ur)}reset(){var n;(n=L(this,At))==null||n.removeObserver(this),ne(this,At,void 0),ge(this,pr,Mc).call(this),ge(this,pr,ph).call(this)}mutate(n,r){var s;return ne(this,or,r),(s=L(this,At))==null||s.removeObserver(this),ne(this,At,L(this,sr).getMutationCache().build(L(this,sr),this.options)),L(this,At).addObserver(this),L(this,At).execute(n)}},sr=new WeakMap,Ur=new WeakMap,At=new WeakMap,or=new WeakMap,pr=new WeakSet,Mc=function(){var r;const n=((r=L(this,At))==null?void 0:r.state)??cw();ne(this,Ur,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ph=function(n){qe.batch(()=>{var r,s,o,i,l,a,c,d;if(L(this,or)&&this.hasListeners()){const u=L(this,Ur).variables,f=L(this,Ur).context,h={client:L(this,sr),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=L(this,or)).onSuccess)==null||s.call(r,n.data,u,f,h)}catch(g){Promise.reject(g)}try{(i=(o=L(this,or)).onSettled)==null||i.call(o,n.data,null,u,f,h)}catch(g){Promise.reject(g)}}else if((n==null?void 0:n.type)==="error"){try{(a=(l=L(this,or)).onError)==null||a.call(l,n.error,u,f,h)}catch(g){Promise.reject(g)}try{(d=(c=L(this,or)).onSettled)==null||d.call(c,void 0,n.error,u,f,h)}catch(g){Promise.reject(g)}}}this.listeners.forEach(u=>{u(L(this,Ur))})})},zx);function g0(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function XR(e,t,n){const r=e.slice(0);return r[t]=n,r}var oi,jt,ii,Us,qt,Kr,fa,ha,pa,ga,it,gh,mh,uw,yh,vh,xh,Lx,GR=(Lx=class extends fo{constructor(t,n,r){super();oe(this,it);oe(this,oi);oe(this,jt);oe(this,ii);oe(this,Us);oe(this,qt);oe(this,Kr);oe(this,fa);oe(this,ha);oe(this,pa);oe(this,ga,[]);ne(this,oi,t),ne(this,Us,r),ne(this,ii,[]),ne(this,qt,[]),ne(this,jt,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&L(this,qt).forEach(t=>{t.subscribe(n=>{ge(this,it,vh).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,L(this,qt).forEach(t=>{t.destroy()})}setQueries(t,n){ne(this,ii,t),ne(this,Us,n),qe.batch(()=>{const r=L(this,qt),s=ge(this,it,yh).call(this,L(this,ii));s.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions));const o=s.map(u=>u.observer),i=o.map(u=>u.getCurrentResult()),l=r.length!==o.length,a=o.some((u,f)=>u!==r[f]),c=l||a,d=c?!0:i.some((u,f)=>{const h=L(this,jt)[f];return!h||!Ml(u,h)});!c&&!d||(c&&(ne(this,ga,s),ne(this,qt,o)),ne(this,jt,i),this.hasListeners()&&(c&&(g0(r,o).forEach(u=>{u.destroy()}),g0(o,r).forEach(u=>{u.subscribe(f=>{ge(this,it,vh).call(this,u,f)})})),ge(this,it,xh).call(this)))})}getCurrentResult(){return L(this,jt)}getQueries(){return L(this,qt).map(t=>t.getCurrentQuery())}getObservers(){return L(this,qt)}getOptimisticResult(t,n){const r=ge(this,it,yh).call(this,t),s=r.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions)),o=r.map(i=>i.defaultedQueryOptions.queryHash);return[s,i=>ge(this,it,mh).call(this,i??s,n,o),()=>ge(this,it,gh).call(this,s,r)]}},oi=new WeakMap,jt=new WeakMap,ii=new WeakMap,Us=new WeakMap,qt=new WeakMap,Kr=new WeakMap,fa=new WeakMap,ha=new WeakMap,pa=new WeakMap,ga=new WeakMap,it=new WeakSet,gh=function(t,n){return n.map((r,s)=>{const o=t[s];return r.defaultedQueryOptions.notifyOnChangeProps?o:r.observer.trackResult(o,i=>{n.forEach(l=>{l.observer.trackProp(i)})})})},mh=function(t,n,r){if(n){const s=L(this,pa),o=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((i,l)=>i!==s[l]));return(!L(this,Kr)||L(this,jt)!==L(this,ha)||o||n!==L(this,fa))&&(ne(this,fa,n),ne(this,ha,L(this,jt)),r!==void 0&&ne(this,pa,r),ne(this,Kr,rg(L(this,Kr),n(t)))),L(this,Kr)}return t},uw=function(){var t;return((t=L(this,Us))==null?void 0:t.combine)!==void 0&&L(this,qt).some((n,r)=>{var s;return n.options.suspense&&((s=L(this,jt)[r])==null?void 0:s.data)===void 0})},yh=function(t){const n=new Map;L(this,qt).forEach(s=>{const o=s.options.queryHash;if(!o)return;const i=n.get(o);i?i.push(s):n.set(o,[s])});const r=[];return t.forEach(s=>{var a;const o=L(this,oi).defaultQueryOptions(s),l=((a=n.get(o.queryHash))==null?void 0:a.shift())??new Ju(L(this,oi),o);r.push({defaultedQueryOptions:o,observer:l})}),r},vh=function(t,n){const r=L(this,qt).indexOf(t);r!==-1&&(ne(this,jt,XR(L(this,jt),r,n)),ge(this,it,xh).call(this))},xh=function(){var t;if(this.hasListeners()){const n=ge(this,it,gh).call(this,L(this,jt),L(this,ga)),r=ge(this,it,uw).call(this),s=L(this,Kr),o=r?s:ge(this,it,mh).call(this,n,(t=L(this,Us))==null?void 0:t.combine);(r||s!==o)&&qe.batch(()=>{this.listeners.forEach(i=>{i(L(this,jt))})})}},Lx),Bn,Dx,ZR=(Dx=class extends fo{constructor(t={}){super();oe(this,Bn);this.config=t,ne(this,Bn,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??ng(s,n);let i=this.get(o);return i||(i=new VR({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(i)),i}add(t){L(this,Bn).has(t.queryHash)||(L(this,Bn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=L(this,Bn).get(t.queryHash);n&&(t.destroy(),n===t&&L(this,Bn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){qe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return L(this,Bn).get(t)}getAll(){return[...L(this,Bn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>l0(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>l0(t,r)):n}notify(t){qe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){qe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){qe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Bn=new WeakMap,Dx),Ue,qr,Yr,li,ai,Qr,ci,ui,Fx,JR=(Fx=class{constructor(e={}){oe(this,Ue);oe(this,qr);oe(this,Yr);oe(this,li);oe(this,ai);oe(this,Qr);oe(this,ci);oe(this,ui);ne(this,Ue,e.queryCache||new ZR),ne(this,qr,e.mutationCache||new YR),ne(this,Yr,e.defaultOptions||{}),ne(this,li,new Map),ne(this,ai,new Map),ne(this,Qr,0)}mount(){Wa(this,Qr)._++,L(this,Qr)===1&&(ne(this,ci,tg.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Ue).onFocus())})),ne(this,ui,eu.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Ue).onOnline())})))}unmount(){var e,t;Wa(this,Qr)._--,L(this,Qr)===0&&((e=L(this,ci))==null||e.call(this),ne(this,ci,void 0),(t=L(this,ui))==null||t.call(this),ne(this,ui,void 0))}isFetching(e){return L(this,Ue).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return L(this,qr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=L(this,Ue).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=L(this,Ue).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Jr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return L(this,Ue).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=L(this,Ue).get(r.queryHash),o=s==null?void 0:s.state.data,i=MR(t,o);if(i!==void 0)return L(this,Ue).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return qe.batch(()=>L(this,Ue).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=L(this,Ue).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=L(this,Ue);qe.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=L(this,Ue);return qe.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=qe.batch(()=>L(this,Ue).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(wt).catch(wt)}invalidateQueries(e,t={}){return qe.batch(()=>(L(this,Ue).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=qe.batch(()=>L(this,Ue).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(wt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(wt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=L(this,Ue).build(this,t);return n.isStaleByTime(Jr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(wt).catch(wt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(wt).catch(wt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return eu.isOnline()?L(this,qr).resumePausedMutations():Promise.resolve()}getQueryCache(){return L(this,Ue)}getMutationCache(){return L(this,qr)}getDefaultOptions(){return L(this,Yr)}setDefaultOptions(e){ne(this,Yr,e)}setQueryDefaults(e,t){L(this,li).set(Gs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...L(this,li).values()],n={};return t.forEach(r=>{di(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){L(this,ai).set(Gs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...L(this,ai).values()],n={};return t.forEach(r=>{di(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...L(this,Yr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ng(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===sg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...L(this,Yr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){L(this,Ue).clear(),L(this,qr).clear()}},Ue=new WeakMap,qr=new WeakMap,Yr=new WeakMap,li=new WeakMap,ai=new WeakMap,Qr=new WeakMap,ci=new WeakMap,ui=new WeakMap,Fx),dw=S.createContext(void 0),Oi=e=>{const t=S.useContext(dw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},eN=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(dw.Provider,{value:e,children:t})),fw=S.createContext(!1),hw=()=>S.useContext(fw);fw.Provider;function tN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var nN=S.createContext(tN()),pw=()=>S.useContext(nN),gw=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?og(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},mw=e=>{S.useEffect(()=>{e.clearReset()},[e])},yw=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||og(n,[e.error,r])),vw=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))}},rN=(e,t)=>e.isLoading&&e.isFetching&&!t,wh=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,bh=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function xw({queries:e,...t},n){const r=Oi(),s=hw(),o=pw(),i=S.useMemo(()=>e.map(x=>{const b=r.defaultQueryOptions(x);return b._optimisticResults=s?"isRestoring":"optimistic",b}),[e,r,s]);i.forEach(x=>{vw(x);const b=r.getQueryCache().get(x.queryHash);gw(x,o,b)}),mw(o);const[l]=S.useState(()=>new GR(r,i,t)),[a,c,d]=l.getOptimisticResult(i,t.combine),u=!s&&t.subscribed!==!1;S.useSyncExternalStore(S.useCallback(x=>u?l.subscribe(qe.batchCalls(x)):wt,[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),S.useEffect(()=>{l.setQueries(i,t)},[i,t,l]);const h=a.some((x,b)=>wh(i[b],x))?a.flatMap((x,b)=>{const p=i[b];if(p&&wh(p,x)){const y=new Ju(r,p);return bh(p,y,o)}return[]}):[];if(h.length>0)throw Promise.all(h);const g=a.find((x,b)=>{const p=i[b];return p&&yw({result:x,errorResetBoundary:o,throwOnError:p.throwOnError,query:r.getQueryCache().get(p.queryHash),suspense:p.suspense})});if(g!=null&&g.error)throw g.error;return c(d())}function ww(e,t,n){var h,g,x,b;const r=hw(),s=pw(),o=Oi(),i=o.defaultQueryOptions(e);(g=(h=o.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||g.call(h,i);const l=o.getQueryCache().get(i.queryHash),a=e.subscribed!==!1;i._optimisticResults=r?"isRestoring":a?"optimistic":void 0,vw(i),gw(i,s,l),mw(s);const c=!o.getQueryCache().get(i.queryHash),[d]=S.useState(()=>new t(o,i)),u=d.getOptimisticResult(i),f=!r&&a;if(S.useSyncExternalStore(S.useCallback(p=>{const y=f?d.subscribe(qe.batchCalls(p)):wt;return d.updateResult(),y},[d,f]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),S.useEffect(()=>{d.setOptions(i)},[i,d]),wh(i,u))throw bh(i,d,s);if(yw({result:u,errorResetBoundary:s,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw u.error;if((b=(x=o.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||b.call(x,i,u),i.experimental_prefetchInRender&&!Il.isServer()&&rN(u,r)){const p=c?bh(i,d,s):l==null?void 0:l.promise;p==null||p.catch(wt).finally(()=>{d.updateResult()})}return i.notifyOnChangeProps?u:d.trackResult(u)}function Un(e,t){return ww(e,Ju)}function So(e,t){const n=Oi(),[r]=S.useState(()=>new QR(n,e));S.useEffect(()=>{r.setOptions(e)},[r,e]);const s=S.useSyncExternalStore(S.useCallback(i=>r.subscribe(qe.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=S.useCallback((i,l)=>{r.mutate(i,l).catch(wt)},[r]);if(s.error&&og(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}function sN(e,t){return ww(e,KR)}var bw={exports:{}},sn={},Sw={exports:{}},Ew={};/**
|
|
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(P,I){var A=P.length;P.push(I);e:for(;0<A;){var B=A-1>>>1,$=P[B];if(0<s($,I))P[B]=I,P[A]=$,A=B;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var I=P[0],A=P.pop();if(A!==I){P[0]=A;e:for(var B=0,$=P.length,U=$>>>1;B<U;){var q=2*(B+1)-1,K=P[q],X=q+1,G=P[X];if(0>s(K,A))X<$&&0>s(G,K)?(P[B]=G,P[X]=A,B=X):(P[B]=K,P[q]=A,B=q);else if(X<$&&0>s(G,A))P[B]=G,P[X]=A,B=X;else break e}}return I}function s(P,I){var A=P.sortIndex-I.sortIndex;return A!==0?A:P.id-I.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=[],d=1,u=null,f=3,h=!1,g=!1,x=!1,b=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(P){for(var I=n(c);I!==null;){if(I.callback===null)r(c);else if(I.startTime<=P)r(c),I.sortIndex=I.expirationTime,t(a,I);else break;I=n(c)}}function w(P){if(x=!1,m(P),!g)if(n(a)!==null)g=!0,z(k);else{var I=n(c);I!==null&&F(w,I.startTime-P)}}function k(P,I){g=!1,x&&(x=!1,p(E),E=-1),h=!0;var A=f;try{for(m(I),u=n(a);u!==null&&(!(u.expirationTime>I)||P&&!j());){var B=u.callback;if(typeof B=="function"){u.callback=null,f=u.priorityLevel;var $=B(u.expirationTime<=I);I=e.unstable_now(),typeof $=="function"?u.callback=$:u===n(a)&&r(a),m(I)}else r(a);u=n(a)}if(u!==null)var U=!0;else{var q=n(c);q!==null&&F(w,q.startTime-I),U=!1}return U}finally{u=null,f=A,h=!1}}var C=!1,R=null,E=-1,M=5,_=-1;function j(){return!(e.unstable_now()-_<M)}function D(){if(R!==null){var P=e.unstable_now();_=P;var I=!0;try{I=R(!0,P)}finally{I?O():(C=!1,R=null)}}else C=!1}var O;if(typeof y=="function")O=function(){y(D)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,T=N.port2;N.port1.onmessage=D,O=function(){T.postMessage(null)}}else O=function(){b(D,0)};function z(P){R=P,C||(C=!0,O())}function F(P,I){E=b(function(){P(e.unstable_now())},I)}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(P){P.callback=null},e.unstable_continueExecution=function(){g||h||(g=!0,z(k))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(P){switch(f){case 1:case 2:case 3:var I=3;break;default:I=f}var A=f;f=I;try{return P()}finally{f=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,I){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var A=f;f=P;try{return I()}finally{f=A}},e.unstable_scheduleCallback=function(P,I,A){var B=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?B+A:B):A=B,P){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=A+$,P={id:d++,callback:I,priorityLevel:P,startTime:A,expirationTime:$,sortIndex:-1},A>B?(P.sortIndex=A,t(c,P),n(a)===null&&P===n(c)&&(x?(p(E),E=-1):x=!0,F(w,A-B))):(P.sortIndex=$,t(a,P),g||h||(g=!0,z(k))),P},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(P){var I=f;return function(){var A=f;f=I;try{return P.apply(this,arguments)}finally{f=A}}}})(Ew);Sw.exports=Ew;var oN=Sw.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 iN=S,tn=oN;function ee(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var kw=new Set,_l={};function ho(e,t){fi(e,t),fi(e+"Capture",t)}function fi(e,t){for(_l[e]=t,e=0;e<t.length;e++)kw.add(t[e])}var gr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sh=Object.prototype.hasOwnProperty,lN=/^[: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]*$/,m0={},y0={};function aN(e){return Sh.call(y0,e)?!0:Sh.call(m0,e)?!1:lN.test(e)?y0[e]=!0:(m0[e]=!0,!1)}function cN(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 uN(e,t,n,r){if(t===null||typeof t>"u"||cN(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 Mt(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 gt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){gt[e]=new Mt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];gt[t]=new Mt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){gt[e]=new Mt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){gt[e]=new Mt(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){gt[e]=new Mt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){gt[e]=new Mt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){gt[e]=new Mt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){gt[e]=new Mt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){gt[e]=new Mt(e,5,!1,e.toLowerCase(),null,!1,!1)});var lg=/[\-:]([a-z])/g;function ag(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(lg,ag);gt[t]=new Mt(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(lg,ag);gt[t]=new Mt(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(lg,ag);gt[t]=new Mt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){gt[e]=new Mt(e,1,!1,e.toLowerCase(),null,!1,!1)});gt.xlinkHref=new Mt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){gt[e]=new Mt(e,1,!1,e.toLowerCase(),null,!0,!0)});function cg(e,t,n,r){var s=gt.hasOwnProperty(t)?gt[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(uN(t,n,s,r)&&(n=null),r||s===null?aN(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 Er=iN.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,qa=Symbol.for("react.element"),Eo=Symbol.for("react.portal"),ko=Symbol.for("react.fragment"),ug=Symbol.for("react.strict_mode"),Eh=Symbol.for("react.profiler"),Cw=Symbol.for("react.provider"),Rw=Symbol.for("react.context"),dg=Symbol.for("react.forward_ref"),kh=Symbol.for("react.suspense"),Ch=Symbol.for("react.suspense_list"),fg=Symbol.for("react.memo"),Ar=Symbol.for("react.lazy"),Nw=Symbol.for("react.offscreen"),v0=Symbol.iterator;function Qi(e){return e===null||typeof e!="object"?null:(e=v0&&e[v0]||e["@@iterator"],typeof e=="function"?e:null)}var Ve=Object.assign,ef;function ul(e){if(ef===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ef=t&&t[1]||""}return`
|
|
34
|
+
`+ef+e}var tf=!1;function nf(e,t){if(!e||tf)return"";tf=!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{tf=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ul(e):""}function dN(e){switch(e.tag){case 5:return ul(e.type);case 16:return ul("Lazy");case 13:return ul("Suspense");case 19:return ul("SuspenseList");case 0:case 2:case 15:return e=nf(e.type,!1),e;case 11:return e=nf(e.type.render,!1),e;case 1:return e=nf(e.type,!0),e;default:return""}}function Rh(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 ko:return"Fragment";case Eo:return"Portal";case Eh:return"Profiler";case ug:return"StrictMode";case kh:return"Suspense";case Ch:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Rw:return(e.displayName||"Context")+".Consumer";case Cw:return(e._context.displayName||"Context")+".Provider";case dg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case fg:return t=e.displayName||null,t!==null?t:Rh(e.type)||"Memo";case Ar:t=e._payload,e=e._init;try{return Rh(e(t))}catch{}}return null}function fN(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 Rh(t);case 8:return t===ug?"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 us(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Pw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hN(e){var t=Pw(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 Ya(e){e._valueTracker||(e._valueTracker=hN(e))}function Tw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Pw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function tu(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 Nh(e,t){var n=t.checked;return Ve({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function x0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=us(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 Mw(e,t){t=t.checked,t!=null&&cg(e,"checked",t,!1)}function Ph(e,t){Mw(e,t);var n=us(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")?Th(e,t.type,n):t.hasOwnProperty("defaultValue")&&Th(e,t.type,us(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function w0(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 Th(e,t,n){(t!=="number"||tu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var dl=Array.isArray;function Lo(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=""+us(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 Mh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ee(91));return Ve({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function b0(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ee(92));if(dl(n)){if(1<n.length)throw Error(ee(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:us(n)}}function Iw(e,t){var n=us(t.value),r=us(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 S0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function _w(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 Ih(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?_w(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Qa,Ow=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(Qa=Qa||document.createElement("div"),Qa.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Qa.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},pN=["Webkit","ms","Moz","O"];Object.keys(ml).forEach(function(e){pN.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ml[t]=ml[e]})});function Aw(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 jw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Aw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var gN=Ve({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 _h(e,t){if(t){if(gN[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ee(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ee(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ee(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ee(62))}}function Oh(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 Ah=null;function hg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var jh=null,Do=null,Fo=null;function E0(e){if(e=xa(e)){if(typeof jh!="function")throw Error(ee(280));var t=e.stateNode;t&&(t=sd(t),jh(e.stateNode,e.type,t))}}function zw(e){Do?Fo?Fo.push(e):Fo=[e]:Do=e}function Lw(){if(Do){var e=Do,t=Fo;if(Fo=Do=null,E0(e),t)for(e=0;e<t.length;e++)E0(t[e])}}function Dw(e,t){return e(t)}function Fw(){}var rf=!1;function $w(e,t,n){if(rf)return e(t,n);rf=!0;try{return Dw(e,t,n)}finally{rf=!1,(Do!==null||Fo!==null)&&(Fw(),Lw())}}function Al(e,t){var n=e.stateNode;if(n===null)return null;var r=sd(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(ee(231,t,typeof n));return n}var zh=!1;if(gr)try{var Xi={};Object.defineProperty(Xi,"passive",{get:function(){zh=!0}}),window.addEventListener("test",Xi,Xi),window.removeEventListener("test",Xi,Xi)}catch{zh=!1}function mN(e,t,n,r,s,o,i,l,a){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var yl=!1,nu=null,ru=!1,Lh=null,yN={onError:function(e){yl=!0,nu=e}};function vN(e,t,n,r,s,o,i,l,a){yl=!1,nu=null,mN.apply(yN,arguments)}function xN(e,t,n,r,s,o,i,l,a){if(vN.apply(this,arguments),yl){if(yl){var c=nu;yl=!1,nu=null}else throw Error(ee(198));ru||(ru=!0,Lh=c)}}function po(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 Bw(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 k0(e){if(po(e)!==e)throw Error(ee(188))}function wN(e){var t=e.alternate;if(!t){if(t=po(e),t===null)throw Error(ee(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 k0(s),e;if(o===r)return k0(s),t;o=o.sibling}throw Error(ee(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(ee(189))}}if(n.alternate!==r)throw Error(ee(190))}if(n.tag!==3)throw Error(ee(188));return n.stateNode.current===n?e:t}function Hw(e){return e=wN(e),e!==null?Vw(e):null}function Vw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Vw(e);if(t!==null)return t;e=e.sibling}return null}var Ww=tn.unstable_scheduleCallback,C0=tn.unstable_cancelCallback,bN=tn.unstable_shouldYield,SN=tn.unstable_requestPaint,Qe=tn.unstable_now,EN=tn.unstable_getCurrentPriorityLevel,pg=tn.unstable_ImmediatePriority,Uw=tn.unstable_UserBlockingPriority,su=tn.unstable_NormalPriority,kN=tn.unstable_LowPriority,Kw=tn.unstable_IdlePriority,ed=null,Kn=null;function CN(e){if(Kn&&typeof Kn.onCommitFiberRoot=="function")try{Kn.onCommitFiberRoot(ed,e,void 0,(e.current.flags&128)===128)}catch{}}var Pn=Math.clz32?Math.clz32:PN,RN=Math.log,NN=Math.LN2;function PN(e){return e>>>=0,e===0?32:31-(RN(e)/NN|0)|0}var Xa=64,Ga=4194304;function fl(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 ou(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=fl(l):(o&=i,o!==0&&(r=fl(o)))}else i=n&~s,i!==0?r=fl(i):o!==0&&(r=fl(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-Pn(t),s=1<<n,r|=e[n],t&=~s;return r}function TN(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 MN(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-Pn(o),l=1<<i,a=s[i];a===-1?(!(l&n)||l&r)&&(s[i]=TN(l,t)):a<=t&&(e.expiredLanes|=l),o&=~l}}function Dh(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function qw(){var e=Xa;return Xa<<=1,!(Xa&4194240)&&(Xa=64),e}function sf(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ya(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Pn(t),e[t]=n}function IN(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-Pn(n),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function gg(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Pn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var Me=0;function Yw(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Qw,mg,Xw,Gw,Zw,Fh=!1,Za=[],es=null,ts=null,ns=null,jl=new Map,zl=new Map,Lr=[],_N="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 R0(e,t){switch(e){case"focusin":case"focusout":es=null;break;case"dragenter":case"dragleave":ts=null;break;case"mouseover":case"mouseout":ns=null;break;case"pointerover":case"pointerout":jl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":zl.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=xa(t),t!==null&&mg(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function ON(e,t,n,r,s){switch(t){case"focusin":return es=Gi(es,e,t,n,r,s),!0;case"dragenter":return ts=Gi(ts,e,t,n,r,s),!0;case"mouseover":return ns=Gi(ns,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return jl.set(o,Gi(jl.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,zl.set(o,Gi(zl.get(o)||null,e,t,n,r,s)),!0}return!1}function Jw(e){var t=Ms(e.target);if(t!==null){var n=po(t);if(n!==null){if(t=n.tag,t===13){if(t=Bw(n),t!==null){e.blockedOn=t,Zw(e.priority,function(){Xw(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 Ic(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=$h(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ah=r,n.target.dispatchEvent(r),Ah=null}else return t=xa(n),t!==null&&mg(t),e.blockedOn=n,!1;t.shift()}return!0}function N0(e,t,n){Ic(e)&&n.delete(t)}function AN(){Fh=!1,es!==null&&Ic(es)&&(es=null),ts!==null&&Ic(ts)&&(ts=null),ns!==null&&Ic(ns)&&(ns=null),jl.forEach(N0),zl.forEach(N0)}function Zi(e,t){e.blockedOn===t&&(e.blockedOn=null,Fh||(Fh=!0,tn.unstable_scheduleCallback(tn.unstable_NormalPriority,AN)))}function Ll(e){function t(s){return Zi(s,e)}if(0<Za.length){Zi(Za[0],e);for(var n=1;n<Za.length;n++){var r=Za[n];r.blockedOn===e&&(r.blockedOn=null)}}for(es!==null&&Zi(es,e),ts!==null&&Zi(ts,e),ns!==null&&Zi(ns,e),jl.forEach(t),zl.forEach(t),n=0;n<Lr.length;n++)r=Lr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Lr.length&&(n=Lr[0],n.blockedOn===null);)Jw(n),n.blockedOn===null&&Lr.shift()}var $o=Er.ReactCurrentBatchConfig,iu=!0;function jN(e,t,n,r){var s=Me,o=$o.transition;$o.transition=null;try{Me=1,yg(e,t,n,r)}finally{Me=s,$o.transition=o}}function zN(e,t,n,r){var s=Me,o=$o.transition;$o.transition=null;try{Me=4,yg(e,t,n,r)}finally{Me=s,$o.transition=o}}function yg(e,t,n,r){if(iu){var s=$h(e,t,n,r);if(s===null)gf(e,t,r,lu,n),R0(e,r);else if(ON(s,e,t,n,r))r.stopPropagation();else if(R0(e,r),t&4&&-1<_N.indexOf(e)){for(;s!==null;){var o=xa(s);if(o!==null&&Qw(o),o=$h(e,t,n,r),o===null&&gf(e,t,r,lu,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else gf(e,t,r,null,n)}}var lu=null;function $h(e,t,n,r){if(lu=null,e=hg(r),e=Ms(e),e!==null)if(t=po(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Bw(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 lu=e,null}function eb(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(EN()){case pg:return 1;case Uw:return 4;case su:case kN:return 16;case Kw:return 536870912;default:return 16}default:return 16}}var Xr=null,vg=null,_c=null;function tb(){if(_c)return _c;var e,t=vg,n=t.length,r,s="value"in Xr?Xr.value:Xr.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 _c=s.slice(e,1<r?1-r:void 0)}function Oc(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 Ja(){return!0}function P0(){return!1}function on(e){function t(n,r,s,o,i){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Ja:P0,this.isPropagationStopped=P0,this}return Ve(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=Ja)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ja)},persist:function(){},isPersistent:Ja}),t}var Ai={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xg=on(Ai),va=Ve({},Ai,{view:0,detail:0}),LN=on(va),of,lf,Ji,td=Ve({},va,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wg,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!==Ji&&(Ji&&e.type==="mousemove"?(of=e.screenX-Ji.screenX,lf=e.screenY-Ji.screenY):lf=of=0,Ji=e),of)},movementY:function(e){return"movementY"in e?e.movementY:lf}}),T0=on(td),DN=Ve({},td,{dataTransfer:0}),FN=on(DN),$N=Ve({},va,{relatedTarget:0}),af=on($N),BN=Ve({},Ai,{animationName:0,elapsedTime:0,pseudoElement:0}),HN=on(BN),VN=Ve({},Ai,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),WN=on(VN),UN=Ve({},Ai,{data:0}),M0=on(UN),KN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qN={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"},YN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function QN(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=YN[e])?!!t[e]:!1}function wg(){return QN}var XN=Ve({},va,{key:function(e){if(e.key){var t=KN[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Oc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qN[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wg,charCode:function(e){return e.type==="keypress"?Oc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Oc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),GN=on(XN),ZN=Ve({},td,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),I0=on(ZN),JN=Ve({},va,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wg}),eP=on(JN),tP=Ve({},Ai,{propertyName:0,elapsedTime:0,pseudoElement:0}),nP=on(tP),rP=Ve({},td,{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}),sP=on(rP),oP=[9,13,27,32],bg=gr&&"CompositionEvent"in window,vl=null;gr&&"documentMode"in document&&(vl=document.documentMode);var iP=gr&&"TextEvent"in window&&!vl,nb=gr&&(!bg||vl&&8<vl&&11>=vl),_0=" ",O0=!1;function rb(e,t){switch(e){case"keyup":return oP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sb(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Co=!1;function lP(e,t){switch(e){case"compositionend":return sb(t);case"keypress":return t.which!==32?null:(O0=!0,_0);case"textInput":return e=t.data,e===_0&&O0?null:e;default:return null}}function aP(e,t){if(Co)return e==="compositionend"||!bg&&rb(e,t)?(e=tb(),_c=vg=Xr=null,Co=!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 nb&&t.locale!=="ko"?null:t.data;default:return null}}var cP={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 A0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!cP[e.type]:t==="textarea"}function ob(e,t,n,r){zw(r),t=au(t,"onChange"),0<t.length&&(n=new xg("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var xl=null,Dl=null;function uP(e){mb(e,0)}function nd(e){var t=Po(e);if(Tw(t))return e}function dP(e,t){if(e==="change")return t}var ib=!1;if(gr){var cf;if(gr){var uf="oninput"in document;if(!uf){var j0=document.createElement("div");j0.setAttribute("oninput","return;"),uf=typeof j0.oninput=="function"}cf=uf}else cf=!1;ib=cf&&(!document.documentMode||9<document.documentMode)}function z0(){xl&&(xl.detachEvent("onpropertychange",lb),Dl=xl=null)}function lb(e){if(e.propertyName==="value"&&nd(Dl)){var t=[];ob(t,Dl,e,hg(e)),$w(uP,t)}}function fP(e,t,n){e==="focusin"?(z0(),xl=t,Dl=n,xl.attachEvent("onpropertychange",lb)):e==="focusout"&&z0()}function hP(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return nd(Dl)}function pP(e,t){if(e==="click")return nd(t)}function gP(e,t){if(e==="input"||e==="change")return nd(t)}function mP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Mn=typeof Object.is=="function"?Object.is:mP;function Fl(e,t){if(Mn(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(!Sh.call(t,s)||!Mn(e[s],t[s]))return!1}return!0}function L0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function D0(e,t){var n=L0(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=L0(n)}}function ab(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ab(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cb(){for(var e=window,t=tu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=tu(e.document)}return t}function Sg(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 yP(e){var t=cb(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ab(n.ownerDocument.documentElement,n)){if(r!==null&&Sg(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=D0(n,o);var i=D0(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 vP=gr&&"documentMode"in document&&11>=document.documentMode,Ro=null,Bh=null,wl=null,Hh=!1;function F0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hh||Ro==null||Ro!==tu(r)||(r=Ro,"selectionStart"in r&&Sg(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&&Fl(wl,r)||(wl=r,r=au(Bh,"onSelect"),0<r.length&&(t=new xg("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ro)))}function ec(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var No={animationend:ec("Animation","AnimationEnd"),animationiteration:ec("Animation","AnimationIteration"),animationstart:ec("Animation","AnimationStart"),transitionend:ec("Transition","TransitionEnd")},df={},ub={};gr&&(ub=document.createElement("div").style,"AnimationEvent"in window||(delete No.animationend.animation,delete No.animationiteration.animation,delete No.animationstart.animation),"TransitionEvent"in window||delete No.transitionend.transition);function rd(e){if(df[e])return df[e];if(!No[e])return e;var t=No[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ub)return df[e]=t[n];return e}var db=rd("animationend"),fb=rd("animationiteration"),hb=rd("animationstart"),pb=rd("transitionend"),gb=new Map,$0="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 gs(e,t){gb.set(e,t),ho(t,[e])}for(var ff=0;ff<$0.length;ff++){var hf=$0[ff],xP=hf.toLowerCase(),wP=hf[0].toUpperCase()+hf.slice(1);gs(xP,"on"+wP)}gs(db,"onAnimationEnd");gs(fb,"onAnimationIteration");gs(hb,"onAnimationStart");gs("dblclick","onDoubleClick");gs("focusin","onFocus");gs("focusout","onBlur");gs(pb,"onTransitionEnd");fi("onMouseEnter",["mouseout","mouseover"]);fi("onMouseLeave",["mouseout","mouseover"]);fi("onPointerEnter",["pointerout","pointerover"]);fi("onPointerLeave",["pointerout","pointerover"]);ho("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ho("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ho("onBeforeInput",["compositionend","keypress","textInput","paste"]);ho("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ho("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ho("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hl="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(" "),bP=new Set("cancel close invalid load scroll toggle".split(" ").concat(hl));function B0(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,xN(r,t,void 0,e),e.currentTarget=null}function mb(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;B0(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;B0(s,l,c),o=a}}}if(ru)throw e=Lh,ru=!1,Lh=null,e}function je(e,t){var n=t[qh];n===void 0&&(n=t[qh]=new Set);var r=e+"__bubble";n.has(r)||(yb(t,e,2,!1),n.add(r))}function pf(e,t,n){var r=0;t&&(r|=4),yb(n,e,r,t)}var tc="_reactListening"+Math.random().toString(36).slice(2);function $l(e){if(!e[tc]){e[tc]=!0,kw.forEach(function(n){n!=="selectionchange"&&(bP.has(n)||pf(n,!1,e),pf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[tc]||(t[tc]=!0,pf("selectionchange",!1,t))}}function yb(e,t,n,r){switch(eb(t)){case 1:var s=jN;break;case 4:s=zN;break;default:s=yg}n=s.bind(null,t,n,e),s=void 0,!zh||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 gf(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=Ms(l),i===null)return;if(a=i.tag,a===5||a===6){r=o=i;continue e}l=l.parentNode}}r=r.return}$w(function(){var c=o,d=hg(n),u=[];e:{var f=gb.get(e);if(f!==void 0){var h=xg,g=e;switch(e){case"keypress":if(Oc(n)===0)break e;case"keydown":case"keyup":h=GN;break;case"focusin":g="focus",h=af;break;case"focusout":g="blur",h=af;break;case"beforeblur":case"afterblur":h=af;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=T0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=FN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=eP;break;case db:case fb:case hb:h=HN;break;case pb:h=nP;break;case"scroll":h=LN;break;case"wheel":h=sP;break;case"copy":case"cut":case"paste":h=WN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=I0}var x=(t&4)!==0,b=!x&&e==="scroll",p=x?f!==null?f+"Capture":null:f;x=[];for(var y=c,m;y!==null;){m=y;var w=m.stateNode;if(m.tag===5&&w!==null&&(m=w,p!==null&&(w=Al(y,p),w!=null&&x.push(Bl(y,w,m)))),b)break;y=y.return}0<x.length&&(f=new h(f,g,null,n,d),u.push({event:f,listeners:x}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==Ah&&(g=n.relatedTarget||n.fromElement)&&(Ms(g)||g[mr]))break e;if((h||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,h?(g=n.relatedTarget||n.toElement,h=c,g=g?Ms(g):null,g!==null&&(b=po(g),g!==b||g.tag!==5&&g.tag!==6)&&(g=null)):(h=null,g=c),h!==g)){if(x=T0,w="onMouseLeave",p="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(x=I0,w="onPointerLeave",p="onPointerEnter",y="pointer"),b=h==null?f:Po(h),m=g==null?f:Po(g),f=new x(w,y+"leave",h,n,d),f.target=b,f.relatedTarget=m,w=null,Ms(d)===c&&(x=new x(p,y+"enter",g,n,d),x.target=m,x.relatedTarget=b,w=x),b=w,h&&g)t:{for(x=h,p=g,y=0,m=x;m;m=xo(m))y++;for(m=0,w=p;w;w=xo(w))m++;for(;0<y-m;)x=xo(x),y--;for(;0<m-y;)p=xo(p),m--;for(;y--;){if(x===p||p!==null&&x===p.alternate)break t;x=xo(x),p=xo(p)}x=null}else x=null;h!==null&&H0(u,f,h,x,!1),g!==null&&b!==null&&H0(u,b,g,x,!0)}}e:{if(f=c?Po(c):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var k=dP;else if(A0(f))if(ib)k=gP;else{k=hP;var C=fP}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=pP);if(k&&(k=k(e,c))){ob(u,k,n,d);break e}C&&C(e,f,c),e==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&Th(f,"number",f.value)}switch(C=c?Po(c):window,e){case"focusin":(A0(C)||C.contentEditable==="true")&&(Ro=C,Bh=c,wl=null);break;case"focusout":wl=Bh=Ro=null;break;case"mousedown":Hh=!0;break;case"contextmenu":case"mouseup":case"dragend":Hh=!1,F0(u,n,d);break;case"selectionchange":if(vP)break;case"keydown":case"keyup":F0(u,n,d)}var R;if(bg)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Co?rb(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(nb&&n.locale!=="ko"&&(Co||E!=="onCompositionStart"?E==="onCompositionEnd"&&Co&&(R=tb()):(Xr=d,vg="value"in Xr?Xr.value:Xr.textContent,Co=!0)),C=au(c,E),0<C.length&&(E=new M0(E,e,null,n,d),u.push({event:E,listeners:C}),R?E.data=R:(R=sb(n),R!==null&&(E.data=R)))),(R=iP?lP(e,n):aP(e,n))&&(c=au(c,"onBeforeInput"),0<c.length&&(d=new M0("onBeforeInput","beforeinput",null,n,d),u.push({event:d,listeners:c}),d.data=R))}mb(u,t)})}function Bl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function au(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=Al(e,n),o!=null&&r.unshift(Bl(e,o,s)),o=Al(e,t),o!=null&&r.push(Bl(e,o,s))),e=e.return}return r}function xo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function H0(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=Al(n,o),a!=null&&i.unshift(Bl(n,a,l))):s||(a=Al(n,o),a!=null&&i.push(Bl(n,a,l)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var SP=/\r\n?/g,EP=/\u0000|\uFFFD/g;function V0(e){return(typeof e=="string"?e:""+e).replace(SP,`
|
|
38
|
+
`).replace(EP,"")}function nc(e,t,n){if(t=V0(t),V0(e)!==t&&n)throw Error(ee(425))}function cu(){}var Vh=null,Wh=null;function Uh(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 Kh=typeof setTimeout=="function"?setTimeout:void 0,kP=typeof clearTimeout=="function"?clearTimeout:void 0,W0=typeof Promise=="function"?Promise:void 0,CP=typeof queueMicrotask=="function"?queueMicrotask:typeof W0<"u"?function(e){return W0.resolve(null).then(e).catch(RP)}:Kh;function RP(e){setTimeout(function(){throw e})}function mf(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),Ll(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Ll(t)}function rs(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 U0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var ji=Math.random().toString(36).slice(2),Wn="__reactFiber$"+ji,Hl="__reactProps$"+ji,mr="__reactContainer$"+ji,qh="__reactEvents$"+ji,NP="__reactListeners$"+ji,PP="__reactHandles$"+ji;function Ms(e){var t=e[Wn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[mr]||n[Wn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=U0(e);e!==null;){if(n=e[Wn])return n;e=U0(e)}return t}e=n,n=e.parentNode}return null}function xa(e){return e=e[Wn]||e[mr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Po(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ee(33))}function sd(e){return e[Hl]||null}var Yh=[],To=-1;function ms(e){return{current:e}}function ze(e){0>To||(e.current=Yh[To],Yh[To]=null,To--)}function Oe(e,t){To++,Yh[To]=e.current,e.current=t}var ds={},Et=ms(ds),Bt=ms(!1),Zs=ds;function hi(e,t){var n=e.type.contextTypes;if(!n)return ds;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 Ht(e){return e=e.childContextTypes,e!=null}function uu(){ze(Bt),ze(Et)}function K0(e,t,n){if(Et.current!==ds)throw Error(ee(168));Oe(Et,t),Oe(Bt,n)}function vb(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(ee(108,fN(e)||"Unknown",s));return Ve({},n,r)}function du(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ds,Zs=Et.current,Oe(Et,e),Oe(Bt,Bt.current),!0}function q0(e,t,n){var r=e.stateNode;if(!r)throw Error(ee(169));n?(e=vb(e,t,Zs),r.__reactInternalMemoizedMergedChildContext=e,ze(Bt),ze(Et),Oe(Et,e)):ze(Bt),Oe(Bt,n)}var tr=null,od=!1,yf=!1;function xb(e){tr===null?tr=[e]:tr.push(e)}function TP(e){od=!0,xb(e)}function ys(){if(!yf&&tr!==null){yf=!0;var e=0,t=Me;try{var n=tr;for(Me=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}tr=null,od=!1}catch(s){throw tr!==null&&(tr=tr.slice(e+1)),Ww(pg,ys),s}finally{Me=t,yf=!1}}return null}var Mo=[],Io=0,fu=null,hu=0,un=[],dn=0,Js=null,lr=1,ar="";function ks(e,t){Mo[Io++]=hu,Mo[Io++]=fu,fu=e,hu=t}function wb(e,t,n){un[dn++]=lr,un[dn++]=ar,un[dn++]=Js,Js=e;var r=lr;e=ar;var s=32-Pn(r)-1;r&=~(1<<s),n+=1;var o=32-Pn(t)+s;if(30<o){var i=s-s%5;o=(r&(1<<i)-1).toString(32),r>>=i,s-=i,lr=1<<32-Pn(t)+s|n<<s|r,ar=o+e}else lr=1<<o|n<<s|r,ar=e}function Eg(e){e.return!==null&&(ks(e,1),wb(e,1,0))}function kg(e){for(;e===fu;)fu=Mo[--Io],Mo[Io]=null,hu=Mo[--Io],Mo[Io]=null;for(;e===Js;)Js=un[--dn],un[dn]=null,ar=un[--dn],un[dn]=null,lr=un[--dn],un[dn]=null}var Jt=null,Zt=null,$e=!1,En=null;function bb(e,t){var n=fn(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 Y0(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,Jt=e,Zt=rs(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Jt=e,Zt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Js!==null?{id:lr,overflow:ar}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=fn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Jt=e,Zt=null,!0):!1;default:return!1}}function Qh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xh(e){if($e){var t=Zt;if(t){var n=t;if(!Y0(e,t)){if(Qh(e))throw Error(ee(418));t=rs(n.nextSibling);var r=Jt;t&&Y0(e,t)?bb(r,n):(e.flags=e.flags&-4097|2,$e=!1,Jt=e)}}else{if(Qh(e))throw Error(ee(418));e.flags=e.flags&-4097|2,$e=!1,Jt=e}}}function Q0(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Jt=e}function rc(e){if(e!==Jt)return!1;if(!$e)return Q0(e),$e=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Uh(e.type,e.memoizedProps)),t&&(t=Zt)){if(Qh(e))throw Sb(),Error(ee(418));for(;t;)bb(e,t),t=rs(t.nextSibling)}if(Q0(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ee(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Zt=rs(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Zt=null}}else Zt=Jt?rs(e.stateNode.nextSibling):null;return!0}function Sb(){for(var e=Zt;e;)e=rs(e.nextSibling)}function pi(){Zt=Jt=null,$e=!1}function Cg(e){En===null?En=[e]:En.push(e)}var MP=Er.ReactCurrentBatchConfig;function el(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(ee(309));var r=n.stateNode}if(!r)throw Error(ee(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(ee(284));if(!n._owner)throw Error(ee(290,e))}return e}function sc(e,t){throw e=Object.prototype.toString.call(t),Error(ee(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function X0(e){var t=e._init;return t(e._payload)}function Eb(e){function t(p,y){if(e){var m=p.deletions;m===null?(p.deletions=[y],p.flags|=16):m.push(y)}}function n(p,y){if(!e)return null;for(;y!==null;)t(p,y),y=y.sibling;return null}function r(p,y){for(p=new Map;y!==null;)y.key!==null?p.set(y.key,y):p.set(y.index,y),y=y.sibling;return p}function s(p,y){return p=ls(p,y),p.index=0,p.sibling=null,p}function o(p,y,m){return p.index=m,e?(m=p.alternate,m!==null?(m=m.index,m<y?(p.flags|=2,y):m):(p.flags|=2,y)):(p.flags|=1048576,y)}function i(p){return e&&p.alternate===null&&(p.flags|=2),p}function l(p,y,m,w){return y===null||y.tag!==6?(y=kf(m,p.mode,w),y.return=p,y):(y=s(y,m),y.return=p,y)}function a(p,y,m,w){var k=m.type;return k===ko?d(p,y,m.props.children,w,m.key):y!==null&&(y.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ar&&X0(k)===y.type)?(w=s(y,m.props),w.ref=el(p,y,m),w.return=p,w):(w=$c(m.type,m.key,m.props,null,p.mode,w),w.ref=el(p,y,m),w.return=p,w)}function c(p,y,m,w){return y===null||y.tag!==4||y.stateNode.containerInfo!==m.containerInfo||y.stateNode.implementation!==m.implementation?(y=Cf(m,p.mode,w),y.return=p,y):(y=s(y,m.children||[]),y.return=p,y)}function d(p,y,m,w,k){return y===null||y.tag!==7?(y=qs(m,p.mode,w,k),y.return=p,y):(y=s(y,m),y.return=p,y)}function u(p,y,m){if(typeof y=="string"&&y!==""||typeof y=="number")return y=kf(""+y,p.mode,m),y.return=p,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case qa:return m=$c(y.type,y.key,y.props,null,p.mode,m),m.ref=el(p,null,y),m.return=p,m;case Eo:return y=Cf(y,p.mode,m),y.return=p,y;case Ar:var w=y._init;return u(p,w(y._payload),m)}if(dl(y)||Qi(y))return y=qs(y,p.mode,m,null),y.return=p,y;sc(p,y)}return null}function f(p,y,m,w){var k=y!==null?y.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return k!==null?null:l(p,y,""+m,w);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case qa:return m.key===k?a(p,y,m,w):null;case Eo:return m.key===k?c(p,y,m,w):null;case Ar:return k=m._init,f(p,y,k(m._payload),w)}if(dl(m)||Qi(m))return k!==null?null:d(p,y,m,w,null);sc(p,m)}return null}function h(p,y,m,w,k){if(typeof w=="string"&&w!==""||typeof w=="number")return p=p.get(m)||null,l(y,p,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case qa:return p=p.get(w.key===null?m:w.key)||null,a(y,p,w,k);case Eo:return p=p.get(w.key===null?m:w.key)||null,c(y,p,w,k);case Ar:var C=w._init;return h(p,y,m,C(w._payload),k)}if(dl(w)||Qi(w))return p=p.get(m)||null,d(y,p,w,k,null);sc(y,w)}return null}function g(p,y,m,w){for(var k=null,C=null,R=y,E=y=0,M=null;R!==null&&E<m.length;E++){R.index>E?(M=R,R=null):M=R.sibling;var _=f(p,R,m[E],w);if(_===null){R===null&&(R=M);break}e&&R&&_.alternate===null&&t(p,R),y=o(_,y,E),C===null?k=_:C.sibling=_,C=_,R=M}if(E===m.length)return n(p,R),$e&&ks(p,E),k;if(R===null){for(;E<m.length;E++)R=u(p,m[E],w),R!==null&&(y=o(R,y,E),C===null?k=R:C.sibling=R,C=R);return $e&&ks(p,E),k}for(R=r(p,R);E<m.length;E++)M=h(R,p,E,m[E],w),M!==null&&(e&&M.alternate!==null&&R.delete(M.key===null?E:M.key),y=o(M,y,E),C===null?k=M:C.sibling=M,C=M);return e&&R.forEach(function(j){return t(p,j)}),$e&&ks(p,E),k}function x(p,y,m,w){var k=Qi(m);if(typeof k!="function")throw Error(ee(150));if(m=k.call(m),m==null)throw Error(ee(151));for(var C=k=null,R=y,E=y=0,M=null,_=m.next();R!==null&&!_.done;E++,_=m.next()){R.index>E?(M=R,R=null):M=R.sibling;var j=f(p,R,_.value,w);if(j===null){R===null&&(R=M);break}e&&R&&j.alternate===null&&t(p,R),y=o(j,y,E),C===null?k=j:C.sibling=j,C=j,R=M}if(_.done)return n(p,R),$e&&ks(p,E),k;if(R===null){for(;!_.done;E++,_=m.next())_=u(p,_.value,w),_!==null&&(y=o(_,y,E),C===null?k=_:C.sibling=_,C=_);return $e&&ks(p,E),k}for(R=r(p,R);!_.done;E++,_=m.next())_=h(R,p,E,_.value,w),_!==null&&(e&&_.alternate!==null&&R.delete(_.key===null?E:_.key),y=o(_,y,E),C===null?k=_:C.sibling=_,C=_);return e&&R.forEach(function(D){return t(p,D)}),$e&&ks(p,E),k}function b(p,y,m,w){if(typeof m=="object"&&m!==null&&m.type===ko&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case qa:e:{for(var k=m.key,C=y;C!==null;){if(C.key===k){if(k=m.type,k===ko){if(C.tag===7){n(p,C.sibling),y=s(C,m.props.children),y.return=p,p=y;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ar&&X0(k)===C.type){n(p,C.sibling),y=s(C,m.props),y.ref=el(p,C,m),y.return=p,p=y;break e}n(p,C);break}else t(p,C);C=C.sibling}m.type===ko?(y=qs(m.props.children,p.mode,w,m.key),y.return=p,p=y):(w=$c(m.type,m.key,m.props,null,p.mode,w),w.ref=el(p,y,m),w.return=p,p=w)}return i(p);case Eo:e:{for(C=m.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===m.containerInfo&&y.stateNode.implementation===m.implementation){n(p,y.sibling),y=s(y,m.children||[]),y.return=p,p=y;break e}else{n(p,y);break}else t(p,y);y=y.sibling}y=Cf(m,p.mode,w),y.return=p,p=y}return i(p);case Ar:return C=m._init,b(p,y,C(m._payload),w)}if(dl(m))return g(p,y,m,w);if(Qi(m))return x(p,y,m,w);sc(p,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,y!==null&&y.tag===6?(n(p,y.sibling),y=s(y,m),y.return=p,p=y):(n(p,y),y=kf(m,p.mode,w),y.return=p,p=y),i(p)):n(p,y)}return b}var gi=Eb(!0),kb=Eb(!1),pu=ms(null),gu=null,_o=null,Rg=null;function Ng(){Rg=_o=gu=null}function Pg(e){var t=pu.current;ze(pu),e._currentValue=t}function Gh(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 Bo(e,t){gu=e,Rg=_o=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ft=!0),e.firstContext=null)}function gn(e){var t=e._currentValue;if(Rg!==e)if(e={context:e,memoizedValue:t,next:null},_o===null){if(gu===null)throw Error(ee(308));_o=e,gu.dependencies={lanes:0,firstContext:e}}else _o=_o.next=e;return t}var Is=null;function Tg(e){Is===null?Is=[e]:Is.push(e)}function Cb(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Tg(t)):(n.next=s.next,s.next=n),t.interleaved=n,yr(e,r)}function yr(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 jr=!1;function Mg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Rb(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 ur(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ss(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ke&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,yr(e,n)}return s=r.interleaved,s===null?(t.next=t,Tg(r)):(t.next=s.next,s.next=t),r.interleaved=t,yr(e,n)}function Ac(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,gg(e,n)}}function G0(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 mu(e,t,n,r){var s=e.updateQueue;jr=!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 d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==i&&(l===null?d.firstBaseUpdate=c:l.next=c,d.lastBaseUpdate=a))}if(o!==null){var u=s.baseState;i=0,d=c=a=null,l=o;do{var f=l.lane,h=l.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,x=l;switch(f=t,h=n,x.tag){case 1:if(g=x.payload,typeof g=="function"){u=g.call(h,u,f);break e}u=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=x.payload,f=typeof g=="function"?g.call(h,u,f):g,f==null)break e;u=Ve({},u,f);break e;case 2:jr=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[l]:f.push(l))}else h={eventTime:h,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(c=d=h,a=u):d=d.next=h,i|=f;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;f=l,l=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(d===null&&(a=u),s.baseState=a,s.firstBaseUpdate=c,s.lastBaseUpdate=d,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);to|=i,e.lanes=i,e.memoizedState=u}}function Z0(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(ee(191,s));s.call(r)}}}var wa={},qn=ms(wa),Vl=ms(wa),Wl=ms(wa);function _s(e){if(e===wa)throw Error(ee(174));return e}function Ig(e,t){switch(Oe(Wl,t),Oe(Vl,e),Oe(qn,wa),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ih(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ih(t,e)}ze(qn),Oe(qn,t)}function mi(){ze(qn),ze(Vl),ze(Wl)}function Nb(e){_s(Wl.current);var t=_s(qn.current),n=Ih(t,e.type);t!==n&&(Oe(Vl,e),Oe(qn,n))}function _g(e){Vl.current===e&&(ze(qn),ze(Vl))}var Be=ms(0);function yu(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 vf=[];function Og(){for(var e=0;e<vf.length;e++)vf[e]._workInProgressVersionPrimary=null;vf.length=0}var jc=Er.ReactCurrentDispatcher,xf=Er.ReactCurrentBatchConfig,eo=0,He=null,st=null,ct=null,vu=!1,bl=!1,Ul=0,IP=0;function yt(){throw Error(ee(321))}function Ag(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Mn(e[n],t[n]))return!1;return!0}function jg(e,t,n,r,s,o){if(eo=o,He=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,jc.current=e===null||e.memoizedState===null?jP:zP,e=n(r,s),bl){o=0;do{if(bl=!1,Ul=0,25<=o)throw Error(ee(301));o+=1,ct=st=null,t.updateQueue=null,jc.current=LP,e=n(r,s)}while(bl)}if(jc.current=xu,t=st!==null&&st.next!==null,eo=0,ct=st=He=null,vu=!1,t)throw Error(ee(300));return e}function zg(){var e=Ul!==0;return Ul=0,e}function Dn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ct===null?He.memoizedState=ct=e:ct=ct.next=e,ct}function mn(){if(st===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=st.next;var t=ct===null?He.memoizedState:ct.next;if(t!==null)ct=t,st=e;else{if(e===null)throw Error(ee(310));st=e,e={memoizedState:st.memoizedState,baseState:st.baseState,baseQueue:st.baseQueue,queue:st.queue,next:null},ct===null?He.memoizedState=ct=e:ct=ct.next=e}return ct}function Kl(e,t){return typeof t=="function"?t(e):t}function wf(e){var t=mn(),n=t.queue;if(n===null)throw Error(ee(311));n.lastRenderedReducer=e;var r=st,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 d=c.lane;if((eo&d)===d)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 u={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};a===null?(l=a=u,i=r):a=a.next=u,He.lanes|=d,to|=d}c=c.next}while(c!==null&&c!==o);a===null?i=r:a.next=l,Mn(r,t.memoizedState)||(Ft=!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,He.lanes|=o,to|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function bf(e){var t=mn(),n=t.queue;if(n===null)throw Error(ee(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);Mn(o,t.memoizedState)||(Ft=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Pb(){}function Tb(e,t){var n=He,r=mn(),s=t(),o=!Mn(r.memoizedState,s);if(o&&(r.memoizedState=s,Ft=!0),r=r.queue,Lg(_b.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||ct!==null&&ct.memoizedState.tag&1){if(n.flags|=2048,ql(9,Ib.bind(null,n,r,s,t),void 0,null),ut===null)throw Error(ee(349));eo&30||Mb(n,t,s)}return s}function Mb(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=He.updateQueue,t===null?(t={lastEffect:null,stores:null},He.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ib(e,t,n,r){t.value=n,t.getSnapshot=r,Ob(t)&&Ab(e)}function _b(e,t,n){return n(function(){Ob(t)&&Ab(e)})}function Ob(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Mn(e,n)}catch{return!0}}function Ab(e){var t=yr(e,1);t!==null&&Tn(t,e,1,-1)}function J0(e){var t=Dn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Kl,lastRenderedState:e},t.queue=e,e=e.dispatch=AP.bind(null,He,e),[t.memoizedState,e]}function ql(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=He.updateQueue,t===null?(t={lastEffect:null,stores:null},He.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 jb(){return mn().memoizedState}function zc(e,t,n,r){var s=Dn();He.flags|=e,s.memoizedState=ql(1|t,n,void 0,r===void 0?null:r)}function id(e,t,n,r){var s=mn();r=r===void 0?null:r;var o=void 0;if(st!==null){var i=st.memoizedState;if(o=i.destroy,r!==null&&Ag(r,i.deps)){s.memoizedState=ql(t,n,o,r);return}}He.flags|=e,s.memoizedState=ql(1|t,n,o,r)}function ey(e,t){return zc(8390656,8,e,t)}function Lg(e,t){return id(2048,8,e,t)}function zb(e,t){return id(4,2,e,t)}function Lb(e,t){return id(4,4,e,t)}function Db(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 Fb(e,t,n){return n=n!=null?n.concat([e]):null,id(4,4,Db.bind(null,t,e),n)}function Dg(){}function $b(e,t){var n=mn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ag(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Bb(e,t){var n=mn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ag(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Hb(e,t,n){return eo&21?(Mn(n,t)||(n=qw(),He.lanes|=n,to|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ft=!0),e.memoizedState=n)}function _P(e,t){var n=Me;Me=n!==0&&4>n?n:4,e(!0);var r=xf.transition;xf.transition={};try{e(!1),t()}finally{Me=n,xf.transition=r}}function Vb(){return mn().memoizedState}function OP(e,t,n){var r=is(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Wb(e))Ub(t,n);else if(n=Cb(e,t,n,r),n!==null){var s=Pt();Tn(n,e,r,s),Kb(n,t,r)}}function AP(e,t,n){var r=is(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Wb(e))Ub(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,Mn(l,i)){var a=t.interleaved;a===null?(s.next=s,Tg(t)):(s.next=a.next,a.next=s),t.interleaved=s;return}}catch{}finally{}n=Cb(e,t,s,r),n!==null&&(s=Pt(),Tn(n,e,r,s),Kb(n,t,r))}}function Wb(e){var t=e.alternate;return e===He||t!==null&&t===He}function Ub(e,t){bl=vu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Kb(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gg(e,n)}}var xu={readContext:gn,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useInsertionEffect:yt,useLayoutEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useMutableSource:yt,useSyncExternalStore:yt,useId:yt,unstable_isNewReconciler:!1},jP={readContext:gn,useCallback:function(e,t){return Dn().memoizedState=[e,t===void 0?null:t],e},useContext:gn,useEffect:ey,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,zc(4194308,4,Db.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zc(4194308,4,e,t)},useInsertionEffect:function(e,t){return zc(4,2,e,t)},useMemo:function(e,t){var n=Dn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Dn();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=OP.bind(null,He,e),[r.memoizedState,e]},useRef:function(e){var t=Dn();return e={current:e},t.memoizedState=e},useState:J0,useDebugValue:Dg,useDeferredValue:function(e){return Dn().memoizedState=e},useTransition:function(){var e=J0(!1),t=e[0];return e=_P.bind(null,e[1]),Dn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=He,s=Dn();if($e){if(n===void 0)throw Error(ee(407));n=n()}else{if(n=t(),ut===null)throw Error(ee(349));eo&30||Mb(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,ey(_b.bind(null,r,o,e),[e]),r.flags|=2048,ql(9,Ib.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Dn(),t=ut.identifierPrefix;if($e){var n=ar,r=lr;n=(r&~(1<<32-Pn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ul++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=IP++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},zP={readContext:gn,useCallback:$b,useContext:gn,useEffect:Lg,useImperativeHandle:Fb,useInsertionEffect:zb,useLayoutEffect:Lb,useMemo:Bb,useReducer:wf,useRef:jb,useState:function(){return wf(Kl)},useDebugValue:Dg,useDeferredValue:function(e){var t=mn();return Hb(t,st.memoizedState,e)},useTransition:function(){var e=wf(Kl)[0],t=mn().memoizedState;return[e,t]},useMutableSource:Pb,useSyncExternalStore:Tb,useId:Vb,unstable_isNewReconciler:!1},LP={readContext:gn,useCallback:$b,useContext:gn,useEffect:Lg,useImperativeHandle:Fb,useInsertionEffect:zb,useLayoutEffect:Lb,useMemo:Bb,useReducer:bf,useRef:jb,useState:function(){return bf(Kl)},useDebugValue:Dg,useDeferredValue:function(e){var t=mn();return st===null?t.memoizedState=e:Hb(t,st.memoizedState,e)},useTransition:function(){var e=bf(Kl)[0],t=mn().memoizedState;return[e,t]},useMutableSource:Pb,useSyncExternalStore:Tb,useId:Vb,unstable_isNewReconciler:!1};function xn(e,t){if(e&&e.defaultProps){t=Ve({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Zh(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ve({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ld={isMounted:function(e){return(e=e._reactInternals)?po(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Pt(),s=is(e),o=ur(r,s);o.payload=t,n!=null&&(o.callback=n),t=ss(e,o,s),t!==null&&(Tn(t,e,s,r),Ac(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Pt(),s=is(e),o=ur(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=ss(e,o,s),t!==null&&(Tn(t,e,s,r),Ac(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Pt(),r=is(e),s=ur(n,r);s.tag=2,t!=null&&(s.callback=t),t=ss(e,s,r),t!==null&&(Tn(t,e,r,n),Ac(t,e,r))}};function ty(e,t,n,r,s,o,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,i):t.prototype&&t.prototype.isPureReactComponent?!Fl(n,r)||!Fl(s,o):!0}function qb(e,t,n){var r=!1,s=ds,o=t.contextType;return typeof o=="object"&&o!==null?o=gn(o):(s=Ht(t)?Zs:Et.current,r=t.contextTypes,o=(r=r!=null)?hi(e,s):ds),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ld,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function ny(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&&ld.enqueueReplaceState(t,t.state,null)}function Jh(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Mg(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=gn(o):(o=Ht(t)?Zs:Et.current,s.context=hi(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Zh(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&&ld.enqueueReplaceState(s,s.state,null),mu(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function yi(e,t){try{var n="",r=t;do n+=dN(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 Sf(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ep(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var DP=typeof WeakMap=="function"?WeakMap:Map;function Yb(e,t,n){n=ur(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){bu||(bu=!0,up=r),ep(e,t)},n}function Qb(e,t,n){n=ur(-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(){ep(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){ep(e,t),typeof r!="function"&&(os===null?os=new Set([this]):os.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function ry(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new DP;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=ZP.bind(null,e,t,n),t.then(e,e))}function sy(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 oy(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=ur(-1,1),t.tag=2,ss(n,t,1))),n.lanes|=1),e)}var FP=Er.ReactCurrentOwner,Ft=!1;function Rt(e,t,n,r){t.child=e===null?kb(t,null,n,r):gi(t,e.child,n,r)}function iy(e,t,n,r,s){n=n.render;var o=t.ref;return Bo(t,s),r=jg(e,t,n,r,o,s),n=zg(),e!==null&&!Ft?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,vr(e,t,s)):($e&&n&&Eg(t),t.flags|=1,Rt(e,t,r,s),t.child)}function ly(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!Kg(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,Xb(e,t,o,r,s)):(e=$c(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var i=o.memoizedProps;if(n=n.compare,n=n!==null?n:Fl,n(i,r)&&e.ref===t.ref)return vr(e,t,s)}return t.flags|=1,e=ls(o,r),e.ref=t.ref,e.return=t,t.child=e}function Xb(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if(Fl(o,r)&&e.ref===t.ref)if(Ft=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(Ft=!0);else return t.lanes=e.lanes,vr(e,t,s)}return tp(e,t,n,r,s)}function Gb(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},Oe(Ao,Yt),Yt|=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,Oe(Ao,Yt),Yt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,Oe(Ao,Yt),Yt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,Oe(Ao,Yt),Yt|=r;return Rt(e,t,s,n),t.child}function Zb(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function tp(e,t,n,r,s){var o=Ht(n)?Zs:Et.current;return o=hi(t,o),Bo(t,s),n=jg(e,t,n,r,o,s),r=zg(),e!==null&&!Ft?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,vr(e,t,s)):($e&&r&&Eg(t),t.flags|=1,Rt(e,t,n,s),t.child)}function ay(e,t,n,r,s){if(Ht(n)){var o=!0;du(t)}else o=!1;if(Bo(t,s),t.stateNode===null)Lc(e,t),qb(t,n,r),Jh(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=gn(c):(c=Ht(n)?Zs:Et.current,c=hi(t,c));var d=n.getDerivedStateFromProps,u=typeof d=="function"||typeof i.getSnapshotBeforeUpdate=="function";u||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==r||a!==c)&&ny(t,i,r,c),jr=!1;var f=t.memoizedState;i.state=f,mu(t,r,i,s),a=t.memoizedState,l!==r||f!==a||Bt.current||jr?(typeof d=="function"&&(Zh(t,n,d,r),a=t.memoizedState),(l=jr||ty(t,n,l,r,f,a,c))?(u||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,Rb(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:xn(t.type,l),i.props=c,u=t.pendingProps,f=i.context,a=n.contextType,typeof a=="object"&&a!==null?a=gn(a):(a=Ht(n)?Zs:Et.current,a=hi(t,a));var h=n.getDerivedStateFromProps;(d=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==u||f!==a)&&ny(t,i,r,a),jr=!1,f=t.memoizedState,i.state=f,mu(t,r,i,s);var g=t.memoizedState;l!==u||f!==g||Bt.current||jr?(typeof h=="function"&&(Zh(t,n,h,r),g=t.memoizedState),(c=jr||ty(t,n,c,r,f,g,a)||!1)?(d||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,g,a),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,g,a)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),i.props=r,i.state=g,i.context=a,r=c):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return np(e,t,n,r,o,s)}function np(e,t,n,r,s,o){Zb(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return s&&q0(t,n,!1),vr(e,t,o);r=t.stateNode,FP.current=t;var l=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=gi(t,e.child,null,o),t.child=gi(t,null,l,o)):Rt(e,t,l,o),t.memoizedState=r.state,s&&q0(t,n,!0),t.child}function Jb(e){var t=e.stateNode;t.pendingContext?K0(e,t.pendingContext,t.pendingContext!==t.context):t.context&&K0(e,t.context,!1),Ig(e,t.containerInfo)}function cy(e,t,n,r,s){return pi(),Cg(s),t.flags|=256,Rt(e,t,n,r),t.child}var rp={dehydrated:null,treeContext:null,retryLane:0};function sp(e){return{baseLanes:e,cachePool:null,transitions:null}}function e1(e,t,n){var r=t.pendingProps,s=Be.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),Oe(Be,s&1),e===null)return Xh(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=ud(i,r,0,null),e=qs(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=sp(n),t.memoizedState=rp,e):Fg(t,i));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return $P(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=ls(s,a),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?o=ls(l,o):(o=qs(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?sp(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=rp,r}return o=e.child,e=o.sibling,r=ls(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 Fg(e,t){return t=ud({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function oc(e,t,n,r){return r!==null&&Cg(r),gi(t,e.child,null,n),e=Fg(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $P(e,t,n,r,s,o,i){if(n)return t.flags&256?(t.flags&=-257,r=Sf(Error(ee(422))),oc(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=ud({mode:"visible",children:r.children},s,0,null),o=qs(o,s,i,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&gi(t,e.child,null,i),t.child.memoizedState=sp(i),t.memoizedState=rp,o);if(!(t.mode&1))return oc(e,t,i,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(ee(419)),r=Sf(o,r,void 0),oc(e,t,i,r)}if(l=(i&e.childLanes)!==0,Ft||l){if(r=ut,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,yr(e,s),Tn(r,e,s,-1))}return Ug(),r=Sf(Error(ee(421))),oc(e,t,i,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=JP.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,Zt=rs(s.nextSibling),Jt=t,$e=!0,En=null,e!==null&&(un[dn++]=lr,un[dn++]=ar,un[dn++]=Js,lr=e.id,ar=e.overflow,Js=t),t=Fg(t,r.children),t.flags|=4096,t)}function uy(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Gh(e.return,t,n)}function Ef(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 t1(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(Rt(e,t,r.children,n),r=Be.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&&uy(e,n,t);else if(e.tag===19)uy(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(Oe(Be,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&&yu(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Ef(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&&yu(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Ef(t,!0,n,null,o);break;case"together":Ef(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Lc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function vr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),to|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ee(153));if(t.child!==null){for(e=t.child,n=ls(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ls(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function BP(e,t,n){switch(t.tag){case 3:Jb(t),pi();break;case 5:Nb(t);break;case 1:Ht(t.type)&&du(t);break;case 4:Ig(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;Oe(pu,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Oe(Be,Be.current&1),t.flags|=128,null):n&t.child.childLanes?e1(e,t,n):(Oe(Be,Be.current&1),e=vr(e,t,n),e!==null?e.sibling:null);Oe(Be,Be.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return t1(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Oe(Be,Be.current),r)break;return null;case 22:case 23:return t.lanes=0,Gb(e,t,n)}return vr(e,t,n)}var n1,op,r1,s1;n1=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}};op=function(){};r1=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,_s(qn.current);var o=null;switch(n){case"input":s=Nh(e,s),r=Nh(e,r),o=[];break;case"select":s=Ve({},s,{value:void 0}),r=Ve({},r,{value:void 0}),o=[];break;case"textarea":s=Mh(e,s),r=Mh(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=cu)}_h(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"&&(_l.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"&&(_l.hasOwnProperty(c)?(a!=null&&c==="onScroll"&&je("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)}};s1=function(e,t,n,r){n!==r&&(t.flags|=4)};function tl(e,t){if(!$e)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 vt(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 HP(e,t,n){var r=t.pendingProps;switch(kg(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vt(t),null;case 1:return Ht(t.type)&&uu(),vt(t),null;case 3:return r=t.stateNode,mi(),ze(Bt),ze(Et),Og(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(rc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,En!==null&&(hp(En),En=null))),op(e,t),vt(t),null;case 5:_g(t);var s=_s(Wl.current);if(n=t.type,e!==null&&t.stateNode!=null)r1(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ee(166));return vt(t),null}if(e=_s(qn.current),rc(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Wn]=t,r[Hl]=o,e=(t.mode&1)!==0,n){case"dialog":je("cancel",r),je("close",r);break;case"iframe":case"object":case"embed":je("load",r);break;case"video":case"audio":for(s=0;s<hl.length;s++)je(hl[s],r);break;case"source":je("error",r);break;case"img":case"image":case"link":je("error",r),je("load",r);break;case"details":je("toggle",r);break;case"input":x0(r,o),je("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},je("invalid",r);break;case"textarea":b0(r,o),je("invalid",r)}_h(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&&nc(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&nc(r.textContent,l,e),s=["children",""+l]):_l.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&je("scroll",r)}switch(n){case"input":Ya(r),w0(r,o,!0);break;case"textarea":Ya(r),S0(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=cu)}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=_w(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[Wn]=t,e[Hl]=r,n1(e,t,!1,!1),t.stateNode=e;e:{switch(i=Oh(n,r),n){case"dialog":je("cancel",e),je("close",e),s=r;break;case"iframe":case"object":case"embed":je("load",e),s=r;break;case"video":case"audio":for(s=0;s<hl.length;s++)je(hl[s],e);s=r;break;case"source":je("error",e),s=r;break;case"img":case"image":case"link":je("error",e),je("load",e),s=r;break;case"details":je("toggle",e),s=r;break;case"input":x0(e,r),s=Nh(e,r),je("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Ve({},r,{value:void 0}),je("invalid",e);break;case"textarea":b0(e,r),s=Mh(e,r),je("invalid",e);break;default:s=r}_h(n,s),l=s;for(o in l)if(l.hasOwnProperty(o)){var a=l[o];o==="style"?jw(e,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Ow(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"&&(_l.hasOwnProperty(o)?a!=null&&o==="onScroll"&&je("scroll",e):a!=null&&cg(e,o,a,i))}switch(n){case"input":Ya(e),w0(e,r,!1);break;case"textarea":Ya(e),S0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+us(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Lo(e,!!r.multiple,o,!1):r.defaultValue!=null&&Lo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=cu)}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 vt(t),null;case 6:if(e&&t.stateNode!=null)s1(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ee(166));if(n=_s(Wl.current),_s(qn.current),rc(t)){if(r=t.stateNode,n=t.memoizedProps,r[Wn]=t,(o=r.nodeValue!==n)&&(e=Jt,e!==null))switch(e.tag){case 3:nc(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&nc(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Wn]=t,t.stateNode=r}return vt(t),null;case 13:if(ze(Be),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if($e&&Zt!==null&&t.mode&1&&!(t.flags&128))Sb(),pi(),t.flags|=98560,o=!1;else if(o=rc(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(ee(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(ee(317));o[Wn]=t}else pi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vt(t),o=!1}else En!==null&&(hp(En),En=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||Be.current&1?ot===0&&(ot=3):Ug())),t.updateQueue!==null&&(t.flags|=4),vt(t),null);case 4:return mi(),op(e,t),e===null&&$l(t.stateNode.containerInfo),vt(t),null;case 10:return Pg(t.type._context),vt(t),null;case 17:return Ht(t.type)&&uu(),vt(t),null;case 19:if(ze(Be),o=t.memoizedState,o===null)return vt(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)tl(o,!1);else{if(ot!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=yu(e),i!==null){for(t.flags|=128,tl(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 Oe(Be,Be.current&1|2),t.child}e=e.sibling}o.tail!==null&&Qe()>vi&&(t.flags|=128,r=!0,tl(o,!1),t.lanes=4194304)}else{if(!r)if(e=yu(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),tl(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!$e)return vt(t),null}else 2*Qe()-o.renderingStartTime>vi&&n!==1073741824&&(t.flags|=128,r=!0,tl(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=Qe(),t.sibling=null,n=Be.current,Oe(Be,r?n&1|2:n&1),t):(vt(t),null);case 22:case 23:return Wg(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Yt&1073741824&&(vt(t),t.subtreeFlags&6&&(t.flags|=8192)):vt(t),null;case 24:return null;case 25:return null}throw Error(ee(156,t.tag))}function VP(e,t){switch(kg(t),t.tag){case 1:return Ht(t.type)&&uu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return mi(),ze(Bt),ze(Et),Og(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return _g(t),null;case 13:if(ze(Be),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ee(340));pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ze(Be),null;case 4:return mi(),null;case 10:return Pg(t.type._context),null;case 22:case 23:return Wg(),null;case 24:return null;default:return null}}var ic=!1,bt=!1,WP=typeof WeakSet=="function"?WeakSet:Set,ae=null;function Oo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ke(e,t,r)}else n.current=null}function ip(e,t,n){try{n()}catch(r){Ke(e,t,r)}}var dy=!1;function UP(e,t){if(Vh=iu,e=cb(),Sg(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,d=0,u=e,f=null;t:for(;;){for(var h;u!==n||s!==0&&u.nodeType!==3||(l=i+s),u!==o||r!==0&&u.nodeType!==3||(a=i+r),u.nodeType===3&&(i+=u.nodeValue.length),(h=u.firstChild)!==null;)f=u,u=h;for(;;){if(u===e)break t;if(f===n&&++c===s&&(l=i),f===o&&++d===r&&(a=i),(h=u.nextSibling)!==null)break;u=f,f=u.parentNode}u=h}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Wh={focusedElem:e,selectionRange:n},iu=!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 g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var x=g.memoizedProps,b=g.memoizedState,p=t.stateNode,y=p.getSnapshotBeforeUpdate(t.elementType===t.type?x:xn(t.type,x),b);p.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ee(163))}}catch(w){Ke(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,ae=e;break}ae=t.return}return g=dy,dy=!1,g}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&&ip(t,n,o)}s=s.next}while(s!==r)}}function ad(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 lp(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 o1(e){var t=e.alternate;t!==null&&(e.alternate=null,o1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wn],delete t[Hl],delete t[qh],delete t[NP],delete t[PP])),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 i1(e){return e.tag===5||e.tag===3||e.tag===4}function fy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||i1(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 ap(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=cu));else if(r!==4&&(e=e.child,e!==null))for(ap(e,t,n),e=e.sibling;e!==null;)ap(e,t,n),e=e.sibling}function cp(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(cp(e,t,n),e=e.sibling;e!==null;)cp(e,t,n),e=e.sibling}var ht=null,bn=!1;function Pr(e,t,n){for(n=n.child;n!==null;)l1(e,t,n),n=n.sibling}function l1(e,t,n){if(Kn&&typeof Kn.onCommitFiberUnmount=="function")try{Kn.onCommitFiberUnmount(ed,n)}catch{}switch(n.tag){case 5:bt||Oo(n,t);case 6:var r=ht,s=bn;ht=null,Pr(e,t,n),ht=r,bn=s,ht!==null&&(bn?(e=ht,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ht.removeChild(n.stateNode));break;case 18:ht!==null&&(bn?(e=ht,n=n.stateNode,e.nodeType===8?mf(e.parentNode,n):e.nodeType===1&&mf(e,n),Ll(e)):mf(ht,n.stateNode));break;case 4:r=ht,s=bn,ht=n.stateNode.containerInfo,bn=!0,Pr(e,t,n),ht=r,bn=s;break;case 0:case 11:case 14:case 15:if(!bt&&(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)&&ip(n,t,i),s=s.next}while(s!==r)}Pr(e,t,n);break;case 1:if(!bt&&(Oo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ke(n,t,l)}Pr(e,t,n);break;case 21:Pr(e,t,n);break;case 22:n.mode&1?(bt=(r=bt)||n.memoizedState!==null,Pr(e,t,n),bt=r):Pr(e,t,n);break;default:Pr(e,t,n)}}function hy(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new WP),t.forEach(function(r){var s=eT.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function yn(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:ht=l.stateNode,bn=!1;break e;case 3:ht=l.stateNode.containerInfo,bn=!0;break e;case 4:ht=l.stateNode.containerInfo,bn=!0;break e}l=l.return}if(ht===null)throw Error(ee(160));l1(o,i,s),ht=null,bn=!1;var a=s.alternate;a!==null&&(a.return=null),s.return=null}catch(c){Ke(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)a1(t,e),t=t.sibling}function a1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(yn(t,e),jn(e),r&4){try{Sl(3,e,e.return),ad(3,e)}catch(x){Ke(e,e.return,x)}try{Sl(5,e,e.return)}catch(x){Ke(e,e.return,x)}}break;case 1:yn(t,e),jn(e),r&512&&n!==null&&Oo(n,n.return);break;case 5:if(yn(t,e),jn(e),r&512&&n!==null&&Oo(n,n.return),e.flags&32){var s=e.stateNode;try{Ol(s,"")}catch(x){Ke(e,e.return,x)}}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&&Mw(s,o),Oh(l,i);var c=Oh(l,o);for(i=0;i<a.length;i+=2){var d=a[i],u=a[i+1];d==="style"?jw(s,u):d==="dangerouslySetInnerHTML"?Ow(s,u):d==="children"?Ol(s,u):cg(s,d,u,c)}switch(l){case"input":Ph(s,o);break;case"textarea":Iw(s,o);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?Lo(s,!!o.multiple,h,!1):f!==!!o.multiple&&(o.defaultValue!=null?Lo(s,!!o.multiple,o.defaultValue,!0):Lo(s,!!o.multiple,o.multiple?[]:"",!1))}s[Hl]=o}catch(x){Ke(e,e.return,x)}}break;case 6:if(yn(t,e),jn(e),r&4){if(e.stateNode===null)throw Error(ee(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(x){Ke(e,e.return,x)}}break;case 3:if(yn(t,e),jn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ll(t.containerInfo)}catch(x){Ke(e,e.return,x)}break;case 4:yn(t,e),jn(e);break;case 13:yn(t,e),jn(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Hg=Qe())),r&4&&hy(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(bt=(c=bt)||d,yn(t,e),bt=c):yn(t,e),jn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(ae=e,d=e.child;d!==null;){for(u=ae=d;ae!==null;){switch(f=ae,h=f.child,f.tag){case 0:case 11:case 14:case 15:Sl(4,f,f.return);break;case 1:Oo(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(x){Ke(r,n,x)}}break;case 5:Oo(f,f.return);break;case 22:if(f.memoizedState!==null){gy(u);continue}}h!==null?(h.return=f,ae=h):gy(u)}d=d.sibling}e:for(d=null,u=e;;){if(u.tag===5){if(d===null){d=u;try{s=u.stateNode,c?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=u.stateNode,a=u.memoizedProps.style,i=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=Aw("display",i))}catch(x){Ke(e,e.return,x)}}}else if(u.tag===6){if(d===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(x){Ke(e,e.return,x)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;d===u&&(d=null),u=u.return}d===u&&(d=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:yn(t,e),jn(e),r&4&&hy(e);break;case 21:break;default:yn(t,e),jn(e)}}function jn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(i1(n)){var r=n;break e}n=n.return}throw Error(ee(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Ol(s,""),r.flags&=-33);var o=fy(e);cp(e,o,s);break;case 3:case 4:var i=r.stateNode.containerInfo,l=fy(e);ap(e,l,i);break;default:throw Error(ee(161))}}catch(a){Ke(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function KP(e,t,n){ae=e,c1(e)}function c1(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||ic;if(!i){var l=s.alternate,a=l!==null&&l.memoizedState!==null||bt;l=ic;var c=bt;if(ic=i,(bt=a)&&!c)for(ae=s;ae!==null;)i=ae,a=i.child,i.tag===22&&i.memoizedState!==null?my(s):a!==null?(a.return=i,ae=a):my(s);for(;o!==null;)ae=o,c1(o),o=o.sibling;ae=s,ic=l,bt=c}py(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,ae=o):py(e)}}function py(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:bt||ad(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!bt)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:xn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&Z0(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}Z0(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 d=c.memoizedState;if(d!==null){var u=d.dehydrated;u!==null&&Ll(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ee(163))}bt||t.flags&512&&lp(t)}catch(f){Ke(t,t.return,f)}}if(t===e){ae=null;break}if(n=t.sibling,n!==null){n.return=t.return,ae=n;break}ae=t.return}}function gy(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 my(e){for(;ae!==null;){var t=ae;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ad(4,t)}catch(a){Ke(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(a){Ke(t,s,a)}}var o=t.return;try{lp(t)}catch(a){Ke(t,o,a)}break;case 5:var i=t.return;try{lp(t)}catch(a){Ke(t,i,a)}}}catch(a){Ke(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 qP=Math.ceil,wu=Er.ReactCurrentDispatcher,$g=Er.ReactCurrentOwner,pn=Er.ReactCurrentBatchConfig,ke=0,ut=null,Je=null,pt=0,Yt=0,Ao=ms(0),ot=0,Yl=null,to=0,cd=0,Bg=0,El=null,Lt=null,Hg=0,vi=1/0,er=null,bu=!1,up=null,os=null,lc=!1,Gr=null,Su=0,kl=0,dp=null,Dc=-1,Fc=0;function Pt(){return ke&6?Qe():Dc!==-1?Dc:Dc=Qe()}function is(e){return e.mode&1?ke&2&&pt!==0?pt&-pt:MP.transition!==null?(Fc===0&&(Fc=qw()),Fc):(e=Me,e!==0||(e=window.event,e=e===void 0?16:eb(e.type)),e):1}function Tn(e,t,n,r){if(50<kl)throw kl=0,dp=null,Error(ee(185));ya(e,n,r),(!(ke&2)||e!==ut)&&(e===ut&&(!(ke&2)&&(cd|=n),ot===4&&Dr(e,pt)),Vt(e,r),n===1&&ke===0&&!(t.mode&1)&&(vi=Qe()+500,od&&ys()))}function Vt(e,t){var n=e.callbackNode;MN(e,t);var r=ou(e,e===ut?pt:0);if(r===0)n!==null&&C0(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&C0(n),t===1)e.tag===0?TP(yy.bind(null,e)):xb(yy.bind(null,e)),CP(function(){!(ke&6)&&ys()}),n=null;else{switch(Yw(r)){case 1:n=pg;break;case 4:n=Uw;break;case 16:n=su;break;case 536870912:n=Kw;break;default:n=su}n=y1(n,u1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function u1(e,t){if(Dc=-1,Fc=0,ke&6)throw Error(ee(327));var n=e.callbackNode;if(Ho()&&e.callbackNode!==n)return null;var r=ou(e,e===ut?pt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Eu(e,r);else{t=r;var s=ke;ke|=2;var o=f1();(ut!==e||pt!==t)&&(er=null,vi=Qe()+500,Ks(e,t));do try{XP();break}catch(l){d1(e,l)}while(!0);Ng(),wu.current=o,ke=s,Je!==null?t=0:(ut=null,pt=0,t=ot)}if(t!==0){if(t===2&&(s=Dh(e),s!==0&&(r=s,t=fp(e,s))),t===1)throw n=Yl,Ks(e,0),Dr(e,r),Vt(e,Qe()),n;if(t===6)Dr(e,r);else{if(s=e.current.alternate,!(r&30)&&!YP(s)&&(t=Eu(e,r),t===2&&(o=Dh(e),o!==0&&(r=o,t=fp(e,o))),t===1))throw n=Yl,Ks(e,0),Dr(e,r),Vt(e,Qe()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(ee(345));case 2:Cs(e,Lt,er);break;case 3:if(Dr(e,r),(r&130023424)===r&&(t=Hg+500-Qe(),10<t)){if(ou(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Pt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Kh(Cs.bind(null,e,Lt,er),t);break}Cs(e,Lt,er);break;case 4:if(Dr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var i=31-Pn(r);o=1<<i,i=t[i],i>s&&(s=i),r&=~o}if(r=s,r=Qe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*qP(r/1960))-r,10<r){e.timeoutHandle=Kh(Cs.bind(null,e,Lt,er),r);break}Cs(e,Lt,er);break;case 5:Cs(e,Lt,er);break;default:throw Error(ee(329))}}}return Vt(e,Qe()),e.callbackNode===n?u1.bind(null,e):null}function fp(e,t){var n=El;return e.current.memoizedState.isDehydrated&&(Ks(e,t).flags|=256),e=Eu(e,t),e!==2&&(t=Lt,Lt=n,t!==null&&hp(t)),e}function hp(e){Lt===null?Lt=e:Lt.push.apply(Lt,e)}function YP(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(!Mn(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 Dr(e,t){for(t&=~Bg,t&=~cd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Pn(t),r=1<<n;e[n]=-1,t&=~r}}function yy(e){if(ke&6)throw Error(ee(327));Ho();var t=ou(e,0);if(!(t&1))return Vt(e,Qe()),null;var n=Eu(e,t);if(e.tag!==0&&n===2){var r=Dh(e);r!==0&&(t=r,n=fp(e,r))}if(n===1)throw n=Yl,Ks(e,0),Dr(e,t),Vt(e,Qe()),n;if(n===6)throw Error(ee(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Cs(e,Lt,er),Vt(e,Qe()),null}function Vg(e,t){var n=ke;ke|=1;try{return e(t)}finally{ke=n,ke===0&&(vi=Qe()+500,od&&ys())}}function no(e){Gr!==null&&Gr.tag===0&&!(ke&6)&&Ho();var t=ke;ke|=1;var n=pn.transition,r=Me;try{if(pn.transition=null,Me=1,e)return e()}finally{Me=r,pn.transition=n,ke=t,!(ke&6)&&ys()}}function Wg(){Yt=Ao.current,ze(Ao)}function Ks(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,kP(n)),Je!==null)for(n=Je.return;n!==null;){var r=n;switch(kg(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&uu();break;case 3:mi(),ze(Bt),ze(Et),Og();break;case 5:_g(r);break;case 4:mi();break;case 13:ze(Be);break;case 19:ze(Be);break;case 10:Pg(r.type._context);break;case 22:case 23:Wg()}n=n.return}if(ut=e,Je=e=ls(e.current,null),pt=Yt=t,ot=0,Yl=null,Bg=cd=to=0,Lt=El=null,Is!==null){for(t=0;t<Is.length;t++)if(n=Is[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}Is=null}return e}function d1(e,t){do{var n=Je;try{if(Ng(),jc.current=xu,vu){for(var r=He.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}vu=!1}if(eo=0,ct=st=He=null,bl=!1,Ul=0,$g.current=null,n===null||n.return===null){ot=1,Yl=t,Je=null;break}e:{var o=e,i=n.return,l=n,a=t;if(t=pt,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var c=a,d=l,u=d.tag;if(!(d.mode&1)&&(u===0||u===11||u===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=sy(i);if(h!==null){h.flags&=-257,oy(h,i,l,o,t),h.mode&1&&ry(o,c,t),t=h,a=c;var g=t.updateQueue;if(g===null){var x=new Set;x.add(a),t.updateQueue=x}else g.add(a);break e}else{if(!(t&1)){ry(o,c,t),Ug();break e}a=Error(ee(426))}}else if($e&&l.mode&1){var b=sy(i);if(b!==null){!(b.flags&65536)&&(b.flags|=256),oy(b,i,l,o,t),Cg(yi(a,l));break e}}o=a=yi(a,l),ot!==4&&(ot=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=Yb(o,a,t);G0(o,p);break e;case 1:l=a;var y=o.type,m=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(os===null||!os.has(m)))){o.flags|=65536,t&=-t,o.lanes|=t;var w=Qb(o,l,t);G0(o,w);break e}}o=o.return}while(o!==null)}p1(n)}catch(k){t=k,Je===n&&n!==null&&(Je=n=n.return);continue}break}while(!0)}function f1(){var e=wu.current;return wu.current=xu,e===null?xu:e}function Ug(){(ot===0||ot===3||ot===2)&&(ot=4),ut===null||!(to&268435455)&&!(cd&268435455)||Dr(ut,pt)}function Eu(e,t){var n=ke;ke|=2;var r=f1();(ut!==e||pt!==t)&&(er=null,Ks(e,t));do try{QP();break}catch(s){d1(e,s)}while(!0);if(Ng(),ke=n,wu.current=r,Je!==null)throw Error(ee(261));return ut=null,pt=0,ot}function QP(){for(;Je!==null;)h1(Je)}function XP(){for(;Je!==null&&!bN();)h1(Je)}function h1(e){var t=m1(e.alternate,e,Yt);e.memoizedProps=e.pendingProps,t===null?p1(e):Je=t,$g.current=null}function p1(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=VP(n,t),n!==null){n.flags&=32767,Je=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ot=6,Je=null;return}}else if(n=HP(n,t,Yt),n!==null){Je=n;return}if(t=t.sibling,t!==null){Je=t;return}Je=t=e}while(t!==null);ot===0&&(ot=5)}function Cs(e,t,n){var r=Me,s=pn.transition;try{pn.transition=null,Me=1,GP(e,t,n,r)}finally{pn.transition=s,Me=r}return null}function GP(e,t,n,r){do Ho();while(Gr!==null);if(ke&6)throw Error(ee(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(ee(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(IN(e,o),e===ut&&(Je=ut=null,pt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||lc||(lc=!0,y1(su,function(){return Ho(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=pn.transition,pn.transition=null;var i=Me;Me=1;var l=ke;ke|=4,$g.current=null,UP(e,n),a1(n,e),yP(Wh),iu=!!Vh,Wh=Vh=null,e.current=n,KP(n),SN(),ke=l,Me=i,pn.transition=o}else e.current=n;if(lc&&(lc=!1,Gr=e,Su=s),o=e.pendingLanes,o===0&&(os=null),CN(n.stateNode),Vt(e,Qe()),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(bu)throw bu=!1,e=up,up=null,e;return Su&1&&e.tag!==0&&Ho(),o=e.pendingLanes,o&1?e===dp?kl++:(kl=0,dp=e):kl=0,ys(),null}function Ho(){if(Gr!==null){var e=Yw(Su),t=pn.transition,n=Me;try{if(pn.transition=null,Me=16>e?16:e,Gr===null)var r=!1;else{if(e=Gr,Gr=null,Su=0,ke&6)throw Error(ee(331));var s=ke;for(ke|=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 d=ae;switch(d.tag){case 0:case 11:case 15:Sl(8,d,o)}var u=d.child;if(u!==null)u.return=d,ae=u;else for(;ae!==null;){d=ae;var f=d.sibling,h=d.return;if(o1(d),d===c){ae=null;break}if(f!==null){f.return=h,ae=f;break}ae=h}}}var g=o.alternate;if(g!==null){var x=g.child;if(x!==null){g.child=null;do{var b=x.sibling;x.sibling=null,x=b}while(x!==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 y=e.current;for(ae=y;ae!==null;){i=ae;var m=i.child;if(i.subtreeFlags&2064&&m!==null)m.return=i,ae=m;else e:for(i=y;ae!==null;){if(l=ae,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ad(9,l)}}catch(k){Ke(l,l.return,k)}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(ke=s,ys(),Kn&&typeof Kn.onPostCommitFiberRoot=="function")try{Kn.onPostCommitFiberRoot(ed,e)}catch{}r=!0}return r}finally{Me=n,pn.transition=t}}return!1}function vy(e,t,n){t=yi(n,t),t=Yb(e,t,1),e=ss(e,t,1),t=Pt(),e!==null&&(ya(e,1,t),Vt(e,t))}function Ke(e,t,n){if(e.tag===3)vy(e,e,n);else for(;t!==null;){if(t.tag===3){vy(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(os===null||!os.has(r))){e=yi(n,e),e=Qb(t,e,1),t=ss(t,e,1),e=Pt(),t!==null&&(ya(t,1,e),Vt(t,e));break}}t=t.return}}function ZP(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Pt(),e.pingedLanes|=e.suspendedLanes&n,ut===e&&(pt&n)===n&&(ot===4||ot===3&&(pt&130023424)===pt&&500>Qe()-Hg?Ks(e,0):Bg|=n),Vt(e,t)}function g1(e,t){t===0&&(e.mode&1?(t=Ga,Ga<<=1,!(Ga&130023424)&&(Ga=4194304)):t=1);var n=Pt();e=yr(e,t),e!==null&&(ya(e,t,n),Vt(e,n))}function JP(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),g1(e,n)}function eT(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(ee(314))}r!==null&&r.delete(t),g1(e,n)}var m1;m1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Bt.current)Ft=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ft=!1,BP(e,t,n);Ft=!!(e.flags&131072)}else Ft=!1,$e&&t.flags&1048576&&wb(t,hu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Lc(e,t),e=t.pendingProps;var s=hi(t,Et.current);Bo(t,n),s=jg(null,t,r,e,s,n);var o=zg();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,Ht(r)?(o=!0,du(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Mg(t),s.updater=ld,t.stateNode=s,s._reactInternals=t,Jh(t,r,e,n),t=np(null,t,r,!0,o,n)):(t.tag=0,$e&&o&&Eg(t),Rt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Lc(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=nT(r),e=xn(r,e),s){case 0:t=tp(null,t,r,e,n);break e;case 1:t=ay(null,t,r,e,n);break e;case 11:t=iy(null,t,r,e,n);break e;case 14:t=ly(null,t,r,xn(r.type,e),n);break e}throw Error(ee(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:xn(r,s),tp(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:xn(r,s),ay(e,t,r,s,n);case 3:e:{if(Jb(t),e===null)throw Error(ee(387));r=t.pendingProps,o=t.memoizedState,s=o.element,Rb(e,t),mu(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=yi(Error(ee(423)),t),t=cy(e,t,r,n,s);break e}else if(r!==s){s=yi(Error(ee(424)),t),t=cy(e,t,r,n,s);break e}else for(Zt=rs(t.stateNode.containerInfo.firstChild),Jt=t,$e=!0,En=null,n=kb(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(pi(),r===s){t=vr(e,t,n);break e}Rt(e,t,r,n)}t=t.child}return t;case 5:return Nb(t),e===null&&Xh(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,Uh(r,s)?i=null:o!==null&&Uh(r,o)&&(t.flags|=32),Zb(e,t),Rt(e,t,i,n),t.child;case 6:return e===null&&Xh(t),null;case 13:return e1(e,t,n);case 4:return Ig(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=gi(t,null,r,n):Rt(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:xn(r,s),iy(e,t,r,s,n);case 7:return Rt(e,t,t.pendingProps,n),t.child;case 8:return Rt(e,t,t.pendingProps.children,n),t.child;case 12:return Rt(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,Oe(pu,r._currentValue),r._currentValue=i,o!==null)if(Mn(o.value,i)){if(o.children===s.children&&!Bt.current){t=vr(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=ur(-1,n&-n),a.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?a.next=a:(a.next=d.next,d.next=a),c.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Gh(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(ee(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Gh(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}Rt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Bo(t,n),s=gn(s),r=r(s),t.flags|=1,Rt(e,t,r,n),t.child;case 14:return r=t.type,s=xn(r,t.pendingProps),s=xn(r.type,s),ly(e,t,r,s,n);case 15:return Xb(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:xn(r,s),Lc(e,t),t.tag=1,Ht(r)?(e=!0,du(t)):e=!1,Bo(t,n),qb(t,r,s),Jh(t,r,s,n),np(null,t,r,!0,e,n);case 19:return t1(e,t,n);case 22:return Gb(e,t,n)}throw Error(ee(156,t.tag))};function y1(e,t){return Ww(e,t)}function tT(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 fn(e,t,n,r){return new tT(e,t,n,r)}function Kg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nT(e){if(typeof e=="function")return Kg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===dg)return 11;if(e===fg)return 14}return 2}function ls(e,t){var n=e.alternate;return n===null?(n=fn(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 $c(e,t,n,r,s,o){var i=2;if(r=e,typeof e=="function")Kg(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case ko:return qs(n.children,s,o,t);case ug:i=8,s|=8;break;case Eh:return e=fn(12,n,t,s|2),e.elementType=Eh,e.lanes=o,e;case kh:return e=fn(13,n,t,s),e.elementType=kh,e.lanes=o,e;case Ch:return e=fn(19,n,t,s),e.elementType=Ch,e.lanes=o,e;case Nw:return ud(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Cw:i=10;break e;case Rw:i=9;break e;case dg:i=11;break e;case fg:i=14;break e;case Ar:i=16,r=null;break e}throw Error(ee(130,e==null?e:typeof e,""))}return t=fn(i,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function qs(e,t,n,r){return e=fn(7,e,r,t),e.lanes=n,e}function ud(e,t,n,r){return e=fn(22,e,r,t),e.elementType=Nw,e.lanes=n,e.stateNode={isHidden:!1},e}function kf(e,t,n){return e=fn(6,e,null,t),e.lanes=n,e}function Cf(e,t,n){return t=fn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function rT(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=sf(0),this.expirationTimes=sf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sf(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function qg(e,t,n,r,s,o,i,l,a){return e=new rT(e,t,n,l,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=fn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mg(o),e}function sT(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Eo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function v1(e){if(!e)return ds;e=e._reactInternals;e:{if(po(e)!==e||e.tag!==1)throw Error(ee(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ht(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ee(171))}if(e.tag===1){var n=e.type;if(Ht(n))return vb(e,n,t)}return t}function x1(e,t,n,r,s,o,i,l,a){return e=qg(n,r,!0,e,s,o,i,l,a),e.context=v1(null),n=e.current,r=Pt(),s=is(n),o=ur(r,s),o.callback=t??null,ss(n,o,s),e.current.lanes=s,ya(e,s,r),Vt(e,r),e}function dd(e,t,n,r){var s=t.current,o=Pt(),i=is(s);return n=v1(n),t.context===null?t.context=n:t.pendingContext=n,t=ur(o,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ss(s,t,i),e!==null&&(Tn(e,s,i,o),Ac(e,s,i)),i}function ku(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 xy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Yg(e,t){xy(e,t),(e=e.alternate)&&xy(e,t)}function oT(){return null}var w1=typeof reportError=="function"?reportError:function(e){console.error(e)};function Qg(e){this._internalRoot=e}fd.prototype.render=Qg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ee(409));dd(e,t,null,null)};fd.prototype.unmount=Qg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;no(function(){dd(null,e,null,null)}),t[mr]=null}};function fd(e){this._internalRoot=e}fd.prototype.unstable_scheduleHydration=function(e){if(e){var t=Gw();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Lr.length&&t!==0&&t<Lr[n].priority;n++);Lr.splice(n,0,e),n===0&&Jw(e)}};function Xg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function hd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function wy(){}function iT(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var c=ku(i);o.call(c)}}var i=x1(t,r,e,0,null,!1,!1,"",wy);return e._reactRootContainer=i,e[mr]=i.current,$l(e.nodeType===8?e.parentNode:e),no(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var c=ku(a);l.call(c)}}var a=qg(e,0,!1,null,null,!1,!1,"",wy);return e._reactRootContainer=a,e[mr]=a.current,$l(e.nodeType===8?e.parentNode:e),no(function(){dd(t,a,n,r)}),a}function pd(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=ku(i);l.call(a)}}dd(t,i,e,s)}else i=iT(n,t,e,s,r);return ku(i)}Qw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=fl(t.pendingLanes);n!==0&&(gg(t,n|1),Vt(t,Qe()),!(ke&6)&&(vi=Qe()+500,ys()))}break;case 13:no(function(){var r=yr(e,1);if(r!==null){var s=Pt();Tn(r,e,1,s)}}),Yg(e,1)}};mg=function(e){if(e.tag===13){var t=yr(e,134217728);if(t!==null){var n=Pt();Tn(t,e,134217728,n)}Yg(e,134217728)}};Xw=function(e){if(e.tag===13){var t=is(e),n=yr(e,t);if(n!==null){var r=Pt();Tn(n,e,t,r)}Yg(e,t)}};Gw=function(){return Me};Zw=function(e,t){var n=Me;try{return Me=e,t()}finally{Me=n}};jh=function(e,t,n){switch(t){case"input":if(Ph(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=sd(r);if(!s)throw Error(ee(90));Tw(r),Ph(r,s)}}}break;case"textarea":Iw(e,n);break;case"select":t=n.value,t!=null&&Lo(e,!!n.multiple,t,!1)}};Dw=Vg;Fw=no;var lT={usingClientEntryPoint:!1,Events:[xa,Po,sd,zw,Lw,Vg]},nl={findFiberByHostInstance:Ms,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},aT={bundleType:nl.bundleType,version:nl.version,rendererPackageName:nl.rendererPackageName,rendererConfig:nl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Er.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Hw(e),e===null?null:e.stateNode},findFiberByHostInstance:nl.findFiberByHostInstance||oT,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 ac=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ac.isDisabled&&ac.supportsFiber)try{ed=ac.inject(aT),Kn=ac}catch{}}sn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lT;sn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Xg(t))throw Error(ee(200));return sT(e,t,null,n)};sn.createRoot=function(e,t){if(!Xg(e))throw Error(ee(299));var n=!1,r="",s=w1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=qg(e,1,!1,null,null,n,!1,r,s),e[mr]=t.current,$l(e.nodeType===8?e.parentNode:e),new Qg(t)};sn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ee(188)):(e=Object.keys(e).join(","),Error(ee(268,e)));return e=Hw(t),e=e===null?null:e.stateNode,e};sn.flushSync=function(e){return no(e)};sn.hydrate=function(e,t,n){if(!hd(t))throw Error(ee(200));return pd(null,e,t,!0,n)};sn.hydrateRoot=function(e,t,n){if(!Xg(e))throw Error(ee(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",i=w1;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=x1(t,null,e,1,n??null,s,!1,o,i),e[mr]=t.current,$l(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new fd(t)};sn.render=function(e,t,n){if(!hd(t))throw Error(ee(200));return pd(null,e,t,!1,n)};sn.unmountComponentAtNode=function(e){if(!hd(e))throw Error(ee(40));return e._reactRootContainer?(no(function(){pd(null,null,e,!1,function(){e._reactRootContainer=null,e[mr]=null})}),!0):!1};sn.unstable_batchedUpdates=Vg;sn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!hd(n))throw Error(ee(200));if(e==null||e._reactInternals===void 0)throw Error(ee(38));return pd(e,t,n,!1,r)};sn.version="18.3.1-next-f1338f8080-20240426";function b1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(b1)}catch(e){console.error(e)}}b1(),bw.exports=sn;var Wt=bw.exports,S1,by=Wt;S1=by.createRoot,by.hydrateRoot;function cT(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 d=t[a*2];c=s[a]={index:a,key:n(a),start:d,size:t[a*2+1],end:d+t[a*2+1],lane:0}}return c}}if(o==="length")return e}return Reflect.get(s,o,i)}})}function wo(e,t,n){let r=n.initialDeps??[],s,o=!0;function i(){const l=e();return(l.length!==r.length||l.some((c,d)=>r[d]!==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 Sy(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const uT=(e,t)=>Math.abs(e-t)<1.01,dT=(e,t,n)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)}};let rl;const Rf=()=>{if(rl!==void 0)return rl;if(typeof navigator>"u")return rl=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return rl=!0;const e=navigator.maxTouchPoints;return rl=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Ey=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},fT=e=>e,hT=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},pT=(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(Ey(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(Ey(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},Cu={passive:!0},gT=typeof window>"u"?!0:"onscrollend"in window,mT=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const o=e.options.useScrollendEvent&&gT;let i=0;const l=o?null:dT(s,()=>t(i,!1),e.options.isScrollingResetDelay),a=u=>()=>{i=n(r),l==null||l(),t(i,u)},c=a(!0),d=a(!1);return r.addEventListener("scroll",c,Cu),o&&r.addEventListener("scrollend",d,Cu),()=>{r.removeEventListener("scroll",c),o&&r.removeEventListener("scrollend",d)}},yT=(e,t)=>mT(e,t,n=>{const{horizontal:r,isRtl:s}=e.options;return r?n.scrollLeft*(s&&-1||1):n.scrollTop}),vT=(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"]},xT=(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})},wT=xT;class bT{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,s;return((s=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const i=()=>{const l=o.target,a=this.indexFromElement(l);if(!l.isConnected){this.observer.unobserve(l);for(const[c,d]of this.elementsCache)if(d===l){this.elementsCache.delete(c);break}return}this.shouldMeasureDuringScroll(a)&&this.resizeItem(a,this.options.measureElement(l,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=null},observe:s=>{var o;return(o=r())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=r())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{var r,s;const o={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:fT,rangeExtractor:hT,onChange:()=>{},measureElement:vT,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 f in n){const h=n[f];h!==void 0&&(o[f]=h)}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 f=i.count,h=o.count,g=this.getMeasurements(),x=f>0?((r=g[0])==null?void 0:r.key)??i.getItemKey(0):null,b=f>0?((s=g[f-1])==null?void 0:s.key)??i.getItemKey(f-1):null;if(h!==f||f>0&&h>0&&(o.getItemKey(0)!==x||o.getItemKey(h-1)!==b)){c=!0;const m=f>0?this.getVirtualItemForOffset(this.getScrollOffset())??g[0]:null;m&&(l=[m.key,this.getScrollOffset()-m.start]);const w=o.followOnAppend===!0?"auto":o.followOnAppend||null;w&&h>f&&this.isAtEnd(i.scrollEndThreshold)&&(f===0||o.getItemKey(h-1)!==b)&&(a=w)}}this.options=o,c&&(this.pendingMin=0,this.itemSizeCacheVersion++);let d=!1,u=0;if(l&&this.scrollOffset!==null){const[f,h]=l,g=this.getMeasurements(),{count:x,getItemKey:b}=this.options;let p=0;for(;p<x&&b(p)!==f;)p++;if(p<x){const y=g[p];if(y){const m=Math.max(0,y.start+h);m!==this.scrollOffset&&(u=m-this.scrollOffset,this.scrollOffset=m,d=!0)}}}(d||a)&&(this.pendingScrollAnchor=[d?l[0]:null,d?l[1]:0,a,u])},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=wo(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{if(i&&this._intendedScrollOffset===null&&o===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(o-this._intendedScrollOffset)<1.5&&(o=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const l=this.getScrollOffset();this.scrollDirection=i?l===o?this.scrollDirection:l<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const o=this.scrollElement,i=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},l=()=>{this._iosTouching=!1,!(!Rf()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};o.addEventListener("touchstart",i,Cu),o.addEventListener("touchend",l,Cu),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&&(Rf()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?a!==0&&(this._iosDeferredAdjustment+=a):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),l&&this.scrollToEnd({behavior:l})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;if(this._iosDeferredAdjustment<0&&n>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=wo(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,r,s,o,i,l,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==l&&(this.lanesChangedFlag=!0),this.prevLanes=l,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:l,laneAssignmentMode:a,gap:c}),{key:!1}),this.getMeasurements=wo(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:l,laneAssignmentMode:a,gap:c},d)=>{const u=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 f=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 y=this._flatMeasurements;if(!y||y.length<p){const k=new Float64Array(p);y&&f>0&&k.set(y.subarray(0,f*2)),y=k,this._flatMeasurements=y}let m;if(f===0)m=r+s;else{const k=f-1;m=y[k*2]+y[k*2+1]+c}for(let k=f;k<n;k++){const C=o(k),R=u.get(C),E=typeof R=="number"?R:this.options.estimateSize(k);y[k*2]=m,y[k*2+1]=E,m+=E+c}const w=cT(n,y,o);return this.measurementsCache=w,w}const h=this.measurementsCache.slice(0,f),g=new Array(l).fill(void 0),x=new Float64Array(l);let b=0;for(let p=0;p<f;p++){const y=h[p];y&&(g[y.lane]===void 0&&b++,g[y.lane]=p,x[y.lane]=y.end)}for(let p=f;p<n;p++){const y=o(p),m=this.laneAssignments.get(p);let w,k;const C=a==="estimate"||u.has(y);if(m!==void 0&&this.options.lanes>1){w=m;const _=g[w],j=_!==void 0?h[_]:void 0;k=j?j.end+c:r+s}else if(b===l){let _=0,j=x[0],D=g[0];for(let O=1;O<l;O++){const N=x[O];(N<j||N===j&&g[O]<D)&&(_=O,j=N,D=g[O])}w=_,k=j+c,C&&this.laneAssignments.set(p,w)}else w=p%this.options.lanes,k=r+s,C&&this.laneAssignments.set(p,w);const R=u.get(y),E=typeof R=="number"?R:this.options.estimateSize(p),M=k+E;h[p]={index:p,start:k,size:E,end:M,key:y,lane:w},g[w]===void 0&&b++,g[w]=p,x[w]=M}return this.measurementsCache=h,h},{key:!1,debug:()=>this.options.debug}),this.calculateRange=wo(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,o)=>n.length===0||r===0?(this.range=null,null):(this.range=ET(n,r,s,o,o===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=wo(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,o,i)=>o===null||i===null?[]:n({startIndex:o,endIndex:i,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),i=Math.max(0,s-o),l=Math.min(this.options.count-1,s+o);return n>=i&&n<=l}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((i,l)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(l))});return}const r=this.indexFromElement(n),s=this.options.getItemKey(r),o=this.elementsCache.get(s);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(s,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var s,o;if(n<0||n>=this.options.count)return;let i,l,a;const c=this._flatMeasurements;if(this.options.lanes===1&&c!==null)a=this.options.getItemKey(n),l=c[n*2],i=c[n*2+1];else{const f=this.measurementsCache[n];if(!f)return;a=f.key,l=f.start,i=f.size}const d=this.itemSizeCache.get(a)??i,u=r-d;if(u!==0){const f=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,h=f?this.getTotalSize():0,g=this.getScrollOffset()+this.scrollAdjustments,b=!this.itemSizeCache.has(a)?l<g:l+d<=g&&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},u,this):b);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(a,r),this.itemSizeCacheVersion++;let y=!1;f?y=this.applyScrollAdjustment(this.getTotalSize()-h):p&&(y=this.applyScrollAdjustment(u)),this.notify(y)}},this.getVirtualItems=wo(()=>[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=E1(0,r.length-1,o?l=>s[l*2]:l=>Sy(r[l]).start,n);return Sy(r[i])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,s=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=n>=i+o?"end":"start"),r==="center"?n+=(s-o)/2:r==="end"&&(n-=o);const l=this.getMaxScrollOffset();return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getSize(),o=this.getScrollOffset(),i=this.measurementsCache[n];if(!i)return;if(r==="auto")if(i.end>=o+s-this.options.scrollPaddingEnd)r="end";else if(i.start<=o+this.options.scrollPaddingStart)r="start";else return[o,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const l=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,r,i.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const o=this.getOffsetForAlignment(n,r),i=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:i,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getOffsetForIndex(n,r);if(!o)return;const[i,l]=o,a=this.now();this.scrollState={index:n,align:l,behavior:s,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+n,o=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:o,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const o=r.length-1,i=this._flatMeasurements;i!=null?s=i[o*2]+i[o*2+1]:s=((n=r[o])==null?void 0:n.end)??0}else{const o=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&o.some(l=>l===null);){const l=r[i];o[l.lane]===null&&(o[l.lane]=l.end),i--}s=Math.max(...o.filter(l=>l!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&n.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){return t===0?!1:Rf()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=t,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,o=1,i=s!==this.scrollState.lastTargetOffset;if(!i&&uT(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 E1=(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 ST(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 ET(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=ST(s,o,n);let d=c;const u=n+t;for(;d<o&&s[d*2]+s[d*2+1]<u;)d++;return{startIndex:c,endIndex:d}}let l=E1(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(u=>u<n+t);){const u=e[a];c[u.lane]=u.end,a++}const d=Array(r).fill(n+t);for(;l>=0&&d.some(u=>u>=n);){const u=e[l];d[u.lane]=u.start,l--}l=Math.max(0,l-l%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:l,endIndex:a}}const Nf=typeof document<"u"?S.useLayoutEffect:S.useEffect;function kT({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const s=S.useReducer(d=>d+1,0)[1],o=S.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});o.current.enabled=t,o.current.mode=n;const i=d=>{const u=o.current;if(!u.enabled||!u.container)return;const f=d.getTotalSize();if(f!==u.lastSize){u.lastSize=f;const h=d.options.horizontal?"width":"height";u.container.style[h]=`${f}px`}},l=d=>{const u=o.current;if(!u.enabled||!u.container)return;i(d);const f=!!d.options.horizontal,h=u.mode==="transform",g=f?"left":"top",x=d.options.scrollMargin,b=d.getVirtualItems();for(const p of b){const y=p.start-x,m=d.elementsCache.get(p.key);m&&u.lastPositions.get(m)!==y&&(u.lastPositions.set(m,y),h?m.style.transform=f?`translate3d(${y}px, 0, 0)`:`translate3d(0, ${y}px, 0)`:m.style[g]=`${y}px`)}},a={...r,onChange:(d,u)=>{var f;const h=o.current;let g=!0;if(h.enabled){l(d);const x=d.range,b=h.prevRange;g=!b||b.isScrolling!==d.isScrolling||b.startIndex!==(x==null?void 0:x.startIndex)||b.endIndex!==(x==null?void 0:x.endIndex),g&&(h.prevRange=x?{startIndex:x.startIndex,endIndex:x.endIndex,isScrolling:d.isScrolling}:null)}g&&(e&&u?Wt.flushSync(s):s()),(f=r.onChange)==null||f.call(r,d,u)}},[c]=S.useState(()=>{const d=new bT(a);return Object.assign(d,{containerRef:u=>{const f=o.current;if(f.container=u,f.lastSize=null,u&&f.enabled){const h=d.getTotalSize();f.lastSize=h;const g=d.options.horizontal?"width":"height";u.style[g]=`${h}px`}}})});return c.setOptions(a),Nf(()=>c._didMount(),[]),Nf(()=>(i(c),c._willUpdate())),Nf(()=>{l(c)}),c}function CT(e){return kT({observeElementRect:pT,observeElementOffset:yT,scrollToFn:wT,...e})}function RT(e){if(typeof e=="object"&&e!==null&&"durationMs"in e){const t=e.durationMs;if(typeof t=="number")return t}}function Gg(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 d;const o=[...s.phases,...s.logs],i=[...o,...s.terminal?[s.terminal]:[]].map(u=>u.at),l=i.length?i.reduce((u,f)=>f<u?f:u,Number.POSITIVE_INFINITY):void 0,c=RT((d=s.terminal)==null?void 0:d.data)??(s.terminal&&l!==void 0&&o.length>0?s.terminal.at-l:void 0);return{...s,startedAt:l,durationMs:c}}),stepLogs:n}}const k1={kind:"all"},gd="unknown";function zi(e){const t=e==null?void 0:e.trim();return t||void 0}function NT(e){return zi(e)===void 0}function ba(e){const t=zi(e);if(t===void 0)return gd;const n=t.lastIndexOf("/");return n===-1?t:t.slice(n+1)||t}function PT(e,t){return e.kind!==t.kind?!1:e.kind==="origin"&&t.kind==="origin"?e.origin===t.origin:!0}function C1(e){return e.kind==="origin"?`origin:${e.origin}`:e.kind}function TT(e,t){if(t.kind==="all")return!0;const n=zi(e.origin);return t.kind==="unknown"?n===void 0:n===t.origin}function MT(e,t){return t.kind==="all"?[...e]:e.filter(n=>TT(n,t))}const Zg="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 IT(e){const t=new Map;let n=0;for(const s of e){const o=zi(s.origin);if(o===void 0){n+=1;continue}t.set(o,(t.get(o)??0)+1)}const r=[{filter:k1,label:"all",title:"Every origin, including runs that have none",count:e.length}];for(const s of[...t.keys()].sort())r.push({filter:{kind:"origin",origin:s},label:ba(s),title:s,count:t.get(s)??0});return n>0&&r.push({filter:{kind:"unknown"},label:gd,title:Zg,count:n}),r}function _T(e){return e.reduce((t,n)=>t+(NT(n.origin)?1:0),0)}function OT(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 ${ba(e.origin.origin)} match these filters.`,unclassified:e.unknownCount}:{message:"No runs match these filters."}:{message:"No runs yet."}}const ky="compensate:";function AT(e){return e.startsWith(ky)?e.slice(ky.length):e}function jT(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 zT(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 LT=10*60*1e3;function DT(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>LT}const FT=new Set(["running","suspended","cancelling"]);function pp(e){const t=e.lastIndexOf("@");return t===-1?e:e.slice(0,t)}function Pf(e,t){const n=pp(e),r=t.filter(i=>pp(i.group)===n),s=r.some(i=>i.depth>0),o=r.some(i=>i.liveWorkers.length>0);return s&&!o}function $T(e){return e.startsWith("wh:")?`webhook ${e}`:e.startsWith("child:")?`child ${e.slice(6)}`:`signal ${e}`}function BT(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 FT.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 HT(e){return`${e.on} ${e.name}`}function Jg(e,t){var s;if(e.status!=="suspended")return e.status==="pending"&&Pf(e.workflow,t.health)?{status:"no-worker",detail:e.workflow}:e.status==="blocked"?{status:"no-worker",detail:e.workflow}:{status:e.status};const n=BT(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:$T(r.name)}:r.kind==="sleep"?{status:"sleeping"}:r.workerGroup&&Pf(r.workerGroup,t.health)?{status:"no-worker",detail:pp(r.workerGroup)}:{status:"running"}:e.waiting?{status:"awaiting",detail:HT(e.waiting)}:Pf(e.workflow,t.health)?{status:"no-worker",detail:e.workflow}:{status:"running"}}function VT(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 R1(){return typeof window<"u"&&typeof window.__DURABLE_BASE__=="string"?window.__DURABLE_BASE__:"/durable"}function N1(){return typeof window<"u"&&typeof window.__DURABLE_API__=="string"?window.__DURABLE_API__:`${R1()}/api`}async function WT(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 UT(e){if(typeof window>"u")return;const t=R1();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 zn(e,t){const n=await fetch(N1()+e,t);if(n.status===401)throw UT(await WT(n)),new Error("Session expired; redirecting to sign-in.");if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return await n.json()}const Ye={async runs(e,t,n,r){const{runs:s}=await Ye.runsPage(e,t,n,r);return s},async runsPage(e,t,n,r,s){const o=new URLSearchParams;e&&o.set("status",e),t&&o.set("tag",t);for(const a of n??[])o.append("attr",a);r!=null&&r.namespace&&o.set("namespace",r.namespace),r!=null&&r.origin&&o.set("origin",r.origin),(s==null?void 0:s.limit)!==void 0&&o.set("limit",String(s.limit)),(s==null?void 0:s.offset)!==void 0&&o.set("offset",String(s.offset));const i=o.toString(),l=await zn(i?`/runs?${i}`:"/runs");return{runs:l.runs,page:l.page}},run(e){return zn(`/runs/${encodeURIComponent(e)}`)},workers(){return zn("/workers")},topology(){return zn("/topology")},async retry(e){return(await zn(`/runs/${encodeURIComponent(e)}/retry`,{method:"POST"})).result},async retryWithInput(e,t){return(await zn(`/runs/${encodeURIComponent(e)}/retry-with-input`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:t})})).result},bulk(e,t){const n=new URLSearchParams;t.status&&n.set("status",t.status),t.tag&&n.set("tag",t.tag);for(const s of t.attr??[])n.append("attr",s);t.namespace&&n.set("namespace",t.namespace),t.origin&&n.set("origin",t.origin);const r=n.toString();return zn(`/bulk/${e}${r?`?${r}`:""}`,{method:"POST"})},async cancel(e,t){const n=t!=null&&t.compensate?"?compensate=true":"";return(await zn(`/runs/${encodeURIComponent(e)}/cancel${n}`,{method:"POST"})).result},async continue(e){return(await zn(`/runs/${encodeURIComponent(e)}/continue`,{method:"POST"})).result},async redispatch(e){return(await zn(`/runs/${encodeURIComponent(e)}/redispatch`,{method:"POST"})).result},streamRun(e,t){const n=new EventSource(`${N1()}/runs/${encodeURIComponent(e)}/stream`);return n.onmessage=r=>{try{t(JSON.parse(r.data))}catch{}},()=>n.close()}};function Ru(e){const t=e.lastIndexOf("@");return t===-1?"default":e.slice(t+1)}function gp(e){const t=e.lastIndexOf("@");return t===-1?e:e.slice(0,t)}function KT(e){const t=new Map;for(const r of e){const s=Ru(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 qT(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 YT(e){var n,r;const t=new Map;for(const s of e)for(const o of s.liveWorkers){const i=gp(o.group),l=t.get(o.instanceId);if(l===void 0){t.set(o.instanceId,{instanceId:o.instanceId,partition:Ru(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=Ru(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 QT(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(gp(o.group)):o.kind==="step"&&r.add(gp(o.group))}const s=e.filter(o=>o.depth>0&&o.liveWorkers.length===0).sort((o,i)=>i.depth-o.depth);return{queueCount:e.length,workflowCount:n.size,stepCount:r.size,workerCount:t.size,starved:s,allDraining:s.length===0}}function P1(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=P1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function T1(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=P1(e))&&(r&&(r+=" "),r+=t);return r}const Cy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ry=T1,M1=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Ry(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 d=n==null?void 0:n[c],u=o==null?void 0:o[c];if(d===null)return null;const f=Cy(d)||Cy(u);return s[c][f]}),l=n&&Object.entries(n).reduce((c,d)=>{let[u,f]=d;return f===void 0||(c[u]=f),c},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:u,className:f,...h}=d;return Object.entries(h).every(g=>{let[x,b]=g;return Array.isArray(b)?b.includes({...o,...l}[x]):{...o,...l}[x]===b})?[...c,u,f]:c},[]);return Ry(e,i,a,n==null?void 0:n.class,n==null?void 0:n.className)},XT=(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},GT=(e,t)=>({classGroupId:e,validator:t}),I1=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Nu="-",Ny=[],ZT="arbitrary..",JT=e=>{const t=tM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return eM(i);const l=i.split(Nu),a=l[0]===""&&l.length>1?1:0;return _1(l,a,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const a=r[i],c=n[i];return a?c?XT(c,a):a:c||Ny}return n[i]||Ny}}},_1=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const c=_1(e,t+1,o);if(c)return c}const i=n.validators;if(i===null)return;const l=t===0?e.join(Nu):e.slice(t).join(Nu),a=i.length;for(let c=0;c<a;c++){const d=i[c];if(d.validator(l))return d.classGroupId}},eM=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?ZT+r:void 0})(),tM=e=>{const{theme:t,classGroups:n}=e;return nM(n,t)},nM=(e,t)=>{const n=I1();for(const r in e){const s=e[r];em(s,n,r,t)}return n},em=(e,t,n,r)=>{const s=e.length;for(let o=0;o<s;o++){const i=e[o];rM(i,t,n,r)}},rM=(e,t,n,r)=>{if(typeof e=="string"){sM(e,t,n);return}if(typeof e=="function"){oM(e,t,n,r);return}iM(e,t,n,r)},sM=(e,t,n)=>{const r=e===""?t:O1(t,e);r.classGroupId=n},oM=(e,t,n,r)=>{if(lM(e)){em(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(GT(n,e))},iM=(e,t,n,r)=>{const s=Object.entries(e),o=s.length;for(let i=0;i<o;i++){const[l,a]=s[i];em(a,O1(t,l),n,r)}},O1=(e,t)=>{let n=e;const r=t.split(Nu),s=r.length;for(let o=0;o<s;o++){const i=r[o];let l=n.nextPart.get(i);l||(l=I1(),n.nextPart.set(i,l)),n=l}return n},lM=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,aM=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)}}},mp="!",Py=":",cM=[],Ty=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),uM=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const o=[];let i=0,l=0,a=0,c;const d=s.length;for(let x=0;x<d;x++){const b=s[x];if(i===0&&l===0){if(b===Py){o.push(s.slice(a,x)),a=x+1;continue}if(b==="/"){c=x;continue}}b==="["?i++:b==="]"?i--:b==="("?l++:b===")"&&l--}const u=o.length===0?s:s.slice(a);let f=u,h=!1;u.endsWith(mp)?(f=u.slice(0,-1),h=!0):u.startsWith(mp)&&(f=u.slice(1),h=!0);const g=c&&c>a?c-a:void 0;return Ty(o,h,f,g)};if(t){const s=t+Py,o=r;r=i=>i.startsWith(s)?o(i.slice(s.length)):Ty(cM,!1,i,void 0,!0)}if(n){const s=r;r=o=>n({className:o,parseClassName:s})}return r},dM=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}},fM=e=>({cache:aM(e.cacheSize),parseClassName:uM(e),sortModifiers:dM(e),postfixLookupClassGroupIds:hM(e),...JT(e)}),hM=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},pM=/\s+/,gM=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o,postfixLookupClassGroupIds:i}=t,l=[],a=e.trim().split(pM);let c="";for(let d=a.length-1;d>=0;d-=1){const u=a[d],{isExternal:f,modifiers:h,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:b}=n(u);if(f){c=u+(c.length>0?" "+c:c);continue}let p=!!b,y;if(p){const R=x.substring(0,b);y=r(R);const E=y&&i[y]?r(x):void 0;E&&E!==y&&(y=E,p=!1)}else y=r(x);if(!y){if(!p){c=u+(c.length>0?" "+c:c);continue}if(y=r(x),!y){c=u+(c.length>0?" "+c:c);continue}p=!1}const m=h.length===0?"":h.length===1?h[0]:o(h).join(":"),w=g?m+mp:m,k=w+y;if(l.indexOf(k)>-1)continue;l.push(k);const C=s(y,p);for(let R=0;R<C.length;++R){const E=C[R];l.push(w+E)}c=u+(c.length>0?" "+c:c)}return c},mM=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=A1(n))&&(s&&(s+=" "),s+=r);return s},A1=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=A1(e[r]))&&(n&&(n+=" "),n+=t);return n},yM=(e,...t)=>{let n,r,s,o;const i=a=>{const c=t.reduce((d,u)=>u(d),e());return n=fM(c),r=n.cache.get,s=n.cache.set,o=l,l(a)},l=a=>{const c=r(a);if(c)return c;const d=gM(a,n);return s(a,d),d};return o=i,(...a)=>o(mM(...a))},vM=[],rt=e=>{const t=n=>n[e]||vM;return t.isThemeGetter=!0,t},j1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,z1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xM=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,wM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bM=/\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$/,SM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,EM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Tr=e=>xM.test(e),xe=e=>!!e&&!Number.isNaN(Number(e)),Ln=e=>!!e&&Number.isInteger(Number(e)),Tf=e=>e.endsWith("%")&&xe(e.slice(0,-1)),Gn=e=>wM.test(e),L1=()=>!0,CM=e=>bM.test(e)&&!SM.test(e),tm=()=>!1,RM=e=>EM.test(e),NM=e=>kM.test(e),PM=e=>!ie(e)&&!le(e),TM=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)),MM=e=>vs(e,$1,tm),ie=e=>j1.test(e),Ss=e=>vs(e,B1,CM),My=e=>vs(e,DM,xe),IM=e=>vs(e,V1,L1),_M=e=>vs(e,H1,tm),Iy=e=>vs(e,D1,tm),OM=e=>vs(e,F1,NM),cc=e=>vs(e,W1,RM),le=e=>z1.test(e),sl=e=>go(e,B1),AM=e=>go(e,H1),_y=e=>go(e,D1),jM=e=>go(e,$1),zM=e=>go(e,F1),uc=e=>go(e,W1,!0),LM=e=>go(e,V1,!0),vs=(e,t,n)=>{const r=j1.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},go=(e,t,n=!1)=>{const r=z1.exec(e);return r?r[1]?t(r[1]):n:!1},D1=e=>e==="position"||e==="percentage",F1=e=>e==="image"||e==="url",$1=e=>e==="length"||e==="size"||e==="bg-size",B1=e=>e==="length",DM=e=>e==="number",H1=e=>e==="family-name",V1=e=>e==="number"||e==="weight",W1=e=>e==="shadow",FM=()=>{const e=rt("color"),t=rt("font"),n=rt("text"),r=rt("font-weight"),s=rt("tracking"),o=rt("leading"),i=rt("breakpoint"),l=rt("container"),a=rt("spacing"),c=rt("radius"),d=rt("shadow"),u=rt("inset-shadow"),f=rt("text-shadow"),h=rt("drop-shadow"),g=rt("blur"),x=rt("perspective"),b=rt("aspect"),p=rt("ease"),y=rt("animate"),m=()=>["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"],k=()=>[...w(),le,ie],C=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],E=()=>[le,ie,a],M=()=>[Tr,"full","auto",...E()],_=()=>[Ln,"none","subgrid",le,ie],j=()=>["auto",{span:["full",Ln,le,ie]},Ln,le,ie],D=()=>[Ln,"auto",le,ie],O=()=>["auto","min","max","fr",le,ie],N=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],T=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...E()],F=()=>[Tr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],P=()=>[Tr,"screen","full","dvw","lvw","svw","min","max","fit",...E()],I=()=>[Tr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...E()],A=()=>[e,le,ie],B=()=>[...w(),_y,Iy,{position:[le,ie]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",jM,MM,{size:[le,ie]}],q=()=>[Tf,sl,Ss],K=()=>["","none","full",c,le,ie],X=()=>["",xe,sl,Ss],G=()=>["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=()=>[xe,Tf,_y,Iy],te=()=>["","none",g,le,ie],V=()=>["none",xe,le,ie],Z=()=>["none",xe,le,ie],Q=()=>[xe,le,ie],ce=()=>[Tr,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Gn],breakpoint:[Gn],color:[L1],container:[Gn],"drop-shadow":[Gn],ease:["in","out","in-out"],font:[PM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Gn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Gn],shadow:[Gn],spacing:["px",xe],text:[Gn],"text-shadow":[Gn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Tr,ie,le,b]}],container:["container"],"container-type":[{"@container":["","normal","size",le,ie]}],"container-named":[TM],columns:[{columns:[xe,ie,le,l]}],"break-after":[{"break-after":m()}],"break-before":[{"break-before":m()}],"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:k()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[Ln,"auto",le,ie]}],basis:[{basis:[Tr,"full","auto",l,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[xe,Tr,"auto","initial","none",ie]}],grow:[{grow:["",xe,le,ie]}],shrink:[{shrink:["",xe,le,ie]}],order:[{order:[Ln,"first","last","none",le,ie]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...N(),"normal"]}],"justify-items":[{"justify-items":[...T(),"normal"]}],"justify-self":[{"justify-self":["auto",...T()]}],"align-content":[{content:["normal",...N()]}],"align-items":[{items:[...T(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...T(),{baseline:["","last"]}]}],"place-content":[{"place-content":N()}],"place-items":[{"place-items":[...T(),"baseline"]}],"place-self":[{"place-self":["auto",...T()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pbs:[{pbs:E()}],pbe:[{pbe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...P()]}],"min-inline-size":[{"min-inline":["auto",...P()]}],"max-inline-size":[{"max-inline":["none",...P()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[l,"screen",...F()]}],"min-w":[{"min-w":[l,"screen","none",...F()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",n,sl,Ss]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,LM,IM]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Tf,ie]}],"font-family":[{font:[AM,_M,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":[xe,"none",le,My]}],leading:[{leading:[o,...E()]}],"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:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[xe,"from-font","auto",le,Ss]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[xe,"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:E()}],"tab-size":[{tab:[Ln,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:B()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ln,le,ie],radial:["",le,ie],conic:[Ln,le,ie]},zM,OM]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-bs":[{"border-bs":X()}],"border-w-be":[{"border-be":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[xe,le,ie]}],"outline-w":[{outline:["",xe,sl,Ss]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",d,uc,cc]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",u,uc,cc]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[xe,Ss]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",f,uc,cc]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[xe,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":[xe]}],"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":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"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":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"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":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"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":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"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":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"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":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"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":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"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":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"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":[xe]}],"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":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",le,ie]}],filter:[{filter:["","none",le,ie]}],blur:[{blur:te()}],brightness:[{brightness:[xe,le,ie]}],contrast:[{contrast:[xe,le,ie]}],"drop-shadow":[{"drop-shadow":["","none",h,uc,cc]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",xe,le,ie]}],"hue-rotate":[{"hue-rotate":[xe,le,ie]}],invert:[{invert:["",xe,le,ie]}],saturate:[{saturate:[xe,le,ie]}],sepia:[{sepia:["",xe,le,ie]}],"backdrop-filter":[{"backdrop-filter":["","none",le,ie]}],"backdrop-blur":[{"backdrop-blur":te()}],"backdrop-brightness":[{"backdrop-brightness":[xe,le,ie]}],"backdrop-contrast":[{"backdrop-contrast":[xe,le,ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",xe,le,ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xe,le,ie]}],"backdrop-invert":[{"backdrop-invert":["",xe,le,ie]}],"backdrop-opacity":[{"backdrop-opacity":[xe,le,ie]}],"backdrop-saturate":[{"backdrop-saturate":[xe,le,ie]}],"backdrop-sepia":[{"backdrop-sepia":["",xe,le,ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"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:[xe,"initial",le,ie]}],ease:[{ease:["linear","initial",p,le,ie]}],delay:[{delay:[xe,le,ie]}],animate:[{animate:["none",y,le,ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,le,ie]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:V()}],"rotate-x":[{"rotate-x":V()}],"rotate-y":[{"rotate-y":V()}],"rotate-z":[{"rotate-z":V()}],scale:[{scale:Z()}],"scale-x":[{"scale-x":Z()}],"scale-y":[{"scale-y":Z()}],"scale-z":[{"scale-z":Z()}],"scale-3d":["scale-3d"],skew:[{skew:Q()}],"skew-x":[{"skew-x":Q()}],"skew-y":[{"skew-y":Q()}],transform:[{transform:[le,ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ce()}],"translate-x":[{"translate-x":ce()}],"translate-y":[{"translate-y":ce()}],"translate-z":[{"translate-z":ce()}],"translate-none":["translate-none"],zoom:[{zoom:[Ln,le,ie]}],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"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":A()}],"scrollbar-track-color":[{"scrollbar-track":A()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mbs":[{"scroll-mbs":E()}],"scroll-mbe":[{"scroll-mbe":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pbs":[{"scroll-pbs":E()}],"scroll-pbe":[{"scroll-pbe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",...A()]}],"stroke-w":[{stroke:[xe,sl,Ss,My]}],stroke:[{stroke:["none",...A()]}],"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"]}},$M=yM(FM);function dt(...e){return $M(T1(e))}const BM=M1("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"}}),Fe=S.forwardRef(({className:e,variant:t,size:n,type:r,...s},o)=>v.jsx("button",{ref:o,type:r??"button",className:dt(BM({variant:t,size:n}),e),...s}));Fe.displayName="Button";function HM({runs:e,value:t,onChange:n}){const r=IT(e);return r.length<=1?null:v.jsxs("div",{className:"flex flex-wrap items-center gap-1 border-b border-line px-2 py-1.5",children:[v.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-[0.18em] text-zinc-600",children:"origin"}),r.map(s=>{const o=PT(t,s.filter);return v.jsxs(Fe,{variant:"ghost",size:"chip","aria-pressed":o,title:s.title,onClick:()=>n(s.filter),className:dt("mono max-w-full gap-1 rounded-md",s.filter.kind==="unknown"&&"italic text-zinc-500",o&&"border-zinc-600 bg-zinc-900 text-zinc-100 hover:text-zinc-100"),children:[v.jsx("span",{className:"truncate",children:s.label}),v.jsx("span",{className:"tnum shrink-0 text-zinc-600",children:s.count})]},C1(s.filter))})]})}function VM(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 WM(e){const t=VM(e.map(n=>n.name));return`${t.length>=2?t:"parallel"} ×${e.length}`}function U1(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:WM(i)}),n=l}return t}function ro(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 _n={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round"};function K1(e){return v.jsxs("svg",{..._n,...e,"aria-hidden":"true",children:[v.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"1.5"}),v.jsx("path",{d:"M9 3v2M15 3v2M9 19v2M15 19v2M3 9h2M3 15h2M19 9h2M19 15h2"})]})}function UM(e){return v.jsxs("svg",{..._n,...e,"aria-hidden":"true",children:[v.jsx("circle",{cx:"12",cy:"12",r:"9"}),v.jsx("path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"})]})}function KM(e){return v.jsxs("svg",{..._n,...e,"aria-hidden":"true",children:[v.jsx("circle",{cx:"12",cy:"13",r:"8"}),v.jsx("path",{d:"M12 13V9M9 2h6"})]})}function qM(e){return v.jsxs("svg",{..._n,...e,"aria-hidden":"true",children:[v.jsx("circle",{cx:"12",cy:"12",r:"2"}),v.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 q1(e){return v.jsx("svg",{..._n,...e,"aria-hidden":"true",children:v.jsx("path",{d:"m4 12 5 5L20 6"})})}function Li(e){return v.jsx("svg",{..._n,...e,"aria-hidden":"true",children:v.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function YM(e){return v.jsxs("svg",{..._n,...e,"aria-hidden":"true",children:[v.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),v.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h8"})]})}function Mf(e){return v.jsx("svg",{..._n,...e,"aria-hidden":"true",children:v.jsx("path",{d:"M21 12a9 9 0 1 1-2.6-6.3M21 4v5h-5"})})}function nm(e){return v.jsx("svg",{..._n,...e,"aria-hidden":"true",children:v.jsx("path",{d:"M13 2 4 14h7l-1 8 9-12h-7l1-8z"})})}function QM(e){return v.jsx("svg",{..._n,...e,"aria-hidden":"true",children:v.jsx("path",{d:"M6 4l14 8-14 8z"})})}function rm(e){return v.jsxs("svg",{..._n,...e,"aria-hidden":"true",children:[v.jsx("circle",{cx:"6",cy:"5",r:"2"}),v.jsx("path",{d:"M6 7v6a4 4 0 004 4h4"}),v.jsx("circle",{cx:"18",cy:"17",r:"2"})]})}const XM={local:K1,remote:UM,sleep:KM,signal:qM,child:rm};function sm(e){return XM[e]??K1}const yp={local:"In-process step",remote:"Remote worker step",sleep:"Durable timer",signal:"External signal",child:"Child workflow — click to open its run"},GM=9e4;function ZM(e,t,n){var o;const r=((t==null?void 0:t.liveWorkers)??[]).filter(i=>n-i.lastBeatAt<=GM).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 JM(e){const t=S.useMemo(()=>{const s=new Set;for(const o of e){const i=ro(o);i!==void 0&&s.add(i)}return[...s].sort()},[e]),n=xw({queries:t.map(s=>({queryKey:["run",s],queryFn:()=>Ye.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 eI(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}=Gg(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 vp(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}const tI={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"},nI={ok:"bg-emerald-400",failed:"bg-red-400",skipped:"bg-amber-400"};function Y1({row:e,run:t,childRuns:n,depth:r,selectedKey:s,onSelect:o,onOpenRun:i,onToggleChild:l,expanded:a,collapsedSubs:c,toggleSubs:d}){var j;const{step:u,left:f,width:h,ms:g,subRows:x}=e,b=u.status==="failed",p=ro(u),y=!!p,m=y?rm:sm(u.kind),w=s===`${u.runId}#${u.seq}`,k=y&&p!==void 0&&a.has(p),C=x.length>0&&!y,R=c.has(u.seq),E=DT(u,Date.now()),{data:M}=Un({queryKey:["workers"],queryFn:()=>Ye.workers(),refetchInterval:1e4,enabled:E}),_=E?ZM(u,M==null?void 0:M.find(D=>D.group===u.workerGroup),Date.now()):void 0;return v.jsxs("div",{children:[v.jsxs("button",{type:"button",onClick:()=>o(u,t),title:y?"Child workflow — click for its detail (↗ opens its run)":void 0,className:`group grid w-full grid-cols-[150px_1fr] items-center gap-3 rounded-md px-2 py-1 text-left transition-colors ${w?"bg-zinc-800/60":"hover:bg-zinc-900/60"}`,children:[v.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[y&&p!==void 0&&v.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),l(p)},className:"shrink-0 text-indigo-400 hover:text-indigo-200 transition-colors",title:k?"Collapse child run":"Expand child run inline",children:v.jsx("span",{className:"inline-block transition-transform",style:{transform:k?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),C&&v.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),d(u.seq)},className:"shrink-0 text-zinc-500 transition-colors hover:text-zinc-300",title:R?`Show ${x.length} sub-process(es)`:"Hide sub-processes",children:v.jsx("span",{className:"inline-block transition-transform",style:{transform:R?"rotate(0deg)":"rotate(90deg)"},children:"▸"})}),v.jsx("span",{className:b?"text-red-400":y?"text-indigo-300":"text-emerald-400",children:v.jsx(m,{width:12,height:12})}),v.jsx("span",{className:"truncate text-[12px] text-zinc-300",children:p!==void 0?((j=n[p])==null?void 0:j.run.workflow)??"child workflow":u.name}),y&&p!==void 0&&v.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),i(p)},title:"Open the child run",className:"shrink-0 text-indigo-300 transition-colors hover:text-indigo-100",children:"↗"})]}),v.jsxs("span",{className:"relative h-5",children:[v.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft"}),v.jsx("span",{className:`absolute top-1/2 flex h-3.5 -translate-y-1/2 items-center rounded-[3px] transition-all duration-500 ease-out ${b?"bg-red-500/35 ring-1 ring-red-500/50":w?"bg-emerald-400/45 ring-1 ring-emerald-400/60":"bg-emerald-500/30 ring-1 ring-emerald-500/40"}`,style:{left:`${f}%`,width:`${h}%`}}),v.jsx("span",{className:"mono tnum absolute top-1/2 -translate-y-1/2 whitespace-nowrap pl-1 text-[10px] text-zinc-500",style:{left:`min(${f+h}%, calc(100% - 44px))`},children:vp(g)})]})]}),(_==null?void 0:_.kind)==="working"&&v.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:[v.jsx("span",{"aria-hidden":!0,children:"⚙"}),"being worked by ",_.instanceId," — heartbeat ",_.beatAgoS,"s ago",_.inFlight!==void 0?` · ${_.inFlight} in flight`:""]}),(_==null?void 0:_.kind)==="lost"&&v.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:[v.jsx("span",{"aria-hidden":!0,children:"⚠"}),"awaiting worker result — dispatched ",_.minutes,"m ago, no live worker (possibly lost)"]}),x.length>0&&!R&&v.jsx("div",{className:"ml-[18px] mt-0.5 mb-1 space-y-0.5 border-l border-line-soft pl-2",children:x.map(D=>v.jsxs("div",{className:"grid grid-cols-[130px_1fr] items-center gap-3 px-2",title:`${D.name} — ${D.status}`,children:[v.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[v.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${nI[D.status]}`}),v.jsx("span",{className:"truncate text-[10px] text-zinc-400",children:D.name})]}),v.jsxs("span",{className:"relative h-3",children:[v.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft"}),v.jsx("span",{className:`absolute top-1/2 h-2 -translate-y-1/2 rounded-[2px] transition-all duration-500 ease-out ${tI[D.status]}`,style:{left:`${D.left}%`,width:`${D.width}%`}}),v.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(${D.left+D.width}%, calc(100% - 38px))`},children:vp(D.ms)})]})]},D.key))}),y&&p!==void 0&&k&&v.jsx("div",{className:"ml-[18px] mt-0.5 mb-1 border-l border-line-soft pl-2",children:v.jsx(sI,{id:p,depth:r+1,selectedKey:s,onSelect:o,onOpenRun:i,expanded:a,onToggleChild:l})})]})}function rI({label:e,fanFailed:t,memberRows:n,rowProps:r}){return v.jsxs("div",{className:"rounded-md bg-zinc-900/30 ring-1 ring-line-soft",children:[v.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[v.jsx("span",{className:"text-[11px] text-indigo-300/80",title:"parallel fan-out (ctx.gather / ctx.all)",children:"⑃"}),v.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.15em] text-zinc-500",children:"parallel"}),v.jsx("span",{className:`text-[11px] ${t?"text-red-400":"text-zinc-300"}`,children:e})]}),v.jsx("div",{className:"ml-[10px] border-l border-line-soft pl-1",children:n.map(s=>v.jsx(Y1,{row:s,...r},s.step.seq))})]})}function om({run:e,timeline:t,depth:n,selectedKey:r,onSelect:s,onOpenRun:o,expanded:i,onToggleChild:l}){const a=JM(t),{span:c,rows:d}=S.useMemo(()=>{const p=e.status==="running"||e.status==="suspended",y=Date.now(),m=t.map(E=>{const M=ro(E),_=M!==void 0?a[M]:void 0,[j,D]=eI(E,_,y);return{step:E,childId:M,childRun:_,barStart:j,barEnd:D}}),w=Math.min(new Date(e.createdAt).getTime(),...m.map(E=>E.barStart)),k=Math.max(...m.map(E=>E.barEnd),p?y:w+1),C=Math.max(k-w,1),R=m.map(({step:E,childId:M,childRun:_,barStart:j,barEnd:D})=>{const{subs:O}=Gg(E.events??[]),N=O.map(T=>{var P;const z=T.startedAt??j,F=((P=T.terminal)==null?void 0:P.at)??z;return{key:T.id,name:T.name,status:T.status??"ok",left:(z-w)/C*100,width:Math.max((F-z)/C*100,.8),ms:T.durationMs??Math.max(F-z,0)}});return{step:E,childId:M,childRun:_,left:(j-w)/C*100,width:Math.max((D-j)/C*100,.8),ms:D-j,subRows:N}});return{span:C,rows:R}},[e,t,a]),u=S.useMemo(()=>U1(t),[t]),f=S.useMemo(()=>{const p=new Map;for(const y of d)p.set(y.step.seq,y);return p},[d]),[h,g]=S.useState(new Set),b={run:e,childRuns:a,depth:n,selectedKey:r,onSelect:s,onOpenRun:o,onToggleChild:l,expanded:i,collapsedSubs:h,toggleSubs:p=>g(y=>{const m=new Set(y);return m.has(p)?m.delete(p):m.add(p),m})};return v.jsx(v.Fragment,{children:u.map(p=>{if(p.kind==="single"){const m=f.get(p.step.seq);return m?v.jsx(Y1,{row:m,...b},m.step.seq):null}const y=p.steps.map(m=>f.get(m.seq)).filter(m=>m!==void 0);return v.jsx(rI,{label:p.label,fanFailed:p.steps.some(m=>m.status==="failed"),memberRows:y,rowProps:b},`fan:${p.group}`)})})}function sI({id:e,depth:t,selectedKey:n,onSelect:r,onOpenRun:s,expanded:o,onToggleChild:i}){const{data:l}=Un({queryKey:["run",e],queryFn:()=>Ye.run(e)});return t>6?null:l?v.jsxs("div",{className:"my-1 rounded-md border border-line bg-black/15",children:[v.jsxs("div",{className:"mono flex items-center gap-2 px-2 py-1 text-[10px] text-zinc-500",children:[v.jsxs("span",{className:"text-indigo-300",children:["⌁ ",l.run.workflow]}),v.jsx("span",{className:"tnum text-zinc-600",children:e.slice(0,8)}),v.jsx("span",{className:`s-${l.run.status} uppercase`,children:l.run.status}),v.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 ↗"})]}),v.jsx(om,{run:l.run,timeline:l.timeline,depth:t,selectedKey:n,onSelect:r,onOpenRun:s,expanded:o,onToggleChild:i})]}):v.jsx("div",{className:"mono px-2 py-1 text-[10px] text-zinc-600",children:"loading child run…"})}function oI({run:e,timeline:t,selectedKey:n,onSelect:r,onOpenRun:s,expanded:o,onToggleChild:i}){const l=S.useMemo(()=>{const d=t.map(x=>new Date(x.startedAt).getTime()),u=t.map(x=>new Date(x.finishedAt).getTime()),f=Math.min(new Date(e.createdAt).getTime(),...d),h=e.status==="running"||e.status==="suspended",g=Math.max(...u,h?Date.now():f+1);return Math.max(g-f,1)},[e,t]),a=o??new Set,c=i??(()=>{});return v.jsxs("div",{className:"flex h-full flex-col",children:[v.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 pt-3",children:[v.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.2em] text-zinc-500",children:"spans"}),v.jsxs("span",{className:"mono tnum text-[10px] text-zinc-600",children:["total ",vp(l)]})]}),v.jsx("div",{className:"min-h-0 flex-1 space-y-1 overflow-auto px-3 pb-3",children:v.jsx(om,{run:e,timeline:t,depth:0,selectedKey:n,onSelect:r,onOpenRun:s,expanded:a,onToggleChild:c})})]})}function Pu(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}function Oy(e,t){return Pu(new Date(t).getTime()-new Date(e).getTime())}function Ay(e){return im(new Date(e).getTime())}function im(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}const Q1={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"},iI={debug:"text-zinc-500",info:"text-zinc-300",warn:"text-amber-300",error:"text-red-300"},lI=["ok","failed","skipped"];function X1({e}){return v.jsxs("div",{className:"flex gap-2 py-0.5",children:[v.jsx("span",{className:"shrink-0 text-zinc-600 tnum",children:im(e.at)}),v.jsx("span",{className:`shrink-0 uppercase ${iI[e.level]}`,children:e.level}),v.jsx("span",{className:"min-w-0 break-words text-zinc-300",children:e.message})]})}function jy({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?Q1[e.status]:"border-amber-500/25 bg-amber-500/10 text-amber-300";return v.jsxs("li",{className:`rounded-md border ${i}`,children:[v.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:[v.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[r&&v.jsx("span",{className:`text-[9px] text-zinc-500 transition-transform duration-150 ${s?"":"-rotate-90"}`,children:"▼"}),v.jsx("span",{className:"mono truncate text-zinc-200",children:e.name}),t&&e.group&&v.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-wider text-zinc-500",children:e.group})]}),v.jsxs("span",{className:"mono flex shrink-0 items-center gap-2 text-[10px] uppercase tracking-wider",children:[e.durationMs!==void 0&&v.jsx("span",{className:"tnum text-zinc-400",children:Pu(e.durationMs)}),v.jsx("span",{children:e.status??"running"})]})]}),s&&v.jsxs("div",{className:"border-t border-line/60 px-2.5 py-2",children:[e.phases.length>0&&v.jsx("ul",{className:"mono mb-2 flex flex-col gap-0.5 text-[10.5px]",children:e.phases.map((c,d)=>v.jsxs("li",{className:"flex gap-2",children:[v.jsx("span",{className:"shrink-0 text-zinc-600 tnum",children:im(c.at)}),v.jsx("span",{className:"text-zinc-400",children:c.phase}),e.startedAt!==void 0&&v.jsxs("span",{className:"text-zinc-600 tnum",children:["+",Pu(c.at-e.startedAt)]})]},`${c.at}-${c.phase}-${d}`))}),((a=e.terminal)==null?void 0:a.message)&&e.terminal.message!==e.name&&v.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&&v.jsx("div",{className:"mono flex flex-col gap-0.5 text-[11px]",children:e.logs.map((c,d)=>v.jsx(X1,{e:c},`${c.at}-${d}`))})]})]})}function aI({events:e}){const{subs:t,stepLogs:n}=Gg(e),r=lI.map(o=>[o,t.filter(i=>i.status===o).length]).filter(([,o])=>o>0),s=t.some(o=>o.group);return v.jsxs(v.Fragment,{children:[t.length>0&&v.jsxs("section",{className:"rise",children:[v.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[v.jsxs("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:["sub-processes · ",t.length]}),v.jsx("span",{className:"mono flex gap-2 text-[10px] uppercase tracking-wider",children:r.map(([o,i])=>v.jsxs("span",{className:Q1[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])=>v.jsxs("div",{className:"mb-2",children:[v.jsx("div",{className:"mono mb-1 text-[10px] uppercase tracking-wider text-zinc-500",children:o}),v.jsx("ul",{className:"flex flex-col gap-1",children:i.map(l=>v.jsx(jy,{sub:l,showGroup:!1},l.id))})]},o)):v.jsx("ul",{className:"flex flex-col gap-1",children:t.map(o=>v.jsx(jy,{sub:o},o.id))})]}),n.length>0&&v.jsxs("section",{className:"rise",children:[v.jsxs("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:["logs · ",n.length]}),v.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)=>v.jsx(X1,{e:o},`${o.at}-${i}`))})]})]})}function cI({value:e}){const[t,n]=S.useState(!1);return v.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?v.jsx(q1,{width:11,height:11}):v.jsx(YM,{width:11,height:11}),t?"copied":"copy"]})}function Tu({label:e,value:t}){const n=typeof t=="string"?t:JSON.stringify(t,null,2);return v.jsxs("section",{className:"rise",children:[v.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[v.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:e}),v.jsx(cI,{value:n})]}),v.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 Mr({k:e,v:t,mono:n=!0}){return v.jsxs("div",{className:"flex items-baseline justify-between gap-3 py-1.5",children:[v.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-[0.16em] text-zinc-600",children:e}),v.jsx("span",{className:`truncate text-right text-[12px] text-zinc-200 ${n?"mono tnum":""}`,children:t})]})}function uI({id:e,onOpenRun:t}){const{data:n}=Un({queryKey:["run",e],queryFn:()=>Ye.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?v.jsxs("div",{className:"mono px-2 py-2 text-[10px] text-zinc-600",children:["no steps recorded yet — child ",n.run.status]}):v.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:v.jsx(om,{run:n.run,timeline:n.timeline,depth:0,onSelect:()=>{},onOpenRun:t??(()=>{}),expanded:r,onToggleChild:o})}):v.jsx("div",{className:"mono px-2 py-2 text-[10px] text-zinc-600",children:"loading child run…"})}function dI({step:e,run:t,onClose:n,onOpenRun:r}){const s=ro(e),[o,i]=S.useState(!1),l=e.status==="failed",a=e.status==="pending"||e.status==="running",c=sm(e.kind),d=Oy(t.createdAt,e.startedAt),u=e.enqueuedAt?new Date(e.startedAt).getTime()-new Date(e.enqueuedAt).getTime():0;return v.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:[v.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.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:v.jsx(c,{width:13,height:13})}),v.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.name})]}),v.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:[e.status," · ",yp[e.kind]??e.kind]})]}),v.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:v.jsx(Li,{})})]}),v.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[v.jsxs("div",{className:"rounded-lg border border-line bg-black/20 px-3.5 py-1",children:[v.jsx(Mr,{k:"seq",v:`#${e.seq}`}),u>=1&&v.jsx(Mr,{k:"queued",v:v.jsx("span",{className:"text-sky-300",children:Pu(u)})}),v.jsx(Mr,{k:"duration",v:a?v.jsx("span",{className:"text-amber-300",children:"running…"}):Oy(e.startedAt,e.finishedAt)}),v.jsx(Mr,{k:"attempts",v:v.jsxs("span",{className:e.attempts>1?"text-amber-300":"",children:[e.attempts>1&&v.jsx(nm,{width:11,height:11,className:"mr-1 inline"}),e.attempts]})}),e.workerGroup&&v.jsx(Mr,{k:"worker",v:`@${e.workerGroup}`}),v.jsx(Mr,{k:"started",v:Ay(e.startedAt)}),!a&&v.jsx(Mr,{k:"finished",v:Ay(e.finishedAt)}),v.jsx(Mr,{k:"offset",v:`+${d}`})]}),l&&e.error&&v.jsxs("section",{className:"rise",children:[v.jsx("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-red-400/80",children:"error"}),v.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&&v.jsx(aI,{events:e.events}),s&&v.jsxs("section",{className:"rise",children:[v.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[v.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:"child run"}),r&&v.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 ↗"})]}),v.jsxs("button",{type:"button",onClick:()=>i(f=>!f),className:"flex w-full items-center gap-2 rounded-md border border-indigo-500/30 bg-indigo-500/10 px-2.5 py-1.5 text-left transition-colors hover:bg-indigo-500/20",title:o?"Collapse child run":"Expand child run inline",children:[v.jsx("span",{className:"inline-block text-[9px] text-indigo-300 transition-transform",style:{transform:o?"rotate(90deg)":"rotate(0deg)"},children:"▸"}),v.jsx("span",{className:"mono truncate text-[11px] text-indigo-300",children:s})]}),o&&v.jsx(uI,{id:s,onOpenRun:r})]}),e.input!==void 0&&v.jsx(Tu,{label:"input",value:e.input}),e.output!==void 0&&v.jsx(Tu,{label:"output",value:e.output})]})]})}function fI({run:e,onClose:t}){const n=e.input===void 0&&e.output===void 0&&!e.error;return v.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:[v.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.workflow}),v.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:["run · ",e.status]})]}),v.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:v.jsx(Li,{})})]}),v.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[e.error&&v.jsxs("section",{className:"rise",children:[v.jsx("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-red-400/80",children:"error"}),v.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&&v.jsx(Tu,{label:"input",value:e.input}),e.output!==void 0&&v.jsx(Tu,{label:"output",value:e.output}),n&&v.jsx("div",{className:"text-sm text-zinc-600",children:"No input/output recorded."})]})]})}function et(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=et(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var hI={value:()=>{}};function md(){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 Bc(n)}function Bc(e){this._=e}function pI(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}})}Bc.prototype=md.prototype={constructor:Bc,on:function(e,t){var n=this._,r=pI(e+"",n),s,o=-1,i=r.length;if(arguments.length<2){for(;++o<i;)if((s=(e=r[o]).type)&&(s=gI(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]=zy(n[s],e.name,t);else if(t==null)for(s in n)n[s]=zy(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 Bc(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 gI(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function zy(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=hI,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var xp="http://www.w3.org/1999/xhtml";const Ly={svg:"http://www.w3.org/2000/svg",xhtml:xp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function yd(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Ly.hasOwnProperty(t)?{space:Ly[t],local:e}:e}function mI(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===xp&&t.documentElement.namespaceURI===xp?t.createElement(e):t.createElementNS(n,e)}}function yI(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function G1(e){var t=yd(e);return(t.local?yI:mI)(t)}function vI(){}function lm(e){return e==null?vI:function(){return this.querySelector(e)}}function xI(e){typeof e!="function"&&(e=lm(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,d=0;d<i;++d)(a=o[d])&&(c=e.call(a,a.__data__,d,o))&&("__data__"in a&&(c.__data__=a.__data__),l[d]=c);return new nn(r,this._parents)}function wI(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function bI(){return[]}function Z1(e){return e==null?bI:function(){return this.querySelectorAll(e)}}function SI(e){return function(){return wI(e.apply(this,arguments))}}function EI(e){typeof e=="function"?e=SI(e):e=Z1(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var i=t[o],l=i.length,a,c=0;c<l;++c)(a=i[c])&&(r.push(e.call(a,a.__data__,c,i)),s.push(a));return new nn(r,s)}function J1(e){return function(){return this.matches(e)}}function eS(e){return function(t){return t.matches(e)}}var kI=Array.prototype.find;function CI(e){return function(){return kI.call(this.children,e)}}function RI(){return this.firstElementChild}function NI(e){return this.select(e==null?RI:CI(typeof e=="function"?e:eS(e)))}var PI=Array.prototype.filter;function TI(){return Array.from(this.children)}function MI(e){return function(){return PI.call(this.children,e)}}function II(e){return this.selectAll(e==null?TI:MI(typeof e=="function"?e:eS(e)))}function _I(e){typeof e!="function"&&(e=J1(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=[],a,c=0;c<i;++c)(a=o[c])&&e.call(a,a.__data__,c,o)&&l.push(a);return new nn(r,this._parents)}function tS(e){return new Array(e.length)}function OI(){return new nn(this._enter||this._groups.map(tS),this._parents)}function Mu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Mu.prototype={constructor:Mu,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 AI(e){return function(){return e}}function jI(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 Mu(e,o[i]);for(;i<a;++i)(l=t[i])&&(s[i]=l)}function zI(e,t,n,r,s,o,i){var l,a,c=new Map,d=t.length,u=o.length,f=new Array(d),h;for(l=0;l<d;++l)(a=t[l])&&(f[l]=h=i.call(a,a.__data__,l,t)+"",c.has(h)?s[l]=a:c.set(h,a));for(l=0;l<u;++l)h=i.call(e,o[l],l,o)+"",(a=c.get(h))?(r[l]=a,a.__data__=o[l],c.delete(h)):n[l]=new Mu(e,o[l]);for(l=0;l<d;++l)(a=t[l])&&c.get(f[l])===a&&(s[l]=a)}function LI(e){return e.__data__}function DI(e,t){if(!arguments.length)return Array.from(this,LI);var n=t?zI:jI,r=this._parents,s=this._groups;typeof e!="function"&&(e=AI(e));for(var o=s.length,i=new Array(o),l=new Array(o),a=new Array(o),c=0;c<o;++c){var d=r[c],u=s[c],f=u.length,h=FI(e.call(d,d&&d.__data__,c,r)),g=h.length,x=l[c]=new Array(g),b=i[c]=new Array(g),p=a[c]=new Array(f);n(d,u,x,b,p,h,t);for(var y=0,m=0,w,k;y<g;++y)if(w=x[y]){for(y>=m&&(m=y+1);!(k=b[m])&&++m<g;);w._next=k||null}}return i=new nn(i,r),i._enter=l,i._exit=a,i}function FI(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function $I(){return new nn(this._exit||this._groups.map(tS),this._parents)}function BI(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 HI(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],d=r[a],u=c.length,f=l[a]=new Array(u),h,g=0;g<u;++g)(h=c[g]||d[g])&&(f[g]=h);for(;a<s;++a)l[a]=n[a];return new nn(l,this._parents)}function VI(){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 WI(e){e||(e=UI);function t(u,f){return u&&f?e(u.__data__,f.__data__):!u-!f}for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o){for(var i=n[o],l=i.length,a=s[o]=new Array(l),c,d=0;d<l;++d)(c=i[d])&&(a[d]=c);a.sort(t)}return new nn(s,this._parents).order()}function UI(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function KI(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function qI(){return Array.from(this)}function YI(){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 QI(){let e=0;for(const t of this)++e;return e}function XI(){return!this.node()}function GI(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 ZI(e){return function(){this.removeAttribute(e)}}function JI(e){return function(){this.removeAttributeNS(e.space,e.local)}}function e_(e,t){return function(){this.setAttribute(e,t)}}function t_(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function n_(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function r_(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 s_(e,t){var n=yd(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?JI:ZI:typeof t=="function"?n.local?r_:n_:n.local?t_:e_)(n,t))}function nS(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function o_(e){return function(){this.style.removeProperty(e)}}function i_(e,t,n){return function(){this.style.setProperty(e,t,n)}}function l_(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function a_(e,t,n){return arguments.length>1?this.each((t==null?o_:typeof t=="function"?l_:i_)(e,t,n??"")):xi(this.node(),e)}function xi(e,t){return e.style.getPropertyValue(t)||nS(e).getComputedStyle(e,null).getPropertyValue(t)}function c_(e){return function(){delete this[e]}}function u_(e,t){return function(){this[e]=t}}function d_(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function f_(e,t){return arguments.length>1?this.each((t==null?c_:typeof t=="function"?d_:u_)(e,t)):this.node()[e]}function rS(e){return e.trim().split(/^|\s+/)}function am(e){return e.classList||new sS(e)}function sS(e){this._node=e,this._names=rS(e.getAttribute("class")||"")}sS.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 oS(e,t){for(var n=am(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function iS(e,t){for(var n=am(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function h_(e){return function(){oS(this,e)}}function p_(e){return function(){iS(this,e)}}function g_(e,t){return function(){(t.apply(this,arguments)?oS:iS)(this,e)}}function m_(e,t){var n=rS(e+"");if(arguments.length<2){for(var r=am(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?g_:t?h_:p_)(n,t))}function y_(){this.textContent=""}function v_(e){return function(){this.textContent=e}}function x_(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function w_(e){return arguments.length?this.each(e==null?y_:(typeof e=="function"?x_:v_)(e)):this.node().textContent}function b_(){this.innerHTML=""}function S_(e){return function(){this.innerHTML=e}}function E_(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function k_(e){return arguments.length?this.each(e==null?b_:(typeof e=="function"?E_:S_)(e)):this.node().innerHTML}function C_(){this.nextSibling&&this.parentNode.appendChild(this)}function R_(){return this.each(C_)}function N_(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function P_(){return this.each(N_)}function T_(e){var t=typeof e=="function"?e:G1(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function M_(){return null}function I_(e,t){var n=typeof e=="function"?e:G1(e),r=t==null?M_:typeof t=="function"?t:lm(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function __(){var e=this.parentNode;e&&e.removeChild(this)}function O_(){return this.each(__)}function A_(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function j_(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function z_(e){return this.select(e?j_:A_)}function L_(e){return arguments.length?this.property("__data__",e):this.node().__data__}function D_(e){return function(t){e.call(this,t,this.__data__)}}function F_(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 $_(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 B_(e,t,n){return function(){var r=this.__on,s,o=D_(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 H_(e,t,n){var r=F_(e+""),s,o=r.length,i;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,c=l.length,d;a<c;++a)for(s=0,d=l[a];s<o;++s)if((i=r[s]).type===d.type&&i.name===d.name)return d.value}return}for(l=t?B_:$_,s=0;s<o;++s)this.each(l(r[s],t,n));return this}function lS(e,t,n){var r=nS(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 V_(e,t){return function(){return lS(this,e,t)}}function W_(e,t){return function(){return lS(this,e,t.apply(this,arguments))}}function U_(e,t){return this.each((typeof t=="function"?W_:V_)(e,t))}function*K_(){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 aS=[null];function nn(e,t){this._groups=e,this._parents=t}function Sa(){return new nn([[document.documentElement]],aS)}function q_(){return this}nn.prototype=Sa.prototype={constructor:nn,select:xI,selectAll:EI,selectChild:NI,selectChildren:II,filter:_I,data:DI,enter:OI,exit:$I,join:BI,merge:HI,selection:q_,order:VI,sort:WI,call:KI,nodes:qI,node:YI,size:QI,empty:XI,each:GI,attr:s_,style:a_,property:f_,classed:m_,text:w_,html:k_,raise:R_,lower:P_,append:T_,insert:I_,remove:O_,clone:z_,datum:L_,on:H_,dispatch:U_,[Symbol.iterator]:K_};function Gt(e){return typeof e=="string"?new nn([[document.querySelector(e)]],[document.documentElement]):new nn([[e]],aS)}function Y_(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Sn(e,t){if(e=Y_(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 Q_={passive:!1},Ql={capture:!0,passive:!1};function If(e){e.stopImmediatePropagation()}function Vo(e){e.preventDefault(),e.stopImmediatePropagation()}function cS(e){var t=e.document.documentElement,n=Gt(e).on("dragstart.drag",Vo,Ql);"onselectstart"in t?n.on("selectstart.drag",Vo,Ql):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function uS(e,t){var n=e.document.documentElement,r=Gt(e).on("dragstart.drag",null);t&&(r.on("click.drag",Vo,Ql),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 dc=e=>()=>e;function wp(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:i,y:l,dx:a,dy:c,dispatch:d}){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:d}})}wp.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function X_(e){return!e.ctrlKey&&!e.button}function G_(){return this.parentNode}function Z_(e,t){return t??{x:e.x,y:e.y}}function J_(){return navigator.maxTouchPoints||"ontouchstart"in this}function dS(){var e=X_,t=G_,n=Z_,r=J_,s={},o=md("start","drag","end"),i=0,l,a,c,d,u=0;function f(w){w.on("mousedown.drag",h).filter(r).on("touchstart.drag",b).on("touchmove.drag",p,Q_).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(w,k){if(!(d||!e.call(this,w,k))){var C=m(this,t.call(this,w,k),w,k,"mouse");C&&(Gt(w.view).on("mousemove.drag",g,Ql).on("mouseup.drag",x,Ql),cS(w.view),If(w),c=!1,l=w.clientX,a=w.clientY,C("start",w))}}function g(w){if(Vo(w),!c){var k=w.clientX-l,C=w.clientY-a;c=k*k+C*C>u}s.mouse("drag",w)}function x(w){Gt(w.view).on("mousemove.drag mouseup.drag",null),uS(w.view,c),Vo(w),s.mouse("end",w)}function b(w,k){if(e.call(this,w,k)){var C=w.changedTouches,R=t.call(this,w,k),E=C.length,M,_;for(M=0;M<E;++M)(_=m(this,R,w,k,C[M].identifier,C[M]))&&(If(w),_("start",w,C[M]))}}function p(w){var k=w.changedTouches,C=k.length,R,E;for(R=0;R<C;++R)(E=s[k[R].identifier])&&(Vo(w),E("drag",w,k[R]))}function y(w){var k=w.changedTouches,C=k.length,R,E;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),R=0;R<C;++R)(E=s[k[R].identifier])&&(If(w),E("end",w,k[R]))}function m(w,k,C,R,E,M){var _=o.copy(),j=Sn(M||C,k),D,O,N;if((N=n.call(w,new wp("beforestart",{sourceEvent:C,target:f,identifier:E,active:i,x:j[0],y:j[1],dx:0,dy:0,dispatch:_}),R))!=null)return D=N.x-j[0]||0,O=N.y-j[1]||0,function T(z,F,P){var I=j,A;switch(z){case"start":s[E]=T,A=i++;break;case"end":delete s[E],--i;case"drag":j=Sn(P||F,k),A=i;break}_.call(z,w,new wp(z,{sourceEvent:F,subject:N,target:f,identifier:E,active:A,x:j[0]+D,y:j[1]+O,dx:j[0]-I[0],dy:j[1]-I[1],dispatch:_}),R)}}return f.filter=function(w){return arguments.length?(e=typeof w=="function"?w:dc(!!w),f):e},f.container=function(w){return arguments.length?(t=typeof w=="function"?w:dc(w),f):t},f.subject=function(w){return arguments.length?(n=typeof w=="function"?w:dc(w),f):n},f.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:dc(!!w),f):r},f.on=function(){var w=o.on.apply(o,arguments);return w===o?f:w},f.clickDistance=function(w){return arguments.length?(u=(w=+w)*w,f):Math.sqrt(u)},f}function cm(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function fS(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ea(){}var Xl=.7,Iu=1/Xl,Wo="\\s*([+-]?\\d+)\\s*",Gl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Yn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",e2=/^#([0-9a-f]{3,8})$/,t2=new RegExp(`^rgb\\(${Wo},${Wo},${Wo}\\)$`),n2=new RegExp(`^rgb\\(${Yn},${Yn},${Yn}\\)$`),r2=new RegExp(`^rgba\\(${Wo},${Wo},${Wo},${Gl}\\)$`),s2=new RegExp(`^rgba\\(${Yn},${Yn},${Yn},${Gl}\\)$`),o2=new RegExp(`^hsl\\(${Gl},${Yn},${Yn}\\)$`),i2=new RegExp(`^hsla\\(${Gl},${Yn},${Yn},${Gl}\\)$`),Dy={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};cm(Ea,so,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Fy,formatHex:Fy,formatHex8:l2,formatHsl:a2,formatRgb:$y,toString:$y});function Fy(){return this.rgb().formatHex()}function l2(){return this.rgb().formatHex8()}function a2(){return hS(this).formatHsl()}function $y(){return this.rgb().formatRgb()}function so(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=e2.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?By(t):n===3?new $t(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?fc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?fc(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=t2.exec(e))?new $t(t[1],t[2],t[3],1):(t=n2.exec(e))?new $t(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=r2.exec(e))?fc(t[1],t[2],t[3],t[4]):(t=s2.exec(e))?fc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=o2.exec(e))?Wy(t[1],t[2]/100,t[3]/100,1):(t=i2.exec(e))?Wy(t[1],t[2]/100,t[3]/100,t[4]):Dy.hasOwnProperty(e)?By(Dy[e]):e==="transparent"?new $t(NaN,NaN,NaN,0):null}function By(e){return new $t(e>>16&255,e>>8&255,e&255,1)}function fc(e,t,n,r){return r<=0&&(e=t=n=NaN),new $t(e,t,n,r)}function c2(e){return e instanceof Ea||(e=so(e)),e?(e=e.rgb(),new $t(e.r,e.g,e.b,e.opacity)):new $t}function bp(e,t,n,r){return arguments.length===1?c2(e):new $t(e,t,n,r??1)}function $t(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}cm($t,bp,fS(Ea,{brighter(e){return e=e==null?Iu:Math.pow(Iu,e),new $t(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Xl:Math.pow(Xl,e),new $t(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new $t(Ys(this.r),Ys(this.g),Ys(this.b),_u(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Hy,formatHex:Hy,formatHex8:u2,formatRgb:Vy,toString:Vy}));function Hy(){return`#${Os(this.r)}${Os(this.g)}${Os(this.b)}`}function u2(){return`#${Os(this.r)}${Os(this.g)}${Os(this.b)}${Os((isNaN(this.opacity)?1:this.opacity)*255)}`}function Vy(){const e=_u(this.opacity);return`${e===1?"rgb(":"rgba("}${Ys(this.r)}, ${Ys(this.g)}, ${Ys(this.b)}${e===1?")":`, ${e})`}`}function _u(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ys(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Os(e){return e=Ys(e),(e<16?"0":"")+e.toString(16)}function Wy(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new kn(e,t,n,r)}function hS(e){if(e instanceof kn)return new kn(e.h,e.s,e.l,e.opacity);if(e instanceof Ea||(e=so(e)),!e)return new kn;if(e instanceof kn)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 kn(i,l,a,e.opacity)}function d2(e,t,n,r){return arguments.length===1?hS(e):new kn(e,t,n,r??1)}function kn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}cm(kn,d2,fS(Ea,{brighter(e){return e=e==null?Iu:Math.pow(Iu,e),new kn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Xl:Math.pow(Xl,e),new kn(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 $t(_f(e>=240?e-240:e+120,s,r),_f(e,s,r),_f(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new kn(Uy(this.h),hc(this.s),hc(this.l),_u(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=_u(this.opacity);return`${e===1?"hsl(":"hsla("}${Uy(this.h)}, ${hc(this.s)*100}%, ${hc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Uy(e){return e=(e||0)%360,e<0?e+360:e}function hc(e){return Math.max(0,Math.min(1,e||0))}function _f(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 um=e=>()=>e;function f2(e,t){return function(n){return e+n*t}}function h2(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 p2(e){return(e=+e)==1?pS:function(t,n){return n-t?h2(t,n,e):um(isNaN(t)?n:t)}}function pS(e,t){var n=t-e;return n?f2(e,n):um(isNaN(e)?t:e)}const Ou=function e(t){var n=p2(t);function r(s,o){var i=n((s=bp(s)).r,(o=bp(o)).r),l=n(s.g,o.g),a=n(s.b,o.b),c=pS(s.opacity,o.opacity);return function(d){return s.r=i(d),s.g=l(d),s.b=a(d),s.opacity=c(d),s+""}}return r.gamma=e,r}(1);function g2(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(o){for(s=0;s<n;++s)r[s]=e[s]*(1-o)+t[s]*o;return r}}function m2(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function y2(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),o=new Array(n),i;for(i=0;i<r;++i)s[i]=Cl(e[i],t[i]);for(;i<n;++i)o[i]=t[i];return function(l){for(i=0;i<r;++i)o[i]=s[i](l);return o}}function v2(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Hn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function x2(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=Cl(e[s],t[s]):r[s]=t[s];return function(o){for(s in n)r[s]=n[s](o);return r}}var Sp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Of=new RegExp(Sp.source,"g");function w2(e){return function(){return e}}function b2(e){return function(t){return e(t)+""}}function gS(e,t){var n=Sp.lastIndex=Of.lastIndex=0,r,s,o,i=-1,l=[],a=[];for(e=e+"",t=t+"";(r=Sp.exec(e))&&(s=Of.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:Hn(r,s)})),n=Of.lastIndex;return n<t.length&&(o=t.slice(n),l[i]?l[i]+=o:l[++i]=o),l.length<2?a[0]?b2(a[0].x):w2(t):(t=a.length,function(c){for(var d=0,u;d<t;++d)l[(u=a[d]).i]=u.x(c);return l.join("")})}function Cl(e,t){var n=typeof t,r;return t==null||n==="boolean"?um(t):(n==="number"?Hn:n==="string"?(r=so(t))?(t=r,Ou):gS:t instanceof so?Ou:t instanceof Date?v2:m2(t)?g2:Array.isArray(t)?y2:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?x2:Hn)(e,t)}var Ky=180/Math.PI,Ep={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function mS(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)*Ky,skewX:Math.atan(a)*Ky,scaleX:i,scaleY:l}}var pc;function S2(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ep:mS(t.a,t.b,t.c,t.d,t.e,t.f)}function E2(e){return e==null||(pc||(pc=document.createElementNS("http://www.w3.org/2000/svg","g")),pc.setAttribute("transform",e),!(e=pc.transform.baseVal.consolidate()))?Ep:(e=e.matrix,mS(e.a,e.b,e.c,e.d,e.e,e.f))}function yS(e,t,n,r){function s(c){return c.length?c.pop()+" ":""}function o(c,d,u,f,h,g){if(c!==u||d!==f){var x=h.push("translate(",null,t,null,n);g.push({i:x-4,x:Hn(c,u)},{i:x-2,x:Hn(d,f)})}else(u||f)&&h.push("translate("+u+t+f+n)}function i(c,d,u,f){c!==d?(c-d>180?d+=360:d-c>180&&(c+=360),f.push({i:u.push(s(u)+"rotate(",null,r)-2,x:Hn(c,d)})):d&&u.push(s(u)+"rotate("+d+r)}function l(c,d,u,f){c!==d?f.push({i:u.push(s(u)+"skewX(",null,r)-2,x:Hn(c,d)}):d&&u.push(s(u)+"skewX("+d+r)}function a(c,d,u,f,h,g){if(c!==u||d!==f){var x=h.push(s(h)+"scale(",null,",",null,")");g.push({i:x-4,x:Hn(c,u)},{i:x-2,x:Hn(d,f)})}else(u!==1||f!==1)&&h.push(s(h)+"scale("+u+","+f+")")}return function(c,d){var u=[],f=[];return c=e(c),d=e(d),o(c.translateX,c.translateY,d.translateX,d.translateY,u,f),i(c.rotate,d.rotate,u,f),l(c.skewX,d.skewX,u,f),a(c.scaleX,c.scaleY,d.scaleX,d.scaleY,u,f),c=d=null,function(h){for(var g=-1,x=f.length,b;++g<x;)u[(b=f[g]).i]=b.x(h);return u.join("")}}}var k2=yS(S2,"px, ","px)","deg)"),C2=yS(E2,", ",")",")"),R2=1e-12;function qy(e){return((e=Math.exp(e))+1/e)/2}function N2(e){return((e=Math.exp(e))-1/e)/2}function P2(e){return((e=Math.exp(2*e))-1)/(e+1)}const Hc=function e(t,n,r){function s(o,i){var l=o[0],a=o[1],c=o[2],d=i[0],u=i[1],f=i[2],h=d-l,g=u-a,x=h*h+g*g,b,p;if(x<R2)p=Math.log(f/c)/t,b=function(R){return[l+R*h,a+R*g,c*Math.exp(t*R*p)]};else{var y=Math.sqrt(x),m=(f*f-c*c+r*x)/(2*c*n*y),w=(f*f-c*c-r*x)/(2*f*n*y),k=Math.log(Math.sqrt(m*m+1)-m),C=Math.log(Math.sqrt(w*w+1)-w);p=(C-k)/t,b=function(R){var E=R*p,M=qy(k),_=c/(n*y)*(M*P2(t*E+k)-N2(k));return[l+_*h,a+_*g,c*M/qy(t*E+k)]}}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 wi=0,pl=0,ol=0,vS=1e3,Au,gl,ju=0,oo=0,vd=0,Zl=typeof performance=="object"&&performance.now?performance:Date,xS=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function dm(){return oo||(xS(T2),oo=Zl.now()+vd)}function T2(){oo=0}function zu(){this._call=this._time=this._next=null}zu.prototype=wS.prototype={constructor:zu,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?dm():+n)+(t==null?0:+t),!this._next&&gl!==this&&(gl?gl._next=this:Au=this,gl=this),this._call=e,this._time=n,kp()},stop:function(){this._call&&(this._call=null,this._time=1/0,kp())}};function wS(e,t,n){var r=new zu;return r.restart(e,t,n),r}function M2(){dm(),++wi;for(var e=Au,t;e;)(t=oo-e._time)>=0&&e._call.call(void 0,t),e=e._next;--wi}function Yy(){oo=(ju=Zl.now())+vd,wi=pl=0;try{M2()}finally{wi=0,_2(),oo=0}}function I2(){var e=Zl.now(),t=e-ju;t>vS&&(vd-=t,ju=e)}function _2(){for(var e,t=Au,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:Au=n);gl=e,kp(r)}function kp(e){if(!wi){pl&&(pl=clearTimeout(pl));var t=e-oo;t>24?(e<1/0&&(pl=setTimeout(Yy,e-Zl.now()-vd)),ol&&(ol=clearInterval(ol))):(ol||(ju=Zl.now(),ol=setInterval(I2,vS)),wi=1,xS(Yy))}}function Qy(e,t,n){var r=new zu;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var O2=md("start","end","cancel","interrupt"),A2=[],bS=0,Xy=1,Cp=2,Vc=3,Gy=4,Rp=5,Wc=6;function xd(e,t,n,r,s,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;j2(e,n,{name:t,index:r,group:s,on:O2,tween:A2,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:bS})}function fm(e,t){var n=On(e,t);if(n.state>bS)throw new Error("too late; already scheduled");return n}function Xn(e,t){var n=On(e,t);if(n.state>Vc)throw new Error("too late; already running");return n}function On(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function j2(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=wS(o,0,n.time);function o(c){n.state=Xy,n.timer.restart(i,n.delay,n.time),n.delay<=c&&i(c-n.delay)}function i(c){var d,u,f,h;if(n.state!==Xy)return a();for(d in r)if(h=r[d],h.name===n.name){if(h.state===Vc)return Qy(i);h.state===Gy?(h.state=Wc,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[d]):+d<t&&(h.state=Wc,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[d])}if(Qy(function(){n.state===Vc&&(n.state=Gy,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=Cp,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Cp){for(n.state=Vc,s=new Array(f=n.tween.length),d=0,u=-1;d<f;++d)(h=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(s[++u]=h);s.length=u+1}}function l(c){for(var d=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(a),n.state=Rp,1),u=-1,f=s.length;++u<f;)s[u].call(e,d);n.state===Rp&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Wc,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Uc(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>Cp&&r.state<Rp,r.state=Wc,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}o&&delete e.__transition}}function z2(e){return this.each(function(){Uc(this,e)})}function L2(e,t){var n,r;return function(){var s=Xn(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 D2(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=Xn(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 F2(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=On(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?L2:D2)(n,e,t))}function hm(e,t,n){var r=e._id;return e.each(function(){var s=Xn(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return On(s,r).value[t]}}function SS(e,t){var n;return(typeof t=="number"?Hn:t instanceof so?Ou:(n=so(t))?(t=n,Ou):gS)(e,t)}function $2(e){return function(){this.removeAttribute(e)}}function B2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function H2(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 V2(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 W2(e,t,n){var r,s,o;return function(){var i,l=n(this),a;return l==null?void this.removeAttribute(e):(i=this.getAttribute(e),a=l+"",i===a?null:i===r&&a===s?o:(s=a,o=t(r=i,l)))}}function U2(e,t,n){var r,s,o;return function(){var i,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),a=l+"",i===a?null:i===r&&a===s?o:(s=a,o=t(r=i,l)))}}function K2(e,t){var n=yd(e),r=n==="transform"?C2:SS;return this.attrTween(e,typeof t=="function"?(n.local?U2:W2)(n,r,hm(this,"attr."+e,t)):t==null?(n.local?B2:$2)(n):(n.local?V2:H2)(n,r,t))}function q2(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Y2(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Q2(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&Y2(e,o)),n}return s._value=t,s}function X2(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&q2(e,o)),n}return s._value=t,s}function G2(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=yd(e);return this.tween(n,(r.local?Q2:X2)(r,t))}function Z2(e,t){return function(){fm(this,e).delay=+t.apply(this,arguments)}}function J2(e,t){return t=+t,function(){fm(this,e).delay=t}}function eO(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Z2:J2)(t,e)):On(this.node(),t).delay}function tO(e,t){return function(){Xn(this,e).duration=+t.apply(this,arguments)}}function nO(e,t){return t=+t,function(){Xn(this,e).duration=t}}function rO(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?tO:nO)(t,e)):On(this.node(),t).duration}function sO(e,t){if(typeof t!="function")throw new Error;return function(){Xn(this,e).ease=t}}function oO(e){var t=this._id;return arguments.length?this.each(sO(t,e)):On(this.node(),t).ease}function iO(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Xn(this,e).ease=n}}function lO(e){if(typeof e!="function")throw new Error;return this.each(iO(this._id,e))}function aO(e){typeof e!="function"&&(e=J1(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 xr(r,this._parents,this._name,this._id)}function cO(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],d=a.length,u=i[l]=new Array(d),f,h=0;h<d;++h)(f=a[h]||c[h])&&(u[h]=f);for(;l<r;++l)i[l]=t[l];return new xr(i,this._parents,this._name,this._id)}function uO(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 dO(e,t,n){var r,s,o=uO(t)?fm:Xn;return function(){var i=o(this,e),l=i.on;l!==r&&(s=(r=l).copy()).on(t,n),i.on=s}}function fO(e,t){var n=this._id;return arguments.length<2?On(this.node(),n).on.on(e):this.each(dO(n,e,t))}function hO(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function pO(){return this.on("end.remove",hO(this._id))}function gO(e){var t=this._name,n=this._id;typeof e!="function"&&(e=lm(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),d,u,f=0;f<a;++f)(d=l[f])&&(u=e.call(d,d.__data__,f,l))&&("__data__"in d&&(u.__data__=d.__data__),c[f]=u,xd(c[f],t,n,f,c,On(d,n)));return new xr(o,this._parents,t,n)}function mO(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Z1(e));for(var r=this._groups,s=r.length,o=[],i=[],l=0;l<s;++l)for(var a=r[l],c=a.length,d,u=0;u<c;++u)if(d=a[u]){for(var f=e.call(d,d.__data__,u,a),h,g=On(d,n),x=0,b=f.length;x<b;++x)(h=f[x])&&xd(h,t,n,x,f,g);o.push(f),i.push(d)}return new xr(o,i,t,n)}var yO=Sa.prototype.constructor;function vO(){return new yO(this._groups,this._parents)}function xO(e,t){var n,r,s;return function(){var o=xi(this,e),i=(this.style.removeProperty(e),xi(this,e));return o===i?null:o===n&&i===r?s:s=t(n=o,r=i)}}function ES(e){return function(){this.style.removeProperty(e)}}function wO(e,t,n){var r,s=n+"",o;return function(){var i=xi(this,e);return i===s?null:i===r?o:o=t(r=i,n)}}function bO(e,t,n){var r,s,o;return function(){var i=xi(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),xi(this,e))),i===a?null:i===r&&a===s?o:(s=a,o=t(r=i,l))}}function SO(e,t){var n,r,s,o="style."+t,i="end."+o,l;return function(){var a=Xn(this,e),c=a.on,d=a.value[o]==null?l||(l=ES(t)):void 0;(c!==n||s!==d)&&(r=(n=c).copy()).on(i,s=d),a.on=r}}function EO(e,t,n){var r=(e+="")=="transform"?k2:SS;return t==null?this.styleTween(e,xO(e,r)).on("end.style."+e,ES(e)):typeof t=="function"?this.styleTween(e,bO(e,r,hm(this,"style."+e,t))).each(SO(this._id,e)):this.styleTween(e,wO(e,r,t),n).on("end.style."+e,null)}function kO(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function CO(e,t,n){var r,s;function o(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&kO(e,i,n)),r}return o._value=t,o}function RO(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,CO(e,t,n??""))}function NO(e){return function(){this.textContent=e}}function PO(e){return function(){var t=e(this);this.textContent=t??""}}function TO(e){return this.tween("text",typeof e=="function"?PO(hm(this,"text",e)):NO(e==null?"":e+""))}function MO(e){return function(t){this.textContent=e.call(this,t)}}function IO(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&MO(s)),t}return r._value=e,r}function _O(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,IO(e))}function OO(){for(var e=this._name,t=this._id,n=kS(),r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],l=i.length,a,c=0;c<l;++c)if(a=i[c]){var d=On(a,t);xd(a,e,n,c,i,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new xr(r,this._parents,e,n)}function AO(){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=Xn(this,r),d=c.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),c.on=t}),s===0&&o()})}var jO=0;function xr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function kS(){return++jO}var Zn=Sa.prototype;xr.prototype={constructor:xr,select:gO,selectAll:mO,selectChild:Zn.selectChild,selectChildren:Zn.selectChildren,filter:aO,merge:cO,selection:vO,transition:OO,call:Zn.call,nodes:Zn.nodes,node:Zn.node,size:Zn.size,empty:Zn.empty,each:Zn.each,on:fO,attr:K2,attrTween:G2,style:EO,styleTween:RO,text:TO,textTween:_O,remove:pO,tween:F2,delay:eO,duration:rO,ease:oO,easeVarying:lO,end:AO,[Symbol.iterator]:Zn[Symbol.iterator]};function zO(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var LO={time:null,delay:0,duration:250,ease:zO};function DO(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 FO(e){var t,n;e instanceof xr?(t=e._id,e=e._name):(t=kS(),(n=LO).time=dm(),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])&&xd(a,e,t,c,i,n||DO(a,t));return new xr(r,this._parents,e,t)}Sa.prototype.interrupt=z2;Sa.prototype.transition=FO;const gc=e=>()=>e;function $O(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 cr(e,t,n){this.k=e,this.x=t,this.y=n}cr.prototype={constructor:cr,scale:function(e){return e===1?this:new cr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new cr(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 wd=new cr(1,0,0);CS.prototype=cr.prototype;function CS(e){for(;!e.__zoom;)if(!(e=e.parentNode))return wd;return e.__zoom}function Af(e){e.stopImmediatePropagation()}function il(e){e.preventDefault(),e.stopImmediatePropagation()}function BO(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function HO(){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 Zy(){return this.__zoom||wd}function VO(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function WO(){return navigator.maxTouchPoints||"ontouchstart"in this}function UO(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 RS(){var e=BO,t=HO,n=UO,r=VO,s=WO,o=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,a=Hc,c=md("start","zoom","end"),d,u,f,h=500,g=150,x=0,b=10;function p(N){N.property("__zoom",Zy).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",_).filter(s).on("touchstart.zoom",j).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(N,T,z,F){var P=N.selection?N.selection():N;P.property("__zoom",Zy),N!==P?k(N,T,z,F):P.interrupt().each(function(){C(this,arguments).event(F).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},p.scaleBy=function(N,T,z,F){p.scaleTo(N,function(){var P=this.__zoom.k,I=typeof T=="function"?T.apply(this,arguments):T;return P*I},z,F)},p.scaleTo=function(N,T,z,F){p.transform(N,function(){var P=t.apply(this,arguments),I=this.__zoom,A=z==null?w(P):typeof z=="function"?z.apply(this,arguments):z,B=I.invert(A),$=typeof T=="function"?T.apply(this,arguments):T;return n(m(y(I,$),A,B),P,i)},z,F)},p.translateBy=function(N,T,z,F){p.transform(N,function(){return n(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof z=="function"?z.apply(this,arguments):z),t.apply(this,arguments),i)},null,F)},p.translateTo=function(N,T,z,F,P){p.transform(N,function(){var I=t.apply(this,arguments),A=this.__zoom,B=F==null?w(I):typeof F=="function"?F.apply(this,arguments):F;return n(wd.translate(B[0],B[1]).scale(A.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof z=="function"?-z.apply(this,arguments):-z),I,i)},F,P)};function y(N,T){return T=Math.max(o[0],Math.min(o[1],T)),T===N.k?N:new cr(T,N.x,N.y)}function m(N,T,z){var F=T[0]-z[0]*N.k,P=T[1]-z[1]*N.k;return F===N.x&&P===N.y?N:new cr(N.k,F,P)}function w(N){return[(+N[0][0]+ +N[1][0])/2,(+N[0][1]+ +N[1][1])/2]}function k(N,T,z,F){N.on("start.zoom",function(){C(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(F).end()}).tween("zoom",function(){var P=this,I=arguments,A=C(P,I).event(F),B=t.apply(P,I),$=z==null?w(B):typeof z=="function"?z.apply(P,I):z,U=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),q=P.__zoom,K=typeof T=="function"?T.apply(P,I):T,X=a(q.invert($).concat(U/q.k),K.invert($).concat(U/K.k));return function(G){if(G===1)G=K;else{var H=X(G),Y=U/H[2];G=new cr(Y,$[0]-H[0]*Y,$[1]-H[1]*Y)}A.zoom(null,G)}})}function C(N,T,z){return!z&&N.__zooming||new R(N,T)}function R(N,T){this.that=N,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(N,T),this.taps=0}R.prototype={event:function(N){return N&&(this.sourceEvent=N),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(N,T){return this.mouse&&N!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&N!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&N!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(N){var T=Gt(this.that).datum();c.call(N,this.that,new $O(N,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:c}),T)}};function E(N,...T){if(!e.apply(this,arguments))return;var z=C(this,T).event(N),F=this.__zoom,P=Math.max(o[0],Math.min(o[1],F.k*Math.pow(2,r.apply(this,arguments)))),I=Sn(N);if(z.wheel)(z.mouse[0][0]!==I[0]||z.mouse[0][1]!==I[1])&&(z.mouse[1]=F.invert(z.mouse[0]=I)),clearTimeout(z.wheel);else{if(F.k===P)return;z.mouse=[I,F.invert(I)],Uc(this),z.start()}il(N),z.wheel=setTimeout(A,g),z.zoom("mouse",n(m(y(F,P),z.mouse[0],z.mouse[1]),z.extent,i));function A(){z.wheel=null,z.end()}}function M(N,...T){if(f||!e.apply(this,arguments))return;var z=N.currentTarget,F=C(this,T,!0).event(N),P=Gt(N.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",U,!0),I=Sn(N,z),A=N.clientX,B=N.clientY;cS(N.view),Af(N),F.mouse=[I,this.__zoom.invert(I)],Uc(this),F.start();function $(q){if(il(q),!F.moved){var K=q.clientX-A,X=q.clientY-B;F.moved=K*K+X*X>x}F.event(q).zoom("mouse",n(m(F.that.__zoom,F.mouse[0]=Sn(q,z),F.mouse[1]),F.extent,i))}function U(q){P.on("mousemove.zoom mouseup.zoom",null),uS(q.view,F.moved),il(q),F.event(q).end()}}function _(N,...T){if(e.apply(this,arguments)){var z=this.__zoom,F=Sn(N.changedTouches?N.changedTouches[0]:N,this),P=z.invert(F),I=z.k*(N.shiftKey?.5:2),A=n(m(y(z,I),F,P),t.apply(this,T),i);il(N),l>0?Gt(this).transition().duration(l).call(k,A,F,N):Gt(this).call(p.transform,A,F,N)}}function j(N,...T){if(e.apply(this,arguments)){var z=N.touches,F=z.length,P=C(this,T,N.changedTouches.length===F).event(N),I,A,B,$;for(Af(N),A=0;A<F;++A)B=z[A],$=Sn(B,this),$=[$,this.__zoom.invert($),B.identifier],P.touch0?!P.touch1&&P.touch0[2]!==$[2]&&(P.touch1=$,P.taps=0):(P.touch0=$,I=!0,P.taps=1+!!d);d&&(d=clearTimeout(d)),I&&(P.taps<2&&(u=$[0],d=setTimeout(function(){d=null},h)),Uc(this),P.start())}}function D(N,...T){if(this.__zooming){var z=C(this,T).event(N),F=N.changedTouches,P=F.length,I,A,B,$;for(il(N),I=0;I<P;++I)A=F[I],B=Sn(A,this),z.touch0&&z.touch0[2]===A.identifier?z.touch0[0]=B:z.touch1&&z.touch1[2]===A.identifier&&(z.touch1[0]=B);if(A=z.that.__zoom,z.touch1){var U=z.touch0[0],q=z.touch0[1],K=z.touch1[0],X=z.touch1[1],G=(G=K[0]-U[0])*G+(G=K[1]-U[1])*G,H=(H=X[0]-q[0])*H+(H=X[1]-q[1])*H;A=y(A,Math.sqrt(G/H)),B=[(U[0]+K[0])/2,(U[1]+K[1])/2],$=[(q[0]+X[0])/2,(q[1]+X[1])/2]}else if(z.touch0)B=z.touch0[0],$=z.touch0[1];else return;z.zoom("touch",n(m(A,B,$),z.extent,i))}}function O(N,...T){if(this.__zooming){var z=C(this,T).event(N),F=N.changedTouches,P=F.length,I,A;for(Af(N),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),I=0;I<P;++I)A=F[I],z.touch0&&z.touch0[2]===A.identifier?delete z.touch0:z.touch1&&z.touch1[2]===A.identifier&&delete z.touch1;if(z.touch1&&!z.touch0&&(z.touch0=z.touch1,delete z.touch1),z.touch0)z.touch0[1]=this.__zoom.invert(z.touch0[0]);else if(z.end(),z.taps===2&&(A=Sn(A,this),Math.hypot(u[0]-A[0],u[1]-A[1])<b)){var B=Gt(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return p.wheelDelta=function(N){return arguments.length?(r=typeof N=="function"?N:gc(+N),p):r},p.filter=function(N){return arguments.length?(e=typeof N=="function"?N:gc(!!N),p):e},p.touchable=function(N){return arguments.length?(s=typeof N=="function"?N:gc(!!N),p):s},p.extent=function(N){return arguments.length?(t=typeof N=="function"?N:gc([[+N[0][0],+N[0][1]],[+N[1][0],+N[1][1]]]),p):t},p.scaleExtent=function(N){return arguments.length?(o[0]=+N[0],o[1]=+N[1],p):[o[0],o[1]]},p.translateExtent=function(N){return arguments.length?(i[0][0]=+N[0][0],i[1][0]=+N[1][0],i[0][1]=+N[0][1],i[1][1]=+N[1][1],p):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},p.constrain=function(N){return arguments.length?(n=N,p):n},p.duration=function(N){return arguments.length?(l=+N,p):l},p.interpolate=function(N){return arguments.length?(a=N,p):a},p.on=function(){var N=c.on.apply(c,arguments);return N===c?p:N},p.clickDistance=function(N){return arguments.length?(x=(N=+N)*N,p):Math.sqrt(x)},p.tapDistance=function(N){return arguments.length?(b=+N,p):b},p}const In={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Jl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],NS=["Enter"," ","Escape"],PS={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var bi;(function(e){e.Strict="strict",e.Loose="loose"})(bi||(bi={}));var Qs;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Qs||(Qs={}));var ea;(function(e){e.Partial="partial",e.Full="full"})(ea||(ea={}));const TS={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Fr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Fr||(Fr={}));var Lu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Lu||(Lu={}));var de;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(de||(de={}));const Jy={[de.Left]:de.Right,[de.Right]:de.Left,[de.Top]:de.Bottom,[de.Bottom]:de.Top};function MS(e){return e===null?null:e?"valid":"invalid"}const IS=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,KO=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),pm=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ka=(e,t=[0,0])=>{const{width:n,height:r}=An(e),s=e.origin??t,o=n*s[0],i=r*s[1];return{x:e.position.x-o,y:e.position.y-i}},qO=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const r=e.reduce((s,o)=>{const i=typeof o=="string";let l=!t.nodeLookup&&!i?o:void 0;return t.nodeLookup&&(l=i?t.nodeLookup.get(o):pm(o)?o:t.nodeLookup.get(o.id)),l?(n=!0,bd(s,Du(l,t.nodeOrigin))):s},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?Sd(r):{x:0,y:0,width:0,height:0}},Ca=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=bd(n,Du(s)),r=!0)}),r?Sd(n):{x:0,y:0,width:0,height:0}},gm=(e,t,[n,r,s]=[0,0,1],o=!1,i=!1)=>{const l=(t.x-n)/s,a=(t.y-r)/s,c=t.width/s,d=t.height/s,u=[];for(const f of e.values()){const{measured:h,selectable:g=!0,hidden:x=!1}=f;if(i&&!g||x)continue;const b=h.width??f.width??f.initialWidth??0,p=h.height??f.height??f.initialHeight??0,{x:y,y:m}=f.internals.positionAbsolute,w=jS(l,a,c,d,y,m,b,p),k=b*p,C=o&&w>0;(!f.internals.handleBounds||C||w>=k||f.dragging)&&u.push(f)}return u},YO=(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 QO(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{let o;if(t!=null&&t.includeHiddenNodes){const{width:i,height:l}=An(s);o=i>0&&l>0}else o=!!(s.measured.width&&s.measured.height&&!s.hidden);o&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function XO({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},i){if(e.size===0)return!0;const l=QO(e,i),a=Ca(l),c=ym(a,t,n,(i==null?void 0:i.minZoom)??s,(i==null?void 0:i.maxZoom)??o,(i==null?void 0:i.padding)??.1);return await r.setViewport(c,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),!0}function _S({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},d=i.origin??r;let u=i.extent||s;if(i.extent==="parent"&&!i.expandParent)if(!l)o==null||o("005",In.error005());else{const{width:h,height:g}=An(l);h&&g&&(u=[[a,c],[a+h,c+g]])}else l&&lo(i.extent)&&(u=[[i.extent[0][0]+a,i.extent[0][1]+c],[i.extent[1][0]+a,i.extent[1][1]+c]]);const f=lo(u)?io(t,u,i.measured):t;return(i.measured.width===void 0||i.measured.height===void 0)&&(o==null||o("015",In.error015())),{position:{x:f.x-a+(i.measured.width??0)*d[0],y:f.y-c+(i.measured.height??0)*d[1]},positionAbsolute:f}}async function GO({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const o=new Set(e.map(f=>f.id)),i=[];for(const f of n){if(f.deletable===!1)continue;const h=o.has(f.id),g=!h&&f.parentId&&i.find(x=>x.id===f.parentId);(h||g)&&i.push(f)}const l=new Set(t.map(f=>f.id)),a=r.filter(f=>f.deletable!==!1),d=YO(i,a);for(const f of a)l.has(f.id)&&!d.find(g=>g.id===f.id)&&d.push(f);if(!s)return{edges:d,nodes:i};const u=await s({nodes:i,edges:d});return typeof u=="boolean"?u?{edges:d,nodes:i}:{edges:[],nodes:[]}:u}const Si=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),io=(e={x:0,y:0},t,n)=>({x:Si(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Si(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function OS(e,t,n){const{width:r,height:s}=An(n),{x:o,y:i}=n.internals.positionAbsolute;return io(e,[[o,i],[o+r,i+s]],t)}const ev=(e,t,n)=>e<t?Si(Math.abs(e-t),1,t)/t:e>n?-Si(Math.abs(e-n),1,t)/t:0,mm=(e,t,n=15,r=40)=>{const s=ev(e.x,r,t.width-r)*n,o=ev(e.y,r,t.height-r)*n;return[s,o]},bd=(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)}),Np=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Sd=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),ta=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=pm(e)?e.internals.positionAbsolute:ka(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}},Du=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=pm(e)?e.internals.positionAbsolute:ka(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)}},AS=(e,t)=>Sd(bd(Np(e),Np(t))),jS=(e,t,n,r,s,o,i,l)=>{const a=Math.max(0,Math.min(e+n,s+i)-Math.max(e,s)),c=Math.max(0,Math.min(t+r,o+l)-Math.max(t,o));return Math.ceil(a*c)},Fu=(e,t)=>jS(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),tv=e=>Cn(e.width)&&Cn(e.height)&&Cn(e.x)&&Cn(e.y),Cn=e=>!isNaN(e)&&isFinite(e),zS=(e,t)=>(n,r)=>{},Ra=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Na=({x:e,y:t},[n,r,s],o=!1,i=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return o?Ra(l,i):l},Ei=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function bo(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ZO(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=bo(e,n),s=bo(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=bo(e.top??e.y??0,n),s=bo(e.bottom??e.y??0,n),o=bo(e.left??e.x??0,t),i=bo(e.right??e.x??0,t);return{top:r,right:i,bottom:s,left:o,x:o+i,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function JO(e,t,n,r,s,o){const{x:i,y:l}=Ei(e,[t,n,r]),{x:a,y:c}=Ei({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=s-a,u=o-c;return{left:Math.floor(i),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(u)}}const ym=(e,t,n,r,s,o)=>{const i=ZO(o,t,n),l=(t-i.x)/e.width,a=(n-i.y)/e.height,c=Math.min(l,a),d=Si(c,r,s),u=e.x+e.width/2,f=e.y+e.height/2,h=t/2-u*d,g=n/2-f*d,x=JO(e,h,g,d,t,n),b={left:Math.min(x.left-i.left,0),top:Math.min(x.top-i.top,0),right:Math.min(x.right-i.right,0),bottom:Math.min(x.bottom-i.bottom,0)};return{x:h-b.left+b.right,y:g-b.top+b.bottom,zoom:d}},na=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function lo(e){return e!=null&&e!=="parent"}function An(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 LS(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 DS(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 nv(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function eA(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function tA(e){return{...PS,...e||{}}}function Rl(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:i}=Rn(e),l=Na({x:o-((s==null?void 0:s.left)??0),y:i-((s==null?void 0:s.top)??0)},r),{x:a,y:c}=n?Ra(l,t):l;return{xSnapped:a,ySnapped:c,...l}}const vm=e=>({width:e.offsetWidth,height:e.offsetHeight}),FS=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},nA=["INPUT","SELECT","TEXTAREA"];function $S(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:nA.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const BS=e=>"clientX"in e,Rn=(e,t)=>{var o,i;const n=BS(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)}},rv=(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,...vm(i)}})};function HS({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,d=Math.abs(a-e),u=Math.abs(c-t);return[a,c,d,u]}function mc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function sv({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case de.Left:return[t-mc(t-r,o),n];case de.Right:return[t+mc(r-t,o),n];case de.Top:return[t,n-mc(n-s,o)];case de.Bottom:return[t,n+mc(s-n,o)]}}function VS({sourceX:e,sourceY:t,sourcePosition:n=de.Bottom,targetX:r,targetY:s,targetPosition:o=de.Top,curvature:i=.25}){const[l,a]=sv({pos:n,x1:e,y1:t,x2:r,y2:s,c:i}),[c,d]=sv({pos:o,x1:r,y1:s,x2:e,y2:t,c:i}),[u,f,h,g]=HS({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:a,targetControlX:c,targetControlY:d});return[`M${e},${t} C${l},${a} ${c},${d} ${r},${s}`,u,f,h,g]}function WS({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 rA({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:s=!1,zIndexMode:o="basic"}){if(o==="manual")return r;const i=s&&n?r+1e3:r,l=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return i+l}function sA({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=bd(Du(e),Du(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 Fu(i,Sd(o))>0}const oA=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,iA=(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)),lA=(e,t,n={})=>{var o;if(!e.source||!e.target)return(o=n.onError)==null||o.call(n,"006",In.error006()),t;const r=n.getEdgeId||oA;let s;return IS(e)?s={...e}:s={...e,id:r(e)},iA(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function US({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,i,l]=WS({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,i,l]}const ov={[de.Left]:{x:-1,y:0},[de.Right]:{x:1,y:0},[de.Top]:{x:0,y:-1},[de.Bottom]:{x:0,y:1}},aA=({source:e,sourcePosition:t=de.Bottom,target:n})=>t===de.Left||t===de.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},iv=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function cA({source:e,sourcePosition:t=de.Bottom,target:n,targetPosition:r=de.Top,center:s,offset:o,stepPosition:i}){const l=ov[t],a=ov[r],c={x:e.x+l.x*o,y:e.y+l.y*o},d={x:n.x+a.x*o,y:n.y+a.y*o},u=aA({source:c,sourcePosition:t,target:d}),f=u.x!==0?"x":"y",h=u[f];let g=[],x,b;const p={x:0,y:0},y={x:0,y:0},[,,m,w]=WS({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*a[f]===-1){f==="x"?(x=s.x??c.x+(d.x-c.x)*i,b=s.y??(c.y+d.y)/2):(x=s.x??(c.x+d.x)/2,b=s.y??c.y+(d.y-c.y)*i);const E=[{x,y:c.y},{x,y:d.y}],M=[{x:c.x,y:b},{x:d.x,y:b}];l[f]===h?g=f==="x"?E:M:g=f==="x"?M:E}else{const E=[{x:c.x,y:d.y}],M=[{x:d.x,y:c.y}];if(f==="x"?g=l.x===h?M:E:g=l.y===h?E:M,t===r){const N=Math.abs(e[f]-n[f]);if(N<=o){const T=Math.min(o-1,o-N);l[f]===h?p[f]=(c[f]>e[f]?-1:1)*T:y[f]=(d[f]>n[f]?-1:1)*T}}if(t!==r){const N=f==="x"?"y":"x",T=l[f]===a[N],z=c[N]>d[N],F=c[N]<d[N];(l[f]===1&&(!T&&z||T&&F)||l[f]!==1&&(!T&&F||T&&z))&&(g=f==="x"?E:M)}const _={x:c.x+p.x,y:c.y+p.y},j={x:d.x+y.x,y:d.y+y.y},D=Math.max(Math.abs(_.x-g[0].x),Math.abs(j.x-g[0].x)),O=Math.max(Math.abs(_.y-g[0].y),Math.abs(j.y-g[0].y));D>=O?(x=(_.x+j.x)/2,b=g[0].y):(x=g[0].x,b=(_.y+j.y)/2)}const k={x:c.x+p.x,y:c.y+p.y},C={x:d.x+y.x,y:d.y+y.y};return[[e,...k.x!==g[0].x||k.y!==g[0].y?[k]:[],...g,...C.x!==g[g.length-1].x||C.y!==g[g.length-1].y?[C]:[],n],x,b,m,w]}function uA(e,t,n,r){const s=Math.min(iv(e,t)/2,iv(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,d=e.y<n.y?1:-1;return`L ${o+s*c},${i}Q ${o},${i} ${o},${i+s*d}`}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 Pp({sourceX:e,sourceY:t,sourcePosition:n=de.Bottom,targetX:r,targetY:s,targetPosition:o=de.Top,borderRadius:i=5,centerX:l,centerY:a,offset:c=20,stepPosition:d=.5}){const[u,f,h,g,x]=cA({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:l,y:a},offset:c,stepPosition:d});let b=`M${u[0].x} ${u[0].y}`;for(let p=1;p<u.length-1;p++)b+=uA(u[p-1],u[p],u[p+1],i);return b+=`L${u[u.length-1].x} ${u[u.length-1].y}`,[b,f,h,g,x]}function lv(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function dA(e){var u;const{sourceNode:t,targetNode:n}=e;if(!lv(t)||!lv(n))return null;const r=t.internals.handleBounds||av(t.handles),s=n.internals.handleBounds||av(n.handles),o=cv((r==null?void 0:r.source)??[],e.sourceHandle),i=cv(e.connectionMode===bi.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(u=e.onError)==null||u.call(e,"008",In.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(o==null?void 0:o.position)||de.Bottom,a=(i==null?void 0:i.position)||de.Top,c=ao(t,o,l),d=ao(n,i,a);return{sourceX:c.x,sourceY:c.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:a}}function av(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 ao(e,t,n=de.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??An(e);if(r)return{x:s+i/2,y:o+l/2};switch((t==null?void 0:t.position)??n){case de.Top:return{x:s+i/2,y:o};case de.Right:return{x:s+i,y:o+l/2};case de.Bottom:return{x:s+i/2,y:o+l};case de.Left:return{x:s,y:o+l/2}}}function cv(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Tp(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function fA(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=Tp(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 KS=1e3,hA=10,xm={nodeOrigin:[0,0],nodeExtent:Jl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},pA={...xm,checkEquality:!0};function wm(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function gA(e,t,n){const r=wm(xm,n);for(const s of e.values())if(s.parentId)Sm(s,e,t,r);else{const o=ka(s,r.nodeOrigin),i=lo(s.extent)?s.extent:r.nodeExtent,l=io(o,i,An(s));s.internals.positionAbsolute=l}}function mA(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const s of e.handles){const o={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(o):s.type==="target"&&r.push(o)}return{source:n,target:r}}function bm(e){return e==="manual"}function Mp(e,t,n,r={}){var d,u;const s=wm(pA,r),o={i:0},i=new Map(t),l=s!=null&&s.elevateNodesOnSelect&&!bm(s.zIndexMode)?KS:0;let a=e.length>0,c=!1;t.clear(),n.clear();for(const f of e){let h=i.get(f.id);if(s.checkEquality&&f===(h==null?void 0:h.internals.userNode))t.set(f.id,h);else{const g=ka(f,s.nodeOrigin),x=lo(f.extent)?f.extent:s.nodeExtent,b=io(g,x,An(f));h={...s.defaults,...f,measured:{width:(d=f.measured)==null?void 0:d.width,height:(u=f.measured)==null?void 0:u.height},internals:{positionAbsolute:b,handleBounds:mA(f,h),z:qS(f,l,s.zIndexMode),userNode:f}},t.set(f.id,h)}(h.measured===void 0||h.measured.width===void 0||h.measured.height===void 0)&&!h.hidden&&(a=!1),f.parentId&&Sm(h,t,n,r,o),c||(c=f.selected??!1)}return{nodesInitialized:a,hasSelectedNodes:c}}function yA(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 Sm(e,t,n,r,s){const{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:l,zIndexMode:a}=wm(xm,r),c=e.parentId,d=t.get(c);if(!d){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}yA(e,n),s&&!d.parentId&&d.internals.rootParentIndex===void 0&&a==="auto"&&(d.internals.rootParentIndex=++s.i,d.internals.z=d.internals.z+s.i*hA),s&&d.internals.rootParentIndex!==void 0&&(s.i=d.internals.rootParentIndex);const u=o&&!bm(a)?KS:0,{x:f,y:h,z:g}=vA(e,d,i,l,u,a),{positionAbsolute:x}=e.internals,b=f!==x.x||h!==x.y;(b||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:f,y:h}:x,z:g}})}function qS(e,t,n){const r=Cn(e.zIndex)?e.zIndex:0;return bm(n)?r:r+(e.selected?t:0)}function vA(e,t,n,r,s,o){const{x:i,y:l}=t.internals.positionAbsolute,a=An(e),c=ka(e,n),d=lo(e.extent)?io(c,e.extent,a):c;let u=io({x:i+d.x,y:l+d.y},r,a);e.extent==="parent"&&(u=OS(u,a,t));const f=qS(e,s,o),h=t.internals.z??0;return{x:u.x,y:u.y,z:h>=f?h+1:f}}function Em(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)??ta(a),d=AS(c,l.rect);o.set(l.parentId,{expandedRect:d,parent:a})}return o.size>0&&o.forEach(({expandedRect:l,parent:a},c)=>{var m;const d=a.internals.positionAbsolute,u=An(a),f=a.origin??r,h=l.x<d.x?Math.round(Math.abs(d.x-l.x)):0,g=l.y<d.y?Math.round(Math.abs(d.y-l.y)):0,x=Math.max(u.width,Math.round(l.width)),b=Math.max(u.height,Math.round(l.height)),p=(x-u.width)*f[0],y=(b-u.height)*f[1];(h>0||g>0||p||y)&&(s.push({id:c,type:"position",position:{x:a.position.x-h+p,y:a.position.y-g+y}}),(m=n.get(c))==null||m.forEach(w=>{e.some(k=>k.id===w.id)||s.push({id:w.id,type:"position",position:{x:w.position.x+h,y:w.position.y+g}})})),(u.width<l.width||u.height<l.height||h||g)&&s.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:x+(h?f[0]*h-p:0),height:b+(g?f[1]*g-y:0)}})}),s}function xA(e,t,n,r,s,o,i){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let a=!1;if(!l)return{changes:[],updatedInternals:a};const c=[],d=window.getComputedStyle(l),{m22:u}=new window.DOMMatrixReadOnly(d.transform),f=[];for(const h of e.values()){const g=t.get(h.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),a=!0;continue}const x=vm(h.nodeElement),b=g.measured.width!==x.width||g.measured.height!==x.height;if(!!(x.width&&x.height&&(b||!g.internals.handleBounds||h.force))){const y=h.nodeElement.getBoundingClientRect(),m=lo(g.extent)?g.extent:o;let{positionAbsolute:w}=g.internals;if(g.parentId&&g.extent==="parent"){const C=t.get(g.parentId);C&&(w=OS(w,x,C))}else m&&(w=io(w,m,x));const k={...g,measured:x,internals:{...g.internals,positionAbsolute:w,handleBounds:{source:rv("source",h.nodeElement,y,u,g.id),target:rv("target",h.nodeElement,y,u,g.id)}}};t.set(g.id,k),g.parentId&&Sm(k,t,n,{nodeOrigin:s,zIndexMode:i}),a=!0,b&&(c.push({id:g.id,type:"dimensions",dimensions:x}),g.expandParent&&g.parentId&&f.push({id:g.id,parentId:g.parentId,rect:ta(k,s)}))}}if(f.length>0){const h=Em(f,t,n,s);c.push(...h)}return{changes:c,updatedInternals:a}}async function wA({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:o}){if(!t||!e.x&&!e.y)return!1;const i=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,o]],r);return!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2])}function uv(e,t,n,r,s,o){let i=s;const l=r.get(i)||new Map;r.set(i,l.set(n,t)),i=`${s}-${e}`;const a=r.get(i)||new Map;if(r.set(i,a.set(n,t)),o){i=`${s}-${e}-${o}`;const c=r.get(i)||new Map;r.set(i,c.set(n,t))}}function YS(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:o,sourceHandle:i=null,targetHandle:l=null}=r,a={edgeId:r.id,source:s,target:o,sourceHandle:i,targetHandle:l},c=`${s}-${i}--${o}-${l}`,d=`${o}-${l}--${s}-${i}`;uv("source",a,d,e,s,i),uv("target",a,c,e,o,l),t.set(r.id,r)}}function QS(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:QS(n,t):!1}function dv(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function bA(e,t,n,r){const s=new Map;for(const[o,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!QS(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 jf({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var i,l,a;const s=[];for(const[c,d]of t){const u=(i=n.get(c))==null?void 0:i.internals.userNode;u&&s.push({...u,position:d.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 SA({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const o={x:n-s.distance.x,y:r-s.distance.y},i=Ra(o,t);return{x:i.x-o.x,y:i.y-o.y}}function EA({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},d=null,u=!1,f=null,h=!1,g=!1,x=null;function b({noDragClassName:y,handleSelector:m,domNode:w,isSelectable:k,nodeId:C,nodeClickDistance:R=0}){f=Gt(w);function E({x:D,y:O}){const{nodeLookup:N,nodeExtent:T,snapGrid:z,snapToGrid:F,nodeOrigin:P,onNodeDrag:I,onSelectionDrag:A,onError:B,updateNodePositions:$}=t();o={x:D,y:O};let U=!1;const q=l.size>1,K=q&&T?Np(Ca(l)):null,X=q&&F?SA({dragItems:l,snapGrid:z,x:D,y:O}):null;for(const[G,H]of l){if(!N.has(G))continue;let Y={x:D-H.distance.x,y:O-H.distance.y};F&&(Y=X?{x:Math.round(Y.x+X.x),y:Math.round(Y.y+X.y)}:Ra(Y,z));let te=null;if(q&&T&&!H.extent&&K){const{positionAbsolute:Q}=H.internals,ce=Q.x-K.x+T[0][0],re=Q.x+H.measured.width-K.x2+T[1][0],W=Q.y-K.y+T[0][1],J=Q.y+H.measured.height-K.y2+T[1][1];te=[[ce,W],[re,J]]}const{position:V,positionAbsolute:Z}=_S({nodeId:G,nextPosition:Y,nodeLookup:N,nodeExtent:te||T,nodeOrigin:P,onError:B});U=U||H.position.x!==V.x||H.position.y!==V.y,H.position=V,H.internals.positionAbsolute=Z}if(g=g||U,!!U&&($(l,!0),x&&(r||I||!C&&A))){const[G,H]=jf({nodeId:C,dragItems:l,nodeLookup:N});r==null||r(x,l,G,H),I==null||I(x,G,H),C||A==null||A(x,H)}}async function M(){if(!d)return;const{transform:D,panBy:O,autoPanSpeed:N,autoPanOnNodeDrag:T}=t();if(!T){a=!1,cancelAnimationFrame(i);return}const[z,F]=mm(c,d,N);(z!==0||F!==0)&&(o.x=(o.x??0)-z/D[2],o.y=(o.y??0)-F/D[2],await O({x:z,y:F})&&E(o)),i=requestAnimationFrame(M)}function _(D){var q;const{nodeLookup:O,multiSelectionActive:N,nodesDraggable:T,transform:z,snapGrid:F,snapToGrid:P,selectNodesOnDrag:I,onNodeDragStart:A,onSelectionDragStart:B,unselectNodesAndEdges:$}=t();u=!0,(!I||!k)&&!N&&C&&((q=O.get(C))!=null&&q.selected||$()),k&&I&&C&&(e==null||e(C));const U=Rl(D.sourceEvent,{transform:z,snapGrid:F,snapToGrid:P,containerBounds:d});if(o=U,l=bA(O,T,U,C),l.size>0&&(n||A||!C&&B)){const[K,X]=jf({nodeId:C,dragItems:l,nodeLookup:O});n==null||n(D.sourceEvent,l,K,X),A==null||A(D.sourceEvent,K,X),C||B==null||B(D.sourceEvent,X)}}const j=dS().clickDistance(R).on("start",D=>{const{domNode:O,nodeDragThreshold:N,transform:T,snapGrid:z,snapToGrid:F}=t();d=(O==null?void 0:O.getBoundingClientRect())||null,h=!1,g=!1,x=D.sourceEvent,N===0&&_(D),o=Rl(D.sourceEvent,{transform:T,snapGrid:z,snapToGrid:F,containerBounds:d}),c=Rn(D.sourceEvent,d)}).on("drag",D=>{const{autoPanOnNodeDrag:O,transform:N,snapGrid:T,snapToGrid:z,nodeDragThreshold:F,nodeLookup:P}=t(),I=Rl(D.sourceEvent,{transform:N,snapGrid:T,snapToGrid:z,containerBounds:d});if(x=D.sourceEvent,(D.sourceEvent.type==="touchmove"&&D.sourceEvent.touches.length>1||C&&!P.has(C))&&(h=!0),!h){if(!a&&O&&u&&(a=!0,M()),!u){const A=Rn(D.sourceEvent,d),B=A.x-c.x,$=A.y-c.y;Math.sqrt(B*B+$*$)>F&&_(D)}(o.x!==I.xSnapped||o.y!==I.ySnapped)&&l&&u&&(c=Rn(D.sourceEvent,d),E(I))}}).on("end",D=>{if(!u||h){h&&l.size>0&&t().updateNodePositions(l,!1);return}if(a=!1,u=!1,cancelAnimationFrame(i),l.size>0){const{nodeLookup:O,updateNodePositions:N,onNodeDragStop:T,onSelectionDragStop:z}=t();if(g&&(N(l,!1),g=!1),s||T||!C&&z){const[F,P]=jf({nodeId:C,dragItems:l,nodeLookup:O,dragging:!1});s==null||s(D.sourceEvent,l,F,P),T==null||T(D.sourceEvent,F,P),C||z==null||z(D.sourceEvent,P)}}}).filter(D=>{const O=D.target;return!D.button&&(!y||!dv(O,`.${y}`,w))&&(!m||dv(O,m,w))});f.call(j)}function p(){f==null||f.on(".drag",null)}return{update:b,destroy:p}}function kA(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())Fu(s,ta(o))>0&&r.push(o);return r}const CA=250;function RA(e,t,n,r){var l,a;let s=[],o=1/0;const i=kA(e,n,t+CA);for(const c of i){const d=[...((l=c.internals.handleBounds)==null?void 0:l.source)??[],...((a=c.internals.handleBounds)==null?void 0:a.target)??[]];for(const u of d){if(r.nodeId===u.nodeId&&r.type===u.type&&r.id===u.id)continue;const{x:f,y:h}=ao(c,u,u.position,!0),g=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(h-e.y,2));g>t||(g<o?(s=[{...u,x:f,y:h}],o=g):g===o&&s.push({...u,x:f,y:h}))}}if(!s.length)return null;if(s.length>1){const c=r.type==="source"?"target":"source";return s.find(d=>d.type===c)??s[0]}return s[0]}function XS(e,t,n,r,s,o=!1){var c,d,u;const i=r.get(e);if(!i)return null;const l=s==="strict"?(c=i.internals.handleBounds)==null?void 0:c[t]:[...((d=i.internals.handleBounds)==null?void 0:d.source)??[],...((u=i.internals.handleBounds)==null?void 0:u.target)??[]],a=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return a&&o?{...a,...ao(i,a,a.position,!0)}:a}function GS(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function NA(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const ZS=()=>!0;function PA(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:i,domNode:l,nodeLookup:a,lib:c,autoPanOnConnect:d,flowId:u,panBy:f,cancelConnection:h,onConnectStart:g,onConnect:x,onConnectEnd:b,isValidConnection:p=ZS,onReconnectEnd:y,updateConnection:m,getTransform:w,getFromHandle:k,autoPanSpeed:C,dragThreshold:R=1,handleDomNode:E}){const M=FS(e.target);let _=0,j;const{x:D,y:O}=Rn(e),N=GS(o,E),T=l==null?void 0:l.getBoundingClientRect();let z=!1;if(!T||!N)return;const F=XS(s,N,r,a,t);if(!F)return;let P=Rn(e,T),I=!1,A=null,B=!1,$=null;function U(){if(!d||!T)return;const[V,Z]=mm(P,T,C);f({x:V,y:Z}),_=requestAnimationFrame(U)}const q={...F,nodeId:s,type:N,position:F.position},K=a.get(s);let G={inProgress:!0,isValid:null,from:ao(K,q,de.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:K,to:P,toHandle:null,toPosition:Jy[q.position],toNode:null,pointer:P};function H(){z=!0,m(G),g==null||g(e,{nodeId:s,handleId:r,handleType:N})}R===0&&H();function Y(V){if(!z){const{x:J,y:se}=Rn(V),pe=J-D,me=se-O;if(!(pe*pe+me*me>R*R))return;H()}if(!k()||!q){te(V);return}const Z=w();P=Rn(V,T),j=RA(Na(P,Z,!1,[1,1]),n,a,q),I||(U(),I=!0);const Q=JS(V,{handle:j,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:i?"target":"source",isValidConnection:p,doc:M,lib:c,flowId:u,nodeLookup:a});$=Q.handleDomNode,A=Q.connection,B=NA(!!j,Q.isValid);const ce=a.get(s),re=ce?ao(ce,q,de.Left,!0):G.from,W={...G,from:re,isValid:B,to:Q.toHandle&&B?Ei({x:Q.toHandle.x,y:Q.toHandle.y},Z):P,toHandle:Q.toHandle,toPosition:B&&Q.toHandle?Q.toHandle.position:Jy[q.position],toNode:Q.toHandle?a.get(Q.toHandle.nodeId):null,pointer:P};m(W),G=W}function te(V){if(!("touches"in V&&V.touches.length>0)){if(z){(j||$)&&A&&B&&(x==null||x(A));const{inProgress:Z,...Q}=G,ce={...Q,toPosition:G.toHandle?G.toPosition:null};b==null||b(V,ce),o&&(y==null||y(V,ce))}h(),cancelAnimationFrame(_),I=!1,B=!1,A=null,$=null,M.removeEventListener("mousemove",Y),M.removeEventListener("mouseup",te),M.removeEventListener("touchmove",Y),M.removeEventListener("touchend",te)}}M.addEventListener("mousemove",Y),M.addEventListener("mouseup",te),M.addEventListener("touchmove",Y),M.addEventListener("touchend",te)}function JS(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:i,lib:l,flowId:a,isValidConnection:c=ZS,nodeLookup:d}){const u=o==="target",f=t?i.querySelector(`.${l}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y:g}=Rn(e),x=i.elementFromPoint(h,g),b=x!=null&&x.classList.contains(`${l}-flow__handle`)?x:f,p={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const y=GS(void 0,b),m=b.getAttribute("data-nodeid"),w=b.getAttribute("data-handleid"),k=b.classList.contains("connectable"),C=b.classList.contains("connectableend");if(!m||!y)return p;const R={source:u?m:r,sourceHandle:u?w:s,target:u?r:m,targetHandle:u?s:w};p.connection=R;const M=k&&C&&(n===bi.Strict?u&&y==="source"||!u&&y==="target":m!==r||w!==s);p.isValid=M&&c(R),p.toHandle=XS(m,y,w,d,n,!0)}return p}const Ip={onPointerDown:PA,isValid:JS};function TA({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=Gt(e);function o({translateExtent:l,width:a,height:c,zoomStep:d=1,pannable:u=!0,zoomable:f=!0,inversePan:h=!1}){const g=m=>{if(m.sourceEvent.type!=="wheel"||!t)return;const w=n(),k=m.sourceEvent.ctrlKey&&na()?10:1,C=-m.sourceEvent.deltaY*(m.sourceEvent.deltaMode===1?.05:m.sourceEvent.deltaMode?1:.002)*d,R=w[2]*Math.pow(2,C*k);t.scaleTo(R)};let x=[0,0];const b=m=>{(m.sourceEvent.type==="mousedown"||m.sourceEvent.type==="touchstart")&&(x=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY])},p=m=>{const w=n();if(m.sourceEvent.type!=="mousemove"&&m.sourceEvent.type!=="touchmove"||!t)return;const k=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY],C=[k[0]-x[0],k[1]-x[1]];x=k;const R=r()*Math.max(w[2],Math.log(w[2]))*(h?-1:1),E={x:w[0]-C[0]*R,y:w[1]-C[1]*R},M=[[0,0],[a,c]];t.setViewportConstrained({x:E.x,y:E.y,zoom:w[2]},M,l)},y=RS().on("start",b).on("zoom",u?p:null).on("zoom.wheel",f?g:null);s.call(y,{})}function i(){s.on("zoom",null)}return{update:o,destroy:i,pointer:Sn}}const Ed=e=>({x:e.x,y:e.y,zoom:e.k}),zf=({x:e,y:t,zoom:n})=>wd.translate(e,t).scale(n),zr=(e,t)=>e.target.closest(`.${t}`),eE=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),MA=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Lf=(e,t=0,n=MA,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},tE=e=>{const t=e.ctrlKey&&na()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function IA({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:c}){return d=>{if(zr(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const u=n.property("__zoom").k||1;if(d.ctrlKey&&i){const b=Sn(d),p=tE(d),y=u*Math.pow(2,p);r.scaleTo(n,y,b,d);return}const f=d.deltaMode===1?20:1;let h=s===Qs.Vertical?0:d.deltaX*f,g=s===Qs.Horizontal?0:d.deltaY*f;!na()&&d.shiftKey&&s!==Qs.Vertical&&(h=d.deltaY*f,g=0),r.translateBy(n,-(h/u)*o,-(g/u)*o,{internal:!0});const x=Ed(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?a==null||a(d,x):(e.isPanScrolling=!0,l==null||l(d,x)),e.panScrollTimeout=setTimeout(()=>{c==null||c(d,x),e.isPanScrolling=!1},150)}}function _A({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const o=r.type==="wheel",i=!t&&o&&!r.ctrlKey,l=zr(r,e);if(r.ctrlKey&&o&&l&&r.preventDefault(),i||l)return null;r.preventDefault(),n.call(this,r,s)}}function OA({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,i,l;if((o=r.sourceEvent)!=null&&o.internal)return;const s=Ed(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 AA({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var i,l;e.usedRightMouseButton=!!(n&&eE(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,Ed(o.transform)))}}function jA({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&&eE(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&o(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const a=Ed(i.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(i.sourceEvent,a)},n?150:0)}}}function zA({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:s,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:a,noPanClassName:c,lib:d,connectionInProgress:u}){return f=>{var p;const h=t||n,g=r&&f.ctrlKey,x=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(zr(f,`${d}-flow__node`)||zr(f,`${d}-flow__edge`)||zr(f,`${d}-flow__selection`)||zr(f,`${d}-flow__nodesselection`)))return!0;if(!s&&!h&&!o&&!i&&!r||l||u&&!x||zr(f,a)&&x||zr(f,c)&&(!x||o&&x&&!t)||!r&&f.ctrlKey&&x)return!1;if(!r&&f.type==="touchstart"&&((p=f.touches)==null?void 0:p.length)>1)return f.preventDefault(),!1;if(!h&&!o&&!g&&x||!s&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(s)&&!s.includes(f.button)&&f.type==="mousedown")return!1;const b=Array.isArray(s)&&s.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||x||e)&&b}}function LA({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:o,onPanZoomStart:i,onPanZoomEnd:l,onDraggingChange:a}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect();let u=[[0,0],[d.width,d.height]];const f=typeof ResizeObserver<"u"?new ResizeObserver(O=>{const N=O[0];N&&(u=[[0,0],[N.contentRect.width,N.contentRect.height]])}):null;f==null||f.observe(e);const h=RS().extent(()=>u).scaleExtent([t,n]).translateExtent(r),g=Gt(e).call(h);w({x:s.x,y:s.y,zoom:Si(s.zoom,t,n)},[[0,0],[d.width,d.height]],r);const x=g.on("wheel.zoom"),b=g.on("dblclick.zoom");h.wheelDelta(tE);async function p(O,N){return g?new Promise(T=>{h==null||h.interpolate((N==null?void 0:N.interpolate)==="linear"?Cl:Hc).transform(Lf(g,N==null?void 0:N.duration,N==null?void 0:N.ease,()=>T(!0)),O)}):!1}function y({noWheelClassName:O,noPanClassName:N,onPaneContextMenu:T,userSelectionActive:z,panOnScroll:F,panOnDrag:P,panOnScrollMode:I,panOnScrollSpeed:A,preventScrolling:B,zoomOnPinch:$,zoomOnScroll:U,zoomOnDoubleClick:q,panActivationKeyPressed:K=!1,zoomActivationKeyPressed:X,lib:G,onTransformChange:H,connectionInProgress:Y,paneClickDistance:te,selectionOnDrag:V}){z&&!c.isZoomingOrPanning&&m();const Z=F&&!X&&!z;h.clickDistance(V?1/0:!Cn(te)||te<0?0:te);const Q=Z?IA({zoomPanValues:c,noWheelClassName:O,d3Selection:g,d3Zoom:h,panOnScrollMode:I,panOnScrollSpeed:A,zoomOnPinch:$,onPanZoomStart:i,onPanZoom:o,onPanZoomEnd:l}):_A({noWheelClassName:O,preventScrolling:B,d3ZoomHandler:x});g.on("wheel.zoom",Q,{passive:!1});const ce=OA({zoomPanValues:c,onDraggingChange:a,onPanZoomStart:i});h.on("start",ce);const re=AA({zoomPanValues:c,panOnDrag:P,onPaneContextMenu:!!T,onPanZoom:o,onTransformChange:H});h.on("zoom",re);const W=jA({zoomPanValues:c,panOnDrag:P,panOnScroll:F,onPaneContextMenu:T,onPanZoomEnd:l,onDraggingChange:a});h.on("end",W);const J=zA({panActivationKeyPressed:K,zoomActivationKeyPressed:X,panOnDrag:P,zoomOnScroll:U,panOnScroll:F,zoomOnDoubleClick:q,zoomOnPinch:$,userSelectionActive:z,noPanClassName:N,noWheelClassName:O,lib:G,connectionInProgress:Y});h.filter(J),q?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function m(){h.on("zoom",null)}async function w(O,N,T){const z=zf(O),F=h==null?void 0:h.constrain()(z,N,T);return F&&await p(F),F}async function k(O,N){const T=zf(O);return await p(T,N),T}function C(O){if(g){const N=zf(O),T=g.property("__zoom");(T.k!==O.zoom||T.x!==O.x||T.y!==O.y)&&(h==null||h.transform(g,N,null,{sync:!0}))}}function R(){const O=g?CS(g.node()):{x:0,y:0,k:1};return{x:O.x,y:O.y,zoom:O.k}}async function E(O,N){return g?new Promise(T=>{h==null||h.interpolate((N==null?void 0:N.interpolate)==="linear"?Cl:Hc).scaleTo(Lf(g,N==null?void 0:N.duration,N==null?void 0:N.ease,()=>T(!0)),O)}):!1}async function M(O,N){return g?new Promise(T=>{h==null||h.interpolate((N==null?void 0:N.interpolate)==="linear"?Cl:Hc).scaleBy(Lf(g,N==null?void 0:N.duration,N==null?void 0:N.ease,()=>T(!0)),O)}):!1}function _(O){h==null||h.scaleExtent(O)}function j(O){h==null||h.translateExtent(O)}function D(O){const N=!Cn(O)||O<0?0:O;h==null||h.clickDistance(N)}return{update:y,destroy:m,setViewport:k,setViewportConstrained:w,getViewport:R,scaleTo:E,scaleBy:M,setScaleExtent:_,setTranslateExtent:j,syncViewport:C,setClickDistance:D}}var ki;(function(e){e.Line="line",e.Handle="handle"})(ki||(ki={}));function DA({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 fv(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 Ir(e,t){return Math.max(0,t-e)}function _r(e,t){return Math.max(0,e-t)}function yc(e,t,n){return Math.max(0,t-e,e-n)}function hv(e,t){return e?!t:t}function FA(e,t,n,r,s,o,i,l){let{affectsX:a,affectsY:c}=t;const{isHorizontal:d,isVertical:u}=t,f=d&&u,{xSnapped:h,ySnapped:g}=n,{minWidth:x,maxWidth:b,minHeight:p,maxHeight:y}=r,{x:m,y:w,width:k,height:C,aspectRatio:R}=e;let E=Math.floor(d?h-e.pointerX:0),M=Math.floor(u?g-e.pointerY:0);const _=k+(a?-E:E),j=C+(c?-M:M),D=-o[0]*k,O=-o[1]*C;let N=yc(_,x,b),T=yc(j,p,y);if(i){let P=0,I=0;a&&E<0?P=Ir(m+E+D,i[0][0]):!a&&E>0&&(P=_r(m+_+D,i[1][0])),c&&M<0?I=Ir(w+M+O,i[0][1]):!c&&M>0&&(I=_r(w+j+O,i[1][1])),N=Math.max(N,P),T=Math.max(T,I)}if(l){let P=0,I=0;a&&E>0?P=_r(m+E,l[0][0]):!a&&E<0&&(P=Ir(m+_,l[1][0])),c&&M>0?I=_r(w+M,l[0][1]):!c&&M<0&&(I=Ir(w+j,l[1][1])),N=Math.max(N,P),T=Math.max(T,I)}if(s){if(d){const P=yc(_/R,p,y)*R;if(N=Math.max(N,P),i){let I=0;!a&&!c||a&&!c&&f?I=_r(w+O+_/R,i[1][1])*R:I=Ir(w+O+(a?E:-E)/R,i[0][1])*R,N=Math.max(N,I)}if(l){let I=0;!a&&!c||a&&!c&&f?I=Ir(w+_/R,l[1][1])*R:I=_r(w+(a?E:-E)/R,l[0][1])*R,N=Math.max(N,I)}}if(u){const P=yc(j*R,x,b)/R;if(T=Math.max(T,P),i){let I=0;!a&&!c||c&&!a&&f?I=_r(m+j*R+D,i[1][0])/R:I=Ir(m+(c?M:-M)*R+D,i[0][0])/R,T=Math.max(T,I)}if(l){let I=0;!a&&!c||c&&!a&&f?I=Ir(m+j*R,l[1][0])/R:I=_r(m+(c?M:-M)*R,l[0][0])/R,T=Math.max(T,I)}}}M=M+(M<0?T:-T),E=E+(E<0?N:-N),s&&(f?_>j*R?M=(hv(a,c)?-E:E)/R:E=(hv(a,c)?-M:M)*R:d?(M=E/R,c=a):(E=M*R,a=c));const z=a?m+E:m,F=c?w+M:w;return{width:k+(a?-E:E),height:C+(c?-M:M),x:o[0]*E*(a?-1:1)+z,y:o[1]*M*(c?-1:1)+F}}const nE={width:0,height:0,x:0,y:0},$A={...nE,pointerX:0,pointerY:0,aspectRatio:1};function BA(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 HA({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=Gt(e);let i={controlDirection:fv("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:c,boundaries:d,keepAspectRatio:u,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:x,shouldResize:b}){let p={...nE},y={...$A};i={boundaries:d,resizeDirection:f,keepAspectRatio:u,controlDirection:fv(c)};let m,w=null,k=[],C,R,E,M=!1;const _=dS().on("start",j=>{const{nodeLookup:D,transform:O,snapGrid:N,snapToGrid:T,nodeOrigin:z,paneDomNode:F}=n();if(m=D.get(t),!m)return;w=(F==null?void 0:F.getBoundingClientRect())??null;const{xSnapped:P,ySnapped:I}=Rl(j.sourceEvent,{transform:O,snapGrid:N,snapToGrid:T,containerBounds:w});p={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},y={...p,pointerX:P,pointerY:I,aspectRatio:p.width/p.height},C=void 0,R=lo(m.extent)?m.extent:void 0,m.parentId&&(m.extent==="parent"||m.expandParent)&&(C=D.get(m.parentId)),C&&m.extent==="parent"&&(R=[[0,0],[C.measured.width,C.measured.height]]),k=[],E=void 0;for(const[A,B]of D)if(B.parentId===t&&(k.push({id:A,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const $=BA(B,m,B.origin??z);E?E=[[Math.min($[0][0],E[0][0]),Math.min($[0][1],E[0][1])],[Math.max($[1][0],E[1][0]),Math.max($[1][1],E[1][1])]]:E=$}h==null||h(j,{...p})}).on("drag",j=>{const{transform:D,snapGrid:O,snapToGrid:N,nodeOrigin:T}=n(),z=Rl(j.sourceEvent,{transform:D,snapGrid:O,snapToGrid:N,containerBounds:w}),F=[];if(!m)return;const{x:P,y:I,width:A,height:B}=p,$={},U=m.origin??T,{width:q,height:K,x:X,y:G}=FA(y,i.controlDirection,z,i.boundaries,i.keepAspectRatio,U,R,E),H=q!==A,Y=K!==B,te=X!==P&&H,V=G!==I&&Y;if(!te&&!V&&!H&&!Y)return;if((te||V||U[0]===1||U[1]===1)&&($.x=te?X:p.x,$.y=V?G:p.y,p.x=$.x,p.y=$.y,k.length>0)){const re=X-P,W=G-I;for(const J of k)J.position={x:J.position.x-re+U[0]*(q-A),y:J.position.y-W+U[1]*(K-B)},F.push(J)}if((H||Y)&&($.width=H&&(!i.resizeDirection||i.resizeDirection==="horizontal")?q:p.width,$.height=Y&&(!i.resizeDirection||i.resizeDirection==="vertical")?K:p.height,p.width=$.width,p.height=$.height),C&&m.expandParent){const re=U[0]*($.width??0);$.x&&$.x<re&&(p.x=re,y.x=y.x-($.x-re));const W=U[1]*($.height??0);$.y&&$.y<W&&(p.y=W,y.y=y.y-($.y-W))}const Z=DA({width:p.width,prevWidth:A,height:p.height,prevHeight:B,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),Q={...p,direction:Z};(b==null?void 0:b(j,Q))!==!1&&(M=!0,g==null||g(j,Q),r($,F))}).on("end",j=>{M&&(x==null||x(j,{...p}),s==null||s({...p}),M=!1)});o.call(_)}function a(){o.on(".drag",null)}return{update:l,destroy:a}}var rE={exports:{}},sE={},oE={exports:{}},iE={};/**
|
|
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 Ci=S;function VA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var WA=typeof Object.is=="function"?Object.is:VA,UA=Ci.useState,KA=Ci.useEffect,qA=Ci.useLayoutEffect,YA=Ci.useDebugValue;function QA(e,t){var n=t(),r=UA({inst:{value:n,getSnapshot:t}}),s=r[0].inst,o=r[1];return qA(function(){s.value=n,s.getSnapshot=t,Df(s)&&o({inst:s})},[e,n,t]),KA(function(){return Df(s)&&o({inst:s}),e(function(){Df(s)&&o({inst:s})})},[e]),YA(n),n}function Df(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!WA(e,n)}catch{return!0}}function XA(e,t){return t()}var GA=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?XA:QA;iE.useSyncExternalStore=Ci.useSyncExternalStore!==void 0?Ci.useSyncExternalStore:GA;oE.exports=iE;var lE=oE.exports;/**
|
|
49
|
+
* @license React
|
|
50
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/var kd=S,ZA=lE;function JA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ej=typeof Object.is=="function"?Object.is:JA,tj=ZA.useSyncExternalStore,nj=kd.useRef,rj=kd.useEffect,sj=kd.useMemo,oj=kd.useDebugValue;sE.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var o=nj(null);if(o.current===null){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=sj(function(){function a(h){if(!c){if(c=!0,d=h,h=r(h),s!==void 0&&i.hasValue){var g=i.value;if(s(g,h))return u=g}return u=h}if(g=u,ej(d,h))return g;var x=r(h);return s!==void 0&&s(g,x)?(d=h,g):(d=h,u=x)}var c=!1,d,u,f=n===void 0?null:n;return[function(){return a(t())},f===null?void 0:function(){return a(f())}]},[t,n,r,s]);var l=tj(e,o[0],o[1]);return rj(function(){i.hasValue=!0,i.value=l},[l]),oj(l),l};rE.exports=sE;var aE=rE.exports;const ij=$x(aE),lj={},pv=e=>{let t;const n=new Set,r=(d,u)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const h=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(g=>g(t,h))}},s=()=>t,a={setState:r,getState:s,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(lj?"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},aj=e=>e?pv(e):pv,{useDebugValue:cj}=Gx,{useSyncExternalStoreWithSelector:uj}=ij,dj=e=>e;function cE(e,t=dj,n){const r=uj(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return cj(r),r}const gv=(e,t)=>{const n=aj(e),r=(s,o=t)=>cE(n,s,o);return Object.assign(r,n),r},fj=(e,t)=>e?gv(e,t):gv;function We(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 Cd=S.createContext(null),hj=Cd.Provider,uE=In.error001("react");function Ce(e,t){const n=S.useContext(Cd);if(n===null)throw new Error(uE);return cE(n,e,t)}function Le(){const e=S.useContext(Cd);if(e===null)throw new Error(uE);return S.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const mv={display:"none"},pj={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},dE="react-flow__node-desc",fE="react-flow__edge-desc",gj="react-flow__aria-live",mj=e=>e.ariaLiveMessage,yj=e=>e.ariaLabelConfig;function vj({rfId:e}){const t=Ce(mj);return v.jsx("div",{id:`${gj}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:pj,children:t})}function xj({rfId:e,disableKeyboardA11y:t}){const n=Ce(yj);return v.jsxs(v.Fragment,{children:[v.jsx("div",{id:`${dE}-${e}`,style:mv,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),v.jsx("div",{id:`${fE}-${e}`,style:mv,children:n["edge.a11yDescription.default"]}),!t&&v.jsx(vj,{rfId:e})]})}const Rd=S.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const i=`${e}`.split("-");return v.jsx("div",{className:et(["react-flow__panel",n,...i]),style:r,ref:o,...s,children:t})});Rd.displayName="Panel";const yv="https://reactflow.dev?utm_source=attribution";function wj({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:v.jsx(Rd,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${yv}`,children:v.jsx("a",{href:yv,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const bj=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}},vc=e=>e.id;function Sj(e,t){return We(e.selectedNodes.map(vc),t.selectedNodes.map(vc))&&We(e.selectedEdges.map(vc),t.selectedEdges.map(vc))}function Ej({onSelectionChange:e}){const t=Le(),{selectedNodes:n,selectedEdges:r}=Ce(bj,Sj);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 kj=e=>!!e.onSelectionChangeHandlers;function Cj({onSelectionChange:e}){const t=Ce(kj);return e||t?v.jsx(Ej,{onSelectionChange:e}):null}const hE=[0,0],Rj={x:0,y:0,zoom:1},Nj=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],vv=[...Nj,"rfId"],Pj=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}),xv={translateExtent:Jl,nodeOrigin:hE,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Tj(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:a}=Ce(Pj,We),c=Le();S.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{d.current=xv,l()}),[]);const d=S.useRef(xv);return S.useEffect(()=>{for(const u of vv){const f=e[u],h=d.current[u];f!==h&&(typeof e[u]>"u"||(u==="nodes"?t(f):u==="edges"?n(f):u==="minZoom"?r(f):u==="maxZoom"?s(f):u==="translateExtent"?o(f):u==="nodeExtent"?i(f):u==="ariaLabelConfig"?c.setState({ariaLabelConfig:tA(f)}):u==="fitView"?c.setState({fitViewQueued:f}):u==="fitViewOptions"?c.setState({fitViewOptions:f}):c.setState({[u]:f})))}d.current=e},vv.map(u=>e[u])),null}function wv(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Mj(e){var r;const[t,n]=S.useState(e==="system"?null:e);return S.useEffect(()=>{if(e!=="system"){n(e);return}const s=wv(),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=wv())!=null&&r.matches?"dark":"light"}const bv=typeof document<"u"?document:null;function ra(e=null,t={target:bv,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(u=>typeof u=="string").map(u=>u.replace(/\+/g,`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),d=c.reduce((u,f)=>u.concat(...f),[]);return[c,d]}return[[],[]]},[e]);return S.useEffect(()=>{const a=(t==null?void 0:t.target)??bv,c=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=h=>{var b,p;if(s.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!s.current||s.current&&!c)&&$S(h))return!1;const x=Ev(h.code,l);if(o.current.add(h[x]),Sv(i,o.current,!1)){const y=((p=(b=h.composedPath)==null?void 0:b.call(h))==null?void 0:p[0])||h.target,m=(y==null?void 0:y.nodeName)==="BUTTON"||(y==null?void 0:y.nodeName)==="A";t.preventDefault!==!1&&(s.current||!m)&&h.preventDefault(),r(!0)}},u=h=>{const g=Ev(h.code,l);Sv(i,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(h[g]),h.key==="Meta"&&o.current.clear(),s.current=!1},f=()=>{o.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",d),a==null||a.addEventListener("keyup",u),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{a==null||a.removeEventListener("keydown",d),a==null||a.removeEventListener("keyup",u),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function Sv(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function Ev(e,t){return t.includes(e)?"code":"key"}const Ij=()=>{const e=Le();return S.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,o],panZoom:i}=e.getState();return i?(await i.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??o},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:o,maxZoom:i,panZoom:l}=e.getState(),a=ym(t,r,s,o,i,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(a,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:s,snapToGrid:o,domNode:i}=e.getState();if(!i)return t;const{x:l,y:a}=i.getBoundingClientRect(),c={x:t.x-l,y:t.y-a},d=n.snapGrid??s,u=n.snapToGrid??o;return Na(c,r,u,d)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:o}=r.getBoundingClientRect(),i=Ei(t,n);return{x:i.x+s,y:i.y+o}}}),[])};function pE(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)_j(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 _j(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Oj(e,t){return pE(e,t)}function Aj(e,t){return pE(e,t)}function Rs(e,t){return{id:e,type:"select",selected:t}}function jo(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(Rs(o.id,i)))}return r}function kv({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 Cv(e){return{id:e.id,type:"remove"}}const jj=zS();function zj(e,t,n={}){return lA(e,t,{...n,onError:n.onError??jj})}const Rv=e=>KO(e),Lj=e=>IS(e);function gE(e){return S.forwardRef(e)}const mE=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Nv(e){const[t,n]=S.useState(BigInt(0)),[r]=S.useState(()=>Dj(()=>n(s=>s+BigInt(1))));return mE(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function Dj(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const yE=S.createContext(null);function Fj({children:e}){const t=Le(),n=S.useCallback(l=>{const{nodes:a=[],setNodes:c,hasDefaultNodes:d,onNodesChange:u,nodeLookup:f,fitViewQueued:h,onNodesChangeMiddlewareMap:g}=t.getState();let x=a;for(const p of l)x=typeof p=="function"?p(x):p;let b=kv({items:x,lookup:f});for(const p of g.values())b=p(b);d&&c(x),b.length>0?u==null||u(b):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:p,nodes:y,setNodes:m}=t.getState();p&&m(y)})},[]),r=Nv(n),s=S.useCallback(l=>{const{edges:a=[],setEdges:c,hasDefaultEdges:d,onEdgesChange:u,edgeLookup:f}=t.getState();let h=a;for(const g of l)h=typeof g=="function"?g(h):g;d?c(h):u&&u(kv({items:h,lookup:f}))},[]),o=Nv(s),i=S.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return v.jsx(yE.Provider,{value:i,children:e})}function $j(){const e=S.useContext(yE);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Bj=e=>!!e.panZoom;function km(){const e=Ij(),t=Le(),n=$j(),r=Ce(Bj),s=S.useMemo(()=>{const o=u=>t.getState().nodeLookup.get(u),i=u=>{n.nodeQueue.push(u)},l=u=>{n.edgeQueue.push(u)},a=u=>{var p,y;const{nodeLookup:f,nodeOrigin:h}=t.getState(),g=Rv(u)?u:f.get(u.id),x=g.parentId?DS(g.position,g.measured,g.parentId,f,h):g.position,b={...g,position:x,width:((p=g.measured)==null?void 0:p.width)??g.width,height:((y=g.measured)==null?void 0:y.height)??g.height};return ta(b)},c=(u,f,h={replace:!1})=>{i(g=>g.map(x=>{if(x.id===u){const b=typeof f=="function"?f(x):f;return h.replace&&Rv(b)?b:{...x,...b}}return x}))},d=(u,f,h={replace:!1})=>{l(g=>g.map(x=>{if(x.id===u){const b=typeof f=="function"?f(x):f;return h.replace&&Lj(b)?b:{...x,...b}}return x}))};return{getNodes:()=>t.getState().nodes.map(u=>({...u})),getNode:u=>{var f;return(f=o(u))==null?void 0:f.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:u=[]}=t.getState();return u.map(f=>({...f}))},getEdge:u=>t.getState().edgeLookup.get(u),setNodes:i,setEdges:l,addNodes:u=>{const f=Array.isArray(u)?u:[u];n.nodeQueue.push(h=>[...h,...f])},addEdges:u=>{const f=Array.isArray(u)?u:[u];n.edgeQueue.push(h=>[...h,...f])},toObject:()=>{const{nodes:u=[],edges:f=[],transform:h}=t.getState(),[g,x,b]=h;return{nodes:u.map(p=>({...p})),edges:f.map(p=>({...p})),viewport:{x:g,y:x,zoom:b}}},deleteElements:async({nodes:u=[],edges:f=[]})=>{const{nodes:h,edges:g,onNodesDelete:x,onEdgesDelete:b,triggerNodeChanges:p,triggerEdgeChanges:y,onDelete:m,onBeforeDelete:w}=t.getState(),{nodes:k,edges:C}=await GO({nodesToRemove:u,edgesToRemove:f,nodes:h,edges:g,onBeforeDelete:w}),R=C.length>0,E=k.length>0;if(R){const M=C.map(Cv);b==null||b(C),y(M)}if(E){const M=k.map(Cv);x==null||x(k),p(M)}return(E||R)&&(m==null||m({nodes:k,edges:C})),{deletedNodes:k,deletedEdges:C}},getIntersectingNodes:(u,f=!0,h)=>{const g=tv(u),x=g?u:a(u),b=h!==void 0;return x?(h||t.getState().nodes).filter(p=>{const y=t.getState().nodeLookup.get(p.id);if(y&&!g&&(p.id===u.id||!y.internals.positionAbsolute))return!1;const m=ta(b?p:y),w=Fu(m,x);return f&&w>0||w>=m.width*m.height||w>=x.width*x.height}):[]},isNodeIntersecting:(u,f,h=!0)=>{const x=tv(u)?u:a(u);if(!x)return!1;const b=Fu(x,f);return h&&b>0||b>=f.width*f.height||b>=x.width*x.height},updateNode:c,updateNodeData:(u,f,h={replace:!1})=>{c(u,g=>{const x=typeof f=="function"?f(g):f;return h.replace?{...g,data:x}:{...g,data:{...g.data,...x}}},h)},updateEdge:d,updateEdgeData:(u,f,h={replace:!1})=>{d(u,g=>{const x=typeof f=="function"?f(g):f;return h.replace?{...g,data:x}:{...g,data:{...g.data,...x}}},h)},getNodesBounds:u=>{const{nodeLookup:f,nodeOrigin:h}=t.getState();return qO(u,{nodeLookup:f,nodeOrigin:h})},getHandleConnections:({type:u,id:f,nodeId:h})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${h}-${u}${f?`-${f}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:u,handleId:f,nodeId:h})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${h}${u?f?`-${u}-${f}`:`-${u}`:""}`))==null?void 0:g.values())??[])},fitView:async u=>{const f=t.getState().fitViewResolver??eA();return t.setState({fitViewQueued:!0,fitViewOptions:u,fitViewResolver:f}),n.nodeQueue.push(h=>[...h]),f.promise}}},[]);return S.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const Pv=e=>e.selected,Hj=typeof window<"u"?window:void 0;function Vj({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Le(),{deleteElements:r}=km(),s=ra(e,{actInsideInputWithModifier:!1}),o=ra(t,{target:Hj});S.useEffect(()=>{if(s){const{edges:i,nodes:l}=n.getState();r({nodes:l.filter(Pv),edges:i.filter(Pv)}),n.setState({nodesSelectionActive:!1})}},[s]),S.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function Wj(e){const t=Le();S.useEffect(()=>{const n=()=>{var s,o,i,l;if(!e.current||!(((o=(s=e.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const r=vm(e.current);(r.height===0||r.width===0)&&((l=(i=t.getState()).onError)==null||l.call(i,"004",In.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 Nd={position:"absolute",width:"100%",height:"100%",top:0,left:0},Uj=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Kj({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:s,panOnScrollSpeed:o=.5,panOnScrollMode:i=Qs.Free,zoomOnDoubleClick:l=!0,panOnDrag:a=!0,defaultViewport:c,translateExtent:d,minZoom:u,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:g=!0,children:x,noWheelClassName:b,noPanClassName:p,onViewportChange:y,isControlledViewport:m,paneClickDistance:w,selectionOnDrag:k}){const C=Le(),R=S.useRef(null),{userSelectionActive:E,lib:M,connectionInProgress:_}=Ce(Uj,We),j=ra(h),D=S.useRef();Wj(R);const O=S.useCallback(N=>{y==null||y({x:N[0],y:N[1],zoom:N[2]}),m||C.setState({transform:N})},[y,m]);return S.useEffect(()=>{if(R.current){D.current=LA({domNode:R.current,minZoom:u,maxZoom:f,translateExtent:d,viewport:c,onDraggingChange:F=>C.setState(P=>P.paneDragging===F?P:{paneDragging:F}),onPanZoomStart:(F,P)=>{const{onViewportChangeStart:I,onMoveStart:A}=C.getState();A==null||A(F,P),I==null||I(P)},onPanZoom:(F,P)=>{const{onViewportChange:I,onMove:A}=C.getState();A==null||A(F,P),I==null||I(P)},onPanZoomEnd:(F,P)=>{const{onViewportChangeEnd:I,onMoveEnd:A}=C.getState();A==null||A(F,P),I==null||I(P)}});const{x:N,y:T,zoom:z}=D.current.getViewport();return C.setState({panZoom:D.current,transform:[N,T,z],domNode:R.current.closest(".react-flow")}),()=>{var F;(F=D.current)==null||F.destroy()}}},[]),S.useEffect(()=>{var N;(N=D.current)==null||N.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:s,panOnScrollSpeed:o,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:a,zoomActivationKeyPressed:j,preventScrolling:g,noPanClassName:p,userSelectionActive:E,noWheelClassName:b,lib:M,onTransformChange:O,connectionInProgress:_,selectionOnDrag:k,paneClickDistance:w})},[e,t,n,r,s,o,i,l,a,j,g,p,E,b,M,O,_,k,w]),v.jsx("div",{className:"react-flow__renderer",ref:R,style:Nd,children:x})}const qj=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Yj(){const{userSelectionActive:e,userSelectionRect:t}=Ce(qj,We);return e&&t?v.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 Ff=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Qj=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Xj({isSelecting:e,selectionKeyPressed:t,selectionMode:n=ea.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:o,selectionOnDrag:i,onSelectionStart:l,onSelectionEnd:a,onPaneClick:c,onPaneContextMenu:d,onPaneScroll:u,onPaneMouseEnter:f,onPaneMouseMove:h,onPaneMouseLeave:g,children:x}){const b=S.useRef(0),p=Le(),{userSelectionActive:y,elementsSelectable:m,dragging:w,panBy:k,autoPanSpeed:C}=Ce(Qj,We),R=m&&(e||y),E=S.useRef(null),M=S.useRef(),_=S.useRef(new Set),j=S.useRef(new Set),D=S.useRef(!1),O=S.useRef(!1),N=S.useRef({x:0,y:0}),T=S.useRef(!1),z=H=>{if(O.current||D.current||p.getState().connection.inProgress){O.current=!1,D.current=!1;return}c==null||c(H),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},F=H=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){H.preventDefault();return}d==null||d(H)},P=u?H=>u(H):void 0,I=H=>{O.current&&(H.stopPropagation(),O.current=!1)},A=H=>{var J,se;if(H.pointerType==="touch"&&r!==!1&&!t)return;const{domNode:Y,transform:te}=p.getState();if(M.current=Y==null?void 0:Y.getBoundingClientRect(),!M.current)return;const V=H.target===E.current;if(!V&&!!H.target.closest(".nokey")||!e||!(i&&V||t)||H.button!==0||!H.isPrimary)return;(se=(J=H.target)==null?void 0:J.setPointerCapture)==null||se.call(J,H.pointerId),O.current=!1;const{x:ce,y:re}=Rn(H.nativeEvent,M.current),W=Na({x:ce,y:re},te);p.setState({userSelectionRect:{width:0,height:0,startX:W.x,startY:W.y,x:ce,y:re}}),V||(H.stopPropagation(),H.preventDefault())};function B(H,Y){const{userSelectionRect:te}=p.getState();if(!te)return;const{transform:V,nodeLookup:Z,edgeLookup:Q,connectionLookup:ce,triggerNodeChanges:re,triggerEdgeChanges:W,defaultEdgeOptions:J}=p.getState(),se={x:te.startX,y:te.startY},{x:pe,y:me}=Ei(se,V),fe={startX:se.x,startY:se.y,x:H<pe?H:pe,y:Y<me?Y:me,width:Math.abs(H-pe),height:Math.abs(Y-me)},ue=_.current,Ne=j.current;_.current=new Set(gm(Z,fe,V,n===ea.Partial,!0).map(_e=>_e.id)),j.current=new Set;const be=(J==null?void 0:J.selectable)??!0;for(const _e of _.current){const ft=ce.get(_e);if(ft)for(const{edgeId:mt}of ft.values()){const De=Q.get(mt);De&&(De.selectable??be)&&j.current.add(mt)}}if(!nv(ue,_.current)){const _e=jo(Z,_.current,!0);re(_e)}if(!nv(Ne,j.current)){const _e=jo(Q,j.current);W(_e)}p.setState({userSelectionRect:fe,userSelectionActive:!0,nodesSelectionActive:!1})}function $(){if(!s||!M.current)return;const[H,Y]=mm(N.current,M.current,C);k({x:H,y:Y}).then(te=>{if(!O.current||!te){b.current=requestAnimationFrame($);return}const{x:V,y:Z}=N.current;B(V,Z),b.current=requestAnimationFrame($)})}const U=()=>{cancelAnimationFrame(b.current),b.current=0,T.current=!1};S.useEffect(()=>()=>U(),[]);const q=H=>{const{userSelectionRect:Y,transform:te,resetSelectedElements:V}=p.getState();if(!M.current||!Y)return;const{x:Z,y:Q}=Rn(H.nativeEvent,M.current);N.current={x:Z,y:Q};const ce=Ei({x:Y.startX,y:Y.startY},te);if(!O.current){const re=t?0:o;if(Math.hypot(Z-ce.x,Q-ce.y)<=re)return;V(),l==null||l(H)}O.current=!0,T.current||($(),T.current=!0),B(Z,Q)},K=H=>{var Y,te;if(!R){H.target===E.current&&p.getState().connection.inProgress&&(D.current=!0);return}H.button===0&&((te=(Y=H.target)==null?void 0:Y.releasePointerCapture)==null||te.call(Y,H.pointerId),!y&&H.target===E.current&&p.getState().userSelectionRect&&(z==null||z(H)),p.setState({userSelectionActive:!1,userSelectionRect:null}),O.current&&(a==null||a(H),p.setState({nodesSelectionActive:_.current.size>0})),U())},X=H=>{var Y,te;(te=(Y=H.target)==null?void 0:Y.releasePointerCapture)==null||te.call(Y,H.pointerId),U()},G=r===!0||Array.isArray(r)&&r.includes(0);return v.jsxs("div",{className:et(["react-flow__pane",{draggable:G,dragging:w,selection:e}]),onClick:R?void 0:Ff(z,E),onContextMenu:Ff(F,E),onWheel:Ff(P,E),onPointerEnter:R?void 0:f,onPointerMove:R?q:h,onPointerUp:K,onPointerCancel:R?X:void 0,onPointerDownCapture:R?A:void 0,onClickCapture:R?I:void 0,onPointerLeave:g,ref:E,style:Nd,children:[x,v.jsx(Yj,{})]})}function _p({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",In.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):s([e])}function vE({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:i}){const l=Le(),[a,c]=S.useState(!1),d=S.useRef();return S.useEffect(()=>{if(!t)return d.current=EA({getStoreItems:()=>l.getState(),onNodeMouseDown:u=>{_p({id:u,store:l,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}}),()=>{var u;(u=d.current)==null||u.destroy(),d.current=void 0}},[t,l,e]),S.useEffect(()=>{t||!e.current||!d.current||d.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:i})},[n,r,t,o,e,s,i]),a}const Gj=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function xE(){const e=Le();return S.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:i,onError:l,updateNodePositions:a,nodeLookup:c,nodeOrigin:d}=e.getState(),u=new Map,f=Gj(i),h=s?o[0]:5,g=s?o[1]:5,x=n.direction.x*h*n.factor,b=n.direction.y*g*n.factor;for(const[,p]of c){if(!f(p))continue;let y={x:p.internals.positionAbsolute.x+x,y:p.internals.positionAbsolute.y+b};s&&(y=Ra(y,o));const{position:m,positionAbsolute:w}=_S({nodeId:p.id,nextPosition:y,nodeLookup:c,nodeExtent:r,nodeOrigin:d,onError:l});p.position=m,p.internals.positionAbsolute=w,u.set(p.id,p)}a(u)},[])}const Cm=S.createContext(null),Zj=Cm.Provider;Cm.Consumer;const wE=()=>S.useContext(Cm),Jj=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),bE=S.createContext(null);function ez({children:e}){const t=Ce(Jj,We);return v.jsx(bE.Provider,{value:t,children:e})}function tz(){const e=S.useContext(bE);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const nz={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},rz=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:i}=r,{fromHandle:l,toHandle:a,isValid:c}=i;if(!l&&!s)return nz;const d=(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:d,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:o===bi.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!s,valid:d&&c}};function sz({type:e="source",position:t=de.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:i,onConnect:l,children:a,className:c,onMouseDown:d,onTouchStart:u,...f},h){var T,z;const g=i||null,x=e==="target",b=Le(),p=wE(),{connectOnClick:y,noPanClassName:m,rfId:w}=tz(),{connectingFrom:k,connectingTo:C,clickConnecting:R,isPossibleEndHandle:E,connectionInProcess:M,clickConnectionInProcess:_,valid:j}=Ce(rz(p,g,e),We);p||(z=(T=b.getState()).onError)==null||z.call(T,"010",In.error010());const D=F=>{const{defaultEdgeOptions:P,onConnect:I,hasDefaultEdges:A}=b.getState(),B={...P,...F};if(A){const{edges:$,setEdges:U,onError:q}=b.getState();U(zj(B,$,{onError:q}))}I==null||I(B),l==null||l(B)},O=F=>{if(!p)return;const P=BS(F.nativeEvent);if(s&&(P&&F.button===0||!P)){const I=b.getState();Ip.onPointerDown(F.nativeEvent,{handleDomNode:F.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:x,handleId:g,nodeId:p,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...A)=>{var B,$;return($=(B=b.getState()).onConnectEnd)==null?void 0:$.call(B,...A)},updateConnection:I.updateConnection,onConnect:D,isValidConnection:n||((...A)=>{var B,$;return(($=(B=b.getState()).isValidConnection)==null?void 0:$.call(B,...A))??!0}),getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}P?d==null||d(F):u==null||u(F)},N=F=>{const{onClickConnectStart:P,onClickConnectEnd:I,connectionClickStartHandle:A,connectionMode:B,isValidConnection:$,lib:U,rfId:q,nodeLookup:K,connection:X}=b.getState();if(!p||!A&&!s)return;if(!A){P==null||P(F.nativeEvent,{nodeId:p,handleId:g,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:p,type:e,id:g}});return}const G=FS(F.target),H=n||$,{connection:Y,isValid:te}=Ip.isValid(F.nativeEvent,{handle:{nodeId:p,id:g,type:e},connectionMode:B,fromNodeId:A.nodeId,fromHandleId:A.id||null,fromType:A.type,isValidConnection:H,flowId:q,doc:G,lib:U,nodeLookup:K});te&&Y&&D(Y);const V=structuredClone(X);delete V.inProgress,V.toPosition=V.toHandle?V.toHandle.position:null,I==null||I(F,V),b.setState({connectionClickStartHandle:null})};return v.jsx("div",{"data-handleid":g,"data-nodeid":p,"data-handlepos":t,"data-id":`${w}-${p}-${g}-${e}`,className:et(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",m,c,{source:!x,target:x,connectable:r,connectablestart:s,connectableend:o,clickconnecting:R,connectingfrom:k,connectingto:C,valid:j,connectionindicator:r&&(!M||E)&&(M||_?o:s)}]),onMouseDown:O,onTouchStart:O,onClick:y?N:void 0,ref:h,...f,children:a})}const fs=S.memo(gE(sz));function oz({data:e,isConnectable:t,sourcePosition:n=de.Bottom}){return v.jsxs(v.Fragment,{children:[e==null?void 0:e.label,v.jsx(fs,{type:"source",position:n,isConnectable:t})]})}function iz({data:e,isConnectable:t,targetPosition:n=de.Top,sourcePosition:r=de.Bottom}){return v.jsxs(v.Fragment,{children:[v.jsx(fs,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,v.jsx(fs,{type:"source",position:r,isConnectable:t})]})}function lz(){return null}function az({data:e,isConnectable:t,targetPosition:n=de.Top}){return v.jsxs(v.Fragment,{children:[v.jsx(fs,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const $u={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Tv={input:oz,default:iz,output:az,group:lz};function cz(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 uz=e=>{const{width:t,height:n,x:r,y:s}=Ca(e.nodeLookup,{filter:o=>!!o.selected});return{width:Cn(t)?t:null,height:Cn(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 dz({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Le(),{width:s,height:o,transformString:i,userSelectionActive:l}=Ce(uz,We),a=xE(),c=S.useRef(null);S.useEffect(()=>{var h;n||(h=c.current)==null||h.focus({preventScroll:!0})},[n]);const d=!l&&s!==null&&o!==null;if(vE({nodeRef:c,disabled:!d}),!d)return null;const u=e?h=>{const g=r.getState().nodes.filter(x=>x.selected);e(h,g)}:void 0,f=h=>{Object.prototype.hasOwnProperty.call($u,h.key)&&(h.preventDefault(),a({direction:$u[h.key],factor:h.shiftKey?4:1}))};return v.jsx("div",{className:et(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:v.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 Mv=typeof window<"u"?window:void 0,fz=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function SE({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:c,selectionOnDrag:d,selectionMode:u,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:g,panActivationKeyCode:x,zoomActivationKeyCode:b,elementsSelectable:p,zoomOnScroll:y,zoomOnPinch:m,panOnScroll:w,panOnScrollSpeed:k,panOnScrollMode:C,zoomOnDoubleClick:R,panOnDrag:E,autoPanOnSelection:M,defaultViewport:_,translateExtent:j,minZoom:D,maxZoom:O,preventScrolling:N,onSelectionContextMenu:T,noWheelClassName:z,noPanClassName:F,disableKeyboardA11y:P,onViewportChange:I,isControlledViewport:A}){const{nodesSelectionActive:B,userSelectionActive:$}=Ce(fz,We),U=ra(c,{target:Mv}),q=ra(x,{target:Mv}),K=q||E,X=q||w,G=d&&K!==!0,H=U||$||G;return Vj({deleteKeyCode:a,multiSelectionKeyCode:g}),v.jsx(Kj,{onPaneContextMenu:o,elementsSelectable:p,zoomOnScroll:y,zoomOnPinch:m,panOnScroll:X,panActivationKeyPressed:q,panOnScrollSpeed:k,panOnScrollMode:C,zoomOnDoubleClick:R,panOnDrag:!U&&K,defaultViewport:_,translateExtent:j,minZoom:D,maxZoom:O,zoomActivationKeyCode:b,preventScrolling:N,noWheelClassName:z,noPanClassName:F,onViewportChange:I,isControlledViewport:A,paneClickDistance:l,selectionOnDrag:G,children:v.jsxs(Xj,{onSelectionStart:f,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,panOnDrag:K,autoPanOnSelection:M,isSelecting:!!H,selectionMode:u,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:G,children:[e,B&&v.jsx(dz,{onSelectionContextMenu:T,noPanClassName:F,disableKeyboardA11y:P})]})})}SE.displayName="FlowRenderer";const hz=S.memo(SE),pz=e=>t=>e?gm(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 gz(e){return Ce(S.useCallback(pz(e),[e]),We)}const mz=e=>e.updateNodeInternals;function yz(){const e=Ce(mz),[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 vz({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=Le(),o=S.useRef(null),i=S.useRef(null),l=S.useRef(e.sourcePosition),a=S.useRef(e.targetPosition),c=S.useRef(t),d=n&&!!e.internals.handleBounds;return S.useEffect(()=>{o.current&&!e.hidden&&(!d||i.current!==o.current)&&(i.current&&(r==null||r.unobserve(i.current)),r==null||r.observe(o.current),i.current=o.current)},[d,e.hidden]),S.useEffect(()=>()=>{i.current&&(r==null||r.unobserve(i.current),i.current=null)},[]),S.useEffect(()=>{if(o.current){const u=c.current!==t,f=l.current!==e.sourcePosition,h=a.current!==e.targetPosition;(u||f||h)&&(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 xz({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:i,nodesDraggable:l,elementsSelectable:a,nodesConnectable:c,nodesFocusable:d,resizeObserver:u,noDragClassName:f,noPanClassName:h,disableKeyboardA11y:g,rfId:x,nodeTypes:b,nodeClickDistance:p,onError:y}){const{node:m,internals:w,isParent:k}=Ce(H=>{const Y=H.nodeLookup.get(e),te=H.parentLookup.has(e);return{node:Y,internals:Y.internals,isParent:te}},We);let C=m.type||"default",R=(b==null?void 0:b[C])||Tv[C];R===void 0&&(y==null||y("003",In.error003(C)),C="default",R=(b==null?void 0:b.default)||Tv.default);const E=!!(m.draggable||l&&typeof m.draggable>"u"),M=!!(m.selectable||a&&typeof m.selectable>"u"),_=!!(m.connectable||c&&typeof m.connectable>"u"),j=!!(m.focusable||d&&typeof m.focusable>"u"),D=Le(),O=LS(m),N=vz({node:m,nodeType:C,hasDimensions:O,resizeObserver:u}),T=vE({nodeRef:N,disabled:m.hidden||!E,noDragClassName:f,handleSelector:m.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:p}),z=xE();if(m.hidden)return null;const F=An(m),P=cz(m),I=M||E||t||n||r||s,A=n?H=>n(H,{...w.userNode}):void 0,B=r?H=>r(H,{...w.userNode}):void 0,$=s?H=>s(H,{...w.userNode}):void 0,U=o?H=>o(H,{...w.userNode}):void 0,q=i?H=>i(H,{...w.userNode}):void 0,K=H=>{const{selectNodesOnDrag:Y,nodeDragThreshold:te}=D.getState();M&&(!Y||!E||te>0)&&_p({id:e,store:D,nodeRef:N}),t&&t(H,{...w.userNode})},X=H=>{if(!($S(H.nativeEvent)||g)){if(NS.includes(H.key)&&M){const Y=H.key==="Escape";_p({id:e,store:D,unselect:Y,nodeRef:N})}else if(E&&m.selected&&Object.prototype.hasOwnProperty.call($u,H.key)){H.preventDefault();const{ariaLabelConfig:Y}=D.getState();D.setState({ariaLiveMessage:Y["node.a11yDescription.ariaLiveMessage"]({direction:H.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),z({direction:$u[H.key],factor:H.shiftKey?4:1})}}},G=()=>{var ce;if(g||!((ce=N.current)!=null&&ce.matches(":focus-visible")))return;const{transform:H,width:Y,height:te,autoPanOnNodeFocus:V,setCenter:Z}=D.getState();if(!V)return;gm(new Map([[e,m]]),{x:0,y:0,width:Y,height:te},H,!0).length>0||Z(m.position.x+F.width/2,m.position.y+F.height/2,{zoom:H[2]})};return v.jsx("div",{className:et(["react-flow__node",`react-flow__node-${C}`,{[h]:E},m.className,{selected:m.selected,selectable:M,parent:k,draggable:E,dragging:T}]),ref:N,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:O?"visible":"hidden",...m.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:A,onMouseMove:B,onMouseLeave:$,onContextMenu:U,onClick:K,onDoubleClick:q,onKeyDown:j?X:void 0,tabIndex:j?0:void 0,onFocus:j?G:void 0,role:m.ariaRole??(j?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${dE}-${x}`,"aria-label":m.ariaLabel,...m.domAttributes,children:v.jsx(Zj,{value:e,children:v.jsx(R,{id:e,data:m.data,type:C,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:m.selected??!1,selectable:M,draggable:E,deletable:m.deletable??!0,isConnectable:_,sourcePosition:m.sourcePosition,targetPosition:m.targetPosition,dragging:T,dragHandle:m.dragHandle,zIndex:w.z,parentId:m.parentId,...F})})})}var wz=S.memo(xz);const bz=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function EE(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:s}=Ce(bz,We),o=gz(e.onlyRenderVisibleElements),i=yz();return v.jsx("div",{className:"react-flow__nodes",style:Nd,children:o.map(l=>v.jsx(wz,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:i,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:s},l))})}EE.displayName="NodeRenderer";const Sz=S.memo(EE);function Ez(e){return Ce(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&&sA({sourceNode:o,targetNode:i,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),We)}const kz=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return v.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Cz=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return v.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Iv={[Lu.Arrow]:kz,[Lu.ArrowClosed]:Cz};function Rz(e){const t=Le();return S.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(Iv,e)?Iv[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",In.error009(e)),null)},[e])}const Nz=({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=Rz(t);return a?v.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:v.jsx(a,{color:n,strokeWidth:i})}):null},kE=({defaultColor:e,rfId:t})=>{const n=Ce(o=>o.edges),r=Ce(o=>o.defaultEdgeOptions),s=S.useMemo(()=>fA(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?v.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:v.jsx("defs",{children:s.map(o=>v.jsx(Nz,{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};kE.displayName="MarkerDefinitions";var Pz=S.memo(kE);function CE({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:i=[2,4],labelBgBorderRadius:l=2,children:a,className:c,...d}){const[u,f]=S.useState({x:1,y:0,width:0,height:0}),h=et(["react-flow__edge-textwrapper",c]),g=S.useRef(null);return S.useEffect(()=>{if(g.current){const x=g.current.getBBox();f({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),n?v.jsxs("g",{transform:`translate(${e-u.width/2} ${t-u.height/2})`,className:h,visibility:u.width?"visible":"hidden",...d,children:[s&&v.jsx("rect",{width:u.width+2*i[0],x:-i[0],y:-i[1],height:u.height+2*i[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),v.jsx("text",{className:"react-flow__edge-text",y:u.height/2,dy:"0.3em",ref:g,style:r,children:n}),a]}):null}CE.displayName="EdgeText";const Tz=S.memo(CE);function Pd({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:a,interactionWidth:c=20,...d}){return v.jsxs(v.Fragment,{children:[v.jsx("path",{...d,d:e,fill:"none",className:et(["react-flow__edge-path",d.className])}),c?v.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&Cn(t)&&Cn(n)?v.jsx(Tz,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function _v({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===de.Left||e===de.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function RE({sourceX:e,sourceY:t,sourcePosition:n=de.Bottom,targetX:r,targetY:s,targetPosition:o=de.Top}){const[i,l]=_v({pos:n,x1:e,y1:t,x2:r,y2:s}),[a,c]=_v({pos:o,x1:r,y1:s,x2:e,y2:t}),[d,u,f,h]=HS({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}`,d,u,f,h]}function NE(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i,targetPosition:l,label:a,labelStyle:c,labelShowBg:d,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h,style:g,markerEnd:x,markerStart:b,interactionWidth:p})=>{const[y,m,w]=RE({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l}),k=e.isInternal?void 0:t;return v.jsx(Pd,{id:k,path:y,labelX:m,labelY:w,label:a,labelStyle:c,labelShowBg:d,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h,style:g,markerEnd:x,markerStart:b,interactionWidth:p})})}const Mz=NE({isInternal:!1}),PE=NE({isInternal:!0});Mz.displayName="SimpleBezierEdge";PE.displayName="SimpleBezierEdgeInternal";function TE(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:f,sourcePosition:h=de.Bottom,targetPosition:g=de.Top,markerEnd:x,markerStart:b,pathOptions:p,interactionWidth:y})=>{const[m,w,k]=Pp({sourceX:n,sourceY:r,sourcePosition:h,targetX:s,targetY:o,targetPosition:g,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset,stepPosition:p==null?void 0:p.stepPosition}),C=e.isInternal?void 0:t;return v.jsx(Pd,{id:C,path:m,labelX:w,labelY:k,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:f,markerEnd:x,markerStart:b,interactionWidth:y})})}const ME=TE({isInternal:!1}),IE=TE({isInternal:!0});ME.displayName="SmoothStepEdge";IE.displayName="SmoothStepEdgeInternal";function _E(e){return S.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return v.jsx(ME,{...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 Iz=_E({isInternal:!1}),OE=_E({isInternal:!0});Iz.displayName="StepEdge";OE.displayName="StepEdgeInternal";function AE(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:f,markerEnd:h,markerStart:g,interactionWidth:x})=>{const[b,p,y]=US({sourceX:n,sourceY:r,targetX:s,targetY:o}),m=e.isInternal?void 0:t;return v.jsx(Pd,{id:m,path:b,labelX:p,labelY:y,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:f,markerEnd:h,markerStart:g,interactionWidth:x})})}const _z=AE({isInternal:!1}),jE=AE({isInternal:!0});_z.displayName="StraightEdge";jE.displayName="StraightEdgeInternal";function zE(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i=de.Bottom,targetPosition:l=de.Top,label:a,labelStyle:c,labelShowBg:d,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h,style:g,markerEnd:x,markerStart:b,pathOptions:p,interactionWidth:y})=>{const[m,w,k]=VS({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l,curvature:p==null?void 0:p.curvature}),C=e.isInternal?void 0:t;return v.jsx(Pd,{id:C,path:m,labelX:w,labelY:k,label:a,labelStyle:c,labelShowBg:d,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h,style:g,markerEnd:x,markerStart:b,interactionWidth:y})})}const Oz=zE({isInternal:!1}),LE=zE({isInternal:!0});Oz.displayName="BezierEdge";LE.displayName="BezierEdgeInternal";const Ov={default:LE,straight:jE,step:OE,smoothstep:IE,simplebezier:PE},Av={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},Az=(e,t,n)=>n===de.Left?e-t:n===de.Right?e+t:e,jz=(e,t,n)=>n===de.Top?e-t:n===de.Bottom?e+t:e,jv="react-flow__edgeupdater";function zv({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:i,type:l}){return v.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:i,className:et([jv,`${jv}-${l}`]),cx:Az(t,r,e),cy:jz(n,r,e),r,stroke:"transparent",fill:"transparent"})}function zz({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:i,sourcePosition:l,targetPosition:a,onReconnect:c,onReconnectStart:d,onReconnectEnd:u,setReconnecting:f,setUpdateHover:h}){const g=Le(),x=(w,k)=>{if(w.button!==0)return;const{autoPanOnConnect:C,domNode:R,connectionMode:E,connectionRadius:M,lib:_,onConnectStart:j,cancelConnection:D,nodeLookup:O,rfId:N,panBy:T,updateConnection:z}=g.getState(),F=k.type==="target",P=(B,$)=>{f(!1),u==null||u(B,n,k.type,$)},I=B=>c==null?void 0:c(n,B),A=(B,$)=>{f(!0),d==null||d(w,n,k.type),j==null||j(B,$)};Ip.onPointerDown(w.nativeEvent,{autoPanOnConnect:C,connectionMode:E,connectionRadius:M,domNode:R,handleId:k.id,nodeId:k.nodeId,nodeLookup:O,isTarget:F,edgeUpdaterType:k.type,lib:_,flowId:N,cancelConnection:D,panBy:T,isValidConnection:(...B)=>{var $,U;return((U=($=g.getState()).isValidConnection)==null?void 0:U.call($,...B))??!0},onConnect:I,onConnectStart:A,onConnectEnd:(...B)=>{var $,U;return(U=($=g.getState()).onConnectEnd)==null?void 0:U.call($,...B)},onReconnectEnd:P,updateConnection:z,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},b=w=>x(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),p=w=>x(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),y=()=>h(!0),m=()=>h(!1);return v.jsxs(v.Fragment,{children:[(e===!0||e==="source")&&v.jsx(zv,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:b,onMouseEnter:y,onMouseOut:m,type:"source"}),(e===!0||e==="target")&&v.jsx(zv,{position:a,centerX:o,centerY:i,radius:t,onMouseDown:p,onMouseEnter:y,onMouseOut:m,type:"target"})]})}function Lz({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:i,onMouseEnter:l,onMouseMove:a,onMouseLeave:c,reconnectRadius:d,onReconnect:u,onReconnectStart:f,onReconnectEnd:h,rfId:g,edgeTypes:x,noPanClassName:b,onError:p,disableKeyboardA11y:y}){let m=Ce(Z=>Z.edgeLookup.get(e));const w=Ce(Z=>Z.defaultEdgeOptions);m=w?{...w,...m}:m;let k=m.type||"default",C=(x==null?void 0:x[k])||Ov[k];C===void 0&&(p==null||p("011",In.error011(k)),k="default",C=(x==null?void 0:x.default)||Ov.default);const R=!!(m.focusable||t&&typeof m.focusable>"u"),E=typeof u<"u"&&(m.reconnectable||n&&typeof m.reconnectable>"u"),M=!!(m.selectable||r&&typeof m.selectable>"u"),_=S.useRef(null),[j,D]=S.useState(!1),[O,N]=S.useState(!1),T=Le(),{zIndex:z=m.zIndex,sourceX:F,sourceY:P,targetX:I,targetY:A,sourcePosition:B,targetPosition:$}=Ce(S.useCallback(Z=>{const Q=Z.nodeLookup.get(m.source),ce=Z.nodeLookup.get(m.target);if(!Q||!ce)return Av;const re=dA({id:e,sourceNode:Q,targetNode:ce,sourceHandle:m.sourceHandle||null,targetHandle:m.targetHandle||null,connectionMode:Z.connectionMode,onError:p}),W=rA({selected:m.selected,zIndex:m.zIndex,sourceNode:Q,targetNode:ce,elevateOnSelect:Z.elevateEdgesOnSelect,zIndexMode:Z.zIndexMode});return{...re||Av,zIndex:W}},[m.source,m.target,m.sourceHandle,m.targetHandle,m.selected,m.zIndex,p]),We),U=S.useMemo(()=>m.markerStart?`url('#${Tp(m.markerStart,g)}')`:void 0,[m.markerStart,g]),q=S.useMemo(()=>m.markerEnd?`url('#${Tp(m.markerEnd,g)}')`:void 0,[m.markerEnd,g]);if(m.hidden||F===null||P===null||I===null||A===null)return null;const K=Z=>{var W;const{addSelectedEdges:Q,unselectNodesAndEdges:ce,multiSelectionActive:re}=T.getState();M&&(T.setState({nodesSelectionActive:!1}),m.selected&&re?(ce({nodes:[],edges:[m]}),(W=_.current)==null||W.blur()):Q([e])),s&&s(Z,m)},X=o?Z=>{o(Z,{...m})}:void 0,G=i?Z=>{i(Z,{...m})}:void 0,H=l?Z=>{l(Z,{...m})}:void 0,Y=a?Z=>{a(Z,{...m})}:void 0,te=c?Z=>{c(Z,{...m})}:void 0,V=Z=>{var Q;if(!y&&NS.includes(Z.key)&&M){const{unselectNodesAndEdges:ce,addSelectedEdges:re}=T.getState();Z.key==="Escape"?((Q=_.current)==null||Q.blur(),ce({edges:[m]})):re([e])}};return v.jsx("svg",{style:{zIndex:z},children:v.jsxs("g",{className:et(["react-flow__edge",`react-flow__edge-${k}`,m.className,b,{selected:m.selected,animated:m.animated,inactive:!M&&!s,updating:j,selectable:M}]),onClick:K,onDoubleClick:X,onContextMenu:G,onMouseEnter:H,onMouseMove:Y,onMouseLeave:te,onKeyDown:R?V:void 0,tabIndex:R?0:void 0,role:m.ariaRole??(R?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":m.ariaLabel===null?void 0:m.ariaLabel||`Edge from ${m.source} to ${m.target}`,"aria-describedby":R?`${fE}-${g}`:void 0,ref:_,...m.domAttributes,children:[!O&&v.jsx(C,{id:e,source:m.source,target:m.target,type:m.type,selected:m.selected,animated:m.animated,selectable:M,deletable:m.deletable??!0,label:m.label,labelStyle:m.labelStyle,labelShowBg:m.labelShowBg,labelBgStyle:m.labelBgStyle,labelBgPadding:m.labelBgPadding,labelBgBorderRadius:m.labelBgBorderRadius,sourceX:F,sourceY:P,targetX:I,targetY:A,sourcePosition:B,targetPosition:$,data:m.data,style:m.style,sourceHandleId:m.sourceHandle,targetHandleId:m.targetHandle,markerStart:U,markerEnd:q,pathOptions:"pathOptions"in m?m.pathOptions:void 0,interactionWidth:m.interactionWidth}),E&&v.jsx(zz,{edge:m,isReconnectable:E,reconnectRadius:d,onReconnect:u,onReconnectStart:f,onReconnectEnd:h,sourceX:F,sourceY:P,targetX:I,targetY:A,sourcePosition:B,targetPosition:$,setUpdateHover:D,setReconnecting:N})]})})}var Dz=S.memo(Lz);const Fz=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function DE({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:c,onEdgeClick:d,reconnectRadius:u,onEdgeDoubleClick:f,onReconnectStart:h,onReconnectEnd:g,disableKeyboardA11y:x}){const{edgesFocusable:b,edgesReconnectable:p,elementsSelectable:y,onError:m}=Ce(Fz,We),w=Ez(t);return v.jsxs("div",{className:"react-flow__edges",children:[v.jsx(Pz,{defaultColor:e,rfId:n}),w.map(k=>v.jsx(Dz,{id:k,edgesFocusable:b,edgesReconnectable:p,elementsSelectable:y,noPanClassName:s,onReconnect:o,onContextMenu:i,onMouseEnter:l,onMouseMove:a,onMouseLeave:c,onClick:d,reconnectRadius:u,onDoubleClick:f,onReconnectStart:h,onReconnectEnd:g,rfId:n,onError:m,edgeTypes:r,disableKeyboardA11y:x},k))]})}DE.displayName="EdgeRenderer";const $z=S.memo(DE),Lv=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function Bz({children:e}){const t=Le(),n=S.useRef(null),[r]=S.useState(()=>t.getState().transform);return mE(()=>{let s=null;const o=()=>{const i=t.getState().transform;s&&i[0]===s[0]&&i[1]===s[1]&&i[2]===s[2]||(s=i,n.current&&(n.current.style.transform=Lv(i)))};return o(),t.subscribe(o)},[t]),v.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:Lv(r)},children:e})}function Hz(e){const t=km(),n=S.useRef(!1);S.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Vz=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Wz(e){const t=Ce(Vz),n=Le();return S.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Uz(e){return e.connection.inProgress?{...e.connection,to:Na(e.connection.to,e.transform)}:{...e.connection}}function Kz(e){return Uz}function qz(e){const t=Kz();return Ce(t,We)}const Yz=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Qz({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:i,isValid:l,inProgress:a}=Ce(Yz,We);return!(o&&s&&a)?null:v.jsx("svg",{style:e,width:o,height:i,className:"react-flow__connectionline react-flow__container",children:v.jsx("g",{className:et(["react-flow__connection",MS(l)]),children:v.jsx(FE,{style:t,type:n,CustomComponent:r,isValid:l})})})}const FE=({style:e,type:t=Fr.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:i,fromHandle:l,fromPosition:a,to:c,toNode:d,toHandle:u,toPosition:f,pointer:h}=qz();if(!s)return;if(n)return v.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:l,fromX:o.x,fromY:o.y,toX:c.x,toY:c.y,fromPosition:a,toPosition:f,connectionStatus:MS(r),toNode:d,toHandle:u,pointer:h});let g="";const x={sourceX:o.x,sourceY:o.y,sourcePosition:a,targetX:c.x,targetY:c.y,targetPosition:f};switch(t){case Fr.Bezier:[g]=VS(x);break;case Fr.SimpleBezier:[g]=RE(x);break;case Fr.Step:[g]=Pp({...x,borderRadius:0});break;case Fr.SmoothStep:[g]=Pp(x);break;default:[g]=US(x)}return v.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};FE.displayName="ConnectionLine";const Xz={};function Dv(e=Xz){S.useRef(e),Le(),S.useEffect(()=>{},[e])}function Gz(){Le(),S.useRef(!1),S.useEffect(()=>{},[])}function $E({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:c,onNodeContextMenu:d,onSelectionContextMenu:u,onSelectionStart:f,onSelectionEnd:h,connectionLineType:g,connectionLineStyle:x,connectionLineComponent:b,connectionLineContainerStyle:p,selectionKeyCode:y,selectionOnDrag:m,selectionMode:w,multiSelectionKeyCode:k,panActivationKeyCode:C,zoomActivationKeyCode:R,deleteKeyCode:E,onlyRenderVisibleElements:M,elementsSelectable:_,defaultViewport:j,translateExtent:D,minZoom:O,maxZoom:N,preventScrolling:T,defaultMarkerColor:z,zoomOnScroll:F,zoomOnPinch:P,panOnScroll:I,panOnScrollSpeed:A,panOnScrollMode:B,zoomOnDoubleClick:$,panOnDrag:U,autoPanOnSelection:q,onPaneClick:K,onPaneMouseEnter:X,onPaneMouseMove:G,onPaneMouseLeave:H,onPaneScroll:Y,onPaneContextMenu:te,paneClickDistance:V,nodeClickDistance:Z,onEdgeContextMenu:Q,onEdgeMouseEnter:ce,onEdgeMouseMove:re,onEdgeMouseLeave:W,reconnectRadius:J,onReconnect:se,onReconnectStart:pe,onReconnectEnd:me,noDragClassName:fe,noWheelClassName:ue,noPanClassName:Ne,disableKeyboardA11y:be,nodeExtent:_e,rfId:ft,viewport:mt,onViewportChange:De,nodesDraggable:lt}){return Dv(e),Dv(t),Gz(),Hz(n),Wz(mt),v.jsx(hz,{onPaneClick:K,onPaneMouseEnter:X,onPaneMouseMove:G,onPaneMouseLeave:H,onPaneContextMenu:te,onPaneScroll:Y,paneClickDistance:V,deleteKeyCode:E,selectionKeyCode:y,selectionOnDrag:m,selectionMode:w,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:k,panActivationKeyCode:C,zoomActivationKeyCode:R,elementsSelectable:_,zoomOnScroll:F,zoomOnPinch:P,zoomOnDoubleClick:$,panOnScroll:I,panOnScrollSpeed:A,panOnScrollMode:B,panOnDrag:U,autoPanOnSelection:q,defaultViewport:j,translateExtent:D,minZoom:O,maxZoom:N,onSelectionContextMenu:u,preventScrolling:T,noDragClassName:fe,noWheelClassName:ue,noPanClassName:Ne,disableKeyboardA11y:be,onViewportChange:De,isControlledViewport:!!mt,children:v.jsxs(Bz,{children:[v.jsx($z,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:i,onReconnect:se,onReconnectStart:pe,onReconnectEnd:me,onlyRenderVisibleElements:M,onEdgeContextMenu:Q,onEdgeMouseEnter:ce,onEdgeMouseMove:re,onEdgeMouseLeave:W,reconnectRadius:J,defaultMarkerColor:z,noPanClassName:Ne,disableKeyboardA11y:be,rfId:ft}),v.jsx(Qz,{style:x,type:g,component:b,containerStyle:p}),v.jsx("div",{className:"react-flow__edgelabel-renderer"}),v.jsx(Sz,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:c,onNodeContextMenu:d,nodeClickDistance:Z,onlyRenderVisibleElements:M,noPanClassName:Ne,noDragClassName:fe,disableKeyboardA11y:be,nodeExtent:_e,rfId:ft,nodesDraggable:lt}),v.jsx("div",{className:"react-flow__viewport-portal"})]})})}$E.displayName="GraphView";const Zz=S.memo($E),Jz=zS(),Fv=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:a=.5,maxZoom:c=2,nodeOrigin:d,nodeExtent:u,zIndexMode:f="basic"}={})=>{const h=new Map,g=new Map,x=new Map,b=new Map,p=r??t??[],y=n??e??[],m=d??[0,0],w=u??Jl;YS(x,b,p);const{nodesInitialized:k}=Mp(y,h,g,{nodeOrigin:m,nodeExtent:w,zIndexMode:f});let C=[0,0,1];if(i&&s&&o){const R=Ca(h,{filter:j=>!!((j.width||j.initialWidth)&&(j.height||j.initialHeight))}),{x:E,y:M,zoom:_}=ym(R,s,o,a,c,(l==null?void 0:l.padding)??.1);C=[E,M,_]}return{rfId:"1",width:s??0,height:o??0,transform:C,nodes:y,nodesInitialized:k,nodeLookup:h,parentLookup:g,edges:p,edgeLookup:b,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:a,maxZoom:c,translateExtent:Jl,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:bi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:m,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:i??!1,fitViewOptions:l,fitViewResolver:null,connection:{...TS},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Jz,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:PS,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},eL=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:a,maxZoom:c,nodeOrigin:d,nodeExtent:u,zIndexMode:f})=>fj((h,g)=>{async function x(){const{nodeLookup:b,panZoom:p,fitViewOptions:y,fitViewResolver:m,width:w,height:k,minZoom:C,maxZoom:R}=g();p&&(await XO({nodes:b,width:w,height:k,panZoom:p,minZoom:C,maxZoom:R},y),m==null||m.resolve(!0),h({fitViewResolver:null}))}return{...Fv({nodes:e,edges:t,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:a,maxZoom:c,nodeOrigin:d,nodeExtent:u,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:b=>{const{nodeLookup:p,parentLookup:y,nodeOrigin:m,nodeExtent:w,elevateNodesOnSelect:k,fitViewQueued:C,zIndexMode:R,nodesSelectionActive:E}=g(),{nodesInitialized:M,hasSelectedNodes:_}=Mp(b,p,y,{nodeOrigin:m,nodeExtent:w,elevateNodesOnSelect:k,checkEquality:!0,zIndexMode:R}),j=E&&_;C&&M?(x(),h({nodes:b,nodesInitialized:M,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:j})):h({nodes:b,nodesInitialized:M,nodesSelectionActive:j})},setEdges:b=>{const{connectionLookup:p,edgeLookup:y}=g();YS(p,y,b),h({edges:b})},setDefaultNodesAndEdges:(b,p)=>{if(b){const{setNodes:y}=g();y(b),h({hasDefaultNodes:!0})}if(p){const{setEdges:y}=g();y(p),h({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:p,nodeLookup:y,parentLookup:m,domNode:w,nodeOrigin:k,nodeExtent:C,debug:R,fitViewQueued:E,zIndexMode:M}=g(),{changes:_,updatedInternals:j}=xA(b,y,m,w,k,C,M);j&&(gA(y,m,{nodeOrigin:k,nodeExtent:C,zIndexMode:M}),E?(x(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),(_==null?void 0:_.length)>0&&(R&&console.log("React Flow: trigger node changes",_),p==null||p(_)))},updateNodePositions:(b,p=!1)=>{const y=[];let m=[];const{nodeLookup:w,triggerNodeChanges:k,connection:C,updateConnection:R,onNodesChangeMiddlewareMap:E}=g();for(const[M,_]of b){const j=w.get(M),D=!!(j!=null&&j.expandParent&&(j!=null&&j.parentId)&&(_!=null&&_.position)),O={id:M,type:"position",position:D?{x:Math.max(0,_.position.x),y:Math.max(0,_.position.y)}:_.position,dragging:p};if(j&&C.inProgress&&C.fromNode.id===j.id){const N=ao(j,C.fromHandle,de.Left,!0);R({...C,from:N})}D&&j.parentId&&y.push({id:M,parentId:j.parentId,rect:{..._.internals.positionAbsolute,width:_.measured.width??0,height:_.measured.height??0}}),m.push(O)}if(y.length>0){const{parentLookup:M,nodeOrigin:_}=g(),j=Em(y,w,M,_);m.push(...j)}for(const M of E.values())m=M(m);k(m)},triggerNodeChanges:b=>{const{onNodesChange:p,setNodes:y,nodes:m,hasDefaultNodes:w,debug:k}=g();if(b!=null&&b.length){if(w){const C=Oj(b,m);y(C)}k&&console.log("React Flow: trigger node changes",b),p==null||p(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:p,setEdges:y,edges:m,hasDefaultEdges:w,debug:k}=g();if(b!=null&&b.length){if(w){const C=Aj(b,m);y(C)}k&&console.log("React Flow: trigger edge changes",b),p==null||p(b)}},addSelectedNodes:b=>{const{multiSelectionActive:p,edgeLookup:y,nodeLookup:m,triggerNodeChanges:w,triggerEdgeChanges:k}=g();if(p){const C=b.map(R=>Rs(R,!0));w(C);return}w(jo(m,new Set([...b]),!0)),k(jo(y))},addSelectedEdges:b=>{const{multiSelectionActive:p,edgeLookup:y,nodeLookup:m,triggerNodeChanges:w,triggerEdgeChanges:k}=g();if(p){const C=b.map(R=>Rs(R,!0));k(C);return}k(jo(y,new Set([...b]))),w(jo(m,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:p}={})=>{const{edges:y,nodes:m,nodeLookup:w,triggerNodeChanges:k,triggerEdgeChanges:C}=g(),R=b||m,E=p||y,M=[];for(const j of R){if(!j.selected)continue;const D=w.get(j.id);D&&(D.selected=!1),M.push(Rs(j.id,!1))}const _=[];for(const j of E)j.selected&&_.push(Rs(j.id,!1));k(M),C(_)},setMinZoom:b=>{const{panZoom:p,maxZoom:y}=g();p==null||p.setScaleExtent([b,y]),h({minZoom:b})},setMaxZoom:b=>{const{panZoom:p,minZoom:y}=g();p==null||p.setScaleExtent([y,b]),h({maxZoom:b})},setTranslateExtent:b=>{var p;(p=g().panZoom)==null||p.setTranslateExtent(b),h({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:p,triggerNodeChanges:y,triggerEdgeChanges:m,elementsSelectable:w}=g();if(!w)return;const k=p.reduce((R,E)=>E.selected?[...R,Rs(E.id,!1)]:R,[]),C=b.reduce((R,E)=>E.selected?[...R,Rs(E.id,!1)]:R,[]);y(k),m(C)},setNodeExtent:b=>{const{nodes:p,nodeLookup:y,parentLookup:m,nodeOrigin:w,elevateNodesOnSelect:k,nodeExtent:C,zIndexMode:R}=g();b[0][0]===C[0][0]&&b[0][1]===C[0][1]&&b[1][0]===C[1][0]&&b[1][1]===C[1][1]||(Mp(p,y,m,{nodeOrigin:w,nodeExtent:b,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:R}),h({nodeExtent:b}))},panBy:b=>{const{transform:p,width:y,height:m,panZoom:w,translateExtent:k}=g();return wA({delta:b,panZoom:w,transform:p,translateExtent:k,width:y,height:m})},setCenter:async(b,p,y)=>{const{width:m,height:w,maxZoom:k,panZoom:C}=g();if(!C)return!1;const R=typeof(y==null?void 0:y.zoom)<"u"?y.zoom:k;return await C.setViewport({x:m/2-b*R,y:w/2-p*R,zoom:R},{duration:y==null?void 0:y.duration,ease:y==null?void 0:y.ease,interpolate:y==null?void 0:y.interpolate}),!0},cancelConnection:()=>{h({connection:{...TS}})},updateConnection:b=>{h({connection:b})},reset:()=>h({...Fv()})}},Object.is);function tL({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,initialMinZoom:i,initialMaxZoom:l,initialFitViewOptions:a,fitView:c,nodeOrigin:d,nodeExtent:u,zIndexMode:f,children:h}){const[g]=S.useState(()=>eL({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:c,minZoom:i,maxZoom:l,fitViewOptions:a,nodeOrigin:d,nodeExtent:u,zIndexMode:f}));return v.jsx(hj,{value:g,children:v.jsx(Fj,{children:v.jsx(ez,{children:h})})})}function nL({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:i,fitView:l,fitViewOptions:a,minZoom:c,maxZoom:d,nodeOrigin:u,nodeExtent:f,zIndexMode:h}){return S.useContext(Cd)?v.jsx(v.Fragment,{children:e}):v.jsx(tL,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:i,fitView:l,initialFitViewOptions:a,initialMinZoom:c,initialMaxZoom:d,nodeOrigin:u,nodeExtent:f,zIndexMode:h,children:e})}const rL={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function sL({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:i,onNodeClick:l,onEdgeClick:a,onInit:c,onMove:d,onMoveStart:u,onMoveEnd:f,onConnect:h,onConnectStart:g,onConnectEnd:x,onClickConnectStart:b,onClickConnectEnd:p,onNodeMouseEnter:y,onNodeMouseMove:m,onNodeMouseLeave:w,onNodeContextMenu:k,onNodeDoubleClick:C,onNodeDragStart:R,onNodeDrag:E,onNodeDragStop:M,onNodesDelete:_,onEdgesDelete:j,onDelete:D,onSelectionChange:O,onSelectionDragStart:N,onSelectionDrag:T,onSelectionDragStop:z,onSelectionContextMenu:F,onSelectionStart:P,onSelectionEnd:I,onBeforeDelete:A,connectionMode:B,connectionLineType:$=Fr.Bezier,connectionLineStyle:U,connectionLineComponent:q,connectionLineContainerStyle:K,deleteKeyCode:X="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:H=!1,selectionMode:Y=ea.Full,panActivationKeyCode:te="Space",multiSelectionKeyCode:V=na()?"Meta":"Control",zoomActivationKeyCode:Z=na()?"Meta":"Control",snapToGrid:Q,snapGrid:ce,onlyRenderVisibleElements:re=!1,selectNodesOnDrag:W,nodesDraggable:J,autoPanOnNodeFocus:se,nodesConnectable:pe,nodesFocusable:me,nodeOrigin:fe=hE,edgesFocusable:ue,edgesReconnectable:Ne,elementsSelectable:be=!0,defaultViewport:_e=Rj,minZoom:ft=.5,maxZoom:mt=2,translateExtent:De=Jl,preventScrolling:lt=!0,nodeExtent:tt,defaultMarkerColor:ln="#b1b1b7",zoomOnScroll:Aa=!0,zoomOnPinch:ja=!0,panOnScroll:za=!1,panOnScrollSpeed:La=.5,panOnScrollMode:Da=Qs.Free,zoomOnDoubleClick:Fa=!0,panOnDrag:$a=!0,onPaneClick:Ae,onPaneMouseEnter:nt,onPaneMouseMove:an,onPaneMouseLeave:_t,onPaneScroll:Cr,onPaneContextMenu:Rr,paneClickDistance:vo=1,nodeClickDistance:Ui=0,children:Nr,onReconnect:Hd,onReconnectStart:Vd,onReconnectEnd:Wd,onEdgeContextMenu:Ud,onEdgeDoubleClick:Ki,onEdgeMouseEnter:Ba,onEdgeMouseMove:Kd,onEdgeMouseLeave:qd,reconnectRadius:bs=10,onNodesChange:Yd,onEdgesChange:Qd,noDragClassName:Xd="nodrag",noWheelClassName:Ha="nowheel",noPanClassName:qi="nopan",fitView:Yi,fitViewOptions:Zm,connectOnClick:PC,attributionPosition:TC,proOptions:MC,defaultEdgeOptions:IC,elevateNodesOnSelect:_C=!0,elevateEdgesOnSelect:OC=!1,disableKeyboardA11y:Jm=!1,autoPanOnConnect:AC,autoPanOnNodeDrag:jC,autoPanOnSelection:zC=!0,autoPanSpeed:LC,connectionRadius:DC,isValidConnection:FC,onError:$C,style:BC,id:e0,nodeDragThreshold:HC,connectionDragThreshold:VC,viewport:WC,onViewportChange:UC,width:KC,height:qC,colorMode:YC="light",debug:QC,onScroll:Va,ariaLabelConfig:XC,zIndexMode:t0="basic",...GC},ZC){const Gd=e0||"1",JC=Mj(YC),eR=S.useCallback(n0=>{n0.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Va==null||Va(n0)},[Va]);return v.jsx("div",{"data-testid":"rf__wrapper",...GC,onScroll:eR,style:{...BC,...rL},ref:ZC,className:et(["react-flow",s,JC]),id:e0,role:"application",children:v.jsxs(nL,{nodes:e,edges:t,width:KC,height:qC,fitView:Yi,fitViewOptions:Zm,minZoom:ft,maxZoom:mt,nodeOrigin:fe,nodeExtent:tt,zIndexMode:t0,children:[v.jsx(Tj,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:g,onConnectEnd:x,onClickConnectStart:b,onClickConnectEnd:p,nodesDraggable:J,autoPanOnNodeFocus:se,nodesConnectable:pe,nodesFocusable:me,edgesFocusable:ue,edgesReconnectable:Ne,elementsSelectable:be,elevateNodesOnSelect:_C,elevateEdgesOnSelect:OC,minZoom:ft,maxZoom:mt,nodeExtent:tt,onNodesChange:Yd,onEdgesChange:Qd,snapToGrid:Q,snapGrid:ce,connectionMode:B,translateExtent:De,connectOnClick:PC,defaultEdgeOptions:IC,fitView:Yi,fitViewOptions:Zm,onNodesDelete:_,onEdgesDelete:j,onDelete:D,onNodeDragStart:R,onNodeDrag:E,onNodeDragStop:M,onSelectionDrag:T,onSelectionDragStart:N,onSelectionDragStop:z,onMove:d,onMoveStart:u,onMoveEnd:f,noPanClassName:qi,nodeOrigin:fe,rfId:Gd,autoPanOnConnect:AC,autoPanOnNodeDrag:jC,autoPanSpeed:LC,onError:$C,connectionRadius:DC,isValidConnection:FC,selectNodesOnDrag:W,nodeDragThreshold:HC,connectionDragThreshold:VC,onBeforeDelete:A,debug:QC,ariaLabelConfig:XC,zIndexMode:t0}),v.jsx(Zz,{onInit:c,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:y,onNodeMouseMove:m,onNodeMouseLeave:w,onNodeContextMenu:k,onNodeDoubleClick:C,nodeTypes:o,edgeTypes:i,connectionLineType:$,connectionLineStyle:U,connectionLineComponent:q,connectionLineContainerStyle:K,selectionKeyCode:G,selectionOnDrag:H,selectionMode:Y,deleteKeyCode:X,multiSelectionKeyCode:V,panActivationKeyCode:te,zoomActivationKeyCode:Z,onlyRenderVisibleElements:re,defaultViewport:_e,translateExtent:De,minZoom:ft,maxZoom:mt,preventScrolling:lt,zoomOnScroll:Aa,zoomOnPinch:ja,zoomOnDoubleClick:Fa,panOnScroll:za,panOnScrollSpeed:La,panOnScrollMode:Da,panOnDrag:$a,autoPanOnSelection:zC,onPaneClick:Ae,onPaneMouseEnter:nt,onPaneMouseMove:an,onPaneMouseLeave:_t,onPaneScroll:Cr,onPaneContextMenu:Rr,paneClickDistance:vo,nodeClickDistance:Ui,onSelectionContextMenu:F,onSelectionStart:P,onSelectionEnd:I,onReconnect:Hd,onReconnectStart:Vd,onReconnectEnd:Wd,onEdgeContextMenu:Ud,onEdgeDoubleClick:Ki,onEdgeMouseEnter:Ba,onEdgeMouseMove:Kd,onEdgeMouseLeave:qd,reconnectRadius:bs,defaultMarkerColor:ln,noDragClassName:Xd,noWheelClassName:Ha,noPanClassName:qi,rfId:Gd,disableKeyboardA11y:Jm,nodeExtent:tt,viewport:WC,onViewportChange:UC,nodesDraggable:J}),v.jsx(Cj,{onSelectionChange:O}),Nr,v.jsx(wj,{proOptions:MC,position:TC}),v.jsx(xj,{rfId:Gd,disableKeyboardA11y:Jm})]})})}var oL=gE(sL);function iL({dimensions:e,lineWidth:t,variant:n,className:r}){return v.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:et(["react-flow__background-pattern",n,r])})}function lL({radius:e,className:t}){return v.jsx("circle",{cx:e,cy:e,r:e,className:et(["react-flow__background-pattern","dots",t])})}var dr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(dr||(dr={}));const aL={[dr.Dots]:1,[dr.Lines]:1,[dr.Cross]:6},cL=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function BE({id:e,variant:t=dr.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:i,bgColor:l,style:a,className:c,patternClassName:d}){const u=S.useRef(null),{transform:f,patternId:h}=Ce(cL,We),g=r||aL[t],x=t===dr.Dots,b=t===dr.Cross,p=Array.isArray(n)?n:[n,n],y=[p[0]*f[2]||1,p[1]*f[2]||1],m=g*f[2],w=Array.isArray(o)?o:[o,o],k=b?[m,m]:y,C=[w[0]*f[2]+k[0]/2,w[1]*f[2]+k[1]/2],R=`${h}${e||""}`;return v.jsxs("svg",{className:et(["react-flow__background",c]),style:{...a,...Nd,"--xy-background-color-props":l,"--xy-background-pattern-color-props":i},ref:u,"data-testid":"rf__background",children:[v.jsx("pattern",{id:R,x:f[0]%y[0],y:f[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`,children:x?v.jsx(lL,{radius:m/2,className:d}):v.jsx(iL,{dimensions:k,lineWidth:s,variant:t,className:d})}),v.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${R})`})]})}BE.displayName="Background";const uL=S.memo(BE);function dL(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:v.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function fL(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:v.jsx("path",{d:"M0 0h32v4.2H0z"})})}function hL(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:v.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 pL(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.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 gL(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.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 xc({children:e,className:t,...n}){return v.jsx("button",{type:"button",className:et(["react-flow__controls-button",t]),...n,children:e})}const mL=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function HE({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:i,onFitView:l,onInteractiveChange:a,className:c,children:d,position:u="bottom-left",orientation:f="vertical","aria-label":h}){const g=Le(),{isInteractive:x,minZoomReached:b,maxZoomReached:p,ariaLabelConfig:y}=Ce(mL,We),{zoomIn:m,zoomOut:w,fitView:k}=km(),C=()=>{m(),o==null||o()},R=()=>{w(),i==null||i()},E=()=>{k(s),l==null||l()},M=()=>{g.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),a==null||a(!x)},_=f==="horizontal"?"horizontal":"vertical";return v.jsxs(Rd,{className:et(["react-flow__controls",_,c]),position:u,style:e,"data-testid":"rf__controls","aria-label":h??y["controls.ariaLabel"],children:[t&&v.jsxs(v.Fragment,{children:[v.jsx(xc,{onClick:C,className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:p,children:v.jsx(dL,{})}),v.jsx(xc,{onClick:R,className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:b,children:v.jsx(fL,{})})]}),n&&v.jsx(xc,{className:"react-flow__controls-fitview",onClick:E,title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:v.jsx(hL,{})}),r&&v.jsx(xc,{className:"react-flow__controls-interactive",onClick:M,title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:x?v.jsx(gL,{}):v.jsx(pL,{})}),d]})}HE.displayName="Controls";const yL=S.memo(HE);function vL({id:e,x:t,y:n,width:r,height:s,style:o,color:i,strokeColor:l,strokeWidth:a,className:c,borderRadius:d,shapeRendering:u,selected:f,onClick:h}){const{background:g,backgroundColor:x}=o||{},b=i||g||x;return v.jsx("rect",{className:et(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:d,ry:d,width:r,height:s,style:{fill:b,stroke:l,strokeWidth:a},shapeRendering:u,onClick:h?p=>h(p,e):void 0})}const xL=S.memo(vL),wL=e=>e.nodes.map(t=>t.id),$f=e=>e instanceof Function?e:()=>e;function bL({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=xL,onClick:i}){const l=Ce(wL,We),a=$f(t),c=$f(e),d=$f(n),u=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return v.jsx(v.Fragment,{children:l.map(f=>v.jsx(EL,{id:f,nodeColorFunc:a,nodeStrokeColorFunc:c,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:i,shapeRendering:u},f))})}function SL({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:i,NodeComponent:l,onClick:a}){const{node:c,x:d,y:u,width:f,height:h}=Ce(g=>{const x=g.nodeLookup.get(e);if(!x)return{node:void 0,x:0,y:0,width:0,height:0};const b=x.internals.userNode,{x:p,y}=x.internals.positionAbsolute,{width:m,height:w}=An(b);return{node:b,x:p,y,width:m,height:w}},We);return!c||c.hidden||!LS(c)?null:v.jsx(l,{x:d,y:u,width:f,height:h,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 EL=S.memo(SL);var kL=S.memo(bL);const CL=200,RL=150,NL=e=>!e.hidden,PL=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?AS(Ca(e.nodeLookup,{filter:NL}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},$v=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,TL=(e,t)=>$v(e.viewBB,t.viewBB)&&$v(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,ML="react-flow__minimap-desc";function VE({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:i,nodeComponent:l,bgColor:a,maskColor:c,maskStrokeColor:d,maskStrokeWidth:u,position:f="bottom-right",onClick:h,onNodeClick:g,pannable:x=!1,zoomable:b=!1,ariaLabel:p,inversePan:y,zoomStep:m=1,offsetScale:w=5}){const k=Le(),C=S.useRef(null),{boundingRect:R,viewBB:E,rfId:M,panZoom:_,translateExtent:j,flowWidth:D,flowHeight:O,ariaLabelConfig:N}=Ce(PL,TL),T=(e==null?void 0:e.width)??CL,z=(e==null?void 0:e.height)??RL,F=R.width/T,P=R.height/z,I=Math.max(F,P),A=I*T,B=I*z,$=w*I,U=R.x-(A-R.width)/2-$,q=R.y-(B-R.height)/2-$,K=A+$*2,X=B+$*2,G=`${ML}-${M}`,H=S.useRef(0),Y=S.useRef();H.current=I,S.useEffect(()=>{if(C.current&&_)return Y.current=TA({domNode:C.current,panZoom:_,getTransform:()=>k.getState().transform,getViewScale:()=>H.current}),()=>{var Q;(Q=Y.current)==null||Q.destroy()}},[_]),S.useEffect(()=>{var Q;(Q=Y.current)==null||Q.update({translateExtent:j,width:D,height:O,inversePan:y,pannable:x,zoomStep:m,zoomable:b})},[x,b,y,m,j,D,O]);const te=h?Q=>{var W;const[ce,re]=((W=Y.current)==null?void 0:W.pointer(Q))||[0,0];h(Q,{x:ce,y:re})}:void 0,V=g?S.useCallback((Q,ce)=>{const re=k.getState().nodeLookup.get(ce).internals.userNode;g(Q,re)},[]):void 0,Z=p??N["minimap.ariaLabel"];return v.jsx(Rd,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof u=="number"?u*I:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof i=="number"?i:void 0},className:et(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:v.jsxs("svg",{width:T,height:z,viewBox:`${U} ${q} ${K} ${X}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":G,ref:C,onClick:te,children:[Z&&v.jsx("title",{id:G,children:Z}),v.jsx(kL,{onClick:V,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:i,nodeComponent:l}),v.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-$},${q-$}h${K+$*2}v${X+$*2}h${-K-$*2}z
|
|
62
|
+
M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}VE.displayName="MiniMap";S.memo(VE);const IL=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,_L={[ki.Line]:"right",[ki.Handle]:"bottom-right"};function OL({nodeId:e,position:t,variant:n=ki.Handle,className:r,style:s=void 0,children:o,color:i,minWidth:l=10,minHeight:a=10,maxWidth:c=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:u=!1,resizeDirection:f,autoScale:h=!0,shouldResize:g,onResizeStart:x,onResize:b,onResizeEnd:p}){const y=wE(),m=typeof e=="string"?e:y,w=Le(),k=S.useRef(null),C=n===ki.Handle,R=Ce(S.useCallback(IL(C&&h),[C,h]),We),E=S.useRef(null),M=t??_L[n];S.useEffect(()=>{if(!(!k.current||!m))return E.current||(E.current=HA({domNode:k.current,nodeId:m,getStoreItems:()=>{const{nodeLookup:j,transform:D,snapGrid:O,snapToGrid:N,nodeOrigin:T,domNode:z}=w.getState();return{nodeLookup:j,transform:D,snapGrid:O,snapToGrid:N,nodeOrigin:T,paneDomNode:z}},onChange:(j,D)=>{const{triggerNodeChanges:O,nodeLookup:N,parentLookup:T,nodeOrigin:z}=w.getState(),F=[],P={x:j.x,y:j.y},I=N.get(m);if(I&&I.expandParent&&I.parentId){const A=I.origin??z,B=j.width??I.measured.width??0,$=j.height??I.measured.height??0,U={id:I.id,parentId:I.parentId,rect:{width:B,height:$,...DS({x:j.x??I.position.x,y:j.y??I.position.y},{width:B,height:$},I.parentId,N,A)}},q=Em([U],N,T,z);F.push(...q),P.x=j.x?Math.max(A[0]*B,j.x):void 0,P.y=j.y?Math.max(A[1]*$,j.y):void 0}if(P.x!==void 0&&P.y!==void 0){const A={id:m,type:"position",position:{...P}};F.push(A)}if(j.width!==void 0&&j.height!==void 0){const B={id:m,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:j.width,height:j.height}};F.push(B)}for(const A of D){const B={...A,type:"position"};F.push(B)}O(F)},onEnd:({width:j,height:D})=>{const O={id:m,type:"dimensions",resizing:!1,dimensions:{width:j,height:D}};w.getState().triggerNodeChanges([O])}})),E.current.update({controlPosition:M,boundaries:{minWidth:l,minHeight:a,maxWidth:c,maxHeight:d},keepAspectRatio:u,resizeDirection:f,onResizeStart:x,onResize:b,onResizeEnd:p,shouldResize:g}),()=>{var j;(j=E.current)==null||j.destroy()}},[M,l,a,c,d,u,x,b,p,g]);const _=M.split("-");return v.jsx("div",{className:et(["react-flow__resize-control","nodrag",..._,n,r]),ref:k,style:{...s,scale:R,...i&&{[C?"backgroundColor":"borderColor"]:i}},children:o})}S.memo(OL);const AL=new Set;function jL(e){return e.startsWith("signal:child:")}function zL(e){const t=Oi(),n=(()=>{const o=new Set(e),i=[...e];for(;i.length>0;){const l=i.shift();if(l===void 0)continue;const a=t.getQueryData(["run",l]);if(a!==void 0)for(const c of a.timeline){const d=ro(c);d!==void 0&&!o.has(d)&&(o.add(d),i.push(d))}}return[...o].sort()})(),r=xw({queries:n.map(o=>({queryKey:["run",o],queryFn:()=>Ye.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 LL({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?rm:sm(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 v.jsxs("div",{title:o?yp.child:yp[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:[v.jsx("span",{className:`absolute inset-y-0 left-0 w-[3px] ${l.rail} ${n?"animate-pulse":""}`}),v.jsx(fs,{type:"target",position:de.Left,className:"!border-0 !bg-zinc-600"}),v.jsxs("div",{className:"py-2.5 pl-3.5 pr-3",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:`grid h-5 w-5 shrink-0 place-items-center rounded ${l.badge}`,children:v.jsx(i,{width:12,height:12})}),v.jsx("span",{className:"truncate text-[13px] font-medium text-zinc-100",children:e.name}),v.jsx("span",{className:`ml-auto grid h-4 w-4 shrink-0 place-items-center rounded-full ${l.pill} ${n?"animate-pulse":""}`,children:t?v.jsx(Li,{width:9,height:9}):n?v.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}):v.jsx(q1,{width:9,height:9})})]}),v.jsxs("div",{className:"mono mt-1.5 flex items-center gap-1.5 text-[10px] text-zinc-500",children:[r?v.jsxs("span",{className:"flex items-center gap-1",children:[!s&&v.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:v.jsx("span",{className:"inline-block text-[9px] transition-transform",style:{transform:e.childExpanded?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),v.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 ↗"})]}):v.jsx("span",{className:"rounded border border-line px-1 text-zinc-400",children:e.kind}),e.attempts>1&&v.jsxs("span",{className:"flex items-center gap-0.5 text-amber-300",children:[v.jsx(nm,{width:9,height:9}),e.attempts]}),e.workerGroup&&v.jsxs("span",{className:"truncate",children:["@",e.workerGroup]}),v.jsxs("span",{className:"tnum ml-auto text-zinc-400",children:["#",e.seq,e.duration&&v.jsxs("span",{className:"text-zinc-600",children:[" · ",e.duration]})]})]}),e.subs&&v.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&&v.jsxs("span",{className:"text-emerald-300",children:[e.subs.ok," ok"]}),e.subs.failed>0&&v.jsxs("span",{className:"text-red-300",children:[e.subs.failed," failed"]}),e.subs.skipped>0&&v.jsxs("span",{className:"text-amber-300",children:[e.subs.skipped," skipped"]})]})]}),v.jsx(fs,{type:"source",position:de.Right,className:"!border-0 !bg-zinc-600"})]})}function DL({data:e}){const t=e.status==="running"||e.status==="awaiting";return v.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:[v.jsx(fs,{type:"target",position:de.Left,className:"!border-0 !bg-zinc-600"}),v.jsx("span",{className:`dot ${t?"pulse":""}`}),v.jsx("span",{className:"mono text-[11px] uppercase tracking-wider",children:e.label}),v.jsx(fs,{type:"source",position:de.Right,className:"!border-0 !bg-zinc-600"})]})}const FL={step:LL,terminal:DL};function $L(e){var n;const t=(n=e.events)==null?void 0:n.filter(r=>r.status);if(!(!t||t.length===0))return{ok:t.filter(r=>r.status==="ok").length,failed:t.filter(r=>r.status==="failed").length,skipped:t.filter(r=>r.status==="skipped").length}}function BL({run:e,timeline:t,endStatus:n,selectedKey:r,onSelect:s,onOpenRun:o,fmtDuration:i,expanded:l,onToggleChild:a}){const c=l??AL,d=S.useMemo(()=>{const x=new Set(c);for(const b of t){const p=ro(b);p!==void 0&&x.add(p)}return x},[c,t]),u=zL(d),{nodes:f,edges:h}=(()=>{const y=[],m=[],w=e.status==="running"||e.status==="suspended",k=(O,N,T)=>({id:`${O}->${N}`,source:O,target:N,style:{stroke:T?"#f87171":"var(--line)",strokeWidth:1.5}}),C=(O,N)=>({id:`${O}=>${N}`,source:O,target:N,style:{stroke:"#818cf8",strokeWidth:1.5,strokeDasharray:"4 3"}});function R(O,N,T,z,F,P){const I=`${F}s${O.seq}`,A=ro(O),B=A!==void 0?u[A]:void 0,$=B!==void 0&&B.timeline.length===1&&B.timeline[0]?{step:B.timeline[0],run:B.run}:void 0,U=$!==void 0,q=!U&&A!==void 0&&c.has(A),K=$?$.step:O,X=$?$.run:P,G=$?$.step.name:A!==void 0?(B==null?void 0:B.run.workflow)??"child workflow":O.name,H=K.status==="failed";y.push({id:I,type:"step",draggable:!1,position:{x:N,y:T},data:{seq:K.seq,name:G,kind:K.kind,status:K.status,workerGroup:K.workerGroup,attempts:K.attempts,duration:i(K.startedAt,K.finishedAt),subs:$L(K),selected:r===`${K.runId}#${K.seq}`,childRunId:A,onOpenRun:o,childExpanded:q,onToggleChild:a,collapsed:U,depth:z,step:K,laneRun:X}});const Y=q?B:void 0;if(Y){const te=E(Y.timeline,z+1,N+248,T+150,`${A}:`,Y.run);for(const Z of te.firstIds)m.push(C(I,Z));const V=jL(O.name)&&te.connectors.length>0?te.connectors:[{id:I,failed:H}];return{id:I,exits:V,nextX:Math.max(N+248,te.nextX),bottomY:Math.max(T,te.bottomY)}}return{id:I,exits:[{id:I,failed:H}],nextX:N+248,bottomY:T}}function E(O,N,T,z,F,P){let I=T;const A=[];let B=[],$=z;for(const U of U1(O)){const q=U.kind==="single"?[U.step]:U.steps,K=A.length===0,X=[];let G=z,H=I;for(const Y of q){const te=R(Y,I,G,N,F,P);K&&A.push(te.id);for(const V of B)m.push(k(V.id,te.id,V.failed));X.push(...te.exits),H=Math.max(H,te.nextX),G=te.bottomY+96}B=X,I=H,$=Math.max($,G-96)}return{firstIds:A,connectors:B,nextX:I,bottomY:$}}const M=248;y.push({id:"start",type:"terminal",position:{x:0,y:0},draggable:!1,data:{status:"running",label:e.workflow}});const _=E(t,0,M,0,"",e);for(const O of _.firstIds)m.push({id:`start->${O}`,source:"start",target:O});const j=n??VT(e,t);y.push({id:"end",type:"terminal",position:{x:Math.max(_.nextX,M),y:0},draggable:!1,data:{status:j,label:j}});const D=_.connectors.length>0?_.connectors:[{id:"start",failed:!1}];for(const O of D)m.push({id:`${O.id}->end`,source:O.id,target:"end",animated:w,style:{stroke:w?"var(--live)":"var(--line)",strokeWidth:w?2:1.5}});return{nodes:y,edges:m}})(),g=S.useCallback((x,b)=>{if(b.type!=="step")return;const p=b.data;p.step&&p.laneRun&&s(p.step,p.laneRun)},[s]);return v.jsxs(oL,{nodes:f,edges:h,nodeTypes:FL,onNodeClick:g,fitView:!0,fitViewOptions:{padding:.3,maxZoom:1.1},proOptions:{hideAttribution:!0},nodesConnectable:!1,nodesDraggable:!1,panOnScroll:!0,minZoom:.3,children:[v.jsx(uL,{variant:dr.Dots,gap:22,size:1,color:"#1c1c22"}),v.jsx(yL,{showInteractive:!1,position:"bottom-right"})]})}function Kc(e){const t=e.lastIndexOf("~retry~");return t===-1?void 0:e.slice(0,t)}function Bf(e){const n=(Kc(e)??e).match(/^(.*)\.child\.\d+$/);return(n==null?void 0:n[1])||void 0}const WE=M1("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"}}),zt=S.forwardRef(({className:e,variant:t,...n},r)=>v.jsx("span",{ref:r,className:dt(WE({variant:t}),e),...n}));zt.displayName="Badge";function It(e,...t){const n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}const UE=S.createContext(void 0);function mo(e){const t=S.useContext(UE);if(e===!1&&t===void 0)throw new Error(It(27));return t}const Bv={};function Ut(e,t){const n=S.useRef(Bv);return n.current===Bv&&(n.current=e(t)),n}function Ri(e,t,n,r){const s=Ut(KE).current;return VL(s,e,t,n,r)&&qE(s,[e,t,n,r]),s.callback}function HL(e){const t=Ut(KE).current;return WL(t,e)&&qE(t,e),t.callback}function KE(){return{callback:null,cleanup:null,refs:[]}}function VL(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function WL(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function qE(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=o(n);typeof i=="function"&&(r[s]=i);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=r[s];typeof i=="function"?i():o(null);break}case"object":{o.current=null;break}}}}}}}const UL=parseInt(S.version,10);function Rm(e){return UL>=e}function Hv(e){if(!S.isValidElement(e))return null;const t=e,n=t.props;return(Rm(19)?n==null?void 0:n.ref:t.ref)??null}function Op(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function KL(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 qL(e,t){return typeof e=="function"?e(t):e}function YL(e,t){return typeof e=="function"?e(t):e}const Nl={};function YE(e,t,n,r,s){let o={...Ap(e,Nl)};return t&&(o=qc(o,t)),n&&(o=qc(o,n)),r&&(o=qc(o,r)),o}function QL(e){if(e.length===0)return Nl;if(e.length===1)return Ap(e[0],Nl);let t={...Ap(e[0],Nl)};for(let n=1;n<e.length;n+=1)t=qc(t,e[n]);return t}function qc(e,t){return QE(t)?t(e):XL(e,t)}function XL(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Op(e.style,r);break}case"className":{e[n]=XE(e.className,r);break}default:GL(n,r)?e[n]=ZL(e[n],r):e[n]=r}}return e}function GL(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 QE(e){return typeof e=="function"}function Ap(e,t){return QE(e)?e(t):e??Nl}function ZL(e,t){return t?e?n=>{if(JL(n)){const s=n;jp(s);const o=t(s);return s.baseUIHandlerPrevented||e==null||e(s),o}const r=t(n);return e==null||e(n),r}:t:e}function jp(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function XE(e,t){return t?e?t+" "+e:t:e}function JL(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function GE(){}const zp=Object.freeze([]),St=Object.freeze({}),eD=500,tD={style:{transition:"none"}},ZE="data-base-ui-click-trigger",JE={fallbackAxisSide:"end"},nD={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function kt(e,t,n={}){const r=t.render,s=rD(t,n);if(n.enabled===!1)return null;const o=n.state??St;return sD(e,r,s,o)}function rD(e,t={}){const{className:n,style:r,render:s}=e,{state:o=St,ref:i,props:l,stateAttributesMapping:a,enabled:c=!0}=t,d=c?qL(n,o):void 0,u=c?YL(r,o):void 0,f=c?KL(o,a):St,h=c?Op(f,Array.isArray(l)?QL(l):l)??St:St;return typeof document<"u"&&(c?Array.isArray(i)?h.ref=HL([h.ref,Hv(s),...i]):h.ref=Ri(h.ref,Hv(s),i):Ri(null,null)),c?(d!==void 0&&(h.className=XE(h.className,d)),u!==void 0&&(h.style=Op(h.style,u)),h):St}function sD(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=YE(n,t.props);return s.ref=n.ref,S.cloneElement(t,s)}if(e&&typeof e=="string")return oD(e,n);throw new Error(It(8))}function oD(e,t){return e==="button"?S.createElement("button",{type:"button",...t,key:t.key}):e==="img"?S.createElement("img",{alt:"",...t,key:t.key}):S.createElement(e,t)}let Bu=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const iD={[Bu.startingStyle]:""},lD={[Bu.endingStyle]:""},Td={transitionStatus(e){return e==="starting"?iD:e==="ending"?lD:null}};let As=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Bu.startingStyle]="startingStyle",e[e.endingStyle=Bu.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e}({}),Lp=function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e}({});const aD={[Lp.popupOpen]:""},cD={[Lp.popupOpen]:"",[Lp.pressed]:""},uD={[As.open]:""},dD={[As.closed]:""},fD={[As.anchorHidden]:""},ek={open(e){return e?aD:null}},hD={open(e){return e?cD:null}},Di={open(e){return e?uD:dD},anchorHidden(e){return e?fD:null}},pD={...Di,...Td},gD=S.forwardRef(function(t,n){const{render:r,className:s,forceRender:o=!1,...i}=t,{store:l}=mo(),a=l.useState("open"),c=l.useState("nested"),d=l.useState("mounted"),u=l.useState("transitionStatus"),f=S.useMemo(()=>({open:a,transitionStatus:u}),[a,u]);return kt("div",t,{state:f,ref:[l.context.backdropRef,n],stateAttributesMapping:pD,props:[{role:"presentation",hidden:!d,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:o||!c})});function Md(){return typeof window<"u"}function xs(e){return Nm(e)?(e.nodeName||"").toLowerCase():"#document"}function Ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function kr(e){var t;return(t=(Nm(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Nm(e){return Md()?e instanceof Node||e instanceof Ge(e).Node:!1}function Ie(e){return Md()?e instanceof Element||e instanceof Ge(e).Element:!1}function Xe(e){return Md()?e instanceof HTMLElement||e instanceof Ge(e).HTMLElement:!1}function Dp(e){return!Md()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ge(e).ShadowRoot}function Fi(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=rn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function mD(e){return/^(table|td|th)$/.test(xs(e))}function Id(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const yD=/transform|translate|scale|rotate|perspective|filter/,vD=/paint|layout|strict|content/,Es=e=>!!e&&e!=="none";let Hf;function Pm(e){const t=Ie(e)?rn(e):e;return Es(t.transform)||Es(t.translate)||Es(t.scale)||Es(t.rotate)||Es(t.perspective)||!_d()&&(Es(t.backdropFilter)||Es(t.filter))||yD.test(t.willChange||"")||vD.test(t.contain||"")}function xD(e){let t=hs(e);for(;Xe(t)&&!as(t);){if(Pm(t))return t;if(Id(t))return null;t=hs(t)}return null}function _d(){return Hf==null&&(Hf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Hf}function as(e){return/^(html|body|#document)$/.test(xs(e))}function rn(e){return Ge(e).getComputedStyle(e)}function Od(e){return Ie(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hs(e){if(xs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Dp(e)&&e.host||kr(e);return Dp(t)?t.host:t}function tk(e){const t=hs(e);return as(t)?(e.ownerDocument||e).body:Xe(t)&&Fi(t)?t:tk(t)}function cs(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=tk(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=Ge(s);if(o){const l=Fp(i);return t.concat(i,i.visualViewport||[],Fi(s)?s:[],l&&n?cs(l):[])}else return t.concat(s,cs(s,[],n))}function Fp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Vf=Zx[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],wD=Vf&&Vf!==S.useLayoutEffect?Vf:e=>e();function he(e){const t=Ut(bD).current;return t.next=e,wD(t.effect),t.trampoline}function bD(){const e={next:void 0,callback:SD,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function SD(){}const ED=()=>{},ye=typeof document<"u"?S.useLayoutEffect:ED,nk=S.createContext(void 0);function rk(e=!1){const t=S.useContext(nk);if(t===void 0&&!e)throw new Error(It(16));return t}function kD(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(d){n&&t&&d.key!=="Tab"&&d.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 Tm(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0}=e,o=S.useRef(null),i=rk(!0)!==void 0,l=he(()=>{const f=o.current;return!!((f==null?void 0:f.tagName)==="A"&&(f!=null&&f.href))}),{props:a}=kD({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:r,isNativeButton:s}),c=S.useCallback(()=>{const f=o.current;CD(f)&&i&&t&&a.disabled===void 0&&f.disabled&&(f.disabled=!1)},[t,a.disabled,i]);ye(c,[c]);const d=S.useCallback((f={})=>{const{onClick:h,onMouseDown:g,onKeyUp:x,onKeyDown:b,onPointerDown:p,...y}=f;return YE({type:s?"button":void 0,onClick(w){if(t){w.preventDefault();return}h==null||h(w)},onMouseDown(w){t||g==null||g(w)},onKeyDown(w){if(t||(jp(w),b==null||b(w)),w.baseUIHandlerPrevented)return;const k=w.target===w.currentTarget&&!s&&!l()&&!t,C=w.key==="Enter",R=w.key===" ";k&&((R||C)&&w.preventDefault(),C&&(h==null||h(w)))},onKeyUp(w){t||(jp(w),x==null||x(w)),!w.baseUIHandlerPrevented&&w.target===w.currentTarget&&!s&&!t&&w.key===" "&&(h==null||h(w))},onPointerDown(w){if(t){w.preventDefault();return}p==null||p(w)}},s?void 0:{role:"button"},a,y)},[t,a,s,l]),u=he(f=>{o.current=f,c()});return{getButtonProps:d,buttonRef:u}}function CD(e){return Xe(e)&&e.tagName==="BUTTON"}const sa="none",Qn="trigger-press",Dt="trigger-hover",$p="trigger-focus",sk="outside-press",RD="close-press",oa="focus-out",Ad="escape-key",ND="disabled",Mm="imperative-action";function Te(e,t,n,r){let s=!1,o=!1;const i=r??St;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 PD=S.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,...l}=t,{store:a}=mo(),c=a.useState("open");function d(g){c&&a.setOpen(!1,Te(RD,g.nativeEvent))}const{getButtonProps:u,buttonRef:f}=Tm({disabled:o,native:i}),h=S.useMemo(()=>({disabled:o}),[o]);return kt("button",t,{state:h,ref:[n,f],props:[{onClick:d},l,u]})}),TD={...Zx};let Vv=0;function MD(e,t="mui"){const[n,r]=S.useState(e),s=e||n;return S.useEffect(()=>{n==null&&(Vv+=1,r(`${t}-${Vv}`))},[n,t]),s}const Wv=TD.useId;function $i(e,t){if(Wv!==void 0){const n=Wv();return e??(t?`${t}-${n}`:n)}return MD(e,t)}function Bi(e){return $i(e,"base-ui")}const ID=S.forwardRef(function(t,n){const{render:r,className:s,id:o,...i}=t,{store:l}=mo(),a=Bi(o);return l.useSyncedValueWithCleanup("descriptionElementId",a),kt("p",t,{ref:n,props:[{id:a},i]})}),_D=[];function Im(e){S.useEffect(e,_D)}const ll=0;class wr{constructor(){Re(this,"currentId",ll);Re(this,"clear",()=>{this.currentId!==ll&&(clearTimeout(this.currentId),this.currentId=ll)});Re(this,"disposeEffect",()=>this.clear)}static create(){return new wr}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ll,n()},t)}isStarted(){return this.currentId!==ll}}function br(){const e=Ut(wr.create).current;return Im(e.disposeEffect),e}function Nn(e){const t=Ut(OD,e).current;return t.next=e,ye(t.effect),t}function OD(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Hi=typeof navigator<"u",Wf=LD(),ok=FD(),ik=DD(),AD=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),jD=Wf.platform==="MacIntel"&&Wf.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Wf.platform),lk=Hi&&/apple/i.test(navigator.vendor),Bp=Hi&&/android/i.test(ok)||/android/i.test(ik),zD=Hi&&ok.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,ak=ik.includes("jsdom/");function LD(){if(!Hi)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function DD(){if(!Hi)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function FD(){if(!Hi)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}const Hp="data-base-ui-focusable",ck="active",uk="selected",dk="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Uf="ArrowLeft",Kf="ArrowRight",$D="ArrowUp",BD="ArrowDown";function ir(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 Ee(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&&Dp(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Nt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function vn(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 HD(e){return e.matches("html,body")}function Ze(e){return(e==null?void 0:e.ownerDocument)||document}function _m(e){return Xe(e)&&e.matches(dk)}function Uv(e){return e?e.getAttribute("role")==="combobox"&&_m(e):!1}function VD(e){if(!e||ak)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Vp(e){return e?e.hasAttribute(Hp)?e:e.querySelector(`[${Hp}]`)||e:null}function Xs(e,t,n=!0){return e.filter(s=>{var o;return s.parentId===t&&(!n||((o=s.context)==null?void 0:o.open))}).flatMap(s=>[s,...Xs(e,s.id,n)])}function Kv(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 Ns(e){e.preventDefault(),e.stopPropagation()}function WD(e){return"nativeEvent"in e}function UD(e){return e.mozInputSource===0&&e.isTrusted?!0:Bp&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function KD(e){return ak?!1:!Bp&&e.width===0&&e.height===0||Bp&&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 co(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function fk(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const qD=["top","right","bottom","left"],Ni=Math.min,fr=Math.max,Pi=Math.round,zo=Math.floor,hr=e=>({x:e,y:e}),YD={left:"right",right:"left",bottom:"top",top:"bottom"};function hk(e,t,n){return fr(e,Ni(t,n))}function Sr(e,t){return typeof e=="function"?e(t):e}function en(e){return e.split("-")[0]}function ws(e){return e.split("-")[1]}function Om(e){return e==="x"?"y":"x"}function Am(e){return e==="y"?"height":"width"}function hn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function jm(e){return Om(hn(e))}function QD(e,t,n){n===void 0&&(n=!1);const r=ws(e),s=jm(e),o=Am(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Hu(i)),[i,Hu(i)]}function XD(e){const t=Hu(e);return[Wp(e),t,Wp(t)]}function Wp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const qv=["left","right"],Yv=["right","left"],GD=["top","bottom"],ZD=["bottom","top"];function JD(e,t,n){switch(e){case"top":case"bottom":return n?t?Yv:qv:t?qv:Yv;case"left":case"right":return t?GD:ZD;default:return[]}}function e5(e,t,n,r){const s=ws(e);let o=JD(en(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(Wp)))),o}function Hu(e){const t=en(e);return YD[t]+e.slice(t.length)}function t5(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 pk(e){return typeof e!="number"?t5(e):{top:e,right:e,bottom:e,left:e}}function Vu(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 wc(e,t,n){return Math.floor(e/t)!==n}function Yc(e,t){return t<0||t>=e.current.length}function n5(e,t){return Kt(e,{disabledIndices:t})}function r5(e,t){return Kt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Kt(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.current.length-1&&Pl(e,o,r));return o}function s5(e,{event:t,orientation:n,loopFocus:r,rtl:s,cols:o,disabledIndices:i,minIndex:l,maxIndex:a,prevIndex:c,stopEvent:d=!1}){let u=c;const f=[],h={};let g=!1;{let p=null,y=-1;e.current.forEach((m,w)=>{if(m==null)return;const k=m.closest('[role="row"]');k&&(g=!0),(k!==p||y===-1)&&(p=k,y+=1,f[y]=[]),f[y].push(w),h[w]=y})}const x=g&&f.length>0&&f.some(p=>p.length!==o);function b(p){if(!x||c===-1)return;const y=h[c];if(y==null)return;const m=f[y].indexOf(c);let w=p==="up"?y-1:y+1;r&&(w<0?w=f.length-1:w>=f.length&&(w=0));const k=new Set;for(;w>=0&&w<f.length&&!k.has(w);){k.add(w);const C=f[w];if(C.length===0){w=p==="up"?w-1:w+1;continue}const R=Math.min(m,C.length-1);for(let E=R;E>=0;E-=1){const M=C[E];if(!Pl(e,M,i))return M}w=p==="up"?w-1:w+1,r&&(w<0?w=f.length-1:w>=f.length&&(w=0))}}if(t.key===$D){const p=b("up");if(p!==void 0)d&&Ns(t),u=p;else{if(d&&Ns(t),c===-1)u=a;else if(u=Kt(e,{startingIndex:u,amount:o,decrement:!0,disabledIndices:i}),r&&(c-o<l||u<0)){const y=c%o,m=a%o,w=a-(m-y);m===y?u=a:u=m>y?w:w-o}Yc(e,u)&&(u=c)}}if(t.key===BD){const p=b("down");p!==void 0?(d&&Ns(t),u=p):(d&&Ns(t),c===-1?u=l:(u=Kt(e,{startingIndex:c,amount:o,disabledIndices:i}),r&&c+o>a&&(u=Kt(e,{startingIndex:c%o-o,amount:o,disabledIndices:i}))),Yc(e,u)&&(u=c))}if(n==="both"){const p=zo(c/o);t.key===(s?Uf:Kf)&&(d&&Ns(t),c%o!==o-1?(u=Kt(e,{startingIndex:c,disabledIndices:i}),r&&wc(u,o,p)&&(u=Kt(e,{startingIndex:c-c%o-1,disabledIndices:i}))):r&&(u=Kt(e,{startingIndex:c-c%o-1,disabledIndices:i})),wc(u,o,p)&&(u=c)),t.key===(s?Kf:Uf)&&(d&&Ns(t),c%o!==0?(u=Kt(e,{startingIndex:c,decrement:!0,disabledIndices:i}),r&&wc(u,o,p)&&(u=Kt(e,{startingIndex:c+(o-c%o),decrement:!0,disabledIndices:i}))):r&&(u=Kt(e,{startingIndex:c+(o-c%o),decrement:!0,disabledIndices:i})),wc(u,o,p)&&(u=c));const y=zo(a/o)===p;Yc(e,u)&&(r&&y?u=t.key===(s?Kf:Uf)?a:Kt(e,{startingIndex:c-c%o-1,disabledIndices:i}):u=c)}return u}function o5(e,t,n){const r=[];let s=0;return e.forEach(({width:o,height:i},l)=>{let a=!1;for(n&&(s=0);!a;){const c=[];for(let d=0;d<o;d+=1)for(let u=0;u<i;u+=1)c.push(s+d+u*t);s%t+o<=t&&c.every(d=>r[d]==null)?(c.forEach(d=>{r[d]=l}),a=!0):s+=1}}),[...r]}function i5(e,t,n,r,s){if(e===-1)return-1;const o=n.indexOf(e),i=t[e];switch(s){case"tl":return o;case"tr":return i?o+i.width-1:o;case"bl":return i?o+(i.height-1)*r:o;case"br":return n.lastIndexOf(e);default:return-1}}function l5(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Pl(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r?r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true":!1}/*!
|
|
63
|
+
* tabbable 6.5.0
|
|
64
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
65
|
+
*/var a5=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Wu=a5.join(","),gk=typeof Element>"u",Ti=gk?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Uu=!gk&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Ku=function(t,n){var r;n===void 0&&(n=!0);var s=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=s===""||s==="true",i=o||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Ku(t.parentNode));return i},c5=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},mk=function(t,n,r){if(Ku(t))return[];var s=Array.prototype.slice.apply(t.querySelectorAll(Wu));return n&&Ti.call(t,Wu)&&s.unshift(t),s=s.filter(r),s},qu=function(t,n,r){for(var s=[],o=Array.from(t);o.length;){var i=o.shift();if(!Ku(i,!1))if(i.tagName==="SLOT"){var l=i.assignedElements(),a=l.length?l:i.children,c=qu(a,!0,r);r.flatten?s.push.apply(s,c):s.push({scopeParent:i,candidates:c})}else{var d=Ti.call(i,Wu);d&&r.filter(i)&&(n||!t.includes(i))&&s.push(i);var u=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),f=!Ku(u,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(u&&f){var h=qu(u===!0?i.children:u.children,!0,r);r.flatten?s.push.apply(s,h):s.push({scopeParent:i,candidates:h})}else o.unshift.apply(o,i.children)}}return s},yk=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},vk=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||c5(t))&&!yk(t)?0:t.tabIndex},u5=function(t,n){var r=vk(t);return r<0&&n&&!yk(t)?0:r},d5=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},xk=function(t){return t.tagName==="INPUT"},f5=function(t){return xk(t)&&t.type==="hidden"},h5=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},p5=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},g5=function(t){if(!t.name)return!0;var n=t.form||Uu(t),r=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=r(window.CSS.escape(t.name));else try{s=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var o=p5(s,t.form);return!o||o===t},m5=function(t){return xk(t)&&t.type==="radio"},y5=function(t){return m5(t)&&!g5(t)},v5=function(t){var n,r=t&&Uu(t),s=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var i,l,a;for(o=!!((i=s)!==null&&i!==void 0&&(l=i.ownerDocument)!==null&&l!==void 0&&l.contains(s)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!o&&s;){var c,d,u;r=Uu(s),s=(c=r)===null||c===void 0?void 0:c.host,o=!!((d=s)!==null&&d!==void 0&&(u=d.ownerDocument)!==null&&u!==void 0&&u.contains(s))}}return o},Qv=function(t){var n=t.getBoundingClientRect(),r=n.width,s=n.height;return r===0&&s===0},x5=function(t,n){var r=n.displayCheck,s=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}var i=getComputedStyle(t),l=i.visibility;if(l==="hidden"||l==="collapse")return!0;var a=Ti.call(t,"details>summary:first-of-type"),c=a?t.parentElement:t;if(Ti.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof s=="function"){for(var d=t;t;){var u=t.parentElement,f=Uu(t);if(u&&!u.shadowRoot&&s(u)===!0)return Qv(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=d}if(v5(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Qv(t);return!1},w5=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var s=n.children.item(r);if(s.tagName==="LEGEND")return Ti.call(n,"fieldset[disabled] *")?!0:!s.contains(t)}return!0}n=n.parentElement}return!1},Up=function(t,n){return!(n.disabled||f5(n)||x5(n,t)||h5(n)||w5(n))},Kp=function(t,n){return!(y5(n)||vk(n)<0||!Up(t,n))},b5=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},wk=function(t){var n=[],r=[];return t.forEach(function(s,o){var i=!!s.scopeParent,l=i?s.scopeParent:s,a=u5(l,i),c=i?wk(s.candidates):l;a===0?i?n.push.apply(n,c):n.push(l):r.push({documentOrder:o,tabIndex:a,item:s,isScope:i,content:c})}),r.sort(d5).reduce(function(s,o){return o.isScope?s.push.apply(s,o.content):s.push(o.content),s},[]).concat(n)},Pa=function(t,n){n=n||{};var r;return n.getShadowRoot?r=qu([t],n.includeContainer,{filter:Kp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:b5}):r=mk(t,n.includeContainer,Kp.bind(null,n)),wk(r)},S5=function(t,n){n=n||{};var r;return n.getShadowRoot?r=qu([t],n.includeContainer,{filter:Up.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=mk(t,n.includeContainer,Up.bind(null,n)),r},bk=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ti.call(t,Wu)===!1?!1:Kp(n,t)};const Vi=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Sk(e,t){const n=Pa(e,Vi()),r=n.length;if(r===0)return;const s=ir(Ze(e)),o=n.indexOf(s),i=o===-1?t===1?0:r-1:o+t;return n[i]}function zm(e){return Sk(Ze(e).body,1)||e}function Ek(e){return Sk(Ze(e).body,-1)||e}function kk(e,t){if(!e)return null;const n=Pa(Ze(e).body,Vi()),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 E5(e){return kk(e,1)}function k5(e){return kk(e,-1)}function Uo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ee(n,r)}function C5(e){Pa(e,Vi()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Xv(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Ck(){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 R5{constructor(){Re(this,"nodesRef",{current:[]});Re(this,"events",Ck())}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 Rk=S.createContext(null),Nk=S.createContext(null),yo=()=>{var e;return((e=S.useContext(Rk))==null?void 0:e.id)||null},Wi=e=>{const t=S.useContext(Nk);return e??t};function N5(e){const t=$i(),n=Wi(e),r=yo();return ye(()=>{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 P5(e){const{children:t,id:n}=e,r=yo();return v.jsx(Rk.Provider,{value:S.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function T5(e){const{children:t,externalTree:n}=e,r=Ut(()=>n??new R5).current;return v.jsx(Nk.Provider,{value:r,children:t})}function Mi(e){return`data-base-ui-${e}`}function Qc(e,t,n){if(n&&!co(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}const Pk=S.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new wr,currentIdRef:{current:null},currentContextRef:{current:null}});function M5(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=br();return v.jsx(Pk.Provider,{value:S.useMemo(()=>({hasProvider:!0,delayRef:s,initialDelayRef:o,currentIdRef:i,timeoutMs:r,currentContextRef:l,timeout:a}),[r,a]),children:t})}function I5(e,t={open:!1}){const n="rootStore"in e?e.rootStore:e,r=n.useState("floatingId"),{enabled:s=!0,open:o}=t,i=S.useContext(Pk),{currentIdRef:l,delayRef:a,timeoutMs:c,initialDelayRef:d,currentContextRef:u,hasProvider:f,timeout:h}=i,[g,x]=S.useState(!1);return ye(()=>{function b(){var p;x(!1),(p=u.current)==null||p.setIsInstantPhase(!1),l.current=null,u.current=null,a.current=d.current}if(s&&l.current&&!o&&l.current===r){if(x(!1),c)return h.start(c,b),()=>{h.clear()};b()}},[s,o,r,l,a,c,d,u,h]),ye(()=>{if(!s||!o)return;const b=u.current,p=l.current;u.current={onOpenChange:n.setOpen,setIsInstantPhase:x},l.current=r,a.current={open:0,close:Qc(d.current,"close")},p!==null&&p!==r?(h.clear(),x(!0),b==null||b.setIsInstantPhase(!0),b==null||b.onOpenChange(!1,Te(sa))):(x(!1),b==null||b.setIsInstantPhase(!1))},[s,o,r,n,l,a,c,d,u,h]),ye(()=>()=>{u.current=null},[u]),S.useMemo(()=>({hasProvider:f,delayRef:a,isInstantPhase:g}),[f,a,g])}const Tk={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1},bc=null;class _5{constructor(){Re(this,"callbacks",[]);Re(this,"callbacksCount",0);Re(this,"nextId",1);Re(this,"startId",1);Re(this,"isScheduled",!1);Re(this,"tick",t=>{var s;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)(s=n[o])==null||s.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Sc=new _5;class Vn{constructor(){Re(this,"currentId",bc);Re(this,"cancel",()=>{this.currentId!==bc&&(Sc.cancel(this.currentId),this.currentId=bc)});Re(this,"disposeEffect",()=>this.cancel)}static create(){return new Vn}static request(t){return Sc.request(t)}static cancel(t){return Sc.cancel(t)}request(t){this.cancel(),this.currentId=Sc.request(()=>{this.currentId=bc,t()})}}function jd(){const e=Ut(Vn.create).current;return Im(e.disposeEffect),e}function ps(e){return(e==null?void 0:e.ownerDocument)||document}const Ii=S.forwardRef(function(t,n){const[r,s]=S.useState();ye(()=>{lk&&s("button")},[]);const o={tabIndex:0,role:r};return v.jsx("span",{...t,ref:n,style:Tk,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})});let Gv=0;function qf(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:s=!1}=t;r&&cancelAnimationFrame(Gv);const o=()=>e==null?void 0:e.focus({preventScroll:n});s?o():Gv=requestAnimationFrame(o)}const Ko={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Zv(e){return e==="inert"?Ko.inert:e==="aria-hidden"?Ko["aria-hidden"]:Ko.none}let Ec=new WeakSet,kc={},Yf=0;const Mk=e=>e&&(e.host||Mk(e.parentNode)),O5=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Mk(n);return e.contains(r)?r:null}).filter(n=>n!=null);function A5(e,t,n,r){const s="data-base-ui-inert",o=r?"inert":n?"aria-hidden":null,i=O5(t,e),l=new Set,a=new Set(i),c=[];kc[s]||(kc[s]=new WeakMap);const d=kc[s];i.forEach(u),f(t),l.clear();function u(h){!h||l.has(h)||(l.add(h),h.parentNode&&u(h.parentNode))}function f(h){!h||a.has(h)||[].forEach.call(h.children,g=>{if(xs(g)!=="script")if(l.has(g))f(g);else{const x=o?g.getAttribute(o):null,b=x!==null&&x!=="false",p=Zv(o),y=(p.get(g)||0)+1,m=(d.get(g)||0)+1;p.set(g,y),d.set(g,m),c.push(g),y===1&&b&&Ec.add(g),m===1&&g.setAttribute(s,""),!b&&o&&g.setAttribute(o,o==="inert"?"":"true")}})}return Yf+=1,()=>{c.forEach(h=>{const g=Zv(o),b=(g.get(h)||0)-1,p=(d.get(h)||0)-1;g.set(h,b),d.set(h,p),b||(!Ec.has(h)&&o&&h.removeAttribute(o),Ec.delete(h)),p||h.removeAttribute(s)}),Yf-=1,Yf||(Ko.inert=new WeakMap,Ko["aria-hidden"]=new WeakMap,Ko.none=new WeakMap,Ec=new WeakSet,kc={})}}function j5(e,t=!1,n=!1){const r=Ze(e[0]).body;return A5(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Ik=S.createContext(null),_k=()=>S.useContext(Ik),z5=Mi("portal");function Ok(e={}){const{ref:t,container:n,componentProps:r=St,elementProps:s,elementState:o}=e,i=$i(),l=_k(),a=l==null?void 0:l.portalNode,[c,d]=S.useState(null),[u,f]=S.useState(null),h=S.useRef(null);ye(()=>{if(n===null){h.current&&(h.current=null,f(null),d(null));return}if(i==null)return;const b=(n&&(Nm(n)?n:n.current))??a??document.body;if(b==null){h.current&&(h.current=null,f(null),d(null));return}h.current!==b&&(h.current=b,f(null),d(b))},[n,a,i]);const g=kt("div",r,{ref:[t,f],state:o,props:[{id:i,[z5]:""},s]});return{portalNode:u,portalSubtree:c&&g?Wt.createPortal(g,c):null}}const Ak=S.forwardRef(function(t,n){const{children:r,container:s,className:o,render:i,renderGuards:l,...a}=t,{portalNode:c,portalSubtree:d}=Ok({container:s,ref:n,componentProps:t,elementProps:a}),u=S.useRef(null),f=S.useRef(null),h=S.useRef(null),g=S.useRef(null),[x,b]=S.useState(null),p=x==null?void 0:x.modal,y=x==null?void 0:x.open,m=typeof l=="boolean"?l:!!x&&!x.modal&&x.open&&!!c;S.useEffect(()=>{if(!c||p)return;function k(C){c&&Uo(C)&&(C.type==="focusin"?Xv:C5)(c)}return c.addEventListener("focusin",k,!0),c.addEventListener("focusout",k,!0),()=>{c.removeEventListener("focusin",k,!0),c.removeEventListener("focusout",k,!0)}},[c,p]),S.useEffect(()=>{!c||y||Xv(c)},[y,c]);const w=S.useMemo(()=>({beforeOutsideRef:u,afterOutsideRef:f,beforeInsideRef:h,afterInsideRef:g,portalNode:c,setFocusManagerState:b}),[c]);return v.jsxs(S.Fragment,{children:[d,v.jsxs(Ik.Provider,{value:w,children:[m&&c&&v.jsx(Ii,{"data-type":"outside",ref:u,onFocus:k=>{var C;if(Uo(k,c))(C=h.current)==null||C.focus();else{const R=x?x.domReference:null,E=Ek(R);E==null||E.focus()}}}),m&&c&&v.jsx("span",{"aria-owns":c.id,style:nD}),c&&Wt.createPortal(r,c),m&&c&&v.jsx(Ii,{"data-type":"outside",ref:f,onFocus:k=>{var C;if(Uo(k,c))(C=g.current)==null||C.focus();else{const R=x?x.domReference:null,E=zm(R);E==null||E.focus(),x!=null&&x.closeOnFocusOut&&(x==null||x.onOpenChange(!1,Te(oa,k.nativeEvent)))}}})]})]})});function Ps(e){return e==null?e:"current"in e?e.current:e}function L5(e,t){const n=Ge(e.target);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 Jv=20;let Zr=[];function Lm(){Zr=Zr.filter(e=>e.isConnected)}function D5(e){Lm(),e&&xs(e)!=="body"&&(Zr.push(e),Zr.length>Jv&&(Zr=Zr.slice(-Jv)))}function Qf(){return Lm(),Zr[Zr.length-1]}function F5(e){if(!e)return null;const t=Vi();return bk(e,t)?e:Pa(e,t)[0]||e}function $5(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():rn(e).display!=="none"}function ex(e,t){var i;if(!t.current.includes("floating")&&!((i=e.getAttribute("role"))!=null&&i.includes("dialog")))return;const n=Vi(),s=S5(e,n).filter(l=>{const a=l.getAttribute("data-tabindex")||"";return bk(l,n)||l.hasAttribute("data-tabindex")&&!a.startsWith("-")}),o=e.getAttribute("tabindex");t.current.includes("floating")||s.length===0?o!=="0"&&e.setAttribute("tabindex","0"):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function jk(e){const{context:t,children:n,disabled:r=!1,order:s=["content"],initialFocus:o=!0,returnFocus:i=!0,restoreFocus:l=!1,modal:a=!0,closeOnFocusOut:c=!0,openInteractionType:d="",getInsideElements:u=()=>[],nextFocusableElement:f,previousFocusableElement:h,beforeContentFocusGuardRef:g,externalTree:x}=e,b="rootStore"in t?t.rootStore:t,p=b.useState("open"),y=b.useState("domReferenceElement"),m=b.useState("floatingElement"),{events:w,dataRef:k}=b.context,C=he(()=>{var W;return(W=k.current.floatingContext)==null?void 0:W.nodeId}),R=he(u),E=o===!1,M=Uv(y)&&E,_=Nn(s),j=Nn(o),D=Nn(i),O=Nn(d),N=Wi(x),T=_k(),z=S.useRef(null),F=S.useRef(null),P=S.useRef(!1),I=S.useRef(!1),A=S.useRef(!1),B=S.useRef(-1),$=S.useRef(""),U=S.useRef(""),q=br(),K=br(),X=jd(),G=T!=null,H=Vp(m),Y=he((W=H)=>W?Pa(W,Vi()):[]),te=he(W=>{const J=Y(W);return _.current.map(()=>J).filter(Boolean).flat()});S.useEffect(()=>{if(r||!a)return;function W(se){se.key==="Tab"&&Ee(H,ir(Ze(H)))&&Y().length===0&&!M&&Ns(se)}const J=Ze(H);return J.addEventListener("keydown",W),()=>{J.removeEventListener("keydown",W)}},[r,y,H,a,_,M,Y,te]),S.useEffect(()=>{if(r||!m)return;function W(J){const se=Nt(J),me=Y().indexOf(se);me!==-1&&(B.current=me)}return m.addEventListener("focusin",W),()=>{m.removeEventListener("focusin",W)}},[r,m,Y]),S.useEffect(()=>{if(r||!p)return;const W=Ze(H);function J(){A.current=!1}function se(me){const fe=Nt(me),ue=Ee(m,fe)||Ee(y,fe)||Ee(T==null?void 0:T.portalNode,fe);A.current=!ue,U.current=me.pointerType||"keyboard"}function pe(){U.current="keyboard"}return W.addEventListener("pointerdown",se,!0),W.addEventListener("pointerup",J,!0),W.addEventListener("pointercancel",J,!0),W.addEventListener("keydown",pe,!0),()=>{W.removeEventListener("pointerdown",se,!0),W.removeEventListener("pointerup",J,!0),W.removeEventListener("pointercancel",J,!0),W.removeEventListener("keydown",pe,!0)}},[r,m,y,H,p,T]),S.useEffect(()=>{if(r||!c)return;function W(){I.current=!0,K.start(0,()=>{I.current=!1})}function J(fe){const ue=fe.relatedTarget,Ne=fe.currentTarget,be=Nt(fe);queueMicrotask(()=>{const _e=C(),ft=b.context.triggerElements,mt=!(Ee(y,ue)||Ee(m,ue)||Ee(ue,m)||Ee(T==null?void 0:T.portalNode,ue)||ue!=null&&ft.hasElement(ue)||ft.hasMatchingElement(De=>Ee(De,ue))||ue!=null&&ue.hasAttribute(Mi("focus-guard"))||N&&(Xs(N.nodesRef.current,_e).find(De=>{var lt,tt;return Ee((lt=De.context)==null?void 0:lt.elements.floating,ue)||Ee((tt=De.context)==null?void 0:tt.elements.domReference,ue)})||Kv(N.nodesRef.current,_e).find(De=>{var lt,tt,ln;return[(lt=De.context)==null?void 0:lt.elements.floating,Vp((tt=De.context)==null?void 0:tt.elements.floating)].includes(ue)||((ln=De.context)==null?void 0:ln.elements.domReference)===ue})));if(Ne===y&&H&&ex(H,_),l&&Ne!==y&&!$5(be)&&ir(Ze(H))===Ze(H).body){if(Xe(H)&&(H.focus(),l==="popup")){X.request(()=>{H.focus()});return}const De=B.current,lt=Y(),tt=lt[De]||lt[lt.length-1]||H;Xe(tt)&&tt.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(M||!a)&&ue&&mt&&!I.current&&(M||ue!==Qf())&&(P.current=!0,b.setOpen(!1,Te(oa,fe)))})}function se(){A.current||(k.current.insideReactTree=!0,q.start(0,()=>{k.current.insideReactTree=!1}))}const pe=Xe(y)?y:null,me=[];if(!(!m&&!pe))return pe&&(pe.addEventListener("focusout",J),pe.addEventListener("pointerdown",W),me.push(()=>{pe.removeEventListener("focusout",J),pe.removeEventListener("pointerdown",W)})),m&&(m.addEventListener("focusout",J),T&&(m.addEventListener("focusout",se,!0),me.push(()=>{m.removeEventListener("focusout",se,!0)})),me.push(()=>{m.removeEventListener("focusout",J)})),()=>{me.forEach(fe=>{fe()})}},[r,y,m,H,a,N,T,b,c,l,Y,M,C,_,k,q,K,X]);const V=S.useRef(null),Z=S.useRef(null),Q=Ri(V,g,T==null?void 0:T.beforeInsideRef),ce=Ri(Z,T==null?void 0:T.afterInsideRef);S.useEffect(()=>{var fe,ue,Ne;if(r||!m||!p)return;const W=Array.from(((fe=T==null?void 0:T.portalNode)==null?void 0:fe.querySelectorAll(`[${Mi("portal")}]`))||[]),se=(Ne=(ue=(N?Kv(N.nodesRef.current,C()):[]).find(be=>{var _e;return Uv(((_e=be.context)==null?void 0:_e.elements.domReference)||null)}))==null?void 0:ue.context)==null?void 0:Ne.elements.domReference,pe=[m,se,...W,...R(),z.current,F.current,V.current,Z.current,T==null?void 0:T.beforeOutsideRef.current,T==null?void 0:T.afterOutsideRef.current,Ps(h),Ps(f),M?y:null].filter(be=>be!=null),me=j5(pe,a||M);return()=>{me()}},[p,r,y,m,a,_,T,M,N,C,R,f,h]),ye(()=>{if(!p||r||!Xe(H))return;const W=Ze(H),J=ir(W);queueMicrotask(()=>{const se=te(H),pe=j.current,me=typeof pe=="function"?pe(O.current||""):pe;if(me===void 0||me===!1)return;let fe;me===!0||me===null?fe=se[0]||H:fe=Ps(me),fe=fe||se[0]||H,!Ee(H,J)&&qf(fe,{preventScroll:fe===H})})},[r,p,H,E,te,j,O]),ye(()=>{if(r||!H)return;const W=Ze(H),J=ir(W);D5(J);function se(fe){if(fe.open||($.current=L5(fe.nativeEvent,U.current)),fe.reason===Dt&&fe.nativeEvent.type==="mouseleave"&&(P.current=!0),fe.reason===sk)if(fe.nested)P.current=!1;else if(UD(fe.nativeEvent)||KD(fe.nativeEvent))P.current=!1;else{let ue=!1;document.createElement("div").focus({get preventScroll(){return ue=!0,!1}}),ue?P.current=!1:P.current=!0}}w.on("openchange",se);const pe=W.createElement("span");pe.setAttribute("tabindex","-1"),pe.setAttribute("aria-hidden","true"),Object.assign(pe.style,Tk),G&&y&&y.insertAdjacentElement("afterend",pe);function me(){const fe=D.current;let ue=typeof fe=="function"?fe($.current):fe;if(ue===void 0||ue===!1)return null;if(ue===null&&(ue=!0),typeof ue=="boolean"){const be=y||Qf();return be&&be.isConnected?be:pe}const Ne=y||Qf()||pe;return Ps(ue)||Ne}return()=>{w.off("openchange",se);const fe=ir(W),ue=Ee(m,fe)||N&&Xs(N.nodesRef.current,C(),!1).some(be=>{var _e;return Ee((_e=be.context)==null?void 0:_e.elements.floating,fe)}),Ne=me();queueMicrotask(()=>{const be=F5(Ne),_e=typeof D.current!="boolean";D.current&&!P.current&&Xe(be)&&(!(!_e&&be!==fe&&fe!==W.body)||ue)&&be.focus({preventScroll:!0}),pe.remove()})}},[r,m,H,D,k,w,N,G,y,C]),S.useEffect(()=>{queueMicrotask(()=>{P.current=!1})},[r]),S.useEffect(()=>{if(r||!p)return;function W(se){const pe=Nt(se);pe!=null&&pe.closest(`[${ZE}]`)&&(I.current=!0)}const J=Ze(H);return J.addEventListener("pointerdown",W,!0),()=>{J.removeEventListener("pointerdown",W,!0)}},[r,p,H]),ye(()=>{if(!r&&T)return T.setFocusManagerState({modal:a,closeOnFocusOut:c,open:p,onOpenChange:b.setOpen,domReference:y}),()=>{T.setFocusManagerState(null)}},[r,T,a,p,b,c,y]),ye(()=>{if(!(r||!H))return ex(H,_),()=>{queueMicrotask(Lm)}},[r,H,_]);const re=!r&&(a?!M:!0)&&(G||a);return v.jsxs(S.Fragment,{children:[re&&v.jsx(Ii,{"data-type":"inside",ref:Q,onFocus:W=>{var J;if(a){const se=te();qf(se[se.length-1])}else if(T!=null&&T.portalNode)if(P.current=!1,Uo(W,T.portalNode)){const se=zm(y);se==null||se.focus()}else(J=Ps(h??T.beforeOutsideRef))==null||J.focus()}}),n,re&&v.jsx(Ii,{"data-type":"inside",ref:ce,onFocus:W=>{var J;if(a)qf(te()[0]);else if(T!=null&&T.portalNode)if(c&&(P.current=!0),Uo(W,T.portalNode)){const se=Ek(y);se==null||se.focus()}else(J=Ps(f??T.afterOutsideRef))==null||J.focus()}})]})}function B5(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:s=!0,event:o="click",toggle:i=!0,ignoreMouse:l=!1,stickIfOpen:a=!0,touchOpenDelay:c=0}=t,d=S.useRef(void 0),u=jd(),f=br(),h=S.useMemo(()=>({onPointerDown(g){d.current=g.pointerType},onMouseDown(g){const x=d.current,b=g.nativeEvent,p=n.select("open");if(g.button!==0||o==="click"||co(x,!0)&&l)return;const y=r.current.openEvent,m=y==null?void 0:y.type,w=n.select("domReferenceElement")!==g.currentTarget,k=p&&w||!(p&&i&&(!(y&&a)||m==="click"||m==="mousedown"));if(_m(b.target)){const R=Te(Qn,b,b.target);k&&x==="touch"&&c>0?f.start(c,()=>{n.setOpen(!0,R)}):n.setOpen(k,R);return}const C=g.currentTarget;u.request(()=>{const R=Te(Qn,b,C);k&&x==="touch"&&c>0?f.start(c,()=>{n.setOpen(!0,R)}):n.setOpen(k,R)})},onClick(g){if(o==="mousedown-only")return;const x=d.current;if(o==="mousedown"&&x){d.current=void 0;return}if(co(x,!0)&&l)return;const b=n.select("open"),p=r.current.openEvent,y=n.select("domReferenceElement")!==g.currentTarget,m=b&&y||!(b&&i&&(!(p&&a)||fk(p))),w=Te(Qn,g.nativeEvent,g.currentTarget);m&&x==="touch"&&c>0?f.start(c,()=>{n.setOpen(!0,w)}):n.setOpen(m,w)},onKeyDown(){d.current=void 0}}),[r,o,l,n,a,i,u,f,c]);return S.useMemo(()=>s?{reference:h}:St,[s,h])}function H5(e,t){let n=null,r=null,s=!1;return{contextElement:e||void 0,getBoundingClientRect(){var h;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(((h=t.dataRef.current.openEvent)==null?void 0:h.type)||"")&&t.pointerType!=="touch";let c=o.width,d=o.height,u=o.x,f=o.y;return n==null&&t.x&&i&&(n=o.x-t.x),r==null&&t.y&&l&&(r=o.y-t.y),u-=n||0,f-=r||0,c=0,d=0,!s||a?(c=t.axis==="y"?o.width:0,d=t.axis==="x"?o.height:0,u=i&&t.x!=null?t.x:u,f=l&&t.y!=null?t.y:f):s&&!a&&(d=t.axis==="x"?o.height:d,c=t.axis==="y"?o.width:c),s=!0,{width:c,height:d,x:u,y:f,top:f,right:u+c,bottom:f+d,left:u}}}}function tx(e){return e!=null&&e.clientX!=null}function V5(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),s=n.useState("floatingElement"),o=n.useState("domReferenceElement"),i=n.context.dataRef,{enabled:l=!0,axis:a="both",x:c=null,y:d=null}=t,u=S.useRef(!1),f=S.useRef(null),[h,g]=S.useState(),[x,b]=S.useState([]),p=he((C,R)=>{u.current||i.current.openEvent&&!tx(i.current.openEvent)||n.set("positionReference",H5(o,{x:C,y:R,axis:a,dataRef:i,pointerType:h}))}),y=he(C=>{c!=null||d!=null||(r?f.current||b([]):p(C.clientX,C.clientY))}),m=co(h)?s:r,w=S.useCallback(()=>{if(!m||!l||c!=null||d!=null)return;const C=Ge(s);function R(E){const M=Nt(E);Ee(s,M)?(C.removeEventListener("mousemove",R),f.current=null):p(E.clientX,E.clientY)}if(!i.current.openEvent||tx(i.current.openEvent)){C.addEventListener("mousemove",R);const E=()=>{C.removeEventListener("mousemove",R),f.current=null};return f.current=E,E}n.set("positionReference",o)},[m,l,c,d,s,i,o,n,p]);S.useEffect(()=>w(),[w,x]),S.useEffect(()=>{l&&!s&&(u.current=!1)},[l,s]),S.useEffect(()=>{!l&&r&&(u.current=!0)},[l,r]),ye(()=>{l&&(c!=null||d!=null)&&(u.current=!1,p(c,d))},[l,c,d,p]);const k=S.useMemo(()=>{function C(R){g(R.pointerType)}return{onPointerDown:C,onPointerEnter:C,onMouseMove:y,onMouseEnter:y}},[y]);return S.useMemo(()=>l?{reference:k}:{},[l,k])}function nx(e,t,n){let{reference:r,floating:s}=e;const o=hn(t),i=jm(t),l=Am(i),a=en(t),c=o==="y",d=r.x+r.width/2-s.width/2,u=r.y+r.height/2-s.height/2,f=r[l]/2-s[l]/2;let h;switch(a){case"top":h={x:d,y:r.y-s.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:u};break;case"left":h={x:r.x-s.width,y:u};break;default:h={x:r.x,y:r.y}}const g=ws(t);return g&&(h[i]+=f*(g==="end"?1:-1)*(n&&c?-1:1)),h}async function W5(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:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:h=0}=Sr(t,e),g=pk(h),b=l[f?u==="floating"?"reference":"floating":u],p=Vu(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:d,strategy:a})),y=u==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,m=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),w=await(o.isElement==null?void 0:o.isElement(m))&&await(o.getScale==null?void 0:o.getScale(m))||{x:1,y:1},k=Vu(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:m,strategy:a}):y);return{top:(p.top-k.top+g.top)/w.y,bottom:(k.bottom-p.bottom+g.bottom)/w.y,left:(p.left-k.left+g.left)/w.x,right:(k.right-p.right+g.right)/w.x}}const U5=50,K5=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:W5},a=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:u}=nx(c,r,a),f=r,h=0;const g={};for(let x=0;x<o.length;x++){const b=o[x];if(!b)continue;const{name:p,fn:y}=b,{x:m,y:w,data:k,reset:C}=await y({x:d,y:u,initialPlacement:r,placement:f,strategy:s,middlewareData:g,rects:c,platform:l,elements:{reference:e,floating:t}});d=m??d,u=w??u,g[p]={...g[p],...k},C&&h<U5&&(h++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):C.rects),{x:d,y:u}=nx(c,f,a)),x=-1)}return{x:d,y:u,placement:f,strategy:s,middlewareData:g}},q5=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:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:x=!0,...b}=Sr(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const p=en(s),y=hn(l),m=en(l)===l,w=await(a.isRTL==null?void 0:a.isRTL(c.floating)),k=f||(m||!x?[Hu(l)]:XD(l)),C=g!=="none";!f&&C&&k.push(...e5(l,x,g,w));const R=[l,...k],E=await a.detectOverflow(t,b),M=[];let _=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&M.push(E[p]),u){const N=QD(s,i,w);M.push(E[N[0]],E[N[1]])}if(_=[..._,{placement:s,overflows:M}],!M.every(N=>N<=0)){var j,D;const N=(((j=o.flip)==null?void 0:j.index)||0)+1,T=R[N];if(T&&(!(u==="alignment"?y!==hn(T):!1)||_.every(P=>hn(P.placement)===y?P.overflows[0]>0:!0)))return{data:{index:N,overflows:_},reset:{placement:T}};let z=(D=_.filter(F=>F.overflows[0]<=0).sort((F,P)=>F.overflows[1]-P.overflows[1])[0])==null?void 0:D.placement;if(!z)switch(h){case"bestFit":{var O;const F=(O=_.filter(P=>{if(C){const I=hn(P.placement);return I===y||I==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(I=>I>0).reduce((I,A)=>I+A,0)]).sort((P,I)=>P[1]-I[1])[0])==null?void 0:O[0];F&&(z=F);break}case"initialPlacement":z=l;break}if(s!==z)return{reset:{placement:z}}}return{}}}};function rx(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sx(e){return qD.some(t=>e[t]>=0)}const Y5=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...o}=Sr(e,t);switch(s){case"referenceHidden":{const i=await r.detectOverflow(t,{...o,elementContext:"reference"}),l=rx(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:sx(l)}}}case"escaped":{const i=await r.detectOverflow(t,{...o,altBoundary:!0}),l=rx(i,n.floating);return{data:{escapedOffsets:l,escaped:sx(l)}}}default:return{}}}}},zk=new Set(["left","top"]);async function Q5(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=en(n),l=ws(n),a=hn(n)==="y",c=zk.has(i)?-1:1,d=o&&a?-1:1,u=Sr(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof g=="number"&&(h=l==="end"?g*-1:g),a?{x:h*d,y:f*c}:{x:f*c,y:h*d}}const X5=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 Q5(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}}}}},G5=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:y=>{let{x:m,y:w}=y;return{x:m,y:w}}},...c}=Sr(e,t),d={x:n,y:r},u=await o.detectOverflow(t,c),f=hn(s),h=Om(f);let g=d[h],x=d[f];const b=(y,m)=>hk(m+u[y==="y"?"top":"left"],m,m-u[y==="y"?"bottom":"right"]);i&&(g=b(h,g)),l&&(x=b(f,x));const p=a.fn({...t,[h]:g,[f]:x});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[h]:i,[f]:l}}}}}},Z5=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:d=!0,crossAxis:u=!0}=Sr(e,t),f={x:s,y:o},h=hn(i),g=Om(h);let x=f[g],b=f[h];const p=Sr(c,t),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:(n=p.mainAxis)!=null?n:0,crossAxis:(r=p.crossAxis)!=null?r:0};if(d){const k=g==="y"?"height":"width",C=l.reference[g]-l.floating[k]+y.mainAxis,R=l.reference[g]+l.reference[k]-y.mainAxis;x<C?x=C:x>R&&(x=R)}if(u){var m,w;const k=g==="y"?"width":"height",C=zk.has(en(i)),R=l.reference[h]-l.floating[k]+(C&&((m=a.offset)==null?void 0:m[h])||0)+(C?0:y.crossAxis),E=l.reference[h]+l.reference[k]+(C?0:((w=a.offset)==null?void 0:w[h])||0)-(C?y.crossAxis:0);b<R?b=R:b>E&&(b=E)}return{[g]:x,[h]:b}}}},J5=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}=Sr(e,t),a=await s.detectOverflow(t,l),c=en(n),d=ws(n),u=hn(n)==="y",{width:f,height:h}=r.floating;let g,x;c==="top"||c==="bottom"?(g=c,x=d===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(x=c,g=d==="end"?"top":"bottom");const b=h-a.top-a.bottom,p=f-a.left-a.right,y=Ni(h-a[g],b),m=Ni(f-a[x],p),w=t.middlewareData.shift,k=!w;let C=y,R=m;w!=null&&w.enabled.x&&(R=p),w!=null&&w.enabled.y&&(C=b),k&&!d&&(u?R=f-2*fr(a.left,a.right):C=h-2*fr(a.top,a.bottom)),await i({...t,availableWidth:R,availableHeight:C});const E=await s.getDimensions(o.floating);return f!==E.width||h!==E.height?{reset:{rects:!0}}:{}}}};function Lk(e){const t=rn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Xe(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,l=Pi(n)!==o||Pi(r)!==i;return l&&(n=o,r=i),{width:n,height:r,$:l}}function Dm(e){return Ie(e)?e:e.contextElement}function qo(e){const t=Dm(e);if(!Xe(t))return hr(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=Lk(t);let i=(o?Pi(n.width):n.width)/r,l=(o?Pi(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const eF=hr(0);function Dk(e){const t=Ge(e);return!_d()||!t.visualViewport?eF:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tF(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ge(e)}function uo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Dm(e);let i=hr(1);t&&(r?Ie(r)&&(i=qo(r)):i=qo(e));const l=tF(o,n,r)?Dk(o):hr(0);let a=(s.left+l.x)/i.x,c=(s.top+l.y)/i.y,d=s.width/i.x,u=s.height/i.y;if(o&&r){const f=Ge(o),h=Ie(r)?Ge(r):r;let g=f,x=Fp(g);for(;x&&h!==g;){const b=qo(x),p=x.getBoundingClientRect(),y=rn(x),m=p.left+(x.clientLeft+parseFloat(y.paddingLeft))*b.x,w=p.top+(x.clientTop+parseFloat(y.paddingTop))*b.y;a*=b.x,c*=b.y,d*=b.x,u*=b.y,a+=m,c+=w,g=Ge(x),x=Fp(g)}}return Vu({width:d,height:u,x:a,y:c})}function zd(e,t){const n=Od(e).scrollLeft;return t?t.left+n:uo(kr(e)).left+n}function Fk(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-zd(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function nF(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=kr(r),l=t?Id(t.floating):!1;if(r===i||l&&o)return n;let a={scrollLeft:0,scrollTop:0},c=hr(1);const d=hr(0),u=Xe(r);if((u||!o)&&((xs(r)!=="body"||Fi(i))&&(a=Od(r)),u)){const h=uo(r);c=qo(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const f=i&&!u&&!o?Fk(i,a):hr(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+d.x+f.x,y:n.y*c.y-a.scrollTop*c.y+d.y+f.y}}function rF(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function sF(e){const t=Od(e),n=e.ownerDocument.body,r=fr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=fr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+zd(e);const i=-t.scrollTop;return rn(n).direction==="rtl"&&(o+=fr(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:o,y:i}}const oF=25;function iF(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Ge(e),o=kr(e),i=s.visualViewport;let l=o.clientWidth,a=o.clientHeight,c=0,d=0;if(i){const f=!_d()||t==="fixed";r?f||(c=-i.offsetLeft,d=-i.offsetTop):(l=i.width,a=i.height,f&&(c=i.offsetLeft,d=i.offsetTop))}if(zd(o)<=0){const f=o.ownerDocument,h=f.body,g=getComputedStyle(h),x=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(o.clientWidth-h.clientWidth-x),p=getComputedStyle(o).scrollbarGutter==="stable both-edges"?b/2:b;p<=oF&&(l-=p)}return{width:l,height:a,x:c,y:d}}function lF(e,t){const n=uo(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=qo(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 ox(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=iF(e,n,t);else if(t==="document")r=sF(kr(e));else if(Ie(t))r=lF(t,n);else{const s=Dk(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Vu(r)}function aF(e,t){const n=t.get(e);if(n)return n;let r=cs(e,[],!1).filter(l=>Ie(l)&&xs(l)!=="body"),s=null;const o=rn(e).position==="fixed";let i=o?hs(e):e;for(;Ie(i)&&!as(i);){const l=rn(i),a=Pm(i),c=s?s.position:o?"fixed":"";!a&&(c==="fixed"||c==="absolute"&&l.position==="static")?r=r.filter(u=>u!==i):s=l,i=hs(i)}return t.set(e,r),r}function cF(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?Id(t)?[]:aF(t,this._c):[].concat(n),r],l=ox(t,i[0],s);let a=l.top,c=l.right,d=l.bottom,u=l.left;for(let f=1;f<i.length;f++){const h=ox(t,i[f],s);a=fr(h.top,a),c=Ni(h.right,c),d=Ni(h.bottom,d),u=fr(h.left,u)}return{width:c-u,height:d-a,x:u,y:a}}function uF(e){const{width:t,height:n}=Lk(e);return{width:t,height:n}}function dF(e,t,n){const r=Xe(t),s=kr(t),o=n==="fixed",i=uo(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const a=hr(0);if((r||!o)&&((xs(t)!=="body"||Fi(s))&&(l=Od(t)),r)){const f=uo(t,!0,o,t);a.x=f.x+t.clientLeft,a.y=f.y+t.clientTop}!r&&s&&(a.x=zd(s));const c=s&&!r&&!o?Fk(s,l):hr(0),d=i.left+l.scrollLeft-a.x-c.x,u=i.top+l.scrollTop-a.y-c.y;return{x:d,y:u,width:i.width,height:i.height}}function Xf(e){return rn(e).position==="static"}function ix(e,t){if(!Xe(e)||rn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return kr(e)===n&&(n=n.ownerDocument.body),n}function $k(e,t){const n=Ge(e);if(Id(e))return n;if(!Xe(e)){let s=hs(e);for(;s&&!as(s);){if(Ie(s)&&!Xf(s))return s;s=hs(s)}return n}let r=ix(e,t);for(;r&&mD(r)&&Xf(r);)r=ix(r,t);return r&&as(r)&&Xf(r)&&!Pm(r)?n:r||xD(e)||n}const fF=async function(e){const t=this.getOffsetParent||$k,n=this.getDimensions,r=await n(e.floating);return{reference:dF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hF(e){return rn(e).direction==="rtl"}const pF={convertOffsetParentRelativeRectToViewportRelativeRect:nF,getDocumentElement:kr,getClippingRect:cF,getOffsetParent:$k,getElementRects:fF,getClientRects:rF,getDimensions:uF,getScale:qo,isElement:Ie,isRTL:hF};function Bk(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gF(e,t,n){let r=null,s;const o=kr(e);function i(){var d;clearTimeout(s),(d=r)==null||d.disconnect(),r=null}function l(d,u){d===void 0&&(d=!1),u===void 0&&(u=1),i();const f=e.getBoundingClientRect(),{left:h,top:g,width:x,height:b}=f;if(d||t(),!x||!b)return;const p=zo(g),y=zo(o.clientWidth-(h+x)),m=zo(o.clientHeight-(g+b)),w=zo(h),C={rootMargin:-p+"px "+-y+"px "+-m+"px "+-w+"px",threshold:fr(0,Ni(1,u))||1};let R=!0;function E(M){const _=M[0].intersectionRatio;if(!Bk(f,e.getBoundingClientRect()))return l();if(_!==u){if(!R)return l();_?l(!1,_):s=setTimeout(()=>{l(!1,1e-7)},1e3)}R=!1}try{r=new IntersectionObserver(E,{...C,root:o.ownerDocument})}catch{r=new IntersectionObserver(E,C)}r.observe(e)}const a=Ge(e),c=()=>l(n);return a.addEventListener("resize",c),l(!0),()=>{a.removeEventListener("resize",c),i()}}function lx(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=Dm(e),d=s||o?[...c?cs(c):[],...t?cs(t):[]]:[];d.forEach(p=>{s&&p.addEventListener("scroll",n),o&&p.addEventListener("resize",n)});const u=c&&l?gF(c,n,o):null;let f=-1,h=null;i&&(h=new ResizeObserver(p=>{let[y]=p;y&&y.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var m;(m=h)==null||m.observe(t)})),n()}),c&&!a&&h.observe(c),t&&h.observe(t));let g,x=a?uo(e):null;a&&b();function b(){const p=uo(e);x&&!Bk(x,p)&&n(),x=p,g=requestAnimationFrame(b)}return n(),()=>{var p;d.forEach(y=>{s&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),u==null||u(),(p=h)==null||p.disconnect(),h=null,a&&cancelAnimationFrame(g)}}const mF=X5,yF=G5,vF=q5,xF=J5,wF=Y5,bF=Z5,SF=(e,t,n)=>{const r=new Map,s=n??{},o={...pF,...s.platform,_c:r};return K5(e,t,{...s,platform:o})};var EF=typeof document<"u",kF=function(){},Xc=EF?S.useLayoutEffect:kF;function Yu(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(!Yu(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)&&!Yu(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Hk(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ax(e,t){const n=Hk(e);return Math.round(t*n)/n}function Gf(e){const t=S.useRef(e);return Xc(()=>{t.current=e}),t}function CF(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,[d,u]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=S.useState(r);Yu(f,r)||h(r);const[g,x]=S.useState(null),[b,p]=S.useState(null),y=S.useCallback(P=>{P!==C.current&&(C.current=P,x(P))},[]),m=S.useCallback(P=>{P!==R.current&&(R.current=P,p(P))},[]),w=o||g,k=i||b,C=S.useRef(null),R=S.useRef(null),E=S.useRef(d),M=a!=null,_=Gf(a),j=Gf(s),D=Gf(c),O=S.useCallback(()=>{if(!C.current||!R.current)return;const P={placement:t,strategy:n,middleware:f};j.current&&(P.platform=j.current),SF(C.current,R.current,P).then(I=>{const A={...I,isPositioned:D.current!==!1};N.current&&!Yu(E.current,A)&&(E.current=A,Wt.flushSync(()=>{u(A)}))})},[f,t,n,j,D]);Xc(()=>{c===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,u(P=>({...P,isPositioned:!1})))},[c]);const N=S.useRef(!1);Xc(()=>(N.current=!0,()=>{N.current=!1}),[]),Xc(()=>{if(w&&(C.current=w),k&&(R.current=k),w&&k){if(_.current)return _.current(w,k,O);O()}},[w,k,O,_,M]);const T=S.useMemo(()=>({reference:C,floating:R,setReference:y,setFloating:m}),[y,m]),z=S.useMemo(()=>({reference:w,floating:k}),[w,k]),F=S.useMemo(()=>{const P={position:n,left:0,top:0};if(!z.floating)return P;const I=ax(z.floating,d.x),A=ax(z.floating,d.y);return l?{...P,transform:"translate("+I+"px, "+A+"px)",...Hk(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:A}},[n,l,z.floating,d.x,d.y]);return S.useMemo(()=>({...d,update:O,refs:T,elements:z,floatingStyles:F}),[d,O,T,z,F])}const RF=(e,t)=>{const n=mF(e);return{name:n.name,fn:n.fn,options:[e,t]}},NF=(e,t)=>{const n=yF(e);return{name:n.name,fn:n.fn,options:[e,t]}},PF=(e,t)=>({fn:bF(e).fn,options:[e,t]}),TF=(e,t)=>{const n=vF(e);return{name:n.name,fn:n.fn,options:[e,t]}},MF=(e,t)=>{const n=xF(e);return{name:n.name,fn:n.fn,options:[e,t]}},IF=(e,t)=>{const n=wF(e);return{name:n.name,fn:n.fn,options:[e,t]}},_F={intentional:"onClick",sloppy:"onPointerDown"};function OF(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 Fm(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),s=n.useState("floatingElement"),o=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:l,dataRef:a}=n.context,{enabled:c=!0,escapeKey:d=!0,outsidePress:u=!0,outsidePressEvent:f="sloppy",referencePress:h=!1,referencePressEvent:g="sloppy",ancestorScroll:x=!1,bubbles:b,externalTree:p}=t,y=Wi(p),m=he(typeof u=="function"?u:()=>!1),w=typeof u=="function"?m:u,k=S.useRef(!1),{escapeKey:C,outsidePress:R}=OF(b),E=S.useRef(null),M=br(),_=br(),j=he(()=>{_.clear(),a.current.insideReactTree=!1}),D=S.useRef(!1),O=S.useRef(""),N=he(V=>{O.current=V.pointerType}),T=he(()=>{const V=O.current,Z=V==="pen"||!V?"mouse":V,Q=typeof f=="function"?f():f;return typeof Q=="string"?Q:Q[Z]}),z=he(V=>{var W;if(!r||!c||!d||V.key!=="Escape"||D.current)return;const Z=(W=a.current.floatingContext)==null?void 0:W.nodeId,Q=y?Xs(y.nodesRef.current,Z):[];if(!C&&Q.length>0){let J=!0;if(Q.forEach(se=>{var pe;(pe=se.context)!=null&&pe.open&&!se.context.dataRef.current.__escapeKeyBubbles&&(J=!1)}),!J)return}const ce=WD(V)?V.nativeEvent:V,re=Te(Ad,ce);n.setOpen(!1,re),!C&&!re.isPropagationAllowed&&V.stopPropagation()}),F=he(V=>{const Z=T();return Z==="intentional"&&V.type!=="click"||Z==="sloppy"&&V.type==="click"}),P=he(()=>{a.current.insideReactTree=!0,_.start(0,j)}),I=he((V,Z=!1)=>{var fe;if(F(V)){j();return}if(a.current.insideReactTree){j();return}if(T()==="intentional"&&Z||typeof w=="function"&&!w(V))return;const Q=Nt(V),ce=`[${Mi("inert")}]`,re=Ze(n.select("floatingElement")).querySelectorAll(ce),W=n.context.triggerElements;if(Q&&(W.hasElement(Q)||W.hasMatchingElement(ue=>Ee(ue,Q))))return;let J=Ie(Q)?Q:null;for(;J&&!as(J);){const ue=hs(J);if(as(ue)||!Ie(ue))break;J=ue}if(re.length&&Ie(Q)&&!HD(Q)&&!Ee(Q,n.select("floatingElement"))&&Array.from(re).every(ue=>!Ee(J,ue)))return;if(Xe(Q)&&!("touches"in V)){const ue=as(Q),Ne=rn(Q),be=/auto|scroll/,_e=ue||be.test(Ne.overflowX),ft=ue||be.test(Ne.overflowY),mt=_e&&Q.clientWidth>0&&Q.scrollWidth>Q.clientWidth,De=ft&&Q.clientHeight>0&&Q.scrollHeight>Q.clientHeight,lt=Ne.direction==="rtl",tt=De&&(lt?V.offsetX<=Q.offsetWidth-Q.clientWidth:V.offsetX>Q.clientWidth),ln=mt&&V.offsetY>Q.clientHeight;if(tt||ln)return}const se=(fe=a.current.floatingContext)==null?void 0:fe.nodeId,pe=y&&Xs(y.nodesRef.current,se).some(ue=>{var Ne;return vn(V,(Ne=ue.context)==null?void 0:Ne.elements.floating)});if(vn(V,n.select("floatingElement"))||vn(V,n.select("domReferenceElement"))||pe)return;const me=y?Xs(y.nodesRef.current,se):[];if(me.length>0){let ue=!0;if(me.forEach(Ne=>{var be;(be=Ne.context)!=null&&be.open&&!Ne.context.dataRef.current.__outsidePressBubbles&&(ue=!1)}),!ue)return}n.setOpen(!1,Te(sk,V)),j()}),A=he(V=>{T()!=="sloppy"||V.pointerType==="touch"||!n.select("open")||!c||vn(V,n.select("floatingElement"))||vn(V,n.select("domReferenceElement"))||I(V)}),B=he(V=>{if(T()!=="sloppy"||!n.select("open")||!c||vn(V,n.select("floatingElement"))||vn(V,n.select("domReferenceElement")))return;const Z=V.touches[0];Z&&(E.current={startTime:Date.now(),startX:Z.clientX,startY:Z.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},M.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}),$=he(V=>{const Z=Nt(V);function Q(){B(V),Z==null||Z.removeEventListener(V.type,Q)}Z==null||Z.addEventListener(V.type,Q)}),U=he(V=>{const Z=k.current;if(k.current=!1,M.clear(),V.type==="mousedown"&&E.current&&!E.current.dismissOnMouseDown)return;const Q=Nt(V);function ce(){V.type==="pointerdown"?A(V):I(V,Z),Q==null||Q.removeEventListener(V.type,ce)}Q==null||Q.addEventListener(V.type,ce)}),q=he(V=>{if(T()!=="sloppy"||!E.current||vn(V,n.select("floatingElement"))||vn(V,n.select("domReferenceElement")))return;const Z=V.touches[0];if(!Z)return;const Q=Math.abs(Z.clientX-E.current.startX),ce=Math.abs(Z.clientY-E.current.startY),re=Math.sqrt(Q*Q+ce*ce);re>5&&(E.current.dismissOnTouchEnd=!0),re>10&&(I(V),M.clear(),E.current=null)}),K=he(V=>{const Z=Nt(V);function Q(){q(V),Z==null||Z.removeEventListener(V.type,Q)}Z==null||Z.addEventListener(V.type,Q)}),X=he(V=>{T()!=="sloppy"||!E.current||vn(V,n.select("floatingElement"))||vn(V,n.select("domReferenceElement"))||(E.current.dismissOnTouchEnd&&I(V),M.clear(),E.current=null)}),G=he(V=>{const Z=Nt(V);function Q(){X(V),Z==null||Z.removeEventListener(V.type,Q)}Z==null||Z.addEventListener(V.type,Q)});S.useEffect(()=>{if(!r||!c)return;a.current.__escapeKeyBubbles=C,a.current.__outsidePressBubbles=R;const V=new wr;function Z(J){n.setOpen(!1,Te(sa,J))}function Q(){V.clear(),D.current=!0}function ce(){V.start(_d()?5:0,()=>{D.current=!1})}const re=Ze(s);re.addEventListener("pointerdown",N,!0),d&&(re.addEventListener("keydown",z),re.addEventListener("compositionstart",Q),re.addEventListener("compositionend",ce)),w&&(re.addEventListener("click",U,!0),re.addEventListener("pointerdown",U,!0),re.addEventListener("touchstart",$,!0),re.addEventListener("touchmove",K,!0),re.addEventListener("touchend",G,!0),re.addEventListener("mousedown",U,!0));let W=[];return x&&(Ie(i)&&(W=cs(i)),Ie(s)&&(W=W.concat(cs(s))),!Ie(o)&&o&&o.contextElement&&(W=W.concat(cs(o.contextElement)))),W=W.filter(J=>{var se;return J!==((se=re.defaultView)==null?void 0:se.visualViewport)}),W.forEach(J=>{J.addEventListener("scroll",Z,{passive:!0})}),()=>{re.removeEventListener("pointerdown",N,!0),d&&(re.removeEventListener("keydown",z),re.removeEventListener("compositionstart",Q),re.removeEventListener("compositionend",ce)),w&&(re.removeEventListener("click",U,!0),re.removeEventListener("pointerdown",U,!0),re.removeEventListener("touchstart",$,!0),re.removeEventListener("touchmove",K,!0),re.removeEventListener("touchend",G,!0),re.removeEventListener("mousedown",U,!0)),W.forEach(J=>{J.removeEventListener("scroll",Z)}),V.clear()}},[a,s,o,i,d,w,r,l,x,c,C,R,z,I,U,A,$,K,G,N,n]),S.useEffect(j,[w,j]);const H=S.useMemo(()=>({onKeyDown:z,...h&&{[_F[g]]:V=>{n.setOpen(!1,Te(Qn,V.nativeEvent))},...g!=="intentional"&&{onClick(V){n.setOpen(!1,Te(Qn,V.nativeEvent))}}}}),[z,n,h,g]),Y=he(V=>{const Z=Nt(V.nativeEvent);!Ee(n.select("floatingElement"),Z)||V.button!==0||(k.current=!0)}),te=S.useMemo(()=>({onKeyDown:z,onPointerDown:Y,onMouseDown:Y,onMouseUp:Y,onClickCapture:P,onMouseDownCapture:P,onPointerDownCapture:P,onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[z,Y,P]);return S.useMemo(()=>c?{reference:H,floating:te,trigger:H}:{},[c,H,te])}var Qu=Symbol("NOT_FOUND");function AF(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function jF(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var cx=e=>Array.isArray(e)?e:[e];function zF(e){const t=Array.isArray(e[0])?e[0]:e;return jF(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function LF(e,t){const n=[],{length:r}=e;for(let s=0;s<r;s++)n.push(e[s].apply(null,t));return n}function DF(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Qu},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function FF(e,t){let n=[];function r(l){const a=n.findIndex(c=>t(l,c.key));if(a>-1){const c=n[a];return a>0&&(n.splice(a,1),n.unshift(c)),c.value}return Qu}function s(l,a){r(l)===Qu&&(n.unshift({key:l,value:a}),n.length>e&&n.pop())}function o(){return n}function i(){n=[]}return{get:r,put:s,getEntries:o,clear:i}}var $F=(e,t)=>e===t;function BF(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:s}=n;for(let o=0;o<s;o++)if(!e(n[o],r[o]))return!1;return!0}}function HF(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=$F,maxSize:s=1,resultEqualityCheck:o}=n,i=BF(r);let l=0;const a=s<=1?DF(i):FF(s,i);function c(){let d=a.get(arguments);if(d===Qu){if(d=e.apply(null,arguments),l++,o){const f=a.getEntries().find(h=>o(h.value,d));f&&(d=f.value,l!==0&&l--)}a.put(arguments,d)}return d}return c.clearCache=()=>{a.clear(),c.resetResultsCount()},c.resultsCount=()=>l,c.resetResultsCount=()=>{l=0},c}var VF=class{constructor(e){this.value=e}deref(){return this.value}},WF=()=>typeof WeakRef>"u"?VF:WeakRef,Vk=WF(),UF=0,ux=1;function Cc(){return{s:UF,v:void 0,o:null,p:null}}function KF(e){return e instanceof Vk?e.deref():e}function qF(e,t={}){let n=Cc();const{resultEqualityCheck:r}=t;let s,o=0;function i(){let l=n;const{length:a}=arguments;for(let u=0,f=a;u<f;u++){const h=arguments[u];if(typeof h=="function"||typeof h=="object"&&h!==null){let g=l.o;g===null&&(l.o=g=new WeakMap);const x=g.get(h);x===void 0?(l=Cc(),g.set(h,l)):l=x}else{let g=l.p;g===null&&(l.p=g=new Map);const x=g.get(h);x===void 0?(l=Cc(),g.set(h,l)):l=x}}const c=l;let d;if(l.s===ux)d=l.v;else if(d=e.apply(null,arguments),o++,r){const u=KF(s);u!=null&&r(u,d)&&(d=u,o!==0&&o--),s=typeof d=="object"&&d!==null||typeof d=="function"?new Vk(d):d}return c.s=ux,c.v=d,d}return i.clearCache=()=>{n=Cc(),i.resetResultsCount()},i.resultsCount=()=>o,i.resetResultsCount=()=>{o=0},i}function YF(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...s)=>{let o=0,i=0,l,a={},c=s.pop();typeof c=="object"&&(a=c,c=s.pop()),AF(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const d={...n,...a},{memoize:u,memoizeOptions:f=[],argsMemoize:h=qF,argsMemoizeOptions:g=[]}=d,x=cx(f),b=cx(g),p=zF(s),y=u(function(){return o++,c.apply(null,arguments)},...x),m=h(function(){i++;const k=LF(p,arguments);return l=y.apply(null,k),l},...b);return Object.assign(m,{resultFunc:c,memoizedResultFunc:y,dependencies:p,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>l,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:u,argsMemoize:h})};return Object.assign(r,{withTypes:()=>r}),r}YF({memoize:HF,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const ve=(e,t,n,r,s,o,...i)=>{if(i.length>0)throw new Error(It(1));let l;if(e)l=e;else throw new Error("Missing arguments");return l},QF=Rm(19),XF=QF?ZF:JF;function GF(e,t,n,r,s){return XF(e,t,n,r,s)}function ZF(e,t,n,r,s){const o=S.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return lE.useSyncExternalStore(e.subscribe,o,o)}function JF(e,t,n,r,s){return aE.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,s))}class Tl{constructor(t){Re(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Re(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){Tl.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||Tl.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};Tl.prototype.setState.call(this,t)}}class Ld extends Tl{constructor(n,r={},s){super(n);Re(this,"controlledValues",new Map);Re(this,"select",(n,r,s,o)=>{const i=this.selectors[n];return i(this.state,r,s,o)});Re(this,"useState",(n,r,s,o)=>{S.useDebugValue(n);const i=this.selectors[n];return GF(this,i,r,s,o)});this.context=r,this.selectors=s}useSyncedValue(n,r){S.useDebugValue(n),ye(()=>{this.state[n]!==r&&this.set(n,r)},[n,r])}useSyncedValueWithCleanup(n,r){ye(()=>(this.state[n]!==r&&this.set(n,r),()=>{this.set(n,void 0)}),[n,r])}useSyncedValues(n){const r=Object.values(n);ye(()=>{this.update(n)},r)}useControlledProp(n,r,s){S.useDebugValue(n);const o=r!==void 0;this.controlledValues.has(n)||(this.controlledValues.set(n,o),!o&&!Object.is(this.state[n],s)&&super.setState({...this.state,[n]:s})),ye(()=>{o&&!Object.is(this.state[n],r)&&super.setState({...this.state,[n]:r})},[n,r,s,o])}set(n,r){this.controlledValues.get(n)!==!0&&super.set(n,r)}update(n){const r={...n};for(const s in r)if(Object.hasOwn(r,s)&&this.controlledValues.get(s)===!0){delete r[s];continue}super.update(r)}setState(n){const r={...n};for(const s in r)if(Object.hasOwn(r,s)&&this.controlledValues.get(s)===!0){delete r[s];continue}super.setState({...this.state,...r})}useContextCallback(n,r){S.useDebugValue(n);const s=he(r??GE);this.context[n]=s}useStateSetter(n){const r=S.useRef(void 0);return r.current===void 0&&(r.current=s=>{this.set(n,s)}),r.current}observe(n,r){let s;typeof n=="function"?s=n:s=this.selectors[n];let o=s(this.state);return r(o,o,this),this.subscribe(i=>{const l=s(i);if(!Object.is(o,l)){const a=o;o=l,r(l,a,this)}})}}const e$={open:ve(e=>e.open),domReferenceElement:ve(e=>e.domReferenceElement),referenceElement:ve(e=>e.positionReference??e.referenceElement),floatingElement:ve(e=>e.floatingElement),floatingId:ve(e=>e.floatingId)};class $m extends Ld{constructor(n){const{nested:r,noEmit:s,onOpenChange:o,triggerElements:i,...l}=n;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:Ck(),nested:r,noEmit:s,triggerElements:i},e$);Re(this,"setOpen",(n,r)=>{var s,o;if((!n||!this.state.open||fk(r.event))&&(this.context.dataRef.current.openEvent=n?r.event:void 0),!this.context.noEmit){const i={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",i)}(o=(s=this.context).onOpenChange)==null||o.call(s,n,r)})}}function t$(e,t=!1,n=!1){const[r,s]=S.useState(e&&t?"idle":void 0),[o,i]=S.useState(e);return e&&!o&&(i(!0),s("starting")),!e&&o&&r!=="ending"&&!n&&s("ending"),!e&&!o&&r==="ending"&&s(void 0),ye(()=>{if(!e&&o&&r!=="ending"&&n){const l=Vn.request(()=>{s("ending")});return()=>{Vn.cancel(l)}}},[e,o,r,n]),ye(()=>{if(!e||t)return;const l=Vn.request(()=>{Wt.flushSync(()=>{s(void 0)})});return()=>{Vn.cancel(l)}},[t,e]),ye(()=>{if(!e||!t)return;e&&o&&r!=="idle"&&s("starting");const l=Vn.request(()=>{s("idle")});return()=>{Vn.cancel(l)}},[t,e,o,s,r]),S.useMemo(()=>({mounted:o,setMounted:i,transitionStatus:r}),[o,r])}function Bm(e,t=!1,n=!0){const r=jd();return he((s,o=null)=>{r.cancel();const i=Ps(e);i!=null&&(typeof i.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?s():r.request(()=>{function l(){i&&Promise.all(i.getAnimations().map(a=>a.finished)).then(()=>{o!=null&&o.aborted||Wt.flushSync(s)}).catch(()=>{if(n){if(o!=null&&o.aborted)return;Wt.flushSync(s)}else i.getAnimations().length>0&&i.getAnimations().some(a=>a.pending||a.playState!=="finished")&&l()})}t?r.request(l):l()}))})}function Dd(e){const{enabled:t=!0,open:n,ref:r,onComplete:s}=e,o=Nn(n),i=he(s),l=Bm(r,n);S.useEffect(()=>{t&&l(()=>{n===o.current&&i()})},[t,n,i,l,o])}function n$(e,t){const n=S.useRef(null);return S.useCallback(r=>{if(e!==void 0&&(n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null),r!==null))return n.current=e,t.context.triggerElements.add(e,r),()=>{n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null)}},[t,e])}function Wk(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=n$(e,n),i=he(l=>{const a=o(l);return l!==null&&n.select("open")&&n.select("activeTriggerId")==null&&n.update({activeTriggerId:e,activeTriggerElement:l,...r}),a});return ye(()=>{s&&n.update({activeTriggerElement:t.current,...r})},[s,n,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:s}}function Hm(e){const t=e.useState("open");ye(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,s]=n.value;e.update({activeTriggerId:r,activeTriggerElement:s})}}},[t,e])}function Vm(e,t,n){const{mounted:r,setMounted:s,transitionStatus:o}=t$(e);t.useSyncedValues({mounted:r,transitionStatus:o});const i=he(()=>{var a,c;s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n==null||n(),(c=(a=t.context).onOpenChangeComplete)==null||c.call(a,!1)}),l=t.useState("preventUnmountingOnClose");return Dd({enabled:!l,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:o}}class Ta{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elements.delete(r),this.elements.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function r$(){return new $m({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Ta,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Wm(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:r$(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:St,inactiveTriggerProps:St,popupProps:St}}const Um={open:ve(e=>e.open),mounted:ve(e=>e.mounted),transitionStatus:ve(e=>e.transitionStatus),floatingRootContext:ve(e=>e.floatingRootContext),preventUnmountingOnClose:ve(e=>e.preventUnmountingOnClose),payload:ve(e=>e.payload),activeTriggerId:ve(e=>e.activeTriggerId),activeTriggerElement:ve(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:ve((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:ve((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:ve((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:ve((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:ve(e=>e.popupProps),popupElement:ve(e=>e.popupElement),positionerElement:ve(e=>e.positionerElement)};function s$(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,s=$i(),o=yo()!=null,i=Ut(()=>new $m({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new Ta,floatingId:s,nested:o,noEmit:e.noEmit||!1})).current;return ye(()=>{const l={open:t,floatingId:s};r.reference!==void 0&&(l.referenceElement=r.reference,l.domReferenceElement=Ie(r.reference)?r.reference:null),r.floating!==void 0&&(l.floatingElement=r.floating),i.update(l)},[t,s,r.reference,r.floating,i]),i.context.onOpenChange=n,i.context.nested=o,i.context.noEmit=e.noEmit||!1,i}function o$(e={}){const{nodeId:t,externalTree:n}=e,r=s$(e),s=e.rootContext||r,o={reference:s.useState("referenceElement"),floating:s.useState("floatingElement"),domReference:s.useState("domReferenceElement")},[i,l]=S.useState(null),a=S.useRef(null),c=Wi(n);ye(()=>{o.domReference&&(a.current=o.domReference)},[o.domReference]);const d=CF({...e,elements:{...o,...i&&{reference:i}}}),u=S.useCallback(R=>{const E=Ie(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;l(E),d.refs.setReference(E)},[d.refs]),[f,h]=S.useState(null),[g,x]=S.useState(null);s.useSyncedValue("referenceElement",f),s.useSyncedValue("domReferenceElement",Ie(f)?f:null),s.useSyncedValue("floatingElement",g);const b=S.useCallback(R=>{(Ie(R)||R===null)&&(a.current=R,h(R)),(Ie(d.refs.reference.current)||d.refs.reference.current===null||R!==null&&!Ie(R))&&d.refs.setReference(R)},[d.refs,h]),p=S.useCallback(R=>{x(R),d.refs.setFloating(R)},[d.refs]),y=S.useMemo(()=>({...d.refs,setReference:b,setFloating:p,setPositionReference:u,domReference:a}),[d.refs,b,p,u]),m=S.useMemo(()=>({...d.elements,domReference:o.domReference}),[d.elements,o.domReference]),w=s.useState("open"),k=s.useState("floatingId"),C=S.useMemo(()=>({...d,dataRef:s.context.dataRef,open:w,onOpenChange:s.setOpen,events:s.context.events,floatingId:k,refs:y,elements:m,nodeId:t,rootStore:s}),[d,y,m,t,s,w,k]);return ye(()=>{s.context.dataRef.current.floatingContext=C;const R=c==null?void 0:c.nodesRef.current.find(E=>E.id===t);R&&(R.context=C)}),S.useMemo(()=>({...d,context:C,refs:y,elements:m,rootStore:s}),[d,y,m,C,s])}function Km(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:s}=e,o=$i(),i=yo()!=null,l=t.useState("open"),a=t.useState("activeTriggerElement"),c=t.useState(r?"popupElement":"positionerElement"),d=t.context.triggerElements,u=Ut(()=>new $m({open:l,referenceElement:a,floatingElement:c,triggerElements:d,onOpenChange:s,floatingId:o,nested:i,noEmit:n})).current;return ye(()=>{const f={open:l,floatingId:o,referenceElement:a,floatingElement:c};Ie(a)&&(f.domReferenceElement=a),u.update(f)},[l,o,a,c,u]),u.context.onOpenChange=s,u.context.nested=i,u.context.noEmit=n,u}const Zf=zD&&lk;function i$(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:r,dataRef:s}=n.context,{enabled:o=!0,visibleOnly:i=!0}=t,l=S.useRef(!1),a=br(),c=S.useRef(!0);S.useEffect(()=>{const u=n.select("domReferenceElement");if(!o)return;const f=Ge(u);function h(){!n.select("open")&&Xe(u)&&u===ir(Ze(u))&&(l.current=!0)}function g(){c.current=!0}function x(){c.current=!1}return f.addEventListener("blur",h),Zf&&(f.addEventListener("keydown",g,!0),f.addEventListener("pointerdown",x,!0)),()=>{f.removeEventListener("blur",h),Zf&&(f.removeEventListener("keydown",g,!0),f.removeEventListener("pointerdown",x,!0))}},[n,o]),S.useEffect(()=>{if(!o)return;function u(f){(f.reason===Qn||f.reason===Ad)&&(l.current=!0)}return r.on("openchange",u),()=>{r.off("openchange",u)}},[r,o]);const d=S.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(u){if(l.current)return;const f=Nt(u.nativeEvent);if(i&&Ie(f)){if(Zf&&!u.relatedTarget){if(!c.current&&!_m(f))return}else if(!VD(f))return}n.setOpen(!0,Te($p,u.nativeEvent,u.currentTarget))},onBlur(u){l.current=!1;const f=u.relatedTarget,h=u.nativeEvent,g=Ie(f)&&f.hasAttribute(Mi("focus-guard"))&&f.getAttribute("data-type")==="outside";a.start(0,()=>{var p;const x=n.select("domReferenceElement"),b=ir(x?x.ownerDocument:document);!f&&b===x||Ee((p=s.current.floatingContext)==null?void 0:p.refs.floating.current,b)||Ee(x,b)||g||n.context.triggerElements.hasElement(u.relatedTarget)||n.setOpen(!1,Te($p,h))})}}),[s,n,i,a]);return S.useMemo(()=>o?{reference:d,trigger:d}:{},[o,d])}const qp=Mi("safe-polygon"),l$=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${dk}`;function a$(e){return e?!!e.closest(l$):!1}function Uk(e){const t=S.useRef(void 0),n=S.useRef(!1),r=S.useRef(void 0),s=S.useRef(!0),o=S.useRef(!1),i=S.useRef(()=>{}),l=S.useRef(!1),a=br(),c=br(),d=S.useRef(void 0);return S.useMemo(()=>{const u=e.context.dataRef.current;return u.hoverInteractionState||(u.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:r,blockMouseMoveRef:s,performedPointerEventsMutationRef:o,unbindMouseMoveRef:i,restTimeoutPendingRef:l,openChangeTimeout:a,restTimeout:c,handleCloseOptionsRef:d}),u.hoverInteractionState},[e,t,n,r,s,o,i,l,a,c,d])}const c$=new Set(["click","mousedown"]);function Kk(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),s=n.useState("floatingElement"),o=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:l=!0,closeDelay:a=0,externalTree:c}=t,{pointerTypeRef:d,interactedInsideRef:u,handlerRef:f,performedPointerEventsMutationRef:h,unbindMouseMoveRef:g,restTimeoutPendingRef:x,openChangeTimeout:b,handleCloseOptionsRef:p}=Uk(n),y=Wi(c),m=yo(),w=he(()=>u.current?!0:i.current.openEvent?c$.has(i.current.openEvent.type):!1),k=he(()=>{var j;const _=(j=i.current.openEvent)==null?void 0:j.type;return(_==null?void 0:_.includes("mouse"))&&_!=="mousedown"}),C=S.useCallback((_,j=!0)=>{const D=u$(a,d.current);D&&!f.current?b.start(D,()=>n.setOpen(!1,Te(Dt,_))):j&&(b.clear(),n.setOpen(!1,Te(Dt,_)))},[a,f,n,d,b]),R=he(()=>{g.current(),f.current=void 0}),E=he(()=>{if(h.current){const _=Ze(s).body;_.style.pointerEvents="",_.removeAttribute(qp),h.current=!1}}),M=he(_=>{const j=Nt(_);if(!a$(j)){u.current=!1;return}u.current=!0});ye(()=>{r||(d.current=void 0,x.current=!1,u.current=!1,R(),E())},[r,d,x,u,R,E]),S.useEffect(()=>()=>{R()},[R]),S.useEffect(()=>E,[E]),ye(()=>{var _,j,D;if(l&&r&&(_=p.current)!=null&&_.blockPointerEvents&&k()&&Ie(o)&&s){h.current=!0;const O=Ze(s).body;O.setAttribute(qp,"");const N=o,T=s,z=(D=(j=y==null?void 0:y.nodesRef.current.find(F=>F.id===m))==null?void 0:j.context)==null?void 0:D.elements.floating;return z&&(z.style.pointerEvents=""),O.style.pointerEvents="none",N.style.pointerEvents="auto",T.style.pointerEvents="auto",()=>{O.style.pointerEvents="",N.style.pointerEvents="",T.style.pointerEvents=""}}},[l,r,o,s,p,k,y,m,h]),S.useEffect(()=>{if(!l)return;function _(N){if(w()||!i.current.floatingContext)return;const T=n.context.triggerElements;N.relatedTarget&&T.hasElement(N.relatedTarget)||(E(),R(),w()||C(N))}function j(N){var T;b.clear(),E(),(T=f.current)==null||T.call(f,N),R()}function D(N){w()||C(N,!1)}const O=s;return O&&(O.addEventListener("mouseleave",_),O.addEventListener("mouseenter",j),O.addEventListener("mouseleave",D),O.addEventListener("pointerdown",M,!0)),()=>{O&&(O.removeEventListener("mouseleave",_),O.removeEventListener("mouseenter",j),O.removeEventListener("mouseleave",D),O.removeEventListener("pointerdown",M,!0))}})}function u$(e,t){return t&&!co(t)?0:typeof e=="function"?e():e}function Jf(e){return typeof e=="function"?e():e}const d$={current:null};function qk(e,t={}){var F;const n="rootStore"in e?e.rootStore:e,{dataRef:r,events:s}=n.context,{enabled:o=!0,delay:i=0,handleClose:l=null,mouseOnly:a=!1,restMs:c=0,move:d=!0,triggerElementRef:u=d$,externalTree:f,isActiveTrigger:h=!0}=t,g=Wi(f),{pointerTypeRef:x,interactedInsideRef:b,handlerRef:p,blockMouseMoveRef:y,performedPointerEventsMutationRef:m,unbindMouseMoveRef:w,restTimeoutPendingRef:k,openChangeTimeout:C,restTimeout:R,handleCloseOptionsRef:E}=Uk(n),M=Nn(l),_=Nn(i),j=Nn(c);h&&(E.current=(F=M.current)==null?void 0:F.__options);const D=he(()=>b.current?!0:r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1),O=S.useCallback((P,I=!0)=>{const A=Qc(_.current,"close",x.current);A&&!p.current?C.start(A,()=>n.setOpen(!1,Te(Dt,P))):I&&(C.clear(),n.setOpen(!1,Te(Dt,P)))},[_,p,n,x,C]),N=he(()=>{w.current(),p.current=void 0}),T=he(()=>{if(m.current){const P=Ze(n.select("domReferenceElement")).body;P.style.pointerEvents="",P.removeAttribute(qp),m.current=!1}});S.useEffect(()=>{if(!o)return;function P(I){I.open||(C.clear(),R.clear(),y.current=!0,k.current=!1)}return s.on("openchange",P),()=>{s.off("openchange",P)}},[o,s,C,R,y,k]);const z=he(P=>{var A;if(D()||!r.current.floatingContext)return;const I=n.context.triggerElements;P.relatedTarget&&I.hasElement(P.relatedTarget)||(A=M.current)==null||A.call(M,{...r.current.floatingContext,tree:g,x:P.clientX,y:P.clientY,onClose(){T(),N(),D()||O(P)}})(P)});return S.useEffect(()=>{if(!o)return;const P=u.current??(h?n.select("domReferenceElement"):null);if(!Ie(P))return;function I($){if(C.clear(),y.current=!1,a&&!co(x.current)||Jf(j.current)>0&&!Qc(_.current,"open"))return;const U=Qc(_.current,"open",x.current),q=n.select("domReferenceElement"),K=n.context.triggerElements,X=(K.hasElement($.target)||K.hasMatchingElement(H=>Ee(H,$.target)))&&(!q||!Ee(q,$.target)),G=$.currentTarget??null;U?C.start(U,()=>{n.select("open")||n.setOpen(!0,Te(Dt,$,G))}):(!n.select("open")||X)&&n.setOpen(!0,Te(Dt,$,G))}function A($){if(D()){T();return}w.current();const U=n.select("domReferenceElement"),q=Ze(U);R.clear(),k.current=!1;const K=n.context.triggerElements;if($.relatedTarget&&K.hasElement($.relatedTarget))return;if(M.current&&r.current.floatingContext){n.select("open")||C.clear(),p.current=M.current({...r.current.floatingContext,tree:g,x:$.clientX,y:$.clientY,onClose(){T(),N(),D()||O($,!0)}});const G=p.current;G($),q.addEventListener("mousemove",G),w.current=()=>{q.removeEventListener("mousemove",G)};return}(x.current==="touch"?!Ee(n.select("floatingElement"),$.relatedTarget):!0)&&O($)}function B($){z($)}return n.select("open")&&P.addEventListener("mouseleave",B),d&&P.addEventListener("mousemove",I,{once:!0}),P.addEventListener("mouseenter",I),P.addEventListener("mouseleave",A),()=>{P.removeEventListener("mouseleave",B),d&&P.removeEventListener("mousemove",I),P.removeEventListener("mouseenter",I),P.removeEventListener("mouseleave",A)}},[N,T,y,r,_,O,n,o,M,z,h,D,a,d,x,j,R,k,C,u,g,w,p]),S.useMemo(()=>{function P(I){x.current=I.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(I){const{nativeEvent:A}=I,B=I.currentTarget,$=n.select("domReferenceElement"),U=n.context.triggerElements,q=n.select("open"),K=(U.hasElement(I.target)||U.hasMatchingElement(G=>Ee(G,I.target)))&&(!$||!Ee($,I.target));if(a&&!co(x.current)||q&&!K||Jf(j.current)===0||!K&&k.current&&I.movementX**2+I.movementY**2<2)return;R.clear();function X(){!y.current&&(!q||K)&&n.setOpen(!0,Te(Dt,A,B))}x.current==="touch"?Wt.flushSync(()=>{X()}):K&&q?X():(k.current=!0,R.start(Jf(j.current),X))}}},[y,a,n,x,j,R,k])}function Fd(e=[]){const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),s=e.map(c=>c==null?void 0:c.trigger),o=S.useCallback(c=>Rc(c,e,"reference"),t),i=S.useCallback(c=>Rc(c,e,"floating"),n),l=S.useCallback(c=>Rc(c,e,"item"),r),a=S.useCallback(c=>Rc(c,e,"trigger"),s);return S.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l,getTriggerProps:a}),[o,i,l,a])}function Rc(e,t,n){var i;const r=new Map,s=n==="item",o={};n==="floating"&&(o.tabIndex=-1,o[Hp]="");for(const l in e)s&&e&&(l===ck||l===uk)||(o[l]=e[l]);for(let l=0;l<t.length;l+=1){let a;const c=(i=t[l])==null?void 0:i[n];typeof c=="function"?a=e?c(e):null:a=c,a&&dx(o,a,s,r)}return dx(o,e,s,r),o}function dx(e,t,n,r){var s;for(const o in t){const i=t[o];n&&(o===ck||o===uk)||(o.startsWith("on")?(r.has(o)||r.set(o,[]),typeof i=="function"&&((s=r.get(o))==null||s.push(i),e[o]=(...l)=>{var a;return(a=r.get(o))==null?void 0:a.map(c=>c(...l)).find(c=>c!==void 0)})):e[o]=i)}}const f$=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Yk(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),s=n.useState("floatingId"),o=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{enabled:l=!0,role:a="dialog"}=t,c=$i(),d=(o==null?void 0:o.id)||c,u=S.useMemo(()=>{var m;return((m=Vp(i))==null?void 0:m.id)||s},[i,s]),f=f$.get(a)??a,g=yo()!=null,x=S.useMemo(()=>f==="tooltip"||a==="label"?St:{"aria-haspopup":f==="alertdialog"?"dialog":f,"aria-expanded":"false",...f==="listbox"&&{role:"combobox"},...f==="menu"&&g&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[f,g,a]),b=S.useMemo(()=>f==="tooltip"||a==="label"?{[`aria-${a==="label"?"labelledby":"describedby"}`]:r?u:void 0}:{...x,"aria-expanded":r?"true":"false","aria-controls":r?u:void 0,...f==="menu"&&{id:d}},[f,u,r,d,a,x]),p=S.useMemo(()=>{const m={id:u,...f&&{role:f}};return f==="tooltip"||a==="label"?m:{...m,...f==="menu"&&{"aria-labelledby":d}}},[f,u,d,a]),y=S.useCallback(({active:m,selected:w})=>{const k={role:"option",...m&&{id:`${u}-fui-option`}};switch(a){case"select":case"combobox":return{...k,"aria-selected":w}}return{}},[u,a]);return S.useMemo(()=>l?{reference:b,floating:p,item:y,trigger:x}:{},[l,b,p,x,y])}function fx(e,t){const[n,r]=e;let s=!1;const o=t.length;for(let i=0,l=o-1;i<o;l=i++){const[a,c]=t[i]||[0,0],[d,u]=t[l]||[0,0];c>=r!=u>=r&&n<=(d-a)*(r-c)/(u-c)+a&&(s=!s)}return s}function h$(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Qk(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,s=new wr;let o=!1,i=null,l=null,a=typeof performance<"u"?performance.now():0;function c(u,f){const h=performance.now(),g=h-a;if(i===null||l===null||g===0)return i=u,l=f,a=h,null;const x=u-i,b=f-l,y=Math.sqrt(x*x+b*b)/g;return i=u,l=f,a=h,y}const d=({x:u,y:f,placement:h,elements:g,onClose:x,nodeId:b,tree:p})=>function(m){function w(){s.clear(),x()}if(s.clear(),!g.domReference||!g.floating||h==null||u==null||f==null)return;const{clientX:k,clientY:C}=m,R=[k,C],E=Nt(m),M=m.type==="mouseleave",_=Ee(g.floating,E),j=Ee(g.domReference,E),D=g.domReference.getBoundingClientRect(),O=g.floating.getBoundingClientRect(),N=h.split("-")[0],T=u>O.right-O.width/2,z=f>O.bottom-O.height/2,F=h$(R,D),P=O.width>D.width,I=O.height>D.height,A=(P?D:O).left,B=(P?D:O).right,$=(I?D:O).top,U=(I?D:O).bottom;if(_&&(o=!0,!M))return;if(j&&(o=!1),j&&!M){o=!0;return}if(M&&Ie(m.relatedTarget)&&Ee(g.floating,m.relatedTarget)||p&&Xs(p.nodesRef.current,b).some(({context:X})=>X==null?void 0:X.open))return;if(N==="top"&&f>=D.bottom-1||N==="bottom"&&f<=D.top+1||N==="left"&&u>=D.right-1||N==="right"&&u<=D.left+1)return w();let q=[];switch(N){case"top":q=[[A,D.top+1],[A,O.bottom-1],[B,O.bottom-1],[B,D.top+1]];break;case"bottom":q=[[A,O.top+1],[A,D.bottom-1],[B,D.bottom-1],[B,O.top+1]];break;case"left":q=[[O.right-1,U],[O.right-1,$],[D.left+1,$],[D.left+1,U]];break;case"right":q=[[D.right-1,U],[D.right-1,$],[O.left+1,$],[O.left+1,U]];break}function K([X,G]){switch(N){case"top":{const H=[P?X+t/2:T?X+t*4:X-t*4,G+t+1],Y=[P?X-t/2:T?X+t*4:X-t*4,G+t+1],te=[[O.left,T||P?O.bottom-t:O.top],[O.right,T?P?O.bottom-t:O.top:O.bottom-t]];return[H,Y,...te]}case"bottom":{const H=[P?X+t/2:T?X+t*4:X-t*4,G-t],Y=[P?X-t/2:T?X+t*4:X-t*4,G-t],te=[[O.left,T||P?O.top+t:O.bottom],[O.right,T?P?O.top+t:O.bottom:O.top+t]];return[H,Y,...te]}case"left":{const H=[X+t+1,I?G+t/2:z?G+t*4:G-t*4],Y=[X+t+1,I?G-t/2:z?G+t*4:G-t*4];return[...[[z||I?O.right-t:O.left,O.top],[z?I?O.right-t:O.left:O.right-t,O.bottom]],H,Y]}case"right":{const H=[X-t,I?G+t/2:z?G+t*4:G-t*4],Y=[X-t,I?G-t/2:z?G+t*4:G-t*4],te=[[z||I?O.left+t:O.right,O.top],[z?I?O.left+t:O.right:O.left+t,O.bottom]];return[H,Y,...te]}default:return[]}}if(!fx([k,C],q)){if(o&&!F)return w();if(!M&&r){const X=c(m.clientX,m.clientY);if(X!==null&&X<.1)return w()}fx([k,C],K([u,f]))?!o&&r&&s.start(40,w):w()}};return d.__options={blockPointerEvents:n},d}let p$=function(e){return e.nestedDialogs="--nested-dialogs",e}({}),g$=function(e){return e[e.open=As.open]="open",e[e.closed=As.closed]="closed",e[e.startingStyle=As.startingStyle]="startingStyle",e[e.endingStyle=As.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e}({});const Xk=S.createContext(void 0);function m$(){const e=S.useContext(Xk);if(e===void 0)throw new Error(It(26));return e}const Yo="ArrowUp",js="ArrowDown",ia="ArrowLeft",Qo="ArrowRight",Ma="Home",Ia="End",Gk=new Set([ia,Qo]),y$=new Set([ia,Qo,Ma,Ia]),Zk=new Set([Yo,js]),v$=new Set([Yo,js,Ma,Ia]),Jk=new Set([...Gk,...Zk]),x$=new Set([...Jk,Ma,Ia]),eC=new Set([Yo,js,ia,Qo,Ma,Ia]),w$="Shift",b$="Control",S$="Alt",E$="Meta",k$=new Set([w$,b$,S$,E$]);function C$(e){return Xe(e)&&e.tagName==="INPUT"}function hx(e){return!!(C$(e)&&e.selectionStart!=null||Xe(e)&&e.tagName==="TEXTAREA")}function px(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=gx(e,t,"left"),c=Nc(e),d=Nc(t);n==="ltr"&&(a+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-c.scrollPaddingRight?s=a+t.offsetWidth+d.scrollMarginRight-e.clientWidth+c.scrollPaddingRight:a-d.scrollMarginLeft<e.scrollLeft+c.scrollPaddingLeft&&(s=a-d.scrollMarginLeft-c.scrollPaddingLeft)),n==="rtl"&&(a-d.scrollMarginRight<e.scrollLeft+c.scrollPaddingLeft?s=a-d.scrollMarginLeft-c.scrollPaddingLeft:a+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-c.scrollPaddingRight&&(s=a+t.offsetWidth+d.scrollMarginRight-e.clientWidth+c.scrollPaddingRight))}if(l&&r!=="horizontal"){const a=gx(e,t,"top"),c=Nc(e),d=Nc(t);a-d.scrollMarginTop<e.scrollTop+c.scrollPaddingTop?o=a-d.scrollMarginTop-c.scrollPaddingTop:a+t.offsetHeight+d.scrollMarginBottom>e.scrollTop+e.clientHeight-c.scrollPaddingBottom&&(o=a+t.offsetHeight+d.scrollMarginBottom-e.clientHeight+c.scrollPaddingBottom)}e.scrollTo({left:s,top:o,behavior:"auto"})}function gx(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 Nc(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 R$={...Di,...Td,nestedDialogOpen(e){return e?{[g$.nestedDialogOpen]:""}:null}},N$=S.forwardRef(function(t,n){const{className:r,finalFocus:s,initialFocus:o,render:i,...l}=t,{store:a}=mo(),c=a.useState("descriptionElementId"),d=a.useState("disablePointerDismissal"),u=a.useState("floatingRootContext"),f=a.useState("popupProps"),h=a.useState("modal"),g=a.useState("mounted"),x=a.useState("nested"),b=a.useState("nestedOpenDialogCount"),p=a.useState("open"),y=a.useState("openMethod"),m=a.useState("titleElementId"),w=a.useState("transitionStatus"),k=a.useState("role");m$(),Dd({open:p,ref:a.context.popupRef,onComplete(){var j,D;p&&((D=(j=a.context).onOpenChangeComplete)==null||D.call(j,!0))}});function C(j){return j==="touch"?a.context.popupRef.current:!0}const R=o===void 0?C:o,E=b>0,M=S.useMemo(()=>({open:p,nested:x,transitionStatus:w,nestedDialogOpen:E}),[p,x,w,E]),_=kt("div",t,{state:M,props:[f,{"aria-labelledby":m??void 0,"aria-describedby":c??void 0,role:k,tabIndex:-1,hidden:!g,onKeyDown(j){eC.has(j.key)&&j.stopPropagation()},style:{[p$.nestedDialogs]:b}},l],ref:[n,a.context.popupRef,a.useStateSetter("popupElement")],stateAttributesMapping:R$});return v.jsx(jk,{context:u,openInteractionType:y,disabled:!g,closeOnFocusOut:!d,initialFocus:R,returnFocus:s,modal:h!==!1,restoreFocus:"popup",children:_})});function tC(e){return Rm(19)?e:e?"true":void 0}const nC=S.forwardRef(function(t,n){const{cutout:r,...s}=t;let o;if(r){const i=r==null?void 0:r.getBoundingClientRect();o=`polygon(
|
|
66
|
+
0% 0%,
|
|
67
|
+
100% 0%,
|
|
68
|
+
100% 100%,
|
|
69
|
+
0% 100%,
|
|
70
|
+
0% 0%,
|
|
71
|
+
${i.left}px ${i.top}px,
|
|
72
|
+
${i.left}px ${i.bottom}px,
|
|
73
|
+
${i.right}px ${i.bottom}px,
|
|
74
|
+
${i.right}px ${i.top}px,
|
|
75
|
+
${i.left}px ${i.top}px
|
|
76
|
+
)`}return v.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})}),P$=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,{store:o}=mo(),i=o.useState("mounted"),l=o.useState("modal");return i||r?v.jsx(Xk.Provider,{value:r,children:v.jsxs(Ak,{ref:n,...s,children:[i&&l===!0&&v.jsx(nC,{ref:o.context.internalBackdropRef,inert:tC(!open)}),t.children]})}):null});let mx={},yx={},vx="";function T$(e){if(typeof document>"u")return!1;const t=ps(e);return Ge(t).innerWidth-t.documentElement.clientWidth>0}function M$(e){const t=ps(e),n=t.documentElement,r=t.body,s=Fi(n)?n:r,o=s.style.overflow;return s.style.overflow="hidden",()=>{s.style.overflow=o}}function I$(e){var f,h;const t=ps(e),n=t.documentElement,r=t.body,s=Ge(n);let o=0,i=0;const l=Vn.create(),a=typeof CSS<"u"&&((f=CSS.supports)==null?void 0:f.call(CSS,"scrollbar-gutter","stable"));if(AD&&(((h=s.visualViewport)==null?void 0:h.scale)??1)!==1)return()=>{};function c(){const g=s.getComputedStyle(n),x=s.getComputedStyle(r),y=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,mx={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},vx=n.style.scrollBehavior,yx={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 m=n.scrollHeight>n.clientHeight,w=n.scrollWidth>n.clientWidth,k=g.overflowY==="scroll"||x.overflowY==="scroll",C=g.overflowX==="scroll"||x.overflowX==="scroll",R=Math.max(0,s.innerWidth-n.clientWidth),E=Math.max(0,s.innerHeight-n.clientHeight),M=parseFloat(x.marginTop)+parseFloat(x.marginBottom),_=parseFloat(x.marginLeft)+parseFloat(x.marginRight),j=Fi(n)?n:r;if(a){n.style.scrollbarGutter=y,j.style.overflowY="hidden",j.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:y,overflowY:"hidden",overflowX:"hidden"}),(m||k)&&(n.style.overflowY="scroll"),(w||C)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:M||E?`calc(100dvh - ${M+E}px)`:"100dvh",width:_||R?`calc(100vw - ${_+R}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,mx),Object.assign(r.style,yx),a||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=vx)}function u(){d(),l.request(c)}return c(),s.addEventListener("resize",u),()=>{l.cancel(),d(),typeof s.removeEventListener=="function"&&s.removeEventListener("resize",u)}}class _${constructor(){Re(this,"lockCount",0);Re(this,"restore",null);Re(this,"timeoutLock",wr.create());Re(this,"timeoutUnlock",wr.create());Re(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Re(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 r=ps(t).documentElement,s=Ge(r).getComputedStyle(r).overflowY;if(s==="hidden"||s==="clip"){this.restore=GE;return}const o=jD||!T$(t);this.restore=o?M$(t):I$(t)}}const O$=new _$;function rC(e=!0,t=null){ye(()=>{if(e)return O$.acquire(t)},[e,t])}function A$(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 sC(e){const[t,n]=S.useState(null),r=he((l,a)=>{e||n(a)}),s=S.useCallback(()=>{n(null)},[]),{onClick:o,onPointerDown:i}=A$(r);return S.useMemo(()=>({openMethod:t,reset:s,triggerProps:{onClick:o,onPointerDown:i}}),[t,s,o,i])}function j$(e){const{store:t,parentContext:n,actionsRef:r}=e,s=t.useState("open"),o=t.useState("disablePointerDismissal"),i=t.useState("modal"),l=t.useState("popupElement"),{openMethod:a,triggerProps:c,reset:d}=sC(s);Hm(t);const{forceUnmount:u}=Vm(s,t,()=>{d()}),f=he(_=>{const j=Te(_);return j.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},j}),h=S.useCallback(()=>{t.setOpen(!1,f(Mm))},[t,f]);S.useImperativeHandle(r,()=>({unmount:u,close:h}),[u,h]);const g=Km({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[x,b]=S.useState(0),p=x===0,y=Yk(g),m=Fm(g,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(_){if("button"in _&&_.button!==0||"touches"in _&&_.touches.length!==1)return!1;const j=Nt(_);if(p&&!o){const D=j;return i&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===D||t.context.backdropRef.current===D||Ee(D,l)&&!(D!=null&&D.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:p});rC(s&&i===!0,l);const{getReferenceProps:w,getFloatingProps:k,getTriggerProps:C}=Fd([y,m]);t.useContextCallback("onNestedDialogOpen",_=>{b(_+1)}),t.useContextCallback("onNestedDialogClose",()=>{b(0)}),S.useEffect(()=>(n!=null&&n.onNestedDialogOpen&&s&&n.onNestedDialogOpen(x),n!=null&&n.onNestedDialogClose&&!s&&n.onNestedDialogClose(),()=>{n!=null&&n.onNestedDialogClose&&s&&n.onNestedDialogClose()}),[s,n,x]);const R=S.useMemo(()=>w(c),[w,c]),E=S.useMemo(()=>C(c),[C,c]),M=S.useMemo(()=>k(),[k]);t.useSyncedValues({openMethod:a,activeTriggerProps:R,inactiveTriggerProps:E,popupProps:M,floatingRootContext:g,nestedOpenDialogCount:x})}const z$={...Um,modal:ve(e=>e.modal),nested:ve(e=>e.nested),nestedOpenDialogCount:ve(e=>e.nestedOpenDialogCount),disablePointerDismissal:ve(e=>e.disablePointerDismissal),openMethod:ve(e=>e.openMethod),descriptionElementId:ve(e=>e.descriptionElementId),titleElementId:ve(e=>e.titleElementId),viewportElement:ve(e=>e.viewportElement),role:ve(e=>e.role)};class L$ extends Ld{constructor(n){super(D$(n),{popupRef:S.createRef(),backdropRef:S.createRef(),internalBackdropRef:S.createRef(),triggerElements:new Ta,onOpenChange:void 0,onOpenChangeComplete:void 0},z$);Re(this,"setOpen",(n,r)=>{var l,a,c,d;if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(a=(l=this.context).onOpenChange)==null||a.call(l,n,r),r.isCanceled)return;const s={open:n,nativeEvent:r.event,reason:r.reason,nested:this.state.nested};(c=this.state.floatingRootContext.context.events)==null||c.emit("openchange",s);const o={open:n},i=((d=r.trigger)==null?void 0:d.id)??null;(i||n)&&(o.activeTriggerId=i,o.activeTriggerElement=r.trigger??null),this.update(o)})}}function D$(e={}){return{...Wm(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function F$(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:o,disablePointerDismissal:i=!1,modal:l=!0,actionsRef:a,handle:c,triggerId:d,defaultTriggerId:u=null}=e,f=mo(!0),h=!!f,g=Ut(()=>(c==null?void 0:c.store)??new L$({open:n??r,activeTriggerId:d!==void 0?d:u,modal:l,disablePointerDismissal:i,nested:h})).current;g.useControlledProp("open",n,r),g.useControlledProp("activeTriggerId",d,u),g.useSyncedValues({disablePointerDismissal:i,nested:h,modal:l}),g.useContextCallback("onOpenChange",s),g.useContextCallback("onOpenChangeComplete",o);const x=g.useState("payload");j$({store:g,actionsRef:a,parentContext:f==null?void 0:f.store.context});const b=S.useMemo(()=>({store:g}),[g]);return v.jsx(UE.Provider,{value:b,children:typeof t=="function"?t({payload:x}):t})}const $$=S.forwardRef(function(t,n){const{render:r,className:s,id:o,...i}=t,{store:l}=mo(),a=Bi(o);return l.useSyncedValueWithCleanup("titleElementId",a),kt("h2",t,{ref:n,props:[{id:a},i]})}),B$=F$,H$=PD;function V$({open:e,onOpenChange:t,title:n,subtitle:r,footer:s,children:o,className:i}){return v.jsx(B$,{open:e,onOpenChange:t,children:v.jsxs(P$,{children:[v.jsx(gD,{className:"fixed inset-0 z-40 bg-black/60 backdrop-blur-sm"}),v.jsxs(N$,{className:dt("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:[v.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsx($$,{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:n}),r&&v.jsx(ID,{className:"mono mt-1 text-[11px] text-zinc-500",children:r})]}),v.jsx(H$,{render:v.jsx(Fe,{variant:"quiet",size:"icon","aria-label":"Close",children:v.jsx(Li,{})})})]}),v.jsx("div",{className:"px-5 py-4",children:o}),s&&v.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:s})]})]})})}const oC=S.forwardRef(({className:e,...t},n)=>v.jsx("input",{ref:n,className:dt("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}));oC.displayName="Input";const Gc=S.forwardRef(({glyph:e,onClear:t,clearLabel:n="clear",containerClassName:r,value:s,...o},i)=>v.jsxs("div",{className:dt("flex items-center gap-1.5 rounded-md border border-line px-2 transition-colors focus-within:border-zinc-600",r),children:[e!==void 0&&v.jsx("span",{className:"shrink-0 text-zinc-600","aria-hidden":!0,children:e}),v.jsx(oC,{ref:i,value:s,...o}),t&&s?v.jsx(Fe,{variant:"ghost",size:"icon",onClick:t,title:n,"aria-label":n,className:"h-4 w-4",children:v.jsx(Li,{width:12,height:12})}):null]}));Gc.displayName="InputField";const iC=S.createContext(void 0);function _a(e){const t=S.useContext(iC);if(t===void 0&&!e)throw new Error(It(47));return t}function W$(){return{...Wm(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0}}const U$={...Um,disabled:ve(e=>e.disabled),instantType:ve(e=>e.instantType),openMethod:ve(e=>e.openMethod),openChangeReason:ve(e=>e.openChangeReason),modal:ve(e=>e.modal),stickIfOpen:ve(e=>e.stickIfOpen),titleElementId:ve(e=>e.titleElementId),descriptionElementId:ve(e=>e.descriptionElementId),openOnHover:ve(e=>e.openOnHover),closeDelay:ve(e=>e.closeDelay)};class qm extends Ld{constructor(n){const r={...W$(),...n};r.open&&(n==null?void 0:n.mounted)===void 0&&(r.mounted=!0);super(r,{popupRef:S.createRef(),backdropRef:S.createRef(),internalBackdropRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:S.createRef(),beforeContentFocusGuardRef:S.createRef(),stickIfOpenTimeout:new wr,triggerElements:new Ta},U$);Re(this,"setOpen",(n,r)=>{var d,u;const s=r.reason===Dt,o=r.reason===Qn&&r.event.detail===0,i=!n&&(r.reason===Ad||r.reason==null);if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(u=(d=this.context).onOpenChange)==null||u.call(d,n,r),r.isCanceled)return;const l={open:n,nativeEvent:r.event,reason:r.reason,nested:this.state.nested,triggerElement:r.trigger},a=this.state.floatingRootContext.context.events;a==null||a.emit("openchange",l);const c=()=>{var g;const f={open:n,openChangeReason:r.reason},h=((g=r.trigger)==null?void 0:g.id)??null;(h||n)&&(f.activeTriggerId=h,f.activeTriggerElement=r.trigger??null),this.update(f)};s?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(eD,()=>{this.set("stickIfOpen",!1)}),Wt.flushSync(c)):c(),o||i?this.set("instantType",o?"click":"dismiss"):r.reason===oa?this.set("instantType","focus"):this.set("instantType",void 0)});Re(this,"disposeEffect",()=>this.context.stickIfOpenTimeout.disposeEffect())}static useStore(n,r){const s=Ut(()=>n??new qm(r)).current;return Im(s.disposeEffect),s}}function xx({props:e}){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:o,modal:i=!1,handle:l,triggerId:a,defaultTriggerId:c=null}=e,d=qm.useStore(l==null?void 0:l.store,{open:n??r,modal:i,activeTriggerId:a!==void 0?a:c});d.useControlledProp("open",n,r),d.useControlledProp("activeTriggerId",a,c);const u=d.useState("open"),f=d.useState("positionerElement"),h=d.useState("payload"),g=d.useState("openChangeReason");d.useContextCallback("onOpenChange",s),d.useContextCallback("onOpenChangeComplete",o);const{openMethod:x,triggerProps:b,reset:p}=sC(u);Hm(d);const{forceUnmount:y}=Vm(u,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null}),p()});rC(u&&i===!0&&g!==Dt&&x!=="touch",f),S.useEffect(()=>{u||d.context.stickIfOpenTimeout.clear()},[d,u]);const m=S.useCallback(T=>{const z=Te(T);return z.preventUnmountOnClose=()=>{d.set("preventUnmountingOnClose",!0)},z},[d]),w=S.useCallback(()=>{d.setOpen(!1,m(Mm))},[d,m]);S.useImperativeHandle(e.actionsRef,()=>({unmount:y,close:w}),[y,w]);const k=Km({popupStore:d,onOpenChange:d.setOpen}),C=Fm(k,{outsidePressEvent:{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),R=Yk(k),{getReferenceProps:E,getFloatingProps:M,getTriggerProps:_}=Fd([C,R]),j=S.useMemo(()=>E(b),[E,b]),D=S.useMemo(()=>_(b),[_,b]),O=S.useMemo(()=>M(),[M]);d.useSyncedValues({modal:i,openMethod:x,activeTriggerProps:j,inactiveTriggerProps:D,popupProps:O,floatingRootContext:k,nested:yo()!=null});const N=S.useMemo(()=>({store:d}),[d]);return v.jsx(iC.Provider,{value:N,children:typeof t=="function"?t({payload:h}):t})}function K$(e){return _a(!0)?v.jsx(xx,{props:e}):v.jsx(T5,{children:v.jsx(xx,{props:e})})}const q$=300,Y$=S.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,handle:l,payload:a,openOnHover:c=!1,delay:d=q$,closeDelay:u=0,id:f,...h}=t,g=_a(!0),x=(l==null?void 0:l.store)??(g==null?void 0:g.store);if(!x)throw new Error(It(74));const b=Bi(f),p=x.useState("isTriggerActive",b),y=x.useState("floatingRootContext"),m=x.useState("isOpenedByTrigger",b),w=S.useRef(null),{registerTrigger:k,isMountedByThisTrigger:C}=Wk(b,w,x,{payload:a,disabled:o,openOnHover:c,closeDelay:u}),R=x.useState("openChangeReason"),E=x.useState("stickIfOpen"),M=x.useState("openMethod"),_=qk(y,{enabled:y!=null&&c&&(M!=="touch"||R!==Qn),mouseOnly:!0,move:!1,handleClose:Qk(),restMs:d,delay:{close:u},triggerElementRef:w,isActiveTrigger:p}),j=B5(y,{enabled:y!=null,stickIfOpen:E}),D=Fd([j]),O=x.useState("triggerProps",C),N=S.useMemo(()=>({disabled:o,open:m}),[o,m]),{getButtonProps:T,buttonRef:z}=Tm({disabled:o,native:i}),F=S.useMemo(()=>({open($){return $&&R===Qn?hD.open($):ek.open($)}}),[R]),P=kt("button",t,{state:N,ref:[z,n,k,w],props:[D.getReferenceProps(),_,O,{[ZE]:"",id:b},h,T],stateAttributesMapping:F}),I=S.useRef(null),A=he($=>{Wt.flushSync(()=>{x.setOpen(!1,Te(oa,$.nativeEvent,$.currentTarget))});const U=k5(I.current);U==null||U.focus()}),B=he($=>{var q;const U=x.select("positionerElement");if(U&&Uo($,U))(q=x.context.beforeContentFocusGuardRef.current)==null||q.focus();else{Wt.flushSync(()=>{x.setOpen(!1,Te(oa,$.nativeEvent,$.currentTarget))});let K=E5(w.current);for(;K!==null&&Ee(U,K)||K!=null&&K.hasAttribute("aria-hidden");){const X=K;if(K=zm(K),K===X)break}K==null||K.focus()}});return p?v.jsxs(S.Fragment,{children:[v.jsx(Ii,{ref:I,onFocus:A}),v.jsx(S.Fragment,{children:P},b),v.jsx(Ii,{ref:x.context.triggerFocusTargetRef,onFocus:B})]}):v.jsx(S.Fragment,{children:P},b)}),lC=S.createContext(void 0);function Q$(){const e=S.useContext(lC);if(e===void 0)throw new Error(It(45));return e}const X$=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,{store:o}=_a();return o.useState("mounted")||r?v.jsx(lC.Provider,{value:r,children:v.jsx(Ak,{ref:n,...s,renderGuards:!1})}):null}),aC=S.createContext(void 0);function G$(){const e=S.useContext(aC);if(!e)throw new Error(It(46));return e}const Z$=S.createContext(void 0);function Oa(){const e=S.useContext(Z$);return(e==null?void 0:e.direction)??"ltr"}const J$=e=>({name:"arrow",options:e,async fn(t){var I,A;const{x:n,y:r,placement:s,rects:o,platform:i,elements:l,middlewareData:a}=t,{element:c,padding:d=0,offsetParent:u="real"}=Sr(e,t)||{};if(c==null)return{};const f=pk(d),h={x:n,y:r},g=jm(s),x=Am(g),b=await i.getDimensions(c),p=g==="y",y=p?"top":"left",m=p?"bottom":"right",w=p?"clientHeight":"clientWidth",k=o.reference[x]+o.reference[g]-h[g]-o.floating[x],C=h[g]-o.reference[g],R=u==="real"?await((I=i.getOffsetParent)==null?void 0:I.call(i,c)):l.floating;let E=l.floating[w]||o.floating[x];(!E||!await((A=i.isElement)==null?void 0:A.call(i,R)))&&(E=l.floating[w]||o.floating[x]);const M=k/2-C/2,_=E/2-b[x]/2-1,j=Math.min(f[y],_),D=Math.min(f[m],_),O=j,N=E-b[x]-D,T=E/2-b[x]/2+M,z=hk(O,T,N),F=!a.arrow&&ws(s)!=null&&T!==z&&o.reference[x]/2-(T<O?j:D)-b[x]/2<0,P=F?T<O?T-O:T-N:0;return{[g]:h[g]+P,data:{[g]:z,centerOffset:T-z-P,...F&&{alignmentOffset:P}},reset:F}}}),e3=(e,t)=>({...J$(e),options:[e,t]}),t3={name:"hide",async fn(e){var l;const{width:t,height:n,x:r,y:s}=e.rects.reference,o=t===0&&n===0&&r===0&&s===0;return{data:{referenceHidden:((l=(await IF().fn(e)).data)==null?void 0:l.referenceHidden)||o}}}},Zc={sideX:"left",sideY:"top"},cC={name:"adaptiveOrigin",async fn(e){var y,m;const{x:t,y:n,rects:{floating:r},elements:{floating:s},platform:o,strategy:i,placement:l}=e,a=Ge(s),c=a.getComputedStyle(s);if(!(c.transitionDuration!=="0s"&&c.transitionDuration!==""))return{x:t,y:n,data:Zc};const u=await((y=o.getOffsetParent)==null?void 0:y.call(o,s));let f={width:0,height:0};if(i==="fixed"&&(a!=null&&a.visualViewport))f={width:a.visualViewport.width,height:a.visualViewport.height};else if(u===a){const w=ps(s);f={width:w.documentElement.clientWidth,height:w.documentElement.clientHeight}}else await((m=o.isElement)==null?void 0:m.call(o,u))&&(f=await o.getDimensions(u));const h=en(l);let g=t,x=n;h==="left"&&(g=f.width-(t+r.width)),h==="top"&&(x=f.height-(n+r.height));const b=h==="left"?"right":Zc.sideX,p=h==="top"?"bottom":Zc.sideY;return{x:g,y:x,data:{sideX:b,sideY:p}}}};function uC(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 wx(e,t,n){const{rects:r,placement:s}=e;return{side:uC(t,en(s),n),align:ws(s)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function dC(e){var Fa,$a;const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,collisionBoundary:l,collisionPadding:a=5,sticky:c=!1,arrowPadding:d=5,disableAnchorTracking:u=!1,keepMounted:f=!1,floatingRootContext:h,mounted:g,collisionAvoidance:x,shiftCrossAxis:b=!1,nodeId:p,adaptiveOrigin:y,lazyFlip:m=!1,externalTree:w}=e,[k,C]=S.useState(null);!g&&k!==null&&C(null);const R=x.side||"flip",E=x.align||"flip",M=x.fallbackAxisSide||"end",_=typeof t=="function"?t:void 0,j=he(_),D=_?j:t,O=Nn(t),T=Oa()==="rtl",z=k||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":T?"left":"right","inline-start":T?"right":"left"}[r],F=o==="center"?z:`${z}-${o}`;let P=a;const I=1,A=r==="bottom"?I:0,B=r==="top"?I:0,$=r==="right"?I:0,U=r==="left"?I:0;typeof P=="number"?P={top:P+A,right:P+U,bottom:P+B,left:P+$}:P&&(P={top:(P.top||0)+A,right:(P.right||0)+U,bottom:(P.bottom||0)+B,left:(P.left||0)+$});const q={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:P},K=S.useRef(null),X=Nn(s),G=Nn(i),te=[RF(Ae=>{const nt=wx(Ae,r,T),an=typeof X.current=="function"?X.current(nt):X.current,_t=typeof G.current=="function"?G.current(nt):G.current;return{mainAxis:an,crossAxis:_t,alignmentAxis:_t}},[typeof s!="function"?s:0,typeof i!="function"?i:0,T,r])],V=E==="none"&&R!=="shift",Z=!V&&(c||b||R==="shift"),Q=R==="none"?null:TF({...q,padding:{top:P.top+I,right:P.right+I,bottom:P.bottom+I,left:P.left+I},mainAxis:!b&&R==="flip",crossAxis:E==="flip"?"alignment":!1,fallbackAxisSideDirection:M}),ce=V?null:NF(Ae=>{const nt=ps(Ae.elements.floating).documentElement;return{...q,rootBoundary:b?{x:0,y:0,width:nt.clientWidth,height:nt.clientHeight}:void 0,mainAxis:E!=="none",crossAxis:Z,limiter:c||b?void 0:PF(an=>{if(!K.current)return{};const{width:_t,height:Cr}=K.current.getBoundingClientRect(),Rr=hn(en(an.placement)),vo=Rr==="y"?_t:Cr,Ui=Rr==="y"?P.left+P.right:P.top+P.bottom;return{offset:vo/2+Ui/2}})}},[q,c,b,P,E]);R==="shift"||E==="shift"||o==="center"?te.push(ce,Q):te.push(Q,ce),te.push(MF({...q,apply({elements:{floating:Ae},rects:{reference:nt},availableWidth:an,availableHeight:_t}){Object.entries({"--available-width":`${an}px`,"--available-height":`${_t}px`,"--anchor-width":`${nt.width}px`,"--anchor-height":`${nt.height}px`}).forEach(([Cr,Rr])=>{Ae.style.setProperty(Cr,Rr)})}}),e3(()=>({element:K.current||document.createElement("div"),padding:d,offsetParent:"floating"}),[d]),{name:"transformOrigin",fn(Ae){var Ha,qi,Yi;const{elements:nt,middlewareData:an,placement:_t,rects:Cr,y:Rr}=Ae,vo=en(_t),Ui=hn(vo),Nr=K.current,Hd=((Ha=an.arrow)==null?void 0:Ha.x)||0,Vd=((qi=an.arrow)==null?void 0:qi.y)||0,Wd=(Nr==null?void 0:Nr.clientWidth)||0,Ud=(Nr==null?void 0:Nr.clientHeight)||0,Ki=Hd+Wd/2,Ba=Vd+Ud/2,Kd=Math.abs(((Yi=an.shift)==null?void 0:Yi.y)||0),qd=Cr.reference.height/2,bs=typeof s=="function"?s(wx(Ae,r,T)):s,Yd=Kd>bs,Qd={top:`${Ki}px calc(100% + ${bs}px)`,bottom:`${Ki}px ${-bs}px`,left:`calc(100% + ${bs}px) ${Ba}px`,right:`${-bs}px ${Ba}px`}[vo],Xd=`${Ki}px ${Cr.reference.y+qd-Rr}px`;return nt.floating.style.setProperty("--transform-origin",Z&&Ui==="y"&&Yd?Xd:Qd),{}}},t3,y),ye(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,h]);const re=S.useMemo(()=>({elementResize:!u&&typeof ResizeObserver<"u",layoutShift:!u&&typeof IntersectionObserver<"u"}),[u]),{refs:W,elements:J,x:se,y:pe,middlewareData:me,update:fe,placement:ue,context:Ne,isPositioned:be,floatingStyles:_e}=o$({rootContext:h,placement:F,middleware:te,strategy:n,whileElementsMounted:f?void 0:(...Ae)=>lx(...Ae,re),nodeId:p,externalTree:w}),{sideX:ft,sideY:mt}=me.adaptiveOrigin||Zc,De=be?n:"fixed",lt=S.useMemo(()=>y?{position:De,[ft]:se,[mt]:pe}:{position:De,..._e},[y,De,ft,se,mt,pe,_e]),tt=S.useRef(null);ye(()=>{if(!g)return;const Ae=O.current,nt=typeof Ae=="function"?Ae():Ae,_t=(bx(nt)?nt.current:nt)||null||null;_t!==tt.current&&(W.setPositionReference(_t),tt.current=_t)},[g,W,D,O]),S.useEffect(()=>{if(!g)return;const Ae=O.current;typeof Ae!="function"&&bx(Ae)&&Ae.current!==tt.current&&(W.setPositionReference(Ae.current),tt.current=Ae.current)},[g,W,D,O]),S.useEffect(()=>{if(f&&g&&J.domReference&&J.floating)return lx(J.domReference,J.floating,fe,re)},[f,g,J,fe,re]);const ln=en(ue),Aa=uC(r,ln,T),ja=ws(ue)||"center",za=!!((Fa=me.hide)!=null&&Fa.referenceHidden);ye(()=>{m&&g&&be&&C(ln)},[m,g,be,ln]);const La=S.useMemo(()=>{var Ae,nt;return{position:"absolute",top:(Ae=me.arrow)==null?void 0:Ae.y,left:(nt=me.arrow)==null?void 0:nt.x}},[me.arrow]),Da=(($a=me.arrow)==null?void 0:$a.centerOffset)!==0;return S.useMemo(()=>({positionerStyles:lt,arrowStyles:La,arrowRef:K,arrowUncentered:Da,side:Aa,align:ja,physicalSide:ln,anchorHidden:za,refs:W,context:Ne,isPositioned:be,update:fe}),[lt,La,K,Da,Aa,ja,ln,za,W,Ne,be,fe])}function bx(e){return e!=null&&"current"in e}function $d(e){return e==="starting"?tD:St}const n3=S.forwardRef(function(t,n){const{render:r,className:s,anchor:o,positionMethod:i="absolute",side:l="bottom",align:a="center",sideOffset:c=0,alignOffset:d=0,collisionBoundary:u="clipping-ancestors",collisionPadding:f=5,arrowPadding:h=5,sticky:g=!1,disableAnchorTracking:x=!1,collisionAvoidance:b=JE,...p}=t,{store:y}=_a(),m=Q$(),w=N5(),k=y.useState("floatingRootContext"),C=y.useState("mounted"),R=y.useState("open"),E=y.useState("openChangeReason"),M=y.useState("activeTriggerElement"),_=y.useState("modal"),j=y.useState("positionerElement"),D=y.useState("instantType"),O=y.useState("transitionStatus"),N=S.useRef(null),T=Bm(j,!1,!1),z=dC({anchor:o,floatingRootContext:k,positionMethod:i,mounted:C,side:l,sideOffset:c,align:a,alignOffset:d,arrowPadding:h,collisionBoundary:u,collisionPadding:f,sticky:g,disableAnchorTracking:x,keepMounted:m,nodeId:w,collisionAvoidance:b,adaptiveOrigin:cC}),F=S.useMemo(()=>{const U={};return R||(U.pointerEvents="none"),{role:"presentation",hidden:!C,style:{...z.positionerStyles,...U}}},[R,C,z.positionerStyles]),P=S.useMemo(()=>({props:F,...z}),[F,z]),I=k==null?void 0:k.select("domReferenceElement");ye(()=>{const U=I,q=N.current;if(U&&(N.current=U),q&&U&&U!==q){y.set("instantType",void 0);const K=new AbortController;return T(()=>{y.set("instantType","trigger-change")},K.signal),()=>{K.abort()}}},[I,T,y]);const A=S.useMemo(()=>({open:R,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:D}),[R,P.side,P.align,P.anchorHidden,D]),B=S.useCallback(U=>{y.set("positionerElement",U)},[y]),$=kt("div",t,{state:A,props:[P.props,$d(O),p],ref:[n,B],stateAttributesMapping:Di});return v.jsxs(aC.Provider,{value:P,children:[C&&_===!0&&E!==Dt&&v.jsx(nC,{ref:y.context.internalBackdropRef,inert:tC(!R),cutout:M}),v.jsx(P5,{id:w,children:$})]})});function Sx(e){const t=rn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Xe(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r;return(Pi(n)!==o||Pi(r)!==i)&&(n=o,r=i),{width:n,height:r}}const r3=typeof ResizeObserver<"u",s3=()=>!0;function fC(e){const{popupElement:t,positionerElement:n,content:r,mounted:s,enabled:o=s3,onMeasureLayout:i,onMeasureLayoutComplete:l,side:a,direction:c}=e,d=S.useRef(!0),u=Bm(t,!0,!1),f=jd(),h=S.useRef(null),g=he(i),x=he(l),b=S.useMemo(()=>{let p=a==="top",y=a==="left";return c==="rtl"?(p=p||a==="inline-end",y=y||a==="inline-end"):(p=p||a==="inline-start",y=y||a==="inline-start"),p?{position:"absolute",[a==="top"?"bottom":"top"]:"0",[y?"right":"left"]:"0"}:St},[a,c]);ye(()=>{if(!s||!o()||!r3){d.current=!0,h.current=null;return}if(!t||!n)return;Object.entries(b).forEach(([M,_])=>{t.style.setProperty(M,_)});const p=new ResizeObserver(M=>{const _=M[0];_&&(h.current===null?h.current={width:Math.ceil(_.borderBoxSize[0].inlineSize),height:Math.ceil(_.borderBoxSize[0].blockSize)}:(h.current.width=Math.ceil(_.borderBoxSize[0].inlineSize),h.current.height=Math.ceil(_.borderBoxSize[0].blockSize)))});p.observe(t),t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto");const y=al(t,"position","static"),m=al(t,"transform","none"),w=al(t,"scale","1"),k=al(n,"--available-width","max-content"),C=al(n,"--available-height","max-content");if(g==null||g(),d.current||h.current===null){n.style.setProperty("--positioner-width","max-content"),n.style.setProperty("--positioner-height","max-content");const M=Sx(t);return n.style.setProperty("--positioner-width",`${M.width}px`),n.style.setProperty("--positioner-height",`${M.height}px`),y(),m(),w(),k(),C(),x==null||x(null,M),d.current=!1,()=>{p.disconnect()}}t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto"),n.style.setProperty("--positioner-width","max-content"),n.style.setProperty("--positioner-height","max-content");const R=Sx(t);t.style.setProperty("--popup-width",`${h.current.width}px`),t.style.setProperty("--popup-height",`${h.current.height}px`),y(),m(),k(),C(),x==null||x(h.current,R),n.style.setProperty("--positioner-width",`${R.width}px`),n.style.setProperty("--positioner-height",`${R.height}px`);const E=new AbortController;return f.request(()=>{t.style.setProperty("--popup-width",`${R.width}px`),t.style.setProperty("--popup-height",`${R.height}px`),u(()=>{t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto")},E.signal)}),()=>{p.disconnect(),E.abort(),f.cancel()}},[r,t,n,u,f,o,s,g,x,b])}function al(e,t,n){const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}const o3=S.createContext(void 0);function i3(e){return S.useContext(o3)}const l3={...Di,...Td},a3=S.forwardRef(function(t,n){const{className:r,render:s,initialFocus:o,finalFocus:i,...l}=t,{store:a}=_a(),c=G$(),d=i3()!=null,u=Oa(),f=a.useState("open"),h=a.useState("openMethod"),g=a.useState("instantType"),x=a.useState("transitionStatus"),b=a.useState("popupProps"),p=a.useState("titleElementId"),y=a.useState("descriptionElementId"),m=a.useState("modal"),w=a.useState("mounted"),k=a.useState("openChangeReason"),C=a.useState("popupElement"),R=a.useState("payload"),E=a.useState("positionerElement"),M=a.useState("activeTriggerElement"),_=a.useState("floatingRootContext");Dd({open:f,ref:a.context.popupRef,onComplete(){var $,U;f&&((U=($=a.context).onOpenChangeComplete)==null||U.call($,!0))}});const j=a.useState("disabled"),D=a.useState("openOnHover"),O=a.useState("closeDelay");Kk(_,{enabled:D&&!j,closeDelay:O});function N($){return $==="touch"?a.context.popupRef.current:!0}const T=o===void 0?N:o,z=S.useMemo(()=>({open:f,side:c.side,align:c.align,instant:g,transitionStatus:x}),[f,c.side,c.align,g,x]),F=S.useCallback($=>{a.set("popupElement",$)},[a]);function P(){_.context.events.emit("measure-layout")}function I($,U){_.context.events.emit("measure-layout-complete",{previousDimensions:$,nextDimensions:U})}const A=S.useCallback(()=>a.context.triggerElements.size>1,[a]);fC({popupElement:C,positionerElement:E,mounted:w,content:R,enabled:A,onMeasureLayout:P,onMeasureLayoutComplete:I,side:c.side,direction:u});const B=kt("div",t,{state:z,ref:[n,a.context.popupRef,F],props:[b,{"aria-labelledby":p,"aria-describedby":y,onKeyDown($){d&&eC.has($.key)&&$.stopPropagation()}},$d(x),l],stateAttributesMapping:l3});return v.jsx(jk,{context:_,openInteractionType:h,modal:m==="trap-focus",disabled:!w||k===Dt,initialFocus:T,returnFocus:i,restoreFocus:"popup",previousFocusableElement:Xe(M)?M:void 0,nextFocusableElement:a.context.triggerFocusTargetRef,beforeContentFocusGuardRef:a.context.beforeContentFocusGuardRef,children:B})}),Yp=K$,Qp=Y$,Xu=S.forwardRef(({className:e,side:t="bottom",align:n="end",sideOffset:r=4,...s},o)=>v.jsx(X$,{children:v.jsx(n3,{side:t,align:n,sideOffset:r,collisionPadding:8,className:"z-40",children:v.jsx(a3,{ref:o,className:dt("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})})}));Xu.displayName="PopoverContent";function c3({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=S.useRef(e!==void 0),[o,i]=S.useState(t),l=s?e:o,a=S.useCallback(c=>{s||i(c)},[]);return[l,a]}const hC=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function u3(){return S.useContext(hC)}function pC(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:s}=e,o=he(s),i=S.useRef(0),l=Ut(f3).current,a=Ut(d3).current,[c,d]=S.useState(0),u=S.useRef(c),f=he((p,y)=>{a.set(p,y??null),u.current+=1,d(u.current)}),h=he(p=>{a.delete(p),u.current+=1,d(u.current)}),g=S.useMemo(()=>{const p=new Map;return Array.from(a.keys()).filter(m=>m.isConnected).sort(h3).forEach((m,w)=>{const k=a.get(m)??{};p.set(m,{...k,index:w})}),p},[a,c]);ye(()=>{if(typeof MutationObserver!="function"||g.size===0)return;const p=new MutationObserver(y=>{const m=new Set,w=k=>m.has(k)?m.delete(k):m.add(k);y.forEach(k=>{k.removedNodes.forEach(w),k.addedNodes.forEach(w)}),m.size===0&&(u.current+=1,d(u.current))});return g.forEach((y,m)=>{m.parentElement&&p.observe(m.parentElement,{childList:!0})}),()=>{p.disconnect()}},[g]),ye(()=>{u.current===c&&(n.current.length!==g.size&&(n.current.length=g.size),r&&r.current.length!==g.size&&(r.current.length=g.size),i.current=g.size),o(g)},[o,g,n,r,c]),ye(()=>()=>{n.current=[]},[n]),ye(()=>()=>{r&&(r.current=[])},[r]);const x=he(p=>(l.add(p),()=>{l.delete(p)}));ye(()=>{l.forEach(p=>p(g))},[l,g]);const b=S.useMemo(()=>({register:f,unregister:h,subscribeMapChange:x,elementsRef:n,labelsRef:r,nextIndexRef:i}),[f,h,x,n,r,i]);return v.jsx(hC.Provider,{value:b,children:t})}function d3(){return new Map}function f3(){return new Set}function h3(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const gC=S.createContext(void 0);function Ym(){const e=S.useContext(gC);if(e===void 0)throw new Error(It(64));return e}let p3=function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e}({});const Qm={tabActivationDirection:e=>({[p3.activationDirection]:e})},g3=S.forwardRef(function(t,n){const{className:r,defaultValue:s=0,onValueChange:o,orientation:i="horizontal",render:l,value:a,...c}=t,d=Oa(),u=S.useRef([]),[f,h]=S.useState(()=>new Map),[g,x]=c3({controlled:a,default:s,name:"Tabs",state:"value"}),[b,p]=S.useState(()=>new Map),[y,m]=S.useState("none"),w=he((O,N)=>{o==null||o(O,N),!N.isCanceled&&(x(O),m(N.activationDirection))}),k=he((O,N)=>{h(T=>{if(T.get(O)===N)return T;const z=new Map(T);return z.set(O,N),z})}),C=he((O,N)=>{h(T=>{if(!T.has(O)||T.get(O)!==N)return T;const z=new Map(T);return z.delete(O),z})}),R=S.useCallback(O=>f.get(O),[f]),E=S.useCallback(O=>{for(const N of b.values())if(O===(N==null?void 0:N.value))return N==null?void 0:N.id},[b]),M=S.useCallback(O=>{if(O===void 0)return null;for(const[N,T]of b.entries())if(T!=null&&O===(T.value??T.index))return N;return null},[b]),_=S.useMemo(()=>({direction:d,getTabElementBySelectedValue:M,getTabIdByPanelValue:E,getTabPanelIdByValue:R,onValueChange:w,orientation:i,registerMountedTabPanel:k,setTabMap:p,unregisterMountedTabPanel:C,tabActivationDirection:y,value:g}),[d,M,E,R,w,i,k,p,C,y,g]),D=kt("div",t,{state:{orientation:i,tabActivationDirection:y},ref:n,props:c,stateAttributesMapping:Qm});return v.jsx(gC.Provider,{value:_,children:v.jsx(pC,{elementsRef:u,children:D})})}),mC="data-composite-item-active";let m3=function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e}({});function yC(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:s,index:o}=e,{register:i,unregister:l,subscribeMapChange:a,elementsRef:c,labelsRef:d,nextIndexRef:u}=u3(),f=S.useRef(-1),[h,g]=S.useState(o??(s===m3.GuessFromOrder?()=>{if(f.current===-1){const p=u.current;u.current+=1,f.current=p}return f.current}:-1)),x=S.useRef(null),b=S.useCallback(p=>{var y;if(x.current=p,h!==-1&&p!==null&&(c.current[h]=p,d)){const m=t!==void 0;d.current[h]=m?t:((y=r==null?void 0:r.current)==null?void 0:y.textContent)??p.textContent}},[h,c,d,t,r]);return ye(()=>{if(o!=null)return;const p=x.current;if(p)return i(p,n),()=>{l(p)}},[o,i,l,n]),ye(()=>{if(o==null)return a(p=>{var m;const y=x.current?(m=p.get(x.current))==null?void 0:m.index:null;y!=null&&g(y)})},[o,a,g]),S.useMemo(()=>({ref:b,index:h}),[h,b])}function y3(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=rk(),{ref:s,index:o}=yC(e),i=n===o,l=S.useRef(null),a=Ri(s,l);return{compositeProps:S.useMemo(()=>({tabIndex:i?0:-1,onFocus(){r(o)},onMouseMove(){const d=l.current;if(!t||!d)return;const u=d.hasAttribute("disabled")||d.ariaDisabled==="true";!i&&!u&&d.focus()}}),[i,r,o,t]),compositeRef:a,index:o}}const vC=S.createContext(void 0);function v3(){const e=S.useContext(vC);if(e===void 0)throw new Error(It(65));return e}const x3=S.forwardRef(function(t,n){const{className:r,disabled:s=!1,render:o,value:i,id:l,nativeButton:a=!0,...c}=t,{value:d,getTabPanelIdByValue:u,orientation:f}=Ym(),{activateOnFocus:h,highlightedTabIndex:g,onTabActivation:x,setHighlightedTabIndex:b,tabsListElement:p}=v3(),y=Bi(l),m=S.useMemo(()=>({disabled:s,id:y,value:i}),[s,y,i]),{compositeProps:w,compositeRef:k,index:C}=y3({metadata:m}),R=i===d,E=S.useRef(!1);ye(()=>{if(E.current){E.current=!1;return}if(!(R&&C>-1&&g!==C))return;const I=p;if(I!=null){const A=ir(ps(I));if(A&&Ee(I,A))return}b(C)},[R,C,g,b,s,p]);const{getButtonProps:M,buttonRef:_}=Tm({disabled:s,native:a,focusableWhenDisabled:!0}),j=u(i),D=S.useRef(!1),O=S.useRef(!1);function N(I){R||s||x(i,Te(sa,I.nativeEvent,void 0,{activationDirection:"none"}))}function T(I){R||(C>-1&&b(C),!s&&h&&(!D.current||D.current&&O.current)&&x(i,Te(sa,I.nativeEvent,void 0,{activationDirection:"none"})))}function z(I){if(R||s)return;D.current=!0;function A(){D.current=!1,O.current=!1}(!I.button||I.button===0)&&(O.current=!0,ps(I.currentTarget).addEventListener("pointerup",A,{once:!0}))}const F=S.useMemo(()=>({disabled:s,active:R,orientation:f}),[s,R,f]);return kt("button",t,{state:F,ref:[n,_,k],props:[w,{role:"tab","aria-controls":j,"aria-selected":R,id:y,onClick:N,onFocus:T,onPointerDown:z,[mC]:R?"":void 0,onKeyDownCapture(){E.current=!0}},c,M]})});let w3=function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e}({});const b3=S.forwardRef(function(t,n){const{className:r,value:s,render:o,keepMounted:i=!1,...l}=t,{value:a,getTabIdByPanelValue:c,orientation:d,tabActivationDirection:u,registerMountedTabPanel:f,unregisterMountedTabPanel:h}=Ym(),g=Bi(),x=S.useMemo(()=>({id:g,value:s}),[g,s]),{ref:b,index:p}=yC({metadata:x}),y=s!==a,m=c(s),w=S.useMemo(()=>({hidden:y,orientation:d,tabActivationDirection:u}),[y,d,u]),k=kt("div",t,{state:w,ref:[n,b],props:[{"aria-labelledby":m,hidden:y,id:g??void 0,role:"tabpanel",tabIndex:y?-1:0,[w3.index]:p},l],stateAttributesMapping:Qm});return ye(()=>{if(!(y&&!i)&&g!=null)return f(s,g),()=>{h(s,g)}},[y,i,s,g,f,h]),!y||i?k:null});function S3(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const E3=[];function k3(e){const{itemSizes:t,cols:n=1,loopFocus:r=!0,dense:s=!1,orientation:o="both",direction:i,highlightedIndex:l,onHighlightedIndexChange:a,rootRef:c,enableHomeAndEndKeys:d=!1,stopEventPropagation:u=!1,disabledIndices:f,modifierKeys:h=E3}=e,[g,x]=S.useState(0),b=n>1,p=S.useRef(null),y=Ri(p,c),m=S.useRef([]),w=S.useRef(!1),k=l??g,C=he((M,_=!1)=>{if((a??x)(M),_){const j=m.current[M];px(p.current,j,i,o)}}),R=he(M=>{if(M.size===0||w.current)return;w.current=!0;const _=Array.from(M.keys()),j=_.find(O=>O==null?void 0:O.hasAttribute(mC))??null,D=j?_.indexOf(j):-1;D!==-1&&C(D),px(p.current,j,i,o)}),E=S.useMemo(()=>({"aria-orientation":o==="both"?void 0:o,ref:y,onFocus(M){!p.current||!hx(M.target)||M.target.setSelectionRange(0,M.target.value.length??0)},onKeyDown(M){const _=d?x$:Jk;if(!_.has(M.key)||C3(M,h)||!p.current)return;const D=i==="rtl",O=D?ia:Qo,N={horizontal:O,vertical:js,both:O}[o],T=D?Qo:ia,z={horizontal:T,vertical:Yo,both:T}[o];if(hx(M.target)&&!S3(M.target)){const U=M.target.selectionStart,q=M.target.selectionEnd,K=M.target.value??"";if(U==null||M.shiftKey||U!==q||M.key!==z&&U<K.length||M.key!==N&&U>0)return}let F=k;const P=n5(m,f),I=r5(m,f);if(b){const U=t||Array.from({length:m.current.length},()=>({width:1,height:1})),q=o5(U,n,s),K=q.findIndex(G=>G!=null&&!Pl(m,G,f)),X=q.reduce((G,H,Y)=>H!=null&&!Pl(m,H,f)?Y:G,-1);F=q[s5({current:q.map(G=>G?m.current[G]:null)},{event:M,orientation:o,loopFocus:r,cols:n,disabledIndices:l5([...f||m.current.map((G,H)=>Pl(m,H)?H:void 0),void 0],q),minIndex:K,maxIndex:X,prevIndex:i5(k>I?P:k,U,q,n,M.key===js?"bl":M.key===Qo?"tr":"tl"),rtl:D})]}const A={horizontal:[O],vertical:[js],both:[O,js]}[o],B={horizontal:[T],vertical:[Yo],both:[T,Yo]}[o],$=b?_:{horizontal:d?y$:Gk,vertical:d?v$:Zk,both:_}[o];d&&(M.key===Ma?F=P:M.key===Ia&&(F=I)),F===k&&(A.includes(M.key)||B.includes(M.key))&&(r&&F===I&&A.includes(M.key)?F=P:r&&F===P&&B.includes(M.key)?F=I:F=Kt(m,{startingIndex:F,decrement:B.includes(M.key),disabledIndices:f})),F!==k&&!Yc(m,F)&&(u&&M.stopPropagation(),$.has(M.key)&&M.preventDefault(),C(F,!0),queueMicrotask(()=>{var U;(U=m.current[F])==null||U.focus()}))}}),[n,s,i,f,m,d,k,b,t,r,y,h,C,o,u]);return S.useMemo(()=>({props:E,highlightedIndex:k,onHighlightedIndexChange:C,elementsRef:m,disabledIndices:f,onMapChange:R,relayKeyboardEvent:E.onKeyDown}),[E,k,C,m,f,R])}function C3(e,t){for(const n of k$.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function R3(e){const{render:t,className:n,refs:r=zp,props:s=zp,state:o=St,stateAttributesMapping:i,highlightedIndex:l,onHighlightedIndexChange:a,orientation:c,dense:d,itemSizes:u,loopFocus:f,cols:h,enableHomeAndEndKeys:g,onMapChange:x,stopEventPropagation:b=!0,rootRef:p,disabledIndices:y,modifierKeys:m,highlightItemOnHover:w=!1,tag:k="div",...C}=e,R=Oa(),{props:E,highlightedIndex:M,onHighlightedIndexChange:_,elementsRef:j,onMapChange:D,relayKeyboardEvent:O}=k3({itemSizes:u,cols:h,loopFocus:f,dense:d,orientation:c,highlightedIndex:l,onHighlightedIndexChange:a,rootRef:p,stopEventPropagation:b,enableHomeAndEndKeys:g,direction:R,disabledIndices:y,modifierKeys:m}),N=kt(k,e,{state:o,ref:r,props:[E,...s,C],stateAttributesMapping:i}),T=S.useMemo(()=>({highlightedIndex:M,onHighlightedIndexChange:_,highlightItemOnHover:w,relayKeyboardEvent:O}),[M,_,w,O]);return v.jsx(nk.Provider,{value:T,children:v.jsx(pC,{elementsRef:j,onMapChange:z=>{x==null||x(z),D(z)},children:N})})}const N3=S.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:s,loopFocus:o=!0,render:i,...l}=t,{getTabElementBySelectedValue:a,onValueChange:c,orientation:d,value:u,setTabMap:f,tabActivationDirection:h}=Ym(),[g,x]=S.useState(0),[b,p]=S.useState(null),y=P3(u,d,b,a),m=he((R,E)=>{if(R!==u){const M=y(R);E.activationDirection=M,c(R,E)}}),w=S.useMemo(()=>({orientation:d,tabActivationDirection:h}),[d,h]),k={"aria-orientation":d==="vertical"?"vertical":void 0,role:"tablist"},C=S.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:g,onTabActivation:m,setHighlightedTabIndex:x,tabsListElement:b,value:u}),[r,g,m,x,b,u]);return v.jsx(vC.Provider,{value:C,children:v.jsx(R3,{render:i,className:s,state:w,refs:[n,p],props:[k,l],stateAttributesMapping:Qm,highlightedIndex:g,enableHomeAndEndKeys:!0,loopFocus:o,orientation:d,onHighlightedIndexChange:x,onMapChange:f,disabledIndices:zp})})});function Ex(e,t){const{left:n,top:r}=e.getBoundingClientRect(),{left:s,top:o}=t.getBoundingClientRect(),i=n-s,l=r-o;return{left:i,top:l}}function P3(e,t,n,r){const[s,o]=S.useState(null);return ye(()=>{if(e==null||n==null){o(null);return}const i=r(e);if(i==null){o(null);return}const{left:l,top:a}=Ex(i,n);o(t==="horizontal"?l:a)},[t,r,n,e]),S.useCallback(i=>{if(i===e)return"none";if(i==null)return o(null),"none";if(i!=null&&n!=null){const l=r(i);if(l!=null){const{left:a,top:c}=Ex(l,n);if(s==null)return o(t==="horizontal"?a:c),"none";if(t==="horizontal"){if(a<s)return o(a),"left";if(a>s)return o(a),"right"}else{if(c<s)return o(c),"up";if(c>s)return o(c),"down"}}}return"none"},[r,t,s,n,e])}const T3=g3,xC=S.forwardRef(({className:e,...t},n)=>v.jsx(N3,{ref:n,className:dt("flex items-center gap-0.5 rounded border border-line bg-zinc-900/60 p-0.5",e),...t}));xC.displayName="TabsList";const wC=S.forwardRef(({className:e,...t},n)=>v.jsx(x3,{ref:n,className:dt("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}));wC.displayName="TabsTab";const Jc=S.forwardRef(({className:e,...t},n)=>v.jsx(b3,{ref:n,className:dt("focus-visible:outline-none",e),...t}));Jc.displayName="TabsPanel";const bC=S.createContext(void 0);function Bd(e){const t=S.useContext(bC);if(t===void 0&&!e)throw new Error(It(72));return t}const M3={...Um,disabled:ve(e=>e.disabled),instantType:ve(e=>e.instantType),isInstantPhase:ve(e=>e.isInstantPhase),trackCursorAxis:ve(e=>e.trackCursorAxis),disableHoverablePopup:ve(e=>e.disableHoverablePopup),lastOpenChangeReason:ve(e=>e.openChangeReason),closeDelay:ve(e=>e.closeDelay)};class Xm extends Ld{constructor(n){super({...I3(),...n},{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Ta},M3);Re(this,"setOpen",(n,r)=>{var c,d;const s=r.reason,o=s===Dt,i=n&&s===$p,l=!n&&(s===Qn||s===Ad);if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(d=(c=this.context).onOpenChange)==null||d.call(c,n,r),r.isCanceled)return;const a=()=>{var h;const u={open:n,openChangeReason:s};i?u.instantType="focus":l?u.instantType="dismiss":s===Dt&&(u.instantType=void 0);const f=((h=r.trigger)==null?void 0:h.id)??null;(f||n)&&(u.activeTriggerId=f,u.activeTriggerElement=r.trigger??null),this.update(u)};o?Wt.flushSync(a):a()})}static useStore(n,r){const s=Ut(()=>n??new Xm(r)).current,o=Km({popupStore:s,onOpenChange:s.setOpen});return s.state.floatingRootContext=o,s}}function I3(){return{...Wm(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0}}function _3(e){const{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:s=!1,trackCursorAxis:o="none",actionsRef:i,onOpenChange:l,onOpenChangeComplete:a,handle:c,triggerId:d,defaultTriggerId:u=null,children:f}=e,h=Xm.useStore(c==null?void 0:c.store,{open:r??n,activeTriggerId:d!==void 0?d:u});h.useControlledProp("open",r,n),h.useControlledProp("activeTriggerId",d,u),h.useContextCallback("onOpenChange",l),h.useContextCallback("onOpenChangeComplete",a);const g=h.useState("open"),x=h.useState("activeTriggerId"),b=h.useState("payload");h.useSyncedValues({trackCursorAxis:o,disableHoverablePopup:s});const p=!t&&g;ye(()=>{g&&t&&h.setOpen(!1,Te(ND))},[g,t,h]),h.useSyncedValue("disabled",t),Hm(h);const{forceUnmount:y,transitionStatus:m}=Vm(p,h),w=h.useState("isInstantPhase"),k=h.useState("instantType"),C=h.useState("lastOpenChangeReason"),R=S.useRef(null);ye(()=>{m==="ending"&&C===sa||m!=="ending"&&w?(k!=="delay"&&(R.current=k),h.set("instantType","delay")):R.current!==null&&(h.set("instantType",R.current),R.current=null)},[m,w,C,k,h]),ye(()=>{p&&x==null&&h.set("payload",void 0)},[h,x,p]);const E=S.useCallback(()=>{h.setOpen(!1,O3(h,Mm))},[h]);S.useImperativeHandle(i,()=>({unmount:y,close:E}),[y,E]);const M=h.useState("floatingRootContext"),_=i$(M,{enabled:!t}),j=Fm(M,{enabled:!t,referencePress:!0}),D=V5(M,{enabled:!t&&o!=="none",axis:o==="none"?void 0:o}),{getReferenceProps:O,getFloatingProps:N,getTriggerProps:T}=Fd([_,j,D]),z=S.useMemo(()=>O(),[O]),F=S.useMemo(()=>T(),[T]),P=S.useMemo(()=>N(),[N]);return h.useSyncedValues({floatingRootContext:M,activeTriggerProps:z,inactiveTriggerProps:F,popupProps:P}),v.jsx(bC.Provider,{value:h,children:typeof f=="function"?f({payload:b}):f})}function O3(e,t){const n=Te(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const SC=S.createContext(void 0);function A3(){return S.useContext(SC)}const j3=600,z3=S.forwardRef(function(t,n){const{className:r,render:s,handle:o,payload:i,disabled:l,delay:a,closeDelay:c,id:d,...u}=t,f=Bd(!0),h=(o==null?void 0:o.store)??f;if(!h)throw new Error(It(82));const g=Bi(d),x=h.useState("isTriggerActive",g),b=h.useState("floatingRootContext"),p=h.useState("isOpenedByTrigger",g),y=S.useRef(null),m=a??j3,w=c??0,{registerTrigger:k,isMountedByThisTrigger:C}=Wk(g,y,h,{payload:i,closeDelay:w}),R=A3(),{delayRef:E,isInstantPhase:M,hasProvider:_}=I5(b,{open:p});h.useSyncedValue("isInstantPhase",M);const j=h.useState("disabled"),D=l??j,O=h.useState("trackCursorAxis"),N=h.useState("disableHoverablePopup"),T=qk(b,{enabled:!D,mouseOnly:!0,move:!1,handleClose:!N&&O!=="both"?Qk():null,restMs(){const I=R==null?void 0:R.delay,A=typeof E.current=="object"?E.current.open:void 0;let B=m;return _&&(A!==0?B=a??I??m:B=0),B},delay(){const I=typeof E.current=="object"?E.current.close:void 0;let A=w;return c==null&&_&&(A=I),{close:A}},triggerElementRef:y,isActiveTrigger:x}),z=S.useMemo(()=>({open:p}),[p]),F=h.useState("triggerProps",C);return kt("button",t,{state:z,ref:[n,k,y],props:[T,F,{id:g},u],stateAttributesMapping:ek})}),EC=S.createContext(void 0);function L3(){const e=S.useContext(EC);if(e===void 0)throw new Error(It(70));return e}const D3=S.forwardRef(function(t,n){const{children:r,container:s,className:o,render:i,...l}=t,{portalNode:a,portalSubtree:c}=Ok({container:s,ref:n,componentProps:t,elementProps:l});return!c&&!a?null:v.jsxs(S.Fragment,{children:[c,a&&Wt.createPortal(r,a)]})}),F3=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Bd().useState("mounted")||r?v.jsx(EC.Provider,{value:r,children:v.jsx(D3,{ref:n,...s})}):null}),kC=S.createContext(void 0);function $3(){const e=S.useContext(kC);if(e===void 0)throw new Error(It(71));return e}const B3=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:d=0,collisionBoundary:u="clipping-ancestors",collisionPadding:f=5,arrowPadding:h=5,sticky:g=!1,disableAnchorTracking:x=!1,collisionAvoidance:b=JE,...p}=t,y=Bd(),m=L3(),w=y.useState("open"),k=y.useState("mounted"),C=y.useState("trackCursorAxis"),R=y.useState("disableHoverablePopup"),E=y.useState("floatingRootContext"),M=y.useState("instantType"),_=y.useState("transitionStatus"),j=dC({anchor:o,positionMethod:i,floatingRootContext:E,mounted:k,side:l,sideOffset:c,align:a,alignOffset:d,collisionBoundary:u,collisionPadding:f,sticky:g,arrowPadding:h,disableAnchorTracking:x,keepMounted:m,collisionAvoidance:b,adaptiveOrigin:cC}),D=S.useMemo(()=>{const z={};return(!w||C==="both"||R)&&(z.pointerEvents="none"),{role:"presentation",hidden:!k,style:{...j.positionerStyles,...z}}},[w,C,R,k,j.positionerStyles]),O=S.useMemo(()=>({open:w,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:C!=="none"?"tracking-cursor":M}),[w,j.side,j.align,j.anchorHidden,C,M]),N=S.useMemo(()=>({...O,arrowRef:j.arrowRef,arrowStyles:j.arrowStyles,arrowUncentered:j.arrowUncentered}),[O,j.arrowRef,j.arrowStyles,j.arrowUncentered]),T=kt("div",t,{state:O,props:[D,$d(_),p],ref:[n,y.useStateSetter("positionerElement")],stateAttributesMapping:Di});return v.jsx(kC.Provider,{value:N,children:T})}),H3={...Di,...Td},V3=S.forwardRef(function(t,n){const{className:r,render:s,...o}=t,i=Bd(),{side:l,align:a}=$3(),c=i.useState("open"),d=i.useState("mounted"),u=i.useState("instantType"),f=i.useState("transitionStatus"),h=i.useState("popupProps"),g=i.useState("payload"),x=i.useState("popupElement"),b=i.useState("positionerElement"),p=i.useState("floatingRootContext"),y=Oa();Dd({open:c,ref:i.context.popupRef,onComplete(){var _,j;c&&((j=(_=i.context).onOpenChangeComplete)==null||j.call(_,!0))}});function m(){p.context.events.emit("measure-layout")}function w(_,j){p.context.events.emit("measure-layout-complete",{previousDimensions:_,nextDimensions:j})}fC({popupElement:x,positionerElement:b,mounted:d,content:g,enabled:()=>i.context.triggerElements.size>1,onMeasureLayout:m,onMeasureLayoutComplete:w,side:l,direction:y});const C=i.useState("disabled"),R=i.useState("closeDelay");Kk(p,{enabled:!C,closeDelay:R});const E=S.useMemo(()=>({open:c,side:l,align:a,instant:u,transitionStatus:f}),[c,l,a,u,f]);return kt("div",t,{state:E,ref:[n,i.context.popupRef,i.useStateSetter("popupElement")],props:[h,$d(f),o],stateAttributesMapping:H3})}),W3=function(t){const{delay:n,closeDelay:r,timeout:s=400}=t,o=S.useMemo(()=>({delay:n,closeDelay:r}),[n,r]),i=S.useMemo(()=>({open:n,close:r}),[n,r]);return v.jsx(SC.Provider,{value:o,children:v.jsx(M5,{delay:i,timeoutMs:s,children:t.children})})};function U3({children:e,...t}){return v.jsx(W3,{delay:150,closeDelay:80,...t,children:e})}const K3=_3,q3=z3,Y3="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 Gu({label:e,suppressed:t,side:n="bottom",align:r="end",children:s}){return v.jsxs(K3,{disabled:t??!1,children:[v.jsx(q3,{render:s}),v.jsx(F3,{children:v.jsx(B3,{side:n,align:r,sideOffset:4,collisionPadding:8,children:v.jsx(V3,{className:dt(Y3),children:e})})})]})}function CC({className:e}){return v.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:[v.jsx("title",{children:"durable"}),v.jsx("path",{d:"M12 2.5 21.5 12 12 21.5 2.5 12z",opacity:.35}),v.jsx("circle",{cx:"6.4",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),v.jsx("circle",{cx:"12",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),v.jsx("circle",{cx:"17.6",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),v.jsx("path",{d:"M8.1 12h2.2M13.7 12h2.2"})]})}const Q3=["pending","running","suspended","completed","failed","cancelling","cancelled","dead"],X3=100;function G3(e){const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const r=Math.round(n/60);if(r<60)return`${r}m ago`;const s=Math.round(r/60);return s<24?`${s}h ago`:`${Math.round(s/24)}d ago`}function Z3(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 Gm({status:e}){const t=e==="running"||e==="awaiting"||e==="cancelling";return v.jsx("span",{className:`dot s-${e} ${t?"pulse":""}`,"aria-hidden":!0})}function RC({status:e}){return v.jsxs(zt,{variant:"status",className:`s-${e} text-[11px]`,children:[v.jsx(Gm,{status:e}),e]})}function J3({counts:e,filter:t,onFilter:n}){const r=Object.values(e).reduce((a,c)=>a+c,0),s=(a,c,d)=>v.jsxs(Fe,{variant:"ghost",size:"chip","aria-pressed":t===a,onClick:()=>n(a),className:dt("rounded-md",t===a&&"border-zinc-600 bg-zinc-900 text-zinc-100 hover:text-zinc-100"),children:[a!=="all"&&v.jsx(Gm,{status:a}),v.jsx("span",{className:"uppercase tracking-wide",children:c}),v.jsx("span",{className:"mono tnum text-zinc-600",children:d})]},a),{data:o}=Un({queryKey:["topology"],queryFn:()=>Ye.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 v.jsxs("header",{className:"z-10 flex items-center gap-4 border-b border-line px-5 py-3",children:[v.jsxs("div",{className:"flex items-center gap-2.5",children:[v.jsx("div",{className:"grid h-7 w-7 place-items-center rounded-md border border-brand/30 bg-brand/10",children:v.jsx(CC,{className:"h-4 w-4 text-brand"})}),v.jsxs("div",{className:"leading-none",children:[v.jsx("div",{className:"text-sm font-semibold tracking-tight",children:"durable"}),v.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})]})]}),v.jsxs("div",{className:"ml-2 flex flex-wrap items-center gap-1",children:[s("all","all",r),Q3.map(a=>s(a,a,e[a]??0))]}),v.jsx(n4,{}),v.jsxs("div",{className:"flex items-center gap-2 text-xs text-zinc-500",children:[v.jsx("span",{className:"dot s-completed pulse","aria-hidden":!0}),"live"]})]})}function e4(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 NC({status:e}){const t=e==null?void 0:e.concurrency;if(!e||!t)return v.jsx("span",{className:"mono text-[9px] text-zinc-600",children:"no status"});const n=t.limit>0&&e.inFlight>=t.limit*.8;return v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsxs("div",{className:"mono flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[10px] text-zinc-500",children:[v.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"}),v.jsxs("span",{className:n?"text-amber-300":"text-zinc-400",children:["in-flight"," ",v.jsxs("span",{className:"tnum",children:[e.inFlight,"/",t.limit]})]}),typeof e.rssPct=="number"&&v.jsxs("span",{className:e.rssPct>=85?"text-rose-300":"",children:["ram ",v.jsxs("span",{className:"tnum",children:[Math.round(e.rssPct),"%"]})]}),typeof e.cpuPct=="number"&&v.jsxs("span",{children:["cpu ",v.jsxs("span",{className:"tnum",children:[Math.round(e.cpuPct),"%"]})]}),typeof e.throughputPerMin=="number"&&v.jsxs("span",{children:[v.jsx("span",{className:"tnum",children:Math.round(e.throughputPerMin)}),"/min"]}),typeof e.p95Ms=="number"&&v.jsxs("span",{children:["p95 ",v.jsxs("span",{className:"tnum",children:[Math.round(e.p95Ms),"ms"]})]})]}),e.lastAdjust&&v.jsxs("div",{className:"mono text-[10px] text-zinc-500",children:[e.lastAdjust.reason," ",v.jsxs("span",{className:"tnum text-zinc-400",children:[e.lastAdjust.from,"→",e.lastAdjust.to]})," ",e4(e.lastAdjust.at)]})]})}function t4({workers:e}){return v.jsx("div",{className:"flex flex-col divide-y divide-line-soft",children:e.map(t=>v.jsxs("div",{className:"flex flex-col gap-1 px-2.5 py-2",children:[v.jsx("span",{className:"mono truncate text-[10px] text-zinc-400",children:t.instanceId}),v.jsx(NC,{status:t.status})]},t.instanceId))})}function n4(){const{data:e}=Un({queryKey:["workers"],queryFn:()=>Ye.workers(),refetchInterval:1e4}),[t,n]=S.useState("workers");if(!e||e.length===0)return null;const r=QT(e),s={workers:"pods",partitions:"parts",alerts:"alerts"};return v.jsxs(T3,{value:t,onValueChange:o=>n(o),className:"ml-auto flex flex-nowrap items-center gap-1.5",children:[v.jsx(xC,{children:["workers","partitions","alerts"].map(o=>v.jsxs(wC,{value:o,children:[s[o],o==="alerts"&&r.starved.length>0&&v.jsx("span",{className:"tnum ml-1 rounded bg-rose-500/80 px-1 text-[9px] text-white",children:r.starved.length})]},o))}),v.jsxs("div",{className:"flex w-[300px] flex-nowrap items-center justify-end gap-1.5",children:[v.jsx(Jc,{value:"workers",className:"flex flex-nowrap items-center gap-1.5",children:v.jsx(r4,{workers:YT(e)})}),v.jsx(Jc,{value:"partitions",className:"flex flex-nowrap items-center gap-1.5",children:v.jsx(s4,{groups:e})}),v.jsx(Jc,{value:"alerts",className:"flex flex-nowrap items-center gap-1.5",children:v.jsx(o4,{summary:r})})]})]})}const kx="__overflow__";function Cx(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 Rx({w:e}){return v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"px-2.5 py-2",children:v.jsx(NC,{status:e.status})}),v.jsxs("div",{className:"max-h-48 overflow-auto border-t border-line-soft px-2.5 py-1.5",children:[v.jsxs("div",{className:"mono mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:[e.handlers.length," handlers"]}),e.handlers.map(t=>v.jsx("div",{className:"mono truncate text-[10px] text-zinc-400",children:t},t))]})]})}function r4({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===kx;return v.jsxs(v.Fragment,{children:[i.map(c=>{const d=t===c.instanceId,u=Cx(c);return v.jsxs(Yp,{open:d,onOpenChange:f=>n(f?c.instanceId:void 0),children:[v.jsx(Gu,{suppressed:d,label:`${c.instanceId}
|
|
77
|
+
${c.handlers.length} handlers · ${c.partition}${u?` · ${u} in-flight`:""}`,children:v.jsx(Qp,{render:v.jsxs(Fe,{variant:"chip",size:"xs",className:dt("mono max-w-[120px] gap-1",d&&"border-zinc-500 bg-zinc-800 text-zinc-200"),children:[v.jsx("span",{className:`dot ${c.status?"s-completed":""}`,"aria-hidden":!0}),v.jsx("span",{className:"truncate",children:c.instanceId}),c.partition!=="default"&&v.jsxs("span",{className:"shrink-0 text-zinc-500",children:["@",c.partition]}),v.jsxs("span",{className:"tnum shrink-0 text-zinc-500",children:[c.handlers.length,"h",u?` · ${u}`:""]})]})})}),v.jsxs(Xu,{children:[v.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:[v.jsx("span",{className:"truncate text-zinc-300",children:c.instanceId}),v.jsxs("span",{className:"shrink-0",children:[c.runtime??"node"," · ",c.partition]})]}),v.jsx(Rx,{w:c})]})]},c.instanceId)}),l.length>0&&v.jsxs(Yp,{open:a,onOpenChange:c=>{n(c?kx:void 0),s(void 0)},children:[v.jsx(Qp,{render:v.jsxs(Fe,{variant:"chip",size:"xs",className:dt("mono shrink-0",a&&"border-zinc-500 bg-zinc-800 text-zinc-200"),children:["+",l.length]})}),v.jsxs(Xu,{children:[v.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"]}),v.jsx("div",{className:"max-h-80 divide-y divide-line-soft overflow-auto",children:l.map(c=>{const d=Cx(c),u=r===c.instanceId;return v.jsxs("div",{children:[v.jsxs("button",{type:"button",onClick:()=>s(u?void 0:c.instanceId),className:dt("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",u?"bg-zinc-800/40 text-zinc-200":"text-zinc-300"),children:[v.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[v.jsx("span",{className:`dot ${c.status?"s-completed":""}`,"aria-hidden":!0}),v.jsx("span",{className:"truncate",children:c.instanceId})]}),v.jsxs("span",{className:"tnum shrink-0 text-zinc-500",children:[c.partition!=="default"?`@${c.partition} · `:"",c.handlers.length,"h",d?` · ${d}`:""]})]}),u&&v.jsx("div",{className:"border-t border-line-soft bg-zinc-900/40",children:v.jsx(Rx,{w:c})})]},c.instanceId)})})]})]})]})}function s4({groups:e}){const[t,n]=S.useState(void 0),r=KT(e);function s(o){const i=new Map;for(const l of e)if(Ru(l.group)===o)for(const a of l.liveWorkers)i.has(a.instanceId)||i.set(a.instanceId,a);return[...i.values()]}return v.jsx(v.Fragment,{children:r.map(o=>{const i=o.starvedCount>0,l=t===o.partition;return v.jsxs(Yp,{open:l&&o.workerCount>0,onOpenChange:a=>n(a?o.partition:void 0),children:[v.jsx(Gu,{suppressed:l,label:`${o.partition}
|
|
78
|
+
${o.workerCount} workers · ${o.handlerCount} handlers · ${o.totalDepth} queued${i?` · ${o.starvedCount} starved`:""}`,children:v.jsx(Qp,{render:v.jsxs(Fe,{variant:"chip",size:"xs",disabled:o.workerCount===0,className:dt("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:[v.jsx("span",{className:`dot ${i?"s-failed":o.workerCount>0?"s-completed":""}`,"aria-hidden":!0}),o.partition,v.jsxs("span",{className:"tnum text-zinc-500",children:[o.workerCount,"w ",o.handlerCount,"h",o.totalDepth>0?` ${o.totalDepth}q`:"",i?` ${o.starvedCount}!`:""]})]})})}),v.jsxs(Xu,{children:[v.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:[v.jsx("span",{className:"text-zinc-300",children:o.partition}),v.jsxs("span",{className:"tnum",children:[o.workerCount," worker(s) · ",o.totalDepth," queued"]})]}),v.jsx(t4,{workers:s(o.partition)})]})]},o.partition)})})}function o4({summary:e}){const t=(n,r)=>`${n} ${n===1?r:`${r}s`}`;return v.jsxs(v.Fragment,{children:[v.jsx(Gu,{label:`Route-by-handler: each @Workflow & @Step is served as its own queue.
|
|
79
|
+
${e.queueCount} queues across ${t(e.workerCount,"worker")}.`,children:v.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?v.jsx("span",{className:"text-good",children:"all draining"}):v.jsxs("span",{className:"text-rose-300",children:[e.starved.length," starved"]})]})}),e.starved.map(n=>v.jsx(Gu,{label:`${n.group}
|
|
80
|
+
${n.depth} queued, no worker consuming`,children:v.jsxs(zt,{variant:"danger",className:"mono gap-1 border-rose-500/50 bg-rose-500/15 py-0.5",children:[v.jsx("span",{className:"dot s-failed","aria-hidden":!0}),v.jsx("span",{className:"max-w-[180px] truncate",children:n.group}),v.jsxs("span",{className:"tnum shrink-0",children:[n.depth,"q · 0w"]})]})},n.group))]})}function i4(){return v.jsx("ul",{className:"divide-y divide-line-soft","aria-hidden":!0,children:[0,1,2,3,4,5].map(e=>v.jsxs("li",{className:"flex flex-col gap-2 px-4 py-3",children:[v.jsxs("div",{className:"flex items-center justify-between gap-2",children:[v.jsx("div",{className:"h-3.5 w-32 animate-pulse rounded bg-zinc-800"}),v.jsx("div",{className:"h-3 w-16 animate-pulse rounded bg-zinc-800/70"})]}),v.jsx("div",{className:"h-2.5 w-48 animate-pulse rounded bg-zinc-800/50"})]},e))})}function l4({r:e,allRuns:t,health:n,selected:r,onSelect:s,onSelectTag:o,onSelectNamespace:i,onSelectOrigin:l}){const a=Jg(e,{runs:t,health:n}),c=e.namespace&&e.namespace!=="default"?e.namespace:void 0,d=zi(e.origin);return v.jsxs("button",{type:"button",onClick:()=>s(e.id),className:`flex w-full flex-col gap-1 px-4 py-3 text-left transition-colors ${r===e.id?"bg-zinc-900":"hover:bg-zinc-900/50"}`,children:[v.jsxs("div",{className:"flex items-center justify-between gap-2",children:[v.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[v.jsx("span",{className:"truncate text-sm font-medium text-zinc-200",children:e.workflow}),c&&v.jsx(zt,{variant:"tenant",className:"mono shrink-0 cursor-pointer px-1 text-[9px] hover:border-sky-400/60 hover:text-sky-200",title:`Tenant / worker-pool partition — click to show only ${c}`,onClick:u=>{u.stopPropagation(),i(c)},children:c}),d&&v.jsx(zt,{variant:"origin",className:"mono shrink-0 cursor-pointer px-1 text-[9px] hover:border-teal-400/60 hover:text-teal-200",title:`Declared by ${d} — click to show only this library's runs`,onClick:u=>{u.stopPropagation(),l({kind:"origin",origin:d})},children:ba(d)}),e.id.startsWith("dlq:")&&v.jsx(zt,{variant:"danger",className:"mono shrink-0 px-1 text-[9px] uppercase tracking-wider",children:"dlq"})]}),v.jsx(RC,{status:a.status})]}),a.detail&&v.jsx("div",{className:`mono truncate text-[11px] s-${a.status}`,children:a.detail}),v.jsxs("div",{className:"flex items-center justify-between gap-2",children:[v.jsx("span",{className:"mono truncate text-[11px] text-zinc-600",children:e.id}),v.jsx("span",{className:"shrink-0 text-[11px] text-zinc-600",children:G3(e.updatedAt)})]}),e.tags&&e.tags.length>0&&v.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map(u=>v.jsxs("span",{onClick:f=>{f.stopPropagation(),o(u)},className:dt(WE({variant:"outline"}),"mono cursor-pointer hover:border-zinc-500 hover:text-zinc-200"),children:["#",u]},u))})]})}const a4=88;function c4({runs:e,allRuns:t,health:n,loading:r,selected:s,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a,emptyNotice:c,hasMore:d,loadingMore:u,onLoadMore:f}){var p;const h=S.useRef(null),g=CT({count:e.length,getScrollElement:()=>h.current,estimateSize:()=>a4,overscan:10,initialRect:{width:340,height:480}}),x=g.getVirtualItems(),b=x.length>0?((p=x[x.length-1])==null?void 0:p.index)??-1:-1;return S.useEffect(()=>{e.length!==0&&(b<e.length-1||!d||u||f==null||f())},[b,e.length,d,u,f]),r&&e.length===0?v.jsx(i4,{}):e.length===0?v.jsxs("div",{className:"flex flex-col items-start gap-2 p-6 text-sm text-zinc-600",children:[v.jsx("span",{children:c.message}),c.unclassified!==void 0&&v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"text-[11px] text-zinc-500",children:[c.unclassified," run",c.unclassified===1?"":"s"," here"," ",c.unclassified===1?"has":"have"," no recorded origin, so no package filter can match ",c.unclassified===1?"it":"them","."]}),v.jsx(Fe,{variant:"chip",size:"xs",className:"mono rounded",title:Zg,onClick:()=>a({kind:"unknown"}),children:"show unclassified"})]})]}):v.jsxs("div",{ref:h,className:"h-full overflow-auto","data-testid":"runs-list-scroll",children:[v.jsx("ul",{className:"relative divide-y divide-line-soft",style:{height:g.getTotalSize()},children:x.map(y=>{const m=e[y.index];return m?v.jsx("li",{ref:g.measureElement,"data-index":y.index,className:"absolute inset-x-0 top-0",style:{transform:`translateY(${y.start}px)`},children:v.jsx(l4,{r:m,allRuns:t,health:n,selected:s,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a})},m.id):null})}),u&&v.jsx("div",{className:"mono px-4 py-2 text-center text-[11px] text-zinc-600",children:"loading more…"})]})}function u4({compensations:e,selKey:t,onSelect:n}){return v.jsxs("div",{className:"shrink-0 border-t border-amber-500/20 bg-black/20 px-7 py-3",children:[v.jsx("div",{className:"mono mb-2 text-[10px] uppercase tracking-[0.18em] text-amber-400/80",children:"compensation · unwind order"}),v.jsx("ul",{className:"flex flex-col gap-1",children:e.map(r=>{const s=`${r.runId}#${r.seq}`;return v.jsx("li",{children:v.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:[v.jsx(Gm,{status:r.status}),v.jsx("span",{className:"truncate text-amber-100",children:AT(r.name)}),v.jsx("span",{className:"ml-auto shrink-0 text-[10px] uppercase tracking-wider text-amber-400/70",children:r.status})]})},s)})})]})}function d4({id:e,onOpenRun:t}){var ce,re;const n=Oi(),{data:r}=Un({queryKey:["run",e],queryFn:async()=>qT(n.getQueryData(["run",e]),await Ye.run(e)),refetchInterval:W=>{var se;const J=(se=W.state.data)==null?void 0:se.run.status;return J==="running"||J==="suspended"?1500:!1}}),{data:s=[]}=Un({queryKey:["workers"],queryFn:()=>Ye.workers(),refetchInterval:5e3}),{data:o=[]}=Un({queryKey:["runs","",""],queryFn:()=>Ye.runs(),refetchInterval:3e3}),i=(r==null?void 0:r.run.status)==="dead"?`dlq:${e}`:void 0,{data:l}=Un({queryKey:["run",i],queryFn:()=>Ye.run(i),enabled:!!i,retry:!1}),a=()=>{n.invalidateQueries({queryKey:["run",e]}),n.invalidateQueries({queryKey:["runs"]})},c=r==null?void 0:r.run.status,d=c==="running"||c==="suspended";S.useEffect(()=>{if(d)return Ye.streamRun(e,W=>{if(W.type==="step.progress"&&W.event&&W.seq!=null){const J=W.seq,se=W.event;n.setQueryData(["run",e],pe=>pe&&{...pe,timeline:pe.timeline.map(me=>me.seq===J?{...me,events:[...me.events??[],se]}:me)});return}n.invalidateQueries({queryKey:["run",e]})})},[e,d,n]);const u=So({mutationFn:()=>Ye.retry(e),onSuccess:a}),f=So({mutationFn:W=>Ye.cancel(e,W!==void 0?{compensate:W}:{}),onSuccess:a}),h=So({mutationFn:()=>Ye.continue(e),onSuccess:a}),g=So({mutationFn:()=>Ye.redispatch(e),onSuccess:a}),x=So({mutationFn:W=>Ye.retryWithInput(e,W),onSuccess:W=>{n.invalidateQueries({queryKey:["runs"]}),t(W.runId)}}),[b,p]=S.useState(!1),[y,m]=S.useState(""),[w,k]=S.useState(),C=()=>{m(JSON.stringify((r==null?void 0:r.run.input)??{},null,2)),k(void 0),p(!0)},R=()=>{let W;try{W=JSON.parse(y)}catch(J){k(J instanceof Error?J.message:"Invalid JSON");return}p(!1),x.mutate(W)},[E,M]=S.useState(),[_,j]=S.useState(!1),[D,O]=S.useState(new Set),[N,T]=S.useState(240);function z(W){W.preventDefault(),W.currentTarget.setPointerCapture(W.pointerId);const J=pe=>T(me=>Math.max(120,Math.min(720,me-pe.movementY))),se=()=>{window.removeEventListener("pointermove",J),window.removeEventListener("pointerup",se)};window.addEventListener("pointermove",J),window.addEventListener("pointerup",se)}function F(W){O(J=>{const se=new Set(J);return se.has(W)?se.delete(W):se.add(W),se})}if(!r)return v.jsx("div",{className:"p-8 text-sm text-zinc-600",children:"Loading run…"});const{run:P,timeline:I}=r,{body:A,compensations:B}=jT(I),$=zT(B),U=P.id.startsWith("dlq:"),q=U?{id:P.id.slice(4),title:"Dead-letter handler",subtitle:`started because run ${P.id.slice(4)} was dead-lettered`,cta:"open dead run →"}:l?{id:`dlq:${P.id}`,title:"Dead-lettered",subtitle:"this run exceeded recovery and was routed to a DLQ handler",cta:"open DLQ handler →"}:void 0,K=B.length>0?(()=>{const W=$.failed>0?` ${$.failed} undo${$.failed===1?"":"s"} failed after retries — check ${$.failed===1?"it":"them"} below.`:"";return $.pending>0?{title:"Compensating",subtitle:`undoing completed steps in reverse (${$.done} of ${$.total} done).${W}`}:P.status==="cancelled"?{title:"Cancelled with compensation",subtitle:`completed steps were undone before cancelling.${W}`}:{title:"Saga compensated",subtitle:`the run failed and its ${$.total} completed step${$.total===1?"":"s"} were undone in reverse.${W}`}})():void 0,X=P.status==="failed"||P.status==="suspended",G=P.status==="running"||P.status==="suspended",H=P.status==="suspended"||P.status==="running",Y=A.some(W=>W.status==="pending"&&W.kind==="signal"&&W.name.startsWith("breakpoint")),te=E?`${E.step.runId}#${E.step.seq}`:void 0,V=Jg(P,{runs:o,health:s,timeline:A}),Z=P.namespace&&P.namespace!=="default"?P.namespace:void 0,Q=zi(P.origin);return v.jsxs("div",{className:"flex h-full flex-col",children:[v.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-line px-7 py-5",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:P.workflow}),Bf(P.id)!==void 0&&v.jsx(Fe,{variant:"alt",size:"xs",onClick:()=>t(Bf(P.id)),className:"mono uppercase tracking-wider",title:`Open the parent run (${Bf(P.id)}) — the macro view this child belongs to`,children:"↑ parent"}),Kc(P.id)!==void 0&&v.jsx(Fe,{variant:"chip",size:"xs",onClick:()=>t(Kc(P.id)),className:"mono uppercase tracking-wider text-zinc-300",title:`This is a retry-with-input of ${Kc(P.id)} — open the original run`,children:"↩ original"}),U&&v.jsx(zt,{variant:"danger",className:"mono py-0.5 uppercase tracking-wider",children:"dlq"}),v.jsx(RC,{status:V.status}),V.detail&&v.jsx("span",{className:`mono text-[11px] s-${V.status}`,children:V.detail}),Z&&v.jsx(zt,{variant:"tenant",className:"mono py-0.5",title:"Tenant / worker-pool partition this run belongs to",children:Z}),Q?v.jsx(zt,{variant:"origin",className:"mono py-0.5",title:`Declared by ${Q}`,children:ba(Q)}):v.jsxs(zt,{variant:"origin-unknown",className:"mono py-0.5",title:Zg,children:["origin ",gd]}),B.length>0&&v.jsx(zt,{variant:"warn",className:dt("mono py-0.5 uppercase tracking-wider",$.pending>0&&"pulse"),title:$.pending>0?`compensating: ${$.done} of ${$.total} undone`:`${$.total} step${$.total===1?"":"s"} compensated`,children:$.pending>0?"compensating":"compensated"}),v.jsxs(zt,{className:"mono bg-transparent py-0.5 text-zinc-500",children:["v",P.workflowVersion]}),v.jsxs("span",{className:"mono tnum text-[11px] text-zinc-600",children:[A.length," ",A.length===1?"step":"steps"]})]}),v.jsx("div",{className:"mono mt-1 truncate text-[11px] text-zinc-600",children:P.id}),P.tags&&P.tags.length>0&&v.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:P.tags.map(W=>v.jsxs(zt,{className:"mono",children:["#",W]},W))}),P.searchAttributes&&Object.keys(P.searchAttributes).length>0&&v.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:Object.entries(P.searchAttributes).map(([W,J])=>v.jsxs(zt,{variant:"attr",className:"mono",title:"search attribute",children:[W,"=",String(J)]},W))}),(ce=r==null?void 0:r.children)!=null&&ce.length?v.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1",children:[v.jsx("span",{className:"text-[10px] text-zinc-600",children:"children:"}),(re=r.children)==null?void 0:re.map(W=>v.jsx(Fe,{variant:"chip",size:"xs",onClick:()=>t(W),className:"mono px-1.5 py-0",children:W},W))]}):null]}),v.jsxs("div",{className:"flex shrink-0 gap-2",children:[v.jsx(Fe,{onClick:()=>j(!0),className:"mono px-2.5 normal-case tracking-normal text-zinc-400",title:"Run input / output",children:"{ }"}),Y&&v.jsxs(Fe,{variant:"warn",disabled:h.isPending,onClick:()=>h.mutate(),children:[v.jsx(QM,{width:12,height:12}),"Continue"]}),v.jsxs(Fe,{variant:"brand",disabled:!X||u.isPending,onClick:()=>u.mutate(),children:[v.jsx(Mf,{width:12,height:12}),"Retry"]}),H&&v.jsxs(Fe,{variant:"info",disabled:g.isPending,onClick:()=>g.mutate(),title:"Re-dispatch stuck `pending` remote steps — recovery for a lost step dispatch (crashed worker or dropped job)",children:[v.jsx(nm,{width:12,height:12}),"Re-dispatch"]}),(P.status==="dead"||P.status==="failed")&&v.jsxs(Fe,{variant:"alt",disabled:x.isPending,onClick:C,title:"Edit the input and re-run as a fresh linked run",children:[v.jsx(Mf,{width:12,height:12}),"Fix & replay"]}),G&&v.jsxs(Fe,{variant:"warn",disabled:f.isPending,onClick:()=>f.mutate(!0),title:"Cancel and run saga compensations (undo completed steps in reverse)",className:"bg-transparent",children:[v.jsx(Mf,{width:12,height:12}),"Cancel + Undo"]}),v.jsxs(Fe,{className:"border-zinc-700",disabled:!G||f.isPending,onClick:()=>f.mutate(!1),children:[v.jsx(Li,{width:12,height:12}),"Cancel"]})]})]}),q&&v.jsxs("div",{className:"flex items-center gap-3 border-b border-rose-500/30 bg-rose-500/10 px-7 py-3",children:[v.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:"⚠"}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("div",{className:"text-[13px] font-medium text-rose-200",children:q.title}),v.jsx("div",{className:"mono truncate text-[11px] text-rose-300/70",children:q.subtitle})]}),v.jsx(Fe,{variant:"danger",onClick:()=>t(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})]}),K&&v.jsxs("div",{className:"flex items-center gap-3 border-b border-amber-500/30 bg-amber-500/10 px-7 py-3",children:[v.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:"↺"}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("div",{className:"text-[13px] font-medium text-amber-200",children:K.title}),v.jsx("div",{className:"mono truncate text-[11px] text-amber-300/70",children:K.subtitle})]})]}),v.jsxs("div",{className:"relative grid min-h-0 flex-1",style:{gridTemplateRows:A.length>0?`1fr ${N}px`:"1fr"},children:[v.jsxs("div",{className:"relative min-h-0",children:[A.length===0?v.jsx("div",{className:"grid h-full place-items-center text-sm text-zinc-600",children:"No steps recorded yet."}):v.jsx(BL,{run:P,timeline:A,endStatus:V.status,selectedKey:te,onSelect:(W,J)=>M({step:W,run:J}),onOpenRun:t,fmtDuration:Z3,expanded:D,onToggleChild:F}),(P.status==="failed"||P.status==="cancelled")&&P.error&&v.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:P.error.message})]}),A.length>0&&v.jsxs("div",{className:"relative min-h-0 overflow-hidden border-t border-line bg-black/20",children:[v.jsx("div",{onPointerDown:z,className:"absolute inset-x-0 top-0 z-10 h-1.5 -translate-y-1/2 cursor-row-resize hover:bg-brand/40",title:"Drag to resize"}),v.jsx(oI,{run:P,timeline:A,selectedKey:te,onSelect:(W,J)=>M({step:W,run:J}),onOpenRun:t,expanded:D,onToggleChild:F})]}),E&&v.jsx(dI,{step:E.step,run:E.run,onClose:()=>M(void 0),onOpenRun:t}),_&&v.jsx(fI,{run:P,onClose:()=>j(!1)})]}),B.length>0&&v.jsx(u4,{compensations:B,selKey:te,onSelect:W=>M({step:W,run:P})}),v.jsxs(V$,{open:b,onOpenChange:p,title:"Fix & replay",subtitle:`re-runs ${P.id} as a fresh linked run`,footer:v.jsxs(v.Fragment,{children:[v.jsx(Fe,{onClick:()=>p(!1),children:"Cancel"}),v.jsx(Fe,{variant:"alt",disabled:x.isPending,onClick:R,children:"Replay"})]}),children:[v.jsx("label",{className:"mono mb-1.5 block text-[10px] uppercase tracking-[0.18em] text-zinc-500",htmlFor:"fix-replay-input",children:"input"}),v.jsx("textarea",{id:"fix-replay-input",value:y,spellCheck:!1,onChange:W=>{m(W.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"}),w&&v.jsx("p",{className:"mono mt-2 rounded border border-bad/25 bg-bad/10 px-2 py-1 text-[11px] text-bad",children:w})]})]})}function Nx(){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 f4(){const[e,t]=S.useState("all"),[n,r]=S.useState(""),[s,o]=S.useState(""),[i,l]=S.useState(""),[a,c]=S.useState(k1),[d,u]=S.useState(()=>Nx()),f=S.useCallback(T=>{if(u(T),typeof window>"u")return;const z=T?`#/run/${encodeURIComponent(T)}`:"",F=z||window.location.pathname+window.location.search;window.location.hash!==z&&window.history.pushState(null,"",F)},[]);S.useEffect(()=>{const T=()=>u(Nx());return window.addEventListener("hashchange",T),window.addEventListener("popstate",T),()=>{window.removeEventListener("hashchange",T),window.removeEventListener("popstate",T)}},[]);const h=Oi(),g=s.split(",").map(T=>T.trim()).filter(Boolean),{data:x,isPending:b,fetchNextPage:p,hasNextPage:y,isFetchingNextPage:m}=sN({queryKey:["runs",n,g.join("|"),i],queryFn:({pageParam:T})=>Ye.runsPage(void 0,n||void 0,g.length?g:void 0,{namespace:i||void 0},{limit:X3,offset:T}),initialPageParam:0,getNextPageParam:T=>{const{limit:z,offset:F,count:P}=T.page;return P===z?F+z:void 0},refetchInterval:3e3}),w=S.useMemo(()=>(x==null?void 0:x.pages.flatMap(T=>T.runs))??[],[x]),{data:k=[]}=Un({queryKey:["workers"],queryFn:()=>Ye.workers(),refetchInterval:5e3}),C=So({mutationFn:T=>Ye.bulk(T,{status:e!=="all"?e:void 0,tag:n||void 0,attr:g.length?g:void 0,namespace:i||void 0,origin:a.kind==="origin"?a.origin:void 0}),onSuccess:()=>h.invalidateQueries({queryKey:["runs"]})}),R=MT(w,a),E=R.reduce((T,z)=>(T[z.status]=(T[z.status]??0)+1,T),{}),M=e==="all"?R:R.filter(T=>T.status===e),_=_T(w),j=e!=="all"||!!n||!!i||g.length>0||a.kind!=="all",D=a.kind==="unknown"?"Bulk actions cannot be scoped to unclassified runs — runs with no origin have no server-side filter. Retry or cancel them from their own run view.":void 0,O=[...new Set(w.filter(T=>Jg(T,{runs:w,health:k}).status==="no-worker").map(T=>T.workflow))],N=`${e}|${n}|${g.join(",")}|${i}|${C1(a)}`;return v.jsxs(U3,{children:[v.jsx("div",{className:"app-bg"}),v.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[v.jsx(J3,{counts:E,filter:e,onFilter:t}),O.length>0&&v.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:[v.jsx("span",{className:"s-no-worker inline-flex items-center gap-1.5",children:v.jsx("span",{className:"dot s-no-worker","aria-hidden":!0})}),v.jsxs("span",{children:["Runs waiting on handlers with no live worker:"," ",v.jsx("span",{className:"mono text-amber-100",children:O.join(", ")}),". Start a worker to unblock."]})]}),v.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-[minmax(300px,360px)_1fr]",children:[v.jsxs("aside",{className:"flex min-h-0 flex-col border-r border-line",children:[v.jsxs("div",{className:"border-b border-line p-2",children:[v.jsx(Gc,{glyph:"#",value:n,onChange:T=>r(T.target.value),onClear:()=>r(""),clearLabel:"clear tag filter",placeholder:"filter by tag…","aria-label":"filter by tag"}),v.jsx(Gc,{glyph:"⛃",containerClassName:"mt-1.5",value:s,onChange:T=>o(T.target.value),onClear:()=>o(""),clearLabel:"clear attribute filter",placeholder:"attrs e.g. amount:gte:200, tier:eq:pro","aria-label":"filter by search attribute",title:"Typed search attributes: comma-separated key:op:value (ops eq ne gt gte lt lte)"}),v.jsx(Gc,{glyph:"@",containerClassName:"mt-1.5",value:i,onChange:T=>l(T.target.value),onClear:()=>l(""),clearLabel:"clear tenant filter",placeholder:"filter by tenant / namespace…","aria-label":"filter by tenant",title:"Tenant / worker-pool partition (WorkflowRun.namespace). Empty shows every tenant."})]}),v.jsx(HM,{runs:w,value:a,onChange:c}),j&&M.length>0&&v.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-3 py-1.5",children:[v.jsxs("span",{className:"mono text-[10px] text-zinc-500",children:[M.length," ",e!=="all"?e:""," ",n&&`#${n}`,i&&` @${i}`,a.kind==="origin"&&` ⬡${ba(a.origin)}`,a.kind==="unknown"&&` ⬡${gd}`,g.length>0&&` ⛃${g.length}`]}),v.jsx(Fe,{variant:"brand",size:"xs",disabled:C.isPending||D!==void 0,title:D,onClick:()=>C.mutate("retry"),className:"mono ml-auto rounded",children:"retry all"}),v.jsx(Fe,{variant:"danger",size:"xs",disabled:C.isPending||D!==void 0,title:D,onClick:()=>C.mutate("cancel"),className:"mono rounded",children:"cancel all"})]}),v.jsx("div",{className:"min-h-0 flex-1",children:v.jsx(c4,{runs:M,allRuns:w,health:k,loading:b,selected:d,onSelect:f,onSelectTag:r,onSelectNamespace:l,onSelectOrigin:c,hasMore:y,loadingMore:m,onLoadMore:p,emptyNotice:OT({anyFilter:j,origin:a,unknownCount:_})},N)})]}),v.jsx("main",{className:"min-h-0",children:d?v.jsx(d4,{id:d,onOpenRun:f},d):v.jsx("div",{className:"grid h-full place-items-center text-center",children:v.jsxs("div",{className:"flex flex-col items-center",children:[v.jsx(CC,{className:"h-10 w-10 text-zinc-800"}),v.jsx("p",{className:"mt-3 text-sm text-zinc-600",children:"Select a run to see its timeline."})]})})})]})]})]})}const h4=new JR({defaultOptions:{queries:{refetchInterval:2e3,refetchOnWindowFocus:!1}}});S1(document.getElementById("root")).render(v.jsx(S.StrictMode,{children:v.jsx(eN,{client:h4,children:v.jsx(f4,{})})}));
|
|
81
|
+
//# sourceMappingURL=index-BpH1yTMa.js.map
|