loom-spec 0.2.0 → 0.3.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/cli/importTrace.d.ts +15 -0
- package/dist/cli/importTrace.js +188 -0
- package/dist/cli/importTrace.js.map +1 -0
- package/dist/cli/index.js +37 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/server/otel.d.ts +32 -0
- package/dist/server/otel.js +98 -0
- package/dist/server/otel.js.map +1 -0
- package/dist/view/assets/TimelineView-DEfpV9mL.js +16 -0
- package/dist/view/assets/{index-B18EbiQt.css → index-CvyHnPjR.css} +1 -1
- package/dist/view/assets/index-Du05xzao.js +210 -0
- package/dist/view/index.html +2 -2
- package/package.json +1 -1
- package/dist/view/assets/index-DAM9J2qS.js +0 -225
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function Ya(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ag={exports:{}},Xa={},lg={exports:{}},ae={};/**
|
|
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 qi=Symbol.for("react.element"),E_=Symbol.for("react.portal"),k_=Symbol.for("react.fragment"),N_=Symbol.for("react.strict_mode"),P_=Symbol.for("react.profiler"),C_=Symbol.for("react.provider"),b_=Symbol.for("react.context"),j_=Symbol.for("react.forward_ref"),M_=Symbol.for("react.suspense"),T_=Symbol.for("react.memo"),I_=Symbol.for("react.lazy"),uh=Symbol.iterator;function z_(e){return e===null||typeof e!="object"?null:(e=uh&&e[uh]||e["@@iterator"],typeof e=="function"?e:null)}var ug={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},cg=Object.assign,dg={};function ko(e,t,n){this.props=e,this.context=t,this.refs=dg,this.updater=n||ug}ko.prototype.isReactComponent={};ko.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ko.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function fg(){}fg.prototype=ko.prototype;function Hc(e,t,n){this.props=e,this.context=t,this.refs=dg,this.updater=n||ug}var Uc=Hc.prototype=new fg;Uc.constructor=Hc;cg(Uc,ko.prototype);Uc.isPureReactComponent=!0;var ch=Array.isArray,hg=Object.prototype.hasOwnProperty,Bc={current:null},pg={key:!0,ref:!0,__self:!0,__source:!0};function mg(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)hg.call(t,r)&&!pg.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:qi,type:e,key:i,ref:s,props:o,_owner:Bc.current}}function R_(e,t){return{$$typeof:qi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Wc(e){return typeof e=="object"&&e!==null&&e.$$typeof===qi}function A_(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var dh=/\/+/g;function Al(e,t){return typeof e=="object"&&e!==null&&e.key!=null?A_(""+e.key):t.toString(36)}function Vs(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case qi:case E_:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Al(s,0):r,ch(o)?(n="",e!=null&&(n=e.replace(dh,"$&/")+"/"),Vs(o,t,n,"",function(u){return u})):o!=null&&(Wc(o)&&(o=R_(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(dh,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",ch(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Al(i,a);s+=Vs(i,t,n,l,o)}else if(l=z_(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Al(i,a++),s+=Vs(i,t,n,l,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function as(e,t,n){if(e==null)return e;var r=[],o=0;return Vs(e,r,"","",function(i){return t.call(n,i,o++)}),r}function O_(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Qe={current:null},Fs={transition:null},D_={ReactCurrentDispatcher:Qe,ReactCurrentBatchConfig:Fs,ReactCurrentOwner:Bc};function gg(){throw Error("act(...) is not supported in production builds of React.")}ae.Children={map:as,forEach:function(e,t,n){as(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return as(e,function(){t++}),t},toArray:function(e){return as(e,function(t){return t})||[]},only:function(e){if(!Wc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ae.Component=ko;ae.Fragment=k_;ae.Profiler=P_;ae.PureComponent=Hc;ae.StrictMode=N_;ae.Suspense=M_;ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D_;ae.act=gg;ae.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=cg({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Bc.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)hg.call(t,l)&&!pg.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:qi,type:e.type,key:o,ref:i,props:r,_owner:s}};ae.createContext=function(e){return e={$$typeof:b_,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:C_,_context:e},e.Consumer=e};ae.createElement=mg;ae.createFactory=function(e){var t=mg.bind(null,e);return t.type=e,t};ae.createRef=function(){return{current:null}};ae.forwardRef=function(e){return{$$typeof:j_,render:e}};ae.isValidElement=Wc;ae.lazy=function(e){return{$$typeof:I_,_payload:{_status:-1,_result:e},_init:O_}};ae.memo=function(e,t){return{$$typeof:T_,type:e,compare:t===void 0?null:t}};ae.startTransition=function(e){var t=Fs.transition;Fs.transition={};try{e()}finally{Fs.transition=t}};ae.unstable_act=gg;ae.useCallback=function(e,t){return Qe.current.useCallback(e,t)};ae.useContext=function(e){return Qe.current.useContext(e)};ae.useDebugValue=function(){};ae.useDeferredValue=function(e){return Qe.current.useDeferredValue(e)};ae.useEffect=function(e,t){return Qe.current.useEffect(e,t)};ae.useId=function(){return Qe.current.useId()};ae.useImperativeHandle=function(e,t,n){return Qe.current.useImperativeHandle(e,t,n)};ae.useInsertionEffect=function(e,t){return Qe.current.useInsertionEffect(e,t)};ae.useLayoutEffect=function(e,t){return Qe.current.useLayoutEffect(e,t)};ae.useMemo=function(e,t){return Qe.current.useMemo(e,t)};ae.useReducer=function(e,t,n){return Qe.current.useReducer(e,t,n)};ae.useRef=function(e){return Qe.current.useRef(e)};ae.useState=function(e){return Qe.current.useState(e)};ae.useSyncExternalStore=function(e,t,n){return Qe.current.useSyncExternalStore(e,t,n)};ae.useTransition=function(){return Qe.current.useTransition()};ae.version="18.3.1";lg.exports=ae;var D=lg.exports;const L_=Ya(D);/**
|
|
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 V_=D,F_=Symbol.for("react.element"),H_=Symbol.for("react.fragment"),U_=Object.prototype.hasOwnProperty,B_=V_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,W_={key:!0,ref:!0,__self:!0,__source:!0};function yg(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)U_.call(t,r)&&!W_.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:F_,type:e,key:i,ref:s,props:o,_owner:B_.current}}Xa.Fragment=H_;Xa.jsx=yg;Xa.jsxs=yg;ag.exports=Xa;var S=ag.exports,vg={exports:{}},ht={},wg={exports:{}},_g={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(M,z){var b=M.length;M.push(z);e:for(;0<b;){var E=b-1>>>1,j=M[E];if(0<o(j,z))M[E]=z,M[b]=j,b=E;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var z=M[0],b=M.pop();if(b!==z){M[0]=b;e:for(var E=0,j=M.length,R=j>>>1;E<R;){var $=2*(E+1)-1,P=M[$],V=$+1,q=M[V];if(0>o(P,b))V<j&&0>o(q,P)?(M[E]=q,M[V]=b,E=V):(M[E]=P,M[$]=b,E=$);else if(V<j&&0>o(q,b))M[E]=q,M[V]=b,E=V;else break e}}return z}function o(M,z){var b=M.sortIndex-z.sortIndex;return b!==0?b:M.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],d=1,c=null,h=3,g=!1,y=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(M){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=M)r(u),z.sortIndex=z.expirationTime,t(l,z);else break;z=n(u)}}function _(M){if(v=!1,m(M),!y)if(n(l)!==null)y=!0,A(x);else{var z=n(u);z!==null&&H(_,z.startTime-M)}}function x(M,z){y=!1,v&&(v=!1,f(I),I=-1),g=!0;var b=h;try{for(m(z),c=n(l);c!==null&&(!(c.expirationTime>z)||M&&!T());){var E=c.callback;if(typeof E=="function"){c.callback=null,h=c.priorityLevel;var j=E(c.expirationTime<=z);z=e.unstable_now(),typeof j=="function"?c.callback=j:c===n(l)&&r(l),m(z)}else r(l);c=n(l)}if(c!==null)var R=!0;else{var $=n(u);$!==null&&H(_,$.startTime-z),R=!1}return R}finally{c=null,h=b,g=!1}}var k=!1,C=null,I=-1,L=5,U=-1;function T(){return!(e.unstable_now()-U<L)}function O(){if(C!==null){var M=e.unstable_now();U=M;var z=!0;try{z=C(!0,M)}finally{z?W():(k=!1,C=null)}}else k=!1}var W;if(typeof p=="function")W=function(){p(O)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,F=N.port2;N.port1.onmessage=O,W=function(){F.postMessage(null)}}else W=function(){w(O,0)};function A(M){C=M,k||(k=!0,W())}function H(M,z){I=w(function(){M(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_continueExecution=function(){y||g||(y=!0,A(x))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(M){switch(h){case 1:case 2:case 3:var z=3;break;default:z=h}var b=h;h=z;try{return M()}finally{h=b}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,z){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var b=h;h=M;try{return z()}finally{h=b}},e.unstable_scheduleCallback=function(M,z,b){var E=e.unstable_now();switch(typeof b=="object"&&b!==null?(b=b.delay,b=typeof b=="number"&&0<b?E+b:E):b=E,M){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=b+j,M={id:d++,callback:z,priorityLevel:M,startTime:b,expirationTime:j,sortIndex:-1},b>E?(M.sortIndex=b,t(u,M),n(l)===null&&M===n(u)&&(v?(f(I),I=-1):v=!0,H(_,b-E))):(M.sortIndex=j,t(l,M),y||g||(y=!0,A(x))),M},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(M){var z=h;return function(){var b=h;h=z;try{return M.apply(this,arguments)}finally{h=b}}}})(_g);wg.exports=_g;var q_=wg.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 K_=D,dt=q_;function K(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var $g=new Set,vi={};function Cr(e,t){ao(e,t),ao(e+"Capture",t)}function ao(e,t){for(vi[e]=t,e=0;e<t.length;e++)$g.add(t[e])}var hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ku=Object.prototype.hasOwnProperty,Y_=/^[: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]*$/,fh={},hh={};function X_(e){return ku.call(hh,e)?!0:ku.call(fh,e)?!1:Y_.test(e)?hh[e]=!0:(fh[e]=!0,!1)}function G_(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Q_(e,t,n,r){if(t===null||typeof t>"u"||G_(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ze(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Fe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Fe[e]=new Ze(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Fe[t]=new Ze(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Fe[e]=new Ze(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Fe[e]=new Ze(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){Fe[e]=new Ze(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Fe[e]=new Ze(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Fe[e]=new Ze(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Fe[e]=new Ze(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Fe[e]=new Ze(e,5,!1,e.toLowerCase(),null,!1,!1)});var qc=/[\-:]([a-z])/g;function Kc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(qc,Kc);Fe[t]=new Ze(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(qc,Kc);Fe[t]=new Ze(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(qc,Kc);Fe[t]=new Ze(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Fe[e]=new Ze(e,1,!1,e.toLowerCase(),null,!1,!1)});Fe.xlinkHref=new Ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Fe[e]=new Ze(e,1,!1,e.toLowerCase(),null,!0,!0)});function Yc(e,t,n,r){var o=Fe.hasOwnProperty(t)?Fe[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Q_(t,n,o,r)&&(n=null),r||o===null?X_(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var wn=K_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ls=Symbol.for("react.element"),Ar=Symbol.for("react.portal"),Or=Symbol.for("react.fragment"),Xc=Symbol.for("react.strict_mode"),Nu=Symbol.for("react.profiler"),xg=Symbol.for("react.provider"),Sg=Symbol.for("react.context"),Gc=Symbol.for("react.forward_ref"),Pu=Symbol.for("react.suspense"),Cu=Symbol.for("react.suspense_list"),Qc=Symbol.for("react.memo"),Cn=Symbol.for("react.lazy"),Eg=Symbol.for("react.offscreen"),ph=Symbol.iterator;function Ao(e){return e===null||typeof e!="object"?null:(e=ph&&e[ph]||e["@@iterator"],typeof e=="function"?e:null)}var ke=Object.assign,Ol;function Yo(e){if(Ol===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ol=t&&t[1]||""}return`
|
|
34
|
+
`+Ol+e}var Dl=!1;function Ll(e,t){if(!e||Dl)return"";Dl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
|
|
35
|
+
`),i=r.stack.split(`
|
|
36
|
+
`),s=o.length-1,a=i.length-1;1<=s&&0<=a&&o[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||o[s]!==i[a]){var l=`
|
|
37
|
+
`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Dl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Yo(e):""}function Z_(e){switch(e.tag){case 5:return Yo(e.type);case 16:return Yo("Lazy");case 13:return Yo("Suspense");case 19:return Yo("SuspenseList");case 0:case 2:case 15:return e=Ll(e.type,!1),e;case 11:return e=Ll(e.type.render,!1),e;case 1:return e=Ll(e.type,!0),e;default:return""}}function bu(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 Or:return"Fragment";case Ar:return"Portal";case Nu:return"Profiler";case Xc:return"StrictMode";case Pu:return"Suspense";case Cu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Sg:return(e.displayName||"Context")+".Consumer";case xg:return(e._context.displayName||"Context")+".Provider";case Gc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Qc:return t=e.displayName||null,t!==null?t:bu(e.type)||"Memo";case Cn:t=e._payload,e=e._init;try{return bu(e(t))}catch{}}return null}function J_(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return bu(t);case 8:return t===Xc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Kn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function kg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function e$(e){var t=kg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function us(e){e._valueTracker||(e._valueTracker=e$(e))}function Ng(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=kg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function la(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 ju(e,t){var n=t.checked;return ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function mh(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Kn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Pg(e,t){t=t.checked,t!=null&&Yc(e,"checked",t,!1)}function Mu(e,t){Pg(e,t);var n=Kn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Tu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Tu(e,t.type,Kn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function gh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Tu(e,t,n){(t!=="number"||la(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Xo=Array.isArray;function Qr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Kn(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Iu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(K(91));return ke({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function yh(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(K(92));if(Xo(n)){if(1<n.length)throw Error(K(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Kn(n)}}function Cg(e,t){var n=Kn(t.value),r=Kn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function vh(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function bg(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 zu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?bg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var cs,jg=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(cs=cs||document.createElement("div"),cs.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=cs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function wi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ni={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},t$=["Webkit","ms","Moz","O"];Object.keys(ni).forEach(function(e){t$.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ni[t]=ni[e]})});function Mg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ni.hasOwnProperty(e)&&ni[e]?(""+t).trim():t+"px"}function Tg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Mg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var n$=ke({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 Ru(e,t){if(t){if(n$[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function Au(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ou=null;function Zc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Du=null,Zr=null,Jr=null;function wh(e){if(e=Xi(e)){if(typeof Du!="function")throw Error(K(280));var t=e.stateNode;t&&(t=el(t),Du(e.stateNode,e.type,t))}}function Ig(e){Zr?Jr?Jr.push(e):Jr=[e]:Zr=e}function zg(){if(Zr){var e=Zr,t=Jr;if(Jr=Zr=null,wh(e),t)for(e=0;e<t.length;e++)wh(t[e])}}function Rg(e,t){return e(t)}function Ag(){}var Vl=!1;function Og(e,t,n){if(Vl)return e(t,n);Vl=!0;try{return Rg(e,t,n)}finally{Vl=!1,(Zr!==null||Jr!==null)&&(Ag(),zg())}}function _i(e,t){var n=e.stateNode;if(n===null)return null;var r=el(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(K(231,t,typeof n));return n}var Lu=!1;if(hn)try{var Oo={};Object.defineProperty(Oo,"passive",{get:function(){Lu=!0}}),window.addEventListener("test",Oo,Oo),window.removeEventListener("test",Oo,Oo)}catch{Lu=!1}function r$(e,t,n,r,o,i,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var ri=!1,ua=null,ca=!1,Vu=null,o$={onError:function(e){ri=!0,ua=e}};function i$(e,t,n,r,o,i,s,a,l){ri=!1,ua=null,r$.apply(o$,arguments)}function s$(e,t,n,r,o,i,s,a,l){if(i$.apply(this,arguments),ri){if(ri){var u=ua;ri=!1,ua=null}else throw Error(K(198));ca||(ca=!0,Vu=u)}}function br(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Dg(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function _h(e){if(br(e)!==e)throw Error(K(188))}function a$(e){var t=e.alternate;if(!t){if(t=br(e),t===null)throw Error(K(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return _h(o),e;if(i===r)return _h(o),t;i=i.sibling}throw Error(K(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(K(189))}}if(n.alternate!==r)throw Error(K(190))}if(n.tag!==3)throw Error(K(188));return n.stateNode.current===n?e:t}function Lg(e){return e=a$(e),e!==null?Vg(e):null}function Vg(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Vg(e);if(t!==null)return t;e=e.sibling}return null}var Fg=dt.unstable_scheduleCallback,$h=dt.unstable_cancelCallback,l$=dt.unstable_shouldYield,u$=dt.unstable_requestPaint,Ce=dt.unstable_now,c$=dt.unstable_getCurrentPriorityLevel,Jc=dt.unstable_ImmediatePriority,Hg=dt.unstable_UserBlockingPriority,da=dt.unstable_NormalPriority,d$=dt.unstable_LowPriority,Ug=dt.unstable_IdlePriority,Ga=null,Yt=null;function f$(e){if(Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(Ga,e,void 0,(e.current.flags&128)===128)}catch{}}var Dt=Math.clz32?Math.clz32:m$,h$=Math.log,p$=Math.LN2;function m$(e){return e>>>=0,e===0?32:31-(h$(e)/p$|0)|0}var ds=64,fs=4194304;function Go(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 fa(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=Go(a):(i&=s,i!==0&&(r=Go(i)))}else s=n&~o,s!==0?r=Go(s):i!==0&&(r=Go(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Dt(t),o=1<<n,r|=e[n],t&=~o;return r}function g$(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function y$(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Dt(i),a=1<<s,l=o[s];l===-1?(!(a&n)||a&r)&&(o[s]=g$(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Fu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Bg(){var e=ds;return ds<<=1,!(ds&4194240)&&(ds=64),e}function Fl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ki(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Dt(t),e[t]=n}function v$(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Dt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function ed(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Dt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var he=0;function Wg(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var qg,td,Kg,Yg,Xg,Hu=!1,hs=[],On=null,Dn=null,Ln=null,$i=new Map,xi=new Map,jn=[],w$="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 xh(e,t){switch(e){case"focusin":case"focusout":On=null;break;case"dragenter":case"dragleave":Dn=null;break;case"mouseover":case"mouseout":Ln=null;break;case"pointerover":case"pointerout":$i.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xi.delete(t.pointerId)}}function Do(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=Xi(t),t!==null&&td(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function _$(e,t,n,r,o){switch(t){case"focusin":return On=Do(On,e,t,n,r,o),!0;case"dragenter":return Dn=Do(Dn,e,t,n,r,o),!0;case"mouseover":return Ln=Do(Ln,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return $i.set(i,Do($i.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,xi.set(i,Do(xi.get(i)||null,e,t,n,r,o)),!0}return!1}function Gg(e){var t=ar(e.target);if(t!==null){var n=br(t);if(n!==null){if(t=n.tag,t===13){if(t=Dg(n),t!==null){e.blockedOn=t,Xg(e.priority,function(){Kg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Uu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ou=r,n.target.dispatchEvent(r),Ou=null}else return t=Xi(n),t!==null&&td(t),e.blockedOn=n,!1;t.shift()}return!0}function Sh(e,t,n){Hs(e)&&n.delete(t)}function $$(){Hu=!1,On!==null&&Hs(On)&&(On=null),Dn!==null&&Hs(Dn)&&(Dn=null),Ln!==null&&Hs(Ln)&&(Ln=null),$i.forEach(Sh),xi.forEach(Sh)}function Lo(e,t){e.blockedOn===t&&(e.blockedOn=null,Hu||(Hu=!0,dt.unstable_scheduleCallback(dt.unstable_NormalPriority,$$)))}function Si(e){function t(o){return Lo(o,e)}if(0<hs.length){Lo(hs[0],e);for(var n=1;n<hs.length;n++){var r=hs[n];r.blockedOn===e&&(r.blockedOn=null)}}for(On!==null&&Lo(On,e),Dn!==null&&Lo(Dn,e),Ln!==null&&Lo(Ln,e),$i.forEach(t),xi.forEach(t),n=0;n<jn.length;n++)r=jn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<jn.length&&(n=jn[0],n.blockedOn===null);)Gg(n),n.blockedOn===null&&jn.shift()}var eo=wn.ReactCurrentBatchConfig,ha=!0;function x$(e,t,n,r){var o=he,i=eo.transition;eo.transition=null;try{he=1,nd(e,t,n,r)}finally{he=o,eo.transition=i}}function S$(e,t,n,r){var o=he,i=eo.transition;eo.transition=null;try{he=4,nd(e,t,n,r)}finally{he=o,eo.transition=i}}function nd(e,t,n,r){if(ha){var o=Uu(e,t,n,r);if(o===null)Ql(e,t,r,pa,n),xh(e,r);else if(_$(o,e,t,n,r))r.stopPropagation();else if(xh(e,r),t&4&&-1<w$.indexOf(e)){for(;o!==null;){var i=Xi(o);if(i!==null&&qg(i),i=Uu(e,t,n,r),i===null&&Ql(e,t,r,pa,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Ql(e,t,r,null,n)}}var pa=null;function Uu(e,t,n,r){if(pa=null,e=Zc(r),e=ar(e),e!==null)if(t=br(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Dg(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return pa=e,null}function Qg(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(c$()){case Jc:return 1;case Hg:return 4;case da:case d$:return 16;case Ug:return 536870912;default:return 16}default:return 16}}var In=null,rd=null,Us=null;function Zg(){if(Us)return Us;var e,t=rd,n=t.length,r,o="value"in In?In.value:In.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Us=o.slice(e,1<r?1-r:void 0)}function Bs(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ps(){return!0}function Eh(){return!1}function pt(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ps:Eh,this.isPropagationStopped=Eh,this}return ke(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ps)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ps)},persist:function(){},isPersistent:ps}),t}var No={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},od=pt(No),Yi=ke({},No,{view:0,detail:0}),E$=pt(Yi),Hl,Ul,Vo,Qa=ke({},Yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:id,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!==Vo&&(Vo&&e.type==="mousemove"?(Hl=e.screenX-Vo.screenX,Ul=e.screenY-Vo.screenY):Ul=Hl=0,Vo=e),Hl)},movementY:function(e){return"movementY"in e?e.movementY:Ul}}),kh=pt(Qa),k$=ke({},Qa,{dataTransfer:0}),N$=pt(k$),P$=ke({},Yi,{relatedTarget:0}),Bl=pt(P$),C$=ke({},No,{animationName:0,elapsedTime:0,pseudoElement:0}),b$=pt(C$),j$=ke({},No,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),M$=pt(j$),T$=ke({},No,{data:0}),Nh=pt(T$),I$={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},z$={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"},R$={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function A$(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=R$[e])?!!t[e]:!1}function id(){return A$}var O$=ke({},Yi,{key:function(e){if(e.key){var t=I$[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Bs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?z$[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:id,charCode:function(e){return e.type==="keypress"?Bs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Bs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),D$=pt(O$),L$=ke({},Qa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ph=pt(L$),V$=ke({},Yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:id}),F$=pt(V$),H$=ke({},No,{propertyName:0,elapsedTime:0,pseudoElement:0}),U$=pt(H$),B$=ke({},Qa,{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}),W$=pt(B$),q$=[9,13,27,32],sd=hn&&"CompositionEvent"in window,oi=null;hn&&"documentMode"in document&&(oi=document.documentMode);var K$=hn&&"TextEvent"in window&&!oi,Jg=hn&&(!sd||oi&&8<oi&&11>=oi),Ch=" ",bh=!1;function e0(e,t){switch(e){case"keyup":return q$.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function t0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Dr=!1;function Y$(e,t){switch(e){case"compositionend":return t0(t);case"keypress":return t.which!==32?null:(bh=!0,Ch);case"textInput":return e=t.data,e===Ch&&bh?null:e;default:return null}}function X$(e,t){if(Dr)return e==="compositionend"||!sd&&e0(e,t)?(e=Zg(),Us=rd=In=null,Dr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Jg&&t.locale!=="ko"?null:t.data;default:return null}}var G$={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 jh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!G$[e.type]:t==="textarea"}function n0(e,t,n,r){Ig(r),t=ma(t,"onChange"),0<t.length&&(n=new od("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ii=null,Ei=null;function Q$(e){h0(e,0)}function Za(e){var t=Fr(e);if(Ng(t))return e}function Z$(e,t){if(e==="change")return t}var r0=!1;if(hn){var Wl;if(hn){var ql="oninput"in document;if(!ql){var Mh=document.createElement("div");Mh.setAttribute("oninput","return;"),ql=typeof Mh.oninput=="function"}Wl=ql}else Wl=!1;r0=Wl&&(!document.documentMode||9<document.documentMode)}function Th(){ii&&(ii.detachEvent("onpropertychange",o0),Ei=ii=null)}function o0(e){if(e.propertyName==="value"&&Za(Ei)){var t=[];n0(t,Ei,e,Zc(e)),Og(Q$,t)}}function J$(e,t,n){e==="focusin"?(Th(),ii=t,Ei=n,ii.attachEvent("onpropertychange",o0)):e==="focusout"&&Th()}function ex(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Za(Ei)}function tx(e,t){if(e==="click")return Za(t)}function nx(e,t){if(e==="input"||e==="change")return Za(t)}function rx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Vt=typeof Object.is=="function"?Object.is:rx;function ki(e,t){if(Vt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!ku.call(t,o)||!Vt(e[o],t[o]))return!1}return!0}function Ih(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zh(e,t){var n=Ih(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ih(n)}}function i0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?i0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function s0(){for(var e=window,t=la();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=la(e.document)}return t}function ad(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ox(e){var t=s0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&i0(n.ownerDocument.documentElement,n)){if(r!==null&&ad(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=zh(n,i);var s=zh(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ix=hn&&"documentMode"in document&&11>=document.documentMode,Lr=null,Bu=null,si=null,Wu=!1;function Rh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Wu||Lr==null||Lr!==la(r)||(r=Lr,"selectionStart"in r&&ad(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),si&&ki(si,r)||(si=r,r=ma(Bu,"onSelect"),0<r.length&&(t=new od("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Lr)))}function ms(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Vr={animationend:ms("Animation","AnimationEnd"),animationiteration:ms("Animation","AnimationIteration"),animationstart:ms("Animation","AnimationStart"),transitionend:ms("Transition","TransitionEnd")},Kl={},a0={};hn&&(a0=document.createElement("div").style,"AnimationEvent"in window||(delete Vr.animationend.animation,delete Vr.animationiteration.animation,delete Vr.animationstart.animation),"TransitionEvent"in window||delete Vr.transitionend.transition);function Ja(e){if(Kl[e])return Kl[e];if(!Vr[e])return e;var t=Vr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in a0)return Kl[e]=t[n];return e}var l0=Ja("animationend"),u0=Ja("animationiteration"),c0=Ja("animationstart"),d0=Ja("transitionend"),f0=new Map,Ah="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 Xn(e,t){f0.set(e,t),Cr(t,[e])}for(var Yl=0;Yl<Ah.length;Yl++){var Xl=Ah[Yl],sx=Xl.toLowerCase(),ax=Xl[0].toUpperCase()+Xl.slice(1);Xn(sx,"on"+ax)}Xn(l0,"onAnimationEnd");Xn(u0,"onAnimationIteration");Xn(c0,"onAnimationStart");Xn("dblclick","onDoubleClick");Xn("focusin","onFocus");Xn("focusout","onBlur");Xn(d0,"onTransitionEnd");ao("onMouseEnter",["mouseout","mouseover"]);ao("onMouseLeave",["mouseout","mouseover"]);ao("onPointerEnter",["pointerout","pointerover"]);ao("onPointerLeave",["pointerout","pointerover"]);Cr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Cr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Cr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Cr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Cr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Cr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qo="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(" "),lx=new Set("cancel close invalid load scroll toggle".split(" ").concat(Qo));function Oh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,s$(r,t,void 0,e),e.currentTarget=null}function h0(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;Oh(o,a,u),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;Oh(o,a,u),i=l}}}if(ca)throw e=Vu,ca=!1,Vu=null,e}function ge(e,t){var n=t[Gu];n===void 0&&(n=t[Gu]=new Set);var r=e+"__bubble";n.has(r)||(p0(t,e,2,!1),n.add(r))}function Gl(e,t,n){var r=0;t&&(r|=4),p0(n,e,r,t)}var gs="_reactListening"+Math.random().toString(36).slice(2);function Ni(e){if(!e[gs]){e[gs]=!0,$g.forEach(function(n){n!=="selectionchange"&&(lx.has(n)||Gl(n,!1,e),Gl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[gs]||(t[gs]=!0,Gl("selectionchange",!1,t))}}function p0(e,t,n,r){switch(Qg(t)){case 1:var o=x$;break;case 4:o=S$;break;default:o=nd}n=o.bind(null,t,n,e),o=void 0,!Lu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Ql(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=ar(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}Og(function(){var u=i,d=Zc(n),c=[];e:{var h=f0.get(e);if(h!==void 0){var g=od,y=e;switch(e){case"keypress":if(Bs(n)===0)break e;case"keydown":case"keyup":g=D$;break;case"focusin":y="focus",g=Bl;break;case"focusout":y="blur",g=Bl;break;case"beforeblur":case"afterblur":g=Bl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=kh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=N$;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=F$;break;case l0:case u0:case c0:g=b$;break;case d0:g=U$;break;case"scroll":g=E$;break;case"wheel":g=W$;break;case"copy":case"cut":case"paste":g=M$;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Ph}var v=(t&4)!==0,w=!v&&e==="scroll",f=v?h!==null?h+"Capture":null:h;v=[];for(var p=u,m;p!==null;){m=p;var _=m.stateNode;if(m.tag===5&&_!==null&&(m=_,f!==null&&(_=_i(p,f),_!=null&&v.push(Pi(p,_,m)))),w)break;p=p.return}0<v.length&&(h=new g(h,y,null,n,d),c.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",h&&n!==Ou&&(y=n.relatedTarget||n.fromElement)&&(ar(y)||y[pn]))break e;if((g||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,g?(y=n.relatedTarget||n.toElement,g=u,y=y?ar(y):null,y!==null&&(w=br(y),y!==w||y.tag!==5&&y.tag!==6)&&(y=null)):(g=null,y=u),g!==y)){if(v=kh,_="onMouseLeave",f="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(v=Ph,_="onPointerLeave",f="onPointerEnter",p="pointer"),w=g==null?h:Fr(g),m=y==null?h:Fr(y),h=new v(_,p+"leave",g,n,d),h.target=w,h.relatedTarget=m,_=null,ar(d)===u&&(v=new v(f,p+"enter",y,n,d),v.target=m,v.relatedTarget=w,_=v),w=_,g&&y)t:{for(v=g,f=y,p=0,m=v;m;m=Mr(m))p++;for(m=0,_=f;_;_=Mr(_))m++;for(;0<p-m;)v=Mr(v),p--;for(;0<m-p;)f=Mr(f),m--;for(;p--;){if(v===f||f!==null&&v===f.alternate)break t;v=Mr(v),f=Mr(f)}v=null}else v=null;g!==null&&Dh(c,h,g,v,!1),y!==null&&w!==null&&Dh(c,w,y,v,!0)}}e:{if(h=u?Fr(u):window,g=h.nodeName&&h.nodeName.toLowerCase(),g==="select"||g==="input"&&h.type==="file")var x=Z$;else if(jh(h))if(r0)x=nx;else{x=ex;var k=J$}else(g=h.nodeName)&&g.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(x=tx);if(x&&(x=x(e,u))){n0(c,x,n,d);break e}k&&k(e,h,u),e==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&Tu(h,"number",h.value)}switch(k=u?Fr(u):window,e){case"focusin":(jh(k)||k.contentEditable==="true")&&(Lr=k,Bu=u,si=null);break;case"focusout":si=Bu=Lr=null;break;case"mousedown":Wu=!0;break;case"contextmenu":case"mouseup":case"dragend":Wu=!1,Rh(c,n,d);break;case"selectionchange":if(ix)break;case"keydown":case"keyup":Rh(c,n,d)}var C;if(sd)e:{switch(e){case"compositionstart":var I="onCompositionStart";break e;case"compositionend":I="onCompositionEnd";break e;case"compositionupdate":I="onCompositionUpdate";break e}I=void 0}else Dr?e0(e,n)&&(I="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(I="onCompositionStart");I&&(Jg&&n.locale!=="ko"&&(Dr||I!=="onCompositionStart"?I==="onCompositionEnd"&&Dr&&(C=Zg()):(In=d,rd="value"in In?In.value:In.textContent,Dr=!0)),k=ma(u,I),0<k.length&&(I=new Nh(I,e,null,n,d),c.push({event:I,listeners:k}),C?I.data=C:(C=t0(n),C!==null&&(I.data=C)))),(C=K$?Y$(e,n):X$(e,n))&&(u=ma(u,"onBeforeInput"),0<u.length&&(d=new Nh("onBeforeInput","beforeinput",null,n,d),c.push({event:d,listeners:u}),d.data=C))}h0(c,t)})}function Pi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ma(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=_i(e,n),i!=null&&r.unshift(Pi(e,i,o)),i=_i(e,t),i!=null&&r.push(Pi(e,i,o))),e=e.return}return r}function Mr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Dh(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,o?(l=_i(n,i),l!=null&&s.unshift(Pi(n,l,a))):o||(l=_i(n,i),l!=null&&s.push(Pi(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var ux=/\r\n?/g,cx=/\u0000|\uFFFD/g;function Lh(e){return(typeof e=="string"?e:""+e).replace(ux,`
|
|
38
|
+
`).replace(cx,"")}function ys(e,t,n){if(t=Lh(t),Lh(e)!==t&&n)throw Error(K(425))}function ga(){}var qu=null,Ku=null;function Yu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xu=typeof setTimeout=="function"?setTimeout:void 0,dx=typeof clearTimeout=="function"?clearTimeout:void 0,Vh=typeof Promise=="function"?Promise:void 0,fx=typeof queueMicrotask=="function"?queueMicrotask:typeof Vh<"u"?function(e){return Vh.resolve(null).then(e).catch(hx)}:Xu;function hx(e){setTimeout(function(){throw e})}function Zl(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Si(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Si(t)}function Vn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Fh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Po=Math.random().toString(36).slice(2),Wt="__reactFiber$"+Po,Ci="__reactProps$"+Po,pn="__reactContainer$"+Po,Gu="__reactEvents$"+Po,px="__reactListeners$"+Po,mx="__reactHandles$"+Po;function ar(e){var t=e[Wt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pn]||n[Wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Fh(e);e!==null;){if(n=e[Wt])return n;e=Fh(e)}return t}e=n,n=e.parentNode}return null}function Xi(e){return e=e[Wt]||e[pn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Fr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(K(33))}function el(e){return e[Ci]||null}var Qu=[],Hr=-1;function Gn(e){return{current:e}}function ve(e){0>Hr||(e.current=Qu[Hr],Qu[Hr]=null,Hr--)}function me(e,t){Hr++,Qu[Hr]=e.current,e.current=t}var Yn={},qe=Gn(Yn),rt=Gn(!1),gr=Yn;function lo(e,t){var n=e.type.contextTypes;if(!n)return Yn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ot(e){return e=e.childContextTypes,e!=null}function ya(){ve(rt),ve(qe)}function Hh(e,t,n){if(qe.current!==Yn)throw Error(K(168));me(qe,t),me(rt,n)}function m0(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(K(108,J_(e)||"Unknown",o));return ke({},n,r)}function va(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yn,gr=qe.current,me(qe,e),me(rt,rt.current),!0}function Uh(e,t,n){var r=e.stateNode;if(!r)throw Error(K(169));n?(e=m0(e,t,gr),r.__reactInternalMemoizedMergedChildContext=e,ve(rt),ve(qe),me(qe,e)):ve(rt),me(rt,n)}var sn=null,tl=!1,Jl=!1;function g0(e){sn===null?sn=[e]:sn.push(e)}function gx(e){tl=!0,g0(e)}function Qn(){if(!Jl&&sn!==null){Jl=!0;var e=0,t=he;try{var n=sn;for(he=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}sn=null,tl=!1}catch(o){throw sn!==null&&(sn=sn.slice(e+1)),Fg(Jc,Qn),o}finally{he=t,Jl=!1}}return null}var Ur=[],Br=0,wa=null,_a=0,wt=[],_t=0,yr=null,an=1,ln="";function er(e,t){Ur[Br++]=_a,Ur[Br++]=wa,wa=e,_a=t}function y0(e,t,n){wt[_t++]=an,wt[_t++]=ln,wt[_t++]=yr,yr=e;var r=an;e=ln;var o=32-Dt(r)-1;r&=~(1<<o),n+=1;var i=32-Dt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,an=1<<32-Dt(t)+o|n<<o|r,ln=i+e}else an=1<<i|n<<o|r,ln=e}function ld(e){e.return!==null&&(er(e,1),y0(e,1,0))}function ud(e){for(;e===wa;)wa=Ur[--Br],Ur[Br]=null,_a=Ur[--Br],Ur[Br]=null;for(;e===yr;)yr=wt[--_t],wt[_t]=null,ln=wt[--_t],wt[_t]=null,an=wt[--_t],wt[_t]=null}var ct=null,ut=null,we=!1,It=null;function v0(e,t){var n=$t(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Bh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ct=e,ut=Vn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ct=e,ut=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=yr!==null?{id:an,overflow:ln}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=$t(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ct=e,ut=null,!0):!1;default:return!1}}function Zu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ju(e){if(we){var t=ut;if(t){var n=t;if(!Bh(e,t)){if(Zu(e))throw Error(K(418));t=Vn(n.nextSibling);var r=ct;t&&Bh(e,t)?v0(r,n):(e.flags=e.flags&-4097|2,we=!1,ct=e)}}else{if(Zu(e))throw Error(K(418));e.flags=e.flags&-4097|2,we=!1,ct=e}}}function Wh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ct=e}function vs(e){if(e!==ct)return!1;if(!we)return Wh(e),we=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Yu(e.type,e.memoizedProps)),t&&(t=ut)){if(Zu(e))throw w0(),Error(K(418));for(;t;)v0(e,t),t=Vn(t.nextSibling)}if(Wh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(K(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ut=Vn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ut=null}}else ut=ct?Vn(e.stateNode.nextSibling):null;return!0}function w0(){for(var e=ut;e;)e=Vn(e.nextSibling)}function uo(){ut=ct=null,we=!1}function cd(e){It===null?It=[e]:It.push(e)}var yx=wn.ReactCurrentBatchConfig;function Fo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(K(309));var r=n.stateNode}if(!r)throw Error(K(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=o.refs;s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(K(284));if(!n._owner)throw Error(K(290,e))}return e}function ws(e,t){throw e=Object.prototype.toString.call(t),Error(K(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function qh(e){var t=e._init;return t(e._payload)}function _0(e){function t(f,p){if(e){var m=f.deletions;m===null?(f.deletions=[p],f.flags|=16):m.push(p)}}function n(f,p){if(!e)return null;for(;p!==null;)t(f,p),p=p.sibling;return null}function r(f,p){for(f=new Map;p!==null;)p.key!==null?f.set(p.key,p):f.set(p.index,p),p=p.sibling;return f}function o(f,p){return f=Bn(f,p),f.index=0,f.sibling=null,f}function i(f,p,m){return f.index=m,e?(m=f.alternate,m!==null?(m=m.index,m<p?(f.flags|=2,p):m):(f.flags|=2,p)):(f.flags|=1048576,p)}function s(f){return e&&f.alternate===null&&(f.flags|=2),f}function a(f,p,m,_){return p===null||p.tag!==6?(p=su(m,f.mode,_),p.return=f,p):(p=o(p,m),p.return=f,p)}function l(f,p,m,_){var x=m.type;return x===Or?d(f,p,m.props.children,_,m.key):p!==null&&(p.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Cn&&qh(x)===p.type)?(_=o(p,m.props),_.ref=Fo(f,p,m),_.return=f,_):(_=Qs(m.type,m.key,m.props,null,f.mode,_),_.ref=Fo(f,p,m),_.return=f,_)}function u(f,p,m,_){return p===null||p.tag!==4||p.stateNode.containerInfo!==m.containerInfo||p.stateNode.implementation!==m.implementation?(p=au(m,f.mode,_),p.return=f,p):(p=o(p,m.children||[]),p.return=f,p)}function d(f,p,m,_,x){return p===null||p.tag!==7?(p=hr(m,f.mode,_,x),p.return=f,p):(p=o(p,m),p.return=f,p)}function c(f,p,m){if(typeof p=="string"&&p!==""||typeof p=="number")return p=su(""+p,f.mode,m),p.return=f,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case ls:return m=Qs(p.type,p.key,p.props,null,f.mode,m),m.ref=Fo(f,null,p),m.return=f,m;case Ar:return p=au(p,f.mode,m),p.return=f,p;case Cn:var _=p._init;return c(f,_(p._payload),m)}if(Xo(p)||Ao(p))return p=hr(p,f.mode,m,null),p.return=f,p;ws(f,p)}return null}function h(f,p,m,_){var x=p!==null?p.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return x!==null?null:a(f,p,""+m,_);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case ls:return m.key===x?l(f,p,m,_):null;case Ar:return m.key===x?u(f,p,m,_):null;case Cn:return x=m._init,h(f,p,x(m._payload),_)}if(Xo(m)||Ao(m))return x!==null?null:d(f,p,m,_,null);ws(f,m)}return null}function g(f,p,m,_,x){if(typeof _=="string"&&_!==""||typeof _=="number")return f=f.get(m)||null,a(p,f,""+_,x);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case ls:return f=f.get(_.key===null?m:_.key)||null,l(p,f,_,x);case Ar:return f=f.get(_.key===null?m:_.key)||null,u(p,f,_,x);case Cn:var k=_._init;return g(f,p,m,k(_._payload),x)}if(Xo(_)||Ao(_))return f=f.get(m)||null,d(p,f,_,x,null);ws(p,_)}return null}function y(f,p,m,_){for(var x=null,k=null,C=p,I=p=0,L=null;C!==null&&I<m.length;I++){C.index>I?(L=C,C=null):L=C.sibling;var U=h(f,C,m[I],_);if(U===null){C===null&&(C=L);break}e&&C&&U.alternate===null&&t(f,C),p=i(U,p,I),k===null?x=U:k.sibling=U,k=U,C=L}if(I===m.length)return n(f,C),we&&er(f,I),x;if(C===null){for(;I<m.length;I++)C=c(f,m[I],_),C!==null&&(p=i(C,p,I),k===null?x=C:k.sibling=C,k=C);return we&&er(f,I),x}for(C=r(f,C);I<m.length;I++)L=g(C,f,I,m[I],_),L!==null&&(e&&L.alternate!==null&&C.delete(L.key===null?I:L.key),p=i(L,p,I),k===null?x=L:k.sibling=L,k=L);return e&&C.forEach(function(T){return t(f,T)}),we&&er(f,I),x}function v(f,p,m,_){var x=Ao(m);if(typeof x!="function")throw Error(K(150));if(m=x.call(m),m==null)throw Error(K(151));for(var k=x=null,C=p,I=p=0,L=null,U=m.next();C!==null&&!U.done;I++,U=m.next()){C.index>I?(L=C,C=null):L=C.sibling;var T=h(f,C,U.value,_);if(T===null){C===null&&(C=L);break}e&&C&&T.alternate===null&&t(f,C),p=i(T,p,I),k===null?x=T:k.sibling=T,k=T,C=L}if(U.done)return n(f,C),we&&er(f,I),x;if(C===null){for(;!U.done;I++,U=m.next())U=c(f,U.value,_),U!==null&&(p=i(U,p,I),k===null?x=U:k.sibling=U,k=U);return we&&er(f,I),x}for(C=r(f,C);!U.done;I++,U=m.next())U=g(C,f,I,U.value,_),U!==null&&(e&&U.alternate!==null&&C.delete(U.key===null?I:U.key),p=i(U,p,I),k===null?x=U:k.sibling=U,k=U);return e&&C.forEach(function(O){return t(f,O)}),we&&er(f,I),x}function w(f,p,m,_){if(typeof m=="object"&&m!==null&&m.type===Or&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case ls:e:{for(var x=m.key,k=p;k!==null;){if(k.key===x){if(x=m.type,x===Or){if(k.tag===7){n(f,k.sibling),p=o(k,m.props.children),p.return=f,f=p;break e}}else if(k.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Cn&&qh(x)===k.type){n(f,k.sibling),p=o(k,m.props),p.ref=Fo(f,k,m),p.return=f,f=p;break e}n(f,k);break}else t(f,k);k=k.sibling}m.type===Or?(p=hr(m.props.children,f.mode,_,m.key),p.return=f,f=p):(_=Qs(m.type,m.key,m.props,null,f.mode,_),_.ref=Fo(f,p,m),_.return=f,f=_)}return s(f);case Ar:e:{for(k=m.key;p!==null;){if(p.key===k)if(p.tag===4&&p.stateNode.containerInfo===m.containerInfo&&p.stateNode.implementation===m.implementation){n(f,p.sibling),p=o(p,m.children||[]),p.return=f,f=p;break e}else{n(f,p);break}else t(f,p);p=p.sibling}p=au(m,f.mode,_),p.return=f,f=p}return s(f);case Cn:return k=m._init,w(f,p,k(m._payload),_)}if(Xo(m))return y(f,p,m,_);if(Ao(m))return v(f,p,m,_);ws(f,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,p!==null&&p.tag===6?(n(f,p.sibling),p=o(p,m),p.return=f,f=p):(n(f,p),p=su(m,f.mode,_),p.return=f,f=p),s(f)):n(f,p)}return w}var co=_0(!0),$0=_0(!1),$a=Gn(null),xa=null,Wr=null,dd=null;function fd(){dd=Wr=xa=null}function hd(e){var t=$a.current;ve($a),e._currentValue=t}function ec(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function to(e,t){xa=e,dd=Wr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(tt=!0),e.firstContext=null)}function Et(e){var t=e._currentValue;if(dd!==e)if(e={context:e,memoizedValue:t,next:null},Wr===null){if(xa===null)throw Error(K(308));Wr=e,xa.dependencies={lanes:0,firstContext:e}}else Wr=Wr.next=e;return t}var lr=null;function pd(e){lr===null?lr=[e]:lr.push(e)}function x0(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,pd(t)):(n.next=o.next,o.next=n),t.interleaved=n,mn(e,r)}function mn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var bn=!1;function md(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function S0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function cn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,de&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,mn(e,n)}return o=r.interleaved,o===null?(t.next=t,pd(r)):(t.next=o.next,o.next=t),r.interleaved=t,mn(e,n)}function Ws(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ed(e,n)}}function Kh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Sa(e,t,n,r){var o=e.updateQueue;bn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==s&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(i!==null){var c=o.baseState;s=0,d=u=l=null,a=i;do{var h=a.lane,g=a.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,v=a;switch(h=t,g=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){c=y.call(g,c,h);break e}c=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,h=typeof y=="function"?y.call(g,c,h):y,h==null)break e;c=ke({},c,h);break e;case 2:bn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[a]:h.push(a))}else g={eventTime:g,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=g,l=c):d=d.next=g,s|=h;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;h=a,a=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(!0);if(d===null&&(l=c),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);wr|=s,e.lanes=s,e.memoizedState=c}}function Yh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(K(191,o));o.call(r)}}}var Gi={},Xt=Gn(Gi),bi=Gn(Gi),ji=Gn(Gi);function ur(e){if(e===Gi)throw Error(K(174));return e}function gd(e,t){switch(me(ji,t),me(bi,e),me(Xt,Gi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:zu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=zu(t,e)}ve(Xt),me(Xt,t)}function fo(){ve(Xt),ve(bi),ve(ji)}function E0(e){ur(ji.current);var t=ur(Xt.current),n=zu(t,e.type);t!==n&&(me(bi,e),me(Xt,n))}function yd(e){bi.current===e&&(ve(Xt),ve(bi))}var Se=Gn(0);function Ea(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var eu=[];function vd(){for(var e=0;e<eu.length;e++)eu[e]._workInProgressVersionPrimary=null;eu.length=0}var qs=wn.ReactCurrentDispatcher,tu=wn.ReactCurrentBatchConfig,vr=0,Ee=null,Te=null,Re=null,ka=!1,ai=!1,Mi=0,vx=0;function He(){throw Error(K(321))}function wd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Vt(e[n],t[n]))return!1;return!0}function _d(e,t,n,r,o,i){if(vr=i,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,qs.current=e===null||e.memoizedState===null?xx:Sx,e=n(r,o),ai){i=0;do{if(ai=!1,Mi=0,25<=i)throw Error(K(301));i+=1,Re=Te=null,t.updateQueue=null,qs.current=Ex,e=n(r,o)}while(ai)}if(qs.current=Na,t=Te!==null&&Te.next!==null,vr=0,Re=Te=Ee=null,ka=!1,t)throw Error(K(300));return e}function $d(){var e=Mi!==0;return Mi=0,e}function Ut(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Re===null?Ee.memoizedState=Re=e:Re=Re.next=e,Re}function kt(){if(Te===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Te.next;var t=Re===null?Ee.memoizedState:Re.next;if(t!==null)Re=t,Te=e;else{if(e===null)throw Error(K(310));Te=e,e={memoizedState:Te.memoizedState,baseState:Te.baseState,baseQueue:Te.baseQueue,queue:Te.queue,next:null},Re===null?Ee.memoizedState=Re=e:Re=Re.next=e}return Re}function Ti(e,t){return typeof t=="function"?t(e):t}function nu(e){var t=kt(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=Te,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,u=i;do{var d=u.lane;if((vr&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var c={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=c,s=r):l=l.next=c,Ee.lanes|=d,wr|=d}u=u.next}while(u!==null&&u!==i);l===null?s=r:l.next=a,Vt(r,t.memoizedState)||(tt=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,Ee.lanes|=i,wr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ru(e){var t=kt(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);Vt(i,t.memoizedState)||(tt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function k0(){}function N0(e,t){var n=Ee,r=kt(),o=t(),i=!Vt(r.memoizedState,o);if(i&&(r.memoizedState=o,tt=!0),r=r.queue,xd(b0.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Re!==null&&Re.memoizedState.tag&1){if(n.flags|=2048,Ii(9,C0.bind(null,n,r,o,t),void 0,null),Ae===null)throw Error(K(349));vr&30||P0(n,t,o)}return o}function P0(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function C0(e,t,n,r){t.value=n,t.getSnapshot=r,j0(t)&&M0(e)}function b0(e,t,n){return n(function(){j0(t)&&M0(e)})}function j0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Vt(e,n)}catch{return!0}}function M0(e){var t=mn(e,1);t!==null&&Lt(t,e,1,-1)}function Xh(e){var t=Ut();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ti,lastRenderedState:e},t.queue=e,e=e.dispatch=$x.bind(null,Ee,e),[t.memoizedState,e]}function Ii(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function T0(){return kt().memoizedState}function Ks(e,t,n,r){var o=Ut();Ee.flags|=e,o.memoizedState=Ii(1|t,n,void 0,r===void 0?null:r)}function nl(e,t,n,r){var o=kt();r=r===void 0?null:r;var i=void 0;if(Te!==null){var s=Te.memoizedState;if(i=s.destroy,r!==null&&wd(r,s.deps)){o.memoizedState=Ii(t,n,i,r);return}}Ee.flags|=e,o.memoizedState=Ii(1|t,n,i,r)}function Gh(e,t){return Ks(8390656,8,e,t)}function xd(e,t){return nl(2048,8,e,t)}function I0(e,t){return nl(4,2,e,t)}function z0(e,t){return nl(4,4,e,t)}function R0(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function A0(e,t,n){return n=n!=null?n.concat([e]):null,nl(4,4,R0.bind(null,t,e),n)}function Sd(){}function O0(e,t){var n=kt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&wd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function D0(e,t){var n=kt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&wd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function L0(e,t,n){return vr&21?(Vt(n,t)||(n=Bg(),Ee.lanes|=n,wr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,tt=!0),e.memoizedState=n)}function wx(e,t){var n=he;he=n!==0&&4>n?n:4,e(!0);var r=tu.transition;tu.transition={};try{e(!1),t()}finally{he=n,tu.transition=r}}function V0(){return kt().memoizedState}function _x(e,t,n){var r=Un(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},F0(e))H0(t,n);else if(n=x0(e,t,n,r),n!==null){var o=Ge();Lt(n,e,r,o),U0(n,t,r)}}function $x(e,t,n){var r=Un(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(F0(e))H0(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,Vt(a,s)){var l=t.interleaved;l===null?(o.next=o,pd(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=x0(e,t,o,r),n!==null&&(o=Ge(),Lt(n,e,r,o),U0(n,t,r))}}function F0(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function H0(e,t){ai=ka=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function U0(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ed(e,n)}}var Na={readContext:Et,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useInsertionEffect:He,useLayoutEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useMutableSource:He,useSyncExternalStore:He,useId:He,unstable_isNewReconciler:!1},xx={readContext:Et,useCallback:function(e,t){return Ut().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:Gh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ks(4194308,4,R0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ks(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ks(4,2,e,t)},useMemo:function(e,t){var n=Ut();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ut();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=_x.bind(null,Ee,e),[r.memoizedState,e]},useRef:function(e){var t=Ut();return e={current:e},t.memoizedState=e},useState:Xh,useDebugValue:Sd,useDeferredValue:function(e){return Ut().memoizedState=e},useTransition:function(){var e=Xh(!1),t=e[0];return e=wx.bind(null,e[1]),Ut().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ee,o=Ut();if(we){if(n===void 0)throw Error(K(407));n=n()}else{if(n=t(),Ae===null)throw Error(K(349));vr&30||P0(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Gh(b0.bind(null,r,i,e),[e]),r.flags|=2048,Ii(9,C0.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ut(),t=Ae.identifierPrefix;if(we){var n=ln,r=an;n=(r&~(1<<32-Dt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Mi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=vx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Sx={readContext:Et,useCallback:O0,useContext:Et,useEffect:xd,useImperativeHandle:A0,useInsertionEffect:I0,useLayoutEffect:z0,useMemo:D0,useReducer:nu,useRef:T0,useState:function(){return nu(Ti)},useDebugValue:Sd,useDeferredValue:function(e){var t=kt();return L0(t,Te.memoizedState,e)},useTransition:function(){var e=nu(Ti)[0],t=kt().memoizedState;return[e,t]},useMutableSource:k0,useSyncExternalStore:N0,useId:V0,unstable_isNewReconciler:!1},Ex={readContext:Et,useCallback:O0,useContext:Et,useEffect:xd,useImperativeHandle:A0,useInsertionEffect:I0,useLayoutEffect:z0,useMemo:D0,useReducer:ru,useRef:T0,useState:function(){return ru(Ti)},useDebugValue:Sd,useDeferredValue:function(e){var t=kt();return Te===null?t.memoizedState=e:L0(t,Te.memoizedState,e)},useTransition:function(){var e=ru(Ti)[0],t=kt().memoizedState;return[e,t]},useMutableSource:k0,useSyncExternalStore:N0,useId:V0,unstable_isNewReconciler:!1};function jt(e,t){if(e&&e.defaultProps){t=ke({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function tc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ke({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var rl={isMounted:function(e){return(e=e._reactInternals)?br(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ge(),o=Un(e),i=cn(r,o);i.payload=t,n!=null&&(i.callback=n),t=Fn(e,i,o),t!==null&&(Lt(t,e,o,r),Ws(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ge(),o=Un(e),i=cn(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Fn(e,i,o),t!==null&&(Lt(t,e,o,r),Ws(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ge(),r=Un(e),o=cn(n,r);o.tag=2,t!=null&&(o.callback=t),t=Fn(e,o,r),t!==null&&(Lt(t,e,r,n),Ws(t,e,r))}};function Qh(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!ki(n,r)||!ki(o,i):!0}function B0(e,t,n){var r=!1,o=Yn,i=t.contextType;return typeof i=="object"&&i!==null?i=Et(i):(o=ot(t)?gr:qe.current,r=t.contextTypes,i=(r=r!=null)?lo(e,o):Yn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=rl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Zh(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&rl.enqueueReplaceState(t,t.state,null)}function nc(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},md(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Et(i):(i=ot(t)?gr:qe.current,o.context=lo(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(tc(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&rl.enqueueReplaceState(o,o.state,null),Sa(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function ho(e,t){try{var n="",r=t;do n+=Z_(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
39
|
+
Error generating stack: `+i.message+`
|
|
40
|
+
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function ou(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function rc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var kx=typeof WeakMap=="function"?WeakMap:Map;function W0(e,t,n){n=cn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ca||(Ca=!0,hc=r),rc(e,t)},n}function q0(e,t,n){n=cn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){rc(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){rc(e,t),typeof r!="function"&&(Hn===null?Hn=new Set([this]):Hn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Jh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new kx;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Lx.bind(null,e,t,n),t.then(e,e))}function ep(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function tp(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=cn(-1,1),t.tag=2,Fn(n,t,1))),n.lanes|=1),e)}var Nx=wn.ReactCurrentOwner,tt=!1;function Ke(e,t,n,r){t.child=e===null?$0(t,null,n,r):co(t,e.child,n,r)}function np(e,t,n,r,o){n=n.render;var i=t.ref;return to(t,o),r=_d(e,t,n,r,i,o),n=$d(),e!==null&&!tt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,gn(e,t,o)):(we&&n&&ld(t),t.flags|=1,Ke(e,t,r,o),t.child)}function rp(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Md(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,K0(e,t,i,r,o)):(e=Qs(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:ki,n(s,r)&&e.ref===t.ref)return gn(e,t,o)}return t.flags|=1,e=Bn(i,r),e.ref=t.ref,e.return=t,t.child=e}function K0(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(ki(i,r)&&e.ref===t.ref)if(tt=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(tt=!0);else return t.lanes=e.lanes,gn(e,t,o)}return oc(e,t,n,r,o)}function Y0(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},me(Kr,at),at|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,me(Kr,at),at|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,me(Kr,at),at|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,me(Kr,at),at|=r;return Ke(e,t,o,n),t.child}function X0(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function oc(e,t,n,r,o){var i=ot(n)?gr:qe.current;return i=lo(t,i),to(t,o),n=_d(e,t,n,r,i,o),r=$d(),e!==null&&!tt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,gn(e,t,o)):(we&&r&&ld(t),t.flags|=1,Ke(e,t,n,o),t.child)}function op(e,t,n,r,o){if(ot(n)){var i=!0;va(t)}else i=!1;if(to(t,o),t.stateNode===null)Ys(e,t),B0(t,n,r),nc(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Et(u):(u=ot(n)?gr:qe.current,u=lo(t,u));var d=n.getDerivedStateFromProps,c=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";c||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&Zh(t,s,r,u),bn=!1;var h=t.memoizedState;s.state=h,Sa(t,r,s,o),l=t.memoizedState,a!==r||h!==l||rt.current||bn?(typeof d=="function"&&(tc(t,n,d,r),l=t.memoizedState),(a=bn||Qh(t,n,a,r,h,l,u))?(c||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,S0(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:jt(t.type,a),s.props=u,c=t.pendingProps,h=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Et(l):(l=ot(n)?gr:qe.current,l=lo(t,l));var g=n.getDerivedStateFromProps;(d=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==c||h!==l)&&Zh(t,s,r,l),bn=!1,h=t.memoizedState,s.state=h,Sa(t,r,s,o);var y=t.memoizedState;a!==c||h!==y||rt.current||bn?(typeof g=="function"&&(tc(t,n,g,r),y=t.memoizedState),(u=bn||Qh(t,n,u,r,h,y,l)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),s.props=r,s.state=y,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return ic(e,t,n,r,i,o)}function ic(e,t,n,r,o,i){X0(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Uh(t,n,!1),gn(e,t,i);r=t.stateNode,Nx.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=co(t,e.child,null,i),t.child=co(t,null,a,i)):Ke(e,t,a,i),t.memoizedState=r.state,o&&Uh(t,n,!0),t.child}function G0(e){var t=e.stateNode;t.pendingContext?Hh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Hh(e,t.context,!1),gd(e,t.containerInfo)}function ip(e,t,n,r,o){return uo(),cd(o),t.flags|=256,Ke(e,t,n,r),t.child}var sc={dehydrated:null,treeContext:null,retryLane:0};function ac(e){return{baseLanes:e,cachePool:null,transitions:null}}function Q0(e,t,n){var r=t.pendingProps,o=Se.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),me(Se,o&1),e===null)return Ju(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=sl(s,r,0,null),e=hr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=ac(n),t.memoizedState=sc,e):Ed(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return Px(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Bn(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Bn(a,i):(i=hr(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?ac(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=sc,r}return i=e.child,e=i.sibling,r=Bn(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ed(e,t){return t=sl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function _s(e,t,n,r){return r!==null&&cd(r),co(t,e.child,null,n),e=Ed(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Px(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=ou(Error(K(422))),_s(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=sl({mode:"visible",children:r.children},o,0,null),i=hr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&co(t,e.child,null,s),t.child.memoizedState=ac(s),t.memoizedState=sc,i);if(!(t.mode&1))return _s(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(K(419)),r=ou(i,r,void 0),_s(e,t,s,r)}if(a=(s&e.childLanes)!==0,tt||a){if(r=Ae,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,mn(e,o),Lt(r,e,o,-1))}return jd(),r=ou(Error(K(421))),_s(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Vx.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,ut=Vn(o.nextSibling),ct=t,we=!0,It=null,e!==null&&(wt[_t++]=an,wt[_t++]=ln,wt[_t++]=yr,an=e.id,ln=e.overflow,yr=t),t=Ed(t,r.children),t.flags|=4096,t)}function sp(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ec(e.return,t,n)}function iu(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Z0(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Ke(e,t,r.children,n),r=Se.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&sp(e,n,t);else if(e.tag===19)sp(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(me(Se,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Ea(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),iu(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Ea(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}iu(t,!0,n,null,i);break;case"together":iu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ys(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function gn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),wr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(K(153));if(t.child!==null){for(e=t.child,n=Bn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Bn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cx(e,t,n){switch(t.tag){case 3:G0(t),uo();break;case 5:E0(t);break;case 1:ot(t.type)&&va(t);break;case 4:gd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;me($a,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(me(Se,Se.current&1),t.flags|=128,null):n&t.child.childLanes?Q0(e,t,n):(me(Se,Se.current&1),e=gn(e,t,n),e!==null?e.sibling:null);me(Se,Se.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Z0(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),me(Se,Se.current),r)break;return null;case 22:case 23:return t.lanes=0,Y0(e,t,n)}return gn(e,t,n)}var J0,lc,ey,ty;J0=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};lc=function(){};ey=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,ur(Xt.current);var i=null;switch(n){case"input":o=ju(e,o),r=ju(e,r),i=[];break;case"select":o=ke({},o,{value:void 0}),r=ke({},r,{value:void 0}),i=[];break;case"textarea":o=Iu(e,o),r=Iu(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ga)}Ru(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var a=o[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(vi.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(a=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(vi.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&ge("scroll",e),i||a===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};ty=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ho(e,t){if(!we)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ue(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function bx(e,t,n){var r=t.pendingProps;switch(ud(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ue(t),null;case 1:return ot(t.type)&&ya(),Ue(t),null;case 3:return r=t.stateNode,fo(),ve(rt),ve(qe),vd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(vs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,It!==null&&(gc(It),It=null))),lc(e,t),Ue(t),null;case 5:yd(t);var o=ur(ji.current);if(n=t.type,e!==null&&t.stateNode!=null)ey(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(K(166));return Ue(t),null}if(e=ur(Xt.current),vs(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Wt]=t,r[Ci]=i,e=(t.mode&1)!==0,n){case"dialog":ge("cancel",r),ge("close",r);break;case"iframe":case"object":case"embed":ge("load",r);break;case"video":case"audio":for(o=0;o<Qo.length;o++)ge(Qo[o],r);break;case"source":ge("error",r);break;case"img":case"image":case"link":ge("error",r),ge("load",r);break;case"details":ge("toggle",r);break;case"input":mh(r,i),ge("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ge("invalid",r);break;case"textarea":yh(r,i),ge("invalid",r)}Ru(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&ys(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&ys(r.textContent,a,e),o=["children",""+a]):vi.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&ge("scroll",r)}switch(n){case"input":us(r),gh(r,i,!0);break;case"textarea":us(r),vh(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=ga)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=bg(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Wt]=t,e[Ci]=r,J0(e,t,!1,!1),t.stateNode=e;e:{switch(s=Au(n,r),n){case"dialog":ge("cancel",e),ge("close",e),o=r;break;case"iframe":case"object":case"embed":ge("load",e),o=r;break;case"video":case"audio":for(o=0;o<Qo.length;o++)ge(Qo[o],e);o=r;break;case"source":ge("error",e),o=r;break;case"img":case"image":case"link":ge("error",e),ge("load",e),o=r;break;case"details":ge("toggle",e),o=r;break;case"input":mh(e,r),o=ju(e,r),ge("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=ke({},r,{value:void 0}),ge("invalid",e);break;case"textarea":yh(e,r),o=Iu(e,r),ge("invalid",e);break;default:o=r}Ru(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Tg(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&jg(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&wi(e,l):typeof l=="number"&&wi(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(vi.hasOwnProperty(i)?l!=null&&i==="onScroll"&&ge("scroll",e):l!=null&&Yc(e,i,l,s))}switch(n){case"input":us(e),gh(e,r,!1);break;case"textarea":us(e),vh(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Kn(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Qr(e,!!r.multiple,i,!1):r.defaultValue!=null&&Qr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=ga)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ue(t),null;case 6:if(e&&t.stateNode!=null)ty(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(K(166));if(n=ur(ji.current),ur(Xt.current),vs(t)){if(r=t.stateNode,n=t.memoizedProps,r[Wt]=t,(i=r.nodeValue!==n)&&(e=ct,e!==null))switch(e.tag){case 3:ys(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ys(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Wt]=t,t.stateNode=r}return Ue(t),null;case 13:if(ve(Se),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(we&&ut!==null&&t.mode&1&&!(t.flags&128))w0(),uo(),t.flags|=98560,i=!1;else if(i=vs(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(K(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(K(317));i[Wt]=t}else uo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ue(t),i=!1}else It!==null&&(gc(It),It=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Se.current&1?ze===0&&(ze=3):jd())),t.updateQueue!==null&&(t.flags|=4),Ue(t),null);case 4:return fo(),lc(e,t),e===null&&Ni(t.stateNode.containerInfo),Ue(t),null;case 10:return hd(t.type._context),Ue(t),null;case 17:return ot(t.type)&&ya(),Ue(t),null;case 19:if(ve(Se),i=t.memoizedState,i===null)return Ue(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Ho(i,!1);else{if(ze!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Ea(e),s!==null){for(t.flags|=128,Ho(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return me(Se,Se.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ce()>po&&(t.flags|=128,r=!0,Ho(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ea(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ho(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!we)return Ue(t),null}else 2*Ce()-i.renderingStartTime>po&&n!==1073741824&&(t.flags|=128,r=!0,Ho(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ce(),t.sibling=null,n=Se.current,me(Se,r?n&1|2:n&1),t):(Ue(t),null);case 22:case 23:return bd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?at&1073741824&&(Ue(t),t.subtreeFlags&6&&(t.flags|=8192)):Ue(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function jx(e,t){switch(ud(t),t.tag){case 1:return ot(t.type)&&ya(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fo(),ve(rt),ve(qe),vd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yd(t),null;case 13:if(ve(Se),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));uo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ve(Se),null;case 4:return fo(),null;case 10:return hd(t.type._context),null;case 22:case 23:return bd(),null;case 24:return null;default:return null}}var $s=!1,We=!1,Mx=typeof WeakSet=="function"?WeakSet:Set,Q=null;function qr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ne(e,t,r)}else n.current=null}function uc(e,t,n){try{n()}catch(r){Ne(e,t,r)}}var ap=!1;function Tx(e,t){if(qu=ha,e=s0(),ad(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,d=0,c=e,h=null;t:for(;;){for(var g;c!==n||o!==0&&c.nodeType!==3||(a=s+o),c!==i||r!==0&&c.nodeType!==3||(l=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(g=c.firstChild)!==null;)h=c,c=g;for(;;){if(c===e)break t;if(h===n&&++u===o&&(a=s),h===i&&++d===r&&(l=s),(g=c.nextSibling)!==null)break;c=h,h=c.parentNode}c=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ku={focusedElem:e,selectionRange:n},ha=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,w=y.memoizedState,f=t.stateNode,p=f.getSnapshotBeforeUpdate(t.elementType===t.type?v:jt(t.type,v),w);f.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(_){Ne(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return y=ap,ap=!1,y}function li(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&uc(t,n,i)}o=o.next}while(o!==r)}}function ol(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function cc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function ny(e){var t=e.alternate;t!==null&&(e.alternate=null,ny(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wt],delete t[Ci],delete t[Gu],delete t[px],delete t[mx])),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 ry(e){return e.tag===5||e.tag===3||e.tag===4}function lp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ry(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 dc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ga));else if(r!==4&&(e=e.child,e!==null))for(dc(e,t,n),e=e.sibling;e!==null;)dc(e,t,n),e=e.sibling}function fc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(fc(e,t,n),e=e.sibling;e!==null;)fc(e,t,n),e=e.sibling}var De=null,Mt=!1;function xn(e,t,n){for(n=n.child;n!==null;)oy(e,t,n),n=n.sibling}function oy(e,t,n){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(Ga,n)}catch{}switch(n.tag){case 5:We||qr(n,t);case 6:var r=De,o=Mt;De=null,xn(e,t,n),De=r,Mt=o,De!==null&&(Mt?(e=De,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):De.removeChild(n.stateNode));break;case 18:De!==null&&(Mt?(e=De,n=n.stateNode,e.nodeType===8?Zl(e.parentNode,n):e.nodeType===1&&Zl(e,n),Si(e)):Zl(De,n.stateNode));break;case 4:r=De,o=Mt,De=n.stateNode.containerInfo,Mt=!0,xn(e,t,n),De=r,Mt=o;break;case 0:case 11:case 14:case 15:if(!We&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&uc(n,t,s),o=o.next}while(o!==r)}xn(e,t,n);break;case 1:if(!We&&(qr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ne(n,t,a)}xn(e,t,n);break;case 21:xn(e,t,n);break;case 22:n.mode&1?(We=(r=We)||n.memoizedState!==null,xn(e,t,n),We=r):xn(e,t,n);break;default:xn(e,t,n)}}function up(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Mx),t.forEach(function(r){var o=Fx.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Pt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:De=a.stateNode,Mt=!1;break e;case 3:De=a.stateNode.containerInfo,Mt=!0;break e;case 4:De=a.stateNode.containerInfo,Mt=!0;break e}a=a.return}if(De===null)throw Error(K(160));oy(i,s,o),De=null,Mt=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Ne(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)iy(t,e),t=t.sibling}function iy(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Pt(t,e),Ht(e),r&4){try{li(3,e,e.return),ol(3,e)}catch(v){Ne(e,e.return,v)}try{li(5,e,e.return)}catch(v){Ne(e,e.return,v)}}break;case 1:Pt(t,e),Ht(e),r&512&&n!==null&&qr(n,n.return);break;case 5:if(Pt(t,e),Ht(e),r&512&&n!==null&&qr(n,n.return),e.flags&32){var o=e.stateNode;try{wi(o,"")}catch(v){Ne(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Pg(o,i),Au(a,s);var u=Au(a,i);for(s=0;s<l.length;s+=2){var d=l[s],c=l[s+1];d==="style"?Tg(o,c):d==="dangerouslySetInnerHTML"?jg(o,c):d==="children"?wi(o,c):Yc(o,d,c,u)}switch(a){case"input":Mu(o,i);break;case"textarea":Cg(o,i);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var g=i.value;g!=null?Qr(o,!!i.multiple,g,!1):h!==!!i.multiple&&(i.defaultValue!=null?Qr(o,!!i.multiple,i.defaultValue,!0):Qr(o,!!i.multiple,i.multiple?[]:"",!1))}o[Ci]=i}catch(v){Ne(e,e.return,v)}}break;case 6:if(Pt(t,e),Ht(e),r&4){if(e.stateNode===null)throw Error(K(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){Ne(e,e.return,v)}}break;case 3:if(Pt(t,e),Ht(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Si(t.containerInfo)}catch(v){Ne(e,e.return,v)}break;case 4:Pt(t,e),Ht(e);break;case 13:Pt(t,e),Ht(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Pd=Ce())),r&4&&up(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(We=(u=We)||d,Pt(t,e),We=u):Pt(t,e),Ht(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Q=e,d=e.child;d!==null;){for(c=Q=d;Q!==null;){switch(h=Q,g=h.child,h.tag){case 0:case 11:case 14:case 15:li(4,h,h.return);break;case 1:qr(h,h.return);var y=h.stateNode;if(typeof y.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){Ne(r,n,v)}}break;case 5:qr(h,h.return);break;case 22:if(h.memoizedState!==null){dp(c);continue}}g!==null?(g.return=h,Q=g):dp(c)}d=d.sibling}e:for(d=null,c=e;;){if(c.tag===5){if(d===null){d=c;try{o=c.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=c.stateNode,l=c.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Mg("display",s))}catch(v){Ne(e,e.return,v)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(v){Ne(e,e.return,v)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:Pt(t,e),Ht(e),r&4&&up(e);break;case 21:break;default:Pt(t,e),Ht(e)}}function Ht(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ry(n)){var r=n;break e}n=n.return}throw Error(K(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(wi(o,""),r.flags&=-33);var i=lp(e);fc(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=lp(e);dc(e,a,s);break;default:throw Error(K(161))}}catch(l){Ne(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ix(e,t,n){Q=e,sy(e)}function sy(e,t,n){for(var r=(e.mode&1)!==0;Q!==null;){var o=Q,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||$s;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||We;a=$s;var u=We;if($s=s,(We=l)&&!u)for(Q=o;Q!==null;)s=Q,l=s.child,s.tag===22&&s.memoizedState!==null?fp(o):l!==null?(l.return=s,Q=l):fp(o);for(;i!==null;)Q=i,sy(i),i=i.sibling;Q=o,$s=a,We=u}cp(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,Q=i):cp(e)}}function cp(e){for(;Q!==null;){var t=Q;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:We||ol(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!We)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:jt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Yh(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Yh(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var c=d.dehydrated;c!==null&&Si(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(K(163))}We||t.flags&512&&cc(t)}catch(h){Ne(t,t.return,h)}}if(t===e){Q=null;break}if(n=t.sibling,n!==null){n.return=t.return,Q=n;break}Q=t.return}}function dp(e){for(;Q!==null;){var t=Q;if(t===e){Q=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Q=n;break}Q=t.return}}function fp(e){for(;Q!==null;){var t=Q;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ol(4,t)}catch(l){Ne(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Ne(t,o,l)}}var i=t.return;try{cc(t)}catch(l){Ne(t,i,l)}break;case 5:var s=t.return;try{cc(t)}catch(l){Ne(t,s,l)}}}catch(l){Ne(t,t.return,l)}if(t===e){Q=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Q=a;break}Q=t.return}}var zx=Math.ceil,Pa=wn.ReactCurrentDispatcher,kd=wn.ReactCurrentOwner,xt=wn.ReactCurrentBatchConfig,de=0,Ae=null,je=null,Ve=0,at=0,Kr=Gn(0),ze=0,zi=null,wr=0,il=0,Nd=0,ui=null,et=null,Pd=0,po=1/0,on=null,Ca=!1,hc=null,Hn=null,xs=!1,zn=null,ba=0,ci=0,pc=null,Xs=-1,Gs=0;function Ge(){return de&6?Ce():Xs!==-1?Xs:Xs=Ce()}function Un(e){return e.mode&1?de&2&&Ve!==0?Ve&-Ve:yx.transition!==null?(Gs===0&&(Gs=Bg()),Gs):(e=he,e!==0||(e=window.event,e=e===void 0?16:Qg(e.type)),e):1}function Lt(e,t,n,r){if(50<ci)throw ci=0,pc=null,Error(K(185));Ki(e,n,r),(!(de&2)||e!==Ae)&&(e===Ae&&(!(de&2)&&(il|=n),ze===4&&Mn(e,Ve)),it(e,r),n===1&&de===0&&!(t.mode&1)&&(po=Ce()+500,tl&&Qn()))}function it(e,t){var n=e.callbackNode;y$(e,t);var r=fa(e,e===Ae?Ve:0);if(r===0)n!==null&&$h(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&$h(n),t===1)e.tag===0?gx(hp.bind(null,e)):g0(hp.bind(null,e)),fx(function(){!(de&6)&&Qn()}),n=null;else{switch(Wg(r)){case 1:n=Jc;break;case 4:n=Hg;break;case 16:n=da;break;case 536870912:n=Ug;break;default:n=da}n=py(n,ay.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ay(e,t){if(Xs=-1,Gs=0,de&6)throw Error(K(327));var n=e.callbackNode;if(no()&&e.callbackNode!==n)return null;var r=fa(e,e===Ae?Ve:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ja(e,r);else{t=r;var o=de;de|=2;var i=uy();(Ae!==e||Ve!==t)&&(on=null,po=Ce()+500,fr(e,t));do try{Ox();break}catch(a){ly(e,a)}while(!0);fd(),Pa.current=i,de=o,je!==null?t=0:(Ae=null,Ve=0,t=ze)}if(t!==0){if(t===2&&(o=Fu(e),o!==0&&(r=o,t=mc(e,o))),t===1)throw n=zi,fr(e,0),Mn(e,r),it(e,Ce()),n;if(t===6)Mn(e,r);else{if(o=e.current.alternate,!(r&30)&&!Rx(o)&&(t=ja(e,r),t===2&&(i=Fu(e),i!==0&&(r=i,t=mc(e,i))),t===1))throw n=zi,fr(e,0),Mn(e,r),it(e,Ce()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(K(345));case 2:tr(e,et,on);break;case 3:if(Mn(e,r),(r&130023424)===r&&(t=Pd+500-Ce(),10<t)){if(fa(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ge(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Xu(tr.bind(null,e,et,on),t);break}tr(e,et,on);break;case 4:if(Mn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Dt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Ce()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*zx(r/1960))-r,10<r){e.timeoutHandle=Xu(tr.bind(null,e,et,on),r);break}tr(e,et,on);break;case 5:tr(e,et,on);break;default:throw Error(K(329))}}}return it(e,Ce()),e.callbackNode===n?ay.bind(null,e):null}function mc(e,t){var n=ui;return e.current.memoizedState.isDehydrated&&(fr(e,t).flags|=256),e=ja(e,t),e!==2&&(t=et,et=n,t!==null&&gc(t)),e}function gc(e){et===null?et=e:et.push.apply(et,e)}function Rx(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!Vt(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Mn(e,t){for(t&=~Nd,t&=~il,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Dt(t),r=1<<n;e[n]=-1,t&=~r}}function hp(e){if(de&6)throw Error(K(327));no();var t=fa(e,0);if(!(t&1))return it(e,Ce()),null;var n=ja(e,t);if(e.tag!==0&&n===2){var r=Fu(e);r!==0&&(t=r,n=mc(e,r))}if(n===1)throw n=zi,fr(e,0),Mn(e,t),it(e,Ce()),n;if(n===6)throw Error(K(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,tr(e,et,on),it(e,Ce()),null}function Cd(e,t){var n=de;de|=1;try{return e(t)}finally{de=n,de===0&&(po=Ce()+500,tl&&Qn())}}function _r(e){zn!==null&&zn.tag===0&&!(de&6)&&no();var t=de;de|=1;var n=xt.transition,r=he;try{if(xt.transition=null,he=1,e)return e()}finally{he=r,xt.transition=n,de=t,!(de&6)&&Qn()}}function bd(){at=Kr.current,ve(Kr)}function fr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,dx(n)),je!==null)for(n=je.return;n!==null;){var r=n;switch(ud(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ya();break;case 3:fo(),ve(rt),ve(qe),vd();break;case 5:yd(r);break;case 4:fo();break;case 13:ve(Se);break;case 19:ve(Se);break;case 10:hd(r.type._context);break;case 22:case 23:bd()}n=n.return}if(Ae=e,je=e=Bn(e.current,null),Ve=at=t,ze=0,zi=null,Nd=il=wr=0,et=ui=null,lr!==null){for(t=0;t<lr.length;t++)if(n=lr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}lr=null}return e}function ly(e,t){do{var n=je;try{if(fd(),qs.current=Na,ka){for(var r=Ee.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ka=!1}if(vr=0,Re=Te=Ee=null,ai=!1,Mi=0,kd.current=null,n===null||n.return===null){ze=1,zi=t,je=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=Ve,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=a,c=d.tag;if(!(d.mode&1)&&(c===0||c===11||c===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var g=ep(s);if(g!==null){g.flags&=-257,tp(g,s,a,i,t),g.mode&1&&Jh(i,u,t),t=g,l=u;var y=t.updateQueue;if(y===null){var v=new Set;v.add(l),t.updateQueue=v}else y.add(l);break e}else{if(!(t&1)){Jh(i,u,t),jd();break e}l=Error(K(426))}}else if(we&&a.mode&1){var w=ep(s);if(w!==null){!(w.flags&65536)&&(w.flags|=256),tp(w,s,a,i,t),cd(ho(l,a));break e}}i=l=ho(l,a),ze!==4&&(ze=2),ui===null?ui=[i]:ui.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var f=W0(i,l,t);Kh(i,f);break e;case 1:a=l;var p=i.type,m=i.stateNode;if(!(i.flags&128)&&(typeof p.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Hn===null||!Hn.has(m)))){i.flags|=65536,t&=-t,i.lanes|=t;var _=q0(i,a,t);Kh(i,_);break e}}i=i.return}while(i!==null)}dy(n)}catch(x){t=x,je===n&&n!==null&&(je=n=n.return);continue}break}while(!0)}function uy(){var e=Pa.current;return Pa.current=Na,e===null?Na:e}function jd(){(ze===0||ze===3||ze===2)&&(ze=4),Ae===null||!(wr&268435455)&&!(il&268435455)||Mn(Ae,Ve)}function ja(e,t){var n=de;de|=2;var r=uy();(Ae!==e||Ve!==t)&&(on=null,fr(e,t));do try{Ax();break}catch(o){ly(e,o)}while(!0);if(fd(),de=n,Pa.current=r,je!==null)throw Error(K(261));return Ae=null,Ve=0,ze}function Ax(){for(;je!==null;)cy(je)}function Ox(){for(;je!==null&&!l$();)cy(je)}function cy(e){var t=hy(e.alternate,e,at);e.memoizedProps=e.pendingProps,t===null?dy(e):je=t,kd.current=null}function dy(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=jx(n,t),n!==null){n.flags&=32767,je=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ze=6,je=null;return}}else if(n=bx(n,t,at),n!==null){je=n;return}if(t=t.sibling,t!==null){je=t;return}je=t=e}while(t!==null);ze===0&&(ze=5)}function tr(e,t,n){var r=he,o=xt.transition;try{xt.transition=null,he=1,Dx(e,t,n,r)}finally{xt.transition=o,he=r}return null}function Dx(e,t,n,r){do no();while(zn!==null);if(de&6)throw Error(K(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(K(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(v$(e,i),e===Ae&&(je=Ae=null,Ve=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||xs||(xs=!0,py(da,function(){return no(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=xt.transition,xt.transition=null;var s=he;he=1;var a=de;de|=4,kd.current=null,Tx(e,n),iy(n,e),ox(Ku),ha=!!qu,Ku=qu=null,e.current=n,Ix(n),u$(),de=a,he=s,xt.transition=i}else e.current=n;if(xs&&(xs=!1,zn=e,ba=o),i=e.pendingLanes,i===0&&(Hn=null),f$(n.stateNode),it(e,Ce()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Ca)throw Ca=!1,e=hc,hc=null,e;return ba&1&&e.tag!==0&&no(),i=e.pendingLanes,i&1?e===pc?ci++:(ci=0,pc=e):ci=0,Qn(),null}function no(){if(zn!==null){var e=Wg(ba),t=xt.transition,n=he;try{if(xt.transition=null,he=16>e?16:e,zn===null)var r=!1;else{if(e=zn,zn=null,ba=0,de&6)throw Error(K(331));var o=de;for(de|=4,Q=e.current;Q!==null;){var i=Q,s=i.child;if(Q.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(Q=u;Q!==null;){var d=Q;switch(d.tag){case 0:case 11:case 15:li(8,d,i)}var c=d.child;if(c!==null)c.return=d,Q=c;else for(;Q!==null;){d=Q;var h=d.sibling,g=d.return;if(ny(d),d===u){Q=null;break}if(h!==null){h.return=g,Q=h;break}Q=g}}}var y=i.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var w=v.sibling;v.sibling=null,v=w}while(v!==null)}}Q=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,Q=s;else e:for(;Q!==null;){if(i=Q,i.flags&2048)switch(i.tag){case 0:case 11:case 15:li(9,i,i.return)}var f=i.sibling;if(f!==null){f.return=i.return,Q=f;break e}Q=i.return}}var p=e.current;for(Q=p;Q!==null;){s=Q;var m=s.child;if(s.subtreeFlags&2064&&m!==null)m.return=s,Q=m;else e:for(s=p;Q!==null;){if(a=Q,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ol(9,a)}}catch(x){Ne(a,a.return,x)}if(a===s){Q=null;break e}var _=a.sibling;if(_!==null){_.return=a.return,Q=_;break e}Q=a.return}}if(de=o,Qn(),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(Ga,e)}catch{}r=!0}return r}finally{he=n,xt.transition=t}}return!1}function pp(e,t,n){t=ho(n,t),t=W0(e,t,1),e=Fn(e,t,1),t=Ge(),e!==null&&(Ki(e,1,t),it(e,t))}function Ne(e,t,n){if(e.tag===3)pp(e,e,n);else for(;t!==null;){if(t.tag===3){pp(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Hn===null||!Hn.has(r))){e=ho(n,e),e=q0(t,e,1),t=Fn(t,e,1),e=Ge(),t!==null&&(Ki(t,1,e),it(t,e));break}}t=t.return}}function Lx(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ge(),e.pingedLanes|=e.suspendedLanes&n,Ae===e&&(Ve&n)===n&&(ze===4||ze===3&&(Ve&130023424)===Ve&&500>Ce()-Pd?fr(e,0):Nd|=n),it(e,t)}function fy(e,t){t===0&&(e.mode&1?(t=fs,fs<<=1,!(fs&130023424)&&(fs=4194304)):t=1);var n=Ge();e=mn(e,t),e!==null&&(Ki(e,t,n),it(e,n))}function Vx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),fy(e,n)}function Fx(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(K(314))}r!==null&&r.delete(t),fy(e,n)}var hy;hy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rt.current)tt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return tt=!1,Cx(e,t,n);tt=!!(e.flags&131072)}else tt=!1,we&&t.flags&1048576&&y0(t,_a,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ys(e,t),e=t.pendingProps;var o=lo(t,qe.current);to(t,n),o=_d(null,t,r,e,o,n);var i=$d();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ot(r)?(i=!0,va(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,md(t),o.updater=rl,t.stateNode=o,o._reactInternals=t,nc(t,r,e,n),t=ic(null,t,r,!0,i,n)):(t.tag=0,we&&i&&ld(t),Ke(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ys(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Ux(r),e=jt(r,e),o){case 0:t=oc(null,t,r,e,n);break e;case 1:t=op(null,t,r,e,n);break e;case 11:t=np(null,t,r,e,n);break e;case 14:t=rp(null,t,r,jt(r.type,e),n);break e}throw Error(K(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),oc(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),op(e,t,r,o,n);case 3:e:{if(G0(t),e===null)throw Error(K(387));r=t.pendingProps,i=t.memoizedState,o=i.element,S0(e,t),Sa(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=ho(Error(K(423)),t),t=ip(e,t,r,n,o);break e}else if(r!==o){o=ho(Error(K(424)),t),t=ip(e,t,r,n,o);break e}else for(ut=Vn(t.stateNode.containerInfo.firstChild),ct=t,we=!0,It=null,n=$0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(uo(),r===o){t=gn(e,t,n);break e}Ke(e,t,r,n)}t=t.child}return t;case 5:return E0(t),e===null&&Ju(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Yu(r,o)?s=null:i!==null&&Yu(r,i)&&(t.flags|=32),X0(e,t),Ke(e,t,s,n),t.child;case 6:return e===null&&Ju(t),null;case 13:return Q0(e,t,n);case 4:return gd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=co(t,null,r,n):Ke(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),np(e,t,r,o,n);case 7:return Ke(e,t,t.pendingProps,n),t.child;case 8:return Ke(e,t,t.pendingProps.children,n),t.child;case 12:return Ke(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,me($a,r._currentValue),r._currentValue=s,i!==null)if(Vt(i.value,s)){if(i.children===o.children&&!rt.current){t=gn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=cn(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),ec(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(K(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),ec(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Ke(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,to(t,n),o=Et(o),r=r(o),t.flags|=1,Ke(e,t,r,n),t.child;case 14:return r=t.type,o=jt(r,t.pendingProps),o=jt(r.type,o),rp(e,t,r,o,n);case 15:return K0(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),Ys(e,t),t.tag=1,ot(r)?(e=!0,va(t)):e=!1,to(t,n),B0(t,r,o),nc(t,r,o,n),ic(null,t,r,!0,e,n);case 19:return Z0(e,t,n);case 22:return Y0(e,t,n)}throw Error(K(156,t.tag))};function py(e,t){return Fg(e,t)}function Hx(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $t(e,t,n,r){return new Hx(e,t,n,r)}function Md(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ux(e){if(typeof e=="function")return Md(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Gc)return 11;if(e===Qc)return 14}return 2}function Bn(e,t){var n=e.alternate;return n===null?(n=$t(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Qs(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Md(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Or:return hr(n.children,o,i,t);case Xc:s=8,o|=8;break;case Nu:return e=$t(12,n,t,o|2),e.elementType=Nu,e.lanes=i,e;case Pu:return e=$t(13,n,t,o),e.elementType=Pu,e.lanes=i,e;case Cu:return e=$t(19,n,t,o),e.elementType=Cu,e.lanes=i,e;case Eg:return sl(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case xg:s=10;break e;case Sg:s=9;break e;case Gc:s=11;break e;case Qc:s=14;break e;case Cn:s=16,r=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=$t(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function hr(e,t,n,r){return e=$t(7,e,r,t),e.lanes=n,e}function sl(e,t,n,r){return e=$t(22,e,r,t),e.elementType=Eg,e.lanes=n,e.stateNode={isHidden:!1},e}function su(e,t,n){return e=$t(6,e,null,t),e.lanes=n,e}function au(e,t,n){return t=$t(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Bx(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Fl(0),this.expirationTimes=Fl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fl(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Td(e,t,n,r,o,i,s,a,l){return e=new Bx(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=$t(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},md(i),e}function Wx(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ar,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function my(e){if(!e)return Yn;e=e._reactInternals;e:{if(br(e)!==e||e.tag!==1)throw Error(K(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ot(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(K(171))}if(e.tag===1){var n=e.type;if(ot(n))return m0(e,n,t)}return t}function gy(e,t,n,r,o,i,s,a,l){return e=Td(n,r,!0,e,o,i,s,a,l),e.context=my(null),n=e.current,r=Ge(),o=Un(n),i=cn(r,o),i.callback=t??null,Fn(n,i,o),e.current.lanes=o,Ki(e,o,r),it(e,r),e}function al(e,t,n,r){var o=t.current,i=Ge(),s=Un(o);return n=my(n),t.context===null?t.context=n:t.pendingContext=n,t=cn(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Fn(o,t,s),e!==null&&(Lt(e,o,s,i),Ws(e,o,s)),s}function Ma(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 mp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Id(e,t){mp(e,t),(e=e.alternate)&&mp(e,t)}function qx(){return null}var yy=typeof reportError=="function"?reportError:function(e){console.error(e)};function zd(e){this._internalRoot=e}ll.prototype.render=zd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(K(409));al(e,t,null,null)};ll.prototype.unmount=zd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_r(function(){al(null,e,null,null)}),t[pn]=null}};function ll(e){this._internalRoot=e}ll.prototype.unstable_scheduleHydration=function(e){if(e){var t=Yg();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jn.length&&t!==0&&t<jn[n].priority;n++);jn.splice(n,0,e),n===0&&Gg(e)}};function Rd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ul(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function gp(){}function Kx(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=Ma(s);i.call(u)}}var s=gy(t,r,e,0,null,!1,!1,"",gp);return e._reactRootContainer=s,e[pn]=s.current,Ni(e.nodeType===8?e.parentNode:e),_r(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var u=Ma(l);a.call(u)}}var l=Td(e,0,!1,null,null,!1,!1,"",gp);return e._reactRootContainer=l,e[pn]=l.current,Ni(e.nodeType===8?e.parentNode:e),_r(function(){al(t,l,n,r)}),l}function cl(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=Ma(s);a.call(l)}}al(t,s,e,o)}else s=Kx(n,t,e,o,r);return Ma(s)}qg=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Go(t.pendingLanes);n!==0&&(ed(t,n|1),it(t,Ce()),!(de&6)&&(po=Ce()+500,Qn()))}break;case 13:_r(function(){var r=mn(e,1);if(r!==null){var o=Ge();Lt(r,e,1,o)}}),Id(e,1)}};td=function(e){if(e.tag===13){var t=mn(e,134217728);if(t!==null){var n=Ge();Lt(t,e,134217728,n)}Id(e,134217728)}};Kg=function(e){if(e.tag===13){var t=Un(e),n=mn(e,t);if(n!==null){var r=Ge();Lt(n,e,t,r)}Id(e,t)}};Yg=function(){return he};Xg=function(e,t){var n=he;try{return he=e,t()}finally{he=n}};Du=function(e,t,n){switch(t){case"input":if(Mu(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=el(r);if(!o)throw Error(K(90));Ng(r),Mu(r,o)}}}break;case"textarea":Cg(e,n);break;case"select":t=n.value,t!=null&&Qr(e,!!n.multiple,t,!1)}};Rg=Cd;Ag=_r;var Yx={usingClientEntryPoint:!1,Events:[Xi,Fr,el,Ig,zg,Cd]},Uo={findFiberByHostInstance:ar,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Xx={bundleType:Uo.bundleType,version:Uo.version,rendererPackageName:Uo.rendererPackageName,rendererConfig:Uo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:wn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Lg(e),e===null?null:e.stateNode},findFiberByHostInstance:Uo.findFiberByHostInstance||qx,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 Ss=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ss.isDisabled&&Ss.supportsFiber)try{Ga=Ss.inject(Xx),Yt=Ss}catch{}}ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yx;ht.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Rd(t))throw Error(K(200));return Wx(e,t,null,n)};ht.createRoot=function(e,t){if(!Rd(e))throw Error(K(299));var n=!1,r="",o=yy;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Td(e,1,!1,null,null,n,!1,r,o),e[pn]=t.current,Ni(e.nodeType===8?e.parentNode:e),new zd(t)};ht.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(K(188)):(e=Object.keys(e).join(","),Error(K(268,e)));return e=Lg(t),e=e===null?null:e.stateNode,e};ht.flushSync=function(e){return _r(e)};ht.hydrate=function(e,t,n){if(!ul(t))throw Error(K(200));return cl(null,e,t,!0,n)};ht.hydrateRoot=function(e,t,n){if(!Rd(e))throw Error(K(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=yy;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=gy(t,null,e,1,n??null,o,!1,i,s),e[pn]=t.current,Ni(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new ll(t)};ht.render=function(e,t,n){if(!ul(t))throw Error(K(200));return cl(null,e,t,!1,n)};ht.unmountComponentAtNode=function(e){if(!ul(e))throw Error(K(40));return e._reactRootContainer?(_r(function(){cl(null,null,e,!1,function(){e._reactRootContainer=null,e[pn]=null})}),!0):!1};ht.unstable_batchedUpdates=Cd;ht.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ul(n))throw Error(K(200));if(e==null||e._reactInternals===void 0)throw Error(K(38));return cl(e,t,n,!1,r)};ht.version="18.3.1-next-f1338f8080-20240426";function vy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vy)}catch(e){console.error(e)}}vy(),vg.exports=ht;var wy=vg.exports,_y,yp=wy;_y=yp.createRoot,yp.hydrateRoot;const Gx="modulepreload",Qx=function(e){return"/"+e},vp={},Zx=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.allSettled(n.map(l=>{if(l=Qx(l),l in vp)return;vp[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const c=document.createElement("link");if(c.rel=u?"stylesheet":Gx,u||(c.as="script"),c.crossOrigin="",c.href=l,a&&c.setAttribute("nonce",a),document.head.appendChild(c),u)return new Promise((h,g)=>{c.addEventListener("load",h),c.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};/**
|
|
41
|
+
* @license lucide-react v0.460.0 - ISC
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the ISC license.
|
|
44
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/const Jx=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$y=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
46
|
+
* @license lucide-react v0.460.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/var eS={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
51
|
+
* @license lucide-react v0.460.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/const tS=D.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>D.createElement("svg",{ref:l,...eS,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:$y("lucide",o),...a},[...s.map(([u,d])=>D.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
|
|
56
|
+
* @license lucide-react v0.460.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/const $e=(e,t)=>{const n=D.forwardRef(({className:r,...o},i)=>D.createElement(tS,{ref:i,iconNode:t,className:$y(`lucide-${Jx(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
|
|
61
|
+
* @license lucide-react v0.460.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const wp=$e("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
|
|
66
|
+
* @license lucide-react v0.460.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const nS=$e("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
71
|
+
* @license lucide-react v0.460.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const rS=$e("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
76
|
+
* @license lucide-react v0.460.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const oS=$e("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
81
|
+
* @license lucide-react v0.460.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const iS=$e("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
86
|
+
* @license lucide-react v0.460.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const sS=$e("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
91
|
+
* @license lucide-react v0.460.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const xy=$e("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/**
|
|
96
|
+
* @license lucide-react v0.460.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const aS=$e("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
101
|
+
* @license lucide-react v0.460.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const lS=$e("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
106
|
+
* @license lucide-react v0.460.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const uS=$e("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
111
|
+
* @license lucide-react v0.460.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const Sy=$e("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
116
|
+
* @license lucide-react v0.460.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const cS=$e("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
121
|
+
* @license lucide-react v0.460.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const dS=$e("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
126
|
+
* @license lucide-react v0.460.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const fS=$e("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/**
|
|
131
|
+
* @license lucide-react v0.460.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const hS=$e("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
|
|
136
|
+
* @license lucide-react v0.460.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const Ad=$e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
141
|
+
* @license lucide-react v0.460.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const pS=$e("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
146
|
+
* @license lucide-react v0.460.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const mS=$e("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/**
|
|
151
|
+
* @license lucide-react v0.460.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const gS=$e("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
156
|
+
* @license lucide-react v0.460.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const yS=$e("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
161
|
+
* @license lucide-react v0.460.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const vS=$e("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
166
|
+
* @license lucide-react v0.460.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const wS=$e("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
|
|
171
|
+
* @license lucide-react v0.460.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const Ey=$e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
176
|
+
* @license lucide-react v0.460.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const _S=$e("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),$S="loom-theme";function xS(){return typeof document>"u"?"light":document.documentElement.getAttribute("data-theme")==="dark"?"dark":"light"}function SS(){const[e,t]=D.useState(xS);D.useEffect(()=>{document.documentElement.setAttribute("data-theme",e);try{localStorage.setItem($S,e)}catch{}},[e]);const n=D.useCallback(()=>{t(r=>r==="light"?"dark":"light")},[]);return{theme:e,setTheme:t,toggleTheme:n}}function ES({currentKind:e,currentId:t,currentTitle:n,diagrams:r,timelines:o,onNavigate:i,onCreate:s}){const[a,l]=D.useState(!1),u=D.useRef(null);D.useEffect(()=>{if(!a)return;function c(h){u.current&&!u.current.contains(h.target)&&l(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[a]);const d=(c,h)=>c===e&&h===t;return S.jsxs("div",{className:"diagram-switcher",ref:u,children:[S.jsxs("button",{className:"switcher-trigger",onClick:()=>l(c=>!c),"aria-expanded":a,"aria-haspopup":"listbox",children:[S.jsx("span",{className:"switcher-title",children:n}),S.jsx(rS,{size:14,className:a?"flip":""})]}),a&&S.jsxs("div",{className:"switcher-menu",role:"listbox",children:[r.length===0&&o.length===0&&S.jsx("div",{className:"switcher-empty",children:"Nothing here yet."}),r.length>0&&S.jsx("div",{className:"switcher-section-label",children:"Diagrams"}),r.map(c=>S.jsxs("button",{className:`switcher-item ${d("diagram",c.id)?"active":""}`,onClick:()=>{i({kind:"diagram",id:c.id}),l(!1)},children:[S.jsx(lS,{size:13,className:"switcher-item-icon"}),S.jsxs("div",{className:"switcher-item-text",children:[S.jsx("div",{className:"switcher-item-title",children:c.title}),S.jsxs("div",{className:"switcher-item-meta",children:[S.jsx("code",{children:c.id})," · ",c.nodeCount," nodes · ",c.edgeCount," edges"]})]})]},`d-${c.id}`)),o.length>0&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"switcher-divider"}),S.jsx("div",{className:"switcher-section-label",children:"Timelines"}),o.map(c=>S.jsxs("button",{className:`switcher-item ${d("timeline",c.id)?"active":""}`,onClick:()=>{i({kind:"timeline",id:c.id}),l(!1)},children:[S.jsx(sS,{size:13,className:"switcher-item-icon"}),S.jsxs("div",{className:"switcher-item-text",children:[S.jsx("div",{className:"switcher-item-title",children:c.title}),S.jsxs("div",{className:"switcher-item-meta",children:[S.jsx("code",{children:c.id})," · ",c.eventCount," events · ",kS(c.totalDurationMs)]})]})]},`t-${c.id}`))]}),S.jsx("div",{className:"switcher-divider"}),S.jsxs("button",{className:"switcher-item new",onClick:()=>{s(),l(!1)},children:[S.jsx(Ad,{size:13,className:"switcher-item-icon"}),S.jsx("span",{children:"New diagram…"})]})]})]})}function kS(e){return e===0?"0ms":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function NS({status:e}){return e==="connected"?S.jsx("span",{className:"conn-dot connected",title:"Live sync connected","aria-label":"Live sync connected",children:S.jsx(wS,{size:12})}):e==="connecting"?S.jsx("span",{className:"conn-dot connecting",title:"Connecting to live sync…","aria-label":"Connecting",children:S.jsx(Sy,{size:12,className:"spin"})}):S.jsx("span",{className:"conn-dot disconnected",title:"Live sync disconnected — reconnecting in the background","aria-label":"Disconnected",children:S.jsx(vS,{size:12})})}function PS({status:e,error:t}){return e==="idle"?null:e==="dirty"?S.jsx("span",{className:"save-indicator dirty",children:"unsaved"}):e==="saving"?S.jsxs("span",{className:"save-indicator saving",children:[S.jsx(Sy,{size:12,className:"spin"})," saving…"]}):e==="saved"?S.jsxs("span",{className:"save-indicator saved",children:[S.jsx(nS,{size:12})," saved"]}):e==="error"?S.jsxs("span",{className:"save-indicator error",title:t??"unknown",children:[S.jsx(iS,{size:12})," save failed"]}):null}function CS({viewKind:e,viewId:t,title:n,subtitle:r,diagrams:o,timelines:i,saveStatus:s,saveError:a,connectionStatus:l,validationErrorCount:u=0,onClickAdd:d,addMenuOpen:c,isDefault:h,onClickHome:g,onNavigate:y,onCreateDiagram:v,addButtonRef:w,hideAddButton:f=!1}){const{theme:p,toggleTheme:m}=SS();return S.jsxs("div",{className:"topbar",children:[!h&&S.jsxs("button",{className:"breadcrumb-back",onClick:g,title:"Back to overview","aria-label":"Back to overview",children:[S.jsx(oS,{size:14})," Overview"]}),S.jsx(ES,{currentKind:e,currentId:t,currentTitle:n,diagrams:o,timelines:i,onNavigate:y,onCreate:v}),r&&S.jsx("div",{className:"subtitle",children:r}),u>0&&S.jsxs("span",{className:"validation-chip",title:`${u} validation issue${u===1?"":"s"} — check the inspector`,children:[S.jsx(yS,{size:12})," ",u]}),S.jsx(NS,{status:l}),S.jsx(PS,{status:s,error:a}),!f&&w&&S.jsxs("button",{ref:w,onClick:d,title:"Add node","aria-label":"Add node","aria-expanded":c,children:[S.jsx(Ad,{size:16})," Add"]}),S.jsx("button",{onClick:m,title:`Switch to ${p==="light"?"dark":"light"} theme`,"aria-label":"Toggle theme",children:p==="light"?S.jsx(dS,{size:16}):S.jsx(gS,{size:16})})]})}function Me(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Me(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var bS={value:()=>{}};function dl(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Zs(n)}function Zs(e){this._=e}function jS(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Zs.prototype=dl.prototype={constructor:Zs,on:function(e,t){var n=this._,r=jS(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=MS(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=_p(n[o],e.name,t);else if(t==null)for(o in n)n[o]=_p(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Zs(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function MS(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function _p(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=bS,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var yc="http://www.w3.org/1999/xhtml";const $p={svg:"http://www.w3.org/2000/svg",xhtml:yc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function fl(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),$p.hasOwnProperty(t)?{space:$p[t],local:e}:e}function TS(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===yc&&t.documentElement.namespaceURI===yc?t.createElement(e):t.createElementNS(n,e)}}function IS(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ky(e){var t=fl(e);return(t.local?IS:TS)(t)}function zS(){}function Od(e){return e==null?zS:function(){return this.querySelector(e)}}function RS(e){typeof e!="function"&&(e=Od(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=new Array(s),l,u,d=0;d<s;++d)(l=i[d])&&(u=e.call(l,l.__data__,d,i))&&("__data__"in l&&(u.__data__=l.__data__),a[d]=u);return new ft(r,this._parents)}function AS(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function OS(){return[]}function Ny(e){return e==null?OS:function(){return this.querySelectorAll(e)}}function DS(e){return function(){return AS(e.apply(this,arguments))}}function LS(e){typeof e=="function"?e=DS(e):e=Ny(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(r.push(e.call(l,l.__data__,u,s)),o.push(l));return new ft(r,o)}function Py(e){return function(){return this.matches(e)}}function Cy(e){return function(t){return t.matches(e)}}var VS=Array.prototype.find;function FS(e){return function(){return VS.call(this.children,e)}}function HS(){return this.firstElementChild}function US(e){return this.select(e==null?HS:FS(typeof e=="function"?e:Cy(e)))}var BS=Array.prototype.filter;function WS(){return Array.from(this.children)}function qS(e){return function(){return BS.call(this.children,e)}}function KS(e){return this.selectAll(e==null?WS:qS(typeof e=="function"?e:Cy(e)))}function YS(e){typeof e!="function"&&(e=Py(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new ft(r,this._parents)}function by(e){return new Array(e.length)}function XS(){return new ft(this._enter||this._groups.map(by),this._parents)}function Ta(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ta.prototype={constructor:Ta,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function GS(e){return function(){return e}}function QS(e,t,n,r,o,i){for(var s=0,a,l=t.length,u=i.length;s<u;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new Ta(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function ZS(e,t,n,r,o,i,s){var a,l,u=new Map,d=t.length,c=i.length,h=new Array(d),g;for(a=0;a<d;++a)(l=t[a])&&(h[a]=g=s.call(l,l.__data__,a,t)+"",u.has(g)?o[a]=l:u.set(g,l));for(a=0;a<c;++a)g=s.call(e,i[a],a,i)+"",(l=u.get(g))?(r[a]=l,l.__data__=i[a],u.delete(g)):n[a]=new Ta(e,i[a]);for(a=0;a<d;++a)(l=t[a])&&u.get(h[a])===l&&(o[a]=l)}function JS(e){return e.__data__}function eE(e,t){if(!arguments.length)return Array.from(this,JS);var n=t?ZS:QS,r=this._parents,o=this._groups;typeof e!="function"&&(e=GS(e));for(var i=o.length,s=new Array(i),a=new Array(i),l=new Array(i),u=0;u<i;++u){var d=r[u],c=o[u],h=c.length,g=tE(e.call(d,d&&d.__data__,u,r)),y=g.length,v=a[u]=new Array(y),w=s[u]=new Array(y),f=l[u]=new Array(h);n(d,c,v,w,f,g,t);for(var p=0,m=0,_,x;p<y;++p)if(_=v[p]){for(p>=m&&(m=p+1);!(x=w[m])&&++m<y;);_._next=x||null}}return s=new ft(s,r),s._enter=a,s._exit=l,s}function tE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function nE(){return new ft(this._exit||this._groups.map(by),this._parents)}function rE(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function oE(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),l=0;l<s;++l)for(var u=n[l],d=r[l],c=u.length,h=a[l]=new Array(c),g,y=0;y<c;++y)(g=u[y]||d[y])&&(h[y]=g);for(;l<o;++l)a[l]=n[l];return new ft(a,this._parents)}function iE(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function sE(e){e||(e=aE);function t(c,h){return c&&h?e(c.__data__,h.__data__):!c-!h}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],a=s.length,l=o[i]=new Array(a),u,d=0;d<a;++d)(u=s[d])&&(l[d]=u);l.sort(t)}return new ft(o,this._parents).order()}function aE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function lE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function uE(){return Array.from(this)}function cE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function dE(){let e=0;for(const t of this)++e;return e}function fE(){return!this.node()}function hE(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this}function pE(e){return function(){this.removeAttribute(e)}}function mE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function gE(e,t){return function(){this.setAttribute(e,t)}}function yE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function vE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function wE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function _E(e,t){var n=fl(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?mE:pE:typeof t=="function"?n.local?wE:vE:n.local?yE:gE)(n,t))}function jy(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function $E(e){return function(){this.style.removeProperty(e)}}function xE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function SE(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function EE(e,t,n){return arguments.length>1?this.each((t==null?$E:typeof t=="function"?SE:xE)(e,t,n??"")):mo(this.node(),e)}function mo(e,t){return e.style.getPropertyValue(t)||jy(e).getComputedStyle(e,null).getPropertyValue(t)}function kE(e){return function(){delete this[e]}}function NE(e,t){return function(){this[e]=t}}function PE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function CE(e,t){return arguments.length>1?this.each((t==null?kE:typeof t=="function"?PE:NE)(e,t)):this.node()[e]}function My(e){return e.trim().split(/^|\s+/)}function Dd(e){return e.classList||new Ty(e)}function Ty(e){this._node=e,this._names=My(e.getAttribute("class")||"")}Ty.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Iy(e,t){for(var n=Dd(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function zy(e,t){for(var n=Dd(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function bE(e){return function(){Iy(this,e)}}function jE(e){return function(){zy(this,e)}}function ME(e,t){return function(){(t.apply(this,arguments)?Iy:zy)(this,e)}}function TE(e,t){var n=My(e+"");if(arguments.length<2){for(var r=Dd(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?ME:t?bE:jE)(n,t))}function IE(){this.textContent=""}function zE(e){return function(){this.textContent=e}}function RE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function AE(e){return arguments.length?this.each(e==null?IE:(typeof e=="function"?RE:zE)(e)):this.node().textContent}function OE(){this.innerHTML=""}function DE(e){return function(){this.innerHTML=e}}function LE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function VE(e){return arguments.length?this.each(e==null?OE:(typeof e=="function"?LE:DE)(e)):this.node().innerHTML}function FE(){this.nextSibling&&this.parentNode.appendChild(this)}function HE(){return this.each(FE)}function UE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function BE(){return this.each(UE)}function WE(e){var t=typeof e=="function"?e:ky(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function qE(){return null}function KE(e,t){var n=typeof e=="function"?e:ky(e),r=t==null?qE:typeof t=="function"?t:Od(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function YE(){var e=this.parentNode;e&&e.removeChild(this)}function XE(){return this.each(YE)}function GE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function QE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ZE(e){return this.select(e?QE:GE)}function JE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function e2(e){return function(t){e.call(this,t,this.__data__)}}function t2(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function n2(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function r2(e,t,n){return function(){var r=this.__on,o,i=e2(t);if(r){for(var s=0,a=r.length;s<a;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function o2(e,t,n){var r=t2(e+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,d;l<u;++l)for(o=0,d=a[l];o<i;++o)if((s=r[o]).type===d.type&&s.name===d.name)return d.value}return}for(a=t?r2:n2,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function Ry(e,t,n){var r=jy(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function i2(e,t){return function(){return Ry(this,e,t)}}function s2(e,t){return function(){return Ry(this,e,t.apply(this,arguments))}}function a2(e,t){return this.each((typeof t=="function"?s2:i2)(e,t))}function*l2(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var Ay=[null];function ft(e,t){this._groups=e,this._parents=t}function Qi(){return new ft([[document.documentElement]],Ay)}function u2(){return this}ft.prototype=Qi.prototype={constructor:ft,select:RS,selectAll:LS,selectChild:US,selectChildren:KS,filter:YS,data:eE,enter:XS,exit:nE,join:rE,merge:oE,selection:u2,order:iE,sort:sE,call:lE,nodes:uE,node:cE,size:dE,empty:fE,each:hE,attr:_E,style:EE,property:CE,classed:TE,text:AE,html:VE,raise:HE,lower:BE,append:WE,insert:KE,remove:XE,clone:ZE,datum:JE,on:o2,dispatch:a2,[Symbol.iterator]:l2};function lt(e){return typeof e=="string"?new ft([[document.querySelector(e)]],[document.documentElement]):new ft([[e]],Ay)}function c2(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Tt(e,t){if(e=c2(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const d2={passive:!1},Ri={capture:!0,passive:!1};function lu(e){e.stopImmediatePropagation()}function ro(e){e.preventDefault(),e.stopImmediatePropagation()}function Oy(e){var t=e.document.documentElement,n=lt(e).on("dragstart.drag",ro,Ri);"onselectstart"in t?n.on("selectstart.drag",ro,Ri):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Dy(e,t){var n=e.document.documentElement,r=lt(e).on("dragstart.drag",null);t&&(r.on("click.drag",ro,Ri),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Es=e=>()=>e;function vc(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:a,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}vc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function f2(e){return!e.ctrlKey&&!e.button}function h2(){return this.parentNode}function p2(e,t){return t??{x:e.x,y:e.y}}function m2(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ly(){var e=f2,t=h2,n=p2,r=m2,o={},i=dl("start","drag","end"),s=0,a,l,u,d,c=0;function h(_){_.on("mousedown.drag",g).filter(r).on("touchstart.drag",w).on("touchmove.drag",f,d2).on("touchend.drag touchcancel.drag",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(_,x){if(!(d||!e.call(this,_,x))){var k=m(this,t.call(this,_,x),_,x,"mouse");k&&(lt(_.view).on("mousemove.drag",y,Ri).on("mouseup.drag",v,Ri),Oy(_.view),lu(_),u=!1,a=_.clientX,l=_.clientY,k("start",_))}}function y(_){if(ro(_),!u){var x=_.clientX-a,k=_.clientY-l;u=x*x+k*k>c}o.mouse("drag",_)}function v(_){lt(_.view).on("mousemove.drag mouseup.drag",null),Dy(_.view,u),ro(_),o.mouse("end",_)}function w(_,x){if(e.call(this,_,x)){var k=_.changedTouches,C=t.call(this,_,x),I=k.length,L,U;for(L=0;L<I;++L)(U=m(this,C,_,x,k[L].identifier,k[L]))&&(lu(_),U("start",_,k[L]))}}function f(_){var x=_.changedTouches,k=x.length,C,I;for(C=0;C<k;++C)(I=o[x[C].identifier])&&(ro(_),I("drag",_,x[C]))}function p(_){var x=_.changedTouches,k=x.length,C,I;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),C=0;C<k;++C)(I=o[x[C].identifier])&&(lu(_),I("end",_,x[C]))}function m(_,x,k,C,I,L){var U=i.copy(),T=Tt(L||k,x),O,W,N;if((N=n.call(_,new vc("beforestart",{sourceEvent:k,target:h,identifier:I,active:s,x:T[0],y:T[1],dx:0,dy:0,dispatch:U}),C))!=null)return O=N.x-T[0]||0,W=N.y-T[1]||0,function F(A,H,M){var z=T,b;switch(A){case"start":o[I]=F,b=s++;break;case"end":delete o[I],--s;case"drag":T=Tt(M||H,x),b=s;break}U.call(A,_,new vc(A,{sourceEvent:H,subject:N,target:h,identifier:I,active:b,x:T[0]+O,y:T[1]+W,dx:T[0]-z[0],dy:T[1]-z[1],dispatch:U}),C)}}return h.filter=function(_){return arguments.length?(e=typeof _=="function"?_:Es(!!_),h):e},h.container=function(_){return arguments.length?(t=typeof _=="function"?_:Es(_),h):t},h.subject=function(_){return arguments.length?(n=typeof _=="function"?_:Es(_),h):n},h.touchable=function(_){return arguments.length?(r=typeof _=="function"?_:Es(!!_),h):r},h.on=function(){var _=i.on.apply(i,arguments);return _===i?h:_},h.clickDistance=function(_){return arguments.length?(c=(_=+_)*_,h):Math.sqrt(c)},h}function Ld(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Vy(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Zi(){}var Ai=.7,Ia=1/Ai,oo="\\s*([+-]?\\d+)\\s*",Oi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",g2=/^#([0-9a-f]{3,8})$/,y2=new RegExp(`^rgb\\(${oo},${oo},${oo}\\)$`),v2=new RegExp(`^rgb\\(${Gt},${Gt},${Gt}\\)$`),w2=new RegExp(`^rgba\\(${oo},${oo},${oo},${Oi}\\)$`),_2=new RegExp(`^rgba\\(${Gt},${Gt},${Gt},${Oi}\\)$`),$2=new RegExp(`^hsl\\(${Oi},${Gt},${Gt}\\)$`),x2=new RegExp(`^hsla\\(${Oi},${Gt},${Gt},${Oi}\\)$`),xp={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};Ld(Zi,$r,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Sp,formatHex:Sp,formatHex8:S2,formatHsl:E2,formatRgb:Ep,toString:Ep});function Sp(){return this.rgb().formatHex()}function S2(){return this.rgb().formatHex8()}function E2(){return Fy(this).formatHsl()}function Ep(){return this.rgb().formatRgb()}function $r(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=g2.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?kp(t):n===3?new nt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ks(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ks(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=y2.exec(e))?new nt(t[1],t[2],t[3],1):(t=v2.exec(e))?new nt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=w2.exec(e))?ks(t[1],t[2],t[3],t[4]):(t=_2.exec(e))?ks(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=$2.exec(e))?Cp(t[1],t[2]/100,t[3]/100,1):(t=x2.exec(e))?Cp(t[1],t[2]/100,t[3]/100,t[4]):xp.hasOwnProperty(e)?kp(xp[e]):e==="transparent"?new nt(NaN,NaN,NaN,0):null}function kp(e){return new nt(e>>16&255,e>>8&255,e&255,1)}function ks(e,t,n,r){return r<=0&&(e=t=n=NaN),new nt(e,t,n,r)}function k2(e){return e instanceof Zi||(e=$r(e)),e?(e=e.rgb(),new nt(e.r,e.g,e.b,e.opacity)):new nt}function wc(e,t,n,r){return arguments.length===1?k2(e):new nt(e,t,n,r??1)}function nt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Ld(nt,wc,Vy(Zi,{brighter(e){return e=e==null?Ia:Math.pow(Ia,e),new nt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ai:Math.pow(Ai,e),new nt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nt(pr(this.r),pr(this.g),pr(this.b),za(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:Np,formatHex:Np,formatHex8:N2,formatRgb:Pp,toString:Pp}));function Np(){return`#${cr(this.r)}${cr(this.g)}${cr(this.b)}`}function N2(){return`#${cr(this.r)}${cr(this.g)}${cr(this.b)}${cr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Pp(){const e=za(this.opacity);return`${e===1?"rgb(":"rgba("}${pr(this.r)}, ${pr(this.g)}, ${pr(this.b)}${e===1?")":`, ${e})`}`}function za(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function pr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cr(e){return e=pr(e),(e<16?"0":"")+e.toString(16)}function Cp(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new zt(e,t,n,r)}function Fy(e){if(e instanceof zt)return new zt(e.h,e.s,e.l,e.opacity);if(e instanceof Zi||(e=$r(e)),!e)return new zt;if(e instanceof zt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,l=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+o:2-i-o,s*=60):a=l>0&&l<1?0:s,new zt(s,a,l,e.opacity)}function P2(e,t,n,r){return arguments.length===1?Fy(e):new zt(e,t,n,r??1)}function zt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ld(zt,P2,Vy(Zi,{brighter(e){return e=e==null?Ia:Math.pow(Ia,e),new zt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ai:Math.pow(Ai,e),new zt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new nt(uu(e>=240?e-240:e+120,o,r),uu(e,o,r),uu(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new zt(bp(this.h),Ns(this.s),Ns(this.l),za(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=za(this.opacity);return`${e===1?"hsl(":"hsla("}${bp(this.h)}, ${Ns(this.s)*100}%, ${Ns(this.l)*100}%${e===1?")":`, ${e})`}`}}));function bp(e){return e=(e||0)%360,e<0?e+360:e}function Ns(e){return Math.max(0,Math.min(1,e||0))}function uu(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Vd=e=>()=>e;function C2(e,t){return function(n){return e+n*t}}function b2(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function j2(e){return(e=+e)==1?Hy:function(t,n){return n-t?b2(t,n,e):Vd(isNaN(t)?n:t)}}function Hy(e,t){var n=t-e;return n?C2(e,n):Vd(isNaN(e)?t:e)}const Ra=function e(t){var n=j2(t);function r(o,i){var s=n((o=wc(o)).r,(i=wc(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),u=Hy(o.opacity,i.opacity);return function(d){return o.r=s(d),o.g=a(d),o.b=l(d),o.opacity=u(d),o+""}}return r.gamma=e,r}(1);function M2(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=e[o]*(1-i)+t[o]*i;return r}}function T2(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function I2(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=di(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<r;++s)i[s]=o[s](a);return i}}function z2(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Bt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function R2(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=di(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var _c=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,cu=new RegExp(_c.source,"g");function A2(e){return function(){return e}}function O2(e){return function(t){return e(t)+""}}function Uy(e,t){var n=_c.lastIndex=cu.lastIndex=0,r,o,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=_c.exec(e))&&(o=cu.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,l.push({i:s,x:Bt(r,o)})),n=cu.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?O2(l[0].x):A2(t):(t=l.length,function(u){for(var d=0,c;d<t;++d)a[(c=l[d]).i]=c.x(u);return a.join("")})}function di(e,t){var n=typeof t,r;return t==null||n==="boolean"?Vd(t):(n==="number"?Bt:n==="string"?(r=$r(t))?(t=r,Ra):Uy:t instanceof $r?Ra:t instanceof Date?z2:T2(t)?M2:Array.isArray(t)?I2:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?R2:Bt)(e,t)}var jp=180/Math.PI,$c={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function By(e,t,n,r,o,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*jp,skewX:Math.atan(l)*jp,scaleX:s,scaleY:a}}var Ps;function D2(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?$c:By(t.a,t.b,t.c,t.d,t.e,t.f)}function L2(e){return e==null||(Ps||(Ps=document.createElementNS("http://www.w3.org/2000/svg","g")),Ps.setAttribute("transform",e),!(e=Ps.transform.baseVal.consolidate()))?$c:(e=e.matrix,By(e.a,e.b,e.c,e.d,e.e,e.f))}function Wy(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,d,c,h,g,y){if(u!==c||d!==h){var v=g.push("translate(",null,t,null,n);y.push({i:v-4,x:Bt(u,c)},{i:v-2,x:Bt(d,h)})}else(c||h)&&g.push("translate("+c+t+h+n)}function s(u,d,c,h){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),h.push({i:c.push(o(c)+"rotate(",null,r)-2,x:Bt(u,d)})):d&&c.push(o(c)+"rotate("+d+r)}function a(u,d,c,h){u!==d?h.push({i:c.push(o(c)+"skewX(",null,r)-2,x:Bt(u,d)}):d&&c.push(o(c)+"skewX("+d+r)}function l(u,d,c,h,g,y){if(u!==c||d!==h){var v=g.push(o(g)+"scale(",null,",",null,")");y.push({i:v-4,x:Bt(u,c)},{i:v-2,x:Bt(d,h)})}else(c!==1||h!==1)&&g.push(o(g)+"scale("+c+","+h+")")}return function(u,d){var c=[],h=[];return u=e(u),d=e(d),i(u.translateX,u.translateY,d.translateX,d.translateY,c,h),s(u.rotate,d.rotate,c,h),a(u.skewX,d.skewX,c,h),l(u.scaleX,u.scaleY,d.scaleX,d.scaleY,c,h),u=d=null,function(g){for(var y=-1,v=h.length,w;++y<v;)c[(w=h[y]).i]=w.x(g);return c.join("")}}}var V2=Wy(D2,"px, ","px)","deg)"),F2=Wy(L2,", ",")",")"),H2=1e-12;function Mp(e){return((e=Math.exp(e))+1/e)/2}function U2(e){return((e=Math.exp(e))-1/e)/2}function B2(e){return((e=Math.exp(2*e))-1)/(e+1)}const Js=function e(t,n,r){function o(i,s){var a=i[0],l=i[1],u=i[2],d=s[0],c=s[1],h=s[2],g=d-a,y=c-l,v=g*g+y*y,w,f;if(v<H2)f=Math.log(h/u)/t,w=function(C){return[a+C*g,l+C*y,u*Math.exp(t*C*f)]};else{var p=Math.sqrt(v),m=(h*h-u*u+r*v)/(2*u*n*p),_=(h*h-u*u-r*v)/(2*h*n*p),x=Math.log(Math.sqrt(m*m+1)-m),k=Math.log(Math.sqrt(_*_+1)-_);f=(k-x)/t,w=function(C){var I=C*f,L=Mp(x),U=u/(n*p)*(L*B2(t*I+x)-U2(x));return[a+U*g,l+U*y,u*L/Mp(t*I+x)]}}return w.duration=f*1e3*t/Math.SQRT2,w}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},o}(Math.SQRT2,2,4);var go=0,Zo=0,Bo=0,qy=1e3,Aa,Jo,Oa=0,xr=0,hl=0,Di=typeof performance=="object"&&performance.now?performance:Date,Ky=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Fd(){return xr||(Ky(W2),xr=Di.now()+hl)}function W2(){xr=0}function Da(){this._call=this._time=this._next=null}Da.prototype=Yy.prototype={constructor:Da,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Fd():+n)+(t==null?0:+t),!this._next&&Jo!==this&&(Jo?Jo._next=this:Aa=this,Jo=this),this._call=e,this._time=n,xc()},stop:function(){this._call&&(this._call=null,this._time=1/0,xc())}};function Yy(e,t,n){var r=new Da;return r.restart(e,t,n),r}function q2(){Fd(),++go;for(var e=Aa,t;e;)(t=xr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--go}function Tp(){xr=(Oa=Di.now())+hl,go=Zo=0;try{q2()}finally{go=0,Y2(),xr=0}}function K2(){var e=Di.now(),t=e-Oa;t>qy&&(hl-=t,Oa=e)}function Y2(){for(var e,t=Aa,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Aa=n);Jo=e,xc(r)}function xc(e){if(!go){Zo&&(Zo=clearTimeout(Zo));var t=e-xr;t>24?(e<1/0&&(Zo=setTimeout(Tp,e-Di.now()-hl)),Bo&&(Bo=clearInterval(Bo))):(Bo||(Oa=Di.now(),Bo=setInterval(K2,qy)),go=1,Ky(Tp))}}function Ip(e,t,n){var r=new Da;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var X2=dl("start","end","cancel","interrupt"),G2=[],Xy=0,zp=1,Sc=2,ea=3,Rp=4,Ec=5,ta=6;function pl(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Q2(e,n,{name:t,index:r,group:o,on:X2,tween:G2,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Xy})}function Hd(e,t){var n=Ft(e,t);if(n.state>Xy)throw new Error("too late; already scheduled");return n}function Zt(e,t){var n=Ft(e,t);if(n.state>ea)throw new Error("too late; already running");return n}function Ft(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Q2(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Yy(i,0,n.time);function i(u){n.state=zp,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var d,c,h,g;if(n.state!==zp)return l();for(d in r)if(g=r[d],g.name===n.name){if(g.state===ea)return Ip(s);g.state===Rp?(g.state=ta,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[d]):+d<t&&(g.state=ta,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[d])}if(Ip(function(){n.state===ea&&(n.state=Rp,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=Sc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Sc){for(n.state=ea,o=new Array(h=n.tween.length),d=0,c=-1;d<h;++d)(g=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(o[++c]=g);o.length=c+1}}function a(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Ec,1),c=-1,h=o.length;++c<h;)o[c].call(e,d);n.state===Ec&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=ta,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function na(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>Sc&&r.state<Ec,r.state=ta,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function Z2(e){return this.each(function(){na(this,e)})}function J2(e,t){var n,r;return function(){var o=Zt(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function ek(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Zt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:t,value:n},l=0,u=o.length;l<u;++l)if(o[l].name===t){o[l]=a;break}l===u&&o.push(a)}i.tween=o}}function tk(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ft(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?J2:ek)(n,e,t))}function Ud(e,t,n){var r=e._id;return e.each(function(){var o=Zt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Ft(o,r).value[t]}}function Gy(e,t){var n;return(typeof t=="number"?Bt:t instanceof $r?Ra:(n=$r(t))?(t=n,Ra):Uy)(e,t)}function nk(e){return function(){this.removeAttribute(e)}}function rk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ok(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function ik(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function sk(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function ak(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function lk(e,t){var n=fl(e),r=n==="transform"?F2:Gy;return this.attrTween(e,typeof t=="function"?(n.local?ak:sk)(n,r,Ud(this,"attr."+e,t)):t==null?(n.local?rk:nk)(n):(n.local?ik:ok)(n,r,t))}function uk(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ck(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function dk(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&ck(e,i)),n}return o._value=t,o}function fk(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&uk(e,i)),n}return o._value=t,o}function hk(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=fl(e);return this.tween(n,(r.local?dk:fk)(r,t))}function pk(e,t){return function(){Hd(this,e).delay=+t.apply(this,arguments)}}function mk(e,t){return t=+t,function(){Hd(this,e).delay=t}}function gk(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?pk:mk)(t,e)):Ft(this.node(),t).delay}function yk(e,t){return function(){Zt(this,e).duration=+t.apply(this,arguments)}}function vk(e,t){return t=+t,function(){Zt(this,e).duration=t}}function wk(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?yk:vk)(t,e)):Ft(this.node(),t).duration}function _k(e,t){if(typeof t!="function")throw new Error;return function(){Zt(this,e).ease=t}}function $k(e){var t=this._id;return arguments.length?this.each(_k(t,e)):Ft(this.node(),t).ease}function xk(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Zt(this,e).ease=n}}function Sk(e){if(typeof e!="function")throw new Error;return this.each(xk(this._id,e))}function Ek(e){typeof e!="function"&&(e=Py(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new yn(r,this._parents,this._name,this._id)}function kk(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),a=0;a<i;++a)for(var l=t[a],u=n[a],d=l.length,c=s[a]=new Array(d),h,g=0;g<d;++g)(h=l[g]||u[g])&&(c[g]=h);for(;a<r;++a)s[a]=t[a];return new yn(s,this._parents,this._name,this._id)}function Nk(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Pk(e,t,n){var r,o,i=Nk(t)?Hd:Zt;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function Ck(e,t){var n=this._id;return arguments.length<2?Ft(this.node(),n).on.on(e):this.each(Pk(n,e,t))}function bk(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function jk(){return this.on("end.remove",bk(this._id))}function Mk(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Od(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],l=a.length,u=i[s]=new Array(l),d,c,h=0;h<l;++h)(d=a[h])&&(c=e.call(d,d.__data__,h,a))&&("__data__"in d&&(c.__data__=d.__data__),u[h]=c,pl(u[h],t,n,h,u,Ft(d,n)));return new yn(i,this._parents,t,n)}function Tk(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ny(e));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var l=r[a],u=l.length,d,c=0;c<u;++c)if(d=l[c]){for(var h=e.call(d,d.__data__,c,l),g,y=Ft(d,n),v=0,w=h.length;v<w;++v)(g=h[v])&&pl(g,t,n,v,h,y);i.push(h),s.push(d)}return new yn(i,s,t,n)}var Ik=Qi.prototype.constructor;function zk(){return new Ik(this._groups,this._parents)}function Rk(e,t){var n,r,o;return function(){var i=mo(this,e),s=(this.style.removeProperty(e),mo(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function Qy(e){return function(){this.style.removeProperty(e)}}function Ak(e,t,n){var r,o=n+"",i;return function(){var s=mo(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function Ok(e,t,n){var r,o,i;return function(){var s=mo(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),mo(this,e))),s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a))}}function Dk(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var l=Zt(this,e),u=l.on,d=l.value[i]==null?a||(a=Qy(t)):void 0;(u!==n||o!==d)&&(r=(n=u).copy()).on(s,o=d),l.on=r}}function Lk(e,t,n){var r=(e+="")=="transform"?V2:Gy;return t==null?this.styleTween(e,Rk(e,r)).on("end.style."+e,Qy(e)):typeof t=="function"?this.styleTween(e,Ok(e,r,Ud(this,"style."+e,t))).each(Dk(this._id,e)):this.styleTween(e,Ak(e,r,t),n).on("end.style."+e,null)}function Vk(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Fk(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&Vk(e,s,n)),r}return i._value=t,i}function Hk(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Fk(e,t,n??""))}function Uk(e){return function(){this.textContent=e}}function Bk(e){return function(){var t=e(this);this.textContent=t??""}}function Wk(e){return this.tween("text",typeof e=="function"?Bk(Ud(this,"text",e)):Uk(e==null?"":e+""))}function qk(e){return function(t){this.textContent=e.call(this,t)}}function Kk(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&qk(o)),t}return r._value=e,r}function Yk(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Kk(e))}function Xk(){for(var e=this._name,t=this._id,n=Zy(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var d=Ft(l,t);pl(l,e,n,u,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new yn(r,this._parents,e,n)}function Gk(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--o===0&&i()}};n.each(function(){var u=Zt(this,r),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),o===0&&i()})}var Qk=0;function yn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Zy(){return++Qk}var rn=Qi.prototype;yn.prototype={constructor:yn,select:Mk,selectAll:Tk,selectChild:rn.selectChild,selectChildren:rn.selectChildren,filter:Ek,merge:kk,selection:zk,transition:Xk,call:rn.call,nodes:rn.nodes,node:rn.node,size:rn.size,empty:rn.empty,each:rn.each,on:Ck,attr:lk,attrTween:hk,style:Lk,styleTween:Hk,text:Wk,textTween:Yk,remove:jk,tween:tk,delay:gk,duration:wk,ease:$k,easeVarying:Sk,end:Gk,[Symbol.iterator]:rn[Symbol.iterator]};function Zk(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Jk={time:null,delay:0,duration:250,ease:Zk};function eN(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function tN(e){var t,n;e instanceof yn?(t=e._id,e=e._name):(t=Zy(),(n=Jk).time=Fd(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&pl(l,e,t,u,s,n||eN(l,t));return new yn(r,this._parents,e,t)}Qi.prototype.interrupt=Z2;Qi.prototype.transition=tN;const Cs=e=>()=>e;function nN(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function un(e,t,n){this.k=e,this.x=t,this.y=n}un.prototype={constructor:un,scale:function(e){return e===1?this:new un(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new un(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ml=new un(1,0,0);Jy.prototype=un.prototype;function Jy(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ml;return e.__zoom}function du(e){e.stopImmediatePropagation()}function Wo(e){e.preventDefault(),e.stopImmediatePropagation()}function rN(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function oN(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Ap(){return this.__zoom||ml}function iN(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function sN(){return navigator.maxTouchPoints||"ontouchstart"in this}function aN(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function ev(){var e=rN,t=oN,n=aN,r=iN,o=sN,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Js,u=dl("start","zoom","end"),d,c,h,g=500,y=150,v=0,w=10;function f(N){N.property("__zoom",Ap).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",U).filter(o).on("touchstart.zoom",T).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}f.transform=function(N,F,A,H){var M=N.selection?N.selection():N;M.property("__zoom",Ap),N!==M?x(N,F,A,H):M.interrupt().each(function(){k(this,arguments).event(H).start().zoom(null,typeof F=="function"?F.apply(this,arguments):F).end()})},f.scaleBy=function(N,F,A,H){f.scaleTo(N,function(){var M=this.__zoom.k,z=typeof F=="function"?F.apply(this,arguments):F;return M*z},A,H)},f.scaleTo=function(N,F,A,H){f.transform(N,function(){var M=t.apply(this,arguments),z=this.__zoom,b=A==null?_(M):typeof A=="function"?A.apply(this,arguments):A,E=z.invert(b),j=typeof F=="function"?F.apply(this,arguments):F;return n(m(p(z,j),b,E),M,s)},A,H)},f.translateBy=function(N,F,A,H){f.transform(N,function(){return n(this.__zoom.translate(typeof F=="function"?F.apply(this,arguments):F,typeof A=="function"?A.apply(this,arguments):A),t.apply(this,arguments),s)},null,H)},f.translateTo=function(N,F,A,H,M){f.transform(N,function(){var z=t.apply(this,arguments),b=this.__zoom,E=H==null?_(z):typeof H=="function"?H.apply(this,arguments):H;return n(ml.translate(E[0],E[1]).scale(b.k).translate(typeof F=="function"?-F.apply(this,arguments):-F,typeof A=="function"?-A.apply(this,arguments):-A),z,s)},H,M)};function p(N,F){return F=Math.max(i[0],Math.min(i[1],F)),F===N.k?N:new un(F,N.x,N.y)}function m(N,F,A){var H=F[0]-A[0]*N.k,M=F[1]-A[1]*N.k;return H===N.x&&M===N.y?N:new un(N.k,H,M)}function _(N){return[(+N[0][0]+ +N[1][0])/2,(+N[0][1]+ +N[1][1])/2]}function x(N,F,A,H){N.on("start.zoom",function(){k(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(H).end()}).tween("zoom",function(){var M=this,z=arguments,b=k(M,z).event(H),E=t.apply(M,z),j=A==null?_(E):typeof A=="function"?A.apply(M,z):A,R=Math.max(E[1][0]-E[0][0],E[1][1]-E[0][1]),$=M.__zoom,P=typeof F=="function"?F.apply(M,z):F,V=l($.invert(j).concat(R/$.k),P.invert(j).concat(R/P.k));return function(q){if(q===1)q=P;else{var B=V(q),Y=R/B[2];q=new un(Y,j[0]-B[0]*Y,j[1]-B[1]*Y)}b.zoom(null,q)}})}function k(N,F,A){return!A&&N.__zooming||new C(N,F)}function C(N,F){this.that=N,this.args=F,this.active=0,this.sourceEvent=null,this.extent=t.apply(N,F),this.taps=0}C.prototype={event:function(N){return N&&(this.sourceEvent=N),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(N,F){return this.mouse&&N!=="mouse"&&(this.mouse[1]=F.invert(this.mouse[0])),this.touch0&&N!=="touch"&&(this.touch0[1]=F.invert(this.touch0[0])),this.touch1&&N!=="touch"&&(this.touch1[1]=F.invert(this.touch1[0])),this.that.__zoom=F,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(N){var F=lt(this.that).datum();u.call(N,this.that,new nN(N,{sourceEvent:this.sourceEvent,target:f,transform:this.that.__zoom,dispatch:u}),F)}};function I(N,...F){if(!e.apply(this,arguments))return;var A=k(this,F).event(N),H=this.__zoom,M=Math.max(i[0],Math.min(i[1],H.k*Math.pow(2,r.apply(this,arguments)))),z=Tt(N);if(A.wheel)(A.mouse[0][0]!==z[0]||A.mouse[0][1]!==z[1])&&(A.mouse[1]=H.invert(A.mouse[0]=z)),clearTimeout(A.wheel);else{if(H.k===M)return;A.mouse=[z,H.invert(z)],na(this),A.start()}Wo(N),A.wheel=setTimeout(b,y),A.zoom("mouse",n(m(p(H,M),A.mouse[0],A.mouse[1]),A.extent,s));function b(){A.wheel=null,A.end()}}function L(N,...F){if(h||!e.apply(this,arguments))return;var A=N.currentTarget,H=k(this,F,!0).event(N),M=lt(N.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",R,!0),z=Tt(N,A),b=N.clientX,E=N.clientY;Oy(N.view),du(N),H.mouse=[z,this.__zoom.invert(z)],na(this),H.start();function j($){if(Wo($),!H.moved){var P=$.clientX-b,V=$.clientY-E;H.moved=P*P+V*V>v}H.event($).zoom("mouse",n(m(H.that.__zoom,H.mouse[0]=Tt($,A),H.mouse[1]),H.extent,s))}function R($){M.on("mousemove.zoom mouseup.zoom",null),Dy($.view,H.moved),Wo($),H.event($).end()}}function U(N,...F){if(e.apply(this,arguments)){var A=this.__zoom,H=Tt(N.changedTouches?N.changedTouches[0]:N,this),M=A.invert(H),z=A.k*(N.shiftKey?.5:2),b=n(m(p(A,z),H,M),t.apply(this,F),s);Wo(N),a>0?lt(this).transition().duration(a).call(x,b,H,N):lt(this).call(f.transform,b,H,N)}}function T(N,...F){if(e.apply(this,arguments)){var A=N.touches,H=A.length,M=k(this,F,N.changedTouches.length===H).event(N),z,b,E,j;for(du(N),b=0;b<H;++b)E=A[b],j=Tt(E,this),j=[j,this.__zoom.invert(j),E.identifier],M.touch0?!M.touch1&&M.touch0[2]!==j[2]&&(M.touch1=j,M.taps=0):(M.touch0=j,z=!0,M.taps=1+!!d);d&&(d=clearTimeout(d)),z&&(M.taps<2&&(c=j[0],d=setTimeout(function(){d=null},g)),na(this),M.start())}}function O(N,...F){if(this.__zooming){var A=k(this,F).event(N),H=N.changedTouches,M=H.length,z,b,E,j;for(Wo(N),z=0;z<M;++z)b=H[z],E=Tt(b,this),A.touch0&&A.touch0[2]===b.identifier?A.touch0[0]=E:A.touch1&&A.touch1[2]===b.identifier&&(A.touch1[0]=E);if(b=A.that.__zoom,A.touch1){var R=A.touch0[0],$=A.touch0[1],P=A.touch1[0],V=A.touch1[1],q=(q=P[0]-R[0])*q+(q=P[1]-R[1])*q,B=(B=V[0]-$[0])*B+(B=V[1]-$[1])*B;b=p(b,Math.sqrt(q/B)),E=[(R[0]+P[0])/2,(R[1]+P[1])/2],j=[($[0]+V[0])/2,($[1]+V[1])/2]}else if(A.touch0)E=A.touch0[0],j=A.touch0[1];else return;A.zoom("touch",n(m(b,E,j),A.extent,s))}}function W(N,...F){if(this.__zooming){var A=k(this,F).event(N),H=N.changedTouches,M=H.length,z,b;for(du(N),h&&clearTimeout(h),h=setTimeout(function(){h=null},g),z=0;z<M;++z)b=H[z],A.touch0&&A.touch0[2]===b.identifier?delete A.touch0:A.touch1&&A.touch1[2]===b.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(b=Tt(b,this),Math.hypot(c[0]-b[0],c[1]-b[1])<w)){var E=lt(this).on("dblclick.zoom");E&&E.apply(this,arguments)}}}return f.wheelDelta=function(N){return arguments.length?(r=typeof N=="function"?N:Cs(+N),f):r},f.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Cs(!!N),f):e},f.touchable=function(N){return arguments.length?(o=typeof N=="function"?N:Cs(!!N),f):o},f.extent=function(N){return arguments.length?(t=typeof N=="function"?N:Cs([[+N[0][0],+N[0][1]],[+N[1][0],+N[1][1]]]),f):t},f.scaleExtent=function(N){return arguments.length?(i[0]=+N[0],i[1]=+N[1],f):[i[0],i[1]]},f.translateExtent=function(N){return arguments.length?(s[0][0]=+N[0][0],s[1][0]=+N[1][0],s[0][1]=+N[0][1],s[1][1]=+N[1][1],f):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},f.constrain=function(N){return arguments.length?(n=N,f):n},f.duration=function(N){return arguments.length?(a=+N,f):a},f.interpolate=function(N){return arguments.length?(l=N,f):l},f.on=function(){var N=u.on.apply(u,arguments);return N===u?f:N},f.clickDistance=function(N){return arguments.length?(v=(N=+N)*N,f):Math.sqrt(v)},f.tapDistance=function(N){return arguments.length?(w=+N,f):w},f}const Qt={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,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."},Li=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],tv=["Enter"," ","Escape"],nv={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var yo;(function(e){e.Strict="strict",e.Loose="loose"})(yo||(yo={}));var mr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(mr||(mr={}));var Vi;(function(e){e.Partial="partial",e.Full="full"})(Vi||(Vi={}));const rv={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Tn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Tn||(Tn={}));var La;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(La||(La={}));var ee;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ee||(ee={}));const Op={[ee.Left]:ee.Right,[ee.Right]:ee.Left,[ee.Top]:ee.Bottom,[ee.Bottom]:ee.Top};function ov(e){return e===null?null:e?"valid":"invalid"}const iv=e=>"id"in e&&"source"in e&&"target"in e,lN=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Bd=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ji=(e,t=[0,0])=>{const{width:n,height:r}=_n(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},uN=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const i=typeof o=="string";let s=!t.nodeLookup&&!i?o:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(o):Bd(o)?o:t.nodeLookup.get(o.id));const a=s?Va(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return gl(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return yl(n)},es=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=gl(n,Va(o)),r=!0)}),r?yl(n):{x:0,y:0,width:0,height:0}},Wd=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const a={...ns(t,[n,r,o]),width:t.width/o,height:t.height/o},l=[];for(const u of e.values()){const{measured:d,selectable:c=!0,hidden:h=!1}=u;if(s&&!c||h)continue;const g=d.width??u.width??u.initialWidth??null,y=d.height??u.height??u.initialHeight??null,v=Fi(a,wo(u)),w=(g??0)*(y??0),f=i&&v>0;(!u.internals.handleBounds||f||v>=w||u.dragging)&&l.push(u)}return l},cN=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function dN(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function fN({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=dN(e,s),l=es(a),u=qd(l,t,n,(s==null?void 0:s.minZoom)??o,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await r.setViewport(u,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function sv({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:l,y:u}=a?a.internals.positionAbsolute:{x:0,y:0},d=s.origin??r;let c=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!a)i==null||i("005",Qt.error005());else{const g=a.measured.width,y=a.measured.height;g&&y&&(c=[[l,u],[l+g,u+y]])}else a&&_o(s.extent)&&(c=[[s.extent[0][0]+l,s.extent[0][1]+u],[s.extent[1][0]+l,s.extent[1][1]+u]]);const h=_o(c)?Sr(t,c,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",Qt.error015())),{position:{x:h.x-l+(s.measured.width??0)*d[0],y:h.y-u+(s.measured.height??0)*d[1]},positionAbsolute:h}}async function hN({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(h=>h.id)),s=[];for(const h of n){if(h.deletable===!1)continue;const g=i.has(h.id),y=!g&&h.parentId&&s.find(v=>v.id===h.parentId);(g||y)&&s.push(h)}const a=new Set(t.map(h=>h.id)),l=r.filter(h=>h.deletable!==!1),d=cN(s,l);for(const h of l)a.has(h.id)&&!d.find(y=>y.id===h.id)&&d.push(h);if(!o)return{edges:d,nodes:s};const c=await o({nodes:s,edges:d});return typeof c=="boolean"?c?{edges:d,nodes:s}:{edges:[],nodes:[]}:c}const vo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Sr=(e={x:0,y:0},t,n)=>({x:vo(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:vo(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function av(e,t,n){const{width:r,height:o}=_n(n),{x:i,y:s}=n.internals.positionAbsolute;return Sr(e,[[i,s],[i+r,s+o]],t)}const Dp=(e,t,n)=>e<t?vo(Math.abs(e-t),1,t)/t:e>n?-vo(Math.abs(e-n),1,t)/t:0,lv=(e,t,n=15,r=40)=>{const o=Dp(e.x,r,t.width-r)*n,i=Dp(e.y,r,t.height-r)*n;return[o,i]},gl=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),kc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),yl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),wo=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Bd(e)?e.internals.positionAbsolute:Ji(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Va=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Bd(e)?e.internals.positionAbsolute:Ji(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},uv=(e,t)=>yl(gl(kc(e),kc(t))),Fi=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Lp=e=>At(e.width)&&At(e.height)&&At(e.x)&&At(e.y),At=e=>!isNaN(e)&&isFinite(e),pN=(e,t)=>{},ts=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ns=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const a={x:(e-n)/o,y:(t-r)/o};return i?ts(a,s):a},Fa=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function Tr(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function mN(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Tr(e,n),o=Tr(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=Tr(e.top??e.y??0,n),o=Tr(e.bottom??e.y??0,n),i=Tr(e.left??e.x??0,t),s=Tr(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:i,x:i+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function gN(e,t,n,r,o,i){const{x:s,y:a}=Fa(e,[t,n,r]),{x:l,y:u}=Fa({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=o-l,c=i-u;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(d),bottom:Math.floor(c)}}const qd=(e,t,n,r,o,i)=>{const s=mN(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,u=Math.min(a,l),d=vo(u,r,o),c=e.x+e.width/2,h=e.y+e.height/2,g=t/2-c*d,y=n/2-h*d,v=gN(e,g,y,d,t,n),w={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:g-w.left+w.right,y:y-w.top+w.bottom,zoom:d}},Hi=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function _o(e){return e!=null&&e!=="parent"}function _n(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function cv(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function dv(e,t={width:0,height:0},n,r,o){const i={...e},s=r.get(n);if(s){const a=s.origin||o;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function Vp(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function yN(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function vN(e){return{...nv,...e||{}}}function fi(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=Ot(e),a=ns({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:l,y:u}=n?ts(a,t):a;return{xSnapped:l,ySnapped:u,...a}}const Kd=e=>({width:e.offsetWidth,height:e.offsetHeight}),fv=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},wN=["INPUT","SELECT","TEXTAREA"];function hv(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:wN.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const pv=e=>"clientX"in e,Ot=(e,t)=>{var i,s;const n=pv(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},Fp=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...Kd(s)}})};function mv({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+a*.375+r*.125,d=Math.abs(l-e),c=Math.abs(u-t);return[l,u,d,c]}function bs(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Hp({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case ee.Left:return[t-bs(t-r,i),n];case ee.Right:return[t+bs(r-t,i),n];case ee.Top:return[t,n-bs(n-o,i)];case ee.Bottom:return[t,n+bs(o-n,i)]}}function gv({sourceX:e,sourceY:t,sourcePosition:n=ee.Bottom,targetX:r,targetY:o,targetPosition:i=ee.Top,curvature:s=.25}){const[a,l]=Hp({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,d]=Hp({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[c,h,g,y]=mv({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${a},${l} ${u},${d} ${r},${o}`,c,h,g,y]}function yv({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[i,a,o,s]}function _N({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const s=o&&n?r+1e3:r,a=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return s+a}function $N({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=gl(Va(e),Va(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return Fi(s,yl(i))>0}const xN=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,SN=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),EN=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||xN;let o;return iv(e)?o={...e}:o={...e,id:r(e)},SN(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function vv({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=yv({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const Up={[ee.Left]:{x:-1,y:0},[ee.Right]:{x:1,y:0},[ee.Top]:{x:0,y:-1},[ee.Bottom]:{x:0,y:1}},kN=({source:e,sourcePosition:t=ee.Bottom,target:n})=>t===ee.Left||t===ee.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Bp=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function NN({source:e,sourcePosition:t=ee.Bottom,target:n,targetPosition:r=ee.Top,center:o,offset:i,stepPosition:s}){const a=Up[t],l=Up[r],u={x:e.x+a.x*i,y:e.y+a.y*i},d={x:n.x+l.x*i,y:n.y+l.y*i},c=kN({source:u,sourcePosition:t,target:d}),h=c.x!==0?"x":"y",g=c[h];let y=[],v,w;const f={x:0,y:0},p={x:0,y:0},[,,m,_]=yv({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[h]*l[h]===-1){h==="x"?(v=o.x??u.x+(d.x-u.x)*s,w=o.y??(u.y+d.y)/2):(v=o.x??(u.x+d.x)/2,w=o.y??u.y+(d.y-u.y)*s);const I=[{x:v,y:u.y},{x:v,y:d.y}],L=[{x:u.x,y:w},{x:d.x,y:w}];a[h]===g?y=h==="x"?I:L:y=h==="x"?L:I}else{const I=[{x:u.x,y:d.y}],L=[{x:d.x,y:u.y}];if(h==="x"?y=a.x===g?L:I:y=a.y===g?I:L,t===r){const N=Math.abs(e[h]-n[h]);if(N<=i){const F=Math.min(i-1,i-N);a[h]===g?f[h]=(u[h]>e[h]?-1:1)*F:p[h]=(d[h]>n[h]?-1:1)*F}}if(t!==r){const N=h==="x"?"y":"x",F=a[h]===l[N],A=u[N]>d[N],H=u[N]<d[N];(a[h]===1&&(!F&&A||F&&H)||a[h]!==1&&(!F&&H||F&&A))&&(y=h==="x"?I:L)}const U={x:u.x+f.x,y:u.y+f.y},T={x:d.x+p.x,y:d.y+p.y},O=Math.max(Math.abs(U.x-y[0].x),Math.abs(T.x-y[0].x)),W=Math.max(Math.abs(U.y-y[0].y),Math.abs(T.y-y[0].y));O>=W?(v=(U.x+T.x)/2,w=y[0].y):(v=y[0].x,w=(U.y+T.y)/2)}const x={x:u.x+f.x,y:u.y+f.y},k={x:d.x+p.x,y:d.y+p.y};return[[e,...x.x!==y[0].x||x.y!==y[0].y?[x]:[],...y,...k.x!==y[y.length-1].x||k.y!==y[y.length-1].y?[k]:[],n],v,w,m,_]}function PN(e,t,n,r){const o=Math.min(Bp(e,t)/2,Bp(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*d}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+o*l}Q ${i},${s} ${i+o*a},${s}`}function Nc({sourceX:e,sourceY:t,sourcePosition:n=ee.Bottom,targetX:r,targetY:o,targetPosition:i=ee.Top,borderRadius:s=5,centerX:a,centerY:l,offset:u=20,stepPosition:d=.5}){const[c,h,g,y,v]=NN({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:l},offset:u,stepPosition:d});let w=`M${c[0].x} ${c[0].y}`;for(let f=1;f<c.length-1;f++)w+=PN(c[f-1],c[f],c[f+1],s);return w+=`L${c[c.length-1].x} ${c[c.length-1].y}`,[w,h,g,y,v]}function Wp(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function CN(e){var c;const{sourceNode:t,targetNode:n}=e;if(!Wp(t)||!Wp(n))return null;const r=t.internals.handleBounds||qp(t.handles),o=n.internals.handleBounds||qp(n.handles),i=Kp((r==null?void 0:r.source)??[],e.sourceHandle),s=Kp(e.connectionMode===yo.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!i||!s)return(c=e.onError)==null||c.call(e,"008",Qt.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(i==null?void 0:i.position)||ee.Bottom,l=(s==null?void 0:s.position)||ee.Top,u=Er(t,i,a),d=Er(n,s,l);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:a,targetPosition:l}}function qp(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Er(e,t,n=ee.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??_n(e);if(r)return{x:o+s/2,y:i+a/2};switch((t==null?void 0:t.position)??n){case ee.Top:return{x:o+s/2,y:i};case ee.Right:return{x:o+s,y:i+a/2};case ee.Bottom:return{x:o+s/2,y:i+a};case ee.Left:return{x:o,y:i+a/2}}}function Kp(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Pc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function bN(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||r,a.markerEnd||o].forEach(l=>{if(l&&typeof l=="object"){const u=Pc(l,t);i.has(u)||(s.push({id:u,color:l.color||n,...l}),i.add(u))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const wv=1e3,jN=10,Yd={nodeOrigin:[0,0],nodeExtent:Li,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},MN={...Yd,checkEquality:!0};function Xd(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function TN(e,t,n){const r=Xd(Yd,n);for(const o of e.values())if(o.parentId)Qd(o,e,t,r);else{const i=Ji(o,r.nodeOrigin),s=_o(o.extent)?o.extent:r.nodeExtent,a=Sr(i,s,_n(o));o.internals.positionAbsolute=a}}function IN(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const i={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(i):o.type==="target"&&r.push(i)}return{source:n,target:r}}function Gd(e){return e==="manual"}function Cc(e,t,n,r={}){var d,c;const o=Xd(MN,r),i={i:0},s=new Map(t),a=o!=null&&o.elevateNodesOnSelect&&!Gd(o.zIndexMode)?wv:0;let l=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let g=s.get(h.id);if(o.checkEquality&&h===(g==null?void 0:g.internals.userNode))t.set(h.id,g);else{const y=Ji(h,o.nodeOrigin),v=_o(h.extent)?h.extent:o.nodeExtent,w=Sr(y,v,_n(h));g={...o.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(c=h.measured)==null?void 0:c.height},internals:{positionAbsolute:w,handleBounds:IN(h,g),z:_v(h,a,o.zIndexMode),userNode:h}},t.set(h.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(l=!1),h.parentId&&Qd(g,t,n,r,i),u||(u=h.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function zN(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Qd(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:l}=Xd(Yd,r),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}zN(e,n),o&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++o.i,d.internals.z=d.internals.z+o.i*jN),o&&d.internals.rootParentIndex!==void 0&&(o.i=d.internals.rootParentIndex);const c=i&&!Gd(l)?wv:0,{x:h,y:g,z:y}=RN(e,d,s,a,c,l),{positionAbsolute:v}=e.internals,w=h!==v.x||g!==v.y;(w||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:h,y:g}:v,z:y}})}function _v(e,t,n){const r=At(e.zIndex)?e.zIndex:0;return Gd(n)?r:r+(e.selected?t:0)}function RN(e,t,n,r,o,i){const{x:s,y:a}=t.internals.positionAbsolute,l=_n(e),u=Ji(e,n),d=_o(e.extent)?Sr(u,e.extent,l):u;let c=Sr({x:s+d.x,y:a+d.y},r,l);e.extent==="parent"&&(c=av(c,l,t));const h=_v(e,o,i),g=t.internals.z??0;return{x:c.x,y:c.y,z:g>=h?g+1:h}}function Zd(e,t,n,r=[0,0]){var s;const o=[],i=new Map;for(const a of e){const l=t.get(a.parentId);if(!l)continue;const u=((s=i.get(a.parentId))==null?void 0:s.expandedRect)??wo(l),d=uv(u,a.rect);i.set(a.parentId,{expandedRect:d,parent:l})}return i.size>0&&i.forEach(({expandedRect:a,parent:l},u)=>{var m;const d=l.internals.positionAbsolute,c=_n(l),h=l.origin??r,g=a.x<d.x?Math.round(Math.abs(d.x-a.x)):0,y=a.y<d.y?Math.round(Math.abs(d.y-a.y)):0,v=Math.max(c.width,Math.round(a.width)),w=Math.max(c.height,Math.round(a.height)),f=(v-c.width)*h[0],p=(w-c.height)*h[1];(g>0||y>0||f||p)&&(o.push({id:u,type:"position",position:{x:l.position.x-g+f,y:l.position.y-y+p}}),(m=n.get(u))==null||m.forEach(_=>{e.some(x=>x.id===_.id)||o.push({id:_.id,type:"position",position:{x:_.position.x+g,y:_.position.y+y}})})),(c.width<a.width||c.height<a.height||g||y)&&o.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:v+(g?h[0]*g-f:0),height:w+(y?h[1]*y-p:0)}})}),o}function AN(e,t,n,r,o,i,s){const a=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const u=[],d=window.getComputedStyle(a),{m22:c}=new window.DOMMatrixReadOnly(d.transform),h=[];for(const g of e.values()){const y=t.get(g.id);if(!y)continue;if(y.hidden){t.set(y.id,{...y,internals:{...y.internals,handleBounds:void 0}}),l=!0;continue}const v=Kd(g.nodeElement),w=y.measured.width!==v.width||y.measured.height!==v.height;if(!!(v.width&&v.height&&(w||!y.internals.handleBounds||g.force))){const p=g.nodeElement.getBoundingClientRect(),m=_o(y.extent)?y.extent:i;let{positionAbsolute:_}=y.internals;y.parentId&&y.extent==="parent"?_=av(_,v,t.get(y.parentId)):m&&(_=Sr(_,m,v));const x={...y,measured:v,internals:{...y.internals,positionAbsolute:_,handleBounds:{source:Fp("source",g.nodeElement,p,c,y.id),target:Fp("target",g.nodeElement,p,c,y.id)}}};t.set(y.id,x),y.parentId&&Qd(x,t,n,{nodeOrigin:o,zIndexMode:s}),l=!0,w&&(u.push({id:y.id,type:"dimensions",dimensions:v}),y.expandParent&&y.parentId&&h.push({id:y.id,parentId:y.parentId,rect:wo(x,o)}))}}if(h.length>0){const g=Zd(h,t,n,o);u.push(...g)}return{changes:u,updatedInternals:l}}async function ON({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function Yp(e,t,n,r,o,i){let s=o;const a=r.get(s)||new Map;r.set(s,a.set(n,t)),s=`${o}-${e}`;const l=r.get(s)||new Map;if(r.set(s,l.set(n,t)),i){s=`${o}-${e}-${i}`;const u=r.get(s)||new Map;r.set(s,u.set(n,t))}}function $v(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:a=null}=r,l={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:a},u=`${o}-${s}--${i}-${a}`,d=`${i}-${a}--${o}-${s}`;Yp("source",l,d,e,o,s),Yp("target",l,u,e,i,a),t.set(r.id,r)}}function xv(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:xv(n,t):!1}function Xp(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function DN(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!xv(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&o.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return o}function fu({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,a,l;const o=[];for(const[u,d]of t){const c=(s=n.get(u))==null?void 0:s.internals.userNode;c&&o.push({...c,position:d.position,dragging:r})}if(!e)return[o[0],o];const i=(a=n.get(e))==null?void 0:a.internals.userNode;return[i?{...i,position:((l=t.get(e))==null?void 0:l.position)||i.position,dragging:r}:o[0],o]}function LN({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const i={x:n-o.distance.x,y:r-o.distance.y},s=ts(i,t);return{x:s.x-i.x,y:s.y-i.y}}function VN({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,a=new Map,l=!1,u={x:0,y:0},d=null,c=!1,h=null,g=!1,y=!1,v=null;function w({noDragClassName:p,handleSelector:m,domNode:_,isSelectable:x,nodeId:k,nodeClickDistance:C=0}){h=lt(_);function I({x:O,y:W}){const{nodeLookup:N,nodeExtent:F,snapGrid:A,snapToGrid:H,nodeOrigin:M,onNodeDrag:z,onSelectionDrag:b,onError:E,updateNodePositions:j}=t();i={x:O,y:W};let R=!1;const $=a.size>1,P=$&&F?kc(es(a)):null,V=$&&H?LN({dragItems:a,snapGrid:A,x:O,y:W}):null;for(const[q,B]of a){if(!N.has(q))continue;let Y={x:O-B.distance.x,y:W-B.distance.y};H&&(Y=V?{x:Math.round(Y.x+V.x),y:Math.round(Y.y+V.y)}:ts(Y,A));let G=null;if($&&F&&!B.extent&&P){const{positionAbsolute:ne}=B.internals,ue=ne.x-P.x+F[0][0],fe=ne.x+B.measured.width-P.x2+F[1][0],le=ne.y-P.y+F[0][1],be=ne.y+B.measured.height-P.y2+F[1][1];G=[[ue,le],[fe,be]]}const{position:Z,positionAbsolute:te}=sv({nodeId:q,nextPosition:Y,nodeLookup:N,nodeExtent:G||F,nodeOrigin:M,onError:E});R=R||B.position.x!==Z.x||B.position.y!==Z.y,B.position=Z,B.internals.positionAbsolute=te}if(y=y||R,!!R&&(j(a,!0),v&&(r||z||!k&&b))){const[q,B]=fu({nodeId:k,dragItems:a,nodeLookup:N});r==null||r(v,a,q,B),z==null||z(v,q,B),k||b==null||b(v,B)}}async function L(){if(!d)return;const{transform:O,panBy:W,autoPanSpeed:N,autoPanOnNodeDrag:F}=t();if(!F){l=!1,cancelAnimationFrame(s);return}const[A,H]=lv(u,d,N);(A!==0||H!==0)&&(i.x=(i.x??0)-A/O[2],i.y=(i.y??0)-H/O[2],await W({x:A,y:H})&&I(i)),s=requestAnimationFrame(L)}function U(O){var $;const{nodeLookup:W,multiSelectionActive:N,nodesDraggable:F,transform:A,snapGrid:H,snapToGrid:M,selectNodesOnDrag:z,onNodeDragStart:b,onSelectionDragStart:E,unselectNodesAndEdges:j}=t();c=!0,(!z||!x)&&!N&&k&&(($=W.get(k))!=null&&$.selected||j()),x&&z&&k&&(e==null||e(k));const R=fi(O.sourceEvent,{transform:A,snapGrid:H,snapToGrid:M,containerBounds:d});if(i=R,a=DN(W,F,R,k),a.size>0&&(n||b||!k&&E)){const[P,V]=fu({nodeId:k,dragItems:a,nodeLookup:W});n==null||n(O.sourceEvent,a,P,V),b==null||b(O.sourceEvent,P,V),k||E==null||E(O.sourceEvent,V)}}const T=Ly().clickDistance(C).on("start",O=>{const{domNode:W,nodeDragThreshold:N,transform:F,snapGrid:A,snapToGrid:H}=t();d=(W==null?void 0:W.getBoundingClientRect())||null,g=!1,y=!1,v=O.sourceEvent,N===0&&U(O),i=fi(O.sourceEvent,{transform:F,snapGrid:A,snapToGrid:H,containerBounds:d}),u=Ot(O.sourceEvent,d)}).on("drag",O=>{const{autoPanOnNodeDrag:W,transform:N,snapGrid:F,snapToGrid:A,nodeDragThreshold:H,nodeLookup:M}=t(),z=fi(O.sourceEvent,{transform:N,snapGrid:F,snapToGrid:A,containerBounds:d});if(v=O.sourceEvent,(O.sourceEvent.type==="touchmove"&&O.sourceEvent.touches.length>1||k&&!M.has(k))&&(g=!0),!g){if(!l&&W&&c&&(l=!0,L()),!c){const b=Ot(O.sourceEvent,d),E=b.x-u.x,j=b.y-u.y;Math.sqrt(E*E+j*j)>H&&U(O)}(i.x!==z.xSnapped||i.y!==z.ySnapped)&&a&&c&&(u=Ot(O.sourceEvent,d),I(z))}}).on("end",O=>{if(!(!c||g)&&(l=!1,c=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:W,updateNodePositions:N,onNodeDragStop:F,onSelectionDragStop:A}=t();if(y&&(N(a,!1),y=!1),o||F||!k&&A){const[H,M]=fu({nodeId:k,dragItems:a,nodeLookup:W,dragging:!1});o==null||o(O.sourceEvent,a,H,M),F==null||F(O.sourceEvent,H,M),k||A==null||A(O.sourceEvent,M)}}}).filter(O=>{const W=O.target;return!O.button&&(!p||!Xp(W,`.${p}`,_))&&(!m||Xp(W,m,_))});h.call(T)}function f(){h==null||h.on(".drag",null)}return{update:w,destroy:f}}function FN(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Fi(o,wo(i))>0&&r.push(i);return r}const HN=250;function UN(e,t,n,r){var a,l;let o=[],i=1/0;const s=FN(e,n,t+HN);for(const u of s){const d=[...((a=u.internals.handleBounds)==null?void 0:a.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const c of d){if(r.nodeId===c.nodeId&&r.type===c.type&&r.id===c.id)continue;const{x:h,y:g}=Er(u,c,c.position,!0),y=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(g-e.y,2));y>t||(y<i?(o=[{...c,x:h,y:g}],i=y):y===i&&o.push({...c,x:h,y:g}))}}if(!o.length)return null;if(o.length>1){const u=r.type==="source"?"target":"source";return o.find(d=>d.type===u)??o[0]}return o[0]}function Sv(e,t,n,r,o,i=!1){var u,d,c;const s=r.get(e);if(!s)return null;const a=o==="strict"?(u=s.internals.handleBounds)==null?void 0:u[t]:[...((d=s.internals.handleBounds)==null?void 0:d.source)??[],...((c=s.internals.handleBounds)==null?void 0:c.target)??[]],l=(n?a==null?void 0:a.find(h=>h.id===n):a==null?void 0:a[0])??null;return l&&i?{...l,...Er(s,l,l.position,!0)}:l}function Ev(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function BN(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const kv=()=>!0;function WN(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:l,lib:u,autoPanOnConnect:d,flowId:c,panBy:h,cancelConnection:g,onConnectStart:y,onConnect:v,onConnectEnd:w,isValidConnection:f=kv,onReconnectEnd:p,updateConnection:m,getTransform:_,getFromHandle:x,autoPanSpeed:k,dragThreshold:C=1,handleDomNode:I}){const L=fv(e.target);let U=0,T;const{x:O,y:W}=Ot(e),N=Ev(i,I),F=a==null?void 0:a.getBoundingClientRect();let A=!1;if(!F||!N)return;const H=Sv(o,N,r,l,t);if(!H)return;let M=Ot(e,F),z=!1,b=null,E=!1,j=null;function R(){if(!d||!F)return;const[Z,te]=lv(M,F,k);h({x:Z,y:te}),U=requestAnimationFrame(R)}const $={...H,nodeId:o,type:N,position:H.position},P=l.get(o);let q={inProgress:!0,isValid:null,from:Er(P,$,ee.Left,!0),fromHandle:$,fromPosition:$.position,fromNode:P,to:M,toHandle:null,toPosition:Op[$.position],toNode:null,pointer:M};function B(){A=!0,m(q),y==null||y(e,{nodeId:o,handleId:r,handleType:N})}C===0&&B();function Y(Z){if(!A){const{x:be,y:gt}=Ot(Z),st=be-O,Nt=gt-W;if(!(st*st+Nt*Nt>C*C))return;B()}if(!x()||!$){G(Z);return}const te=_();M=Ot(Z,F),T=UN(ns(M,te,!1,[1,1]),n,l,$),z||(R(),z=!0);const ne=Nv(Z,{handle:T,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:f,doc:L,lib:u,flowId:c,nodeLookup:l});j=ne.handleDomNode,b=ne.connection,E=BN(!!T,ne.isValid);const ue=l.get(o),fe=ue?Er(ue,$,ee.Left,!0):q.from,le={...q,from:fe,isValid:E,to:ne.toHandle&&E?Fa({x:ne.toHandle.x,y:ne.toHandle.y},te):M,toHandle:ne.toHandle,toPosition:E&&ne.toHandle?ne.toHandle.position:Op[$.position],toNode:ne.toHandle?l.get(ne.toHandle.nodeId):null,pointer:M};m(le),q=le}function G(Z){if(!("touches"in Z&&Z.touches.length>0)){if(A){(T||j)&&b&&E&&(v==null||v(b));const{inProgress:te,...ne}=q,ue={...ne,toPosition:q.toHandle?q.toPosition:null};w==null||w(Z,ue),i&&(p==null||p(Z,ue))}g(),cancelAnimationFrame(U),z=!1,E=!1,b=null,j=null,L.removeEventListener("mousemove",Y),L.removeEventListener("mouseup",G),L.removeEventListener("touchmove",Y),L.removeEventListener("touchend",G)}}L.addEventListener("mousemove",Y),L.addEventListener("mouseup",G),L.addEventListener("touchmove",Y),L.addEventListener("touchend",G)}function Nv(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:u=kv,nodeLookup:d}){const c=i==="target",h=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:g,y}=Ot(e),v=s.elementFromPoint(g,y),w=v!=null&&v.classList.contains(`${a}-flow__handle`)?v:h,f={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const p=Ev(void 0,w),m=w.getAttribute("data-nodeid"),_=w.getAttribute("data-handleid"),x=w.classList.contains("connectable"),k=w.classList.contains("connectableend");if(!m||!p)return f;const C={source:c?m:r,sourceHandle:c?_:o,target:c?r:m,targetHandle:c?o:_};f.connection=C;const L=x&&k&&(n===yo.Strict?c&&p==="source"||!c&&p==="target":m!==r||_!==o);f.isValid=L&&u(C),f.toHandle=Sv(m,p,_,d,n,!0)}return f}const bc={onPointerDown:WN,isValid:Nv};function qN({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=lt(e);function i({translateExtent:a,width:l,height:u,zoomStep:d=1,pannable:c=!0,zoomable:h=!0,inversePan:g=!1}){const y=m=>{if(m.sourceEvent.type!=="wheel"||!t)return;const _=n(),x=m.sourceEvent.ctrlKey&&Hi()?10:1,k=-m.sourceEvent.deltaY*(m.sourceEvent.deltaMode===1?.05:m.sourceEvent.deltaMode?1:.002)*d,C=_[2]*Math.pow(2,k*x);t.scaleTo(C)};let v=[0,0];const w=m=>{(m.sourceEvent.type==="mousedown"||m.sourceEvent.type==="touchstart")&&(v=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY])},f=m=>{const _=n();if(m.sourceEvent.type!=="mousemove"&&m.sourceEvent.type!=="touchmove"||!t)return;const x=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY],k=[x[0]-v[0],x[1]-v[1]];v=x;const C=r()*Math.max(_[2],Math.log(_[2]))*(g?-1:1),I={x:_[0]-k[0]*C,y:_[1]-k[1]*C},L=[[0,0],[l,u]];t.setViewportConstrained({x:I.x,y:I.y,zoom:_[2]},L,a)},p=ev().on("start",w).on("zoom",c?f:null).on("zoom.wheel",h?y:null);o.call(p,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:Tt}}const vl=e=>({x:e.x,y:e.y,zoom:e.k}),hu=({x:e,y:t,zoom:n})=>ml.translate(e,t).scale(n),Yr=(e,t)=>e.target.closest(`.${t}`),Pv=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),KN=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,pu=(e,t=0,n=KN,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},Cv=e=>{const t=e.ctrlKey&&Hi()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function YN({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:u}){return d=>{if(Yr(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const c=n.property("__zoom").k||1;if(d.ctrlKey&&s){const w=Tt(d),f=Cv(d),p=c*Math.pow(2,f);r.scaleTo(n,p,w,d);return}const h=d.deltaMode===1?20:1;let g=o===mr.Vertical?0:d.deltaX*h,y=o===mr.Horizontal?0:d.deltaY*h;!Hi()&&d.shiftKey&&o!==mr.Vertical&&(g=d.deltaY*h,y=0),r.translateBy(n,-(g/c)*i,-(y/c)*i,{internal:!0});const v=vl(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(d,v),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a==null||a(d,v))}}function XN({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,a=Yr(r,e);if(r.ctrlKey&&i&&a&&r.preventDefault(),s||a)return null;r.preventDefault(),n.call(this,r,o)}}function GN({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,a;if((i=r.sourceEvent)!=null&&i.internal)return;const o=vl(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((a=r.sourceEvent)==null?void 0:a.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function QN({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,a;e.usedRightMouseButton=!!(n&&Pv(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!((a=i.sourceEvent)!=null&&a.internal)&&(o==null||o(i.sourceEvent,vl(i.transform)))}}function ZN({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return s=>{var a;if(!((a=s.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,i&&Pv(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const l=vl(s.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,l)},n?150:0)}}}function JN({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:a,noPanClassName:l,lib:u,connectionInProgress:d}){return c=>{var w;const h=e||t,g=n&&c.ctrlKey,y=c.type==="wheel";if(c.button===1&&c.type==="mousedown"&&(Yr(c,`${u}-flow__node`)||Yr(c,`${u}-flow__edge`)))return!0;if(!r&&!h&&!o&&!i&&!n||s||d&&!y||Yr(c,a)&&y||Yr(c,l)&&(!y||o&&y&&!e)||!n&&c.ctrlKey&&y)return!1;if(!n&&c.type==="touchstart"&&((w=c.touches)==null?void 0:w.length)>1)return c.preventDefault(),!1;if(!h&&!o&&!g&&y||!r&&(c.type==="mousedown"||c.type==="touchstart")||Array.isArray(r)&&!r.includes(c.button)&&c.type==="mousedown")return!1;const v=Array.isArray(r)&&r.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||y)&&v}}function eP({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),c=ev().scaleExtent([t,n]).translateExtent(r),h=lt(e).call(c);p({x:o.x,y:o.y,zoom:vo(o.zoom,t,n)},[[0,0],[d.width,d.height]],r);const g=h.on("wheel.zoom"),y=h.on("dblclick.zoom");c.wheelDelta(Cv);function v(T,O){return h?new Promise(W=>{c==null||c.interpolate((O==null?void 0:O.interpolate)==="linear"?di:Js).transform(pu(h,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>W(!0)),T)}):Promise.resolve(!1)}function w({noWheelClassName:T,noPanClassName:O,onPaneContextMenu:W,userSelectionActive:N,panOnScroll:F,panOnDrag:A,panOnScrollMode:H,panOnScrollSpeed:M,preventScrolling:z,zoomOnPinch:b,zoomOnScroll:E,zoomOnDoubleClick:j,zoomActivationKeyPressed:R,lib:$,onTransformChange:P,connectionInProgress:V,paneClickDistance:q,selectionOnDrag:B}){N&&!u.isZoomingOrPanning&&f();const Y=F&&!R&&!N;c.clickDistance(B?1/0:!At(q)||q<0?0:q);const G=Y?YN({zoomPanValues:u,noWheelClassName:T,d3Selection:h,d3Zoom:c,panOnScrollMode:H,panOnScrollSpeed:M,zoomOnPinch:b,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):XN({noWheelClassName:T,preventScrolling:z,d3ZoomHandler:g});if(h.on("wheel.zoom",G,{passive:!1}),!N){const te=GN({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:s});c.on("start",te);const ne=QN({zoomPanValues:u,panOnDrag:A,onPaneContextMenu:!!W,onPanZoom:i,onTransformChange:P});c.on("zoom",ne);const ue=ZN({zoomPanValues:u,panOnDrag:A,panOnScroll:F,onPaneContextMenu:W,onPanZoomEnd:a,onDraggingChange:l});c.on("end",ue)}const Z=JN({zoomActivationKeyPressed:R,panOnDrag:A,zoomOnScroll:E,panOnScroll:F,zoomOnDoubleClick:j,zoomOnPinch:b,userSelectionActive:N,noPanClassName:O,noWheelClassName:T,lib:$,connectionInProgress:V});c.filter(Z),j?h.on("dblclick.zoom",y):h.on("dblclick.zoom",null)}function f(){c.on("zoom",null)}async function p(T,O,W){const N=hu(T),F=c==null?void 0:c.constrain()(N,O,W);return F&&await v(F),new Promise(A=>A(F))}async function m(T,O){const W=hu(T);return await v(W,O),new Promise(N=>N(W))}function _(T){if(h){const O=hu(T),W=h.property("__zoom");(W.k!==T.zoom||W.x!==T.x||W.y!==T.y)&&(c==null||c.transform(h,O,null,{sync:!0}))}}function x(){const T=h?Jy(h.node()):{x:0,y:0,k:1};return{x:T.x,y:T.y,zoom:T.k}}function k(T,O){return h?new Promise(W=>{c==null||c.interpolate((O==null?void 0:O.interpolate)==="linear"?di:Js).scaleTo(pu(h,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>W(!0)),T)}):Promise.resolve(!1)}function C(T,O){return h?new Promise(W=>{c==null||c.interpolate((O==null?void 0:O.interpolate)==="linear"?di:Js).scaleBy(pu(h,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>W(!0)),T)}):Promise.resolve(!1)}function I(T){c==null||c.scaleExtent(T)}function L(T){c==null||c.translateExtent(T)}function U(T){const O=!At(T)||T<0?0:T;c==null||c.clickDistance(O)}return{update:w,destroy:f,setViewport:m,setViewportConstrained:p,getViewport:x,scaleTo:k,scaleBy:C,setScaleExtent:I,setTranslateExtent:L,syncViewport:_,setClickDistance:U}}var $o;(function(e){e.Line="line",e.Handle="handle"})($o||($o={}));function tP({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){const s=e-t,a=n-r,l=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&o&&(l[0]=l[0]*-1),a&&i&&(l[1]=l[1]*-1),l}function Gp(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function Sn(e,t){return Math.max(0,t-e)}function En(e,t){return Math.max(0,e-t)}function js(e,t,n){return Math.max(0,t-e,e-n)}function Qp(e,t){return e?!t:t}function nP(e,t,n,r,o,i,s,a){let{affectsX:l,affectsY:u}=t;const{isHorizontal:d,isVertical:c}=t,h=d&&c,{xSnapped:g,ySnapped:y}=n,{minWidth:v,maxWidth:w,minHeight:f,maxHeight:p}=r,{x:m,y:_,width:x,height:k,aspectRatio:C}=e;let I=Math.floor(d?g-e.pointerX:0),L=Math.floor(c?y-e.pointerY:0);const U=x+(l?-I:I),T=k+(u?-L:L),O=-i[0]*x,W=-i[1]*k;let N=js(U,v,w),F=js(T,f,p);if(s){let M=0,z=0;l&&I<0?M=Sn(m+I+O,s[0][0]):!l&&I>0&&(M=En(m+U+O,s[1][0])),u&&L<0?z=Sn(_+L+W,s[0][1]):!u&&L>0&&(z=En(_+T+W,s[1][1])),N=Math.max(N,M),F=Math.max(F,z)}if(a){let M=0,z=0;l&&I>0?M=En(m+I,a[0][0]):!l&&I<0&&(M=Sn(m+U,a[1][0])),u&&L>0?z=En(_+L,a[0][1]):!u&&L<0&&(z=Sn(_+T,a[1][1])),N=Math.max(N,M),F=Math.max(F,z)}if(o){if(d){const M=js(U/C,f,p)*C;if(N=Math.max(N,M),s){let z=0;!l&&!u||l&&!u&&h?z=En(_+W+U/C,s[1][1])*C:z=Sn(_+W+(l?I:-I)/C,s[0][1])*C,N=Math.max(N,z)}if(a){let z=0;!l&&!u||l&&!u&&h?z=Sn(_+U/C,a[1][1])*C:z=En(_+(l?I:-I)/C,a[0][1])*C,N=Math.max(N,z)}}if(c){const M=js(T*C,v,w)/C;if(F=Math.max(F,M),s){let z=0;!l&&!u||u&&!l&&h?z=En(m+T*C+O,s[1][0])/C:z=Sn(m+(u?L:-L)*C+O,s[0][0])/C,F=Math.max(F,z)}if(a){let z=0;!l&&!u||u&&!l&&h?z=Sn(m+T*C,a[1][0])/C:z=En(m+(u?L:-L)*C,a[0][0])/C,F=Math.max(F,z)}}}L=L+(L<0?F:-F),I=I+(I<0?N:-N),o&&(h?U>T*C?L=(Qp(l,u)?-I:I)/C:I=(Qp(l,u)?-L:L)*C:d?(L=I/C,u=l):(I=L*C,l=u));const A=l?m+I:m,H=u?_+L:_;return{width:x+(l?-I:I),height:k+(u?-L:L),x:i[0]*I*(l?-1:1)+A,y:i[1]*L*(u?-1:1)+H}}const bv={width:0,height:0,x:0,y:0},rP={...bv,pointerX:0,pointerY:0,aspectRatio:1};function oP(e){return[[0,0],[e.measured.width,e.measured.height]]}function iP(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,l=n[1]*s;return[[r-a,o-l],[r+i-a,o+s-l]]}function sP({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=lt(e);let s={controlDirection:Gp("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:u,boundaries:d,keepAspectRatio:c,resizeDirection:h,onResizeStart:g,onResize:y,onResizeEnd:v,shouldResize:w}){let f={...bv},p={...rP};s={boundaries:d,resizeDirection:h,keepAspectRatio:c,controlDirection:Gp(u)};let m,_=null,x=[],k,C,I,L=!1;const U=Ly().on("start",T=>{const{nodeLookup:O,transform:W,snapGrid:N,snapToGrid:F,nodeOrigin:A,paneDomNode:H}=n();if(m=O.get(t),!m)return;_=(H==null?void 0:H.getBoundingClientRect())??null;const{xSnapped:M,ySnapped:z}=fi(T.sourceEvent,{transform:W,snapGrid:N,snapToGrid:F,containerBounds:_});f={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},p={...f,pointerX:M,pointerY:z,aspectRatio:f.width/f.height},k=void 0,m.parentId&&(m.extent==="parent"||m.expandParent)&&(k=O.get(m.parentId),C=k&&m.extent==="parent"?oP(k):void 0),x=[],I=void 0;for(const[b,E]of O)if(E.parentId===t&&(x.push({id:b,position:{...E.position},extent:E.extent}),E.extent==="parent"||E.expandParent)){const j=iP(E,m,E.origin??A);I?I=[[Math.min(j[0][0],I[0][0]),Math.min(j[0][1],I[0][1])],[Math.max(j[1][0],I[1][0]),Math.max(j[1][1],I[1][1])]]:I=j}g==null||g(T,{...f})}).on("drag",T=>{const{transform:O,snapGrid:W,snapToGrid:N,nodeOrigin:F}=n(),A=fi(T.sourceEvent,{transform:O,snapGrid:W,snapToGrid:N,containerBounds:_}),H=[];if(!m)return;const{x:M,y:z,width:b,height:E}=f,j={},R=m.origin??F,{width:$,height:P,x:V,y:q}=nP(p,s.controlDirection,A,s.boundaries,s.keepAspectRatio,R,C,I),B=$!==b,Y=P!==E,G=V!==M&&B,Z=q!==z&&Y;if(!G&&!Z&&!B&&!Y)return;if((G||Z||R[0]===1||R[1]===1)&&(j.x=G?V:f.x,j.y=Z?q:f.y,f.x=j.x,f.y=j.y,x.length>0)){const fe=V-M,le=q-z;for(const be of x)be.position={x:be.position.x-fe+R[0]*($-b),y:be.position.y-le+R[1]*(P-E)},H.push(be)}if((B||Y)&&(j.width=B&&(!s.resizeDirection||s.resizeDirection==="horizontal")?$:f.width,j.height=Y&&(!s.resizeDirection||s.resizeDirection==="vertical")?P:f.height,f.width=j.width,f.height=j.height),k&&m.expandParent){const fe=R[0]*(j.width??0);j.x&&j.x<fe&&(f.x=fe,p.x=p.x-(j.x-fe));const le=R[1]*(j.height??0);j.y&&j.y<le&&(f.y=le,p.y=p.y-(j.y-le))}const te=tP({width:f.width,prevWidth:b,height:f.height,prevHeight:E,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),ne={...f,direction:te};(w==null?void 0:w(T,ne))!==!1&&(L=!0,y==null||y(T,ne),r(j,H))}).on("end",T=>{L&&(v==null||v(T,{...f}),o==null||o({...f}),L=!1)});i.call(U)}function l(){i.on(".drag",null)}return{update:a,destroy:l}}var jv={exports:{}},Mv={},Tv={exports:{}},Iv={};/**
|
|
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 xo=D;function aP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var lP=typeof Object.is=="function"?Object.is:aP,uP=xo.useState,cP=xo.useEffect,dP=xo.useLayoutEffect,fP=xo.useDebugValue;function hP(e,t){var n=t(),r=uP({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return dP(function(){o.value=n,o.getSnapshot=t,mu(o)&&i({inst:o})},[e,n,t]),cP(function(){return mu(o)&&i({inst:o}),e(function(){mu(o)&&i({inst:o})})},[e]),fP(n),n}function mu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!lP(e,n)}catch{return!0}}function pP(e,t){return t()}var mP=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?pP:hP;Iv.useSyncExternalStore=xo.useSyncExternalStore!==void 0?xo.useSyncExternalStore:mP;Tv.exports=Iv;var gP=Tv.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 wl=D,yP=gP;function vP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wP=typeof Object.is=="function"?Object.is:vP,_P=yP.useSyncExternalStore,$P=wl.useRef,xP=wl.useEffect,SP=wl.useMemo,EP=wl.useDebugValue;Mv.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=$P(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=SP(function(){function l(g){if(!u){if(u=!0,d=g,g=r(g),o!==void 0&&s.hasValue){var y=s.value;if(o(y,g))return c=y}return c=g}if(y=c,wP(d,g))return y;var v=r(g);return o!==void 0&&o(y,v)?(d=g,y):(d=g,c=v)}var u=!1,d,c,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,r,o]);var a=_P(e,i[0],i[1]);return xP(function(){s.hasValue=!0,s.value=a},[a]),EP(a),a};jv.exports=Mv;var kP=jv.exports;const NP=Ya(kP),PP={},Zp=e=>{let t;const n=new Set,r=(d,c)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const g=t;t=c??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(y=>y(t,g))}},o=()=>t,l={setState:r,getState:o,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(PP?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,o,l);return l},CP=e=>e?Zp(e):Zp,{useDebugValue:bP}=L_,{useSyncExternalStoreWithSelector:jP}=NP,MP=e=>e;function zv(e,t=MP,n){const r=jP(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return bP(r),r}const Jp=(e,t)=>{const n=CP(e),r=(o,i=t)=>zv(n,o,i);return Object.assign(r,n),r},TP=(e,t)=>e?Jp(e,t):Jp;function _e(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const _l=D.createContext(null),IP=_l.Provider,Rv=Qt.error001();function ce(e,t){const n=D.useContext(_l);if(n===null)throw new Error(Rv);return zv(n,e,t)}function xe(){const e=D.useContext(_l);if(e===null)throw new Error(Rv);return D.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const em={display:"none"},zP={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Av="react-flow__node-desc",Ov="react-flow__edge-desc",RP="react-flow__aria-live",AP=e=>e.ariaLiveMessage,OP=e=>e.ariaLabelConfig;function DP({rfId:e}){const t=ce(AP);return S.jsx("div",{id:`${RP}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:zP,children:t})}function LP({rfId:e,disableKeyboardA11y:t}){const n=ce(OP);return S.jsxs(S.Fragment,{children:[S.jsx("div",{id:`${Av}-${e}`,style:em,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),S.jsx("div",{id:`${Ov}-${e}`,style:em,children:n["edge.a11yDescription.default"]}),!t&&S.jsx(DP,{rfId:e})]})}const $l=D.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{const s=`${e}`.split("-");return S.jsx("div",{className:Me(["react-flow__panel",n,...s]),style:r,ref:i,...o,children:t})});$l.displayName="Panel";function VP({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:S.jsx($l,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:S.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const FP=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Ms=e=>e.id;function HP(e,t){return _e(e.selectedNodes.map(Ms),t.selectedNodes.map(Ms))&&_e(e.selectedEdges.map(Ms),t.selectedEdges.map(Ms))}function UP({onSelectionChange:e}){const t=xe(),{selectedNodes:n,selectedEdges:r}=ce(FP,HP);return D.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,r,e]),null}const BP=e=>!!e.onSelectionChangeHandlers;function WP({onSelectionChange:e}){const t=ce(BP);return e||t?S.jsx(UP,{onSelectionChange:e}):null}const jc=typeof window<"u"?D.useLayoutEffect:D.useEffect,Dv=[0,0],qP={x:0,y:0,zoom:1},KP=["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"],tm=[...KP,"rfId"],YP=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),nm={translateExtent:Li,nodeOrigin:Dv,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function XP(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:l}=ce(YP,_e),u=xe();jc(()=>(l(e.defaultNodes,e.defaultEdges),()=>{d.current=nm,a()}),[]);const d=D.useRef(nm);return jc(()=>{for(const c of tm){const h=e[c],g=d.current[c];h!==g&&(typeof e[c]>"u"||(c==="nodes"?t(h):c==="edges"?n(h):c==="minZoom"?r(h):c==="maxZoom"?o(h):c==="translateExtent"?i(h):c==="nodeExtent"?s(h):c==="ariaLabelConfig"?u.setState({ariaLabelConfig:vN(h)}):c==="fitView"?u.setState({fitViewQueued:h}):c==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[c]:h})))}d.current=e},tm.map(c=>e[c])),null}function rm(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function GP(e){var r;const[t,n]=D.useState(e==="system"?null:e);return D.useEffect(()=>{if(e!=="system"){n(e);return}const o=rm(),i=()=>n(o!=null&&o.matches?"dark":"light");return i(),o==null||o.addEventListener("change",i),()=>{o==null||o.removeEventListener("change",i)}},[e]),t!==null?t:(r=rm())!=null&&r.matches?"dark":"light"}const om=typeof document<"u"?document:null;function Ui(e=null,t={target:om,actInsideInputWithModifier:!0}){const[n,r]=D.useState(!1),o=D.useRef(!1),i=D.useRef(new Set([])),[s,a]=D.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(c=>typeof c=="string").map(c=>c.replace("+",`
|
|
197
|
+
`).replace(`
|
|
198
|
+
|
|
199
|
+
`,`
|
|
200
|
+
+`).split(`
|
|
201
|
+
`)),d=u.reduce((c,h)=>c.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return D.useEffect(()=>{const l=(t==null?void 0:t.target)??om,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=g=>{var w,f;if(o.current=g.ctrlKey||g.metaKey||g.shiftKey||g.altKey,(!o.current||o.current&&!u)&&hv(g))return!1;const v=sm(g.code,a);if(i.current.add(g[v]),im(s,i.current,!1)){const p=((f=(w=g.composedPath)==null?void 0:w.call(g))==null?void 0:f[0])||g.target,m=(p==null?void 0:p.nodeName)==="BUTTON"||(p==null?void 0:p.nodeName)==="A";t.preventDefault!==!1&&(o.current||!m)&&g.preventDefault(),r(!0)}},c=g=>{const y=sm(g.code,a);im(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(g[y]),g.key==="Meta"&&i.current.clear(),o.current=!1},h=()=>{i.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",d),l==null||l.addEventListener("keyup",c),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{l==null||l.removeEventListener("keydown",d),l==null||l.removeEventListener("keyup",c),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}function im(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function sm(e,t){return t.includes(e)?"code":"key"}const QP=()=>{const e=xe();return D.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,o,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:o,minZoom:i,maxZoom:s,panZoom:a}=e.getState(),l=qd(t,r,o,i,s,(n==null?void 0:n.padding)??.1);return a?(await a.setViewport(l,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:a,y:l}=s.getBoundingClientRect(),u={x:t.x-a,y:t.y-l},d=n.snapGrid??o,c=n.snapToGrid??i;return ns(u,r,c,d)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),s=Fa(t,n);return{x:s.x+o,y:s.y+i}}}),[])};function Lv(e,t){const n=[],r=new Map,o=[];for(const i of e)if(i.type==="add"){o.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const s=r.get(i.id);s?s.push(i):r.set(i.id,[i])}for(const i of t){const s=r.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...i};for(const l of s)ZP(l,a);n.push(a)}return o.length&&o.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function ZP(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function JP(e,t){return Lv(e,t)}function eC(e,t){return Lv(e,t)}function nr(e,t){return{id:e,type:"select",selected:t}}function Xr(e,t=new Set,n=!1){const r=[];for(const[o,i]of e){const s=t.has(o);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),r.push(nr(i.id,s)))}return r}function am({items:e=[],lookup:t}){var o;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,s]of e.entries()){const a=t.get(s.id),l=((o=a==null?void 0:a.internals)==null?void 0:o.userNode)??a;l!==void 0&&l!==s&&n.push({id:s.id,item:s,type:"replace"}),l===void 0&&n.push({item:s,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function lm(e){return{id:e.id,type:"remove"}}const um=e=>lN(e),tC=e=>iv(e);function Vv(e){return D.forwardRef(e)}function cm(e){const[t,n]=D.useState(BigInt(0)),[r]=D.useState(()=>nC(()=>n(o=>o+BigInt(1))));return jc(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function nC(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Fv=D.createContext(null);function rC({children:e}){const t=xe(),n=D.useCallback(a=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:d,onNodesChange:c,nodeLookup:h,fitViewQueued:g,onNodesChangeMiddlewareMap:y}=t.getState();let v=l;for(const f of a)v=typeof f=="function"?f(v):f;let w=am({items:v,lookup:h});for(const f of y.values())w=f(w);d&&u(v),w.length>0?c==null||c(w):g&&window.requestAnimationFrame(()=>{const{fitViewQueued:f,nodes:p,setNodes:m}=t.getState();f&&m(p)})},[]),r=cm(n),o=D.useCallback(a=>{const{edges:l=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:c,edgeLookup:h}=t.getState();let g=l;for(const y of a)g=typeof y=="function"?y(g):y;d?u(g):c&&c(am({items:g,lookup:h}))},[]),i=cm(o),s=D.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return S.jsx(Fv.Provider,{value:s,children:e})}function oC(){const e=D.useContext(Fv);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const iC=e=>!!e.panZoom;function Jd(){const e=QP(),t=xe(),n=oC(),r=ce(iC),o=D.useMemo(()=>{const i=c=>t.getState().nodeLookup.get(c),s=c=>{n.nodeQueue.push(c)},a=c=>{n.edgeQueue.push(c)},l=c=>{var f,p;const{nodeLookup:h,nodeOrigin:g}=t.getState(),y=um(c)?c:h.get(c.id),v=y.parentId?dv(y.position,y.measured,y.parentId,h,g):y.position,w={...y,position:v,width:((f=y.measured)==null?void 0:f.width)??y.width,height:((p=y.measured)==null?void 0:p.height)??y.height};return wo(w)},u=(c,h,g={replace:!1})=>{s(y=>y.map(v=>{if(v.id===c){const w=typeof h=="function"?h(v):h;return g.replace&&um(w)?w:{...v,...w}}return v}))},d=(c,h,g={replace:!1})=>{a(y=>y.map(v=>{if(v.id===c){const w=typeof h=="function"?h(v):h;return g.replace&&tC(w)?w:{...v,...w}}return v}))};return{getNodes:()=>t.getState().nodes.map(c=>({...c})),getNode:c=>{var h;return(h=i(c))==null?void 0:h.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:c=[]}=t.getState();return c.map(h=>({...h}))},getEdge:c=>t.getState().edgeLookup.get(c),setNodes:s,setEdges:a,addNodes:c=>{const h=Array.isArray(c)?c:[c];n.nodeQueue.push(g=>[...g,...h])},addEdges:c=>{const h=Array.isArray(c)?c:[c];n.edgeQueue.push(g=>[...g,...h])},toObject:()=>{const{nodes:c=[],edges:h=[],transform:g}=t.getState(),[y,v,w]=g;return{nodes:c.map(f=>({...f})),edges:h.map(f=>({...f})),viewport:{x:y,y:v,zoom:w}}},deleteElements:async({nodes:c=[],edges:h=[]})=>{const{nodes:g,edges:y,onNodesDelete:v,onEdgesDelete:w,triggerNodeChanges:f,triggerEdgeChanges:p,onDelete:m,onBeforeDelete:_}=t.getState(),{nodes:x,edges:k}=await hN({nodesToRemove:c,edgesToRemove:h,nodes:g,edges:y,onBeforeDelete:_}),C=k.length>0,I=x.length>0;if(C){const L=k.map(lm);w==null||w(k),p(L)}if(I){const L=x.map(lm);v==null||v(x),f(L)}return(I||C)&&(m==null||m({nodes:x,edges:k})),{deletedNodes:x,deletedEdges:k}},getIntersectingNodes:(c,h=!0,g)=>{const y=Lp(c),v=y?c:l(c),w=g!==void 0;return v?(g||t.getState().nodes).filter(f=>{const p=t.getState().nodeLookup.get(f.id);if(p&&!y&&(f.id===c.id||!p.internals.positionAbsolute))return!1;const m=wo(w?f:p),_=Fi(m,v);return h&&_>0||_>=m.width*m.height||_>=v.width*v.height}):[]},isNodeIntersecting:(c,h,g=!0)=>{const v=Lp(c)?c:l(c);if(!v)return!1;const w=Fi(v,h);return g&&w>0||w>=h.width*h.height||w>=v.width*v.height},updateNode:u,updateNodeData:(c,h,g={replace:!1})=>{u(c,y=>{const v=typeof h=="function"?h(y):h;return g.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},g)},updateEdge:d,updateEdgeData:(c,h,g={replace:!1})=>{d(c,y=>{const v=typeof h=="function"?h(y):h;return g.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},g)},getNodesBounds:c=>{const{nodeLookup:h,nodeOrigin:g}=t.getState();return uN(c,{nodeLookup:h,nodeOrigin:g})},getHandleConnections:({type:c,id:h,nodeId:g})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${g}-${c}${h?`-${h}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:c,handleId:h,nodeId:g})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${g}${c?h?`-${c}-${h}`:`-${c}`:""}`))==null?void 0:y.values())??[])},fitView:async c=>{const h=t.getState().fitViewResolver??yN();return t.setState({fitViewQueued:!0,fitViewOptions:c,fitViewResolver:h}),n.nodeQueue.push(g=>[...g]),h.promise}}},[]);return D.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const dm=e=>e.selected,sC=typeof window<"u"?window:void 0;function aC({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=xe(),{deleteElements:r}=Jd(),o=Ui(e,{actInsideInputWithModifier:!1}),i=Ui(t,{target:sC});D.useEffect(()=>{if(o){const{edges:s,nodes:a}=n.getState();r({nodes:a.filter(dm),edges:s.filter(dm)}),n.setState({nodesSelectionActive:!1})}},[o]),D.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function lC(e){const t=xe();D.useEffect(()=>{const n=()=>{var o,i,s,a;if(!e.current||!(((i=(o=e.current).checkVisibility)==null?void 0:i.call(o))??!0))return!1;const r=Kd(e.current);(r.height===0||r.width===0)&&((a=(s=t.getState()).onError)==null||a.call(s,"004",Qt.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const xl={position:"absolute",width:"100%",height:"100%",top:0,left:0},uC=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function cC({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:i=mr.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:c,zoomActivationKeyCode:h,preventScrolling:g=!0,children:y,noWheelClassName:v,noPanClassName:w,onViewportChange:f,isControlledViewport:p,paneClickDistance:m,selectionOnDrag:_}){const x=xe(),k=D.useRef(null),{userSelectionActive:C,lib:I,connectionInProgress:L}=ce(uC,_e),U=Ui(h),T=D.useRef();lC(k);const O=D.useCallback(W=>{f==null||f({x:W[0],y:W[1],zoom:W[2]}),p||x.setState({transform:W})},[f,p]);return D.useEffect(()=>{if(k.current){T.current=eP({domNode:k.current,minZoom:d,maxZoom:c,translateExtent:u,viewport:l,onDraggingChange:A=>x.setState(H=>H.paneDragging===A?H:{paneDragging:A}),onPanZoomStart:(A,H)=>{const{onViewportChangeStart:M,onMoveStart:z}=x.getState();z==null||z(A,H),M==null||M(H)},onPanZoom:(A,H)=>{const{onViewportChange:M,onMove:z}=x.getState();z==null||z(A,H),M==null||M(H)},onPanZoomEnd:(A,H)=>{const{onViewportChangeEnd:M,onMoveEnd:z}=x.getState();z==null||z(A,H),M==null||M(H)}});const{x:W,y:N,zoom:F}=T.current.getViewport();return x.setState({panZoom:T.current,transform:[W,N,F],domNode:k.current.closest(".react-flow")}),()=>{var A;(A=T.current)==null||A.destroy()}}},[]),D.useEffect(()=>{var W;(W=T.current)==null||W.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:U,preventScrolling:g,noPanClassName:w,userSelectionActive:C,noWheelClassName:v,lib:I,onTransformChange:O,connectionInProgress:L,selectionOnDrag:_,paneClickDistance:m})},[e,t,n,r,o,i,s,a,U,g,w,C,v,I,O,L,_,m]),S.jsx("div",{className:"react-flow__renderer",ref:k,style:xl,children:y})}const dC=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function fC(){const{userSelectionActive:e,userSelectionRect:t}=ce(dC,_e);return e&&t?S.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const gu=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},hC=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function pC({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Vi.Full,panOnDrag:r,paneClickDistance:o,selectionOnDrag:i,onSelectionStart:s,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:c,onPaneMouseMove:h,onPaneMouseLeave:g,children:y}){const v=xe(),{userSelectionActive:w,elementsSelectable:f,dragging:p,connectionInProgress:m}=ce(hC,_e),_=f&&(e||w),x=D.useRef(null),k=D.useRef(),C=D.useRef(new Set),I=D.useRef(new Set),L=D.useRef(!1),U=M=>{if(L.current||m){L.current=!1;return}l==null||l(M),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},T=M=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){M.preventDefault();return}u==null||u(M)},O=d?M=>d(M):void 0,W=M=>{L.current&&(M.stopPropagation(),L.current=!1)},N=M=>{var P,V;const{domNode:z}=v.getState();if(k.current=z==null?void 0:z.getBoundingClientRect(),!k.current)return;const b=M.target===x.current;if(!b&&!!M.target.closest(".nokey")||!e||!(i&&b||t)||M.button!==0||!M.isPrimary)return;(V=(P=M.target)==null?void 0:P.setPointerCapture)==null||V.call(P,M.pointerId),L.current=!1;const{x:R,y:$}=Ot(M.nativeEvent,k.current);v.setState({userSelectionRect:{width:0,height:0,startX:R,startY:$,x:R,y:$}}),b||(M.stopPropagation(),M.preventDefault())},F=M=>{const{userSelectionRect:z,transform:b,nodeLookup:E,edgeLookup:j,connectionLookup:R,triggerNodeChanges:$,triggerEdgeChanges:P,defaultEdgeOptions:V,resetSelectedElements:q}=v.getState();if(!k.current||!z)return;const{x:B,y:Y}=Ot(M.nativeEvent,k.current),{startX:G,startY:Z}=z;if(!L.current){const le=t?0:o;if(Math.hypot(B-G,Y-Z)<=le)return;q(),s==null||s(M)}L.current=!0;const te={startX:G,startY:Z,x:B<G?B:G,y:Y<Z?Y:Z,width:Math.abs(B-G),height:Math.abs(Y-Z)},ne=C.current,ue=I.current;C.current=new Set(Wd(E,te,b,n===Vi.Partial,!0).map(le=>le.id)),I.current=new Set;const fe=(V==null?void 0:V.selectable)??!0;for(const le of C.current){const be=R.get(le);if(be)for(const{edgeId:gt}of be.values()){const st=j.get(gt);st&&(st.selectable??fe)&&I.current.add(gt)}}if(!Vp(ne,C.current)){const le=Xr(E,C.current,!0);$(le)}if(!Vp(ue,I.current)){const le=Xr(j,I.current);P(le)}v.setState({userSelectionRect:te,userSelectionActive:!0,nodesSelectionActive:!1})},A=M=>{var z,b;M.button===0&&((b=(z=M.target)==null?void 0:z.releasePointerCapture)==null||b.call(z,M.pointerId),!w&&M.target===x.current&&v.getState().userSelectionRect&&(U==null||U(M)),v.setState({userSelectionActive:!1,userSelectionRect:null}),L.current&&(a==null||a(M),v.setState({nodesSelectionActive:C.current.size>0})))},H=r===!0||Array.isArray(r)&&r.includes(0);return S.jsxs("div",{className:Me(["react-flow__pane",{draggable:H,dragging:p,selection:e}]),onClick:_?void 0:gu(U,x),onContextMenu:gu(T,x),onWheel:gu(O,x),onPointerEnter:_?void 0:c,onPointerMove:_?F:h,onPointerUp:_?A:void 0,onPointerDownCapture:_?N:void 0,onClickCapture:_?W:void 0,onPointerLeave:g,ref:x,style:xl,children:[y,S.jsx(fC,{})]})}function Mc({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:a,onError:l}=t.getState(),u=a.get(e);if(!u){l==null||l("012",Qt.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):o([e])}function Hv({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:s}){const a=xe(),[l,u]=D.useState(!1),d=D.useRef();return D.useEffect(()=>{d.current=VN({getStoreItems:()=>a.getState(),onNodeMouseDown:c=>{Mc({id:c,store:a,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),D.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:o,nodeClickDistance:s}),()=>{var c;(c=d.current)==null||c.destroy()}},[n,r,t,i,e,o,s]),l}const mC=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Uv(){const e=xe();return D.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:i,nodesDraggable:s,onError:a,updateNodePositions:l,nodeLookup:u,nodeOrigin:d}=e.getState(),c=new Map,h=mC(s),g=o?i[0]:5,y=o?i[1]:5,v=n.direction.x*g*n.factor,w=n.direction.y*y*n.factor;for(const[,f]of u){if(!h(f))continue;let p={x:f.internals.positionAbsolute.x+v,y:f.internals.positionAbsolute.y+w};o&&(p=ts(p,i));const{position:m,positionAbsolute:_}=sv({nodeId:f.id,nextPosition:p,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:a});f.position=m,f.internals.positionAbsolute=_,c.set(f.id,f)}l(c)},[])}const ef=D.createContext(null),gC=ef.Provider;ef.Consumer;const Bv=()=>D.useContext(ef),yC=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),vC=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:i,connection:s}=r,{fromHandle:a,toHandle:l,isValid:u}=s,d=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n;return{connectingFrom:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,connectingTo:d,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:i===yo.Strict?(a==null?void 0:a.type)!==n:e!==(a==null?void 0:a.nodeId)||t!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!o,valid:d&&u}};function wC({type:e="source",position:t=ee.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:l,className:u,onMouseDown:d,onTouchStart:c,...h},g){var F,A;const y=s||null,v=e==="target",w=xe(),f=Bv(),{connectOnClick:p,noPanClassName:m,rfId:_}=ce(yC,_e),{connectingFrom:x,connectingTo:k,clickConnecting:C,isPossibleEndHandle:I,connectionInProcess:L,clickConnectionInProcess:U,valid:T}=ce(vC(f,y,e),_e);f||(A=(F=w.getState()).onError)==null||A.call(F,"010",Qt.error010());const O=H=>{const{defaultEdgeOptions:M,onConnect:z,hasDefaultEdges:b}=w.getState(),E={...M,...H};if(b){const{edges:j,setEdges:R}=w.getState();R(EN(E,j))}z==null||z(E),a==null||a(E)},W=H=>{if(!f)return;const M=pv(H.nativeEvent);if(o&&(M&&H.button===0||!M)){const z=w.getState();bc.onPointerDown(H.nativeEvent,{handleDomNode:H.currentTarget,autoPanOnConnect:z.autoPanOnConnect,connectionMode:z.connectionMode,connectionRadius:z.connectionRadius,domNode:z.domNode,nodeLookup:z.nodeLookup,lib:z.lib,isTarget:v,handleId:y,nodeId:f,flowId:z.rfId,panBy:z.panBy,cancelConnection:z.cancelConnection,onConnectStart:z.onConnectStart,onConnectEnd:(...b)=>{var E,j;return(j=(E=w.getState()).onConnectEnd)==null?void 0:j.call(E,...b)},updateConnection:z.updateConnection,onConnect:O,isValidConnection:n||((...b)=>{var E,j;return((j=(E=w.getState()).isValidConnection)==null?void 0:j.call(E,...b))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:z.autoPanSpeed,dragThreshold:z.connectionDragThreshold})}M?d==null||d(H):c==null||c(H)},N=H=>{const{onClickConnectStart:M,onClickConnectEnd:z,connectionClickStartHandle:b,connectionMode:E,isValidConnection:j,lib:R,rfId:$,nodeLookup:P,connection:V}=w.getState();if(!f||!b&&!o)return;if(!b){M==null||M(H.nativeEvent,{nodeId:f,handleId:y,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:f,type:e,id:y}});return}const q=fv(H.target),B=n||j,{connection:Y,isValid:G}=bc.isValid(H.nativeEvent,{handle:{nodeId:f,id:y,type:e},connectionMode:E,fromNodeId:b.nodeId,fromHandleId:b.id||null,fromType:b.type,isValidConnection:B,flowId:$,doc:q,lib:R,nodeLookup:P});G&&Y&&O(Y);const Z=structuredClone(V);delete Z.inProgress,Z.toPosition=Z.toHandle?Z.toHandle.position:null,z==null||z(H,Z),w.setState({connectionClickStartHandle:null})};return S.jsx("div",{"data-handleid":y,"data-nodeid":f,"data-handlepos":t,"data-id":`${_}-${f}-${y}-${e}`,className:Me(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",m,u,{source:!v,target:v,connectable:r,connectablestart:o,connectableend:i,clickconnecting:C,connectingfrom:x,connectingto:k,valid:T,connectionindicator:r&&(!L||I)&&(L||U?i:o)}]),onMouseDown:W,onTouchStart:W,onClick:p?N:void 0,ref:g,...h,children:l})}const Rn=D.memo(Vv(wC));function _C({data:e,isConnectable:t,sourcePosition:n=ee.Bottom}){return S.jsxs(S.Fragment,{children:[e==null?void 0:e.label,S.jsx(Rn,{type:"source",position:n,isConnectable:t})]})}function $C({data:e,isConnectable:t,targetPosition:n=ee.Top,sourcePosition:r=ee.Bottom}){return S.jsxs(S.Fragment,{children:[S.jsx(Rn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,S.jsx(Rn,{type:"source",position:r,isConnectable:t})]})}function xC(){return null}function SC({data:e,isConnectable:t,targetPosition:n=ee.Top}){return S.jsxs(S.Fragment,{children:[S.jsx(Rn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Ha={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},fm={input:_C,default:$C,output:SC,group:xC};function EC(e){var t,n,r,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const kC=e=>{const{width:t,height:n,x:r,y:o}=es(e.nodeLookup,{filter:i=>!!i.selected});return{width:At(t)?t:null,height:At(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function NC({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=xe(),{width:o,height:i,transformString:s,userSelectionActive:a}=ce(kC,_e),l=Uv(),u=D.useRef(null);D.useEffect(()=>{var g;n||(g=u.current)==null||g.focus({preventScroll:!0})},[n]);const d=!a&&o!==null&&i!==null;if(Hv({nodeRef:u,disabled:!d}),!d)return null;const c=e?g=>{const y=r.getState().nodes.filter(v=>v.selected);e(g,y)}:void 0,h=g=>{Object.prototype.hasOwnProperty.call(Ha,g.key)&&(g.preventDefault(),l({direction:Ha[g.key],factor:g.shiftKey?4:1}))};return S.jsx("div",{className:Me(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:S.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:c,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:o,height:i}})})}const hm=typeof window<"u"?window:void 0,PC=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Wv({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:d,selectionMode:c,onSelectionStart:h,onSelectionEnd:g,multiSelectionKeyCode:y,panActivationKeyCode:v,zoomActivationKeyCode:w,elementsSelectable:f,zoomOnScroll:p,zoomOnPinch:m,panOnScroll:_,panOnScrollSpeed:x,panOnScrollMode:k,zoomOnDoubleClick:C,panOnDrag:I,defaultViewport:L,translateExtent:U,minZoom:T,maxZoom:O,preventScrolling:W,onSelectionContextMenu:N,noWheelClassName:F,noPanClassName:A,disableKeyboardA11y:H,onViewportChange:M,isControlledViewport:z}){const{nodesSelectionActive:b,userSelectionActive:E}=ce(PC,_e),j=Ui(u,{target:hm}),R=Ui(v,{target:hm}),$=R||I,P=R||_,V=d&&$!==!0,q=j||E||V;return aC({deleteKeyCode:l,multiSelectionKeyCode:y}),S.jsx(cC,{onPaneContextMenu:i,elementsSelectable:f,zoomOnScroll:p,zoomOnPinch:m,panOnScroll:P,panOnScrollSpeed:x,panOnScrollMode:k,zoomOnDoubleClick:C,panOnDrag:!j&&$,defaultViewport:L,translateExtent:U,minZoom:T,maxZoom:O,zoomActivationKeyCode:w,preventScrolling:W,noWheelClassName:F,noPanClassName:A,onViewportChange:M,isControlledViewport:z,paneClickDistance:a,selectionOnDrag:V,children:S.jsxs(pC,{onSelectionStart:h,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:$,isSelecting:!!q,selectionMode:c,selectionKeyPressed:j,paneClickDistance:a,selectionOnDrag:V,children:[e,b&&S.jsx(NC,{onSelectionContextMenu:N,noPanClassName:A,disableKeyboardA11y:H})]})})}Wv.displayName="FlowRenderer";const CC=D.memo(Wv),bC=e=>t=>e?Wd(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function jC(e){return ce(D.useCallback(bC(e),[e]),_e)}const MC=e=>e.updateNodeInternals;function TC(){const e=ce(MC),[t]=D.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(o=>{const i=o.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:o.target,force:!0})}),e(r)}));return D.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function IC({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=xe(),i=D.useRef(null),s=D.useRef(null),a=D.useRef(e.sourcePosition),l=D.useRef(e.targetPosition),u=D.useRef(t),d=n&&!!e.internals.handleBounds;return D.useEffect(()=>{i.current&&!e.hidden&&(!d||s.current!==i.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(i.current),s.current=i.current)},[d,e.hidden]),D.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),D.useEffect(()=>{if(i.current){const c=u.current!==t,h=a.current!==e.sourcePosition,g=l.current!==e.targetPosition;(c||h||g)&&(u.current=t,a.current=e.sourcePosition,l.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function zC({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:s,nodesDraggable:a,elementsSelectable:l,nodesConnectable:u,nodesFocusable:d,resizeObserver:c,noDragClassName:h,noPanClassName:g,disableKeyboardA11y:y,rfId:v,nodeTypes:w,nodeClickDistance:f,onError:p}){const{node:m,internals:_,isParent:x}=ce(B=>{const Y=B.nodeLookup.get(e),G=B.parentLookup.has(e);return{node:Y,internals:Y.internals,isParent:G}},_e);let k=m.type||"default",C=(w==null?void 0:w[k])||fm[k];C===void 0&&(p==null||p("003",Qt.error003(k)),k="default",C=(w==null?void 0:w.default)||fm.default);const I=!!(m.draggable||a&&typeof m.draggable>"u"),L=!!(m.selectable||l&&typeof m.selectable>"u"),U=!!(m.connectable||u&&typeof m.connectable>"u"),T=!!(m.focusable||d&&typeof m.focusable>"u"),O=xe(),W=cv(m),N=IC({node:m,nodeType:k,hasDimensions:W,resizeObserver:c}),F=Hv({nodeRef:N,disabled:m.hidden||!I,noDragClassName:h,handleSelector:m.dragHandle,nodeId:e,isSelectable:L,nodeClickDistance:f}),A=Uv();if(m.hidden)return null;const H=_n(m),M=EC(m),z=L||I||t||n||r||o,b=n?B=>n(B,{..._.userNode}):void 0,E=r?B=>r(B,{..._.userNode}):void 0,j=o?B=>o(B,{..._.userNode}):void 0,R=i?B=>i(B,{..._.userNode}):void 0,$=s?B=>s(B,{..._.userNode}):void 0,P=B=>{const{selectNodesOnDrag:Y,nodeDragThreshold:G}=O.getState();L&&(!Y||!I||G>0)&&Mc({id:e,store:O,nodeRef:N}),t&&t(B,{..._.userNode})},V=B=>{if(!(hv(B.nativeEvent)||y)){if(tv.includes(B.key)&&L){const Y=B.key==="Escape";Mc({id:e,store:O,unselect:Y,nodeRef:N})}else if(I&&m.selected&&Object.prototype.hasOwnProperty.call(Ha,B.key)){B.preventDefault();const{ariaLabelConfig:Y}=O.getState();O.setState({ariaLiveMessage:Y["node.a11yDescription.ariaLiveMessage"]({direction:B.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),A({direction:Ha[B.key],factor:B.shiftKey?4:1})}}},q=()=>{var ue;if(y||!((ue=N.current)!=null&&ue.matches(":focus-visible")))return;const{transform:B,width:Y,height:G,autoPanOnNodeFocus:Z,setCenter:te}=O.getState();if(!Z)return;Wd(new Map([[e,m]]),{x:0,y:0,width:Y,height:G},B,!0).length>0||te(m.position.x+H.width/2,m.position.y+H.height/2,{zoom:B[2]})};return S.jsx("div",{className:Me(["react-flow__node",`react-flow__node-${k}`,{[g]:I},m.className,{selected:m.selected,selectable:L,parent:x,draggable:I,dragging:F}]),ref:N,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:z?"all":"none",visibility:W?"visible":"hidden",...m.style,...M},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:b,onMouseMove:E,onMouseLeave:j,onContextMenu:R,onClick:P,onDoubleClick:$,onKeyDown:T?V:void 0,tabIndex:T?0:void 0,onFocus:T?q:void 0,role:m.ariaRole??(T?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${Av}-${v}`,"aria-label":m.ariaLabel,...m.domAttributes,children:S.jsx(gC,{value:e,children:S.jsx(C,{id:e,data:m.data,type:k,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:m.selected??!1,selectable:L,draggable:I,deletable:m.deletable??!0,isConnectable:U,sourcePosition:m.sourcePosition,targetPosition:m.targetPosition,dragging:F,dragHandle:m.dragHandle,zIndex:_.z,parentId:m.parentId,...H})})})}var RC=D.memo(zC);const AC=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function qv(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,onError:i}=ce(AC,_e),s=jC(e.onlyRenderVisibleElements),a=TC();return S.jsx("div",{className:"react-flow__nodes",style:xl,children:s.map(l=>S.jsx(RC,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}qv.displayName="NodeRenderer";const OC=D.memo(qv);function DC(e){return ce(D.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const r=[];if(n.width&&n.height)for(const o of n.edges){const i=n.nodeLookup.get(o.source),s=n.nodeLookup.get(o.target);i&&s&&$N({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),_e)}const LC=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return S.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},VC=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return S.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},pm={[La.Arrow]:LC,[La.ArrowClosed]:VC};function FC(e){const t=xe();return D.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(pm,e)?pm[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Qt.error009(e)),null)},[e])}const HC=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=FC(t);return l?S.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:S.jsx(l,{color:n,strokeWidth:s})}):null},Kv=({defaultColor:e,rfId:t})=>{const n=ce(i=>i.edges),r=ce(i=>i.defaultEdgeOptions),o=D.useMemo(()=>bN(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return o.length?S.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:S.jsx("defs",{children:o.map(i=>S.jsx(HC,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};Kv.displayName="MarkerDefinitions";var UC=D.memo(Kv);function Yv({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:u,...d}){const[c,h]=D.useState({x:1,y:0,width:0,height:0}),g=Me(["react-flow__edge-textwrapper",u]),y=D.useRef(null);return D.useEffect(()=>{if(y.current){const v=y.current.getBBox();h({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?S.jsxs("g",{transform:`translate(${e-c.width/2} ${t-c.height/2})`,className:g,visibility:c.width?"visible":"hidden",...d,children:[o&&S.jsx("rect",{width:c.width+2*s[0],x:-s[0],y:-s[1],height:c.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),S.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:y,style:r,children:n}),l]}):null}Yv.displayName="EdgeText";const BC=D.memo(Yv);function Co({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:u=20,...d}){return S.jsxs(S.Fragment,{children:[S.jsx("path",{...d,d:e,fill:"none",className:Me(["react-flow__edge-path",d.className])}),u?S.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&At(t)&&At(n)?S.jsx(BC,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function mm({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===ee.Left||e===ee.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Xv({sourceX:e,sourceY:t,sourcePosition:n=ee.Bottom,targetX:r,targetY:o,targetPosition:i=ee.Top}){const[s,a]=mm({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,u]=mm({pos:i,x1:r,y1:o,x2:e,y2:t}),[d,c,h,g]=mv({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${a} ${l},${u} ${r},${o}`,d,c,h,g]}function Gv(e){return D.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s,targetPosition:a,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:w,interactionWidth:f})=>{const[p,m,_]=Xv({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:a}),x=e.isInternal?void 0:t;return S.jsx(Co,{id:x,path:p,labelX:m,labelY:_,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:w,interactionWidth:f})})}const WC=Gv({isInternal:!1}),Qv=Gv({isInternal:!0});WC.displayName="SimpleBezierEdge";Qv.displayName="SimpleBezierEdgeInternal";function Zv(e){return D.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:h,sourcePosition:g=ee.Bottom,targetPosition:y=ee.Top,markerEnd:v,markerStart:w,pathOptions:f,interactionWidth:p})=>{const[m,_,x]=Nc({sourceX:n,sourceY:r,sourcePosition:g,targetX:o,targetY:i,targetPosition:y,borderRadius:f==null?void 0:f.borderRadius,offset:f==null?void 0:f.offset,stepPosition:f==null?void 0:f.stepPosition}),k=e.isInternal?void 0:t;return S.jsx(Co,{id:k,path:m,labelX:_,labelY:x,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:h,markerEnd:v,markerStart:w,interactionWidth:p})})}const Jv=Zv({isInternal:!1}),e1=Zv({isInternal:!0});Jv.displayName="SmoothStepEdge";e1.displayName="SmoothStepEdgeInternal";function t1(e){return D.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return S.jsx(Jv,{...n,id:r,pathOptions:D.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const qC=t1({isInternal:!1}),n1=t1({isInternal:!0});qC.displayName="StepEdge";n1.displayName="StepEdgeInternal";function r1(e){return D.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:h,markerEnd:g,markerStart:y,interactionWidth:v})=>{const[w,f,p]=vv({sourceX:n,sourceY:r,targetX:o,targetY:i}),m=e.isInternal?void 0:t;return S.jsx(Co,{id:m,path:w,labelX:f,labelY:p,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:h,markerEnd:g,markerStart:y,interactionWidth:v})})}const KC=r1({isInternal:!1}),o1=r1({isInternal:!0});KC.displayName="StraightEdge";o1.displayName="StraightEdgeInternal";function i1(e){return D.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s=ee.Bottom,targetPosition:a=ee.Top,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:w,pathOptions:f,interactionWidth:p})=>{const[m,_,x]=gv({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:a,curvature:f==null?void 0:f.curvature}),k=e.isInternal?void 0:t;return S.jsx(Co,{id:k,path:m,labelX:_,labelY:x,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:w,interactionWidth:p})})}const YC=i1({isInternal:!1}),s1=i1({isInternal:!0});YC.displayName="BezierEdge";s1.displayName="BezierEdgeInternal";const gm={default:s1,straight:o1,step:n1,smoothstep:e1,simplebezier:Qv},ym={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},XC=(e,t,n)=>n===ee.Left?e-t:n===ee.Right?e+t:e,GC=(e,t,n)=>n===ee.Top?e-t:n===ee.Bottom?e+t:e,vm="react-flow__edgeupdater";function wm({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:a}){return S.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:Me([vm,`${vm}-${a}`]),cx:XC(t,r,e),cy:GC(n,r,e),r,stroke:"transparent",fill:"transparent"})}function QC({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:s,sourcePosition:a,targetPosition:l,onReconnect:u,onReconnectStart:d,onReconnectEnd:c,setReconnecting:h,setUpdateHover:g}){const y=xe(),v=(_,x)=>{if(_.button!==0)return;const{autoPanOnConnect:k,domNode:C,connectionMode:I,connectionRadius:L,lib:U,onConnectStart:T,cancelConnection:O,nodeLookup:W,rfId:N,panBy:F,updateConnection:A}=y.getState(),H=x.type==="target",M=(E,j)=>{h(!1),c==null||c(E,n,x.type,j)},z=E=>u==null?void 0:u(n,E),b=(E,j)=>{h(!0),d==null||d(_,n,x.type),T==null||T(E,j)};bc.onPointerDown(_.nativeEvent,{autoPanOnConnect:k,connectionMode:I,connectionRadius:L,domNode:C,handleId:x.id,nodeId:x.nodeId,nodeLookup:W,isTarget:H,edgeUpdaterType:x.type,lib:U,flowId:N,cancelConnection:O,panBy:F,isValidConnection:(...E)=>{var j,R;return((R=(j=y.getState()).isValidConnection)==null?void 0:R.call(j,...E))??!0},onConnect:z,onConnectStart:b,onConnectEnd:(...E)=>{var j,R;return(R=(j=y.getState()).onConnectEnd)==null?void 0:R.call(j,...E)},onReconnectEnd:M,updateConnection:A,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},w=_=>v(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),f=_=>v(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),p=()=>g(!0),m=()=>g(!1);return S.jsxs(S.Fragment,{children:[(e===!0||e==="source")&&S.jsx(wm,{position:a,centerX:r,centerY:o,radius:t,onMouseDown:w,onMouseEnter:p,onMouseOut:m,type:"source"}),(e===!0||e==="target")&&S.jsx(wm,{position:l,centerX:i,centerY:s,radius:t,onMouseDown:f,onMouseEnter:p,onMouseOut:m,type:"target"})]})}function ZC({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:u,reconnectRadius:d,onReconnect:c,onReconnectStart:h,onReconnectEnd:g,rfId:y,edgeTypes:v,noPanClassName:w,onError:f,disableKeyboardA11y:p}){let m=ce(te=>te.edgeLookup.get(e));const _=ce(te=>te.defaultEdgeOptions);m=_?{..._,...m}:m;let x=m.type||"default",k=(v==null?void 0:v[x])||gm[x];k===void 0&&(f==null||f("011",Qt.error011(x)),x="default",k=(v==null?void 0:v.default)||gm.default);const C=!!(m.focusable||t&&typeof m.focusable>"u"),I=typeof c<"u"&&(m.reconnectable||n&&typeof m.reconnectable>"u"),L=!!(m.selectable||r&&typeof m.selectable>"u"),U=D.useRef(null),[T,O]=D.useState(!1),[W,N]=D.useState(!1),F=xe(),{zIndex:A,sourceX:H,sourceY:M,targetX:z,targetY:b,sourcePosition:E,targetPosition:j}=ce(D.useCallback(te=>{const ne=te.nodeLookup.get(m.source),ue=te.nodeLookup.get(m.target);if(!ne||!ue)return{zIndex:m.zIndex,...ym};const fe=CN({id:e,sourceNode:ne,targetNode:ue,sourceHandle:m.sourceHandle||null,targetHandle:m.targetHandle||null,connectionMode:te.connectionMode,onError:f});return{zIndex:_N({selected:m.selected,zIndex:m.zIndex,sourceNode:ne,targetNode:ue,elevateOnSelect:te.elevateEdgesOnSelect,zIndexMode:te.zIndexMode}),...fe||ym}},[m.source,m.target,m.sourceHandle,m.targetHandle,m.selected,m.zIndex]),_e),R=D.useMemo(()=>m.markerStart?`url('#${Pc(m.markerStart,y)}')`:void 0,[m.markerStart,y]),$=D.useMemo(()=>m.markerEnd?`url('#${Pc(m.markerEnd,y)}')`:void 0,[m.markerEnd,y]);if(m.hidden||H===null||M===null||z===null||b===null)return null;const P=te=>{var le;const{addSelectedEdges:ne,unselectNodesAndEdges:ue,multiSelectionActive:fe}=F.getState();L&&(F.setState({nodesSelectionActive:!1}),m.selected&&fe?(ue({nodes:[],edges:[m]}),(le=U.current)==null||le.blur()):ne([e])),o&&o(te,m)},V=i?te=>{i(te,{...m})}:void 0,q=s?te=>{s(te,{...m})}:void 0,B=a?te=>{a(te,{...m})}:void 0,Y=l?te=>{l(te,{...m})}:void 0,G=u?te=>{u(te,{...m})}:void 0,Z=te=>{var ne;if(!p&&tv.includes(te.key)&&L){const{unselectNodesAndEdges:ue,addSelectedEdges:fe}=F.getState();te.key==="Escape"?((ne=U.current)==null||ne.blur(),ue({edges:[m]})):fe([e])}};return S.jsx("svg",{style:{zIndex:A},children:S.jsxs("g",{className:Me(["react-flow__edge",`react-flow__edge-${x}`,m.className,w,{selected:m.selected,animated:m.animated,inactive:!L&&!o,updating:T,selectable:L}]),onClick:P,onDoubleClick:V,onContextMenu:q,onMouseEnter:B,onMouseMove:Y,onMouseLeave:G,onKeyDown:C?Z:void 0,tabIndex:C?0:void 0,role:m.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":m.ariaLabel===null?void 0:m.ariaLabel||`Edge from ${m.source} to ${m.target}`,"aria-describedby":C?`${Ov}-${y}`:void 0,ref:U,...m.domAttributes,children:[!W&&S.jsx(k,{id:e,source:m.source,target:m.target,type:m.type,selected:m.selected,animated:m.animated,selectable:L,deletable:m.deletable??!0,label:m.label,labelStyle:m.labelStyle,labelShowBg:m.labelShowBg,labelBgStyle:m.labelBgStyle,labelBgPadding:m.labelBgPadding,labelBgBorderRadius:m.labelBgBorderRadius,sourceX:H,sourceY:M,targetX:z,targetY:b,sourcePosition:E,targetPosition:j,data:m.data,style:m.style,sourceHandleId:m.sourceHandle,targetHandleId:m.targetHandle,markerStart:R,markerEnd:$,pathOptions:"pathOptions"in m?m.pathOptions:void 0,interactionWidth:m.interactionWidth}),I&&S.jsx(QC,{edge:m,isReconnectable:I,reconnectRadius:d,onReconnect:c,onReconnectStart:h,onReconnectEnd:g,sourceX:H,sourceY:M,targetX:z,targetY:b,sourcePosition:E,targetPosition:j,setUpdateHover:O,setReconnecting:N})]})})}var JC=D.memo(ZC);const eb=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function a1({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:c,onEdgeDoubleClick:h,onReconnectStart:g,onReconnectEnd:y,disableKeyboardA11y:v}){const{edgesFocusable:w,edgesReconnectable:f,elementsSelectable:p,onError:m}=ce(eb,_e),_=DC(t);return S.jsxs("div",{className:"react-flow__edges",children:[S.jsx(UC,{defaultColor:e,rfId:n}),_.map(x=>S.jsx(JC,{id:x,edgesFocusable:w,edgesReconnectable:f,elementsSelectable:p,noPanClassName:o,onReconnect:i,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:u,onClick:d,reconnectRadius:c,onDoubleClick:h,onReconnectStart:g,onReconnectEnd:y,rfId:n,onError:m,edgeTypes:r,disableKeyboardA11y:v},x))]})}a1.displayName="EdgeRenderer";const tb=D.memo(a1),nb=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function rb({children:e}){const t=ce(nb);return S.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function ob(e){const t=Jd(),n=D.useRef(!1);D.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const ib=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function sb(e){const t=ce(ib),n=xe();return D.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function ab(e){return e.connection.inProgress?{...e.connection,to:ns(e.connection.to,e.transform)}:{...e.connection}}function lb(e){return ab}function ub(e){const t=lb();return ce(t,_e)}const cb=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function db({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:i,height:s,isValid:a,inProgress:l}=ce(cb,_e);return!(i&&o&&l)?null:S.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:S.jsx("g",{className:Me(["react-flow__connection",ov(a)]),children:S.jsx(l1,{style:t,type:n,CustomComponent:r,isValid:a})})})}const l1=({style:e,type:t=Tn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:i,fromNode:s,fromHandle:a,fromPosition:l,to:u,toNode:d,toHandle:c,toPosition:h,pointer:g}=ub();if(!o)return;if(n)return S.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:h,connectionStatus:ov(r),toNode:d,toHandle:c,pointer:g});let y="";const v={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case Tn.Bezier:[y]=gv(v);break;case Tn.SimpleBezier:[y]=Xv(v);break;case Tn.Step:[y]=Nc({...v,borderRadius:0});break;case Tn.SmoothStep:[y]=Nc(v);break;default:[y]=vv(v)}return S.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};l1.displayName="ConnectionLine";const fb={};function _m(e=fb){D.useRef(e),xe(),D.useEffect(()=>{},[e])}function hb(){xe(),D.useRef(!1),D.useEffect(()=>{},[])}function u1({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:c,onSelectionStart:h,onSelectionEnd:g,connectionLineType:y,connectionLineStyle:v,connectionLineComponent:w,connectionLineContainerStyle:f,selectionKeyCode:p,selectionOnDrag:m,selectionMode:_,multiSelectionKeyCode:x,panActivationKeyCode:k,zoomActivationKeyCode:C,deleteKeyCode:I,onlyRenderVisibleElements:L,elementsSelectable:U,defaultViewport:T,translateExtent:O,minZoom:W,maxZoom:N,preventScrolling:F,defaultMarkerColor:A,zoomOnScroll:H,zoomOnPinch:M,panOnScroll:z,panOnScrollSpeed:b,panOnScrollMode:E,zoomOnDoubleClick:j,panOnDrag:R,onPaneClick:$,onPaneMouseEnter:P,onPaneMouseMove:V,onPaneMouseLeave:q,onPaneScroll:B,onPaneContextMenu:Y,paneClickDistance:G,nodeClickDistance:Z,onEdgeContextMenu:te,onEdgeMouseEnter:ne,onEdgeMouseMove:ue,onEdgeMouseLeave:fe,reconnectRadius:le,onReconnect:be,onReconnectStart:gt,onReconnectEnd:st,noDragClassName:Nt,noWheelClassName:Jt,noPanClassName:en,disableKeyboardA11y:tn,nodeExtent:Zn,rfId:$n,viewport:yt,onViewportChange:nn}){return _m(e),_m(t),hb(),ob(n),sb(yt),S.jsx(CC,{onPaneClick:$,onPaneMouseEnter:P,onPaneMouseMove:V,onPaneMouseLeave:q,onPaneContextMenu:Y,onPaneScroll:B,paneClickDistance:G,deleteKeyCode:I,selectionKeyCode:p,selectionOnDrag:m,selectionMode:_,onSelectionStart:h,onSelectionEnd:g,multiSelectionKeyCode:x,panActivationKeyCode:k,zoomActivationKeyCode:C,elementsSelectable:U,zoomOnScroll:H,zoomOnPinch:M,zoomOnDoubleClick:j,panOnScroll:z,panOnScrollSpeed:b,panOnScrollMode:E,panOnDrag:R,defaultViewport:T,translateExtent:O,minZoom:W,maxZoom:N,onSelectionContextMenu:c,preventScrolling:F,noDragClassName:Nt,noWheelClassName:Jt,noPanClassName:en,disableKeyboardA11y:tn,onViewportChange:nn,isControlledViewport:!!yt,children:S.jsxs(rb,{children:[S.jsx(tb,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:s,onReconnect:be,onReconnectStart:gt,onReconnectEnd:st,onlyRenderVisibleElements:L,onEdgeContextMenu:te,onEdgeMouseEnter:ne,onEdgeMouseMove:ue,onEdgeMouseLeave:fe,reconnectRadius:le,defaultMarkerColor:A,noPanClassName:en,disableKeyboardA11y:tn,rfId:$n}),S.jsx(db,{style:v,type:y,component:w,containerStyle:f}),S.jsx("div",{className:"react-flow__edgelabel-renderer"}),S.jsx(OC,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:Z,onlyRenderVisibleElements:L,noPanClassName:en,noDragClassName:Nt,disableKeyboardA11y:tn,nodeExtent:Zn,rfId:$n}),S.jsx("div",{className:"react-flow__viewport-portal"})]})})}u1.displayName="GraphView";const pb=D.memo(u1),$m=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:a,minZoom:l=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:c,zIndexMode:h="basic"}={})=>{const g=new Map,y=new Map,v=new Map,w=new Map,f=r??t??[],p=n??e??[],m=d??[0,0],_=c??Li;$v(v,w,f);const{nodesInitialized:x}=Cc(p,g,y,{nodeOrigin:m,nodeExtent:_,zIndexMode:h});let k=[0,0,1];if(s&&o&&i){const C=es(g,{filter:T=>!!((T.width||T.initialWidth)&&(T.height||T.initialHeight))}),{x:I,y:L,zoom:U}=qd(C,o,i,l,u,(a==null?void 0:a.padding)??.1);k=[I,L,U]}return{rfId:"1",width:o??0,height:i??0,transform:k,nodes:p,nodesInitialized:x,nodeLookup:g,parentLookup:y,edges:f,edgeLookup:w,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Li,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:yo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:m,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...rv},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:pN,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:nv,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},mb=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:c,zIndexMode:h})=>TP((g,y)=>{async function v(){const{nodeLookup:w,panZoom:f,fitViewOptions:p,fitViewResolver:m,width:_,height:x,minZoom:k,maxZoom:C}=y();f&&(await fN({nodes:w,width:_,height:x,panZoom:f,minZoom:k,maxZoom:C},p),m==null||m.resolve(!0),g({fitViewResolver:null}))}return{...$m({nodes:e,edges:t,width:o,height:i,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:c,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:w=>{const{nodeLookup:f,parentLookup:p,nodeOrigin:m,elevateNodesOnSelect:_,fitViewQueued:x,zIndexMode:k,nodesSelectionActive:C}=y(),{nodesInitialized:I,hasSelectedNodes:L}=Cc(w,f,p,{nodeOrigin:m,nodeExtent:c,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:k}),U=C&&L;x&&I?(v(),g({nodes:w,nodesInitialized:I,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:U})):g({nodes:w,nodesInitialized:I,nodesSelectionActive:U})},setEdges:w=>{const{connectionLookup:f,edgeLookup:p}=y();$v(f,p,w),g({edges:w})},setDefaultNodesAndEdges:(w,f)=>{if(w){const{setNodes:p}=y();p(w),g({hasDefaultNodes:!0})}if(f){const{setEdges:p}=y();p(f),g({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:f,nodeLookup:p,parentLookup:m,domNode:_,nodeOrigin:x,nodeExtent:k,debug:C,fitViewQueued:I,zIndexMode:L}=y(),{changes:U,updatedInternals:T}=AN(w,p,m,_,x,k,L);T&&(TN(p,m,{nodeOrigin:x,nodeExtent:k,zIndexMode:L}),I?(v(),g({fitViewQueued:!1,fitViewOptions:void 0})):g({}),(U==null?void 0:U.length)>0&&(C&&console.log("React Flow: trigger node changes",U),f==null||f(U)))},updateNodePositions:(w,f=!1)=>{const p=[];let m=[];const{nodeLookup:_,triggerNodeChanges:x,connection:k,updateConnection:C,onNodesChangeMiddlewareMap:I}=y();for(const[L,U]of w){const T=_.get(L),O=!!(T!=null&&T.expandParent&&(T!=null&&T.parentId)&&(U!=null&&U.position)),W={id:L,type:"position",position:O?{x:Math.max(0,U.position.x),y:Math.max(0,U.position.y)}:U.position,dragging:f};if(T&&k.inProgress&&k.fromNode.id===T.id){const N=Er(T,k.fromHandle,ee.Left,!0);C({...k,from:N})}O&&T.parentId&&p.push({id:L,parentId:T.parentId,rect:{...U.internals.positionAbsolute,width:U.measured.width??0,height:U.measured.height??0}}),m.push(W)}if(p.length>0){const{parentLookup:L,nodeOrigin:U}=y(),T=Zd(p,_,L,U);m.push(...T)}for(const L of I.values())m=L(m);x(m)},triggerNodeChanges:w=>{const{onNodesChange:f,setNodes:p,nodes:m,hasDefaultNodes:_,debug:x}=y();if(w!=null&&w.length){if(_){const k=JP(w,m);p(k)}x&&console.log("React Flow: trigger node changes",w),f==null||f(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:f,setEdges:p,edges:m,hasDefaultEdges:_,debug:x}=y();if(w!=null&&w.length){if(_){const k=eC(w,m);p(k)}x&&console.log("React Flow: trigger edge changes",w),f==null||f(w)}},addSelectedNodes:w=>{const{multiSelectionActive:f,edgeLookup:p,nodeLookup:m,triggerNodeChanges:_,triggerEdgeChanges:x}=y();if(f){const k=w.map(C=>nr(C,!0));_(k);return}_(Xr(m,new Set([...w]),!0)),x(Xr(p))},addSelectedEdges:w=>{const{multiSelectionActive:f,edgeLookup:p,nodeLookup:m,triggerNodeChanges:_,triggerEdgeChanges:x}=y();if(f){const k=w.map(C=>nr(C,!0));x(k);return}x(Xr(p,new Set([...w]))),_(Xr(m,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:f}={})=>{const{edges:p,nodes:m,nodeLookup:_,triggerNodeChanges:x,triggerEdgeChanges:k}=y(),C=w||m,I=f||p,L=[];for(const T of C){if(!T.selected)continue;const O=_.get(T.id);O&&(O.selected=!1),L.push(nr(T.id,!1))}const U=[];for(const T of I)T.selected&&U.push(nr(T.id,!1));x(L),k(U)},setMinZoom:w=>{const{panZoom:f,maxZoom:p}=y();f==null||f.setScaleExtent([w,p]),g({minZoom:w})},setMaxZoom:w=>{const{panZoom:f,minZoom:p}=y();f==null||f.setScaleExtent([p,w]),g({maxZoom:w})},setTranslateExtent:w=>{var f;(f=y().panZoom)==null||f.setTranslateExtent(w),g({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:f,triggerNodeChanges:p,triggerEdgeChanges:m,elementsSelectable:_}=y();if(!_)return;const x=f.reduce((C,I)=>I.selected?[...C,nr(I.id,!1)]:C,[]),k=w.reduce((C,I)=>I.selected?[...C,nr(I.id,!1)]:C,[]);p(x),m(k)},setNodeExtent:w=>{const{nodes:f,nodeLookup:p,parentLookup:m,nodeOrigin:_,elevateNodesOnSelect:x,nodeExtent:k,zIndexMode:C}=y();w[0][0]===k[0][0]&&w[0][1]===k[0][1]&&w[1][0]===k[1][0]&&w[1][1]===k[1][1]||(Cc(f,p,m,{nodeOrigin:_,nodeExtent:w,elevateNodesOnSelect:x,checkEquality:!1,zIndexMode:C}),g({nodeExtent:w}))},panBy:w=>{const{transform:f,width:p,height:m,panZoom:_,translateExtent:x}=y();return ON({delta:w,panZoom:_,transform:f,translateExtent:x,width:p,height:m})},setCenter:async(w,f,p)=>{const{width:m,height:_,maxZoom:x,panZoom:k}=y();if(!k)return Promise.resolve(!1);const C=typeof(p==null?void 0:p.zoom)<"u"?p.zoom:x;return await k.setViewport({x:m/2-w*C,y:_/2-f*C,zoom:C},{duration:p==null?void 0:p.duration,ease:p==null?void 0:p.ease,interpolate:p==null?void 0:p.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{g({connection:{...rv}})},updateConnection:w=>{g({connection:w})},reset:()=>g({...$m()})}},Object.is);function gb({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:l,fitView:u,nodeOrigin:d,nodeExtent:c,zIndexMode:h,children:g}){const[y]=D.useState(()=>mb({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:u,minZoom:s,maxZoom:a,fitViewOptions:l,nodeOrigin:d,nodeExtent:c,zIndexMode:h}));return S.jsx(IP,{value:y,children:S.jsx(rC,{children:g})})}function yb({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:s,fitView:a,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:c,nodeExtent:h,zIndexMode:g}){return D.useContext(_l)?S.jsx(S.Fragment,{children:e}):S.jsx(gb,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:s,fitView:a,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:c,nodeExtent:h,zIndexMode:g,children:e})}const vb={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function wb({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:s,onNodeClick:a,onEdgeClick:l,onInit:u,onMove:d,onMoveStart:c,onMoveEnd:h,onConnect:g,onConnectStart:y,onConnectEnd:v,onClickConnectStart:w,onClickConnectEnd:f,onNodeMouseEnter:p,onNodeMouseMove:m,onNodeMouseLeave:_,onNodeContextMenu:x,onNodeDoubleClick:k,onNodeDragStart:C,onNodeDrag:I,onNodeDragStop:L,onNodesDelete:U,onEdgesDelete:T,onDelete:O,onSelectionChange:W,onSelectionDragStart:N,onSelectionDrag:F,onSelectionDragStop:A,onSelectionContextMenu:H,onSelectionStart:M,onSelectionEnd:z,onBeforeDelete:b,connectionMode:E,connectionLineType:j=Tn.Bezier,connectionLineStyle:R,connectionLineComponent:$,connectionLineContainerStyle:P,deleteKeyCode:V="Backspace",selectionKeyCode:q="Shift",selectionOnDrag:B=!1,selectionMode:Y=Vi.Full,panActivationKeyCode:G="Space",multiSelectionKeyCode:Z=Hi()?"Meta":"Control",zoomActivationKeyCode:te=Hi()?"Meta":"Control",snapToGrid:ne,snapGrid:ue,onlyRenderVisibleElements:fe=!1,selectNodesOnDrag:le,nodesDraggable:be,autoPanOnNodeFocus:gt,nodesConnectable:st,nodesFocusable:Nt,nodeOrigin:Jt=Dv,edgesFocusable:en,edgesReconnectable:tn,elementsSelectable:Zn=!0,defaultViewport:$n=qP,minZoom:yt=.5,maxZoom:nn=2,translateExtent:zo=Li,preventScrolling:is=!0,nodeExtent:Ro,defaultMarkerColor:xw="#b1b1b7",zoomOnScroll:Sw=!0,zoomOnPinch:Ew=!0,panOnScroll:kw=!1,panOnScrollSpeed:Nw=.5,panOnScrollMode:Pw=mr.Free,zoomOnDoubleClick:Cw=!0,panOnDrag:bw=!0,onPaneClick:jw,onPaneMouseEnter:Mw,onPaneMouseMove:Tw,onPaneMouseLeave:Iw,onPaneScroll:zw,onPaneContextMenu:Rw,paneClickDistance:Aw=1,nodeClickDistance:Ow=0,children:Dw,onReconnect:Lw,onReconnectStart:Vw,onReconnectEnd:Fw,onEdgeContextMenu:Hw,onEdgeDoubleClick:Uw,onEdgeMouseEnter:Bw,onEdgeMouseMove:Ww,onEdgeMouseLeave:qw,reconnectRadius:Kw=10,onNodesChange:Yw,onEdgesChange:Xw,noDragClassName:Gw="nodrag",noWheelClassName:Qw="nowheel",noPanClassName:nh="nopan",fitView:rh,fitViewOptions:oh,connectOnClick:Zw,attributionPosition:Jw,proOptions:e_,defaultEdgeOptions:t_,elevateNodesOnSelect:n_=!0,elevateEdgesOnSelect:r_=!1,disableKeyboardA11y:ih=!1,autoPanOnConnect:o_,autoPanOnNodeDrag:i_,autoPanSpeed:s_,connectionRadius:a_,isValidConnection:l_,onError:u_,style:c_,id:sh,nodeDragThreshold:d_,connectionDragThreshold:f_,viewport:h_,onViewportChange:p_,width:m_,height:g_,colorMode:y_="light",debug:v_,onScroll:ss,ariaLabelConfig:w_,zIndexMode:ah="basic",...__},$_){const Rl=sh||"1",x_=GP(y_),S_=D.useCallback(lh=>{lh.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ss==null||ss(lh)},[ss]);return S.jsx("div",{"data-testid":"rf__wrapper",...__,onScroll:S_,style:{...c_,...vb},ref:$_,className:Me(["react-flow",o,x_]),id:sh,role:"application",children:S.jsxs(yb,{nodes:e,edges:t,width:m_,height:g_,fitView:rh,fitViewOptions:oh,minZoom:yt,maxZoom:nn,nodeOrigin:Jt,nodeExtent:Ro,zIndexMode:ah,children:[S.jsx(XP,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:y,onConnectEnd:v,onClickConnectStart:w,onClickConnectEnd:f,nodesDraggable:be,autoPanOnNodeFocus:gt,nodesConnectable:st,nodesFocusable:Nt,edgesFocusable:en,edgesReconnectable:tn,elementsSelectable:Zn,elevateNodesOnSelect:n_,elevateEdgesOnSelect:r_,minZoom:yt,maxZoom:nn,nodeExtent:Ro,onNodesChange:Yw,onEdgesChange:Xw,snapToGrid:ne,snapGrid:ue,connectionMode:E,translateExtent:zo,connectOnClick:Zw,defaultEdgeOptions:t_,fitView:rh,fitViewOptions:oh,onNodesDelete:U,onEdgesDelete:T,onDelete:O,onNodeDragStart:C,onNodeDrag:I,onNodeDragStop:L,onSelectionDrag:F,onSelectionDragStart:N,onSelectionDragStop:A,onMove:d,onMoveStart:c,onMoveEnd:h,noPanClassName:nh,nodeOrigin:Jt,rfId:Rl,autoPanOnConnect:o_,autoPanOnNodeDrag:i_,autoPanSpeed:s_,onError:u_,connectionRadius:a_,isValidConnection:l_,selectNodesOnDrag:le,nodeDragThreshold:d_,connectionDragThreshold:f_,onBeforeDelete:b,debug:v_,ariaLabelConfig:w_,zIndexMode:ah}),S.jsx(pb,{onInit:u,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:p,onNodeMouseMove:m,onNodeMouseLeave:_,onNodeContextMenu:x,onNodeDoubleClick:k,nodeTypes:i,edgeTypes:s,connectionLineType:j,connectionLineStyle:R,connectionLineComponent:$,connectionLineContainerStyle:P,selectionKeyCode:q,selectionOnDrag:B,selectionMode:Y,deleteKeyCode:V,multiSelectionKeyCode:Z,panActivationKeyCode:G,zoomActivationKeyCode:te,onlyRenderVisibleElements:fe,defaultViewport:$n,translateExtent:zo,minZoom:yt,maxZoom:nn,preventScrolling:is,zoomOnScroll:Sw,zoomOnPinch:Ew,zoomOnDoubleClick:Cw,panOnScroll:kw,panOnScrollSpeed:Nw,panOnScrollMode:Pw,panOnDrag:bw,onPaneClick:jw,onPaneMouseEnter:Mw,onPaneMouseMove:Tw,onPaneMouseLeave:Iw,onPaneScroll:zw,onPaneContextMenu:Rw,paneClickDistance:Aw,nodeClickDistance:Ow,onSelectionContextMenu:H,onSelectionStart:M,onSelectionEnd:z,onReconnect:Lw,onReconnectStart:Vw,onReconnectEnd:Fw,onEdgeContextMenu:Hw,onEdgeDoubleClick:Uw,onEdgeMouseEnter:Bw,onEdgeMouseMove:Ww,onEdgeMouseLeave:qw,reconnectRadius:Kw,defaultMarkerColor:xw,noDragClassName:Gw,noWheelClassName:Qw,noPanClassName:nh,rfId:Rl,disableKeyboardA11y:ih,nodeExtent:Ro,viewport:h_,onViewportChange:p_}),S.jsx(WP,{onSelectionChange:W}),Dw,S.jsx(VP,{proOptions:e_,position:Jw}),S.jsx(LP,{rfId:Rl,disableKeyboardA11y:ih})]})})}var _b=Vv(wb);const $b=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function c1({children:e}){const t=ce($b);return t?wy.createPortal(e,t):null}function xb({dimensions:e,lineWidth:t,variant:n,className:r}){return S.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Me(["react-flow__background-pattern",n,r])})}function Sb({radius:e,className:t}){return S.jsx("circle",{cx:e,cy:e,r:e,className:Me(["react-flow__background-pattern","dots",t])})}var Wn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Wn||(Wn={}));const Eb={[Wn.Dots]:1,[Wn.Lines]:1,[Wn.Cross]:6},kb=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function d1({id:e,variant:t=Wn.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:s,bgColor:a,style:l,className:u,patternClassName:d}){const c=D.useRef(null),{transform:h,patternId:g}=ce(kb,_e),y=r||Eb[t],v=t===Wn.Dots,w=t===Wn.Cross,f=Array.isArray(n)?n:[n,n],p=[f[0]*h[2]||1,f[1]*h[2]||1],m=y*h[2],_=Array.isArray(i)?i:[i,i],x=w?[m,m]:p,k=[_[0]*h[2]||1+x[0]/2,_[1]*h[2]||1+x[1]/2],C=`${g}${e||""}`;return S.jsxs("svg",{className:Me(["react-flow__background",u]),style:{...l,...xl,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:c,"data-testid":"rf__background",children:[S.jsx("pattern",{id:C,x:h[0]%p[0],y:h[1]%p[1],width:p[0],height:p[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:v?S.jsx(Sb,{radius:m/2,className:d}):S.jsx(xb,{dimensions:x,lineWidth:o,variant:t,className:d})}),S.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}d1.displayName="Background";const Nb=D.memo(d1);function Pb(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:S.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Cb(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:S.jsx("path",{d:"M0 0h32v4.2H0z"})})}function bb(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:S.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 jb(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:S.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 Mb(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:S.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 Ts({children:e,className:t,...n}){return S.jsx("button",{type:"button",className:Me(["react-flow__controls-button",t]),...n,children:e})}const Tb=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function f1({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:u,children:d,position:c="bottom-left",orientation:h="vertical","aria-label":g}){const y=xe(),{isInteractive:v,minZoomReached:w,maxZoomReached:f,ariaLabelConfig:p}=ce(Tb,_e),{zoomIn:m,zoomOut:_,fitView:x}=Jd(),k=()=>{m(),i==null||i()},C=()=>{_(),s==null||s()},I=()=>{x(o),a==null||a()},L=()=>{y.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),l==null||l(!v)},U=h==="horizontal"?"horizontal":"vertical";return S.jsxs($l,{className:Me(["react-flow__controls",U,u]),position:c,style:e,"data-testid":"rf__controls","aria-label":g??p["controls.ariaLabel"],children:[t&&S.jsxs(S.Fragment,{children:[S.jsx(Ts,{onClick:k,className:"react-flow__controls-zoomin",title:p["controls.zoomIn.ariaLabel"],"aria-label":p["controls.zoomIn.ariaLabel"],disabled:f,children:S.jsx(Pb,{})}),S.jsx(Ts,{onClick:C,className:"react-flow__controls-zoomout",title:p["controls.zoomOut.ariaLabel"],"aria-label":p["controls.zoomOut.ariaLabel"],disabled:w,children:S.jsx(Cb,{})})]}),n&&S.jsx(Ts,{className:"react-flow__controls-fitview",onClick:I,title:p["controls.fitView.ariaLabel"],"aria-label":p["controls.fitView.ariaLabel"],children:S.jsx(bb,{})}),r&&S.jsx(Ts,{className:"react-flow__controls-interactive",onClick:L,title:p["controls.interactive.ariaLabel"],"aria-label":p["controls.interactive.ariaLabel"],children:v?S.jsx(Mb,{}):S.jsx(jb,{})}),d]})}f1.displayName="Controls";const Ib=D.memo(f1);function zb({id:e,x:t,y:n,width:r,height:o,style:i,color:s,strokeColor:a,strokeWidth:l,className:u,borderRadius:d,shapeRendering:c,selected:h,onClick:g}){const{background:y,backgroundColor:v}=i||{},w=s||y||v;return S.jsx("rect",{className:Me(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:o,style:{fill:w,stroke:a,strokeWidth:l},shapeRendering:c,onClick:g?f=>g(f,e):void 0})}const Rb=D.memo(zb),Ab=e=>e.nodes.map(t=>t.id),yu=e=>e instanceof Function?e:()=>e;function Ob({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=Rb,onClick:s}){const a=ce(Ab,_e),l=yu(t),u=yu(e),d=yu(n),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return S.jsx(S.Fragment,{children:a.map(h=>S.jsx(Lb,{id:h,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:s,shapeRendering:c},h))})}function Db({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:a,onClick:l}){const{node:u,x:d,y:c,width:h,height:g}=ce(y=>{const v=y.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const w=v.internals.userNode,{x:f,y:p}=v.internals.positionAbsolute,{width:m,height:_}=_n(w);return{node:w,x:f,y:p,width:m,height:_}},_e);return!u||u.hidden||!cv(u)?null:S.jsx(a,{x:d,y:c,width:h,height:g,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:o,strokeColor:n(u),strokeWidth:i,shapeRendering:s,onClick:l,id:u.id})}const Lb=D.memo(Db);var Vb=D.memo(Ob);const Fb=200,Hb=150,Ub=e=>!e.hidden,Bb=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?uv(es(e.nodeLookup,{filter:Ub}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Wb="react-flow__minimap-desc";function h1({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:l,maskColor:u,maskStrokeColor:d,maskStrokeWidth:c,position:h="bottom-right",onClick:g,onNodeClick:y,pannable:v=!1,zoomable:w=!1,ariaLabel:f,inversePan:p,zoomStep:m=1,offsetScale:_=5}){const x=xe(),k=D.useRef(null),{boundingRect:C,viewBB:I,rfId:L,panZoom:U,translateExtent:T,flowWidth:O,flowHeight:W,ariaLabelConfig:N}=ce(Bb,_e),F=(e==null?void 0:e.width)??Fb,A=(e==null?void 0:e.height)??Hb,H=C.width/F,M=C.height/A,z=Math.max(H,M),b=z*F,E=z*A,j=_*z,R=C.x-(b-C.width)/2-j,$=C.y-(E-C.height)/2-j,P=b+j*2,V=E+j*2,q=`${Wb}-${L}`,B=D.useRef(0),Y=D.useRef();B.current=z,D.useEffect(()=>{if(k.current&&U)return Y.current=qN({domNode:k.current,panZoom:U,getTransform:()=>x.getState().transform,getViewScale:()=>B.current}),()=>{var ne;(ne=Y.current)==null||ne.destroy()}},[U]),D.useEffect(()=>{var ne;(ne=Y.current)==null||ne.update({translateExtent:T,width:O,height:W,inversePan:p,pannable:v,zoomStep:m,zoomable:w})},[v,w,p,m,T,O,W]);const G=g?ne=>{var le;const[ue,fe]=((le=Y.current)==null?void 0:le.pointer(ne))||[0,0];g(ne,{x:ue,y:fe})}:void 0,Z=y?D.useCallback((ne,ue)=>{const fe=x.getState().nodeLookup.get(ue).internals.userNode;y(ne,fe)},[]):void 0,te=f??N["minimap.ariaLabel"];return S.jsx($l,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof c=="number"?c*z:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:Me(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:S.jsxs("svg",{width:F,height:A,viewBox:`${R} ${$} ${P} ${V}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":q,ref:k,onClick:G,children:[te&&S.jsx("title",{id:q,children:te}),S.jsx(Vb,{onClick:Z,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:a}),S.jsx("path",{className:"react-flow__minimap-mask",d:`M${R-j},${$-j}h${P+j*2}v${V+j*2}h${-P-j*2}z
|
|
202
|
+
M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}h1.displayName="MiniMap";D.memo(h1);const qb=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Kb={[$o.Line]:"right",[$o.Handle]:"bottom-right"};function Yb({nodeId:e,position:t,variant:n=$o.Handle,className:r,style:o=void 0,children:i,color:s,minWidth:a=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:c=!1,resizeDirection:h,autoScale:g=!0,shouldResize:y,onResizeStart:v,onResize:w,onResizeEnd:f}){const p=Bv(),m=typeof e=="string"?e:p,_=xe(),x=D.useRef(null),k=n===$o.Handle,C=ce(D.useCallback(qb(k&&g),[k,g]),_e),I=D.useRef(null),L=t??Kb[n];D.useEffect(()=>{if(!(!x.current||!m))return I.current||(I.current=sP({domNode:x.current,nodeId:m,getStoreItems:()=>{const{nodeLookup:T,transform:O,snapGrid:W,snapToGrid:N,nodeOrigin:F,domNode:A}=_.getState();return{nodeLookup:T,transform:O,snapGrid:W,snapToGrid:N,nodeOrigin:F,paneDomNode:A}},onChange:(T,O)=>{const{triggerNodeChanges:W,nodeLookup:N,parentLookup:F,nodeOrigin:A}=_.getState(),H=[],M={x:T.x,y:T.y},z=N.get(m);if(z&&z.expandParent&&z.parentId){const b=z.origin??A,E=T.width??z.measured.width??0,j=T.height??z.measured.height??0,R={id:z.id,parentId:z.parentId,rect:{width:E,height:j,...dv({x:T.x??z.position.x,y:T.y??z.position.y},{width:E,height:j},z.parentId,N,b)}},$=Zd([R],N,F,A);H.push(...$),M.x=T.x?Math.max(b[0]*E,T.x):void 0,M.y=T.y?Math.max(b[1]*j,T.y):void 0}if(M.x!==void 0&&M.y!==void 0){const b={id:m,type:"position",position:{...M}};H.push(b)}if(T.width!==void 0&&T.height!==void 0){const E={id:m,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:T.width,height:T.height}};H.push(E)}for(const b of O){const E={...b,type:"position"};H.push(E)}W(H)},onEnd:({width:T,height:O})=>{const W={id:m,type:"dimensions",resizing:!1,dimensions:{width:T,height:O}};_.getState().triggerNodeChanges([W])}})),I.current.update({controlPosition:L,boundaries:{minWidth:a,minHeight:l,maxWidth:u,maxHeight:d},keepAspectRatio:c,resizeDirection:h,onResizeStart:v,onResize:w,onResizeEnd:f,shouldResize:y}),()=>{var T;(T=I.current)==null||T.destroy()}},[L,a,l,u,d,c,v,w,f,y]);const U=L.split("-");return S.jsx("div",{className:Me(["react-flow__resize-control","nodrag",...U,n,r]),ref:x,style:{...o,scale:C,...s&&{[k?"backgroundColor":"borderColor"]:s}},children:i})}D.memo(Yb);const Xb={monitor:cS,server:pS,database:aS,zap:_S,globe:uS,music:fS,sliders:mS},Gb={planned:"var(--status-planned)",implemented:"var(--status-implemented)",stale:"var(--status-stale)",deprecated:"var(--status-deprecated)"},xm={audio:"#f472b6",midi:"#a78bfa",control:"#34d399",http:"#60a5fa",data:"#fbbf24"};function Sm(e,t){if(t<=1)return"50%";const n=18,r=100-n*2,o=e/(t-1);return`${n+o*r}%`}function Qb({data:e}){var h,g,y;const{node:t,typeDef:n,onDrillDown:r,active:o}=e,i=(n==null?void 0:n.color)??"#71717a",s=n!=null&&n.icon?Xb[n.icon]??wp:wp,a=(n==null?void 0:n.label)??t.type,l=((h=n==null?void 0:n.ports)==null?void 0:h.in)??[],u=((g=n==null?void 0:n.ports)==null?void 0:g.out)??[],d=l.length>0,c=u.length>0;return S.jsxs("div",{className:`node-card status-${t.status}${d||c?" has-ports":""}${o?" active":""}`,style:{"--node-color":i,"--status-color":Gb[t.status]},children:[d?l.map((v,w)=>S.jsxs("div",{className:"port-row port-in",style:{top:Sm(w,l.length)},children:[S.jsx(Rn,{type:"target",position:ee.Left,id:v.name,style:{background:v.signal?xm[v.signal]??i:i}}),S.jsx("span",{className:"port-label",children:v.name})]},`in-${v.name}`)):S.jsx(Rn,{type:"target",position:ee.Left}),S.jsxs("div",{className:"node-header",children:[S.jsx(s,{className:"node-icon"}),S.jsx("span",{className:"node-type",children:a})]}),S.jsx("div",{className:"node-label",children:t.label}),S.jsx("span",{className:"status-dot",title:t.status}),(((y=t.code_refs)==null?void 0:y.length)??0)>0&&S.jsxs("span",{className:"refs-badge",title:(t.code_refs??[]).map(v=>v.path+(v.symbol?` · ${v.symbol}`:"")).join(`
|
|
203
|
+
`)||"Code refs",children:[S.jsx(hS,{size:9})," ",t.code_refs.length]}),t.drill_down&&r&&S.jsx("button",{className:"drill-down-btn",title:`Drill into ${t.drill_down}`,"aria-label":`Drill into ${t.drill_down}`,onPointerDown:v=>v.stopPropagation(),onClick:v=>{v.stopPropagation(),r(t.drill_down)},children:S.jsx(xy,{size:12})}),c?u.map((v,w)=>S.jsxs("div",{className:"port-row port-out",style:{top:Sm(w,u.length)},children:[S.jsx("span",{className:"port-label",children:v.name}),S.jsx(Rn,{type:"source",position:ee.Right,id:v.name,style:{background:v.signal?xm[v.signal]??i:i}})]},`out-${v.name}`)):S.jsx(Rn,{type:"source",position:ee.Right})]})}function Zb({data:e,width:t,height:n}){const{group:r,onDrillDown:o}=e,i=r.color??"#94a3b8";return S.jsx("div",{className:"group-frame",style:{width:t??"100%",height:n??"100%","--group-color":i},children:S.jsxs("div",{className:"group-label",children:[S.jsx("span",{children:r.label}),r.drill_down&&o&&S.jsx("button",{className:"drill-down-btn inline",title:`Drill into ${r.drill_down}`,"aria-label":`Drill into ${r.drill_down}`,onClick:s=>{s.stopPropagation(),o(r.drill_down)},children:S.jsx(xy,{size:11})})]})})}const Jb=32;function ej(e){const{id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:a,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:c,markerEnd:h,markerStart:g,data:y}=e,v=(y==null?void 0:y.parallelOffset)??0,w=o-n,f=i-r,p=Math.max(Math.sqrt(w*w+f*f),1),m=-f/p,_=w/p,x=v*Jb,k=(n+o)/2+m*x,C=(r+i)/2+_*x,I=(n+o)/2+m*(x/2),L=(r+i)/2+_*(x/2),U=`M ${n},${r} Q ${k},${C} ${o},${i}`,T=Array.isArray(u)?u[0]:6,O=Array.isArray(u)?u[1]:3;return S.jsxs(S.Fragment,{children:[S.jsx(Co,{id:t,path:U,style:c,markerEnd:h,markerStart:g}),s&&S.jsx(c1,{children:S.jsx("div",{className:"parallel-edge-label nodrag nopan",style:{position:"absolute",transform:`translate(-50%, -50%) translate(${I}px, ${L}px)`,padding:`${O}px ${T}px`,borderRadius:(d??3)+"px",background:(l==null?void 0:l.fill)??"var(--bg-elevated)",color:(a==null?void 0:a.fill)??"var(--text-muted)",fontSize:(a==null?void 0:a.fontSize)??11,fontFamily:"inherit",lineHeight:1.2,pointerEvents:"all",userSelect:"none"},children:s})})]})}const tj=32,nj=320;function rj(e){const{id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:a,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:c,markerEnd:h,markerStart:g,data:y}=e,v=y??{},w=v.parallelOffset??0,f=v.pulsing??!1,p=o-n,m=i-r,_=Math.max(Math.sqrt(p*p+m*m),1),x=-m/_,k=p/_,C=w*tj,I=(n+o)/2+x*C,L=(r+i)/2+k*C,U=`M ${n},${r} Q ${I},${L} ${o},${i}`,T=`pulse-path-${t}`,O=Math.max(.4,_/nj),W=(n+o)/2+x*(C/2),N=(r+i)/2+k*(C/2),F=Array.isArray(u)?u[0]:6,A=Array.isArray(u)?u[1]:3,H=(c==null?void 0:c.stroke)??"var(--accent)";return S.jsxs(S.Fragment,{children:[S.jsx(Co,{id:t,path:U,style:c,markerEnd:h,markerStart:g}),S.jsx("path",{id:T,d:U,fill:"none",stroke:"none"}),f&&S.jsx("circle",{r:5,className:"pulse-marker",fill:H,stroke:"white",strokeWidth:1,children:S.jsx("animateMotion",{dur:`${O}s`,repeatCount:"indefinite",children:S.jsx("mpath",{href:`#${T}`})})}),s&&S.jsx(c1,{children:S.jsx("div",{className:"parallel-edge-label nodrag nopan",style:{position:"absolute",transform:`translate(-50%, -50%) translate(${W}px, ${N}px)`,padding:`${A}px ${F}px`,borderRadius:(d??3)+"px",background:(l==null?void 0:l.fill)??"var(--bg-elevated)",color:(a==null?void 0:a.fill)??"var(--text-muted)",fontSize:(a==null?void 0:a.fontSize)??11,fontFamily:"inherit",lineHeight:1.2,pointerEvents:"all",userSelect:"none"},children:s})})]})}async function Bi(e){const t=await fetch(e);if(!t.ok){let n="";try{n=` — ${(await t.json()).error??""}`}catch{}throw new Error(`${e}: ${t.status} ${t.statusText}${n}`)}return await t.json()}async function oj(){return Bi("/api/diagrams")}async function Em(e="overview"){const[t,n]=await Promise.all([Bi(`/api/diagrams/${e}`),Bi("/api/node-types")]);return{diagram:t,nodeTypes:n}}async function p1(e){const t=await fetch(`/api/diagrams/${e.id}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Error(`save failed: ${t.status} ${n.error??""}`)}}async function m1(e,t){await p1({version:"1",id:e,title:t,nodes:[],edges:[]})}async function ij(){return Bi("/api/timelines")}async function dA(e){return Bi(`/api/timelines/${e}`)}async function fA(e){const t=await fetch(`/api/timelines/${e.id}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Error(`save failed: ${t.status} ${n.error??""}`)}}var Tc={exports:{}},tf={},St={},So={},rs={},oe={},Wi={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(p){if(super(),!e.IDENTIFIER.test(p))throw new Error("CodeGen: name must be a valid identifier");this.str=p}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(p){super(),this._items=typeof p=="string"?[p]:p}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const p=this._items[0];return p===""||p==='""'}get str(){var p;return(p=this._str)!==null&&p!==void 0?p:this._str=this._items.reduce((m,_)=>`${m}${_}`,"")}get names(){var p;return(p=this._names)!==null&&p!==void 0?p:this._names=this._items.reduce((m,_)=>(_ instanceof n&&(m[_.str]=(m[_.str]||0)+1),m),{})}}e._Code=r,e.nil=new r("");function o(f,...p){const m=[f[0]];let _=0;for(;_<p.length;)a(m,p[_]),m.push(f[++_]);return new r(m)}e._=o;const i=new r("+");function s(f,...p){const m=[g(f[0])];let _=0;for(;_<p.length;)m.push(i),a(m,p[_]),m.push(i,g(f[++_]));return l(m),new r(m)}e.str=s;function a(f,p){p instanceof r?f.push(...p._items):p instanceof n?f.push(p):f.push(c(p))}e.addCodeArg=a;function l(f){let p=1;for(;p<f.length-1;){if(f[p]===i){const m=u(f[p-1],f[p+1]);if(m!==void 0){f.splice(p-1,3,m);continue}f[p++]="+"}p++}}function u(f,p){if(p==='""')return f;if(f==='""')return p;if(typeof f=="string")return p instanceof n||f[f.length-1]!=='"'?void 0:typeof p!="string"?`${f.slice(0,-1)}${p}"`:p[0]==='"'?f.slice(0,-1)+p.slice(1):void 0;if(typeof p=="string"&&p[0]==='"'&&!(f instanceof n))return`"${f}${p.slice(1)}`}function d(f,p){return p.emptyStr()?f:f.emptyStr()?p:s`${f}${p}`}e.strConcat=d;function c(f){return typeof f=="number"||typeof f=="boolean"||f===null?f:g(Array.isArray(f)?f.join(","):f)}function h(f){return new r(g(f))}e.stringify=h;function g(f){return JSON.stringify(f).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=g;function y(f){return typeof f=="string"&&e.IDENTIFIER.test(f)?new r(`.${f}`):o`[${f}]`}e.getProperty=y;function v(f){if(typeof f=="string"&&e.IDENTIFIER.test(f))return new r(`${f}`);throw new Error(`CodeGen: invalid export name: ${f}, use explicit $id name mapping`)}e.getEsmExportName=v;function w(f){return new r(f.toString())}e.regexpCode=w})(Wi);var Ic={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Wi;class n extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var r;(function(l){l[l.Started=0]="Started",l[l.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class o{constructor({prefixes:u,parent:d}={}){this._names={},this._prefixes=u,this._parent=d}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const d=this._names[u]||this._nameGroup(u);return`${u}${d.index++}`}_nameGroup(u){var d,c;if(!((c=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||c===void 0)&&c.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}e.Scope=o;class i extends t.Name{constructor(u,d){super(d),this.prefix=u}setValue(u,{property:d,itemIndex:c}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(d)}[${c}]`}}e.ValueScopeName=i;const s=(0,t._)`\n`;class a extends o{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?s:t.nil}}get(){return this._scope}name(u){return new i(u,this._newName(u))}value(u,d){var c;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const h=this.toName(u),{prefix:g}=h,y=(c=d.key)!==null&&c!==void 0?c:d.ref;let v=this._values[g];if(v){const p=v.get(y);if(p)return p}else v=this._values[g]=new Map;v.set(y,h);const w=this._scope[g]||(this._scope[g]=[]),f=w.length;return w[f]=d.ref,h.setValue(d,{property:g,itemIndex:f}),h}getValue(u,d){const c=this._values[u];if(c)return c.get(d)}scopeRefs(u,d=this._values){return this._reduceValues(d,c=>{if(c.scopePath===void 0)throw new Error(`CodeGen: name "${c}" has no value`);return(0,t._)`${u}${c.scopePath}`})}scopeCode(u=this._values,d,c){return this._reduceValues(u,h=>{if(h.value===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return h.value.code},d,c)}_reduceValues(u,d,c={},h){let g=t.nil;for(const y in u){const v=u[y];if(!v)continue;const w=c[y]=c[y]||new Map;v.forEach(f=>{if(w.has(f))return;w.set(f,r.Started);let p=d(f);if(p){const m=this.opts.es5?e.varKinds.var:e.varKinds.const;g=(0,t._)`${g}${m} ${f} = ${p};${this.opts._n}`}else if(p=h==null?void 0:h(f))g=(0,t._)`${g}${p}${this.opts._n}`;else throw new n(f);w.set(f,r.Completed)})}return g}}e.ValueScope=a})(Ic);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Wi,n=Ic;var r=Wi;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var o=Ic;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames($,P){return this}}class s extends i{constructor($,P,V){super(),this.varKind=$,this.name=P,this.rhs=V}render({es5:$,_n:P}){const V=$?n.varKinds.var:this.varKind,q=this.rhs===void 0?"":` = ${this.rhs}`;return`${V} ${this.name}${q};`+P}optimizeNames($,P){if($[this.name.str])return this.rhs&&(this.rhs=N(this.rhs,$,P)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends i{constructor($,P,V){super(),this.lhs=$,this.rhs=P,this.sideEffects=V}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,P){if(!(this.lhs instanceof t.Name&&!$[this.lhs.str]&&!this.sideEffects))return this.rhs=N(this.rhs,$,P),this}get names(){const $=this.lhs instanceof t.Name?{}:{...this.lhs.names};return W($,this.rhs)}}class l extends a{constructor($,P,V,q){super($,V,q),this.op=P}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class u extends i{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class d extends i{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class c extends i{constructor($){super(),this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class h extends i{constructor($){super(),this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,P){return this.code=N(this.code,$,P),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class g extends i{constructor($=[]){super(),this.nodes=$}render($){return this.nodes.reduce((P,V)=>P+V.render($),"")}optimizeNodes(){const{nodes:$}=this;let P=$.length;for(;P--;){const V=$[P].optimizeNodes();Array.isArray(V)?$.splice(P,1,...V):V?$[P]=V:$.splice(P,1)}return $.length>0?this:void 0}optimizeNames($,P){const{nodes:V}=this;let q=V.length;for(;q--;){const B=V[q];B.optimizeNames($,P)||(F($,B.names),V.splice(q,1))}return V.length>0?this:void 0}get names(){return this.nodes.reduce(($,P)=>O($,P.names),{})}}class y extends g{render($){return"{"+$._n+super.render($)+"}"+$._n}}class v extends g{}class w extends y{}w.kind="else";class f extends y{constructor($,P){super(P),this.condition=$}render($){let P=`if(${this.condition})`+super.render($);return this.else&&(P+="else "+this.else.render($)),P}optimizeNodes(){super.optimizeNodes();const $=this.condition;if($===!0)return this.nodes;let P=this.else;if(P){const V=P.optimizeNodes();P=this.else=Array.isArray(V)?new w(V):V}if(P)return $===!1?P instanceof f?P:P.nodes:this.nodes.length?this:new f(A($),P instanceof f?[P]:P.nodes);if(!($===!1||!this.nodes.length))return this}optimizeNames($,P){var V;if(this.else=(V=this.else)===null||V===void 0?void 0:V.optimizeNames($,P),!!(super.optimizeNames($,P)||this.else))return this.condition=N(this.condition,$,P),this}get names(){const $=super.names;return W($,this.condition),this.else&&O($,this.else.names),$}}f.kind="if";class p extends y{}p.kind="for";class m extends p{constructor($){super(),this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,P){if(super.optimizeNames($,P))return this.iteration=N(this.iteration,$,P),this}get names(){return O(super.names,this.iteration.names)}}class _ extends p{constructor($,P,V,q){super(),this.varKind=$,this.name=P,this.from=V,this.to=q}render($){const P=$.es5?n.varKinds.var:this.varKind,{name:V,from:q,to:B}=this;return`for(${P} ${V}=${q}; ${V}<${B}; ${V}++)`+super.render($)}get names(){const $=W(super.names,this.from);return W($,this.to)}}class x extends p{constructor($,P,V,q){super(),this.loop=$,this.varKind=P,this.name=V,this.iterable=q}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,P){if(super.optimizeNames($,P))return this.iterable=N(this.iterable,$,P),this}get names(){return O(super.names,this.iterable.names)}}class k extends y{constructor($,P,V){super(),this.name=$,this.args=P,this.async=V}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}k.kind="func";class C extends g{render($){return"return "+super.render($)}}C.kind="return";class I extends y{render($){let P="try"+super.render($);return this.catch&&(P+=this.catch.render($)),this.finally&&(P+=this.finally.render($)),P}optimizeNodes(){var $,P;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(P=this.finally)===null||P===void 0||P.optimizeNodes(),this}optimizeNames($,P){var V,q;return super.optimizeNames($,P),(V=this.catch)===null||V===void 0||V.optimizeNames($,P),(q=this.finally)===null||q===void 0||q.optimizeNames($,P),this}get names(){const $=super.names;return this.catch&&O($,this.catch.names),this.finally&&O($,this.finally.names),$}}class L extends y{constructor($){super(),this.error=$}render($){return`catch(${this.error})`+super.render($)}}L.kind="catch";class U extends y{render($){return"finally"+super.render($)}}U.kind="finally";class T{constructor($,P={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...P,_n:P.lines?`
|
|
204
|
+
`:""},this._extScope=$,this._scope=new n.Scope({parent:$}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,P){const V=this._extScope.value($,P);return(this._values[V.prefix]||(this._values[V.prefix]=new Set)).add(V),V}getScopeValue($,P){return this._extScope.getValue($,P)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,P,V,q){const B=this._scope.toName(P);return V!==void 0&&q&&(this._constants[B.str]=V),this._leafNode(new s($,B,V)),B}const($,P,V){return this._def(n.varKinds.const,$,P,V)}let($,P,V){return this._def(n.varKinds.let,$,P,V)}var($,P,V){return this._def(n.varKinds.var,$,P,V)}assign($,P,V){return this._leafNode(new a($,P,V))}add($,P){return this._leafNode(new l($,e.operators.ADD,P))}code($){return typeof $=="function"?$():$!==t.nil&&this._leafNode(new h($)),this}object(...$){const P=["{"];for(const[V,q]of $)P.length>1&&P.push(","),P.push(V),(V!==q||this.opts.es5)&&(P.push(":"),(0,t.addCodeArg)(P,q));return P.push("}"),new t._Code(P)}if($,P,V){if(this._blockNode(new f($)),P&&V)this.code(P).else().code(V).endIf();else if(P)this.code(P).endIf();else if(V)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new f($))}else(){return this._elseNode(new w)}endIf(){return this._endBlockNode(f,w)}_for($,P){return this._blockNode($),P&&this.code(P).endFor(),this}for($,P){return this._for(new m($),P)}forRange($,P,V,q,B=this.opts.es5?n.varKinds.var:n.varKinds.let){const Y=this._scope.toName($);return this._for(new _(B,Y,P,V),()=>q(Y))}forOf($,P,V,q=n.varKinds.const){const B=this._scope.toName($);if(this.opts.es5){const Y=P instanceof t.Name?P:this.var("_arr",P);return this.forRange("_i",0,(0,t._)`${Y}.length`,G=>{this.var(B,(0,t._)`${Y}[${G}]`),V(B)})}return this._for(new x("of",q,B,P),()=>V(B))}forIn($,P,V,q=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf($,(0,t._)`Object.keys(${P})`,V);const B=this._scope.toName($);return this._for(new x("in",q,B,P),()=>V(B))}endFor(){return this._endBlockNode(p)}label($){return this._leafNode(new u($))}break($){return this._leafNode(new d($))}return($){const P=new C;if(this._blockNode(P),this.code($),P.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(C)}try($,P,V){if(!P&&!V)throw new Error('CodeGen: "try" without "catch" and "finally"');const q=new I;if(this._blockNode(q),this.code($),P){const B=this.name("e");this._currNode=q.catch=new L(B),P(B)}return V&&(this._currNode=q.finally=new U,this.code(V)),this._endBlockNode(L,U)}throw($){return this._leafNode(new c($))}block($,P){return this._blockStarts.push(this._nodes.length),$&&this.code($).endBlock(P),this}endBlock($){const P=this._blockStarts.pop();if(P===void 0)throw new Error("CodeGen: not in self-balancing block");const V=this._nodes.length-P;if(V<0||$!==void 0&&V!==$)throw new Error(`CodeGen: wrong number of nodes: ${V} vs ${$} expected`);return this._nodes.length=P,this}func($,P=t.nil,V,q){return this._blockNode(new k($,P,V)),q&&this.code(q).endFunc(),this}endFunc(){return this._endBlockNode(k)}optimize($=1){for(;$-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,P){const V=this._currNode;if(V instanceof $||P&&V instanceof P)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${P?`${$.kind}/${P.kind}`:$.kind}"`)}_elseNode($){const P=this._currNode;if(!(P instanceof f))throw new Error('CodeGen: "else" without "if"');return this._currNode=P.else=$,this}get _root(){return this._nodes[0]}get _currNode(){const $=this._nodes;return $[$.length-1]}set _currNode($){const P=this._nodes;P[P.length-1]=$}}e.CodeGen=T;function O(R,$){for(const P in $)R[P]=(R[P]||0)+($[P]||0);return R}function W(R,$){return $ instanceof t._CodeOrName?O(R,$.names):R}function N(R,$,P){if(R instanceof t.Name)return V(R);if(!q(R))return R;return new t._Code(R._items.reduce((B,Y)=>(Y instanceof t.Name&&(Y=V(Y)),Y instanceof t._Code?B.push(...Y._items):B.push(Y),B),[]));function V(B){const Y=P[B.str];return Y===void 0||$[B.str]!==1?B:(delete $[B.str],Y)}function q(B){return B instanceof t._Code&&B._items.some(Y=>Y instanceof t.Name&&$[Y.str]===1&&P[Y.str]!==void 0)}}function F(R,$){for(const P in $)R[P]=(R[P]||0)-($[P]||0)}function A(R){return typeof R=="boolean"||typeof R=="number"||R===null?!R:(0,t._)`!${j(R)}`}e.not=A;const H=E(e.operators.AND);function M(...R){return R.reduce(H)}e.and=M;const z=E(e.operators.OR);function b(...R){return R.reduce(z)}e.or=b;function E(R){return($,P)=>$===t.nil?P:P===t.nil?$:(0,t._)`${j($)} ${R} ${j(P)}`}function j(R){return R instanceof t.Name?R:(0,t._)`(${R})`}})(oe);var X={};Object.defineProperty(X,"__esModule",{value:!0});X.checkStrictMode=X.getErrorPath=X.Type=X.useFunc=X.setEvaluated=X.evaluatedPropsToName=X.mergeEvaluated=X.eachItem=X.unescapeJsonPointer=X.escapeJsonPointer=X.escapeFragment=X.unescapeFragment=X.schemaRefOrVal=X.schemaHasRulesButRef=X.schemaHasRules=X.checkUnknownRules=X.alwaysValidSchema=X.toHash=void 0;const pe=oe,sj=Wi;function aj(e){const t={};for(const n of e)t[n]=!0;return t}X.toHash=aj;function lj(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(g1(e,t),!y1(t,e.self.RULES.all))}X.alwaysValidSchema=lj;function g1(e,t=e.schema){const{opts:n,self:r}=e;if(!n.strictSchema||typeof t=="boolean")return;const o=r.RULES.keywords;for(const i in t)o[i]||_1(e,`unknown keyword: "${i}"`)}X.checkUnknownRules=g1;function y1(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(t[n])return!0;return!1}X.schemaHasRules=y1;function uj(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}X.schemaHasRulesButRef=uj;function cj({topSchemaRef:e,schemaPath:t},n,r,o){if(!o){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,pe._)`${n}`}return(0,pe._)`${e}${t}${(0,pe.getProperty)(r)}`}X.schemaRefOrVal=cj;function dj(e){return v1(decodeURIComponent(e))}X.unescapeFragment=dj;function fj(e){return encodeURIComponent(nf(e))}X.escapeFragment=fj;function nf(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}X.escapeJsonPointer=nf;function v1(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}X.unescapeJsonPointer=v1;function hj(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)}X.eachItem=hj;function km({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:r}){return(o,i,s,a)=>{const l=s===void 0?i:s instanceof pe.Name?(i instanceof pe.Name?e(o,i,s):t(o,i,s),s):i instanceof pe.Name?(t(o,s,i),i):n(i,s);return a===pe.Name&&!(l instanceof pe.Name)?r(o,l):l}}X.mergeEvaluated={props:km({mergeNames:(e,t,n)=>e.if((0,pe._)`${n} !== true && ${t} !== undefined`,()=>{e.if((0,pe._)`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,(0,pe._)`${n} || {}`).code((0,pe._)`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if((0,pe._)`${n} !== true`,()=>{t===!0?e.assign(n,!0):(e.assign(n,(0,pe._)`${n} || {}`),rf(e,n,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:w1}),items:km({mergeNames:(e,t,n)=>e.if((0,pe._)`${n} !== true && ${t} !== undefined`,()=>e.assign(n,(0,pe._)`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if((0,pe._)`${n} !== true`,()=>e.assign(n,t===!0?!0:(0,pe._)`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function w1(e,t){if(t===!0)return e.var("props",!0);const n=e.var("props",(0,pe._)`{}`);return t!==void 0&&rf(e,n,t),n}X.evaluatedPropsToName=w1;function rf(e,t,n){Object.keys(n).forEach(r=>e.assign((0,pe._)`${t}${(0,pe.getProperty)(r)}`,!0))}X.setEvaluated=rf;const Nm={};function pj(e,t){return e.scopeValue("func",{ref:t,code:Nm[t.code]||(Nm[t.code]=new sj._Code(t.code))})}X.useFunc=pj;var zc;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(zc||(X.Type=zc={}));function mj(e,t,n){if(e instanceof pe.Name){const r=t===zc.Num;return n?r?(0,pe._)`"[" + ${e} + "]"`:(0,pe._)`"['" + ${e} + "']"`:r?(0,pe._)`"/" + ${e}`:(0,pe._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,pe.getProperty)(e).toString():"/"+nf(e)}X.getErrorPath=mj;function _1(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw new Error(t);e.self.logger.warn(t)}}X.checkStrictMode=_1;var mt={};Object.defineProperty(mt,"__esModule",{value:!0});const Be=oe,gj={data:new Be.Name("data"),valCxt:new Be.Name("valCxt"),instancePath:new Be.Name("instancePath"),parentData:new Be.Name("parentData"),parentDataProperty:new Be.Name("parentDataProperty"),rootData:new Be.Name("rootData"),dynamicAnchors:new Be.Name("dynamicAnchors"),vErrors:new Be.Name("vErrors"),errors:new Be.Name("errors"),this:new Be.Name("this"),self:new Be.Name("self"),scope:new Be.Name("scope"),json:new Be.Name("json"),jsonPos:new Be.Name("jsonPos"),jsonLen:new Be.Name("jsonLen"),jsonPart:new Be.Name("jsonPart")};mt.default=gj;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=oe,n=X,r=mt;e.keywordError={message:({keyword:w})=>(0,t.str)`must pass "${w}" keyword validation`},e.keyword$DataError={message:({keyword:w,schemaType:f})=>f?(0,t.str)`"${w}" keyword must be ${f} ($data)`:(0,t.str)`"${w}" keyword is invalid ($data)`};function o(w,f=e.keywordError,p,m){const{it:_}=w,{gen:x,compositeRule:k,allErrors:C}=_,I=c(w,f,p);m??(k||C)?l(x,I):u(_,(0,t._)`[${I}]`)}e.reportError=o;function i(w,f=e.keywordError,p){const{it:m}=w,{gen:_,compositeRule:x,allErrors:k}=m,C=c(w,f,p);l(_,C),x||k||u(m,r.default.vErrors)}e.reportExtraError=i;function s(w,f){w.assign(r.default.errors,f),w.if((0,t._)`${r.default.vErrors} !== null`,()=>w.if(f,()=>w.assign((0,t._)`${r.default.vErrors}.length`,f),()=>w.assign(r.default.vErrors,null)))}e.resetErrorsCount=s;function a({gen:w,keyword:f,schemaValue:p,data:m,errsCount:_,it:x}){if(_===void 0)throw new Error("ajv implementation error");const k=w.name("err");w.forRange("i",_,r.default.errors,C=>{w.const(k,(0,t._)`${r.default.vErrors}[${C}]`),w.if((0,t._)`${k}.instancePath === undefined`,()=>w.assign((0,t._)`${k}.instancePath`,(0,t.strConcat)(r.default.instancePath,x.errorPath))),w.assign((0,t._)`${k}.schemaPath`,(0,t.str)`${x.errSchemaPath}/${f}`),x.opts.verbose&&(w.assign((0,t._)`${k}.schema`,p),w.assign((0,t._)`${k}.data`,m))})}e.extendErrors=a;function l(w,f){const p=w.const("err",f);w.if((0,t._)`${r.default.vErrors} === null`,()=>w.assign(r.default.vErrors,(0,t._)`[${p}]`),(0,t._)`${r.default.vErrors}.push(${p})`),w.code((0,t._)`${r.default.errors}++`)}function u(w,f){const{gen:p,validateName:m,schemaEnv:_}=w;_.$async?p.throw((0,t._)`new ${w.ValidationError}(${f})`):(p.assign((0,t._)`${m}.errors`,f),p.return(!1))}const d={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function c(w,f,p){const{createErrors:m}=w.it;return m===!1?(0,t._)`{}`:h(w,f,p)}function h(w,f,p={}){const{gen:m,it:_}=w,x=[g(_,p),y(w,p)];return v(w,f,x),m.object(...x)}function g({errorPath:w},{instancePath:f}){const p=f?(0,t.str)`${w}${(0,n.getErrorPath)(f,n.Type.Str)}`:w;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,p)]}function y({keyword:w,it:{errSchemaPath:f}},{schemaPath:p,parentSchema:m}){let _=m?f:(0,t.str)`${f}/${w}`;return p&&(_=(0,t.str)`${_}${(0,n.getErrorPath)(p,n.Type.Str)}`),[d.schemaPath,_]}function v(w,{params:f,message:p},m){const{keyword:_,data:x,schemaValue:k,it:C}=w,{opts:I,propertyName:L,topSchemaRef:U,schemaPath:T}=C;m.push([d.keyword,_],[d.params,typeof f=="function"?f(w):f||(0,t._)`{}`]),I.messages&&m.push([d.message,typeof p=="function"?p(w):p]),I.verbose&&m.push([d.schema,k],[d.parentSchema,(0,t._)`${U}${T}`],[r.default.data,x]),L&&m.push([d.propertyName,L])}})(rs);Object.defineProperty(So,"__esModule",{value:!0});So.boolOrEmptySchema=So.topBoolOrEmptySchema=void 0;const yj=rs,vj=oe,wj=mt,_j={message:"boolean schema is false"};function $j(e){const{gen:t,schema:n,validateName:r}=e;n===!1?$1(e,!1):typeof n=="object"&&n.$async===!0?t.return(wj.default.data):(t.assign((0,vj._)`${r}.errors`,null),t.return(!0))}So.topBoolOrEmptySchema=$j;function xj(e,t){const{gen:n,schema:r}=e;r===!1?(n.var(t,!1),$1(e)):n.var(t,!0)}So.boolOrEmptySchema=xj;function $1(e,t){const{gen:n,data:r}=e,o={gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,yj.reportError)(o,_j,void 0,t)}var Ie={},kr={};Object.defineProperty(kr,"__esModule",{value:!0});kr.getRules=kr.isJSONType=void 0;const Sj=["string","number","integer","boolean","null","object","array"],Ej=new Set(Sj);function kj(e){return typeof e=="string"&&Ej.has(e)}kr.isJSONType=kj;function Nj(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}kr.getRules=Nj;var dn={};Object.defineProperty(dn,"__esModule",{value:!0});dn.shouldUseRule=dn.shouldUseGroup=dn.schemaHasRulesForType=void 0;function Pj({schema:e,self:t},n){const r=t.RULES.types[n];return r&&r!==!0&&x1(e,r)}dn.schemaHasRulesForType=Pj;function x1(e,t){return t.rules.some(n=>S1(e,n))}dn.shouldUseGroup=x1;function S1(e,t){var n;return e[t.keyword]!==void 0||((n=t.definition.implements)===null||n===void 0?void 0:n.some(r=>e[r]!==void 0))}dn.shouldUseRule=S1;Object.defineProperty(Ie,"__esModule",{value:!0});Ie.reportTypeError=Ie.checkDataTypes=Ie.checkDataType=Ie.coerceAndCheckDataType=Ie.getJSONTypes=Ie.getSchemaTypes=Ie.DataType=void 0;const Cj=kr,bj=dn,jj=rs,ie=oe,E1=X;var io;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(io||(Ie.DataType=io={}));function Mj(e){const t=k1(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}Ie.getSchemaTypes=Mj;function k1(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(Cj.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Ie.getJSONTypes=k1;function Tj(e,t){const{gen:n,data:r,opts:o}=e,i=Ij(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,bj.schemaHasRulesForType)(e,t[0]));if(s){const a=of(t,r,o.strictNumbers,io.Wrong);n.if(a,()=>{i.length?zj(e,t,i):sf(e)})}return s}Ie.coerceAndCheckDataType=Tj;const N1=new Set(["string","number","integer","boolean","null"]);function Ij(e,t){return t?e.filter(n=>N1.has(n)||t==="array"&&n==="array"):[]}function zj(e,t,n){const{gen:r,data:o,opts:i}=e,s=r.let("dataType",(0,ie._)`typeof ${o}`),a=r.let("coerced",(0,ie._)`undefined`);i.coerceTypes==="array"&&r.if((0,ie._)`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>r.assign(o,(0,ie._)`${o}[0]`).assign(s,(0,ie._)`typeof ${o}`).if(of(t,o,i.strictNumbers),()=>r.assign(a,o))),r.if((0,ie._)`${a} !== undefined`);for(const u of n)(N1.has(u)||u==="array"&&i.coerceTypes==="array")&&l(u);r.else(),sf(e),r.endIf(),r.if((0,ie._)`${a} !== undefined`,()=>{r.assign(o,a),Rj(e,a)});function l(u){switch(u){case"string":r.elseIf((0,ie._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,ie._)`"" + ${o}`).elseIf((0,ie._)`${o} === null`).assign(a,(0,ie._)`""`);return;case"number":r.elseIf((0,ie._)`${s} == "boolean" || ${o} === null
|
|
205
|
+
|| (${s} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,ie._)`+${o}`);return;case"integer":r.elseIf((0,ie._)`${s} === "boolean" || ${o} === null
|
|
206
|
+
|| (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,ie._)`+${o}`);return;case"boolean":r.elseIf((0,ie._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf((0,ie._)`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":r.elseIf((0,ie._)`${o} === "" || ${o} === 0 || ${o} === false`),r.assign(a,null);return;case"array":r.elseIf((0,ie._)`${s} === "string" || ${s} === "number"
|
|
207
|
+
|| ${s} === "boolean" || ${o} === null`).assign(a,(0,ie._)`[${o}]`)}}}function Rj({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,ie._)`${t} !== undefined`,()=>e.assign((0,ie._)`${t}[${n}]`,r))}function Rc(e,t,n,r=io.Correct){const o=r===io.Correct?ie.operators.EQ:ie.operators.NEQ;let i;switch(e){case"null":return(0,ie._)`${t} ${o} null`;case"array":i=(0,ie._)`Array.isArray(${t})`;break;case"object":i=(0,ie._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,ie._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,ie._)`typeof ${t} ${o} ${e}`}return r===io.Correct?i:(0,ie.not)(i);function s(a=ie.nil){return(0,ie.and)((0,ie._)`typeof ${t} == "number"`,a,n?(0,ie._)`isFinite(${t})`:ie.nil)}}Ie.checkDataType=Rc;function of(e,t,n,r){if(e.length===1)return Rc(e[0],t,n,r);let o;const i=(0,E1.toHash)(e);if(i.array&&i.object){const s=(0,ie._)`typeof ${t} != "object"`;o=i.null?s:(0,ie._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else o=ie.nil;i.number&&delete i.integer;for(const s in i)o=(0,ie.and)(o,Rc(s,t,n,r));return o}Ie.checkDataTypes=of;const Aj={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,ie._)`{type: ${e}}`:(0,ie._)`{type: ${t}}`};function sf(e){const t=Oj(e);(0,jj.reportError)(t,Aj)}Ie.reportTypeError=sf;function Oj(e){const{gen:t,data:n,schema:r}=e,o=(0,E1.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:o,schemaValue:o,parentSchema:r,params:{},it:e}}var Sl={};Object.defineProperty(Sl,"__esModule",{value:!0});Sl.assignDefaults=void 0;const Ir=oe,Dj=X;function Lj(e,t){const{properties:n,items:r}=e.schema;if(t==="object"&&n)for(const o in n)Pm(e,o,n[o].default);else t==="array"&&Array.isArray(r)&&r.forEach((o,i)=>Pm(e,i,o.default))}Sl.assignDefaults=Lj;function Pm(e,t,n){const{gen:r,compositeRule:o,data:i,opts:s}=e;if(n===void 0)return;const a=(0,Ir._)`${i}${(0,Ir.getProperty)(t)}`;if(o){(0,Dj.checkStrictMode)(e,`default is ignored for: ${a}`);return}let l=(0,Ir._)`${a} === undefined`;s.useDefaults==="empty"&&(l=(0,Ir._)`${l} || ${a} === null || ${a} === ""`),r.if(l,(0,Ir._)`${a} = ${(0,Ir.stringify)(n)}`)}var Kt={},se={};Object.defineProperty(se,"__esModule",{value:!0});se.validateUnion=se.validateArray=se.usePattern=se.callValidateCode=se.schemaProperties=se.allSchemaProperties=se.noPropertyInData=se.propertyInData=se.isOwnProperty=se.hasPropFunc=se.reportMissingProp=se.checkMissingProp=se.checkReportMissingProp=void 0;const ye=oe,af=X,kn=mt,Vj=X;function Fj(e,t){const{gen:n,data:r,it:o}=e;n.if(uf(n,r,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,ye._)`${t}`},!0),e.error()})}se.checkReportMissingProp=Fj;function Hj({gen:e,data:t,it:{opts:n}},r,o){return(0,ye.or)(...r.map(i=>(0,ye.and)(uf(e,t,i,n.ownProperties),(0,ye._)`${o} = ${i}`)))}se.checkMissingProp=Hj;function Uj(e,t){e.setParams({missingProperty:t},!0),e.error()}se.reportMissingProp=Uj;function P1(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ye._)`Object.prototype.hasOwnProperty`})}se.hasPropFunc=P1;function lf(e,t,n){return(0,ye._)`${P1(e)}.call(${t}, ${n})`}se.isOwnProperty=lf;function Bj(e,t,n,r){const o=(0,ye._)`${t}${(0,ye.getProperty)(n)} !== undefined`;return r?(0,ye._)`${o} && ${lf(e,t,n)}`:o}se.propertyInData=Bj;function uf(e,t,n,r){const o=(0,ye._)`${t}${(0,ye.getProperty)(n)} === undefined`;return r?(0,ye.or)(o,(0,ye.not)(lf(e,t,n))):o}se.noPropertyInData=uf;function C1(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}se.allSchemaProperties=C1;function Wj(e,t){return C1(t).filter(n=>!(0,af.alwaysValidSchema)(e,t[n]))}se.schemaProperties=Wj;function qj({schemaCode:e,data:t,it:{gen:n,topSchemaRef:r,schemaPath:o,errorPath:i},it:s},a,l,u){const d=u?(0,ye._)`${e}, ${t}, ${r}${o}`:t,c=[[kn.default.instancePath,(0,ye.strConcat)(kn.default.instancePath,i)],[kn.default.parentData,s.parentData],[kn.default.parentDataProperty,s.parentDataProperty],[kn.default.rootData,kn.default.rootData]];s.opts.dynamicRef&&c.push([kn.default.dynamicAnchors,kn.default.dynamicAnchors]);const h=(0,ye._)`${d}, ${n.object(...c)}`;return l!==ye.nil?(0,ye._)`${a}.call(${l}, ${h})`:(0,ye._)`${a}(${h})`}se.callValidateCode=qj;const Kj=(0,ye._)`new RegExp`;function Yj({gen:e,it:{opts:t}},n){const r=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(n,r);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,ye._)`${o.code==="new RegExp"?Kj:(0,Vj.useFunc)(e,o)}(${n}, ${r})`})}se.usePattern=Yj;function Xj(e){const{gen:t,data:n,keyword:r,it:o}=e,i=t.name("valid");if(o.allErrors){const a=t.let("valid",!0);return s(()=>t.assign(a,!1)),a}return t.var(i,!0),s(()=>t.break()),i;function s(a){const l=t.const("len",(0,ye._)`${n}.length`);t.forRange("i",0,l,u=>{e.subschema({keyword:r,dataProp:u,dataPropType:af.Type.Num},i),t.if((0,ye.not)(i),a)})}}se.validateArray=Xj;function Gj(e){const{gen:t,schema:n,keyword:r,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(l=>(0,af.alwaysValidSchema)(o,l))&&!o.opts.unevaluated)return;const s=t.let("valid",!1),a=t.name("_valid");t.block(()=>n.forEach((l,u)=>{const d=e.subschema({keyword:r,schemaProp:u,compositeRule:!0},a);t.assign(s,(0,ye._)`${s} || ${a}`),e.mergeValidEvaluated(d,a)||t.if((0,ye.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}se.validateUnion=Gj;Object.defineProperty(Kt,"__esModule",{value:!0});Kt.validateKeywordUsage=Kt.validSchemaType=Kt.funcKeywordCode=Kt.macroKeywordCode=void 0;const Ye=oe,rr=mt,Qj=se,Zj=rs;function Jj(e,t){const{gen:n,keyword:r,schema:o,parentSchema:i,it:s}=e,a=t.macro.call(s.self,o,i,s),l=b1(n,r,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);const u=n.name("valid");e.subschema({schema:a,schemaPath:Ye.nil,errSchemaPath:`${s.errSchemaPath}/${r}`,topSchemaRef:l,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Kt.macroKeywordCode=Jj;function eM(e,t){var n;const{gen:r,keyword:o,schema:i,parentSchema:s,$data:a,it:l}=e;nM(l,t);const u=!a&&t.compile?t.compile.call(l.self,i,s,l):t.validate,d=b1(r,o,u),c=r.let("valid");e.block$data(c,h),e.ok((n=t.valid)!==null&&n!==void 0?n:c);function h(){if(t.errors===!1)v(),t.modifying&&Cm(e),w(()=>e.error());else{const f=t.async?g():y();t.modifying&&Cm(e),w(()=>tM(e,f))}}function g(){const f=r.let("ruleErrs",null);return r.try(()=>v((0,Ye._)`await `),p=>r.assign(c,!1).if((0,Ye._)`${p} instanceof ${l.ValidationError}`,()=>r.assign(f,(0,Ye._)`${p}.errors`),()=>r.throw(p))),f}function y(){const f=(0,Ye._)`${d}.errors`;return r.assign(f,null),v(Ye.nil),f}function v(f=t.async?(0,Ye._)`await `:Ye.nil){const p=l.opts.passContext?rr.default.this:rr.default.self,m=!("compile"in t&&!a||t.schema===!1);r.assign(c,(0,Ye._)`${f}${(0,Qj.callValidateCode)(e,d,p,m)}`,t.modifying)}function w(f){var p;r.if((0,Ye.not)((p=t.valid)!==null&&p!==void 0?p:c),f)}}Kt.funcKeywordCode=eM;function Cm(e){const{gen:t,data:n,it:r}=e;t.if(r.parentData,()=>t.assign(n,(0,Ye._)`${r.parentData}[${r.parentDataProperty}]`))}function tM(e,t){const{gen:n}=e;n.if((0,Ye._)`Array.isArray(${t})`,()=>{n.assign(rr.default.vErrors,(0,Ye._)`${rr.default.vErrors} === null ? ${t} : ${rr.default.vErrors}.concat(${t})`).assign(rr.default.errors,(0,Ye._)`${rr.default.vErrors}.length`),(0,Zj.extendErrors)(e)},()=>e.error())}function nM({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function b1(e,t,n){if(n===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,Ye.stringify)(n)})}function rM(e,t,n=!1){return!t.length||t.some(r=>r==="array"?Array.isArray(e):r==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==r||n&&typeof e>"u")}Kt.validSchemaType=rM;function oM({schema:e,opts:t,self:n,errSchemaPath:r},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");const s=o.dependencies;if(s!=null&&s.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){const l=`keyword "${i}" value is invalid at path "${r}": `+n.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")n.logger.error(l);else throw new Error(l)}}Kt.validateKeywordUsage=oM;var qn={};Object.defineProperty(qn,"__esModule",{value:!0});qn.extendSubschemaMode=qn.extendSubschemaData=qn.getSubschema=void 0;const qt=oe,j1=X;function iM(e,{keyword:t,schemaProp:n,schema:r,schemaPath:o,errSchemaPath:i,topSchemaRef:s}){if(t!==void 0&&r!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){const a=e.schema[t];return n===void 0?{schema:a,schemaPath:(0,qt._)`${e.schemaPath}${(0,qt.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[n],schemaPath:(0,qt._)`${e.schemaPath}${(0,qt.getProperty)(t)}${(0,qt.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,j1.escapeFragment)(n)}`}}if(r!==void 0){if(o===void 0||i===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:o,topSchemaRef:s,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}qn.getSubschema=iM;function sM(e,t,{dataProp:n,dataPropType:r,data:o,dataTypes:i,propertyName:s}){if(o!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:a}=t;if(n!==void 0){const{errorPath:u,dataPathArr:d,opts:c}=t,h=a.let("data",(0,qt._)`${t.data}${(0,qt.getProperty)(n)}`,!0);l(h),e.errorPath=(0,qt.str)`${u}${(0,j1.getErrorPath)(n,r,c.jsPropertySyntax)}`,e.parentDataProperty=(0,qt._)`${n}`,e.dataPathArr=[...d,e.parentDataProperty]}if(o!==void 0){const u=o instanceof qt.Name?o:a.let("data",o,!0);l(u),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);function l(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}qn.extendSubschemaData=sM;function aM(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:o,allErrors:i}){r!==void 0&&(e.compositeRule=r),o!==void 0&&(e.createErrors=o),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=n}qn.extendSubschemaMode=aM;var Le={},M1=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n},T1={exports:{}},An=T1.exports=function(e,t,n){typeof t=="function"&&(n=t,t={}),n=t.cb||n;var r=typeof n=="function"?n:n.pre||function(){},o=n.post||function(){};ra(t,r,o,e,"",e)};An.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};An.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};An.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};An.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function ra(e,t,n,r,o,i,s,a,l,u){if(r&&typeof r=="object"&&!Array.isArray(r)){t(r,o,i,s,a,l,u);for(var d in r){var c=r[d];if(Array.isArray(c)){if(d in An.arrayKeywords)for(var h=0;h<c.length;h++)ra(e,t,n,c[h],o+"/"+d+"/"+h,i,o,d,r,h)}else if(d in An.propsKeywords){if(c&&typeof c=="object")for(var g in c)ra(e,t,n,c[g],o+"/"+d+"/"+lM(g),i,o,d,r,g)}else(d in An.keywords||e.allKeys&&!(d in An.skipKeywords))&&ra(e,t,n,c,o+"/"+d,i,o,d,r)}n(r,o,i,s,a,l,u)}}function lM(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var uM=T1.exports;Object.defineProperty(Le,"__esModule",{value:!0});Le.getSchemaRefs=Le.resolveUrl=Le.normalizeId=Le._getFullPath=Le.getFullPath=Le.inlineRef=void 0;const cM=X,dM=M1,fM=uM,hM=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function pM(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Ac(e):t?I1(e)<=t:!1}Le.inlineRef=pM;const mM=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Ac(e){for(const t in e){if(mM.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(Ac)||typeof n=="object"&&Ac(n))return!0}return!1}function I1(e){let t=0;for(const n in e){if(n==="$ref")return 1/0;if(t++,!hM.has(n)&&(typeof e[n]=="object"&&(0,cM.eachItem)(e[n],r=>t+=I1(r)),t===1/0))return 1/0}return t}function z1(e,t="",n){n!==!1&&(t=so(t));const r=e.parse(t);return R1(e,r)}Le.getFullPath=z1;function R1(e,t){return e.serialize(t).split("#")[0]+"#"}Le._getFullPath=R1;const gM=/#\/?$/;function so(e){return e?e.replace(gM,""):""}Le.normalizeId=so;function yM(e,t,n){return n=so(n),e.resolve(t,n)}Le.resolveUrl=yM;const vM=/^[a-z_][-a-z0-9._]*$/i;function wM(e,t){if(typeof e=="boolean")return{};const{schemaId:n,uriResolver:r}=this.opts,o=so(e[n]||t),i={"":o},s=z1(r,o,!1),a={},l=new Set;return fM(e,{allKeys:!0},(c,h,g,y)=>{if(y===void 0)return;const v=s+h;let w=i[y];typeof c[n]=="string"&&(w=f.call(this,c[n])),p.call(this,c.$anchor),p.call(this,c.$dynamicAnchor),i[h]=w;function f(m){const _=this.opts.uriResolver.resolve;if(m=so(w?_(w,m):m),l.has(m))throw d(m);l.add(m);let x=this.refs[m];return typeof x=="string"&&(x=this.refs[x]),typeof x=="object"?u(c,x.schema,m):m!==so(v)&&(m[0]==="#"?(u(c,a[m],m),a[m]=c):this.refs[m]=v),m}function p(m){if(typeof m=="string"){if(!vM.test(m))throw new Error(`invalid anchor "${m}"`);f.call(this,`#${m}`)}}}),a;function u(c,h,g){if(h!==void 0&&!dM(c,h))throw d(g)}function d(c){return new Error(`reference "${c}" resolves to more than one schema`)}}Le.getSchemaRefs=wM;Object.defineProperty(St,"__esModule",{value:!0});St.getData=St.KeywordCxt=St.validateFunctionCode=void 0;const A1=So,bm=Ie,cf=dn,Ua=Ie,_M=Sl,hi=Kt,vu=qn,J=oe,re=mt,$M=Le,fn=X,qo=rs;function xM(e){if(L1(e)&&(V1(e),D1(e))){kM(e);return}O1(e,()=>(0,A1.topBoolOrEmptySchema)(e))}St.validateFunctionCode=xM;function O1({gen:e,validateName:t,schema:n,schemaEnv:r,opts:o},i){o.code.es5?e.func(t,(0,J._)`${re.default.data}, ${re.default.valCxt}`,r.$async,()=>{e.code((0,J._)`"use strict"; ${jm(n,o)}`),EM(e,o),e.code(i)}):e.func(t,(0,J._)`${re.default.data}, ${SM(o)}`,r.$async,()=>e.code(jm(n,o)).code(i))}function SM(e){return(0,J._)`{${re.default.instancePath}="", ${re.default.parentData}, ${re.default.parentDataProperty}, ${re.default.rootData}=${re.default.data}${e.dynamicRef?(0,J._)`, ${re.default.dynamicAnchors}={}`:J.nil}}={}`}function EM(e,t){e.if(re.default.valCxt,()=>{e.var(re.default.instancePath,(0,J._)`${re.default.valCxt}.${re.default.instancePath}`),e.var(re.default.parentData,(0,J._)`${re.default.valCxt}.${re.default.parentData}`),e.var(re.default.parentDataProperty,(0,J._)`${re.default.valCxt}.${re.default.parentDataProperty}`),e.var(re.default.rootData,(0,J._)`${re.default.valCxt}.${re.default.rootData}`),t.dynamicRef&&e.var(re.default.dynamicAnchors,(0,J._)`${re.default.valCxt}.${re.default.dynamicAnchors}`)},()=>{e.var(re.default.instancePath,(0,J._)`""`),e.var(re.default.parentData,(0,J._)`undefined`),e.var(re.default.parentDataProperty,(0,J._)`undefined`),e.var(re.default.rootData,re.default.data),t.dynamicRef&&e.var(re.default.dynamicAnchors,(0,J._)`{}`)})}function kM(e){const{schema:t,opts:n,gen:r}=e;O1(e,()=>{n.$comment&&t.$comment&&H1(e),jM(e),r.let(re.default.vErrors,null),r.let(re.default.errors,0),n.unevaluated&&NM(e),F1(e),IM(e)})}function NM(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",(0,J._)`${n}.evaluated`),t.if((0,J._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,J._)`${e.evaluated}.props`,(0,J._)`undefined`)),t.if((0,J._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,J._)`${e.evaluated}.items`,(0,J._)`undefined`))}function jm(e,t){const n=typeof e=="object"&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,J._)`/*# sourceURL=${n} */`:J.nil}function PM(e,t){if(L1(e)&&(V1(e),D1(e))){CM(e,t);return}(0,A1.boolOrEmptySchema)(e,t)}function D1({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function L1(e){return typeof e.schema!="boolean"}function CM(e,t){const{schema:n,gen:r,opts:o}=e;o.$comment&&n.$comment&&H1(e),MM(e),TM(e);const i=r.const("_errs",re.default.errors);F1(e,i),r.var(t,(0,J._)`${i} === ${re.default.errors}`)}function V1(e){(0,fn.checkUnknownRules)(e),bM(e)}function F1(e,t){if(e.opts.jtd)return Mm(e,[],!1,t);const n=(0,bm.getSchemaTypes)(e.schema),r=(0,bm.coerceAndCheckDataType)(e,n);Mm(e,n,!r,t)}function bM(e){const{schema:t,errSchemaPath:n,opts:r,self:o}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,fn.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function jM(e){const{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,fn.checkStrictMode)(e,"default is ignored in the schema root")}function MM(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,$M.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function TM(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function H1({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:o}){const i=n.$comment;if(o.$comment===!0)e.code((0,J._)`${re.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){const s=(0,J.str)`${r}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,J._)`${re.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function IM(e){const{gen:t,schemaEnv:n,validateName:r,ValidationError:o,opts:i}=e;n.$async?t.if((0,J._)`${re.default.errors} === 0`,()=>t.return(re.default.data),()=>t.throw((0,J._)`new ${o}(${re.default.vErrors})`)):(t.assign((0,J._)`${r}.errors`,re.default.vErrors),i.unevaluated&&zM(e),t.return((0,J._)`${re.default.errors} === 0`))}function zM({gen:e,evaluated:t,props:n,items:r}){n instanceof J.Name&&e.assign((0,J._)`${t}.props`,n),r instanceof J.Name&&e.assign((0,J._)`${t}.items`,r)}function Mm(e,t,n,r){const{gen:o,schema:i,data:s,allErrors:a,opts:l,self:u}=e,{RULES:d}=u;if(i.$ref&&(l.ignoreKeywordsWithRef||!(0,fn.schemaHasRulesButRef)(i,d))){o.block(()=>W1(e,"$ref",d.all.$ref.definition));return}l.jtd||RM(e,t),o.block(()=>{for(const h of d.rules)c(h);c(d.post)});function c(h){(0,cf.shouldUseGroup)(i,h)&&(h.type?(o.if((0,Ua.checkDataType)(h.type,s,l.strictNumbers)),Tm(e,h),t.length===1&&t[0]===h.type&&n&&(o.else(),(0,Ua.reportTypeError)(e)),o.endIf()):Tm(e,h),a||o.if((0,J._)`${re.default.errors} === ${r||0}`))}}function Tm(e,t){const{gen:n,schema:r,opts:{useDefaults:o}}=e;o&&(0,_M.assignDefaults)(e,t.type),n.block(()=>{for(const i of t.rules)(0,cf.shouldUseRule)(r,i)&&W1(e,i.keyword,i.definition,t.type)})}function RM(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(AM(e,t),e.opts.allowUnionTypes||OM(e,t),DM(e,e.dataTypes))}function AM(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(n=>{U1(e.dataTypes,n)||df(e,`type "${n}" not allowed by context "${e.dataTypes.join(",")}"`)}),VM(e,t)}}function OM(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&df(e,"use allowUnionTypes to allow union type keyword")}function DM(e,t){const n=e.self.RULES.all;for(const r in n){const o=n[r];if(typeof o=="object"&&(0,cf.shouldUseRule)(e.schema,o)){const{type:i}=o.definition;i.length&&!i.some(s=>LM(t,s))&&df(e,`missing type "${i.join(",")}" for keyword "${r}"`)}}}function LM(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function U1(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function VM(e,t){const n=[];for(const r of e.dataTypes)U1(t,r)?n.push(r):t.includes("integer")&&r==="number"&&n.push("integer");e.dataTypes=n}function df(e,t){const n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,fn.checkStrictMode)(e,t,e.opts.strictTypes)}class B1{constructor(t,n,r){if((0,hi.validateKeywordUsage)(t,n,r),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=r,this.data=t.data,this.schema=t.schema[r],this.$data=n.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,fn.schemaRefOrVal)(t,this.schema,r,this.$data),this.schemaType=n.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=n,this.$data)this.schemaCode=t.gen.const("vSchema",q1(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,hi.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=t.gen.const("_errs",re.default.errors))}result(t,n,r){this.failResult((0,J.not)(t),n,r)}failResult(t,n,r){this.gen.if(t),r?r():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,n){this.failResult((0,J.not)(t),void 0,n)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:n}=this;this.fail((0,J._)`${n} !== undefined && (${(0,J.or)(this.invalid$data(),t)})`)}error(t,n,r){if(n){this.setParams(n),this._error(t,r),this.setParams({});return}this._error(t,r)}_error(t,n){(t?qo.reportExtraError:qo.reportError)(this,this.def.error,n)}$dataError(){(0,qo.reportError)(this,this.def.$dataError||qo.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,qo.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,n){n?Object.assign(this.params,t):this.params=t}block$data(t,n,r=J.nil){this.gen.block(()=>{this.check$data(t,r),n()})}check$data(t=J.nil,n=J.nil){if(!this.$data)return;const{gen:r,schemaCode:o,schemaType:i,def:s}=this;r.if((0,J.or)((0,J._)`${o} === undefined`,n)),t!==J.nil&&r.assign(t,!0),(i.length||s.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),t!==J.nil&&r.assign(t,!1)),r.else()}invalid$data(){const{gen:t,schemaCode:n,schemaType:r,def:o,it:i}=this;return(0,J.or)(s(),a());function s(){if(r.length){if(!(n instanceof J.Name))throw new Error("ajv implementation error");const l=Array.isArray(r)?r:[r];return(0,J._)`${(0,Ua.checkDataTypes)(l,n,i.opts.strictNumbers,Ua.DataType.Wrong)}`}return J.nil}function a(){if(o.validateSchema){const l=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,J._)`!${l}(${n})`}return J.nil}}subschema(t,n){const r=(0,vu.getSubschema)(this.it,t);(0,vu.extendSubschemaData)(r,this.it,t),(0,vu.extendSubschemaMode)(r,t);const o={...this.it,...r,items:void 0,props:void 0};return PM(o,n),o}mergeEvaluated(t,n){const{it:r,gen:o}=this;r.opts.unevaluated&&(r.props!==!0&&t.props!==void 0&&(r.props=fn.mergeEvaluated.props(o,t.props,r.props,n)),r.items!==!0&&t.items!==void 0&&(r.items=fn.mergeEvaluated.items(o,t.items,r.items,n)))}mergeValidEvaluated(t,n){const{it:r,gen:o}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return o.if(n,()=>this.mergeEvaluated(t,J.Name)),!0}}St.KeywordCxt=B1;function W1(e,t,n,r){const o=new B1(e,n,t);"code"in n?n.code(o,r):o.$data&&n.validate?(0,hi.funcKeywordCode)(o,n):"macro"in n?(0,hi.macroKeywordCode)(o,n):(n.compile||n.validate)&&(0,hi.funcKeywordCode)(o,n)}const FM=/^\/(?:[^~]|~0|~1)*$/,HM=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function q1(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let o,i;if(e==="")return re.default.rootData;if(e[0]==="/"){if(!FM.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=re.default.rootData}else{const u=HM.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);const d=+u[1];if(o=u[2],o==="#"){if(d>=t)throw new Error(l("property/index",d));return r[t-d]}if(d>t)throw new Error(l("data",d));if(i=n[t-d],!o)return i}let s=i;const a=o.split("/");for(const u of a)u&&(i=(0,J._)`${i}${(0,J.getProperty)((0,fn.unescapeJsonPointer)(u))}`,s=(0,J._)`${s} && ${i}`);return s;function l(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}St.getData=q1;var bo={};Object.defineProperty(bo,"__esModule",{value:!0});class UM extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}bo.default=UM;var jr={};Object.defineProperty(jr,"__esModule",{value:!0});const wu=Le;class BM extends Error{constructor(t,n,r,o){super(o||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,wu.resolveUrl)(t,n,r),this.missingSchema=(0,wu.normalizeId)((0,wu.getFullPath)(t,this.missingRef))}}jr.default=BM;var Xe={};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.resolveSchema=Xe.getCompilingSchema=Xe.resolveRef=Xe.compileSchema=Xe.SchemaEnv=void 0;const Ct=oe,WM=bo,Jn=mt,Rt=Le,Im=X,qM=St;class El{constructor(t){var n;this.refs={},this.dynamicAnchors={};let r;typeof t.schema=="object"&&(r=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(n=t.baseId)!==null&&n!==void 0?n:(0,Rt.normalizeId)(r==null?void 0:r[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=r==null?void 0:r.$async,this.refs={}}}Xe.SchemaEnv=El;function ff(e){const t=K1.call(this,e);if(t)return t;const n=(0,Rt.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:r,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new Ct.CodeGen(this.scope,{es5:r,lines:o,ownProperties:i});let a;e.$async&&(a=s.scopeValue("Error",{ref:WM.default,code:(0,Ct._)`require("ajv/dist/runtime/validation_error").default`}));const l=s.scopeName("validate");e.validateName=l;const u={gen:s,allErrors:this.opts.allErrors,data:Jn.default.data,parentData:Jn.default.parentData,parentDataProperty:Jn.default.parentDataProperty,dataNames:[Jn.default.data],dataPathArr:[Ct.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Ct.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:Ct.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Ct._)`""`,opts:this.opts,self:this};let d;try{this._compilations.add(e),(0,qM.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);const c=s.toString();d=`${s.scopeRefs(Jn.default.scope)}return ${c}`,this.opts.code.process&&(d=this.opts.code.process(d,e));const g=new Function(`${Jn.default.self}`,`${Jn.default.scope}`,d)(this,this.scope.get());if(this.scope.value(l,{ref:g}),g.errors=null,g.schema=e.schema,g.schemaEnv=e,e.$async&&(g.$async=!0),this.opts.code.source===!0&&(g.source={validateName:l,validateCode:c,scopeValues:s._values}),this.opts.unevaluated){const{props:y,items:v}=u;g.evaluated={props:y instanceof Ct.Name?void 0:y,items:v instanceof Ct.Name?void 0:v,dynamicProps:y instanceof Ct.Name,dynamicItems:v instanceof Ct.Name},g.source&&(g.source.evaluated=(0,Ct.stringify)(g.evaluated))}return e.validate=g,e}catch(c){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),c}finally{this._compilations.delete(e)}}Xe.compileSchema=ff;function KM(e,t,n){var r;n=(0,Rt.resolveUrl)(this.opts.uriResolver,t,n);const o=e.refs[n];if(o)return o;let i=GM.call(this,e,n);if(i===void 0){const s=(r=e.localRefs)===null||r===void 0?void 0:r[n],{schemaId:a}=this.opts;s&&(i=new El({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[n]=YM.call(this,i)}Xe.resolveRef=KM;function YM(e){return(0,Rt.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:ff.call(this,e)}function K1(e){for(const t of this._compilations)if(XM(t,e))return t}Xe.getCompilingSchema=K1;function XM(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function GM(e,t){let n;for(;typeof(n=this.refs[t])=="string";)t=n;return n||this.schemas[t]||kl.call(this,e,t)}function kl(e,t){const n=this.opts.uriResolver.parse(t),r=(0,Rt._getFullPath)(this.opts.uriResolver,n);let o=(0,Rt.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===o)return _u.call(this,n,e);const i=(0,Rt.normalizeId)(r),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){const a=kl.call(this,e,s);return typeof(a==null?void 0:a.schema)!="object"?void 0:_u.call(this,n,a)}if(typeof(s==null?void 0:s.schema)=="object"){if(s.validate||ff.call(this,s),i===(0,Rt.normalizeId)(t)){const{schema:a}=s,{schemaId:l}=this.opts,u=a[l];return u&&(o=(0,Rt.resolveUrl)(this.opts.uriResolver,o,u)),new El({schema:a,schemaId:l,root:e,baseId:o})}return _u.call(this,n,s)}}Xe.resolveSchema=kl;const QM=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function _u(e,{baseId:t,schema:n,root:r}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(const a of e.fragment.slice(1).split("/")){if(typeof n=="boolean")return;const l=n[(0,Im.unescapeFragment)(a)];if(l===void 0)return;n=l;const u=typeof n=="object"&&n[this.opts.schemaId];!QM.has(a)&&u&&(t=(0,Rt.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof n!="boolean"&&n.$ref&&!(0,Im.schemaHasRulesButRef)(n,this.RULES)){const a=(0,Rt.resolveUrl)(this.opts.uriResolver,t,n.$ref);i=kl.call(this,r,a)}const{schemaId:s}=this.opts;if(i=i||new El({schema:n,schemaId:s,root:r,baseId:t}),i.schema!==i.root.schema)return i}const ZM="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",JM="Meta-schema for $data reference (JSON AnySchema extension proposal)",eT="object",tT=["$data"],nT={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},rT=!1,oT={$id:ZM,description:JM,type:eT,required:tT,properties:nT,additionalProperties:rT};var hf={},Nl={exports:{}};const iT=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Y1=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),pf=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),X1=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),sT=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function G1(e){let t="",n=0,r=0;for(r=0;r<e.length;r++)if(n=e[r].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r]}return t}const aT=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function zm(e){return e.length=0,!0}function lT(e,t,n){if(e.length){const r=G1(e);if(r!=="")t.push(r);else return n.error=!0,!1;e.length=0}return!0}function uT(e){let t=0;const n={error:!1,address:"",zone:""},r=[],o=[];let i=!1,s=!1,a=lT;for(let l=0;l<e.length;l++){const u=e[l];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(s=!0),!a(o,r,n))break;if(++t>7){n.error=!0;break}l>0&&e[l-1]===":"&&(i=!0),r.push(":");continue}else if(u==="%"){if(!a(o,r,n))break;a=zm}else{o.push(u);continue}}return o.length&&(a===zm?n.zone=o.join(""):s?r.push(o.join("")):r.push(G1(o))),n.address=r.join(""),n}function Q1(e){if(cT(e,":")<2)return{host:e,isIPV6:!1};const t=uT(e);if(t.error)return{host:e,isIPV6:!1};{let n=t.address,r=t.address;return t.zone&&(n+="%"+t.zone,r+="%25"+t.zone),{host:n,isIPV6:!0,escapedHost:r}}}function cT(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function dT(e){let t=e;const n=[];let r=-1,o=0;for(;o=t.length;){if(o===1){if(t===".")break;if(t==="/"){n.push("/");break}else{n.push(t);break}}else if(o===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){n.push("/");break}}else if(o===3&&t==="/.."){n.length!==0&&n.pop(),n.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),n.length!==0&&n.pop();continue}}if((r=t.indexOf("/",1))===-1){n.push(t);break}else n.push(t.slice(0,r)),t=t.slice(r)}return n.join("")}const fT={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},hT=/[@/?#:]/g,pT=/[@/?#]/g;function Z1(e,t){const n=t?pT:hT;return n.lastIndex=0,e.replace(n,r=>fT[r])}function mT(e,t=!1){if(e.indexOf("%")===-1)return e;let n="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){const o=e.slice(r+1,r+3);if(pf(o)){const i=o.toUpperCase(),s=String.fromCharCode(parseInt(i,16));t&&X1(s)?n+=s:n+="%"+i,r+=2;continue}}n+=e[r]}return n}function gT(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){const r=e.slice(n+1,n+3);if(pf(r)){const o=r.toUpperCase(),i=String.fromCharCode(parseInt(o,16));i!=="."&&X1(i)?t+=i:t+="%"+o,n+=2;continue}}sT(e[n])?t+=e[n]:t+=escape(e[n])}return t}function yT(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){const r=e.slice(n+1,n+3);if(pf(r)){t+="%"+r.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function vT(e){const t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let n=unescape(e.host);if(!Y1(n)){const r=Q1(n);r.isIPV6===!0?n=`[${r.escapedHost}]`:n=Z1(n,!1)}t.push(n)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}var J1={nonSimpleDomain:aT,recomposeAuthority:vT,reescapeHostDelimiters:Z1,normalizePercentEncoding:mT,normalizePathEncoding:gT,escapePreservingEscapes:yT,removeDotSegments:dT,isIPv4:Y1,isUUID:iT,normalizeIPv6:Q1};const{isUUID:wT}=J1,_T=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function ew(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function tw(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function nw(e){const t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function $T(e){return e.secure=ew(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function xT(e){if((e.port===(ew(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,n]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function ST(e,t){if(!e.path)return e.error="URN can not be parsed",e;const n=e.path.match(_T);if(n){const r=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];const o=`${r}:${t.nid||e.nid}`,i=mf(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function ET(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");const n=t.scheme||e.scheme||"urn",r=e.nid.toLowerCase(),o=`${n}:${t.nid||r}`,i=mf(o);i&&(e=i.serialize(e,t));const s=e,a=e.nss;return s.path=`${r||t.nid}:${a}`,t.skipEscape=!0,s}function kT(e,t){const n=e;return n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!wT(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function NT(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const rw={scheme:"http",domainHost:!0,parse:tw,serialize:nw},PT={scheme:"https",domainHost:rw.domainHost,parse:tw,serialize:nw},oa={scheme:"ws",domainHost:!0,parse:$T,serialize:xT},CT={scheme:"wss",domainHost:oa.domainHost,parse:oa.parse,serialize:oa.serialize},bT={scheme:"urn",parse:ST,serialize:ET,skipNormalize:!0},jT={scheme:"urn:uuid",parse:kT,serialize:NT,skipNormalize:!0},Ba={http:rw,https:PT,ws:oa,wss:CT,urn:bT,"urn:uuid":jT};Object.setPrototypeOf(Ba,null);function mf(e){return e&&(Ba[e]||Ba[e.toLowerCase()])||void 0}var MT={SCHEMES:Ba,getSchemeHandler:mf};const{normalizeIPv6:TT,removeDotSegments:ei,recomposeAuthority:IT,normalizePercentEncoding:zT,normalizePathEncoding:RT,escapePreservingEscapes:AT,reescapeHostDelimiters:OT,isIPv4:DT,nonSimpleDomain:LT}=J1,{SCHEMES:VT,getSchemeHandler:ow}=MT;function FT(e,t){return typeof e=="string"?e=qT(e,t):typeof e=="object"&&(e=Eo(Nr(e,t),t)),e}function HT(e,t,n){const r=n?Object.assign({scheme:"null"},n):{scheme:"null"},o=iw(Eo(e,r),Eo(t,r),r,!0);return r.skipEscape=!0,Nr(o,r)}function iw(e,t,n,r){const o={};return r||(e=Eo(Nr(e,n),n),t=Eo(Nr(t,n),n)),n=n||{},!n.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=ei(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=ei(t.path||""),o.query=t.query):(t.path?(t.path[0]==="/"?o.path=ei(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=ei(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function UT(e,t,n){const r=Rm(e,n),o=Rm(t,n);return r!==void 0&&o!==void 0&&r.toLowerCase()===o.toLowerCase()}function Nr(e,t){const n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},r=Object.assign({},t),o=[],i=ow(r.scheme||n.scheme);i&&i.serialize&&i.serialize(n,r),n.path!==void 0&&(r.skipEscape?n.path=zT(n.path):(n.path=AT(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),r.reference!=="suffix"&&n.scheme&&o.push(n.scheme,":");const s=IT(n);if(s!==void 0&&(r.reference!=="suffix"&&o.push("//"),o.push(s),n.path&&n.path[0]!=="/"&&o.push("/")),n.path!==void 0){let a=n.path;!r.absolutePath&&(!i||!i.absolutePath)&&(a=ei(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),o.push(a)}return n.query!==void 0&&o.push("?",n.query),n.fragment!==void 0&&o.push("#",n.fragment),o.join("")}const BT=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function WT(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function sw(e,t){const n=Object.assign({},t),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let o=!1,i=!1;n.reference==="suffix"&&(n.scheme?e=n.scheme+":"+e:e="//"+e);const s=e.match(BT);if(s){r.scheme=s[1],r.userinfo=s[3],r.host=s[4],r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=s[7],r.fragment=s[8],isNaN(r.port)&&(r.port=s[5]);const a=WT(r,s);if(a!==void 0&&(r.error=r.error||a,o=!0),r.host)if(DT(r.host)===!1){const d=TT(r.host);r.host=d.host.toLowerCase(),i=d.isIPV6}else i=!0;r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path?r.reference="same-document":r.scheme===void 0?r.reference="relative":r.fragment===void 0?r.reference="absolute":r.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==r.reference&&(r.error=r.error||"URI is not a "+n.reference+" reference.");const l=ow(n.scheme||r.scheme);if(!n.unicodeSupport&&(!l||!l.unicodeSupport)&&r.host&&(n.domainHost||l&&l.domainHost)&&i===!1&<(r.host))try{r.host=URL.domainToASCII(r.host.toLowerCase())}catch(u){r.error=r.error||"Host's domain name can not be converted to ASCII: "+u}if((!l||l&&!l.skipNormalize)&&(e.indexOf("%")!==-1&&(r.scheme!==void 0&&(r.scheme=unescape(r.scheme)),r.host!==void 0&&(r.host=OT(unescape(r.host),i))),r.path&&(r.path=RT(r.path)),r.fragment))try{r.fragment=encodeURI(decodeURIComponent(r.fragment))}catch{r.error=r.error||"URI malformed"}l&&l.parse&&l.parse(r,n)}else r.error=r.error||"URI can not be parsed.";return{parsed:r,malformedAuthorityOrPort:o}}function Eo(e,t){return sw(e,t).parsed}function qT(e,t){return aw(e,t).normalized}function aw(e,t){const{parsed:n,malformedAuthorityOrPort:r}=sw(e,t);return{normalized:r?e:Nr(n,t),malformedAuthorityOrPort:r}}function Rm(e,t){if(typeof e=="string"){const{normalized:n,malformedAuthorityOrPort:r}=aw(e,t);return r?void 0:n}if(typeof e=="object")return Nr(e,t)}const gf={SCHEMES:VT,normalize:FT,resolve:HT,resolveComponent:iw,equal:UT,serialize:Nr,parse:Eo};Nl.exports=gf;Nl.exports.default=gf;Nl.exports.fastUri=gf;var KT=Nl.exports;Object.defineProperty(hf,"__esModule",{value:!0});const lw=KT;lw.code='require("ajv/dist/runtime/uri").default';hf.default=lw;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=St;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=oe;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=bo,o=jr,i=kr,s=Xe,a=oe,l=Le,u=Ie,d=X,c=oT,h=hf,g=(b,E)=>new RegExp(b,E);g.code="new RegExp";const y=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),w={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},f={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},p=200;function m(b){var E,j,R,$,P,V,q,B,Y,G,Z,te,ne,ue,fe,le,be,gt,st,Nt,Jt,en,tn,Zn,$n;const yt=b.strict,nn=(E=b.code)===null||E===void 0?void 0:E.optimize,zo=nn===!0||nn===void 0?1:nn||0,is=(R=(j=b.code)===null||j===void 0?void 0:j.regExp)!==null&&R!==void 0?R:g,Ro=($=b.uriResolver)!==null&&$!==void 0?$:h.default;return{strictSchema:(V=(P=b.strictSchema)!==null&&P!==void 0?P:yt)!==null&&V!==void 0?V:!0,strictNumbers:(B=(q=b.strictNumbers)!==null&&q!==void 0?q:yt)!==null&&B!==void 0?B:!0,strictTypes:(G=(Y=b.strictTypes)!==null&&Y!==void 0?Y:yt)!==null&&G!==void 0?G:"log",strictTuples:(te=(Z=b.strictTuples)!==null&&Z!==void 0?Z:yt)!==null&&te!==void 0?te:"log",strictRequired:(ue=(ne=b.strictRequired)!==null&&ne!==void 0?ne:yt)!==null&&ue!==void 0?ue:!1,code:b.code?{...b.code,optimize:zo,regExp:is}:{optimize:zo,regExp:is},loopRequired:(fe=b.loopRequired)!==null&&fe!==void 0?fe:p,loopEnum:(le=b.loopEnum)!==null&&le!==void 0?le:p,meta:(be=b.meta)!==null&&be!==void 0?be:!0,messages:(gt=b.messages)!==null&>!==void 0?gt:!0,inlineRefs:(st=b.inlineRefs)!==null&&st!==void 0?st:!0,schemaId:(Nt=b.schemaId)!==null&&Nt!==void 0?Nt:"$id",addUsedSchema:(Jt=b.addUsedSchema)!==null&&Jt!==void 0?Jt:!0,validateSchema:(en=b.validateSchema)!==null&&en!==void 0?en:!0,validateFormats:(tn=b.validateFormats)!==null&&tn!==void 0?tn:!0,unicodeRegExp:(Zn=b.unicodeRegExp)!==null&&Zn!==void 0?Zn:!0,int32range:($n=b.int32range)!==null&&$n!==void 0?$n:!0,uriResolver:Ro}}class _{constructor(E={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,E=this.opts={...E,...m(E)};const{es5:j,lines:R}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:v,es5:j,lines:R}),this.logger=O(E.logger);const $=E.validateFormats;E.validateFormats=!1,this.RULES=(0,i.getRules)(),x.call(this,w,E,"NOT SUPPORTED"),x.call(this,f,E,"DEPRECATED","warn"),this._metaOpts=U.call(this),E.formats&&I.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),E.keywords&&L.call(this,E.keywords),typeof E.meta=="object"&&this.addMetaSchema(E.meta),C.call(this),E.validateFormats=$}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:E,meta:j,schemaId:R}=this.opts;let $=c;R==="id"&&($={...c},$.id=$.$id,delete $.$id),j&&E&&this.addMetaSchema($,$[R],!1)}defaultMeta(){const{meta:E,schemaId:j}=this.opts;return this.opts.defaultMeta=typeof E=="object"?E[j]||E:void 0}validate(E,j){let R;if(typeof E=="string"){if(R=this.getSchema(E),!R)throw new Error(`no schema with key or ref "${E}"`)}else R=this.compile(E);const $=R(j);return"$async"in R||(this.errors=R.errors),$}compile(E,j){const R=this._addSchema(E,j);return R.validate||this._compileSchemaEnv(R)}compileAsync(E,j){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:R}=this.opts;return $.call(this,E,j);async function $(G,Z){await P.call(this,G.$schema);const te=this._addSchema(G,Z);return te.validate||V.call(this,te)}async function P(G){G&&!this.getSchema(G)&&await $.call(this,{$ref:G},!0)}async function V(G){try{return this._compileSchemaEnv(G)}catch(Z){if(!(Z instanceof o.default))throw Z;return q.call(this,Z),await B.call(this,Z.missingSchema),V.call(this,G)}}function q({missingSchema:G,missingRef:Z}){if(this.refs[G])throw new Error(`AnySchema ${G} is loaded but ${Z} cannot be resolved`)}async function B(G){const Z=await Y.call(this,G);this.refs[G]||await P.call(this,Z.$schema),this.refs[G]||this.addSchema(Z,G,j)}async function Y(G){const Z=this._loading[G];if(Z)return Z;try{return await(this._loading[G]=R(G))}finally{delete this._loading[G]}}}addSchema(E,j,R,$=this.opts.validateSchema){if(Array.isArray(E)){for(const V of E)this.addSchema(V,void 0,R,$);return this}let P;if(typeof E=="object"){const{schemaId:V}=this.opts;if(P=E[V],P!==void 0&&typeof P!="string")throw new Error(`schema ${V} must be string`)}return j=(0,l.normalizeId)(j||P),this._checkUnique(j),this.schemas[j]=this._addSchema(E,R,j,$,!0),this}addMetaSchema(E,j,R=this.opts.validateSchema){return this.addSchema(E,j,!0,R),this}validateSchema(E,j){if(typeof E=="boolean")return!0;let R;if(R=E.$schema,R!==void 0&&typeof R!="string")throw new Error("$schema must be a string");if(R=R||this.opts.defaultMeta||this.defaultMeta(),!R)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const $=this.validate(R,E);if(!$&&j){const P="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(P);else throw new Error(P)}return $}getSchema(E){let j;for(;typeof(j=k.call(this,E))=="string";)E=j;if(j===void 0){const{schemaId:R}=this.opts,$=new s.SchemaEnv({schema:{},schemaId:R});if(j=s.resolveSchema.call(this,$,E),!j)return;this.refs[E]=j}return j.validate||this._compileSchemaEnv(j)}removeSchema(E){if(E instanceof RegExp)return this._removeAllSchemas(this.schemas,E),this._removeAllSchemas(this.refs,E),this;switch(typeof E){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const j=k.call(this,E);return typeof j=="object"&&this._cache.delete(j.schema),delete this.schemas[E],delete this.refs[E],this}case"object":{const j=E;this._cache.delete(j);let R=E[this.opts.schemaId];return R&&(R=(0,l.normalizeId)(R),delete this.schemas[R],delete this.refs[R]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(E){for(const j of E)this.addKeyword(j);return this}addKeyword(E,j){let R;if(typeof E=="string")R=E,typeof j=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),j.keyword=R);else if(typeof E=="object"&&j===void 0){if(j=E,R=j.keyword,Array.isArray(R)&&!R.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(N.call(this,R,j),!j)return(0,d.eachItem)(R,P=>F.call(this,P)),this;H.call(this,j);const $={...j,type:(0,u.getJSONTypes)(j.type),schemaType:(0,u.getJSONTypes)(j.schemaType)};return(0,d.eachItem)(R,$.type.length===0?P=>F.call(this,P,$):P=>$.type.forEach(V=>F.call(this,P,$,V))),this}getKeyword(E){const j=this.RULES.all[E];return typeof j=="object"?j.definition:!!j}removeKeyword(E){const{RULES:j}=this;delete j.keywords[E],delete j.all[E];for(const R of j.rules){const $=R.rules.findIndex(P=>P.keyword===E);$>=0&&R.rules.splice($,1)}return this}addFormat(E,j){return typeof j=="string"&&(j=new RegExp(j)),this.formats[E]=j,this}errorsText(E=this.errors,{separator:j=", ",dataVar:R="data"}={}){return!E||E.length===0?"No errors":E.map($=>`${R}${$.instancePath} ${$.message}`).reduce(($,P)=>$+j+P)}$dataMetaSchema(E,j){const R=this.RULES.all;E=JSON.parse(JSON.stringify(E));for(const $ of j){const P=$.split("/").slice(1);let V=E;for(const q of P)V=V[q];for(const q in R){const B=R[q];if(typeof B!="object")continue;const{$data:Y}=B.definition,G=V[q];Y&&G&&(V[q]=z(G))}}return E}_removeAllSchemas(E,j){for(const R in E){const $=E[R];(!j||j.test(R))&&(typeof $=="string"?delete E[R]:$&&!$.meta&&(this._cache.delete($.schema),delete E[R]))}}_addSchema(E,j,R,$=this.opts.validateSchema,P=this.opts.addUsedSchema){let V;const{schemaId:q}=this.opts;if(typeof E=="object")V=E[q];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof E!="boolean")throw new Error("schema must be object or boolean")}let B=this._cache.get(E);if(B!==void 0)return B;R=(0,l.normalizeId)(V||R);const Y=l.getSchemaRefs.call(this,E,R);return B=new s.SchemaEnv({schema:E,schemaId:q,meta:j,baseId:R,localRefs:Y}),this._cache.set(B.schema,B),P&&!R.startsWith("#")&&(R&&this._checkUnique(R),this.refs[R]=B),$&&this.validateSchema(E,!0),B}_checkUnique(E){if(this.schemas[E]||this.refs[E])throw new Error(`schema with key or id "${E}" already exists`)}_compileSchemaEnv(E){if(E.meta?this._compileMetaSchema(E):s.compileSchema.call(this,E),!E.validate)throw new Error("ajv implementation error");return E.validate}_compileMetaSchema(E){const j=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,E)}finally{this.opts=j}}}_.ValidationError=r.default,_.MissingRefError=o.default,e.default=_;function x(b,E,j,R="error"){for(const $ in b){const P=$;P in E&&this.logger[R](`${j}: option ${$}. ${b[P]}`)}}function k(b){return b=(0,l.normalizeId)(b),this.schemas[b]||this.refs[b]}function C(){const b=this.opts.schemas;if(b)if(Array.isArray(b))this.addSchema(b);else for(const E in b)this.addSchema(b[E],E)}function I(){for(const b in this.opts.formats){const E=this.opts.formats[b];E&&this.addFormat(b,E)}}function L(b){if(Array.isArray(b)){this.addVocabulary(b);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const E in b){const j=b[E];j.keyword||(j.keyword=E),this.addKeyword(j)}}function U(){const b={...this.opts};for(const E of y)delete b[E];return b}const T={log(){},warn(){},error(){}};function O(b){if(b===!1)return T;if(b===void 0)return console;if(b.log&&b.warn&&b.error)return b;throw new Error("logger must implement log, warn and error methods")}const W=/^[a-z_$][a-z0-9_$:-]*$/i;function N(b,E){const{RULES:j}=this;if((0,d.eachItem)(b,R=>{if(j.keywords[R])throw new Error(`Keyword ${R} is already defined`);if(!W.test(R))throw new Error(`Keyword ${R} has invalid name`)}),!!E&&E.$data&&!("code"in E||"validate"in E))throw new Error('$data keyword must have "code" or "validate" function')}function F(b,E,j){var R;const $=E==null?void 0:E.post;if(j&&$)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:P}=this;let V=$?P.post:P.rules.find(({type:B})=>B===j);if(V||(V={type:j,rules:[]},P.rules.push(V)),P.keywords[b]=!0,!E)return;const q={keyword:b,definition:{...E,type:(0,u.getJSONTypes)(E.type),schemaType:(0,u.getJSONTypes)(E.schemaType)}};E.before?A.call(this,V,q,E.before):V.rules.push(q),P.all[b]=q,(R=E.implements)===null||R===void 0||R.forEach(B=>this.addKeyword(B))}function A(b,E,j){const R=b.rules.findIndex($=>$.keyword===j);R>=0?b.rules.splice(R,0,E):(b.rules.push(E),this.logger.warn(`rule ${j} is not defined`))}function H(b){let{metaSchema:E}=b;E!==void 0&&(b.$data&&this.opts.$data&&(E=z(E)),b.validateSchema=this.compile(E,!0))}const M={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function z(b){return{anyOf:[b,M]}}})(tf);var yf={},Pl={},vf={};Object.defineProperty(vf,"__esModule",{value:!0});const YT={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};vf.default=YT;var vn={};Object.defineProperty(vn,"__esModule",{value:!0});vn.callRef=vn.getValidate=void 0;const XT=jr,Am=se,Je=oe,zr=mt,Om=Xe,Is=X,GT={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:r}=e,{baseId:o,schemaEnv:i,validateName:s,opts:a,self:l}=r,{root:u}=i;if((n==="#"||n==="#/")&&o===u.baseId)return c();const d=Om.resolveRef.call(l,u,o,n);if(d===void 0)throw new XT.default(r.opts.uriResolver,o,n);if(d instanceof Om.SchemaEnv)return h(d);return g(d);function c(){if(i===u)return ia(e,s,i,i.$async);const y=t.scopeValue("root",{ref:u});return ia(e,(0,Je._)`${y}.validate`,u,u.$async)}function h(y){const v=uw(e,y);ia(e,v,y,y.$async)}function g(y){const v=t.scopeValue("schema",a.code.source===!0?{ref:y,code:(0,Je.stringify)(y)}:{ref:y}),w=t.name("valid"),f=e.subschema({schema:y,dataTypes:[],schemaPath:Je.nil,topSchemaRef:v,errSchemaPath:n},w);e.mergeEvaluated(f),e.ok(w)}}};function uw(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):(0,Je._)`${n.scopeValue("wrapper",{ref:t})}.validate`}vn.getValidate=uw;function ia(e,t,n,r){const{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:l}=i,u=l.passContext?zr.default.this:Je.nil;r?d():c();function d(){if(!a.$async)throw new Error("async schema referenced by sync schema");const y=o.let("valid");o.try(()=>{o.code((0,Je._)`await ${(0,Am.callValidateCode)(e,t,u)}`),g(t),s||o.assign(y,!0)},v=>{o.if((0,Je._)`!(${v} instanceof ${i.ValidationError})`,()=>o.throw(v)),h(v),s||o.assign(y,!1)}),e.ok(y)}function c(){e.result((0,Am.callValidateCode)(e,t,u),()=>g(t),()=>h(t))}function h(y){const v=(0,Je._)`${y}.errors`;o.assign(zr.default.vErrors,(0,Je._)`${zr.default.vErrors} === null ? ${v} : ${zr.default.vErrors}.concat(${v})`),o.assign(zr.default.errors,(0,Je._)`${zr.default.vErrors}.length`)}function g(y){var v;if(!i.opts.unevaluated)return;const w=(v=n==null?void 0:n.validate)===null||v===void 0?void 0:v.evaluated;if(i.props!==!0)if(w&&!w.dynamicProps)w.props!==void 0&&(i.props=Is.mergeEvaluated.props(o,w.props,i.props));else{const f=o.var("props",(0,Je._)`${y}.evaluated.props`);i.props=Is.mergeEvaluated.props(o,f,i.props,Je.Name)}if(i.items!==!0)if(w&&!w.dynamicItems)w.items!==void 0&&(i.items=Is.mergeEvaluated.items(o,w.items,i.items));else{const f=o.var("items",(0,Je._)`${y}.evaluated.items`);i.items=Is.mergeEvaluated.items(o,f,i.items,Je.Name)}}}vn.callRef=ia;vn.default=GT;Object.defineProperty(Pl,"__esModule",{value:!0});const QT=vf,ZT=vn,JT=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",QT.default,ZT.default];Pl.default=JT;var Cl={},wf={};Object.defineProperty(wf,"__esModule",{value:!0});const Wa=oe,Nn=Wa.operators,qa={maximum:{okStr:"<=",ok:Nn.LTE,fail:Nn.GT},minimum:{okStr:">=",ok:Nn.GTE,fail:Nn.LT},exclusiveMaximum:{okStr:"<",ok:Nn.LT,fail:Nn.GTE},exclusiveMinimum:{okStr:">",ok:Nn.GT,fail:Nn.LTE}},eI={message:({keyword:e,schemaCode:t})=>(0,Wa.str)`must be ${qa[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Wa._)`{comparison: ${qa[e].okStr}, limit: ${t}}`},tI={keyword:Object.keys(qa),type:"number",schemaType:"number",$data:!0,error:eI,code(e){const{keyword:t,data:n,schemaCode:r}=e;e.fail$data((0,Wa._)`${n} ${qa[t].fail} ${r} || isNaN(${n})`)}};wf.default=tI;var _f={};Object.defineProperty(_f,"__esModule",{value:!0});const pi=oe,nI={message:({schemaCode:e})=>(0,pi.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,pi._)`{multipleOf: ${e}}`},rI={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:nI,code(e){const{gen:t,data:n,schemaCode:r,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,pi._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,pi._)`${s} !== parseInt(${s})`;e.fail$data((0,pi._)`(${r} === 0 || (${s} = ${n}/${r}, ${a}))`)}};_f.default=rI;var $f={},xf={};Object.defineProperty(xf,"__esModule",{value:!0});function cw(e){const t=e.length;let n=0,r=0,o;for(;r<t;)n++,o=e.charCodeAt(r++),o>=55296&&o<=56319&&r<t&&(o=e.charCodeAt(r),(o&64512)===56320&&r++);return n}xf.default=cw;cw.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty($f,"__esModule",{value:!0});const or=oe,oI=X,iI=xf,sI={message({keyword:e,schemaCode:t}){const n=e==="maxLength"?"more":"fewer";return(0,or.str)`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>(0,or._)`{limit: ${e}}`},aI={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:sI,code(e){const{keyword:t,data:n,schemaCode:r,it:o}=e,i=t==="maxLength"?or.operators.GT:or.operators.LT,s=o.opts.unicode===!1?(0,or._)`${n}.length`:(0,or._)`${(0,oI.useFunc)(e.gen,iI.default)}(${n})`;e.fail$data((0,or._)`${s} ${i} ${r}`)}};$f.default=aI;var Sf={};Object.defineProperty(Sf,"__esModule",{value:!0});const lI=se,uI=X,Gr=oe,cI={message:({schemaCode:e})=>(0,Gr.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Gr._)`{pattern: ${e}}`},dI={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:cI,code(e){const{gen:t,data:n,$data:r,schema:o,schemaCode:i,it:s}=e,a=s.opts.unicodeRegExp?"u":"";if(r){const{regExp:l}=s.opts.code,u=l.code==="new RegExp"?(0,Gr._)`new RegExp`:(0,uI.useFunc)(t,l),d=t.let("valid");t.try(()=>t.assign(d,(0,Gr._)`${u}(${i}, ${a}).test(${n})`),()=>t.assign(d,!1)),e.fail$data((0,Gr._)`!${d}`)}else{const l=(0,lI.usePattern)(e,o);e.fail$data((0,Gr._)`!${l}.test(${n})`)}}};Sf.default=dI;var Ef={};Object.defineProperty(Ef,"__esModule",{value:!0});const mi=oe,fI={message({keyword:e,schemaCode:t}){const n=e==="maxProperties"?"more":"fewer";return(0,mi.str)`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>(0,mi._)`{limit: ${e}}`},hI={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:fI,code(e){const{keyword:t,data:n,schemaCode:r}=e,o=t==="maxProperties"?mi.operators.GT:mi.operators.LT;e.fail$data((0,mi._)`Object.keys(${n}).length ${o} ${r}`)}};Ef.default=hI;var kf={};Object.defineProperty(kf,"__esModule",{value:!0});const Ko=se,gi=oe,pI=X,mI={message:({params:{missingProperty:e}})=>(0,gi.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,gi._)`{missingProperty: ${e}}`},gI={keyword:"required",type:"object",schemaType:"array",$data:!0,error:mI,code(e){const{gen:t,schema:n,schemaCode:r,data:o,$data:i,it:s}=e,{opts:a}=s;if(!i&&n.length===0)return;const l=n.length>=a.loopRequired;if(s.allErrors?u():d(),a.strictRequired){const g=e.parentSchema.properties,{definedProperties:y}=e.it;for(const v of n)if((g==null?void 0:g[v])===void 0&&!y.has(v)){const w=s.schemaEnv.baseId+s.errSchemaPath,f=`required property "${v}" is not defined at "${w}" (strictRequired)`;(0,pI.checkStrictMode)(s,f,s.opts.strictRequired)}}function u(){if(l||i)e.block$data(gi.nil,c);else for(const g of n)(0,Ko.checkReportMissingProp)(e,g)}function d(){const g=t.let("missing");if(l||i){const y=t.let("valid",!0);e.block$data(y,()=>h(g,y)),e.ok(y)}else t.if((0,Ko.checkMissingProp)(e,n,g)),(0,Ko.reportMissingProp)(e,g),t.else()}function c(){t.forOf("prop",r,g=>{e.setParams({missingProperty:g}),t.if((0,Ko.noPropertyInData)(t,o,g,a.ownProperties),()=>e.error())})}function h(g,y){e.setParams({missingProperty:g}),t.forOf(g,r,()=>{t.assign(y,(0,Ko.propertyInData)(t,o,g,a.ownProperties)),t.if((0,gi.not)(y),()=>{e.error(),t.break()})},gi.nil)}}};kf.default=gI;var Nf={};Object.defineProperty(Nf,"__esModule",{value:!0});const yi=oe,yI={message({keyword:e,schemaCode:t}){const n=e==="maxItems"?"more":"fewer";return(0,yi.str)`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>(0,yi._)`{limit: ${e}}`},vI={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:yI,code(e){const{keyword:t,data:n,schemaCode:r}=e,o=t==="maxItems"?yi.operators.GT:yi.operators.LT;e.fail$data((0,yi._)`${n}.length ${o} ${r}`)}};Nf.default=vI;var Pf={},os={};Object.defineProperty(os,"__esModule",{value:!0});const dw=M1;dw.code='require("ajv/dist/runtime/equal").default';os.default=dw;Object.defineProperty(Pf,"__esModule",{value:!0});const $u=Ie,Oe=oe,wI=X,_I=os,$I={message:({params:{i:e,j:t}})=>(0,Oe.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Oe._)`{i: ${e}, j: ${t}}`},xI={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:$I,code(e){const{gen:t,data:n,$data:r,schema:o,parentSchema:i,schemaCode:s,it:a}=e;if(!r&&!o)return;const l=t.let("valid"),u=i.items?(0,$u.getSchemaTypes)(i.items):[];e.block$data(l,d,(0,Oe._)`${s} === false`),e.ok(l);function d(){const y=t.let("i",(0,Oe._)`${n}.length`),v=t.let("j");e.setParams({i:y,j:v}),t.assign(l,!0),t.if((0,Oe._)`${y} > 1`,()=>(c()?h:g)(y,v))}function c(){return u.length>0&&!u.some(y=>y==="object"||y==="array")}function h(y,v){const w=t.name("item"),f=(0,$u.checkDataTypes)(u,w,a.opts.strictNumbers,$u.DataType.Wrong),p=t.const("indices",(0,Oe._)`{}`);t.for((0,Oe._)`;${y}--;`,()=>{t.let(w,(0,Oe._)`${n}[${y}]`),t.if(f,(0,Oe._)`continue`),u.length>1&&t.if((0,Oe._)`typeof ${w} == "string"`,(0,Oe._)`${w} += "_"`),t.if((0,Oe._)`typeof ${p}[${w}] == "number"`,()=>{t.assign(v,(0,Oe._)`${p}[${w}]`),e.error(),t.assign(l,!1).break()}).code((0,Oe._)`${p}[${w}] = ${y}`)})}function g(y,v){const w=(0,wI.useFunc)(t,_I.default),f=t.name("outer");t.label(f).for((0,Oe._)`;${y}--;`,()=>t.for((0,Oe._)`${v} = ${y}; ${v}--;`,()=>t.if((0,Oe._)`${w}(${n}[${y}], ${n}[${v}])`,()=>{e.error(),t.assign(l,!1).break(f)})))}}};Pf.default=xI;var Cf={};Object.defineProperty(Cf,"__esModule",{value:!0});const Oc=oe,SI=X,EI=os,kI={message:"must be equal to constant",params:({schemaCode:e})=>(0,Oc._)`{allowedValue: ${e}}`},NI={keyword:"const",$data:!0,error:kI,code(e){const{gen:t,data:n,$data:r,schemaCode:o,schema:i}=e;r||i&&typeof i=="object"?e.fail$data((0,Oc._)`!${(0,SI.useFunc)(t,EI.default)}(${n}, ${o})`):e.fail((0,Oc._)`${i} !== ${n}`)}};Cf.default=NI;var bf={};Object.defineProperty(bf,"__esModule",{value:!0});const ti=oe,PI=X,CI=os,bI={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,ti._)`{allowedValues: ${e}}`},jI={keyword:"enum",schemaType:"array",$data:!0,error:bI,code(e){const{gen:t,data:n,$data:r,schema:o,schemaCode:i,it:s}=e;if(!r&&o.length===0)throw new Error("enum must have non-empty array");const a=o.length>=s.opts.loopEnum;let l;const u=()=>l??(l=(0,PI.useFunc)(t,CI.default));let d;if(a||r)d=t.let("valid"),e.block$data(d,c);else{if(!Array.isArray(o))throw new Error("ajv implementation error");const g=t.const("vSchema",i);d=(0,ti.or)(...o.map((y,v)=>h(g,v)))}e.pass(d);function c(){t.assign(d,!1),t.forOf("v",i,g=>t.if((0,ti._)`${u()}(${n}, ${g})`,()=>t.assign(d,!0).break()))}function h(g,y){const v=o[y];return typeof v=="object"&&v!==null?(0,ti._)`${u()}(${n}, ${g}[${y}])`:(0,ti._)`${n} === ${v}`}}};bf.default=jI;Object.defineProperty(Cl,"__esModule",{value:!0});const MI=wf,TI=_f,II=$f,zI=Sf,RI=Ef,AI=kf,OI=Nf,DI=Pf,LI=Cf,VI=bf,FI=[MI.default,TI.default,II.default,zI.default,RI.default,AI.default,OI.default,DI.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},LI.default,VI.default];Cl.default=FI;var bl={},jo={};Object.defineProperty(jo,"__esModule",{value:!0});jo.validateAdditionalItems=void 0;const ir=oe,Dc=X,HI={message:({params:{len:e}})=>(0,ir.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,ir._)`{limit: ${e}}`},UI={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:HI,code(e){const{parentSchema:t,it:n}=e,{items:r}=t;if(!Array.isArray(r)){(0,Dc.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}fw(e,r)}};function fw(e,t){const{gen:n,schema:r,data:o,keyword:i,it:s}=e;s.items=!0;const a=n.const("len",(0,ir._)`${o}.length`);if(r===!1)e.setParams({len:t.length}),e.pass((0,ir._)`${a} <= ${t.length}`);else if(typeof r=="object"&&!(0,Dc.alwaysValidSchema)(s,r)){const u=n.var("valid",(0,ir._)`${a} <= ${t.length}`);n.if((0,ir.not)(u),()=>l(u)),e.ok(u)}function l(u){n.forRange("i",t.length,a,d=>{e.subschema({keyword:i,dataProp:d,dataPropType:Dc.Type.Num},u),s.allErrors||n.if((0,ir.not)(u),()=>n.break())})}}jo.validateAdditionalItems=fw;jo.default=UI;var jf={},Mo={};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.validateTuple=void 0;const Dm=oe,sa=X,BI=se,WI={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return hw(e,"additionalItems",t);n.items=!0,!(0,sa.alwaysValidSchema)(n,t)&&e.ok((0,BI.validateArray)(e))}};function hw(e,t,n=e.schema){const{gen:r,parentSchema:o,data:i,keyword:s,it:a}=e;d(o),a.opts.unevaluated&&n.length&&a.items!==!0&&(a.items=sa.mergeEvaluated.items(r,n.length,a.items));const l=r.name("valid"),u=r.const("len",(0,Dm._)`${i}.length`);n.forEach((c,h)=>{(0,sa.alwaysValidSchema)(a,c)||(r.if((0,Dm._)`${u} > ${h}`,()=>e.subschema({keyword:s,schemaProp:h,dataProp:h},l)),e.ok(l))});function d(c){const{opts:h,errSchemaPath:g}=a,y=n.length,v=y===c.minItems&&(y===c.maxItems||c[t]===!1);if(h.strictTuples&&!v){const w=`"${s}" is ${y}-tuple, but minItems or maxItems/${t} are not specified or different at path "${g}"`;(0,sa.checkStrictMode)(a,w,h.strictTuples)}}}Mo.validateTuple=hw;Mo.default=WI;Object.defineProperty(jf,"__esModule",{value:!0});const qI=Mo,KI={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,qI.validateTuple)(e,"items")};jf.default=KI;var Mf={};Object.defineProperty(Mf,"__esModule",{value:!0});const Lm=oe,YI=X,XI=se,GI=jo,QI={message:({params:{len:e}})=>(0,Lm.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Lm._)`{limit: ${e}}`},ZI={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:QI,code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:o}=n;r.items=!0,!(0,YI.alwaysValidSchema)(r,t)&&(o?(0,GI.validateAdditionalItems)(e,o):e.ok((0,XI.validateArray)(e)))}};Mf.default=ZI;var Tf={};Object.defineProperty(Tf,"__esModule",{value:!0});const vt=oe,zs=X,JI={message:({params:{min:e,max:t}})=>t===void 0?(0,vt.str)`must contain at least ${e} valid item(s)`:(0,vt.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,vt._)`{minContains: ${e}}`:(0,vt._)`{minContains: ${e}, maxContains: ${t}}`},e4={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:JI,code(e){const{gen:t,schema:n,parentSchema:r,data:o,it:i}=e;let s,a;const{minContains:l,maxContains:u}=r;i.opts.next?(s=l===void 0?1:l,a=u):s=1;const d=t.const("len",(0,vt._)`${o}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,zs.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,zs.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,zs.alwaysValidSchema)(i,n)){let v=(0,vt._)`${d} >= ${s}`;a!==void 0&&(v=(0,vt._)`${v} && ${d} <= ${a}`),e.pass(v);return}i.items=!0;const c=t.name("valid");a===void 0&&s===1?g(c,()=>t.if(c,()=>t.break())):s===0?(t.let(c,!0),a!==void 0&&t.if((0,vt._)`${o}.length > 0`,h)):(t.let(c,!1),h()),e.result(c,()=>e.reset());function h(){const v=t.name("_valid"),w=t.let("count",0);g(v,()=>t.if(v,()=>y(w)))}function g(v,w){t.forRange("i",0,d,f=>{e.subschema({keyword:"contains",dataProp:f,dataPropType:zs.Type.Num,compositeRule:!0},v),w()})}function y(v){t.code((0,vt._)`${v}++`),a===void 0?t.if((0,vt._)`${v} >= ${s}`,()=>t.assign(c,!0).break()):(t.if((0,vt._)`${v} > ${a}`,()=>t.assign(c,!1).break()),s===1?t.assign(c,!0):t.if((0,vt._)`${v} >= ${s}`,()=>t.assign(c,!0)))}}};Tf.default=e4;var jl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=oe,n=X,r=se;e.error={message:({params:{property:l,depsCount:u,deps:d}})=>{const c=u===1?"property":"properties";return(0,t.str)`must have ${c} ${d} when property ${l} is present`},params:({params:{property:l,depsCount:u,deps:d,missingProperty:c}})=>(0,t._)`{property: ${l},
|
|
208
|
+
missingProperty: ${c},
|
|
209
|
+
depsCount: ${u},
|
|
210
|
+
deps: ${d}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(l){const[u,d]=i(l);s(l,u),a(l,d)}};function i({schema:l}){const u={},d={};for(const c in l){if(c==="__proto__")continue;const h=Array.isArray(l[c])?u:d;h[c]=l[c]}return[u,d]}function s(l,u=l.schema){const{gen:d,data:c,it:h}=l;if(Object.keys(u).length===0)return;const g=d.let("missing");for(const y in u){const v=u[y];if(v.length===0)continue;const w=(0,r.propertyInData)(d,c,y,h.opts.ownProperties);l.setParams({property:y,depsCount:v.length,deps:v.join(", ")}),h.allErrors?d.if(w,()=>{for(const f of v)(0,r.checkReportMissingProp)(l,f)}):(d.if((0,t._)`${w} && (${(0,r.checkMissingProp)(l,v,g)})`),(0,r.reportMissingProp)(l,g),d.else())}}e.validatePropertyDeps=s;function a(l,u=l.schema){const{gen:d,data:c,keyword:h,it:g}=l,y=d.name("valid");for(const v in u)(0,n.alwaysValidSchema)(g,u[v])||(d.if((0,r.propertyInData)(d,c,v,g.opts.ownProperties),()=>{const w=l.subschema({keyword:h,schemaProp:v},y);l.mergeValidEvaluated(w,y)},()=>d.var(y,!0)),l.ok(y))}e.validateSchemaDeps=a,e.default=o})(jl);var If={};Object.defineProperty(If,"__esModule",{value:!0});const pw=oe,t4=X,n4={message:"property name must be valid",params:({params:e})=>(0,pw._)`{propertyName: ${e.propertyName}}`},r4={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:n4,code(e){const{gen:t,schema:n,data:r,it:o}=e;if((0,t4.alwaysValidSchema)(o,n))return;const i=t.name("valid");t.forIn("key",r,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,pw.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};If.default=r4;var Ml={};Object.defineProperty(Ml,"__esModule",{value:!0});const Rs=se,bt=oe,o4=mt,As=X,i4={message:"must NOT have additional properties",params:({params:e})=>(0,bt._)`{additionalProperty: ${e.additionalProperty}}`},s4={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:i4,code(e){const{gen:t,schema:n,parentSchema:r,data:o,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");const{allErrors:a,opts:l}=s;if(s.props=!0,l.removeAdditional!=="all"&&(0,As.alwaysValidSchema)(s,n))return;const u=(0,Rs.allSchemaProperties)(r.properties),d=(0,Rs.allSchemaProperties)(r.patternProperties);c(),e.ok((0,bt._)`${i} === ${o4.default.errors}`);function c(){t.forIn("key",o,w=>{!u.length&&!d.length?y(w):t.if(h(w),()=>y(w))})}function h(w){let f;if(u.length>8){const p=(0,As.schemaRefOrVal)(s,r.properties,"properties");f=(0,Rs.isOwnProperty)(t,p,w)}else u.length?f=(0,bt.or)(...u.map(p=>(0,bt._)`${w} === ${p}`)):f=bt.nil;return d.length&&(f=(0,bt.or)(f,...d.map(p=>(0,bt._)`${(0,Rs.usePattern)(e,p)}.test(${w})`))),(0,bt.not)(f)}function g(w){t.code((0,bt._)`delete ${o}[${w}]`)}function y(w){if(l.removeAdditional==="all"||l.removeAdditional&&n===!1){g(w);return}if(n===!1){e.setParams({additionalProperty:w}),e.error(),a||t.break();return}if(typeof n=="object"&&!(0,As.alwaysValidSchema)(s,n)){const f=t.name("valid");l.removeAdditional==="failing"?(v(w,f,!1),t.if((0,bt.not)(f),()=>{e.reset(),g(w)})):(v(w,f),a||t.if((0,bt.not)(f),()=>t.break()))}}function v(w,f,p){const m={keyword:"additionalProperties",dataProp:w,dataPropType:As.Type.Str};p===!1&&Object.assign(m,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(m,f)}}};Ml.default=s4;var zf={};Object.defineProperty(zf,"__esModule",{value:!0});const a4=St,Vm=se,xu=X,Fm=Ml,l4={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:r,data:o,it:i}=e;i.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&Fm.default.code(new a4.KeywordCxt(i,Fm.default,"additionalProperties"));const s=(0,Vm.allSchemaProperties)(n);for(const c of s)i.definedProperties.add(c);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=xu.mergeEvaluated.props(t,(0,xu.toHash)(s),i.props));const a=s.filter(c=>!(0,xu.alwaysValidSchema)(i,n[c]));if(a.length===0)return;const l=t.name("valid");for(const c of a)u(c)?d(c):(t.if((0,Vm.propertyInData)(t,o,c,i.opts.ownProperties)),d(c),i.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(c),e.ok(l);function u(c){return i.opts.useDefaults&&!i.compositeRule&&n[c].default!==void 0}function d(c){e.subschema({keyword:"properties",schemaProp:c,dataProp:c},l)}}};zf.default=l4;var Rf={};Object.defineProperty(Rf,"__esModule",{value:!0});const Hm=se,Os=oe,Um=X,Bm=X,u4={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:r,parentSchema:o,it:i}=e,{opts:s}=i,a=(0,Hm.allSchemaProperties)(n),l=a.filter(v=>(0,Um.alwaysValidSchema)(i,n[v]));if(a.length===0||l.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;const u=s.strictSchema&&!s.allowMatchingProperties&&o.properties,d=t.name("valid");i.props!==!0&&!(i.props instanceof Os.Name)&&(i.props=(0,Bm.evaluatedPropsToName)(t,i.props));const{props:c}=i;h();function h(){for(const v of a)u&&g(v),i.allErrors?y(v):(t.var(d,!0),y(v),t.if(d))}function g(v){for(const w in u)new RegExp(v).test(w)&&(0,Um.checkStrictMode)(i,`property ${w} matches pattern ${v} (use allowMatchingProperties)`)}function y(v){t.forIn("key",r,w=>{t.if((0,Os._)`${(0,Hm.usePattern)(e,v)}.test(${w})`,()=>{const f=l.includes(v);f||e.subschema({keyword:"patternProperties",schemaProp:v,dataProp:w,dataPropType:Bm.Type.Str},d),i.opts.unevaluated&&c!==!0?t.assign((0,Os._)`${c}[${w}]`,!0):!f&&!i.allErrors&&t.if((0,Os.not)(d),()=>t.break())})})}}};Rf.default=u4;var Af={};Object.defineProperty(Af,"__esModule",{value:!0});const c4=X,d4={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:r}=e;if((0,c4.alwaysValidSchema)(r,n)){e.fail();return}const o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Af.default=d4;var Of={};Object.defineProperty(Of,"__esModule",{value:!0});const f4=se,h4={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:f4.validateUnion,error:{message:"must match a schema in anyOf"}};Of.default=h4;var Df={};Object.defineProperty(Df,"__esModule",{value:!0});const aa=oe,p4=X,m4={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,aa._)`{passingSchemas: ${e.passing}}`},g4={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:m4,code(e){const{gen:t,schema:n,parentSchema:r,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(o.opts.discriminator&&r.discriminator)return;const i=n,s=t.let("valid",!1),a=t.let("passing",null),l=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(s,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((d,c)=>{let h;(0,p4.alwaysValidSchema)(o,d)?t.var(l,!0):h=e.subschema({keyword:"oneOf",schemaProp:c,compositeRule:!0},l),c>0&&t.if((0,aa._)`${l} && ${s}`).assign(s,!1).assign(a,(0,aa._)`[${a}, ${c}]`).else(),t.if(l,()=>{t.assign(s,!0),t.assign(a,c),h&&e.mergeEvaluated(h,aa.Name)})})}}};Df.default=g4;var Lf={};Object.defineProperty(Lf,"__esModule",{value:!0});const y4=X,v4={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const o=t.name("valid");n.forEach((i,s)=>{if((0,y4.alwaysValidSchema)(r,i))return;const a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};Lf.default=v4;var Vf={};Object.defineProperty(Vf,"__esModule",{value:!0});const Ka=oe,mw=X,w4={message:({params:e})=>(0,Ka.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Ka._)`{failingKeyword: ${e.ifClause}}`},_4={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:w4,code(e){const{gen:t,parentSchema:n,it:r}=e;n.then===void 0&&n.else===void 0&&(0,mw.checkStrictMode)(r,'"if" without "then" and "else" is ignored');const o=Wm(r,"then"),i=Wm(r,"else");if(!o&&!i)return;const s=t.let("valid",!0),a=t.name("_valid");if(l(),e.reset(),o&&i){const d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,u("then",d),u("else",d))}else o?t.if(a,u("then")):t.if((0,Ka.not)(a),u("else"));e.pass(s,()=>e.error(!0));function l(){const d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function u(d,c){return()=>{const h=e.subschema({keyword:d},a);t.assign(s,a),e.mergeValidEvaluated(h,s),c?t.assign(c,(0,Ka._)`${d}`):e.setParams({ifClause:d})}}}};function Wm(e,t){const n=e.schema[t];return n!==void 0&&!(0,mw.alwaysValidSchema)(e,n)}Vf.default=_4;var Ff={};Object.defineProperty(Ff,"__esModule",{value:!0});const $4=X,x4={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,$4.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};Ff.default=x4;Object.defineProperty(bl,"__esModule",{value:!0});const S4=jo,E4=jf,k4=Mo,N4=Mf,P4=Tf,C4=jl,b4=If,j4=Ml,M4=zf,T4=Rf,I4=Af,z4=Of,R4=Df,A4=Lf,O4=Vf,D4=Ff;function L4(e=!1){const t=[I4.default,z4.default,R4.default,A4.default,O4.default,D4.default,b4.default,j4.default,C4.default,M4.default,T4.default];return e?t.push(E4.default,N4.default):t.push(S4.default,k4.default),t.push(P4.default),t}bl.default=L4;var Hf={},To={};Object.defineProperty(To,"__esModule",{value:!0});To.dynamicAnchor=void 0;const Su=oe,V4=mt,qm=Xe,F4=vn,H4={keyword:"$dynamicAnchor",schemaType:"string",code:e=>gw(e,e.schema)};function gw(e,t){const{gen:n,it:r}=e;r.schemaEnv.root.dynamicAnchors[t]=!0;const o=(0,Su._)`${V4.default.dynamicAnchors}${(0,Su.getProperty)(t)}`,i=r.errSchemaPath==="#"?r.validateName:U4(e);n.if((0,Su._)`!${o}`,()=>n.assign(o,i))}To.dynamicAnchor=gw;function U4(e){const{schemaEnv:t,schema:n,self:r}=e.it,{root:o,baseId:i,localRefs:s,meta:a}=t.root,{schemaId:l}=r.opts,u=new qm.SchemaEnv({schema:n,schemaId:l,root:o,baseId:i,localRefs:s,meta:a});return qm.compileSchema.call(r,u),(0,F4.getValidate)(e,u)}To.default=H4;var Io={};Object.defineProperty(Io,"__esModule",{value:!0});Io.dynamicRef=void 0;const Km=oe,B4=mt,Ym=vn,W4={keyword:"$dynamicRef",schemaType:"string",code:e=>yw(e,e.schema)};function yw(e,t){const{gen:n,keyword:r,it:o}=e;if(t[0]!=="#")throw new Error(`"${r}" only supports hash fragment reference`);const i=t.slice(1);if(o.allErrors)s();else{const l=n.let("valid",!1);s(l),e.ok(l)}function s(l){if(o.schemaEnv.root.dynamicAnchors[i]){const u=n.let("_v",(0,Km._)`${B4.default.dynamicAnchors}${(0,Km.getProperty)(i)}`);n.if(u,a(u,l),a(o.validateName,l))}else a(o.validateName,l)()}function a(l,u){return u?()=>n.block(()=>{(0,Ym.callRef)(e,l),n.let(u,!0)}):()=>(0,Ym.callRef)(e,l)}}Io.dynamicRef=yw;Io.default=W4;var Uf={};Object.defineProperty(Uf,"__esModule",{value:!0});const q4=To,K4=X,Y4={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,q4.dynamicAnchor)(e,""):(0,K4.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}};Uf.default=Y4;var Bf={};Object.defineProperty(Bf,"__esModule",{value:!0});const X4=Io,G4={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,X4.dynamicRef)(e,e.schema)};Bf.default=G4;Object.defineProperty(Hf,"__esModule",{value:!0});const Q4=To,Z4=Io,J4=Uf,e3=Bf,t3=[Q4.default,Z4.default,J4.default,e3.default];Hf.default=t3;var Wf={},qf={};Object.defineProperty(qf,"__esModule",{value:!0});const Xm=jl,n3={keyword:"dependentRequired",type:"object",schemaType:"object",error:Xm.error,code:e=>(0,Xm.validatePropertyDeps)(e)};qf.default=n3;var Kf={};Object.defineProperty(Kf,"__esModule",{value:!0});const r3=jl,o3={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,r3.validateSchemaDeps)(e)};Kf.default=o3;var Yf={};Object.defineProperty(Yf,"__esModule",{value:!0});const i3=X,s3={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:n}){t.contains===void 0&&(0,i3.checkStrictMode)(n,`"${e}" without "contains" is ignored`)}};Yf.default=s3;Object.defineProperty(Wf,"__esModule",{value:!0});const a3=qf,l3=Kf,u3=Yf,c3=[a3.default,l3.default,u3.default];Wf.default=c3;var Xf={},Gf={};Object.defineProperty(Gf,"__esModule",{value:!0});const Pn=oe,Gm=X,d3=mt,f3={message:"must NOT have unevaluated properties",params:({params:e})=>(0,Pn._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},h3={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:f3,code(e){const{gen:t,schema:n,data:r,errsCount:o,it:i}=e;if(!o)throw new Error("ajv implementation error");const{allErrors:s,props:a}=i;a instanceof Pn.Name?t.if((0,Pn._)`${a} !== true`,()=>t.forIn("key",r,c=>t.if(u(a,c),()=>l(c)))):a!==!0&&t.forIn("key",r,c=>a===void 0?l(c):t.if(d(a,c),()=>l(c))),i.props=!0,e.ok((0,Pn._)`${o} === ${d3.default.errors}`);function l(c){if(n===!1){e.setParams({unevaluatedProperty:c}),e.error(),s||t.break();return}if(!(0,Gm.alwaysValidSchema)(i,n)){const h=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:c,dataPropType:Gm.Type.Str},h),s||t.if((0,Pn.not)(h),()=>t.break())}}function u(c,h){return(0,Pn._)`!${c} || !${c}[${h}]`}function d(c,h){const g=[];for(const y in c)c[y]===!0&&g.push((0,Pn._)`${h} !== ${y}`);return(0,Pn.and)(...g)}}};Gf.default=h3;var Qf={};Object.defineProperty(Qf,"__esModule",{value:!0});const sr=oe,Qm=X,p3={message:({params:{len:e}})=>(0,sr.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,sr._)`{limit: ${e}}`},m3={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:p3,code(e){const{gen:t,schema:n,data:r,it:o}=e,i=o.items||0;if(i===!0)return;const s=t.const("len",(0,sr._)`${r}.length`);if(n===!1)e.setParams({len:i}),e.fail((0,sr._)`${s} > ${i}`);else if(typeof n=="object"&&!(0,Qm.alwaysValidSchema)(o,n)){const l=t.var("valid",(0,sr._)`${s} <= ${i}`);t.if((0,sr.not)(l),()=>a(l,i)),e.ok(l)}o.items=!0;function a(l,u){t.forRange("i",u,s,d=>{e.subschema({keyword:"unevaluatedItems",dataProp:d,dataPropType:Qm.Type.Num},l),o.allErrors||t.if((0,sr.not)(l),()=>t.break())})}}};Qf.default=m3;Object.defineProperty(Xf,"__esModule",{value:!0});const g3=Gf,y3=Qf,v3=[g3.default,y3.default];Xf.default=v3;var Tl={},Zf={};Object.defineProperty(Zf,"__esModule",{value:!0});const Pe=oe,w3={message:({schemaCode:e})=>(0,Pe.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Pe._)`{format: ${e}}`},_3={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:w3,code(e,t){const{gen:n,data:r,$data:o,schema:i,schemaCode:s,it:a}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:c}=a;if(!l.validateFormats)return;o?h():g();function h(){const y=n.scopeValue("formats",{ref:c.formats,code:l.code.formats}),v=n.const("fDef",(0,Pe._)`${y}[${s}]`),w=n.let("fType"),f=n.let("format");n.if((0,Pe._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>n.assign(w,(0,Pe._)`${v}.type || "string"`).assign(f,(0,Pe._)`${v}.validate`),()=>n.assign(w,(0,Pe._)`"string"`).assign(f,v)),e.fail$data((0,Pe.or)(p(),m()));function p(){return l.strictSchema===!1?Pe.nil:(0,Pe._)`${s} && !${f}`}function m(){const _=d.$async?(0,Pe._)`(${v}.async ? await ${f}(${r}) : ${f}(${r}))`:(0,Pe._)`${f}(${r})`,x=(0,Pe._)`(typeof ${f} == "function" ? ${_} : ${f}.test(${r}))`;return(0,Pe._)`${f} && ${f} !== true && ${w} === ${t} && !${x}`}}function g(){const y=c.formats[i];if(!y){p();return}if(y===!0)return;const[v,w,f]=m(y);v===t&&e.pass(_());function p(){if(l.strictSchema===!1){c.logger.warn(x());return}throw new Error(x());function x(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function m(x){const k=x instanceof RegExp?(0,Pe.regexpCode)(x):l.code.formats?(0,Pe._)`${l.code.formats}${(0,Pe.getProperty)(i)}`:void 0,C=n.scopeValue("formats",{key:i,ref:x,code:k});return typeof x=="object"&&!(x instanceof RegExp)?[x.type||"string",x.validate,(0,Pe._)`${C}.validate`]:["string",x,C]}function _(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!d.$async)throw new Error("async format in sync schema");return(0,Pe._)`await ${f}(${r})`}return typeof w=="function"?(0,Pe._)`${f}(${r})`:(0,Pe._)`${f}.test(${r})`}}}};Zf.default=_3;Object.defineProperty(Tl,"__esModule",{value:!0});const $3=Zf,x3=[$3.default];Tl.default=x3;var Pr={};Object.defineProperty(Pr,"__esModule",{value:!0});Pr.contentVocabulary=Pr.metadataVocabulary=void 0;Pr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Pr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(yf,"__esModule",{value:!0});const S3=Pl,E3=Cl,k3=bl,N3=Hf,P3=Wf,C3=Xf,b3=Tl,Zm=Pr,j3=[N3.default,S3.default,E3.default,(0,k3.default)(!0),b3.default,Zm.metadataVocabulary,Zm.contentVocabulary,P3.default,C3.default];yf.default=j3;var Il={},zl={};Object.defineProperty(zl,"__esModule",{value:!0});zl.DiscrError=void 0;var Jm;(function(e){e.Tag="tag",e.Mapping="mapping"})(Jm||(zl.DiscrError=Jm={}));Object.defineProperty(Il,"__esModule",{value:!0});const Rr=oe,Lc=zl,eg=Xe,M3=jr,T3=X,I3={message:({params:{discrError:e,tagName:t}})=>e===Lc.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>(0,Rr._)`{error: ${e}, tag: ${n}, tagValue: ${t}}`},z3={keyword:"discriminator",type:"object",schemaType:"object",error:I3,code(e){const{gen:t,data:n,schema:r,parentSchema:o,it:i}=e,{oneOf:s}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=r.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const l=t.let("valid",!1),u=t.const("tag",(0,Rr._)`${n}${(0,Rr.getProperty)(a)}`);t.if((0,Rr._)`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:Lc.DiscrError.Tag,tag:u,tagName:a})),e.ok(l);function d(){const g=h();t.if(!1);for(const y in g)t.elseIf((0,Rr._)`${u} === ${y}`),t.assign(l,c(g[y]));t.else(),e.error(!1,{discrError:Lc.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function c(g){const y=t.name("valid"),v=e.subschema({keyword:"oneOf",schemaProp:g},y);return e.mergeEvaluated(v,Rr.Name),y}function h(){var g;const y={},v=f(o);let w=!0;for(let _=0;_<s.length;_++){let x=s[_];if(x!=null&&x.$ref&&!(0,T3.schemaHasRulesButRef)(x,i.self.RULES)){const C=x.$ref;if(x=eg.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,C),x instanceof eg.SchemaEnv&&(x=x.schema),x===void 0)throw new M3.default(i.opts.uriResolver,i.baseId,C)}const k=(g=x==null?void 0:x.properties)===null||g===void 0?void 0:g[a];if(typeof k!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);w=w&&(v||f(x)),p(k,_)}if(!w)throw new Error(`discriminator: "${a}" must be required`);return y;function f({required:_}){return Array.isArray(_)&&_.includes(a)}function p(_,x){if(_.const)m(_.const,x);else if(_.enum)for(const k of _.enum)m(k,x);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function m(_,x){if(typeof _!="string"||_ in y)throw new Error(`discriminator: "${a}" values must be unique strings`);y[_]=x}}}};Il.default=z3;var Jf={};const R3="https://json-schema.org/draft/2020-12/schema",A3="https://json-schema.org/draft/2020-12/schema",O3={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},D3="meta",L3="Core and Validation specifications meta-schema",V3=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],F3=["object","boolean"],H3="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",U3={definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}},B3={$schema:R3,$id:A3,$vocabulary:O3,$dynamicAnchor:D3,title:L3,allOf:V3,type:F3,$comment:H3,properties:U3},W3="https://json-schema.org/draft/2020-12/schema",q3="https://json-schema.org/draft/2020-12/meta/applicator",K3={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},Y3="meta",X3="Applicator vocabulary meta-schema",G3=["object","boolean"],Q3={prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},Z3={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},J3={$schema:W3,$id:q3,$vocabulary:K3,$dynamicAnchor:Y3,title:X3,type:G3,properties:Q3,$defs:Z3},ez="https://json-schema.org/draft/2020-12/schema",tz="https://json-schema.org/draft/2020-12/meta/unevaluated",nz={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},rz="meta",oz="Unevaluated applicator vocabulary meta-schema",iz=["object","boolean"],sz={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},az={$schema:ez,$id:tz,$vocabulary:nz,$dynamicAnchor:rz,title:oz,type:iz,properties:sz},lz="https://json-schema.org/draft/2020-12/schema",uz="https://json-schema.org/draft/2020-12/meta/content",cz={"https://json-schema.org/draft/2020-12/vocab/content":!0},dz="meta",fz="Content vocabulary meta-schema",hz=["object","boolean"],pz={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},mz={$schema:lz,$id:uz,$vocabulary:cz,$dynamicAnchor:dz,title:fz,type:hz,properties:pz},gz="https://json-schema.org/draft/2020-12/schema",yz="https://json-schema.org/draft/2020-12/meta/core",vz={"https://json-schema.org/draft/2020-12/vocab/core":!0},wz="meta",_z="Core vocabulary meta-schema",$z=["object","boolean"],xz={$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},Sz={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},Ez={$schema:gz,$id:yz,$vocabulary:vz,$dynamicAnchor:wz,title:_z,type:$z,properties:xz,$defs:Sz},kz="https://json-schema.org/draft/2020-12/schema",Nz="https://json-schema.org/draft/2020-12/meta/format-annotation",Pz={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},Cz="meta",bz="Format vocabulary meta-schema for annotation results",jz=["object","boolean"],Mz={format:{type:"string"}},Tz={$schema:kz,$id:Nz,$vocabulary:Pz,$dynamicAnchor:Cz,title:bz,type:jz,properties:Mz},Iz="https://json-schema.org/draft/2020-12/schema",zz="https://json-schema.org/draft/2020-12/meta/meta-data",Rz={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},Az="meta",Oz="Meta-data vocabulary meta-schema",Dz=["object","boolean"],Lz={title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}},Vz={$schema:Iz,$id:zz,$vocabulary:Rz,$dynamicAnchor:Az,title:Oz,type:Dz,properties:Lz},Fz="https://json-schema.org/draft/2020-12/schema",Hz="https://json-schema.org/draft/2020-12/meta/validation",Uz={"https://json-schema.org/draft/2020-12/vocab/validation":!0},Bz="meta",Wz="Validation vocabulary meta-schema",qz=["object","boolean"],Kz={type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},Yz={nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Xz={$schema:Fz,$id:Hz,$vocabulary:Uz,$dynamicAnchor:Bz,title:Wz,type:qz,properties:Kz,$defs:Yz};Object.defineProperty(Jf,"__esModule",{value:!0});const Gz=B3,Qz=J3,Zz=az,Jz=mz,eR=Ez,tR=Tz,nR=Vz,rR=Xz,oR=["/properties"];function iR(e){return[Gz,Qz,Zz,Jz,eR,t(this,tR),nR,t(this,rR)].forEach(n=>this.addMetaSchema(n,void 0,!1)),this;function t(n,r){return e?n.$dataMetaSchema(r,oR):r}}Jf.default=iR;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const n=tf,r=yf,o=Il,i=Jf,s="https://json-schema.org/draft/2020-12/schema";class a extends n.default{constructor(g={}){super({...g,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:g,meta:y}=this.opts;y&&(i.default.call(this,g),this.refs["http://json-schema.org/schema"]=s)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}t.Ajv2020=a,e.exports=t=a,e.exports.Ajv2020=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var l=St;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var u=oe;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=bo;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var c=jr;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return c.default}})})(Tc,Tc.exports);var sR=Tc.exports;const aR=Ya(sR);var Vc={exports:{}},vw={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(T,O){return{validate:T,compare:O}}e.fullFormats={date:t(i,s),time:t(l(!0),u),"date-time":t(h(!0),g),"iso-time":t(l(),d),"iso-date-time":t(h(),y),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:f,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:U,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:m,int32:{type:"number",validate:k},int64:{type:"number",validate:C},float:{type:"number",validate:I},double:{type:"number",validate:I},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,g),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,y),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(T){return T%4===0&&(T%100!==0||T%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(T){const O=r.exec(T);if(!O)return!1;const W=+O[1],N=+O[2],F=+O[3];return N>=1&&N<=12&&F>=1&&F<=(N===2&&n(W)?29:o[N])}function s(T,O){if(T&&O)return T>O?1:T<O?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function l(T){return function(W){const N=a.exec(W);if(!N)return!1;const F=+N[1],A=+N[2],H=+N[3],M=N[4],z=N[5]==="-"?-1:1,b=+(N[6]||0),E=+(N[7]||0);if(b>23||E>59||T&&!M)return!1;if(F<=23&&A<=59&&H<60)return!0;const j=A-E*z,R=F-b*z-(j<0?1:0);return(R===23||R===-1)&&(j===59||j===-1)&&H<61}}function u(T,O){if(!(T&&O))return;const W=new Date("2020-01-01T"+T).valueOf(),N=new Date("2020-01-01T"+O).valueOf();if(W&&N)return W-N}function d(T,O){if(!(T&&O))return;const W=a.exec(T),N=a.exec(O);if(W&&N)return T=W[1]+W[2]+W[3],O=N[1]+N[2]+N[3],T>O?1:T<O?-1:0}const c=/t|\s/i;function h(T){const O=l(T);return function(N){const F=N.split(c);return F.length===2&&i(F[0])&&O(F[1])}}function g(T,O){if(!(T&&O))return;const W=new Date(T).valueOf(),N=new Date(O).valueOf();if(W&&N)return W-N}function y(T,O){if(!(T&&O))return;const[W,N]=T.split(c),[F,A]=O.split(c),H=s(W,F);if(H!==void 0)return H||u(N,A)}const v=/\/|:/,w=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function f(T){return v.test(T)&&w.test(T)}const p=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function m(T){return p.lastIndex=0,p.test(T)}const _=-2147483648,x=2**31-1;function k(T){return Number.isInteger(T)&&T<=x&&T>=_}function C(T){return Number.isInteger(T)}function I(){return!0}const L=/[^\\]\\Z/;function U(T){if(L.test(T))return!1;try{return new RegExp(T),!0}catch{return!1}}})(vw);var ww={},Fc={exports:{}},eh={};Object.defineProperty(eh,"__esModule",{value:!0});const lR=Pl,uR=Cl,cR=bl,dR=Tl,tg=Pr,fR=[lR.default,uR.default,(0,cR.default)(),dR.default,tg.metadataVocabulary,tg.contentVocabulary];eh.default=fR;const hR="http://json-schema.org/draft-07/schema#",pR="http://json-schema.org/draft-07/schema#",mR="Core schema meta-schema",gR={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},yR=["object","boolean"],vR={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},wR={$schema:hR,$id:pR,title:mR,definitions:gR,type:yR,properties:vR,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=tf,r=eh,o=Il,i=wR,s=["/properties"],a="http://json-schema.org/draft-07/schema";class l extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(y=>this.addVocabulary(y)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const y=this.opts.$data?this.$dataMetaSchema(i,s):i;this.addMetaSchema(y,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=St;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=oe;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var c=bo;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return c.default}});var h=jr;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})})(Fc,Fc.exports);var _R=Fc.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=_R,n=oe,r=n.operators,o={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},i={message:({keyword:a,schemaCode:l})=>(0,n.str)`should be ${o[a].okStr} ${l}`,params:({keyword:a,schemaCode:l})=>(0,n._)`{comparison: ${o[a].okStr}, limit: ${l}}`};e.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:i,code(a){const{gen:l,data:u,schemaCode:d,keyword:c,it:h}=a,{opts:g,self:y}=h;if(!g.validateFormats)return;const v=new t.KeywordCxt(h,y.RULES.all.format.definition,"format");v.$data?w():f();function w(){const m=l.scopeValue("formats",{ref:y.formats,code:g.code.formats}),_=l.const("fmt",(0,n._)`${m}[${v.schemaCode}]`);a.fail$data((0,n.or)((0,n._)`typeof ${_} != "object"`,(0,n._)`${_} instanceof RegExp`,(0,n._)`typeof ${_}.compare != "function"`,p(_)))}function f(){const m=v.schema,_=y.formats[m];if(!_||_===!0)return;if(typeof _!="object"||_ instanceof RegExp||typeof _.compare!="function")throw new Error(`"${c}": format "${m}" does not define "compare" function`);const x=l.scopeValue("formats",{key:m,ref:_,code:g.code.formats?(0,n._)`${g.code.formats}${(0,n.getProperty)(m)}`:void 0});a.fail$data(p(x))}function p(m){return(0,n._)`${m}.compare(${u}, ${d}) ${o[c].fail} 0`}},dependencies:["format"]};const s=a=>(a.addKeyword(e.formatLimitDefinition),a);e.default=s})(ww);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=vw,r=ww,o=oe,i=new o.Name("fullFormats"),s=new o.Name("fastFormats"),a=(u,d={keywords:!0})=>{if(Array.isArray(d))return l(u,d,n.fullFormats,i),u;const[c,h]=d.mode==="fast"?[n.fastFormats,s]:[n.fullFormats,i],g=d.formats||n.formatNames;return l(u,g,c,h),d.keywords&&(0,r.default)(u),u};a.get=(u,d="full")=>{const h=(d==="fast"?n.fastFormats:n.fullFormats)[u];if(!h)throw new Error(`Unknown format "${u}"`);return h};function l(u,d,c,h){var g,y;(g=(y=u.opts.code).formats)!==null&&g!==void 0||(y.formats=(0,o._)`require("ajv-formats/dist/formats").${h}`);for(const v of d)u.addFormat(v,c[v])}e.exports=t=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a})(Vc,Vc.exports);var $R=Vc.exports;const xR=Ya($R),SR="https://json-schema.org/draft/2020-12/schema",ER="https://loom-spec.dev/schema/diagram-v1.json",kR="Loom Diagram",NR="A node-based architecture spec file.",PR="object",CR=["version","id","title","nodes","edges"],bR=!1,jR={$schema:{type:"string"},version:{const:"1"},id:{type:"string",pattern:"^[a-z0-9-]+$",description:"Diagram identifier. Should match the filename without extension."},title:{type:"string",minLength:1},description:{type:"string"},nodes:{type:"array",items:{$ref:"#/$defs/Node"}},edges:{type:"array",items:{$ref:"#/$defs/Edge"}},groups:{type:"array",items:{$ref:"#/$defs/Group"},default:[]}},MR={Node:{type:"object",required:["id","type","label","position","status"],additionalProperties:!1,properties:{id:{type:"string",pattern:"^[a-z0-9-]+$",description:"Unique within this diagram."},type:{type:"string",description:"References a key in node-types.json."},label:{type:"string",minLength:1,maxLength:60},description:{type:"string",description:"Markdown allowed."},position:{type:"object",required:["x","y"],additionalProperties:!1,properties:{x:{type:"number"},y:{type:"number"}}},status:{type:"string",enum:["planned","implemented","stale","deprecated"],description:"planned = spec exists, code does not. implemented = both present. stale = code refs are broken, needs review. deprecated = kept for history, no longer active."},code_refs:{type:"array",items:{$ref:"#/$defs/CodeRef"},default:[]},properties:{type:"object",description:"Custom fields defined by the node's type in node-types.json.",default:{}},tags:{type:"array",items:{type:"string"},default:[]},drill_down:{type:"string",pattern:"^[a-z0-9-]+$",description:"ID of another diagram file to navigate into when this node is opened."}}},Edge:{type:"object",required:["id","from","to","kind"],additionalProperties:!1,properties:{id:{type:"string",minLength:1},from:{type:"string",pattern:"^[a-z0-9-]+(:[a-z0-9_-]+)?$",description:"Source node id, optionally with :port-name suffix."},to:{type:"string",pattern:"^[a-z0-9-]+(:[a-z0-9_-]+)?$",description:"Target node id, optionally with :port-name suffix."},kind:{type:"string",enum:["request","event","data-read","data-write","signal","dependency","control"]},label:{type:"string",maxLength:60},description:{type:"string"},direction:{type:"string",enum:["forward","bidirectional"],default:"forward"}}},Group:{type:"object",required:["id","label"],additionalProperties:!1,properties:{id:{type:"string",pattern:"^[a-z0-9-]+$"},label:{type:"string",minLength:1},children:{type:"array",items:{type:"string"},description:"Node ids contained in this group.",default:[]},subgroups:{type:"array",items:{type:"string"},description:"Group ids nested inside this group.",default:[]},color:{type:"string",pattern:"^#[0-9a-fA-F]{6}$"},collapsed:{type:"boolean",default:!1},drill_down:{type:"string",pattern:"^[a-z0-9-]+$"}}},CodeRef:{type:"object",required:["path"],additionalProperties:!1,properties:{path:{type:"string",description:"Repo-relative file path."},symbol:{type:"string",description:"Function, class, or component name. Preferred over lines because it survives refactors."},lines:{type:"string",pattern:"^[0-9]+(-[0-9]+)?(,[0-9]+(-[0-9]+)?)*$",description:"Line range(s) like '1-80' or '12,45-50'. Use only when no symbol applies."}}}},TR={$schema:SR,$id:ER,title:kR,description:NR,type:PR,required:CR,additionalProperties:bR,properties:jR,$defs:MR},_w=new aR({allErrors:!0,strict:!1});xR(_w);const ng=_w.compile(TR),IR={nodes:"node",edges:"edge",groups:"group"};function Eu(e){return ng(e)?[]:(ng.errors??[]).map(n=>{var i;const r=n.instancePath??"",o=r.match(/^\/(nodes|edges|groups)\/(\d+)(?:\/(.+))?$/);if(o){const s=o[1],a=IR[s],l=Number(o[2]),u=o[3],d=e[s],c=(i=d==null?void 0:d[l])==null?void 0:i.id;return{path:r,scope:a,itemId:c,field:u,message:n.message??"invalid"}}return{path:r,scope:"root",message:n.message??"invalid"}})}function zR(e,t){const n={};for(const r of e){if(r.scope!=="node"||r.itemId!==t)continue;const o=r.field?r.field.split("/")[0]??"*":"*";n[o]||(n[o]=r.message)}return n}function RR(e,t){const n={};for(const r of e){if(r.scope!=="edge"||r.itemId!==t)continue;const o=r.field?r.field.split("/")[0]??"*":"*";n[o]||(n[o]=r.message)}return n}const AR=500;function OR(e){const[t,n]=D.useState({diagram:null,nodeTypes:null,loadError:null,saveStatus:"idle",saveError:null,connectionStatus:"connecting",validationErrors:[]}),r=D.useRef(null),o=D.useRef(null),i=D.useRef(!1),s=D.useRef(t);s.current=t,D.useEffect(()=>{let w=!1;return Em(e).then(f=>{w||(o.current=f.diagram,i.current=!0,n(p=>({...p,diagram:f.diagram,nodeTypes:f.nodeTypes,validationErrors:Eu(f.diagram)})))}).catch(f=>{w||n(p=>({...p,loadError:f instanceof Error?f.message:String(f)}))}),()=>{w=!0}},[e]);const a=D.useCallback(()=>{r.current&&clearTimeout(r.current),n(w=>({...w,saveStatus:"dirty",saveError:null})),r.current=setTimeout(async()=>{const w=o.current;if(w){n(f=>({...f,saveStatus:"saving"}));try{await p1(w),n(f=>({...f,saveStatus:"saved"}))}catch(f){n(p=>({...p,saveStatus:"error",saveError:f instanceof Error?f.message:String(f)}))}}},AR)},[]),l=D.useCallback(w=>{i.current&&(n(f=>{if(!f.diagram)return f;const p=w(f.diagram);return o.current=p,{...f,diagram:p,validationErrors:Eu(p)}}),a())},[a]),u=D.useCallback((w,f)=>{l(p=>({...p,nodes:p.nodes.map(m=>m.id===w?f(m):m)}))},[l]),d=D.useCallback(w=>{l(f=>({...f,nodes:f.nodes.filter(p=>p.id!==w),edges:f.edges.filter(p=>{const m=p.from.split(":")[0],_=p.to.split(":")[0];return m!==w&&_!==w})}))},[l]),c=D.useCallback(w=>{l(f=>({...f,nodes:[...f.nodes,w]}))},[l]),h=D.useCallback((w,f)=>{l(p=>({...p,edges:p.edges.map(m=>m.id===w?f(m):m)}))},[l]),g=D.useCallback(w=>{l(f=>({...f,edges:[...f.edges,w]}))},[l]),y=D.useCallback(w=>{l(f=>({...f,edges:f.edges.filter(p=>p.id!==w)}))},[l]);return D.useEffect(()=>{n(p=>({...p,connectionStatus:"connecting"}));const w=new EventSource("/api/events"),f=()=>{const p=s.current.saveStatus;p==="dirty"||p==="saving"||Em(e).then(m=>{o.current=m.diagram,n(_=>({..._,diagram:m.diagram,nodeTypes:m.nodeTypes,saveStatus:"idle",saveError:null,validationErrors:Eu(m.diagram)}))}).catch(()=>{})};return w.onopen=()=>{n(p=>({...p,connectionStatus:"connected"}))},w.onerror=()=>{n(p=>({...p,connectionStatus:"disconnected"}))},w.addEventListener("change",p=>{try{const m=JSON.parse(p.data);(m.type==="diagram-changed"&&m.id===e||m.type==="node-types-changed")&&f()}catch{}}),()=>{w.close()}},[e]),D.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]),D.useMemo(()=>({...t,updateNode:u,deleteNode:d,addNode:c,updateEdge:h,addEdge:g,deleteEdge:y}),[t,u,d,c,h,g,y])}function DR(e,t){const n=new Set(e.nodes.map(o=>o.id));let r=1;for(;n.has(`${t}-${r}`);)r++;return`${t}-${r}`}function LR(e){const t=new Set(e.edges.map(r=>r.id));let n=e.edges.length+1;for(;t.has(`e${n}`);)n++;return`e${n}`}const VR=200,FR=90,rg=24,og=32,HR=18;function UR(e){const t=new Map((e.groups??[]).map(s=>[s.id,s])),n=new Map(e.nodes.map(s=>[s.id,s])),r=new Map,o=new Set;function i(s){const a=r.get(s);if(a)return a;if(o.has(s))return null;o.add(s);const l=t.get(s);if(!l)return o.delete(s),null;let u=1/0,d=1/0,c=-1/0,h=-1/0;for(const y of l.children??[]){const v=n.get(y);if(!v)continue;const{x:w,y:f}=v.position;u=Math.min(u,w),d=Math.min(d,f),c=Math.max(c,w+VR),h=Math.max(h,f+FR)}for(const y of l.subgroups??[]){const v=i(y);v&&(u=Math.min(u,v.x),d=Math.min(d,v.y),c=Math.max(c,v.x+v.width),h=Math.max(h,v.y+v.height))}let g;return isFinite(u)?g={x:u-rg,y:d-og,width:c-u+rg*2,height:h-d+og+HR}:g={x:50,y:50,width:220,height:80},r.set(s,g),o.delete(s),g}for(const s of e.groups??[])i(s.id);return r}function BR(e){const t=new Map(e.map(o=>[o.id,o])),n=new Map;function r(o,i=new Set){if(n.has(o))return n.get(o);if(i.has(o))return 0;i.add(o);const s=t.get(o);if(!s||!s.subgroups||s.subgroups.length===0)return n.set(o,0),0;let a=0;for(const l of s.subgroups)a=Math.max(a,r(l,i)+1);return n.set(o,a),a}for(const o of e)r(o.id);return[...e].sort((o,i)=>(n.get(i.id)??0)-(n.get(o.id)??0))}const WR={request:"var(--edge-request)",event:"var(--edge-event)","data-read":"var(--edge-data-read)","data-write":"var(--edge-data-write)",signal:"var(--edge-signal)",dependency:"var(--edge-dependency)",control:"var(--edge-control)"},qR={loom:Qb,loomGroup:Zb},KR={parallel:ej,pulse:rj};function Ds(e){const t=e.indexOf(":");return t===-1?e:e.slice(0,t)}function ig(e){const t=e.indexOf(":");return t===-1?{node:e,port:null}:{node:e.slice(0,t),port:e.slice(t+1)}}function YR({diagram:e,nodeTypesConfig:t,selection:n,onSelect:r,onMoveNode:o,onDeleteNode:i,onDeleteEdge:s,onAddEdge:a,onDrillDown:l,interactive:u=!0,activeNodeIds:d,pulsingEdgeIds:c}){const h=D.useMemo(()=>{const _=UR(e),k=BR(e.groups??[]).flatMap(I=>{const L=_.get(I.id);return L?[{id:`__group__${I.id}`,type:"loomGroup",position:{x:L.x,y:L.y},width:L.width,height:L.height,draggable:!1,selectable:!1,focusable:!1,deletable:!1,data:{group:I,onDrillDown:l}}]:[]}),C=e.nodes.map(I=>({id:I.id,type:"loom",position:I.position,selected:(n==null?void 0:n.kind)==="node"&&n.id===I.id,draggable:u,selectable:u,data:{node:I,typeDef:t.types[I.type],onDrillDown:l,active:(d==null?void 0:d.has(I.id))??!1}}));return[...k,...C]},[e,t,n,l,u,d]),g=D.useMemo(()=>{const _=new Map;for(const x of e.edges){const k=`${Ds(x.from)}::${Ds(x.to)}`,C=_.get(k);C?C.push(x):_.set(k,[x])}return e.edges.map(x=>{const k=`${Ds(x.from)}::${Ds(x.to)}`,C=_.get(k),I=C.findIndex(A=>A.id===x.id),L=C.length,U=L===1?0:I-(L-1)/2,T=L>1,O=ig(x.from),W=ig(x.to),N=(c==null?void 0:c.has(x.id))??!1,F=N?"pulse":T?"parallel":void 0;return{id:x.id,source:O.node,target:W.node,sourceHandle:O.port,targetHandle:W.port,type:F,label:x.label,selected:(n==null?void 0:n.kind)==="edge"&&n.id===x.id,selectable:u,style:{stroke:WR[x.kind],strokeWidth:1.5},labelStyle:{fill:"var(--text-muted)",fontSize:11},labelBgStyle:{fill:"var(--bg-elevated)"},labelBgPadding:[4,2],labelBgBorderRadius:3,animated:!N&&(x.kind==="event"||x.kind==="signal"),data:{parallelOffset:T?U:0,pulsing:N}}})},[e,n,u,c]),y=D.useCallback(_=>{for(const x of _)"id"in x&&x.id.startsWith("__group__")||(x.type==="position"&&x.position&&!x.dragging?o==null||o(x.id,x.position):x.type==="remove"&&(i==null||i(x.id)))},[o,i]),v=D.useCallback(_=>{for(const x of _)x.type==="remove"&&(s==null||s(x.id))},[s]),w=D.useCallback(_=>{if(!_.source||!_.target)return;const x=_.sourceHandle?`${_.source}:${_.sourceHandle}`:_.source,k=_.targetHandle?`${_.target}:${_.targetHandle}`:_.target;a==null||a({id:LR(e),from:x,to:k,kind:"request"})},[e,a]),f=D.useCallback(({nodes:_,edges:x})=>{r&&(_[0]?r({kind:"node",id:_[0].id}):x[0]?r({kind:"edge",id:x[0].id}):r(null))},[r]),p=D.useRef(null),m=D.useRef(null);return D.useEffect(()=>{if(u)return;const _=p.current;if(!_)return;let x=null;const k=()=>{x&&clearTimeout(x),x=setTimeout(()=>{var I;(I=m.current)==null||I.fitView({padding:.2,duration:200,minZoom:.05,maxZoom:1.5})},60)},C=new ResizeObserver(k);return C.observe(_),()=>{x&&clearTimeout(x),C.disconnect()}},[u,e]),S.jsx("div",{className:"canvas-wrap",ref:p,children:S.jsxs(_b,{nodes:h,edges:g,nodeTypes:qR,edgeTypes:KR,onNodesChange:u?y:void 0,onEdgesChange:u?v:void 0,onConnect:u?w:void 0,onSelectionChange:u?f:void 0,onNodeDoubleClick:u?(_,x)=>{var C;const k=x.data;(C=k.node)!=null&&C.drill_down&&(l==null||l(k.node.drill_down))}:void 0,nodesDraggable:u,nodesConnectable:u,elementsSelectable:u,minZoom:u?.2:.05,fitView:!0,fitViewOptions:u?{padding:.2}:{padding:.2,minZoom:.05,maxZoom:1.5},proOptions:{hideAttribution:!0},deleteKeyCode:u?["Backspace","Delete"]:null,onInit:_=>{m.current=_,u||setTimeout(()=>_.fitView({padding:.2,duration:0,minZoom:.05,maxZoom:1.5}),80)},children:[S.jsx(Nb,{gap:16,size:1,color:"var(--grid-dot)"}),u&&S.jsx(Ib,{})]})})}function dr({message:e}){return e?S.jsx("div",{className:"field-error",children:e}):null}const XR={planned:"var(--status-planned)",implemented:"var(--status-implemented)",stale:"var(--status-stale)",deprecated:"var(--status-deprecated)"},GR=["planned","implemented","stale","deprecated"],QR=["request","event","data-read","data-write","signal","dependency","control"];function ZR(e){return e.selectedNode?S.jsx(JR,{...e,node:e.selectedNode}):e.selectedEdge?S.jsx(eA,{...e,edge:e.selectedEdge}):S.jsx("div",{className:"inspector",children:S.jsx("div",{className:"empty",children:"Select a node or edge to inspect"})})}function JR({node:e,nodeTypes:t,validationErrors:n,onUpdateNode:r}){const o=t.types[e.type],i=(o==null?void 0:o.color)??"#71717a",s=e.properties??{},a=e.code_refs??[],l=e.tags??[],u=zR(n,e.id),d=h=>r(e.id,h),c=(h,g)=>d(y=>({...y,properties:{...y.properties??{},[h]:g}}));return S.jsxs("div",{className:"inspector",children:[S.jsx("span",{className:"type-tag",style:{background:i,color:"#fff"},children:(o==null?void 0:o.label)??e.type}),S.jsxs("div",{className:"field",children:[S.jsx("div",{className:"field-label",children:"Label"}),S.jsx("input",{className:"input",value:e.label,onChange:h=>d(g=>({...g,label:h.target.value}))}),S.jsx(dr,{message:u.label})]}),S.jsxs("div",{className:"field",children:[S.jsx("div",{className:"field-label",children:"Status"}),S.jsx("select",{className:"input",value:e.status,onChange:h=>d(g=>({...g,status:h.target.value})),children:GR.map(h=>S.jsx("option",{value:h,children:h},h))}),S.jsx("div",{className:"status-line",style:{background:XR[e.status]}})]}),S.jsxs("div",{className:"field",children:[S.jsx("div",{className:"field-label",children:"ID"}),S.jsx("div",{className:"field-value",children:S.jsx("code",{children:e.id})}),S.jsx(dr,{message:u.id})]}),S.jsxs("div",{className:"field",children:[S.jsx("div",{className:"field-label",children:"Description"}),S.jsx("textarea",{className:"input textarea",rows:3,value:e.description??"",placeholder:"Markdown allowed",onChange:h=>d(g=>({...g,description:h.target.value||void 0}))}),S.jsx(dr,{message:u.description})]}),((o==null?void 0:o.fields)??[]).length>0&&S.jsxs("div",{className:"field",children:[S.jsx("div",{className:"field-label",children:"Properties"}),((o==null?void 0:o.fields)??[]).map(h=>S.jsx(nA,{field:h,value:s[h.name],onChange:g=>c(h.name,g)},h.name))]}),S.jsxs("div",{className:"field",children:[S.jsx("div",{className:"field-label",children:"Code refs"}),S.jsx(dr,{message:u.code_refs}),a.map((h,g)=>S.jsxs("div",{className:"code-ref-row",children:[S.jsx("input",{className:"input",value:h.path,placeholder:"src/path/to/file.ts",onChange:y=>d(v=>{const w=[...v.code_refs??[]];return w[g]={...w[g],path:y.target.value},{...v,code_refs:w}})}),S.jsx("input",{className:"input small",value:h.symbol??"",placeholder:"symbol",onChange:y=>d(v=>{const w=[...v.code_refs??[]];return w[g]={...w[g],symbol:y.target.value||void 0},{...v,code_refs:w}})}),S.jsx("input",{className:"input small",value:h.lines??"",placeholder:"lines",onChange:y=>d(v=>{const w=[...v.code_refs??[]];return w[g]={...w[g],lines:y.target.value||void 0},{...v,code_refs:w}})}),S.jsx("button",{type:"button",className:"row-delete",title:"Remove ref","aria-label":"Remove ref",onClick:()=>d(y=>({...y,code_refs:(y.code_refs??[]).filter((v,w)=>w!==g)})),children:S.jsx(Ey,{size:12})})]},g)),S.jsxs("button",{type:"button",className:"add-row",onClick:()=>d(h=>({...h,code_refs:[...h.code_refs??[],{path:""}]})),children:[S.jsx(Ad,{size:12})," Add code ref"]})]}),S.jsxs("div",{className:"field",children:[S.jsx("div",{className:"field-label",children:"Tags"}),S.jsx(tA,{value:l,onChange:h=>d(g=>({...g,tags:h.length>0?h:void 0}))})]})]})}function eA({edge:e,validationErrors:t,onUpdateEdge:n}){const r=i=>n(e.id,i),o=RR(t,e.id);return S.jsxs("div",{className:"inspector",children:[S.jsx("span",{className:"type-tag",style:{background:"#71717a",color:"#fff"},children:"EDGE"}),S.jsxs("div",{className:"field",children:[S.jsx("div",{className:"field-label",children:"From → To"}),S.jsxs("div",{className:"field-value",children:[S.jsx("code",{children:e.from})," → ",S.jsx("code",{children:e.to})]}),S.jsx(dr,{message:o.from??o.to})]}),S.jsxs("div",{className:"field",children:[S.jsx("div",{className:"field-label",children:"Kind"}),S.jsx("select",{className:"input",value:e.kind,onChange:i=>r(s=>({...s,kind:i.target.value})),children:QR.map(i=>S.jsx("option",{value:i,children:i},i))}),S.jsx(dr,{message:o.kind})]}),S.jsxs("div",{className:"field",children:[S.jsx("div",{className:"field-label",children:"Label"}),S.jsx("input",{className:"input",value:e.label??"",onChange:i=>r(s=>({...s,label:i.target.value||void 0}))}),S.jsx(dr,{message:o.label})]}),S.jsxs("div",{className:"field",children:[S.jsx("div",{className:"field-label",children:"Description"}),S.jsx("textarea",{className:"input textarea",rows:2,value:e.description??"",onChange:i=>r(s=>({...s,description:i.target.value||void 0}))})]})]})}function tA({value:e,onChange:t}){const[n,r]=D.useState(""),o=()=>{const i=n.trim().toLowerCase();r(""),i&&(e.includes(i)||t([...e,i]))};return S.jsxs("div",{className:"tag-input",children:[S.jsx("div",{className:"tag-chips",children:e.map(i=>S.jsxs("span",{className:"tag",children:[i,S.jsx("button",{type:"button",className:"tag-x","aria-label":`Remove tag ${i}`,onClick:()=>t(e.filter(s=>s!==i)),children:S.jsx(Ey,{size:10})})]},i))}),S.jsx("input",{className:"input",value:n,placeholder:"Add tag and press Enter",onChange:i=>r(i.target.value),onKeyDown:i=>{i.key==="Enter"?(i.preventDefault(),o()):i.key==="Backspace"&&n===""&&e.length>0&&t(e.slice(0,-1))},onBlur:o})]})}function nA({field:e,value:t,onChange:n}){if(e.type==="boolean")return S.jsxs("label",{style:{display:"flex",gap:6,alignItems:"center",margin:"4px 0"},children:[S.jsx("input",{type:"checkbox",checked:!!t,onChange:r=>n(r.target.checked)}),S.jsx("span",{style:{color:"var(--text-muted)",fontSize:12},children:e.name})]});if(e.type==="enum"){const r=e.values??[];return S.jsxs("div",{style:{margin:"4px 0"},children:[S.jsx("div",{style:{color:"var(--text-muted)",fontSize:11},children:e.name}),S.jsxs("select",{className:"input",value:t??"",onChange:o=>n(o.target.value||void 0),children:[S.jsx("option",{value:"",children:"—"}),r.map(o=>S.jsx("option",{value:o,children:o},o))]})]})}return e.type==="number"?S.jsxs("div",{style:{margin:"4px 0"},children:[S.jsx("div",{style:{color:"var(--text-muted)",fontSize:11},children:e.name}),S.jsx("input",{className:"input",type:"number",value:t??"",onChange:r=>n(r.target.value===""?void 0:Number(r.target.value))})]}):e.type==="markdown"?S.jsxs("div",{style:{margin:"4px 0"},children:[S.jsx("div",{style:{color:"var(--text-muted)",fontSize:11},children:e.name}),S.jsx("textarea",{className:"input textarea",rows:3,value:t??"",onChange:r=>n(r.target.value||void 0)})]}):S.jsxs("div",{style:{margin:"4px 0"},children:[S.jsx("div",{style:{color:"var(--text-muted)",fontSize:11},children:e.name}),S.jsx("input",{className:"input",value:t??"",onChange:r=>n(r.target.value||void 0)})]})}function rA({nodeTypes:e,anchorRef:t,onPick:n,onClose:r}){const o=D.useRef(null),[i,s]=D.useState(null);return D.useLayoutEffect(()=>{function a(){const l=t.current;if(!l)return;const u=l.getBoundingClientRect();s({top:u.bottom+6,right:Math.max(8,window.innerWidth-u.right)})}return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[t]),D.useEffect(()=>{function a(l){var u;if(o.current&&!o.current.contains(l.target)){if((u=t.current)!=null&&u.contains(l.target))return;r()}}return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[r,t]),i?S.jsxs("div",{className:"add-node-menu",ref:o,style:{top:i.top,right:i.right},children:[S.jsx("div",{className:"add-node-menu-title",children:"Add node"}),Object.entries(e.types).map(([a,l])=>S.jsxs("button",{className:"add-node-item",onClick:()=>n(a),style:{"--node-color":l.color},children:[S.jsx("span",{className:"add-node-color"}),S.jsxs("div",{className:"add-node-text",children:[S.jsx("div",{className:"add-node-label",children:l.label}),S.jsx("code",{className:"add-node-key",children:a})]})]},a))]}):null}function oA({id:e,diagrams:t,timelines:n,refreshDiagrams:r,isDefault:o,onClickHome:i,onNavigate:s}){const a=OR(e),[l,u]=D.useState(null),[d,c]=D.useState(!1),h=D.useRef(null),g=D.useCallback(p=>{u(null),c(!1),s(p)},[s]),y=D.useCallback(async()=>{const p=window.prompt("New diagram id (lowercase letters, digits, hyphens):","");if(p===null)return;const m=p.trim();if(!m)return;if(!/^[a-z0-9-]+$/.test(m)){window.alert("Invalid id. Use lowercase letters, digits, and hyphens only.");return}if(t.some(x=>x.id===m)){window.alert(`A diagram with id "${m}" already exists.`);return}const _=window.prompt("Title:",m.replace(/-/g," ").replace(/\b\w/g,x=>x.toUpperCase()))??m;try{await m1(m,_),r(),g({kind:"diagram",id:m})}catch(x){window.alert(`Failed to create diagram: ${x instanceof Error?x.message:String(x)}`)}},[t,r,g]),v=D.useCallback(p=>{if(!a.diagram)return;const m=DR(a.diagram,p),_={id:m,type:p,label:"Untitled",position:{x:200,y:200},status:"planned",code_refs:[],properties:{}};a.addNode(_),u({kind:"node",id:m}),c(!1)},[a]);if(a.loadError)return S.jsxs("div",{className:"app",children:[S.jsx("div",{className:"topbar",children:S.jsx("div",{className:"title",children:"loom-spec"})}),S.jsx("div",{className:"canvas-wrap",style:{padding:24},children:S.jsxs("code",{style:{color:"var(--status-stale)"},children:["Failed to load: ",a.loadError]})}),S.jsx("div",{className:"inspector",children:S.jsx("div",{className:"empty",children:"—"})})]});if(!a.diagram||!a.nodeTypes)return S.jsxs("div",{className:"app",children:[S.jsx("div",{className:"topbar",children:S.jsx("div",{className:"title",children:"loom-spec"})}),S.jsx("div",{className:"canvas-wrap",style:{padding:24,color:"var(--text-muted)"},children:"Loading…"}),S.jsx("div",{className:"inspector",children:S.jsx("div",{className:"empty",children:"—"})})]});const w=(l==null?void 0:l.kind)==="node"?a.diagram.nodes.find(p=>p.id===l.id)??null:null,f=(l==null?void 0:l.kind)==="edge"?a.diagram.edges.find(p=>p.id===l.id)??null:null;return S.jsxs("div",{className:"app",children:[S.jsx(CS,{viewKind:"diagram",viewId:e,title:a.diagram.title,subtitle:a.diagram.description,diagrams:t,timelines:n,saveStatus:a.saveStatus,saveError:a.saveError,connectionStatus:a.connectionStatus,validationErrorCount:a.validationErrors.length,onClickAdd:()=>c(p=>!p),addMenuOpen:d,isDefault:o,onClickHome:i,onNavigate:g,onCreateDiagram:y,addButtonRef:h}),d&&S.jsx(rA,{nodeTypes:a.nodeTypes,anchorRef:h,onPick:v,onClose:()=>c(!1)}),S.jsx(YR,{diagram:a.diagram,nodeTypesConfig:a.nodeTypes,selection:l,onSelect:u,onMoveNode:(p,m)=>a.updateNode(p,_=>({..._,position:m})),onDeleteNode:p=>{a.deleteNode(p),(l==null?void 0:l.kind)==="node"&&l.id===p&&u(null)},onDeleteEdge:p=>{a.deleteEdge(p),(l==null?void 0:l.kind)==="edge"&&l.id===p&&u(null)},onAddEdge:a.addEdge,onDrillDown:p=>g({kind:"diagram",id:p})}),S.jsx(ZR,{selectedNode:w,selectedEdge:f,nodeTypes:a.nodeTypes,validationErrors:a.validationErrors,onUpdateNode:a.updateNode,onUpdateEdge:a.updateEdge})]})}const th="overview",Ls={kind:"diagram",id:th};function sg(){if(typeof location>"u")return Ls;const e=location.hash.replace(/^#/,"").trim();if(!e)return Ls;if(e.startsWith("timeline:")){const t=e.slice(9).trim();return t?{kind:"timeline",id:t}:Ls}if(e.startsWith("diagram:")){const t=e.slice(8).trim();return t?{kind:"diagram",id:t}:Ls}return{kind:"diagram",id:e}}function iA(e){return e.kind==="diagram"&&e.id===th?"":e.kind==="diagram"?`#diagram:${e.id}`:`#timeline:${e.id}`}function sA(){const[e,t]=D.useState(()=>sg());D.useEffect(()=>{const o=()=>t(sg());return window.addEventListener("hashchange",o),()=>window.removeEventListener("hashchange",o)},[]);const n=D.useCallback(o=>{const i=iA(o);history.pushState(null,"",i||location.pathname),t(o)},[]),r=e.kind==="diagram"&&e.id===th;return{view:e,navigate:n,isDefault:r}}function aA(){const[e,t]=D.useState([]),[n,r]=D.useState(null),o=D.useCallback(()=>{oj().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]);return D.useEffect(()=>{o()},[o]),{diagrams:e,error:n,refresh:o}}function lA(){const[e,t]=D.useState([]),[n,r]=D.useState(null),o=D.useCallback(()=>{ij().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]);return D.useEffect(()=>{o()},[o]),{timelines:e,error:n,refresh:o}}const uA=D.lazy(()=>Zx(()=>import("./TimelineView-DEfpV9mL.js"),[]).then(e=>({default:e.TimelineView})));function cA(){const{view:e,navigate:t,isDefault:n}=sA(),{diagrams:r,refresh:o}=aA(),{timelines:i}=lA(),s=D.useCallback(()=>t({kind:"diagram",id:"overview"}),[t]),a=D.useCallback(async()=>{const l=window.prompt("New diagram id (lowercase letters, digits, hyphens):","");if(l===null)return;const u=l.trim();if(!u)return;if(!/^[a-z0-9-]+$/.test(u)){window.alert("Invalid id.");return}if(r.some(c=>c.id===u)){window.alert(`A diagram with id "${u}" already exists.`);return}const d=window.prompt("Title:",u.replace(/-/g," ").replace(/\b\w/g,c=>c.toUpperCase()))??u;try{await m1(u,d),o(),t({kind:"diagram",id:u})}catch(c){window.alert(`Failed to create diagram: ${c instanceof Error?c.message:String(c)}`)}},[r,o,t]);return e.kind==="timeline"?S.jsx(D.Suspense,{fallback:S.jsxs("div",{className:"app timeline-app",children:[S.jsx("div",{className:"topbar",children:S.jsx("div",{className:"title",children:"loom-spec"})}),S.jsx("div",{className:"canvas-wrap",style:{padding:24,color:"var(--text-muted)"},children:"Loading timeline view…"}),S.jsx("div",{className:"inspector",children:S.jsx("div",{className:"empty",children:"—"})})]}),children:S.jsx(uA,{id:e.id,diagrams:r,timelines:i,isDefault:n,onClickHome:s,onNavigate:t,onCreateDiagram:a})}):S.jsx(oA,{id:e.id,diagrams:r,timelines:i,refreshDiagrams:o,isDefault:n,onClickHome:s,onNavigate:t})}const $w=document.getElementById("root");if(!$w)throw new Error("#root not found");_y($w).render(S.jsx(D.StrictMode,{children:S.jsx(cA,{})}));export{YR as D,Ad as P,CS as T,dA as a,$e as c,S as j,Em as l,D as r,fA as s};
|