@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,216 @@
|
|
|
1
|
+
var Xy=Object.defineProperty;var Qy=(t,r,i)=>r in t?Xy(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i;var ga=(t,r,i)=>Qy(t,typeof r!="symbol"?r+"":r,i);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))a(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function i(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function a(u){if(u.ep)return;u.ep=!0;const f=i(u);fetch(u.href,f)}})();var Gy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Xc={exports:{}},ya={},Qc={exports:{}},ht={};/**
|
|
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 Bp;function Zy(){if(Bp)return ht;Bp=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.iterator;function S(O){return O===null||typeof O!="object"?null:(O=x&&O[x]||O["@@iterator"],typeof O=="function"?O:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,$={};function M(O,B,ke){this.props=O,this.context=B,this.refs=$,this.updater=ke||N}M.prototype.isReactComponent={},M.prototype.setState=function(O,B){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,B,"setState")},M.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function I(){}I.prototype=M.prototype;function H(O,B,ke){this.props=O,this.context=B,this.refs=$,this.updater=ke||N}var j=H.prototype=new I;j.constructor=H,C(j,M.prototype),j.isPureReactComponent=!0;var R=Array.isArray,q=Object.prototype.hasOwnProperty,V={current:null},U={key:!0,ref:!0,__self:!0,__source:!0};function pe(O,B,ke){var Se,Ie={},Re=null,Ae=null;if(B!=null)for(Se in B.ref!==void 0&&(Ae=B.ref),B.key!==void 0&&(Re=""+B.key),B)q.call(B,Se)&&!U.hasOwnProperty(Se)&&(Ie[Se]=B[Se]);var we=arguments.length-2;if(we===1)Ie.children=ke;else if(1<we){for(var ze=Array(we),be=0;be<we;be++)ze[be]=arguments[be+2];Ie.children=ze}if(O&&O.defaultProps)for(Se in we=O.defaultProps,we)Ie[Se]===void 0&&(Ie[Se]=we[Se]);return{$$typeof:t,type:O,key:Re,ref:Ae,props:Ie,_owner:V.current}}function he(O,B){return{$$typeof:t,type:O.type,key:B,ref:O.ref,props:O.props,_owner:O._owner}}function _e(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function Q(O){var B={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(ke){return B[ke]})}var le=/\/+/g;function xe(O,B){return typeof O=="object"&&O!==null&&O.key!=null?Q(""+O.key):B.toString(36)}function z(O,B,ke,Se,Ie){var Re=typeof O;(Re==="undefined"||Re==="boolean")&&(O=null);var Ae=!1;if(O===null)Ae=!0;else switch(Re){case"string":case"number":Ae=!0;break;case"object":switch(O.$$typeof){case t:case r:Ae=!0}}if(Ae)return Ae=O,Ie=Ie(Ae),O=Se===""?"."+xe(Ae,0):Se,R(Ie)?(ke="",O!=null&&(ke=O.replace(le,"$&/")+"/"),z(Ie,B,ke,"",function(be){return be})):Ie!=null&&(_e(Ie)&&(Ie=he(Ie,ke+(!Ie.key||Ae&&Ae.key===Ie.key?"":(""+Ie.key).replace(le,"$&/")+"/")+O)),B.push(Ie)),1;if(Ae=0,Se=Se===""?".":Se+":",R(O))for(var we=0;we<O.length;we++){Re=O[we];var ze=Se+xe(Re,we);Ae+=z(Re,B,ke,ze,Ie)}else if(ze=S(O),typeof ze=="function")for(O=ze.call(O),we=0;!(Re=O.next()).done;)Re=Re.value,ze=Se+xe(Re,we++),Ae+=z(Re,B,ke,ze,Ie);else if(Re==="object")throw B=String(O),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.");return Ae}function ue(O,B,ke){if(O==null)return O;var Se=[],Ie=0;return z(O,Se,"","",function(Re){return B.call(ke,Re,Ie++)}),Se}function te(O){if(O._status===-1){var B=O._result;B=B(),B.then(function(ke){(O._status===0||O._status===-1)&&(O._status=1,O._result=ke)},function(ke){(O._status===0||O._status===-1)&&(O._status=2,O._result=ke)}),O._status===-1&&(O._status=0,O._result=B)}if(O._status===1)return O._result.default;throw O._result}var ae={current:null},L={transition:null},F={ReactCurrentDispatcher:ae,ReactCurrentBatchConfig:L,ReactCurrentOwner:V};function X(){throw Error("act(...) is not supported in production builds of React.")}return ht.Children={map:ue,forEach:function(O,B,ke){ue(O,function(){B.apply(this,arguments)},ke)},count:function(O){var B=0;return ue(O,function(){B++}),B},toArray:function(O){return ue(O,function(B){return B})||[]},only:function(O){if(!_e(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},ht.Component=M,ht.Fragment=i,ht.Profiler=u,ht.PureComponent=H,ht.StrictMode=a,ht.Suspense=v,ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F,ht.act=X,ht.cloneElement=function(O,B,ke){if(O==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+O+".");var Se=C({},O.props),Ie=O.key,Re=O.ref,Ae=O._owner;if(B!=null){if(B.ref!==void 0&&(Re=B.ref,Ae=V.current),B.key!==void 0&&(Ie=""+B.key),O.type&&O.type.defaultProps)var we=O.type.defaultProps;for(ze in B)q.call(B,ze)&&!U.hasOwnProperty(ze)&&(Se[ze]=B[ze]===void 0&&we!==void 0?we[ze]:B[ze])}var ze=arguments.length-2;if(ze===1)Se.children=ke;else if(1<ze){we=Array(ze);for(var be=0;be<ze;be++)we[be]=arguments[be+2];Se.children=we}return{$$typeof:t,type:O.type,key:Ie,ref:Re,props:Se,_owner:Ae}},ht.createContext=function(O){return O={$$typeof:d,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},O.Provider={$$typeof:f,_context:O},O.Consumer=O},ht.createElement=pe,ht.createFactory=function(O){var B=pe.bind(null,O);return B.type=O,B},ht.createRef=function(){return{current:null}},ht.forwardRef=function(O){return{$$typeof:m,render:O}},ht.isValidElement=_e,ht.lazy=function(O){return{$$typeof:b,_payload:{_status:-1,_result:O},_init:te}},ht.memo=function(O,B){return{$$typeof:w,type:O,compare:B===void 0?null:B}},ht.startTransition=function(O){var B=L.transition;L.transition={};try{O()}finally{L.transition=B}},ht.unstable_act=X,ht.useCallback=function(O,B){return ae.current.useCallback(O,B)},ht.useContext=function(O){return ae.current.useContext(O)},ht.useDebugValue=function(){},ht.useDeferredValue=function(O){return ae.current.useDeferredValue(O)},ht.useEffect=function(O,B){return ae.current.useEffect(O,B)},ht.useId=function(){return ae.current.useId()},ht.useImperativeHandle=function(O,B,ke){return ae.current.useImperativeHandle(O,B,ke)},ht.useInsertionEffect=function(O,B){return ae.current.useInsertionEffect(O,B)},ht.useLayoutEffect=function(O,B){return ae.current.useLayoutEffect(O,B)},ht.useMemo=function(O,B){return ae.current.useMemo(O,B)},ht.useReducer=function(O,B,ke){return ae.current.useReducer(O,B,ke)},ht.useRef=function(O){return ae.current.useRef(O)},ht.useState=function(O){return ae.current.useState(O)},ht.useSyncExternalStore=function(O,B,ke){return ae.current.useSyncExternalStore(O,B,ke)},ht.useTransition=function(){return ae.current.useTransition()},ht.version="18.3.1",ht}var Hp;function Aa(){return Hp||(Hp=1,Qc.exports=Zy()),Qc.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 Vp;function Jy(){if(Vp)return ya;Vp=1;var t=Aa(),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,u=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function d(m,v,w){var b,x={},S=null,N=null;w!==void 0&&(S=""+w),v.key!==void 0&&(S=""+v.key),v.ref!==void 0&&(N=v.ref);for(b in v)a.call(v,b)&&!f.hasOwnProperty(b)&&(x[b]=v[b]);if(m&&m.defaultProps)for(b in v=m.defaultProps,v)x[b]===void 0&&(x[b]=v[b]);return{$$typeof:r,type:m,key:S,ref:N,props:x,_owner:u.current}}return ya.Fragment=i,ya.jsx=d,ya.jsxs=d,ya}var Kp;function e0(){return Kp||(Kp=1,Xc.exports=Jy()),Xc.exports}var P=e0(),ce=Aa();const lm=vu(ce);var Vl={},Gc={exports:{}},Fn={},Zc={exports:{}},Jc={};/**
|
|
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 Up;function t0(){return Up||(Up=1,(function(t){function r(L,F){var X=L.length;L.push(F);e:for(;0<X;){var O=X-1>>>1,B=L[O];if(0<u(B,F))L[O]=F,L[X]=B,X=O;else break e}}function i(L){return L.length===0?null:L[0]}function a(L){if(L.length===0)return null;var F=L[0],X=L.pop();if(X!==F){L[0]=X;e:for(var O=0,B=L.length,ke=B>>>1;O<ke;){var Se=2*(O+1)-1,Ie=L[Se],Re=Se+1,Ae=L[Re];if(0>u(Ie,X))Re<B&&0>u(Ae,Ie)?(L[O]=Ae,L[Re]=X,O=Re):(L[O]=Ie,L[Se]=X,O=Se);else if(Re<B&&0>u(Ae,X))L[O]=Ae,L[Re]=X,O=Re;else break e}}return F}function u(L,F){var X=L.sortIndex-F.sortIndex;return X!==0?X:L.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;t.unstable_now=function(){return f.now()}}else{var d=Date,m=d.now();t.unstable_now=function(){return d.now()-m}}var v=[],w=[],b=1,x=null,S=3,N=!1,C=!1,$=!1,M=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 j(L){for(var F=i(w);F!==null;){if(F.callback===null)a(w);else if(F.startTime<=L)a(w),F.sortIndex=F.expirationTime,r(v,F);else break;F=i(w)}}function R(L){if($=!1,j(L),!C)if(i(v)!==null)C=!0,te(q);else{var F=i(w);F!==null&&ae(R,F.startTime-L)}}function q(L,F){C=!1,$&&($=!1,I(pe),pe=-1),N=!0;var X=S;try{for(j(F),x=i(v);x!==null&&(!(x.expirationTime>F)||L&&!Q());){var O=x.callback;if(typeof O=="function"){x.callback=null,S=x.priorityLevel;var B=O(x.expirationTime<=F);F=t.unstable_now(),typeof B=="function"?x.callback=B:x===i(v)&&a(v),j(F)}else a(v);x=i(v)}if(x!==null)var ke=!0;else{var Se=i(w);Se!==null&&ae(R,Se.startTime-F),ke=!1}return ke}finally{x=null,S=X,N=!1}}var V=!1,U=null,pe=-1,he=5,_e=-1;function Q(){return!(t.unstable_now()-_e<he)}function le(){if(U!==null){var L=t.unstable_now();_e=L;var F=!0;try{F=U(!0,L)}finally{F?xe():(V=!1,U=null)}}else V=!1}var xe;if(typeof H=="function")xe=function(){H(le)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,ue=z.port2;z.port1.onmessage=le,xe=function(){ue.postMessage(null)}}else xe=function(){M(le,0)};function te(L){U=L,V||(V=!0,xe())}function ae(L,F){pe=M(function(){L(t.unstable_now())},F)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(L){L.callback=null},t.unstable_continueExecution=function(){C||N||(C=!0,te(q))},t.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):he=0<L?Math.floor(1e3/L):5},t.unstable_getCurrentPriorityLevel=function(){return S},t.unstable_getFirstCallbackNode=function(){return i(v)},t.unstable_next=function(L){switch(S){case 1:case 2:case 3:var F=3;break;default:F=S}var X=S;S=F;try{return L()}finally{S=X}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(L,F){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var X=S;S=L;try{return F()}finally{S=X}},t.unstable_scheduleCallback=function(L,F,X){var O=t.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?O+X:O):X=O,L){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=X+B,L={id:b++,callback:F,priorityLevel:L,startTime:X,expirationTime:B,sortIndex:-1},X>O?(L.sortIndex=X,r(w,L),i(v)===null&&L===i(w)&&($?(I(pe),pe=-1):$=!0,ae(R,X-O))):(L.sortIndex=B,r(v,L),C||N||(C=!0,te(q))),L},t.unstable_shouldYield=Q,t.unstable_wrapCallback=function(L){var F=S;return function(){var X=S;S=F;try{return L.apply(this,arguments)}finally{S=X}}}})(Jc)),Jc}var qp;function n0(){return qp||(qp=1,Zc.exports=t0()),Zc.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 Wp;function r0(){if(Wp)return Fn;Wp=1;var t=Aa(),r=n0();function i(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,u={};function f(e,n){d(e,n),d(e+"Capture",n)}function d(e,n){for(u[e]=n,e=0;e<n.length;e++)a.add(n[e])}var m=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),v=Object.prototype.hasOwnProperty,w=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,b={},x={};function S(e){return v.call(x,e)?!0:v.call(b,e)?!1:w.test(e)?x[e]=!0:(b[e]=!0,!1)}function N(e,n,o,l){if(o!==null&&o.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return l?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function C(e,n,o,l){if(n===null||typeof n>"u"||N(e,n,o,l))return!0;if(l)return!1;if(o!==null)switch(o.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function $(e,n,o,l,p,g,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=l,this.attributeNamespace=p,this.mustUseProperty=o,this.propertyName=e,this.type=n,this.sanitizeURL=g,this.removeEmptyString=E}var M={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){M[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];M[n]=new $(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){M[e]=new $(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){M[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){M[e]=new $(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){M[e]=new $(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){M[e]=new $(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){M[e]=new $(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){M[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);M[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);M[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);M[n]=new $(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){M[e]=new $(e,1,!1,e.toLowerCase(),null,!1,!1)}),M.xlinkHref=new $("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){M[e]=new $(e,1,!1,e.toLowerCase(),null,!0,!0)});function j(e,n,o,l){var p=M.hasOwnProperty(n)?M[n]:null;(p!==null?p.type!==0:l||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(C(n,o,p,l)&&(o=null),l||p===null?S(n)&&(o===null?e.removeAttribute(n):e.setAttribute(n,""+o)):p.mustUseProperty?e[p.propertyName]=o===null?p.type===3?!1:"":o:(n=p.attributeName,l=p.attributeNamespace,o===null?e.removeAttribute(n):(p=p.type,o=p===3||p===4&&o===!0?"":""+o,l?e.setAttributeNS(l,n,o):e.setAttribute(n,o))))}var R=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,q=Symbol.for("react.element"),V=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),pe=Symbol.for("react.strict_mode"),he=Symbol.for("react.profiler"),_e=Symbol.for("react.provider"),Q=Symbol.for("react.context"),le=Symbol.for("react.forward_ref"),xe=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),ae=Symbol.for("react.offscreen"),L=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=L&&e[L]||e["@@iterator"],typeof e=="function"?e:null)}var X=Object.assign,O;function B(e){if(O===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);O=n&&n[1]||""}return`
|
|
34
|
+
`+O+e}var ke=!1;function Se(e,n){if(!e||ke)return"";ke=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(ye){var l=ye}Reflect.construct(e,[],n)}else{try{n.call()}catch(ye){l=ye}e.call(n.prototype)}else{try{throw Error()}catch(ye){l=ye}e()}}catch(ye){if(ye&&l&&typeof ye.stack=="string"){for(var p=ye.stack.split(`
|
|
35
|
+
`),g=l.stack.split(`
|
|
36
|
+
`),E=p.length-1,D=g.length-1;1<=E&&0<=D&&p[E]!==g[D];)D--;for(;1<=E&&0<=D;E--,D--)if(p[E]!==g[D]){if(E!==1||D!==1)do if(E--,D--,0>D||p[E]!==g[D]){var K=`
|
|
37
|
+
`+p[E].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),K}while(1<=E&&0<=D);break}}}finally{ke=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?B(e):""}function Ie(e){switch(e.tag){case 5:return B(e.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return e=Se(e.type,!1),e;case 11:return e=Se(e.type.render,!1),e;case 1:return e=Se(e.type,!0),e;default:return""}}function Re(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case U:return"Fragment";case V:return"Portal";case he:return"Profiler";case pe:return"StrictMode";case xe:return"Suspense";case z:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Q:return(e.displayName||"Context")+".Consumer";case _e:return(e._context.displayName||"Context")+".Provider";case le: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:Re(e.type)||"Memo";case te:n=e._payload,e=e._init;try{return Re(e(n))}catch{}}return null}function Ae(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 Re(n);case 8:return n===pe?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function we(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ze(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function be(e){var n=ze(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),l=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var p=o.get,g=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return p.call(this)},set:function(E){l=""+E,g.call(this,E)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(E){l=""+E},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Je(e){e._valueTracker||(e._valueTracker=be(e))}function Fe(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),l="";return e&&(l=ze(e)?e.checked?"true":"false":e.value),e=l,e!==o?(n.setValue(e),!0):!1}function Ve(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 ct(e,n){var o=n.checked;return X({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function nt(e,n){var o=n.defaultValue==null?"":n.defaultValue,l=n.checked!=null?n.checked:n.defaultChecked;o=we(n.value!=null?n.value:o),e._wrapperState={initialChecked:l,initialValue:o,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function ft(e,n){n=n.checked,n!=null&&j(e,"checked",n,!1)}function kt(e,n){ft(e,n);var o=we(n.value),l=n.type;if(o!=null)l==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Gt(e,n.type,o):n.hasOwnProperty("defaultValue")&&Gt(e,n.type,we(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function rn(e,n,o){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var l=n.type;if(!(l!=="submit"&&l!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,o||n===e.value||(e.value=n),e.defaultValue=n}o=e.name,o!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,o!==""&&(e.name=o)}function Gt(e,n,o){(n!=="number"||Ve(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var qt=Array.isArray;function Nt(e,n,o,l){if(e=e.options,n){n={};for(var p=0;p<o.length;p++)n["$"+o[p]]=!0;for(o=0;o<e.length;o++)p=n.hasOwnProperty("$"+e[o].value),e[o].selected!==p&&(e[o].selected=p),p&&l&&(e[o].defaultSelected=!0)}else{for(o=""+we(o),n=null,p=0;p<e.length;p++){if(e[p].value===o){e[p].selected=!0,l&&(e[p].defaultSelected=!0);return}n!==null||e[p].disabled||(n=e[p])}n!==null&&(n.selected=!0)}}function Mn(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return X({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function cn(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(qt(o)){if(1<o.length)throw Error(i(93));o=o[0]}n=o}n==null&&(n=""),o=n}e._wrapperState={initialValue:we(o)}}function pr(e,n){var o=we(n.value),l=we(n.defaultValue);o!=null&&(o=""+o,o!==e.value&&(e.value=o),n.defaultValue==null&&e.defaultValue!==o&&(e.defaultValue=o)),l!=null&&(e.defaultValue=""+l)}function fn(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function Ct(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Wt(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?Ct(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Hn,Jn=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,o,l,p){MSApp.execUnsafeLocalFunction(function(){return e(n,o,l,p)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(Hn=Hn||document.createElement("div"),Hn.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=Hn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function _n(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var Yt={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},Sn=["Webkit","ms","Moz","O"];Object.keys(Yt).forEach(function(e){Sn.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Yt[n]=Yt[e]})});function hr(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||Yt.hasOwnProperty(e)&&Yt[e]?(""+n).trim():n+"px"}function $r(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var l=o.indexOf("--")===0,p=hr(o,n[o],l);o==="float"&&(o="cssFloat"),l?e.setProperty(o,p):e[o]=p}}var bn=X({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 qe(e,n){if(n){if(bn[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(i(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(i(61))}if(n.style!=null&&typeof n.style!="object")throw Error(i(62))}}function Vn(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var kn=null;function er(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Be=null,In=null,Kn=null;function Or(e){if(e=ta(e)){if(typeof Be!="function")throw Error(i(280));var n=e.stateNode;n&&(n=ol(n),Be(e.stateNode,e.type,n))}}function Rr(e){In?Kn?Kn.push(e):Kn=[e]:In=e}function mr(){if(In){var e=In,n=Kn;if(Kn=In=null,Or(e),n)for(e=0;e<n.length;e++)Or(n[e])}}function eo(e,n){return e(n)}function W(){}var Le=!1;function Xe(e,n,o){if(Le)return e(n,o);Le=!0;try{return eo(e,n,o)}finally{Le=!1,(In!==null||Kn!==null)&&(W(),mr())}}function lt(e,n){var o=e.stateNode;if(o===null)return null;var l=ol(o);if(l===null)return null;o=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(i(231,n,typeof o));return o}var Ht=!1;if(m)try{var ut={};Object.defineProperty(ut,"passive",{get:function(){Ht=!0}}),window.addEventListener("test",ut,ut),window.removeEventListener("test",ut,ut)}catch{Ht=!1}function St(e,n,o,l,p,g,E,D,K){var ye=Array.prototype.slice.call(arguments,3);try{n.apply(o,ye)}catch(je){this.onError(je)}}var dn=!1,En=null,pn=!1,Un=null,Mo={onError:function(e){dn=!0,En=e}};function Nn(e,n,o,l,p,g,E,D,K){dn=!1,En=null,St.apply(Mo,arguments)}function Cn(e,n,o,l,p,g,E,D,K){if(Nn.apply(this,arguments),dn){if(dn){var ye=En;dn=!1,En=null}else throw Error(i(198));pn||(pn=!0,Un=ye)}}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 Dr(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function li(e){if(Ft(e)!==e)throw Error(i(188))}function tr(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,l=n;;){var p=o.return;if(p===null)break;var g=p.alternate;if(g===null){if(l=p.return,l!==null){o=l;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===o)return li(p),e;if(g===l)return li(p),n;g=g.sibling}throw Error(i(188))}if(o.return!==l.return)o=p,l=g;else{for(var E=!1,D=p.child;D;){if(D===o){E=!0,o=p,l=g;break}if(D===l){E=!0,l=p,o=g;break}D=D.sibling}if(!E){for(D=g.child;D;){if(D===o){E=!0,o=g,l=p;break}if(D===l){E=!0,l=g,o=p;break}D=D.sibling}if(!E)throw Error(i(189))}}if(o.alternate!==l)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?e:n}function ui(e){return e=tr(e),e!==null?nr(e):null}function nr(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=nr(e);if(n!==null)return n;e=e.sibling}return null}var ci=r.unstable_scheduleCallback,Io=r.unstable_cancelCallback,Pt=r.unstable_shouldYield,rr=r.unstable_requestPaint,yt=r.unstable_now,Bi=r.unstable_getCurrentPriorityLevel,zr=r.unstable_ImmediatePriority,Ao=r.unstable_UserBlockingPriority,Lr=r.unstable_NormalPriority,gr=r.unstable_LowPriority,fi=r.unstable_IdlePriority,or=null,Pn=null;function dt(e){if(Pn&&typeof Pn.onCommitFiberRoot=="function")try{Pn.onCommitFiberRoot(or,e,void 0,(e.current.flags&128)===128)}catch{}}var hn=Math.clz32?Math.clz32:to,Hi=Math.log,$o=Math.LN2;function to(e){return e>>>=0,e===0?32:31-(Hi(e)/$o|0)|0}var no=64,ro=4194304;function qn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function vt(e,n){var o=e.pendingLanes;if(o===0)return 0;var l=0,p=e.suspendedLanes,g=e.pingedLanes,E=o&268435455;if(E!==0){var D=E&~p;D!==0?l=qn(D):(g&=E,g!==0&&(l=qn(g)))}else E=o&~p,E!==0?l=qn(E):g!==0&&(l=qn(g));if(l===0)return 0;if(n!==0&&n!==l&&(n&p)===0&&(p=l&-l,g=n&-n,p>=g||p===16&&(g&4194240)!==0))return n;if((l&4)!==0&&(l|=o&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=l;0<n;)o=31-hn(n),p=1<<o,l|=e[o],n&=~p;return l}function Fr(e,n){switch(e){case 1:case 2:case 4:return n+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function oo(e,n){for(var o=e.suspendedLanes,l=e.pingedLanes,p=e.expirationTimes,g=e.pendingLanes;0<g;){var E=31-hn(g),D=1<<E,K=p[E];K===-1?((D&o)===0||(D&l)!==0)&&(p[E]=Fr(D,n)):K<=n&&(e.expiredLanes|=D),g&=~D}}function ir(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Br(){var e=no;return no<<=1,(no&4194240)===0&&(no=64),e}function io(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function sr(e,n,o){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-hn(n),e[n]=o}function di(e,n){var o=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<o;){var p=31-hn(o),g=1<<p;n[p]=0,l[p]=-1,e[p]=-1,o&=~g}}function Oo(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var l=31-hn(o),p=1<<l;p&n|e[l]&n&&(e[l]|=n),o&=~p}}var wt=0;function Ba(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var mt,Vi,Ha,Va,mn,Hr=!1,so=[],on=null,yr=null,vr=null,At=new Map,sn=new Map,An=[],pi="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ki(e,n){switch(e){case"focusin":case"focusout":on=null;break;case"dragenter":case"dragleave":yr=null;break;case"mouseover":case"mouseout":vr=null;break;case"pointerover":case"pointerout":At.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":sn.delete(n.pointerId)}}function $n(e,n,o,l,p,g){return e===null||e.nativeEvent!==g?(e={blockedOn:n,domEventName:o,eventSystemFlags:l,nativeEvent:g,targetContainers:[p]},n!==null&&(n=ta(n),n!==null&&Vi(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,p!==null&&n.indexOf(p)===-1&&n.push(p),e)}function Au(e,n,o,l,p){switch(n){case"focusin":return on=$n(on,e,n,o,l,p),!0;case"dragenter":return yr=$n(yr,e,n,o,l,p),!0;case"mouseover":return vr=$n(vr,e,n,o,l,p),!0;case"pointerover":var g=p.pointerId;return At.set(g,$n(At.get(g)||null,e,n,o,l,p)),!0;case"gotpointercapture":return g=p.pointerId,sn.set(g,$n(sn.get(g)||null,e,n,o,l,p)),!0}return!1}function Wn(e){var n=_i(e.target);if(n!==null){var o=Ft(n);if(o!==null){if(n=o.tag,n===13){if(n=Dr(o),n!==null){e.blockedOn=n,mn(e.priority,function(){Ha(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 Ro(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=Do(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(o===null){o=e.nativeEvent;var l=new o.constructor(o.type,o);kn=l,o.target.dispatchEvent(l),kn=null}else return n=ta(o),n!==null&&Vi(n),e.blockedOn=o,!1;n.shift()}return!0}function Ds(e,n,o){Ro(e)&&o.delete(n)}function zs(){Hr=!1,on!==null&&Ro(on)&&(on=null),yr!==null&&Ro(yr)&&(yr=null),vr!==null&&Ro(vr)&&(vr=null),At.forEach(Ds),sn.forEach(Ds)}function xr(e,n){e.blockedOn===n&&(e.blockedOn=null,Hr||(Hr=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,zs)))}function ao(e){function n(p){return xr(p,e)}if(0<so.length){xr(so[0],e);for(var o=1;o<so.length;o++){var l=so[o];l.blockedOn===e&&(l.blockedOn=null)}}for(on!==null&&xr(on,e),yr!==null&&xr(yr,e),vr!==null&&xr(vr,e),At.forEach(n),sn.forEach(n),o=0;o<An.length;o++)l=An[o],l.blockedOn===e&&(l.blockedOn=null);for(;0<An.length&&(o=An[0],o.blockedOn===null);)Wn(o),o.blockedOn===null&&An.shift()}var lo=R.ReactCurrentBatchConfig,Ui=!0;function hi(e,n,o,l){var p=wt,g=lo.transition;lo.transition=null;try{wt=1,Ls(e,n,o,l)}finally{wt=p,lo.transition=g}}function $u(e,n,o,l){var p=wt,g=lo.transition;lo.transition=null;try{wt=4,Ls(e,n,o,l)}finally{wt=p,lo.transition=g}}function Ls(e,n,o,l){if(Ui){var p=Do(e,n,o,l);if(p===null)Lu(e,n,l,uo,o),Ki(e,l);else if(Au(p,e,n,o,l))l.stopPropagation();else if(Ki(e,l),n&4&&-1<pi.indexOf(e)){for(;p!==null;){var g=ta(p);if(g!==null&&mt(g),g=Do(e,n,o,l),g===null&&Lu(e,n,l,uo,o),g===p)break;p=g}p!==null&&l.stopPropagation()}else Lu(e,n,l,null,o)}}var uo=null;function Do(e,n,o,l){if(uo=null,e=er(l),e=_i(e),e!==null)if(n=Ft(e),n===null)e=null;else if(o=n.tag,o===13){if(e=Dr(n),e!==null)return e;e=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return uo=e,null}function qi(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Bi()){case zr:return 1;case Ao:return 4;case Lr:case gr:return 16;case fi:return 536870912;default:return 16}default:return 16}}var Vr=null,Fs=null,Wi=null;function Yi(){if(Wi)return Wi;var e,n=Fs,o=n.length,l,p="value"in Vr?Vr.value:Vr.textContent,g=p.length;for(e=0;e<o&&n[e]===p[e];e++);var E=o-e;for(l=1;l<=E&&n[o-l]===p[g-l];l++);return Wi=p.slice(e,1<l?1-l:void 0)}function zo(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function mi(){return!0}function gi(){return!1}function Zt(e){function n(o,l,p,g,E){this._reactName=o,this._targetInst=p,this.type=l,this.nativeEvent=g,this.target=E,this.currentTarget=null;for(var D in e)e.hasOwnProperty(D)&&(o=e[D],this[D]=o?o(g):g[D]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?mi:gi,this.isPropagationStopped=gi,this}return X(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=mi)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=mi)},persist:function(){},isPersistent:mi}),n}var wr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xi=Zt(wr),yi=X({},wr,{view:0,detail:0}),Lo=Zt(yi),co,vi,fo,Fo=X({},yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ts,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==fo&&(fo&&e.type==="mousemove"?(co=e.screenX-fo.screenX,vi=e.screenY-fo.screenY):vi=co=0,fo=e),co)},movementY:function(e){return"movementY"in e?e.movementY:vi}}),Qi=Zt(Fo),Jt=X({},Fo,{dataTransfer:0}),xi=Zt(Jt),wi=X({},yi,{relatedTarget:0}),Gi=Zt(wi),Zi=X({},wr,{animationName:0,elapsedTime:0,pseudoElement:0}),Ka=Zt(Zi),Ua=X({},wr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ji=Zt(Ua),Bs=X({},wr,{data:0}),Kr=Zt(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"},es={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ks(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=es[e])?!!n[e]:!1}function ts(){return Ks}var Ou=X({},yi,{key:function(e){if(e.key){var n=Hs[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=zo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Vs[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ts,charCode:function(e){return e.type==="keypress"?zo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Us=Zt(Ou),ns=X({},Fo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qa=Zt(ns),qs=X({},yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ts}),Ws=Zt(qs),Ru=X({},wr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wa=Zt(Ru),Du=X({},Fo,{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}),Ya=Zt(Du),Xa=[9,13,27,32],Ys=m&&"CompositionEvent"in window,Bo=null;m&&"documentMode"in document&&(Bo=document.documentMode);var Xs=m&&"TextEvent"in window&&!Bo,Qs=m&&(!Ys||Bo&&8<Bo&&11>=Bo),Gs=" ",Qa=!1;function Ga(e,n){switch(e){case"keyup":return Xa.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 _r=!1;function Sr(e,n){switch(e){case"compositionend":return Za(n);case"keypress":return n.which!==32?null:(Qa=!0,Gs);case"textInput":return e=n.data,e===Gs&&Qa?null:e;default:return null}}function Rt(e,n){if(_r)return e==="compositionend"||!Ys&&Ga(e,n)?(e=Yi(),Wi=Fs=Vr=null,_r=!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 rs={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function po(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!rs[e.type]:n==="textarea"}function Ja(e,n,o,l){Rr(l),n=tl(n,"onChange"),0<n.length&&(o=new Xi("onChange","change",null,o,l),e.push({event:o,listeners:n}))}var ho=null,Ho=null;function mo(e){rd(e,0)}function Vo(e){var n=as(e);if(Fe(n))return e}function Ko(e,n){if(e==="change")return n}var br=!1;if(m){var os;if(m){var s="oninput"in document;if(!s){var c=document.createElement("div");c.setAttribute("oninput","return;"),s=typeof c.oninput=="function"}os=s}else os=!1;br=os&&(!document.documentMode||9<document.documentMode)}function h(){ho&&(ho.detachEvent("onpropertychange",y),Ho=ho=null)}function y(e){if(e.propertyName==="value"&&Vo(Ho)){var n=[];Ja(n,Ho,e,er(e)),Xe(mo,n)}}function _(e,n,o){e==="focusin"?(h(),ho=n,Ho=o,ho.attachEvent("onpropertychange",y)):e==="focusout"&&h()}function k(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vo(Ho)}function T(e,n){if(e==="click")return Vo(n)}function A(e,n){if(e==="input"||e==="change")return Vo(n)}function G(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var se=typeof Object.is=="function"?Object.is:G;function J(e,n){if(se(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var o=Object.keys(e),l=Object.keys(n);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var p=o[l];if(!v.call(n,p)||!se(e[p],n[p]))return!1}return!0}function Y(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Z(e,n){var o=Y(e);e=0;for(var l;o;){if(o.nodeType===3){if(l=e+o.textContent.length,e<=n&&l>=n)return{node:o,offset:n-e};e=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Y(o)}}function ie(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?ie(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function re(){for(var e=window,n=Ve();n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=Ve(e.document)}return n}function ne(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function oe(e){var n=re(),o=e.focusedElem,l=e.selectionRange;if(n!==o&&o&&o.ownerDocument&&ie(o.ownerDocument.documentElement,o)){if(l!==null&&ne(o)){if(n=l.start,e=l.end,e===void 0&&(e=n),"selectionStart"in o)o.selectionStart=n,o.selectionEnd=Math.min(e,o.value.length);else if(e=(n=o.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var p=o.textContent.length,g=Math.min(l.start,p);l=l.end===void 0?g:Math.min(l.end,p),!e.extend&&g>l&&(p=l,l=g,g=p),p=Z(o,g);var E=Z(o,l);p&&E&&(e.rangeCount!==1||e.anchorNode!==p.node||e.anchorOffset!==p.offset||e.focusNode!==E.node||e.focusOffset!==E.offset)&&(n=n.createRange(),n.setStart(p.node,p.offset),e.removeAllRanges(),g>l?(e.addRange(n),e.extend(E.node,E.offset)):(n.setEnd(E.node,E.offset),e.addRange(n)))}}for(n=[],e=o;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<n.length;o++)e=n[o],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ge=m&&"documentMode"in document&&11>=document.documentMode,fe=null,ve=null,Ee=null,Ce=!1;function Oe(e,n,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Ce||fe==null||fe!==Ve(l)||(l=fe,"selectionStart"in l&&ne(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ee&&J(Ee,l)||(Ee=l,l=tl(ve,"onSelect"),0<l.length&&(n=new Xi("onSelect","select",null,n,o),e.push({event:n,listeners:l}),n.target=fe)))}function Te(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var He={animationend:Te("Animation","AnimationEnd"),animationiteration:Te("Animation","AnimationIteration"),animationstart:Te("Animation","AnimationStart"),transitionend:Te("Transition","TransitionEnd")},$e={},Ue={};m&&(Ue=document.createElement("div").style,"AnimationEvent"in window||(delete He.animationend.animation,delete He.animationiteration.animation,delete He.animationstart.animation),"TransitionEvent"in window||delete He.transitionend.transition);function Ne(e){if($e[e])return $e[e];if(!He[e])return e;var n=He[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in Ue)return $e[e]=n[o];return e}var rt=Ne("animationend"),ot=Ne("animationiteration"),at=Ne("animationstart"),pt=Ne("transitionend"),gn=new Map,st="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function jt(e,n){gn.set(e,n),f(n,[e])}for(var Vt=0;Vt<st.length;Vt++){var Uo=st[Vt],an=Uo.toLowerCase(),go=Uo[0].toUpperCase()+Uo.slice(1);jt(an,"on"+go)}jt(rt,"onAnimationEnd"),jt(ot,"onAnimationIteration"),jt(at,"onAnimationStart"),jt("dblclick","onDoubleClick"),jt("focusin","onFocus"),jt("focusout","onBlur"),jt(pt,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),f("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),f("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),f("onBeforeInput",["compositionend","keypress","textInput","paste"]),f("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),sy=new Set("cancel close invalid load scroll toggle".split(" ").concat(yo));function nd(e,n,o){var l=e.type||"unknown-event";e.currentTarget=o,Cn(l,n,void 0,e),e.currentTarget=null}function rd(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var l=e[o],p=l.event;l=l.listeners;e:{var g=void 0;if(n)for(var E=l.length-1;0<=E;E--){var D=l[E],K=D.instance,ye=D.currentTarget;if(D=D.listener,K!==g&&p.isPropagationStopped())break e;nd(p,D,ye),g=K}else for(E=0;E<l.length;E++){if(D=l[E],K=D.instance,ye=D.currentTarget,D=D.listener,K!==g&&p.isPropagationStopped())break e;nd(p,D,ye),g=K}}}if(pn)throw e=Un,pn=!1,Un=null,e}function Tt(e,n){var o=n[Uu];o===void 0&&(o=n[Uu]=new Set);var l=e+"__bubble";o.has(l)||(od(n,e,2,!1),o.add(l))}function zu(e,n,o){var l=0;n&&(l|=4),od(o,e,l,n)}var el="_reactListening"+Math.random().toString(36).slice(2);function Zs(e){if(!e[el]){e[el]=!0,a.forEach(function(o){o!=="selectionchange"&&(sy.has(o)||zu(o,!1,e),zu(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[el]||(n[el]=!0,zu("selectionchange",!1,n))}}function od(e,n,o,l){switch(qi(n)){case 1:var p=hi;break;case 4:p=$u;break;default:p=Ls}o=p.bind(null,n,o,e),p=void 0,!Ht||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(p=!0),l?p!==void 0?e.addEventListener(n,o,{capture:!0,passive:p}):e.addEventListener(n,o,!0):p!==void 0?e.addEventListener(n,o,{passive:p}):e.addEventListener(n,o,!1)}function Lu(e,n,o,l,p){var g=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var E=l.tag;if(E===3||E===4){var D=l.stateNode.containerInfo;if(D===p||D.nodeType===8&&D.parentNode===p)break;if(E===4)for(E=l.return;E!==null;){var K=E.tag;if((K===3||K===4)&&(K=E.stateNode.containerInfo,K===p||K.nodeType===8&&K.parentNode===p))return;E=E.return}for(;D!==null;){if(E=_i(D),E===null)return;if(K=E.tag,K===5||K===6){l=g=E;continue e}D=D.parentNode}}l=l.return}Xe(function(){var ye=g,je=er(o),Me=[];e:{var Pe=gn.get(e);if(Pe!==void 0){var Ke=Xi,Ye=e;switch(e){case"keypress":if(zo(o)===0)break e;case"keydown":case"keyup":Ke=Us;break;case"focusin":Ye="focus",Ke=Gi;break;case"focusout":Ye="blur",Ke=Gi;break;case"beforeblur":case"afterblur":Ke=Gi;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ke=Qi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ke=xi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ke=Ws;break;case rt:case ot:case at:Ke=Ka;break;case pt:Ke=Wa;break;case"scroll":Ke=Lo;break;case"wheel":Ke=Ya;break;case"copy":case"cut":case"paste":Ke=Ji;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ke=qa}var Qe=(n&4)!==0,Bt=!Qe&&e==="scroll",de=Qe?Pe!==null?Pe+"Capture":null:Pe;Qe=[];for(var ee=ye,me;ee!==null;){me=ee;var De=me.stateNode;if(me.tag===5&&De!==null&&(me=De,de!==null&&(De=lt(ee,de),De!=null&&Qe.push(Js(ee,De,me)))),Bt)break;ee=ee.return}0<Qe.length&&(Pe=new Ke(Pe,Ye,null,o,je),Me.push({event:Pe,listeners:Qe}))}}if((n&7)===0){e:{if(Pe=e==="mouseover"||e==="pointerover",Ke=e==="mouseout"||e==="pointerout",Pe&&o!==kn&&(Ye=o.relatedTarget||o.fromElement)&&(_i(Ye)||Ye[vo]))break e;if((Ke||Pe)&&(Pe=je.window===je?je:(Pe=je.ownerDocument)?Pe.defaultView||Pe.parentWindow:window,Ke?(Ye=o.relatedTarget||o.toElement,Ke=ye,Ye=Ye?_i(Ye):null,Ye!==null&&(Bt=Ft(Ye),Ye!==Bt||Ye.tag!==5&&Ye.tag!==6)&&(Ye=null)):(Ke=null,Ye=ye),Ke!==Ye)){if(Qe=Qi,De="onMouseLeave",de="onMouseEnter",ee="mouse",(e==="pointerout"||e==="pointerover")&&(Qe=qa,De="onPointerLeave",de="onPointerEnter",ee="pointer"),Bt=Ke==null?Pe:as(Ke),me=Ye==null?Pe:as(Ye),Pe=new Qe(De,ee+"leave",Ke,o,je),Pe.target=Bt,Pe.relatedTarget=me,De=null,_i(je)===ye&&(Qe=new Qe(de,ee+"enter",Ye,o,je),Qe.target=me,Qe.relatedTarget=Bt,De=Qe),Bt=De,Ke&&Ye)t:{for(Qe=Ke,de=Ye,ee=0,me=Qe;me;me=is(me))ee++;for(me=0,De=de;De;De=is(De))me++;for(;0<ee-me;)Qe=is(Qe),ee--;for(;0<me-ee;)de=is(de),me--;for(;ee--;){if(Qe===de||de!==null&&Qe===de.alternate)break t;Qe=is(Qe),de=is(de)}Qe=null}else Qe=null;Ke!==null&&id(Me,Pe,Ke,Qe,!1),Ye!==null&&Bt!==null&&id(Me,Bt,Ye,Qe,!0)}}e:{if(Pe=ye?as(ye):window,Ke=Pe.nodeName&&Pe.nodeName.toLowerCase(),Ke==="select"||Ke==="input"&&Pe.type==="file")var Ge=Ko;else if(po(Pe))if(br)Ge=A;else{Ge=k;var et=_}else(Ke=Pe.nodeName)&&Ke.toLowerCase()==="input"&&(Pe.type==="checkbox"||Pe.type==="radio")&&(Ge=T);if(Ge&&(Ge=Ge(e,ye))){Ja(Me,Ge,o,je);break e}et&&et(e,Pe,ye),e==="focusout"&&(et=Pe._wrapperState)&&et.controlled&&Pe.type==="number"&&Gt(Pe,"number",Pe.value)}switch(et=ye?as(ye):window,e){case"focusin":(po(et)||et.contentEditable==="true")&&(fe=et,ve=ye,Ee=null);break;case"focusout":Ee=ve=fe=null;break;case"mousedown":Ce=!0;break;case"contextmenu":case"mouseup":case"dragend":Ce=!1,Oe(Me,o,je);break;case"selectionchange":if(ge)break;case"keydown":case"keyup":Oe(Me,o,je)}var tt;if(Ys)e:{switch(e){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else _r?Ga(e,o)&&(it="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(it="onCompositionStart");it&&(Qs&&o.locale!=="ko"&&(_r||it!=="onCompositionStart"?it==="onCompositionEnd"&&_r&&(tt=Yi()):(Vr=je,Fs="value"in Vr?Vr.value:Vr.textContent,_r=!0)),et=tl(ye,it),0<et.length&&(it=new Kr(it,e,null,o,je),Me.push({event:it,listeners:et}),tt?it.data=tt:(tt=Za(o),tt!==null&&(it.data=tt)))),(tt=Xs?Sr(e,o):Rt(e,o))&&(ye=tl(ye,"onBeforeInput"),0<ye.length&&(je=new Kr("onBeforeInput","beforeinput",null,o,je),Me.push({event:je,listeners:ye}),je.data=tt))}rd(Me,n)})}function Js(e,n,o){return{instance:e,listener:n,currentTarget:o}}function tl(e,n){for(var o=n+"Capture",l=[];e!==null;){var p=e,g=p.stateNode;p.tag===5&&g!==null&&(p=g,g=lt(e,o),g!=null&&l.unshift(Js(e,g,p)),g=lt(e,n),g!=null&&l.push(Js(e,g,p))),e=e.return}return l}function is(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function id(e,n,o,l,p){for(var g=n._reactName,E=[];o!==null&&o!==l;){var D=o,K=D.alternate,ye=D.stateNode;if(K!==null&&K===l)break;D.tag===5&&ye!==null&&(D=ye,p?(K=lt(o,g),K!=null&&E.unshift(Js(o,K,D))):p||(K=lt(o,g),K!=null&&E.push(Js(o,K,D)))),o=o.return}E.length!==0&&e.push({event:n,listeners:E})}var ay=/\r\n?/g,ly=/\u0000|\uFFFD/g;function sd(e){return(typeof e=="string"?e:""+e).replace(ay,`
|
|
38
|
+
`).replace(ly,"")}function nl(e,n,o){if(n=sd(n),sd(e)!==n&&o)throw Error(i(425))}function rl(){}var Fu=null,Bu=null;function Hu(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 Vu=typeof setTimeout=="function"?setTimeout:void 0,uy=typeof clearTimeout=="function"?clearTimeout:void 0,ad=typeof Promise=="function"?Promise:void 0,cy=typeof queueMicrotask=="function"?queueMicrotask:typeof ad<"u"?function(e){return ad.resolve(null).then(e).catch(fy)}:Vu;function fy(e){setTimeout(function(){throw e})}function Ku(e,n){var o=n,l=0;do{var p=o.nextSibling;if(e.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"){if(l===0){e.removeChild(p),ao(n);return}l--}else o!=="$"&&o!=="$?"&&o!=="$!"||l++;o=p}while(o);ao(n)}function qo(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 ld(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(n===0)return e;n--}else o==="/$"&&n++}e=e.previousSibling}return null}var ss=Math.random().toString(36).slice(2),Ur="__reactFiber$"+ss,ea="__reactProps$"+ss,vo="__reactContainer$"+ss,Uu="__reactEvents$"+ss,dy="__reactListeners$"+ss,py="__reactHandles$"+ss;function _i(e){var n=e[Ur];if(n)return n;for(var o=e.parentNode;o;){if(n=o[vo]||o[Ur]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=ld(e);e!==null;){if(o=e[Ur])return o;e=ld(e)}return n}e=o,o=e.parentNode}return null}function ta(e){return e=e[Ur]||e[vo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function as(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function ol(e){return e[ea]||null}var qu=[],ls=-1;function Wo(e){return{current:e}}function Mt(e){0>ls||(e.current=qu[ls],qu[ls]=null,ls--)}function Et(e,n){ls++,qu[ls]=e.current,e.current=n}var Yo={},yn=Wo(Yo),On=Wo(!1),Si=Yo;function us(e,n){var o=e.type.contextTypes;if(!o)return Yo;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var p={},g;for(g in o)p[g]=n[g];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=p),p}function Rn(e){return e=e.childContextTypes,e!=null}function il(){Mt(On),Mt(yn)}function ud(e,n,o){if(yn.current!==Yo)throw Error(i(168));Et(yn,n),Et(On,o)}function cd(e,n,o){var l=e.stateNode;if(n=n.childContextTypes,typeof l.getChildContext!="function")return o;l=l.getChildContext();for(var p in l)if(!(p in n))throw Error(i(108,Ae(e)||"Unknown",p));return X({},o,l)}function sl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yo,Si=yn.current,Et(yn,e),Et(On,On.current),!0}function fd(e,n,o){var l=e.stateNode;if(!l)throw Error(i(169));o?(e=cd(e,n,Si),l.__reactInternalMemoizedMergedChildContext=e,Mt(On),Mt(yn),Et(yn,e)):Mt(On),Et(On,o)}var xo=null,al=!1,Wu=!1;function dd(e){xo===null?xo=[e]:xo.push(e)}function hy(e){al=!0,dd(e)}function Xo(){if(!Wu&&xo!==null){Wu=!0;var e=0,n=wt;try{var o=xo;for(wt=1;e<o.length;e++){var l=o[e];do l=l(!0);while(l!==null)}xo=null,al=!1}catch(p){throw xo!==null&&(xo=xo.slice(e+1)),ci(zr,Xo),p}finally{wt=n,Wu=!1}}return null}var cs=[],fs=0,ll=null,ul=0,ar=[],lr=0,bi=null,wo=1,_o="";function ki(e,n){cs[fs++]=ul,cs[fs++]=ll,ll=e,ul=n}function pd(e,n,o){ar[lr++]=wo,ar[lr++]=_o,ar[lr++]=bi,bi=e;var l=wo;e=_o;var p=32-hn(l)-1;l&=~(1<<p),o+=1;var g=32-hn(n)+p;if(30<g){var E=p-p%5;g=(l&(1<<E)-1).toString(32),l>>=E,p-=E,wo=1<<32-hn(n)+p|o<<p|l,_o=g+e}else wo=1<<g|o<<p|l,_o=e}function Yu(e){e.return!==null&&(ki(e,1),pd(e,1,0))}function Xu(e){for(;e===ll;)ll=cs[--fs],cs[fs]=null,ul=cs[--fs],cs[fs]=null;for(;e===bi;)bi=ar[--lr],ar[lr]=null,_o=ar[--lr],ar[lr]=null,wo=ar[--lr],ar[lr]=null}var Yn=null,Xn=null,$t=!1,kr=null;function hd(e,n){var o=dr(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 md(e,n){switch(e.tag){case 5:var o=e.type;return n=n.nodeType!==1||o.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,Yn=e,Xn=qo(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Yn=e,Xn=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(o=bi!==null?{id:wo,overflow:_o}:null,e.memoizedState={dehydrated:n,treeContext:o,retryLane:1073741824},o=dr(18,null,null,0),o.stateNode=n,o.return=e,e.child=o,Yn=e,Xn=null,!0):!1;default:return!1}}function Qu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Gu(e){if($t){var n=Xn;if(n){var o=n;if(!md(e,n)){if(Qu(e))throw Error(i(418));n=qo(o.nextSibling);var l=Yn;n&&md(e,n)?hd(l,o):(e.flags=e.flags&-4097|2,$t=!1,Yn=e)}}else{if(Qu(e))throw Error(i(418));e.flags=e.flags&-4097|2,$t=!1,Yn=e}}}function gd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Yn=e}function cl(e){if(e!==Yn)return!1;if(!$t)return gd(e),$t=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Hu(e.type,e.memoizedProps)),n&&(n=Xn)){if(Qu(e))throw yd(),Error(i(418));for(;n;)hd(e,n),n=qo(n.nextSibling)}if(gd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="/$"){if(n===0){Xn=qo(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++}e=e.nextSibling}Xn=null}}else Xn=Yn?qo(e.stateNode.nextSibling):null;return!0}function yd(){for(var e=Xn;e;)e=qo(e.nextSibling)}function ds(){Xn=Yn=null,$t=!1}function Zu(e){kr===null?kr=[e]:kr.push(e)}var my=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 l=o.stateNode}if(!l)throw Error(i(147,e));var p=l,g=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===g?n.ref:(n=function(E){var D=p.refs;E===null?delete D[g]:D[g]=E},n._stringRef=g,n)}if(typeof e!="string")throw Error(i(284));if(!o._owner)throw Error(i(290,e))}return e}function fl(e,n){throw e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function vd(e){var n=e._init;return n(e._payload)}function xd(e){function n(de,ee){if(e){var me=de.deletions;me===null?(de.deletions=[ee],de.flags|=16):me.push(ee)}}function o(de,ee){if(!e)return null;for(;ee!==null;)n(de,ee),ee=ee.sibling;return null}function l(de,ee){for(de=new Map;ee!==null;)ee.key!==null?de.set(ee.key,ee):de.set(ee.index,ee),ee=ee.sibling;return de}function p(de,ee){return de=ri(de,ee),de.index=0,de.sibling=null,de}function g(de,ee,me){return de.index=me,e?(me=de.alternate,me!==null?(me=me.index,me<ee?(de.flags|=2,ee):me):(de.flags|=2,ee)):(de.flags|=1048576,ee)}function E(de){return e&&de.alternate===null&&(de.flags|=2),de}function D(de,ee,me,De){return ee===null||ee.tag!==6?(ee=Vc(me,de.mode,De),ee.return=de,ee):(ee=p(ee,me),ee.return=de,ee)}function K(de,ee,me,De){var Ge=me.type;return Ge===U?je(de,ee,me.props.children,De,me.key):ee!==null&&(ee.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===te&&vd(Ge)===ee.type)?(De=p(ee,me.props),De.ref=na(de,ee,me),De.return=de,De):(De=Ol(me.type,me.key,me.props,null,de.mode,De),De.ref=na(de,ee,me),De.return=de,De)}function ye(de,ee,me,De){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==me.containerInfo||ee.stateNode.implementation!==me.implementation?(ee=Kc(me,de.mode,De),ee.return=de,ee):(ee=p(ee,me.children||[]),ee.return=de,ee)}function je(de,ee,me,De,Ge){return ee===null||ee.tag!==7?(ee=Ii(me,de.mode,De,Ge),ee.return=de,ee):(ee=p(ee,me),ee.return=de,ee)}function Me(de,ee,me){if(typeof ee=="string"&&ee!==""||typeof ee=="number")return ee=Vc(""+ee,de.mode,me),ee.return=de,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case q:return me=Ol(ee.type,ee.key,ee.props,null,de.mode,me),me.ref=na(de,null,ee),me.return=de,me;case V:return ee=Kc(ee,de.mode,me),ee.return=de,ee;case te:var De=ee._init;return Me(de,De(ee._payload),me)}if(qt(ee)||F(ee))return ee=Ii(ee,de.mode,me,null),ee.return=de,ee;fl(de,ee)}return null}function Pe(de,ee,me,De){var Ge=ee!==null?ee.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return Ge!==null?null:D(de,ee,""+me,De);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case q:return me.key===Ge?K(de,ee,me,De):null;case V:return me.key===Ge?ye(de,ee,me,De):null;case te:return Ge=me._init,Pe(de,ee,Ge(me._payload),De)}if(qt(me)||F(me))return Ge!==null?null:je(de,ee,me,De,null);fl(de,me)}return null}function Ke(de,ee,me,De,Ge){if(typeof De=="string"&&De!==""||typeof De=="number")return de=de.get(me)||null,D(ee,de,""+De,Ge);if(typeof De=="object"&&De!==null){switch(De.$$typeof){case q:return de=de.get(De.key===null?me:De.key)||null,K(ee,de,De,Ge);case V:return de=de.get(De.key===null?me:De.key)||null,ye(ee,de,De,Ge);case te:var et=De._init;return Ke(de,ee,me,et(De._payload),Ge)}if(qt(De)||F(De))return de=de.get(me)||null,je(ee,de,De,Ge,null);fl(ee,De)}return null}function Ye(de,ee,me,De){for(var Ge=null,et=null,tt=ee,it=ee=0,nn=null;tt!==null&&it<me.length;it++){tt.index>it?(nn=tt,tt=null):nn=tt.sibling;var _t=Pe(de,tt,me[it],De);if(_t===null){tt===null&&(tt=nn);break}e&&tt&&_t.alternate===null&&n(de,tt),ee=g(_t,ee,it),et===null?Ge=_t:et.sibling=_t,et=_t,tt=nn}if(it===me.length)return o(de,tt),$t&&ki(de,it),Ge;if(tt===null){for(;it<me.length;it++)tt=Me(de,me[it],De),tt!==null&&(ee=g(tt,ee,it),et===null?Ge=tt:et.sibling=tt,et=tt);return $t&&ki(de,it),Ge}for(tt=l(de,tt);it<me.length;it++)nn=Ke(tt,de,it,me[it],De),nn!==null&&(e&&nn.alternate!==null&&tt.delete(nn.key===null?it:nn.key),ee=g(nn,ee,it),et===null?Ge=nn:et.sibling=nn,et=nn);return e&&tt.forEach(function(oi){return n(de,oi)}),$t&&ki(de,it),Ge}function Qe(de,ee,me,De){var Ge=F(me);if(typeof Ge!="function")throw Error(i(150));if(me=Ge.call(me),me==null)throw Error(i(151));for(var et=Ge=null,tt=ee,it=ee=0,nn=null,_t=me.next();tt!==null&&!_t.done;it++,_t=me.next()){tt.index>it?(nn=tt,tt=null):nn=tt.sibling;var oi=Pe(de,tt,_t.value,De);if(oi===null){tt===null&&(tt=nn);break}e&&tt&&oi.alternate===null&&n(de,tt),ee=g(oi,ee,it),et===null?Ge=oi:et.sibling=oi,et=oi,tt=nn}if(_t.done)return o(de,tt),$t&&ki(de,it),Ge;if(tt===null){for(;!_t.done;it++,_t=me.next())_t=Me(de,_t.value,De),_t!==null&&(ee=g(_t,ee,it),et===null?Ge=_t:et.sibling=_t,et=_t);return $t&&ki(de,it),Ge}for(tt=l(de,tt);!_t.done;it++,_t=me.next())_t=Ke(tt,de,it,_t.value,De),_t!==null&&(e&&_t.alternate!==null&&tt.delete(_t.key===null?it:_t.key),ee=g(_t,ee,it),et===null?Ge=_t:et.sibling=_t,et=_t);return e&&tt.forEach(function(Yy){return n(de,Yy)}),$t&&ki(de,it),Ge}function Bt(de,ee,me,De){if(typeof me=="object"&&me!==null&&me.type===U&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case q:e:{for(var Ge=me.key,et=ee;et!==null;){if(et.key===Ge){if(Ge=me.type,Ge===U){if(et.tag===7){o(de,et.sibling),ee=p(et,me.props.children),ee.return=de,de=ee;break e}}else if(et.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===te&&vd(Ge)===et.type){o(de,et.sibling),ee=p(et,me.props),ee.ref=na(de,et,me),ee.return=de,de=ee;break e}o(de,et);break}else n(de,et);et=et.sibling}me.type===U?(ee=Ii(me.props.children,de.mode,De,me.key),ee.return=de,de=ee):(De=Ol(me.type,me.key,me.props,null,de.mode,De),De.ref=na(de,ee,me),De.return=de,de=De)}return E(de);case V:e:{for(et=me.key;ee!==null;){if(ee.key===et)if(ee.tag===4&&ee.stateNode.containerInfo===me.containerInfo&&ee.stateNode.implementation===me.implementation){o(de,ee.sibling),ee=p(ee,me.children||[]),ee.return=de,de=ee;break e}else{o(de,ee);break}else n(de,ee);ee=ee.sibling}ee=Kc(me,de.mode,De),ee.return=de,de=ee}return E(de);case te:return et=me._init,Bt(de,ee,et(me._payload),De)}if(qt(me))return Ye(de,ee,me,De);if(F(me))return Qe(de,ee,me,De);fl(de,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,ee!==null&&ee.tag===6?(o(de,ee.sibling),ee=p(ee,me),ee.return=de,de=ee):(o(de,ee),ee=Vc(me,de.mode,De),ee.return=de,de=ee),E(de)):o(de,ee)}return Bt}var ps=xd(!0),wd=xd(!1),dl=Wo(null),pl=null,hs=null,Ju=null;function ec(){Ju=hs=pl=null}function tc(e){var n=dl.current;Mt(dl),e._currentValue=n}function nc(e,n,o){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===o)break;e=e.return}}function ms(e,n){pl=e,Ju=hs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Dn=!0),e.firstContext=null)}function ur(e){var n=e._currentValue;if(Ju!==e)if(e={context:e,memoizedValue:n,next:null},hs===null){if(pl===null)throw Error(i(308));hs=e,pl.dependencies={lanes:0,firstContext:e}}else hs=hs.next=e;return n}var Ei=null;function rc(e){Ei===null?Ei=[e]:Ei.push(e)}function _d(e,n,o,l){var p=n.interleaved;return p===null?(o.next=o,rc(n)):(o.next=p.next,p.next=o),n.interleaved=o,So(e,l)}function So(e,n){e.lanes|=n;var o=e.alternate;for(o!==null&&(o.lanes|=n),o=e,e=e.return;e!==null;)e.childLanes|=n,o=e.alternate,o!==null&&(o.childLanes|=n),o=e,e=e.return;return o.tag===3?o.stateNode:null}var Qo=!1;function oc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Sd(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function bo(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Go(e,n,o){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(xt&2)!==0){var p=l.pending;return p===null?n.next=n:(n.next=p.next,p.next=n),l.pending=n,So(e,o)}return p=l.interleaved,p===null?(n.next=n,rc(l)):(n.next=p.next,p.next=n),l.interleaved=n,So(e,o)}function hl(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194240)!==0)){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,Oo(e,o)}}function bd(e,n){var o=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var p=null,g=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};g===null?p=g=E:g=g.next=E,o=o.next}while(o!==null);g===null?p=g=n:g=g.next=n}else p=g=n;o={baseState:l.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:l.shared,effects:l.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}function ml(e,n,o,l){var p=e.updateQueue;Qo=!1;var g=p.firstBaseUpdate,E=p.lastBaseUpdate,D=p.shared.pending;if(D!==null){p.shared.pending=null;var K=D,ye=K.next;K.next=null,E===null?g=ye:E.next=ye,E=K;var je=e.alternate;je!==null&&(je=je.updateQueue,D=je.lastBaseUpdate,D!==E&&(D===null?je.firstBaseUpdate=ye:D.next=ye,je.lastBaseUpdate=K))}if(g!==null){var Me=p.baseState;E=0,je=ye=K=null,D=g;do{var Pe=D.lane,Ke=D.eventTime;if((l&Pe)===Pe){je!==null&&(je=je.next={eventTime:Ke,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var Ye=e,Qe=D;switch(Pe=n,Ke=o,Qe.tag){case 1:if(Ye=Qe.payload,typeof Ye=="function"){Me=Ye.call(Ke,Me,Pe);break e}Me=Ye;break e;case 3:Ye.flags=Ye.flags&-65537|128;case 0:if(Ye=Qe.payload,Pe=typeof Ye=="function"?Ye.call(Ke,Me,Pe):Ye,Pe==null)break e;Me=X({},Me,Pe);break e;case 2:Qo=!0}}D.callback!==null&&D.lane!==0&&(e.flags|=64,Pe=p.effects,Pe===null?p.effects=[D]:Pe.push(D))}else Ke={eventTime:Ke,lane:Pe,tag:D.tag,payload:D.payload,callback:D.callback,next:null},je===null?(ye=je=Ke,K=Me):je=je.next=Ke,E|=Pe;if(D=D.next,D===null){if(D=p.shared.pending,D===null)break;Pe=D,D=Pe.next,Pe.next=null,p.lastBaseUpdate=Pe,p.shared.pending=null}}while(!0);if(je===null&&(K=Me),p.baseState=K,p.firstBaseUpdate=ye,p.lastBaseUpdate=je,n=p.shared.interleaved,n!==null){p=n;do E|=p.lane,p=p.next;while(p!==n)}else g===null&&(p.shared.lanes=0);Pi|=E,e.lanes=E,e.memoizedState=Me}}function kd(e,n,o){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var l=e[n],p=l.callback;if(p!==null){if(l.callback=null,l=o,typeof p!="function")throw Error(i(191,p));p.call(l)}}}var ra={},qr=Wo(ra),oa=Wo(ra),ia=Wo(ra);function Ni(e){if(e===ra)throw Error(i(174));return e}function ic(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:Wt(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=Wt(n,e)}Mt(qr),Et(qr,n)}function gs(){Mt(qr),Mt(oa),Mt(ia)}function Ed(e){Ni(ia.current);var n=Ni(qr.current),o=Wt(n,e.type);n!==o&&(Et(oa,e),Et(qr,o))}function sc(e){oa.current===e&&(Mt(qr),Mt(oa))}var Dt=Wo(0);function gl(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 ac=[];function lc(){for(var e=0;e<ac.length;e++)ac[e]._workInProgressVersionPrimary=null;ac.length=0}var yl=R.ReactCurrentDispatcher,uc=R.ReactCurrentBatchConfig,Ci=0,zt=null,Xt=null,en=null,vl=!1,sa=!1,aa=0,gy=0;function vn(){throw Error(i(321))}function cc(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!se(e[o],n[o]))return!1;return!0}function fc(e,n,o,l,p,g){if(Ci=g,zt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,yl.current=e===null||e.memoizedState===null?wy:_y,e=o(l,p),sa){g=0;do{if(sa=!1,aa=0,25<=g)throw Error(i(301));g+=1,en=Xt=null,n.updateQueue=null,yl.current=Sy,e=o(l,p)}while(sa)}if(yl.current=_l,n=Xt!==null&&Xt.next!==null,Ci=0,en=Xt=zt=null,vl=!1,n)throw Error(i(300));return e}function dc(){var e=aa!==0;return aa=0,e}function Wr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return en===null?zt.memoizedState=en=e:en=en.next=e,en}function cr(){if(Xt===null){var e=zt.alternate;e=e!==null?e.memoizedState:null}else e=Xt.next;var n=en===null?zt.memoizedState:en.next;if(n!==null)en=n,Xt=e;else{if(e===null)throw Error(i(310));Xt=e,e={memoizedState:Xt.memoizedState,baseState:Xt.baseState,baseQueue:Xt.baseQueue,queue:Xt.queue,next:null},en===null?zt.memoizedState=en=e:en=en.next=e}return en}function la(e,n){return typeof n=="function"?n(e):n}function pc(e){var n=cr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var l=Xt,p=l.baseQueue,g=o.pending;if(g!==null){if(p!==null){var E=p.next;p.next=g.next,g.next=E}l.baseQueue=p=g,o.pending=null}if(p!==null){g=p.next,l=l.baseState;var D=E=null,K=null,ye=g;do{var je=ye.lane;if((Ci&je)===je)K!==null&&(K=K.next={lane:0,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null}),l=ye.hasEagerState?ye.eagerState:e(l,ye.action);else{var Me={lane:je,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null};K===null?(D=K=Me,E=l):K=K.next=Me,zt.lanes|=je,Pi|=je}ye=ye.next}while(ye!==null&&ye!==g);K===null?E=l:K.next=D,se(l,n.memoizedState)||(Dn=!0),n.memoizedState=l,n.baseState=E,n.baseQueue=K,o.lastRenderedState=l}if(e=o.interleaved,e!==null){p=e;do g=p.lane,zt.lanes|=g,Pi|=g,p=p.next;while(p!==e)}else p===null&&(o.lanes=0);return[n.memoizedState,o.dispatch]}function hc(e){var n=cr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var l=o.dispatch,p=o.pending,g=n.memoizedState;if(p!==null){o.pending=null;var E=p=p.next;do g=e(g,E.action),E=E.next;while(E!==p);se(g,n.memoizedState)||(Dn=!0),n.memoizedState=g,n.baseQueue===null&&(n.baseState=g),o.lastRenderedState=g}return[g,l]}function Nd(){}function Cd(e,n){var o=zt,l=cr(),p=n(),g=!se(l.memoizedState,p);if(g&&(l.memoizedState=p,Dn=!0),l=l.queue,mc(Td.bind(null,o,l,e),[e]),l.getSnapshot!==n||g||en!==null&&en.memoizedState.tag&1){if(o.flags|=2048,ua(9,jd.bind(null,o,l,p,n),void 0,null),tn===null)throw Error(i(349));(Ci&30)!==0||Pd(o,n,p)}return p}function Pd(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 jd(e,n,o,l){n.value=o,n.getSnapshot=l,Md(n)&&Id(e)}function Td(e,n,o){return o(function(){Md(n)&&Id(e)})}function Md(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!se(e,o)}catch{return!0}}function Id(e){var n=So(e,1);n!==null&&Pr(n,e,1,-1)}function Ad(e){var n=Wr();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=xy.bind(null,zt,e),[n.memoizedState,e]}function ua(e,n,o,l){return e={tag:e,create:n,destroy:o,deps:l,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:(l=o.next,o.next=e,e.next=l,n.lastEffect=e)),e}function $d(){return cr().memoizedState}function xl(e,n,o,l){var p=Wr();zt.flags|=e,p.memoizedState=ua(1|n,o,void 0,l===void 0?null:l)}function wl(e,n,o,l){var p=cr();l=l===void 0?null:l;var g=void 0;if(Xt!==null){var E=Xt.memoizedState;if(g=E.destroy,l!==null&&cc(l,E.deps)){p.memoizedState=ua(n,o,g,l);return}}zt.flags|=e,p.memoizedState=ua(1|n,o,g,l)}function Od(e,n){return xl(8390656,8,e,n)}function mc(e,n){return wl(2048,8,e,n)}function Rd(e,n){return wl(4,2,e,n)}function Dd(e,n){return wl(4,4,e,n)}function zd(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Ld(e,n,o){return o=o!=null?o.concat([e]):null,wl(4,4,zd.bind(null,n,e),o)}function gc(){}function Fd(e,n){var o=cr();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&cc(n,l[1])?l[0]:(o.memoizedState=[e,n],e)}function Bd(e,n){var o=cr();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&cc(n,l[1])?l[0]:(e=e(),o.memoizedState=[e,n],e)}function Hd(e,n,o){return(Ci&21)===0?(e.baseState&&(e.baseState=!1,Dn=!0),e.memoizedState=o):(se(o,n)||(o=Br(),zt.lanes|=o,Pi|=o,e.baseState=!0),n)}function yy(e,n){var o=wt;wt=o!==0&&4>o?o:4,e(!0);var l=uc.transition;uc.transition={};try{e(!1),n()}finally{wt=o,uc.transition=l}}function Vd(){return cr().memoizedState}function vy(e,n,o){var l=ti(e);if(o={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null},Kd(e))Ud(n,o);else if(o=_d(e,n,o,l),o!==null){var p=Tn();Pr(o,e,l,p),qd(o,n,l)}}function xy(e,n,o){var l=ti(e),p={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null};if(Kd(e))Ud(n,p);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=n.lastRenderedReducer,g!==null))try{var E=n.lastRenderedState,D=g(E,o);if(p.hasEagerState=!0,p.eagerState=D,se(D,E)){var K=n.interleaved;K===null?(p.next=p,rc(n)):(p.next=K.next,K.next=p),n.interleaved=p;return}}catch{}finally{}o=_d(e,n,p,l),o!==null&&(p=Tn(),Pr(o,e,l,p),qd(o,n,l))}}function Kd(e){var n=e.alternate;return e===zt||n!==null&&n===zt}function Ud(e,n){sa=vl=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function qd(e,n,o){if((o&4194240)!==0){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,Oo(e,o)}}var _l={readContext:ur,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useInsertionEffect:vn,useLayoutEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useMutableSource:vn,useSyncExternalStore:vn,useId:vn,unstable_isNewReconciler:!1},wy={readContext:ur,useCallback:function(e,n){return Wr().memoizedState=[e,n===void 0?null:n],e},useContext:ur,useEffect:Od,useImperativeHandle:function(e,n,o){return o=o!=null?o.concat([e]):null,xl(4194308,4,zd.bind(null,n,e),o)},useLayoutEffect:function(e,n){return xl(4194308,4,e,n)},useInsertionEffect:function(e,n){return xl(4,2,e,n)},useMemo:function(e,n){var o=Wr();return n=n===void 0?null:n,e=e(),o.memoizedState=[e,n],e},useReducer:function(e,n,o){var l=Wr();return n=o!==void 0?o(n):n,l.memoizedState=l.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},l.queue=e,e=e.dispatch=vy.bind(null,zt,e),[l.memoizedState,e]},useRef:function(e){var n=Wr();return e={current:e},n.memoizedState=e},useState:Ad,useDebugValue:gc,useDeferredValue:function(e){return Wr().memoizedState=e},useTransition:function(){var e=Ad(!1),n=e[0];return e=yy.bind(null,e[1]),Wr().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,o){var l=zt,p=Wr();if($t){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),tn===null)throw Error(i(349));(Ci&30)!==0||Pd(l,n,o)}p.memoizedState=o;var g={value:o,getSnapshot:n};return p.queue=g,Od(Td.bind(null,l,g,e),[e]),l.flags|=2048,ua(9,jd.bind(null,l,g,o,n),void 0,null),o},useId:function(){var e=Wr(),n=tn.identifierPrefix;if($t){var o=_o,l=wo;o=(l&~(1<<32-hn(l)-1)).toString(32)+o,n=":"+n+"R"+o,o=aa++,0<o&&(n+="H"+o.toString(32)),n+=":"}else o=gy++,n=":"+n+"r"+o.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},_y={readContext:ur,useCallback:Fd,useContext:ur,useEffect:mc,useImperativeHandle:Ld,useInsertionEffect:Rd,useLayoutEffect:Dd,useMemo:Bd,useReducer:pc,useRef:$d,useState:function(){return pc(la)},useDebugValue:gc,useDeferredValue:function(e){var n=cr();return Hd(n,Xt.memoizedState,e)},useTransition:function(){var e=pc(la)[0],n=cr().memoizedState;return[e,n]},useMutableSource:Nd,useSyncExternalStore:Cd,useId:Vd,unstable_isNewReconciler:!1},Sy={readContext:ur,useCallback:Fd,useContext:ur,useEffect:mc,useImperativeHandle:Ld,useInsertionEffect:Rd,useLayoutEffect:Dd,useMemo:Bd,useReducer:hc,useRef:$d,useState:function(){return hc(la)},useDebugValue:gc,useDeferredValue:function(e){var n=cr();return Xt===null?n.memoizedState=e:Hd(n,Xt.memoizedState,e)},useTransition:function(){var e=hc(la)[0],n=cr().memoizedState;return[e,n]},useMutableSource:Nd,useSyncExternalStore:Cd,useId:Vd,unstable_isNewReconciler:!1};function Er(e,n){if(e&&e.defaultProps){n=X({},n),e=e.defaultProps;for(var o in e)n[o]===void 0&&(n[o]=e[o]);return n}return n}function yc(e,n,o,l){n=e.memoizedState,o=o(l,n),o=o==null?n:X({},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 l=Tn(),p=ti(e),g=bo(l,p);g.payload=n,o!=null&&(g.callback=o),n=Go(e,g,p),n!==null&&(Pr(n,e,p,l),hl(n,e,p))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var l=Tn(),p=ti(e),g=bo(l,p);g.tag=1,g.payload=n,o!=null&&(g.callback=o),n=Go(e,g,p),n!==null&&(Pr(n,e,p,l),hl(n,e,p))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=Tn(),l=ti(e),p=bo(o,l);p.tag=2,n!=null&&(p.callback=n),n=Go(e,p,l),n!==null&&(Pr(n,e,l,o),hl(n,e,l))}};function Wd(e,n,o,l,p,g,E){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,g,E):n.prototype&&n.prototype.isPureReactComponent?!J(o,l)||!J(p,g):!0}function Yd(e,n,o){var l=!1,p=Yo,g=n.contextType;return typeof g=="object"&&g!==null?g=ur(g):(p=Rn(n)?Si:yn.current,l=n.contextTypes,g=(l=l!=null)?us(e,p):Yo),n=new n(o,g),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Sl,e.stateNode=n,n._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=p,e.__reactInternalMemoizedMaskedChildContext=g),n}function Xd(e,n,o,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,l),n.state!==e&&Sl.enqueueReplaceState(n,n.state,null)}function vc(e,n,o,l){var p=e.stateNode;p.props=o,p.state=e.memoizedState,p.refs={},oc(e);var g=n.contextType;typeof g=="object"&&g!==null?p.context=ur(g):(g=Rn(n)?Si:yn.current,p.context=us(e,g)),p.state=e.memoizedState,g=n.getDerivedStateFromProps,typeof g=="function"&&(yc(e,n,g,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),ml(e,o,p,l),p.state=e.memoizedState),typeof p.componentDidMount=="function"&&(e.flags|=4194308)}function ys(e,n){try{var o="",l=n;do o+=Ie(l),l=l.return;while(l);var p=o}catch(g){p=`
|
|
39
|
+
Error generating stack: `+g.message+`
|
|
40
|
+
`+g.stack}return{value:e,source:n,stack:p,digest:null}}function xc(e,n,o){return{value:e,source:null,stack:o??null,digest:n??null}}function wc(e,n){try{console.error(n.value)}catch(o){setTimeout(function(){throw o})}}var by=typeof WeakMap=="function"?WeakMap:Map;function Qd(e,n,o){o=bo(-1,o),o.tag=3,o.payload={element:null};var l=n.value;return o.callback=function(){jl||(jl=!0,Oc=l),wc(e,n)},o}function Gd(e,n,o){o=bo(-1,o),o.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var p=n.value;o.payload=function(){return l(p)},o.callback=function(){wc(e,n)}}var g=e.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(o.callback=function(){wc(e,n),typeof l!="function"&&(Jo===null?Jo=new Set([this]):Jo.add(this));var E=n.stack;this.componentDidCatch(n.value,{componentStack:E!==null?E:""})}),o}function Zd(e,n,o){var l=e.pingCache;if(l===null){l=e.pingCache=new by;var p=new Set;l.set(n,p)}else p=l.get(n),p===void 0&&(p=new Set,l.set(n,p));p.has(o)||(p.add(o),e=Dy.bind(null,e,n,o),n.then(e,e))}function Jd(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 ep(e,n,o,l,p){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,o.flags|=131072,o.flags&=-52805,o.tag===1&&(o.alternate===null?o.tag=17:(n=bo(-1,1),n.tag=2,Go(o,n,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=p,e)}var ky=R.ReactCurrentOwner,Dn=!1;function jn(e,n,o,l){n.child=e===null?wd(n,null,o,l):ps(n,e.child,o,l)}function tp(e,n,o,l,p){o=o.render;var g=n.ref;return ms(n,p),l=fc(e,n,o,l,g,p),o=dc(),e!==null&&!Dn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,ko(e,n,p)):($t&&o&&Yu(n),n.flags|=1,jn(e,n,l,p),n.child)}function np(e,n,o,l,p){if(e===null){var g=o.type;return typeof g=="function"&&!Hc(g)&&g.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(n.tag=15,n.type=g,rp(e,n,g,l,p)):(e=Ol(o.type,null,l,n,n.mode,p),e.ref=n.ref,e.return=n,n.child=e)}if(g=e.child,(e.lanes&p)===0){var E=g.memoizedProps;if(o=o.compare,o=o!==null?o:J,o(E,l)&&e.ref===n.ref)return ko(e,n,p)}return n.flags|=1,e=ri(g,l),e.ref=n.ref,e.return=n,n.child=e}function rp(e,n,o,l,p){if(e!==null){var g=e.memoizedProps;if(J(g,l)&&e.ref===n.ref)if(Dn=!1,n.pendingProps=l=g,(e.lanes&p)!==0)(e.flags&131072)!==0&&(Dn=!0);else return n.lanes=e.lanes,ko(e,n,p)}return _c(e,n,o,l,p)}function op(e,n,o){var l=n.pendingProps,p=l.children,g=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Et(xs,Qn),Qn|=o;else{if((o&1073741824)===0)return e=g!==null?g.baseLanes|o:o,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,Et(xs,Qn),Qn|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=g!==null?g.baseLanes:o,Et(xs,Qn),Qn|=l}else g!==null?(l=g.baseLanes|o,n.memoizedState=null):l=o,Et(xs,Qn),Qn|=l;return jn(e,n,p,o),n.child}function ip(e,n){var o=n.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(n.flags|=512,n.flags|=2097152)}function _c(e,n,o,l,p){var g=Rn(o)?Si:yn.current;return g=us(n,g),ms(n,p),o=fc(e,n,o,l,g,p),l=dc(),e!==null&&!Dn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,ko(e,n,p)):($t&&l&&Yu(n),n.flags|=1,jn(e,n,o,p),n.child)}function sp(e,n,o,l,p){if(Rn(o)){var g=!0;sl(n)}else g=!1;if(ms(n,p),n.stateNode===null)kl(e,n),Yd(n,o,l),vc(n,o,l,p),l=!0;else if(e===null){var E=n.stateNode,D=n.memoizedProps;E.props=D;var K=E.context,ye=o.contextType;typeof ye=="object"&&ye!==null?ye=ur(ye):(ye=Rn(o)?Si:yn.current,ye=us(n,ye));var je=o.getDerivedStateFromProps,Me=typeof je=="function"||typeof E.getSnapshotBeforeUpdate=="function";Me||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(D!==l||K!==ye)&&Xd(n,E,l,ye),Qo=!1;var Pe=n.memoizedState;E.state=Pe,ml(n,l,E,p),K=n.memoizedState,D!==l||Pe!==K||On.current||Qo?(typeof je=="function"&&(yc(n,o,je,l),K=n.memoizedState),(D=Qo||Wd(n,o,D,l,Pe,K,ye))?(Me||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(n.flags|=4194308)):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=K),E.props=l,E.state=K,E.context=ye,l=D):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{E=n.stateNode,Sd(e,n),D=n.memoizedProps,ye=n.type===n.elementType?D:Er(n.type,D),E.props=ye,Me=n.pendingProps,Pe=E.context,K=o.contextType,typeof K=="object"&&K!==null?K=ur(K):(K=Rn(o)?Si:yn.current,K=us(n,K));var Ke=o.getDerivedStateFromProps;(je=typeof Ke=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(D!==Me||Pe!==K)&&Xd(n,E,l,K),Qo=!1,Pe=n.memoizedState,E.state=Pe,ml(n,l,E,p);var Ye=n.memoizedState;D!==Me||Pe!==Ye||On.current||Qo?(typeof Ke=="function"&&(yc(n,o,Ke,l),Ye=n.memoizedState),(ye=Qo||Wd(n,o,ye,l,Pe,Ye,K)||!1)?(je||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(l,Ye,K),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(l,Ye,K)),typeof E.componentDidUpdate=="function"&&(n.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof E.componentDidUpdate!="function"||D===e.memoizedProps&&Pe===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&Pe===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=Ye),E.props=l,E.state=Ye,E.context=K,l=ye):(typeof E.componentDidUpdate!="function"||D===e.memoizedProps&&Pe===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&Pe===e.memoizedState||(n.flags|=1024),l=!1)}return Sc(e,n,o,l,g,p)}function Sc(e,n,o,l,p,g){ip(e,n);var E=(n.flags&128)!==0;if(!l&&!E)return p&&fd(n,o,!1),ko(e,n,g);l=n.stateNode,ky.current=n;var D=E&&typeof o.getDerivedStateFromError!="function"?null:l.render();return n.flags|=1,e!==null&&E?(n.child=ps(n,e.child,null,g),n.child=ps(n,null,D,g)):jn(e,n,D,g),n.memoizedState=l.state,p&&fd(n,o,!0),n.child}function ap(e){var n=e.stateNode;n.pendingContext?ud(e,n.pendingContext,n.pendingContext!==n.context):n.context&&ud(e,n.context,!1),ic(e,n.containerInfo)}function lp(e,n,o,l,p){return ds(),Zu(p),n.flags|=256,jn(e,n,o,l),n.child}var bc={dehydrated:null,treeContext:null,retryLane:0};function kc(e){return{baseLanes:e,cachePool:null,transitions:null}}function up(e,n,o){var l=n.pendingProps,p=Dt.current,g=!1,E=(n.flags&128)!==0,D;if((D=E)||(D=e!==null&&e.memoizedState===null?!1:(p&2)!==0),D?(g=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(p|=1),Et(Dt,p&1),e===null)return Gu(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(E=l.children,e=l.fallback,g?(l=n.mode,g=n.child,E={mode:"hidden",children:E},(l&1)===0&&g!==null?(g.childLanes=0,g.pendingProps=E):g=Rl(E,l,0,null),e=Ii(e,l,o,null),g.return=n,e.return=n,g.sibling=e,n.child=g,n.child.memoizedState=kc(o),n.memoizedState=bc,e):Ec(n,E));if(p=e.memoizedState,p!==null&&(D=p.dehydrated,D!==null))return Ey(e,n,E,l,D,p,o);if(g){g=l.fallback,E=n.mode,p=e.child,D=p.sibling;var K={mode:"hidden",children:l.children};return(E&1)===0&&n.child!==p?(l=n.child,l.childLanes=0,l.pendingProps=K,n.deletions=null):(l=ri(p,K),l.subtreeFlags=p.subtreeFlags&14680064),D!==null?g=ri(D,g):(g=Ii(g,E,o,null),g.flags|=2),g.return=n,l.return=n,l.sibling=g,n.child=l,l=g,g=n.child,E=e.child.memoizedState,E=E===null?kc(o):{baseLanes:E.baseLanes|o,cachePool:null,transitions:E.transitions},g.memoizedState=E,g.childLanes=e.childLanes&~o,n.memoizedState=bc,l}return g=e.child,e=g.sibling,l=ri(g,{mode:"visible",children:l.children}),(n.mode&1)===0&&(l.lanes=o),l.return=n,l.sibling=null,e!==null&&(o=n.deletions,o===null?(n.deletions=[e],n.flags|=16):o.push(e)),n.child=l,n.memoizedState=null,l}function Ec(e,n){return n=Rl({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function bl(e,n,o,l){return l!==null&&Zu(l),ps(n,e.child,null,o),e=Ec(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Ey(e,n,o,l,p,g,E){if(o)return n.flags&256?(n.flags&=-257,l=xc(Error(i(422))),bl(e,n,E,l)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(g=l.fallback,p=n.mode,l=Rl({mode:"visible",children:l.children},p,0,null),g=Ii(g,p,E,null),g.flags|=2,l.return=n,g.return=n,l.sibling=g,n.child=l,(n.mode&1)!==0&&ps(n,e.child,null,E),n.child.memoizedState=kc(E),n.memoizedState=bc,g);if((n.mode&1)===0)return bl(e,n,E,null);if(p.data==="$!"){if(l=p.nextSibling&&p.nextSibling.dataset,l)var D=l.dgst;return l=D,g=Error(i(419)),l=xc(g,l,void 0),bl(e,n,E,l)}if(D=(E&e.childLanes)!==0,Dn||D){if(l=tn,l!==null){switch(E&-E){case 4:p=2;break;case 16:p=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:p=32;break;case 536870912:p=268435456;break;default:p=0}p=(p&(l.suspendedLanes|E))!==0?0:p,p!==0&&p!==g.retryLane&&(g.retryLane=p,So(e,p),Pr(l,e,p,-1))}return Bc(),l=xc(Error(i(421))),bl(e,n,E,l)}return p.data==="$?"?(n.flags|=128,n.child=e.child,n=zy.bind(null,e),p._reactRetry=n,null):(e=g.treeContext,Xn=qo(p.nextSibling),Yn=n,$t=!0,kr=null,e!==null&&(ar[lr++]=wo,ar[lr++]=_o,ar[lr++]=bi,wo=e.id,_o=e.overflow,bi=n),n=Ec(n,l.children),n.flags|=4096,n)}function cp(e,n,o){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),nc(e.return,n,o)}function Nc(e,n,o,l,p){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:p}:(g.isBackwards=n,g.rendering=null,g.renderingStartTime=0,g.last=l,g.tail=o,g.tailMode=p)}function fp(e,n,o){var l=n.pendingProps,p=l.revealOrder,g=l.tail;if(jn(e,n,l.children,o),l=Dt.current,(l&2)!==0)l=l&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cp(e,o,n);else if(e.tag===19)cp(e,o,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}if(Et(Dt,l),(n.mode&1)===0)n.memoizedState=null;else switch(p){case"forwards":for(o=n.child,p=null;o!==null;)e=o.alternate,e!==null&&gl(e)===null&&(p=o),o=o.sibling;o=p,o===null?(p=n.child,n.child=null):(p=o.sibling,o.sibling=null),Nc(n,!1,p,o,g);break;case"backwards":for(o=null,p=n.child,n.child=null;p!==null;){if(e=p.alternate,e!==null&&gl(e)===null){n.child=p;break}e=p.sibling,p.sibling=o,o=p,p=e}Nc(n,!0,o,null,g);break;case"together":Nc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function kl(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function ko(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),Pi|=n.lanes,(o&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(i(153));if(n.child!==null){for(e=n.child,o=ri(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=ri(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function Ny(e,n,o){switch(n.tag){case 3:ap(n),ds();break;case 5:Ed(n);break;case 1:Rn(n.type)&&sl(n);break;case 4:ic(n,n.stateNode.containerInfo);break;case 10:var l=n.type._context,p=n.memoizedProps.value;Et(dl,l._currentValue),l._currentValue=p;break;case 13:if(l=n.memoizedState,l!==null)return l.dehydrated!==null?(Et(Dt,Dt.current&1),n.flags|=128,null):(o&n.child.childLanes)!==0?up(e,n,o):(Et(Dt,Dt.current&1),e=ko(e,n,o),e!==null?e.sibling:null);Et(Dt,Dt.current&1);break;case 19:if(l=(o&n.childLanes)!==0,(e.flags&128)!==0){if(l)return fp(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),l)break;return null;case 22:case 23:return n.lanes=0,op(e,n,o)}return ko(e,n,o)}var dp,Cc,pp,hp;dp=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}},Cc=function(){},pp=function(e,n,o,l){var p=e.memoizedProps;if(p!==l){e=n.stateNode,Ni(qr.current);var g=null;switch(o){case"input":p=ct(e,p),l=ct(e,l),g=[];break;case"select":p=X({},p,{value:void 0}),l=X({},l,{value:void 0}),g=[];break;case"textarea":p=Mn(e,p),l=Mn(e,l),g=[];break;default:typeof p.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=rl)}qe(o,l);var E;o=null;for(ye in p)if(!l.hasOwnProperty(ye)&&p.hasOwnProperty(ye)&&p[ye]!=null)if(ye==="style"){var D=p[ye];for(E in D)D.hasOwnProperty(E)&&(o||(o={}),o[E]="")}else ye!=="dangerouslySetInnerHTML"&&ye!=="children"&&ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&ye!=="autoFocus"&&(u.hasOwnProperty(ye)?g||(g=[]):(g=g||[]).push(ye,null));for(ye in l){var K=l[ye];if(D=p!=null?p[ye]:void 0,l.hasOwnProperty(ye)&&K!==D&&(K!=null||D!=null))if(ye==="style")if(D){for(E in D)!D.hasOwnProperty(E)||K&&K.hasOwnProperty(E)||(o||(o={}),o[E]="");for(E in K)K.hasOwnProperty(E)&&D[E]!==K[E]&&(o||(o={}),o[E]=K[E])}else o||(g||(g=[]),g.push(ye,o)),o=K;else ye==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,D=D?D.__html:void 0,K!=null&&D!==K&&(g=g||[]).push(ye,K)):ye==="children"?typeof K!="string"&&typeof K!="number"||(g=g||[]).push(ye,""+K):ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&(u.hasOwnProperty(ye)?(K!=null&&ye==="onScroll"&&Tt("scroll",e),g||D===K||(g=[])):(g=g||[]).push(ye,K))}o&&(g=g||[]).push("style",o);var ye=g;(n.updateQueue=ye)&&(n.flags|=4)}},hp=function(e,n,o,l){o!==l&&(n.flags|=4)};function ca(e,n){if(!$t)switch(e.tailMode){case"hidden":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function xn(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,l=0;if(n)for(var p=e.child;p!==null;)o|=p.lanes|p.childLanes,l|=p.subtreeFlags&14680064,l|=p.flags&14680064,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)o|=p.lanes|p.childLanes,l|=p.subtreeFlags,l|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=l,e.childLanes=o,n}function Cy(e,n,o){var l=n.pendingProps;switch(Xu(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xn(n),null;case 1:return Rn(n.type)&&il(),xn(n),null;case 3:return l=n.stateNode,gs(),Mt(On),Mt(yn),lc(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(cl(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,kr!==null&&(zc(kr),kr=null))),Cc(e,n),xn(n),null;case 5:sc(n);var p=Ni(ia.current);if(o=n.type,e!==null&&n.stateNode!=null)pp(e,n,o,l,p),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!l){if(n.stateNode===null)throw Error(i(166));return xn(n),null}if(e=Ni(qr.current),cl(n)){l=n.stateNode,o=n.type;var g=n.memoizedProps;switch(l[Ur]=n,l[ea]=g,e=(n.mode&1)!==0,o){case"dialog":Tt("cancel",l),Tt("close",l);break;case"iframe":case"object":case"embed":Tt("load",l);break;case"video":case"audio":for(p=0;p<yo.length;p++)Tt(yo[p],l);break;case"source":Tt("error",l);break;case"img":case"image":case"link":Tt("error",l),Tt("load",l);break;case"details":Tt("toggle",l);break;case"input":nt(l,g),Tt("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!g.multiple},Tt("invalid",l);break;case"textarea":cn(l,g),Tt("invalid",l)}qe(o,g),p=null;for(var E in g)if(g.hasOwnProperty(E)){var D=g[E];E==="children"?typeof D=="string"?l.textContent!==D&&(g.suppressHydrationWarning!==!0&&nl(l.textContent,D,e),p=["children",D]):typeof D=="number"&&l.textContent!==""+D&&(g.suppressHydrationWarning!==!0&&nl(l.textContent,D,e),p=["children",""+D]):u.hasOwnProperty(E)&&D!=null&&E==="onScroll"&&Tt("scroll",l)}switch(o){case"input":Je(l),rn(l,g,!0);break;case"textarea":Je(l),fn(l);break;case"select":case"option":break;default:typeof g.onClick=="function"&&(l.onclick=rl)}l=p,n.updateQueue=l,l!==null&&(n.flags|=4)}else{E=p.nodeType===9?p:p.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ct(o)),e==="http://www.w3.org/1999/xhtml"?o==="script"?(e=E.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=E.createElement(o,{is:l.is}):(e=E.createElement(o),o==="select"&&(E=e,l.multiple?E.multiple=!0:l.size&&(E.size=l.size))):e=E.createElementNS(e,o),e[Ur]=n,e[ea]=l,dp(e,n,!1,!1),n.stateNode=e;e:{switch(E=Vn(o,l),o){case"dialog":Tt("cancel",e),Tt("close",e),p=l;break;case"iframe":case"object":case"embed":Tt("load",e),p=l;break;case"video":case"audio":for(p=0;p<yo.length;p++)Tt(yo[p],e);p=l;break;case"source":Tt("error",e),p=l;break;case"img":case"image":case"link":Tt("error",e),Tt("load",e),p=l;break;case"details":Tt("toggle",e),p=l;break;case"input":nt(e,l),p=ct(e,l),Tt("invalid",e);break;case"option":p=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},p=X({},l,{value:void 0}),Tt("invalid",e);break;case"textarea":cn(e,l),p=Mn(e,l),Tt("invalid",e);break;default:p=l}qe(o,p),D=p;for(g in D)if(D.hasOwnProperty(g)){var K=D[g];g==="style"?$r(e,K):g==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,K!=null&&Jn(e,K)):g==="children"?typeof K=="string"?(o!=="textarea"||K!=="")&&_n(e,K):typeof K=="number"&&_n(e,""+K):g!=="suppressContentEditableWarning"&&g!=="suppressHydrationWarning"&&g!=="autoFocus"&&(u.hasOwnProperty(g)?K!=null&&g==="onScroll"&&Tt("scroll",e):K!=null&&j(e,g,K,E))}switch(o){case"input":Je(e),rn(e,l,!1);break;case"textarea":Je(e),fn(e);break;case"option":l.value!=null&&e.setAttribute("value",""+we(l.value));break;case"select":e.multiple=!!l.multiple,g=l.value,g!=null?Nt(e,!!l.multiple,g,!1):l.defaultValue!=null&&Nt(e,!!l.multiple,l.defaultValue,!0);break;default:typeof p.onClick=="function"&&(e.onclick=rl)}switch(o){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return xn(n),null;case 6:if(e&&n.stateNode!=null)hp(e,n,e.memoizedProps,l);else{if(typeof l!="string"&&n.stateNode===null)throw Error(i(166));if(o=Ni(ia.current),Ni(qr.current),cl(n)){if(l=n.stateNode,o=n.memoizedProps,l[Ur]=n,(g=l.nodeValue!==o)&&(e=Yn,e!==null))switch(e.tag){case 3:nl(l.nodeValue,o,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&nl(l.nodeValue,o,(e.mode&1)!==0)}g&&(n.flags|=4)}else l=(o.nodeType===9?o:o.ownerDocument).createTextNode(l),l[Ur]=n,n.stateNode=l}return xn(n),null;case 13:if(Mt(Dt),l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if($t&&Xn!==null&&(n.mode&1)!==0&&(n.flags&128)===0)yd(),ds(),n.flags|=98560,g=!1;else if(g=cl(n),l!==null&&l.dehydrated!==null){if(e===null){if(!g)throw Error(i(318));if(g=n.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(i(317));g[Ur]=n}else ds(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;xn(n),g=!1}else kr!==null&&(zc(kr),kr=null),g=!0;if(!g)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=o,n):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(Dt.current&1)!==0?Qt===0&&(Qt=3):Bc())),n.updateQueue!==null&&(n.flags|=4),xn(n),null);case 4:return gs(),Cc(e,n),e===null&&Zs(n.stateNode.containerInfo),xn(n),null;case 10:return tc(n.type._context),xn(n),null;case 17:return Rn(n.type)&&il(),xn(n),null;case 19:if(Mt(Dt),g=n.memoizedState,g===null)return xn(n),null;if(l=(n.flags&128)!==0,E=g.rendering,E===null)if(l)ca(g,!1);else{if(Qt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(E=gl(e),E!==null){for(n.flags|=128,ca(g,!1),l=E.updateQueue,l!==null&&(n.updateQueue=l,n.flags|=4),n.subtreeFlags=0,l=o,o=n.child;o!==null;)g=o,e=l,g.flags&=14680066,E=g.alternate,E===null?(g.childLanes=0,g.lanes=e,g.child=null,g.subtreeFlags=0,g.memoizedProps=null,g.memoizedState=null,g.updateQueue=null,g.dependencies=null,g.stateNode=null):(g.childLanes=E.childLanes,g.lanes=E.lanes,g.child=E.child,g.subtreeFlags=0,g.deletions=null,g.memoizedProps=E.memoizedProps,g.memoizedState=E.memoizedState,g.updateQueue=E.updateQueue,g.type=E.type,e=E.dependencies,g.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}g.tail!==null&&yt()>ws&&(n.flags|=128,l=!0,ca(g,!1),n.lanes=4194304)}else{if(!l)if(e=gl(E),e!==null){if(n.flags|=128,l=!0,o=e.updateQueue,o!==null&&(n.updateQueue=o,n.flags|=4),ca(g,!0),g.tail===null&&g.tailMode==="hidden"&&!E.alternate&&!$t)return xn(n),null}else 2*yt()-g.renderingStartTime>ws&&o!==1073741824&&(n.flags|=128,l=!0,ca(g,!1),n.lanes=4194304);g.isBackwards?(E.sibling=n.child,n.child=E):(o=g.last,o!==null?o.sibling=E:n.child=E,g.last=E)}return g.tail!==null?(n=g.tail,g.rendering=n,g.tail=n.sibling,g.renderingStartTime=yt(),n.sibling=null,o=Dt.current,Et(Dt,l?o&1|2:o&1),n):(xn(n),null);case 22:case 23:return Fc(),l=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(n.flags|=8192),l&&(n.mode&1)!==0?(Qn&1073741824)!==0&&(xn(n),n.subtreeFlags&6&&(n.flags|=8192)):xn(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function Py(e,n){switch(Xu(n),n.tag){case 1:return Rn(n.type)&&il(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return gs(),Mt(On),Mt(yn),lc(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return sc(n),null;case 13:if(Mt(Dt),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));ds()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Mt(Dt),null;case 4:return gs(),null;case 10:return tc(n.type._context),null;case 22:case 23:return Fc(),null;case 24:return null;default:return null}}var El=!1,wn=!1,jy=typeof WeakSet=="function"?WeakSet:Set,We=null;function vs(e,n){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(l){Lt(e,n,l)}else o.current=null}function Pc(e,n,o){try{o()}catch(l){Lt(e,n,l)}}var mp=!1;function Ty(e,n){if(Fu=Ui,e=re(),ne(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var l=o.getSelection&&o.getSelection();if(l&&l.rangeCount!==0){o=l.anchorNode;var p=l.anchorOffset,g=l.focusNode;l=l.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var E=0,D=-1,K=-1,ye=0,je=0,Me=e,Pe=null;t:for(;;){for(var Ke;Me!==o||p!==0&&Me.nodeType!==3||(D=E+p),Me!==g||l!==0&&Me.nodeType!==3||(K=E+l),Me.nodeType===3&&(E+=Me.nodeValue.length),(Ke=Me.firstChild)!==null;)Pe=Me,Me=Ke;for(;;){if(Me===e)break t;if(Pe===o&&++ye===p&&(D=E),Pe===g&&++je===l&&(K=E),(Ke=Me.nextSibling)!==null)break;Me=Pe,Pe=Me.parentNode}Me=Ke}o=D===-1||K===-1?null:{start:D,end:K}}else o=null}o=o||{start:0,end:0}}else o=null;for(Bu={focusedElem:e,selectionRange:o},Ui=!1,We=n;We!==null;)if(n=We,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,We=e;else for(;We!==null;){n=We;try{var Ye=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(Ye!==null){var Qe=Ye.memoizedProps,Bt=Ye.memoizedState,de=n.stateNode,ee=de.getSnapshotBeforeUpdate(n.elementType===n.type?Qe:Er(n.type,Qe),Bt);de.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:var me=n.stateNode.containerInfo;me.nodeType===1?me.textContent="":me.nodeType===9&&me.documentElement&&me.removeChild(me.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(De){Lt(n,n.return,De)}if(e=n.sibling,e!==null){e.return=n.return,We=e;break}We=n.return}return Ye=mp,mp=!1,Ye}function fa(e,n,o){var l=n.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var p=l=l.next;do{if((p.tag&e)===e){var g=p.destroy;p.destroy=void 0,g!==void 0&&Pc(n,o,g)}p=p.next}while(p!==l)}}function Nl(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var l=o.create;o.destroy=l()}o=o.next}while(o!==n)}}function jc(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 gp(e){var n=e.alternate;n!==null&&(e.alternate=null,gp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Ur],delete n[ea],delete n[Uu],delete n[dy],delete n[py])),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 yp(e){return e.tag===5||e.tag===3||e.tag===4}function vp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yp(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 Tc(e,n,o){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?o.nodeType===8?o.parentNode.insertBefore(e,n):o.insertBefore(e,n):(o.nodeType===8?(n=o.parentNode,n.insertBefore(e,o)):(n=o,n.appendChild(e)),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=rl));else if(l!==4&&(e=e.child,e!==null))for(Tc(e,n,o),e=e.sibling;e!==null;)Tc(e,n,o),e=e.sibling}function Mc(e,n,o){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(Mc(e,n,o),e=e.sibling;e!==null;)Mc(e,n,o),e=e.sibling}var ln=null,Nr=!1;function Zo(e,n,o){for(o=o.child;o!==null;)xp(e,n,o),o=o.sibling}function xp(e,n,o){if(Pn&&typeof Pn.onCommitFiberUnmount=="function")try{Pn.onCommitFiberUnmount(or,o)}catch{}switch(o.tag){case 5:wn||vs(o,n);case 6:var l=ln,p=Nr;ln=null,Zo(e,n,o),ln=l,Nr=p,ln!==null&&(Nr?(e=ln,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):ln.removeChild(o.stateNode));break;case 18:ln!==null&&(Nr?(e=ln,o=o.stateNode,e.nodeType===8?Ku(e.parentNode,o):e.nodeType===1&&Ku(e,o),ao(e)):Ku(ln,o.stateNode));break;case 4:l=ln,p=Nr,ln=o.stateNode.containerInfo,Nr=!0,Zo(e,n,o),ln=l,Nr=p;break;case 0:case 11:case 14:case 15:if(!wn&&(l=o.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){p=l=l.next;do{var g=p,E=g.destroy;g=g.tag,E!==void 0&&((g&2)!==0||(g&4)!==0)&&Pc(o,n,E),p=p.next}while(p!==l)}Zo(e,n,o);break;case 1:if(!wn&&(vs(o,n),l=o.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=o.memoizedProps,l.state=o.memoizedState,l.componentWillUnmount()}catch(D){Lt(o,n,D)}Zo(e,n,o);break;case 21:Zo(e,n,o);break;case 22:o.mode&1?(wn=(l=wn)||o.memoizedState!==null,Zo(e,n,o),wn=l):Zo(e,n,o);break;default:Zo(e,n,o)}}function wp(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new jy),n.forEach(function(l){var p=Ly.bind(null,e,l);o.has(l)||(o.add(l),l.then(p,p))})}}function Cr(e,n){var o=n.deletions;if(o!==null)for(var l=0;l<o.length;l++){var p=o[l];try{var g=e,E=n,D=E;e:for(;D!==null;){switch(D.tag){case 5:ln=D.stateNode,Nr=!1;break e;case 3:ln=D.stateNode.containerInfo,Nr=!0;break e;case 4:ln=D.stateNode.containerInfo,Nr=!0;break e}D=D.return}if(ln===null)throw Error(i(160));xp(g,E,p),ln=null,Nr=!1;var K=p.alternate;K!==null&&(K.return=null),p.return=null}catch(ye){Lt(p,n,ye)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)_p(n,e),n=n.sibling}function _p(e,n){var o=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Cr(n,e),Yr(e),l&4){try{fa(3,e,e.return),Nl(3,e)}catch(Qe){Lt(e,e.return,Qe)}try{fa(5,e,e.return)}catch(Qe){Lt(e,e.return,Qe)}}break;case 1:Cr(n,e),Yr(e),l&512&&o!==null&&vs(o,o.return);break;case 5:if(Cr(n,e),Yr(e),l&512&&o!==null&&vs(o,o.return),e.flags&32){var p=e.stateNode;try{_n(p,"")}catch(Qe){Lt(e,e.return,Qe)}}if(l&4&&(p=e.stateNode,p!=null)){var g=e.memoizedProps,E=o!==null?o.memoizedProps:g,D=e.type,K=e.updateQueue;if(e.updateQueue=null,K!==null)try{D==="input"&&g.type==="radio"&&g.name!=null&&ft(p,g),Vn(D,E);var ye=Vn(D,g);for(E=0;E<K.length;E+=2){var je=K[E],Me=K[E+1];je==="style"?$r(p,Me):je==="dangerouslySetInnerHTML"?Jn(p,Me):je==="children"?_n(p,Me):j(p,je,Me,ye)}switch(D){case"input":kt(p,g);break;case"textarea":pr(p,g);break;case"select":var Pe=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!g.multiple;var Ke=g.value;Ke!=null?Nt(p,!!g.multiple,Ke,!1):Pe!==!!g.multiple&&(g.defaultValue!=null?Nt(p,!!g.multiple,g.defaultValue,!0):Nt(p,!!g.multiple,g.multiple?[]:"",!1))}p[ea]=g}catch(Qe){Lt(e,e.return,Qe)}}break;case 6:if(Cr(n,e),Yr(e),l&4){if(e.stateNode===null)throw Error(i(162));p=e.stateNode,g=e.memoizedProps;try{p.nodeValue=g}catch(Qe){Lt(e,e.return,Qe)}}break;case 3:if(Cr(n,e),Yr(e),l&4&&o!==null&&o.memoizedState.isDehydrated)try{ao(n.containerInfo)}catch(Qe){Lt(e,e.return,Qe)}break;case 4:Cr(n,e),Yr(e);break;case 13:Cr(n,e),Yr(e),p=e.child,p.flags&8192&&(g=p.memoizedState!==null,p.stateNode.isHidden=g,!g||p.alternate!==null&&p.alternate.memoizedState!==null||($c=yt())),l&4&&wp(e);break;case 22:if(je=o!==null&&o.memoizedState!==null,e.mode&1?(wn=(ye=wn)||je,Cr(n,e),wn=ye):Cr(n,e),Yr(e),l&8192){if(ye=e.memoizedState!==null,(e.stateNode.isHidden=ye)&&!je&&(e.mode&1)!==0)for(We=e,je=e.child;je!==null;){for(Me=We=je;We!==null;){switch(Pe=We,Ke=Pe.child,Pe.tag){case 0:case 11:case 14:case 15:fa(4,Pe,Pe.return);break;case 1:vs(Pe,Pe.return);var Ye=Pe.stateNode;if(typeof Ye.componentWillUnmount=="function"){l=Pe,o=Pe.return;try{n=l,Ye.props=n.memoizedProps,Ye.state=n.memoizedState,Ye.componentWillUnmount()}catch(Qe){Lt(l,o,Qe)}}break;case 5:vs(Pe,Pe.return);break;case 22:if(Pe.memoizedState!==null){kp(Me);continue}}Ke!==null?(Ke.return=Pe,We=Ke):kp(Me)}je=je.sibling}e:for(je=null,Me=e;;){if(Me.tag===5){if(je===null){je=Me;try{p=Me.stateNode,ye?(g=p.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none"):(D=Me.stateNode,K=Me.memoizedProps.style,E=K!=null&&K.hasOwnProperty("display")?K.display:null,D.style.display=hr("display",E))}catch(Qe){Lt(e,e.return,Qe)}}}else if(Me.tag===6){if(je===null)try{Me.stateNode.nodeValue=ye?"":Me.memoizedProps}catch(Qe){Lt(e,e.return,Qe)}}else if((Me.tag!==22&&Me.tag!==23||Me.memoizedState===null||Me===e)&&Me.child!==null){Me.child.return=Me,Me=Me.child;continue}if(Me===e)break e;for(;Me.sibling===null;){if(Me.return===null||Me.return===e)break e;je===Me&&(je=null),Me=Me.return}je===Me&&(je=null),Me.sibling.return=Me.return,Me=Me.sibling}}break;case 19:Cr(n,e),Yr(e),l&4&&wp(e);break;case 21:break;default:Cr(n,e),Yr(e)}}function Yr(e){var n=e.flags;if(n&2){try{e:{for(var o=e.return;o!==null;){if(yp(o)){var l=o;break e}o=o.return}throw Error(i(160))}switch(l.tag){case 5:var p=l.stateNode;l.flags&32&&(_n(p,""),l.flags&=-33);var g=vp(e);Mc(e,g,p);break;case 3:case 4:var E=l.stateNode.containerInfo,D=vp(e);Tc(e,D,E);break;default:throw Error(i(161))}}catch(K){Lt(e,e.return,K)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function My(e,n,o){We=e,Sp(e)}function Sp(e,n,o){for(var l=(e.mode&1)!==0;We!==null;){var p=We,g=p.child;if(p.tag===22&&l){var E=p.memoizedState!==null||El;if(!E){var D=p.alternate,K=D!==null&&D.memoizedState!==null||wn;D=El;var ye=wn;if(El=E,(wn=K)&&!ye)for(We=p;We!==null;)E=We,K=E.child,E.tag===22&&E.memoizedState!==null?Ep(p):K!==null?(K.return=E,We=K):Ep(p);for(;g!==null;)We=g,Sp(g),g=g.sibling;We=p,El=D,wn=ye}bp(e)}else(p.subtreeFlags&8772)!==0&&g!==null?(g.return=p,We=g):bp(e)}}function bp(e){for(;We!==null;){var n=We;if((n.flags&8772)!==0){var o=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:wn||Nl(5,n);break;case 1:var l=n.stateNode;if(n.flags&4&&!wn)if(o===null)l.componentDidMount();else{var p=n.elementType===n.type?o.memoizedProps:Er(n.type,o.memoizedProps);l.componentDidUpdate(p,o.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var g=n.updateQueue;g!==null&&kd(n,g,l);break;case 3:var E=n.updateQueue;if(E!==null){if(o=null,n.child!==null)switch(n.child.tag){case 5:o=n.child.stateNode;break;case 1:o=n.child.stateNode}kd(n,E,o)}break;case 5:var D=n.stateNode;if(o===null&&n.flags&4){o=D;var K=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":K.autoFocus&&o.focus();break;case"img":K.src&&(o.src=K.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var ye=n.alternate;if(ye!==null){var je=ye.memoizedState;if(je!==null){var Me=je.dehydrated;Me!==null&&ao(Me)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}wn||n.flags&512&&jc(n)}catch(Pe){Lt(n,n.return,Pe)}}if(n===e){We=null;break}if(o=n.sibling,o!==null){o.return=n.return,We=o;break}We=n.return}}function kp(e){for(;We!==null;){var n=We;if(n===e){We=null;break}var o=n.sibling;if(o!==null){o.return=n.return,We=o;break}We=n.return}}function Ep(e){for(;We!==null;){var n=We;try{switch(n.tag){case 0:case 11:case 15:var o=n.return;try{Nl(4,n)}catch(K){Lt(n,o,K)}break;case 1:var l=n.stateNode;if(typeof l.componentDidMount=="function"){var p=n.return;try{l.componentDidMount()}catch(K){Lt(n,p,K)}}var g=n.return;try{jc(n)}catch(K){Lt(n,g,K)}break;case 5:var E=n.return;try{jc(n)}catch(K){Lt(n,E,K)}}}catch(K){Lt(n,n.return,K)}if(n===e){We=null;break}var D=n.sibling;if(D!==null){D.return=n.return,We=D;break}We=n.return}}var Iy=Math.ceil,Cl=R.ReactCurrentDispatcher,Ic=R.ReactCurrentOwner,fr=R.ReactCurrentBatchConfig,xt=0,tn=null,Kt=null,un=0,Qn=0,xs=Wo(0),Qt=0,da=null,Pi=0,Pl=0,Ac=0,pa=null,zn=null,$c=0,ws=1/0,Eo=null,jl=!1,Oc=null,Jo=null,Tl=!1,ei=null,Ml=0,ha=0,Rc=null,Il=-1,Al=0;function Tn(){return(xt&6)!==0?yt():Il!==-1?Il:Il=yt()}function ti(e){return(e.mode&1)===0?1:(xt&2)!==0&&un!==0?un&-un:my.transition!==null?(Al===0&&(Al=Br()),Al):(e=wt,e!==0||(e=window.event,e=e===void 0?16:qi(e.type)),e)}function Pr(e,n,o,l){if(50<ha)throw ha=0,Rc=null,Error(i(185));sr(e,o,l),((xt&2)===0||e!==tn)&&(e===tn&&((xt&2)===0&&(Pl|=o),Qt===4&&ni(e,un)),Ln(e,l),o===1&&xt===0&&(n.mode&1)===0&&(ws=yt()+500,al&&Xo()))}function Ln(e,n){var o=e.callbackNode;oo(e,n);var l=vt(e,e===tn?un:0);if(l===0)o!==null&&Io(o),e.callbackNode=null,e.callbackPriority=0;else if(n=l&-l,e.callbackPriority!==n){if(o!=null&&Io(o),n===1)e.tag===0?hy(Cp.bind(null,e)):dd(Cp.bind(null,e)),cy(function(){(xt&6)===0&&Xo()}),o=null;else{switch(Ba(l)){case 1:o=zr;break;case 4:o=Ao;break;case 16:o=Lr;break;case 536870912:o=fi;break;default:o=Lr}o=Op(o,Np.bind(null,e))}e.callbackPriority=n,e.callbackNode=o}}function Np(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 l=vt(e,e===tn?un:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||n)n=$l(e,l);else{n=l;var p=xt;xt|=2;var g=jp();(tn!==e||un!==n)&&(Eo=null,ws=yt()+500,Ti(e,n));do try{Oy();break}catch(D){Pp(e,D)}while(!0);ec(),Cl.current=g,xt=p,Kt!==null?n=0:(tn=null,un=0,n=Qt)}if(n!==0){if(n===2&&(p=ir(e),p!==0&&(l=p,n=Dc(e,p))),n===1)throw o=da,Ti(e,0),ni(e,l),Ln(e,yt()),o;if(n===6)ni(e,l);else{if(p=e.current.alternate,(l&30)===0&&!Ay(p)&&(n=$l(e,l),n===2&&(g=ir(e),g!==0&&(l=g,n=Dc(e,g))),n===1))throw o=da,Ti(e,0),ni(e,l),Ln(e,yt()),o;switch(e.finishedWork=p,e.finishedLanes=l,n){case 0:case 1:throw Error(i(345));case 2:Mi(e,zn,Eo);break;case 3:if(ni(e,l),(l&130023424)===l&&(n=$c+500-yt(),10<n)){if(vt(e,0)!==0)break;if(p=e.suspendedLanes,(p&l)!==l){Tn(),e.pingedLanes|=e.suspendedLanes&p;break}e.timeoutHandle=Vu(Mi.bind(null,e,zn,Eo),n);break}Mi(e,zn,Eo);break;case 4:if(ni(e,l),(l&4194240)===l)break;for(n=e.eventTimes,p=-1;0<l;){var E=31-hn(l);g=1<<E,E=n[E],E>p&&(p=E),l&=~g}if(l=p,l=yt()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Iy(l/1960))-l,10<l){e.timeoutHandle=Vu(Mi.bind(null,e,zn,Eo),l);break}Mi(e,zn,Eo);break;case 5:Mi(e,zn,Eo);break;default:throw Error(i(329))}}}return Ln(e,yt()),e.callbackNode===o?Np.bind(null,e):null}function Dc(e,n){var o=pa;return e.current.memoizedState.isDehydrated&&(Ti(e,n).flags|=256),e=$l(e,n),e!==2&&(n=zn,zn=o,n!==null&&zc(n)),e}function zc(e){zn===null?zn=e:zn.push.apply(zn,e)}function Ay(e){for(var n=e;;){if(n.flags&16384){var o=n.updateQueue;if(o!==null&&(o=o.stores,o!==null))for(var l=0;l<o.length;l++){var p=o[l],g=p.getSnapshot;p=p.value;try{if(!se(g(),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 ni(e,n){for(n&=~Ac,n&=~Pl,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var o=31-hn(n),l=1<<o;e[o]=-1,n&=~l}}function Cp(e){if((xt&6)!==0)throw Error(i(327));_s();var n=vt(e,0);if((n&1)===0)return Ln(e,yt()),null;var o=$l(e,n);if(e.tag!==0&&o===2){var l=ir(e);l!==0&&(n=l,o=Dc(e,l))}if(o===1)throw o=da,Ti(e,0),ni(e,n),Ln(e,yt()),o;if(o===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,Mi(e,zn,Eo),Ln(e,yt()),null}function Lc(e,n){var o=xt;xt|=1;try{return e(n)}finally{xt=o,xt===0&&(ws=yt()+500,al&&Xo())}}function ji(e){ei!==null&&ei.tag===0&&(xt&6)===0&&_s();var n=xt;xt|=1;var o=fr.transition,l=wt;try{if(fr.transition=null,wt=1,e)return e()}finally{wt=l,fr.transition=o,xt=n,(xt&6)===0&&Xo()}}function Fc(){Qn=xs.current,Mt(xs)}function Ti(e,n){e.finishedWork=null,e.finishedLanes=0;var o=e.timeoutHandle;if(o!==-1&&(e.timeoutHandle=-1,uy(o)),Kt!==null)for(o=Kt.return;o!==null;){var l=o;switch(Xu(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&il();break;case 3:gs(),Mt(On),Mt(yn),lc();break;case 5:sc(l);break;case 4:gs();break;case 13:Mt(Dt);break;case 19:Mt(Dt);break;case 10:tc(l.type._context);break;case 22:case 23:Fc()}o=o.return}if(tn=e,Kt=e=ri(e.current,null),un=Qn=n,Qt=0,da=null,Ac=Pl=Pi=0,zn=pa=null,Ei!==null){for(n=0;n<Ei.length;n++)if(o=Ei[n],l=o.interleaved,l!==null){o.interleaved=null;var p=l.next,g=o.pending;if(g!==null){var E=g.next;g.next=p,l.next=E}o.pending=l}Ei=null}return e}function Pp(e,n){do{var o=Kt;try{if(ec(),yl.current=_l,vl){for(var l=zt.memoizedState;l!==null;){var p=l.queue;p!==null&&(p.pending=null),l=l.next}vl=!1}if(Ci=0,en=Xt=zt=null,sa=!1,aa=0,Ic.current=null,o===null||o.return===null){Qt=1,da=n,Kt=null;break}e:{var g=e,E=o.return,D=o,K=n;if(n=un,D.flags|=32768,K!==null&&typeof K=="object"&&typeof K.then=="function"){var ye=K,je=D,Me=je.tag;if((je.mode&1)===0&&(Me===0||Me===11||Me===15)){var Pe=je.alternate;Pe?(je.updateQueue=Pe.updateQueue,je.memoizedState=Pe.memoizedState,je.lanes=Pe.lanes):(je.updateQueue=null,je.memoizedState=null)}var Ke=Jd(E);if(Ke!==null){Ke.flags&=-257,ep(Ke,E,D,g,n),Ke.mode&1&&Zd(g,ye,n),n=Ke,K=ye;var Ye=n.updateQueue;if(Ye===null){var Qe=new Set;Qe.add(K),n.updateQueue=Qe}else Ye.add(K);break e}else{if((n&1)===0){Zd(g,ye,n),Bc();break e}K=Error(i(426))}}else if($t&&D.mode&1){var Bt=Jd(E);if(Bt!==null){(Bt.flags&65536)===0&&(Bt.flags|=256),ep(Bt,E,D,g,n),Zu(ys(K,D));break e}}g=K=ys(K,D),Qt!==4&&(Qt=2),pa===null?pa=[g]:pa.push(g),g=E;do{switch(g.tag){case 3:g.flags|=65536,n&=-n,g.lanes|=n;var de=Qd(g,K,n);bd(g,de);break e;case 1:D=K;var ee=g.type,me=g.stateNode;if((g.flags&128)===0&&(typeof ee.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(Jo===null||!Jo.has(me)))){g.flags|=65536,n&=-n,g.lanes|=n;var De=Gd(g,D,n);bd(g,De);break e}}g=g.return}while(g!==null)}Mp(o)}catch(Ge){n=Ge,Kt===o&&o!==null&&(Kt=o=o.return);continue}break}while(!0)}function jp(){var e=Cl.current;return Cl.current=_l,e===null?_l:e}function Bc(){(Qt===0||Qt===3||Qt===2)&&(Qt=4),tn===null||(Pi&268435455)===0&&(Pl&268435455)===0||ni(tn,un)}function $l(e,n){var o=xt;xt|=2;var l=jp();(tn!==e||un!==n)&&(Eo=null,Ti(e,n));do try{$y();break}catch(p){Pp(e,p)}while(!0);if(ec(),xt=o,Cl.current=l,Kt!==null)throw Error(i(261));return tn=null,un=0,Qt}function $y(){for(;Kt!==null;)Tp(Kt)}function Oy(){for(;Kt!==null&&!Pt();)Tp(Kt)}function Tp(e){var n=$p(e.alternate,e,Qn);e.memoizedProps=e.pendingProps,n===null?Mp(e):Kt=n,Ic.current=null}function Mp(e){var n=e;do{var o=n.alternate;if(e=n.return,(n.flags&32768)===0){if(o=Cy(o,n,Qn),o!==null){Kt=o;return}}else{if(o=Py(o,n),o!==null){o.flags&=32767,Kt=o;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Qt=6,Kt=null;return}}if(n=n.sibling,n!==null){Kt=n;return}Kt=n=e}while(n!==null);Qt===0&&(Qt=5)}function Mi(e,n,o){var l=wt,p=fr.transition;try{fr.transition=null,wt=1,Ry(e,n,o,l)}finally{fr.transition=p,wt=l}return null}function Ry(e,n,o,l){do _s();while(ei!==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 g=o.lanes|o.childLanes;if(di(e,g),e===tn&&(Kt=tn=null,un=0),(o.subtreeFlags&2064)===0&&(o.flags&2064)===0||Tl||(Tl=!0,Op(Lr,function(){return _s(),null})),g=(o.flags&15990)!==0,(o.subtreeFlags&15990)!==0||g){g=fr.transition,fr.transition=null;var E=wt;wt=1;var D=xt;xt|=4,Ic.current=null,Ty(e,o),_p(o,e),oe(Bu),Ui=!!Fu,Bu=Fu=null,e.current=o,My(o),rr(),xt=D,wt=E,fr.transition=g}else e.current=o;if(Tl&&(Tl=!1,ei=e,Ml=p),g=e.pendingLanes,g===0&&(Jo=null),dt(o.stateNode),Ln(e,yt()),n!==null)for(l=e.onRecoverableError,o=0;o<n.length;o++)p=n[o],l(p.value,{componentStack:p.stack,digest:p.digest});if(jl)throw jl=!1,e=Oc,Oc=null,e;return(Ml&1)!==0&&e.tag!==0&&_s(),g=e.pendingLanes,(g&1)!==0?e===Rc?ha++:(ha=0,Rc=e):ha=0,Xo(),null}function _s(){if(ei!==null){var e=Ba(Ml),n=fr.transition,o=wt;try{if(fr.transition=null,wt=16>e?16:e,ei===null)var l=!1;else{if(e=ei,ei=null,Ml=0,(xt&6)!==0)throw Error(i(331));var p=xt;for(xt|=4,We=e.current;We!==null;){var g=We,E=g.child;if((We.flags&16)!==0){var D=g.deletions;if(D!==null){for(var K=0;K<D.length;K++){var ye=D[K];for(We=ye;We!==null;){var je=We;switch(je.tag){case 0:case 11:case 15:fa(8,je,g)}var Me=je.child;if(Me!==null)Me.return=je,We=Me;else for(;We!==null;){je=We;var Pe=je.sibling,Ke=je.return;if(gp(je),je===ye){We=null;break}if(Pe!==null){Pe.return=Ke,We=Pe;break}We=Ke}}}var Ye=g.alternate;if(Ye!==null){var Qe=Ye.child;if(Qe!==null){Ye.child=null;do{var Bt=Qe.sibling;Qe.sibling=null,Qe=Bt}while(Qe!==null)}}We=g}}if((g.subtreeFlags&2064)!==0&&E!==null)E.return=g,We=E;else e:for(;We!==null;){if(g=We,(g.flags&2048)!==0)switch(g.tag){case 0:case 11:case 15:fa(9,g,g.return)}var de=g.sibling;if(de!==null){de.return=g.return,We=de;break e}We=g.return}}var ee=e.current;for(We=ee;We!==null;){E=We;var me=E.child;if((E.subtreeFlags&2064)!==0&&me!==null)me.return=E,We=me;else e:for(E=ee;We!==null;){if(D=We,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:Nl(9,D)}}catch(Ge){Lt(D,D.return,Ge)}if(D===E){We=null;break e}var De=D.sibling;if(De!==null){De.return=D.return,We=De;break e}We=D.return}}if(xt=p,Xo(),Pn&&typeof Pn.onPostCommitFiberRoot=="function")try{Pn.onPostCommitFiberRoot(or,e)}catch{}l=!0}return l}finally{wt=o,fr.transition=n}}return!1}function Ip(e,n,o){n=ys(o,n),n=Qd(e,n,1),e=Go(e,n,1),n=Tn(),e!==null&&(sr(e,1,n),Ln(e,n))}function Lt(e,n,o){if(e.tag===3)Ip(e,e,o);else for(;n!==null;){if(n.tag===3){Ip(n,e,o);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Jo===null||!Jo.has(l))){e=ys(o,e),e=Gd(n,e,1),n=Go(n,e,1),e=Tn(),n!==null&&(sr(n,1,e),Ln(n,e));break}}n=n.return}}function Dy(e,n,o){var l=e.pingCache;l!==null&&l.delete(n),n=Tn(),e.pingedLanes|=e.suspendedLanes&o,tn===e&&(un&o)===o&&(Qt===4||Qt===3&&(un&130023424)===un&&500>yt()-$c?Ti(e,0):Ac|=o),Ln(e,n)}function Ap(e,n){n===0&&((e.mode&1)===0?n=1:(n=ro,ro<<=1,(ro&130023424)===0&&(ro=4194304)));var o=Tn();e=So(e,n),e!==null&&(sr(e,n,o),Ln(e,o))}function zy(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),Ap(e,o)}function Ly(e,n){var o=0;switch(e.tag){case 13:var l=e.stateNode,p=e.memoizedState;p!==null&&(o=p.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(i(314))}l!==null&&l.delete(n),Ap(e,o)}var $p;$p=function(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps||On.current)Dn=!0;else{if((e.lanes&o)===0&&(n.flags&128)===0)return Dn=!1,Ny(e,n,o);Dn=(e.flags&131072)!==0}else Dn=!1,$t&&(n.flags&1048576)!==0&&pd(n,ul,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;kl(e,n),e=n.pendingProps;var p=us(n,yn.current);ms(n,o),p=fc(null,n,l,e,p,o);var g=dc();return n.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Rn(l)?(g=!0,sl(n)):g=!1,n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,oc(n),p.updater=Sl,n.stateNode=p,p._reactInternals=n,vc(n,l,e,o),n=Sc(null,n,l,!0,g,o)):(n.tag=0,$t&&g&&Yu(n),jn(null,n,p,o),n=n.child),n;case 16:l=n.elementType;e:{switch(kl(e,n),e=n.pendingProps,p=l._init,l=p(l._payload),n.type=l,p=n.tag=By(l),e=Er(l,e),p){case 0:n=_c(null,n,l,e,o);break e;case 1:n=sp(null,n,l,e,o);break e;case 11:n=tp(null,n,l,e,o);break e;case 14:n=np(null,n,l,Er(l.type,e),o);break e}throw Error(i(306,l,""))}return n;case 0:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Er(l,p),_c(e,n,l,p,o);case 1:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Er(l,p),sp(e,n,l,p,o);case 3:e:{if(ap(n),e===null)throw Error(i(387));l=n.pendingProps,g=n.memoizedState,p=g.element,Sd(e,n),ml(n,l,null,o);var E=n.memoizedState;if(l=E.element,g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=g,n.memoizedState=g,n.flags&256){p=ys(Error(i(423)),n),n=lp(e,n,l,o,p);break e}else if(l!==p){p=ys(Error(i(424)),n),n=lp(e,n,l,o,p);break e}else for(Xn=qo(n.stateNode.containerInfo.firstChild),Yn=n,$t=!0,kr=null,o=wd(n,null,l,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ds(),l===p){n=ko(e,n,o);break e}jn(e,n,l,o)}n=n.child}return n;case 5:return Ed(n),e===null&&Gu(n),l=n.type,p=n.pendingProps,g=e!==null?e.memoizedProps:null,E=p.children,Hu(l,p)?E=null:g!==null&&Hu(l,g)&&(n.flags|=32),ip(e,n),jn(e,n,E,o),n.child;case 6:return e===null&&Gu(n),null;case 13:return up(e,n,o);case 4:return ic(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=ps(n,null,l,o):jn(e,n,l,o),n.child;case 11:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Er(l,p),tp(e,n,l,p,o);case 7:return jn(e,n,n.pendingProps,o),n.child;case 8:return jn(e,n,n.pendingProps.children,o),n.child;case 12:return jn(e,n,n.pendingProps.children,o),n.child;case 10:e:{if(l=n.type._context,p=n.pendingProps,g=n.memoizedProps,E=p.value,Et(dl,l._currentValue),l._currentValue=E,g!==null)if(se(g.value,E)){if(g.children===p.children&&!On.current){n=ko(e,n,o);break e}}else for(g=n.child,g!==null&&(g.return=n);g!==null;){var D=g.dependencies;if(D!==null){E=g.child;for(var K=D.firstContext;K!==null;){if(K.context===l){if(g.tag===1){K=bo(-1,o&-o),K.tag=2;var ye=g.updateQueue;if(ye!==null){ye=ye.shared;var je=ye.pending;je===null?K.next=K:(K.next=je.next,je.next=K),ye.pending=K}}g.lanes|=o,K=g.alternate,K!==null&&(K.lanes|=o),nc(g.return,o,n),D.lanes|=o;break}K=K.next}}else if(g.tag===10)E=g.type===n.type?null:g.child;else if(g.tag===18){if(E=g.return,E===null)throw Error(i(341));E.lanes|=o,D=E.alternate,D!==null&&(D.lanes|=o),nc(E,o,n),E=g.sibling}else E=g.child;if(E!==null)E.return=g;else for(E=g;E!==null;){if(E===n){E=null;break}if(g=E.sibling,g!==null){g.return=E.return,E=g;break}E=E.return}g=E}jn(e,n,p.children,o),n=n.child}return n;case 9:return p=n.type,l=n.pendingProps.children,ms(n,o),p=ur(p),l=l(p),n.flags|=1,jn(e,n,l,o),n.child;case 14:return l=n.type,p=Er(l,n.pendingProps),p=Er(l.type,p),np(e,n,l,p,o);case 15:return rp(e,n,n.type,n.pendingProps,o);case 17:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Er(l,p),kl(e,n),n.tag=1,Rn(l)?(e=!0,sl(n)):e=!1,ms(n,o),Yd(n,l,p),vc(n,l,p,o),Sc(null,n,l,!0,e,o);case 19:return fp(e,n,o);case 22:return op(e,n,o)}throw Error(i(156,n.tag))};function Op(e,n){return ci(e,n)}function Fy(e,n,o,l){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dr(e,n,o,l){return new Fy(e,n,o,l)}function Hc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function By(e){if(typeof e=="function")return Hc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===le)return 11;if(e===ue)return 14}return 2}function ri(e,n){var o=e.alternate;return o===null?(o=dr(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 Ol(e,n,o,l,p,g){var E=2;if(l=e,typeof e=="function")Hc(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case U:return Ii(o.children,p,g,n);case pe:E=8,p|=8;break;case he:return e=dr(12,o,n,p|2),e.elementType=he,e.lanes=g,e;case xe:return e=dr(13,o,n,p),e.elementType=xe,e.lanes=g,e;case z:return e=dr(19,o,n,p),e.elementType=z,e.lanes=g,e;case ae:return Rl(o,p,g,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _e:E=10;break e;case Q:E=9;break e;case le:E=11;break e;case ue:E=14;break e;case te:E=16,l=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return n=dr(E,o,n,p),n.elementType=e,n.type=l,n.lanes=g,n}function Ii(e,n,o,l){return e=dr(7,e,l,n),e.lanes=o,e}function Rl(e,n,o,l){return e=dr(22,e,l,n),e.elementType=ae,e.lanes=o,e.stateNode={isHidden:!1},e}function Vc(e,n,o){return e=dr(6,e,null,n),e.lanes=o,e}function Kc(e,n,o){return n=dr(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Hy(e,n,o,l,p){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=io(0),this.expirationTimes=io(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=io(0),this.identifierPrefix=l,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Uc(e,n,o,l,p,g,E,D,K){return e=new Hy(e,n,o,D,K),n===1?(n=1,g===!0&&(n|=8)):n=0,g=dr(3,null,null,n),e.current=g,g.stateNode=e,g.memoizedState={element:l,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},oc(g),e}function Vy(e,n,o){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:V,key:l==null?null:""+l,children:e,containerInfo:n,implementation:o}}function Rp(e){if(!e)return Yo;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(Rn(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(i(171))}if(e.tag===1){var o=e.type;if(Rn(o))return cd(e,o,n)}return n}function Dp(e,n,o,l,p,g,E,D,K){return e=Uc(o,l,!0,e,p,g,E,D,K),e.context=Rp(null),o=e.current,l=Tn(),p=ti(o),g=bo(l,p),g.callback=n??null,Go(o,g,p),e.current.lanes=p,sr(e,p,l),Ln(e,l),e}function Dl(e,n,o,l){var p=n.current,g=Tn(),E=ti(p);return o=Rp(o),n.context===null?n.context=o:n.pendingContext=o,n=bo(g,E),n.payload={element:e},l=l===void 0?null:l,l!==null&&(n.callback=l),e=Go(p,n,E),e!==null&&(Pr(e,p,E,g),hl(e,p,E)),E}function zl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function zp(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function qc(e,n){zp(e,n),(e=e.alternate)&&zp(e,n)}function Ky(){return null}var Lp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Wc(e){this._internalRoot=e}Ll.prototype.render=Wc.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));Dl(e,n,null,null)},Ll.prototype.unmount=Wc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;ji(function(){Dl(null,e,null,null)}),n[vo]=null}};function Ll(e){this._internalRoot=e}Ll.prototype.unstable_scheduleHydration=function(e){if(e){var n=Va();e={blockedOn:null,target:e,priority:n};for(var o=0;o<An.length&&n!==0&&n<An[o].priority;o++);An.splice(o,0,e),o===0&&Wn(e)}};function Yc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Fl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Fp(){}function Uy(e,n,o,l,p){if(p){if(typeof l=="function"){var g=l;l=function(){var ye=zl(E);g.call(ye)}}var E=Dp(n,l,e,0,null,!1,!1,"",Fp);return e._reactRootContainer=E,e[vo]=E.current,Zs(e.nodeType===8?e.parentNode:e),ji(),E}for(;p=e.lastChild;)e.removeChild(p);if(typeof l=="function"){var D=l;l=function(){var ye=zl(K);D.call(ye)}}var K=Uc(e,0,!1,null,null,!1,!1,"",Fp);return e._reactRootContainer=K,e[vo]=K.current,Zs(e.nodeType===8?e.parentNode:e),ji(function(){Dl(n,K,o,l)}),K}function Bl(e,n,o,l,p){var g=o._reactRootContainer;if(g){var E=g;if(typeof p=="function"){var D=p;p=function(){var K=zl(E);D.call(K)}}Dl(n,E,e,p)}else E=Uy(o,n,e,p,l);return zl(E)}mt=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var o=qn(n.pendingLanes);o!==0&&(Oo(n,o|1),Ln(n,yt()),(xt&6)===0&&(ws=yt()+500,Xo()))}break;case 13:ji(function(){var l=So(e,1);if(l!==null){var p=Tn();Pr(l,e,1,p)}}),qc(e,1)}},Vi=function(e){if(e.tag===13){var n=So(e,134217728);if(n!==null){var o=Tn();Pr(n,e,134217728,o)}qc(e,134217728)}},Ha=function(e){if(e.tag===13){var n=ti(e),o=So(e,n);if(o!==null){var l=Tn();Pr(o,e,n,l)}qc(e,n)}},Va=function(){return wt},mn=function(e,n){var o=wt;try{return wt=e,n()}finally{wt=o}},Be=function(e,n,o){switch(n){case"input":if(kt(e,o),n=o.name,o.type==="radio"&&n!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<o.length;n++){var l=o[n];if(l!==e&&l.form===e.form){var p=ol(l);if(!p)throw Error(i(90));Fe(l),kt(l,p)}}}break;case"textarea":pr(e,o);break;case"select":n=o.value,n!=null&&Nt(e,!!o.multiple,n,!1)}},eo=Lc,W=ji;var qy={usingClientEntryPoint:!1,Events:[ta,as,ol,Rr,mr,Lc]},ma={findFiberByHostInstance:_i,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Wy={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=ui(e),e===null?null:e.stateNode},findFiberByHostInstance:ma.findFiberByHostInstance||Ky,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 Hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hl.isDisabled&&Hl.supportsFiber)try{or=Hl.inject(Wy),Pn=Hl}catch{}}return Fn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qy,Fn.createPortal=function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Yc(n))throw Error(i(200));return Vy(e,n,null,o)},Fn.createRoot=function(e,n){if(!Yc(e))throw Error(i(299));var o=!1,l="",p=Lp;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(p=n.onRecoverableError)),n=Uc(e,1,!1,null,null,o,!1,l,p),e[vo]=n.current,Zs(e.nodeType===8?e.parentNode:e),new Wc(n)},Fn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=ui(n),e=e===null?null:e.stateNode,e},Fn.flushSync=function(e){return ji(e)},Fn.hydrate=function(e,n,o){if(!Fl(n))throw Error(i(200));return Bl(null,e,n,!0,o)},Fn.hydrateRoot=function(e,n,o){if(!Yc(e))throw Error(i(405));var l=o!=null&&o.hydratedSources||null,p=!1,g="",E=Lp;if(o!=null&&(o.unstable_strictMode===!0&&(p=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),n=Dp(n,null,e,1,o??null,p,!1,g,E),e[vo]=n.current,Zs(e),l)for(e=0;e<l.length;e++)o=l[e],p=o._getVersion,p=p(o._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[o,p]:n.mutableSourceEagerHydrationData.push(o,p);return new Ll(n)},Fn.render=function(e,n,o){if(!Fl(n))throw Error(i(200));return Bl(null,e,n,!1,o)},Fn.unmountComponentAtNode=function(e){if(!Fl(e))throw Error(i(40));return e._reactRootContainer?(ji(function(){Bl(null,null,e,!1,function(){e._reactRootContainer=null,e[vo]=null})}),!0):!1},Fn.unstable_batchedUpdates=Lc,Fn.unstable_renderSubtreeIntoContainer=function(e,n,o,l){if(!Fl(o))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return Bl(e,n,o,!1,l)},Fn.version="18.3.1-next-f1338f8080-20240426",Fn}var Yp;function um(){if(Yp)return Gc.exports;Yp=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(),Gc.exports=r0(),Gc.exports}var Xp;function o0(){if(Xp)return Vl;Xp=1;var t=um();return Vl.createRoot=t.createRoot,Vl.hydrateRoot=t.hydrateRoot,Vl}var i0=o0();const s0=vu(i0),a0=["get","post","put","patch","delete","options","head","trace"];function Qp(t){return t.replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_|_$/g,"").replace(/_+/g,"_")}function xu(t,r,i,a){if(i)return Qp(i).replace(/^[0-9]/,"_$&")||`op_${a}`;const u=Qp(r.replace(/[{}]/g,""));return`${t}_${u}`||`op_${a}`}function wu(t){var a;return`${(((a=t.info)==null?void 0:a.title)??"Api").replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean).map(u=>u.charAt(0).toUpperCase()+u.slice(1).toLowerCase()).join("")||"Api"}Client`}function _u(t){return(t.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join("")||"Api")+"Service"}function Zr(t){const r=[];if(!t.paths)return r;for(const[i,a]of Object.entries(t.paths)){if(!a||typeof a!="object"||"$ref"in a)continue;const u=a;for(const f of a0){const d=u[f];d&&typeof d=="object"&&r.push({method:f,path:i,operationId:d.operationId,tags:d.tags})}}return r}function l0(t,r,i,a="baseUrl"){var f,d;const u=r.toUpperCase();return`const ${a} = "${((d=(f=t.servers)==null?void 0:f[0])==null?void 0:d.url)??"http://localhost:3000"}";
|
|
41
|
+
/** @returns {Promise<unknown>} */
|
|
42
|
+
const res = await fetch(\`${a}${i}\`, {
|
|
43
|
+
method: "${u}",
|
|
44
|
+
headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
|
|
45
|
+
${u==="GET"||u==="HEAD"?"":"body: JSON.stringify({}),"}
|
|
46
|
+
});
|
|
47
|
+
const data = await res.json();
|
|
48
|
+
`}function cm(t,r){const i=t.map((a,u)=>` /**
|
|
49
|
+
* @param {{ headers?: Record<string, string> }} [options]
|
|
50
|
+
* @returns {Promise<unknown>}
|
|
51
|
+
*/
|
|
52
|
+
async ${xu(a.method,a.path,a.operationId,u)}(options) {
|
|
53
|
+
const res = await fetch(\`\${this.baseUrl}${a.path}\`, {
|
|
54
|
+
method: "${a.method.toUpperCase()}",
|
|
55
|
+
headers: { ...this.defaultHeaders, ...options?.headers },
|
|
56
|
+
});
|
|
57
|
+
return res.json();
|
|
58
|
+
}`);return`export class ${r} {
|
|
59
|
+
/**
|
|
60
|
+
* @param {string} baseUrl
|
|
61
|
+
* @param {Record<string, string>} [defaultHeaders]
|
|
62
|
+
*/
|
|
63
|
+
constructor(baseUrl, defaultHeaders = {}) {
|
|
64
|
+
this.baseUrl = baseUrl;
|
|
65
|
+
this.defaultHeaders = defaultHeaders;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
${i.join(`
|
|
69
|
+
|
|
70
|
+
`)}
|
|
71
|
+
}
|
|
72
|
+
`}function u0(t){return cm(Zr(t),wu(t))}function c0(t,r){const i=_u(r),a=Zr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return cm(a,i)}function f0(t,r,i){var f,d;const a=((d=(f=t.servers)==null?void 0:f[0])==null?void 0:d.url)??"http://localhost:3000",u=r.toUpperCase();return`<?php
|
|
73
|
+
$baseUrl = '${a}';
|
|
74
|
+
$url = $baseUrl . '${i}';
|
|
75
|
+
$opts = [
|
|
76
|
+
'http' => [
|
|
77
|
+
'method' => '${u}',
|
|
78
|
+
'header' => "Content-Type: application/json\\r\\nAuthorization: Bearer {$token}\\r\\n",
|
|
79
|
+
${u==="GET"||u==="HEAD"?"":"'content' => json_encode([]),"}
|
|
80
|
+
],
|
|
81
|
+
];
|
|
82
|
+
$context = stream_context_create($opts);
|
|
83
|
+
$response = file_get_contents($url, false, $context);
|
|
84
|
+
$data = json_decode($response, true);
|
|
85
|
+
`}function fm(t,r){const i=t.map((a,u)=>` public function ${xu(a.method,a.path,a.operationId,u)}(array $extraHeaders = []): array
|
|
86
|
+
{
|
|
87
|
+
$url = $this->baseUrl . '${a.path}';
|
|
88
|
+
$headers = array_merge($this->defaultHeaders, $extraHeaders);
|
|
89
|
+
$opts = [
|
|
90
|
+
'http' => [
|
|
91
|
+
'method' => '${a.method.toUpperCase()}',
|
|
92
|
+
'header' => $this->formatHeaders($headers),
|
|
93
|
+
],
|
|
94
|
+
];
|
|
95
|
+
$ctx = stream_context_create($opts);
|
|
96
|
+
$raw = file_get_contents($url, false, $ctx);
|
|
97
|
+
return json_decode($raw ?: '[]', true) ?: [];
|
|
98
|
+
}`);return`<?php
|
|
99
|
+
|
|
100
|
+
declare(strict_types=1);
|
|
101
|
+
|
|
102
|
+
final class ${r}
|
|
103
|
+
{
|
|
104
|
+
public function __construct(
|
|
105
|
+
private string $baseUrl,
|
|
106
|
+
/** @var array<string, string> */
|
|
107
|
+
private array $defaultHeaders = [],
|
|
108
|
+
) {
|
|
109
|
+
$this->baseUrl = rtrim($baseUrl, '/');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** @param array<string, string> $headers */
|
|
113
|
+
private function formatHeaders(array $headers): string
|
|
114
|
+
{
|
|
115
|
+
$lines = [];
|
|
116
|
+
foreach ($headers as $k => $v) {
|
|
117
|
+
$lines[] = $k . ': ' . $v;
|
|
118
|
+
}
|
|
119
|
+
return implode("\\r\\n", $lines) . "\\r\\n";
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
${i.join(`
|
|
123
|
+
|
|
124
|
+
`)}
|
|
125
|
+
}
|
|
126
|
+
`}function d0(t){return fm(Zr(t),wu(t))}function p0(t,r){const i=_u(r),a=Zr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return fm(a,i)}function h0(t,r,i){var d,m;const a=((m=(d=t.servers)==null?void 0:d[0])==null?void 0:m.url)??"http://localhost:3000",u=r.toLowerCase();return`import httpx
|
|
127
|
+
|
|
128
|
+
base_url = "${a}"
|
|
129
|
+
url = f"{base_url}${i}"
|
|
130
|
+
headers = {"Authorization": f"Bearer {token}"}
|
|
131
|
+
with httpx.Client() as client:
|
|
132
|
+
response = client.${u}(url, headers=headers${u==="get"||u==="head"?"":", json={}"})
|
|
133
|
+
data = response.json()
|
|
134
|
+
`}function dm(t,r){const i=t.map((a,u)=>{const f=xu(a.method,a.path,a.operationId,u),d=a.method.toLowerCase(),m=d==="get"||d==="head"?"":", json={}";return` def ${f}(self, headers: dict | None = None) -> dict:
|
|
135
|
+
h = {**self.default_headers, **(headers or {})}
|
|
136
|
+
r = self._client.${d}(f"{self.base_url}${a.path}", headers=h${m})
|
|
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 m0(t){return dm(Zr(t),wu(t))}function g0(t,r){const i=_u(r),a=Zr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return dm(a,i)}function y0(t){const r=t.split("/");return(r[r.length-1]??"Unknown").replace(/[^a-zA-Z0-9_]/g,"_")}function yf(t){if(!t)return"unknown";if("$ref"in t&&t.$ref)return y0(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?`${yf(r.items)}[]`:r.type==="object"&&r.properties?`{
|
|
153
|
+
${Object.entries(r.properties).map(([a,u])=>` ${JSON.stringify(a)}?: ${yf(u)};`).join(`
|
|
154
|
+
`)}
|
|
155
|
+
}`:"Record<string, unknown>"}function v0(t,r,i,a="baseUrl"){var w,b,x,S,N,C;const u=(b=(w=t.paths)==null?void 0:w[i])==null?void 0:b[r],f=u==null?void 0:u.requestBody;let d;if((S=(x=f==null?void 0:f.content)==null?void 0:x["application/json"])!=null&&S.schema){const $=f.content["application/json"].schema;$&&!("$ref"in $)&&(d=$)}const m=d?yf(d):"Record<string, unknown>",v=r.toUpperCase();return`const ${a} = "${((C=(N=t.servers)==null?void 0:N[0])==null?void 0:C.url)??"http://localhost:3000"}";
|
|
156
|
+
const res = await fetch(\`${a}${i}\`, {
|
|
157
|
+
method: "${v}",
|
|
158
|
+
headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
|
|
159
|
+
${v==="GET"||v==="HEAD"?"":`body: JSON.stringify({} as ${m}),`}
|
|
160
|
+
});
|
|
161
|
+
const data = await res.json() as unknown;
|
|
162
|
+
`}function pm(t,r){const i=t.map((a,u)=>` async ${xu(a.method,a.path,a.operationId,u)}(options?: { headers?: Record<string, string> }): Promise<unknown> {
|
|
163
|
+
const res = await fetch(\`\${this.baseUrl}${a.path}\`, {
|
|
164
|
+
method: "${a.method.toUpperCase()}",
|
|
165
|
+
headers: { ...this.defaultHeaders, ...options?.headers },
|
|
166
|
+
});
|
|
167
|
+
return res.json();
|
|
168
|
+
}`);return`export class ${r} {
|
|
169
|
+
constructor(
|
|
170
|
+
private baseUrl: string,
|
|
171
|
+
private defaultHeaders: Record<string, string> = {},
|
|
172
|
+
) {}
|
|
173
|
+
|
|
174
|
+
${i.join(`
|
|
175
|
+
|
|
176
|
+
`)}
|
|
177
|
+
}
|
|
178
|
+
`}function x0(t){const r=Zr(t),i=wu(t);return pm(r,i)}function w0(t,r){const i=_u(r),a=Zr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return pm(a,i)}function _0(t,r,i,a){switch(r){case"typescript":return v0(t,i,a);case"javascript":return l0(t,i,a);case"python":return h0(t,i,a);case"php":return f0(t,i,a);default:{const u=r;throw new Error(`Unsupported language: ${u}`)}}}function S0(t,r,i){switch(r){case"typescript":return w0(t,i);case"javascript":return c0(t,i);case"python":return g0(t,i);case"php":return p0(t,i);default:{const a=r;throw new Error(`Unsupported language: ${a}`)}}}function b0(t,r,i){if(i===null)switch(r){case"typescript":return x0(t);case"javascript":return u0(t);case"python":return m0(t);case"php":return d0(t);default:{const a=r;throw new Error(`Unsupported language: ${a}`)}}return S0(t,r,i)}function k0(t){const r=new Set;for(const i of Zr(t))for(const a of i.tags??[])r.add(a);return r.size===0&&r.add("default"),[...r].sort()}function Ss(t,r){var i,a,u;return r!=null&&r.trim()?r.replace(/\/$/,""):((u=(a=(i=t.servers)==null?void 0:i[0])==null?void 0:a.url)==null?void 0:u.replace(/\/$/,""))??window.location.origin}function E0(t){var i;const r=(i=t.components)==null?void 0:i.securitySchemes;return r?Object.keys(r):[]}function $f(t,r){if(!r.startsWith("$"))return;let i=t;const a=r.slice(1);if(a.startsWith(".")){for(const u of a.slice(1).split("."))if(i&&typeof i=="object"&&u in i)i=i[u];else return;return i}return i}var Jl={exports:{}},N0=Jl.exports,Gp;function C0(){return Gp||(Gp=1,(function(t,r){((i,a)=>{t.exports=a()})(N0,function(){var i=function(s,c){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(h,y){h.__proto__=y}:function(h,y){for(var _ in y)Object.prototype.hasOwnProperty.call(y,_)&&(h[_]=y[_])}))(s,c)},a=function(){return(a=Object.assign||function(s){for(var c,h=1,y=arguments.length;h<y;h++)for(var _ in c=arguments[h])Object.prototype.hasOwnProperty.call(c,_)&&(s[_]=c[_]);return s}).apply(this,arguments)};function u(s,c,h){for(var y,_=0,k=c.length;_<k;_++)!y&&_ in c||((y=y||Array.prototype.slice.call(c,0,_))[_]=c[_]);return s.concat(y||Array.prototype.slice.call(c))}var f=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Gy,d=Object.keys,m=Array.isArray;function v(s,c){return typeof c=="object"&&d(c).forEach(function(h){s[h]=c[h]}),s}typeof Promise>"u"||f.Promise||(f.Promise=Promise);var w=Object.getPrototypeOf,b={}.hasOwnProperty;function x(s,c){return b.call(s,c)}function S(s,c){typeof c=="function"&&(c=c(w(s))),(typeof Reflect>"u"?d:Reflect.ownKeys)(c).forEach(function(h){C(s,h,c[h])})}var N=Object.defineProperty;function C(s,c,h,y){N(s,c,v(h&&x(h,"get")&&typeof h.get=="function"?{get:h.get,set:h.set,configurable:!0}:{value:h,configurable:!0,writable:!0},y))}function $(s){return{from:function(c){return s.prototype=Object.create(c.prototype),C(s.prototype,"constructor",s),{extend:S.bind(null,s.prototype)}}}}var M=Object.getOwnPropertyDescriptor,I=[].slice;function H(s,c,h){return I.call(s,c,h)}function j(s,c){return c(s)}function R(s){if(!s)throw new Error("Assertion Failed")}function q(s){f.setImmediate?setImmediate(s):setTimeout(s,0)}function V(s,c){if(typeof c=="string"&&x(s,c))return s[c];if(!c)return s;if(typeof c!="string"){for(var h=[],y=0,_=c.length;y<_;++y){var k=V(s,c[y]);h.push(k)}return h}var T,A=c.indexOf(".");return A===-1||(T=s[c.substr(0,A)])==null?void 0:V(T,c.substr(A+1))}function U(s,c,h){if(s&&c!==void 0&&!("isFrozen"in Object&&Object.isFrozen(s)))if(typeof c!="string"&&"length"in c){R(typeof h!="string"&&"length"in h);for(var y=0,_=c.length;y<_;++y)U(s,c[y],h[y])}else{var k,T,A=c.indexOf(".");A!==-1?(k=c.substr(0,A),(A=c.substr(A+1))===""?h===void 0?m(s)&&!isNaN(parseInt(k))?s.splice(k,1):delete s[k]:s[k]=h:U(T=(T=s[k])&&x(s,k)?T:s[k]={},A,h)):h===void 0?m(s)&&!isNaN(parseInt(c))?s.splice(c,1):delete s[c]:s[c]=h}}function pe(s){var c,h={};for(c in s)x(s,c)&&(h[c]=s[c]);return h}var he=[].concat;function _e(s){return he.apply([],s)}var B="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(_e([8,16,32,64].map(function(s){return["Int","Uint","Float"].map(function(c){return c+s+"Array"})}))).filter(function(s){return f[s]}),Q=new Set(B.map(function(s){return f[s]})),le=null;function xe(s){return le=new WeakMap,s=(function c(h){if(!h||typeof h!="object")return h;var y=le.get(h);if(y)return y;if(m(h)){y=[],le.set(h,y);for(var _=0,k=h.length;_<k;++_)y.push(c(h[_]))}else if(Q.has(h.constructor))y=h;else{var T,A=w(h);for(T in y=A===Object.prototype?{}:Object.create(A),le.set(h,y),h)x(h,T)&&(y[T]=c(h[T]))}return y})(s),le=null,s}var z={}.toString;function ue(s){return z.call(s).slice(8,-1)}var te=typeof Symbol<"u"?Symbol.iterator:"@@iterator",ae=typeof te=="symbol"?function(s){var c;return s!=null&&(c=s[te])&&c.apply(s)}:function(){return null};function L(s,c){c=s.indexOf(c),0<=c&&s.splice(c,1)}var F={};function X(s){var c,h,y,_;if(arguments.length===1){if(m(s))return s.slice();if(this===F&&typeof s=="string")return[s];if(_=ae(s))for(h=[];!(y=_.next()).done;)h.push(y.value);else{if(s==null)return[s];if(typeof(c=s.length)!="number")return[s];for(h=new Array(c);c--;)h[c]=s[c]}}else for(c=arguments.length,h=new Array(c);c--;)h[c]=arguments[c];return h}var O=typeof Symbol<"u"?function(s){return s[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},B=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Ct=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(B),ke={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 Se(s,c){this.name=s,this.message=c}function Ie(s,c){return s+". Errors: "+Object.keys(c).map(function(h){return c[h].toString()}).filter(function(h,y,_){return _.indexOf(h)===y}).join(`
|
|
179
|
+
`)}function Re(s,c,h,y){this.failures=c,this.failedKeys=y,this.successCount=h,this.message=Ie(s,c)}function Ae(s,c){this.name="BulkError",this.failures=Object.keys(c).map(function(h){return c[h]}),this.failuresByPos=c,this.message=Ie(s,this.failures)}$(Se).from(Error).extend({toString:function(){return this.name+": "+this.message}}),$(Re).from(Se),$(Ae).from(Se);var we=Ct.reduce(function(s,c){return s[c]=c+"Error",s},{}),ze=Se,be=Ct.reduce(function(s,c){var h=c+"Error";function y(_,k){this.name=h,_?typeof _=="string"?(this.message="".concat(_).concat(k?`
|
|
180
|
+
`+k:""),this.inner=k||null):typeof _=="object"&&(this.message="".concat(_.name," ").concat(_.message),this.inner=_):(this.message=ke[c]||h,this.inner=null)}return $(y).from(ze),s[c]=y,s},{}),Je=(be.Syntax=SyntaxError,be.Type=TypeError,be.Range=RangeError,B.reduce(function(s,c){return s[c+"Error"]=be[c],s},{}));B=Ct.reduce(function(s,c){return["Syntax","Type","Range"].indexOf(c)===-1&&(s[c+"Error"]=be[c]),s},{});function Fe(){}function Ve(s){return s}function ct(s,c){return s==null||s===Ve?c:function(h){return c(s(h))}}function nt(s,c){return function(){s.apply(this,arguments),c.apply(this,arguments)}}function ft(s,c){return s===Fe?c:function(){var h=s.apply(this,arguments),y=(h!==void 0&&(arguments[0]=h),this.onsuccess),_=this.onerror,k=(this.onsuccess=null,this.onerror=null,c.apply(this,arguments));return y&&(this.onsuccess=this.onsuccess?nt(y,this.onsuccess):y),_&&(this.onerror=this.onerror?nt(_,this.onerror):_),k!==void 0?k:h}}function kt(s,c){return s===Fe?c:function(){s.apply(this,arguments);var h=this.onsuccess,y=this.onerror;this.onsuccess=this.onerror=null,c.apply(this,arguments),h&&(this.onsuccess=this.onsuccess?nt(h,this.onsuccess):h),y&&(this.onerror=this.onerror?nt(y,this.onerror):y)}}function rn(s,c){return s===Fe?c:function(_){var y=s.apply(this,arguments),_=(v(_,y),this.onsuccess),k=this.onerror,T=(this.onsuccess=null,this.onerror=null,c.apply(this,arguments));return _&&(this.onsuccess=this.onsuccess?nt(_,this.onsuccess):_),k&&(this.onerror=this.onerror?nt(k,this.onerror):k),y===void 0?T===void 0?void 0:T:v(y,T)}}function Gt(s,c){return s===Fe?c:function(){return c.apply(this,arguments)!==!1&&s.apply(this,arguments)}}function qt(s,c){return s===Fe?c:function(){var h=s.apply(this,arguments);if(h&&typeof h.then=="function"){for(var y=this,_=arguments.length,k=new Array(_);_--;)k[_]=arguments[_];return h.then(function(){return c.apply(y,k)})}return c.apply(this,arguments)}}B.ModifyError=Re,B.DexieError=Se,B.BulkError=Ae;var Nt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Mn(s){Nt=s}var cn={},pr=100,fn=typeof Promise>"u"?[]:(Ct=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[fn=crypto.subtle.digest("SHA-512",new Uint8Array([0])),w(fn),Ct]:[Ct,w(Ct),Ct]),Ct=fn[0],po=fn[1],po=po&&po.then,Wt=Ct&&Ct.constructor,Hn=!!fn[2],Jn=function(s,c){Vn.push([s,c]),Yt&&(queueMicrotask(W),Yt=!1)},_n=!0,Yt=!0,Sn=[],hr=[],$r=Ve,bn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Fe,pgp:!1,env:{},finalize:Fe},qe=bn,Vn=[],kn=0,er=[];function Be(s){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var c=this._PSD=qe;if(typeof s!="function"){if(s!==cn)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Or(this,this._value)}else this._state=null,this._value=null,++c.ref,(function h(y,_){try{_(function(k){if(y._state===null){if(k===y)throw new TypeError("A promise cannot be resolved with itself.");var T=y._lib&&Le();k&&typeof k.then=="function"?h(y,function(A,G){k instanceof Be?k._then(A,G):k.then(A,G)}):(y._state=!0,y._value=k,Rr(y)),T&&Xe()}},Or.bind(null,y))}catch(k){Or(y,k)}})(this,s)}var In={get:function(){var s=qe,c=Un;function h(y,_){var k=this,T=!s.global&&(s!==qe||c!==Un),A=T&&!Ft(),G=new Be(function(se,J){mr(k,new Kn(ci(y,s,T,A),ci(_,s,T,A),se,J,s))});return this._consoleTask&&(G._consoleTask=this._consoleTask),G}return h.prototype=cn,h},set:function(s){C(this,"then",s&&s.prototype===cn?In:{get:function(){return s},set:In.set})}};function Kn(s,c,h,y,_){this.onFulfilled=typeof s=="function"?s:null,this.onRejected=typeof c=="function"?c:null,this.resolve=h,this.reject=y,this.psd=_}function Or(s,c){var h,y;hr.push(c),s._state===null&&(h=s._lib&&Le(),c=$r(c),s._state=!1,s._value=c,y=s,Sn.some(function(_){return _._value===y._value})||Sn.push(y),Rr(s),h)&&Xe()}function Rr(s){var c=s._listeners;s._listeners=[];for(var h=0,y=c.length;h<y;++h)mr(s,c[h]);var _=s._PSD;--_.ref||_.finalize(),kn===0&&(++kn,Jn(function(){--kn==0&<()},[]))}function mr(s,c){if(s._state===null)s._listeners.push(c);else{var h=s._state?c.onFulfilled:c.onRejected;if(h===null)return(s._state?c.resolve:c.reject)(s._value);++c.psd.ref,++kn,Jn(eo,[h,s,c])}}function eo(s,c,h){try{var y,_=c._value;!c._state&&hr.length&&(hr=[]),y=Nt&&c._consoleTask?c._consoleTask.run(function(){return s(_)}):s(_),c._state||hr.indexOf(_)!==-1||(k=>{for(var T=Sn.length;T;)if(Sn[--T]._value===k._value)return Sn.splice(T,1)})(c),h.resolve(y)}catch(k){h.reject(k)}finally{--kn==0&<(),--h.psd.ref||h.psd.finalize()}}function W(){nr(bn,function(){Le()&&Xe()})}function Le(){var s=_n;return Yt=_n=!1,s}function Xe(){var s,c,h;do for(;0<Vn.length;)for(s=Vn,Vn=[],h=s.length,c=0;c<h;++c){var y=s[c];y[0].apply(null,y[1])}while(0<Vn.length);Yt=_n=!0}function lt(){for(var s=Sn,c=(Sn=[],s.forEach(function(y){y._PSD.onunhandled.call(null,y._value,y)}),er.slice(0)),h=c.length;h;)c[--h]()}function Ht(s){return new Be(cn,!1,s)}function ut(s,c){var h=qe;return function(){var y=Le(),_=qe;try{return tr(h,!0),s.apply(this,arguments)}catch(k){c&&c(k)}finally{tr(_,!1),y&&Xe()}}}S(Be.prototype,{then:In,_then:function(s,c){mr(this,new Kn(null,null,s,c,qe))},catch:function(s){var c,h;return arguments.length===1?this.then(null,s):(c=s,h=arguments[1],typeof c=="function"?this.then(null,function(y){return(y instanceof c?h:Ht)(y)}):this.then(null,function(y){return(y&&y.name===c?h:Ht)(y)}))},finally:function(s){return this.then(function(c){return Be.resolve(s()).then(function(){return c})},function(c){return Be.resolve(s()).then(function(){return Ht(c)})})},timeout:function(s,c){var h=this;return s<1/0?new Be(function(y,_){var k=setTimeout(function(){return _(new be.Timeout(c))},s);h.then(y,_).finally(clearTimeout.bind(null,k))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&C(Be.prototype,Symbol.toStringTag,"Dexie.Promise"),bn.env=ui(),S(Be,{all:function(){var s=X.apply(null,arguments).map(Dr);return new Be(function(c,h){s.length===0&&c([]);var y=s.length;s.forEach(function(_,k){return Be.resolve(_).then(function(T){s[k]=T,--y||c(s)},h)})})},resolve:function(s){return s instanceof Be?s:s&&typeof s.then=="function"?new Be(function(c,h){s.then(c,h)}):new Be(cn,!0,s)},reject:Ht,race:function(){var s=X.apply(null,arguments).map(Dr);return new Be(function(c,h){s.map(function(y){return Be.resolve(y).then(c,h)})})},PSD:{get:function(){return qe},set:function(s){return qe=s}},totalEchoes:{get:function(){return Un}},newPSD:Nn,usePSD:nr,scheduler:{get:function(){return Jn},set:function(s){Jn=s}},rejectionMapper:{get:function(){return $r},set:function(s){$r=s}},follow:function(s,c){return new Be(function(h,y){return Nn(function(_,k){var T=qe;T.unhandleds=[],T.onunhandled=k,T.finalize=nt(function(){var A,G=this;A=function(){G.unhandleds.length===0?_():k(G.unhandleds[0])},er.push(function se(){A(),er.splice(er.indexOf(se),1)}),++kn,Jn(function(){--kn==0&<()},[])},T.finalize),s()},c,h,y)})}}),Wt&&(Wt.allSettled&&C(Be,"allSettled",function(){var s=X.apply(null,arguments).map(Dr);return new Be(function(c){s.length===0&&c([]);var h=s.length,y=new Array(h);s.forEach(function(_,k){return Be.resolve(_).then(function(T){return y[k]={status:"fulfilled",value:T}},function(T){return y[k]={status:"rejected",reason:T}}).then(function(){return--h||c(y)})})})}),Wt.any&&typeof AggregateError<"u"&&C(Be,"any",function(){var s=X.apply(null,arguments).map(Dr);return new Be(function(c,h){s.length===0&&h(new AggregateError([]));var y=s.length,_=new Array(y);s.forEach(function(k,T){return Be.resolve(k).then(function(A){return c(A)},function(A){_[T]=A,--y||h(new AggregateError(_))})})})}),Wt.withResolvers)&&(Be.withResolvers=Wt.withResolvers);var St={awaits:0,echoes:0,id:0},dn=0,En=[],pn=0,Un=0,Mo=0;function Nn(s,T,h,y){var _=qe,k=Object.create(_),T=(k.parent=_,k.ref=0,k.global=!1,k.id=++Mo,bn.env,k.env=Hn?{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}:{},T&&v(k,T),++_.ref,k.finalize=function(){--this.parent.ref||this.parent.finalize()},nr(k,s,h,y));return k.ref===0&&k.finalize(),T}function Cn(){return St.id||(St.id=++dn),++St.awaits,St.echoes+=pr,St.id}function Ft(){return!!St.awaits&&(--St.awaits==0&&(St.id=0),St.echoes=St.awaits*pr,!0)}function Dr(s){return St.echoes&&s&&s.constructor===Wt?(Cn(),s.then(function(c){return Ft(),c},function(c){return Ft(),Pt(c)})):s}function li(){var s=En[En.length-1];En.pop(),tr(s,!1)}function tr(s,c){var h,y,_=qe;(c?!St.echoes||pn++&&s===qe:!pn||--pn&&s===qe)||queueMicrotask(c?(function(k){++Un,St.echoes&&--St.echoes!=0||(St.echoes=St.awaits=St.id=0),En.push(qe),tr(k,!0)}).bind(null,s):li),s!==qe&&(qe=s,_===bn&&(bn.env=ui()),Hn)&&(h=bn.env.Promise,y=s.env,_.global||s.global)&&(Object.defineProperty(f,"Promise",y.PromiseProp),h.all=y.all,h.race=y.race,h.resolve=y.resolve,h.reject=y.reject,y.allSettled&&(h.allSettled=y.allSettled),y.any)&&(h.any=y.any)}function ui(){var s=f.Promise;return Hn?{Promise:s,PromiseProp:Object.getOwnPropertyDescriptor(f,"Promise"),all:s.all,race:s.race,allSettled:s.allSettled,any:s.any,resolve:s.resolve,reject:s.reject}:{}}function nr(s,c,h,y,_){var k=qe;try{return tr(s,!0),c(h,y,_)}finally{tr(k,!1)}}function ci(s,c,h,y){return typeof s!="function"?s:function(){var _=qe;h&&Cn(),tr(c,!0);try{return s.apply(this,arguments)}finally{tr(_,!1),y&&queueMicrotask(Ft)}}}function Io(s){Promise===Wt&&St.echoes===0?pn===0?s():enqueueNativeMicroTask(s):setTimeout(s,0)}(""+po).indexOf("[native code]")===-1&&(Cn=Ft=Fe);var Pt=Be.reject,rr="",yt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Bi="String expected.",zr="__dbnames",Ao="readonly",Lr="readwrite";function gr(s,c){return s?c?function(){return s.apply(this,arguments)&&c.apply(this,arguments)}:s:c}var fi={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function or(s){return typeof s!="string"||/\./.test(s)?function(c){return c}:function(c){return c[s]===void 0&&s in c&&delete(c=xe(c))[s],c}}function Pn(){throw be.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function dt(s,c){try{var h=hn(s),y=hn(c);if(h!==y)return h==="Array"?1:y==="Array"?-1:h==="binary"?1:y==="binary"?-1:h==="string"?1:y==="string"?-1:h==="Date"?1:y!=="Date"?NaN:-1;switch(h){case"number":case"Date":case"string":return c<s?1:s<c?-1:0;case"binary":for(var _=Hi(s),k=Hi(c),T=_.length,A=k.length,G=T<A?T:A,se=0;se<G;++se)if(_[se]!==k[se])return _[se]<k[se]?-1:1;return T===A?0:T<A?-1:1;case"Array":for(var J=s,Y=c,Z=J.length,ie=Y.length,re=Z<ie?Z:ie,ne=0;ne<re;++ne){var oe=dt(J[ne],Y[ne]);if(oe!==0)return oe}return Z===ie?0:Z<ie?-1:1}}catch{}return NaN}function hn(s){var c=typeof s;return c=="object"&&(ArrayBuffer.isView(s)||(c=ue(s))==="ArrayBuffer")?"binary":c}function Hi(s){return s instanceof Uint8Array?s:ArrayBuffer.isView(s)?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s)}function $o(s,c,h){var y=s.schema.yProps;return y?(c&&0<h.numFailures&&(c=c.filter(function(_,k){return!h.failures[k]})),Promise.all(y.map(function(_){return _=_.updatesTable,c?s.db.table(_).where("k").anyOf(c).delete():s.db.table(_).clear()})).then(function(){return h})):h}no.prototype.execute=function(s){var c=this["@@propmod"];if(c.add!==void 0){var h=c.add;if(m(h))return u(u([],m(s)?s:[],!0),h).sort();if(typeof h=="number")return(Number(s)||0)+h;if(typeof h=="bigint")try{return BigInt(s)+h}catch{return BigInt(0)+h}throw new TypeError("Invalid term ".concat(h))}if(c.remove!==void 0){var y=c.remove;if(m(y))return m(s)?s.filter(function(_){return!y.includes(_)}).sort():[];if(typeof y=="number")return Number(s)-y;if(typeof y=="bigint")try{return BigInt(s)-y}catch{return BigInt(0)-y}throw new TypeError("Invalid subtrahend ".concat(y))}return h=(h=c.replacePrefix)==null?void 0:h[0],h&&typeof s=="string"&&s.startsWith(h)?c.replacePrefix[1]+s.substring(h.length):s};var to=no;function no(s){this["@@propmod"]=s}function ro(s,c){for(var h=d(c),y=h.length,_=!1,k=0;k<y;++k){var T=h[k],A=c[T],G=V(s,T);A instanceof to?(U(s,T,A.execute(G)),_=!0):G!==A&&(U(s,T,A),_=!0)}return _}vt.prototype._trans=function(s,c,h){var y=this._tx||qe.trans,_=this.name,k=Nt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(s==="readonly"?"read":"write"," ").concat(this.name));function T(se,J,Y){if(Y.schema[_])return c(Y.idbtrans,Y);throw new be.NotFound("Table "+_+" not part of transaction")}var A=Le();try{var G=y&&y.db._novip===this.db._novip?y===qe.trans?y._promise(s,T,h):Nn(function(){return y._promise(s,T,h)},{trans:y,transless:qe.transless||qe}):(function se(J,Y,Z,ie){if(J.idbdb&&(J._state.openComplete||qe.letThrough||J._vip)){var re=J._createTransaction(Y,Z,J._dbSchema);try{re.create(),J._state.PR1398_maxLoop=3}catch(ne){return ne.name===we.InvalidState&&J.isOpen()&&0<--J._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),J.close({disableAutoOpen:!1}),J.open().then(function(){return se(J,Y,Z,ie)})):Pt(ne)}return re._promise(Y,function(ne,oe){return Nn(function(){return qe.trans=re,ie(ne,oe,re)})}).then(function(ne){if(Y==="readwrite")try{re.idbtrans.commit()}catch{}return Y==="readonly"?ne:re._completion.then(function(){return ne})})}if(J._state.openComplete)return Pt(new be.DatabaseClosed(J._state.dbOpenError));if(!J._state.isBeingOpened){if(!J._state.autoOpen)return Pt(new be.DatabaseClosed);J.open().catch(Fe)}return J._state.dbReadyPromise.then(function(){return se(J,Y,Z,ie)})})(this.db,s,[this.name],T);return k&&(G._consoleTask=k,G=G.catch(function(se){return console.trace(se),Pt(se)})),G}finally{A&&Xe()}},vt.prototype.get=function(s,c){var h=this;return s&&s.constructor===Object?this.where(s).first(c):s==null?Pt(new be.Type("Invalid argument to Table.get()")):this._trans("readonly",function(y){return h.core.get({trans:y,key:s}).then(function(_){return h.hook.reading.fire(_)})}).then(c)},vt.prototype.where=function(s){if(typeof s=="string")return new this.db.WhereClause(this,s);if(m(s))return new this.db.WhereClause(this,"[".concat(s.join("+"),"]"));var c=d(s);if(c.length===1)return this.where(c[0]).equals(s[c[0]]);var h=this.schema.indexes.concat(this.schema.primKey).filter(function(A){if(A.compound&&c.every(function(se){return 0<=A.keyPath.indexOf(se)})){for(var G=0;G<c.length;++G)if(c.indexOf(A.keyPath[G])===-1)return!1;return!0}return!1}).sort(function(A,G){return A.keyPath.length-G.keyPath.length})[0];if(h&&this.db._maxKey!==rr)return T=h.keyPath.slice(0,c.length),this.where(T).equals(T.map(function(A){return s[A]}));!h&&Nt&&console.warn("The query ".concat(JSON.stringify(s)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(c.join("+"),"]"));var y=this.schema.idxByName;function _(A,G){return dt(A,G)===0}var T=c.reduce(function(J,G){var se=J[0],J=J[1],Y=y[G],Z=s[G];return[se||Y,se||!Y?gr(J,Y&&Y.multi?function(ie){return ie=V(ie,G),m(ie)&&ie.some(function(re){return _(Z,re)})}:function(ie){return _(Z,V(ie,G))}):J]},[null,null]),k=T[0],T=T[1];return k?this.where(k.name).equals(s[k.keyPath]).filter(T):h?this.filter(T):this.where(c).equals("")},vt.prototype.filter=function(s){return this.toCollection().and(s)},vt.prototype.count=function(s){return this.toCollection().count(s)},vt.prototype.offset=function(s){return this.toCollection().offset(s)},vt.prototype.limit=function(s){return this.toCollection().limit(s)},vt.prototype.each=function(s){return this.toCollection().each(s)},vt.prototype.toArray=function(s){return this.toCollection().toArray(s)},vt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},vt.prototype.orderBy=function(s){return new this.db.Collection(new this.db.WhereClause(this,m(s)?"[".concat(s.join("+"),"]"):s))},vt.prototype.reverse=function(){return this.toCollection().reverse()},vt.prototype.mapToClass=function(s){for(var c=this.db,h=this.name,y=((this.schema.mappedClass=s).prototype instanceof Pn&&(s=(T=>{var A=J,G=T;if(typeof G!="function"&&G!==null)throw new TypeError("Class extends value "+String(G)+" is not a constructor or null");function se(){this.constructor=A}function J(){return T!==null&&T.apply(this,arguments)||this}return i(A,G),A.prototype=G===null?Object.create(G):(se.prototype=G.prototype,new se),Object.defineProperty(J.prototype,"db",{get:function(){return c},enumerable:!1,configurable:!0}),J.prototype.table=function(){return h},J})(s)),new Set),_=s.prototype;_;_=w(_))Object.getOwnPropertyNames(_).forEach(function(T){return y.add(T)});function k(T){if(!T)return T;var A,G=Object.create(s.prototype);for(A in T)if(!y.has(A))try{G[A]=T[A]}catch{}return G}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=k,this.hook("reading",k),s},vt.prototype.defineClass=function(){return this.mapToClass(function(s){v(this,s)})},vt.prototype.add=function(s,c){var h=this,y=this.schema.primKey,_=y.auto,k=y.keyPath,T=s;return k&&_&&(T=or(k)(s)),this._trans("readwrite",function(A){return h.core.mutate({trans:A,type:"add",keys:c!=null?[c]:null,values:[T]})}).then(function(A){return A.numFailures?Be.reject(A.failures[0]):A.lastResult}).then(function(A){if(k)try{U(s,k,A)}catch{}return A})},vt.prototype.upsert=function(s,c){var h=this,y=this.schema.primKey.keyPath;return this._trans("readwrite",function(_){return h.core.get({trans:_,key:s}).then(function(k){var T=k??{};return ro(T,c),y&&U(T,y,s),h.core.mutate({trans:_,type:"put",values:[T],keys:[s],upsert:!0,updates:{keys:[s],changeSpecs:[c]}}).then(function(A){return A.numFailures?Be.reject(A.failures[0]):!!k})})})},vt.prototype.update=function(s,c){return typeof s!="object"||m(s)?this.where(":id").equals(s).modify(c):(s=V(s,this.schema.primKey.keyPath))===void 0?Pt(new be.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(s).modify(c)},vt.prototype.put=function(s,c){var h=this,y=this.schema.primKey,_=y.auto,k=y.keyPath,T=s;return k&&_&&(T=or(k)(s)),this._trans("readwrite",function(A){return h.core.mutate({trans:A,type:"put",values:[T],keys:c!=null?[c]:null})}).then(function(A){return A.numFailures?Be.reject(A.failures[0]):A.lastResult}).then(function(A){if(k)try{U(s,k,A)}catch{}return A})},vt.prototype.delete=function(s){var c=this;return this._trans("readwrite",function(h){return c.core.mutate({trans:h,type:"delete",keys:[s]}).then(function(y){return $o(c,[s],y)}).then(function(y){return y.numFailures?Be.reject(y.failures[0]):void 0})})},vt.prototype.clear=function(){var s=this;return this._trans("readwrite",function(c){return s.core.mutate({trans:c,type:"deleteRange",range:fi}).then(function(h){return $o(s,null,h)})}).then(function(c){return c.numFailures?Be.reject(c.failures[0]):void 0})},vt.prototype.bulkGet=function(s){var c=this;return this._trans("readonly",function(h){return c.core.getMany({keys:s,trans:h}).then(function(y){return y.map(function(_){return c.hook.reading.fire(_)})})})},vt.prototype.bulkAdd=function(s,c,h){var y=this,_=Array.isArray(c)?c:void 0,k=(h=h||(_?void 0:c))?h.allKeys:void 0;return this._trans("readwrite",function(T){var A=y.schema.primKey,se=A.auto,A=A.keyPath;if(A&&_)throw new be.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(_&&_.length!==s.length)throw new be.InvalidArgument("Arguments objects and keys must have the same length");var G=s.length,se=A&&se?s.map(or(A)):s;return y.core.mutate({trans:T,type:"add",keys:_,values:se,wantResults:k}).then(function(J){var Y=J.numFailures,Z=J.failures;if(Y===0)return k?J.results:J.lastResult;throw new Ae("".concat(y.name,".bulkAdd(): ").concat(Y," of ").concat(G," operations failed"),Z)})})},vt.prototype.bulkPut=function(s,c,h){var y=this,_=Array.isArray(c)?c:void 0,k=(h=h||(_?void 0:c))?h.allKeys:void 0;return this._trans("readwrite",function(T){var A=y.schema.primKey,se=A.auto,A=A.keyPath;if(A&&_)throw new be.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(_&&_.length!==s.length)throw new be.InvalidArgument("Arguments objects and keys must have the same length");var G=s.length,se=A&&se?s.map(or(A)):s;return y.core.mutate({trans:T,type:"put",keys:_,values:se,wantResults:k}).then(function(J){var Y=J.numFailures,Z=J.failures;if(Y===0)return k?J.results:J.lastResult;throw new Ae("".concat(y.name,".bulkPut(): ").concat(Y," of ").concat(G," operations failed"),Z)})})},vt.prototype.bulkUpdate=function(s){var c=this,h=this.core,y=s.map(function(T){return T.key}),_=s.map(function(T){return T.changes}),k=[];return this._trans("readwrite",function(T){return h.getMany({trans:T,keys:y,cache:"clone"}).then(function(A){var G=[],se=[],J=(s.forEach(function(Y,Z){var ie=Y.key,re=Y.changes,ne=A[Z];if(ne){for(var oe=0,ge=Object.keys(re);oe<ge.length;oe++){var fe=ge[oe],ve=re[fe];if(fe===c.schema.primKey.keyPath){if(dt(ve,ie)!==0)throw new be.Constraint("Cannot update primary key in bulkUpdate()")}else U(ne,fe,ve)}k.push(Z),G.push(ie),se.push(ne)}}),G.length);return h.mutate({trans:T,type:"put",keys:G,values:se,updates:{keys:y,changeSpecs:_}}).then(function(Y){var Z=Y.numFailures,ie=Y.failures;if(Z===0)return J;for(var re=0,ne=Object.keys(ie);re<ne.length;re++){var oe,ge=ne[re],fe=k[Number(ge)];fe!=null&&(oe=ie[ge],delete ie[ge],ie[fe]=oe)}throw new Ae("".concat(c.name,".bulkUpdate(): ").concat(Z," of ").concat(J," operations failed"),ie)})})})},vt.prototype.bulkDelete=function(s){var c=this,h=s.length;return this._trans("readwrite",function(y){return c.core.mutate({trans:y,type:"delete",keys:s}).then(function(_){return $o(c,s,_)})}).then(function(y){var _=y.numFailures,k=y.failures;if(_===0)return y.lastResult;throw new Ae("".concat(c.name,".bulkDelete(): ").concat(_," of ").concat(h," operations failed"),k)})};var qn=vt;function vt(){}function Fr(s){function c(T,A){if(A){for(var G=arguments.length,se=new Array(G-1);--G;)se[G-1]=arguments[G];return h[T].subscribe.apply(null,se),s}if(typeof T=="string")return h[T]}var h={};c.addEventType=k;for(var y=1,_=arguments.length;y<_;++y)k(arguments[y]);return c;function k(T,A,G){var se,J;if(typeof T!="object")return A=A||Gt,J={subscribers:[],fire:G=G||Fe,subscribe:function(Y){J.subscribers.indexOf(Y)===-1&&(J.subscribers.push(Y),J.fire=A(J.fire,Y))},unsubscribe:function(Y){J.subscribers=J.subscribers.filter(function(Z){return Z!==Y}),J.fire=J.subscribers.reduce(A,G)}},h[T]=c[T]=J;d(se=T).forEach(function(Y){var Z=se[Y];if(m(Z))k(Y,se[Y][0],se[Y][1]);else{if(Z!=="asap")throw new be.InvalidArgument("Invalid event config");var ie=k(Y,Ve,function(){for(var re=arguments.length,ne=new Array(re);re--;)ne[re]=arguments[re];ie.subscribers.forEach(function(oe){q(function(){oe.apply(null,ne)})})})}})}}function oo(s,c){return $(c).from({prototype:s}),c}function ir(s,c){return!(s.filter||s.algorithm||s.or)&&(c?s.justLimit:!s.replayFilter)}function Br(s,c){s.filter=gr(s.filter,c)}function io(s,c,h){var y=s.replayFilter;s.replayFilter=y?function(){return gr(y(),c())}:c,s.justLimit=h&&!y}function sr(s,c){if(s.isPrimKey)return c.primaryKey;var h=c.getIndexByKeyPath(s.index);if(h)return h;throw new be.Schema("KeyPath "+s.index+" on object store "+c.name+" is not indexed")}function di(s,c,h){var y=sr(s,c.schema);return c.openCursor({trans:h,values:!s.keysOnly,reverse:s.dir==="prev",unique:!!s.unique,query:{index:y,range:s.range}})}function Oo(s,c,h,y){var _,k,T=s.replayFilter?gr(s.filter,s.replayFilter()):s.filter;return s.or?(_={},k=function(A,G,se){var J,Y;T&&!T(G,se,function(Z){return G.stop(Z)},function(Z){return G.fail(Z)})||((Y=""+(J=G.primaryKey))=="[object ArrayBuffer]"&&(Y=""+new Uint8Array(J)),x(_,Y))||(_[Y]=!0,c(A,G,se))},Promise.all([s.or._iterate(k,h),wt(di(s,y,h),s.algorithm,k,!s.keysOnly&&s.valueMapper)])):wt(di(s,y,h),gr(s.algorithm,T),c,!s.keysOnly&&s.valueMapper)}function wt(s,c,h,y){var _=ut(y?function(k,T,A){return h(y(k),T,A)}:h);return s.then(function(k){if(k)return k.start(function(){var T=function(){return k.continue()};c&&!c(k,function(A){return T=A},function(A){k.stop(A),T=Fe},function(A){k.fail(A),T=Fe})||_(k.value,k,function(A){return T=A}),T()})})}mt.prototype._read=function(s,c){var h=this._ctx;return h.error?h.table._trans(null,Pt.bind(null,h.error)):h.table._trans("readonly",s).then(c)},mt.prototype._write=function(s){var c=this._ctx;return c.error?c.table._trans(null,Pt.bind(null,c.error)):c.table._trans("readwrite",s,"locked")},mt.prototype._addAlgorithm=function(s){var c=this._ctx;c.algorithm=gr(c.algorithm,s)},mt.prototype._iterate=function(s,c){return Oo(this._ctx,s,c,this._ctx.table.core)},mt.prototype.clone=function(s){var c=Object.create(this.constructor.prototype),h=Object.create(this._ctx);return s&&v(h,s),c._ctx=h,c},mt.prototype.raw=function(){return this._ctx.valueMapper=null,this},mt.prototype.each=function(s){var c=this._ctx;return this._read(function(h){return Oo(c,s,h,c.table.core)})},mt.prototype.count=function(s){var c=this;return this._read(function(h){var y,_=c._ctx,k=_.table.core;return ir(_,!0)?k.count({trans:h,query:{index:sr(_,k.schema),range:_.range}}).then(function(T){return Math.min(T,_.limit)}):(y=0,Oo(_,function(){return++y,!1},h,k).then(function(){return y}))}).then(s)},mt.prototype.sortBy=function(s,c){var h=s.split(".").reverse(),y=h[0],_=h.length-1;function k(G,se){return se?k(G[h[se]],se-1):G[y]}var T=this._ctx.dir==="next"?1:-1;function A(G,se){return dt(k(G,_),k(se,_))*T}return this.toArray(function(G){return G.sort(A)}).then(c)},mt.prototype.toArray=function(s){var c=this;return this._read(function(h){var y,_,k,T=c._ctx;return ir(T,!0)&&0<T.limit?(y=T.valueMapper,_=sr(T,T.table.core.schema),T.table.core.query({trans:h,limit:T.limit,values:!0,direction:T.dir==="prev"?"prev":void 0,query:{index:_,range:T.range}}).then(function(A){return A=A.result,y?A.map(y):A})):(k=[],Oo(T,function(A){return k.push(A)},h,T.table.core).then(function(){return k}))},s)},mt.prototype.offset=function(s){var c=this._ctx;return s<=0||(c.offset+=s,ir(c)?io(c,function(){var h=s;return function(y,_){return h===0||(h===1?--h:_(function(){y.advance(h),h=0}),!1)}}):io(c,function(){var h=s;return function(){return--h<0}})),this},mt.prototype.limit=function(s){return this._ctx.limit=Math.min(this._ctx.limit,s),io(this._ctx,function(){var c=s;return function(h,y,_){return--c<=0&&y(_),0<=c}},!0),this},mt.prototype.until=function(s,c){return Br(this._ctx,function(h,y,_){return!s(h.value)||(y(_),c)}),this},mt.prototype.first=function(s){return this.limit(1).toArray(function(c){return c[0]}).then(s)},mt.prototype.last=function(s){return this.reverse().first(s)},mt.prototype.filter=function(s){var c;return Br(this._ctx,function(h){return s(h.value)}),(c=this._ctx).isMatch=gr(c.isMatch,s),this},mt.prototype.and=function(s){return this.filter(s)},mt.prototype.or=function(s){return new this.db.WhereClause(this._ctx.table,s,this)},mt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},mt.prototype.desc=function(){return this.reverse()},mt.prototype.eachKey=function(s){var c=this._ctx;return c.keysOnly=!c.isMatch,this.each(function(h,y){s(y.key,y)})},mt.prototype.eachUniqueKey=function(s){return this._ctx.unique="unique",this.eachKey(s)},mt.prototype.eachPrimaryKey=function(s){var c=this._ctx;return c.keysOnly=!c.isMatch,this.each(function(h,y){s(y.primaryKey,y)})},mt.prototype.keys=function(s){var c=this._ctx,h=(c.keysOnly=!c.isMatch,[]);return this.each(function(y,_){h.push(_.key)}).then(function(){return h}).then(s)},mt.prototype.primaryKeys=function(s){var c=this._ctx;if(ir(c,!0)&&0<c.limit)return this._read(function(y){var _=sr(c,c.table.core.schema);return c.table.core.query({trans:y,values:!1,limit:c.limit,direction:c.dir==="prev"?"prev":void 0,query:{index:_,range:c.range}})}).then(function(y){return y.result}).then(s);c.keysOnly=!c.isMatch;var h=[];return this.each(function(y,_){h.push(_.primaryKey)}).then(function(){return h}).then(s)},mt.prototype.uniqueKeys=function(s){return this._ctx.unique="unique",this.keys(s)},mt.prototype.firstKey=function(s){return this.limit(1).keys(function(c){return c[0]}).then(s)},mt.prototype.lastKey=function(s){return this.reverse().firstKey(s)},mt.prototype.distinct=function(){var s,c=this._ctx,c=c.index&&c.table.schema.idxByName[c.index];return c&&c.multi&&(s={},Br(this._ctx,function(y){var y=y.primaryKey.toString(),_=x(s,y);return s[y]=!0,!_})),this},mt.prototype.modify=function(s){var c=this,h=this._ctx;return this._write(function(y){function _(ne,oe){var ge=oe.failures;Z+=ne-oe.numFailures;for(var fe=0,ve=d(ge);fe<ve.length;fe++){var Ee=ve[fe];Y.push(ge[Ee])}}var k=typeof s=="function"?s:function(ne){return ro(ne,s)},T=h.table.core,J=T.schema.primaryKey,A=J.outbound,G=J.extractKey,se=200,J=c.db._options.modifyChunkSize,Y=(J&&(se=typeof J=="object"?J[T.name]||J["*"]||200:J),[]),Z=0,ie=[],re=s===Vi;return c.clone().primaryKeys().then(function(ne){function oe(fe){var ve=Math.min(se,ne.length-fe),Ee=ne.slice(fe,fe+ve);return(re?Promise.resolve([]):T.getMany({trans:y,keys:Ee,cache:"immutable"})).then(function(Ce){var Oe=[],Te=[],He=A?[]:null,$e=re?Ee:[];if(!re)for(var Ue=0;Ue<ve;++Ue){var Ne=Ce[Ue],rt={value:xe(Ne),primKey:ne[fe+Ue]};k.call(rt,rt.value,rt)!==!1&&(rt.value==null?$e.push(ne[fe+Ue]):A||dt(G(Ne),G(rt.value))===0?(Te.push(rt.value),A&&He.push(ne[fe+Ue])):($e.push(ne[fe+Ue]),Oe.push(rt.value)))}return Promise.resolve(0<Oe.length&&T.mutate({trans:y,type:"add",values:Oe}).then(function(ot){for(var at in ot.failures)$e.splice(parseInt(at),1);_(Oe.length,ot)})).then(function(){return(0<Te.length||ge&&typeof s=="object")&&T.mutate({trans:y,type:"put",keys:He,values:Te,criteria:ge,changeSpec:typeof s!="function"&&s,isAdditionalChunk:0<fe}).then(function(ot){return _(Te.length,ot)})}).then(function(){return(0<$e.length||ge&&re)&&T.mutate({trans:y,type:"delete",keys:$e,criteria:ge,isAdditionalChunk:0<fe}).then(function(ot){return $o(h.table,$e,ot)}).then(function(ot){return _($e.length,ot)})}).then(function(){return ne.length>fe+ve&&oe(fe+se)})})}var ge=ir(h)&&h.limit===1/0&&(typeof s!="function"||re)&&{index:h.index,range:h.range};return oe(0).then(function(){if(0<Y.length)throw new Re("Error modifying one or more objects",Y,Z,ie);return ne.length})})})},mt.prototype.delete=function(){var s=this._ctx,c=s.range;return!ir(s)||s.table.schema.yProps||!s.isPrimKey&&c.type!==3?this.modify(Vi):this._write(function(h){var y=s.table.core.schema.primaryKey,_=c;return s.table.core.count({trans:h,query:{index:y,range:_}}).then(function(k){return s.table.core.mutate({trans:h,type:"deleteRange",range:_}).then(function(G){var A=G.failures,G=G.numFailures;if(G)throw new Re("Could not delete some values",Object.keys(A).map(function(se){return A[se]}),k-G);return k-G})})})};var Ba=mt;function mt(){}var Vi=function(s,c){return c.value=null};function Ha(s,c){return s<c?-1:s===c?0:1}function Va(s,c){return c<s?-1:s===c?0:1}function mn(s,c,h){return s=s instanceof vr?new s.Collection(s):s,s._ctx.error=new(h||TypeError)(c),s}function Hr(s){return new s.Collection(s,function(){return yr("")}).limit(0)}function so(ie,c,h,y){var _,k,T,A,G,se,J,Y=h.length;if(!h.every(function(ne){return typeof ne=="string"}))return mn(ie,Bi);function Z(ne){_=ne==="next"?function(ge){return ge.toUpperCase()}:function(ge){return ge.toLowerCase()},k=ne==="next"?function(ge){return ge.toLowerCase()}:function(ge){return ge.toUpperCase()},T=ne==="next"?Ha:Va;var oe=h.map(function(ge){return{lower:k(ge),upper:_(ge)}}).sort(function(ge,fe){return T(ge.lower,fe.lower)});A=oe.map(function(ge){return ge.upper}),G=oe.map(function(ge){return ge.lower}),J=(se=ne)==="next"?"":y}Z("next");var ie=new ie.Collection(ie,function(){return on(A[0],G[Y-1]+y)}),re=(ie._ondirectionchange=function(ne){Z(ne)},0);return ie._addAlgorithm(function(ne,oe,ge){var fe=ne.key;if(typeof fe=="string"){var ve=k(fe);if(c(ve,G,re))return!0;for(var Ee=null,Ce=re;Ce<Y;++Ce){var Oe=((Te,He,$e,Ue,Ne,rt)=>{for(var ot=Math.min(Te.length,Ue.length),at=-1,pt=0;pt<ot;++pt){var gn=He[pt];if(gn!==Ue[pt])return Ne(Te[pt],$e[pt])<0?Te.substr(0,pt)+$e[pt]+$e.substr(pt+1):Ne(Te[pt],Ue[pt])<0?Te.substr(0,pt)+Ue[pt]+$e.substr(pt+1):0<=at?Te.substr(0,at)+He[at]+$e.substr(at+1):null;Ne(Te[pt],gn)<0&&(at=pt)}return ot<Ue.length&&rt==="next"?Te+$e.substr(Te.length):ot<Te.length&&rt==="prev"?Te.substr(0,$e.length):at<0?null:Te.substr(0,at)+Ue[at]+$e.substr(at+1)})(fe,ve,A[Ce],G[Ce],T,se);Oe===null&&Ee===null?re=Ce+1:(Ee===null||0<T(Ee,Oe))&&(Ee=Oe)}oe(Ee!==null?function(){ne.continue(Ee+J)}:ge)}return!1}),ie}function on(s,c,h,y){return{type:2,lower:s,upper:c,lowerOpen:h,upperOpen:y}}function yr(s){return{type:1,lower:s,upper:s}}Object.defineProperty(At.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),At.prototype.between=function(s,c,h,y){h=h!==!1,y=y===!0;try{return 0<this._cmp(s,c)||this._cmp(s,c)===0&&(h||y)&&(!h||!y)?Hr(this):new this.Collection(this,function(){return on(s,c,!h,!y)})}catch{return mn(this,yt)}},At.prototype.equals=function(s){return s==null?mn(this,yt):new this.Collection(this,function(){return yr(s)})},At.prototype.above=function(s){return s==null?mn(this,yt):new this.Collection(this,function(){return on(s,void 0,!0)})},At.prototype.aboveOrEqual=function(s){return s==null?mn(this,yt):new this.Collection(this,function(){return on(s,void 0,!1)})},At.prototype.below=function(s){return s==null?mn(this,yt):new this.Collection(this,function(){return on(void 0,s,!1,!0)})},At.prototype.belowOrEqual=function(s){return s==null?mn(this,yt):new this.Collection(this,function(){return on(void 0,s)})},At.prototype.startsWith=function(s){return typeof s!="string"?mn(this,Bi):this.between(s,s+rr,!0,!0)},At.prototype.startsWithIgnoreCase=function(s){return s===""?this.startsWith(s):so(this,function(c,h){return c.indexOf(h[0])===0},[s],rr)},At.prototype.equalsIgnoreCase=function(s){return so(this,function(c,h){return c===h[0]},[s],"")},At.prototype.anyOfIgnoreCase=function(){var s=X.apply(F,arguments);return s.length===0?Hr(this):so(this,function(c,h){return h.indexOf(c)!==-1},s,"")},At.prototype.startsWithAnyOfIgnoreCase=function(){var s=X.apply(F,arguments);return s.length===0?Hr(this):so(this,function(c,h){return h.some(function(y){return c.indexOf(y)===0})},s,rr)},At.prototype.anyOf=function(){var s,c,h=this,y=X.apply(F,arguments),_=this._cmp;try{y.sort(_)}catch{return mn(this,yt)}return y.length===0?Hr(this):((s=new this.Collection(this,function(){return on(y[0],y[y.length-1])}))._ondirectionchange=function(k){_=k==="next"?h._ascending:h._descending,y.sort(_)},c=0,s._addAlgorithm(function(k,T,A){for(var G=k.key;0<_(G,y[c]);)if(++c===y.length)return T(A),!1;return _(G,y[c])===0||(T(function(){k.continue(y[c])}),!1)}),s)},At.prototype.notEqual=function(s){return this.inAnyRange([[-1/0,s],[s,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},At.prototype.noneOf=function(){var s=X.apply(F,arguments);if(s.length===0)return new this.Collection(this);try{s.sort(this._ascending)}catch{return mn(this,yt)}var c=s.reduce(function(h,y){return h?h.concat([[h[h.length-1][1],y]]):[[-1/0,y]]},null);return c.push([s[s.length-1],this.db._maxKey]),this.inAnyRange(c,{includeLowers:!1,includeUppers:!1})},At.prototype.inAnyRange=function(s,ge){var h=this,y=this._cmp,_=this._ascending,k=this._descending,T=this._min,A=this._max;if(s.length===0)return Hr(this);if(!s.every(function(fe){return fe[0]!==void 0&&fe[1]!==void 0&&_(fe[0],fe[1])<=0}))return mn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",be.InvalidArgument);var G=!ge||ge.includeLowers!==!1,se=ge&&ge.includeUppers===!0,J,Y=_;function Z(fe,ve){return Y(fe[0],ve[0])}try{(J=s.reduce(function(fe,ve){for(var Ee=0,Ce=fe.length;Ee<Ce;++Ee){var Oe=fe[Ee];if(y(ve[0],Oe[1])<0&&0<y(ve[1],Oe[0])){Oe[0]=T(Oe[0],ve[0]),Oe[1]=A(Oe[1],ve[1]);break}}return Ee===Ce&&fe.push(ve),fe},[])).sort(Z)}catch{return mn(this,yt)}var ie=0,re=se?function(fe){return 0<_(fe,J[ie][1])}:function(fe){return 0<=_(fe,J[ie][1])},ne=G?function(fe){return 0<k(fe,J[ie][0])}:function(fe){return 0<=k(fe,J[ie][0])},oe=re,ge=new this.Collection(this,function(){return on(J[0][0],J[J.length-1][1],!G,!se)});return ge._ondirectionchange=function(fe){Y=fe==="next"?(oe=re,_):(oe=ne,k),J.sort(Z)},ge._addAlgorithm(function(fe,ve,Ee){for(var Ce,Oe=fe.key;oe(Oe);)if(++ie===J.length)return ve(Ee),!1;return!re(Ce=Oe)&&!ne(Ce)||(h._cmp(Oe,J[ie][1])===0||h._cmp(Oe,J[ie][0])===0||ve(function(){Y===_?fe.continue(J[ie][0]):fe.continue(J[ie][1])}),!1)}),ge},At.prototype.startsWithAnyOf=function(){var s=X.apply(F,arguments);return s.every(function(c){return typeof c=="string"})?s.length===0?Hr(this):this.inAnyRange(s.map(function(c){return[c,c+rr]})):mn(this,"startsWithAnyOf() only works with strings")};var vr=At;function At(){}function sn(s){return ut(function(c){return An(c),s(c.target.error),!1})}function An(s){s.stopPropagation&&s.stopPropagation(),s.preventDefault&&s.preventDefault()}var pi="storagemutated",Ki="x-storagemutated-1",$n=Fr(null,pi),Au=(Wn.prototype._lock=function(){return R(!qe.global),++this._reculock,this._reculock!==1||qe.global||(qe.lockOwnerFor=this),this},Wn.prototype._unlock=function(){if(R(!qe.global),--this._reculock==0)for(qe.global||(qe.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var s=this._blockedFuncs.shift();try{nr(s[1],s[0])}catch{}}return this},Wn.prototype._locked=function(){return this._reculock&&qe.lockOwnerFor!==this},Wn.prototype.create=function(s){var c=this;if(this.mode){var h=this.db.idbdb,y=this.db._state.dbOpenError;if(R(!this.idbtrans),!s&&!h)switch(y&&y.name){case"DatabaseClosedError":throw new be.DatabaseClosed(y);case"MissingAPIError":throw new be.MissingAPI(y.message,y);default:throw new be.OpenFailed(y)}if(!this.active)throw new be.TransactionInactive;R(this._completion._state===null),(s=this.idbtrans=s||(this.db.core||h).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=ut(function(_){An(_),c._reject(s.error)}),s.onabort=ut(function(_){An(_),c.active&&c._reject(new be.Abort(s.error)),c.active=!1,c.on("abort").fire(_)}),s.oncomplete=ut(function(){c.active=!1,c._resolve(),"mutatedParts"in s&&$n.storagemutated.fire(s.mutatedParts)})}return this},Wn.prototype._promise=function(s,c,h){var y,_=this;return s==="readwrite"&&this.mode!=="readwrite"?Pt(new be.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Be(function(k,T){_._blockedFuncs.push([function(){_._promise(s,c,h).then(k,T)},qe])}):h?Nn(function(){var k=new Be(function(T,A){_._lock();var G=c(T,A,_);G&&G.then&&G.then(T,A)});return k.finally(function(){return _._unlock()}),k._lib=!0,k}):((y=new Be(function(k,T){var A=c(k,T,_);A&&A.then&&A.then(k,T)}))._lib=!0,y):Pt(new be.TransactionInactive)},Wn.prototype._root=function(){return this.parent?this.parent._root():this},Wn.prototype.waitFor=function(s){var c,h=this._root(),y=Be.resolve(s),_=(h._waitingFor?h._waitingFor=h._waitingFor.then(function(){return y}):(h._waitingFor=y,h._waitingQueue=[],c=h.idbtrans.objectStore(h.storeNames[0]),(function k(){for(++h._spinCount;h._waitingQueue.length;)h._waitingQueue.shift()();h._waitingFor&&(c.get(-1/0).onsuccess=k)})()),h._waitingFor);return new Be(function(k,T){y.then(function(A){return h._waitingQueue.push(ut(k.bind(null,A)))},function(A){return h._waitingQueue.push(ut(T.bind(null,A)))}).finally(function(){h._waitingFor===_&&(h._waitingFor=null)})})},Wn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new be.Abort))},Wn.prototype.table=function(s){var c=this._memoizedTables||(this._memoizedTables={});if(x(c,s))return c[s];var h=this.schema[s];if(h)return(h=new this.db.Table(s,h,this)).core=this.db.core.table(s),c[s]=h;throw new be.NotFound("Table "+s+" not part of transaction")},Wn);function Wn(){}function Ro(s,c,h,y,_,k,T,A){return{name:s,keyPath:c,unique:h,multi:y,auto:_,compound:k,src:(h&&!T?"&":"")+(y?"*":"")+(_?"++":"")+Ds(c),type:A}}function Ds(s){return typeof s=="string"?s:s?"["+[].join.call(s,"+")+"]":""}function zs(s,c,h){return{name:s,primKey:c,indexes:h,mappedClass:null,idxByName:(y=function(_){return[_.name,_]},h.reduce(function(_,k,T){return k=y(k,T),k&&(_[k[0]]=k[1]),_},{}))};var y}var xr=function(s){try{return s.only([[]]),xr=function(){return[[]]},[[]]}catch{return xr=function(){return rr},rr}};function ao(s){return s==null?function(){}:typeof s=="string"?(c=s).split(".").length===1?function(h){return h[c]}:function(h){return V(h,c)}:function(h){return V(h,s)};var c}function lo(s){return[].slice.call(s)}var Ui=0;function hi(s){return s==null?":id":typeof s=="string"?s:"[".concat(s.join("+"),"]")}function $u(s,c,T){function y(oe){if(oe.type===3)return null;if(oe.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var ie=oe.lower,re=oe.upper,ne=oe.lowerOpen,oe=oe.upperOpen;return ie===void 0?re===void 0?null:c.upperBound(re,!!oe):re===void 0?c.lowerBound(ie,!!ne):c.bound(ie,re,!!ne,!!oe)}function _(Z){var ie,re,ne=Z.name;return{name:ne,schema:Z,mutate:function(oe){var ge=oe.trans,fe=oe.type,ve=oe.keys,Ee=oe.values,Ce=oe.range;return new Promise(function(Oe,Te){Oe=ut(Oe);var He=ge.objectStore(ne),$e=He.keyPath==null,Ue=fe==="put"||fe==="add";if(!Ue&&fe!=="delete"&&fe!=="deleteRange")throw new Error("Invalid operation type: "+fe);var Ne,rt=(ve||Ee||{length:1}).length;if(ve&&Ee&&ve.length!==Ee.length)throw new Error("Given keys array must have same length as given values array.");if(rt===0)return Oe({numFailures:0,failures:{},results:[],lastResult:void 0});function ot(an){++gn,An(an)}var at=[],pt=[],gn=0;if(fe==="deleteRange"){if(Ce.type===4)return Oe({numFailures:gn,failures:pt,results:[],lastResult:void 0});Ce.type===3?at.push(Ne=He.clear()):at.push(Ne=He.delete(y(Ce)))}else{var $e=Ue?$e?[Ee,ve]:[Ee,null]:[ve,null],st=$e[0],jt=$e[1];if(Ue)for(var Vt=0;Vt<rt;++Vt)at.push(Ne=jt&&jt[Vt]!==void 0?He[fe](st[Vt],jt[Vt]):He[fe](st[Vt])),Ne.onerror=ot;else for(Vt=0;Vt<rt;++Vt)at.push(Ne=He[fe](st[Vt])),Ne.onerror=ot}function Uo(an){an=an.target.result,at.forEach(function(go,yo){return go.error!=null&&(pt[yo]=go.error)}),Oe({numFailures:gn,failures:pt,results:fe==="delete"?ve:at.map(function(go){return go.result}),lastResult:an})}Ne.onerror=function(an){ot(an),Uo(an)},Ne.onsuccess=Uo})},getMany:function(oe){var ge=oe.trans,fe=oe.keys;return new Promise(function(ve,Ee){ve=ut(ve);for(var Ce,Oe=ge.objectStore(ne),Te=fe.length,He=new Array(Te),$e=0,Ue=0,Ne=function(at){at=at.target,He[at._pos]=at.result,++Ue===$e&&ve(He)},rt=sn(Ee),ot=0;ot<Te;++ot)fe[ot]!=null&&((Ce=Oe.get(fe[ot]))._pos=ot,Ce.onsuccess=Ne,Ce.onerror=rt,++$e);$e===0&&ve(He)})},get:function(oe){var ge=oe.trans,fe=oe.key;return new Promise(function(ve,Ee){ve=ut(ve);var Ce=ge.objectStore(ne).get(fe);Ce.onsuccess=function(Oe){return ve(Oe.target.result)},Ce.onerror=sn(Ee)})},query:(ie=G,re=se,function(oe){return new Promise(function(ge,fe){ge=ut(ge);var ve,Ee,Ce,Oe,rt=oe.trans,Te=oe.values,He=oe.limit,Ne=oe.query,$e=($e=oe.direction)!=null?$e:"next",Ue=He===1/0?void 0:He,ot=Ne.index,Ne=Ne.range,rt=rt.objectStore(ne),rt=ot.isPrimaryKey?rt:rt.index(ot.name),ot=y(Ne);if(He===0)return ge({result:[]});re?(Ne={query:ot,count:Ue,direction:$e},(ve=Te?rt.getAll(Ne):rt.getAllKeys(Ne)).onsuccess=function(at){return ge({result:at.target.result})},ve.onerror=sn(fe)):ie&&$e==="next"?((ve=Te?rt.getAll(ot,Ue):rt.getAllKeys(ot,Ue)).onsuccess=function(at){return ge({result:at.target.result})},ve.onerror=sn(fe)):(Ee=0,Ce=!Te&&"openKeyCursor"in rt?rt.openKeyCursor(ot,$e):rt.openCursor(ot,$e),Oe=[],Ce.onsuccess=function(){var at=Ce.result;return!at||(Oe.push(Te?at.value:at.primaryKey),++Ee===He)?ge({result:Oe}):void at.continue()},Ce.onerror=sn(fe))})}),openCursor:function(oe){var ge=oe.trans,fe=oe.values,ve=oe.query,Ee=oe.reverse,Ce=oe.unique;return new Promise(function(Oe,Te){Oe=ut(Oe);var Ue=ve.index,He=ve.range,$e=ge.objectStore(ne),$e=Ue.isPrimaryKey?$e:$e.index(Ue.name),Ue=Ee?Ce?"prevunique":"prev":Ce?"nextunique":"next",Ne=!fe&&"openKeyCursor"in $e?$e.openKeyCursor(y(He),Ue):$e.openCursor(y(He),Ue);Ne.onerror=sn(Te),Ne.onsuccess=ut(function(rt){var ot,at,pt,gn,st=Ne.result;st?(st.___id=++Ui,st.done=!1,ot=st.continue.bind(st),at=(at=st.continuePrimaryKey)&&at.bind(st),pt=st.advance.bind(st),gn=function(){throw new Error("Cursor not stopped")},st.trans=ge,st.stop=st.continue=st.continuePrimaryKey=st.advance=function(){throw new Error("Cursor not started")},st.fail=ut(Te),st.next=function(){var jt=this,Vt=1;return this.start(function(){return Vt--?jt.continue():jt.stop()}).then(function(){return jt})},st.start=function(jt){function Vt(){if(Ne.result)try{jt()}catch(an){st.fail(an)}else st.done=!0,st.start=function(){throw new Error("Cursor behind last entry")},st.stop()}var Uo=new Promise(function(an,go){an=ut(an),Ne.onerror=sn(go),st.fail=go,st.stop=function(yo){st.stop=st.continue=st.continuePrimaryKey=st.advance=gn,an(yo)}});return Ne.onsuccess=ut(function(an){Ne.onsuccess=Vt,Vt()}),st.continue=ot,st.continuePrimaryKey=at,st.advance=pt,Vt(),Uo},Oe(st)):Oe(null)},Te)})},count:function(oe){var ge=oe.query,fe=oe.trans,ve=ge.index,Ee=ge.range;return new Promise(function(Ce,Oe){var Te=fe.objectStore(ne),Te=ve.isPrimaryKey?Te:Te.index(ve.name),He=y(Ee),He=He?Te.count(He):Te.count();He.onsuccess=ut(function($e){return Ce($e.target.result)}),He.onerror=sn(Oe)})}}}k=T,A=lo((T=s).objectStoreNames),J=0<A.length?k.objectStore(A[0]):{};var k,T={schema:{name:T.name,tables:A.map(function(Z){return k.objectStore(Z)}).map(function(Z){var ie=Z.keyPath,re=Z.autoIncrement,oe=m(ie),ne={},oe={name:Z.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:ie==null,compound:oe,keyPath:ie,autoIncrement:re,unique:!0,extractKey:ao(ie)},indexes:lo(Z.indexNames).map(function(ge){return Z.index(ge)}).map(function(Ee){var Ce=Ee.name,fe=Ee.unique,ve=Ee.multiEntry,Ee=Ee.keyPath,Ce={name:Ce,compound:m(Ee),keyPath:Ee,unique:fe,multiEntry:ve,extractKey:ao(Ee)};return ne[hi(Ee)]=Ce}),getIndexByKeyPath:function(ge){return ne[hi(ge)]}};return ne[":id"]=oe.primaryKey,ie!=null&&(ne[hi(ie)]=oe.primaryKey),oe})},hasGetAll:0<A.length&&"getAll"in J&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in J},A=T.schema,G=T.hasGetAll,se=T.hasIdb3Features,J=A.tables.map(_),Y={};return J.forEach(function(Z){return Y[Z.name]=Z}),{stack:"dbcore",transaction:s.transaction.bind(s),table:function(Z){if(Y[Z])return Y[Z];throw new Error("Table '".concat(Z,"' not found"))},MIN_KEY:-1/0,MAX_KEY:xr(c),schema:A}}function Ls(s,c,h,y){return h=h.IDBKeyRange,c=$u(c,h,y),{dbcore:s.dbcore.reduce(function(_,k){return k=k.create,a(a({},_),k(_))},c)}}function uo(s,c){var h=c.db,h=Ls(s._middlewares,h,s._deps,c);s.core=h.dbcore,s.tables.forEach(function(y){var _=y.name;s.core.schema.tables.some(function(k){return k.name===_})&&(y.core=s.core.table(_),s[_]instanceof s.Table)&&(s[_].core=y.core)})}function Do(s,c,h,y){h.forEach(function(_){var k=y[_];c.forEach(function(T){var A=(function G(se,J){return M(se,J)||(se=w(se))&&G(se,J)})(T,_);(!A||"value"in A&&A.value===void 0)&&(T===s.Transaction.prototype||T instanceof s.Transaction?C(T,_,{get:function(){return this.table(_)},set:function(G){N(this,_,{value:G,writable:!0,configurable:!0,enumerable:!0})}}):T[_]=new s.Table(_,k))})})}function qi(s,c){c.forEach(function(h){for(var y in h)h[y]instanceof s.Table&&delete h[y]})}function Vr(s,c){return s._cfg.version-c._cfg.version}function Fs(s,c,h,y){var _=s._dbSchema,k=(h.objectStoreNames.contains("$meta")&&!_.$meta&&(_.$meta=zs("$meta",Xi("")[0],[]),s._storeNames.push("$meta")),s._createTransaction("readwrite",s._storeNames,_)),T=(k.create(h),k._completion.catch(y),k._reject.bind(k)),A=qe.transless||qe;Nn(function(){if(qe.trans=k,qe.transless=A,c!==0)return uo(s,h),se=c,((G=k).storeNames.includes("$meta")?G.table("$meta").get("version").then(function(J){return J??se}):Be.resolve(se)).then(function(oe){var Y=s,Z=oe,ie=k,re=h,ne=[],oe=Y._versions,ge=Y._dbSchema=Zt(0,Y.idbdb,re);return(oe=oe.filter(function(fe){return fe._cfg.version>=Z})).length===0?Be.resolve():(oe.forEach(function(fe){ne.push(function(){var ve,Ee,Ce,Oe=ge,Te=fe._cfg.dbschema,He=(wr(Y,Oe,re),wr(Y,Te,re),ge=Y._dbSchema=Te,Yi(Oe,Te)),$e=(He.add.forEach(function(Ue){zo(re,Ue[0],Ue[1].primKey,Ue[1].indexes)}),He.change.forEach(function(Ue){if(Ue.recreate)throw new be.Upgrade("Not yet support for changing primary key");var Ne=re.objectStore(Ue.name);Ue.add.forEach(function(rt){return gi(Ne,rt)}),Ue.change.forEach(function(rt){Ne.deleteIndex(rt.name),gi(Ne,rt)}),Ue.del.forEach(function(rt){return Ne.deleteIndex(rt)})}),fe._cfg.contentUpgrade);if($e&&fe._cfg.version>Z)return uo(Y,re),ie._memoizedTables={},ve=pe(Te),He.del.forEach(function(Ue){ve[Ue]=Oe[Ue]}),qi(Y,[Y.Transaction.prototype]),Do(Y,[Y.Transaction.prototype],d(ve),ve),ie.schema=ve,(Ee=O($e))&&Cn(),Te=Be.follow(function(){var Ue;(Ce=$e(ie))&&Ee&&(Ue=Ft.bind(null,null),Ce.then(Ue,Ue))}),Ce&&typeof Ce.then=="function"?Be.resolve(Ce):Te.then(function(){return Ce})}),ne.push(function(ve){var Ee,Ce,Oe=fe._cfg.dbschema;Ee=Oe,Ce=ve,[].slice.call(Ce.db.objectStoreNames).forEach(function(Te){return Ee[Te]==null&&Ce.db.deleteObjectStore(Te)}),qi(Y,[Y.Transaction.prototype]),Do(Y,[Y.Transaction.prototype],Y._storeNames,Y._dbSchema),ie.schema=Y._dbSchema}),ne.push(function(ve){Y.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(Y.idbdb.version/10)===fe._cfg.version?(Y.idbdb.deleteObjectStore("$meta"),delete Y._dbSchema.$meta,Y._storeNames=Y._storeNames.filter(function(Ee){return Ee!=="$meta"})):ve.objectStore("$meta").put(fe._cfg.version,"version"))})}),(function fe(){return ne.length?Be.resolve(ne.shift()(ie.idbtrans)).then(fe):Be.resolve()})().then(function(){mi(ge,re)}))}).catch(T);var G,se;d(_).forEach(function(J){zo(h,J,_[J].primKey,_[J].indexes)}),uo(s,h),Be.follow(function(){return s.on.populate.fire(k)}).catch(T)})}function Wi(s,c){mi(s._dbSchema,c),c.db.version%10!=0||c.objectStoreNames.contains("$meta")||c.db.createObjectStore("$meta").add(Math.ceil(c.db.version/10-1),"version");var h=Zt(0,s.idbdb,c);wr(s,s._dbSchema,c);for(var y=0,_=Yi(h,s._dbSchema).change;y<_.length;y++){var k=(T=>{if(T.change.length||T.recreate)return console.warn("Unable to patch indexes of table ".concat(T.name," because it has changes on the type of index or primary key.")),{value:void 0};var A=c.objectStore(T.name);T.add.forEach(function(G){Nt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(T.name,".").concat(G.src)),gi(A,G)})})(_[y]);if(typeof k=="object")return k.value}}function Yi(s,c){var h,y={del:[],add:[],change:[]};for(h in s)c[h]||y.del.push(h);for(h in c){var _=s[h],k=c[h];if(_){var T={name:h,def:k,recreate:!1,del:[],add:[],change:[]};if(""+(_.primKey.keyPath||"")!=""+(k.primKey.keyPath||"")||_.primKey.auto!==k.primKey.auto)T.recreate=!0,y.change.push(T);else{var A=_.idxByName,G=k.idxByName,se=void 0;for(se in A)G[se]||T.del.push(se);for(se in G){var J=A[se],Y=G[se];J?J.src!==Y.src&&T.change.push(Y):T.add.push(Y)}(0<T.del.length||0<T.add.length||0<T.change.length)&&y.change.push(T)}}else y.add.push([h,k])}return y}function zo(s,c,h,y){var _=s.db.createObjectStore(c,h.keyPath?{keyPath:h.keyPath,autoIncrement:h.auto}:{autoIncrement:h.auto});y.forEach(function(k){return gi(_,k)})}function mi(s,c){d(s).forEach(function(h){c.db.objectStoreNames.contains(h)||(Nt&&console.debug("Dexie: Creating missing table",h),zo(c,h,s[h].primKey,s[h].indexes))})}function gi(s,c){s.createIndex(c.name,c.keyPath,{unique:c.unique,multiEntry:c.multi})}function Zt(s,c,h){var y={};return H(c.objectStoreNames,0).forEach(function(_){for(var k=h.objectStore(_),T=Ro(Ds(se=k.keyPath),se||"",!0,!1,!!k.autoIncrement,se&&typeof se!="string",!0),A=[],G=0;G<k.indexNames.length;++G){var J=k.index(k.indexNames[G]),se=J.keyPath,J=Ro(J.name,se,!!J.unique,!!J.multiEntry,!1,se&&typeof se!="string",!1);A.push(J)}y[_]=zs(_,T,A)}),y}function wr(s,c,h){for(var y=h.db.objectStoreNames,_=0;_<y.length;++_){var k=y[_],T=h.objectStore(k);s._hasGetAll="getAll"in T;for(var A=0;A<T.indexNames.length;++A){var G,se=T.indexNames[A],J=T.index(se).keyPath,J=typeof J=="string"?J:"["+H(J).join("+")+"]";c[k]&&(G=c[k].idxByName[J])&&(G.name=se,delete c[k].idxByName[J],c[k].idxByName[se]=G)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&f.WorkerGlobalScope&&f instanceof f.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(s._hasGetAll=!1)}function Xi(s){return s.split(",").map(function(c,h){var _=c.split(":"),y=(y=_[1])==null?void 0:y.trim(),_=(c=_[0].trim()).replace(/([&*]|\+\+)/g,""),k=/^\[/.test(_)?_.match(/^\[(.*)\]$/)[1].split("+"):_;return Ro(_,k||null,/\&/.test(c),/\*/.test(c),/\+\+/.test(c),m(k),h===0,y)})}Lo.prototype._createTableSchema=zs,Lo.prototype._parseIndexSyntax=Xi,Lo.prototype._parseStoresSpec=function(s,c){var h=this;d(s).forEach(function(y){if(s[y]!==null){var _=h._parseIndexSyntax(s[y]),k=_.shift();if(!k)throw new be.Schema("Invalid schema for table "+y+": "+s[y]);if(k.unique=!0,k.multi)throw new be.Schema("Primary key cannot be multiEntry*");_.forEach(function(T){if(T.auto)throw new be.Schema("Only primary key can be marked as autoIncrement (++)");if(!T.keyPath)throw new be.Schema("Index must have a name and cannot be an empty string")}),k=h._createTableSchema(y,k,_),c[y]=k}})},Lo.prototype.stores=function(h){var c=this.db,h=(this._cfg.storesSource=this._cfg.storesSource?v(this._cfg.storesSource,h):h,c._versions),y={},_={};return h.forEach(function(k){v(y,k._cfg.storesSource),_=k._cfg.dbschema={},k._parseStoresSpec(y,_)}),c._dbSchema=_,qi(c,[c._allTables,c,c.Transaction.prototype]),Do(c,[c._allTables,c,c.Transaction.prototype,this._cfg.tables],d(_),_),c._storeNames=d(_),this},Lo.prototype.upgrade=function(s){return this._cfg.contentUpgrade=qt(this._cfg.contentUpgrade||Fe,s),this};var yi=Lo;function Lo(){}var co=(()=>{var s,c,h;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(s=new Set,c=new FinalizationRegistry(function(y){s.delete(y)}),{toArray:function(){return Array.from(s).map(function(y){return y.deref()}).filter(function(y){return y!==void 0})},add:function(y){var _=new WeakRef(y._novip);s.add(_),c.register(y._novip,_,_),s.size>y._options.maxConnections&&(_=s.values().next().value,s.delete(_),c.unregister(_))},remove:function(y){if(y)for(var _=s.values(),k=_.next();!k.done;){var T=k.value;if(T.deref()===y._novip)return s.delete(T),void c.unregister(T);k=_.next()}}}):(h=[],{toArray:function(){return h},add:function(y){h.push(y._novip)},remove:function(y){y&&(y=h.indexOf(y._novip))!==-1&&h.splice(y,1)}})})();function vi(s,c){var h=s._dbNamesDB;return h||(h=s._dbNamesDB=new Sr(zr,{addons:[],indexedDB:s,IDBKeyRange:c})).version(1).stores({dbnames:"name"}),h.table("dbnames")}function fo(s){return s&&typeof s.databases=="function"}function Fo(s){return Nn(function(){return qe.letThrough=!0,s()})}function Qi(s){return!("from"in s)}var Jt=function(s,c){var h;if(!this)return h=new Jt,s&&"d"in s&&v(h,s),h;v(this,arguments.length?{d:1,from:s,to:1<arguments.length?c:s}:{d:0})};function xi(s,c,h){var y=dt(c,h);if(!isNaN(y)){if(0<y)throw RangeError();if(Qi(s))return v(s,{from:c,to:h,d:1});var y=s.l,_=s.r;if(dt(h,s.from)<0)return y?xi(y,c,h):s.l={from:c,to:h,d:1,l:null,r:null},Ka(s);if(0<dt(c,s.to))return _?xi(_,c,h):s.r={from:c,to:h,d:1,l:null,r:null},Ka(s);dt(c,s.from)<0&&(s.from=c,s.l=null,s.d=_?_.d+1:1),0<dt(h,s.to)&&(s.to=h,s.r=null,s.d=s.l?s.l.d+1:1),c=!s.r,y&&!s.l&&wi(s,y),_&&c&&wi(s,_)}}function wi(s,c){Qi(c)||(function h(y,_){var k=_.from,T=_.l,A=_.r;xi(y,k,_.to),T&&h(y,T),A&&h(y,A)})(s,c)}function Gi(s,c){var h=Zi(c),y=h.next();if(!y.done)for(var _=y.value,k=Zi(s),T=k.next(_.from),A=T.value;!y.done&&!T.done;){if(dt(A.from,_.to)<=0&&0<=dt(A.to,_.from))return!0;dt(_.from,A.from)<0?_=(y=h.next(A.from)).value:A=(T=k.next(_.from)).value}return!1}function Zi(s){var c=Qi(s)?null:{s:0,n:s};return{next:function(h){for(var y=0<arguments.length;c;)switch(c.s){case 0:if(c.s=1,y)for(;c.n.l&&dt(h,c.n.from)<0;)c={up:c,n:c.n.l,s:1};else for(;c.n.l;)c={up:c,n:c.n.l,s:1};case 1:if(c.s=2,!y||dt(h,c.n.to)<=0)return{value:c.n,done:!1};case 2:if(c.n.r){c.s=3,c={up:c,n:c.n.r,s:0};continue}case 3:c=c.up}return{done:!0}}}}function Ka(s){var c,h,y,_=(((_=s.r)==null?void 0:_.d)||0)-(((_=s.l)==null?void 0:_.d)||0),_=1<_?"r":_<-1?"l":"";_&&(c=_=="r"?"l":"r",h=a({},s),y=s[_],s.from=y.from,s.to=y.to,s[_]=y[_],h[_]=y[c],(s[c]=h).d=Ua(h)),s.d=Ua(s)}function Ua(h){var c=h.r,h=h.l;return(c?h?Math.max(c.d,h.d):c.d:h?h.d:0)+1}function Ji(s,c){return d(c).forEach(function(h){s[h]?wi(s[h],c[h]):s[h]=(function y(_){var k,T,A={};for(k in _)x(_,k)&&(T=_[k],A[k]=!T||typeof T!="object"||Q.has(T.constructor)?T:y(T));return A})(c[h])}),s}function Bs(s,c){return s.all||c.all||Object.keys(s).some(function(h){return c[h]&&Gi(c[h],s[h])})}S(Jt.prototype,((Ct={add:function(s){return wi(this,s),this},addKey:function(s){return xi(this,s,s),this},addKeys:function(s){var c=this;return s.forEach(function(h){return xi(c,h,h)}),this},hasKey:function(s){var c=Zi(this).next(s).value;return c&&dt(c.from,s)<=0&&0<=dt(c.to,s)}})[te]=function(){return Zi(this)},Ct));var Kr={},Hs={},Vs=!1;function es(s){Ji(Hs,s),Vs||(Vs=!0,setTimeout(function(){Vs=!1,Ks(Hs,!(Hs={}))},0))}function Ks(s,c){c===void 0&&(c=!1);var h=new Set;if(s.all)for(var y=0,_=Object.values(Kr);y<_.length;y++)ts(A=_[y],s,h,c);else for(var k in s){var T,A,k=/^idb\:\/\/(.*)\/(.*)\//.exec(k);k&&(T=k[1],k=k[2],A=Kr["idb://".concat(T,"/").concat(k)])&&ts(A,s,h,c)}h.forEach(function(G){return G()})}function ts(s,c,h,y){for(var _=[],k=0,T=Object.entries(s.queries.query);k<T.length;k++){for(var A=T[k],G=A[0],se=[],J=0,Y=A[1];J<Y.length;J++){var Z=Y[J];Bs(c,Z.obsSet)?Z.subscribers.forEach(function(oe){return h.add(oe)}):y&&se.push(Z)}y&&_.push([G,se])}if(y)for(var ie=0,re=_;ie<re.length;ie++){var ne=re[ie],G=ne[0],se=ne[1];s.queries.query[G]=se}}function Ou(s){var c=s._state,h=s._deps.indexedDB;if(c.isBeingOpened||s.idbdb)return c.dbReadyPromise.then(function(){return c.dbOpenError?Pt(c.dbOpenError):s});c.isBeingOpened=!0,c.dbOpenError=null,c.openComplete=!1;var y=c.openCanceller,_=Math.round(10*s.verno),k=!1;function T(){if(c.openCanceller!==y)throw new be.DatabaseClosed("db.open() was cancelled")}function A(){return new Be(function(Z,ie){if(T(),!h)throw new be.MissingAPI;var re=s.name,ne=c.autoSchema||!_?h.open(re):h.open(re,_);if(!ne)throw new be.MissingAPI;ne.onerror=sn(ie),ne.onblocked=ut(s._fireOnBlocked),ne.onupgradeneeded=ut(function(oe){var ge;J=ne.transaction,c.autoSchema&&!s._options.allowEmptyDB?(ne.onerror=An,J.abort(),ne.result.close(),(ge=h.deleteDatabase(re)).onsuccess=ge.onerror=ut(function(){ie(new be.NoSuchDatabase("Database ".concat(re," doesnt exist")))})):(J.onerror=sn(ie),ge=oe.oldVersion>Math.pow(2,62)?0:oe.oldVersion,Y=ge<1,s.idbdb=ne.result,k&&Wi(s,J),Fs(s,ge/10,J,ie))},ie),ne.onsuccess=ut(function(){J=null;var oe,ge,fe,ve,Ee,Ce,Oe=s.idbdb=ne.result,Te=H(Oe.objectStoreNames);if(0<Te.length)try{var He=Oe.transaction((Ee=Te).length===1?Ee[0]:Ee,"readonly");if(c.autoSchema)Ce=Oe,ve=He,(fe=s).verno=Ce.version/10,ve=fe._dbSchema=Zt(0,Ce,ve),fe._storeNames=H(Ce.objectStoreNames,0),Do(fe,[fe._allTables],d(ve),ve);else if(wr(s,s._dbSchema,He),ge=He,((ge=Yi(Zt(0,(oe=s).idbdb,ge),oe._dbSchema)).add.length||ge.change.some(function($e){return $e.add.length||$e.change.length}))&&!k)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),Oe.close(),_=Oe.version+1,k=!0,Z(A());uo(s,He)}catch{}co.add(s),Oe.onversionchange=ut(function($e){c.vcFired=!0,s.on("versionchange").fire($e)}),Oe.onclose=ut(function(){s.close({disableAutoOpen:!1})}),Y&&(Te=s._deps,Ee=re,fo(Ce=Te.indexedDB)||Ee===zr||vi(Ce,Te.IDBKeyRange).put({name:Ee}).catch(Fe)),Z()},ie)}).catch(function(Z){switch(Z==null?void 0:Z.name){case"UnknownError":if(0<c.PR1398_maxLoop)return c.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),A();break;case"VersionError":if(0<_)return _=0,A()}return Be.reject(Z)})}var G,se=c.dbReadyResolve,J=null,Y=!1;return Be.race([y,(typeof navigator>"u"?Be.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Z){function ie(){return indexedDB.databases().finally(Z)}G=setInterval(ie,100),ie()}).finally(function(){return clearInterval(G)}):Promise.resolve()).then(A)]).then(function(){return T(),c.onReadyBeingFired=[],Be.resolve(Fo(function(){return s.on.ready.fire(s.vip)})).then(function Z(){var ie;if(0<c.onReadyBeingFired.length)return ie=c.onReadyBeingFired.reduce(qt,Fe),c.onReadyBeingFired=[],Be.resolve(Fo(function(){return ie(s.vip)})).then(Z)})}).finally(function(){c.openCanceller===y&&(c.onReadyBeingFired=null,c.isBeingOpened=!1)}).catch(function(Z){c.dbOpenError=Z;try{J&&J.abort()}catch{}return y===c.openCanceller&&s._close(),Pt(Z)}).finally(function(){c.openComplete=!0,se()}).then(function(){var Z;return Y&&(Z={},s.tables.forEach(function(ie){ie.schema.indexes.forEach(function(re){re.name&&(Z["idb://".concat(s.name,"/").concat(ie.name,"/").concat(re.name)]=new Jt(-1/0,[[[]]]))}),Z["idb://".concat(s.name,"/").concat(ie.name,"/")]=Z["idb://".concat(s.name,"/").concat(ie.name,"/:dels")]=new Jt(-1/0,[[[]]])}),$n(pi).fire(Z),Ks(Z,!0)),s})}function Us(s){function c(k){return s.next(k)}var h=_(c),y=_(function(k){return s.throw(k)});function _(k){return function(A){var A=k(A),G=A.value;return A.done?G:G&&typeof G.then=="function"?G.then(h,y):m(G)?Promise.all(G).then(h,y):h(G)}}return _(c)()}function ns(s,c,h){for(var y=m(s)?s.slice():[s],_=0;_<h;++_)y.push(c);return y}var qa={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(s){return a(a({},s),{table:function(y){var h=s.table(y),y=h.schema,_={},k=[];function T(Z,ie,re){var fe=hi(Z),ne=_[fe]=_[fe]||[],oe=Z==null?0:typeof Z=="string"?1:Z.length,ge=0<ie,fe=a(a({},re),{name:ge?"".concat(fe,"(virtual-from:").concat(re.name,")"):re.name,lowLevelIndex:re,isVirtual:ge,keyTail:ie,keyLength:oe,extractKey:ao(Z),unique:!ge&&re.unique});return ne.push(fe),fe.isPrimaryKey||k.push(fe),1<oe&&T(oe===2?Z[0]:Z.slice(0,oe-1),ie+1,re),ne.sort(function(ve,Ee){return ve.keyTail-Ee.keyTail}),fe}var A=T(y.primaryKey.keyPath,0,y.primaryKey);_[":id"]=[A];for(var G=0,se=y.indexes;G<se.length;G++){var J=se[G];T(J.keyPath,0,J)}function Y(Z){var ie,re=Z.query.index;return re.isVirtual?a(a({},Z),{query:{index:re.lowLevelIndex,range:(ie=Z.query.range,re=re.keyTail,{type:ie.type===1?2:ie.type,lower:ns(ie.lower,ie.lowerOpen?s.MAX_KEY:s.MIN_KEY,re),lowerOpen:!0,upper:ns(ie.upper,ie.upperOpen?s.MIN_KEY:s.MAX_KEY,re),upperOpen:!0})}}):Z}return a(a({},h),{schema:a(a({},y),{primaryKey:A,indexes:k,getIndexByKeyPath:function(Z){return(Z=_[hi(Z)])&&Z[0]}}),count:function(Z){return h.count(Y(Z))},query:function(Z){return h.query(Y(Z))},openCursor:function(Z){var ie=Z.query.index,re=ie.keyTail,ne=ie.keyLength;return ie.isVirtual?h.openCursor(Y(Z)).then(function(ge){return ge&&oe(ge)}):h.openCursor(Z);function oe(ge){return Object.create(ge,{continue:{value:function(fe){fe!=null?ge.continue(ns(fe,Z.reverse?s.MAX_KEY:s.MIN_KEY,re)):Z.unique?ge.continue(ge.key.slice(0,ne).concat(Z.reverse?s.MIN_KEY:s.MAX_KEY,re)):ge.continue()}},continuePrimaryKey:{value:function(fe,ve){ge.continuePrimaryKey(ns(fe,s.MAX_KEY,re),ve)}},primaryKey:{get:function(){return ge.primaryKey}},key:{get:function(){var fe=ge.key;return ne===1?fe[0]:fe.slice(0,ne)}},value:{get:function(){return ge.value}}})}}})}})}};function qs(s,c,h,y){return h=h||{},y=y||"",d(s).forEach(function(_){var k,T,A;x(c,_)?(k=s[_],T=c[_],typeof k=="object"&&typeof T=="object"&&k&&T?(A=ue(k))!==ue(T)?h[y+_]=c[_]:A==="Object"?qs(k,T,h,y+_+"."):k!==T&&(h[y+_]=c[_]):k!==T&&(h[y+_]=c[_])):h[y+_]=void 0}),d(c).forEach(function(_){x(s,_)||(h[y+_]=c[_])}),h}function Ws(s,c){return c.type==="delete"?c.keys:c.keys||c.values.map(s.extractKey)}var Ru={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(s){return a(a({},s),{table:function(c){var h=s.table(c),y=h.schema.primaryKey;return a(a({},h),{mutate:function(_){var k=qe.trans,T=k.table(c).hook,A=T.deleting,G=T.creating,se=T.updating;switch(_.type){case"add":if(G.fire===Fe)break;return k._promise("readwrite",function(){return J(_)},!0);case"put":if(G.fire===Fe&&se.fire===Fe)break;return k._promise("readwrite",function(){return J(_)},!0);case"delete":if(A.fire===Fe)break;return k._promise("readwrite",function(){return J(_)},!0);case"deleteRange":if(A.fire===Fe)break;return k._promise("readwrite",function(){return(function Y(Z,ie,re){return h.query({trans:Z,values:!1,query:{index:y,range:ie},limit:re}).then(function(ne){var oe=ne.result;return J({type:"delete",keys:oe,trans:Z}).then(function(ge){return 0<ge.numFailures?Promise.reject(ge.failures[0]):oe.length<re?{failures:[],numFailures:0,lastResult:void 0}:Y(Z,a(a({},ie),{lower:oe[oe.length-1],lowerOpen:!0}),re)})})})(_.trans,_.range,1e4)},!0)}return h.mutate(_);function J(Y){var Z,ie,re,ne=qe.trans,oe=Y.keys||Ws(y,Y);if(oe)return(Y=Y.type==="add"||Y.type==="put"?a(a({},Y),{keys:oe}):a({},Y)).type!=="delete"&&(Y.values=u([],Y.values)),Y.keys&&(Y.keys=u([],Y.keys)),Z=h,re=oe,((ie=Y).type==="add"?Promise.resolve([]):Z.getMany({trans:ie.trans,keys:re,cache:"immutable"})).then(function(ge){var fe=oe.map(function(ve,Ee){var Ce,Oe,Te,He=ge[Ee],$e={onerror:null,onsuccess:null};return Y.type==="delete"?A.fire.call($e,ve,He,ne):Y.type==="add"||He===void 0?(Ce=G.fire.call($e,ve,Y.values[Ee],ne),ve==null&&Ce!=null&&(Y.keys[Ee]=ve=Ce,y.outbound||U(Y.values[Ee],y.keyPath,ve))):(Ce=qs(He,Y.values[Ee]),(Oe=se.fire.call($e,Ce,ve,He,ne))&&(Te=Y.values[Ee],Object.keys(Oe).forEach(function(Ue){x(Te,Ue)?Te[Ue]=Oe[Ue]:U(Te,Ue,Oe[Ue])}))),$e});return h.mutate(Y).then(function(ve){for(var Ee=ve.failures,Ce=ve.results,Oe=ve.numFailures,ve=ve.lastResult,Te=0;Te<oe.length;++Te){var He=(Ce||oe)[Te],$e=fe[Te];He==null?$e.onerror&&$e.onerror(Ee[Te]):$e.onsuccess&&$e.onsuccess(Y.type==="put"&&ge[Te]?Y.values[Te]:He)}return{failures:Ee,results:Ce,numFailures:Oe,lastResult:ve}}).catch(function(ve){return fe.forEach(function(Ee){return Ee.onerror&&Ee.onerror(ve)}),Promise.reject(ve)})});throw new Error("Keys missing")}}})}})}};function Wa(s,c,h){try{if(!c||c.keys.length<s.length)return null;for(var y=[],_=0,k=0;_<c.keys.length&&k<s.length;++_)dt(c.keys[_],s[k])===0&&(y.push(h?xe(c.values[_]):c.values[_]),++k);return y.length===s.length?y:null}catch{return null}}var Du={stack:"dbcore",level:-1,create:function(s){return{table:function(c){var h=s.table(c);return a(a({},h),{getMany:function(y){var _;return y.cache?(_=Wa(y.keys,y.trans._cache,y.cache==="clone"))?Be.resolve(_):h.getMany(y).then(function(k){return y.trans._cache={keys:y.keys,values:y.cache==="clone"?xe(k):k},k}):h.getMany(y)},mutate:function(y){return y.type!=="add"&&(y.trans._cache=null),h.mutate(y)}})}}}};function Ya(s,c){return s.trans.mode==="readonly"&&!!s.subscr&&!s.trans.explicit&&s.trans.db._options.cache!=="disabled"&&!c.schema.primaryKey.outbound}function Xa(s,c){switch(s){case"query":return c.values&&!c.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Ys={stack:"dbcore",level:0,name:"Observability",create:function(s){var c=s.schema.name,h=new Jt(s.MIN_KEY,s.MAX_KEY);return a(a({},s),{transaction:function(y,_,k){if(qe.subscr&&_!=="readonly")throw new be.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(qe.querier));return s.transaction(y,_,k)},table:function(y){function _(oe){var ne,oe=oe.query;return[ne=oe.index,new Jt((ne=(oe=oe.range).lower)!=null?ne:s.MIN_KEY,(ne=oe.upper)!=null?ne:s.MAX_KEY)]}var k=s.table(y),T=k.schema,A=T.primaryKey,G=T.indexes,se=A.extractKey,J=A.outbound,Y=A.autoIncrement&&G.filter(function(re){return re.compound&&re.keyPath.includes(A.keyPath)}),Z=a(a({},k),{mutate:function(re){function ne(Ne){return Ne="idb://".concat(c,"/").concat(y,"/").concat(Ne),Ee[Ne]||(Ee[Ne]=new Jt)}var oe,ge,fe,ve=re.trans,Ee=re.mutatedParts||(re.mutatedParts={}),Ce=ne(""),Oe=ne(":dels"),Te=re.type,$e=re.type==="deleteRange"?[re.range]:re.type==="delete"?[re.keys]:re.values.length<50?[Ws(A,re).filter(function(Ne){return Ne}),re.values]:[],He=$e[0],$e=$e[1],Ue=re.trans._cache;return m(He)?(Ce.addKeys(He),(Te=Te==="delete"||He.length===$e.length?Wa(He,Ue):null)||Oe.addKeys(He),(Te||$e)&&(oe=ne,ge=Te,fe=$e,T.indexes.forEach(function(Ne){var rt=oe(Ne.name||"");function ot(pt){return pt!=null?Ne.extractKey(pt):null}function at(pt){Ne.multiEntry&&m(pt)?pt.forEach(function(gn){return rt.addKey(gn)}):rt.addKey(pt)}(ge||fe).forEach(function(pt,jt){var st=ge&&ot(ge[jt]),jt=fe&&ot(fe[jt]);dt(st,jt)!==0&&(st!=null&&at(st),jt!=null)&&at(jt)})}))):He?($e={from:(Ue=He.lower)!=null?Ue:s.MIN_KEY,to:(Te=He.upper)!=null?Te:s.MAX_KEY},Oe.add($e),Ce.add($e)):(Ce.add(h),Oe.add(h),T.indexes.forEach(function(Ne){return ne(Ne.name).add(h)})),k.mutate(re).then(function(Ne){return!He||re.type!=="add"&&re.type!=="put"||(Ce.addKeys(Ne.results),Y&&Y.forEach(function(rt){for(var ot=re.values.map(function(st){return rt.extractKey(st)}),at=rt.keyPath.findIndex(function(st){return st===A.keyPath}),pt=0,gn=Ne.results.length;pt<gn;++pt)ot[pt][at]=Ne.results[pt];ne(rt.name).addKeys(ot)})),ve.mutatedParts=Ji(ve.mutatedParts||{},Ee),Ne})}}),ie={get:function(re){return[A,new Jt(re.key)]},getMany:function(re){return[A,new Jt().addKeys(re.keys)]},count:_,query:_,openCursor:_};return d(ie).forEach(function(re){Z[re]=function(ne){var oe=qe.subscr,ge=!!oe,fe=Ya(qe,k)&&Xa(re,ne)?ne.obsSet={}:oe;if(ge){var ve,oe=function($e){return $e="idb://".concat(c,"/").concat(y,"/").concat($e),fe[$e]||(fe[$e]=new Jt)},Ee=oe(""),Ce=oe(":dels"),ge=ie[re](ne),Oe=ge[0],ge=ge[1];if((re==="query"&&Oe.isPrimaryKey&&!ne.values?Ce:oe(Oe.name||"")).add(ge),!Oe.isPrimaryKey){if(re!=="count")return ve=re==="query"&&J&&ne.values&&k.query(a(a({},ne),{values:!1})),k[re].apply(this,arguments).then(function($e){if(re==="query"){if(J&&ne.values)return ve.then(function(ot){return ot=ot.result,Ee.addKeys(ot),$e});var Ue=ne.values?$e.result.map(se):$e.result;(ne.values?Ee:Ce).addKeys(Ue)}else{var Ne,rt;if(re==="openCursor")return rt=ne.values,(Ne=$e)&&Object.create(Ne,{key:{get:function(){return Ce.addKey(Ne.primaryKey),Ne.key}},primaryKey:{get:function(){var ot=Ne.primaryKey;return Ce.addKey(ot),ot}},value:{get:function(){return rt&&Ee.addKey(Ne.primaryKey),Ne.value}}})}return $e});Ce.add(h)}}return k[re].apply(this,arguments)}}),Z}})}};function Bo(s,c,h){var y;return h.numFailures===0?c:c.type==="deleteRange"||(y=c.keys?c.keys.length:"values"in c&&c.values?c.values.length:1,h.numFailures===y)?null:(y=a({},c),m(y.keys)&&(y.keys=y.keys.filter(function(_,k){return!(k in h.failures)})),"values"in y&&m(y.values)&&(y.values=y.values.filter(function(_,k){return!(k in h.failures)})),y)}function Xs(s,c){return h=s,((y=c).lower===void 0||(y.lowerOpen?0<dt(h,y.lower):0<=dt(h,y.lower)))&&(h=s,(y=c).upper===void 0||(y.upperOpen?dt(h,y.upper)<0:dt(h,y.upper)<=0));var h,y}function Qs(s,c,h,y,_,k){var T,A,G,se,J,Y,Z;return!h||h.length===0||(T=c.query.index,A=T.multiEntry,G=c.query.range,se=y.schema.primaryKey.extractKey,J=T.extractKey,Y=(T.lowLevelIndex||T).extractKey,(y=h.reduce(function(ie,re){var ne=ie,oe=[];if(re.type==="add"||re.type==="put")for(var ge=new Jt,fe=re.values.length-1;0<=fe;--fe){var ve,Ee=re.values[fe],Ce=se(Ee);!ge.hasKey(Ce)&&(ve=J(Ee),A&&m(ve)?ve.some(function(Ue){return Xs(Ue,G)}):Xs(ve,G))&&(ge.addKey(Ce),oe.push(Ee))}switch(re.type){case"add":var Oe=new Jt().addKeys(c.values?ie.map(function(Ne){return se(Ne)}):ie),ne=ie.concat(c.values?oe.filter(function(Ne){return Ne=se(Ne),!Oe.hasKey(Ne)&&(Oe.addKey(Ne),!0)}):oe.map(function(Ne){return se(Ne)}).filter(function(Ne){return!Oe.hasKey(Ne)&&(Oe.addKey(Ne),!0)}));break;case"put":var Te=new Jt().addKeys(re.values.map(function(Ne){return se(Ne)}));ne=ie.filter(function(Ne){return!Te.hasKey(c.values?se(Ne):Ne)}).concat(c.values?oe:oe.map(function(Ne){return se(Ne)}));break;case"delete":var He=new Jt().addKeys(re.keys);ne=ie.filter(function(Ne){return!He.hasKey(c.values?se(Ne):Ne)});break;case"deleteRange":var $e=re.range;ne=ie.filter(function(Ne){return!Xs(se(Ne),$e)})}return ne},s))===s)?s:(Z=function(ie,re){return dt(Y(ie),Y(re))||dt(se(ie),se(re))},y.sort(c.direction==="prev"||c.direction==="prevunique"?function(ie,re){return Z(re,ie)}:Z),c.limit&&c.limit<1/0&&(y.length>c.limit?y.length=c.limit:s.length===c.limit&&y.length<c.limit&&(_.dirty=!0)),k?Object.freeze(y):y)}function Gs(s,c){return dt(s.lower,c.lower)===0&&dt(s.upper,c.upper)===0&&!!s.lowerOpen==!!c.lowerOpen&&!!s.upperOpen==!!c.upperOpen}function Qa(s,c){return((h,y,_,k)=>{if(h===void 0)return y!==void 0?-1:0;if(y===void 0)return 1;if((h=dt(h,y))===0){if(_&&k)return 0;if(_)return 1;if(k)return-1}return h})(s.lower,c.lower,s.lowerOpen,c.lowerOpen)<=0&&0<=((h,y,_,k)=>{if(h===void 0)return y!==void 0?1:0;if(y===void 0)return-1;if((h=dt(h,y))===0){if(_&&k)return 0;if(_)return-1;if(k)return 1}return h})(s.upper,c.upper,s.upperOpen,c.upperOpen)}function Ga(s,c,h,y){s.subscribers.add(h),y.addEventListener("abort",function(){var _,k;s.subscribers.delete(h),s.subscribers.size===0&&(_=s,k=c,setTimeout(function(){_.subscribers.size===0&&L(k,_)},3e3))})}var Za={stack:"dbcore",level:0,name:"Cache",create:function(s){var c=s.schema.name;return a(a({},s),{transaction:function(h,y,_){var k,T,A=s.transaction(h,y,_);return y==="readwrite"&&(_=(k=new AbortController).signal,A.addEventListener("abort",(T=function(G){return function(){if(k.abort(),y==="readwrite"){for(var se=new Set,J=0,Y=h;J<Y.length;J++){var Z=Y[J],ie=Kr["idb://".concat(c,"/").concat(Z)];if(ie){var re=s.table(Z),ne=ie.optimisticOps.filter(function(Ne){return Ne.trans===A});if(A._explicit&&G&&A.mutatedParts)for(var oe=0,ge=Object.values(ie.queries.query);oe<ge.length;oe++)for(var fe=0,ve=(Oe=ge[oe]).slice();fe<ve.length;fe++)Bs((Te=ve[fe]).obsSet,A.mutatedParts)&&(L(Oe,Te),Te.subscribers.forEach(function(Ne){return se.add(Ne)}));else if(0<ne.length){ie.optimisticOps=ie.optimisticOps.filter(function(Ne){return Ne.trans!==A});for(var Ee=0,Ce=Object.values(ie.queries.query);Ee<Ce.length;Ee++)for(var Oe,Te,He,$e=0,Ue=(Oe=Ce[Ee]).slice();$e<Ue.length;$e++)(Te=Ue[$e]).res!=null&&A.mutatedParts&&(G&&!Te.dirty?(He=Object.isFrozen(Te.res),He=Qs(Te.res,Te.req,ne,re,Te,He),Te.dirty?(L(Oe,Te),Te.subscribers.forEach(function(Ne){return se.add(Ne)})):He!==Te.res&&(Te.res=He,Te.promise=Be.resolve({result:He}))):(Te.dirty&&L(Oe,Te),Te.subscribers.forEach(function(Ne){return se.add(Ne)})))}}}se.forEach(function(Ne){return Ne()})}}})(!1),{signal:_}),A.addEventListener("error",T(!1),{signal:_}),A.addEventListener("complete",T(!0),{signal:_})),A},table:function(h){var y=s.table(h),_=y.schema.primaryKey;return a(a({},y),{mutate:function(k){var T,A=qe.trans;return!_.outbound&&A.db._options.cache!=="disabled"&&!A.explicit&&A.idbtrans.mode==="readwrite"&&(T=Kr["idb://".concat(c,"/").concat(h)])?(A=y.mutate(k),k.type!=="add"&&k.type!=="put"||!(50<=k.values.length||Ws(_,k).some(function(G){return G==null}))?(T.optimisticOps.push(k),k.mutatedParts&&es(k.mutatedParts),A.then(function(G){0<G.numFailures&&(L(T.optimisticOps,k),(G=Bo(0,k,G))&&T.optimisticOps.push(G),k.mutatedParts)&&es(k.mutatedParts)}),A.catch(function(){L(T.optimisticOps,k),k.mutatedParts&&es(k.mutatedParts)})):A.then(function(G){var se=Bo(0,a(a({},k),{values:k.values.map(function(J,Y){var Z;return G.failures[Y]?J:(U(Z=(Z=_.keyPath)!=null&&Z.includes(".")?xe(J):a({},J),_.keyPath,G.results[Y]),Z)})}),G);T.optimisticOps.push(se),queueMicrotask(function(){return k.mutatedParts&&es(k.mutatedParts)})}),A):y.mutate(k)},query:function(k){var T,A,G,se,J,Y,Z;return Ya(qe,y)&&Xa("query",k)?(T=((G=qe.trans)==null?void 0:G.db._options.cache)==="immutable",A=(G=qe).requery,G=G.signal,Y=((ie,re,ne,oe)=>{var ge=Kr["idb://".concat(ie,"/").concat(re)];if(!ge)return[];if(!(ie=ge.queries[ne]))return[null,!1,ge,null];var fe=ie[(oe.query?oe.query.index.name:null)||""];if(!fe)return[null,!1,ge,null];switch(ne){case"query":var ve=(Ee=oe.direction)!=null?Ee:"next",Ee=fe.find(function(Ce){var Oe;return Ce.req.limit===oe.limit&&Ce.req.values===oe.values&&((Oe=Ce.req.direction)!=null?Oe:"next")===ve&&Gs(Ce.req.query.range,oe.query.range)});return Ee?[Ee,!0,ge,fe]:[fe.find(function(Ce){var Oe;return("limit"in Ce.req?Ce.req.limit:1/0)>=oe.limit&&((Oe=Ce.req.direction)!=null?Oe:"next")===ve&&(!oe.values||Ce.req.values)&&Qa(Ce.req.query.range,oe.query.range)}),!1,ge,fe];case"count":return Ee=fe.find(function(Ce){return Gs(Ce.req.query.range,oe.query.range)}),[Ee,!!Ee,ge,fe]}})(c,h,"query",k),Z=Y[0],se=Y[2],J=Y[3],Z&&Y[1]?Z.obsSet=k.obsSet:(Y=y.query(k).then(function(ie){var re=ie.result;if(Z&&(Z.res=re),T){for(var ne=0,oe=re.length;ne<oe;++ne)Object.freeze(re[ne]);Object.freeze(re)}else ie.result=xe(re);return ie}).catch(function(ie){return J&&Z&&L(J,Z),Promise.reject(ie)}),Z={obsSet:k.obsSet,promise:Y,subscribers:new Set,type:"query",req:k,dirty:!1},J?J.push(Z):(J=[Z],(se=se||(Kr["idb://".concat(c,"/").concat(h)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[k.query.index.name||""]=J)),Ga(Z,J,A,G),Z.promise.then(function(ie){return{result:Qs(ie.result,k,se==null?void 0:se.optimisticOps,y,Z,T)}})):y.query(k)}})}})}};function _r(s,c){return new Proxy(s,{get:function(h,y,_){return y==="db"?c:Reflect.get(h,y,_)}})}Rt.prototype.version=function(s){if(isNaN(s)||s<.1)throw new be.Type("Given version is not a positive number");if(s=Math.round(10*s)/10,this.idbdb||this._state.isBeingOpened)throw new be.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,s);var c=this._versions,h=c.filter(function(y){return y._cfg.version===s})[0];return h||(h=new this.Version(s),c.push(h),c.sort(Vr),h.stores({}),this._state.autoSchema=!1),h},Rt.prototype._whenReady=function(s){var c=this;return this.idbdb&&(this._state.openComplete||qe.letThrough||this._vip)?s():new Be(function(h,y){if(c._state.openComplete)return y(new be.DatabaseClosed(c._state.dbOpenError));if(!c._state.isBeingOpened){if(!c._state.autoOpen)return void y(new be.DatabaseClosed);c.open().catch(Fe)}c._state.dbReadyPromise.then(h,y)}).then(s)},Rt.prototype.use=function(_){var c=_.stack,h=_.create,y=_.level,_=_.name,k=(_&&this.unuse({stack:c,name:_}),this._middlewares[c]||(this._middlewares[c]=[]));return k.push({stack:c,create:h,level:y??10,name:_}),k.sort(function(T,A){return T.level-A.level}),this},Rt.prototype.unuse=function(s){var c=s.stack,h=s.name,y=s.create;return c&&this._middlewares[c]&&(this._middlewares[c]=this._middlewares[c].filter(function(_){return y?_.create!==y:!!h&&_.name!==h})),this},Rt.prototype.open=function(){var s=this;return nr(bn,function(){return Ou(s)})},Rt.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var s=this._state;if(co.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}s.isBeingOpened||(s.dbReadyPromise=new Be(function(c){s.dbReadyResolve=c}),s.openCanceller=new Be(function(c,h){s.cancelOpen=h}))},Rt.prototype.close=function(c){var c=(c===void 0?{disableAutoOpen:!0}:c).disableAutoOpen,h=this._state;c?(h.isBeingOpened&&h.cancelOpen(new be.DatabaseClosed),this._close(),h.autoOpen=!1,h.dbOpenError=new be.DatabaseClosed):(this._close(),h.autoOpen=this._options.autoOpen||h.isBeingOpened,h.openComplete=!1,h.dbOpenError=null)},Rt.prototype.delete=function(s){var c=this,h=(s===void 0&&(s={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),y=this._state;return new Be(function(_,k){function T(){c.close(s);var A=c._deps.indexedDB.deleteDatabase(c.name);A.onsuccess=ut(function(){var G,se,J;G=c._deps,se=c.name,fo(J=G.indexedDB)||se===zr||vi(J,G.IDBKeyRange).delete(se).catch(Fe),_()}),A.onerror=sn(k),A.onblocked=c._fireOnBlocked}if(h)throw new be.InvalidArgument("Invalid closeOptions argument to db.delete()");y.isBeingOpened?y.dbReadyPromise.then(T):T()})},Rt.prototype.backendDB=function(){return this.idbdb},Rt.prototype.isOpen=function(){return this.idbdb!==null},Rt.prototype.hasBeenClosed=function(){var s=this._state.dbOpenError;return s&&s.name==="DatabaseClosed"},Rt.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Rt.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Rt.prototype,"tables",{get:function(){var s=this;return d(this._allTables).map(function(c){return s._allTables[c]})},enumerable:!1,configurable:!0}),Rt.prototype.transaction=function(){var s=(function(c,h,y){var _=arguments.length;if(_<2)throw new be.InvalidArgument("Too few arguments");for(var k=new Array(_-1);--_;)k[_-1]=arguments[_];return y=k.pop(),[c,_e(k),y]}).apply(this,arguments);return this._transaction.apply(this,s)},Rt.prototype._transaction=function(s,c,h){var y,_,k=this,T=qe.trans,A=(T&&T.db===this&&s.indexOf("!")===-1||(T=null),s.indexOf("?")!==-1);s=s.replace("!","").replace("?","");try{if(_=c.map(function(se){if(se=se instanceof k.Table?se.name:se,typeof se!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return se}),s=="r"||s===Ao)y=Ao;else{if(s!="rw"&&s!=Lr)throw new be.InvalidArgument("Invalid transaction mode: "+s);y=Lr}if(T){if(T.mode===Ao&&y===Lr){if(!A)throw new be.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");T=null}T&&_.forEach(function(se){if(T&&T.storeNames.indexOf(se)===-1){if(!A)throw new be.SubTransaction("Table "+se+" not included in parent transaction.");T=null}}),A&&T&&!T.active&&(T=null)}}catch(se){return T?T._promise(null,function(J,Y){Y(se)}):Pt(se)}var G=(function se(J,Y,Z,ie,re){return Be.resolve().then(function(){var fe=qe.transless||qe,ne=J._createTransaction(Y,Z,J._dbSchema,ie),fe=(ne.explicit=!0,{trans:ne,transless:fe});if(ie)ne.idbtrans=ie.idbtrans;else try{ne.create(),ne.idbtrans._explicit=!0,J._state.PR1398_maxLoop=3}catch(ve){return ve.name===we.InvalidState&&J.isOpen()&&0<--J._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),J.close({disableAutoOpen:!1}),J.open().then(function(){return se(J,Y,Z,null,re)})):Pt(ve)}var oe,ge=O(re),fe=(ge&&Cn(),Be.follow(function(){var ve;(oe=re.call(ne,ne))&&(ge?(ve=Ft.bind(null,null),oe.then(ve,ve)):typeof oe.next=="function"&&typeof oe.throw=="function"&&(oe=Us(oe)))},fe));return(oe&&typeof oe.then=="function"?Be.resolve(oe).then(function(ve){return ne.active?ve:Pt(new be.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):fe.then(function(){return oe})).then(function(ve){return ie&&ne._resolve(),ne._completion.then(function(){return ve})}).catch(function(ve){return ne._reject(ve),Pt(ve)})})}).bind(null,this,y,_,T,h);return T?T._promise(y,G,"lock"):qe.trans?nr(qe.transless,function(){return k._whenReady(G)}):this._whenReady(G)},Rt.prototype.table=function(s){if(x(this._allTables,s))return this._allTables[s];throw new be.InvalidTable("Table ".concat(s," does not exist"))};var Sr=Rt;function Rt(s,c){var h,y,_,k,T,A=this,G=(this._middlewares={},this.verno=0,Rt.dependencies),G=(this._options=c=a({addons:Rt.addons,autoOpen:!0,indexedDB:G.indexedDB,IDBKeyRange:G.IDBKeyRange,cache:"cloned",maxConnections:1e3},c),this._deps={indexedDB:c.indexedDB,IDBKeyRange:c.IDBKeyRange},c.addons),se=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Fe,dbReadyPromise:null,cancelOpen:Fe,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:c.autoOpen}),J=(se.dbReadyPromise=new Be(function(Y){se.dbReadyResolve=Y}),se.openCanceller=new Be(function(Y,Z){se.cancelOpen=Z}),this._state=se,this.name=s,this.on=Fr(this,"populate","blocked","versionchange","close",{ready:[qt,Fe]}),this.once=function(Y,Z){var ie=function(){for(var re=[],ne=0;ne<arguments.length;ne++)re[ne]=arguments[ne];A.on(Y).unsubscribe(ie),Z.apply(A,re)};return A.on(Y,ie)},this.on.ready.subscribe=j(this.on.ready.subscribe,function(Y){return function(Z,ie){Rt.vip(function(){var re,ne=A._state;ne.openComplete?(ne.dbOpenError||Be.resolve().then(Z),ie&&Y(Z)):ne.onReadyBeingFired?(ne.onReadyBeingFired.push(Z),ie&&Y(Z)):(Y(Z),re=A,ie||Y(function oe(){re.on.ready.unsubscribe(Z),re.on.ready.unsubscribe(oe)}))})}}),this.Collection=(h=this,oo(Ba.prototype,function(oe,ne){this.db=h;var ie=fi,re=null;if(ne)try{ie=ne()}catch(fe){re=fe}var ne=oe._ctx,oe=ne.table,ge=oe.hook.reading.fire;this._ctx={table:oe,index:ne.index,isPrimKey:!ne.index||oe.schema.primKey.keyPath&&ne.index===oe.schema.primKey.name,range:ie,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:re,or:ne.or,valueMapper:ge!==Ve?ge:null}})),this.Table=(y=this,oo(qn.prototype,function(Y,Z,ie){this.db=y,this._tx=ie,this.name=Y,this.schema=Z,this.hook=y._allTables[Y]?y._allTables[Y].hook:Fr(null,{creating:[ft,Fe],reading:[ct,Ve],updating:[rn,Fe],deleting:[kt,Fe]})})),this.Transaction=(_=this,oo(Au.prototype,function(Y,Z,ie,re,ne){var oe=this;Y!=="readonly"&&Z.forEach(function(ge){ge=(ge=ie[ge])==null?void 0:ge.yProps,ge&&(Z=Z.concat(ge.map(function(fe){return fe.updatesTable})))}),this.db=_,this.mode=Y,this.storeNames=Z,this.schema=ie,this.chromeTransactionDurability=re,this.idbtrans=null,this.on=Fr(this,"complete","error","abort"),this.parent=ne||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new Be(function(ge,fe){oe._resolve=ge,oe._reject=fe}),this._completion.then(function(){oe.active=!1,oe.on.complete.fire()},function(ge){var fe=oe.active;return oe.active=!1,oe.on.error.fire(ge),oe.parent?oe.parent._reject(ge):fe&&oe.idbtrans&&oe.idbtrans.abort(),Pt(ge)})})),this.Version=(k=this,oo(yi.prototype,function(Y){this.db=k,this._cfg={version:Y,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(T=this,oo(vr.prototype,function(Y,Z,ie){if(this.db=T,this._ctx={table:Y,index:Z===":id"?null:Z,or:ie},this._cmp=this._ascending=dt,this._descending=function(re,ne){return dt(ne,re)},this._max=function(re,ne){return 0<dt(re,ne)?re:ne},this._min=function(re,ne){return dt(re,ne)<0?re:ne},this._IDBKeyRange=T._deps.IDBKeyRange,!this._IDBKeyRange)throw new be.MissingAPI})),this.on("versionchange",function(Y){0<Y.newVersion?console.warn("Another connection wants to upgrade database '".concat(A.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(A.name,"'. Closing db now to resume the delete request.")),A.close({disableAutoOpen:!1})}),this.on("blocked",function(Y){!Y.newVersion||Y.newVersion<Y.oldVersion?console.warn("Dexie.delete('".concat(A.name,"') was blocked")):console.warn("Upgrade '".concat(A.name,"' blocked by other connection holding version ").concat(Y.oldVersion/10))}),this._maxKey=xr(c.IDBKeyRange),this._createTransaction=function(Y,Z,ie,re){return new A.Transaction(Y,Z,ie,A._options.chromeTransactionDurability,re)},this._fireOnBlocked=function(Y){A.on("blocked").fire(Y),co.toArray().filter(function(Z){return Z.name===A.name&&Z!==A&&!Z._state.vcFired}).map(function(Z){return Z.on("versionchange").fire(Y)})},this.use(Du),this.use(Za),this.use(Ys),this.use(qa),this.use(Ru),new Proxy(this,{get:function(Y,Z,ie){var re;return Z==="_vip"||(Z==="table"?function(ne){return _r(A.table(ne),J)}:(re=Reflect.get(Y,Z,ie))instanceof qn?_r(re,J):Z==="tables"?re.map(function(ne){return _r(ne,J)}):Z==="_createTransaction"?function(){return _r(re.apply(this,arguments),J)}:re)}}));this.vip=J,G.forEach(function(Y){return Y(A)})}var rs,po=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Ja=(ho.prototype.subscribe=function(s,c,h){return this._subscribe(s&&typeof s!="function"?s:{next:s,error:c,complete:h})},ho.prototype[po]=function(){return this},ho);function ho(s){this._subscribe=s}try{rs={indexedDB:f.indexedDB||f.mozIndexedDB||f.webkitIndexedDB||f.msIndexedDB,IDBKeyRange:f.IDBKeyRange||f.webkitIDBKeyRange}}catch{rs={indexedDB:null,IDBKeyRange:null}}function Ho(s){var c,h=!1,y=new Ja(function(_){var k=O(s),T,A=!1,G={},se={},J={get closed(){return A},unsubscribe:function(){A||(A=!0,T&&T.abort(),Y&&$n.storagemutated.unsubscribe(re))}},Y=(_.start&&_.start(J),!1),Z=function(){return Io(ne)};function ie(){return Bs(se,G)}var re=function(oe){Ji(G,oe),ie()&&Z()},ne=function(){var oe,ge,fe;!A&&rs.indexedDB&&(G={},oe={},T&&T.abort(),T=new AbortController,fe=(ve=>{var Ee=Le();try{k&&Cn();var Ce=Nn(s,ve);return Ce=k?Ce.finally(Ft):Ce}finally{Ee&&Xe()}})(ge={subscr:oe,signal:T.signal,requery:Z,querier:s,trans:null}),Y||($n(pi,re),Y=!0),Promise.resolve(fe).then(function(ve){h=!0,c=ve,A||ge.signal.aborted||(ie()||(se=oe,ie())?Z():(G={},Io(function(){return!A&&_.next&&_.next(ve)})))},function(ve){h=!1,["DatabaseClosedError","AbortError"].includes(ve==null?void 0:ve.name)||A||Io(function(){A||_.error&&_.error(ve)})}))};return setTimeout(Z,0),J});return y.hasValue=function(){return h},y.getValue=function(){return c},y}var mo=Sr;function Vo(s){var c=br;try{br=!0,$n.storagemutated.fire(s),Ks(s,!0)}finally{br=c}}S(mo,a(a({},B),{delete:function(s){return new mo(s,{addons:[]}).delete()},exists:function(s){return new mo(s,{addons:[]}).open().then(function(c){return c.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(s){try{return c=mo.dependencies,h=c.indexedDB,c=c.IDBKeyRange,(fo(h)?Promise.resolve(h.databases()).then(function(y){return y.map(function(_){return _.name}).filter(function(_){return _!==zr})}):vi(h,c).toCollection().primaryKeys()).then(s)}catch{return Pt(new be.MissingAPI)}var c,h},defineClass:function(){return function(s){v(this,s)}},ignoreTransaction:function(s){return qe.trans?nr(qe.transless||bn,s):s()},vip:Fo,async:function(s){return function(){try{var c=Us(s.apply(this,arguments));return c&&typeof c.then=="function"?c:Be.resolve(c)}catch(h){return Pt(h)}}},spawn:function(s,c,h){try{var y=Us(s.apply(h,c||[]));return y&&typeof y.then=="function"?y:Be.resolve(y)}catch(_){return Pt(_)}},currentTransaction:{get:function(){return qe.trans||null}},waitFor:function(s,c){return s=Be.resolve(typeof s=="function"?mo.ignoreTransaction(s):s).timeout(c||6e4),qe.trans?qe.trans.waitFor(s):s},Promise:Be,debug:{get:function(){return Nt},set:function(s){Mn(s)}},derive:$,extend:v,props:S,override:j,Events:Fr,on:$n,liveQuery:Ho,extendObservabilitySet:Ji,getByKeyPath:V,setByKeyPath:U,delByKeyPath:function(s,c){typeof c=="string"?U(s,c,void 0):"length"in c&&[].map.call(c,function(h){U(s,h,void 0)})},shallowClone:pe,deepClone:xe,getObjectDiff:qs,cmp:dt,asap:q,minKey:-1/0,addons:[],connections:{get:co.toArray},errnames:we,dependencies:rs,cache:Kr,semVer:"4.4.2",version:"4.4.2".split(".").map(function(s){return parseInt(s)}).reduce(function(s,c,h){return s+c/Math.pow(10,2*h)})})),mo.maxKey=xr(mo.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&($n(pi,function(s){br||(s=new CustomEvent(Ki,{detail:s}),br=!0,dispatchEvent(s),br=!1)}),addEventListener(Ki,function(s){s=s.detail,br||Vo(s)}));var Ko,br=!1,os=function(){};return typeof BroadcastChannel<"u"&&((os=function(){(Ko=new BroadcastChannel(Ki)).onmessage=function(s){return s.data&&Vo(s.data)}})(),typeof Ko.unref=="function"&&Ko.unref(),$n(pi,function(s){br||Ko.postMessage(s)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(s){if(!Sr.disableBfCache&&s.persisted){Nt&&console.debug("Dexie: handling persisted pagehide"),Ko!=null&&Ko.close();for(var c=0,h=co.toArray();c<h.length;c++)h[c].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(s){!Sr.disableBfCache&&s.persisted&&(Nt&&console.debug("Dexie: handling persisted pageshow"),os(),Vo({all:new Jt(-1/0,[[]])}))})),Be.rejectionMapper=function(s,c){return!s||s instanceof Se||s instanceof TypeError||s instanceof SyntaxError||!s.name||!Je[s.name]?s:(c=new Je[s.name](c||s.message,s),"stack"in s&&C(c,"stack",{get:function(){return this.inner.stack}}),c)},Mn(Nt),a(Sr,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:Sr,Entity:Pn,PropModification:to,RangeSet:Jt,add:function(s){return new to({add:s})},cmp:dt,default:Sr,liveQuery:Ho,mergeRanges:wi,rangesOverlap:Gi,remove:function(s){return new to({remove:s})},replacePrefix:function(s,c){return new to({replacePrefix:[s,c]})}}),{default:Sr}),Sr})})(Jl)),Jl.exports}var P0=C0();const vf=vu(P0),Zp=Symbol.for("Dexie"),su=globalThis[Zp]||(globalThis[Zp]=vf);if(vf.semVer!==su.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${vf.semVer} and ${su.semVer}`);const{liveQuery:ik,mergeRanges:sk,rangesOverlap:ak,RangeSet:lk,cmp:uk,Entity:ck,PropModification:fk,replacePrefix:dk,add:pk,remove:hk,DexieYProvider:mk}=su;class j0 extends su{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 bt=new j0;async function T0(){const[t,r,i]=await Promise.all([bt.flows.toArray(),bt.testSuites.toArray(),bt.environments.toArray()]),a=await bt.kv.get("authTokens");let u;try{u=a!=null&&a.value?JSON.parse(a.value):void 0}catch{u=void 0}return{formatVersion:1,exportedAt:new Date().toISOString(),flows:t,testSuites:r,environments:i,authTokens:u}}async function hm(t){await bt.transaction("rw",bt.flows,bt.testSuites,bt.environments,bt.kv,async()=>{await bt.flows.clear(),await bt.testSuites.clear(),await bt.environments.clear();for(const r of t.flows)await bt.flows.add({name:r.name,steps:r.steps,graph:r.graph});for(const r of t.testSuites)await bt.testSuites.add({name:r.name,cases:r.cases});for(const r of t.environments)await bt.environments.add({name:r.name,baseUrl:r.baseUrl,vars:r.vars??{}});t.authTokens&&await bt.kv.put({key:"authTokens",value:JSON.stringify(t.authTokens)})})}async function M0(t){if(t.formatVersion!==1)return!1;const[r,i]=await Promise.all([bt.flows.count(),bt.testSuites.count()]);return r>0||i>0?!1:(await hm(t),!0)}function I0(t,r,i){var d,m;const a=[],u=r===t.expectStatus;if(a.push(`HTTP ${r} ${u?"✓":`✗ (esperado ${t.expectStatus})`}`),!u)return{pass:!1,lines:a};if((d=t.contains)!=null&&d.trim()){const v=i.includes(t.contains);if(a.push(`Contiene texto "${t.contains}": ${v?"✓":"✗"}`),!v)return{pass:!1,lines:a}}const f=(m=t.jsonPath)==null?void 0:m.trim();if(f){let v;try{v=JSON.parse(i)}catch{return a.push("Body no es JSON válido: ✗"),{pass:!1,lines:a}}const w=$f(v,f),b=t.expectJsonValue;if(b!==void 0&&b!==""){const x=w==null?String(w):typeof w=="object"?JSON.stringify(w):String(w),S=b.trim(),N=x===S||String(w)===S;if(a.push(`JSON path ${f} → ${x} vs "${S}": ${N?"✓":"✗"}`),!N)return{pass:!1,lines:a}}else{const x=w!=null;if(a.push(`JSON path ${f} existe: ${x?"✓":"✗"}`),!x)return{pass:!1,lines:a}}}return{pass:!0,lines:a}}function Ut(t){if(typeof t=="string"||typeof t=="number")return""+t;let r="";if(Array.isArray(t))for(let i=0,a;i<t.length;i++)(a=Ut(t[i]))!==""&&(r+=(r&&" ")+a);else for(let i in t)t[i]&&(r+=(r&&" ")+i);return r}var A0={value:()=>{}};function Su(){for(var t=0,r=arguments.length,i={},a;t<r;++t){if(!(a=arguments[t]+"")||a in i||/[\s.]/.test(a))throw new Error("illegal type: "+a);i[a]=[]}return new eu(i)}function eu(t){this._=t}function $0(t,r){return t.trim().split(/^|\s+/).map(function(i){var a="",u=i.indexOf(".");if(u>=0&&(a=i.slice(u+1),i=i.slice(0,u)),i&&!r.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:a}})}eu.prototype=Su.prototype={constructor:eu,on:function(t,r){var i=this._,a=$0(t+"",i),u,f=-1,d=a.length;if(arguments.length<2){for(;++f<d;)if((u=(t=a[f]).type)&&(u=O0(i[u],t.name)))return u;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++f<d;)if(u=(t=a[f]).type)i[u]=Jp(i[u],t.name,r);else if(r==null)for(u in i)i[u]=Jp(i[u],t.name,null);return this},copy:function(){var t={},r=this._;for(var i in r)t[i]=r[i].slice();return new eu(t)},call:function(t,r){if((u=arguments.length-2)>0)for(var i=new Array(u),a=0,u,f;a<u;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(f=this._[t],a=0,u=f.length;a<u;++a)f[a].value.apply(r,i)},apply:function(t,r,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var a=this._[t],u=0,f=a.length;u<f;++u)a[u].value.apply(r,i)}};function O0(t,r){for(var i=0,a=t.length,u;i<a;++i)if((u=t[i]).name===r)return u.value}function Jp(t,r,i){for(var a=0,u=t.length;a<u;++a)if(t[a].name===r){t[a]=A0,t=t.slice(0,a).concat(t.slice(a+1));break}return i!=null&&t.push({name:r,value:i}),t}var xf="http://www.w3.org/1999/xhtml";const eh={svg:"http://www.w3.org/2000/svg",xhtml:xf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function bu(t){var r=t+="",i=r.indexOf(":");return i>=0&&(r=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),eh.hasOwnProperty(r)?{space:eh[r],local:t}:t}function R0(t){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===xf&&r.documentElement.namespaceURI===xf?r.createElement(t):r.createElementNS(i,t)}}function D0(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function mm(t){var r=bu(t);return(r.local?D0:R0)(r)}function z0(){}function Of(t){return t==null?z0:function(){return this.querySelector(t)}}function L0(t){typeof t!="function"&&(t=Of(t));for(var r=this._groups,i=r.length,a=new Array(i),u=0;u<i;++u)for(var f=r[u],d=f.length,m=a[u]=new Array(d),v,w,b=0;b<d;++b)(v=f[b])&&(w=t.call(v,v.__data__,b,f))&&("__data__"in v&&(w.__data__=v.__data__),m[b]=w);return new Zn(a,this._parents)}function F0(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function B0(){return[]}function gm(t){return t==null?B0:function(){return this.querySelectorAll(t)}}function H0(t){return function(){return F0(t.apply(this,arguments))}}function V0(t){typeof t=="function"?t=H0(t):t=gm(t);for(var r=this._groups,i=r.length,a=[],u=[],f=0;f<i;++f)for(var d=r[f],m=d.length,v,w=0;w<m;++w)(v=d[w])&&(a.push(t.call(v,v.__data__,w,d)),u.push(v));return new Zn(a,u)}function ym(t){return function(){return this.matches(t)}}function vm(t){return function(r){return r.matches(t)}}var K0=Array.prototype.find;function U0(t){return function(){return K0.call(this.children,t)}}function q0(){return this.firstElementChild}function W0(t){return this.select(t==null?q0:U0(typeof t=="function"?t:vm(t)))}var Y0=Array.prototype.filter;function X0(){return Array.from(this.children)}function Q0(t){return function(){return Y0.call(this.children,t)}}function G0(t){return this.selectAll(t==null?X0:Q0(typeof t=="function"?t:vm(t)))}function Z0(t){typeof t!="function"&&(t=ym(t));for(var r=this._groups,i=r.length,a=new Array(i),u=0;u<i;++u)for(var f=r[u],d=f.length,m=a[u]=[],v,w=0;w<d;++w)(v=f[w])&&t.call(v,v.__data__,w,f)&&m.push(v);return new Zn(a,this._parents)}function xm(t){return new Array(t.length)}function J0(){return new Zn(this._enter||this._groups.map(xm),this._parents)}function au(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}au.prototype={constructor:au,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 ev(t){return function(){return t}}function tv(t,r,i,a,u,f){for(var d=0,m,v=r.length,w=f.length;d<w;++d)(m=r[d])?(m.__data__=f[d],a[d]=m):i[d]=new au(t,f[d]);for(;d<v;++d)(m=r[d])&&(u[d]=m)}function nv(t,r,i,a,u,f,d){var m,v,w=new Map,b=r.length,x=f.length,S=new Array(b),N;for(m=0;m<b;++m)(v=r[m])&&(S[m]=N=d.call(v,v.__data__,m,r)+"",w.has(N)?u[m]=v:w.set(N,v));for(m=0;m<x;++m)N=d.call(t,f[m],m,f)+"",(v=w.get(N))?(a[m]=v,v.__data__=f[m],w.delete(N)):i[m]=new au(t,f[m]);for(m=0;m<b;++m)(v=r[m])&&w.get(S[m])===v&&(u[m]=v)}function rv(t){return t.__data__}function ov(t,r){if(!arguments.length)return Array.from(this,rv);var i=r?nv:tv,a=this._parents,u=this._groups;typeof t!="function"&&(t=ev(t));for(var f=u.length,d=new Array(f),m=new Array(f),v=new Array(f),w=0;w<f;++w){var b=a[w],x=u[w],S=x.length,N=iv(t.call(b,b&&b.__data__,w,a)),C=N.length,$=m[w]=new Array(C),M=d[w]=new Array(C),I=v[w]=new Array(S);i(b,x,$,M,I,N,r);for(var H=0,j=0,R,q;H<C;++H)if(R=$[H]){for(H>=j&&(j=H+1);!(q=M[j])&&++j<C;);R._next=q||null}}return d=new Zn(d,a),d._enter=m,d._exit=v,d}function iv(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function sv(){return new Zn(this._exit||this._groups.map(xm),this._parents)}function av(t,r,i){var a=this.enter(),u=this,f=this.exit();return typeof t=="function"?(a=t(a),a&&(a=a.selection())):a=a.append(t+""),r!=null&&(u=r(u),u&&(u=u.selection())),i==null?f.remove():i(f),a&&u?a.merge(u).order():u}function lv(t){for(var r=t.selection?t.selection():t,i=this._groups,a=r._groups,u=i.length,f=a.length,d=Math.min(u,f),m=new Array(u),v=0;v<d;++v)for(var w=i[v],b=a[v],x=w.length,S=m[v]=new Array(x),N,C=0;C<x;++C)(N=w[C]||b[C])&&(S[C]=N);for(;v<u;++v)m[v]=i[v];return new Zn(m,this._parents)}function uv(){for(var t=this._groups,r=-1,i=t.length;++r<i;)for(var a=t[r],u=a.length-1,f=a[u],d;--u>=0;)(d=a[u])&&(f&&d.compareDocumentPosition(f)^4&&f.parentNode.insertBefore(d,f),f=d);return this}function cv(t){t||(t=fv);function r(x,S){return x&&S?t(x.__data__,S.__data__):!x-!S}for(var i=this._groups,a=i.length,u=new Array(a),f=0;f<a;++f){for(var d=i[f],m=d.length,v=u[f]=new Array(m),w,b=0;b<m;++b)(w=d[b])&&(v[b]=w);v.sort(r)}return new Zn(u,this._parents).order()}function fv(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function dv(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function pv(){return Array.from(this)}function hv(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var a=t[r],u=0,f=a.length;u<f;++u){var d=a[u];if(d)return d}return null}function mv(){let t=0;for(const r of this)++t;return t}function gv(){return!this.node()}function yv(t){for(var r=this._groups,i=0,a=r.length;i<a;++i)for(var u=r[i],f=0,d=u.length,m;f<d;++f)(m=u[f])&&t.call(m,m.__data__,f,u);return this}function vv(t){return function(){this.removeAttribute(t)}}function xv(t){return function(){this.removeAttributeNS(t.space,t.local)}}function wv(t,r){return function(){this.setAttribute(t,r)}}function _v(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function Sv(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function bv(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 kv(t,r){var i=bu(t);if(arguments.length<2){var a=this.node();return i.local?a.getAttributeNS(i.space,i.local):a.getAttribute(i)}return this.each((r==null?i.local?xv:vv:typeof r=="function"?i.local?bv:Sv:i.local?_v:wv)(i,r))}function wm(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Ev(t){return function(){this.style.removeProperty(t)}}function Nv(t,r,i){return function(){this.style.setProperty(t,r,i)}}function Cv(t,r,i){return function(){var a=r.apply(this,arguments);a==null?this.style.removeProperty(t):this.style.setProperty(t,a,i)}}function Pv(t,r,i){return arguments.length>1?this.each((r==null?Ev:typeof r=="function"?Cv:Nv)(t,r,i??"")):js(this.node(),t)}function js(t,r){return t.style.getPropertyValue(r)||wm(t).getComputedStyle(t,null).getPropertyValue(r)}function jv(t){return function(){delete this[t]}}function Tv(t,r){return function(){this[t]=r}}function Mv(t,r){return function(){var i=r.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function Iv(t,r){return arguments.length>1?this.each((r==null?jv:typeof r=="function"?Mv:Tv)(t,r)):this.node()[t]}function _m(t){return t.trim().split(/^|\s+/)}function Rf(t){return t.classList||new Sm(t)}function Sm(t){this._node=t,this._names=_m(t.getAttribute("class")||"")}Sm.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 bm(t,r){for(var i=Rf(t),a=-1,u=r.length;++a<u;)i.add(r[a])}function km(t,r){for(var i=Rf(t),a=-1,u=r.length;++a<u;)i.remove(r[a])}function Av(t){return function(){bm(this,t)}}function $v(t){return function(){km(this,t)}}function Ov(t,r){return function(){(r.apply(this,arguments)?bm:km)(this,t)}}function Rv(t,r){var i=_m(t+"");if(arguments.length<2){for(var a=Rf(this.node()),u=-1,f=i.length;++u<f;)if(!a.contains(i[u]))return!1;return!0}return this.each((typeof r=="function"?Ov:r?Av:$v)(i,r))}function Dv(){this.textContent=""}function zv(t){return function(){this.textContent=t}}function Lv(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function Fv(t){return arguments.length?this.each(t==null?Dv:(typeof t=="function"?Lv:zv)(t)):this.node().textContent}function Bv(){this.innerHTML=""}function Hv(t){return function(){this.innerHTML=t}}function Vv(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function Kv(t){return arguments.length?this.each(t==null?Bv:(typeof t=="function"?Vv:Hv)(t)):this.node().innerHTML}function Uv(){this.nextSibling&&this.parentNode.appendChild(this)}function qv(){return this.each(Uv)}function Wv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Yv(){return this.each(Wv)}function Xv(t){var r=typeof t=="function"?t:mm(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function Qv(){return null}function Gv(t,r){var i=typeof t=="function"?t:mm(t),a=r==null?Qv:typeof r=="function"?r:Of(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),a.apply(this,arguments)||null)})}function Zv(){var t=this.parentNode;t&&t.removeChild(this)}function Jv(){return this.each(Zv)}function ex(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function tx(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function nx(t){return this.select(t?tx:ex)}function rx(t){return arguments.length?this.property("__data__",t):this.node().__data__}function ox(t){return function(r){t.call(this,r,this.__data__)}}function ix(t){return t.trim().split(/^|\s+/).map(function(r){var i="",a=r.indexOf(".");return a>=0&&(i=r.slice(a+1),r=r.slice(0,a)),{type:r,name:i}})}function sx(t){return function(){var r=this.__on;if(r){for(var i=0,a=-1,u=r.length,f;i<u;++i)f=r[i],(!t.type||f.type===t.type)&&f.name===t.name?this.removeEventListener(f.type,f.listener,f.options):r[++a]=f;++a?r.length=a:delete this.__on}}}function ax(t,r,i){return function(){var a=this.__on,u,f=ox(r);if(a){for(var d=0,m=a.length;d<m;++d)if((u=a[d]).type===t.type&&u.name===t.name){this.removeEventListener(u.type,u.listener,u.options),this.addEventListener(u.type,u.listener=f,u.options=i),u.value=r;return}}this.addEventListener(t.type,f,i),u={type:t.type,name:t.name,value:r,listener:f,options:i},a?a.push(u):this.__on=[u]}}function lx(t,r,i){var a=ix(t+""),u,f=a.length,d;if(arguments.length<2){var m=this.node().__on;if(m){for(var v=0,w=m.length,b;v<w;++v)for(u=0,b=m[v];u<f;++u)if((d=a[u]).type===b.type&&d.name===b.name)return b.value}return}for(m=r?ax:sx,u=0;u<f;++u)this.each(m(a[u],r,i));return this}function Em(t,r,i){var a=wm(t),u=a.CustomEvent;typeof u=="function"?u=new u(r,i):(u=a.document.createEvent("Event"),i?(u.initEvent(r,i.bubbles,i.cancelable),u.detail=i.detail):u.initEvent(r,!1,!1)),t.dispatchEvent(u)}function ux(t,r){return function(){return Em(this,t,r)}}function cx(t,r){return function(){return Em(this,t,r.apply(this,arguments))}}function fx(t,r){return this.each((typeof r=="function"?cx:ux)(t,r))}function*dx(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var a=t[r],u=0,f=a.length,d;u<f;++u)(d=a[u])&&(yield d)}var Nm=[null];function Zn(t,r){this._groups=t,this._parents=r}function $a(){return new Zn([[document.documentElement]],Nm)}function px(){return this}Zn.prototype=$a.prototype={constructor:Zn,select:L0,selectAll:V0,selectChild:W0,selectChildren:G0,filter:Z0,data:ov,enter:J0,exit:sv,join:av,merge:lv,selection:px,order:uv,sort:cv,call:dv,nodes:pv,node:hv,size:mv,empty:gv,each:yv,attr:kv,style:Pv,property:Iv,classed:Rv,text:Fv,html:Kv,raise:qv,lower:Yv,append:Xv,insert:Gv,remove:Jv,clone:nx,datum:rx,on:lx,dispatch:fx,[Symbol.iterator]:dx};function Gn(t){return typeof t=="string"?new Zn([[document.querySelector(t)]],[document.documentElement]):new Zn([[t]],Nm)}function hx(t){let r;for(;r=t.sourceEvent;)t=r;return t}function jr(t,r){if(t=hx(t),r===void 0&&(r=t.currentTarget),r){var i=r.ownerSVGElement||r;if(i.createSVGPoint){var a=i.createSVGPoint();return a.x=t.clientX,a.y=t.clientY,a=a.matrixTransform(r.getScreenCTM().inverse()),[a.x,a.y]}if(r.getBoundingClientRect){var u=r.getBoundingClientRect();return[t.clientX-u.left-r.clientLeft,t.clientY-u.top-r.clientTop]}}return[t.pageX,t.pageY]}const mx={passive:!1},ka={capture:!0,passive:!1};function ef(t){t.stopImmediatePropagation()}function Cs(t){t.preventDefault(),t.stopImmediatePropagation()}function Cm(t){var r=t.document.documentElement,i=Gn(t).on("dragstart.drag",Cs,ka);"onselectstart"in r?i.on("selectstart.drag",Cs,ka):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function Pm(t,r){var i=t.document.documentElement,a=Gn(t).on("dragstart.drag",null);r&&(a.on("click.drag",Cs,ka),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in i?a.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Kl=t=>()=>t;function wf(t,{sourceEvent:r,subject:i,target:a,identifier:u,active:f,x:d,y:m,dx:v,dy:w,dispatch:b}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:u,enumerable:!0,configurable:!0},active:{value:f,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:m,enumerable:!0,configurable:!0},dx:{value:v,enumerable:!0,configurable:!0},dy:{value:w,enumerable:!0,configurable:!0},_:{value:b}})}wf.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function gx(t){return!t.ctrlKey&&!t.button}function yx(){return this.parentNode}function vx(t,r){return r??{x:t.x,y:t.y}}function xx(){return navigator.maxTouchPoints||"ontouchstart"in this}function jm(){var t=gx,r=yx,i=vx,a=xx,u={},f=Su("start","drag","end"),d=0,m,v,w,b,x=0;function S(R){R.on("mousedown.drag",N).filter(a).on("touchstart.drag",M).on("touchmove.drag",I,mx).on("touchend.drag touchcancel.drag",H).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function N(R,q){if(!(b||!t.call(this,R,q))){var V=j(this,r.call(this,R,q),R,q,"mouse");V&&(Gn(R.view).on("mousemove.drag",C,ka).on("mouseup.drag",$,ka),Cm(R.view),ef(R),w=!1,m=R.clientX,v=R.clientY,V("start",R))}}function C(R){if(Cs(R),!w){var q=R.clientX-m,V=R.clientY-v;w=q*q+V*V>x}u.mouse("drag",R)}function $(R){Gn(R.view).on("mousemove.drag mouseup.drag",null),Pm(R.view,w),Cs(R),u.mouse("end",R)}function M(R,q){if(t.call(this,R,q)){var V=R.changedTouches,U=r.call(this,R,q),pe=V.length,he,_e;for(he=0;he<pe;++he)(_e=j(this,U,R,q,V[he].identifier,V[he]))&&(ef(R),_e("start",R,V[he]))}}function I(R){var q=R.changedTouches,V=q.length,U,pe;for(U=0;U<V;++U)(pe=u[q[U].identifier])&&(Cs(R),pe("drag",R,q[U]))}function H(R){var q=R.changedTouches,V=q.length,U,pe;for(b&&clearTimeout(b),b=setTimeout(function(){b=null},500),U=0;U<V;++U)(pe=u[q[U].identifier])&&(ef(R),pe("end",R,q[U]))}function j(R,q,V,U,pe,he){var _e=f.copy(),Q=jr(he||V,q),le,xe,z;if((z=i.call(R,new wf("beforestart",{sourceEvent:V,target:S,identifier:pe,active:d,x:Q[0],y:Q[1],dx:0,dy:0,dispatch:_e}),U))!=null)return le=z.x-Q[0]||0,xe=z.y-Q[1]||0,function ue(te,ae,L){var F=Q,X;switch(te){case"start":u[pe]=ue,X=d++;break;case"end":delete u[pe],--d;case"drag":Q=jr(L||ae,q),X=d;break}_e.call(te,R,new wf(te,{sourceEvent:ae,subject:z,target:S,identifier:pe,active:X,x:Q[0]+le,y:Q[1]+xe,dx:Q[0]-F[0],dy:Q[1]-F[1],dispatch:_e}),U)}}return S.filter=function(R){return arguments.length?(t=typeof R=="function"?R:Kl(!!R),S):t},S.container=function(R){return arguments.length?(r=typeof R=="function"?R:Kl(R),S):r},S.subject=function(R){return arguments.length?(i=typeof R=="function"?R:Kl(R),S):i},S.touchable=function(R){return arguments.length?(a=typeof R=="function"?R:Kl(!!R),S):a},S.on=function(){var R=f.on.apply(f,arguments);return R===f?S:R},S.clickDistance=function(R){return arguments.length?(x=(R=+R)*R,S):Math.sqrt(x)},S}function Df(t,r,i){t.prototype=r.prototype=i,i.constructor=t}function Tm(t,r){var i=Object.create(t.prototype);for(var a in r)i[a]=r[a];return i}function Oa(){}var Ea=.7,lu=1/Ea,Ps="\\s*([+-]?\\d+)\\s*",Na="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wx=/^#([0-9a-f]{3,8})$/,_x=new RegExp(`^rgb\\(${Ps},${Ps},${Ps}\\)$`),Sx=new RegExp(`^rgb\\(${Qr},${Qr},${Qr}\\)$`),bx=new RegExp(`^rgba\\(${Ps},${Ps},${Ps},${Na}\\)$`),kx=new RegExp(`^rgba\\(${Qr},${Qr},${Qr},${Na}\\)$`),Ex=new RegExp(`^hsl\\(${Na},${Qr},${Qr}\\)$`),Nx=new RegExp(`^hsla\\(${Na},${Qr},${Qr},${Na}\\)$`),th={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};Df(Oa,Di,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:nh,formatHex:nh,formatHex8:Cx,formatHsl:Px,formatRgb:rh,toString:rh});function nh(){return this.rgb().formatHex()}function Cx(){return this.rgb().formatHex8()}function Px(){return Mm(this).formatHsl()}function rh(){return this.rgb().formatRgb()}function Di(t){var r,i;return t=(t+"").trim().toLowerCase(),(r=wx.exec(t))?(i=r[1].length,r=parseInt(r[1],16),i===6?oh(r):i===3?new Bn(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?Ul(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?Ul(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=_x.exec(t))?new Bn(r[1],r[2],r[3],1):(r=Sx.exec(t))?new Bn(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=bx.exec(t))?Ul(r[1],r[2],r[3],r[4]):(r=kx.exec(t))?Ul(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Ex.exec(t))?ah(r[1],r[2]/100,r[3]/100,1):(r=Nx.exec(t))?ah(r[1],r[2]/100,r[3]/100,r[4]):th.hasOwnProperty(t)?oh(th[t]):t==="transparent"?new Bn(NaN,NaN,NaN,0):null}function oh(t){return new Bn(t>>16&255,t>>8&255,t&255,1)}function Ul(t,r,i,a){return a<=0&&(t=r=i=NaN),new Bn(t,r,i,a)}function jx(t){return t instanceof Oa||(t=Di(t)),t?(t=t.rgb(),new Bn(t.r,t.g,t.b,t.opacity)):new Bn}function _f(t,r,i,a){return arguments.length===1?jx(t):new Bn(t,r,i,a??1)}function Bn(t,r,i,a){this.r=+t,this.g=+r,this.b=+i,this.opacity=+a}Df(Bn,_f,Tm(Oa,{brighter(t){return t=t==null?lu:Math.pow(lu,t),new Bn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ea:Math.pow(Ea,t),new Bn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Bn(Oi(this.r),Oi(this.g),Oi(this.b),uu(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:ih,formatHex:ih,formatHex8:Tx,formatRgb:sh,toString:sh}));function ih(){return`#${$i(this.r)}${$i(this.g)}${$i(this.b)}`}function Tx(){return`#${$i(this.r)}${$i(this.g)}${$i(this.b)}${$i((isNaN(this.opacity)?1:this.opacity)*255)}`}function sh(){const t=uu(this.opacity);return`${t===1?"rgb(":"rgba("}${Oi(this.r)}, ${Oi(this.g)}, ${Oi(this.b)}${t===1?")":`, ${t})`}`}function uu(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Oi(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function $i(t){return t=Oi(t),(t<16?"0":"")+t.toString(16)}function ah(t,r,i,a){return a<=0?t=r=i=NaN:i<=0||i>=1?t=r=NaN:r<=0&&(t=NaN),new Tr(t,r,i,a)}function Mm(t){if(t instanceof Tr)return new Tr(t.h,t.s,t.l,t.opacity);if(t instanceof Oa||(t=Di(t)),!t)return new Tr;if(t instanceof Tr)return t;t=t.rgb();var r=t.r/255,i=t.g/255,a=t.b/255,u=Math.min(r,i,a),f=Math.max(r,i,a),d=NaN,m=f-u,v=(f+u)/2;return m?(r===f?d=(i-a)/m+(i<a)*6:i===f?d=(a-r)/m+2:d=(r-i)/m+4,m/=v<.5?f+u:2-f-u,d*=60):m=v>0&&v<1?0:d,new Tr(d,m,v,t.opacity)}function Mx(t,r,i,a){return arguments.length===1?Mm(t):new Tr(t,r,i,a??1)}function Tr(t,r,i,a){this.h=+t,this.s=+r,this.l=+i,this.opacity=+a}Df(Tr,Mx,Tm(Oa,{brighter(t){return t=t==null?lu:Math.pow(lu,t),new Tr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ea:Math.pow(Ea,t),new Tr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,r=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,a=i+(i<.5?i:1-i)*r,u=2*i-a;return new Bn(tf(t>=240?t-240:t+120,u,a),tf(t,u,a),tf(t<120?t+240:t-120,u,a),this.opacity)},clamp(){return new Tr(lh(this.h),ql(this.s),ql(this.l),uu(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=uu(this.opacity);return`${t===1?"hsl(":"hsla("}${lh(this.h)}, ${ql(this.s)*100}%, ${ql(this.l)*100}%${t===1?")":`, ${t})`}`}}));function lh(t){return t=(t||0)%360,t<0?t+360:t}function ql(t){return Math.max(0,Math.min(1,t||0))}function tf(t,r,i){return(t<60?r+(i-r)*t/60:t<180?i:t<240?r+(i-r)*(240-t)/60:r)*255}const zf=t=>()=>t;function Ix(t,r){return function(i){return t+i*r}}function Ax(t,r,i){return t=Math.pow(t,i),r=Math.pow(r,i)-t,i=1/i,function(a){return Math.pow(t+a*r,i)}}function $x(t){return(t=+t)==1?Im:function(r,i){return i-r?Ax(r,i,t):zf(isNaN(r)?i:r)}}function Im(t,r){var i=r-t;return i?Ix(t,i):zf(isNaN(t)?r:t)}const cu=(function t(r){var i=$x(r);function a(u,f){var d=i((u=_f(u)).r,(f=_f(f)).r),m=i(u.g,f.g),v=i(u.b,f.b),w=Im(u.opacity,f.opacity);return function(b){return u.r=d(b),u.g=m(b),u.b=v(b),u.opacity=w(b),u+""}}return a.gamma=t,a})(1);function Ox(t,r){r||(r=[]);var i=t?Math.min(r.length,t.length):0,a=r.slice(),u;return function(f){for(u=0;u<i;++u)a[u]=t[u]*(1-f)+r[u]*f;return a}}function Rx(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Dx(t,r){var i=r?r.length:0,a=t?Math.min(i,t.length):0,u=new Array(a),f=new Array(i),d;for(d=0;d<a;++d)u[d]=Sa(t[d],r[d]);for(;d<i;++d)f[d]=r[d];return function(m){for(d=0;d<a;++d)f[d]=u[d](m);return f}}function zx(t,r){var i=new Date;return t=+t,r=+r,function(a){return i.setTime(t*(1-a)+r*a),i}}function Xr(t,r){return t=+t,r=+r,function(i){return t*(1-i)+r*i}}function Lx(t,r){var i={},a={},u;(t===null||typeof t!="object")&&(t={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in t?i[u]=Sa(t[u],r[u]):a[u]=r[u];return function(f){for(u in i)a[u]=i[u](f);return a}}var Sf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,nf=new RegExp(Sf.source,"g");function Fx(t){return function(){return t}}function Bx(t){return function(r){return t(r)+""}}function Am(t,r){var i=Sf.lastIndex=nf.lastIndex=0,a,u,f,d=-1,m=[],v=[];for(t=t+"",r=r+"";(a=Sf.exec(t))&&(u=nf.exec(r));)(f=u.index)>i&&(f=r.slice(i,f),m[d]?m[d]+=f:m[++d]=f),(a=a[0])===(u=u[0])?m[d]?m[d]+=u:m[++d]=u:(m[++d]=null,v.push({i:d,x:Xr(a,u)})),i=nf.lastIndex;return i<r.length&&(f=r.slice(i),m[d]?m[d]+=f:m[++d]=f),m.length<2?v[0]?Bx(v[0].x):Fx(r):(r=v.length,function(w){for(var b=0,x;b<r;++b)m[(x=v[b]).i]=x.x(w);return m.join("")})}function Sa(t,r){var i=typeof r,a;return r==null||i==="boolean"?zf(r):(i==="number"?Xr:i==="string"?(a=Di(r))?(r=a,cu):Am:r instanceof Di?cu:r instanceof Date?zx:Rx(r)?Ox:Array.isArray(r)?Dx:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Lx:Xr)(t,r)}var uh=180/Math.PI,bf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function $m(t,r,i,a,u,f){var d,m,v;return(d=Math.sqrt(t*t+r*r))&&(t/=d,r/=d),(v=t*i+r*a)&&(i-=t*v,a-=r*v),(m=Math.sqrt(i*i+a*a))&&(i/=m,a/=m,v/=m),t*a<r*i&&(t=-t,r=-r,v=-v,d=-d),{translateX:u,translateY:f,rotate:Math.atan2(r,t)*uh,skewX:Math.atan(v)*uh,scaleX:d,scaleY:m}}var Wl;function Hx(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?bf:$m(r.a,r.b,r.c,r.d,r.e,r.f)}function Vx(t){return t==null||(Wl||(Wl=document.createElementNS("http://www.w3.org/2000/svg","g")),Wl.setAttribute("transform",t),!(t=Wl.transform.baseVal.consolidate()))?bf:(t=t.matrix,$m(t.a,t.b,t.c,t.d,t.e,t.f))}function Om(t,r,i,a){function u(w){return w.length?w.pop()+" ":""}function f(w,b,x,S,N,C){if(w!==x||b!==S){var $=N.push("translate(",null,r,null,i);C.push({i:$-4,x:Xr(w,x)},{i:$-2,x:Xr(b,S)})}else(x||S)&&N.push("translate("+x+r+S+i)}function d(w,b,x,S){w!==b?(w-b>180?b+=360:b-w>180&&(w+=360),S.push({i:x.push(u(x)+"rotate(",null,a)-2,x:Xr(w,b)})):b&&x.push(u(x)+"rotate("+b+a)}function m(w,b,x,S){w!==b?S.push({i:x.push(u(x)+"skewX(",null,a)-2,x:Xr(w,b)}):b&&x.push(u(x)+"skewX("+b+a)}function v(w,b,x,S,N,C){if(w!==x||b!==S){var $=N.push(u(N)+"scale(",null,",",null,")");C.push({i:$-4,x:Xr(w,x)},{i:$-2,x:Xr(b,S)})}else(x!==1||S!==1)&&N.push(u(N)+"scale("+x+","+S+")")}return function(w,b){var x=[],S=[];return w=t(w),b=t(b),f(w.translateX,w.translateY,b.translateX,b.translateY,x,S),d(w.rotate,b.rotate,x,S),m(w.skewX,b.skewX,x,S),v(w.scaleX,w.scaleY,b.scaleX,b.scaleY,x,S),w=b=null,function(N){for(var C=-1,$=S.length,M;++C<$;)x[(M=S[C]).i]=M.x(N);return x.join("")}}}var Kx=Om(Hx,"px, ","px)","deg)"),Ux=Om(Vx,", ",")",")"),qx=1e-12;function ch(t){return((t=Math.exp(t))+1/t)/2}function Wx(t){return((t=Math.exp(t))-1/t)/2}function Yx(t){return((t=Math.exp(2*t))-1)/(t+1)}const tu=(function t(r,i,a){function u(f,d){var m=f[0],v=f[1],w=f[2],b=d[0],x=d[1],S=d[2],N=b-m,C=x-v,$=N*N+C*C,M,I;if($<qx)I=Math.log(S/w)/r,M=function(U){return[m+U*N,v+U*C,w*Math.exp(r*U*I)]};else{var H=Math.sqrt($),j=(S*S-w*w+a*$)/(2*w*i*H),R=(S*S-w*w-a*$)/(2*S*i*H),q=Math.log(Math.sqrt(j*j+1)-j),V=Math.log(Math.sqrt(R*R+1)-R);I=(V-q)/r,M=function(U){var pe=U*I,he=ch(q),_e=w/(i*H)*(he*Yx(r*pe+q)-Wx(q));return[m+_e*N,v+_e*C,w*he/ch(r*pe+q)]}}return M.duration=I*1e3*r/Math.SQRT2,M}return u.rho=function(f){var d=Math.max(.001,+f),m=d*d,v=m*m;return t(d,m,v)},u})(Math.SQRT2,2,4);var Ts=0,wa=0,va=0,Rm=1e3,fu,_a,du=0,zi=0,ku=0,Ca=typeof performance=="object"&&performance.now?performance:Date,Dm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Lf(){return zi||(Dm(Xx),zi=Ca.now()+ku)}function Xx(){zi=0}function pu(){this._call=this._time=this._next=null}pu.prototype=zm.prototype={constructor:pu,restart:function(t,r,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?Lf():+i)+(r==null?0:+r),!this._next&&_a!==this&&(_a?_a._next=this:fu=this,_a=this),this._call=t,this._time=i,kf()},stop:function(){this._call&&(this._call=null,this._time=1/0,kf())}};function zm(t,r,i){var a=new pu;return a.restart(t,r,i),a}function Qx(){Lf(),++Ts;for(var t=fu,r;t;)(r=zi-t._time)>=0&&t._call.call(void 0,r),t=t._next;--Ts}function fh(){zi=(du=Ca.now())+ku,Ts=wa=0;try{Qx()}finally{Ts=0,Zx(),zi=0}}function Gx(){var t=Ca.now(),r=t-du;r>Rm&&(ku-=r,du=t)}function Zx(){for(var t,r=fu,i,a=1/0;r;)r._call?(a>r._time&&(a=r._time),t=r,r=r._next):(i=r._next,r._next=null,r=t?t._next=i:fu=i);_a=t,kf(a)}function kf(t){if(!Ts){wa&&(wa=clearTimeout(wa));var r=t-zi;r>24?(t<1/0&&(wa=setTimeout(fh,t-Ca.now()-ku)),va&&(va=clearInterval(va))):(va||(du=Ca.now(),va=setInterval(Gx,Rm)),Ts=1,Dm(fh))}}function dh(t,r,i){var a=new pu;return r=r==null?0:+r,a.restart(u=>{a.stop(),t(u+r)},r,i),a}var Jx=Su("start","end","cancel","interrupt"),ew=[],Lm=0,ph=1,Ef=2,nu=3,hh=4,Nf=5,ru=6;function Eu(t,r,i,a,u,f){var d=t.__transition;if(!d)t.__transition={};else if(i in d)return;tw(t,i,{name:r,index:a,group:u,on:Jx,tween:ew,time:f.time,delay:f.delay,duration:f.duration,ease:f.ease,timer:null,state:Lm})}function Ff(t,r){var i=Ar(t,r);if(i.state>Lm)throw new Error("too late; already scheduled");return i}function Jr(t,r){var i=Ar(t,r);if(i.state>nu)throw new Error("too late; already running");return i}function Ar(t,r){var i=t.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function tw(t,r,i){var a=t.__transition,u;a[r]=i,i.timer=zm(f,0,i.time);function f(w){i.state=ph,i.timer.restart(d,i.delay,i.time),i.delay<=w&&d(w-i.delay)}function d(w){var b,x,S,N;if(i.state!==ph)return v();for(b in a)if(N=a[b],N.name===i.name){if(N.state===nu)return dh(d);N.state===hh?(N.state=ru,N.timer.stop(),N.on.call("interrupt",t,t.__data__,N.index,N.group),delete a[b]):+b<r&&(N.state=ru,N.timer.stop(),N.on.call("cancel",t,t.__data__,N.index,N.group),delete a[b])}if(dh(function(){i.state===nu&&(i.state=hh,i.timer.restart(m,i.delay,i.time),m(w))}),i.state=Ef,i.on.call("start",t,t.__data__,i.index,i.group),i.state===Ef){for(i.state=nu,u=new Array(S=i.tween.length),b=0,x=-1;b<S;++b)(N=i.tween[b].value.call(t,t.__data__,i.index,i.group))&&(u[++x]=N);u.length=x+1}}function m(w){for(var b=w<i.duration?i.ease.call(null,w/i.duration):(i.timer.restart(v),i.state=Nf,1),x=-1,S=u.length;++x<S;)u[x].call(t,b);i.state===Nf&&(i.on.call("end",t,t.__data__,i.index,i.group),v())}function v(){i.state=ru,i.timer.stop(),delete a[r];for(var w in a)return;delete t.__transition}}function ou(t,r){var i=t.__transition,a,u,f=!0,d;if(i){r=r==null?null:r+"";for(d in i){if((a=i[d]).name!==r){f=!1;continue}u=a.state>Ef&&a.state<Nf,a.state=ru,a.timer.stop(),a.on.call(u?"interrupt":"cancel",t,t.__data__,a.index,a.group),delete i[d]}f&&delete t.__transition}}function nw(t){return this.each(function(){ou(this,t)})}function rw(t,r){var i,a;return function(){var u=Jr(this,t),f=u.tween;if(f!==i){a=i=f;for(var d=0,m=a.length;d<m;++d)if(a[d].name===r){a=a.slice(),a.splice(d,1);break}}u.tween=a}}function ow(t,r,i){var a,u;if(typeof i!="function")throw new Error;return function(){var f=Jr(this,t),d=f.tween;if(d!==a){u=(a=d).slice();for(var m={name:r,value:i},v=0,w=u.length;v<w;++v)if(u[v].name===r){u[v]=m;break}v===w&&u.push(m)}f.tween=u}}function iw(t,r){var i=this._id;if(t+="",arguments.length<2){for(var a=Ar(this.node(),i).tween,u=0,f=a.length,d;u<f;++u)if((d=a[u]).name===t)return d.value;return null}return this.each((r==null?rw:ow)(i,t,r))}function Bf(t,r,i){var a=t._id;return t.each(function(){var u=Jr(this,a);(u.value||(u.value={}))[r]=i.apply(this,arguments)}),function(u){return Ar(u,a).value[r]}}function Fm(t,r){var i;return(typeof r=="number"?Xr:r instanceof Di?cu:(i=Di(r))?(r=i,cu):Am)(t,r)}function sw(t){return function(){this.removeAttribute(t)}}function aw(t){return function(){this.removeAttributeNS(t.space,t.local)}}function lw(t,r,i){var a,u=i+"",f;return function(){var d=this.getAttribute(t);return d===u?null:d===a?f:f=r(a=d,i)}}function uw(t,r,i){var a,u=i+"",f;return function(){var d=this.getAttributeNS(t.space,t.local);return d===u?null:d===a?f:f=r(a=d,i)}}function cw(t,r,i){var a,u,f;return function(){var d,m=i(this),v;return m==null?void this.removeAttribute(t):(d=this.getAttribute(t),v=m+"",d===v?null:d===a&&v===u?f:(u=v,f=r(a=d,m)))}}function fw(t,r,i){var a,u,f;return function(){var d,m=i(this),v;return m==null?void this.removeAttributeNS(t.space,t.local):(d=this.getAttributeNS(t.space,t.local),v=m+"",d===v?null:d===a&&v===u?f:(u=v,f=r(a=d,m)))}}function dw(t,r){var i=bu(t),a=i==="transform"?Ux:Fm;return this.attrTween(t,typeof r=="function"?(i.local?fw:cw)(i,a,Bf(this,"attr."+t,r)):r==null?(i.local?aw:sw)(i):(i.local?uw:lw)(i,a,r))}function pw(t,r){return function(i){this.setAttribute(t,r.call(this,i))}}function hw(t,r){return function(i){this.setAttributeNS(t.space,t.local,r.call(this,i))}}function mw(t,r){var i,a;function u(){var f=r.apply(this,arguments);return f!==a&&(i=(a=f)&&hw(t,f)),i}return u._value=r,u}function gw(t,r){var i,a;function u(){var f=r.apply(this,arguments);return f!==a&&(i=(a=f)&&pw(t,f)),i}return u._value=r,u}function yw(t,r){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(r==null)return this.tween(i,null);if(typeof r!="function")throw new Error;var a=bu(t);return this.tween(i,(a.local?mw:gw)(a,r))}function vw(t,r){return function(){Ff(this,t).delay=+r.apply(this,arguments)}}function xw(t,r){return r=+r,function(){Ff(this,t).delay=r}}function ww(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?vw:xw)(r,t)):Ar(this.node(),r).delay}function _w(t,r){return function(){Jr(this,t).duration=+r.apply(this,arguments)}}function Sw(t,r){return r=+r,function(){Jr(this,t).duration=r}}function bw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?_w:Sw)(r,t)):Ar(this.node(),r).duration}function kw(t,r){if(typeof r!="function")throw new Error;return function(){Jr(this,t).ease=r}}function Ew(t){var r=this._id;return arguments.length?this.each(kw(r,t)):Ar(this.node(),r).ease}function Nw(t,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;Jr(this,t).ease=i}}function Cw(t){if(typeof t!="function")throw new Error;return this.each(Nw(this._id,t))}function Pw(t){typeof t!="function"&&(t=ym(t));for(var r=this._groups,i=r.length,a=new Array(i),u=0;u<i;++u)for(var f=r[u],d=f.length,m=a[u]=[],v,w=0;w<d;++w)(v=f[w])&&t.call(v,v.__data__,w,f)&&m.push(v);return new jo(a,this._parents,this._name,this._id)}function jw(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,i=t._groups,a=r.length,u=i.length,f=Math.min(a,u),d=new Array(a),m=0;m<f;++m)for(var v=r[m],w=i[m],b=v.length,x=d[m]=new Array(b),S,N=0;N<b;++N)(S=v[N]||w[N])&&(x[N]=S);for(;m<a;++m)d[m]=r[m];return new jo(d,this._parents,this._name,this._id)}function Tw(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 Mw(t,r,i){var a,u,f=Tw(r)?Ff:Jr;return function(){var d=f(this,t),m=d.on;m!==a&&(u=(a=m).copy()).on(r,i),d.on=u}}function Iw(t,r){var i=this._id;return arguments.length<2?Ar(this.node(),i).on.on(t):this.each(Mw(i,t,r))}function Aw(t){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==t)return;r&&r.removeChild(this)}}function $w(){return this.on("end.remove",Aw(this._id))}function Ow(t){var r=this._name,i=this._id;typeof t!="function"&&(t=Of(t));for(var a=this._groups,u=a.length,f=new Array(u),d=0;d<u;++d)for(var m=a[d],v=m.length,w=f[d]=new Array(v),b,x,S=0;S<v;++S)(b=m[S])&&(x=t.call(b,b.__data__,S,m))&&("__data__"in b&&(x.__data__=b.__data__),w[S]=x,Eu(w[S],r,i,S,w,Ar(b,i)));return new jo(f,this._parents,r,i)}function Rw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=gm(t));for(var a=this._groups,u=a.length,f=[],d=[],m=0;m<u;++m)for(var v=a[m],w=v.length,b,x=0;x<w;++x)if(b=v[x]){for(var S=t.call(b,b.__data__,x,v),N,C=Ar(b,i),$=0,M=S.length;$<M;++$)(N=S[$])&&Eu(N,r,i,$,S,C);f.push(S),d.push(b)}return new jo(f,d,r,i)}var Dw=$a.prototype.constructor;function zw(){return new Dw(this._groups,this._parents)}function Lw(t,r){var i,a,u;return function(){var f=js(this,t),d=(this.style.removeProperty(t),js(this,t));return f===d?null:f===i&&d===a?u:u=r(i=f,a=d)}}function Bm(t){return function(){this.style.removeProperty(t)}}function Fw(t,r,i){var a,u=i+"",f;return function(){var d=js(this,t);return d===u?null:d===a?f:f=r(a=d,i)}}function Bw(t,r,i){var a,u,f;return function(){var d=js(this,t),m=i(this),v=m+"";return m==null&&(v=m=(this.style.removeProperty(t),js(this,t))),d===v?null:d===a&&v===u?f:(u=v,f=r(a=d,m))}}function Hw(t,r){var i,a,u,f="style."+r,d="end."+f,m;return function(){var v=Jr(this,t),w=v.on,b=v.value[f]==null?m||(m=Bm(r)):void 0;(w!==i||u!==b)&&(a=(i=w).copy()).on(d,u=b),v.on=a}}function Vw(t,r,i){var a=(t+="")=="transform"?Kx:Fm;return r==null?this.styleTween(t,Lw(t,a)).on("end.style."+t,Bm(t)):typeof r=="function"?this.styleTween(t,Bw(t,a,Bf(this,"style."+t,r))).each(Hw(this._id,t)):this.styleTween(t,Fw(t,a,r),i).on("end.style."+t,null)}function Kw(t,r,i){return function(a){this.style.setProperty(t,r.call(this,a),i)}}function Uw(t,r,i){var a,u;function f(){var d=r.apply(this,arguments);return d!==u&&(a=(u=d)&&Kw(t,d,i)),a}return f._value=r,f}function qw(t,r,i){var a="style."+(t+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(r==null)return this.tween(a,null);if(typeof r!="function")throw new Error;return this.tween(a,Uw(t,r,i??""))}function Ww(t){return function(){this.textContent=t}}function Yw(t){return function(){var r=t(this);this.textContent=r??""}}function Xw(t){return this.tween("text",typeof t=="function"?Yw(Bf(this,"text",t)):Ww(t==null?"":t+""))}function Qw(t){return function(r){this.textContent=t.call(this,r)}}function Gw(t){var r,i;function a(){var u=t.apply(this,arguments);return u!==i&&(r=(i=u)&&Qw(u)),r}return a._value=t,a}function Zw(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,Gw(t))}function Jw(){for(var t=this._name,r=this._id,i=Hm(),a=this._groups,u=a.length,f=0;f<u;++f)for(var d=a[f],m=d.length,v,w=0;w<m;++w)if(v=d[w]){var b=Ar(v,r);Eu(v,t,i,w,d,{time:b.time+b.delay+b.duration,delay:0,duration:b.duration,ease:b.ease})}return new jo(a,this._parents,t,i)}function e1(){var t,r,i=this,a=i._id,u=i.size();return new Promise(function(f,d){var m={value:d},v={value:function(){--u===0&&f()}};i.each(function(){var w=Jr(this,a),b=w.on;b!==t&&(r=(t=b).copy(),r._.cancel.push(m),r._.interrupt.push(m),r._.end.push(v)),w.on=r}),u===0&&f()})}var t1=0;function jo(t,r,i,a){this._groups=t,this._parents=r,this._name=i,this._id=a}function Hm(){return++t1}var No=$a.prototype;jo.prototype={constructor:jo,select:Ow,selectAll:Rw,selectChild:No.selectChild,selectChildren:No.selectChildren,filter:Pw,merge:jw,selection:zw,transition:Jw,call:No.call,nodes:No.nodes,node:No.node,size:No.size,empty:No.empty,each:No.each,on:Iw,attr:dw,attrTween:yw,style:Vw,styleTween:qw,text:Xw,textTween:Zw,remove:$w,tween:iw,delay:ww,duration:bw,ease:Ew,easeVarying:Cw,end:e1,[Symbol.iterator]:No[Symbol.iterator]};function n1(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var r1={time:null,delay:0,duration:250,ease:n1};function o1(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 i1(t){var r,i;t instanceof jo?(r=t._id,t=t._name):(r=Hm(),(i=r1).time=Lf(),t=t==null?null:t+"");for(var a=this._groups,u=a.length,f=0;f<u;++f)for(var d=a[f],m=d.length,v,w=0;w<m;++w)(v=d[w])&&Eu(v,t,r,w,d,i||o1(v,r));return new jo(a,this._parents,t,r)}$a.prototype.interrupt=nw;$a.prototype.transition=i1;const Yl=t=>()=>t;function s1(t,{sourceEvent:r,target:i,transform:a,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:u}})}function Co(t,r,i){this.k=t,this.x=r,this.y=i}Co.prototype={constructor:Co,scale:function(t){return t===1?this:new Co(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new Co(this.k,this.x+this.k*t,this.y+this.k*r)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Nu=new Co(1,0,0);Vm.prototype=Co.prototype;function Vm(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Nu;return t.__zoom}function rf(t){t.stopImmediatePropagation()}function xa(t){t.preventDefault(),t.stopImmediatePropagation()}function a1(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function l1(){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 mh(){return this.__zoom||Nu}function u1(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function c1(){return navigator.maxTouchPoints||"ontouchstart"in this}function f1(t,r,i){var a=t.invertX(r[0][0])-i[0][0],u=t.invertX(r[1][0])-i[1][0],f=t.invertY(r[0][1])-i[0][1],d=t.invertY(r[1][1])-i[1][1];return t.translate(u>a?(a+u)/2:Math.min(0,a)||Math.max(0,u),d>f?(f+d)/2:Math.min(0,f)||Math.max(0,d))}function Km(){var t=a1,r=l1,i=f1,a=u1,u=c1,f=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],m=250,v=tu,w=Su("start","zoom","end"),b,x,S,N=500,C=150,$=0,M=10;function I(z){z.property("__zoom",mh).on("wheel.zoom",pe,{passive:!1}).on("mousedown.zoom",he).on("dblclick.zoom",_e).filter(u).on("touchstart.zoom",Q).on("touchmove.zoom",le).on("touchend.zoom touchcancel.zoom",xe).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}I.transform=function(z,ue,te,ae){var L=z.selection?z.selection():z;L.property("__zoom",mh),z!==L?q(z,ue,te,ae):L.interrupt().each(function(){V(this,arguments).event(ae).start().zoom(null,typeof ue=="function"?ue.apply(this,arguments):ue).end()})},I.scaleBy=function(z,ue,te,ae){I.scaleTo(z,function(){var L=this.__zoom.k,F=typeof ue=="function"?ue.apply(this,arguments):ue;return L*F},te,ae)},I.scaleTo=function(z,ue,te,ae){I.transform(z,function(){var L=r.apply(this,arguments),F=this.__zoom,X=te==null?R(L):typeof te=="function"?te.apply(this,arguments):te,O=F.invert(X),B=typeof ue=="function"?ue.apply(this,arguments):ue;return i(j(H(F,B),X,O),L,d)},te,ae)},I.translateBy=function(z,ue,te,ae){I.transform(z,function(){return i(this.__zoom.translate(typeof ue=="function"?ue.apply(this,arguments):ue,typeof te=="function"?te.apply(this,arguments):te),r.apply(this,arguments),d)},null,ae)},I.translateTo=function(z,ue,te,ae,L){I.transform(z,function(){var F=r.apply(this,arguments),X=this.__zoom,O=ae==null?R(F):typeof ae=="function"?ae.apply(this,arguments):ae;return i(Nu.translate(O[0],O[1]).scale(X.k).translate(typeof ue=="function"?-ue.apply(this,arguments):-ue,typeof te=="function"?-te.apply(this,arguments):-te),F,d)},ae,L)};function H(z,ue){return ue=Math.max(f[0],Math.min(f[1],ue)),ue===z.k?z:new Co(ue,z.x,z.y)}function j(z,ue,te){var ae=ue[0]-te[0]*z.k,L=ue[1]-te[1]*z.k;return ae===z.x&&L===z.y?z:new Co(z.k,ae,L)}function R(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function q(z,ue,te,ae){z.on("start.zoom",function(){V(this,arguments).event(ae).start()}).on("interrupt.zoom end.zoom",function(){V(this,arguments).event(ae).end()}).tween("zoom",function(){var L=this,F=arguments,X=V(L,F).event(ae),O=r.apply(L,F),B=te==null?R(O):typeof te=="function"?te.apply(L,F):te,ke=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),Se=L.__zoom,Ie=typeof ue=="function"?ue.apply(L,F):ue,Re=v(Se.invert(B).concat(ke/Se.k),Ie.invert(B).concat(ke/Ie.k));return function(Ae){if(Ae===1)Ae=Ie;else{var we=Re(Ae),ze=ke/we[2];Ae=new Co(ze,B[0]-we[0]*ze,B[1]-we[1]*ze)}X.zoom(null,Ae)}})}function V(z,ue,te){return!te&&z.__zooming||new U(z,ue)}function U(z,ue){this.that=z,this.args=ue,this.active=0,this.sourceEvent=null,this.extent=r.apply(z,ue),this.taps=0}U.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,ue){return this.mouse&&z!=="mouse"&&(this.mouse[1]=ue.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=ue.invert(this.touch0[0])),this.touch1&&z!=="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(z){var ue=Gn(this.that).datum();w.call(z,this.that,new s1(z,{sourceEvent:this.sourceEvent,target:I,transform:this.that.__zoom,dispatch:w}),ue)}};function pe(z,...ue){if(!t.apply(this,arguments))return;var te=V(this,ue).event(z),ae=this.__zoom,L=Math.max(f[0],Math.min(f[1],ae.k*Math.pow(2,a.apply(this,arguments)))),F=jr(z);if(te.wheel)(te.mouse[0][0]!==F[0]||te.mouse[0][1]!==F[1])&&(te.mouse[1]=ae.invert(te.mouse[0]=F)),clearTimeout(te.wheel);else{if(ae.k===L)return;te.mouse=[F,ae.invert(F)],ou(this),te.start()}xa(z),te.wheel=setTimeout(X,C),te.zoom("mouse",i(j(H(ae,L),te.mouse[0],te.mouse[1]),te.extent,d));function X(){te.wheel=null,te.end()}}function he(z,...ue){if(S||!t.apply(this,arguments))return;var te=z.currentTarget,ae=V(this,ue,!0).event(z),L=Gn(z.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",ke,!0),F=jr(z,te),X=z.clientX,O=z.clientY;Cm(z.view),rf(z),ae.mouse=[F,this.__zoom.invert(F)],ou(this),ae.start();function B(Se){if(xa(Se),!ae.moved){var Ie=Se.clientX-X,Re=Se.clientY-O;ae.moved=Ie*Ie+Re*Re>$}ae.event(Se).zoom("mouse",i(j(ae.that.__zoom,ae.mouse[0]=jr(Se,te),ae.mouse[1]),ae.extent,d))}function ke(Se){L.on("mousemove.zoom mouseup.zoom",null),Pm(Se.view,ae.moved),xa(Se),ae.event(Se).end()}}function _e(z,...ue){if(t.apply(this,arguments)){var te=this.__zoom,ae=jr(z.changedTouches?z.changedTouches[0]:z,this),L=te.invert(ae),F=te.k*(z.shiftKey?.5:2),X=i(j(H(te,F),ae,L),r.apply(this,ue),d);xa(z),m>0?Gn(this).transition().duration(m).call(q,X,ae,z):Gn(this).call(I.transform,X,ae,z)}}function Q(z,...ue){if(t.apply(this,arguments)){var te=z.touches,ae=te.length,L=V(this,ue,z.changedTouches.length===ae).event(z),F,X,O,B;for(rf(z),X=0;X<ae;++X)O=te[X],B=jr(O,this),B=[B,this.__zoom.invert(B),O.identifier],L.touch0?!L.touch1&&L.touch0[2]!==B[2]&&(L.touch1=B,L.taps=0):(L.touch0=B,F=!0,L.taps=1+!!b);b&&(b=clearTimeout(b)),F&&(L.taps<2&&(x=B[0],b=setTimeout(function(){b=null},N)),ou(this),L.start())}}function le(z,...ue){if(this.__zooming){var te=V(this,ue).event(z),ae=z.changedTouches,L=ae.length,F,X,O,B;for(xa(z),F=0;F<L;++F)X=ae[F],O=jr(X,this),te.touch0&&te.touch0[2]===X.identifier?te.touch0[0]=O:te.touch1&&te.touch1[2]===X.identifier&&(te.touch1[0]=O);if(X=te.that.__zoom,te.touch1){var ke=te.touch0[0],Se=te.touch0[1],Ie=te.touch1[0],Re=te.touch1[1],Ae=(Ae=Ie[0]-ke[0])*Ae+(Ae=Ie[1]-ke[1])*Ae,we=(we=Re[0]-Se[0])*we+(we=Re[1]-Se[1])*we;X=H(X,Math.sqrt(Ae/we)),O=[(ke[0]+Ie[0])/2,(ke[1]+Ie[1])/2],B=[(Se[0]+Re[0])/2,(Se[1]+Re[1])/2]}else if(te.touch0)O=te.touch0[0],B=te.touch0[1];else return;te.zoom("touch",i(j(X,O,B),te.extent,d))}}function xe(z,...ue){if(this.__zooming){var te=V(this,ue).event(z),ae=z.changedTouches,L=ae.length,F,X;for(rf(z),S&&clearTimeout(S),S=setTimeout(function(){S=null},N),F=0;F<L;++F)X=ae[F],te.touch0&&te.touch0[2]===X.identifier?delete te.touch0:te.touch1&&te.touch1[2]===X.identifier&&delete te.touch1;if(te.touch1&&!te.touch0&&(te.touch0=te.touch1,delete te.touch1),te.touch0)te.touch0[1]=this.__zoom.invert(te.touch0[0]);else if(te.end(),te.taps===2&&(X=jr(X,this),Math.hypot(x[0]-X[0],x[1]-X[1])<M)){var O=Gn(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return I.wheelDelta=function(z){return arguments.length?(a=typeof z=="function"?z:Yl(+z),I):a},I.filter=function(z){return arguments.length?(t=typeof z=="function"?z:Yl(!!z),I):t},I.touchable=function(z){return arguments.length?(u=typeof z=="function"?z:Yl(!!z),I):u},I.extent=function(z){return arguments.length?(r=typeof z=="function"?z:Yl([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),I):r},I.scaleExtent=function(z){return arguments.length?(f[0]=+z[0],f[1]=+z[1],I):[f[0],f[1]]},I.translateExtent=function(z){return arguments.length?(d[0][0]=+z[0][0],d[1][0]=+z[1][0],d[0][1]=+z[0][1],d[1][1]=+z[1][1],I):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},I.constrain=function(z){return arguments.length?(i=z,I):i},I.duration=function(z){return arguments.length?(m=+z,I):m},I.interpolate=function(z){return arguments.length?(v=z,I):v},I.on=function(){var z=w.on.apply(w,arguments);return z===w?I:z},I.clickDistance=function(z){return arguments.length?($=(z=+z)*z,I):Math.sqrt($)},I.tapDistance=function(z){return arguments.length?(M=+z,I):M},I}const Gr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:r,sourceHandle:i,targetHandle:a})=>`Couldn't create edge for ${t} handle id: "${t==="source"?i:a}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Pa=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Um=["Enter"," ","Escape"],qm={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:r,y:i})=>`Moved selected node ${t}. New position, x: ${r}, y: ${i}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Ms;(function(t){t.Strict="strict",t.Loose="loose"})(Ms||(Ms={}));var Ri;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Ri||(Ri={}));var ja;(function(t){t.Partial="partial",t.Full="full"})(ja||(ja={}));const Wm={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ai;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(ai||(ai={}));var hu;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(hu||(hu={}));var Ze;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Ze||(Ze={}));const gh={[Ze.Left]:Ze.Right,[Ze.Right]:Ze.Left,[Ze.Top]:Ze.Bottom,[Ze.Bottom]:Ze.Top};function Ym(t){return t===null?null:t?"valid":"invalid"}const Xm=t=>"id"in t&&"source"in t&&"target"in t,d1=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Hf=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Ra=(t,r=[0,0])=>{const{width:i,height:a}=To(t),u=t.origin??r,f=i*u[0],d=a*u[1];return{x:t.position.x-f,y:t.position.y-d}},p1=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const i=t.reduce((a,u)=>{const f=typeof u=="string";let d=!r.nodeLookup&&!f?u:void 0;r.nodeLookup&&(d=f?r.nodeLookup.get(u):Hf(u)?u:r.nodeLookup.get(u.id));const m=d?mu(d,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Cu(a,m)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Pu(i)},Da=(t,r={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return t.forEach(u=>{(r.filter===void 0||r.filter(u))&&(i=Cu(i,mu(u)),a=!0)}),a?Pu(i):{x:0,y:0,width:0,height:0}},Vf=(t,r,[i,a,u]=[0,0,1],f=!1,d=!1)=>{const m={...La(r,[i,a,u]),width:r.width/u,height:r.height/u},v=[];for(const w of t.values()){const{measured:b,selectable:x=!0,hidden:S=!1}=w;if(d&&!x||S)continue;const N=b.width??w.width??w.initialWidth??null,C=b.height??w.height??w.initialHeight??null,$=Ta(m,As(w)),M=(N??0)*(C??0),I=f&&$>0;(!w.internals.handleBounds||I||$>=M||w.dragging)&&v.push(w)}return v},h1=(t,r)=>{const i=new Set;return t.forEach(a=>{i.add(a.id)}),r.filter(a=>i.has(a.source)||i.has(a.target))};function m1(t,r){const i=new Map,a=r!=null&&r.nodes?new Set(r.nodes.map(u=>u.id)):null;return t.forEach(u=>{u.measured.width&&u.measured.height&&((r==null?void 0:r.includeHiddenNodes)||!u.hidden)&&(!a||a.has(u.id))&&i.set(u.id,u)}),i}async function g1({nodes:t,width:r,height:i,panZoom:a,minZoom:u,maxZoom:f},d){if(t.size===0)return Promise.resolve(!0);const m=m1(t,d),v=Da(m),w=Kf(v,r,i,(d==null?void 0:d.minZoom)??u,(d==null?void 0:d.maxZoom)??f,(d==null?void 0:d.padding)??.1);return await a.setViewport(w,{duration:d==null?void 0:d.duration,ease:d==null?void 0:d.ease,interpolate:d==null?void 0:d.interpolate}),Promise.resolve(!0)}function Qm({nodeId:t,nextPosition:r,nodeLookup:i,nodeOrigin:a=[0,0],nodeExtent:u,onError:f}){const d=i.get(t),m=d.parentId?i.get(d.parentId):void 0,{x:v,y:w}=m?m.internals.positionAbsolute:{x:0,y:0},b=d.origin??a;let x=d.extent||u;if(d.extent==="parent"&&!d.expandParent)if(!m)f==null||f("005",Gr.error005());else{const N=m.measured.width,C=m.measured.height;N&&C&&(x=[[v,w],[v+N,w+C]])}else m&&$s(d.extent)&&(x=[[d.extent[0][0]+v,d.extent[0][1]+w],[d.extent[1][0]+v,d.extent[1][1]+w]]);const S=$s(x)?Li(r,x,d.measured):r;return(d.measured.width===void 0||d.measured.height===void 0)&&(f==null||f("015",Gr.error015())),{position:{x:S.x-v+(d.measured.width??0)*b[0],y:S.y-w+(d.measured.height??0)*b[1]},positionAbsolute:S}}async function y1({nodesToRemove:t=[],edgesToRemove:r=[],nodes:i,edges:a,onBeforeDelete:u}){const f=new Set(t.map(S=>S.id)),d=[];for(const S of i){if(S.deletable===!1)continue;const N=f.has(S.id),C=!N&&S.parentId&&d.find($=>$.id===S.parentId);(N||C)&&d.push(S)}const m=new Set(r.map(S=>S.id)),v=a.filter(S=>S.deletable!==!1),b=h1(d,v);for(const S of v)m.has(S.id)&&!b.find(C=>C.id===S.id)&&b.push(S);if(!u)return{edges:b,nodes:d};const x=await u({nodes:d,edges:b});return typeof x=="boolean"?x?{edges:b,nodes:d}:{edges:[],nodes:[]}:x}const Is=(t,r=0,i=1)=>Math.min(Math.max(t,r),i),Li=(t={x:0,y:0},r,i)=>({x:Is(t.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:Is(t.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function Gm(t,r,i){const{width:a,height:u}=To(i),{x:f,y:d}=i.internals.positionAbsolute;return Li(t,[[f,d],[f+a,d+u]],r)}const yh=(t,r,i)=>t<r?Is(Math.abs(t-r),1,r)/r:t>i?-Is(Math.abs(t-i),1,r)/r:0,Zm=(t,r,i=15,a=40)=>{const u=yh(t.x,a,r.width-a)*i,f=yh(t.y,a,r.height-a)*i;return[u,f]},Cu=(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)}),Cf=({x:t,y:r,width:i,height:a})=>({x:t,y:r,x2:t+i,y2:r+a}),Pu=({x:t,y:r,x2:i,y2:a})=>({x:t,y:r,width:i-t,height:a-r}),As=(t,r=[0,0])=>{var u,f;const{x:i,y:a}=Hf(t)?t.internals.positionAbsolute:Ra(t,r);return{x:i,y:a,width:((u=t.measured)==null?void 0:u.width)??t.width??t.initialWidth??0,height:((f=t.measured)==null?void 0:f.height)??t.height??t.initialHeight??0}},mu=(t,r=[0,0])=>{var u,f;const{x:i,y:a}=Hf(t)?t.internals.positionAbsolute:Ra(t,r);return{x:i,y:a,x2:i+(((u=t.measured)==null?void 0:u.width)??t.width??t.initialWidth??0),y2:a+(((f=t.measured)==null?void 0:f.height)??t.height??t.initialHeight??0)}},Jm=(t,r)=>Pu(Cu(Cf(t),Cf(r))),Ta=(t,r)=>{const i=Math.max(0,Math.min(t.x+t.width,r.x+r.width)-Math.max(t.x,r.x)),a=Math.max(0,Math.min(t.y+t.height,r.y+r.height)-Math.max(t.y,r.y));return Math.ceil(i*a)},vh=t=>Mr(t.width)&&Mr(t.height)&&Mr(t.x)&&Mr(t.y),Mr=t=>!isNaN(t)&&isFinite(t),v1=(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])}),La=({x:t,y:r},[i,a,u],f=!1,d=[1,1])=>{const m={x:(t-i)/u,y:(r-a)/u};return f?za(m,d):m},gu=({x:t,y:r},[i,a,u])=>({x:t*u+i,y:r*u+a});function bs(t,r){if(typeof t=="number")return Math.floor((r-r/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(i)}if(typeof t=="string"&&t.endsWith("%")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(r*i*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function x1(t,r,i){if(typeof t=="string"||typeof t=="number"){const a=bs(t,i),u=bs(t,r);return{top:a,right:u,bottom:a,left:u,x:u*2,y:a*2}}if(typeof t=="object"){const a=bs(t.top??t.y??0,i),u=bs(t.bottom??t.y??0,i),f=bs(t.left??t.x??0,r),d=bs(t.right??t.x??0,r);return{top:a,right:d,bottom:u,left:f,x:f+d,y:a+u}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function w1(t,r,i,a,u,f){const{x:d,y:m}=gu(t,[r,i,a]),{x:v,y:w}=gu({x:t.x+t.width,y:t.y+t.height},[r,i,a]),b=u-v,x=f-w;return{left:Math.floor(d),top:Math.floor(m),right:Math.floor(b),bottom:Math.floor(x)}}const Kf=(t,r,i,a,u,f)=>{const d=x1(f,r,i),m=(r-d.x)/t.width,v=(i-d.y)/t.height,w=Math.min(m,v),b=Is(w,a,u),x=t.x+t.width/2,S=t.y+t.height/2,N=r/2-x*b,C=i/2-S*b,$=w1(t,N,C,b,r,i),M={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:N-M.left+M.right,y:C-M.top+M.bottom,zoom:b}},Ma=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function $s(t){return t!=null&&t!=="parent"}function To(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 eg(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 tg(t,r={width:0,height:0},i,a,u){const f={...t},d=a.get(i);if(d){const m=d.origin||u;f.x+=d.internals.positionAbsolute.x-(r.width??0)*m[0],f.y+=d.internals.positionAbsolute.y-(r.height??0)*m[1]}return f}function xh(t,r){if(t.size!==r.size)return!1;for(const i of t)if(!r.has(i))return!1;return!0}function _1(){let t,r;return{promise:new Promise((a,u)=>{t=a,r=u}),resolve:t,reject:r}}function S1(t){return{...qm,...t||{}}}function ba(t,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:a,containerBounds:u}){const{x:f,y:d}=Ir(t),m=La({x:f-((u==null?void 0:u.left)??0),y:d-((u==null?void 0:u.top)??0)},a),{x:v,y:w}=i?za(m,r):m;return{xSnapped:v,ySnapped:w,...m}}const Uf=t=>({width:t.offsetWidth,height:t.offsetHeight}),ng=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},b1=["INPUT","SELECT","TEXTAREA"];function rg(t){var a,u;const r=((u=(a=t.composedPath)==null?void 0:a.call(t))==null?void 0:u[0])||t.target;return(r==null?void 0:r.nodeType)!==1?!1:b1.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const og=t=>"clientX"in t,Ir=(t,r)=>{var f,d;const i=og(t),a=i?t.clientX:(f=t.touches)==null?void 0:f[0].clientX,u=i?t.clientY:(d=t.touches)==null?void 0:d[0].clientY;return{x:a-((r==null?void 0:r.left)??0),y:u-((r==null?void 0:r.top)??0)}},wh=(t,r,i,a,u)=>{const f=r.querySelectorAll(`.${t}`);return!f||!f.length?null:Array.from(f).map(d=>{const m=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:t,nodeId:u,position:d.getAttribute("data-handlepos"),x:(m.left-i.left)/a,y:(m.top-i.top)/a,...Uf(d)}})};function ig({sourceX:t,sourceY:r,targetX:i,targetY:a,sourceControlX:u,sourceControlY:f,targetControlX:d,targetControlY:m}){const v=t*.125+u*.375+d*.375+i*.125,w=r*.125+f*.375+m*.375+a*.125,b=Math.abs(v-t),x=Math.abs(w-r);return[v,w,b,x]}function Xl(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function _h({pos:t,x1:r,y1:i,x2:a,y2:u,c:f}){switch(t){case Ze.Left:return[r-Xl(r-a,f),i];case Ze.Right:return[r+Xl(a-r,f),i];case Ze.Top:return[r,i-Xl(i-u,f)];case Ze.Bottom:return[r,i+Xl(u-i,f)]}}function sg({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:a,targetY:u,targetPosition:f=Ze.Top,curvature:d=.25}){const[m,v]=_h({pos:i,x1:t,y1:r,x2:a,y2:u,c:d}),[w,b]=_h({pos:f,x1:a,y1:u,x2:t,y2:r,c:d}),[x,S,N,C]=ig({sourceX:t,sourceY:r,targetX:a,targetY:u,sourceControlX:m,sourceControlY:v,targetControlX:w,targetControlY:b});return[`M${t},${r} C${m},${v} ${w},${b} ${a},${u}`,x,S,N,C]}function ag({sourceX:t,sourceY:r,targetX:i,targetY:a}){const u=Math.abs(i-t)/2,f=i<t?i+u:i-u,d=Math.abs(a-r)/2,m=a<r?a+d:a-d;return[f,m,u,d]}function k1({sourceNode:t,targetNode:r,selected:i=!1,zIndex:a=0,elevateOnSelect:u=!1,zIndexMode:f="basic"}){if(f==="manual")return a;const d=u&&i?a+1e3:a,m=Math.max(t.parentId||u&&t.selected?t.internals.z:0,r.parentId||u&&r.selected?r.internals.z:0);return d+m}function E1({sourceNode:t,targetNode:r,width:i,height:a,transform:u}){const f=Cu(mu(t),mu(r));f.x===f.x2&&(f.x2+=1),f.y===f.y2&&(f.y2+=1);const d={x:-u[0]/u[2],y:-u[1]/u[2],width:i/u[2],height:a/u[2]};return Ta(d,Pu(f))>0}const N1=({source:t,sourceHandle:r,target:i,targetHandle:a})=>`xy-edge__${t}${r||""}-${i}${a||""}`,C1=(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)),lg=(t,r,i={})=>{if(!t.source||!t.target)return r;const a=i.getEdgeId||N1;let u;return Xm(t)?u={...t}:u={...t,id:a(t)},C1(u,r)?r:(u.sourceHandle===null&&delete u.sourceHandle,u.targetHandle===null&&delete u.targetHandle,r.concat(u))};function ug({sourceX:t,sourceY:r,targetX:i,targetY:a}){const[u,f,d,m]=ag({sourceX:t,sourceY:r,targetX:i,targetY:a});return[`M ${t},${r}L ${i},${a}`,u,f,d,m]}const Sh={[Ze.Left]:{x:-1,y:0},[Ze.Right]:{x:1,y:0},[Ze.Top]:{x:0,y:-1},[Ze.Bottom]:{x:0,y:1}},P1=({source:t,sourcePosition:r=Ze.Bottom,target:i})=>r===Ze.Left||r===Ze.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},bh=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function j1({source:t,sourcePosition:r=Ze.Bottom,target:i,targetPosition:a=Ze.Top,center:u,offset:f,stepPosition:d}){const m=Sh[r],v=Sh[a],w={x:t.x+m.x*f,y:t.y+m.y*f},b={x:i.x+v.x*f,y:i.y+v.y*f},x=P1({source:w,sourcePosition:r,target:b}),S=x.x!==0?"x":"y",N=x[S];let C=[],$,M;const I={x:0,y:0},H={x:0,y:0},[,,j,R]=ag({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(m[S]*v[S]===-1){S==="x"?($=u.x??w.x+(b.x-w.x)*d,M=u.y??(w.y+b.y)/2):($=u.x??(w.x+b.x)/2,M=u.y??w.y+(b.y-w.y)*d);const pe=[{x:$,y:w.y},{x:$,y:b.y}],he=[{x:w.x,y:M},{x:b.x,y:M}];m[S]===N?C=S==="x"?pe:he:C=S==="x"?he:pe}else{const pe=[{x:w.x,y:b.y}],he=[{x:b.x,y:w.y}];if(S==="x"?C=m.x===N?he:pe:C=m.y===N?pe:he,r===a){const z=Math.abs(t[S]-i[S]);if(z<=f){const ue=Math.min(f-1,f-z);m[S]===N?I[S]=(w[S]>t[S]?-1:1)*ue:H[S]=(b[S]>i[S]?-1:1)*ue}}if(r!==a){const z=S==="x"?"y":"x",ue=m[S]===v[z],te=w[z]>b[z],ae=w[z]<b[z];(m[S]===1&&(!ue&&te||ue&&ae)||m[S]!==1&&(!ue&&ae||ue&&te))&&(C=S==="x"?pe:he)}const _e={x:w.x+I.x,y:w.y+I.y},Q={x:b.x+H.x,y:b.y+H.y},le=Math.max(Math.abs(_e.x-C[0].x),Math.abs(Q.x-C[0].x)),xe=Math.max(Math.abs(_e.y-C[0].y),Math.abs(Q.y-C[0].y));le>=xe?($=(_e.x+Q.x)/2,M=C[0].y):($=C[0].x,M=(_e.y+Q.y)/2)}const q={x:w.x+I.x,y:w.y+I.y},V={x:b.x+H.x,y:b.y+H.y};return[[t,...q.x!==C[0].x||q.y!==C[0].y?[q]:[],...C,...V.x!==C[C.length-1].x||V.y!==C[C.length-1].y?[V]:[],i],$,M,j,R]}function T1(t,r,i,a){const u=Math.min(bh(t,r)/2,bh(r,i)/2,a),{x:f,y:d}=r;if(t.x===f&&f===i.x||t.y===d&&d===i.y)return`L${f} ${d}`;if(t.y===d){const w=t.x<i.x?-1:1,b=t.y<i.y?1:-1;return`L ${f+u*w},${d}Q ${f},${d} ${f},${d+u*b}`}const m=t.x<i.x?1:-1,v=t.y<i.y?-1:1;return`L ${f},${d+u*v}Q ${f},${d} ${f+u*m},${d}`}function Pf({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:a,targetY:u,targetPosition:f=Ze.Top,borderRadius:d=5,centerX:m,centerY:v,offset:w=20,stepPosition:b=.5}){const[x,S,N,C,$]=j1({source:{x:t,y:r},sourcePosition:i,target:{x:a,y:u},targetPosition:f,center:{x:m,y:v},offset:w,stepPosition:b});let M=`M${x[0].x} ${x[0].y}`;for(let I=1;I<x.length-1;I++)M+=T1(x[I-1],x[I],x[I+1],d);return M+=`L${x[x.length-1].x} ${x[x.length-1].y}`,[M,S,N,C,$]}function kh(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function M1(t){var x;const{sourceNode:r,targetNode:i}=t;if(!kh(r)||!kh(i))return null;const a=r.internals.handleBounds||Eh(r.handles),u=i.internals.handleBounds||Eh(i.handles),f=Nh((a==null?void 0:a.source)??[],t.sourceHandle),d=Nh(t.connectionMode===Ms.Strict?(u==null?void 0:u.target)??[]:((u==null?void 0:u.target)??[]).concat((u==null?void 0:u.source)??[]),t.targetHandle);if(!f||!d)return(x=t.onError)==null||x.call(t,"008",Gr.error008(f?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const m=(f==null?void 0:f.position)||Ze.Bottom,v=(d==null?void 0:d.position)||Ze.Top,w=Fi(r,f,m),b=Fi(i,d,v);return{sourceX:w.x,sourceY:w.y,targetX:b.x,targetY:b.y,sourcePosition:m,targetPosition:v}}function Eh(t){if(!t)return null;const r=[],i=[];for(const a of t)a.width=a.width??1,a.height=a.height??1,a.type==="source"?r.push(a):a.type==="target"&&i.push(a);return{source:r,target:i}}function Fi(t,r,i=Ze.Left,a=!1){const u=((r==null?void 0:r.x)??0)+t.internals.positionAbsolute.x,f=((r==null?void 0:r.y)??0)+t.internals.positionAbsolute.y,{width:d,height:m}=r??To(t);if(a)return{x:u+d/2,y:f+m/2};switch((r==null?void 0:r.position)??i){case Ze.Top:return{x:u+d/2,y:f};case Ze.Right:return{x:u+d,y:f+m/2};case Ze.Bottom:return{x:u+d/2,y:f+m};case Ze.Left:return{x:u,y:f+m/2}}}function Nh(t,r){return t&&(r?t.find(i=>i.id===r):t[0])||null}function jf(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(a=>`${a}=${t[a]}`).join("&")}`:""}function I1(t,{id:r,defaultColor:i,defaultMarkerStart:a,defaultMarkerEnd:u}){const f=new Set;return t.reduce((d,m)=>([m.markerStart||a,m.markerEnd||u].forEach(v=>{if(v&&typeof v=="object"){const w=jf(v,r);f.has(w)||(d.push({id:w,color:v.color||i,...v}),f.add(w))}}),d),[]).sort((d,m)=>d.id.localeCompare(m.id))}const cg=1e3,A1=10,qf={nodeOrigin:[0,0],nodeExtent:Pa,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},$1={...qf,checkEquality:!0};function Wf(t,r){const i={...t};for(const a in r)r[a]!==void 0&&(i[a]=r[a]);return i}function O1(t,r,i){const a=Wf(qf,i);for(const u of t.values())if(u.parentId)Xf(u,t,r,a);else{const f=Ra(u,a.nodeOrigin),d=$s(u.extent)?u.extent:a.nodeExtent,m=Li(f,d,To(u));u.internals.positionAbsolute=m}}function R1(t,r){if(!t.handles)return t.measured?r==null?void 0:r.internals.handleBounds:void 0;const i=[],a=[];for(const u of t.handles){const f={id:u.id,width:u.width??1,height:u.height??1,nodeId:t.id,x:u.x,y:u.y,position:u.position,type:u.type};u.type==="source"?i.push(f):u.type==="target"&&a.push(f)}return{source:i,target:a}}function Yf(t){return t==="manual"}function Tf(t,r,i,a={}){var b,x;const u=Wf($1,a),f={i:0},d=new Map(r),m=u!=null&&u.elevateNodesOnSelect&&!Yf(u.zIndexMode)?cg:0;let v=t.length>0,w=!1;r.clear(),i.clear();for(const S of t){let N=d.get(S.id);if(u.checkEquality&&S===(N==null?void 0:N.internals.userNode))r.set(S.id,N);else{const C=Ra(S,u.nodeOrigin),$=$s(S.extent)?S.extent:u.nodeExtent,M=Li(C,$,To(S));N={...u.defaults,...S,measured:{width:(b=S.measured)==null?void 0:b.width,height:(x=S.measured)==null?void 0:x.height},internals:{positionAbsolute:M,handleBounds:R1(S,N),z:fg(S,m,u.zIndexMode),userNode:S}},r.set(S.id,N)}(N.measured===void 0||N.measured.width===void 0||N.measured.height===void 0)&&!N.hidden&&(v=!1),S.parentId&&Xf(N,r,i,a,f),w||(w=S.selected??!1)}return{nodesInitialized:v,hasSelectedNodes:w}}function D1(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 Xf(t,r,i,a,u){const{elevateNodesOnSelect:f,nodeOrigin:d,nodeExtent:m,zIndexMode:v}=Wf(qf,a),w=t.parentId,b=r.get(w);if(!b){console.warn(`Parent node ${w} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}D1(t,i),u&&!b.parentId&&b.internals.rootParentIndex===void 0&&v==="auto"&&(b.internals.rootParentIndex=++u.i,b.internals.z=b.internals.z+u.i*A1),u&&b.internals.rootParentIndex!==void 0&&(u.i=b.internals.rootParentIndex);const x=f&&!Yf(v)?cg:0,{x:S,y:N,z:C}=z1(t,b,d,m,x,v),{positionAbsolute:$}=t.internals,M=S!==$.x||N!==$.y;(M||C!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:M?{x:S,y:N}:$,z:C}})}function fg(t,r,i){const a=Mr(t.zIndex)?t.zIndex:0;return Yf(i)?a:a+(t.selected?r:0)}function z1(t,r,i,a,u,f){const{x:d,y:m}=r.internals.positionAbsolute,v=To(t),w=Ra(t,i),b=$s(t.extent)?Li(w,t.extent,v):w;let x=Li({x:d+b.x,y:m+b.y},a,v);t.extent==="parent"&&(x=Gm(x,v,r));const S=fg(t,u,f),N=r.internals.z??0;return{x:x.x,y:x.y,z:N>=S?N+1:S}}function Qf(t,r,i,a=[0,0]){var d;const u=[],f=new Map;for(const m of t){const v=r.get(m.parentId);if(!v)continue;const w=((d=f.get(m.parentId))==null?void 0:d.expandedRect)??As(v),b=Jm(w,m.rect);f.set(m.parentId,{expandedRect:b,parent:v})}return f.size>0&&f.forEach(({expandedRect:m,parent:v},w)=>{var j;const b=v.internals.positionAbsolute,x=To(v),S=v.origin??a,N=m.x<b.x?Math.round(Math.abs(b.x-m.x)):0,C=m.y<b.y?Math.round(Math.abs(b.y-m.y)):0,$=Math.max(x.width,Math.round(m.width)),M=Math.max(x.height,Math.round(m.height)),I=($-x.width)*S[0],H=(M-x.height)*S[1];(N>0||C>0||I||H)&&(u.push({id:w,type:"position",position:{x:v.position.x-N+I,y:v.position.y-C+H}}),(j=i.get(w))==null||j.forEach(R=>{t.some(q=>q.id===R.id)||u.push({id:R.id,type:"position",position:{x:R.position.x+N,y:R.position.y+C}})})),(x.width<m.width||x.height<m.height||N||C)&&u.push({id:w,type:"dimensions",setAttributes:!0,dimensions:{width:$+(N?S[0]*N-I:0),height:M+(C?S[1]*C-H:0)}})}),u}function L1(t,r,i,a,u,f,d){const m=a==null?void 0:a.querySelector(".xyflow__viewport");let v=!1;if(!m)return{changes:[],updatedInternals:v};const w=[],b=window.getComputedStyle(m),{m22:x}=new window.DOMMatrixReadOnly(b.transform),S=[];for(const N of t.values()){const C=r.get(N.id);if(!C)continue;if(C.hidden){r.set(C.id,{...C,internals:{...C.internals,handleBounds:void 0}}),v=!0;continue}const $=Uf(N.nodeElement),M=C.measured.width!==$.width||C.measured.height!==$.height;if(!!($.width&&$.height&&(M||!C.internals.handleBounds||N.force))){const H=N.nodeElement.getBoundingClientRect(),j=$s(C.extent)?C.extent:f;let{positionAbsolute:R}=C.internals;C.parentId&&C.extent==="parent"?R=Gm(R,$,r.get(C.parentId)):j&&(R=Li(R,j,$));const q={...C,measured:$,internals:{...C.internals,positionAbsolute:R,handleBounds:{source:wh("source",N.nodeElement,H,x,C.id),target:wh("target",N.nodeElement,H,x,C.id)}}};r.set(C.id,q),C.parentId&&Xf(q,r,i,{nodeOrigin:u,zIndexMode:d}),v=!0,M&&(w.push({id:C.id,type:"dimensions",dimensions:$}),C.expandParent&&C.parentId&&S.push({id:C.id,parentId:C.parentId,rect:As(q,u)}))}}if(S.length>0){const N=Qf(S,r,i,u);w.push(...N)}return{changes:w,updatedInternals:v}}async function F1({delta:t,panZoom:r,transform:i,translateExtent:a,width:u,height:f}){if(!r||!t.x&&!t.y)return Promise.resolve(!1);const d=await r.setViewportConstrained({x:i[0]+t.x,y:i[1]+t.y,zoom:i[2]},[[0,0],[u,f]],a),m=!!d&&(d.x!==i[0]||d.y!==i[1]||d.k!==i[2]);return Promise.resolve(m)}function Ch(t,r,i,a,u,f){let d=u;const m=a.get(d)||new Map;a.set(d,m.set(i,r)),d=`${u}-${t}`;const v=a.get(d)||new Map;if(a.set(d,v.set(i,r)),f){d=`${u}-${t}-${f}`;const w=a.get(d)||new Map;a.set(d,w.set(i,r))}}function dg(t,r,i){t.clear(),r.clear();for(const a of i){const{source:u,target:f,sourceHandle:d=null,targetHandle:m=null}=a,v={edgeId:a.id,source:u,target:f,sourceHandle:d,targetHandle:m},w=`${u}-${d}--${f}-${m}`,b=`${f}-${m}--${u}-${d}`;Ch("source",v,b,t,u,d),Ch("target",v,w,t,f,m),r.set(a.id,a)}}function pg(t,r){if(!t.parentId)return!1;const i=r.get(t.parentId);return i?i.selected?!0:pg(i,r):!1}function Ph(t,r,i){var u;let a=t;do{if((u=a==null?void 0:a.matches)!=null&&u.call(a,r))return!0;if(a===i)return!1;a=a==null?void 0:a.parentElement}while(a);return!1}function B1(t,r,i,a){const u=new Map;for(const[f,d]of t)if((d.selected||d.id===a)&&(!d.parentId||!pg(d,t))&&(d.draggable||r&&typeof d.draggable>"u")){const m=t.get(f);m&&u.set(f,{id:f,position:m.position||{x:0,y:0},distance:{x:i.x-m.internals.positionAbsolute.x,y:i.y-m.internals.positionAbsolute.y},extent:m.extent,parentId:m.parentId,origin:m.origin,expandParent:m.expandParent,internals:{positionAbsolute:m.internals.positionAbsolute||{x:0,y:0}},measured:{width:m.measured.width??0,height:m.measured.height??0}})}return u}function of({nodeId:t,dragItems:r,nodeLookup:i,dragging:a=!0}){var d,m,v;const u=[];for(const[w,b]of r){const x=(d=i.get(w))==null?void 0:d.internals.userNode;x&&u.push({...x,position:b.position,dragging:a})}if(!t)return[u[0],u];const f=(m=i.get(t))==null?void 0:m.internals.userNode;return[f?{...f,position:((v=r.get(t))==null?void 0:v.position)||f.position,dragging:a}:u[0],u]}function H1({dragItems:t,snapGrid:r,x:i,y:a}){const u=t.values().next().value;if(!u)return null;const f={x:i-u.distance.x,y:a-u.distance.y},d=za(f,r);return{x:d.x-f.x,y:d.y-f.y}}function V1({onNodeMouseDown:t,getStoreItems:r,onDragStart:i,onDrag:a,onDragStop:u}){let f={x:null,y:null},d=0,m=new Map,v=!1,w={x:0,y:0},b=null,x=!1,S=null,N=!1,C=!1,$=null;function M({noDragClassName:H,handleSelector:j,domNode:R,isSelectable:q,nodeId:V,nodeClickDistance:U=0}){S=Gn(R);function pe({x:le,y:xe}){const{nodeLookup:z,nodeExtent:ue,snapGrid:te,snapToGrid:ae,nodeOrigin:L,onNodeDrag:F,onSelectionDrag:X,onError:O,updateNodePositions:B}=r();f={x:le,y:xe};let ke=!1;const Se=m.size>1,Ie=Se&&ue?Cf(Da(m)):null,Re=Se&&ae?H1({dragItems:m,snapGrid:te,x:le,y:xe}):null;for(const[Ae,we]of m){if(!z.has(Ae))continue;let ze={x:le-we.distance.x,y:xe-we.distance.y};ae&&(ze=Re?{x:Math.round(ze.x+Re.x),y:Math.round(ze.y+Re.y)}:za(ze,te));let be=null;if(Se&&ue&&!we.extent&&Ie){const{positionAbsolute:Ve}=we.internals,ct=Ve.x-Ie.x+ue[0][0],nt=Ve.x+we.measured.width-Ie.x2+ue[1][0],ft=Ve.y-Ie.y+ue[0][1],kt=Ve.y+we.measured.height-Ie.y2+ue[1][1];be=[[ct,ft],[nt,kt]]}const{position:Je,positionAbsolute:Fe}=Qm({nodeId:Ae,nextPosition:ze,nodeLookup:z,nodeExtent:be||ue,nodeOrigin:L,onError:O});ke=ke||we.position.x!==Je.x||we.position.y!==Je.y,we.position=Je,we.internals.positionAbsolute=Fe}if(C=C||ke,!!ke&&(B(m,!0),$&&(a||F||!V&&X))){const[Ae,we]=of({nodeId:V,dragItems:m,nodeLookup:z});a==null||a($,m,Ae,we),F==null||F($,Ae,we),V||X==null||X($,we)}}async function he(){if(!b)return;const{transform:le,panBy:xe,autoPanSpeed:z,autoPanOnNodeDrag:ue}=r();if(!ue){v=!1,cancelAnimationFrame(d);return}const[te,ae]=Zm(w,b,z);(te!==0||ae!==0)&&(f.x=(f.x??0)-te/le[2],f.y=(f.y??0)-ae/le[2],await xe({x:te,y:ae})&&pe(f)),d=requestAnimationFrame(he)}function _e(le){var Se;const{nodeLookup:xe,multiSelectionActive:z,nodesDraggable:ue,transform:te,snapGrid:ae,snapToGrid:L,selectNodesOnDrag:F,onNodeDragStart:X,onSelectionDragStart:O,unselectNodesAndEdges:B}=r();x=!0,(!F||!q)&&!z&&V&&((Se=xe.get(V))!=null&&Se.selected||B()),q&&F&&V&&(t==null||t(V));const ke=ba(le.sourceEvent,{transform:te,snapGrid:ae,snapToGrid:L,containerBounds:b});if(f=ke,m=B1(xe,ue,ke,V),m.size>0&&(i||X||!V&&O)){const[Ie,Re]=of({nodeId:V,dragItems:m,nodeLookup:xe});i==null||i(le.sourceEvent,m,Ie,Re),X==null||X(le.sourceEvent,Ie,Re),V||O==null||O(le.sourceEvent,Re)}}const Q=jm().clickDistance(U).on("start",le=>{const{domNode:xe,nodeDragThreshold:z,transform:ue,snapGrid:te,snapToGrid:ae}=r();b=(xe==null?void 0:xe.getBoundingClientRect())||null,N=!1,C=!1,$=le.sourceEvent,z===0&&_e(le),f=ba(le.sourceEvent,{transform:ue,snapGrid:te,snapToGrid:ae,containerBounds:b}),w=Ir(le.sourceEvent,b)}).on("drag",le=>{const{autoPanOnNodeDrag:xe,transform:z,snapGrid:ue,snapToGrid:te,nodeDragThreshold:ae,nodeLookup:L}=r(),F=ba(le.sourceEvent,{transform:z,snapGrid:ue,snapToGrid:te,containerBounds:b});if($=le.sourceEvent,(le.sourceEvent.type==="touchmove"&&le.sourceEvent.touches.length>1||V&&!L.has(V))&&(N=!0),!N){if(!v&&xe&&x&&(v=!0,he()),!x){const X=Ir(le.sourceEvent,b),O=X.x-w.x,B=X.y-w.y;Math.sqrt(O*O+B*B)>ae&&_e(le)}(f.x!==F.xSnapped||f.y!==F.ySnapped)&&m&&x&&(w=Ir(le.sourceEvent,b),pe(F))}}).on("end",le=>{if(!(!x||N)&&(v=!1,x=!1,cancelAnimationFrame(d),m.size>0)){const{nodeLookup:xe,updateNodePositions:z,onNodeDragStop:ue,onSelectionDragStop:te}=r();if(C&&(z(m,!1),C=!1),u||ue||!V&&te){const[ae,L]=of({nodeId:V,dragItems:m,nodeLookup:xe,dragging:!1});u==null||u(le.sourceEvent,m,ae,L),ue==null||ue(le.sourceEvent,ae,L),V||te==null||te(le.sourceEvent,L)}}}).filter(le=>{const xe=le.target;return!le.button&&(!H||!Ph(xe,`.${H}`,R))&&(!j||Ph(xe,j,R))});S.call(Q)}function I(){S==null||S.on(".drag",null)}return{update:M,destroy:I}}function K1(t,r,i){const a=[],u={x:t.x-i,y:t.y-i,width:i*2,height:i*2};for(const f of r.values())Ta(u,As(f))>0&&a.push(f);return a}const U1=250;function q1(t,r,i,a){var m,v;let u=[],f=1/0;const d=K1(t,i,r+U1);for(const w of d){const b=[...((m=w.internals.handleBounds)==null?void 0:m.source)??[],...((v=w.internals.handleBounds)==null?void 0:v.target)??[]];for(const x of b){if(a.nodeId===x.nodeId&&a.type===x.type&&a.id===x.id)continue;const{x:S,y:N}=Fi(w,x,x.position,!0),C=Math.sqrt(Math.pow(S-t.x,2)+Math.pow(N-t.y,2));C>r||(C<f?(u=[{...x,x:S,y:N}],f=C):C===f&&u.push({...x,x:S,y:N}))}}if(!u.length)return null;if(u.length>1){const w=a.type==="source"?"target":"source";return u.find(b=>b.type===w)??u[0]}return u[0]}function hg(t,r,i,a,u,f=!1){var w,b,x;const d=a.get(t);if(!d)return null;const m=u==="strict"?(w=d.internals.handleBounds)==null?void 0:w[r]:[...((b=d.internals.handleBounds)==null?void 0:b.source)??[],...((x=d.internals.handleBounds)==null?void 0:x.target)??[]],v=(i?m==null?void 0:m.find(S=>S.id===i):m==null?void 0:m[0])??null;return v&&f?{...v,...Fi(d,v,v.position,!0)}:v}function mg(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function W1(t,r){let i=null;return r?i=!0:t&&!r&&(i=!1),i}const gg=()=>!0;function Y1(t,{connectionMode:r,connectionRadius:i,handleId:a,nodeId:u,edgeUpdaterType:f,isTarget:d,domNode:m,nodeLookup:v,lib:w,autoPanOnConnect:b,flowId:x,panBy:S,cancelConnection:N,onConnectStart:C,onConnect:$,onConnectEnd:M,isValidConnection:I=gg,onReconnectEnd:H,updateConnection:j,getTransform:R,getFromHandle:q,autoPanSpeed:V,dragThreshold:U=1,handleDomNode:pe}){const he=ng(t.target);let _e=0,Q;const{x:le,y:xe}=Ir(t),z=mg(f,pe),ue=m==null?void 0:m.getBoundingClientRect();let te=!1;if(!ue||!z)return;const ae=hg(u,z,a,v,r);if(!ae)return;let L=Ir(t,ue),F=!1,X=null,O=!1,B=null;function ke(){if(!b||!ue)return;const[Je,Fe]=Zm(L,ue,V);S({x:Je,y:Fe}),_e=requestAnimationFrame(ke)}const Se={...ae,nodeId:u,type:z,position:ae.position},Ie=v.get(u);let Ae={inProgress:!0,isValid:null,from:Fi(Ie,Se,Ze.Left,!0),fromHandle:Se,fromPosition:Se.position,fromNode:Ie,to:L,toHandle:null,toPosition:gh[Se.position],toNode:null,pointer:L};function we(){te=!0,j(Ae),C==null||C(t,{nodeId:u,handleId:a,handleType:z})}U===0&&we();function ze(Je){if(!te){const{x:kt,y:rn}=Ir(Je),Gt=kt-le,qt=rn-xe;if(!(Gt*Gt+qt*qt>U*U))return;we()}if(!q()||!Se){be(Je);return}const Fe=R();L=Ir(Je,ue),Q=q1(La(L,Fe,!1,[1,1]),i,v,Se),F||(ke(),F=!0);const Ve=yg(Je,{handle:Q,connectionMode:r,fromNodeId:u,fromHandleId:a,fromType:d?"target":"source",isValidConnection:I,doc:he,lib:w,flowId:x,nodeLookup:v});B=Ve.handleDomNode,X=Ve.connection,O=W1(!!Q,Ve.isValid);const ct=v.get(u),nt=ct?Fi(ct,Se,Ze.Left,!0):Ae.from,ft={...Ae,from:nt,isValid:O,to:Ve.toHandle&&O?gu({x:Ve.toHandle.x,y:Ve.toHandle.y},Fe):L,toHandle:Ve.toHandle,toPosition:O&&Ve.toHandle?Ve.toHandle.position:gh[Se.position],toNode:Ve.toHandle?v.get(Ve.toHandle.nodeId):null,pointer:L};j(ft),Ae=ft}function be(Je){if(!("touches"in Je&&Je.touches.length>0)){if(te){(Q||B)&&X&&O&&($==null||$(X));const{inProgress:Fe,...Ve}=Ae,ct={...Ve,toPosition:Ae.toHandle?Ae.toPosition:null};M==null||M(Je,ct),f&&(H==null||H(Je,ct))}N(),cancelAnimationFrame(_e),F=!1,O=!1,X=null,B=null,he.removeEventListener("mousemove",ze),he.removeEventListener("mouseup",be),he.removeEventListener("touchmove",ze),he.removeEventListener("touchend",be)}}he.addEventListener("mousemove",ze),he.addEventListener("mouseup",be),he.addEventListener("touchmove",ze),he.addEventListener("touchend",be)}function yg(t,{handle:r,connectionMode:i,fromNodeId:a,fromHandleId:u,fromType:f,doc:d,lib:m,flowId:v,isValidConnection:w=gg,nodeLookup:b}){const x=f==="target",S=r?d.querySelector(`.${m}-flow__handle[data-id="${v}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:N,y:C}=Ir(t),$=d.elementFromPoint(N,C),M=$!=null&&$.classList.contains(`${m}-flow__handle`)?$:S,I={handleDomNode:M,isValid:!1,connection:null,toHandle:null};if(M){const H=mg(void 0,M),j=M.getAttribute("data-nodeid"),R=M.getAttribute("data-handleid"),q=M.classList.contains("connectable"),V=M.classList.contains("connectableend");if(!j||!H)return I;const U={source:x?j:a,sourceHandle:x?R:u,target:x?a:j,targetHandle:x?u:R};I.connection=U;const he=q&&V&&(i===Ms.Strict?x&&H==="source"||!x&&H==="target":j!==a||R!==u);I.isValid=he&&w(U),I.toHandle=hg(j,H,R,b,i,!0)}return I}const Mf={onPointerDown:Y1,isValid:yg};function X1({domNode:t,panZoom:r,getTransform:i,getViewScale:a}){const u=Gn(t);function f({translateExtent:m,width:v,height:w,zoomStep:b=1,pannable:x=!0,zoomable:S=!0,inversePan:N=!1}){const C=j=>{if(j.sourceEvent.type!=="wheel"||!r)return;const R=i(),q=j.sourceEvent.ctrlKey&&Ma()?10:1,V=-j.sourceEvent.deltaY*(j.sourceEvent.deltaMode===1?.05:j.sourceEvent.deltaMode?1:.002)*b,U=R[2]*Math.pow(2,V*q);r.scaleTo(U)};let $=[0,0];const M=j=>{(j.sourceEvent.type==="mousedown"||j.sourceEvent.type==="touchstart")&&($=[j.sourceEvent.clientX??j.sourceEvent.touches[0].clientX,j.sourceEvent.clientY??j.sourceEvent.touches[0].clientY])},I=j=>{const R=i();if(j.sourceEvent.type!=="mousemove"&&j.sourceEvent.type!=="touchmove"||!r)return;const q=[j.sourceEvent.clientX??j.sourceEvent.touches[0].clientX,j.sourceEvent.clientY??j.sourceEvent.touches[0].clientY],V=[q[0]-$[0],q[1]-$[1]];$=q;const U=a()*Math.max(R[2],Math.log(R[2]))*(N?-1:1),pe={x:R[0]-V[0]*U,y:R[1]-V[1]*U},he=[[0,0],[v,w]];r.setViewportConstrained({x:pe.x,y:pe.y,zoom:R[2]},he,m)},H=Km().on("start",M).on("zoom",x?I:null).on("zoom.wheel",S?C:null);u.call(H,{})}function d(){u.on("zoom",null)}return{update:f,destroy:d,pointer:jr}}const ju=t=>({x:t.x,y:t.y,zoom:t.k}),sf=({x:t,y:r,zoom:i})=>Nu.translate(t,r).scale(i),Es=(t,r)=>t.target.closest(`.${r}`),vg=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),Q1=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,af=(t,r=0,i=Q1,a=()=>{})=>{const u=typeof r=="number"&&r>0;return u||a(),u?t.transition().duration(r).ease(i).on("end",a):t},xg=t=>{const r=t.ctrlKey&&Ma()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function G1({zoomPanValues:t,noWheelClassName:r,d3Selection:i,d3Zoom:a,panOnScrollMode:u,panOnScrollSpeed:f,zoomOnPinch:d,onPanZoomStart:m,onPanZoom:v,onPanZoomEnd:w}){return b=>{if(Es(b,r))return b.ctrlKey&&b.preventDefault(),!1;b.preventDefault(),b.stopImmediatePropagation();const x=i.property("__zoom").k||1;if(b.ctrlKey&&d){const M=jr(b),I=xg(b),H=x*Math.pow(2,I);a.scaleTo(i,H,M,b);return}const S=b.deltaMode===1?20:1;let N=u===Ri.Vertical?0:b.deltaX*S,C=u===Ri.Horizontal?0:b.deltaY*S;!Ma()&&b.shiftKey&&u!==Ri.Vertical&&(N=b.deltaY*S,C=0),a.translateBy(i,-(N/x)*f,-(C/x)*f,{internal:!0});const $=ju(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(v==null||v(b,$),t.panScrollTimeout=setTimeout(()=>{w==null||w(b,$),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,m==null||m(b,$))}}function Z1({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:i}){return function(a,u){const f=a.type==="wheel",d=!r&&f&&!a.ctrlKey,m=Es(a,t);if(a.ctrlKey&&f&&m&&a.preventDefault(),d||m)return null;a.preventDefault(),i.call(this,a,u)}}function J1({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:i}){return a=>{var f,d,m;if((f=a.sourceEvent)!=null&&f.internal)return;const u=ju(a.transform);t.mouseButton=((d=a.sourceEvent)==null?void 0:d.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=u,((m=a.sourceEvent)==null?void 0:m.type)==="mousedown"&&r(!0),i&&(i==null||i(a.sourceEvent,u))}}function e_({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:i,onTransformChange:a,onPanZoom:u}){return f=>{var d,m;t.usedRightMouseButton=!!(i&&vg(r,t.mouseButton??0)),(d=f.sourceEvent)!=null&&d.sync||a([f.transform.x,f.transform.y,f.transform.k]),u&&!((m=f.sourceEvent)!=null&&m.internal)&&(u==null||u(f.sourceEvent,ju(f.transform)))}}function t_({zoomPanValues:t,panOnDrag:r,panOnScroll:i,onDraggingChange:a,onPanZoomEnd:u,onPaneContextMenu:f}){return d=>{var m;if(!((m=d.sourceEvent)!=null&&m.internal)&&(t.isZoomingOrPanning=!1,f&&vg(r,t.mouseButton??0)&&!t.usedRightMouseButton&&d.sourceEvent&&f(d.sourceEvent),t.usedRightMouseButton=!1,a(!1),u)){const v=ju(d.transform);t.prevViewport=v,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{u==null||u(d.sourceEvent,v)},i?150:0)}}}function n_({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:a,panOnScroll:u,zoomOnDoubleClick:f,userSelectionActive:d,noWheelClassName:m,noPanClassName:v,lib:w,connectionInProgress:b}){return x=>{var M;const S=t||r,N=i&&x.ctrlKey,C=x.type==="wheel";if(x.button===1&&x.type==="mousedown"&&(Es(x,`${w}-flow__node`)||Es(x,`${w}-flow__edge`)))return!0;if(!a&&!S&&!u&&!f&&!i||d||b&&!C||Es(x,m)&&C||Es(x,v)&&(!C||u&&C&&!t)||!i&&x.ctrlKey&&C)return!1;if(!i&&x.type==="touchstart"&&((M=x.touches)==null?void 0:M.length)>1)return x.preventDefault(),!1;if(!S&&!u&&!N&&C||!a&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(a)&&!a.includes(x.button)&&x.type==="mousedown")return!1;const $=Array.isArray(a)&&a.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||C)&&$}}function r_({domNode:t,minZoom:r,maxZoom:i,translateExtent:a,viewport:u,onPanZoom:f,onPanZoomStart:d,onPanZoomEnd:m,onDraggingChange:v}){const w={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},b=t.getBoundingClientRect(),x=Km().scaleExtent([r,i]).translateExtent(a),S=Gn(t).call(x);H({x:u.x,y:u.y,zoom:Is(u.zoom,r,i)},[[0,0],[b.width,b.height]],a);const N=S.on("wheel.zoom"),C=S.on("dblclick.zoom");x.wheelDelta(xg);function $(Q,le){return S?new Promise(xe=>{x==null||x.interpolate((le==null?void 0:le.interpolate)==="linear"?Sa:tu).transform(af(S,le==null?void 0:le.duration,le==null?void 0:le.ease,()=>xe(!0)),Q)}):Promise.resolve(!1)}function M({noWheelClassName:Q,noPanClassName:le,onPaneContextMenu:xe,userSelectionActive:z,panOnScroll:ue,panOnDrag:te,panOnScrollMode:ae,panOnScrollSpeed:L,preventScrolling:F,zoomOnPinch:X,zoomOnScroll:O,zoomOnDoubleClick:B,zoomActivationKeyPressed:ke,lib:Se,onTransformChange:Ie,connectionInProgress:Re,paneClickDistance:Ae,selectionOnDrag:we}){z&&!w.isZoomingOrPanning&&I();const ze=ue&&!ke&&!z;x.clickDistance(we?1/0:!Mr(Ae)||Ae<0?0:Ae);const be=ze?G1({zoomPanValues:w,noWheelClassName:Q,d3Selection:S,d3Zoom:x,panOnScrollMode:ae,panOnScrollSpeed:L,zoomOnPinch:X,onPanZoomStart:d,onPanZoom:f,onPanZoomEnd:m}):Z1({noWheelClassName:Q,preventScrolling:F,d3ZoomHandler:N});if(S.on("wheel.zoom",be,{passive:!1}),!z){const Fe=J1({zoomPanValues:w,onDraggingChange:v,onPanZoomStart:d});x.on("start",Fe);const Ve=e_({zoomPanValues:w,panOnDrag:te,onPaneContextMenu:!!xe,onPanZoom:f,onTransformChange:Ie});x.on("zoom",Ve);const ct=t_({zoomPanValues:w,panOnDrag:te,panOnScroll:ue,onPaneContextMenu:xe,onPanZoomEnd:m,onDraggingChange:v});x.on("end",ct)}const Je=n_({zoomActivationKeyPressed:ke,panOnDrag:te,zoomOnScroll:O,panOnScroll:ue,zoomOnDoubleClick:B,zoomOnPinch:X,userSelectionActive:z,noPanClassName:le,noWheelClassName:Q,lib:Se,connectionInProgress:Re});x.filter(Je),B?S.on("dblclick.zoom",C):S.on("dblclick.zoom",null)}function I(){x.on("zoom",null)}async function H(Q,le,xe){const z=sf(Q),ue=x==null?void 0:x.constrain()(z,le,xe);return ue&&await $(ue),new Promise(te=>te(ue))}async function j(Q,le){const xe=sf(Q);return await $(xe,le),new Promise(z=>z(xe))}function R(Q){if(S){const le=sf(Q),xe=S.property("__zoom");(xe.k!==Q.zoom||xe.x!==Q.x||xe.y!==Q.y)&&(x==null||x.transform(S,le,null,{sync:!0}))}}function q(){const Q=S?Vm(S.node()):{x:0,y:0,k:1};return{x:Q.x,y:Q.y,zoom:Q.k}}function V(Q,le){return S?new Promise(xe=>{x==null||x.interpolate((le==null?void 0:le.interpolate)==="linear"?Sa:tu).scaleTo(af(S,le==null?void 0:le.duration,le==null?void 0:le.ease,()=>xe(!0)),Q)}):Promise.resolve(!1)}function U(Q,le){return S?new Promise(xe=>{x==null||x.interpolate((le==null?void 0:le.interpolate)==="linear"?Sa:tu).scaleBy(af(S,le==null?void 0:le.duration,le==null?void 0:le.ease,()=>xe(!0)),Q)}):Promise.resolve(!1)}function pe(Q){x==null||x.scaleExtent(Q)}function he(Q){x==null||x.translateExtent(Q)}function _e(Q){const le=!Mr(Q)||Q<0?0:Q;x==null||x.clickDistance(le)}return{update:M,destroy:I,setViewport:j,setViewportConstrained:H,getViewport:q,scaleTo:V,scaleBy:U,setScaleExtent:pe,setTranslateExtent:he,syncViewport:R,setClickDistance:_e}}var Os;(function(t){t.Line="line",t.Handle="handle"})(Os||(Os={}));function o_({width:t,prevWidth:r,height:i,prevHeight:a,affectsX:u,affectsY:f}){const d=t-r,m=i-a,v=[d>0?1:d<0?-1:0,m>0?1:m<0?-1:0];return d&&u&&(v[0]=v[0]*-1),m&&f&&(v[1]=v[1]*-1),v}function jh(t){const r=t.includes("right")||t.includes("left"),i=t.includes("bottom")||t.includes("top"),a=t.includes("left"),u=t.includes("top");return{isHorizontal:r,isVertical:i,affectsX:a,affectsY:u}}function ii(t,r){return Math.max(0,r-t)}function si(t,r){return Math.max(0,t-r)}function Ql(t,r,i){return Math.max(0,r-t,t-i)}function Th(t,r){return t?!r:r}function i_(t,r,i,a,u,f,d,m){let{affectsX:v,affectsY:w}=r;const{isHorizontal:b,isVertical:x}=r,S=b&&x,{xSnapped:N,ySnapped:C}=i,{minWidth:$,maxWidth:M,minHeight:I,maxHeight:H}=a,{x:j,y:R,width:q,height:V,aspectRatio:U}=t;let pe=Math.floor(b?N-t.pointerX:0),he=Math.floor(x?C-t.pointerY:0);const _e=q+(v?-pe:pe),Q=V+(w?-he:he),le=-f[0]*q,xe=-f[1]*V;let z=Ql(_e,$,M),ue=Ql(Q,I,H);if(d){let L=0,F=0;v&&pe<0?L=ii(j+pe+le,d[0][0]):!v&&pe>0&&(L=si(j+_e+le,d[1][0])),w&&he<0?F=ii(R+he+xe,d[0][1]):!w&&he>0&&(F=si(R+Q+xe,d[1][1])),z=Math.max(z,L),ue=Math.max(ue,F)}if(m){let L=0,F=0;v&&pe>0?L=si(j+pe,m[0][0]):!v&&pe<0&&(L=ii(j+_e,m[1][0])),w&&he>0?F=si(R+he,m[0][1]):!w&&he<0&&(F=ii(R+Q,m[1][1])),z=Math.max(z,L),ue=Math.max(ue,F)}if(u){if(b){const L=Ql(_e/U,I,H)*U;if(z=Math.max(z,L),d){let F=0;!v&&!w||v&&!w&&S?F=si(R+xe+_e/U,d[1][1])*U:F=ii(R+xe+(v?pe:-pe)/U,d[0][1])*U,z=Math.max(z,F)}if(m){let F=0;!v&&!w||v&&!w&&S?F=ii(R+_e/U,m[1][1])*U:F=si(R+(v?pe:-pe)/U,m[0][1])*U,z=Math.max(z,F)}}if(x){const L=Ql(Q*U,$,M)/U;if(ue=Math.max(ue,L),d){let F=0;!v&&!w||w&&!v&&S?F=si(j+Q*U+le,d[1][0])/U:F=ii(j+(w?he:-he)*U+le,d[0][0])/U,ue=Math.max(ue,F)}if(m){let F=0;!v&&!w||w&&!v&&S?F=ii(j+Q*U,m[1][0])/U:F=si(j+(w?he:-he)*U,m[0][0])/U,ue=Math.max(ue,F)}}}he=he+(he<0?ue:-ue),pe=pe+(pe<0?z:-z),u&&(S?_e>Q*U?he=(Th(v,w)?-pe:pe)/U:pe=(Th(v,w)?-he:he)*U:b?(he=pe/U,w=v):(pe=he*U,v=w));const te=v?j+pe:j,ae=w?R+he:R;return{width:q+(v?-pe:pe),height:V+(w?-he:he),x:f[0]*pe*(v?-1:1)+te,y:f[1]*he*(w?-1:1)+ae}}const wg={width:0,height:0,x:0,y:0},s_={...wg,pointerX:0,pointerY:0,aspectRatio:1};function a_(t){return[[0,0],[t.measured.width,t.measured.height]]}function l_(t,r,i){const a=r.position.x+t.position.x,u=r.position.y+t.position.y,f=t.measured.width??0,d=t.measured.height??0,m=i[0]*f,v=i[1]*d;return[[a-m,u-v],[a+f-m,u+d-v]]}function u_({domNode:t,nodeId:r,getStoreItems:i,onChange:a,onEnd:u}){const f=Gn(t);let d={controlDirection:jh("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function m({controlPosition:w,boundaries:b,keepAspectRatio:x,resizeDirection:S,onResizeStart:N,onResize:C,onResizeEnd:$,shouldResize:M}){let I={...wg},H={...s_};d={boundaries:b,resizeDirection:S,keepAspectRatio:x,controlDirection:jh(w)};let j,R=null,q=[],V,U,pe,he=!1;const _e=jm().on("start",Q=>{const{nodeLookup:le,transform:xe,snapGrid:z,snapToGrid:ue,nodeOrigin:te,paneDomNode:ae}=i();if(j=le.get(r),!j)return;R=(ae==null?void 0:ae.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:F}=ba(Q.sourceEvent,{transform:xe,snapGrid:z,snapToGrid:ue,containerBounds:R});I={width:j.measured.width??0,height:j.measured.height??0,x:j.position.x??0,y:j.position.y??0},H={...I,pointerX:L,pointerY:F,aspectRatio:I.width/I.height},V=void 0,j.parentId&&(j.extent==="parent"||j.expandParent)&&(V=le.get(j.parentId),U=V&&j.extent==="parent"?a_(V):void 0),q=[],pe=void 0;for(const[X,O]of le)if(O.parentId===r&&(q.push({id:X,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const B=l_(O,j,O.origin??te);pe?pe=[[Math.min(B[0][0],pe[0][0]),Math.min(B[0][1],pe[0][1])],[Math.max(B[1][0],pe[1][0]),Math.max(B[1][1],pe[1][1])]]:pe=B}N==null||N(Q,{...I})}).on("drag",Q=>{const{transform:le,snapGrid:xe,snapToGrid:z,nodeOrigin:ue}=i(),te=ba(Q.sourceEvent,{transform:le,snapGrid:xe,snapToGrid:z,containerBounds:R}),ae=[];if(!j)return;const{x:L,y:F,width:X,height:O}=I,B={},ke=j.origin??ue,{width:Se,height:Ie,x:Re,y:Ae}=i_(H,d.controlDirection,te,d.boundaries,d.keepAspectRatio,ke,U,pe),we=Se!==X,ze=Ie!==O,be=Re!==L&&we,Je=Ae!==F&&ze;if(!be&&!Je&&!we&&!ze)return;if((be||Je||ke[0]===1||ke[1]===1)&&(B.x=be?Re:I.x,B.y=Je?Ae:I.y,I.x=B.x,I.y=B.y,q.length>0)){const nt=Re-L,ft=Ae-F;for(const kt of q)kt.position={x:kt.position.x-nt+ke[0]*(Se-X),y:kt.position.y-ft+ke[1]*(Ie-O)},ae.push(kt)}if((we||ze)&&(B.width=we&&(!d.resizeDirection||d.resizeDirection==="horizontal")?Se:I.width,B.height=ze&&(!d.resizeDirection||d.resizeDirection==="vertical")?Ie:I.height,I.width=B.width,I.height=B.height),V&&j.expandParent){const nt=ke[0]*(B.width??0);B.x&&B.x<nt&&(I.x=nt,H.x=H.x-(B.x-nt));const ft=ke[1]*(B.height??0);B.y&&B.y<ft&&(I.y=ft,H.y=H.y-(B.y-ft))}const Fe=o_({width:I.width,prevWidth:X,height:I.height,prevHeight:O,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),Ve={...I,direction:Fe};(M==null?void 0:M(Q,Ve))!==!1&&(he=!0,C==null||C(Q,Ve),a(B,ae))}).on("end",Q=>{he&&($==null||$(Q,{...I}),u==null||u({...I}),he=!1)});f.call(_e)}function v(){f.on(".drag",null)}return{update:m,destroy:v}}var lf={exports:{}},uf={},cf={exports:{}},ff={};/**
|
|
181
|
+
* @license React
|
|
182
|
+
* use-sync-external-store-shim.production.js
|
|
183
|
+
*
|
|
184
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the MIT license found in the
|
|
187
|
+
* LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/var Mh;function c_(){if(Mh)return ff;Mh=1;var t=Aa();function r(x,S){return x===S&&(x!==0||1/x===1/S)||x!==x&&S!==S}var i=typeof Object.is=="function"?Object.is:r,a=t.useState,u=t.useEffect,f=t.useLayoutEffect,d=t.useDebugValue;function m(x,S){var N=S(),C=a({inst:{value:N,getSnapshot:S}}),$=C[0].inst,M=C[1];return f(function(){$.value=N,$.getSnapshot=S,v($)&&M({inst:$})},[x,N,S]),u(function(){return v($)&&M({inst:$}),x(function(){v($)&&M({inst:$})})},[x]),d(N),N}function v(x){var S=x.getSnapshot;x=x.value;try{var N=S();return!i(x,N)}catch{return!0}}function w(x,S){return S()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?w:m;return ff.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:b,ff}var Ih;function f_(){return Ih||(Ih=1,cf.exports=c_()),cf.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 Ah;function d_(){if(Ah)return uf;Ah=1;var t=Aa(),r=f_();function i(w,b){return w===b&&(w!==0||1/w===1/b)||w!==w&&b!==b}var a=typeof Object.is=="function"?Object.is:i,u=r.useSyncExternalStore,f=t.useRef,d=t.useEffect,m=t.useMemo,v=t.useDebugValue;return uf.useSyncExternalStoreWithSelector=function(w,b,x,S,N){var C=f(null);if(C.current===null){var $={hasValue:!1,value:null};C.current=$}else $=C.current;C=m(function(){function I(V){if(!H){if(H=!0,j=V,V=S(V),N!==void 0&&$.hasValue){var U=$.value;if(N(U,V))return R=U}return R=V}if(U=R,a(j,V))return U;var pe=S(V);return N!==void 0&&N(U,pe)?(j=V,U):(j=V,R=pe)}var H=!1,j,R,q=x===void 0?null:x;return[function(){return I(b())},q===null?void 0:function(){return I(q())}]},[b,x,S,N]);var M=u(w,C[0],C[1]);return d(function(){$.hasValue=!0,$.value=M},[M]),v(M),M},uf}var $h;function p_(){return $h||($h=1,lf.exports=d_()),lf.exports}var h_=p_();const m_=vu(h_),g_={},Oh=t=>{let r;const i=new Set,a=(b,x)=>{const S=typeof b=="function"?b(r):b;if(!Object.is(S,r)){const N=r;r=x??(typeof S!="object"||S===null)?S:Object.assign({},r,S),i.forEach(C=>C(r,N))}},u=()=>r,v={setState:a,getState:u,getInitialState:()=>w,subscribe:b=>(i.add(b),()=>i.delete(b)),destroy:()=>{(g_?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),i.clear()}},w=r=t(a,u,v);return v},y_=t=>t?Oh(t):Oh,{useDebugValue:v_}=lm,{useSyncExternalStoreWithSelector:x_}=m_,w_=t=>t;function _g(t,r=w_,i){const a=x_(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,i);return v_(a),a}const Rh=(t,r)=>{const i=y_(t),a=(u,f=r)=>_g(i,u,f);return Object.assign(a,i),a},__=(t,r)=>t?Rh(t,r):Rh;function Ot(t,r){if(Object.is(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(const[a,u]of t)if(!Object.is(u,r.get(a)))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(const a of t)if(!r.has(a))return!1;return!0}const i=Object.keys(t);if(i.length!==Object.keys(r).length)return!1;for(const a of i)if(!Object.prototype.hasOwnProperty.call(r,a)||!Object.is(t[a],r[a]))return!1;return!0}um();const Tu=ce.createContext(null),S_=Tu.Provider,Sg=Gr.error001();function gt(t,r){const i=ce.useContext(Tu);if(i===null)throw new Error(Sg);return _g(i,t,r)}function It(){const t=ce.useContext(Tu);if(t===null)throw new Error(Sg);return ce.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Dh={display:"none"},b_={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},bg="react-flow__node-desc",kg="react-flow__edge-desc",k_="react-flow__aria-live",E_=t=>t.ariaLiveMessage,N_=t=>t.ariaLabelConfig;function C_({rfId:t}){const r=gt(E_);return P.jsx("div",{id:`${k_}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:b_,children:r})}function P_({rfId:t,disableKeyboardA11y:r}){const i=gt(N_);return P.jsxs(P.Fragment,{children:[P.jsx("div",{id:`${bg}-${t}`,style:Dh,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),P.jsx("div",{id:`${kg}-${t}`,style:Dh,children:i["edge.a11yDescription.default"]}),!r&&P.jsx(C_,{rfId:t})]})}const Fa=ce.forwardRef(({position:t="top-left",children:r,className:i,style:a,...u},f)=>{const d=`${t}`.split("-");return P.jsx("div",{className:Ut(["react-flow__panel",i,...d]),style:a,ref:f,...u,children:r})});Fa.displayName="Panel";function j_({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:P.jsx(Fa,{position:r,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:P.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const T_=t=>{const r=[],i=[];for(const[,a]of t.nodeLookup)a.selected&&r.push(a.internals.userNode);for(const[,a]of t.edgeLookup)a.selected&&i.push(a);return{selectedNodes:r,selectedEdges:i}},Gl=t=>t.id;function M_(t,r){return Ot(t.selectedNodes.map(Gl),r.selectedNodes.map(Gl))&&Ot(t.selectedEdges.map(Gl),r.selectedEdges.map(Gl))}function I_({onSelectionChange:t}){const r=It(),{selectedNodes:i,selectedEdges:a}=gt(T_,M_);return ce.useEffect(()=>{const u={nodes:i,edges:a};t==null||t(u),r.getState().onSelectionChangeHandlers.forEach(f=>f(u))},[i,a,t]),null}const A_=t=>!!t.onSelectionChangeHandlers;function $_({onSelectionChange:t}){const r=gt(A_);return t||r?P.jsx(I_,{onSelectionChange:t}):null}const If=typeof window<"u"?ce.useLayoutEffect:ce.useEffect,Eg=[0,0],O_={x:0,y:0,zoom:1},R_=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],zh=[...R_,"rfId"],D_=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}),Lh={translateExtent:Pa,nodeOrigin:Eg,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function z_(t){const{setNodes:r,setEdges:i,setMinZoom:a,setMaxZoom:u,setTranslateExtent:f,setNodeExtent:d,reset:m,setDefaultNodesAndEdges:v}=gt(D_,Ot),w=It();If(()=>(v(t.defaultNodes,t.defaultEdges),()=>{b.current=Lh,m()}),[]);const b=ce.useRef(Lh);return If(()=>{for(const x of zh){const S=t[x],N=b.current[x];S!==N&&(typeof t[x]>"u"||(x==="nodes"?r(S):x==="edges"?i(S):x==="minZoom"?a(S):x==="maxZoom"?u(S):x==="translateExtent"?f(S):x==="nodeExtent"?d(S):x==="ariaLabelConfig"?w.setState({ariaLabelConfig:S1(S)}):x==="fitView"?w.setState({fitViewQueued:S}):x==="fitViewOptions"?w.setState({fitViewOptions:S}):w.setState({[x]:S})))}b.current=t},zh.map(x=>t[x])),null}function Fh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function L_(t){var a;const[r,i]=ce.useState(t==="system"?null:t);return ce.useEffect(()=>{if(t!=="system"){i(t);return}const u=Fh(),f=()=>i(u!=null&&u.matches?"dark":"light");return f(),u==null||u.addEventListener("change",f),()=>{u==null||u.removeEventListener("change",f)}},[t]),r!==null?r:(a=Fh())!=null&&a.matches?"dark":"light"}const Bh=typeof document<"u"?document:null;function Ia(t=null,r={target:Bh,actInsideInputWithModifier:!0}){const[i,a]=ce.useState(!1),u=ce.useRef(!1),f=ce.useRef(new Set([])),[d,m]=ce.useMemo(()=>{if(t!==null){const w=(Array.isArray(t)?t:[t]).filter(x=>typeof x=="string").map(x=>x.replace("+",`
|
|
197
|
+
`).replace(`
|
|
198
|
+
|
|
199
|
+
`,`
|
|
200
|
+
+`).split(`
|
|
201
|
+
`)),b=w.reduce((x,S)=>x.concat(...S),[]);return[w,b]}return[[],[]]},[t]);return ce.useEffect(()=>{const v=(r==null?void 0:r.target)??Bh,w=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const b=N=>{var M,I;if(u.current=N.ctrlKey||N.metaKey||N.shiftKey||N.altKey,(!u.current||u.current&&!w)&&rg(N))return!1;const $=Vh(N.code,m);if(f.current.add(N[$]),Hh(d,f.current,!1)){const H=((I=(M=N.composedPath)==null?void 0:M.call(N))==null?void 0:I[0])||N.target,j=(H==null?void 0:H.nodeName)==="BUTTON"||(H==null?void 0:H.nodeName)==="A";r.preventDefault!==!1&&(u.current||!j)&&N.preventDefault(),a(!0)}},x=N=>{const C=Vh(N.code,m);Hh(d,f.current,!0)?(a(!1),f.current.clear()):f.current.delete(N[C]),N.key==="Meta"&&f.current.clear(),u.current=!1},S=()=>{f.current.clear(),a(!1)};return v==null||v.addEventListener("keydown",b),v==null||v.addEventListener("keyup",x),window.addEventListener("blur",S),window.addEventListener("contextmenu",S),()=>{v==null||v.removeEventListener("keydown",b),v==null||v.removeEventListener("keyup",x),window.removeEventListener("blur",S),window.removeEventListener("contextmenu",S)}}},[t,a]),i}function Hh(t,r,i){return t.filter(a=>i||a.length===r.size).some(a=>a.every(u=>r.has(u)))}function Vh(t,r){return r.includes(t)?"code":"key"}const F_=()=>{const t=It();return ce.useMemo(()=>({zoomIn:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1.2,r):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1/1.2,r):Promise.resolve(!1)},zoomTo:(r,i)=>{const{panZoom:a}=t.getState();return a?a.scaleTo(r,i):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(r,i)=>{const{transform:[a,u,f],panZoom:d}=t.getState();return d?(await d.setViewport({x:r.x??a,y:r.y??u,zoom:r.zoom??f},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,i,a]=t.getState().transform;return{x:r,y:i,zoom:a}},setCenter:async(r,i,a)=>t.getState().setCenter(r,i,a),fitBounds:async(r,i)=>{const{width:a,height:u,minZoom:f,maxZoom:d,panZoom:m}=t.getState(),v=Kf(r,a,u,f,d,(i==null?void 0:i.padding)??.1);return m?(await m.setViewport(v,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,i={})=>{const{transform:a,snapGrid:u,snapToGrid:f,domNode:d}=t.getState();if(!d)return r;const{x:m,y:v}=d.getBoundingClientRect(),w={x:r.x-m,y:r.y-v},b=i.snapGrid??u,x=i.snapToGrid??f;return La(w,a,x,b)},flowToScreenPosition:r=>{const{transform:i,domNode:a}=t.getState();if(!a)return r;const{x:u,y:f}=a.getBoundingClientRect(),d=gu(r,i);return{x:d.x+u,y:d.y+f}}}),[])};function Ng(t,r){const i=[],a=new Map,u=[];for(const f of t)if(f.type==="add"){u.push(f);continue}else if(f.type==="remove"||f.type==="replace")a.set(f.id,[f]);else{const d=a.get(f.id);d?d.push(f):a.set(f.id,[f])}for(const f of r){const d=a.get(f.id);if(!d){i.push(f);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){i.push({...d[0].item});continue}const m={...f};for(const v of d)B_(v,m);i.push(m)}return u.length&&u.forEach(f=>{f.index!==void 0?i.splice(f.index,0,{...f.item}):i.push({...f.item})}),i}function B_(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 Cg(t,r){return Ng(t,r)}function Pg(t,r){return Ng(t,r)}function Ai(t,r){return{id:t,type:"select",selected:r}}function Ns(t,r=new Set,i=!1){const a=[];for(const[u,f]of t){const d=r.has(u);!(f.selected===void 0&&!d)&&f.selected!==d&&(i&&(f.selected=d),a.push(Ai(f.id,d)))}return a}function Kh({items:t=[],lookup:r}){var u;const i=[],a=new Map(t.map(f=>[f.id,f]));for(const[f,d]of t.entries()){const m=r.get(d.id),v=((u=m==null?void 0:m.internals)==null?void 0:u.userNode)??m;v!==void 0&&v!==d&&i.push({id:d.id,item:d,type:"replace"}),v===void 0&&i.push({item:d,type:"add",index:f})}for(const[f]of r)a.get(f)===void 0&&i.push({id:f,type:"remove"});return i}function Uh(t){return{id:t.id,type:"remove"}}const qh=t=>d1(t),H_=t=>Xm(t);function jg(t){return ce.forwardRef(t)}function Wh(t){const[r,i]=ce.useState(BigInt(0)),[a]=ce.useState(()=>V_(()=>i(u=>u+BigInt(1))));return If(()=>{const u=a.get();u.length&&(t(u),a.reset())},[r]),a}function V_(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),t()}}}const Tg=ce.createContext(null);function K_({children:t}){const r=It(),i=ce.useCallback(m=>{const{nodes:v=[],setNodes:w,hasDefaultNodes:b,onNodesChange:x,nodeLookup:S,fitViewQueued:N,onNodesChangeMiddlewareMap:C}=r.getState();let $=v;for(const I of m)$=typeof I=="function"?I($):I;let M=Kh({items:$,lookup:S});for(const I of C.values())M=I(M);b&&w($),M.length>0?x==null||x(M):N&&window.requestAnimationFrame(()=>{const{fitViewQueued:I,nodes:H,setNodes:j}=r.getState();I&&j(H)})},[]),a=Wh(i),u=ce.useCallback(m=>{const{edges:v=[],setEdges:w,hasDefaultEdges:b,onEdgesChange:x,edgeLookup:S}=r.getState();let N=v;for(const C of m)N=typeof C=="function"?C(N):C;b?w(N):x&&x(Kh({items:N,lookup:S}))},[]),f=Wh(u),d=ce.useMemo(()=>({nodeQueue:a,edgeQueue:f}),[]);return P.jsx(Tg.Provider,{value:d,children:t})}function U_(){const t=ce.useContext(Tg);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const q_=t=>!!t.panZoom;function Gf(){const t=F_(),r=It(),i=U_(),a=gt(q_),u=ce.useMemo(()=>{const f=x=>r.getState().nodeLookup.get(x),d=x=>{i.nodeQueue.push(x)},m=x=>{i.edgeQueue.push(x)},v=x=>{var I,H;const{nodeLookup:S,nodeOrigin:N}=r.getState(),C=qh(x)?x:S.get(x.id),$=C.parentId?tg(C.position,C.measured,C.parentId,S,N):C.position,M={...C,position:$,width:((I=C.measured)==null?void 0:I.width)??C.width,height:((H=C.measured)==null?void 0:H.height)??C.height};return As(M)},w=(x,S,N={replace:!1})=>{d(C=>C.map($=>{if($.id===x){const M=typeof S=="function"?S($):S;return N.replace&&qh(M)?M:{...$,...M}}return $}))},b=(x,S,N={replace:!1})=>{m(C=>C.map($=>{if($.id===x){const M=typeof S=="function"?S($):S;return N.replace&&H_(M)?M:{...$,...M}}return $}))};return{getNodes:()=>r.getState().nodes.map(x=>({...x})),getNode:x=>{var S;return(S=f(x))==null?void 0:S.internals.userNode},getInternalNode:f,getEdges:()=>{const{edges:x=[]}=r.getState();return x.map(S=>({...S}))},getEdge:x=>r.getState().edgeLookup.get(x),setNodes:d,setEdges:m,addNodes:x=>{const S=Array.isArray(x)?x:[x];i.nodeQueue.push(N=>[...N,...S])},addEdges:x=>{const S=Array.isArray(x)?x:[x];i.edgeQueue.push(N=>[...N,...S])},toObject:()=>{const{nodes:x=[],edges:S=[],transform:N}=r.getState(),[C,$,M]=N;return{nodes:x.map(I=>({...I})),edges:S.map(I=>({...I})),viewport:{x:C,y:$,zoom:M}}},deleteElements:async({nodes:x=[],edges:S=[]})=>{const{nodes:N,edges:C,onNodesDelete:$,onEdgesDelete:M,triggerNodeChanges:I,triggerEdgeChanges:H,onDelete:j,onBeforeDelete:R}=r.getState(),{nodes:q,edges:V}=await y1({nodesToRemove:x,edgesToRemove:S,nodes:N,edges:C,onBeforeDelete:R}),U=V.length>0,pe=q.length>0;if(U){const he=V.map(Uh);M==null||M(V),H(he)}if(pe){const he=q.map(Uh);$==null||$(q),I(he)}return(pe||U)&&(j==null||j({nodes:q,edges:V})),{deletedNodes:q,deletedEdges:V}},getIntersectingNodes:(x,S=!0,N)=>{const C=vh(x),$=C?x:v(x),M=N!==void 0;return $?(N||r.getState().nodes).filter(I=>{const H=r.getState().nodeLookup.get(I.id);if(H&&!C&&(I.id===x.id||!H.internals.positionAbsolute))return!1;const j=As(M?I:H),R=Ta(j,$);return S&&R>0||R>=j.width*j.height||R>=$.width*$.height}):[]},isNodeIntersecting:(x,S,N=!0)=>{const $=vh(x)?x:v(x);if(!$)return!1;const M=Ta($,S);return N&&M>0||M>=S.width*S.height||M>=$.width*$.height},updateNode:w,updateNodeData:(x,S,N={replace:!1})=>{w(x,C=>{const $=typeof S=="function"?S(C):S;return N.replace?{...C,data:$}:{...C,data:{...C.data,...$}}},N)},updateEdge:b,updateEdgeData:(x,S,N={replace:!1})=>{b(x,C=>{const $=typeof S=="function"?S(C):S;return N.replace?{...C,data:$}:{...C,data:{...C.data,...$}}},N)},getNodesBounds:x=>{const{nodeLookup:S,nodeOrigin:N}=r.getState();return p1(x,{nodeLookup:S,nodeOrigin:N})},getHandleConnections:({type:x,id:S,nodeId:N})=>{var C;return Array.from(((C=r.getState().connectionLookup.get(`${N}-${x}${S?`-${S}`:""}`))==null?void 0:C.values())??[])},getNodeConnections:({type:x,handleId:S,nodeId:N})=>{var C;return Array.from(((C=r.getState().connectionLookup.get(`${N}${x?S?`-${x}-${S}`:`-${x}`:""}`))==null?void 0:C.values())??[])},fitView:async x=>{const S=r.getState().fitViewResolver??_1();return r.setState({fitViewQueued:!0,fitViewOptions:x,fitViewResolver:S}),i.nodeQueue.push(N=>[...N]),S.promise}}},[]);return ce.useMemo(()=>({...u,...t,viewportInitialized:a}),[a])}const Yh=t=>t.selected,W_=typeof window<"u"?window:void 0;function Y_({deleteKeyCode:t,multiSelectionKeyCode:r}){const i=It(),{deleteElements:a}=Gf(),u=Ia(t,{actInsideInputWithModifier:!1}),f=Ia(r,{target:W_});ce.useEffect(()=>{if(u){const{edges:d,nodes:m}=i.getState();a({nodes:m.filter(Yh),edges:d.filter(Yh)}),i.setState({nodesSelectionActive:!1})}},[u]),ce.useEffect(()=>{i.setState({multiSelectionActive:f})},[f])}function X_(t){const r=It();ce.useEffect(()=>{const i=()=>{var u,f,d,m;if(!t.current||!(((f=(u=t.current).checkVisibility)==null?void 0:f.call(u))??!0))return!1;const a=Uf(t.current);(a.height===0||a.width===0)&&((m=(d=r.getState()).onError)==null||m.call(d,"004",Gr.error004())),r.setState({width:a.width||500,height:a.height||500})};if(t.current){i(),window.addEventListener("resize",i);const a=new ResizeObserver(()=>i());return a.observe(t.current),()=>{window.removeEventListener("resize",i),a&&t.current&&a.unobserve(t.current)}}},[])}const Mu={position:"absolute",width:"100%",height:"100%",top:0,left:0},Q_=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function G_({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:u=.5,panOnScrollMode:f=Ri.Free,zoomOnDoubleClick:d=!0,panOnDrag:m=!0,defaultViewport:v,translateExtent:w,minZoom:b,maxZoom:x,zoomActivationKeyCode:S,preventScrolling:N=!0,children:C,noWheelClassName:$,noPanClassName:M,onViewportChange:I,isControlledViewport:H,paneClickDistance:j,selectionOnDrag:R}){const q=It(),V=ce.useRef(null),{userSelectionActive:U,lib:pe,connectionInProgress:he}=gt(Q_,Ot),_e=Ia(S),Q=ce.useRef();X_(V);const le=ce.useCallback(xe=>{I==null||I({x:xe[0],y:xe[1],zoom:xe[2]}),H||q.setState({transform:xe})},[I,H]);return ce.useEffect(()=>{if(V.current){Q.current=r_({domNode:V.current,minZoom:b,maxZoom:x,translateExtent:w,viewport:v,onDraggingChange:te=>q.setState(ae=>ae.paneDragging===te?ae:{paneDragging:te}),onPanZoomStart:(te,ae)=>{const{onViewportChangeStart:L,onMoveStart:F}=q.getState();F==null||F(te,ae),L==null||L(ae)},onPanZoom:(te,ae)=>{const{onViewportChange:L,onMove:F}=q.getState();F==null||F(te,ae),L==null||L(ae)},onPanZoomEnd:(te,ae)=>{const{onViewportChangeEnd:L,onMoveEnd:F}=q.getState();F==null||F(te,ae),L==null||L(ae)}});const{x:xe,y:z,zoom:ue}=Q.current.getViewport();return q.setState({panZoom:Q.current,transform:[xe,z,ue],domNode:V.current.closest(".react-flow")}),()=>{var te;(te=Q.current)==null||te.destroy()}}},[]),ce.useEffect(()=>{var xe;(xe=Q.current)==null||xe.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:a,panOnScrollSpeed:u,panOnScrollMode:f,zoomOnDoubleClick:d,panOnDrag:m,zoomActivationKeyPressed:_e,preventScrolling:N,noPanClassName:M,userSelectionActive:U,noWheelClassName:$,lib:pe,onTransformChange:le,connectionInProgress:he,selectionOnDrag:R,paneClickDistance:j})},[t,r,i,a,u,f,d,m,_e,N,M,U,$,pe,le,he,R,j]),P.jsx("div",{className:"react-flow__renderer",ref:V,style:Mu,children:C})}const Z_=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function J_(){const{userSelectionActive:t,userSelectionRect:r}=gt(Z_,Ot);return t&&r?P.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}const df=(t,r)=>i=>{i.target===r.current&&(t==null||t(i))},eS=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function tS({isSelecting:t,selectionKeyPressed:r,selectionMode:i=ja.Full,panOnDrag:a,paneClickDistance:u,selectionOnDrag:f,onSelectionStart:d,onSelectionEnd:m,onPaneClick:v,onPaneContextMenu:w,onPaneScroll:b,onPaneMouseEnter:x,onPaneMouseMove:S,onPaneMouseLeave:N,children:C}){const $=It(),{userSelectionActive:M,elementsSelectable:I,dragging:H,connectionInProgress:j}=gt(eS,Ot),R=I&&(t||M),q=ce.useRef(null),V=ce.useRef(),U=ce.useRef(new Set),pe=ce.useRef(new Set),he=ce.useRef(!1),_e=L=>{if(he.current||j){he.current=!1;return}v==null||v(L),$.getState().resetSelectedElements(),$.setState({nodesSelectionActive:!1})},Q=L=>{if(Array.isArray(a)&&(a!=null&&a.includes(2))){L.preventDefault();return}w==null||w(L)},le=b?L=>b(L):void 0,xe=L=>{he.current&&(L.stopPropagation(),he.current=!1)},z=L=>{var Ie,Re;const{domNode:F}=$.getState();if(V.current=F==null?void 0:F.getBoundingClientRect(),!V.current)return;const X=L.target===q.current;if(!X&&!!L.target.closest(".nokey")||!t||!(f&&X||r)||L.button!==0||!L.isPrimary)return;(Re=(Ie=L.target)==null?void 0:Ie.setPointerCapture)==null||Re.call(Ie,L.pointerId),he.current=!1;const{x:ke,y:Se}=Ir(L.nativeEvent,V.current);$.setState({userSelectionRect:{width:0,height:0,startX:ke,startY:Se,x:ke,y:Se}}),X||(L.stopPropagation(),L.preventDefault())},ue=L=>{const{userSelectionRect:F,transform:X,nodeLookup:O,edgeLookup:B,connectionLookup:ke,triggerNodeChanges:Se,triggerEdgeChanges:Ie,defaultEdgeOptions:Re,resetSelectedElements:Ae}=$.getState();if(!V.current||!F)return;const{x:we,y:ze}=Ir(L.nativeEvent,V.current),{startX:be,startY:Je}=F;if(!he.current){const ft=r?0:u;if(Math.hypot(we-be,ze-Je)<=ft)return;Ae(),d==null||d(L)}he.current=!0;const Fe={startX:be,startY:Je,x:we<be?we:be,y:ze<Je?ze:Je,width:Math.abs(we-be),height:Math.abs(ze-Je)},Ve=U.current,ct=pe.current;U.current=new Set(Vf(O,Fe,X,i===ja.Partial,!0).map(ft=>ft.id)),pe.current=new Set;const nt=(Re==null?void 0:Re.selectable)??!0;for(const ft of U.current){const kt=ke.get(ft);if(kt)for(const{edgeId:rn}of kt.values()){const Gt=B.get(rn);Gt&&(Gt.selectable??nt)&&pe.current.add(rn)}}if(!xh(Ve,U.current)){const ft=Ns(O,U.current,!0);Se(ft)}if(!xh(ct,pe.current)){const ft=Ns(B,pe.current);Ie(ft)}$.setState({userSelectionRect:Fe,userSelectionActive:!0,nodesSelectionActive:!1})},te=L=>{var F,X;L.button===0&&((X=(F=L.target)==null?void 0:F.releasePointerCapture)==null||X.call(F,L.pointerId),!M&&L.target===q.current&&$.getState().userSelectionRect&&(_e==null||_e(L)),$.setState({userSelectionActive:!1,userSelectionRect:null}),he.current&&(m==null||m(L),$.setState({nodesSelectionActive:U.current.size>0})))},ae=a===!0||Array.isArray(a)&&a.includes(0);return P.jsxs("div",{className:Ut(["react-flow__pane",{draggable:ae,dragging:H,selection:t}]),onClick:R?void 0:df(_e,q),onContextMenu:df(Q,q),onWheel:df(le,q),onPointerEnter:R?void 0:x,onPointerMove:R?ue:S,onPointerUp:R?te:void 0,onPointerDownCapture:R?z:void 0,onClickCapture:R?xe:void 0,onPointerLeave:N,ref:q,style:Mu,children:[C,P.jsx(J_,{})]})}function Af({id:t,store:r,unselect:i=!1,nodeRef:a}){const{addSelectedNodes:u,unselectNodesAndEdges:f,multiSelectionActive:d,nodeLookup:m,onError:v}=r.getState(),w=m.get(t);if(!w){v==null||v("012",Gr.error012(t));return}r.setState({nodesSelectionActive:!1}),w.selected?(i||w.selected&&d)&&(f({nodes:[w],edges:[]}),requestAnimationFrame(()=>{var b;return(b=a==null?void 0:a.current)==null?void 0:b.blur()})):u([t])}function Mg({nodeRef:t,disabled:r=!1,noDragClassName:i,handleSelector:a,nodeId:u,isSelectable:f,nodeClickDistance:d}){const m=It(),[v,w]=ce.useState(!1),b=ce.useRef();return ce.useEffect(()=>{b.current=V1({getStoreItems:()=>m.getState(),onNodeMouseDown:x=>{Af({id:x,store:m,nodeRef:t})},onDragStart:()=>{w(!0)},onDragStop:()=>{w(!1)}})},[]),ce.useEffect(()=>{if(!(r||!t.current||!b.current))return b.current.update({noDragClassName:i,handleSelector:a,domNode:t.current,isSelectable:f,nodeId:u,nodeClickDistance:d}),()=>{var x;(x=b.current)==null||x.destroy()}},[i,a,r,f,t,u,d]),v}const nS=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function Ig(){const t=It();return ce.useCallback(i=>{const{nodeExtent:a,snapToGrid:u,snapGrid:f,nodesDraggable:d,onError:m,updateNodePositions:v,nodeLookup:w,nodeOrigin:b}=t.getState(),x=new Map,S=nS(d),N=u?f[0]:5,C=u?f[1]:5,$=i.direction.x*N*i.factor,M=i.direction.y*C*i.factor;for(const[,I]of w){if(!S(I))continue;let H={x:I.internals.positionAbsolute.x+$,y:I.internals.positionAbsolute.y+M};u&&(H=za(H,f));const{position:j,positionAbsolute:R}=Qm({nodeId:I.id,nextPosition:H,nodeLookup:w,nodeExtent:a,nodeOrigin:b,onError:m});I.position=j,I.internals.positionAbsolute=R,x.set(I.id,I)}v(x)},[])}const Zf=ce.createContext(null),rS=Zf.Provider;Zf.Consumer;const Ag=()=>ce.useContext(Zf),oS=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),iS=(t,r,i)=>a=>{const{connectionClickStartHandle:u,connectionMode:f,connection:d}=a,{fromHandle:m,toHandle:v,isValid:w}=d,b=(v==null?void 0:v.nodeId)===t&&(v==null?void 0:v.id)===r&&(v==null?void 0:v.type)===i;return{connectingFrom:(m==null?void 0:m.nodeId)===t&&(m==null?void 0:m.id)===r&&(m==null?void 0:m.type)===i,connectingTo:b,clickConnecting:(u==null?void 0:u.nodeId)===t&&(u==null?void 0:u.id)===r&&(u==null?void 0:u.type)===i,isPossibleEndHandle:f===Ms.Strict?(m==null?void 0:m.type)!==i:t!==(m==null?void 0:m.nodeId)||r!==(m==null?void 0:m.id),connectionInProcess:!!m,clickConnectionInProcess:!!u,valid:b&&w}};function sS({type:t="source",position:r=Ze.Top,isValidConnection:i,isConnectable:a=!0,isConnectableStart:u=!0,isConnectableEnd:f=!0,id:d,onConnect:m,children:v,className:w,onMouseDown:b,onTouchStart:x,...S},N){var ue,te;const C=d||null,$=t==="target",M=It(),I=Ag(),{connectOnClick:H,noPanClassName:j,rfId:R}=gt(oS,Ot),{connectingFrom:q,connectingTo:V,clickConnecting:U,isPossibleEndHandle:pe,connectionInProcess:he,clickConnectionInProcess:_e,valid:Q}=gt(iS(I,C,t),Ot);I||(te=(ue=M.getState()).onError)==null||te.call(ue,"010",Gr.error010());const le=ae=>{const{defaultEdgeOptions:L,onConnect:F,hasDefaultEdges:X}=M.getState(),O={...L,...ae};if(X){const{edges:B,setEdges:ke}=M.getState();ke(lg(O,B))}F==null||F(O),m==null||m(O)},xe=ae=>{if(!I)return;const L=og(ae.nativeEvent);if(u&&(L&&ae.button===0||!L)){const F=M.getState();Mf.onPointerDown(ae.nativeEvent,{handleDomNode:ae.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:$,handleId:C,nodeId:I,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:(...X)=>{var O,B;return(B=(O=M.getState()).onConnectEnd)==null?void 0:B.call(O,...X)},updateConnection:F.updateConnection,onConnect:le,isValidConnection:i||((...X)=>{var O,B;return((B=(O=M.getState()).isValidConnection)==null?void 0:B.call(O,...X))??!0}),getTransform:()=>M.getState().transform,getFromHandle:()=>M.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}L?b==null||b(ae):x==null||x(ae)},z=ae=>{const{onClickConnectStart:L,onClickConnectEnd:F,connectionClickStartHandle:X,connectionMode:O,isValidConnection:B,lib:ke,rfId:Se,nodeLookup:Ie,connection:Re}=M.getState();if(!I||!X&&!u)return;if(!X){L==null||L(ae.nativeEvent,{nodeId:I,handleId:C,handleType:t}),M.setState({connectionClickStartHandle:{nodeId:I,type:t,id:C}});return}const Ae=ng(ae.target),we=i||B,{connection:ze,isValid:be}=Mf.isValid(ae.nativeEvent,{handle:{nodeId:I,id:C,type:t},connectionMode:O,fromNodeId:X.nodeId,fromHandleId:X.id||null,fromType:X.type,isValidConnection:we,flowId:Se,doc:Ae,lib:ke,nodeLookup:Ie});be&&ze&&le(ze);const Je=structuredClone(Re);delete Je.inProgress,Je.toPosition=Je.toHandle?Je.toHandle.position:null,F==null||F(ae,Je),M.setState({connectionClickStartHandle:null})};return P.jsx("div",{"data-handleid":C,"data-nodeid":I,"data-handlepos":r,"data-id":`${R}-${I}-${C}-${t}`,className:Ut(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",j,w,{source:!$,target:$,connectable:a,connectablestart:u,connectableend:f,clickconnecting:U,connectingfrom:q,connectingto:V,valid:Q,connectionindicator:a&&(!he||pe)&&(he||_e?f:u)}]),onMouseDown:xe,onTouchStart:xe,onClick:H?z:void 0,ref:N,...S,children:v})}const Rs=ce.memo(jg(sS));function aS({data:t,isConnectable:r,sourcePosition:i=Ze.Bottom}){return P.jsxs(P.Fragment,{children:[t==null?void 0:t.label,P.jsx(Rs,{type:"source",position:i,isConnectable:r})]})}function lS({data:t,isConnectable:r,targetPosition:i=Ze.Top,sourcePosition:a=Ze.Bottom}){return P.jsxs(P.Fragment,{children:[P.jsx(Rs,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label,P.jsx(Rs,{type:"source",position:a,isConnectable:r})]})}function uS(){return null}function cS({data:t,isConnectable:r,targetPosition:i=Ze.Top}){return P.jsxs(P.Fragment,{children:[P.jsx(Rs,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label]})}const yu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Xh={input:aS,default:lS,output:cS,group:uS};function fS(t){var r,i,a,u;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((r=t.style)==null?void 0:r.width),height:t.height??t.initialHeight??((i=t.style)==null?void 0:i.height)}:{width:t.width??((a=t.style)==null?void 0:a.width),height:t.height??((u=t.style)==null?void 0:u.height)}}const dS=t=>{const{width:r,height:i,x:a,y:u}=Da(t.nodeLookup,{filter:f=>!!f.selected});return{width:Mr(r)?r:null,height:Mr(i)?i:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${a}px,${u}px)`}};function pS({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:i}){const a=It(),{width:u,height:f,transformString:d,userSelectionActive:m}=gt(dS,Ot),v=Ig(),w=ce.useRef(null);ce.useEffect(()=>{var N;i||(N=w.current)==null||N.focus({preventScroll:!0})},[i]);const b=!m&&u!==null&&f!==null;if(Mg({nodeRef:w,disabled:!b}),!b)return null;const x=t?N=>{const C=a.getState().nodes.filter($=>$.selected);t(N,C)}:void 0,S=N=>{Object.prototype.hasOwnProperty.call(yu,N.key)&&(N.preventDefault(),v({direction:yu[N.key],factor:N.shiftKey?4:1}))};return P.jsx("div",{className:Ut(["react-flow__nodesselection","react-flow__container",r]),style:{transform:d},children:P.jsx("div",{ref:w,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:i?void 0:-1,onKeyDown:i?void 0:S,style:{width:u,height:f}})})}const Qh=typeof window<"u"?window:void 0,hS=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function $g({children:t,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:d,paneClickDistance:m,deleteKeyCode:v,selectionKeyCode:w,selectionOnDrag:b,selectionMode:x,onSelectionStart:S,onSelectionEnd:N,multiSelectionKeyCode:C,panActivationKeyCode:$,zoomActivationKeyCode:M,elementsSelectable:I,zoomOnScroll:H,zoomOnPinch:j,panOnScroll:R,panOnScrollSpeed:q,panOnScrollMode:V,zoomOnDoubleClick:U,panOnDrag:pe,defaultViewport:he,translateExtent:_e,minZoom:Q,maxZoom:le,preventScrolling:xe,onSelectionContextMenu:z,noWheelClassName:ue,noPanClassName:te,disableKeyboardA11y:ae,onViewportChange:L,isControlledViewport:F}){const{nodesSelectionActive:X,userSelectionActive:O}=gt(hS,Ot),B=Ia(w,{target:Qh}),ke=Ia($,{target:Qh}),Se=ke||pe,Ie=ke||R,Re=b&&Se!==!0,Ae=B||O||Re;return Y_({deleteKeyCode:v,multiSelectionKeyCode:C}),P.jsx(G_,{onPaneContextMenu:f,elementsSelectable:I,zoomOnScroll:H,zoomOnPinch:j,panOnScroll:Ie,panOnScrollSpeed:q,panOnScrollMode:V,zoomOnDoubleClick:U,panOnDrag:!B&&Se,defaultViewport:he,translateExtent:_e,minZoom:Q,maxZoom:le,zoomActivationKeyCode:M,preventScrolling:xe,noWheelClassName:ue,noPanClassName:te,onViewportChange:L,isControlledViewport:F,paneClickDistance:m,selectionOnDrag:Re,children:P.jsxs(tS,{onSelectionStart:S,onSelectionEnd:N,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:d,panOnDrag:Se,isSelecting:!!Ae,selectionMode:x,selectionKeyPressed:B,paneClickDistance:m,selectionOnDrag:Re,children:[t,X&&P.jsx(pS,{onSelectionContextMenu:z,noPanClassName:te,disableKeyboardA11y:ae})]})})}$g.displayName="FlowRenderer";const mS=ce.memo($g),gS=t=>r=>t?Vf(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 yS(t){return gt(ce.useCallback(gS(t),[t]),Ot)}const vS=t=>t.updateNodeInternals;function xS(){const t=gt(vS),[r]=ce.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const a=new Map;i.forEach(u=>{const f=u.target.getAttribute("data-id");a.set(f,{id:f,nodeElement:u.target,force:!0})}),t(a)}));return ce.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function wS({node:t,nodeType:r,hasDimensions:i,resizeObserver:a}){const u=It(),f=ce.useRef(null),d=ce.useRef(null),m=ce.useRef(t.sourcePosition),v=ce.useRef(t.targetPosition),w=ce.useRef(r),b=i&&!!t.internals.handleBounds;return ce.useEffect(()=>{f.current&&!t.hidden&&(!b||d.current!==f.current)&&(d.current&&(a==null||a.unobserve(d.current)),a==null||a.observe(f.current),d.current=f.current)},[b,t.hidden]),ce.useEffect(()=>()=>{d.current&&(a==null||a.unobserve(d.current),d.current=null)},[]),ce.useEffect(()=>{if(f.current){const x=w.current!==r,S=m.current!==t.sourcePosition,N=v.current!==t.targetPosition;(x||S||N)&&(w.current=r,m.current=t.sourcePosition,v.current=t.targetPosition,u.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:f.current,force:!0}]])))}},[t.id,r,t.sourcePosition,t.targetPosition]),f}function _S({id:t,onClick:r,onMouseEnter:i,onMouseMove:a,onMouseLeave:u,onContextMenu:f,onDoubleClick:d,nodesDraggable:m,elementsSelectable:v,nodesConnectable:w,nodesFocusable:b,resizeObserver:x,noDragClassName:S,noPanClassName:N,disableKeyboardA11y:C,rfId:$,nodeTypes:M,nodeClickDistance:I,onError:H}){const{node:j,internals:R,isParent:q}=gt(we=>{const ze=we.nodeLookup.get(t),be=we.parentLookup.has(t);return{node:ze,internals:ze.internals,isParent:be}},Ot);let V=j.type||"default",U=(M==null?void 0:M[V])||Xh[V];U===void 0&&(H==null||H("003",Gr.error003(V)),V="default",U=(M==null?void 0:M.default)||Xh.default);const pe=!!(j.draggable||m&&typeof j.draggable>"u"),he=!!(j.selectable||v&&typeof j.selectable>"u"),_e=!!(j.connectable||w&&typeof j.connectable>"u"),Q=!!(j.focusable||b&&typeof j.focusable>"u"),le=It(),xe=eg(j),z=wS({node:j,nodeType:V,hasDimensions:xe,resizeObserver:x}),ue=Mg({nodeRef:z,disabled:j.hidden||!pe,noDragClassName:S,handleSelector:j.dragHandle,nodeId:t,isSelectable:he,nodeClickDistance:I}),te=Ig();if(j.hidden)return null;const ae=To(j),L=fS(j),F=he||pe||r||i||a||u,X=i?we=>i(we,{...R.userNode}):void 0,O=a?we=>a(we,{...R.userNode}):void 0,B=u?we=>u(we,{...R.userNode}):void 0,ke=f?we=>f(we,{...R.userNode}):void 0,Se=d?we=>d(we,{...R.userNode}):void 0,Ie=we=>{const{selectNodesOnDrag:ze,nodeDragThreshold:be}=le.getState();he&&(!ze||!pe||be>0)&&Af({id:t,store:le,nodeRef:z}),r&&r(we,{...R.userNode})},Re=we=>{if(!(rg(we.nativeEvent)||C)){if(Um.includes(we.key)&&he){const ze=we.key==="Escape";Af({id:t,store:le,unselect:ze,nodeRef:z})}else if(pe&&j.selected&&Object.prototype.hasOwnProperty.call(yu,we.key)){we.preventDefault();const{ariaLabelConfig:ze}=le.getState();le.setState({ariaLiveMessage:ze["node.a11yDescription.ariaLiveMessage"]({direction:we.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),te({direction:yu[we.key],factor:we.shiftKey?4:1})}}},Ae=()=>{var ct;if(C||!((ct=z.current)!=null&&ct.matches(":focus-visible")))return;const{transform:we,width:ze,height:be,autoPanOnNodeFocus:Je,setCenter:Fe}=le.getState();if(!Je)return;Vf(new Map([[t,j]]),{x:0,y:0,width:ze,height:be},we,!0).length>0||Fe(j.position.x+ae.width/2,j.position.y+ae.height/2,{zoom:we[2]})};return P.jsx("div",{className:Ut(["react-flow__node",`react-flow__node-${V}`,{[N]:pe},j.className,{selected:j.selected,selectable:he,parent:q,draggable:pe,dragging:ue}]),ref:z,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:xe?"visible":"hidden",...j.style,...L},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:X,onMouseMove:O,onMouseLeave:B,onContextMenu:ke,onClick:Ie,onDoubleClick:Se,onKeyDown:Q?Re:void 0,tabIndex:Q?0:void 0,onFocus:Q?Ae:void 0,role:j.ariaRole??(Q?"group":void 0),"aria-roledescription":"node","aria-describedby":C?void 0:`${bg}-${$}`,"aria-label":j.ariaLabel,...j.domAttributes,children:P.jsx(rS,{value:t,children:P.jsx(U,{id:t,data:j.data,type:V,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:j.selected??!1,selectable:he,draggable:pe,deletable:j.deletable??!0,isConnectable:_e,sourcePosition:j.sourcePosition,targetPosition:j.targetPosition,dragging:ue,dragHandle:j.dragHandle,zIndex:R.z,parentId:j.parentId,...ae})})})}var SS=ce.memo(_S);const bS=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Og(t){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:a,elementsSelectable:u,onError:f}=gt(bS,Ot),d=yS(t.onlyRenderVisibleElements),m=xS();return P.jsx("div",{className:"react-flow__nodes",style:Mu,children:d.map(v=>P.jsx(SS,{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:m,nodesDraggable:r,nodesConnectable:i,nodesFocusable:a,elementsSelectable:u,nodeClickDistance:t.nodeClickDistance,onError:f},v))})}Og.displayName="NodeRenderer";const kS=ce.memo(Og);function ES(t){return gt(ce.useCallback(i=>{if(!t)return i.edges.map(u=>u.id);const a=[];if(i.width&&i.height)for(const u of i.edges){const f=i.nodeLookup.get(u.source),d=i.nodeLookup.get(u.target);f&&d&&E1({sourceNode:f,targetNode:d,width:i.width,height:i.height,transform:i.transform})&&a.push(u.id)}return a},[t]),Ot)}const NS=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t}};return P.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},CS=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t,fill:t}};return P.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Gh={[hu.Arrow]:NS,[hu.ArrowClosed]:CS};function PS(t){const r=It();return ce.useMemo(()=>{var u,f;return Object.prototype.hasOwnProperty.call(Gh,t)?Gh[t]:((f=(u=r.getState()).onError)==null||f.call(u,"009",Gr.error009(t)),null)},[t])}const jS=({id:t,type:r,color:i,width:a=12.5,height:u=12.5,markerUnits:f="strokeWidth",strokeWidth:d,orient:m="auto-start-reverse"})=>{const v=PS(r);return v?P.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${a}`,markerHeight:`${u}`,viewBox:"-10 -10 20 20",markerUnits:f,orient:m,refX:"0",refY:"0",children:P.jsx(v,{color:i,strokeWidth:d})}):null},Rg=({defaultColor:t,rfId:r})=>{const i=gt(f=>f.edges),a=gt(f=>f.defaultEdgeOptions),u=ce.useMemo(()=>I1(i,{id:r,defaultColor:t,defaultMarkerStart:a==null?void 0:a.markerStart,defaultMarkerEnd:a==null?void 0:a.markerEnd}),[i,a,r,t]);return u.length?P.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:P.jsx("defs",{children:u.map(f=>P.jsx(jS,{id:f.id,type:f.type,color:f.color,width:f.width,height:f.height,markerUnits:f.markerUnits,strokeWidth:f.strokeWidth,orient:f.orient},f.id))})}):null};Rg.displayName="MarkerDefinitions";var TS=ce.memo(Rg);function Dg({x:t,y:r,label:i,labelStyle:a,labelShowBg:u=!0,labelBgStyle:f,labelBgPadding:d=[2,4],labelBgBorderRadius:m=2,children:v,className:w,...b}){const[x,S]=ce.useState({x:1,y:0,width:0,height:0}),N=Ut(["react-flow__edge-textwrapper",w]),C=ce.useRef(null);return ce.useEffect(()=>{if(C.current){const $=C.current.getBBox();S({x:$.x,y:$.y,width:$.width,height:$.height})}},[i]),i?P.jsxs("g",{transform:`translate(${t-x.width/2} ${r-x.height/2})`,className:N,visibility:x.width?"visible":"hidden",...b,children:[u&&P.jsx("rect",{width:x.width+2*d[0],x:-d[0],y:-d[1],height:x.height+2*d[1],className:"react-flow__edge-textbg",style:f,rx:m,ry:m}),P.jsx("text",{className:"react-flow__edge-text",y:x.height/2,dy:"0.3em",ref:C,style:a,children:i}),v]}):null}Dg.displayName="EdgeText";const MS=ce.memo(Dg);function Iu({path:t,labelX:r,labelY:i,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:v,interactionWidth:w=20,...b}){return P.jsxs(P.Fragment,{children:[P.jsx("path",{...b,d:t,fill:"none",className:Ut(["react-flow__edge-path",b.className])}),w?P.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:w,className:"react-flow__edge-interaction"}):null,a&&Mr(r)&&Mr(i)?P.jsx(MS,{x:r,y:i,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:v}):null]})}function Zh({pos:t,x1:r,y1:i,x2:a,y2:u}){return t===Ze.Left||t===Ze.Right?[.5*(r+a),i]:[r,.5*(i+u)]}function zg({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:a,targetY:u,targetPosition:f=Ze.Top}){const[d,m]=Zh({pos:i,x1:t,y1:r,x2:a,y2:u}),[v,w]=Zh({pos:f,x1:a,y1:u,x2:t,y2:r}),[b,x,S,N]=ig({sourceX:t,sourceY:r,targetX:a,targetY:u,sourceControlX:d,sourceControlY:m,targetControlX:v,targetControlY:w});return[`M${t},${r} C${d},${m} ${v},${w} ${a},${u}`,b,x,S,N]}function Lg(t){return ce.memo(({id:r,sourceX:i,sourceY:a,targetX:u,targetY:f,sourcePosition:d,targetPosition:m,label:v,labelStyle:w,labelShowBg:b,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:N,style:C,markerEnd:$,markerStart:M,interactionWidth:I})=>{const[H,j,R]=zg({sourceX:i,sourceY:a,sourcePosition:d,targetX:u,targetY:f,targetPosition:m}),q=t.isInternal?void 0:r;return P.jsx(Iu,{id:q,path:H,labelX:j,labelY:R,label:v,labelStyle:w,labelShowBg:b,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:N,style:C,markerEnd:$,markerStart:M,interactionWidth:I})})}const IS=Lg({isInternal:!1}),Fg=Lg({isInternal:!0});IS.displayName="SimpleBezierEdge";Fg.displayName="SimpleBezierEdgeInternal";function Bg(t){return ce.memo(({id:r,sourceX:i,sourceY:a,targetX:u,targetY:f,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:w,labelBgPadding:b,labelBgBorderRadius:x,style:S,sourcePosition:N=Ze.Bottom,targetPosition:C=Ze.Top,markerEnd:$,markerStart:M,pathOptions:I,interactionWidth:H})=>{const[j,R,q]=Pf({sourceX:i,sourceY:a,sourcePosition:N,targetX:u,targetY:f,targetPosition:C,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 P.jsx(Iu,{id:V,path:j,labelX:R,labelY:q,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:w,labelBgPadding:b,labelBgBorderRadius:x,style:S,markerEnd:$,markerStart:M,interactionWidth:H})})}const Hg=Bg({isInternal:!1}),Vg=Bg({isInternal:!0});Hg.displayName="SmoothStepEdge";Vg.displayName="SmoothStepEdgeInternal";function Kg(t){return ce.memo(({id:r,...i})=>{var u;const a=t.isInternal?void 0:r;return P.jsx(Hg,{...i,id:a,pathOptions:ce.useMemo(()=>{var f;return{borderRadius:0,offset:(f=i.pathOptions)==null?void 0:f.offset}},[(u=i.pathOptions)==null?void 0:u.offset])})})}const AS=Kg({isInternal:!1}),Ug=Kg({isInternal:!0});AS.displayName="StepEdge";Ug.displayName="StepEdgeInternal";function qg(t){return ce.memo(({id:r,sourceX:i,sourceY:a,targetX:u,targetY:f,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:w,labelBgPadding:b,labelBgBorderRadius:x,style:S,markerEnd:N,markerStart:C,interactionWidth:$})=>{const[M,I,H]=ug({sourceX:i,sourceY:a,targetX:u,targetY:f}),j=t.isInternal?void 0:r;return P.jsx(Iu,{id:j,path:M,labelX:I,labelY:H,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:w,labelBgPadding:b,labelBgBorderRadius:x,style:S,markerEnd:N,markerStart:C,interactionWidth:$})})}const $S=qg({isInternal:!1}),Wg=qg({isInternal:!0});$S.displayName="StraightEdge";Wg.displayName="StraightEdgeInternal";function Yg(t){return ce.memo(({id:r,sourceX:i,sourceY:a,targetX:u,targetY:f,sourcePosition:d=Ze.Bottom,targetPosition:m=Ze.Top,label:v,labelStyle:w,labelShowBg:b,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:N,style:C,markerEnd:$,markerStart:M,pathOptions:I,interactionWidth:H})=>{const[j,R,q]=sg({sourceX:i,sourceY:a,sourcePosition:d,targetX:u,targetY:f,targetPosition:m,curvature:I==null?void 0:I.curvature}),V=t.isInternal?void 0:r;return P.jsx(Iu,{id:V,path:j,labelX:R,labelY:q,label:v,labelStyle:w,labelShowBg:b,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:N,style:C,markerEnd:$,markerStart:M,interactionWidth:H})})}const OS=Yg({isInternal:!1}),Xg=Yg({isInternal:!0});OS.displayName="BezierEdge";Xg.displayName="BezierEdgeInternal";const Jh={default:Xg,straight:Wg,step:Ug,smoothstep:Vg,simplebezier:Fg},em={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},RS=(t,r,i)=>i===Ze.Left?t-r:i===Ze.Right?t+r:t,DS=(t,r,i)=>i===Ze.Top?t-r:i===Ze.Bottom?t+r:t,tm="react-flow__edgeupdater";function nm({position:t,centerX:r,centerY:i,radius:a=10,onMouseDown:u,onMouseEnter:f,onMouseOut:d,type:m}){return P.jsx("circle",{onMouseDown:u,onMouseEnter:f,onMouseOut:d,className:Ut([tm,`${tm}-${m}`]),cx:RS(r,a,t),cy:DS(i,a,t),r:a,stroke:"transparent",fill:"transparent"})}function zS({isReconnectable:t,reconnectRadius:r,edge:i,sourceX:a,sourceY:u,targetX:f,targetY:d,sourcePosition:m,targetPosition:v,onReconnect:w,onReconnectStart:b,onReconnectEnd:x,setReconnecting:S,setUpdateHover:N}){const C=It(),$=(R,q)=>{if(R.button!==0)return;const{autoPanOnConnect:V,domNode:U,connectionMode:pe,connectionRadius:he,lib:_e,onConnectStart:Q,cancelConnection:le,nodeLookup:xe,rfId:z,panBy:ue,updateConnection:te}=C.getState(),ae=q.type==="target",L=(O,B)=>{S(!1),x==null||x(O,i,q.type,B)},F=O=>w==null?void 0:w(i,O),X=(O,B)=>{S(!0),b==null||b(R,i,q.type),Q==null||Q(O,B)};Mf.onPointerDown(R.nativeEvent,{autoPanOnConnect:V,connectionMode:pe,connectionRadius:he,domNode:U,handleId:q.id,nodeId:q.nodeId,nodeLookup:xe,isTarget:ae,edgeUpdaterType:q.type,lib:_e,flowId:z,cancelConnection:le,panBy:ue,isValidConnection:(...O)=>{var B,ke;return((ke=(B=C.getState()).isValidConnection)==null?void 0:ke.call(B,...O))??!0},onConnect:F,onConnectStart:X,onConnectEnd:(...O)=>{var B,ke;return(ke=(B=C.getState()).onConnectEnd)==null?void 0:ke.call(B,...O)},onReconnectEnd:L,updateConnection:te,getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,dragThreshold:C.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},M=R=>$(R,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),I=R=>$(R,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),H=()=>N(!0),j=()=>N(!1);return P.jsxs(P.Fragment,{children:[(t===!0||t==="source")&&P.jsx(nm,{position:m,centerX:a,centerY:u,radius:r,onMouseDown:M,onMouseEnter:H,onMouseOut:j,type:"source"}),(t===!0||t==="target")&&P.jsx(nm,{position:v,centerX:f,centerY:d,radius:r,onMouseDown:I,onMouseEnter:H,onMouseOut:j,type:"target"})]})}function LS({id:t,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:a,onClick:u,onDoubleClick:f,onContextMenu:d,onMouseEnter:m,onMouseMove:v,onMouseLeave:w,reconnectRadius:b,onReconnect:x,onReconnectStart:S,onReconnectEnd:N,rfId:C,edgeTypes:$,noPanClassName:M,onError:I,disableKeyboardA11y:H}){let j=gt(Fe=>Fe.edgeLookup.get(t));const R=gt(Fe=>Fe.defaultEdgeOptions);j=R?{...R,...j}:j;let q=j.type||"default",V=($==null?void 0:$[q])||Jh[q];V===void 0&&(I==null||I("011",Gr.error011(q)),q="default",V=($==null?void 0:$.default)||Jh.default);const U=!!(j.focusable||r&&typeof j.focusable>"u"),pe=typeof x<"u"&&(j.reconnectable||i&&typeof j.reconnectable>"u"),he=!!(j.selectable||a&&typeof j.selectable>"u"),_e=ce.useRef(null),[Q,le]=ce.useState(!1),[xe,z]=ce.useState(!1),ue=It(),{zIndex:te,sourceX:ae,sourceY:L,targetX:F,targetY:X,sourcePosition:O,targetPosition:B}=gt(ce.useCallback(Fe=>{const Ve=Fe.nodeLookup.get(j.source),ct=Fe.nodeLookup.get(j.target);if(!Ve||!ct)return{zIndex:j.zIndex,...em};const nt=M1({id:t,sourceNode:Ve,targetNode:ct,sourceHandle:j.sourceHandle||null,targetHandle:j.targetHandle||null,connectionMode:Fe.connectionMode,onError:I});return{zIndex:k1({selected:j.selected,zIndex:j.zIndex,sourceNode:Ve,targetNode:ct,elevateOnSelect:Fe.elevateEdgesOnSelect,zIndexMode:Fe.zIndexMode}),...nt||em}},[j.source,j.target,j.sourceHandle,j.targetHandle,j.selected,j.zIndex]),Ot),ke=ce.useMemo(()=>j.markerStart?`url('#${jf(j.markerStart,C)}')`:void 0,[j.markerStart,C]),Se=ce.useMemo(()=>j.markerEnd?`url('#${jf(j.markerEnd,C)}')`:void 0,[j.markerEnd,C]);if(j.hidden||ae===null||L===null||F===null||X===null)return null;const Ie=Fe=>{var ft;const{addSelectedEdges:Ve,unselectNodesAndEdges:ct,multiSelectionActive:nt}=ue.getState();he&&(ue.setState({nodesSelectionActive:!1}),j.selected&&nt?(ct({nodes:[],edges:[j]}),(ft=_e.current)==null||ft.blur()):Ve([t])),u&&u(Fe,j)},Re=f?Fe=>{f(Fe,{...j})}:void 0,Ae=d?Fe=>{d(Fe,{...j})}:void 0,we=m?Fe=>{m(Fe,{...j})}:void 0,ze=v?Fe=>{v(Fe,{...j})}:void 0,be=w?Fe=>{w(Fe,{...j})}:void 0,Je=Fe=>{var Ve;if(!H&&Um.includes(Fe.key)&&he){const{unselectNodesAndEdges:ct,addSelectedEdges:nt}=ue.getState();Fe.key==="Escape"?((Ve=_e.current)==null||Ve.blur(),ct({edges:[j]})):nt([t])}};return P.jsx("svg",{style:{zIndex:te},children:P.jsxs("g",{className:Ut(["react-flow__edge",`react-flow__edge-${q}`,j.className,M,{selected:j.selected,animated:j.animated,inactive:!he&&!u,updating:Q,selectable:he}]),onClick:Ie,onDoubleClick:Re,onContextMenu:Ae,onMouseEnter:we,onMouseMove:ze,onMouseLeave:be,onKeyDown:U?Je:void 0,tabIndex:U?0:void 0,role:j.ariaRole??(U?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":j.ariaLabel===null?void 0:j.ariaLabel||`Edge from ${j.source} to ${j.target}`,"aria-describedby":U?`${kg}-${C}`:void 0,ref:_e,...j.domAttributes,children:[!xe&&P.jsx(V,{id:t,source:j.source,target:j.target,type:j.type,selected:j.selected,animated:j.animated,selectable:he,deletable:j.deletable??!0,label:j.label,labelStyle:j.labelStyle,labelShowBg:j.labelShowBg,labelBgStyle:j.labelBgStyle,labelBgPadding:j.labelBgPadding,labelBgBorderRadius:j.labelBgBorderRadius,sourceX:ae,sourceY:L,targetX:F,targetY:X,sourcePosition:O,targetPosition:B,data:j.data,style:j.style,sourceHandleId:j.sourceHandle,targetHandleId:j.targetHandle,markerStart:ke,markerEnd:Se,pathOptions:"pathOptions"in j?j.pathOptions:void 0,interactionWidth:j.interactionWidth}),pe&&P.jsx(zS,{edge:j,isReconnectable:pe,reconnectRadius:b,onReconnect:x,onReconnectStart:S,onReconnectEnd:N,sourceX:ae,sourceY:L,targetX:F,targetY:X,sourcePosition:O,targetPosition:B,setUpdateHover:le,setReconnecting:z})]})})}var FS=ce.memo(LS);const BS=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function Qg({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:i,edgeTypes:a,noPanClassName:u,onReconnect:f,onEdgeContextMenu:d,onEdgeMouseEnter:m,onEdgeMouseMove:v,onEdgeMouseLeave:w,onEdgeClick:b,reconnectRadius:x,onEdgeDoubleClick:S,onReconnectStart:N,onReconnectEnd:C,disableKeyboardA11y:$}){const{edgesFocusable:M,edgesReconnectable:I,elementsSelectable:H,onError:j}=gt(BS,Ot),R=ES(r);return P.jsxs("div",{className:"react-flow__edges",children:[P.jsx(TS,{defaultColor:t,rfId:i}),R.map(q=>P.jsx(FS,{id:q,edgesFocusable:M,edgesReconnectable:I,elementsSelectable:H,noPanClassName:u,onReconnect:f,onContextMenu:d,onMouseEnter:m,onMouseMove:v,onMouseLeave:w,onClick:b,reconnectRadius:x,onDoubleClick:S,onReconnectStart:N,onReconnectEnd:C,rfId:i,onError:j,edgeTypes:a,disableKeyboardA11y:$},q))]})}Qg.displayName="EdgeRenderer";const HS=ce.memo(Qg),VS=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function KS({children:t}){const r=gt(VS);return P.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function US(t){const r=Gf(),i=ce.useRef(!1);ce.useEffect(()=>{!i.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),i.current=!0)},[t,r.viewportInitialized])}const qS=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function WS(t){const r=gt(qS),i=It();return ce.useEffect(()=>{t&&(r==null||r(t),i.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function YS(t){return t.connection.inProgress?{...t.connection,to:La(t.connection.to,t.transform)}:{...t.connection}}function XS(t){return YS}function QS(t){const r=XS();return gt(r,Ot)}const GS=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function ZS({containerStyle:t,style:r,type:i,component:a}){const{nodesConnectable:u,width:f,height:d,isValid:m,inProgress:v}=gt(GS,Ot);return!(f&&u&&v)?null:P.jsx("svg",{style:t,width:f,height:d,className:"react-flow__connectionline react-flow__container",children:P.jsx("g",{className:Ut(["react-flow__connection",Ym(m)]),children:P.jsx(Gg,{style:r,type:i,CustomComponent:a,isValid:m})})})}const Gg=({style:t,type:r=ai.Bezier,CustomComponent:i,isValid:a})=>{const{inProgress:u,from:f,fromNode:d,fromHandle:m,fromPosition:v,to:w,toNode:b,toHandle:x,toPosition:S,pointer:N}=QS();if(!u)return;if(i)return P.jsx(i,{connectionLineType:r,connectionLineStyle:t,fromNode:d,fromHandle:m,fromX:f.x,fromY:f.y,toX:w.x,toY:w.y,fromPosition:v,toPosition:S,connectionStatus:Ym(a),toNode:b,toHandle:x,pointer:N});let C="";const $={sourceX:f.x,sourceY:f.y,sourcePosition:v,targetX:w.x,targetY:w.y,targetPosition:S};switch(r){case ai.Bezier:[C]=sg($);break;case ai.SimpleBezier:[C]=zg($);break;case ai.Step:[C]=Pf({...$,borderRadius:0});break;case ai.SmoothStep:[C]=Pf($);break;default:[C]=ug($)}return P.jsx("path",{d:C,fill:"none",className:"react-flow__connection-path",style:t})};Gg.displayName="ConnectionLine";const JS={};function rm(t=JS){ce.useRef(t),It(),ce.useEffect(()=>{},[t])}function eb(){It(),ce.useRef(!1),ce.useEffect(()=>{},[])}function Zg({nodeTypes:t,edgeTypes:r,onInit:i,onNodeClick:a,onEdgeClick:u,onNodeDoubleClick:f,onEdgeDoubleClick:d,onNodeMouseEnter:m,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:b,onSelectionContextMenu:x,onSelectionStart:S,onSelectionEnd:N,connectionLineType:C,connectionLineStyle:$,connectionLineComponent:M,connectionLineContainerStyle:I,selectionKeyCode:H,selectionOnDrag:j,selectionMode:R,multiSelectionKeyCode:q,panActivationKeyCode:V,zoomActivationKeyCode:U,deleteKeyCode:pe,onlyRenderVisibleElements:he,elementsSelectable:_e,defaultViewport:Q,translateExtent:le,minZoom:xe,maxZoom:z,preventScrolling:ue,defaultMarkerColor:te,zoomOnScroll:ae,zoomOnPinch:L,panOnScroll:F,panOnScrollSpeed:X,panOnScrollMode:O,zoomOnDoubleClick:B,panOnDrag:ke,onPaneClick:Se,onPaneMouseEnter:Ie,onPaneMouseMove:Re,onPaneMouseLeave:Ae,onPaneScroll:we,onPaneContextMenu:ze,paneClickDistance:be,nodeClickDistance:Je,onEdgeContextMenu:Fe,onEdgeMouseEnter:Ve,onEdgeMouseMove:ct,onEdgeMouseLeave:nt,reconnectRadius:ft,onReconnect:kt,onReconnectStart:rn,onReconnectEnd:Gt,noDragClassName:qt,noWheelClassName:Nt,noPanClassName:Mn,disableKeyboardA11y:cn,nodeExtent:pr,rfId:fn,viewport:Ct,onViewportChange:Wt}){return rm(t),rm(r),eb(),US(i),WS(Ct),P.jsx(mS,{onPaneClick:Se,onPaneMouseEnter:Ie,onPaneMouseMove:Re,onPaneMouseLeave:Ae,onPaneContextMenu:ze,onPaneScroll:we,paneClickDistance:be,deleteKeyCode:pe,selectionKeyCode:H,selectionOnDrag:j,selectionMode:R,onSelectionStart:S,onSelectionEnd:N,multiSelectionKeyCode:q,panActivationKeyCode:V,zoomActivationKeyCode:U,elementsSelectable:_e,zoomOnScroll:ae,zoomOnPinch:L,zoomOnDoubleClick:B,panOnScroll:F,panOnScrollSpeed:X,panOnScrollMode:O,panOnDrag:ke,defaultViewport:Q,translateExtent:le,minZoom:xe,maxZoom:z,onSelectionContextMenu:x,preventScrolling:ue,noDragClassName:qt,noWheelClassName:Nt,noPanClassName:Mn,disableKeyboardA11y:cn,onViewportChange:Wt,isControlledViewport:!!Ct,children:P.jsxs(KS,{children:[P.jsx(HS,{edgeTypes:r,onEdgeClick:u,onEdgeDoubleClick:d,onReconnect:kt,onReconnectStart:rn,onReconnectEnd:Gt,onlyRenderVisibleElements:he,onEdgeContextMenu:Fe,onEdgeMouseEnter:Ve,onEdgeMouseMove:ct,onEdgeMouseLeave:nt,reconnectRadius:ft,defaultMarkerColor:te,noPanClassName:Mn,disableKeyboardA11y:cn,rfId:fn}),P.jsx(ZS,{style:$,type:C,component:M,containerStyle:I}),P.jsx("div",{className:"react-flow__edgelabel-renderer"}),P.jsx(kS,{nodeTypes:t,onNodeClick:a,onNodeDoubleClick:f,onNodeMouseEnter:m,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:b,nodeClickDistance:Je,onlyRenderVisibleElements:he,noPanClassName:Mn,noDragClassName:qt,disableKeyboardA11y:cn,nodeExtent:pr,rfId:fn}),P.jsx("div",{className:"react-flow__viewport-portal"})]})})}Zg.displayName="GraphView";const tb=ce.memo(Zg),om=({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,width:u,height:f,fitView:d,fitViewOptions:m,minZoom:v=.5,maxZoom:w=2,nodeOrigin:b,nodeExtent:x,zIndexMode:S="basic"}={})=>{const N=new Map,C=new Map,$=new Map,M=new Map,I=a??r??[],H=i??t??[],j=b??[0,0],R=x??Pa;dg($,M,I);const{nodesInitialized:q}=Tf(H,N,C,{nodeOrigin:j,nodeExtent:R,zIndexMode:S});let V=[0,0,1];if(d&&u&&f){const U=Da(N,{filter:Q=>!!((Q.width||Q.initialWidth)&&(Q.height||Q.initialHeight))}),{x:pe,y:he,zoom:_e}=Kf(U,u,f,v,w,(m==null?void 0:m.padding)??.1);V=[pe,he,_e]}return{rfId:"1",width:u??0,height:f??0,transform:V,nodes:H,nodesInitialized:q,nodeLookup:N,parentLookup:C,edges:I,edgeLookup:M,connectionLookup:$,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:v,maxZoom:w,translateExtent:Pa,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ms.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:j,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:m,fitViewResolver:null,connection:{...Wm},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:v1,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:qm,zIndexMode:S,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},nb=({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,width:u,height:f,fitView:d,fitViewOptions:m,minZoom:v,maxZoom:w,nodeOrigin:b,nodeExtent:x,zIndexMode:S})=>__((N,C)=>{async function $(){const{nodeLookup:M,panZoom:I,fitViewOptions:H,fitViewResolver:j,width:R,height:q,minZoom:V,maxZoom:U}=C();I&&(await g1({nodes:M,width:R,height:q,panZoom:I,minZoom:V,maxZoom:U},H),j==null||j.resolve(!0),N({fitViewResolver:null}))}return{...om({nodes:t,edges:r,width:u,height:f,fitView:d,fitViewOptions:m,minZoom:v,maxZoom:w,nodeOrigin:b,nodeExtent:x,defaultNodes:i,defaultEdges:a,zIndexMode:S}),setNodes:M=>{const{nodeLookup:I,parentLookup:H,nodeOrigin:j,elevateNodesOnSelect:R,fitViewQueued:q,zIndexMode:V,nodesSelectionActive:U}=C(),{nodesInitialized:pe,hasSelectedNodes:he}=Tf(M,I,H,{nodeOrigin:j,nodeExtent:x,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:V}),_e=U&&he;q&&pe?($(),N({nodes:M,nodesInitialized:pe,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:_e})):N({nodes:M,nodesInitialized:pe,nodesSelectionActive:_e})},setEdges:M=>{const{connectionLookup:I,edgeLookup:H}=C();dg(I,H,M),N({edges:M})},setDefaultNodesAndEdges:(M,I)=>{if(M){const{setNodes:H}=C();H(M),N({hasDefaultNodes:!0})}if(I){const{setEdges:H}=C();H(I),N({hasDefaultEdges:!0})}},updateNodeInternals:M=>{const{triggerNodeChanges:I,nodeLookup:H,parentLookup:j,domNode:R,nodeOrigin:q,nodeExtent:V,debug:U,fitViewQueued:pe,zIndexMode:he}=C(),{changes:_e,updatedInternals:Q}=L1(M,H,j,R,q,V,he);Q&&(O1(H,j,{nodeOrigin:q,nodeExtent:V,zIndexMode:he}),pe?($(),N({fitViewQueued:!1,fitViewOptions:void 0})):N({}),(_e==null?void 0:_e.length)>0&&(U&&console.log("React Flow: trigger node changes",_e),I==null||I(_e)))},updateNodePositions:(M,I=!1)=>{const H=[];let j=[];const{nodeLookup:R,triggerNodeChanges:q,connection:V,updateConnection:U,onNodesChangeMiddlewareMap:pe}=C();for(const[he,_e]of M){const Q=R.get(he),le=!!(Q!=null&&Q.expandParent&&(Q!=null&&Q.parentId)&&(_e!=null&&_e.position)),xe={id:he,type:"position",position:le?{x:Math.max(0,_e.position.x),y:Math.max(0,_e.position.y)}:_e.position,dragging:I};if(Q&&V.inProgress&&V.fromNode.id===Q.id){const z=Fi(Q,V.fromHandle,Ze.Left,!0);U({...V,from:z})}le&&Q.parentId&&H.push({id:he,parentId:Q.parentId,rect:{..._e.internals.positionAbsolute,width:_e.measured.width??0,height:_e.measured.height??0}}),j.push(xe)}if(H.length>0){const{parentLookup:he,nodeOrigin:_e}=C(),Q=Qf(H,R,he,_e);j.push(...Q)}for(const he of pe.values())j=he(j);q(j)},triggerNodeChanges:M=>{const{onNodesChange:I,setNodes:H,nodes:j,hasDefaultNodes:R,debug:q}=C();if(M!=null&&M.length){if(R){const V=Cg(M,j);H(V)}q&&console.log("React Flow: trigger node changes",M),I==null||I(M)}},triggerEdgeChanges:M=>{const{onEdgesChange:I,setEdges:H,edges:j,hasDefaultEdges:R,debug:q}=C();if(M!=null&&M.length){if(R){const V=Pg(M,j);H(V)}q&&console.log("React Flow: trigger edge changes",M),I==null||I(M)}},addSelectedNodes:M=>{const{multiSelectionActive:I,edgeLookup:H,nodeLookup:j,triggerNodeChanges:R,triggerEdgeChanges:q}=C();if(I){const V=M.map(U=>Ai(U,!0));R(V);return}R(Ns(j,new Set([...M]),!0)),q(Ns(H))},addSelectedEdges:M=>{const{multiSelectionActive:I,edgeLookup:H,nodeLookup:j,triggerNodeChanges:R,triggerEdgeChanges:q}=C();if(I){const V=M.map(U=>Ai(U,!0));q(V);return}q(Ns(H,new Set([...M]))),R(Ns(j,new Set,!0))},unselectNodesAndEdges:({nodes:M,edges:I}={})=>{const{edges:H,nodes:j,nodeLookup:R,triggerNodeChanges:q,triggerEdgeChanges:V}=C(),U=M||j,pe=I||H,he=[];for(const Q of U){if(!Q.selected)continue;const le=R.get(Q.id);le&&(le.selected=!1),he.push(Ai(Q.id,!1))}const _e=[];for(const Q of pe)Q.selected&&_e.push(Ai(Q.id,!1));q(he),V(_e)},setMinZoom:M=>{const{panZoom:I,maxZoom:H}=C();I==null||I.setScaleExtent([M,H]),N({minZoom:M})},setMaxZoom:M=>{const{panZoom:I,minZoom:H}=C();I==null||I.setScaleExtent([H,M]),N({maxZoom:M})},setTranslateExtent:M=>{var I;(I=C().panZoom)==null||I.setTranslateExtent(M),N({translateExtent:M})},resetSelectedElements:()=>{const{edges:M,nodes:I,triggerNodeChanges:H,triggerEdgeChanges:j,elementsSelectable:R}=C();if(!R)return;const q=I.reduce((U,pe)=>pe.selected?[...U,Ai(pe.id,!1)]:U,[]),V=M.reduce((U,pe)=>pe.selected?[...U,Ai(pe.id,!1)]:U,[]);H(q),j(V)},setNodeExtent:M=>{const{nodes:I,nodeLookup:H,parentLookup:j,nodeOrigin:R,elevateNodesOnSelect:q,nodeExtent:V,zIndexMode:U}=C();M[0][0]===V[0][0]&&M[0][1]===V[0][1]&&M[1][0]===V[1][0]&&M[1][1]===V[1][1]||(Tf(I,H,j,{nodeOrigin:R,nodeExtent:M,elevateNodesOnSelect:q,checkEquality:!1,zIndexMode:U}),N({nodeExtent:M}))},panBy:M=>{const{transform:I,width:H,height:j,panZoom:R,translateExtent:q}=C();return F1({delta:M,panZoom:R,transform:I,translateExtent:q,width:H,height:j})},setCenter:async(M,I,H)=>{const{width:j,height:R,maxZoom:q,panZoom:V}=C();if(!V)return Promise.resolve(!1);const U=typeof(H==null?void 0:H.zoom)<"u"?H.zoom:q;return await V.setViewport({x:j/2-M*U,y:R/2-I*U,zoom:U},{duration:H==null?void 0:H.duration,ease:H==null?void 0:H.ease,interpolate:H==null?void 0:H.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{N({connection:{...Wm}})},updateConnection:M=>{N({connection:M})},reset:()=>N({...om()})}},Object.is);function rb({initialNodes:t,initialEdges:r,defaultNodes:i,defaultEdges:a,initialWidth:u,initialHeight:f,initialMinZoom:d,initialMaxZoom:m,initialFitViewOptions:v,fitView:w,nodeOrigin:b,nodeExtent:x,zIndexMode:S,children:N}){const[C]=ce.useState(()=>nb({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,width:u,height:f,fitView:w,minZoom:d,maxZoom:m,fitViewOptions:v,nodeOrigin:b,nodeExtent:x,zIndexMode:S}));return P.jsx(S_,{value:C,children:P.jsx(K_,{children:N})})}function ob({children:t,nodes:r,edges:i,defaultNodes:a,defaultEdges:u,width:f,height:d,fitView:m,fitViewOptions:v,minZoom:w,maxZoom:b,nodeOrigin:x,nodeExtent:S,zIndexMode:N}){return ce.useContext(Tu)?P.jsx(P.Fragment,{children:t}):P.jsx(rb,{initialNodes:r,initialEdges:i,defaultNodes:a,defaultEdges:u,initialWidth:f,initialHeight:d,fitView:m,initialFitViewOptions:v,initialMinZoom:w,initialMaxZoom:b,nodeOrigin:x,nodeExtent:S,zIndexMode:N,children:t})}const ib={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function sb({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,className:u,nodeTypes:f,edgeTypes:d,onNodeClick:m,onEdgeClick:v,onInit:w,onMove:b,onMoveStart:x,onMoveEnd:S,onConnect:N,onConnectStart:C,onConnectEnd:$,onClickConnectStart:M,onClickConnectEnd:I,onNodeMouseEnter:H,onNodeMouseMove:j,onNodeMouseLeave:R,onNodeContextMenu:q,onNodeDoubleClick:V,onNodeDragStart:U,onNodeDrag:pe,onNodeDragStop:he,onNodesDelete:_e,onEdgesDelete:Q,onDelete:le,onSelectionChange:xe,onSelectionDragStart:z,onSelectionDrag:ue,onSelectionDragStop:te,onSelectionContextMenu:ae,onSelectionStart:L,onSelectionEnd:F,onBeforeDelete:X,connectionMode:O,connectionLineType:B=ai.Bezier,connectionLineStyle:ke,connectionLineComponent:Se,connectionLineContainerStyle:Ie,deleteKeyCode:Re="Backspace",selectionKeyCode:Ae="Shift",selectionOnDrag:we=!1,selectionMode:ze=ja.Full,panActivationKeyCode:be="Space",multiSelectionKeyCode:Je=Ma()?"Meta":"Control",zoomActivationKeyCode:Fe=Ma()?"Meta":"Control",snapToGrid:Ve,snapGrid:ct,onlyRenderVisibleElements:nt=!1,selectNodesOnDrag:ft,nodesDraggable:kt,autoPanOnNodeFocus:rn,nodesConnectable:Gt,nodesFocusable:qt,nodeOrigin:Nt=Eg,edgesFocusable:Mn,edgesReconnectable:cn,elementsSelectable:pr=!0,defaultViewport:fn=O_,minZoom:Ct=.5,maxZoom:Wt=2,translateExtent:Hn=Pa,preventScrolling:Jn=!0,nodeExtent:_n,defaultMarkerColor:Yt="#b1b1b7",zoomOnScroll:Sn=!0,zoomOnPinch:hr=!0,panOnScroll:$r=!1,panOnScrollSpeed:bn=.5,panOnScrollMode:qe=Ri.Free,zoomOnDoubleClick:Vn=!0,panOnDrag:kn=!0,onPaneClick:er,onPaneMouseEnter:Be,onPaneMouseMove:In,onPaneMouseLeave:Kn,onPaneScroll:Or,onPaneContextMenu:Rr,paneClickDistance:mr=1,nodeClickDistance:eo=0,children:W,onReconnect:Le,onReconnectStart:Xe,onReconnectEnd:lt,onEdgeContextMenu:Ht,onEdgeDoubleClick:ut,onEdgeMouseEnter:St,onEdgeMouseMove:dn,onEdgeMouseLeave:En,reconnectRadius:pn=10,onNodesChange:Un,onEdgesChange:Mo,noDragClassName:Nn="nodrag",noWheelClassName:Cn="nowheel",noPanClassName:Ft="nopan",fitView:Dr,fitViewOptions:li,connectOnClick:tr,attributionPosition:ui,proOptions:nr,defaultEdgeOptions:ci,elevateNodesOnSelect:Io=!0,elevateEdgesOnSelect:Pt=!1,disableKeyboardA11y:rr=!1,autoPanOnConnect:yt,autoPanOnNodeDrag:Bi,autoPanSpeed:zr,connectionRadius:Ao,isValidConnection:Lr,onError:gr,style:fi,id:or,nodeDragThreshold:Pn,connectionDragThreshold:dt,viewport:hn,onViewportChange:Hi,width:$o,height:to,colorMode:no="light",debug:ro,onScroll:qn,ariaLabelConfig:vt,zIndexMode:Fr="basic",...oo},ir){const Br=or||"1",io=L_(no),sr=ce.useCallback(di=>{di.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),qn==null||qn(di)},[qn]);return P.jsx("div",{"data-testid":"rf__wrapper",...oo,onScroll:sr,style:{...fi,...ib},ref:ir,className:Ut(["react-flow",u,io]),id:or,role:"application",children:P.jsxs(ob,{nodes:t,edges:r,width:$o,height:to,fitView:Dr,fitViewOptions:li,minZoom:Ct,maxZoom:Wt,nodeOrigin:Nt,nodeExtent:_n,zIndexMode:Fr,children:[P.jsx(z_,{nodes:t,edges:r,defaultNodes:i,defaultEdges:a,onConnect:N,onConnectStart:C,onConnectEnd:$,onClickConnectStart:M,onClickConnectEnd:I,nodesDraggable:kt,autoPanOnNodeFocus:rn,nodesConnectable:Gt,nodesFocusable:qt,edgesFocusable:Mn,edgesReconnectable:cn,elementsSelectable:pr,elevateNodesOnSelect:Io,elevateEdgesOnSelect:Pt,minZoom:Ct,maxZoom:Wt,nodeExtent:_n,onNodesChange:Un,onEdgesChange:Mo,snapToGrid:Ve,snapGrid:ct,connectionMode:O,translateExtent:Hn,connectOnClick:tr,defaultEdgeOptions:ci,fitView:Dr,fitViewOptions:li,onNodesDelete:_e,onEdgesDelete:Q,onDelete:le,onNodeDragStart:U,onNodeDrag:pe,onNodeDragStop:he,onSelectionDrag:ue,onSelectionDragStart:z,onSelectionDragStop:te,onMove:b,onMoveStart:x,onMoveEnd:S,noPanClassName:Ft,nodeOrigin:Nt,rfId:Br,autoPanOnConnect:yt,autoPanOnNodeDrag:Bi,autoPanSpeed:zr,onError:gr,connectionRadius:Ao,isValidConnection:Lr,selectNodesOnDrag:ft,nodeDragThreshold:Pn,connectionDragThreshold:dt,onBeforeDelete:X,debug:ro,ariaLabelConfig:vt,zIndexMode:Fr}),P.jsx(tb,{onInit:w,onNodeClick:m,onEdgeClick:v,onNodeMouseEnter:H,onNodeMouseMove:j,onNodeMouseLeave:R,onNodeContextMenu:q,onNodeDoubleClick:V,nodeTypes:f,edgeTypes:d,connectionLineType:B,connectionLineStyle:ke,connectionLineComponent:Se,connectionLineContainerStyle:Ie,selectionKeyCode:Ae,selectionOnDrag:we,selectionMode:ze,deleteKeyCode:Re,multiSelectionKeyCode:Je,panActivationKeyCode:be,zoomActivationKeyCode:Fe,onlyRenderVisibleElements:nt,defaultViewport:fn,translateExtent:Hn,minZoom:Ct,maxZoom:Wt,preventScrolling:Jn,zoomOnScroll:Sn,zoomOnPinch:hr,zoomOnDoubleClick:Vn,panOnScroll:$r,panOnScrollSpeed:bn,panOnScrollMode:qe,panOnDrag:kn,onPaneClick:er,onPaneMouseEnter:Be,onPaneMouseMove:In,onPaneMouseLeave:Kn,onPaneScroll:Or,onPaneContextMenu:Rr,paneClickDistance:mr,nodeClickDistance:eo,onSelectionContextMenu:ae,onSelectionStart:L,onSelectionEnd:F,onReconnect:Le,onReconnectStart:Xe,onReconnectEnd:lt,onEdgeContextMenu:Ht,onEdgeDoubleClick:ut,onEdgeMouseEnter:St,onEdgeMouseMove:dn,onEdgeMouseLeave:En,reconnectRadius:pn,defaultMarkerColor:Yt,noDragClassName:Nn,noWheelClassName:Cn,noPanClassName:Ft,rfId:Br,disableKeyboardA11y:rr,nodeExtent:_n,viewport:hn,onViewportChange:Hi}),P.jsx($_,{onSelectionChange:xe}),W,P.jsx(j_,{proOptions:nr,position:ui}),P.jsx(P_,{rfId:Br,disableKeyboardA11y:rr})]})})}var ab=jg(sb);function lb(){const t=It();return ce.useCallback(r=>{const{domNode:i,updateNodeInternals:a}=t.getState(),u=Array.isArray(r)?r:[r],f=new Map;u.forEach(d=>{const m=i==null?void 0:i.querySelector(`.react-flow__node[data-id="${d}"]`);m&&f.set(d,{id:d,nodeElement:m,force:!0})}),requestAnimationFrame(()=>a(f,{triggerFitView:!1}))},[])}function ub(t){const[r,i]=ce.useState(t),a=ce.useCallback(u=>i(f=>Cg(u,f)),[]);return[r,i,a]}function cb(t){const[r,i]=ce.useState(t),a=ce.useCallback(u=>i(f=>Pg(u,f)),[]);return[r,i,a]}function fb({dimensions:t,lineWidth:r,variant:i,className:a}){return P.jsx("path",{strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:Ut(["react-flow__background-pattern",i,a])})}function db({radius:t,className:r}){return P.jsx("circle",{cx:t,cy:t,r:t,className:Ut(["react-flow__background-pattern","dots",r])})}var Po;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Po||(Po={}));const pb={[Po.Dots]:1,[Po.Lines]:1,[Po.Cross]:6},hb=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function Jg({id:t,variant:r=Po.Dots,gap:i=20,size:a,lineWidth:u=1,offset:f=0,color:d,bgColor:m,style:v,className:w,patternClassName:b}){const x=ce.useRef(null),{transform:S,patternId:N}=gt(hb,Ot),C=a||pb[r],$=r===Po.Dots,M=r===Po.Cross,I=Array.isArray(i)?i:[i,i],H=[I[0]*S[2]||1,I[1]*S[2]||1],j=C*S[2],R=Array.isArray(f)?f:[f,f],q=M?[j,j]:H,V=[R[0]*S[2]||1+q[0]/2,R[1]*S[2]||1+q[1]/2],U=`${N}${t||""}`;return P.jsxs("svg",{className:Ut(["react-flow__background",w]),style:{...v,...Mu,"--xy-background-color-props":m,"--xy-background-pattern-color-props":d},ref:x,"data-testid":"rf__background",children:[P.jsx("pattern",{id:U,x:S[0]%H[0],y:S[1]%H[1],width:H[0],height:H[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${V[0]},-${V[1]})`,children:$?P.jsx(db,{radius:j/2,className:b}):P.jsx(fb,{dimensions:q,lineWidth:u,variant:r,className:b})}),P.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${U})`})]})}Jg.displayName="Background";const mb=ce.memo(Jg);function gb(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:P.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function yb(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:P.jsx("path",{d:"M0 0h32v4.2H0z"})})}function vb(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:P.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function xb(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:P.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function wb(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:P.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Zl({children:t,className:r,...i}){return P.jsx("button",{type:"button",className:Ut(["react-flow__controls-button",r]),...i,children:t})}const _b=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function ey({style:t,showZoom:r=!0,showFitView:i=!0,showInteractive:a=!0,fitViewOptions:u,onZoomIn:f,onZoomOut:d,onFitView:m,onInteractiveChange:v,className:w,children:b,position:x="bottom-left",orientation:S="vertical","aria-label":N}){const C=It(),{isInteractive:$,minZoomReached:M,maxZoomReached:I,ariaLabelConfig:H}=gt(_b,Ot),{zoomIn:j,zoomOut:R,fitView:q}=Gf(),V=()=>{j(),f==null||f()},U=()=>{R(),d==null||d()},pe=()=>{q(u),m==null||m()},he=()=>{C.setState({nodesDraggable:!$,nodesConnectable:!$,elementsSelectable:!$}),v==null||v(!$)},_e=S==="horizontal"?"horizontal":"vertical";return P.jsxs(Fa,{className:Ut(["react-flow__controls",_e,w]),position:x,style:t,"data-testid":"rf__controls","aria-label":N??H["controls.ariaLabel"],children:[r&&P.jsxs(P.Fragment,{children:[P.jsx(Zl,{onClick:V,className:"react-flow__controls-zoomin",title:H["controls.zoomIn.ariaLabel"],"aria-label":H["controls.zoomIn.ariaLabel"],disabled:I,children:P.jsx(gb,{})}),P.jsx(Zl,{onClick:U,className:"react-flow__controls-zoomout",title:H["controls.zoomOut.ariaLabel"],"aria-label":H["controls.zoomOut.ariaLabel"],disabled:M,children:P.jsx(yb,{})})]}),i&&P.jsx(Zl,{className:"react-flow__controls-fitview",onClick:pe,title:H["controls.fitView.ariaLabel"],"aria-label":H["controls.fitView.ariaLabel"],children:P.jsx(vb,{})}),a&&P.jsx(Zl,{className:"react-flow__controls-interactive",onClick:he,title:H["controls.interactive.ariaLabel"],"aria-label":H["controls.interactive.ariaLabel"],children:$?P.jsx(wb,{}):P.jsx(xb,{})}),b]})}ey.displayName="Controls";const Sb=ce.memo(ey);function bb({id:t,x:r,y:i,width:a,height:u,style:f,color:d,strokeColor:m,strokeWidth:v,className:w,borderRadius:b,shapeRendering:x,selected:S,onClick:N}){const{background:C,backgroundColor:$}=f||{},M=d||C||$;return P.jsx("rect",{className:Ut(["react-flow__minimap-node",{selected:S},w]),x:r,y:i,rx:b,ry:b,width:a,height:u,style:{fill:M,stroke:m,strokeWidth:v},shapeRendering:x,onClick:N?I=>N(I,t):void 0})}const kb=ce.memo(bb),Eb=t=>t.nodes.map(r=>r.id),pf=t=>t instanceof Function?t:()=>t;function Nb({nodeStrokeColor:t,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:u,nodeComponent:f=kb,onClick:d}){const m=gt(Eb,Ot),v=pf(r),w=pf(t),b=pf(i),x=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return P.jsx(P.Fragment,{children:m.map(S=>P.jsx(Pb,{id:S,nodeColorFunc:v,nodeStrokeColorFunc:w,nodeClassNameFunc:b,nodeBorderRadius:a,nodeStrokeWidth:u,NodeComponent:f,onClick:d,shapeRendering:x},S))})}function Cb({id:t,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:a,nodeBorderRadius:u,nodeStrokeWidth:f,shapeRendering:d,NodeComponent:m,onClick:v}){const{node:w,x:b,y:x,width:S,height:N}=gt(C=>{const $=C.nodeLookup.get(t);if(!$)return{node:void 0,x:0,y:0,width:0,height:0};const M=$.internals.userNode,{x:I,y:H}=$.internals.positionAbsolute,{width:j,height:R}=To(M);return{node:M,x:I,y:H,width:j,height:R}},Ot);return!w||w.hidden||!eg(w)?null:P.jsx(m,{x:b,y:x,width:S,height:N,style:w.style,selected:!!w.selected,className:a(w),color:r(w),borderRadius:u,strokeColor:i(w),strokeWidth:f,shapeRendering:d,onClick:v,id:w.id})}const Pb=ce.memo(Cb);var jb=ce.memo(Nb);const Tb=200,Mb=150,Ib=t=>!t.hidden,Ab=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?Jm(Da(t.nodeLookup,{filter:Ib}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},$b="react-flow__minimap-desc";function ty({style:t,className:r,nodeStrokeColor:i,nodeColor:a,nodeClassName:u="",nodeBorderRadius:f=5,nodeStrokeWidth:d,nodeComponent:m,bgColor:v,maskColor:w,maskStrokeColor:b,maskStrokeWidth:x,position:S="bottom-right",onClick:N,onNodeClick:C,pannable:$=!1,zoomable:M=!1,ariaLabel:I,inversePan:H,zoomStep:j=1,offsetScale:R=5}){const q=It(),V=ce.useRef(null),{boundingRect:U,viewBB:pe,rfId:he,panZoom:_e,translateExtent:Q,flowWidth:le,flowHeight:xe,ariaLabelConfig:z}=gt(Ab,Ot),ue=(t==null?void 0:t.width)??Tb,te=(t==null?void 0:t.height)??Mb,ae=U.width/ue,L=U.height/te,F=Math.max(ae,L),X=F*ue,O=F*te,B=R*F,ke=U.x-(X-U.width)/2-B,Se=U.y-(O-U.height)/2-B,Ie=X+B*2,Re=O+B*2,Ae=`${$b}-${he}`,we=ce.useRef(0),ze=ce.useRef();we.current=F,ce.useEffect(()=>{if(V.current&&_e)return ze.current=X1({domNode:V.current,panZoom:_e,getTransform:()=>q.getState().transform,getViewScale:()=>we.current}),()=>{var Ve;(Ve=ze.current)==null||Ve.destroy()}},[_e]),ce.useEffect(()=>{var Ve;(Ve=ze.current)==null||Ve.update({translateExtent:Q,width:le,height:xe,inversePan:H,pannable:$,zoomStep:j,zoomable:M})},[$,M,H,j,Q,le,xe]);const be=N?Ve=>{var ft;const[ct,nt]=((ft=ze.current)==null?void 0:ft.pointer(Ve))||[0,0];N(Ve,{x:ct,y:nt})}:void 0,Je=C?ce.useCallback((Ve,ct)=>{const nt=q.getState().nodeLookup.get(ct).internals.userNode;C(Ve,nt)},[]):void 0,Fe=I??z["minimap.ariaLabel"];return P.jsx(Fa,{position:S,style:{...t,"--xy-minimap-background-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-background-color-props":typeof w=="string"?w:void 0,"--xy-minimap-mask-stroke-color-props":typeof b=="string"?b:void 0,"--xy-minimap-mask-stroke-width-props":typeof x=="number"?x*F:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof d=="number"?d:void 0},className:Ut(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:P.jsxs("svg",{width:ue,height:te,viewBox:`${ke} ${Se} ${Ie} ${Re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Ae,ref:V,onClick:be,children:[Fe&&P.jsx("title",{id:Ae,children:Fe}),P.jsx(jb,{onClick:Je,nodeColor:a,nodeStrokeColor:i,nodeBorderRadius:f,nodeClassName:u,nodeStrokeWidth:d,nodeComponent:m}),P.jsx("path",{className:"react-flow__minimap-mask",d:`M${ke-B},${Se-B}h${Ie+B*2}v${Re+B*2}h${-Ie-B*2}z
|
|
202
|
+
M${pe.x},${pe.y}h${pe.width}v${pe.height}h${-pe.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ty.displayName="MiniMap";const Ob=ce.memo(ty),Rb=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,Db={[Os.Line]:"right",[Os.Handle]:"bottom-right"};function zb({nodeId:t,position:r,variant:i=Os.Handle,className:a,style:u=void 0,children:f,color:d,minWidth:m=10,minHeight:v=10,maxWidth:w=Number.MAX_VALUE,maxHeight:b=Number.MAX_VALUE,keepAspectRatio:x=!1,resizeDirection:S,autoScale:N=!0,shouldResize:C,onResizeStart:$,onResize:M,onResizeEnd:I}){const H=Ag(),j=typeof t=="string"?t:H,R=It(),q=ce.useRef(null),V=i===Os.Handle,U=gt(ce.useCallback(Rb(V&&N),[V,N]),Ot),pe=ce.useRef(null),he=r??Db[i];ce.useEffect(()=>{if(!(!q.current||!j))return pe.current||(pe.current=u_({domNode:q.current,nodeId:j,getStoreItems:()=>{const{nodeLookup:Q,transform:le,snapGrid:xe,snapToGrid:z,nodeOrigin:ue,domNode:te}=R.getState();return{nodeLookup:Q,transform:le,snapGrid:xe,snapToGrid:z,nodeOrigin:ue,paneDomNode:te}},onChange:(Q,le)=>{const{triggerNodeChanges:xe,nodeLookup:z,parentLookup:ue,nodeOrigin:te}=R.getState(),ae=[],L={x:Q.x,y:Q.y},F=z.get(j);if(F&&F.expandParent&&F.parentId){const X=F.origin??te,O=Q.width??F.measured.width??0,B=Q.height??F.measured.height??0,ke={id:F.id,parentId:F.parentId,rect:{width:O,height:B,...tg({x:Q.x??F.position.x,y:Q.y??F.position.y},{width:O,height:B},F.parentId,z,X)}},Se=Qf([ke],z,ue,te);ae.push(...Se),L.x=Q.x?Math.max(X[0]*O,Q.x):void 0,L.y=Q.y?Math.max(X[1]*B,Q.y):void 0}if(L.x!==void 0&&L.y!==void 0){const X={id:j,type:"position",position:{...L}};ae.push(X)}if(Q.width!==void 0&&Q.height!==void 0){const O={id:j,type:"dimensions",resizing:!0,setAttributes:S?S==="horizontal"?"width":"height":!0,dimensions:{width:Q.width,height:Q.height}};ae.push(O)}for(const X of le){const O={...X,type:"position"};ae.push(O)}xe(ae)},onEnd:({width:Q,height:le})=>{const xe={id:j,type:"dimensions",resizing:!1,dimensions:{width:Q,height:le}};R.getState().triggerNodeChanges([xe])}})),pe.current.update({controlPosition:he,boundaries:{minWidth:m,minHeight:v,maxWidth:w,maxHeight:b},keepAspectRatio:x,resizeDirection:S,onResizeStart:$,onResize:M,onResizeEnd:I,shouldResize:C}),()=>{var Q;(Q=pe.current)==null||Q.destroy()}},[he,m,v,w,b,x,$,M,I,C]);const _e=he.split("-");return P.jsx("div",{className:Ut(["react-flow__resize-control","nodrag",..._e,i,a]),ref:q,style:{...u,scale:U,...d&&{[V?"backgroundColor":"borderColor"]:d}},children:f})}ce.memo(zb);function Jf(t,r,i){var f,d;const a=r.toLowerCase(),u=(d=(f=t.paths)==null?void 0:f[i])==null?void 0:d[a];return(u==null?void 0:u.summary)??(u==null?void 0:u.operationId)??`${r.toUpperCase()} ${i}`}function ed(t,r,i){var m,v,w,b;const a=r.toLowerCase(),u=(v=(m=t.paths)==null?void 0:m[i])==null?void 0:v[a];if(!(u!=null&&u.requestBody))return"— sin body";const d=(b=(w=u.requestBody.content)==null?void 0:w["application/json"])==null?void 0:b.schema;return d&&"$ref"in d?`body: ${d.$ref}`:"body: JSON"}function td(t,r,i){var m,v,w,b,x,S;const a=r.toLowerCase(),u=(v=(m=t.paths)==null?void 0:m[i])==null?void 0:v[a],f=((w=u==null?void 0:u.responses)==null?void 0:w["200"])??((b=u==null?void 0:u.responses)==null?void 0:b["201"]);if(!f)return"—";const d=typeof f=="object"&&f&&"content"in f?(S=(x=f.content)==null?void 0:x["application/json"])==null?void 0:S.schema:void 0;return d&&"$ref"in d?String(d.$ref):"JSON"}const iu=()=>({sourceJsonPath:"$",variableName:"v",useInTarget:"vars_only",targetKey:""});function hf(t,r){return`${t.toLowerCase()} ${r}`}function Lb(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}const ny=ce.createContext(null);function Fb(t){const{id:r,selected:i}=t,a=t.data,u=ce.useContext(ny),f=lb();return ce.useEffect(()=>{f(r)},[a.path,a.method,r,f]),P.jsxs("div",{className:`rounded-xl border bg-surface-950/90 px-3 py-2 min-w-[200px] max-w-[280px] shadow-lg ${i?"border-accent ring-2 ring-accent/40":"border-surface-600"}`,children:[P.jsx(Rs,{type:"target",position:Ze.Left,id:"in",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-teal-500"}),P.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[P.jsx("span",{className:"text-[10px] uppercase font-bold text-accent tracking-wide",children:a.method}),P.jsx("span",{className:"text-[10px] text-slate-500 truncate",title:a.summary,children:a.summary})]}),u?P.jsxs("label",{className:"block text-[10px] text-slate-500 mb-1",children:["Endpoint",P.jsx("select",{className:"mt-0.5 w-full bg-surface-900 border border-surface-600 rounded px-1.5 py-1 text-[11px] font-mono",value:hf(a.method,a.path),onChange:d=>{const{method:m,path:v}=Lb(d.target.value);u.updateNodeData(r,{method:m,path:v,summary:Jf(u.doc,m,v),reqHint:ed(u.doc,m,v),resHint:td(u.doc,m,v)})},children:u.ops.map(d=>P.jsxs("option",{value:hf(d.method,d.path),children:[d.method.toUpperCase()," ",d.path]},hf(d.method,d.path)))})]}):P.jsx("p",{className:"font-mono text-[11px] text-slate-300 truncate",children:a.path}),P.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-1 text-[9px] text-slate-500 leading-tight",children:[P.jsxs("div",{children:[P.jsx("span",{className:"text-slate-600",children:"req"})," ",a.reqHint]}),P.jsxs("div",{children:[P.jsx("span",{className:"text-slate-600",children:"res"})," ",a.resHint]})]}),P.jsx(Rs,{type:"source",position:Ze.Right,id:"out",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-amber-500"})]})}const Bb={apiOp:Fb};function Hb(t,r){const i=r.nodes.map(u=>({id:u.id,type:"apiOp",position:{x:u.x,y:u.y},data:{method:u.method.toLowerCase(),path:u.path,summary:Jf(t,u.method,u.path),reqHint:ed(t,u.method,u.path),resHint:td(t,u.method,u.path)}})),a=r.edges.map(u=>({id:u.id,source:u.source,target:u.target,sourceHandle:"out",targetHandle:"in",data:{mapping:{...u.mapping}},label:u.mapping.variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}}));return{nodes:i,edges:a}}function Vb(t,r){return{nodes:t.map(i=>({id:i.id,method:i.data.method,path:i.data.path,x:i.position.x,y:i.position.y})),edges:r.map(i=>{var a;return{id:i.id,source:i.source,target:i.target,mapping:((a=i.data)==null?void 0:a.mapping)??iu()}})}}const Kb=[{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 Ub({doc:t,ops:r,graph:i,onGraphChange:a}){var j,R,q,V,U,pe,he,_e;const u=ce.useMemo(()=>Hb(t,i),[t,i]),[f,d,m]=ub(u.nodes),[v,w,b]=cb(u.edges),[x,S]=ce.useState(null);ce.useEffect(()=>{a(Vb(f,v))},[f,v,a]);const N=ce.useCallback((Q,le)=>{d(xe=>xe.map(z=>z.id===Q?{...z,data:{...z.data,...le}}:z))},[d]),C=ce.useMemo(()=>({doc:t,ops:r,updateNodeData:N}),[t,r,N]),$=ce.useCallback(Q=>{Q.sourceHandle!=="out"||Q.targetHandle!=="in"||w(le=>lg({...Q,id:`e-${Q.source}-${Q.target}-${crypto.randomUUID().slice(0,8)}`,sourceHandle:"out",targetHandle:"in",data:{mapping:iu()},label:iu().variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}},le))},[w]),M=v.find(Q=>Q.id===x),I=Q=>{x&&w(le=>le.map(xe=>{var ue;if(xe.id!==x)return xe;const z={...((ue=xe.data)==null?void 0:ue.mapping)??iu(),...Q};return{...xe,data:{mapping:z},label:z.variableName}}))},H=()=>{const Q=f.reduce((ae,L)=>L.position.x>ae?L.position.x:ae,0),le=r[0];if(!le)return;const xe=crypto.randomUUID(),z=Q>0?Q+40:80,te={id:xe,type:"apiOp",position:{x:z,y:120},data:{method:le.method.toLowerCase(),path:le.path,summary:Jf(t,le.method,le.path),reqHint:ed(t,le.method,le.path),resHint:td(t,le.method,le.path)}};d(ae=>[...ae,te])};return P.jsx(ny.Provider,{value:C,children:P.jsxs("div",{className:"space-y-3",children:[P.jsx("div",{className:"h-[min(520px,70vh)] w-full rounded-xl border border-surface-700 bg-surface-950",children:P.jsxs(ab,{nodes:f,edges:v,onNodesChange:m,onEdgesChange:b,onConnect:$,nodeTypes:Bb,onEdgeClick:(Q,le)=>S(le.id),onPaneClick:()=>S(null),fitView:!0,minZoom:.4,maxZoom:1.5,proOptions:{hideAttribution:!0},isValidConnection:Q=>Q.sourceHandle==="out"&&Q.targetHandle==="in",children:[P.jsx(mb,{variant:Po.Dots,gap:16,size:1,color:"rgb(51 65 85 / 0.5)"}),P.jsx(Sb,{className:"!bg-surface-900 !border-surface-600 !shadow-lg"}),P.jsx(Ob,{className:"!bg-surface-900/95 !border-surface-600",nodeColor:()=>"rgb(45 212 191 / 0.5)"}),P.jsx(Fa,{position:"top-left",children:P.jsx("button",{type:"button",onClick:H,className:"text-xs px-3 py-2 rounded-lg bg-accent/90 text-surface-950 font-medium shadow",children:"+ Nodo (endpoint)"})})]})}),P.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[P.jsx("h4",{className:"text-xs font-semibold text-slate-300",children:"Cable seleccionado (respuesta → request)"}),M?P.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs",children:[P.jsxs("label",{className:"text-slate-500",children:["JSON path en la respuesta",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((j=M.data)==null?void 0:j.mapping.sourceJsonPath)??"$",onChange:Q=>I({sourceJsonPath:Q.target.value}),placeholder:"$.access_token"})]}),P.jsxs("label",{className:"text-slate-500",children:["Nombre de variable",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((R=M.data)==null?void 0:R.mapping.variableName)??"",onChange:Q=>I({variableName:Q.target.value}),placeholder:"token"})]}),P.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Cómo se usa en el request del nodo destino",P.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((q=M.data)==null?void 0:q.mapping.useInTarget)??"vars_only",onChange:Q=>I({useInTarget:Q.target.value}),children:Kb.map(Q=>P.jsx("option",{value:Q.value,children:Q.label},Q.value))})]}),(((V=M.data)==null?void 0:V.mapping.useInTarget)==="path_param"||((U=M.data)==null?void 0:U.mapping.useInTarget)==="header"||((pe=M.data)==null?void 0:pe.mapping.useInTarget)==="query")&&P.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Clave (nombre del param / header / query)",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((he=M.data)==null?void 0:he.mapping.targetKey)??"",onChange:Q=>I({targetKey:Q.target.value}),placeholder:"id / Authorization / q"})]}),P.jsxs("p",{className:"sm:col-span-2 text-[11px] text-slate-500 leading-relaxed",children:["El valor extraído se guarda en la variable y, según la opción, se inyecta en la ruta"," ",P.jsx("code",{className:"text-accent",children:"{clave}"}),", en un header, o en query. Con «solo variable», usa"," ",P.jsx("code",{className:"text-accent",children:"{"+(((_e=M.data)==null?void 0:_e.mapping.variableName)||"var")+"}"})," ","en la ruta del endpoint destino."]})]}):P.jsx("p",{className:"text-xs text-slate-500",children:"Conecta la salida derecha (res) de un nodo con la entrada izquierda (req) de otro. Haz clic en un cable para definir el mapeo."})]})]})})}function ry(t,r){const i=new Map(t.map(v=>[v.id,v])),a=new Set(t.map(v=>v.id)),u=new Map,f=new Map;for(const v of a)u.set(v,0),f.set(v,[]);for(const v of r)!a.has(v.source)||!a.has(v.target)||(u.set(v.target,(u.get(v.target)??0)+1),f.get(v.source).push(v.target));const d=[];for(const[v,w]of u)w===0&&d.push(v);d.sort((v,w)=>i.get(v).x-i.get(w).x||i.get(v).y-i.get(w).y);const m=[];for(;d.length;){const v=d.shift();m.push(v);for(const w of f.get(v)??[]){const b=(u.get(w)??0)-1;u.set(w,b),b===0&&(d.push(w),d.sort((x,S)=>i.get(x).x-i.get(S).x||i.get(x).y-i.get(S).y))}}if(m.length<t.length){const v=t.filter(w=>!m.includes(w.id)).sort((w,b)=>w.x-b.x||w.y-b.y);return[...m.map(w=>i.get(w)),...v]}return m.map(v=>i.get(v))}async function im(t,r,i){var v;const{nodes:a,edges:u}=t;if(a.length===0)return"Sin nodos en el flujo.";const f=ry(a,u),d={};let m="";for(let w=0;w<f.length;w++){const b=f[w];let x=b.path;const S={...i()},N=u.filter(q=>q.target===b.id);for(const q of N){const{mapping:V}=q,U=d[V.variableName];if(U!==void 0)switch(V.useInTarget){case"path_param":V.targetKey&&(x=x.split(`{${V.targetKey}}`).join(U));break;case"header":if(V.targetKey){const pe=V.targetKey;S[pe]=pe.toLowerCase()==="authorization"&&!U.startsWith("Bearer ")?`Bearer ${U}`:U}break;case"query":{const pe=x.includes("?")?"&":"?";x=`${x}${pe}${encodeURIComponent(V.targetKey)}=${encodeURIComponent(U)}`;break}case"vars_only":default:x=x.split(`{${V.variableName}}`).join(U);break}}for(const[q,V]of Object.entries(d))x=x.split(`{${q}}`).join(V);const C=`${r.replace(/\/$/,"")}${x}`,$={method:b.method.toUpperCase(),headers:S},M=b.method.toLowerCase();M!=="get"&&M!=="head"&&($.body="{}");const I=await fetch(C,$);let H={};const j=await I.text();try{H=j?JSON.parse(j):{}}catch{H={_raw:j}}m+=`▸ ${b.method.toUpperCase()} ${b.path} → ${I.status}
|
|
203
|
+
${JSON.stringify(H,null,2)}
|
|
204
|
+
|
|
205
|
+
`;const R=u.filter(q=>q.source===b.id);for(const q of R){const V=((v=q.mapping.sourceJsonPath)==null?void 0:v.trim())||"$",U=$f(H,V);U!=null&&(d[q.mapping.variableName]=typeof U=="object"?JSON.stringify(U):String(U))}}return m+=`
|
|
206
|
+
Variables finales: ${JSON.stringify(d,null,2)}`,m}function qb(t){const r=ry(t.nodes,t.edges);return r.map((i,a)=>{const u=r[a+1];if(!u)return{method:i.method,path:i.path};const f=t.edges.find(d=>d.source===i.id&&d.target===u.id);return f?{method:i.method,path:i.path,extract:{varName:f.mapping.variableName,jsonPath:f.mapping.sourceJsonPath||"$"}}:{method:i.method,path:i.path}})}function Wb(t){var a;const r=t.map((u,f)=>({id:`n-${f}`,method:u.method,path:u.path,x:40+f*300,y:120})),i=[];for(let u=0;u<t.length-1;u++){const f=(a=t[u])==null?void 0:a.extract;f!=null&&f.jsonPath&&i.push({id:`e-${u}`,source:`n-${u}`,target:`n-${u+1}`,mapping:{sourceJsonPath:f.jsonPath,variableName:f.varName,useInTarget:"vars_only",targetKey:""}})}return{nodes:r,edges:i}}const oy=ce.createContext({productName:null,logoDataUrl:null});function Yb({value:t,children:r}){return P.jsx(oy.Provider,{value:t,children:r})}function Xb(){return ce.useContext(oy)}const iy=[{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 sm(t){return iy.some(r=>r.value===t)}const mf=[{id:"typescript",label:"TypeScript"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"php",label:"PHP"}];function gf(t,r){return`${t.toLowerCase()} ${r}`}function Qb(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}async function am(t){await navigator.clipboard.writeText(t)}function Gb(){var eo;const t=Xb(),[r,i]=ce.useState(null),[a,u]=ce.useState(null),[f,d]=ce.useState("explore"),[m,v]=ce.useState(""),[w,b]=ce.useState(null),[x,S]=ce.useState(null),[N,C]=ce.useState("{}"),[$,M]=ce.useState(""),[I,H]=ce.useState("typescript"),[j,R]=ce.useState(""),[q,V]=ce.useState(""),[U,pe]=ce.useState("X-Api-Key"),[he,_e]=ce.useState({nodes:[],edges:[]}),[Q,le]=ce.useState(0),[xe,z]=ce.useState("Mi flujo"),[ue,te]=ce.useState([]),[ae,L]=ce.useState(""),[F,X]=ce.useState({name:"Suite 1",cases:[]}),[O,B]=ce.useState([]),[ke,Se]=ce.useState(""),[Ie,Re]=ce.useState(""),[Ae,we]=ce.useState(null),[ze,be]=ce.useState(null),Je="/docs/openapi.json",Fe="/docs/preset.json",Ve=ce.useCallback(async()=>{const[W,Le]=await Promise.all([bt.flows.toArray(),bt.testSuites.toArray()]);te(W.sort((Xe,lt)=>(Xe.name??"").localeCompare(lt.name??""))),B(Le.sort((Xe,lt)=>(Xe.name??"").localeCompare(lt.name??"")))},[]);ce.useEffect(()=>{var Le,Xe;if(!r)return;const W=((Le=t.productName)==null?void 0:Le.trim())||((Xe=r.info.title)==null?void 0:Xe.trim())||"API";document.title=W},[r,t.productName]),ce.useEffect(()=>{fetch(Je).then(W=>{if(!W.ok)throw new Error(`${W.status} ${W.statusText}`);return W.json()}).then(W=>{i(W),v(Ss(W)),u(null)}).catch(W=>u(W.message))},[Je]),ce.useEffect(()=>{if(!r)return;let W=!1;return(async()=>{try{const Le=await fetch(Fe);if(!Le.ok||W)return;const Xe=await Le.json(),lt=await M0(Xe);!W&<&&await Ve()}catch{}})(),()=>{W=!0}},[r,Fe,Ve]),ce.useEffect(()=>{Ve(),bt.kv.get("bearer").then(W=>W&&R(W.value)),bt.kv.get("apiKey").then(W=>W&&V(W.value))},[Ve]);const ct=ce.useMemo(()=>r?k0(r):[],[r]),nt=ce.useMemo(()=>r?Zr(r):[],[r]),ft=ce.useMemo(()=>w?nt.filter(W=>(W.tags??["default"]).includes(w)):nt,[nt,w]);ce.useEffect(()=>{if(nt.length&&!Ie){const W=nt[0];Re(gf(W.method,W.path))}},[nt,Ie]),ce.useEffect(()=>{if(nt.length===0||he.nodes.length>0||f!=="flows"||Ae!=null)return;const W=nt[0];_e({nodes:[{id:crypto.randomUUID(),method:W.method.toLowerCase(),path:W.path,x:80,y:120}],edges:[]}),le(Le=>Le+1)},[nt,he.nodes.length,f,Ae]);const kt=ce.useCallback(()=>{const W={"Content-Type":"application/json"};return j.trim()&&(W.Authorization=`Bearer ${j.trim()}`),q.trim()&&(W[U]=q.trim()),W},[j,q,U]),rn=ce.useMemo(()=>{if(!r||!x)return null;const W={};for(const{id:Le}of mf)W[Le]=_0(r,Le,x.method,x.path);return W},[r,x]),Gt=ce.useMemo(()=>r?b0(r,I,w):"",[r,I,w]),qt=async()=>{if(!r||!x)return;const W=`${Ss(r,m)}${x.path}`,Le={method:x.method.toUpperCase(),headers:kt()},Xe=x.method.toLowerCase();Xe!=="get"&&Xe!=="head"&&(Le.body=N.trim()?N:"{}");const lt=await fetch(W,Le),Ht=await lt.text();M(`${lt.status} ${lt.statusText}
|
|
207
|
+
|
|
208
|
+
${Ht}`)},Nt=async W=>{var Ht;if(!r)return"";const Le={};let Xe="";const lt=Ss(r,m);for(let ut=0;ut<W.length;ut++){const St=W[ut];let dn=St.path;for(const[Cn,Ft]of Object.entries(Le))dn=dn.replace(`{${Cn}}`,Ft);const En=`${lt}${dn}`,pn={method:St.method.toUpperCase(),headers:kt()},Un=St.method.toLowerCase();Un!=="get"&&Un!=="head"&&(pn.body="{}");const Mo=await fetch(En,pn),Nn=await Mo.json().catch(()=>({}));if(Xe+=`Paso ${ut+1}: ${Mo.status}
|
|
209
|
+
${JSON.stringify(Nn,null,2)}
|
|
210
|
+
|
|
211
|
+
`,(Ht=St.extract)!=null&&Ht.jsonPath){const Cn=$f(Nn,St.extract.jsonPath);Cn!==void 0&&(Le[St.extract.varName]=String(Cn))}}return Xe},Mn=async()=>{if(!r)return;const W=Ss(r,m);if(he.nodes.length===0){L("Añade al menos un nodo al flujo.");return}const Le=await im(he,W,kt);L(Le)},cn=async W=>{if(!r)return;const Le=Ss(r,m),Xe=W.graph&&W.graph.nodes.length>0?await im(W.graph,Le,kt):await Nt(W.steps);L(Xe),d("flows")},pr=W=>{z(W.name),_e(W.graph&&W.graph.nodes.length>0?W.graph:Wb(W.steps.length?W.steps:[{method:"get",path:"/"}])),le(Le=>Le+1),we(W.id??null),d("flows")},fn=()=>{we(null),z("Nuevo flujo"),nt[0]?_e({nodes:[{id:crypto.randomUUID(),method:nt[0].method.toLowerCase(),path:nt[0].path,x:80,y:120}],edges:[]}):_e({nodes:[],edges:[]}),le(W=>W+1)},Ct=ce.useCallback(W=>{_e(W)},[]),Wt=async()=>{const W=qb(he);if(Ae!=null)await bt.flows.update(Ae,{name:xe,steps:W,graph:he});else{const Le=await bt.flows.add({name:xe,steps:W,graph:he});we(Le)}await Ve()},Hn=async W=>{W!==void 0&&(W===Ae&&(we(null),fn()),await bt.flows.delete(W),await Ve())},Jn=()=>{if(!Ie)return;const{method:W,path:Le}=Qb(Ie),Xe={id:crypto.randomUUID(),method:W,path:Le,expectStatus:200,contains:void 0,jsonPath:void 0,expectJsonValue:void 0};X(lt=>({...lt,cases:[...lt.cases,Xe]}))},_n=W=>{X(Le=>({...Le,cases:Le.cases.filter(Xe=>Xe.id!==W)}))},Yt=(W,Le)=>{X(Xe=>({...Xe,cases:Xe.cases.map(lt=>lt.id===W?{...lt,...Le}:lt)}))},Sn=async W=>{if(!r)return"";const Le=Ss(r,m);let Xe="";for(const lt of W){const Ht=`${Le}${lt.path}`,ut=await fetch(Ht,{method:lt.method.toUpperCase(),headers:kt()}),St=await ut.text(),dn=I0(lt,ut.status,St),En=`${dn.pass?"PASS":"FAIL"} ${lt.method.toUpperCase()} ${lt.path}`;Xe+=`${En}
|
|
212
|
+
${dn.lines.map(pn=>` ${pn}`).join(`
|
|
213
|
+
`)}
|
|
214
|
+
|
|
215
|
+
`}return Xe},hr=async()=>{const W=await Sn(F.cases);Se(W)},$r=async()=>{if(!r||O.length===0)return;let W="";for(const Le of O)W+=`━━━ ${Le.name} (${Le.cases.length} casos) ━━━
|
|
216
|
+
`,W+=await Sn(Le.cases);Se(W),d("tests")},bn=async W=>{const Le=await Sn(W.cases);Se(Le),d("tests")},qe=W=>{X({name:W.name,cases:W.cases.map(Le=>({...Le,id:Le.id&&Le.id.length>0?Le.id:crypto.randomUUID()}))}),be(W.id??null),d("tests")},Vn=()=>{be(null),X({name:"Nueva suite",cases:[]})},kn=async()=>{if(ze!=null)await bt.testSuites.update(ze,{name:F.name,cases:F.cases});else{const W=await bt.testSuites.add({name:F.name,cases:F.cases});be(W)}await Ve()},er=async W=>{W!==void 0&&(W===ze&&(be(null),X({name:"Nueva suite",cases:[]})),await bt.testSuites.delete(W),await Ve())},Be=async()=>{await bt.kv.put({key:"bearer",value:j}),await bt.kv.put({key:"apiKey",value:q})},In=async()=>{const W=await T0(),Le=new Blob([JSON.stringify(W,null,2)],{type:"application/json"}),Xe=document.createElement("a");Xe.href=URL.createObjectURL(Le),Xe.download="api-doc-tor-export.json",Xe.click()},Kn=async W=>{var Ht;const Le=(Ht=W.target.files)==null?void 0:Ht[0];if(!Le)return;const Xe=await Le.text(),lt=JSON.parse(Xe);await hm(lt),await Ve()},Or=()=>{x&&(_e(W=>{const Le=W.nodes[W.nodes.length-1],Xe=Le?Le.x+280:80,lt=(Le==null?void 0:Le.y)??120;return{nodes:[...W.nodes,{id:crypto.randomUUID(),method:x.method.toLowerCase(),path:x.path,x:Xe,y:lt}],edges:W.edges}}),le(W=>W+1),d("flows"))};if(a)return P.jsx("div",{className:"min-h-screen flex items-center justify-center p-8",children:P.jsxs("div",{className:"max-w-lg rounded-2xl border border-red-500/30 bg-surface-900 p-6 text-red-200",children:[P.jsx("h1",{className:"font-display text-xl font-bold mb-2",children:"No se pudo cargar OpenAPI"}),P.jsx("p",{className:"text-sm opacity-90",children:a}),P.jsxs("p",{className:"text-xs mt-4 text-slate-500",children:["URL intentada: ",Je]})]})});if(!r)return P.jsx("div",{className:"min-h-screen flex items-center justify-center",children:P.jsx("p",{className:"text-slate-400 animate-pulse",children:"Cargando especificación…"})});const Rr=w===null?"Todos los endpoints (cliente único con todas las operaciones)":`Tag «${w}» (solo operaciones de este grupo)`,mr=((eo=t.productName)==null?void 0:eo.trim())||r.info.title;return P.jsxs("div",{className:"min-h-screen flex flex-col bg-surface-950",children:[P.jsxs("div",{className:"flex flex-1 flex-col md:flex-row min-h-0",children:[P.jsxs("aside",{className:"w-full md:w-64 border-b md:border-b-0 md:border-r border-surface-700 bg-surface-900/80 shrink-0",children:[P.jsxs("div",{className:"p-4 border-b border-surface-700",children:[t.logoDataUrl?P.jsx("img",{src:t.logoDataUrl,alt:"",className:"h-9 max-w-[200px] object-contain object-left mb-2"}):null,P.jsx("h1",{className:"font-display text-lg font-bold text-white tracking-tight",children:mr}),P.jsx("p",{className:"text-xs text-slate-500 mt-1",children:mr===r.info.title?`v${r.info.version}`:`${r.info.title} · v${r.info.version}`})]}),P.jsx("nav",{className:"p-2 flex flex-row md:flex-col gap-1 overflow-x-auto",children:[["explore","Explorar"],["flows",`Flujos (${ue.length})`],["tests",`Tests (${O.length})`],["auth","Auth"]].map(([W,Le])=>P.jsx("button",{type:"button",onClick:()=>d(W),className:`text-left px-3 py-2 rounded-lg text-sm transition ${f===W?"bg-accent/20 text-accent":"text-slate-400 hover:bg-surface-800"}`,children:Le},W))}),P.jsxs("div",{className:"p-3 border-t border-surface-700 space-y-2",children:[P.jsx("button",{type:"button",onClick:In,className:"w-full text-xs py-2 rounded-lg bg-surface-800 hover:bg-surface-700",children:"Exportar estado"}),P.jsxs("label",{className:"block w-full text-xs py-2 rounded-lg bg-surface-800 hover:bg-surface-700 text-center cursor-pointer",children:["Importar JSON",P.jsx("input",{type:"file",accept:"application/json",className:"hidden",onChange:Kn})]})]})]}),P.jsxs("main",{className:"flex-1 flex flex-col min-h-0",children:[P.jsx("header",{className:"border-b border-surface-700 px-4 py-3 flex flex-wrap gap-3 items-center bg-surface-900/50",children:P.jsxs("label",{className:"text-xs text-slate-500",children:["Base URL",P.jsx("input",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1 text-sm w-64",value:m,onChange:W=>v(W.target.value)})]})}),f==="explore"&&P.jsxs("div",{className:"flex-1 flex flex-col lg:flex-row min-h-0",children:[P.jsxs("div",{className:"lg:w-72 border-b lg:border-b-0 lg:border-r border-surface-700 overflow-auto max-h-64 lg:max-h-none",children:[P.jsxs("div",{className:"p-2",children:[P.jsx("p",{className:"text-xs uppercase tracking-wider text-slate-500 mb-2",children:"Tags"}),P.jsxs("div",{className:"flex flex-wrap gap-1",children:[P.jsx("button",{type:"button",onClick:()=>b(null),className:`text-xs px-2 py-1 rounded ${w===null?"bg-accent/30":"bg-surface-800"}`,children:"Todos"}),ct.map(W=>P.jsx("button",{type:"button",onClick:()=>b(W),className:`text-xs px-2 py-1 rounded ${w===W?"bg-accent/30":"bg-surface-800"}`,children:W},W))]})]}),P.jsx("ul",{className:"text-sm",children:ft.map(W=>P.jsx("li",{children:P.jsxs("button",{type:"button",onClick:()=>S({method:W.method,path:W.path}),className:`w-full text-left px-3 py-2 hover:bg-surface-800 flex gap-2 ${(x==null?void 0:x.method)===W.method&&x.path===W.path?"bg-surface-800 border-l-2 border-accent":""}`,children:[P.jsx("span",{className:"uppercase text-accent text-xs w-12 shrink-0",children:W.method}),P.jsx("span",{className:"truncate text-slate-300",children:W.path})]})},`${W.method}:${W.path}`))})]}),P.jsx("div",{className:"flex-1 p-4 overflow-auto space-y-6",children:x?P.jsxs(P.Fragment,{children:[P.jsxs("div",{children:[P.jsxs("h2",{className:"font-display font-semibold text-white text-lg",children:[x.method.toUpperCase()," ",x.path]}),P.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["Filtro de exportación de servicio: ",Rr]})]}),P.jsxs("section",{className:"space-y-2",children:[P.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Probar"}),P.jsx("textarea",{className:"w-full h-28 bg-surface-900 border border-surface-600 rounded-lg p-3 font-mono text-xs",value:N,onChange:W=>C(W.target.value),placeholder:"Body JSON"}),P.jsx("button",{type:"button",onClick:()=>void qt(),className:"px-4 py-2 rounded-lg bg-accent text-surface-950 font-medium text-sm",children:"Ejecutar"}),P.jsx("pre",{className:"text-xs bg-surface-900 border border-surface-700 rounded-lg p-3 overflow-auto max-h-64 text-emerald-300/90 whitespace-pre-wrap",children:$||"—"})]}),P.jsxs("section",{className:"space-y-3",children:[P.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Snippets por lenguaje"}),P.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:rn&&mf.map(({id:W,label:Le})=>P.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/60 overflow-hidden",children:[P.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-surface-700 bg-surface-800/50",children:[P.jsx("span",{className:"text-xs font-medium text-accent",children:Le}),P.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-surface-600",onClick:()=>void am(rn[W]),children:"Copiar"})]}),P.jsx("pre",{className:"text-[11px] p-3 overflow-auto max-h-56 text-slate-300 font-mono whitespace-pre-wrap",children:rn[W]})]},W))})]}),P.jsxs("section",{className:"space-y-3 rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[P.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Cliente / servicio generado"}),P.jsx("p",{className:"text-xs text-slate-500",children:Rr}),P.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[P.jsxs("label",{className:"text-xs text-slate-400",children:["Lenguaje del archivo",P.jsx("select",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:I,onChange:W=>H(W.target.value),children:mf.map(({id:W,label:Le})=>P.jsx("option",{value:W,children:Le},W))})]}),P.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-surface-700 hover:bg-surface-600",onClick:()=>void am(Gt),children:"Copiar servicio"})]}),P.jsx("pre",{className:"text-[11px] bg-surface-950 border border-surface-700 rounded-lg p-3 overflow-auto max-h-96 text-slate-200 font-mono whitespace-pre-wrap",children:Gt})]}),P.jsx("div",{className:"flex flex-wrap gap-2 pt-2 border-t border-surface-800",children:P.jsx("button",{type:"button",className:"text-xs px-3 py-2 rounded-lg bg-surface-800 hover:bg-surface-700",onClick:Or,children:"Añadir operación actual a un flujo (ve a Flujos)"})})]}):P.jsx("p",{className:"text-slate-500",children:"Selecciona una operación en la lista."})})]}),f==="flows"&&P.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[P.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4",children:[P.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:"Flujos guardados"}),ue.length===0?P.jsx("p",{className:"text-sm text-slate-500",children:"Aún no hay flujos. Crea uno en el editor y guarda."}):P.jsx("ul",{className:"space-y-2",children:ue.map(W=>{var Le,Xe;return P.jsxs("li",{className:"flex flex-wrap items-center gap-2 justify-between rounded-lg border border-surface-700 bg-surface-950/50 px-3 py-2",children:[P.jsxs("div",{children:[P.jsx("span",{className:"text-sm text-slate-200 font-medium",children:W.name}),P.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[(((Xe=(Le=W.graph)==null?void 0:Le.nodes)==null?void 0:Xe.length)??W.steps.length)||0," nodo(s)"]})]}),P.jsxs("div",{className:"flex flex-wrap gap-2",children:[P.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded-lg bg-emerald-600/30 text-emerald-300 hover:bg-emerald-600/50",title:"Ejecutar sin cargar el editor",onClick:()=>void cn(W),children:"Play"}),P.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent hover:bg-accent/30",onClick:()=>pr(W),children:"Editar"}),P.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40 text-slate-300",onClick:()=>void Hn(W.id),children:"Eliminar"})]})]},W.id!=null?`flow-${W.id}`:`flow-${W.name}`)})})]}),P.jsxs("section",{className:"space-y-4 max-w-6xl",children:[P.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[P.jsx("h3",{className:"text-sm font-semibold text-white",children:"Editor de flujo (nodos y cables)"}),P.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg border border-surface-600 text-slate-300 hover:bg-surface-800",onClick:fn,children:"Nuevo flujo"})]}),Ae!=null&&P.jsxs("p",{className:"text-xs text-accent",children:["Editando flujo guardado (#",Ae,")"]}),P.jsxs("p",{className:"text-sm text-slate-400",children:["Cada nodo es un endpoint del spec. Conecta ",P.jsx("strong",{className:"text-slate-300",children:"res → req"})," ","y define qué campo de la respuesta pasa al siguiente request (JSON path, variable, header, query o ",P.jsx("code",{className:"text-accent",children:"{variable}"})," en la ruta)."]}),P.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm w-full max-w-md",value:xe,onChange:W=>z(W.target.value),placeholder:"Nombre del flujo"}),P.jsx(Ub,{doc:r,ops:nt,graph:he,onGraphChange:Ct},Q),P.jsxs("div",{className:"flex flex-wrap gap-2",children:[P.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-emerald-600 text-white text-sm font-medium hover:bg-emerald-500",onClick:()=>void Mn(),children:"Play (grafo)"}),P.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Wt(),children:Ae!=null?"Guardar cambios":"Guardar flujo"})]}),P.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 max-h-64 overflow-auto whitespace-pre-wrap",children:ae||"Resultado de la ejecución aquí."})]})]}),f==="tests"&&P.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[P.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[P.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[P.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suites guardadas"}),O.length>0&&P.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-emerald-600/80 text-white hover:bg-emerald-500",onClick:()=>void $r(),children:"Ejecutar todas las suites"})]}),O.length===0?P.jsx("p",{className:"text-sm text-slate-500",children:"Ninguna suite guardada."}):P.jsx("ul",{className:"space-y-2",children:O.map(W=>P.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-surface-700 bg-surface-950/50 px-3 py-2",children:[P.jsxs("div",{children:[P.jsx("span",{className:"text-sm text-slate-200 font-medium",children:W.name}),P.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[W.cases.length," caso(s)"]})]}),P.jsxs("div",{className:"flex flex-wrap gap-2",children:[P.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded-lg bg-emerald-600/30 text-emerald-300 hover:bg-emerald-600/50",onClick:()=>void bn(W),children:"Play"}),P.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent",onClick:()=>qe(W),children:"Editar"}),P.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40",onClick:()=>void er(W.id),children:"Eliminar"})]})]},W.id!=null?`suite-${W.id}`:`suite-${W.name}`))})]}),P.jsxs("section",{className:"space-y-4",children:[P.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[P.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suite en edición"}),P.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg border border-surface-600 text-slate-300 hover:bg-surface-800",onClick:Vn,children:"Nueva suite"})]}),ze!=null&&P.jsxs("p",{className:"text-xs text-accent",children:["Editando suite guardada (#",ze,")"]}),P.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm max-w-md",value:F.name,onChange:W=>X(Le=>({...Le,name:W.target.value})),placeholder:"Nombre de la suite"}),P.jsxs("div",{className:"flex flex-wrap gap-2 items-end rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[P.jsxs("label",{className:"text-xs text-slate-400 flex-1 min-w-[200px]",children:["Añadir endpoint del spec",P.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm font-mono",value:Ie,onChange:W=>Re(W.target.value),children:nt.map(W=>P.jsxs("option",{value:gf(W.method,W.path),children:[W.method.toUpperCase()," ",W.path]},gf(W.method,W.path)))})]}),P.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-800 text-sm hover:bg-surface-700",onClick:Jn,children:"Añadir a la suite"})]}),P.jsx("ul",{className:"space-y-4",children:F.cases.map(W=>{const Le=sm(W.expectStatus)?String(W.expectStatus):"custom";return P.jsxs("li",{className:"rounded-xl border border-surface-700 bg-surface-950/40 p-4 space-y-3 text-sm",children:[P.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[P.jsxs("span",{className:"font-mono text-xs text-accent",children:[W.method.toUpperCase()," ",W.path]}),P.jsx("button",{type:"button",className:"text-xs text-red-400 hover:underline shrink-0",onClick:()=>_n(W.id),children:"Quitar"})]}),P.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[P.jsxs("label",{className:"text-xs text-slate-400 block",children:["Código HTTP esperado",P.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[P.jsxs("select",{className:"bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm max-w-[200px]",value:Le,onChange:Xe=>{const lt=Xe.target.value;if(lt==="custom"){Yt(W.id,{expectStatus:sm(W.expectStatus)?1e3:W.expectStatus});return}Yt(W.id,{expectStatus:Number(lt)})},children:[iy.map(Xe=>P.jsx("option",{value:String(Xe.value),children:Xe.label},Xe.value)),P.jsx("option",{value:"custom",children:"Otro…"})]}),Le==="custom"&&P.jsx("input",{type:"number",className:"w-20 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:W.expectStatus,onChange:Xe=>Yt(W.id,{expectStatus:Number(Xe.target.value)||0})})]})]}),P.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["El body contiene (opcional)",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:'ej. "ok"',value:W.contains??"",onChange:Xe=>Yt(W.id,{contains:Xe.target.value||void 0})})]}),P.jsxs("label",{className:"text-xs text-slate-400 block",children:["JSON path (opcional)",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:"$.data.id",value:W.jsonPath??"",onChange:Xe=>Yt(W.id,{jsonPath:Xe.target.value||void 0})})]}),P.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["Valor esperado en JSON path (opcional)",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:"Vacío = solo comprobar que existe",value:W.expectJsonValue??"",onChange:Xe=>Yt(W.id,{expectJsonValue:Xe.target.value||void 0})})]})]})]},W.id)})}),P.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[P.jsx("button",{type:"button",className:"px-5 py-2.5 rounded-lg bg-emerald-600 text-white text-sm font-semibold hover:bg-emerald-500 shadow-lg shadow-emerald-900/30",onClick:()=>void hr(),children:"Correr todos los casos (suite actual)"}),P.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void kn(),children:ze!=null?"Guardar cambios":"Guardar suite"})]}),P.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 whitespace-pre-wrap min-h-[4rem]",children:ke||"—"})]})]}),f==="auth"&&P.jsxs("div",{className:"p-4 space-y-4 max-w-lg",children:[P.jsxs("p",{className:"text-sm text-slate-400",children:["Esquemas en el spec: ",E0(r).join(", ")||"ninguno"]}),P.jsxs("label",{className:"block text-sm",children:["Bearer token",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:j,onChange:W=>R(W.target.value),placeholder:"eyJ..."})]}),P.jsxs("label",{className:"block text-sm",children:["API key header",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:U,onChange:W=>pe(W.target.value)})]}),P.jsxs("label",{className:"block text-sm",children:["API key",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:q,onChange:W=>V(W.target.value),type:"password",autoComplete:"off"})]}),P.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Be(),children:"Recordar en este navegador"})]})]})]}),P.jsx("footer",{className:"border-t border-surface-700 px-3 py-2.5 text-center text-[11px] text-slate-600 bg-surface-950 shrink-0",children:"made with ♥ by andres arcila"})]})}const Zb={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 a=parseInt(i[1],16);return`${a>>16&255} ${a>>8&255} ${a&255}`}function Jb(t){return{...Zb,...t}}function ek(t){var a,u;const r=(a=t.logoBase64)==null?void 0:a.trim();return r?r.startsWith("data:")?r:`data:${((u=t.logoMimeType)==null?void 0:u.trim())||"image/png"};base64,${r}`:null}function tk(t){var i;const r=Jb(t==null?void 0:t.colors);return{productName:((i=t==null?void 0:t.productName)==null?void 0:i.trim())||null,logoDataUrl:t?ek(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)}}}function nk(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 rk(){const t=tk(void 0);try{const r=await fetch("/docs/ui-config.json");return r.ok?await r.json():t}catch{return t}}(async()=>{const t=await rk();nk(t.colorsRgb),s0.createRoot(document.getElementById("root")).render(P.jsx(lm.StrictMode,{children:P.jsx(Yb,{value:{productName:t.productName,logoDataUrl:t.logoDataUrl},children:P.jsx(Gb,{})})}))})();
|