@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.
- package/dist/chat-proxy.d.ts +12 -0
- package/dist/chat-proxy.d.ts.map +1 -0
- package/dist/chat-proxy.js +44 -0
- package/dist/chat-proxy.js.map +1 -0
- package/dist/docs-access-express.d.ts +16 -0
- package/dist/docs-access-express.d.ts.map +1 -0
- package/dist/docs-access-express.js +187 -0
- package/dist/docs-access-express.js.map +1 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +134 -0
- package/dist/index.js.map +1 -0
- package/package.json +36 -0
- package/static/assets/index-2Nv3pxOm.css +1 -0
- package/static/assets/index-6tehJlKh.js +214 -0
- package/static/assets/index-B148KlKZ.js +247 -0
- package/static/assets/index-B7AxOqhh.js +247 -0
- package/static/assets/index-BAVM9zLs.css +1 -0
- package/static/assets/index-BD4qyClR.js +216 -0
- package/static/assets/index-BZaQe_xi.css +1 -0
- package/static/assets/index-BjWlpH_h.js +216 -0
- package/static/assets/index-BmiFV0rx.css +1 -0
- package/static/assets/index-BqIvYIJT.js +247 -0
- package/static/assets/index-BwOiuEB4.js +216 -0
- package/static/assets/index-C372jkHK.js +214 -0
- package/static/assets/index-C9S9wEor.js +217 -0
- package/static/assets/index-Cd9PPQz6.css +1 -0
- package/static/assets/index-Cf2mt1FM.css +1 -0
- package/static/assets/index-Cfn42GaL.css +1 -0
- package/static/assets/index-Ckm4kbAk.css +1 -0
- package/static/assets/index-CzGmm9SR.css +1 -0
- package/static/assets/index-D0jOSazL.js +187 -0
- package/static/assets/index-D3-lCeHu.js +214 -0
- package/static/assets/index-DDRNEd4n.js +247 -0
- package/static/assets/index-DOyViYzn.js +247 -0
- package/static/assets/index-DZsbTHIg.js +214 -0
- package/static/assets/index-DaYbWEw0.js +190 -0
- package/static/assets/index-Djqsib7P.css +1 -0
- package/static/assets/index-Ds4IYSZ4.css +1 -0
- package/static/assets/index-Dzo0Xwn5.css +1 -0
- package/static/assets/index-L47Yb4hH.js +187 -0
- package/static/assets/index-NKfaEJl0.css +1 -0
- package/static/assets/index-U9Pdo8dD.js +214 -0
- package/static/assets/index-UVEGH1D3.css +1 -0
- package/static/assets/index-mZYiGRwU.css +1 -0
- package/static/assets/index-pOjZ5m-I.js +247 -0
- package/static/assets/index-rCcLuTWw.js +216 -0
- package/static/index.html +21 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
var gy=Object.defineProperty;var yy=(t,r,i)=>r in t?gy(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i;var ga=(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 l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var vy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Jc={exports:{}},ya={},Zc={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 Qp;function xy(){if(Qp)return pt;Qp=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),x=Symbol.iterator;function _(A){return A===null||typeof A!="object"?null:(A=x&&A[x]||A["@@iterator"],typeof A=="function"?A:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,$={};function T(A,K,pe){this.props=A,this.context=K,this.refs=$,this.updater=pe||C}T.prototype.isReactComponent={},T.prototype.setState=function(A,K){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,K,"setState")},T.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function I(){}I.prototype=T.prototype;function H(A,K,pe){this.props=A,this.context=K,this.refs=$,this.updater=pe||C}var P=H.prototype=new I;P.constructor=H,j(P,T.prototype),P.isPureReactComponent=!0;var R=Array.isArray,B=Object.prototype.hasOwnProperty,V={current:null},W={key:!0,ref:!0,__self:!0,__source:!0};function Q(A,K,pe){var be,$e={},Ae=null,Oe=null;if(K!=null)for(be in K.ref!==void 0&&(Oe=K.ref),K.key!==void 0&&(Ae=""+K.key),K)B.call(K,be)&&!W.hasOwnProperty(be)&&($e[be]=K[be]);var Se=arguments.length-2;if(Se===1)$e.children=pe;else if(1<Se){for(var De=Array(Se),Ne=0;Ne<Se;Ne++)De[Ne]=arguments[Ne+2];$e.children=De}if(A&&A.defaultProps)for(be in Se=A.defaultProps,Se)$e[be]===void 0&&($e[be]=Se[be]);return{$$typeof:t,type:A,key:Ae,ref:Oe,props:$e,_owner:V.current}}function de(A,K){return{$$typeof:t,type:A.type,key:K,ref:A.ref,props:A.props,_owner:A._owner}}function ke(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function Y(A){var K={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(pe){return K[pe]})}var fe=/\/+/g;function ve(A,K){return typeof A=="object"&&A!==null&&A.key!=null?Y(""+A.key):K.toString(36)}function D(A,K,pe,be,$e){var Ae=typeof A;(Ae==="undefined"||Ae==="boolean")&&(A=null);var Oe=!1;if(A===null)Oe=!0;else switch(Ae){case"string":case"number":Oe=!0;break;case"object":switch(A.$$typeof){case t:case r:Oe=!0}}if(Oe)return Oe=A,$e=$e(Oe),A=be===""?"."+ve(Oe,0):be,R($e)?(pe="",A!=null&&(pe=A.replace(fe,"$&/")+"/"),D($e,K,pe,"",function(Ne){return Ne})):$e!=null&&(ke($e)&&($e=de($e,pe+(!$e.key||Oe&&Oe.key===$e.key?"":(""+$e.key).replace(fe,"$&/")+"/")+A)),K.push($e)),1;if(Oe=0,be=be===""?".":be+":",R(A))for(var Se=0;Se<A.length;Se++){Ae=A[Se];var De=be+ve(Ae,Se);Oe+=D(Ae,K,pe,De,$e)}else if(De=_(A),typeof De=="function")for(A=De.call(A),Se=0;!(Ae=A.next()).done;)Ae=Ae.value,De=be+ve(Ae,Se++),Oe+=D(Ae,K,pe,De,$e);else if(Ae==="object")throw K=String(A),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.");return Oe}function ue(A,K,pe){if(A==null)return A;var be=[],$e=0;return D(A,be,"","",function(Ae){return K.call(pe,Ae,$e++)}),be}function G(A){if(A._status===-1){var K=A._result;K=K(),K.then(function(pe){(A._status===0||A._status===-1)&&(A._status=1,A._result=pe)},function(pe){(A._status===0||A._status===-1)&&(A._status=2,A._result=pe)}),A._status===-1&&(A._status=0,A._result=K)}if(A._status===1)return A._result.default;throw A._result}var se={current:null},F={transition:null},q={ReactCurrentDispatcher:se,ReactCurrentBatchConfig:F,ReactCurrentOwner:V};function Z(){throw Error("act(...) is not supported in production builds of React.")}return pt.Children={map:ue,forEach:function(A,K,pe){ue(A,function(){K.apply(this,arguments)},pe)},count:function(A){var K=0;return ue(A,function(){K++}),K},toArray:function(A){return ue(A,function(K){return K})||[]},only:function(A){if(!ke(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},pt.Component=T,pt.Fragment=i,pt.Profiler=l,pt.PureComponent=H,pt.StrictMode=s,pt.Suspense=v,pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,pt.act=Z,pt.cloneElement=function(A,K,pe){if(A==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+A+".");var be=j({},A.props),$e=A.key,Ae=A.ref,Oe=A._owner;if(K!=null){if(K.ref!==void 0&&(Ae=K.ref,Oe=V.current),K.key!==void 0&&($e=""+K.key),A.type&&A.type.defaultProps)var Se=A.type.defaultProps;for(De in K)B.call(K,De)&&!W.hasOwnProperty(De)&&(be[De]=K[De]===void 0&&Se!==void 0?Se[De]:K[De])}var De=arguments.length-2;if(De===1)be.children=pe;else if(1<De){Se=Array(De);for(var Ne=0;Ne<De;Ne++)Se[Ne]=arguments[Ne+2];be.children=Se}return{$$typeof:t,type:A.type,key:$e,ref:Ae,props:be,_owner:Oe}},pt.createContext=function(A){return A={$$typeof:d,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},A.Provider={$$typeof:c,_context:A},A.Consumer=A},pt.createElement=Q,pt.createFactory=function(A){var K=Q.bind(null,A);return K.type=A,K},pt.createRef=function(){return{current:null}},pt.forwardRef=function(A){return{$$typeof:h,render:A}},pt.isValidElement=ke,pt.lazy=function(A){return{$$typeof:S,_payload:{_status:-1,_result:A},_init:G}},pt.memo=function(A,K){return{$$typeof:b,type:A,compare:K===void 0?null:K}},pt.startTransition=function(A){var K=F.transition;F.transition={};try{A()}finally{F.transition=K}},pt.unstable_act=Z,pt.useCallback=function(A,K){return se.current.useCallback(A,K)},pt.useContext=function(A){return se.current.useContext(A)},pt.useDebugValue=function(){},pt.useDeferredValue=function(A){return se.current.useDeferredValue(A)},pt.useEffect=function(A,K){return se.current.useEffect(A,K)},pt.useId=function(){return se.current.useId()},pt.useImperativeHandle=function(A,K,pe){return se.current.useImperativeHandle(A,K,pe)},pt.useInsertionEffect=function(A,K){return se.current.useInsertionEffect(A,K)},pt.useLayoutEffect=function(A,K){return se.current.useLayoutEffect(A,K)},pt.useMemo=function(A,K){return se.current.useMemo(A,K)},pt.useReducer=function(A,K,pe){return se.current.useReducer(A,K,pe)},pt.useRef=function(A){return se.current.useRef(A)},pt.useState=function(A){return se.current.useState(A)},pt.useSyncExternalStore=function(A,K,pe){return se.current.useSyncExternalStore(A,K,pe)},pt.useTransition=function(){return se.current.useTransition()},pt.version="18.3.1",pt}var Gp;function Aa(){return Gp||(Gp=1,Zc.exports=xy()),Zc.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 Jp;function wy(){if(Jp)return ya;Jp=1;var t=Aa(),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function d(h,v,b){var S,x={},_=null,C=null;b!==void 0&&(_=""+b),v.key!==void 0&&(_=""+v.key),v.ref!==void 0&&(C=v.ref);for(S in v)s.call(v,S)&&!c.hasOwnProperty(S)&&(x[S]=v[S]);if(h&&h.defaultProps)for(S in v=h.defaultProps,v)x[S]===void 0&&(x[S]=v[S]);return{$$typeof:r,type:h,key:_,ref:C,props:x,_owner:l.current}}return ya.Fragment=i,ya.jsx=d,ya.jsxs=d,ya}var Zp;function by(){return Zp||(Zp=1,Jc.exports=wy()),Jc.exports}var g=by(),U=Aa();const wm=bu(U);var Ul={},ef={exports:{}},Xn={},tf={exports:{}},nf={};/**
|
|
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 eh;function _y(){return eh||(eh=1,(function(t){function r(F,q){var Z=F.length;F.push(q);e:for(;0<Z;){var A=Z-1>>>1,K=F[A];if(0<l(K,q))F[A]=q,F[Z]=K,Z=A;else break e}}function i(F){return F.length===0?null:F[0]}function s(F){if(F.length===0)return null;var q=F[0],Z=F.pop();if(Z!==q){F[0]=Z;e:for(var A=0,K=F.length,pe=K>>>1;A<pe;){var be=2*(A+1)-1,$e=F[be],Ae=be+1,Oe=F[Ae];if(0>l($e,Z))Ae<K&&0>l(Oe,$e)?(F[A]=Oe,F[Ae]=Z,A=Ae):(F[A]=$e,F[be]=Z,A=be);else if(Ae<K&&0>l(Oe,Z))F[A]=Oe,F[Ae]=Z,A=Ae;else break e}}return q}function l(F,q){var Z=F.sortIndex-q.sortIndex;return Z!==0?Z:F.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();t.unstable_now=function(){return d.now()-h}}var v=[],b=[],S=1,x=null,_=3,C=!1,j=!1,$=!1,T=typeof setTimeout=="function"?setTimeout:null,I=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 P(F){for(var q=i(b);q!==null;){if(q.callback===null)s(b);else if(q.startTime<=F)s(b),q.sortIndex=q.expirationTime,r(v,q);else break;q=i(b)}}function R(F){if($=!1,P(F),!j)if(i(v)!==null)j=!0,G(B);else{var q=i(b);q!==null&&se(R,q.startTime-F)}}function B(F,q){j=!1,$&&($=!1,I(Q),Q=-1),C=!0;var Z=_;try{for(P(q),x=i(v);x!==null&&(!(x.expirationTime>q)||F&&!Y());){var A=x.callback;if(typeof A=="function"){x.callback=null,_=x.priorityLevel;var K=A(x.expirationTime<=q);q=t.unstable_now(),typeof K=="function"?x.callback=K:x===i(v)&&s(v),P(q)}else s(v);x=i(v)}if(x!==null)var pe=!0;else{var be=i(b);be!==null&&se(R,be.startTime-q),pe=!1}return pe}finally{x=null,_=Z,C=!1}}var V=!1,W=null,Q=-1,de=5,ke=-1;function Y(){return!(t.unstable_now()-ke<de)}function fe(){if(W!==null){var F=t.unstable_now();ke=F;var q=!0;try{q=W(!0,F)}finally{q?ve():(V=!1,W=null)}}else V=!1}var ve;if(typeof H=="function")ve=function(){H(fe)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,ue=D.port2;D.port1.onmessage=fe,ve=function(){ue.postMessage(null)}}else ve=function(){T(fe,0)};function G(F){W=F,V||(V=!0,ve())}function se(F,q){Q=T(function(){F(t.unstable_now())},q)}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(F){F.callback=null},t.unstable_continueExecution=function(){j||C||(j=!0,G(B))},t.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):de=0<F?Math.floor(1e3/F):5},t.unstable_getCurrentPriorityLevel=function(){return _},t.unstable_getFirstCallbackNode=function(){return i(v)},t.unstable_next=function(F){switch(_){case 1:case 2:case 3:var q=3;break;default:q=_}var Z=_;_=q;try{return F()}finally{_=Z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(F,q){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var Z=_;_=F;try{return q()}finally{_=Z}},t.unstable_scheduleCallback=function(F,q,Z){var A=t.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?A+Z:A):Z=A,F){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=Z+K,F={id:S++,callback:q,priorityLevel:F,startTime:Z,expirationTime:K,sortIndex:-1},Z>A?(F.sortIndex=Z,r(b,F),i(v)===null&&F===i(b)&&($?(I(Q),Q=-1):$=!0,se(R,Z-A))):(F.sortIndex=K,r(v,F),j||C||(j=!0,G(B))),F},t.unstable_shouldYield=Y,t.unstable_wrapCallback=function(F){var q=_;return function(){var Z=_;_=q;try{return F.apply(this,arguments)}finally{_=Z}}}})(nf)),nf}var th;function Sy(){return th||(th=1,tf.exports=_y()),tf.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 nh;function ky(){if(nh)return Xn;nh=1;var t=Aa(),r=Sy();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 s=new Set,l={};function c(e,n){d(e,n),d(e+"Capture",n)}function d(e,n){for(l[e]=n,e=0;e<n.length;e++)s.add(n[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),v=Object.prototype.hasOwnProperty,b=/^[: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 _(e){return v.call(x,e)?!0:v.call(S,e)?!1:b.test(e)?x[e]=!0:(S[e]=!0,!1)}function C(e,n,o,u){if(o!==null&&o.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return u?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function j(e,n,o,u){if(n===null||typeof n>"u"||C(e,n,o,u))return!0;if(u)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 $(e,n,o,u,p,y,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=u,this.attributeNamespace=p,this.mustUseProperty=o,this.propertyName=e,this.type=n,this.sanitizeURL=y,this.removeEmptyString=E}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){T[e]=new $(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 $(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){T[e]=new $(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){T[e]=new $(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 $(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){T[e]=new $(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){T[e]=new $(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){T[e]=new $(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){T[e]=new $(e,5,!1,e.toLowerCase(),null,!1,!1)});var I=/[\-:]([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(I,H);T[n]=new $(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(I,H);T[n]=new $(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(I,H);T[n]=new $(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){T[e]=new $(e,1,!1,e.toLowerCase(),null,!1,!1)}),T.xlinkHref=new $("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){T[e]=new $(e,1,!1,e.toLowerCase(),null,!0,!0)});function P(e,n,o,u){var p=T.hasOwnProperty(n)?T[n]:null;(p!==null?p.type!==0:u||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(j(n,o,p,u)&&(o=null),u||p===null?_(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,u=p.attributeNamespace,o===null?e.removeAttribute(n):(p=p.type,o=p===3||p===4&&o===!0?"":""+o,u?e.setAttributeNS(u,n,o):e.setAttribute(n,o))))}var R=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,B=Symbol.for("react.element"),V=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),de=Symbol.for("react.profiler"),ke=Symbol.for("react.provider"),Y=Symbol.for("react.context"),fe=Symbol.for("react.forward_ref"),ve=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),se=Symbol.for("react.offscreen"),F=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var Z=Object.assign,A;function K(e){if(A===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);A=n&&n[1]||""}return`
|
|
34
|
+
`+A+e}var pe=!1;function be(e,n){if(!e||pe)return"";pe=!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(xe){var u=xe}Reflect.construct(e,[],n)}else{try{n.call()}catch(xe){u=xe}e.call(n.prototype)}else{try{throw Error()}catch(xe){u=xe}e()}}catch(xe){if(xe&&u&&typeof xe.stack=="string"){for(var p=xe.stack.split(`
|
|
35
|
+
`),y=u.stack.split(`
|
|
36
|
+
`),E=p.length-1,z=y.length-1;1<=E&&0<=z&&p[E]!==y[z];)z--;for(;1<=E&&0<=z;E--,z--)if(p[E]!==y[z]){if(E!==1||z!==1)do if(E--,z--,0>z||p[E]!==y[z]){var X=`
|
|
37
|
+
`+p[E].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=E&&0<=z);break}}}finally{pe=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?K(e):""}function $e(e){switch(e.tag){case 5:return K(e.type);case 16:return K("Lazy");case 13:return K("Suspense");case 19:return K("SuspenseList");case 0:case 2:case 15:return e=be(e.type,!1),e;case 11:return e=be(e.type.render,!1),e;case 1:return e=be(e.type,!0),e;default:return""}}function Ae(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 W:return"Fragment";case V:return"Portal";case de:return"Profiler";case Q:return"StrictMode";case ve:return"Suspense";case D:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Y:return(e.displayName||"Context")+".Consumer";case ke:return(e._context.displayName||"Context")+".Provider";case fe:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ue:return n=e.displayName||null,n!==null?n:Ae(e.type)||"Memo";case G:n=e._payload,e=e._init;try{return Ae(e(n))}catch{}}return null}function Oe(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 Ae(n);case 8:return n===Q?"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 Se(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function De(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ne(e){var n=De(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),u=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var p=o.get,y=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return p.call(this)},set:function(E){u=""+E,y.call(this,E)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return u},setValue:function(E){u=""+E},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function et(e){e._valueTracker||(e._valueTracker=Ne(e))}function Fe(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),u="";return e&&(u=De(e)?e.checked?"true":"false":e.value),e=u,e!==o?(n.setValue(e),!0):!1}function Ke(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 qe(e,n){var o=n.checked;return Z({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function at(e,n){var o=n.defaultValue==null?"":n.defaultValue,u=n.checked!=null?n.checked:n.defaultChecked;o=Se(n.value!=null?n.value:o),e._wrapperState={initialChecked:u,initialValue:o,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function ot(e,n){n=n.checked,n!=null&&P(e,"checked",n,!1)}function Tt(e,n){ot(e,n);var o=Se(n.value),u=n.type;if(o!=null)u==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(u==="submit"||u==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Wt(e,n.type,o):n.hasOwnProperty("defaultValue")&&Wt(e,n.type,Se(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function xn(e,n,o){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var u=n.type;if(!(u!=="submit"&&u!=="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 Wt(e,n,o){(n!=="number"||Ke(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var Yt=Array.isArray;function kt(e,n,o,u){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&&u&&(e[o].defaultSelected=!0)}else{for(o=""+Se(o),n=null,p=0;p<e.length;p++){if(e[p].value===o){e[p].selected=!0,u&&(e[p].defaultSelected=!0);return}n!==null||e[p].disabled||(n=e[p])}n!==null&&(n.selected=!0)}}function nn(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return Z({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function dn(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(Yt(o)){if(1<o.length)throw Error(i(93));o=o[0]}n=o}n==null&&(n=""),o=n}e._wrapperState={initialValue:Se(o)}}function Pn(e,n){var o=Se(n.value),u=Se(n.defaultValue);o!=null&&(o=""+o,o!==e.value&&(e.value=o),n.defaultValue==null&&e.defaultValue!==o&&(e.defaultValue=o)),u!=null&&(e.defaultValue=""+u)}function wn(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function St(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 Xt(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?St(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ht,lr=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,o,u,p){MSApp.execUnsafeLocalFunction(function(){return e(n,o,u,p)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(Ht=Ht||document.createElement("div"),Ht.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=Ht.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function yt(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var Rn={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},Gn=["Webkit","ms","Moz","O"];Object.keys(Rn).forEach(function(e){Gn.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Rn[n]=Rn[e]})});function Ln(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||Rn.hasOwnProperty(e)&&Rn[e]?(""+n).trim():n+"px"}function Dn(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var u=o.indexOf("--")===0,p=Ln(o,n[o],u);o==="float"&&(o="cssFloat"),u?e.setProperty(o,p):e[o]=p}}var pn=Z({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 We(e,n){if(n){if(pn[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 Nt(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 $n=null;function ur(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Be=null,zn=null,Jn=null;function _r(e){if(e=ta(e)){if(typeof Be!="function")throw Error(i(280));var n=e.stateNode;n&&(n=il(n),Be(e.stateNode,e.type,n))}}function oo(e){zn?Jn?Jn.push(e):Jn=[e]:zn=e}function Br(){if(zn){var e=zn,n=Jn;if(Jn=zn=null,_r(e),n)for(e=0;e<n.length;e++)_r(n[e])}}function Ro(e,n){return e(n)}function Lo(){}var Fn=!1;function rn(e,n,o){if(Fn)return e(n,o);Fn=!0;try{return Ro(e,n,o)}finally{Fn=!1,(zn!==null||Jn!==null)&&(Lo(),Br())}}function Mn(e,n){var o=e.stateNode;if(o===null)return null;var u=il(o);if(u===null)return null;o=u[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":(u=!u.disabled)||(e=e.type,u=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!u;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(i(231,n,typeof o));return o}var cr=!1;if(h)try{var mt={};Object.defineProperty(mt,"passive",{get:function(){cr=!0}}),window.addEventListener("test",mt,mt),window.removeEventListener("test",mt,mt)}catch{cr=!1}function It(e,n,o,u,p,y,E,z,X){var xe=Array.prototype.slice.call(arguments,3);try{n.apply(o,xe)}catch(Me){this.onError(Me)}}var Sr=!1,Zn=null,er=!1,fr=null,pi={onError:function(e){Sr=!0,Zn=e}};function Tn(e,n,o,u,p,y,E,z,X){Sr=!1,Zn=null,It.apply(pi,arguments)}function dr(e,n,o,u,p,y,E,z,X){if(Tn.apply(this,arguments),Sr){if(Sr){var xe=Zn;Sr=!1,Zn=null}else throw Error(i(198));er||(er=!0,fr=xe)}}function Ft(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 pr(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 io(e){if(Ft(e)!==e)throw Error(i(188))}function Bn(e){var n=e.alternate;if(!n){if(n=Ft(e),n===null)throw Error(i(188));return n!==e?null:e}for(var o=e,u=n;;){var p=o.return;if(p===null)break;var y=p.alternate;if(y===null){if(u=p.return,u!==null){o=u;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===o)return io(p),e;if(y===u)return io(p),n;y=y.sibling}throw Error(i(188))}if(o.return!==u.return)o=p,u=y;else{for(var E=!1,z=p.child;z;){if(z===o){E=!0,o=p,u=y;break}if(z===u){E=!0,u=p,o=y;break}z=z.sibling}if(!E){for(z=y.child;z;){if(z===o){E=!0,o=y,u=p;break}if(z===u){E=!0,u=y,o=p;break}z=z.sibling}if(!E)throw Error(i(189))}}if(o.alternate!==u)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?e:n}function Hr(e){return e=Bn(e),e!==null?bn(e):null}function bn(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=bn(e);if(n!==null)return n;e=e.sibling}return null}var Vr=r.unstable_scheduleCallback,L=r.unstable_cancelCallback,_e=r.unstable_shouldYield,He=r.unstable_requestPaint,Xe=r.unstable_now,on=r.unstable_getCurrentPriorityLevel,Vt=r.unstable_ImmediatePriority,Qt=r.unstable_UserBlockingPriority,Ut=r.unstable_NormalPriority,Ct=r.unstable_LowPriority,_n=r.unstable_IdlePriority,In=null,sn=null;function ft(e){if(sn&&typeof sn.onCommitFiberRoot=="function")try{sn.onCommitFiberRoot(In,e,void 0,(e.current.flags&128)===128)}catch{}}var Kt=Math.clz32?Math.clz32:so,Do=Math.log,zo=Math.LN2;function so(e){return e>>>=0,e===0?32:31-(Do(e)/zo|0)|0}var ao=64,lo=4194304;function tr(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 u=0,p=e.suspendedLanes,y=e.pingedLanes,E=o&268435455;if(E!==0){var z=E&~p;z!==0?u=tr(z):(y&=E,y!==0&&(u=tr(y)))}else E=o&~p,E!==0?u=tr(E):y!==0&&(u=tr(y));if(u===0)return 0;if(n!==0&&n!==u&&(n&p)===0&&(p=u&-u,y=n&-n,p>=y||p===16&&(y&4194240)!==0))return n;if((u&4)!==0&&(u|=o&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=u;0<n;)o=31-Kt(n),p=1<<o,u|=e[o],n&=~p;return u}function Ur(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 uo(e,n){for(var o=e.suspendedLanes,u=e.pingedLanes,p=e.expirationTimes,y=e.pendingLanes;0<y;){var E=31-Kt(y),z=1<<E,X=p[E];X===-1?((z&o)===0||(z&u)!==0)&&(p[E]=Ur(z,n)):X<=n&&(e.expiredLanes|=z),y&=~z}}function hr(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Kr(){var e=ao;return ao<<=1,(ao&4194240)===0&&(ao=64),e}function co(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function mr(e,n,o){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-Kt(n),e[n]=o}function hi(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 u=e.eventTimes;for(e=e.expirationTimes;0<o;){var p=31-Kt(o),y=1<<p;n[p]=0,u[p]=-1,e[p]=-1,o&=~y}}function Fo(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var u=31-Kt(o),p=1<<u;p&n|e[u]&n&&(e[u]|=n),o&=~p}}var wt=0;function Ha(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var ht,Ui,Va,Ua,Sn,qr=!1,fo=[],hn=null,kr=null,Nr=null,At=new Map,mn=new Map,Hn=[],mi="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":hn=null;break;case"dragenter":case"dragleave":kr=null;break;case"mouseover":case"mouseout":Nr=null;break;case"pointerover":case"pointerout":At.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":mn.delete(n.pointerId)}}function Vn(e,n,o,u,p,y){return e===null||e.nativeEvent!==y?(e={blockedOn:n,domEventName:o,eventSystemFlags:u,nativeEvent:y,targetContainers:[p]},n!==null&&(n=ta(n),n!==null&&Ui(n)),e):(e.eventSystemFlags|=u,n=e.targetContainers,p!==null&&n.indexOf(p)===-1&&n.push(p),e)}function Ru(e,n,o,u,p){switch(n){case"focusin":return hn=Vn(hn,e,n,o,u,p),!0;case"dragenter":return kr=Vn(kr,e,n,o,u,p),!0;case"mouseover":return Nr=Vn(Nr,e,n,o,u,p),!0;case"pointerover":var y=p.pointerId;return At.set(y,Vn(At.get(y)||null,e,n,o,u,p)),!0;case"gotpointercapture":return y=p.pointerId,mn.set(y,Vn(mn.get(y)||null,e,n,o,u,p)),!0}return!1}function nr(e){var n=Si(e.target);if(n!==null){var o=Ft(n);if(o!==null){if(n=o.tag,n===13){if(n=pr(o),n!==null){e.blockedOn=n,Sn(e.priority,function(){Va(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 Bo(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=Ho(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(o===null){o=e.nativeEvent;var u=new o.constructor(o.type,o);$n=u,o.target.dispatchEvent(u),$n=null}else return n=ta(o),n!==null&&Ui(n),e.blockedOn=o,!1;n.shift()}return!0}function Ls(e,n,o){Bo(e)&&o.delete(n)}function Ds(){qr=!1,hn!==null&&Bo(hn)&&(hn=null),kr!==null&&Bo(kr)&&(kr=null),Nr!==null&&Bo(Nr)&&(Nr=null),At.forEach(Ls),mn.forEach(Ls)}function Er(e,n){e.blockedOn===n&&(e.blockedOn=null,qr||(qr=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Ds)))}function po(e){function n(p){return Er(p,e)}if(0<fo.length){Er(fo[0],e);for(var o=1;o<fo.length;o++){var u=fo[o];u.blockedOn===e&&(u.blockedOn=null)}}for(hn!==null&&Er(hn,e),kr!==null&&Er(kr,e),Nr!==null&&Er(Nr,e),At.forEach(n),mn.forEach(n),o=0;o<Hn.length;o++)u=Hn[o],u.blockedOn===e&&(u.blockedOn=null);for(;0<Hn.length&&(o=Hn[0],o.blockedOn===null);)nr(o),o.blockedOn===null&&Hn.shift()}var ho=R.ReactCurrentBatchConfig,qi=!0;function gi(e,n,o,u){var p=wt,y=ho.transition;ho.transition=null;try{wt=1,zs(e,n,o,u)}finally{wt=p,ho.transition=y}}function Lu(e,n,o,u){var p=wt,y=ho.transition;ho.transition=null;try{wt=4,zs(e,n,o,u)}finally{wt=p,ho.transition=y}}function zs(e,n,o,u){if(qi){var p=Ho(e,n,o,u);if(p===null)Hu(e,n,u,mo,o),Ki(e,u);else if(Ru(p,e,n,o,u))u.stopPropagation();else if(Ki(e,u),n&4&&-1<mi.indexOf(e)){for(;p!==null;){var y=ta(p);if(y!==null&&ht(y),y=Ho(e,n,o,u),y===null&&Hu(e,n,u,mo,o),y===p)break;p=y}p!==null&&u.stopPropagation()}else Hu(e,n,u,null,o)}}var mo=null;function Ho(e,n,o,u){if(mo=null,e=ur(u),e=Si(e),e!==null)if(n=Ft(e),n===null)e=null;else if(o=n.tag,o===13){if(e=pr(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 mo=e,null}function Wi(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(on()){case Vt:return 1;case Qt:return 4;case Ut:case Ct:return 16;case _n:return 536870912;default:return 16}default:return 16}}var Wr=null,Fs=null,Yi=null;function Xi(){if(Yi)return Yi;var e,n=Fs,o=n.length,u,p="value"in Wr?Wr.value:Wr.textContent,y=p.length;for(e=0;e<o&&n[e]===p[e];e++);var E=o-e;for(u=1;u<=E&&n[o-u]===p[y-u];u++);return Yi=p.slice(e,1<u?1-u:void 0)}function Vo(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 yi(){return!0}function vi(){return!1}function an(e){function n(o,u,p,y,E){this._reactName=o,this._targetInst=p,this.type=u,this.nativeEvent=y,this.target=E,this.currentTarget=null;for(var z in e)e.hasOwnProperty(z)&&(o=e[z],this[z]=o?o(y):y[z]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?yi:vi,this.isPropagationStopped=vi,this}return Z(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=yi)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=yi)},persist:function(){},isPersistent:yi}),n}var Cr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qi=an(Cr),xi=Z({},Cr,{view:0,detail:0}),Uo=an(xi),go,wi,yo,Ko=Z({},xi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ns,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!==yo&&(yo&&e.type==="mousemove"?(go=e.screenX-yo.screenX,wi=e.screenY-yo.screenY):wi=go=0,yo=e),go)},movementY:function(e){return"movementY"in e?e.movementY:wi}}),Gi=an(Ko),ln=Z({},Ko,{dataTransfer:0}),bi=an(ln),_i=Z({},xi,{relatedTarget:0}),Ji=an(_i),Zi=Z({},Cr,{animationName:0,elapsedTime:0,pseudoElement:0}),Ka=an(Zi),qa=Z({},Cr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),es=an(qa),Bs=Z({},Cr,{data:0}),Yr=an(Bs),Hs={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vs={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"},ts={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Us(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=ts[e])?!!n[e]:!1}function ns(){return Us}var Du=Z({},xi,{key:function(e){if(e.key){var n=Hs[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Vo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Vs[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ns,charCode:function(e){return e.type==="keypress"?Vo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Vo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ks=an(Du),rs=Z({},Ko,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wa=an(rs),qs=Z({},xi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ns}),Ws=an(qs),zu=Z({},Cr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ya=an(zu),Fu=Z({},Ko,{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}),Xa=an(Fu),Qa=[9,13,27,32],Ys=h&&"CompositionEvent"in window,qo=null;h&&"documentMode"in document&&(qo=document.documentMode);var Xs=h&&"TextEvent"in window&&!qo,Qs=h&&(!Ys||qo&&8<qo&&11>=qo),Gs=" ",Ga=!1;function Ja(e,n){switch(e){case"keyup":return Qa.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Za(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var jr=!1;function Pr(e,n){switch(e){case"compositionend":return Za(n);case"keypress":return n.which!==32?null:(Ga=!0,Gs);case"textInput":return e=n.data,e===Gs&&Ga?null:e;default:return null}}function Lt(e,n){if(jr)return e==="compositionend"||!Ys&&Ja(e,n)?(e=Xi(),Yi=Fs=Wr=null,jr=!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 Qs&&n.locale!=="ko"?null:n.data;default:return null}}var os={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 vo(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!os[e.type]:n==="textarea"}function el(e,n,o,u){oo(u),n=nl(n,"onChange"),0<n.length&&(o=new Qi("onChange","change",null,o,u),e.push({event:o,listeners:n}))}var xo=null,Wo=null;function wo(e){dd(e,0)}function Yo(e){var n=ls(e);if(Fe(n))return e}function Xo(e,n){if(e==="change")return n}var $r=!1;if(h){var is;if(h){var a="oninput"in document;if(!a){var f=document.createElement("div");f.setAttribute("oninput","return;"),a=typeof f.oninput=="function"}is=a}else is=!1;$r=is&&(!document.documentMode||9<document.documentMode)}function m(){xo&&(xo.detachEvent("onpropertychange",w),Wo=xo=null)}function w(e){if(e.propertyName==="value"&&Yo(Wo)){var n=[];el(n,Wo,e,ur(e)),rn(wo,n)}}function k(e,n,o){e==="focusin"?(m(),xo=n,Wo=o,xo.attachEvent("onpropertychange",w)):e==="focusout"&&m()}function N(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Yo(Wo)}function M(e,n){if(e==="click")return Yo(n)}function O(e,n){if(e==="input"||e==="change")return Yo(n)}function ee(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var ce=typeof Object.is=="function"?Object.is:ee;function ne(e,n){if(ce(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var o=Object.keys(e),u=Object.keys(n);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var p=o[u];if(!v.call(n,p)||!ce(e[p],n[p]))return!1}return!0}function J(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function te(e,n){var o=J(e);e=0;for(var u;o;){if(o.nodeType===3){if(u=e+o.textContent.length,e<=n&&u>=n)return{node:o,offset:n-e};e=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=J(o)}}function le(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?le(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function ie(){for(var e=window,n=Ke();n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=Ke(e.document)}return n}function oe(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 ae(e){var n=ie(),o=e.focusedElem,u=e.selectionRange;if(n!==o&&o&&o.ownerDocument&&le(o.ownerDocument.documentElement,o)){if(u!==null&&oe(o)){if(n=u.start,e=u.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,y=Math.min(u.start,p);u=u.end===void 0?y:Math.min(u.end,p),!e.extend&&y>u&&(p=u,u=y,y=p),p=te(o,y);var E=te(o,u);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(),y>u?(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 ye=h&&"documentMode"in document&&11>=document.documentMode,he=null,we=null,Ee=null,je=!1;function Le(e,n,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;je||he==null||he!==Ke(u)||(u=he,"selectionStart"in u&&oe(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Ee&&ne(Ee,u)||(Ee=u,u=nl(we,"onSelect"),0<u.length&&(n=new Qi("onSelect","select",null,n,o),e.push({event:n,listeners:u}),n.target=he)))}function Te(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var Ve={animationend:Te("Animation","AnimationEnd"),animationiteration:Te("Animation","AnimationIteration"),animationstart:Te("Animation","AnimationStart"),transitionend:Te("Transition","TransitionEnd")},Re={},Ye={};h&&(Ye=document.createElement("div").style,"AnimationEvent"in window||(delete Ve.animationend.animation,delete Ve.animationiteration.animation,delete Ve.animationstart.animation),"TransitionEvent"in window||delete Ve.transitionend.transition);function Ce(e){if(Re[e])return Re[e];if(!Ve[e])return e;var n=Ve[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in Ye)return Re[e]=n[o];return e}var it=Ce("animationend"),st=Ce("animationiteration"),ct=Ce("animationstart"),dt=Ce("transitionend"),kn=new Map,ut="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){kn.set(e,n),c(n,[e])}for(var Gt=0;Gt<ut.length;Gt++){var Qo=ut[Gt],gn=Qo.toLowerCase(),bo=Qo[0].toUpperCase()+Qo.slice(1);jt(gn,"on"+bo)}jt(it,"onAnimationEnd"),jt(st,"onAnimationIteration"),jt(ct,"onAnimationStart"),jt("dblclick","onDoubleClick"),jt("focusin","onFocus"),jt("focusout","onBlur"),jt(dt,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _o="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(" "),Cg=new Set("cancel close invalid load scroll toggle".split(" ").concat(_o));function fd(e,n,o){var u=e.type||"unknown-event";e.currentTarget=o,dr(u,n,void 0,e),e.currentTarget=null}function dd(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var u=e[o],p=u.event;u=u.listeners;e:{var y=void 0;if(n)for(var E=u.length-1;0<=E;E--){var z=u[E],X=z.instance,xe=z.currentTarget;if(z=z.listener,X!==y&&p.isPropagationStopped())break e;fd(p,z,xe),y=X}else for(E=0;E<u.length;E++){if(z=u[E],X=z.instance,xe=z.currentTarget,z=z.listener,X!==y&&p.isPropagationStopped())break e;fd(p,z,xe),y=X}}}if(er)throw e=fr,er=!1,fr=null,e}function Pt(e,n){var o=n[Yu];o===void 0&&(o=n[Yu]=new Set);var u=e+"__bubble";o.has(u)||(pd(n,e,2,!1),o.add(u))}function Bu(e,n,o){var u=0;n&&(u|=4),pd(o,e,u,n)}var tl="_reactListening"+Math.random().toString(36).slice(2);function Js(e){if(!e[tl]){e[tl]=!0,s.forEach(function(o){o!=="selectionchange"&&(Cg.has(o)||Bu(o,!1,e),Bu(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[tl]||(n[tl]=!0,Bu("selectionchange",!1,n))}}function pd(e,n,o,u){switch(Wi(n)){case 1:var p=gi;break;case 4:p=Lu;break;default:p=zs}o=p.bind(null,n,o,e),p=void 0,!cr||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(p=!0),u?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 Hu(e,n,o,u,p){var y=u;if((n&1)===0&&(n&2)===0&&u!==null)e:for(;;){if(u===null)return;var E=u.tag;if(E===3||E===4){var z=u.stateNode.containerInfo;if(z===p||z.nodeType===8&&z.parentNode===p)break;if(E===4)for(E=u.return;E!==null;){var X=E.tag;if((X===3||X===4)&&(X=E.stateNode.containerInfo,X===p||X.nodeType===8&&X.parentNode===p))return;E=E.return}for(;z!==null;){if(E=Si(z),E===null)return;if(X=E.tag,X===5||X===6){u=y=E;continue e}z=z.parentNode}}u=u.return}rn(function(){var xe=y,Me=ur(o),Ie=[];e:{var Pe=kn.get(e);if(Pe!==void 0){var Ue=Qi,Ge=e;switch(e){case"keypress":if(Vo(o)===0)break e;case"keydown":case"keyup":Ue=Ks;break;case"focusin":Ge="focus",Ue=Ji;break;case"focusout":Ge="blur",Ue=Ji;break;case"beforeblur":case"afterblur":Ue=Ji;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":Ue=Gi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ue=bi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ue=Ws;break;case it:case st:case ct:Ue=Ka;break;case dt:Ue=Ya;break;case"scroll":Ue=Uo;break;case"wheel":Ue=Xa;break;case"copy":case"cut":case"paste":Ue=es;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ue=Wa}var Je=(n&4)!==0,qt=!Je&&e==="scroll",me=Je?Pe!==null?Pe+"Capture":null:Pe;Je=[];for(var re=xe,ge;re!==null;){ge=re;var ze=ge.stateNode;if(ge.tag===5&&ze!==null&&(ge=ze,me!==null&&(ze=Mn(re,me),ze!=null&&Je.push(Zs(re,ze,ge)))),qt)break;re=re.return}0<Je.length&&(Pe=new Ue(Pe,Ge,null,o,Me),Ie.push({event:Pe,listeners:Je}))}}if((n&7)===0){e:{if(Pe=e==="mouseover"||e==="pointerover",Ue=e==="mouseout"||e==="pointerout",Pe&&o!==$n&&(Ge=o.relatedTarget||o.fromElement)&&(Si(Ge)||Ge[So]))break e;if((Ue||Pe)&&(Pe=Me.window===Me?Me:(Pe=Me.ownerDocument)?Pe.defaultView||Pe.parentWindow:window,Ue?(Ge=o.relatedTarget||o.toElement,Ue=xe,Ge=Ge?Si(Ge):null,Ge!==null&&(qt=Ft(Ge),Ge!==qt||Ge.tag!==5&&Ge.tag!==6)&&(Ge=null)):(Ue=null,Ge=xe),Ue!==Ge)){if(Je=Gi,ze="onMouseLeave",me="onMouseEnter",re="mouse",(e==="pointerout"||e==="pointerover")&&(Je=Wa,ze="onPointerLeave",me="onPointerEnter",re="pointer"),qt=Ue==null?Pe:ls(Ue),ge=Ge==null?Pe:ls(Ge),Pe=new Je(ze,re+"leave",Ue,o,Me),Pe.target=qt,Pe.relatedTarget=ge,ze=null,Si(Me)===xe&&(Je=new Je(me,re+"enter",Ge,o,Me),Je.target=ge,Je.relatedTarget=qt,ze=Je),qt=ze,Ue&&Ge)t:{for(Je=Ue,me=Ge,re=0,ge=Je;ge;ge=ss(ge))re++;for(ge=0,ze=me;ze;ze=ss(ze))ge++;for(;0<re-ge;)Je=ss(Je),re--;for(;0<ge-re;)me=ss(me),ge--;for(;re--;){if(Je===me||me!==null&&Je===me.alternate)break t;Je=ss(Je),me=ss(me)}Je=null}else Je=null;Ue!==null&&hd(Ie,Pe,Ue,Je,!1),Ge!==null&&qt!==null&&hd(Ie,qt,Ge,Je,!0)}}e:{if(Pe=xe?ls(xe):window,Ue=Pe.nodeName&&Pe.nodeName.toLowerCase(),Ue==="select"||Ue==="input"&&Pe.type==="file")var Ze=Xo;else if(vo(Pe))if($r)Ze=O;else{Ze=N;var nt=k}else(Ue=Pe.nodeName)&&Ue.toLowerCase()==="input"&&(Pe.type==="checkbox"||Pe.type==="radio")&&(Ze=M);if(Ze&&(Ze=Ze(e,xe))){el(Ie,Ze,o,Me);break e}nt&&nt(e,Pe,xe),e==="focusout"&&(nt=Pe._wrapperState)&&nt.controlled&&Pe.type==="number"&&Wt(Pe,"number",Pe.value)}switch(nt=xe?ls(xe):window,e){case"focusin":(vo(nt)||nt.contentEditable==="true")&&(he=nt,we=xe,Ee=null);break;case"focusout":Ee=we=he=null;break;case"mousedown":je=!0;break;case"contextmenu":case"mouseup":case"dragend":je=!1,Le(Ie,o,Me);break;case"selectionchange":if(ye)break;case"keydown":case"keyup":Le(Ie,o,Me)}var rt;if(Ys)e:{switch(e){case"compositionstart":var lt="onCompositionStart";break e;case"compositionend":lt="onCompositionEnd";break e;case"compositionupdate":lt="onCompositionUpdate";break e}lt=void 0}else jr?Ja(e,o)&&(lt="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(lt="onCompositionStart");lt&&(Qs&&o.locale!=="ko"&&(jr||lt!=="onCompositionStart"?lt==="onCompositionEnd"&&jr&&(rt=Xi()):(Wr=Me,Fs="value"in Wr?Wr.value:Wr.textContent,jr=!0)),nt=nl(xe,lt),0<nt.length&&(lt=new Yr(lt,e,null,o,Me),Ie.push({event:lt,listeners:nt}),rt?lt.data=rt:(rt=Za(o),rt!==null&&(lt.data=rt)))),(rt=Xs?Pr(e,o):Lt(e,o))&&(xe=nl(xe,"onBeforeInput"),0<xe.length&&(Me=new Yr("onBeforeInput","beforeinput",null,o,Me),Ie.push({event:Me,listeners:xe}),Me.data=rt))}dd(Ie,n)})}function Zs(e,n,o){return{instance:e,listener:n,currentTarget:o}}function nl(e,n){for(var o=n+"Capture",u=[];e!==null;){var p=e,y=p.stateNode;p.tag===5&&y!==null&&(p=y,y=Mn(e,o),y!=null&&u.unshift(Zs(e,y,p)),y=Mn(e,n),y!=null&&u.push(Zs(e,y,p))),e=e.return}return u}function ss(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function hd(e,n,o,u,p){for(var y=n._reactName,E=[];o!==null&&o!==u;){var z=o,X=z.alternate,xe=z.stateNode;if(X!==null&&X===u)break;z.tag===5&&xe!==null&&(z=xe,p?(X=Mn(o,y),X!=null&&E.unshift(Zs(o,X,z))):p||(X=Mn(o,y),X!=null&&E.push(Zs(o,X,z)))),o=o.return}E.length!==0&&e.push({event:n,listeners:E})}var jg=/\r\n?/g,Pg=/\u0000|\uFFFD/g;function md(e){return(typeof e=="string"?e:""+e).replace(jg,`
|
|
38
|
+
`).replace(Pg,"")}function rl(e,n,o){if(n=md(n),md(e)!==n&&o)throw Error(i(425))}function ol(){}var Vu=null,Uu=null;function Ku(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 qu=typeof setTimeout=="function"?setTimeout:void 0,$g=typeof clearTimeout=="function"?clearTimeout:void 0,gd=typeof Promise=="function"?Promise:void 0,Mg=typeof queueMicrotask=="function"?queueMicrotask:typeof gd<"u"?function(e){return gd.resolve(null).then(e).catch(Tg)}:qu;function Tg(e){setTimeout(function(){throw e})}function Wu(e,n){var o=n,u=0;do{var p=o.nextSibling;if(e.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"){if(u===0){e.removeChild(p),po(n);return}u--}else o!=="$"&&o!=="$?"&&o!=="$!"||u++;o=p}while(o);po(n)}function Go(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 yd(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 as=Math.random().toString(36).slice(2),Xr="__reactFiber$"+as,ea="__reactProps$"+as,So="__reactContainer$"+as,Yu="__reactEvents$"+as,Ig="__reactListeners$"+as,Ag="__reactHandles$"+as;function Si(e){var n=e[Xr];if(n)return n;for(var o=e.parentNode;o;){if(n=o[So]||o[Xr]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=yd(e);e!==null;){if(o=e[Xr])return o;e=yd(e)}return n}e=o,o=e.parentNode}return null}function ta(e){return e=e[Xr]||e[So],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ls(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function il(e){return e[ea]||null}var Xu=[],us=-1;function Jo(e){return{current:e}}function $t(e){0>us||(e.current=Xu[us],Xu[us]=null,us--)}function Et(e,n){us++,Xu[us]=e.current,e.current=n}var Zo={},Nn=Jo(Zo),Un=Jo(!1),ki=Zo;function cs(e,n){var o=e.type.contextTypes;if(!o)return Zo;var u=e.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===n)return u.__reactInternalMemoizedMaskedChildContext;var p={},y;for(y in o)p[y]=n[y];return u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=p),p}function Kn(e){return e=e.childContextTypes,e!=null}function sl(){$t(Un),$t(Nn)}function vd(e,n,o){if(Nn.current!==Zo)throw Error(i(168));Et(Nn,n),Et(Un,o)}function xd(e,n,o){var u=e.stateNode;if(n=n.childContextTypes,typeof u.getChildContext!="function")return o;u=u.getChildContext();for(var p in u)if(!(p in n))throw Error(i(108,Oe(e)||"Unknown",p));return Z({},o,u)}function al(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zo,ki=Nn.current,Et(Nn,e),Et(Un,Un.current),!0}function wd(e,n,o){var u=e.stateNode;if(!u)throw Error(i(169));o?(e=xd(e,n,ki),u.__reactInternalMemoizedMergedChildContext=e,$t(Un),$t(Nn),Et(Nn,e)):$t(Un),Et(Un,o)}var ko=null,ll=!1,Qu=!1;function bd(e){ko===null?ko=[e]:ko.push(e)}function Og(e){ll=!0,bd(e)}function ei(){if(!Qu&&ko!==null){Qu=!0;var e=0,n=wt;try{var o=ko;for(wt=1;e<o.length;e++){var u=o[e];do u=u(!0);while(u!==null)}ko=null,ll=!1}catch(p){throw ko!==null&&(ko=ko.slice(e+1)),Vr(Vt,ei),p}finally{wt=n,Qu=!1}}return null}var fs=[],ds=0,ul=null,cl=0,gr=[],yr=0,Ni=null,No=1,Eo="";function Ei(e,n){fs[ds++]=cl,fs[ds++]=ul,ul=e,cl=n}function _d(e,n,o){gr[yr++]=No,gr[yr++]=Eo,gr[yr++]=Ni,Ni=e;var u=No;e=Eo;var p=32-Kt(u)-1;u&=~(1<<p),o+=1;var y=32-Kt(n)+p;if(30<y){var E=p-p%5;y=(u&(1<<E)-1).toString(32),u>>=E,p-=E,No=1<<32-Kt(n)+p|o<<p|u,Eo=y+e}else No=1<<y|o<<p|u,Eo=e}function Gu(e){e.return!==null&&(Ei(e,1),_d(e,1,0))}function Ju(e){for(;e===ul;)ul=fs[--ds],fs[ds]=null,cl=fs[--ds],fs[ds]=null;for(;e===Ni;)Ni=gr[--yr],gr[yr]=null,Eo=gr[--yr],gr[yr]=null,No=gr[--yr],gr[yr]=null}var rr=null,or=null,Ot=!1,Mr=null;function Sd(e,n){var o=br(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 kd(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,rr=e,or=Go(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,rr=e,or=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(o=Ni!==null?{id:No,overflow:Eo}:null,e.memoizedState={dehydrated:n,treeContext:o,retryLane:1073741824},o=br(18,null,null,0),o.stateNode=n,o.return=e,e.child=o,rr=e,or=null,!0):!1;default:return!1}}function Zu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ec(e){if(Ot){var n=or;if(n){var o=n;if(!kd(e,n)){if(Zu(e))throw Error(i(418));n=Go(o.nextSibling);var u=rr;n&&kd(e,n)?Sd(u,o):(e.flags=e.flags&-4097|2,Ot=!1,rr=e)}}else{if(Zu(e))throw Error(i(418));e.flags=e.flags&-4097|2,Ot=!1,rr=e}}}function Nd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;rr=e}function fl(e){if(e!==rr)return!1;if(!Ot)return Nd(e),Ot=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Ku(e.type,e.memoizedProps)),n&&(n=or)){if(Zu(e))throw Ed(),Error(i(418));for(;n;)Sd(e,n),n=Go(n.nextSibling)}if(Nd(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){or=Go(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++}e=e.nextSibling}or=null}}else or=rr?Go(e.stateNode.nextSibling):null;return!0}function Ed(){for(var e=or;e;)e=Go(e.nextSibling)}function ps(){or=rr=null,Ot=!1}function tc(e){Mr===null?Mr=[e]:Mr.push(e)}var Rg=R.ReactCurrentBatchConfig;function na(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 u=o.stateNode}if(!u)throw Error(i(147,e));var p=u,y=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===y?n.ref:(n=function(E){var z=p.refs;E===null?delete z[y]:z[y]=E},n._stringRef=y,n)}if(typeof e!="string")throw Error(i(284));if(!o._owner)throw Error(i(290,e))}return e}function dl(e,n){throw e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function Cd(e){var n=e._init;return n(e._payload)}function jd(e){function n(me,re){if(e){var ge=me.deletions;ge===null?(me.deletions=[re],me.flags|=16):ge.push(re)}}function o(me,re){if(!e)return null;for(;re!==null;)n(me,re),re=re.sibling;return null}function u(me,re){for(me=new Map;re!==null;)re.key!==null?me.set(re.key,re):me.set(re.index,re),re=re.sibling;return me}function p(me,re){return me=li(me,re),me.index=0,me.sibling=null,me}function y(me,re,ge){return me.index=ge,e?(ge=me.alternate,ge!==null?(ge=ge.index,ge<re?(me.flags|=2,re):ge):(me.flags|=2,re)):(me.flags|=1048576,re)}function E(me){return e&&me.alternate===null&&(me.flags|=2),me}function z(me,re,ge,ze){return re===null||re.tag!==6?(re=qc(ge,me.mode,ze),re.return=me,re):(re=p(re,ge),re.return=me,re)}function X(me,re,ge,ze){var Ze=ge.type;return Ze===W?Me(me,re,ge.props.children,ze,ge.key):re!==null&&(re.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===G&&Cd(Ze)===re.type)?(ze=p(re,ge.props),ze.ref=na(me,re,ge),ze.return=me,ze):(ze=Rl(ge.type,ge.key,ge.props,null,me.mode,ze),ze.ref=na(me,re,ge),ze.return=me,ze)}function xe(me,re,ge,ze){return re===null||re.tag!==4||re.stateNode.containerInfo!==ge.containerInfo||re.stateNode.implementation!==ge.implementation?(re=Wc(ge,me.mode,ze),re.return=me,re):(re=p(re,ge.children||[]),re.return=me,re)}function Me(me,re,ge,ze,Ze){return re===null||re.tag!==7?(re=Ai(ge,me.mode,ze,Ze),re.return=me,re):(re=p(re,ge),re.return=me,re)}function Ie(me,re,ge){if(typeof re=="string"&&re!==""||typeof re=="number")return re=qc(""+re,me.mode,ge),re.return=me,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case B:return ge=Rl(re.type,re.key,re.props,null,me.mode,ge),ge.ref=na(me,null,re),ge.return=me,ge;case V:return re=Wc(re,me.mode,ge),re.return=me,re;case G:var ze=re._init;return Ie(me,ze(re._payload),ge)}if(Yt(re)||q(re))return re=Ai(re,me.mode,ge,null),re.return=me,re;dl(me,re)}return null}function Pe(me,re,ge,ze){var Ze=re!==null?re.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number")return Ze!==null?null:z(me,re,""+ge,ze);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case B:return ge.key===Ze?X(me,re,ge,ze):null;case V:return ge.key===Ze?xe(me,re,ge,ze):null;case G:return Ze=ge._init,Pe(me,re,Ze(ge._payload),ze)}if(Yt(ge)||q(ge))return Ze!==null?null:Me(me,re,ge,ze,null);dl(me,ge)}return null}function Ue(me,re,ge,ze,Ze){if(typeof ze=="string"&&ze!==""||typeof ze=="number")return me=me.get(ge)||null,z(re,me,""+ze,Ze);if(typeof ze=="object"&&ze!==null){switch(ze.$$typeof){case B:return me=me.get(ze.key===null?ge:ze.key)||null,X(re,me,ze,Ze);case V:return me=me.get(ze.key===null?ge:ze.key)||null,xe(re,me,ze,Ze);case G:var nt=ze._init;return Ue(me,re,ge,nt(ze._payload),Ze)}if(Yt(ze)||q(ze))return me=me.get(ge)||null,Me(re,me,ze,Ze,null);dl(re,ze)}return null}function Ge(me,re,ge,ze){for(var Ze=null,nt=null,rt=re,lt=re=0,fn=null;rt!==null&<<ge.length;lt++){rt.index>lt?(fn=rt,rt=null):fn=rt.sibling;var bt=Pe(me,rt,ge[lt],ze);if(bt===null){rt===null&&(rt=fn);break}e&&rt&&bt.alternate===null&&n(me,rt),re=y(bt,re,lt),nt===null?Ze=bt:nt.sibling=bt,nt=bt,rt=fn}if(lt===ge.length)return o(me,rt),Ot&&Ei(me,lt),Ze;if(rt===null){for(;lt<ge.length;lt++)rt=Ie(me,ge[lt],ze),rt!==null&&(re=y(rt,re,lt),nt===null?Ze=rt:nt.sibling=rt,nt=rt);return Ot&&Ei(me,lt),Ze}for(rt=u(me,rt);lt<ge.length;lt++)fn=Ue(rt,me,lt,ge[lt],ze),fn!==null&&(e&&fn.alternate!==null&&rt.delete(fn.key===null?lt:fn.key),re=y(fn,re,lt),nt===null?Ze=fn:nt.sibling=fn,nt=fn);return e&&rt.forEach(function(ui){return n(me,ui)}),Ot&&Ei(me,lt),Ze}function Je(me,re,ge,ze){var Ze=q(ge);if(typeof Ze!="function")throw Error(i(150));if(ge=Ze.call(ge),ge==null)throw Error(i(151));for(var nt=Ze=null,rt=re,lt=re=0,fn=null,bt=ge.next();rt!==null&&!bt.done;lt++,bt=ge.next()){rt.index>lt?(fn=rt,rt=null):fn=rt.sibling;var ui=Pe(me,rt,bt.value,ze);if(ui===null){rt===null&&(rt=fn);break}e&&rt&&ui.alternate===null&&n(me,rt),re=y(ui,re,lt),nt===null?Ze=ui:nt.sibling=ui,nt=ui,rt=fn}if(bt.done)return o(me,rt),Ot&&Ei(me,lt),Ze;if(rt===null){for(;!bt.done;lt++,bt=ge.next())bt=Ie(me,bt.value,ze),bt!==null&&(re=y(bt,re,lt),nt===null?Ze=bt:nt.sibling=bt,nt=bt);return Ot&&Ei(me,lt),Ze}for(rt=u(me,rt);!bt.done;lt++,bt=ge.next())bt=Ue(rt,me,lt,bt.value,ze),bt!==null&&(e&&bt.alternate!==null&&rt.delete(bt.key===null?lt:bt.key),re=y(bt,re,lt),nt===null?Ze=bt:nt.sibling=bt,nt=bt);return e&&rt.forEach(function(my){return n(me,my)}),Ot&&Ei(me,lt),Ze}function qt(me,re,ge,ze){if(typeof ge=="object"&&ge!==null&&ge.type===W&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case B:e:{for(var Ze=ge.key,nt=re;nt!==null;){if(nt.key===Ze){if(Ze=ge.type,Ze===W){if(nt.tag===7){o(me,nt.sibling),re=p(nt,ge.props.children),re.return=me,me=re;break e}}else if(nt.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===G&&Cd(Ze)===nt.type){o(me,nt.sibling),re=p(nt,ge.props),re.ref=na(me,nt,ge),re.return=me,me=re;break e}o(me,nt);break}else n(me,nt);nt=nt.sibling}ge.type===W?(re=Ai(ge.props.children,me.mode,ze,ge.key),re.return=me,me=re):(ze=Rl(ge.type,ge.key,ge.props,null,me.mode,ze),ze.ref=na(me,re,ge),ze.return=me,me=ze)}return E(me);case V:e:{for(nt=ge.key;re!==null;){if(re.key===nt)if(re.tag===4&&re.stateNode.containerInfo===ge.containerInfo&&re.stateNode.implementation===ge.implementation){o(me,re.sibling),re=p(re,ge.children||[]),re.return=me,me=re;break e}else{o(me,re);break}else n(me,re);re=re.sibling}re=Wc(ge,me.mode,ze),re.return=me,me=re}return E(me);case G:return nt=ge._init,qt(me,re,nt(ge._payload),ze)}if(Yt(ge))return Ge(me,re,ge,ze);if(q(ge))return Je(me,re,ge,ze);dl(me,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"?(ge=""+ge,re!==null&&re.tag===6?(o(me,re.sibling),re=p(re,ge),re.return=me,me=re):(o(me,re),re=qc(ge,me.mode,ze),re.return=me,me=re),E(me)):o(me,re)}return qt}var hs=jd(!0),Pd=jd(!1),pl=Jo(null),hl=null,ms=null,nc=null;function rc(){nc=ms=hl=null}function oc(e){var n=pl.current;$t(pl),e._currentValue=n}function ic(e,n,o){for(;e!==null;){var u=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,u!==null&&(u.childLanes|=n)):u!==null&&(u.childLanes&n)!==n&&(u.childLanes|=n),e===o)break;e=e.return}}function gs(e,n){hl=e,nc=ms=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(qn=!0),e.firstContext=null)}function vr(e){var n=e._currentValue;if(nc!==e)if(e={context:e,memoizedValue:n,next:null},ms===null){if(hl===null)throw Error(i(308));ms=e,hl.dependencies={lanes:0,firstContext:e}}else ms=ms.next=e;return n}var Ci=null;function sc(e){Ci===null?Ci=[e]:Ci.push(e)}function $d(e,n,o,u){var p=n.interleaved;return p===null?(o.next=o,sc(n)):(o.next=p.next,p.next=o),n.interleaved=o,Co(e,u)}function Co(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 ti=!1;function ac(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Md(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 jo(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function ni(e,n,o){var u=e.updateQueue;if(u===null)return null;if(u=u.shared,(xt&2)!==0){var p=u.pending;return p===null?n.next=n:(n.next=p.next,p.next=n),u.pending=n,Co(e,o)}return p=u.interleaved,p===null?(n.next=n,sc(u)):(n.next=p.next,p.next=n),u.interleaved=n,Co(e,o)}function ml(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194240)!==0)){var u=n.lanes;u&=e.pendingLanes,o|=u,n.lanes=o,Fo(e,o)}}function Td(e,n){var o=e.updateQueue,u=e.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var p=null,y=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};y===null?p=y=E:y=y.next=E,o=o.next}while(o!==null);y===null?p=y=n:y=y.next=n}else p=y=n;o={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:u.shared,effects:u.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}function gl(e,n,o,u){var p=e.updateQueue;ti=!1;var y=p.firstBaseUpdate,E=p.lastBaseUpdate,z=p.shared.pending;if(z!==null){p.shared.pending=null;var X=z,xe=X.next;X.next=null,E===null?y=xe:E.next=xe,E=X;var Me=e.alternate;Me!==null&&(Me=Me.updateQueue,z=Me.lastBaseUpdate,z!==E&&(z===null?Me.firstBaseUpdate=xe:z.next=xe,Me.lastBaseUpdate=X))}if(y!==null){var Ie=p.baseState;E=0,Me=xe=X=null,z=y;do{var Pe=z.lane,Ue=z.eventTime;if((u&Pe)===Pe){Me!==null&&(Me=Me.next={eventTime:Ue,lane:0,tag:z.tag,payload:z.payload,callback:z.callback,next:null});e:{var Ge=e,Je=z;switch(Pe=n,Ue=o,Je.tag){case 1:if(Ge=Je.payload,typeof Ge=="function"){Ie=Ge.call(Ue,Ie,Pe);break e}Ie=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=Je.payload,Pe=typeof Ge=="function"?Ge.call(Ue,Ie,Pe):Ge,Pe==null)break e;Ie=Z({},Ie,Pe);break e;case 2:ti=!0}}z.callback!==null&&z.lane!==0&&(e.flags|=64,Pe=p.effects,Pe===null?p.effects=[z]:Pe.push(z))}else Ue={eventTime:Ue,lane:Pe,tag:z.tag,payload:z.payload,callback:z.callback,next:null},Me===null?(xe=Me=Ue,X=Ie):Me=Me.next=Ue,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(Me===null&&(X=Ie),p.baseState=X,p.firstBaseUpdate=xe,p.lastBaseUpdate=Me,n=p.shared.interleaved,n!==null){p=n;do E|=p.lane,p=p.next;while(p!==n)}else y===null&&(p.shared.lanes=0);$i|=E,e.lanes=E,e.memoizedState=Ie}}function Id(e,n,o){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var u=e[n],p=u.callback;if(p!==null){if(u.callback=null,u=o,typeof p!="function")throw Error(i(191,p));p.call(u)}}}var ra={},Qr=Jo(ra),oa=Jo(ra),ia=Jo(ra);function ji(e){if(e===ra)throw Error(i(174));return e}function lc(e,n){switch(Et(ia,n),Et(oa,e),Et(Qr,ra),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:Xt(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=Xt(n,e)}$t(Qr),Et(Qr,n)}function ys(){$t(Qr),$t(oa),$t(ia)}function Ad(e){ji(ia.current);var n=ji(Qr.current),o=Xt(n,e.type);n!==o&&(Et(oa,e),Et(Qr,o))}function uc(e){oa.current===e&&($t(Qr),$t(oa))}var Dt=Jo(0);function yl(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 cc=[];function fc(){for(var e=0;e<cc.length;e++)cc[e]._workInProgressVersionPrimary=null;cc.length=0}var vl=R.ReactCurrentDispatcher,dc=R.ReactCurrentBatchConfig,Pi=0,zt=null,en=null,un=null,xl=!1,sa=!1,aa=0,Lg=0;function En(){throw Error(i(321))}function pc(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!ce(e[o],n[o]))return!1;return!0}function hc(e,n,o,u,p,y){if(Pi=y,zt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,vl.current=e===null||e.memoizedState===null?Bg:Hg,e=o(u,p),sa){y=0;do{if(sa=!1,aa=0,25<=y)throw Error(i(301));y+=1,un=en=null,n.updateQueue=null,vl.current=Vg,e=o(u,p)}while(sa)}if(vl.current=_l,n=en!==null&&en.next!==null,Pi=0,un=en=zt=null,xl=!1,n)throw Error(i(300));return e}function mc(){var e=aa!==0;return aa=0,e}function Gr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return un===null?zt.memoizedState=un=e:un=un.next=e,un}function xr(){if(en===null){var e=zt.alternate;e=e!==null?e.memoizedState:null}else e=en.next;var n=un===null?zt.memoizedState:un.next;if(n!==null)un=n,en=e;else{if(e===null)throw Error(i(310));en=e,e={memoizedState:en.memoizedState,baseState:en.baseState,baseQueue:en.baseQueue,queue:en.queue,next:null},un===null?zt.memoizedState=un=e:un=un.next=e}return un}function la(e,n){return typeof n=="function"?n(e):n}function gc(e){var n=xr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var u=en,p=u.baseQueue,y=o.pending;if(y!==null){if(p!==null){var E=p.next;p.next=y.next,y.next=E}u.baseQueue=p=y,o.pending=null}if(p!==null){y=p.next,u=u.baseState;var z=E=null,X=null,xe=y;do{var Me=xe.lane;if((Pi&Me)===Me)X!==null&&(X=X.next={lane:0,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null}),u=xe.hasEagerState?xe.eagerState:e(u,xe.action);else{var Ie={lane:Me,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null};X===null?(z=X=Ie,E=u):X=X.next=Ie,zt.lanes|=Me,$i|=Me}xe=xe.next}while(xe!==null&&xe!==y);X===null?E=u:X.next=z,ce(u,n.memoizedState)||(qn=!0),n.memoizedState=u,n.baseState=E,n.baseQueue=X,o.lastRenderedState=u}if(e=o.interleaved,e!==null){p=e;do y=p.lane,zt.lanes|=y,$i|=y,p=p.next;while(p!==e)}else p===null&&(o.lanes=0);return[n.memoizedState,o.dispatch]}function yc(e){var n=xr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var u=o.dispatch,p=o.pending,y=n.memoizedState;if(p!==null){o.pending=null;var E=p=p.next;do y=e(y,E.action),E=E.next;while(E!==p);ce(y,n.memoizedState)||(qn=!0),n.memoizedState=y,n.baseQueue===null&&(n.baseState=y),o.lastRenderedState=y}return[y,u]}function Od(){}function Rd(e,n){var o=zt,u=xr(),p=n(),y=!ce(u.memoizedState,p);if(y&&(u.memoizedState=p,qn=!0),u=u.queue,vc(zd.bind(null,o,u,e),[e]),u.getSnapshot!==n||y||un!==null&&un.memoizedState.tag&1){if(o.flags|=2048,ua(9,Dd.bind(null,o,u,p,n),void 0,null),cn===null)throw Error(i(349));(Pi&30)!==0||Ld(o,n,p)}return p}function Ld(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=zt.updateQueue,n===null?(n={lastEffect:null,stores:null},zt.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function Dd(e,n,o,u){n.value=o,n.getSnapshot=u,Fd(n)&&Bd(e)}function zd(e,n,o){return o(function(){Fd(n)&&Bd(e)})}function Fd(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!ce(e,o)}catch{return!0}}function Bd(e){var n=Co(e,1);n!==null&&Or(n,e,1,-1)}function Hd(e){var n=Gr();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:e},n.queue=e,e=e.dispatch=Fg.bind(null,zt,e),[n.memoizedState,e]}function ua(e,n,o,u){return e={tag:e,create:n,destroy:o,deps:u,next:null},n=zt.updateQueue,n===null?(n={lastEffect:null,stores:null},zt.updateQueue=n,n.lastEffect=e.next=e):(o=n.lastEffect,o===null?n.lastEffect=e.next=e:(u=o.next,o.next=e,e.next=u,n.lastEffect=e)),e}function Vd(){return xr().memoizedState}function wl(e,n,o,u){var p=Gr();zt.flags|=e,p.memoizedState=ua(1|n,o,void 0,u===void 0?null:u)}function bl(e,n,o,u){var p=xr();u=u===void 0?null:u;var y=void 0;if(en!==null){var E=en.memoizedState;if(y=E.destroy,u!==null&&pc(u,E.deps)){p.memoizedState=ua(n,o,y,u);return}}zt.flags|=e,p.memoizedState=ua(1|n,o,y,u)}function Ud(e,n){return wl(8390656,8,e,n)}function vc(e,n){return bl(2048,8,e,n)}function Kd(e,n){return bl(4,2,e,n)}function qd(e,n){return bl(4,4,e,n)}function Wd(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 Yd(e,n,o){return o=o!=null?o.concat([e]):null,bl(4,4,Wd.bind(null,n,e),o)}function xc(){}function Xd(e,n){var o=xr();n=n===void 0?null:n;var u=o.memoizedState;return u!==null&&n!==null&&pc(n,u[1])?u[0]:(o.memoizedState=[e,n],e)}function Qd(e,n){var o=xr();n=n===void 0?null:n;var u=o.memoizedState;return u!==null&&n!==null&&pc(n,u[1])?u[0]:(e=e(),o.memoizedState=[e,n],e)}function Gd(e,n,o){return(Pi&21)===0?(e.baseState&&(e.baseState=!1,qn=!0),e.memoizedState=o):(ce(o,n)||(o=Kr(),zt.lanes|=o,$i|=o,e.baseState=!0),n)}function Dg(e,n){var o=wt;wt=o!==0&&4>o?o:4,e(!0);var u=dc.transition;dc.transition={};try{e(!1),n()}finally{wt=o,dc.transition=u}}function Jd(){return xr().memoizedState}function zg(e,n,o){var u=si(e);if(o={lane:u,action:o,hasEagerState:!1,eagerState:null,next:null},Zd(e))ep(n,o);else if(o=$d(e,n,o,u),o!==null){var p=On();Or(o,e,u,p),tp(o,n,u)}}function Fg(e,n,o){var u=si(e),p={lane:u,action:o,hasEagerState:!1,eagerState:null,next:null};if(Zd(e))ep(n,p);else{var y=e.alternate;if(e.lanes===0&&(y===null||y.lanes===0)&&(y=n.lastRenderedReducer,y!==null))try{var E=n.lastRenderedState,z=y(E,o);if(p.hasEagerState=!0,p.eagerState=z,ce(z,E)){var X=n.interleaved;X===null?(p.next=p,sc(n)):(p.next=X.next,X.next=p),n.interleaved=p;return}}catch{}finally{}o=$d(e,n,p,u),o!==null&&(p=On(),Or(o,e,u,p),tp(o,n,u))}}function Zd(e){var n=e.alternate;return e===zt||n!==null&&n===zt}function ep(e,n){sa=xl=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function tp(e,n,o){if((o&4194240)!==0){var u=n.lanes;u&=e.pendingLanes,o|=u,n.lanes=o,Fo(e,o)}}var _l={readContext:vr,useCallback:En,useContext:En,useEffect:En,useImperativeHandle:En,useInsertionEffect:En,useLayoutEffect:En,useMemo:En,useReducer:En,useRef:En,useState:En,useDebugValue:En,useDeferredValue:En,useTransition:En,useMutableSource:En,useSyncExternalStore:En,useId:En,unstable_isNewReconciler:!1},Bg={readContext:vr,useCallback:function(e,n){return Gr().memoizedState=[e,n===void 0?null:n],e},useContext:vr,useEffect:Ud,useImperativeHandle:function(e,n,o){return o=o!=null?o.concat([e]):null,wl(4194308,4,Wd.bind(null,n,e),o)},useLayoutEffect:function(e,n){return wl(4194308,4,e,n)},useInsertionEffect:function(e,n){return wl(4,2,e,n)},useMemo:function(e,n){var o=Gr();return n=n===void 0?null:n,e=e(),o.memoizedState=[e,n],e},useReducer:function(e,n,o){var u=Gr();return n=o!==void 0?o(n):n,u.memoizedState=u.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},u.queue=e,e=e.dispatch=zg.bind(null,zt,e),[u.memoizedState,e]},useRef:function(e){var n=Gr();return e={current:e},n.memoizedState=e},useState:Hd,useDebugValue:xc,useDeferredValue:function(e){return Gr().memoizedState=e},useTransition:function(){var e=Hd(!1),n=e[0];return e=Dg.bind(null,e[1]),Gr().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,o){var u=zt,p=Gr();if(Ot){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),cn===null)throw Error(i(349));(Pi&30)!==0||Ld(u,n,o)}p.memoizedState=o;var y={value:o,getSnapshot:n};return p.queue=y,Ud(zd.bind(null,u,y,e),[e]),u.flags|=2048,ua(9,Dd.bind(null,u,y,o,n),void 0,null),o},useId:function(){var e=Gr(),n=cn.identifierPrefix;if(Ot){var o=Eo,u=No;o=(u&~(1<<32-Kt(u)-1)).toString(32)+o,n=":"+n+"R"+o,o=aa++,0<o&&(n+="H"+o.toString(32)),n+=":"}else o=Lg++,n=":"+n+"r"+o.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},Hg={readContext:vr,useCallback:Xd,useContext:vr,useEffect:vc,useImperativeHandle:Yd,useInsertionEffect:Kd,useLayoutEffect:qd,useMemo:Qd,useReducer:gc,useRef:Vd,useState:function(){return gc(la)},useDebugValue:xc,useDeferredValue:function(e){var n=xr();return Gd(n,en.memoizedState,e)},useTransition:function(){var e=gc(la)[0],n=xr().memoizedState;return[e,n]},useMutableSource:Od,useSyncExternalStore:Rd,useId:Jd,unstable_isNewReconciler:!1},Vg={readContext:vr,useCallback:Xd,useContext:vr,useEffect:vc,useImperativeHandle:Yd,useInsertionEffect:Kd,useLayoutEffect:qd,useMemo:Qd,useReducer:yc,useRef:Vd,useState:function(){return yc(la)},useDebugValue:xc,useDeferredValue:function(e){var n=xr();return en===null?n.memoizedState=e:Gd(n,en.memoizedState,e)},useTransition:function(){var e=yc(la)[0],n=xr().memoizedState;return[e,n]},useMutableSource:Od,useSyncExternalStore:Rd,useId:Jd,unstable_isNewReconciler:!1};function Tr(e,n){if(e&&e.defaultProps){n=Z({},n),e=e.defaultProps;for(var o in e)n[o]===void 0&&(n[o]=e[o]);return n}return n}function wc(e,n,o,u){n=e.memoizedState,o=o(u,n),o=o==null?n:Z({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var Sl={isMounted:function(e){return(e=e._reactInternals)?Ft(e)===e:!1},enqueueSetState:function(e,n,o){e=e._reactInternals;var u=On(),p=si(e),y=jo(u,p);y.payload=n,o!=null&&(y.callback=o),n=ni(e,y,p),n!==null&&(Or(n,e,p,u),ml(n,e,p))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var u=On(),p=si(e),y=jo(u,p);y.tag=1,y.payload=n,o!=null&&(y.callback=o),n=ni(e,y,p),n!==null&&(Or(n,e,p,u),ml(n,e,p))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=On(),u=si(e),p=jo(o,u);p.tag=2,n!=null&&(p.callback=n),n=ni(e,p,u),n!==null&&(Or(n,e,u,o),ml(n,e,u))}};function np(e,n,o,u,p,y,E){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(u,y,E):n.prototype&&n.prototype.isPureReactComponent?!ne(o,u)||!ne(p,y):!0}function rp(e,n,o){var u=!1,p=Zo,y=n.contextType;return typeof y=="object"&&y!==null?y=vr(y):(p=Kn(n)?ki:Nn.current,u=n.contextTypes,y=(u=u!=null)?cs(e,p):Zo),n=new n(o,y),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Sl,e.stateNode=n,n._reactInternals=e,u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=p,e.__reactInternalMemoizedMaskedChildContext=y),n}function op(e,n,o,u){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,u),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,u),n.state!==e&&Sl.enqueueReplaceState(n,n.state,null)}function bc(e,n,o,u){var p=e.stateNode;p.props=o,p.state=e.memoizedState,p.refs={},ac(e);var y=n.contextType;typeof y=="object"&&y!==null?p.context=vr(y):(y=Kn(n)?ki:Nn.current,p.context=cs(e,y)),p.state=e.memoizedState,y=n.getDerivedStateFromProps,typeof y=="function"&&(wc(e,n,y,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&&Sl.enqueueReplaceState(p,p.state,null),gl(e,o,p,u),p.state=e.memoizedState),typeof p.componentDidMount=="function"&&(e.flags|=4194308)}function vs(e,n){try{var o="",u=n;do o+=$e(u),u=u.return;while(u);var p=o}catch(y){p=`
|
|
39
|
+
Error generating stack: `+y.message+`
|
|
40
|
+
`+y.stack}return{value:e,source:n,stack:p,digest:null}}function _c(e,n,o){return{value:e,source:null,stack:o??null,digest:n??null}}function Sc(e,n){try{console.error(n.value)}catch(o){setTimeout(function(){throw o})}}var Ug=typeof WeakMap=="function"?WeakMap:Map;function ip(e,n,o){o=jo(-1,o),o.tag=3,o.payload={element:null};var u=n.value;return o.callback=function(){$l||($l=!0,Dc=u),Sc(e,n)},o}function sp(e,n,o){o=jo(-1,o),o.tag=3;var u=e.type.getDerivedStateFromError;if(typeof u=="function"){var p=n.value;o.payload=function(){return u(p)},o.callback=function(){Sc(e,n)}}var y=e.stateNode;return y!==null&&typeof y.componentDidCatch=="function"&&(o.callback=function(){Sc(e,n),typeof u!="function"&&(oi===null?oi=new Set([this]):oi.add(this));var E=n.stack;this.componentDidCatch(n.value,{componentStack:E!==null?E:""})}),o}function ap(e,n,o){var u=e.pingCache;if(u===null){u=e.pingCache=new Ug;var p=new Set;u.set(n,p)}else p=u.get(n),p===void 0&&(p=new Set,u.set(n,p));p.has(o)||(p.add(o),e=oy.bind(null,e,n,o),n.then(e,e))}function lp(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 up(e,n,o,u,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=jo(-1,1),n.tag=2,ni(o,n,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=p,e)}var Kg=R.ReactCurrentOwner,qn=!1;function An(e,n,o,u){n.child=e===null?Pd(n,null,o,u):hs(n,e.child,o,u)}function cp(e,n,o,u,p){o=o.render;var y=n.ref;return gs(n,p),u=hc(e,n,o,u,y,p),o=mc(),e!==null&&!qn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,Po(e,n,p)):(Ot&&o&&Gu(n),n.flags|=1,An(e,n,u,p),n.child)}function fp(e,n,o,u,p){if(e===null){var y=o.type;return typeof y=="function"&&!Kc(y)&&y.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(n.tag=15,n.type=y,dp(e,n,y,u,p)):(e=Rl(o.type,null,u,n,n.mode,p),e.ref=n.ref,e.return=n,n.child=e)}if(y=e.child,(e.lanes&p)===0){var E=y.memoizedProps;if(o=o.compare,o=o!==null?o:ne,o(E,u)&&e.ref===n.ref)return Po(e,n,p)}return n.flags|=1,e=li(y,u),e.ref=n.ref,e.return=n,n.child=e}function dp(e,n,o,u,p){if(e!==null){var y=e.memoizedProps;if(ne(y,u)&&e.ref===n.ref)if(qn=!1,n.pendingProps=u=y,(e.lanes&p)!==0)(e.flags&131072)!==0&&(qn=!0);else return n.lanes=e.lanes,Po(e,n,p)}return kc(e,n,o,u,p)}function pp(e,n,o){var u=n.pendingProps,p=u.children,y=e!==null?e.memoizedState:null;if(u.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Et(ws,ir),ir|=o;else{if((o&1073741824)===0)return e=y!==null?y.baseLanes|o:o,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,Et(ws,ir),ir|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=y!==null?y.baseLanes:o,Et(ws,ir),ir|=u}else y!==null?(u=y.baseLanes|o,n.memoizedState=null):u=o,Et(ws,ir),ir|=u;return An(e,n,p,o),n.child}function hp(e,n){var o=n.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(n.flags|=512,n.flags|=2097152)}function kc(e,n,o,u,p){var y=Kn(o)?ki:Nn.current;return y=cs(n,y),gs(n,p),o=hc(e,n,o,u,y,p),u=mc(),e!==null&&!qn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,Po(e,n,p)):(Ot&&u&&Gu(n),n.flags|=1,An(e,n,o,p),n.child)}function mp(e,n,o,u,p){if(Kn(o)){var y=!0;al(n)}else y=!1;if(gs(n,p),n.stateNode===null)Nl(e,n),rp(n,o,u),bc(n,o,u,p),u=!0;else if(e===null){var E=n.stateNode,z=n.memoizedProps;E.props=z;var X=E.context,xe=o.contextType;typeof xe=="object"&&xe!==null?xe=vr(xe):(xe=Kn(o)?ki:Nn.current,xe=cs(n,xe));var Me=o.getDerivedStateFromProps,Ie=typeof Me=="function"||typeof E.getSnapshotBeforeUpdate=="function";Ie||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(z!==u||X!==xe)&&op(n,E,u,xe),ti=!1;var Pe=n.memoizedState;E.state=Pe,gl(n,u,E,p),X=n.memoizedState,z!==u||Pe!==X||Un.current||ti?(typeof Me=="function"&&(wc(n,o,Me,u),X=n.memoizedState),(z=ti||np(n,o,z,u,Pe,X,xe))?(Ie||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=u,n.memoizedState=X),E.props=u,E.state=X,E.context=xe,u=z):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{E=n.stateNode,Md(e,n),z=n.memoizedProps,xe=n.type===n.elementType?z:Tr(n.type,z),E.props=xe,Ie=n.pendingProps,Pe=E.context,X=o.contextType,typeof X=="object"&&X!==null?X=vr(X):(X=Kn(o)?ki:Nn.current,X=cs(n,X));var Ue=o.getDerivedStateFromProps;(Me=typeof Ue=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(z!==Ie||Pe!==X)&&op(n,E,u,X),ti=!1,Pe=n.memoizedState,E.state=Pe,gl(n,u,E,p);var Ge=n.memoizedState;z!==Ie||Pe!==Ge||Un.current||ti?(typeof Ue=="function"&&(wc(n,o,Ue,u),Ge=n.memoizedState),(xe=ti||np(n,o,xe,u,Pe,Ge,X)||!1)?(Me||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(u,Ge,X),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(u,Ge,X)),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=u,n.memoizedState=Ge),E.props=u,E.state=Ge,E.context=X,u=xe):(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),u=!1)}return Nc(e,n,o,u,y,p)}function Nc(e,n,o,u,p,y){hp(e,n);var E=(n.flags&128)!==0;if(!u&&!E)return p&&wd(n,o,!1),Po(e,n,y);u=n.stateNode,Kg.current=n;var z=E&&typeof o.getDerivedStateFromError!="function"?null:u.render();return n.flags|=1,e!==null&&E?(n.child=hs(n,e.child,null,y),n.child=hs(n,null,z,y)):An(e,n,z,y),n.memoizedState=u.state,p&&wd(n,o,!0),n.child}function gp(e){var n=e.stateNode;n.pendingContext?vd(e,n.pendingContext,n.pendingContext!==n.context):n.context&&vd(e,n.context,!1),lc(e,n.containerInfo)}function yp(e,n,o,u,p){return ps(),tc(p),n.flags|=256,An(e,n,o,u),n.child}var Ec={dehydrated:null,treeContext:null,retryLane:0};function Cc(e){return{baseLanes:e,cachePool:null,transitions:null}}function vp(e,n,o){var u=n.pendingProps,p=Dt.current,y=!1,E=(n.flags&128)!==0,z;if((z=E)||(z=e!==null&&e.memoizedState===null?!1:(p&2)!==0),z?(y=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(p|=1),Et(Dt,p&1),e===null)return ec(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=u.children,e=u.fallback,y?(u=n.mode,y=n.child,E={mode:"hidden",children:E},(u&1)===0&&y!==null?(y.childLanes=0,y.pendingProps=E):y=Ll(E,u,0,null),e=Ai(e,u,o,null),y.return=n,e.return=n,y.sibling=e,n.child=y,n.child.memoizedState=Cc(o),n.memoizedState=Ec,e):jc(n,E));if(p=e.memoizedState,p!==null&&(z=p.dehydrated,z!==null))return qg(e,n,E,u,z,p,o);if(y){y=u.fallback,E=n.mode,p=e.child,z=p.sibling;var X={mode:"hidden",children:u.children};return(E&1)===0&&n.child!==p?(u=n.child,u.childLanes=0,u.pendingProps=X,n.deletions=null):(u=li(p,X),u.subtreeFlags=p.subtreeFlags&14680064),z!==null?y=li(z,y):(y=Ai(y,E,o,null),y.flags|=2),y.return=n,u.return=n,u.sibling=y,n.child=u,u=y,y=n.child,E=e.child.memoizedState,E=E===null?Cc(o):{baseLanes:E.baseLanes|o,cachePool:null,transitions:E.transitions},y.memoizedState=E,y.childLanes=e.childLanes&~o,n.memoizedState=Ec,u}return y=e.child,e=y.sibling,u=li(y,{mode:"visible",children:u.children}),(n.mode&1)===0&&(u.lanes=o),u.return=n,u.sibling=null,e!==null&&(o=n.deletions,o===null?(n.deletions=[e],n.flags|=16):o.push(e)),n.child=u,n.memoizedState=null,u}function jc(e,n){return n=Ll({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function kl(e,n,o,u){return u!==null&&tc(u),hs(n,e.child,null,o),e=jc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function qg(e,n,o,u,p,y,E){if(o)return n.flags&256?(n.flags&=-257,u=_c(Error(i(422))),kl(e,n,E,u)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(y=u.fallback,p=n.mode,u=Ll({mode:"visible",children:u.children},p,0,null),y=Ai(y,p,E,null),y.flags|=2,u.return=n,y.return=n,u.sibling=y,n.child=u,(n.mode&1)!==0&&hs(n,e.child,null,E),n.child.memoizedState=Cc(E),n.memoizedState=Ec,y);if((n.mode&1)===0)return kl(e,n,E,null);if(p.data==="$!"){if(u=p.nextSibling&&p.nextSibling.dataset,u)var z=u.dgst;return u=z,y=Error(i(419)),u=_c(y,u,void 0),kl(e,n,E,u)}if(z=(E&e.childLanes)!==0,qn||z){if(u=cn,u!==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&(u.suspendedLanes|E))!==0?0:p,p!==0&&p!==y.retryLane&&(y.retryLane=p,Co(e,p),Or(u,e,p,-1))}return Uc(),u=_c(Error(i(421))),kl(e,n,E,u)}return p.data==="$?"?(n.flags|=128,n.child=e.child,n=iy.bind(null,e),p._reactRetry=n,null):(e=y.treeContext,or=Go(p.nextSibling),rr=n,Ot=!0,Mr=null,e!==null&&(gr[yr++]=No,gr[yr++]=Eo,gr[yr++]=Ni,No=e.id,Eo=e.overflow,Ni=n),n=jc(n,u.children),n.flags|=4096,n)}function xp(e,n,o){e.lanes|=n;var u=e.alternate;u!==null&&(u.lanes|=n),ic(e.return,n,o)}function Pc(e,n,o,u,p){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:p}:(y.isBackwards=n,y.rendering=null,y.renderingStartTime=0,y.last=u,y.tail=o,y.tailMode=p)}function wp(e,n,o){var u=n.pendingProps,p=u.revealOrder,y=u.tail;if(An(e,n,u.children,o),u=Dt.current,(u&2)!==0)u=u&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&&xp(e,o,n);else if(e.tag===19)xp(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}u&=1}if(Et(Dt,u),(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&&yl(e)===null&&(p=o),o=o.sibling;o=p,o===null?(p=n.child,n.child=null):(p=o.sibling,o.sibling=null),Pc(n,!1,p,o,y);break;case"backwards":for(o=null,p=n.child,n.child=null;p!==null;){if(e=p.alternate,e!==null&&yl(e)===null){n.child=p;break}e=p.sibling,p.sibling=o,o=p,p=e}Pc(n,!0,o,null,y);break;case"together":Pc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function Nl(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function Po(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),$i|=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=li(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=li(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function Wg(e,n,o){switch(n.tag){case 3:gp(n),ps();break;case 5:Ad(n);break;case 1:Kn(n.type)&&al(n);break;case 4:lc(n,n.stateNode.containerInfo);break;case 10:var u=n.type._context,p=n.memoizedProps.value;Et(pl,u._currentValue),u._currentValue=p;break;case 13:if(u=n.memoizedState,u!==null)return u.dehydrated!==null?(Et(Dt,Dt.current&1),n.flags|=128,null):(o&n.child.childLanes)!==0?vp(e,n,o):(Et(Dt,Dt.current&1),e=Po(e,n,o),e!==null?e.sibling:null);Et(Dt,Dt.current&1);break;case 19:if(u=(o&n.childLanes)!==0,(e.flags&128)!==0){if(u)return wp(e,n,o);n.flags|=128}if(p=n.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Et(Dt,Dt.current),u)break;return null;case 22:case 23:return n.lanes=0,pp(e,n,o)}return Po(e,n,o)}var bp,$c,_p,Sp;bp=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}},$c=function(){},_p=function(e,n,o,u){var p=e.memoizedProps;if(p!==u){e=n.stateNode,ji(Qr.current);var y=null;switch(o){case"input":p=qe(e,p),u=qe(e,u),y=[];break;case"select":p=Z({},p,{value:void 0}),u=Z({},u,{value:void 0}),y=[];break;case"textarea":p=nn(e,p),u=nn(e,u),y=[];break;default:typeof p.onClick!="function"&&typeof u.onClick=="function"&&(e.onclick=ol)}We(o,u);var E;o=null;for(xe in p)if(!u.hasOwnProperty(xe)&&p.hasOwnProperty(xe)&&p[xe]!=null)if(xe==="style"){var z=p[xe];for(E in z)z.hasOwnProperty(E)&&(o||(o={}),o[E]="")}else xe!=="dangerouslySetInnerHTML"&&xe!=="children"&&xe!=="suppressContentEditableWarning"&&xe!=="suppressHydrationWarning"&&xe!=="autoFocus"&&(l.hasOwnProperty(xe)?y||(y=[]):(y=y||[]).push(xe,null));for(xe in u){var X=u[xe];if(z=p!=null?p[xe]:void 0,u.hasOwnProperty(xe)&&X!==z&&(X!=null||z!=null))if(xe==="style")if(z){for(E in z)!z.hasOwnProperty(E)||X&&X.hasOwnProperty(E)||(o||(o={}),o[E]="");for(E in X)X.hasOwnProperty(E)&&z[E]!==X[E]&&(o||(o={}),o[E]=X[E])}else o||(y||(y=[]),y.push(xe,o)),o=X;else xe==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,z=z?z.__html:void 0,X!=null&&z!==X&&(y=y||[]).push(xe,X)):xe==="children"?typeof X!="string"&&typeof X!="number"||(y=y||[]).push(xe,""+X):xe!=="suppressContentEditableWarning"&&xe!=="suppressHydrationWarning"&&(l.hasOwnProperty(xe)?(X!=null&&xe==="onScroll"&&Pt("scroll",e),y||z===X||(y=[])):(y=y||[]).push(xe,X))}o&&(y=y||[]).push("style",o);var xe=y;(n.updateQueue=xe)&&(n.flags|=4)}},Sp=function(e,n,o,u){o!==u&&(n.flags|=4)};function ca(e,n){if(!Ot)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 u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:u.sibling=null}}function Cn(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,u=0;if(n)for(var p=e.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags&14680064,u|=p.flags&14680064,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=u,e.childLanes=o,n}function Yg(e,n,o){var u=n.pendingProps;switch(Ju(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cn(n),null;case 1:return Kn(n.type)&&sl(),Cn(n),null;case 3:return u=n.stateNode,ys(),$t(Un),$t(Nn),fc(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(e===null||e.child===null)&&(fl(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Mr!==null&&(Bc(Mr),Mr=null))),$c(e,n),Cn(n),null;case 5:uc(n);var p=ji(ia.current);if(o=n.type,e!==null&&n.stateNode!=null)_p(e,n,o,u,p),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!u){if(n.stateNode===null)throw Error(i(166));return Cn(n),null}if(e=ji(Qr.current),fl(n)){u=n.stateNode,o=n.type;var y=n.memoizedProps;switch(u[Xr]=n,u[ea]=y,e=(n.mode&1)!==0,o){case"dialog":Pt("cancel",u),Pt("close",u);break;case"iframe":case"object":case"embed":Pt("load",u);break;case"video":case"audio":for(p=0;p<_o.length;p++)Pt(_o[p],u);break;case"source":Pt("error",u);break;case"img":case"image":case"link":Pt("error",u),Pt("load",u);break;case"details":Pt("toggle",u);break;case"input":at(u,y),Pt("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!y.multiple},Pt("invalid",u);break;case"textarea":dn(u,y),Pt("invalid",u)}We(o,y),p=null;for(var E in y)if(y.hasOwnProperty(E)){var z=y[E];E==="children"?typeof z=="string"?u.textContent!==z&&(y.suppressHydrationWarning!==!0&&rl(u.textContent,z,e),p=["children",z]):typeof z=="number"&&u.textContent!==""+z&&(y.suppressHydrationWarning!==!0&&rl(u.textContent,z,e),p=["children",""+z]):l.hasOwnProperty(E)&&z!=null&&E==="onScroll"&&Pt("scroll",u)}switch(o){case"input":et(u),xn(u,y,!0);break;case"textarea":et(u),wn(u);break;case"select":case"option":break;default:typeof y.onClick=="function"&&(u.onclick=ol)}u=p,n.updateQueue=u,u!==null&&(n.flags|=4)}else{E=p.nodeType===9?p:p.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=St(o)),e==="http://www.w3.org/1999/xhtml"?o==="script"?(e=E.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof u.is=="string"?e=E.createElement(o,{is:u.is}):(e=E.createElement(o),o==="select"&&(E=e,u.multiple?E.multiple=!0:u.size&&(E.size=u.size))):e=E.createElementNS(e,o),e[Xr]=n,e[ea]=u,bp(e,n,!1,!1),n.stateNode=e;e:{switch(E=Nt(o,u),o){case"dialog":Pt("cancel",e),Pt("close",e),p=u;break;case"iframe":case"object":case"embed":Pt("load",e),p=u;break;case"video":case"audio":for(p=0;p<_o.length;p++)Pt(_o[p],e);p=u;break;case"source":Pt("error",e),p=u;break;case"img":case"image":case"link":Pt("error",e),Pt("load",e),p=u;break;case"details":Pt("toggle",e),p=u;break;case"input":at(e,u),p=qe(e,u),Pt("invalid",e);break;case"option":p=u;break;case"select":e._wrapperState={wasMultiple:!!u.multiple},p=Z({},u,{value:void 0}),Pt("invalid",e);break;case"textarea":dn(e,u),p=nn(e,u),Pt("invalid",e);break;default:p=u}We(o,p),z=p;for(y in z)if(z.hasOwnProperty(y)){var X=z[y];y==="style"?Dn(e,X):y==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,X!=null&&lr(e,X)):y==="children"?typeof X=="string"?(o!=="textarea"||X!=="")&&yt(e,X):typeof X=="number"&&yt(e,""+X):y!=="suppressContentEditableWarning"&&y!=="suppressHydrationWarning"&&y!=="autoFocus"&&(l.hasOwnProperty(y)?X!=null&&y==="onScroll"&&Pt("scroll",e):X!=null&&P(e,y,X,E))}switch(o){case"input":et(e),xn(e,u,!1);break;case"textarea":et(e),wn(e);break;case"option":u.value!=null&&e.setAttribute("value",""+Se(u.value));break;case"select":e.multiple=!!u.multiple,y=u.value,y!=null?kt(e,!!u.multiple,y,!1):u.defaultValue!=null&&kt(e,!!u.multiple,u.defaultValue,!0);break;default:typeof p.onClick=="function"&&(e.onclick=ol)}switch(o){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return Cn(n),null;case 6:if(e&&n.stateNode!=null)Sp(e,n,e.memoizedProps,u);else{if(typeof u!="string"&&n.stateNode===null)throw Error(i(166));if(o=ji(ia.current),ji(Qr.current),fl(n)){if(u=n.stateNode,o=n.memoizedProps,u[Xr]=n,(y=u.nodeValue!==o)&&(e=rr,e!==null))switch(e.tag){case 3:rl(u.nodeValue,o,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&rl(u.nodeValue,o,(e.mode&1)!==0)}y&&(n.flags|=4)}else u=(o.nodeType===9?o:o.ownerDocument).createTextNode(u),u[Xr]=n,n.stateNode=u}return Cn(n),null;case 13:if($t(Dt),u=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ot&&or!==null&&(n.mode&1)!==0&&(n.flags&128)===0)Ed(),ps(),n.flags|=98560,y=!1;else if(y=fl(n),u!==null&&u.dehydrated!==null){if(e===null){if(!y)throw Error(i(318));if(y=n.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[Xr]=n}else ps(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Cn(n),y=!1}else Mr!==null&&(Bc(Mr),Mr=null),y=!0;if(!y)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=o,n):(u=u!==null,u!==(e!==null&&e.memoizedState!==null)&&u&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(Dt.current&1)!==0?tn===0&&(tn=3):Uc())),n.updateQueue!==null&&(n.flags|=4),Cn(n),null);case 4:return ys(),$c(e,n),e===null&&Js(n.stateNode.containerInfo),Cn(n),null;case 10:return oc(n.type._context),Cn(n),null;case 17:return Kn(n.type)&&sl(),Cn(n),null;case 19:if($t(Dt),y=n.memoizedState,y===null)return Cn(n),null;if(u=(n.flags&128)!==0,E=y.rendering,E===null)if(u)ca(y,!1);else{if(tn!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(E=yl(e),E!==null){for(n.flags|=128,ca(y,!1),u=E.updateQueue,u!==null&&(n.updateQueue=u,n.flags|=4),n.subtreeFlags=0,u=o,o=n.child;o!==null;)y=o,e=u,y.flags&=14680066,E=y.alternate,E===null?(y.childLanes=0,y.lanes=e,y.child=null,y.subtreeFlags=0,y.memoizedProps=null,y.memoizedState=null,y.updateQueue=null,y.dependencies=null,y.stateNode=null):(y.childLanes=E.childLanes,y.lanes=E.lanes,y.child=E.child,y.subtreeFlags=0,y.deletions=null,y.memoizedProps=E.memoizedProps,y.memoizedState=E.memoizedState,y.updateQueue=E.updateQueue,y.type=E.type,e=E.dependencies,y.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),o=o.sibling;return Et(Dt,Dt.current&1|2),n.child}e=e.sibling}y.tail!==null&&Xe()>bs&&(n.flags|=128,u=!0,ca(y,!1),n.lanes=4194304)}else{if(!u)if(e=yl(E),e!==null){if(n.flags|=128,u=!0,o=e.updateQueue,o!==null&&(n.updateQueue=o,n.flags|=4),ca(y,!0),y.tail===null&&y.tailMode==="hidden"&&!E.alternate&&!Ot)return Cn(n),null}else 2*Xe()-y.renderingStartTime>bs&&o!==1073741824&&(n.flags|=128,u=!0,ca(y,!1),n.lanes=4194304);y.isBackwards?(E.sibling=n.child,n.child=E):(o=y.last,o!==null?o.sibling=E:n.child=E,y.last=E)}return y.tail!==null?(n=y.tail,y.rendering=n,y.tail=n.sibling,y.renderingStartTime=Xe(),n.sibling=null,o=Dt.current,Et(Dt,u?o&1|2:o&1),n):(Cn(n),null);case 22:case 23:return Vc(),u=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==u&&(n.flags|=8192),u&&(n.mode&1)!==0?(ir&1073741824)!==0&&(Cn(n),n.subtreeFlags&6&&(n.flags|=8192)):Cn(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function Xg(e,n){switch(Ju(n),n.tag){case 1:return Kn(n.type)&&sl(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return ys(),$t(Un),$t(Nn),fc(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return uc(n),null;case 13:if($t(Dt),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));ps()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return $t(Dt),null;case 4:return ys(),null;case 10:return oc(n.type._context),null;case 22:case 23:return Vc(),null;case 24:return null;default:return null}}var El=!1,jn=!1,Qg=typeof WeakSet=="function"?WeakSet:Set,Qe=null;function xs(e,n){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(u){Bt(e,n,u)}else o.current=null}function Mc(e,n,o){try{o()}catch(u){Bt(e,n,u)}}var kp=!1;function Gg(e,n){if(Vu=qi,e=ie(),oe(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var p=u.anchorOffset,y=u.focusNode;u=u.focusOffset;try{o.nodeType,y.nodeType}catch{o=null;break e}var E=0,z=-1,X=-1,xe=0,Me=0,Ie=e,Pe=null;t:for(;;){for(var Ue;Ie!==o||p!==0&&Ie.nodeType!==3||(z=E+p),Ie!==y||u!==0&&Ie.nodeType!==3||(X=E+u),Ie.nodeType===3&&(E+=Ie.nodeValue.length),(Ue=Ie.firstChild)!==null;)Pe=Ie,Ie=Ue;for(;;){if(Ie===e)break t;if(Pe===o&&++xe===p&&(z=E),Pe===y&&++Me===u&&(X=E),(Ue=Ie.nextSibling)!==null)break;Ie=Pe,Pe=Ie.parentNode}Ie=Ue}o=z===-1||X===-1?null:{start:z,end:X}}else o=null}o=o||{start:0,end:0}}else o=null;for(Uu={focusedElem:e,selectionRange:o},qi=!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 Ge=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(Ge!==null){var Je=Ge.memoizedProps,qt=Ge.memoizedState,me=n.stateNode,re=me.getSnapshotBeforeUpdate(n.elementType===n.type?Je:Tr(n.type,Je),qt);me.__reactInternalSnapshotBeforeUpdate=re}break;case 3:var ge=n.stateNode.containerInfo;ge.nodeType===1?ge.textContent="":ge.nodeType===9&&ge.documentElement&&ge.removeChild(ge.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(ze){Bt(n,n.return,ze)}if(e=n.sibling,e!==null){e.return=n.return,Qe=e;break}Qe=n.return}return Ge=kp,kp=!1,Ge}function fa(e,n,o){var u=n.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var p=u=u.next;do{if((p.tag&e)===e){var y=p.destroy;p.destroy=void 0,y!==void 0&&Mc(n,o,y)}p=p.next}while(p!==u)}}function Cl(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 u=o.create;o.destroy=u()}o=o.next}while(o!==n)}}function Tc(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 Np(e){var n=e.alternate;n!==null&&(e.alternate=null,Np(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Xr],delete n[ea],delete n[Yu],delete n[Ig],delete n[Ag])),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 Ep(e){return e.tag===5||e.tag===3||e.tag===4}function Cp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ep(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 Ic(e,n,o){var u=e.tag;if(u===5||u===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=ol));else if(u!==4&&(e=e.child,e!==null))for(Ic(e,n,o),e=e.sibling;e!==null;)Ic(e,n,o),e=e.sibling}function Ac(e,n,o){var u=e.tag;if(u===5||u===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(u!==4&&(e=e.child,e!==null))for(Ac(e,n,o),e=e.sibling;e!==null;)Ac(e,n,o),e=e.sibling}var yn=null,Ir=!1;function ri(e,n,o){for(o=o.child;o!==null;)jp(e,n,o),o=o.sibling}function jp(e,n,o){if(sn&&typeof sn.onCommitFiberUnmount=="function")try{sn.onCommitFiberUnmount(In,o)}catch{}switch(o.tag){case 5:jn||xs(o,n);case 6:var u=yn,p=Ir;yn=null,ri(e,n,o),yn=u,Ir=p,yn!==null&&(Ir?(e=yn,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):yn.removeChild(o.stateNode));break;case 18:yn!==null&&(Ir?(e=yn,o=o.stateNode,e.nodeType===8?Wu(e.parentNode,o):e.nodeType===1&&Wu(e,o),po(e)):Wu(yn,o.stateNode));break;case 4:u=yn,p=Ir,yn=o.stateNode.containerInfo,Ir=!0,ri(e,n,o),yn=u,Ir=p;break;case 0:case 11:case 14:case 15:if(!jn&&(u=o.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){p=u=u.next;do{var y=p,E=y.destroy;y=y.tag,E!==void 0&&((y&2)!==0||(y&4)!==0)&&Mc(o,n,E),p=p.next}while(p!==u)}ri(e,n,o);break;case 1:if(!jn&&(xs(o,n),u=o.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=o.memoizedProps,u.state=o.memoizedState,u.componentWillUnmount()}catch(z){Bt(o,n,z)}ri(e,n,o);break;case 21:ri(e,n,o);break;case 22:o.mode&1?(jn=(u=jn)||o.memoizedState!==null,ri(e,n,o),jn=u):ri(e,n,o);break;default:ri(e,n,o)}}function Pp(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new Qg),n.forEach(function(u){var p=sy.bind(null,e,u);o.has(u)||(o.add(u),u.then(p,p))})}}function Ar(e,n){var o=n.deletions;if(o!==null)for(var u=0;u<o.length;u++){var p=o[u];try{var y=e,E=n,z=E;e:for(;z!==null;){switch(z.tag){case 5:yn=z.stateNode,Ir=!1;break e;case 3:yn=z.stateNode.containerInfo,Ir=!0;break e;case 4:yn=z.stateNode.containerInfo,Ir=!0;break e}z=z.return}if(yn===null)throw Error(i(160));jp(y,E,p),yn=null,Ir=!1;var X=p.alternate;X!==null&&(X.return=null),p.return=null}catch(xe){Bt(p,n,xe)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)$p(n,e),n=n.sibling}function $p(e,n){var o=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ar(n,e),Jr(e),u&4){try{fa(3,e,e.return),Cl(3,e)}catch(Je){Bt(e,e.return,Je)}try{fa(5,e,e.return)}catch(Je){Bt(e,e.return,Je)}}break;case 1:Ar(n,e),Jr(e),u&512&&o!==null&&xs(o,o.return);break;case 5:if(Ar(n,e),Jr(e),u&512&&o!==null&&xs(o,o.return),e.flags&32){var p=e.stateNode;try{yt(p,"")}catch(Je){Bt(e,e.return,Je)}}if(u&4&&(p=e.stateNode,p!=null)){var y=e.memoizedProps,E=o!==null?o.memoizedProps:y,z=e.type,X=e.updateQueue;if(e.updateQueue=null,X!==null)try{z==="input"&&y.type==="radio"&&y.name!=null&&ot(p,y),Nt(z,E);var xe=Nt(z,y);for(E=0;E<X.length;E+=2){var Me=X[E],Ie=X[E+1];Me==="style"?Dn(p,Ie):Me==="dangerouslySetInnerHTML"?lr(p,Ie):Me==="children"?yt(p,Ie):P(p,Me,Ie,xe)}switch(z){case"input":Tt(p,y);break;case"textarea":Pn(p,y);break;case"select":var Pe=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!y.multiple;var Ue=y.value;Ue!=null?kt(p,!!y.multiple,Ue,!1):Pe!==!!y.multiple&&(y.defaultValue!=null?kt(p,!!y.multiple,y.defaultValue,!0):kt(p,!!y.multiple,y.multiple?[]:"",!1))}p[ea]=y}catch(Je){Bt(e,e.return,Je)}}break;case 6:if(Ar(n,e),Jr(e),u&4){if(e.stateNode===null)throw Error(i(162));p=e.stateNode,y=e.memoizedProps;try{p.nodeValue=y}catch(Je){Bt(e,e.return,Je)}}break;case 3:if(Ar(n,e),Jr(e),u&4&&o!==null&&o.memoizedState.isDehydrated)try{po(n.containerInfo)}catch(Je){Bt(e,e.return,Je)}break;case 4:Ar(n,e),Jr(e);break;case 13:Ar(n,e),Jr(e),p=e.child,p.flags&8192&&(y=p.memoizedState!==null,p.stateNode.isHidden=y,!y||p.alternate!==null&&p.alternate.memoizedState!==null||(Lc=Xe())),u&4&&Pp(e);break;case 22:if(Me=o!==null&&o.memoizedState!==null,e.mode&1?(jn=(xe=jn)||Me,Ar(n,e),jn=xe):Ar(n,e),Jr(e),u&8192){if(xe=e.memoizedState!==null,(e.stateNode.isHidden=xe)&&!Me&&(e.mode&1)!==0)for(Qe=e,Me=e.child;Me!==null;){for(Ie=Qe=Me;Qe!==null;){switch(Pe=Qe,Ue=Pe.child,Pe.tag){case 0:case 11:case 14:case 15:fa(4,Pe,Pe.return);break;case 1:xs(Pe,Pe.return);var Ge=Pe.stateNode;if(typeof Ge.componentWillUnmount=="function"){u=Pe,o=Pe.return;try{n=u,Ge.props=n.memoizedProps,Ge.state=n.memoizedState,Ge.componentWillUnmount()}catch(Je){Bt(u,o,Je)}}break;case 5:xs(Pe,Pe.return);break;case 22:if(Pe.memoizedState!==null){Ip(Ie);continue}}Ue!==null?(Ue.return=Pe,Qe=Ue):Ip(Ie)}Me=Me.sibling}e:for(Me=null,Ie=e;;){if(Ie.tag===5){if(Me===null){Me=Ie;try{p=Ie.stateNode,xe?(y=p.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none"):(z=Ie.stateNode,X=Ie.memoizedProps.style,E=X!=null&&X.hasOwnProperty("display")?X.display:null,z.style.display=Ln("display",E))}catch(Je){Bt(e,e.return,Je)}}}else if(Ie.tag===6){if(Me===null)try{Ie.stateNode.nodeValue=xe?"":Ie.memoizedProps}catch(Je){Bt(e,e.return,Je)}}else if((Ie.tag!==22&&Ie.tag!==23||Ie.memoizedState===null||Ie===e)&&Ie.child!==null){Ie.child.return=Ie,Ie=Ie.child;continue}if(Ie===e)break e;for(;Ie.sibling===null;){if(Ie.return===null||Ie.return===e)break e;Me===Ie&&(Me=null),Ie=Ie.return}Me===Ie&&(Me=null),Ie.sibling.return=Ie.return,Ie=Ie.sibling}}break;case 19:Ar(n,e),Jr(e),u&4&&Pp(e);break;case 21:break;default:Ar(n,e),Jr(e)}}function Jr(e){var n=e.flags;if(n&2){try{e:{for(var o=e.return;o!==null;){if(Ep(o)){var u=o;break e}o=o.return}throw Error(i(160))}switch(u.tag){case 5:var p=u.stateNode;u.flags&32&&(yt(p,""),u.flags&=-33);var y=Cp(e);Ac(e,y,p);break;case 3:case 4:var E=u.stateNode.containerInfo,z=Cp(e);Ic(e,z,E);break;default:throw Error(i(161))}}catch(X){Bt(e,e.return,X)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Jg(e,n,o){Qe=e,Mp(e)}function Mp(e,n,o){for(var u=(e.mode&1)!==0;Qe!==null;){var p=Qe,y=p.child;if(p.tag===22&&u){var E=p.memoizedState!==null||El;if(!E){var z=p.alternate,X=z!==null&&z.memoizedState!==null||jn;z=El;var xe=jn;if(El=E,(jn=X)&&!xe)for(Qe=p;Qe!==null;)E=Qe,X=E.child,E.tag===22&&E.memoizedState!==null?Ap(p):X!==null?(X.return=E,Qe=X):Ap(p);for(;y!==null;)Qe=y,Mp(y),y=y.sibling;Qe=p,El=z,jn=xe}Tp(e)}else(p.subtreeFlags&8772)!==0&&y!==null?(y.return=p,Qe=y):Tp(e)}}function Tp(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:jn||Cl(5,n);break;case 1:var u=n.stateNode;if(n.flags&4&&!jn)if(o===null)u.componentDidMount();else{var p=n.elementType===n.type?o.memoizedProps:Tr(n.type,o.memoizedProps);u.componentDidUpdate(p,o.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var y=n.updateQueue;y!==null&&Id(n,y,u);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}Id(n,E,o)}break;case 5:var z=n.stateNode;if(o===null&&n.flags&4){o=z;var X=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":X.autoFocus&&o.focus();break;case"img":X.src&&(o.src=X.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var xe=n.alternate;if(xe!==null){var Me=xe.memoizedState;if(Me!==null){var Ie=Me.dehydrated;Ie!==null&&po(Ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}jn||n.flags&512&&Tc(n)}catch(Pe){Bt(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 Ip(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 Ap(e){for(;Qe!==null;){var n=Qe;try{switch(n.tag){case 0:case 11:case 15:var o=n.return;try{Cl(4,n)}catch(X){Bt(n,o,X)}break;case 1:var u=n.stateNode;if(typeof u.componentDidMount=="function"){var p=n.return;try{u.componentDidMount()}catch(X){Bt(n,p,X)}}var y=n.return;try{Tc(n)}catch(X){Bt(n,y,X)}break;case 5:var E=n.return;try{Tc(n)}catch(X){Bt(n,E,X)}}}catch(X){Bt(n,n.return,X)}if(n===e){Qe=null;break}var z=n.sibling;if(z!==null){z.return=n.return,Qe=z;break}Qe=n.return}}var Zg=Math.ceil,jl=R.ReactCurrentDispatcher,Oc=R.ReactCurrentOwner,wr=R.ReactCurrentBatchConfig,xt=0,cn=null,Jt=null,vn=0,ir=0,ws=Jo(0),tn=0,da=null,$i=0,Pl=0,Rc=0,pa=null,Wn=null,Lc=0,bs=1/0,$o=null,$l=!1,Dc=null,oi=null,Ml=!1,ii=null,Tl=0,ha=0,zc=null,Il=-1,Al=0;function On(){return(xt&6)!==0?Xe():Il!==-1?Il:Il=Xe()}function si(e){return(e.mode&1)===0?1:(xt&2)!==0&&vn!==0?vn&-vn:Rg.transition!==null?(Al===0&&(Al=Kr()),Al):(e=wt,e!==0||(e=window.event,e=e===void 0?16:Wi(e.type)),e)}function Or(e,n,o,u){if(50<ha)throw ha=0,zc=null,Error(i(185));mr(e,o,u),((xt&2)===0||e!==cn)&&(e===cn&&((xt&2)===0&&(Pl|=o),tn===4&&ai(e,vn)),Yn(e,u),o===1&&xt===0&&(n.mode&1)===0&&(bs=Xe()+500,ll&&ei()))}function Yn(e,n){var o=e.callbackNode;uo(e,n);var u=vt(e,e===cn?vn:0);if(u===0)o!==null&&L(o),e.callbackNode=null,e.callbackPriority=0;else if(n=u&-u,e.callbackPriority!==n){if(o!=null&&L(o),n===1)e.tag===0?Og(Rp.bind(null,e)):bd(Rp.bind(null,e)),Mg(function(){(xt&6)===0&&ei()}),o=null;else{switch(Ha(u)){case 1:o=Vt;break;case 4:o=Qt;break;case 16:o=Ut;break;case 536870912:o=_n;break;default:o=Ut}o=Up(o,Op.bind(null,e))}e.callbackPriority=n,e.callbackNode=o}}function Op(e,n){if(Il=-1,Al=0,(xt&6)!==0)throw Error(i(327));var o=e.callbackNode;if(_s()&&e.callbackNode!==o)return null;var u=vt(e,e===cn?vn:0);if(u===0)return null;if((u&30)!==0||(u&e.expiredLanes)!==0||n)n=Ol(e,u);else{n=u;var p=xt;xt|=2;var y=Dp();(cn!==e||vn!==n)&&($o=null,bs=Xe()+500,Ti(e,n));do try{ny();break}catch(z){Lp(e,z)}while(!0);rc(),jl.current=y,xt=p,Jt!==null?n=0:(cn=null,vn=0,n=tn)}if(n!==0){if(n===2&&(p=hr(e),p!==0&&(u=p,n=Fc(e,p))),n===1)throw o=da,Ti(e,0),ai(e,u),Yn(e,Xe()),o;if(n===6)ai(e,u);else{if(p=e.current.alternate,(u&30)===0&&!ey(p)&&(n=Ol(e,u),n===2&&(y=hr(e),y!==0&&(u=y,n=Fc(e,y))),n===1))throw o=da,Ti(e,0),ai(e,u),Yn(e,Xe()),o;switch(e.finishedWork=p,e.finishedLanes=u,n){case 0:case 1:throw Error(i(345));case 2:Ii(e,Wn,$o);break;case 3:if(ai(e,u),(u&130023424)===u&&(n=Lc+500-Xe(),10<n)){if(vt(e,0)!==0)break;if(p=e.suspendedLanes,(p&u)!==u){On(),e.pingedLanes|=e.suspendedLanes&p;break}e.timeoutHandle=qu(Ii.bind(null,e,Wn,$o),n);break}Ii(e,Wn,$o);break;case 4:if(ai(e,u),(u&4194240)===u)break;for(n=e.eventTimes,p=-1;0<u;){var E=31-Kt(u);y=1<<E,E=n[E],E>p&&(p=E),u&=~y}if(u=p,u=Xe()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*Zg(u/1960))-u,10<u){e.timeoutHandle=qu(Ii.bind(null,e,Wn,$o),u);break}Ii(e,Wn,$o);break;case 5:Ii(e,Wn,$o);break;default:throw Error(i(329))}}}return Yn(e,Xe()),e.callbackNode===o?Op.bind(null,e):null}function Fc(e,n){var o=pa;return e.current.memoizedState.isDehydrated&&(Ti(e,n).flags|=256),e=Ol(e,n),e!==2&&(n=Wn,Wn=o,n!==null&&Bc(n)),e}function Bc(e){Wn===null?Wn=e:Wn.push.apply(Wn,e)}function ey(e){for(var n=e;;){if(n.flags&16384){var o=n.updateQueue;if(o!==null&&(o=o.stores,o!==null))for(var u=0;u<o.length;u++){var p=o[u],y=p.getSnapshot;p=p.value;try{if(!ce(y(),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 ai(e,n){for(n&=~Rc,n&=~Pl,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var o=31-Kt(n),u=1<<o;e[o]=-1,n&=~u}}function Rp(e){if((xt&6)!==0)throw Error(i(327));_s();var n=vt(e,0);if((n&1)===0)return Yn(e,Xe()),null;var o=Ol(e,n);if(e.tag!==0&&o===2){var u=hr(e);u!==0&&(n=u,o=Fc(e,u))}if(o===1)throw o=da,Ti(e,0),ai(e,n),Yn(e,Xe()),o;if(o===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,Ii(e,Wn,$o),Yn(e,Xe()),null}function Hc(e,n){var o=xt;xt|=1;try{return e(n)}finally{xt=o,xt===0&&(bs=Xe()+500,ll&&ei())}}function Mi(e){ii!==null&&ii.tag===0&&(xt&6)===0&&_s();var n=xt;xt|=1;var o=wr.transition,u=wt;try{if(wr.transition=null,wt=1,e)return e()}finally{wt=u,wr.transition=o,xt=n,(xt&6)===0&&ei()}}function Vc(){ir=ws.current,$t(ws)}function Ti(e,n){e.finishedWork=null,e.finishedLanes=0;var o=e.timeoutHandle;if(o!==-1&&(e.timeoutHandle=-1,$g(o)),Jt!==null)for(o=Jt.return;o!==null;){var u=o;switch(Ju(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&sl();break;case 3:ys(),$t(Un),$t(Nn),fc();break;case 5:uc(u);break;case 4:ys();break;case 13:$t(Dt);break;case 19:$t(Dt);break;case 10:oc(u.type._context);break;case 22:case 23:Vc()}o=o.return}if(cn=e,Jt=e=li(e.current,null),vn=ir=n,tn=0,da=null,Rc=Pl=$i=0,Wn=pa=null,Ci!==null){for(n=0;n<Ci.length;n++)if(o=Ci[n],u=o.interleaved,u!==null){o.interleaved=null;var p=u.next,y=o.pending;if(y!==null){var E=y.next;y.next=p,u.next=E}o.pending=u}Ci=null}return e}function Lp(e,n){do{var o=Jt;try{if(rc(),vl.current=_l,xl){for(var u=zt.memoizedState;u!==null;){var p=u.queue;p!==null&&(p.pending=null),u=u.next}xl=!1}if(Pi=0,un=en=zt=null,sa=!1,aa=0,Oc.current=null,o===null||o.return===null){tn=1,da=n,Jt=null;break}e:{var y=e,E=o.return,z=o,X=n;if(n=vn,z.flags|=32768,X!==null&&typeof X=="object"&&typeof X.then=="function"){var xe=X,Me=z,Ie=Me.tag;if((Me.mode&1)===0&&(Ie===0||Ie===11||Ie===15)){var Pe=Me.alternate;Pe?(Me.updateQueue=Pe.updateQueue,Me.memoizedState=Pe.memoizedState,Me.lanes=Pe.lanes):(Me.updateQueue=null,Me.memoizedState=null)}var Ue=lp(E);if(Ue!==null){Ue.flags&=-257,up(Ue,E,z,y,n),Ue.mode&1&&ap(y,xe,n),n=Ue,X=xe;var Ge=n.updateQueue;if(Ge===null){var Je=new Set;Je.add(X),n.updateQueue=Je}else Ge.add(X);break e}else{if((n&1)===0){ap(y,xe,n),Uc();break e}X=Error(i(426))}}else if(Ot&&z.mode&1){var qt=lp(E);if(qt!==null){(qt.flags&65536)===0&&(qt.flags|=256),up(qt,E,z,y,n),tc(vs(X,z));break e}}y=X=vs(X,z),tn!==4&&(tn=2),pa===null?pa=[y]:pa.push(y),y=E;do{switch(y.tag){case 3:y.flags|=65536,n&=-n,y.lanes|=n;var me=ip(y,X,n);Td(y,me);break e;case 1:z=X;var re=y.type,ge=y.stateNode;if((y.flags&128)===0&&(typeof re.getDerivedStateFromError=="function"||ge!==null&&typeof ge.componentDidCatch=="function"&&(oi===null||!oi.has(ge)))){y.flags|=65536,n&=-n,y.lanes|=n;var ze=sp(y,z,n);Td(y,ze);break e}}y=y.return}while(y!==null)}Fp(o)}catch(Ze){n=Ze,Jt===o&&o!==null&&(Jt=o=o.return);continue}break}while(!0)}function Dp(){var e=jl.current;return jl.current=_l,e===null?_l:e}function Uc(){(tn===0||tn===3||tn===2)&&(tn=4),cn===null||($i&268435455)===0&&(Pl&268435455)===0||ai(cn,vn)}function Ol(e,n){var o=xt;xt|=2;var u=Dp();(cn!==e||vn!==n)&&($o=null,Ti(e,n));do try{ty();break}catch(p){Lp(e,p)}while(!0);if(rc(),xt=o,jl.current=u,Jt!==null)throw Error(i(261));return cn=null,vn=0,tn}function ty(){for(;Jt!==null;)zp(Jt)}function ny(){for(;Jt!==null&&!_e();)zp(Jt)}function zp(e){var n=Vp(e.alternate,e,ir);e.memoizedProps=e.pendingProps,n===null?Fp(e):Jt=n,Oc.current=null}function Fp(e){var n=e;do{var o=n.alternate;if(e=n.return,(n.flags&32768)===0){if(o=Yg(o,n,ir),o!==null){Jt=o;return}}else{if(o=Xg(o,n),o!==null){o.flags&=32767,Jt=o;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{tn=6,Jt=null;return}}if(n=n.sibling,n!==null){Jt=n;return}Jt=n=e}while(n!==null);tn===0&&(tn=5)}function Ii(e,n,o){var u=wt,p=wr.transition;try{wr.transition=null,wt=1,ry(e,n,o,u)}finally{wr.transition=p,wt=u}return null}function ry(e,n,o,u){do _s();while(ii!==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 y=o.lanes|o.childLanes;if(hi(e,y),e===cn&&(Jt=cn=null,vn=0),(o.subtreeFlags&2064)===0&&(o.flags&2064)===0||Ml||(Ml=!0,Up(Ut,function(){return _s(),null})),y=(o.flags&15990)!==0,(o.subtreeFlags&15990)!==0||y){y=wr.transition,wr.transition=null;var E=wt;wt=1;var z=xt;xt|=4,Oc.current=null,Gg(e,o),$p(o,e),ae(Uu),qi=!!Vu,Uu=Vu=null,e.current=o,Jg(o),He(),xt=z,wt=E,wr.transition=y}else e.current=o;if(Ml&&(Ml=!1,ii=e,Tl=p),y=e.pendingLanes,y===0&&(oi=null),ft(o.stateNode),Yn(e,Xe()),n!==null)for(u=e.onRecoverableError,o=0;o<n.length;o++)p=n[o],u(p.value,{componentStack:p.stack,digest:p.digest});if($l)throw $l=!1,e=Dc,Dc=null,e;return(Tl&1)!==0&&e.tag!==0&&_s(),y=e.pendingLanes,(y&1)!==0?e===zc?ha++:(ha=0,zc=e):ha=0,ei(),null}function _s(){if(ii!==null){var e=Ha(Tl),n=wr.transition,o=wt;try{if(wr.transition=null,wt=16>e?16:e,ii===null)var u=!1;else{if(e=ii,ii=null,Tl=0,(xt&6)!==0)throw Error(i(331));var p=xt;for(xt|=4,Qe=e.current;Qe!==null;){var y=Qe,E=y.child;if((Qe.flags&16)!==0){var z=y.deletions;if(z!==null){for(var X=0;X<z.length;X++){var xe=z[X];for(Qe=xe;Qe!==null;){var Me=Qe;switch(Me.tag){case 0:case 11:case 15:fa(8,Me,y)}var Ie=Me.child;if(Ie!==null)Ie.return=Me,Qe=Ie;else for(;Qe!==null;){Me=Qe;var Pe=Me.sibling,Ue=Me.return;if(Np(Me),Me===xe){Qe=null;break}if(Pe!==null){Pe.return=Ue,Qe=Pe;break}Qe=Ue}}}var Ge=y.alternate;if(Ge!==null){var Je=Ge.child;if(Je!==null){Ge.child=null;do{var qt=Je.sibling;Je.sibling=null,Je=qt}while(Je!==null)}}Qe=y}}if((y.subtreeFlags&2064)!==0&&E!==null)E.return=y,Qe=E;else e:for(;Qe!==null;){if(y=Qe,(y.flags&2048)!==0)switch(y.tag){case 0:case 11:case 15:fa(9,y,y.return)}var me=y.sibling;if(me!==null){me.return=y.return,Qe=me;break e}Qe=y.return}}var re=e.current;for(Qe=re;Qe!==null;){E=Qe;var ge=E.child;if((E.subtreeFlags&2064)!==0&&ge!==null)ge.return=E,Qe=ge;else e:for(E=re;Qe!==null;){if(z=Qe,(z.flags&2048)!==0)try{switch(z.tag){case 0:case 11:case 15:Cl(9,z)}}catch(Ze){Bt(z,z.return,Ze)}if(z===E){Qe=null;break e}var ze=z.sibling;if(ze!==null){ze.return=z.return,Qe=ze;break e}Qe=z.return}}if(xt=p,ei(),sn&&typeof sn.onPostCommitFiberRoot=="function")try{sn.onPostCommitFiberRoot(In,e)}catch{}u=!0}return u}finally{wt=o,wr.transition=n}}return!1}function Bp(e,n,o){n=vs(o,n),n=ip(e,n,1),e=ni(e,n,1),n=On(),e!==null&&(mr(e,1,n),Yn(e,n))}function Bt(e,n,o){if(e.tag===3)Bp(e,e,o);else for(;n!==null;){if(n.tag===3){Bp(n,e,o);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(oi===null||!oi.has(u))){e=vs(o,e),e=sp(n,e,1),n=ni(n,e,1),e=On(),n!==null&&(mr(n,1,e),Yn(n,e));break}}n=n.return}}function oy(e,n,o){var u=e.pingCache;u!==null&&u.delete(n),n=On(),e.pingedLanes|=e.suspendedLanes&o,cn===e&&(vn&o)===o&&(tn===4||tn===3&&(vn&130023424)===vn&&500>Xe()-Lc?Ti(e,0):Rc|=o),Yn(e,n)}function Hp(e,n){n===0&&((e.mode&1)===0?n=1:(n=lo,lo<<=1,(lo&130023424)===0&&(lo=4194304)));var o=On();e=Co(e,n),e!==null&&(mr(e,n,o),Yn(e,o))}function iy(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),Hp(e,o)}function sy(e,n){var o=0;switch(e.tag){case 13:var u=e.stateNode,p=e.memoizedState;p!==null&&(o=p.retryLane);break;case 19:u=e.stateNode;break;default:throw Error(i(314))}u!==null&&u.delete(n),Hp(e,o)}var Vp;Vp=function(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps||Un.current)qn=!0;else{if((e.lanes&o)===0&&(n.flags&128)===0)return qn=!1,Wg(e,n,o);qn=(e.flags&131072)!==0}else qn=!1,Ot&&(n.flags&1048576)!==0&&_d(n,cl,n.index);switch(n.lanes=0,n.tag){case 2:var u=n.type;Nl(e,n),e=n.pendingProps;var p=cs(n,Nn.current);gs(n,o),p=hc(null,n,u,e,p,o);var y=mc();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,Kn(u)?(y=!0,al(n)):y=!1,n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,ac(n),p.updater=Sl,n.stateNode=p,p._reactInternals=n,bc(n,u,e,o),n=Nc(null,n,u,!0,y,o)):(n.tag=0,Ot&&y&&Gu(n),An(null,n,p,o),n=n.child),n;case 16:u=n.elementType;e:{switch(Nl(e,n),e=n.pendingProps,p=u._init,u=p(u._payload),n.type=u,p=n.tag=ly(u),e=Tr(u,e),p){case 0:n=kc(null,n,u,e,o);break e;case 1:n=mp(null,n,u,e,o);break e;case 11:n=cp(null,n,u,e,o);break e;case 14:n=fp(null,n,u,Tr(u.type,e),o);break e}throw Error(i(306,u,""))}return n;case 0:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Tr(u,p),kc(e,n,u,p,o);case 1:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Tr(u,p),mp(e,n,u,p,o);case 3:e:{if(gp(n),e===null)throw Error(i(387));u=n.pendingProps,y=n.memoizedState,p=y.element,Md(e,n),gl(n,u,null,o);var E=n.memoizedState;if(u=E.element,y.isDehydrated)if(y={element:u,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=y,n.memoizedState=y,n.flags&256){p=vs(Error(i(423)),n),n=yp(e,n,u,o,p);break e}else if(u!==p){p=vs(Error(i(424)),n),n=yp(e,n,u,o,p);break e}else for(or=Go(n.stateNode.containerInfo.firstChild),rr=n,Ot=!0,Mr=null,o=Pd(n,null,u,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ps(),u===p){n=Po(e,n,o);break e}An(e,n,u,o)}n=n.child}return n;case 5:return Ad(n),e===null&&ec(n),u=n.type,p=n.pendingProps,y=e!==null?e.memoizedProps:null,E=p.children,Ku(u,p)?E=null:y!==null&&Ku(u,y)&&(n.flags|=32),hp(e,n),An(e,n,E,o),n.child;case 6:return e===null&&ec(n),null;case 13:return vp(e,n,o);case 4:return lc(n,n.stateNode.containerInfo),u=n.pendingProps,e===null?n.child=hs(n,null,u,o):An(e,n,u,o),n.child;case 11:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Tr(u,p),cp(e,n,u,p,o);case 7:return An(e,n,n.pendingProps,o),n.child;case 8:return An(e,n,n.pendingProps.children,o),n.child;case 12:return An(e,n,n.pendingProps.children,o),n.child;case 10:e:{if(u=n.type._context,p=n.pendingProps,y=n.memoizedProps,E=p.value,Et(pl,u._currentValue),u._currentValue=E,y!==null)if(ce(y.value,E)){if(y.children===p.children&&!Un.current){n=Po(e,n,o);break e}}else for(y=n.child,y!==null&&(y.return=n);y!==null;){var z=y.dependencies;if(z!==null){E=y.child;for(var X=z.firstContext;X!==null;){if(X.context===u){if(y.tag===1){X=jo(-1,o&-o),X.tag=2;var xe=y.updateQueue;if(xe!==null){xe=xe.shared;var Me=xe.pending;Me===null?X.next=X:(X.next=Me.next,Me.next=X),xe.pending=X}}y.lanes|=o,X=y.alternate,X!==null&&(X.lanes|=o),ic(y.return,o,n),z.lanes|=o;break}X=X.next}}else if(y.tag===10)E=y.type===n.type?null:y.child;else if(y.tag===18){if(E=y.return,E===null)throw Error(i(341));E.lanes|=o,z=E.alternate,z!==null&&(z.lanes|=o),ic(E,o,n),E=y.sibling}else E=y.child;if(E!==null)E.return=y;else for(E=y;E!==null;){if(E===n){E=null;break}if(y=E.sibling,y!==null){y.return=E.return,E=y;break}E=E.return}y=E}An(e,n,p.children,o),n=n.child}return n;case 9:return p=n.type,u=n.pendingProps.children,gs(n,o),p=vr(p),u=u(p),n.flags|=1,An(e,n,u,o),n.child;case 14:return u=n.type,p=Tr(u,n.pendingProps),p=Tr(u.type,p),fp(e,n,u,p,o);case 15:return dp(e,n,n.type,n.pendingProps,o);case 17:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Tr(u,p),Nl(e,n),n.tag=1,Kn(u)?(e=!0,al(n)):e=!1,gs(n,o),rp(n,u,p),bc(n,u,p,o),Nc(null,n,u,!0,e,o);case 19:return wp(e,n,o);case 22:return pp(e,n,o)}throw Error(i(156,n.tag))};function Up(e,n){return Vr(e,n)}function ay(e,n,o,u){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=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function br(e,n,o,u){return new ay(e,n,o,u)}function Kc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ly(e){if(typeof e=="function")return Kc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fe)return 11;if(e===ue)return 14}return 2}function li(e,n){var o=e.alternate;return o===null?(o=br(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 Rl(e,n,o,u,p,y){var E=2;if(u=e,typeof e=="function")Kc(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case W:return Ai(o.children,p,y,n);case Q:E=8,p|=8;break;case de:return e=br(12,o,n,p|2),e.elementType=de,e.lanes=y,e;case ve:return e=br(13,o,n,p),e.elementType=ve,e.lanes=y,e;case D:return e=br(19,o,n,p),e.elementType=D,e.lanes=y,e;case se:return Ll(o,p,y,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ke:E=10;break e;case Y:E=9;break e;case fe:E=11;break e;case ue:E=14;break e;case G:E=16,u=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return n=br(E,o,n,p),n.elementType=e,n.type=u,n.lanes=y,n}function Ai(e,n,o,u){return e=br(7,e,u,n),e.lanes=o,e}function Ll(e,n,o,u){return e=br(22,e,u,n),e.elementType=se,e.lanes=o,e.stateNode={isHidden:!1},e}function qc(e,n,o){return e=br(6,e,null,n),e.lanes=o,e}function Wc(e,n,o){return n=br(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function uy(e,n,o,u,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=co(0),this.expirationTimes=co(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=co(0),this.identifierPrefix=u,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Yc(e,n,o,u,p,y,E,z,X){return e=new uy(e,n,o,z,X),n===1?(n=1,y===!0&&(n|=8)):n=0,y=br(3,null,null,n),e.current=y,y.stateNode=e,y.memoizedState={element:u,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},ac(y),e}function cy(e,n,o){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:V,key:u==null?null:""+u,children:e,containerInfo:n,implementation:o}}function Kp(e){if(!e)return Zo;e=e._reactInternals;e:{if(Ft(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(Kn(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(Kn(o))return xd(e,o,n)}return n}function qp(e,n,o,u,p,y,E,z,X){return e=Yc(o,u,!0,e,p,y,E,z,X),e.context=Kp(null),o=e.current,u=On(),p=si(o),y=jo(u,p),y.callback=n??null,ni(o,y,p),e.current.lanes=p,mr(e,p,u),Yn(e,u),e}function Dl(e,n,o,u){var p=n.current,y=On(),E=si(p);return o=Kp(o),n.context===null?n.context=o:n.pendingContext=o,n=jo(y,E),n.payload={element:e},u=u===void 0?null:u,u!==null&&(n.callback=u),e=ni(p,n,E),e!==null&&(Or(e,p,E,y),ml(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 Wp(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function Xc(e,n){Wp(e,n),(e=e.alternate)&&Wp(e,n)}function fy(){return null}var Yp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Qc(e){this._internalRoot=e}Fl.prototype.render=Qc.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));Dl(e,n,null,null)},Fl.prototype.unmount=Qc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Mi(function(){Dl(null,e,null,null)}),n[So]=null}};function Fl(e){this._internalRoot=e}Fl.prototype.unstable_scheduleHydration=function(e){if(e){var n=Ua();e={blockedOn:null,target:e,priority:n};for(var o=0;o<Hn.length&&n!==0&&n<Hn[o].priority;o++);Hn.splice(o,0,e),o===0&&nr(e)}};function Gc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Bl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Xp(){}function dy(e,n,o,u,p){if(p){if(typeof u=="function"){var y=u;u=function(){var xe=zl(E);y.call(xe)}}var E=qp(n,u,e,0,null,!1,!1,"",Xp);return e._reactRootContainer=E,e[So]=E.current,Js(e.nodeType===8?e.parentNode:e),Mi(),E}for(;p=e.lastChild;)e.removeChild(p);if(typeof u=="function"){var z=u;u=function(){var xe=zl(X);z.call(xe)}}var X=Yc(e,0,!1,null,null,!1,!1,"",Xp);return e._reactRootContainer=X,e[So]=X.current,Js(e.nodeType===8?e.parentNode:e),Mi(function(){Dl(n,X,o,u)}),X}function Hl(e,n,o,u,p){var y=o._reactRootContainer;if(y){var E=y;if(typeof p=="function"){var z=p;p=function(){var X=zl(E);z.call(X)}}Dl(n,E,e,p)}else E=dy(o,n,e,p,u);return zl(E)}ht=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var o=tr(n.pendingLanes);o!==0&&(Fo(n,o|1),Yn(n,Xe()),(xt&6)===0&&(bs=Xe()+500,ei()))}break;case 13:Mi(function(){var u=Co(e,1);if(u!==null){var p=On();Or(u,e,1,p)}}),Xc(e,1)}},Ui=function(e){if(e.tag===13){var n=Co(e,134217728);if(n!==null){var o=On();Or(n,e,134217728,o)}Xc(e,134217728)}},Va=function(e){if(e.tag===13){var n=si(e),o=Co(e,n);if(o!==null){var u=On();Or(o,e,n,u)}Xc(e,n)}},Ua=function(){return wt},Sn=function(e,n){var o=wt;try{return wt=e,n()}finally{wt=o}},Be=function(e,n,o){switch(n){case"input":if(Tt(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 u=o[n];if(u!==e&&u.form===e.form){var p=il(u);if(!p)throw Error(i(90));Fe(u),Tt(u,p)}}}break;case"textarea":Pn(e,o);break;case"select":n=o.value,n!=null&&kt(e,!!o.multiple,n,!1)}},Ro=Hc,Lo=Mi;var py={usingClientEntryPoint:!1,Events:[ta,ls,il,oo,Br,Hc]},ma={findFiberByHostInstance:Si,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},hy={bundleType:ma.bundleType,version:ma.version,rendererPackageName:ma.rendererPackageName,rendererConfig:ma.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=Hr(e),e===null?null:e.stateNode},findFiberByHostInstance:ma.findFiberByHostInstance||fy,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 Vl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vl.isDisabled&&Vl.supportsFiber)try{In=Vl.inject(hy),sn=Vl}catch{}}return Xn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=py,Xn.createPortal=function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Gc(n))throw Error(i(200));return cy(e,n,null,o)},Xn.createRoot=function(e,n){if(!Gc(e))throw Error(i(299));var o=!1,u="",p=Yp;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onRecoverableError!==void 0&&(p=n.onRecoverableError)),n=Yc(e,1,!1,null,null,o,!1,u,p),e[So]=n.current,Js(e.nodeType===8?e.parentNode:e),new Qc(n)},Xn.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=Hr(n),e=e===null?null:e.stateNode,e},Xn.flushSync=function(e){return Mi(e)},Xn.hydrate=function(e,n,o){if(!Bl(n))throw Error(i(200));return Hl(null,e,n,!0,o)},Xn.hydrateRoot=function(e,n,o){if(!Gc(e))throw Error(i(405));var u=o!=null&&o.hydratedSources||null,p=!1,y="",E=Yp;if(o!=null&&(o.unstable_strictMode===!0&&(p=!0),o.identifierPrefix!==void 0&&(y=o.identifierPrefix),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),n=qp(n,null,e,1,o??null,p,!1,y,E),e[So]=n.current,Js(e),u)for(e=0;e<u.length;e++)o=u[e],p=o._getVersion,p=p(o._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[o,p]:n.mutableSourceEagerHydrationData.push(o,p);return new Fl(n)},Xn.render=function(e,n,o){if(!Bl(n))throw Error(i(200));return Hl(null,e,n,!1,o)},Xn.unmountComponentAtNode=function(e){if(!Bl(e))throw Error(i(40));return e._reactRootContainer?(Mi(function(){Hl(null,null,e,!1,function(){e._reactRootContainer=null,e[So]=null})}),!0):!1},Xn.unstable_batchedUpdates=Hc,Xn.unstable_renderSubtreeIntoContainer=function(e,n,o,u){if(!Bl(o))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return Hl(e,n,o,!1,u)},Xn.version="18.3.1-next-f1338f8080-20240426",Xn}var rh;function bm(){if(rh)return ef.exports;rh=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(),ef.exports=ky(),ef.exports}var oh;function Ny(){if(oh)return Ul;oh=1;var t=bm();return Ul.createRoot=t.createRoot,Ul.hydrateRoot=t.hydrateRoot,Ul}var Ey=Ny();const Cy=bu(Ey),jy="x-api-doc-tor-llm-key";function tu(t){switch(t){case"anthropic":return"claude-sonnet-4-20250514";case"openai":return"gpt-4o-mini";case"openrouter":return"openai/gpt-4o-mini";default:return"gpt-4o-mini"}}const Py=["get","post","put","patch","delete","options","head","trace"];function ih(t){return t.replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_|_$/g,"").replace(/_+/g,"_")}function _u(t,r,i,s){if(i)return ih(i).replace(/^[0-9]/,"_$&")||`op_${s}`;const l=ih(r.replace(/[{}]/g,""));return`${t}_${l}`||`op_${s}`}function Su(t){var s;return`${(((s=t.info)==null?void 0:s.title)??"Api").replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean).map(l=>l.charAt(0).toUpperCase()+l.slice(1).toLowerCase()).join("")||"Api"}Client`}function ku(t){return(t.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join("")||"Api")+"Service"}function no(t){const r=[];if(!t.paths)return r;for(const[i,s]of Object.entries(t.paths)){if(!s||typeof s!="object"||"$ref"in s)continue;const l=s;for(const c of Py){const d=l[c];d&&typeof d=="object"&&r.push({method:c,path:i,operationId:d.operationId,tags:d.tags})}}return r}function $y(t,r,i,s="baseUrl"){var c,d;const l=r.toUpperCase();return`const ${s} = "${((d=(c=t.servers)==null?void 0:c[0])==null?void 0:d.url)??"http://localhost:3000"}";
|
|
41
|
+
/** @returns {Promise<unknown>} */
|
|
42
|
+
const res = await fetch(\`${s}${i}\`, {
|
|
43
|
+
method: "${l}",
|
|
44
|
+
headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
|
|
45
|
+
${l==="GET"||l==="HEAD"?"":"body: JSON.stringify({}),"}
|
|
46
|
+
});
|
|
47
|
+
const data = await res.json();
|
|
48
|
+
`}function _m(t,r){const i=t.map((s,l)=>` /**
|
|
49
|
+
* @param {{ headers?: Record<string, string> }} [options]
|
|
50
|
+
* @returns {Promise<unknown>}
|
|
51
|
+
*/
|
|
52
|
+
async ${_u(s.method,s.path,s.operationId,l)}(options) {
|
|
53
|
+
const res = await fetch(\`\${this.baseUrl}${s.path}\`, {
|
|
54
|
+
method: "${s.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 My(t){return _m(no(t),Su(t))}function Ty(t,r){const i=ku(r),s=no(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return _m(s,i)}function Iy(t,r,i){var c,d;const s=((d=(c=t.servers)==null?void 0:c[0])==null?void 0:d.url)??"http://localhost:3000",l=r.toUpperCase();return`<?php
|
|
73
|
+
$baseUrl = '${s}';
|
|
74
|
+
$url = $baseUrl . '${i}';
|
|
75
|
+
$opts = [
|
|
76
|
+
'http' => [
|
|
77
|
+
'method' => '${l}',
|
|
78
|
+
'header' => "Content-Type: application/json\\r\\nAuthorization: Bearer {$token}\\r\\n",
|
|
79
|
+
${l==="GET"||l==="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 Sm(t,r){const i=t.map((s,l)=>` public function ${_u(s.method,s.path,s.operationId,l)}(array $extraHeaders = []): array
|
|
86
|
+
{
|
|
87
|
+
$url = $this->baseUrl . '${s.path}';
|
|
88
|
+
$headers = array_merge($this->defaultHeaders, $extraHeaders);
|
|
89
|
+
$opts = [
|
|
90
|
+
'http' => [
|
|
91
|
+
'method' => '${s.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 Ay(t){return Sm(no(t),Su(t))}function Oy(t,r){const i=ku(r),s=no(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return Sm(s,i)}function Ry(t,r,i){var d,h;const s=((h=(d=t.servers)==null?void 0:d[0])==null?void 0:h.url)??"http://localhost:3000",l=r.toLowerCase();return`import httpx
|
|
127
|
+
|
|
128
|
+
base_url = "${s}"
|
|
129
|
+
url = f"{base_url}${i}"
|
|
130
|
+
headers = {"Authorization": f"Bearer {token}"}
|
|
131
|
+
with httpx.Client() as client:
|
|
132
|
+
response = client.${l}(url, headers=headers${l==="get"||l==="head"?"":", json={}"})
|
|
133
|
+
data = response.json()
|
|
134
|
+
`}function km(t,r){const i=t.map((s,l)=>{const c=_u(s.method,s.path,s.operationId,l),d=s.method.toLowerCase(),h=d==="get"||d==="head"?"":", json={}";return` def ${c}(self, headers: dict | None = None) -> dict:
|
|
135
|
+
h = {**self.default_headers, **(headers or {})}
|
|
136
|
+
r = self._client.${d}(f"{self.base_url}${s.path}", headers=h${h})
|
|
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 Ly(t){return km(no(t),Su(t))}function Dy(t,r){const i=ku(r),s=no(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return km(s,i)}function zy(t){const r=t.split("/");return(r[r.length-1]??"Unknown").replace(/[^a-zA-Z0-9_]/g,"_")}function _f(t){if(!t)return"unknown";if("$ref"in t&&t.$ref)return zy(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?`${_f(r.items)}[]`:r.type==="object"&&r.properties?`{
|
|
153
|
+
${Object.entries(r.properties).map(([s,l])=>` ${JSON.stringify(s)}?: ${_f(l)};`).join(`
|
|
154
|
+
`)}
|
|
155
|
+
}`:"Record<string, unknown>"}function Fy(t,r,i,s="baseUrl"){var b,S,x,_,C,j;const l=(S=(b=t.paths)==null?void 0:b[i])==null?void 0:S[r],c=l==null?void 0:l.requestBody;let d;if((_=(x=c==null?void 0:c.content)==null?void 0:x["application/json"])!=null&&_.schema){const $=c.content["application/json"].schema;$&&!("$ref"in $)&&(d=$)}const h=d?_f(d):"Record<string, unknown>",v=r.toUpperCase();return`const ${s} = "${((j=(C=t.servers)==null?void 0:C[0])==null?void 0:j.url)??"http://localhost:3000"}";
|
|
156
|
+
const res = await fetch(\`${s}${i}\`, {
|
|
157
|
+
method: "${v}",
|
|
158
|
+
headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
|
|
159
|
+
${v==="GET"||v==="HEAD"?"":`body: JSON.stringify({} as ${h}),`}
|
|
160
|
+
});
|
|
161
|
+
const data = await res.json() as unknown;
|
|
162
|
+
`}function Nm(t,r){const i=t.map((s,l)=>` async ${_u(s.method,s.path,s.operationId,l)}(options?: { headers?: Record<string, string> }): Promise<unknown> {
|
|
163
|
+
const res = await fetch(\`\${this.baseUrl}${s.path}\`, {
|
|
164
|
+
method: "${s.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 By(t){const r=no(t),i=Su(t);return Nm(r,i)}function Hy(t,r){const i=ku(r),s=no(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return Nm(s,i)}function Vy(t,r,i,s){switch(r){case"typescript":return Fy(t,i,s);case"javascript":return $y(t,i,s);case"python":return Ry(t,i,s);case"php":return Iy(t,i,s);default:{const l=r;throw new Error(`Unsupported language: ${l}`)}}}function Uy(t,r,i){switch(r){case"typescript":return Hy(t,i);case"javascript":return Ty(t,i);case"python":return Dy(t,i);case"php":return Oy(t,i);default:{const s=r;throw new Error(`Unsupported language: ${s}`)}}}function Ky(t,r,i){if(i===null)switch(r){case"typescript":return By(t);case"javascript":return My(t);case"python":return Ly(t);case"php":return Ay(t);default:{const s=r;throw new Error(`Unsupported language: ${s}`)}}return Uy(t,r,i)}function qy(t){const r=new Set;for(const i of no(t))for(const s of i.tags??[])r.add(s);return r.size===0&&r.add("default"),[...r].sort()}function Ri(t,r){var i,s,l;return r!=null&&r.trim()?r.replace(/\/$/,""):((l=(s=(i=t.servers)==null?void 0:i[0])==null?void 0:s.url)==null?void 0:l.replace(/\/$/,""))??window.location.origin}function Wy(t){var i;const r=(i=t.components)==null?void 0:i.securitySchemes;return r?Object.keys(r):[]}function Ff(t,r){if(!r.startsWith("$"))return;let i=t;const s=r.slice(1);if(s.startsWith(".")){for(const l of s.slice(1).split("."))if(i&&typeof i=="object"&&l in i)i=i[l];else return;return i}return i}var nu={exports:{}},Yy=nu.exports,sh;function Xy(){return sh||(sh=1,(function(t,r){((i,s)=>{t.exports=s()})(Yy,function(){var i=function(a,f){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(m,w){m.__proto__=w}:function(m,w){for(var k in w)Object.prototype.hasOwnProperty.call(w,k)&&(m[k]=w[k])}))(a,f)},s=function(){return(s=Object.assign||function(a){for(var f,m=1,w=arguments.length;m<w;m++)for(var k in f=arguments[m])Object.prototype.hasOwnProperty.call(f,k)&&(a[k]=f[k]);return a}).apply(this,arguments)};function l(a,f,m){for(var w,k=0,N=f.length;k<N;k++)!w&&k in f||((w=w||Array.prototype.slice.call(f,0,k))[k]=f[k]);return a.concat(w||Array.prototype.slice.call(f))}var c=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:vy,d=Object.keys,h=Array.isArray;function v(a,f){return typeof f=="object"&&d(f).forEach(function(m){a[m]=f[m]}),a}typeof Promise>"u"||c.Promise||(c.Promise=Promise);var b=Object.getPrototypeOf,S={}.hasOwnProperty;function x(a,f){return S.call(a,f)}function _(a,f){typeof f=="function"&&(f=f(b(a))),(typeof Reflect>"u"?d:Reflect.ownKeys)(f).forEach(function(m){j(a,m,f[m])})}var C=Object.defineProperty;function j(a,f,m,w){C(a,f,v(m&&x(m,"get")&&typeof m.get=="function"?{get:m.get,set:m.set,configurable:!0}:{value:m,configurable:!0,writable:!0},w))}function $(a){return{from:function(f){return a.prototype=Object.create(f.prototype),j(a.prototype,"constructor",a),{extend:_.bind(null,a.prototype)}}}}var T=Object.getOwnPropertyDescriptor,I=[].slice;function H(a,f,m){return I.call(a,f,m)}function P(a,f){return f(a)}function R(a){if(!a)throw new Error("Assertion Failed")}function B(a){c.setImmediate?setImmediate(a):setTimeout(a,0)}function V(a,f){if(typeof f=="string"&&x(a,f))return a[f];if(!f)return a;if(typeof f!="string"){for(var m=[],w=0,k=f.length;w<k;++w){var N=V(a,f[w]);m.push(N)}return m}var M,O=f.indexOf(".");return O===-1||(M=a[f.substr(0,O)])==null?void 0:V(M,f.substr(O+1))}function W(a,f,m){if(a&&f!==void 0&&!("isFrozen"in Object&&Object.isFrozen(a)))if(typeof f!="string"&&"length"in f){R(typeof m!="string"&&"length"in m);for(var w=0,k=f.length;w<k;++w)W(a,f[w],m[w])}else{var N,M,O=f.indexOf(".");O!==-1?(N=f.substr(0,O),(O=f.substr(O+1))===""?m===void 0?h(a)&&!isNaN(parseInt(N))?a.splice(N,1):delete a[N]:a[N]=m:W(M=(M=a[N])&&x(a,N)?M:a[N]={},O,m)):m===void 0?h(a)&&!isNaN(parseInt(f))?a.splice(f,1):delete a[f]:a[f]=m}}function Q(a){var f,m={};for(f in a)x(a,f)&&(m[f]=a[f]);return m}var de=[].concat;function ke(a){return de.apply([],a)}var K="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(ke([8,16,32,64].map(function(a){return["Int","Uint","Float"].map(function(f){return f+a+"Array"})}))).filter(function(a){return c[a]}),Y=new Set(K.map(function(a){return c[a]})),fe=null;function ve(a){return fe=new WeakMap,a=(function f(m){if(!m||typeof m!="object")return m;var w=fe.get(m);if(w)return w;if(h(m)){w=[],fe.set(m,w);for(var k=0,N=m.length;k<N;++k)w.push(f(m[k]))}else if(Y.has(m.constructor))w=m;else{var M,O=b(m);for(M in w=O===Object.prototype?{}:Object.create(O),fe.set(m,w),m)x(m,M)&&(w[M]=f(m[M]))}return w})(a),fe=null,a}var D={}.toString;function ue(a){return D.call(a).slice(8,-1)}var G=typeof Symbol<"u"?Symbol.iterator:"@@iterator",se=typeof G=="symbol"?function(a){var f;return a!=null&&(f=a[G])&&f.apply(a)}:function(){return null};function F(a,f){f=a.indexOf(f),0<=f&&a.splice(f,1)}var q={};function Z(a){var f,m,w,k;if(arguments.length===1){if(h(a))return a.slice();if(this===q&&typeof a=="string")return[a];if(k=se(a))for(m=[];!(w=k.next()).done;)m.push(w.value);else{if(a==null)return[a];if(typeof(f=a.length)!="number")return[a];for(m=new Array(f);f--;)m[f]=a[f]}}else for(f=arguments.length,m=new Array(f);f--;)m[f]=arguments[f];return m}var A=typeof Symbol<"u"?function(a){return a[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},K=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],St=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(K),pe={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 be(a,f){this.name=a,this.message=f}function $e(a,f){return a+". Errors: "+Object.keys(f).map(function(m){return f[m].toString()}).filter(function(m,w,k){return k.indexOf(m)===w}).join(`
|
|
179
|
+
`)}function Ae(a,f,m,w){this.failures=f,this.failedKeys=w,this.successCount=m,this.message=$e(a,f)}function Oe(a,f){this.name="BulkError",this.failures=Object.keys(f).map(function(m){return f[m]}),this.failuresByPos=f,this.message=$e(a,this.failures)}$(be).from(Error).extend({toString:function(){return this.name+": "+this.message}}),$(Ae).from(be),$(Oe).from(be);var Se=St.reduce(function(a,f){return a[f]=f+"Error",a},{}),De=be,Ne=St.reduce(function(a,f){var m=f+"Error";function w(k,N){this.name=m,k?typeof k=="string"?(this.message="".concat(k).concat(N?`
|
|
180
|
+
`+N:""),this.inner=N||null):typeof k=="object"&&(this.message="".concat(k.name," ").concat(k.message),this.inner=k):(this.message=pe[f]||m,this.inner=null)}return $(w).from(De),a[f]=w,a},{}),et=(Ne.Syntax=SyntaxError,Ne.Type=TypeError,Ne.Range=RangeError,K.reduce(function(a,f){return a[f+"Error"]=Ne[f],a},{}));K=St.reduce(function(a,f){return["Syntax","Type","Range"].indexOf(f)===-1&&(a[f+"Error"]=Ne[f]),a},{});function Fe(){}function Ke(a){return a}function qe(a,f){return a==null||a===Ke?f:function(m){return f(a(m))}}function at(a,f){return function(){a.apply(this,arguments),f.apply(this,arguments)}}function ot(a,f){return a===Fe?f:function(){var m=a.apply(this,arguments),w=(m!==void 0&&(arguments[0]=m),this.onsuccess),k=this.onerror,N=(this.onsuccess=null,this.onerror=null,f.apply(this,arguments));return w&&(this.onsuccess=this.onsuccess?at(w,this.onsuccess):w),k&&(this.onerror=this.onerror?at(k,this.onerror):k),N!==void 0?N:m}}function Tt(a,f){return a===Fe?f:function(){a.apply(this,arguments);var m=this.onsuccess,w=this.onerror;this.onsuccess=this.onerror=null,f.apply(this,arguments),m&&(this.onsuccess=this.onsuccess?at(m,this.onsuccess):m),w&&(this.onerror=this.onerror?at(w,this.onerror):w)}}function xn(a,f){return a===Fe?f:function(k){var w=a.apply(this,arguments),k=(v(k,w),this.onsuccess),N=this.onerror,M=(this.onsuccess=null,this.onerror=null,f.apply(this,arguments));return k&&(this.onsuccess=this.onsuccess?at(k,this.onsuccess):k),N&&(this.onerror=this.onerror?at(N,this.onerror):N),w===void 0?M===void 0?void 0:M:v(w,M)}}function Wt(a,f){return a===Fe?f:function(){return f.apply(this,arguments)!==!1&&a.apply(this,arguments)}}function Yt(a,f){return a===Fe?f:function(){var m=a.apply(this,arguments);if(m&&typeof m.then=="function"){for(var w=this,k=arguments.length,N=new Array(k);k--;)N[k]=arguments[k];return m.then(function(){return f.apply(w,N)})}return f.apply(this,arguments)}}K.ModifyError=Ae,K.DexieError=be,K.BulkError=Oe;var kt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function nn(a){kt=a}var dn={},Pn=100,wn=typeof Promise>"u"?[]:(St=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[wn=crypto.subtle.digest("SHA-512",new Uint8Array([0])),b(wn),St]:[St,b(St),St]),St=wn[0],vo=wn[1],vo=vo&&vo.then,Xt=St&&St.constructor,Ht=!!wn[2],lr=function(a,f){Nt.push([a,f]),Rn&&(queueMicrotask(Lo),Rn=!1)},yt=!0,Rn=!0,Gn=[],Ln=[],Dn=Ke,pn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Fe,pgp:!1,env:{},finalize:Fe},We=pn,Nt=[],$n=0,ur=[];function Be(a){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var f=this._PSD=We;if(typeof a!="function"){if(a!==dn)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&_r(this,this._value)}else this._state=null,this._value=null,++f.ref,(function m(w,k){try{k(function(N){if(w._state===null){if(N===w)throw new TypeError("A promise cannot be resolved with itself.");var M=w._lib&&Fn();N&&typeof N.then=="function"?m(w,function(O,ee){N instanceof Be?N._then(O,ee):N.then(O,ee)}):(w._state=!0,w._value=N,oo(w)),M&&rn()}},_r.bind(null,w))}catch(N){_r(w,N)}})(this,a)}var zn={get:function(){var a=We,f=fr;function m(w,k){var N=this,M=!a.global&&(a!==We||f!==fr),O=M&&!Ft(),ee=new Be(function(ce,ne){Br(N,new Jn(Vr(w,a,M,O),Vr(k,a,M,O),ce,ne,a))});return this._consoleTask&&(ee._consoleTask=this._consoleTask),ee}return m.prototype=dn,m},set:function(a){j(this,"then",a&&a.prototype===dn?zn:{get:function(){return a},set:zn.set})}};function Jn(a,f,m,w,k){this.onFulfilled=typeof a=="function"?a:null,this.onRejected=typeof f=="function"?f:null,this.resolve=m,this.reject=w,this.psd=k}function _r(a,f){var m,w;Ln.push(f),a._state===null&&(m=a._lib&&Fn(),f=Dn(f),a._state=!1,a._value=f,w=a,Gn.some(function(k){return k._value===w._value})||Gn.push(w),oo(a),m)&&rn()}function oo(a){var f=a._listeners;a._listeners=[];for(var m=0,w=f.length;m<w;++m)Br(a,f[m]);var k=a._PSD;--k.ref||k.finalize(),$n===0&&(++$n,lr(function(){--$n==0&&Mn()},[]))}function Br(a,f){if(a._state===null)a._listeners.push(f);else{var m=a._state?f.onFulfilled:f.onRejected;if(m===null)return(a._state?f.resolve:f.reject)(a._value);++f.psd.ref,++$n,lr(Ro,[m,a,f])}}function Ro(a,f,m){try{var w,k=f._value;!f._state&&Ln.length&&(Ln=[]),w=kt&&f._consoleTask?f._consoleTask.run(function(){return a(k)}):a(k),f._state||Ln.indexOf(k)!==-1||(N=>{for(var M=Gn.length;M;)if(Gn[--M]._value===N._value)return Gn.splice(M,1)})(f),m.resolve(w)}catch(N){m.reject(N)}finally{--$n==0&&Mn(),--m.psd.ref||m.psd.finalize()}}function Lo(){bn(pn,function(){Fn()&&rn()})}function Fn(){var a=yt;return Rn=yt=!1,a}function rn(){var a,f,m;do for(;0<Nt.length;)for(a=Nt,Nt=[],m=a.length,f=0;f<m;++f){var w=a[f];w[0].apply(null,w[1])}while(0<Nt.length);Rn=yt=!0}function Mn(){for(var a=Gn,f=(Gn=[],a.forEach(function(w){w._PSD.onunhandled.call(null,w._value,w)}),ur.slice(0)),m=f.length;m;)f[--m]()}function cr(a){return new Be(dn,!1,a)}function mt(a,f){var m=We;return function(){var w=Fn(),k=We;try{return Bn(m,!0),a.apply(this,arguments)}catch(N){f&&f(N)}finally{Bn(k,!1),w&&rn()}}}_(Be.prototype,{then:zn,_then:function(a,f){Br(this,new Jn(null,null,a,f,We))},catch:function(a){var f,m;return arguments.length===1?this.then(null,a):(f=a,m=arguments[1],typeof f=="function"?this.then(null,function(w){return(w instanceof f?m:cr)(w)}):this.then(null,function(w){return(w&&w.name===f?m:cr)(w)}))},finally:function(a){return this.then(function(f){return Be.resolve(a()).then(function(){return f})},function(f){return Be.resolve(a()).then(function(){return cr(f)})})},timeout:function(a,f){var m=this;return a<1/0?new Be(function(w,k){var N=setTimeout(function(){return k(new Ne.Timeout(f))},a);m.then(w,k).finally(clearTimeout.bind(null,N))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&j(Be.prototype,Symbol.toStringTag,"Dexie.Promise"),pn.env=Hr(),_(Be,{all:function(){var a=Z.apply(null,arguments).map(pr);return new Be(function(f,m){a.length===0&&f([]);var w=a.length;a.forEach(function(k,N){return Be.resolve(k).then(function(M){a[N]=M,--w||f(a)},m)})})},resolve:function(a){return a instanceof Be?a:a&&typeof a.then=="function"?new Be(function(f,m){a.then(f,m)}):new Be(dn,!0,a)},reject:cr,race:function(){var a=Z.apply(null,arguments).map(pr);return new Be(function(f,m){a.map(function(w){return Be.resolve(w).then(f,m)})})},PSD:{get:function(){return We},set:function(a){return We=a}},totalEchoes:{get:function(){return fr}},newPSD:Tn,usePSD:bn,scheduler:{get:function(){return lr},set:function(a){lr=a}},rejectionMapper:{get:function(){return Dn},set:function(a){Dn=a}},follow:function(a,f){return new Be(function(m,w){return Tn(function(k,N){var M=We;M.unhandleds=[],M.onunhandled=N,M.finalize=at(function(){var O,ee=this;O=function(){ee.unhandleds.length===0?k():N(ee.unhandleds[0])},ur.push(function ce(){O(),ur.splice(ur.indexOf(ce),1)}),++$n,lr(function(){--$n==0&&Mn()},[])},M.finalize),a()},f,m,w)})}}),Xt&&(Xt.allSettled&&j(Be,"allSettled",function(){var a=Z.apply(null,arguments).map(pr);return new Be(function(f){a.length===0&&f([]);var m=a.length,w=new Array(m);a.forEach(function(k,N){return Be.resolve(k).then(function(M){return w[N]={status:"fulfilled",value:M}},function(M){return w[N]={status:"rejected",reason:M}}).then(function(){return--m||f(w)})})})}),Xt.any&&typeof AggregateError<"u"&&j(Be,"any",function(){var a=Z.apply(null,arguments).map(pr);return new Be(function(f,m){a.length===0&&m(new AggregateError([]));var w=a.length,k=new Array(w);a.forEach(function(N,M){return Be.resolve(N).then(function(O){return f(O)},function(O){k[M]=O,--w||m(new AggregateError(k))})})})}),Xt.withResolvers)&&(Be.withResolvers=Xt.withResolvers);var It={awaits:0,echoes:0,id:0},Sr=0,Zn=[],er=0,fr=0,pi=0;function Tn(a,M,m,w){var k=We,N=Object.create(k),M=(N.parent=k,N.ref=0,N.global=!1,N.id=++pi,pn.env,N.env=Ht?{Promise:Be,PromiseProp:{value:Be,configurable:!0,writable:!0},all:Be.all,race:Be.race,allSettled:Be.allSettled,any:Be.any,resolve:Be.resolve,reject:Be.reject}:{},M&&v(N,M),++k.ref,N.finalize=function(){--this.parent.ref||this.parent.finalize()},bn(N,a,m,w));return N.ref===0&&N.finalize(),M}function dr(){return It.id||(It.id=++Sr),++It.awaits,It.echoes+=Pn,It.id}function Ft(){return!!It.awaits&&(--It.awaits==0&&(It.id=0),It.echoes=It.awaits*Pn,!0)}function pr(a){return It.echoes&&a&&a.constructor===Xt?(dr(),a.then(function(f){return Ft(),f},function(f){return Ft(),_e(f)})):a}function io(){var a=Zn[Zn.length-1];Zn.pop(),Bn(a,!1)}function Bn(a,f){var m,w,k=We;(f?!It.echoes||er++&&a===We:!er||--er&&a===We)||queueMicrotask(f?(function(N){++fr,It.echoes&&--It.echoes!=0||(It.echoes=It.awaits=It.id=0),Zn.push(We),Bn(N,!0)}).bind(null,a):io),a!==We&&(We=a,k===pn&&(pn.env=Hr()),Ht)&&(m=pn.env.Promise,w=a.env,k.global||a.global)&&(Object.defineProperty(c,"Promise",w.PromiseProp),m.all=w.all,m.race=w.race,m.resolve=w.resolve,m.reject=w.reject,w.allSettled&&(m.allSettled=w.allSettled),w.any)&&(m.any=w.any)}function Hr(){var a=c.Promise;return Ht?{Promise:a,PromiseProp:Object.getOwnPropertyDescriptor(c,"Promise"),all:a.all,race:a.race,allSettled:a.allSettled,any:a.any,resolve:a.resolve,reject:a.reject}:{}}function bn(a,f,m,w,k){var N=We;try{return Bn(a,!0),f(m,w,k)}finally{Bn(N,!1)}}function Vr(a,f,m,w){return typeof a!="function"?a:function(){var k=We;m&&dr(),Bn(f,!0);try{return a.apply(this,arguments)}finally{Bn(k,!1),w&&queueMicrotask(Ft)}}}function L(a){Promise===Xt&&It.echoes===0?er===0?a():enqueueNativeMicroTask(a):setTimeout(a,0)}(""+vo).indexOf("[native code]")===-1&&(dr=Ft=Fe);var _e=Be.reject,He="",Xe="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",on="String expected.",Vt="__dbnames",Qt="readonly",Ut="readwrite";function Ct(a,f){return a?f?function(){return a.apply(this,arguments)&&f.apply(this,arguments)}:a:f}var _n={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function In(a){return typeof a!="string"||/\./.test(a)?function(f){return f}:function(f){return f[a]===void 0&&a in f&&delete(f=ve(f))[a],f}}function sn(){throw Ne.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function ft(a,f){try{var m=Kt(a),w=Kt(f);if(m!==w)return m==="Array"?1:w==="Array"?-1:m==="binary"?1:w==="binary"?-1:m==="string"?1:w==="string"?-1:m==="Date"?1:w!=="Date"?NaN:-1;switch(m){case"number":case"Date":case"string":return f<a?1:a<f?-1:0;case"binary":for(var k=Do(a),N=Do(f),M=k.length,O=N.length,ee=M<O?M:O,ce=0;ce<ee;++ce)if(k[ce]!==N[ce])return k[ce]<N[ce]?-1:1;return M===O?0:M<O?-1:1;case"Array":for(var ne=a,J=f,te=ne.length,le=J.length,ie=te<le?te:le,oe=0;oe<ie;++oe){var ae=ft(ne[oe],J[oe]);if(ae!==0)return ae}return te===le?0:te<le?-1:1}}catch{}return NaN}function Kt(a){var f=typeof a;return f=="object"&&(ArrayBuffer.isView(a)||(f=ue(a))==="ArrayBuffer")?"binary":f}function Do(a){return a instanceof Uint8Array?a:ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):new Uint8Array(a)}function zo(a,f,m){var w=a.schema.yProps;return w?(f&&0<m.numFailures&&(f=f.filter(function(k,N){return!m.failures[N]})),Promise.all(w.map(function(k){return k=k.updatesTable,f?a.db.table(k).where("k").anyOf(f).delete():a.db.table(k).clear()})).then(function(){return m})):m}ao.prototype.execute=function(a){var f=this["@@propmod"];if(f.add!==void 0){var m=f.add;if(h(m))return l(l([],h(a)?a:[],!0),m).sort();if(typeof m=="number")return(Number(a)||0)+m;if(typeof m=="bigint")try{return BigInt(a)+m}catch{return BigInt(0)+m}throw new TypeError("Invalid term ".concat(m))}if(f.remove!==void 0){var w=f.remove;if(h(w))return h(a)?a.filter(function(k){return!w.includes(k)}).sort():[];if(typeof w=="number")return Number(a)-w;if(typeof w=="bigint")try{return BigInt(a)-w}catch{return BigInt(0)-w}throw new TypeError("Invalid subtrahend ".concat(w))}return m=(m=f.replacePrefix)==null?void 0:m[0],m&&typeof a=="string"&&a.startsWith(m)?f.replacePrefix[1]+a.substring(m.length):a};var so=ao;function ao(a){this["@@propmod"]=a}function lo(a,f){for(var m=d(f),w=m.length,k=!1,N=0;N<w;++N){var M=m[N],O=f[M],ee=V(a,M);O instanceof so?(W(a,M,O.execute(ee)),k=!0):ee!==O&&(W(a,M,O),k=!0)}return k}vt.prototype._trans=function(a,f,m){var w=this._tx||We.trans,k=this.name,N=kt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(a==="readonly"?"read":"write"," ").concat(this.name));function M(ce,ne,J){if(J.schema[k])return f(J.idbtrans,J);throw new Ne.NotFound("Table "+k+" not part of transaction")}var O=Fn();try{var ee=w&&w.db._novip===this.db._novip?w===We.trans?w._promise(a,M,m):Tn(function(){return w._promise(a,M,m)},{trans:w,transless:We.transless||We}):(function ce(ne,J,te,le){if(ne.idbdb&&(ne._state.openComplete||We.letThrough||ne._vip)){var ie=ne._createTransaction(J,te,ne._dbSchema);try{ie.create(),ne._state.PR1398_maxLoop=3}catch(oe){return oe.name===Se.InvalidState&&ne.isOpen()&&0<--ne._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),ne.close({disableAutoOpen:!1}),ne.open().then(function(){return ce(ne,J,te,le)})):_e(oe)}return ie._promise(J,function(oe,ae){return Tn(function(){return We.trans=ie,le(oe,ae,ie)})}).then(function(oe){if(J==="readwrite")try{ie.idbtrans.commit()}catch{}return J==="readonly"?oe:ie._completion.then(function(){return oe})})}if(ne._state.openComplete)return _e(new Ne.DatabaseClosed(ne._state.dbOpenError));if(!ne._state.isBeingOpened){if(!ne._state.autoOpen)return _e(new Ne.DatabaseClosed);ne.open().catch(Fe)}return ne._state.dbReadyPromise.then(function(){return ce(ne,J,te,le)})})(this.db,a,[this.name],M);return N&&(ee._consoleTask=N,ee=ee.catch(function(ce){return console.trace(ce),_e(ce)})),ee}finally{O&&rn()}},vt.prototype.get=function(a,f){var m=this;return a&&a.constructor===Object?this.where(a).first(f):a==null?_e(new Ne.Type("Invalid argument to Table.get()")):this._trans("readonly",function(w){return m.core.get({trans:w,key:a}).then(function(k){return m.hook.reading.fire(k)})}).then(f)},vt.prototype.where=function(a){if(typeof a=="string")return new this.db.WhereClause(this,a);if(h(a))return new this.db.WhereClause(this,"[".concat(a.join("+"),"]"));var f=d(a);if(f.length===1)return this.where(f[0]).equals(a[f[0]]);var m=this.schema.indexes.concat(this.schema.primKey).filter(function(O){if(O.compound&&f.every(function(ce){return 0<=O.keyPath.indexOf(ce)})){for(var ee=0;ee<f.length;++ee)if(f.indexOf(O.keyPath[ee])===-1)return!1;return!0}return!1}).sort(function(O,ee){return O.keyPath.length-ee.keyPath.length})[0];if(m&&this.db._maxKey!==He)return M=m.keyPath.slice(0,f.length),this.where(M).equals(M.map(function(O){return a[O]}));!m&&kt&&console.warn("The query ".concat(JSON.stringify(a)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(f.join("+"),"]"));var w=this.schema.idxByName;function k(O,ee){return ft(O,ee)===0}var M=f.reduce(function(ne,ee){var ce=ne[0],ne=ne[1],J=w[ee],te=a[ee];return[ce||J,ce||!J?Ct(ne,J&&J.multi?function(le){return le=V(le,ee),h(le)&&le.some(function(ie){return k(te,ie)})}:function(le){return k(te,V(le,ee))}):ne]},[null,null]),N=M[0],M=M[1];return N?this.where(N.name).equals(a[N.keyPath]).filter(M):m?this.filter(M):this.where(f).equals("")},vt.prototype.filter=function(a){return this.toCollection().and(a)},vt.prototype.count=function(a){return this.toCollection().count(a)},vt.prototype.offset=function(a){return this.toCollection().offset(a)},vt.prototype.limit=function(a){return this.toCollection().limit(a)},vt.prototype.each=function(a){return this.toCollection().each(a)},vt.prototype.toArray=function(a){return this.toCollection().toArray(a)},vt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},vt.prototype.orderBy=function(a){return new this.db.Collection(new this.db.WhereClause(this,h(a)?"[".concat(a.join("+"),"]"):a))},vt.prototype.reverse=function(){return this.toCollection().reverse()},vt.prototype.mapToClass=function(a){for(var f=this.db,m=this.name,w=((this.schema.mappedClass=a).prototype instanceof sn&&(a=(M=>{var O=ne,ee=M;if(typeof ee!="function"&&ee!==null)throw new TypeError("Class extends value "+String(ee)+" is not a constructor or null");function ce(){this.constructor=O}function ne(){return M!==null&&M.apply(this,arguments)||this}return i(O,ee),O.prototype=ee===null?Object.create(ee):(ce.prototype=ee.prototype,new ce),Object.defineProperty(ne.prototype,"db",{get:function(){return f},enumerable:!1,configurable:!0}),ne.prototype.table=function(){return m},ne})(a)),new Set),k=a.prototype;k;k=b(k))Object.getOwnPropertyNames(k).forEach(function(M){return w.add(M)});function N(M){if(!M)return M;var O,ee=Object.create(a.prototype);for(O in M)if(!w.has(O))try{ee[O]=M[O]}catch{}return ee}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=N,this.hook("reading",N),a},vt.prototype.defineClass=function(){return this.mapToClass(function(a){v(this,a)})},vt.prototype.add=function(a,f){var m=this,w=this.schema.primKey,k=w.auto,N=w.keyPath,M=a;return N&&k&&(M=In(N)(a)),this._trans("readwrite",function(O){return m.core.mutate({trans:O,type:"add",keys:f!=null?[f]:null,values:[M]})}).then(function(O){return O.numFailures?Be.reject(O.failures[0]):O.lastResult}).then(function(O){if(N)try{W(a,N,O)}catch{}return O})},vt.prototype.upsert=function(a,f){var m=this,w=this.schema.primKey.keyPath;return this._trans("readwrite",function(k){return m.core.get({trans:k,key:a}).then(function(N){var M=N??{};return lo(M,f),w&&W(M,w,a),m.core.mutate({trans:k,type:"put",values:[M],keys:[a],upsert:!0,updates:{keys:[a],changeSpecs:[f]}}).then(function(O){return O.numFailures?Be.reject(O.failures[0]):!!N})})})},vt.prototype.update=function(a,f){return typeof a!="object"||h(a)?this.where(":id").equals(a).modify(f):(a=V(a,this.schema.primKey.keyPath))===void 0?_e(new Ne.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(a).modify(f)},vt.prototype.put=function(a,f){var m=this,w=this.schema.primKey,k=w.auto,N=w.keyPath,M=a;return N&&k&&(M=In(N)(a)),this._trans("readwrite",function(O){return m.core.mutate({trans:O,type:"put",values:[M],keys:f!=null?[f]:null})}).then(function(O){return O.numFailures?Be.reject(O.failures[0]):O.lastResult}).then(function(O){if(N)try{W(a,N,O)}catch{}return O})},vt.prototype.delete=function(a){var f=this;return this._trans("readwrite",function(m){return f.core.mutate({trans:m,type:"delete",keys:[a]}).then(function(w){return zo(f,[a],w)}).then(function(w){return w.numFailures?Be.reject(w.failures[0]):void 0})})},vt.prototype.clear=function(){var a=this;return this._trans("readwrite",function(f){return a.core.mutate({trans:f,type:"deleteRange",range:_n}).then(function(m){return zo(a,null,m)})}).then(function(f){return f.numFailures?Be.reject(f.failures[0]):void 0})},vt.prototype.bulkGet=function(a){var f=this;return this._trans("readonly",function(m){return f.core.getMany({keys:a,trans:m}).then(function(w){return w.map(function(k){return f.hook.reading.fire(k)})})})},vt.prototype.bulkAdd=function(a,f,m){var w=this,k=Array.isArray(f)?f:void 0,N=(m=m||(k?void 0:f))?m.allKeys:void 0;return this._trans("readwrite",function(M){var O=w.schema.primKey,ce=O.auto,O=O.keyPath;if(O&&k)throw new Ne.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(k&&k.length!==a.length)throw new Ne.InvalidArgument("Arguments objects and keys must have the same length");var ee=a.length,ce=O&&ce?a.map(In(O)):a;return w.core.mutate({trans:M,type:"add",keys:k,values:ce,wantResults:N}).then(function(ne){var J=ne.numFailures,te=ne.failures;if(J===0)return N?ne.results:ne.lastResult;throw new Oe("".concat(w.name,".bulkAdd(): ").concat(J," of ").concat(ee," operations failed"),te)})})},vt.prototype.bulkPut=function(a,f,m){var w=this,k=Array.isArray(f)?f:void 0,N=(m=m||(k?void 0:f))?m.allKeys:void 0;return this._trans("readwrite",function(M){var O=w.schema.primKey,ce=O.auto,O=O.keyPath;if(O&&k)throw new Ne.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(k&&k.length!==a.length)throw new Ne.InvalidArgument("Arguments objects and keys must have the same length");var ee=a.length,ce=O&&ce?a.map(In(O)):a;return w.core.mutate({trans:M,type:"put",keys:k,values:ce,wantResults:N}).then(function(ne){var J=ne.numFailures,te=ne.failures;if(J===0)return N?ne.results:ne.lastResult;throw new Oe("".concat(w.name,".bulkPut(): ").concat(J," of ").concat(ee," operations failed"),te)})})},vt.prototype.bulkUpdate=function(a){var f=this,m=this.core,w=a.map(function(M){return M.key}),k=a.map(function(M){return M.changes}),N=[];return this._trans("readwrite",function(M){return m.getMany({trans:M,keys:w,cache:"clone"}).then(function(O){var ee=[],ce=[],ne=(a.forEach(function(J,te){var le=J.key,ie=J.changes,oe=O[te];if(oe){for(var ae=0,ye=Object.keys(ie);ae<ye.length;ae++){var he=ye[ae],we=ie[he];if(he===f.schema.primKey.keyPath){if(ft(we,le)!==0)throw new Ne.Constraint("Cannot update primary key in bulkUpdate()")}else W(oe,he,we)}N.push(te),ee.push(le),ce.push(oe)}}),ee.length);return m.mutate({trans:M,type:"put",keys:ee,values:ce,updates:{keys:w,changeSpecs:k}}).then(function(J){var te=J.numFailures,le=J.failures;if(te===0)return ne;for(var ie=0,oe=Object.keys(le);ie<oe.length;ie++){var ae,ye=oe[ie],he=N[Number(ye)];he!=null&&(ae=le[ye],delete le[ye],le[he]=ae)}throw new Oe("".concat(f.name,".bulkUpdate(): ").concat(te," of ").concat(ne," operations failed"),le)})})})},vt.prototype.bulkDelete=function(a){var f=this,m=a.length;return this._trans("readwrite",function(w){return f.core.mutate({trans:w,type:"delete",keys:a}).then(function(k){return zo(f,a,k)})}).then(function(w){var k=w.numFailures,N=w.failures;if(k===0)return w.lastResult;throw new Oe("".concat(f.name,".bulkDelete(): ").concat(k," of ").concat(m," operations failed"),N)})};var tr=vt;function vt(){}function Ur(a){function f(M,O){if(O){for(var ee=arguments.length,ce=new Array(ee-1);--ee;)ce[ee-1]=arguments[ee];return m[M].subscribe.apply(null,ce),a}if(typeof M=="string")return m[M]}var m={};f.addEventType=N;for(var w=1,k=arguments.length;w<k;++w)N(arguments[w]);return f;function N(M,O,ee){var ce,ne;if(typeof M!="object")return O=O||Wt,ne={subscribers:[],fire:ee=ee||Fe,subscribe:function(J){ne.subscribers.indexOf(J)===-1&&(ne.subscribers.push(J),ne.fire=O(ne.fire,J))},unsubscribe:function(J){ne.subscribers=ne.subscribers.filter(function(te){return te!==J}),ne.fire=ne.subscribers.reduce(O,ee)}},m[M]=f[M]=ne;d(ce=M).forEach(function(J){var te=ce[J];if(h(te))N(J,ce[J][0],ce[J][1]);else{if(te!=="asap")throw new Ne.InvalidArgument("Invalid event config");var le=N(J,Ke,function(){for(var ie=arguments.length,oe=new Array(ie);ie--;)oe[ie]=arguments[ie];le.subscribers.forEach(function(ae){B(function(){ae.apply(null,oe)})})})}})}}function uo(a,f){return $(f).from({prototype:a}),f}function hr(a,f){return!(a.filter||a.algorithm||a.or)&&(f?a.justLimit:!a.replayFilter)}function Kr(a,f){a.filter=Ct(a.filter,f)}function co(a,f,m){var w=a.replayFilter;a.replayFilter=w?function(){return Ct(w(),f())}:f,a.justLimit=m&&!w}function mr(a,f){if(a.isPrimKey)return f.primaryKey;var m=f.getIndexByKeyPath(a.index);if(m)return m;throw new Ne.Schema("KeyPath "+a.index+" on object store "+f.name+" is not indexed")}function hi(a,f,m){var w=mr(a,f.schema);return f.openCursor({trans:m,values:!a.keysOnly,reverse:a.dir==="prev",unique:!!a.unique,query:{index:w,range:a.range}})}function Fo(a,f,m,w){var k,N,M=a.replayFilter?Ct(a.filter,a.replayFilter()):a.filter;return a.or?(k={},N=function(O,ee,ce){var ne,J;M&&!M(ee,ce,function(te){return ee.stop(te)},function(te){return ee.fail(te)})||((J=""+(ne=ee.primaryKey))=="[object ArrayBuffer]"&&(J=""+new Uint8Array(ne)),x(k,J))||(k[J]=!0,f(O,ee,ce))},Promise.all([a.or._iterate(N,m),wt(hi(a,w,m),a.algorithm,N,!a.keysOnly&&a.valueMapper)])):wt(hi(a,w,m),Ct(a.algorithm,M),f,!a.keysOnly&&a.valueMapper)}function wt(a,f,m,w){var k=mt(w?function(N,M,O){return m(w(N),M,O)}:m);return a.then(function(N){if(N)return N.start(function(){var M=function(){return N.continue()};f&&!f(N,function(O){return M=O},function(O){N.stop(O),M=Fe},function(O){N.fail(O),M=Fe})||k(N.value,N,function(O){return M=O}),M()})})}ht.prototype._read=function(a,f){var m=this._ctx;return m.error?m.table._trans(null,_e.bind(null,m.error)):m.table._trans("readonly",a).then(f)},ht.prototype._write=function(a){var f=this._ctx;return f.error?f.table._trans(null,_e.bind(null,f.error)):f.table._trans("readwrite",a,"locked")},ht.prototype._addAlgorithm=function(a){var f=this._ctx;f.algorithm=Ct(f.algorithm,a)},ht.prototype._iterate=function(a,f){return Fo(this._ctx,a,f,this._ctx.table.core)},ht.prototype.clone=function(a){var f=Object.create(this.constructor.prototype),m=Object.create(this._ctx);return a&&v(m,a),f._ctx=m,f},ht.prototype.raw=function(){return this._ctx.valueMapper=null,this},ht.prototype.each=function(a){var f=this._ctx;return this._read(function(m){return Fo(f,a,m,f.table.core)})},ht.prototype.count=function(a){var f=this;return this._read(function(m){var w,k=f._ctx,N=k.table.core;return hr(k,!0)?N.count({trans:m,query:{index:mr(k,N.schema),range:k.range}}).then(function(M){return Math.min(M,k.limit)}):(w=0,Fo(k,function(){return++w,!1},m,N).then(function(){return w}))}).then(a)},ht.prototype.sortBy=function(a,f){var m=a.split(".").reverse(),w=m[0],k=m.length-1;function N(ee,ce){return ce?N(ee[m[ce]],ce-1):ee[w]}var M=this._ctx.dir==="next"?1:-1;function O(ee,ce){return ft(N(ee,k),N(ce,k))*M}return this.toArray(function(ee){return ee.sort(O)}).then(f)},ht.prototype.toArray=function(a){var f=this;return this._read(function(m){var w,k,N,M=f._ctx;return hr(M,!0)&&0<M.limit?(w=M.valueMapper,k=mr(M,M.table.core.schema),M.table.core.query({trans:m,limit:M.limit,values:!0,direction:M.dir==="prev"?"prev":void 0,query:{index:k,range:M.range}}).then(function(O){return O=O.result,w?O.map(w):O})):(N=[],Fo(M,function(O){return N.push(O)},m,M.table.core).then(function(){return N}))},a)},ht.prototype.offset=function(a){var f=this._ctx;return a<=0||(f.offset+=a,hr(f)?co(f,function(){var m=a;return function(w,k){return m===0||(m===1?--m:k(function(){w.advance(m),m=0}),!1)}}):co(f,function(){var m=a;return function(){return--m<0}})),this},ht.prototype.limit=function(a){return this._ctx.limit=Math.min(this._ctx.limit,a),co(this._ctx,function(){var f=a;return function(m,w,k){return--f<=0&&w(k),0<=f}},!0),this},ht.prototype.until=function(a,f){return Kr(this._ctx,function(m,w,k){return!a(m.value)||(w(k),f)}),this},ht.prototype.first=function(a){return this.limit(1).toArray(function(f){return f[0]}).then(a)},ht.prototype.last=function(a){return this.reverse().first(a)},ht.prototype.filter=function(a){var f;return Kr(this._ctx,function(m){return a(m.value)}),(f=this._ctx).isMatch=Ct(f.isMatch,a),this},ht.prototype.and=function(a){return this.filter(a)},ht.prototype.or=function(a){return new this.db.WhereClause(this._ctx.table,a,this)},ht.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},ht.prototype.desc=function(){return this.reverse()},ht.prototype.eachKey=function(a){var f=this._ctx;return f.keysOnly=!f.isMatch,this.each(function(m,w){a(w.key,w)})},ht.prototype.eachUniqueKey=function(a){return this._ctx.unique="unique",this.eachKey(a)},ht.prototype.eachPrimaryKey=function(a){var f=this._ctx;return f.keysOnly=!f.isMatch,this.each(function(m,w){a(w.primaryKey,w)})},ht.prototype.keys=function(a){var f=this._ctx,m=(f.keysOnly=!f.isMatch,[]);return this.each(function(w,k){m.push(k.key)}).then(function(){return m}).then(a)},ht.prototype.primaryKeys=function(a){var f=this._ctx;if(hr(f,!0)&&0<f.limit)return this._read(function(w){var k=mr(f,f.table.core.schema);return f.table.core.query({trans:w,values:!1,limit:f.limit,direction:f.dir==="prev"?"prev":void 0,query:{index:k,range:f.range}})}).then(function(w){return w.result}).then(a);f.keysOnly=!f.isMatch;var m=[];return this.each(function(w,k){m.push(k.primaryKey)}).then(function(){return m}).then(a)},ht.prototype.uniqueKeys=function(a){return this._ctx.unique="unique",this.keys(a)},ht.prototype.firstKey=function(a){return this.limit(1).keys(function(f){return f[0]}).then(a)},ht.prototype.lastKey=function(a){return this.reverse().firstKey(a)},ht.prototype.distinct=function(){var a,f=this._ctx,f=f.index&&f.table.schema.idxByName[f.index];return f&&f.multi&&(a={},Kr(this._ctx,function(w){var w=w.primaryKey.toString(),k=x(a,w);return a[w]=!0,!k})),this},ht.prototype.modify=function(a){var f=this,m=this._ctx;return this._write(function(w){function k(oe,ae){var ye=ae.failures;te+=oe-ae.numFailures;for(var he=0,we=d(ye);he<we.length;he++){var Ee=we[he];J.push(ye[Ee])}}var N=typeof a=="function"?a:function(oe){return lo(oe,a)},M=m.table.core,ne=M.schema.primaryKey,O=ne.outbound,ee=ne.extractKey,ce=200,ne=f.db._options.modifyChunkSize,J=(ne&&(ce=typeof ne=="object"?ne[M.name]||ne["*"]||200:ne),[]),te=0,le=[],ie=a===Ui;return f.clone().primaryKeys().then(function(oe){function ae(he){var we=Math.min(ce,oe.length-he),Ee=oe.slice(he,he+we);return(ie?Promise.resolve([]):M.getMany({trans:w,keys:Ee,cache:"immutable"})).then(function(je){var Le=[],Te=[],Ve=O?[]:null,Re=ie?Ee:[];if(!ie)for(var Ye=0;Ye<we;++Ye){var Ce=je[Ye],it={value:ve(Ce),primKey:oe[he+Ye]};N.call(it,it.value,it)!==!1&&(it.value==null?Re.push(oe[he+Ye]):O||ft(ee(Ce),ee(it.value))===0?(Te.push(it.value),O&&Ve.push(oe[he+Ye])):(Re.push(oe[he+Ye]),Le.push(it.value)))}return Promise.resolve(0<Le.length&&M.mutate({trans:w,type:"add",values:Le}).then(function(st){for(var ct in st.failures)Re.splice(parseInt(ct),1);k(Le.length,st)})).then(function(){return(0<Te.length||ye&&typeof a=="object")&&M.mutate({trans:w,type:"put",keys:Ve,values:Te,criteria:ye,changeSpec:typeof a!="function"&&a,isAdditionalChunk:0<he}).then(function(st){return k(Te.length,st)})}).then(function(){return(0<Re.length||ye&&ie)&&M.mutate({trans:w,type:"delete",keys:Re,criteria:ye,isAdditionalChunk:0<he}).then(function(st){return zo(m.table,Re,st)}).then(function(st){return k(Re.length,st)})}).then(function(){return oe.length>he+we&&ae(he+ce)})})}var ye=hr(m)&&m.limit===1/0&&(typeof a!="function"||ie)&&{index:m.index,range:m.range};return ae(0).then(function(){if(0<J.length)throw new Ae("Error modifying one or more objects",J,te,le);return oe.length})})})},ht.prototype.delete=function(){var a=this._ctx,f=a.range;return!hr(a)||a.table.schema.yProps||!a.isPrimKey&&f.type!==3?this.modify(Ui):this._write(function(m){var w=a.table.core.schema.primaryKey,k=f;return a.table.core.count({trans:m,query:{index:w,range:k}}).then(function(N){return a.table.core.mutate({trans:m,type:"deleteRange",range:k}).then(function(ee){var O=ee.failures,ee=ee.numFailures;if(ee)throw new Ae("Could not delete some values",Object.keys(O).map(function(ce){return O[ce]}),N-ee);return N-ee})})})};var Ha=ht;function ht(){}var Ui=function(a,f){return f.value=null};function Va(a,f){return a<f?-1:a===f?0:1}function Ua(a,f){return f<a?-1:a===f?0:1}function Sn(a,f,m){return a=a instanceof Nr?new a.Collection(a):a,a._ctx.error=new(m||TypeError)(f),a}function qr(a){return new a.Collection(a,function(){return kr("")}).limit(0)}function fo(le,f,m,w){var k,N,M,O,ee,ce,ne,J=m.length;if(!m.every(function(oe){return typeof oe=="string"}))return Sn(le,on);function te(oe){k=oe==="next"?function(ye){return ye.toUpperCase()}:function(ye){return ye.toLowerCase()},N=oe==="next"?function(ye){return ye.toLowerCase()}:function(ye){return ye.toUpperCase()},M=oe==="next"?Va:Ua;var ae=m.map(function(ye){return{lower:N(ye),upper:k(ye)}}).sort(function(ye,he){return M(ye.lower,he.lower)});O=ae.map(function(ye){return ye.upper}),ee=ae.map(function(ye){return ye.lower}),ne=(ce=oe)==="next"?"":w}te("next");var le=new le.Collection(le,function(){return hn(O[0],ee[J-1]+w)}),ie=(le._ondirectionchange=function(oe){te(oe)},0);return le._addAlgorithm(function(oe,ae,ye){var he=oe.key;if(typeof he=="string"){var we=N(he);if(f(we,ee,ie))return!0;for(var Ee=null,je=ie;je<J;++je){var Le=((Te,Ve,Re,Ye,Ce,it)=>{for(var st=Math.min(Te.length,Ye.length),ct=-1,dt=0;dt<st;++dt){var kn=Ve[dt];if(kn!==Ye[dt])return Ce(Te[dt],Re[dt])<0?Te.substr(0,dt)+Re[dt]+Re.substr(dt+1):Ce(Te[dt],Ye[dt])<0?Te.substr(0,dt)+Ye[dt]+Re.substr(dt+1):0<=ct?Te.substr(0,ct)+Ve[ct]+Re.substr(ct+1):null;Ce(Te[dt],kn)<0&&(ct=dt)}return st<Ye.length&&it==="next"?Te+Re.substr(Te.length):st<Te.length&&it==="prev"?Te.substr(0,Re.length):ct<0?null:Te.substr(0,ct)+Ye[ct]+Re.substr(ct+1)})(he,we,O[je],ee[je],M,ce);Le===null&&Ee===null?ie=je+1:(Ee===null||0<M(Ee,Le))&&(Ee=Le)}ae(Ee!==null?function(){oe.continue(Ee+ne)}:ye)}return!1}),le}function hn(a,f,m,w){return{type:2,lower:a,upper:f,lowerOpen:m,upperOpen:w}}function kr(a){return{type:1,lower:a,upper:a}}Object.defineProperty(At.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),At.prototype.between=function(a,f,m,w){m=m!==!1,w=w===!0;try{return 0<this._cmp(a,f)||this._cmp(a,f)===0&&(m||w)&&(!m||!w)?qr(this):new this.Collection(this,function(){return hn(a,f,!m,!w)})}catch{return Sn(this,Xe)}},At.prototype.equals=function(a){return a==null?Sn(this,Xe):new this.Collection(this,function(){return kr(a)})},At.prototype.above=function(a){return a==null?Sn(this,Xe):new this.Collection(this,function(){return hn(a,void 0,!0)})},At.prototype.aboveOrEqual=function(a){return a==null?Sn(this,Xe):new this.Collection(this,function(){return hn(a,void 0,!1)})},At.prototype.below=function(a){return a==null?Sn(this,Xe):new this.Collection(this,function(){return hn(void 0,a,!1,!0)})},At.prototype.belowOrEqual=function(a){return a==null?Sn(this,Xe):new this.Collection(this,function(){return hn(void 0,a)})},At.prototype.startsWith=function(a){return typeof a!="string"?Sn(this,on):this.between(a,a+He,!0,!0)},At.prototype.startsWithIgnoreCase=function(a){return a===""?this.startsWith(a):fo(this,function(f,m){return f.indexOf(m[0])===0},[a],He)},At.prototype.equalsIgnoreCase=function(a){return fo(this,function(f,m){return f===m[0]},[a],"")},At.prototype.anyOfIgnoreCase=function(){var a=Z.apply(q,arguments);return a.length===0?qr(this):fo(this,function(f,m){return m.indexOf(f)!==-1},a,"")},At.prototype.startsWithAnyOfIgnoreCase=function(){var a=Z.apply(q,arguments);return a.length===0?qr(this):fo(this,function(f,m){return m.some(function(w){return f.indexOf(w)===0})},a,He)},At.prototype.anyOf=function(){var a,f,m=this,w=Z.apply(q,arguments),k=this._cmp;try{w.sort(k)}catch{return Sn(this,Xe)}return w.length===0?qr(this):((a=new this.Collection(this,function(){return hn(w[0],w[w.length-1])}))._ondirectionchange=function(N){k=N==="next"?m._ascending:m._descending,w.sort(k)},f=0,a._addAlgorithm(function(N,M,O){for(var ee=N.key;0<k(ee,w[f]);)if(++f===w.length)return M(O),!1;return k(ee,w[f])===0||(M(function(){N.continue(w[f])}),!1)}),a)},At.prototype.notEqual=function(a){return this.inAnyRange([[-1/0,a],[a,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},At.prototype.noneOf=function(){var a=Z.apply(q,arguments);if(a.length===0)return new this.Collection(this);try{a.sort(this._ascending)}catch{return Sn(this,Xe)}var f=a.reduce(function(m,w){return m?m.concat([[m[m.length-1][1],w]]):[[-1/0,w]]},null);return f.push([a[a.length-1],this.db._maxKey]),this.inAnyRange(f,{includeLowers:!1,includeUppers:!1})},At.prototype.inAnyRange=function(a,ye){var m=this,w=this._cmp,k=this._ascending,N=this._descending,M=this._min,O=this._max;if(a.length===0)return qr(this);if(!a.every(function(he){return he[0]!==void 0&&he[1]!==void 0&&k(he[0],he[1])<=0}))return Sn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Ne.InvalidArgument);var ee=!ye||ye.includeLowers!==!1,ce=ye&&ye.includeUppers===!0,ne,J=k;function te(he,we){return J(he[0],we[0])}try{(ne=a.reduce(function(he,we){for(var Ee=0,je=he.length;Ee<je;++Ee){var Le=he[Ee];if(w(we[0],Le[1])<0&&0<w(we[1],Le[0])){Le[0]=M(Le[0],we[0]),Le[1]=O(Le[1],we[1]);break}}return Ee===je&&he.push(we),he},[])).sort(te)}catch{return Sn(this,Xe)}var le=0,ie=ce?function(he){return 0<k(he,ne[le][1])}:function(he){return 0<=k(he,ne[le][1])},oe=ee?function(he){return 0<N(he,ne[le][0])}:function(he){return 0<=N(he,ne[le][0])},ae=ie,ye=new this.Collection(this,function(){return hn(ne[0][0],ne[ne.length-1][1],!ee,!ce)});return ye._ondirectionchange=function(he){J=he==="next"?(ae=ie,k):(ae=oe,N),ne.sort(te)},ye._addAlgorithm(function(he,we,Ee){for(var je,Le=he.key;ae(Le);)if(++le===ne.length)return we(Ee),!1;return!ie(je=Le)&&!oe(je)||(m._cmp(Le,ne[le][1])===0||m._cmp(Le,ne[le][0])===0||we(function(){J===k?he.continue(ne[le][0]):he.continue(ne[le][1])}),!1)}),ye},At.prototype.startsWithAnyOf=function(){var a=Z.apply(q,arguments);return a.every(function(f){return typeof f=="string"})?a.length===0?qr(this):this.inAnyRange(a.map(function(f){return[f,f+He]})):Sn(this,"startsWithAnyOf() only works with strings")};var Nr=At;function At(){}function mn(a){return mt(function(f){return Hn(f),a(f.target.error),!1})}function Hn(a){a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault()}var mi="storagemutated",Ki="x-storagemutated-1",Vn=Ur(null,mi),Ru=(nr.prototype._lock=function(){return R(!We.global),++this._reculock,this._reculock!==1||We.global||(We.lockOwnerFor=this),this},nr.prototype._unlock=function(){if(R(!We.global),--this._reculock==0)for(We.global||(We.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var a=this._blockedFuncs.shift();try{bn(a[1],a[0])}catch{}}return this},nr.prototype._locked=function(){return this._reculock&&We.lockOwnerFor!==this},nr.prototype.create=function(a){var f=this;if(this.mode){var m=this.db.idbdb,w=this.db._state.dbOpenError;if(R(!this.idbtrans),!a&&!m)switch(w&&w.name){case"DatabaseClosedError":throw new Ne.DatabaseClosed(w);case"MissingAPIError":throw new Ne.MissingAPI(w.message,w);default:throw new Ne.OpenFailed(w)}if(!this.active)throw new Ne.TransactionInactive;R(this._completion._state===null),(a=this.idbtrans=a||(this.db.core||m).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=mt(function(k){Hn(k),f._reject(a.error)}),a.onabort=mt(function(k){Hn(k),f.active&&f._reject(new Ne.Abort(a.error)),f.active=!1,f.on("abort").fire(k)}),a.oncomplete=mt(function(){f.active=!1,f._resolve(),"mutatedParts"in a&&Vn.storagemutated.fire(a.mutatedParts)})}return this},nr.prototype._promise=function(a,f,m){var w,k=this;return a==="readwrite"&&this.mode!=="readwrite"?_e(new Ne.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Be(function(N,M){k._blockedFuncs.push([function(){k._promise(a,f,m).then(N,M)},We])}):m?Tn(function(){var N=new Be(function(M,O){k._lock();var ee=f(M,O,k);ee&&ee.then&&ee.then(M,O)});return N.finally(function(){return k._unlock()}),N._lib=!0,N}):((w=new Be(function(N,M){var O=f(N,M,k);O&&O.then&&O.then(N,M)}))._lib=!0,w):_e(new Ne.TransactionInactive)},nr.prototype._root=function(){return this.parent?this.parent._root():this},nr.prototype.waitFor=function(a){var f,m=this._root(),w=Be.resolve(a),k=(m._waitingFor?m._waitingFor=m._waitingFor.then(function(){return w}):(m._waitingFor=w,m._waitingQueue=[],f=m.idbtrans.objectStore(m.storeNames[0]),(function N(){for(++m._spinCount;m._waitingQueue.length;)m._waitingQueue.shift()();m._waitingFor&&(f.get(-1/0).onsuccess=N)})()),m._waitingFor);return new Be(function(N,M){w.then(function(O){return m._waitingQueue.push(mt(N.bind(null,O)))},function(O){return m._waitingQueue.push(mt(M.bind(null,O)))}).finally(function(){m._waitingFor===k&&(m._waitingFor=null)})})},nr.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Ne.Abort))},nr.prototype.table=function(a){var f=this._memoizedTables||(this._memoizedTables={});if(x(f,a))return f[a];var m=this.schema[a];if(m)return(m=new this.db.Table(a,m,this)).core=this.db.core.table(a),f[a]=m;throw new Ne.NotFound("Table "+a+" not part of transaction")},nr);function nr(){}function Bo(a,f,m,w,k,N,M,O){return{name:a,keyPath:f,unique:m,multi:w,auto:k,compound:N,src:(m&&!M?"&":"")+(w?"*":"")+(k?"++":"")+Ls(f),type:O}}function Ls(a){return typeof a=="string"?a:a?"["+[].join.call(a,"+")+"]":""}function Ds(a,f,m){return{name:a,primKey:f,indexes:m,mappedClass:null,idxByName:(w=function(k){return[k.name,k]},m.reduce(function(k,N,M){return N=w(N,M),N&&(k[N[0]]=N[1]),k},{}))};var w}var Er=function(a){try{return a.only([[]]),Er=function(){return[[]]},[[]]}catch{return Er=function(){return He},He}};function po(a){return a==null?function(){}:typeof a=="string"?(f=a).split(".").length===1?function(m){return m[f]}:function(m){return V(m,f)}:function(m){return V(m,a)};var f}function ho(a){return[].slice.call(a)}var qi=0;function gi(a){return a==null?":id":typeof a=="string"?a:"[".concat(a.join("+"),"]")}function Lu(a,f,M){function w(ae){if(ae.type===3)return null;if(ae.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var le=ae.lower,ie=ae.upper,oe=ae.lowerOpen,ae=ae.upperOpen;return le===void 0?ie===void 0?null:f.upperBound(ie,!!ae):ie===void 0?f.lowerBound(le,!!oe):f.bound(le,ie,!!oe,!!ae)}function k(te){var le,ie,oe=te.name;return{name:oe,schema:te,mutate:function(ae){var ye=ae.trans,he=ae.type,we=ae.keys,Ee=ae.values,je=ae.range;return new Promise(function(Le,Te){Le=mt(Le);var Ve=ye.objectStore(oe),Re=Ve.keyPath==null,Ye=he==="put"||he==="add";if(!Ye&&he!=="delete"&&he!=="deleteRange")throw new Error("Invalid operation type: "+he);var Ce,it=(we||Ee||{length:1}).length;if(we&&Ee&&we.length!==Ee.length)throw new Error("Given keys array must have same length as given values array.");if(it===0)return Le({numFailures:0,failures:{},results:[],lastResult:void 0});function st(gn){++kn,Hn(gn)}var ct=[],dt=[],kn=0;if(he==="deleteRange"){if(je.type===4)return Le({numFailures:kn,failures:dt,results:[],lastResult:void 0});je.type===3?ct.push(Ce=Ve.clear()):ct.push(Ce=Ve.delete(w(je)))}else{var Re=Ye?Re?[Ee,we]:[Ee,null]:[we,null],ut=Re[0],jt=Re[1];if(Ye)for(var Gt=0;Gt<it;++Gt)ct.push(Ce=jt&&jt[Gt]!==void 0?Ve[he](ut[Gt],jt[Gt]):Ve[he](ut[Gt])),Ce.onerror=st;else for(Gt=0;Gt<it;++Gt)ct.push(Ce=Ve[he](ut[Gt])),Ce.onerror=st}function Qo(gn){gn=gn.target.result,ct.forEach(function(bo,_o){return bo.error!=null&&(dt[_o]=bo.error)}),Le({numFailures:kn,failures:dt,results:he==="delete"?we:ct.map(function(bo){return bo.result}),lastResult:gn})}Ce.onerror=function(gn){st(gn),Qo(gn)},Ce.onsuccess=Qo})},getMany:function(ae){var ye=ae.trans,he=ae.keys;return new Promise(function(we,Ee){we=mt(we);for(var je,Le=ye.objectStore(oe),Te=he.length,Ve=new Array(Te),Re=0,Ye=0,Ce=function(ct){ct=ct.target,Ve[ct._pos]=ct.result,++Ye===Re&&we(Ve)},it=mn(Ee),st=0;st<Te;++st)he[st]!=null&&((je=Le.get(he[st]))._pos=st,je.onsuccess=Ce,je.onerror=it,++Re);Re===0&&we(Ve)})},get:function(ae){var ye=ae.trans,he=ae.key;return new Promise(function(we,Ee){we=mt(we);var je=ye.objectStore(oe).get(he);je.onsuccess=function(Le){return we(Le.target.result)},je.onerror=mn(Ee)})},query:(le=ee,ie=ce,function(ae){return new Promise(function(ye,he){ye=mt(ye);var we,Ee,je,Le,it=ae.trans,Te=ae.values,Ve=ae.limit,Ce=ae.query,Re=(Re=ae.direction)!=null?Re:"next",Ye=Ve===1/0?void 0:Ve,st=Ce.index,Ce=Ce.range,it=it.objectStore(oe),it=st.isPrimaryKey?it:it.index(st.name),st=w(Ce);if(Ve===0)return ye({result:[]});ie?(Ce={query:st,count:Ye,direction:Re},(we=Te?it.getAll(Ce):it.getAllKeys(Ce)).onsuccess=function(ct){return ye({result:ct.target.result})},we.onerror=mn(he)):le&&Re==="next"?((we=Te?it.getAll(st,Ye):it.getAllKeys(st,Ye)).onsuccess=function(ct){return ye({result:ct.target.result})},we.onerror=mn(he)):(Ee=0,je=!Te&&"openKeyCursor"in it?it.openKeyCursor(st,Re):it.openCursor(st,Re),Le=[],je.onsuccess=function(){var ct=je.result;return!ct||(Le.push(Te?ct.value:ct.primaryKey),++Ee===Ve)?ye({result:Le}):void ct.continue()},je.onerror=mn(he))})}),openCursor:function(ae){var ye=ae.trans,he=ae.values,we=ae.query,Ee=ae.reverse,je=ae.unique;return new Promise(function(Le,Te){Le=mt(Le);var Ye=we.index,Ve=we.range,Re=ye.objectStore(oe),Re=Ye.isPrimaryKey?Re:Re.index(Ye.name),Ye=Ee?je?"prevunique":"prev":je?"nextunique":"next",Ce=!he&&"openKeyCursor"in Re?Re.openKeyCursor(w(Ve),Ye):Re.openCursor(w(Ve),Ye);Ce.onerror=mn(Te),Ce.onsuccess=mt(function(it){var st,ct,dt,kn,ut=Ce.result;ut?(ut.___id=++qi,ut.done=!1,st=ut.continue.bind(ut),ct=(ct=ut.continuePrimaryKey)&&ct.bind(ut),dt=ut.advance.bind(ut),kn=function(){throw new Error("Cursor not stopped")},ut.trans=ye,ut.stop=ut.continue=ut.continuePrimaryKey=ut.advance=function(){throw new Error("Cursor not started")},ut.fail=mt(Te),ut.next=function(){var jt=this,Gt=1;return this.start(function(){return Gt--?jt.continue():jt.stop()}).then(function(){return jt})},ut.start=function(jt){function Gt(){if(Ce.result)try{jt()}catch(gn){ut.fail(gn)}else ut.done=!0,ut.start=function(){throw new Error("Cursor behind last entry")},ut.stop()}var Qo=new Promise(function(gn,bo){gn=mt(gn),Ce.onerror=mn(bo),ut.fail=bo,ut.stop=function(_o){ut.stop=ut.continue=ut.continuePrimaryKey=ut.advance=kn,gn(_o)}});return Ce.onsuccess=mt(function(gn){Ce.onsuccess=Gt,Gt()}),ut.continue=st,ut.continuePrimaryKey=ct,ut.advance=dt,Gt(),Qo},Le(ut)):Le(null)},Te)})},count:function(ae){var ye=ae.query,he=ae.trans,we=ye.index,Ee=ye.range;return new Promise(function(je,Le){var Te=he.objectStore(oe),Te=we.isPrimaryKey?Te:Te.index(we.name),Ve=w(Ee),Ve=Ve?Te.count(Ve):Te.count();Ve.onsuccess=mt(function(Re){return je(Re.target.result)}),Ve.onerror=mn(Le)})}}}N=M,O=ho((M=a).objectStoreNames),ne=0<O.length?N.objectStore(O[0]):{};var N,M={schema:{name:M.name,tables:O.map(function(te){return N.objectStore(te)}).map(function(te){var le=te.keyPath,ie=te.autoIncrement,ae=h(le),oe={},ae={name:te.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:le==null,compound:ae,keyPath:le,autoIncrement:ie,unique:!0,extractKey:po(le)},indexes:ho(te.indexNames).map(function(ye){return te.index(ye)}).map(function(Ee){var je=Ee.name,he=Ee.unique,we=Ee.multiEntry,Ee=Ee.keyPath,je={name:je,compound:h(Ee),keyPath:Ee,unique:he,multiEntry:we,extractKey:po(Ee)};return oe[gi(Ee)]=je}),getIndexByKeyPath:function(ye){return oe[gi(ye)]}};return oe[":id"]=ae.primaryKey,le!=null&&(oe[gi(le)]=ae.primaryKey),ae})},hasGetAll:0<O.length&&"getAll"in ne&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in ne},O=M.schema,ee=M.hasGetAll,ce=M.hasIdb3Features,ne=O.tables.map(k),J={};return ne.forEach(function(te){return J[te.name]=te}),{stack:"dbcore",transaction:a.transaction.bind(a),table:function(te){if(J[te])return J[te];throw new Error("Table '".concat(te,"' not found"))},MIN_KEY:-1/0,MAX_KEY:Er(f),schema:O}}function zs(a,f,m,w){return m=m.IDBKeyRange,f=Lu(f,m,w),{dbcore:a.dbcore.reduce(function(k,N){return N=N.create,s(s({},k),N(k))},f)}}function mo(a,f){var m=f.db,m=zs(a._middlewares,m,a._deps,f);a.core=m.dbcore,a.tables.forEach(function(w){var k=w.name;a.core.schema.tables.some(function(N){return N.name===k})&&(w.core=a.core.table(k),a[k]instanceof a.Table)&&(a[k].core=w.core)})}function Ho(a,f,m,w){m.forEach(function(k){var N=w[k];f.forEach(function(M){var O=(function ee(ce,ne){return T(ce,ne)||(ce=b(ce))&&ee(ce,ne)})(M,k);(!O||"value"in O&&O.value===void 0)&&(M===a.Transaction.prototype||M instanceof a.Transaction?j(M,k,{get:function(){return this.table(k)},set:function(ee){C(this,k,{value:ee,writable:!0,configurable:!0,enumerable:!0})}}):M[k]=new a.Table(k,N))})})}function Wi(a,f){f.forEach(function(m){for(var w in m)m[w]instanceof a.Table&&delete m[w]})}function Wr(a,f){return a._cfg.version-f._cfg.version}function Fs(a,f,m,w){var k=a._dbSchema,N=(m.objectStoreNames.contains("$meta")&&!k.$meta&&(k.$meta=Ds("$meta",Qi("")[0],[]),a._storeNames.push("$meta")),a._createTransaction("readwrite",a._storeNames,k)),M=(N.create(m),N._completion.catch(w),N._reject.bind(N)),O=We.transless||We;Tn(function(){if(We.trans=N,We.transless=O,f!==0)return mo(a,m),ce=f,((ee=N).storeNames.includes("$meta")?ee.table("$meta").get("version").then(function(ne){return ne??ce}):Be.resolve(ce)).then(function(ae){var J=a,te=ae,le=N,ie=m,oe=[],ae=J._versions,ye=J._dbSchema=an(0,J.idbdb,ie);return(ae=ae.filter(function(he){return he._cfg.version>=te})).length===0?Be.resolve():(ae.forEach(function(he){oe.push(function(){var we,Ee,je,Le=ye,Te=he._cfg.dbschema,Ve=(Cr(J,Le,ie),Cr(J,Te,ie),ye=J._dbSchema=Te,Xi(Le,Te)),Re=(Ve.add.forEach(function(Ye){Vo(ie,Ye[0],Ye[1].primKey,Ye[1].indexes)}),Ve.change.forEach(function(Ye){if(Ye.recreate)throw new Ne.Upgrade("Not yet support for changing primary key");var Ce=ie.objectStore(Ye.name);Ye.add.forEach(function(it){return vi(Ce,it)}),Ye.change.forEach(function(it){Ce.deleteIndex(it.name),vi(Ce,it)}),Ye.del.forEach(function(it){return Ce.deleteIndex(it)})}),he._cfg.contentUpgrade);if(Re&&he._cfg.version>te)return mo(J,ie),le._memoizedTables={},we=Q(Te),Ve.del.forEach(function(Ye){we[Ye]=Le[Ye]}),Wi(J,[J.Transaction.prototype]),Ho(J,[J.Transaction.prototype],d(we),we),le.schema=we,(Ee=A(Re))&&dr(),Te=Be.follow(function(){var Ye;(je=Re(le))&&Ee&&(Ye=Ft.bind(null,null),je.then(Ye,Ye))}),je&&typeof je.then=="function"?Be.resolve(je):Te.then(function(){return je})}),oe.push(function(we){var Ee,je,Le=he._cfg.dbschema;Ee=Le,je=we,[].slice.call(je.db.objectStoreNames).forEach(function(Te){return Ee[Te]==null&&je.db.deleteObjectStore(Te)}),Wi(J,[J.Transaction.prototype]),Ho(J,[J.Transaction.prototype],J._storeNames,J._dbSchema),le.schema=J._dbSchema}),oe.push(function(we){J.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(J.idbdb.version/10)===he._cfg.version?(J.idbdb.deleteObjectStore("$meta"),delete J._dbSchema.$meta,J._storeNames=J._storeNames.filter(function(Ee){return Ee!=="$meta"})):we.objectStore("$meta").put(he._cfg.version,"version"))})}),(function he(){return oe.length?Be.resolve(oe.shift()(le.idbtrans)).then(he):Be.resolve()})().then(function(){yi(ye,ie)}))}).catch(M);var ee,ce;d(k).forEach(function(ne){Vo(m,ne,k[ne].primKey,k[ne].indexes)}),mo(a,m),Be.follow(function(){return a.on.populate.fire(N)}).catch(M)})}function Yi(a,f){yi(a._dbSchema,f),f.db.version%10!=0||f.objectStoreNames.contains("$meta")||f.db.createObjectStore("$meta").add(Math.ceil(f.db.version/10-1),"version");var m=an(0,a.idbdb,f);Cr(a,a._dbSchema,f);for(var w=0,k=Xi(m,a._dbSchema).change;w<k.length;w++){var N=(M=>{if(M.change.length||M.recreate)return console.warn("Unable to patch indexes of table ".concat(M.name," because it has changes on the type of index or primary key.")),{value:void 0};var O=f.objectStore(M.name);M.add.forEach(function(ee){kt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(M.name,".").concat(ee.src)),vi(O,ee)})})(k[w]);if(typeof N=="object")return N.value}}function Xi(a,f){var m,w={del:[],add:[],change:[]};for(m in a)f[m]||w.del.push(m);for(m in f){var k=a[m],N=f[m];if(k){var M={name:m,def:N,recreate:!1,del:[],add:[],change:[]};if(""+(k.primKey.keyPath||"")!=""+(N.primKey.keyPath||"")||k.primKey.auto!==N.primKey.auto)M.recreate=!0,w.change.push(M);else{var O=k.idxByName,ee=N.idxByName,ce=void 0;for(ce in O)ee[ce]||M.del.push(ce);for(ce in ee){var ne=O[ce],J=ee[ce];ne?ne.src!==J.src&&M.change.push(J):M.add.push(J)}(0<M.del.length||0<M.add.length||0<M.change.length)&&w.change.push(M)}}else w.add.push([m,N])}return w}function Vo(a,f,m,w){var k=a.db.createObjectStore(f,m.keyPath?{keyPath:m.keyPath,autoIncrement:m.auto}:{autoIncrement:m.auto});w.forEach(function(N){return vi(k,N)})}function yi(a,f){d(a).forEach(function(m){f.db.objectStoreNames.contains(m)||(kt&&console.debug("Dexie: Creating missing table",m),Vo(f,m,a[m].primKey,a[m].indexes))})}function vi(a,f){a.createIndex(f.name,f.keyPath,{unique:f.unique,multiEntry:f.multi})}function an(a,f,m){var w={};return H(f.objectStoreNames,0).forEach(function(k){for(var N=m.objectStore(k),M=Bo(Ls(ce=N.keyPath),ce||"",!0,!1,!!N.autoIncrement,ce&&typeof ce!="string",!0),O=[],ee=0;ee<N.indexNames.length;++ee){var ne=N.index(N.indexNames[ee]),ce=ne.keyPath,ne=Bo(ne.name,ce,!!ne.unique,!!ne.multiEntry,!1,ce&&typeof ce!="string",!1);O.push(ne)}w[k]=Ds(k,M,O)}),w}function Cr(a,f,m){for(var w=m.db.objectStoreNames,k=0;k<w.length;++k){var N=w[k],M=m.objectStore(N);a._hasGetAll="getAll"in M;for(var O=0;O<M.indexNames.length;++O){var ee,ce=M.indexNames[O],ne=M.index(ce).keyPath,ne=typeof ne=="string"?ne:"["+H(ne).join("+")+"]";f[N]&&(ee=f[N].idxByName[ne])&&(ee.name=ce,delete f[N].idxByName[ne],f[N].idxByName[ce]=ee)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&c.WorkerGlobalScope&&c instanceof c.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(a._hasGetAll=!1)}function Qi(a){return a.split(",").map(function(f,m){var k=f.split(":"),w=(w=k[1])==null?void 0:w.trim(),k=(f=k[0].trim()).replace(/([&*]|\+\+)/g,""),N=/^\[/.test(k)?k.match(/^\[(.*)\]$/)[1].split("+"):k;return Bo(k,N||null,/\&/.test(f),/\*/.test(f),/\+\+/.test(f),h(N),m===0,w)})}Uo.prototype._createTableSchema=Ds,Uo.prototype._parseIndexSyntax=Qi,Uo.prototype._parseStoresSpec=function(a,f){var m=this;d(a).forEach(function(w){if(a[w]!==null){var k=m._parseIndexSyntax(a[w]),N=k.shift();if(!N)throw new Ne.Schema("Invalid schema for table "+w+": "+a[w]);if(N.unique=!0,N.multi)throw new Ne.Schema("Primary key cannot be multiEntry*");k.forEach(function(M){if(M.auto)throw new Ne.Schema("Only primary key can be marked as autoIncrement (++)");if(!M.keyPath)throw new Ne.Schema("Index must have a name and cannot be an empty string")}),N=m._createTableSchema(w,N,k),f[w]=N}})},Uo.prototype.stores=function(m){var f=this.db,m=(this._cfg.storesSource=this._cfg.storesSource?v(this._cfg.storesSource,m):m,f._versions),w={},k={};return m.forEach(function(N){v(w,N._cfg.storesSource),k=N._cfg.dbschema={},N._parseStoresSpec(w,k)}),f._dbSchema=k,Wi(f,[f._allTables,f,f.Transaction.prototype]),Ho(f,[f._allTables,f,f.Transaction.prototype,this._cfg.tables],d(k),k),f._storeNames=d(k),this},Uo.prototype.upgrade=function(a){return this._cfg.contentUpgrade=Yt(this._cfg.contentUpgrade||Fe,a),this};var xi=Uo;function Uo(){}var go=(()=>{var a,f,m;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(a=new Set,f=new FinalizationRegistry(function(w){a.delete(w)}),{toArray:function(){return Array.from(a).map(function(w){return w.deref()}).filter(function(w){return w!==void 0})},add:function(w){var k=new WeakRef(w._novip);a.add(k),f.register(w._novip,k,k),a.size>w._options.maxConnections&&(k=a.values().next().value,a.delete(k),f.unregister(k))},remove:function(w){if(w)for(var k=a.values(),N=k.next();!N.done;){var M=N.value;if(M.deref()===w._novip)return a.delete(M),void f.unregister(M);N=k.next()}}}):(m=[],{toArray:function(){return m},add:function(w){m.push(w._novip)},remove:function(w){w&&(w=m.indexOf(w._novip))!==-1&&m.splice(w,1)}})})();function wi(a,f){var m=a._dbNamesDB;return m||(m=a._dbNamesDB=new Pr(Vt,{addons:[],indexedDB:a,IDBKeyRange:f})).version(1).stores({dbnames:"name"}),m.table("dbnames")}function yo(a){return a&&typeof a.databases=="function"}function Ko(a){return Tn(function(){return We.letThrough=!0,a()})}function Gi(a){return!("from"in a)}var ln=function(a,f){var m;if(!this)return m=new ln,a&&"d"in a&&v(m,a),m;v(this,arguments.length?{d:1,from:a,to:1<arguments.length?f:a}:{d:0})};function bi(a,f,m){var w=ft(f,m);if(!isNaN(w)){if(0<w)throw RangeError();if(Gi(a))return v(a,{from:f,to:m,d:1});var w=a.l,k=a.r;if(ft(m,a.from)<0)return w?bi(w,f,m):a.l={from:f,to:m,d:1,l:null,r:null},Ka(a);if(0<ft(f,a.to))return k?bi(k,f,m):a.r={from:f,to:m,d:1,l:null,r:null},Ka(a);ft(f,a.from)<0&&(a.from=f,a.l=null,a.d=k?k.d+1:1),0<ft(m,a.to)&&(a.to=m,a.r=null,a.d=a.l?a.l.d+1:1),f=!a.r,w&&!a.l&&_i(a,w),k&&f&&_i(a,k)}}function _i(a,f){Gi(f)||(function m(w,k){var N=k.from,M=k.l,O=k.r;bi(w,N,k.to),M&&m(w,M),O&&m(w,O)})(a,f)}function Ji(a,f){var m=Zi(f),w=m.next();if(!w.done)for(var k=w.value,N=Zi(a),M=N.next(k.from),O=M.value;!w.done&&!M.done;){if(ft(O.from,k.to)<=0&&0<=ft(O.to,k.from))return!0;ft(k.from,O.from)<0?k=(w=m.next(O.from)).value:O=(M=N.next(k.from)).value}return!1}function Zi(a){var f=Gi(a)?null:{s:0,n:a};return{next:function(m){for(var w=0<arguments.length;f;)switch(f.s){case 0:if(f.s=1,w)for(;f.n.l&&ft(m,f.n.from)<0;)f={up:f,n:f.n.l,s:1};else for(;f.n.l;)f={up:f,n:f.n.l,s:1};case 1:if(f.s=2,!w||ft(m,f.n.to)<=0)return{value:f.n,done:!1};case 2:if(f.n.r){f.s=3,f={up:f,n:f.n.r,s:0};continue}case 3:f=f.up}return{done:!0}}}}function Ka(a){var f,m,w,k=(((k=a.r)==null?void 0:k.d)||0)-(((k=a.l)==null?void 0:k.d)||0),k=1<k?"r":k<-1?"l":"";k&&(f=k=="r"?"l":"r",m=s({},a),w=a[k],a.from=w.from,a.to=w.to,a[k]=w[k],m[k]=w[f],(a[f]=m).d=qa(m)),a.d=qa(a)}function qa(m){var f=m.r,m=m.l;return(f?m?Math.max(f.d,m.d):f.d:m?m.d:0)+1}function es(a,f){return d(f).forEach(function(m){a[m]?_i(a[m],f[m]):a[m]=(function w(k){var N,M,O={};for(N in k)x(k,N)&&(M=k[N],O[N]=!M||typeof M!="object"||Y.has(M.constructor)?M:w(M));return O})(f[m])}),a}function Bs(a,f){return a.all||f.all||Object.keys(a).some(function(m){return f[m]&&Ji(f[m],a[m])})}_(ln.prototype,((St={add:function(a){return _i(this,a),this},addKey:function(a){return bi(this,a,a),this},addKeys:function(a){var f=this;return a.forEach(function(m){return bi(f,m,m)}),this},hasKey:function(a){var f=Zi(this).next(a).value;return f&&ft(f.from,a)<=0&&0<=ft(f.to,a)}})[G]=function(){return Zi(this)},St));var Yr={},Hs={},Vs=!1;function ts(a){es(Hs,a),Vs||(Vs=!0,setTimeout(function(){Vs=!1,Us(Hs,!(Hs={}))},0))}function Us(a,f){f===void 0&&(f=!1);var m=new Set;if(a.all)for(var w=0,k=Object.values(Yr);w<k.length;w++)ns(O=k[w],a,m,f);else for(var N in a){var M,O,N=/^idb\:\/\/(.*)\/(.*)\//.exec(N);N&&(M=N[1],N=N[2],O=Yr["idb://".concat(M,"/").concat(N)])&&ns(O,a,m,f)}m.forEach(function(ee){return ee()})}function ns(a,f,m,w){for(var k=[],N=0,M=Object.entries(a.queries.query);N<M.length;N++){for(var O=M[N],ee=O[0],ce=[],ne=0,J=O[1];ne<J.length;ne++){var te=J[ne];Bs(f,te.obsSet)?te.subscribers.forEach(function(ae){return m.add(ae)}):w&&ce.push(te)}w&&k.push([ee,ce])}if(w)for(var le=0,ie=k;le<ie.length;le++){var oe=ie[le],ee=oe[0],ce=oe[1];a.queries.query[ee]=ce}}function Du(a){var f=a._state,m=a._deps.indexedDB;if(f.isBeingOpened||a.idbdb)return f.dbReadyPromise.then(function(){return f.dbOpenError?_e(f.dbOpenError):a});f.isBeingOpened=!0,f.dbOpenError=null,f.openComplete=!1;var w=f.openCanceller,k=Math.round(10*a.verno),N=!1;function M(){if(f.openCanceller!==w)throw new Ne.DatabaseClosed("db.open() was cancelled")}function O(){return new Be(function(te,le){if(M(),!m)throw new Ne.MissingAPI;var ie=a.name,oe=f.autoSchema||!k?m.open(ie):m.open(ie,k);if(!oe)throw new Ne.MissingAPI;oe.onerror=mn(le),oe.onblocked=mt(a._fireOnBlocked),oe.onupgradeneeded=mt(function(ae){var ye;ne=oe.transaction,f.autoSchema&&!a._options.allowEmptyDB?(oe.onerror=Hn,ne.abort(),oe.result.close(),(ye=m.deleteDatabase(ie)).onsuccess=ye.onerror=mt(function(){le(new Ne.NoSuchDatabase("Database ".concat(ie," doesnt exist")))})):(ne.onerror=mn(le),ye=ae.oldVersion>Math.pow(2,62)?0:ae.oldVersion,J=ye<1,a.idbdb=oe.result,N&&Yi(a,ne),Fs(a,ye/10,ne,le))},le),oe.onsuccess=mt(function(){ne=null;var ae,ye,he,we,Ee,je,Le=a.idbdb=oe.result,Te=H(Le.objectStoreNames);if(0<Te.length)try{var Ve=Le.transaction((Ee=Te).length===1?Ee[0]:Ee,"readonly");if(f.autoSchema)je=Le,we=Ve,(he=a).verno=je.version/10,we=he._dbSchema=an(0,je,we),he._storeNames=H(je.objectStoreNames,0),Ho(he,[he._allTables],d(we),we);else if(Cr(a,a._dbSchema,Ve),ye=Ve,((ye=Xi(an(0,(ae=a).idbdb,ye),ae._dbSchema)).add.length||ye.change.some(function(Re){return Re.add.length||Re.change.length}))&&!N)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."),Le.close(),k=Le.version+1,N=!0,te(O());mo(a,Ve)}catch{}go.add(a),Le.onversionchange=mt(function(Re){f.vcFired=!0,a.on("versionchange").fire(Re)}),Le.onclose=mt(function(){a.close({disableAutoOpen:!1})}),J&&(Te=a._deps,Ee=ie,yo(je=Te.indexedDB)||Ee===Vt||wi(je,Te.IDBKeyRange).put({name:Ee}).catch(Fe)),te()},le)}).catch(function(te){switch(te==null?void 0:te.name){case"UnknownError":if(0<f.PR1398_maxLoop)return f.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),O();break;case"VersionError":if(0<k)return k=0,O()}return Be.reject(te)})}var ee,ce=f.dbReadyResolve,ne=null,J=!1;return Be.race([w,(typeof navigator>"u"?Be.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(te){function le(){return indexedDB.databases().finally(te)}ee=setInterval(le,100),le()}).finally(function(){return clearInterval(ee)}):Promise.resolve()).then(O)]).then(function(){return M(),f.onReadyBeingFired=[],Be.resolve(Ko(function(){return a.on.ready.fire(a.vip)})).then(function te(){var le;if(0<f.onReadyBeingFired.length)return le=f.onReadyBeingFired.reduce(Yt,Fe),f.onReadyBeingFired=[],Be.resolve(Ko(function(){return le(a.vip)})).then(te)})}).finally(function(){f.openCanceller===w&&(f.onReadyBeingFired=null,f.isBeingOpened=!1)}).catch(function(te){f.dbOpenError=te;try{ne&&ne.abort()}catch{}return w===f.openCanceller&&a._close(),_e(te)}).finally(function(){f.openComplete=!0,ce()}).then(function(){var te;return J&&(te={},a.tables.forEach(function(le){le.schema.indexes.forEach(function(ie){ie.name&&(te["idb://".concat(a.name,"/").concat(le.name,"/").concat(ie.name)]=new ln(-1/0,[[[]]]))}),te["idb://".concat(a.name,"/").concat(le.name,"/")]=te["idb://".concat(a.name,"/").concat(le.name,"/:dels")]=new ln(-1/0,[[[]]])}),Vn(mi).fire(te),Us(te,!0)),a})}function Ks(a){function f(N){return a.next(N)}var m=k(f),w=k(function(N){return a.throw(N)});function k(N){return function(O){var O=N(O),ee=O.value;return O.done?ee:ee&&typeof ee.then=="function"?ee.then(m,w):h(ee)?Promise.all(ee).then(m,w):m(ee)}}return k(f)()}function rs(a,f,m){for(var w=h(a)?a.slice():[a],k=0;k<m;++k)w.push(f);return w}var Wa={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(a){return s(s({},a),{table:function(w){var m=a.table(w),w=m.schema,k={},N=[];function M(te,le,ie){var he=gi(te),oe=k[he]=k[he]||[],ae=te==null?0:typeof te=="string"?1:te.length,ye=0<le,he=s(s({},ie),{name:ye?"".concat(he,"(virtual-from:").concat(ie.name,")"):ie.name,lowLevelIndex:ie,isVirtual:ye,keyTail:le,keyLength:ae,extractKey:po(te),unique:!ye&&ie.unique});return oe.push(he),he.isPrimaryKey||N.push(he),1<ae&&M(ae===2?te[0]:te.slice(0,ae-1),le+1,ie),oe.sort(function(we,Ee){return we.keyTail-Ee.keyTail}),he}var O=M(w.primaryKey.keyPath,0,w.primaryKey);k[":id"]=[O];for(var ee=0,ce=w.indexes;ee<ce.length;ee++){var ne=ce[ee];M(ne.keyPath,0,ne)}function J(te){var le,ie=te.query.index;return ie.isVirtual?s(s({},te),{query:{index:ie.lowLevelIndex,range:(le=te.query.range,ie=ie.keyTail,{type:le.type===1?2:le.type,lower:rs(le.lower,le.lowerOpen?a.MAX_KEY:a.MIN_KEY,ie),lowerOpen:!0,upper:rs(le.upper,le.upperOpen?a.MIN_KEY:a.MAX_KEY,ie),upperOpen:!0})}}):te}return s(s({},m),{schema:s(s({},w),{primaryKey:O,indexes:N,getIndexByKeyPath:function(te){return(te=k[gi(te)])&&te[0]}}),count:function(te){return m.count(J(te))},query:function(te){return m.query(J(te))},openCursor:function(te){var le=te.query.index,ie=le.keyTail,oe=le.keyLength;return le.isVirtual?m.openCursor(J(te)).then(function(ye){return ye&&ae(ye)}):m.openCursor(te);function ae(ye){return Object.create(ye,{continue:{value:function(he){he!=null?ye.continue(rs(he,te.reverse?a.MAX_KEY:a.MIN_KEY,ie)):te.unique?ye.continue(ye.key.slice(0,oe).concat(te.reverse?a.MIN_KEY:a.MAX_KEY,ie)):ye.continue()}},continuePrimaryKey:{value:function(he,we){ye.continuePrimaryKey(rs(he,a.MAX_KEY,ie),we)}},primaryKey:{get:function(){return ye.primaryKey}},key:{get:function(){var he=ye.key;return oe===1?he[0]:he.slice(0,oe)}},value:{get:function(){return ye.value}}})}}})}})}};function qs(a,f,m,w){return m=m||{},w=w||"",d(a).forEach(function(k){var N,M,O;x(f,k)?(N=a[k],M=f[k],typeof N=="object"&&typeof M=="object"&&N&&M?(O=ue(N))!==ue(M)?m[w+k]=f[k]:O==="Object"?qs(N,M,m,w+k+"."):N!==M&&(m[w+k]=f[k]):N!==M&&(m[w+k]=f[k])):m[w+k]=void 0}),d(f).forEach(function(k){x(a,k)||(m[w+k]=f[k])}),m}function Ws(a,f){return f.type==="delete"?f.keys:f.keys||f.values.map(a.extractKey)}var zu={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(a){return s(s({},a),{table:function(f){var m=a.table(f),w=m.schema.primaryKey;return s(s({},m),{mutate:function(k){var N=We.trans,M=N.table(f).hook,O=M.deleting,ee=M.creating,ce=M.updating;switch(k.type){case"add":if(ee.fire===Fe)break;return N._promise("readwrite",function(){return ne(k)},!0);case"put":if(ee.fire===Fe&&ce.fire===Fe)break;return N._promise("readwrite",function(){return ne(k)},!0);case"delete":if(O.fire===Fe)break;return N._promise("readwrite",function(){return ne(k)},!0);case"deleteRange":if(O.fire===Fe)break;return N._promise("readwrite",function(){return(function J(te,le,ie){return m.query({trans:te,values:!1,query:{index:w,range:le},limit:ie}).then(function(oe){var ae=oe.result;return ne({type:"delete",keys:ae,trans:te}).then(function(ye){return 0<ye.numFailures?Promise.reject(ye.failures[0]):ae.length<ie?{failures:[],numFailures:0,lastResult:void 0}:J(te,s(s({},le),{lower:ae[ae.length-1],lowerOpen:!0}),ie)})})})(k.trans,k.range,1e4)},!0)}return m.mutate(k);function ne(J){var te,le,ie,oe=We.trans,ae=J.keys||Ws(w,J);if(ae)return(J=J.type==="add"||J.type==="put"?s(s({},J),{keys:ae}):s({},J)).type!=="delete"&&(J.values=l([],J.values)),J.keys&&(J.keys=l([],J.keys)),te=m,ie=ae,((le=J).type==="add"?Promise.resolve([]):te.getMany({trans:le.trans,keys:ie,cache:"immutable"})).then(function(ye){var he=ae.map(function(we,Ee){var je,Le,Te,Ve=ye[Ee],Re={onerror:null,onsuccess:null};return J.type==="delete"?O.fire.call(Re,we,Ve,oe):J.type==="add"||Ve===void 0?(je=ee.fire.call(Re,we,J.values[Ee],oe),we==null&&je!=null&&(J.keys[Ee]=we=je,w.outbound||W(J.values[Ee],w.keyPath,we))):(je=qs(Ve,J.values[Ee]),(Le=ce.fire.call(Re,je,we,Ve,oe))&&(Te=J.values[Ee],Object.keys(Le).forEach(function(Ye){x(Te,Ye)?Te[Ye]=Le[Ye]:W(Te,Ye,Le[Ye])}))),Re});return m.mutate(J).then(function(we){for(var Ee=we.failures,je=we.results,Le=we.numFailures,we=we.lastResult,Te=0;Te<ae.length;++Te){var Ve=(je||ae)[Te],Re=he[Te];Ve==null?Re.onerror&&Re.onerror(Ee[Te]):Re.onsuccess&&Re.onsuccess(J.type==="put"&&ye[Te]?J.values[Te]:Ve)}return{failures:Ee,results:je,numFailures:Le,lastResult:we}}).catch(function(we){return he.forEach(function(Ee){return Ee.onerror&&Ee.onerror(we)}),Promise.reject(we)})});throw new Error("Keys missing")}}})}})}};function Ya(a,f,m){try{if(!f||f.keys.length<a.length)return null;for(var w=[],k=0,N=0;k<f.keys.length&&N<a.length;++k)ft(f.keys[k],a[N])===0&&(w.push(m?ve(f.values[k]):f.values[k]),++N);return w.length===a.length?w:null}catch{return null}}var Fu={stack:"dbcore",level:-1,create:function(a){return{table:function(f){var m=a.table(f);return s(s({},m),{getMany:function(w){var k;return w.cache?(k=Ya(w.keys,w.trans._cache,w.cache==="clone"))?Be.resolve(k):m.getMany(w).then(function(N){return w.trans._cache={keys:w.keys,values:w.cache==="clone"?ve(N):N},N}):m.getMany(w)},mutate:function(w){return w.type!=="add"&&(w.trans._cache=null),m.mutate(w)}})}}}};function Xa(a,f){return a.trans.mode==="readonly"&&!!a.subscr&&!a.trans.explicit&&a.trans.db._options.cache!=="disabled"&&!f.schema.primaryKey.outbound}function Qa(a,f){switch(a){case"query":return f.values&&!f.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Ys={stack:"dbcore",level:0,name:"Observability",create:function(a){var f=a.schema.name,m=new ln(a.MIN_KEY,a.MAX_KEY);return s(s({},a),{transaction:function(w,k,N){if(We.subscr&&k!=="readonly")throw new Ne.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(We.querier));return a.transaction(w,k,N)},table:function(w){function k(ae){var oe,ae=ae.query;return[oe=ae.index,new ln((oe=(ae=ae.range).lower)!=null?oe:a.MIN_KEY,(oe=ae.upper)!=null?oe:a.MAX_KEY)]}var N=a.table(w),M=N.schema,O=M.primaryKey,ee=M.indexes,ce=O.extractKey,ne=O.outbound,J=O.autoIncrement&&ee.filter(function(ie){return ie.compound&&ie.keyPath.includes(O.keyPath)}),te=s(s({},N),{mutate:function(ie){function oe(Ce){return Ce="idb://".concat(f,"/").concat(w,"/").concat(Ce),Ee[Ce]||(Ee[Ce]=new ln)}var ae,ye,he,we=ie.trans,Ee=ie.mutatedParts||(ie.mutatedParts={}),je=oe(""),Le=oe(":dels"),Te=ie.type,Re=ie.type==="deleteRange"?[ie.range]:ie.type==="delete"?[ie.keys]:ie.values.length<50?[Ws(O,ie).filter(function(Ce){return Ce}),ie.values]:[],Ve=Re[0],Re=Re[1],Ye=ie.trans._cache;return h(Ve)?(je.addKeys(Ve),(Te=Te==="delete"||Ve.length===Re.length?Ya(Ve,Ye):null)||Le.addKeys(Ve),(Te||Re)&&(ae=oe,ye=Te,he=Re,M.indexes.forEach(function(Ce){var it=ae(Ce.name||"");function st(dt){return dt!=null?Ce.extractKey(dt):null}function ct(dt){Ce.multiEntry&&h(dt)?dt.forEach(function(kn){return it.addKey(kn)}):it.addKey(dt)}(ye||he).forEach(function(dt,jt){var ut=ye&&st(ye[jt]),jt=he&&st(he[jt]);ft(ut,jt)!==0&&(ut!=null&&ct(ut),jt!=null)&&ct(jt)})}))):Ve?(Re={from:(Ye=Ve.lower)!=null?Ye:a.MIN_KEY,to:(Te=Ve.upper)!=null?Te:a.MAX_KEY},Le.add(Re),je.add(Re)):(je.add(m),Le.add(m),M.indexes.forEach(function(Ce){return oe(Ce.name).add(m)})),N.mutate(ie).then(function(Ce){return!Ve||ie.type!=="add"&&ie.type!=="put"||(je.addKeys(Ce.results),J&&J.forEach(function(it){for(var st=ie.values.map(function(ut){return it.extractKey(ut)}),ct=it.keyPath.findIndex(function(ut){return ut===O.keyPath}),dt=0,kn=Ce.results.length;dt<kn;++dt)st[dt][ct]=Ce.results[dt];oe(it.name).addKeys(st)})),we.mutatedParts=es(we.mutatedParts||{},Ee),Ce})}}),le={get:function(ie){return[O,new ln(ie.key)]},getMany:function(ie){return[O,new ln().addKeys(ie.keys)]},count:k,query:k,openCursor:k};return d(le).forEach(function(ie){te[ie]=function(oe){var ae=We.subscr,ye=!!ae,he=Xa(We,N)&&Qa(ie,oe)?oe.obsSet={}:ae;if(ye){var we,ae=function(Re){return Re="idb://".concat(f,"/").concat(w,"/").concat(Re),he[Re]||(he[Re]=new ln)},Ee=ae(""),je=ae(":dels"),ye=le[ie](oe),Le=ye[0],ye=ye[1];if((ie==="query"&&Le.isPrimaryKey&&!oe.values?je:ae(Le.name||"")).add(ye),!Le.isPrimaryKey){if(ie!=="count")return we=ie==="query"&&ne&&oe.values&&N.query(s(s({},oe),{values:!1})),N[ie].apply(this,arguments).then(function(Re){if(ie==="query"){if(ne&&oe.values)return we.then(function(st){return st=st.result,Ee.addKeys(st),Re});var Ye=oe.values?Re.result.map(ce):Re.result;(oe.values?Ee:je).addKeys(Ye)}else{var Ce,it;if(ie==="openCursor")return it=oe.values,(Ce=Re)&&Object.create(Ce,{key:{get:function(){return je.addKey(Ce.primaryKey),Ce.key}},primaryKey:{get:function(){var st=Ce.primaryKey;return je.addKey(st),st}},value:{get:function(){return it&&Ee.addKey(Ce.primaryKey),Ce.value}}})}return Re});je.add(m)}}return N[ie].apply(this,arguments)}}),te}})}};function qo(a,f,m){var w;return m.numFailures===0?f:f.type==="deleteRange"||(w=f.keys?f.keys.length:"values"in f&&f.values?f.values.length:1,m.numFailures===w)?null:(w=s({},f),h(w.keys)&&(w.keys=w.keys.filter(function(k,N){return!(N in m.failures)})),"values"in w&&h(w.values)&&(w.values=w.values.filter(function(k,N){return!(N in m.failures)})),w)}function Xs(a,f){return m=a,((w=f).lower===void 0||(w.lowerOpen?0<ft(m,w.lower):0<=ft(m,w.lower)))&&(m=a,(w=f).upper===void 0||(w.upperOpen?ft(m,w.upper)<0:ft(m,w.upper)<=0));var m,w}function Qs(a,f,m,w,k,N){var M,O,ee,ce,ne,J,te;return!m||m.length===0||(M=f.query.index,O=M.multiEntry,ee=f.query.range,ce=w.schema.primaryKey.extractKey,ne=M.extractKey,J=(M.lowLevelIndex||M).extractKey,(w=m.reduce(function(le,ie){var oe=le,ae=[];if(ie.type==="add"||ie.type==="put")for(var ye=new ln,he=ie.values.length-1;0<=he;--he){var we,Ee=ie.values[he],je=ce(Ee);!ye.hasKey(je)&&(we=ne(Ee),O&&h(we)?we.some(function(Ye){return Xs(Ye,ee)}):Xs(we,ee))&&(ye.addKey(je),ae.push(Ee))}switch(ie.type){case"add":var Le=new ln().addKeys(f.values?le.map(function(Ce){return ce(Ce)}):le),oe=le.concat(f.values?ae.filter(function(Ce){return Ce=ce(Ce),!Le.hasKey(Ce)&&(Le.addKey(Ce),!0)}):ae.map(function(Ce){return ce(Ce)}).filter(function(Ce){return!Le.hasKey(Ce)&&(Le.addKey(Ce),!0)}));break;case"put":var Te=new ln().addKeys(ie.values.map(function(Ce){return ce(Ce)}));oe=le.filter(function(Ce){return!Te.hasKey(f.values?ce(Ce):Ce)}).concat(f.values?ae:ae.map(function(Ce){return ce(Ce)}));break;case"delete":var Ve=new ln().addKeys(ie.keys);oe=le.filter(function(Ce){return!Ve.hasKey(f.values?ce(Ce):Ce)});break;case"deleteRange":var Re=ie.range;oe=le.filter(function(Ce){return!Xs(ce(Ce),Re)})}return oe},a))===a)?a:(te=function(le,ie){return ft(J(le),J(ie))||ft(ce(le),ce(ie))},w.sort(f.direction==="prev"||f.direction==="prevunique"?function(le,ie){return te(ie,le)}:te),f.limit&&f.limit<1/0&&(w.length>f.limit?w.length=f.limit:a.length===f.limit&&w.length<f.limit&&(k.dirty=!0)),N?Object.freeze(w):w)}function Gs(a,f){return ft(a.lower,f.lower)===0&&ft(a.upper,f.upper)===0&&!!a.lowerOpen==!!f.lowerOpen&&!!a.upperOpen==!!f.upperOpen}function Ga(a,f){return((m,w,k,N)=>{if(m===void 0)return w!==void 0?-1:0;if(w===void 0)return 1;if((m=ft(m,w))===0){if(k&&N)return 0;if(k)return 1;if(N)return-1}return m})(a.lower,f.lower,a.lowerOpen,f.lowerOpen)<=0&&0<=((m,w,k,N)=>{if(m===void 0)return w!==void 0?1:0;if(w===void 0)return-1;if((m=ft(m,w))===0){if(k&&N)return 0;if(k)return-1;if(N)return 1}return m})(a.upper,f.upper,a.upperOpen,f.upperOpen)}function Ja(a,f,m,w){a.subscribers.add(m),w.addEventListener("abort",function(){var k,N;a.subscribers.delete(m),a.subscribers.size===0&&(k=a,N=f,setTimeout(function(){k.subscribers.size===0&&F(N,k)},3e3))})}var Za={stack:"dbcore",level:0,name:"Cache",create:function(a){var f=a.schema.name;return s(s({},a),{transaction:function(m,w,k){var N,M,O=a.transaction(m,w,k);return w==="readwrite"&&(k=(N=new AbortController).signal,O.addEventListener("abort",(M=function(ee){return function(){if(N.abort(),w==="readwrite"){for(var ce=new Set,ne=0,J=m;ne<J.length;ne++){var te=J[ne],le=Yr["idb://".concat(f,"/").concat(te)];if(le){var ie=a.table(te),oe=le.optimisticOps.filter(function(Ce){return Ce.trans===O});if(O._explicit&&ee&&O.mutatedParts)for(var ae=0,ye=Object.values(le.queries.query);ae<ye.length;ae++)for(var he=0,we=(Le=ye[ae]).slice();he<we.length;he++)Bs((Te=we[he]).obsSet,O.mutatedParts)&&(F(Le,Te),Te.subscribers.forEach(function(Ce){return ce.add(Ce)}));else if(0<oe.length){le.optimisticOps=le.optimisticOps.filter(function(Ce){return Ce.trans!==O});for(var Ee=0,je=Object.values(le.queries.query);Ee<je.length;Ee++)for(var Le,Te,Ve,Re=0,Ye=(Le=je[Ee]).slice();Re<Ye.length;Re++)(Te=Ye[Re]).res!=null&&O.mutatedParts&&(ee&&!Te.dirty?(Ve=Object.isFrozen(Te.res),Ve=Qs(Te.res,Te.req,oe,ie,Te,Ve),Te.dirty?(F(Le,Te),Te.subscribers.forEach(function(Ce){return ce.add(Ce)})):Ve!==Te.res&&(Te.res=Ve,Te.promise=Be.resolve({result:Ve}))):(Te.dirty&&F(Le,Te),Te.subscribers.forEach(function(Ce){return ce.add(Ce)})))}}}ce.forEach(function(Ce){return Ce()})}}})(!1),{signal:k}),O.addEventListener("error",M(!1),{signal:k}),O.addEventListener("complete",M(!0),{signal:k})),O},table:function(m){var w=a.table(m),k=w.schema.primaryKey;return s(s({},w),{mutate:function(N){var M,O=We.trans;return!k.outbound&&O.db._options.cache!=="disabled"&&!O.explicit&&O.idbtrans.mode==="readwrite"&&(M=Yr["idb://".concat(f,"/").concat(m)])?(O=w.mutate(N),N.type!=="add"&&N.type!=="put"||!(50<=N.values.length||Ws(k,N).some(function(ee){return ee==null}))?(M.optimisticOps.push(N),N.mutatedParts&&ts(N.mutatedParts),O.then(function(ee){0<ee.numFailures&&(F(M.optimisticOps,N),(ee=qo(0,N,ee))&&M.optimisticOps.push(ee),N.mutatedParts)&&ts(N.mutatedParts)}),O.catch(function(){F(M.optimisticOps,N),N.mutatedParts&&ts(N.mutatedParts)})):O.then(function(ee){var ce=qo(0,s(s({},N),{values:N.values.map(function(ne,J){var te;return ee.failures[J]?ne:(W(te=(te=k.keyPath)!=null&&te.includes(".")?ve(ne):s({},ne),k.keyPath,ee.results[J]),te)})}),ee);M.optimisticOps.push(ce),queueMicrotask(function(){return N.mutatedParts&&ts(N.mutatedParts)})}),O):w.mutate(N)},query:function(N){var M,O,ee,ce,ne,J,te;return Xa(We,w)&&Qa("query",N)?(M=((ee=We.trans)==null?void 0:ee.db._options.cache)==="immutable",O=(ee=We).requery,ee=ee.signal,J=((le,ie,oe,ae)=>{var ye=Yr["idb://".concat(le,"/").concat(ie)];if(!ye)return[];if(!(le=ye.queries[oe]))return[null,!1,ye,null];var he=le[(ae.query?ae.query.index.name:null)||""];if(!he)return[null,!1,ye,null];switch(oe){case"query":var we=(Ee=ae.direction)!=null?Ee:"next",Ee=he.find(function(je){var Le;return je.req.limit===ae.limit&&je.req.values===ae.values&&((Le=je.req.direction)!=null?Le:"next")===we&&Gs(je.req.query.range,ae.query.range)});return Ee?[Ee,!0,ye,he]:[he.find(function(je){var Le;return("limit"in je.req?je.req.limit:1/0)>=ae.limit&&((Le=je.req.direction)!=null?Le:"next")===we&&(!ae.values||je.req.values)&&Ga(je.req.query.range,ae.query.range)}),!1,ye,he];case"count":return Ee=he.find(function(je){return Gs(je.req.query.range,ae.query.range)}),[Ee,!!Ee,ye,he]}})(f,m,"query",N),te=J[0],ce=J[2],ne=J[3],te&&J[1]?te.obsSet=N.obsSet:(J=w.query(N).then(function(le){var ie=le.result;if(te&&(te.res=ie),M){for(var oe=0,ae=ie.length;oe<ae;++oe)Object.freeze(ie[oe]);Object.freeze(ie)}else le.result=ve(ie);return le}).catch(function(le){return ne&&te&&F(ne,te),Promise.reject(le)}),te={obsSet:N.obsSet,promise:J,subscribers:new Set,type:"query",req:N,dirty:!1},ne?ne.push(te):(ne=[te],(ce=ce||(Yr["idb://".concat(f,"/").concat(m)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[N.query.index.name||""]=ne)),Ja(te,ne,O,ee),te.promise.then(function(le){return{result:Qs(le.result,N,ce==null?void 0:ce.optimisticOps,w,te,M)}})):w.query(N)}})}})}};function jr(a,f){return new Proxy(a,{get:function(m,w,k){return w==="db"?f:Reflect.get(m,w,k)}})}Lt.prototype.version=function(a){if(isNaN(a)||a<.1)throw new Ne.Type("Given version is not a positive number");if(a=Math.round(10*a)/10,this.idbdb||this._state.isBeingOpened)throw new Ne.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,a);var f=this._versions,m=f.filter(function(w){return w._cfg.version===a})[0];return m||(m=new this.Version(a),f.push(m),f.sort(Wr),m.stores({}),this._state.autoSchema=!1),m},Lt.prototype._whenReady=function(a){var f=this;return this.idbdb&&(this._state.openComplete||We.letThrough||this._vip)?a():new Be(function(m,w){if(f._state.openComplete)return w(new Ne.DatabaseClosed(f._state.dbOpenError));if(!f._state.isBeingOpened){if(!f._state.autoOpen)return void w(new Ne.DatabaseClosed);f.open().catch(Fe)}f._state.dbReadyPromise.then(m,w)}).then(a)},Lt.prototype.use=function(k){var f=k.stack,m=k.create,w=k.level,k=k.name,N=(k&&this.unuse({stack:f,name:k}),this._middlewares[f]||(this._middlewares[f]=[]));return N.push({stack:f,create:m,level:w??10,name:k}),N.sort(function(M,O){return M.level-O.level}),this},Lt.prototype.unuse=function(a){var f=a.stack,m=a.name,w=a.create;return f&&this._middlewares[f]&&(this._middlewares[f]=this._middlewares[f].filter(function(k){return w?k.create!==w:!!m&&k.name!==m})),this},Lt.prototype.open=function(){var a=this;return bn(pn,function(){return Du(a)})},Lt.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var a=this._state;if(go.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}a.isBeingOpened||(a.dbReadyPromise=new Be(function(f){a.dbReadyResolve=f}),a.openCanceller=new Be(function(f,m){a.cancelOpen=m}))},Lt.prototype.close=function(f){var f=(f===void 0?{disableAutoOpen:!0}:f).disableAutoOpen,m=this._state;f?(m.isBeingOpened&&m.cancelOpen(new Ne.DatabaseClosed),this._close(),m.autoOpen=!1,m.dbOpenError=new Ne.DatabaseClosed):(this._close(),m.autoOpen=this._options.autoOpen||m.isBeingOpened,m.openComplete=!1,m.dbOpenError=null)},Lt.prototype.delete=function(a){var f=this,m=(a===void 0&&(a={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),w=this._state;return new Be(function(k,N){function M(){f.close(a);var O=f._deps.indexedDB.deleteDatabase(f.name);O.onsuccess=mt(function(){var ee,ce,ne;ee=f._deps,ce=f.name,yo(ne=ee.indexedDB)||ce===Vt||wi(ne,ee.IDBKeyRange).delete(ce).catch(Fe),k()}),O.onerror=mn(N),O.onblocked=f._fireOnBlocked}if(m)throw new Ne.InvalidArgument("Invalid closeOptions argument to db.delete()");w.isBeingOpened?w.dbReadyPromise.then(M):M()})},Lt.prototype.backendDB=function(){return this.idbdb},Lt.prototype.isOpen=function(){return this.idbdb!==null},Lt.prototype.hasBeenClosed=function(){var a=this._state.dbOpenError;return a&&a.name==="DatabaseClosed"},Lt.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Lt.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Lt.prototype,"tables",{get:function(){var a=this;return d(this._allTables).map(function(f){return a._allTables[f]})},enumerable:!1,configurable:!0}),Lt.prototype.transaction=function(){var a=(function(f,m,w){var k=arguments.length;if(k<2)throw new Ne.InvalidArgument("Too few arguments");for(var N=new Array(k-1);--k;)N[k-1]=arguments[k];return w=N.pop(),[f,ke(N),w]}).apply(this,arguments);return this._transaction.apply(this,a)},Lt.prototype._transaction=function(a,f,m){var w,k,N=this,M=We.trans,O=(M&&M.db===this&&a.indexOf("!")===-1||(M=null),a.indexOf("?")!==-1);a=a.replace("!","").replace("?","");try{if(k=f.map(function(ce){if(ce=ce instanceof N.Table?ce.name:ce,typeof ce!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return ce}),a=="r"||a===Qt)w=Qt;else{if(a!="rw"&&a!=Ut)throw new Ne.InvalidArgument("Invalid transaction mode: "+a);w=Ut}if(M){if(M.mode===Qt&&w===Ut){if(!O)throw new Ne.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");M=null}M&&k.forEach(function(ce){if(M&&M.storeNames.indexOf(ce)===-1){if(!O)throw new Ne.SubTransaction("Table "+ce+" not included in parent transaction.");M=null}}),O&&M&&!M.active&&(M=null)}}catch(ce){return M?M._promise(null,function(ne,J){J(ce)}):_e(ce)}var ee=(function ce(ne,J,te,le,ie){return Be.resolve().then(function(){var he=We.transless||We,oe=ne._createTransaction(J,te,ne._dbSchema,le),he=(oe.explicit=!0,{trans:oe,transless:he});if(le)oe.idbtrans=le.idbtrans;else try{oe.create(),oe.idbtrans._explicit=!0,ne._state.PR1398_maxLoop=3}catch(we){return we.name===Se.InvalidState&&ne.isOpen()&&0<--ne._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),ne.close({disableAutoOpen:!1}),ne.open().then(function(){return ce(ne,J,te,null,ie)})):_e(we)}var ae,ye=A(ie),he=(ye&&dr(),Be.follow(function(){var we;(ae=ie.call(oe,oe))&&(ye?(we=Ft.bind(null,null),ae.then(we,we)):typeof ae.next=="function"&&typeof ae.throw=="function"&&(ae=Ks(ae)))},he));return(ae&&typeof ae.then=="function"?Be.resolve(ae).then(function(we){return oe.active?we:_e(new Ne.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):he.then(function(){return ae})).then(function(we){return le&&oe._resolve(),oe._completion.then(function(){return we})}).catch(function(we){return oe._reject(we),_e(we)})})}).bind(null,this,w,k,M,m);return M?M._promise(w,ee,"lock"):We.trans?bn(We.transless,function(){return N._whenReady(ee)}):this._whenReady(ee)},Lt.prototype.table=function(a){if(x(this._allTables,a))return this._allTables[a];throw new Ne.InvalidTable("Table ".concat(a," does not exist"))};var Pr=Lt;function Lt(a,f){var m,w,k,N,M,O=this,ee=(this._middlewares={},this.verno=0,Lt.dependencies),ee=(this._options=f=s({addons:Lt.addons,autoOpen:!0,indexedDB:ee.indexedDB,IDBKeyRange:ee.IDBKeyRange,cache:"cloned",maxConnections:1e3},f),this._deps={indexedDB:f.indexedDB,IDBKeyRange:f.IDBKeyRange},f.addons),ce=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Fe,dbReadyPromise:null,cancelOpen:Fe,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:f.autoOpen}),ne=(ce.dbReadyPromise=new Be(function(J){ce.dbReadyResolve=J}),ce.openCanceller=new Be(function(J,te){ce.cancelOpen=te}),this._state=ce,this.name=a,this.on=Ur(this,"populate","blocked","versionchange","close",{ready:[Yt,Fe]}),this.once=function(J,te){var le=function(){for(var ie=[],oe=0;oe<arguments.length;oe++)ie[oe]=arguments[oe];O.on(J).unsubscribe(le),te.apply(O,ie)};return O.on(J,le)},this.on.ready.subscribe=P(this.on.ready.subscribe,function(J){return function(te,le){Lt.vip(function(){var ie,oe=O._state;oe.openComplete?(oe.dbOpenError||Be.resolve().then(te),le&&J(te)):oe.onReadyBeingFired?(oe.onReadyBeingFired.push(te),le&&J(te)):(J(te),ie=O,le||J(function ae(){ie.on.ready.unsubscribe(te),ie.on.ready.unsubscribe(ae)}))})}}),this.Collection=(m=this,uo(Ha.prototype,function(ae,oe){this.db=m;var le=_n,ie=null;if(oe)try{le=oe()}catch(he){ie=he}var oe=ae._ctx,ae=oe.table,ye=ae.hook.reading.fire;this._ctx={table:ae,index:oe.index,isPrimKey:!oe.index||ae.schema.primKey.keyPath&&oe.index===ae.schema.primKey.name,range:le,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:ie,or:oe.or,valueMapper:ye!==Ke?ye:null}})),this.Table=(w=this,uo(tr.prototype,function(J,te,le){this.db=w,this._tx=le,this.name=J,this.schema=te,this.hook=w._allTables[J]?w._allTables[J].hook:Ur(null,{creating:[ot,Fe],reading:[qe,Ke],updating:[xn,Fe],deleting:[Tt,Fe]})})),this.Transaction=(k=this,uo(Ru.prototype,function(J,te,le,ie,oe){var ae=this;J!=="readonly"&&te.forEach(function(ye){ye=(ye=le[ye])==null?void 0:ye.yProps,ye&&(te=te.concat(ye.map(function(he){return he.updatesTable})))}),this.db=k,this.mode=J,this.storeNames=te,this.schema=le,this.chromeTransactionDurability=ie,this.idbtrans=null,this.on=Ur(this,"complete","error","abort"),this.parent=oe||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 Be(function(ye,he){ae._resolve=ye,ae._reject=he}),this._completion.then(function(){ae.active=!1,ae.on.complete.fire()},function(ye){var he=ae.active;return ae.active=!1,ae.on.error.fire(ye),ae.parent?ae.parent._reject(ye):he&&ae.idbtrans&&ae.idbtrans.abort(),_e(ye)})})),this.Version=(N=this,uo(xi.prototype,function(J){this.db=N,this._cfg={version:J,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(M=this,uo(Nr.prototype,function(J,te,le){if(this.db=M,this._ctx={table:J,index:te===":id"?null:te,or:le},this._cmp=this._ascending=ft,this._descending=function(ie,oe){return ft(oe,ie)},this._max=function(ie,oe){return 0<ft(ie,oe)?ie:oe},this._min=function(ie,oe){return ft(ie,oe)<0?ie:oe},this._IDBKeyRange=M._deps.IDBKeyRange,!this._IDBKeyRange)throw new Ne.MissingAPI})),this.on("versionchange",function(J){0<J.newVersion?console.warn("Another connection wants to upgrade database '".concat(O.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(O.name,"'. Closing db now to resume the delete request.")),O.close({disableAutoOpen:!1})}),this.on("blocked",function(J){!J.newVersion||J.newVersion<J.oldVersion?console.warn("Dexie.delete('".concat(O.name,"') was blocked")):console.warn("Upgrade '".concat(O.name,"' blocked by other connection holding version ").concat(J.oldVersion/10))}),this._maxKey=Er(f.IDBKeyRange),this._createTransaction=function(J,te,le,ie){return new O.Transaction(J,te,le,O._options.chromeTransactionDurability,ie)},this._fireOnBlocked=function(J){O.on("blocked").fire(J),go.toArray().filter(function(te){return te.name===O.name&&te!==O&&!te._state.vcFired}).map(function(te){return te.on("versionchange").fire(J)})},this.use(Fu),this.use(Za),this.use(Ys),this.use(Wa),this.use(zu),new Proxy(this,{get:function(J,te,le){var ie;return te==="_vip"||(te==="table"?function(oe){return jr(O.table(oe),ne)}:(ie=Reflect.get(J,te,le))instanceof tr?jr(ie,ne):te==="tables"?ie.map(function(oe){return jr(oe,ne)}):te==="_createTransaction"?function(){return jr(ie.apply(this,arguments),ne)}:ie)}}));this.vip=ne,ee.forEach(function(J){return J(O)})}var os,vo=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",el=(xo.prototype.subscribe=function(a,f,m){return this._subscribe(a&&typeof a!="function"?a:{next:a,error:f,complete:m})},xo.prototype[vo]=function(){return this},xo);function xo(a){this._subscribe=a}try{os={indexedDB:c.indexedDB||c.mozIndexedDB||c.webkitIndexedDB||c.msIndexedDB,IDBKeyRange:c.IDBKeyRange||c.webkitIDBKeyRange}}catch{os={indexedDB:null,IDBKeyRange:null}}function Wo(a){var f,m=!1,w=new el(function(k){var N=A(a),M,O=!1,ee={},ce={},ne={get closed(){return O},unsubscribe:function(){O||(O=!0,M&&M.abort(),J&&Vn.storagemutated.unsubscribe(ie))}},J=(k.start&&k.start(ne),!1),te=function(){return L(oe)};function le(){return Bs(ce,ee)}var ie=function(ae){es(ee,ae),le()&&te()},oe=function(){var ae,ye,he;!O&&os.indexedDB&&(ee={},ae={},M&&M.abort(),M=new AbortController,he=(we=>{var Ee=Fn();try{N&&dr();var je=Tn(a,we);return je=N?je.finally(Ft):je}finally{Ee&&rn()}})(ye={subscr:ae,signal:M.signal,requery:te,querier:a,trans:null}),J||(Vn(mi,ie),J=!0),Promise.resolve(he).then(function(we){m=!0,f=we,O||ye.signal.aborted||(le()||(ce=ae,le())?te():(ee={},L(function(){return!O&&k.next&&k.next(we)})))},function(we){m=!1,["DatabaseClosedError","AbortError"].includes(we==null?void 0:we.name)||O||L(function(){O||k.error&&k.error(we)})}))};return setTimeout(te,0),ne});return w.hasValue=function(){return m},w.getValue=function(){return f},w}var wo=Pr;function Yo(a){var f=$r;try{$r=!0,Vn.storagemutated.fire(a),Us(a,!0)}finally{$r=f}}_(wo,s(s({},K),{delete:function(a){return new wo(a,{addons:[]}).delete()},exists:function(a){return new wo(a,{addons:[]}).open().then(function(f){return f.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(a){try{return f=wo.dependencies,m=f.indexedDB,f=f.IDBKeyRange,(yo(m)?Promise.resolve(m.databases()).then(function(w){return w.map(function(k){return k.name}).filter(function(k){return k!==Vt})}):wi(m,f).toCollection().primaryKeys()).then(a)}catch{return _e(new Ne.MissingAPI)}var f,m},defineClass:function(){return function(a){v(this,a)}},ignoreTransaction:function(a){return We.trans?bn(We.transless||pn,a):a()},vip:Ko,async:function(a){return function(){try{var f=Ks(a.apply(this,arguments));return f&&typeof f.then=="function"?f:Be.resolve(f)}catch(m){return _e(m)}}},spawn:function(a,f,m){try{var w=Ks(a.apply(m,f||[]));return w&&typeof w.then=="function"?w:Be.resolve(w)}catch(k){return _e(k)}},currentTransaction:{get:function(){return We.trans||null}},waitFor:function(a,f){return a=Be.resolve(typeof a=="function"?wo.ignoreTransaction(a):a).timeout(f||6e4),We.trans?We.trans.waitFor(a):a},Promise:Be,debug:{get:function(){return kt},set:function(a){nn(a)}},derive:$,extend:v,props:_,override:P,Events:Ur,on:Vn,liveQuery:Wo,extendObservabilitySet:es,getByKeyPath:V,setByKeyPath:W,delByKeyPath:function(a,f){typeof f=="string"?W(a,f,void 0):"length"in f&&[].map.call(f,function(m){W(a,m,void 0)})},shallowClone:Q,deepClone:ve,getObjectDiff:qs,cmp:ft,asap:B,minKey:-1/0,addons:[],connections:{get:go.toArray},errnames:Se,dependencies:os,cache:Yr,semVer:"4.4.2",version:"4.4.2".split(".").map(function(a){return parseInt(a)}).reduce(function(a,f,m){return a+f/Math.pow(10,2*m)})})),wo.maxKey=Er(wo.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Vn(mi,function(a){$r||(a=new CustomEvent(Ki,{detail:a}),$r=!0,dispatchEvent(a),$r=!1)}),addEventListener(Ki,function(a){a=a.detail,$r||Yo(a)}));var Xo,$r=!1,is=function(){};return typeof BroadcastChannel<"u"&&((is=function(){(Xo=new BroadcastChannel(Ki)).onmessage=function(a){return a.data&&Yo(a.data)}})(),typeof Xo.unref=="function"&&Xo.unref(),Vn(mi,function(a){$r||Xo.postMessage(a)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(a){if(!Pr.disableBfCache&&a.persisted){kt&&console.debug("Dexie: handling persisted pagehide"),Xo!=null&&Xo.close();for(var f=0,m=go.toArray();f<m.length;f++)m[f].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(a){!Pr.disableBfCache&&a.persisted&&(kt&&console.debug("Dexie: handling persisted pageshow"),is(),Yo({all:new ln(-1/0,[[]])}))})),Be.rejectionMapper=function(a,f){return!a||a instanceof be||a instanceof TypeError||a instanceof SyntaxError||!a.name||!et[a.name]?a:(f=new et[a.name](f||a.message,a),"stack"in a&&j(f,"stack",{get:function(){return this.inner.stack}}),f)},nn(kt),s(Pr,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:Pr,Entity:sn,PropModification:so,RangeSet:ln,add:function(a){return new so({add:a})},cmp:ft,default:Pr,liveQuery:Wo,mergeRanges:_i,rangesOverlap:Ji,remove:function(a){return new so({remove:a})},replacePrefix:function(a,f){return new so({replacePrefix:[a,f]})}}),{default:Pr}),Pr})})(nu)),nu.exports}var Qy=Xy();const Sf=bu(Qy),ah=Symbol.for("Dexie"),uu=globalThis[ah]||(globalThis[ah]=Sf);if(Sf.semVer!==uu.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Sf.semVer} and ${uu.semVer}`);const{liveQuery:f2,mergeRanges:d2,rangesOverlap:p2,RangeSet:h2,cmp:m2,Entity:g2,PropModification:y2,replacePrefix:v2,add:x2,remove:w2,DexieYProvider:b2}=uu;class Gy extends uu{constructor(){super("api-doc-tor");ga(this,"flows");ga(this,"testSuites");ga(this,"environments");ga(this,"kv");this.version(1).stores({flows:"++id, name",testSuites:"++id, name",environments:"++id, name",kv:"key"})}}const _t=new Gy;async function Jy(){const[t,r,i]=await Promise.all([_t.flows.toArray(),_t.testSuites.toArray(),_t.environments.toArray()]),s=await _t.kv.get("authTokens");let l;try{l=s!=null&&s.value?JSON.parse(s.value):void 0}catch{l=void 0}return{formatVersion:1,exportedAt:new Date().toISOString(),flows:t,testSuites:r,environments:i,authTokens:l}}async function Em(t){await _t.transaction("rw",_t.flows,_t.testSuites,_t.environments,_t.kv,async()=>{await _t.flows.clear(),await _t.testSuites.clear(),await _t.environments.clear();for(const r of t.flows)await _t.flows.add({name:r.name,steps:r.steps,graph:r.graph});for(const r of t.testSuites)await _t.testSuites.add({name:r.name,cases:r.cases});for(const r of t.environments)await _t.environments.add({name:r.name,baseUrl:r.baseUrl,vars:r.vars??{}});t.authTokens&&await _t.kv.put({key:"authTokens",value:JSON.stringify(t.authTokens)})})}async function Zy(t){if(t.formatVersion!==1)return!1;const[r,i]=await Promise.all([_t.flows.count(),_t.testSuites.count()]);return r>0||i>0?!1:(await Em(t),!0)}function ev(t,r,i){var d,h;const s=[],l=r===t.expectStatus;if(s.push(`HTTP ${r} ${l?"✓":`✗ (esperado ${t.expectStatus})`}`),!l)return{pass:!1,lines:s};if((d=t.contains)!=null&&d.trim()){const v=i.includes(t.contains);if(s.push(`Contiene texto "${t.contains}": ${v?"✓":"✗"}`),!v)return{pass:!1,lines:s}}const c=(h=t.jsonPath)==null?void 0:h.trim();if(c){let v;try{v=JSON.parse(i)}catch{return s.push("Body no es JSON válido: ✗"),{pass:!1,lines:s}}const b=Ff(v,c),S=t.expectJsonValue;if(S!==void 0&&S!==""){const x=b==null?String(b):typeof b=="object"?JSON.stringify(b):String(b),_=S.trim(),C=x===_||String(b)===_;if(s.push(`JSON path ${c} → ${x} vs "${_}": ${C?"✓":"✗"}`),!C)return{pass:!1,lines:s}}else{const x=b!=null;if(s.push(`JSON path ${c} existe: ${x?"✓":"✗"}`),!x)return{pass:!1,lines:s}}}return{pass:!0,lines:s}}function Zt(t){if(typeof t=="string"||typeof t=="number")return""+t;let r="";if(Array.isArray(t))for(let i=0,s;i<t.length;i++)(s=Zt(t[i]))!==""&&(r+=(r&&" ")+s);else for(let i in t)t[i]&&(r+=(r&&" ")+i);return r}var tv={value:()=>{}};function Nu(){for(var t=0,r=arguments.length,i={},s;t<r;++t){if(!(s=arguments[t]+"")||s in i||/[\s.]/.test(s))throw new Error("illegal type: "+s);i[s]=[]}return new ru(i)}function ru(t){this._=t}function nv(t,r){return t.trim().split(/^|\s+/).map(function(i){var s="",l=i.indexOf(".");if(l>=0&&(s=i.slice(l+1),i=i.slice(0,l)),i&&!r.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:s}})}ru.prototype=Nu.prototype={constructor:ru,on:function(t,r){var i=this._,s=nv(t+"",i),l,c=-1,d=s.length;if(arguments.length<2){for(;++c<d;)if((l=(t=s[c]).type)&&(l=rv(i[l],t.name)))return l;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++c<d;)if(l=(t=s[c]).type)i[l]=lh(i[l],t.name,r);else if(r==null)for(l in i)i[l]=lh(i[l],t.name,null);return this},copy:function(){var t={},r=this._;for(var i in r)t[i]=r[i].slice();return new ru(t)},call:function(t,r){if((l=arguments.length-2)>0)for(var i=new Array(l),s=0,l,c;s<l;++s)i[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(c=this._[t],s=0,l=c.length;s<l;++s)c[s].value.apply(r,i)},apply:function(t,r,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var s=this._[t],l=0,c=s.length;l<c;++l)s[l].value.apply(r,i)}};function rv(t,r){for(var i=0,s=t.length,l;i<s;++i)if((l=t[i]).name===r)return l.value}function lh(t,r,i){for(var s=0,l=t.length;s<l;++s)if(t[s].name===r){t[s]=tv,t=t.slice(0,s).concat(t.slice(s+1));break}return i!=null&&t.push({name:r,value:i}),t}var kf="http://www.w3.org/1999/xhtml";const uh={svg:"http://www.w3.org/2000/svg",xhtml:kf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Eu(t){var r=t+="",i=r.indexOf(":");return i>=0&&(r=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),uh.hasOwnProperty(r)?{space:uh[r],local:t}:t}function ov(t){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===kf&&r.documentElement.namespaceURI===kf?r.createElement(t):r.createElementNS(i,t)}}function iv(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Cm(t){var r=Eu(t);return(r.local?iv:ov)(r)}function sv(){}function Bf(t){return t==null?sv:function(){return this.querySelector(t)}}function av(t){typeof t!="function"&&(t=Bf(t));for(var r=this._groups,i=r.length,s=new Array(i),l=0;l<i;++l)for(var c=r[l],d=c.length,h=s[l]=new Array(d),v,b,S=0;S<d;++S)(v=c[S])&&(b=t.call(v,v.__data__,S,c))&&("__data__"in v&&(b.__data__=v.__data__),h[S]=b);return new ar(s,this._parents)}function lv(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function uv(){return[]}function jm(t){return t==null?uv:function(){return this.querySelectorAll(t)}}function cv(t){return function(){return lv(t.apply(this,arguments))}}function fv(t){typeof t=="function"?t=cv(t):t=jm(t);for(var r=this._groups,i=r.length,s=[],l=[],c=0;c<i;++c)for(var d=r[c],h=d.length,v,b=0;b<h;++b)(v=d[b])&&(s.push(t.call(v,v.__data__,b,d)),l.push(v));return new ar(s,l)}function Pm(t){return function(){return this.matches(t)}}function $m(t){return function(r){return r.matches(t)}}var dv=Array.prototype.find;function pv(t){return function(){return dv.call(this.children,t)}}function hv(){return this.firstElementChild}function mv(t){return this.select(t==null?hv:pv(typeof t=="function"?t:$m(t)))}var gv=Array.prototype.filter;function yv(){return Array.from(this.children)}function vv(t){return function(){return gv.call(this.children,t)}}function xv(t){return this.selectAll(t==null?yv:vv(typeof t=="function"?t:$m(t)))}function wv(t){typeof t!="function"&&(t=Pm(t));for(var r=this._groups,i=r.length,s=new Array(i),l=0;l<i;++l)for(var c=r[l],d=c.length,h=s[l]=[],v,b=0;b<d;++b)(v=c[b])&&t.call(v,v.__data__,b,c)&&h.push(v);return new ar(s,this._parents)}function Mm(t){return new Array(t.length)}function bv(){return new ar(this._enter||this._groups.map(Mm),this._parents)}function cu(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}cu.prototype={constructor:cu,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 _v(t){return function(){return t}}function Sv(t,r,i,s,l,c){for(var d=0,h,v=r.length,b=c.length;d<b;++d)(h=r[d])?(h.__data__=c[d],s[d]=h):i[d]=new cu(t,c[d]);for(;d<v;++d)(h=r[d])&&(l[d]=h)}function kv(t,r,i,s,l,c,d){var h,v,b=new Map,S=r.length,x=c.length,_=new Array(S),C;for(h=0;h<S;++h)(v=r[h])&&(_[h]=C=d.call(v,v.__data__,h,r)+"",b.has(C)?l[h]=v:b.set(C,v));for(h=0;h<x;++h)C=d.call(t,c[h],h,c)+"",(v=b.get(C))?(s[h]=v,v.__data__=c[h],b.delete(C)):i[h]=new cu(t,c[h]);for(h=0;h<S;++h)(v=r[h])&&b.get(_[h])===v&&(l[h]=v)}function Nv(t){return t.__data__}function Ev(t,r){if(!arguments.length)return Array.from(this,Nv);var i=r?kv:Sv,s=this._parents,l=this._groups;typeof t!="function"&&(t=_v(t));for(var c=l.length,d=new Array(c),h=new Array(c),v=new Array(c),b=0;b<c;++b){var S=s[b],x=l[b],_=x.length,C=Cv(t.call(S,S&&S.__data__,b,s)),j=C.length,$=h[b]=new Array(j),T=d[b]=new Array(j),I=v[b]=new Array(_);i(S,x,$,T,I,C,r);for(var H=0,P=0,R,B;H<j;++H)if(R=$[H]){for(H>=P&&(P=H+1);!(B=T[P])&&++P<j;);R._next=B||null}}return d=new ar(d,s),d._enter=h,d._exit=v,d}function Cv(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function jv(){return new ar(this._exit||this._groups.map(Mm),this._parents)}function Pv(t,r,i){var s=this.enter(),l=this,c=this.exit();return typeof t=="function"?(s=t(s),s&&(s=s.selection())):s=s.append(t+""),r!=null&&(l=r(l),l&&(l=l.selection())),i==null?c.remove():i(c),s&&l?s.merge(l).order():l}function $v(t){for(var r=t.selection?t.selection():t,i=this._groups,s=r._groups,l=i.length,c=s.length,d=Math.min(l,c),h=new Array(l),v=0;v<d;++v)for(var b=i[v],S=s[v],x=b.length,_=h[v]=new Array(x),C,j=0;j<x;++j)(C=b[j]||S[j])&&(_[j]=C);for(;v<l;++v)h[v]=i[v];return new ar(h,this._parents)}function Mv(){for(var t=this._groups,r=-1,i=t.length;++r<i;)for(var s=t[r],l=s.length-1,c=s[l],d;--l>=0;)(d=s[l])&&(c&&d.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(d,c),c=d);return this}function Tv(t){t||(t=Iv);function r(x,_){return x&&_?t(x.__data__,_.__data__):!x-!_}for(var i=this._groups,s=i.length,l=new Array(s),c=0;c<s;++c){for(var d=i[c],h=d.length,v=l[c]=new Array(h),b,S=0;S<h;++S)(b=d[S])&&(v[S]=b);v.sort(r)}return new ar(l,this._parents).order()}function Iv(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function Av(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Ov(){return Array.from(this)}function Rv(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],l=0,c=s.length;l<c;++l){var d=s[l];if(d)return d}return null}function Lv(){let t=0;for(const r of this)++t;return t}function Dv(){return!this.node()}function zv(t){for(var r=this._groups,i=0,s=r.length;i<s;++i)for(var l=r[i],c=0,d=l.length,h;c<d;++c)(h=l[c])&&t.call(h,h.__data__,c,l);return this}function Fv(t){return function(){this.removeAttribute(t)}}function Bv(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Hv(t,r){return function(){this.setAttribute(t,r)}}function Vv(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function Uv(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function Kv(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 qv(t,r){var i=Eu(t);if(arguments.length<2){var s=this.node();return i.local?s.getAttributeNS(i.space,i.local):s.getAttribute(i)}return this.each((r==null?i.local?Bv:Fv:typeof r=="function"?i.local?Kv:Uv:i.local?Vv:Hv)(i,r))}function Tm(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Wv(t){return function(){this.style.removeProperty(t)}}function Yv(t,r,i){return function(){this.style.setProperty(t,r,i)}}function Xv(t,r,i){return function(){var s=r.apply(this,arguments);s==null?this.style.removeProperty(t):this.style.setProperty(t,s,i)}}function Qv(t,r,i){return arguments.length>1?this.each((r==null?Wv:typeof r=="function"?Xv:Yv)(t,r,i??"")):Ps(this.node(),t)}function Ps(t,r){return t.style.getPropertyValue(r)||Tm(t).getComputedStyle(t,null).getPropertyValue(r)}function Gv(t){return function(){delete this[t]}}function Jv(t,r){return function(){this[t]=r}}function Zv(t,r){return function(){var i=r.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function ex(t,r){return arguments.length>1?this.each((r==null?Gv:typeof r=="function"?Zv:Jv)(t,r)):this.node()[t]}function Im(t){return t.trim().split(/^|\s+/)}function Hf(t){return t.classList||new Am(t)}function Am(t){this._node=t,this._names=Im(t.getAttribute("class")||"")}Am.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 Om(t,r){for(var i=Hf(t),s=-1,l=r.length;++s<l;)i.add(r[s])}function Rm(t,r){for(var i=Hf(t),s=-1,l=r.length;++s<l;)i.remove(r[s])}function tx(t){return function(){Om(this,t)}}function nx(t){return function(){Rm(this,t)}}function rx(t,r){return function(){(r.apply(this,arguments)?Om:Rm)(this,t)}}function ox(t,r){var i=Im(t+"");if(arguments.length<2){for(var s=Hf(this.node()),l=-1,c=i.length;++l<c;)if(!s.contains(i[l]))return!1;return!0}return this.each((typeof r=="function"?rx:r?tx:nx)(i,r))}function ix(){this.textContent=""}function sx(t){return function(){this.textContent=t}}function ax(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function lx(t){return arguments.length?this.each(t==null?ix:(typeof t=="function"?ax:sx)(t)):this.node().textContent}function ux(){this.innerHTML=""}function cx(t){return function(){this.innerHTML=t}}function fx(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function dx(t){return arguments.length?this.each(t==null?ux:(typeof t=="function"?fx:cx)(t)):this.node().innerHTML}function px(){this.nextSibling&&this.parentNode.appendChild(this)}function hx(){return this.each(px)}function mx(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function gx(){return this.each(mx)}function yx(t){var r=typeof t=="function"?t:Cm(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function vx(){return null}function xx(t,r){var i=typeof t=="function"?t:Cm(t),s=r==null?vx:typeof r=="function"?r:Bf(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})}function wx(){var t=this.parentNode;t&&t.removeChild(this)}function bx(){return this.each(wx)}function _x(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function Sx(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function kx(t){return this.select(t?Sx:_x)}function Nx(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ex(t){return function(r){t.call(this,r,this.__data__)}}function Cx(t){return t.trim().split(/^|\s+/).map(function(r){var i="",s=r.indexOf(".");return s>=0&&(i=r.slice(s+1),r=r.slice(0,s)),{type:r,name:i}})}function jx(t){return function(){var r=this.__on;if(r){for(var i=0,s=-1,l=r.length,c;i<l;++i)c=r[i],(!t.type||c.type===t.type)&&c.name===t.name?this.removeEventListener(c.type,c.listener,c.options):r[++s]=c;++s?r.length=s:delete this.__on}}}function Px(t,r,i){return function(){var s=this.__on,l,c=Ex(r);if(s){for(var d=0,h=s.length;d<h;++d)if((l=s[d]).type===t.type&&l.name===t.name){this.removeEventListener(l.type,l.listener,l.options),this.addEventListener(l.type,l.listener=c,l.options=i),l.value=r;return}}this.addEventListener(t.type,c,i),l={type:t.type,name:t.name,value:r,listener:c,options:i},s?s.push(l):this.__on=[l]}}function $x(t,r,i){var s=Cx(t+""),l,c=s.length,d;if(arguments.length<2){var h=this.node().__on;if(h){for(var v=0,b=h.length,S;v<b;++v)for(l=0,S=h[v];l<c;++l)if((d=s[l]).type===S.type&&d.name===S.name)return S.value}return}for(h=r?Px:jx,l=0;l<c;++l)this.each(h(s[l],r,i));return this}function Lm(t,r,i){var s=Tm(t),l=s.CustomEvent;typeof l=="function"?l=new l(r,i):(l=s.document.createEvent("Event"),i?(l.initEvent(r,i.bubbles,i.cancelable),l.detail=i.detail):l.initEvent(r,!1,!1)),t.dispatchEvent(l)}function Mx(t,r){return function(){return Lm(this,t,r)}}function Tx(t,r){return function(){return Lm(this,t,r.apply(this,arguments))}}function Ix(t,r){return this.each((typeof r=="function"?Tx:Mx)(t,r))}function*Ax(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],l=0,c=s.length,d;l<c;++l)(d=s[l])&&(yield d)}var Dm=[null];function ar(t,r){this._groups=t,this._parents=r}function Oa(){return new ar([[document.documentElement]],Dm)}function Ox(){return this}ar.prototype=Oa.prototype={constructor:ar,select:av,selectAll:fv,selectChild:mv,selectChildren:xv,filter:wv,data:Ev,enter:bv,exit:jv,join:Pv,merge:$v,selection:Ox,order:Mv,sort:Tv,call:Av,nodes:Ov,node:Rv,size:Lv,empty:Dv,each:zv,attr:qv,style:Qv,property:ex,classed:ox,text:lx,html:dx,raise:hx,lower:gx,append:yx,insert:xx,remove:bx,clone:kx,datum:Nx,on:$x,dispatch:Ix,[Symbol.iterator]:Ax};function sr(t){return typeof t=="string"?new ar([[document.querySelector(t)]],[document.documentElement]):new ar([[t]],Dm)}function Rx(t){let r;for(;r=t.sourceEvent;)t=r;return t}function Rr(t,r){if(t=Rx(t),r===void 0&&(r=t.currentTarget),r){var i=r.ownerSVGElement||r;if(i.createSVGPoint){var s=i.createSVGPoint();return s.x=t.clientX,s.y=t.clientY,s=s.matrixTransform(r.getScreenCTM().inverse()),[s.x,s.y]}if(r.getBoundingClientRect){var l=r.getBoundingClientRect();return[t.clientX-l.left-r.clientLeft,t.clientY-l.top-r.clientTop]}}return[t.pageX,t.pageY]}const Lx={passive:!1},Na={capture:!0,passive:!1};function rf(t){t.stopImmediatePropagation()}function Cs(t){t.preventDefault(),t.stopImmediatePropagation()}function zm(t){var r=t.document.documentElement,i=sr(t).on("dragstart.drag",Cs,Na);"onselectstart"in r?i.on("selectstart.drag",Cs,Na):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function Fm(t,r){var i=t.document.documentElement,s=sr(t).on("dragstart.drag",null);r&&(s.on("click.drag",Cs,Na),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in i?s.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Kl=t=>()=>t;function Nf(t,{sourceEvent:r,subject:i,target:s,identifier:l,active:c,x:d,y:h,dx:v,dy:b,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:s,enumerable:!0,configurable:!0},identifier:{value:l,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:h,enumerable:!0,configurable:!0},dx:{value:v,enumerable:!0,configurable:!0},dy:{value:b,enumerable:!0,configurable:!0},_:{value:S}})}Nf.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Dx(t){return!t.ctrlKey&&!t.button}function zx(){return this.parentNode}function Fx(t,r){return r??{x:t.x,y:t.y}}function Bx(){return navigator.maxTouchPoints||"ontouchstart"in this}function Bm(){var t=Dx,r=zx,i=Fx,s=Bx,l={},c=Nu("start","drag","end"),d=0,h,v,b,S,x=0;function _(R){R.on("mousedown.drag",C).filter(s).on("touchstart.drag",T).on("touchmove.drag",I,Lx).on("touchend.drag touchcancel.drag",H).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(R,B){if(!(S||!t.call(this,R,B))){var V=P(this,r.call(this,R,B),R,B,"mouse");V&&(sr(R.view).on("mousemove.drag",j,Na).on("mouseup.drag",$,Na),zm(R.view),rf(R),b=!1,h=R.clientX,v=R.clientY,V("start",R))}}function j(R){if(Cs(R),!b){var B=R.clientX-h,V=R.clientY-v;b=B*B+V*V>x}l.mouse("drag",R)}function $(R){sr(R.view).on("mousemove.drag mouseup.drag",null),Fm(R.view,b),Cs(R),l.mouse("end",R)}function T(R,B){if(t.call(this,R,B)){var V=R.changedTouches,W=r.call(this,R,B),Q=V.length,de,ke;for(de=0;de<Q;++de)(ke=P(this,W,R,B,V[de].identifier,V[de]))&&(rf(R),ke("start",R,V[de]))}}function I(R){var B=R.changedTouches,V=B.length,W,Q;for(W=0;W<V;++W)(Q=l[B[W].identifier])&&(Cs(R),Q("drag",R,B[W]))}function H(R){var B=R.changedTouches,V=B.length,W,Q;for(S&&clearTimeout(S),S=setTimeout(function(){S=null},500),W=0;W<V;++W)(Q=l[B[W].identifier])&&(rf(R),Q("end",R,B[W]))}function P(R,B,V,W,Q,de){var ke=c.copy(),Y=Rr(de||V,B),fe,ve,D;if((D=i.call(R,new Nf("beforestart",{sourceEvent:V,target:_,identifier:Q,active:d,x:Y[0],y:Y[1],dx:0,dy:0,dispatch:ke}),W))!=null)return fe=D.x-Y[0]||0,ve=D.y-Y[1]||0,function ue(G,se,F){var q=Y,Z;switch(G){case"start":l[Q]=ue,Z=d++;break;case"end":delete l[Q],--d;case"drag":Y=Rr(F||se,B),Z=d;break}ke.call(G,R,new Nf(G,{sourceEvent:se,subject:D,target:_,identifier:Q,active:Z,x:Y[0]+fe,y:Y[1]+ve,dx:Y[0]-q[0],dy:Y[1]-q[1],dispatch:ke}),W)}}return _.filter=function(R){return arguments.length?(t=typeof R=="function"?R:Kl(!!R),_):t},_.container=function(R){return arguments.length?(r=typeof R=="function"?R:Kl(R),_):r},_.subject=function(R){return arguments.length?(i=typeof R=="function"?R:Kl(R),_):i},_.touchable=function(R){return arguments.length?(s=typeof R=="function"?R:Kl(!!R),_):s},_.on=function(){var R=c.on.apply(c,arguments);return R===c?_:R},_.clickDistance=function(R){return arguments.length?(x=(R=+R)*R,_):Math.sqrt(x)},_}function Vf(t,r,i){t.prototype=r.prototype=i,i.constructor=t}function Hm(t,r){var i=Object.create(t.prototype);for(var s in r)i[s]=r[s];return i}function Ra(){}var Ea=.7,fu=1/Ea,js="\\s*([+-]?\\d+)\\s*",Ca="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",eo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Hx=/^#([0-9a-f]{3,8})$/,Vx=new RegExp(`^rgb\\(${js},${js},${js}\\)$`),Ux=new RegExp(`^rgb\\(${eo},${eo},${eo}\\)$`),Kx=new RegExp(`^rgba\\(${js},${js},${js},${Ca}\\)$`),qx=new RegExp(`^rgba\\(${eo},${eo},${eo},${Ca}\\)$`),Wx=new RegExp(`^hsl\\(${Ca},${eo},${eo}\\)$`),Yx=new RegExp(`^hsla\\(${Ca},${eo},${eo},${Ca}\\)$`),ch={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};Vf(Ra,Fi,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:fh,formatHex:fh,formatHex8:Xx,formatHsl:Qx,formatRgb:dh,toString:dh});function fh(){return this.rgb().formatHex()}function Xx(){return this.rgb().formatHex8()}function Qx(){return Vm(this).formatHsl()}function dh(){return this.rgb().formatRgb()}function Fi(t){var r,i;return t=(t+"").trim().toLowerCase(),(r=Hx.exec(t))?(i=r[1].length,r=parseInt(r[1],16),i===6?ph(r):i===3?new Qn(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?ql(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?ql(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=Vx.exec(t))?new Qn(r[1],r[2],r[3],1):(r=Ux.exec(t))?new Qn(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=Kx.exec(t))?ql(r[1],r[2],r[3],r[4]):(r=qx.exec(t))?ql(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Wx.exec(t))?gh(r[1],r[2]/100,r[3]/100,1):(r=Yx.exec(t))?gh(r[1],r[2]/100,r[3]/100,r[4]):ch.hasOwnProperty(t)?ph(ch[t]):t==="transparent"?new Qn(NaN,NaN,NaN,0):null}function ph(t){return new Qn(t>>16&255,t>>8&255,t&255,1)}function ql(t,r,i,s){return s<=0&&(t=r=i=NaN),new Qn(t,r,i,s)}function Gx(t){return t instanceof Ra||(t=Fi(t)),t?(t=t.rgb(),new Qn(t.r,t.g,t.b,t.opacity)):new Qn}function Ef(t,r,i,s){return arguments.length===1?Gx(t):new Qn(t,r,i,s??1)}function Qn(t,r,i,s){this.r=+t,this.g=+r,this.b=+i,this.opacity=+s}Vf(Qn,Ef,Hm(Ra,{brighter(t){return t=t==null?fu:Math.pow(fu,t),new Qn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ea:Math.pow(Ea,t),new Qn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Qn(Di(this.r),Di(this.g),Di(this.b),du(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:hh,formatHex:hh,formatHex8:Jx,formatRgb:mh,toString:mh}));function hh(){return`#${Li(this.r)}${Li(this.g)}${Li(this.b)}`}function Jx(){return`#${Li(this.r)}${Li(this.g)}${Li(this.b)}${Li((isNaN(this.opacity)?1:this.opacity)*255)}`}function mh(){const t=du(this.opacity);return`${t===1?"rgb(":"rgba("}${Di(this.r)}, ${Di(this.g)}, ${Di(this.b)}${t===1?")":`, ${t})`}`}function du(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Di(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Li(t){return t=Di(t),(t<16?"0":"")+t.toString(16)}function gh(t,r,i,s){return s<=0?t=r=i=NaN:i<=0||i>=1?t=r=NaN:r<=0&&(t=NaN),new Lr(t,r,i,s)}function Vm(t){if(t instanceof Lr)return new Lr(t.h,t.s,t.l,t.opacity);if(t instanceof Ra||(t=Fi(t)),!t)return new Lr;if(t instanceof Lr)return t;t=t.rgb();var r=t.r/255,i=t.g/255,s=t.b/255,l=Math.min(r,i,s),c=Math.max(r,i,s),d=NaN,h=c-l,v=(c+l)/2;return h?(r===c?d=(i-s)/h+(i<s)*6:i===c?d=(s-r)/h+2:d=(r-i)/h+4,h/=v<.5?c+l:2-c-l,d*=60):h=v>0&&v<1?0:d,new Lr(d,h,v,t.opacity)}function Zx(t,r,i,s){return arguments.length===1?Vm(t):new Lr(t,r,i,s??1)}function Lr(t,r,i,s){this.h=+t,this.s=+r,this.l=+i,this.opacity=+s}Vf(Lr,Zx,Hm(Ra,{brighter(t){return t=t==null?fu:Math.pow(fu,t),new Lr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ea:Math.pow(Ea,t),new Lr(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,s=i+(i<.5?i:1-i)*r,l=2*i-s;return new Qn(of(t>=240?t-240:t+120,l,s),of(t,l,s),of(t<120?t+240:t-120,l,s),this.opacity)},clamp(){return new Lr(yh(this.h),Wl(this.s),Wl(this.l),du(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=du(this.opacity);return`${t===1?"hsl(":"hsla("}${yh(this.h)}, ${Wl(this.s)*100}%, ${Wl(this.l)*100}%${t===1?")":`, ${t})`}`}}));function yh(t){return t=(t||0)%360,t<0?t+360:t}function Wl(t){return Math.max(0,Math.min(1,t||0))}function of(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 Uf=t=>()=>t;function ew(t,r){return function(i){return t+i*r}}function tw(t,r,i){return t=Math.pow(t,i),r=Math.pow(r,i)-t,i=1/i,function(s){return Math.pow(t+s*r,i)}}function nw(t){return(t=+t)==1?Um:function(r,i){return i-r?tw(r,i,t):Uf(isNaN(r)?i:r)}}function Um(t,r){var i=r-t;return i?ew(t,i):Uf(isNaN(t)?r:t)}const pu=(function t(r){var i=nw(r);function s(l,c){var d=i((l=Ef(l)).r,(c=Ef(c)).r),h=i(l.g,c.g),v=i(l.b,c.b),b=Um(l.opacity,c.opacity);return function(S){return l.r=d(S),l.g=h(S),l.b=v(S),l.opacity=b(S),l+""}}return s.gamma=t,s})(1);function rw(t,r){r||(r=[]);var i=t?Math.min(r.length,t.length):0,s=r.slice(),l;return function(c){for(l=0;l<i;++l)s[l]=t[l]*(1-c)+r[l]*c;return s}}function ow(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function iw(t,r){var i=r?r.length:0,s=t?Math.min(i,t.length):0,l=new Array(s),c=new Array(i),d;for(d=0;d<s;++d)l[d]=_a(t[d],r[d]);for(;d<i;++d)c[d]=r[d];return function(h){for(d=0;d<s;++d)c[d]=l[d](h);return c}}function sw(t,r){var i=new Date;return t=+t,r=+r,function(s){return i.setTime(t*(1-s)+r*s),i}}function Zr(t,r){return t=+t,r=+r,function(i){return t*(1-i)+r*i}}function aw(t,r){var i={},s={},l;(t===null||typeof t!="object")&&(t={}),(r===null||typeof r!="object")&&(r={});for(l in r)l in t?i[l]=_a(t[l],r[l]):s[l]=r[l];return function(c){for(l in i)s[l]=i[l](c);return s}}var Cf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sf=new RegExp(Cf.source,"g");function lw(t){return function(){return t}}function uw(t){return function(r){return t(r)+""}}function Km(t,r){var i=Cf.lastIndex=sf.lastIndex=0,s,l,c,d=-1,h=[],v=[];for(t=t+"",r=r+"";(s=Cf.exec(t))&&(l=sf.exec(r));)(c=l.index)>i&&(c=r.slice(i,c),h[d]?h[d]+=c:h[++d]=c),(s=s[0])===(l=l[0])?h[d]?h[d]+=l:h[++d]=l:(h[++d]=null,v.push({i:d,x:Zr(s,l)})),i=sf.lastIndex;return i<r.length&&(c=r.slice(i),h[d]?h[d]+=c:h[++d]=c),h.length<2?v[0]?uw(v[0].x):lw(r):(r=v.length,function(b){for(var S=0,x;S<r;++S)h[(x=v[S]).i]=x.x(b);return h.join("")})}function _a(t,r){var i=typeof r,s;return r==null||i==="boolean"?Uf(r):(i==="number"?Zr:i==="string"?(s=Fi(r))?(r=s,pu):Km:r instanceof Fi?pu:r instanceof Date?sw:ow(r)?rw:Array.isArray(r)?iw:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?aw:Zr)(t,r)}var vh=180/Math.PI,jf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function qm(t,r,i,s,l,c){var d,h,v;return(d=Math.sqrt(t*t+r*r))&&(t/=d,r/=d),(v=t*i+r*s)&&(i-=t*v,s-=r*v),(h=Math.sqrt(i*i+s*s))&&(i/=h,s/=h,v/=h),t*s<r*i&&(t=-t,r=-r,v=-v,d=-d),{translateX:l,translateY:c,rotate:Math.atan2(r,t)*vh,skewX:Math.atan(v)*vh,scaleX:d,scaleY:h}}var Yl;function cw(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?jf:qm(r.a,r.b,r.c,r.d,r.e,r.f)}function fw(t){return t==null||(Yl||(Yl=document.createElementNS("http://www.w3.org/2000/svg","g")),Yl.setAttribute("transform",t),!(t=Yl.transform.baseVal.consolidate()))?jf:(t=t.matrix,qm(t.a,t.b,t.c,t.d,t.e,t.f))}function Wm(t,r,i,s){function l(b){return b.length?b.pop()+" ":""}function c(b,S,x,_,C,j){if(b!==x||S!==_){var $=C.push("translate(",null,r,null,i);j.push({i:$-4,x:Zr(b,x)},{i:$-2,x:Zr(S,_)})}else(x||_)&&C.push("translate("+x+r+_+i)}function d(b,S,x,_){b!==S?(b-S>180?S+=360:S-b>180&&(b+=360),_.push({i:x.push(l(x)+"rotate(",null,s)-2,x:Zr(b,S)})):S&&x.push(l(x)+"rotate("+S+s)}function h(b,S,x,_){b!==S?_.push({i:x.push(l(x)+"skewX(",null,s)-2,x:Zr(b,S)}):S&&x.push(l(x)+"skewX("+S+s)}function v(b,S,x,_,C,j){if(b!==x||S!==_){var $=C.push(l(C)+"scale(",null,",",null,")");j.push({i:$-4,x:Zr(b,x)},{i:$-2,x:Zr(S,_)})}else(x!==1||_!==1)&&C.push(l(C)+"scale("+x+","+_+")")}return function(b,S){var x=[],_=[];return b=t(b),S=t(S),c(b.translateX,b.translateY,S.translateX,S.translateY,x,_),d(b.rotate,S.rotate,x,_),h(b.skewX,S.skewX,x,_),v(b.scaleX,b.scaleY,S.scaleX,S.scaleY,x,_),b=S=null,function(C){for(var j=-1,$=_.length,T;++j<$;)x[(T=_[j]).i]=T.x(C);return x.join("")}}}var dw=Wm(cw,"px, ","px)","deg)"),pw=Wm(fw,", ",")",")"),hw=1e-12;function xh(t){return((t=Math.exp(t))+1/t)/2}function mw(t){return((t=Math.exp(t))-1/t)/2}function gw(t){return((t=Math.exp(2*t))-1)/(t+1)}const ou=(function t(r,i,s){function l(c,d){var h=c[0],v=c[1],b=c[2],S=d[0],x=d[1],_=d[2],C=S-h,j=x-v,$=C*C+j*j,T,I;if($<hw)I=Math.log(_/b)/r,T=function(W){return[h+W*C,v+W*j,b*Math.exp(r*W*I)]};else{var H=Math.sqrt($),P=(_*_-b*b+s*$)/(2*b*i*H),R=(_*_-b*b-s*$)/(2*_*i*H),B=Math.log(Math.sqrt(P*P+1)-P),V=Math.log(Math.sqrt(R*R+1)-R);I=(V-B)/r,T=function(W){var Q=W*I,de=xh(B),ke=b/(i*H)*(de*gw(r*Q+B)-mw(B));return[h+ke*C,v+ke*j,b*de/xh(r*Q+B)]}}return T.duration=I*1e3*r/Math.SQRT2,T}return l.rho=function(c){var d=Math.max(.001,+c),h=d*d,v=h*h;return t(d,h,v)},l})(Math.SQRT2,2,4);var $s=0,wa=0,va=0,Ym=1e3,hu,ba,mu=0,Bi=0,Cu=0,ja=typeof performance=="object"&&performance.now?performance:Date,Xm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Kf(){return Bi||(Xm(yw),Bi=ja.now()+Cu)}function yw(){Bi=0}function gu(){this._call=this._time=this._next=null}gu.prototype=Qm.prototype={constructor:gu,restart:function(t,r,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?Kf():+i)+(r==null?0:+r),!this._next&&ba!==this&&(ba?ba._next=this:hu=this,ba=this),this._call=t,this._time=i,Pf()},stop:function(){this._call&&(this._call=null,this._time=1/0,Pf())}};function Qm(t,r,i){var s=new gu;return s.restart(t,r,i),s}function vw(){Kf(),++$s;for(var t=hu,r;t;)(r=Bi-t._time)>=0&&t._call.call(void 0,r),t=t._next;--$s}function wh(){Bi=(mu=ja.now())+Cu,$s=wa=0;try{vw()}finally{$s=0,ww(),Bi=0}}function xw(){var t=ja.now(),r=t-mu;r>Ym&&(Cu-=r,mu=t)}function ww(){for(var t,r=hu,i,s=1/0;r;)r._call?(s>r._time&&(s=r._time),t=r,r=r._next):(i=r._next,r._next=null,r=t?t._next=i:hu=i);ba=t,Pf(s)}function Pf(t){if(!$s){wa&&(wa=clearTimeout(wa));var r=t-Bi;r>24?(t<1/0&&(wa=setTimeout(wh,t-ja.now()-Cu)),va&&(va=clearInterval(va))):(va||(mu=ja.now(),va=setInterval(xw,Ym)),$s=1,Xm(wh))}}function bh(t,r,i){var s=new gu;return r=r==null?0:+r,s.restart(l=>{s.stop(),t(l+r)},r,i),s}var bw=Nu("start","end","cancel","interrupt"),_w=[],Gm=0,_h=1,$f=2,iu=3,Sh=4,Mf=5,su=6;function ju(t,r,i,s,l,c){var d=t.__transition;if(!d)t.__transition={};else if(i in d)return;Sw(t,i,{name:r,index:s,group:l,on:bw,tween:_w,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:Gm})}function qf(t,r){var i=Fr(t,r);if(i.state>Gm)throw new Error("too late; already scheduled");return i}function ro(t,r){var i=Fr(t,r);if(i.state>iu)throw new Error("too late; already running");return i}function Fr(t,r){var i=t.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function Sw(t,r,i){var s=t.__transition,l;s[r]=i,i.timer=Qm(c,0,i.time);function c(b){i.state=_h,i.timer.restart(d,i.delay,i.time),i.delay<=b&&d(b-i.delay)}function d(b){var S,x,_,C;if(i.state!==_h)return v();for(S in s)if(C=s[S],C.name===i.name){if(C.state===iu)return bh(d);C.state===Sh?(C.state=su,C.timer.stop(),C.on.call("interrupt",t,t.__data__,C.index,C.group),delete s[S]):+S<r&&(C.state=su,C.timer.stop(),C.on.call("cancel",t,t.__data__,C.index,C.group),delete s[S])}if(bh(function(){i.state===iu&&(i.state=Sh,i.timer.restart(h,i.delay,i.time),h(b))}),i.state=$f,i.on.call("start",t,t.__data__,i.index,i.group),i.state===$f){for(i.state=iu,l=new Array(_=i.tween.length),S=0,x=-1;S<_;++S)(C=i.tween[S].value.call(t,t.__data__,i.index,i.group))&&(l[++x]=C);l.length=x+1}}function h(b){for(var S=b<i.duration?i.ease.call(null,b/i.duration):(i.timer.restart(v),i.state=Mf,1),x=-1,_=l.length;++x<_;)l[x].call(t,S);i.state===Mf&&(i.on.call("end",t,t.__data__,i.index,i.group),v())}function v(){i.state=su,i.timer.stop(),delete s[r];for(var b in s)return;delete t.__transition}}function au(t,r){var i=t.__transition,s,l,c=!0,d;if(i){r=r==null?null:r+"";for(d in i){if((s=i[d]).name!==r){c=!1;continue}l=s.state>$f&&s.state<Mf,s.state=su,s.timer.stop(),s.on.call(l?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete i[d]}c&&delete t.__transition}}function kw(t){return this.each(function(){au(this,t)})}function Nw(t,r){var i,s;return function(){var l=ro(this,t),c=l.tween;if(c!==i){s=i=c;for(var d=0,h=s.length;d<h;++d)if(s[d].name===r){s=s.slice(),s.splice(d,1);break}}l.tween=s}}function Ew(t,r,i){var s,l;if(typeof i!="function")throw new Error;return function(){var c=ro(this,t),d=c.tween;if(d!==s){l=(s=d).slice();for(var h={name:r,value:i},v=0,b=l.length;v<b;++v)if(l[v].name===r){l[v]=h;break}v===b&&l.push(h)}c.tween=l}}function Cw(t,r){var i=this._id;if(t+="",arguments.length<2){for(var s=Fr(this.node(),i).tween,l=0,c=s.length,d;l<c;++l)if((d=s[l]).name===t)return d.value;return null}return this.each((r==null?Nw:Ew)(i,t,r))}function Wf(t,r,i){var s=t._id;return t.each(function(){var l=ro(this,s);(l.value||(l.value={}))[r]=i.apply(this,arguments)}),function(l){return Fr(l,s).value[r]}}function Jm(t,r){var i;return(typeof r=="number"?Zr:r instanceof Fi?pu:(i=Fi(r))?(r=i,pu):Km)(t,r)}function jw(t){return function(){this.removeAttribute(t)}}function Pw(t){return function(){this.removeAttributeNS(t.space,t.local)}}function $w(t,r,i){var s,l=i+"",c;return function(){var d=this.getAttribute(t);return d===l?null:d===s?c:c=r(s=d,i)}}function Mw(t,r,i){var s,l=i+"",c;return function(){var d=this.getAttributeNS(t.space,t.local);return d===l?null:d===s?c:c=r(s=d,i)}}function Tw(t,r,i){var s,l,c;return function(){var d,h=i(this),v;return h==null?void this.removeAttribute(t):(d=this.getAttribute(t),v=h+"",d===v?null:d===s&&v===l?c:(l=v,c=r(s=d,h)))}}function Iw(t,r,i){var s,l,c;return function(){var d,h=i(this),v;return h==null?void this.removeAttributeNS(t.space,t.local):(d=this.getAttributeNS(t.space,t.local),v=h+"",d===v?null:d===s&&v===l?c:(l=v,c=r(s=d,h)))}}function Aw(t,r){var i=Eu(t),s=i==="transform"?pw:Jm;return this.attrTween(t,typeof r=="function"?(i.local?Iw:Tw)(i,s,Wf(this,"attr."+t,r)):r==null?(i.local?Pw:jw)(i):(i.local?Mw:$w)(i,s,r))}function Ow(t,r){return function(i){this.setAttribute(t,r.call(this,i))}}function Rw(t,r){return function(i){this.setAttributeNS(t.space,t.local,r.call(this,i))}}function Lw(t,r){var i,s;function l(){var c=r.apply(this,arguments);return c!==s&&(i=(s=c)&&Rw(t,c)),i}return l._value=r,l}function Dw(t,r){var i,s;function l(){var c=r.apply(this,arguments);return c!==s&&(i=(s=c)&&Ow(t,c)),i}return l._value=r,l}function zw(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 s=Eu(t);return this.tween(i,(s.local?Lw:Dw)(s,r))}function Fw(t,r){return function(){qf(this,t).delay=+r.apply(this,arguments)}}function Bw(t,r){return r=+r,function(){qf(this,t).delay=r}}function Hw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Fw:Bw)(r,t)):Fr(this.node(),r).delay}function Vw(t,r){return function(){ro(this,t).duration=+r.apply(this,arguments)}}function Uw(t,r){return r=+r,function(){ro(this,t).duration=r}}function Kw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Vw:Uw)(r,t)):Fr(this.node(),r).duration}function qw(t,r){if(typeof r!="function")throw new Error;return function(){ro(this,t).ease=r}}function Ww(t){var r=this._id;return arguments.length?this.each(qw(r,t)):Fr(this.node(),r).ease}function Yw(t,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;ro(this,t).ease=i}}function Xw(t){if(typeof t!="function")throw new Error;return this.each(Yw(this._id,t))}function Qw(t){typeof t!="function"&&(t=Pm(t));for(var r=this._groups,i=r.length,s=new Array(i),l=0;l<i;++l)for(var c=r[l],d=c.length,h=s[l]=[],v,b=0;b<d;++b)(v=c[b])&&t.call(v,v.__data__,b,c)&&h.push(v);return new Ao(s,this._parents,this._name,this._id)}function Gw(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,i=t._groups,s=r.length,l=i.length,c=Math.min(s,l),d=new Array(s),h=0;h<c;++h)for(var v=r[h],b=i[h],S=v.length,x=d[h]=new Array(S),_,C=0;C<S;++C)(_=v[C]||b[C])&&(x[C]=_);for(;h<s;++h)d[h]=r[h];return new Ao(d,this._parents,this._name,this._id)}function Jw(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 Zw(t,r,i){var s,l,c=Jw(r)?qf:ro;return function(){var d=c(this,t),h=d.on;h!==s&&(l=(s=h).copy()).on(r,i),d.on=l}}function e1(t,r){var i=this._id;return arguments.length<2?Fr(this.node(),i).on.on(t):this.each(Zw(i,t,r))}function t1(t){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==t)return;r&&r.removeChild(this)}}function n1(){return this.on("end.remove",t1(this._id))}function r1(t){var r=this._name,i=this._id;typeof t!="function"&&(t=Bf(t));for(var s=this._groups,l=s.length,c=new Array(l),d=0;d<l;++d)for(var h=s[d],v=h.length,b=c[d]=new Array(v),S,x,_=0;_<v;++_)(S=h[_])&&(x=t.call(S,S.__data__,_,h))&&("__data__"in S&&(x.__data__=S.__data__),b[_]=x,ju(b[_],r,i,_,b,Fr(S,i)));return new Ao(c,this._parents,r,i)}function o1(t){var r=this._name,i=this._id;typeof t!="function"&&(t=jm(t));for(var s=this._groups,l=s.length,c=[],d=[],h=0;h<l;++h)for(var v=s[h],b=v.length,S,x=0;x<b;++x)if(S=v[x]){for(var _=t.call(S,S.__data__,x,v),C,j=Fr(S,i),$=0,T=_.length;$<T;++$)(C=_[$])&&ju(C,r,i,$,_,j);c.push(_),d.push(S)}return new Ao(c,d,r,i)}var i1=Oa.prototype.constructor;function s1(){return new i1(this._groups,this._parents)}function a1(t,r){var i,s,l;return function(){var c=Ps(this,t),d=(this.style.removeProperty(t),Ps(this,t));return c===d?null:c===i&&d===s?l:l=r(i=c,s=d)}}function Zm(t){return function(){this.style.removeProperty(t)}}function l1(t,r,i){var s,l=i+"",c;return function(){var d=Ps(this,t);return d===l?null:d===s?c:c=r(s=d,i)}}function u1(t,r,i){var s,l,c;return function(){var d=Ps(this,t),h=i(this),v=h+"";return h==null&&(v=h=(this.style.removeProperty(t),Ps(this,t))),d===v?null:d===s&&v===l?c:(l=v,c=r(s=d,h))}}function c1(t,r){var i,s,l,c="style."+r,d="end."+c,h;return function(){var v=ro(this,t),b=v.on,S=v.value[c]==null?h||(h=Zm(r)):void 0;(b!==i||l!==S)&&(s=(i=b).copy()).on(d,l=S),v.on=s}}function f1(t,r,i){var s=(t+="")=="transform"?dw:Jm;return r==null?this.styleTween(t,a1(t,s)).on("end.style."+t,Zm(t)):typeof r=="function"?this.styleTween(t,u1(t,s,Wf(this,"style."+t,r))).each(c1(this._id,t)):this.styleTween(t,l1(t,s,r),i).on("end.style."+t,null)}function d1(t,r,i){return function(s){this.style.setProperty(t,r.call(this,s),i)}}function p1(t,r,i){var s,l;function c(){var d=r.apply(this,arguments);return d!==l&&(s=(l=d)&&d1(t,d,i)),s}return c._value=r,c}function h1(t,r,i){var s="style."+(t+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(r==null)return this.tween(s,null);if(typeof r!="function")throw new Error;return this.tween(s,p1(t,r,i??""))}function m1(t){return function(){this.textContent=t}}function g1(t){return function(){var r=t(this);this.textContent=r??""}}function y1(t){return this.tween("text",typeof t=="function"?g1(Wf(this,"text",t)):m1(t==null?"":t+""))}function v1(t){return function(r){this.textContent=t.call(this,r)}}function x1(t){var r,i;function s(){var l=t.apply(this,arguments);return l!==i&&(r=(i=l)&&v1(l)),r}return s._value=t,s}function w1(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,x1(t))}function b1(){for(var t=this._name,r=this._id,i=e0(),s=this._groups,l=s.length,c=0;c<l;++c)for(var d=s[c],h=d.length,v,b=0;b<h;++b)if(v=d[b]){var S=Fr(v,r);ju(v,t,i,b,d,{time:S.time+S.delay+S.duration,delay:0,duration:S.duration,ease:S.ease})}return new Ao(s,this._parents,t,i)}function _1(){var t,r,i=this,s=i._id,l=i.size();return new Promise(function(c,d){var h={value:d},v={value:function(){--l===0&&c()}};i.each(function(){var b=ro(this,s),S=b.on;S!==t&&(r=(t=S).copy(),r._.cancel.push(h),r._.interrupt.push(h),r._.end.push(v)),b.on=r}),l===0&&c()})}var S1=0;function Ao(t,r,i,s){this._groups=t,this._parents=r,this._name=i,this._id=s}function e0(){return++S1}var Mo=Oa.prototype;Ao.prototype={constructor:Ao,select:r1,selectAll:o1,selectChild:Mo.selectChild,selectChildren:Mo.selectChildren,filter:Qw,merge:Gw,selection:s1,transition:b1,call:Mo.call,nodes:Mo.nodes,node:Mo.node,size:Mo.size,empty:Mo.empty,each:Mo.each,on:e1,attr:Aw,attrTween:zw,style:f1,styleTween:h1,text:y1,textTween:w1,remove:n1,tween:Cw,delay:Hw,duration:Kw,ease:Ww,easeVarying:Xw,end:_1,[Symbol.iterator]:Mo[Symbol.iterator]};function k1(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var N1={time:null,delay:0,duration:250,ease:k1};function E1(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 C1(t){var r,i;t instanceof Ao?(r=t._id,t=t._name):(r=e0(),(i=N1).time=Kf(),t=t==null?null:t+"");for(var s=this._groups,l=s.length,c=0;c<l;++c)for(var d=s[c],h=d.length,v,b=0;b<h;++b)(v=d[b])&&ju(v,t,r,b,d,i||E1(v,r));return new Ao(s,this._parents,t,r)}Oa.prototype.interrupt=kw;Oa.prototype.transition=C1;const Xl=t=>()=>t;function j1(t,{sourceEvent:r,target:i,transform:s,dispatch:l}){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:s,enumerable:!0,configurable:!0},_:{value:l}})}function To(t,r,i){this.k=t,this.x=r,this.y=i}To.prototype={constructor:To,scale:function(t){return t===1?this:new To(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new To(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 Pu=new To(1,0,0);t0.prototype=To.prototype;function t0(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Pu;return t.__zoom}function af(t){t.stopImmediatePropagation()}function xa(t){t.preventDefault(),t.stopImmediatePropagation()}function P1(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function $1(){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 kh(){return this.__zoom||Pu}function M1(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function T1(){return navigator.maxTouchPoints||"ontouchstart"in this}function I1(t,r,i){var s=t.invertX(r[0][0])-i[0][0],l=t.invertX(r[1][0])-i[1][0],c=t.invertY(r[0][1])-i[0][1],d=t.invertY(r[1][1])-i[1][1];return t.translate(l>s?(s+l)/2:Math.min(0,s)||Math.max(0,l),d>c?(c+d)/2:Math.min(0,c)||Math.max(0,d))}function n0(){var t=P1,r=$1,i=I1,s=M1,l=T1,c=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],h=250,v=ou,b=Nu("start","zoom","end"),S,x,_,C=500,j=150,$=0,T=10;function I(D){D.property("__zoom",kh).on("wheel.zoom",Q,{passive:!1}).on("mousedown.zoom",de).on("dblclick.zoom",ke).filter(l).on("touchstart.zoom",Y).on("touchmove.zoom",fe).on("touchend.zoom touchcancel.zoom",ve).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}I.transform=function(D,ue,G,se){var F=D.selection?D.selection():D;F.property("__zoom",kh),D!==F?B(D,ue,G,se):F.interrupt().each(function(){V(this,arguments).event(se).start().zoom(null,typeof ue=="function"?ue.apply(this,arguments):ue).end()})},I.scaleBy=function(D,ue,G,se){I.scaleTo(D,function(){var F=this.__zoom.k,q=typeof ue=="function"?ue.apply(this,arguments):ue;return F*q},G,se)},I.scaleTo=function(D,ue,G,se){I.transform(D,function(){var F=r.apply(this,arguments),q=this.__zoom,Z=G==null?R(F):typeof G=="function"?G.apply(this,arguments):G,A=q.invert(Z),K=typeof ue=="function"?ue.apply(this,arguments):ue;return i(P(H(q,K),Z,A),F,d)},G,se)},I.translateBy=function(D,ue,G,se){I.transform(D,function(){return i(this.__zoom.translate(typeof ue=="function"?ue.apply(this,arguments):ue,typeof G=="function"?G.apply(this,arguments):G),r.apply(this,arguments),d)},null,se)},I.translateTo=function(D,ue,G,se,F){I.transform(D,function(){var q=r.apply(this,arguments),Z=this.__zoom,A=se==null?R(q):typeof se=="function"?se.apply(this,arguments):se;return i(Pu.translate(A[0],A[1]).scale(Z.k).translate(typeof ue=="function"?-ue.apply(this,arguments):-ue,typeof G=="function"?-G.apply(this,arguments):-G),q,d)},se,F)};function H(D,ue){return ue=Math.max(c[0],Math.min(c[1],ue)),ue===D.k?D:new To(ue,D.x,D.y)}function P(D,ue,G){var se=ue[0]-G[0]*D.k,F=ue[1]-G[1]*D.k;return se===D.x&&F===D.y?D:new To(D.k,se,F)}function R(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function B(D,ue,G,se){D.on("start.zoom",function(){V(this,arguments).event(se).start()}).on("interrupt.zoom end.zoom",function(){V(this,arguments).event(se).end()}).tween("zoom",function(){var F=this,q=arguments,Z=V(F,q).event(se),A=r.apply(F,q),K=G==null?R(A):typeof G=="function"?G.apply(F,q):G,pe=Math.max(A[1][0]-A[0][0],A[1][1]-A[0][1]),be=F.__zoom,$e=typeof ue=="function"?ue.apply(F,q):ue,Ae=v(be.invert(K).concat(pe/be.k),$e.invert(K).concat(pe/$e.k));return function(Oe){if(Oe===1)Oe=$e;else{var Se=Ae(Oe),De=pe/Se[2];Oe=new To(De,K[0]-Se[0]*De,K[1]-Se[1]*De)}Z.zoom(null,Oe)}})}function V(D,ue,G){return!G&&D.__zooming||new W(D,ue)}function W(D,ue){this.that=D,this.args=ue,this.active=0,this.sourceEvent=null,this.extent=r.apply(D,ue),this.taps=0}W.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,ue){return this.mouse&&D!=="mouse"&&(this.mouse[1]=ue.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=ue.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=ue.invert(this.touch1[0])),this.that.__zoom=ue,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var ue=sr(this.that).datum();b.call(D,this.that,new j1(D,{sourceEvent:this.sourceEvent,target:I,transform:this.that.__zoom,dispatch:b}),ue)}};function Q(D,...ue){if(!t.apply(this,arguments))return;var G=V(this,ue).event(D),se=this.__zoom,F=Math.max(c[0],Math.min(c[1],se.k*Math.pow(2,s.apply(this,arguments)))),q=Rr(D);if(G.wheel)(G.mouse[0][0]!==q[0]||G.mouse[0][1]!==q[1])&&(G.mouse[1]=se.invert(G.mouse[0]=q)),clearTimeout(G.wheel);else{if(se.k===F)return;G.mouse=[q,se.invert(q)],au(this),G.start()}xa(D),G.wheel=setTimeout(Z,j),G.zoom("mouse",i(P(H(se,F),G.mouse[0],G.mouse[1]),G.extent,d));function Z(){G.wheel=null,G.end()}}function de(D,...ue){if(_||!t.apply(this,arguments))return;var G=D.currentTarget,se=V(this,ue,!0).event(D),F=sr(D.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",pe,!0),q=Rr(D,G),Z=D.clientX,A=D.clientY;zm(D.view),af(D),se.mouse=[q,this.__zoom.invert(q)],au(this),se.start();function K(be){if(xa(be),!se.moved){var $e=be.clientX-Z,Ae=be.clientY-A;se.moved=$e*$e+Ae*Ae>$}se.event(be).zoom("mouse",i(P(se.that.__zoom,se.mouse[0]=Rr(be,G),se.mouse[1]),se.extent,d))}function pe(be){F.on("mousemove.zoom mouseup.zoom",null),Fm(be.view,se.moved),xa(be),se.event(be).end()}}function ke(D,...ue){if(t.apply(this,arguments)){var G=this.__zoom,se=Rr(D.changedTouches?D.changedTouches[0]:D,this),F=G.invert(se),q=G.k*(D.shiftKey?.5:2),Z=i(P(H(G,q),se,F),r.apply(this,ue),d);xa(D),h>0?sr(this).transition().duration(h).call(B,Z,se,D):sr(this).call(I.transform,Z,se,D)}}function Y(D,...ue){if(t.apply(this,arguments)){var G=D.touches,se=G.length,F=V(this,ue,D.changedTouches.length===se).event(D),q,Z,A,K;for(af(D),Z=0;Z<se;++Z)A=G[Z],K=Rr(A,this),K=[K,this.__zoom.invert(K),A.identifier],F.touch0?!F.touch1&&F.touch0[2]!==K[2]&&(F.touch1=K,F.taps=0):(F.touch0=K,q=!0,F.taps=1+!!S);S&&(S=clearTimeout(S)),q&&(F.taps<2&&(x=K[0],S=setTimeout(function(){S=null},C)),au(this),F.start())}}function fe(D,...ue){if(this.__zooming){var G=V(this,ue).event(D),se=D.changedTouches,F=se.length,q,Z,A,K;for(xa(D),q=0;q<F;++q)Z=se[q],A=Rr(Z,this),G.touch0&&G.touch0[2]===Z.identifier?G.touch0[0]=A:G.touch1&&G.touch1[2]===Z.identifier&&(G.touch1[0]=A);if(Z=G.that.__zoom,G.touch1){var pe=G.touch0[0],be=G.touch0[1],$e=G.touch1[0],Ae=G.touch1[1],Oe=(Oe=$e[0]-pe[0])*Oe+(Oe=$e[1]-pe[1])*Oe,Se=(Se=Ae[0]-be[0])*Se+(Se=Ae[1]-be[1])*Se;Z=H(Z,Math.sqrt(Oe/Se)),A=[(pe[0]+$e[0])/2,(pe[1]+$e[1])/2],K=[(be[0]+Ae[0])/2,(be[1]+Ae[1])/2]}else if(G.touch0)A=G.touch0[0],K=G.touch0[1];else return;G.zoom("touch",i(P(Z,A,K),G.extent,d))}}function ve(D,...ue){if(this.__zooming){var G=V(this,ue).event(D),se=D.changedTouches,F=se.length,q,Z;for(af(D),_&&clearTimeout(_),_=setTimeout(function(){_=null},C),q=0;q<F;++q)Z=se[q],G.touch0&&G.touch0[2]===Z.identifier?delete G.touch0:G.touch1&&G.touch1[2]===Z.identifier&&delete G.touch1;if(G.touch1&&!G.touch0&&(G.touch0=G.touch1,delete G.touch1),G.touch0)G.touch0[1]=this.__zoom.invert(G.touch0[0]);else if(G.end(),G.taps===2&&(Z=Rr(Z,this),Math.hypot(x[0]-Z[0],x[1]-Z[1])<T)){var A=sr(this).on("dblclick.zoom");A&&A.apply(this,arguments)}}}return I.wheelDelta=function(D){return arguments.length?(s=typeof D=="function"?D:Xl(+D),I):s},I.filter=function(D){return arguments.length?(t=typeof D=="function"?D:Xl(!!D),I):t},I.touchable=function(D){return arguments.length?(l=typeof D=="function"?D:Xl(!!D),I):l},I.extent=function(D){return arguments.length?(r=typeof D=="function"?D:Xl([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),I):r},I.scaleExtent=function(D){return arguments.length?(c[0]=+D[0],c[1]=+D[1],I):[c[0],c[1]]},I.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],I):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},I.constrain=function(D){return arguments.length?(i=D,I):i},I.duration=function(D){return arguments.length?(h=+D,I):h},I.interpolate=function(D){return arguments.length?(v=D,I):v},I.on=function(){var D=b.on.apply(b,arguments);return D===b?I:D},I.clickDistance=function(D){return arguments.length?($=(D=+D)*D,I):Math.sqrt($)},I.tapDistance=function(D){return arguments.length?(T=+D,I):T},I}const to={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:s})=>`Couldn't create edge for ${t} handle id: "${t==="source"?i:s}", 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."},Pa=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],r0=["Enter"," ","Escape"],o0={"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 zi;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(zi||(zi={}));var $a;(function(t){t.Partial="partial",t.Full="full"})($a||($a={}));const i0={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var di;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(di||(di={}));var yu;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(yu||(yu={}));var tt;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(tt||(tt={}));const Nh={[tt.Left]:tt.Right,[tt.Right]:tt.Left,[tt.Top]:tt.Bottom,[tt.Bottom]:tt.Top};function s0(t){return t===null?null:t?"valid":"invalid"}const a0=t=>"id"in t&&"source"in t&&"target"in t,A1=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Yf=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),La=(t,r=[0,0])=>{const{width:i,height:s}=Oo(t),l=t.origin??r,c=i*l[0],d=s*l[1];return{x:t.position.x-c,y:t.position.y-d}},O1=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const i=t.reduce((s,l)=>{const c=typeof l=="string";let d=!r.nodeLookup&&!c?l:void 0;r.nodeLookup&&(d=c?r.nodeLookup.get(l):Yf(l)?l:r.nodeLookup.get(l.id));const h=d?vu(d,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return $u(s,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Mu(i)},Da=(t,r={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return t.forEach(l=>{(r.filter===void 0||r.filter(l))&&(i=$u(i,vu(l)),s=!0)}),s?Mu(i):{x:0,y:0,width:0,height:0}},Xf=(t,r,[i,s,l]=[0,0,1],c=!1,d=!1)=>{const h={...Fa(r,[i,s,l]),width:r.width/l,height:r.height/l},v=[];for(const b of t.values()){const{measured:S,selectable:x=!0,hidden:_=!1}=b;if(d&&!x||_)continue;const C=S.width??b.width??b.initialWidth??null,j=S.height??b.height??b.initialHeight??null,$=Ma(h,Is(b)),T=(C??0)*(j??0),I=c&&$>0;(!b.internals.handleBounds||I||$>=T||b.dragging)&&v.push(b)}return v},R1=(t,r)=>{const i=new Set;return t.forEach(s=>{i.add(s.id)}),r.filter(s=>i.has(s.source)||i.has(s.target))};function L1(t,r){const i=new Map,s=r!=null&&r.nodes?new Set(r.nodes.map(l=>l.id)):null;return t.forEach(l=>{l.measured.width&&l.measured.height&&((r==null?void 0:r.includeHiddenNodes)||!l.hidden)&&(!s||s.has(l.id))&&i.set(l.id,l)}),i}async function D1({nodes:t,width:r,height:i,panZoom:s,minZoom:l,maxZoom:c},d){if(t.size===0)return Promise.resolve(!0);const h=L1(t,d),v=Da(h),b=Qf(v,r,i,(d==null?void 0:d.minZoom)??l,(d==null?void 0:d.maxZoom)??c,(d==null?void 0:d.padding)??.1);return await s.setViewport(b,{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 l0({nodeId:t,nextPosition:r,nodeLookup:i,nodeOrigin:s=[0,0],nodeExtent:l,onError:c}){const d=i.get(t),h=d.parentId?i.get(d.parentId):void 0,{x:v,y:b}=h?h.internals.positionAbsolute:{x:0,y:0},S=d.origin??s;let x=d.extent||l;if(d.extent==="parent"&&!d.expandParent)if(!h)c==null||c("005",to.error005());else{const C=h.measured.width,j=h.measured.height;C&&j&&(x=[[v,b],[v+C,b+j]])}else h&&As(d.extent)&&(x=[[d.extent[0][0]+v,d.extent[0][1]+b],[d.extent[1][0]+v,d.extent[1][1]+b]]);const _=As(x)?Hi(r,x,d.measured):r;return(d.measured.width===void 0||d.measured.height===void 0)&&(c==null||c("015",to.error015())),{position:{x:_.x-v+(d.measured.width??0)*S[0],y:_.y-b+(d.measured.height??0)*S[1]},positionAbsolute:_}}async function z1({nodesToRemove:t=[],edgesToRemove:r=[],nodes:i,edges:s,onBeforeDelete:l}){const c=new Set(t.map(_=>_.id)),d=[];for(const _ of i){if(_.deletable===!1)continue;const C=c.has(_.id),j=!C&&_.parentId&&d.find($=>$.id===_.parentId);(C||j)&&d.push(_)}const h=new Set(r.map(_=>_.id)),v=s.filter(_=>_.deletable!==!1),S=R1(d,v);for(const _ of v)h.has(_.id)&&!S.find(j=>j.id===_.id)&&S.push(_);if(!l)return{edges:S,nodes:d};const x=await l({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),Hi=(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 u0(t,r,i){const{width:s,height:l}=Oo(i),{x:c,y:d}=i.internals.positionAbsolute;return Hi(t,[[c,d],[c+s,d+l]],r)}const Eh=(t,r,i)=>t<r?Ts(Math.abs(t-r),1,r)/r:t>i?-Ts(Math.abs(t-i),1,r)/r:0,c0=(t,r,i=15,s=40)=>{const l=Eh(t.x,s,r.width-s)*i,c=Eh(t.y,s,r.height-s)*i;return[l,c]},$u=(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)}),Tf=({x:t,y:r,width:i,height:s})=>({x:t,y:r,x2:t+i,y2:r+s}),Mu=({x:t,y:r,x2:i,y2:s})=>({x:t,y:r,width:i-t,height:s-r}),Is=(t,r=[0,0])=>{var l,c;const{x:i,y:s}=Yf(t)?t.internals.positionAbsolute:La(t,r);return{x:i,y:s,width:((l=t.measured)==null?void 0:l.width)??t.width??t.initialWidth??0,height:((c=t.measured)==null?void 0:c.height)??t.height??t.initialHeight??0}},vu=(t,r=[0,0])=>{var l,c;const{x:i,y:s}=Yf(t)?t.internals.positionAbsolute:La(t,r);return{x:i,y:s,x2:i+(((l=t.measured)==null?void 0:l.width)??t.width??t.initialWidth??0),y2:s+(((c=t.measured)==null?void 0:c.height)??t.height??t.initialHeight??0)}},f0=(t,r)=>Mu($u(Tf(t),Tf(r))),Ma=(t,r)=>{const i=Math.max(0,Math.min(t.x+t.width,r.x+r.width)-Math.max(t.x,r.x)),s=Math.max(0,Math.min(t.y+t.height,r.y+r.height)-Math.max(t.y,r.y));return Math.ceil(i*s)},Ch=t=>Dr(t.width)&&Dr(t.height)&&Dr(t.x)&&Dr(t.y),Dr=t=>!isNaN(t)&&isFinite(t),F1=(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])}),Fa=({x:t,y:r},[i,s,l],c=!1,d=[1,1])=>{const h={x:(t-i)/l,y:(r-s)/l};return c?za(h,d):h},xu=({x:t,y:r},[i,s,l])=>({x:t*l+i,y:r*l+s});function Ss(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 B1(t,r,i){if(typeof t=="string"||typeof t=="number"){const s=Ss(t,i),l=Ss(t,r);return{top:s,right:l,bottom:s,left:l,x:l*2,y:s*2}}if(typeof t=="object"){const s=Ss(t.top??t.y??0,i),l=Ss(t.bottom??t.y??0,i),c=Ss(t.left??t.x??0,r),d=Ss(t.right??t.x??0,r);return{top:s,right:d,bottom:l,left:c,x:c+d,y:s+l}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function H1(t,r,i,s,l,c){const{x:d,y:h}=xu(t,[r,i,s]),{x:v,y:b}=xu({x:t.x+t.width,y:t.y+t.height},[r,i,s]),S=l-v,x=c-b;return{left:Math.floor(d),top:Math.floor(h),right:Math.floor(S),bottom:Math.floor(x)}}const Qf=(t,r,i,s,l,c)=>{const d=B1(c,r,i),h=(r-d.x)/t.width,v=(i-d.y)/t.height,b=Math.min(h,v),S=Ts(b,s,l),x=t.x+t.width/2,_=t.y+t.height/2,C=r/2-x*S,j=i/2-_*S,$=H1(t,C,j,S,r,i),T={left:Math.min($.left-d.left,0),top:Math.min($.top-d.top,0),right:Math.min($.right-d.right,0),bottom:Math.min($.bottom-d.bottom,0)};return{x:C-T.left+T.right,y:j-T.top+T.bottom,zoom:S}},Ta=()=>{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 Oo(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 d0(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 p0(t,r={width:0,height:0},i,s,l){const c={...t},d=s.get(i);if(d){const h=d.origin||l;c.x+=d.internals.positionAbsolute.x-(r.width??0)*h[0],c.y+=d.internals.positionAbsolute.y-(r.height??0)*h[1]}return c}function jh(t,r){if(t.size!==r.size)return!1;for(const i of t)if(!r.has(i))return!1;return!0}function V1(){let t,r;return{promise:new Promise((s,l)=>{t=s,r=l}),resolve:t,reject:r}}function U1(t){return{...o0,...t||{}}}function Sa(t,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:s,containerBounds:l}){const{x:c,y:d}=zr(t),h=Fa({x:c-((l==null?void 0:l.left)??0),y:d-((l==null?void 0:l.top)??0)},s),{x:v,y:b}=i?za(h,r):h;return{xSnapped:v,ySnapped:b,...h}}const Gf=t=>({width:t.offsetWidth,height:t.offsetHeight}),h0=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},K1=["INPUT","SELECT","TEXTAREA"];function m0(t){var s,l;const r=((l=(s=t.composedPath)==null?void 0:s.call(t))==null?void 0:l[0])||t.target;return(r==null?void 0:r.nodeType)!==1?!1:K1.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const g0=t=>"clientX"in t,zr=(t,r)=>{var c,d;const i=g0(t),s=i?t.clientX:(c=t.touches)==null?void 0:c[0].clientX,l=i?t.clientY:(d=t.touches)==null?void 0:d[0].clientY;return{x:s-((r==null?void 0:r.left)??0),y:l-((r==null?void 0:r.top)??0)}},Ph=(t,r,i,s,l)=>{const c=r.querySelectorAll(`.${t}`);return!c||!c.length?null:Array.from(c).map(d=>{const h=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:t,nodeId:l,position:d.getAttribute("data-handlepos"),x:(h.left-i.left)/s,y:(h.top-i.top)/s,...Gf(d)}})};function y0({sourceX:t,sourceY:r,targetX:i,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:h}){const v=t*.125+l*.375+d*.375+i*.125,b=r*.125+c*.375+h*.375+s*.125,S=Math.abs(v-t),x=Math.abs(b-r);return[v,b,S,x]}function Ql(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function $h({pos:t,x1:r,y1:i,x2:s,y2:l,c}){switch(t){case tt.Left:return[r-Ql(r-s,c),i];case tt.Right:return[r+Ql(s-r,c),i];case tt.Top:return[r,i-Ql(i-l,c)];case tt.Bottom:return[r,i+Ql(l-i,c)]}}function v0({sourceX:t,sourceY:r,sourcePosition:i=tt.Bottom,targetX:s,targetY:l,targetPosition:c=tt.Top,curvature:d=.25}){const[h,v]=$h({pos:i,x1:t,y1:r,x2:s,y2:l,c:d}),[b,S]=$h({pos:c,x1:s,y1:l,x2:t,y2:r,c:d}),[x,_,C,j]=y0({sourceX:t,sourceY:r,targetX:s,targetY:l,sourceControlX:h,sourceControlY:v,targetControlX:b,targetControlY:S});return[`M${t},${r} C${h},${v} ${b},${S} ${s},${l}`,x,_,C,j]}function x0({sourceX:t,sourceY:r,targetX:i,targetY:s}){const l=Math.abs(i-t)/2,c=i<t?i+l:i-l,d=Math.abs(s-r)/2,h=s<r?s+d:s-d;return[c,h,l,d]}function q1({sourceNode:t,targetNode:r,selected:i=!1,zIndex:s=0,elevateOnSelect:l=!1,zIndexMode:c="basic"}){if(c==="manual")return s;const d=l&&i?s+1e3:s,h=Math.max(t.parentId||l&&t.selected?t.internals.z:0,r.parentId||l&&r.selected?r.internals.z:0);return d+h}function W1({sourceNode:t,targetNode:r,width:i,height:s,transform:l}){const c=$u(vu(t),vu(r));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d={x:-l[0]/l[2],y:-l[1]/l[2],width:i/l[2],height:s/l[2]};return Ma(d,Mu(c))>0}const Y1=({source:t,sourceHandle:r,target:i,targetHandle:s})=>`xy-edge__${t}${r||""}-${i}${s||""}`,X1=(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)),w0=(t,r,i={})=>{if(!t.source||!t.target)return r;const s=i.getEdgeId||Y1;let l;return a0(t)?l={...t}:l={...t,id:s(t)},X1(l,r)?r:(l.sourceHandle===null&&delete l.sourceHandle,l.targetHandle===null&&delete l.targetHandle,r.concat(l))};function b0({sourceX:t,sourceY:r,targetX:i,targetY:s}){const[l,c,d,h]=x0({sourceX:t,sourceY:r,targetX:i,targetY:s});return[`M ${t},${r}L ${i},${s}`,l,c,d,h]}const Mh={[tt.Left]:{x:-1,y:0},[tt.Right]:{x:1,y:0},[tt.Top]:{x:0,y:-1},[tt.Bottom]:{x:0,y:1}},Q1=({source:t,sourcePosition:r=tt.Bottom,target:i})=>r===tt.Left||r===tt.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},Th=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function G1({source:t,sourcePosition:r=tt.Bottom,target:i,targetPosition:s=tt.Top,center:l,offset:c,stepPosition:d}){const h=Mh[r],v=Mh[s],b={x:t.x+h.x*c,y:t.y+h.y*c},S={x:i.x+v.x*c,y:i.y+v.y*c},x=Q1({source:b,sourcePosition:r,target:S}),_=x.x!==0?"x":"y",C=x[_];let j=[],$,T;const I={x:0,y:0},H={x:0,y:0},[,,P,R]=x0({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(h[_]*v[_]===-1){_==="x"?($=l.x??b.x+(S.x-b.x)*d,T=l.y??(b.y+S.y)/2):($=l.x??(b.x+S.x)/2,T=l.y??b.y+(S.y-b.y)*d);const Q=[{x:$,y:b.y},{x:$,y:S.y}],de=[{x:b.x,y:T},{x:S.x,y:T}];h[_]===C?j=_==="x"?Q:de:j=_==="x"?de:Q}else{const Q=[{x:b.x,y:S.y}],de=[{x:S.x,y:b.y}];if(_==="x"?j=h.x===C?de:Q:j=h.y===C?Q:de,r===s){const D=Math.abs(t[_]-i[_]);if(D<=c){const ue=Math.min(c-1,c-D);h[_]===C?I[_]=(b[_]>t[_]?-1:1)*ue:H[_]=(S[_]>i[_]?-1:1)*ue}}if(r!==s){const D=_==="x"?"y":"x",ue=h[_]===v[D],G=b[D]>S[D],se=b[D]<S[D];(h[_]===1&&(!ue&&G||ue&&se)||h[_]!==1&&(!ue&&se||ue&&G))&&(j=_==="x"?Q:de)}const ke={x:b.x+I.x,y:b.y+I.y},Y={x:S.x+H.x,y:S.y+H.y},fe=Math.max(Math.abs(ke.x-j[0].x),Math.abs(Y.x-j[0].x)),ve=Math.max(Math.abs(ke.y-j[0].y),Math.abs(Y.y-j[0].y));fe>=ve?($=(ke.x+Y.x)/2,T=j[0].y):($=j[0].x,T=(ke.y+Y.y)/2)}const B={x:b.x+I.x,y:b.y+I.y},V={x:S.x+H.x,y:S.y+H.y};return[[t,...B.x!==j[0].x||B.y!==j[0].y?[B]:[],...j,...V.x!==j[j.length-1].x||V.y!==j[j.length-1].y?[V]:[],i],$,T,P,R]}function J1(t,r,i,s){const l=Math.min(Th(t,r)/2,Th(r,i)/2,s),{x:c,y:d}=r;if(t.x===c&&c===i.x||t.y===d&&d===i.y)return`L${c} ${d}`;if(t.y===d){const b=t.x<i.x?-1:1,S=t.y<i.y?1:-1;return`L ${c+l*b},${d}Q ${c},${d} ${c},${d+l*S}`}const h=t.x<i.x?1:-1,v=t.y<i.y?-1:1;return`L ${c},${d+l*v}Q ${c},${d} ${c+l*h},${d}`}function If({sourceX:t,sourceY:r,sourcePosition:i=tt.Bottom,targetX:s,targetY:l,targetPosition:c=tt.Top,borderRadius:d=5,centerX:h,centerY:v,offset:b=20,stepPosition:S=.5}){const[x,_,C,j,$]=G1({source:{x:t,y:r},sourcePosition:i,target:{x:s,y:l},targetPosition:c,center:{x:h,y:v},offset:b,stepPosition:S});let T=`M${x[0].x} ${x[0].y}`;for(let I=1;I<x.length-1;I++)T+=J1(x[I-1],x[I],x[I+1],d);return T+=`L${x[x.length-1].x} ${x[x.length-1].y}`,[T,_,C,j,$]}function Ih(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function Z1(t){var x;const{sourceNode:r,targetNode:i}=t;if(!Ih(r)||!Ih(i))return null;const s=r.internals.handleBounds||Ah(r.handles),l=i.internals.handleBounds||Ah(i.handles),c=Oh((s==null?void 0:s.source)??[],t.sourceHandle),d=Oh(t.connectionMode===Ms.Strict?(l==null?void 0:l.target)??[]:((l==null?void 0:l.target)??[]).concat((l==null?void 0:l.source)??[]),t.targetHandle);if(!c||!d)return(x=t.onError)==null||x.call(t,"008",to.error008(c?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const h=(c==null?void 0:c.position)||tt.Bottom,v=(d==null?void 0:d.position)||tt.Top,b=Vi(r,c,h),S=Vi(i,d,v);return{sourceX:b.x,sourceY:b.y,targetX:S.x,targetY:S.y,sourcePosition:h,targetPosition:v}}function Ah(t){if(!t)return null;const r=[],i=[];for(const s of t)s.width=s.width??1,s.height=s.height??1,s.type==="source"?r.push(s):s.type==="target"&&i.push(s);return{source:r,target:i}}function Vi(t,r,i=tt.Left,s=!1){const l=((r==null?void 0:r.x)??0)+t.internals.positionAbsolute.x,c=((r==null?void 0:r.y)??0)+t.internals.positionAbsolute.y,{width:d,height:h}=r??Oo(t);if(s)return{x:l+d/2,y:c+h/2};switch((r==null?void 0:r.position)??i){case tt.Top:return{x:l+d/2,y:c};case tt.Right:return{x:l+d,y:c+h/2};case tt.Bottom:return{x:l+d/2,y:c+h};case tt.Left:return{x:l,y:c+h/2}}}function Oh(t,r){return t&&(r?t.find(i=>i.id===r):t[0])||null}function Af(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(s=>`${s}=${t[s]}`).join("&")}`:""}function eb(t,{id:r,defaultColor:i,defaultMarkerStart:s,defaultMarkerEnd:l}){const c=new Set;return t.reduce((d,h)=>([h.markerStart||s,h.markerEnd||l].forEach(v=>{if(v&&typeof v=="object"){const b=Af(v,r);c.has(b)||(d.push({id:b,color:v.color||i,...v}),c.add(b))}}),d),[]).sort((d,h)=>d.id.localeCompare(h.id))}const _0=1e3,tb=10,Jf={nodeOrigin:[0,0],nodeExtent:Pa,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},nb={...Jf,checkEquality:!0};function Zf(t,r){const i={...t};for(const s in r)r[s]!==void 0&&(i[s]=r[s]);return i}function rb(t,r,i){const s=Zf(Jf,i);for(const l of t.values())if(l.parentId)td(l,t,r,s);else{const c=La(l,s.nodeOrigin),d=As(l.extent)?l.extent:s.nodeExtent,h=Hi(c,d,Oo(l));l.internals.positionAbsolute=h}}function ob(t,r){if(!t.handles)return t.measured?r==null?void 0:r.internals.handleBounds:void 0;const i=[],s=[];for(const l of t.handles){const c={id:l.id,width:l.width??1,height:l.height??1,nodeId:t.id,x:l.x,y:l.y,position:l.position,type:l.type};l.type==="source"?i.push(c):l.type==="target"&&s.push(c)}return{source:i,target:s}}function ed(t){return t==="manual"}function Of(t,r,i,s={}){var S,x;const l=Zf(nb,s),c={i:0},d=new Map(r),h=l!=null&&l.elevateNodesOnSelect&&!ed(l.zIndexMode)?_0:0;let v=t.length>0,b=!1;r.clear(),i.clear();for(const _ of t){let C=d.get(_.id);if(l.checkEquality&&_===(C==null?void 0:C.internals.userNode))r.set(_.id,C);else{const j=La(_,l.nodeOrigin),$=As(_.extent)?_.extent:l.nodeExtent,T=Hi(j,$,Oo(_));C={...l.defaults,..._,measured:{width:(S=_.measured)==null?void 0:S.width,height:(x=_.measured)==null?void 0:x.height},internals:{positionAbsolute:T,handleBounds:ob(_,C),z:S0(_,h,l.zIndexMode),userNode:_}},r.set(_.id,C)}(C.measured===void 0||C.measured.width===void 0||C.measured.height===void 0)&&!C.hidden&&(v=!1),_.parentId&&td(C,r,i,s,c),b||(b=_.selected??!1)}return{nodesInitialized:v,hasSelectedNodes:b}}function ib(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 td(t,r,i,s,l){const{elevateNodesOnSelect:c,nodeOrigin:d,nodeExtent:h,zIndexMode:v}=Zf(Jf,s),b=t.parentId,S=r.get(b);if(!S){console.warn(`Parent node ${b} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}ib(t,i),l&&!S.parentId&&S.internals.rootParentIndex===void 0&&v==="auto"&&(S.internals.rootParentIndex=++l.i,S.internals.z=S.internals.z+l.i*tb),l&&S.internals.rootParentIndex!==void 0&&(l.i=S.internals.rootParentIndex);const x=c&&!ed(v)?_0:0,{x:_,y:C,z:j}=sb(t,S,d,h,x,v),{positionAbsolute:$}=t.internals,T=_!==$.x||C!==$.y;(T||j!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:T?{x:_,y:C}:$,z:j}})}function S0(t,r,i){const s=Dr(t.zIndex)?t.zIndex:0;return ed(i)?s:s+(t.selected?r:0)}function sb(t,r,i,s,l,c){const{x:d,y:h}=r.internals.positionAbsolute,v=Oo(t),b=La(t,i),S=As(t.extent)?Hi(b,t.extent,v):b;let x=Hi({x:d+S.x,y:h+S.y},s,v);t.extent==="parent"&&(x=u0(x,v,r));const _=S0(t,l,c),C=r.internals.z??0;return{x:x.x,y:x.y,z:C>=_?C+1:_}}function nd(t,r,i,s=[0,0]){var d;const l=[],c=new Map;for(const h of t){const v=r.get(h.parentId);if(!v)continue;const b=((d=c.get(h.parentId))==null?void 0:d.expandedRect)??Is(v),S=f0(b,h.rect);c.set(h.parentId,{expandedRect:S,parent:v})}return c.size>0&&c.forEach(({expandedRect:h,parent:v},b)=>{var P;const S=v.internals.positionAbsolute,x=Oo(v),_=v.origin??s,C=h.x<S.x?Math.round(Math.abs(S.x-h.x)):0,j=h.y<S.y?Math.round(Math.abs(S.y-h.y)):0,$=Math.max(x.width,Math.round(h.width)),T=Math.max(x.height,Math.round(h.height)),I=($-x.width)*_[0],H=(T-x.height)*_[1];(C>0||j>0||I||H)&&(l.push({id:b,type:"position",position:{x:v.position.x-C+I,y:v.position.y-j+H}}),(P=i.get(b))==null||P.forEach(R=>{t.some(B=>B.id===R.id)||l.push({id:R.id,type:"position",position:{x:R.position.x+C,y:R.position.y+j}})})),(x.width<h.width||x.height<h.height||C||j)&&l.push({id:b,type:"dimensions",setAttributes:!0,dimensions:{width:$+(C?_[0]*C-I:0),height:T+(j?_[1]*j-H:0)}})}),l}function ab(t,r,i,s,l,c,d){const h=s==null?void 0:s.querySelector(".xyflow__viewport");let v=!1;if(!h)return{changes:[],updatedInternals:v};const b=[],S=window.getComputedStyle(h),{m22:x}=new window.DOMMatrixReadOnly(S.transform),_=[];for(const C of t.values()){const j=r.get(C.id);if(!j)continue;if(j.hidden){r.set(j.id,{...j,internals:{...j.internals,handleBounds:void 0}}),v=!0;continue}const $=Gf(C.nodeElement),T=j.measured.width!==$.width||j.measured.height!==$.height;if(!!($.width&&$.height&&(T||!j.internals.handleBounds||C.force))){const H=C.nodeElement.getBoundingClientRect(),P=As(j.extent)?j.extent:c;let{positionAbsolute:R}=j.internals;j.parentId&&j.extent==="parent"?R=u0(R,$,r.get(j.parentId)):P&&(R=Hi(R,P,$));const B={...j,measured:$,internals:{...j.internals,positionAbsolute:R,handleBounds:{source:Ph("source",C.nodeElement,H,x,j.id),target:Ph("target",C.nodeElement,H,x,j.id)}}};r.set(j.id,B),j.parentId&&td(B,r,i,{nodeOrigin:l,zIndexMode:d}),v=!0,T&&(b.push({id:j.id,type:"dimensions",dimensions:$}),j.expandParent&&j.parentId&&_.push({id:j.id,parentId:j.parentId,rect:Is(B,l)}))}}if(_.length>0){const C=nd(_,r,i,l);b.push(...C)}return{changes:b,updatedInternals:v}}async function lb({delta:t,panZoom:r,transform:i,translateExtent:s,width:l,height:c}){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],[l,c]],s),h=!!d&&(d.x!==i[0]||d.y!==i[1]||d.k!==i[2]);return Promise.resolve(h)}function Rh(t,r,i,s,l,c){let d=l;const h=s.get(d)||new Map;s.set(d,h.set(i,r)),d=`${l}-${t}`;const v=s.get(d)||new Map;if(s.set(d,v.set(i,r)),c){d=`${l}-${t}-${c}`;const b=s.get(d)||new Map;s.set(d,b.set(i,r))}}function k0(t,r,i){t.clear(),r.clear();for(const s of i){const{source:l,target:c,sourceHandle:d=null,targetHandle:h=null}=s,v={edgeId:s.id,source:l,target:c,sourceHandle:d,targetHandle:h},b=`${l}-${d}--${c}-${h}`,S=`${c}-${h}--${l}-${d}`;Rh("source",v,S,t,l,d),Rh("target",v,b,t,c,h),r.set(s.id,s)}}function N0(t,r){if(!t.parentId)return!1;const i=r.get(t.parentId);return i?i.selected?!0:N0(i,r):!1}function Lh(t,r,i){var l;let s=t;do{if((l=s==null?void 0:s.matches)!=null&&l.call(s,r))return!0;if(s===i)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function ub(t,r,i,s){const l=new Map;for(const[c,d]of t)if((d.selected||d.id===s)&&(!d.parentId||!N0(d,t))&&(d.draggable||r&&typeof d.draggable>"u")){const h=t.get(c);h&&l.set(c,{id:c,position:h.position||{x:0,y:0},distance:{x:i.x-h.internals.positionAbsolute.x,y:i.y-h.internals.positionAbsolute.y},extent:h.extent,parentId:h.parentId,origin:h.origin,expandParent:h.expandParent,internals:{positionAbsolute:h.internals.positionAbsolute||{x:0,y:0}},measured:{width:h.measured.width??0,height:h.measured.height??0}})}return l}function lf({nodeId:t,dragItems:r,nodeLookup:i,dragging:s=!0}){var d,h,v;const l=[];for(const[b,S]of r){const x=(d=i.get(b))==null?void 0:d.internals.userNode;x&&l.push({...x,position:S.position,dragging:s})}if(!t)return[l[0],l];const c=(h=i.get(t))==null?void 0:h.internals.userNode;return[c?{...c,position:((v=r.get(t))==null?void 0:v.position)||c.position,dragging:s}:l[0],l]}function cb({dragItems:t,snapGrid:r,x:i,y:s}){const l=t.values().next().value;if(!l)return null;const c={x:i-l.distance.x,y:s-l.distance.y},d=za(c,r);return{x:d.x-c.x,y:d.y-c.y}}function fb({onNodeMouseDown:t,getStoreItems:r,onDragStart:i,onDrag:s,onDragStop:l}){let c={x:null,y:null},d=0,h=new Map,v=!1,b={x:0,y:0},S=null,x=!1,_=null,C=!1,j=!1,$=null;function T({noDragClassName:H,handleSelector:P,domNode:R,isSelectable:B,nodeId:V,nodeClickDistance:W=0}){_=sr(R);function Q({x:fe,y:ve}){const{nodeLookup:D,nodeExtent:ue,snapGrid:G,snapToGrid:se,nodeOrigin:F,onNodeDrag:q,onSelectionDrag:Z,onError:A,updateNodePositions:K}=r();c={x:fe,y:ve};let pe=!1;const be=h.size>1,$e=be&&ue?Tf(Da(h)):null,Ae=be&&se?cb({dragItems:h,snapGrid:G,x:fe,y:ve}):null;for(const[Oe,Se]of h){if(!D.has(Oe))continue;let De={x:fe-Se.distance.x,y:ve-Se.distance.y};se&&(De=Ae?{x:Math.round(De.x+Ae.x),y:Math.round(De.y+Ae.y)}:za(De,G));let Ne=null;if(be&&ue&&!Se.extent&&$e){const{positionAbsolute:Ke}=Se.internals,qe=Ke.x-$e.x+ue[0][0],at=Ke.x+Se.measured.width-$e.x2+ue[1][0],ot=Ke.y-$e.y+ue[0][1],Tt=Ke.y+Se.measured.height-$e.y2+ue[1][1];Ne=[[qe,ot],[at,Tt]]}const{position:et,positionAbsolute:Fe}=l0({nodeId:Oe,nextPosition:De,nodeLookup:D,nodeExtent:Ne||ue,nodeOrigin:F,onError:A});pe=pe||Se.position.x!==et.x||Se.position.y!==et.y,Se.position=et,Se.internals.positionAbsolute=Fe}if(j=j||pe,!!pe&&(K(h,!0),$&&(s||q||!V&&Z))){const[Oe,Se]=lf({nodeId:V,dragItems:h,nodeLookup:D});s==null||s($,h,Oe,Se),q==null||q($,Oe,Se),V||Z==null||Z($,Se)}}async function de(){if(!S)return;const{transform:fe,panBy:ve,autoPanSpeed:D,autoPanOnNodeDrag:ue}=r();if(!ue){v=!1,cancelAnimationFrame(d);return}const[G,se]=c0(b,S,D);(G!==0||se!==0)&&(c.x=(c.x??0)-G/fe[2],c.y=(c.y??0)-se/fe[2],await ve({x:G,y:se})&&Q(c)),d=requestAnimationFrame(de)}function ke(fe){var be;const{nodeLookup:ve,multiSelectionActive:D,nodesDraggable:ue,transform:G,snapGrid:se,snapToGrid:F,selectNodesOnDrag:q,onNodeDragStart:Z,onSelectionDragStart:A,unselectNodesAndEdges:K}=r();x=!0,(!q||!B)&&!D&&V&&((be=ve.get(V))!=null&&be.selected||K()),B&&q&&V&&(t==null||t(V));const pe=Sa(fe.sourceEvent,{transform:G,snapGrid:se,snapToGrid:F,containerBounds:S});if(c=pe,h=ub(ve,ue,pe,V),h.size>0&&(i||Z||!V&&A)){const[$e,Ae]=lf({nodeId:V,dragItems:h,nodeLookup:ve});i==null||i(fe.sourceEvent,h,$e,Ae),Z==null||Z(fe.sourceEvent,$e,Ae),V||A==null||A(fe.sourceEvent,Ae)}}const Y=Bm().clickDistance(W).on("start",fe=>{const{domNode:ve,nodeDragThreshold:D,transform:ue,snapGrid:G,snapToGrid:se}=r();S=(ve==null?void 0:ve.getBoundingClientRect())||null,C=!1,j=!1,$=fe.sourceEvent,D===0&&ke(fe),c=Sa(fe.sourceEvent,{transform:ue,snapGrid:G,snapToGrid:se,containerBounds:S}),b=zr(fe.sourceEvent,S)}).on("drag",fe=>{const{autoPanOnNodeDrag:ve,transform:D,snapGrid:ue,snapToGrid:G,nodeDragThreshold:se,nodeLookup:F}=r(),q=Sa(fe.sourceEvent,{transform:D,snapGrid:ue,snapToGrid:G,containerBounds:S});if($=fe.sourceEvent,(fe.sourceEvent.type==="touchmove"&&fe.sourceEvent.touches.length>1||V&&!F.has(V))&&(C=!0),!C){if(!v&&ve&&x&&(v=!0,de()),!x){const Z=zr(fe.sourceEvent,S),A=Z.x-b.x,K=Z.y-b.y;Math.sqrt(A*A+K*K)>se&&ke(fe)}(c.x!==q.xSnapped||c.y!==q.ySnapped)&&h&&x&&(b=zr(fe.sourceEvent,S),Q(q))}}).on("end",fe=>{if(!(!x||C)&&(v=!1,x=!1,cancelAnimationFrame(d),h.size>0)){const{nodeLookup:ve,updateNodePositions:D,onNodeDragStop:ue,onSelectionDragStop:G}=r();if(j&&(D(h,!1),j=!1),l||ue||!V&&G){const[se,F]=lf({nodeId:V,dragItems:h,nodeLookup:ve,dragging:!1});l==null||l(fe.sourceEvent,h,se,F),ue==null||ue(fe.sourceEvent,se,F),V||G==null||G(fe.sourceEvent,F)}}}).filter(fe=>{const ve=fe.target;return!fe.button&&(!H||!Lh(ve,`.${H}`,R))&&(!P||Lh(ve,P,R))});_.call(Y)}function I(){_==null||_.on(".drag",null)}return{update:T,destroy:I}}function db(t,r,i){const s=[],l={x:t.x-i,y:t.y-i,width:i*2,height:i*2};for(const c of r.values())Ma(l,Is(c))>0&&s.push(c);return s}const pb=250;function hb(t,r,i,s){var h,v;let l=[],c=1/0;const d=db(t,i,r+pb);for(const b of d){const S=[...((h=b.internals.handleBounds)==null?void 0:h.source)??[],...((v=b.internals.handleBounds)==null?void 0:v.target)??[]];for(const x of S){if(s.nodeId===x.nodeId&&s.type===x.type&&s.id===x.id)continue;const{x:_,y:C}=Vi(b,x,x.position,!0),j=Math.sqrt(Math.pow(_-t.x,2)+Math.pow(C-t.y,2));j>r||(j<c?(l=[{...x,x:_,y:C}],c=j):j===c&&l.push({...x,x:_,y:C}))}}if(!l.length)return null;if(l.length>1){const b=s.type==="source"?"target":"source";return l.find(S=>S.type===b)??l[0]}return l[0]}function E0(t,r,i,s,l,c=!1){var b,S,x;const d=s.get(t);if(!d)return null;const h=l==="strict"?(b=d.internals.handleBounds)==null?void 0:b[r]:[...((S=d.internals.handleBounds)==null?void 0:S.source)??[],...((x=d.internals.handleBounds)==null?void 0:x.target)??[]],v=(i?h==null?void 0:h.find(_=>_.id===i):h==null?void 0:h[0])??null;return v&&c?{...v,...Vi(d,v,v.position,!0)}:v}function C0(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function mb(t,r){let i=null;return r?i=!0:t&&!r&&(i=!1),i}const j0=()=>!0;function gb(t,{connectionMode:r,connectionRadius:i,handleId:s,nodeId:l,edgeUpdaterType:c,isTarget:d,domNode:h,nodeLookup:v,lib:b,autoPanOnConnect:S,flowId:x,panBy:_,cancelConnection:C,onConnectStart:j,onConnect:$,onConnectEnd:T,isValidConnection:I=j0,onReconnectEnd:H,updateConnection:P,getTransform:R,getFromHandle:B,autoPanSpeed:V,dragThreshold:W=1,handleDomNode:Q}){const de=h0(t.target);let ke=0,Y;const{x:fe,y:ve}=zr(t),D=C0(c,Q),ue=h==null?void 0:h.getBoundingClientRect();let G=!1;if(!ue||!D)return;const se=E0(l,D,s,v,r);if(!se)return;let F=zr(t,ue),q=!1,Z=null,A=!1,K=null;function pe(){if(!S||!ue)return;const[et,Fe]=c0(F,ue,V);_({x:et,y:Fe}),ke=requestAnimationFrame(pe)}const be={...se,nodeId:l,type:D,position:se.position},$e=v.get(l);let Oe={inProgress:!0,isValid:null,from:Vi($e,be,tt.Left,!0),fromHandle:be,fromPosition:be.position,fromNode:$e,to:F,toHandle:null,toPosition:Nh[be.position],toNode:null,pointer:F};function Se(){G=!0,P(Oe),j==null||j(t,{nodeId:l,handleId:s,handleType:D})}W===0&&Se();function De(et){if(!G){const{x:Tt,y:xn}=zr(et),Wt=Tt-fe,Yt=xn-ve;if(!(Wt*Wt+Yt*Yt>W*W))return;Se()}if(!B()||!be){Ne(et);return}const Fe=R();F=zr(et,ue),Y=hb(Fa(F,Fe,!1,[1,1]),i,v,be),q||(pe(),q=!0);const Ke=P0(et,{handle:Y,connectionMode:r,fromNodeId:l,fromHandleId:s,fromType:d?"target":"source",isValidConnection:I,doc:de,lib:b,flowId:x,nodeLookup:v});K=Ke.handleDomNode,Z=Ke.connection,A=mb(!!Y,Ke.isValid);const qe=v.get(l),at=qe?Vi(qe,be,tt.Left,!0):Oe.from,ot={...Oe,from:at,isValid:A,to:Ke.toHandle&&A?xu({x:Ke.toHandle.x,y:Ke.toHandle.y},Fe):F,toHandle:Ke.toHandle,toPosition:A&&Ke.toHandle?Ke.toHandle.position:Nh[be.position],toNode:Ke.toHandle?v.get(Ke.toHandle.nodeId):null,pointer:F};P(ot),Oe=ot}function Ne(et){if(!("touches"in et&&et.touches.length>0)){if(G){(Y||K)&&Z&&A&&($==null||$(Z));const{inProgress:Fe,...Ke}=Oe,qe={...Ke,toPosition:Oe.toHandle?Oe.toPosition:null};T==null||T(et,qe),c&&(H==null||H(et,qe))}C(),cancelAnimationFrame(ke),q=!1,A=!1,Z=null,K=null,de.removeEventListener("mousemove",De),de.removeEventListener("mouseup",Ne),de.removeEventListener("touchmove",De),de.removeEventListener("touchend",Ne)}}de.addEventListener("mousemove",De),de.addEventListener("mouseup",Ne),de.addEventListener("touchmove",De),de.addEventListener("touchend",Ne)}function P0(t,{handle:r,connectionMode:i,fromNodeId:s,fromHandleId:l,fromType:c,doc:d,lib:h,flowId:v,isValidConnection:b=j0,nodeLookup:S}){const x=c==="target",_=r?d.querySelector(`.${h}-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:C,y:j}=zr(t),$=d.elementFromPoint(C,j),T=$!=null&&$.classList.contains(`${h}-flow__handle`)?$:_,I={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){const H=C0(void 0,T),P=T.getAttribute("data-nodeid"),R=T.getAttribute("data-handleid"),B=T.classList.contains("connectable"),V=T.classList.contains("connectableend");if(!P||!H)return I;const W={source:x?P:s,sourceHandle:x?R:l,target:x?s:P,targetHandle:x?l:R};I.connection=W;const de=B&&V&&(i===Ms.Strict?x&&H==="source"||!x&&H==="target":P!==s||R!==l);I.isValid=de&&b(W),I.toHandle=E0(P,H,R,S,i,!0)}return I}const Rf={onPointerDown:gb,isValid:P0};function yb({domNode:t,panZoom:r,getTransform:i,getViewScale:s}){const l=sr(t);function c({translateExtent:h,width:v,height:b,zoomStep:S=1,pannable:x=!0,zoomable:_=!0,inversePan:C=!1}){const j=P=>{if(P.sourceEvent.type!=="wheel"||!r)return;const R=i(),B=P.sourceEvent.ctrlKey&&Ta()?10:1,V=-P.sourceEvent.deltaY*(P.sourceEvent.deltaMode===1?.05:P.sourceEvent.deltaMode?1:.002)*S,W=R[2]*Math.pow(2,V*B);r.scaleTo(W)};let $=[0,0];const T=P=>{(P.sourceEvent.type==="mousedown"||P.sourceEvent.type==="touchstart")&&($=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY])},I=P=>{const R=i();if(P.sourceEvent.type!=="mousemove"&&P.sourceEvent.type!=="touchmove"||!r)return;const B=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY],V=[B[0]-$[0],B[1]-$[1]];$=B;const W=s()*Math.max(R[2],Math.log(R[2]))*(C?-1:1),Q={x:R[0]-V[0]*W,y:R[1]-V[1]*W},de=[[0,0],[v,b]];r.setViewportConstrained({x:Q.x,y:Q.y,zoom:R[2]},de,h)},H=n0().on("start",T).on("zoom",x?I:null).on("zoom.wheel",_?j:null);l.call(H,{})}function d(){l.on("zoom",null)}return{update:c,destroy:d,pointer:Rr}}const Tu=t=>({x:t.x,y:t.y,zoom:t.k}),uf=({x:t,y:r,zoom:i})=>Pu.translate(t,r).scale(i),Ns=(t,r)=>t.target.closest(`.${r}`),$0=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),vb=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,cf=(t,r=0,i=vb,s=()=>{})=>{const l=typeof r=="number"&&r>0;return l||s(),l?t.transition().duration(r).ease(i).on("end",s):t},M0=t=>{const r=t.ctrlKey&&Ta()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function xb({zoomPanValues:t,noWheelClassName:r,d3Selection:i,d3Zoom:s,panOnScrollMode:l,panOnScrollSpeed:c,zoomOnPinch:d,onPanZoomStart:h,onPanZoom:v,onPanZoomEnd:b}){return S=>{if(Ns(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=Rr(S),I=M0(S),H=x*Math.pow(2,I);s.scaleTo(i,H,T,S);return}const _=S.deltaMode===1?20:1;let C=l===zi.Vertical?0:S.deltaX*_,j=l===zi.Horizontal?0:S.deltaY*_;!Ta()&&S.shiftKey&&l!==zi.Vertical&&(C=S.deltaY*_,j=0),s.translateBy(i,-(C/x)*c,-(j/x)*c,{internal:!0});const $=Tu(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(v==null||v(S,$),t.panScrollTimeout=setTimeout(()=>{b==null||b(S,$),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,h==null||h(S,$))}}function wb({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:i}){return function(s,l){const c=s.type==="wheel",d=!r&&c&&!s.ctrlKey,h=Ns(s,t);if(s.ctrlKey&&c&&h&&s.preventDefault(),d||h)return null;s.preventDefault(),i.call(this,s,l)}}function bb({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:i}){return s=>{var c,d,h;if((c=s.sourceEvent)!=null&&c.internal)return;const l=Tu(s.transform);t.mouseButton=((d=s.sourceEvent)==null?void 0:d.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=l,((h=s.sourceEvent)==null?void 0:h.type)==="mousedown"&&r(!0),i&&(i==null||i(s.sourceEvent,l))}}function _b({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:i,onTransformChange:s,onPanZoom:l}){return c=>{var d,h;t.usedRightMouseButton=!!(i&&$0(r,t.mouseButton??0)),(d=c.sourceEvent)!=null&&d.sync||s([c.transform.x,c.transform.y,c.transform.k]),l&&!((h=c.sourceEvent)!=null&&h.internal)&&(l==null||l(c.sourceEvent,Tu(c.transform)))}}function Sb({zoomPanValues:t,panOnDrag:r,panOnScroll:i,onDraggingChange:s,onPanZoomEnd:l,onPaneContextMenu:c}){return d=>{var h;if(!((h=d.sourceEvent)!=null&&h.internal)&&(t.isZoomingOrPanning=!1,c&&$0(r,t.mouseButton??0)&&!t.usedRightMouseButton&&d.sourceEvent&&c(d.sourceEvent),t.usedRightMouseButton=!1,s(!1),l)){const v=Tu(d.transform);t.prevViewport=v,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{l==null||l(d.sourceEvent,v)},i?150:0)}}}function kb({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:s,panOnScroll:l,zoomOnDoubleClick:c,userSelectionActive:d,noWheelClassName:h,noPanClassName:v,lib:b,connectionInProgress:S}){return x=>{var T;const _=t||r,C=i&&x.ctrlKey,j=x.type==="wheel";if(x.button===1&&x.type==="mousedown"&&(Ns(x,`${b}-flow__node`)||Ns(x,`${b}-flow__edge`)))return!0;if(!s&&!_&&!l&&!c&&!i||d||S&&!j||Ns(x,h)&&j||Ns(x,v)&&(!j||l&&j&&!t)||!i&&x.ctrlKey&&j)return!1;if(!i&&x.type==="touchstart"&&((T=x.touches)==null?void 0:T.length)>1)return x.preventDefault(),!1;if(!_&&!l&&!C&&j||!s&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(s)&&!s.includes(x.button)&&x.type==="mousedown")return!1;const $=Array.isArray(s)&&s.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||j)&&$}}function Nb({domNode:t,minZoom:r,maxZoom:i,translateExtent:s,viewport:l,onPanZoom:c,onPanZoomStart:d,onPanZoomEnd:h,onDraggingChange:v}){const b={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},S=t.getBoundingClientRect(),x=n0().scaleExtent([r,i]).translateExtent(s),_=sr(t).call(x);H({x:l.x,y:l.y,zoom:Ts(l.zoom,r,i)},[[0,0],[S.width,S.height]],s);const C=_.on("wheel.zoom"),j=_.on("dblclick.zoom");x.wheelDelta(M0);function $(Y,fe){return _?new Promise(ve=>{x==null||x.interpolate((fe==null?void 0:fe.interpolate)==="linear"?_a:ou).transform(cf(_,fe==null?void 0:fe.duration,fe==null?void 0:fe.ease,()=>ve(!0)),Y)}):Promise.resolve(!1)}function T({noWheelClassName:Y,noPanClassName:fe,onPaneContextMenu:ve,userSelectionActive:D,panOnScroll:ue,panOnDrag:G,panOnScrollMode:se,panOnScrollSpeed:F,preventScrolling:q,zoomOnPinch:Z,zoomOnScroll:A,zoomOnDoubleClick:K,zoomActivationKeyPressed:pe,lib:be,onTransformChange:$e,connectionInProgress:Ae,paneClickDistance:Oe,selectionOnDrag:Se}){D&&!b.isZoomingOrPanning&&I();const De=ue&&!pe&&!D;x.clickDistance(Se?1/0:!Dr(Oe)||Oe<0?0:Oe);const Ne=De?xb({zoomPanValues:b,noWheelClassName:Y,d3Selection:_,d3Zoom:x,panOnScrollMode:se,panOnScrollSpeed:F,zoomOnPinch:Z,onPanZoomStart:d,onPanZoom:c,onPanZoomEnd:h}):wb({noWheelClassName:Y,preventScrolling:q,d3ZoomHandler:C});if(_.on("wheel.zoom",Ne,{passive:!1}),!D){const Fe=bb({zoomPanValues:b,onDraggingChange:v,onPanZoomStart:d});x.on("start",Fe);const Ke=_b({zoomPanValues:b,panOnDrag:G,onPaneContextMenu:!!ve,onPanZoom:c,onTransformChange:$e});x.on("zoom",Ke);const qe=Sb({zoomPanValues:b,panOnDrag:G,panOnScroll:ue,onPaneContextMenu:ve,onPanZoomEnd:h,onDraggingChange:v});x.on("end",qe)}const et=kb({zoomActivationKeyPressed:pe,panOnDrag:G,zoomOnScroll:A,panOnScroll:ue,zoomOnDoubleClick:K,zoomOnPinch:Z,userSelectionActive:D,noPanClassName:fe,noWheelClassName:Y,lib:be,connectionInProgress:Ae});x.filter(et),K?_.on("dblclick.zoom",j):_.on("dblclick.zoom",null)}function I(){x.on("zoom",null)}async function H(Y,fe,ve){const D=uf(Y),ue=x==null?void 0:x.constrain()(D,fe,ve);return ue&&await $(ue),new Promise(G=>G(ue))}async function P(Y,fe){const ve=uf(Y);return await $(ve,fe),new Promise(D=>D(ve))}function R(Y){if(_){const fe=uf(Y),ve=_.property("__zoom");(ve.k!==Y.zoom||ve.x!==Y.x||ve.y!==Y.y)&&(x==null||x.transform(_,fe,null,{sync:!0}))}}function B(){const Y=_?t0(_.node()):{x:0,y:0,k:1};return{x:Y.x,y:Y.y,zoom:Y.k}}function V(Y,fe){return _?new Promise(ve=>{x==null||x.interpolate((fe==null?void 0:fe.interpolate)==="linear"?_a:ou).scaleTo(cf(_,fe==null?void 0:fe.duration,fe==null?void 0:fe.ease,()=>ve(!0)),Y)}):Promise.resolve(!1)}function W(Y,fe){return _?new Promise(ve=>{x==null||x.interpolate((fe==null?void 0:fe.interpolate)==="linear"?_a:ou).scaleBy(cf(_,fe==null?void 0:fe.duration,fe==null?void 0:fe.ease,()=>ve(!0)),Y)}):Promise.resolve(!1)}function Q(Y){x==null||x.scaleExtent(Y)}function de(Y){x==null||x.translateExtent(Y)}function ke(Y){const fe=!Dr(Y)||Y<0?0:Y;x==null||x.clickDistance(fe)}return{update:T,destroy:I,setViewport:P,setViewportConstrained:H,getViewport:B,scaleTo:V,scaleBy:W,setScaleExtent:Q,setTranslateExtent:de,syncViewport:R,setClickDistance:ke}}var Os;(function(t){t.Line="line",t.Handle="handle"})(Os||(Os={}));function Eb({width:t,prevWidth:r,height:i,prevHeight:s,affectsX:l,affectsY:c}){const d=t-r,h=i-s,v=[d>0?1:d<0?-1:0,h>0?1:h<0?-1:0];return d&&l&&(v[0]=v[0]*-1),h&&c&&(v[1]=v[1]*-1),v}function Dh(t){const r=t.includes("right")||t.includes("left"),i=t.includes("bottom")||t.includes("top"),s=t.includes("left"),l=t.includes("top");return{isHorizontal:r,isVertical:i,affectsX:s,affectsY:l}}function ci(t,r){return Math.max(0,r-t)}function fi(t,r){return Math.max(0,t-r)}function Gl(t,r,i){return Math.max(0,r-t,t-i)}function zh(t,r){return t?!r:r}function Cb(t,r,i,s,l,c,d,h){let{affectsX:v,affectsY:b}=r;const{isHorizontal:S,isVertical:x}=r,_=S&&x,{xSnapped:C,ySnapped:j}=i,{minWidth:$,maxWidth:T,minHeight:I,maxHeight:H}=s,{x:P,y:R,width:B,height:V,aspectRatio:W}=t;let Q=Math.floor(S?C-t.pointerX:0),de=Math.floor(x?j-t.pointerY:0);const ke=B+(v?-Q:Q),Y=V+(b?-de:de),fe=-c[0]*B,ve=-c[1]*V;let D=Gl(ke,$,T),ue=Gl(Y,I,H);if(d){let F=0,q=0;v&&Q<0?F=ci(P+Q+fe,d[0][0]):!v&&Q>0&&(F=fi(P+ke+fe,d[1][0])),b&&de<0?q=ci(R+de+ve,d[0][1]):!b&&de>0&&(q=fi(R+Y+ve,d[1][1])),D=Math.max(D,F),ue=Math.max(ue,q)}if(h){let F=0,q=0;v&&Q>0?F=fi(P+Q,h[0][0]):!v&&Q<0&&(F=ci(P+ke,h[1][0])),b&&de>0?q=fi(R+de,h[0][1]):!b&&de<0&&(q=ci(R+Y,h[1][1])),D=Math.max(D,F),ue=Math.max(ue,q)}if(l){if(S){const F=Gl(ke/W,I,H)*W;if(D=Math.max(D,F),d){let q=0;!v&&!b||v&&!b&&_?q=fi(R+ve+ke/W,d[1][1])*W:q=ci(R+ve+(v?Q:-Q)/W,d[0][1])*W,D=Math.max(D,q)}if(h){let q=0;!v&&!b||v&&!b&&_?q=ci(R+ke/W,h[1][1])*W:q=fi(R+(v?Q:-Q)/W,h[0][1])*W,D=Math.max(D,q)}}if(x){const F=Gl(Y*W,$,T)/W;if(ue=Math.max(ue,F),d){let q=0;!v&&!b||b&&!v&&_?q=fi(P+Y*W+fe,d[1][0])/W:q=ci(P+(b?de:-de)*W+fe,d[0][0])/W,ue=Math.max(ue,q)}if(h){let q=0;!v&&!b||b&&!v&&_?q=ci(P+Y*W,h[1][0])/W:q=fi(P+(b?de:-de)*W,h[0][0])/W,ue=Math.max(ue,q)}}}de=de+(de<0?ue:-ue),Q=Q+(Q<0?D:-D),l&&(_?ke>Y*W?de=(zh(v,b)?-Q:Q)/W:Q=(zh(v,b)?-de:de)*W:S?(de=Q/W,b=v):(Q=de*W,v=b));const G=v?P+Q:P,se=b?R+de:R;return{width:B+(v?-Q:Q),height:V+(b?-de:de),x:c[0]*Q*(v?-1:1)+G,y:c[1]*de*(b?-1:1)+se}}const T0={width:0,height:0,x:0,y:0},jb={...T0,pointerX:0,pointerY:0,aspectRatio:1};function Pb(t){return[[0,0],[t.measured.width,t.measured.height]]}function $b(t,r,i){const s=r.position.x+t.position.x,l=r.position.y+t.position.y,c=t.measured.width??0,d=t.measured.height??0,h=i[0]*c,v=i[1]*d;return[[s-h,l-v],[s+c-h,l+d-v]]}function Mb({domNode:t,nodeId:r,getStoreItems:i,onChange:s,onEnd:l}){const c=sr(t);let d={controlDirection:Dh("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function h({controlPosition:b,boundaries:S,keepAspectRatio:x,resizeDirection:_,onResizeStart:C,onResize:j,onResizeEnd:$,shouldResize:T}){let I={...T0},H={...jb};d={boundaries:S,resizeDirection:_,keepAspectRatio:x,controlDirection:Dh(b)};let P,R=null,B=[],V,W,Q,de=!1;const ke=Bm().on("start",Y=>{const{nodeLookup:fe,transform:ve,snapGrid:D,snapToGrid:ue,nodeOrigin:G,paneDomNode:se}=i();if(P=fe.get(r),!P)return;R=(se==null?void 0:se.getBoundingClientRect())??null;const{xSnapped:F,ySnapped:q}=Sa(Y.sourceEvent,{transform:ve,snapGrid:D,snapToGrid:ue,containerBounds:R});I={width:P.measured.width??0,height:P.measured.height??0,x:P.position.x??0,y:P.position.y??0},H={...I,pointerX:F,pointerY:q,aspectRatio:I.width/I.height},V=void 0,P.parentId&&(P.extent==="parent"||P.expandParent)&&(V=fe.get(P.parentId),W=V&&P.extent==="parent"?Pb(V):void 0),B=[],Q=void 0;for(const[Z,A]of fe)if(A.parentId===r&&(B.push({id:Z,position:{...A.position},extent:A.extent}),A.extent==="parent"||A.expandParent)){const K=$b(A,P,A.origin??G);Q?Q=[[Math.min(K[0][0],Q[0][0]),Math.min(K[0][1],Q[0][1])],[Math.max(K[1][0],Q[1][0]),Math.max(K[1][1],Q[1][1])]]:Q=K}C==null||C(Y,{...I})}).on("drag",Y=>{const{transform:fe,snapGrid:ve,snapToGrid:D,nodeOrigin:ue}=i(),G=Sa(Y.sourceEvent,{transform:fe,snapGrid:ve,snapToGrid:D,containerBounds:R}),se=[];if(!P)return;const{x:F,y:q,width:Z,height:A}=I,K={},pe=P.origin??ue,{width:be,height:$e,x:Ae,y:Oe}=Cb(H,d.controlDirection,G,d.boundaries,d.keepAspectRatio,pe,W,Q),Se=be!==Z,De=$e!==A,Ne=Ae!==F&&Se,et=Oe!==q&&De;if(!Ne&&!et&&!Se&&!De)return;if((Ne||et||pe[0]===1||pe[1]===1)&&(K.x=Ne?Ae:I.x,K.y=et?Oe:I.y,I.x=K.x,I.y=K.y,B.length>0)){const at=Ae-F,ot=Oe-q;for(const Tt of B)Tt.position={x:Tt.position.x-at+pe[0]*(be-Z),y:Tt.position.y-ot+pe[1]*($e-A)},se.push(Tt)}if((Se||De)&&(K.width=Se&&(!d.resizeDirection||d.resizeDirection==="horizontal")?be:I.width,K.height=De&&(!d.resizeDirection||d.resizeDirection==="vertical")?$e:I.height,I.width=K.width,I.height=K.height),V&&P.expandParent){const at=pe[0]*(K.width??0);K.x&&K.x<at&&(I.x=at,H.x=H.x-(K.x-at));const ot=pe[1]*(K.height??0);K.y&&K.y<ot&&(I.y=ot,H.y=H.y-(K.y-ot))}const Fe=Eb({width:I.width,prevWidth:Z,height:I.height,prevHeight:A,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),Ke={...I,direction:Fe};(T==null?void 0:T(Y,Ke))!==!1&&(de=!0,j==null||j(Y,Ke),s(K,se))}).on("end",Y=>{de&&($==null||$(Y,{...I}),l==null||l({...I}),de=!1)});c.call(ke)}function v(){c.on(".drag",null)}return{update:h,destroy:v}}var ff={exports:{}},df={},pf={exports:{}},hf={};/**
|
|
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 Fh;function Tb(){if(Fh)return hf;Fh=1;var t=Aa();function r(x,_){return x===_&&(x!==0||1/x===1/_)||x!==x&&_!==_}var i=typeof Object.is=="function"?Object.is:r,s=t.useState,l=t.useEffect,c=t.useLayoutEffect,d=t.useDebugValue;function h(x,_){var C=_(),j=s({inst:{value:C,getSnapshot:_}}),$=j[0].inst,T=j[1];return c(function(){$.value=C,$.getSnapshot=_,v($)&&T({inst:$})},[x,C,_]),l(function(){return v($)&&T({inst:$}),x(function(){v($)&&T({inst:$})})},[x]),d(C),C}function v(x){var _=x.getSnapshot;x=x.value;try{var C=_();return!i(x,C)}catch{return!0}}function b(x,_){return _()}var S=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?b:h;return hf.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:S,hf}var Bh;function Ib(){return Bh||(Bh=1,pf.exports=Tb()),pf.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 Hh;function Ab(){if(Hh)return df;Hh=1;var t=Aa(),r=Ib();function i(b,S){return b===S&&(b!==0||1/b===1/S)||b!==b&&S!==S}var s=typeof Object.is=="function"?Object.is:i,l=r.useSyncExternalStore,c=t.useRef,d=t.useEffect,h=t.useMemo,v=t.useDebugValue;return df.useSyncExternalStoreWithSelector=function(b,S,x,_,C){var j=c(null);if(j.current===null){var $={hasValue:!1,value:null};j.current=$}else $=j.current;j=h(function(){function I(V){if(!H){if(H=!0,P=V,V=_(V),C!==void 0&&$.hasValue){var W=$.value;if(C(W,V))return R=W}return R=V}if(W=R,s(P,V))return W;var Q=_(V);return C!==void 0&&C(W,Q)?(P=V,W):(P=V,R=Q)}var H=!1,P,R,B=x===void 0?null:x;return[function(){return I(S())},B===null?void 0:function(){return I(B())}]},[S,x,_,C]);var T=l(b,j[0],j[1]);return d(function(){$.hasValue=!0,$.value=T},[T]),v(T),T},df}var Vh;function Ob(){return Vh||(Vh=1,ff.exports=Ab()),ff.exports}var Rb=Ob();const Lb=bu(Rb),Db={},Uh=t=>{let r;const i=new Set,s=(S,x)=>{const _=typeof S=="function"?S(r):S;if(!Object.is(_,r)){const C=r;r=x??(typeof _!="object"||_===null)?_:Object.assign({},r,_),i.forEach(j=>j(r,C))}},l=()=>r,v={setState:s,getState:l,getInitialState:()=>b,subscribe:S=>(i.add(S),()=>i.delete(S)),destroy:()=>{(Db?"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()}},b=r=t(s,l,v);return v},zb=t=>t?Uh(t):Uh,{useDebugValue:Fb}=wm,{useSyncExternalStoreWithSelector:Bb}=Lb,Hb=t=>t;function I0(t,r=Hb,i){const s=Bb(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,i);return Fb(s),s}const Kh=(t,r)=>{const i=zb(t),s=(l,c=r)=>I0(i,l,c);return Object.assign(s,i),s},Vb=(t,r)=>t?Kh(t,r):Kh;function Rt(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[s,l]of t)if(!Object.is(l,r.get(s)))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(const s of t)if(!r.has(s))return!1;return!0}const i=Object.keys(t);if(i.length!==Object.keys(r).length)return!1;for(const s of i)if(!Object.prototype.hasOwnProperty.call(r,s)||!Object.is(t[s],r[s]))return!1;return!0}bm();const Iu=U.createContext(null),Ub=Iu.Provider,A0=to.error001();function gt(t,r){const i=U.useContext(Iu);if(i===null)throw new Error(A0);return I0(i,t,r)}function Mt(){const t=U.useContext(Iu);if(t===null)throw new Error(A0);return U.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const qh={display:"none"},Kb={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},O0="react-flow__node-desc",R0="react-flow__edge-desc",qb="react-flow__aria-live",Wb=t=>t.ariaLiveMessage,Yb=t=>t.ariaLabelConfig;function Xb({rfId:t}){const r=gt(Wb);return g.jsx("div",{id:`${qb}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:Kb,children:r})}function Qb({rfId:t,disableKeyboardA11y:r}){const i=gt(Yb);return g.jsxs(g.Fragment,{children:[g.jsx("div",{id:`${O0}-${t}`,style:qh,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),g.jsx("div",{id:`${R0}-${t}`,style:qh,children:i["edge.a11yDescription.default"]}),!r&&g.jsx(Xb,{rfId:t})]})}const Ba=U.forwardRef(({position:t="top-left",children:r,className:i,style:s,...l},c)=>{const d=`${t}`.split("-");return g.jsx("div",{className:Zt(["react-flow__panel",i,...d]),style:s,ref:c,...l,children:r})});Ba.displayName="Panel";function Gb({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:g.jsx(Ba,{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:g.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Jb=t=>{const r=[],i=[];for(const[,s]of t.nodeLookup)s.selected&&r.push(s.internals.userNode);for(const[,s]of t.edgeLookup)s.selected&&i.push(s);return{selectedNodes:r,selectedEdges:i}},Jl=t=>t.id;function Zb(t,r){return Rt(t.selectedNodes.map(Jl),r.selectedNodes.map(Jl))&&Rt(t.selectedEdges.map(Jl),r.selectedEdges.map(Jl))}function e_({onSelectionChange:t}){const r=Mt(),{selectedNodes:i,selectedEdges:s}=gt(Jb,Zb);return U.useEffect(()=>{const l={nodes:i,edges:s};t==null||t(l),r.getState().onSelectionChangeHandlers.forEach(c=>c(l))},[i,s,t]),null}const t_=t=>!!t.onSelectionChangeHandlers;function n_({onSelectionChange:t}){const r=gt(t_);return t||r?g.jsx(e_,{onSelectionChange:t}):null}const Lf=typeof window<"u"?U.useLayoutEffect:U.useEffect,L0=[0,0],r_={x:0,y:0,zoom:1},o_=["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"],Wh=[...o_,"rfId"],i_=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}),Yh={translateExtent:Pa,nodeOrigin:L0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function s_(t){const{setNodes:r,setEdges:i,setMinZoom:s,setMaxZoom:l,setTranslateExtent:c,setNodeExtent:d,reset:h,setDefaultNodesAndEdges:v}=gt(i_,Rt),b=Mt();Lf(()=>(v(t.defaultNodes,t.defaultEdges),()=>{S.current=Yh,h()}),[]);const S=U.useRef(Yh);return Lf(()=>{for(const x of Wh){const _=t[x],C=S.current[x];_!==C&&(typeof t[x]>"u"||(x==="nodes"?r(_):x==="edges"?i(_):x==="minZoom"?s(_):x==="maxZoom"?l(_):x==="translateExtent"?c(_):x==="nodeExtent"?d(_):x==="ariaLabelConfig"?b.setState({ariaLabelConfig:U1(_)}):x==="fitView"?b.setState({fitViewQueued:_}):x==="fitViewOptions"?b.setState({fitViewOptions:_}):b.setState({[x]:_})))}S.current=t},Wh.map(x=>t[x])),null}function Xh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function a_(t){var s;const[r,i]=U.useState(t==="system"?null:t);return U.useEffect(()=>{if(t!=="system"){i(t);return}const l=Xh(),c=()=>i(l!=null&&l.matches?"dark":"light");return c(),l==null||l.addEventListener("change",c),()=>{l==null||l.removeEventListener("change",c)}},[t]),r!==null?r:(s=Xh())!=null&&s.matches?"dark":"light"}const Qh=typeof document<"u"?document:null;function Ia(t=null,r={target:Qh,actInsideInputWithModifier:!0}){const[i,s]=U.useState(!1),l=U.useRef(!1),c=U.useRef(new Set([])),[d,h]=U.useMemo(()=>{if(t!==null){const b=(Array.isArray(t)?t:[t]).filter(x=>typeof x=="string").map(x=>x.replace("+",`
|
|
197
|
+
`).replace(`
|
|
198
|
+
|
|
199
|
+
`,`
|
|
200
|
+
+`).split(`
|
|
201
|
+
`)),S=b.reduce((x,_)=>x.concat(..._),[]);return[b,S]}return[[],[]]},[t]);return U.useEffect(()=>{const v=(r==null?void 0:r.target)??Qh,b=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const S=C=>{var T,I;if(l.current=C.ctrlKey||C.metaKey||C.shiftKey||C.altKey,(!l.current||l.current&&!b)&&m0(C))return!1;const $=Jh(C.code,h);if(c.current.add(C[$]),Gh(d,c.current,!1)){const H=((I=(T=C.composedPath)==null?void 0:T.call(C))==null?void 0:I[0])||C.target,P=(H==null?void 0:H.nodeName)==="BUTTON"||(H==null?void 0:H.nodeName)==="A";r.preventDefault!==!1&&(l.current||!P)&&C.preventDefault(),s(!0)}},x=C=>{const j=Jh(C.code,h);Gh(d,c.current,!0)?(s(!1),c.current.clear()):c.current.delete(C[j]),C.key==="Meta"&&c.current.clear(),l.current=!1},_=()=>{c.current.clear(),s(!1)};return v==null||v.addEventListener("keydown",S),v==null||v.addEventListener("keyup",x),window.addEventListener("blur",_),window.addEventListener("contextmenu",_),()=>{v==null||v.removeEventListener("keydown",S),v==null||v.removeEventListener("keyup",x),window.removeEventListener("blur",_),window.removeEventListener("contextmenu",_)}}},[t,s]),i}function Gh(t,r,i){return t.filter(s=>i||s.length===r.size).some(s=>s.every(l=>r.has(l)))}function Jh(t,r){return r.includes(t)?"code":"key"}const l_=()=>{const t=Mt();return U.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:s}=t.getState();return s?s.scaleTo(r,i):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(r,i)=>{const{transform:[s,l,c],panZoom:d}=t.getState();return d?(await d.setViewport({x:r.x??s,y:r.y??l,zoom:r.zoom??c},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,i,s]=t.getState().transform;return{x:r,y:i,zoom:s}},setCenter:async(r,i,s)=>t.getState().setCenter(r,i,s),fitBounds:async(r,i)=>{const{width:s,height:l,minZoom:c,maxZoom:d,panZoom:h}=t.getState(),v=Qf(r,s,l,c,d,(i==null?void 0:i.padding)??.1);return h?(await h.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:s,snapGrid:l,snapToGrid:c,domNode:d}=t.getState();if(!d)return r;const{x:h,y:v}=d.getBoundingClientRect(),b={x:r.x-h,y:r.y-v},S=i.snapGrid??l,x=i.snapToGrid??c;return Fa(b,s,x,S)},flowToScreenPosition:r=>{const{transform:i,domNode:s}=t.getState();if(!s)return r;const{x:l,y:c}=s.getBoundingClientRect(),d=xu(r,i);return{x:d.x+l,y:d.y+c}}}),[])};function D0(t,r){const i=[],s=new Map,l=[];for(const c of t)if(c.type==="add"){l.push(c);continue}else if(c.type==="remove"||c.type==="replace")s.set(c.id,[c]);else{const d=s.get(c.id);d?d.push(c):s.set(c.id,[c])}for(const c of r){const d=s.get(c.id);if(!d){i.push(c);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){i.push({...d[0].item});continue}const h={...c};for(const v of d)u_(v,h);i.push(h)}return l.length&&l.forEach(c=>{c.index!==void 0?i.splice(c.index,0,{...c.item}):i.push({...c.item})}),i}function u_(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 z0(t,r){return D0(t,r)}function F0(t,r){return D0(t,r)}function Oi(t,r){return{id:t,type:"select",selected:r}}function Es(t,r=new Set,i=!1){const s=[];for(const[l,c]of t){const d=r.has(l);!(c.selected===void 0&&!d)&&c.selected!==d&&(i&&(c.selected=d),s.push(Oi(c.id,d)))}return s}function Zh({items:t=[],lookup:r}){var l;const i=[],s=new Map(t.map(c=>[c.id,c]));for(const[c,d]of t.entries()){const h=r.get(d.id),v=((l=h==null?void 0:h.internals)==null?void 0:l.userNode)??h;v!==void 0&&v!==d&&i.push({id:d.id,item:d,type:"replace"}),v===void 0&&i.push({item:d,type:"add",index:c})}for(const[c]of r)s.get(c)===void 0&&i.push({id:c,type:"remove"});return i}function em(t){return{id:t.id,type:"remove"}}const tm=t=>A1(t),c_=t=>a0(t);function B0(t){return U.forwardRef(t)}function nm(t){const[r,i]=U.useState(BigInt(0)),[s]=U.useState(()=>f_(()=>i(l=>l+BigInt(1))));return Lf(()=>{const l=s.get();l.length&&(t(l),s.reset())},[r]),s}function f_(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),t()}}}const H0=U.createContext(null);function d_({children:t}){const r=Mt(),i=U.useCallback(h=>{const{nodes:v=[],setNodes:b,hasDefaultNodes:S,onNodesChange:x,nodeLookup:_,fitViewQueued:C,onNodesChangeMiddlewareMap:j}=r.getState();let $=v;for(const I of h)$=typeof I=="function"?I($):I;let T=Zh({items:$,lookup:_});for(const I of j.values())T=I(T);S&&b($),T.length>0?x==null||x(T):C&&window.requestAnimationFrame(()=>{const{fitViewQueued:I,nodes:H,setNodes:P}=r.getState();I&&P(H)})},[]),s=nm(i),l=U.useCallback(h=>{const{edges:v=[],setEdges:b,hasDefaultEdges:S,onEdgesChange:x,edgeLookup:_}=r.getState();let C=v;for(const j of h)C=typeof j=="function"?j(C):j;S?b(C):x&&x(Zh({items:C,lookup:_}))},[]),c=nm(l),d=U.useMemo(()=>({nodeQueue:s,edgeQueue:c}),[]);return g.jsx(H0.Provider,{value:d,children:t})}function p_(){const t=U.useContext(H0);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const h_=t=>!!t.panZoom;function rd(){const t=l_(),r=Mt(),i=p_(),s=gt(h_),l=U.useMemo(()=>{const c=x=>r.getState().nodeLookup.get(x),d=x=>{i.nodeQueue.push(x)},h=x=>{i.edgeQueue.push(x)},v=x=>{var I,H;const{nodeLookup:_,nodeOrigin:C}=r.getState(),j=tm(x)?x:_.get(x.id),$=j.parentId?p0(j.position,j.measured,j.parentId,_,C):j.position,T={...j,position:$,width:((I=j.measured)==null?void 0:I.width)??j.width,height:((H=j.measured)==null?void 0:H.height)??j.height};return Is(T)},b=(x,_,C={replace:!1})=>{d(j=>j.map($=>{if($.id===x){const T=typeof _=="function"?_($):_;return C.replace&&tm(T)?T:{...$,...T}}return $}))},S=(x,_,C={replace:!1})=>{h(j=>j.map($=>{if($.id===x){const T=typeof _=="function"?_($):_;return C.replace&&c_(T)?T:{...$,...T}}return $}))};return{getNodes:()=>r.getState().nodes.map(x=>({...x})),getNode:x=>{var _;return(_=c(x))==null?void 0:_.internals.userNode},getInternalNode:c,getEdges:()=>{const{edges:x=[]}=r.getState();return x.map(_=>({..._}))},getEdge:x=>r.getState().edgeLookup.get(x),setNodes:d,setEdges:h,addNodes:x=>{const _=Array.isArray(x)?x:[x];i.nodeQueue.push(C=>[...C,..._])},addEdges:x=>{const _=Array.isArray(x)?x:[x];i.edgeQueue.push(C=>[...C,..._])},toObject:()=>{const{nodes:x=[],edges:_=[],transform:C}=r.getState(),[j,$,T]=C;return{nodes:x.map(I=>({...I})),edges:_.map(I=>({...I})),viewport:{x:j,y:$,zoom:T}}},deleteElements:async({nodes:x=[],edges:_=[]})=>{const{nodes:C,edges:j,onNodesDelete:$,onEdgesDelete:T,triggerNodeChanges:I,triggerEdgeChanges:H,onDelete:P,onBeforeDelete:R}=r.getState(),{nodes:B,edges:V}=await z1({nodesToRemove:x,edgesToRemove:_,nodes:C,edges:j,onBeforeDelete:R}),W=V.length>0,Q=B.length>0;if(W){const de=V.map(em);T==null||T(V),H(de)}if(Q){const de=B.map(em);$==null||$(B),I(de)}return(Q||W)&&(P==null||P({nodes:B,edges:V})),{deletedNodes:B,deletedEdges:V}},getIntersectingNodes:(x,_=!0,C)=>{const j=Ch(x),$=j?x:v(x),T=C!==void 0;return $?(C||r.getState().nodes).filter(I=>{const H=r.getState().nodeLookup.get(I.id);if(H&&!j&&(I.id===x.id||!H.internals.positionAbsolute))return!1;const P=Is(T?I:H),R=Ma(P,$);return _&&R>0||R>=P.width*P.height||R>=$.width*$.height}):[]},isNodeIntersecting:(x,_,C=!0)=>{const $=Ch(x)?x:v(x);if(!$)return!1;const T=Ma($,_);return C&&T>0||T>=_.width*_.height||T>=$.width*$.height},updateNode:b,updateNodeData:(x,_,C={replace:!1})=>{b(x,j=>{const $=typeof _=="function"?_(j):_;return C.replace?{...j,data:$}:{...j,data:{...j.data,...$}}},C)},updateEdge:S,updateEdgeData:(x,_,C={replace:!1})=>{S(x,j=>{const $=typeof _=="function"?_(j):_;return C.replace?{...j,data:$}:{...j,data:{...j.data,...$}}},C)},getNodesBounds:x=>{const{nodeLookup:_,nodeOrigin:C}=r.getState();return O1(x,{nodeLookup:_,nodeOrigin:C})},getHandleConnections:({type:x,id:_,nodeId:C})=>{var j;return Array.from(((j=r.getState().connectionLookup.get(`${C}-${x}${_?`-${_}`:""}`))==null?void 0:j.values())??[])},getNodeConnections:({type:x,handleId:_,nodeId:C})=>{var j;return Array.from(((j=r.getState().connectionLookup.get(`${C}${x?_?`-${x}-${_}`:`-${x}`:""}`))==null?void 0:j.values())??[])},fitView:async x=>{const _=r.getState().fitViewResolver??V1();return r.setState({fitViewQueued:!0,fitViewOptions:x,fitViewResolver:_}),i.nodeQueue.push(C=>[...C]),_.promise}}},[]);return U.useMemo(()=>({...l,...t,viewportInitialized:s}),[s])}const rm=t=>t.selected,m_=typeof window<"u"?window:void 0;function g_({deleteKeyCode:t,multiSelectionKeyCode:r}){const i=Mt(),{deleteElements:s}=rd(),l=Ia(t,{actInsideInputWithModifier:!1}),c=Ia(r,{target:m_});U.useEffect(()=>{if(l){const{edges:d,nodes:h}=i.getState();s({nodes:h.filter(rm),edges:d.filter(rm)}),i.setState({nodesSelectionActive:!1})}},[l]),U.useEffect(()=>{i.setState({multiSelectionActive:c})},[c])}function y_(t){const r=Mt();U.useEffect(()=>{const i=()=>{var l,c,d,h;if(!t.current||!(((c=(l=t.current).checkVisibility)==null?void 0:c.call(l))??!0))return!1;const s=Gf(t.current);(s.height===0||s.width===0)&&((h=(d=r.getState()).onError)==null||h.call(d,"004",to.error004())),r.setState({width:s.width||500,height:s.height||500})};if(t.current){i(),window.addEventListener("resize",i);const s=new ResizeObserver(()=>i());return s.observe(t.current),()=>{window.removeEventListener("resize",i),s&&t.current&&s.unobserve(t.current)}}},[])}const Au={position:"absolute",width:"100%",height:"100%",top:0,left:0},v_=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function x_({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=zi.Free,zoomOnDoubleClick:d=!0,panOnDrag:h=!0,defaultViewport:v,translateExtent:b,minZoom:S,maxZoom:x,zoomActivationKeyCode:_,preventScrolling:C=!0,children:j,noWheelClassName:$,noPanClassName:T,onViewportChange:I,isControlledViewport:H,paneClickDistance:P,selectionOnDrag:R}){const B=Mt(),V=U.useRef(null),{userSelectionActive:W,lib:Q,connectionInProgress:de}=gt(v_,Rt),ke=Ia(_),Y=U.useRef();y_(V);const fe=U.useCallback(ve=>{I==null||I({x:ve[0],y:ve[1],zoom:ve[2]}),H||B.setState({transform:ve})},[I,H]);return U.useEffect(()=>{if(V.current){Y.current=Nb({domNode:V.current,minZoom:S,maxZoom:x,translateExtent:b,viewport:v,onDraggingChange:G=>B.setState(se=>se.paneDragging===G?se:{paneDragging:G}),onPanZoomStart:(G,se)=>{const{onViewportChangeStart:F,onMoveStart:q}=B.getState();q==null||q(G,se),F==null||F(se)},onPanZoom:(G,se)=>{const{onViewportChange:F,onMove:q}=B.getState();q==null||q(G,se),F==null||F(se)},onPanZoomEnd:(G,se)=>{const{onViewportChangeEnd:F,onMoveEnd:q}=B.getState();q==null||q(G,se),F==null||F(se)}});const{x:ve,y:D,zoom:ue}=Y.current.getViewport();return B.setState({panZoom:Y.current,transform:[ve,D,ue],domNode:V.current.closest(".react-flow")}),()=>{var G;(G=Y.current)==null||G.destroy()}}},[]),U.useEffect(()=>{var ve;(ve=Y.current)==null||ve.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:s,panOnScrollSpeed:l,panOnScrollMode:c,zoomOnDoubleClick:d,panOnDrag:h,zoomActivationKeyPressed:ke,preventScrolling:C,noPanClassName:T,userSelectionActive:W,noWheelClassName:$,lib:Q,onTransformChange:fe,connectionInProgress:de,selectionOnDrag:R,paneClickDistance:P})},[t,r,i,s,l,c,d,h,ke,C,T,W,$,Q,fe,de,R,P]),g.jsx("div",{className:"react-flow__renderer",ref:V,style:Au,children:j})}const w_=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function b_(){const{userSelectionActive:t,userSelectionRect:r}=gt(w_,Rt);return t&&r?g.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 mf=(t,r)=>i=>{i.target===r.current&&(t==null||t(i))},__=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function S_({isSelecting:t,selectionKeyPressed:r,selectionMode:i=$a.Full,panOnDrag:s,paneClickDistance:l,selectionOnDrag:c,onSelectionStart:d,onSelectionEnd:h,onPaneClick:v,onPaneContextMenu:b,onPaneScroll:S,onPaneMouseEnter:x,onPaneMouseMove:_,onPaneMouseLeave:C,children:j}){const $=Mt(),{userSelectionActive:T,elementsSelectable:I,dragging:H,connectionInProgress:P}=gt(__,Rt),R=I&&(t||T),B=U.useRef(null),V=U.useRef(),W=U.useRef(new Set),Q=U.useRef(new Set),de=U.useRef(!1),ke=F=>{if(de.current||P){de.current=!1;return}v==null||v(F),$.getState().resetSelectedElements(),$.setState({nodesSelectionActive:!1})},Y=F=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){F.preventDefault();return}b==null||b(F)},fe=S?F=>S(F):void 0,ve=F=>{de.current&&(F.stopPropagation(),de.current=!1)},D=F=>{var $e,Ae;const{domNode:q}=$.getState();if(V.current=q==null?void 0:q.getBoundingClientRect(),!V.current)return;const Z=F.target===B.current;if(!Z&&!!F.target.closest(".nokey")||!t||!(c&&Z||r)||F.button!==0||!F.isPrimary)return;(Ae=($e=F.target)==null?void 0:$e.setPointerCapture)==null||Ae.call($e,F.pointerId),de.current=!1;const{x:pe,y:be}=zr(F.nativeEvent,V.current);$.setState({userSelectionRect:{width:0,height:0,startX:pe,startY:be,x:pe,y:be}}),Z||(F.stopPropagation(),F.preventDefault())},ue=F=>{const{userSelectionRect:q,transform:Z,nodeLookup:A,edgeLookup:K,connectionLookup:pe,triggerNodeChanges:be,triggerEdgeChanges:$e,defaultEdgeOptions:Ae,resetSelectedElements:Oe}=$.getState();if(!V.current||!q)return;const{x:Se,y:De}=zr(F.nativeEvent,V.current),{startX:Ne,startY:et}=q;if(!de.current){const ot=r?0:l;if(Math.hypot(Se-Ne,De-et)<=ot)return;Oe(),d==null||d(F)}de.current=!0;const Fe={startX:Ne,startY:et,x:Se<Ne?Se:Ne,y:De<et?De:et,width:Math.abs(Se-Ne),height:Math.abs(De-et)},Ke=W.current,qe=Q.current;W.current=new Set(Xf(A,Fe,Z,i===$a.Partial,!0).map(ot=>ot.id)),Q.current=new Set;const at=(Ae==null?void 0:Ae.selectable)??!0;for(const ot of W.current){const Tt=pe.get(ot);if(Tt)for(const{edgeId:xn}of Tt.values()){const Wt=K.get(xn);Wt&&(Wt.selectable??at)&&Q.current.add(xn)}}if(!jh(Ke,W.current)){const ot=Es(A,W.current,!0);be(ot)}if(!jh(qe,Q.current)){const ot=Es(K,Q.current);$e(ot)}$.setState({userSelectionRect:Fe,userSelectionActive:!0,nodesSelectionActive:!1})},G=F=>{var q,Z;F.button===0&&((Z=(q=F.target)==null?void 0:q.releasePointerCapture)==null||Z.call(q,F.pointerId),!T&&F.target===B.current&&$.getState().userSelectionRect&&(ke==null||ke(F)),$.setState({userSelectionActive:!1,userSelectionRect:null}),de.current&&(h==null||h(F),$.setState({nodesSelectionActive:W.current.size>0})))},se=s===!0||Array.isArray(s)&&s.includes(0);return g.jsxs("div",{className:Zt(["react-flow__pane",{draggable:se,dragging:H,selection:t}]),onClick:R?void 0:mf(ke,B),onContextMenu:mf(Y,B),onWheel:mf(fe,B),onPointerEnter:R?void 0:x,onPointerMove:R?ue:_,onPointerUp:R?G:void 0,onPointerDownCapture:R?D:void 0,onClickCapture:R?ve:void 0,onPointerLeave:C,ref:B,style:Au,children:[j,g.jsx(b_,{})]})}function Df({id:t,store:r,unselect:i=!1,nodeRef:s}){const{addSelectedNodes:l,unselectNodesAndEdges:c,multiSelectionActive:d,nodeLookup:h,onError:v}=r.getState(),b=h.get(t);if(!b){v==null||v("012",to.error012(t));return}r.setState({nodesSelectionActive:!1}),b.selected?(i||b.selected&&d)&&(c({nodes:[b],edges:[]}),requestAnimationFrame(()=>{var S;return(S=s==null?void 0:s.current)==null?void 0:S.blur()})):l([t])}function V0({nodeRef:t,disabled:r=!1,noDragClassName:i,handleSelector:s,nodeId:l,isSelectable:c,nodeClickDistance:d}){const h=Mt(),[v,b]=U.useState(!1),S=U.useRef();return U.useEffect(()=>{S.current=fb({getStoreItems:()=>h.getState(),onNodeMouseDown:x=>{Df({id:x,store:h,nodeRef:t})},onDragStart:()=>{b(!0)},onDragStop:()=>{b(!1)}})},[]),U.useEffect(()=>{if(!(r||!t.current||!S.current))return S.current.update({noDragClassName:i,handleSelector:s,domNode:t.current,isSelectable:c,nodeId:l,nodeClickDistance:d}),()=>{var x;(x=S.current)==null||x.destroy()}},[i,s,r,c,t,l,d]),v}const k_=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function U0(){const t=Mt();return U.useCallback(i=>{const{nodeExtent:s,snapToGrid:l,snapGrid:c,nodesDraggable:d,onError:h,updateNodePositions:v,nodeLookup:b,nodeOrigin:S}=t.getState(),x=new Map,_=k_(d),C=l?c[0]:5,j=l?c[1]:5,$=i.direction.x*C*i.factor,T=i.direction.y*j*i.factor;for(const[,I]of b){if(!_(I))continue;let H={x:I.internals.positionAbsolute.x+$,y:I.internals.positionAbsolute.y+T};l&&(H=za(H,c));const{position:P,positionAbsolute:R}=l0({nodeId:I.id,nextPosition:H,nodeLookup:b,nodeExtent:s,nodeOrigin:S,onError:h});I.position=P,I.internals.positionAbsolute=R,x.set(I.id,I)}v(x)},[])}const od=U.createContext(null),N_=od.Provider;od.Consumer;const K0=()=>U.useContext(od),E_=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),C_=(t,r,i)=>s=>{const{connectionClickStartHandle:l,connectionMode:c,connection:d}=s,{fromHandle:h,toHandle:v,isValid:b}=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:(h==null?void 0:h.nodeId)===t&&(h==null?void 0:h.id)===r&&(h==null?void 0:h.type)===i,connectingTo:S,clickConnecting:(l==null?void 0:l.nodeId)===t&&(l==null?void 0:l.id)===r&&(l==null?void 0:l.type)===i,isPossibleEndHandle:c===Ms.Strict?(h==null?void 0:h.type)!==i:t!==(h==null?void 0:h.nodeId)||r!==(h==null?void 0:h.id),connectionInProcess:!!h,clickConnectionInProcess:!!l,valid:S&&b}};function j_({type:t="source",position:r=tt.Top,isValidConnection:i,isConnectable:s=!0,isConnectableStart:l=!0,isConnectableEnd:c=!0,id:d,onConnect:h,children:v,className:b,onMouseDown:S,onTouchStart:x,..._},C){var ue,G;const j=d||null,$=t==="target",T=Mt(),I=K0(),{connectOnClick:H,noPanClassName:P,rfId:R}=gt(E_,Rt),{connectingFrom:B,connectingTo:V,clickConnecting:W,isPossibleEndHandle:Q,connectionInProcess:de,clickConnectionInProcess:ke,valid:Y}=gt(C_(I,j,t),Rt);I||(G=(ue=T.getState()).onError)==null||G.call(ue,"010",to.error010());const fe=se=>{const{defaultEdgeOptions:F,onConnect:q,hasDefaultEdges:Z}=T.getState(),A={...F,...se};if(Z){const{edges:K,setEdges:pe}=T.getState();pe(w0(A,K))}q==null||q(A),h==null||h(A)},ve=se=>{if(!I)return;const F=g0(se.nativeEvent);if(l&&(F&&se.button===0||!F)){const q=T.getState();Rf.onPointerDown(se.nativeEvent,{handleDomNode:se.currentTarget,autoPanOnConnect:q.autoPanOnConnect,connectionMode:q.connectionMode,connectionRadius:q.connectionRadius,domNode:q.domNode,nodeLookup:q.nodeLookup,lib:q.lib,isTarget:$,handleId:j,nodeId:I,flowId:q.rfId,panBy:q.panBy,cancelConnection:q.cancelConnection,onConnectStart:q.onConnectStart,onConnectEnd:(...Z)=>{var A,K;return(K=(A=T.getState()).onConnectEnd)==null?void 0:K.call(A,...Z)},updateConnection:q.updateConnection,onConnect:fe,isValidConnection:i||((...Z)=>{var A,K;return((K=(A=T.getState()).isValidConnection)==null?void 0:K.call(A,...Z))??!0}),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:q.autoPanSpeed,dragThreshold:q.connectionDragThreshold})}F?S==null||S(se):x==null||x(se)},D=se=>{const{onClickConnectStart:F,onClickConnectEnd:q,connectionClickStartHandle:Z,connectionMode:A,isValidConnection:K,lib:pe,rfId:be,nodeLookup:$e,connection:Ae}=T.getState();if(!I||!Z&&!l)return;if(!Z){F==null||F(se.nativeEvent,{nodeId:I,handleId:j,handleType:t}),T.setState({connectionClickStartHandle:{nodeId:I,type:t,id:j}});return}const Oe=h0(se.target),Se=i||K,{connection:De,isValid:Ne}=Rf.isValid(se.nativeEvent,{handle:{nodeId:I,id:j,type:t},connectionMode:A,fromNodeId:Z.nodeId,fromHandleId:Z.id||null,fromType:Z.type,isValidConnection:Se,flowId:be,doc:Oe,lib:pe,nodeLookup:$e});Ne&&De&&fe(De);const et=structuredClone(Ae);delete et.inProgress,et.toPosition=et.toHandle?et.toHandle.position:null,q==null||q(se,et),T.setState({connectionClickStartHandle:null})};return g.jsx("div",{"data-handleid":j,"data-nodeid":I,"data-handlepos":r,"data-id":`${R}-${I}-${j}-${t}`,className:Zt(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",P,b,{source:!$,target:$,connectable:s,connectablestart:l,connectableend:c,clickconnecting:W,connectingfrom:B,connectingto:V,valid:Y,connectionindicator:s&&(!de||Q)&&(de||ke?c:l)}]),onMouseDown:ve,onTouchStart:ve,onClick:H?D:void 0,ref:C,..._,children:v})}const Rs=U.memo(B0(j_));function P_({data:t,isConnectable:r,sourcePosition:i=tt.Bottom}){return g.jsxs(g.Fragment,{children:[t==null?void 0:t.label,g.jsx(Rs,{type:"source",position:i,isConnectable:r})]})}function $_({data:t,isConnectable:r,targetPosition:i=tt.Top,sourcePosition:s=tt.Bottom}){return g.jsxs(g.Fragment,{children:[g.jsx(Rs,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label,g.jsx(Rs,{type:"source",position:s,isConnectable:r})]})}function M_(){return null}function T_({data:t,isConnectable:r,targetPosition:i=tt.Top}){return g.jsxs(g.Fragment,{children:[g.jsx(Rs,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label]})}const wu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},om={input:P_,default:$_,output:T_,group:M_};function I_(t){var r,i,s,l;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??((s=t.style)==null?void 0:s.width),height:t.height??((l=t.style)==null?void 0:l.height)}}const A_=t=>{const{width:r,height:i,x:s,y:l}=Da(t.nodeLookup,{filter:c=>!!c.selected});return{width:Dr(r)?r:null,height:Dr(i)?i:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${s}px,${l}px)`}};function O_({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:i}){const s=Mt(),{width:l,height:c,transformString:d,userSelectionActive:h}=gt(A_,Rt),v=U0(),b=U.useRef(null);U.useEffect(()=>{var C;i||(C=b.current)==null||C.focus({preventScroll:!0})},[i]);const S=!h&&l!==null&&c!==null;if(V0({nodeRef:b,disabled:!S}),!S)return null;const x=t?C=>{const j=s.getState().nodes.filter($=>$.selected);t(C,j)}:void 0,_=C=>{Object.prototype.hasOwnProperty.call(wu,C.key)&&(C.preventDefault(),v({direction:wu[C.key],factor:C.shiftKey?4:1}))};return g.jsx("div",{className:Zt(["react-flow__nodesselection","react-flow__container",r]),style:{transform:d},children:g.jsx("div",{ref:b,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:i?void 0:-1,onKeyDown:i?void 0:_,style:{width:l,height:c}})})}const im=typeof window<"u"?window:void 0,R_=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function q0({children:t,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:l,onPaneContextMenu:c,onPaneScroll:d,paneClickDistance:h,deleteKeyCode:v,selectionKeyCode:b,selectionOnDrag:S,selectionMode:x,onSelectionStart:_,onSelectionEnd:C,multiSelectionKeyCode:j,panActivationKeyCode:$,zoomActivationKeyCode:T,elementsSelectable:I,zoomOnScroll:H,zoomOnPinch:P,panOnScroll:R,panOnScrollSpeed:B,panOnScrollMode:V,zoomOnDoubleClick:W,panOnDrag:Q,defaultViewport:de,translateExtent:ke,minZoom:Y,maxZoom:fe,preventScrolling:ve,onSelectionContextMenu:D,noWheelClassName:ue,noPanClassName:G,disableKeyboardA11y:se,onViewportChange:F,isControlledViewport:q}){const{nodesSelectionActive:Z,userSelectionActive:A}=gt(R_,Rt),K=Ia(b,{target:im}),pe=Ia($,{target:im}),be=pe||Q,$e=pe||R,Ae=S&&be!==!0,Oe=K||A||Ae;return g_({deleteKeyCode:v,multiSelectionKeyCode:j}),g.jsx(x_,{onPaneContextMenu:c,elementsSelectable:I,zoomOnScroll:H,zoomOnPinch:P,panOnScroll:$e,panOnScrollSpeed:B,panOnScrollMode:V,zoomOnDoubleClick:W,panOnDrag:!K&&be,defaultViewport:de,translateExtent:ke,minZoom:Y,maxZoom:fe,zoomActivationKeyCode:T,preventScrolling:ve,noWheelClassName:ue,noPanClassName:G,onViewportChange:F,isControlledViewport:q,paneClickDistance:h,selectionOnDrag:Ae,children:g.jsxs(S_,{onSelectionStart:_,onSelectionEnd:C,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:l,onPaneContextMenu:c,onPaneScroll:d,panOnDrag:be,isSelecting:!!Oe,selectionMode:x,selectionKeyPressed:K,paneClickDistance:h,selectionOnDrag:Ae,children:[t,Z&&g.jsx(O_,{onSelectionContextMenu:D,noPanClassName:G,disableKeyboardA11y:se})]})})}q0.displayName="FlowRenderer";const L_=U.memo(q0),D_=t=>r=>t?Xf(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 z_(t){return gt(U.useCallback(D_(t),[t]),Rt)}const F_=t=>t.updateNodeInternals;function B_(){const t=gt(F_),[r]=U.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const s=new Map;i.forEach(l=>{const c=l.target.getAttribute("data-id");s.set(c,{id:c,nodeElement:l.target,force:!0})}),t(s)}));return U.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function H_({node:t,nodeType:r,hasDimensions:i,resizeObserver:s}){const l=Mt(),c=U.useRef(null),d=U.useRef(null),h=U.useRef(t.sourcePosition),v=U.useRef(t.targetPosition),b=U.useRef(r),S=i&&!!t.internals.handleBounds;return U.useEffect(()=>{c.current&&!t.hidden&&(!S||d.current!==c.current)&&(d.current&&(s==null||s.unobserve(d.current)),s==null||s.observe(c.current),d.current=c.current)},[S,t.hidden]),U.useEffect(()=>()=>{d.current&&(s==null||s.unobserve(d.current),d.current=null)},[]),U.useEffect(()=>{if(c.current){const x=b.current!==r,_=h.current!==t.sourcePosition,C=v.current!==t.targetPosition;(x||_||C)&&(b.current=r,h.current=t.sourcePosition,v.current=t.targetPosition,l.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:c.current,force:!0}]])))}},[t.id,r,t.sourcePosition,t.targetPosition]),c}function V_({id:t,onClick:r,onMouseEnter:i,onMouseMove:s,onMouseLeave:l,onContextMenu:c,onDoubleClick:d,nodesDraggable:h,elementsSelectable:v,nodesConnectable:b,nodesFocusable:S,resizeObserver:x,noDragClassName:_,noPanClassName:C,disableKeyboardA11y:j,rfId:$,nodeTypes:T,nodeClickDistance:I,onError:H}){const{node:P,internals:R,isParent:B}=gt(Se=>{const De=Se.nodeLookup.get(t),Ne=Se.parentLookup.has(t);return{node:De,internals:De.internals,isParent:Ne}},Rt);let V=P.type||"default",W=(T==null?void 0:T[V])||om[V];W===void 0&&(H==null||H("003",to.error003(V)),V="default",W=(T==null?void 0:T.default)||om.default);const Q=!!(P.draggable||h&&typeof P.draggable>"u"),de=!!(P.selectable||v&&typeof P.selectable>"u"),ke=!!(P.connectable||b&&typeof P.connectable>"u"),Y=!!(P.focusable||S&&typeof P.focusable>"u"),fe=Mt(),ve=d0(P),D=H_({node:P,nodeType:V,hasDimensions:ve,resizeObserver:x}),ue=V0({nodeRef:D,disabled:P.hidden||!Q,noDragClassName:_,handleSelector:P.dragHandle,nodeId:t,isSelectable:de,nodeClickDistance:I}),G=U0();if(P.hidden)return null;const se=Oo(P),F=I_(P),q=de||Q||r||i||s||l,Z=i?Se=>i(Se,{...R.userNode}):void 0,A=s?Se=>s(Se,{...R.userNode}):void 0,K=l?Se=>l(Se,{...R.userNode}):void 0,pe=c?Se=>c(Se,{...R.userNode}):void 0,be=d?Se=>d(Se,{...R.userNode}):void 0,$e=Se=>{const{selectNodesOnDrag:De,nodeDragThreshold:Ne}=fe.getState();de&&(!De||!Q||Ne>0)&&Df({id:t,store:fe,nodeRef:D}),r&&r(Se,{...R.userNode})},Ae=Se=>{if(!(m0(Se.nativeEvent)||j)){if(r0.includes(Se.key)&&de){const De=Se.key==="Escape";Df({id:t,store:fe,unselect:De,nodeRef:D})}else if(Q&&P.selected&&Object.prototype.hasOwnProperty.call(wu,Se.key)){Se.preventDefault();const{ariaLabelConfig:De}=fe.getState();fe.setState({ariaLiveMessage:De["node.a11yDescription.ariaLiveMessage"]({direction:Se.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),G({direction:wu[Se.key],factor:Se.shiftKey?4:1})}}},Oe=()=>{var qe;if(j||!((qe=D.current)!=null&&qe.matches(":focus-visible")))return;const{transform:Se,width:De,height:Ne,autoPanOnNodeFocus:et,setCenter:Fe}=fe.getState();if(!et)return;Xf(new Map([[t,P]]),{x:0,y:0,width:De,height:Ne},Se,!0).length>0||Fe(P.position.x+se.width/2,P.position.y+se.height/2,{zoom:Se[2]})};return g.jsx("div",{className:Zt(["react-flow__node",`react-flow__node-${V}`,{[C]:Q},P.className,{selected:P.selected,selectable:de,parent:B,draggable:Q,dragging:ue}]),ref:D,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:q?"all":"none",visibility:ve?"visible":"hidden",...P.style,...F},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:Z,onMouseMove:A,onMouseLeave:K,onContextMenu:pe,onClick:$e,onDoubleClick:be,onKeyDown:Y?Ae:void 0,tabIndex:Y?0:void 0,onFocus:Y?Oe:void 0,role:P.ariaRole??(Y?"group":void 0),"aria-roledescription":"node","aria-describedby":j?void 0:`${O0}-${$}`,"aria-label":P.ariaLabel,...P.domAttributes,children:g.jsx(N_,{value:t,children:g.jsx(W,{id:t,data:P.data,type:V,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:P.selected??!1,selectable:de,draggable:Q,deletable:P.deletable??!0,isConnectable:ke,sourcePosition:P.sourcePosition,targetPosition:P.targetPosition,dragging:ue,dragHandle:P.dragHandle,zIndex:R.z,parentId:P.parentId,...se})})})}var U_=U.memo(V_);const K_=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function W0(t){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:l,onError:c}=gt(K_,Rt),d=z_(t.onlyRenderVisibleElements),h=B_();return g.jsx("div",{className:"react-flow__nodes",style:Au,children:d.map(v=>g.jsx(U_,{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:h,nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:l,nodeClickDistance:t.nodeClickDistance,onError:c},v))})}W0.displayName="NodeRenderer";const q_=U.memo(W0);function W_(t){return gt(U.useCallback(i=>{if(!t)return i.edges.map(l=>l.id);const s=[];if(i.width&&i.height)for(const l of i.edges){const c=i.nodeLookup.get(l.source),d=i.nodeLookup.get(l.target);c&&d&&W1({sourceNode:c,targetNode:d,width:i.width,height:i.height,transform:i.transform})&&s.push(l.id)}return s},[t]),Rt)}const Y_=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t}};return g.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},X_=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t,fill:t}};return g.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},sm={[yu.Arrow]:Y_,[yu.ArrowClosed]:X_};function Q_(t){const r=Mt();return U.useMemo(()=>{var l,c;return Object.prototype.hasOwnProperty.call(sm,t)?sm[t]:((c=(l=r.getState()).onError)==null||c.call(l,"009",to.error009(t)),null)},[t])}const G_=({id:t,type:r,color:i,width:s=12.5,height:l=12.5,markerUnits:c="strokeWidth",strokeWidth:d,orient:h="auto-start-reverse"})=>{const v=Q_(r);return v?g.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${s}`,markerHeight:`${l}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:h,refX:"0",refY:"0",children:g.jsx(v,{color:i,strokeWidth:d})}):null},Y0=({defaultColor:t,rfId:r})=>{const i=gt(c=>c.edges),s=gt(c=>c.defaultEdgeOptions),l=U.useMemo(()=>eb(i,{id:r,defaultColor:t,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[i,s,r,t]);return l.length?g.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:g.jsx("defs",{children:l.map(c=>g.jsx(G_,{id:c.id,type:c.type,color:c.color,width:c.width,height:c.height,markerUnits:c.markerUnits,strokeWidth:c.strokeWidth,orient:c.orient},c.id))})}):null};Y0.displayName="MarkerDefinitions";var J_=U.memo(Y0);function X0({x:t,y:r,label:i,labelStyle:s,labelShowBg:l=!0,labelBgStyle:c,labelBgPadding:d=[2,4],labelBgBorderRadius:h=2,children:v,className:b,...S}){const[x,_]=U.useState({x:1,y:0,width:0,height:0}),C=Zt(["react-flow__edge-textwrapper",b]),j=U.useRef(null);return U.useEffect(()=>{if(j.current){const $=j.current.getBBox();_({x:$.x,y:$.y,width:$.width,height:$.height})}},[i]),i?g.jsxs("g",{transform:`translate(${t-x.width/2} ${r-x.height/2})`,className:C,visibility:x.width?"visible":"hidden",...S,children:[l&&g.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:c,rx:h,ry:h}),g.jsx("text",{className:"react-flow__edge-text",y:x.height/2,dy:"0.3em",ref:j,style:s,children:i}),v]}):null}X0.displayName="EdgeText";const Z_=U.memo(X0);function Ou({path:t,labelX:r,labelY:i,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:v,interactionWidth:b=20,...S}){return g.jsxs(g.Fragment,{children:[g.jsx("path",{...S,d:t,fill:"none",className:Zt(["react-flow__edge-path",S.className])}),b?g.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:b,className:"react-flow__edge-interaction"}):null,s&&Dr(r)&&Dr(i)?g.jsx(Z_,{x:r,y:i,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:v}):null]})}function am({pos:t,x1:r,y1:i,x2:s,y2:l}){return t===tt.Left||t===tt.Right?[.5*(r+s),i]:[r,.5*(i+l)]}function Q0({sourceX:t,sourceY:r,sourcePosition:i=tt.Bottom,targetX:s,targetY:l,targetPosition:c=tt.Top}){const[d,h]=am({pos:i,x1:t,y1:r,x2:s,y2:l}),[v,b]=am({pos:c,x1:s,y1:l,x2:t,y2:r}),[S,x,_,C]=y0({sourceX:t,sourceY:r,targetX:s,targetY:l,sourceControlX:d,sourceControlY:h,targetControlX:v,targetControlY:b});return[`M${t},${r} C${d},${h} ${v},${b} ${s},${l}`,S,x,_,C]}function G0(t){return U.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,sourcePosition:d,targetPosition:h,label:v,labelStyle:b,labelShowBg:S,labelBgStyle:x,labelBgPadding:_,labelBgBorderRadius:C,style:j,markerEnd:$,markerStart:T,interactionWidth:I})=>{const[H,P,R]=Q0({sourceX:i,sourceY:s,sourcePosition:d,targetX:l,targetY:c,targetPosition:h}),B=t.isInternal?void 0:r;return g.jsx(Ou,{id:B,path:H,labelX:P,labelY:R,label:v,labelStyle:b,labelShowBg:S,labelBgStyle:x,labelBgPadding:_,labelBgBorderRadius:C,style:j,markerEnd:$,markerStart:T,interactionWidth:I})})}const eS=G0({isInternal:!1}),J0=G0({isInternal:!0});eS.displayName="SimpleBezierEdge";J0.displayName="SimpleBezierEdgeInternal";function Z0(t){return U.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,label:d,labelStyle:h,labelShowBg:v,labelBgStyle:b,labelBgPadding:S,labelBgBorderRadius:x,style:_,sourcePosition:C=tt.Bottom,targetPosition:j=tt.Top,markerEnd:$,markerStart:T,pathOptions:I,interactionWidth:H})=>{const[P,R,B]=If({sourceX:i,sourceY:s,sourcePosition:C,targetX:l,targetY:c,targetPosition:j,borderRadius:I==null?void 0:I.borderRadius,offset:I==null?void 0:I.offset,stepPosition:I==null?void 0:I.stepPosition}),V=t.isInternal?void 0:r;return g.jsx(Ou,{id:V,path:P,labelX:R,labelY:B,label:d,labelStyle:h,labelShowBg:v,labelBgStyle:b,labelBgPadding:S,labelBgBorderRadius:x,style:_,markerEnd:$,markerStart:T,interactionWidth:H})})}const eg=Z0({isInternal:!1}),tg=Z0({isInternal:!0});eg.displayName="SmoothStepEdge";tg.displayName="SmoothStepEdgeInternal";function ng(t){return U.memo(({id:r,...i})=>{var l;const s=t.isInternal?void 0:r;return g.jsx(eg,{...i,id:s,pathOptions:U.useMemo(()=>{var c;return{borderRadius:0,offset:(c=i.pathOptions)==null?void 0:c.offset}},[(l=i.pathOptions)==null?void 0:l.offset])})})}const tS=ng({isInternal:!1}),rg=ng({isInternal:!0});tS.displayName="StepEdge";rg.displayName="StepEdgeInternal";function og(t){return U.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,label:d,labelStyle:h,labelShowBg:v,labelBgStyle:b,labelBgPadding:S,labelBgBorderRadius:x,style:_,markerEnd:C,markerStart:j,interactionWidth:$})=>{const[T,I,H]=b0({sourceX:i,sourceY:s,targetX:l,targetY:c}),P=t.isInternal?void 0:r;return g.jsx(Ou,{id:P,path:T,labelX:I,labelY:H,label:d,labelStyle:h,labelShowBg:v,labelBgStyle:b,labelBgPadding:S,labelBgBorderRadius:x,style:_,markerEnd:C,markerStart:j,interactionWidth:$})})}const nS=og({isInternal:!1}),ig=og({isInternal:!0});nS.displayName="StraightEdge";ig.displayName="StraightEdgeInternal";function sg(t){return U.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,sourcePosition:d=tt.Bottom,targetPosition:h=tt.Top,label:v,labelStyle:b,labelShowBg:S,labelBgStyle:x,labelBgPadding:_,labelBgBorderRadius:C,style:j,markerEnd:$,markerStart:T,pathOptions:I,interactionWidth:H})=>{const[P,R,B]=v0({sourceX:i,sourceY:s,sourcePosition:d,targetX:l,targetY:c,targetPosition:h,curvature:I==null?void 0:I.curvature}),V=t.isInternal?void 0:r;return g.jsx(Ou,{id:V,path:P,labelX:R,labelY:B,label:v,labelStyle:b,labelShowBg:S,labelBgStyle:x,labelBgPadding:_,labelBgBorderRadius:C,style:j,markerEnd:$,markerStart:T,interactionWidth:H})})}const rS=sg({isInternal:!1}),ag=sg({isInternal:!0});rS.displayName="BezierEdge";ag.displayName="BezierEdgeInternal";const lm={default:ag,straight:ig,step:rg,smoothstep:tg,simplebezier:J0},um={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},oS=(t,r,i)=>i===tt.Left?t-r:i===tt.Right?t+r:t,iS=(t,r,i)=>i===tt.Top?t-r:i===tt.Bottom?t+r:t,cm="react-flow__edgeupdater";function fm({position:t,centerX:r,centerY:i,radius:s=10,onMouseDown:l,onMouseEnter:c,onMouseOut:d,type:h}){return g.jsx("circle",{onMouseDown:l,onMouseEnter:c,onMouseOut:d,className:Zt([cm,`${cm}-${h}`]),cx:oS(r,s,t),cy:iS(i,s,t),r:s,stroke:"transparent",fill:"transparent"})}function sS({isReconnectable:t,reconnectRadius:r,edge:i,sourceX:s,sourceY:l,targetX:c,targetY:d,sourcePosition:h,targetPosition:v,onReconnect:b,onReconnectStart:S,onReconnectEnd:x,setReconnecting:_,setUpdateHover:C}){const j=Mt(),$=(R,B)=>{if(R.button!==0)return;const{autoPanOnConnect:V,domNode:W,connectionMode:Q,connectionRadius:de,lib:ke,onConnectStart:Y,cancelConnection:fe,nodeLookup:ve,rfId:D,panBy:ue,updateConnection:G}=j.getState(),se=B.type==="target",F=(A,K)=>{_(!1),x==null||x(A,i,B.type,K)},q=A=>b==null?void 0:b(i,A),Z=(A,K)=>{_(!0),S==null||S(R,i,B.type),Y==null||Y(A,K)};Rf.onPointerDown(R.nativeEvent,{autoPanOnConnect:V,connectionMode:Q,connectionRadius:de,domNode:W,handleId:B.id,nodeId:B.nodeId,nodeLookup:ve,isTarget:se,edgeUpdaterType:B.type,lib:ke,flowId:D,cancelConnection:fe,panBy:ue,isValidConnection:(...A)=>{var K,pe;return((pe=(K=j.getState()).isValidConnection)==null?void 0:pe.call(K,...A))??!0},onConnect:q,onConnectStart:Z,onConnectEnd:(...A)=>{var K,pe;return(pe=(K=j.getState()).onConnectEnd)==null?void 0:pe.call(K,...A)},onReconnectEnd:F,updateConnection:G,getTransform:()=>j.getState().transform,getFromHandle:()=>j.getState().connection.fromHandle,dragThreshold:j.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},T=R=>$(R,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),I=R=>$(R,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),H=()=>C(!0),P=()=>C(!1);return g.jsxs(g.Fragment,{children:[(t===!0||t==="source")&&g.jsx(fm,{position:h,centerX:s,centerY:l,radius:r,onMouseDown:T,onMouseEnter:H,onMouseOut:P,type:"source"}),(t===!0||t==="target")&&g.jsx(fm,{position:v,centerX:c,centerY:d,radius:r,onMouseDown:I,onMouseEnter:H,onMouseOut:P,type:"target"})]})}function aS({id:t,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:s,onClick:l,onDoubleClick:c,onContextMenu:d,onMouseEnter:h,onMouseMove:v,onMouseLeave:b,reconnectRadius:S,onReconnect:x,onReconnectStart:_,onReconnectEnd:C,rfId:j,edgeTypes:$,noPanClassName:T,onError:I,disableKeyboardA11y:H}){let P=gt(Fe=>Fe.edgeLookup.get(t));const R=gt(Fe=>Fe.defaultEdgeOptions);P=R?{...R,...P}:P;let B=P.type||"default",V=($==null?void 0:$[B])||lm[B];V===void 0&&(I==null||I("011",to.error011(B)),B="default",V=($==null?void 0:$.default)||lm.default);const W=!!(P.focusable||r&&typeof P.focusable>"u"),Q=typeof x<"u"&&(P.reconnectable||i&&typeof P.reconnectable>"u"),de=!!(P.selectable||s&&typeof P.selectable>"u"),ke=U.useRef(null),[Y,fe]=U.useState(!1),[ve,D]=U.useState(!1),ue=Mt(),{zIndex:G,sourceX:se,sourceY:F,targetX:q,targetY:Z,sourcePosition:A,targetPosition:K}=gt(U.useCallback(Fe=>{const Ke=Fe.nodeLookup.get(P.source),qe=Fe.nodeLookup.get(P.target);if(!Ke||!qe)return{zIndex:P.zIndex,...um};const at=Z1({id:t,sourceNode:Ke,targetNode:qe,sourceHandle:P.sourceHandle||null,targetHandle:P.targetHandle||null,connectionMode:Fe.connectionMode,onError:I});return{zIndex:q1({selected:P.selected,zIndex:P.zIndex,sourceNode:Ke,targetNode:qe,elevateOnSelect:Fe.elevateEdgesOnSelect,zIndexMode:Fe.zIndexMode}),...at||um}},[P.source,P.target,P.sourceHandle,P.targetHandle,P.selected,P.zIndex]),Rt),pe=U.useMemo(()=>P.markerStart?`url('#${Af(P.markerStart,j)}')`:void 0,[P.markerStart,j]),be=U.useMemo(()=>P.markerEnd?`url('#${Af(P.markerEnd,j)}')`:void 0,[P.markerEnd,j]);if(P.hidden||se===null||F===null||q===null||Z===null)return null;const $e=Fe=>{var ot;const{addSelectedEdges:Ke,unselectNodesAndEdges:qe,multiSelectionActive:at}=ue.getState();de&&(ue.setState({nodesSelectionActive:!1}),P.selected&&at?(qe({nodes:[],edges:[P]}),(ot=ke.current)==null||ot.blur()):Ke([t])),l&&l(Fe,P)},Ae=c?Fe=>{c(Fe,{...P})}:void 0,Oe=d?Fe=>{d(Fe,{...P})}:void 0,Se=h?Fe=>{h(Fe,{...P})}:void 0,De=v?Fe=>{v(Fe,{...P})}:void 0,Ne=b?Fe=>{b(Fe,{...P})}:void 0,et=Fe=>{var Ke;if(!H&&r0.includes(Fe.key)&&de){const{unselectNodesAndEdges:qe,addSelectedEdges:at}=ue.getState();Fe.key==="Escape"?((Ke=ke.current)==null||Ke.blur(),qe({edges:[P]})):at([t])}};return g.jsx("svg",{style:{zIndex:G},children:g.jsxs("g",{className:Zt(["react-flow__edge",`react-flow__edge-${B}`,P.className,T,{selected:P.selected,animated:P.animated,inactive:!de&&!l,updating:Y,selectable:de}]),onClick:$e,onDoubleClick:Ae,onContextMenu:Oe,onMouseEnter:Se,onMouseMove:De,onMouseLeave:Ne,onKeyDown:W?et:void 0,tabIndex:W?0:void 0,role:P.ariaRole??(W?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":P.ariaLabel===null?void 0:P.ariaLabel||`Edge from ${P.source} to ${P.target}`,"aria-describedby":W?`${R0}-${j}`:void 0,ref:ke,...P.domAttributes,children:[!ve&&g.jsx(V,{id:t,source:P.source,target:P.target,type:P.type,selected:P.selected,animated:P.animated,selectable:de,deletable:P.deletable??!0,label:P.label,labelStyle:P.labelStyle,labelShowBg:P.labelShowBg,labelBgStyle:P.labelBgStyle,labelBgPadding:P.labelBgPadding,labelBgBorderRadius:P.labelBgBorderRadius,sourceX:se,sourceY:F,targetX:q,targetY:Z,sourcePosition:A,targetPosition:K,data:P.data,style:P.style,sourceHandleId:P.sourceHandle,targetHandleId:P.targetHandle,markerStart:pe,markerEnd:be,pathOptions:"pathOptions"in P?P.pathOptions:void 0,interactionWidth:P.interactionWidth}),Q&&g.jsx(sS,{edge:P,isReconnectable:Q,reconnectRadius:S,onReconnect:x,onReconnectStart:_,onReconnectEnd:C,sourceX:se,sourceY:F,targetX:q,targetY:Z,sourcePosition:A,targetPosition:K,setUpdateHover:fe,setReconnecting:D})]})})}var lS=U.memo(aS);const uS=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function lg({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:i,edgeTypes:s,noPanClassName:l,onReconnect:c,onEdgeContextMenu:d,onEdgeMouseEnter:h,onEdgeMouseMove:v,onEdgeMouseLeave:b,onEdgeClick:S,reconnectRadius:x,onEdgeDoubleClick:_,onReconnectStart:C,onReconnectEnd:j,disableKeyboardA11y:$}){const{edgesFocusable:T,edgesReconnectable:I,elementsSelectable:H,onError:P}=gt(uS,Rt),R=W_(r);return g.jsxs("div",{className:"react-flow__edges",children:[g.jsx(J_,{defaultColor:t,rfId:i}),R.map(B=>g.jsx(lS,{id:B,edgesFocusable:T,edgesReconnectable:I,elementsSelectable:H,noPanClassName:l,onReconnect:c,onContextMenu:d,onMouseEnter:h,onMouseMove:v,onMouseLeave:b,onClick:S,reconnectRadius:x,onDoubleClick:_,onReconnectStart:C,onReconnectEnd:j,rfId:i,onError:P,edgeTypes:s,disableKeyboardA11y:$},B))]})}lg.displayName="EdgeRenderer";const cS=U.memo(lg),fS=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function dS({children:t}){const r=gt(fS);return g.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function pS(t){const r=rd(),i=U.useRef(!1);U.useEffect(()=>{!i.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),i.current=!0)},[t,r.viewportInitialized])}const hS=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function mS(t){const r=gt(hS),i=Mt();return U.useEffect(()=>{t&&(r==null||r(t),i.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function gS(t){return t.connection.inProgress?{...t.connection,to:Fa(t.connection.to,t.transform)}:{...t.connection}}function yS(t){return gS}function vS(t){const r=yS();return gt(r,Rt)}const xS=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function wS({containerStyle:t,style:r,type:i,component:s}){const{nodesConnectable:l,width:c,height:d,isValid:h,inProgress:v}=gt(xS,Rt);return!(c&&l&&v)?null:g.jsx("svg",{style:t,width:c,height:d,className:"react-flow__connectionline react-flow__container",children:g.jsx("g",{className:Zt(["react-flow__connection",s0(h)]),children:g.jsx(ug,{style:r,type:i,CustomComponent:s,isValid:h})})})}const ug=({style:t,type:r=di.Bezier,CustomComponent:i,isValid:s})=>{const{inProgress:l,from:c,fromNode:d,fromHandle:h,fromPosition:v,to:b,toNode:S,toHandle:x,toPosition:_,pointer:C}=vS();if(!l)return;if(i)return g.jsx(i,{connectionLineType:r,connectionLineStyle:t,fromNode:d,fromHandle:h,fromX:c.x,fromY:c.y,toX:b.x,toY:b.y,fromPosition:v,toPosition:_,connectionStatus:s0(s),toNode:S,toHandle:x,pointer:C});let j="";const $={sourceX:c.x,sourceY:c.y,sourcePosition:v,targetX:b.x,targetY:b.y,targetPosition:_};switch(r){case di.Bezier:[j]=v0($);break;case di.SimpleBezier:[j]=Q0($);break;case di.Step:[j]=If({...$,borderRadius:0});break;case di.SmoothStep:[j]=If($);break;default:[j]=b0($)}return g.jsx("path",{d:j,fill:"none",className:"react-flow__connection-path",style:t})};ug.displayName="ConnectionLine";const bS={};function dm(t=bS){U.useRef(t),Mt(),U.useEffect(()=>{},[t])}function _S(){Mt(),U.useRef(!1),U.useEffect(()=>{},[])}function cg({nodeTypes:t,edgeTypes:r,onInit:i,onNodeClick:s,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:d,onNodeMouseEnter:h,onNodeMouseMove:v,onNodeMouseLeave:b,onNodeContextMenu:S,onSelectionContextMenu:x,onSelectionStart:_,onSelectionEnd:C,connectionLineType:j,connectionLineStyle:$,connectionLineComponent:T,connectionLineContainerStyle:I,selectionKeyCode:H,selectionOnDrag:P,selectionMode:R,multiSelectionKeyCode:B,panActivationKeyCode:V,zoomActivationKeyCode:W,deleteKeyCode:Q,onlyRenderVisibleElements:de,elementsSelectable:ke,defaultViewport:Y,translateExtent:fe,minZoom:ve,maxZoom:D,preventScrolling:ue,defaultMarkerColor:G,zoomOnScroll:se,zoomOnPinch:F,panOnScroll:q,panOnScrollSpeed:Z,panOnScrollMode:A,zoomOnDoubleClick:K,panOnDrag:pe,onPaneClick:be,onPaneMouseEnter:$e,onPaneMouseMove:Ae,onPaneMouseLeave:Oe,onPaneScroll:Se,onPaneContextMenu:De,paneClickDistance:Ne,nodeClickDistance:et,onEdgeContextMenu:Fe,onEdgeMouseEnter:Ke,onEdgeMouseMove:qe,onEdgeMouseLeave:at,reconnectRadius:ot,onReconnect:Tt,onReconnectStart:xn,onReconnectEnd:Wt,noDragClassName:Yt,noWheelClassName:kt,noPanClassName:nn,disableKeyboardA11y:dn,nodeExtent:Pn,rfId:wn,viewport:St,onViewportChange:Xt}){return dm(t),dm(r),_S(),pS(i),mS(St),g.jsx(L_,{onPaneClick:be,onPaneMouseEnter:$e,onPaneMouseMove:Ae,onPaneMouseLeave:Oe,onPaneContextMenu:De,onPaneScroll:Se,paneClickDistance:Ne,deleteKeyCode:Q,selectionKeyCode:H,selectionOnDrag:P,selectionMode:R,onSelectionStart:_,onSelectionEnd:C,multiSelectionKeyCode:B,panActivationKeyCode:V,zoomActivationKeyCode:W,elementsSelectable:ke,zoomOnScroll:se,zoomOnPinch:F,zoomOnDoubleClick:K,panOnScroll:q,panOnScrollSpeed:Z,panOnScrollMode:A,panOnDrag:pe,defaultViewport:Y,translateExtent:fe,minZoom:ve,maxZoom:D,onSelectionContextMenu:x,preventScrolling:ue,noDragClassName:Yt,noWheelClassName:kt,noPanClassName:nn,disableKeyboardA11y:dn,onViewportChange:Xt,isControlledViewport:!!St,children:g.jsxs(dS,{children:[g.jsx(cS,{edgeTypes:r,onEdgeClick:l,onEdgeDoubleClick:d,onReconnect:Tt,onReconnectStart:xn,onReconnectEnd:Wt,onlyRenderVisibleElements:de,onEdgeContextMenu:Fe,onEdgeMouseEnter:Ke,onEdgeMouseMove:qe,onEdgeMouseLeave:at,reconnectRadius:ot,defaultMarkerColor:G,noPanClassName:nn,disableKeyboardA11y:dn,rfId:wn}),g.jsx(wS,{style:$,type:j,component:T,containerStyle:I}),g.jsx("div",{className:"react-flow__edgelabel-renderer"}),g.jsx(q_,{nodeTypes:t,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:v,onNodeMouseLeave:b,onNodeContextMenu:S,nodeClickDistance:et,onlyRenderVisibleElements:de,noPanClassName:nn,noDragClassName:Yt,disableKeyboardA11y:dn,nodeExtent:Pn,rfId:wn}),g.jsx("div",{className:"react-flow__viewport-portal"})]})})}cg.displayName="GraphView";const SS=U.memo(cg),pm=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:d,fitViewOptions:h,minZoom:v=.5,maxZoom:b=2,nodeOrigin:S,nodeExtent:x,zIndexMode:_="basic"}={})=>{const C=new Map,j=new Map,$=new Map,T=new Map,I=s??r??[],H=i??t??[],P=S??[0,0],R=x??Pa;k0($,T,I);const{nodesInitialized:B}=Of(H,C,j,{nodeOrigin:P,nodeExtent:R,zIndexMode:_});let V=[0,0,1];if(d&&l&&c){const W=Da(C,{filter:Y=>!!((Y.width||Y.initialWidth)&&(Y.height||Y.initialHeight))}),{x:Q,y:de,zoom:ke}=Qf(W,l,c,v,b,(h==null?void 0:h.padding)??.1);V=[Q,de,ke]}return{rfId:"1",width:l??0,height:c??0,transform:V,nodes:H,nodesInitialized:B,nodeLookup:C,parentLookup:j,edges:I,edgeLookup:T,connectionLookup:$,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:v,maxZoom:b,translateExtent:Pa,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ms.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:P,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:h,fitViewResolver:null,connection:{...i0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:F1,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:o0,zIndexMode:_,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},kS=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:d,fitViewOptions:h,minZoom:v,maxZoom:b,nodeOrigin:S,nodeExtent:x,zIndexMode:_})=>Vb((C,j)=>{async function $(){const{nodeLookup:T,panZoom:I,fitViewOptions:H,fitViewResolver:P,width:R,height:B,minZoom:V,maxZoom:W}=j();I&&(await D1({nodes:T,width:R,height:B,panZoom:I,minZoom:V,maxZoom:W},H),P==null||P.resolve(!0),C({fitViewResolver:null}))}return{...pm({nodes:t,edges:r,width:l,height:c,fitView:d,fitViewOptions:h,minZoom:v,maxZoom:b,nodeOrigin:S,nodeExtent:x,defaultNodes:i,defaultEdges:s,zIndexMode:_}),setNodes:T=>{const{nodeLookup:I,parentLookup:H,nodeOrigin:P,elevateNodesOnSelect:R,fitViewQueued:B,zIndexMode:V,nodesSelectionActive:W}=j(),{nodesInitialized:Q,hasSelectedNodes:de}=Of(T,I,H,{nodeOrigin:P,nodeExtent:x,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:V}),ke=W&&de;B&&Q?($(),C({nodes:T,nodesInitialized:Q,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:ke})):C({nodes:T,nodesInitialized:Q,nodesSelectionActive:ke})},setEdges:T=>{const{connectionLookup:I,edgeLookup:H}=j();k0(I,H,T),C({edges:T})},setDefaultNodesAndEdges:(T,I)=>{if(T){const{setNodes:H}=j();H(T),C({hasDefaultNodes:!0})}if(I){const{setEdges:H}=j();H(I),C({hasDefaultEdges:!0})}},updateNodeInternals:T=>{const{triggerNodeChanges:I,nodeLookup:H,parentLookup:P,domNode:R,nodeOrigin:B,nodeExtent:V,debug:W,fitViewQueued:Q,zIndexMode:de}=j(),{changes:ke,updatedInternals:Y}=ab(T,H,P,R,B,V,de);Y&&(rb(H,P,{nodeOrigin:B,nodeExtent:V,zIndexMode:de}),Q?($(),C({fitViewQueued:!1,fitViewOptions:void 0})):C({}),(ke==null?void 0:ke.length)>0&&(W&&console.log("React Flow: trigger node changes",ke),I==null||I(ke)))},updateNodePositions:(T,I=!1)=>{const H=[];let P=[];const{nodeLookup:R,triggerNodeChanges:B,connection:V,updateConnection:W,onNodesChangeMiddlewareMap:Q}=j();for(const[de,ke]of T){const Y=R.get(de),fe=!!(Y!=null&&Y.expandParent&&(Y!=null&&Y.parentId)&&(ke!=null&&ke.position)),ve={id:de,type:"position",position:fe?{x:Math.max(0,ke.position.x),y:Math.max(0,ke.position.y)}:ke.position,dragging:I};if(Y&&V.inProgress&&V.fromNode.id===Y.id){const D=Vi(Y,V.fromHandle,tt.Left,!0);W({...V,from:D})}fe&&Y.parentId&&H.push({id:de,parentId:Y.parentId,rect:{...ke.internals.positionAbsolute,width:ke.measured.width??0,height:ke.measured.height??0}}),P.push(ve)}if(H.length>0){const{parentLookup:de,nodeOrigin:ke}=j(),Y=nd(H,R,de,ke);P.push(...Y)}for(const de of Q.values())P=de(P);B(P)},triggerNodeChanges:T=>{const{onNodesChange:I,setNodes:H,nodes:P,hasDefaultNodes:R,debug:B}=j();if(T!=null&&T.length){if(R){const V=z0(T,P);H(V)}B&&console.log("React Flow: trigger node changes",T),I==null||I(T)}},triggerEdgeChanges:T=>{const{onEdgesChange:I,setEdges:H,edges:P,hasDefaultEdges:R,debug:B}=j();if(T!=null&&T.length){if(R){const V=F0(T,P);H(V)}B&&console.log("React Flow: trigger edge changes",T),I==null||I(T)}},addSelectedNodes:T=>{const{multiSelectionActive:I,edgeLookup:H,nodeLookup:P,triggerNodeChanges:R,triggerEdgeChanges:B}=j();if(I){const V=T.map(W=>Oi(W,!0));R(V);return}R(Es(P,new Set([...T]),!0)),B(Es(H))},addSelectedEdges:T=>{const{multiSelectionActive:I,edgeLookup:H,nodeLookup:P,triggerNodeChanges:R,triggerEdgeChanges:B}=j();if(I){const V=T.map(W=>Oi(W,!0));B(V);return}B(Es(H,new Set([...T]))),R(Es(P,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:I}={})=>{const{edges:H,nodes:P,nodeLookup:R,triggerNodeChanges:B,triggerEdgeChanges:V}=j(),W=T||P,Q=I||H,de=[];for(const Y of W){if(!Y.selected)continue;const fe=R.get(Y.id);fe&&(fe.selected=!1),de.push(Oi(Y.id,!1))}const ke=[];for(const Y of Q)Y.selected&&ke.push(Oi(Y.id,!1));B(de),V(ke)},setMinZoom:T=>{const{panZoom:I,maxZoom:H}=j();I==null||I.setScaleExtent([T,H]),C({minZoom:T})},setMaxZoom:T=>{const{panZoom:I,minZoom:H}=j();I==null||I.setScaleExtent([H,T]),C({maxZoom:T})},setTranslateExtent:T=>{var I;(I=j().panZoom)==null||I.setTranslateExtent(T),C({translateExtent:T})},resetSelectedElements:()=>{const{edges:T,nodes:I,triggerNodeChanges:H,triggerEdgeChanges:P,elementsSelectable:R}=j();if(!R)return;const B=I.reduce((W,Q)=>Q.selected?[...W,Oi(Q.id,!1)]:W,[]),V=T.reduce((W,Q)=>Q.selected?[...W,Oi(Q.id,!1)]:W,[]);H(B),P(V)},setNodeExtent:T=>{const{nodes:I,nodeLookup:H,parentLookup:P,nodeOrigin:R,elevateNodesOnSelect:B,nodeExtent:V,zIndexMode:W}=j();T[0][0]===V[0][0]&&T[0][1]===V[0][1]&&T[1][0]===V[1][0]&&T[1][1]===V[1][1]||(Of(I,H,P,{nodeOrigin:R,nodeExtent:T,elevateNodesOnSelect:B,checkEquality:!1,zIndexMode:W}),C({nodeExtent:T}))},panBy:T=>{const{transform:I,width:H,height:P,panZoom:R,translateExtent:B}=j();return lb({delta:T,panZoom:R,transform:I,translateExtent:B,width:H,height:P})},setCenter:async(T,I,H)=>{const{width:P,height:R,maxZoom:B,panZoom:V}=j();if(!V)return Promise.resolve(!1);const W=typeof(H==null?void 0:H.zoom)<"u"?H.zoom:B;return await V.setViewport({x:P/2-T*W,y:R/2-I*W,zoom:W},{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:()=>{C({connection:{...i0}})},updateConnection:T=>{C({connection:T})},reset:()=>C({...pm()})}},Object.is);function NS({initialNodes:t,initialEdges:r,defaultNodes:i,defaultEdges:s,initialWidth:l,initialHeight:c,initialMinZoom:d,initialMaxZoom:h,initialFitViewOptions:v,fitView:b,nodeOrigin:S,nodeExtent:x,zIndexMode:_,children:C}){const[j]=U.useState(()=>kS({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:b,minZoom:d,maxZoom:h,fitViewOptions:v,nodeOrigin:S,nodeExtent:x,zIndexMode:_}));return g.jsx(Ub,{value:j,children:g.jsx(d_,{children:C})})}function ES({children:t,nodes:r,edges:i,defaultNodes:s,defaultEdges:l,width:c,height:d,fitView:h,fitViewOptions:v,minZoom:b,maxZoom:S,nodeOrigin:x,nodeExtent:_,zIndexMode:C}){return U.useContext(Iu)?g.jsx(g.Fragment,{children:t}):g.jsx(NS,{initialNodes:r,initialEdges:i,defaultNodes:s,defaultEdges:l,initialWidth:c,initialHeight:d,fitView:h,initialFitViewOptions:v,initialMinZoom:b,initialMaxZoom:S,nodeOrigin:x,nodeExtent:_,zIndexMode:C,children:t})}const CS={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function jS({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,className:l,nodeTypes:c,edgeTypes:d,onNodeClick:h,onEdgeClick:v,onInit:b,onMove:S,onMoveStart:x,onMoveEnd:_,onConnect:C,onConnectStart:j,onConnectEnd:$,onClickConnectStart:T,onClickConnectEnd:I,onNodeMouseEnter:H,onNodeMouseMove:P,onNodeMouseLeave:R,onNodeContextMenu:B,onNodeDoubleClick:V,onNodeDragStart:W,onNodeDrag:Q,onNodeDragStop:de,onNodesDelete:ke,onEdgesDelete:Y,onDelete:fe,onSelectionChange:ve,onSelectionDragStart:D,onSelectionDrag:ue,onSelectionDragStop:G,onSelectionContextMenu:se,onSelectionStart:F,onSelectionEnd:q,onBeforeDelete:Z,connectionMode:A,connectionLineType:K=di.Bezier,connectionLineStyle:pe,connectionLineComponent:be,connectionLineContainerStyle:$e,deleteKeyCode:Ae="Backspace",selectionKeyCode:Oe="Shift",selectionOnDrag:Se=!1,selectionMode:De=$a.Full,panActivationKeyCode:Ne="Space",multiSelectionKeyCode:et=Ta()?"Meta":"Control",zoomActivationKeyCode:Fe=Ta()?"Meta":"Control",snapToGrid:Ke,snapGrid:qe,onlyRenderVisibleElements:at=!1,selectNodesOnDrag:ot,nodesDraggable:Tt,autoPanOnNodeFocus:xn,nodesConnectable:Wt,nodesFocusable:Yt,nodeOrigin:kt=L0,edgesFocusable:nn,edgesReconnectable:dn,elementsSelectable:Pn=!0,defaultViewport:wn=r_,minZoom:St=.5,maxZoom:Xt=2,translateExtent:Ht=Pa,preventScrolling:lr=!0,nodeExtent:yt,defaultMarkerColor:Rn="#b1b1b7",zoomOnScroll:Gn=!0,zoomOnPinch:Ln=!0,panOnScroll:Dn=!1,panOnScrollSpeed:pn=.5,panOnScrollMode:We=zi.Free,zoomOnDoubleClick:Nt=!0,panOnDrag:$n=!0,onPaneClick:ur,onPaneMouseEnter:Be,onPaneMouseMove:zn,onPaneMouseLeave:Jn,onPaneScroll:_r,onPaneContextMenu:oo,paneClickDistance:Br=1,nodeClickDistance:Ro=0,children:Lo,onReconnect:Fn,onReconnectStart:rn,onReconnectEnd:Mn,onEdgeContextMenu:cr,onEdgeDoubleClick:mt,onEdgeMouseEnter:It,onEdgeMouseMove:Sr,onEdgeMouseLeave:Zn,reconnectRadius:er=10,onNodesChange:fr,onEdgesChange:pi,noDragClassName:Tn="nodrag",noWheelClassName:dr="nowheel",noPanClassName:Ft="nopan",fitView:pr,fitViewOptions:io,connectOnClick:Bn,attributionPosition:Hr,proOptions:bn,defaultEdgeOptions:Vr,elevateNodesOnSelect:L=!0,elevateEdgesOnSelect:_e=!1,disableKeyboardA11y:He=!1,autoPanOnConnect:Xe,autoPanOnNodeDrag:on,autoPanSpeed:Vt,connectionRadius:Qt,isValidConnection:Ut,onError:Ct,style:_n,id:In,nodeDragThreshold:sn,connectionDragThreshold:ft,viewport:Kt,onViewportChange:Do,width:zo,height:so,colorMode:ao="light",debug:lo,onScroll:tr,ariaLabelConfig:vt,zIndexMode:Ur="basic",...uo},hr){const Kr=In||"1",co=a_(ao),mr=U.useCallback(hi=>{hi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),tr==null||tr(hi)},[tr]);return g.jsx("div",{"data-testid":"rf__wrapper",...uo,onScroll:mr,style:{..._n,...CS},ref:hr,className:Zt(["react-flow",l,co]),id:In,role:"application",children:g.jsxs(ES,{nodes:t,edges:r,width:zo,height:so,fitView:pr,fitViewOptions:io,minZoom:St,maxZoom:Xt,nodeOrigin:kt,nodeExtent:yt,zIndexMode:Ur,children:[g.jsx(s_,{nodes:t,edges:r,defaultNodes:i,defaultEdges:s,onConnect:C,onConnectStart:j,onConnectEnd:$,onClickConnectStart:T,onClickConnectEnd:I,nodesDraggable:Tt,autoPanOnNodeFocus:xn,nodesConnectable:Wt,nodesFocusable:Yt,edgesFocusable:nn,edgesReconnectable:dn,elementsSelectable:Pn,elevateNodesOnSelect:L,elevateEdgesOnSelect:_e,minZoom:St,maxZoom:Xt,nodeExtent:yt,onNodesChange:fr,onEdgesChange:pi,snapToGrid:Ke,snapGrid:qe,connectionMode:A,translateExtent:Ht,connectOnClick:Bn,defaultEdgeOptions:Vr,fitView:pr,fitViewOptions:io,onNodesDelete:ke,onEdgesDelete:Y,onDelete:fe,onNodeDragStart:W,onNodeDrag:Q,onNodeDragStop:de,onSelectionDrag:ue,onSelectionDragStart:D,onSelectionDragStop:G,onMove:S,onMoveStart:x,onMoveEnd:_,noPanClassName:Ft,nodeOrigin:kt,rfId:Kr,autoPanOnConnect:Xe,autoPanOnNodeDrag:on,autoPanSpeed:Vt,onError:Ct,connectionRadius:Qt,isValidConnection:Ut,selectNodesOnDrag:ot,nodeDragThreshold:sn,connectionDragThreshold:ft,onBeforeDelete:Z,debug:lo,ariaLabelConfig:vt,zIndexMode:Ur}),g.jsx(SS,{onInit:b,onNodeClick:h,onEdgeClick:v,onNodeMouseEnter:H,onNodeMouseMove:P,onNodeMouseLeave:R,onNodeContextMenu:B,onNodeDoubleClick:V,nodeTypes:c,edgeTypes:d,connectionLineType:K,connectionLineStyle:pe,connectionLineComponent:be,connectionLineContainerStyle:$e,selectionKeyCode:Oe,selectionOnDrag:Se,selectionMode:De,deleteKeyCode:Ae,multiSelectionKeyCode:et,panActivationKeyCode:Ne,zoomActivationKeyCode:Fe,onlyRenderVisibleElements:at,defaultViewport:wn,translateExtent:Ht,minZoom:St,maxZoom:Xt,preventScrolling:lr,zoomOnScroll:Gn,zoomOnPinch:Ln,zoomOnDoubleClick:Nt,panOnScroll:Dn,panOnScrollSpeed:pn,panOnScrollMode:We,panOnDrag:$n,onPaneClick:ur,onPaneMouseEnter:Be,onPaneMouseMove:zn,onPaneMouseLeave:Jn,onPaneScroll:_r,onPaneContextMenu:oo,paneClickDistance:Br,nodeClickDistance:Ro,onSelectionContextMenu:se,onSelectionStart:F,onSelectionEnd:q,onReconnect:Fn,onReconnectStart:rn,onReconnectEnd:Mn,onEdgeContextMenu:cr,onEdgeDoubleClick:mt,onEdgeMouseEnter:It,onEdgeMouseMove:Sr,onEdgeMouseLeave:Zn,reconnectRadius:er,defaultMarkerColor:Rn,noDragClassName:Tn,noWheelClassName:dr,noPanClassName:Ft,rfId:Kr,disableKeyboardA11y:He,nodeExtent:yt,viewport:Kt,onViewportChange:Do}),g.jsx(n_,{onSelectionChange:ve}),Lo,g.jsx(Gb,{proOptions:bn,position:Hr}),g.jsx(Qb,{rfId:Kr,disableKeyboardA11y:He})]})})}var PS=B0(jS);function $S(){const t=Mt();return U.useCallback(r=>{const{domNode:i,updateNodeInternals:s}=t.getState(),l=Array.isArray(r)?r:[r],c=new Map;l.forEach(d=>{const h=i==null?void 0:i.querySelector(`.react-flow__node[data-id="${d}"]`);h&&c.set(d,{id:d,nodeElement:h,force:!0})}),requestAnimationFrame(()=>s(c,{triggerFitView:!1}))},[])}function MS(t){const[r,i]=U.useState(t),s=U.useCallback(l=>i(c=>z0(l,c)),[]);return[r,i,s]}function TS(t){const[r,i]=U.useState(t),s=U.useCallback(l=>i(c=>F0(l,c)),[]);return[r,i,s]}function IS({dimensions:t,lineWidth:r,variant:i,className:s}){return g.jsx("path",{strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:Zt(["react-flow__background-pattern",i,s])})}function AS({radius:t,className:r}){return g.jsx("circle",{cx:t,cy:t,r:t,className:Zt(["react-flow__background-pattern","dots",r])})}var Io;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Io||(Io={}));const OS={[Io.Dots]:1,[Io.Lines]:1,[Io.Cross]:6},RS=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function fg({id:t,variant:r=Io.Dots,gap:i=20,size:s,lineWidth:l=1,offset:c=0,color:d,bgColor:h,style:v,className:b,patternClassName:S}){const x=U.useRef(null),{transform:_,patternId:C}=gt(RS,Rt),j=s||OS[r],$=r===Io.Dots,T=r===Io.Cross,I=Array.isArray(i)?i:[i,i],H=[I[0]*_[2]||1,I[1]*_[2]||1],P=j*_[2],R=Array.isArray(c)?c:[c,c],B=T?[P,P]:H,V=[R[0]*_[2]||1+B[0]/2,R[1]*_[2]||1+B[1]/2],W=`${C}${t||""}`;return g.jsxs("svg",{className:Zt(["react-flow__background",b]),style:{...v,...Au,"--xy-background-color-props":h,"--xy-background-pattern-color-props":d},ref:x,"data-testid":"rf__background",children:[g.jsx("pattern",{id:W,x:_[0]%H[0],y:_[1]%H[1],width:H[0],height:H[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${V[0]},-${V[1]})`,children:$?g.jsx(AS,{radius:P/2,className:S}):g.jsx(IS,{dimensions:B,lineWidth:l,variant:r,className:S})}),g.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${W})`})]})}fg.displayName="Background";const LS=U.memo(fg);function DS(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:g.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function zS(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:g.jsx("path",{d:"M0 0h32v4.2H0z"})})}function FS(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:g.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 BS(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.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 HS(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.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 Zl({children:t,className:r,...i}){return g.jsx("button",{type:"button",className:Zt(["react-flow__controls-button",r]),...i,children:t})}const VS=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function dg({style:t,showZoom:r=!0,showFitView:i=!0,showInteractive:s=!0,fitViewOptions:l,onZoomIn:c,onZoomOut:d,onFitView:h,onInteractiveChange:v,className:b,children:S,position:x="bottom-left",orientation:_="vertical","aria-label":C}){const j=Mt(),{isInteractive:$,minZoomReached:T,maxZoomReached:I,ariaLabelConfig:H}=gt(VS,Rt),{zoomIn:P,zoomOut:R,fitView:B}=rd(),V=()=>{P(),c==null||c()},W=()=>{R(),d==null||d()},Q=()=>{B(l),h==null||h()},de=()=>{j.setState({nodesDraggable:!$,nodesConnectable:!$,elementsSelectable:!$}),v==null||v(!$)},ke=_==="horizontal"?"horizontal":"vertical";return g.jsxs(Ba,{className:Zt(["react-flow__controls",ke,b]),position:x,style:t,"data-testid":"rf__controls","aria-label":C??H["controls.ariaLabel"],children:[r&&g.jsxs(g.Fragment,{children:[g.jsx(Zl,{onClick:V,className:"react-flow__controls-zoomin",title:H["controls.zoomIn.ariaLabel"],"aria-label":H["controls.zoomIn.ariaLabel"],disabled:I,children:g.jsx(DS,{})}),g.jsx(Zl,{onClick:W,className:"react-flow__controls-zoomout",title:H["controls.zoomOut.ariaLabel"],"aria-label":H["controls.zoomOut.ariaLabel"],disabled:T,children:g.jsx(zS,{})})]}),i&&g.jsx(Zl,{className:"react-flow__controls-fitview",onClick:Q,title:H["controls.fitView.ariaLabel"],"aria-label":H["controls.fitView.ariaLabel"],children:g.jsx(FS,{})}),s&&g.jsx(Zl,{className:"react-flow__controls-interactive",onClick:de,title:H["controls.interactive.ariaLabel"],"aria-label":H["controls.interactive.ariaLabel"],children:$?g.jsx(HS,{}):g.jsx(BS,{})}),S]})}dg.displayName="Controls";const US=U.memo(dg);function KS({id:t,x:r,y:i,width:s,height:l,style:c,color:d,strokeColor:h,strokeWidth:v,className:b,borderRadius:S,shapeRendering:x,selected:_,onClick:C}){const{background:j,backgroundColor:$}=c||{},T=d||j||$;return g.jsx("rect",{className:Zt(["react-flow__minimap-node",{selected:_},b]),x:r,y:i,rx:S,ry:S,width:s,height:l,style:{fill:T,stroke:h,strokeWidth:v},shapeRendering:x,onClick:C?I=>C(I,t):void 0})}const qS=U.memo(KS),WS=t=>t.nodes.map(r=>r.id),gf=t=>t instanceof Function?t:()=>t;function YS({nodeStrokeColor:t,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:l,nodeComponent:c=qS,onClick:d}){const h=gt(WS,Rt),v=gf(r),b=gf(t),S=gf(i),x=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return g.jsx(g.Fragment,{children:h.map(_=>g.jsx(QS,{id:_,nodeColorFunc:v,nodeStrokeColorFunc:b,nodeClassNameFunc:S,nodeBorderRadius:s,nodeStrokeWidth:l,NodeComponent:c,onClick:d,shapeRendering:x},_))})}function XS({id:t,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:s,nodeBorderRadius:l,nodeStrokeWidth:c,shapeRendering:d,NodeComponent:h,onClick:v}){const{node:b,x:S,y:x,width:_,height:C}=gt(j=>{const $=j.nodeLookup.get(t);if(!$)return{node:void 0,x:0,y:0,width:0,height:0};const T=$.internals.userNode,{x:I,y:H}=$.internals.positionAbsolute,{width:P,height:R}=Oo(T);return{node:T,x:I,y:H,width:P,height:R}},Rt);return!b||b.hidden||!d0(b)?null:g.jsx(h,{x:S,y:x,width:_,height:C,style:b.style,selected:!!b.selected,className:s(b),color:r(b),borderRadius:l,strokeColor:i(b),strokeWidth:c,shapeRendering:d,onClick:v,id:b.id})}const QS=U.memo(XS);var GS=U.memo(YS);const JS=200,ZS=150,ek=t=>!t.hidden,tk=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?f0(Da(t.nodeLookup,{filter:ek}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},nk="react-flow__minimap-desc";function pg({style:t,className:r,nodeStrokeColor:i,nodeColor:s,nodeClassName:l="",nodeBorderRadius:c=5,nodeStrokeWidth:d,nodeComponent:h,bgColor:v,maskColor:b,maskStrokeColor:S,maskStrokeWidth:x,position:_="bottom-right",onClick:C,onNodeClick:j,pannable:$=!1,zoomable:T=!1,ariaLabel:I,inversePan:H,zoomStep:P=1,offsetScale:R=5}){const B=Mt(),V=U.useRef(null),{boundingRect:W,viewBB:Q,rfId:de,panZoom:ke,translateExtent:Y,flowWidth:fe,flowHeight:ve,ariaLabelConfig:D}=gt(tk,Rt),ue=(t==null?void 0:t.width)??JS,G=(t==null?void 0:t.height)??ZS,se=W.width/ue,F=W.height/G,q=Math.max(se,F),Z=q*ue,A=q*G,K=R*q,pe=W.x-(Z-W.width)/2-K,be=W.y-(A-W.height)/2-K,$e=Z+K*2,Ae=A+K*2,Oe=`${nk}-${de}`,Se=U.useRef(0),De=U.useRef();Se.current=q,U.useEffect(()=>{if(V.current&&ke)return De.current=yb({domNode:V.current,panZoom:ke,getTransform:()=>B.getState().transform,getViewScale:()=>Se.current}),()=>{var Ke;(Ke=De.current)==null||Ke.destroy()}},[ke]),U.useEffect(()=>{var Ke;(Ke=De.current)==null||Ke.update({translateExtent:Y,width:fe,height:ve,inversePan:H,pannable:$,zoomStep:P,zoomable:T})},[$,T,H,P,Y,fe,ve]);const Ne=C?Ke=>{var ot;const[qe,at]=((ot=De.current)==null?void 0:ot.pointer(Ke))||[0,0];C(Ke,{x:qe,y:at})}:void 0,et=j?U.useCallback((Ke,qe)=>{const at=B.getState().nodeLookup.get(qe).internals.userNode;j(Ke,at)},[]):void 0,Fe=I??D["minimap.ariaLabel"];return g.jsx(Ba,{position:_,style:{...t,"--xy-minimap-background-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-background-color-props":typeof b=="string"?b:void 0,"--xy-minimap-mask-stroke-color-props":typeof S=="string"?S:void 0,"--xy-minimap-mask-stroke-width-props":typeof x=="number"?x*q:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s: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:Zt(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:g.jsxs("svg",{width:ue,height:G,viewBox:`${pe} ${be} ${$e} ${Ae}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Oe,ref:V,onClick:Ne,children:[Fe&&g.jsx("title",{id:Oe,children:Fe}),g.jsx(GS,{onClick:et,nodeColor:s,nodeStrokeColor:i,nodeBorderRadius:c,nodeClassName:l,nodeStrokeWidth:d,nodeComponent:h}),g.jsx("path",{className:"react-flow__minimap-mask",d:`M${pe-K},${be-K}h${$e+K*2}v${Ae+K*2}h${-$e-K*2}z
|
|
202
|
+
M${Q.x},${Q.y}h${Q.width}v${Q.height}h${-Q.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}pg.displayName="MiniMap";const rk=U.memo(pg),ok=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,ik={[Os.Line]:"right",[Os.Handle]:"bottom-right"};function sk({nodeId:t,position:r,variant:i=Os.Handle,className:s,style:l=void 0,children:c,color:d,minWidth:h=10,minHeight:v=10,maxWidth:b=Number.MAX_VALUE,maxHeight:S=Number.MAX_VALUE,keepAspectRatio:x=!1,resizeDirection:_,autoScale:C=!0,shouldResize:j,onResizeStart:$,onResize:T,onResizeEnd:I}){const H=K0(),P=typeof t=="string"?t:H,R=Mt(),B=U.useRef(null),V=i===Os.Handle,W=gt(U.useCallback(ok(V&&C),[V,C]),Rt),Q=U.useRef(null),de=r??ik[i];U.useEffect(()=>{if(!(!B.current||!P))return Q.current||(Q.current=Mb({domNode:B.current,nodeId:P,getStoreItems:()=>{const{nodeLookup:Y,transform:fe,snapGrid:ve,snapToGrid:D,nodeOrigin:ue,domNode:G}=R.getState();return{nodeLookup:Y,transform:fe,snapGrid:ve,snapToGrid:D,nodeOrigin:ue,paneDomNode:G}},onChange:(Y,fe)=>{const{triggerNodeChanges:ve,nodeLookup:D,parentLookup:ue,nodeOrigin:G}=R.getState(),se=[],F={x:Y.x,y:Y.y},q=D.get(P);if(q&&q.expandParent&&q.parentId){const Z=q.origin??G,A=Y.width??q.measured.width??0,K=Y.height??q.measured.height??0,pe={id:q.id,parentId:q.parentId,rect:{width:A,height:K,...p0({x:Y.x??q.position.x,y:Y.y??q.position.y},{width:A,height:K},q.parentId,D,Z)}},be=nd([pe],D,ue,G);se.push(...be),F.x=Y.x?Math.max(Z[0]*A,Y.x):void 0,F.y=Y.y?Math.max(Z[1]*K,Y.y):void 0}if(F.x!==void 0&&F.y!==void 0){const Z={id:P,type:"position",position:{...F}};se.push(Z)}if(Y.width!==void 0&&Y.height!==void 0){const A={id:P,type:"dimensions",resizing:!0,setAttributes:_?_==="horizontal"?"width":"height":!0,dimensions:{width:Y.width,height:Y.height}};se.push(A)}for(const Z of fe){const A={...Z,type:"position"};se.push(A)}ve(se)},onEnd:({width:Y,height:fe})=>{const ve={id:P,type:"dimensions",resizing:!1,dimensions:{width:Y,height:fe}};R.getState().triggerNodeChanges([ve])}})),Q.current.update({controlPosition:de,boundaries:{minWidth:h,minHeight:v,maxWidth:b,maxHeight:S},keepAspectRatio:x,resizeDirection:_,onResizeStart:$,onResize:T,onResizeEnd:I,shouldResize:j}),()=>{var Y;(Y=Q.current)==null||Y.destroy()}},[de,h,v,b,S,x,$,T,I,j]);const ke=de.split("-");return g.jsx("div",{className:Zt(["react-flow__resize-control","nodrag",...ke,i,s]),ref:B,style:{...l,scale:W,...d&&{[V?"backgroundColor":"borderColor"]:d}},children:c})}U.memo(sk);const ak={get:"bg-emerald-500/20 text-emerald-200 border-emerald-500/45",post:"bg-sky-500/20 text-sky-200 border-sky-500/45",put:"bg-amber-500/20 text-amber-200 border-amber-500/45",patch:"bg-violet-500/20 text-violet-200 border-violet-500/45",delete:"bg-rose-500/20 text-rose-200 border-rose-500/45",head:"bg-slate-500/25 text-slate-300 border-slate-500/45",options:"bg-slate-500/25 text-slate-300 border-slate-500/45",trace:"bg-slate-500/25 text-slate-300 border-slate-500/45"};function ka({method:t,className:r="",size:i="sm"}){const s=t.toLowerCase().trim(),l=ak[s]??"bg-accent/15 text-accent border-accent/40",c=i==="md"?"text-xs px-2.5 py-1 min-w-[3.25rem] justify-center":"text-[10px] px-1.5 py-0.5 min-w-[2.75rem] justify-center";return g.jsx("span",{className:`inline-flex items-center rounded-md font-semibold uppercase tracking-wide border shrink-0 transition-colors duration-200 ${l} ${c} ${r}`,children:t.toUpperCase()})}function id(t,r,i){var c,d;const s=r.toLowerCase(),l=(d=(c=t.paths)==null?void 0:c[i])==null?void 0:d[s];return(l==null?void 0:l.summary)??(l==null?void 0:l.operationId)??`${r.toUpperCase()} ${i}`}function sd(t,r,i){var h,v,b,S;const s=r.toLowerCase(),l=(v=(h=t.paths)==null?void 0:h[i])==null?void 0:v[s];if(!(l!=null&&l.requestBody))return"— sin body";const d=(S=(b=l.requestBody.content)==null?void 0:b["application/json"])==null?void 0:S.schema;return d&&"$ref"in d?`body: ${d.$ref}`:"body: JSON"}function ad(t,r,i){var h,v,b,S,x,_;const s=r.toLowerCase(),l=(v=(h=t.paths)==null?void 0:h[i])==null?void 0:v[s],c=((b=l==null?void 0:l.responses)==null?void 0:b["200"])??((S=l==null?void 0:l.responses)==null?void 0:S["201"]);if(!c)return"—";const d=typeof c=="object"&&c&&"content"in c?(_=(x=c.content)==null?void 0:x["application/json"])==null?void 0:_.schema:void 0;return d&&"$ref"in d?String(d.$ref):"JSON"}const lu=()=>({sourceJsonPath:"$",variableName:"v",useInTarget:"vars_only",targetKey:""});function yf(t,r){return`${t.toLowerCase()} ${r}`}function lk(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}const hg=U.createContext(null);function uk(t){const{id:r,selected:i}=t,s=t.data,l=U.useContext(hg),c=$S();return U.useEffect(()=>{c(r)},[s.path,s.method,r,c]),g.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:[g.jsx(Rs,{type:"target",position:tt.Left,id:"in",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-teal-500"}),g.jsxs("div",{className:"flex items-center gap-2 mb-1 min-w-0",children:[g.jsx(ka,{method:s.method}),g.jsx("span",{className:"text-[10px] text-slate-500 truncate",title:s.summary,children:s.summary})]}),l?g.jsxs("label",{className:"block text-[10px] text-slate-500 mb-1",children:["Endpoint",g.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:yf(s.method,s.path),onChange:d=>{const{method:h,path:v}=lk(d.target.value);l.updateNodeData(r,{method:h,path:v,summary:id(l.doc,h,v),reqHint:sd(l.doc,h,v),resHint:ad(l.doc,h,v)})},children:l.ops.map(d=>g.jsxs("option",{value:yf(d.method,d.path),children:[d.method.toUpperCase()," ",d.path]},yf(d.method,d.path)))})]}):g.jsx("p",{className:"font-mono text-[11px] text-slate-300 truncate",children:s.path}),g.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-1 text-[9px] text-slate-500 leading-tight",children:[g.jsxs("div",{children:[g.jsx("span",{className:"text-slate-600",children:"req"})," ",s.reqHint]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-slate-600",children:"res"})," ",s.resHint]})]}),g.jsx(Rs,{type:"source",position:tt.Right,id:"out",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-amber-500"})]})}const ck={apiOp:uk};function fk(t,r){const i=r.nodes.map(l=>({id:l.id,type:"apiOp",position:{x:l.x,y:l.y},data:{method:l.method.toLowerCase(),path:l.path,summary:id(t,l.method,l.path),reqHint:sd(t,l.method,l.path),resHint:ad(t,l.method,l.path)}})),s=r.edges.map(l=>({id:l.id,source:l.source,target:l.target,sourceHandle:"out",targetHandle:"in",data:{mapping:{...l.mapping}},label:l.mapping.variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}}));return{nodes:i,edges:s}}function dk(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 s;return{id:i.id,source:i.source,target:i.target,mapping:((s=i.data)==null?void 0:s.mapping)??lu()}})}}const pk=[{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 hk({doc:t,ops:r,graph:i,onGraphChange:s}){var P,R,B,V,W,Q,de,ke;const l=U.useMemo(()=>fk(t,i),[t,i]),[c,d,h]=MS(l.nodes),[v,b,S]=TS(l.edges),[x,_]=U.useState(null);U.useEffect(()=>{s(dk(c,v))},[c,v,s]);const C=U.useCallback((Y,fe)=>{d(ve=>ve.map(D=>D.id===Y?{...D,data:{...D.data,...fe}}:D))},[d]),j=U.useMemo(()=>({doc:t,ops:r,updateNodeData:C}),[t,r,C]),$=U.useCallback(Y=>{Y.sourceHandle!=="out"||Y.targetHandle!=="in"||b(fe=>w0({...Y,id:`e-${Y.source}-${Y.target}-${crypto.randomUUID().slice(0,8)}`,sourceHandle:"out",targetHandle:"in",data:{mapping:lu()},label:lu().variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}},fe))},[b]),T=v.find(Y=>Y.id===x),I=Y=>{x&&b(fe=>fe.map(ve=>{var ue;if(ve.id!==x)return ve;const D={...((ue=ve.data)==null?void 0:ue.mapping)??lu(),...Y};return{...ve,data:{mapping:D},label:D.variableName}}))},H=()=>{const Y=c.reduce((se,F)=>F.position.x>se?F.position.x:se,0),fe=r[0];if(!fe)return;const ve=crypto.randomUUID(),D=Y>0?Y+40:80,G={id:ve,type:"apiOp",position:{x:D,y:120},data:{method:fe.method.toLowerCase(),path:fe.path,summary:id(t,fe.method,fe.path),reqHint:sd(t,fe.method,fe.path),resHint:ad(t,fe.method,fe.path)}};d(se=>[...se,G])};return g.jsx(hg.Provider,{value:j,children:g.jsxs("div",{className:"space-y-3",children:[g.jsx("div",{className:"h-[min(520px,70vh)] w-full rounded-xl border border-surface-700 bg-surface-950",children:g.jsxs(PS,{nodes:c,edges:v,onNodesChange:h,onEdgesChange:S,onConnect:$,nodeTypes:ck,onEdgeClick:(Y,fe)=>_(fe.id),onPaneClick:()=>_(null),fitView:!0,minZoom:.4,maxZoom:1.5,proOptions:{hideAttribution:!0},isValidConnection:Y=>Y.sourceHandle==="out"&&Y.targetHandle==="in",children:[g.jsx(LS,{variant:Io.Dots,gap:16,size:1,color:"rgb(51 65 85 / 0.5)"}),g.jsx(US,{className:"!bg-surface-900 !border-surface-600 !shadow-lg"}),g.jsx(rk,{className:"!bg-surface-900/95 !border-surface-600",nodeColor:()=>"rgb(45 212 191 / 0.5)"}),g.jsx(Ba,{position:"top-left",children:g.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)"})})]})}),g.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[g.jsx("h4",{className:"text-xs font-semibold text-slate-300",children:"Cable seleccionado (respuesta → request)"}),T?g.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs",children:[g.jsxs("label",{className:"text-slate-500",children:["JSON path en la respuesta",g.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((P=T.data)==null?void 0:P.mapping.sourceJsonPath)??"$",onChange:Y=>I({sourceJsonPath:Y.target.value}),placeholder:"$.access_token"})]}),g.jsxs("label",{className:"text-slate-500",children:["Nombre de variable",g.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:Y=>I({variableName:Y.target.value}),placeholder:"token"})]}),g.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Cómo se usa en el request del nodo destino",g.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((B=T.data)==null?void 0:B.mapping.useInTarget)??"vars_only",onChange:Y=>I({useInTarget:Y.target.value}),children:pk.map(Y=>g.jsx("option",{value:Y.value,children:Y.label},Y.value))})]}),(((V=T.data)==null?void 0:V.mapping.useInTarget)==="path_param"||((W=T.data)==null?void 0:W.mapping.useInTarget)==="header"||((Q=T.data)==null?void 0:Q.mapping.useInTarget)==="query")&&g.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Clave (nombre del param / header / query)",g.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((de=T.data)==null?void 0:de.mapping.targetKey)??"",onChange:Y=>I({targetKey:Y.target.value}),placeholder:"id / Authorization / q"})]}),g.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"," ",g.jsx("code",{className:"text-accent",children:"{clave}"}),", en un header, o en query. Con «solo variable», usa"," ",g.jsx("code",{className:"text-accent",children:"{"+(((ke=T.data)==null?void 0:ke.mapping.variableName)||"var")+"}"})," ","en la ruta del endpoint destino."]})]}):g.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 mg(t,r){const i=new Map(t.map(v=>[v.id,v])),s=new Set(t.map(v=>v.id)),l=new Map,c=new Map;for(const v of s)l.set(v,0),c.set(v,[]);for(const v of r)!s.has(v.source)||!s.has(v.target)||(l.set(v.target,(l.get(v.target)??0)+1),c.get(v.source).push(v.target));const d=[];for(const[v,b]of l)b===0&&d.push(v);d.sort((v,b)=>i.get(v).x-i.get(b).x||i.get(v).y-i.get(b).y);const h=[];for(;d.length;){const v=d.shift();h.push(v);for(const b of c.get(v)??[]){const S=(l.get(b)??0)-1;l.set(b,S),S===0&&(d.push(b),d.sort((x,_)=>i.get(x).x-i.get(_).x||i.get(x).y-i.get(_).y))}}if(h.length<t.length){const v=t.filter(b=>!h.includes(b.id)).sort((b,S)=>b.x-S.x||b.y-S.y);return[...h.map(b=>i.get(b)),...v]}return h.map(v=>i.get(v))}async function hm(t,r,i){var v;const{nodes:s,edges:l}=t;if(s.length===0)return"Sin nodos en el flujo.";const c=mg(s,l),d={};let h="";for(let b=0;b<c.length;b++){const S=c[b];let x=S.path;const _={...i()},C=l.filter(B=>B.target===S.id);for(const B of C){const{mapping:V}=B,W=d[V.variableName];if(W!==void 0)switch(V.useInTarget){case"path_param":V.targetKey&&(x=x.split(`{${V.targetKey}}`).join(W));break;case"header":if(V.targetKey){const Q=V.targetKey;_[Q]=Q.toLowerCase()==="authorization"&&!W.startsWith("Bearer ")?`Bearer ${W}`:W}break;case"query":{const Q=x.includes("?")?"&":"?";x=`${x}${Q}${encodeURIComponent(V.targetKey)}=${encodeURIComponent(W)}`;break}case"vars_only":default:x=x.split(`{${V.variableName}}`).join(W);break}}for(const[B,V]of Object.entries(d))x=x.split(`{${B}}`).join(V);const j=`${r.replace(/\/$/,"")}${x}`,$={method:S.method.toUpperCase(),headers:_},T=S.method.toLowerCase();T!=="get"&&T!=="head"&&($.body="{}");const I=await fetch(j,{...$,credentials:"include"});let H={};const P=await I.text();try{H=P?JSON.parse(P):{}}catch{H={_raw:P}}h+=`▸ ${S.method.toUpperCase()} ${S.path} → ${I.status}
|
|
203
|
+
${JSON.stringify(H,null,2)}
|
|
204
|
+
|
|
205
|
+
`;const R=l.filter(B=>B.source===S.id);for(const B of R){const V=((v=B.mapping.sourceJsonPath)==null?void 0:v.trim())||"$",W=Ff(H,V);W!=null&&(d[B.mapping.variableName]=typeof W=="object"?JSON.stringify(W):String(W))}}return h+=`
|
|
206
|
+
Variables finales: ${JSON.stringify(d,null,2)}`,h}function mk(t){const r=mg(t.nodes,t.edges);return r.map((i,s)=>{const l=r[s+1];if(!l)return{method:i.method,path:i.path};const c=t.edges.find(d=>d.source===i.id&&d.target===l.id);return c?{method:i.method,path:i.path,extract:{varName:c.mapping.variableName,jsonPath:c.mapping.sourceJsonPath||"$"}}:{method:i.method,path:i.path}})}function gk(t){var s;const r=t.map((l,c)=>({id:`n-${c}`,method:l.method,path:l.path,x:40+c*300,y:120})),i=[];for(let l=0;l<t.length-1;l++){const c=(s=t[l])==null?void 0:s.extract;c!=null&&c.jsonPath&&i.push({id:`e-${l}`,source:`n-${l}`,target:`n-${l+1}`,mapping:{sourceJsonPath:c.jsonPath,variableName:c.varName,useInTarget:"vars_only",targetKey:""}})}return{nodes:r,edges:i}}const gg=U.createContext({productName:null,logoDataUrl:null});function yk({value:t,children:r}){return g.jsx(gg.Provider,{value:t,children:r})}function vk(){return U.useContext(gg)}function xk({data:t,defaultOpenDepth:r=3}){return g.jsx("div",{className:"json-tree text-[11px] font-mono leading-relaxed text-left overflow-auto max-h-80 rounded-lg border border-surface-700 bg-surface-950/80 p-2",children:g.jsx(ld,{value:t,depth:0,defaultOpenDepth:r})})}function ld({value:t,depth:r,defaultOpenDepth:i,name:s}){return t===null||typeof t!="object"?g.jsx(wk,{name:s,value:t}):Array.isArray(t)?g.jsx(bk,{name:s,value:t,depth:r,defaultOpenDepth:i}):g.jsx(_k,{name:s,value:t,depth:r,defaultOpenDepth:i})}function wk({name:t,value:r}){return g.jsxs("div",{className:"pl-1 break-all",children:[t!=null&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),g.jsx("span",{className:"text-slate-500",children:": "})]}),g.jsx("span",{className:"text-emerald-200/95",children:JSON.stringify(r)})]})}function bk({name:t,value:r,depth:i,defaultOpenDepth:s}){const l=i<s,[c,d]=U.useState(l);return r.length===0?g.jsxs("div",{className:"pl-1",children:[t!=null&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),g.jsx("span",{className:"text-slate-500",children:": "})]}),g.jsx("span",{className:"text-slate-500",children:"[]"})]}):g.jsxs("div",{className:"pl-1",children:[t!=null&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),g.jsx("span",{className:"text-slate-500",children:": "})]}),g.jsx("button",{type:"button","aria-expanded":c,onClick:()=>d(!c),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:c?"▼":"▶"}),g.jsx("span",{className:"text-slate-500",children:"["}),g.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:r.length}),c&&g.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:r.map((h,v)=>g.jsxs("li",{children:[g.jsx("span",{className:"text-violet-400/90 mr-1",children:v}),g.jsx(ld,{value:h,depth:i+1,defaultOpenDepth:s})]},v))}),!c&&g.jsx("span",{className:"text-slate-600",children:" … "}),g.jsx("span",{className:"text-slate-500",children:"]"})]})}function _k({name:t,value:r,depth:i,defaultOpenDepth:s}){const l=Object.keys(r),c=i<s,[d,h]=U.useState(c);return l.length===0?g.jsxs("div",{className:"pl-1",children:[t!=null&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),g.jsx("span",{className:"text-slate-500",children:": "})]}),g.jsx("span",{className:"text-slate-500",children:"{}"})]}):g.jsxs("div",{className:"pl-1",children:[t!=null&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),g.jsx("span",{className:"text-slate-500",children:": "})]}),g.jsx("button",{type:"button","aria-expanded":d,onClick:()=>h(!d),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:d?"▼":"▶"}),g.jsx("span",{className:"text-slate-500",children:"{"}),g.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:l.length}),d&&g.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:l.map(v=>g.jsx("li",{children:g.jsx(ld,{name:v,value:r[v],depth:i+1,defaultOpenDepth:s})},v))}),!d&&g.jsx("span",{className:"text-slate-600",children:" … "}),g.jsx("span",{className:"text-slate-500",children:"}"})]})}function ud(t,r){if(!r.startsWith("#/"))return;const i=r.slice(2).split("/");let s=t;for(const l of i)if(s&&typeof s=="object"&&l in s)s=s[l];else return;return s}function Sk(t,r){return"$ref"in r?ud(t,r.$ref):r}function mm(t,r){return"$ref"in r?ud(t,r.$ref):r}function yg(t,r,i){var b;const s=(b=t.paths)==null?void 0:b[i],l=s==null?void 0:s[r.toLowerCase()];if(!l)return[];const c=(s==null?void 0:s.parameters)??[],d=l.parameters??[],h=new Set,v=[];for(const S of[...c,...d]){const x=Sk(t,S);if(!x||!["query","path","header","cookie"].includes(x.in))continue;const _=`${x.in}:${x.name}`;h.has(_)||(h.add(_),v.push({name:x.name,in:x.in,required:!!x.required,description:typeof x.description=="string"?x.description:void 0}))}return v}function zf(t,r,i){var v,b,S,x;const s=(b=(v=t.paths)==null?void 0:v[i])==null?void 0:b[r.toLowerCase()];if(!(s!=null&&s.requestBody))return null;const l=s.requestBody,c="$ref"in l?ud(t,l.$ref):l;if(!((x=(S=c==null?void 0:c.content)==null?void 0:S["application/json"])!=null&&x.schema))return null;const d=c.content["application/json"].schema,h=mm(t,d);if(!h)return null;if(h.type==="object"&&h.properties&&Object.keys(h.properties).length>0){const _=new Set(h.required??[]);return Object.keys(h.properties).map(C=>{const j=h.properties[C],$=j&&"$ref"in j?mm(t,j):j;return{key:C,required:_.has(C),description:$==null?void 0:$.description,format:$==null?void 0:$.format,type:$==null?void 0:$.type}})}return null}function kk(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vg(t,r){let i=t;for(const[s,l]of Object.entries(r))i=i.replace(new RegExp(`\\{${kk(s)}\\}`,"g"),encodeURIComponent(l));return i}function xg(t,r){const i=new URLSearchParams;for(const l of r){if(l.in!=="query")continue;const c=t[l.name];c!==void 0&&c!==""&&i.set(l.name,c)}const s=i.toString();return s?`?${s}`:""}function cd(t,r){var s;if(!(t!=null&&t.length))return{};const i={};for(const l of t){const c=((s=r[l.key])==null?void 0:s.trim())??"";if(c==="")continue;const d=l.type;if(d==="integer"||d==="number"){const h=Number(c);i[l.key]=Number.isFinite(h)?h:c}else if(d==="boolean")i[l.key]=c==="true"||c==="1";else try{i[l.key]=JSON.parse(c)}catch{i[l.key]=c}}return i}function gm(t,r){const i=cd(t,r);return JSON.stringify(i,null,2)}function Nk(t,r){if(!(t!=null&&t.length))return{};try{const i=JSON.parse(r||"{}"),s={};for(const l of t)if(l.key in i&&i[l.key]!==void 0){const c=i[l.key];s[l.key]=typeof c=="string"?c:JSON.stringify(c)}else s[l.key]="";return s}catch{return Object.fromEntries(t.map(i=>[i.key,""]))}}function wg(t){return/\{[^/}]+\}/.test(t)}function Ek(t,r,i,s,l){var h,v;const c={...t};for(const b of r){const S=(h=i[b.name])==null?void 0:h.trim();S&&(c[b.name]=S)}const d=[];for(const b of s){const S=(v=l[b.name])==null?void 0:v.trim();S&&d.push(`${b.name}=${S}`)}return d.length&&(c.Cookie=c.Cookie?`${c.Cookie}; ${d.join("; ")}`:d.join("; ")),c}function Ck(t,r,i,s,l){var P,R,B,V,W;const c=yg(t,r.method,r.path),d=c.filter(Q=>Q.in==="path"),h=c.filter(Q=>Q.in==="query"),v=c.filter(Q=>Q.in==="header"),b=c.filter(Q=>Q.in==="cookie"),S=zf(t,r.method,r.path),x=r.method.toLowerCase(),_=x!=="get"&&x!=="head";for(const Q of d)if(Q.required&&!((P=l.pathVals[Q.name])!=null&&P.trim()))return{ok:!1,error:`Parámetro de ruta obligatorio: ${Q.name}`};for(const Q of h)if(Q.required&&!((R=l.queryVals[Q.name])!=null&&R.trim()))return{ok:!1,error:`Query obligatorio: ${Q.name}`};for(const Q of v)if(Q.required&&!((B=l.headerVals[Q.name])!=null&&B.trim()))return{ok:!1,error:`Header obligatorio: ${Q.name}`};for(const Q of b)if(Q.required&&!((V=l.cookieVals[Q.name])!=null&&V.trim()))return{ok:!1,error:`Cookie obligatorio: ${Q.name}`};let C=vg(r.path,l.pathVals);if(wg(C))return{ok:!1,error:"Quedan placeholders `{…}` en la ruta sin valor."};const j=xg(l.queryVals,c),T=`${Ri(t,i)}${C}${j}`,I=Ek(s(),v,l.headerVals,b,l.cookieVals);let H;if(_)if(l.bodyMode==="fields"&&(S!=null&&S.length)){for(const de of S)if(de.required&&!((W=l.bodyVals[de.key])!=null&&W.trim()))return{ok:!1,error:`Campo de body obligatorio: ${de.key}`};const Q=cd(S,l.bodyVals);H=JSON.stringify(Q)}else H=l.tryBodyRaw.trim()||"{}";return{ok:!0,url:T,headers:I,body:H,method:r.method.toUpperCase()}}function eu(t){return`'${t.replace(/'/g,"'\\''")}'`}function jk(t){const r=["curl","-sS","-X",eu(t.method)],i=Object.entries(t.headers);i.sort(([s],[l])=>s.localeCompare(l));for(const[s,l]of i)r.push("-H",eu(`${s}: ${l}`));return t.body!==void 0&&t.body!==""&&r.push("--data",eu(t.body)),r.push(eu(t.url)),r.join(" ")}function vf(t,r,i){var d;const s=r.toLowerCase(),l=(d=t.paths)==null?void 0:d[i];if(!l||typeof l!="object"||"$ref"in l)return!1;const c=l[s];return(c==null?void 0:c.deprecated)===!0}function Pk(t,r,i,s,l){var h,v;const c={...t};for(const b of r){const S=(h=i[b.name])==null?void 0:h.trim();S&&(c[b.name]=S)}const d=[];for(const b of s){const S=(v=l[b.name])==null?void 0:v.trim();S&&d.push(`${b.name}=${S}`)}return d.length&&(c.Cookie=c.Cookie?`${c.Cookie}; ${d.join("; ")}`:d.join("; ")),c}function $k({doc:t,selectedOp:r,baseUrl:i,buildHeaders:s}){const[l,c]=U.useState({}),[d,h]=U.useState({}),[v,b]=U.useState({}),[S,x]=U.useState({}),[_,C]=U.useState({}),[j,$]=U.useState("{}"),[T,I]=U.useState("raw"),[H,P]=U.useState(null),[R,B]=U.useState(null),[V,W]=U.useState(null),Q=U.useMemo(()=>yg(t,r.method,r.path),[t,r.method,r.path]),de=U.useMemo(()=>Q.filter(pe=>pe.in==="path"),[Q]),ke=U.useMemo(()=>Q.filter(pe=>pe.in==="query"),[Q]),Y=U.useMemo(()=>Q.filter(pe=>pe.in==="header"),[Q]),fe=U.useMemo(()=>Q.filter(pe=>pe.in==="cookie"),[Q]),ve=U.useMemo(()=>zf(t,r.method,r.path),[t,r.method,r.path]),D=r.method.toLowerCase(),ue=D!=="get"&&D!=="head";U.useEffect(()=>{c({}),h({}),b({}),x({}),B(null),P(null);const pe=zf(t,r.method,r.path);pe!=null&&pe.length?(C(Object.fromEntries(pe.map(be=>[be.key,""]))),I("fields"),$(gm(pe,{}))):(C({}),I("raw"),$("{}"))},[t,r.method,r.path]);const G=U.useCallback((pe,be)=>{C($e=>({...$e,[pe]:be}))},[]),se=U.useCallback(()=>{ve!=null&&ve.length&&$(gm(ve,_)),I("raw")},[ve,_]),F=U.useCallback(()=>{ve!=null&&ve.length&&C(Nk(ve,j)),I("fields")},[ve,j]),q=async()=>{var De,Ne,et,Fe,Ke;B(null);const pe=Ri(t,i);for(const qe of de)if(qe.required&&!((De=l[qe.name])!=null&&De.trim())){B(`Parámetro de ruta obligatorio: ${qe.name}`);return}for(const qe of ke)if(qe.required&&!((Ne=d[qe.name])!=null&&Ne.trim())){B(`Query obligatorio: ${qe.name}`);return}for(const qe of Y)if(qe.required&&!((et=v[qe.name])!=null&&et.trim())){B(`Header obligatorio: ${qe.name}`);return}for(const qe of fe)if(qe.required&&!((Fe=S[qe.name])!=null&&Fe.trim())){B(`Cookie obligatorio: ${qe.name}`);return}let be=vg(r.path,l);if(wg(be)){B("Quedan placeholders `{…}` en la ruta sin valor.");return}const $e=xg(d,Q),Ae=`${pe}${be}${$e}`,Oe=Pk(s(),Y,v,fe,S),Se={method:r.method.toUpperCase(),headers:Oe,credentials:"include"};if(ue)if(T==="fields"&&(ve!=null&&ve.length)){for(const at of ve)if(at.required&&!((Ke=_[at.key])!=null&&Ke.trim())){B(`Campo de body obligatorio: ${at.key}`);return}const qe=cd(ve,_);Se.body=JSON.stringify(qe)}else{const qe=j.trim()||"{}";Se.body=qe}try{const qe=await fetch(Ae,Se),at=await qe.text();let ot=null;try{ot=at?JSON.parse(at):null}catch{ot=null}P({status:qe.status,statusText:qe.statusText,bodyText:at,json:ot})}catch(qe){P(null),B(qe instanceof Error?qe.message:String(qe))}},Z=async()=>{W(null);const pe=Ck(t,r,i,s,{pathVals:l,queryVals:d,headerVals:v,cookieVals:S,bodyVals:_,tryBodyRaw:j,bodyMode:T});if(!pe.ok){W(pe.error);return}const be=jk(pe);try{await navigator.clipboard.writeText(be),W("cURL copiado al portapapeles."),window.setTimeout(()=>W(null),2500)}catch{W("No se pudo copiar (permiso del portapapeles).")}},A=(pe,be,$e)=>g.jsxs("label",{className:"block text-xs",children:[g.jsxs("span",{className:"text-slate-400",children:[pe.name,pe.required?g.jsx("span",{className:"text-rose-400/90",children:" *"}):null,pe.in!=="path"?g.jsxs("span",{className:"text-slate-600 ml-1",children:["(",pe.in,")"]}):null]}),g.jsx("input",{type:"text",className:"glass-input mt-0.5 w-full min-h-[44px] sm:min-h-0 border rounded-xl px-3 py-2 font-mono text-[11px] text-slate-200 transition-colors duration-150 hover:border-accent/25",value:be[pe.name]??"",onChange:Ae=>$e(Oe=>({...Oe,[pe.name]:Ae.target.value})),placeholder:pe.description||(pe.in==="path"?`{${pe.name}}`:""),autoComplete:"off"})]},`${pe.in}:${pe.name}`),K=pe=>g.jsxs("label",{className:"block text-xs",children:[g.jsxs("span",{className:"text-slate-400",children:[pe.key,pe.required?g.jsx("span",{className:"text-rose-400/90",children:" *"}):null,pe.type?g.jsxs("span",{className:"text-slate-600 ml-1",children:["(",pe.type,")"]}):null]}),g.jsx("input",{type:"text",className:"glass-input mt-0.5 w-full min-h-[44px] sm:min-h-0 border rounded-xl px-3 py-2 font-mono text-[11px] text-slate-200 transition-colors duration-150 hover:border-accent/25",value:_[pe.key]??"",onChange:be=>G(pe.key,be.target.value),placeholder:pe.description||"valor o JSON para objetos anidados",autoComplete:"off"})]},pe.key);return g.jsxs("section",{className:"space-y-4 glass-card p-4",children:[g.jsx("h3",{className:"text-sm font-semibold tracking-tight text-slate-200",children:"Probar"}),(de.length>0||ke.length>0||Y.length>0||fe.length>0)&&g.jsxs("div",{className:"space-y-2 rounded-xl border border-white/[0.07] bg-surface-950/35 backdrop-blur-sm p-3",children:[g.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Parámetros"}),g.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[de.map(pe=>A(pe,l,c)),ke.map(pe=>A(pe,d,h)),Y.map(pe=>A(pe,v,b)),fe.map(pe=>A(pe,S,x))]})]}),ue&&g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsx("span",{className:"text-xs text-slate-400",children:"Body"}),ve!=null&&ve.length?g.jsxs("div",{className:"flex rounded-lg border border-surface-600 overflow-hidden text-xs shadow-inner shadow-black/20",role:"group","aria-label":"Modo de body",children:[g.jsx("button",{type:"button",className:`min-h-[40px] px-3 py-2 transition-colors duration-200 sm:min-h-0 sm:py-1.5 ${T==="fields"?"bg-accent/25 text-accent font-medium":"bg-surface-800 text-slate-400 hover:text-slate-200"}`,onClick:F,children:"Campos"}),g.jsx("button",{type:"button",className:`min-h-[40px] px-3 py-2 transition-colors duration-200 sm:min-h-0 sm:py-1.5 border-l border-surface-600/80 ${T==="raw"?"bg-accent/25 text-accent font-medium":"bg-surface-800 text-slate-400 hover:text-slate-200"}`,onClick:se,children:"JSON raw"})]}):g.jsx("span",{className:"text-[10px] text-slate-500",children:"(solo JSON — sin propiedades `object` en el spec)"})]}),T==="fields"&&(ve!=null&&ve.length)?g.jsx("div",{className:"grid gap-2 sm:grid-cols-2 rounded-xl border border-white/[0.07] bg-surface-950/35 backdrop-blur-sm p-3",children:ve.map(pe=>K(pe))}):g.jsx("textarea",{className:"glass-input w-full h-28 min-h-[7rem] border rounded-xl p-3 font-mono text-xs text-slate-200 leading-relaxed transition-colors duration-150 hover:border-accent/25",value:j,onChange:pe=>$(pe.target.value),placeholder:'{"key": "value"}',spellCheck:!1})]}),R&&g.jsx("p",{role:"alert",className:"text-xs text-rose-200 bg-rose-950/40 border border-rose-700/50 rounded-lg px-3 py-2 leading-relaxed",children:R}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsx("button",{type:"button",onClick:()=>void q(),className:"min-h-[48px] sm:min-h-0 px-6 py-3 sm:px-5 sm:py-2.5 rounded-xl bg-accent text-surface-950 font-semibold text-sm shadow-lg shadow-accent/15 transition-[transform,filter] duration-200 hover:brightness-110 active:scale-[0.98] motion-reduce:active:scale-100 cursor-pointer",children:"Ejecutar"}),g.jsx("button",{type:"button",onClick:()=>void Z(),className:"min-h-[48px] sm:min-h-0 px-4 py-3 sm:py-2.5 rounded-xl glass-pill text-slate-200 text-sm font-medium",children:"Copiar cURL"})]}),V?g.jsx("p",{className:"text-xs text-emerald-400/90",role:"status",children:V}):null,g.jsxs("div",{className:"space-y-2",children:[g.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Respuesta"}),H?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"text-xs font-mono text-slate-300 bg-surface-900/80 border border-surface-700 rounded-lg px-3 py-2",children:[g.jsx("span",{className:H.status>=200&&H.status<300?"text-emerald-400":H.status>=400?"text-rose-400":"text-amber-300",children:H.status})," ",H.statusText]}),H.json!==null?g.jsx(xk,{data:H.json,defaultOpenDepth:3}):g.jsx("pre",{className:"text-xs glass-input border rounded-xl p-3 overflow-auto max-h-64 text-emerald-300/90 whitespace-pre-wrap font-mono",children:H.bodyText||"—"})]}):g.jsx("p",{className:"text-xs text-slate-500",children:"—"})]})]})}function Mk(t){const r=t.toLowerCase().trim();return`border-l-[3px] ${r==="get"?"border-l-emerald-400":r==="post"?"border-l-sky-400":r==="put"?"border-l-amber-400":r==="patch"?"border-l-violet-400":r==="delete"?"border-l-rose-400":r==="head"||r==="options"||r==="trace"?"border-l-slate-400":"border-l-cyan-400/80"}`}function Tk(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("circle",{cx:"11",cy:"11",r:"8"}),g.jsx("path",{d:"m21 21-4.3-4.3"})]})}function Ik(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("circle",{cx:"18",cy:"5",r:"3"}),g.jsx("circle",{cx:"6",cy:"12",r:"3"}),g.jsx("circle",{cx:"18",cy:"19",r:"3"}),g.jsx("path",{d:"m8.59 13.51 6.83 3.98"}),g.jsx("path",{d:"m15.41 6.51-6.82 3.98"})]})}function Ak(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("path",{d:"M12 3 2 8l10 5 10-5-10-5Z"}),g.jsx("path",{d:"M2 13 12 18l10-5"}),g.jsx("path",{d:"M2 18 12 23l10-5"})]})}function Ok(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("path",{d:"M9 11l3 3L22 4"}),g.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}function bg(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("path",{d:"M12 8V4H8"}),g.jsx("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}),g.jsx("path",{d:"M2 14h2"}),g.jsx("path",{d:"M20 14h2"}),g.jsx("path",{d:"M15 13v2"}),g.jsx("path",{d:"M9 13v2"})]})}function Rk(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),g.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function Lk(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),g.jsx("polyline",{points:"7 10 12 15 17 10"}),g.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function Dk(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),g.jsx("polyline",{points:"17 8 12 3 7 8"}),g.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]})}function zk(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),g.jsx("polyline",{points:"16 17 21 12 16 7"}),g.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})}function ym(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("path",{d:"M15 3h6v6"}),g.jsx("path",{d:"M9 21H3v-6"}),g.jsx("path",{d:"M21 3l-7 7"}),g.jsx("path",{d:"M3 21l7-7"})]})}const Fk=["get","post","put","patch","delete","options","head","trace"];function _g(t,r){const i=t.trim().replace(/\s+/g," ");return i.length<=r?i:`${i.slice(0,r-1)}…`}function Bk(t,r,i,s,l){const c=[`${t.toUpperCase()} ${r}`];return i&&c.push(`— ${_g(i,140)}`),s!=null&&s.length&&c.push(`[tags: ${s.join(", ")}]`),l&&c.push(`(operationId: ${l})`),c.join(" ")}function Hk(t,r){const i=[];let s=0;const l=t.paths;if(!l)return{lines:i,total:0};for(const[c,d]of Object.entries(l)){if(!d||typeof d!="object"||"$ref"in d)continue;const h=d;for(const v of Fk){const b=h[v];if(!(!b||typeof b!="object")&&(s+=1,i.length<r)){const S=b.summary||(b.description?_g(b.description,200):void 0);i.push(Bk(v,c,S,b.tags,b.operationId))}}}return{lines:i,total:s}}function Vk(t){var i,s,l,c,d,h,v;const r=[`Flujo «${t.name}»`];if((i=t.steps)!=null&&i.length){const b=t.steps.map(x=>`${x.method.toUpperCase()} ${x.path}`).join(" → ");r.push(`secuencia (pasos): ${b}`);const S=t.steps.filter(x=>x.extract).map(x=>`${x.extract.varName} ← ${x.extract.jsonPath}`);S.length&&r.push(`extracciones: ${S.join("; ")}`)}if((l=(s=t.graph)==null?void 0:s.nodes)!=null&&l.length){const b=t.graph.nodes.map(S=>`${S.method.toUpperCase()} ${S.path}`).join(" → ");r.push(`grafo (nodos en orden guardado): ${b}`),(c=t.graph.edges)!=null&&c.length&&r.push(`cables: ${t.graph.edges.length} (mapeo respuesta → siguiente request; detalle en la UI Flujos)`)}return!((d=t.steps)!=null&&d.length)&&!((v=(h=t.graph)==null?void 0:h.nodes)!=null&&v.length)&&r.push("(sin pasos ni nodos)"),r.join(". ")}function Uk(t){var i;if(!((i=t.cases)!=null&&i.length))return`Suite «${t.name}»: sin casos`;const r=t.cases.map(s=>`${s.method.toUpperCase()} ${s.path} → esperado HTTP ${s.expectStatus}`).join("; ");return`Suite «${t.name}» (${t.cases.length} caso(s)): ${r}`}function Kk(t,r){var T,I,H,P;const i=t.info.title??"API",s=t.info.version??"",l=`Documentación OpenAPI «${i}»${s?` v${s}`:""}.`,c=((T=t.servers)==null?void 0:T.map(R=>`${R.url}${R.description?` (${R.description})`:""}`).join(`
|
|
207
|
+
`))||"(sin servers en el spec; usa la Base URL de la barra superior en la UI)",d=(I=t.components)!=null&&I.securitySchemes?Object.entries(t.components.securitySchemes).map(([R,B])=>{if(!B||typeof B!="object"||"$ref"in B)return`${R}: ref`;const V=B.type??"?";return`${R} (${V})`}).join("; "):"",{lines:h,total:v}=Hk(t,400),b=v>h.length?`
|
|
208
|
+
… y ${v-h.length} operación(es) más en el spec.`:"";let S="";const x=((H=r==null?void 0:r.savedFlows)==null?void 0:H.filter(R=>R.name))??[];x.length&&(S=`
|
|
209
|
+
|
|
210
|
+
--- Flujos guardados por el usuario en esta app (${x.length}) ---
|
|
211
|
+
${x.map(Vk).join(`
|
|
212
|
+
`)}`);let _="";const C=((P=r==null?void 0:r.testSuites)==null?void 0:P.filter(R=>R.name))??[];C.length&&(_=`
|
|
213
|
+
|
|
214
|
+
--- Suites de tests guardadas (${C.length}) ---
|
|
215
|
+
${C.map(Uk).join(`
|
|
216
|
+
`)}`);let j="";const $=r==null?void 0:r.selectedOperation;return $!=null&&$.path&&(j=`
|
|
217
|
+
|
|
218
|
+
--- Operación enfocada en la UI (Explorar) ---
|
|
219
|
+
${$.method.toUpperCase()} ${$.path}
|
|
220
|
+
(Prioriza explicar esta ruta si el usuario pregunta en genérico «este endpoint».)`),`${l}
|
|
221
|
+
|
|
222
|
+
--- Servidores (servers) ---
|
|
223
|
+
${c}
|
|
224
|
+
|
|
225
|
+
--- Seguridad (components.securitySchemes) ---
|
|
226
|
+
${d||"(ninguno declarado o solo referencias)"}
|
|
227
|
+
|
|
228
|
+
--- Catálogo de endpoints (método, ruta, resumen/tags) ---
|
|
229
|
+
Total de operaciones en el spec: ${v}.
|
|
230
|
+
${h.join(`
|
|
231
|
+
`)}${b}
|
|
232
|
+
${S}
|
|
233
|
+
${_}${j}
|
|
234
|
+
|
|
235
|
+
Instrucciones:
|
|
236
|
+
- Responde en el idioma del usuario. Sé preciso: cita método y ruta cuando hables de un endpoint.
|
|
237
|
+
- Puedes explicar cómo encadenar llamadas (flujos), qué variables extraer entre pasos, y cómo se relacionan con los tests guardados.
|
|
238
|
+
- Para probar requests reales, el usuario debe usar la pestaña Explorar (o Flujos/Tests); tú no ejecutas HTTP.
|
|
239
|
+
- Si falta detalle en este resumen, indica que puede ver el cuerpo completo de la operación en la UI (Explorar) o en el JSON OpenAPI.`}async function qk(t,r,i,s,l){const c=`${t.replace(/\/?$/,"/")}__chat`,d=await fetch(c,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",[jy]:r},body:JSON.stringify({provider:i,model:s,messages:l})}),h=await d.text();if(!d.ok){let v=h;try{const b=JSON.parse(h);v=b.message??b.error??h}catch{}throw new Error(v||`HTTP ${d.status}`)}return JSON.parse(h)}function Wk({doc:t,contextExtras:r,provider:i,model:s,apiKey:l,onOpenLlmSettings:c}){const d="/docs/",[h,v]=U.useState(!1),[b,S]=U.useState([]),[x,_]=U.useState(""),[C,j]=U.useState(!1),[$,T]=U.useState(null),I=U.useRef(null),H=U.useMemo(()=>Kk(t,r),[t,r]);U.useEffect(()=>{var B;(B=I.current)==null||B.scrollIntoView({behavior:"smooth"})},[b]);const P=U.useCallback(async()=>{const B=x.trim();if(!B||C)return;if(!l.trim()){T("Configura tu API key: botón «Asistente: API de IA…» al pie del menú, o el icono del asistente."),c==null||c();return}T(null);const V=s.trim()||tu(i),W={role:"user",content:B},Q=[{role:"system",content:H},...b.filter(de=>de.role!=="system"),W];_(""),S(de=>[...de,W]),j(!0);try{const de=await qk(d,l.trim(),i,V,Q);S(ke=>[...ke,{role:"assistant",content:de.content??""}])}catch(de){T(de instanceof Error?de.message:String(de))}finally{j(!1)}},[l,d,x,C,b,s,c,i,H]),R=U.useCallback(()=>{S([]),T(null)},[]);return g.jsxs("div",{className:"fixed bottom-4 right-4 z-[100] flex flex-col items-end gap-2 pointer-events-none [&>*]:pointer-events-auto",style:{paddingBottom:"max(0.5rem, env(safe-area-inset-bottom))"},children:[h?g.jsxs("div",{className:"glass-modal-panel w-[min(100vw-1.5rem,24rem)] h-[min(72vh,28rem)] flex flex-col rounded-2xl overflow-hidden",role:"dialog","aria-label":"Asistente de la API",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 border-b border-white/[0.08] bg-surface-950/30",children:[g.jsx("span",{className:"text-sm font-medium text-slate-200",children:"Asistente"}),g.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[g.jsx("button",{type:"button",onClick:R,className:"text-[11px] text-slate-500 hover:text-slate-300 px-2 py-1 rounded-lg glass-pill",children:"Vaciar"}),g.jsx("button",{type:"button",onClick:()=>v(!1),className:"touch-target min-w-[2.25rem] min-h-[2.25rem] rounded-xl text-slate-400 hover:text-white glass-pill text-lg leading-none","aria-label":"Cerrar panel del asistente",children:"×"})]})]}),$?g.jsxs("div",{className:"px-3 py-2 text-xs text-rose-200 bg-rose-950/35 backdrop-blur-sm border-b border-rose-500/20 flex flex-wrap items-center gap-2",children:[g.jsx("span",{className:"flex-1 min-w-0",children:$}),c?g.jsx("button",{type:"button",className:"shrink-0 underline text-accent",onClick:c,children:"Abrir configuración"}):null]}):null,g.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3 min-h-0",children:[b.length===0?g.jsx("p",{className:"text-xs text-slate-500 text-center py-6 leading-relaxed px-1",children:"Pregunta por endpoints, flujos o tests. Configura el proveedor con «Asistente: API de IA…» en el menú."}):b.map((B,V)=>g.jsxs("div",{className:`text-xs leading-relaxed rounded-xl px-2.5 py-2 backdrop-blur-sm ${B.role==="user"?"bg-accent/15 text-slate-100 ml-3 border border-accent/30 shadow-[0_4px_20px_-8px_rgb(var(--accent)/0.35)]":"bg-surface-800/50 text-slate-200 mr-3 border border-white/[0.08]"}`,children:[g.jsx("span",{className:"text-[10px] uppercase tracking-wider text-slate-500 block mb-0.5",children:B.role==="user"?"Tú":"Asistente"}),g.jsx("div",{className:"whitespace-pre-wrap break-words",children:B.content})]},`${V}-${B.role}`)),g.jsx("div",{ref:I})]}),g.jsxs("div",{className:"p-2.5 border-t border-white/[0.08] flex gap-2 bg-surface-950/25",children:[g.jsx("textarea",{className:"glass-input flex-1 min-h-[44px] max-h-32 border rounded-xl px-2.5 py-2 text-xs text-slate-200 resize-y",rows:2,value:x,onChange:B=>_(B.target.value),onKeyDown:B=>{B.key==="Enter"&&!B.shiftKey&&(B.preventDefault(),P())},placeholder:"Pregunta sobre el spec…",disabled:C}),g.jsx("button",{type:"button",onClick:()=>void P(),disabled:C||!x.trim(),className:"self-end shrink-0 min-h-[44px] px-3 rounded-xl bg-accent text-surface-950 font-semibold text-xs shadow-[0_6px_20px_-6px_rgb(var(--accent)/0.5)] disabled:opacity-40",children:C?"…":"Enviar"})]})]}):null,g.jsx("button",{type:"button",onClick:()=>v(B=>!B),className:`touch-target min-w-[3.25rem] min-h-[3.25rem] rounded-full flex items-center justify-center transition-[transform,box-shadow,filter] duration-200 ${h?"glass-fab-muted scale-95":"glass-fab hover:scale-[1.03] hover:brightness-110"}`,"aria-expanded":h,"aria-label":h?"Ocultar asistente":"Abrir asistente",title:"Asistente",children:g.jsx(bg,{className:h?"opacity-80":void 0})})]})}const Sg="adt-llm-provider",kg="adt-llm-model",Ng="adt-llm-key";function Yk(){try{const t=localStorage.getItem(Sg),r=t==="anthropic"||t==="openai"||t==="openrouter"?t:"openrouter",i=localStorage.getItem(kg)??"",s=localStorage.getItem(Ng)??"";return{provider:r,model:i,apiKey:s}}catch{return{provider:"openrouter",model:"",apiKey:""}}}function Xk(t,r,i){try{localStorage.setItem(Sg,t),localStorage.setItem(kg,r),localStorage.setItem(Ng,i)}catch{}}function Qk({open:t,onClose:r,ops:i,onPick:s}){const[l,c]=U.useState(""),d=U.useRef(null),[h,v]=U.useState(0),b=U.useMemo(()=>{const x=l.trim().toLowerCase();return x?i.filter(_=>{const C=(_.operationId??"").toLowerCase(),j=_.path.toLowerCase(),$=_.method.toLowerCase(),T=(_.tags??[]).join(" ").toLowerCase();return j.includes(x)||$.includes(x)||C.includes(x)||T.includes(x)}).slice(0,80):i.slice(0,80)},[i,l]);U.useEffect(()=>{t&&(c(""),v(0),window.setTimeout(()=>{var x;return(x=d.current)==null?void 0:x.focus()},10))},[t]),U.useEffect(()=>{v(0)},[l]);const S=U.useCallback(x=>{s({method:x.method,path:x.path}),r()},[r,s]);return U.useEffect(()=>{if(!t)return;const x=_=>{if(_.key==="Escape"){_.preventDefault(),r();return}_.key==="ArrowDown"&&(_.preventDefault(),v(C=>Math.min(C+1,Math.max(0,b.length-1)))),_.key==="ArrowUp"&&(_.preventDefault(),v(C=>Math.max(0,C-1))),_.key==="Enter"&&b[h]&&(_.preventDefault(),S(b[h]))};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[t,b,h,r,S]),t?g.jsx("div",{className:"glass-modal-backdrop fixed inset-0 z-[120] flex items-start justify-center pt-[12vh] px-3",role:"presentation",onClick:r,children:g.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Buscar operación",className:"glass-modal-panel w-full max-w-xl rounded-2xl overflow-hidden shadow-2xl",onClick:x=>x.stopPropagation(),children:[g.jsxs("div",{className:"border-b border-white/[0.08] px-3 py-2",children:[g.jsx("input",{ref:d,type:"search",className:"glass-input w-full border-0 rounded-xl px-3 py-2.5 text-sm text-slate-100 placeholder:text-slate-500 focus:ring-2 focus:ring-accent/50",placeholder:"Buscar por ruta, método, operationId o tag…",value:l,onChange:x=>c(x.target.value),autoComplete:"off"}),g.jsxs("p",{className:"text-[10px] text-slate-500 mt-1 px-1",children:["↑↓ navegar · Enter abrir · Esc cerrar ·"," ",g.jsx("kbd",{className:"px-1 rounded bg-surface-800 text-slate-400",children:"⌘K"})," /"," ",g.jsx("kbd",{className:"px-1 rounded bg-surface-800 text-slate-400",children:"Ctrl+K"})]})]}),g.jsx("ul",{className:"max-h-[min(50vh,22rem)] overflow-y-auto py-1",role:"listbox",children:b.length===0?g.jsx("li",{className:"px-4 py-6 text-sm text-slate-500 text-center",children:"Sin coincidencias"}):b.map((x,_)=>g.jsx("li",{children:g.jsxs("button",{type:"button",role:"option","aria-selected":_===h,className:`w-full text-left px-3 py-2.5 flex items-start gap-2 transition-colors ${_===h?"bg-accent/15 text-slate-100":"hover:bg-white/[0.04] text-slate-300"}`,onMouseEnter:()=>v(_),onClick:()=>S(x),children:[g.jsx(ka,{method:x.method,size:"sm"}),g.jsxs("span",{className:"flex-1 min-w-0",children:[g.jsx("span",{className:"font-mono text-xs break-all",children:x.path}),x.operationId?g.jsx("span",{className:"block text-[10px] text-slate-500 mt-0.5",children:x.operationId}):null,x.deprecated?g.jsx("span",{className:"ml-2 text-[10px] uppercase text-amber-400/90",children:"deprecated"}):null]})]})},`${x.method}:${x.path}`))})]})}):null}function Gk(t){return typeof t=="object"&&t!==null&&"$ref"in t&&typeof t.$ref=="string"}function Jk({doc:t}){const r=U.useMemo(()=>{var h;const d=(h=t.components)==null?void 0:h.schemas;return!d||typeof d!="object"?[]:Object.keys(d).sort((v,b)=>v.localeCompare(b))},[t]),[i,s]=U.useState(null),l=U.useMemo(()=>{var h,v;if(!i)return"";const d=(v=(h=t.components)==null?void 0:h.schemas)==null?void 0:v[i];if(d===void 0)return"// (no definido)";try{return JSON.stringify(d,null,2)}catch{return String(d)}},[t,i]),c=async()=>{try{await navigator.clipboard.writeText(l)}catch{}};return r.length===0?g.jsx("div",{className:"p-4 max-w-3xl",children:g.jsxs("p",{className:"text-sm text-slate-500",children:["Este spec no define ",g.jsx("code",{className:"text-accent",children:"components.schemas"}),"."]})}):g.jsxs("div",{className:"p-4 flex flex-col lg:flex-row gap-4 min-h-0 max-w-6xl",children:[g.jsxs("div",{className:"lg:w-56 shrink-0 space-y-2",children:[g.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500",children:"Esquemas"}),g.jsx("ul",{className:"space-y-0.5 max-h-[min(70vh,32rem)] overflow-y-auto rounded-xl border border-white/[0.08] bg-surface-950/30 p-1",children:r.map(d=>{var b,S;const h=(S=(b=t.components)==null?void 0:b.schemas)==null?void 0:S[d],v=Gk(h);return g.jsx("li",{children:g.jsxs("button",{type:"button",onClick:()=>s(d),className:`w-full text-left px-2 py-2 rounded-lg text-xs font-mono transition-colors ${i===d?"glass-pill-active text-slate-100":"text-slate-400 hover:bg-white/[0.04] hover:text-slate-200"}`,children:[d,v?g.jsx("span",{className:"block text-[10px] text-slate-500 truncate",title:h.$ref,children:"→ ref"}):null]})},d)})})]}),g.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2 min-h-0",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[g.jsx("h3",{className:"text-sm font-medium text-slate-200",children:i?g.jsx(g.Fragment,{children:g.jsx("code",{className:"text-accent",children:i})}):g.jsx("span",{className:"text-slate-500",children:"Selecciona un esquema"})}),i?g.jsx("button",{type:"button",onClick:()=>void c(),className:"text-xs px-3 py-1.5 rounded-lg glass-pill text-slate-300",children:"Copiar JSON"}):null]}),i?g.jsx("pre",{className:"glass-input border rounded-xl p-3 text-xs font-mono text-slate-200 overflow-auto max-h-[min(70vh,36rem)] whitespace-pre",children:l}):g.jsx("p",{className:"text-xs text-slate-500",children:"Los modelos reutilizables del spec aparecen aquí."})]})]})}const xf="op";function Zk(t,r){const i=`${t.toLowerCase()} ${r}`;return encodeURIComponent(i)}function e2(t){if(!(t!=null&&t.trim()))return null;try{const r=decodeURIComponent(t),i=r.indexOf(" ");if(i===-1)return null;const s=r.slice(0,i).trim().toLowerCase(),l=r.slice(i+1);return!s||l.length===0?null:{method:s,path:l}}catch{return null}}const Eg=[{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 vm(t){return Eg.some(r=>r.value===t)}const wf=[{id:"typescript",label:"TypeScript"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"php",label:"PHP"}];function bf(t,r){return`${t.toLowerCase()} ${r}`}function t2(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}async function xm(t){await navigator.clipboard.writeText(t)}function n2(){var Vr;const t=vk(),[r,i]=U.useState(null),[s,l]=U.useState(null),[c,d]=U.useState("explore"),[h,v]=U.useState(""),[b,S]=U.useState(null),[x,_]=U.useState(null),[C,j]=U.useState("typescript"),[$,T]=U.useState(""),[I,H]=U.useState(""),[P,R]=U.useState("X-Api-Key"),[B,V]=U.useState({nodes:[],edges:[]}),[W,Q]=U.useState(0),[de,ke]=U.useState("Mi flujo"),[Y,fe]=U.useState([]),[ve,D]=U.useState(""),[ue,G]=U.useState({name:"Suite 1",cases:[]}),[se,F]=U.useState([]),[q,Z]=U.useState(""),[A,K]=U.useState(""),[pe,be]=U.useState(null),[$e,Ae]=U.useState(null),[Oe,Se]=U.useState(null),[De,Ne]=U.useState("openrouter"),[et,Fe]=U.useState(""),[Ke,qe]=U.useState(""),[at,ot]=U.useState(!1),[Tt,xn]=U.useState(!1),[Wt,Yt]=U.useState(!1),kt=(L,_e)=>{try{const He=sessionStorage.getItem(L);if(He==="1")return!0;if(He==="0")return!1}catch{}return _e},[nn,dn]=U.useState(()=>kt("adt-collapse-main",!1)),[Pn,wn]=U.useState(()=>kt("adt-collapse-explore",!1)),St="/docs/openapi.json",Xt="/docs/preset.json",Ht=U.useCallback(async()=>{const[L,_e]=await Promise.all([_t.flows.toArray(),_t.testSuites.toArray()]);fe(L.sort((He,Xe)=>(He.name??"").localeCompare(Xe.name??""))),F(_e.sort((He,Xe)=>(He.name??"").localeCompare(Xe.name??"")))},[]);U.useEffect(()=>{var _e,He;if(!r)return;const L=((_e=t.productName)==null?void 0:_e.trim())||((He=r.info.title)==null?void 0:He.trim())||"API";document.title=L},[r,t.productName]),U.useEffect(()=>{fetch(St,{credentials:"include"}).then(async L=>{if(L.status===401){let _e="/docs/__auth/login";try{const He=await L.json();He.loginPath&&(_e=He.loginPath)}catch{}return window.location.href=_e,null}if(!L.ok)throw new Error(`${L.status} ${L.statusText}`);return L.json()}).then(L=>{L&&(i(L),v(Ri(L)),l(null))}).catch(L=>l(L.message))},[St]),U.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-main",nn?"1":"0")}catch{}},[nn]),U.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-explore",Pn?"1":"0")}catch{}},[Pn]),U.useEffect(()=>{(async()=>{try{const L=await fetch("/docs/__auth/session",{credentials:"include"});if(L.ok){const _e=await L.json();Se({username:_e.username})}else Se(null)}catch{Se(null)}})()},[]),U.useEffect(()=>{if(!r)return;let L=!1;return(async()=>{try{const _e=await fetch(Xt,{credentials:"include"});if(!_e.ok||L)return;const He=await _e.json(),Xe=await Zy(He);!L&&Xe&&await Ht()}catch{}})(),()=>{L=!0}},[r,Xt,Ht]),U.useEffect(()=>{Ht(),_t.kv.get("bearer").then(L=>L&&T(L.value)),_t.kv.get("apiKey").then(L=>L&&H(L.value))},[Ht]),U.useEffect(()=>{const L=Yk();Ne(L.provider),Fe(L.model||tu(L.provider)),qe(L.apiKey)},[]),U.useEffect(()=>{Yt(!1)},[r]);const lr=U.useMemo(()=>r?qy(r):[],[r]),yt=U.useMemo(()=>r?no(r):[],[r]),Rn=U.useMemo(()=>r?yt.map(L=>({method:L.method,path:L.path,operationId:L.operationId,tags:L.tags,deprecated:vf(r,L.method,L.path)})):[],[r,yt]);U.useEffect(()=>{if(!r||yt.length===0||Wt)return;const L=new URLSearchParams(window.location.search),_e=e2(L.get(xf));_e&&yt.some(Xe=>Xe.method.toLowerCase()===_e.method&&Xe.path===_e.path)&&(_({method:_e.method,path:_e.path}),d("explore")),Yt(!0)},[r,yt,Wt]),U.useEffect(()=>{if(!Wt||!r)return;const L=new URL(window.location.href);c==="explore"&&x?L.searchParams.set(xf,Zk(x.method,x.path)):L.searchParams.delete(xf),window.history.replaceState({},"",L.toString())},[Wt,r,c,x]),U.useEffect(()=>{const L=_e=>{(_e.metaKey||_e.ctrlKey)&&_e.key.toLowerCase()==="k"&&(_e.preventDefault(),xn(He=>!He))};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[]);const Gn=U.useMemo(()=>({savedFlows:Y,testSuites:se,selectedOperation:x}),[Y,se,x]),Ln=U.useMemo(()=>b?yt.filter(L=>(L.tags??["default"]).includes(b)):yt,[yt,b]);U.useEffect(()=>{if(yt.length&&!A){const L=yt[0];K(bf(L.method,L.path))}},[yt,A]),U.useEffect(()=>{if(yt.length===0||B.nodes.length>0||c!=="flows"||pe!=null)return;const L=yt[0];V({nodes:[{id:crypto.randomUUID(),method:L.method.toLowerCase(),path:L.path,x:80,y:120}],edges:[]}),Q(_e=>_e+1)},[yt,B.nodes.length,c,pe]);const Dn=U.useCallback(()=>{const L={"Content-Type":"application/json"};return $.trim()&&(L.Authorization=`Bearer ${$.trim()}`),I.trim()&&(L[P]=I.trim()),L},[$,I,P]),pn=U.useMemo(()=>{if(!r||!x)return null;const L={};for(const{id:_e}of wf)L[_e]=Vy(r,_e,x.method,x.path);return L},[r,x]),We=U.useMemo(()=>r?Ky(r,C,b):"",[r,C,b]),Nt=U.useMemo(()=>{var Vt,Qt;if(!r||!x)return null;const L=(Vt=r.paths)==null?void 0:Vt[x.path];if(!L||typeof L!="object"||"$ref"in L)return null;const _e=L[x.method.toLowerCase()];if(!_e)return null;const He=typeof _e.summary=="string"?_e.summary:void 0,Xe=typeof _e.description=="string"?_e.description:void 0;let on=null;try{const Ut=_e.requestBody,Ct=(Qt=Ut==null?void 0:Ut.content)==null?void 0:Qt["application/json"];if((Ct==null?void 0:Ct.example)!==void 0)on=JSON.stringify(Ct.example,null,2);else if(Ct!=null&&Ct.examples&&typeof Ct.examples=="object"){const _n=Object.values(Ct.examples)[0];_n&&_n.value!==void 0&&(on=JSON.stringify(_n.value,null,2))}}catch{}return{summary:He,description:Xe,exampleStr:on}},[r,x]),$n=U.useCallback(L=>{_(L),d("explore")},[]),ur=async L=>{var on;if(!r)return"";const _e={};let He="";const Xe=Ri(r,h);for(let Vt=0;Vt<L.length;Vt++){const Qt=L[Vt];let Ut=Qt.path;for(const[Kt,Do]of Object.entries(_e))Ut=Ut.replace(`{${Kt}}`,Do);const Ct=`${Xe}${Ut}`,_n={method:Qt.method.toUpperCase(),headers:Dn()},In=Qt.method.toLowerCase();In!=="get"&&In!=="head"&&(_n.body="{}");const sn=await fetch(Ct,{..._n,credentials:"include"}),ft=await sn.json().catch(()=>({}));if(He+=`Paso ${Vt+1}: ${sn.status}
|
|
240
|
+
${JSON.stringify(ft,null,2)}
|
|
241
|
+
|
|
242
|
+
`,(on=Qt.extract)!=null&&on.jsonPath){const Kt=Ff(ft,Qt.extract.jsonPath);Kt!==void 0&&(_e[Qt.extract.varName]=String(Kt))}}return He},Be=async()=>{if(!r)return;const L=Ri(r,h);if(B.nodes.length===0){D("Añade al menos un nodo al flujo.");return}const _e=await hm(B,L,Dn);D(_e)},zn=async L=>{if(!r)return;const _e=Ri(r,h),He=L.graph&&L.graph.nodes.length>0?await hm(L.graph,_e,Dn):await ur(L.steps);D(He),d("flows")},Jn=L=>{ke(L.name),V(L.graph&&L.graph.nodes.length>0?L.graph:gk(L.steps.length?L.steps:[{method:"get",path:"/"}])),Q(_e=>_e+1),be(L.id??null),d("flows")},_r=()=>{be(null),ke("Nuevo flujo"),yt[0]?V({nodes:[{id:crypto.randomUUID(),method:yt[0].method.toLowerCase(),path:yt[0].path,x:80,y:120}],edges:[]}):V({nodes:[],edges:[]}),Q(L=>L+1)},oo=U.useCallback(L=>{V(L)},[]),Br=async()=>{const L=mk(B);if(pe!=null)await _t.flows.update(pe,{name:de,steps:L,graph:B});else{const _e=await _t.flows.add({name:de,steps:L,graph:B});be(_e)}await Ht()},Ro=async L=>{L!==void 0&&(L===pe&&(be(null),_r()),await _t.flows.delete(L),await Ht())},Lo=()=>{if(!A)return;const{method:L,path:_e}=t2(A),He={id:crypto.randomUUID(),method:L,path:_e,expectStatus:200,contains:void 0,jsonPath:void 0,expectJsonValue:void 0};G(Xe=>({...Xe,cases:[...Xe.cases,He]}))},Fn=L=>{G(_e=>({..._e,cases:_e.cases.filter(He=>He.id!==L)}))},rn=(L,_e)=>{G(He=>({...He,cases:He.cases.map(Xe=>Xe.id===L?{...Xe,..._e}:Xe)}))},Mn=async L=>{if(!r)return"";const _e=Ri(r,h);let He="";for(const Xe of L){const on=`${_e}${Xe.path}`,Vt=await fetch(on,{method:Xe.method.toUpperCase(),headers:Dn(),credentials:"include"}),Qt=await Vt.text(),Ut=ev(Xe,Vt.status,Qt),Ct=`${Ut.pass?"PASS":"FAIL"} ${Xe.method.toUpperCase()} ${Xe.path}`;He+=`${Ct}
|
|
243
|
+
${Ut.lines.map(_n=>` ${_n}`).join(`
|
|
244
|
+
`)}
|
|
245
|
+
|
|
246
|
+
`}return He},cr=async()=>{const L=await Mn(ue.cases);Z(L)},mt=async()=>{if(!r||se.length===0)return;let L="";for(const _e of se)L+=`━━━ ${_e.name} (${_e.cases.length} casos) ━━━
|
|
247
|
+
`,L+=await Mn(_e.cases);Z(L),d("tests")},It=async L=>{const _e=await Mn(L.cases);Z(_e),d("tests")},Sr=L=>{G({name:L.name,cases:L.cases.map(_e=>({..._e,id:_e.id&&_e.id.length>0?_e.id:crypto.randomUUID()}))}),Ae(L.id??null),d("tests")},Zn=()=>{Ae(null),G({name:"Nueva suite",cases:[]})},er=async()=>{if($e!=null)await _t.testSuites.update($e,{name:ue.name,cases:ue.cases});else{const L=await _t.testSuites.add({name:ue.name,cases:ue.cases});Ae(L)}await Ht()},fr=async L=>{L!==void 0&&(L===$e&&(Ae(null),G({name:"Nueva suite",cases:[]})),await _t.testSuites.delete(L),await Ht())},pi=async()=>{await _t.kv.put({key:"bearer",value:$}),await _t.kv.put({key:"apiKey",value:I})},Tn=async()=>{const L=await Jy(),_e=new Blob([JSON.stringify(L,null,2)],{type:"application/json"}),He=document.createElement("a");He.href=URL.createObjectURL(_e),He.download="api-doc-tor-export.json",He.click()},dr=async L=>{var on;const _e=(on=L.target.files)==null?void 0:on[0];if(!_e)return;const He=await _e.text(),Xe=JSON.parse(He);await Em(Xe),await Ht()},Ft=async()=>{await fetch("/docs/__auth/logout",{method:"POST",credentials:"include"}),window.location.href="/docs/__auth/login"},pr=U.useCallback(()=>{ot(!0)},[]),io=U.useCallback(()=>{Xk(De,et.trim(),Ke),ot(!1)},[Ke,et,De]);U.useEffect(()=>{if(!at)return;const L=_e=>{_e.key==="Escape"&&ot(!1)};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[at]);const Bn=()=>{x&&(V(L=>{const _e=L.nodes[L.nodes.length-1],He=_e?_e.x+280:80,Xe=(_e==null?void 0:_e.y)??120;return{nodes:[...L.nodes,{id:crypto.randomUUID(),method:x.method.toLowerCase(),path:x.path,x:He,y:Xe}],edges:L.edges}}),Q(L=>L+1),d("flows"))};if(s)return g.jsx("div",{className:"app-glass-bg min-h-screen flex items-center justify-center p-8",children:g.jsxs("div",{role:"alert",className:"glass-card max-w-lg border-red-500/40 bg-red-950/25 p-6 text-red-100",children:[g.jsx("h1",{className:"font-display text-xl font-bold mb-2",children:"No se pudo cargar OpenAPI"}),g.jsx("p",{className:"text-sm opacity-90 leading-relaxed",children:s}),g.jsxs("p",{className:"text-xs mt-4 text-slate-500",children:["URL intentada: ",St]})]})});if(!r)return g.jsx("div",{className:"app-glass-bg min-h-screen flex items-center justify-center p-6",children:g.jsx("div",{className:"glass-card px-8 py-6 border-white/[0.08]",children:g.jsx("p",{className:"text-slate-300 motion-safe:animate-pulse text-sm font-medium",children:"Cargando especificación…"})})});const Hr=b===null?"Todos los endpoints (cliente único con todas las operaciones)":`Tag «${b}» (solo operaciones de este grupo)`,bn=((Vr=t.productName)==null?void 0:Vr.trim())||r.info.title;return g.jsxs("div",{className:"app-glass-bg min-h-screen flex flex-col selection:bg-accent/25 selection:text-slate-50",children:[g.jsx("a",{href:"#main-content",className:"skip-link",children:"Saltar al contenido"}),g.jsxs("div",{className:"flex flex-1 flex-col md:flex-row min-h-0",children:[g.jsxs("aside",{className:`glass-sidebar w-full border-b md:border-b-0 md:border-r border-surface-600/40 shrink-0 transition-[width] duration-200 ease-out flex flex-col overflow-hidden md:rounded-r-3xl ${nn?"md:w-14 md:min-w-[3.5rem]":"md:w-64"}`,children:[g.jsx("input",{id:"adt-state-import",type:"file",accept:"application/json",className:"hidden",onChange:dr}),g.jsxs("div",{className:nn?"max-md:block md:hidden":"block",children:[g.jsxs("div",{className:"p-4 border-b border-surface-700 flex justify-between items-start gap-2",children:[g.jsxs("div",{className:"min-w-0",children:[t.logoDataUrl?g.jsx("img",{src:t.logoDataUrl,alt:bn,className:"h-9 max-w-[200px] object-contain object-left mb-2"}):null,g.jsx("h1",{className:"font-display text-lg font-bold text-white tracking-tight",children:bn}),g.jsx("p",{className:"text-xs text-slate-500 mt-1",children:bn===r.info.title?`v${r.info.version}`:`${r.info.title} · v${r.info.version}`})]}),g.jsx("button",{type:"button",className:"hidden md:flex shrink-0 touch-target rounded-lg border border-surface-600 bg-surface-800 text-slate-300 hover:bg-surface-700 items-center justify-center text-lg leading-none transition-colors duration-200",onClick:()=>dn(!0),"aria-label":"Ocultar menú lateral",title:"Ocultar menú",children:"‹"})]}),g.jsx("nav",{className:"p-2 flex flex-row md:flex-col gap-1 overflow-x-auto","aria-label":"Navegación principal",children:[["explore","Explorar"],["flows",`Flujos (${Y.length})`],["tests",`Tests (${se.length})`],["schemas","Esquemas"],["auth","Auth"]].map(([L,_e])=>g.jsx("button",{type:"button",onClick:()=>d(L),className:`text-left px-3 py-2.5 md:py-2 rounded-xl text-sm transition-all duration-200 ease-out min-h-[44px] md:min-h-0 flex items-center ${c===L?"glass-pill-active text-accent":"text-slate-400 glass-pill hover:text-slate-200"}`,children:_e},L))}),Oe?g.jsxs("div",{className:"px-3 py-2 border-t border-surface-700 flex items-center justify-between gap-2 text-xs",children:[g.jsx("span",{className:"text-slate-400 truncate",title:Oe.username,children:Oe.username}),g.jsx("button",{type:"button",className:"shrink-0 text-accent hover:underline",onClick:()=>void Ft(),children:"Salir"})]}):null,g.jsxs("div",{className:"p-3 border-t border-surface-700 space-y-2",children:[g.jsx("button",{type:"button",onClick:()=>ot(!0),className:"w-full text-xs py-2.5 rounded-xl glass-pill text-slate-200 hover:text-accent min-h-[44px] md:min-h-0 transition-all duration-200",children:"Asistente: API de IA…"}),g.jsx("button",{type:"button",onClick:Tn,className:"w-full text-xs py-2.5 rounded-xl glass-pill text-slate-300 min-h-[44px] md:min-h-0",children:"Exportar estado"}),g.jsx("label",{htmlFor:"adt-state-import",className:"block w-full text-xs py-2.5 rounded-xl glass-pill text-center text-slate-300 cursor-pointer transition-all duration-200 min-h-[44px] md:min-h-0 flex items-center justify-center",children:"Importar JSON"})]})]}),nn?g.jsxs("div",{className:"max-md:hidden md:flex flex-1 flex-col items-stretch py-2 px-1 gap-1 min-h-0 overflow-y-auto overflow-x-hidden",children:[g.jsx("button",{type:"button",className:"touch-target w-11 h-11 mx-auto rounded-lg border border-surface-600 bg-surface-800 text-slate-200 hover:bg-surface-700 flex items-center justify-center shrink-0 transition-colors duration-200",onClick:()=>dn(!1),"aria-label":"Mostrar menú lateral completo",title:"Expandir panel completo",children:g.jsx(ym,{className:"text-slate-300"})}),g.jsxs("nav",{className:"flex flex-col gap-0.5 items-center w-full py-1 border-b border-surface-700/80","aria-label":"Secciones",children:[g.jsx("button",{type:"button",onClick:()=>d("explore"),title:"Explorar","aria-current":c==="explore"?"page":void 0,className:`relative touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${c==="explore"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:g.jsx(Tk,{})}),g.jsxs("button",{type:"button",onClick:()=>d("flows"),title:`Flujos (${Y.length})`,"aria-current":c==="flows"?"page":void 0,className:`relative touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${c==="flows"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:[g.jsx(Ik,{}),Y.length>0?g.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 min-w-[14px] h-3.5 px-0.5 rounded-full bg-accent text-[8px] font-bold text-surface-950 flex items-center justify-center leading-none",children:Y.length>99?"99+":Y.length}):null]}),g.jsxs("button",{type:"button",onClick:()=>d("tests"),title:`Tests (${se.length})`,"aria-current":c==="tests"?"page":void 0,className:`relative touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${c==="tests"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:[g.jsx(Ok,{}),se.length>0?g.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 min-w-[14px] h-3.5 px-0.5 rounded-full bg-emerald-500 text-[8px] font-bold text-surface-950 flex items-center justify-center leading-none",children:se.length>99?"99+":se.length}):null]}),g.jsx("button",{type:"button",onClick:()=>d("schemas"),title:"Esquemas","aria-current":c==="schemas"?"page":void 0,className:`touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${c==="schemas"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:g.jsx(Ak,{})}),g.jsx("button",{type:"button",onClick:()=>ot(!0),title:"Asistente: configurar API de IA",className:"touch-target w-11 h-11 rounded-lg border border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-accent flex items-center justify-center shrink-0 transition-colors duration-200",children:g.jsx(bg,{})}),g.jsxs("button",{type:"button",onClick:()=>d("auth"),title:"Auth","aria-current":c==="auth"?"page":void 0,className:`relative touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${c==="auth"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:[g.jsx(Rk,{}),Oe?g.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-emerald-400 border border-surface-900","aria-hidden":!0}):null]})]}),g.jsxs("div",{className:"flex flex-col gap-0.5 items-center w-full py-1 mt-auto border-t border-surface-700/80",children:[g.jsx("button",{type:"button",onClick:Tn,title:"Exportar estado",className:"touch-target w-11 h-11 rounded-lg border border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200 flex items-center justify-center transition-colors duration-200",children:g.jsx(Lk,{})}),g.jsx("button",{type:"button",onClick:()=>{var L;return(L=document.getElementById("adt-state-import"))==null?void 0:L.click()},title:"Importar JSON",className:"touch-target w-11 h-11 rounded-lg border border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200 flex items-center justify-center transition-colors duration-200",children:g.jsx(Dk,{})}),Oe?g.jsx("button",{type:"button",onClick:()=>void Ft(),title:`Salir (${Oe.username})`,className:"touch-target w-11 h-11 rounded-lg border border-transparent bg-surface-800/80 text-rose-400/90 hover:bg-rose-950/50 flex items-center justify-center transition-colors duration-200",children:g.jsx(zk,{})}):null]})]}):null]}),g.jsxs("main",{id:"main-content",tabIndex:-1,className:"flex-1 flex flex-col min-h-0 outline-none",children:[g.jsx("header",{className:"glass-sticky-header sticky top-0 z-20 px-4 py-3 flex flex-wrap gap-3 items-center",children:g.jsxs("label",{className:"text-xs text-slate-500 flex flex-col gap-1 sm:flex-row sm:items-center",children:[g.jsx("span",{className:"shrink-0 font-medium text-slate-400",children:"Base URL"}),g.jsx("input",{className:"glass-input sm:ml-2 min-h-[44px] sm:min-h-0 border rounded-xl px-3 py-2 text-sm w-full max-w-md text-slate-200 transition-colors duration-200 hover:border-accent/30",value:h,onChange:L=>v(L.target.value),placeholder:"https://api.ejemplo.com",autoComplete:"url",spellCheck:!1})]})}),c==="explore"&&g.jsxs("div",{className:"flex-1 flex flex-col lg:flex-row min-h-0",children:[g.jsxs("div",{className:`glass-explore-rail shrink-0 border-b lg:border-b-0 lg:border-r border-surface-600/35 overflow-auto transition-[width] duration-200 ease-out lg:rounded-r-2xl ${Pn?"lg:w-14 lg:min-w-[3.5rem] max-h-16 lg:max-h-none":"lg:w-72 max-h-64 lg:max-h-none"}`,children:[g.jsxs("div",{className:Pn?"max-lg:block lg:hidden":"block",children:[g.jsxs("div",{className:"p-2 flex items-start justify-between gap-2 border-b border-surface-700 lg:border-b-0",children:[g.jsx("p",{className:"text-xs uppercase tracking-wider text-slate-500 shrink-0",children:"Tags"}),g.jsx("button",{type:"button",className:"hidden lg:flex shrink-0 touch-target rounded-lg border border-surface-600 bg-surface-800 text-slate-300 hover:bg-surface-700 items-center justify-center text-sm leading-none transition-colors duration-200",onClick:()=>wn(!0),"aria-label":"Ocultar lista de endpoints",title:"Ocultar endpoints",children:"‹"})]}),g.jsx("div",{className:"p-2 pt-1",children:g.jsxs("div",{className:"flex flex-wrap gap-1",children:[g.jsx("button",{type:"button",onClick:()=>S(null),className:`text-xs px-3 py-2 sm:py-1 rounded-xl min-h-[40px] sm:min-h-0 transition-all duration-200 ${b===null?"glass-pill-active text-slate-100":"glass-pill text-slate-300"}`,children:"Todos"}),lr.map(L=>g.jsx("button",{type:"button",onClick:()=>S(L),className:`text-xs px-3 py-2 sm:py-1 rounded-xl min-h-[40px] sm:min-h-0 transition-all duration-200 ${b===L?"glass-pill-active text-slate-100":"glass-pill text-slate-300"}`,children:L},L))]})}),g.jsx("ul",{className:"text-sm",children:Ln.map(L=>g.jsx("li",{children:g.jsxs("button",{type:"button",onClick:()=>_({method:L.method,path:L.path}),className:`w-full text-left px-3 py-2.5 sm:py-2 min-h-[44px] sm:min-h-0 flex gap-2 items-center transition-all duration-150 rounded-r-xl ${(x==null?void 0:x.method)===L.method&&x.path===L.path?"glass-pill-active border-l-2 border-accent ml-0.5":"hover:bg-white/[0.04]"}`,children:[g.jsx(ka,{method:L.method}),g.jsxs("span",{className:"flex-1 min-w-0 flex items-center gap-1.5",children:[g.jsx("span",{className:"truncate text-slate-300",children:L.path}),r&&vf(r,L.method,L.path)?g.jsx("span",{className:"shrink-0 text-[9px] uppercase text-amber-400/90",title:"Deprecated",children:"dep"}):null]})]})},`${L.method}:${L.path}`))})]}),Pn?g.jsxs("div",{className:"max-lg:hidden lg:flex flex-1 flex-col items-stretch py-2 px-1 gap-1 min-h-0 min-w-0",children:[g.jsx("button",{type:"button",className:"touch-target w-11 h-11 mx-auto rounded-lg border border-surface-600 bg-surface-800 text-slate-200 hover:bg-surface-700 flex items-center justify-center shrink-0 transition-colors duration-200",onClick:()=>wn(!1),"aria-label":"Mostrar lista de endpoints completa",title:"Expandir lista de endpoints",children:g.jsx(ym,{className:"text-slate-300"})}),g.jsxs("div",{className:"text-center text-[9px] font-mono text-slate-500 leading-none px-0.5",title:`${Ln.length} operación(es) (filtro actual)`,children:[g.jsx("span",{className:"block text-slate-400 font-semibold text-[11px]",children:Ln.length}),g.jsx("span",{className:"text-[8px] uppercase tracking-tighter",children:"ops"})]}),g.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col gap-0.5 min-h-0 max-h-[min(70vh,32rem)] items-center w-full",role:"list","aria-label":"Endpoints numerados",children:Ln.map((L,_e)=>{const He=(x==null?void 0:x.method)===L.method&&x.path===L.path;return g.jsx("button",{type:"button",role:"listitem",title:`${L.method.toUpperCase()} ${L.path}`,onClick:()=>_({method:L.method,path:L.path}),className:`touch-target min-h-[40px] min-w-[40px] w-10 h-10 shrink-0 rounded-md border border-surface-700 bg-surface-900 text-[11px] font-mono font-semibold text-slate-200 hover:bg-surface-800 transition-colors duration-150 ${Mk(L.method)} ${He?"ring-2 ring-accent/80 shadow-[inset_0_0_0_1px_rgba(56,189,248,0.2)]":""}`,children:_e+1},`${L.method}:${L.path}`)})})]}):null]}),g.jsx("div",{className:"flex-1 p-4 overflow-auto space-y-6",children:x?g.jsxs(g.Fragment,{children:[g.jsxs("div",{children:[g.jsxs("h2",{className:"font-display font-semibold text-white text-lg flex flex-wrap items-center gap-2",children:[g.jsx(ka,{method:x.method,size:"md"}),g.jsx("span",{className:"font-mono text-slate-200 break-all",children:x.path}),r&&vf(r,x.method,x.path)?g.jsx("span",{className:"text-[10px] uppercase px-2 py-0.5 rounded-md border border-amber-500/40 text-amber-300 bg-amber-500/10",children:"deprecated"}):null]}),Nt!=null&&Nt.summary?g.jsx("p",{className:"text-sm text-slate-300 mt-2 leading-relaxed",children:Nt.summary}):null,Nt!=null&&Nt.description&&Nt.description!==Nt.summary?g.jsx("p",{className:"text-xs text-slate-500 mt-2 leading-relaxed whitespace-pre-wrap",children:Nt.description}):null,Nt!=null&&Nt.exampleStr?g.jsxs("details",{className:"mt-3 group",children:[g.jsx("summary",{className:"text-xs text-slate-400 cursor-pointer hover:text-slate-300",children:"Ejemplo de cuerpo (request)"}),g.jsx("pre",{className:"mt-2 glass-input border rounded-xl p-3 text-xs font-mono text-slate-200 overflow-auto max-h-48",children:Nt.exampleStr})]}):null,g.jsxs("p",{className:"text-xs text-slate-500 mt-2",children:["Filtro de exportación de servicio: ",Hr]})]}),r?g.jsx($k,{doc:r,selectedOp:x,baseUrl:h,buildHeaders:Dn}):null,g.jsxs("section",{className:"space-y-3",children:[g.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Snippets por lenguaje"}),g.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:pn&&wf.map(({id:L,label:_e})=>g.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/60 overflow-hidden",children:[g.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-surface-700 bg-surface-800/50",children:[g.jsx("span",{className:"text-xs font-medium text-accent",children:_e}),g.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-surface-600",onClick:()=>void xm(pn[L]),children:"Copiar"})]}),g.jsx("pre",{className:"text-[11px] p-3 overflow-auto max-h-56 text-slate-300 font-mono whitespace-pre-wrap",children:pn[L]})]},L))})]}),g.jsxs("section",{className:"space-y-3 rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[g.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Cliente / servicio generado"}),g.jsx("p",{className:"text-xs text-slate-500",children:Hr}),g.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[g.jsxs("label",{className:"text-xs text-slate-400",children:["Lenguaje del archivo",g.jsx("select",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:C,onChange:L=>j(L.target.value),children:wf.map(({id:L,label:_e})=>g.jsx("option",{value:L,children:_e},L))})]}),g.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-surface-700 hover:bg-surface-600",onClick:()=>void xm(We),children:"Copiar servicio"})]}),g.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:We})]}),g.jsx("div",{className:"flex flex-wrap gap-2 pt-2 border-t border-surface-800",children:g.jsx("button",{type:"button",className:"text-xs px-3 py-2 rounded-lg bg-surface-800 hover:bg-surface-700",onClick:Bn,children:"Añadir operación actual a un flujo (ve a Flujos)"})})]}):g.jsx("p",{className:"text-slate-500",children:"Selecciona una operación en la lista."})})]}),c==="schemas"&&g.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:g.jsx(Jk,{doc:r})}),c==="flows"&&g.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[g.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4",children:[g.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:"Flujos guardados"}),Y.length===0?g.jsx("p",{className:"text-sm text-slate-500",children:"Aún no hay flujos. Crea uno en el editor y guarda."}):g.jsx("ul",{className:"space-y-2",children:Y.map(L=>{var _e,He;return g.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:[g.jsxs("div",{children:[g.jsx("span",{className:"text-sm text-slate-200 font-medium",children:L.name}),g.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[(((He=(_e=L.graph)==null?void 0:_e.nodes)==null?void 0:He.length)??L.steps.length)||0," nodo(s)"]})]}),g.jsxs("div",{className:"flex flex-wrap gap-2",children:[g.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 zn(L),children:"Play"}),g.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent hover:bg-accent/30",onClick:()=>Jn(L),children:"Editar"}),g.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 Ro(L.id),children:"Eliminar"})]})]},L.id!=null?`flow-${L.id}`:`flow-${L.name}`)})})]}),g.jsxs("section",{className:"space-y-4 max-w-6xl",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[g.jsx("h3",{className:"text-sm font-semibold text-white",children:"Editor de flujo (nodos y cables)"}),g.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:_r,children:"Nuevo flujo"})]}),pe!=null&&g.jsxs("p",{className:"text-xs text-accent",children:["Editando flujo guardado (#",pe,")"]}),g.jsxs("p",{className:"text-sm text-slate-400",children:["Cada nodo es un endpoint del spec. Conecta ",g.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 ",g.jsx("code",{className:"text-accent",children:"{variable}"})," en la ruta)."]}),g.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm w-full max-w-md",value:de,onChange:L=>ke(L.target.value),placeholder:"Nombre del flujo"}),g.jsx(hk,{doc:r,ops:yt,graph:B,onGraphChange:oo},W),g.jsxs("div",{className:"flex flex-wrap gap-2",children:[g.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 Be(),children:"Play (grafo)"}),g.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Br(),children:pe!=null?"Guardar cambios":"Guardar flujo"})]}),g.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:ve||"Resultado de la ejecución aquí."})]})]}),c==="tests"&&g.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[g.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[g.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suites guardadas"}),se.length>0&&g.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 mt(),children:"Ejecutar todas las suites"})]}),se.length===0?g.jsx("p",{className:"text-sm text-slate-500",children:"Ninguna suite guardada."}):g.jsx("ul",{className:"space-y-2",children:se.map(L=>g.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:[g.jsxs("div",{children:[g.jsx("span",{className:"text-sm text-slate-200 font-medium",children:L.name}),g.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[L.cases.length," caso(s)"]})]}),g.jsxs("div",{className:"flex flex-wrap gap-2",children:[g.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 It(L),children:"Play"}),g.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent",onClick:()=>Sr(L),children:"Editar"}),g.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40",onClick:()=>void fr(L.id),children:"Eliminar"})]})]},L.id!=null?`suite-${L.id}`:`suite-${L.name}`))})]}),g.jsxs("section",{className:"space-y-4",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[g.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suite en edición"}),g.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:Zn,children:"Nueva suite"})]}),$e!=null&&g.jsxs("p",{className:"text-xs text-accent",children:["Editando suite guardada (#",$e,")"]}),g.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm max-w-md",value:ue.name,onChange:L=>G(_e=>({..._e,name:L.target.value})),placeholder:"Nombre de la suite"}),g.jsxs("div",{className:"flex flex-wrap gap-2 items-end rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[g.jsxs("label",{className:"text-xs text-slate-400 flex-1 min-w-[200px]",children:["Añadir endpoint del spec",g.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm font-mono",value:A,onChange:L=>K(L.target.value),children:yt.map(L=>g.jsxs("option",{value:bf(L.method,L.path),children:[L.method.toUpperCase()," ",L.path]},bf(L.method,L.path)))})]}),g.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-800 text-sm hover:bg-surface-700",onClick:Lo,children:"Añadir a la suite"})]}),g.jsx("ul",{className:"space-y-4",children:ue.cases.map(L=>{const _e=vm(L.expectStatus)?String(L.expectStatus):"custom";return g.jsxs("li",{className:"rounded-xl border border-surface-700 bg-surface-950/40 p-4 space-y-3 text-sm",children:[g.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[g.jsxs("span",{className:"flex flex-wrap items-center gap-2 min-w-0",children:[g.jsx(ka,{method:L.method}),g.jsx("span",{className:"font-mono text-xs text-slate-300 break-all",children:L.path})]}),g.jsx("button",{type:"button",className:"text-xs text-red-400 hover:underline shrink-0",onClick:()=>Fn(L.id),children:"Quitar"})]}),g.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[g.jsxs("label",{className:"text-xs text-slate-400 block",children:["Código HTTP esperado",g.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[g.jsxs("select",{className:"bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm max-w-[200px]",value:_e,onChange:He=>{const Xe=He.target.value;if(Xe==="custom"){rn(L.id,{expectStatus:vm(L.expectStatus)?1e3:L.expectStatus});return}rn(L.id,{expectStatus:Number(Xe)})},children:[Eg.map(He=>g.jsx("option",{value:String(He.value),children:He.label},He.value)),g.jsx("option",{value:"custom",children:"Otro…"})]}),_e==="custom"&&g.jsx("input",{type:"number",className:"w-20 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:L.expectStatus,onChange:He=>rn(L.id,{expectStatus:Number(He.target.value)||0})})]})]}),g.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["El body contiene (opcional)",g.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:L.contains??"",onChange:He=>rn(L.id,{contains:He.target.value||void 0})})]}),g.jsxs("label",{className:"text-xs text-slate-400 block",children:["JSON path (opcional)",g.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:L.jsonPath??"",onChange:He=>rn(L.id,{jsonPath:He.target.value||void 0})})]}),g.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["Valor esperado en JSON path (opcional)",g.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:L.expectJsonValue??"",onChange:He=>rn(L.id,{expectJsonValue:He.target.value||void 0})})]})]})]},L.id)})}),g.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[g.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 cr(),children:"Correr todos los casos (suite actual)"}),g.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void er(),children:$e!=null?"Guardar cambios":"Guardar suite"})]}),g.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 whitespace-pre-wrap min-h-[4rem]",children:q||"—"})]})]}),c==="auth"&&g.jsxs("div",{className:"p-4 space-y-4 max-w-lg",children:[g.jsxs("p",{className:"text-sm text-slate-400",children:["Esquemas en el spec: ",Wy(r).join(", ")||"ninguno"]}),g.jsxs("label",{className:"block text-sm",children:["Bearer token",g.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:$,onChange:L=>T(L.target.value),placeholder:"eyJ..."})]}),g.jsxs("label",{className:"block text-sm",children:["API key header",g.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:P,onChange:L=>R(L.target.value)})]}),g.jsxs("label",{className:"block text-sm",children:["API key",g.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:I,onChange:L=>H(L.target.value),type:"password",autoComplete:"off"})]}),g.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void pi(),children:"Recordar en este navegador"})]})]})]}),g.jsx(Qk,{open:Tt,onClose:()=>xn(!1),ops:Rn,onPick:$n}),at?g.jsx("div",{className:"glass-modal-backdrop fixed inset-0 z-[110] flex items-end sm:items-center justify-center p-4 sm:p-6",role:"presentation",onClick:()=>ot(!1),children:g.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"adt-llm-modal-title",className:"glass-modal-panel w-full max-w-md rounded-2xl max-h-[90vh] overflow-y-auto",onClick:L=>L.stopPropagation(),children:[g.jsxs("div",{className:"flex items-start justify-between gap-2 px-4 py-3 border-b border-white/[0.08]",children:[g.jsx("h2",{id:"adt-llm-modal-title",className:"text-sm font-semibold text-slate-100 pr-2",children:"Asistente: proveedor de IA"}),g.jsx("button",{type:"button",className:"shrink-0 touch-target min-w-[2.25rem] min-h-[2.25rem] rounded-xl text-slate-400 hover:text-white glass-pill text-lg leading-none",onClick:()=>ot(!1),"aria-label":"Cerrar",children:"×"})]}),g.jsxs("div",{className:"px-4 py-4 space-y-3",children:[g.jsx("p",{className:"text-xs text-slate-400 leading-relaxed",children:"Tu clave se guarda solo en este navegador. El servidor la reenvía al proveedor; no se almacena en el servidor."}),g.jsxs("label",{className:"block text-xs text-slate-400",children:["Proveedor",g.jsxs("select",{className:"glass-input mt-1 w-full border rounded-xl px-3 py-2 text-sm text-slate-200",value:De,onChange:L=>{const _e=L.target.value;Ne(_e),Fe(He=>He.trim()?He:tu(_e))},children:[g.jsx("option",{value:"anthropic",children:"Anthropic (Claude)"}),g.jsx("option",{value:"openai",children:"OpenAI"}),g.jsx("option",{value:"openrouter",children:"OpenRouter"})]})]}),g.jsxs("label",{className:"block text-xs text-slate-400",children:["Modelo (opcional)",g.jsx("input",{className:"glass-input mt-1 w-full border rounded-xl px-3 py-2 text-sm font-mono text-slate-200",value:et,onChange:L=>Fe(L.target.value),placeholder:tu(De),spellCheck:!1})]}),g.jsxs("label",{className:"block text-xs text-slate-400",children:["API key",g.jsx("input",{type:"password",className:"glass-input mt-1 w-full border rounded-xl px-3 py-2 text-sm font-mono text-slate-200",value:Ke,onChange:L=>qe(L.target.value),placeholder:De==="anthropic"?"sk-ant-…":De==="openai"?"sk-…":"sk-or-v1-…",autoComplete:"off"})]}),g.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[g.jsx("button",{type:"button",onClick:io,className:"px-4 py-2.5 rounded-xl bg-accent text-surface-950 text-sm font-medium shadow-[0_8px_24px_-8px_rgb(var(--accent)/0.55)] hover:brightness-110 transition-[filter]",children:"Guardar"}),g.jsx("button",{type:"button",onClick:()=>ot(!1),className:"px-4 py-2.5 rounded-xl glass-pill text-slate-300 text-sm",children:"Cancelar"})]})]})]})}):null,g.jsx(Wk,{doc:r,contextExtras:Gn,provider:De,model:et,apiKey:Ke,onOpenLlmSettings:pr}),g.jsx("footer",{className:"glass-footer px-3 py-2.5 text-center text-[11px] text-slate-500 shrink-0",children:"made with ♥ by andres arcila"})]})}const r2={surface950:"#0c0f14",surface900:"#12171f",surface800:"#1a2230",surface700:"#243044",accent:"#38bdf8",accentDim:"#0ea5e9"};function ks(t){const r=t.trim(),i=/^#?([0-9a-f]{6})$/i.exec(r);if(!i)return"12 15 20";const s=parseInt(i[1],16);return`${s>>16&255} ${s>>8&255} ${s&255}`}function o2(t){return{...r2,...t}}function i2(t){var s,l;const r=(s=t.logoBase64)==null?void 0:s.trim();return r?r.startsWith("data:")?r:`data:${((l=t.logoMimeType)==null?void 0:l.trim())||"image/png"};base64,${r}`:null}function s2(t){var i;const r=o2(t==null?void 0:t.colors);return{productName:((i=t==null?void 0:t.productName)==null?void 0:i.trim())||null,logoDataUrl:t?i2(t):null,colors:r,colorsRgb:{surface950:ks(r.surface950),surface900:ks(r.surface900),surface800:ks(r.surface800),surface700:ks(r.surface700),accent:ks(r.accent),accentDim:ks(r.accentDim)}}}const a2={credentials:"include"};function l2(t){const r=document.documentElement;r.style.setProperty("--surface-950",t.surface950),r.style.setProperty("--surface-900",t.surface900),r.style.setProperty("--surface-800",t.surface800),r.style.setProperty("--surface-700",t.surface700),r.style.setProperty("--accent",t.accent),r.style.setProperty("--accent-dim",t.accentDim)}async function u2(){const t=s2(void 0);try{const r=await fetch("/docs/ui-config.json",a2);return r.status===401?{...t,docsAuthRequired:!0}:r.ok?await r.json():t}catch{return t}}(async()=>{const t=await u2();l2(t.colorsRgb),Cy.createRoot(document.getElementById("root")).render(g.jsx(wm.StrictMode,{children:g.jsx(yk,{value:{productName:t.productName,logoDataUrl:t.logoDataUrl},children:g.jsx(n2,{})})}))})();
|