@api-doc-tor/express 0.1.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.
Files changed (48) hide show
  1. package/dist/chat-proxy.d.ts +12 -0
  2. package/dist/chat-proxy.d.ts.map +1 -0
  3. package/dist/chat-proxy.js +44 -0
  4. package/dist/chat-proxy.js.map +1 -0
  5. package/dist/docs-access-express.d.ts +16 -0
  6. package/dist/docs-access-express.d.ts.map +1 -0
  7. package/dist/docs-access-express.js +187 -0
  8. package/dist/docs-access-express.js.map +1 -0
  9. package/dist/index.d.ts +64 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +134 -0
  12. package/dist/index.js.map +1 -0
  13. package/package.json +36 -0
  14. package/static/assets/index-2Nv3pxOm.css +1 -0
  15. package/static/assets/index-6tehJlKh.js +214 -0
  16. package/static/assets/index-B148KlKZ.js +247 -0
  17. package/static/assets/index-B7AxOqhh.js +247 -0
  18. package/static/assets/index-BAVM9zLs.css +1 -0
  19. package/static/assets/index-BD4qyClR.js +216 -0
  20. package/static/assets/index-BZaQe_xi.css +1 -0
  21. package/static/assets/index-BjWlpH_h.js +216 -0
  22. package/static/assets/index-BmiFV0rx.css +1 -0
  23. package/static/assets/index-BqIvYIJT.js +247 -0
  24. package/static/assets/index-BwOiuEB4.js +216 -0
  25. package/static/assets/index-C372jkHK.js +214 -0
  26. package/static/assets/index-C9S9wEor.js +217 -0
  27. package/static/assets/index-Cd9PPQz6.css +1 -0
  28. package/static/assets/index-Cf2mt1FM.css +1 -0
  29. package/static/assets/index-Cfn42GaL.css +1 -0
  30. package/static/assets/index-Ckm4kbAk.css +1 -0
  31. package/static/assets/index-CzGmm9SR.css +1 -0
  32. package/static/assets/index-D0jOSazL.js +187 -0
  33. package/static/assets/index-D3-lCeHu.js +214 -0
  34. package/static/assets/index-DDRNEd4n.js +247 -0
  35. package/static/assets/index-DOyViYzn.js +247 -0
  36. package/static/assets/index-DZsbTHIg.js +214 -0
  37. package/static/assets/index-DaYbWEw0.js +190 -0
  38. package/static/assets/index-Djqsib7P.css +1 -0
  39. package/static/assets/index-Ds4IYSZ4.css +1 -0
  40. package/static/assets/index-Dzo0Xwn5.css +1 -0
  41. package/static/assets/index-L47Yb4hH.js +187 -0
  42. package/static/assets/index-NKfaEJl0.css +1 -0
  43. package/static/assets/index-U9Pdo8dD.js +214 -0
  44. package/static/assets/index-UVEGH1D3.css +1 -0
  45. package/static/assets/index-mZYiGRwU.css +1 -0
  46. package/static/assets/index-pOjZ5m-I.js +247 -0
  47. package/static/assets/index-rCcLuTWw.js +216 -0
  48. package/static/index.html +21 -0
@@ -0,0 +1,216 @@
1
+ var Wy=Object.defineProperty;var Yy=(t,r,i)=>r in t?Wy(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i;var ma=(t,r,i)=>Yy(t,typeof r!="symbol"?r+"":r,i);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))a(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function i(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function a(u){if(u.ep)return;u.ep=!0;const f=i(u);fetch(u.href,f)}})();var Xy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Yc={exports:{}},ga={},Xc={exports:{}},pt={};/**
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 Fp;function Qy(){if(Fp)return pt;Fp=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),d=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),x=Symbol.iterator;function b(O){return O===null||typeof O!="object"?null:(O=x&&O[x]||O["@@iterator"],typeof O=="function"?O:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,A={};function T(O,B,be){this.props=O,this.context=B,this.refs=A,this.updater=be||N}T.prototype.isReactComponent={},T.prototype.setState=function(O,B){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,B,"setState")},T.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function $(){}$.prototype=T.prototype;function H(O,B,be){this.props=O,this.context=B,this.refs=A,this.updater=be||N}var M=H.prototype=new $;M.constructor=H,C(M,T.prototype),M.isPureReactComponent=!0;var R=Array.isArray,X=Object.prototype.hasOwnProperty,V={current:null},U={key:!0,ref:!0,__self:!0,__source:!0};function le(O,B,be){var _e,$e={},Ie=null,ze=null;if(B!=null)for(_e in B.ref!==void 0&&(ze=B.ref),B.key!==void 0&&(Ie=""+B.key),B)X.call(B,_e)&&!U.hasOwnProperty(_e)&&($e[_e]=B[_e]);var we=arguments.length-2;if(we===1)$e.children=be;else if(1<we){for(var Le=Array(we),ke=0;ke<we;ke++)Le[ke]=arguments[ke+2];$e.children=Le}if(O&&O.defaultProps)for(_e in we=O.defaultProps,we)$e[_e]===void 0&&($e[_e]=we[_e]);return{$$typeof:t,type:O,key:Ie,ref:ze,props:$e,_owner:V.current}}function he(O,B){return{$$typeof:t,type:O.type,key:B,ref:O.ref,props:O.props,_owner:O._owner}}function Se(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function W(O){var B={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(be){return B[be]})}var ue=/\/+/g;function xe(O,B){return typeof O=="object"&&O!==null&&O.key!=null?W(""+O.key):B.toString(36)}function D(O,B,be,_e,$e){var Ie=typeof O;(Ie==="undefined"||Ie==="boolean")&&(O=null);var ze=!1;if(O===null)ze=!0;else switch(Ie){case"string":case"number":ze=!0;break;case"object":switch(O.$$typeof){case t:case r:ze=!0}}if(ze)return ze=O,$e=$e(ze),O=_e===""?"."+xe(ze,0):_e,R($e)?(be="",O!=null&&(be=O.replace(ue,"$&/")+"/"),D($e,B,be,"",function(ke){return ke})):$e!=null&&(Se($e)&&($e=he($e,be+(!$e.key||ze&&ze.key===$e.key?"":(""+$e.key).replace(ue,"$&/")+"/")+O)),B.push($e)),1;if(ze=0,_e=_e===""?".":_e+":",R(O))for(var we=0;we<O.length;we++){Ie=O[we];var Le=_e+xe(Ie,we);ze+=D(Ie,B,be,Le,$e)}else if(Le=b(O),typeof Le=="function")for(O=Le.call(O),we=0;!(Ie=O.next()).done;)Ie=Ie.value,Le=_e+xe(Ie,we++),ze+=D(Ie,B,be,Le,$e);else if(Ie==="object")throw B=String(O),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.");return ze}function ce(O,B,be){if(O==null)return O;var _e=[],$e=0;return D(O,_e,"","",function(Ie){return B.call(be,Ie,$e++)}),_e}function te(O){if(O._status===-1){var B=O._result;B=B(),B.then(function(be){(O._status===0||O._status===-1)&&(O._status=1,O._result=be)},function(be){(O._status===0||O._status===-1)&&(O._status=2,O._result=be)}),O._status===-1&&(O._status=0,O._result=B)}if(O._status===1)return O._result.default;throw O._result}var ae={current:null},L={transition:null},F={ReactCurrentDispatcher:ae,ReactCurrentBatchConfig:L,ReactCurrentOwner:V};function Q(){throw Error("act(...) is not supported in production builds of React.")}return pt.Children={map:ce,forEach:function(O,B,be){ce(O,function(){B.apply(this,arguments)},be)},count:function(O){var B=0;return ce(O,function(){B++}),B},toArray:function(O){return ce(O,function(B){return B})||[]},only:function(O){if(!Se(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},pt.Component=T,pt.Fragment=i,pt.Profiler=u,pt.PureComponent=H,pt.StrictMode=a,pt.Suspense=v,pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F,pt.act=Q,pt.cloneElement=function(O,B,be){if(O==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+O+".");var _e=C({},O.props),$e=O.key,Ie=O.ref,ze=O._owner;if(B!=null){if(B.ref!==void 0&&(Ie=B.ref,ze=V.current),B.key!==void 0&&($e=""+B.key),O.type&&O.type.defaultProps)var we=O.type.defaultProps;for(Le in B)X.call(B,Le)&&!U.hasOwnProperty(Le)&&(_e[Le]=B[Le]===void 0&&we!==void 0?we[Le]:B[Le])}var Le=arguments.length-2;if(Le===1)_e.children=be;else if(1<Le){we=Array(Le);for(var ke=0;ke<Le;ke++)we[ke]=arguments[ke+2];_e.children=we}return{$$typeof:t,type:O.type,key:$e,ref:Ie,props:_e,_owner:ze}},pt.createContext=function(O){return O={$$typeof:d,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},O.Provider={$$typeof:f,_context:O},O.Consumer=O},pt.createElement=le,pt.createFactory=function(O){var B=le.bind(null,O);return B.type=O,B},pt.createRef=function(){return{current:null}},pt.forwardRef=function(O){return{$$typeof:g,render:O}},pt.isValidElement=Se,pt.lazy=function(O){return{$$typeof:S,_payload:{_status:-1,_result:O},_init:te}},pt.memo=function(O,B){return{$$typeof:w,type:O,compare:B===void 0?null:B}},pt.startTransition=function(O){var B=L.transition;L.transition={};try{O()}finally{L.transition=B}},pt.unstable_act=Q,pt.useCallback=function(O,B){return ae.current.useCallback(O,B)},pt.useContext=function(O){return ae.current.useContext(O)},pt.useDebugValue=function(){},pt.useDeferredValue=function(O){return ae.current.useDeferredValue(O)},pt.useEffect=function(O,B){return ae.current.useEffect(O,B)},pt.useId=function(){return ae.current.useId()},pt.useImperativeHandle=function(O,B,be){return ae.current.useImperativeHandle(O,B,be)},pt.useInsertionEffect=function(O,B){return ae.current.useInsertionEffect(O,B)},pt.useLayoutEffect=function(O,B){return ae.current.useLayoutEffect(O,B)},pt.useMemo=function(O,B){return ae.current.useMemo(O,B)},pt.useReducer=function(O,B,be){return ae.current.useReducer(O,B,be)},pt.useRef=function(O){return ae.current.useRef(O)},pt.useState=function(O){return ae.current.useState(O)},pt.useSyncExternalStore=function(O,B,be){return ae.current.useSyncExternalStore(O,B,be)},pt.useTransition=function(){return ae.current.useTransition()},pt.version="18.3.1",pt}var Bp;function Ia(){return Bp||(Bp=1,Xc.exports=Qy()),Xc.exports}/**
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 Hp;function Gy(){if(Hp)return ga;Hp=1;var t=Ia(),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,u=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function d(g,v,w){var S,x={},b=null,N=null;w!==void 0&&(b=""+w),v.key!==void 0&&(b=""+v.key),v.ref!==void 0&&(N=v.ref);for(S in v)a.call(v,S)&&!f.hasOwnProperty(S)&&(x[S]=v[S]);if(g&&g.defaultProps)for(S in v=g.defaultProps,v)x[S]===void 0&&(x[S]=v[S]);return{$$typeof:r,type:g,key:b,ref:N,props:x,_owner:u.current}}return ga.Fragment=i,ga.jsx=d,ga.jsxs=d,ga}var Vp;function Zy(){return Vp||(Vp=1,Yc.exports=Gy()),Yc.exports}var P=Zy(),de=Ia();const am=yu(de);var Hl={},Qc={exports:{}},Fn={},Gc={exports:{}},Zc={};/**
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
+ */var Kp;function Jy(){return Kp||(Kp=1,(function(t){function r(L,F){var Q=L.length;L.push(F);e:for(;0<Q;){var O=Q-1>>>1,B=L[O];if(0<u(B,F))L[O]=F,L[Q]=B,Q=O;else break e}}function i(L){return L.length===0?null:L[0]}function a(L){if(L.length===0)return null;var F=L[0],Q=L.pop();if(Q!==F){L[0]=Q;e:for(var O=0,B=L.length,be=B>>>1;O<be;){var _e=2*(O+1)-1,$e=L[_e],Ie=_e+1,ze=L[Ie];if(0>u($e,Q))Ie<B&&0>u(ze,$e)?(L[O]=ze,L[Ie]=Q,O=Ie):(L[O]=$e,L[_e]=Q,O=_e);else if(Ie<B&&0>u(ze,Q))L[O]=ze,L[Ie]=Q,O=Ie;else break e}}return F}function u(L,F){var Q=L.sortIndex-F.sortIndex;return Q!==0?Q:L.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;t.unstable_now=function(){return f.now()}}else{var d=Date,g=d.now();t.unstable_now=function(){return d.now()-g}}var v=[],w=[],S=1,x=null,b=3,N=!1,C=!1,A=!1,T=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,H=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(L){for(var F=i(w);F!==null;){if(F.callback===null)a(w);else if(F.startTime<=L)a(w),F.sortIndex=F.expirationTime,r(v,F);else break;F=i(w)}}function R(L){if(A=!1,M(L),!C)if(i(v)!==null)C=!0,te(X);else{var F=i(w);F!==null&&ae(R,F.startTime-L)}}function X(L,F){C=!1,A&&(A=!1,$(le),le=-1),N=!0;var Q=b;try{for(M(F),x=i(v);x!==null&&(!(x.expirationTime>F)||L&&!W());){var O=x.callback;if(typeof O=="function"){x.callback=null,b=x.priorityLevel;var B=O(x.expirationTime<=F);F=t.unstable_now(),typeof B=="function"?x.callback=B:x===i(v)&&a(v),M(F)}else a(v);x=i(v)}if(x!==null)var be=!0;else{var _e=i(w);_e!==null&&ae(R,_e.startTime-F),be=!1}return be}finally{x=null,b=Q,N=!1}}var V=!1,U=null,le=-1,he=5,Se=-1;function W(){return!(t.unstable_now()-Se<he)}function ue(){if(U!==null){var L=t.unstable_now();Se=L;var F=!0;try{F=U(!0,L)}finally{F?xe():(V=!1,U=null)}}else V=!1}var xe;if(typeof H=="function")xe=function(){H(ue)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,ce=D.port2;D.port1.onmessage=ue,xe=function(){ce.postMessage(null)}}else xe=function(){T(ue,0)};function te(L){U=L,V||(V=!0,xe())}function ae(L,F){le=T(function(){L(t.unstable_now())},F)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(L){L.callback=null},t.unstable_continueExecution=function(){C||N||(C=!0,te(X))},t.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):he=0<L?Math.floor(1e3/L):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_getFirstCallbackNode=function(){return i(v)},t.unstable_next=function(L){switch(b){case 1:case 2:case 3:var F=3;break;default:F=b}var Q=b;b=F;try{return L()}finally{b=Q}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(L,F){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var Q=b;b=L;try{return F()}finally{b=Q}},t.unstable_scheduleCallback=function(L,F,Q){var O=t.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?O+Q:O):Q=O,L){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=Q+B,L={id:S++,callback:F,priorityLevel:L,startTime:Q,expirationTime:B,sortIndex:-1},Q>O?(L.sortIndex=Q,r(w,L),i(v)===null&&L===i(w)&&(A?($(le),le=-1):A=!0,ae(R,Q-O))):(L.sortIndex=B,r(v,L),C||N||(C=!0,te(X))),L},t.unstable_shouldYield=W,t.unstable_wrapCallback=function(L){var F=b;return function(){var Q=b;b=F;try{return L.apply(this,arguments)}finally{b=Q}}}})(Zc)),Zc}var Up;function e0(){return Up||(Up=1,Gc.exports=Jy()),Gc.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 qp;function t0(){if(qp)return Fn;qp=1;var t=Ia(),r=e0();function i(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,u={};function f(e,n){d(e,n),d(e+"Capture",n)}function d(e,n){for(u[e]=n,e=0;e<n.length;e++)a.add(n[e])}var g=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),v=Object.prototype.hasOwnProperty,w=/^[: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]*$/,S={},x={};function b(e){return v.call(x,e)?!0:v.call(S,e)?!1:w.test(e)?x[e]=!0:(S[e]=!0,!1)}function N(e,n,o,l){if(o!==null&&o.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return l?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function C(e,n,o,l){if(n===null||typeof n>"u"||N(e,n,o,l))return!0;if(l)return!1;if(o!==null)switch(o.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function A(e,n,o,l,p,m,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=l,this.attributeNamespace=p,this.mustUseProperty=o,this.propertyName=e,this.type=n,this.sanitizeURL=m,this.removeEmptyString=E}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){T[e]=new A(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];T[n]=new A(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){T[e]=new A(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){T[e]=new A(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){T[e]=new A(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){T[e]=new A(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){T[e]=new A(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){T[e]=new A(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){T[e]=new A(e,5,!1,e.toLowerCase(),null,!1,!1)});var $=/[\-:]([a-z])/g;function H(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 n=e.replace($,H);T[n]=new A(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace($,H);T[n]=new A(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace($,H);T[n]=new A(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){T[e]=new A(e,1,!1,e.toLowerCase(),null,!1,!1)}),T.xlinkHref=new A("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){T[e]=new A(e,1,!1,e.toLowerCase(),null,!0,!0)});function M(e,n,o,l){var p=T.hasOwnProperty(n)?T[n]:null;(p!==null?p.type!==0:l||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(C(n,o,p,l)&&(o=null),l||p===null?b(n)&&(o===null?e.removeAttribute(n):e.setAttribute(n,""+o)):p.mustUseProperty?e[p.propertyName]=o===null?p.type===3?!1:"":o:(n=p.attributeName,l=p.attributeNamespace,o===null?e.removeAttribute(n):(p=p.type,o=p===3||p===4&&o===!0?"":""+o,l?e.setAttributeNS(l,n,o):e.setAttribute(n,o))))}var R=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,X=Symbol.for("react.element"),V=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),le=Symbol.for("react.strict_mode"),he=Symbol.for("react.profiler"),Se=Symbol.for("react.provider"),W=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),xe=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),ce=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),ae=Symbol.for("react.offscreen"),L=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=L&&e[L]||e["@@iterator"],typeof e=="function"?e:null)}var Q=Object.assign,O;function B(e){if(O===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);O=n&&n[1]||""}return`
34
+ `+O+e}var be=!1;function _e(e,n){if(!e||be)return"";be=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(ye){var l=ye}Reflect.construct(e,[],n)}else{try{n.call()}catch(ye){l=ye}e.call(n.prototype)}else{try{throw Error()}catch(ye){l=ye}e()}}catch(ye){if(ye&&l&&typeof ye.stack=="string"){for(var p=ye.stack.split(`
35
+ `),m=l.stack.split(`
36
+ `),E=p.length-1,z=m.length-1;1<=E&&0<=z&&p[E]!==m[z];)z--;for(;1<=E&&0<=z;E--,z--)if(p[E]!==m[z]){if(E!==1||z!==1)do if(E--,z--,0>z||p[E]!==m[z]){var K=`
37
+ `+p[E].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),K}while(1<=E&&0<=z);break}}}finally{be=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?B(e):""}function $e(e){switch(e.tag){case 5:return B(e.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return e=_e(e.type,!1),e;case 11:return e=_e(e.type.render,!1),e;case 1:return e=_e(e.type,!0),e;default:return""}}function Ie(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 U:return"Fragment";case V:return"Portal";case he:return"Profiler";case le:return"StrictMode";case xe:return"Suspense";case D:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case W:return(e.displayName||"Context")+".Consumer";case Se:return(e._context.displayName||"Context")+".Provider";case ue:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ce:return n=e.displayName||null,n!==null?n:Ie(e.type)||"Memo";case te:n=e._payload,e=e._init;try{return Ie(e(n))}catch{}}return null}function ze(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ie(n);case 8:return n===le?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function we(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Le(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ke(e){var n=Le(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),l=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var p=o.get,m=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return p.call(this)},set:function(E){l=""+E,m.call(this,E)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(E){l=""+E},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Je(e){e._valueTracker||(e._valueTracker=ke(e))}function Oe(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),l="";return e&&(l=Le(e)?e.checked?"true":"false":e.value),e=l,e!==o?(n.setValue(e),!0):!1}function Ye(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 et(e,n){var o=n.checked;return Q({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function ft(e,n){var o=n.defaultValue==null?"":n.defaultValue,l=n.checked!=null?n.checked:n.defaultChecked;o=we(n.value!=null?n.value:o),e._wrapperState={initialChecked:l,initialValue:o,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function lt(e,n){n=n.checked,n!=null&&M(e,"checked",n,!1)}function kt(e,n){lt(e,n);var o=we(n.value),l=n.type;if(o!=null)l==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?on(e,n.type,o):n.hasOwnProperty("defaultValue")&&on(e,n.type,we(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function dn(e,n,o){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var l=n.type;if(!(l!=="submit"&&l!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,o||n===e.value||(e.value=n),e.defaultValue=n}o=e.name,o!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,o!==""&&(e.name=o)}function on(e,n,o){(n!=="number"||Ye(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var Wt=Array.isArray;function Nt(e,n,o,l){if(e=e.options,n){n={};for(var p=0;p<o.length;p++)n["$"+o[p]]=!0;for(o=0;o<e.length;o++)p=n.hasOwnProperty("$"+e[o].value),e[o].selected!==p&&(e[o].selected=p),p&&l&&(e[o].defaultSelected=!0)}else{for(o=""+we(o),n=null,p=0;p<e.length;p++){if(e[p].value===o){e[p].selected=!0,l&&(e[p].defaultSelected=!0);return}n!==null||e[p].disabled||(n=e[p])}n!==null&&(n.selected=!0)}}function jn(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return Q({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function pn(e,n){var o=n.value;if(o==null){if(o=n.children,n=n.defaultValue,o!=null){if(n!=null)throw Error(i(92));if(Wt(o)){if(1<o.length)throw Error(i(93));o=o[0]}n=o}n==null&&(n=""),o=n}e._wrapperState={initialValue:we(o)}}function Jn(e,n){var o=we(n.value),l=we(n.defaultValue);o!=null&&(o=""+o,o!==e.value&&(e.value=o),n.defaultValue==null&&e.defaultValue!==o&&(e.defaultValue=o)),l!=null&&(e.defaultValue=""+l)}function Sn(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function Ct(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 Yt(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?Ct(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Hn,er=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,o,l,p){MSApp.execUnsafeLocalFunction(function(){return e(n,o,l,p)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(Hn=Hn||document.createElement("div"),Hn.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=Hn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Ht(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var hn={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},Vn=["Webkit","ms","Moz","O"];Object.keys(hn).forEach(function(e){Vn.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),hn[n]=hn[e]})});function gr(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||hn.hasOwnProperty(e)&&hn[e]?(""+n).trim():n+"px"}function Rr(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var l=o.indexOf("--")===0,p=gr(o,n[o],l);o==="float"&&(o="cssFloat"),l?e.setProperty(o,p):e[o]=p}}var bn=Q({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 Ue(e,n){if(n){if(bn[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(i(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(i(61))}if(n.style!=null&&typeof n.style!="object")throw Error(i(62))}}function Kn(e,n){if(e.indexOf("-")===-1)return typeof n.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 kn=null;function tr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fe=null,Mn=null,Un=null;function yr(e){if(e=ea(e)){if(typeof Fe!="function")throw Error(i(280));var n=e.stateNode;n&&(n=rl(n),Fe(e.stateNode,e.type,n))}}function q(e){Mn?Un?Un.push(e):Un=[e]:Mn=e}function Be(){if(Mn){var e=Mn,n=Un;if(Un=Mn=null,yr(e),n)for(e=0;e<n.length;e++)yr(n[e])}}function Ze(e,n){return e(n)}function dt(){}var Lt=!1;function Xt(e,n,o){if(Lt)return e(n,o);Lt=!0;try{return Ze(e,n,o)}finally{Lt=!1,(Mn!==null||Un!==null)&&(dt(),Be())}}function Vt(e,n){var o=e.stateNode;if(o===null)return null;var l=rl(o);if(l===null)return null;o=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(i(231,n,typeof o));return o}var sn=!1;if(g)try{var ht={};Object.defineProperty(ht,"passive",{get:function(){sn=!0}}),window.addEventListener("test",ht,ht),window.removeEventListener("test",ht,ht)}catch{sn=!1}function bt(e,n,o,l,p,m,E,z,K){var ye=Array.prototype.slice.call(arguments,3);try{n.apply(o,ye)}catch(je){this.onError(je)}}var nr=!1,Tn=null,In=!1,En=null,ai={onError:function(e){nr=!0,Tn=e}};function rr(e,n,o,l,p,m,E,z,K){nr=!1,Tn=null,bt.apply(ai,arguments)}function zr(e,n,o,l,p,m,E,z,K){if(rr.apply(this,arguments),nr){if(nr){var ye=Tn;nr=!1,Tn=null}else throw Error(i(198));In||(In=!0,En=ye)}}function Qt(e){var n=e,o=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(o=n.return),e=n.return;while(e)}return n.tag===3?o:null}function Dr(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function li(e){if(Qt(e)!==e)throw Error(i(188))}function or(e){var n=e.alternate;if(!n){if(n=Qt(e),n===null)throw Error(i(188));return n!==e?null:e}for(var o=e,l=n;;){var p=o.return;if(p===null)break;var m=p.alternate;if(m===null){if(l=p.return,l!==null){o=l;continue}break}if(p.child===m.child){for(m=p.child;m;){if(m===o)return li(p),e;if(m===l)return li(p),n;m=m.sibling}throw Error(i(188))}if(o.return!==l.return)o=p,l=m;else{for(var E=!1,z=p.child;z;){if(z===o){E=!0,o=p,l=m;break}if(z===l){E=!0,l=p,o=m;break}z=z.sibling}if(!E){for(z=m.child;z;){if(z===o){E=!0,o=m,l=p;break}if(z===l){E=!0,l=m,o=p;break}z=z.sibling}if(!E)throw Error(i(189))}}if(o.alternate!==l)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?e:n}function ui(e){return e=or(e),e!==null?ir(e):null}function ir(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=ir(e);if(n!==null)return n;e=e.sibling}return null}var ci=r.unstable_scheduleCallback,To=r.unstable_cancelCallback,Pt=r.unstable_shouldYield,sr=r.unstable_requestPaint,yt=r.unstable_now,Bi=r.unstable_getCurrentPriorityLevel,Lr=r.unstable_ImmediatePriority,Io=r.unstable_UserBlockingPriority,Fr=r.unstable_NormalPriority,vr=r.unstable_LowPriority,fi=r.unstable_IdlePriority,ar=null,Nn=null;function ut(e){if(Nn&&typeof Nn.onCommitFiberRoot=="function")try{Nn.onCommitFiberRoot(ar,e,void 0,(e.current.flags&128)===128)}catch{}}var mn=Math.clz32?Math.clz32:to,Hi=Math.log,Ao=Math.LN2;function to(e){return e>>>=0,e===0?32:31-(Hi(e)/Ao|0)|0}var no=64,ro=4194304;function qn(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 vt(e,n){var o=e.pendingLanes;if(o===0)return 0;var l=0,p=e.suspendedLanes,m=e.pingedLanes,E=o&268435455;if(E!==0){var z=E&~p;z!==0?l=qn(z):(m&=E,m!==0&&(l=qn(m)))}else E=o&~p,E!==0?l=qn(E):m!==0&&(l=qn(m));if(l===0)return 0;if(n!==0&&n!==l&&(n&p)===0&&(p=l&-l,m=n&-n,p>=m||p===16&&(m&4194240)!==0))return n;if((l&4)!==0&&(l|=o&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=l;0<n;)o=31-mn(n),p=1<<o,l|=e[o],n&=~p;return l}function Br(e,n){switch(e){case 1:case 2:case 4:return n+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 n+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 oo(e,n){for(var o=e.suspendedLanes,l=e.pingedLanes,p=e.expirationTimes,m=e.pendingLanes;0<m;){var E=31-mn(m),z=1<<E,K=p[E];K===-1?((z&o)===0||(z&l)!==0)&&(p[E]=Br(z,n)):K<=n&&(e.expiredLanes|=z),m&=~z}}function lr(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Hr(){var e=no;return no<<=1,(no&4194240)===0&&(no=64),e}function io(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function ur(e,n,o){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-mn(n),e[n]=o}function di(e,n){var o=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<o;){var p=31-mn(o),m=1<<p;n[p]=0,l[p]=-1,e[p]=-1,o&=~m}}function $o(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var l=31-mn(o),p=1<<l;p&n|e[l]&n&&(e[l]|=n),o&=~p}}var wt=0;function Fa(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var mt,Vi,Ba,Ha,gn,Vr=!1,so=[],an=null,xr=null,wr=null,At=new Map,ln=new Map,An=[],pi="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 Ki(e,n){switch(e){case"focusin":case"focusout":an=null;break;case"dragenter":case"dragleave":xr=null;break;case"mouseover":case"mouseout":wr=null;break;case"pointerover":case"pointerout":At.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":ln.delete(n.pointerId)}}function $n(e,n,o,l,p,m){return e===null||e.nativeEvent!==m?(e={blockedOn:n,domEventName:o,eventSystemFlags:l,nativeEvent:m,targetContainers:[p]},n!==null&&(n=ea(n),n!==null&&Vi(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,p!==null&&n.indexOf(p)===-1&&n.push(p),e)}function Iu(e,n,o,l,p){switch(n){case"focusin":return an=$n(an,e,n,o,l,p),!0;case"dragenter":return xr=$n(xr,e,n,o,l,p),!0;case"mouseover":return wr=$n(wr,e,n,o,l,p),!0;case"pointerover":var m=p.pointerId;return At.set(m,$n(At.get(m)||null,e,n,o,l,p)),!0;case"gotpointercapture":return m=p.pointerId,ln.set(m,$n(ln.get(m)||null,e,n,o,l,p)),!0}return!1}function Wn(e){var n=_i(e.target);if(n!==null){var o=Qt(n);if(o!==null){if(n=o.tag,n===13){if(n=Dr(o),n!==null){e.blockedOn=n,gn(e.priority,function(){Ba(o)});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Oo(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=Ro(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(o===null){o=e.nativeEvent;var l=new o.constructor(o.type,o);kn=l,o.target.dispatchEvent(l),kn=null}else return n=ea(o),n!==null&&Vi(n),e.blockedOn=o,!1;n.shift()}return!0}function Rs(e,n,o){Oo(e)&&o.delete(n)}function zs(){Vr=!1,an!==null&&Oo(an)&&(an=null),xr!==null&&Oo(xr)&&(xr=null),wr!==null&&Oo(wr)&&(wr=null),At.forEach(Rs),ln.forEach(Rs)}function _r(e,n){e.blockedOn===n&&(e.blockedOn=null,Vr||(Vr=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,zs)))}function ao(e){function n(p){return _r(p,e)}if(0<so.length){_r(so[0],e);for(var o=1;o<so.length;o++){var l=so[o];l.blockedOn===e&&(l.blockedOn=null)}}for(an!==null&&_r(an,e),xr!==null&&_r(xr,e),wr!==null&&_r(wr,e),At.forEach(n),ln.forEach(n),o=0;o<An.length;o++)l=An[o],l.blockedOn===e&&(l.blockedOn=null);for(;0<An.length&&(o=An[0],o.blockedOn===null);)Wn(o),o.blockedOn===null&&An.shift()}var lo=R.ReactCurrentBatchConfig,Ui=!0;function hi(e,n,o,l){var p=wt,m=lo.transition;lo.transition=null;try{wt=1,Ds(e,n,o,l)}finally{wt=p,lo.transition=m}}function Au(e,n,o,l){var p=wt,m=lo.transition;lo.transition=null;try{wt=4,Ds(e,n,o,l)}finally{wt=p,lo.transition=m}}function Ds(e,n,o,l){if(Ui){var p=Ro(e,n,o,l);if(p===null)Du(e,n,l,uo,o),Ki(e,l);else if(Iu(p,e,n,o,l))l.stopPropagation();else if(Ki(e,l),n&4&&-1<pi.indexOf(e)){for(;p!==null;){var m=ea(p);if(m!==null&&mt(m),m=Ro(e,n,o,l),m===null&&Du(e,n,l,uo,o),m===p)break;p=m}p!==null&&l.stopPropagation()}else Du(e,n,l,null,o)}}var uo=null;function Ro(e,n,o,l){if(uo=null,e=tr(l),e=_i(e),e!==null)if(n=Qt(e),n===null)e=null;else if(o=n.tag,o===13){if(e=Dr(n),e!==null)return e;e=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return uo=e,null}function qi(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(Bi()){case Lr:return 1;case Io:return 4;case Fr:case vr:return 16;case fi:return 536870912;default:return 16}default:return 16}}var Kr=null,Ls=null,Wi=null;function Yi(){if(Wi)return Wi;var e,n=Ls,o=n.length,l,p="value"in Kr?Kr.value:Kr.textContent,m=p.length;for(e=0;e<o&&n[e]===p[e];e++);var E=o-e;for(l=1;l<=E&&n[o-l]===p[m-l];l++);return Wi=p.slice(e,1<l?1-l:void 0)}function zo(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function mi(){return!0}function gi(){return!1}function Jt(e){function n(o,l,p,m,E){this._reactName=o,this._targetInst=p,this.type=l,this.nativeEvent=m,this.target=E,this.currentTarget=null;for(var z in e)e.hasOwnProperty(z)&&(o=e[z],this[z]=o?o(m):m[z]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?mi:gi,this.isPropagationStopped=gi,this}return Q(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=mi)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=mi)},persist:function(){},isPersistent:mi}),n}var Sr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xi=Jt(Sr),yi=Q({},Sr,{view:0,detail:0}),Do=Jt(yi),co,vi,fo,Lo=Q({},yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ts,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!==fo&&(fo&&e.type==="mousemove"?(co=e.screenX-fo.screenX,vi=e.screenY-fo.screenY):vi=co=0,fo=e),co)},movementY:function(e){return"movementY"in e?e.movementY:vi}}),Qi=Jt(Lo),en=Q({},Lo,{dataTransfer:0}),xi=Jt(en),wi=Q({},yi,{relatedTarget:0}),Gi=Jt(wi),Zi=Q({},Sr,{animationName:0,elapsedTime:0,pseudoElement:0}),Va=Jt(Zi),Ka=Q({},Sr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ji=Jt(Ka),Fs=Q({},Sr,{data:0}),Ur=Jt(Fs),Bs={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Hs={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"},es={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Vs(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=es[e])?!!n[e]:!1}function ts(){return Vs}var $u=Q({},yi,{key:function(e){if(e.key){var n=Bs[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=zo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Hs[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ts,charCode:function(e){return e.type==="keypress"?zo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ks=Jt($u),ns=Q({},Lo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ua=Jt(ns),Us=Q({},yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ts}),qs=Jt(Us),Ou=Q({},Sr,{propertyName:0,elapsedTime:0,pseudoElement:0}),qa=Jt(Ou),Ru=Q({},Lo,{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}),Wa=Jt(Ru),Ya=[9,13,27,32],Ws=g&&"CompositionEvent"in window,Fo=null;g&&"documentMode"in document&&(Fo=document.documentMode);var Ys=g&&"TextEvent"in window&&!Fo,Xs=g&&(!Ws||Fo&&8<Fo&&11>=Fo),Qs=" ",Xa=!1;function Qa(e,n){switch(e){case"keyup":return Ya.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ga(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var br=!1;function kr(e,n){switch(e){case"compositionend":return Ga(n);case"keypress":return n.which!==32?null:(Xa=!0,Qs);case"textInput":return e=n.data,e===Qs&&Xa?null:e;default:return null}}function Rt(e,n){if(br)return e==="compositionend"||!Ws&&Qa(e,n)?(e=Yi(),Wi=Ls=Kr=null,br=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Xs&&n.locale!=="ko"?null:n.data;default:return null}}var rs={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 po(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!rs[e.type]:n==="textarea"}function Za(e,n,o,l){q(l),n=el(n,"onChange"),0<n.length&&(o=new Xi("onChange","change",null,o,l),e.push({event:o,listeners:n}))}var ho=null,Bo=null;function mo(e){nd(e,0)}function Ho(e){var n=as(e);if(Oe(n))return e}function Vo(e,n){if(e==="change")return n}var Er=!1;if(g){var os;if(g){var s="oninput"in document;if(!s){var c=document.createElement("div");c.setAttribute("oninput","return;"),s=typeof c.oninput=="function"}os=s}else os=!1;Er=os&&(!document.documentMode||9<document.documentMode)}function h(){ho&&(ho.detachEvent("onpropertychange",y),Bo=ho=null)}function y(e){if(e.propertyName==="value"&&Ho(Bo)){var n=[];Za(n,Bo,e,tr(e)),Xt(mo,n)}}function _(e,n,o){e==="focusin"?(h(),ho=n,Bo=o,ho.attachEvent("onpropertychange",y)):e==="focusout"&&h()}function k(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ho(Bo)}function j(e,n){if(e==="click")return Ho(n)}function I(e,n){if(e==="input"||e==="change")return Ho(n)}function G(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var se=typeof Object.is=="function"?Object.is:G;function J(e,n){if(se(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var o=Object.keys(e),l=Object.keys(n);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var p=o[l];if(!v.call(n,p)||!se(e[p],n[p]))return!1}return!0}function Y(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Z(e,n){var o=Y(e);e=0;for(var l;o;){if(o.nodeType===3){if(l=e+o.textContent.length,e<=n&&l>=n)return{node:o,offset:n-e};e=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Y(o)}}function ie(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?ie(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function re(){for(var e=window,n=Ye();n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=Ye(e.document)}return n}function ne(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function oe(e){var n=re(),o=e.focusedElem,l=e.selectionRange;if(n!==o&&o&&o.ownerDocument&&ie(o.ownerDocument.documentElement,o)){if(l!==null&&ne(o)){if(n=l.start,e=l.end,e===void 0&&(e=n),"selectionStart"in o)o.selectionStart=n,o.selectionEnd=Math.min(e,o.value.length);else if(e=(n=o.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var p=o.textContent.length,m=Math.min(l.start,p);l=l.end===void 0?m:Math.min(l.end,p),!e.extend&&m>l&&(p=l,l=m,m=p),p=Z(o,m);var E=Z(o,l);p&&E&&(e.rangeCount!==1||e.anchorNode!==p.node||e.anchorOffset!==p.offset||e.focusNode!==E.node||e.focusOffset!==E.offset)&&(n=n.createRange(),n.setStart(p.node,p.offset),e.removeAllRanges(),m>l?(e.addRange(n),e.extend(E.node,E.offset)):(n.setEnd(E.node,E.offset),e.addRange(n)))}}for(n=[],e=o;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<n.length;o++)e=n[o],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ge=g&&"documentMode"in document&&11>=document.documentMode,fe=null,ve=null,Ee=null,Ce=!1;function Re(e,n,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Ce||fe==null||fe!==Ye(l)||(l=fe,"selectionStart"in l&&ne(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ee&&J(Ee,l)||(Ee=l,l=el(ve,"onSelect"),0<l.length&&(n=new Xi("onSelect","select",null,n,o),e.push({event:n,listeners:l}),n.target=fe)))}function Me(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var He={animationend:Me("Animation","AnimationEnd"),animationiteration:Me("Animation","AnimationIteration"),animationstart:Me("Animation","AnimationStart"),transitionend:Me("Transition","TransitionEnd")},Ae={},Ke={};g&&(Ke=document.createElement("div").style,"AnimationEvent"in window||(delete He.animationend.animation,delete He.animationiteration.animation,delete He.animationstart.animation),"TransitionEvent"in window||delete He.transitionend.transition);function Ne(e){if(Ae[e])return Ae[e];if(!He[e])return e;var n=He[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in Ke)return Ae[e]=n[o];return e}var rt=Ne("animationend"),ot=Ne("animationiteration"),at=Ne("animationstart"),ct=Ne("transitionend"),yn=new Map,st="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 jt(e,n){yn.set(e,n),f(n,[e])}for(var Kt=0;Kt<st.length;Kt++){var Ko=st[Kt],un=Ko.toLowerCase(),go=Ko[0].toUpperCase()+Ko.slice(1);jt(un,"on"+go)}jt(rt,"onAnimationEnd"),jt(ot,"onAnimationIteration"),jt(at,"onAnimationStart"),jt("dblclick","onDoubleClick"),jt("focusin","onFocus"),jt("focusout","onBlur"),jt(ct,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),f("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),f("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),f("onBeforeInput",["compositionend","keypress","textInput","paste"]),f("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yo="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(" "),oy=new Set("cancel close invalid load scroll toggle".split(" ").concat(yo));function td(e,n,o){var l=e.type||"unknown-event";e.currentTarget=o,zr(l,n,void 0,e),e.currentTarget=null}function nd(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var l=e[o],p=l.event;l=l.listeners;e:{var m=void 0;if(n)for(var E=l.length-1;0<=E;E--){var z=l[E],K=z.instance,ye=z.currentTarget;if(z=z.listener,K!==m&&p.isPropagationStopped())break e;td(p,z,ye),m=K}else for(E=0;E<l.length;E++){if(z=l[E],K=z.instance,ye=z.currentTarget,z=z.listener,K!==m&&p.isPropagationStopped())break e;td(p,z,ye),m=K}}}if(In)throw e=En,In=!1,En=null,e}function Mt(e,n){var o=n[Ku];o===void 0&&(o=n[Ku]=new Set);var l=e+"__bubble";o.has(l)||(rd(n,e,2,!1),o.add(l))}function zu(e,n,o){var l=0;n&&(l|=4),rd(o,e,l,n)}var Ja="_reactListening"+Math.random().toString(36).slice(2);function Gs(e){if(!e[Ja]){e[Ja]=!0,a.forEach(function(o){o!=="selectionchange"&&(oy.has(o)||zu(o,!1,e),zu(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Ja]||(n[Ja]=!0,zu("selectionchange",!1,n))}}function rd(e,n,o,l){switch(qi(n)){case 1:var p=hi;break;case 4:p=Au;break;default:p=Ds}o=p.bind(null,n,o,e),p=void 0,!sn||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(p=!0),l?p!==void 0?e.addEventListener(n,o,{capture:!0,passive:p}):e.addEventListener(n,o,!0):p!==void 0?e.addEventListener(n,o,{passive:p}):e.addEventListener(n,o,!1)}function Du(e,n,o,l,p){var m=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var E=l.tag;if(E===3||E===4){var z=l.stateNode.containerInfo;if(z===p||z.nodeType===8&&z.parentNode===p)break;if(E===4)for(E=l.return;E!==null;){var K=E.tag;if((K===3||K===4)&&(K=E.stateNode.containerInfo,K===p||K.nodeType===8&&K.parentNode===p))return;E=E.return}for(;z!==null;){if(E=_i(z),E===null)return;if(K=E.tag,K===5||K===6){l=m=E;continue e}z=z.parentNode}}l=l.return}Xt(function(){var ye=m,je=tr(o),Te=[];e:{var Pe=yn.get(e);if(Pe!==void 0){var Ve=Xi,We=e;switch(e){case"keypress":if(zo(o)===0)break e;case"keydown":case"keyup":Ve=Ks;break;case"focusin":We="focus",Ve=Gi;break;case"focusout":We="blur",Ve=Gi;break;case"beforeblur":case"afterblur":Ve=Gi;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ve=Qi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ve=xi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ve=qs;break;case rt:case ot:case at:Ve=Va;break;case ct:Ve=qa;break;case"scroll":Ve=Do;break;case"wheel":Ve=Wa;break;case"copy":case"cut":case"paste":Ve=Ji;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ve=Ua}var Xe=(n&4)!==0,Bt=!Xe&&e==="scroll",pe=Xe?Pe!==null?Pe+"Capture":null:Pe;Xe=[];for(var ee=ye,me;ee!==null;){me=ee;var De=me.stateNode;if(me.tag===5&&De!==null&&(me=De,pe!==null&&(De=Vt(ee,pe),De!=null&&Xe.push(Zs(ee,De,me)))),Bt)break;ee=ee.return}0<Xe.length&&(Pe=new Ve(Pe,We,null,o,je),Te.push({event:Pe,listeners:Xe}))}}if((n&7)===0){e:{if(Pe=e==="mouseover"||e==="pointerover",Ve=e==="mouseout"||e==="pointerout",Pe&&o!==kn&&(We=o.relatedTarget||o.fromElement)&&(_i(We)||We[vo]))break e;if((Ve||Pe)&&(Pe=je.window===je?je:(Pe=je.ownerDocument)?Pe.defaultView||Pe.parentWindow:window,Ve?(We=o.relatedTarget||o.toElement,Ve=ye,We=We?_i(We):null,We!==null&&(Bt=Qt(We),We!==Bt||We.tag!==5&&We.tag!==6)&&(We=null)):(Ve=null,We=ye),Ve!==We)){if(Xe=Qi,De="onMouseLeave",pe="onMouseEnter",ee="mouse",(e==="pointerout"||e==="pointerover")&&(Xe=Ua,De="onPointerLeave",pe="onPointerEnter",ee="pointer"),Bt=Ve==null?Pe:as(Ve),me=We==null?Pe:as(We),Pe=new Xe(De,ee+"leave",Ve,o,je),Pe.target=Bt,Pe.relatedTarget=me,De=null,_i(je)===ye&&(Xe=new Xe(pe,ee+"enter",We,o,je),Xe.target=me,Xe.relatedTarget=Bt,De=Xe),Bt=De,Ve&&We)t:{for(Xe=Ve,pe=We,ee=0,me=Xe;me;me=is(me))ee++;for(me=0,De=pe;De;De=is(De))me++;for(;0<ee-me;)Xe=is(Xe),ee--;for(;0<me-ee;)pe=is(pe),me--;for(;ee--;){if(Xe===pe||pe!==null&&Xe===pe.alternate)break t;Xe=is(Xe),pe=is(pe)}Xe=null}else Xe=null;Ve!==null&&od(Te,Pe,Ve,Xe,!1),We!==null&&Bt!==null&&od(Te,Bt,We,Xe,!0)}}e:{if(Pe=ye?as(ye):window,Ve=Pe.nodeName&&Pe.nodeName.toLowerCase(),Ve==="select"||Ve==="input"&&Pe.type==="file")var Qe=Vo;else if(po(Pe))if(Er)Qe=I;else{Qe=k;var tt=_}else(Ve=Pe.nodeName)&&Ve.toLowerCase()==="input"&&(Pe.type==="checkbox"||Pe.type==="radio")&&(Qe=j);if(Qe&&(Qe=Qe(e,ye))){Za(Te,Qe,o,je);break e}tt&&tt(e,Pe,ye),e==="focusout"&&(tt=Pe._wrapperState)&&tt.controlled&&Pe.type==="number"&&on(Pe,"number",Pe.value)}switch(tt=ye?as(ye):window,e){case"focusin":(po(tt)||tt.contentEditable==="true")&&(fe=tt,ve=ye,Ee=null);break;case"focusout":Ee=ve=fe=null;break;case"mousedown":Ce=!0;break;case"contextmenu":case"mouseup":case"dragend":Ce=!1,Re(Te,o,je);break;case"selectionchange":if(ge)break;case"keydown":case"keyup":Re(Te,o,je)}var nt;if(Ws)e:{switch(e){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else br?Qa(e,o)&&(it="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(it="onCompositionStart");it&&(Xs&&o.locale!=="ko"&&(br||it!=="onCompositionStart"?it==="onCompositionEnd"&&br&&(nt=Yi()):(Kr=je,Ls="value"in Kr?Kr.value:Kr.textContent,br=!0)),tt=el(ye,it),0<tt.length&&(it=new Ur(it,e,null,o,je),Te.push({event:it,listeners:tt}),nt?it.data=nt:(nt=Ga(o),nt!==null&&(it.data=nt)))),(nt=Ys?kr(e,o):Rt(e,o))&&(ye=el(ye,"onBeforeInput"),0<ye.length&&(je=new Ur("onBeforeInput","beforeinput",null,o,je),Te.push({event:je,listeners:ye}),je.data=nt))}nd(Te,n)})}function Zs(e,n,o){return{instance:e,listener:n,currentTarget:o}}function el(e,n){for(var o=n+"Capture",l=[];e!==null;){var p=e,m=p.stateNode;p.tag===5&&m!==null&&(p=m,m=Vt(e,o),m!=null&&l.unshift(Zs(e,m,p)),m=Vt(e,n),m!=null&&l.push(Zs(e,m,p))),e=e.return}return l}function is(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function od(e,n,o,l,p){for(var m=n._reactName,E=[];o!==null&&o!==l;){var z=o,K=z.alternate,ye=z.stateNode;if(K!==null&&K===l)break;z.tag===5&&ye!==null&&(z=ye,p?(K=Vt(o,m),K!=null&&E.unshift(Zs(o,K,z))):p||(K=Vt(o,m),K!=null&&E.push(Zs(o,K,z)))),o=o.return}E.length!==0&&e.push({event:n,listeners:E})}var iy=/\r\n?/g,sy=/\u0000|\uFFFD/g;function id(e){return(typeof e=="string"?e:""+e).replace(iy,`
38
+ `).replace(sy,"")}function tl(e,n,o){if(n=id(n),id(e)!==n&&o)throw Error(i(425))}function nl(){}var Lu=null,Fu=null;function Bu(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Hu=typeof setTimeout=="function"?setTimeout:void 0,ay=typeof clearTimeout=="function"?clearTimeout:void 0,sd=typeof Promise=="function"?Promise:void 0,ly=typeof queueMicrotask=="function"?queueMicrotask:typeof sd<"u"?function(e){return sd.resolve(null).then(e).catch(uy)}:Hu;function uy(e){setTimeout(function(){throw e})}function Vu(e,n){var o=n,l=0;do{var p=o.nextSibling;if(e.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"){if(l===0){e.removeChild(p),ao(n);return}l--}else o!=="$"&&o!=="$?"&&o!=="$!"||l++;o=p}while(o);ao(n)}function Uo(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function ad(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(n===0)return e;n--}else o==="/$"&&n++}e=e.previousSibling}return null}var ss=Math.random().toString(36).slice(2),qr="__reactFiber$"+ss,Js="__reactProps$"+ss,vo="__reactContainer$"+ss,Ku="__reactEvents$"+ss,cy="__reactListeners$"+ss,fy="__reactHandles$"+ss;function _i(e){var n=e[qr];if(n)return n;for(var o=e.parentNode;o;){if(n=o[vo]||o[qr]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=ad(e);e!==null;){if(o=e[qr])return o;e=ad(e)}return n}e=o,o=e.parentNode}return null}function ea(e){return e=e[qr]||e[vo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function as(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function rl(e){return e[Js]||null}var Uu=[],ls=-1;function qo(e){return{current:e}}function Tt(e){0>ls||(e.current=Uu[ls],Uu[ls]=null,ls--)}function Et(e,n){ls++,Uu[ls]=e.current,e.current=n}var Wo={},vn=qo(Wo),On=qo(!1),Si=Wo;function us(e,n){var o=e.type.contextTypes;if(!o)return Wo;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var p={},m;for(m in o)p[m]=n[m];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=p),p}function Rn(e){return e=e.childContextTypes,e!=null}function ol(){Tt(On),Tt(vn)}function ld(e,n,o){if(vn.current!==Wo)throw Error(i(168));Et(vn,n),Et(On,o)}function ud(e,n,o){var l=e.stateNode;if(n=n.childContextTypes,typeof l.getChildContext!="function")return o;l=l.getChildContext();for(var p in l)if(!(p in n))throw Error(i(108,ze(e)||"Unknown",p));return Q({},o,l)}function il(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wo,Si=vn.current,Et(vn,e),Et(On,On.current),!0}function cd(e,n,o){var l=e.stateNode;if(!l)throw Error(i(169));o?(e=ud(e,n,Si),l.__reactInternalMemoizedMergedChildContext=e,Tt(On),Tt(vn),Et(vn,e)):Tt(On),Et(On,o)}var xo=null,sl=!1,qu=!1;function fd(e){xo===null?xo=[e]:xo.push(e)}function dy(e){sl=!0,fd(e)}function Yo(){if(!qu&&xo!==null){qu=!0;var e=0,n=wt;try{var o=xo;for(wt=1;e<o.length;e++){var l=o[e];do l=l(!0);while(l!==null)}xo=null,sl=!1}catch(p){throw xo!==null&&(xo=xo.slice(e+1)),ci(Lr,Yo),p}finally{wt=n,qu=!1}}return null}var cs=[],fs=0,al=null,ll=0,cr=[],fr=0,bi=null,wo=1,_o="";function ki(e,n){cs[fs++]=ll,cs[fs++]=al,al=e,ll=n}function dd(e,n,o){cr[fr++]=wo,cr[fr++]=_o,cr[fr++]=bi,bi=e;var l=wo;e=_o;var p=32-mn(l)-1;l&=~(1<<p),o+=1;var m=32-mn(n)+p;if(30<m){var E=p-p%5;m=(l&(1<<E)-1).toString(32),l>>=E,p-=E,wo=1<<32-mn(n)+p|o<<p|l,_o=m+e}else wo=1<<m|o<<p|l,_o=e}function Wu(e){e.return!==null&&(ki(e,1),dd(e,1,0))}function Yu(e){for(;e===al;)al=cs[--fs],cs[fs]=null,ll=cs[--fs],cs[fs]=null;for(;e===bi;)bi=cr[--fr],cr[fr]=null,_o=cr[--fr],cr[fr]=null,wo=cr[--fr],cr[fr]=null}var Yn=null,Xn=null,$t=!1,Nr=null;function pd(e,n){var o=mr(5,null,null,0);o.elementType="DELETED",o.stateNode=n,o.return=e,n=e.deletions,n===null?(e.deletions=[o],e.flags|=16):n.push(o)}function hd(e,n){switch(e.tag){case 5:var o=e.type;return n=n.nodeType!==1||o.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,Yn=e,Xn=Uo(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Yn=e,Xn=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(o=bi!==null?{id:wo,overflow:_o}:null,e.memoizedState={dehydrated:n,treeContext:o,retryLane:1073741824},o=mr(18,null,null,0),o.stateNode=n,o.return=e,e.child=o,Yn=e,Xn=null,!0):!1;default:return!1}}function Xu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Qu(e){if($t){var n=Xn;if(n){var o=n;if(!hd(e,n)){if(Xu(e))throw Error(i(418));n=Uo(o.nextSibling);var l=Yn;n&&hd(e,n)?pd(l,o):(e.flags=e.flags&-4097|2,$t=!1,Yn=e)}}else{if(Xu(e))throw Error(i(418));e.flags=e.flags&-4097|2,$t=!1,Yn=e}}}function md(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Yn=e}function ul(e){if(e!==Yn)return!1;if(!$t)return md(e),$t=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Bu(e.type,e.memoizedProps)),n&&(n=Xn)){if(Xu(e))throw gd(),Error(i(418));for(;n;)pd(e,n),n=Uo(n.nextSibling)}if(md(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="/$"){if(n===0){Xn=Uo(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++}e=e.nextSibling}Xn=null}}else Xn=Yn?Uo(e.stateNode.nextSibling):null;return!0}function gd(){for(var e=Xn;e;)e=Uo(e.nextSibling)}function ds(){Xn=Yn=null,$t=!1}function Gu(e){Nr===null?Nr=[e]:Nr.push(e)}var py=R.ReactCurrentBatchConfig;function ta(e,n,o){if(e=o.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(o._owner){if(o=o._owner,o){if(o.tag!==1)throw Error(i(309));var l=o.stateNode}if(!l)throw Error(i(147,e));var p=l,m=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===m?n.ref:(n=function(E){var z=p.refs;E===null?delete z[m]:z[m]=E},n._stringRef=m,n)}if(typeof e!="string")throw Error(i(284));if(!o._owner)throw Error(i(290,e))}return e}function cl(e,n){throw e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function yd(e){var n=e._init;return n(e._payload)}function vd(e){function n(pe,ee){if(e){var me=pe.deletions;me===null?(pe.deletions=[ee],pe.flags|=16):me.push(ee)}}function o(pe,ee){if(!e)return null;for(;ee!==null;)n(pe,ee),ee=ee.sibling;return null}function l(pe,ee){for(pe=new Map;ee!==null;)ee.key!==null?pe.set(ee.key,ee):pe.set(ee.index,ee),ee=ee.sibling;return pe}function p(pe,ee){return pe=ni(pe,ee),pe.index=0,pe.sibling=null,pe}function m(pe,ee,me){return pe.index=me,e?(me=pe.alternate,me!==null?(me=me.index,me<ee?(pe.flags|=2,ee):me):(pe.flags|=2,ee)):(pe.flags|=1048576,ee)}function E(pe){return e&&pe.alternate===null&&(pe.flags|=2),pe}function z(pe,ee,me,De){return ee===null||ee.tag!==6?(ee=Hc(me,pe.mode,De),ee.return=pe,ee):(ee=p(ee,me),ee.return=pe,ee)}function K(pe,ee,me,De){var Qe=me.type;return Qe===U?je(pe,ee,me.props.children,De,me.key):ee!==null&&(ee.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===te&&yd(Qe)===ee.type)?(De=p(ee,me.props),De.ref=ta(pe,ee,me),De.return=pe,De):(De=$l(me.type,me.key,me.props,null,pe.mode,De),De.ref=ta(pe,ee,me),De.return=pe,De)}function ye(pe,ee,me,De){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==me.containerInfo||ee.stateNode.implementation!==me.implementation?(ee=Vc(me,pe.mode,De),ee.return=pe,ee):(ee=p(ee,me.children||[]),ee.return=pe,ee)}function je(pe,ee,me,De,Qe){return ee===null||ee.tag!==7?(ee=Ii(me,pe.mode,De,Qe),ee.return=pe,ee):(ee=p(ee,me),ee.return=pe,ee)}function Te(pe,ee,me){if(typeof ee=="string"&&ee!==""||typeof ee=="number")return ee=Hc(""+ee,pe.mode,me),ee.return=pe,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case X:return me=$l(ee.type,ee.key,ee.props,null,pe.mode,me),me.ref=ta(pe,null,ee),me.return=pe,me;case V:return ee=Vc(ee,pe.mode,me),ee.return=pe,ee;case te:var De=ee._init;return Te(pe,De(ee._payload),me)}if(Wt(ee)||F(ee))return ee=Ii(ee,pe.mode,me,null),ee.return=pe,ee;cl(pe,ee)}return null}function Pe(pe,ee,me,De){var Qe=ee!==null?ee.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return Qe!==null?null:z(pe,ee,""+me,De);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case X:return me.key===Qe?K(pe,ee,me,De):null;case V:return me.key===Qe?ye(pe,ee,me,De):null;case te:return Qe=me._init,Pe(pe,ee,Qe(me._payload),De)}if(Wt(me)||F(me))return Qe!==null?null:je(pe,ee,me,De,null);cl(pe,me)}return null}function Ve(pe,ee,me,De,Qe){if(typeof De=="string"&&De!==""||typeof De=="number")return pe=pe.get(me)||null,z(ee,pe,""+De,Qe);if(typeof De=="object"&&De!==null){switch(De.$$typeof){case X:return pe=pe.get(De.key===null?me:De.key)||null,K(ee,pe,De,Qe);case V:return pe=pe.get(De.key===null?me:De.key)||null,ye(ee,pe,De,Qe);case te:var tt=De._init;return Ve(pe,ee,me,tt(De._payload),Qe)}if(Wt(De)||F(De))return pe=pe.get(me)||null,je(ee,pe,De,Qe,null);cl(ee,De)}return null}function We(pe,ee,me,De){for(var Qe=null,tt=null,nt=ee,it=ee=0,rn=null;nt!==null&&it<me.length;it++){nt.index>it?(rn=nt,nt=null):rn=nt.sibling;var _t=Pe(pe,nt,me[it],De);if(_t===null){nt===null&&(nt=rn);break}e&&nt&&_t.alternate===null&&n(pe,nt),ee=m(_t,ee,it),tt===null?Qe=_t:tt.sibling=_t,tt=_t,nt=rn}if(it===me.length)return o(pe,nt),$t&&ki(pe,it),Qe;if(nt===null){for(;it<me.length;it++)nt=Te(pe,me[it],De),nt!==null&&(ee=m(nt,ee,it),tt===null?Qe=nt:tt.sibling=nt,tt=nt);return $t&&ki(pe,it),Qe}for(nt=l(pe,nt);it<me.length;it++)rn=Ve(nt,pe,it,me[it],De),rn!==null&&(e&&rn.alternate!==null&&nt.delete(rn.key===null?it:rn.key),ee=m(rn,ee,it),tt===null?Qe=rn:tt.sibling=rn,tt=rn);return e&&nt.forEach(function(ri){return n(pe,ri)}),$t&&ki(pe,it),Qe}function Xe(pe,ee,me,De){var Qe=F(me);if(typeof Qe!="function")throw Error(i(150));if(me=Qe.call(me),me==null)throw Error(i(151));for(var tt=Qe=null,nt=ee,it=ee=0,rn=null,_t=me.next();nt!==null&&!_t.done;it++,_t=me.next()){nt.index>it?(rn=nt,nt=null):rn=nt.sibling;var ri=Pe(pe,nt,_t.value,De);if(ri===null){nt===null&&(nt=rn);break}e&&nt&&ri.alternate===null&&n(pe,nt),ee=m(ri,ee,it),tt===null?Qe=ri:tt.sibling=ri,tt=ri,nt=rn}if(_t.done)return o(pe,nt),$t&&ki(pe,it),Qe;if(nt===null){for(;!_t.done;it++,_t=me.next())_t=Te(pe,_t.value,De),_t!==null&&(ee=m(_t,ee,it),tt===null?Qe=_t:tt.sibling=_t,tt=_t);return $t&&ki(pe,it),Qe}for(nt=l(pe,nt);!_t.done;it++,_t=me.next())_t=Ve(nt,pe,it,_t.value,De),_t!==null&&(e&&_t.alternate!==null&&nt.delete(_t.key===null?it:_t.key),ee=m(_t,ee,it),tt===null?Qe=_t:tt.sibling=_t,tt=_t);return e&&nt.forEach(function(qy){return n(pe,qy)}),$t&&ki(pe,it),Qe}function Bt(pe,ee,me,De){if(typeof me=="object"&&me!==null&&me.type===U&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case X:e:{for(var Qe=me.key,tt=ee;tt!==null;){if(tt.key===Qe){if(Qe=me.type,Qe===U){if(tt.tag===7){o(pe,tt.sibling),ee=p(tt,me.props.children),ee.return=pe,pe=ee;break e}}else if(tt.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===te&&yd(Qe)===tt.type){o(pe,tt.sibling),ee=p(tt,me.props),ee.ref=ta(pe,tt,me),ee.return=pe,pe=ee;break e}o(pe,tt);break}else n(pe,tt);tt=tt.sibling}me.type===U?(ee=Ii(me.props.children,pe.mode,De,me.key),ee.return=pe,pe=ee):(De=$l(me.type,me.key,me.props,null,pe.mode,De),De.ref=ta(pe,ee,me),De.return=pe,pe=De)}return E(pe);case V:e:{for(tt=me.key;ee!==null;){if(ee.key===tt)if(ee.tag===4&&ee.stateNode.containerInfo===me.containerInfo&&ee.stateNode.implementation===me.implementation){o(pe,ee.sibling),ee=p(ee,me.children||[]),ee.return=pe,pe=ee;break e}else{o(pe,ee);break}else n(pe,ee);ee=ee.sibling}ee=Vc(me,pe.mode,De),ee.return=pe,pe=ee}return E(pe);case te:return tt=me._init,Bt(pe,ee,tt(me._payload),De)}if(Wt(me))return We(pe,ee,me,De);if(F(me))return Xe(pe,ee,me,De);cl(pe,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,ee!==null&&ee.tag===6?(o(pe,ee.sibling),ee=p(ee,me),ee.return=pe,pe=ee):(o(pe,ee),ee=Hc(me,pe.mode,De),ee.return=pe,pe=ee),E(pe)):o(pe,ee)}return Bt}var ps=vd(!0),xd=vd(!1),fl=qo(null),dl=null,hs=null,Zu=null;function Ju(){Zu=hs=dl=null}function ec(e){var n=fl.current;Tt(fl),e._currentValue=n}function tc(e,n,o){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===o)break;e=e.return}}function ms(e,n){dl=e,Zu=hs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(zn=!0),e.firstContext=null)}function dr(e){var n=e._currentValue;if(Zu!==e)if(e={context:e,memoizedValue:n,next:null},hs===null){if(dl===null)throw Error(i(308));hs=e,dl.dependencies={lanes:0,firstContext:e}}else hs=hs.next=e;return n}var Ei=null;function nc(e){Ei===null?Ei=[e]:Ei.push(e)}function wd(e,n,o,l){var p=n.interleaved;return p===null?(o.next=o,nc(n)):(o.next=p.next,p.next=o),n.interleaved=o,So(e,l)}function So(e,n){e.lanes|=n;var o=e.alternate;for(o!==null&&(o.lanes|=n),o=e,e=e.return;e!==null;)e.childLanes|=n,o=e.alternate,o!==null&&(o.childLanes|=n),o=e,e=e.return;return o.tag===3?o.stateNode:null}var Xo=!1;function rc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _d(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function bo(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Qo(e,n,o){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(xt&2)!==0){var p=l.pending;return p===null?n.next=n:(n.next=p.next,p.next=n),l.pending=n,So(e,o)}return p=l.interleaved,p===null?(n.next=n,nc(l)):(n.next=p.next,p.next=n),l.interleaved=n,So(e,o)}function pl(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194240)!==0)){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,$o(e,o)}}function Sd(e,n){var o=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var p=null,m=null;if(o=o.firstBaseUpdate,o!==null){do{var E={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};m===null?p=m=E:m=m.next=E,o=o.next}while(o!==null);m===null?p=m=n:m=m.next=n}else p=m=n;o={baseState:l.baseState,firstBaseUpdate:p,lastBaseUpdate:m,shared:l.shared,effects:l.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}function hl(e,n,o,l){var p=e.updateQueue;Xo=!1;var m=p.firstBaseUpdate,E=p.lastBaseUpdate,z=p.shared.pending;if(z!==null){p.shared.pending=null;var K=z,ye=K.next;K.next=null,E===null?m=ye:E.next=ye,E=K;var je=e.alternate;je!==null&&(je=je.updateQueue,z=je.lastBaseUpdate,z!==E&&(z===null?je.firstBaseUpdate=ye:z.next=ye,je.lastBaseUpdate=K))}if(m!==null){var Te=p.baseState;E=0,je=ye=K=null,z=m;do{var Pe=z.lane,Ve=z.eventTime;if((l&Pe)===Pe){je!==null&&(je=je.next={eventTime:Ve,lane:0,tag:z.tag,payload:z.payload,callback:z.callback,next:null});e:{var We=e,Xe=z;switch(Pe=n,Ve=o,Xe.tag){case 1:if(We=Xe.payload,typeof We=="function"){Te=We.call(Ve,Te,Pe);break e}Te=We;break e;case 3:We.flags=We.flags&-65537|128;case 0:if(We=Xe.payload,Pe=typeof We=="function"?We.call(Ve,Te,Pe):We,Pe==null)break e;Te=Q({},Te,Pe);break e;case 2:Xo=!0}}z.callback!==null&&z.lane!==0&&(e.flags|=64,Pe=p.effects,Pe===null?p.effects=[z]:Pe.push(z))}else Ve={eventTime:Ve,lane:Pe,tag:z.tag,payload:z.payload,callback:z.callback,next:null},je===null?(ye=je=Ve,K=Te):je=je.next=Ve,E|=Pe;if(z=z.next,z===null){if(z=p.shared.pending,z===null)break;Pe=z,z=Pe.next,Pe.next=null,p.lastBaseUpdate=Pe,p.shared.pending=null}}while(!0);if(je===null&&(K=Te),p.baseState=K,p.firstBaseUpdate=ye,p.lastBaseUpdate=je,n=p.shared.interleaved,n!==null){p=n;do E|=p.lane,p=p.next;while(p!==n)}else m===null&&(p.shared.lanes=0);Pi|=E,e.lanes=E,e.memoizedState=Te}}function bd(e,n,o){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var l=e[n],p=l.callback;if(p!==null){if(l.callback=null,l=o,typeof p!="function")throw Error(i(191,p));p.call(l)}}}var na={},Wr=qo(na),ra=qo(na),oa=qo(na);function Ni(e){if(e===na)throw Error(i(174));return e}function oc(e,n){switch(Et(oa,n),Et(ra,e),Et(Wr,na),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:Yt(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=Yt(n,e)}Tt(Wr),Et(Wr,n)}function gs(){Tt(Wr),Tt(ra),Tt(oa)}function kd(e){Ni(oa.current);var n=Ni(Wr.current),o=Yt(n,e.type);n!==o&&(Et(ra,e),Et(Wr,o))}function ic(e){ra.current===e&&(Tt(Wr),Tt(ra))}var zt=qo(0);function ml(e){for(var n=e;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||o.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var sc=[];function ac(){for(var e=0;e<sc.length;e++)sc[e]._workInProgressVersionPrimary=null;sc.length=0}var gl=R.ReactCurrentDispatcher,lc=R.ReactCurrentBatchConfig,Ci=0,Dt=null,Gt=null,tn=null,yl=!1,ia=!1,sa=0,hy=0;function xn(){throw Error(i(321))}function uc(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!se(e[o],n[o]))return!1;return!0}function cc(e,n,o,l,p,m){if(Ci=m,Dt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,gl.current=e===null||e.memoizedState===null?vy:xy,e=o(l,p),ia){m=0;do{if(ia=!1,sa=0,25<=m)throw Error(i(301));m+=1,tn=Gt=null,n.updateQueue=null,gl.current=wy,e=o(l,p)}while(ia)}if(gl.current=wl,n=Gt!==null&&Gt.next!==null,Ci=0,tn=Gt=Dt=null,yl=!1,n)throw Error(i(300));return e}function fc(){var e=sa!==0;return sa=0,e}function Yr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?Dt.memoizedState=tn=e:tn=tn.next=e,tn}function pr(){if(Gt===null){var e=Dt.alternate;e=e!==null?e.memoizedState:null}else e=Gt.next;var n=tn===null?Dt.memoizedState:tn.next;if(n!==null)tn=n,Gt=e;else{if(e===null)throw Error(i(310));Gt=e,e={memoizedState:Gt.memoizedState,baseState:Gt.baseState,baseQueue:Gt.baseQueue,queue:Gt.queue,next:null},tn===null?Dt.memoizedState=tn=e:tn=tn.next=e}return tn}function aa(e,n){return typeof n=="function"?n(e):n}function dc(e){var n=pr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var l=Gt,p=l.baseQueue,m=o.pending;if(m!==null){if(p!==null){var E=p.next;p.next=m.next,m.next=E}l.baseQueue=p=m,o.pending=null}if(p!==null){m=p.next,l=l.baseState;var z=E=null,K=null,ye=m;do{var je=ye.lane;if((Ci&je)===je)K!==null&&(K=K.next={lane:0,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null}),l=ye.hasEagerState?ye.eagerState:e(l,ye.action);else{var Te={lane:je,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null};K===null?(z=K=Te,E=l):K=K.next=Te,Dt.lanes|=je,Pi|=je}ye=ye.next}while(ye!==null&&ye!==m);K===null?E=l:K.next=z,se(l,n.memoizedState)||(zn=!0),n.memoizedState=l,n.baseState=E,n.baseQueue=K,o.lastRenderedState=l}if(e=o.interleaved,e!==null){p=e;do m=p.lane,Dt.lanes|=m,Pi|=m,p=p.next;while(p!==e)}else p===null&&(o.lanes=0);return[n.memoizedState,o.dispatch]}function pc(e){var n=pr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var l=o.dispatch,p=o.pending,m=n.memoizedState;if(p!==null){o.pending=null;var E=p=p.next;do m=e(m,E.action),E=E.next;while(E!==p);se(m,n.memoizedState)||(zn=!0),n.memoizedState=m,n.baseQueue===null&&(n.baseState=m),o.lastRenderedState=m}return[m,l]}function Ed(){}function Nd(e,n){var o=Dt,l=pr(),p=n(),m=!se(l.memoizedState,p);if(m&&(l.memoizedState=p,zn=!0),l=l.queue,hc(jd.bind(null,o,l,e),[e]),l.getSnapshot!==n||m||tn!==null&&tn.memoizedState.tag&1){if(o.flags|=2048,la(9,Pd.bind(null,o,l,p,n),void 0,null),nn===null)throw Error(i(349));(Ci&30)!==0||Cd(o,n,p)}return p}function Cd(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=Dt.updateQueue,n===null?(n={lastEffect:null,stores:null},Dt.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function Pd(e,n,o,l){n.value=o,n.getSnapshot=l,Md(n)&&Td(e)}function jd(e,n,o){return o(function(){Md(n)&&Td(e)})}function Md(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!se(e,o)}catch{return!0}}function Td(e){var n=So(e,1);n!==null&&Mr(n,e,1,-1)}function Id(e){var n=Yr();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:e},n.queue=e,e=e.dispatch=yy.bind(null,Dt,e),[n.memoizedState,e]}function la(e,n,o,l){return e={tag:e,create:n,destroy:o,deps:l,next:null},n=Dt.updateQueue,n===null?(n={lastEffect:null,stores:null},Dt.updateQueue=n,n.lastEffect=e.next=e):(o=n.lastEffect,o===null?n.lastEffect=e.next=e:(l=o.next,o.next=e,e.next=l,n.lastEffect=e)),e}function Ad(){return pr().memoizedState}function vl(e,n,o,l){var p=Yr();Dt.flags|=e,p.memoizedState=la(1|n,o,void 0,l===void 0?null:l)}function xl(e,n,o,l){var p=pr();l=l===void 0?null:l;var m=void 0;if(Gt!==null){var E=Gt.memoizedState;if(m=E.destroy,l!==null&&uc(l,E.deps)){p.memoizedState=la(n,o,m,l);return}}Dt.flags|=e,p.memoizedState=la(1|n,o,m,l)}function $d(e,n){return vl(8390656,8,e,n)}function hc(e,n){return xl(2048,8,e,n)}function Od(e,n){return xl(4,2,e,n)}function Rd(e,n){return xl(4,4,e,n)}function zd(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Dd(e,n,o){return o=o!=null?o.concat([e]):null,xl(4,4,zd.bind(null,n,e),o)}function mc(){}function Ld(e,n){var o=pr();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&uc(n,l[1])?l[0]:(o.memoizedState=[e,n],e)}function Fd(e,n){var o=pr();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&uc(n,l[1])?l[0]:(e=e(),o.memoizedState=[e,n],e)}function Bd(e,n,o){return(Ci&21)===0?(e.baseState&&(e.baseState=!1,zn=!0),e.memoizedState=o):(se(o,n)||(o=Hr(),Dt.lanes|=o,Pi|=o,e.baseState=!0),n)}function my(e,n){var o=wt;wt=o!==0&&4>o?o:4,e(!0);var l=lc.transition;lc.transition={};try{e(!1),n()}finally{wt=o,lc.transition=l}}function Hd(){return pr().memoizedState}function gy(e,n,o){var l=ei(e);if(o={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null},Vd(e))Kd(n,o);else if(o=wd(e,n,o,l),o!==null){var p=Pn();Mr(o,e,l,p),Ud(o,n,l)}}function yy(e,n,o){var l=ei(e),p={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null};if(Vd(e))Kd(n,p);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=n.lastRenderedReducer,m!==null))try{var E=n.lastRenderedState,z=m(E,o);if(p.hasEagerState=!0,p.eagerState=z,se(z,E)){var K=n.interleaved;K===null?(p.next=p,nc(n)):(p.next=K.next,K.next=p),n.interleaved=p;return}}catch{}finally{}o=wd(e,n,p,l),o!==null&&(p=Pn(),Mr(o,e,l,p),Ud(o,n,l))}}function Vd(e){var n=e.alternate;return e===Dt||n!==null&&n===Dt}function Kd(e,n){ia=yl=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function Ud(e,n,o){if((o&4194240)!==0){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,$o(e,o)}}var wl={readContext:dr,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useInsertionEffect:xn,useLayoutEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useMutableSource:xn,useSyncExternalStore:xn,useId:xn,unstable_isNewReconciler:!1},vy={readContext:dr,useCallback:function(e,n){return Yr().memoizedState=[e,n===void 0?null:n],e},useContext:dr,useEffect:$d,useImperativeHandle:function(e,n,o){return o=o!=null?o.concat([e]):null,vl(4194308,4,zd.bind(null,n,e),o)},useLayoutEffect:function(e,n){return vl(4194308,4,e,n)},useInsertionEffect:function(e,n){return vl(4,2,e,n)},useMemo:function(e,n){var o=Yr();return n=n===void 0?null:n,e=e(),o.memoizedState=[e,n],e},useReducer:function(e,n,o){var l=Yr();return n=o!==void 0?o(n):n,l.memoizedState=l.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},l.queue=e,e=e.dispatch=gy.bind(null,Dt,e),[l.memoizedState,e]},useRef:function(e){var n=Yr();return e={current:e},n.memoizedState=e},useState:Id,useDebugValue:mc,useDeferredValue:function(e){return Yr().memoizedState=e},useTransition:function(){var e=Id(!1),n=e[0];return e=my.bind(null,e[1]),Yr().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,o){var l=Dt,p=Yr();if($t){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),nn===null)throw Error(i(349));(Ci&30)!==0||Cd(l,n,o)}p.memoizedState=o;var m={value:o,getSnapshot:n};return p.queue=m,$d(jd.bind(null,l,m,e),[e]),l.flags|=2048,la(9,Pd.bind(null,l,m,o,n),void 0,null),o},useId:function(){var e=Yr(),n=nn.identifierPrefix;if($t){var o=_o,l=wo;o=(l&~(1<<32-mn(l)-1)).toString(32)+o,n=":"+n+"R"+o,o=sa++,0<o&&(n+="H"+o.toString(32)),n+=":"}else o=hy++,n=":"+n+"r"+o.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},xy={readContext:dr,useCallback:Ld,useContext:dr,useEffect:hc,useImperativeHandle:Dd,useInsertionEffect:Od,useLayoutEffect:Rd,useMemo:Fd,useReducer:dc,useRef:Ad,useState:function(){return dc(aa)},useDebugValue:mc,useDeferredValue:function(e){var n=pr();return Bd(n,Gt.memoizedState,e)},useTransition:function(){var e=dc(aa)[0],n=pr().memoizedState;return[e,n]},useMutableSource:Ed,useSyncExternalStore:Nd,useId:Hd,unstable_isNewReconciler:!1},wy={readContext:dr,useCallback:Ld,useContext:dr,useEffect:hc,useImperativeHandle:Dd,useInsertionEffect:Od,useLayoutEffect:Rd,useMemo:Fd,useReducer:pc,useRef:Ad,useState:function(){return pc(aa)},useDebugValue:mc,useDeferredValue:function(e){var n=pr();return Gt===null?n.memoizedState=e:Bd(n,Gt.memoizedState,e)},useTransition:function(){var e=pc(aa)[0],n=pr().memoizedState;return[e,n]},useMutableSource:Ed,useSyncExternalStore:Nd,useId:Hd,unstable_isNewReconciler:!1};function Cr(e,n){if(e&&e.defaultProps){n=Q({},n),e=e.defaultProps;for(var o in e)n[o]===void 0&&(n[o]=e[o]);return n}return n}function gc(e,n,o,l){n=e.memoizedState,o=o(l,n),o=o==null?n:Q({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var _l={isMounted:function(e){return(e=e._reactInternals)?Qt(e)===e:!1},enqueueSetState:function(e,n,o){e=e._reactInternals;var l=Pn(),p=ei(e),m=bo(l,p);m.payload=n,o!=null&&(m.callback=o),n=Qo(e,m,p),n!==null&&(Mr(n,e,p,l),pl(n,e,p))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var l=Pn(),p=ei(e),m=bo(l,p);m.tag=1,m.payload=n,o!=null&&(m.callback=o),n=Qo(e,m,p),n!==null&&(Mr(n,e,p,l),pl(n,e,p))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=Pn(),l=ei(e),p=bo(o,l);p.tag=2,n!=null&&(p.callback=n),n=Qo(e,p,l),n!==null&&(Mr(n,e,l,o),pl(n,e,l))}};function qd(e,n,o,l,p,m,E){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,m,E):n.prototype&&n.prototype.isPureReactComponent?!J(o,l)||!J(p,m):!0}function Wd(e,n,o){var l=!1,p=Wo,m=n.contextType;return typeof m=="object"&&m!==null?m=dr(m):(p=Rn(n)?Si:vn.current,l=n.contextTypes,m=(l=l!=null)?us(e,p):Wo),n=new n(o,m),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=_l,e.stateNode=n,n._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=p,e.__reactInternalMemoizedMaskedChildContext=m),n}function Yd(e,n,o,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,l),n.state!==e&&_l.enqueueReplaceState(n,n.state,null)}function yc(e,n,o,l){var p=e.stateNode;p.props=o,p.state=e.memoizedState,p.refs={},rc(e);var m=n.contextType;typeof m=="object"&&m!==null?p.context=dr(m):(m=Rn(n)?Si:vn.current,p.context=us(e,m)),p.state=e.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(gc(e,n,m,o),p.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(n=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),n!==p.state&&_l.enqueueReplaceState(p,p.state,null),hl(e,o,p,l),p.state=e.memoizedState),typeof p.componentDidMount=="function"&&(e.flags|=4194308)}function ys(e,n){try{var o="",l=n;do o+=$e(l),l=l.return;while(l);var p=o}catch(m){p=`
39
+ Error generating stack: `+m.message+`
40
+ `+m.stack}return{value:e,source:n,stack:p,digest:null}}function vc(e,n,o){return{value:e,source:null,stack:o??null,digest:n??null}}function xc(e,n){try{console.error(n.value)}catch(o){setTimeout(function(){throw o})}}var _y=typeof WeakMap=="function"?WeakMap:Map;function Xd(e,n,o){o=bo(-1,o),o.tag=3,o.payload={element:null};var l=n.value;return o.callback=function(){Pl||(Pl=!0,$c=l),xc(e,n)},o}function Qd(e,n,o){o=bo(-1,o),o.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var p=n.value;o.payload=function(){return l(p)},o.callback=function(){xc(e,n)}}var m=e.stateNode;return m!==null&&typeof m.componentDidCatch=="function"&&(o.callback=function(){xc(e,n),typeof l!="function"&&(Zo===null?Zo=new Set([this]):Zo.add(this));var E=n.stack;this.componentDidCatch(n.value,{componentStack:E!==null?E:""})}),o}function Gd(e,n,o){var l=e.pingCache;if(l===null){l=e.pingCache=new _y;var p=new Set;l.set(n,p)}else p=l.get(n),p===void 0&&(p=new Set,l.set(n,p));p.has(o)||(p.add(o),e=Oy.bind(null,e,n,o),n.then(e,e))}function Zd(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function Jd(e,n,o,l,p){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,o.flags|=131072,o.flags&=-52805,o.tag===1&&(o.alternate===null?o.tag=17:(n=bo(-1,1),n.tag=2,Qo(o,n,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=p,e)}var Sy=R.ReactCurrentOwner,zn=!1;function Cn(e,n,o,l){n.child=e===null?xd(n,null,o,l):ps(n,e.child,o,l)}function ep(e,n,o,l,p){o=o.render;var m=n.ref;return ms(n,p),l=cc(e,n,o,l,m,p),o=fc(),e!==null&&!zn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,ko(e,n,p)):($t&&o&&Wu(n),n.flags|=1,Cn(e,n,l,p),n.child)}function tp(e,n,o,l,p){if(e===null){var m=o.type;return typeof m=="function"&&!Bc(m)&&m.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(n.tag=15,n.type=m,np(e,n,m,l,p)):(e=$l(o.type,null,l,n,n.mode,p),e.ref=n.ref,e.return=n,n.child=e)}if(m=e.child,(e.lanes&p)===0){var E=m.memoizedProps;if(o=o.compare,o=o!==null?o:J,o(E,l)&&e.ref===n.ref)return ko(e,n,p)}return n.flags|=1,e=ni(m,l),e.ref=n.ref,e.return=n,n.child=e}function np(e,n,o,l,p){if(e!==null){var m=e.memoizedProps;if(J(m,l)&&e.ref===n.ref)if(zn=!1,n.pendingProps=l=m,(e.lanes&p)!==0)(e.flags&131072)!==0&&(zn=!0);else return n.lanes=e.lanes,ko(e,n,p)}return wc(e,n,o,l,p)}function rp(e,n,o){var l=n.pendingProps,p=l.children,m=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Et(xs,Qn),Qn|=o;else{if((o&1073741824)===0)return e=m!==null?m.baseLanes|o:o,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,Et(xs,Qn),Qn|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=m!==null?m.baseLanes:o,Et(xs,Qn),Qn|=l}else m!==null?(l=m.baseLanes|o,n.memoizedState=null):l=o,Et(xs,Qn),Qn|=l;return Cn(e,n,p,o),n.child}function op(e,n){var o=n.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(n.flags|=512,n.flags|=2097152)}function wc(e,n,o,l,p){var m=Rn(o)?Si:vn.current;return m=us(n,m),ms(n,p),o=cc(e,n,o,l,m,p),l=fc(),e!==null&&!zn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,ko(e,n,p)):($t&&l&&Wu(n),n.flags|=1,Cn(e,n,o,p),n.child)}function ip(e,n,o,l,p){if(Rn(o)){var m=!0;il(n)}else m=!1;if(ms(n,p),n.stateNode===null)bl(e,n),Wd(n,o,l),yc(n,o,l,p),l=!0;else if(e===null){var E=n.stateNode,z=n.memoizedProps;E.props=z;var K=E.context,ye=o.contextType;typeof ye=="object"&&ye!==null?ye=dr(ye):(ye=Rn(o)?Si:vn.current,ye=us(n,ye));var je=o.getDerivedStateFromProps,Te=typeof je=="function"||typeof E.getSnapshotBeforeUpdate=="function";Te||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(z!==l||K!==ye)&&Yd(n,E,l,ye),Xo=!1;var Pe=n.memoizedState;E.state=Pe,hl(n,l,E,p),K=n.memoizedState,z!==l||Pe!==K||On.current||Xo?(typeof je=="function"&&(gc(n,o,je,l),K=n.memoizedState),(z=Xo||qd(n,o,z,l,Pe,K,ye))?(Te||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(n.flags|=4194308)):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=K),E.props=l,E.state=K,E.context=ye,l=z):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{E=n.stateNode,_d(e,n),z=n.memoizedProps,ye=n.type===n.elementType?z:Cr(n.type,z),E.props=ye,Te=n.pendingProps,Pe=E.context,K=o.contextType,typeof K=="object"&&K!==null?K=dr(K):(K=Rn(o)?Si:vn.current,K=us(n,K));var Ve=o.getDerivedStateFromProps;(je=typeof Ve=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(z!==Te||Pe!==K)&&Yd(n,E,l,K),Xo=!1,Pe=n.memoizedState,E.state=Pe,hl(n,l,E,p);var We=n.memoizedState;z!==Te||Pe!==We||On.current||Xo?(typeof Ve=="function"&&(gc(n,o,Ve,l),We=n.memoizedState),(ye=Xo||qd(n,o,ye,l,Pe,We,K)||!1)?(je||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(l,We,K),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(l,We,K)),typeof E.componentDidUpdate=="function"&&(n.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof E.componentDidUpdate!="function"||z===e.memoizedProps&&Pe===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||z===e.memoizedProps&&Pe===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=We),E.props=l,E.state=We,E.context=K,l=ye):(typeof E.componentDidUpdate!="function"||z===e.memoizedProps&&Pe===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||z===e.memoizedProps&&Pe===e.memoizedState||(n.flags|=1024),l=!1)}return _c(e,n,o,l,m,p)}function _c(e,n,o,l,p,m){op(e,n);var E=(n.flags&128)!==0;if(!l&&!E)return p&&cd(n,o,!1),ko(e,n,m);l=n.stateNode,Sy.current=n;var z=E&&typeof o.getDerivedStateFromError!="function"?null:l.render();return n.flags|=1,e!==null&&E?(n.child=ps(n,e.child,null,m),n.child=ps(n,null,z,m)):Cn(e,n,z,m),n.memoizedState=l.state,p&&cd(n,o,!0),n.child}function sp(e){var n=e.stateNode;n.pendingContext?ld(e,n.pendingContext,n.pendingContext!==n.context):n.context&&ld(e,n.context,!1),oc(e,n.containerInfo)}function ap(e,n,o,l,p){return ds(),Gu(p),n.flags|=256,Cn(e,n,o,l),n.child}var Sc={dehydrated:null,treeContext:null,retryLane:0};function bc(e){return{baseLanes:e,cachePool:null,transitions:null}}function lp(e,n,o){var l=n.pendingProps,p=zt.current,m=!1,E=(n.flags&128)!==0,z;if((z=E)||(z=e!==null&&e.memoizedState===null?!1:(p&2)!==0),z?(m=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(p|=1),Et(zt,p&1),e===null)return Qu(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(E=l.children,e=l.fallback,m?(l=n.mode,m=n.child,E={mode:"hidden",children:E},(l&1)===0&&m!==null?(m.childLanes=0,m.pendingProps=E):m=Ol(E,l,0,null),e=Ii(e,l,o,null),m.return=n,e.return=n,m.sibling=e,n.child=m,n.child.memoizedState=bc(o),n.memoizedState=Sc,e):kc(n,E));if(p=e.memoizedState,p!==null&&(z=p.dehydrated,z!==null))return by(e,n,E,l,z,p,o);if(m){m=l.fallback,E=n.mode,p=e.child,z=p.sibling;var K={mode:"hidden",children:l.children};return(E&1)===0&&n.child!==p?(l=n.child,l.childLanes=0,l.pendingProps=K,n.deletions=null):(l=ni(p,K),l.subtreeFlags=p.subtreeFlags&14680064),z!==null?m=ni(z,m):(m=Ii(m,E,o,null),m.flags|=2),m.return=n,l.return=n,l.sibling=m,n.child=l,l=m,m=n.child,E=e.child.memoizedState,E=E===null?bc(o):{baseLanes:E.baseLanes|o,cachePool:null,transitions:E.transitions},m.memoizedState=E,m.childLanes=e.childLanes&~o,n.memoizedState=Sc,l}return m=e.child,e=m.sibling,l=ni(m,{mode:"visible",children:l.children}),(n.mode&1)===0&&(l.lanes=o),l.return=n,l.sibling=null,e!==null&&(o=n.deletions,o===null?(n.deletions=[e],n.flags|=16):o.push(e)),n.child=l,n.memoizedState=null,l}function kc(e,n){return n=Ol({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function Sl(e,n,o,l){return l!==null&&Gu(l),ps(n,e.child,null,o),e=kc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function by(e,n,o,l,p,m,E){if(o)return n.flags&256?(n.flags&=-257,l=vc(Error(i(422))),Sl(e,n,E,l)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(m=l.fallback,p=n.mode,l=Ol({mode:"visible",children:l.children},p,0,null),m=Ii(m,p,E,null),m.flags|=2,l.return=n,m.return=n,l.sibling=m,n.child=l,(n.mode&1)!==0&&ps(n,e.child,null,E),n.child.memoizedState=bc(E),n.memoizedState=Sc,m);if((n.mode&1)===0)return Sl(e,n,E,null);if(p.data==="$!"){if(l=p.nextSibling&&p.nextSibling.dataset,l)var z=l.dgst;return l=z,m=Error(i(419)),l=vc(m,l,void 0),Sl(e,n,E,l)}if(z=(E&e.childLanes)!==0,zn||z){if(l=nn,l!==null){switch(E&-E){case 4:p=2;break;case 16:p=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:p=32;break;case 536870912:p=268435456;break;default:p=0}p=(p&(l.suspendedLanes|E))!==0?0:p,p!==0&&p!==m.retryLane&&(m.retryLane=p,So(e,p),Mr(l,e,p,-1))}return Fc(),l=vc(Error(i(421))),Sl(e,n,E,l)}return p.data==="$?"?(n.flags|=128,n.child=e.child,n=Ry.bind(null,e),p._reactRetry=n,null):(e=m.treeContext,Xn=Uo(p.nextSibling),Yn=n,$t=!0,Nr=null,e!==null&&(cr[fr++]=wo,cr[fr++]=_o,cr[fr++]=bi,wo=e.id,_o=e.overflow,bi=n),n=kc(n,l.children),n.flags|=4096,n)}function up(e,n,o){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),tc(e.return,n,o)}function Ec(e,n,o,l,p){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:p}:(m.isBackwards=n,m.rendering=null,m.renderingStartTime=0,m.last=l,m.tail=o,m.tailMode=p)}function cp(e,n,o){var l=n.pendingProps,p=l.revealOrder,m=l.tail;if(Cn(e,n,l.children,o),l=zt.current,(l&2)!==0)l=l&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&up(e,o,n);else if(e.tag===19)up(e,o,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}if(Et(zt,l),(n.mode&1)===0)n.memoizedState=null;else switch(p){case"forwards":for(o=n.child,p=null;o!==null;)e=o.alternate,e!==null&&ml(e)===null&&(p=o),o=o.sibling;o=p,o===null?(p=n.child,n.child=null):(p=o.sibling,o.sibling=null),Ec(n,!1,p,o,m);break;case"backwards":for(o=null,p=n.child,n.child=null;p!==null;){if(e=p.alternate,e!==null&&ml(e)===null){n.child=p;break}e=p.sibling,p.sibling=o,o=p,p=e}Ec(n,!0,o,null,m);break;case"together":Ec(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function bl(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function ko(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),Pi|=n.lanes,(o&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(i(153));if(n.child!==null){for(e=n.child,o=ni(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=ni(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function ky(e,n,o){switch(n.tag){case 3:sp(n),ds();break;case 5:kd(n);break;case 1:Rn(n.type)&&il(n);break;case 4:oc(n,n.stateNode.containerInfo);break;case 10:var l=n.type._context,p=n.memoizedProps.value;Et(fl,l._currentValue),l._currentValue=p;break;case 13:if(l=n.memoizedState,l!==null)return l.dehydrated!==null?(Et(zt,zt.current&1),n.flags|=128,null):(o&n.child.childLanes)!==0?lp(e,n,o):(Et(zt,zt.current&1),e=ko(e,n,o),e!==null?e.sibling:null);Et(zt,zt.current&1);break;case 19:if(l=(o&n.childLanes)!==0,(e.flags&128)!==0){if(l)return cp(e,n,o);n.flags|=128}if(p=n.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Et(zt,zt.current),l)break;return null;case 22:case 23:return n.lanes=0,rp(e,n,o)}return ko(e,n,o)}var fp,Nc,dp,pp;fp=function(e,n){for(var o=n.child;o!==null;){if(o.tag===5||o.tag===6)e.appendChild(o.stateNode);else if(o.tag!==4&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},Nc=function(){},dp=function(e,n,o,l){var p=e.memoizedProps;if(p!==l){e=n.stateNode,Ni(Wr.current);var m=null;switch(o){case"input":p=et(e,p),l=et(e,l),m=[];break;case"select":p=Q({},p,{value:void 0}),l=Q({},l,{value:void 0}),m=[];break;case"textarea":p=jn(e,p),l=jn(e,l),m=[];break;default:typeof p.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=nl)}Ue(o,l);var E;o=null;for(ye in p)if(!l.hasOwnProperty(ye)&&p.hasOwnProperty(ye)&&p[ye]!=null)if(ye==="style"){var z=p[ye];for(E in z)z.hasOwnProperty(E)&&(o||(o={}),o[E]="")}else ye!=="dangerouslySetInnerHTML"&&ye!=="children"&&ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&ye!=="autoFocus"&&(u.hasOwnProperty(ye)?m||(m=[]):(m=m||[]).push(ye,null));for(ye in l){var K=l[ye];if(z=p!=null?p[ye]:void 0,l.hasOwnProperty(ye)&&K!==z&&(K!=null||z!=null))if(ye==="style")if(z){for(E in z)!z.hasOwnProperty(E)||K&&K.hasOwnProperty(E)||(o||(o={}),o[E]="");for(E in K)K.hasOwnProperty(E)&&z[E]!==K[E]&&(o||(o={}),o[E]=K[E])}else o||(m||(m=[]),m.push(ye,o)),o=K;else ye==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,z=z?z.__html:void 0,K!=null&&z!==K&&(m=m||[]).push(ye,K)):ye==="children"?typeof K!="string"&&typeof K!="number"||(m=m||[]).push(ye,""+K):ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&(u.hasOwnProperty(ye)?(K!=null&&ye==="onScroll"&&Mt("scroll",e),m||z===K||(m=[])):(m=m||[]).push(ye,K))}o&&(m=m||[]).push("style",o);var ye=m;(n.updateQueue=ye)&&(n.flags|=4)}},pp=function(e,n,o,l){o!==l&&(n.flags|=4)};function ua(e,n){if(!$t)switch(e.tailMode){case"hidden":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function wn(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,l=0;if(n)for(var p=e.child;p!==null;)o|=p.lanes|p.childLanes,l|=p.subtreeFlags&14680064,l|=p.flags&14680064,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)o|=p.lanes|p.childLanes,l|=p.subtreeFlags,l|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=l,e.childLanes=o,n}function Ey(e,n,o){var l=n.pendingProps;switch(Yu(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wn(n),null;case 1:return Rn(n.type)&&ol(),wn(n),null;case 3:return l=n.stateNode,gs(),Tt(On),Tt(vn),ac(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(ul(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Nr!==null&&(zc(Nr),Nr=null))),Nc(e,n),wn(n),null;case 5:ic(n);var p=Ni(oa.current);if(o=n.type,e!==null&&n.stateNode!=null)dp(e,n,o,l,p),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!l){if(n.stateNode===null)throw Error(i(166));return wn(n),null}if(e=Ni(Wr.current),ul(n)){l=n.stateNode,o=n.type;var m=n.memoizedProps;switch(l[qr]=n,l[Js]=m,e=(n.mode&1)!==0,o){case"dialog":Mt("cancel",l),Mt("close",l);break;case"iframe":case"object":case"embed":Mt("load",l);break;case"video":case"audio":for(p=0;p<yo.length;p++)Mt(yo[p],l);break;case"source":Mt("error",l);break;case"img":case"image":case"link":Mt("error",l),Mt("load",l);break;case"details":Mt("toggle",l);break;case"input":ft(l,m),Mt("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!m.multiple},Mt("invalid",l);break;case"textarea":pn(l,m),Mt("invalid",l)}Ue(o,m),p=null;for(var E in m)if(m.hasOwnProperty(E)){var z=m[E];E==="children"?typeof z=="string"?l.textContent!==z&&(m.suppressHydrationWarning!==!0&&tl(l.textContent,z,e),p=["children",z]):typeof z=="number"&&l.textContent!==""+z&&(m.suppressHydrationWarning!==!0&&tl(l.textContent,z,e),p=["children",""+z]):u.hasOwnProperty(E)&&z!=null&&E==="onScroll"&&Mt("scroll",l)}switch(o){case"input":Je(l),dn(l,m,!0);break;case"textarea":Je(l),Sn(l);break;case"select":case"option":break;default:typeof m.onClick=="function"&&(l.onclick=nl)}l=p,n.updateQueue=l,l!==null&&(n.flags|=4)}else{E=p.nodeType===9?p:p.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ct(o)),e==="http://www.w3.org/1999/xhtml"?o==="script"?(e=E.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=E.createElement(o,{is:l.is}):(e=E.createElement(o),o==="select"&&(E=e,l.multiple?E.multiple=!0:l.size&&(E.size=l.size))):e=E.createElementNS(e,o),e[qr]=n,e[Js]=l,fp(e,n,!1,!1),n.stateNode=e;e:{switch(E=Kn(o,l),o){case"dialog":Mt("cancel",e),Mt("close",e),p=l;break;case"iframe":case"object":case"embed":Mt("load",e),p=l;break;case"video":case"audio":for(p=0;p<yo.length;p++)Mt(yo[p],e);p=l;break;case"source":Mt("error",e),p=l;break;case"img":case"image":case"link":Mt("error",e),Mt("load",e),p=l;break;case"details":Mt("toggle",e),p=l;break;case"input":ft(e,l),p=et(e,l),Mt("invalid",e);break;case"option":p=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},p=Q({},l,{value:void 0}),Mt("invalid",e);break;case"textarea":pn(e,l),p=jn(e,l),Mt("invalid",e);break;default:p=l}Ue(o,p),z=p;for(m in z)if(z.hasOwnProperty(m)){var K=z[m];m==="style"?Rr(e,K):m==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,K!=null&&er(e,K)):m==="children"?typeof K=="string"?(o!=="textarea"||K!=="")&&Ht(e,K):typeof K=="number"&&Ht(e,""+K):m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&m!=="autoFocus"&&(u.hasOwnProperty(m)?K!=null&&m==="onScroll"&&Mt("scroll",e):K!=null&&M(e,m,K,E))}switch(o){case"input":Je(e),dn(e,l,!1);break;case"textarea":Je(e),Sn(e);break;case"option":l.value!=null&&e.setAttribute("value",""+we(l.value));break;case"select":e.multiple=!!l.multiple,m=l.value,m!=null?Nt(e,!!l.multiple,m,!1):l.defaultValue!=null&&Nt(e,!!l.multiple,l.defaultValue,!0);break;default:typeof p.onClick=="function"&&(e.onclick=nl)}switch(o){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return wn(n),null;case 6:if(e&&n.stateNode!=null)pp(e,n,e.memoizedProps,l);else{if(typeof l!="string"&&n.stateNode===null)throw Error(i(166));if(o=Ni(oa.current),Ni(Wr.current),ul(n)){if(l=n.stateNode,o=n.memoizedProps,l[qr]=n,(m=l.nodeValue!==o)&&(e=Yn,e!==null))switch(e.tag){case 3:tl(l.nodeValue,o,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&tl(l.nodeValue,o,(e.mode&1)!==0)}m&&(n.flags|=4)}else l=(o.nodeType===9?o:o.ownerDocument).createTextNode(l),l[qr]=n,n.stateNode=l}return wn(n),null;case 13:if(Tt(zt),l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if($t&&Xn!==null&&(n.mode&1)!==0&&(n.flags&128)===0)gd(),ds(),n.flags|=98560,m=!1;else if(m=ul(n),l!==null&&l.dehydrated!==null){if(e===null){if(!m)throw Error(i(318));if(m=n.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(i(317));m[qr]=n}else ds(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;wn(n),m=!1}else Nr!==null&&(zc(Nr),Nr=null),m=!0;if(!m)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=o,n):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(zt.current&1)!==0?Zt===0&&(Zt=3):Fc())),n.updateQueue!==null&&(n.flags|=4),wn(n),null);case 4:return gs(),Nc(e,n),e===null&&Gs(n.stateNode.containerInfo),wn(n),null;case 10:return ec(n.type._context),wn(n),null;case 17:return Rn(n.type)&&ol(),wn(n),null;case 19:if(Tt(zt),m=n.memoizedState,m===null)return wn(n),null;if(l=(n.flags&128)!==0,E=m.rendering,E===null)if(l)ua(m,!1);else{if(Zt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(E=ml(e),E!==null){for(n.flags|=128,ua(m,!1),l=E.updateQueue,l!==null&&(n.updateQueue=l,n.flags|=4),n.subtreeFlags=0,l=o,o=n.child;o!==null;)m=o,e=l,m.flags&=14680066,E=m.alternate,E===null?(m.childLanes=0,m.lanes=e,m.child=null,m.subtreeFlags=0,m.memoizedProps=null,m.memoizedState=null,m.updateQueue=null,m.dependencies=null,m.stateNode=null):(m.childLanes=E.childLanes,m.lanes=E.lanes,m.child=E.child,m.subtreeFlags=0,m.deletions=null,m.memoizedProps=E.memoizedProps,m.memoizedState=E.memoizedState,m.updateQueue=E.updateQueue,m.type=E.type,e=E.dependencies,m.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),o=o.sibling;return Et(zt,zt.current&1|2),n.child}e=e.sibling}m.tail!==null&&yt()>ws&&(n.flags|=128,l=!0,ua(m,!1),n.lanes=4194304)}else{if(!l)if(e=ml(E),e!==null){if(n.flags|=128,l=!0,o=e.updateQueue,o!==null&&(n.updateQueue=o,n.flags|=4),ua(m,!0),m.tail===null&&m.tailMode==="hidden"&&!E.alternate&&!$t)return wn(n),null}else 2*yt()-m.renderingStartTime>ws&&o!==1073741824&&(n.flags|=128,l=!0,ua(m,!1),n.lanes=4194304);m.isBackwards?(E.sibling=n.child,n.child=E):(o=m.last,o!==null?o.sibling=E:n.child=E,m.last=E)}return m.tail!==null?(n=m.tail,m.rendering=n,m.tail=n.sibling,m.renderingStartTime=yt(),n.sibling=null,o=zt.current,Et(zt,l?o&1|2:o&1),n):(wn(n),null);case 22:case 23:return Lc(),l=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(n.flags|=8192),l&&(n.mode&1)!==0?(Qn&1073741824)!==0&&(wn(n),n.subtreeFlags&6&&(n.flags|=8192)):wn(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function Ny(e,n){switch(Yu(n),n.tag){case 1:return Rn(n.type)&&ol(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return gs(),Tt(On),Tt(vn),ac(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return ic(n),null;case 13:if(Tt(zt),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));ds()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Tt(zt),null;case 4:return gs(),null;case 10:return ec(n.type._context),null;case 22:case 23:return Lc(),null;case 24:return null;default:return null}}var kl=!1,_n=!1,Cy=typeof WeakSet=="function"?WeakSet:Set,qe=null;function vs(e,n){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(l){Ft(e,n,l)}else o.current=null}function Cc(e,n,o){try{o()}catch(l){Ft(e,n,l)}}var hp=!1;function Py(e,n){if(Lu=Ui,e=re(),ne(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var l=o.getSelection&&o.getSelection();if(l&&l.rangeCount!==0){o=l.anchorNode;var p=l.anchorOffset,m=l.focusNode;l=l.focusOffset;try{o.nodeType,m.nodeType}catch{o=null;break e}var E=0,z=-1,K=-1,ye=0,je=0,Te=e,Pe=null;t:for(;;){for(var Ve;Te!==o||p!==0&&Te.nodeType!==3||(z=E+p),Te!==m||l!==0&&Te.nodeType!==3||(K=E+l),Te.nodeType===3&&(E+=Te.nodeValue.length),(Ve=Te.firstChild)!==null;)Pe=Te,Te=Ve;for(;;){if(Te===e)break t;if(Pe===o&&++ye===p&&(z=E),Pe===m&&++je===l&&(K=E),(Ve=Te.nextSibling)!==null)break;Te=Pe,Pe=Te.parentNode}Te=Ve}o=z===-1||K===-1?null:{start:z,end:K}}else o=null}o=o||{start:0,end:0}}else o=null;for(Fu={focusedElem:e,selectionRange:o},Ui=!1,qe=n;qe!==null;)if(n=qe,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,qe=e;else for(;qe!==null;){n=qe;try{var We=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(We!==null){var Xe=We.memoizedProps,Bt=We.memoizedState,pe=n.stateNode,ee=pe.getSnapshotBeforeUpdate(n.elementType===n.type?Xe:Cr(n.type,Xe),Bt);pe.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:var me=n.stateNode.containerInfo;me.nodeType===1?me.textContent="":me.nodeType===9&&me.documentElement&&me.removeChild(me.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(De){Ft(n,n.return,De)}if(e=n.sibling,e!==null){e.return=n.return,qe=e;break}qe=n.return}return We=hp,hp=!1,We}function ca(e,n,o){var l=n.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var p=l=l.next;do{if((p.tag&e)===e){var m=p.destroy;p.destroy=void 0,m!==void 0&&Cc(n,o,m)}p=p.next}while(p!==l)}}function El(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var l=o.create;o.destroy=l()}o=o.next}while(o!==n)}}function Pc(e){var n=e.ref;if(n!==null){var o=e.stateNode;switch(e.tag){case 5:e=o;break;default:e=o}typeof n=="function"?n(e):n.current=e}}function mp(e){var n=e.alternate;n!==null&&(e.alternate=null,mp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[qr],delete n[Js],delete n[Ku],delete n[cy],delete n[fy])),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 gp(e){return e.tag===5||e.tag===3||e.tag===4}function yp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gp(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 jc(e,n,o){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?o.nodeType===8?o.parentNode.insertBefore(e,n):o.insertBefore(e,n):(o.nodeType===8?(n=o.parentNode,n.insertBefore(e,o)):(n=o,n.appendChild(e)),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=nl));else if(l!==4&&(e=e.child,e!==null))for(jc(e,n,o),e=e.sibling;e!==null;)jc(e,n,o),e=e.sibling}function Mc(e,n,o){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(Mc(e,n,o),e=e.sibling;e!==null;)Mc(e,n,o),e=e.sibling}var cn=null,Pr=!1;function Go(e,n,o){for(o=o.child;o!==null;)vp(e,n,o),o=o.sibling}function vp(e,n,o){if(Nn&&typeof Nn.onCommitFiberUnmount=="function")try{Nn.onCommitFiberUnmount(ar,o)}catch{}switch(o.tag){case 5:_n||vs(o,n);case 6:var l=cn,p=Pr;cn=null,Go(e,n,o),cn=l,Pr=p,cn!==null&&(Pr?(e=cn,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):cn.removeChild(o.stateNode));break;case 18:cn!==null&&(Pr?(e=cn,o=o.stateNode,e.nodeType===8?Vu(e.parentNode,o):e.nodeType===1&&Vu(e,o),ao(e)):Vu(cn,o.stateNode));break;case 4:l=cn,p=Pr,cn=o.stateNode.containerInfo,Pr=!0,Go(e,n,o),cn=l,Pr=p;break;case 0:case 11:case 14:case 15:if(!_n&&(l=o.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){p=l=l.next;do{var m=p,E=m.destroy;m=m.tag,E!==void 0&&((m&2)!==0||(m&4)!==0)&&Cc(o,n,E),p=p.next}while(p!==l)}Go(e,n,o);break;case 1:if(!_n&&(vs(o,n),l=o.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=o.memoizedProps,l.state=o.memoizedState,l.componentWillUnmount()}catch(z){Ft(o,n,z)}Go(e,n,o);break;case 21:Go(e,n,o);break;case 22:o.mode&1?(_n=(l=_n)||o.memoizedState!==null,Go(e,n,o),_n=l):Go(e,n,o);break;default:Go(e,n,o)}}function xp(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new Cy),n.forEach(function(l){var p=zy.bind(null,e,l);o.has(l)||(o.add(l),l.then(p,p))})}}function jr(e,n){var o=n.deletions;if(o!==null)for(var l=0;l<o.length;l++){var p=o[l];try{var m=e,E=n,z=E;e:for(;z!==null;){switch(z.tag){case 5:cn=z.stateNode,Pr=!1;break e;case 3:cn=z.stateNode.containerInfo,Pr=!0;break e;case 4:cn=z.stateNode.containerInfo,Pr=!0;break e}z=z.return}if(cn===null)throw Error(i(160));vp(m,E,p),cn=null,Pr=!1;var K=p.alternate;K!==null&&(K.return=null),p.return=null}catch(ye){Ft(p,n,ye)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)wp(n,e),n=n.sibling}function wp(e,n){var o=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jr(n,e),Xr(e),l&4){try{ca(3,e,e.return),El(3,e)}catch(Xe){Ft(e,e.return,Xe)}try{ca(5,e,e.return)}catch(Xe){Ft(e,e.return,Xe)}}break;case 1:jr(n,e),Xr(e),l&512&&o!==null&&vs(o,o.return);break;case 5:if(jr(n,e),Xr(e),l&512&&o!==null&&vs(o,o.return),e.flags&32){var p=e.stateNode;try{Ht(p,"")}catch(Xe){Ft(e,e.return,Xe)}}if(l&4&&(p=e.stateNode,p!=null)){var m=e.memoizedProps,E=o!==null?o.memoizedProps:m,z=e.type,K=e.updateQueue;if(e.updateQueue=null,K!==null)try{z==="input"&&m.type==="radio"&&m.name!=null&&lt(p,m),Kn(z,E);var ye=Kn(z,m);for(E=0;E<K.length;E+=2){var je=K[E],Te=K[E+1];je==="style"?Rr(p,Te):je==="dangerouslySetInnerHTML"?er(p,Te):je==="children"?Ht(p,Te):M(p,je,Te,ye)}switch(z){case"input":kt(p,m);break;case"textarea":Jn(p,m);break;case"select":var Pe=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!m.multiple;var Ve=m.value;Ve!=null?Nt(p,!!m.multiple,Ve,!1):Pe!==!!m.multiple&&(m.defaultValue!=null?Nt(p,!!m.multiple,m.defaultValue,!0):Nt(p,!!m.multiple,m.multiple?[]:"",!1))}p[Js]=m}catch(Xe){Ft(e,e.return,Xe)}}break;case 6:if(jr(n,e),Xr(e),l&4){if(e.stateNode===null)throw Error(i(162));p=e.stateNode,m=e.memoizedProps;try{p.nodeValue=m}catch(Xe){Ft(e,e.return,Xe)}}break;case 3:if(jr(n,e),Xr(e),l&4&&o!==null&&o.memoizedState.isDehydrated)try{ao(n.containerInfo)}catch(Xe){Ft(e,e.return,Xe)}break;case 4:jr(n,e),Xr(e);break;case 13:jr(n,e),Xr(e),p=e.child,p.flags&8192&&(m=p.memoizedState!==null,p.stateNode.isHidden=m,!m||p.alternate!==null&&p.alternate.memoizedState!==null||(Ac=yt())),l&4&&xp(e);break;case 22:if(je=o!==null&&o.memoizedState!==null,e.mode&1?(_n=(ye=_n)||je,jr(n,e),_n=ye):jr(n,e),Xr(e),l&8192){if(ye=e.memoizedState!==null,(e.stateNode.isHidden=ye)&&!je&&(e.mode&1)!==0)for(qe=e,je=e.child;je!==null;){for(Te=qe=je;qe!==null;){switch(Pe=qe,Ve=Pe.child,Pe.tag){case 0:case 11:case 14:case 15:ca(4,Pe,Pe.return);break;case 1:vs(Pe,Pe.return);var We=Pe.stateNode;if(typeof We.componentWillUnmount=="function"){l=Pe,o=Pe.return;try{n=l,We.props=n.memoizedProps,We.state=n.memoizedState,We.componentWillUnmount()}catch(Xe){Ft(l,o,Xe)}}break;case 5:vs(Pe,Pe.return);break;case 22:if(Pe.memoizedState!==null){bp(Te);continue}}Ve!==null?(Ve.return=Pe,qe=Ve):bp(Te)}je=je.sibling}e:for(je=null,Te=e;;){if(Te.tag===5){if(je===null){je=Te;try{p=Te.stateNode,ye?(m=p.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none"):(z=Te.stateNode,K=Te.memoizedProps.style,E=K!=null&&K.hasOwnProperty("display")?K.display:null,z.style.display=gr("display",E))}catch(Xe){Ft(e,e.return,Xe)}}}else if(Te.tag===6){if(je===null)try{Te.stateNode.nodeValue=ye?"":Te.memoizedProps}catch(Xe){Ft(e,e.return,Xe)}}else if((Te.tag!==22&&Te.tag!==23||Te.memoizedState===null||Te===e)&&Te.child!==null){Te.child.return=Te,Te=Te.child;continue}if(Te===e)break e;for(;Te.sibling===null;){if(Te.return===null||Te.return===e)break e;je===Te&&(je=null),Te=Te.return}je===Te&&(je=null),Te.sibling.return=Te.return,Te=Te.sibling}}break;case 19:jr(n,e),Xr(e),l&4&&xp(e);break;case 21:break;default:jr(n,e),Xr(e)}}function Xr(e){var n=e.flags;if(n&2){try{e:{for(var o=e.return;o!==null;){if(gp(o)){var l=o;break e}o=o.return}throw Error(i(160))}switch(l.tag){case 5:var p=l.stateNode;l.flags&32&&(Ht(p,""),l.flags&=-33);var m=yp(e);Mc(e,m,p);break;case 3:case 4:var E=l.stateNode.containerInfo,z=yp(e);jc(e,z,E);break;default:throw Error(i(161))}}catch(K){Ft(e,e.return,K)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function jy(e,n,o){qe=e,_p(e)}function _p(e,n,o){for(var l=(e.mode&1)!==0;qe!==null;){var p=qe,m=p.child;if(p.tag===22&&l){var E=p.memoizedState!==null||kl;if(!E){var z=p.alternate,K=z!==null&&z.memoizedState!==null||_n;z=kl;var ye=_n;if(kl=E,(_n=K)&&!ye)for(qe=p;qe!==null;)E=qe,K=E.child,E.tag===22&&E.memoizedState!==null?kp(p):K!==null?(K.return=E,qe=K):kp(p);for(;m!==null;)qe=m,_p(m),m=m.sibling;qe=p,kl=z,_n=ye}Sp(e)}else(p.subtreeFlags&8772)!==0&&m!==null?(m.return=p,qe=m):Sp(e)}}function Sp(e){for(;qe!==null;){var n=qe;if((n.flags&8772)!==0){var o=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:_n||El(5,n);break;case 1:var l=n.stateNode;if(n.flags&4&&!_n)if(o===null)l.componentDidMount();else{var p=n.elementType===n.type?o.memoizedProps:Cr(n.type,o.memoizedProps);l.componentDidUpdate(p,o.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var m=n.updateQueue;m!==null&&bd(n,m,l);break;case 3:var E=n.updateQueue;if(E!==null){if(o=null,n.child!==null)switch(n.child.tag){case 5:o=n.child.stateNode;break;case 1:o=n.child.stateNode}bd(n,E,o)}break;case 5:var z=n.stateNode;if(o===null&&n.flags&4){o=z;var K=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":K.autoFocus&&o.focus();break;case"img":K.src&&(o.src=K.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var ye=n.alternate;if(ye!==null){var je=ye.memoizedState;if(je!==null){var Te=je.dehydrated;Te!==null&&ao(Te)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}_n||n.flags&512&&Pc(n)}catch(Pe){Ft(n,n.return,Pe)}}if(n===e){qe=null;break}if(o=n.sibling,o!==null){o.return=n.return,qe=o;break}qe=n.return}}function bp(e){for(;qe!==null;){var n=qe;if(n===e){qe=null;break}var o=n.sibling;if(o!==null){o.return=n.return,qe=o;break}qe=n.return}}function kp(e){for(;qe!==null;){var n=qe;try{switch(n.tag){case 0:case 11:case 15:var o=n.return;try{El(4,n)}catch(K){Ft(n,o,K)}break;case 1:var l=n.stateNode;if(typeof l.componentDidMount=="function"){var p=n.return;try{l.componentDidMount()}catch(K){Ft(n,p,K)}}var m=n.return;try{Pc(n)}catch(K){Ft(n,m,K)}break;case 5:var E=n.return;try{Pc(n)}catch(K){Ft(n,E,K)}}}catch(K){Ft(n,n.return,K)}if(n===e){qe=null;break}var z=n.sibling;if(z!==null){z.return=n.return,qe=z;break}qe=n.return}}var My=Math.ceil,Nl=R.ReactCurrentDispatcher,Tc=R.ReactCurrentOwner,hr=R.ReactCurrentBatchConfig,xt=0,nn=null,Ut=null,fn=0,Qn=0,xs=qo(0),Zt=0,fa=null,Pi=0,Cl=0,Ic=0,da=null,Dn=null,Ac=0,ws=1/0,Eo=null,Pl=!1,$c=null,Zo=null,jl=!1,Jo=null,Ml=0,pa=0,Oc=null,Tl=-1,Il=0;function Pn(){return(xt&6)!==0?yt():Tl!==-1?Tl:Tl=yt()}function ei(e){return(e.mode&1)===0?1:(xt&2)!==0&&fn!==0?fn&-fn:py.transition!==null?(Il===0&&(Il=Hr()),Il):(e=wt,e!==0||(e=window.event,e=e===void 0?16:qi(e.type)),e)}function Mr(e,n,o,l){if(50<pa)throw pa=0,Oc=null,Error(i(185));ur(e,o,l),((xt&2)===0||e!==nn)&&(e===nn&&((xt&2)===0&&(Cl|=o),Zt===4&&ti(e,fn)),Ln(e,l),o===1&&xt===0&&(n.mode&1)===0&&(ws=yt()+500,sl&&Yo()))}function Ln(e,n){var o=e.callbackNode;oo(e,n);var l=vt(e,e===nn?fn:0);if(l===0)o!==null&&To(o),e.callbackNode=null,e.callbackPriority=0;else if(n=l&-l,e.callbackPriority!==n){if(o!=null&&To(o),n===1)e.tag===0?dy(Np.bind(null,e)):fd(Np.bind(null,e)),ly(function(){(xt&6)===0&&Yo()}),o=null;else{switch(Fa(l)){case 1:o=Lr;break;case 4:o=Io;break;case 16:o=Fr;break;case 536870912:o=fi;break;default:o=Fr}o=$p(o,Ep.bind(null,e))}e.callbackPriority=n,e.callbackNode=o}}function Ep(e,n){if(Tl=-1,Il=0,(xt&6)!==0)throw Error(i(327));var o=e.callbackNode;if(_s()&&e.callbackNode!==o)return null;var l=vt(e,e===nn?fn:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||n)n=Al(e,l);else{n=l;var p=xt;xt|=2;var m=Pp();(nn!==e||fn!==n)&&(Eo=null,ws=yt()+500,Mi(e,n));do try{Ay();break}catch(z){Cp(e,z)}while(!0);Ju(),Nl.current=m,xt=p,Ut!==null?n=0:(nn=null,fn=0,n=Zt)}if(n!==0){if(n===2&&(p=lr(e),p!==0&&(l=p,n=Rc(e,p))),n===1)throw o=fa,Mi(e,0),ti(e,l),Ln(e,yt()),o;if(n===6)ti(e,l);else{if(p=e.current.alternate,(l&30)===0&&!Ty(p)&&(n=Al(e,l),n===2&&(m=lr(e),m!==0&&(l=m,n=Rc(e,m))),n===1))throw o=fa,Mi(e,0),ti(e,l),Ln(e,yt()),o;switch(e.finishedWork=p,e.finishedLanes=l,n){case 0:case 1:throw Error(i(345));case 2:Ti(e,Dn,Eo);break;case 3:if(ti(e,l),(l&130023424)===l&&(n=Ac+500-yt(),10<n)){if(vt(e,0)!==0)break;if(p=e.suspendedLanes,(p&l)!==l){Pn(),e.pingedLanes|=e.suspendedLanes&p;break}e.timeoutHandle=Hu(Ti.bind(null,e,Dn,Eo),n);break}Ti(e,Dn,Eo);break;case 4:if(ti(e,l),(l&4194240)===l)break;for(n=e.eventTimes,p=-1;0<l;){var E=31-mn(l);m=1<<E,E=n[E],E>p&&(p=E),l&=~m}if(l=p,l=yt()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*My(l/1960))-l,10<l){e.timeoutHandle=Hu(Ti.bind(null,e,Dn,Eo),l);break}Ti(e,Dn,Eo);break;case 5:Ti(e,Dn,Eo);break;default:throw Error(i(329))}}}return Ln(e,yt()),e.callbackNode===o?Ep.bind(null,e):null}function Rc(e,n){var o=da;return e.current.memoizedState.isDehydrated&&(Mi(e,n).flags|=256),e=Al(e,n),e!==2&&(n=Dn,Dn=o,n!==null&&zc(n)),e}function zc(e){Dn===null?Dn=e:Dn.push.apply(Dn,e)}function Ty(e){for(var n=e;;){if(n.flags&16384){var o=n.updateQueue;if(o!==null&&(o=o.stores,o!==null))for(var l=0;l<o.length;l++){var p=o[l],m=p.getSnapshot;p=p.value;try{if(!se(m(),p))return!1}catch{return!1}}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ti(e,n){for(n&=~Ic,n&=~Cl,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var o=31-mn(n),l=1<<o;e[o]=-1,n&=~l}}function Np(e){if((xt&6)!==0)throw Error(i(327));_s();var n=vt(e,0);if((n&1)===0)return Ln(e,yt()),null;var o=Al(e,n);if(e.tag!==0&&o===2){var l=lr(e);l!==0&&(n=l,o=Rc(e,l))}if(o===1)throw o=fa,Mi(e,0),ti(e,n),Ln(e,yt()),o;if(o===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,Ti(e,Dn,Eo),Ln(e,yt()),null}function Dc(e,n){var o=xt;xt|=1;try{return e(n)}finally{xt=o,xt===0&&(ws=yt()+500,sl&&Yo())}}function ji(e){Jo!==null&&Jo.tag===0&&(xt&6)===0&&_s();var n=xt;xt|=1;var o=hr.transition,l=wt;try{if(hr.transition=null,wt=1,e)return e()}finally{wt=l,hr.transition=o,xt=n,(xt&6)===0&&Yo()}}function Lc(){Qn=xs.current,Tt(xs)}function Mi(e,n){e.finishedWork=null,e.finishedLanes=0;var o=e.timeoutHandle;if(o!==-1&&(e.timeoutHandle=-1,ay(o)),Ut!==null)for(o=Ut.return;o!==null;){var l=o;switch(Yu(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&ol();break;case 3:gs(),Tt(On),Tt(vn),ac();break;case 5:ic(l);break;case 4:gs();break;case 13:Tt(zt);break;case 19:Tt(zt);break;case 10:ec(l.type._context);break;case 22:case 23:Lc()}o=o.return}if(nn=e,Ut=e=ni(e.current,null),fn=Qn=n,Zt=0,fa=null,Ic=Cl=Pi=0,Dn=da=null,Ei!==null){for(n=0;n<Ei.length;n++)if(o=Ei[n],l=o.interleaved,l!==null){o.interleaved=null;var p=l.next,m=o.pending;if(m!==null){var E=m.next;m.next=p,l.next=E}o.pending=l}Ei=null}return e}function Cp(e,n){do{var o=Ut;try{if(Ju(),gl.current=wl,yl){for(var l=Dt.memoizedState;l!==null;){var p=l.queue;p!==null&&(p.pending=null),l=l.next}yl=!1}if(Ci=0,tn=Gt=Dt=null,ia=!1,sa=0,Tc.current=null,o===null||o.return===null){Zt=1,fa=n,Ut=null;break}e:{var m=e,E=o.return,z=o,K=n;if(n=fn,z.flags|=32768,K!==null&&typeof K=="object"&&typeof K.then=="function"){var ye=K,je=z,Te=je.tag;if((je.mode&1)===0&&(Te===0||Te===11||Te===15)){var Pe=je.alternate;Pe?(je.updateQueue=Pe.updateQueue,je.memoizedState=Pe.memoizedState,je.lanes=Pe.lanes):(je.updateQueue=null,je.memoizedState=null)}var Ve=Zd(E);if(Ve!==null){Ve.flags&=-257,Jd(Ve,E,z,m,n),Ve.mode&1&&Gd(m,ye,n),n=Ve,K=ye;var We=n.updateQueue;if(We===null){var Xe=new Set;Xe.add(K),n.updateQueue=Xe}else We.add(K);break e}else{if((n&1)===0){Gd(m,ye,n),Fc();break e}K=Error(i(426))}}else if($t&&z.mode&1){var Bt=Zd(E);if(Bt!==null){(Bt.flags&65536)===0&&(Bt.flags|=256),Jd(Bt,E,z,m,n),Gu(ys(K,z));break e}}m=K=ys(K,z),Zt!==4&&(Zt=2),da===null?da=[m]:da.push(m),m=E;do{switch(m.tag){case 3:m.flags|=65536,n&=-n,m.lanes|=n;var pe=Xd(m,K,n);Sd(m,pe);break e;case 1:z=K;var ee=m.type,me=m.stateNode;if((m.flags&128)===0&&(typeof ee.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(Zo===null||!Zo.has(me)))){m.flags|=65536,n&=-n,m.lanes|=n;var De=Qd(m,z,n);Sd(m,De);break e}}m=m.return}while(m!==null)}Mp(o)}catch(Qe){n=Qe,Ut===o&&o!==null&&(Ut=o=o.return);continue}break}while(!0)}function Pp(){var e=Nl.current;return Nl.current=wl,e===null?wl:e}function Fc(){(Zt===0||Zt===3||Zt===2)&&(Zt=4),nn===null||(Pi&268435455)===0&&(Cl&268435455)===0||ti(nn,fn)}function Al(e,n){var o=xt;xt|=2;var l=Pp();(nn!==e||fn!==n)&&(Eo=null,Mi(e,n));do try{Iy();break}catch(p){Cp(e,p)}while(!0);if(Ju(),xt=o,Nl.current=l,Ut!==null)throw Error(i(261));return nn=null,fn=0,Zt}function Iy(){for(;Ut!==null;)jp(Ut)}function Ay(){for(;Ut!==null&&!Pt();)jp(Ut)}function jp(e){var n=Ap(e.alternate,e,Qn);e.memoizedProps=e.pendingProps,n===null?Mp(e):Ut=n,Tc.current=null}function Mp(e){var n=e;do{var o=n.alternate;if(e=n.return,(n.flags&32768)===0){if(o=Ey(o,n,Qn),o!==null){Ut=o;return}}else{if(o=Ny(o,n),o!==null){o.flags&=32767,Ut=o;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Zt=6,Ut=null;return}}if(n=n.sibling,n!==null){Ut=n;return}Ut=n=e}while(n!==null);Zt===0&&(Zt=5)}function Ti(e,n,o){var l=wt,p=hr.transition;try{hr.transition=null,wt=1,$y(e,n,o,l)}finally{hr.transition=p,wt=l}return null}function $y(e,n,o,l){do _s();while(Jo!==null);if((xt&6)!==0)throw Error(i(327));o=e.finishedWork;var p=e.finishedLanes;if(o===null)return null;if(e.finishedWork=null,e.finishedLanes=0,o===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var m=o.lanes|o.childLanes;if(di(e,m),e===nn&&(Ut=nn=null,fn=0),(o.subtreeFlags&2064)===0&&(o.flags&2064)===0||jl||(jl=!0,$p(Fr,function(){return _s(),null})),m=(o.flags&15990)!==0,(o.subtreeFlags&15990)!==0||m){m=hr.transition,hr.transition=null;var E=wt;wt=1;var z=xt;xt|=4,Tc.current=null,Py(e,o),wp(o,e),oe(Fu),Ui=!!Lu,Fu=Lu=null,e.current=o,jy(o),sr(),xt=z,wt=E,hr.transition=m}else e.current=o;if(jl&&(jl=!1,Jo=e,Ml=p),m=e.pendingLanes,m===0&&(Zo=null),ut(o.stateNode),Ln(e,yt()),n!==null)for(l=e.onRecoverableError,o=0;o<n.length;o++)p=n[o],l(p.value,{componentStack:p.stack,digest:p.digest});if(Pl)throw Pl=!1,e=$c,$c=null,e;return(Ml&1)!==0&&e.tag!==0&&_s(),m=e.pendingLanes,(m&1)!==0?e===Oc?pa++:(pa=0,Oc=e):pa=0,Yo(),null}function _s(){if(Jo!==null){var e=Fa(Ml),n=hr.transition,o=wt;try{if(hr.transition=null,wt=16>e?16:e,Jo===null)var l=!1;else{if(e=Jo,Jo=null,Ml=0,(xt&6)!==0)throw Error(i(331));var p=xt;for(xt|=4,qe=e.current;qe!==null;){var m=qe,E=m.child;if((qe.flags&16)!==0){var z=m.deletions;if(z!==null){for(var K=0;K<z.length;K++){var ye=z[K];for(qe=ye;qe!==null;){var je=qe;switch(je.tag){case 0:case 11:case 15:ca(8,je,m)}var Te=je.child;if(Te!==null)Te.return=je,qe=Te;else for(;qe!==null;){je=qe;var Pe=je.sibling,Ve=je.return;if(mp(je),je===ye){qe=null;break}if(Pe!==null){Pe.return=Ve,qe=Pe;break}qe=Ve}}}var We=m.alternate;if(We!==null){var Xe=We.child;if(Xe!==null){We.child=null;do{var Bt=Xe.sibling;Xe.sibling=null,Xe=Bt}while(Xe!==null)}}qe=m}}if((m.subtreeFlags&2064)!==0&&E!==null)E.return=m,qe=E;else e:for(;qe!==null;){if(m=qe,(m.flags&2048)!==0)switch(m.tag){case 0:case 11:case 15:ca(9,m,m.return)}var pe=m.sibling;if(pe!==null){pe.return=m.return,qe=pe;break e}qe=m.return}}var ee=e.current;for(qe=ee;qe!==null;){E=qe;var me=E.child;if((E.subtreeFlags&2064)!==0&&me!==null)me.return=E,qe=me;else e:for(E=ee;qe!==null;){if(z=qe,(z.flags&2048)!==0)try{switch(z.tag){case 0:case 11:case 15:El(9,z)}}catch(Qe){Ft(z,z.return,Qe)}if(z===E){qe=null;break e}var De=z.sibling;if(De!==null){De.return=z.return,qe=De;break e}qe=z.return}}if(xt=p,Yo(),Nn&&typeof Nn.onPostCommitFiberRoot=="function")try{Nn.onPostCommitFiberRoot(ar,e)}catch{}l=!0}return l}finally{wt=o,hr.transition=n}}return!1}function Tp(e,n,o){n=ys(o,n),n=Xd(e,n,1),e=Qo(e,n,1),n=Pn(),e!==null&&(ur(e,1,n),Ln(e,n))}function Ft(e,n,o){if(e.tag===3)Tp(e,e,o);else for(;n!==null;){if(n.tag===3){Tp(n,e,o);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Zo===null||!Zo.has(l))){e=ys(o,e),e=Qd(n,e,1),n=Qo(n,e,1),e=Pn(),n!==null&&(ur(n,1,e),Ln(n,e));break}}n=n.return}}function Oy(e,n,o){var l=e.pingCache;l!==null&&l.delete(n),n=Pn(),e.pingedLanes|=e.suspendedLanes&o,nn===e&&(fn&o)===o&&(Zt===4||Zt===3&&(fn&130023424)===fn&&500>yt()-Ac?Mi(e,0):Ic|=o),Ln(e,n)}function Ip(e,n){n===0&&((e.mode&1)===0?n=1:(n=ro,ro<<=1,(ro&130023424)===0&&(ro=4194304)));var o=Pn();e=So(e,n),e!==null&&(ur(e,n,o),Ln(e,o))}function Ry(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),Ip(e,o)}function zy(e,n){var o=0;switch(e.tag){case 13:var l=e.stateNode,p=e.memoizedState;p!==null&&(o=p.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(i(314))}l!==null&&l.delete(n),Ip(e,o)}var Ap;Ap=function(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps||On.current)zn=!0;else{if((e.lanes&o)===0&&(n.flags&128)===0)return zn=!1,ky(e,n,o);zn=(e.flags&131072)!==0}else zn=!1,$t&&(n.flags&1048576)!==0&&dd(n,ll,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;bl(e,n),e=n.pendingProps;var p=us(n,vn.current);ms(n,o),p=cc(null,n,l,e,p,o);var m=fc();return n.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Rn(l)?(m=!0,il(n)):m=!1,n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,rc(n),p.updater=_l,n.stateNode=p,p._reactInternals=n,yc(n,l,e,o),n=_c(null,n,l,!0,m,o)):(n.tag=0,$t&&m&&Wu(n),Cn(null,n,p,o),n=n.child),n;case 16:l=n.elementType;e:{switch(bl(e,n),e=n.pendingProps,p=l._init,l=p(l._payload),n.type=l,p=n.tag=Ly(l),e=Cr(l,e),p){case 0:n=wc(null,n,l,e,o);break e;case 1:n=ip(null,n,l,e,o);break e;case 11:n=ep(null,n,l,e,o);break e;case 14:n=tp(null,n,l,Cr(l.type,e),o);break e}throw Error(i(306,l,""))}return n;case 0:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Cr(l,p),wc(e,n,l,p,o);case 1:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Cr(l,p),ip(e,n,l,p,o);case 3:e:{if(sp(n),e===null)throw Error(i(387));l=n.pendingProps,m=n.memoizedState,p=m.element,_d(e,n),hl(n,l,null,o);var E=n.memoizedState;if(l=E.element,m.isDehydrated)if(m={element:l,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=m,n.memoizedState=m,n.flags&256){p=ys(Error(i(423)),n),n=ap(e,n,l,o,p);break e}else if(l!==p){p=ys(Error(i(424)),n),n=ap(e,n,l,o,p);break e}else for(Xn=Uo(n.stateNode.containerInfo.firstChild),Yn=n,$t=!0,Nr=null,o=xd(n,null,l,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ds(),l===p){n=ko(e,n,o);break e}Cn(e,n,l,o)}n=n.child}return n;case 5:return kd(n),e===null&&Qu(n),l=n.type,p=n.pendingProps,m=e!==null?e.memoizedProps:null,E=p.children,Bu(l,p)?E=null:m!==null&&Bu(l,m)&&(n.flags|=32),op(e,n),Cn(e,n,E,o),n.child;case 6:return e===null&&Qu(n),null;case 13:return lp(e,n,o);case 4:return oc(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=ps(n,null,l,o):Cn(e,n,l,o),n.child;case 11:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Cr(l,p),ep(e,n,l,p,o);case 7:return Cn(e,n,n.pendingProps,o),n.child;case 8:return Cn(e,n,n.pendingProps.children,o),n.child;case 12:return Cn(e,n,n.pendingProps.children,o),n.child;case 10:e:{if(l=n.type._context,p=n.pendingProps,m=n.memoizedProps,E=p.value,Et(fl,l._currentValue),l._currentValue=E,m!==null)if(se(m.value,E)){if(m.children===p.children&&!On.current){n=ko(e,n,o);break e}}else for(m=n.child,m!==null&&(m.return=n);m!==null;){var z=m.dependencies;if(z!==null){E=m.child;for(var K=z.firstContext;K!==null;){if(K.context===l){if(m.tag===1){K=bo(-1,o&-o),K.tag=2;var ye=m.updateQueue;if(ye!==null){ye=ye.shared;var je=ye.pending;je===null?K.next=K:(K.next=je.next,je.next=K),ye.pending=K}}m.lanes|=o,K=m.alternate,K!==null&&(K.lanes|=o),tc(m.return,o,n),z.lanes|=o;break}K=K.next}}else if(m.tag===10)E=m.type===n.type?null:m.child;else if(m.tag===18){if(E=m.return,E===null)throw Error(i(341));E.lanes|=o,z=E.alternate,z!==null&&(z.lanes|=o),tc(E,o,n),E=m.sibling}else E=m.child;if(E!==null)E.return=m;else for(E=m;E!==null;){if(E===n){E=null;break}if(m=E.sibling,m!==null){m.return=E.return,E=m;break}E=E.return}m=E}Cn(e,n,p.children,o),n=n.child}return n;case 9:return p=n.type,l=n.pendingProps.children,ms(n,o),p=dr(p),l=l(p),n.flags|=1,Cn(e,n,l,o),n.child;case 14:return l=n.type,p=Cr(l,n.pendingProps),p=Cr(l.type,p),tp(e,n,l,p,o);case 15:return np(e,n,n.type,n.pendingProps,o);case 17:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Cr(l,p),bl(e,n),n.tag=1,Rn(l)?(e=!0,il(n)):e=!1,ms(n,o),Wd(n,l,p),yc(n,l,p,o),_c(null,n,l,!0,e,o);case 19:return cp(e,n,o);case 22:return rp(e,n,o)}throw Error(i(156,n.tag))};function $p(e,n){return ci(e,n)}function Dy(e,n,o,l){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mr(e,n,o,l){return new Dy(e,n,o,l)}function Bc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ly(e){if(typeof e=="function")return Bc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ue)return 11;if(e===ce)return 14}return 2}function ni(e,n){var o=e.alternate;return o===null?(o=mr(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function $l(e,n,o,l,p,m){var E=2;if(l=e,typeof e=="function")Bc(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case U:return Ii(o.children,p,m,n);case le:E=8,p|=8;break;case he:return e=mr(12,o,n,p|2),e.elementType=he,e.lanes=m,e;case xe:return e=mr(13,o,n,p),e.elementType=xe,e.lanes=m,e;case D:return e=mr(19,o,n,p),e.elementType=D,e.lanes=m,e;case ae:return Ol(o,p,m,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Se:E=10;break e;case W:E=9;break e;case ue:E=11;break e;case ce:E=14;break e;case te:E=16,l=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return n=mr(E,o,n,p),n.elementType=e,n.type=l,n.lanes=m,n}function Ii(e,n,o,l){return e=mr(7,e,l,n),e.lanes=o,e}function Ol(e,n,o,l){return e=mr(22,e,l,n),e.elementType=ae,e.lanes=o,e.stateNode={isHidden:!1},e}function Hc(e,n,o){return e=mr(6,e,null,n),e.lanes=o,e}function Vc(e,n,o){return n=mr(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Fy(e,n,o,l,p){this.tag=n,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=io(0),this.expirationTimes=io(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=io(0),this.identifierPrefix=l,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Kc(e,n,o,l,p,m,E,z,K){return e=new Fy(e,n,o,z,K),n===1?(n=1,m===!0&&(n|=8)):n=0,m=mr(3,null,null,n),e.current=m,m.stateNode=e,m.memoizedState={element:l,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},rc(m),e}function By(e,n,o){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:V,key:l==null?null:""+l,children:e,containerInfo:n,implementation:o}}function Op(e){if(!e)return Wo;e=e._reactInternals;e:{if(Qt(e)!==e||e.tag!==1)throw Error(i(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(Rn(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(i(171))}if(e.tag===1){var o=e.type;if(Rn(o))return ud(e,o,n)}return n}function Rp(e,n,o,l,p,m,E,z,K){return e=Kc(o,l,!0,e,p,m,E,z,K),e.context=Op(null),o=e.current,l=Pn(),p=ei(o),m=bo(l,p),m.callback=n??null,Qo(o,m,p),e.current.lanes=p,ur(e,p,l),Ln(e,l),e}function Rl(e,n,o,l){var p=n.current,m=Pn(),E=ei(p);return o=Op(o),n.context===null?n.context=o:n.pendingContext=o,n=bo(m,E),n.payload={element:e},l=l===void 0?null:l,l!==null&&(n.callback=l),e=Qo(p,n,E),e!==null&&(Mr(e,p,E,m),pl(e,p,E)),E}function zl(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 zp(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function Uc(e,n){zp(e,n),(e=e.alternate)&&zp(e,n)}function Hy(){return null}var Dp=typeof reportError=="function"?reportError:function(e){console.error(e)};function qc(e){this._internalRoot=e}Dl.prototype.render=qc.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));Rl(e,n,null,null)},Dl.prototype.unmount=qc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;ji(function(){Rl(null,e,null,null)}),n[vo]=null}};function Dl(e){this._internalRoot=e}Dl.prototype.unstable_scheduleHydration=function(e){if(e){var n=Ha();e={blockedOn:null,target:e,priority:n};for(var o=0;o<An.length&&n!==0&&n<An[o].priority;o++);An.splice(o,0,e),o===0&&Wn(e)}};function Wc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ll(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Lp(){}function Vy(e,n,o,l,p){if(p){if(typeof l=="function"){var m=l;l=function(){var ye=zl(E);m.call(ye)}}var E=Rp(n,l,e,0,null,!1,!1,"",Lp);return e._reactRootContainer=E,e[vo]=E.current,Gs(e.nodeType===8?e.parentNode:e),ji(),E}for(;p=e.lastChild;)e.removeChild(p);if(typeof l=="function"){var z=l;l=function(){var ye=zl(K);z.call(ye)}}var K=Kc(e,0,!1,null,null,!1,!1,"",Lp);return e._reactRootContainer=K,e[vo]=K.current,Gs(e.nodeType===8?e.parentNode:e),ji(function(){Rl(n,K,o,l)}),K}function Fl(e,n,o,l,p){var m=o._reactRootContainer;if(m){var E=m;if(typeof p=="function"){var z=p;p=function(){var K=zl(E);z.call(K)}}Rl(n,E,e,p)}else E=Vy(o,n,e,p,l);return zl(E)}mt=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var o=qn(n.pendingLanes);o!==0&&($o(n,o|1),Ln(n,yt()),(xt&6)===0&&(ws=yt()+500,Yo()))}break;case 13:ji(function(){var l=So(e,1);if(l!==null){var p=Pn();Mr(l,e,1,p)}}),Uc(e,1)}},Vi=function(e){if(e.tag===13){var n=So(e,134217728);if(n!==null){var o=Pn();Mr(n,e,134217728,o)}Uc(e,134217728)}},Ba=function(e){if(e.tag===13){var n=ei(e),o=So(e,n);if(o!==null){var l=Pn();Mr(o,e,n,l)}Uc(e,n)}},Ha=function(){return wt},gn=function(e,n){var o=wt;try{return wt=e,n()}finally{wt=o}},Fe=function(e,n,o){switch(n){case"input":if(kt(e,o),n=o.name,o.type==="radio"&&n!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<o.length;n++){var l=o[n];if(l!==e&&l.form===e.form){var p=rl(l);if(!p)throw Error(i(90));Oe(l),kt(l,p)}}}break;case"textarea":Jn(e,o);break;case"select":n=o.value,n!=null&&Nt(e,!!o.multiple,n,!1)}},Ze=Dc,dt=ji;var Ky={usingClientEntryPoint:!1,Events:[ea,as,rl,q,Be,Dc]},ha={findFiberByHostInstance:_i,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Uy={bundleType:ha.bundleType,version:ha.version,rendererPackageName:ha.rendererPackageName,rendererConfig:ha.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ui(e),e===null?null:e.stateNode},findFiberByHostInstance:ha.findFiberByHostInstance||Hy,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 Bl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bl.isDisabled&&Bl.supportsFiber)try{ar=Bl.inject(Uy),Nn=Bl}catch{}}return Fn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ky,Fn.createPortal=function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Wc(n))throw Error(i(200));return By(e,n,null,o)},Fn.createRoot=function(e,n){if(!Wc(e))throw Error(i(299));var o=!1,l="",p=Dp;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(p=n.onRecoverableError)),n=Kc(e,1,!1,null,null,o,!1,l,p),e[vo]=n.current,Gs(e.nodeType===8?e.parentNode:e),new qc(n)},Fn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=ui(n),e=e===null?null:e.stateNode,e},Fn.flushSync=function(e){return ji(e)},Fn.hydrate=function(e,n,o){if(!Ll(n))throw Error(i(200));return Fl(null,e,n,!0,o)},Fn.hydrateRoot=function(e,n,o){if(!Wc(e))throw Error(i(405));var l=o!=null&&o.hydratedSources||null,p=!1,m="",E=Dp;if(o!=null&&(o.unstable_strictMode===!0&&(p=!0),o.identifierPrefix!==void 0&&(m=o.identifierPrefix),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),n=Rp(n,null,e,1,o??null,p,!1,m,E),e[vo]=n.current,Gs(e),l)for(e=0;e<l.length;e++)o=l[e],p=o._getVersion,p=p(o._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[o,p]:n.mutableSourceEagerHydrationData.push(o,p);return new Dl(n)},Fn.render=function(e,n,o){if(!Ll(n))throw Error(i(200));return Fl(null,e,n,!1,o)},Fn.unmountComponentAtNode=function(e){if(!Ll(e))throw Error(i(40));return e._reactRootContainer?(ji(function(){Fl(null,null,e,!1,function(){e._reactRootContainer=null,e[vo]=null})}),!0):!1},Fn.unstable_batchedUpdates=Dc,Fn.unstable_renderSubtreeIntoContainer=function(e,n,o,l){if(!Ll(o))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return Fl(e,n,o,!1,l)},Fn.version="18.3.1-next-f1338f8080-20240426",Fn}var Wp;function lm(){if(Wp)return Qc.exports;Wp=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Qc.exports=t0(),Qc.exports}var Yp;function n0(){if(Yp)return Hl;Yp=1;var t=lm();return Hl.createRoot=t.createRoot,Hl.hydrateRoot=t.hydrateRoot,Hl}var r0=n0();const o0=yu(r0),i0=["get","post","put","patch","delete","options","head","trace"];function Xp(t){return t.replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_|_$/g,"").replace(/_+/g,"_")}function vu(t,r,i,a){if(i)return Xp(i).replace(/^[0-9]/,"_$&")||`op_${a}`;const u=Xp(r.replace(/[{}]/g,""));return`${t}_${u}`||`op_${a}`}function xu(t){var a;return`${(((a=t.info)==null?void 0:a.title)??"Api").replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean).map(u=>u.charAt(0).toUpperCase()+u.slice(1).toLowerCase()).join("")||"Api"}Client`}function wu(t){return(t.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join("")||"Api")+"Service"}function Jr(t){const r=[];if(!t.paths)return r;for(const[i,a]of Object.entries(t.paths)){if(!a||typeof a!="object"||"$ref"in a)continue;const u=a;for(const f of i0){const d=u[f];d&&typeof d=="object"&&r.push({method:f,path:i,operationId:d.operationId,tags:d.tags})}}return r}function s0(t,r,i,a="baseUrl"){var f,d;const u=r.toUpperCase();return`const ${a} = "${((d=(f=t.servers)==null?void 0:f[0])==null?void 0:d.url)??"http://localhost:3000"}";
41
+ /** @returns {Promise<unknown>} */
42
+ const res = await fetch(\`${a}${i}\`, {
43
+ method: "${u}",
44
+ headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
45
+ ${u==="GET"||u==="HEAD"?"":"body: JSON.stringify({}),"}
46
+ });
47
+ const data = await res.json();
48
+ `}function um(t,r){const i=t.map((a,u)=>` /**
49
+ * @param {{ headers?: Record<string, string> }} [options]
50
+ * @returns {Promise<unknown>}
51
+ */
52
+ async ${vu(a.method,a.path,a.operationId,u)}(options) {
53
+ const res = await fetch(\`\${this.baseUrl}${a.path}\`, {
54
+ method: "${a.method.toUpperCase()}",
55
+ headers: { ...this.defaultHeaders, ...options?.headers },
56
+ });
57
+ return res.json();
58
+ }`);return`export class ${r} {
59
+ /**
60
+ * @param {string} baseUrl
61
+ * @param {Record<string, string>} [defaultHeaders]
62
+ */
63
+ constructor(baseUrl, defaultHeaders = {}) {
64
+ this.baseUrl = baseUrl;
65
+ this.defaultHeaders = defaultHeaders;
66
+ }
67
+
68
+ ${i.join(`
69
+
70
+ `)}
71
+ }
72
+ `}function a0(t){return um(Jr(t),xu(t))}function l0(t,r){const i=wu(r),a=Jr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return um(a,i)}function u0(t,r,i){var f,d;const a=((d=(f=t.servers)==null?void 0:f[0])==null?void 0:d.url)??"http://localhost:3000",u=r.toUpperCase();return`<?php
73
+ $baseUrl = '${a}';
74
+ $url = $baseUrl . '${i}';
75
+ $opts = [
76
+ 'http' => [
77
+ 'method' => '${u}',
78
+ 'header' => "Content-Type: application/json\\r\\nAuthorization: Bearer {$token}\\r\\n",
79
+ ${u==="GET"||u==="HEAD"?"":"'content' => json_encode([]),"}
80
+ ],
81
+ ];
82
+ $context = stream_context_create($opts);
83
+ $response = file_get_contents($url, false, $context);
84
+ $data = json_decode($response, true);
85
+ `}function cm(t,r){const i=t.map((a,u)=>` public function ${vu(a.method,a.path,a.operationId,u)}(array $extraHeaders = []): array
86
+ {
87
+ $url = $this->baseUrl . '${a.path}';
88
+ $headers = array_merge($this->defaultHeaders, $extraHeaders);
89
+ $opts = [
90
+ 'http' => [
91
+ 'method' => '${a.method.toUpperCase()}',
92
+ 'header' => $this->formatHeaders($headers),
93
+ ],
94
+ ];
95
+ $ctx = stream_context_create($opts);
96
+ $raw = file_get_contents($url, false, $ctx);
97
+ return json_decode($raw ?: '[]', true) ?: [];
98
+ }`);return`<?php
99
+
100
+ declare(strict_types=1);
101
+
102
+ final class ${r}
103
+ {
104
+ public function __construct(
105
+ private string $baseUrl,
106
+ /** @var array<string, string> */
107
+ private array $defaultHeaders = [],
108
+ ) {
109
+ $this->baseUrl = rtrim($baseUrl, '/');
110
+ }
111
+
112
+ /** @param array<string, string> $headers */
113
+ private function formatHeaders(array $headers): string
114
+ {
115
+ $lines = [];
116
+ foreach ($headers as $k => $v) {
117
+ $lines[] = $k . ': ' . $v;
118
+ }
119
+ return implode("\\r\\n", $lines) . "\\r\\n";
120
+ }
121
+
122
+ ${i.join(`
123
+
124
+ `)}
125
+ }
126
+ `}function c0(t){return cm(Jr(t),xu(t))}function f0(t,r){const i=wu(r),a=Jr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return cm(a,i)}function d0(t,r,i){var d,g;const a=((g=(d=t.servers)==null?void 0:d[0])==null?void 0:g.url)??"http://localhost:3000",u=r.toLowerCase();return`import httpx
127
+
128
+ base_url = "${a}"
129
+ url = f"{base_url}${i}"
130
+ headers = {"Authorization": f"Bearer {token}"}
131
+ with httpx.Client() as client:
132
+ response = client.${u}(url, headers=headers${u==="get"||u==="head"?"":", json={}"})
133
+ data = response.json()
134
+ `}function fm(t,r){const i=t.map((a,u)=>{const f=vu(a.method,a.path,a.operationId,u),d=a.method.toLowerCase(),g=d==="get"||d==="head"?"":", json={}";return` def ${f}(self, headers: dict | None = None) -> dict:
135
+ h = {**self.default_headers, **(headers or {})}
136
+ r = self._client.${d}(f"{self.base_url}${a.path}", headers=h${g})
137
+ return r.json()`});return`from __future__ import annotations
138
+ import httpx
139
+
140
+ class ${r}:
141
+ def __init__(self, base_url: str, default_headers: dict | None = None) -> None:
142
+ self.base_url = base_url.rstrip("/")
143
+ self.default_headers = default_headers or {}
144
+ self._client = httpx.Client()
145
+
146
+ def close(self) -> None:
147
+ self._client.close()
148
+
149
+ ${i.join(`
150
+
151
+ `)}
152
+ `}function p0(t){return fm(Jr(t),xu(t))}function h0(t,r){const i=wu(r),a=Jr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return fm(a,i)}function m0(t){const r=t.split("/");return(r[r.length-1]??"Unknown").replace(/[^a-zA-Z0-9_]/g,"_")}function gf(t){if(!t)return"unknown";if("$ref"in t&&t.$ref)return m0(t.$ref);const r=t;return r.type==="string"?"string":r.type==="number"||r.type==="integer"?"number":r.type==="boolean"?"boolean":r.type==="array"&&r.items?`${gf(r.items)}[]`:r.type==="object"&&r.properties?`{
153
+ ${Object.entries(r.properties).map(([a,u])=>` ${JSON.stringify(a)}?: ${gf(u)};`).join(`
154
+ `)}
155
+ }`:"Record<string, unknown>"}function g0(t,r,i,a="baseUrl"){var w,S,x,b,N,C;const u=(S=(w=t.paths)==null?void 0:w[i])==null?void 0:S[r],f=u==null?void 0:u.requestBody;let d;if((b=(x=f==null?void 0:f.content)==null?void 0:x["application/json"])!=null&&b.schema){const A=f.content["application/json"].schema;A&&!("$ref"in A)&&(d=A)}const g=d?gf(d):"Record<string, unknown>",v=r.toUpperCase();return`const ${a} = "${((C=(N=t.servers)==null?void 0:N[0])==null?void 0:C.url)??"http://localhost:3000"}";
156
+ const res = await fetch(\`${a}${i}\`, {
157
+ method: "${v}",
158
+ headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
159
+ ${v==="GET"||v==="HEAD"?"":`body: JSON.stringify({} as ${g}),`}
160
+ });
161
+ const data = await res.json() as unknown;
162
+ `}function dm(t,r){const i=t.map((a,u)=>` async ${vu(a.method,a.path,a.operationId,u)}(options?: { headers?: Record<string, string> }): Promise<unknown> {
163
+ const res = await fetch(\`\${this.baseUrl}${a.path}\`, {
164
+ method: "${a.method.toUpperCase()}",
165
+ headers: { ...this.defaultHeaders, ...options?.headers },
166
+ });
167
+ return res.json();
168
+ }`);return`export class ${r} {
169
+ constructor(
170
+ private baseUrl: string,
171
+ private defaultHeaders: Record<string, string> = {},
172
+ ) {}
173
+
174
+ ${i.join(`
175
+
176
+ `)}
177
+ }
178
+ `}function y0(t){const r=Jr(t),i=xu(t);return dm(r,i)}function v0(t,r){const i=wu(r),a=Jr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return dm(a,i)}function x0(t,r,i,a){switch(r){case"typescript":return g0(t,i,a);case"javascript":return s0(t,i,a);case"python":return d0(t,i,a);case"php":return u0(t,i,a);default:{const u=r;throw new Error(`Unsupported language: ${u}`)}}}function w0(t,r,i){switch(r){case"typescript":return v0(t,i);case"javascript":return l0(t,i);case"python":return h0(t,i);case"php":return f0(t,i);default:{const a=r;throw new Error(`Unsupported language: ${a}`)}}}function _0(t,r,i){if(i===null)switch(r){case"typescript":return y0(t);case"javascript":return a0(t);case"python":return p0(t);case"php":return c0(t);default:{const a=r;throw new Error(`Unsupported language: ${a}`)}}return w0(t,r,i)}function S0(t){const r=new Set;for(const i of Jr(t))for(const a of i.tags??[])r.add(a);return r.size===0&&r.add("default"),[...r].sort()}function Ss(t,r){var i,a,u;return r!=null&&r.trim()?r.replace(/\/$/,""):((u=(a=(i=t.servers)==null?void 0:i[0])==null?void 0:a.url)==null?void 0:u.replace(/\/$/,""))??window.location.origin}function b0(t){var i;const r=(i=t.components)==null?void 0:i.securitySchemes;return r?Object.keys(r):[]}function Af(t,r){if(!r.startsWith("$"))return;let i=t;const a=r.slice(1);if(a.startsWith(".")){for(const u of a.slice(1).split("."))if(i&&typeof i=="object"&&u in i)i=i[u];else return;return i}return i}var Zl={exports:{}},k0=Zl.exports,Qp;function E0(){return Qp||(Qp=1,(function(t,r){((i,a)=>{t.exports=a()})(k0,function(){var i=function(s,c){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(h,y){h.__proto__=y}:function(h,y){for(var _ in y)Object.prototype.hasOwnProperty.call(y,_)&&(h[_]=y[_])}))(s,c)},a=function(){return(a=Object.assign||function(s){for(var c,h=1,y=arguments.length;h<y;h++)for(var _ in c=arguments[h])Object.prototype.hasOwnProperty.call(c,_)&&(s[_]=c[_]);return s}).apply(this,arguments)};function u(s,c,h){for(var y,_=0,k=c.length;_<k;_++)!y&&_ in c||((y=y||Array.prototype.slice.call(c,0,_))[_]=c[_]);return s.concat(y||Array.prototype.slice.call(c))}var f=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Xy,d=Object.keys,g=Array.isArray;function v(s,c){return typeof c=="object"&&d(c).forEach(function(h){s[h]=c[h]}),s}typeof Promise>"u"||f.Promise||(f.Promise=Promise);var w=Object.getPrototypeOf,S={}.hasOwnProperty;function x(s,c){return S.call(s,c)}function b(s,c){typeof c=="function"&&(c=c(w(s))),(typeof Reflect>"u"?d:Reflect.ownKeys)(c).forEach(function(h){C(s,h,c[h])})}var N=Object.defineProperty;function C(s,c,h,y){N(s,c,v(h&&x(h,"get")&&typeof h.get=="function"?{get:h.get,set:h.set,configurable:!0}:{value:h,configurable:!0,writable:!0},y))}function A(s){return{from:function(c){return s.prototype=Object.create(c.prototype),C(s.prototype,"constructor",s),{extend:b.bind(null,s.prototype)}}}}var T=Object.getOwnPropertyDescriptor,$=[].slice;function H(s,c,h){return $.call(s,c,h)}function M(s,c){return c(s)}function R(s){if(!s)throw new Error("Assertion Failed")}function X(s){f.setImmediate?setImmediate(s):setTimeout(s,0)}function V(s,c){if(typeof c=="string"&&x(s,c))return s[c];if(!c)return s;if(typeof c!="string"){for(var h=[],y=0,_=c.length;y<_;++y){var k=V(s,c[y]);h.push(k)}return h}var j,I=c.indexOf(".");return I===-1||(j=s[c.substr(0,I)])==null?void 0:V(j,c.substr(I+1))}function U(s,c,h){if(s&&c!==void 0&&!("isFrozen"in Object&&Object.isFrozen(s)))if(typeof c!="string"&&"length"in c){R(typeof h!="string"&&"length"in h);for(var y=0,_=c.length;y<_;++y)U(s,c[y],h[y])}else{var k,j,I=c.indexOf(".");I!==-1?(k=c.substr(0,I),(I=c.substr(I+1))===""?h===void 0?g(s)&&!isNaN(parseInt(k))?s.splice(k,1):delete s[k]:s[k]=h:U(j=(j=s[k])&&x(s,k)?j:s[k]={},I,h)):h===void 0?g(s)&&!isNaN(parseInt(c))?s.splice(c,1):delete s[c]:s[c]=h}}function le(s){var c,h={};for(c in s)x(s,c)&&(h[c]=s[c]);return h}var he=[].concat;function Se(s){return he.apply([],s)}var B="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Se([8,16,32,64].map(function(s){return["Int","Uint","Float"].map(function(c){return c+s+"Array"})}))).filter(function(s){return f[s]}),W=new Set(B.map(function(s){return f[s]})),ue=null;function xe(s){return ue=new WeakMap,s=(function c(h){if(!h||typeof h!="object")return h;var y=ue.get(h);if(y)return y;if(g(h)){y=[],ue.set(h,y);for(var _=0,k=h.length;_<k;++_)y.push(c(h[_]))}else if(W.has(h.constructor))y=h;else{var j,I=w(h);for(j in y=I===Object.prototype?{}:Object.create(I),ue.set(h,y),h)x(h,j)&&(y[j]=c(h[j]))}return y})(s),ue=null,s}var D={}.toString;function ce(s){return D.call(s).slice(8,-1)}var te=typeof Symbol<"u"?Symbol.iterator:"@@iterator",ae=typeof te=="symbol"?function(s){var c;return s!=null&&(c=s[te])&&c.apply(s)}:function(){return null};function L(s,c){c=s.indexOf(c),0<=c&&s.splice(c,1)}var F={};function Q(s){var c,h,y,_;if(arguments.length===1){if(g(s))return s.slice();if(this===F&&typeof s=="string")return[s];if(_=ae(s))for(h=[];!(y=_.next()).done;)h.push(y.value);else{if(s==null)return[s];if(typeof(c=s.length)!="number")return[s];for(h=new Array(c);c--;)h[c]=s[c]}}else for(c=arguments.length,h=new Array(c);c--;)h[c]=arguments[c];return h}var O=typeof Symbol<"u"?function(s){return s[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},B=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Ct=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(B),be={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function _e(s,c){this.name=s,this.message=c}function $e(s,c){return s+". Errors: "+Object.keys(c).map(function(h){return c[h].toString()}).filter(function(h,y,_){return _.indexOf(h)===y}).join(`
179
+ `)}function Ie(s,c,h,y){this.failures=c,this.failedKeys=y,this.successCount=h,this.message=$e(s,c)}function ze(s,c){this.name="BulkError",this.failures=Object.keys(c).map(function(h){return c[h]}),this.failuresByPos=c,this.message=$e(s,this.failures)}A(_e).from(Error).extend({toString:function(){return this.name+": "+this.message}}),A(Ie).from(_e),A(ze).from(_e);var we=Ct.reduce(function(s,c){return s[c]=c+"Error",s},{}),Le=_e,ke=Ct.reduce(function(s,c){var h=c+"Error";function y(_,k){this.name=h,_?typeof _=="string"?(this.message="".concat(_).concat(k?`
180
+ `+k:""),this.inner=k||null):typeof _=="object"&&(this.message="".concat(_.name," ").concat(_.message),this.inner=_):(this.message=be[c]||h,this.inner=null)}return A(y).from(Le),s[c]=y,s},{}),Je=(ke.Syntax=SyntaxError,ke.Type=TypeError,ke.Range=RangeError,B.reduce(function(s,c){return s[c+"Error"]=ke[c],s},{}));B=Ct.reduce(function(s,c){return["Syntax","Type","Range"].indexOf(c)===-1&&(s[c+"Error"]=ke[c]),s},{});function Oe(){}function Ye(s){return s}function et(s,c){return s==null||s===Ye?c:function(h){return c(s(h))}}function ft(s,c){return function(){s.apply(this,arguments),c.apply(this,arguments)}}function lt(s,c){return s===Oe?c:function(){var h=s.apply(this,arguments),y=(h!==void 0&&(arguments[0]=h),this.onsuccess),_=this.onerror,k=(this.onsuccess=null,this.onerror=null,c.apply(this,arguments));return y&&(this.onsuccess=this.onsuccess?ft(y,this.onsuccess):y),_&&(this.onerror=this.onerror?ft(_,this.onerror):_),k!==void 0?k:h}}function kt(s,c){return s===Oe?c:function(){s.apply(this,arguments);var h=this.onsuccess,y=this.onerror;this.onsuccess=this.onerror=null,c.apply(this,arguments),h&&(this.onsuccess=this.onsuccess?ft(h,this.onsuccess):h),y&&(this.onerror=this.onerror?ft(y,this.onerror):y)}}function dn(s,c){return s===Oe?c:function(_){var y=s.apply(this,arguments),_=(v(_,y),this.onsuccess),k=this.onerror,j=(this.onsuccess=null,this.onerror=null,c.apply(this,arguments));return _&&(this.onsuccess=this.onsuccess?ft(_,this.onsuccess):_),k&&(this.onerror=this.onerror?ft(k,this.onerror):k),y===void 0?j===void 0?void 0:j:v(y,j)}}function on(s,c){return s===Oe?c:function(){return c.apply(this,arguments)!==!1&&s.apply(this,arguments)}}function Wt(s,c){return s===Oe?c:function(){var h=s.apply(this,arguments);if(h&&typeof h.then=="function"){for(var y=this,_=arguments.length,k=new Array(_);_--;)k[_]=arguments[_];return h.then(function(){return c.apply(y,k)})}return c.apply(this,arguments)}}B.ModifyError=Ie,B.DexieError=_e,B.BulkError=ze;var Nt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function jn(s){Nt=s}var pn={},Jn=100,Sn=typeof Promise>"u"?[]:(Ct=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[Sn=crypto.subtle.digest("SHA-512",new Uint8Array([0])),w(Sn),Ct]:[Ct,w(Ct),Ct]),Ct=Sn[0],po=Sn[1],po=po&&po.then,Yt=Ct&&Ct.constructor,Hn=!!Sn[2],er=function(s,c){Kn.push([s,c]),hn&&(queueMicrotask(dt),hn=!1)},Ht=!0,hn=!0,Vn=[],gr=[],Rr=Ye,bn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Oe,pgp:!1,env:{},finalize:Oe},Ue=bn,Kn=[],kn=0,tr=[];function Fe(s){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var c=this._PSD=Ue;if(typeof s!="function"){if(s!==pn)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&yr(this,this._value)}else this._state=null,this._value=null,++c.ref,(function h(y,_){try{_(function(k){if(y._state===null){if(k===y)throw new TypeError("A promise cannot be resolved with itself.");var j=y._lib&&Lt();k&&typeof k.then=="function"?h(y,function(I,G){k instanceof Fe?k._then(I,G):k.then(I,G)}):(y._state=!0,y._value=k,q(y)),j&&Xt()}},yr.bind(null,y))}catch(k){yr(y,k)}})(this,s)}var Mn={get:function(){var s=Ue,c=En;function h(y,_){var k=this,j=!s.global&&(s!==Ue||c!==En),I=j&&!Qt(),G=new Fe(function(se,J){Be(k,new Un(ci(y,s,j,I),ci(_,s,j,I),se,J,s))});return this._consoleTask&&(G._consoleTask=this._consoleTask),G}return h.prototype=pn,h},set:function(s){C(this,"then",s&&s.prototype===pn?Mn:{get:function(){return s},set:Mn.set})}};function Un(s,c,h,y,_){this.onFulfilled=typeof s=="function"?s:null,this.onRejected=typeof c=="function"?c:null,this.resolve=h,this.reject=y,this.psd=_}function yr(s,c){var h,y;gr.push(c),s._state===null&&(h=s._lib&&Lt(),c=Rr(c),s._state=!1,s._value=c,y=s,Vn.some(function(_){return _._value===y._value})||Vn.push(y),q(s),h)&&Xt()}function q(s){var c=s._listeners;s._listeners=[];for(var h=0,y=c.length;h<y;++h)Be(s,c[h]);var _=s._PSD;--_.ref||_.finalize(),kn===0&&(++kn,er(function(){--kn==0&&Vt()},[]))}function Be(s,c){if(s._state===null)s._listeners.push(c);else{var h=s._state?c.onFulfilled:c.onRejected;if(h===null)return(s._state?c.resolve:c.reject)(s._value);++c.psd.ref,++kn,er(Ze,[h,s,c])}}function Ze(s,c,h){try{var y,_=c._value;!c._state&&gr.length&&(gr=[]),y=Nt&&c._consoleTask?c._consoleTask.run(function(){return s(_)}):s(_),c._state||gr.indexOf(_)!==-1||(k=>{for(var j=Vn.length;j;)if(Vn[--j]._value===k._value)return Vn.splice(j,1)})(c),h.resolve(y)}catch(k){h.reject(k)}finally{--kn==0&&Vt(),--h.psd.ref||h.psd.finalize()}}function dt(){ir(bn,function(){Lt()&&Xt()})}function Lt(){var s=Ht;return hn=Ht=!1,s}function Xt(){var s,c,h;do for(;0<Kn.length;)for(s=Kn,Kn=[],h=s.length,c=0;c<h;++c){var y=s[c];y[0].apply(null,y[1])}while(0<Kn.length);hn=Ht=!0}function Vt(){for(var s=Vn,c=(Vn=[],s.forEach(function(y){y._PSD.onunhandled.call(null,y._value,y)}),tr.slice(0)),h=c.length;h;)c[--h]()}function sn(s){return new Fe(pn,!1,s)}function ht(s,c){var h=Ue;return function(){var y=Lt(),_=Ue;try{return or(h,!0),s.apply(this,arguments)}catch(k){c&&c(k)}finally{or(_,!1),y&&Xt()}}}b(Fe.prototype,{then:Mn,_then:function(s,c){Be(this,new Un(null,null,s,c,Ue))},catch:function(s){var c,h;return arguments.length===1?this.then(null,s):(c=s,h=arguments[1],typeof c=="function"?this.then(null,function(y){return(y instanceof c?h:sn)(y)}):this.then(null,function(y){return(y&&y.name===c?h:sn)(y)}))},finally:function(s){return this.then(function(c){return Fe.resolve(s()).then(function(){return c})},function(c){return Fe.resolve(s()).then(function(){return sn(c)})})},timeout:function(s,c){var h=this;return s<1/0?new Fe(function(y,_){var k=setTimeout(function(){return _(new ke.Timeout(c))},s);h.then(y,_).finally(clearTimeout.bind(null,k))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&C(Fe.prototype,Symbol.toStringTag,"Dexie.Promise"),bn.env=ui(),b(Fe,{all:function(){var s=Q.apply(null,arguments).map(Dr);return new Fe(function(c,h){s.length===0&&c([]);var y=s.length;s.forEach(function(_,k){return Fe.resolve(_).then(function(j){s[k]=j,--y||c(s)},h)})})},resolve:function(s){return s instanceof Fe?s:s&&typeof s.then=="function"?new Fe(function(c,h){s.then(c,h)}):new Fe(pn,!0,s)},reject:sn,race:function(){var s=Q.apply(null,arguments).map(Dr);return new Fe(function(c,h){s.map(function(y){return Fe.resolve(y).then(c,h)})})},PSD:{get:function(){return Ue},set:function(s){return Ue=s}},totalEchoes:{get:function(){return En}},newPSD:rr,usePSD:ir,scheduler:{get:function(){return er},set:function(s){er=s}},rejectionMapper:{get:function(){return Rr},set:function(s){Rr=s}},follow:function(s,c){return new Fe(function(h,y){return rr(function(_,k){var j=Ue;j.unhandleds=[],j.onunhandled=k,j.finalize=ft(function(){var I,G=this;I=function(){G.unhandleds.length===0?_():k(G.unhandleds[0])},tr.push(function se(){I(),tr.splice(tr.indexOf(se),1)}),++kn,er(function(){--kn==0&&Vt()},[])},j.finalize),s()},c,h,y)})}}),Yt&&(Yt.allSettled&&C(Fe,"allSettled",function(){var s=Q.apply(null,arguments).map(Dr);return new Fe(function(c){s.length===0&&c([]);var h=s.length,y=new Array(h);s.forEach(function(_,k){return Fe.resolve(_).then(function(j){return y[k]={status:"fulfilled",value:j}},function(j){return y[k]={status:"rejected",reason:j}}).then(function(){return--h||c(y)})})})}),Yt.any&&typeof AggregateError<"u"&&C(Fe,"any",function(){var s=Q.apply(null,arguments).map(Dr);return new Fe(function(c,h){s.length===0&&h(new AggregateError([]));var y=s.length,_=new Array(y);s.forEach(function(k,j){return Fe.resolve(k).then(function(I){return c(I)},function(I){_[j]=I,--y||h(new AggregateError(_))})})})}),Yt.withResolvers)&&(Fe.withResolvers=Yt.withResolvers);var bt={awaits:0,echoes:0,id:0},nr=0,Tn=[],In=0,En=0,ai=0;function rr(s,j,h,y){var _=Ue,k=Object.create(_),j=(k.parent=_,k.ref=0,k.global=!1,k.id=++ai,bn.env,k.env=Hn?{Promise:Fe,PromiseProp:{value:Fe,configurable:!0,writable:!0},all:Fe.all,race:Fe.race,allSettled:Fe.allSettled,any:Fe.any,resolve:Fe.resolve,reject:Fe.reject}:{},j&&v(k,j),++_.ref,k.finalize=function(){--this.parent.ref||this.parent.finalize()},ir(k,s,h,y));return k.ref===0&&k.finalize(),j}function zr(){return bt.id||(bt.id=++nr),++bt.awaits,bt.echoes+=Jn,bt.id}function Qt(){return!!bt.awaits&&(--bt.awaits==0&&(bt.id=0),bt.echoes=bt.awaits*Jn,!0)}function Dr(s){return bt.echoes&&s&&s.constructor===Yt?(zr(),s.then(function(c){return Qt(),c},function(c){return Qt(),Pt(c)})):s}function li(){var s=Tn[Tn.length-1];Tn.pop(),or(s,!1)}function or(s,c){var h,y,_=Ue;(c?!bt.echoes||In++&&s===Ue:!In||--In&&s===Ue)||queueMicrotask(c?(function(k){++En,bt.echoes&&--bt.echoes!=0||(bt.echoes=bt.awaits=bt.id=0),Tn.push(Ue),or(k,!0)}).bind(null,s):li),s!==Ue&&(Ue=s,_===bn&&(bn.env=ui()),Hn)&&(h=bn.env.Promise,y=s.env,_.global||s.global)&&(Object.defineProperty(f,"Promise",y.PromiseProp),h.all=y.all,h.race=y.race,h.resolve=y.resolve,h.reject=y.reject,y.allSettled&&(h.allSettled=y.allSettled),y.any)&&(h.any=y.any)}function ui(){var s=f.Promise;return Hn?{Promise:s,PromiseProp:Object.getOwnPropertyDescriptor(f,"Promise"),all:s.all,race:s.race,allSettled:s.allSettled,any:s.any,resolve:s.resolve,reject:s.reject}:{}}function ir(s,c,h,y,_){var k=Ue;try{return or(s,!0),c(h,y,_)}finally{or(k,!1)}}function ci(s,c,h,y){return typeof s!="function"?s:function(){var _=Ue;h&&zr(),or(c,!0);try{return s.apply(this,arguments)}finally{or(_,!1),y&&queueMicrotask(Qt)}}}function To(s){Promise===Yt&&bt.echoes===0?In===0?s():enqueueNativeMicroTask(s):setTimeout(s,0)}(""+po).indexOf("[native code]")===-1&&(zr=Qt=Oe);var Pt=Fe.reject,sr="￿",yt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Bi="String expected.",Lr="__dbnames",Io="readonly",Fr="readwrite";function vr(s,c){return s?c?function(){return s.apply(this,arguments)&&c.apply(this,arguments)}:s:c}var fi={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ar(s){return typeof s!="string"||/\./.test(s)?function(c){return c}:function(c){return c[s]===void 0&&s in c&&delete(c=xe(c))[s],c}}function Nn(){throw ke.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function ut(s,c){try{var h=mn(s),y=mn(c);if(h!==y)return h==="Array"?1:y==="Array"?-1:h==="binary"?1:y==="binary"?-1:h==="string"?1:y==="string"?-1:h==="Date"?1:y!=="Date"?NaN:-1;switch(h){case"number":case"Date":case"string":return c<s?1:s<c?-1:0;case"binary":for(var _=Hi(s),k=Hi(c),j=_.length,I=k.length,G=j<I?j:I,se=0;se<G;++se)if(_[se]!==k[se])return _[se]<k[se]?-1:1;return j===I?0:j<I?-1:1;case"Array":for(var J=s,Y=c,Z=J.length,ie=Y.length,re=Z<ie?Z:ie,ne=0;ne<re;++ne){var oe=ut(J[ne],Y[ne]);if(oe!==0)return oe}return Z===ie?0:Z<ie?-1:1}}catch{}return NaN}function mn(s){var c=typeof s;return c=="object"&&(ArrayBuffer.isView(s)||(c=ce(s))==="ArrayBuffer")?"binary":c}function Hi(s){return s instanceof Uint8Array?s:ArrayBuffer.isView(s)?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s)}function Ao(s,c,h){var y=s.schema.yProps;return y?(c&&0<h.numFailures&&(c=c.filter(function(_,k){return!h.failures[k]})),Promise.all(y.map(function(_){return _=_.updatesTable,c?s.db.table(_).where("k").anyOf(c).delete():s.db.table(_).clear()})).then(function(){return h})):h}no.prototype.execute=function(s){var c=this["@@propmod"];if(c.add!==void 0){var h=c.add;if(g(h))return u(u([],g(s)?s:[],!0),h).sort();if(typeof h=="number")return(Number(s)||0)+h;if(typeof h=="bigint")try{return BigInt(s)+h}catch{return BigInt(0)+h}throw new TypeError("Invalid term ".concat(h))}if(c.remove!==void 0){var y=c.remove;if(g(y))return g(s)?s.filter(function(_){return!y.includes(_)}).sort():[];if(typeof y=="number")return Number(s)-y;if(typeof y=="bigint")try{return BigInt(s)-y}catch{return BigInt(0)-y}throw new TypeError("Invalid subtrahend ".concat(y))}return h=(h=c.replacePrefix)==null?void 0:h[0],h&&typeof s=="string"&&s.startsWith(h)?c.replacePrefix[1]+s.substring(h.length):s};var to=no;function no(s){this["@@propmod"]=s}function ro(s,c){for(var h=d(c),y=h.length,_=!1,k=0;k<y;++k){var j=h[k],I=c[j],G=V(s,j);I instanceof to?(U(s,j,I.execute(G)),_=!0):G!==I&&(U(s,j,I),_=!0)}return _}vt.prototype._trans=function(s,c,h){var y=this._tx||Ue.trans,_=this.name,k=Nt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(s==="readonly"?"read":"write"," ").concat(this.name));function j(se,J,Y){if(Y.schema[_])return c(Y.idbtrans,Y);throw new ke.NotFound("Table "+_+" not part of transaction")}var I=Lt();try{var G=y&&y.db._novip===this.db._novip?y===Ue.trans?y._promise(s,j,h):rr(function(){return y._promise(s,j,h)},{trans:y,transless:Ue.transless||Ue}):(function se(J,Y,Z,ie){if(J.idbdb&&(J._state.openComplete||Ue.letThrough||J._vip)){var re=J._createTransaction(Y,Z,J._dbSchema);try{re.create(),J._state.PR1398_maxLoop=3}catch(ne){return ne.name===we.InvalidState&&J.isOpen()&&0<--J._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),J.close({disableAutoOpen:!1}),J.open().then(function(){return se(J,Y,Z,ie)})):Pt(ne)}return re._promise(Y,function(ne,oe){return rr(function(){return Ue.trans=re,ie(ne,oe,re)})}).then(function(ne){if(Y==="readwrite")try{re.idbtrans.commit()}catch{}return Y==="readonly"?ne:re._completion.then(function(){return ne})})}if(J._state.openComplete)return Pt(new ke.DatabaseClosed(J._state.dbOpenError));if(!J._state.isBeingOpened){if(!J._state.autoOpen)return Pt(new ke.DatabaseClosed);J.open().catch(Oe)}return J._state.dbReadyPromise.then(function(){return se(J,Y,Z,ie)})})(this.db,s,[this.name],j);return k&&(G._consoleTask=k,G=G.catch(function(se){return console.trace(se),Pt(se)})),G}finally{I&&Xt()}},vt.prototype.get=function(s,c){var h=this;return s&&s.constructor===Object?this.where(s).first(c):s==null?Pt(new ke.Type("Invalid argument to Table.get()")):this._trans("readonly",function(y){return h.core.get({trans:y,key:s}).then(function(_){return h.hook.reading.fire(_)})}).then(c)},vt.prototype.where=function(s){if(typeof s=="string")return new this.db.WhereClause(this,s);if(g(s))return new this.db.WhereClause(this,"[".concat(s.join("+"),"]"));var c=d(s);if(c.length===1)return this.where(c[0]).equals(s[c[0]]);var h=this.schema.indexes.concat(this.schema.primKey).filter(function(I){if(I.compound&&c.every(function(se){return 0<=I.keyPath.indexOf(se)})){for(var G=0;G<c.length;++G)if(c.indexOf(I.keyPath[G])===-1)return!1;return!0}return!1}).sort(function(I,G){return I.keyPath.length-G.keyPath.length})[0];if(h&&this.db._maxKey!==sr)return j=h.keyPath.slice(0,c.length),this.where(j).equals(j.map(function(I){return s[I]}));!h&&Nt&&console.warn("The query ".concat(JSON.stringify(s)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(c.join("+"),"]"));var y=this.schema.idxByName;function _(I,G){return ut(I,G)===0}var j=c.reduce(function(J,G){var se=J[0],J=J[1],Y=y[G],Z=s[G];return[se||Y,se||!Y?vr(J,Y&&Y.multi?function(ie){return ie=V(ie,G),g(ie)&&ie.some(function(re){return _(Z,re)})}:function(ie){return _(Z,V(ie,G))}):J]},[null,null]),k=j[0],j=j[1];return k?this.where(k.name).equals(s[k.keyPath]).filter(j):h?this.filter(j):this.where(c).equals("")},vt.prototype.filter=function(s){return this.toCollection().and(s)},vt.prototype.count=function(s){return this.toCollection().count(s)},vt.prototype.offset=function(s){return this.toCollection().offset(s)},vt.prototype.limit=function(s){return this.toCollection().limit(s)},vt.prototype.each=function(s){return this.toCollection().each(s)},vt.prototype.toArray=function(s){return this.toCollection().toArray(s)},vt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},vt.prototype.orderBy=function(s){return new this.db.Collection(new this.db.WhereClause(this,g(s)?"[".concat(s.join("+"),"]"):s))},vt.prototype.reverse=function(){return this.toCollection().reverse()},vt.prototype.mapToClass=function(s){for(var c=this.db,h=this.name,y=((this.schema.mappedClass=s).prototype instanceof Nn&&(s=(j=>{var I=J,G=j;if(typeof G!="function"&&G!==null)throw new TypeError("Class extends value "+String(G)+" is not a constructor or null");function se(){this.constructor=I}function J(){return j!==null&&j.apply(this,arguments)||this}return i(I,G),I.prototype=G===null?Object.create(G):(se.prototype=G.prototype,new se),Object.defineProperty(J.prototype,"db",{get:function(){return c},enumerable:!1,configurable:!0}),J.prototype.table=function(){return h},J})(s)),new Set),_=s.prototype;_;_=w(_))Object.getOwnPropertyNames(_).forEach(function(j){return y.add(j)});function k(j){if(!j)return j;var I,G=Object.create(s.prototype);for(I in j)if(!y.has(I))try{G[I]=j[I]}catch{}return G}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=k,this.hook("reading",k),s},vt.prototype.defineClass=function(){return this.mapToClass(function(s){v(this,s)})},vt.prototype.add=function(s,c){var h=this,y=this.schema.primKey,_=y.auto,k=y.keyPath,j=s;return k&&_&&(j=ar(k)(s)),this._trans("readwrite",function(I){return h.core.mutate({trans:I,type:"add",keys:c!=null?[c]:null,values:[j]})}).then(function(I){return I.numFailures?Fe.reject(I.failures[0]):I.lastResult}).then(function(I){if(k)try{U(s,k,I)}catch{}return I})},vt.prototype.upsert=function(s,c){var h=this,y=this.schema.primKey.keyPath;return this._trans("readwrite",function(_){return h.core.get({trans:_,key:s}).then(function(k){var j=k??{};return ro(j,c),y&&U(j,y,s),h.core.mutate({trans:_,type:"put",values:[j],keys:[s],upsert:!0,updates:{keys:[s],changeSpecs:[c]}}).then(function(I){return I.numFailures?Fe.reject(I.failures[0]):!!k})})})},vt.prototype.update=function(s,c){return typeof s!="object"||g(s)?this.where(":id").equals(s).modify(c):(s=V(s,this.schema.primKey.keyPath))===void 0?Pt(new ke.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(s).modify(c)},vt.prototype.put=function(s,c){var h=this,y=this.schema.primKey,_=y.auto,k=y.keyPath,j=s;return k&&_&&(j=ar(k)(s)),this._trans("readwrite",function(I){return h.core.mutate({trans:I,type:"put",values:[j],keys:c!=null?[c]:null})}).then(function(I){return I.numFailures?Fe.reject(I.failures[0]):I.lastResult}).then(function(I){if(k)try{U(s,k,I)}catch{}return I})},vt.prototype.delete=function(s){var c=this;return this._trans("readwrite",function(h){return c.core.mutate({trans:h,type:"delete",keys:[s]}).then(function(y){return Ao(c,[s],y)}).then(function(y){return y.numFailures?Fe.reject(y.failures[0]):void 0})})},vt.prototype.clear=function(){var s=this;return this._trans("readwrite",function(c){return s.core.mutate({trans:c,type:"deleteRange",range:fi}).then(function(h){return Ao(s,null,h)})}).then(function(c){return c.numFailures?Fe.reject(c.failures[0]):void 0})},vt.prototype.bulkGet=function(s){var c=this;return this._trans("readonly",function(h){return c.core.getMany({keys:s,trans:h}).then(function(y){return y.map(function(_){return c.hook.reading.fire(_)})})})},vt.prototype.bulkAdd=function(s,c,h){var y=this,_=Array.isArray(c)?c:void 0,k=(h=h||(_?void 0:c))?h.allKeys:void 0;return this._trans("readwrite",function(j){var I=y.schema.primKey,se=I.auto,I=I.keyPath;if(I&&_)throw new ke.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(_&&_.length!==s.length)throw new ke.InvalidArgument("Arguments objects and keys must have the same length");var G=s.length,se=I&&se?s.map(ar(I)):s;return y.core.mutate({trans:j,type:"add",keys:_,values:se,wantResults:k}).then(function(J){var Y=J.numFailures,Z=J.failures;if(Y===0)return k?J.results:J.lastResult;throw new ze("".concat(y.name,".bulkAdd(): ").concat(Y," of ").concat(G," operations failed"),Z)})})},vt.prototype.bulkPut=function(s,c,h){var y=this,_=Array.isArray(c)?c:void 0,k=(h=h||(_?void 0:c))?h.allKeys:void 0;return this._trans("readwrite",function(j){var I=y.schema.primKey,se=I.auto,I=I.keyPath;if(I&&_)throw new ke.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(_&&_.length!==s.length)throw new ke.InvalidArgument("Arguments objects and keys must have the same length");var G=s.length,se=I&&se?s.map(ar(I)):s;return y.core.mutate({trans:j,type:"put",keys:_,values:se,wantResults:k}).then(function(J){var Y=J.numFailures,Z=J.failures;if(Y===0)return k?J.results:J.lastResult;throw new ze("".concat(y.name,".bulkPut(): ").concat(Y," of ").concat(G," operations failed"),Z)})})},vt.prototype.bulkUpdate=function(s){var c=this,h=this.core,y=s.map(function(j){return j.key}),_=s.map(function(j){return j.changes}),k=[];return this._trans("readwrite",function(j){return h.getMany({trans:j,keys:y,cache:"clone"}).then(function(I){var G=[],se=[],J=(s.forEach(function(Y,Z){var ie=Y.key,re=Y.changes,ne=I[Z];if(ne){for(var oe=0,ge=Object.keys(re);oe<ge.length;oe++){var fe=ge[oe],ve=re[fe];if(fe===c.schema.primKey.keyPath){if(ut(ve,ie)!==0)throw new ke.Constraint("Cannot update primary key in bulkUpdate()")}else U(ne,fe,ve)}k.push(Z),G.push(ie),se.push(ne)}}),G.length);return h.mutate({trans:j,type:"put",keys:G,values:se,updates:{keys:y,changeSpecs:_}}).then(function(Y){var Z=Y.numFailures,ie=Y.failures;if(Z===0)return J;for(var re=0,ne=Object.keys(ie);re<ne.length;re++){var oe,ge=ne[re],fe=k[Number(ge)];fe!=null&&(oe=ie[ge],delete ie[ge],ie[fe]=oe)}throw new ze("".concat(c.name,".bulkUpdate(): ").concat(Z," of ").concat(J," operations failed"),ie)})})})},vt.prototype.bulkDelete=function(s){var c=this,h=s.length;return this._trans("readwrite",function(y){return c.core.mutate({trans:y,type:"delete",keys:s}).then(function(_){return Ao(c,s,_)})}).then(function(y){var _=y.numFailures,k=y.failures;if(_===0)return y.lastResult;throw new ze("".concat(c.name,".bulkDelete(): ").concat(_," of ").concat(h," operations failed"),k)})};var qn=vt;function vt(){}function Br(s){function c(j,I){if(I){for(var G=arguments.length,se=new Array(G-1);--G;)se[G-1]=arguments[G];return h[j].subscribe.apply(null,se),s}if(typeof j=="string")return h[j]}var h={};c.addEventType=k;for(var y=1,_=arguments.length;y<_;++y)k(arguments[y]);return c;function k(j,I,G){var se,J;if(typeof j!="object")return I=I||on,J={subscribers:[],fire:G=G||Oe,subscribe:function(Y){J.subscribers.indexOf(Y)===-1&&(J.subscribers.push(Y),J.fire=I(J.fire,Y))},unsubscribe:function(Y){J.subscribers=J.subscribers.filter(function(Z){return Z!==Y}),J.fire=J.subscribers.reduce(I,G)}},h[j]=c[j]=J;d(se=j).forEach(function(Y){var Z=se[Y];if(g(Z))k(Y,se[Y][0],se[Y][1]);else{if(Z!=="asap")throw new ke.InvalidArgument("Invalid event config");var ie=k(Y,Ye,function(){for(var re=arguments.length,ne=new Array(re);re--;)ne[re]=arguments[re];ie.subscribers.forEach(function(oe){X(function(){oe.apply(null,ne)})})})}})}}function oo(s,c){return A(c).from({prototype:s}),c}function lr(s,c){return!(s.filter||s.algorithm||s.or)&&(c?s.justLimit:!s.replayFilter)}function Hr(s,c){s.filter=vr(s.filter,c)}function io(s,c,h){var y=s.replayFilter;s.replayFilter=y?function(){return vr(y(),c())}:c,s.justLimit=h&&!y}function ur(s,c){if(s.isPrimKey)return c.primaryKey;var h=c.getIndexByKeyPath(s.index);if(h)return h;throw new ke.Schema("KeyPath "+s.index+" on object store "+c.name+" is not indexed")}function di(s,c,h){var y=ur(s,c.schema);return c.openCursor({trans:h,values:!s.keysOnly,reverse:s.dir==="prev",unique:!!s.unique,query:{index:y,range:s.range}})}function $o(s,c,h,y){var _,k,j=s.replayFilter?vr(s.filter,s.replayFilter()):s.filter;return s.or?(_={},k=function(I,G,se){var J,Y;j&&!j(G,se,function(Z){return G.stop(Z)},function(Z){return G.fail(Z)})||((Y=""+(J=G.primaryKey))=="[object ArrayBuffer]"&&(Y=""+new Uint8Array(J)),x(_,Y))||(_[Y]=!0,c(I,G,se))},Promise.all([s.or._iterate(k,h),wt(di(s,y,h),s.algorithm,k,!s.keysOnly&&s.valueMapper)])):wt(di(s,y,h),vr(s.algorithm,j),c,!s.keysOnly&&s.valueMapper)}function wt(s,c,h,y){var _=ht(y?function(k,j,I){return h(y(k),j,I)}:h);return s.then(function(k){if(k)return k.start(function(){var j=function(){return k.continue()};c&&!c(k,function(I){return j=I},function(I){k.stop(I),j=Oe},function(I){k.fail(I),j=Oe})||_(k.value,k,function(I){return j=I}),j()})})}mt.prototype._read=function(s,c){var h=this._ctx;return h.error?h.table._trans(null,Pt.bind(null,h.error)):h.table._trans("readonly",s).then(c)},mt.prototype._write=function(s){var c=this._ctx;return c.error?c.table._trans(null,Pt.bind(null,c.error)):c.table._trans("readwrite",s,"locked")},mt.prototype._addAlgorithm=function(s){var c=this._ctx;c.algorithm=vr(c.algorithm,s)},mt.prototype._iterate=function(s,c){return $o(this._ctx,s,c,this._ctx.table.core)},mt.prototype.clone=function(s){var c=Object.create(this.constructor.prototype),h=Object.create(this._ctx);return s&&v(h,s),c._ctx=h,c},mt.prototype.raw=function(){return this._ctx.valueMapper=null,this},mt.prototype.each=function(s){var c=this._ctx;return this._read(function(h){return $o(c,s,h,c.table.core)})},mt.prototype.count=function(s){var c=this;return this._read(function(h){var y,_=c._ctx,k=_.table.core;return lr(_,!0)?k.count({trans:h,query:{index:ur(_,k.schema),range:_.range}}).then(function(j){return Math.min(j,_.limit)}):(y=0,$o(_,function(){return++y,!1},h,k).then(function(){return y}))}).then(s)},mt.prototype.sortBy=function(s,c){var h=s.split(".").reverse(),y=h[0],_=h.length-1;function k(G,se){return se?k(G[h[se]],se-1):G[y]}var j=this._ctx.dir==="next"?1:-1;function I(G,se){return ut(k(G,_),k(se,_))*j}return this.toArray(function(G){return G.sort(I)}).then(c)},mt.prototype.toArray=function(s){var c=this;return this._read(function(h){var y,_,k,j=c._ctx;return lr(j,!0)&&0<j.limit?(y=j.valueMapper,_=ur(j,j.table.core.schema),j.table.core.query({trans:h,limit:j.limit,values:!0,direction:j.dir==="prev"?"prev":void 0,query:{index:_,range:j.range}}).then(function(I){return I=I.result,y?I.map(y):I})):(k=[],$o(j,function(I){return k.push(I)},h,j.table.core).then(function(){return k}))},s)},mt.prototype.offset=function(s){var c=this._ctx;return s<=0||(c.offset+=s,lr(c)?io(c,function(){var h=s;return function(y,_){return h===0||(h===1?--h:_(function(){y.advance(h),h=0}),!1)}}):io(c,function(){var h=s;return function(){return--h<0}})),this},mt.prototype.limit=function(s){return this._ctx.limit=Math.min(this._ctx.limit,s),io(this._ctx,function(){var c=s;return function(h,y,_){return--c<=0&&y(_),0<=c}},!0),this},mt.prototype.until=function(s,c){return Hr(this._ctx,function(h,y,_){return!s(h.value)||(y(_),c)}),this},mt.prototype.first=function(s){return this.limit(1).toArray(function(c){return c[0]}).then(s)},mt.prototype.last=function(s){return this.reverse().first(s)},mt.prototype.filter=function(s){var c;return Hr(this._ctx,function(h){return s(h.value)}),(c=this._ctx).isMatch=vr(c.isMatch,s),this},mt.prototype.and=function(s){return this.filter(s)},mt.prototype.or=function(s){return new this.db.WhereClause(this._ctx.table,s,this)},mt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},mt.prototype.desc=function(){return this.reverse()},mt.prototype.eachKey=function(s){var c=this._ctx;return c.keysOnly=!c.isMatch,this.each(function(h,y){s(y.key,y)})},mt.prototype.eachUniqueKey=function(s){return this._ctx.unique="unique",this.eachKey(s)},mt.prototype.eachPrimaryKey=function(s){var c=this._ctx;return c.keysOnly=!c.isMatch,this.each(function(h,y){s(y.primaryKey,y)})},mt.prototype.keys=function(s){var c=this._ctx,h=(c.keysOnly=!c.isMatch,[]);return this.each(function(y,_){h.push(_.key)}).then(function(){return h}).then(s)},mt.prototype.primaryKeys=function(s){var c=this._ctx;if(lr(c,!0)&&0<c.limit)return this._read(function(y){var _=ur(c,c.table.core.schema);return c.table.core.query({trans:y,values:!1,limit:c.limit,direction:c.dir==="prev"?"prev":void 0,query:{index:_,range:c.range}})}).then(function(y){return y.result}).then(s);c.keysOnly=!c.isMatch;var h=[];return this.each(function(y,_){h.push(_.primaryKey)}).then(function(){return h}).then(s)},mt.prototype.uniqueKeys=function(s){return this._ctx.unique="unique",this.keys(s)},mt.prototype.firstKey=function(s){return this.limit(1).keys(function(c){return c[0]}).then(s)},mt.prototype.lastKey=function(s){return this.reverse().firstKey(s)},mt.prototype.distinct=function(){var s,c=this._ctx,c=c.index&&c.table.schema.idxByName[c.index];return c&&c.multi&&(s={},Hr(this._ctx,function(y){var y=y.primaryKey.toString(),_=x(s,y);return s[y]=!0,!_})),this},mt.prototype.modify=function(s){var c=this,h=this._ctx;return this._write(function(y){function _(ne,oe){var ge=oe.failures;Z+=ne-oe.numFailures;for(var fe=0,ve=d(ge);fe<ve.length;fe++){var Ee=ve[fe];Y.push(ge[Ee])}}var k=typeof s=="function"?s:function(ne){return ro(ne,s)},j=h.table.core,J=j.schema.primaryKey,I=J.outbound,G=J.extractKey,se=200,J=c.db._options.modifyChunkSize,Y=(J&&(se=typeof J=="object"?J[j.name]||J["*"]||200:J),[]),Z=0,ie=[],re=s===Vi;return c.clone().primaryKeys().then(function(ne){function oe(fe){var ve=Math.min(se,ne.length-fe),Ee=ne.slice(fe,fe+ve);return(re?Promise.resolve([]):j.getMany({trans:y,keys:Ee,cache:"immutable"})).then(function(Ce){var Re=[],Me=[],He=I?[]:null,Ae=re?Ee:[];if(!re)for(var Ke=0;Ke<ve;++Ke){var Ne=Ce[Ke],rt={value:xe(Ne),primKey:ne[fe+Ke]};k.call(rt,rt.value,rt)!==!1&&(rt.value==null?Ae.push(ne[fe+Ke]):I||ut(G(Ne),G(rt.value))===0?(Me.push(rt.value),I&&He.push(ne[fe+Ke])):(Ae.push(ne[fe+Ke]),Re.push(rt.value)))}return Promise.resolve(0<Re.length&&j.mutate({trans:y,type:"add",values:Re}).then(function(ot){for(var at in ot.failures)Ae.splice(parseInt(at),1);_(Re.length,ot)})).then(function(){return(0<Me.length||ge&&typeof s=="object")&&j.mutate({trans:y,type:"put",keys:He,values:Me,criteria:ge,changeSpec:typeof s!="function"&&s,isAdditionalChunk:0<fe}).then(function(ot){return _(Me.length,ot)})}).then(function(){return(0<Ae.length||ge&&re)&&j.mutate({trans:y,type:"delete",keys:Ae,criteria:ge,isAdditionalChunk:0<fe}).then(function(ot){return Ao(h.table,Ae,ot)}).then(function(ot){return _(Ae.length,ot)})}).then(function(){return ne.length>fe+ve&&oe(fe+se)})})}var ge=lr(h)&&h.limit===1/0&&(typeof s!="function"||re)&&{index:h.index,range:h.range};return oe(0).then(function(){if(0<Y.length)throw new Ie("Error modifying one or more objects",Y,Z,ie);return ne.length})})})},mt.prototype.delete=function(){var s=this._ctx,c=s.range;return!lr(s)||s.table.schema.yProps||!s.isPrimKey&&c.type!==3?this.modify(Vi):this._write(function(h){var y=s.table.core.schema.primaryKey,_=c;return s.table.core.count({trans:h,query:{index:y,range:_}}).then(function(k){return s.table.core.mutate({trans:h,type:"deleteRange",range:_}).then(function(G){var I=G.failures,G=G.numFailures;if(G)throw new Ie("Could not delete some values",Object.keys(I).map(function(se){return I[se]}),k-G);return k-G})})})};var Fa=mt;function mt(){}var Vi=function(s,c){return c.value=null};function Ba(s,c){return s<c?-1:s===c?0:1}function Ha(s,c){return c<s?-1:s===c?0:1}function gn(s,c,h){return s=s instanceof wr?new s.Collection(s):s,s._ctx.error=new(h||TypeError)(c),s}function Vr(s){return new s.Collection(s,function(){return xr("")}).limit(0)}function so(ie,c,h,y){var _,k,j,I,G,se,J,Y=h.length;if(!h.every(function(ne){return typeof ne=="string"}))return gn(ie,Bi);function Z(ne){_=ne==="next"?function(ge){return ge.toUpperCase()}:function(ge){return ge.toLowerCase()},k=ne==="next"?function(ge){return ge.toLowerCase()}:function(ge){return ge.toUpperCase()},j=ne==="next"?Ba:Ha;var oe=h.map(function(ge){return{lower:k(ge),upper:_(ge)}}).sort(function(ge,fe){return j(ge.lower,fe.lower)});I=oe.map(function(ge){return ge.upper}),G=oe.map(function(ge){return ge.lower}),J=(se=ne)==="next"?"":y}Z("next");var ie=new ie.Collection(ie,function(){return an(I[0],G[Y-1]+y)}),re=(ie._ondirectionchange=function(ne){Z(ne)},0);return ie._addAlgorithm(function(ne,oe,ge){var fe=ne.key;if(typeof fe=="string"){var ve=k(fe);if(c(ve,G,re))return!0;for(var Ee=null,Ce=re;Ce<Y;++Ce){var Re=((Me,He,Ae,Ke,Ne,rt)=>{for(var ot=Math.min(Me.length,Ke.length),at=-1,ct=0;ct<ot;++ct){var yn=He[ct];if(yn!==Ke[ct])return Ne(Me[ct],Ae[ct])<0?Me.substr(0,ct)+Ae[ct]+Ae.substr(ct+1):Ne(Me[ct],Ke[ct])<0?Me.substr(0,ct)+Ke[ct]+Ae.substr(ct+1):0<=at?Me.substr(0,at)+He[at]+Ae.substr(at+1):null;Ne(Me[ct],yn)<0&&(at=ct)}return ot<Ke.length&&rt==="next"?Me+Ae.substr(Me.length):ot<Me.length&&rt==="prev"?Me.substr(0,Ae.length):at<0?null:Me.substr(0,at)+Ke[at]+Ae.substr(at+1)})(fe,ve,I[Ce],G[Ce],j,se);Re===null&&Ee===null?re=Ce+1:(Ee===null||0<j(Ee,Re))&&(Ee=Re)}oe(Ee!==null?function(){ne.continue(Ee+J)}:ge)}return!1}),ie}function an(s,c,h,y){return{type:2,lower:s,upper:c,lowerOpen:h,upperOpen:y}}function xr(s){return{type:1,lower:s,upper:s}}Object.defineProperty(At.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),At.prototype.between=function(s,c,h,y){h=h!==!1,y=y===!0;try{return 0<this._cmp(s,c)||this._cmp(s,c)===0&&(h||y)&&(!h||!y)?Vr(this):new this.Collection(this,function(){return an(s,c,!h,!y)})}catch{return gn(this,yt)}},At.prototype.equals=function(s){return s==null?gn(this,yt):new this.Collection(this,function(){return xr(s)})},At.prototype.above=function(s){return s==null?gn(this,yt):new this.Collection(this,function(){return an(s,void 0,!0)})},At.prototype.aboveOrEqual=function(s){return s==null?gn(this,yt):new this.Collection(this,function(){return an(s,void 0,!1)})},At.prototype.below=function(s){return s==null?gn(this,yt):new this.Collection(this,function(){return an(void 0,s,!1,!0)})},At.prototype.belowOrEqual=function(s){return s==null?gn(this,yt):new this.Collection(this,function(){return an(void 0,s)})},At.prototype.startsWith=function(s){return typeof s!="string"?gn(this,Bi):this.between(s,s+sr,!0,!0)},At.prototype.startsWithIgnoreCase=function(s){return s===""?this.startsWith(s):so(this,function(c,h){return c.indexOf(h[0])===0},[s],sr)},At.prototype.equalsIgnoreCase=function(s){return so(this,function(c,h){return c===h[0]},[s],"")},At.prototype.anyOfIgnoreCase=function(){var s=Q.apply(F,arguments);return s.length===0?Vr(this):so(this,function(c,h){return h.indexOf(c)!==-1},s,"")},At.prototype.startsWithAnyOfIgnoreCase=function(){var s=Q.apply(F,arguments);return s.length===0?Vr(this):so(this,function(c,h){return h.some(function(y){return c.indexOf(y)===0})},s,sr)},At.prototype.anyOf=function(){var s,c,h=this,y=Q.apply(F,arguments),_=this._cmp;try{y.sort(_)}catch{return gn(this,yt)}return y.length===0?Vr(this):((s=new this.Collection(this,function(){return an(y[0],y[y.length-1])}))._ondirectionchange=function(k){_=k==="next"?h._ascending:h._descending,y.sort(_)},c=0,s._addAlgorithm(function(k,j,I){for(var G=k.key;0<_(G,y[c]);)if(++c===y.length)return j(I),!1;return _(G,y[c])===0||(j(function(){k.continue(y[c])}),!1)}),s)},At.prototype.notEqual=function(s){return this.inAnyRange([[-1/0,s],[s,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},At.prototype.noneOf=function(){var s=Q.apply(F,arguments);if(s.length===0)return new this.Collection(this);try{s.sort(this._ascending)}catch{return gn(this,yt)}var c=s.reduce(function(h,y){return h?h.concat([[h[h.length-1][1],y]]):[[-1/0,y]]},null);return c.push([s[s.length-1],this.db._maxKey]),this.inAnyRange(c,{includeLowers:!1,includeUppers:!1})},At.prototype.inAnyRange=function(s,ge){var h=this,y=this._cmp,_=this._ascending,k=this._descending,j=this._min,I=this._max;if(s.length===0)return Vr(this);if(!s.every(function(fe){return fe[0]!==void 0&&fe[1]!==void 0&&_(fe[0],fe[1])<=0}))return gn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",ke.InvalidArgument);var G=!ge||ge.includeLowers!==!1,se=ge&&ge.includeUppers===!0,J,Y=_;function Z(fe,ve){return Y(fe[0],ve[0])}try{(J=s.reduce(function(fe,ve){for(var Ee=0,Ce=fe.length;Ee<Ce;++Ee){var Re=fe[Ee];if(y(ve[0],Re[1])<0&&0<y(ve[1],Re[0])){Re[0]=j(Re[0],ve[0]),Re[1]=I(Re[1],ve[1]);break}}return Ee===Ce&&fe.push(ve),fe},[])).sort(Z)}catch{return gn(this,yt)}var ie=0,re=se?function(fe){return 0<_(fe,J[ie][1])}:function(fe){return 0<=_(fe,J[ie][1])},ne=G?function(fe){return 0<k(fe,J[ie][0])}:function(fe){return 0<=k(fe,J[ie][0])},oe=re,ge=new this.Collection(this,function(){return an(J[0][0],J[J.length-1][1],!G,!se)});return ge._ondirectionchange=function(fe){Y=fe==="next"?(oe=re,_):(oe=ne,k),J.sort(Z)},ge._addAlgorithm(function(fe,ve,Ee){for(var Ce,Re=fe.key;oe(Re);)if(++ie===J.length)return ve(Ee),!1;return!re(Ce=Re)&&!ne(Ce)||(h._cmp(Re,J[ie][1])===0||h._cmp(Re,J[ie][0])===0||ve(function(){Y===_?fe.continue(J[ie][0]):fe.continue(J[ie][1])}),!1)}),ge},At.prototype.startsWithAnyOf=function(){var s=Q.apply(F,arguments);return s.every(function(c){return typeof c=="string"})?s.length===0?Vr(this):this.inAnyRange(s.map(function(c){return[c,c+sr]})):gn(this,"startsWithAnyOf() only works with strings")};var wr=At;function At(){}function ln(s){return ht(function(c){return An(c),s(c.target.error),!1})}function An(s){s.stopPropagation&&s.stopPropagation(),s.preventDefault&&s.preventDefault()}var pi="storagemutated",Ki="x-storagemutated-1",$n=Br(null,pi),Iu=(Wn.prototype._lock=function(){return R(!Ue.global),++this._reculock,this._reculock!==1||Ue.global||(Ue.lockOwnerFor=this),this},Wn.prototype._unlock=function(){if(R(!Ue.global),--this._reculock==0)for(Ue.global||(Ue.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var s=this._blockedFuncs.shift();try{ir(s[1],s[0])}catch{}}return this},Wn.prototype._locked=function(){return this._reculock&&Ue.lockOwnerFor!==this},Wn.prototype.create=function(s){var c=this;if(this.mode){var h=this.db.idbdb,y=this.db._state.dbOpenError;if(R(!this.idbtrans),!s&&!h)switch(y&&y.name){case"DatabaseClosedError":throw new ke.DatabaseClosed(y);case"MissingAPIError":throw new ke.MissingAPI(y.message,y);default:throw new ke.OpenFailed(y)}if(!this.active)throw new ke.TransactionInactive;R(this._completion._state===null),(s=this.idbtrans=s||(this.db.core||h).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=ht(function(_){An(_),c._reject(s.error)}),s.onabort=ht(function(_){An(_),c.active&&c._reject(new ke.Abort(s.error)),c.active=!1,c.on("abort").fire(_)}),s.oncomplete=ht(function(){c.active=!1,c._resolve(),"mutatedParts"in s&&$n.storagemutated.fire(s.mutatedParts)})}return this},Wn.prototype._promise=function(s,c,h){var y,_=this;return s==="readwrite"&&this.mode!=="readwrite"?Pt(new ke.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Fe(function(k,j){_._blockedFuncs.push([function(){_._promise(s,c,h).then(k,j)},Ue])}):h?rr(function(){var k=new Fe(function(j,I){_._lock();var G=c(j,I,_);G&&G.then&&G.then(j,I)});return k.finally(function(){return _._unlock()}),k._lib=!0,k}):((y=new Fe(function(k,j){var I=c(k,j,_);I&&I.then&&I.then(k,j)}))._lib=!0,y):Pt(new ke.TransactionInactive)},Wn.prototype._root=function(){return this.parent?this.parent._root():this},Wn.prototype.waitFor=function(s){var c,h=this._root(),y=Fe.resolve(s),_=(h._waitingFor?h._waitingFor=h._waitingFor.then(function(){return y}):(h._waitingFor=y,h._waitingQueue=[],c=h.idbtrans.objectStore(h.storeNames[0]),(function k(){for(++h._spinCount;h._waitingQueue.length;)h._waitingQueue.shift()();h._waitingFor&&(c.get(-1/0).onsuccess=k)})()),h._waitingFor);return new Fe(function(k,j){y.then(function(I){return h._waitingQueue.push(ht(k.bind(null,I)))},function(I){return h._waitingQueue.push(ht(j.bind(null,I)))}).finally(function(){h._waitingFor===_&&(h._waitingFor=null)})})},Wn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ke.Abort))},Wn.prototype.table=function(s){var c=this._memoizedTables||(this._memoizedTables={});if(x(c,s))return c[s];var h=this.schema[s];if(h)return(h=new this.db.Table(s,h,this)).core=this.db.core.table(s),c[s]=h;throw new ke.NotFound("Table "+s+" not part of transaction")},Wn);function Wn(){}function Oo(s,c,h,y,_,k,j,I){return{name:s,keyPath:c,unique:h,multi:y,auto:_,compound:k,src:(h&&!j?"&":"")+(y?"*":"")+(_?"++":"")+Rs(c),type:I}}function Rs(s){return typeof s=="string"?s:s?"["+[].join.call(s,"+")+"]":""}function zs(s,c,h){return{name:s,primKey:c,indexes:h,mappedClass:null,idxByName:(y=function(_){return[_.name,_]},h.reduce(function(_,k,j){return k=y(k,j),k&&(_[k[0]]=k[1]),_},{}))};var y}var _r=function(s){try{return s.only([[]]),_r=function(){return[[]]},[[]]}catch{return _r=function(){return sr},sr}};function ao(s){return s==null?function(){}:typeof s=="string"?(c=s).split(".").length===1?function(h){return h[c]}:function(h){return V(h,c)}:function(h){return V(h,s)};var c}function lo(s){return[].slice.call(s)}var Ui=0;function hi(s){return s==null?":id":typeof s=="string"?s:"[".concat(s.join("+"),"]")}function Au(s,c,j){function y(oe){if(oe.type===3)return null;if(oe.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var ie=oe.lower,re=oe.upper,ne=oe.lowerOpen,oe=oe.upperOpen;return ie===void 0?re===void 0?null:c.upperBound(re,!!oe):re===void 0?c.lowerBound(ie,!!ne):c.bound(ie,re,!!ne,!!oe)}function _(Z){var ie,re,ne=Z.name;return{name:ne,schema:Z,mutate:function(oe){var ge=oe.trans,fe=oe.type,ve=oe.keys,Ee=oe.values,Ce=oe.range;return new Promise(function(Re,Me){Re=ht(Re);var He=ge.objectStore(ne),Ae=He.keyPath==null,Ke=fe==="put"||fe==="add";if(!Ke&&fe!=="delete"&&fe!=="deleteRange")throw new Error("Invalid operation type: "+fe);var Ne,rt=(ve||Ee||{length:1}).length;if(ve&&Ee&&ve.length!==Ee.length)throw new Error("Given keys array must have same length as given values array.");if(rt===0)return Re({numFailures:0,failures:{},results:[],lastResult:void 0});function ot(un){++yn,An(un)}var at=[],ct=[],yn=0;if(fe==="deleteRange"){if(Ce.type===4)return Re({numFailures:yn,failures:ct,results:[],lastResult:void 0});Ce.type===3?at.push(Ne=He.clear()):at.push(Ne=He.delete(y(Ce)))}else{var Ae=Ke?Ae?[Ee,ve]:[Ee,null]:[ve,null],st=Ae[0],jt=Ae[1];if(Ke)for(var Kt=0;Kt<rt;++Kt)at.push(Ne=jt&&jt[Kt]!==void 0?He[fe](st[Kt],jt[Kt]):He[fe](st[Kt])),Ne.onerror=ot;else for(Kt=0;Kt<rt;++Kt)at.push(Ne=He[fe](st[Kt])),Ne.onerror=ot}function Ko(un){un=un.target.result,at.forEach(function(go,yo){return go.error!=null&&(ct[yo]=go.error)}),Re({numFailures:yn,failures:ct,results:fe==="delete"?ve:at.map(function(go){return go.result}),lastResult:un})}Ne.onerror=function(un){ot(un),Ko(un)},Ne.onsuccess=Ko})},getMany:function(oe){var ge=oe.trans,fe=oe.keys;return new Promise(function(ve,Ee){ve=ht(ve);for(var Ce,Re=ge.objectStore(ne),Me=fe.length,He=new Array(Me),Ae=0,Ke=0,Ne=function(at){at=at.target,He[at._pos]=at.result,++Ke===Ae&&ve(He)},rt=ln(Ee),ot=0;ot<Me;++ot)fe[ot]!=null&&((Ce=Re.get(fe[ot]))._pos=ot,Ce.onsuccess=Ne,Ce.onerror=rt,++Ae);Ae===0&&ve(He)})},get:function(oe){var ge=oe.trans,fe=oe.key;return new Promise(function(ve,Ee){ve=ht(ve);var Ce=ge.objectStore(ne).get(fe);Ce.onsuccess=function(Re){return ve(Re.target.result)},Ce.onerror=ln(Ee)})},query:(ie=G,re=se,function(oe){return new Promise(function(ge,fe){ge=ht(ge);var ve,Ee,Ce,Re,rt=oe.trans,Me=oe.values,He=oe.limit,Ne=oe.query,Ae=(Ae=oe.direction)!=null?Ae:"next",Ke=He===1/0?void 0:He,ot=Ne.index,Ne=Ne.range,rt=rt.objectStore(ne),rt=ot.isPrimaryKey?rt:rt.index(ot.name),ot=y(Ne);if(He===0)return ge({result:[]});re?(Ne={query:ot,count:Ke,direction:Ae},(ve=Me?rt.getAll(Ne):rt.getAllKeys(Ne)).onsuccess=function(at){return ge({result:at.target.result})},ve.onerror=ln(fe)):ie&&Ae==="next"?((ve=Me?rt.getAll(ot,Ke):rt.getAllKeys(ot,Ke)).onsuccess=function(at){return ge({result:at.target.result})},ve.onerror=ln(fe)):(Ee=0,Ce=!Me&&"openKeyCursor"in rt?rt.openKeyCursor(ot,Ae):rt.openCursor(ot,Ae),Re=[],Ce.onsuccess=function(){var at=Ce.result;return!at||(Re.push(Me?at.value:at.primaryKey),++Ee===He)?ge({result:Re}):void at.continue()},Ce.onerror=ln(fe))})}),openCursor:function(oe){var ge=oe.trans,fe=oe.values,ve=oe.query,Ee=oe.reverse,Ce=oe.unique;return new Promise(function(Re,Me){Re=ht(Re);var Ke=ve.index,He=ve.range,Ae=ge.objectStore(ne),Ae=Ke.isPrimaryKey?Ae:Ae.index(Ke.name),Ke=Ee?Ce?"prevunique":"prev":Ce?"nextunique":"next",Ne=!fe&&"openKeyCursor"in Ae?Ae.openKeyCursor(y(He),Ke):Ae.openCursor(y(He),Ke);Ne.onerror=ln(Me),Ne.onsuccess=ht(function(rt){var ot,at,ct,yn,st=Ne.result;st?(st.___id=++Ui,st.done=!1,ot=st.continue.bind(st),at=(at=st.continuePrimaryKey)&&at.bind(st),ct=st.advance.bind(st),yn=function(){throw new Error("Cursor not stopped")},st.trans=ge,st.stop=st.continue=st.continuePrimaryKey=st.advance=function(){throw new Error("Cursor not started")},st.fail=ht(Me),st.next=function(){var jt=this,Kt=1;return this.start(function(){return Kt--?jt.continue():jt.stop()}).then(function(){return jt})},st.start=function(jt){function Kt(){if(Ne.result)try{jt()}catch(un){st.fail(un)}else st.done=!0,st.start=function(){throw new Error("Cursor behind last entry")},st.stop()}var Ko=new Promise(function(un,go){un=ht(un),Ne.onerror=ln(go),st.fail=go,st.stop=function(yo){st.stop=st.continue=st.continuePrimaryKey=st.advance=yn,un(yo)}});return Ne.onsuccess=ht(function(un){Ne.onsuccess=Kt,Kt()}),st.continue=ot,st.continuePrimaryKey=at,st.advance=ct,Kt(),Ko},Re(st)):Re(null)},Me)})},count:function(oe){var ge=oe.query,fe=oe.trans,ve=ge.index,Ee=ge.range;return new Promise(function(Ce,Re){var Me=fe.objectStore(ne),Me=ve.isPrimaryKey?Me:Me.index(ve.name),He=y(Ee),He=He?Me.count(He):Me.count();He.onsuccess=ht(function(Ae){return Ce(Ae.target.result)}),He.onerror=ln(Re)})}}}k=j,I=lo((j=s).objectStoreNames),J=0<I.length?k.objectStore(I[0]):{};var k,j={schema:{name:j.name,tables:I.map(function(Z){return k.objectStore(Z)}).map(function(Z){var ie=Z.keyPath,re=Z.autoIncrement,oe=g(ie),ne={},oe={name:Z.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:ie==null,compound:oe,keyPath:ie,autoIncrement:re,unique:!0,extractKey:ao(ie)},indexes:lo(Z.indexNames).map(function(ge){return Z.index(ge)}).map(function(Ee){var Ce=Ee.name,fe=Ee.unique,ve=Ee.multiEntry,Ee=Ee.keyPath,Ce={name:Ce,compound:g(Ee),keyPath:Ee,unique:fe,multiEntry:ve,extractKey:ao(Ee)};return ne[hi(Ee)]=Ce}),getIndexByKeyPath:function(ge){return ne[hi(ge)]}};return ne[":id"]=oe.primaryKey,ie!=null&&(ne[hi(ie)]=oe.primaryKey),oe})},hasGetAll:0<I.length&&"getAll"in J&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in J},I=j.schema,G=j.hasGetAll,se=j.hasIdb3Features,J=I.tables.map(_),Y={};return J.forEach(function(Z){return Y[Z.name]=Z}),{stack:"dbcore",transaction:s.transaction.bind(s),table:function(Z){if(Y[Z])return Y[Z];throw new Error("Table '".concat(Z,"' not found"))},MIN_KEY:-1/0,MAX_KEY:_r(c),schema:I}}function Ds(s,c,h,y){return h=h.IDBKeyRange,c=Au(c,h,y),{dbcore:s.dbcore.reduce(function(_,k){return k=k.create,a(a({},_),k(_))},c)}}function uo(s,c){var h=c.db,h=Ds(s._middlewares,h,s._deps,c);s.core=h.dbcore,s.tables.forEach(function(y){var _=y.name;s.core.schema.tables.some(function(k){return k.name===_})&&(y.core=s.core.table(_),s[_]instanceof s.Table)&&(s[_].core=y.core)})}function Ro(s,c,h,y){h.forEach(function(_){var k=y[_];c.forEach(function(j){var I=(function G(se,J){return T(se,J)||(se=w(se))&&G(se,J)})(j,_);(!I||"value"in I&&I.value===void 0)&&(j===s.Transaction.prototype||j instanceof s.Transaction?C(j,_,{get:function(){return this.table(_)},set:function(G){N(this,_,{value:G,writable:!0,configurable:!0,enumerable:!0})}}):j[_]=new s.Table(_,k))})})}function qi(s,c){c.forEach(function(h){for(var y in h)h[y]instanceof s.Table&&delete h[y]})}function Kr(s,c){return s._cfg.version-c._cfg.version}function Ls(s,c,h,y){var _=s._dbSchema,k=(h.objectStoreNames.contains("$meta")&&!_.$meta&&(_.$meta=zs("$meta",Xi("")[0],[]),s._storeNames.push("$meta")),s._createTransaction("readwrite",s._storeNames,_)),j=(k.create(h),k._completion.catch(y),k._reject.bind(k)),I=Ue.transless||Ue;rr(function(){if(Ue.trans=k,Ue.transless=I,c!==0)return uo(s,h),se=c,((G=k).storeNames.includes("$meta")?G.table("$meta").get("version").then(function(J){return J??se}):Fe.resolve(se)).then(function(oe){var Y=s,Z=oe,ie=k,re=h,ne=[],oe=Y._versions,ge=Y._dbSchema=Jt(0,Y.idbdb,re);return(oe=oe.filter(function(fe){return fe._cfg.version>=Z})).length===0?Fe.resolve():(oe.forEach(function(fe){ne.push(function(){var ve,Ee,Ce,Re=ge,Me=fe._cfg.dbschema,He=(Sr(Y,Re,re),Sr(Y,Me,re),ge=Y._dbSchema=Me,Yi(Re,Me)),Ae=(He.add.forEach(function(Ke){zo(re,Ke[0],Ke[1].primKey,Ke[1].indexes)}),He.change.forEach(function(Ke){if(Ke.recreate)throw new ke.Upgrade("Not yet support for changing primary key");var Ne=re.objectStore(Ke.name);Ke.add.forEach(function(rt){return gi(Ne,rt)}),Ke.change.forEach(function(rt){Ne.deleteIndex(rt.name),gi(Ne,rt)}),Ke.del.forEach(function(rt){return Ne.deleteIndex(rt)})}),fe._cfg.contentUpgrade);if(Ae&&fe._cfg.version>Z)return uo(Y,re),ie._memoizedTables={},ve=le(Me),He.del.forEach(function(Ke){ve[Ke]=Re[Ke]}),qi(Y,[Y.Transaction.prototype]),Ro(Y,[Y.Transaction.prototype],d(ve),ve),ie.schema=ve,(Ee=O(Ae))&&zr(),Me=Fe.follow(function(){var Ke;(Ce=Ae(ie))&&Ee&&(Ke=Qt.bind(null,null),Ce.then(Ke,Ke))}),Ce&&typeof Ce.then=="function"?Fe.resolve(Ce):Me.then(function(){return Ce})}),ne.push(function(ve){var Ee,Ce,Re=fe._cfg.dbschema;Ee=Re,Ce=ve,[].slice.call(Ce.db.objectStoreNames).forEach(function(Me){return Ee[Me]==null&&Ce.db.deleteObjectStore(Me)}),qi(Y,[Y.Transaction.prototype]),Ro(Y,[Y.Transaction.prototype],Y._storeNames,Y._dbSchema),ie.schema=Y._dbSchema}),ne.push(function(ve){Y.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(Y.idbdb.version/10)===fe._cfg.version?(Y.idbdb.deleteObjectStore("$meta"),delete Y._dbSchema.$meta,Y._storeNames=Y._storeNames.filter(function(Ee){return Ee!=="$meta"})):ve.objectStore("$meta").put(fe._cfg.version,"version"))})}),(function fe(){return ne.length?Fe.resolve(ne.shift()(ie.idbtrans)).then(fe):Fe.resolve()})().then(function(){mi(ge,re)}))}).catch(j);var G,se;d(_).forEach(function(J){zo(h,J,_[J].primKey,_[J].indexes)}),uo(s,h),Fe.follow(function(){return s.on.populate.fire(k)}).catch(j)})}function Wi(s,c){mi(s._dbSchema,c),c.db.version%10!=0||c.objectStoreNames.contains("$meta")||c.db.createObjectStore("$meta").add(Math.ceil(c.db.version/10-1),"version");var h=Jt(0,s.idbdb,c);Sr(s,s._dbSchema,c);for(var y=0,_=Yi(h,s._dbSchema).change;y<_.length;y++){var k=(j=>{if(j.change.length||j.recreate)return console.warn("Unable to patch indexes of table ".concat(j.name," because it has changes on the type of index or primary key.")),{value:void 0};var I=c.objectStore(j.name);j.add.forEach(function(G){Nt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(j.name,".").concat(G.src)),gi(I,G)})})(_[y]);if(typeof k=="object")return k.value}}function Yi(s,c){var h,y={del:[],add:[],change:[]};for(h in s)c[h]||y.del.push(h);for(h in c){var _=s[h],k=c[h];if(_){var j={name:h,def:k,recreate:!1,del:[],add:[],change:[]};if(""+(_.primKey.keyPath||"")!=""+(k.primKey.keyPath||"")||_.primKey.auto!==k.primKey.auto)j.recreate=!0,y.change.push(j);else{var I=_.idxByName,G=k.idxByName,se=void 0;for(se in I)G[se]||j.del.push(se);for(se in G){var J=I[se],Y=G[se];J?J.src!==Y.src&&j.change.push(Y):j.add.push(Y)}(0<j.del.length||0<j.add.length||0<j.change.length)&&y.change.push(j)}}else y.add.push([h,k])}return y}function zo(s,c,h,y){var _=s.db.createObjectStore(c,h.keyPath?{keyPath:h.keyPath,autoIncrement:h.auto}:{autoIncrement:h.auto});y.forEach(function(k){return gi(_,k)})}function mi(s,c){d(s).forEach(function(h){c.db.objectStoreNames.contains(h)||(Nt&&console.debug("Dexie: Creating missing table",h),zo(c,h,s[h].primKey,s[h].indexes))})}function gi(s,c){s.createIndex(c.name,c.keyPath,{unique:c.unique,multiEntry:c.multi})}function Jt(s,c,h){var y={};return H(c.objectStoreNames,0).forEach(function(_){for(var k=h.objectStore(_),j=Oo(Rs(se=k.keyPath),se||"",!0,!1,!!k.autoIncrement,se&&typeof se!="string",!0),I=[],G=0;G<k.indexNames.length;++G){var J=k.index(k.indexNames[G]),se=J.keyPath,J=Oo(J.name,se,!!J.unique,!!J.multiEntry,!1,se&&typeof se!="string",!1);I.push(J)}y[_]=zs(_,j,I)}),y}function Sr(s,c,h){for(var y=h.db.objectStoreNames,_=0;_<y.length;++_){var k=y[_],j=h.objectStore(k);s._hasGetAll="getAll"in j;for(var I=0;I<j.indexNames.length;++I){var G,se=j.indexNames[I],J=j.index(se).keyPath,J=typeof J=="string"?J:"["+H(J).join("+")+"]";c[k]&&(G=c[k].idxByName[J])&&(G.name=se,delete c[k].idxByName[J],c[k].idxByName[se]=G)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&f.WorkerGlobalScope&&f instanceof f.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(s._hasGetAll=!1)}function Xi(s){return s.split(",").map(function(c,h){var _=c.split(":"),y=(y=_[1])==null?void 0:y.trim(),_=(c=_[0].trim()).replace(/([&*]|\+\+)/g,""),k=/^\[/.test(_)?_.match(/^\[(.*)\]$/)[1].split("+"):_;return Oo(_,k||null,/\&/.test(c),/\*/.test(c),/\+\+/.test(c),g(k),h===0,y)})}Do.prototype._createTableSchema=zs,Do.prototype._parseIndexSyntax=Xi,Do.prototype._parseStoresSpec=function(s,c){var h=this;d(s).forEach(function(y){if(s[y]!==null){var _=h._parseIndexSyntax(s[y]),k=_.shift();if(!k)throw new ke.Schema("Invalid schema for table "+y+": "+s[y]);if(k.unique=!0,k.multi)throw new ke.Schema("Primary key cannot be multiEntry*");_.forEach(function(j){if(j.auto)throw new ke.Schema("Only primary key can be marked as autoIncrement (++)");if(!j.keyPath)throw new ke.Schema("Index must have a name and cannot be an empty string")}),k=h._createTableSchema(y,k,_),c[y]=k}})},Do.prototype.stores=function(h){var c=this.db,h=(this._cfg.storesSource=this._cfg.storesSource?v(this._cfg.storesSource,h):h,c._versions),y={},_={};return h.forEach(function(k){v(y,k._cfg.storesSource),_=k._cfg.dbschema={},k._parseStoresSpec(y,_)}),c._dbSchema=_,qi(c,[c._allTables,c,c.Transaction.prototype]),Ro(c,[c._allTables,c,c.Transaction.prototype,this._cfg.tables],d(_),_),c._storeNames=d(_),this},Do.prototype.upgrade=function(s){return this._cfg.contentUpgrade=Wt(this._cfg.contentUpgrade||Oe,s),this};var yi=Do;function Do(){}var co=(()=>{var s,c,h;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(s=new Set,c=new FinalizationRegistry(function(y){s.delete(y)}),{toArray:function(){return Array.from(s).map(function(y){return y.deref()}).filter(function(y){return y!==void 0})},add:function(y){var _=new WeakRef(y._novip);s.add(_),c.register(y._novip,_,_),s.size>y._options.maxConnections&&(_=s.values().next().value,s.delete(_),c.unregister(_))},remove:function(y){if(y)for(var _=s.values(),k=_.next();!k.done;){var j=k.value;if(j.deref()===y._novip)return s.delete(j),void c.unregister(j);k=_.next()}}}):(h=[],{toArray:function(){return h},add:function(y){h.push(y._novip)},remove:function(y){y&&(y=h.indexOf(y._novip))!==-1&&h.splice(y,1)}})})();function vi(s,c){var h=s._dbNamesDB;return h||(h=s._dbNamesDB=new kr(Lr,{addons:[],indexedDB:s,IDBKeyRange:c})).version(1).stores({dbnames:"name"}),h.table("dbnames")}function fo(s){return s&&typeof s.databases=="function"}function Lo(s){return rr(function(){return Ue.letThrough=!0,s()})}function Qi(s){return!("from"in s)}var en=function(s,c){var h;if(!this)return h=new en,s&&"d"in s&&v(h,s),h;v(this,arguments.length?{d:1,from:s,to:1<arguments.length?c:s}:{d:0})};function xi(s,c,h){var y=ut(c,h);if(!isNaN(y)){if(0<y)throw RangeError();if(Qi(s))return v(s,{from:c,to:h,d:1});var y=s.l,_=s.r;if(ut(h,s.from)<0)return y?xi(y,c,h):s.l={from:c,to:h,d:1,l:null,r:null},Va(s);if(0<ut(c,s.to))return _?xi(_,c,h):s.r={from:c,to:h,d:1,l:null,r:null},Va(s);ut(c,s.from)<0&&(s.from=c,s.l=null,s.d=_?_.d+1:1),0<ut(h,s.to)&&(s.to=h,s.r=null,s.d=s.l?s.l.d+1:1),c=!s.r,y&&!s.l&&wi(s,y),_&&c&&wi(s,_)}}function wi(s,c){Qi(c)||(function h(y,_){var k=_.from,j=_.l,I=_.r;xi(y,k,_.to),j&&h(y,j),I&&h(y,I)})(s,c)}function Gi(s,c){var h=Zi(c),y=h.next();if(!y.done)for(var _=y.value,k=Zi(s),j=k.next(_.from),I=j.value;!y.done&&!j.done;){if(ut(I.from,_.to)<=0&&0<=ut(I.to,_.from))return!0;ut(_.from,I.from)<0?_=(y=h.next(I.from)).value:I=(j=k.next(_.from)).value}return!1}function Zi(s){var c=Qi(s)?null:{s:0,n:s};return{next:function(h){for(var y=0<arguments.length;c;)switch(c.s){case 0:if(c.s=1,y)for(;c.n.l&&ut(h,c.n.from)<0;)c={up:c,n:c.n.l,s:1};else for(;c.n.l;)c={up:c,n:c.n.l,s:1};case 1:if(c.s=2,!y||ut(h,c.n.to)<=0)return{value:c.n,done:!1};case 2:if(c.n.r){c.s=3,c={up:c,n:c.n.r,s:0};continue}case 3:c=c.up}return{done:!0}}}}function Va(s){var c,h,y,_=(((_=s.r)==null?void 0:_.d)||0)-(((_=s.l)==null?void 0:_.d)||0),_=1<_?"r":_<-1?"l":"";_&&(c=_=="r"?"l":"r",h=a({},s),y=s[_],s.from=y.from,s.to=y.to,s[_]=y[_],h[_]=y[c],(s[c]=h).d=Ka(h)),s.d=Ka(s)}function Ka(h){var c=h.r,h=h.l;return(c?h?Math.max(c.d,h.d):c.d:h?h.d:0)+1}function Ji(s,c){return d(c).forEach(function(h){s[h]?wi(s[h],c[h]):s[h]=(function y(_){var k,j,I={};for(k in _)x(_,k)&&(j=_[k],I[k]=!j||typeof j!="object"||W.has(j.constructor)?j:y(j));return I})(c[h])}),s}function Fs(s,c){return s.all||c.all||Object.keys(s).some(function(h){return c[h]&&Gi(c[h],s[h])})}b(en.prototype,((Ct={add:function(s){return wi(this,s),this},addKey:function(s){return xi(this,s,s),this},addKeys:function(s){var c=this;return s.forEach(function(h){return xi(c,h,h)}),this},hasKey:function(s){var c=Zi(this).next(s).value;return c&&ut(c.from,s)<=0&&0<=ut(c.to,s)}})[te]=function(){return Zi(this)},Ct));var Ur={},Bs={},Hs=!1;function es(s){Ji(Bs,s),Hs||(Hs=!0,setTimeout(function(){Hs=!1,Vs(Bs,!(Bs={}))},0))}function Vs(s,c){c===void 0&&(c=!1);var h=new Set;if(s.all)for(var y=0,_=Object.values(Ur);y<_.length;y++)ts(I=_[y],s,h,c);else for(var k in s){var j,I,k=/^idb\:\/\/(.*)\/(.*)\//.exec(k);k&&(j=k[1],k=k[2],I=Ur["idb://".concat(j,"/").concat(k)])&&ts(I,s,h,c)}h.forEach(function(G){return G()})}function ts(s,c,h,y){for(var _=[],k=0,j=Object.entries(s.queries.query);k<j.length;k++){for(var I=j[k],G=I[0],se=[],J=0,Y=I[1];J<Y.length;J++){var Z=Y[J];Fs(c,Z.obsSet)?Z.subscribers.forEach(function(oe){return h.add(oe)}):y&&se.push(Z)}y&&_.push([G,se])}if(y)for(var ie=0,re=_;ie<re.length;ie++){var ne=re[ie],G=ne[0],se=ne[1];s.queries.query[G]=se}}function $u(s){var c=s._state,h=s._deps.indexedDB;if(c.isBeingOpened||s.idbdb)return c.dbReadyPromise.then(function(){return c.dbOpenError?Pt(c.dbOpenError):s});c.isBeingOpened=!0,c.dbOpenError=null,c.openComplete=!1;var y=c.openCanceller,_=Math.round(10*s.verno),k=!1;function j(){if(c.openCanceller!==y)throw new ke.DatabaseClosed("db.open() was cancelled")}function I(){return new Fe(function(Z,ie){if(j(),!h)throw new ke.MissingAPI;var re=s.name,ne=c.autoSchema||!_?h.open(re):h.open(re,_);if(!ne)throw new ke.MissingAPI;ne.onerror=ln(ie),ne.onblocked=ht(s._fireOnBlocked),ne.onupgradeneeded=ht(function(oe){var ge;J=ne.transaction,c.autoSchema&&!s._options.allowEmptyDB?(ne.onerror=An,J.abort(),ne.result.close(),(ge=h.deleteDatabase(re)).onsuccess=ge.onerror=ht(function(){ie(new ke.NoSuchDatabase("Database ".concat(re," doesnt exist")))})):(J.onerror=ln(ie),ge=oe.oldVersion>Math.pow(2,62)?0:oe.oldVersion,Y=ge<1,s.idbdb=ne.result,k&&Wi(s,J),Ls(s,ge/10,J,ie))},ie),ne.onsuccess=ht(function(){J=null;var oe,ge,fe,ve,Ee,Ce,Re=s.idbdb=ne.result,Me=H(Re.objectStoreNames);if(0<Me.length)try{var He=Re.transaction((Ee=Me).length===1?Ee[0]:Ee,"readonly");if(c.autoSchema)Ce=Re,ve=He,(fe=s).verno=Ce.version/10,ve=fe._dbSchema=Jt(0,Ce,ve),fe._storeNames=H(Ce.objectStoreNames,0),Ro(fe,[fe._allTables],d(ve),ve);else if(Sr(s,s._dbSchema,He),ge=He,((ge=Yi(Jt(0,(oe=s).idbdb,ge),oe._dbSchema)).add.length||ge.change.some(function(Ae){return Ae.add.length||Ae.change.length}))&&!k)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),Re.close(),_=Re.version+1,k=!0,Z(I());uo(s,He)}catch{}co.add(s),Re.onversionchange=ht(function(Ae){c.vcFired=!0,s.on("versionchange").fire(Ae)}),Re.onclose=ht(function(){s.close({disableAutoOpen:!1})}),Y&&(Me=s._deps,Ee=re,fo(Ce=Me.indexedDB)||Ee===Lr||vi(Ce,Me.IDBKeyRange).put({name:Ee}).catch(Oe)),Z()},ie)}).catch(function(Z){switch(Z==null?void 0:Z.name){case"UnknownError":if(0<c.PR1398_maxLoop)return c.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),I();break;case"VersionError":if(0<_)return _=0,I()}return Fe.reject(Z)})}var G,se=c.dbReadyResolve,J=null,Y=!1;return Fe.race([y,(typeof navigator>"u"?Fe.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Z){function ie(){return indexedDB.databases().finally(Z)}G=setInterval(ie,100),ie()}).finally(function(){return clearInterval(G)}):Promise.resolve()).then(I)]).then(function(){return j(),c.onReadyBeingFired=[],Fe.resolve(Lo(function(){return s.on.ready.fire(s.vip)})).then(function Z(){var ie;if(0<c.onReadyBeingFired.length)return ie=c.onReadyBeingFired.reduce(Wt,Oe),c.onReadyBeingFired=[],Fe.resolve(Lo(function(){return ie(s.vip)})).then(Z)})}).finally(function(){c.openCanceller===y&&(c.onReadyBeingFired=null,c.isBeingOpened=!1)}).catch(function(Z){c.dbOpenError=Z;try{J&&J.abort()}catch{}return y===c.openCanceller&&s._close(),Pt(Z)}).finally(function(){c.openComplete=!0,se()}).then(function(){var Z;return Y&&(Z={},s.tables.forEach(function(ie){ie.schema.indexes.forEach(function(re){re.name&&(Z["idb://".concat(s.name,"/").concat(ie.name,"/").concat(re.name)]=new en(-1/0,[[[]]]))}),Z["idb://".concat(s.name,"/").concat(ie.name,"/")]=Z["idb://".concat(s.name,"/").concat(ie.name,"/:dels")]=new en(-1/0,[[[]]])}),$n(pi).fire(Z),Vs(Z,!0)),s})}function Ks(s){function c(k){return s.next(k)}var h=_(c),y=_(function(k){return s.throw(k)});function _(k){return function(I){var I=k(I),G=I.value;return I.done?G:G&&typeof G.then=="function"?G.then(h,y):g(G)?Promise.all(G).then(h,y):h(G)}}return _(c)()}function ns(s,c,h){for(var y=g(s)?s.slice():[s],_=0;_<h;++_)y.push(c);return y}var Ua={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(s){return a(a({},s),{table:function(y){var h=s.table(y),y=h.schema,_={},k=[];function j(Z,ie,re){var fe=hi(Z),ne=_[fe]=_[fe]||[],oe=Z==null?0:typeof Z=="string"?1:Z.length,ge=0<ie,fe=a(a({},re),{name:ge?"".concat(fe,"(virtual-from:").concat(re.name,")"):re.name,lowLevelIndex:re,isVirtual:ge,keyTail:ie,keyLength:oe,extractKey:ao(Z),unique:!ge&&re.unique});return ne.push(fe),fe.isPrimaryKey||k.push(fe),1<oe&&j(oe===2?Z[0]:Z.slice(0,oe-1),ie+1,re),ne.sort(function(ve,Ee){return ve.keyTail-Ee.keyTail}),fe}var I=j(y.primaryKey.keyPath,0,y.primaryKey);_[":id"]=[I];for(var G=0,se=y.indexes;G<se.length;G++){var J=se[G];j(J.keyPath,0,J)}function Y(Z){var ie,re=Z.query.index;return re.isVirtual?a(a({},Z),{query:{index:re.lowLevelIndex,range:(ie=Z.query.range,re=re.keyTail,{type:ie.type===1?2:ie.type,lower:ns(ie.lower,ie.lowerOpen?s.MAX_KEY:s.MIN_KEY,re),lowerOpen:!0,upper:ns(ie.upper,ie.upperOpen?s.MIN_KEY:s.MAX_KEY,re),upperOpen:!0})}}):Z}return a(a({},h),{schema:a(a({},y),{primaryKey:I,indexes:k,getIndexByKeyPath:function(Z){return(Z=_[hi(Z)])&&Z[0]}}),count:function(Z){return h.count(Y(Z))},query:function(Z){return h.query(Y(Z))},openCursor:function(Z){var ie=Z.query.index,re=ie.keyTail,ne=ie.keyLength;return ie.isVirtual?h.openCursor(Y(Z)).then(function(ge){return ge&&oe(ge)}):h.openCursor(Z);function oe(ge){return Object.create(ge,{continue:{value:function(fe){fe!=null?ge.continue(ns(fe,Z.reverse?s.MAX_KEY:s.MIN_KEY,re)):Z.unique?ge.continue(ge.key.slice(0,ne).concat(Z.reverse?s.MIN_KEY:s.MAX_KEY,re)):ge.continue()}},continuePrimaryKey:{value:function(fe,ve){ge.continuePrimaryKey(ns(fe,s.MAX_KEY,re),ve)}},primaryKey:{get:function(){return ge.primaryKey}},key:{get:function(){var fe=ge.key;return ne===1?fe[0]:fe.slice(0,ne)}},value:{get:function(){return ge.value}}})}}})}})}};function Us(s,c,h,y){return h=h||{},y=y||"",d(s).forEach(function(_){var k,j,I;x(c,_)?(k=s[_],j=c[_],typeof k=="object"&&typeof j=="object"&&k&&j?(I=ce(k))!==ce(j)?h[y+_]=c[_]:I==="Object"?Us(k,j,h,y+_+"."):k!==j&&(h[y+_]=c[_]):k!==j&&(h[y+_]=c[_])):h[y+_]=void 0}),d(c).forEach(function(_){x(s,_)||(h[y+_]=c[_])}),h}function qs(s,c){return c.type==="delete"?c.keys:c.keys||c.values.map(s.extractKey)}var Ou={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(s){return a(a({},s),{table:function(c){var h=s.table(c),y=h.schema.primaryKey;return a(a({},h),{mutate:function(_){var k=Ue.trans,j=k.table(c).hook,I=j.deleting,G=j.creating,se=j.updating;switch(_.type){case"add":if(G.fire===Oe)break;return k._promise("readwrite",function(){return J(_)},!0);case"put":if(G.fire===Oe&&se.fire===Oe)break;return k._promise("readwrite",function(){return J(_)},!0);case"delete":if(I.fire===Oe)break;return k._promise("readwrite",function(){return J(_)},!0);case"deleteRange":if(I.fire===Oe)break;return k._promise("readwrite",function(){return(function Y(Z,ie,re){return h.query({trans:Z,values:!1,query:{index:y,range:ie},limit:re}).then(function(ne){var oe=ne.result;return J({type:"delete",keys:oe,trans:Z}).then(function(ge){return 0<ge.numFailures?Promise.reject(ge.failures[0]):oe.length<re?{failures:[],numFailures:0,lastResult:void 0}:Y(Z,a(a({},ie),{lower:oe[oe.length-1],lowerOpen:!0}),re)})})})(_.trans,_.range,1e4)},!0)}return h.mutate(_);function J(Y){var Z,ie,re,ne=Ue.trans,oe=Y.keys||qs(y,Y);if(oe)return(Y=Y.type==="add"||Y.type==="put"?a(a({},Y),{keys:oe}):a({},Y)).type!=="delete"&&(Y.values=u([],Y.values)),Y.keys&&(Y.keys=u([],Y.keys)),Z=h,re=oe,((ie=Y).type==="add"?Promise.resolve([]):Z.getMany({trans:ie.trans,keys:re,cache:"immutable"})).then(function(ge){var fe=oe.map(function(ve,Ee){var Ce,Re,Me,He=ge[Ee],Ae={onerror:null,onsuccess:null};return Y.type==="delete"?I.fire.call(Ae,ve,He,ne):Y.type==="add"||He===void 0?(Ce=G.fire.call(Ae,ve,Y.values[Ee],ne),ve==null&&Ce!=null&&(Y.keys[Ee]=ve=Ce,y.outbound||U(Y.values[Ee],y.keyPath,ve))):(Ce=Us(He,Y.values[Ee]),(Re=se.fire.call(Ae,Ce,ve,He,ne))&&(Me=Y.values[Ee],Object.keys(Re).forEach(function(Ke){x(Me,Ke)?Me[Ke]=Re[Ke]:U(Me,Ke,Re[Ke])}))),Ae});return h.mutate(Y).then(function(ve){for(var Ee=ve.failures,Ce=ve.results,Re=ve.numFailures,ve=ve.lastResult,Me=0;Me<oe.length;++Me){var He=(Ce||oe)[Me],Ae=fe[Me];He==null?Ae.onerror&&Ae.onerror(Ee[Me]):Ae.onsuccess&&Ae.onsuccess(Y.type==="put"&&ge[Me]?Y.values[Me]:He)}return{failures:Ee,results:Ce,numFailures:Re,lastResult:ve}}).catch(function(ve){return fe.forEach(function(Ee){return Ee.onerror&&Ee.onerror(ve)}),Promise.reject(ve)})});throw new Error("Keys missing")}}})}})}};function qa(s,c,h){try{if(!c||c.keys.length<s.length)return null;for(var y=[],_=0,k=0;_<c.keys.length&&k<s.length;++_)ut(c.keys[_],s[k])===0&&(y.push(h?xe(c.values[_]):c.values[_]),++k);return y.length===s.length?y:null}catch{return null}}var Ru={stack:"dbcore",level:-1,create:function(s){return{table:function(c){var h=s.table(c);return a(a({},h),{getMany:function(y){var _;return y.cache?(_=qa(y.keys,y.trans._cache,y.cache==="clone"))?Fe.resolve(_):h.getMany(y).then(function(k){return y.trans._cache={keys:y.keys,values:y.cache==="clone"?xe(k):k},k}):h.getMany(y)},mutate:function(y){return y.type!=="add"&&(y.trans._cache=null),h.mutate(y)}})}}}};function Wa(s,c){return s.trans.mode==="readonly"&&!!s.subscr&&!s.trans.explicit&&s.trans.db._options.cache!=="disabled"&&!c.schema.primaryKey.outbound}function Ya(s,c){switch(s){case"query":return c.values&&!c.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Ws={stack:"dbcore",level:0,name:"Observability",create:function(s){var c=s.schema.name,h=new en(s.MIN_KEY,s.MAX_KEY);return a(a({},s),{transaction:function(y,_,k){if(Ue.subscr&&_!=="readonly")throw new ke.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Ue.querier));return s.transaction(y,_,k)},table:function(y){function _(oe){var ne,oe=oe.query;return[ne=oe.index,new en((ne=(oe=oe.range).lower)!=null?ne:s.MIN_KEY,(ne=oe.upper)!=null?ne:s.MAX_KEY)]}var k=s.table(y),j=k.schema,I=j.primaryKey,G=j.indexes,se=I.extractKey,J=I.outbound,Y=I.autoIncrement&&G.filter(function(re){return re.compound&&re.keyPath.includes(I.keyPath)}),Z=a(a({},k),{mutate:function(re){function ne(Ne){return Ne="idb://".concat(c,"/").concat(y,"/").concat(Ne),Ee[Ne]||(Ee[Ne]=new en)}var oe,ge,fe,ve=re.trans,Ee=re.mutatedParts||(re.mutatedParts={}),Ce=ne(""),Re=ne(":dels"),Me=re.type,Ae=re.type==="deleteRange"?[re.range]:re.type==="delete"?[re.keys]:re.values.length<50?[qs(I,re).filter(function(Ne){return Ne}),re.values]:[],He=Ae[0],Ae=Ae[1],Ke=re.trans._cache;return g(He)?(Ce.addKeys(He),(Me=Me==="delete"||He.length===Ae.length?qa(He,Ke):null)||Re.addKeys(He),(Me||Ae)&&(oe=ne,ge=Me,fe=Ae,j.indexes.forEach(function(Ne){var rt=oe(Ne.name||"");function ot(ct){return ct!=null?Ne.extractKey(ct):null}function at(ct){Ne.multiEntry&&g(ct)?ct.forEach(function(yn){return rt.addKey(yn)}):rt.addKey(ct)}(ge||fe).forEach(function(ct,jt){var st=ge&&ot(ge[jt]),jt=fe&&ot(fe[jt]);ut(st,jt)!==0&&(st!=null&&at(st),jt!=null)&&at(jt)})}))):He?(Ae={from:(Ke=He.lower)!=null?Ke:s.MIN_KEY,to:(Me=He.upper)!=null?Me:s.MAX_KEY},Re.add(Ae),Ce.add(Ae)):(Ce.add(h),Re.add(h),j.indexes.forEach(function(Ne){return ne(Ne.name).add(h)})),k.mutate(re).then(function(Ne){return!He||re.type!=="add"&&re.type!=="put"||(Ce.addKeys(Ne.results),Y&&Y.forEach(function(rt){for(var ot=re.values.map(function(st){return rt.extractKey(st)}),at=rt.keyPath.findIndex(function(st){return st===I.keyPath}),ct=0,yn=Ne.results.length;ct<yn;++ct)ot[ct][at]=Ne.results[ct];ne(rt.name).addKeys(ot)})),ve.mutatedParts=Ji(ve.mutatedParts||{},Ee),Ne})}}),ie={get:function(re){return[I,new en(re.key)]},getMany:function(re){return[I,new en().addKeys(re.keys)]},count:_,query:_,openCursor:_};return d(ie).forEach(function(re){Z[re]=function(ne){var oe=Ue.subscr,ge=!!oe,fe=Wa(Ue,k)&&Ya(re,ne)?ne.obsSet={}:oe;if(ge){var ve,oe=function(Ae){return Ae="idb://".concat(c,"/").concat(y,"/").concat(Ae),fe[Ae]||(fe[Ae]=new en)},Ee=oe(""),Ce=oe(":dels"),ge=ie[re](ne),Re=ge[0],ge=ge[1];if((re==="query"&&Re.isPrimaryKey&&!ne.values?Ce:oe(Re.name||"")).add(ge),!Re.isPrimaryKey){if(re!=="count")return ve=re==="query"&&J&&ne.values&&k.query(a(a({},ne),{values:!1})),k[re].apply(this,arguments).then(function(Ae){if(re==="query"){if(J&&ne.values)return ve.then(function(ot){return ot=ot.result,Ee.addKeys(ot),Ae});var Ke=ne.values?Ae.result.map(se):Ae.result;(ne.values?Ee:Ce).addKeys(Ke)}else{var Ne,rt;if(re==="openCursor")return rt=ne.values,(Ne=Ae)&&Object.create(Ne,{key:{get:function(){return Ce.addKey(Ne.primaryKey),Ne.key}},primaryKey:{get:function(){var ot=Ne.primaryKey;return Ce.addKey(ot),ot}},value:{get:function(){return rt&&Ee.addKey(Ne.primaryKey),Ne.value}}})}return Ae});Ce.add(h)}}return k[re].apply(this,arguments)}}),Z}})}};function Fo(s,c,h){var y;return h.numFailures===0?c:c.type==="deleteRange"||(y=c.keys?c.keys.length:"values"in c&&c.values?c.values.length:1,h.numFailures===y)?null:(y=a({},c),g(y.keys)&&(y.keys=y.keys.filter(function(_,k){return!(k in h.failures)})),"values"in y&&g(y.values)&&(y.values=y.values.filter(function(_,k){return!(k in h.failures)})),y)}function Ys(s,c){return h=s,((y=c).lower===void 0||(y.lowerOpen?0<ut(h,y.lower):0<=ut(h,y.lower)))&&(h=s,(y=c).upper===void 0||(y.upperOpen?ut(h,y.upper)<0:ut(h,y.upper)<=0));var h,y}function Xs(s,c,h,y,_,k){var j,I,G,se,J,Y,Z;return!h||h.length===0||(j=c.query.index,I=j.multiEntry,G=c.query.range,se=y.schema.primaryKey.extractKey,J=j.extractKey,Y=(j.lowLevelIndex||j).extractKey,(y=h.reduce(function(ie,re){var ne=ie,oe=[];if(re.type==="add"||re.type==="put")for(var ge=new en,fe=re.values.length-1;0<=fe;--fe){var ve,Ee=re.values[fe],Ce=se(Ee);!ge.hasKey(Ce)&&(ve=J(Ee),I&&g(ve)?ve.some(function(Ke){return Ys(Ke,G)}):Ys(ve,G))&&(ge.addKey(Ce),oe.push(Ee))}switch(re.type){case"add":var Re=new en().addKeys(c.values?ie.map(function(Ne){return se(Ne)}):ie),ne=ie.concat(c.values?oe.filter(function(Ne){return Ne=se(Ne),!Re.hasKey(Ne)&&(Re.addKey(Ne),!0)}):oe.map(function(Ne){return se(Ne)}).filter(function(Ne){return!Re.hasKey(Ne)&&(Re.addKey(Ne),!0)}));break;case"put":var Me=new en().addKeys(re.values.map(function(Ne){return se(Ne)}));ne=ie.filter(function(Ne){return!Me.hasKey(c.values?se(Ne):Ne)}).concat(c.values?oe:oe.map(function(Ne){return se(Ne)}));break;case"delete":var He=new en().addKeys(re.keys);ne=ie.filter(function(Ne){return!He.hasKey(c.values?se(Ne):Ne)});break;case"deleteRange":var Ae=re.range;ne=ie.filter(function(Ne){return!Ys(se(Ne),Ae)})}return ne},s))===s)?s:(Z=function(ie,re){return ut(Y(ie),Y(re))||ut(se(ie),se(re))},y.sort(c.direction==="prev"||c.direction==="prevunique"?function(ie,re){return Z(re,ie)}:Z),c.limit&&c.limit<1/0&&(y.length>c.limit?y.length=c.limit:s.length===c.limit&&y.length<c.limit&&(_.dirty=!0)),k?Object.freeze(y):y)}function Qs(s,c){return ut(s.lower,c.lower)===0&&ut(s.upper,c.upper)===0&&!!s.lowerOpen==!!c.lowerOpen&&!!s.upperOpen==!!c.upperOpen}function Xa(s,c){return((h,y,_,k)=>{if(h===void 0)return y!==void 0?-1:0;if(y===void 0)return 1;if((h=ut(h,y))===0){if(_&&k)return 0;if(_)return 1;if(k)return-1}return h})(s.lower,c.lower,s.lowerOpen,c.lowerOpen)<=0&&0<=((h,y,_,k)=>{if(h===void 0)return y!==void 0?1:0;if(y===void 0)return-1;if((h=ut(h,y))===0){if(_&&k)return 0;if(_)return-1;if(k)return 1}return h})(s.upper,c.upper,s.upperOpen,c.upperOpen)}function Qa(s,c,h,y){s.subscribers.add(h),y.addEventListener("abort",function(){var _,k;s.subscribers.delete(h),s.subscribers.size===0&&(_=s,k=c,setTimeout(function(){_.subscribers.size===0&&L(k,_)},3e3))})}var Ga={stack:"dbcore",level:0,name:"Cache",create:function(s){var c=s.schema.name;return a(a({},s),{transaction:function(h,y,_){var k,j,I=s.transaction(h,y,_);return y==="readwrite"&&(_=(k=new AbortController).signal,I.addEventListener("abort",(j=function(G){return function(){if(k.abort(),y==="readwrite"){for(var se=new Set,J=0,Y=h;J<Y.length;J++){var Z=Y[J],ie=Ur["idb://".concat(c,"/").concat(Z)];if(ie){var re=s.table(Z),ne=ie.optimisticOps.filter(function(Ne){return Ne.trans===I});if(I._explicit&&G&&I.mutatedParts)for(var oe=0,ge=Object.values(ie.queries.query);oe<ge.length;oe++)for(var fe=0,ve=(Re=ge[oe]).slice();fe<ve.length;fe++)Fs((Me=ve[fe]).obsSet,I.mutatedParts)&&(L(Re,Me),Me.subscribers.forEach(function(Ne){return se.add(Ne)}));else if(0<ne.length){ie.optimisticOps=ie.optimisticOps.filter(function(Ne){return Ne.trans!==I});for(var Ee=0,Ce=Object.values(ie.queries.query);Ee<Ce.length;Ee++)for(var Re,Me,He,Ae=0,Ke=(Re=Ce[Ee]).slice();Ae<Ke.length;Ae++)(Me=Ke[Ae]).res!=null&&I.mutatedParts&&(G&&!Me.dirty?(He=Object.isFrozen(Me.res),He=Xs(Me.res,Me.req,ne,re,Me,He),Me.dirty?(L(Re,Me),Me.subscribers.forEach(function(Ne){return se.add(Ne)})):He!==Me.res&&(Me.res=He,Me.promise=Fe.resolve({result:He}))):(Me.dirty&&L(Re,Me),Me.subscribers.forEach(function(Ne){return se.add(Ne)})))}}}se.forEach(function(Ne){return Ne()})}}})(!1),{signal:_}),I.addEventListener("error",j(!1),{signal:_}),I.addEventListener("complete",j(!0),{signal:_})),I},table:function(h){var y=s.table(h),_=y.schema.primaryKey;return a(a({},y),{mutate:function(k){var j,I=Ue.trans;return!_.outbound&&I.db._options.cache!=="disabled"&&!I.explicit&&I.idbtrans.mode==="readwrite"&&(j=Ur["idb://".concat(c,"/").concat(h)])?(I=y.mutate(k),k.type!=="add"&&k.type!=="put"||!(50<=k.values.length||qs(_,k).some(function(G){return G==null}))?(j.optimisticOps.push(k),k.mutatedParts&&es(k.mutatedParts),I.then(function(G){0<G.numFailures&&(L(j.optimisticOps,k),(G=Fo(0,k,G))&&j.optimisticOps.push(G),k.mutatedParts)&&es(k.mutatedParts)}),I.catch(function(){L(j.optimisticOps,k),k.mutatedParts&&es(k.mutatedParts)})):I.then(function(G){var se=Fo(0,a(a({},k),{values:k.values.map(function(J,Y){var Z;return G.failures[Y]?J:(U(Z=(Z=_.keyPath)!=null&&Z.includes(".")?xe(J):a({},J),_.keyPath,G.results[Y]),Z)})}),G);j.optimisticOps.push(se),queueMicrotask(function(){return k.mutatedParts&&es(k.mutatedParts)})}),I):y.mutate(k)},query:function(k){var j,I,G,se,J,Y,Z;return Wa(Ue,y)&&Ya("query",k)?(j=((G=Ue.trans)==null?void 0:G.db._options.cache)==="immutable",I=(G=Ue).requery,G=G.signal,Y=((ie,re,ne,oe)=>{var ge=Ur["idb://".concat(ie,"/").concat(re)];if(!ge)return[];if(!(ie=ge.queries[ne]))return[null,!1,ge,null];var fe=ie[(oe.query?oe.query.index.name:null)||""];if(!fe)return[null,!1,ge,null];switch(ne){case"query":var ve=(Ee=oe.direction)!=null?Ee:"next",Ee=fe.find(function(Ce){var Re;return Ce.req.limit===oe.limit&&Ce.req.values===oe.values&&((Re=Ce.req.direction)!=null?Re:"next")===ve&&Qs(Ce.req.query.range,oe.query.range)});return Ee?[Ee,!0,ge,fe]:[fe.find(function(Ce){var Re;return("limit"in Ce.req?Ce.req.limit:1/0)>=oe.limit&&((Re=Ce.req.direction)!=null?Re:"next")===ve&&(!oe.values||Ce.req.values)&&Xa(Ce.req.query.range,oe.query.range)}),!1,ge,fe];case"count":return Ee=fe.find(function(Ce){return Qs(Ce.req.query.range,oe.query.range)}),[Ee,!!Ee,ge,fe]}})(c,h,"query",k),Z=Y[0],se=Y[2],J=Y[3],Z&&Y[1]?Z.obsSet=k.obsSet:(Y=y.query(k).then(function(ie){var re=ie.result;if(Z&&(Z.res=re),j){for(var ne=0,oe=re.length;ne<oe;++ne)Object.freeze(re[ne]);Object.freeze(re)}else ie.result=xe(re);return ie}).catch(function(ie){return J&&Z&&L(J,Z),Promise.reject(ie)}),Z={obsSet:k.obsSet,promise:Y,subscribers:new Set,type:"query",req:k,dirty:!1},J?J.push(Z):(J=[Z],(se=se||(Ur["idb://".concat(c,"/").concat(h)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[k.query.index.name||""]=J)),Qa(Z,J,I,G),Z.promise.then(function(ie){return{result:Xs(ie.result,k,se==null?void 0:se.optimisticOps,y,Z,j)}})):y.query(k)}})}})}};function br(s,c){return new Proxy(s,{get:function(h,y,_){return y==="db"?c:Reflect.get(h,y,_)}})}Rt.prototype.version=function(s){if(isNaN(s)||s<.1)throw new ke.Type("Given version is not a positive number");if(s=Math.round(10*s)/10,this.idbdb||this._state.isBeingOpened)throw new ke.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,s);var c=this._versions,h=c.filter(function(y){return y._cfg.version===s})[0];return h||(h=new this.Version(s),c.push(h),c.sort(Kr),h.stores({}),this._state.autoSchema=!1),h},Rt.prototype._whenReady=function(s){var c=this;return this.idbdb&&(this._state.openComplete||Ue.letThrough||this._vip)?s():new Fe(function(h,y){if(c._state.openComplete)return y(new ke.DatabaseClosed(c._state.dbOpenError));if(!c._state.isBeingOpened){if(!c._state.autoOpen)return void y(new ke.DatabaseClosed);c.open().catch(Oe)}c._state.dbReadyPromise.then(h,y)}).then(s)},Rt.prototype.use=function(_){var c=_.stack,h=_.create,y=_.level,_=_.name,k=(_&&this.unuse({stack:c,name:_}),this._middlewares[c]||(this._middlewares[c]=[]));return k.push({stack:c,create:h,level:y??10,name:_}),k.sort(function(j,I){return j.level-I.level}),this},Rt.prototype.unuse=function(s){var c=s.stack,h=s.name,y=s.create;return c&&this._middlewares[c]&&(this._middlewares[c]=this._middlewares[c].filter(function(_){return y?_.create!==y:!!h&&_.name!==h})),this},Rt.prototype.open=function(){var s=this;return ir(bn,function(){return $u(s)})},Rt.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var s=this._state;if(co.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}s.isBeingOpened||(s.dbReadyPromise=new Fe(function(c){s.dbReadyResolve=c}),s.openCanceller=new Fe(function(c,h){s.cancelOpen=h}))},Rt.prototype.close=function(c){var c=(c===void 0?{disableAutoOpen:!0}:c).disableAutoOpen,h=this._state;c?(h.isBeingOpened&&h.cancelOpen(new ke.DatabaseClosed),this._close(),h.autoOpen=!1,h.dbOpenError=new ke.DatabaseClosed):(this._close(),h.autoOpen=this._options.autoOpen||h.isBeingOpened,h.openComplete=!1,h.dbOpenError=null)},Rt.prototype.delete=function(s){var c=this,h=(s===void 0&&(s={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),y=this._state;return new Fe(function(_,k){function j(){c.close(s);var I=c._deps.indexedDB.deleteDatabase(c.name);I.onsuccess=ht(function(){var G,se,J;G=c._deps,se=c.name,fo(J=G.indexedDB)||se===Lr||vi(J,G.IDBKeyRange).delete(se).catch(Oe),_()}),I.onerror=ln(k),I.onblocked=c._fireOnBlocked}if(h)throw new ke.InvalidArgument("Invalid closeOptions argument to db.delete()");y.isBeingOpened?y.dbReadyPromise.then(j):j()})},Rt.prototype.backendDB=function(){return this.idbdb},Rt.prototype.isOpen=function(){return this.idbdb!==null},Rt.prototype.hasBeenClosed=function(){var s=this._state.dbOpenError;return s&&s.name==="DatabaseClosed"},Rt.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Rt.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Rt.prototype,"tables",{get:function(){var s=this;return d(this._allTables).map(function(c){return s._allTables[c]})},enumerable:!1,configurable:!0}),Rt.prototype.transaction=function(){var s=(function(c,h,y){var _=arguments.length;if(_<2)throw new ke.InvalidArgument("Too few arguments");for(var k=new Array(_-1);--_;)k[_-1]=arguments[_];return y=k.pop(),[c,Se(k),y]}).apply(this,arguments);return this._transaction.apply(this,s)},Rt.prototype._transaction=function(s,c,h){var y,_,k=this,j=Ue.trans,I=(j&&j.db===this&&s.indexOf("!")===-1||(j=null),s.indexOf("?")!==-1);s=s.replace("!","").replace("?","");try{if(_=c.map(function(se){if(se=se instanceof k.Table?se.name:se,typeof se!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return se}),s=="r"||s===Io)y=Io;else{if(s!="rw"&&s!=Fr)throw new ke.InvalidArgument("Invalid transaction mode: "+s);y=Fr}if(j){if(j.mode===Io&&y===Fr){if(!I)throw new ke.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");j=null}j&&_.forEach(function(se){if(j&&j.storeNames.indexOf(se)===-1){if(!I)throw new ke.SubTransaction("Table "+se+" not included in parent transaction.");j=null}}),I&&j&&!j.active&&(j=null)}}catch(se){return j?j._promise(null,function(J,Y){Y(se)}):Pt(se)}var G=(function se(J,Y,Z,ie,re){return Fe.resolve().then(function(){var fe=Ue.transless||Ue,ne=J._createTransaction(Y,Z,J._dbSchema,ie),fe=(ne.explicit=!0,{trans:ne,transless:fe});if(ie)ne.idbtrans=ie.idbtrans;else try{ne.create(),ne.idbtrans._explicit=!0,J._state.PR1398_maxLoop=3}catch(ve){return ve.name===we.InvalidState&&J.isOpen()&&0<--J._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),J.close({disableAutoOpen:!1}),J.open().then(function(){return se(J,Y,Z,null,re)})):Pt(ve)}var oe,ge=O(re),fe=(ge&&zr(),Fe.follow(function(){var ve;(oe=re.call(ne,ne))&&(ge?(ve=Qt.bind(null,null),oe.then(ve,ve)):typeof oe.next=="function"&&typeof oe.throw=="function"&&(oe=Ks(oe)))},fe));return(oe&&typeof oe.then=="function"?Fe.resolve(oe).then(function(ve){return ne.active?ve:Pt(new ke.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):fe.then(function(){return oe})).then(function(ve){return ie&&ne._resolve(),ne._completion.then(function(){return ve})}).catch(function(ve){return ne._reject(ve),Pt(ve)})})}).bind(null,this,y,_,j,h);return j?j._promise(y,G,"lock"):Ue.trans?ir(Ue.transless,function(){return k._whenReady(G)}):this._whenReady(G)},Rt.prototype.table=function(s){if(x(this._allTables,s))return this._allTables[s];throw new ke.InvalidTable("Table ".concat(s," does not exist"))};var kr=Rt;function Rt(s,c){var h,y,_,k,j,I=this,G=(this._middlewares={},this.verno=0,Rt.dependencies),G=(this._options=c=a({addons:Rt.addons,autoOpen:!0,indexedDB:G.indexedDB,IDBKeyRange:G.IDBKeyRange,cache:"cloned",maxConnections:1e3},c),this._deps={indexedDB:c.indexedDB,IDBKeyRange:c.IDBKeyRange},c.addons),se=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Oe,dbReadyPromise:null,cancelOpen:Oe,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:c.autoOpen}),J=(se.dbReadyPromise=new Fe(function(Y){se.dbReadyResolve=Y}),se.openCanceller=new Fe(function(Y,Z){se.cancelOpen=Z}),this._state=se,this.name=s,this.on=Br(this,"populate","blocked","versionchange","close",{ready:[Wt,Oe]}),this.once=function(Y,Z){var ie=function(){for(var re=[],ne=0;ne<arguments.length;ne++)re[ne]=arguments[ne];I.on(Y).unsubscribe(ie),Z.apply(I,re)};return I.on(Y,ie)},this.on.ready.subscribe=M(this.on.ready.subscribe,function(Y){return function(Z,ie){Rt.vip(function(){var re,ne=I._state;ne.openComplete?(ne.dbOpenError||Fe.resolve().then(Z),ie&&Y(Z)):ne.onReadyBeingFired?(ne.onReadyBeingFired.push(Z),ie&&Y(Z)):(Y(Z),re=I,ie||Y(function oe(){re.on.ready.unsubscribe(Z),re.on.ready.unsubscribe(oe)}))})}}),this.Collection=(h=this,oo(Fa.prototype,function(oe,ne){this.db=h;var ie=fi,re=null;if(ne)try{ie=ne()}catch(fe){re=fe}var ne=oe._ctx,oe=ne.table,ge=oe.hook.reading.fire;this._ctx={table:oe,index:ne.index,isPrimKey:!ne.index||oe.schema.primKey.keyPath&&ne.index===oe.schema.primKey.name,range:ie,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:re,or:ne.or,valueMapper:ge!==Ye?ge:null}})),this.Table=(y=this,oo(qn.prototype,function(Y,Z,ie){this.db=y,this._tx=ie,this.name=Y,this.schema=Z,this.hook=y._allTables[Y]?y._allTables[Y].hook:Br(null,{creating:[lt,Oe],reading:[et,Ye],updating:[dn,Oe],deleting:[kt,Oe]})})),this.Transaction=(_=this,oo(Iu.prototype,function(Y,Z,ie,re,ne){var oe=this;Y!=="readonly"&&Z.forEach(function(ge){ge=(ge=ie[ge])==null?void 0:ge.yProps,ge&&(Z=Z.concat(ge.map(function(fe){return fe.updatesTable})))}),this.db=_,this.mode=Y,this.storeNames=Z,this.schema=ie,this.chromeTransactionDurability=re,this.idbtrans=null,this.on=Br(this,"complete","error","abort"),this.parent=ne||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new Fe(function(ge,fe){oe._resolve=ge,oe._reject=fe}),this._completion.then(function(){oe.active=!1,oe.on.complete.fire()},function(ge){var fe=oe.active;return oe.active=!1,oe.on.error.fire(ge),oe.parent?oe.parent._reject(ge):fe&&oe.idbtrans&&oe.idbtrans.abort(),Pt(ge)})})),this.Version=(k=this,oo(yi.prototype,function(Y){this.db=k,this._cfg={version:Y,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(j=this,oo(wr.prototype,function(Y,Z,ie){if(this.db=j,this._ctx={table:Y,index:Z===":id"?null:Z,or:ie},this._cmp=this._ascending=ut,this._descending=function(re,ne){return ut(ne,re)},this._max=function(re,ne){return 0<ut(re,ne)?re:ne},this._min=function(re,ne){return ut(re,ne)<0?re:ne},this._IDBKeyRange=j._deps.IDBKeyRange,!this._IDBKeyRange)throw new ke.MissingAPI})),this.on("versionchange",function(Y){0<Y.newVersion?console.warn("Another connection wants to upgrade database '".concat(I.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(I.name,"'. Closing db now to resume the delete request.")),I.close({disableAutoOpen:!1})}),this.on("blocked",function(Y){!Y.newVersion||Y.newVersion<Y.oldVersion?console.warn("Dexie.delete('".concat(I.name,"') was blocked")):console.warn("Upgrade '".concat(I.name,"' blocked by other connection holding version ").concat(Y.oldVersion/10))}),this._maxKey=_r(c.IDBKeyRange),this._createTransaction=function(Y,Z,ie,re){return new I.Transaction(Y,Z,ie,I._options.chromeTransactionDurability,re)},this._fireOnBlocked=function(Y){I.on("blocked").fire(Y),co.toArray().filter(function(Z){return Z.name===I.name&&Z!==I&&!Z._state.vcFired}).map(function(Z){return Z.on("versionchange").fire(Y)})},this.use(Ru),this.use(Ga),this.use(Ws),this.use(Ua),this.use(Ou),new Proxy(this,{get:function(Y,Z,ie){var re;return Z==="_vip"||(Z==="table"?function(ne){return br(I.table(ne),J)}:(re=Reflect.get(Y,Z,ie))instanceof qn?br(re,J):Z==="tables"?re.map(function(ne){return br(ne,J)}):Z==="_createTransaction"?function(){return br(re.apply(this,arguments),J)}:re)}}));this.vip=J,G.forEach(function(Y){return Y(I)})}var rs,po=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Za=(ho.prototype.subscribe=function(s,c,h){return this._subscribe(s&&typeof s!="function"?s:{next:s,error:c,complete:h})},ho.prototype[po]=function(){return this},ho);function ho(s){this._subscribe=s}try{rs={indexedDB:f.indexedDB||f.mozIndexedDB||f.webkitIndexedDB||f.msIndexedDB,IDBKeyRange:f.IDBKeyRange||f.webkitIDBKeyRange}}catch{rs={indexedDB:null,IDBKeyRange:null}}function Bo(s){var c,h=!1,y=new Za(function(_){var k=O(s),j,I=!1,G={},se={},J={get closed(){return I},unsubscribe:function(){I||(I=!0,j&&j.abort(),Y&&$n.storagemutated.unsubscribe(re))}},Y=(_.start&&_.start(J),!1),Z=function(){return To(ne)};function ie(){return Fs(se,G)}var re=function(oe){Ji(G,oe),ie()&&Z()},ne=function(){var oe,ge,fe;!I&&rs.indexedDB&&(G={},oe={},j&&j.abort(),j=new AbortController,fe=(ve=>{var Ee=Lt();try{k&&zr();var Ce=rr(s,ve);return Ce=k?Ce.finally(Qt):Ce}finally{Ee&&Xt()}})(ge={subscr:oe,signal:j.signal,requery:Z,querier:s,trans:null}),Y||($n(pi,re),Y=!0),Promise.resolve(fe).then(function(ve){h=!0,c=ve,I||ge.signal.aborted||(ie()||(se=oe,ie())?Z():(G={},To(function(){return!I&&_.next&&_.next(ve)})))},function(ve){h=!1,["DatabaseClosedError","AbortError"].includes(ve==null?void 0:ve.name)||I||To(function(){I||_.error&&_.error(ve)})}))};return setTimeout(Z,0),J});return y.hasValue=function(){return h},y.getValue=function(){return c},y}var mo=kr;function Ho(s){var c=Er;try{Er=!0,$n.storagemutated.fire(s),Vs(s,!0)}finally{Er=c}}b(mo,a(a({},B),{delete:function(s){return new mo(s,{addons:[]}).delete()},exists:function(s){return new mo(s,{addons:[]}).open().then(function(c){return c.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(s){try{return c=mo.dependencies,h=c.indexedDB,c=c.IDBKeyRange,(fo(h)?Promise.resolve(h.databases()).then(function(y){return y.map(function(_){return _.name}).filter(function(_){return _!==Lr})}):vi(h,c).toCollection().primaryKeys()).then(s)}catch{return Pt(new ke.MissingAPI)}var c,h},defineClass:function(){return function(s){v(this,s)}},ignoreTransaction:function(s){return Ue.trans?ir(Ue.transless||bn,s):s()},vip:Lo,async:function(s){return function(){try{var c=Ks(s.apply(this,arguments));return c&&typeof c.then=="function"?c:Fe.resolve(c)}catch(h){return Pt(h)}}},spawn:function(s,c,h){try{var y=Ks(s.apply(h,c||[]));return y&&typeof y.then=="function"?y:Fe.resolve(y)}catch(_){return Pt(_)}},currentTransaction:{get:function(){return Ue.trans||null}},waitFor:function(s,c){return s=Fe.resolve(typeof s=="function"?mo.ignoreTransaction(s):s).timeout(c||6e4),Ue.trans?Ue.trans.waitFor(s):s},Promise:Fe,debug:{get:function(){return Nt},set:function(s){jn(s)}},derive:A,extend:v,props:b,override:M,Events:Br,on:$n,liveQuery:Bo,extendObservabilitySet:Ji,getByKeyPath:V,setByKeyPath:U,delByKeyPath:function(s,c){typeof c=="string"?U(s,c,void 0):"length"in c&&[].map.call(c,function(h){U(s,h,void 0)})},shallowClone:le,deepClone:xe,getObjectDiff:Us,cmp:ut,asap:X,minKey:-1/0,addons:[],connections:{get:co.toArray},errnames:we,dependencies:rs,cache:Ur,semVer:"4.4.2",version:"4.4.2".split(".").map(function(s){return parseInt(s)}).reduce(function(s,c,h){return s+c/Math.pow(10,2*h)})})),mo.maxKey=_r(mo.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&($n(pi,function(s){Er||(s=new CustomEvent(Ki,{detail:s}),Er=!0,dispatchEvent(s),Er=!1)}),addEventListener(Ki,function(s){s=s.detail,Er||Ho(s)}));var Vo,Er=!1,os=function(){};return typeof BroadcastChannel<"u"&&((os=function(){(Vo=new BroadcastChannel(Ki)).onmessage=function(s){return s.data&&Ho(s.data)}})(),typeof Vo.unref=="function"&&Vo.unref(),$n(pi,function(s){Er||Vo.postMessage(s)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(s){if(!kr.disableBfCache&&s.persisted){Nt&&console.debug("Dexie: handling persisted pagehide"),Vo!=null&&Vo.close();for(var c=0,h=co.toArray();c<h.length;c++)h[c].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(s){!kr.disableBfCache&&s.persisted&&(Nt&&console.debug("Dexie: handling persisted pageshow"),os(),Ho({all:new en(-1/0,[[]])}))})),Fe.rejectionMapper=function(s,c){return!s||s instanceof _e||s instanceof TypeError||s instanceof SyntaxError||!s.name||!Je[s.name]?s:(c=new Je[s.name](c||s.message,s),"stack"in s&&C(c,"stack",{get:function(){return this.inner.stack}}),c)},jn(Nt),a(kr,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:kr,Entity:Nn,PropModification:to,RangeSet:en,add:function(s){return new to({add:s})},cmp:ut,default:kr,liveQuery:Bo,mergeRanges:wi,rangesOverlap:Gi,remove:function(s){return new to({remove:s})},replacePrefix:function(s,c){return new to({replacePrefix:[s,c]})}}),{default:kr}),kr})})(Zl)),Zl.exports}var N0=E0();const yf=yu(N0),Gp=Symbol.for("Dexie"),iu=globalThis[Gp]||(globalThis[Gp]=yf);if(yf.semVer!==iu.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${yf.semVer} and ${iu.semVer}`);const{liveQuery:Xb,mergeRanges:Qb,rangesOverlap:Gb,RangeSet:Zb,cmp:Jb,Entity:ek,PropModification:tk,replacePrefix:nk,add:rk,remove:ok,DexieYProvider:ik}=iu;class C0 extends iu{constructor(){super("api-doc-tor");ma(this,"flows");ma(this,"testSuites");ma(this,"environments");ma(this,"kv");this.version(1).stores({flows:"++id, name",testSuites:"++id, name",environments:"++id, name",kv:"key"})}}const St=new C0;async function P0(){const[t,r,i]=await Promise.all([St.flows.toArray(),St.testSuites.toArray(),St.environments.toArray()]),a=await St.kv.get("authTokens");let u;try{u=a!=null&&a.value?JSON.parse(a.value):void 0}catch{u=void 0}return{formatVersion:1,exportedAt:new Date().toISOString(),flows:t,testSuites:r,environments:i,authTokens:u}}async function pm(t){await St.transaction("rw",St.flows,St.testSuites,St.environments,St.kv,async()=>{await St.flows.clear(),await St.testSuites.clear(),await St.environments.clear();for(const r of t.flows)await St.flows.add({name:r.name,steps:r.steps,graph:r.graph});for(const r of t.testSuites)await St.testSuites.add({name:r.name,cases:r.cases});for(const r of t.environments)await St.environments.add({name:r.name,baseUrl:r.baseUrl,vars:r.vars??{}});t.authTokens&&await St.kv.put({key:"authTokens",value:JSON.stringify(t.authTokens)})})}async function j0(t){if(t.formatVersion!==1)return!1;const[r,i]=await Promise.all([St.flows.count(),St.testSuites.count()]);return r>0||i>0?!1:(await pm(t),!0)}function M0(t,r,i){var d,g;const a=[],u=r===t.expectStatus;if(a.push(`HTTP ${r} ${u?"✓":`✗ (esperado ${t.expectStatus})`}`),!u)return{pass:!1,lines:a};if((d=t.contains)!=null&&d.trim()){const v=i.includes(t.contains);if(a.push(`Contiene texto "${t.contains}": ${v?"✓":"✗"}`),!v)return{pass:!1,lines:a}}const f=(g=t.jsonPath)==null?void 0:g.trim();if(f){let v;try{v=JSON.parse(i)}catch{return a.push("Body no es JSON válido: ✗"),{pass:!1,lines:a}}const w=Af(v,f),S=t.expectJsonValue;if(S!==void 0&&S!==""){const x=w==null?String(w):typeof w=="object"?JSON.stringify(w):String(w),b=S.trim(),N=x===b||String(w)===b;if(a.push(`JSON path ${f} → ${x} vs "${b}": ${N?"✓":"✗"}`),!N)return{pass:!1,lines:a}}else{const x=w!=null;if(a.push(`JSON path ${f} existe: ${x?"✓":"✗"}`),!x)return{pass:!1,lines:a}}}return{pass:!0,lines:a}}function qt(t){if(typeof t=="string"||typeof t=="number")return""+t;let r="";if(Array.isArray(t))for(let i=0,a;i<t.length;i++)(a=qt(t[i]))!==""&&(r+=(r&&" ")+a);else for(let i in t)t[i]&&(r+=(r&&" ")+i);return r}var T0={value:()=>{}};function _u(){for(var t=0,r=arguments.length,i={},a;t<r;++t){if(!(a=arguments[t]+"")||a in i||/[\s.]/.test(a))throw new Error("illegal type: "+a);i[a]=[]}return new Jl(i)}function Jl(t){this._=t}function I0(t,r){return t.trim().split(/^|\s+/).map(function(i){var a="",u=i.indexOf(".");if(u>=0&&(a=i.slice(u+1),i=i.slice(0,u)),i&&!r.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:a}})}Jl.prototype=_u.prototype={constructor:Jl,on:function(t,r){var i=this._,a=I0(t+"",i),u,f=-1,d=a.length;if(arguments.length<2){for(;++f<d;)if((u=(t=a[f]).type)&&(u=A0(i[u],t.name)))return u;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++f<d;)if(u=(t=a[f]).type)i[u]=Zp(i[u],t.name,r);else if(r==null)for(u in i)i[u]=Zp(i[u],t.name,null);return this},copy:function(){var t={},r=this._;for(var i in r)t[i]=r[i].slice();return new Jl(t)},call:function(t,r){if((u=arguments.length-2)>0)for(var i=new Array(u),a=0,u,f;a<u;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(f=this._[t],a=0,u=f.length;a<u;++a)f[a].value.apply(r,i)},apply:function(t,r,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var a=this._[t],u=0,f=a.length;u<f;++u)a[u].value.apply(r,i)}};function A0(t,r){for(var i=0,a=t.length,u;i<a;++i)if((u=t[i]).name===r)return u.value}function Zp(t,r,i){for(var a=0,u=t.length;a<u;++a)if(t[a].name===r){t[a]=T0,t=t.slice(0,a).concat(t.slice(a+1));break}return i!=null&&t.push({name:r,value:i}),t}var vf="http://www.w3.org/1999/xhtml";const Jp={svg:"http://www.w3.org/2000/svg",xhtml:vf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Su(t){var r=t+="",i=r.indexOf(":");return i>=0&&(r=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),Jp.hasOwnProperty(r)?{space:Jp[r],local:t}:t}function $0(t){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===vf&&r.documentElement.namespaceURI===vf?r.createElement(t):r.createElementNS(i,t)}}function O0(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function hm(t){var r=Su(t);return(r.local?O0:$0)(r)}function R0(){}function $f(t){return t==null?R0:function(){return this.querySelector(t)}}function z0(t){typeof t!="function"&&(t=$f(t));for(var r=this._groups,i=r.length,a=new Array(i),u=0;u<i;++u)for(var f=r[u],d=f.length,g=a[u]=new Array(d),v,w,S=0;S<d;++S)(v=f[S])&&(w=t.call(v,v.__data__,S,f))&&("__data__"in v&&(w.__data__=v.__data__),g[S]=w);return new Zn(a,this._parents)}function D0(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function L0(){return[]}function mm(t){return t==null?L0:function(){return this.querySelectorAll(t)}}function F0(t){return function(){return D0(t.apply(this,arguments))}}function B0(t){typeof t=="function"?t=F0(t):t=mm(t);for(var r=this._groups,i=r.length,a=[],u=[],f=0;f<i;++f)for(var d=r[f],g=d.length,v,w=0;w<g;++w)(v=d[w])&&(a.push(t.call(v,v.__data__,w,d)),u.push(v));return new Zn(a,u)}function gm(t){return function(){return this.matches(t)}}function ym(t){return function(r){return r.matches(t)}}var H0=Array.prototype.find;function V0(t){return function(){return H0.call(this.children,t)}}function K0(){return this.firstElementChild}function U0(t){return this.select(t==null?K0:V0(typeof t=="function"?t:ym(t)))}var q0=Array.prototype.filter;function W0(){return Array.from(this.children)}function Y0(t){return function(){return q0.call(this.children,t)}}function X0(t){return this.selectAll(t==null?W0:Y0(typeof t=="function"?t:ym(t)))}function Q0(t){typeof t!="function"&&(t=gm(t));for(var r=this._groups,i=r.length,a=new Array(i),u=0;u<i;++u)for(var f=r[u],d=f.length,g=a[u]=[],v,w=0;w<d;++w)(v=f[w])&&t.call(v,v.__data__,w,f)&&g.push(v);return new Zn(a,this._parents)}function vm(t){return new Array(t.length)}function G0(){return new Zn(this._enter||this._groups.map(vm),this._parents)}function su(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}su.prototype={constructor:su,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,r){return this._parent.insertBefore(t,r)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Z0(t){return function(){return t}}function J0(t,r,i,a,u,f){for(var d=0,g,v=r.length,w=f.length;d<w;++d)(g=r[d])?(g.__data__=f[d],a[d]=g):i[d]=new su(t,f[d]);for(;d<v;++d)(g=r[d])&&(u[d]=g)}function ev(t,r,i,a,u,f,d){var g,v,w=new Map,S=r.length,x=f.length,b=new Array(S),N;for(g=0;g<S;++g)(v=r[g])&&(b[g]=N=d.call(v,v.__data__,g,r)+"",w.has(N)?u[g]=v:w.set(N,v));for(g=0;g<x;++g)N=d.call(t,f[g],g,f)+"",(v=w.get(N))?(a[g]=v,v.__data__=f[g],w.delete(N)):i[g]=new su(t,f[g]);for(g=0;g<S;++g)(v=r[g])&&w.get(b[g])===v&&(u[g]=v)}function tv(t){return t.__data__}function nv(t,r){if(!arguments.length)return Array.from(this,tv);var i=r?ev:J0,a=this._parents,u=this._groups;typeof t!="function"&&(t=Z0(t));for(var f=u.length,d=new Array(f),g=new Array(f),v=new Array(f),w=0;w<f;++w){var S=a[w],x=u[w],b=x.length,N=rv(t.call(S,S&&S.__data__,w,a)),C=N.length,A=g[w]=new Array(C),T=d[w]=new Array(C),$=v[w]=new Array(b);i(S,x,A,T,$,N,r);for(var H=0,M=0,R,X;H<C;++H)if(R=A[H]){for(H>=M&&(M=H+1);!(X=T[M])&&++M<C;);R._next=X||null}}return d=new Zn(d,a),d._enter=g,d._exit=v,d}function rv(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function ov(){return new Zn(this._exit||this._groups.map(vm),this._parents)}function iv(t,r,i){var a=this.enter(),u=this,f=this.exit();return typeof t=="function"?(a=t(a),a&&(a=a.selection())):a=a.append(t+""),r!=null&&(u=r(u),u&&(u=u.selection())),i==null?f.remove():i(f),a&&u?a.merge(u).order():u}function sv(t){for(var r=t.selection?t.selection():t,i=this._groups,a=r._groups,u=i.length,f=a.length,d=Math.min(u,f),g=new Array(u),v=0;v<d;++v)for(var w=i[v],S=a[v],x=w.length,b=g[v]=new Array(x),N,C=0;C<x;++C)(N=w[C]||S[C])&&(b[C]=N);for(;v<u;++v)g[v]=i[v];return new Zn(g,this._parents)}function av(){for(var t=this._groups,r=-1,i=t.length;++r<i;)for(var a=t[r],u=a.length-1,f=a[u],d;--u>=0;)(d=a[u])&&(f&&d.compareDocumentPosition(f)^4&&f.parentNode.insertBefore(d,f),f=d);return this}function lv(t){t||(t=uv);function r(x,b){return x&&b?t(x.__data__,b.__data__):!x-!b}for(var i=this._groups,a=i.length,u=new Array(a),f=0;f<a;++f){for(var d=i[f],g=d.length,v=u[f]=new Array(g),w,S=0;S<g;++S)(w=d[S])&&(v[S]=w);v.sort(r)}return new Zn(u,this._parents).order()}function uv(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function cv(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function fv(){return Array.from(this)}function dv(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var a=t[r],u=0,f=a.length;u<f;++u){var d=a[u];if(d)return d}return null}function pv(){let t=0;for(const r of this)++t;return t}function hv(){return!this.node()}function mv(t){for(var r=this._groups,i=0,a=r.length;i<a;++i)for(var u=r[i],f=0,d=u.length,g;f<d;++f)(g=u[f])&&t.call(g,g.__data__,f,u);return this}function gv(t){return function(){this.removeAttribute(t)}}function yv(t){return function(){this.removeAttributeNS(t.space,t.local)}}function vv(t,r){return function(){this.setAttribute(t,r)}}function xv(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function wv(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function _v(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function Sv(t,r){var i=Su(t);if(arguments.length<2){var a=this.node();return i.local?a.getAttributeNS(i.space,i.local):a.getAttribute(i)}return this.each((r==null?i.local?yv:gv:typeof r=="function"?i.local?_v:wv:i.local?xv:vv)(i,r))}function xm(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function bv(t){return function(){this.style.removeProperty(t)}}function kv(t,r,i){return function(){this.style.setProperty(t,r,i)}}function Ev(t,r,i){return function(){var a=r.apply(this,arguments);a==null?this.style.removeProperty(t):this.style.setProperty(t,a,i)}}function Nv(t,r,i){return arguments.length>1?this.each((r==null?bv:typeof r=="function"?Ev:kv)(t,r,i??"")):Ps(this.node(),t)}function Ps(t,r){return t.style.getPropertyValue(r)||xm(t).getComputedStyle(t,null).getPropertyValue(r)}function Cv(t){return function(){delete this[t]}}function Pv(t,r){return function(){this[t]=r}}function jv(t,r){return function(){var i=r.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function Mv(t,r){return arguments.length>1?this.each((r==null?Cv:typeof r=="function"?jv:Pv)(t,r)):this.node()[t]}function wm(t){return t.trim().split(/^|\s+/)}function Of(t){return t.classList||new _m(t)}function _m(t){this._node=t,this._names=wm(t.getAttribute("class")||"")}_m.prototype={add:function(t){var r=this._names.indexOf(t);r<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var r=this._names.indexOf(t);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Sm(t,r){for(var i=Of(t),a=-1,u=r.length;++a<u;)i.add(r[a])}function bm(t,r){for(var i=Of(t),a=-1,u=r.length;++a<u;)i.remove(r[a])}function Tv(t){return function(){Sm(this,t)}}function Iv(t){return function(){bm(this,t)}}function Av(t,r){return function(){(r.apply(this,arguments)?Sm:bm)(this,t)}}function $v(t,r){var i=wm(t+"");if(arguments.length<2){for(var a=Of(this.node()),u=-1,f=i.length;++u<f;)if(!a.contains(i[u]))return!1;return!0}return this.each((typeof r=="function"?Av:r?Tv:Iv)(i,r))}function Ov(){this.textContent=""}function Rv(t){return function(){this.textContent=t}}function zv(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function Dv(t){return arguments.length?this.each(t==null?Ov:(typeof t=="function"?zv:Rv)(t)):this.node().textContent}function Lv(){this.innerHTML=""}function Fv(t){return function(){this.innerHTML=t}}function Bv(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function Hv(t){return arguments.length?this.each(t==null?Lv:(typeof t=="function"?Bv:Fv)(t)):this.node().innerHTML}function Vv(){this.nextSibling&&this.parentNode.appendChild(this)}function Kv(){return this.each(Vv)}function Uv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function qv(){return this.each(Uv)}function Wv(t){var r=typeof t=="function"?t:hm(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function Yv(){return null}function Xv(t,r){var i=typeof t=="function"?t:hm(t),a=r==null?Yv:typeof r=="function"?r:$f(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),a.apply(this,arguments)||null)})}function Qv(){var t=this.parentNode;t&&t.removeChild(this)}function Gv(){return this.each(Qv)}function Zv(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function Jv(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function ex(t){return this.select(t?Jv:Zv)}function tx(t){return arguments.length?this.property("__data__",t):this.node().__data__}function nx(t){return function(r){t.call(this,r,this.__data__)}}function rx(t){return t.trim().split(/^|\s+/).map(function(r){var i="",a=r.indexOf(".");return a>=0&&(i=r.slice(a+1),r=r.slice(0,a)),{type:r,name:i}})}function ox(t){return function(){var r=this.__on;if(r){for(var i=0,a=-1,u=r.length,f;i<u;++i)f=r[i],(!t.type||f.type===t.type)&&f.name===t.name?this.removeEventListener(f.type,f.listener,f.options):r[++a]=f;++a?r.length=a:delete this.__on}}}function ix(t,r,i){return function(){var a=this.__on,u,f=nx(r);if(a){for(var d=0,g=a.length;d<g;++d)if((u=a[d]).type===t.type&&u.name===t.name){this.removeEventListener(u.type,u.listener,u.options),this.addEventListener(u.type,u.listener=f,u.options=i),u.value=r;return}}this.addEventListener(t.type,f,i),u={type:t.type,name:t.name,value:r,listener:f,options:i},a?a.push(u):this.__on=[u]}}function sx(t,r,i){var a=rx(t+""),u,f=a.length,d;if(arguments.length<2){var g=this.node().__on;if(g){for(var v=0,w=g.length,S;v<w;++v)for(u=0,S=g[v];u<f;++u)if((d=a[u]).type===S.type&&d.name===S.name)return S.value}return}for(g=r?ix:ox,u=0;u<f;++u)this.each(g(a[u],r,i));return this}function km(t,r,i){var a=xm(t),u=a.CustomEvent;typeof u=="function"?u=new u(r,i):(u=a.document.createEvent("Event"),i?(u.initEvent(r,i.bubbles,i.cancelable),u.detail=i.detail):u.initEvent(r,!1,!1)),t.dispatchEvent(u)}function ax(t,r){return function(){return km(this,t,r)}}function lx(t,r){return function(){return km(this,t,r.apply(this,arguments))}}function ux(t,r){return this.each((typeof r=="function"?lx:ax)(t,r))}function*cx(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var a=t[r],u=0,f=a.length,d;u<f;++u)(d=a[u])&&(yield d)}var Em=[null];function Zn(t,r){this._groups=t,this._parents=r}function Aa(){return new Zn([[document.documentElement]],Em)}function fx(){return this}Zn.prototype=Aa.prototype={constructor:Zn,select:z0,selectAll:B0,selectChild:U0,selectChildren:X0,filter:Q0,data:nv,enter:G0,exit:ov,join:iv,merge:sv,selection:fx,order:av,sort:lv,call:cv,nodes:fv,node:dv,size:pv,empty:hv,each:mv,attr:Sv,style:Nv,property:Mv,classed:$v,text:Dv,html:Hv,raise:Kv,lower:qv,append:Wv,insert:Xv,remove:Gv,clone:ex,datum:tx,on:sx,dispatch:ux,[Symbol.iterator]:cx};function Gn(t){return typeof t=="string"?new Zn([[document.querySelector(t)]],[document.documentElement]):new Zn([[t]],Em)}function dx(t){let r;for(;r=t.sourceEvent;)t=r;return t}function Tr(t,r){if(t=dx(t),r===void 0&&(r=t.currentTarget),r){var i=r.ownerSVGElement||r;if(i.createSVGPoint){var a=i.createSVGPoint();return a.x=t.clientX,a.y=t.clientY,a=a.matrixTransform(r.getScreenCTM().inverse()),[a.x,a.y]}if(r.getBoundingClientRect){var u=r.getBoundingClientRect();return[t.clientX-u.left-r.clientLeft,t.clientY-u.top-r.clientTop]}}return[t.pageX,t.pageY]}const px={passive:!1},ba={capture:!0,passive:!1};function Jc(t){t.stopImmediatePropagation()}function Ns(t){t.preventDefault(),t.stopImmediatePropagation()}function Nm(t){var r=t.document.documentElement,i=Gn(t).on("dragstart.drag",Ns,ba);"onselectstart"in r?i.on("selectstart.drag",Ns,ba):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function Cm(t,r){var i=t.document.documentElement,a=Gn(t).on("dragstart.drag",null);r&&(a.on("click.drag",Ns,ba),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in i?a.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Vl=t=>()=>t;function xf(t,{sourceEvent:r,subject:i,target:a,identifier:u,active:f,x:d,y:g,dx:v,dy:w,dispatch:S}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:u,enumerable:!0,configurable:!0},active:{value:f,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:g,enumerable:!0,configurable:!0},dx:{value:v,enumerable:!0,configurable:!0},dy:{value:w,enumerable:!0,configurable:!0},_:{value:S}})}xf.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function hx(t){return!t.ctrlKey&&!t.button}function mx(){return this.parentNode}function gx(t,r){return r??{x:t.x,y:t.y}}function yx(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pm(){var t=hx,r=mx,i=gx,a=yx,u={},f=_u("start","drag","end"),d=0,g,v,w,S,x=0;function b(R){R.on("mousedown.drag",N).filter(a).on("touchstart.drag",T).on("touchmove.drag",$,px).on("touchend.drag touchcancel.drag",H).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function N(R,X){if(!(S||!t.call(this,R,X))){var V=M(this,r.call(this,R,X),R,X,"mouse");V&&(Gn(R.view).on("mousemove.drag",C,ba).on("mouseup.drag",A,ba),Nm(R.view),Jc(R),w=!1,g=R.clientX,v=R.clientY,V("start",R))}}function C(R){if(Ns(R),!w){var X=R.clientX-g,V=R.clientY-v;w=X*X+V*V>x}u.mouse("drag",R)}function A(R){Gn(R.view).on("mousemove.drag mouseup.drag",null),Cm(R.view,w),Ns(R),u.mouse("end",R)}function T(R,X){if(t.call(this,R,X)){var V=R.changedTouches,U=r.call(this,R,X),le=V.length,he,Se;for(he=0;he<le;++he)(Se=M(this,U,R,X,V[he].identifier,V[he]))&&(Jc(R),Se("start",R,V[he]))}}function $(R){var X=R.changedTouches,V=X.length,U,le;for(U=0;U<V;++U)(le=u[X[U].identifier])&&(Ns(R),le("drag",R,X[U]))}function H(R){var X=R.changedTouches,V=X.length,U,le;for(S&&clearTimeout(S),S=setTimeout(function(){S=null},500),U=0;U<V;++U)(le=u[X[U].identifier])&&(Jc(R),le("end",R,X[U]))}function M(R,X,V,U,le,he){var Se=f.copy(),W=Tr(he||V,X),ue,xe,D;if((D=i.call(R,new xf("beforestart",{sourceEvent:V,target:b,identifier:le,active:d,x:W[0],y:W[1],dx:0,dy:0,dispatch:Se}),U))!=null)return ue=D.x-W[0]||0,xe=D.y-W[1]||0,function ce(te,ae,L){var F=W,Q;switch(te){case"start":u[le]=ce,Q=d++;break;case"end":delete u[le],--d;case"drag":W=Tr(L||ae,X),Q=d;break}Se.call(te,R,new xf(te,{sourceEvent:ae,subject:D,target:b,identifier:le,active:Q,x:W[0]+ue,y:W[1]+xe,dx:W[0]-F[0],dy:W[1]-F[1],dispatch:Se}),U)}}return b.filter=function(R){return arguments.length?(t=typeof R=="function"?R:Vl(!!R),b):t},b.container=function(R){return arguments.length?(r=typeof R=="function"?R:Vl(R),b):r},b.subject=function(R){return arguments.length?(i=typeof R=="function"?R:Vl(R),b):i},b.touchable=function(R){return arguments.length?(a=typeof R=="function"?R:Vl(!!R),b):a},b.on=function(){var R=f.on.apply(f,arguments);return R===f?b:R},b.clickDistance=function(R){return arguments.length?(x=(R=+R)*R,b):Math.sqrt(x)},b}function Rf(t,r,i){t.prototype=r.prototype=i,i.constructor=t}function jm(t,r){var i=Object.create(t.prototype);for(var a in r)i[a]=r[a];return i}function $a(){}var ka=.7,au=1/ka,Cs="\\s*([+-]?\\d+)\\s*",Ea="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",vx=/^#([0-9a-f]{3,8})$/,xx=new RegExp(`^rgb\\(${Cs},${Cs},${Cs}\\)$`),wx=new RegExp(`^rgb\\(${Gr},${Gr},${Gr}\\)$`),_x=new RegExp(`^rgba\\(${Cs},${Cs},${Cs},${Ea}\\)$`),Sx=new RegExp(`^rgba\\(${Gr},${Gr},${Gr},${Ea}\\)$`),bx=new RegExp(`^hsl\\(${Ea},${Gr},${Gr}\\)$`),kx=new RegExp(`^hsla\\(${Ea},${Gr},${Gr},${Ea}\\)$`),eh={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};Rf($a,zi,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:th,formatHex:th,formatHex8:Ex,formatHsl:Nx,formatRgb:nh,toString:nh});function th(){return this.rgb().formatHex()}function Ex(){return this.rgb().formatHex8()}function Nx(){return Mm(this).formatHsl()}function nh(){return this.rgb().formatRgb()}function zi(t){var r,i;return t=(t+"").trim().toLowerCase(),(r=vx.exec(t))?(i=r[1].length,r=parseInt(r[1],16),i===6?rh(r):i===3?new Bn(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?Kl(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?Kl(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=xx.exec(t))?new Bn(r[1],r[2],r[3],1):(r=wx.exec(t))?new Bn(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=_x.exec(t))?Kl(r[1],r[2],r[3],r[4]):(r=Sx.exec(t))?Kl(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=bx.exec(t))?sh(r[1],r[2]/100,r[3]/100,1):(r=kx.exec(t))?sh(r[1],r[2]/100,r[3]/100,r[4]):eh.hasOwnProperty(t)?rh(eh[t]):t==="transparent"?new Bn(NaN,NaN,NaN,0):null}function rh(t){return new Bn(t>>16&255,t>>8&255,t&255,1)}function Kl(t,r,i,a){return a<=0&&(t=r=i=NaN),new Bn(t,r,i,a)}function Cx(t){return t instanceof $a||(t=zi(t)),t?(t=t.rgb(),new Bn(t.r,t.g,t.b,t.opacity)):new Bn}function wf(t,r,i,a){return arguments.length===1?Cx(t):new Bn(t,r,i,a??1)}function Bn(t,r,i,a){this.r=+t,this.g=+r,this.b=+i,this.opacity=+a}Rf(Bn,wf,jm($a,{brighter(t){return t=t==null?au:Math.pow(au,t),new Bn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ka:Math.pow(ka,t),new Bn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Bn(Oi(this.r),Oi(this.g),Oi(this.b),lu(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:oh,formatHex:oh,formatHex8:Px,formatRgb:ih,toString:ih}));function oh(){return`#${$i(this.r)}${$i(this.g)}${$i(this.b)}`}function Px(){return`#${$i(this.r)}${$i(this.g)}${$i(this.b)}${$i((isNaN(this.opacity)?1:this.opacity)*255)}`}function ih(){const t=lu(this.opacity);return`${t===1?"rgb(":"rgba("}${Oi(this.r)}, ${Oi(this.g)}, ${Oi(this.b)}${t===1?")":`, ${t})`}`}function lu(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Oi(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function $i(t){return t=Oi(t),(t<16?"0":"")+t.toString(16)}function sh(t,r,i,a){return a<=0?t=r=i=NaN:i<=0||i>=1?t=r=NaN:r<=0&&(t=NaN),new Ir(t,r,i,a)}function Mm(t){if(t instanceof Ir)return new Ir(t.h,t.s,t.l,t.opacity);if(t instanceof $a||(t=zi(t)),!t)return new Ir;if(t instanceof Ir)return t;t=t.rgb();var r=t.r/255,i=t.g/255,a=t.b/255,u=Math.min(r,i,a),f=Math.max(r,i,a),d=NaN,g=f-u,v=(f+u)/2;return g?(r===f?d=(i-a)/g+(i<a)*6:i===f?d=(a-r)/g+2:d=(r-i)/g+4,g/=v<.5?f+u:2-f-u,d*=60):g=v>0&&v<1?0:d,new Ir(d,g,v,t.opacity)}function jx(t,r,i,a){return arguments.length===1?Mm(t):new Ir(t,r,i,a??1)}function Ir(t,r,i,a){this.h=+t,this.s=+r,this.l=+i,this.opacity=+a}Rf(Ir,jx,jm($a,{brighter(t){return t=t==null?au:Math.pow(au,t),new Ir(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ka:Math.pow(ka,t),new Ir(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,r=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,a=i+(i<.5?i:1-i)*r,u=2*i-a;return new Bn(ef(t>=240?t-240:t+120,u,a),ef(t,u,a),ef(t<120?t+240:t-120,u,a),this.opacity)},clamp(){return new Ir(ah(this.h),Ul(this.s),Ul(this.l),lu(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 t=lu(this.opacity);return`${t===1?"hsl(":"hsla("}${ah(this.h)}, ${Ul(this.s)*100}%, ${Ul(this.l)*100}%${t===1?")":`, ${t})`}`}}));function ah(t){return t=(t||0)%360,t<0?t+360:t}function Ul(t){return Math.max(0,Math.min(1,t||0))}function ef(t,r,i){return(t<60?r+(i-r)*t/60:t<180?i:t<240?r+(i-r)*(240-t)/60:r)*255}const zf=t=>()=>t;function Mx(t,r){return function(i){return t+i*r}}function Tx(t,r,i){return t=Math.pow(t,i),r=Math.pow(r,i)-t,i=1/i,function(a){return Math.pow(t+a*r,i)}}function Ix(t){return(t=+t)==1?Tm:function(r,i){return i-r?Tx(r,i,t):zf(isNaN(r)?i:r)}}function Tm(t,r){var i=r-t;return i?Mx(t,i):zf(isNaN(t)?r:t)}const uu=(function t(r){var i=Ix(r);function a(u,f){var d=i((u=wf(u)).r,(f=wf(f)).r),g=i(u.g,f.g),v=i(u.b,f.b),w=Tm(u.opacity,f.opacity);return function(S){return u.r=d(S),u.g=g(S),u.b=v(S),u.opacity=w(S),u+""}}return a.gamma=t,a})(1);function Ax(t,r){r||(r=[]);var i=t?Math.min(r.length,t.length):0,a=r.slice(),u;return function(f){for(u=0;u<i;++u)a[u]=t[u]*(1-f)+r[u]*f;return a}}function $x(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Ox(t,r){var i=r?r.length:0,a=t?Math.min(i,t.length):0,u=new Array(a),f=new Array(i),d;for(d=0;d<a;++d)u[d]=_a(t[d],r[d]);for(;d<i;++d)f[d]=r[d];return function(g){for(d=0;d<a;++d)f[d]=u[d](g);return f}}function Rx(t,r){var i=new Date;return t=+t,r=+r,function(a){return i.setTime(t*(1-a)+r*a),i}}function Qr(t,r){return t=+t,r=+r,function(i){return t*(1-i)+r*i}}function zx(t,r){var i={},a={},u;(t===null||typeof t!="object")&&(t={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in t?i[u]=_a(t[u],r[u]):a[u]=r[u];return function(f){for(u in i)a[u]=i[u](f);return a}}var _f=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tf=new RegExp(_f.source,"g");function Dx(t){return function(){return t}}function Lx(t){return function(r){return t(r)+""}}function Im(t,r){var i=_f.lastIndex=tf.lastIndex=0,a,u,f,d=-1,g=[],v=[];for(t=t+"",r=r+"";(a=_f.exec(t))&&(u=tf.exec(r));)(f=u.index)>i&&(f=r.slice(i,f),g[d]?g[d]+=f:g[++d]=f),(a=a[0])===(u=u[0])?g[d]?g[d]+=u:g[++d]=u:(g[++d]=null,v.push({i:d,x:Qr(a,u)})),i=tf.lastIndex;return i<r.length&&(f=r.slice(i),g[d]?g[d]+=f:g[++d]=f),g.length<2?v[0]?Lx(v[0].x):Dx(r):(r=v.length,function(w){for(var S=0,x;S<r;++S)g[(x=v[S]).i]=x.x(w);return g.join("")})}function _a(t,r){var i=typeof r,a;return r==null||i==="boolean"?zf(r):(i==="number"?Qr:i==="string"?(a=zi(r))?(r=a,uu):Im:r instanceof zi?uu:r instanceof Date?Rx:$x(r)?Ax:Array.isArray(r)?Ox:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?zx:Qr)(t,r)}var lh=180/Math.PI,Sf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Am(t,r,i,a,u,f){var d,g,v;return(d=Math.sqrt(t*t+r*r))&&(t/=d,r/=d),(v=t*i+r*a)&&(i-=t*v,a-=r*v),(g=Math.sqrt(i*i+a*a))&&(i/=g,a/=g,v/=g),t*a<r*i&&(t=-t,r=-r,v=-v,d=-d),{translateX:u,translateY:f,rotate:Math.atan2(r,t)*lh,skewX:Math.atan(v)*lh,scaleX:d,scaleY:g}}var ql;function Fx(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?Sf:Am(r.a,r.b,r.c,r.d,r.e,r.f)}function Bx(t){return t==null||(ql||(ql=document.createElementNS("http://www.w3.org/2000/svg","g")),ql.setAttribute("transform",t),!(t=ql.transform.baseVal.consolidate()))?Sf:(t=t.matrix,Am(t.a,t.b,t.c,t.d,t.e,t.f))}function $m(t,r,i,a){function u(w){return w.length?w.pop()+" ":""}function f(w,S,x,b,N,C){if(w!==x||S!==b){var A=N.push("translate(",null,r,null,i);C.push({i:A-4,x:Qr(w,x)},{i:A-2,x:Qr(S,b)})}else(x||b)&&N.push("translate("+x+r+b+i)}function d(w,S,x,b){w!==S?(w-S>180?S+=360:S-w>180&&(w+=360),b.push({i:x.push(u(x)+"rotate(",null,a)-2,x:Qr(w,S)})):S&&x.push(u(x)+"rotate("+S+a)}function g(w,S,x,b){w!==S?b.push({i:x.push(u(x)+"skewX(",null,a)-2,x:Qr(w,S)}):S&&x.push(u(x)+"skewX("+S+a)}function v(w,S,x,b,N,C){if(w!==x||S!==b){var A=N.push(u(N)+"scale(",null,",",null,")");C.push({i:A-4,x:Qr(w,x)},{i:A-2,x:Qr(S,b)})}else(x!==1||b!==1)&&N.push(u(N)+"scale("+x+","+b+")")}return function(w,S){var x=[],b=[];return w=t(w),S=t(S),f(w.translateX,w.translateY,S.translateX,S.translateY,x,b),d(w.rotate,S.rotate,x,b),g(w.skewX,S.skewX,x,b),v(w.scaleX,w.scaleY,S.scaleX,S.scaleY,x,b),w=S=null,function(N){for(var C=-1,A=b.length,T;++C<A;)x[(T=b[C]).i]=T.x(N);return x.join("")}}}var Hx=$m(Fx,"px, ","px)","deg)"),Vx=$m(Bx,", ",")",")"),Kx=1e-12;function uh(t){return((t=Math.exp(t))+1/t)/2}function Ux(t){return((t=Math.exp(t))-1/t)/2}function qx(t){return((t=Math.exp(2*t))-1)/(t+1)}const eu=(function t(r,i,a){function u(f,d){var g=f[0],v=f[1],w=f[2],S=d[0],x=d[1],b=d[2],N=S-g,C=x-v,A=N*N+C*C,T,$;if(A<Kx)$=Math.log(b/w)/r,T=function(U){return[g+U*N,v+U*C,w*Math.exp(r*U*$)]};else{var H=Math.sqrt(A),M=(b*b-w*w+a*A)/(2*w*i*H),R=(b*b-w*w-a*A)/(2*b*i*H),X=Math.log(Math.sqrt(M*M+1)-M),V=Math.log(Math.sqrt(R*R+1)-R);$=(V-X)/r,T=function(U){var le=U*$,he=uh(X),Se=w/(i*H)*(he*qx(r*le+X)-Ux(X));return[g+Se*N,v+Se*C,w*he/uh(r*le+X)]}}return T.duration=$*1e3*r/Math.SQRT2,T}return u.rho=function(f){var d=Math.max(.001,+f),g=d*d,v=g*g;return t(d,g,v)},u})(Math.SQRT2,2,4);var js=0,xa=0,ya=0,Om=1e3,cu,wa,fu=0,Di=0,bu=0,Na=typeof performance=="object"&&performance.now?performance:Date,Rm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Df(){return Di||(Rm(Wx),Di=Na.now()+bu)}function Wx(){Di=0}function du(){this._call=this._time=this._next=null}du.prototype=zm.prototype={constructor:du,restart:function(t,r,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?Df():+i)+(r==null?0:+r),!this._next&&wa!==this&&(wa?wa._next=this:cu=this,wa=this),this._call=t,this._time=i,bf()},stop:function(){this._call&&(this._call=null,this._time=1/0,bf())}};function zm(t,r,i){var a=new du;return a.restart(t,r,i),a}function Yx(){Df(),++js;for(var t=cu,r;t;)(r=Di-t._time)>=0&&t._call.call(void 0,r),t=t._next;--js}function ch(){Di=(fu=Na.now())+bu,js=xa=0;try{Yx()}finally{js=0,Qx(),Di=0}}function Xx(){var t=Na.now(),r=t-fu;r>Om&&(bu-=r,fu=t)}function Qx(){for(var t,r=cu,i,a=1/0;r;)r._call?(a>r._time&&(a=r._time),t=r,r=r._next):(i=r._next,r._next=null,r=t?t._next=i:cu=i);wa=t,bf(a)}function bf(t){if(!js){xa&&(xa=clearTimeout(xa));var r=t-Di;r>24?(t<1/0&&(xa=setTimeout(ch,t-Na.now()-bu)),ya&&(ya=clearInterval(ya))):(ya||(fu=Na.now(),ya=setInterval(Xx,Om)),js=1,Rm(ch))}}function fh(t,r,i){var a=new du;return r=r==null?0:+r,a.restart(u=>{a.stop(),t(u+r)},r,i),a}var Gx=_u("start","end","cancel","interrupt"),Zx=[],Dm=0,dh=1,kf=2,tu=3,ph=4,Ef=5,nu=6;function ku(t,r,i,a,u,f){var d=t.__transition;if(!d)t.__transition={};else if(i in d)return;Jx(t,i,{name:r,index:a,group:u,on:Gx,tween:Zx,time:f.time,delay:f.delay,duration:f.duration,ease:f.ease,timer:null,state:Dm})}function Lf(t,r){var i=Or(t,r);if(i.state>Dm)throw new Error("too late; already scheduled");return i}function eo(t,r){var i=Or(t,r);if(i.state>tu)throw new Error("too late; already running");return i}function Or(t,r){var i=t.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function Jx(t,r,i){var a=t.__transition,u;a[r]=i,i.timer=zm(f,0,i.time);function f(w){i.state=dh,i.timer.restart(d,i.delay,i.time),i.delay<=w&&d(w-i.delay)}function d(w){var S,x,b,N;if(i.state!==dh)return v();for(S in a)if(N=a[S],N.name===i.name){if(N.state===tu)return fh(d);N.state===ph?(N.state=nu,N.timer.stop(),N.on.call("interrupt",t,t.__data__,N.index,N.group),delete a[S]):+S<r&&(N.state=nu,N.timer.stop(),N.on.call("cancel",t,t.__data__,N.index,N.group),delete a[S])}if(fh(function(){i.state===tu&&(i.state=ph,i.timer.restart(g,i.delay,i.time),g(w))}),i.state=kf,i.on.call("start",t,t.__data__,i.index,i.group),i.state===kf){for(i.state=tu,u=new Array(b=i.tween.length),S=0,x=-1;S<b;++S)(N=i.tween[S].value.call(t,t.__data__,i.index,i.group))&&(u[++x]=N);u.length=x+1}}function g(w){for(var S=w<i.duration?i.ease.call(null,w/i.duration):(i.timer.restart(v),i.state=Ef,1),x=-1,b=u.length;++x<b;)u[x].call(t,S);i.state===Ef&&(i.on.call("end",t,t.__data__,i.index,i.group),v())}function v(){i.state=nu,i.timer.stop(),delete a[r];for(var w in a)return;delete t.__transition}}function ru(t,r){var i=t.__transition,a,u,f=!0,d;if(i){r=r==null?null:r+"";for(d in i){if((a=i[d]).name!==r){f=!1;continue}u=a.state>kf&&a.state<Ef,a.state=nu,a.timer.stop(),a.on.call(u?"interrupt":"cancel",t,t.__data__,a.index,a.group),delete i[d]}f&&delete t.__transition}}function ew(t){return this.each(function(){ru(this,t)})}function tw(t,r){var i,a;return function(){var u=eo(this,t),f=u.tween;if(f!==i){a=i=f;for(var d=0,g=a.length;d<g;++d)if(a[d].name===r){a=a.slice(),a.splice(d,1);break}}u.tween=a}}function nw(t,r,i){var a,u;if(typeof i!="function")throw new Error;return function(){var f=eo(this,t),d=f.tween;if(d!==a){u=(a=d).slice();for(var g={name:r,value:i},v=0,w=u.length;v<w;++v)if(u[v].name===r){u[v]=g;break}v===w&&u.push(g)}f.tween=u}}function rw(t,r){var i=this._id;if(t+="",arguments.length<2){for(var a=Or(this.node(),i).tween,u=0,f=a.length,d;u<f;++u)if((d=a[u]).name===t)return d.value;return null}return this.each((r==null?tw:nw)(i,t,r))}function Ff(t,r,i){var a=t._id;return t.each(function(){var u=eo(this,a);(u.value||(u.value={}))[r]=i.apply(this,arguments)}),function(u){return Or(u,a).value[r]}}function Lm(t,r){var i;return(typeof r=="number"?Qr:r instanceof zi?uu:(i=zi(r))?(r=i,uu):Im)(t,r)}function ow(t){return function(){this.removeAttribute(t)}}function iw(t){return function(){this.removeAttributeNS(t.space,t.local)}}function sw(t,r,i){var a,u=i+"",f;return function(){var d=this.getAttribute(t);return d===u?null:d===a?f:f=r(a=d,i)}}function aw(t,r,i){var a,u=i+"",f;return function(){var d=this.getAttributeNS(t.space,t.local);return d===u?null:d===a?f:f=r(a=d,i)}}function lw(t,r,i){var a,u,f;return function(){var d,g=i(this),v;return g==null?void this.removeAttribute(t):(d=this.getAttribute(t),v=g+"",d===v?null:d===a&&v===u?f:(u=v,f=r(a=d,g)))}}function uw(t,r,i){var a,u,f;return function(){var d,g=i(this),v;return g==null?void this.removeAttributeNS(t.space,t.local):(d=this.getAttributeNS(t.space,t.local),v=g+"",d===v?null:d===a&&v===u?f:(u=v,f=r(a=d,g)))}}function cw(t,r){var i=Su(t),a=i==="transform"?Vx:Lm;return this.attrTween(t,typeof r=="function"?(i.local?uw:lw)(i,a,Ff(this,"attr."+t,r)):r==null?(i.local?iw:ow)(i):(i.local?aw:sw)(i,a,r))}function fw(t,r){return function(i){this.setAttribute(t,r.call(this,i))}}function dw(t,r){return function(i){this.setAttributeNS(t.space,t.local,r.call(this,i))}}function pw(t,r){var i,a;function u(){var f=r.apply(this,arguments);return f!==a&&(i=(a=f)&&dw(t,f)),i}return u._value=r,u}function hw(t,r){var i,a;function u(){var f=r.apply(this,arguments);return f!==a&&(i=(a=f)&&fw(t,f)),i}return u._value=r,u}function mw(t,r){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(r==null)return this.tween(i,null);if(typeof r!="function")throw new Error;var a=Su(t);return this.tween(i,(a.local?pw:hw)(a,r))}function gw(t,r){return function(){Lf(this,t).delay=+r.apply(this,arguments)}}function yw(t,r){return r=+r,function(){Lf(this,t).delay=r}}function vw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?gw:yw)(r,t)):Or(this.node(),r).delay}function xw(t,r){return function(){eo(this,t).duration=+r.apply(this,arguments)}}function ww(t,r){return r=+r,function(){eo(this,t).duration=r}}function _w(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?xw:ww)(r,t)):Or(this.node(),r).duration}function Sw(t,r){if(typeof r!="function")throw new Error;return function(){eo(this,t).ease=r}}function bw(t){var r=this._id;return arguments.length?this.each(Sw(r,t)):Or(this.node(),r).ease}function kw(t,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;eo(this,t).ease=i}}function Ew(t){if(typeof t!="function")throw new Error;return this.each(kw(this._id,t))}function Nw(t){typeof t!="function"&&(t=gm(t));for(var r=this._groups,i=r.length,a=new Array(i),u=0;u<i;++u)for(var f=r[u],d=f.length,g=a[u]=[],v,w=0;w<d;++w)(v=f[w])&&t.call(v,v.__data__,w,f)&&g.push(v);return new jo(a,this._parents,this._name,this._id)}function Cw(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,i=t._groups,a=r.length,u=i.length,f=Math.min(a,u),d=new Array(a),g=0;g<f;++g)for(var v=r[g],w=i[g],S=v.length,x=d[g]=new Array(S),b,N=0;N<S;++N)(b=v[N]||w[N])&&(x[N]=b);for(;g<a;++g)d[g]=r[g];return new jo(d,this._parents,this._name,this._id)}function Pw(t){return(t+"").trim().split(/^|\s+/).every(function(r){var i=r.indexOf(".");return i>=0&&(r=r.slice(0,i)),!r||r==="start"})}function jw(t,r,i){var a,u,f=Pw(r)?Lf:eo;return function(){var d=f(this,t),g=d.on;g!==a&&(u=(a=g).copy()).on(r,i),d.on=u}}function Mw(t,r){var i=this._id;return arguments.length<2?Or(this.node(),i).on.on(t):this.each(jw(i,t,r))}function Tw(t){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==t)return;r&&r.removeChild(this)}}function Iw(){return this.on("end.remove",Tw(this._id))}function Aw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=$f(t));for(var a=this._groups,u=a.length,f=new Array(u),d=0;d<u;++d)for(var g=a[d],v=g.length,w=f[d]=new Array(v),S,x,b=0;b<v;++b)(S=g[b])&&(x=t.call(S,S.__data__,b,g))&&("__data__"in S&&(x.__data__=S.__data__),w[b]=x,ku(w[b],r,i,b,w,Or(S,i)));return new jo(f,this._parents,r,i)}function $w(t){var r=this._name,i=this._id;typeof t!="function"&&(t=mm(t));for(var a=this._groups,u=a.length,f=[],d=[],g=0;g<u;++g)for(var v=a[g],w=v.length,S,x=0;x<w;++x)if(S=v[x]){for(var b=t.call(S,S.__data__,x,v),N,C=Or(S,i),A=0,T=b.length;A<T;++A)(N=b[A])&&ku(N,r,i,A,b,C);f.push(b),d.push(S)}return new jo(f,d,r,i)}var Ow=Aa.prototype.constructor;function Rw(){return new Ow(this._groups,this._parents)}function zw(t,r){var i,a,u;return function(){var f=Ps(this,t),d=(this.style.removeProperty(t),Ps(this,t));return f===d?null:f===i&&d===a?u:u=r(i=f,a=d)}}function Fm(t){return function(){this.style.removeProperty(t)}}function Dw(t,r,i){var a,u=i+"",f;return function(){var d=Ps(this,t);return d===u?null:d===a?f:f=r(a=d,i)}}function Lw(t,r,i){var a,u,f;return function(){var d=Ps(this,t),g=i(this),v=g+"";return g==null&&(v=g=(this.style.removeProperty(t),Ps(this,t))),d===v?null:d===a&&v===u?f:(u=v,f=r(a=d,g))}}function Fw(t,r){var i,a,u,f="style."+r,d="end."+f,g;return function(){var v=eo(this,t),w=v.on,S=v.value[f]==null?g||(g=Fm(r)):void 0;(w!==i||u!==S)&&(a=(i=w).copy()).on(d,u=S),v.on=a}}function Bw(t,r,i){var a=(t+="")=="transform"?Hx:Lm;return r==null?this.styleTween(t,zw(t,a)).on("end.style."+t,Fm(t)):typeof r=="function"?this.styleTween(t,Lw(t,a,Ff(this,"style."+t,r))).each(Fw(this._id,t)):this.styleTween(t,Dw(t,a,r),i).on("end.style."+t,null)}function Hw(t,r,i){return function(a){this.style.setProperty(t,r.call(this,a),i)}}function Vw(t,r,i){var a,u;function f(){var d=r.apply(this,arguments);return d!==u&&(a=(u=d)&&Hw(t,d,i)),a}return f._value=r,f}function Kw(t,r,i){var a="style."+(t+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(r==null)return this.tween(a,null);if(typeof r!="function")throw new Error;return this.tween(a,Vw(t,r,i??""))}function Uw(t){return function(){this.textContent=t}}function qw(t){return function(){var r=t(this);this.textContent=r??""}}function Ww(t){return this.tween("text",typeof t=="function"?qw(Ff(this,"text",t)):Uw(t==null?"":t+""))}function Yw(t){return function(r){this.textContent=t.call(this,r)}}function Xw(t){var r,i;function a(){var u=t.apply(this,arguments);return u!==i&&(r=(i=u)&&Yw(u)),r}return a._value=t,a}function Qw(t){var r="text";if(arguments.length<1)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,Xw(t))}function Gw(){for(var t=this._name,r=this._id,i=Bm(),a=this._groups,u=a.length,f=0;f<u;++f)for(var d=a[f],g=d.length,v,w=0;w<g;++w)if(v=d[w]){var S=Or(v,r);ku(v,t,i,w,d,{time:S.time+S.delay+S.duration,delay:0,duration:S.duration,ease:S.ease})}return new jo(a,this._parents,t,i)}function Zw(){var t,r,i=this,a=i._id,u=i.size();return new Promise(function(f,d){var g={value:d},v={value:function(){--u===0&&f()}};i.each(function(){var w=eo(this,a),S=w.on;S!==t&&(r=(t=S).copy(),r._.cancel.push(g),r._.interrupt.push(g),r._.end.push(v)),w.on=r}),u===0&&f()})}var Jw=0;function jo(t,r,i,a){this._groups=t,this._parents=r,this._name=i,this._id=a}function Bm(){return++Jw}var No=Aa.prototype;jo.prototype={constructor:jo,select:Aw,selectAll:$w,selectChild:No.selectChild,selectChildren:No.selectChildren,filter:Nw,merge:Cw,selection:Rw,transition:Gw,call:No.call,nodes:No.nodes,node:No.node,size:No.size,empty:No.empty,each:No.each,on:Mw,attr:cw,attrTween:mw,style:Bw,styleTween:Kw,text:Ww,textTween:Qw,remove:Iw,tween:rw,delay:vw,duration:_w,ease:bw,easeVarying:Ew,end:Zw,[Symbol.iterator]:No[Symbol.iterator]};function e1(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var t1={time:null,delay:0,duration:250,ease:e1};function n1(t,r){for(var i;!(i=t.__transition)||!(i=i[r]);)if(!(t=t.parentNode))throw new Error(`transition ${r} not found`);return i}function r1(t){var r,i;t instanceof jo?(r=t._id,t=t._name):(r=Bm(),(i=t1).time=Df(),t=t==null?null:t+"");for(var a=this._groups,u=a.length,f=0;f<u;++f)for(var d=a[f],g=d.length,v,w=0;w<g;++w)(v=d[w])&&ku(v,t,r,w,d,i||n1(v,r));return new jo(a,this._parents,t,r)}Aa.prototype.interrupt=ew;Aa.prototype.transition=r1;const Wl=t=>()=>t;function o1(t,{sourceEvent:r,target:i,transform:a,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:u}})}function Co(t,r,i){this.k=t,this.x=r,this.y=i}Co.prototype={constructor:Co,scale:function(t){return t===1?this:new Co(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new Co(this.k,this.x+this.k*t,this.y+this.k*r)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Eu=new Co(1,0,0);Hm.prototype=Co.prototype;function Hm(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Eu;return t.__zoom}function nf(t){t.stopImmediatePropagation()}function va(t){t.preventDefault(),t.stopImmediatePropagation()}function i1(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function s1(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function hh(){return this.__zoom||Eu}function a1(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function l1(){return navigator.maxTouchPoints||"ontouchstart"in this}function u1(t,r,i){var a=t.invertX(r[0][0])-i[0][0],u=t.invertX(r[1][0])-i[1][0],f=t.invertY(r[0][1])-i[0][1],d=t.invertY(r[1][1])-i[1][1];return t.translate(u>a?(a+u)/2:Math.min(0,a)||Math.max(0,u),d>f?(f+d)/2:Math.min(0,f)||Math.max(0,d))}function Vm(){var t=i1,r=s1,i=u1,a=a1,u=l1,f=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],g=250,v=eu,w=_u("start","zoom","end"),S,x,b,N=500,C=150,A=0,T=10;function $(D){D.property("__zoom",hh).on("wheel.zoom",le,{passive:!1}).on("mousedown.zoom",he).on("dblclick.zoom",Se).filter(u).on("touchstart.zoom",W).on("touchmove.zoom",ue).on("touchend.zoom touchcancel.zoom",xe).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}$.transform=function(D,ce,te,ae){var L=D.selection?D.selection():D;L.property("__zoom",hh),D!==L?X(D,ce,te,ae):L.interrupt().each(function(){V(this,arguments).event(ae).start().zoom(null,typeof ce=="function"?ce.apply(this,arguments):ce).end()})},$.scaleBy=function(D,ce,te,ae){$.scaleTo(D,function(){var L=this.__zoom.k,F=typeof ce=="function"?ce.apply(this,arguments):ce;return L*F},te,ae)},$.scaleTo=function(D,ce,te,ae){$.transform(D,function(){var L=r.apply(this,arguments),F=this.__zoom,Q=te==null?R(L):typeof te=="function"?te.apply(this,arguments):te,O=F.invert(Q),B=typeof ce=="function"?ce.apply(this,arguments):ce;return i(M(H(F,B),Q,O),L,d)},te,ae)},$.translateBy=function(D,ce,te,ae){$.transform(D,function(){return i(this.__zoom.translate(typeof ce=="function"?ce.apply(this,arguments):ce,typeof te=="function"?te.apply(this,arguments):te),r.apply(this,arguments),d)},null,ae)},$.translateTo=function(D,ce,te,ae,L){$.transform(D,function(){var F=r.apply(this,arguments),Q=this.__zoom,O=ae==null?R(F):typeof ae=="function"?ae.apply(this,arguments):ae;return i(Eu.translate(O[0],O[1]).scale(Q.k).translate(typeof ce=="function"?-ce.apply(this,arguments):-ce,typeof te=="function"?-te.apply(this,arguments):-te),F,d)},ae,L)};function H(D,ce){return ce=Math.max(f[0],Math.min(f[1],ce)),ce===D.k?D:new Co(ce,D.x,D.y)}function M(D,ce,te){var ae=ce[0]-te[0]*D.k,L=ce[1]-te[1]*D.k;return ae===D.x&&L===D.y?D:new Co(D.k,ae,L)}function R(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function X(D,ce,te,ae){D.on("start.zoom",function(){V(this,arguments).event(ae).start()}).on("interrupt.zoom end.zoom",function(){V(this,arguments).event(ae).end()}).tween("zoom",function(){var L=this,F=arguments,Q=V(L,F).event(ae),O=r.apply(L,F),B=te==null?R(O):typeof te=="function"?te.apply(L,F):te,be=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),_e=L.__zoom,$e=typeof ce=="function"?ce.apply(L,F):ce,Ie=v(_e.invert(B).concat(be/_e.k),$e.invert(B).concat(be/$e.k));return function(ze){if(ze===1)ze=$e;else{var we=Ie(ze),Le=be/we[2];ze=new Co(Le,B[0]-we[0]*Le,B[1]-we[1]*Le)}Q.zoom(null,ze)}})}function V(D,ce,te){return!te&&D.__zooming||new U(D,ce)}function U(D,ce){this.that=D,this.args=ce,this.active=0,this.sourceEvent=null,this.extent=r.apply(D,ce),this.taps=0}U.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,ce){return this.mouse&&D!=="mouse"&&(this.mouse[1]=ce.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=ce.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=ce.invert(this.touch1[0])),this.that.__zoom=ce,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var ce=Gn(this.that).datum();w.call(D,this.that,new o1(D,{sourceEvent:this.sourceEvent,target:$,transform:this.that.__zoom,dispatch:w}),ce)}};function le(D,...ce){if(!t.apply(this,arguments))return;var te=V(this,ce).event(D),ae=this.__zoom,L=Math.max(f[0],Math.min(f[1],ae.k*Math.pow(2,a.apply(this,arguments)))),F=Tr(D);if(te.wheel)(te.mouse[0][0]!==F[0]||te.mouse[0][1]!==F[1])&&(te.mouse[1]=ae.invert(te.mouse[0]=F)),clearTimeout(te.wheel);else{if(ae.k===L)return;te.mouse=[F,ae.invert(F)],ru(this),te.start()}va(D),te.wheel=setTimeout(Q,C),te.zoom("mouse",i(M(H(ae,L),te.mouse[0],te.mouse[1]),te.extent,d));function Q(){te.wheel=null,te.end()}}function he(D,...ce){if(b||!t.apply(this,arguments))return;var te=D.currentTarget,ae=V(this,ce,!0).event(D),L=Gn(D.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",be,!0),F=Tr(D,te),Q=D.clientX,O=D.clientY;Nm(D.view),nf(D),ae.mouse=[F,this.__zoom.invert(F)],ru(this),ae.start();function B(_e){if(va(_e),!ae.moved){var $e=_e.clientX-Q,Ie=_e.clientY-O;ae.moved=$e*$e+Ie*Ie>A}ae.event(_e).zoom("mouse",i(M(ae.that.__zoom,ae.mouse[0]=Tr(_e,te),ae.mouse[1]),ae.extent,d))}function be(_e){L.on("mousemove.zoom mouseup.zoom",null),Cm(_e.view,ae.moved),va(_e),ae.event(_e).end()}}function Se(D,...ce){if(t.apply(this,arguments)){var te=this.__zoom,ae=Tr(D.changedTouches?D.changedTouches[0]:D,this),L=te.invert(ae),F=te.k*(D.shiftKey?.5:2),Q=i(M(H(te,F),ae,L),r.apply(this,ce),d);va(D),g>0?Gn(this).transition().duration(g).call(X,Q,ae,D):Gn(this).call($.transform,Q,ae,D)}}function W(D,...ce){if(t.apply(this,arguments)){var te=D.touches,ae=te.length,L=V(this,ce,D.changedTouches.length===ae).event(D),F,Q,O,B;for(nf(D),Q=0;Q<ae;++Q)O=te[Q],B=Tr(O,this),B=[B,this.__zoom.invert(B),O.identifier],L.touch0?!L.touch1&&L.touch0[2]!==B[2]&&(L.touch1=B,L.taps=0):(L.touch0=B,F=!0,L.taps=1+!!S);S&&(S=clearTimeout(S)),F&&(L.taps<2&&(x=B[0],S=setTimeout(function(){S=null},N)),ru(this),L.start())}}function ue(D,...ce){if(this.__zooming){var te=V(this,ce).event(D),ae=D.changedTouches,L=ae.length,F,Q,O,B;for(va(D),F=0;F<L;++F)Q=ae[F],O=Tr(Q,this),te.touch0&&te.touch0[2]===Q.identifier?te.touch0[0]=O:te.touch1&&te.touch1[2]===Q.identifier&&(te.touch1[0]=O);if(Q=te.that.__zoom,te.touch1){var be=te.touch0[0],_e=te.touch0[1],$e=te.touch1[0],Ie=te.touch1[1],ze=(ze=$e[0]-be[0])*ze+(ze=$e[1]-be[1])*ze,we=(we=Ie[0]-_e[0])*we+(we=Ie[1]-_e[1])*we;Q=H(Q,Math.sqrt(ze/we)),O=[(be[0]+$e[0])/2,(be[1]+$e[1])/2],B=[(_e[0]+Ie[0])/2,(_e[1]+Ie[1])/2]}else if(te.touch0)O=te.touch0[0],B=te.touch0[1];else return;te.zoom("touch",i(M(Q,O,B),te.extent,d))}}function xe(D,...ce){if(this.__zooming){var te=V(this,ce).event(D),ae=D.changedTouches,L=ae.length,F,Q;for(nf(D),b&&clearTimeout(b),b=setTimeout(function(){b=null},N),F=0;F<L;++F)Q=ae[F],te.touch0&&te.touch0[2]===Q.identifier?delete te.touch0:te.touch1&&te.touch1[2]===Q.identifier&&delete te.touch1;if(te.touch1&&!te.touch0&&(te.touch0=te.touch1,delete te.touch1),te.touch0)te.touch0[1]=this.__zoom.invert(te.touch0[0]);else if(te.end(),te.taps===2&&(Q=Tr(Q,this),Math.hypot(x[0]-Q[0],x[1]-Q[1])<T)){var O=Gn(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return $.wheelDelta=function(D){return arguments.length?(a=typeof D=="function"?D:Wl(+D),$):a},$.filter=function(D){return arguments.length?(t=typeof D=="function"?D:Wl(!!D),$):t},$.touchable=function(D){return arguments.length?(u=typeof D=="function"?D:Wl(!!D),$):u},$.extent=function(D){return arguments.length?(r=typeof D=="function"?D:Wl([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),$):r},$.scaleExtent=function(D){return arguments.length?(f[0]=+D[0],f[1]=+D[1],$):[f[0],f[1]]},$.translateExtent=function(D){return arguments.length?(d[0][0]=+D[0][0],d[1][0]=+D[1][0],d[0][1]=+D[0][1],d[1][1]=+D[1][1],$):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},$.constrain=function(D){return arguments.length?(i=D,$):i},$.duration=function(D){return arguments.length?(g=+D,$):g},$.interpolate=function(D){return arguments.length?(v=D,$):v},$.on=function(){var D=w.on.apply(w,arguments);return D===w?$:D},$.clickDistance=function(D){return arguments.length?(A=(D=+D)*D,$):Math.sqrt(A)},$.tapDistance=function(D){return arguments.length?(T=+D,$):T},$}const Zr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:r,sourceHandle:i,targetHandle:a})=>`Couldn't create edge for ${t} handle id: "${t==="source"?i:a}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/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."},Ca=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Km=["Enter"," ","Escape"],Um={"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:t,x:r,y:i})=>`Moved selected node ${t}. New position, x: ${r}, y: ${i}`,"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 Ms;(function(t){t.Strict="strict",t.Loose="loose"})(Ms||(Ms={}));var Ri;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Ri||(Ri={}));var Pa;(function(t){t.Partial="partial",t.Full="full"})(Pa||(Pa={}));const qm={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var si;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(si||(si={}));var pu;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(pu||(pu={}));var Ge;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Ge||(Ge={}));const mh={[Ge.Left]:Ge.Right,[Ge.Right]:Ge.Left,[Ge.Top]:Ge.Bottom,[Ge.Bottom]:Ge.Top};function Wm(t){return t===null?null:t?"valid":"invalid"}const Ym=t=>"id"in t&&"source"in t&&"target"in t,c1=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Bf=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Oa=(t,r=[0,0])=>{const{width:i,height:a}=Mo(t),u=t.origin??r,f=i*u[0],d=a*u[1];return{x:t.position.x-f,y:t.position.y-d}},f1=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const i=t.reduce((a,u)=>{const f=typeof u=="string";let d=!r.nodeLookup&&!f?u:void 0;r.nodeLookup&&(d=f?r.nodeLookup.get(u):Bf(u)?u:r.nodeLookup.get(u.id));const g=d?hu(d,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Nu(a,g)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Cu(i)},Ra=(t,r={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return t.forEach(u=>{(r.filter===void 0||r.filter(u))&&(i=Nu(i,hu(u)),a=!0)}),a?Cu(i):{x:0,y:0,width:0,height:0}},Hf=(t,r,[i,a,u]=[0,0,1],f=!1,d=!1)=>{const g={...Da(r,[i,a,u]),width:r.width/u,height:r.height/u},v=[];for(const w of t.values()){const{measured:S,selectable:x=!0,hidden:b=!1}=w;if(d&&!x||b)continue;const N=S.width??w.width??w.initialWidth??null,C=S.height??w.height??w.initialHeight??null,A=ja(g,Is(w)),T=(N??0)*(C??0),$=f&&A>0;(!w.internals.handleBounds||$||A>=T||w.dragging)&&v.push(w)}return v},d1=(t,r)=>{const i=new Set;return t.forEach(a=>{i.add(a.id)}),r.filter(a=>i.has(a.source)||i.has(a.target))};function p1(t,r){const i=new Map,a=r!=null&&r.nodes?new Set(r.nodes.map(u=>u.id)):null;return t.forEach(u=>{u.measured.width&&u.measured.height&&((r==null?void 0:r.includeHiddenNodes)||!u.hidden)&&(!a||a.has(u.id))&&i.set(u.id,u)}),i}async function h1({nodes:t,width:r,height:i,panZoom:a,minZoom:u,maxZoom:f},d){if(t.size===0)return Promise.resolve(!0);const g=p1(t,d),v=Ra(g),w=Vf(v,r,i,(d==null?void 0:d.minZoom)??u,(d==null?void 0:d.maxZoom)??f,(d==null?void 0:d.padding)??.1);return await a.setViewport(w,{duration:d==null?void 0:d.duration,ease:d==null?void 0:d.ease,interpolate:d==null?void 0:d.interpolate}),Promise.resolve(!0)}function Xm({nodeId:t,nextPosition:r,nodeLookup:i,nodeOrigin:a=[0,0],nodeExtent:u,onError:f}){const d=i.get(t),g=d.parentId?i.get(d.parentId):void 0,{x:v,y:w}=g?g.internals.positionAbsolute:{x:0,y:0},S=d.origin??a;let x=d.extent||u;if(d.extent==="parent"&&!d.expandParent)if(!g)f==null||f("005",Zr.error005());else{const N=g.measured.width,C=g.measured.height;N&&C&&(x=[[v,w],[v+N,w+C]])}else g&&As(d.extent)&&(x=[[d.extent[0][0]+v,d.extent[0][1]+w],[d.extent[1][0]+v,d.extent[1][1]+w]]);const b=As(x)?Li(r,x,d.measured):r;return(d.measured.width===void 0||d.measured.height===void 0)&&(f==null||f("015",Zr.error015())),{position:{x:b.x-v+(d.measured.width??0)*S[0],y:b.y-w+(d.measured.height??0)*S[1]},positionAbsolute:b}}async function m1({nodesToRemove:t=[],edgesToRemove:r=[],nodes:i,edges:a,onBeforeDelete:u}){const f=new Set(t.map(b=>b.id)),d=[];for(const b of i){if(b.deletable===!1)continue;const N=f.has(b.id),C=!N&&b.parentId&&d.find(A=>A.id===b.parentId);(N||C)&&d.push(b)}const g=new Set(r.map(b=>b.id)),v=a.filter(b=>b.deletable!==!1),S=d1(d,v);for(const b of v)g.has(b.id)&&!S.find(C=>C.id===b.id)&&S.push(b);if(!u)return{edges:S,nodes:d};const x=await u({nodes:d,edges:S});return typeof x=="boolean"?x?{edges:S,nodes:d}:{edges:[],nodes:[]}:x}const Ts=(t,r=0,i=1)=>Math.min(Math.max(t,r),i),Li=(t={x:0,y:0},r,i)=>({x:Ts(t.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:Ts(t.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function Qm(t,r,i){const{width:a,height:u}=Mo(i),{x:f,y:d}=i.internals.positionAbsolute;return Li(t,[[f,d],[f+a,d+u]],r)}const gh=(t,r,i)=>t<r?Ts(Math.abs(t-r),1,r)/r:t>i?-Ts(Math.abs(t-i),1,r)/r:0,Gm=(t,r,i=15,a=40)=>{const u=gh(t.x,a,r.width-a)*i,f=gh(t.y,a,r.height-a)*i;return[u,f]},Nu=(t,r)=>({x:Math.min(t.x,r.x),y:Math.min(t.y,r.y),x2:Math.max(t.x2,r.x2),y2:Math.max(t.y2,r.y2)}),Nf=({x:t,y:r,width:i,height:a})=>({x:t,y:r,x2:t+i,y2:r+a}),Cu=({x:t,y:r,x2:i,y2:a})=>({x:t,y:r,width:i-t,height:a-r}),Is=(t,r=[0,0])=>{var u,f;const{x:i,y:a}=Bf(t)?t.internals.positionAbsolute:Oa(t,r);return{x:i,y:a,width:((u=t.measured)==null?void 0:u.width)??t.width??t.initialWidth??0,height:((f=t.measured)==null?void 0:f.height)??t.height??t.initialHeight??0}},hu=(t,r=[0,0])=>{var u,f;const{x:i,y:a}=Bf(t)?t.internals.positionAbsolute:Oa(t,r);return{x:i,y:a,x2:i+(((u=t.measured)==null?void 0:u.width)??t.width??t.initialWidth??0),y2:a+(((f=t.measured)==null?void 0:f.height)??t.height??t.initialHeight??0)}},Zm=(t,r)=>Cu(Nu(Nf(t),Nf(r))),ja=(t,r)=>{const i=Math.max(0,Math.min(t.x+t.width,r.x+r.width)-Math.max(t.x,r.x)),a=Math.max(0,Math.min(t.y+t.height,r.y+r.height)-Math.max(t.y,r.y));return Math.ceil(i*a)},yh=t=>Ar(t.width)&&Ar(t.height)&&Ar(t.x)&&Ar(t.y),Ar=t=>!isNaN(t)&&isFinite(t),g1=(t,r)=>{},za=(t,r=[1,1])=>({x:r[0]*Math.round(t.x/r[0]),y:r[1]*Math.round(t.y/r[1])}),Da=({x:t,y:r},[i,a,u],f=!1,d=[1,1])=>{const g={x:(t-i)/u,y:(r-a)/u};return f?za(g,d):g},mu=({x:t,y:r},[i,a,u])=>({x:t*u+i,y:r*u+a});function bs(t,r){if(typeof t=="number")return Math.floor((r-r/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(i)}if(typeof t=="string"&&t.endsWith("%")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(r*i*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function y1(t,r,i){if(typeof t=="string"||typeof t=="number"){const a=bs(t,i),u=bs(t,r);return{top:a,right:u,bottom:a,left:u,x:u*2,y:a*2}}if(typeof t=="object"){const a=bs(t.top??t.y??0,i),u=bs(t.bottom??t.y??0,i),f=bs(t.left??t.x??0,r),d=bs(t.right??t.x??0,r);return{top:a,right:d,bottom:u,left:f,x:f+d,y:a+u}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function v1(t,r,i,a,u,f){const{x:d,y:g}=mu(t,[r,i,a]),{x:v,y:w}=mu({x:t.x+t.width,y:t.y+t.height},[r,i,a]),S=u-v,x=f-w;return{left:Math.floor(d),top:Math.floor(g),right:Math.floor(S),bottom:Math.floor(x)}}const Vf=(t,r,i,a,u,f)=>{const d=y1(f,r,i),g=(r-d.x)/t.width,v=(i-d.y)/t.height,w=Math.min(g,v),S=Ts(w,a,u),x=t.x+t.width/2,b=t.y+t.height/2,N=r/2-x*S,C=i/2-b*S,A=v1(t,N,C,S,r,i),T={left:Math.min(A.left-d.left,0),top:Math.min(A.top-d.top,0),right:Math.min(A.right-d.right,0),bottom:Math.min(A.bottom-d.bottom,0)};return{x:N-T.left+T.right,y:C-T.top+T.bottom,zoom:S}},Ma=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function As(t){return t!=null&&t!=="parent"}function Mo(t){var r,i;return{width:((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0,height:((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight??0}}function Jm(t){var r,i;return(((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth)!==void 0&&(((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight)!==void 0}function eg(t,r={width:0,height:0},i,a,u){const f={...t},d=a.get(i);if(d){const g=d.origin||u;f.x+=d.internals.positionAbsolute.x-(r.width??0)*g[0],f.y+=d.internals.positionAbsolute.y-(r.height??0)*g[1]}return f}function vh(t,r){if(t.size!==r.size)return!1;for(const i of t)if(!r.has(i))return!1;return!0}function x1(){let t,r;return{promise:new Promise((a,u)=>{t=a,r=u}),resolve:t,reject:r}}function w1(t){return{...Um,...t||{}}}function Sa(t,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:a,containerBounds:u}){const{x:f,y:d}=$r(t),g=Da({x:f-((u==null?void 0:u.left)??0),y:d-((u==null?void 0:u.top)??0)},a),{x:v,y:w}=i?za(g,r):g;return{xSnapped:v,ySnapped:w,...g}}const Kf=t=>({width:t.offsetWidth,height:t.offsetHeight}),tg=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},_1=["INPUT","SELECT","TEXTAREA"];function ng(t){var a,u;const r=((u=(a=t.composedPath)==null?void 0:a.call(t))==null?void 0:u[0])||t.target;return(r==null?void 0:r.nodeType)!==1?!1:_1.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const rg=t=>"clientX"in t,$r=(t,r)=>{var f,d;const i=rg(t),a=i?t.clientX:(f=t.touches)==null?void 0:f[0].clientX,u=i?t.clientY:(d=t.touches)==null?void 0:d[0].clientY;return{x:a-((r==null?void 0:r.left)??0),y:u-((r==null?void 0:r.top)??0)}},xh=(t,r,i,a,u)=>{const f=r.querySelectorAll(`.${t}`);return!f||!f.length?null:Array.from(f).map(d=>{const g=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:t,nodeId:u,position:d.getAttribute("data-handlepos"),x:(g.left-i.left)/a,y:(g.top-i.top)/a,...Kf(d)}})};function og({sourceX:t,sourceY:r,targetX:i,targetY:a,sourceControlX:u,sourceControlY:f,targetControlX:d,targetControlY:g}){const v=t*.125+u*.375+d*.375+i*.125,w=r*.125+f*.375+g*.375+a*.125,S=Math.abs(v-t),x=Math.abs(w-r);return[v,w,S,x]}function Yl(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function wh({pos:t,x1:r,y1:i,x2:a,y2:u,c:f}){switch(t){case Ge.Left:return[r-Yl(r-a,f),i];case Ge.Right:return[r+Yl(a-r,f),i];case Ge.Top:return[r,i-Yl(i-u,f)];case Ge.Bottom:return[r,i+Yl(u-i,f)]}}function ig({sourceX:t,sourceY:r,sourcePosition:i=Ge.Bottom,targetX:a,targetY:u,targetPosition:f=Ge.Top,curvature:d=.25}){const[g,v]=wh({pos:i,x1:t,y1:r,x2:a,y2:u,c:d}),[w,S]=wh({pos:f,x1:a,y1:u,x2:t,y2:r,c:d}),[x,b,N,C]=og({sourceX:t,sourceY:r,targetX:a,targetY:u,sourceControlX:g,sourceControlY:v,targetControlX:w,targetControlY:S});return[`M${t},${r} C${g},${v} ${w},${S} ${a},${u}`,x,b,N,C]}function sg({sourceX:t,sourceY:r,targetX:i,targetY:a}){const u=Math.abs(i-t)/2,f=i<t?i+u:i-u,d=Math.abs(a-r)/2,g=a<r?a+d:a-d;return[f,g,u,d]}function S1({sourceNode:t,targetNode:r,selected:i=!1,zIndex:a=0,elevateOnSelect:u=!1,zIndexMode:f="basic"}){if(f==="manual")return a;const d=u&&i?a+1e3:a,g=Math.max(t.parentId||u&&t.selected?t.internals.z:0,r.parentId||u&&r.selected?r.internals.z:0);return d+g}function b1({sourceNode:t,targetNode:r,width:i,height:a,transform:u}){const f=Nu(hu(t),hu(r));f.x===f.x2&&(f.x2+=1),f.y===f.y2&&(f.y2+=1);const d={x:-u[0]/u[2],y:-u[1]/u[2],width:i/u[2],height:a/u[2]};return ja(d,Cu(f))>0}const k1=({source:t,sourceHandle:r,target:i,targetHandle:a})=>`xy-edge__${t}${r||""}-${i}${a||""}`,E1=(t,r)=>r.some(i=>i.source===t.source&&i.target===t.target&&(i.sourceHandle===t.sourceHandle||!i.sourceHandle&&!t.sourceHandle)&&(i.targetHandle===t.targetHandle||!i.targetHandle&&!t.targetHandle)),ag=(t,r,i={})=>{if(!t.source||!t.target)return r;const a=i.getEdgeId||k1;let u;return Ym(t)?u={...t}:u={...t,id:a(t)},E1(u,r)?r:(u.sourceHandle===null&&delete u.sourceHandle,u.targetHandle===null&&delete u.targetHandle,r.concat(u))};function lg({sourceX:t,sourceY:r,targetX:i,targetY:a}){const[u,f,d,g]=sg({sourceX:t,sourceY:r,targetX:i,targetY:a});return[`M ${t},${r}L ${i},${a}`,u,f,d,g]}const _h={[Ge.Left]:{x:-1,y:0},[Ge.Right]:{x:1,y:0},[Ge.Top]:{x:0,y:-1},[Ge.Bottom]:{x:0,y:1}},N1=({source:t,sourcePosition:r=Ge.Bottom,target:i})=>r===Ge.Left||r===Ge.Right?t.x<i.x?{x:1,y:0}:{x:-1,y:0}:t.y<i.y?{x:0,y:1}:{x:0,y:-1},Sh=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function C1({source:t,sourcePosition:r=Ge.Bottom,target:i,targetPosition:a=Ge.Top,center:u,offset:f,stepPosition:d}){const g=_h[r],v=_h[a],w={x:t.x+g.x*f,y:t.y+g.y*f},S={x:i.x+v.x*f,y:i.y+v.y*f},x=N1({source:w,sourcePosition:r,target:S}),b=x.x!==0?"x":"y",N=x[b];let C=[],A,T;const $={x:0,y:0},H={x:0,y:0},[,,M,R]=sg({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(g[b]*v[b]===-1){b==="x"?(A=u.x??w.x+(S.x-w.x)*d,T=u.y??(w.y+S.y)/2):(A=u.x??(w.x+S.x)/2,T=u.y??w.y+(S.y-w.y)*d);const le=[{x:A,y:w.y},{x:A,y:S.y}],he=[{x:w.x,y:T},{x:S.x,y:T}];g[b]===N?C=b==="x"?le:he:C=b==="x"?he:le}else{const le=[{x:w.x,y:S.y}],he=[{x:S.x,y:w.y}];if(b==="x"?C=g.x===N?he:le:C=g.y===N?le:he,r===a){const D=Math.abs(t[b]-i[b]);if(D<=f){const ce=Math.min(f-1,f-D);g[b]===N?$[b]=(w[b]>t[b]?-1:1)*ce:H[b]=(S[b]>i[b]?-1:1)*ce}}if(r!==a){const D=b==="x"?"y":"x",ce=g[b]===v[D],te=w[D]>S[D],ae=w[D]<S[D];(g[b]===1&&(!ce&&te||ce&&ae)||g[b]!==1&&(!ce&&ae||ce&&te))&&(C=b==="x"?le:he)}const Se={x:w.x+$.x,y:w.y+$.y},W={x:S.x+H.x,y:S.y+H.y},ue=Math.max(Math.abs(Se.x-C[0].x),Math.abs(W.x-C[0].x)),xe=Math.max(Math.abs(Se.y-C[0].y),Math.abs(W.y-C[0].y));ue>=xe?(A=(Se.x+W.x)/2,T=C[0].y):(A=C[0].x,T=(Se.y+W.y)/2)}const X={x:w.x+$.x,y:w.y+$.y},V={x:S.x+H.x,y:S.y+H.y};return[[t,...X.x!==C[0].x||X.y!==C[0].y?[X]:[],...C,...V.x!==C[C.length-1].x||V.y!==C[C.length-1].y?[V]:[],i],A,T,M,R]}function P1(t,r,i,a){const u=Math.min(Sh(t,r)/2,Sh(r,i)/2,a),{x:f,y:d}=r;if(t.x===f&&f===i.x||t.y===d&&d===i.y)return`L${f} ${d}`;if(t.y===d){const w=t.x<i.x?-1:1,S=t.y<i.y?1:-1;return`L ${f+u*w},${d}Q ${f},${d} ${f},${d+u*S}`}const g=t.x<i.x?1:-1,v=t.y<i.y?-1:1;return`L ${f},${d+u*v}Q ${f},${d} ${f+u*g},${d}`}function Cf({sourceX:t,sourceY:r,sourcePosition:i=Ge.Bottom,targetX:a,targetY:u,targetPosition:f=Ge.Top,borderRadius:d=5,centerX:g,centerY:v,offset:w=20,stepPosition:S=.5}){const[x,b,N,C,A]=C1({source:{x:t,y:r},sourcePosition:i,target:{x:a,y:u},targetPosition:f,center:{x:g,y:v},offset:w,stepPosition:S});let T=`M${x[0].x} ${x[0].y}`;for(let $=1;$<x.length-1;$++)T+=P1(x[$-1],x[$],x[$+1],d);return T+=`L${x[x.length-1].x} ${x[x.length-1].y}`,[T,b,N,C,A]}function bh(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function j1(t){var x;const{sourceNode:r,targetNode:i}=t;if(!bh(r)||!bh(i))return null;const a=r.internals.handleBounds||kh(r.handles),u=i.internals.handleBounds||kh(i.handles),f=Eh((a==null?void 0:a.source)??[],t.sourceHandle),d=Eh(t.connectionMode===Ms.Strict?(u==null?void 0:u.target)??[]:((u==null?void 0:u.target)??[]).concat((u==null?void 0:u.source)??[]),t.targetHandle);if(!f||!d)return(x=t.onError)==null||x.call(t,"008",Zr.error008(f?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const g=(f==null?void 0:f.position)||Ge.Bottom,v=(d==null?void 0:d.position)||Ge.Top,w=Fi(r,f,g),S=Fi(i,d,v);return{sourceX:w.x,sourceY:w.y,targetX:S.x,targetY:S.y,sourcePosition:g,targetPosition:v}}function kh(t){if(!t)return null;const r=[],i=[];for(const a of t)a.width=a.width??1,a.height=a.height??1,a.type==="source"?r.push(a):a.type==="target"&&i.push(a);return{source:r,target:i}}function Fi(t,r,i=Ge.Left,a=!1){const u=((r==null?void 0:r.x)??0)+t.internals.positionAbsolute.x,f=((r==null?void 0:r.y)??0)+t.internals.positionAbsolute.y,{width:d,height:g}=r??Mo(t);if(a)return{x:u+d/2,y:f+g/2};switch((r==null?void 0:r.position)??i){case Ge.Top:return{x:u+d/2,y:f};case Ge.Right:return{x:u+d,y:f+g/2};case Ge.Bottom:return{x:u+d/2,y:f+g};case Ge.Left:return{x:u,y:f+g/2}}}function Eh(t,r){return t&&(r?t.find(i=>i.id===r):t[0])||null}function Pf(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(a=>`${a}=${t[a]}`).join("&")}`:""}function M1(t,{id:r,defaultColor:i,defaultMarkerStart:a,defaultMarkerEnd:u}){const f=new Set;return t.reduce((d,g)=>([g.markerStart||a,g.markerEnd||u].forEach(v=>{if(v&&typeof v=="object"){const w=Pf(v,r);f.has(w)||(d.push({id:w,color:v.color||i,...v}),f.add(w))}}),d),[]).sort((d,g)=>d.id.localeCompare(g.id))}const ug=1e3,T1=10,Uf={nodeOrigin:[0,0],nodeExtent:Ca,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},I1={...Uf,checkEquality:!0};function qf(t,r){const i={...t};for(const a in r)r[a]!==void 0&&(i[a]=r[a]);return i}function A1(t,r,i){const a=qf(Uf,i);for(const u of t.values())if(u.parentId)Yf(u,t,r,a);else{const f=Oa(u,a.nodeOrigin),d=As(u.extent)?u.extent:a.nodeExtent,g=Li(f,d,Mo(u));u.internals.positionAbsolute=g}}function $1(t,r){if(!t.handles)return t.measured?r==null?void 0:r.internals.handleBounds:void 0;const i=[],a=[];for(const u of t.handles){const f={id:u.id,width:u.width??1,height:u.height??1,nodeId:t.id,x:u.x,y:u.y,position:u.position,type:u.type};u.type==="source"?i.push(f):u.type==="target"&&a.push(f)}return{source:i,target:a}}function Wf(t){return t==="manual"}function jf(t,r,i,a={}){var S,x;const u=qf(I1,a),f={i:0},d=new Map(r),g=u!=null&&u.elevateNodesOnSelect&&!Wf(u.zIndexMode)?ug:0;let v=t.length>0,w=!1;r.clear(),i.clear();for(const b of t){let N=d.get(b.id);if(u.checkEquality&&b===(N==null?void 0:N.internals.userNode))r.set(b.id,N);else{const C=Oa(b,u.nodeOrigin),A=As(b.extent)?b.extent:u.nodeExtent,T=Li(C,A,Mo(b));N={...u.defaults,...b,measured:{width:(S=b.measured)==null?void 0:S.width,height:(x=b.measured)==null?void 0:x.height},internals:{positionAbsolute:T,handleBounds:$1(b,N),z:cg(b,g,u.zIndexMode),userNode:b}},r.set(b.id,N)}(N.measured===void 0||N.measured.width===void 0||N.measured.height===void 0)&&!N.hidden&&(v=!1),b.parentId&&Yf(N,r,i,a,f),w||(w=b.selected??!1)}return{nodesInitialized:v,hasSelectedNodes:w}}function O1(t,r){if(!t.parentId)return;const i=r.get(t.parentId);i?i.set(t.id,t):r.set(t.parentId,new Map([[t.id,t]]))}function Yf(t,r,i,a,u){const{elevateNodesOnSelect:f,nodeOrigin:d,nodeExtent:g,zIndexMode:v}=qf(Uf,a),w=t.parentId,S=r.get(w);if(!S){console.warn(`Parent node ${w} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}O1(t,i),u&&!S.parentId&&S.internals.rootParentIndex===void 0&&v==="auto"&&(S.internals.rootParentIndex=++u.i,S.internals.z=S.internals.z+u.i*T1),u&&S.internals.rootParentIndex!==void 0&&(u.i=S.internals.rootParentIndex);const x=f&&!Wf(v)?ug:0,{x:b,y:N,z:C}=R1(t,S,d,g,x,v),{positionAbsolute:A}=t.internals,T=b!==A.x||N!==A.y;(T||C!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:T?{x:b,y:N}:A,z:C}})}function cg(t,r,i){const a=Ar(t.zIndex)?t.zIndex:0;return Wf(i)?a:a+(t.selected?r:0)}function R1(t,r,i,a,u,f){const{x:d,y:g}=r.internals.positionAbsolute,v=Mo(t),w=Oa(t,i),S=As(t.extent)?Li(w,t.extent,v):w;let x=Li({x:d+S.x,y:g+S.y},a,v);t.extent==="parent"&&(x=Qm(x,v,r));const b=cg(t,u,f),N=r.internals.z??0;return{x:x.x,y:x.y,z:N>=b?N+1:b}}function Xf(t,r,i,a=[0,0]){var d;const u=[],f=new Map;for(const g of t){const v=r.get(g.parentId);if(!v)continue;const w=((d=f.get(g.parentId))==null?void 0:d.expandedRect)??Is(v),S=Zm(w,g.rect);f.set(g.parentId,{expandedRect:S,parent:v})}return f.size>0&&f.forEach(({expandedRect:g,parent:v},w)=>{var M;const S=v.internals.positionAbsolute,x=Mo(v),b=v.origin??a,N=g.x<S.x?Math.round(Math.abs(S.x-g.x)):0,C=g.y<S.y?Math.round(Math.abs(S.y-g.y)):0,A=Math.max(x.width,Math.round(g.width)),T=Math.max(x.height,Math.round(g.height)),$=(A-x.width)*b[0],H=(T-x.height)*b[1];(N>0||C>0||$||H)&&(u.push({id:w,type:"position",position:{x:v.position.x-N+$,y:v.position.y-C+H}}),(M=i.get(w))==null||M.forEach(R=>{t.some(X=>X.id===R.id)||u.push({id:R.id,type:"position",position:{x:R.position.x+N,y:R.position.y+C}})})),(x.width<g.width||x.height<g.height||N||C)&&u.push({id:w,type:"dimensions",setAttributes:!0,dimensions:{width:A+(N?b[0]*N-$:0),height:T+(C?b[1]*C-H:0)}})}),u}function z1(t,r,i,a,u,f,d){const g=a==null?void 0:a.querySelector(".xyflow__viewport");let v=!1;if(!g)return{changes:[],updatedInternals:v};const w=[],S=window.getComputedStyle(g),{m22:x}=new window.DOMMatrixReadOnly(S.transform),b=[];for(const N of t.values()){const C=r.get(N.id);if(!C)continue;if(C.hidden){r.set(C.id,{...C,internals:{...C.internals,handleBounds:void 0}}),v=!0;continue}const A=Kf(N.nodeElement),T=C.measured.width!==A.width||C.measured.height!==A.height;if(!!(A.width&&A.height&&(T||!C.internals.handleBounds||N.force))){const H=N.nodeElement.getBoundingClientRect(),M=As(C.extent)?C.extent:f;let{positionAbsolute:R}=C.internals;C.parentId&&C.extent==="parent"?R=Qm(R,A,r.get(C.parentId)):M&&(R=Li(R,M,A));const X={...C,measured:A,internals:{...C.internals,positionAbsolute:R,handleBounds:{source:xh("source",N.nodeElement,H,x,C.id),target:xh("target",N.nodeElement,H,x,C.id)}}};r.set(C.id,X),C.parentId&&Yf(X,r,i,{nodeOrigin:u,zIndexMode:d}),v=!0,T&&(w.push({id:C.id,type:"dimensions",dimensions:A}),C.expandParent&&C.parentId&&b.push({id:C.id,parentId:C.parentId,rect:Is(X,u)}))}}if(b.length>0){const N=Xf(b,r,i,u);w.push(...N)}return{changes:w,updatedInternals:v}}async function D1({delta:t,panZoom:r,transform:i,translateExtent:a,width:u,height:f}){if(!r||!t.x&&!t.y)return Promise.resolve(!1);const d=await r.setViewportConstrained({x:i[0]+t.x,y:i[1]+t.y,zoom:i[2]},[[0,0],[u,f]],a),g=!!d&&(d.x!==i[0]||d.y!==i[1]||d.k!==i[2]);return Promise.resolve(g)}function Nh(t,r,i,a,u,f){let d=u;const g=a.get(d)||new Map;a.set(d,g.set(i,r)),d=`${u}-${t}`;const v=a.get(d)||new Map;if(a.set(d,v.set(i,r)),f){d=`${u}-${t}-${f}`;const w=a.get(d)||new Map;a.set(d,w.set(i,r))}}function fg(t,r,i){t.clear(),r.clear();for(const a of i){const{source:u,target:f,sourceHandle:d=null,targetHandle:g=null}=a,v={edgeId:a.id,source:u,target:f,sourceHandle:d,targetHandle:g},w=`${u}-${d}--${f}-${g}`,S=`${f}-${g}--${u}-${d}`;Nh("source",v,S,t,u,d),Nh("target",v,w,t,f,g),r.set(a.id,a)}}function dg(t,r){if(!t.parentId)return!1;const i=r.get(t.parentId);return i?i.selected?!0:dg(i,r):!1}function Ch(t,r,i){var u;let a=t;do{if((u=a==null?void 0:a.matches)!=null&&u.call(a,r))return!0;if(a===i)return!1;a=a==null?void 0:a.parentElement}while(a);return!1}function L1(t,r,i,a){const u=new Map;for(const[f,d]of t)if((d.selected||d.id===a)&&(!d.parentId||!dg(d,t))&&(d.draggable||r&&typeof d.draggable>"u")){const g=t.get(f);g&&u.set(f,{id:f,position:g.position||{x:0,y:0},distance:{x:i.x-g.internals.positionAbsolute.x,y:i.y-g.internals.positionAbsolute.y},extent:g.extent,parentId:g.parentId,origin:g.origin,expandParent:g.expandParent,internals:{positionAbsolute:g.internals.positionAbsolute||{x:0,y:0}},measured:{width:g.measured.width??0,height:g.measured.height??0}})}return u}function rf({nodeId:t,dragItems:r,nodeLookup:i,dragging:a=!0}){var d,g,v;const u=[];for(const[w,S]of r){const x=(d=i.get(w))==null?void 0:d.internals.userNode;x&&u.push({...x,position:S.position,dragging:a})}if(!t)return[u[0],u];const f=(g=i.get(t))==null?void 0:g.internals.userNode;return[f?{...f,position:((v=r.get(t))==null?void 0:v.position)||f.position,dragging:a}:u[0],u]}function F1({dragItems:t,snapGrid:r,x:i,y:a}){const u=t.values().next().value;if(!u)return null;const f={x:i-u.distance.x,y:a-u.distance.y},d=za(f,r);return{x:d.x-f.x,y:d.y-f.y}}function B1({onNodeMouseDown:t,getStoreItems:r,onDragStart:i,onDrag:a,onDragStop:u}){let f={x:null,y:null},d=0,g=new Map,v=!1,w={x:0,y:0},S=null,x=!1,b=null,N=!1,C=!1,A=null;function T({noDragClassName:H,handleSelector:M,domNode:R,isSelectable:X,nodeId:V,nodeClickDistance:U=0}){b=Gn(R);function le({x:ue,y:xe}){const{nodeLookup:D,nodeExtent:ce,snapGrid:te,snapToGrid:ae,nodeOrigin:L,onNodeDrag:F,onSelectionDrag:Q,onError:O,updateNodePositions:B}=r();f={x:ue,y:xe};let be=!1;const _e=g.size>1,$e=_e&&ce?Nf(Ra(g)):null,Ie=_e&&ae?F1({dragItems:g,snapGrid:te,x:ue,y:xe}):null;for(const[ze,we]of g){if(!D.has(ze))continue;let Le={x:ue-we.distance.x,y:xe-we.distance.y};ae&&(Le=Ie?{x:Math.round(Le.x+Ie.x),y:Math.round(Le.y+Ie.y)}:za(Le,te));let ke=null;if(_e&&ce&&!we.extent&&$e){const{positionAbsolute:Ye}=we.internals,et=Ye.x-$e.x+ce[0][0],ft=Ye.x+we.measured.width-$e.x2+ce[1][0],lt=Ye.y-$e.y+ce[0][1],kt=Ye.y+we.measured.height-$e.y2+ce[1][1];ke=[[et,lt],[ft,kt]]}const{position:Je,positionAbsolute:Oe}=Xm({nodeId:ze,nextPosition:Le,nodeLookup:D,nodeExtent:ke||ce,nodeOrigin:L,onError:O});be=be||we.position.x!==Je.x||we.position.y!==Je.y,we.position=Je,we.internals.positionAbsolute=Oe}if(C=C||be,!!be&&(B(g,!0),A&&(a||F||!V&&Q))){const[ze,we]=rf({nodeId:V,dragItems:g,nodeLookup:D});a==null||a(A,g,ze,we),F==null||F(A,ze,we),V||Q==null||Q(A,we)}}async function he(){if(!S)return;const{transform:ue,panBy:xe,autoPanSpeed:D,autoPanOnNodeDrag:ce}=r();if(!ce){v=!1,cancelAnimationFrame(d);return}const[te,ae]=Gm(w,S,D);(te!==0||ae!==0)&&(f.x=(f.x??0)-te/ue[2],f.y=(f.y??0)-ae/ue[2],await xe({x:te,y:ae})&&le(f)),d=requestAnimationFrame(he)}function Se(ue){var _e;const{nodeLookup:xe,multiSelectionActive:D,nodesDraggable:ce,transform:te,snapGrid:ae,snapToGrid:L,selectNodesOnDrag:F,onNodeDragStart:Q,onSelectionDragStart:O,unselectNodesAndEdges:B}=r();x=!0,(!F||!X)&&!D&&V&&((_e=xe.get(V))!=null&&_e.selected||B()),X&&F&&V&&(t==null||t(V));const be=Sa(ue.sourceEvent,{transform:te,snapGrid:ae,snapToGrid:L,containerBounds:S});if(f=be,g=L1(xe,ce,be,V),g.size>0&&(i||Q||!V&&O)){const[$e,Ie]=rf({nodeId:V,dragItems:g,nodeLookup:xe});i==null||i(ue.sourceEvent,g,$e,Ie),Q==null||Q(ue.sourceEvent,$e,Ie),V||O==null||O(ue.sourceEvent,Ie)}}const W=Pm().clickDistance(U).on("start",ue=>{const{domNode:xe,nodeDragThreshold:D,transform:ce,snapGrid:te,snapToGrid:ae}=r();S=(xe==null?void 0:xe.getBoundingClientRect())||null,N=!1,C=!1,A=ue.sourceEvent,D===0&&Se(ue),f=Sa(ue.sourceEvent,{transform:ce,snapGrid:te,snapToGrid:ae,containerBounds:S}),w=$r(ue.sourceEvent,S)}).on("drag",ue=>{const{autoPanOnNodeDrag:xe,transform:D,snapGrid:ce,snapToGrid:te,nodeDragThreshold:ae,nodeLookup:L}=r(),F=Sa(ue.sourceEvent,{transform:D,snapGrid:ce,snapToGrid:te,containerBounds:S});if(A=ue.sourceEvent,(ue.sourceEvent.type==="touchmove"&&ue.sourceEvent.touches.length>1||V&&!L.has(V))&&(N=!0),!N){if(!v&&xe&&x&&(v=!0,he()),!x){const Q=$r(ue.sourceEvent,S),O=Q.x-w.x,B=Q.y-w.y;Math.sqrt(O*O+B*B)>ae&&Se(ue)}(f.x!==F.xSnapped||f.y!==F.ySnapped)&&g&&x&&(w=$r(ue.sourceEvent,S),le(F))}}).on("end",ue=>{if(!(!x||N)&&(v=!1,x=!1,cancelAnimationFrame(d),g.size>0)){const{nodeLookup:xe,updateNodePositions:D,onNodeDragStop:ce,onSelectionDragStop:te}=r();if(C&&(D(g,!1),C=!1),u||ce||!V&&te){const[ae,L]=rf({nodeId:V,dragItems:g,nodeLookup:xe,dragging:!1});u==null||u(ue.sourceEvent,g,ae,L),ce==null||ce(ue.sourceEvent,ae,L),V||te==null||te(ue.sourceEvent,L)}}}).filter(ue=>{const xe=ue.target;return!ue.button&&(!H||!Ch(xe,`.${H}`,R))&&(!M||Ch(xe,M,R))});b.call(W)}function $(){b==null||b.on(".drag",null)}return{update:T,destroy:$}}function H1(t,r,i){const a=[],u={x:t.x-i,y:t.y-i,width:i*2,height:i*2};for(const f of r.values())ja(u,Is(f))>0&&a.push(f);return a}const V1=250;function K1(t,r,i,a){var g,v;let u=[],f=1/0;const d=H1(t,i,r+V1);for(const w of d){const S=[...((g=w.internals.handleBounds)==null?void 0:g.source)??[],...((v=w.internals.handleBounds)==null?void 0:v.target)??[]];for(const x of S){if(a.nodeId===x.nodeId&&a.type===x.type&&a.id===x.id)continue;const{x:b,y:N}=Fi(w,x,x.position,!0),C=Math.sqrt(Math.pow(b-t.x,2)+Math.pow(N-t.y,2));C>r||(C<f?(u=[{...x,x:b,y:N}],f=C):C===f&&u.push({...x,x:b,y:N}))}}if(!u.length)return null;if(u.length>1){const w=a.type==="source"?"target":"source";return u.find(S=>S.type===w)??u[0]}return u[0]}function pg(t,r,i,a,u,f=!1){var w,S,x;const d=a.get(t);if(!d)return null;const g=u==="strict"?(w=d.internals.handleBounds)==null?void 0:w[r]:[...((S=d.internals.handleBounds)==null?void 0:S.source)??[],...((x=d.internals.handleBounds)==null?void 0:x.target)??[]],v=(i?g==null?void 0:g.find(b=>b.id===i):g==null?void 0:g[0])??null;return v&&f?{...v,...Fi(d,v,v.position,!0)}:v}function hg(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function U1(t,r){let i=null;return r?i=!0:t&&!r&&(i=!1),i}const mg=()=>!0;function q1(t,{connectionMode:r,connectionRadius:i,handleId:a,nodeId:u,edgeUpdaterType:f,isTarget:d,domNode:g,nodeLookup:v,lib:w,autoPanOnConnect:S,flowId:x,panBy:b,cancelConnection:N,onConnectStart:C,onConnect:A,onConnectEnd:T,isValidConnection:$=mg,onReconnectEnd:H,updateConnection:M,getTransform:R,getFromHandle:X,autoPanSpeed:V,dragThreshold:U=1,handleDomNode:le}){const he=tg(t.target);let Se=0,W;const{x:ue,y:xe}=$r(t),D=hg(f,le),ce=g==null?void 0:g.getBoundingClientRect();let te=!1;if(!ce||!D)return;const ae=pg(u,D,a,v,r);if(!ae)return;let L=$r(t,ce),F=!1,Q=null,O=!1,B=null;function be(){if(!S||!ce)return;const[Je,Oe]=Gm(L,ce,V);b({x:Je,y:Oe}),Se=requestAnimationFrame(be)}const _e={...ae,nodeId:u,type:D,position:ae.position},$e=v.get(u);let ze={inProgress:!0,isValid:null,from:Fi($e,_e,Ge.Left,!0),fromHandle:_e,fromPosition:_e.position,fromNode:$e,to:L,toHandle:null,toPosition:mh[_e.position],toNode:null,pointer:L};function we(){te=!0,M(ze),C==null||C(t,{nodeId:u,handleId:a,handleType:D})}U===0&&we();function Le(Je){if(!te){const{x:kt,y:dn}=$r(Je),on=kt-ue,Wt=dn-xe;if(!(on*on+Wt*Wt>U*U))return;we()}if(!X()||!_e){ke(Je);return}const Oe=R();L=$r(Je,ce),W=K1(Da(L,Oe,!1,[1,1]),i,v,_e),F||(be(),F=!0);const Ye=gg(Je,{handle:W,connectionMode:r,fromNodeId:u,fromHandleId:a,fromType:d?"target":"source",isValidConnection:$,doc:he,lib:w,flowId:x,nodeLookup:v});B=Ye.handleDomNode,Q=Ye.connection,O=U1(!!W,Ye.isValid);const et=v.get(u),ft=et?Fi(et,_e,Ge.Left,!0):ze.from,lt={...ze,from:ft,isValid:O,to:Ye.toHandle&&O?mu({x:Ye.toHandle.x,y:Ye.toHandle.y},Oe):L,toHandle:Ye.toHandle,toPosition:O&&Ye.toHandle?Ye.toHandle.position:mh[_e.position],toNode:Ye.toHandle?v.get(Ye.toHandle.nodeId):null,pointer:L};M(lt),ze=lt}function ke(Je){if(!("touches"in Je&&Je.touches.length>0)){if(te){(W||B)&&Q&&O&&(A==null||A(Q));const{inProgress:Oe,...Ye}=ze,et={...Ye,toPosition:ze.toHandle?ze.toPosition:null};T==null||T(Je,et),f&&(H==null||H(Je,et))}N(),cancelAnimationFrame(Se),F=!1,O=!1,Q=null,B=null,he.removeEventListener("mousemove",Le),he.removeEventListener("mouseup",ke),he.removeEventListener("touchmove",Le),he.removeEventListener("touchend",ke)}}he.addEventListener("mousemove",Le),he.addEventListener("mouseup",ke),he.addEventListener("touchmove",Le),he.addEventListener("touchend",ke)}function gg(t,{handle:r,connectionMode:i,fromNodeId:a,fromHandleId:u,fromType:f,doc:d,lib:g,flowId:v,isValidConnection:w=mg,nodeLookup:S}){const x=f==="target",b=r?d.querySelector(`.${g}-flow__handle[data-id="${v}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:N,y:C}=$r(t),A=d.elementFromPoint(N,C),T=A!=null&&A.classList.contains(`${g}-flow__handle`)?A:b,$={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){const H=hg(void 0,T),M=T.getAttribute("data-nodeid"),R=T.getAttribute("data-handleid"),X=T.classList.contains("connectable"),V=T.classList.contains("connectableend");if(!M||!H)return $;const U={source:x?M:a,sourceHandle:x?R:u,target:x?a:M,targetHandle:x?u:R};$.connection=U;const he=X&&V&&(i===Ms.Strict?x&&H==="source"||!x&&H==="target":M!==a||R!==u);$.isValid=he&&w(U),$.toHandle=pg(M,H,R,S,i,!0)}return $}const Mf={onPointerDown:q1,isValid:gg};function W1({domNode:t,panZoom:r,getTransform:i,getViewScale:a}){const u=Gn(t);function f({translateExtent:g,width:v,height:w,zoomStep:S=1,pannable:x=!0,zoomable:b=!0,inversePan:N=!1}){const C=M=>{if(M.sourceEvent.type!=="wheel"||!r)return;const R=i(),X=M.sourceEvent.ctrlKey&&Ma()?10:1,V=-M.sourceEvent.deltaY*(M.sourceEvent.deltaMode===1?.05:M.sourceEvent.deltaMode?1:.002)*S,U=R[2]*Math.pow(2,V*X);r.scaleTo(U)};let A=[0,0];const T=M=>{(M.sourceEvent.type==="mousedown"||M.sourceEvent.type==="touchstart")&&(A=[M.sourceEvent.clientX??M.sourceEvent.touches[0].clientX,M.sourceEvent.clientY??M.sourceEvent.touches[0].clientY])},$=M=>{const R=i();if(M.sourceEvent.type!=="mousemove"&&M.sourceEvent.type!=="touchmove"||!r)return;const X=[M.sourceEvent.clientX??M.sourceEvent.touches[0].clientX,M.sourceEvent.clientY??M.sourceEvent.touches[0].clientY],V=[X[0]-A[0],X[1]-A[1]];A=X;const U=a()*Math.max(R[2],Math.log(R[2]))*(N?-1:1),le={x:R[0]-V[0]*U,y:R[1]-V[1]*U},he=[[0,0],[v,w]];r.setViewportConstrained({x:le.x,y:le.y,zoom:R[2]},he,g)},H=Vm().on("start",T).on("zoom",x?$:null).on("zoom.wheel",b?C:null);u.call(H,{})}function d(){u.on("zoom",null)}return{update:f,destroy:d,pointer:Tr}}const Pu=t=>({x:t.x,y:t.y,zoom:t.k}),of=({x:t,y:r,zoom:i})=>Eu.translate(t,r).scale(i),ks=(t,r)=>t.target.closest(`.${r}`),yg=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),Y1=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,sf=(t,r=0,i=Y1,a=()=>{})=>{const u=typeof r=="number"&&r>0;return u||a(),u?t.transition().duration(r).ease(i).on("end",a):t},vg=t=>{const r=t.ctrlKey&&Ma()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function X1({zoomPanValues:t,noWheelClassName:r,d3Selection:i,d3Zoom:a,panOnScrollMode:u,panOnScrollSpeed:f,zoomOnPinch:d,onPanZoomStart:g,onPanZoom:v,onPanZoomEnd:w}){return S=>{if(ks(S,r))return S.ctrlKey&&S.preventDefault(),!1;S.preventDefault(),S.stopImmediatePropagation();const x=i.property("__zoom").k||1;if(S.ctrlKey&&d){const T=Tr(S),$=vg(S),H=x*Math.pow(2,$);a.scaleTo(i,H,T,S);return}const b=S.deltaMode===1?20:1;let N=u===Ri.Vertical?0:S.deltaX*b,C=u===Ri.Horizontal?0:S.deltaY*b;!Ma()&&S.shiftKey&&u!==Ri.Vertical&&(N=S.deltaY*b,C=0),a.translateBy(i,-(N/x)*f,-(C/x)*f,{internal:!0});const A=Pu(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(v==null||v(S,A),t.panScrollTimeout=setTimeout(()=>{w==null||w(S,A),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,g==null||g(S,A))}}function Q1({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:i}){return function(a,u){const f=a.type==="wheel",d=!r&&f&&!a.ctrlKey,g=ks(a,t);if(a.ctrlKey&&f&&g&&a.preventDefault(),d||g)return null;a.preventDefault(),i.call(this,a,u)}}function G1({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:i}){return a=>{var f,d,g;if((f=a.sourceEvent)!=null&&f.internal)return;const u=Pu(a.transform);t.mouseButton=((d=a.sourceEvent)==null?void 0:d.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=u,((g=a.sourceEvent)==null?void 0:g.type)==="mousedown"&&r(!0),i&&(i==null||i(a.sourceEvent,u))}}function Z1({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:i,onTransformChange:a,onPanZoom:u}){return f=>{var d,g;t.usedRightMouseButton=!!(i&&yg(r,t.mouseButton??0)),(d=f.sourceEvent)!=null&&d.sync||a([f.transform.x,f.transform.y,f.transform.k]),u&&!((g=f.sourceEvent)!=null&&g.internal)&&(u==null||u(f.sourceEvent,Pu(f.transform)))}}function J1({zoomPanValues:t,panOnDrag:r,panOnScroll:i,onDraggingChange:a,onPanZoomEnd:u,onPaneContextMenu:f}){return d=>{var g;if(!((g=d.sourceEvent)!=null&&g.internal)&&(t.isZoomingOrPanning=!1,f&&yg(r,t.mouseButton??0)&&!t.usedRightMouseButton&&d.sourceEvent&&f(d.sourceEvent),t.usedRightMouseButton=!1,a(!1),u)){const v=Pu(d.transform);t.prevViewport=v,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{u==null||u(d.sourceEvent,v)},i?150:0)}}}function e_({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:a,panOnScroll:u,zoomOnDoubleClick:f,userSelectionActive:d,noWheelClassName:g,noPanClassName:v,lib:w,connectionInProgress:S}){return x=>{var T;const b=t||r,N=i&&x.ctrlKey,C=x.type==="wheel";if(x.button===1&&x.type==="mousedown"&&(ks(x,`${w}-flow__node`)||ks(x,`${w}-flow__edge`)))return!0;if(!a&&!b&&!u&&!f&&!i||d||S&&!C||ks(x,g)&&C||ks(x,v)&&(!C||u&&C&&!t)||!i&&x.ctrlKey&&C)return!1;if(!i&&x.type==="touchstart"&&((T=x.touches)==null?void 0:T.length)>1)return x.preventDefault(),!1;if(!b&&!u&&!N&&C||!a&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(a)&&!a.includes(x.button)&&x.type==="mousedown")return!1;const A=Array.isArray(a)&&a.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||C)&&A}}function t_({domNode:t,minZoom:r,maxZoom:i,translateExtent:a,viewport:u,onPanZoom:f,onPanZoomStart:d,onPanZoomEnd:g,onDraggingChange:v}){const w={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},S=t.getBoundingClientRect(),x=Vm().scaleExtent([r,i]).translateExtent(a),b=Gn(t).call(x);H({x:u.x,y:u.y,zoom:Ts(u.zoom,r,i)},[[0,0],[S.width,S.height]],a);const N=b.on("wheel.zoom"),C=b.on("dblclick.zoom");x.wheelDelta(vg);function A(W,ue){return b?new Promise(xe=>{x==null||x.interpolate((ue==null?void 0:ue.interpolate)==="linear"?_a:eu).transform(sf(b,ue==null?void 0:ue.duration,ue==null?void 0:ue.ease,()=>xe(!0)),W)}):Promise.resolve(!1)}function T({noWheelClassName:W,noPanClassName:ue,onPaneContextMenu:xe,userSelectionActive:D,panOnScroll:ce,panOnDrag:te,panOnScrollMode:ae,panOnScrollSpeed:L,preventScrolling:F,zoomOnPinch:Q,zoomOnScroll:O,zoomOnDoubleClick:B,zoomActivationKeyPressed:be,lib:_e,onTransformChange:$e,connectionInProgress:Ie,paneClickDistance:ze,selectionOnDrag:we}){D&&!w.isZoomingOrPanning&&$();const Le=ce&&!be&&!D;x.clickDistance(we?1/0:!Ar(ze)||ze<0?0:ze);const ke=Le?X1({zoomPanValues:w,noWheelClassName:W,d3Selection:b,d3Zoom:x,panOnScrollMode:ae,panOnScrollSpeed:L,zoomOnPinch:Q,onPanZoomStart:d,onPanZoom:f,onPanZoomEnd:g}):Q1({noWheelClassName:W,preventScrolling:F,d3ZoomHandler:N});if(b.on("wheel.zoom",ke,{passive:!1}),!D){const Oe=G1({zoomPanValues:w,onDraggingChange:v,onPanZoomStart:d});x.on("start",Oe);const Ye=Z1({zoomPanValues:w,panOnDrag:te,onPaneContextMenu:!!xe,onPanZoom:f,onTransformChange:$e});x.on("zoom",Ye);const et=J1({zoomPanValues:w,panOnDrag:te,panOnScroll:ce,onPaneContextMenu:xe,onPanZoomEnd:g,onDraggingChange:v});x.on("end",et)}const Je=e_({zoomActivationKeyPressed:be,panOnDrag:te,zoomOnScroll:O,panOnScroll:ce,zoomOnDoubleClick:B,zoomOnPinch:Q,userSelectionActive:D,noPanClassName:ue,noWheelClassName:W,lib:_e,connectionInProgress:Ie});x.filter(Je),B?b.on("dblclick.zoom",C):b.on("dblclick.zoom",null)}function $(){x.on("zoom",null)}async function H(W,ue,xe){const D=of(W),ce=x==null?void 0:x.constrain()(D,ue,xe);return ce&&await A(ce),new Promise(te=>te(ce))}async function M(W,ue){const xe=of(W);return await A(xe,ue),new Promise(D=>D(xe))}function R(W){if(b){const ue=of(W),xe=b.property("__zoom");(xe.k!==W.zoom||xe.x!==W.x||xe.y!==W.y)&&(x==null||x.transform(b,ue,null,{sync:!0}))}}function X(){const W=b?Hm(b.node()):{x:0,y:0,k:1};return{x:W.x,y:W.y,zoom:W.k}}function V(W,ue){return b?new Promise(xe=>{x==null||x.interpolate((ue==null?void 0:ue.interpolate)==="linear"?_a:eu).scaleTo(sf(b,ue==null?void 0:ue.duration,ue==null?void 0:ue.ease,()=>xe(!0)),W)}):Promise.resolve(!1)}function U(W,ue){return b?new Promise(xe=>{x==null||x.interpolate((ue==null?void 0:ue.interpolate)==="linear"?_a:eu).scaleBy(sf(b,ue==null?void 0:ue.duration,ue==null?void 0:ue.ease,()=>xe(!0)),W)}):Promise.resolve(!1)}function le(W){x==null||x.scaleExtent(W)}function he(W){x==null||x.translateExtent(W)}function Se(W){const ue=!Ar(W)||W<0?0:W;x==null||x.clickDistance(ue)}return{update:T,destroy:$,setViewport:M,setViewportConstrained:H,getViewport:X,scaleTo:V,scaleBy:U,setScaleExtent:le,setTranslateExtent:he,syncViewport:R,setClickDistance:Se}}var $s;(function(t){t.Line="line",t.Handle="handle"})($s||($s={}));function n_({width:t,prevWidth:r,height:i,prevHeight:a,affectsX:u,affectsY:f}){const d=t-r,g=i-a,v=[d>0?1:d<0?-1:0,g>0?1:g<0?-1:0];return d&&u&&(v[0]=v[0]*-1),g&&f&&(v[1]=v[1]*-1),v}function Ph(t){const r=t.includes("right")||t.includes("left"),i=t.includes("bottom")||t.includes("top"),a=t.includes("left"),u=t.includes("top");return{isHorizontal:r,isVertical:i,affectsX:a,affectsY:u}}function oi(t,r){return Math.max(0,r-t)}function ii(t,r){return Math.max(0,t-r)}function Xl(t,r,i){return Math.max(0,r-t,t-i)}function jh(t,r){return t?!r:r}function r_(t,r,i,a,u,f,d,g){let{affectsX:v,affectsY:w}=r;const{isHorizontal:S,isVertical:x}=r,b=S&&x,{xSnapped:N,ySnapped:C}=i,{minWidth:A,maxWidth:T,minHeight:$,maxHeight:H}=a,{x:M,y:R,width:X,height:V,aspectRatio:U}=t;let le=Math.floor(S?N-t.pointerX:0),he=Math.floor(x?C-t.pointerY:0);const Se=X+(v?-le:le),W=V+(w?-he:he),ue=-f[0]*X,xe=-f[1]*V;let D=Xl(Se,A,T),ce=Xl(W,$,H);if(d){let L=0,F=0;v&&le<0?L=oi(M+le+ue,d[0][0]):!v&&le>0&&(L=ii(M+Se+ue,d[1][0])),w&&he<0?F=oi(R+he+xe,d[0][1]):!w&&he>0&&(F=ii(R+W+xe,d[1][1])),D=Math.max(D,L),ce=Math.max(ce,F)}if(g){let L=0,F=0;v&&le>0?L=ii(M+le,g[0][0]):!v&&le<0&&(L=oi(M+Se,g[1][0])),w&&he>0?F=ii(R+he,g[0][1]):!w&&he<0&&(F=oi(R+W,g[1][1])),D=Math.max(D,L),ce=Math.max(ce,F)}if(u){if(S){const L=Xl(Se/U,$,H)*U;if(D=Math.max(D,L),d){let F=0;!v&&!w||v&&!w&&b?F=ii(R+xe+Se/U,d[1][1])*U:F=oi(R+xe+(v?le:-le)/U,d[0][1])*U,D=Math.max(D,F)}if(g){let F=0;!v&&!w||v&&!w&&b?F=oi(R+Se/U,g[1][1])*U:F=ii(R+(v?le:-le)/U,g[0][1])*U,D=Math.max(D,F)}}if(x){const L=Xl(W*U,A,T)/U;if(ce=Math.max(ce,L),d){let F=0;!v&&!w||w&&!v&&b?F=ii(M+W*U+ue,d[1][0])/U:F=oi(M+(w?he:-he)*U+ue,d[0][0])/U,ce=Math.max(ce,F)}if(g){let F=0;!v&&!w||w&&!v&&b?F=oi(M+W*U,g[1][0])/U:F=ii(M+(w?he:-he)*U,g[0][0])/U,ce=Math.max(ce,F)}}}he=he+(he<0?ce:-ce),le=le+(le<0?D:-D),u&&(b?Se>W*U?he=(jh(v,w)?-le:le)/U:le=(jh(v,w)?-he:he)*U:S?(he=le/U,w=v):(le=he*U,v=w));const te=v?M+le:M,ae=w?R+he:R;return{width:X+(v?-le:le),height:V+(w?-he:he),x:f[0]*le*(v?-1:1)+te,y:f[1]*he*(w?-1:1)+ae}}const xg={width:0,height:0,x:0,y:0},o_={...xg,pointerX:0,pointerY:0,aspectRatio:1};function i_(t){return[[0,0],[t.measured.width,t.measured.height]]}function s_(t,r,i){const a=r.position.x+t.position.x,u=r.position.y+t.position.y,f=t.measured.width??0,d=t.measured.height??0,g=i[0]*f,v=i[1]*d;return[[a-g,u-v],[a+f-g,u+d-v]]}function a_({domNode:t,nodeId:r,getStoreItems:i,onChange:a,onEnd:u}){const f=Gn(t);let d={controlDirection:Ph("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function g({controlPosition:w,boundaries:S,keepAspectRatio:x,resizeDirection:b,onResizeStart:N,onResize:C,onResizeEnd:A,shouldResize:T}){let $={...xg},H={...o_};d={boundaries:S,resizeDirection:b,keepAspectRatio:x,controlDirection:Ph(w)};let M,R=null,X=[],V,U,le,he=!1;const Se=Pm().on("start",W=>{const{nodeLookup:ue,transform:xe,snapGrid:D,snapToGrid:ce,nodeOrigin:te,paneDomNode:ae}=i();if(M=ue.get(r),!M)return;R=(ae==null?void 0:ae.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:F}=Sa(W.sourceEvent,{transform:xe,snapGrid:D,snapToGrid:ce,containerBounds:R});$={width:M.measured.width??0,height:M.measured.height??0,x:M.position.x??0,y:M.position.y??0},H={...$,pointerX:L,pointerY:F,aspectRatio:$.width/$.height},V=void 0,M.parentId&&(M.extent==="parent"||M.expandParent)&&(V=ue.get(M.parentId),U=V&&M.extent==="parent"?i_(V):void 0),X=[],le=void 0;for(const[Q,O]of ue)if(O.parentId===r&&(X.push({id:Q,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const B=s_(O,M,O.origin??te);le?le=[[Math.min(B[0][0],le[0][0]),Math.min(B[0][1],le[0][1])],[Math.max(B[1][0],le[1][0]),Math.max(B[1][1],le[1][1])]]:le=B}N==null||N(W,{...$})}).on("drag",W=>{const{transform:ue,snapGrid:xe,snapToGrid:D,nodeOrigin:ce}=i(),te=Sa(W.sourceEvent,{transform:ue,snapGrid:xe,snapToGrid:D,containerBounds:R}),ae=[];if(!M)return;const{x:L,y:F,width:Q,height:O}=$,B={},be=M.origin??ce,{width:_e,height:$e,x:Ie,y:ze}=r_(H,d.controlDirection,te,d.boundaries,d.keepAspectRatio,be,U,le),we=_e!==Q,Le=$e!==O,ke=Ie!==L&&we,Je=ze!==F&&Le;if(!ke&&!Je&&!we&&!Le)return;if((ke||Je||be[0]===1||be[1]===1)&&(B.x=ke?Ie:$.x,B.y=Je?ze:$.y,$.x=B.x,$.y=B.y,X.length>0)){const ft=Ie-L,lt=ze-F;for(const kt of X)kt.position={x:kt.position.x-ft+be[0]*(_e-Q),y:kt.position.y-lt+be[1]*($e-O)},ae.push(kt)}if((we||Le)&&(B.width=we&&(!d.resizeDirection||d.resizeDirection==="horizontal")?_e:$.width,B.height=Le&&(!d.resizeDirection||d.resizeDirection==="vertical")?$e:$.height,$.width=B.width,$.height=B.height),V&&M.expandParent){const ft=be[0]*(B.width??0);B.x&&B.x<ft&&($.x=ft,H.x=H.x-(B.x-ft));const lt=be[1]*(B.height??0);B.y&&B.y<lt&&($.y=lt,H.y=H.y-(B.y-lt))}const Oe=n_({width:$.width,prevWidth:Q,height:$.height,prevHeight:O,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),Ye={...$,direction:Oe};(T==null?void 0:T(W,Ye))!==!1&&(he=!0,C==null||C(W,Ye),a(B,ae))}).on("end",W=>{he&&(A==null||A(W,{...$}),u==null||u({...$}),he=!1)});f.call(Se)}function v(){f.on(".drag",null)}return{update:g,destroy:v}}var af={exports:{}},lf={},uf={exports:{}},cf={};/**
181
+ * @license React
182
+ * use-sync-external-store-shim.production.js
183
+ *
184
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
185
+ *
186
+ * This source code is licensed under the MIT license found in the
187
+ * LICENSE file in the root directory of this source tree.
188
+ */var Mh;function l_(){if(Mh)return cf;Mh=1;var t=Ia();function r(x,b){return x===b&&(x!==0||1/x===1/b)||x!==x&&b!==b}var i=typeof Object.is=="function"?Object.is:r,a=t.useState,u=t.useEffect,f=t.useLayoutEffect,d=t.useDebugValue;function g(x,b){var N=b(),C=a({inst:{value:N,getSnapshot:b}}),A=C[0].inst,T=C[1];return f(function(){A.value=N,A.getSnapshot=b,v(A)&&T({inst:A})},[x,N,b]),u(function(){return v(A)&&T({inst:A}),x(function(){v(A)&&T({inst:A})})},[x]),d(N),N}function v(x){var b=x.getSnapshot;x=x.value;try{var N=b();return!i(x,N)}catch{return!0}}function w(x,b){return b()}var S=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?w:g;return cf.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:S,cf}var Th;function u_(){return Th||(Th=1,uf.exports=l_()),uf.exports}/**
189
+ * @license React
190
+ * use-sync-external-store-shim/with-selector.production.js
191
+ *
192
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
193
+ *
194
+ * This source code is licensed under the MIT license found in the
195
+ * LICENSE file in the root directory of this source tree.
196
+ */var Ih;function c_(){if(Ih)return lf;Ih=1;var t=Ia(),r=u_();function i(w,S){return w===S&&(w!==0||1/w===1/S)||w!==w&&S!==S}var a=typeof Object.is=="function"?Object.is:i,u=r.useSyncExternalStore,f=t.useRef,d=t.useEffect,g=t.useMemo,v=t.useDebugValue;return lf.useSyncExternalStoreWithSelector=function(w,S,x,b,N){var C=f(null);if(C.current===null){var A={hasValue:!1,value:null};C.current=A}else A=C.current;C=g(function(){function $(V){if(!H){if(H=!0,M=V,V=b(V),N!==void 0&&A.hasValue){var U=A.value;if(N(U,V))return R=U}return R=V}if(U=R,a(M,V))return U;var le=b(V);return N!==void 0&&N(U,le)?(M=V,U):(M=V,R=le)}var H=!1,M,R,X=x===void 0?null:x;return[function(){return $(S())},X===null?void 0:function(){return $(X())}]},[S,x,b,N]);var T=u(w,C[0],C[1]);return d(function(){A.hasValue=!0,A.value=T},[T]),v(T),T},lf}var Ah;function f_(){return Ah||(Ah=1,af.exports=c_()),af.exports}var d_=f_();const p_=yu(d_),h_={},$h=t=>{let r;const i=new Set,a=(S,x)=>{const b=typeof S=="function"?S(r):S;if(!Object.is(b,r)){const N=r;r=x??(typeof b!="object"||b===null)?b:Object.assign({},r,b),i.forEach(C=>C(r,N))}},u=()=>r,v={setState:a,getState:u,getInitialState:()=>w,subscribe:S=>(i.add(S),()=>i.delete(S)),destroy:()=>{(h_?"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."),i.clear()}},w=r=t(a,u,v);return v},m_=t=>t?$h(t):$h,{useDebugValue:g_}=am,{useSyncExternalStoreWithSelector:y_}=p_,v_=t=>t;function wg(t,r=v_,i){const a=y_(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,i);return g_(a),a}const Oh=(t,r)=>{const i=m_(t),a=(u,f=r)=>wg(i,u,f);return Object.assign(a,i),a},x_=(t,r)=>t?Oh(t,r):Oh;function Ot(t,r){if(Object.is(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(const[a,u]of t)if(!Object.is(u,r.get(a)))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(const a of t)if(!r.has(a))return!1;return!0}const i=Object.keys(t);if(i.length!==Object.keys(r).length)return!1;for(const a of i)if(!Object.prototype.hasOwnProperty.call(r,a)||!Object.is(t[a],r[a]))return!1;return!0}lm();const ju=de.createContext(null),w_=ju.Provider,_g=Zr.error001();function gt(t,r){const i=de.useContext(ju);if(i===null)throw new Error(_g);return wg(i,t,r)}function It(){const t=de.useContext(ju);if(t===null)throw new Error(_g);return de.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Rh={display:"none"},__={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Sg="react-flow__node-desc",bg="react-flow__edge-desc",S_="react-flow__aria-live",b_=t=>t.ariaLiveMessage,k_=t=>t.ariaLabelConfig;function E_({rfId:t}){const r=gt(b_);return P.jsx("div",{id:`${S_}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:__,children:r})}function N_({rfId:t,disableKeyboardA11y:r}){const i=gt(k_);return P.jsxs(P.Fragment,{children:[P.jsx("div",{id:`${Sg}-${t}`,style:Rh,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),P.jsx("div",{id:`${bg}-${t}`,style:Rh,children:i["edge.a11yDescription.default"]}),!r&&P.jsx(E_,{rfId:t})]})}const La=de.forwardRef(({position:t="top-left",children:r,className:i,style:a,...u},f)=>{const d=`${t}`.split("-");return P.jsx("div",{className:qt(["react-flow__panel",i,...d]),style:a,ref:f,...u,children:r})});La.displayName="Panel";function C_({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:P.jsx(La,{position:r,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:P.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const P_=t=>{const r=[],i=[];for(const[,a]of t.nodeLookup)a.selected&&r.push(a.internals.userNode);for(const[,a]of t.edgeLookup)a.selected&&i.push(a);return{selectedNodes:r,selectedEdges:i}},Ql=t=>t.id;function j_(t,r){return Ot(t.selectedNodes.map(Ql),r.selectedNodes.map(Ql))&&Ot(t.selectedEdges.map(Ql),r.selectedEdges.map(Ql))}function M_({onSelectionChange:t}){const r=It(),{selectedNodes:i,selectedEdges:a}=gt(P_,j_);return de.useEffect(()=>{const u={nodes:i,edges:a};t==null||t(u),r.getState().onSelectionChangeHandlers.forEach(f=>f(u))},[i,a,t]),null}const T_=t=>!!t.onSelectionChangeHandlers;function I_({onSelectionChange:t}){const r=gt(T_);return t||r?P.jsx(M_,{onSelectionChange:t}):null}const Tf=typeof window<"u"?de.useLayoutEffect:de.useEffect,kg=[0,0],A_={x:0,y:0,zoom:1},$_=["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"],zh=[...$_,"rfId"],O_=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),Dh={translateExtent:Ca,nodeOrigin:kg,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function R_(t){const{setNodes:r,setEdges:i,setMinZoom:a,setMaxZoom:u,setTranslateExtent:f,setNodeExtent:d,reset:g,setDefaultNodesAndEdges:v}=gt(O_,Ot),w=It();Tf(()=>(v(t.defaultNodes,t.defaultEdges),()=>{S.current=Dh,g()}),[]);const S=de.useRef(Dh);return Tf(()=>{for(const x of zh){const b=t[x],N=S.current[x];b!==N&&(typeof t[x]>"u"||(x==="nodes"?r(b):x==="edges"?i(b):x==="minZoom"?a(b):x==="maxZoom"?u(b):x==="translateExtent"?f(b):x==="nodeExtent"?d(b):x==="ariaLabelConfig"?w.setState({ariaLabelConfig:w1(b)}):x==="fitView"?w.setState({fitViewQueued:b}):x==="fitViewOptions"?w.setState({fitViewOptions:b}):w.setState({[x]:b})))}S.current=t},zh.map(x=>t[x])),null}function Lh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function z_(t){var a;const[r,i]=de.useState(t==="system"?null:t);return de.useEffect(()=>{if(t!=="system"){i(t);return}const u=Lh(),f=()=>i(u!=null&&u.matches?"dark":"light");return f(),u==null||u.addEventListener("change",f),()=>{u==null||u.removeEventListener("change",f)}},[t]),r!==null?r:(a=Lh())!=null&&a.matches?"dark":"light"}const Fh=typeof document<"u"?document:null;function Ta(t=null,r={target:Fh,actInsideInputWithModifier:!0}){const[i,a]=de.useState(!1),u=de.useRef(!1),f=de.useRef(new Set([])),[d,g]=de.useMemo(()=>{if(t!==null){const w=(Array.isArray(t)?t:[t]).filter(x=>typeof x=="string").map(x=>x.replace("+",`
197
+ `).replace(`
198
+
199
+ `,`
200
+ +`).split(`
201
+ `)),S=w.reduce((x,b)=>x.concat(...b),[]);return[w,S]}return[[],[]]},[t]);return de.useEffect(()=>{const v=(r==null?void 0:r.target)??Fh,w=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const S=N=>{var T,$;if(u.current=N.ctrlKey||N.metaKey||N.shiftKey||N.altKey,(!u.current||u.current&&!w)&&ng(N))return!1;const A=Hh(N.code,g);if(f.current.add(N[A]),Bh(d,f.current,!1)){const H=(($=(T=N.composedPath)==null?void 0:T.call(N))==null?void 0:$[0])||N.target,M=(H==null?void 0:H.nodeName)==="BUTTON"||(H==null?void 0:H.nodeName)==="A";r.preventDefault!==!1&&(u.current||!M)&&N.preventDefault(),a(!0)}},x=N=>{const C=Hh(N.code,g);Bh(d,f.current,!0)?(a(!1),f.current.clear()):f.current.delete(N[C]),N.key==="Meta"&&f.current.clear(),u.current=!1},b=()=>{f.current.clear(),a(!1)};return v==null||v.addEventListener("keydown",S),v==null||v.addEventListener("keyup",x),window.addEventListener("blur",b),window.addEventListener("contextmenu",b),()=>{v==null||v.removeEventListener("keydown",S),v==null||v.removeEventListener("keyup",x),window.removeEventListener("blur",b),window.removeEventListener("contextmenu",b)}}},[t,a]),i}function Bh(t,r,i){return t.filter(a=>i||a.length===r.size).some(a=>a.every(u=>r.has(u)))}function Hh(t,r){return r.includes(t)?"code":"key"}const D_=()=>{const t=It();return de.useMemo(()=>({zoomIn:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1.2,r):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1/1.2,r):Promise.resolve(!1)},zoomTo:(r,i)=>{const{panZoom:a}=t.getState();return a?a.scaleTo(r,i):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(r,i)=>{const{transform:[a,u,f],panZoom:d}=t.getState();return d?(await d.setViewport({x:r.x??a,y:r.y??u,zoom:r.zoom??f},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,i,a]=t.getState().transform;return{x:r,y:i,zoom:a}},setCenter:async(r,i,a)=>t.getState().setCenter(r,i,a),fitBounds:async(r,i)=>{const{width:a,height:u,minZoom:f,maxZoom:d,panZoom:g}=t.getState(),v=Vf(r,a,u,f,d,(i==null?void 0:i.padding)??.1);return g?(await g.setViewport(v,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,i={})=>{const{transform:a,snapGrid:u,snapToGrid:f,domNode:d}=t.getState();if(!d)return r;const{x:g,y:v}=d.getBoundingClientRect(),w={x:r.x-g,y:r.y-v},S=i.snapGrid??u,x=i.snapToGrid??f;return Da(w,a,x,S)},flowToScreenPosition:r=>{const{transform:i,domNode:a}=t.getState();if(!a)return r;const{x:u,y:f}=a.getBoundingClientRect(),d=mu(r,i);return{x:d.x+u,y:d.y+f}}}),[])};function Eg(t,r){const i=[],a=new Map,u=[];for(const f of t)if(f.type==="add"){u.push(f);continue}else if(f.type==="remove"||f.type==="replace")a.set(f.id,[f]);else{const d=a.get(f.id);d?d.push(f):a.set(f.id,[f])}for(const f of r){const d=a.get(f.id);if(!d){i.push(f);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){i.push({...d[0].item});continue}const g={...f};for(const v of d)L_(v,g);i.push(g)}return u.length&&u.forEach(f=>{f.index!==void 0?i.splice(f.index,0,{...f.item}):i.push({...f.item})}),i}function L_(t,r){switch(t.type){case"select":{r.selected=t.selected;break}case"position":{typeof t.position<"u"&&(r.position=t.position),typeof t.dragging<"u"&&(r.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(r.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(r.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(r.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(r.resizing=t.resizing);break}}}function Ng(t,r){return Eg(t,r)}function Cg(t,r){return Eg(t,r)}function Ai(t,r){return{id:t,type:"select",selected:r}}function Es(t,r=new Set,i=!1){const a=[];for(const[u,f]of t){const d=r.has(u);!(f.selected===void 0&&!d)&&f.selected!==d&&(i&&(f.selected=d),a.push(Ai(f.id,d)))}return a}function Vh({items:t=[],lookup:r}){var u;const i=[],a=new Map(t.map(f=>[f.id,f]));for(const[f,d]of t.entries()){const g=r.get(d.id),v=((u=g==null?void 0:g.internals)==null?void 0:u.userNode)??g;v!==void 0&&v!==d&&i.push({id:d.id,item:d,type:"replace"}),v===void 0&&i.push({item:d,type:"add",index:f})}for(const[f]of r)a.get(f)===void 0&&i.push({id:f,type:"remove"});return i}function Kh(t){return{id:t.id,type:"remove"}}const Uh=t=>c1(t),F_=t=>Ym(t);function Pg(t){return de.forwardRef(t)}function qh(t){const[r,i]=de.useState(BigInt(0)),[a]=de.useState(()=>B_(()=>i(u=>u+BigInt(1))));return Tf(()=>{const u=a.get();u.length&&(t(u),a.reset())},[r]),a}function B_(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),t()}}}const jg=de.createContext(null);function H_({children:t}){const r=It(),i=de.useCallback(g=>{const{nodes:v=[],setNodes:w,hasDefaultNodes:S,onNodesChange:x,nodeLookup:b,fitViewQueued:N,onNodesChangeMiddlewareMap:C}=r.getState();let A=v;for(const $ of g)A=typeof $=="function"?$(A):$;let T=Vh({items:A,lookup:b});for(const $ of C.values())T=$(T);S&&w(A),T.length>0?x==null||x(T):N&&window.requestAnimationFrame(()=>{const{fitViewQueued:$,nodes:H,setNodes:M}=r.getState();$&&M(H)})},[]),a=qh(i),u=de.useCallback(g=>{const{edges:v=[],setEdges:w,hasDefaultEdges:S,onEdgesChange:x,edgeLookup:b}=r.getState();let N=v;for(const C of g)N=typeof C=="function"?C(N):C;S?w(N):x&&x(Vh({items:N,lookup:b}))},[]),f=qh(u),d=de.useMemo(()=>({nodeQueue:a,edgeQueue:f}),[]);return P.jsx(jg.Provider,{value:d,children:t})}function V_(){const t=de.useContext(jg);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const K_=t=>!!t.panZoom;function Qf(){const t=D_(),r=It(),i=V_(),a=gt(K_),u=de.useMemo(()=>{const f=x=>r.getState().nodeLookup.get(x),d=x=>{i.nodeQueue.push(x)},g=x=>{i.edgeQueue.push(x)},v=x=>{var $,H;const{nodeLookup:b,nodeOrigin:N}=r.getState(),C=Uh(x)?x:b.get(x.id),A=C.parentId?eg(C.position,C.measured,C.parentId,b,N):C.position,T={...C,position:A,width:(($=C.measured)==null?void 0:$.width)??C.width,height:((H=C.measured)==null?void 0:H.height)??C.height};return Is(T)},w=(x,b,N={replace:!1})=>{d(C=>C.map(A=>{if(A.id===x){const T=typeof b=="function"?b(A):b;return N.replace&&Uh(T)?T:{...A,...T}}return A}))},S=(x,b,N={replace:!1})=>{g(C=>C.map(A=>{if(A.id===x){const T=typeof b=="function"?b(A):b;return N.replace&&F_(T)?T:{...A,...T}}return A}))};return{getNodes:()=>r.getState().nodes.map(x=>({...x})),getNode:x=>{var b;return(b=f(x))==null?void 0:b.internals.userNode},getInternalNode:f,getEdges:()=>{const{edges:x=[]}=r.getState();return x.map(b=>({...b}))},getEdge:x=>r.getState().edgeLookup.get(x),setNodes:d,setEdges:g,addNodes:x=>{const b=Array.isArray(x)?x:[x];i.nodeQueue.push(N=>[...N,...b])},addEdges:x=>{const b=Array.isArray(x)?x:[x];i.edgeQueue.push(N=>[...N,...b])},toObject:()=>{const{nodes:x=[],edges:b=[],transform:N}=r.getState(),[C,A,T]=N;return{nodes:x.map($=>({...$})),edges:b.map($=>({...$})),viewport:{x:C,y:A,zoom:T}}},deleteElements:async({nodes:x=[],edges:b=[]})=>{const{nodes:N,edges:C,onNodesDelete:A,onEdgesDelete:T,triggerNodeChanges:$,triggerEdgeChanges:H,onDelete:M,onBeforeDelete:R}=r.getState(),{nodes:X,edges:V}=await m1({nodesToRemove:x,edgesToRemove:b,nodes:N,edges:C,onBeforeDelete:R}),U=V.length>0,le=X.length>0;if(U){const he=V.map(Kh);T==null||T(V),H(he)}if(le){const he=X.map(Kh);A==null||A(X),$(he)}return(le||U)&&(M==null||M({nodes:X,edges:V})),{deletedNodes:X,deletedEdges:V}},getIntersectingNodes:(x,b=!0,N)=>{const C=yh(x),A=C?x:v(x),T=N!==void 0;return A?(N||r.getState().nodes).filter($=>{const H=r.getState().nodeLookup.get($.id);if(H&&!C&&($.id===x.id||!H.internals.positionAbsolute))return!1;const M=Is(T?$:H),R=ja(M,A);return b&&R>0||R>=M.width*M.height||R>=A.width*A.height}):[]},isNodeIntersecting:(x,b,N=!0)=>{const A=yh(x)?x:v(x);if(!A)return!1;const T=ja(A,b);return N&&T>0||T>=b.width*b.height||T>=A.width*A.height},updateNode:w,updateNodeData:(x,b,N={replace:!1})=>{w(x,C=>{const A=typeof b=="function"?b(C):b;return N.replace?{...C,data:A}:{...C,data:{...C.data,...A}}},N)},updateEdge:S,updateEdgeData:(x,b,N={replace:!1})=>{S(x,C=>{const A=typeof b=="function"?b(C):b;return N.replace?{...C,data:A}:{...C,data:{...C.data,...A}}},N)},getNodesBounds:x=>{const{nodeLookup:b,nodeOrigin:N}=r.getState();return f1(x,{nodeLookup:b,nodeOrigin:N})},getHandleConnections:({type:x,id:b,nodeId:N})=>{var C;return Array.from(((C=r.getState().connectionLookup.get(`${N}-${x}${b?`-${b}`:""}`))==null?void 0:C.values())??[])},getNodeConnections:({type:x,handleId:b,nodeId:N})=>{var C;return Array.from(((C=r.getState().connectionLookup.get(`${N}${x?b?`-${x}-${b}`:`-${x}`:""}`))==null?void 0:C.values())??[])},fitView:async x=>{const b=r.getState().fitViewResolver??x1();return r.setState({fitViewQueued:!0,fitViewOptions:x,fitViewResolver:b}),i.nodeQueue.push(N=>[...N]),b.promise}}},[]);return de.useMemo(()=>({...u,...t,viewportInitialized:a}),[a])}const Wh=t=>t.selected,U_=typeof window<"u"?window:void 0;function q_({deleteKeyCode:t,multiSelectionKeyCode:r}){const i=It(),{deleteElements:a}=Qf(),u=Ta(t,{actInsideInputWithModifier:!1}),f=Ta(r,{target:U_});de.useEffect(()=>{if(u){const{edges:d,nodes:g}=i.getState();a({nodes:g.filter(Wh),edges:d.filter(Wh)}),i.setState({nodesSelectionActive:!1})}},[u]),de.useEffect(()=>{i.setState({multiSelectionActive:f})},[f])}function W_(t){const r=It();de.useEffect(()=>{const i=()=>{var u,f,d,g;if(!t.current||!(((f=(u=t.current).checkVisibility)==null?void 0:f.call(u))??!0))return!1;const a=Kf(t.current);(a.height===0||a.width===0)&&((g=(d=r.getState()).onError)==null||g.call(d,"004",Zr.error004())),r.setState({width:a.width||500,height:a.height||500})};if(t.current){i(),window.addEventListener("resize",i);const a=new ResizeObserver(()=>i());return a.observe(t.current),()=>{window.removeEventListener("resize",i),a&&t.current&&a.unobserve(t.current)}}},[])}const Mu={position:"absolute",width:"100%",height:"100%",top:0,left:0},Y_=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function X_({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:u=.5,panOnScrollMode:f=Ri.Free,zoomOnDoubleClick:d=!0,panOnDrag:g=!0,defaultViewport:v,translateExtent:w,minZoom:S,maxZoom:x,zoomActivationKeyCode:b,preventScrolling:N=!0,children:C,noWheelClassName:A,noPanClassName:T,onViewportChange:$,isControlledViewport:H,paneClickDistance:M,selectionOnDrag:R}){const X=It(),V=de.useRef(null),{userSelectionActive:U,lib:le,connectionInProgress:he}=gt(Y_,Ot),Se=Ta(b),W=de.useRef();W_(V);const ue=de.useCallback(xe=>{$==null||$({x:xe[0],y:xe[1],zoom:xe[2]}),H||X.setState({transform:xe})},[$,H]);return de.useEffect(()=>{if(V.current){W.current=t_({domNode:V.current,minZoom:S,maxZoom:x,translateExtent:w,viewport:v,onDraggingChange:te=>X.setState(ae=>ae.paneDragging===te?ae:{paneDragging:te}),onPanZoomStart:(te,ae)=>{const{onViewportChangeStart:L,onMoveStart:F}=X.getState();F==null||F(te,ae),L==null||L(ae)},onPanZoom:(te,ae)=>{const{onViewportChange:L,onMove:F}=X.getState();F==null||F(te,ae),L==null||L(ae)},onPanZoomEnd:(te,ae)=>{const{onViewportChangeEnd:L,onMoveEnd:F}=X.getState();F==null||F(te,ae),L==null||L(ae)}});const{x:xe,y:D,zoom:ce}=W.current.getViewport();return X.setState({panZoom:W.current,transform:[xe,D,ce],domNode:V.current.closest(".react-flow")}),()=>{var te;(te=W.current)==null||te.destroy()}}},[]),de.useEffect(()=>{var xe;(xe=W.current)==null||xe.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:a,panOnScrollSpeed:u,panOnScrollMode:f,zoomOnDoubleClick:d,panOnDrag:g,zoomActivationKeyPressed:Se,preventScrolling:N,noPanClassName:T,userSelectionActive:U,noWheelClassName:A,lib:le,onTransformChange:ue,connectionInProgress:he,selectionOnDrag:R,paneClickDistance:M})},[t,r,i,a,u,f,d,g,Se,N,T,U,A,le,ue,he,R,M]),P.jsx("div",{className:"react-flow__renderer",ref:V,style:Mu,children:C})}const Q_=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function G_(){const{userSelectionActive:t,userSelectionRect:r}=gt(Q_,Ot);return t&&r?P.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}const ff=(t,r)=>i=>{i.target===r.current&&(t==null||t(i))},Z_=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function J_({isSelecting:t,selectionKeyPressed:r,selectionMode:i=Pa.Full,panOnDrag:a,paneClickDistance:u,selectionOnDrag:f,onSelectionStart:d,onSelectionEnd:g,onPaneClick:v,onPaneContextMenu:w,onPaneScroll:S,onPaneMouseEnter:x,onPaneMouseMove:b,onPaneMouseLeave:N,children:C}){const A=It(),{userSelectionActive:T,elementsSelectable:$,dragging:H,connectionInProgress:M}=gt(Z_,Ot),R=$&&(t||T),X=de.useRef(null),V=de.useRef(),U=de.useRef(new Set),le=de.useRef(new Set),he=de.useRef(!1),Se=L=>{if(he.current||M){he.current=!1;return}v==null||v(L),A.getState().resetSelectedElements(),A.setState({nodesSelectionActive:!1})},W=L=>{if(Array.isArray(a)&&(a!=null&&a.includes(2))){L.preventDefault();return}w==null||w(L)},ue=S?L=>S(L):void 0,xe=L=>{he.current&&(L.stopPropagation(),he.current=!1)},D=L=>{var $e,Ie;const{domNode:F}=A.getState();if(V.current=F==null?void 0:F.getBoundingClientRect(),!V.current)return;const Q=L.target===X.current;if(!Q&&!!L.target.closest(".nokey")||!t||!(f&&Q||r)||L.button!==0||!L.isPrimary)return;(Ie=($e=L.target)==null?void 0:$e.setPointerCapture)==null||Ie.call($e,L.pointerId),he.current=!1;const{x:be,y:_e}=$r(L.nativeEvent,V.current);A.setState({userSelectionRect:{width:0,height:0,startX:be,startY:_e,x:be,y:_e}}),Q||(L.stopPropagation(),L.preventDefault())},ce=L=>{const{userSelectionRect:F,transform:Q,nodeLookup:O,edgeLookup:B,connectionLookup:be,triggerNodeChanges:_e,triggerEdgeChanges:$e,defaultEdgeOptions:Ie,resetSelectedElements:ze}=A.getState();if(!V.current||!F)return;const{x:we,y:Le}=$r(L.nativeEvent,V.current),{startX:ke,startY:Je}=F;if(!he.current){const lt=r?0:u;if(Math.hypot(we-ke,Le-Je)<=lt)return;ze(),d==null||d(L)}he.current=!0;const Oe={startX:ke,startY:Je,x:we<ke?we:ke,y:Le<Je?Le:Je,width:Math.abs(we-ke),height:Math.abs(Le-Je)},Ye=U.current,et=le.current;U.current=new Set(Hf(O,Oe,Q,i===Pa.Partial,!0).map(lt=>lt.id)),le.current=new Set;const ft=(Ie==null?void 0:Ie.selectable)??!0;for(const lt of U.current){const kt=be.get(lt);if(kt)for(const{edgeId:dn}of kt.values()){const on=B.get(dn);on&&(on.selectable??ft)&&le.current.add(dn)}}if(!vh(Ye,U.current)){const lt=Es(O,U.current,!0);_e(lt)}if(!vh(et,le.current)){const lt=Es(B,le.current);$e(lt)}A.setState({userSelectionRect:Oe,userSelectionActive:!0,nodesSelectionActive:!1})},te=L=>{var F,Q;L.button===0&&((Q=(F=L.target)==null?void 0:F.releasePointerCapture)==null||Q.call(F,L.pointerId),!T&&L.target===X.current&&A.getState().userSelectionRect&&(Se==null||Se(L)),A.setState({userSelectionActive:!1,userSelectionRect:null}),he.current&&(g==null||g(L),A.setState({nodesSelectionActive:U.current.size>0})))},ae=a===!0||Array.isArray(a)&&a.includes(0);return P.jsxs("div",{className:qt(["react-flow__pane",{draggable:ae,dragging:H,selection:t}]),onClick:R?void 0:ff(Se,X),onContextMenu:ff(W,X),onWheel:ff(ue,X),onPointerEnter:R?void 0:x,onPointerMove:R?ce:b,onPointerUp:R?te:void 0,onPointerDownCapture:R?D:void 0,onClickCapture:R?xe:void 0,onPointerLeave:N,ref:X,style:Mu,children:[C,P.jsx(G_,{})]})}function If({id:t,store:r,unselect:i=!1,nodeRef:a}){const{addSelectedNodes:u,unselectNodesAndEdges:f,multiSelectionActive:d,nodeLookup:g,onError:v}=r.getState(),w=g.get(t);if(!w){v==null||v("012",Zr.error012(t));return}r.setState({nodesSelectionActive:!1}),w.selected?(i||w.selected&&d)&&(f({nodes:[w],edges:[]}),requestAnimationFrame(()=>{var S;return(S=a==null?void 0:a.current)==null?void 0:S.blur()})):u([t])}function Mg({nodeRef:t,disabled:r=!1,noDragClassName:i,handleSelector:a,nodeId:u,isSelectable:f,nodeClickDistance:d}){const g=It(),[v,w]=de.useState(!1),S=de.useRef();return de.useEffect(()=>{S.current=B1({getStoreItems:()=>g.getState(),onNodeMouseDown:x=>{If({id:x,store:g,nodeRef:t})},onDragStart:()=>{w(!0)},onDragStop:()=>{w(!1)}})},[]),de.useEffect(()=>{if(!(r||!t.current||!S.current))return S.current.update({noDragClassName:i,handleSelector:a,domNode:t.current,isSelectable:f,nodeId:u,nodeClickDistance:d}),()=>{var x;(x=S.current)==null||x.destroy()}},[i,a,r,f,t,u,d]),v}const eS=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function Tg(){const t=It();return de.useCallback(i=>{const{nodeExtent:a,snapToGrid:u,snapGrid:f,nodesDraggable:d,onError:g,updateNodePositions:v,nodeLookup:w,nodeOrigin:S}=t.getState(),x=new Map,b=eS(d),N=u?f[0]:5,C=u?f[1]:5,A=i.direction.x*N*i.factor,T=i.direction.y*C*i.factor;for(const[,$]of w){if(!b($))continue;let H={x:$.internals.positionAbsolute.x+A,y:$.internals.positionAbsolute.y+T};u&&(H=za(H,f));const{position:M,positionAbsolute:R}=Xm({nodeId:$.id,nextPosition:H,nodeLookup:w,nodeExtent:a,nodeOrigin:S,onError:g});$.position=M,$.internals.positionAbsolute=R,x.set($.id,$)}v(x)},[])}const Gf=de.createContext(null),tS=Gf.Provider;Gf.Consumer;const Ig=()=>de.useContext(Gf),nS=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),rS=(t,r,i)=>a=>{const{connectionClickStartHandle:u,connectionMode:f,connection:d}=a,{fromHandle:g,toHandle:v,isValid:w}=d,S=(v==null?void 0:v.nodeId)===t&&(v==null?void 0:v.id)===r&&(v==null?void 0:v.type)===i;return{connectingFrom:(g==null?void 0:g.nodeId)===t&&(g==null?void 0:g.id)===r&&(g==null?void 0:g.type)===i,connectingTo:S,clickConnecting:(u==null?void 0:u.nodeId)===t&&(u==null?void 0:u.id)===r&&(u==null?void 0:u.type)===i,isPossibleEndHandle:f===Ms.Strict?(g==null?void 0:g.type)!==i:t!==(g==null?void 0:g.nodeId)||r!==(g==null?void 0:g.id),connectionInProcess:!!g,clickConnectionInProcess:!!u,valid:S&&w}};function oS({type:t="source",position:r=Ge.Top,isValidConnection:i,isConnectable:a=!0,isConnectableStart:u=!0,isConnectableEnd:f=!0,id:d,onConnect:g,children:v,className:w,onMouseDown:S,onTouchStart:x,...b},N){var ce,te;const C=d||null,A=t==="target",T=It(),$=Ig(),{connectOnClick:H,noPanClassName:M,rfId:R}=gt(nS,Ot),{connectingFrom:X,connectingTo:V,clickConnecting:U,isPossibleEndHandle:le,connectionInProcess:he,clickConnectionInProcess:Se,valid:W}=gt(rS($,C,t),Ot);$||(te=(ce=T.getState()).onError)==null||te.call(ce,"010",Zr.error010());const ue=ae=>{const{defaultEdgeOptions:L,onConnect:F,hasDefaultEdges:Q}=T.getState(),O={...L,...ae};if(Q){const{edges:B,setEdges:be}=T.getState();be(ag(O,B))}F==null||F(O),g==null||g(O)},xe=ae=>{if(!$)return;const L=rg(ae.nativeEvent);if(u&&(L&&ae.button===0||!L)){const F=T.getState();Mf.onPointerDown(ae.nativeEvent,{handleDomNode:ae.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:A,handleId:C,nodeId:$,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:(...Q)=>{var O,B;return(B=(O=T.getState()).onConnectEnd)==null?void 0:B.call(O,...Q)},updateConnection:F.updateConnection,onConnect:ue,isValidConnection:i||((...Q)=>{var O,B;return((B=(O=T.getState()).isValidConnection)==null?void 0:B.call(O,...Q))??!0}),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}L?S==null||S(ae):x==null||x(ae)},D=ae=>{const{onClickConnectStart:L,onClickConnectEnd:F,connectionClickStartHandle:Q,connectionMode:O,isValidConnection:B,lib:be,rfId:_e,nodeLookup:$e,connection:Ie}=T.getState();if(!$||!Q&&!u)return;if(!Q){L==null||L(ae.nativeEvent,{nodeId:$,handleId:C,handleType:t}),T.setState({connectionClickStartHandle:{nodeId:$,type:t,id:C}});return}const ze=tg(ae.target),we=i||B,{connection:Le,isValid:ke}=Mf.isValid(ae.nativeEvent,{handle:{nodeId:$,id:C,type:t},connectionMode:O,fromNodeId:Q.nodeId,fromHandleId:Q.id||null,fromType:Q.type,isValidConnection:we,flowId:_e,doc:ze,lib:be,nodeLookup:$e});ke&&Le&&ue(Le);const Je=structuredClone(Ie);delete Je.inProgress,Je.toPosition=Je.toHandle?Je.toHandle.position:null,F==null||F(ae,Je),T.setState({connectionClickStartHandle:null})};return P.jsx("div",{"data-handleid":C,"data-nodeid":$,"data-handlepos":r,"data-id":`${R}-${$}-${C}-${t}`,className:qt(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",M,w,{source:!A,target:A,connectable:a,connectablestart:u,connectableend:f,clickconnecting:U,connectingfrom:X,connectingto:V,valid:W,connectionindicator:a&&(!he||le)&&(he||Se?f:u)}]),onMouseDown:xe,onTouchStart:xe,onClick:H?D:void 0,ref:N,...b,children:v})}const Os=de.memo(Pg(oS));function iS({data:t,isConnectable:r,sourcePosition:i=Ge.Bottom}){return P.jsxs(P.Fragment,{children:[t==null?void 0:t.label,P.jsx(Os,{type:"source",position:i,isConnectable:r})]})}function sS({data:t,isConnectable:r,targetPosition:i=Ge.Top,sourcePosition:a=Ge.Bottom}){return P.jsxs(P.Fragment,{children:[P.jsx(Os,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label,P.jsx(Os,{type:"source",position:a,isConnectable:r})]})}function aS(){return null}function lS({data:t,isConnectable:r,targetPosition:i=Ge.Top}){return P.jsxs(P.Fragment,{children:[P.jsx(Os,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label]})}const gu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Yh={input:iS,default:sS,output:lS,group:aS};function uS(t){var r,i,a,u;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((r=t.style)==null?void 0:r.width),height:t.height??t.initialHeight??((i=t.style)==null?void 0:i.height)}:{width:t.width??((a=t.style)==null?void 0:a.width),height:t.height??((u=t.style)==null?void 0:u.height)}}const cS=t=>{const{width:r,height:i,x:a,y:u}=Ra(t.nodeLookup,{filter:f=>!!f.selected});return{width:Ar(r)?r:null,height:Ar(i)?i:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${a}px,${u}px)`}};function fS({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:i}){const a=It(),{width:u,height:f,transformString:d,userSelectionActive:g}=gt(cS,Ot),v=Tg(),w=de.useRef(null);de.useEffect(()=>{var N;i||(N=w.current)==null||N.focus({preventScroll:!0})},[i]);const S=!g&&u!==null&&f!==null;if(Mg({nodeRef:w,disabled:!S}),!S)return null;const x=t?N=>{const C=a.getState().nodes.filter(A=>A.selected);t(N,C)}:void 0,b=N=>{Object.prototype.hasOwnProperty.call(gu,N.key)&&(N.preventDefault(),v({direction:gu[N.key],factor:N.shiftKey?4:1}))};return P.jsx("div",{className:qt(["react-flow__nodesselection","react-flow__container",r]),style:{transform:d},children:P.jsx("div",{ref:w,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:i?void 0:-1,onKeyDown:i?void 0:b,style:{width:u,height:f}})})}const Xh=typeof window<"u"?window:void 0,dS=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function Ag({children:t,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:d,paneClickDistance:g,deleteKeyCode:v,selectionKeyCode:w,selectionOnDrag:S,selectionMode:x,onSelectionStart:b,onSelectionEnd:N,multiSelectionKeyCode:C,panActivationKeyCode:A,zoomActivationKeyCode:T,elementsSelectable:$,zoomOnScroll:H,zoomOnPinch:M,panOnScroll:R,panOnScrollSpeed:X,panOnScrollMode:V,zoomOnDoubleClick:U,panOnDrag:le,defaultViewport:he,translateExtent:Se,minZoom:W,maxZoom:ue,preventScrolling:xe,onSelectionContextMenu:D,noWheelClassName:ce,noPanClassName:te,disableKeyboardA11y:ae,onViewportChange:L,isControlledViewport:F}){const{nodesSelectionActive:Q,userSelectionActive:O}=gt(dS,Ot),B=Ta(w,{target:Xh}),be=Ta(A,{target:Xh}),_e=be||le,$e=be||R,Ie=S&&_e!==!0,ze=B||O||Ie;return q_({deleteKeyCode:v,multiSelectionKeyCode:C}),P.jsx(X_,{onPaneContextMenu:f,elementsSelectable:$,zoomOnScroll:H,zoomOnPinch:M,panOnScroll:$e,panOnScrollSpeed:X,panOnScrollMode:V,zoomOnDoubleClick:U,panOnDrag:!B&&_e,defaultViewport:he,translateExtent:Se,minZoom:W,maxZoom:ue,zoomActivationKeyCode:T,preventScrolling:xe,noWheelClassName:ce,noPanClassName:te,onViewportChange:L,isControlledViewport:F,paneClickDistance:g,selectionOnDrag:Ie,children:P.jsxs(J_,{onSelectionStart:b,onSelectionEnd:N,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:d,panOnDrag:_e,isSelecting:!!ze,selectionMode:x,selectionKeyPressed:B,paneClickDistance:g,selectionOnDrag:Ie,children:[t,Q&&P.jsx(fS,{onSelectionContextMenu:D,noPanClassName:te,disableKeyboardA11y:ae})]})})}Ag.displayName="FlowRenderer";const pS=de.memo(Ag),hS=t=>r=>t?Hf(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(i=>i.id):Array.from(r.nodeLookup.keys());function mS(t){return gt(de.useCallback(hS(t),[t]),Ot)}const gS=t=>t.updateNodeInternals;function yS(){const t=gt(gS),[r]=de.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const a=new Map;i.forEach(u=>{const f=u.target.getAttribute("data-id");a.set(f,{id:f,nodeElement:u.target,force:!0})}),t(a)}));return de.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function vS({node:t,nodeType:r,hasDimensions:i,resizeObserver:a}){const u=It(),f=de.useRef(null),d=de.useRef(null),g=de.useRef(t.sourcePosition),v=de.useRef(t.targetPosition),w=de.useRef(r),S=i&&!!t.internals.handleBounds;return de.useEffect(()=>{f.current&&!t.hidden&&(!S||d.current!==f.current)&&(d.current&&(a==null||a.unobserve(d.current)),a==null||a.observe(f.current),d.current=f.current)},[S,t.hidden]),de.useEffect(()=>()=>{d.current&&(a==null||a.unobserve(d.current),d.current=null)},[]),de.useEffect(()=>{if(f.current){const x=w.current!==r,b=g.current!==t.sourcePosition,N=v.current!==t.targetPosition;(x||b||N)&&(w.current=r,g.current=t.sourcePosition,v.current=t.targetPosition,u.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:f.current,force:!0}]])))}},[t.id,r,t.sourcePosition,t.targetPosition]),f}function xS({id:t,onClick:r,onMouseEnter:i,onMouseMove:a,onMouseLeave:u,onContextMenu:f,onDoubleClick:d,nodesDraggable:g,elementsSelectable:v,nodesConnectable:w,nodesFocusable:S,resizeObserver:x,noDragClassName:b,noPanClassName:N,disableKeyboardA11y:C,rfId:A,nodeTypes:T,nodeClickDistance:$,onError:H}){const{node:M,internals:R,isParent:X}=gt(we=>{const Le=we.nodeLookup.get(t),ke=we.parentLookup.has(t);return{node:Le,internals:Le.internals,isParent:ke}},Ot);let V=M.type||"default",U=(T==null?void 0:T[V])||Yh[V];U===void 0&&(H==null||H("003",Zr.error003(V)),V="default",U=(T==null?void 0:T.default)||Yh.default);const le=!!(M.draggable||g&&typeof M.draggable>"u"),he=!!(M.selectable||v&&typeof M.selectable>"u"),Se=!!(M.connectable||w&&typeof M.connectable>"u"),W=!!(M.focusable||S&&typeof M.focusable>"u"),ue=It(),xe=Jm(M),D=vS({node:M,nodeType:V,hasDimensions:xe,resizeObserver:x}),ce=Mg({nodeRef:D,disabled:M.hidden||!le,noDragClassName:b,handleSelector:M.dragHandle,nodeId:t,isSelectable:he,nodeClickDistance:$}),te=Tg();if(M.hidden)return null;const ae=Mo(M),L=uS(M),F=he||le||r||i||a||u,Q=i?we=>i(we,{...R.userNode}):void 0,O=a?we=>a(we,{...R.userNode}):void 0,B=u?we=>u(we,{...R.userNode}):void 0,be=f?we=>f(we,{...R.userNode}):void 0,_e=d?we=>d(we,{...R.userNode}):void 0,$e=we=>{const{selectNodesOnDrag:Le,nodeDragThreshold:ke}=ue.getState();he&&(!Le||!le||ke>0)&&If({id:t,store:ue,nodeRef:D}),r&&r(we,{...R.userNode})},Ie=we=>{if(!(ng(we.nativeEvent)||C)){if(Km.includes(we.key)&&he){const Le=we.key==="Escape";If({id:t,store:ue,unselect:Le,nodeRef:D})}else if(le&&M.selected&&Object.prototype.hasOwnProperty.call(gu,we.key)){we.preventDefault();const{ariaLabelConfig:Le}=ue.getState();ue.setState({ariaLiveMessage:Le["node.a11yDescription.ariaLiveMessage"]({direction:we.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),te({direction:gu[we.key],factor:we.shiftKey?4:1})}}},ze=()=>{var et;if(C||!((et=D.current)!=null&&et.matches(":focus-visible")))return;const{transform:we,width:Le,height:ke,autoPanOnNodeFocus:Je,setCenter:Oe}=ue.getState();if(!Je)return;Hf(new Map([[t,M]]),{x:0,y:0,width:Le,height:ke},we,!0).length>0||Oe(M.position.x+ae.width/2,M.position.y+ae.height/2,{zoom:we[2]})};return P.jsx("div",{className:qt(["react-flow__node",`react-flow__node-${V}`,{[N]:le},M.className,{selected:M.selected,selectable:he,parent:X,draggable:le,dragging:ce}]),ref:D,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:xe?"visible":"hidden",...M.style,...L},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:Q,onMouseMove:O,onMouseLeave:B,onContextMenu:be,onClick:$e,onDoubleClick:_e,onKeyDown:W?Ie:void 0,tabIndex:W?0:void 0,onFocus:W?ze:void 0,role:M.ariaRole??(W?"group":void 0),"aria-roledescription":"node","aria-describedby":C?void 0:`${Sg}-${A}`,"aria-label":M.ariaLabel,...M.domAttributes,children:P.jsx(tS,{value:t,children:P.jsx(U,{id:t,data:M.data,type:V,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:M.selected??!1,selectable:he,draggable:le,deletable:M.deletable??!0,isConnectable:Se,sourcePosition:M.sourcePosition,targetPosition:M.targetPosition,dragging:ce,dragHandle:M.dragHandle,zIndex:R.z,parentId:M.parentId,...ae})})})}var wS=de.memo(xS);const _S=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function $g(t){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:a,elementsSelectable:u,onError:f}=gt(_S,Ot),d=mS(t.onlyRenderVisibleElements),g=yS();return P.jsx("div",{className:"react-flow__nodes",style:Mu,children:d.map(v=>P.jsx(wS,{id:v,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:g,nodesDraggable:r,nodesConnectable:i,nodesFocusable:a,elementsSelectable:u,nodeClickDistance:t.nodeClickDistance,onError:f},v))})}$g.displayName="NodeRenderer";const SS=de.memo($g);function bS(t){return gt(de.useCallback(i=>{if(!t)return i.edges.map(u=>u.id);const a=[];if(i.width&&i.height)for(const u of i.edges){const f=i.nodeLookup.get(u.source),d=i.nodeLookup.get(u.target);f&&d&&b1({sourceNode:f,targetNode:d,width:i.width,height:i.height,transform:i.transform})&&a.push(u.id)}return a},[t]),Ot)}const kS=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t}};return P.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},ES=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t,fill:t}};return P.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Qh={[pu.Arrow]:kS,[pu.ArrowClosed]:ES};function NS(t){const r=It();return de.useMemo(()=>{var u,f;return Object.prototype.hasOwnProperty.call(Qh,t)?Qh[t]:((f=(u=r.getState()).onError)==null||f.call(u,"009",Zr.error009(t)),null)},[t])}const CS=({id:t,type:r,color:i,width:a=12.5,height:u=12.5,markerUnits:f="strokeWidth",strokeWidth:d,orient:g="auto-start-reverse"})=>{const v=NS(r);return v?P.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${a}`,markerHeight:`${u}`,viewBox:"-10 -10 20 20",markerUnits:f,orient:g,refX:"0",refY:"0",children:P.jsx(v,{color:i,strokeWidth:d})}):null},Og=({defaultColor:t,rfId:r})=>{const i=gt(f=>f.edges),a=gt(f=>f.defaultEdgeOptions),u=de.useMemo(()=>M1(i,{id:r,defaultColor:t,defaultMarkerStart:a==null?void 0:a.markerStart,defaultMarkerEnd:a==null?void 0:a.markerEnd}),[i,a,r,t]);return u.length?P.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:P.jsx("defs",{children:u.map(f=>P.jsx(CS,{id:f.id,type:f.type,color:f.color,width:f.width,height:f.height,markerUnits:f.markerUnits,strokeWidth:f.strokeWidth,orient:f.orient},f.id))})}):null};Og.displayName="MarkerDefinitions";var PS=de.memo(Og);function Rg({x:t,y:r,label:i,labelStyle:a,labelShowBg:u=!0,labelBgStyle:f,labelBgPadding:d=[2,4],labelBgBorderRadius:g=2,children:v,className:w,...S}){const[x,b]=de.useState({x:1,y:0,width:0,height:0}),N=qt(["react-flow__edge-textwrapper",w]),C=de.useRef(null);return de.useEffect(()=>{if(C.current){const A=C.current.getBBox();b({x:A.x,y:A.y,width:A.width,height:A.height})}},[i]),i?P.jsxs("g",{transform:`translate(${t-x.width/2} ${r-x.height/2})`,className:N,visibility:x.width?"visible":"hidden",...S,children:[u&&P.jsx("rect",{width:x.width+2*d[0],x:-d[0],y:-d[1],height:x.height+2*d[1],className:"react-flow__edge-textbg",style:f,rx:g,ry:g}),P.jsx("text",{className:"react-flow__edge-text",y:x.height/2,dy:"0.3em",ref:C,style:a,children:i}),v]}):null}Rg.displayName="EdgeText";const jS=de.memo(Rg);function Tu({path:t,labelX:r,labelY:i,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,interactionWidth:w=20,...S}){return P.jsxs(P.Fragment,{children:[P.jsx("path",{...S,d:t,fill:"none",className:qt(["react-flow__edge-path",S.className])}),w?P.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:w,className:"react-flow__edge-interaction"}):null,a&&Ar(r)&&Ar(i)?P.jsx(jS,{x:r,y:i,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v}):null]})}function Gh({pos:t,x1:r,y1:i,x2:a,y2:u}){return t===Ge.Left||t===Ge.Right?[.5*(r+a),i]:[r,.5*(i+u)]}function zg({sourceX:t,sourceY:r,sourcePosition:i=Ge.Bottom,targetX:a,targetY:u,targetPosition:f=Ge.Top}){const[d,g]=Gh({pos:i,x1:t,y1:r,x2:a,y2:u}),[v,w]=Gh({pos:f,x1:a,y1:u,x2:t,y2:r}),[S,x,b,N]=og({sourceX:t,sourceY:r,targetX:a,targetY:u,sourceControlX:d,sourceControlY:g,targetControlX:v,targetControlY:w});return[`M${t},${r} C${d},${g} ${v},${w} ${a},${u}`,S,x,b,N]}function Dg(t){return de.memo(({id:r,sourceX:i,sourceY:a,targetX:u,targetY:f,sourcePosition:d,targetPosition:g,label:v,labelStyle:w,labelShowBg:S,labelBgStyle:x,labelBgPadding:b,labelBgBorderRadius:N,style:C,markerEnd:A,markerStart:T,interactionWidth:$})=>{const[H,M,R]=zg({sourceX:i,sourceY:a,sourcePosition:d,targetX:u,targetY:f,targetPosition:g}),X=t.isInternal?void 0:r;return P.jsx(Tu,{id:X,path:H,labelX:M,labelY:R,label:v,labelStyle:w,labelShowBg:S,labelBgStyle:x,labelBgPadding:b,labelBgBorderRadius:N,style:C,markerEnd:A,markerStart:T,interactionWidth:$})})}const MS=Dg({isInternal:!1}),Lg=Dg({isInternal:!0});MS.displayName="SimpleBezierEdge";Lg.displayName="SimpleBezierEdgeInternal";function Fg(t){return de.memo(({id:r,sourceX:i,sourceY:a,targetX:u,targetY:f,label:d,labelStyle:g,labelShowBg:v,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:x,style:b,sourcePosition:N=Ge.Bottom,targetPosition:C=Ge.Top,markerEnd:A,markerStart:T,pathOptions:$,interactionWidth:H})=>{const[M,R,X]=Cf({sourceX:i,sourceY:a,sourcePosition:N,targetX:u,targetY:f,targetPosition:C,borderRadius:$==null?void 0:$.borderRadius,offset:$==null?void 0:$.offset,stepPosition:$==null?void 0:$.stepPosition}),V=t.isInternal?void 0:r;return P.jsx(Tu,{id:V,path:M,labelX:R,labelY:X,label:d,labelStyle:g,labelShowBg:v,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:x,style:b,markerEnd:A,markerStart:T,interactionWidth:H})})}const Bg=Fg({isInternal:!1}),Hg=Fg({isInternal:!0});Bg.displayName="SmoothStepEdge";Hg.displayName="SmoothStepEdgeInternal";function Vg(t){return de.memo(({id:r,...i})=>{var u;const a=t.isInternal?void 0:r;return P.jsx(Bg,{...i,id:a,pathOptions:de.useMemo(()=>{var f;return{borderRadius:0,offset:(f=i.pathOptions)==null?void 0:f.offset}},[(u=i.pathOptions)==null?void 0:u.offset])})})}const TS=Vg({isInternal:!1}),Kg=Vg({isInternal:!0});TS.displayName="StepEdge";Kg.displayName="StepEdgeInternal";function Ug(t){return de.memo(({id:r,sourceX:i,sourceY:a,targetX:u,targetY:f,label:d,labelStyle:g,labelShowBg:v,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:x,style:b,markerEnd:N,markerStart:C,interactionWidth:A})=>{const[T,$,H]=lg({sourceX:i,sourceY:a,targetX:u,targetY:f}),M=t.isInternal?void 0:r;return P.jsx(Tu,{id:M,path:T,labelX:$,labelY:H,label:d,labelStyle:g,labelShowBg:v,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:x,style:b,markerEnd:N,markerStart:C,interactionWidth:A})})}const IS=Ug({isInternal:!1}),qg=Ug({isInternal:!0});IS.displayName="StraightEdge";qg.displayName="StraightEdgeInternal";function Wg(t){return de.memo(({id:r,sourceX:i,sourceY:a,targetX:u,targetY:f,sourcePosition:d=Ge.Bottom,targetPosition:g=Ge.Top,label:v,labelStyle:w,labelShowBg:S,labelBgStyle:x,labelBgPadding:b,labelBgBorderRadius:N,style:C,markerEnd:A,markerStart:T,pathOptions:$,interactionWidth:H})=>{const[M,R,X]=ig({sourceX:i,sourceY:a,sourcePosition:d,targetX:u,targetY:f,targetPosition:g,curvature:$==null?void 0:$.curvature}),V=t.isInternal?void 0:r;return P.jsx(Tu,{id:V,path:M,labelX:R,labelY:X,label:v,labelStyle:w,labelShowBg:S,labelBgStyle:x,labelBgPadding:b,labelBgBorderRadius:N,style:C,markerEnd:A,markerStart:T,interactionWidth:H})})}const AS=Wg({isInternal:!1}),Yg=Wg({isInternal:!0});AS.displayName="BezierEdge";Yg.displayName="BezierEdgeInternal";const Zh={default:Yg,straight:qg,step:Kg,smoothstep:Hg,simplebezier:Lg},Jh={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},$S=(t,r,i)=>i===Ge.Left?t-r:i===Ge.Right?t+r:t,OS=(t,r,i)=>i===Ge.Top?t-r:i===Ge.Bottom?t+r:t,em="react-flow__edgeupdater";function tm({position:t,centerX:r,centerY:i,radius:a=10,onMouseDown:u,onMouseEnter:f,onMouseOut:d,type:g}){return P.jsx("circle",{onMouseDown:u,onMouseEnter:f,onMouseOut:d,className:qt([em,`${em}-${g}`]),cx:$S(r,a,t),cy:OS(i,a,t),r:a,stroke:"transparent",fill:"transparent"})}function RS({isReconnectable:t,reconnectRadius:r,edge:i,sourceX:a,sourceY:u,targetX:f,targetY:d,sourcePosition:g,targetPosition:v,onReconnect:w,onReconnectStart:S,onReconnectEnd:x,setReconnecting:b,setUpdateHover:N}){const C=It(),A=(R,X)=>{if(R.button!==0)return;const{autoPanOnConnect:V,domNode:U,connectionMode:le,connectionRadius:he,lib:Se,onConnectStart:W,cancelConnection:ue,nodeLookup:xe,rfId:D,panBy:ce,updateConnection:te}=C.getState(),ae=X.type==="target",L=(O,B)=>{b(!1),x==null||x(O,i,X.type,B)},F=O=>w==null?void 0:w(i,O),Q=(O,B)=>{b(!0),S==null||S(R,i,X.type),W==null||W(O,B)};Mf.onPointerDown(R.nativeEvent,{autoPanOnConnect:V,connectionMode:le,connectionRadius:he,domNode:U,handleId:X.id,nodeId:X.nodeId,nodeLookup:xe,isTarget:ae,edgeUpdaterType:X.type,lib:Se,flowId:D,cancelConnection:ue,panBy:ce,isValidConnection:(...O)=>{var B,be;return((be=(B=C.getState()).isValidConnection)==null?void 0:be.call(B,...O))??!0},onConnect:F,onConnectStart:Q,onConnectEnd:(...O)=>{var B,be;return(be=(B=C.getState()).onConnectEnd)==null?void 0:be.call(B,...O)},onReconnectEnd:L,updateConnection:te,getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,dragThreshold:C.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},T=R=>A(R,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),$=R=>A(R,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),H=()=>N(!0),M=()=>N(!1);return P.jsxs(P.Fragment,{children:[(t===!0||t==="source")&&P.jsx(tm,{position:g,centerX:a,centerY:u,radius:r,onMouseDown:T,onMouseEnter:H,onMouseOut:M,type:"source"}),(t===!0||t==="target")&&P.jsx(tm,{position:v,centerX:f,centerY:d,radius:r,onMouseDown:$,onMouseEnter:H,onMouseOut:M,type:"target"})]})}function zS({id:t,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:a,onClick:u,onDoubleClick:f,onContextMenu:d,onMouseEnter:g,onMouseMove:v,onMouseLeave:w,reconnectRadius:S,onReconnect:x,onReconnectStart:b,onReconnectEnd:N,rfId:C,edgeTypes:A,noPanClassName:T,onError:$,disableKeyboardA11y:H}){let M=gt(Oe=>Oe.edgeLookup.get(t));const R=gt(Oe=>Oe.defaultEdgeOptions);M=R?{...R,...M}:M;let X=M.type||"default",V=(A==null?void 0:A[X])||Zh[X];V===void 0&&($==null||$("011",Zr.error011(X)),X="default",V=(A==null?void 0:A.default)||Zh.default);const U=!!(M.focusable||r&&typeof M.focusable>"u"),le=typeof x<"u"&&(M.reconnectable||i&&typeof M.reconnectable>"u"),he=!!(M.selectable||a&&typeof M.selectable>"u"),Se=de.useRef(null),[W,ue]=de.useState(!1),[xe,D]=de.useState(!1),ce=It(),{zIndex:te,sourceX:ae,sourceY:L,targetX:F,targetY:Q,sourcePosition:O,targetPosition:B}=gt(de.useCallback(Oe=>{const Ye=Oe.nodeLookup.get(M.source),et=Oe.nodeLookup.get(M.target);if(!Ye||!et)return{zIndex:M.zIndex,...Jh};const ft=j1({id:t,sourceNode:Ye,targetNode:et,sourceHandle:M.sourceHandle||null,targetHandle:M.targetHandle||null,connectionMode:Oe.connectionMode,onError:$});return{zIndex:S1({selected:M.selected,zIndex:M.zIndex,sourceNode:Ye,targetNode:et,elevateOnSelect:Oe.elevateEdgesOnSelect,zIndexMode:Oe.zIndexMode}),...ft||Jh}},[M.source,M.target,M.sourceHandle,M.targetHandle,M.selected,M.zIndex]),Ot),be=de.useMemo(()=>M.markerStart?`url('#${Pf(M.markerStart,C)}')`:void 0,[M.markerStart,C]),_e=de.useMemo(()=>M.markerEnd?`url('#${Pf(M.markerEnd,C)}')`:void 0,[M.markerEnd,C]);if(M.hidden||ae===null||L===null||F===null||Q===null)return null;const $e=Oe=>{var lt;const{addSelectedEdges:Ye,unselectNodesAndEdges:et,multiSelectionActive:ft}=ce.getState();he&&(ce.setState({nodesSelectionActive:!1}),M.selected&&ft?(et({nodes:[],edges:[M]}),(lt=Se.current)==null||lt.blur()):Ye([t])),u&&u(Oe,M)},Ie=f?Oe=>{f(Oe,{...M})}:void 0,ze=d?Oe=>{d(Oe,{...M})}:void 0,we=g?Oe=>{g(Oe,{...M})}:void 0,Le=v?Oe=>{v(Oe,{...M})}:void 0,ke=w?Oe=>{w(Oe,{...M})}:void 0,Je=Oe=>{var Ye;if(!H&&Km.includes(Oe.key)&&he){const{unselectNodesAndEdges:et,addSelectedEdges:ft}=ce.getState();Oe.key==="Escape"?((Ye=Se.current)==null||Ye.blur(),et({edges:[M]})):ft([t])}};return P.jsx("svg",{style:{zIndex:te},children:P.jsxs("g",{className:qt(["react-flow__edge",`react-flow__edge-${X}`,M.className,T,{selected:M.selected,animated:M.animated,inactive:!he&&!u,updating:W,selectable:he}]),onClick:$e,onDoubleClick:Ie,onContextMenu:ze,onMouseEnter:we,onMouseMove:Le,onMouseLeave:ke,onKeyDown:U?Je:void 0,tabIndex:U?0:void 0,role:M.ariaRole??(U?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":M.ariaLabel===null?void 0:M.ariaLabel||`Edge from ${M.source} to ${M.target}`,"aria-describedby":U?`${bg}-${C}`:void 0,ref:Se,...M.domAttributes,children:[!xe&&P.jsx(V,{id:t,source:M.source,target:M.target,type:M.type,selected:M.selected,animated:M.animated,selectable:he,deletable:M.deletable??!0,label:M.label,labelStyle:M.labelStyle,labelShowBg:M.labelShowBg,labelBgStyle:M.labelBgStyle,labelBgPadding:M.labelBgPadding,labelBgBorderRadius:M.labelBgBorderRadius,sourceX:ae,sourceY:L,targetX:F,targetY:Q,sourcePosition:O,targetPosition:B,data:M.data,style:M.style,sourceHandleId:M.sourceHandle,targetHandleId:M.targetHandle,markerStart:be,markerEnd:_e,pathOptions:"pathOptions"in M?M.pathOptions:void 0,interactionWidth:M.interactionWidth}),le&&P.jsx(RS,{edge:M,isReconnectable:le,reconnectRadius:S,onReconnect:x,onReconnectStart:b,onReconnectEnd:N,sourceX:ae,sourceY:L,targetX:F,targetY:Q,sourcePosition:O,targetPosition:B,setUpdateHover:ue,setReconnecting:D})]})})}var DS=de.memo(zS);const LS=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function Xg({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:i,edgeTypes:a,noPanClassName:u,onReconnect:f,onEdgeContextMenu:d,onEdgeMouseEnter:g,onEdgeMouseMove:v,onEdgeMouseLeave:w,onEdgeClick:S,reconnectRadius:x,onEdgeDoubleClick:b,onReconnectStart:N,onReconnectEnd:C,disableKeyboardA11y:A}){const{edgesFocusable:T,edgesReconnectable:$,elementsSelectable:H,onError:M}=gt(LS,Ot),R=bS(r);return P.jsxs("div",{className:"react-flow__edges",children:[P.jsx(PS,{defaultColor:t,rfId:i}),R.map(X=>P.jsx(DS,{id:X,edgesFocusable:T,edgesReconnectable:$,elementsSelectable:H,noPanClassName:u,onReconnect:f,onContextMenu:d,onMouseEnter:g,onMouseMove:v,onMouseLeave:w,onClick:S,reconnectRadius:x,onDoubleClick:b,onReconnectStart:N,onReconnectEnd:C,rfId:i,onError:M,edgeTypes:a,disableKeyboardA11y:A},X))]})}Xg.displayName="EdgeRenderer";const FS=de.memo(Xg),BS=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function HS({children:t}){const r=gt(BS);return P.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function VS(t){const r=Qf(),i=de.useRef(!1);de.useEffect(()=>{!i.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),i.current=!0)},[t,r.viewportInitialized])}const KS=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function US(t){const r=gt(KS),i=It();return de.useEffect(()=>{t&&(r==null||r(t),i.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function qS(t){return t.connection.inProgress?{...t.connection,to:Da(t.connection.to,t.transform)}:{...t.connection}}function WS(t){return qS}function YS(t){const r=WS();return gt(r,Ot)}const XS=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function QS({containerStyle:t,style:r,type:i,component:a}){const{nodesConnectable:u,width:f,height:d,isValid:g,inProgress:v}=gt(XS,Ot);return!(f&&u&&v)?null:P.jsx("svg",{style:t,width:f,height:d,className:"react-flow__connectionline react-flow__container",children:P.jsx("g",{className:qt(["react-flow__connection",Wm(g)]),children:P.jsx(Qg,{style:r,type:i,CustomComponent:a,isValid:g})})})}const Qg=({style:t,type:r=si.Bezier,CustomComponent:i,isValid:a})=>{const{inProgress:u,from:f,fromNode:d,fromHandle:g,fromPosition:v,to:w,toNode:S,toHandle:x,toPosition:b,pointer:N}=YS();if(!u)return;if(i)return P.jsx(i,{connectionLineType:r,connectionLineStyle:t,fromNode:d,fromHandle:g,fromX:f.x,fromY:f.y,toX:w.x,toY:w.y,fromPosition:v,toPosition:b,connectionStatus:Wm(a),toNode:S,toHandle:x,pointer:N});let C="";const A={sourceX:f.x,sourceY:f.y,sourcePosition:v,targetX:w.x,targetY:w.y,targetPosition:b};switch(r){case si.Bezier:[C]=ig(A);break;case si.SimpleBezier:[C]=zg(A);break;case si.Step:[C]=Cf({...A,borderRadius:0});break;case si.SmoothStep:[C]=Cf(A);break;default:[C]=lg(A)}return P.jsx("path",{d:C,fill:"none",className:"react-flow__connection-path",style:t})};Qg.displayName="ConnectionLine";const GS={};function nm(t=GS){de.useRef(t),It(),de.useEffect(()=>{},[t])}function ZS(){It(),de.useRef(!1),de.useEffect(()=>{},[])}function Gg({nodeTypes:t,edgeTypes:r,onInit:i,onNodeClick:a,onEdgeClick:u,onNodeDoubleClick:f,onEdgeDoubleClick:d,onNodeMouseEnter:g,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:S,onSelectionContextMenu:x,onSelectionStart:b,onSelectionEnd:N,connectionLineType:C,connectionLineStyle:A,connectionLineComponent:T,connectionLineContainerStyle:$,selectionKeyCode:H,selectionOnDrag:M,selectionMode:R,multiSelectionKeyCode:X,panActivationKeyCode:V,zoomActivationKeyCode:U,deleteKeyCode:le,onlyRenderVisibleElements:he,elementsSelectable:Se,defaultViewport:W,translateExtent:ue,minZoom:xe,maxZoom:D,preventScrolling:ce,defaultMarkerColor:te,zoomOnScroll:ae,zoomOnPinch:L,panOnScroll:F,panOnScrollSpeed:Q,panOnScrollMode:O,zoomOnDoubleClick:B,panOnDrag:be,onPaneClick:_e,onPaneMouseEnter:$e,onPaneMouseMove:Ie,onPaneMouseLeave:ze,onPaneScroll:we,onPaneContextMenu:Le,paneClickDistance:ke,nodeClickDistance:Je,onEdgeContextMenu:Oe,onEdgeMouseEnter:Ye,onEdgeMouseMove:et,onEdgeMouseLeave:ft,reconnectRadius:lt,onReconnect:kt,onReconnectStart:dn,onReconnectEnd:on,noDragClassName:Wt,noWheelClassName:Nt,noPanClassName:jn,disableKeyboardA11y:pn,nodeExtent:Jn,rfId:Sn,viewport:Ct,onViewportChange:Yt}){return nm(t),nm(r),ZS(),VS(i),US(Ct),P.jsx(pS,{onPaneClick:_e,onPaneMouseEnter:$e,onPaneMouseMove:Ie,onPaneMouseLeave:ze,onPaneContextMenu:Le,onPaneScroll:we,paneClickDistance:ke,deleteKeyCode:le,selectionKeyCode:H,selectionOnDrag:M,selectionMode:R,onSelectionStart:b,onSelectionEnd:N,multiSelectionKeyCode:X,panActivationKeyCode:V,zoomActivationKeyCode:U,elementsSelectable:Se,zoomOnScroll:ae,zoomOnPinch:L,zoomOnDoubleClick:B,panOnScroll:F,panOnScrollSpeed:Q,panOnScrollMode:O,panOnDrag:be,defaultViewport:W,translateExtent:ue,minZoom:xe,maxZoom:D,onSelectionContextMenu:x,preventScrolling:ce,noDragClassName:Wt,noWheelClassName:Nt,noPanClassName:jn,disableKeyboardA11y:pn,onViewportChange:Yt,isControlledViewport:!!Ct,children:P.jsxs(HS,{children:[P.jsx(FS,{edgeTypes:r,onEdgeClick:u,onEdgeDoubleClick:d,onReconnect:kt,onReconnectStart:dn,onReconnectEnd:on,onlyRenderVisibleElements:he,onEdgeContextMenu:Oe,onEdgeMouseEnter:Ye,onEdgeMouseMove:et,onEdgeMouseLeave:ft,reconnectRadius:lt,defaultMarkerColor:te,noPanClassName:jn,disableKeyboardA11y:pn,rfId:Sn}),P.jsx(QS,{style:A,type:C,component:T,containerStyle:$}),P.jsx("div",{className:"react-flow__edgelabel-renderer"}),P.jsx(SS,{nodeTypes:t,onNodeClick:a,onNodeDoubleClick:f,onNodeMouseEnter:g,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:S,nodeClickDistance:Je,onlyRenderVisibleElements:he,noPanClassName:jn,noDragClassName:Wt,disableKeyboardA11y:pn,nodeExtent:Jn,rfId:Sn}),P.jsx("div",{className:"react-flow__viewport-portal"})]})})}Gg.displayName="GraphView";const JS=de.memo(Gg),rm=({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,width:u,height:f,fitView:d,fitViewOptions:g,minZoom:v=.5,maxZoom:w=2,nodeOrigin:S,nodeExtent:x,zIndexMode:b="basic"}={})=>{const N=new Map,C=new Map,A=new Map,T=new Map,$=a??r??[],H=i??t??[],M=S??[0,0],R=x??Ca;fg(A,T,$);const{nodesInitialized:X}=jf(H,N,C,{nodeOrigin:M,nodeExtent:R,zIndexMode:b});let V=[0,0,1];if(d&&u&&f){const U=Ra(N,{filter:W=>!!((W.width||W.initialWidth)&&(W.height||W.initialHeight))}),{x:le,y:he,zoom:Se}=Vf(U,u,f,v,w,(g==null?void 0:g.padding)??.1);V=[le,he,Se]}return{rfId:"1",width:u??0,height:f??0,transform:V,nodes:H,nodesInitialized:X,nodeLookup:N,parentLookup:C,edges:$,edgeLookup:T,connectionLookup:A,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:v,maxZoom:w,translateExtent:Ca,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ms.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:d??!1,fitViewOptions:g,fitViewResolver:null,connection:{...qm},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:g1,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Um,zIndexMode:b,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},eb=({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,width:u,height:f,fitView:d,fitViewOptions:g,minZoom:v,maxZoom:w,nodeOrigin:S,nodeExtent:x,zIndexMode:b})=>x_((N,C)=>{async function A(){const{nodeLookup:T,panZoom:$,fitViewOptions:H,fitViewResolver:M,width:R,height:X,minZoom:V,maxZoom:U}=C();$&&(await h1({nodes:T,width:R,height:X,panZoom:$,minZoom:V,maxZoom:U},H),M==null||M.resolve(!0),N({fitViewResolver:null}))}return{...rm({nodes:t,edges:r,width:u,height:f,fitView:d,fitViewOptions:g,minZoom:v,maxZoom:w,nodeOrigin:S,nodeExtent:x,defaultNodes:i,defaultEdges:a,zIndexMode:b}),setNodes:T=>{const{nodeLookup:$,parentLookup:H,nodeOrigin:M,elevateNodesOnSelect:R,fitViewQueued:X,zIndexMode:V,nodesSelectionActive:U}=C(),{nodesInitialized:le,hasSelectedNodes:he}=jf(T,$,H,{nodeOrigin:M,nodeExtent:x,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:V}),Se=U&&he;X&&le?(A(),N({nodes:T,nodesInitialized:le,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:Se})):N({nodes:T,nodesInitialized:le,nodesSelectionActive:Se})},setEdges:T=>{const{connectionLookup:$,edgeLookup:H}=C();fg($,H,T),N({edges:T})},setDefaultNodesAndEdges:(T,$)=>{if(T){const{setNodes:H}=C();H(T),N({hasDefaultNodes:!0})}if($){const{setEdges:H}=C();H($),N({hasDefaultEdges:!0})}},updateNodeInternals:T=>{const{triggerNodeChanges:$,nodeLookup:H,parentLookup:M,domNode:R,nodeOrigin:X,nodeExtent:V,debug:U,fitViewQueued:le,zIndexMode:he}=C(),{changes:Se,updatedInternals:W}=z1(T,H,M,R,X,V,he);W&&(A1(H,M,{nodeOrigin:X,nodeExtent:V,zIndexMode:he}),le?(A(),N({fitViewQueued:!1,fitViewOptions:void 0})):N({}),(Se==null?void 0:Se.length)>0&&(U&&console.log("React Flow: trigger node changes",Se),$==null||$(Se)))},updateNodePositions:(T,$=!1)=>{const H=[];let M=[];const{nodeLookup:R,triggerNodeChanges:X,connection:V,updateConnection:U,onNodesChangeMiddlewareMap:le}=C();for(const[he,Se]of T){const W=R.get(he),ue=!!(W!=null&&W.expandParent&&(W!=null&&W.parentId)&&(Se!=null&&Se.position)),xe={id:he,type:"position",position:ue?{x:Math.max(0,Se.position.x),y:Math.max(0,Se.position.y)}:Se.position,dragging:$};if(W&&V.inProgress&&V.fromNode.id===W.id){const D=Fi(W,V.fromHandle,Ge.Left,!0);U({...V,from:D})}ue&&W.parentId&&H.push({id:he,parentId:W.parentId,rect:{...Se.internals.positionAbsolute,width:Se.measured.width??0,height:Se.measured.height??0}}),M.push(xe)}if(H.length>0){const{parentLookup:he,nodeOrigin:Se}=C(),W=Xf(H,R,he,Se);M.push(...W)}for(const he of le.values())M=he(M);X(M)},triggerNodeChanges:T=>{const{onNodesChange:$,setNodes:H,nodes:M,hasDefaultNodes:R,debug:X}=C();if(T!=null&&T.length){if(R){const V=Ng(T,M);H(V)}X&&console.log("React Flow: trigger node changes",T),$==null||$(T)}},triggerEdgeChanges:T=>{const{onEdgesChange:$,setEdges:H,edges:M,hasDefaultEdges:R,debug:X}=C();if(T!=null&&T.length){if(R){const V=Cg(T,M);H(V)}X&&console.log("React Flow: trigger edge changes",T),$==null||$(T)}},addSelectedNodes:T=>{const{multiSelectionActive:$,edgeLookup:H,nodeLookup:M,triggerNodeChanges:R,triggerEdgeChanges:X}=C();if($){const V=T.map(U=>Ai(U,!0));R(V);return}R(Es(M,new Set([...T]),!0)),X(Es(H))},addSelectedEdges:T=>{const{multiSelectionActive:$,edgeLookup:H,nodeLookup:M,triggerNodeChanges:R,triggerEdgeChanges:X}=C();if($){const V=T.map(U=>Ai(U,!0));X(V);return}X(Es(H,new Set([...T]))),R(Es(M,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:$}={})=>{const{edges:H,nodes:M,nodeLookup:R,triggerNodeChanges:X,triggerEdgeChanges:V}=C(),U=T||M,le=$||H,he=[];for(const W of U){if(!W.selected)continue;const ue=R.get(W.id);ue&&(ue.selected=!1),he.push(Ai(W.id,!1))}const Se=[];for(const W of le)W.selected&&Se.push(Ai(W.id,!1));X(he),V(Se)},setMinZoom:T=>{const{panZoom:$,maxZoom:H}=C();$==null||$.setScaleExtent([T,H]),N({minZoom:T})},setMaxZoom:T=>{const{panZoom:$,minZoom:H}=C();$==null||$.setScaleExtent([H,T]),N({maxZoom:T})},setTranslateExtent:T=>{var $;($=C().panZoom)==null||$.setTranslateExtent(T),N({translateExtent:T})},resetSelectedElements:()=>{const{edges:T,nodes:$,triggerNodeChanges:H,triggerEdgeChanges:M,elementsSelectable:R}=C();if(!R)return;const X=$.reduce((U,le)=>le.selected?[...U,Ai(le.id,!1)]:U,[]),V=T.reduce((U,le)=>le.selected?[...U,Ai(le.id,!1)]:U,[]);H(X),M(V)},setNodeExtent:T=>{const{nodes:$,nodeLookup:H,parentLookup:M,nodeOrigin:R,elevateNodesOnSelect:X,nodeExtent:V,zIndexMode:U}=C();T[0][0]===V[0][0]&&T[0][1]===V[0][1]&&T[1][0]===V[1][0]&&T[1][1]===V[1][1]||(jf($,H,M,{nodeOrigin:R,nodeExtent:T,elevateNodesOnSelect:X,checkEquality:!1,zIndexMode:U}),N({nodeExtent:T}))},panBy:T=>{const{transform:$,width:H,height:M,panZoom:R,translateExtent:X}=C();return D1({delta:T,panZoom:R,transform:$,translateExtent:X,width:H,height:M})},setCenter:async(T,$,H)=>{const{width:M,height:R,maxZoom:X,panZoom:V}=C();if(!V)return Promise.resolve(!1);const U=typeof(H==null?void 0:H.zoom)<"u"?H.zoom:X;return await V.setViewport({x:M/2-T*U,y:R/2-$*U,zoom:U},{duration:H==null?void 0:H.duration,ease:H==null?void 0:H.ease,interpolate:H==null?void 0:H.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{N({connection:{...qm}})},updateConnection:T=>{N({connection:T})},reset:()=>N({...rm()})}},Object.is);function tb({initialNodes:t,initialEdges:r,defaultNodes:i,defaultEdges:a,initialWidth:u,initialHeight:f,initialMinZoom:d,initialMaxZoom:g,initialFitViewOptions:v,fitView:w,nodeOrigin:S,nodeExtent:x,zIndexMode:b,children:N}){const[C]=de.useState(()=>eb({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,width:u,height:f,fitView:w,minZoom:d,maxZoom:g,fitViewOptions:v,nodeOrigin:S,nodeExtent:x,zIndexMode:b}));return P.jsx(w_,{value:C,children:P.jsx(H_,{children:N})})}function nb({children:t,nodes:r,edges:i,defaultNodes:a,defaultEdges:u,width:f,height:d,fitView:g,fitViewOptions:v,minZoom:w,maxZoom:S,nodeOrigin:x,nodeExtent:b,zIndexMode:N}){return de.useContext(ju)?P.jsx(P.Fragment,{children:t}):P.jsx(tb,{initialNodes:r,initialEdges:i,defaultNodes:a,defaultEdges:u,initialWidth:f,initialHeight:d,fitView:g,initialFitViewOptions:v,initialMinZoom:w,initialMaxZoom:S,nodeOrigin:x,nodeExtent:b,zIndexMode:N,children:t})}const rb={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function ob({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,className:u,nodeTypes:f,edgeTypes:d,onNodeClick:g,onEdgeClick:v,onInit:w,onMove:S,onMoveStart:x,onMoveEnd:b,onConnect:N,onConnectStart:C,onConnectEnd:A,onClickConnectStart:T,onClickConnectEnd:$,onNodeMouseEnter:H,onNodeMouseMove:M,onNodeMouseLeave:R,onNodeContextMenu:X,onNodeDoubleClick:V,onNodeDragStart:U,onNodeDrag:le,onNodeDragStop:he,onNodesDelete:Se,onEdgesDelete:W,onDelete:ue,onSelectionChange:xe,onSelectionDragStart:D,onSelectionDrag:ce,onSelectionDragStop:te,onSelectionContextMenu:ae,onSelectionStart:L,onSelectionEnd:F,onBeforeDelete:Q,connectionMode:O,connectionLineType:B=si.Bezier,connectionLineStyle:be,connectionLineComponent:_e,connectionLineContainerStyle:$e,deleteKeyCode:Ie="Backspace",selectionKeyCode:ze="Shift",selectionOnDrag:we=!1,selectionMode:Le=Pa.Full,panActivationKeyCode:ke="Space",multiSelectionKeyCode:Je=Ma()?"Meta":"Control",zoomActivationKeyCode:Oe=Ma()?"Meta":"Control",snapToGrid:Ye,snapGrid:et,onlyRenderVisibleElements:ft=!1,selectNodesOnDrag:lt,nodesDraggable:kt,autoPanOnNodeFocus:dn,nodesConnectable:on,nodesFocusable:Wt,nodeOrigin:Nt=kg,edgesFocusable:jn,edgesReconnectable:pn,elementsSelectable:Jn=!0,defaultViewport:Sn=A_,minZoom:Ct=.5,maxZoom:Yt=2,translateExtent:Hn=Ca,preventScrolling:er=!0,nodeExtent:Ht,defaultMarkerColor:hn="#b1b1b7",zoomOnScroll:Vn=!0,zoomOnPinch:gr=!0,panOnScroll:Rr=!1,panOnScrollSpeed:bn=.5,panOnScrollMode:Ue=Ri.Free,zoomOnDoubleClick:Kn=!0,panOnDrag:kn=!0,onPaneClick:tr,onPaneMouseEnter:Fe,onPaneMouseMove:Mn,onPaneMouseLeave:Un,onPaneScroll:yr,onPaneContextMenu:q,paneClickDistance:Be=1,nodeClickDistance:Ze=0,children:dt,onReconnect:Lt,onReconnectStart:Xt,onReconnectEnd:Vt,onEdgeContextMenu:sn,onEdgeDoubleClick:ht,onEdgeMouseEnter:bt,onEdgeMouseMove:nr,onEdgeMouseLeave:Tn,reconnectRadius:In=10,onNodesChange:En,onEdgesChange:ai,noDragClassName:rr="nodrag",noWheelClassName:zr="nowheel",noPanClassName:Qt="nopan",fitView:Dr,fitViewOptions:li,connectOnClick:or,attributionPosition:ui,proOptions:ir,defaultEdgeOptions:ci,elevateNodesOnSelect:To=!0,elevateEdgesOnSelect:Pt=!1,disableKeyboardA11y:sr=!1,autoPanOnConnect:yt,autoPanOnNodeDrag:Bi,autoPanSpeed:Lr,connectionRadius:Io,isValidConnection:Fr,onError:vr,style:fi,id:ar,nodeDragThreshold:Nn,connectionDragThreshold:ut,viewport:mn,onViewportChange:Hi,width:Ao,height:to,colorMode:no="light",debug:ro,onScroll:qn,ariaLabelConfig:vt,zIndexMode:Br="basic",...oo},lr){const Hr=ar||"1",io=z_(no),ur=de.useCallback(di=>{di.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),qn==null||qn(di)},[qn]);return P.jsx("div",{"data-testid":"rf__wrapper",...oo,onScroll:ur,style:{...fi,...rb},ref:lr,className:qt(["react-flow",u,io]),id:ar,role:"application",children:P.jsxs(nb,{nodes:t,edges:r,width:Ao,height:to,fitView:Dr,fitViewOptions:li,minZoom:Ct,maxZoom:Yt,nodeOrigin:Nt,nodeExtent:Ht,zIndexMode:Br,children:[P.jsx(R_,{nodes:t,edges:r,defaultNodes:i,defaultEdges:a,onConnect:N,onConnectStart:C,onConnectEnd:A,onClickConnectStart:T,onClickConnectEnd:$,nodesDraggable:kt,autoPanOnNodeFocus:dn,nodesConnectable:on,nodesFocusable:Wt,edgesFocusable:jn,edgesReconnectable:pn,elementsSelectable:Jn,elevateNodesOnSelect:To,elevateEdgesOnSelect:Pt,minZoom:Ct,maxZoom:Yt,nodeExtent:Ht,onNodesChange:En,onEdgesChange:ai,snapToGrid:Ye,snapGrid:et,connectionMode:O,translateExtent:Hn,connectOnClick:or,defaultEdgeOptions:ci,fitView:Dr,fitViewOptions:li,onNodesDelete:Se,onEdgesDelete:W,onDelete:ue,onNodeDragStart:U,onNodeDrag:le,onNodeDragStop:he,onSelectionDrag:ce,onSelectionDragStart:D,onSelectionDragStop:te,onMove:S,onMoveStart:x,onMoveEnd:b,noPanClassName:Qt,nodeOrigin:Nt,rfId:Hr,autoPanOnConnect:yt,autoPanOnNodeDrag:Bi,autoPanSpeed:Lr,onError:vr,connectionRadius:Io,isValidConnection:Fr,selectNodesOnDrag:lt,nodeDragThreshold:Nn,connectionDragThreshold:ut,onBeforeDelete:Q,debug:ro,ariaLabelConfig:vt,zIndexMode:Br}),P.jsx(JS,{onInit:w,onNodeClick:g,onEdgeClick:v,onNodeMouseEnter:H,onNodeMouseMove:M,onNodeMouseLeave:R,onNodeContextMenu:X,onNodeDoubleClick:V,nodeTypes:f,edgeTypes:d,connectionLineType:B,connectionLineStyle:be,connectionLineComponent:_e,connectionLineContainerStyle:$e,selectionKeyCode:ze,selectionOnDrag:we,selectionMode:Le,deleteKeyCode:Ie,multiSelectionKeyCode:Je,panActivationKeyCode:ke,zoomActivationKeyCode:Oe,onlyRenderVisibleElements:ft,defaultViewport:Sn,translateExtent:Hn,minZoom:Ct,maxZoom:Yt,preventScrolling:er,zoomOnScroll:Vn,zoomOnPinch:gr,zoomOnDoubleClick:Kn,panOnScroll:Rr,panOnScrollSpeed:bn,panOnScrollMode:Ue,panOnDrag:kn,onPaneClick:tr,onPaneMouseEnter:Fe,onPaneMouseMove:Mn,onPaneMouseLeave:Un,onPaneScroll:yr,onPaneContextMenu:q,paneClickDistance:Be,nodeClickDistance:Ze,onSelectionContextMenu:ae,onSelectionStart:L,onSelectionEnd:F,onReconnect:Lt,onReconnectStart:Xt,onReconnectEnd:Vt,onEdgeContextMenu:sn,onEdgeDoubleClick:ht,onEdgeMouseEnter:bt,onEdgeMouseMove:nr,onEdgeMouseLeave:Tn,reconnectRadius:In,defaultMarkerColor:hn,noDragClassName:rr,noWheelClassName:zr,noPanClassName:Qt,rfId:Hr,disableKeyboardA11y:sr,nodeExtent:Ht,viewport:mn,onViewportChange:Hi}),P.jsx(I_,{onSelectionChange:xe}),dt,P.jsx(C_,{proOptions:ir,position:ui}),P.jsx(N_,{rfId:Hr,disableKeyboardA11y:sr})]})})}var ib=Pg(ob);function sb(){const t=It();return de.useCallback(r=>{const{domNode:i,updateNodeInternals:a}=t.getState(),u=Array.isArray(r)?r:[r],f=new Map;u.forEach(d=>{const g=i==null?void 0:i.querySelector(`.react-flow__node[data-id="${d}"]`);g&&f.set(d,{id:d,nodeElement:g,force:!0})}),requestAnimationFrame(()=>a(f,{triggerFitView:!1}))},[])}function ab(t){const[r,i]=de.useState(t),a=de.useCallback(u=>i(f=>Ng(u,f)),[]);return[r,i,a]}function lb(t){const[r,i]=de.useState(t),a=de.useCallback(u=>i(f=>Cg(u,f)),[]);return[r,i,a]}function ub({dimensions:t,lineWidth:r,variant:i,className:a}){return P.jsx("path",{strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:qt(["react-flow__background-pattern",i,a])})}function cb({radius:t,className:r}){return P.jsx("circle",{cx:t,cy:t,r:t,className:qt(["react-flow__background-pattern","dots",r])})}var Po;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Po||(Po={}));const fb={[Po.Dots]:1,[Po.Lines]:1,[Po.Cross]:6},db=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function Zg({id:t,variant:r=Po.Dots,gap:i=20,size:a,lineWidth:u=1,offset:f=0,color:d,bgColor:g,style:v,className:w,patternClassName:S}){const x=de.useRef(null),{transform:b,patternId:N}=gt(db,Ot),C=a||fb[r],A=r===Po.Dots,T=r===Po.Cross,$=Array.isArray(i)?i:[i,i],H=[$[0]*b[2]||1,$[1]*b[2]||1],M=C*b[2],R=Array.isArray(f)?f:[f,f],X=T?[M,M]:H,V=[R[0]*b[2]||1+X[0]/2,R[1]*b[2]||1+X[1]/2],U=`${N}${t||""}`;return P.jsxs("svg",{className:qt(["react-flow__background",w]),style:{...v,...Mu,"--xy-background-color-props":g,"--xy-background-pattern-color-props":d},ref:x,"data-testid":"rf__background",children:[P.jsx("pattern",{id:U,x:b[0]%H[0],y:b[1]%H[1],width:H[0],height:H[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${V[0]},-${V[1]})`,children:A?P.jsx(cb,{radius:M/2,className:S}):P.jsx(ub,{dimensions:X,lineWidth:u,variant:r,className:S})}),P.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${U})`})]})}Zg.displayName="Background";const pb=de.memo(Zg);function hb(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:P.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function mb(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:P.jsx("path",{d:"M0 0h32v4.2H0z"})})}function gb(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:P.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 yb(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:P.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 vb(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:P.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 Gl({children:t,className:r,...i}){return P.jsx("button",{type:"button",className:qt(["react-flow__controls-button",r]),...i,children:t})}const xb=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function Jg({style:t,showZoom:r=!0,showFitView:i=!0,showInteractive:a=!0,fitViewOptions:u,onZoomIn:f,onZoomOut:d,onFitView:g,onInteractiveChange:v,className:w,children:S,position:x="bottom-left",orientation:b="vertical","aria-label":N}){const C=It(),{isInteractive:A,minZoomReached:T,maxZoomReached:$,ariaLabelConfig:H}=gt(xb,Ot),{zoomIn:M,zoomOut:R,fitView:X}=Qf(),V=()=>{M(),f==null||f()},U=()=>{R(),d==null||d()},le=()=>{X(u),g==null||g()},he=()=>{C.setState({nodesDraggable:!A,nodesConnectable:!A,elementsSelectable:!A}),v==null||v(!A)},Se=b==="horizontal"?"horizontal":"vertical";return P.jsxs(La,{className:qt(["react-flow__controls",Se,w]),position:x,style:t,"data-testid":"rf__controls","aria-label":N??H["controls.ariaLabel"],children:[r&&P.jsxs(P.Fragment,{children:[P.jsx(Gl,{onClick:V,className:"react-flow__controls-zoomin",title:H["controls.zoomIn.ariaLabel"],"aria-label":H["controls.zoomIn.ariaLabel"],disabled:$,children:P.jsx(hb,{})}),P.jsx(Gl,{onClick:U,className:"react-flow__controls-zoomout",title:H["controls.zoomOut.ariaLabel"],"aria-label":H["controls.zoomOut.ariaLabel"],disabled:T,children:P.jsx(mb,{})})]}),i&&P.jsx(Gl,{className:"react-flow__controls-fitview",onClick:le,title:H["controls.fitView.ariaLabel"],"aria-label":H["controls.fitView.ariaLabel"],children:P.jsx(gb,{})}),a&&P.jsx(Gl,{className:"react-flow__controls-interactive",onClick:he,title:H["controls.interactive.ariaLabel"],"aria-label":H["controls.interactive.ariaLabel"],children:A?P.jsx(vb,{}):P.jsx(yb,{})}),S]})}Jg.displayName="Controls";const wb=de.memo(Jg);function _b({id:t,x:r,y:i,width:a,height:u,style:f,color:d,strokeColor:g,strokeWidth:v,className:w,borderRadius:S,shapeRendering:x,selected:b,onClick:N}){const{background:C,backgroundColor:A}=f||{},T=d||C||A;return P.jsx("rect",{className:qt(["react-flow__minimap-node",{selected:b},w]),x:r,y:i,rx:S,ry:S,width:a,height:u,style:{fill:T,stroke:g,strokeWidth:v},shapeRendering:x,onClick:N?$=>N($,t):void 0})}const Sb=de.memo(_b),bb=t=>t.nodes.map(r=>r.id),df=t=>t instanceof Function?t:()=>t;function kb({nodeStrokeColor:t,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:u,nodeComponent:f=Sb,onClick:d}){const g=gt(bb,Ot),v=df(r),w=df(t),S=df(i),x=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return P.jsx(P.Fragment,{children:g.map(b=>P.jsx(Nb,{id:b,nodeColorFunc:v,nodeStrokeColorFunc:w,nodeClassNameFunc:S,nodeBorderRadius:a,nodeStrokeWidth:u,NodeComponent:f,onClick:d,shapeRendering:x},b))})}function Eb({id:t,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:a,nodeBorderRadius:u,nodeStrokeWidth:f,shapeRendering:d,NodeComponent:g,onClick:v}){const{node:w,x:S,y:x,width:b,height:N}=gt(C=>{const A=C.nodeLookup.get(t);if(!A)return{node:void 0,x:0,y:0,width:0,height:0};const T=A.internals.userNode,{x:$,y:H}=A.internals.positionAbsolute,{width:M,height:R}=Mo(T);return{node:T,x:$,y:H,width:M,height:R}},Ot);return!w||w.hidden||!Jm(w)?null:P.jsx(g,{x:S,y:x,width:b,height:N,style:w.style,selected:!!w.selected,className:a(w),color:r(w),borderRadius:u,strokeColor:i(w),strokeWidth:f,shapeRendering:d,onClick:v,id:w.id})}const Nb=de.memo(Eb);var Cb=de.memo(kb);const Pb=200,jb=150,Mb=t=>!t.hidden,Tb=t=>{const r={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:r,boundingRect:t.nodeLookup.size>0?Zm(Ra(t.nodeLookup,{filter:Mb}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},Ib="react-flow__minimap-desc";function ey({style:t,className:r,nodeStrokeColor:i,nodeColor:a,nodeClassName:u="",nodeBorderRadius:f=5,nodeStrokeWidth:d,nodeComponent:g,bgColor:v,maskColor:w,maskStrokeColor:S,maskStrokeWidth:x,position:b="bottom-right",onClick:N,onNodeClick:C,pannable:A=!1,zoomable:T=!1,ariaLabel:$,inversePan:H,zoomStep:M=1,offsetScale:R=5}){const X=It(),V=de.useRef(null),{boundingRect:U,viewBB:le,rfId:he,panZoom:Se,translateExtent:W,flowWidth:ue,flowHeight:xe,ariaLabelConfig:D}=gt(Tb,Ot),ce=(t==null?void 0:t.width)??Pb,te=(t==null?void 0:t.height)??jb,ae=U.width/ce,L=U.height/te,F=Math.max(ae,L),Q=F*ce,O=F*te,B=R*F,be=U.x-(Q-U.width)/2-B,_e=U.y-(O-U.height)/2-B,$e=Q+B*2,Ie=O+B*2,ze=`${Ib}-${he}`,we=de.useRef(0),Le=de.useRef();we.current=F,de.useEffect(()=>{if(V.current&&Se)return Le.current=W1({domNode:V.current,panZoom:Se,getTransform:()=>X.getState().transform,getViewScale:()=>we.current}),()=>{var Ye;(Ye=Le.current)==null||Ye.destroy()}},[Se]),de.useEffect(()=>{var Ye;(Ye=Le.current)==null||Ye.update({translateExtent:W,width:ue,height:xe,inversePan:H,pannable:A,zoomStep:M,zoomable:T})},[A,T,H,M,W,ue,xe]);const ke=N?Ye=>{var lt;const[et,ft]=((lt=Le.current)==null?void 0:lt.pointer(Ye))||[0,0];N(Ye,{x:et,y:ft})}:void 0,Je=C?de.useCallback((Ye,et)=>{const ft=X.getState().nodeLookup.get(et).internals.userNode;C(Ye,ft)},[]):void 0,Oe=$??D["minimap.ariaLabel"];return P.jsx(La,{position:b,style:{...t,"--xy-minimap-background-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-background-color-props":typeof w=="string"?w:void 0,"--xy-minimap-mask-stroke-color-props":typeof S=="string"?S:void 0,"--xy-minimap-mask-stroke-width-props":typeof x=="number"?x*F:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof d=="number"?d:void 0},className:qt(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:P.jsxs("svg",{width:ce,height:te,viewBox:`${be} ${_e} ${$e} ${Ie}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ze,ref:V,onClick:ke,children:[Oe&&P.jsx("title",{id:ze,children:Oe}),P.jsx(Cb,{onClick:Je,nodeColor:a,nodeStrokeColor:i,nodeBorderRadius:f,nodeClassName:u,nodeStrokeWidth:d,nodeComponent:g}),P.jsx("path",{className:"react-flow__minimap-mask",d:`M${be-B},${_e-B}h${$e+B*2}v${Ie+B*2}h${-$e-B*2}z
202
+ M${le.x},${le.y}h${le.width}v${le.height}h${-le.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ey.displayName="MiniMap";const Ab=de.memo(ey),$b=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,Ob={[$s.Line]:"right",[$s.Handle]:"bottom-right"};function Rb({nodeId:t,position:r,variant:i=$s.Handle,className:a,style:u=void 0,children:f,color:d,minWidth:g=10,minHeight:v=10,maxWidth:w=Number.MAX_VALUE,maxHeight:S=Number.MAX_VALUE,keepAspectRatio:x=!1,resizeDirection:b,autoScale:N=!0,shouldResize:C,onResizeStart:A,onResize:T,onResizeEnd:$}){const H=Ig(),M=typeof t=="string"?t:H,R=It(),X=de.useRef(null),V=i===$s.Handle,U=gt(de.useCallback($b(V&&N),[V,N]),Ot),le=de.useRef(null),he=r??Ob[i];de.useEffect(()=>{if(!(!X.current||!M))return le.current||(le.current=a_({domNode:X.current,nodeId:M,getStoreItems:()=>{const{nodeLookup:W,transform:ue,snapGrid:xe,snapToGrid:D,nodeOrigin:ce,domNode:te}=R.getState();return{nodeLookup:W,transform:ue,snapGrid:xe,snapToGrid:D,nodeOrigin:ce,paneDomNode:te}},onChange:(W,ue)=>{const{triggerNodeChanges:xe,nodeLookup:D,parentLookup:ce,nodeOrigin:te}=R.getState(),ae=[],L={x:W.x,y:W.y},F=D.get(M);if(F&&F.expandParent&&F.parentId){const Q=F.origin??te,O=W.width??F.measured.width??0,B=W.height??F.measured.height??0,be={id:F.id,parentId:F.parentId,rect:{width:O,height:B,...eg({x:W.x??F.position.x,y:W.y??F.position.y},{width:O,height:B},F.parentId,D,Q)}},_e=Xf([be],D,ce,te);ae.push(..._e),L.x=W.x?Math.max(Q[0]*O,W.x):void 0,L.y=W.y?Math.max(Q[1]*B,W.y):void 0}if(L.x!==void 0&&L.y!==void 0){const Q={id:M,type:"position",position:{...L}};ae.push(Q)}if(W.width!==void 0&&W.height!==void 0){const O={id:M,type:"dimensions",resizing:!0,setAttributes:b?b==="horizontal"?"width":"height":!0,dimensions:{width:W.width,height:W.height}};ae.push(O)}for(const Q of ue){const O={...Q,type:"position"};ae.push(O)}xe(ae)},onEnd:({width:W,height:ue})=>{const xe={id:M,type:"dimensions",resizing:!1,dimensions:{width:W,height:ue}};R.getState().triggerNodeChanges([xe])}})),le.current.update({controlPosition:he,boundaries:{minWidth:g,minHeight:v,maxWidth:w,maxHeight:S},keepAspectRatio:x,resizeDirection:b,onResizeStart:A,onResize:T,onResizeEnd:$,shouldResize:C}),()=>{var W;(W=le.current)==null||W.destroy()}},[he,g,v,w,S,x,A,T,$,C]);const Se=he.split("-");return P.jsx("div",{className:qt(["react-flow__resize-control","nodrag",...Se,i,a]),ref:X,style:{...u,scale:U,...d&&{[V?"backgroundColor":"borderColor"]:d}},children:f})}de.memo(Rb);function Zf(t,r,i){var f,d;const a=r.toLowerCase(),u=(d=(f=t.paths)==null?void 0:f[i])==null?void 0:d[a];return(u==null?void 0:u.summary)??(u==null?void 0:u.operationId)??`${r.toUpperCase()} ${i}`}function Jf(t,r,i){var g,v,w,S;const a=r.toLowerCase(),u=(v=(g=t.paths)==null?void 0:g[i])==null?void 0:v[a];if(!(u!=null&&u.requestBody))return"— sin body";const d=(S=(w=u.requestBody.content)==null?void 0:w["application/json"])==null?void 0:S.schema;return d&&"$ref"in d?`body: ${d.$ref}`:"body: JSON"}function ed(t,r,i){var g,v,w,S,x,b;const a=r.toLowerCase(),u=(v=(g=t.paths)==null?void 0:g[i])==null?void 0:v[a],f=((w=u==null?void 0:u.responses)==null?void 0:w["200"])??((S=u==null?void 0:u.responses)==null?void 0:S["201"]);if(!f)return"—";const d=typeof f=="object"&&f&&"content"in f?(b=(x=f.content)==null?void 0:x["application/json"])==null?void 0:b.schema:void 0;return d&&"$ref"in d?String(d.$ref):"JSON"}const ou=()=>({sourceJsonPath:"$",variableName:"v",useInTarget:"vars_only",targetKey:""});function pf(t,r){return`${t.toLowerCase()} ${r}`}function zb(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}const ty=de.createContext(null);function Db(t){const{id:r,selected:i}=t,a=t.data,u=de.useContext(ty),f=sb();return de.useEffect(()=>{f(r)},[a.path,a.method,r,f]),P.jsxs("div",{className:`rounded-xl border bg-surface-950/90 px-3 py-2 min-w-[200px] max-w-[280px] shadow-lg ${i?"border-accent ring-2 ring-accent/40":"border-surface-600"}`,children:[P.jsx(Os,{type:"target",position:Ge.Left,id:"in",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-teal-500"}),P.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[P.jsx("span",{className:"text-[10px] uppercase font-bold text-accent tracking-wide",children:a.method}),P.jsx("span",{className:"text-[10px] text-slate-500 truncate",title:a.summary,children:a.summary})]}),u?P.jsxs("label",{className:"block text-[10px] text-slate-500 mb-1",children:["Endpoint",P.jsx("select",{className:"mt-0.5 w-full bg-surface-900 border border-surface-600 rounded px-1.5 py-1 text-[11px] font-mono",value:pf(a.method,a.path),onChange:d=>{const{method:g,path:v}=zb(d.target.value);u.updateNodeData(r,{method:g,path:v,summary:Zf(u.doc,g,v),reqHint:Jf(u.doc,g,v),resHint:ed(u.doc,g,v)})},children:u.ops.map(d=>P.jsxs("option",{value:pf(d.method,d.path),children:[d.method.toUpperCase()," ",d.path]},pf(d.method,d.path)))})]}):P.jsx("p",{className:"font-mono text-[11px] text-slate-300 truncate",children:a.path}),P.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-1 text-[9px] text-slate-500 leading-tight",children:[P.jsxs("div",{children:[P.jsx("span",{className:"text-slate-600",children:"req"})," ",a.reqHint]}),P.jsxs("div",{children:[P.jsx("span",{className:"text-slate-600",children:"res"})," ",a.resHint]})]}),P.jsx(Os,{type:"source",position:Ge.Right,id:"out",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-amber-500"})]})}const Lb={apiOp:Db};function Fb(t,r){const i=r.nodes.map(u=>({id:u.id,type:"apiOp",position:{x:u.x,y:u.y},data:{method:u.method.toLowerCase(),path:u.path,summary:Zf(t,u.method,u.path),reqHint:Jf(t,u.method,u.path),resHint:ed(t,u.method,u.path)}})),a=r.edges.map(u=>({id:u.id,source:u.source,target:u.target,sourceHandle:"out",targetHandle:"in",data:{mapping:{...u.mapping}},label:u.mapping.variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}}));return{nodes:i,edges:a}}function Bb(t,r){return{nodes:t.map(i=>({id:i.id,method:i.data.method,path:i.data.path,x:i.position.x,y:i.position.y})),edges:r.map(i=>{var a;return{id:i.id,source:i.source,target:i.target,mapping:((a=i.data)==null?void 0:a.mapping)??ou()}})}}const Hb=[{value:"vars_only",label:"Solo variable ({nombre} en la ruta)"},{value:"path_param",label:"Path param {clave}"},{value:"header",label:"Header"},{value:"query",label:"Query string"}];function Vb({doc:t,ops:r,graph:i,onGraphChange:a}){var M,R,X,V,U,le,he,Se;const u=de.useMemo(()=>Fb(t,i),[t,i]),[f,d,g]=ab(u.nodes),[v,w,S]=lb(u.edges),[x,b]=de.useState(null);de.useEffect(()=>{a(Bb(f,v))},[f,v,a]);const N=de.useCallback((W,ue)=>{d(xe=>xe.map(D=>D.id===W?{...D,data:{...D.data,...ue}}:D))},[d]),C=de.useMemo(()=>({doc:t,ops:r,updateNodeData:N}),[t,r,N]),A=de.useCallback(W=>{W.sourceHandle!=="out"||W.targetHandle!=="in"||w(ue=>ag({...W,id:`e-${W.source}-${W.target}-${crypto.randomUUID().slice(0,8)}`,sourceHandle:"out",targetHandle:"in",data:{mapping:ou()},label:ou().variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}},ue))},[w]),T=v.find(W=>W.id===x),$=W=>{x&&w(ue=>ue.map(xe=>{var ce;if(xe.id!==x)return xe;const D={...((ce=xe.data)==null?void 0:ce.mapping)??ou(),...W};return{...xe,data:{mapping:D},label:D.variableName}}))},H=()=>{const W=f.reduce((ae,L)=>L.position.x>ae?L.position.x:ae,0),ue=r[0];if(!ue)return;const xe=crypto.randomUUID(),D=W>0?W+40:80,te={id:xe,type:"apiOp",position:{x:D,y:120},data:{method:ue.method.toLowerCase(),path:ue.path,summary:Zf(t,ue.method,ue.path),reqHint:Jf(t,ue.method,ue.path),resHint:ed(t,ue.method,ue.path)}};d(ae=>[...ae,te])};return P.jsx(ty.Provider,{value:C,children:P.jsxs("div",{className:"space-y-3",children:[P.jsx("div",{className:"h-[min(520px,70vh)] w-full rounded-xl border border-surface-700 bg-surface-950",children:P.jsxs(ib,{nodes:f,edges:v,onNodesChange:g,onEdgesChange:S,onConnect:A,nodeTypes:Lb,onEdgeClick:(W,ue)=>b(ue.id),onPaneClick:()=>b(null),fitView:!0,minZoom:.4,maxZoom:1.5,proOptions:{hideAttribution:!0},isValidConnection:W=>W.sourceHandle==="out"&&W.targetHandle==="in",children:[P.jsx(pb,{variant:Po.Dots,gap:16,size:1,color:"rgb(51 65 85 / 0.5)"}),P.jsx(wb,{className:"!bg-surface-900 !border-surface-600 !shadow-lg"}),P.jsx(Ab,{className:"!bg-surface-900/95 !border-surface-600",nodeColor:()=>"rgb(45 212 191 / 0.5)"}),P.jsx(La,{position:"top-left",children:P.jsx("button",{type:"button",onClick:H,className:"text-xs px-3 py-2 rounded-lg bg-accent/90 text-surface-950 font-medium shadow",children:"+ Nodo (endpoint)"})})]})}),P.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[P.jsx("h4",{className:"text-xs font-semibold text-slate-300",children:"Cable seleccionado (respuesta → request)"}),T?P.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs",children:[P.jsxs("label",{className:"text-slate-500",children:["JSON path en la respuesta",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((M=T.data)==null?void 0:M.mapping.sourceJsonPath)??"$",onChange:W=>$({sourceJsonPath:W.target.value}),placeholder:"$.access_token"})]}),P.jsxs("label",{className:"text-slate-500",children:["Nombre de variable",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((R=T.data)==null?void 0:R.mapping.variableName)??"",onChange:W=>$({variableName:W.target.value}),placeholder:"token"})]}),P.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Cómo se usa en el request del nodo destino",P.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((X=T.data)==null?void 0:X.mapping.useInTarget)??"vars_only",onChange:W=>$({useInTarget:W.target.value}),children:Hb.map(W=>P.jsx("option",{value:W.value,children:W.label},W.value))})]}),(((V=T.data)==null?void 0:V.mapping.useInTarget)==="path_param"||((U=T.data)==null?void 0:U.mapping.useInTarget)==="header"||((le=T.data)==null?void 0:le.mapping.useInTarget)==="query")&&P.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Clave (nombre del param / header / query)",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((he=T.data)==null?void 0:he.mapping.targetKey)??"",onChange:W=>$({targetKey:W.target.value}),placeholder:"id / Authorization / q"})]}),P.jsxs("p",{className:"sm:col-span-2 text-[11px] text-slate-500 leading-relaxed",children:["El valor extraído se guarda en la variable y, según la opción, se inyecta en la ruta"," ",P.jsx("code",{className:"text-accent",children:"{clave}"}),", en un header, o en query. Con «solo variable», usa"," ",P.jsx("code",{className:"text-accent",children:"{"+(((Se=T.data)==null?void 0:Se.mapping.variableName)||"var")+"}"})," ","en la ruta del endpoint destino."]})]}):P.jsx("p",{className:"text-xs text-slate-500",children:"Conecta la salida derecha (res) de un nodo con la entrada izquierda (req) de otro. Haz clic en un cable para definir el mapeo."})]})]})})}function ny(t,r){const i=new Map(t.map(v=>[v.id,v])),a=new Set(t.map(v=>v.id)),u=new Map,f=new Map;for(const v of a)u.set(v,0),f.set(v,[]);for(const v of r)!a.has(v.source)||!a.has(v.target)||(u.set(v.target,(u.get(v.target)??0)+1),f.get(v.source).push(v.target));const d=[];for(const[v,w]of u)w===0&&d.push(v);d.sort((v,w)=>i.get(v).x-i.get(w).x||i.get(v).y-i.get(w).y);const g=[];for(;d.length;){const v=d.shift();g.push(v);for(const w of f.get(v)??[]){const S=(u.get(w)??0)-1;u.set(w,S),S===0&&(d.push(w),d.sort((x,b)=>i.get(x).x-i.get(b).x||i.get(x).y-i.get(b).y))}}if(g.length<t.length){const v=t.filter(w=>!g.includes(w.id)).sort((w,S)=>w.x-S.x||w.y-S.y);return[...g.map(w=>i.get(w)),...v]}return g.map(v=>i.get(v))}async function om(t,r,i){var v;const{nodes:a,edges:u}=t;if(a.length===0)return"Sin nodos en el flujo.";const f=ny(a,u),d={};let g="";for(let w=0;w<f.length;w++){const S=f[w];let x=S.path;const b={...i()},N=u.filter(X=>X.target===S.id);for(const X of N){const{mapping:V}=X,U=d[V.variableName];if(U!==void 0)switch(V.useInTarget){case"path_param":V.targetKey&&(x=x.split(`{${V.targetKey}}`).join(U));break;case"header":if(V.targetKey){const le=V.targetKey;b[le]=le.toLowerCase()==="authorization"&&!U.startsWith("Bearer ")?`Bearer ${U}`:U}break;case"query":{const le=x.includes("?")?"&":"?";x=`${x}${le}${encodeURIComponent(V.targetKey)}=${encodeURIComponent(U)}`;break}case"vars_only":default:x=x.split(`{${V.variableName}}`).join(U);break}}for(const[X,V]of Object.entries(d))x=x.split(`{${X}}`).join(V);const C=`${r.replace(/\/$/,"")}${x}`,A={method:S.method.toUpperCase(),headers:b},T=S.method.toLowerCase();T!=="get"&&T!=="head"&&(A.body="{}");const $=await fetch(C,A);let H={};const M=await $.text();try{H=M?JSON.parse(M):{}}catch{H={_raw:M}}g+=`▸ ${S.method.toUpperCase()} ${S.path} → ${$.status}
203
+ ${JSON.stringify(H,null,2)}
204
+
205
+ `;const R=u.filter(X=>X.source===S.id);for(const X of R){const V=((v=X.mapping.sourceJsonPath)==null?void 0:v.trim())||"$",U=Af(H,V);U!=null&&(d[X.mapping.variableName]=typeof U=="object"?JSON.stringify(U):String(U))}}return g+=`
206
+ Variables finales: ${JSON.stringify(d,null,2)}`,g}function Kb(t){const r=ny(t.nodes,t.edges);return r.map((i,a)=>{const u=r[a+1];if(!u)return{method:i.method,path:i.path};const f=t.edges.find(d=>d.source===i.id&&d.target===u.id);return f?{method:i.method,path:i.path,extract:{varName:f.mapping.variableName,jsonPath:f.mapping.sourceJsonPath||"$"}}:{method:i.method,path:i.path}})}function Ub(t){var a;const r=t.map((u,f)=>({id:`n-${f}`,method:u.method,path:u.path,x:40+f*300,y:120})),i=[];for(let u=0;u<t.length-1;u++){const f=(a=t[u])==null?void 0:a.extract;f!=null&&f.jsonPath&&i.push({id:`e-${u}`,source:`n-${u}`,target:`n-${u+1}`,mapping:{sourceJsonPath:f.jsonPath,variableName:f.varName,useInTarget:"vars_only",targetKey:""}})}return{nodes:r,edges:i}}const ry=[{value:200,label:"200 OK"},{value:201,label:"201 Created"},{value:202,label:"202 Accepted"},{value:204,label:"204 No Content"},{value:400,label:"400 Bad Request"},{value:401,label:"401 Unauthorized"},{value:403,label:"403 Forbidden"},{value:404,label:"404 Not Found"},{value:409,label:"409 Conflict"},{value:422,label:"422 Unprocessable"},{value:429,label:"429 Too Many Requests"},{value:500,label:"500 Server Error"},{value:502,label:"502 Bad Gateway"},{value:503,label:"503 Unavailable"}];function im(t){return ry.some(r=>r.value===t)}const hf=[{id:"typescript",label:"TypeScript"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"php",label:"PHP"}];function mf(t,r){return`${t.toLowerCase()} ${r}`}function qb(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}async function sm(t){await navigator.clipboard.writeText(t)}function Wb(){const[t,r]=de.useState(null),[i,a]=de.useState(null),[u,f]=de.useState("explore"),[d,g]=de.useState(""),[v,w]=de.useState(null),[S,x]=de.useState(null),[b,N]=de.useState("{}"),[C,A]=de.useState(""),[T,$]=de.useState("typescript"),[H,M]=de.useState(""),[R,X]=de.useState(""),[V,U]=de.useState("X-Api-Key"),[le,he]=de.useState({nodes:[],edges:[]}),[Se,W]=de.useState(0),[ue,xe]=de.useState("Mi flujo"),[D,ce]=de.useState([]),[te,ae]=de.useState(""),[L,F]=de.useState({name:"Suite 1",cases:[]}),[Q,O]=de.useState([]),[B,be]=de.useState(""),[_e,$e]=de.useState(""),[Ie,ze]=de.useState(null),[we,Le]=de.useState(null),ke="/docs/openapi.json",Je="/docs/preset.json",Oe=de.useCallback(async()=>{const[q,Be]=await Promise.all([St.flows.toArray(),St.testSuites.toArray()]);ce(q.sort((Ze,dt)=>(Ze.name??"").localeCompare(dt.name??""))),O(Be.sort((Ze,dt)=>(Ze.name??"").localeCompare(dt.name??"")))},[]);de.useEffect(()=>{fetch(ke).then(q=>{if(!q.ok)throw new Error(`${q.status} ${q.statusText}`);return q.json()}).then(q=>{r(q),g(Ss(q)),a(null)}).catch(q=>a(q.message))},[ke]),de.useEffect(()=>{if(!t)return;let q=!1;return(async()=>{try{const Be=await fetch(Je);if(!Be.ok||q)return;const Ze=await Be.json(),dt=await j0(Ze);!q&&dt&&await Oe()}catch{}})(),()=>{q=!0}},[t,Je,Oe]),de.useEffect(()=>{Oe(),St.kv.get("bearer").then(q=>q&&M(q.value)),St.kv.get("apiKey").then(q=>q&&X(q.value))},[Oe]);const Ye=de.useMemo(()=>t?S0(t):[],[t]),et=de.useMemo(()=>t?Jr(t):[],[t]),ft=de.useMemo(()=>v?et.filter(q=>(q.tags??["default"]).includes(v)):et,[et,v]);de.useEffect(()=>{if(et.length&&!_e){const q=et[0];$e(mf(q.method,q.path))}},[et,_e]),de.useEffect(()=>{if(et.length===0||le.nodes.length>0||u!=="flows"||Ie!=null)return;const q=et[0];he({nodes:[{id:crypto.randomUUID(),method:q.method.toLowerCase(),path:q.path,x:80,y:120}],edges:[]}),W(Be=>Be+1)},[et,le.nodes.length,u,Ie]);const lt=de.useCallback(()=>{const q={"Content-Type":"application/json"};return H.trim()&&(q.Authorization=`Bearer ${H.trim()}`),R.trim()&&(q[V]=R.trim()),q},[H,R,V]),kt=de.useMemo(()=>{if(!t||!S)return null;const q={};for(const{id:Be}of hf)q[Be]=x0(t,Be,S.method,S.path);return q},[t,S]),dn=de.useMemo(()=>t?_0(t,T,v):"",[t,T,v]),on=async()=>{if(!t||!S)return;const q=`${Ss(t,d)}${S.path}`,Be={method:S.method.toUpperCase(),headers:lt()},Ze=S.method.toLowerCase();Ze!=="get"&&Ze!=="head"&&(Be.body=b.trim()?b:"{}");const dt=await fetch(q,Be),Lt=await dt.text();A(`${dt.status} ${dt.statusText}
207
+
208
+ ${Lt}`)},Wt=async q=>{var Lt;if(!t)return"";const Be={};let Ze="";const dt=Ss(t,d);for(let Xt=0;Xt<q.length;Xt++){const Vt=q[Xt];let sn=Vt.path;for(const[En,ai]of Object.entries(Be))sn=sn.replace(`{${En}}`,ai);const ht=`${dt}${sn}`,bt={method:Vt.method.toUpperCase(),headers:lt()},nr=Vt.method.toLowerCase();nr!=="get"&&nr!=="head"&&(bt.body="{}");const Tn=await fetch(ht,bt),In=await Tn.json().catch(()=>({}));if(Ze+=`Paso ${Xt+1}: ${Tn.status}
209
+ ${JSON.stringify(In,null,2)}
210
+
211
+ `,(Lt=Vt.extract)!=null&&Lt.jsonPath){const En=Af(In,Vt.extract.jsonPath);En!==void 0&&(Be[Vt.extract.varName]=String(En))}}return Ze},Nt=async()=>{if(!t)return;const q=Ss(t,d);if(le.nodes.length===0){ae("Añade al menos un nodo al flujo.");return}const Be=await om(le,q,lt);ae(Be)},jn=async q=>{if(!t)return;const Be=Ss(t,d),Ze=q.graph&&q.graph.nodes.length>0?await om(q.graph,Be,lt):await Wt(q.steps);ae(Ze),f("flows")},pn=q=>{xe(q.name),he(q.graph&&q.graph.nodes.length>0?q.graph:Ub(q.steps.length?q.steps:[{method:"get",path:"/"}])),W(Be=>Be+1),ze(q.id??null),f("flows")},Jn=()=>{ze(null),xe("Nuevo flujo"),et[0]?he({nodes:[{id:crypto.randomUUID(),method:et[0].method.toLowerCase(),path:et[0].path,x:80,y:120}],edges:[]}):he({nodes:[],edges:[]}),W(q=>q+1)},Sn=de.useCallback(q=>{he(q)},[]),Ct=async()=>{const q=Kb(le);if(Ie!=null)await St.flows.update(Ie,{name:ue,steps:q,graph:le});else{const Be=await St.flows.add({name:ue,steps:q,graph:le});ze(Be)}await Oe()},Yt=async q=>{q!==void 0&&(q===Ie&&(ze(null),Jn()),await St.flows.delete(q),await Oe())},Hn=()=>{if(!_e)return;const{method:q,path:Be}=qb(_e),Ze={id:crypto.randomUUID(),method:q,path:Be,expectStatus:200,contains:void 0,jsonPath:void 0,expectJsonValue:void 0};F(dt=>({...dt,cases:[...dt.cases,Ze]}))},er=q=>{F(Be=>({...Be,cases:Be.cases.filter(Ze=>Ze.id!==q)}))},Ht=(q,Be)=>{F(Ze=>({...Ze,cases:Ze.cases.map(dt=>dt.id===q?{...dt,...Be}:dt)}))},hn=async q=>{if(!t)return"";const Be=Ss(t,d);let Ze="";for(const dt of q){const Lt=`${Be}${dt.path}`,Xt=await fetch(Lt,{method:dt.method.toUpperCase(),headers:lt()}),Vt=await Xt.text(),sn=M0(dt,Xt.status,Vt),ht=`${sn.pass?"PASS":"FAIL"} ${dt.method.toUpperCase()} ${dt.path}`;Ze+=`${ht}
212
+ ${sn.lines.map(bt=>` ${bt}`).join(`
213
+ `)}
214
+
215
+ `}return Ze},Vn=async()=>{const q=await hn(L.cases);be(q)},gr=async()=>{if(!t||Q.length===0)return;let q="";for(const Be of Q)q+=`━━━ ${Be.name} (${Be.cases.length} casos) ━━━
216
+ `,q+=await hn(Be.cases);be(q),f("tests")},Rr=async q=>{const Be=await hn(q.cases);be(Be),f("tests")},bn=q=>{F({name:q.name,cases:q.cases.map(Be=>({...Be,id:Be.id&&Be.id.length>0?Be.id:crypto.randomUUID()}))}),Le(q.id??null),f("tests")},Ue=()=>{Le(null),F({name:"Nueva suite",cases:[]})},Kn=async()=>{if(we!=null)await St.testSuites.update(we,{name:L.name,cases:L.cases});else{const q=await St.testSuites.add({name:L.name,cases:L.cases});Le(q)}await Oe()},kn=async q=>{q!==void 0&&(q===we&&(Le(null),F({name:"Nueva suite",cases:[]})),await St.testSuites.delete(q),await Oe())},tr=async()=>{await St.kv.put({key:"bearer",value:H}),await St.kv.put({key:"apiKey",value:R})},Fe=async()=>{const q=await P0(),Be=new Blob([JSON.stringify(q,null,2)],{type:"application/json"}),Ze=document.createElement("a");Ze.href=URL.createObjectURL(Be),Ze.download="api-doc-tor-export.json",Ze.click()},Mn=async q=>{var Lt;const Be=(Lt=q.target.files)==null?void 0:Lt[0];if(!Be)return;const Ze=await Be.text(),dt=JSON.parse(Ze);await pm(dt),await Oe()},Un=()=>{S&&(he(q=>{const Be=q.nodes[q.nodes.length-1],Ze=Be?Be.x+280:80,dt=(Be==null?void 0:Be.y)??120;return{nodes:[...q.nodes,{id:crypto.randomUUID(),method:S.method.toLowerCase(),path:S.path,x:Ze,y:dt}],edges:q.edges}}),W(q=>q+1),f("flows"))};if(i)return P.jsx("div",{className:"min-h-screen flex items-center justify-center p-8",children:P.jsxs("div",{className:"max-w-lg rounded-2xl border border-red-500/30 bg-surface-900 p-6 text-red-200",children:[P.jsx("h1",{className:"font-display text-xl font-bold mb-2",children:"No se pudo cargar OpenAPI"}),P.jsx("p",{className:"text-sm opacity-90",children:i}),P.jsxs("p",{className:"text-xs mt-4 text-slate-500",children:["URL intentada: ",ke]})]})});if(!t)return P.jsx("div",{className:"min-h-screen flex items-center justify-center",children:P.jsx("p",{className:"text-slate-400 animate-pulse",children:"Cargando especificación…"})});const yr=v===null?"Todos los endpoints (cliente único con todas las operaciones)":`Tag «${v}» (solo operaciones de este grupo)`;return P.jsxs("div",{className:"min-h-screen flex flex-col md:flex-row",children:[P.jsxs("aside",{className:"w-full md:w-64 border-b md:border-b-0 md:border-r border-surface-700 bg-surface-900/80 shrink-0",children:[P.jsxs("div",{className:"p-4 border-b border-surface-700",children:[P.jsx("h1",{className:"font-display text-lg font-bold text-white tracking-tight",children:"api-doc-tor"}),P.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:[t.info.title," · v",t.info.version]})]}),P.jsx("nav",{className:"p-2 flex flex-row md:flex-col gap-1 overflow-x-auto",children:[["explore","Explorar"],["flows",`Flujos (${D.length})`],["tests",`Tests (${Q.length})`],["auth","Auth"]].map(([q,Be])=>P.jsx("button",{type:"button",onClick:()=>f(q),className:`text-left px-3 py-2 rounded-lg text-sm transition ${u===q?"bg-accent/20 text-accent":"text-slate-400 hover:bg-surface-800"}`,children:Be},q))}),P.jsxs("div",{className:"p-3 border-t border-surface-700 space-y-2",children:[P.jsx("button",{type:"button",onClick:Fe,className:"w-full text-xs py-2 rounded-lg bg-surface-800 hover:bg-surface-700",children:"Exportar estado"}),P.jsxs("label",{className:"block w-full text-xs py-2 rounded-lg bg-surface-800 hover:bg-surface-700 text-center cursor-pointer",children:["Importar JSON",P.jsx("input",{type:"file",accept:"application/json",className:"hidden",onChange:Mn})]})]})]}),P.jsxs("main",{className:"flex-1 flex flex-col min-h-0",children:[P.jsx("header",{className:"border-b border-surface-700 px-4 py-3 flex flex-wrap gap-3 items-center bg-surface-900/50",children:P.jsxs("label",{className:"text-xs text-slate-500",children:["Base URL",P.jsx("input",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1 text-sm w-64",value:d,onChange:q=>g(q.target.value)})]})}),u==="explore"&&P.jsxs("div",{className:"flex-1 flex flex-col lg:flex-row min-h-0",children:[P.jsxs("div",{className:"lg:w-72 border-b lg:border-b-0 lg:border-r border-surface-700 overflow-auto max-h-64 lg:max-h-none",children:[P.jsxs("div",{className:"p-2",children:[P.jsx("p",{className:"text-xs uppercase tracking-wider text-slate-500 mb-2",children:"Tags"}),P.jsxs("div",{className:"flex flex-wrap gap-1",children:[P.jsx("button",{type:"button",onClick:()=>w(null),className:`text-xs px-2 py-1 rounded ${v===null?"bg-accent/30":"bg-surface-800"}`,children:"Todos"}),Ye.map(q=>P.jsx("button",{type:"button",onClick:()=>w(q),className:`text-xs px-2 py-1 rounded ${v===q?"bg-accent/30":"bg-surface-800"}`,children:q},q))]})]}),P.jsx("ul",{className:"text-sm",children:ft.map(q=>P.jsx("li",{children:P.jsxs("button",{type:"button",onClick:()=>x({method:q.method,path:q.path}),className:`w-full text-left px-3 py-2 hover:bg-surface-800 flex gap-2 ${(S==null?void 0:S.method)===q.method&&S.path===q.path?"bg-surface-800 border-l-2 border-accent":""}`,children:[P.jsx("span",{className:"uppercase text-accent text-xs w-12 shrink-0",children:q.method}),P.jsx("span",{className:"truncate text-slate-300",children:q.path})]})},`${q.method}:${q.path}`))})]}),P.jsx("div",{className:"flex-1 p-4 overflow-auto space-y-6",children:S?P.jsxs(P.Fragment,{children:[P.jsxs("div",{children:[P.jsxs("h2",{className:"font-display font-semibold text-white text-lg",children:[S.method.toUpperCase()," ",S.path]}),P.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["Filtro de exportación de servicio: ",yr]})]}),P.jsxs("section",{className:"space-y-2",children:[P.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Probar"}),P.jsx("textarea",{className:"w-full h-28 bg-surface-900 border border-surface-600 rounded-lg p-3 font-mono text-xs",value:b,onChange:q=>N(q.target.value),placeholder:"Body JSON"}),P.jsx("button",{type:"button",onClick:()=>void on(),className:"px-4 py-2 rounded-lg bg-accent text-surface-950 font-medium text-sm",children:"Ejecutar"}),P.jsx("pre",{className:"text-xs bg-surface-900 border border-surface-700 rounded-lg p-3 overflow-auto max-h-64 text-emerald-300/90 whitespace-pre-wrap",children:C||"—"})]}),P.jsxs("section",{className:"space-y-3",children:[P.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Snippets por lenguaje"}),P.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:kt&&hf.map(({id:q,label:Be})=>P.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/60 overflow-hidden",children:[P.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-surface-700 bg-surface-800/50",children:[P.jsx("span",{className:"text-xs font-medium text-accent",children:Be}),P.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-surface-600",onClick:()=>void sm(kt[q]),children:"Copiar"})]}),P.jsx("pre",{className:"text-[11px] p-3 overflow-auto max-h-56 text-slate-300 font-mono whitespace-pre-wrap",children:kt[q]})]},q))})]}),P.jsxs("section",{className:"space-y-3 rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[P.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Cliente / servicio generado"}),P.jsx("p",{className:"text-xs text-slate-500",children:yr}),P.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[P.jsxs("label",{className:"text-xs text-slate-400",children:["Lenguaje del archivo",P.jsx("select",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:T,onChange:q=>$(q.target.value),children:hf.map(({id:q,label:Be})=>P.jsx("option",{value:q,children:Be},q))})]}),P.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-surface-700 hover:bg-surface-600",onClick:()=>void sm(dn),children:"Copiar servicio"})]}),P.jsx("pre",{className:"text-[11px] bg-surface-950 border border-surface-700 rounded-lg p-3 overflow-auto max-h-96 text-slate-200 font-mono whitespace-pre-wrap",children:dn})]}),P.jsx("div",{className:"flex flex-wrap gap-2 pt-2 border-t border-surface-800",children:P.jsx("button",{type:"button",className:"text-xs px-3 py-2 rounded-lg bg-surface-800 hover:bg-surface-700",onClick:Un,children:"Añadir operación actual a un flujo (ve a Flujos)"})})]}):P.jsx("p",{className:"text-slate-500",children:"Selecciona una operación en la lista."})})]}),u==="flows"&&P.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[P.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4",children:[P.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:"Flujos guardados"}),D.length===0?P.jsx("p",{className:"text-sm text-slate-500",children:"Aún no hay flujos. Crea uno en el editor y guarda."}):P.jsx("ul",{className:"space-y-2",children:D.map(q=>{var Be,Ze;return P.jsxs("li",{className:"flex flex-wrap items-center gap-2 justify-between rounded-lg border border-surface-700 bg-surface-950/50 px-3 py-2",children:[P.jsxs("div",{children:[P.jsx("span",{className:"text-sm text-slate-200 font-medium",children:q.name}),P.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[(((Ze=(Be=q.graph)==null?void 0:Be.nodes)==null?void 0:Ze.length)??q.steps.length)||0," nodo(s)"]})]}),P.jsxs("div",{className:"flex flex-wrap gap-2",children:[P.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded-lg bg-emerald-600/30 text-emerald-300 hover:bg-emerald-600/50",title:"Ejecutar sin cargar el editor",onClick:()=>void jn(q),children:"Play"}),P.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent hover:bg-accent/30",onClick:()=>pn(q),children:"Editar"}),P.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40 text-slate-300",onClick:()=>void Yt(q.id),children:"Eliminar"})]})]},q.id!=null?`flow-${q.id}`:`flow-${q.name}`)})})]}),P.jsxs("section",{className:"space-y-4 max-w-6xl",children:[P.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[P.jsx("h3",{className:"text-sm font-semibold text-white",children:"Editor de flujo (nodos y cables)"}),P.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg border border-surface-600 text-slate-300 hover:bg-surface-800",onClick:Jn,children:"Nuevo flujo"})]}),Ie!=null&&P.jsxs("p",{className:"text-xs text-accent",children:["Editando flujo guardado (#",Ie,")"]}),P.jsxs("p",{className:"text-sm text-slate-400",children:["Cada nodo es un endpoint del spec. Conecta ",P.jsx("strong",{className:"text-slate-300",children:"res → req"})," ","y define qué campo de la respuesta pasa al siguiente request (JSON path, variable, header, query o ",P.jsx("code",{className:"text-accent",children:"{variable}"})," en la ruta)."]}),P.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm w-full max-w-md",value:ue,onChange:q=>xe(q.target.value),placeholder:"Nombre del flujo"}),P.jsx(Vb,{doc:t,ops:et,graph:le,onGraphChange:Sn},Se),P.jsxs("div",{className:"flex flex-wrap gap-2",children:[P.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-emerald-600 text-white text-sm font-medium hover:bg-emerald-500",onClick:()=>void Nt(),children:"Play (grafo)"}),P.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Ct(),children:Ie!=null?"Guardar cambios":"Guardar flujo"})]}),P.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 max-h-64 overflow-auto whitespace-pre-wrap",children:te||"Resultado de la ejecución aquí."})]})]}),u==="tests"&&P.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[P.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[P.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[P.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suites guardadas"}),Q.length>0&&P.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-emerald-600/80 text-white hover:bg-emerald-500",onClick:()=>void gr(),children:"Ejecutar todas las suites"})]}),Q.length===0?P.jsx("p",{className:"text-sm text-slate-500",children:"Ninguna suite guardada."}):P.jsx("ul",{className:"space-y-2",children:Q.map(q=>P.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-surface-700 bg-surface-950/50 px-3 py-2",children:[P.jsxs("div",{children:[P.jsx("span",{className:"text-sm text-slate-200 font-medium",children:q.name}),P.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[q.cases.length," caso(s)"]})]}),P.jsxs("div",{className:"flex flex-wrap gap-2",children:[P.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded-lg bg-emerald-600/30 text-emerald-300 hover:bg-emerald-600/50",onClick:()=>void Rr(q),children:"Play"}),P.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent",onClick:()=>bn(q),children:"Editar"}),P.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40",onClick:()=>void kn(q.id),children:"Eliminar"})]})]},q.id!=null?`suite-${q.id}`:`suite-${q.name}`))})]}),P.jsxs("section",{className:"space-y-4",children:[P.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[P.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suite en edición"}),P.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg border border-surface-600 text-slate-300 hover:bg-surface-800",onClick:Ue,children:"Nueva suite"})]}),we!=null&&P.jsxs("p",{className:"text-xs text-accent",children:["Editando suite guardada (#",we,")"]}),P.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm max-w-md",value:L.name,onChange:q=>F(Be=>({...Be,name:q.target.value})),placeholder:"Nombre de la suite"}),P.jsxs("div",{className:"flex flex-wrap gap-2 items-end rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[P.jsxs("label",{className:"text-xs text-slate-400 flex-1 min-w-[200px]",children:["Añadir endpoint del spec",P.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm font-mono",value:_e,onChange:q=>$e(q.target.value),children:et.map(q=>P.jsxs("option",{value:mf(q.method,q.path),children:[q.method.toUpperCase()," ",q.path]},mf(q.method,q.path)))})]}),P.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-800 text-sm hover:bg-surface-700",onClick:Hn,children:"Añadir a la suite"})]}),P.jsx("ul",{className:"space-y-4",children:L.cases.map(q=>{const Be=im(q.expectStatus)?String(q.expectStatus):"custom";return P.jsxs("li",{className:"rounded-xl border border-surface-700 bg-surface-950/40 p-4 space-y-3 text-sm",children:[P.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[P.jsxs("span",{className:"font-mono text-xs text-accent",children:[q.method.toUpperCase()," ",q.path]}),P.jsx("button",{type:"button",className:"text-xs text-red-400 hover:underline shrink-0",onClick:()=>er(q.id),children:"Quitar"})]}),P.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[P.jsxs("label",{className:"text-xs text-slate-400 block",children:["Código HTTP esperado",P.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[P.jsxs("select",{className:"bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm max-w-[200px]",value:Be,onChange:Ze=>{const dt=Ze.target.value;if(dt==="custom"){Ht(q.id,{expectStatus:im(q.expectStatus)?1e3:q.expectStatus});return}Ht(q.id,{expectStatus:Number(dt)})},children:[ry.map(Ze=>P.jsx("option",{value:String(Ze.value),children:Ze.label},Ze.value)),P.jsx("option",{value:"custom",children:"Otro…"})]}),Be==="custom"&&P.jsx("input",{type:"number",className:"w-20 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:q.expectStatus,onChange:Ze=>Ht(q.id,{expectStatus:Number(Ze.target.value)||0})})]})]}),P.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["El body contiene (opcional)",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:'ej. "ok"',value:q.contains??"",onChange:Ze=>Ht(q.id,{contains:Ze.target.value||void 0})})]}),P.jsxs("label",{className:"text-xs text-slate-400 block",children:["JSON path (opcional)",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:"$.data.id",value:q.jsonPath??"",onChange:Ze=>Ht(q.id,{jsonPath:Ze.target.value||void 0})})]}),P.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["Valor esperado en JSON path (opcional)",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:"Vacío = solo comprobar que existe",value:q.expectJsonValue??"",onChange:Ze=>Ht(q.id,{expectJsonValue:Ze.target.value||void 0})})]})]})]},q.id)})}),P.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[P.jsx("button",{type:"button",className:"px-5 py-2.5 rounded-lg bg-emerald-600 text-white text-sm font-semibold hover:bg-emerald-500 shadow-lg shadow-emerald-900/30",onClick:()=>void Vn(),children:"Correr todos los casos (suite actual)"}),P.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Kn(),children:we!=null?"Guardar cambios":"Guardar suite"})]}),P.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 whitespace-pre-wrap min-h-[4rem]",children:B||"—"})]})]}),u==="auth"&&P.jsxs("div",{className:"p-4 space-y-4 max-w-lg",children:[P.jsxs("p",{className:"text-sm text-slate-400",children:["Esquemas en el spec: ",b0(t).join(", ")||"ninguno"]}),P.jsxs("label",{className:"block text-sm",children:["Bearer token",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:H,onChange:q=>M(q.target.value),placeholder:"eyJ..."})]}),P.jsxs("label",{className:"block text-sm",children:["API key header",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:V,onChange:q=>U(q.target.value)})]}),P.jsxs("label",{className:"block text-sm",children:["API key",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:R,onChange:q=>X(q.target.value),type:"password",autoComplete:"off"})]}),P.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void tr(),children:"Recordar en este navegador"})]})]})]})}o0.createRoot(document.getElementById("root")).render(P.jsx(am.StrictMode,{children:P.jsx(Wb,{})}));