emviz 0.3.2 → 0.4.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/README.md +87 -1
- package/dist/actors.test.d.ts +2 -0
- package/dist/actors.test.d.ts.map +1 -0
- package/dist/agent-cli.d.ts +11 -0
- package/dist/agent-cli.d.ts.map +1 -0
- package/dist/app/assets/index-8T912aXf.js +171 -0
- package/dist/app/assets/{index-CrgcGOJd.css → index-DPbbANyA.css} +1 -1
- package/dist/app/index.html +2 -2
- package/dist/feedback.d.ts +110 -0
- package/dist/feedback.d.ts.map +1 -0
- package/dist/feedback.test.d.ts +2 -0
- package/dist/feedback.test.d.ts.map +1 -0
- package/dist/gitSources.d.ts +2 -0
- package/dist/gitSources.d.ts.map +1 -0
- package/dist/gitSources.test.d.ts +2 -0
- package/dist/gitSources.test.d.ts.map +1 -0
- package/dist/index.js +1072 -252
- package/dist/index.js.map +4 -4
- package/package.json +3 -3
- package/dist/app/assets/index-BuZINukD.js +0 -171
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function s(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(o){if(o.ep)return;o.ep=!0;const c=s(o);fetch(o.href,c)}})();function jv(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Rd={exports:{}},io={};var Fy;function qx(){if(Fy)return io;Fy=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function s(a,o,c){var u=null;if(c!==void 0&&(u=""+c),o.key!==void 0&&(u=""+o.key),"key"in o){c={};for(var d in o)d!=="key"&&(c[d]=o[d])}else c=o;return o=c.ref,{$$typeof:t,type:a,key:u,ref:o!==void 0?o:null,props:c}}return io.Fragment=n,io.jsx=s,io.jsxs=s,io}var Jy;function Vx(){return Jy||(Jy=1,Rd.exports=qx()),Rd.exports}var x=Vx(),Ld={exports:{}},Ne={};var Wy;function Yx(){if(Wy)return Ne;Wy=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function S(D){return D===null||typeof D!="object"?null:(D=y&&D[y]||D["@@iterator"],typeof D=="function"?D:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,N={};function C(D,$,ne){this.props=D,this.context=$,this.refs=N,this.updater=ne||w}C.prototype.isReactComponent={},C.prototype.setState=function(D,$){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,$,"setState")},C.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function j(){}j.prototype=C.prototype;function _(D,$,ne){this.props=D,this.context=$,this.refs=N,this.updater=ne||w}var A=_.prototype=new j;A.constructor=_,E(A,C.prototype),A.isPureReactComponent=!0;var T=Array.isArray;function M(){}var k={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function U(D,$,ne){var ie=ne.ref;return{$$typeof:t,type:D,key:$,ref:ie!==void 0?ie:null,props:ne}}function te(D,$){return U(D.type,$,D.props)}function Y(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function X(D){var $={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ne){return $[ne]})}var W=/\/+/g;function L(D,$){return typeof D=="object"&&D!==null&&D.key!=null?X(""+D.key):$.toString(36)}function G(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(M,M):(D.status="pending",D.then(function($){D.status==="pending"&&(D.status="fulfilled",D.value=$)},function($){D.status==="pending"&&(D.status="rejected",D.reason=$)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function z(D,$,ne,ie,ce){var he=typeof D;(he==="undefined"||he==="boolean")&&(D=null);var fe=!1;if(D===null)fe=!0;else switch(he){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(D.$$typeof){case t:case n:fe=!0;break;case v:return fe=D._init,z(fe(D._payload),$,ne,ie,ce)}}if(fe)return ce=ce(D),fe=ie===""?"."+L(D,0):ie,T(ce)?(ne="",fe!=null&&(ne=fe.replace(W,"$&/")+"/"),z(ce,$,ne,"",function(pe){return pe})):ce!=null&&(Y(ce)&&(ce=te(ce,ne+(ce.key==null||D&&D.key===ce.key?"":(""+ce.key).replace(W,"$&/")+"/")+fe)),$.push(ce)),1;fe=0;var K=ie===""?".":ie+":";if(T(D))for(var ue=0;ue<D.length;ue++)ie=D[ue],he=K+L(ie,ue),fe+=z(ie,$,ne,he,ce);else if(ue=S(D),typeof ue=="function")for(D=ue.call(D),ue=0;!(ie=D.next()).done;)ie=ie.value,he=K+L(ie,ue++),fe+=z(ie,$,ne,he,ce);else if(he==="object"){if(typeof D.then=="function")return z(G(D),$,ne,ie,ce);throw $=String(D),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return fe}function B(D,$,ne){if(D==null)return D;var ie=[],ce=0;return z(D,ie,"","",function(he){return $.call(ne,he,ce++)}),ie}function I(D){if(D._status===-1){var $=D._result;$=$(),$.then(function(ne){(D._status===0||D._status===-1)&&(D._status=1,D._result=ne)},function(ne){(D._status===0||D._status===-1)&&(D._status=2,D._result=ne)}),D._status===-1&&(D._status=0,D._result=$)}if(D._status===1)return D._result.default;throw D._result}var Q=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},se={map:B,forEach:function(D,$,ne){B(D,function(){$.apply(this,arguments)},ne)},count:function(D){var $=0;return B(D,function(){$++}),$},toArray:function(D){return B(D,function($){return $})||[]},only:function(D){if(!Y(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Ne.Activity=g,Ne.Children=se,Ne.Component=C,Ne.Fragment=s,Ne.Profiler=o,Ne.PureComponent=_,Ne.StrictMode=a,Ne.Suspense=h,Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,Ne.__COMPILER_RUNTIME={__proto__:null,c:function(D){return k.H.useMemoCache(D)}},Ne.cache=function(D){return function(){return D.apply(null,arguments)}},Ne.cacheSignal=function(){return null},Ne.cloneElement=function(D,$,ne){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var ie=E({},D.props),ce=D.key;if($!=null)for(he in $.key!==void 0&&(ce=""+$.key),$)!R.call($,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&$.ref===void 0||(ie[he]=$[he]);var he=arguments.length-2;if(he===1)ie.children=ne;else if(1<he){for(var fe=Array(he),K=0;K<he;K++)fe[K]=arguments[K+2];ie.children=fe}return U(D.type,ce,ie)},Ne.createContext=function(D){return D={$$typeof:u,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:c,_context:D},D},Ne.createElement=function(D,$,ne){var ie,ce={},he=null;if($!=null)for(ie in $.key!==void 0&&(he=""+$.key),$)R.call($,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(ce[ie]=$[ie]);var fe=arguments.length-2;if(fe===1)ce.children=ne;else if(1<fe){for(var K=Array(fe),ue=0;ue<fe;ue++)K[ue]=arguments[ue+2];ce.children=K}if(D&&D.defaultProps)for(ie in fe=D.defaultProps,fe)ce[ie]===void 0&&(ce[ie]=fe[ie]);return U(D,he,ce)},Ne.createRef=function(){return{current:null}},Ne.forwardRef=function(D){return{$$typeof:d,render:D}},Ne.isValidElement=Y,Ne.lazy=function(D){return{$$typeof:v,_payload:{_status:-1,_result:D},_init:I}},Ne.memo=function(D,$){return{$$typeof:p,type:D,compare:$===void 0?null:$}},Ne.startTransition=function(D){var $=k.T,ne={};k.T=ne;try{var ie=D(),ce=k.S;ce!==null&&ce(ne,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(M,Q)}catch(he){Q(he)}finally{$!==null&&ne.types!==null&&($.types=ne.types),k.T=$}},Ne.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},Ne.use=function(D){return k.H.use(D)},Ne.useActionState=function(D,$,ne){return k.H.useActionState(D,$,ne)},Ne.useCallback=function(D,$){return k.H.useCallback(D,$)},Ne.useContext=function(D){return k.H.useContext(D)},Ne.useDebugValue=function(){},Ne.useDeferredValue=function(D,$){return k.H.useDeferredValue(D,$)},Ne.useEffect=function(D,$){return k.H.useEffect(D,$)},Ne.useEffectEvent=function(D){return k.H.useEffectEvent(D)},Ne.useId=function(){return k.H.useId()},Ne.useImperativeHandle=function(D,$,ne){return k.H.useImperativeHandle(D,$,ne)},Ne.useInsertionEffect=function(D,$){return k.H.useInsertionEffect(D,$)},Ne.useLayoutEffect=function(D,$){return k.H.useLayoutEffect(D,$)},Ne.useMemo=function(D,$){return k.H.useMemo(D,$)},Ne.useOptimistic=function(D,$){return k.H.useOptimistic(D,$)},Ne.useReducer=function(D,$,ne){return k.H.useReducer(D,$,ne)},Ne.useRef=function(D){return k.H.useRef(D)},Ne.useState=function(D){return k.H.useState(D)},Ne.useSyncExternalStore=function(D,$,ne){return k.H.useSyncExternalStore(D,$,ne)},Ne.useTransition=function(){return k.H.useTransition()},Ne.version="19.2.7",Ne}var Py;function Oo(){return Py||(Py=1,Ld.exports=Yx()),Ld.exports}var V=Oo();const Jc=jv(V);var Bd={exports:{}},so={},Hd={exports:{}},$d={};var e0;function Gx(){return e0||(e0=1,(function(t){function n(z,B){var I=z.length;z.push(B);e:for(;0<I;){var Q=I-1>>>1,se=z[Q];if(0<o(se,B))z[Q]=B,z[I]=se,I=Q;else break e}}function s(z){return z.length===0?null:z[0]}function a(z){if(z.length===0)return null;var B=z[0],I=z.pop();if(I!==B){z[0]=I;e:for(var Q=0,se=z.length,D=se>>>1;Q<D;){var $=2*(Q+1)-1,ne=z[$],ie=$+1,ce=z[ie];if(0>o(ne,I))ie<se&&0>o(ce,ne)?(z[Q]=ce,z[ie]=I,Q=ie):(z[Q]=ne,z[$]=I,Q=$);else if(ie<se&&0>o(ce,I))z[Q]=ce,z[ie]=I,Q=ie;else break e}}return B}function o(z,B){var I=z.sortIndex-B.sortIndex;return I!==0?I:z.id-B.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var u=Date,d=u.now();t.unstable_now=function(){return u.now()-d}}var h=[],p=[],v=1,g=null,y=3,S=!1,w=!1,E=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function A(z){for(var B=s(p);B!==null;){if(B.callback===null)a(p);else if(B.startTime<=z)a(p),B.sortIndex=B.expirationTime,n(h,B);else break;B=s(p)}}function T(z){if(E=!1,A(z),!w)if(s(h)!==null)w=!0,M||(M=!0,X());else{var B=s(p);B!==null&&G(T,B.startTime-z)}}var M=!1,k=-1,R=5,U=-1;function te(){return N?!0:!(t.unstable_now()-U<R)}function Y(){if(N=!1,M){var z=t.unstable_now();U=z;var B=!0;try{e:{w=!1,E&&(E=!1,j(k),k=-1),S=!0;var I=y;try{t:{for(A(z),g=s(h);g!==null&&!(g.expirationTime>z&&te());){var Q=g.callback;if(typeof Q=="function"){g.callback=null,y=g.priorityLevel;var se=Q(g.expirationTime<=z);if(z=t.unstable_now(),typeof se=="function"){g.callback=se,A(z),B=!0;break t}g===s(h)&&a(h),A(z)}else a(h);g=s(h)}if(g!==null)B=!0;else{var D=s(p);D!==null&&G(T,D.startTime-z),B=!1}}break e}finally{g=null,y=I,S=!1}B=void 0}}finally{B?X():M=!1}}}var X;if(typeof _=="function")X=function(){_(Y)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,L=W.port2;W.port1.onmessage=Y,X=function(){L.postMessage(null)}}else X=function(){C(Y,0)};function G(z,B){k=C(function(){z(t.unstable_now())},B)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(z){z.callback=null},t.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_next=function(z){switch(y){case 1:case 2:case 3:var B=3;break;default:B=y}var I=y;y=B;try{return z()}finally{y=I}},t.unstable_requestPaint=function(){N=!0},t.unstable_runWithPriority=function(z,B){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var I=y;y=z;try{return B()}finally{y=I}},t.unstable_scheduleCallback=function(z,B,I){var Q=t.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?Q+I:Q):I=Q,z){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=I+se,z={id:v++,callback:B,priorityLevel:z,startTime:I,expirationTime:se,sortIndex:-1},I>Q?(z.sortIndex=I,n(p,z),s(h)===null&&z===s(p)&&(E?(j(k),k=-1):E=!0,G(T,I-Q))):(z.sortIndex=se,n(h,z),w||S||(w=!0,M||(M=!0,X()))),z},t.unstable_shouldYield=te,t.unstable_wrapCallback=function(z){var B=y;return function(){var I=y;y=B;try{return z.apply(this,arguments)}finally{y=I}}}})($d)),$d}var t0;function Ix(){return t0||(t0=1,Hd.exports=Gx()),Hd.exports}var Ud={exports:{}},jt={};var n0;function Xx(){if(n0)return jt;n0=1;var t=Oo();function n(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var a={d:{f:s,r:function(){throw Error(n(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(h,p,v){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:h,containerInfo:p,implementation:v}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return jt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,jt.createPortal=function(h,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return c(h,p,null,v)},jt.flushSync=function(h){var p=u.T,v=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=p,a.p=v,a.d.f()}},jt.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(h,p))},jt.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},jt.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var v=p.as,g=d(v,p.crossOrigin),y=typeof p.integrity=="string"?p.integrity:void 0,S=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?a.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:S}):v==="script"&&a.d.X(h,{crossOrigin:g,integrity:y,fetchPriority:S,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},jt.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=d(p.as,p.crossOrigin);a.d.M(h,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(h)},jt.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,g=d(v,p.crossOrigin);a.d.L(h,v,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},jt.preloadModule=function(h,p){if(typeof h=="string")if(p){var v=d(p.as,p.crossOrigin);a.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(h)},jt.requestFormReset=function(h){a.d.r(h)},jt.unstable_batchedUpdates=function(h,p){return h(p)},jt.useFormState=function(h,p,v){return u.H.useFormState(h,p,v)},jt.useFormStatus=function(){return u.H.useHostTransitionStatus()},jt.version="19.2.7",jt}var i0;function Rv(){if(i0)return Ud.exports;i0=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),Ud.exports=Xx(),Ud.exports}var s0;function Kx(){if(s0)return so;s0=1;var t=Ix(),n=Oo(),s=Rv();function a(e){var i="https://react.dev/errors/"+e;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var i=e,l=e;if(e.alternate)for(;i.return;)i=i.return;else{e=i;do i=e,(i.flags&4098)!==0&&(l=i.return),e=i.return;while(e)}return i.tag===3?l:null}function u(e){if(e.tag===13){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function d(e){if(e.tag===31){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function h(e){if(c(e)!==e)throw Error(a(188))}function p(e){var i=e.alternate;if(!i){if(i=c(e),i===null)throw Error(a(188));return i!==e?null:e}for(var l=e,r=i;;){var f=l.return;if(f===null)break;var m=f.alternate;if(m===null){if(r=f.return,r!==null){l=r;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===l)return h(f),e;if(m===r)return h(f),i;m=m.sibling}throw Error(a(188))}if(l.return!==r.return)l=f,r=m;else{for(var b=!1,O=f.child;O;){if(O===l){b=!0,l=f,r=m;break}if(O===r){b=!0,r=f,l=m;break}O=O.sibling}if(!b){for(O=m.child;O;){if(O===l){b=!0,l=m,r=f;break}if(O===r){b=!0,r=m,l=f;break}O=O.sibling}if(!b)throw Error(a(189))}}if(l.alternate!==r)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?e:i}function v(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e;for(e=e.child;e!==null;){if(i=v(e),i!==null)return i;e=e.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),_=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function X(e){return e===null||typeof e!="object"?null:(e=Y&&e[Y]||e["@@iterator"],typeof e=="function"?e:null)}var W=Symbol.for("react.client.reference");function L(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===W?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case C:return"Profiler";case N:return"StrictMode";case T:return"Suspense";case M:return"SuspenseList";case U:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case _:return e.displayName||"Context";case j:return(e._context.displayName||"Context")+".Consumer";case A:var i=e.render;return e=e.displayName,e||(e=i.displayName||i.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case k:return i=e.displayName||null,i!==null?i:L(e.type)||"Memo";case R:i=e._payload,e=e._init;try{return L(e(i))}catch{}}return null}var G=Array.isArray,z=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},Q=[],se=-1;function D(e){return{current:e}}function $(e){0>se||(e.current=Q[se],Q[se]=null,se--)}function ne(e,i){se++,Q[se]=e.current,e.current=i}var ie=D(null),ce=D(null),he=D(null),fe=D(null);function K(e,i){switch(ne(he,i),ne(ce,e),ne(ie,null),i.nodeType){case 9:case 11:e=(e=i.documentElement)&&(e=e.namespaceURI)?by(e):0;break;default:if(e=i.tagName,i=i.namespaceURI)i=by(i),e=Sy(i,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(ie),ne(ie,e)}function ue(){$(ie),$(ce),$(he)}function pe(e){e.memoizedState!==null&&ne(fe,e);var i=ie.current,l=Sy(i,e.type);i!==l&&(ne(ce,e),ne(ie,l))}function xe(e){ce.current===e&&($(ie),$(ce)),fe.current===e&&($(fe),Pa._currentValue=I)}var de,be;function Ee(e){if(de===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);de=i&&i[1]||"",be=-1<l.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+de+e+be}var ze=!1;function Ie(e,i){if(!e||ze)return"";ze=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(i){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(ee){var P=ee}Reflect.construct(e,[],re)}else{try{re.call()}catch(ee){P=ee}e.call(re.prototype)}}else{try{throw Error()}catch(ee){P=ee}(re=e())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(ee){if(ee&&P&&typeof ee.stack=="string")return[ee.stack,P.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=r.DetermineComponentFrameRoot(),b=m[0],O=m[1];if(b&&O){var H=b.split(`
|
|
4
|
+
`),J=O.split(`
|
|
5
|
+
`);for(f=r=0;r<H.length&&!H[r].includes("DetermineComponentFrameRoot");)r++;for(;f<J.length&&!J[f].includes("DetermineComponentFrameRoot");)f++;if(r===H.length||f===J.length)for(r=H.length-1,f=J.length-1;1<=r&&0<=f&&H[r]!==J[f];)f--;for(;1<=r&&0<=f;r--,f--)if(H[r]!==J[f]){if(r!==1||f!==1)do if(r--,f--,0>f||H[r]!==J[f]){var le=`
|
|
6
|
+
`+H[r].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=r&&0<=f);break}}}finally{ze=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Ee(l):""}function wt(e,i){switch(e.tag){case 26:case 27:case 5:return Ee(e.type);case 16:return Ee("Lazy");case 13:return e.child!==i&&i!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return Ie(e.type,!1);case 11:return Ie(e.type.render,!1);case 1:return Ie(e.type,!0);case 31:return Ee("Activity");default:return""}}function We(e){try{var i="",l=null;do i+=wt(e,l),l=e,e=e.return;while(e);return i}catch(r){return`
|
|
7
|
+
Error generating stack: `+r.message+`
|
|
8
|
+
`+r.stack}}var yt=Object.prototype.hasOwnProperty,Et=t.unstable_scheduleCallback,zt=t.unstable_cancelCallback,Yn=t.unstable_shouldYield,$t=t.unstable_requestPaint,Pe=t.unstable_now,rt=t.unstable_getCurrentPriorityLevel,Lt=t.unstable_ImmediatePriority,Qe=t.unstable_UserBlockingPriority,Dt=t.unstable_NormalPriority,ls=t.unstable_LowPriority,vi=t.unstable_IdlePriority,bn=t.log,ia=t.unstable_setDisableYieldValue,Gn=null,Nt=null;function on(e){if(typeof bn=="function"&&ia(e),Nt&&typeof Nt.setStrictMode=="function")try{Nt.setStrictMode(Gn,e)}catch{}}var _t=Math.clz32?Math.clz32:ae,sa=Math.log,la=Math.LN2;function ae(e){return e>>>=0,e===0?32:31-(sa(e)/la|0)|0}var ye=256,Me=262144,Ze=4194304;function vt(e){var i=e&42;if(i!==0)return i;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function At(e,i,l){var r=e.pendingLanes;if(r===0)return 0;var f=0,m=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var O=r&134217727;return O!==0?(r=O&~m,r!==0?f=vt(r):(b&=O,b!==0?f=vt(b):l||(l=O&~e,l!==0&&(f=vt(l))))):(O=r&~m,O!==0?f=vt(O):b!==0?f=vt(b):l||(l=r&~e,l!==0&&(f=vt(l)))),f===0?0:i!==0&&i!==f&&(i&m)===0&&(m=f&-f,l=i&-i,m>=l||m===32&&(l&4194048)!==0)?i:f}function In(e,i){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&i)===0}function Nu(e,i){switch(e){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32: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 i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qo(){var e=Ze;return Ze<<=1,(Ze&62914560)===0&&(Ze=4194304),e}function aa(e){for(var i=[],l=0;31>l;l++)i.push(e);return i}function as(e,i){e.pendingLanes|=i,i!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _u(e,i,l,r,f,m){var b=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var O=e.entanglements,H=e.expirationTimes,J=e.hiddenUpdates;for(l=b&~l;0<l;){var le=31-_t(l),re=1<<le;O[le]=0,H[le]=-1;var P=J[le];if(P!==null)for(J[le]=null,le=0;le<P.length;le++){var ee=P[le];ee!==null&&(ee.lane&=-536870913)}l&=~re}r!==0&&Vo(e,r,0),m!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=m&~(b&~i))}function Vo(e,i,l){e.pendingLanes|=i,e.suspendedLanes&=~i;var r=31-_t(i);e.entangledLanes|=i,e.entanglements[r]=e.entanglements[r]|1073741824|l&261930}function Yo(e,i){var l=e.entangledLanes|=i;for(e=e.entanglements;l;){var r=31-_t(l),f=1<<r;f&i|e[r]&i&&(e[r]|=i),l&=~f}}function Go(e,i){var l=i&-i;return l=(l&42)!==0?1:oa(l),(l&(e.suspendedLanes|i))!==0?0:l}function oa(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ra(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Io(){var e=B.p;return e!==0?e:(e=window.event,e===void 0?32:Yy(e.type))}function Xo(e,i){var l=B.p;try{return B.p=e,i()}finally{B.p=l}}var kn=Math.random().toString(36).slice(2),bt="__reactFiber$"+kn,kt="__reactProps$"+kn,Xn="__reactContainer$"+kn,Us="__reactEvents$"+kn,Ko="__reactListeners$"+kn,Au="__reactHandles$"+kn,Zo="__reactResources$"+kn,os="__reactMarker$"+kn;function ca(e){delete e[bt],delete e[kt],delete e[Us],delete e[Ko],delete e[Au]}function bi(e){var i=e[bt];if(i)return i;for(var l=e.parentNode;l;){if(i=l[Xn]||l[bt]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(e=Ty(e);e!==null;){if(l=e[bt])return l;e=Ty(e)}return i}e=l,l=e.parentNode}return null}function Si(e){if(e=e[bt]||e[Xn]){var i=e.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return e}return null}function wi(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e.stateNode;throw Error(a(33))}function xi(e){var i=e[Zo];return i||(i=e[Zo]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function ft(e){e[os]=!0}var Qo=new Set,Fo={};function Kn(e,i){Ei(e,i),Ei(e+"Capture",i)}function Ei(e,i){for(Fo[e]=i,e=0;e<i.length;e++)Qo.add(i[e])}var Tu=RegExp("^[: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]*$"),Jo={},ua={};function Mu(e){return yt.call(ua,e)?!0:yt.call(Jo,e)?!1:Tu.test(e)?ua[e]=!0:(Jo[e]=!0,!1)}function qs(e,i,l){if(Mu(i))if(l===null)e.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(i);return;case"boolean":var r=i.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(i);return}}e.setAttribute(i,""+l)}}function Vs(e,i,l){if(l===null)e.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttribute(i,""+l)}}function Sn(e,i,l,r){if(r===null)e.removeAttribute(l);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(i,l,""+r)}}function Ut(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wo(e){var i=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Cu(e,i,l){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,i);if(!e.hasOwnProperty(i)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var f=r.get,m=r.set;return Object.defineProperty(e,i,{configurable:!0,get:function(){return f.call(this)},set:function(b){l=""+b,m.call(this,b)}}),Object.defineProperty(e,i,{enumerable:r.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){e._valueTracker=null,delete e[i]}}}}function fa(e){if(!e._valueTracker){var i=Wo(e)?"checked":"value";e._valueTracker=Cu(e,i,""+e[i])}}function da(e){if(!e)return!1;var i=e._valueTracker;if(!i)return!0;var l=i.getValue(),r="";return e&&(r=Wo(e)?e.checked?"true":"false":e.value),e=r,e!==l?(i.setValue(e),!0):!1}function Ys(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}}var Po=/[\n"\\]/g;function qt(e){return e.replace(Po,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function ha(e,i,l,r,f,m,b,O){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),i!=null?b==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+Ut(i)):e.value!==""+Ut(i)&&(e.value=""+Ut(i)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),i!=null?ma(e,b,Ut(i)):l!=null?ma(e,b,Ut(l)):r!=null&&e.removeAttribute("value"),f==null&&m!=null&&(e.defaultChecked=!!m),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?e.name=""+Ut(O):e.removeAttribute("name")}function Gs(e,i,l,r,f,m,b,O){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.type=m),i!=null||l!=null){if(!(m!=="submit"&&m!=="reset"||i!=null)){fa(e);return}l=l!=null?""+Ut(l):"",i=i!=null?""+Ut(i):l,O||i===e.value||(e.value=i),e.defaultValue=i}r=r??f,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=O?e.checked:!!r,e.defaultChecked=!!r,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),fa(e)}function ma(e,i,l){i==="number"&&Ys(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Ni(e,i,l,r){if(e=e.options,i){i={};for(var f=0;f<l.length;f++)i["$"+l[f]]=!0;for(l=0;l<e.length;l++)f=i.hasOwnProperty("$"+e[l].value),e[l].selected!==f&&(e[l].selected=f),f&&r&&(e[l].defaultSelected=!0)}else{for(l=""+Ut(l),i=null,f=0;f<e.length;f++){if(e[f].value===l){e[f].selected=!0,r&&(e[f].defaultSelected=!0);return}i!==null||e[f].disabled||(i=e[f])}i!==null&&(i.selected=!0)}}function pa(e,i,l){if(i!=null&&(i=""+Ut(i),i!==e.value&&(e.value=i),l==null)){e.defaultValue!==i&&(e.defaultValue=i);return}e.defaultValue=l!=null?""+Ut(l):""}function pm(e,i,l,r){if(i==null){if(r!=null){if(l!=null)throw Error(a(92));if(G(r)){if(1<r.length)throw Error(a(93));r=r[0]}l=r}l==null&&(l=""),i=l}l=Ut(i),e.defaultValue=l,r=e.textContent,r===l&&r!==""&&r!==null&&(e.value=r),fa(e)}function Is(e,i){if(i){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=i;return}}e.textContent=i}var LS=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function gm(e,i,l){var r=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?r?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="":r?e.setProperty(i,l):typeof l!="number"||l===0||LS.has(i)?i==="float"?e.cssFloat=l:e[i]=(""+l).trim():e[i]=l+"px"}function ym(e,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(e=e.style,l!=null){for(var r in l)!l.hasOwnProperty(r)||i!=null&&i.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var f in i)r=i[f],i.hasOwnProperty(f)&&l[f]!==r&&gm(e,f,r)}else for(var m in i)i.hasOwnProperty(m)&&gm(e,m,i[m])}function Ou(e){if(e.indexOf("-")===-1)return!1;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 BS=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),HS=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function er(e){return HS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Zn(){}var zu=null;function Du(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xs=null,Ks=null;function vm(e){var i=Si(e);if(i&&(e=i.stateNode)){var l=e[kt]||null;e:switch(e=i.stateNode,i.type){case"input":if(ha(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+qt(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var r=l[i];if(r!==e&&r.form===e.form){var f=r[kt]||null;if(!f)throw Error(a(90));ha(r,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(i=0;i<l.length;i++)r=l[i],r.form===e.form&&da(r)}break e;case"textarea":pa(e,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&Ni(e,!!l.multiple,i,!1)}}}var ku=!1;function bm(e,i,l){if(ku)return e(i,l);ku=!0;try{var r=e(i);return r}finally{if(ku=!1,(Xs!==null||Ks!==null)&&(qr(),Xs&&(i=Xs,e=Ks,Ks=Xs=null,vm(i),e)))for(i=0;i<e.length;i++)vm(e[i])}}function ga(e,i){var l=e.stateNode;if(l===null)return null;var r=l[kt]||null;if(r===null)return null;l=r[i];e:switch(i){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(l&&typeof l!="function")throw Error(a(231,i,typeof l));return l}var Qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ju=!1;if(Qn)try{var ya={};Object.defineProperty(ya,"passive",{get:function(){ju=!0}}),window.addEventListener("test",ya,ya),window.removeEventListener("test",ya,ya)}catch{ju=!1}var _i=null,Ru=null,tr=null;function Sm(){if(tr)return tr;var e,i=Ru,l=i.length,r,f="value"in _i?_i.value:_i.textContent,m=f.length;for(e=0;e<l&&i[e]===f[e];e++);var b=l-e;for(r=1;r<=b&&i[l-r]===f[m-r];r++);return tr=f.slice(e,1<r?1-r:void 0)}function nr(e){var i=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&i===13&&(e=13)):e=i,e===10&&(e=13),32<=e||e===13?e:0}function ir(){return!0}function wm(){return!1}function Vt(e){function i(l,r,f,m,b){this._reactName=l,this._targetInst=f,this.type=r,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var O in e)e.hasOwnProperty(O)&&(l=e[O],this[O]=l?l(m):m[O]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?ir:wm,this.isPropagationStopped=wm,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=ir)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=ir)},persist:function(){},isPersistent:ir}),i}var rs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sr=Vt(rs),va=g({},rs,{view:0,detail:0}),$S=Vt(va),Lu,Bu,ba,lr=g({},va,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$u,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!==ba&&(ba&&e.type==="mousemove"?(Lu=e.screenX-ba.screenX,Bu=e.screenY-ba.screenY):Bu=Lu=0,ba=e),Lu)},movementY:function(e){return"movementY"in e?e.movementY:Bu}}),xm=Vt(lr),US=g({},lr,{dataTransfer:0}),qS=Vt(US),VS=g({},va,{relatedTarget:0}),Hu=Vt(VS),YS=g({},rs,{animationName:0,elapsedTime:0,pseudoElement:0}),GS=Vt(YS),IS=g({},rs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),XS=Vt(IS),KS=g({},rs,{data:0}),Em=Vt(KS),ZS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},QS={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"},FS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function JS(e){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(e):(e=FS[e])?!!i[e]:!1}function $u(){return JS}var WS=g({},va,{key:function(e){if(e.key){var i=ZS[e.key]||e.key;if(i!=="Unidentified")return i}return e.type==="keypress"?(e=nr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?QS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$u,charCode:function(e){return e.type==="keypress"?nr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?nr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),PS=Vt(WS),ew=g({},lr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nm=Vt(ew),tw=g({},va,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$u}),nw=Vt(tw),iw=g({},rs,{propertyName:0,elapsedTime:0,pseudoElement:0}),sw=Vt(iw),lw=g({},lr,{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}),aw=Vt(lw),ow=g({},rs,{newState:0,oldState:0}),rw=Vt(ow),cw=[9,13,27,32],Uu=Qn&&"CompositionEvent"in window,Sa=null;Qn&&"documentMode"in document&&(Sa=document.documentMode);var uw=Qn&&"TextEvent"in window&&!Sa,_m=Qn&&(!Uu||Sa&&8<Sa&&11>=Sa),Am=" ",Tm=!1;function Mm(e,i){switch(e){case"keyup":return cw.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zs=!1;function fw(e,i){switch(e){case"compositionend":return Cm(i);case"keypress":return i.which!==32?null:(Tm=!0,Am);case"textInput":return e=i.data,e===Am&&Tm?null:e;default:return null}}function dw(e,i){if(Zs)return e==="compositionend"||!Uu&&Mm(e,i)?(e=Sm(),tr=Ru=_i=null,Zs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return _m&&i.locale!=="ko"?null:i.data;default:return null}}var hw={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 Om(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i==="input"?!!hw[e.type]:i==="textarea"}function zm(e,i,l,r){Xs?Ks?Ks.push(r):Ks=[r]:Xs=r,i=Zr(i,"onChange"),0<i.length&&(l=new sr("onChange","change",null,l,r),e.push({event:l,listeners:i}))}var wa=null,xa=null;function mw(e){hy(e,0)}function ar(e){var i=wi(e);if(da(i))return e}function Dm(e,i){if(e==="change")return i}var km=!1;if(Qn){var qu;if(Qn){var Vu="oninput"in document;if(!Vu){var jm=document.createElement("div");jm.setAttribute("oninput","return;"),Vu=typeof jm.oninput=="function"}qu=Vu}else qu=!1;km=qu&&(!document.documentMode||9<document.documentMode)}function Rm(){wa&&(wa.detachEvent("onpropertychange",Lm),xa=wa=null)}function Lm(e){if(e.propertyName==="value"&&ar(xa)){var i=[];zm(i,xa,e,Du(e)),bm(mw,i)}}function pw(e,i,l){e==="focusin"?(Rm(),wa=i,xa=l,wa.attachEvent("onpropertychange",Lm)):e==="focusout"&&Rm()}function gw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ar(xa)}function yw(e,i){if(e==="click")return ar(i)}function vw(e,i){if(e==="input"||e==="change")return ar(i)}function bw(e,i){return e===i&&(e!==0||1/e===1/i)||e!==e&&i!==i}var Ft=typeof Object.is=="function"?Object.is:bw;function Ea(e,i){if(Ft(e,i))return!0;if(typeof e!="object"||e===null||typeof i!="object"||i===null)return!1;var l=Object.keys(e),r=Object.keys(i);if(l.length!==r.length)return!1;for(r=0;r<l.length;r++){var f=l[r];if(!yt.call(i,f)||!Ft(e[f],i[f]))return!1}return!0}function Bm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Hm(e,i){var l=Bm(e);e=0;for(var r;l;){if(l.nodeType===3){if(r=e+l.textContent.length,e<=i&&r>=i)return{node:l,offset:i-e};e=r}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Bm(l)}}function $m(e,i){return e&&i?e===i?!0:e&&e.nodeType===3?!1:i&&i.nodeType===3?$m(e,i.parentNode):"contains"in e?e.contains(i):e.compareDocumentPosition?!!(e.compareDocumentPosition(i)&16):!1:!1}function Um(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var i=Ys(e.document);i instanceof e.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)e=i.contentWindow;else break;i=Ys(e.document)}return i}function Yu(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i&&(i==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||i==="textarea"||e.contentEditable==="true")}var Sw=Qn&&"documentMode"in document&&11>=document.documentMode,Qs=null,Gu=null,Na=null,Iu=!1;function qm(e,i,l){var r=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Iu||Qs==null||Qs!==Ys(r)||(r=Qs,"selectionStart"in r&&Yu(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}),Na&&Ea(Na,r)||(Na=r,r=Zr(Gu,"onSelect"),0<r.length&&(i=new sr("onSelect","select",null,i,l),e.push({event:i,listeners:r}),i.target=Qs)))}function cs(e,i){var l={};return l[e.toLowerCase()]=i.toLowerCase(),l["Webkit"+e]="webkit"+i,l["Moz"+e]="moz"+i,l}var Fs={animationend:cs("Animation","AnimationEnd"),animationiteration:cs("Animation","AnimationIteration"),animationstart:cs("Animation","AnimationStart"),transitionrun:cs("Transition","TransitionRun"),transitionstart:cs("Transition","TransitionStart"),transitioncancel:cs("Transition","TransitionCancel"),transitionend:cs("Transition","TransitionEnd")},Xu={},Vm={};Qn&&(Vm=document.createElement("div").style,"AnimationEvent"in window||(delete Fs.animationend.animation,delete Fs.animationiteration.animation,delete Fs.animationstart.animation),"TransitionEvent"in window||delete Fs.transitionend.transition);function us(e){if(Xu[e])return Xu[e];if(!Fs[e])return e;var i=Fs[e],l;for(l in i)if(i.hasOwnProperty(l)&&l in Vm)return Xu[e]=i[l];return e}var Ym=us("animationend"),Gm=us("animationiteration"),Im=us("animationstart"),ww=us("transitionrun"),xw=us("transitionstart"),Ew=us("transitioncancel"),Xm=us("transitionend"),Km=new Map,Ku="abort auxClick beforeToggle 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(" ");Ku.push("scrollEnd");function wn(e,i){Km.set(e,i),Kn(i,[e])}var or=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},rn=[],Js=0,Zu=0;function rr(){for(var e=Js,i=Zu=Js=0;i<e;){var l=rn[i];rn[i++]=null;var r=rn[i];rn[i++]=null;var f=rn[i];rn[i++]=null;var m=rn[i];if(rn[i++]=null,r!==null&&f!==null){var b=r.pending;b===null?f.next=f:(f.next=b.next,b.next=f),r.pending=f}m!==0&&Zm(l,f,m)}}function cr(e,i,l,r){rn[Js++]=e,rn[Js++]=i,rn[Js++]=l,rn[Js++]=r,Zu|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Qu(e,i,l,r){return cr(e,i,l,r),ur(e)}function fs(e,i){return cr(e,null,null,i),ur(e)}function Zm(e,i,l){e.lanes|=l;var r=e.alternate;r!==null&&(r.lanes|=l);for(var f=!1,m=e.return;m!==null;)m.childLanes|=l,r=m.alternate,r!==null&&(r.childLanes|=l),m.tag===22&&(e=m.stateNode,e===null||e._visibility&1||(f=!0)),e=m,m=m.return;return e.tag===3?(m=e.stateNode,f&&i!==null&&(f=31-_t(l),e=m.hiddenUpdates,r=e[f],r===null?e[f]=[i]:r.push(i),i.lane=l|536870912),m):null}function ur(e){if(50<Xa)throw Xa=0,ld=null,Error(a(185));for(var i=e.return;i!==null;)e=i,i=e.return;return e.tag===3?e.stateNode:null}var Ws={};function Nw(e,i,l,r){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,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 Jt(e,i,l,r){return new Nw(e,i,l,r)}function Fu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fn(e,i){var l=e.alternate;return l===null?(l=Jt(e.tag,i,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=i,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,i=e.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Qm(e,i){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=i,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,i=l.dependencies,e.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),e}function fr(e,i,l,r,f,m){var b=0;if(r=e,typeof e=="function")Fu(e)&&(b=1);else if(typeof e=="string")b=Cx(e,l,ie.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case U:return e=Jt(31,l,i,f),e.elementType=U,e.lanes=m,e;case E:return ds(l.children,f,m,i);case N:b=8,f|=24;break;case C:return e=Jt(12,l,i,f|2),e.elementType=C,e.lanes=m,e;case T:return e=Jt(13,l,i,f),e.elementType=T,e.lanes=m,e;case M:return e=Jt(19,l,i,f),e.elementType=M,e.lanes=m,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _:b=10;break e;case j:b=9;break e;case A:b=11;break e;case k:b=14;break e;case R:b=16,r=null;break e}b=29,l=Error(a(130,e===null?"null":typeof e,"")),r=null}return i=Jt(b,l,i,f),i.elementType=e,i.type=r,i.lanes=m,i}function ds(e,i,l,r){return e=Jt(7,e,r,i),e.lanes=l,e}function Ju(e,i,l){return e=Jt(6,e,null,i),e.lanes=l,e}function Fm(e){var i=Jt(18,null,null,0);return i.stateNode=e,i}function Wu(e,i,l){return i=Jt(4,e.children!==null?e.children:[],e.key,i),i.lanes=l,i.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},i}var Jm=new WeakMap;function cn(e,i){if(typeof e=="object"&&e!==null){var l=Jm.get(e);return l!==void 0?l:(i={value:e,source:i,stack:We(i)},Jm.set(e,i),i)}return{value:e,source:i,stack:We(i)}}var Ps=[],el=0,dr=null,_a=0,un=[],fn=0,Ai=null,jn=1,Rn="";function Jn(e,i){Ps[el++]=_a,Ps[el++]=dr,dr=e,_a=i}function Wm(e,i,l){un[fn++]=jn,un[fn++]=Rn,un[fn++]=Ai,Ai=e;var r=jn;e=Rn;var f=32-_t(r)-1;r&=~(1<<f),l+=1;var m=32-_t(i)+f;if(30<m){var b=f-f%5;m=(r&(1<<b)-1).toString(32),r>>=b,f-=b,jn=1<<32-_t(i)+f|l<<f|r,Rn=m+e}else jn=1<<m|l<<f|r,Rn=e}function Pu(e){e.return!==null&&(Jn(e,1),Wm(e,1,0))}function ef(e){for(;e===dr;)dr=Ps[--el],Ps[el]=null,_a=Ps[--el],Ps[el]=null;for(;e===Ai;)Ai=un[--fn],un[fn]=null,Rn=un[--fn],un[fn]=null,jn=un[--fn],un[fn]=null}function Pm(e,i){un[fn++]=jn,un[fn++]=Rn,un[fn++]=Ai,jn=i.id,Rn=i.overflow,Ai=e}var Tt=null,Fe=null,je=!1,Ti=null,dn=!1,tf=Error(a(519));function Mi(e){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Aa(cn(i,e)),tf}function ep(e){var i=e.stateNode,l=e.type,r=e.memoizedProps;switch(i[bt]=e,i[kt]=r,l){case"dialog":Oe("cancel",i),Oe("close",i);break;case"iframe":case"object":case"embed":Oe("load",i);break;case"video":case"audio":for(l=0;l<Za.length;l++)Oe(Za[l],i);break;case"source":Oe("error",i);break;case"img":case"image":case"link":Oe("error",i),Oe("load",i);break;case"details":Oe("toggle",i);break;case"input":Oe("invalid",i),Gs(i,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Oe("invalid",i);break;case"textarea":Oe("invalid",i),pm(i,r.value,r.defaultValue,r.children)}l=r.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||r.suppressHydrationWarning===!0||yy(i.textContent,l)?(r.popover!=null&&(Oe("beforetoggle",i),Oe("toggle",i)),r.onScroll!=null&&Oe("scroll",i),r.onScrollEnd!=null&&Oe("scrollend",i),r.onClick!=null&&(i.onclick=Zn),i=!0):i=!1,i||Mi(e,!0)}function tp(e){for(Tt=e.return;Tt;)switch(Tt.tag){case 5:case 31:case 13:dn=!1;return;case 27:case 3:dn=!0;return;default:Tt=Tt.return}}function tl(e){if(e!==Tt)return!1;if(!je)return tp(e),je=!0,!1;var i=e.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Sd(e.type,e.memoizedProps)),l=!l),l&&Fe&&Mi(e),tp(e),i===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Fe=Ay(e)}else if(i===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Fe=Ay(e)}else i===27?(i=Fe,Vi(e.type)?(e=_d,_d=null,Fe=e):Fe=i):Fe=Tt?mn(e.stateNode.nextSibling):null;return!0}function hs(){Fe=Tt=null,je=!1}function nf(){var e=Ti;return e!==null&&(Xt===null?Xt=e:Xt.push.apply(Xt,e),Ti=null),e}function Aa(e){Ti===null?Ti=[e]:Ti.push(e)}var sf=D(null),ms=null,Wn=null;function Ci(e,i,l){ne(sf,i._currentValue),i._currentValue=l}function Pn(e){e._currentValue=sf.current,$(sf)}function lf(e,i,l){for(;e!==null;){var r=e.alternate;if((e.childLanes&i)!==i?(e.childLanes|=i,r!==null&&(r.childLanes|=i)):r!==null&&(r.childLanes&i)!==i&&(r.childLanes|=i),e===l)break;e=e.return}}function af(e,i,l,r){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var m=f.dependencies;if(m!==null){var b=f.child;m=m.firstContext;e:for(;m!==null;){var O=m;m=f;for(var H=0;H<i.length;H++)if(O.context===i[H]){m.lanes|=l,O=m.alternate,O!==null&&(O.lanes|=l),lf(m.return,l,e),r||(b=null);break e}m=O.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error(a(341));b.lanes|=l,m=b.alternate,m!==null&&(m.lanes|=l),lf(b,l,e),b=null}else b=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===e){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function nl(e,i,l,r){e=null;for(var f=i,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var b=f.alternate;if(b===null)throw Error(a(387));if(b=b.memoizedProps,b!==null){var O=f.type;Ft(f.pendingProps.value,b.value)||(e!==null?e.push(O):e=[O])}}else if(f===fe.current){if(b=f.alternate,b===null)throw Error(a(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(Pa):e=[Pa])}f=f.return}e!==null&&af(i,e,l,r),i.flags|=262144}function hr(e){for(e=e.firstContext;e!==null;){if(!Ft(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ps(e){ms=e,Wn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Mt(e){return np(ms,e)}function mr(e,i){return ms===null&&ps(e),np(e,i)}function np(e,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},Wn===null){if(e===null)throw Error(a(308));Wn=i,e.dependencies={lanes:0,firstContext:i},e.flags|=524288}else Wn=Wn.next=i;return l}var _w=typeof AbortController<"u"?AbortController:function(){var e=[],i=this.signal={aborted:!1,addEventListener:function(l,r){e.push(r)}};this.abort=function(){i.aborted=!0,e.forEach(function(l){return l()})}},Aw=t.unstable_scheduleCallback,Tw=t.unstable_NormalPriority,dt={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function of(){return{controller:new _w,data:new Map,refCount:0}}function Ta(e){e.refCount--,e.refCount===0&&Aw(Tw,function(){e.controller.abort()})}var Ma=null,rf=0,il=0,sl=null;function Mw(e,i){if(Ma===null){var l=Ma=[];rf=0,il=fd(),sl={status:"pending",value:void 0,then:function(r){l.push(r)}}}return rf++,i.then(ip,ip),i}function ip(){if(--rf===0&&Ma!==null){sl!==null&&(sl.status="fulfilled");var e=Ma;Ma=null,il=0,sl=null;for(var i=0;i<e.length;i++)(0,e[i])()}}function Cw(e,i){var l=[],r={status:"pending",value:null,reason:null,then:function(f){l.push(f)}};return e.then(function(){r.status="fulfilled",r.value=i;for(var f=0;f<l.length;f++)(0,l[f])(i)},function(f){for(r.status="rejected",r.reason=f,f=0;f<l.length;f++)(0,l[f])(void 0)}),r}var sp=z.S;z.S=function(e,i){qg=Pe(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Mw(e,i),sp!==null&&sp(e,i)};var gs=D(null);function cf(){var e=gs.current;return e!==null?e:Xe.pooledCache}function pr(e,i){i===null?ne(gs,gs.current):ne(gs,i.pool)}function lp(){var e=cf();return e===null?null:{parent:dt._currentValue,pool:e}}var ll=Error(a(460)),uf=Error(a(474)),gr=Error(a(542)),yr={then:function(){}};function ap(e){return e=e.status,e==="fulfilled"||e==="rejected"}function op(e,i,l){switch(l=e[l],l===void 0?e.push(i):l!==i&&(i.then(Zn,Zn),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,cp(e),e;default:if(typeof i.status=="string")i.then(Zn,Zn);else{if(e=Xe,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=i,e.status="pending",e.then(function(r){if(i.status==="pending"){var f=i;f.status="fulfilled",f.value=r}},function(r){if(i.status==="pending"){var f=i;f.status="rejected",f.reason=r}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,cp(e),e}throw vs=i,ll}}function ys(e){try{var i=e._init;return i(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(vs=l,ll):l}}var vs=null;function rp(){if(vs===null)throw Error(a(459));var e=vs;return vs=null,e}function cp(e){if(e===ll||e===gr)throw Error(a(483))}var al=null,Ca=0;function vr(e){var i=Ca;return Ca+=1,al===null&&(al=[]),op(al,e,i)}function Oa(e,i){i=i.props.ref,e.ref=i!==void 0?i:null}function br(e,i){throw i.$$typeof===y?Error(a(525)):(e=Object.prototype.toString.call(i),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":e)))}function up(e){function i(Z,q){if(e){var F=Z.deletions;F===null?(Z.deletions=[q],Z.flags|=16):F.push(q)}}function l(Z,q){if(!e)return null;for(;q!==null;)i(Z,q),q=q.sibling;return null}function r(Z){for(var q=new Map;Z!==null;)Z.key!==null?q.set(Z.key,Z):q.set(Z.index,Z),Z=Z.sibling;return q}function f(Z,q){return Z=Fn(Z,q),Z.index=0,Z.sibling=null,Z}function m(Z,q,F){return Z.index=F,e?(F=Z.alternate,F!==null?(F=F.index,F<q?(Z.flags|=67108866,q):F):(Z.flags|=67108866,q)):(Z.flags|=1048576,q)}function b(Z){return e&&Z.alternate===null&&(Z.flags|=67108866),Z}function O(Z,q,F,oe){return q===null||q.tag!==6?(q=Ju(F,Z.mode,oe),q.return=Z,q):(q=f(q,F),q.return=Z,q)}function H(Z,q,F,oe){var Se=F.type;return Se===E?le(Z,q,F.props.children,oe,F.key):q!==null&&(q.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===R&&ys(Se)===q.type)?(q=f(q,F.props),Oa(q,F),q.return=Z,q):(q=fr(F.type,F.key,F.props,null,Z.mode,oe),Oa(q,F),q.return=Z,q)}function J(Z,q,F,oe){return q===null||q.tag!==4||q.stateNode.containerInfo!==F.containerInfo||q.stateNode.implementation!==F.implementation?(q=Wu(F,Z.mode,oe),q.return=Z,q):(q=f(q,F.children||[]),q.return=Z,q)}function le(Z,q,F,oe,Se){return q===null||q.tag!==7?(q=ds(F,Z.mode,oe,Se),q.return=Z,q):(q=f(q,F),q.return=Z,q)}function re(Z,q,F){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Ju(""+q,Z.mode,F),q.return=Z,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case S:return F=fr(q.type,q.key,q.props,null,Z.mode,F),Oa(F,q),F.return=Z,F;case w:return q=Wu(q,Z.mode,F),q.return=Z,q;case R:return q=ys(q),re(Z,q,F)}if(G(q)||X(q))return q=ds(q,Z.mode,F,null),q.return=Z,q;if(typeof q.then=="function")return re(Z,vr(q),F);if(q.$$typeof===_)return re(Z,mr(Z,q),F);br(Z,q)}return null}function P(Z,q,F,oe){var Se=q!==null?q.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return Se!==null?null:O(Z,q,""+F,oe);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case S:return F.key===Se?H(Z,q,F,oe):null;case w:return F.key===Se?J(Z,q,F,oe):null;case R:return F=ys(F),P(Z,q,F,oe)}if(G(F)||X(F))return Se!==null?null:le(Z,q,F,oe,null);if(typeof F.then=="function")return P(Z,q,vr(F),oe);if(F.$$typeof===_)return P(Z,q,mr(Z,F),oe);br(Z,F)}return null}function ee(Z,q,F,oe,Se){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Z=Z.get(F)||null,O(q,Z,""+oe,Se);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case S:return Z=Z.get(oe.key===null?F:oe.key)||null,H(q,Z,oe,Se);case w:return Z=Z.get(oe.key===null?F:oe.key)||null,J(q,Z,oe,Se);case R:return oe=ys(oe),ee(Z,q,F,oe,Se)}if(G(oe)||X(oe))return Z=Z.get(F)||null,le(q,Z,oe,Se,null);if(typeof oe.then=="function")return ee(Z,q,F,vr(oe),Se);if(oe.$$typeof===_)return ee(Z,q,F,mr(q,oe),Se);br(q,oe)}return null}function ge(Z,q,F,oe){for(var Se=null,Le=null,ve=q,Te=q=0,ke=null;ve!==null&&Te<F.length;Te++){ve.index>Te?(ke=ve,ve=null):ke=ve.sibling;var Be=P(Z,ve,F[Te],oe);if(Be===null){ve===null&&(ve=ke);break}e&&ve&&Be.alternate===null&&i(Z,ve),q=m(Be,q,Te),Le===null?Se=Be:Le.sibling=Be,Le=Be,ve=ke}if(Te===F.length)return l(Z,ve),je&&Jn(Z,Te),Se;if(ve===null){for(;Te<F.length;Te++)ve=re(Z,F[Te],oe),ve!==null&&(q=m(ve,q,Te),Le===null?Se=ve:Le.sibling=ve,Le=ve);return je&&Jn(Z,Te),Se}for(ve=r(ve);Te<F.length;Te++)ke=ee(ve,Z,Te,F[Te],oe),ke!==null&&(e&&ke.alternate!==null&&ve.delete(ke.key===null?Te:ke.key),q=m(ke,q,Te),Le===null?Se=ke:Le.sibling=ke,Le=ke);return e&&ve.forEach(function(Ki){return i(Z,Ki)}),je&&Jn(Z,Te),Se}function we(Z,q,F,oe){if(F==null)throw Error(a(151));for(var Se=null,Le=null,ve=q,Te=q=0,ke=null,Be=F.next();ve!==null&&!Be.done;Te++,Be=F.next()){ve.index>Te?(ke=ve,ve=null):ke=ve.sibling;var Ki=P(Z,ve,Be.value,oe);if(Ki===null){ve===null&&(ve=ke);break}e&&ve&&Ki.alternate===null&&i(Z,ve),q=m(Ki,q,Te),Le===null?Se=Ki:Le.sibling=Ki,Le=Ki,ve=ke}if(Be.done)return l(Z,ve),je&&Jn(Z,Te),Se;if(ve===null){for(;!Be.done;Te++,Be=F.next())Be=re(Z,Be.value,oe),Be!==null&&(q=m(Be,q,Te),Le===null?Se=Be:Le.sibling=Be,Le=Be);return je&&Jn(Z,Te),Se}for(ve=r(ve);!Be.done;Te++,Be=F.next())Be=ee(ve,Z,Te,Be.value,oe),Be!==null&&(e&&Be.alternate!==null&&ve.delete(Be.key===null?Te:Be.key),q=m(Be,q,Te),Le===null?Se=Be:Le.sibling=Be,Le=Be);return e&&ve.forEach(function(Ux){return i(Z,Ux)}),je&&Jn(Z,Te),Se}function Ge(Z,q,F,oe){if(typeof F=="object"&&F!==null&&F.type===E&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case S:e:{for(var Se=F.key;q!==null;){if(q.key===Se){if(Se=F.type,Se===E){if(q.tag===7){l(Z,q.sibling),oe=f(q,F.props.children),oe.return=Z,Z=oe;break e}}else if(q.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===R&&ys(Se)===q.type){l(Z,q.sibling),oe=f(q,F.props),Oa(oe,F),oe.return=Z,Z=oe;break e}l(Z,q);break}else i(Z,q);q=q.sibling}F.type===E?(oe=ds(F.props.children,Z.mode,oe,F.key),oe.return=Z,Z=oe):(oe=fr(F.type,F.key,F.props,null,Z.mode,oe),Oa(oe,F),oe.return=Z,Z=oe)}return b(Z);case w:e:{for(Se=F.key;q!==null;){if(q.key===Se)if(q.tag===4&&q.stateNode.containerInfo===F.containerInfo&&q.stateNode.implementation===F.implementation){l(Z,q.sibling),oe=f(q,F.children||[]),oe.return=Z,Z=oe;break e}else{l(Z,q);break}else i(Z,q);q=q.sibling}oe=Wu(F,Z.mode,oe),oe.return=Z,Z=oe}return b(Z);case R:return F=ys(F),Ge(Z,q,F,oe)}if(G(F))return ge(Z,q,F,oe);if(X(F)){if(Se=X(F),typeof Se!="function")throw Error(a(150));return F=Se.call(F),we(Z,q,F,oe)}if(typeof F.then=="function")return Ge(Z,q,vr(F),oe);if(F.$$typeof===_)return Ge(Z,q,mr(Z,F),oe);br(Z,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,q!==null&&q.tag===6?(l(Z,q.sibling),oe=f(q,F),oe.return=Z,Z=oe):(l(Z,q),oe=Ju(F,Z.mode,oe),oe.return=Z,Z=oe),b(Z)):l(Z,q)}return function(Z,q,F,oe){try{Ca=0;var Se=Ge(Z,q,F,oe);return al=null,Se}catch(ve){if(ve===ll||ve===gr)throw ve;var Le=Jt(29,ve,null,Z.mode);return Le.lanes=oe,Le.return=Z,Le}}}var bs=up(!0),fp=up(!1),Oi=!1;function ff(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function df(e,i){e=e.updateQueue,i.updateQueue===e&&(i.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function zi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Di(e,i,l){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(He&2)!==0){var f=r.pending;return f===null?i.next=i:(i.next=f.next,f.next=i),r.pending=i,i=ur(e),Zm(e,null,l),i}return cr(e,r,i,l),ur(e)}function za(e,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var r=i.lanes;r&=e.pendingLanes,l|=r,i.lanes=l,Yo(e,l)}}function hf(e,i){var l=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,l===r)){var f=null,m=null;if(l=l.firstBaseUpdate,l!==null){do{var b={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};m===null?f=m=b:m=m.next=b,l=l.next}while(l!==null);m===null?f=m=i:m=m.next=i}else f=m=i;l={baseState:r.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:r.shared,callbacks:r.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=i:e.next=i,l.lastBaseUpdate=i}var mf=!1;function Da(){if(mf){var e=sl;if(e!==null)throw e}}function ka(e,i,l,r){mf=!1;var f=e.updateQueue;Oi=!1;var m=f.firstBaseUpdate,b=f.lastBaseUpdate,O=f.shared.pending;if(O!==null){f.shared.pending=null;var H=O,J=H.next;H.next=null,b===null?m=J:b.next=J,b=H;var le=e.alternate;le!==null&&(le=le.updateQueue,O=le.lastBaseUpdate,O!==b&&(O===null?le.firstBaseUpdate=J:O.next=J,le.lastBaseUpdate=H))}if(m!==null){var re=f.baseState;b=0,le=J=H=null,O=m;do{var P=O.lane&-536870913,ee=P!==O.lane;if(ee?(De&P)===P:(r&P)===P){P!==0&&P===il&&(mf=!0),le!==null&&(le=le.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var ge=e,we=O;P=i;var Ge=l;switch(we.tag){case 1:if(ge=we.payload,typeof ge=="function"){re=ge.call(Ge,re,P);break e}re=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=we.payload,P=typeof ge=="function"?ge.call(Ge,re,P):ge,P==null)break e;re=g({},re,P);break e;case 2:Oi=!0}}P=O.callback,P!==null&&(e.flags|=64,ee&&(e.flags|=8192),ee=f.callbacks,ee===null?f.callbacks=[P]:ee.push(P))}else ee={lane:P,tag:O.tag,payload:O.payload,callback:O.callback,next:null},le===null?(J=le=ee,H=re):le=le.next=ee,b|=P;if(O=O.next,O===null){if(O=f.shared.pending,O===null)break;ee=O,O=ee.next,ee.next=null,f.lastBaseUpdate=ee,f.shared.pending=null}}while(!0);le===null&&(H=re),f.baseState=H,f.firstBaseUpdate=J,f.lastBaseUpdate=le,m===null&&(f.shared.lanes=0),Bi|=b,e.lanes=b,e.memoizedState=re}}function dp(e,i){if(typeof e!="function")throw Error(a(191,e));e.call(i)}function hp(e,i){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)dp(l[e],i)}var ol=D(null),Sr=D(0);function mp(e,i){e=ri,ne(Sr,e),ne(ol,i),ri=e|i.baseLanes}function pf(){ne(Sr,ri),ne(ol,ol.current)}function gf(){ri=Sr.current,$(ol),$(Sr)}var Wt=D(null),hn=null;function ki(e){var i=e.alternate;ne(ct,ct.current&1),ne(Wt,e),hn===null&&(i===null||ol.current!==null||i.memoizedState!==null)&&(hn=e)}function yf(e){ne(ct,ct.current),ne(Wt,e),hn===null&&(hn=e)}function pp(e){e.tag===22?(ne(ct,ct.current),ne(Wt,e),hn===null&&(hn=e)):ji()}function ji(){ne(ct,ct.current),ne(Wt,Wt.current)}function Pt(e){$(Wt),hn===e&&(hn=null),$(ct)}var ct=D(0);function wr(e){for(var i=e;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Ed(l)||Nd(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var ei=0,Ae=null,Ve=null,ht=null,xr=!1,rl=!1,Ss=!1,Er=0,ja=0,cl=null,Ow=0;function at(){throw Error(a(321))}function vf(e,i){if(i===null)return!1;for(var l=0;l<i.length&&l<e.length;l++)if(!Ft(e[l],i[l]))return!1;return!0}function bf(e,i,l,r,f,m){return ei=m,Ae=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,z.H=e===null||e.memoizedState===null?Wp:jf,Ss=!1,m=l(r,f),Ss=!1,rl&&(m=yp(i,l,r,f)),gp(e),m}function gp(e){z.H=Ba;var i=Ve!==null&&Ve.next!==null;if(ei=0,ht=Ve=Ae=null,xr=!1,ja=0,cl=null,i)throw Error(a(300));e===null||mt||(e=e.dependencies,e!==null&&hr(e)&&(mt=!0))}function yp(e,i,l,r){Ae=e;var f=0;do{if(rl&&(cl=null),ja=0,rl=!1,25<=f)throw Error(a(301));if(f+=1,ht=Ve=null,e.updateQueue!=null){var m=e.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}z.H=Pp,m=i(l,r)}while(rl);return m}function zw(){var e=z.H,i=e.useState()[0];return i=typeof i.then=="function"?Ra(i):i,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(Ae.flags|=1024),i}function Sf(){var e=Er!==0;return Er=0,e}function wf(e,i,l){i.updateQueue=e.updateQueue,i.flags&=-2053,e.lanes&=~l}function xf(e){if(xr){for(e=e.memoizedState;e!==null;){var i=e.queue;i!==null&&(i.pending=null),e=e.next}xr=!1}ei=0,ht=Ve=Ae=null,rl=!1,ja=Er=0,cl=null}function Bt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ht===null?Ae.memoizedState=ht=e:ht=ht.next=e,ht}function ut(){if(Ve===null){var e=Ae.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var i=ht===null?Ae.memoizedState:ht.next;if(i!==null)ht=i,Ve=e;else{if(e===null)throw Ae.alternate===null?Error(a(467)):Error(a(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},ht===null?Ae.memoizedState=ht=e:ht=ht.next=e}return ht}function Nr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ra(e){var i=ja;return ja+=1,cl===null&&(cl=[]),e=op(cl,e,i),i=Ae,(ht===null?i.memoizedState:ht.next)===null&&(i=i.alternate,z.H=i===null||i.memoizedState===null?Wp:jf),e}function _r(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ra(e);if(e.$$typeof===_)return Mt(e)}throw Error(a(438,String(e)))}function Ef(e){var i=null,l=Ae.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var r=Ae.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(i={data:r.data.map(function(f){return f.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=Nr(),Ae.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(e),r=0;r<e;r++)l[r]=te;return i.index++,l}function ti(e,i){return typeof i=="function"?i(e):i}function Ar(e){var i=ut();return Nf(i,Ve,e)}function Nf(e,i,l){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=l;var f=e.baseQueue,m=r.pending;if(m!==null){if(f!==null){var b=f.next;f.next=m.next,m.next=b}i.baseQueue=f=m,r.pending=null}if(m=e.baseState,f===null)e.memoizedState=m;else{i=f.next;var O=b=null,H=null,J=i,le=!1;do{var re=J.lane&-536870913;if(re!==J.lane?(De&re)===re:(ei&re)===re){var P=J.revertLane;if(P===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),re===il&&(le=!0);else if((ei&P)===P){J=J.next,P===il&&(le=!0);continue}else re={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},H===null?(O=H=re,b=m):H=H.next=re,Ae.lanes|=P,Bi|=P;re=J.action,Ss&&l(m,re),m=J.hasEagerState?J.eagerState:l(m,re)}else P={lane:re,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},H===null?(O=H=P,b=m):H=H.next=P,Ae.lanes|=re,Bi|=re;J=J.next}while(J!==null&&J!==i);if(H===null?b=m:H.next=O,!Ft(m,e.memoizedState)&&(mt=!0,le&&(l=sl,l!==null)))throw l;e.memoizedState=m,e.baseState=b,e.baseQueue=H,r.lastRenderedState=m}return f===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function _f(e){var i=ut(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=e;var r=l.dispatch,f=l.pending,m=i.memoizedState;if(f!==null){l.pending=null;var b=f=f.next;do m=e(m,b.action),b=b.next;while(b!==f);Ft(m,i.memoizedState)||(mt=!0),i.memoizedState=m,i.baseQueue===null&&(i.baseState=m),l.lastRenderedState=m}return[m,r]}function vp(e,i,l){var r=Ae,f=ut(),m=je;if(m){if(l===void 0)throw Error(a(407));l=l()}else l=i();var b=!Ft((Ve||f).memoizedState,l);if(b&&(f.memoizedState=l,mt=!0),f=f.queue,Mf(wp.bind(null,r,f,e),[e]),f.getSnapshot!==i||b||ht!==null&&ht.memoizedState.tag&1){if(r.flags|=2048,ul(9,{destroy:void 0},Sp.bind(null,r,f,l,i),null),Xe===null)throw Error(a(349));m||(ei&127)!==0||bp(r,i,l)}return l}function bp(e,i,l){e.flags|=16384,e={getSnapshot:i,value:l},i=Ae.updateQueue,i===null?(i=Nr(),Ae.updateQueue=i,i.stores=[e]):(l=i.stores,l===null?i.stores=[e]:l.push(e))}function Sp(e,i,l,r){i.value=l,i.getSnapshot=r,xp(i)&&Ep(e)}function wp(e,i,l){return l(function(){xp(i)&&Ep(e)})}function xp(e){var i=e.getSnapshot;e=e.value;try{var l=i();return!Ft(e,l)}catch{return!0}}function Ep(e){var i=fs(e,2);i!==null&&Kt(i,e,2)}function Af(e){var i=Bt();if(typeof e=="function"){var l=e;if(e=l(),Ss){on(!0);try{l()}finally{on(!1)}}}return i.memoizedState=i.baseState=e,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ti,lastRenderedState:e},i}function Np(e,i,l,r){return e.baseState=l,Nf(e,Ve,typeof r=="function"?r:ti)}function Dw(e,i,l,r,f){if(Cr(e))throw Error(a(485));if(e=i.action,e!==null){var m={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){m.listeners.push(b)}};z.T!==null?l(!0):m.isTransition=!1,r(m),l=i.pending,l===null?(m.next=i.pending=m,_p(i,m)):(m.next=l.next,i.pending=l.next=m)}}function _p(e,i){var l=i.action,r=i.payload,f=e.state;if(i.isTransition){var m=z.T,b={};z.T=b;try{var O=l(f,r),H=z.S;H!==null&&H(b,O),Ap(e,i,O)}catch(J){Tf(e,i,J)}finally{m!==null&&b.types!==null&&(m.types=b.types),z.T=m}}else try{m=l(f,r),Ap(e,i,m)}catch(J){Tf(e,i,J)}}function Ap(e,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(r){Tp(e,i,r)},function(r){return Tf(e,i,r)}):Tp(e,i,l)}function Tp(e,i,l){i.status="fulfilled",i.value=l,Mp(i),e.state=l,i=e.pending,i!==null&&(l=i.next,l===i?e.pending=null:(l=l.next,i.next=l,_p(e,l)))}function Tf(e,i,l){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do i.status="rejected",i.reason=l,Mp(i),i=i.next;while(i!==r)}e.action=null}function Mp(e){e=e.listeners;for(var i=0;i<e.length;i++)(0,e[i])()}function Cp(e,i){return i}function Op(e,i){if(je){var l=Xe.formState;if(l!==null){e:{var r=Ae;if(je){if(Fe){t:{for(var f=Fe,m=dn;f.nodeType!==8;){if(!m){f=null;break t}if(f=mn(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){Fe=mn(f.nextSibling),r=f.data==="F!";break e}}Mi(r)}r=!1}r&&(i=l[0])}}return l=Bt(),l.memoizedState=l.baseState=i,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cp,lastRenderedState:i},l.queue=r,l=Qp.bind(null,Ae,r),r.dispatch=l,r=Af(!1),m=kf.bind(null,Ae,!1,r.queue),r=Bt(),f={state:i,dispatch:null,action:e,pending:null},r.queue=f,l=Dw.bind(null,Ae,f,m,l),f.dispatch=l,r.memoizedState=e,[i,l,!1]}function zp(e){var i=ut();return Dp(i,Ve,e)}function Dp(e,i,l){if(i=Nf(e,i,Cp)[0],e=Ar(ti)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var r=Ra(i)}catch(b){throw b===ll?gr:b}else r=i;i=ut();var f=i.queue,m=f.dispatch;return l!==i.memoizedState&&(Ae.flags|=2048,ul(9,{destroy:void 0},kw.bind(null,f,l),null)),[r,m,e]}function kw(e,i){e.action=i}function kp(e){var i=ut(),l=Ve;if(l!==null)return Dp(i,l,e);ut(),i=i.memoizedState,l=ut();var r=l.queue.dispatch;return l.memoizedState=e,[i,r,!1]}function ul(e,i,l,r){return e={tag:e,create:l,deps:r,inst:i,next:null},i=Ae.updateQueue,i===null&&(i=Nr(),Ae.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=e.next=e:(r=l.next,l.next=e,e.next=r,i.lastEffect=e),e}function jp(){return ut().memoizedState}function Tr(e,i,l,r){var f=Bt();Ae.flags|=e,f.memoizedState=ul(1|i,{destroy:void 0},l,r===void 0?null:r)}function Mr(e,i,l,r){var f=ut();r=r===void 0?null:r;var m=f.memoizedState.inst;Ve!==null&&r!==null&&vf(r,Ve.memoizedState.deps)?f.memoizedState=ul(i,m,l,r):(Ae.flags|=e,f.memoizedState=ul(1|i,m,l,r))}function Rp(e,i){Tr(8390656,8,e,i)}function Mf(e,i){Mr(2048,8,e,i)}function jw(e){Ae.flags|=4;var i=Ae.updateQueue;if(i===null)i=Nr(),Ae.updateQueue=i,i.events=[e];else{var l=i.events;l===null?i.events=[e]:l.push(e)}}function Lp(e){var i=ut().memoizedState;return jw({ref:i,nextImpl:e}),function(){if((He&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Bp(e,i){return Mr(4,2,e,i)}function Hp(e,i){return Mr(4,4,e,i)}function $p(e,i){if(typeof i=="function"){e=e();var l=i(e);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return e=e(),i.current=e,function(){i.current=null}}function Up(e,i,l){l=l!=null?l.concat([e]):null,Mr(4,4,$p.bind(null,i,e),l)}function Cf(){}function qp(e,i){var l=ut();i=i===void 0?null:i;var r=l.memoizedState;return i!==null&&vf(i,r[1])?r[0]:(l.memoizedState=[e,i],e)}function Vp(e,i){var l=ut();i=i===void 0?null:i;var r=l.memoizedState;if(i!==null&&vf(i,r[1]))return r[0];if(r=e(),Ss){on(!0);try{e()}finally{on(!1)}}return l.memoizedState=[r,i],r}function Of(e,i,l){return l===void 0||(ei&1073741824)!==0&&(De&261930)===0?e.memoizedState=i:(e.memoizedState=l,e=Yg(),Ae.lanes|=e,Bi|=e,l)}function Yp(e,i,l,r){return Ft(l,i)?l:ol.current!==null?(e=Of(e,l,r),Ft(e,i)||(mt=!0),e):(ei&42)===0||(ei&1073741824)!==0&&(De&261930)===0?(mt=!0,e.memoizedState=l):(e=Yg(),Ae.lanes|=e,Bi|=e,i)}function Gp(e,i,l,r,f){var m=B.p;B.p=m!==0&&8>m?m:8;var b=z.T,O={};z.T=O,kf(e,!1,i,l);try{var H=f(),J=z.S;if(J!==null&&J(O,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var le=Cw(H,r);La(e,i,le,nn(e))}else La(e,i,r,nn(e))}catch(re){La(e,i,{then:function(){},status:"rejected",reason:re},nn())}finally{B.p=m,b!==null&&O.types!==null&&(b.types=O.types),z.T=b}}function Rw(){}function zf(e,i,l,r){if(e.tag!==5)throw Error(a(476));var f=Ip(e).queue;Gp(e,f,i,I,l===null?Rw:function(){return Xp(e),l(r)})}function Ip(e){var i=e.memoizedState;if(i!==null)return i;i={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ti,lastRenderedState:I},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ti,lastRenderedState:l},next:null},e.memoizedState=i,e=e.alternate,e!==null&&(e.memoizedState=i),i}function Xp(e){var i=Ip(e);i.next===null&&(i=e.alternate.memoizedState),La(e,i.next.queue,{},nn())}function Df(){return Mt(Pa)}function Kp(){return ut().memoizedState}function Zp(){return ut().memoizedState}function Lw(e){for(var i=e.return;i!==null;){switch(i.tag){case 24:case 3:var l=nn();e=zi(l);var r=Di(i,e,l);r!==null&&(Kt(r,i,l),za(r,i,l)),i={cache:of()},e.payload=i;return}i=i.return}}function Bw(e,i,l){var r=nn();l={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Cr(e)?Fp(i,l):(l=Qu(e,i,l,r),l!==null&&(Kt(l,e,r),Jp(l,i,r)))}function Qp(e,i,l){var r=nn();La(e,i,l,r)}function La(e,i,l,r){var f={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Cr(e))Fp(i,f);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=i.lastRenderedReducer,m!==null))try{var b=i.lastRenderedState,O=m(b,l);if(f.hasEagerState=!0,f.eagerState=O,Ft(O,b))return cr(e,i,f,0),Xe===null&&rr(),!1}catch{}if(l=Qu(e,i,f,r),l!==null)return Kt(l,e,r),Jp(l,i,r),!0}return!1}function kf(e,i,l,r){if(r={lane:2,revertLane:fd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Cr(e)){if(i)throw Error(a(479))}else i=Qu(e,l,r,2),i!==null&&Kt(i,e,2)}function Cr(e){var i=e.alternate;return e===Ae||i!==null&&i===Ae}function Fp(e,i){rl=xr=!0;var l=e.pending;l===null?i.next=i:(i.next=l.next,l.next=i),e.pending=i}function Jp(e,i,l){if((l&4194048)!==0){var r=i.lanes;r&=e.pendingLanes,l|=r,i.lanes=l,Yo(e,l)}}var Ba={readContext:Mt,use:_r,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useLayoutEffect:at,useInsertionEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useSyncExternalStore:at,useId:at,useHostTransitionStatus:at,useFormState:at,useActionState:at,useOptimistic:at,useMemoCache:at,useCacheRefresh:at};Ba.useEffectEvent=at;var Wp={readContext:Mt,use:_r,useCallback:function(e,i){return Bt().memoizedState=[e,i===void 0?null:i],e},useContext:Mt,useEffect:Rp,useImperativeHandle:function(e,i,l){l=l!=null?l.concat([e]):null,Tr(4194308,4,$p.bind(null,i,e),l)},useLayoutEffect:function(e,i){return Tr(4194308,4,e,i)},useInsertionEffect:function(e,i){Tr(4,2,e,i)},useMemo:function(e,i){var l=Bt();i=i===void 0?null:i;var r=e();if(Ss){on(!0);try{e()}finally{on(!1)}}return l.memoizedState=[r,i],r},useReducer:function(e,i,l){var r=Bt();if(l!==void 0){var f=l(i);if(Ss){on(!0);try{l(i)}finally{on(!1)}}}else f=i;return r.memoizedState=r.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},r.queue=e,e=e.dispatch=Bw.bind(null,Ae,e),[r.memoizedState,e]},useRef:function(e){var i=Bt();return e={current:e},i.memoizedState=e},useState:function(e){e=Af(e);var i=e.queue,l=Qp.bind(null,Ae,i);return i.dispatch=l,[e.memoizedState,l]},useDebugValue:Cf,useDeferredValue:function(e,i){var l=Bt();return Of(l,e,i)},useTransition:function(){var e=Af(!1);return e=Gp.bind(null,Ae,e.queue,!0,!1),Bt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,i,l){var r=Ae,f=Bt();if(je){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),Xe===null)throw Error(a(349));(De&127)!==0||bp(r,i,l)}f.memoizedState=l;var m={value:l,getSnapshot:i};return f.queue=m,Rp(wp.bind(null,r,m,e),[e]),r.flags|=2048,ul(9,{destroy:void 0},Sp.bind(null,r,m,l,i),null),l},useId:function(){var e=Bt(),i=Xe.identifierPrefix;if(je){var l=Rn,r=jn;l=(r&~(1<<32-_t(r)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Er++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=Ow++,i="_"+i+"r_"+l.toString(32)+"_";return e.memoizedState=i},useHostTransitionStatus:Df,useFormState:Op,useActionState:Op,useOptimistic:function(e){var i=Bt();i.memoizedState=i.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=kf.bind(null,Ae,!0,l),l.dispatch=i,[e,i]},useMemoCache:Ef,useCacheRefresh:function(){return Bt().memoizedState=Lw.bind(null,Ae)},useEffectEvent:function(e){var i=Bt(),l={impl:e};return i.memoizedState=l,function(){if((He&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},jf={readContext:Mt,use:_r,useCallback:qp,useContext:Mt,useEffect:Mf,useImperativeHandle:Up,useInsertionEffect:Bp,useLayoutEffect:Hp,useMemo:Vp,useReducer:Ar,useRef:jp,useState:function(){return Ar(ti)},useDebugValue:Cf,useDeferredValue:function(e,i){var l=ut();return Yp(l,Ve.memoizedState,e,i)},useTransition:function(){var e=Ar(ti)[0],i=ut().memoizedState;return[typeof e=="boolean"?e:Ra(e),i]},useSyncExternalStore:vp,useId:Kp,useHostTransitionStatus:Df,useFormState:zp,useActionState:zp,useOptimistic:function(e,i){var l=ut();return Np(l,Ve,e,i)},useMemoCache:Ef,useCacheRefresh:Zp};jf.useEffectEvent=Lp;var Pp={readContext:Mt,use:_r,useCallback:qp,useContext:Mt,useEffect:Mf,useImperativeHandle:Up,useInsertionEffect:Bp,useLayoutEffect:Hp,useMemo:Vp,useReducer:_f,useRef:jp,useState:function(){return _f(ti)},useDebugValue:Cf,useDeferredValue:function(e,i){var l=ut();return Ve===null?Of(l,e,i):Yp(l,Ve.memoizedState,e,i)},useTransition:function(){var e=_f(ti)[0],i=ut().memoizedState;return[typeof e=="boolean"?e:Ra(e),i]},useSyncExternalStore:vp,useId:Kp,useHostTransitionStatus:Df,useFormState:kp,useActionState:kp,useOptimistic:function(e,i){var l=ut();return Ve!==null?Np(l,Ve,e,i):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Ef,useCacheRefresh:Zp};Pp.useEffectEvent=Lp;function Rf(e,i,l,r){i=e.memoizedState,l=l(r,i),l=l==null?i:g({},i,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Lf={enqueueSetState:function(e,i,l){e=e._reactInternals;var r=nn(),f=zi(r);f.payload=i,l!=null&&(f.callback=l),i=Di(e,f,r),i!==null&&(Kt(i,e,r),za(i,e,r))},enqueueReplaceState:function(e,i,l){e=e._reactInternals;var r=nn(),f=zi(r);f.tag=1,f.payload=i,l!=null&&(f.callback=l),i=Di(e,f,r),i!==null&&(Kt(i,e,r),za(i,e,r))},enqueueForceUpdate:function(e,i){e=e._reactInternals;var l=nn(),r=zi(l);r.tag=2,i!=null&&(r.callback=i),i=Di(e,r,l),i!==null&&(Kt(i,e,l),za(i,e,l))}};function eg(e,i,l,r,f,m,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,m,b):i.prototype&&i.prototype.isPureReactComponent?!Ea(l,r)||!Ea(f,m):!0}function tg(e,i,l,r){e=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,r),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,r),i.state!==e&&Lf.enqueueReplaceState(i,i.state,null)}function ws(e,i){var l=i;if("ref"in i){l={};for(var r in i)r!=="ref"&&(l[r]=i[r])}if(e=e.defaultProps){l===i&&(l=g({},l));for(var f in e)l[f]===void 0&&(l[f]=e[f])}return l}function ng(e){or(e)}function ig(e){console.error(e)}function sg(e){or(e)}function Or(e,i){try{var l=e.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(r){setTimeout(function(){throw r})}}function lg(e,i,l){try{var r=e.onCaughtError;r(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Bf(e,i,l){return l=zi(l),l.tag=3,l.payload={element:null},l.callback=function(){Or(e,i)},l}function ag(e){return e=zi(e),e.tag=3,e}function og(e,i,l,r){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var m=r.value;e.payload=function(){return f(m)},e.callback=function(){lg(i,l,r)}}var b=l.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){lg(i,l,r),typeof f!="function"&&(Hi===null?Hi=new Set([this]):Hi.add(this));var O=r.stack;this.componentDidCatch(r.value,{componentStack:O!==null?O:""})})}function Hw(e,i,l,r,f){if(l.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(i=l.alternate,i!==null&&nl(i,l,f,!0),l=Wt.current,l!==null){switch(l.tag){case 31:case 13:return hn===null?Vr():l.alternate===null&&ot===0&&(ot=3),l.flags&=-257,l.flags|=65536,l.lanes=f,r===yr?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([r]):i.add(r),rd(e,r,f)),!1;case 22:return l.flags|=65536,r===yr?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([r])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([r]):l.add(r)),rd(e,r,f)),!1}throw Error(a(435,l.tag))}return rd(e,r,f),Vr(),!1}if(je)return i=Wt.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=f,r!==tf&&(e=Error(a(422),{cause:r}),Aa(cn(e,l)))):(r!==tf&&(i=Error(a(423),{cause:r}),Aa(cn(i,l))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,r=cn(r,l),f=Bf(e.stateNode,r,f),hf(e,f),ot!==4&&(ot=2)),!1;var m=Error(a(520),{cause:r});if(m=cn(m,l),Ia===null?Ia=[m]:Ia.push(m),ot!==4&&(ot=2),i===null)return!0;r=cn(r,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,e=f&-f,l.lanes|=e,e=Bf(l.stateNode,r,e),hf(l,e),!1;case 1:if(i=l.type,m=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Hi===null||!Hi.has(m))))return l.flags|=65536,f&=-f,l.lanes|=f,f=ag(f),og(f,e,l,r),hf(l,f),!1}l=l.return}while(l!==null);return!1}var Hf=Error(a(461)),mt=!1;function Ct(e,i,l,r){i.child=e===null?fp(i,null,l,r):bs(i,e.child,l,r)}function rg(e,i,l,r,f){l=l.render;var m=i.ref;if("ref"in r){var b={};for(var O in r)O!=="ref"&&(b[O]=r[O])}else b=r;return ps(i),r=bf(e,i,l,b,m,f),O=Sf(),e!==null&&!mt?(wf(e,i,f),ni(e,i,f)):(je&&O&&Pu(i),i.flags|=1,Ct(e,i,r,f),i.child)}function cg(e,i,l,r,f){if(e===null){var m=l.type;return typeof m=="function"&&!Fu(m)&&m.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=m,ug(e,i,m,r,f)):(e=fr(l.type,null,r,i,i.mode,f),e.ref=i.ref,e.return=i,i.child=e)}if(m=e.child,!Xf(e,f)){var b=m.memoizedProps;if(l=l.compare,l=l!==null?l:Ea,l(b,r)&&e.ref===i.ref)return ni(e,i,f)}return i.flags|=1,e=Fn(m,r),e.ref=i.ref,e.return=i,i.child=e}function ug(e,i,l,r,f){if(e!==null){var m=e.memoizedProps;if(Ea(m,r)&&e.ref===i.ref)if(mt=!1,i.pendingProps=r=m,Xf(e,f))(e.flags&131072)!==0&&(mt=!0);else return i.lanes=e.lanes,ni(e,i,f)}return $f(e,i,l,r,f)}function fg(e,i,l,r){var f=r.children,m=e!==null?e.memoizedState:null;if(e===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((i.flags&128)!==0){if(m=m!==null?m.baseLanes|l:l,e!==null){for(r=i.child=e.child,f=0;r!==null;)f=f|r.lanes|r.childLanes,r=r.sibling;r=f&~m}else r=0,i.child=null;return dg(e,i,m,l,r)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},e!==null&&pr(i,m!==null?m.cachePool:null),m!==null?mp(i,m):pf(),pp(i);else return r=i.lanes=536870912,dg(e,i,m!==null?m.baseLanes|l:l,l,r)}else m!==null?(pr(i,m.cachePool),mp(i,m),ji(),i.memoizedState=null):(e!==null&&pr(i,null),pf(),ji());return Ct(e,i,f,l),i.child}function Ha(e,i){return e!==null&&e.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function dg(e,i,l,r,f){var m=cf();return m=m===null?null:{parent:dt._currentValue,pool:m},i.memoizedState={baseLanes:l,cachePool:m},e!==null&&pr(i,null),pf(),pp(i),e!==null&&nl(e,i,r,!0),i.childLanes=f,null}function zr(e,i){return i=kr({mode:i.mode,children:i.children},e.mode),i.ref=e.ref,e.child=i,i.return=e,i}function hg(e,i,l){return bs(i,e.child,null,l),e=zr(i,i.pendingProps),e.flags|=2,Pt(i),i.memoizedState=null,e}function $w(e,i,l){var r=i.pendingProps,f=(i.flags&128)!==0;if(i.flags&=-129,e===null){if(je){if(r.mode==="hidden")return e=zr(i,r),i.lanes=536870912,Ha(null,e);if(yf(i),(e=Fe)?(e=_y(e,dn),e=e!==null&&e.data==="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:Ai!==null?{id:jn,overflow:Rn}:null,retryLane:536870912,hydrationErrors:null},l=Fm(e),l.return=i,i.child=l,Tt=i,Fe=null)):e=null,e===null)throw Mi(i);return i.lanes=536870912,null}return zr(i,r)}var m=e.memoizedState;if(m!==null){var b=m.dehydrated;if(yf(i),f)if(i.flags&256)i.flags&=-257,i=hg(e,i,l);else if(i.memoizedState!==null)i.child=e.child,i.flags|=128,i=null;else throw Error(a(558));else if(mt||nl(e,i,l,!1),f=(l&e.childLanes)!==0,mt||f){if(r=Xe,r!==null&&(b=Go(r,l),b!==0&&b!==m.retryLane))throw m.retryLane=b,fs(e,b),Kt(r,e,b),Hf;Vr(),i=hg(e,i,l)}else e=m.treeContext,Fe=mn(b.nextSibling),Tt=i,je=!0,Ti=null,dn=!1,e!==null&&Pm(i,e),i=zr(i,r),i.flags|=4096;return i}return e=Fn(e.child,{mode:r.mode,children:r.children}),e.ref=i.ref,i.child=e,e.return=i,e}function Dr(e,i){var l=i.ref;if(l===null)e!==null&&e.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(e===null||e.ref!==l)&&(i.flags|=4194816)}}function $f(e,i,l,r,f){return ps(i),l=bf(e,i,l,r,void 0,f),r=Sf(),e!==null&&!mt?(wf(e,i,f),ni(e,i,f)):(je&&r&&Pu(i),i.flags|=1,Ct(e,i,l,f),i.child)}function mg(e,i,l,r,f,m){return ps(i),i.updateQueue=null,l=yp(i,r,l,f),gp(e),r=Sf(),e!==null&&!mt?(wf(e,i,m),ni(e,i,m)):(je&&r&&Pu(i),i.flags|=1,Ct(e,i,l,m),i.child)}function pg(e,i,l,r,f){if(ps(i),i.stateNode===null){var m=Ws,b=l.contextType;typeof b=="object"&&b!==null&&(m=Mt(b)),m=new l(r,m),i.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Lf,i.stateNode=m,m._reactInternals=i,m=i.stateNode,m.props=r,m.state=i.memoizedState,m.refs={},ff(i),b=l.contextType,m.context=typeof b=="object"&&b!==null?Mt(b):Ws,m.state=i.memoizedState,b=l.getDerivedStateFromProps,typeof b=="function"&&(Rf(i,l,b,r),m.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(b=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),b!==m.state&&Lf.enqueueReplaceState(m,m.state,null),ka(i,r,m,f),Da(),m.state=i.memoizedState),typeof m.componentDidMount=="function"&&(i.flags|=4194308),r=!0}else if(e===null){m=i.stateNode;var O=i.memoizedProps,H=ws(l,O);m.props=H;var J=m.context,le=l.contextType;b=Ws,typeof le=="object"&&le!==null&&(b=Mt(le));var re=l.getDerivedStateFromProps;le=typeof re=="function"||typeof m.getSnapshotBeforeUpdate=="function",O=i.pendingProps!==O,le||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(O||J!==b)&&tg(i,m,r,b),Oi=!1;var P=i.memoizedState;m.state=P,ka(i,r,m,f),Da(),J=i.memoizedState,O||P!==J||Oi?(typeof re=="function"&&(Rf(i,l,re,r),J=i.memoizedState),(H=Oi||eg(i,l,H,r,P,J,b))?(le||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(i.flags|=4194308)):(typeof m.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=r,i.memoizedState=J),m.props=r,m.state=J,m.context=b,r=H):(typeof m.componentDidMount=="function"&&(i.flags|=4194308),r=!1)}else{m=i.stateNode,df(e,i),b=i.memoizedProps,le=ws(l,b),m.props=le,re=i.pendingProps,P=m.context,J=l.contextType,H=Ws,typeof J=="object"&&J!==null&&(H=Mt(J)),O=l.getDerivedStateFromProps,(J=typeof O=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==re||P!==H)&&tg(i,m,r,H),Oi=!1,P=i.memoizedState,m.state=P,ka(i,r,m,f),Da();var ee=i.memoizedState;b!==re||P!==ee||Oi||e!==null&&e.dependencies!==null&&hr(e.dependencies)?(typeof O=="function"&&(Rf(i,l,O,r),ee=i.memoizedState),(le=Oi||eg(i,l,le,r,P,ee,H)||e!==null&&e.dependencies!==null&&hr(e.dependencies))?(J||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(r,ee,H),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(r,ee,H)),typeof m.componentDidUpdate=="function"&&(i.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===e.memoizedProps&&P===e.memoizedState||(i.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&P===e.memoizedState||(i.flags|=1024),i.memoizedProps=r,i.memoizedState=ee),m.props=r,m.state=ee,m.context=H,r=le):(typeof m.componentDidUpdate!="function"||b===e.memoizedProps&&P===e.memoizedState||(i.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&P===e.memoizedState||(i.flags|=1024),r=!1)}return m=r,Dr(e,i),r=(i.flags&128)!==0,m||r?(m=i.stateNode,l=r&&typeof l.getDerivedStateFromError!="function"?null:m.render(),i.flags|=1,e!==null&&r?(i.child=bs(i,e.child,null,f),i.child=bs(i,null,l,f)):Ct(e,i,l,f),i.memoizedState=m.state,e=i.child):e=ni(e,i,f),e}function gg(e,i,l,r){return hs(),i.flags|=256,Ct(e,i,l,r),i.child}var Uf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qf(e){return{baseLanes:e,cachePool:lp()}}function Vf(e,i,l){return e=e!==null?e.childLanes&~l:0,i&&(e|=tn),e}function yg(e,i,l){var r=i.pendingProps,f=!1,m=(i.flags&128)!==0,b;if((b=m)||(b=e!==null&&e.memoizedState===null?!1:(ct.current&2)!==0),b&&(f=!0,i.flags&=-129),b=(i.flags&32)!==0,i.flags&=-33,e===null){if(je){if(f?ki(i):ji(),(e=Fe)?(e=_y(e,dn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:Ai!==null?{id:jn,overflow:Rn}:null,retryLane:536870912,hydrationErrors:null},l=Fm(e),l.return=i,i.child=l,Tt=i,Fe=null)):e=null,e===null)throw Mi(i);return Nd(e)?i.lanes=32:i.lanes=536870912,null}var O=r.children;return r=r.fallback,f?(ji(),f=i.mode,O=kr({mode:"hidden",children:O},f),r=ds(r,f,l,null),O.return=i,r.return=i,O.sibling=r,i.child=O,r=i.child,r.memoizedState=qf(l),r.childLanes=Vf(e,b,l),i.memoizedState=Uf,Ha(null,r)):(ki(i),Yf(i,O))}var H=e.memoizedState;if(H!==null&&(O=H.dehydrated,O!==null)){if(m)i.flags&256?(ki(i),i.flags&=-257,i=Gf(e,i,l)):i.memoizedState!==null?(ji(),i.child=e.child,i.flags|=128,i=null):(ji(),O=r.fallback,f=i.mode,r=kr({mode:"visible",children:r.children},f),O=ds(O,f,l,null),O.flags|=2,r.return=i,O.return=i,r.sibling=O,i.child=r,bs(i,e.child,null,l),r=i.child,r.memoizedState=qf(l),r.childLanes=Vf(e,b,l),i.memoizedState=Uf,i=Ha(null,r));else if(ki(i),Nd(O)){if(b=O.nextSibling&&O.nextSibling.dataset,b)var J=b.dgst;b=J,r=Error(a(419)),r.stack="",r.digest=b,Aa({value:r,source:null,stack:null}),i=Gf(e,i,l)}else if(mt||nl(e,i,l,!1),b=(l&e.childLanes)!==0,mt||b){if(b=Xe,b!==null&&(r=Go(b,l),r!==0&&r!==H.retryLane))throw H.retryLane=r,fs(e,r),Kt(b,e,r),Hf;Ed(O)||Vr(),i=Gf(e,i,l)}else Ed(O)?(i.flags|=192,i.child=e.child,i=null):(e=H.treeContext,Fe=mn(O.nextSibling),Tt=i,je=!0,Ti=null,dn=!1,e!==null&&Pm(i,e),i=Yf(i,r.children),i.flags|=4096);return i}return f?(ji(),O=r.fallback,f=i.mode,H=e.child,J=H.sibling,r=Fn(H,{mode:"hidden",children:r.children}),r.subtreeFlags=H.subtreeFlags&65011712,J!==null?O=Fn(J,O):(O=ds(O,f,l,null),O.flags|=2),O.return=i,r.return=i,r.sibling=O,i.child=r,Ha(null,r),r=i.child,O=e.child.memoizedState,O===null?O=qf(l):(f=O.cachePool,f!==null?(H=dt._currentValue,f=f.parent!==H?{parent:H,pool:H}:f):f=lp(),O={baseLanes:O.baseLanes|l,cachePool:f}),r.memoizedState=O,r.childLanes=Vf(e,b,l),i.memoizedState=Uf,Ha(e.child,r)):(ki(i),l=e.child,e=l.sibling,l=Fn(l,{mode:"visible",children:r.children}),l.return=i,l.sibling=null,e!==null&&(b=i.deletions,b===null?(i.deletions=[e],i.flags|=16):b.push(e)),i.child=l,i.memoizedState=null,l)}function Yf(e,i){return i=kr({mode:"visible",children:i},e.mode),i.return=e,e.child=i}function kr(e,i){return e=Jt(22,e,null,i),e.lanes=0,e}function Gf(e,i,l){return bs(i,e.child,null,l),e=Yf(i,i.pendingProps.children),e.flags|=2,i.memoizedState=null,e}function vg(e,i,l){e.lanes|=i;var r=e.alternate;r!==null&&(r.lanes|=i),lf(e.return,i,l)}function If(e,i,l,r,f,m){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:r,tail:l,tailMode:f,treeForkCount:m}:(b.isBackwards=i,b.rendering=null,b.renderingStartTime=0,b.last=r,b.tail=l,b.tailMode=f,b.treeForkCount=m)}function bg(e,i,l){var r=i.pendingProps,f=r.revealOrder,m=r.tail;r=r.children;var b=ct.current,O=(b&2)!==0;if(O?(b=b&1|2,i.flags|=128):b&=1,ne(ct,b),Ct(e,i,r,l),r=je?_a:0,!O&&e!==null&&(e.flags&128)!==0)e:for(e=i.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vg(e,l,i);else if(e.tag===19)vg(e,l,i);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break e;for(;e.sibling===null;){if(e.return===null||e.return===i)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(l=i.child,f=null;l!==null;)e=l.alternate,e!==null&&wr(e)===null&&(f=l),l=l.sibling;l=f,l===null?(f=i.child,i.child=null):(f=l.sibling,l.sibling=null),If(i,!1,f,l,m,r);break;case"backwards":case"unstable_legacy-backwards":for(l=null,f=i.child,i.child=null;f!==null;){if(e=f.alternate,e!==null&&wr(e)===null){i.child=f;break}e=f.sibling,f.sibling=l,l=f,f=e}If(i,!0,l,null,m,r);break;case"together":If(i,!1,null,null,void 0,r);break;default:i.memoizedState=null}return i.child}function ni(e,i,l){if(e!==null&&(i.dependencies=e.dependencies),Bi|=i.lanes,(l&i.childLanes)===0)if(e!==null){if(nl(e,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(e!==null&&i.child!==e.child)throw Error(a(153));if(i.child!==null){for(e=i.child,l=Fn(e,e.pendingProps),i.child=l,l.return=i;e.sibling!==null;)e=e.sibling,l=l.sibling=Fn(e,e.pendingProps),l.return=i;l.sibling=null}return i.child}function Xf(e,i){return(e.lanes&i)!==0?!0:(e=e.dependencies,!!(e!==null&&hr(e)))}function Uw(e,i,l){switch(i.tag){case 3:K(i,i.stateNode.containerInfo),Ci(i,dt,e.memoizedState.cache),hs();break;case 27:case 5:pe(i);break;case 4:K(i,i.stateNode.containerInfo);break;case 10:Ci(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,yf(i),null;break;case 13:var r=i.memoizedState;if(r!==null)return r.dehydrated!==null?(ki(i),i.flags|=128,null):(l&i.child.childLanes)!==0?yg(e,i,l):(ki(i),e=ni(e,i,l),e!==null?e.sibling:null);ki(i);break;case 19:var f=(e.flags&128)!==0;if(r=(l&i.childLanes)!==0,r||(nl(e,i,l,!1),r=(l&i.childLanes)!==0),f){if(r)return bg(e,i,l);i.flags|=128}if(f=i.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),ne(ct,ct.current),r)break;return null;case 22:return i.lanes=0,fg(e,i,l,i.pendingProps);case 24:Ci(i,dt,e.memoizedState.cache)}return ni(e,i,l)}function Sg(e,i,l){if(e!==null)if(e.memoizedProps!==i.pendingProps)mt=!0;else{if(!Xf(e,l)&&(i.flags&128)===0)return mt=!1,Uw(e,i,l);mt=(e.flags&131072)!==0}else mt=!1,je&&(i.flags&1048576)!==0&&Wm(i,_a,i.index);switch(i.lanes=0,i.tag){case 16:e:{var r=i.pendingProps;if(e=ys(i.elementType),i.type=e,typeof e=="function")Fu(e)?(r=ws(e,r),i.tag=1,i=pg(null,i,e,r,l)):(i.tag=0,i=$f(null,i,e,r,l));else{if(e!=null){var f=e.$$typeof;if(f===A){i.tag=11,i=rg(null,i,e,r,l);break e}else if(f===k){i.tag=14,i=cg(null,i,e,r,l);break e}}throw i=L(e)||e,Error(a(306,i,""))}}return i;case 0:return $f(e,i,i.type,i.pendingProps,l);case 1:return r=i.type,f=ws(r,i.pendingProps),pg(e,i,r,f,l);case 3:e:{if(K(i,i.stateNode.containerInfo),e===null)throw Error(a(387));r=i.pendingProps;var m=i.memoizedState;f=m.element,df(e,i),ka(i,r,null,l);var b=i.memoizedState;if(r=b.cache,Ci(i,dt,r),r!==m.cache&&af(i,[dt],l,!0),Da(),r=b.element,m.isDehydrated)if(m={element:r,isDehydrated:!1,cache:b.cache},i.updateQueue.baseState=m,i.memoizedState=m,i.flags&256){i=gg(e,i,r,l);break e}else if(r!==f){f=cn(Error(a(424)),i),Aa(f),i=gg(e,i,r,l);break e}else for(e=i.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Fe=mn(e.firstChild),Tt=i,je=!0,Ti=null,dn=!0,l=fp(i,null,r,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(hs(),r===f){i=ni(e,i,l);break e}Ct(e,i,r,l)}i=i.child}return i;case 26:return Dr(e,i),e===null?(l=zy(i.type,null,i.pendingProps,null))?i.memoizedState=l:je||(l=i.type,e=i.pendingProps,r=Qr(he.current).createElement(l),r[bt]=i,r[kt]=e,Ot(r,l,e),ft(r),i.stateNode=r):i.memoizedState=zy(i.type,e.memoizedProps,i.pendingProps,e.memoizedState),null;case 27:return pe(i),e===null&&je&&(r=i.stateNode=My(i.type,i.pendingProps,he.current),Tt=i,dn=!0,f=Fe,Vi(i.type)?(_d=f,Fe=mn(r.firstChild)):Fe=f),Ct(e,i,i.pendingProps.children,l),Dr(e,i),e===null&&(i.flags|=4194304),i.child;case 5:return e===null&&je&&((f=r=Fe)&&(r=gx(r,i.type,i.pendingProps,dn),r!==null?(i.stateNode=r,Tt=i,Fe=mn(r.firstChild),dn=!1,f=!0):f=!1),f||Mi(i)),pe(i),f=i.type,m=i.pendingProps,b=e!==null?e.memoizedProps:null,r=m.children,Sd(f,m)?r=null:b!==null&&Sd(f,b)&&(i.flags|=32),i.memoizedState!==null&&(f=bf(e,i,zw,null,null,l),Pa._currentValue=f),Dr(e,i),Ct(e,i,r,l),i.child;case 6:return e===null&&je&&((e=l=Fe)&&(l=yx(l,i.pendingProps,dn),l!==null?(i.stateNode=l,Tt=i,Fe=null,e=!0):e=!1),e||Mi(i)),null;case 13:return yg(e,i,l);case 4:return K(i,i.stateNode.containerInfo),r=i.pendingProps,e===null?i.child=bs(i,null,r,l):Ct(e,i,r,l),i.child;case 11:return rg(e,i,i.type,i.pendingProps,l);case 7:return Ct(e,i,i.pendingProps,l),i.child;case 8:return Ct(e,i,i.pendingProps.children,l),i.child;case 12:return Ct(e,i,i.pendingProps.children,l),i.child;case 10:return r=i.pendingProps,Ci(i,i.type,r.value),Ct(e,i,r.children,l),i.child;case 9:return f=i.type._context,r=i.pendingProps.children,ps(i),f=Mt(f),r=r(f),i.flags|=1,Ct(e,i,r,l),i.child;case 14:return cg(e,i,i.type,i.pendingProps,l);case 15:return ug(e,i,i.type,i.pendingProps,l);case 19:return bg(e,i,l);case 31:return $w(e,i,l);case 22:return fg(e,i,l,i.pendingProps);case 24:return ps(i),r=Mt(dt),e===null?(f=cf(),f===null&&(f=Xe,m=of(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=l),f=m),i.memoizedState={parent:r,cache:f},ff(i),Ci(i,dt,f)):((e.lanes&l)!==0&&(df(e,i),ka(i,null,null,l),Da()),f=e.memoizedState,m=i.memoizedState,f.parent!==r?(f={parent:r,cache:r},i.memoizedState=f,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=f),Ci(i,dt,r)):(r=m.cache,Ci(i,dt,r),r!==f.cache&&af(i,[dt],l,!0))),Ct(e,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function ii(e){e.flags|=4}function Kf(e,i,l,r,f){if((i=(e.mode&32)!==0)&&(i=!1),i){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(Kg())e.flags|=8192;else throw vs=yr,uf}else e.flags&=-16777217}function wg(e,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ly(i))if(Kg())e.flags|=8192;else throw vs=yr,uf}function jr(e,i){i!==null&&(e.flags|=4),e.flags&16384&&(i=e.tag!==22?qo():536870912,e.lanes|=i,ml|=i)}function $a(e,i){if(!je)switch(e.tailMode){case"hidden":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var r=null;l!==null;)l.alternate!==null&&(r=l),l=l.sibling;r===null?i||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Je(e){var i=e.alternate!==null&&e.alternate.child===e.child,l=0,r=0;if(i)for(var f=e.child;f!==null;)l|=f.lanes|f.childLanes,r|=f.subtreeFlags&65011712,r|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)l|=f.lanes|f.childLanes,r|=f.subtreeFlags,r|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=r,e.childLanes=l,i}function qw(e,i,l){var r=i.pendingProps;switch(ef(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(i),null;case 1:return Je(i),null;case 3:return l=i.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),i.memoizedState.cache!==r&&(i.flags|=2048),Pn(dt),ue(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(tl(i)?ii(i):e===null||e.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,nf())),Je(i),null;case 26:var f=i.type,m=i.memoizedState;return e===null?(ii(i),m!==null?(Je(i),wg(i,m)):(Je(i),Kf(i,f,null,r,l))):m?m!==e.memoizedState?(ii(i),Je(i),wg(i,m)):(Je(i),i.flags&=-16777217):(e=e.memoizedProps,e!==r&&ii(i),Je(i),Kf(i,f,e,r,l)),null;case 27:if(xe(i),l=he.current,f=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==r&&ii(i);else{if(!r){if(i.stateNode===null)throw Error(a(166));return Je(i),null}e=ie.current,tl(i)?ep(i):(e=My(f,r,l),i.stateNode=e,ii(i))}return Je(i),null;case 5:if(xe(i),f=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==r&&ii(i);else{if(!r){if(i.stateNode===null)throw Error(a(166));return Je(i),null}if(m=ie.current,tl(i))ep(i);else{var b=Qr(he.current);switch(m){case 1:m=b.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:m=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":m=b.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":m=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":m=b.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof r.is=="string"?b.createElement("select",{is:r.is}):b.createElement("select"),r.multiple?m.multiple=!0:r.size&&(m.size=r.size);break;default:m=typeof r.is=="string"?b.createElement(f,{is:r.is}):b.createElement(f)}}m[bt]=i,m[kt]=r;e:for(b=i.child;b!==null;){if(b.tag===5||b.tag===6)m.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===i)break e;for(;b.sibling===null;){if(b.return===null||b.return===i)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}i.stateNode=m;e:switch(Ot(m,f,r),f){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ii(i)}}return Je(i),Kf(i,i.type,e===null?null:e.memoizedProps,i.pendingProps,l),null;case 6:if(e&&i.stateNode!=null)e.memoizedProps!==r&&ii(i);else{if(typeof r!="string"&&i.stateNode===null)throw Error(a(166));if(e=he.current,tl(i)){if(e=i.stateNode,l=i.memoizedProps,r=null,f=Tt,f!==null)switch(f.tag){case 27:case 5:r=f.memoizedProps}e[bt]=i,e=!!(e.nodeValue===l||r!==null&&r.suppressHydrationWarning===!0||yy(e.nodeValue,l)),e||Mi(i,!0)}else e=Qr(e).createTextNode(r),e[bt]=i,i.stateNode=e}return Je(i),null;case 31:if(l=i.memoizedState,e===null||e.memoizedState!==null){if(r=tl(i),l!==null){if(e===null){if(!r)throw Error(a(318));if(e=i.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[bt]=i}else hs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Je(i),e=!1}else l=nf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return i.flags&256?(Pt(i),i):(Pt(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Je(i),null;case 13:if(r=i.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=tl(i),r!==null&&r.dehydrated!==null){if(e===null){if(!f)throw Error(a(318));if(f=i.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(317));f[bt]=i}else hs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Je(i),f=!1}else f=nf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return i.flags&256?(Pt(i),i):(Pt(i),null)}return Pt(i),(i.flags&128)!==0?(i.lanes=l,i):(l=r!==null,e=e!==null&&e.memoizedState!==null,l&&(r=i.child,f=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(f=r.alternate.memoizedState.cachePool.pool),m=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(m=r.memoizedState.cachePool.pool),m!==f&&(r.flags|=2048)),l!==e&&l&&(i.child.flags|=8192),jr(i,i.updateQueue),Je(i),null);case 4:return ue(),e===null&&pd(i.stateNode.containerInfo),Je(i),null;case 10:return Pn(i.type),Je(i),null;case 19:if($(ct),r=i.memoizedState,r===null)return Je(i),null;if(f=(i.flags&128)!==0,m=r.rendering,m===null)if(f)$a(r,!1);else{if(ot!==0||e!==null&&(e.flags&128)!==0)for(e=i.child;e!==null;){if(m=wr(e),m!==null){for(i.flags|=128,$a(r,!1),e=m.updateQueue,i.updateQueue=e,jr(i,e),i.subtreeFlags=0,e=l,l=i.child;l!==null;)Qm(l,e),l=l.sibling;return ne(ct,ct.current&1|2),je&&Jn(i,r.treeForkCount),i.child}e=e.sibling}r.tail!==null&&Pe()>$r&&(i.flags|=128,f=!0,$a(r,!1),i.lanes=4194304)}else{if(!f)if(e=wr(m),e!==null){if(i.flags|=128,f=!0,e=e.updateQueue,i.updateQueue=e,jr(i,e),$a(r,!0),r.tail===null&&r.tailMode==="hidden"&&!m.alternate&&!je)return Je(i),null}else 2*Pe()-r.renderingStartTime>$r&&l!==536870912&&(i.flags|=128,f=!0,$a(r,!1),i.lanes=4194304);r.isBackwards?(m.sibling=i.child,i.child=m):(e=r.last,e!==null?e.sibling=m:i.child=m,r.last=m)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Pe(),e.sibling=null,l=ct.current,ne(ct,f?l&1|2:l&1),je&&Jn(i,r.treeForkCount),e):(Je(i),null);case 22:case 23:return Pt(i),gf(),r=i.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(i.flags|=8192):r&&(i.flags|=8192),r?(l&536870912)!==0&&(i.flags&128)===0&&(Je(i),i.subtreeFlags&6&&(i.flags|=8192)):Je(i),l=i.updateQueue,l!==null&&jr(i,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==l&&(i.flags|=2048),e!==null&&$(gs),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Pn(dt),Je(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function Vw(e,i){switch(ef(i),i.tag){case 1:return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 3:return Pn(dt),ue(),e=i.flags,(e&65536)!==0&&(e&128)===0?(i.flags=e&-65537|128,i):null;case 26:case 27:case 5:return xe(i),null;case 31:if(i.memoizedState!==null){if(Pt(i),i.alternate===null)throw Error(a(340));hs()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 13:if(Pt(i),e=i.memoizedState,e!==null&&e.dehydrated!==null){if(i.alternate===null)throw Error(a(340));hs()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 19:return $(ct),null;case 4:return ue(),null;case 10:return Pn(i.type),null;case 22:case 23:return Pt(i),gf(),e!==null&&$(gs),e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 24:return Pn(dt),null;case 25:return null;default:return null}}function xg(e,i){switch(ef(i),i.tag){case 3:Pn(dt),ue();break;case 26:case 27:case 5:xe(i);break;case 4:ue();break;case 31:i.memoizedState!==null&&Pt(i);break;case 13:Pt(i);break;case 19:$(ct);break;case 10:Pn(i.type);break;case 22:case 23:Pt(i),gf(),e!==null&&$(gs);break;case 24:Pn(dt)}}function Ua(e,i){try{var l=i.updateQueue,r=l!==null?l.lastEffect:null;if(r!==null){var f=r.next;l=f;do{if((l.tag&e)===e){r=void 0;var m=l.create,b=l.inst;r=m(),b.destroy=r}l=l.next}while(l!==f)}}catch(O){qe(i,i.return,O)}}function Ri(e,i,l){try{var r=i.updateQueue,f=r!==null?r.lastEffect:null;if(f!==null){var m=f.next;r=m;do{if((r.tag&e)===e){var b=r.inst,O=b.destroy;if(O!==void 0){b.destroy=void 0,f=i;var H=l,J=O;try{J()}catch(le){qe(f,H,le)}}}r=r.next}while(r!==m)}}catch(le){qe(i,i.return,le)}}function Eg(e){var i=e.updateQueue;if(i!==null){var l=e.stateNode;try{hp(i,l)}catch(r){qe(e,e.return,r)}}}function Ng(e,i,l){l.props=ws(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(r){qe(e,i,r)}}function qa(e,i){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof l=="function"?e.refCleanup=l(r):l.current=r}}catch(f){qe(e,i,f)}}function Ln(e,i){var l=e.ref,r=e.refCleanup;if(l!==null)if(typeof r=="function")try{r()}catch(f){qe(e,i,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(f){qe(e,i,f)}else l.current=null}function _g(e){var i=e.type,l=e.memoizedProps,r=e.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break e;case"img":l.src?r.src=l.src:l.srcSet&&(r.srcset=l.srcSet)}}catch(f){qe(e,e.return,f)}}function Zf(e,i,l){try{var r=e.stateNode;ux(r,e.type,l,i),r[kt]=i}catch(f){qe(e,e.return,f)}}function Ag(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Vi(e.type)||e.tag===4}function Qf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ag(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.tag===27&&Vi(e.type)||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 Ff(e,i,l){var r=e.tag;if(r===5||r===6)e=e.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(e),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=Zn));else if(r!==4&&(r===27&&Vi(e.type)&&(l=e.stateNode,i=null),e=e.child,e!==null))for(Ff(e,i,l),e=e.sibling;e!==null;)Ff(e,i,l),e=e.sibling}function Rr(e,i,l){var r=e.tag;if(r===5||r===6)e=e.stateNode,i?l.insertBefore(e,i):l.appendChild(e);else if(r!==4&&(r===27&&Vi(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Rr(e,i,l),e=e.sibling;e!==null;)Rr(e,i,l),e=e.sibling}function Tg(e){var i=e.stateNode,l=e.memoizedProps;try{for(var r=e.type,f=i.attributes;f.length;)i.removeAttributeNode(f[0]);Ot(i,r,l),i[bt]=e,i[kt]=l}catch(m){qe(e,e.return,m)}}var si=!1,pt=!1,Jf=!1,Mg=typeof WeakSet=="function"?WeakSet:Set,xt=null;function Yw(e,i){if(e=e.containerInfo,vd=nc,e=Um(e),Yu(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var r=l.getSelection&&l.getSelection();if(r&&r.rangeCount!==0){l=r.anchorNode;var f=r.anchorOffset,m=r.focusNode;r=r.focusOffset;try{l.nodeType,m.nodeType}catch{l=null;break e}var b=0,O=-1,H=-1,J=0,le=0,re=e,P=null;t:for(;;){for(var ee;re!==l||f!==0&&re.nodeType!==3||(O=b+f),re!==m||r!==0&&re.nodeType!==3||(H=b+r),re.nodeType===3&&(b+=re.nodeValue.length),(ee=re.firstChild)!==null;)P=re,re=ee;for(;;){if(re===e)break t;if(P===l&&++J===f&&(O=b),P===m&&++le===r&&(H=b),(ee=re.nextSibling)!==null)break;re=P,P=re.parentNode}re=ee}l=O===-1||H===-1?null:{start:O,end:H}}else l=null}l=l||{start:0,end:0}}else l=null;for(bd={focusedElem:e,selectionRange:l},nc=!1,xt=i;xt!==null;)if(i=xt,e=i.child,(i.subtreeFlags&1028)!==0&&e!==null)e.return=i,xt=e;else for(;xt!==null;){switch(i=xt,m=i.alternate,e=i.flags,i.tag){case 0:if((e&4)!==0&&(e=i.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)f=e[l],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&m!==null){e=void 0,l=i,f=m.memoizedProps,m=m.memoizedState,r=l.stateNode;try{var ge=ws(l.type,f);e=r.getSnapshotBeforeUpdate(ge,m),r.__reactInternalSnapshotBeforeUpdate=e}catch(we){qe(l,l.return,we)}}break;case 3:if((e&1024)!==0){if(e=i.stateNode.containerInfo,l=e.nodeType,l===9)xd(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":xd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(a(163))}if(e=i.sibling,e!==null){e.return=i.return,xt=e;break}xt=i.return}}function Cg(e,i,l){var r=l.flags;switch(l.tag){case 0:case 11:case 15:ai(e,l),r&4&&Ua(5,l);break;case 1:if(ai(e,l),r&4)if(e=l.stateNode,i===null)try{e.componentDidMount()}catch(b){qe(l,l.return,b)}else{var f=ws(l.type,i.memoizedProps);i=i.memoizedState;try{e.componentDidUpdate(f,i,e.__reactInternalSnapshotBeforeUpdate)}catch(b){qe(l,l.return,b)}}r&64&&Eg(l),r&512&&qa(l,l.return);break;case 3:if(ai(e,l),r&64&&(e=l.updateQueue,e!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{hp(e,i)}catch(b){qe(l,l.return,b)}}break;case 27:i===null&&r&4&&Tg(l);case 26:case 5:ai(e,l),i===null&&r&4&&_g(l),r&512&&qa(l,l.return);break;case 12:ai(e,l);break;case 31:ai(e,l),r&4&&Dg(e,l);break;case 13:ai(e,l),r&4&&kg(e,l),r&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Ww.bind(null,l),vx(e,l))));break;case 22:if(r=l.memoizedState!==null||si,!r){i=i!==null&&i.memoizedState!==null||pt,f=si;var m=pt;si=r,(pt=i)&&!m?oi(e,l,(l.subtreeFlags&8772)!==0):ai(e,l),si=f,pt=m}break;case 30:break;default:ai(e,l)}}function Og(e){var i=e.alternate;i!==null&&(e.alternate=null,Og(i)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(i=e.stateNode,i!==null&&ca(i)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var et=null,Yt=!1;function li(e,i,l){for(l=l.child;l!==null;)zg(e,i,l),l=l.sibling}function zg(e,i,l){if(Nt&&typeof Nt.onCommitFiberUnmount=="function")try{Nt.onCommitFiberUnmount(Gn,l)}catch{}switch(l.tag){case 26:pt||Ln(l,i),li(e,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:pt||Ln(l,i);var r=et,f=Yt;Vi(l.type)&&(et=l.stateNode,Yt=!1),li(e,i,l),Fa(l.stateNode),et=r,Yt=f;break;case 5:pt||Ln(l,i);case 6:if(r=et,f=Yt,et=null,li(e,i,l),et=r,Yt=f,et!==null)if(Yt)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(l.stateNode)}catch(m){qe(l,i,m)}else try{et.removeChild(l.stateNode)}catch(m){qe(l,i,m)}break;case 18:et!==null&&(Yt?(e=et,Ey(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),xl(e)):Ey(et,l.stateNode));break;case 4:r=et,f=Yt,et=l.stateNode.containerInfo,Yt=!0,li(e,i,l),et=r,Yt=f;break;case 0:case 11:case 14:case 15:Ri(2,l,i),pt||Ri(4,l,i),li(e,i,l);break;case 1:pt||(Ln(l,i),r=l.stateNode,typeof r.componentWillUnmount=="function"&&Ng(l,i,r)),li(e,i,l);break;case 21:li(e,i,l);break;case 22:pt=(r=pt)||l.memoizedState!==null,li(e,i,l),pt=r;break;default:li(e,i,l)}}function Dg(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{xl(e)}catch(l){qe(i,i.return,l)}}}function kg(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{xl(e)}catch(l){qe(i,i.return,l)}}function Gw(e){switch(e.tag){case 31:case 13:case 19:var i=e.stateNode;return i===null&&(i=e.stateNode=new Mg),i;case 22:return e=e.stateNode,i=e._retryCache,i===null&&(i=e._retryCache=new Mg),i;default:throw Error(a(435,e.tag))}}function Lr(e,i){var l=Gw(e);i.forEach(function(r){if(!l.has(r)){l.add(r);var f=Pw.bind(null,e,r);r.then(f,f)}})}function Gt(e,i){var l=i.deletions;if(l!==null)for(var r=0;r<l.length;r++){var f=l[r],m=e,b=i,O=b;e:for(;O!==null;){switch(O.tag){case 27:if(Vi(O.type)){et=O.stateNode,Yt=!1;break e}break;case 5:et=O.stateNode,Yt=!1;break e;case 3:case 4:et=O.stateNode.containerInfo,Yt=!0;break e}O=O.return}if(et===null)throw Error(a(160));zg(m,b,f),et=null,Yt=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)jg(i,e),i=i.sibling}var xn=null;function jg(e,i){var l=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Gt(i,e),It(e),r&4&&(Ri(3,e,e.return),Ua(3,e),Ri(5,e,e.return));break;case 1:Gt(i,e),It(e),r&512&&(pt||l===null||Ln(l,l.return)),r&64&&si&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?r:l.concat(r))));break;case 26:var f=xn;if(Gt(i,e),It(e),r&512&&(pt||l===null||Ln(l,l.return)),r&4){var m=l!==null?l.memoizedState:null;if(r=e.memoizedState,l===null)if(r===null)if(e.stateNode===null){e:{r=e.type,l=e.memoizedProps,f=f.ownerDocument||f;t:switch(r){case"title":m=f.getElementsByTagName("title")[0],(!m||m[os]||m[bt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(r),f.head.insertBefore(m,f.querySelector("head > title"))),Ot(m,r,l),m[bt]=e,ft(m),r=m;break e;case"link":var b=jy("link","href",f).get(r+(l.href||""));if(b){for(var O=0;O<b.length;O++)if(m=b[O],m.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&m.getAttribute("rel")===(l.rel==null?null:l.rel)&&m.getAttribute("title")===(l.title==null?null:l.title)&&m.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){b.splice(O,1);break t}}m=f.createElement(r),Ot(m,r,l),f.head.appendChild(m);break;case"meta":if(b=jy("meta","content",f).get(r+(l.content||""))){for(O=0;O<b.length;O++)if(m=b[O],m.getAttribute("content")===(l.content==null?null:""+l.content)&&m.getAttribute("name")===(l.name==null?null:l.name)&&m.getAttribute("property")===(l.property==null?null:l.property)&&m.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&m.getAttribute("charset")===(l.charSet==null?null:l.charSet)){b.splice(O,1);break t}}m=f.createElement(r),Ot(m,r,l),f.head.appendChild(m);break;default:throw Error(a(468,r))}m[bt]=e,ft(m),r=m}e.stateNode=r}else Ry(f,e.type,e.stateNode);else e.stateNode=ky(f,r,e.memoizedProps);else m!==r?(m===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):m.count--,r===null?Ry(f,e.type,e.stateNode):ky(f,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Zf(e,e.memoizedProps,l.memoizedProps)}break;case 27:Gt(i,e),It(e),r&512&&(pt||l===null||Ln(l,l.return)),l!==null&&r&4&&Zf(e,e.memoizedProps,l.memoizedProps);break;case 5:if(Gt(i,e),It(e),r&512&&(pt||l===null||Ln(l,l.return)),e.flags&32){f=e.stateNode;try{Is(f,"")}catch(ge){qe(e,e.return,ge)}}r&4&&e.stateNode!=null&&(f=e.memoizedProps,Zf(e,f,l!==null?l.memoizedProps:f)),r&1024&&(Jf=!0);break;case 6:if(Gt(i,e),It(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,l=e.stateNode;try{l.nodeValue=r}catch(ge){qe(e,e.return,ge)}}break;case 3:if(Wr=null,f=xn,xn=Fr(i.containerInfo),Gt(i,e),xn=f,It(e),r&4&&l!==null&&l.memoizedState.isDehydrated)try{xl(i.containerInfo)}catch(ge){qe(e,e.return,ge)}Jf&&(Jf=!1,Rg(e));break;case 4:r=xn,xn=Fr(e.stateNode.containerInfo),Gt(i,e),It(e),xn=r;break;case 12:Gt(i,e),It(e);break;case 31:Gt(i,e),It(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Lr(e,r)));break;case 13:Gt(i,e),It(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Hr=Pe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Lr(e,r)));break;case 22:f=e.memoizedState!==null;var H=l!==null&&l.memoizedState!==null,J=si,le=pt;if(si=J||f,pt=le||H,Gt(i,e),pt=le,si=J,It(e),r&8192)e:for(i=e.stateNode,i._visibility=f?i._visibility&-2:i._visibility|1,f&&(l===null||H||si||pt||xs(e)),l=null,i=e;;){if(i.tag===5||i.tag===26){if(l===null){H=l=i;try{if(m=H.stateNode,f)b=m.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{O=H.stateNode;var re=H.memoizedProps.style,P=re!=null&&re.hasOwnProperty("display")?re.display:null;O.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(ge){qe(H,H.return,ge)}}}else if(i.tag===6){if(l===null){H=i;try{H.stateNode.nodeValue=f?"":H.memoizedProps}catch(ge){qe(H,H.return,ge)}}}else if(i.tag===18){if(l===null){H=i;try{var ee=H.stateNode;f?Ny(ee,!0):Ny(H.stateNode,!1)}catch(ge){qe(H,H.return,ge)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===e)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break e;for(;i.sibling===null;){if(i.return===null||i.return===e)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}r&4&&(r=e.updateQueue,r!==null&&(l=r.retryQueue,l!==null&&(r.retryQueue=null,Lr(e,l))));break;case 19:Gt(i,e),It(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Lr(e,r)));break;case 30:break;case 21:break;default:Gt(i,e),It(e)}}function It(e){var i=e.flags;if(i&2){try{for(var l,r=e.return;r!==null;){if(Ag(r)){l=r;break}r=r.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var f=l.stateNode,m=Qf(e);Rr(e,m,f);break;case 5:var b=l.stateNode;l.flags&32&&(Is(b,""),l.flags&=-33);var O=Qf(e);Rr(e,O,b);break;case 3:case 4:var H=l.stateNode.containerInfo,J=Qf(e);Ff(e,J,H);break;default:throw Error(a(161))}}catch(le){qe(e,e.return,le)}e.flags&=-3}i&4096&&(e.flags&=-4097)}function Rg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var i=e;Rg(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),e=e.sibling}}function ai(e,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Cg(e,i.alternate,i),i=i.sibling}function xs(e){for(e=e.child;e!==null;){var i=e;switch(i.tag){case 0:case 11:case 14:case 15:Ri(4,i,i.return),xs(i);break;case 1:Ln(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&Ng(i,i.return,l),xs(i);break;case 27:Fa(i.stateNode);case 26:case 5:Ln(i,i.return),xs(i);break;case 22:i.memoizedState===null&&xs(i);break;case 30:xs(i);break;default:xs(i)}e=e.sibling}}function oi(e,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var r=i.alternate,f=e,m=i,b=m.flags;switch(m.tag){case 0:case 11:case 15:oi(f,m,l),Ua(4,m);break;case 1:if(oi(f,m,l),r=m,f=r.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(J){qe(r,r.return,J)}if(r=m,f=r.updateQueue,f!==null){var O=r.stateNode;try{var H=f.shared.hiddenCallbacks;if(H!==null)for(f.shared.hiddenCallbacks=null,f=0;f<H.length;f++)dp(H[f],O)}catch(J){qe(r,r.return,J)}}l&&b&64&&Eg(m),qa(m,m.return);break;case 27:Tg(m);case 26:case 5:oi(f,m,l),l&&r===null&&b&4&&_g(m),qa(m,m.return);break;case 12:oi(f,m,l);break;case 31:oi(f,m,l),l&&b&4&&Dg(f,m);break;case 13:oi(f,m,l),l&&b&4&&kg(f,m);break;case 22:m.memoizedState===null&&oi(f,m,l),qa(m,m.return);break;case 30:break;default:oi(f,m,l)}i=i.sibling}}function Wf(e,i){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(e=i.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Ta(l))}function Pf(e,i){e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&Ta(e))}function En(e,i,l,r){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Lg(e,i,l,r),i=i.sibling}function Lg(e,i,l,r){var f=i.flags;switch(i.tag){case 0:case 11:case 15:En(e,i,l,r),f&2048&&Ua(9,i);break;case 1:En(e,i,l,r);break;case 3:En(e,i,l,r),f&2048&&(e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&Ta(e)));break;case 12:if(f&2048){En(e,i,l,r),e=i.stateNode;try{var m=i.memoizedProps,b=m.id,O=m.onPostCommit;typeof O=="function"&&O(b,i.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(H){qe(i,i.return,H)}}else En(e,i,l,r);break;case 31:En(e,i,l,r);break;case 13:En(e,i,l,r);break;case 23:break;case 22:m=i.stateNode,b=i.alternate,i.memoizedState!==null?m._visibility&2?En(e,i,l,r):Va(e,i):m._visibility&2?En(e,i,l,r):(m._visibility|=2,fl(e,i,l,r,(i.subtreeFlags&10256)!==0||!1)),f&2048&&Wf(b,i);break;case 24:En(e,i,l,r),f&2048&&Pf(i.alternate,i);break;default:En(e,i,l,r)}}function fl(e,i,l,r,f){for(f=f&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var m=e,b=i,O=l,H=r,J=b.flags;switch(b.tag){case 0:case 11:case 15:fl(m,b,O,H,f),Ua(8,b);break;case 23:break;case 22:var le=b.stateNode;b.memoizedState!==null?le._visibility&2?fl(m,b,O,H,f):Va(m,b):(le._visibility|=2,fl(m,b,O,H,f)),f&&J&2048&&Wf(b.alternate,b);break;case 24:fl(m,b,O,H,f),f&&J&2048&&Pf(b.alternate,b);break;default:fl(m,b,O,H,f)}i=i.sibling}}function Va(e,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=e,r=i,f=r.flags;switch(r.tag){case 22:Va(l,r),f&2048&&Wf(r.alternate,r);break;case 24:Va(l,r),f&2048&&Pf(r.alternate,r);break;default:Va(l,r)}i=i.sibling}}var Ya=8192;function dl(e,i,l){if(e.subtreeFlags&Ya)for(e=e.child;e!==null;)Bg(e,i,l),e=e.sibling}function Bg(e,i,l){switch(e.tag){case 26:dl(e,i,l),e.flags&Ya&&e.memoizedState!==null&&Ox(l,xn,e.memoizedState,e.memoizedProps);break;case 5:dl(e,i,l);break;case 3:case 4:var r=xn;xn=Fr(e.stateNode.containerInfo),dl(e,i,l),xn=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ya,Ya=16777216,dl(e,i,l),Ya=r):dl(e,i,l));break;default:dl(e,i,l)}}function Hg(e){var i=e.alternate;if(i!==null&&(e=i.child,e!==null)){i.child=null;do i=e.sibling,e.sibling=null,e=i;while(e!==null)}}function Ga(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var r=i[l];xt=r,Ug(r,e)}Hg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)$g(e),e=e.sibling}function $g(e){switch(e.tag){case 0:case 11:case 15:Ga(e),e.flags&2048&&Ri(9,e,e.return);break;case 3:Ga(e);break;case 12:Ga(e);break;case 22:var i=e.stateNode;e.memoizedState!==null&&i._visibility&2&&(e.return===null||e.return.tag!==13)?(i._visibility&=-3,Br(e)):Ga(e);break;default:Ga(e)}}function Br(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var r=i[l];xt=r,Ug(r,e)}Hg(e)}for(e=e.child;e!==null;){switch(i=e,i.tag){case 0:case 11:case 15:Ri(8,i,i.return),Br(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,Br(i));break;default:Br(i)}e=e.sibling}}function Ug(e,i){for(;xt!==null;){var l=xt;switch(l.tag){case 0:case 11:case 15:Ri(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var r=l.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ta(l.memoizedState.cache)}if(r=l.child,r!==null)r.return=l,xt=r;else e:for(l=e;xt!==null;){r=xt;var f=r.sibling,m=r.return;if(Og(r),r===l){xt=null;break e}if(f!==null){f.return=m,xt=f;break e}xt=m}}}var Iw={getCacheForType:function(e){var i=Mt(dt),l=i.data.get(e);return l===void 0&&(l=e(),i.data.set(e,l)),l},cacheSignal:function(){return Mt(dt).controller.signal}},Xw=typeof WeakMap=="function"?WeakMap:Map,He=0,Xe=null,Ce=null,De=0,Ue=0,en=null,Li=!1,hl=!1,ed=!1,ri=0,ot=0,Bi=0,Es=0,td=0,tn=0,ml=0,Ia=null,Xt=null,nd=!1,Hr=0,qg=0,$r=1/0,Ur=null,Hi=null,St=0,$i=null,pl=null,ci=0,id=0,sd=null,Vg=null,Xa=0,ld=null;function nn(){return(He&2)!==0&&De!==0?De&-De:z.T!==null?fd():Io()}function Yg(){if(tn===0)if((De&536870912)===0||je){var e=Me;Me<<=1,(Me&3932160)===0&&(Me=262144),tn=e}else tn=536870912;return e=Wt.current,e!==null&&(e.flags|=32),tn}function Kt(e,i,l){(e===Xe&&(Ue===2||Ue===9)||e.cancelPendingCommit!==null)&&(gl(e,0),Ui(e,De,tn,!1)),as(e,l),((He&2)===0||e!==Xe)&&(e===Xe&&((He&2)===0&&(Es|=l),ot===4&&Ui(e,De,tn,!1)),Bn(e))}function Gg(e,i,l){if((He&6)!==0)throw Error(a(327));var r=!l&&(i&127)===0&&(i&e.expiredLanes)===0||In(e,i),f=r?Qw(e,i):od(e,i,!0),m=r;do{if(f===0){hl&&!r&&Ui(e,i,0,!1);break}else{if(l=e.current.alternate,m&&!Kw(l)){f=od(e,i,!1),m=!1;continue}if(f===2){if(m=i,e.errorRecoveryDisabledLanes&m)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){i=b;e:{var O=e;f=Ia;var H=O.current.memoizedState.isDehydrated;if(H&&(gl(O,b).flags|=256),b=od(O,b,!1),b!==2){if(ed&&!H){O.errorRecoveryDisabledLanes|=m,Es|=m,f=4;break e}m=Xt,Xt=f,m!==null&&(Xt===null?Xt=m:Xt.push.apply(Xt,m))}f=b}if(m=!1,f!==2)continue}}if(f===1){gl(e,0),Ui(e,i,0,!0);break}e:{switch(r=e,m=f,m){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Ui(r,i,tn,!Li);break e;case 2:Xt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(f=Hr+300-Pe(),10<f)){if(Ui(r,i,tn,!Li),At(r,0,!0)!==0)break e;ci=i,r.timeoutHandle=wy(Ig.bind(null,r,l,Xt,Ur,nd,i,tn,Es,ml,Li,m,"Throttled",-0,0),f);break e}Ig(r,l,Xt,Ur,nd,i,tn,Es,ml,Li,m,null,-0,0)}}break}while(!0);Bn(e)}function Ig(e,i,l,r,f,m,b,O,H,J,le,re,P,ee){if(e.timeoutHandle=-1,re=i.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Zn},Bg(i,m,re);var ge=(m&62914560)===m?Hr-Pe():(m&4194048)===m?qg-Pe():0;if(ge=zx(re,ge),ge!==null){ci=m,e.cancelPendingCommit=ge(Pg.bind(null,e,i,m,l,r,f,b,O,H,le,re,null,P,ee)),Ui(e,m,b,!J);return}}Pg(e,i,m,l,r,f,b,O,H)}function Kw(e){for(var i=e;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var r=0;r<l.length;r++){var f=l[r],m=f.getSnapshot;f=f.value;try{if(!Ft(m(),f))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Ui(e,i,l,r){i&=~td,i&=~Es,e.suspendedLanes|=i,e.pingedLanes&=~i,r&&(e.warmLanes|=i),r=e.expirationTimes;for(var f=i;0<f;){var m=31-_t(f),b=1<<m;r[m]=-1,f&=~b}l!==0&&Vo(e,l,i)}function qr(){return(He&6)===0?(Ka(0),!1):!0}function ad(){if(Ce!==null){if(Ue===0)var e=Ce.return;else e=Ce,Wn=ms=null,xf(e),al=null,Ca=0,e=Ce;for(;e!==null;)xg(e.alternate,e),e=e.return;Ce=null}}function gl(e,i){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,hx(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),ci=0,ad(),Xe=e,Ce=l=Fn(e.current,null),De=i,Ue=0,en=null,Li=!1,hl=In(e,i),ed=!1,ml=tn=td=Es=Bi=ot=0,Xt=Ia=null,nd=!1,(i&8)!==0&&(i|=i&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=i;0<r;){var f=31-_t(r),m=1<<f;i|=e[f],r&=~m}return ri=i,rr(),l}function Xg(e,i){Ae=null,z.H=Ba,i===ll||i===gr?(i=rp(),Ue=3):i===uf?(i=rp(),Ue=4):Ue=i===Hf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,en=i,Ce===null&&(ot=1,Or(e,cn(i,e.current)))}function Kg(){var e=Wt.current;return e===null?!0:(De&4194048)===De?hn===null:(De&62914560)===De||(De&536870912)!==0?e===hn:!1}function Zg(){var e=z.H;return z.H=Ba,e===null?Ba:e}function Qg(){var e=z.A;return z.A=Iw,e}function Vr(){ot=4,Li||(De&4194048)!==De&&Wt.current!==null||(hl=!0),(Bi&134217727)===0&&(Es&134217727)===0||Xe===null||Ui(Xe,De,tn,!1)}function od(e,i,l){var r=He;He|=2;var f=Zg(),m=Qg();(Xe!==e||De!==i)&&(Ur=null,gl(e,i)),i=!1;var b=ot;e:do try{if(Ue!==0&&Ce!==null){var O=Ce,H=en;switch(Ue){case 8:ad(),b=6;break e;case 3:case 2:case 9:case 6:Wt.current===null&&(i=!0);var J=Ue;if(Ue=0,en=null,yl(e,O,H,J),l&&hl){b=0;break e}break;default:J=Ue,Ue=0,en=null,yl(e,O,H,J)}}Zw(),b=ot;break}catch(le){Xg(e,le)}while(!0);return i&&e.shellSuspendCounter++,Wn=ms=null,He=r,z.H=f,z.A=m,Ce===null&&(Xe=null,De=0,rr()),b}function Zw(){for(;Ce!==null;)Fg(Ce)}function Qw(e,i){var l=He;He|=2;var r=Zg(),f=Qg();Xe!==e||De!==i?(Ur=null,$r=Pe()+500,gl(e,i)):hl=In(e,i);e:do try{if(Ue!==0&&Ce!==null){i=Ce;var m=en;t:switch(Ue){case 1:Ue=0,en=null,yl(e,i,m,1);break;case 2:case 9:if(ap(m)){Ue=0,en=null,Jg(i);break}i=function(){Ue!==2&&Ue!==9||Xe!==e||(Ue=7),Bn(e)},m.then(i,i);break e;case 3:Ue=7;break e;case 4:Ue=5;break e;case 7:ap(m)?(Ue=0,en=null,Jg(i)):(Ue=0,en=null,yl(e,i,m,7));break;case 5:var b=null;switch(Ce.tag){case 26:b=Ce.memoizedState;case 5:case 27:var O=Ce;if(b?Ly(b):O.stateNode.complete){Ue=0,en=null;var H=O.sibling;if(H!==null)Ce=H;else{var J=O.return;J!==null?(Ce=J,Yr(J)):Ce=null}break t}}Ue=0,en=null,yl(e,i,m,5);break;case 6:Ue=0,en=null,yl(e,i,m,6);break;case 8:ad(),ot=6;break e;default:throw Error(a(462))}}Fw();break}catch(le){Xg(e,le)}while(!0);return Wn=ms=null,z.H=r,z.A=f,He=l,Ce!==null?0:(Xe=null,De=0,rr(),ot)}function Fw(){for(;Ce!==null&&!Yn();)Fg(Ce)}function Fg(e){var i=Sg(e.alternate,e,ri);e.memoizedProps=e.pendingProps,i===null?Yr(e):Ce=i}function Jg(e){var i=e,l=i.alternate;switch(i.tag){case 15:case 0:i=mg(l,i,i.pendingProps,i.type,void 0,De);break;case 11:i=mg(l,i,i.pendingProps,i.type.render,i.ref,De);break;case 5:xf(i);default:xg(l,i),i=Ce=Qm(i,ri),i=Sg(l,i,ri)}e.memoizedProps=e.pendingProps,i===null?Yr(e):Ce=i}function yl(e,i,l,r){Wn=ms=null,xf(i),al=null,Ca=0;var f=i.return;try{if(Hw(e,f,i,l,De)){ot=1,Or(e,cn(l,e.current)),Ce=null;return}}catch(m){if(f!==null)throw Ce=f,m;ot=1,Or(e,cn(l,e.current)),Ce=null;return}i.flags&32768?(je||r===1?e=!0:hl||(De&536870912)!==0?e=!1:(Li=e=!0,(r===2||r===9||r===3||r===6)&&(r=Wt.current,r!==null&&r.tag===13&&(r.flags|=16384))),Wg(i,e)):Yr(i)}function Yr(e){var i=e;do{if((i.flags&32768)!==0){Wg(i,Li);return}e=i.return;var l=qw(i.alternate,i,ri);if(l!==null){Ce=l;return}if(i=i.sibling,i!==null){Ce=i;return}Ce=i=e}while(i!==null);ot===0&&(ot=5)}function Wg(e,i){do{var l=Vw(e.alternate,e);if(l!==null){l.flags&=32767,Ce=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(e=e.sibling,e!==null)){Ce=e;return}Ce=e=l}while(e!==null);ot=6,Ce=null}function Pg(e,i,l,r,f,m,b,O,H){e.cancelPendingCommit=null;do Gr();while(St!==0);if((He&6)!==0)throw Error(a(327));if(i!==null){if(i===e.current)throw Error(a(177));if(m=i.lanes|i.childLanes,m|=Zu,_u(e,l,m,b,O,H),e===Xe&&(Ce=Xe=null,De=0),pl=i,$i=e,ci=l,id=m,sd=f,Vg=r,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ex(Dt,function(){return sy(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||r){r=z.T,z.T=null,f=B.p,B.p=2,b=He,He|=4;try{Yw(e,i,l)}finally{He=b,B.p=f,z.T=r}}St=1,ey(),ty(),ny()}}function ey(){if(St===1){St=0;var e=$i,i=pl,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=z.T,z.T=null;var r=B.p;B.p=2;var f=He;He|=4;try{jg(i,e);var m=bd,b=Um(e.containerInfo),O=m.focusedElem,H=m.selectionRange;if(b!==O&&O&&O.ownerDocument&&$m(O.ownerDocument.documentElement,O)){if(H!==null&&Yu(O)){var J=H.start,le=H.end;if(le===void 0&&(le=J),"selectionStart"in O)O.selectionStart=J,O.selectionEnd=Math.min(le,O.value.length);else{var re=O.ownerDocument||document,P=re&&re.defaultView||window;if(P.getSelection){var ee=P.getSelection(),ge=O.textContent.length,we=Math.min(H.start,ge),Ge=H.end===void 0?we:Math.min(H.end,ge);!ee.extend&&we>Ge&&(b=Ge,Ge=we,we=b);var Z=Hm(O,we),q=Hm(O,Ge);if(Z&&q&&(ee.rangeCount!==1||ee.anchorNode!==Z.node||ee.anchorOffset!==Z.offset||ee.focusNode!==q.node||ee.focusOffset!==q.offset)){var F=re.createRange();F.setStart(Z.node,Z.offset),ee.removeAllRanges(),we>Ge?(ee.addRange(F),ee.extend(q.node,q.offset)):(F.setEnd(q.node,q.offset),ee.addRange(F))}}}}for(re=[],ee=O;ee=ee.parentNode;)ee.nodeType===1&&re.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<re.length;O++){var oe=re[O];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}nc=!!vd,bd=vd=null}finally{He=f,B.p=r,z.T=l}}e.current=i,St=2}}function ty(){if(St===2){St=0;var e=$i,i=pl,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=z.T,z.T=null;var r=B.p;B.p=2;var f=He;He|=4;try{Cg(e,i.alternate,i)}finally{He=f,B.p=r,z.T=l}}St=3}}function ny(){if(St===4||St===3){St=0,$t();var e=$i,i=pl,l=ci,r=Vg;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?St=5:(St=0,pl=$i=null,iy(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(Hi=null),ra(l),i=i.stateNode,Nt&&typeof Nt.onCommitFiberRoot=="function")try{Nt.onCommitFiberRoot(Gn,i,void 0,(i.current.flags&128)===128)}catch{}if(r!==null){i=z.T,f=B.p,B.p=2,z.T=null;try{for(var m=e.onRecoverableError,b=0;b<r.length;b++){var O=r[b];m(O.value,{componentStack:O.stack})}}finally{z.T=i,B.p=f}}(ci&3)!==0&&Gr(),Bn(e),f=e.pendingLanes,(l&261930)!==0&&(f&42)!==0?e===ld?Xa++:(Xa=0,ld=e):Xa=0,Ka(0)}}function iy(e,i){(e.pooledCacheLanes&=i)===0&&(i=e.pooledCache,i!=null&&(e.pooledCache=null,Ta(i)))}function Gr(){return ey(),ty(),ny(),sy()}function sy(){if(St!==5)return!1;var e=$i,i=id;id=0;var l=ra(ci),r=z.T,f=B.p;try{B.p=32>l?32:l,z.T=null,l=sd,sd=null;var m=$i,b=ci;if(St=0,pl=$i=null,ci=0,(He&6)!==0)throw Error(a(331));var O=He;if(He|=4,$g(m.current),Lg(m,m.current,b,l),He=O,Ka(0,!1),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot(Gn,m)}catch{}return!0}finally{B.p=f,z.T=r,iy(e,i)}}function ly(e,i,l){i=cn(l,i),i=Bf(e.stateNode,i,2),e=Di(e,i,2),e!==null&&(as(e,2),Bn(e))}function qe(e,i,l){if(e.tag===3)ly(e,e,l);else for(;i!==null;){if(i.tag===3){ly(i,e,l);break}else if(i.tag===1){var r=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Hi===null||!Hi.has(r))){e=cn(l,e),l=ag(2),r=Di(i,l,2),r!==null&&(og(l,r,i,e),as(r,2),Bn(r));break}}i=i.return}}function rd(e,i,l){var r=e.pingCache;if(r===null){r=e.pingCache=new Xw;var f=new Set;r.set(i,f)}else f=r.get(i),f===void 0&&(f=new Set,r.set(i,f));f.has(l)||(ed=!0,f.add(l),e=Jw.bind(null,e,i,l),i.then(e,e))}function Jw(e,i,l){var r=e.pingCache;r!==null&&r.delete(i),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Xe===e&&(De&l)===l&&(ot===4||ot===3&&(De&62914560)===De&&300>Pe()-Hr?(He&2)===0&&gl(e,0):td|=l,ml===De&&(ml=0)),Bn(e)}function ay(e,i){i===0&&(i=qo()),e=fs(e,i),e!==null&&(as(e,i),Bn(e))}function Ww(e){var i=e.memoizedState,l=0;i!==null&&(l=i.retryLane),ay(e,l)}function Pw(e,i){var l=0;switch(e.tag){case 31:case 13:var r=e.stateNode,f=e.memoizedState;f!==null&&(l=f.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(i),ay(e,l)}function ex(e,i){return Et(e,i)}var Ir=null,vl=null,cd=!1,Xr=!1,ud=!1,qi=0;function Bn(e){e!==vl&&e.next===null&&(vl===null?Ir=vl=e:vl=vl.next=e),Xr=!0,cd||(cd=!0,nx())}function Ka(e,i){if(!ud&&Xr){ud=!0;do for(var l=!1,r=Ir;r!==null;){if(e!==0){var f=r.pendingLanes;if(f===0)var m=0;else{var b=r.suspendedLanes,O=r.pingedLanes;m=(1<<31-_t(42|e)+1)-1,m&=f&~(b&~O),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(l=!0,uy(r,m))}else m=De,m=At(r,r===Xe?m:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(m&3)===0||In(r,m)||(l=!0,uy(r,m));r=r.next}while(l);ud=!1}}function tx(){oy()}function oy(){Xr=cd=!1;var e=0;qi!==0&&dx()&&(e=qi);for(var i=Pe(),l=null,r=Ir;r!==null;){var f=r.next,m=ry(r,i);m===0?(r.next=null,l===null?Ir=f:l.next=f,f===null&&(vl=l)):(l=r,(e!==0||(m&3)!==0)&&(Xr=!0)),r=f}St!==0&&St!==5||Ka(e),qi!==0&&(qi=0)}function ry(e,i){for(var l=e.suspendedLanes,r=e.pingedLanes,f=e.expirationTimes,m=e.pendingLanes&-62914561;0<m;){var b=31-_t(m),O=1<<b,H=f[b];H===-1?((O&l)===0||(O&r)!==0)&&(f[b]=Nu(O,i)):H<=i&&(e.expiredLanes|=O),m&=~O}if(i=Xe,l=De,l=At(e,e===i?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,l===0||e===i&&(Ue===2||Ue===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&zt(r),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||In(e,l)){if(i=l&-l,i===e.callbackPriority)return i;switch(r!==null&&zt(r),ra(l)){case 2:case 8:l=Qe;break;case 32:l=Dt;break;case 268435456:l=vi;break;default:l=Dt}return r=cy.bind(null,e),l=Et(l,r),e.callbackPriority=i,e.callbackNode=l,i}return r!==null&&r!==null&&zt(r),e.callbackPriority=2,e.callbackNode=null,2}function cy(e,i){if(St!==0&&St!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Gr()&&e.callbackNode!==l)return null;var r=De;return r=At(e,e===Xe?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Gg(e,r,i),ry(e,Pe()),e.callbackNode!=null&&e.callbackNode===l?cy.bind(null,e):null)}function uy(e,i){if(Gr())return null;Gg(e,i,!0)}function nx(){mx(function(){(He&6)!==0?Et(Lt,tx):oy()})}function fd(){if(qi===0){var e=il;e===0&&(e=ye,ye<<=1,(ye&261888)===0&&(ye=256)),qi=e}return qi}function fy(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:er(""+e)}function dy(e,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,e.id&&l.setAttribute("form",e.id),i.parentNode.insertBefore(l,i),e=new FormData(e),l.parentNode.removeChild(l),e}function ix(e,i,l,r,f){if(i==="submit"&&l&&l.stateNode===f){var m=fy((f[kt]||null).action),b=r.submitter;b&&(i=(i=b[kt]||null)?fy(i.formAction):b.getAttribute("formAction"),i!==null&&(m=i,b=null));var O=new sr("action","action",null,r,f);e.push({event:O,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(qi!==0){var H=b?dy(f,b):new FormData(f);zf(l,{pending:!0,data:H,method:f.method,action:m},null,H)}}else typeof m=="function"&&(O.preventDefault(),H=b?dy(f,b):new FormData(f),zf(l,{pending:!0,data:H,method:f.method,action:m},m,H))},currentTarget:f}]})}}for(var dd=0;dd<Ku.length;dd++){var hd=Ku[dd],sx=hd.toLowerCase(),lx=hd[0].toUpperCase()+hd.slice(1);wn(sx,"on"+lx)}wn(Ym,"onAnimationEnd"),wn(Gm,"onAnimationIteration"),wn(Im,"onAnimationStart"),wn("dblclick","onDoubleClick"),wn("focusin","onFocus"),wn("focusout","onBlur"),wn(ww,"onTransitionRun"),wn(xw,"onTransitionStart"),wn(Ew,"onTransitionCancel"),wn(Xm,"onTransitionEnd"),Ei("onMouseEnter",["mouseout","mouseover"]),Ei("onMouseLeave",["mouseout","mouseover"]),Ei("onPointerEnter",["pointerout","pointerover"]),Ei("onPointerLeave",["pointerout","pointerover"]),Kn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Kn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Kn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Kn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Kn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Kn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Za="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(" "),ax=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Za));function hy(e,i){i=(i&4)!==0;for(var l=0;l<e.length;l++){var r=e[l],f=r.event;r=r.listeners;e:{var m=void 0;if(i)for(var b=r.length-1;0<=b;b--){var O=r[b],H=O.instance,J=O.currentTarget;if(O=O.listener,H!==m&&f.isPropagationStopped())break e;m=O,f.currentTarget=J;try{m(f)}catch(le){or(le)}f.currentTarget=null,m=H}else for(b=0;b<r.length;b++){if(O=r[b],H=O.instance,J=O.currentTarget,O=O.listener,H!==m&&f.isPropagationStopped())break e;m=O,f.currentTarget=J;try{m(f)}catch(le){or(le)}f.currentTarget=null,m=H}}}}function Oe(e,i){var l=i[Us];l===void 0&&(l=i[Us]=new Set);var r=e+"__bubble";l.has(r)||(my(i,e,2,!1),l.add(r))}function md(e,i,l){var r=0;i&&(r|=4),my(l,e,r,i)}var Kr="_reactListening"+Math.random().toString(36).slice(2);function pd(e){if(!e[Kr]){e[Kr]=!0,Qo.forEach(function(l){l!=="selectionchange"&&(ax.has(l)||md(l,!1,e),md(l,!0,e))});var i=e.nodeType===9?e:e.ownerDocument;i===null||i[Kr]||(i[Kr]=!0,md("selectionchange",!1,i))}}function my(e,i,l,r){switch(Yy(i)){case 2:var f=jx;break;case 8:f=Rx;break;default:f=Od}l=f.bind(null,i,l,e),f=void 0,!ju||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(f=!0),r?f!==void 0?e.addEventListener(i,l,{capture:!0,passive:f}):e.addEventListener(i,l,!0):f!==void 0?e.addEventListener(i,l,{passive:f}):e.addEventListener(i,l,!1)}function gd(e,i,l,r,f){var m=r;if((i&1)===0&&(i&2)===0&&r!==null)e:for(;;){if(r===null)return;var b=r.tag;if(b===3||b===4){var O=r.stateNode.containerInfo;if(O===f)break;if(b===4)for(b=r.return;b!==null;){var H=b.tag;if((H===3||H===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;O!==null;){if(b=bi(O),b===null)return;if(H=b.tag,H===5||H===6||H===26||H===27){r=m=b;continue e}O=O.parentNode}}r=r.return}bm(function(){var J=m,le=Du(l),re=[];e:{var P=Km.get(e);if(P!==void 0){var ee=sr,ge=e;switch(e){case"keypress":if(nr(l)===0)break e;case"keydown":case"keyup":ee=PS;break;case"focusin":ge="focus",ee=Hu;break;case"focusout":ge="blur",ee=Hu;break;case"beforeblur":case"afterblur":ee=Hu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=xm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=qS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=nw;break;case Ym:case Gm:case Im:ee=GS;break;case Xm:ee=sw;break;case"scroll":case"scrollend":ee=$S;break;case"wheel":ee=aw;break;case"copy":case"cut":case"paste":ee=XS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=Nm;break;case"toggle":case"beforetoggle":ee=rw}var we=(i&4)!==0,Ge=!we&&(e==="scroll"||e==="scrollend"),Z=we?P!==null?P+"Capture":null:P;we=[];for(var q=J,F;q!==null;){var oe=q;if(F=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||F===null||Z===null||(oe=ga(q,Z),oe!=null&&we.push(Qa(q,oe,F))),Ge)break;q=q.return}0<we.length&&(P=new ee(P,ge,null,l,le),re.push({event:P,listeners:we}))}}if((i&7)===0){e:{if(P=e==="mouseover"||e==="pointerover",ee=e==="mouseout"||e==="pointerout",P&&l!==zu&&(ge=l.relatedTarget||l.fromElement)&&(bi(ge)||ge[Xn]))break e;if((ee||P)&&(P=le.window===le?le:(P=le.ownerDocument)?P.defaultView||P.parentWindow:window,ee?(ge=l.relatedTarget||l.toElement,ee=J,ge=ge?bi(ge):null,ge!==null&&(Ge=c(ge),we=ge.tag,ge!==Ge||we!==5&&we!==27&&we!==6)&&(ge=null)):(ee=null,ge=J),ee!==ge)){if(we=xm,oe="onMouseLeave",Z="onMouseEnter",q="mouse",(e==="pointerout"||e==="pointerover")&&(we=Nm,oe="onPointerLeave",Z="onPointerEnter",q="pointer"),Ge=ee==null?P:wi(ee),F=ge==null?P:wi(ge),P=new we(oe,q+"leave",ee,l,le),P.target=Ge,P.relatedTarget=F,oe=null,bi(le)===J&&(we=new we(Z,q+"enter",ge,l,le),we.target=F,we.relatedTarget=Ge,oe=we),Ge=oe,ee&&ge)t:{for(we=ox,Z=ee,q=ge,F=0,oe=Z;oe;oe=we(oe))F++;oe=0;for(var Se=q;Se;Se=we(Se))oe++;for(;0<F-oe;)Z=we(Z),F--;for(;0<oe-F;)q=we(q),oe--;for(;F--;){if(Z===q||q!==null&&Z===q.alternate){we=Z;break t}Z=we(Z),q=we(q)}we=null}else we=null;ee!==null&&py(re,P,ee,we,!1),ge!==null&&Ge!==null&&py(re,Ge,ge,we,!0)}}e:{if(P=J?wi(J):window,ee=P.nodeName&&P.nodeName.toLowerCase(),ee==="select"||ee==="input"&&P.type==="file")var Le=Dm;else if(Om(P))if(km)Le=vw;else{Le=gw;var ve=pw}else ee=P.nodeName,!ee||ee.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?J&&Ou(J.elementType)&&(Le=Dm):Le=yw;if(Le&&(Le=Le(e,J))){zm(re,Le,l,le);break e}ve&&ve(e,P,J),e==="focusout"&&J&&P.type==="number"&&J.memoizedProps.value!=null&&ma(P,"number",P.value)}switch(ve=J?wi(J):window,e){case"focusin":(Om(ve)||ve.contentEditable==="true")&&(Qs=ve,Gu=J,Na=null);break;case"focusout":Na=Gu=Qs=null;break;case"mousedown":Iu=!0;break;case"contextmenu":case"mouseup":case"dragend":Iu=!1,qm(re,l,le);break;case"selectionchange":if(Sw)break;case"keydown":case"keyup":qm(re,l,le)}var Te;if(Uu)e:{switch(e){case"compositionstart":var ke="onCompositionStart";break e;case"compositionend":ke="onCompositionEnd";break e;case"compositionupdate":ke="onCompositionUpdate";break e}ke=void 0}else Zs?Mm(e,l)&&(ke="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(ke="onCompositionStart");ke&&(_m&&l.locale!=="ko"&&(Zs||ke!=="onCompositionStart"?ke==="onCompositionEnd"&&Zs&&(Te=Sm()):(_i=le,Ru="value"in _i?_i.value:_i.textContent,Zs=!0)),ve=Zr(J,ke),0<ve.length&&(ke=new Em(ke,e,null,l,le),re.push({event:ke,listeners:ve}),Te?ke.data=Te:(Te=Cm(l),Te!==null&&(ke.data=Te)))),(Te=uw?fw(e,l):dw(e,l))&&(ke=Zr(J,"onBeforeInput"),0<ke.length&&(ve=new Em("onBeforeInput","beforeinput",null,l,le),re.push({event:ve,listeners:ke}),ve.data=Te)),ix(re,e,J,l,le)}hy(re,i)})}function Qa(e,i,l){return{instance:e,listener:i,currentTarget:l}}function Zr(e,i){for(var l=i+"Capture",r=[];e!==null;){var f=e,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=ga(e,l),f!=null&&r.unshift(Qa(e,f,m)),f=ga(e,i),f!=null&&r.push(Qa(e,f,m))),e.tag===3)return r;e=e.return}return[]}function ox(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function py(e,i,l,r,f){for(var m=i._reactName,b=[];l!==null&&l!==r;){var O=l,H=O.alternate,J=O.stateNode;if(O=O.tag,H!==null&&H===r)break;O!==5&&O!==26&&O!==27||J===null||(H=J,f?(J=ga(l,m),J!=null&&b.unshift(Qa(l,J,H))):f||(J=ga(l,m),J!=null&&b.push(Qa(l,J,H)))),l=l.return}b.length!==0&&e.push({event:i,listeners:b})}var rx=/\r\n?/g,cx=/\u0000|\uFFFD/g;function gy(e){return(typeof e=="string"?e:""+e).replace(rx,`
|
|
9
|
+
`).replace(cx,"")}function yy(e,i){return i=gy(i),gy(e)===i}function Ye(e,i,l,r,f,m){switch(l){case"children":typeof r=="string"?i==="body"||i==="textarea"&&r===""||Is(e,r):(typeof r=="number"||typeof r=="bigint")&&i!=="body"&&Is(e,""+r);break;case"className":Vs(e,"class",r);break;case"tabIndex":Vs(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Vs(e,l,r);break;case"style":ym(e,r,m);break;case"data":if(i!=="object"){Vs(e,"data",r);break}case"src":case"href":if(r===""&&(i!=="a"||l!=="href")){e.removeAttribute(l);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(l);break}r=er(""+r),e.setAttribute(l,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(l==="formAction"?(i!=="input"&&Ye(e,i,"name",f.name,f,null),Ye(e,i,"formEncType",f.formEncType,f,null),Ye(e,i,"formMethod",f.formMethod,f,null),Ye(e,i,"formTarget",f.formTarget,f,null)):(Ye(e,i,"encType",f.encType,f,null),Ye(e,i,"method",f.method,f,null),Ye(e,i,"target",f.target,f,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(l);break}r=er(""+r),e.setAttribute(l,r);break;case"onClick":r!=null&&(e.onclick=Zn);break;case"onScroll":r!=null&&Oe("scroll",e);break;case"onScrollEnd":r!=null&&Oe("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(a(61));if(l=r.__html,l!=null){if(f.children!=null)throw Error(a(60));e.innerHTML=l}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}l=er(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(l,""+r):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":r===!0?e.setAttribute(l,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(l,r):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(l,r):e.removeAttribute(l);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(l):e.setAttribute(l,r);break;case"popover":Oe("beforetoggle",e),Oe("toggle",e),qs(e,"popover",r);break;case"xlinkActuate":Sn(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Sn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Sn(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Sn(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Sn(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Sn(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Sn(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Sn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Sn(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":qs(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=BS.get(l)||l,qs(e,l,r))}}function yd(e,i,l,r,f,m){switch(l){case"style":ym(e,r,m);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(a(61));if(l=r.__html,l!=null){if(f.children!=null)throw Error(a(60));e.innerHTML=l}}break;case"children":typeof r=="string"?Is(e,r):(typeof r=="number"||typeof r=="bigint")&&Is(e,""+r);break;case"onScroll":r!=null&&Oe("scroll",e);break;case"onScrollEnd":r!=null&&Oe("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Zn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fo.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),i=l.slice(2,f?l.length-7:void 0),m=e[kt]||null,m=m!=null?m[l]:null,typeof m=="function"&&e.removeEventListener(i,m,f),typeof r=="function")){typeof m!="function"&&m!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(i,r,f);break e}l in e?e[l]=r:r===!0?e.setAttribute(l,""):qs(e,l,r)}}}function Ot(e,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Oe("error",e),Oe("load",e);var r=!1,f=!1,m;for(m in l)if(l.hasOwnProperty(m)){var b=l[m];if(b!=null)switch(m){case"src":r=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Ye(e,i,m,b,l,null)}}f&&Ye(e,i,"srcSet",l.srcSet,l,null),r&&Ye(e,i,"src",l.src,l,null);return;case"input":Oe("invalid",e);var O=m=b=f=null,H=null,J=null;for(r in l)if(l.hasOwnProperty(r)){var le=l[r];if(le!=null)switch(r){case"name":f=le;break;case"type":b=le;break;case"checked":H=le;break;case"defaultChecked":J=le;break;case"value":m=le;break;case"defaultValue":O=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(a(137,i));break;default:Ye(e,i,r,le,l,null)}}Gs(e,m,O,H,J,b,f,!1);return;case"select":Oe("invalid",e),r=b=m=null;for(f in l)if(l.hasOwnProperty(f)&&(O=l[f],O!=null))switch(f){case"value":m=O;break;case"defaultValue":b=O;break;case"multiple":r=O;default:Ye(e,i,f,O,l,null)}i=m,l=b,e.multiple=!!r,i!=null?Ni(e,!!r,i,!1):l!=null&&Ni(e,!!r,l,!0);return;case"textarea":Oe("invalid",e),m=f=r=null;for(b in l)if(l.hasOwnProperty(b)&&(O=l[b],O!=null))switch(b){case"value":r=O;break;case"defaultValue":f=O;break;case"children":m=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(a(91));break;default:Ye(e,i,b,O,l,null)}pm(e,r,f,m);return;case"option":for(H in l)l.hasOwnProperty(H)&&(r=l[H],r!=null)&&(H==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":Ye(e,i,H,r,l,null));return;case"dialog":Oe("beforetoggle",e),Oe("toggle",e),Oe("cancel",e),Oe("close",e);break;case"iframe":case"object":Oe("load",e);break;case"video":case"audio":for(r=0;r<Za.length;r++)Oe(Za[r],e);break;case"image":Oe("error",e),Oe("load",e);break;case"details":Oe("toggle",e);break;case"embed":case"source":case"link":Oe("error",e),Oe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in l)if(l.hasOwnProperty(J)&&(r=l[J],r!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Ye(e,i,J,r,l,null)}return;default:if(Ou(i)){for(le in l)l.hasOwnProperty(le)&&(r=l[le],r!==void 0&&yd(e,i,le,r,l,void 0));return}}for(O in l)l.hasOwnProperty(O)&&(r=l[O],r!=null&&Ye(e,i,O,r,l,null))}function ux(e,i,l,r){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,b=null,O=null,H=null,J=null,le=null;for(ee in l){var re=l[ee];if(l.hasOwnProperty(ee)&&re!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":H=re;default:r.hasOwnProperty(ee)||Ye(e,i,ee,null,r,re)}}for(var P in r){var ee=r[P];if(re=l[P],r.hasOwnProperty(P)&&(ee!=null||re!=null))switch(P){case"type":m=ee;break;case"name":f=ee;break;case"checked":J=ee;break;case"defaultChecked":le=ee;break;case"value":b=ee;break;case"defaultValue":O=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(a(137,i));break;default:ee!==re&&Ye(e,i,P,ee,r,re)}}ha(e,b,O,H,J,le,m,f);return;case"select":ee=b=O=P=null;for(m in l)if(H=l[m],l.hasOwnProperty(m)&&H!=null)switch(m){case"value":break;case"multiple":ee=H;default:r.hasOwnProperty(m)||Ye(e,i,m,null,r,H)}for(f in r)if(m=r[f],H=l[f],r.hasOwnProperty(f)&&(m!=null||H!=null))switch(f){case"value":P=m;break;case"defaultValue":O=m;break;case"multiple":b=m;default:m!==H&&Ye(e,i,f,m,r,H)}i=O,l=b,r=ee,P!=null?Ni(e,!!l,P,!1):!!r!=!!l&&(i!=null?Ni(e,!!l,i,!0):Ni(e,!!l,l?[]:"",!1));return;case"textarea":ee=P=null;for(O in l)if(f=l[O],l.hasOwnProperty(O)&&f!=null&&!r.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:Ye(e,i,O,null,r,f)}for(b in r)if(f=r[b],m=l[b],r.hasOwnProperty(b)&&(f!=null||m!=null))switch(b){case"value":P=f;break;case"defaultValue":ee=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(a(91));break;default:f!==m&&Ye(e,i,b,f,r,m)}pa(e,P,ee);return;case"option":for(var ge in l)P=l[ge],l.hasOwnProperty(ge)&&P!=null&&!r.hasOwnProperty(ge)&&(ge==="selected"?e.selected=!1:Ye(e,i,ge,null,r,P));for(H in r)P=r[H],ee=l[H],r.hasOwnProperty(H)&&P!==ee&&(P!=null||ee!=null)&&(H==="selected"?e.selected=P&&typeof P!="function"&&typeof P!="symbol":Ye(e,i,H,P,r,ee));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var we in l)P=l[we],l.hasOwnProperty(we)&&P!=null&&!r.hasOwnProperty(we)&&Ye(e,i,we,null,r,P);for(J in r)if(P=r[J],ee=l[J],r.hasOwnProperty(J)&&P!==ee&&(P!=null||ee!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(a(137,i));break;default:Ye(e,i,J,P,r,ee)}return;default:if(Ou(i)){for(var Ge in l)P=l[Ge],l.hasOwnProperty(Ge)&&P!==void 0&&!r.hasOwnProperty(Ge)&&yd(e,i,Ge,void 0,r,P);for(le in r)P=r[le],ee=l[le],!r.hasOwnProperty(le)||P===ee||P===void 0&&ee===void 0||yd(e,i,le,P,r,ee);return}}for(var Z in l)P=l[Z],l.hasOwnProperty(Z)&&P!=null&&!r.hasOwnProperty(Z)&&Ye(e,i,Z,null,r,P);for(re in r)P=r[re],ee=l[re],!r.hasOwnProperty(re)||P===ee||P==null&&ee==null||Ye(e,i,re,P,r,ee)}function vy(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function fx(){if(typeof performance.getEntriesByType=="function"){for(var e=0,i=0,l=performance.getEntriesByType("resource"),r=0;r<l.length;r++){var f=l[r],m=f.transferSize,b=f.initiatorType,O=f.duration;if(m&&O&&vy(b)){for(b=0,O=f.responseEnd,r+=1;r<l.length;r++){var H=l[r],J=H.startTime;if(J>O)break;var le=H.transferSize,re=H.initiatorType;le&&vy(re)&&(H=H.responseEnd,b+=le*(H<O?1:(O-J)/(H-J)))}if(--r,i+=8*(m+b)/(f.duration/1e3),e++,10<e)break}}if(0<e)return i/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var vd=null,bd=null;function Qr(e){return e.nodeType===9?e:e.ownerDocument}function by(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Sy(e,i){if(e===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&i==="foreignObject"?0:e}function Sd(e,i){return e==="textarea"||e==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var wd=null;function dx(){var e=window.event;return e&&e.type==="popstate"?e===wd?!1:(wd=e,!0):(wd=null,!1)}var wy=typeof setTimeout=="function"?setTimeout:void 0,hx=typeof clearTimeout=="function"?clearTimeout:void 0,xy=typeof Promise=="function"?Promise:void 0,mx=typeof queueMicrotask=="function"?queueMicrotask:typeof xy<"u"?function(e){return xy.resolve(null).then(e).catch(px)}:wy;function px(e){setTimeout(function(){throw e})}function Vi(e){return e==="head"}function Ey(e,i){var l=i,r=0;do{var f=l.nextSibling;if(e.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"||l==="/&"){if(r===0){e.removeChild(f),xl(i);return}r--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")r++;else if(l==="html")Fa(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Fa(l);for(var m=l.firstChild;m;){var b=m.nextSibling,O=m.nodeName;m[os]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&m.rel.toLowerCase()==="stylesheet"||l.removeChild(m),m=b}}else l==="body"&&Fa(e.ownerDocument.body);l=f}while(l);xl(i)}function Ny(e,i){var l=e;e=0;do{var r=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),r&&r.nodeType===8)if(l=r.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=r}while(l)}function xd(e){var i=e.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":xd(l),ca(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function gx(e,i,l,r){for(;e.nodeType===1;){var f=l;if(e.nodeName.toLowerCase()!==i.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[os])switch(i){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(m=e.getAttribute("rel"),m==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(m!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(m=e.getAttribute("src"),(m!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(i==="input"&&e.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===m)return e}else return e;if(e=mn(e.nextSibling),e===null)break}return null}function yx(e,i,l){if(i==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=mn(e.nextSibling),e===null))return null;return e}function _y(e,i){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=mn(e.nextSibling),e===null))return null;return e}function Ed(e){return e.data==="$?"||e.data==="$~"}function Nd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function vx(e,i){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=i;else if(e.data!=="$?"||l.readyState!=="loading")i();else{var r=function(){i(),l.removeEventListener("DOMContentLoaded",r)};l.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function mn(e){for(;e!=null;e=e.nextSibling){var i=e.nodeType;if(i===1||i===3)break;if(i===8){if(i=e.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return e}var _d=null;function Ay(e){e=e.nextSibling;for(var i=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(i===0)return mn(e.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}e=e.nextSibling}return null}function Ty(e){e=e.previousSibling;for(var i=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return e;i--}else l!=="/$"&&l!=="/&"||i++}e=e.previousSibling}return null}function My(e,i,l){switch(i=Qr(l),e){case"html":if(e=i.documentElement,!e)throw Error(a(452));return e;case"head":if(e=i.head,!e)throw Error(a(453));return e;case"body":if(e=i.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Fa(e){for(var i=e.attributes;i.length;)e.removeAttributeNode(i[0]);ca(e)}var pn=new Map,Cy=new Set;function Fr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ui=B.d;B.d={f:bx,r:Sx,D:wx,C:xx,L:Ex,m:Nx,X:Ax,S:_x,M:Tx};function bx(){var e=ui.f(),i=qr();return e||i}function Sx(e){var i=Si(e);i!==null&&i.tag===5&&i.type==="form"?Xp(i):ui.r(e)}var bl=typeof document>"u"?null:document;function Oy(e,i,l){var r=bl;if(r&&typeof i=="string"&&i){var f=qt(i);f='link[rel="'+e+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),Cy.has(f)||(Cy.add(f),e={rel:e,crossOrigin:l,href:i},r.querySelector(f)===null&&(i=r.createElement("link"),Ot(i,"link",e),ft(i),r.head.appendChild(i)))}}function wx(e){ui.D(e),Oy("dns-prefetch",e,null)}function xx(e,i){ui.C(e,i),Oy("preconnect",e,i)}function Ex(e,i,l){ui.L(e,i,l);var r=bl;if(r&&e&&i){var f='link[rel="preload"][as="'+qt(i)+'"]';i==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+qt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+qt(l.imageSizes)+'"]')):f+='[href="'+qt(e)+'"]';var m=f;switch(i){case"style":m=Sl(e);break;case"script":m=wl(e)}pn.has(m)||(e=g({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:e,as:i},l),pn.set(m,e),r.querySelector(f)!==null||i==="style"&&r.querySelector(Ja(m))||i==="script"&&r.querySelector(Wa(m))||(i=r.createElement("link"),Ot(i,"link",e),ft(i),r.head.appendChild(i)))}}function Nx(e,i){ui.m(e,i);var l=bl;if(l&&e){var r=i&&typeof i.as=="string"?i.as:"script",f='link[rel="modulepreload"][as="'+qt(r)+'"][href="'+qt(e)+'"]',m=f;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=wl(e)}if(!pn.has(m)&&(e=g({rel:"modulepreload",href:e},i),pn.set(m,e),l.querySelector(f)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Wa(m)))return}r=l.createElement("link"),Ot(r,"link",e),ft(r),l.head.appendChild(r)}}}function _x(e,i,l){ui.S(e,i,l);var r=bl;if(r&&e){var f=xi(r).hoistableStyles,m=Sl(e);i=i||"default";var b=f.get(m);if(!b){var O={loading:0,preload:null};if(b=r.querySelector(Ja(m)))O.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":i},l),(l=pn.get(m))&&Ad(e,l);var H=b=r.createElement("link");ft(H),Ot(H,"link",e),H._p=new Promise(function(J,le){H.onload=J,H.onerror=le}),H.addEventListener("load",function(){O.loading|=1}),H.addEventListener("error",function(){O.loading|=2}),O.loading|=4,Jr(b,i,r)}b={type:"stylesheet",instance:b,count:1,state:O},f.set(m,b)}}}function Ax(e,i){ui.X(e,i);var l=bl;if(l&&e){var r=xi(l).hoistableScripts,f=wl(e),m=r.get(f);m||(m=l.querySelector(Wa(f)),m||(e=g({src:e,async:!0},i),(i=pn.get(f))&&Td(e,i),m=l.createElement("script"),ft(m),Ot(m,"link",e),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},r.set(f,m))}}function Tx(e,i){ui.M(e,i);var l=bl;if(l&&e){var r=xi(l).hoistableScripts,f=wl(e),m=r.get(f);m||(m=l.querySelector(Wa(f)),m||(e=g({src:e,async:!0,type:"module"},i),(i=pn.get(f))&&Td(e,i),m=l.createElement("script"),ft(m),Ot(m,"link",e),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},r.set(f,m))}}function zy(e,i,l,r){var f=(f=he.current)?Fr(f):null;if(!f)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=Sl(l.href),l=xi(f).hoistableStyles,r=l.get(i),r||(r={type:"style",instance:null,count:0,state:null},l.set(i,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Sl(l.href);var m=xi(f).hoistableStyles,b=m.get(e);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(e,b),(m=f.querySelector(Ja(e)))&&!m._p&&(b.instance=m,b.state.loading=5),pn.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},pn.set(e,l),m||Mx(f,e,l,b.state))),i&&r===null)throw Error(a(528,""));return b}if(i&&r!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=wl(l),l=xi(f).hoistableScripts,r=l.get(i),r||(r={type:"script",instance:null,count:0,state:null},l.set(i,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Sl(e){return'href="'+qt(e)+'"'}function Ja(e){return'link[rel="stylesheet"]['+e+"]"}function Dy(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function Mx(e,i,l,r){e.querySelector('link[rel="preload"][as="style"]['+i+"]")?r.loading=1:(i=e.createElement("link"),r.preload=i,i.addEventListener("load",function(){return r.loading|=1}),i.addEventListener("error",function(){return r.loading|=2}),Ot(i,"link",l),ft(i),e.head.appendChild(i))}function wl(e){return'[src="'+qt(e)+'"]'}function Wa(e){return"script[async]"+e}function ky(e,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var r=e.querySelector('style[data-href~="'+qt(l.href)+'"]');if(r)return i.instance=r,ft(r),r;var f=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),ft(r),Ot(r,"style",f),Jr(r,l.precedence,e),i.instance=r;case"stylesheet":f=Sl(l.href);var m=e.querySelector(Ja(f));if(m)return i.state.loading|=4,i.instance=m,ft(m),m;r=Dy(l),(f=pn.get(f))&&Ad(r,f),m=(e.ownerDocument||e).createElement("link"),ft(m);var b=m;return b._p=new Promise(function(O,H){b.onload=O,b.onerror=H}),Ot(m,"link",r),i.state.loading|=4,Jr(m,l.precedence,e),i.instance=m;case"script":return m=wl(l.src),(f=e.querySelector(Wa(m)))?(i.instance=f,ft(f),f):(r=l,(f=pn.get(m))&&(r=g({},l),Td(r,f)),e=e.ownerDocument||e,f=e.createElement("script"),ft(f),Ot(f,"link",r),e.head.appendChild(f),i.instance=f);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(r=i.instance,i.state.loading|=4,Jr(r,l.precedence,e));return i.instance}function Jr(e,i,l){for(var r=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=r.length?r[r.length-1]:null,m=f,b=0;b<r.length;b++){var O=r[b];if(O.dataset.precedence===i)m=O;else if(m!==f)break}m?m.parentNode.insertBefore(e,m.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(e,i.firstChild))}function Ad(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.title==null&&(e.title=i.title)}function Td(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.integrity==null&&(e.integrity=i.integrity)}var Wr=null;function jy(e,i,l){if(Wr===null){var r=new Map,f=Wr=new Map;f.set(l,r)}else f=Wr,r=f.get(l),r||(r=new Map,f.set(l,r));if(r.has(e))return r;for(r.set(e,null),l=l.getElementsByTagName(e),f=0;f<l.length;f++){var m=l[f];if(!(m[os]||m[bt]||e==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(i)||"";b=e+b;var O=r.get(b);O?O.push(m):r.set(b,[m])}}return r}function Ry(e,i,l){e=e.ownerDocument||e,e.head.insertBefore(l,i==="title"?e.querySelector("head > title"):null)}function Cx(e,i,l){if(l===1||i.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(e=i.disabled,typeof i.precedence=="string"&&e==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Ly(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ox(e,i,l,r){if(l.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var f=Sl(r.href),m=i.querySelector(Ja(f));if(m){i=m._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(e.count++,e=Pr.bind(e),i.then(e,e)),l.state.loading|=4,l.instance=m,ft(m);return}m=i.ownerDocument||i,r=Dy(r),(f=pn.get(f))&&Ad(r,f),m=m.createElement("link"),ft(m);var b=m;b._p=new Promise(function(O,H){b.onload=O,b.onerror=H}),Ot(m,"link",r),l.instance=m}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Pr.bind(e),i.addEventListener("load",l),i.addEventListener("error",l))}}var Md=0;function zx(e,i){return e.stylesheets&&e.count===0&&tc(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var r=setTimeout(function(){if(e.stylesheets&&tc(e,e.stylesheets),e.unsuspend){var m=e.unsuspend;e.unsuspend=null,m()}},6e4+i);0<e.imgBytes&&Md===0&&(Md=62500*fx());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&tc(e,e.stylesheets),e.unsuspend)){var m=e.unsuspend;e.unsuspend=null,m()}},(e.imgBytes>Md?50:800)+i);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(f)}}:null}function Pr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ec=null;function tc(e,i){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ec=new Map,i.forEach(Dx,e),ec=null,Pr.call(e))}function Dx(e,i){if(!(i.state.loading&4)){var l=ec.get(e);if(l)var r=l.get(null);else{l=new Map,ec.set(e,l);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var b=f[m];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(l.set(b.dataset.precedence,b),r=b)}r&&l.set(null,r)}f=i.instance,b=f.getAttribute("data-precedence"),m=l.get(b)||r,m===r&&l.set(null,f),l.set(b,f),this.count++,r=Pr.bind(this),f.addEventListener("load",r),f.addEventListener("error",r),m?m.parentNode.insertBefore(f,m.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),i.state.loading|=4}}var Pa={$$typeof:_,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function kx(e,i,l,r,f,m,b,O,H){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=aa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=aa(0),this.hiddenUpdates=aa(null),this.identifierPrefix=r,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function By(e,i,l,r,f,m,b,O,H,J,le,re){return e=new kx(e,i,l,b,H,J,le,re,O),i=1,m===!0&&(i|=24),m=Jt(3,null,null,i),e.current=m,m.stateNode=e,i=of(),i.refCount++,e.pooledCache=i,i.refCount++,m.memoizedState={element:r,isDehydrated:l,cache:i},ff(m),e}function Hy(e){return e?(e=Ws,e):Ws}function $y(e,i,l,r,f,m){f=Hy(f),r.context===null?r.context=f:r.pendingContext=f,r=zi(i),r.payload={element:l},m=m===void 0?null:m,m!==null&&(r.callback=m),l=Di(e,r,i),l!==null&&(Kt(l,e,i),za(l,e,i))}function Uy(e,i){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<i?l:i}}function Cd(e,i){Uy(e,i),(e=e.alternate)&&Uy(e,i)}function qy(e){if(e.tag===13||e.tag===31){var i=fs(e,67108864);i!==null&&Kt(i,e,67108864),Cd(e,67108864)}}function Vy(e){if(e.tag===13||e.tag===31){var i=nn();i=oa(i);var l=fs(e,i);l!==null&&Kt(l,e,i),Cd(e,i)}}var nc=!0;function jx(e,i,l,r){var f=z.T;z.T=null;var m=B.p;try{B.p=2,Od(e,i,l,r)}finally{B.p=m,z.T=f}}function Rx(e,i,l,r){var f=z.T;z.T=null;var m=B.p;try{B.p=8,Od(e,i,l,r)}finally{B.p=m,z.T=f}}function Od(e,i,l,r){if(nc){var f=zd(r);if(f===null)gd(e,i,r,ic,l),Gy(e,r);else if(Bx(f,e,i,l,r))r.stopPropagation();else if(Gy(e,r),i&4&&-1<Lx.indexOf(e)){for(;f!==null;){var m=Si(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=vt(m.pendingLanes);if(b!==0){var O=m;for(O.pendingLanes|=2,O.entangledLanes|=2;b;){var H=1<<31-_t(b);O.entanglements[1]|=H,b&=~H}Bn(m),(He&6)===0&&($r=Pe()+500,Ka(0))}}break;case 31:case 13:O=fs(m,2),O!==null&&Kt(O,m,2),qr(),Cd(m,2)}if(m=zd(r),m===null&&gd(e,i,r,ic,l),m===f)break;f=m}f!==null&&r.stopPropagation()}else gd(e,i,r,null,l)}}function zd(e){return e=Du(e),Dd(e)}var ic=null;function Dd(e){if(ic=null,e=bi(e),e!==null){var i=c(e);if(i===null)e=null;else{var l=i.tag;if(l===13){if(e=u(i),e!==null)return e;e=null}else if(l===31){if(e=d(i),e!==null)return e;e=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;e=null}else i!==e&&(e=null)}}return ic=e,null}function Yy(e){switch(e){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(rt()){case Lt:return 2;case Qe:return 8;case Dt:case ls:return 32;case vi:return 268435456;default:return 32}default:return 32}}var kd=!1,Yi=null,Gi=null,Ii=null,eo=new Map,to=new Map,Xi=[],Lx="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".split(" ");function Gy(e,i){switch(e){case"focusin":case"focusout":Yi=null;break;case"dragenter":case"dragleave":Gi=null;break;case"mouseover":case"mouseout":Ii=null;break;case"pointerover":case"pointerout":eo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":to.delete(i.pointerId)}}function no(e,i,l,r,f,m){return e===null||e.nativeEvent!==m?(e={blockedOn:i,domEventName:l,eventSystemFlags:r,nativeEvent:m,targetContainers:[f]},i!==null&&(i=Si(i),i!==null&&qy(i)),e):(e.eventSystemFlags|=r,i=e.targetContainers,f!==null&&i.indexOf(f)===-1&&i.push(f),e)}function Bx(e,i,l,r,f){switch(i){case"focusin":return Yi=no(Yi,e,i,l,r,f),!0;case"dragenter":return Gi=no(Gi,e,i,l,r,f),!0;case"mouseover":return Ii=no(Ii,e,i,l,r,f),!0;case"pointerover":var m=f.pointerId;return eo.set(m,no(eo.get(m)||null,e,i,l,r,f)),!0;case"gotpointercapture":return m=f.pointerId,to.set(m,no(to.get(m)||null,e,i,l,r,f)),!0}return!1}function Iy(e){var i=bi(e.target);if(i!==null){var l=c(i);if(l!==null){if(i=l.tag,i===13){if(i=u(l),i!==null){e.blockedOn=i,Xo(e.priority,function(){Vy(l)});return}}else if(i===31){if(i=d(l),i!==null){e.blockedOn=i,Xo(e.priority,function(){Vy(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function sc(e){if(e.blockedOn!==null)return!1;for(var i=e.targetContainers;0<i.length;){var l=zd(e.nativeEvent);if(l===null){l=e.nativeEvent;var r=new l.constructor(l.type,l);zu=r,l.target.dispatchEvent(r),zu=null}else return i=Si(l),i!==null&&qy(i),e.blockedOn=l,!1;i.shift()}return!0}function Xy(e,i,l){sc(e)&&l.delete(i)}function Hx(){kd=!1,Yi!==null&&sc(Yi)&&(Yi=null),Gi!==null&&sc(Gi)&&(Gi=null),Ii!==null&&sc(Ii)&&(Ii=null),eo.forEach(Xy),to.forEach(Xy)}function lc(e,i){e.blockedOn===i&&(e.blockedOn=null,kd||(kd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Hx)))}var ac=null;function Ky(e){ac!==e&&(ac=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ac===e&&(ac=null);for(var i=0;i<e.length;i+=3){var l=e[i],r=e[i+1],f=e[i+2];if(typeof r!="function"){if(Dd(r||l)===null)continue;break}var m=Si(l);m!==null&&(e.splice(i,3),i-=3,zf(m,{pending:!0,data:f,method:l.method,action:r},r,f))}}))}function xl(e){function i(H){return lc(H,e)}Yi!==null&&lc(Yi,e),Gi!==null&&lc(Gi,e),Ii!==null&&lc(Ii,e),eo.forEach(i),to.forEach(i);for(var l=0;l<Xi.length;l++){var r=Xi[l];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Xi.length&&(l=Xi[0],l.blockedOn===null);)Iy(l),l.blockedOn===null&&Xi.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(r=0;r<l.length;r+=3){var f=l[r],m=l[r+1],b=f[kt]||null;if(typeof m=="function")b||Ky(l);else if(b){var O=null;if(m&&m.hasAttribute("formAction")){if(f=m,b=m[kt]||null)O=b.formAction;else if(Dd(f)!==null)continue}else O=b.action;typeof O=="function"?l[r+1]=O:(l.splice(r,3),r-=3),Ky(l)}}}function Zy(){function e(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(b){return f=b})},focusReset:"manual",scroll:"manual"})}function i(){f!==null&&(f(),f=null),r||setTimeout(l,20)}function l(){if(!r&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),f!==null&&(f(),f=null)}}}function jd(e){this._internalRoot=e}oc.prototype.render=jd.prototype.render=function(e){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,r=nn();$y(l,r,e,i,null,null)},oc.prototype.unmount=jd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var i=e.containerInfo;$y(e.current,2,null,e,null,null),qr(),i[Xn]=null}};function oc(e){this._internalRoot=e}oc.prototype.unstable_scheduleHydration=function(e){if(e){var i=Io();e={blockedOn:null,target:e,priority:i};for(var l=0;l<Xi.length&&i!==0&&i<Xi[l].priority;l++);Xi.splice(l,0,e),l===0&&Iy(e)}};var Qy=n.version;if(Qy!=="19.2.7")throw Error(a(527,Qy,"19.2.7"));B.findDOMNode=function(e){var i=e._reactInternals;if(i===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=p(i),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var $x={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{Gn=rc.inject($x),Nt=rc}catch{}}return so.createRoot=function(e,i){if(!o(e))throw Error(a(299));var l=!1,r="",f=ng,m=ig,b=sg;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(f=i.onUncaughtError),i.onCaughtError!==void 0&&(m=i.onCaughtError),i.onRecoverableError!==void 0&&(b=i.onRecoverableError)),i=By(e,1,!1,null,null,l,r,null,f,m,b,Zy),e[Xn]=i.current,pd(e),new jd(i)},so.hydrateRoot=function(e,i,l){if(!o(e))throw Error(a(299));var r=!1,f="",m=ng,b=ig,O=sg,H=null;return l!=null&&(l.unstable_strictMode===!0&&(r=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(m=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(O=l.onRecoverableError),l.formState!==void 0&&(H=l.formState)),i=By(e,1,!0,i,l??null,r,f,H,m,b,O,Zy),i.context=Hy(null),l=i.current,r=nn(),r=oa(r),f=zi(r),f.callback=null,Di(l,f,r),l=r,i.current.lanes=l,as(i,l),Bn(i),e[Xn]=i.current,pd(e),new oc(i)},so.version="19.2.7",so}var l0;function Zx(){if(l0)return Bd.exports;l0=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),Bd.exports=Kx(),Bd.exports}var Qx=Zx();function gt(t){if(typeof t=="string"||typeof t=="number")return""+t;let n="";if(Array.isArray(t))for(let s=0,a;s<t.length;s++)(a=gt(t[s]))!==""&&(n+=(n&&" ")+a);else for(let s in t)t[s]&&(n+=(n&&" ")+s);return n}var Fx={value:()=>{}};function Wc(){for(var t=0,n=arguments.length,s={},a;t<n;++t){if(!(a=arguments[t]+"")||a in s||/[\s.]/.test(a))throw new Error("illegal type: "+a);s[a]=[]}return new Nc(s)}function Nc(t){this._=t}function Jx(t,n){return t.trim().split(/^|\s+/).map(function(s){var a="",o=s.indexOf(".");if(o>=0&&(a=s.slice(o+1),s=s.slice(0,o)),s&&!n.hasOwnProperty(s))throw new Error("unknown type: "+s);return{type:s,name:a}})}Nc.prototype=Wc.prototype={constructor:Nc,on:function(t,n){var s=this._,a=Jx(t+"",s),o,c=-1,u=a.length;if(arguments.length<2){for(;++c<u;)if((o=(t=a[c]).type)&&(o=Wx(s[o],t.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++c<u;)if(o=(t=a[c]).type)s[o]=a0(s[o],t.name,n);else if(n==null)for(o in s)s[o]=a0(s[o],t.name,null);return this},copy:function(){var t={},n=this._;for(var s in n)t[s]=n[s].slice();return new Nc(t)},call:function(t,n){if((o=arguments.length-2)>0)for(var s=new Array(o),a=0,o,c;a<o;++a)s[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(c=this._[t],a=0,o=c.length;a<o;++a)c[a].value.apply(n,s)},apply:function(t,n,s){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var a=this._[t],o=0,c=a.length;o<c;++o)a[o].value.apply(n,s)}};function Wx(t,n){for(var s=0,a=t.length,o;s<a;++s)if((o=t[s]).name===n)return o.value}function a0(t,n,s){for(var a=0,o=t.length;a<o;++a)if(t[a].name===n){t[a]=Fx,t=t.slice(0,a).concat(t.slice(a+1));break}return s!=null&&t.push({name:n,value:s}),t}var ch="http://www.w3.org/1999/xhtml";const o0={svg:"http://www.w3.org/2000/svg",xhtml:ch,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Pc(t){var n=t+="",s=n.indexOf(":");return s>=0&&(n=t.slice(0,s))!=="xmlns"&&(t=t.slice(s+1)),o0.hasOwnProperty(n)?{space:o0[n],local:t}:t}function Px(t){return function(){var n=this.ownerDocument,s=this.namespaceURI;return s===ch&&n.documentElement.namespaceURI===ch?n.createElement(t):n.createElementNS(s,t)}}function eE(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Lv(t){var n=Pc(t);return(n.local?eE:Px)(n)}function tE(){}function jh(t){return t==null?tE:function(){return this.querySelector(t)}}function nE(t){typeof t!="function"&&(t=jh(t));for(var n=this._groups,s=n.length,a=new Array(s),o=0;o<s;++o)for(var c=n[o],u=c.length,d=a[o]=new Array(u),h,p,v=0;v<u;++v)(h=c[v])&&(p=t.call(h,h.__data__,v,c))&&("__data__"in h&&(p.__data__=h.__data__),d[v]=p);return new an(a,this._parents)}function iE(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function sE(){return[]}function Bv(t){return t==null?sE:function(){return this.querySelectorAll(t)}}function lE(t){return function(){return iE(t.apply(this,arguments))}}function aE(t){typeof t=="function"?t=lE(t):t=Bv(t);for(var n=this._groups,s=n.length,a=[],o=[],c=0;c<s;++c)for(var u=n[c],d=u.length,h,p=0;p<d;++p)(h=u[p])&&(a.push(t.call(h,h.__data__,p,u)),o.push(h));return new an(a,o)}function Hv(t){return function(){return this.matches(t)}}function $v(t){return function(n){return n.matches(t)}}var oE=Array.prototype.find;function rE(t){return function(){return oE.call(this.children,t)}}function cE(){return this.firstElementChild}function uE(t){return this.select(t==null?cE:rE(typeof t=="function"?t:$v(t)))}var fE=Array.prototype.filter;function dE(){return Array.from(this.children)}function hE(t){return function(){return fE.call(this.children,t)}}function mE(t){return this.selectAll(t==null?dE:hE(typeof t=="function"?t:$v(t)))}function pE(t){typeof t!="function"&&(t=Hv(t));for(var n=this._groups,s=n.length,a=new Array(s),o=0;o<s;++o)for(var c=n[o],u=c.length,d=a[o]=[],h,p=0;p<u;++p)(h=c[p])&&t.call(h,h.__data__,p,c)&&d.push(h);return new an(a,this._parents)}function Uv(t){return new Array(t.length)}function gE(){return new an(this._enter||this._groups.map(Uv),this._parents)}function Lc(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}Lc.prototype={constructor:Lc,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function yE(t){return function(){return t}}function vE(t,n,s,a,o,c){for(var u=0,d,h=n.length,p=c.length;u<p;++u)(d=n[u])?(d.__data__=c[u],a[u]=d):s[u]=new Lc(t,c[u]);for(;u<h;++u)(d=n[u])&&(o[u]=d)}function bE(t,n,s,a,o,c,u){var d,h,p=new Map,v=n.length,g=c.length,y=new Array(v),S;for(d=0;d<v;++d)(h=n[d])&&(y[d]=S=u.call(h,h.__data__,d,n)+"",p.has(S)?o[d]=h:p.set(S,h));for(d=0;d<g;++d)S=u.call(t,c[d],d,c)+"",(h=p.get(S))?(a[d]=h,h.__data__=c[d],p.delete(S)):s[d]=new Lc(t,c[d]);for(d=0;d<v;++d)(h=n[d])&&p.get(y[d])===h&&(o[d]=h)}function SE(t){return t.__data__}function wE(t,n){if(!arguments.length)return Array.from(this,SE);var s=n?bE:vE,a=this._parents,o=this._groups;typeof t!="function"&&(t=yE(t));for(var c=o.length,u=new Array(c),d=new Array(c),h=new Array(c),p=0;p<c;++p){var v=a[p],g=o[p],y=g.length,S=xE(t.call(v,v&&v.__data__,p,a)),w=S.length,E=d[p]=new Array(w),N=u[p]=new Array(w),C=h[p]=new Array(y);s(v,g,E,N,C,S,n);for(var j=0,_=0,A,T;j<w;++j)if(A=E[j]){for(j>=_&&(_=j+1);!(T=N[_])&&++_<w;);A._next=T||null}}return u=new an(u,a),u._enter=d,u._exit=h,u}function xE(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function EE(){return new an(this._exit||this._groups.map(Uv),this._parents)}function NE(t,n,s){var a=this.enter(),o=this,c=this.exit();return typeof t=="function"?(a=t(a),a&&(a=a.selection())):a=a.append(t+""),n!=null&&(o=n(o),o&&(o=o.selection())),s==null?c.remove():s(c),a&&o?a.merge(o).order():o}function _E(t){for(var n=t.selection?t.selection():t,s=this._groups,a=n._groups,o=s.length,c=a.length,u=Math.min(o,c),d=new Array(o),h=0;h<u;++h)for(var p=s[h],v=a[h],g=p.length,y=d[h]=new Array(g),S,w=0;w<g;++w)(S=p[w]||v[w])&&(y[w]=S);for(;h<o;++h)d[h]=s[h];return new an(d,this._parents)}function AE(){for(var t=this._groups,n=-1,s=t.length;++n<s;)for(var a=t[n],o=a.length-1,c=a[o],u;--o>=0;)(u=a[o])&&(c&&u.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(u,c),c=u);return this}function TE(t){t||(t=ME);function n(g,y){return g&&y?t(g.__data__,y.__data__):!g-!y}for(var s=this._groups,a=s.length,o=new Array(a),c=0;c<a;++c){for(var u=s[c],d=u.length,h=o[c]=new Array(d),p,v=0;v<d;++v)(p=u[v])&&(h[v]=p);h.sort(n)}return new an(o,this._parents).order()}function ME(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function CE(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function OE(){return Array.from(this)}function zE(){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var a=t[n],o=0,c=a.length;o<c;++o){var u=a[o];if(u)return u}return null}function DE(){let t=0;for(const n of this)++t;return t}function kE(){return!this.node()}function jE(t){for(var n=this._groups,s=0,a=n.length;s<a;++s)for(var o=n[s],c=0,u=o.length,d;c<u;++c)(d=o[c])&&t.call(d,d.__data__,c,o);return this}function RE(t){return function(){this.removeAttribute(t)}}function LE(t){return function(){this.removeAttributeNS(t.space,t.local)}}function BE(t,n){return function(){this.setAttribute(t,n)}}function HE(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function $E(t,n){return function(){var s=n.apply(this,arguments);s==null?this.removeAttribute(t):this.setAttribute(t,s)}}function UE(t,n){return function(){var s=n.apply(this,arguments);s==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,s)}}function qE(t,n){var s=Pc(t);if(arguments.length<2){var a=this.node();return s.local?a.getAttributeNS(s.space,s.local):a.getAttribute(s)}return this.each((n==null?s.local?LE:RE:typeof n=="function"?s.local?UE:$E:s.local?HE:BE)(s,n))}function qv(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function VE(t){return function(){this.style.removeProperty(t)}}function YE(t,n,s){return function(){this.style.setProperty(t,n,s)}}function GE(t,n,s){return function(){var a=n.apply(this,arguments);a==null?this.style.removeProperty(t):this.style.setProperty(t,a,s)}}function IE(t,n,s){return arguments.length>1?this.each((n==null?VE:typeof n=="function"?GE:YE)(t,n,s??"")):ql(this.node(),t)}function ql(t,n){return t.style.getPropertyValue(n)||qv(t).getComputedStyle(t,null).getPropertyValue(n)}function XE(t){return function(){delete this[t]}}function KE(t,n){return function(){this[t]=n}}function ZE(t,n){return function(){var s=n.apply(this,arguments);s==null?delete this[t]:this[t]=s}}function QE(t,n){return arguments.length>1?this.each((n==null?XE:typeof n=="function"?ZE:KE)(t,n)):this.node()[t]}function Vv(t){return t.trim().split(/^|\s+/)}function Rh(t){return t.classList||new Yv(t)}function Yv(t){this._node=t,this._names=Vv(t.getAttribute("class")||"")}Yv.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Gv(t,n){for(var s=Rh(t),a=-1,o=n.length;++a<o;)s.add(n[a])}function Iv(t,n){for(var s=Rh(t),a=-1,o=n.length;++a<o;)s.remove(n[a])}function FE(t){return function(){Gv(this,t)}}function JE(t){return function(){Iv(this,t)}}function WE(t,n){return function(){(n.apply(this,arguments)?Gv:Iv)(this,t)}}function PE(t,n){var s=Vv(t+"");if(arguments.length<2){for(var a=Rh(this.node()),o=-1,c=s.length;++o<c;)if(!a.contains(s[o]))return!1;return!0}return this.each((typeof n=="function"?WE:n?FE:JE)(s,n))}function e2(){this.textContent=""}function t2(t){return function(){this.textContent=t}}function n2(t){return function(){var n=t.apply(this,arguments);this.textContent=n??""}}function i2(t){return arguments.length?this.each(t==null?e2:(typeof t=="function"?n2:t2)(t)):this.node().textContent}function s2(){this.innerHTML=""}function l2(t){return function(){this.innerHTML=t}}function a2(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n??""}}function o2(t){return arguments.length?this.each(t==null?s2:(typeof t=="function"?a2:l2)(t)):this.node().innerHTML}function r2(){this.nextSibling&&this.parentNode.appendChild(this)}function c2(){return this.each(r2)}function u2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function f2(){return this.each(u2)}function d2(t){var n=typeof t=="function"?t:Lv(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function h2(){return null}function m2(t,n){var s=typeof t=="function"?t:Lv(t),a=n==null?h2:typeof n=="function"?n:jh(n);return this.select(function(){return this.insertBefore(s.apply(this,arguments),a.apply(this,arguments)||null)})}function p2(){var t=this.parentNode;t&&t.removeChild(this)}function g2(){return this.each(p2)}function y2(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function v2(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function b2(t){return this.select(t?v2:y2)}function S2(t){return arguments.length?this.property("__data__",t):this.node().__data__}function w2(t){return function(n){t.call(this,n,this.__data__)}}function x2(t){return t.trim().split(/^|\s+/).map(function(n){var s="",a=n.indexOf(".");return a>=0&&(s=n.slice(a+1),n=n.slice(0,a)),{type:n,name:s}})}function E2(t){return function(){var n=this.__on;if(n){for(var s=0,a=-1,o=n.length,c;s<o;++s)c=n[s],(!t.type||c.type===t.type)&&c.name===t.name?this.removeEventListener(c.type,c.listener,c.options):n[++a]=c;++a?n.length=a:delete this.__on}}}function N2(t,n,s){return function(){var a=this.__on,o,c=w2(n);if(a){for(var u=0,d=a.length;u<d;++u)if((o=a[u]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=c,o.options=s),o.value=n;return}}this.addEventListener(t.type,c,s),o={type:t.type,name:t.name,value:n,listener:c,options:s},a?a.push(o):this.__on=[o]}}function _2(t,n,s){var a=x2(t+""),o,c=a.length,u;if(arguments.length<2){var d=this.node().__on;if(d){for(var h=0,p=d.length,v;h<p;++h)for(o=0,v=d[h];o<c;++o)if((u=a[o]).type===v.type&&u.name===v.name)return v.value}return}for(d=n?N2:E2,o=0;o<c;++o)this.each(d(a[o],n,s));return this}function Xv(t,n,s){var a=qv(t),o=a.CustomEvent;typeof o=="function"?o=new o(n,s):(o=a.document.createEvent("Event"),s?(o.initEvent(n,s.bubbles,s.cancelable),o.detail=s.detail):o.initEvent(n,!1,!1)),t.dispatchEvent(o)}function A2(t,n){return function(){return Xv(this,t,n)}}function T2(t,n){return function(){return Xv(this,t,n.apply(this,arguments))}}function M2(t,n){return this.each((typeof n=="function"?T2:A2)(t,n))}function*C2(){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var a=t[n],o=0,c=a.length,u;o<c;++o)(u=a[o])&&(yield u)}var Kv=[null];function an(t,n){this._groups=t,this._parents=n}function zo(){return new an([[document.documentElement]],Kv)}function O2(){return this}an.prototype=zo.prototype={constructor:an,select:nE,selectAll:aE,selectChild:uE,selectChildren:mE,filter:pE,data:wE,enter:gE,exit:EE,join:NE,merge:_E,selection:O2,order:AE,sort:TE,call:CE,nodes:OE,node:zE,size:DE,empty:kE,each:jE,attr:qE,style:IE,property:QE,classed:PE,text:i2,html:o2,raise:c2,lower:f2,append:d2,insert:m2,remove:g2,clone:b2,datum:S2,on:_2,dispatch:M2,[Symbol.iterator]:C2};function sn(t){return typeof t=="string"?new an([[document.querySelector(t)]],[document.documentElement]):new an([[t]],Kv)}function z2(t){let n;for(;n=t.sourceEvent;)t=n;return t}function An(t,n){if(t=z2(t),n===void 0&&(n=t.currentTarget),n){var s=n.ownerSVGElement||n;if(s.createSVGPoint){var a=s.createSVGPoint();return a.x=t.clientX,a.y=t.clientY,a=a.matrixTransform(n.getScreenCTM().inverse()),[a.x,a.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[t.clientX-o.left-n.clientLeft,t.clientY-o.top-n.clientTop]}}return[t.pageX,t.pageY]}const D2={passive:!1},po={capture:!0,passive:!1};function qd(t){t.stopImmediatePropagation()}function jl(t){t.preventDefault(),t.stopImmediatePropagation()}function Zv(t){var n=t.document.documentElement,s=sn(t).on("dragstart.drag",jl,po);"onselectstart"in n?s.on("selectstart.drag",jl,po):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Qv(t,n){var s=t.document.documentElement,a=sn(t).on("dragstart.drag",null);n&&(a.on("click.drag",jl,po),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in s?a.on("selectstart.drag",null):(s.style.MozUserSelect=s.__noselect,delete s.__noselect)}const cc=t=>()=>t;function uh(t,{sourceEvent:n,subject:s,target:a,identifier:o,active:c,x:u,y:d,dx:h,dy:p,dispatch:v}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:s,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:d,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:v}})}uh.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function k2(t){return!t.ctrlKey&&!t.button}function j2(){return this.parentNode}function R2(t,n){return n??{x:t.x,y:t.y}}function L2(){return navigator.maxTouchPoints||"ontouchstart"in this}function Fv(){var t=k2,n=j2,s=R2,a=L2,o={},c=Wc("start","drag","end"),u=0,d,h,p,v,g=0;function y(A){A.on("mousedown.drag",S).filter(a).on("touchstart.drag",N).on("touchmove.drag",C,D2).on("touchend.drag touchcancel.drag",j).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function S(A,T){if(!(v||!t.call(this,A,T))){var M=_(this,n.call(this,A,T),A,T,"mouse");M&&(sn(A.view).on("mousemove.drag",w,po).on("mouseup.drag",E,po),Zv(A.view),qd(A),p=!1,d=A.clientX,h=A.clientY,M("start",A))}}function w(A){if(jl(A),!p){var T=A.clientX-d,M=A.clientY-h;p=T*T+M*M>g}o.mouse("drag",A)}function E(A){sn(A.view).on("mousemove.drag mouseup.drag",null),Qv(A.view,p),jl(A),o.mouse("end",A)}function N(A,T){if(t.call(this,A,T)){var M=A.changedTouches,k=n.call(this,A,T),R=M.length,U,te;for(U=0;U<R;++U)(te=_(this,k,A,T,M[U].identifier,M[U]))&&(qd(A),te("start",A,M[U]))}}function C(A){var T=A.changedTouches,M=T.length,k,R;for(k=0;k<M;++k)(R=o[T[k].identifier])&&(jl(A),R("drag",A,T[k]))}function j(A){var T=A.changedTouches,M=T.length,k,R;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),k=0;k<M;++k)(R=o[T[k].identifier])&&(qd(A),R("end",A,T[k]))}function _(A,T,M,k,R,U){var te=c.copy(),Y=An(U||M,T),X,W,L;if((L=s.call(A,new uh("beforestart",{sourceEvent:M,target:y,identifier:R,active:u,x:Y[0],y:Y[1],dx:0,dy:0,dispatch:te}),k))!=null)return X=L.x-Y[0]||0,W=L.y-Y[1]||0,function G(z,B,I){var Q=Y,se;switch(z){case"start":o[R]=G,se=u++;break;case"end":delete o[R],--u;case"drag":Y=An(I||B,T),se=u;break}te.call(z,A,new uh(z,{sourceEvent:B,subject:L,target:y,identifier:R,active:se,x:Y[0]+X,y:Y[1]+W,dx:Y[0]-Q[0],dy:Y[1]-Q[1],dispatch:te}),k)}}return y.filter=function(A){return arguments.length?(t=typeof A=="function"?A:cc(!!A),y):t},y.container=function(A){return arguments.length?(n=typeof A=="function"?A:cc(A),y):n},y.subject=function(A){return arguments.length?(s=typeof A=="function"?A:cc(A),y):s},y.touchable=function(A){return arguments.length?(a=typeof A=="function"?A:cc(!!A),y):a},y.on=function(){var A=c.on.apply(c,arguments);return A===c?y:A},y.clickDistance=function(A){return arguments.length?(g=(A=+A)*A,y):Math.sqrt(g)},y}function Lh(t,n,s){t.prototype=n.prototype=s,s.constructor=t}function Jv(t,n){var s=Object.create(t.prototype);for(var a in n)s[a]=n[a];return s}function Do(){}var go=.7,Bc=1/go,Rl="\\s*([+-]?\\d+)\\s*",yo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$n="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",B2=/^#([0-9a-f]{3,8})$/,H2=new RegExp(`^rgb\\(${Rl},${Rl},${Rl}\\)$`),$2=new RegExp(`^rgb\\(${$n},${$n},${$n}\\)$`),U2=new RegExp(`^rgba\\(${Rl},${Rl},${Rl},${yo}\\)$`),q2=new RegExp(`^rgba\\(${$n},${$n},${$n},${yo}\\)$`),V2=new RegExp(`^hsl\\(${yo},${$n},${$n}\\)$`),Y2=new RegExp(`^hsla\\(${yo},${$n},${$n},${yo}\\)$`),r0={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};Lh(Do,zs,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:c0,formatHex:c0,formatHex8:G2,formatHsl:I2,formatRgb:u0,toString:u0});function c0(){return this.rgb().formatHex()}function G2(){return this.rgb().formatHex8()}function I2(){return Wv(this).formatHsl()}function u0(){return this.rgb().formatRgb()}function zs(t){var n,s;return t=(t+"").trim().toLowerCase(),(n=B2.exec(t))?(s=n[1].length,n=parseInt(n[1],16),s===6?f0(n):s===3?new Qt(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):s===8?uc(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):s===4?uc(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=H2.exec(t))?new Qt(n[1],n[2],n[3],1):(n=$2.exec(t))?new Qt(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=U2.exec(t))?uc(n[1],n[2],n[3],n[4]):(n=q2.exec(t))?uc(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=V2.exec(t))?m0(n[1],n[2]/100,n[3]/100,1):(n=Y2.exec(t))?m0(n[1],n[2]/100,n[3]/100,n[4]):r0.hasOwnProperty(t)?f0(r0[t]):t==="transparent"?new Qt(NaN,NaN,NaN,0):null}function f0(t){return new Qt(t>>16&255,t>>8&255,t&255,1)}function uc(t,n,s,a){return a<=0&&(t=n=s=NaN),new Qt(t,n,s,a)}function X2(t){return t instanceof Do||(t=zs(t)),t?(t=t.rgb(),new Qt(t.r,t.g,t.b,t.opacity)):new Qt}function fh(t,n,s,a){return arguments.length===1?X2(t):new Qt(t,n,s,a??1)}function Qt(t,n,s,a){this.r=+t,this.g=+n,this.b=+s,this.opacity=+a}Lh(Qt,fh,Jv(Do,{brighter(t){return t=t==null?Bc:Math.pow(Bc,t),new Qt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?go:Math.pow(go,t),new Qt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Qt(Cs(this.r),Cs(this.g),Cs(this.b),Hc(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:d0,formatHex:d0,formatHex8:K2,formatRgb:h0,toString:h0}));function d0(){return`#${_s(this.r)}${_s(this.g)}${_s(this.b)}`}function K2(){return`#${_s(this.r)}${_s(this.g)}${_s(this.b)}${_s((isNaN(this.opacity)?1:this.opacity)*255)}`}function h0(){const t=Hc(this.opacity);return`${t===1?"rgb(":"rgba("}${Cs(this.r)}, ${Cs(this.g)}, ${Cs(this.b)}${t===1?")":`, ${t})`}`}function Hc(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Cs(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function _s(t){return t=Cs(t),(t<16?"0":"")+t.toString(16)}function m0(t,n,s,a){return a<=0?t=n=s=NaN:s<=0||s>=1?t=n=NaN:n<=0&&(t=NaN),new Tn(t,n,s,a)}function Wv(t){if(t instanceof Tn)return new Tn(t.h,t.s,t.l,t.opacity);if(t instanceof Do||(t=zs(t)),!t)return new Tn;if(t instanceof Tn)return t;t=t.rgb();var n=t.r/255,s=t.g/255,a=t.b/255,o=Math.min(n,s,a),c=Math.max(n,s,a),u=NaN,d=c-o,h=(c+o)/2;return d?(n===c?u=(s-a)/d+(s<a)*6:s===c?u=(a-n)/d+2:u=(n-s)/d+4,d/=h<.5?c+o:2-c-o,u*=60):d=h>0&&h<1?0:u,new Tn(u,d,h,t.opacity)}function Z2(t,n,s,a){return arguments.length===1?Wv(t):new Tn(t,n,s,a??1)}function Tn(t,n,s,a){this.h=+t,this.s=+n,this.l=+s,this.opacity=+a}Lh(Tn,Z2,Jv(Do,{brighter(t){return t=t==null?Bc:Math.pow(Bc,t),new Tn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?go:Math.pow(go,t),new Tn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,n=isNaN(t)||isNaN(this.s)?0:this.s,s=this.l,a=s+(s<.5?s:1-s)*n,o=2*s-a;return new Qt(Vd(t>=240?t-240:t+120,o,a),Vd(t,o,a),Vd(t<120?t+240:t-120,o,a),this.opacity)},clamp(){return new Tn(p0(this.h),fc(this.s),fc(this.l),Hc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Hc(this.opacity);return`${t===1?"hsl(":"hsla("}${p0(this.h)}, ${fc(this.s)*100}%, ${fc(this.l)*100}%${t===1?")":`, ${t})`}`}}));function p0(t){return t=(t||0)%360,t<0?t+360:t}function fc(t){return Math.max(0,Math.min(1,t||0))}function Vd(t,n,s){return(t<60?n+(s-n)*t/60:t<180?s:t<240?n+(s-n)*(240-t)/60:n)*255}const Bh=t=>()=>t;function Q2(t,n){return function(s){return t+s*n}}function F2(t,n,s){return t=Math.pow(t,s),n=Math.pow(n,s)-t,s=1/s,function(a){return Math.pow(t+a*n,s)}}function J2(t){return(t=+t)==1?Pv:function(n,s){return s-n?F2(n,s,t):Bh(isNaN(n)?s:n)}}function Pv(t,n){var s=n-t;return s?Q2(t,s):Bh(isNaN(t)?n:t)}const $c=(function t(n){var s=J2(n);function a(o,c){var u=s((o=fh(o)).r,(c=fh(c)).r),d=s(o.g,c.g),h=s(o.b,c.b),p=Pv(o.opacity,c.opacity);return function(v){return o.r=u(v),o.g=d(v),o.b=h(v),o.opacity=p(v),o+""}}return a.gamma=t,a})(1);function W2(t,n){n||(n=[]);var s=t?Math.min(n.length,t.length):0,a=n.slice(),o;return function(c){for(o=0;o<s;++o)a[o]=t[o]*(1-c)+n[o]*c;return a}}function P2(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function eN(t,n){var s=n?n.length:0,a=t?Math.min(s,t.length):0,o=new Array(a),c=new Array(s),u;for(u=0;u<a;++u)o[u]=fo(t[u],n[u]);for(;u<s;++u)c[u]=n[u];return function(d){for(u=0;u<a;++u)c[u]=o[u](d);return c}}function tN(t,n){var s=new Date;return t=+t,n=+n,function(a){return s.setTime(t*(1-a)+n*a),s}}function Hn(t,n){return t=+t,n=+n,function(s){return t*(1-s)+n*s}}function nN(t,n){var s={},a={},o;(t===null||typeof t!="object")&&(t={}),(n===null||typeof n!="object")&&(n={});for(o in n)o in t?s[o]=fo(t[o],n[o]):a[o]=n[o];return function(c){for(o in s)a[o]=s[o](c);return a}}var dh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yd=new RegExp(dh.source,"g");function iN(t){return function(){return t}}function sN(t){return function(n){return t(n)+""}}function eb(t,n){var s=dh.lastIndex=Yd.lastIndex=0,a,o,c,u=-1,d=[],h=[];for(t=t+"",n=n+"";(a=dh.exec(t))&&(o=Yd.exec(n));)(c=o.index)>s&&(c=n.slice(s,c),d[u]?d[u]+=c:d[++u]=c),(a=a[0])===(o=o[0])?d[u]?d[u]+=o:d[++u]=o:(d[++u]=null,h.push({i:u,x:Hn(a,o)})),s=Yd.lastIndex;return s<n.length&&(c=n.slice(s),d[u]?d[u]+=c:d[++u]=c),d.length<2?h[0]?sN(h[0].x):iN(n):(n=h.length,function(p){for(var v=0,g;v<n;++v)d[(g=h[v]).i]=g.x(p);return d.join("")})}function fo(t,n){var s=typeof n,a;return n==null||s==="boolean"?Bh(n):(s==="number"?Hn:s==="string"?(a=zs(n))?(n=a,$c):eb:n instanceof zs?$c:n instanceof Date?tN:P2(n)?W2:Array.isArray(n)?eN:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?nN:Hn)(t,n)}var g0=180/Math.PI,hh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tb(t,n,s,a,o,c){var u,d,h;return(u=Math.sqrt(t*t+n*n))&&(t/=u,n/=u),(h=t*s+n*a)&&(s-=t*h,a-=n*h),(d=Math.sqrt(s*s+a*a))&&(s/=d,a/=d,h/=d),t*a<n*s&&(t=-t,n=-n,h=-h,u=-u),{translateX:o,translateY:c,rotate:Math.atan2(n,t)*g0,skewX:Math.atan(h)*g0,scaleX:u,scaleY:d}}var dc;function lN(t){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?hh:tb(n.a,n.b,n.c,n.d,n.e,n.f)}function aN(t){return t==null||(dc||(dc=document.createElementNS("http://www.w3.org/2000/svg","g")),dc.setAttribute("transform",t),!(t=dc.transform.baseVal.consolidate()))?hh:(t=t.matrix,tb(t.a,t.b,t.c,t.d,t.e,t.f))}function nb(t,n,s,a){function o(p){return p.length?p.pop()+" ":""}function c(p,v,g,y,S,w){if(p!==g||v!==y){var E=S.push("translate(",null,n,null,s);w.push({i:E-4,x:Hn(p,g)},{i:E-2,x:Hn(v,y)})}else(g||y)&&S.push("translate("+g+n+y+s)}function u(p,v,g,y){p!==v?(p-v>180?v+=360:v-p>180&&(p+=360),y.push({i:g.push(o(g)+"rotate(",null,a)-2,x:Hn(p,v)})):v&&g.push(o(g)+"rotate("+v+a)}function d(p,v,g,y){p!==v?y.push({i:g.push(o(g)+"skewX(",null,a)-2,x:Hn(p,v)}):v&&g.push(o(g)+"skewX("+v+a)}function h(p,v,g,y,S,w){if(p!==g||v!==y){var E=S.push(o(S)+"scale(",null,",",null,")");w.push({i:E-4,x:Hn(p,g)},{i:E-2,x:Hn(v,y)})}else(g!==1||y!==1)&&S.push(o(S)+"scale("+g+","+y+")")}return function(p,v){var g=[],y=[];return p=t(p),v=t(v),c(p.translateX,p.translateY,v.translateX,v.translateY,g,y),u(p.rotate,v.rotate,g,y),d(p.skewX,v.skewX,g,y),h(p.scaleX,p.scaleY,v.scaleX,v.scaleY,g,y),p=v=null,function(S){for(var w=-1,E=y.length,N;++w<E;)g[(N=y[w]).i]=N.x(S);return g.join("")}}}var oN=nb(lN,"px, ","px)","deg)"),rN=nb(aN,", ",")",")"),cN=1e-12;function y0(t){return((t=Math.exp(t))+1/t)/2}function uN(t){return((t=Math.exp(t))-1/t)/2}function fN(t){return((t=Math.exp(2*t))-1)/(t+1)}const _c=(function t(n,s,a){function o(c,u){var d=c[0],h=c[1],p=c[2],v=u[0],g=u[1],y=u[2],S=v-d,w=g-h,E=S*S+w*w,N,C;if(E<cN)C=Math.log(y/p)/n,N=function(k){return[d+k*S,h+k*w,p*Math.exp(n*k*C)]};else{var j=Math.sqrt(E),_=(y*y-p*p+a*E)/(2*p*s*j),A=(y*y-p*p-a*E)/(2*y*s*j),T=Math.log(Math.sqrt(_*_+1)-_),M=Math.log(Math.sqrt(A*A+1)-A);C=(M-T)/n,N=function(k){var R=k*C,U=y0(T),te=p/(s*j)*(U*fN(n*R+T)-uN(T));return[d+te*S,h+te*w,p*U/y0(n*R+T)]}}return N.duration=C*1e3*n/Math.SQRT2,N}return o.rho=function(c){var u=Math.max(.001,+c),d=u*u,h=d*d;return t(u,d,h)},o})(Math.SQRT2,2,4);var Vl=0,ro=0,lo=0,ib=1e3,Uc,co,qc=0,Ds=0,eu=0,vo=typeof performance=="object"&&performance.now?performance:Date,sb=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Hh(){return Ds||(sb(dN),Ds=vo.now()+eu)}function dN(){Ds=0}function Vc(){this._call=this._time=this._next=null}Vc.prototype=lb.prototype={constructor:Vc,restart:function(t,n,s){if(typeof t!="function")throw new TypeError("callback is not a function");s=(s==null?Hh():+s)+(n==null?0:+n),!this._next&&co!==this&&(co?co._next=this:Uc=this,co=this),this._call=t,this._time=s,mh()},stop:function(){this._call&&(this._call=null,this._time=1/0,mh())}};function lb(t,n,s){var a=new Vc;return a.restart(t,n,s),a}function hN(){Hh(),++Vl;for(var t=Uc,n;t;)(n=Ds-t._time)>=0&&t._call.call(void 0,n),t=t._next;--Vl}function v0(){Ds=(qc=vo.now())+eu,Vl=ro=0;try{hN()}finally{Vl=0,pN(),Ds=0}}function mN(){var t=vo.now(),n=t-qc;n>ib&&(eu-=n,qc=t)}function pN(){for(var t,n=Uc,s,a=1/0;n;)n._call?(a>n._time&&(a=n._time),t=n,n=n._next):(s=n._next,n._next=null,n=t?t._next=s:Uc=s);co=t,mh(a)}function mh(t){if(!Vl){ro&&(ro=clearTimeout(ro));var n=t-Ds;n>24?(t<1/0&&(ro=setTimeout(v0,t-vo.now()-eu)),lo&&(lo=clearInterval(lo))):(lo||(qc=vo.now(),lo=setInterval(mN,ib)),Vl=1,sb(v0))}}function b0(t,n,s){var a=new Vc;return n=n==null?0:+n,a.restart(o=>{a.stop(),t(o+n)},n,s),a}var gN=Wc("start","end","cancel","interrupt"),yN=[],ab=0,S0=1,ph=2,Ac=3,w0=4,gh=5,Tc=6;function tu(t,n,s,a,o,c){var u=t.__transition;if(!u)t.__transition={};else if(s in u)return;vN(t,s,{name:n,index:a,group:o,on:gN,tween:yN,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:ab})}function $h(t,n){var s=zn(t,n);if(s.state>ab)throw new Error("too late; already scheduled");return s}function Vn(t,n){var s=zn(t,n);if(s.state>Ac)throw new Error("too late; already running");return s}function zn(t,n){var s=t.__transition;if(!s||!(s=s[n]))throw new Error("transition not found");return s}function vN(t,n,s){var a=t.__transition,o;a[n]=s,s.timer=lb(c,0,s.time);function c(p){s.state=S0,s.timer.restart(u,s.delay,s.time),s.delay<=p&&u(p-s.delay)}function u(p){var v,g,y,S;if(s.state!==S0)return h();for(v in a)if(S=a[v],S.name===s.name){if(S.state===Ac)return b0(u);S.state===w0?(S.state=Tc,S.timer.stop(),S.on.call("interrupt",t,t.__data__,S.index,S.group),delete a[v]):+v<n&&(S.state=Tc,S.timer.stop(),S.on.call("cancel",t,t.__data__,S.index,S.group),delete a[v])}if(b0(function(){s.state===Ac&&(s.state=w0,s.timer.restart(d,s.delay,s.time),d(p))}),s.state=ph,s.on.call("start",t,t.__data__,s.index,s.group),s.state===ph){for(s.state=Ac,o=new Array(y=s.tween.length),v=0,g=-1;v<y;++v)(S=s.tween[v].value.call(t,t.__data__,s.index,s.group))&&(o[++g]=S);o.length=g+1}}function d(p){for(var v=p<s.duration?s.ease.call(null,p/s.duration):(s.timer.restart(h),s.state=gh,1),g=-1,y=o.length;++g<y;)o[g].call(t,v);s.state===gh&&(s.on.call("end",t,t.__data__,s.index,s.group),h())}function h(){s.state=Tc,s.timer.stop(),delete a[n];for(var p in a)return;delete t.__transition}}function Mc(t,n){var s=t.__transition,a,o,c=!0,u;if(s){n=n==null?null:n+"";for(u in s){if((a=s[u]).name!==n){c=!1;continue}o=a.state>ph&&a.state<gh,a.state=Tc,a.timer.stop(),a.on.call(o?"interrupt":"cancel",t,t.__data__,a.index,a.group),delete s[u]}c&&delete t.__transition}}function bN(t){return this.each(function(){Mc(this,t)})}function SN(t,n){var s,a;return function(){var o=Vn(this,t),c=o.tween;if(c!==s){a=s=c;for(var u=0,d=a.length;u<d;++u)if(a[u].name===n){a=a.slice(),a.splice(u,1);break}}o.tween=a}}function wN(t,n,s){var a,o;if(typeof s!="function")throw new Error;return function(){var c=Vn(this,t),u=c.tween;if(u!==a){o=(a=u).slice();for(var d={name:n,value:s},h=0,p=o.length;h<p;++h)if(o[h].name===n){o[h]=d;break}h===p&&o.push(d)}c.tween=o}}function xN(t,n){var s=this._id;if(t+="",arguments.length<2){for(var a=zn(this.node(),s).tween,o=0,c=a.length,u;o<c;++o)if((u=a[o]).name===t)return u.value;return null}return this.each((n==null?SN:wN)(s,t,n))}function Uh(t,n,s){var a=t._id;return t.each(function(){var o=Vn(this,a);(o.value||(o.value={}))[n]=s.apply(this,arguments)}),function(o){return zn(o,a).value[n]}}function ob(t,n){var s;return(typeof n=="number"?Hn:n instanceof zs?$c:(s=zs(n))?(n=s,$c):eb)(t,n)}function EN(t){return function(){this.removeAttribute(t)}}function NN(t){return function(){this.removeAttributeNS(t.space,t.local)}}function _N(t,n,s){var a,o=s+"",c;return function(){var u=this.getAttribute(t);return u===o?null:u===a?c:c=n(a=u,s)}}function AN(t,n,s){var a,o=s+"",c;return function(){var u=this.getAttributeNS(t.space,t.local);return u===o?null:u===a?c:c=n(a=u,s)}}function TN(t,n,s){var a,o,c;return function(){var u,d=s(this),h;return d==null?void this.removeAttribute(t):(u=this.getAttribute(t),h=d+"",u===h?null:u===a&&h===o?c:(o=h,c=n(a=u,d)))}}function MN(t,n,s){var a,o,c;return function(){var u,d=s(this),h;return d==null?void this.removeAttributeNS(t.space,t.local):(u=this.getAttributeNS(t.space,t.local),h=d+"",u===h?null:u===a&&h===o?c:(o=h,c=n(a=u,d)))}}function CN(t,n){var s=Pc(t),a=s==="transform"?rN:ob;return this.attrTween(t,typeof n=="function"?(s.local?MN:TN)(s,a,Uh(this,"attr."+t,n)):n==null?(s.local?NN:EN)(s):(s.local?AN:_N)(s,a,n))}function ON(t,n){return function(s){this.setAttribute(t,n.call(this,s))}}function zN(t,n){return function(s){this.setAttributeNS(t.space,t.local,n.call(this,s))}}function DN(t,n){var s,a;function o(){var c=n.apply(this,arguments);return c!==a&&(s=(a=c)&&zN(t,c)),s}return o._value=n,o}function kN(t,n){var s,a;function o(){var c=n.apply(this,arguments);return c!==a&&(s=(a=c)&&ON(t,c)),s}return o._value=n,o}function jN(t,n){var s="attr."+t;if(arguments.length<2)return(s=this.tween(s))&&s._value;if(n==null)return this.tween(s,null);if(typeof n!="function")throw new Error;var a=Pc(t);return this.tween(s,(a.local?DN:kN)(a,n))}function RN(t,n){return function(){$h(this,t).delay=+n.apply(this,arguments)}}function LN(t,n){return n=+n,function(){$h(this,t).delay=n}}function BN(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?RN:LN)(n,t)):zn(this.node(),n).delay}function HN(t,n){return function(){Vn(this,t).duration=+n.apply(this,arguments)}}function $N(t,n){return n=+n,function(){Vn(this,t).duration=n}}function UN(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?HN:$N)(n,t)):zn(this.node(),n).duration}function qN(t,n){if(typeof n!="function")throw new Error;return function(){Vn(this,t).ease=n}}function VN(t){var n=this._id;return arguments.length?this.each(qN(n,t)):zn(this.node(),n).ease}function YN(t,n){return function(){var s=n.apply(this,arguments);if(typeof s!="function")throw new Error;Vn(this,t).ease=s}}function GN(t){if(typeof t!="function")throw new Error;return this.each(YN(this._id,t))}function IN(t){typeof t!="function"&&(t=Hv(t));for(var n=this._groups,s=n.length,a=new Array(s),o=0;o<s;++o)for(var c=n[o],u=c.length,d=a[o]=[],h,p=0;p<u;++p)(h=c[p])&&t.call(h,h.__data__,p,c)&&d.push(h);return new gi(a,this._parents,this._name,this._id)}function XN(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,s=t._groups,a=n.length,o=s.length,c=Math.min(a,o),u=new Array(a),d=0;d<c;++d)for(var h=n[d],p=s[d],v=h.length,g=u[d]=new Array(v),y,S=0;S<v;++S)(y=h[S]||p[S])&&(g[S]=y);for(;d<a;++d)u[d]=n[d];return new gi(u,this._parents,this._name,this._id)}function KN(t){return(t+"").trim().split(/^|\s+/).every(function(n){var s=n.indexOf(".");return s>=0&&(n=n.slice(0,s)),!n||n==="start"})}function ZN(t,n,s){var a,o,c=KN(n)?$h:Vn;return function(){var u=c(this,t),d=u.on;d!==a&&(o=(a=d).copy()).on(n,s),u.on=o}}function QN(t,n){var s=this._id;return arguments.length<2?zn(this.node(),s).on.on(t):this.each(ZN(s,t,n))}function FN(t){return function(){var n=this.parentNode;for(var s in this.__transition)if(+s!==t)return;n&&n.removeChild(this)}}function JN(){return this.on("end.remove",FN(this._id))}function WN(t){var n=this._name,s=this._id;typeof t!="function"&&(t=jh(t));for(var a=this._groups,o=a.length,c=new Array(o),u=0;u<o;++u)for(var d=a[u],h=d.length,p=c[u]=new Array(h),v,g,y=0;y<h;++y)(v=d[y])&&(g=t.call(v,v.__data__,y,d))&&("__data__"in v&&(g.__data__=v.__data__),p[y]=g,tu(p[y],n,s,y,p,zn(v,s)));return new gi(c,this._parents,n,s)}function PN(t){var n=this._name,s=this._id;typeof t!="function"&&(t=Bv(t));for(var a=this._groups,o=a.length,c=[],u=[],d=0;d<o;++d)for(var h=a[d],p=h.length,v,g=0;g<p;++g)if(v=h[g]){for(var y=t.call(v,v.__data__,g,h),S,w=zn(v,s),E=0,N=y.length;E<N;++E)(S=y[E])&&tu(S,n,s,E,y,w);c.push(y),u.push(v)}return new gi(c,u,n,s)}var e_=zo.prototype.constructor;function t_(){return new e_(this._groups,this._parents)}function n_(t,n){var s,a,o;return function(){var c=ql(this,t),u=(this.style.removeProperty(t),ql(this,t));return c===u?null:c===s&&u===a?o:o=n(s=c,a=u)}}function rb(t){return function(){this.style.removeProperty(t)}}function i_(t,n,s){var a,o=s+"",c;return function(){var u=ql(this,t);return u===o?null:u===a?c:c=n(a=u,s)}}function s_(t,n,s){var a,o,c;return function(){var u=ql(this,t),d=s(this),h=d+"";return d==null&&(h=d=(this.style.removeProperty(t),ql(this,t))),u===h?null:u===a&&h===o?c:(o=h,c=n(a=u,d))}}function l_(t,n){var s,a,o,c="style."+n,u="end."+c,d;return function(){var h=Vn(this,t),p=h.on,v=h.value[c]==null?d||(d=rb(n)):void 0;(p!==s||o!==v)&&(a=(s=p).copy()).on(u,o=v),h.on=a}}function a_(t,n,s){var a=(t+="")=="transform"?oN:ob;return n==null?this.styleTween(t,n_(t,a)).on("end.style."+t,rb(t)):typeof n=="function"?this.styleTween(t,s_(t,a,Uh(this,"style."+t,n))).each(l_(this._id,t)):this.styleTween(t,i_(t,a,n),s).on("end.style."+t,null)}function o_(t,n,s){return function(a){this.style.setProperty(t,n.call(this,a),s)}}function r_(t,n,s){var a,o;function c(){var u=n.apply(this,arguments);return u!==o&&(a=(o=u)&&o_(t,u,s)),a}return c._value=n,c}function c_(t,n,s){var a="style."+(t+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(n==null)return this.tween(a,null);if(typeof n!="function")throw new Error;return this.tween(a,r_(t,n,s??""))}function u_(t){return function(){this.textContent=t}}function f_(t){return function(){var n=t(this);this.textContent=n??""}}function d_(t){return this.tween("text",typeof t=="function"?f_(Uh(this,"text",t)):u_(t==null?"":t+""))}function h_(t){return function(n){this.textContent=t.call(this,n)}}function m_(t){var n,s;function a(){var o=t.apply(this,arguments);return o!==s&&(n=(s=o)&&h_(o)),n}return a._value=t,a}function p_(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,m_(t))}function g_(){for(var t=this._name,n=this._id,s=cb(),a=this._groups,o=a.length,c=0;c<o;++c)for(var u=a[c],d=u.length,h,p=0;p<d;++p)if(h=u[p]){var v=zn(h,n);tu(h,t,s,p,u,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new gi(a,this._parents,t,s)}function y_(){var t,n,s=this,a=s._id,o=s.size();return new Promise(function(c,u){var d={value:u},h={value:function(){--o===0&&c()}};s.each(function(){var p=Vn(this,a),v=p.on;v!==t&&(n=(t=v).copy(),n._.cancel.push(d),n._.interrupt.push(d),n._.end.push(h)),p.on=n}),o===0&&c()})}var v_=0;function gi(t,n,s,a){this._groups=t,this._parents=n,this._name=s,this._id=a}function cb(){return++v_}var fi=zo.prototype;gi.prototype={constructor:gi,select:WN,selectAll:PN,selectChild:fi.selectChild,selectChildren:fi.selectChildren,filter:IN,merge:XN,selection:t_,transition:g_,call:fi.call,nodes:fi.nodes,node:fi.node,size:fi.size,empty:fi.empty,each:fi.each,on:QN,attr:CN,attrTween:jN,style:a_,styleTween:c_,text:d_,textTween:p_,remove:JN,tween:xN,delay:BN,duration:UN,ease:VN,easeVarying:GN,end:y_,[Symbol.iterator]:fi[Symbol.iterator]};function b_(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var S_={time:null,delay:0,duration:250,ease:b_};function w_(t,n){for(var s;!(s=t.__transition)||!(s=s[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return s}function x_(t){var n,s;t instanceof gi?(n=t._id,t=t._name):(n=cb(),(s=S_).time=Hh(),t=t==null?null:t+"");for(var a=this._groups,o=a.length,c=0;c<o;++c)for(var u=a[c],d=u.length,h,p=0;p<d;++p)(h=u[p])&&tu(h,t,n,p,u,s||w_(h,n));return new gi(a,this._parents,t,n)}zo.prototype.interrupt=bN;zo.prototype.transition=x_;const hc=t=>()=>t;function E_(t,{sourceEvent:n,target:s,transform:a,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:o}})}function hi(t,n,s){this.k=t,this.x=n,this.y=s}hi.prototype={constructor:hi,scale:function(t){return t===1?this:new hi(this.k*t,this.x,this.y)},translate:function(t,n){return t===0&n===0?this:new hi(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var nu=new hi(1,0,0);ub.prototype=hi.prototype;function ub(t){for(;!t.__zoom;)if(!(t=t.parentNode))return nu;return t.__zoom}function Gd(t){t.stopImmediatePropagation()}function ao(t){t.preventDefault(),t.stopImmediatePropagation()}function N_(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function __(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function x0(){return this.__zoom||nu}function A_(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function T_(){return navigator.maxTouchPoints||"ontouchstart"in this}function M_(t,n,s){var a=t.invertX(n[0][0])-s[0][0],o=t.invertX(n[1][0])-s[1][0],c=t.invertY(n[0][1])-s[0][1],u=t.invertY(n[1][1])-s[1][1];return t.translate(o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o),u>c?(c+u)/2:Math.min(0,c)||Math.max(0,u))}function fb(){var t=N_,n=__,s=M_,a=A_,o=T_,c=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],d=250,h=_c,p=Wc("start","zoom","end"),v,g,y,S=500,w=150,E=0,N=10;function C(L){L.property("__zoom",x0).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",te).filter(o).on("touchstart.zoom",Y).on("touchmove.zoom",X).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(L,G,z,B){var I=L.selection?L.selection():L;I.property("__zoom",x0),L!==I?T(L,G,z,B):I.interrupt().each(function(){M(this,arguments).event(B).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},C.scaleBy=function(L,G,z,B){C.scaleTo(L,function(){var I=this.__zoom.k,Q=typeof G=="function"?G.apply(this,arguments):G;return I*Q},z,B)},C.scaleTo=function(L,G,z,B){C.transform(L,function(){var I=n.apply(this,arguments),Q=this.__zoom,se=z==null?A(I):typeof z=="function"?z.apply(this,arguments):z,D=Q.invert(se),$=typeof G=="function"?G.apply(this,arguments):G;return s(_(j(Q,$),se,D),I,u)},z,B)},C.translateBy=function(L,G,z,B){C.transform(L,function(){return s(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof z=="function"?z.apply(this,arguments):z),n.apply(this,arguments),u)},null,B)},C.translateTo=function(L,G,z,B,I){C.transform(L,function(){var Q=n.apply(this,arguments),se=this.__zoom,D=B==null?A(Q):typeof B=="function"?B.apply(this,arguments):B;return s(nu.translate(D[0],D[1]).scale(se.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof z=="function"?-z.apply(this,arguments):-z),Q,u)},B,I)};function j(L,G){return G=Math.max(c[0],Math.min(c[1],G)),G===L.k?L:new hi(G,L.x,L.y)}function _(L,G,z){var B=G[0]-z[0]*L.k,I=G[1]-z[1]*L.k;return B===L.x&&I===L.y?L:new hi(L.k,B,I)}function A(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function T(L,G,z,B){L.on("start.zoom",function(){M(this,arguments).event(B).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(B).end()}).tween("zoom",function(){var I=this,Q=arguments,se=M(I,Q).event(B),D=n.apply(I,Q),$=z==null?A(D):typeof z=="function"?z.apply(I,Q):z,ne=Math.max(D[1][0]-D[0][0],D[1][1]-D[0][1]),ie=I.__zoom,ce=typeof G=="function"?G.apply(I,Q):G,he=h(ie.invert($).concat(ne/ie.k),ce.invert($).concat(ne/ce.k));return function(fe){if(fe===1)fe=ce;else{var K=he(fe),ue=ne/K[2];fe=new hi(ue,$[0]-K[0]*ue,$[1]-K[1]*ue)}se.zoom(null,fe)}})}function M(L,G,z){return!z&&L.__zooming||new k(L,G)}function k(L,G){this.that=L,this.args=G,this.active=0,this.sourceEvent=null,this.extent=n.apply(L,G),this.taps=0}k.prototype={event:function(L){return L&&(this.sourceEvent=L),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(L,G){return this.mouse&&L!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var G=sn(this.that).datum();p.call(L,this.that,new E_(L,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:p}),G)}};function R(L,...G){if(!t.apply(this,arguments))return;var z=M(this,G).event(L),B=this.__zoom,I=Math.max(c[0],Math.min(c[1],B.k*Math.pow(2,a.apply(this,arguments)))),Q=An(L);if(z.wheel)(z.mouse[0][0]!==Q[0]||z.mouse[0][1]!==Q[1])&&(z.mouse[1]=B.invert(z.mouse[0]=Q)),clearTimeout(z.wheel);else{if(B.k===I)return;z.mouse=[Q,B.invert(Q)],Mc(this),z.start()}ao(L),z.wheel=setTimeout(se,w),z.zoom("mouse",s(_(j(B,I),z.mouse[0],z.mouse[1]),z.extent,u));function se(){z.wheel=null,z.end()}}function U(L,...G){if(y||!t.apply(this,arguments))return;var z=L.currentTarget,B=M(this,G,!0).event(L),I=sn(L.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",ne,!0),Q=An(L,z),se=L.clientX,D=L.clientY;Zv(L.view),Gd(L),B.mouse=[Q,this.__zoom.invert(Q)],Mc(this),B.start();function $(ie){if(ao(ie),!B.moved){var ce=ie.clientX-se,he=ie.clientY-D;B.moved=ce*ce+he*he>E}B.event(ie).zoom("mouse",s(_(B.that.__zoom,B.mouse[0]=An(ie,z),B.mouse[1]),B.extent,u))}function ne(ie){I.on("mousemove.zoom mouseup.zoom",null),Qv(ie.view,B.moved),ao(ie),B.event(ie).end()}}function te(L,...G){if(t.apply(this,arguments)){var z=this.__zoom,B=An(L.changedTouches?L.changedTouches[0]:L,this),I=z.invert(B),Q=z.k*(L.shiftKey?.5:2),se=s(_(j(z,Q),B,I),n.apply(this,G),u);ao(L),d>0?sn(this).transition().duration(d).call(T,se,B,L):sn(this).call(C.transform,se,B,L)}}function Y(L,...G){if(t.apply(this,arguments)){var z=L.touches,B=z.length,I=M(this,G,L.changedTouches.length===B).event(L),Q,se,D,$;for(Gd(L),se=0;se<B;++se)D=z[se],$=An(D,this),$=[$,this.__zoom.invert($),D.identifier],I.touch0?!I.touch1&&I.touch0[2]!==$[2]&&(I.touch1=$,I.taps=0):(I.touch0=$,Q=!0,I.taps=1+!!v);v&&(v=clearTimeout(v)),Q&&(I.taps<2&&(g=$[0],v=setTimeout(function(){v=null},S)),Mc(this),I.start())}}function X(L,...G){if(this.__zooming){var z=M(this,G).event(L),B=L.changedTouches,I=B.length,Q,se,D,$;for(ao(L),Q=0;Q<I;++Q)se=B[Q],D=An(se,this),z.touch0&&z.touch0[2]===se.identifier?z.touch0[0]=D:z.touch1&&z.touch1[2]===se.identifier&&(z.touch1[0]=D);if(se=z.that.__zoom,z.touch1){var ne=z.touch0[0],ie=z.touch0[1],ce=z.touch1[0],he=z.touch1[1],fe=(fe=ce[0]-ne[0])*fe+(fe=ce[1]-ne[1])*fe,K=(K=he[0]-ie[0])*K+(K=he[1]-ie[1])*K;se=j(se,Math.sqrt(fe/K)),D=[(ne[0]+ce[0])/2,(ne[1]+ce[1])/2],$=[(ie[0]+he[0])/2,(ie[1]+he[1])/2]}else if(z.touch0)D=z.touch0[0],$=z.touch0[1];else return;z.zoom("touch",s(_(se,D,$),z.extent,u))}}function W(L,...G){if(this.__zooming){var z=M(this,G).event(L),B=L.changedTouches,I=B.length,Q,se;for(Gd(L),y&&clearTimeout(y),y=setTimeout(function(){y=null},S),Q=0;Q<I;++Q)se=B[Q],z.touch0&&z.touch0[2]===se.identifier?delete z.touch0:z.touch1&&z.touch1[2]===se.identifier&&delete z.touch1;if(z.touch1&&!z.touch0&&(z.touch0=z.touch1,delete z.touch1),z.touch0)z.touch0[1]=this.__zoom.invert(z.touch0[0]);else if(z.end(),z.taps===2&&(se=An(se,this),Math.hypot(g[0]-se[0],g[1]-se[1])<N)){var D=sn(this).on("dblclick.zoom");D&&D.apply(this,arguments)}}}return C.wheelDelta=function(L){return arguments.length?(a=typeof L=="function"?L:hc(+L),C):a},C.filter=function(L){return arguments.length?(t=typeof L=="function"?L:hc(!!L),C):t},C.touchable=function(L){return arguments.length?(o=typeof L=="function"?L:hc(!!L),C):o},C.extent=function(L){return arguments.length?(n=typeof L=="function"?L:hc([[+L[0][0],+L[0][1]],[+L[1][0],+L[1][1]]]),C):n},C.scaleExtent=function(L){return arguments.length?(c[0]=+L[0],c[1]=+L[1],C):[c[0],c[1]]},C.translateExtent=function(L){return arguments.length?(u[0][0]=+L[0][0],u[1][0]=+L[1][0],u[0][1]=+L[0][1],u[1][1]=+L[1][1],C):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},C.constrain=function(L){return arguments.length?(s=L,C):s},C.duration=function(L){return arguments.length?(d=+L,C):d},C.interpolate=function(L){return arguments.length?(h=L,C):h},C.on=function(){var L=p.on.apply(p,arguments);return L===p?C:L},C.clickDistance=function(L){return arguments.length?(E=(L=+L)*L,C):Math.sqrt(E)},C.tapDistance=function(L){return arguments.length?(N=+L,C):N},C}const On={error001:(t="react")=>`Seems like you have not used zustand provider as an ancestor. Help: https://${t}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:n,sourceHandle:s,targetHandle:a})=>`Couldn't create edge for ${t} handle id: "${t==="source"?s:a}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:t=>`Edge with id "${t}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},bo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],db=["Enter"," ","Escape"],hb={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:n,y:s})=>`Moved selected node ${t}. New position, x: ${n}, y: ${s}`,"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 Yl;(function(t){t.Strict="strict",t.Loose="loose"})(Yl||(Yl={}));var Os;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Os||(Os={}));var So;(function(t){t.Partial="partial",t.Full="full"})(So||(So={}));const mb={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var es;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(es||(es={}));var wo;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(wo||(wo={}));var me;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(me||(me={}));const E0={[me.Left]:me.Right,[me.Right]:me.Left,[me.Top]:me.Bottom,[me.Bottom]:me.Top};function pb(t){return t===null?null:t?"valid":"invalid"}const gb=t=>"id"in t&&"source"in t&&"target"in t,C_=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),qh=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),ko=(t,n=[0,0])=>{const{width:s,height:a}=yi(t),o=t.origin??n,c=s*o[0],u=a*o[1];return{x:t.position.x-c,y:t.position.y-u}},O_=(t,n={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const s=t.reduce((a,o)=>{const c=typeof o=="string";let u=!n.nodeLookup&&!c?o:void 0;n.nodeLookup&&(u=c?n.nodeLookup.get(o):qh(o)?o:n.nodeLookup.get(o.id));const d=u?Yc(u,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return iu(a,d)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return su(s)},jo=(t,n={})=>{let s={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return t.forEach(o=>{(n.filter===void 0||n.filter(o))&&(s=iu(s,Yc(o)),a=!0)}),a?su(s):{x:0,y:0,width:0,height:0}},Vh=(t,n,[s,a,o]=[0,0,1],c=!1,u=!1)=>{const d={...Fl(n,[s,a,o]),width:n.width/o,height:n.height/o},h=[];for(const p of t.values()){const{measured:v,selectable:g=!0,hidden:y=!1}=p;if(u&&!g||y)continue;const S=v.width??p.width??p.initialWidth??null,w=v.height??p.height??p.initialHeight??null,E=xo(d,Il(p)),N=(S??0)*(w??0),C=c&&E>0;(!p.internals.handleBounds||C||E>=N||p.dragging)&&h.push(p)}return h},z_=(t,n)=>{const s=new Set;return t.forEach(a=>{s.add(a.id)}),n.filter(a=>s.has(a.source)||s.has(a.target))};function D_(t,n){const s=new Map,a=n?.nodes?new Set(n.nodes.map(o=>o.id)):null;return t.forEach(o=>{o.measured.width&&o.measured.height&&(n?.includeHiddenNodes||!o.hidden)&&(!a||a.has(o.id))&&s.set(o.id,o)}),s}async function k_({nodes:t,width:n,height:s,panZoom:a,minZoom:o,maxZoom:c},u){if(t.size===0)return!0;const d=D_(t,u),h=jo(d),p=Gh(h,n,s,u?.minZoom??o,u?.maxZoom??c,u?.padding??.1);return await a.setViewport(p,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),!0}function yb({nodeId:t,nextPosition:n,nodeLookup:s,nodeOrigin:a=[0,0],nodeExtent:o,onError:c}){const u=s.get(t),d=u.parentId?s.get(u.parentId):void 0,{x:h,y:p}=d?d.internals.positionAbsolute:{x:0,y:0},v=u.origin??a;let g=u.extent||o;if(u.extent==="parent"&&!u.expandParent)if(!d)c?.("005",On.error005());else{const S=d.measured.width,w=d.measured.height;S&&w&&(g=[[h,p],[h+S,p+w]])}else d&&js(u.extent)&&(g=[[u.extent[0][0]+h,u.extent[0][1]+p],[u.extent[1][0]+h,u.extent[1][1]+p]]);const y=js(g)?ks(n,g,u.measured):n;return(u.measured.width===void 0||u.measured.height===void 0)&&c?.("015",On.error015()),{position:{x:y.x-h+(u.measured.width??0)*v[0],y:y.y-p+(u.measured.height??0)*v[1]},positionAbsolute:y}}async function j_({nodesToRemove:t=[],edgesToRemove:n=[],nodes:s,edges:a,onBeforeDelete:o}){const c=new Set(t.map(y=>y.id)),u=[];for(const y of s){if(y.deletable===!1)continue;const S=c.has(y.id),w=!S&&y.parentId&&u.find(E=>E.id===y.parentId);(S||w)&&u.push(y)}const d=new Set(n.map(y=>y.id)),h=a.filter(y=>y.deletable!==!1),v=z_(u,h);for(const y of h)d.has(y.id)&&!v.find(w=>w.id===y.id)&&v.push(y);if(!o)return{edges:v,nodes:u};const g=await o({nodes:u,edges:v});return typeof g=="boolean"?g?{edges:v,nodes:u}:{edges:[],nodes:[]}:g}const Gl=(t,n=0,s=1)=>Math.min(Math.max(t,n),s),ks=(t={x:0,y:0},n,s)=>({x:Gl(t.x,n[0][0],n[1][0]-(s?.width??0)),y:Gl(t.y,n[0][1],n[1][1]-(s?.height??0))});function vb(t,n,s){const{width:a,height:o}=yi(s),{x:c,y:u}=s.internals.positionAbsolute;return ks(t,[[c,u],[c+a,u+o]],n)}const N0=(t,n,s)=>t<n?Gl(Math.abs(t-n),1,n)/n:t>s?-Gl(Math.abs(t-s),1,n)/n:0,Yh=(t,n,s=15,a=40)=>{const o=N0(t.x,a,n.width-a)*s,c=N0(t.y,a,n.height-a)*s;return[o,c]},iu=(t,n)=>({x:Math.min(t.x,n.x),y:Math.min(t.y,n.y),x2:Math.max(t.x2,n.x2),y2:Math.max(t.y2,n.y2)}),yh=({x:t,y:n,width:s,height:a})=>({x:t,y:n,x2:t+s,y2:n+a}),su=({x:t,y:n,x2:s,y2:a})=>({x:t,y:n,width:s-t,height:a-n}),Il=(t,n=[0,0])=>{const{x:s,y:a}=qh(t)?t.internals.positionAbsolute:ko(t,n);return{x:s,y:a,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},Yc=(t,n=[0,0])=>{const{x:s,y:a}=qh(t)?t.internals.positionAbsolute:ko(t,n);return{x:s,y:a,x2:s+(t.measured?.width??t.width??t.initialWidth??0),y2:a+(t.measured?.height??t.height??t.initialHeight??0)}},bb=(t,n)=>su(iu(yh(t),yh(n))),xo=(t,n)=>{const s=Math.max(0,Math.min(t.x+t.width,n.x+n.width)-Math.max(t.x,n.x)),a=Math.max(0,Math.min(t.y+t.height,n.y+n.height)-Math.max(t.y,n.y));return Math.ceil(s*a)},_0=t=>Mn(t.width)&&Mn(t.height)&&Mn(t.x)&&Mn(t.y),Mn=t=>!isNaN(t)&&isFinite(t),Sb=(t,n)=>(s,a)=>{},Ro=(t,n=[1,1])=>({x:n[0]*Math.round(t.x/n[0]),y:n[1]*Math.round(t.y/n[1])}),Fl=({x:t,y:n},[s,a,o],c=!1,u=[1,1])=>{const d={x:(t-s)/o,y:(n-a)/o};return c?Ro(d,u):d},Xl=({x:t,y:n},[s,a,o])=>({x:t*o+s,y:n*o+a});function El(t,n){if(typeof t=="number")return Math.floor((n-n/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const s=parseFloat(t);if(!Number.isNaN(s))return Math.floor(s)}if(typeof t=="string"&&t.endsWith("%")){const s=parseFloat(t);if(!Number.isNaN(s))return Math.floor(n*s*.01)}return console.error(`The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function R_(t,n,s){if(typeof t=="string"||typeof t=="number"){const a=El(t,s),o=El(t,n);return{top:a,right:o,bottom:a,left:o,x:o*2,y:a*2}}if(typeof t=="object"){const a=El(t.top??t.y??0,s),o=El(t.bottom??t.y??0,s),c=El(t.left??t.x??0,n),u=El(t.right??t.x??0,n);return{top:a,right:u,bottom:o,left:c,x:c+u,y:a+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function L_(t,n,s,a,o,c){const{x:u,y:d}=Xl(t,[n,s,a]),{x:h,y:p}=Xl({x:t.x+t.width,y:t.y+t.height},[n,s,a]),v=o-h,g=c-p;return{left:Math.floor(u),top:Math.floor(d),right:Math.floor(v),bottom:Math.floor(g)}}const Gh=(t,n,s,a,o,c)=>{const u=R_(c,n,s),d=(n-u.x)/t.width,h=(s-u.y)/t.height,p=Math.min(d,h),v=Gl(p,a,o),g=t.x+t.width/2,y=t.y+t.height/2,S=n/2-g*v,w=s/2-y*v,E=L_(t,S,w,v,n,s),N={left:Math.min(E.left-u.left,0),top:Math.min(E.top-u.top,0),right:Math.min(E.right-u.right,0),bottom:Math.min(E.bottom-u.bottom,0)};return{x:S-N.left+N.right,y:w-N.top+N.bottom,zoom:v}},Eo=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function js(t){return t!=null&&t!=="parent"}function yi(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function wb(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}function xb(t,n={width:0,height:0},s,a,o){const c={...t},u=a.get(s);if(u){const d=u.origin||o;c.x+=u.internals.positionAbsolute.x-(n.width??0)*d[0],c.y+=u.internals.positionAbsolute.y-(n.height??0)*d[1]}return c}function A0(t,n){if(t.size!==n.size)return!1;for(const s of t)if(!n.has(s))return!1;return!0}function B_(){let t,n;return{promise:new Promise((a,o)=>{t=a,n=o}),resolve:t,reject:n}}function H_(t){return{...hb,...t||{}}}function ho(t,{snapGrid:n=[0,0],snapToGrid:s=!1,transform:a,containerBounds:o}){const{x:c,y:u}=Cn(t),d=Fl({x:c-(o?.left??0),y:u-(o?.top??0)},a),{x:h,y:p}=s?Ro(d,n):d;return{xSnapped:h,ySnapped:p,...d}}const Ih=t=>({width:t.offsetWidth,height:t.offsetHeight}),Eb=t=>t?.getRootNode?.()||window?.document,$_=["INPUT","SELECT","TEXTAREA"];function Nb(t){const n=t.composedPath?.()?.[0]||t.target;return n?.nodeType!==1?!1:$_.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const _b=t=>"clientX"in t,Cn=(t,n)=>{const s=_b(t),a=s?t.clientX:t.touches?.[0].clientX,o=s?t.clientY:t.touches?.[0].clientY;return{x:a-(n?.left??0),y:o-(n?.top??0)}},T0=(t,n,s,a,o)=>{const c=n.querySelectorAll(`.${t}`);return!c||!c.length?null:Array.from(c).map(u=>{const d=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:t,nodeId:o,position:u.getAttribute("data-handlepos"),x:(d.left-s.left)/a,y:(d.top-s.top)/a,...Ih(u)}})};function Ab({sourceX:t,sourceY:n,targetX:s,targetY:a,sourceControlX:o,sourceControlY:c,targetControlX:u,targetControlY:d}){const h=t*.125+o*.375+u*.375+s*.125,p=n*.125+c*.375+d*.375+a*.125,v=Math.abs(h-t),g=Math.abs(p-n);return[h,p,v,g]}function mc(t,n){return t>=0?.5*t:n*25*Math.sqrt(-t)}function M0({pos:t,x1:n,y1:s,x2:a,y2:o,c}){switch(t){case me.Left:return[n-mc(n-a,c),s];case me.Right:return[n+mc(a-n,c),s];case me.Top:return[n,s-mc(s-o,c)];case me.Bottom:return[n,s+mc(o-s,c)]}}function Tb({sourceX:t,sourceY:n,sourcePosition:s=me.Bottom,targetX:a,targetY:o,targetPosition:c=me.Top,curvature:u=.25}){const[d,h]=M0({pos:s,x1:t,y1:n,x2:a,y2:o,c:u}),[p,v]=M0({pos:c,x1:a,y1:o,x2:t,y2:n,c:u}),[g,y,S,w]=Ab({sourceX:t,sourceY:n,targetX:a,targetY:o,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:v});return[`M${t},${n} C${d},${h} ${p},${v} ${a},${o}`,g,y,S,w]}function Mb({sourceX:t,sourceY:n,targetX:s,targetY:a}){const o=Math.abs(s-t)/2,c=s<t?s+o:s-o,u=Math.abs(a-n)/2,d=a<n?a+u:a-u;return[c,d,o,u]}function U_({sourceNode:t,targetNode:n,selected:s=!1,zIndex:a=0,elevateOnSelect:o=!1,zIndexMode:c="basic"}){if(c==="manual")return a;const u=o&&s?a+1e3:a,d=Math.max(t.parentId||o&&t.selected?t.internals.z:0,n.parentId||o&&n.selected?n.internals.z:0);return u+d}function q_({sourceNode:t,targetNode:n,width:s,height:a,transform:o}){const c=iu(Yc(t),Yc(n));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u={x:-o[0]/o[2],y:-o[1]/o[2],width:s/o[2],height:a/o[2]};return xo(u,su(c))>0}const V_=({source:t,sourceHandle:n,target:s,targetHandle:a})=>`xy-edge__${t}${n||""}-${s}${a||""}`,Y_=(t,n)=>n.some(s=>s.source===t.source&&s.target===t.target&&(s.sourceHandle===t.sourceHandle||!s.sourceHandle&&!t.sourceHandle)&&(s.targetHandle===t.targetHandle||!s.targetHandle&&!t.targetHandle)),G_=(t,n,s={})=>{if(!t.source||!t.target)return s.onError?.("006",On.error006()),n;const a=s.getEdgeId||V_;let o;return gb(t)?o={...t}:o={...t,id:a(t)},Y_(o,n)?n:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,n.concat(o))};function Cb({sourceX:t,sourceY:n,targetX:s,targetY:a}){const[o,c,u,d]=Mb({sourceX:t,sourceY:n,targetX:s,targetY:a});return[`M ${t},${n}L ${s},${a}`,o,c,u,d]}const C0={[me.Left]:{x:-1,y:0},[me.Right]:{x:1,y:0},[me.Top]:{x:0,y:-1},[me.Bottom]:{x:0,y:1}},I_=({source:t,sourcePosition:n=me.Bottom,target:s})=>n===me.Left||n===me.Right?t.x<s.x?{x:1,y:0}:{x:-1,y:0}:t.y<s.y?{x:0,y:1}:{x:0,y:-1},O0=(t,n)=>Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2));function X_({source:t,sourcePosition:n=me.Bottom,target:s,targetPosition:a=me.Top,center:o,offset:c,stepPosition:u}){const d=C0[n],h=C0[a],p={x:t.x+d.x*c,y:t.y+d.y*c},v={x:s.x+h.x*c,y:s.y+h.y*c},g=I_({source:p,sourcePosition:n,target:v}),y=g.x!==0?"x":"y",S=g[y];let w=[],E,N;const C={x:0,y:0},j={x:0,y:0},[,,_,A]=Mb({sourceX:t.x,sourceY:t.y,targetX:s.x,targetY:s.y});if(d[y]*h[y]===-1){y==="x"?(E=o.x??p.x+(v.x-p.x)*u,N=o.y??(p.y+v.y)/2):(E=o.x??(p.x+v.x)/2,N=o.y??p.y+(v.y-p.y)*u);const R=[{x:E,y:p.y},{x:E,y:v.y}],U=[{x:p.x,y:N},{x:v.x,y:N}];d[y]===S?w=y==="x"?R:U:w=y==="x"?U:R}else{const R=[{x:p.x,y:v.y}],U=[{x:v.x,y:p.y}];if(y==="x"?w=d.x===S?U:R:w=d.y===S?R:U,n===a){const L=Math.abs(t[y]-s[y]);if(L<=c){const G=Math.min(c-1,c-L);d[y]===S?C[y]=(p[y]>t[y]?-1:1)*G:j[y]=(v[y]>s[y]?-1:1)*G}}if(n!==a){const L=y==="x"?"y":"x",G=d[y]===h[L],z=p[L]>v[L],B=p[L]<v[L];(d[y]===1&&(!G&&z||G&&B)||d[y]!==1&&(!G&&B||G&&z))&&(w=y==="x"?R:U)}const te={x:p.x+C.x,y:p.y+C.y},Y={x:v.x+j.x,y:v.y+j.y},X=Math.max(Math.abs(te.x-w[0].x),Math.abs(Y.x-w[0].x)),W=Math.max(Math.abs(te.y-w[0].y),Math.abs(Y.y-w[0].y));X>=W?(E=(te.x+Y.x)/2,N=w[0].y):(E=w[0].x,N=(te.y+Y.y)/2)}const T={x:p.x+C.x,y:p.y+C.y},M={x:v.x+j.x,y:v.y+j.y};return[[t,...T.x!==w[0].x||T.y!==w[0].y?[T]:[],...w,...M.x!==w[w.length-1].x||M.y!==w[w.length-1].y?[M]:[],s],E,N,_,A]}function K_(t,n,s,a){const o=Math.min(O0(t,n)/2,O0(n,s)/2,a),{x:c,y:u}=n;if(t.x===c&&c===s.x||t.y===u&&u===s.y)return`L${c} ${u}`;if(t.y===u){const p=t.x<s.x?-1:1,v=t.y<s.y?1:-1;return`L ${c+o*p},${u}Q ${c},${u} ${c},${u+o*v}`}const d=t.x<s.x?1:-1,h=t.y<s.y?-1:1;return`L ${c},${u+o*h}Q ${c},${u} ${c+o*d},${u}`}function vh({sourceX:t,sourceY:n,sourcePosition:s=me.Bottom,targetX:a,targetY:o,targetPosition:c=me.Top,borderRadius:u=5,centerX:d,centerY:h,offset:p=20,stepPosition:v=.5}){const[g,y,S,w,E]=X_({source:{x:t,y:n},sourcePosition:s,target:{x:a,y:o},targetPosition:c,center:{x:d,y:h},offset:p,stepPosition:v});let N=`M${g[0].x} ${g[0].y}`;for(let C=1;C<g.length-1;C++)N+=K_(g[C-1],g[C],g[C+1],u);return N+=`L${g[g.length-1].x} ${g[g.length-1].y}`,[N,y,S,w,E]}function z0(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function Z_(t){const{sourceNode:n,targetNode:s}=t;if(!z0(n)||!z0(s))return null;const a=n.internals.handleBounds||D0(n.handles),o=s.internals.handleBounds||D0(s.handles),c=k0(a?.source??[],t.sourceHandle),u=k0(t.connectionMode===Yl.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),t.targetHandle);if(!c||!u)return t.onError?.("008",On.error008(c?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const d=c?.position||me.Bottom,h=u?.position||me.Top,p=Rs(n,c,d),v=Rs(s,u,h);return{sourceX:p.x,sourceY:p.y,targetX:v.x,targetY:v.y,sourcePosition:d,targetPosition:h}}function D0(t){if(!t)return null;const n=[],s=[];for(const a of t)a.width=a.width??1,a.height=a.height??1,a.type==="source"?n.push(a):a.type==="target"&&s.push(a);return{source:n,target:s}}function Rs(t,n,s=me.Left,a=!1){const o=(n?.x??0)+t.internals.positionAbsolute.x,c=(n?.y??0)+t.internals.positionAbsolute.y,{width:u,height:d}=n??yi(t);if(a)return{x:o+u/2,y:c+d/2};switch(n?.position??s){case me.Top:return{x:o+u/2,y:c};case me.Right:return{x:o+u,y:c+d/2};case me.Bottom:return{x:o+u/2,y:c+d};case me.Left:return{x:o,y:c+d/2}}}function k0(t,n){return t&&(n?t.find(s=>s.id===n):t[0])||null}function bh(t,n){return t?typeof t=="string"?t:`${n?`${n}__`:""}${Object.keys(t).sort().map(a=>`${a}=${t[a]}`).join("&")}`:""}function Q_(t,{id:n,defaultColor:s,defaultMarkerStart:a,defaultMarkerEnd:o}){const c=new Set;return t.reduce((u,d)=>([d.markerStart||a,d.markerEnd||o].forEach(h=>{if(h&&typeof h=="object"){const p=bh(h,n);c.has(p)||(u.push({id:p,color:h.color||s,...h}),c.add(p))}}),u),[]).sort((u,d)=>u.id.localeCompare(d.id))}const Ob=1e3,F_=10,Xh={nodeOrigin:[0,0],nodeExtent:bo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},J_={...Xh,checkEquality:!0};function Kh(t,n){const s={...t};for(const a in n)n[a]!==void 0&&(s[a]=n[a]);return s}function W_(t,n,s){const a=Kh(Xh,s);for(const o of t.values())if(o.parentId)Qh(o,t,n,a);else{const c=ko(o,a.nodeOrigin),u=js(o.extent)?o.extent:a.nodeExtent,d=ks(c,u,yi(o));o.internals.positionAbsolute=d}}function P_(t,n){if(!t.handles)return t.measured?n?.internals.handleBounds:void 0;const s=[],a=[];for(const o of t.handles){const c={id:o.id,width:o.width??1,height:o.height??1,nodeId:t.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?s.push(c):o.type==="target"&&a.push(c)}return{source:s,target:a}}function Zh(t){return t==="manual"}function Sh(t,n,s,a={}){const o=Kh(J_,a),c={i:0},u=new Map(n),d=o?.elevateNodesOnSelect&&!Zh(o.zIndexMode)?Ob:0;let h=t.length>0,p=!1;n.clear(),s.clear();for(const v of t){let g=u.get(v.id);if(o.checkEquality&&v===g?.internals.userNode)n.set(v.id,g);else{const y=ko(v,o.nodeOrigin),S=js(v.extent)?v.extent:o.nodeExtent,w=ks(y,S,yi(v));g={...o.defaults,...v,measured:{width:v.measured?.width,height:v.measured?.height},internals:{positionAbsolute:w,handleBounds:P_(v,g),z:zb(v,d,o.zIndexMode),userNode:v}},n.set(v.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(h=!1),v.parentId&&Qh(g,n,s,a,c),p||=v.selected??!1}return{nodesInitialized:h,hasSelectedNodes:p}}function eA(t,n){if(!t.parentId)return;const s=n.get(t.parentId);s?s.set(t.id,t):n.set(t.parentId,new Map([[t.id,t]]))}function Qh(t,n,s,a,o){const{elevateNodesOnSelect:c,nodeOrigin:u,nodeExtent:d,zIndexMode:h}=Kh(Xh,a),p=t.parentId,v=n.get(p);if(!v){console.warn(`Parent node ${p} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}eA(t,s),o&&!v.parentId&&v.internals.rootParentIndex===void 0&&h==="auto"&&(v.internals.rootParentIndex=++o.i,v.internals.z=v.internals.z+o.i*F_),o&&v.internals.rootParentIndex!==void 0&&(o.i=v.internals.rootParentIndex);const g=c&&!Zh(h)?Ob:0,{x:y,y:S,z:w}=tA(t,v,u,d,g,h),{positionAbsolute:E}=t.internals,N=y!==E.x||S!==E.y;(N||w!==t.internals.z)&&n.set(t.id,{...t,internals:{...t.internals,positionAbsolute:N?{x:y,y:S}:E,z:w}})}function zb(t,n,s){const a=Mn(t.zIndex)?t.zIndex:0;return Zh(s)?a:a+(t.selected?n:0)}function tA(t,n,s,a,o,c){const{x:u,y:d}=n.internals.positionAbsolute,h=yi(t),p=ko(t,s),v=js(t.extent)?ks(p,t.extent,h):p;let g=ks({x:u+v.x,y:d+v.y},a,h);t.extent==="parent"&&(g=vb(g,h,n));const y=zb(t,o,c),S=n.internals.z??0;return{x:g.x,y:g.y,z:S>=y?S+1:y}}function Fh(t,n,s,a=[0,0]){const o=[],c=new Map;for(const u of t){const d=n.get(u.parentId);if(!d)continue;const h=c.get(u.parentId)?.expandedRect??Il(d),p=bb(h,u.rect);c.set(u.parentId,{expandedRect:p,parent:d})}return c.size>0&&c.forEach(({expandedRect:u,parent:d},h)=>{const p=d.internals.positionAbsolute,v=yi(d),g=d.origin??a,y=u.x<p.x?Math.round(Math.abs(p.x-u.x)):0,S=u.y<p.y?Math.round(Math.abs(p.y-u.y)):0,w=Math.max(v.width,Math.round(u.width)),E=Math.max(v.height,Math.round(u.height)),N=(w-v.width)*g[0],C=(E-v.height)*g[1];(y>0||S>0||N||C)&&(o.push({id:h,type:"position",position:{x:d.position.x-y+N,y:d.position.y-S+C}}),s.get(h)?.forEach(j=>{t.some(_=>_.id===j.id)||o.push({id:j.id,type:"position",position:{x:j.position.x+y,y:j.position.y+S}})})),(v.width<u.width||v.height<u.height||y||S)&&o.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:w+(y?g[0]*y-N:0),height:E+(S?g[1]*S-C:0)}})}),o}function nA(t,n,s,a,o,c,u){const d=a?.querySelector(".xyflow__viewport");let h=!1;if(!d)return{changes:[],updatedInternals:h};const p=[],v=window.getComputedStyle(d),{m22:g}=new window.DOMMatrixReadOnly(v.transform),y=[];for(const S of t.values()){const w=n.get(S.id);if(!w)continue;if(w.hidden){n.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),h=!0;continue}const E=Ih(S.nodeElement),N=w.measured.width!==E.width||w.measured.height!==E.height;if(!!(E.width&&E.height&&(N||!w.internals.handleBounds||S.force))){const j=S.nodeElement.getBoundingClientRect(),_=js(w.extent)?w.extent:c;let{positionAbsolute:A}=w.internals;w.parentId&&w.extent==="parent"?A=vb(A,E,n.get(w.parentId)):_&&(A=ks(A,_,E));const T={...w,measured:E,internals:{...w.internals,positionAbsolute:A,handleBounds:{source:T0("source",S.nodeElement,j,g,w.id),target:T0("target",S.nodeElement,j,g,w.id)}}};n.set(w.id,T),w.parentId&&Qh(T,n,s,{nodeOrigin:o,zIndexMode:u}),h=!0,N&&(p.push({id:w.id,type:"dimensions",dimensions:E}),w.expandParent&&w.parentId&&y.push({id:w.id,parentId:w.parentId,rect:Il(T,o)}))}}if(y.length>0){const S=Fh(y,n,s,o);p.push(...S)}return{changes:p,updatedInternals:h}}async function iA({delta:t,panZoom:n,transform:s,translateExtent:a,width:o,height:c}){if(!n||!t.x&&!t.y)return!1;const u=await n.setViewportConstrained({x:s[0]+t.x,y:s[1]+t.y,zoom:s[2]},[[0,0],[o,c]],a);return!!u&&(u.x!==s[0]||u.y!==s[1]||u.k!==s[2])}function j0(t,n,s,a,o,c){let u=o;const d=a.get(u)||new Map;a.set(u,d.set(s,n)),u=`${o}-${t}`;const h=a.get(u)||new Map;if(a.set(u,h.set(s,n)),c){u=`${o}-${t}-${c}`;const p=a.get(u)||new Map;a.set(u,p.set(s,n))}}function Db(t,n,s){t.clear(),n.clear();for(const a of s){const{source:o,target:c,sourceHandle:u=null,targetHandle:d=null}=a,h={edgeId:a.id,source:o,target:c,sourceHandle:u,targetHandle:d},p=`${o}-${u}--${c}-${d}`,v=`${c}-${d}--${o}-${u}`;j0("source",h,v,t,o,u),j0("target",h,p,t,c,d),n.set(a.id,a)}}function kb(t,n){if(!t.parentId)return!1;const s=n.get(t.parentId);return s?s.selected?!0:kb(s,n):!1}function R0(t,n,s){let a=t;do{if(a?.matches?.(n))return!0;if(a===s)return!1;a=a?.parentElement}while(a);return!1}function sA(t,n,s,a){const o=new Map;for(const[c,u]of t)if((u.selected||u.id===a)&&(!u.parentId||!kb(u,t))&&(u.draggable||n&&typeof u.draggable>"u")){const d=t.get(c);d&&o.set(c,{id:c,position:d.position||{x:0,y:0},distance:{x:s.x-d.internals.positionAbsolute.x,y:s.y-d.internals.positionAbsolute.y},extent:d.extent,parentId:d.parentId,origin:d.origin,expandParent:d.expandParent,internals:{positionAbsolute:d.internals.positionAbsolute||{x:0,y:0}},measured:{width:d.measured.width??0,height:d.measured.height??0}})}return o}function Id({nodeId:t,dragItems:n,nodeLookup:s,dragging:a=!0}){const o=[];for(const[u,d]of n){const h=s.get(u)?.internals.userNode;h&&o.push({...h,position:d.position,dragging:a})}if(!t)return[o[0],o];const c=s.get(t)?.internals.userNode;return[c?{...c,position:n.get(t)?.position||c.position,dragging:a}:o[0],o]}function lA({dragItems:t,snapGrid:n,x:s,y:a}){const o=t.values().next().value;if(!o)return null;const c={x:s-o.distance.x,y:a-o.distance.y},u=Ro(c,n);return{x:u.x-c.x,y:u.y-c.y}}function aA({onNodeMouseDown:t,getStoreItems:n,onDragStart:s,onDrag:a,onDragStop:o}){let c={x:null,y:null},u=0,d=new Map,h=!1,p={x:0,y:0},v=null,g=!1,y=null,S=!1,w=!1,E=null;function N({noDragClassName:j,handleSelector:_,domNode:A,isSelectable:T,nodeId:M,nodeClickDistance:k=0}){y=sn(A);function R({x:X,y:W}){const{nodeLookup:L,nodeExtent:G,snapGrid:z,snapToGrid:B,nodeOrigin:I,onNodeDrag:Q,onSelectionDrag:se,onError:D,updateNodePositions:$}=n();c={x:X,y:W};let ne=!1;const ie=d.size>1,ce=ie&&G?yh(jo(d)):null,he=ie&&B?lA({dragItems:d,snapGrid:z,x:X,y:W}):null;for(const[fe,K]of d){if(!L.has(fe))continue;let ue={x:X-K.distance.x,y:W-K.distance.y};B&&(ue=he?{x:Math.round(ue.x+he.x),y:Math.round(ue.y+he.y)}:Ro(ue,z));let pe=null;if(ie&&G&&!K.extent&&ce){const{positionAbsolute:be}=K.internals,Ee=be.x-ce.x+G[0][0],ze=be.x+K.measured.width-ce.x2+G[1][0],Ie=be.y-ce.y+G[0][1],wt=be.y+K.measured.height-ce.y2+G[1][1];pe=[[Ee,Ie],[ze,wt]]}const{position:xe,positionAbsolute:de}=yb({nodeId:fe,nextPosition:ue,nodeLookup:L,nodeExtent:pe||G,nodeOrigin:I,onError:D});ne=ne||K.position.x!==xe.x||K.position.y!==xe.y,K.position=xe,K.internals.positionAbsolute=de}if(w=w||ne,!!ne&&($(d,!0),E&&(a||Q||!M&&se))){const[fe,K]=Id({nodeId:M,dragItems:d,nodeLookup:L});a?.(E,d,fe,K),Q?.(E,fe,K),M||se?.(E,K)}}async function U(){if(!v)return;const{transform:X,panBy:W,autoPanSpeed:L,autoPanOnNodeDrag:G}=n();if(!G){h=!1,cancelAnimationFrame(u);return}const[z,B]=Yh(p,v,L);(z!==0||B!==0)&&(c.x=(c.x??0)-z/X[2],c.y=(c.y??0)-B/X[2],await W({x:z,y:B})&&R(c)),u=requestAnimationFrame(U)}function te(X){const{nodeLookup:W,multiSelectionActive:L,nodesDraggable:G,transform:z,snapGrid:B,snapToGrid:I,selectNodesOnDrag:Q,onNodeDragStart:se,onSelectionDragStart:D,unselectNodesAndEdges:$}=n();g=!0,(!Q||!T)&&!L&&M&&(W.get(M)?.selected||$()),T&&Q&&M&&t?.(M);const ne=ho(X.sourceEvent,{transform:z,snapGrid:B,snapToGrid:I,containerBounds:v});if(c=ne,d=sA(W,G,ne,M),d.size>0&&(s||se||!M&&D)){const[ie,ce]=Id({nodeId:M,dragItems:d,nodeLookup:W});s?.(X.sourceEvent,d,ie,ce),se?.(X.sourceEvent,ie,ce),M||D?.(X.sourceEvent,ce)}}const Y=Fv().clickDistance(k).on("start",X=>{const{domNode:W,nodeDragThreshold:L,transform:G,snapGrid:z,snapToGrid:B}=n();v=W?.getBoundingClientRect()||null,S=!1,w=!1,E=X.sourceEvent,L===0&&te(X),c=ho(X.sourceEvent,{transform:G,snapGrid:z,snapToGrid:B,containerBounds:v}),p=Cn(X.sourceEvent,v)}).on("drag",X=>{const{autoPanOnNodeDrag:W,transform:L,snapGrid:G,snapToGrid:z,nodeDragThreshold:B,nodeLookup:I}=n(),Q=ho(X.sourceEvent,{transform:L,snapGrid:G,snapToGrid:z,containerBounds:v});if(E=X.sourceEvent,(X.sourceEvent.type==="touchmove"&&X.sourceEvent.touches.length>1||M&&!I.has(M))&&(S=!0),!S){if(!h&&W&&g&&(h=!0,U()),!g){const se=Cn(X.sourceEvent,v),D=se.x-p.x,$=se.y-p.y;Math.sqrt(D*D+$*$)>B&&te(X)}(c.x!==Q.xSnapped||c.y!==Q.ySnapped)&&d&&g&&(p=Cn(X.sourceEvent,v),R(Q))}}).on("end",X=>{if(!g||S){S&&d.size>0&&n().updateNodePositions(d,!1);return}if(h=!1,g=!1,cancelAnimationFrame(u),d.size>0){const{nodeLookup:W,updateNodePositions:L,onNodeDragStop:G,onSelectionDragStop:z}=n();if(w&&(L(d,!1),w=!1),o||G||!M&&z){const[B,I]=Id({nodeId:M,dragItems:d,nodeLookup:W,dragging:!1});o?.(X.sourceEvent,d,B,I),G?.(X.sourceEvent,B,I),M||z?.(X.sourceEvent,I)}}}).filter(X=>{const W=X.target;return!X.button&&(!j||!R0(W,`.${j}`,A))&&(!_||R0(W,_,A))});y.call(Y)}function C(){y?.on(".drag",null)}return{update:N,destroy:C}}function oA(t,n,s){const a=[],o={x:t.x-s,y:t.y-s,width:s*2,height:s*2};for(const c of n.values())xo(o,Il(c))>0&&a.push(c);return a}const rA=250;function cA(t,n,s,a){let o=[],c=1/0;const u=oA(t,s,n+rA);for(const d of u){const h=[...d.internals.handleBounds?.source??[],...d.internals.handleBounds?.target??[]];for(const p of h){if(a.nodeId===p.nodeId&&a.type===p.type&&a.id===p.id)continue;const{x:v,y:g}=Rs(d,p,p.position,!0),y=Math.sqrt(Math.pow(v-t.x,2)+Math.pow(g-t.y,2));y>n||(y<c?(o=[{...p,x:v,y:g}],c=y):y===c&&o.push({...p,x:v,y:g}))}}if(!o.length)return null;if(o.length>1){const d=a.type==="source"?"target":"source";return o.find(h=>h.type===d)??o[0]}return o[0]}function jb(t,n,s,a,o,c=!1){const u=a.get(t);if(!u)return null;const d=o==="strict"?u.internals.handleBounds?.[n]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],h=(s?d?.find(p=>p.id===s):d?.[0])??null;return h&&c?{...h,...Rs(u,h,h.position,!0)}:h}function Rb(t,n){return t||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function uA(t,n){let s=null;return n?s=!0:t&&!n&&(s=!1),s}const Lb=()=>!0;function fA(t,{connectionMode:n,connectionRadius:s,handleId:a,nodeId:o,edgeUpdaterType:c,isTarget:u,domNode:d,nodeLookup:h,lib:p,autoPanOnConnect:v,flowId:g,panBy:y,cancelConnection:S,onConnectStart:w,onConnect:E,onConnectEnd:N,isValidConnection:C=Lb,onReconnectEnd:j,updateConnection:_,getTransform:A,getFromHandle:T,autoPanSpeed:M,dragThreshold:k=1,handleDomNode:R}){const U=Eb(t.target);let te=0,Y;const{x:X,y:W}=Cn(t),L=Rb(c,R),G=d?.getBoundingClientRect();let z=!1;if(!G||!L)return;const B=jb(o,L,a,h,n);if(!B)return;let I=Cn(t,G),Q=!1,se=null,D=!1,$=null;function ne(){if(!v||!G)return;const[xe,de]=Yh(I,G,M);y({x:xe,y:de}),te=requestAnimationFrame(ne)}const ie={...B,nodeId:o,type:L,position:B.position},ce=h.get(o);let fe={inProgress:!0,isValid:null,from:Rs(ce,ie,me.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:ce,to:I,toHandle:null,toPosition:E0[ie.position],toNode:null,pointer:I};function K(){z=!0,_(fe),w?.(t,{nodeId:o,handleId:a,handleType:L})}k===0&&K();function ue(xe){if(!z){const{x:wt,y:We}=Cn(xe),yt=wt-X,Et=We-W;if(!(yt*yt+Et*Et>k*k))return;K()}if(!T()||!ie){pe(xe);return}const de=A();I=Cn(xe,G),Y=cA(Fl(I,de,!1,[1,1]),s,h,ie),Q||(ne(),Q=!0);const be=Bb(xe,{handle:Y,connectionMode:n,fromNodeId:o,fromHandleId:a,fromType:u?"target":"source",isValidConnection:C,doc:U,lib:p,flowId:g,nodeLookup:h});$=be.handleDomNode,se=be.connection,D=uA(!!Y,be.isValid);const Ee=h.get(o),ze=Ee?Rs(Ee,ie,me.Left,!0):fe.from,Ie={...fe,from:ze,isValid:D,to:be.toHandle&&D?Xl({x:be.toHandle.x,y:be.toHandle.y},de):I,toHandle:be.toHandle,toPosition:D&&be.toHandle?be.toHandle.position:E0[ie.position],toNode:be.toHandle?h.get(be.toHandle.nodeId):null,pointer:I};_(Ie),fe=Ie}function pe(xe){if(!("touches"in xe&&xe.touches.length>0)){if(z){(Y||$)&&se&&D&&E?.(se);const{inProgress:de,...be}=fe,Ee={...be,toPosition:fe.toHandle?fe.toPosition:null};N?.(xe,Ee),c&&j?.(xe,Ee)}S(),cancelAnimationFrame(te),Q=!1,D=!1,se=null,$=null,U.removeEventListener("mousemove",ue),U.removeEventListener("mouseup",pe),U.removeEventListener("touchmove",ue),U.removeEventListener("touchend",pe)}}U.addEventListener("mousemove",ue),U.addEventListener("mouseup",pe),U.addEventListener("touchmove",ue),U.addEventListener("touchend",pe)}function Bb(t,{handle:n,connectionMode:s,fromNodeId:a,fromHandleId:o,fromType:c,doc:u,lib:d,flowId:h,isValidConnection:p=Lb,nodeLookup:v}){const g=c==="target",y=n?u.querySelector(`.${d}-flow__handle[data-id="${h}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x:S,y:w}=Cn(t),E=u.elementFromPoint(S,w),N=E?.classList.contains(`${d}-flow__handle`)?E:y,C={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const j=Rb(void 0,N),_=N.getAttribute("data-nodeid"),A=N.getAttribute("data-handleid"),T=N.classList.contains("connectable"),M=N.classList.contains("connectableend");if(!_||!j)return C;const k={source:g?_:a,sourceHandle:g?A:o,target:g?a:_,targetHandle:g?o:A};C.connection=k;const U=T&&M&&(s===Yl.Strict?g&&j==="source"||!g&&j==="target":_!==a||A!==o);C.isValid=U&&p(k),C.toHandle=jb(_,j,A,v,s,!0)}return C}const wh={onPointerDown:fA,isValid:Bb};function dA({domNode:t,panZoom:n,getTransform:s,getViewScale:a}){const o=sn(t);function c({translateExtent:d,width:h,height:p,zoomStep:v=1,pannable:g=!0,zoomable:y=!0,inversePan:S=!1}){const w=_=>{if(_.sourceEvent.type!=="wheel"||!n)return;const A=s(),T=_.sourceEvent.ctrlKey&&Eo()?10:1,M=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*v,k=A[2]*Math.pow(2,M*T);n.scaleTo(k)};let E=[0,0];const N=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(E=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},C=_=>{const A=s();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!n)return;const T=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],M=[T[0]-E[0],T[1]-E[1]];E=T;const k=a()*Math.max(A[2],Math.log(A[2]))*(S?-1:1),R={x:A[0]-M[0]*k,y:A[1]-M[1]*k},U=[[0,0],[h,p]];n.setViewportConstrained({x:R.x,y:R.y,zoom:A[2]},U,d)},j=fb().on("start",N).on("zoom",g?C:null).on("zoom.wheel",y?w:null);o.call(j,{})}function u(){o.on("zoom",null)}return{update:c,destroy:u,pointer:An}}const lu=t=>({x:t.x,y:t.y,zoom:t.k}),Xd=({x:t,y:n,zoom:s})=>nu.translate(t,n).scale(s),Tl=(t,n)=>t.target.closest(`.${n}`),Hb=(t,n)=>n===2&&Array.isArray(t)&&t.includes(2),hA=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Kd=(t,n=0,s=hA,a=()=>{})=>{const o=typeof n=="number"&&n>0;return o||a(),o?t.transition().duration(n).ease(s).on("end",a):t},$b=t=>{const n=t.ctrlKey&&Eo()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*n};function mA({zoomPanValues:t,noWheelClassName:n,d3Selection:s,d3Zoom:a,panOnScrollMode:o,panOnScrollSpeed:c,zoomOnPinch:u,onPanZoomStart:d,onPanZoom:h,onPanZoomEnd:p}){return v=>{if(Tl(v,n))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const g=s.property("__zoom").k||1;if(v.ctrlKey&&u){const N=An(v),C=$b(v),j=g*Math.pow(2,C);a.scaleTo(s,j,N,v);return}const y=v.deltaMode===1?20:1;let S=o===Os.Vertical?0:v.deltaX*y,w=o===Os.Horizontal?0:v.deltaY*y;!Eo()&&v.shiftKey&&o!==Os.Vertical&&(S=v.deltaY*y,w=0),a.translateBy(s,-(S/g)*c,-(w/g)*c,{internal:!0});const E=lu(s.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(h?.(v,E),t.panScrollTimeout=setTimeout(()=>{p?.(v,E),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,d?.(v,E))}}function pA({noWheelClassName:t,preventScrolling:n,d3ZoomHandler:s}){return function(a,o){const c=a.type==="wheel",u=!n&&c&&!a.ctrlKey,d=Tl(a,t);if(a.ctrlKey&&c&&d&&a.preventDefault(),u||d)return null;a.preventDefault(),s.call(this,a,o)}}function gA({zoomPanValues:t,onDraggingChange:n,onPanZoomStart:s}){return a=>{if(a.sourceEvent?.internal)return;const o=lu(a.transform);t.mouseButton=a.sourceEvent?.button||0,t.isZoomingOrPanning=!0,t.prevViewport=o,a.sourceEvent?.type==="mousedown"&&n(!0),s&&s?.(a.sourceEvent,o)}}function yA({zoomPanValues:t,panOnDrag:n,onPaneContextMenu:s,onTransformChange:a,onPanZoom:o}){return c=>{t.usedRightMouseButton=!!(s&&Hb(n,t.mouseButton??0)),c.sourceEvent?.sync||a([c.transform.x,c.transform.y,c.transform.k]),o&&!c.sourceEvent?.internal&&o?.(c.sourceEvent,lu(c.transform))}}function vA({zoomPanValues:t,panOnDrag:n,panOnScroll:s,onDraggingChange:a,onPanZoomEnd:o,onPaneContextMenu:c}){return u=>{if(!u.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,c&&Hb(n,t.mouseButton??0)&&!t.usedRightMouseButton&&u.sourceEvent&&c(u.sourceEvent),t.usedRightMouseButton=!1,a(!1),o)){const d=lu(u.transform);t.prevViewport=d,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{o?.(u.sourceEvent,d)},s?150:0)}}}function bA({zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:s,panOnDrag:a,panOnScroll:o,zoomOnDoubleClick:c,userSelectionActive:u,noWheelClassName:d,noPanClassName:h,lib:p,connectionInProgress:v}){return g=>{const y=t||n,S=s&&g.ctrlKey,w=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Tl(g,`${p}-flow__node`)||Tl(g,`${p}-flow__edge`)))return!0;if(!a&&!y&&!o&&!c&&!s||u||v&&!w||Tl(g,d)&&w||Tl(g,h)&&(!w||o&&w&&!t)||!s&&g.ctrlKey&&w)return!1;if(!s&&g.type==="touchstart"&&g.touches?.length>1)return g.preventDefault(),!1;if(!y&&!o&&!S&&w||!a&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(a)&&!a.includes(g.button)&&g.type==="mousedown")return!1;const E=Array.isArray(a)&&a.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||w)&&E}}function SA({domNode:t,minZoom:n,maxZoom:s,translateExtent:a,viewport:o,onPanZoom:c,onPanZoomStart:u,onPanZoomEnd:d,onDraggingChange:h}){const p={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=t.getBoundingClientRect(),g=fb().scaleExtent([n,s]).translateExtent(a),y=sn(t).call(g);j({x:o.x,y:o.y,zoom:Gl(o.zoom,n,s)},[[0,0],[v.width,v.height]],a);const S=y.on("wheel.zoom"),w=y.on("dblclick.zoom");g.wheelDelta($b);async function E(Y,X){return y?new Promise(W=>{g?.interpolate(X?.interpolate==="linear"?fo:_c).transform(Kd(y,X?.duration,X?.ease,()=>W(!0)),Y)}):!1}function N({noWheelClassName:Y,noPanClassName:X,onPaneContextMenu:W,userSelectionActive:L,panOnScroll:G,panOnDrag:z,panOnScrollMode:B,panOnScrollSpeed:I,preventScrolling:Q,zoomOnPinch:se,zoomOnScroll:D,zoomOnDoubleClick:$,zoomActivationKeyPressed:ne,lib:ie,onTransformChange:ce,connectionInProgress:he,paneClickDistance:fe,selectionOnDrag:K}){L&&!p.isZoomingOrPanning&&C();const ue=G&&!ne&&!L;g.clickDistance(K?1/0:!Mn(fe)||fe<0?0:fe);const pe=ue?mA({zoomPanValues:p,noWheelClassName:Y,d3Selection:y,d3Zoom:g,panOnScrollMode:B,panOnScrollSpeed:I,zoomOnPinch:se,onPanZoomStart:u,onPanZoom:c,onPanZoomEnd:d}):pA({noWheelClassName:Y,preventScrolling:Q,d3ZoomHandler:S});y.on("wheel.zoom",pe,{passive:!1});const xe=gA({zoomPanValues:p,onDraggingChange:h,onPanZoomStart:u});g.on("start",xe);const de=yA({zoomPanValues:p,panOnDrag:z,onPaneContextMenu:!!W,onPanZoom:c,onTransformChange:ce});g.on("zoom",de);const be=vA({zoomPanValues:p,panOnDrag:z,panOnScroll:G,onPaneContextMenu:W,onPanZoomEnd:d,onDraggingChange:h});g.on("end",be);const Ee=bA({zoomActivationKeyPressed:ne,panOnDrag:z,zoomOnScroll:D,panOnScroll:G,zoomOnDoubleClick:$,zoomOnPinch:se,userSelectionActive:L,noPanClassName:X,noWheelClassName:Y,lib:ie,connectionInProgress:he});g.filter(Ee),$?y.on("dblclick.zoom",w):y.on("dblclick.zoom",null)}function C(){g.on("zoom",null)}async function j(Y,X,W){const L=Xd(Y),G=g?.constrain()(L,X,W);return G&&await E(G),G}async function _(Y,X){const W=Xd(Y);return await E(W,X),W}function A(Y){if(y){const X=Xd(Y),W=y.property("__zoom");(W.k!==Y.zoom||W.x!==Y.x||W.y!==Y.y)&&g?.transform(y,X,null,{sync:!0})}}function T(){const Y=y?ub(y.node()):{x:0,y:0,k:1};return{x:Y.x,y:Y.y,zoom:Y.k}}async function M(Y,X){return y?new Promise(W=>{g?.interpolate(X?.interpolate==="linear"?fo:_c).scaleTo(Kd(y,X?.duration,X?.ease,()=>W(!0)),Y)}):!1}async function k(Y,X){return y?new Promise(W=>{g?.interpolate(X?.interpolate==="linear"?fo:_c).scaleBy(Kd(y,X?.duration,X?.ease,()=>W(!0)),Y)}):!1}function R(Y){g?.scaleExtent(Y)}function U(Y){g?.translateExtent(Y)}function te(Y){const X=!Mn(Y)||Y<0?0:Y;g?.clickDistance(X)}return{update:N,destroy:C,setViewport:_,setViewportConstrained:j,getViewport:T,scaleTo:M,scaleBy:k,setScaleExtent:R,setTranslateExtent:U,syncViewport:A,setClickDistance:te}}var Kl;(function(t){t.Line="line",t.Handle="handle"})(Kl||(Kl={}));function wA({width:t,prevWidth:n,height:s,prevHeight:a,affectsX:o,affectsY:c}){const u=t-n,d=s-a,h=[u>0?1:u<0?-1:0,d>0?1:d<0?-1:0];return u&&o&&(h[0]=h[0]*-1),d&&c&&(h[1]=h[1]*-1),h}function L0(t){const n=t.includes("right")||t.includes("left"),s=t.includes("bottom")||t.includes("top"),a=t.includes("left"),o=t.includes("top");return{isHorizontal:n,isVertical:s,affectsX:a,affectsY:o}}function Zi(t,n){return Math.max(0,n-t)}function Qi(t,n){return Math.max(0,t-n)}function pc(t,n,s){return Math.max(0,n-t,t-s)}function B0(t,n){return t?!n:n}function xA(t,n,s,a,o,c,u,d){let{affectsX:h,affectsY:p}=n;const{isHorizontal:v,isVertical:g}=n,y=v&&g,{xSnapped:S,ySnapped:w}=s,{minWidth:E,maxWidth:N,minHeight:C,maxHeight:j}=a,{x:_,y:A,width:T,height:M,aspectRatio:k}=t;let R=Math.floor(v?S-t.pointerX:0),U=Math.floor(g?w-t.pointerY:0);const te=T+(h?-R:R),Y=M+(p?-U:U),X=-c[0]*T,W=-c[1]*M;let L=pc(te,E,N),G=pc(Y,C,j);if(u){let I=0,Q=0;h&&R<0?I=Zi(_+R+X,u[0][0]):!h&&R>0&&(I=Qi(_+te+X,u[1][0])),p&&U<0?Q=Zi(A+U+W,u[0][1]):!p&&U>0&&(Q=Qi(A+Y+W,u[1][1])),L=Math.max(L,I),G=Math.max(G,Q)}if(d){let I=0,Q=0;h&&R>0?I=Qi(_+R,d[0][0]):!h&&R<0&&(I=Zi(_+te,d[1][0])),p&&U>0?Q=Qi(A+U,d[0][1]):!p&&U<0&&(Q=Zi(A+Y,d[1][1])),L=Math.max(L,I),G=Math.max(G,Q)}if(o){if(v){const I=pc(te/k,C,j)*k;if(L=Math.max(L,I),u){let Q=0;!h&&!p||h&&!p&&y?Q=Qi(A+W+te/k,u[1][1])*k:Q=Zi(A+W+(h?R:-R)/k,u[0][1])*k,L=Math.max(L,Q)}if(d){let Q=0;!h&&!p||h&&!p&&y?Q=Zi(A+te/k,d[1][1])*k:Q=Qi(A+(h?R:-R)/k,d[0][1])*k,L=Math.max(L,Q)}}if(g){const I=pc(Y*k,E,N)/k;if(G=Math.max(G,I),u){let Q=0;!h&&!p||p&&!h&&y?Q=Qi(_+Y*k+X,u[1][0])/k:Q=Zi(_+(p?U:-U)*k+X,u[0][0])/k,G=Math.max(G,Q)}if(d){let Q=0;!h&&!p||p&&!h&&y?Q=Zi(_+Y*k,d[1][0])/k:Q=Qi(_+(p?U:-U)*k,d[0][0])/k,G=Math.max(G,Q)}}}U=U+(U<0?G:-G),R=R+(R<0?L:-L),o&&(y?te>Y*k?U=(B0(h,p)?-R:R)/k:R=(B0(h,p)?-U:U)*k:v?(U=R/k,p=h):(R=U*k,h=p));const z=h?_+R:_,B=p?A+U:A;return{width:T+(h?-R:R),height:M+(p?-U:U),x:c[0]*R*(h?-1:1)+z,y:c[1]*U*(p?-1:1)+B}}const Ub={width:0,height:0,x:0,y:0},EA={...Ub,pointerX:0,pointerY:0,aspectRatio:1};function NA(t,n,s){const a=n.position.x+t.position.x,o=n.position.y+t.position.y,c=t.measured.width??0,u=t.measured.height??0,d=s[0]*c,h=s[1]*u;return[[a-d,o-h],[a+c-d,o+u-h]]}function _A({domNode:t,nodeId:n,getStoreItems:s,onChange:a,onEnd:o}){const c=sn(t);let u={controlDirection:L0("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function d({controlPosition:p,boundaries:v,keepAspectRatio:g,resizeDirection:y,onResizeStart:S,onResize:w,onResizeEnd:E,shouldResize:N}){let C={...Ub},j={...EA};u={boundaries:v,resizeDirection:y,keepAspectRatio:g,controlDirection:L0(p)};let _,A=null,T=[],M,k,R,U=!1;const te=Fv().on("start",Y=>{const{nodeLookup:X,transform:W,snapGrid:L,snapToGrid:G,nodeOrigin:z,paneDomNode:B}=s();if(_=X.get(n),!_)return;A=B?.getBoundingClientRect()??null;const{xSnapped:I,ySnapped:Q}=ho(Y.sourceEvent,{transform:W,snapGrid:L,snapToGrid:G,containerBounds:A});C={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},j={...C,pointerX:I,pointerY:Q,aspectRatio:C.width/C.height},M=void 0,k=js(_.extent)?_.extent:void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(M=X.get(_.parentId)),M&&_.extent==="parent"&&(k=[[0,0],[M.measured.width,M.measured.height]]),T=[],R=void 0;for(const[se,D]of X)if(D.parentId===n&&(T.push({id:se,position:{...D.position},extent:D.extent}),D.extent==="parent"||D.expandParent)){const $=NA(D,_,D.origin??z);R?R=[[Math.min($[0][0],R[0][0]),Math.min($[0][1],R[0][1])],[Math.max($[1][0],R[1][0]),Math.max($[1][1],R[1][1])]]:R=$}S?.(Y,{...C})}).on("drag",Y=>{const{transform:X,snapGrid:W,snapToGrid:L,nodeOrigin:G}=s(),z=ho(Y.sourceEvent,{transform:X,snapGrid:W,snapToGrid:L,containerBounds:A}),B=[];if(!_)return;const{x:I,y:Q,width:se,height:D}=C,$={},ne=_.origin??G,{width:ie,height:ce,x:he,y:fe}=xA(j,u.controlDirection,z,u.boundaries,u.keepAspectRatio,ne,k,R),K=ie!==se,ue=ce!==D,pe=he!==I&&K,xe=fe!==Q&&ue;if(!pe&&!xe&&!K&&!ue)return;if((pe||xe||ne[0]===1||ne[1]===1)&&($.x=pe?he:C.x,$.y=xe?fe:C.y,C.x=$.x,C.y=$.y,T.length>0)){const ze=he-I,Ie=fe-Q;for(const wt of T)wt.position={x:wt.position.x-ze+ne[0]*(ie-se),y:wt.position.y-Ie+ne[1]*(ce-D)},B.push(wt)}if((K||ue)&&($.width=K&&(!u.resizeDirection||u.resizeDirection==="horizontal")?ie:C.width,$.height=ue&&(!u.resizeDirection||u.resizeDirection==="vertical")?ce:C.height,C.width=$.width,C.height=$.height),M&&_.expandParent){const ze=ne[0]*($.width??0);$.x&&$.x<ze&&(C.x=ze,j.x=j.x-($.x-ze));const Ie=ne[1]*($.height??0);$.y&&$.y<Ie&&(C.y=Ie,j.y=j.y-($.y-Ie))}const de=wA({width:C.width,prevWidth:se,height:C.height,prevHeight:D,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),be={...C,direction:de};N?.(Y,be)!==!1&&(U=!0,w?.(Y,be),a($,B))}).on("end",Y=>{U&&(E?.(Y,{...C}),o?.({...C}),U=!1)});c.call(te)}function h(){c.on(".drag",null)}return{update:d,destroy:h}}var Zd={exports:{}},Qd={},Fd={exports:{}},Jd={};var H0;function AA(){if(H0)return Jd;H0=1;var t=Oo();function n(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var s=typeof Object.is=="function"?Object.is:n,a=t.useState,o=t.useEffect,c=t.useLayoutEffect,u=t.useDebugValue;function d(g,y){var S=y(),w=a({inst:{value:S,getSnapshot:y}}),E=w[0].inst,N=w[1];return c(function(){E.value=S,E.getSnapshot=y,h(E)&&N({inst:E})},[g,S,y]),o(function(){return h(E)&&N({inst:E}),g(function(){h(E)&&N({inst:E})})},[g]),u(S),S}function h(g){var y=g.getSnapshot;g=g.value;try{var S=y();return!s(g,S)}catch{return!0}}function p(g,y){return y()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:d;return Jd.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:v,Jd}var $0;function TA(){return $0||($0=1,Fd.exports=AA()),Fd.exports}var U0;function MA(){if(U0)return Qd;U0=1;var t=Oo(),n=TA();function s(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var a=typeof Object.is=="function"?Object.is:s,o=n.useSyncExternalStore,c=t.useRef,u=t.useEffect,d=t.useMemo,h=t.useDebugValue;return Qd.useSyncExternalStoreWithSelector=function(p,v,g,y,S){var w=c(null);if(w.current===null){var E={hasValue:!1,value:null};w.current=E}else E=w.current;w=d(function(){function C(M){if(!j){if(j=!0,_=M,M=y(M),S!==void 0&&E.hasValue){var k=E.value;if(S(k,M))return A=k}return A=M}if(k=A,a(_,M))return k;var R=y(M);return S!==void 0&&S(k,R)?(_=M,k):(_=M,A=R)}var j=!1,_,A,T=g===void 0?null:g;return[function(){return C(v())},T===null?void 0:function(){return C(T())}]},[v,g,y,S]);var N=o(p,w[0],w[1]);return u(function(){E.hasValue=!0,E.value=N},[N]),h(N),N},Qd}var q0;function CA(){return q0||(q0=1,Zd.exports=MA()),Zd.exports}var OA=CA();const zA=jv(OA),DA={},V0=t=>{let n;const s=new Set,a=(v,g)=>{const y=typeof v=="function"?v(n):v;if(!Object.is(y,n)){const S=n;n=g??(typeof y!="object"||y===null)?y:Object.assign({},n,y),s.forEach(w=>w(n,S))}},o=()=>n,h={setState:a,getState:o,getInitialState:()=>p,subscribe:v=>(s.add(v),()=>s.delete(v)),destroy:()=>{(DA?"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."),s.clear()}},p=n=t(a,o,h);return h},kA=t=>t?V0(t):V0,{useDebugValue:jA}=Jc,{useSyncExternalStoreWithSelector:RA}=zA,LA=t=>t;function qb(t,n=LA,s){const a=RA(t.subscribe,t.getState,t.getServerState||t.getInitialState,n,s);return jA(a),a}const Y0=(t,n)=>{const s=kA(t),a=(o,c=n)=>qb(s,o,c);return Object.assign(a,s),a},BA=(t,n)=>t?Y0(t,n):Y0;function tt(t,n){if(Object.is(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(const[a,o]of t)if(!Object.is(o,n.get(a)))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(const a of t)if(!n.has(a))return!1;return!0}const s=Object.keys(t);if(s.length!==Object.keys(n).length)return!1;for(const a of s)if(!Object.prototype.hasOwnProperty.call(n,a)||!Object.is(t[a],n[a]))return!1;return!0}var HA=Rv();const au=V.createContext(null),$A=au.Provider,Vb=On.error001("react");function Re(t,n){const s=V.useContext(au);if(s===null)throw new Error(Vb);return qb(s,t,n)}function it(){const t=V.useContext(au);if(t===null)throw new Error(Vb);return V.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const G0={display:"none"},UA={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Yb="react-flow__node-desc",Gb="react-flow__edge-desc",qA="react-flow__aria-live",VA=t=>t.ariaLiveMessage,YA=t=>t.ariaLabelConfig;function GA({rfId:t}){const n=Re(VA);return x.jsx("div",{id:`${qA}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:UA,children:n})}function IA({rfId:t,disableKeyboardA11y:n}){const s=Re(YA);return x.jsxs(x.Fragment,{children:[x.jsx("div",{id:`${Yb}-${t}`,style:G0,children:n?s["node.a11yDescription.default"]:s["node.a11yDescription.keyboardDisabled"]}),x.jsx("div",{id:`${Gb}-${t}`,style:G0,children:s["edge.a11yDescription.default"]}),!n&&x.jsx(GA,{rfId:t})]})}const ou=V.forwardRef(({position:t="top-left",children:n,className:s,style:a,...o},c)=>{const u=`${t}`.split("-");return x.jsx("div",{className:gt(["react-flow__panel",s,...u]),style:a,ref:c,...o,children:n})});ou.displayName="Panel";function XA({proOptions:t,position:n="bottom-right"}){return t?.hideAttribution?null:x.jsx(ou,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:x.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const KA=t=>{const n=[],s=[];for(const[,a]of t.nodeLookup)a.selected&&n.push(a.internals.userNode);for(const[,a]of t.edgeLookup)a.selected&&s.push(a);return{selectedNodes:n,selectedEdges:s}},gc=t=>t.id;function ZA(t,n){return tt(t.selectedNodes.map(gc),n.selectedNodes.map(gc))&&tt(t.selectedEdges.map(gc),n.selectedEdges.map(gc))}function QA({onSelectionChange:t}){const n=it(),{selectedNodes:s,selectedEdges:a}=Re(KA,ZA);return V.useEffect(()=>{const o={nodes:s,edges:a};t?.(o),n.getState().onSelectionChangeHandlers.forEach(c=>c(o))},[s,a,t]),null}const FA=t=>!!t.onSelectionChangeHandlers;function JA({onSelectionChange:t}){const n=Re(FA);return t||n?x.jsx(QA,{onSelectionChange:t}):null}const Ib=[0,0],WA={x:0,y:0,zoom:1},PA=["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"],I0=[...PA,"rfId"],eT=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),X0={translateExtent:bo,nodeOrigin:Ib,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function tT(t){const{setNodes:n,setEdges:s,setMinZoom:a,setMaxZoom:o,setTranslateExtent:c,setNodeExtent:u,reset:d,setDefaultNodesAndEdges:h}=Re(eT,tt),p=it();V.useEffect(()=>(h(t.defaultNodes,t.defaultEdges),()=>{v.current=X0,d()}),[]);const v=V.useRef(X0);return V.useEffect(()=>{for(const g of I0){const y=t[g],S=v.current[g];y!==S&&(typeof t[g]>"u"||(g==="nodes"?n(y):g==="edges"?s(y):g==="minZoom"?a(y):g==="maxZoom"?o(y):g==="translateExtent"?c(y):g==="nodeExtent"?u(y):g==="ariaLabelConfig"?p.setState({ariaLabelConfig:H_(y)}):g==="fitView"?p.setState({fitViewQueued:y}):g==="fitViewOptions"?p.setState({fitViewOptions:y}):p.setState({[g]:y})))}v.current=t},I0.map(g=>t[g])),null}function K0(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function nT(t){const[n,s]=V.useState(t==="system"?null:t);return V.useEffect(()=>{if(t!=="system"){s(t);return}const a=K0(),o=()=>s(a?.matches?"dark":"light");return o(),a?.addEventListener("change",o),()=>{a?.removeEventListener("change",o)}},[t]),n!==null?n:K0()?.matches?"dark":"light"}const Z0=typeof document<"u"?document:null;function No(t=null,n={target:Z0,actInsideInputWithModifier:!0}){const[s,a]=V.useState(!1),o=V.useRef(!1),c=V.useRef(new Set([])),[u,d]=V.useMemo(()=>{if(t!==null){const p=(Array.isArray(t)?t:[t]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
|
|
10
|
+
`).replace(`
|
|
11
|
+
|
|
12
|
+
`,`
|
|
13
|
+
+`).split(`
|
|
14
|
+
`)),v=p.reduce((g,y)=>g.concat(...y),[]);return[p,v]}return[[],[]]},[t]);return V.useEffect(()=>{const h=n?.target??Z0,p=n?.actInsideInputWithModifier??!0;if(t!==null){const v=S=>{if(o.current=S.ctrlKey||S.metaKey||S.shiftKey||S.altKey,(!o.current||o.current&&!p)&&Nb(S))return!1;const E=F0(S.code,d);if(c.current.add(S[E]),Q0(u,c.current,!1)){const N=S.composedPath?.()?.[0]||S.target,C=N?.nodeName==="BUTTON"||N?.nodeName==="A";n.preventDefault!==!1&&(o.current||!C)&&S.preventDefault(),a(!0)}},g=S=>{const w=F0(S.code,d);Q0(u,c.current,!0)?(a(!1),c.current.clear()):c.current.delete(S[w]),S.key==="Meta"&&c.current.clear(),o.current=!1},y=()=>{c.current.clear(),a(!1)};return h?.addEventListener("keydown",v),h?.addEventListener("keyup",g),window.addEventListener("blur",y),window.addEventListener("contextmenu",y),()=>{h?.removeEventListener("keydown",v),h?.removeEventListener("keyup",g),window.removeEventListener("blur",y),window.removeEventListener("contextmenu",y)}}},[t,a]),s}function Q0(t,n,s){return t.filter(a=>s||a.length===n.size).some(a=>a.every(o=>n.has(o)))}function F0(t,n){return n.includes(t)?"code":"key"}const iT=()=>{const t=it();return V.useMemo(()=>({zoomIn:async n=>{const{panZoom:s}=t.getState();return s?s.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:s}=t.getState();return s?s.scaleBy(1/1.2,n):!1},zoomTo:async(n,s)=>{const{panZoom:a}=t.getState();return a?a.scaleTo(n,s):!1},getZoom:()=>t.getState().transform[2],setViewport:async(n,s)=>{const{transform:[a,o,c],panZoom:u}=t.getState();return u?(await u.setViewport({x:n.x??a,y:n.y??o,zoom:n.zoom??c},s),!0):!1},getViewport:()=>{const[n,s,a]=t.getState().transform;return{x:n,y:s,zoom:a}},setCenter:async(n,s,a)=>t.getState().setCenter(n,s,a),fitBounds:async(n,s)=>{const{width:a,height:o,minZoom:c,maxZoom:u,panZoom:d}=t.getState(),h=Gh(n,a,o,c,u,s?.padding??.1);return d?(await d.setViewport(h,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),!0):!1},screenToFlowPosition:(n,s={})=>{const{transform:a,snapGrid:o,snapToGrid:c,domNode:u}=t.getState();if(!u)return n;const{x:d,y:h}=u.getBoundingClientRect(),p={x:n.x-d,y:n.y-h},v=s.snapGrid??o,g=s.snapToGrid??c;return Fl(p,a,g,v)},flowToScreenPosition:n=>{const{transform:s,domNode:a}=t.getState();if(!a)return n;const{x:o,y:c}=a.getBoundingClientRect(),u=Xl(n,s);return{x:u.x+o,y:u.y+c}}}),[])};function Xb(t,n){const s=[],a=new Map,o=[];for(const c of t)if(c.type==="add"){o.push(c);continue}else if(c.type==="remove"||c.type==="replace")a.set(c.id,[c]);else{const u=a.get(c.id);u?u.push(c):a.set(c.id,[c])}for(const c of n){const u=a.get(c.id);if(!u){s.push(c);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){s.push({...u[0].item});continue}const d={...c};for(const h of u)sT(h,d);s.push(d)}return o.length&&o.forEach(c=>{c.index!==void 0?s.splice(c.index,0,{...c.item}):s.push({...c.item})}),s}function sT(t,n){switch(t.type){case"select":{n.selected=t.selected;break}case"position":{typeof t.position<"u"&&(n.position=t.position),typeof t.dragging<"u"&&(n.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(n.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(n.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(n.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(n.resizing=t.resizing);break}}}function lT(t,n){return Xb(t,n)}function aT(t,n){return Xb(t,n)}function Ns(t,n){return{id:t,type:"select",selected:n}}function Ml(t,n=new Set,s=!1){const a=[];for(const[o,c]of t){const u=n.has(o);!(c.selected===void 0&&!u)&&c.selected!==u&&(s&&(c.selected=u),a.push(Ns(c.id,u)))}return a}function J0({items:t=[],lookup:n}){const s=[],a=new Map(t.map(o=>[o.id,o]));for(const[o,c]of t.entries()){const u=n.get(c.id),d=u?.internals?.userNode??u;d!==void 0&&d!==c&&s.push({id:c.id,item:c,type:"replace"}),d===void 0&&s.push({item:c,type:"add",index:o})}for(const[o]of n)a.get(o)===void 0&&s.push({id:o,type:"remove"});return s}function W0(t){return{id:t.id,type:"remove"}}const oT=Sb();function rT(t,n,s={}){return G_(t,n,{...s,onError:s.onError??oT})}const P0=t=>C_(t),cT=t=>gb(t);function Kb(t){return V.forwardRef(t)}const uT=typeof window<"u"?V.useLayoutEffect:V.useEffect;function ev(t){const[n,s]=V.useState(BigInt(0)),[a]=V.useState(()=>fT(()=>s(o=>o+BigInt(1))));return uT(()=>{const o=a.get();o.length&&(t(o),a.reset())},[n]),a}function fT(t){let n=[];return{get:()=>n,reset:()=>{n=[]},push:s=>{n.push(s),t()}}}const Zb=V.createContext(null);function dT({children:t}){const n=it(),s=V.useCallback(d=>{const{nodes:h=[],setNodes:p,hasDefaultNodes:v,onNodesChange:g,nodeLookup:y,fitViewQueued:S,onNodesChangeMiddlewareMap:w}=n.getState();let E=h;for(const C of d)E=typeof C=="function"?C(E):C;let N=J0({items:E,lookup:y});for(const C of w.values())N=C(N);v&&p(E),N.length>0?g?.(N):S&&window.requestAnimationFrame(()=>{const{fitViewQueued:C,nodes:j,setNodes:_}=n.getState();C&&_(j)})},[]),a=ev(s),o=V.useCallback(d=>{const{edges:h=[],setEdges:p,hasDefaultEdges:v,onEdgesChange:g,edgeLookup:y}=n.getState();let S=h;for(const w of d)S=typeof w=="function"?w(S):w;v?p(S):g&&g(J0({items:S,lookup:y}))},[]),c=ev(o),u=V.useMemo(()=>({nodeQueue:a,edgeQueue:c}),[]);return x.jsx(Zb.Provider,{value:u,children:t})}function hT(){const t=V.useContext(Zb);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const mT=t=>!!t.panZoom;function ru(){const t=iT(),n=it(),s=hT(),a=Re(mT),o=V.useMemo(()=>{const c=g=>n.getState().nodeLookup.get(g),u=g=>{s.nodeQueue.push(g)},d=g=>{s.edgeQueue.push(g)},h=g=>{const{nodeLookup:y,nodeOrigin:S}=n.getState(),w=P0(g)?g:y.get(g.id),E=w.parentId?xb(w.position,w.measured,w.parentId,y,S):w.position,N={...w,position:E,width:w.measured?.width??w.width,height:w.measured?.height??w.height};return Il(N)},p=(g,y,S={replace:!1})=>{u(w=>w.map(E=>{if(E.id===g){const N=typeof y=="function"?y(E):y;return S.replace&&P0(N)?N:{...E,...N}}return E}))},v=(g,y,S={replace:!1})=>{d(w=>w.map(E=>{if(E.id===g){const N=typeof y=="function"?y(E):y;return S.replace&&cT(N)?N:{...E,...N}}return E}))};return{getNodes:()=>n.getState().nodes.map(g=>({...g})),getNode:g=>c(g)?.internals.userNode,getInternalNode:c,getEdges:()=>{const{edges:g=[]}=n.getState();return g.map(y=>({...y}))},getEdge:g=>n.getState().edgeLookup.get(g),setNodes:u,setEdges:d,addNodes:g=>{const y=Array.isArray(g)?g:[g];s.nodeQueue.push(S=>[...S,...y])},addEdges:g=>{const y=Array.isArray(g)?g:[g];s.edgeQueue.push(S=>[...S,...y])},toObject:()=>{const{nodes:g=[],edges:y=[],transform:S}=n.getState(),[w,E,N]=S;return{nodes:g.map(C=>({...C})),edges:y.map(C=>({...C})),viewport:{x:w,y:E,zoom:N}}},deleteElements:async({nodes:g=[],edges:y=[]})=>{const{nodes:S,edges:w,onNodesDelete:E,onEdgesDelete:N,triggerNodeChanges:C,triggerEdgeChanges:j,onDelete:_,onBeforeDelete:A}=n.getState(),{nodes:T,edges:M}=await j_({nodesToRemove:g,edgesToRemove:y,nodes:S,edges:w,onBeforeDelete:A}),k=M.length>0,R=T.length>0;if(k){const U=M.map(W0);N?.(M),j(U)}if(R){const U=T.map(W0);E?.(T),C(U)}return(R||k)&&_?.({nodes:T,edges:M}),{deletedNodes:T,deletedEdges:M}},getIntersectingNodes:(g,y=!0,S)=>{const w=_0(g),E=w?g:h(g),N=S!==void 0;return E?(S||n.getState().nodes).filter(C=>{const j=n.getState().nodeLookup.get(C.id);if(j&&!w&&(C.id===g.id||!j.internals.positionAbsolute))return!1;const _=Il(N?C:j),A=xo(_,E);return y&&A>0||A>=_.width*_.height||A>=E.width*E.height}):[]},isNodeIntersecting:(g,y,S=!0)=>{const E=_0(g)?g:h(g);if(!E)return!1;const N=xo(E,y);return S&&N>0||N>=y.width*y.height||N>=E.width*E.height},updateNode:p,updateNodeData:(g,y,S={replace:!1})=>{p(g,w=>{const E=typeof y=="function"?y(w):y;return S.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},S)},updateEdge:v,updateEdgeData:(g,y,S={replace:!1})=>{v(g,w=>{const E=typeof y=="function"?y(w):y;return S.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},S)},getNodesBounds:g=>{const{nodeLookup:y,nodeOrigin:S}=n.getState();return O_(g,{nodeLookup:y,nodeOrigin:S})},getHandleConnections:({type:g,id:y,nodeId:S})=>Array.from(n.getState().connectionLookup.get(`${S}-${g}${y?`-${y}`:""}`)?.values()??[]),getNodeConnections:({type:g,handleId:y,nodeId:S})=>Array.from(n.getState().connectionLookup.get(`${S}${g?y?`-${g}-${y}`:`-${g}`:""}`)?.values()??[]),fitView:async g=>{const y=n.getState().fitViewResolver??B_();return n.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:y}),s.nodeQueue.push(S=>[...S]),y.promise}}},[]);return V.useMemo(()=>({...o,...t,viewportInitialized:a}),[a])}const tv=t=>t.selected,pT=typeof window<"u"?window:void 0;function gT({deleteKeyCode:t,multiSelectionKeyCode:n}){const s=it(),{deleteElements:a}=ru(),o=No(t,{actInsideInputWithModifier:!1}),c=No(n,{target:pT});V.useEffect(()=>{if(o){const{edges:u,nodes:d}=s.getState();a({nodes:d.filter(tv),edges:u.filter(tv)}),s.setState({nodesSelectionActive:!1})}},[o]),V.useEffect(()=>{s.setState({multiSelectionActive:c})},[c])}function yT(t){const n=it();V.useEffect(()=>{const s=()=>{if(!t.current||!(t.current.checkVisibility?.()??!0))return!1;const a=Ih(t.current);(a.height===0||a.width===0)&&n.getState().onError?.("004",On.error004()),n.setState({width:a.width||500,height:a.height||500})};if(t.current){s(),window.addEventListener("resize",s);const a=new ResizeObserver(()=>s());return a.observe(t.current),()=>{window.removeEventListener("resize",s),a&&t.current&&a.unobserve(t.current)}}},[])}const cu={position:"absolute",width:"100%",height:"100%",top:0,left:0},vT=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function bT({onPaneContextMenu:t,zoomOnScroll:n=!0,zoomOnPinch:s=!0,panOnScroll:a=!1,panOnScrollSpeed:o=.5,panOnScrollMode:c=Os.Free,zoomOnDoubleClick:u=!0,panOnDrag:d=!0,defaultViewport:h,translateExtent:p,minZoom:v,maxZoom:g,zoomActivationKeyCode:y,preventScrolling:S=!0,children:w,noWheelClassName:E,noPanClassName:N,onViewportChange:C,isControlledViewport:j,paneClickDistance:_,selectionOnDrag:A}){const T=it(),M=V.useRef(null),{userSelectionActive:k,lib:R,connectionInProgress:U}=Re(vT,tt),te=No(y),Y=V.useRef();yT(M);const X=V.useCallback(W=>{C?.({x:W[0],y:W[1],zoom:W[2]}),j||T.setState({transform:W})},[C,j]);return V.useEffect(()=>{if(M.current){Y.current=SA({domNode:M.current,minZoom:v,maxZoom:g,translateExtent:p,viewport:h,onDraggingChange:z=>T.setState(B=>B.paneDragging===z?B:{paneDragging:z}),onPanZoomStart:(z,B)=>{const{onViewportChangeStart:I,onMoveStart:Q}=T.getState();Q?.(z,B),I?.(B)},onPanZoom:(z,B)=>{const{onViewportChange:I,onMove:Q}=T.getState();Q?.(z,B),I?.(B)},onPanZoomEnd:(z,B)=>{const{onViewportChangeEnd:I,onMoveEnd:Q}=T.getState();Q?.(z,B),I?.(B)}});const{x:W,y:L,zoom:G}=Y.current.getViewport();return T.setState({panZoom:Y.current,transform:[W,L,G],domNode:M.current.closest(".react-flow")}),()=>{Y.current?.destroy()}}},[]),V.useEffect(()=>{Y.current?.update({onPaneContextMenu:t,zoomOnScroll:n,zoomOnPinch:s,panOnScroll:a,panOnScrollSpeed:o,panOnScrollMode:c,zoomOnDoubleClick:u,panOnDrag:d,zoomActivationKeyPressed:te,preventScrolling:S,noPanClassName:N,userSelectionActive:k,noWheelClassName:E,lib:R,onTransformChange:X,connectionInProgress:U,selectionOnDrag:A,paneClickDistance:_})},[t,n,s,a,o,c,u,d,te,S,N,k,E,R,X,U,A,_]),x.jsx("div",{className:"react-flow__renderer",ref:M,style:cu,children:w})}const ST=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function wT(){const{userSelectionActive:t,userSelectionRect:n}=Re(ST,tt);return t&&n?x.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Wd=(t,n)=>s=>{s.target===n.current&&t?.(s)},xT=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging,panBy:t.panBy,autoPanSpeed:t.autoPanSpeed});function ET({isSelecting:t,selectionKeyPressed:n,selectionMode:s=So.Full,panOnDrag:a,autoPanOnSelection:o,paneClickDistance:c,selectionOnDrag:u,onSelectionStart:d,onSelectionEnd:h,onPaneClick:p,onPaneContextMenu:v,onPaneScroll:g,onPaneMouseEnter:y,onPaneMouseMove:S,onPaneMouseLeave:w,children:E}){const N=V.useRef(0),C=it(),{userSelectionActive:j,elementsSelectable:_,dragging:A,connectionInProgress:T,panBy:M,autoPanSpeed:k}=Re(xT,tt),R=_&&(t||j),U=V.useRef(null),te=V.useRef(),Y=V.useRef(new Set),X=V.useRef(new Set),W=V.useRef(!1),L=V.useRef({x:0,y:0}),G=V.useRef(!1),z=K=>{if(W.current||T){W.current=!1;return}p?.(K),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},B=K=>{if(Array.isArray(a)&&a?.includes(2)){K.preventDefault();return}v?.(K)},I=g?K=>g(K):void 0,Q=K=>{W.current&&(K.stopPropagation(),W.current=!1)},se=K=>{const{domNode:ue,transform:pe}=C.getState();if(te.current=ue?.getBoundingClientRect(),!te.current)return;const xe=K.target===U.current;if(!xe&&!!K.target.closest(".nokey")||!t||!(u&&xe||n)||K.button!==0||!K.isPrimary)return;K.target?.setPointerCapture?.(K.pointerId),W.current=!1;const{x:Ee,y:ze}=Cn(K.nativeEvent,te.current),Ie=Fl({x:Ee,y:ze},pe);C.setState({userSelectionRect:{width:0,height:0,startX:Ie.x,startY:Ie.y,x:Ee,y:ze}}),xe||(K.stopPropagation(),K.preventDefault())};function D(K,ue){const{userSelectionRect:pe}=C.getState();if(!pe)return;const{transform:xe,nodeLookup:de,edgeLookup:be,connectionLookup:Ee,triggerNodeChanges:ze,triggerEdgeChanges:Ie,defaultEdgeOptions:wt}=C.getState(),We={x:pe.startX,y:pe.startY},{x:yt,y:Et}=Xl(We,xe),zt={startX:We.x,startY:We.y,x:K<yt?K:yt,y:ue<Et?ue:Et,width:Math.abs(K-yt),height:Math.abs(ue-Et)},Yn=Y.current,$t=X.current;Y.current=new Set(Vh(de,zt,xe,s===So.Partial,!0).map(rt=>rt.id)),X.current=new Set;const Pe=wt?.selectable??!0;for(const rt of Y.current){const Lt=Ee.get(rt);if(Lt)for(const{edgeId:Qe}of Lt.values()){const Dt=be.get(Qe);Dt&&(Dt.selectable??Pe)&&X.current.add(Qe)}}if(!A0(Yn,Y.current)){const rt=Ml(de,Y.current,!0);ze(rt)}if(!A0($t,X.current)){const rt=Ml(be,X.current);Ie(rt)}C.setState({userSelectionRect:zt,userSelectionActive:!0,nodesSelectionActive:!1})}function $(){if(!o||!te.current)return;const[K,ue]=Yh(L.current,te.current,k);M({x:K,y:ue}).then(pe=>{if(!W.current||!pe){N.current=requestAnimationFrame($);return}const{x:xe,y:de}=L.current;D(xe,de),N.current=requestAnimationFrame($)})}const ne=()=>{cancelAnimationFrame(N.current),N.current=0,G.current=!1};V.useEffect(()=>()=>ne(),[]);const ie=K=>{const{userSelectionRect:ue,transform:pe,resetSelectedElements:xe}=C.getState();if(!te.current||!ue)return;const{x:de,y:be}=Cn(K.nativeEvent,te.current);L.current={x:de,y:be};const Ee=Xl({x:ue.startX,y:ue.startY},pe);if(!W.current){const ze=n?0:c;if(Math.hypot(de-Ee.x,be-Ee.y)<=ze)return;xe(),d?.(K)}W.current=!0,G.current||($(),G.current=!0),D(de,be)},ce=K=>{K.button===0&&(K.target?.releasePointerCapture?.(K.pointerId),!j&&K.target===U.current&&C.getState().userSelectionRect&&z?.(K),C.setState({userSelectionActive:!1,userSelectionRect:null}),W.current&&(h?.(K),C.setState({nodesSelectionActive:Y.current.size>0})),ne())},he=K=>{K.target?.releasePointerCapture?.(K.pointerId),ne()},fe=a===!0||Array.isArray(a)&&a.includes(0);return x.jsxs("div",{className:gt(["react-flow__pane",{draggable:fe,dragging:A,selection:t}]),onClick:R?void 0:Wd(z,U),onContextMenu:Wd(B,U),onWheel:Wd(I,U),onPointerEnter:R?void 0:y,onPointerMove:R?ie:S,onPointerUp:R?ce:void 0,onPointerCancel:R?he:void 0,onPointerDownCapture:R?se:void 0,onClickCapture:R?Q:void 0,onPointerLeave:w,ref:U,style:cu,children:[E,x.jsx(wT,{})]})}function xh({id:t,store:n,unselect:s=!1,nodeRef:a}){const{addSelectedNodes:o,unselectNodesAndEdges:c,multiSelectionActive:u,nodeLookup:d,onError:h}=n.getState(),p=d.get(t);if(!p){h?.("012",On.error012(t));return}n.setState({nodesSelectionActive:!1}),p.selected?(s||p.selected&&u)&&(c({nodes:[p],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):o([t])}function Qb({nodeRef:t,disabled:n=!1,noDragClassName:s,handleSelector:a,nodeId:o,isSelectable:c,nodeClickDistance:u}){const d=it(),[h,p]=V.useState(!1),v=V.useRef();return V.useEffect(()=>{v.current=aA({getStoreItems:()=>d.getState(),onNodeMouseDown:g=>{xh({id:g,store:d,nodeRef:t})},onDragStart:()=>{p(!0)},onDragStop:()=>{p(!1)}})},[]),V.useEffect(()=>{if(!(n||!t.current||!v.current))return v.current.update({noDragClassName:s,handleSelector:a,domNode:t.current,isSelectable:c,nodeId:o,nodeClickDistance:u}),()=>{v.current?.destroy()}},[s,a,n,c,t,o,u]),h}const NT=t=>n=>n.selected&&(n.draggable||t&&typeof n.draggable>"u");function Fb(){const t=it();return V.useCallback(s=>{const{nodeExtent:a,snapToGrid:o,snapGrid:c,nodesDraggable:u,onError:d,updateNodePositions:h,nodeLookup:p,nodeOrigin:v}=t.getState(),g=new Map,y=NT(u),S=o?c[0]:5,w=o?c[1]:5,E=s.direction.x*S*s.factor,N=s.direction.y*w*s.factor;for(const[,C]of p){if(!y(C))continue;let j={x:C.internals.positionAbsolute.x+E,y:C.internals.positionAbsolute.y+N};o&&(j=Ro(j,c));const{position:_,positionAbsolute:A}=yb({nodeId:C.id,nextPosition:j,nodeLookup:p,nodeExtent:a,nodeOrigin:v,onError:d});C.position=_,C.internals.positionAbsolute=A,g.set(C.id,C)}h(g)},[])}const Jh=V.createContext(null),_T=Jh.Provider;Jh.Consumer;const Jb=()=>V.useContext(Jh),AT=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),TT=(t,n,s)=>a=>{const{connectionClickStartHandle:o,connectionMode:c,connection:u}=a,{fromHandle:d,toHandle:h,isValid:p}=u,v=h?.nodeId===t&&h?.id===n&&h?.type===s;return{connectingFrom:d?.nodeId===t&&d?.id===n&&d?.type===s,connectingTo:v,clickConnecting:o?.nodeId===t&&o?.id===n&&o?.type===s,isPossibleEndHandle:c===Yl.Strict?d?.type!==s:t!==d?.nodeId||n!==d?.id,connectionInProcess:!!d,clickConnectionInProcess:!!o,valid:v&&p}};function MT({type:t="source",position:n=me.Top,isValidConnection:s,isConnectable:a=!0,isConnectableStart:o=!0,isConnectableEnd:c=!0,id:u,onConnect:d,children:h,className:p,onMouseDown:v,onTouchStart:g,...y},S){const w=u||null,E=t==="target",N=it(),C=Jb(),{connectOnClick:j,noPanClassName:_,rfId:A}=Re(AT,tt),{connectingFrom:T,connectingTo:M,clickConnecting:k,isPossibleEndHandle:R,connectionInProcess:U,clickConnectionInProcess:te,valid:Y}=Re(TT(C,w,t),tt);C||N.getState().onError?.("010",On.error010());const X=G=>{const{defaultEdgeOptions:z,onConnect:B,hasDefaultEdges:I}=N.getState(),Q={...z,...G};if(I){const{edges:se,setEdges:D,onError:$}=N.getState();D(rT(Q,se,{onError:$}))}B?.(Q),d?.(Q)},W=G=>{if(!C)return;const z=_b(G.nativeEvent);if(o&&(z&&G.button===0||!z)){const B=N.getState();wh.onPointerDown(G.nativeEvent,{handleDomNode:G.currentTarget,autoPanOnConnect:B.autoPanOnConnect,connectionMode:B.connectionMode,connectionRadius:B.connectionRadius,domNode:B.domNode,nodeLookup:B.nodeLookup,lib:B.lib,isTarget:E,handleId:w,nodeId:C,flowId:B.rfId,panBy:B.panBy,cancelConnection:B.cancelConnection,onConnectStart:B.onConnectStart,onConnectEnd:(...I)=>N.getState().onConnectEnd?.(...I),updateConnection:B.updateConnection,onConnect:X,isValidConnection:s||((...I)=>N.getState().isValidConnection?.(...I)??!0),getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:B.autoPanSpeed,dragThreshold:B.connectionDragThreshold})}z?v?.(G):g?.(G)},L=G=>{const{onClickConnectStart:z,onClickConnectEnd:B,connectionClickStartHandle:I,connectionMode:Q,isValidConnection:se,lib:D,rfId:$,nodeLookup:ne,connection:ie}=N.getState();if(!C||!I&&!o)return;if(!I){z?.(G.nativeEvent,{nodeId:C,handleId:w,handleType:t}),N.setState({connectionClickStartHandle:{nodeId:C,type:t,id:w}});return}const ce=Eb(G.target),he=s||se,{connection:fe,isValid:K}=wh.isValid(G.nativeEvent,{handle:{nodeId:C,id:w,type:t},connectionMode:Q,fromNodeId:I.nodeId,fromHandleId:I.id||null,fromType:I.type,isValidConnection:he,flowId:$,doc:ce,lib:D,nodeLookup:ne});K&&fe&&X(fe);const ue=structuredClone(ie);delete ue.inProgress,ue.toPosition=ue.toHandle?ue.toHandle.position:null,B?.(G,ue),N.setState({connectionClickStartHandle:null})};return x.jsx("div",{"data-handleid":w,"data-nodeid":C,"data-handlepos":n,"data-id":`${A}-${C}-${w}-${t}`,className:gt(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",_,p,{source:!E,target:E,connectable:a,connectablestart:o,connectableend:c,clickconnecting:k,connectingfrom:T,connectingto:M,valid:Y,connectionindicator:a&&(!U||R)&&(U||te?c:o)}]),onMouseDown:W,onTouchStart:W,onClick:j?L:void 0,ref:S,...y,children:h})}const gn=V.memo(Kb(MT));function CT({data:t,isConnectable:n,sourcePosition:s=me.Bottom}){return x.jsxs(x.Fragment,{children:[t?.label,x.jsx(gn,{type:"source",position:s,isConnectable:n})]})}function OT({data:t,isConnectable:n,targetPosition:s=me.Top,sourcePosition:a=me.Bottom}){return x.jsxs(x.Fragment,{children:[x.jsx(gn,{type:"target",position:s,isConnectable:n}),t?.label,x.jsx(gn,{type:"source",position:a,isConnectable:n})]})}function zT(){return null}function DT({data:t,isConnectable:n,targetPosition:s=me.Top}){return x.jsxs(x.Fragment,{children:[x.jsx(gn,{type:"target",position:s,isConnectable:n}),t?.label]})}const Gc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},nv={input:CT,default:OT,output:DT,group:zT};function kT(t){return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??t.style?.width,height:t.height??t.initialHeight??t.style?.height}:{width:t.width??t.style?.width,height:t.height??t.style?.height}}const jT=t=>{const{width:n,height:s,x:a,y:o}=jo(t.nodeLookup,{filter:c=>!!c.selected});return{width:Mn(n)?n:null,height:Mn(s)?s:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${a}px,${o}px)`}};function RT({onSelectionContextMenu:t,noPanClassName:n,disableKeyboardA11y:s}){const a=it(),{width:o,height:c,transformString:u,userSelectionActive:d}=Re(jT,tt),h=Fb(),p=V.useRef(null);V.useEffect(()=>{s||p.current?.focus({preventScroll:!0})},[s]);const v=!d&&o!==null&&c!==null;if(Qb({nodeRef:p,disabled:!v}),!v)return null;const g=t?S=>{const w=a.getState().nodes.filter(E=>E.selected);t(S,w)}:void 0,y=S=>{Object.prototype.hasOwnProperty.call(Gc,S.key)&&(S.preventDefault(),h({direction:Gc[S.key],factor:S.shiftKey?4:1}))};return x.jsx("div",{className:gt(["react-flow__nodesselection","react-flow__container",n]),style:{transform:u},children:x.jsx("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:s?void 0:-1,onKeyDown:s?void 0:y,style:{width:o,height:c}})})}const iv=typeof window<"u"?window:void 0,LT=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function Wb({children:t,onPaneClick:n,onPaneMouseEnter:s,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:c,onPaneScroll:u,paneClickDistance:d,deleteKeyCode:h,selectionKeyCode:p,selectionOnDrag:v,selectionMode:g,onSelectionStart:y,onSelectionEnd:S,multiSelectionKeyCode:w,panActivationKeyCode:E,zoomActivationKeyCode:N,elementsSelectable:C,zoomOnScroll:j,zoomOnPinch:_,panOnScroll:A,panOnScrollSpeed:T,panOnScrollMode:M,zoomOnDoubleClick:k,panOnDrag:R,autoPanOnSelection:U,defaultViewport:te,translateExtent:Y,minZoom:X,maxZoom:W,preventScrolling:L,onSelectionContextMenu:G,noWheelClassName:z,noPanClassName:B,disableKeyboardA11y:I,onViewportChange:Q,isControlledViewport:se}){const{nodesSelectionActive:D,userSelectionActive:$}=Re(LT,tt),ne=No(p,{target:iv}),ie=No(E,{target:iv}),ce=ie||R,he=ie||A,fe=v&&ce!==!0,K=ne||$||fe;return gT({deleteKeyCode:h,multiSelectionKeyCode:w}),x.jsx(bT,{onPaneContextMenu:c,elementsSelectable:C,zoomOnScroll:j,zoomOnPinch:_,panOnScroll:he,panOnScrollSpeed:T,panOnScrollMode:M,zoomOnDoubleClick:k,panOnDrag:!ne&&ce,defaultViewport:te,translateExtent:Y,minZoom:X,maxZoom:W,zoomActivationKeyCode:N,preventScrolling:L,noWheelClassName:z,noPanClassName:B,onViewportChange:Q,isControlledViewport:se,paneClickDistance:d,selectionOnDrag:fe,children:x.jsxs(ET,{onSelectionStart:y,onSelectionEnd:S,onPaneClick:n,onPaneMouseEnter:s,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:c,onPaneScroll:u,panOnDrag:ce,autoPanOnSelection:U,isSelecting:!!K,selectionMode:g,selectionKeyPressed:ne,paneClickDistance:d,selectionOnDrag:fe,children:[t,D&&x.jsx(RT,{onSelectionContextMenu:G,noPanClassName:B,disableKeyboardA11y:I})]})})}Wb.displayName="FlowRenderer";const BT=V.memo(Wb),HT=t=>n=>t?Vh(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(s=>s.id):Array.from(n.nodeLookup.keys());function $T(t){return Re(V.useCallback(HT(t),[t]),tt)}const UT=t=>t.updateNodeInternals;function qT(){const t=Re(UT),[n]=V.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(s=>{const a=new Map;s.forEach(o=>{const c=o.target.getAttribute("data-id");a.set(c,{id:c,nodeElement:o.target,force:!0})}),t(a)}));return V.useEffect(()=>()=>{n?.disconnect()},[n]),n}function VT({node:t,nodeType:n,hasDimensions:s,resizeObserver:a}){const o=it(),c=V.useRef(null),u=V.useRef(null),d=V.useRef(t.sourcePosition),h=V.useRef(t.targetPosition),p=V.useRef(n),v=s&&!!t.internals.handleBounds;return V.useEffect(()=>{c.current&&!t.hidden&&(!v||u.current!==c.current)&&(u.current&&a?.unobserve(u.current),a?.observe(c.current),u.current=c.current)},[v,t.hidden]),V.useEffect(()=>()=>{u.current&&(a?.unobserve(u.current),u.current=null)},[]),V.useEffect(()=>{if(c.current){const g=p.current!==n,y=d.current!==t.sourcePosition,S=h.current!==t.targetPosition;(g||y||S)&&(p.current=n,d.current=t.sourcePosition,h.current=t.targetPosition,o.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:c.current,force:!0}]])))}},[t.id,n,t.sourcePosition,t.targetPosition]),c}function YT({id:t,onClick:n,onMouseEnter:s,onMouseMove:a,onMouseLeave:o,onContextMenu:c,onDoubleClick:u,nodesDraggable:d,elementsSelectable:h,nodesConnectable:p,nodesFocusable:v,resizeObserver:g,noDragClassName:y,noPanClassName:S,disableKeyboardA11y:w,rfId:E,nodeTypes:N,nodeClickDistance:C,onError:j}){const{node:_,internals:A,isParent:T}=Re(K=>{const ue=K.nodeLookup.get(t),pe=K.parentLookup.has(t);return{node:ue,internals:ue.internals,isParent:pe}},tt);let M=_.type||"default",k=N?.[M]||nv[M];k===void 0&&(j?.("003",On.error003(M)),M="default",k=N?.default||nv.default);const R=!!(_.draggable||d&&typeof _.draggable>"u"),U=!!(_.selectable||h&&typeof _.selectable>"u"),te=!!(_.connectable||p&&typeof _.connectable>"u"),Y=!!(_.focusable||v&&typeof _.focusable>"u"),X=it(),W=wb(_),L=VT({node:_,nodeType:M,hasDimensions:W,resizeObserver:g}),G=Qb({nodeRef:L,disabled:_.hidden||!R,noDragClassName:y,handleSelector:_.dragHandle,nodeId:t,isSelectable:U,nodeClickDistance:C}),z=Fb();if(_.hidden)return null;const B=yi(_),I=kT(_),Q=U||R||n||s||a||o,se=s?K=>s(K,{...A.userNode}):void 0,D=a?K=>a(K,{...A.userNode}):void 0,$=o?K=>o(K,{...A.userNode}):void 0,ne=c?K=>c(K,{...A.userNode}):void 0,ie=u?K=>u(K,{...A.userNode}):void 0,ce=K=>{const{selectNodesOnDrag:ue,nodeDragThreshold:pe}=X.getState();U&&(!ue||!R||pe>0)&&xh({id:t,store:X,nodeRef:L}),n&&n(K,{...A.userNode})},he=K=>{if(!(Nb(K.nativeEvent)||w)){if(db.includes(K.key)&&U){const ue=K.key==="Escape";xh({id:t,store:X,unselect:ue,nodeRef:L})}else if(R&&_.selected&&Object.prototype.hasOwnProperty.call(Gc,K.key)){K.preventDefault();const{ariaLabelConfig:ue}=X.getState();X.setState({ariaLiveMessage:ue["node.a11yDescription.ariaLiveMessage"]({direction:K.key.replace("Arrow","").toLowerCase(),x:~~A.positionAbsolute.x,y:~~A.positionAbsolute.y})}),z({direction:Gc[K.key],factor:K.shiftKey?4:1})}}},fe=()=>{if(w||!L.current?.matches(":focus-visible"))return;const{transform:K,width:ue,height:pe,autoPanOnNodeFocus:xe,setCenter:de}=X.getState();if(!xe)return;Vh(new Map([[t,_]]),{x:0,y:0,width:ue,height:pe},K,!0).length>0||de(_.position.x+B.width/2,_.position.y+B.height/2,{zoom:K[2]})};return x.jsx("div",{className:gt(["react-flow__node",`react-flow__node-${M}`,{[S]:R},_.className,{selected:_.selected,selectable:U,parent:T,draggable:R,dragging:G}]),ref:L,style:{zIndex:A.z,transform:`translate(${A.positionAbsolute.x}px,${A.positionAbsolute.y}px)`,pointerEvents:Q?"all":"none",visibility:W?"visible":"hidden",..._.style,...I},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:se,onMouseMove:D,onMouseLeave:$,onContextMenu:ne,onClick:ce,onDoubleClick:ie,onKeyDown:Y?he:void 0,tabIndex:Y?0:void 0,onFocus:Y?fe:void 0,role:_.ariaRole??(Y?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${Yb}-${E}`,"aria-label":_.ariaLabel,..._.domAttributes,children:x.jsx(_T,{value:t,children:x.jsx(k,{id:t,data:_.data,type:M,positionAbsoluteX:A.positionAbsolute.x,positionAbsoluteY:A.positionAbsolute.y,selected:_.selected??!1,selectable:U,draggable:R,deletable:_.deletable??!0,isConnectable:te,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:G,dragHandle:_.dragHandle,zIndex:A.z,parentId:_.parentId,...B})})})}var GT=V.memo(YT);const IT=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Pb(t){const{nodesDraggable:n,nodesConnectable:s,nodesFocusable:a,elementsSelectable:o,onError:c}=Re(IT,tt),u=$T(t.onlyRenderVisibleElements),d=qT();return x.jsx("div",{className:"react-flow__nodes",style:cu,children:u.map(h=>x.jsx(GT,{id:h,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:d,nodesDraggable:n,nodesConnectable:s,nodesFocusable:a,elementsSelectable:o,nodeClickDistance:t.nodeClickDistance,onError:c},h))})}Pb.displayName="NodeRenderer";const XT=V.memo(Pb);function KT(t){return Re(V.useCallback(s=>{if(!t)return s.edges.map(o=>o.id);const a=[];if(s.width&&s.height)for(const o of s.edges){const c=s.nodeLookup.get(o.source),u=s.nodeLookup.get(o.target);c&&u&&q_({sourceNode:c,targetNode:u,width:s.width,height:s.height,transform:s.transform})&&a.push(o.id)}return a},[t]),tt)}const ZT=({color:t="none",strokeWidth:n=1})=>{const s={strokeWidth:n,...t&&{stroke:t}};return x.jsx("polyline",{className:"arrow",style:s,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},QT=({color:t="none",strokeWidth:n=1})=>{const s={strokeWidth:n,...t&&{stroke:t,fill:t}};return x.jsx("polyline",{className:"arrowclosed",style:s,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},sv={[wo.Arrow]:ZT,[wo.ArrowClosed]:QT};function FT(t){const n=it();return V.useMemo(()=>Object.prototype.hasOwnProperty.call(sv,t)?sv[t]:(n.getState().onError?.("009",On.error009(t)),null),[t])}const JT=({id:t,type:n,color:s,width:a=12.5,height:o=12.5,markerUnits:c="strokeWidth",strokeWidth:u,orient:d="auto-start-reverse"})=>{const h=FT(n);return h?x.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${a}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:d,refX:"0",refY:"0",children:x.jsx(h,{color:s,strokeWidth:u})}):null},e1=({defaultColor:t,rfId:n})=>{const s=Re(c=>c.edges),a=Re(c=>c.defaultEdgeOptions),o=V.useMemo(()=>Q_(s,{id:n,defaultColor:t,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[s,a,n,t]);return o.length?x.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:x.jsx("defs",{children:o.map(c=>x.jsx(JT,{id:c.id,type:c.type,color:c.color,width:c.width,height:c.height,markerUnits:c.markerUnits,strokeWidth:c.strokeWidth,orient:c.orient},c.id))})}):null};e1.displayName="MarkerDefinitions";var WT=V.memo(e1);function t1({x:t,y:n,label:s,labelStyle:a,labelShowBg:o=!0,labelBgStyle:c,labelBgPadding:u=[2,4],labelBgBorderRadius:d=2,children:h,className:p,...v}){const[g,y]=V.useState({x:1,y:0,width:0,height:0}),S=gt(["react-flow__edge-textwrapper",p]),w=V.useRef(null);return V.useEffect(()=>{if(w.current){const E=w.current.getBBox();y({x:E.x,y:E.y,width:E.width,height:E.height})}},[s]),s?x.jsxs("g",{transform:`translate(${t-g.width/2} ${n-g.height/2})`,className:S,visibility:g.width?"visible":"hidden",...v,children:[o&&x.jsx("rect",{width:g.width+2*u[0],x:-u[0],y:-u[1],height:g.height+2*u[1],className:"react-flow__edge-textbg",style:c,rx:d,ry:d}),x.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:w,style:a,children:s}),h]}):null}t1.displayName="EdgeText";const PT=V.memo(t1);function Lo({path:t,labelX:n,labelY:s,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,interactionWidth:p=20,...v}){return x.jsxs(x.Fragment,{children:[x.jsx("path",{...v,d:t,fill:"none",className:gt(["react-flow__edge-path",v.className])}),p?x.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}):null,a&&Mn(n)&&Mn(s)?x.jsx(PT,{x:n,y:s,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h}):null]})}function lv({pos:t,x1:n,y1:s,x2:a,y2:o}){return t===me.Left||t===me.Right?[.5*(n+a),s]:[n,.5*(s+o)]}function n1({sourceX:t,sourceY:n,sourcePosition:s=me.Bottom,targetX:a,targetY:o,targetPosition:c=me.Top}){const[u,d]=lv({pos:s,x1:t,y1:n,x2:a,y2:o}),[h,p]=lv({pos:c,x1:a,y1:o,x2:t,y2:n}),[v,g,y,S]=Ab({sourceX:t,sourceY:n,targetX:a,targetY:o,sourceControlX:u,sourceControlY:d,targetControlX:h,targetControlY:p});return[`M${t},${n} C${u},${d} ${h},${p} ${a},${o}`,v,g,y,S]}function i1(t){return V.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,sourcePosition:u,targetPosition:d,label:h,labelStyle:p,labelShowBg:v,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:S,style:w,markerEnd:E,markerStart:N,interactionWidth:C})=>{const[j,_,A]=n1({sourceX:s,sourceY:a,sourcePosition:u,targetX:o,targetY:c,targetPosition:d}),T=t.isInternal?void 0:n;return x.jsx(Lo,{id:T,path:j,labelX:_,labelY:A,label:h,labelStyle:p,labelShowBg:v,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:S,style:w,markerEnd:E,markerStart:N,interactionWidth:C})})}const eM=i1({isInternal:!1}),s1=i1({isInternal:!0});eM.displayName="SimpleBezierEdge";s1.displayName="SimpleBezierEdgeInternal";function l1(t){return V.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:g,style:y,sourcePosition:S=me.Bottom,targetPosition:w=me.Top,markerEnd:E,markerStart:N,pathOptions:C,interactionWidth:j})=>{const[_,A,T]=vh({sourceX:s,sourceY:a,sourcePosition:S,targetX:o,targetY:c,targetPosition:w,borderRadius:C?.borderRadius,offset:C?.offset,stepPosition:C?.stepPosition}),M=t.isInternal?void 0:n;return x.jsx(Lo,{id:M,path:_,labelX:A,labelY:T,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:g,style:y,markerEnd:E,markerStart:N,interactionWidth:j})})}const a1=l1({isInternal:!1}),o1=l1({isInternal:!0});a1.displayName="SmoothStepEdge";o1.displayName="SmoothStepEdgeInternal";function r1(t){return V.memo(({id:n,...s})=>{const a=t.isInternal?void 0:n;return x.jsx(a1,{...s,id:a,pathOptions:V.useMemo(()=>({borderRadius:0,offset:s.pathOptions?.offset}),[s.pathOptions?.offset])})})}const tM=r1({isInternal:!1}),c1=r1({isInternal:!0});tM.displayName="StepEdge";c1.displayName="StepEdgeInternal";function u1(t){return V.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:g,style:y,markerEnd:S,markerStart:w,interactionWidth:E})=>{const[N,C,j]=Cb({sourceX:s,sourceY:a,targetX:o,targetY:c}),_=t.isInternal?void 0:n;return x.jsx(Lo,{id:_,path:N,labelX:C,labelY:j,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:g,style:y,markerEnd:S,markerStart:w,interactionWidth:E})})}const nM=u1({isInternal:!1}),f1=u1({isInternal:!0});nM.displayName="StraightEdge";f1.displayName="StraightEdgeInternal";function d1(t){return V.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,sourcePosition:u=me.Bottom,targetPosition:d=me.Top,label:h,labelStyle:p,labelShowBg:v,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:S,style:w,markerEnd:E,markerStart:N,pathOptions:C,interactionWidth:j})=>{const[_,A,T]=Tb({sourceX:s,sourceY:a,sourcePosition:u,targetX:o,targetY:c,targetPosition:d,curvature:C?.curvature}),M=t.isInternal?void 0:n;return x.jsx(Lo,{id:M,path:_,labelX:A,labelY:T,label:h,labelStyle:p,labelShowBg:v,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:S,style:w,markerEnd:E,markerStart:N,interactionWidth:j})})}const iM=d1({isInternal:!1}),h1=d1({isInternal:!0});iM.displayName="BezierEdge";h1.displayName="BezierEdgeInternal";const av={default:h1,straight:f1,step:c1,smoothstep:o1,simplebezier:s1},ov={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},sM=(t,n,s)=>s===me.Left?t-n:s===me.Right?t+n:t,lM=(t,n,s)=>s===me.Top?t-n:s===me.Bottom?t+n:t,rv="react-flow__edgeupdater";function cv({position:t,centerX:n,centerY:s,radius:a=10,onMouseDown:o,onMouseEnter:c,onMouseOut:u,type:d}){return x.jsx("circle",{onMouseDown:o,onMouseEnter:c,onMouseOut:u,className:gt([rv,`${rv}-${d}`]),cx:sM(n,a,t),cy:lM(s,a,t),r:a,stroke:"transparent",fill:"transparent"})}function aM({isReconnectable:t,reconnectRadius:n,edge:s,sourceX:a,sourceY:o,targetX:c,targetY:u,sourcePosition:d,targetPosition:h,onReconnect:p,onReconnectStart:v,onReconnectEnd:g,setReconnecting:y,setUpdateHover:S}){const w=it(),E=(A,T)=>{if(A.button!==0)return;const{autoPanOnConnect:M,domNode:k,connectionMode:R,connectionRadius:U,lib:te,onConnectStart:Y,cancelConnection:X,nodeLookup:W,rfId:L,panBy:G,updateConnection:z}=w.getState(),B=T.type==="target",I=(D,$)=>{y(!1),g?.(D,s,T.type,$)},Q=D=>p?.(s,D),se=(D,$)=>{y(!0),v?.(A,s,T.type),Y?.(D,$)};wh.onPointerDown(A.nativeEvent,{autoPanOnConnect:M,connectionMode:R,connectionRadius:U,domNode:k,handleId:T.id,nodeId:T.nodeId,nodeLookup:W,isTarget:B,edgeUpdaterType:T.type,lib:te,flowId:L,cancelConnection:X,panBy:G,isValidConnection:(...D)=>w.getState().isValidConnection?.(...D)??!0,onConnect:Q,onConnectStart:se,onConnectEnd:(...D)=>w.getState().onConnectEnd?.(...D),onReconnectEnd:I,updateConnection:z,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:A.currentTarget})},N=A=>E(A,{nodeId:s.target,id:s.targetHandle??null,type:"target"}),C=A=>E(A,{nodeId:s.source,id:s.sourceHandle??null,type:"source"}),j=()=>S(!0),_=()=>S(!1);return x.jsxs(x.Fragment,{children:[(t===!0||t==="source")&&x.jsx(cv,{position:d,centerX:a,centerY:o,radius:n,onMouseDown:N,onMouseEnter:j,onMouseOut:_,type:"source"}),(t===!0||t==="target")&&x.jsx(cv,{position:h,centerX:c,centerY:u,radius:n,onMouseDown:C,onMouseEnter:j,onMouseOut:_,type:"target"})]})}function oM({id:t,edgesFocusable:n,edgesReconnectable:s,elementsSelectable:a,onClick:o,onDoubleClick:c,onContextMenu:u,onMouseEnter:d,onMouseMove:h,onMouseLeave:p,reconnectRadius:v,onReconnect:g,onReconnectStart:y,onReconnectEnd:S,rfId:w,edgeTypes:E,noPanClassName:N,onError:C,disableKeyboardA11y:j}){let _=Re(de=>de.edgeLookup.get(t));const A=Re(de=>de.defaultEdgeOptions);_=A?{...A,..._}:_;let T=_.type||"default",M=E?.[T]||av[T];M===void 0&&(C?.("011",On.error011(T)),T="default",M=E?.default||av.default);const k=!!(_.focusable||n&&typeof _.focusable>"u"),R=typeof g<"u"&&(_.reconnectable||s&&typeof _.reconnectable>"u"),U=!!(_.selectable||a&&typeof _.selectable>"u"),te=V.useRef(null),[Y,X]=V.useState(!1),[W,L]=V.useState(!1),G=it(),{zIndex:z,sourceX:B,sourceY:I,targetX:Q,targetY:se,sourcePosition:D,targetPosition:$}=Re(V.useCallback(de=>{const be=de.nodeLookup.get(_.source),Ee=de.nodeLookup.get(_.target);if(!be||!Ee)return{zIndex:_.zIndex,...ov};const ze=Z_({id:t,sourceNode:be,targetNode:Ee,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:de.connectionMode,onError:C});return{zIndex:U_({selected:_.selected,zIndex:_.zIndex,sourceNode:be,targetNode:Ee,elevateOnSelect:de.elevateEdgesOnSelect,zIndexMode:de.zIndexMode}),...ze||ov}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),tt),ne=V.useMemo(()=>_.markerStart?`url('#${bh(_.markerStart,w)}')`:void 0,[_.markerStart,w]),ie=V.useMemo(()=>_.markerEnd?`url('#${bh(_.markerEnd,w)}')`:void 0,[_.markerEnd,w]);if(_.hidden||B===null||I===null||Q===null||se===null)return null;const ce=de=>{const{addSelectedEdges:be,unselectNodesAndEdges:Ee,multiSelectionActive:ze}=G.getState();U&&(G.setState({nodesSelectionActive:!1}),_.selected&&ze?(Ee({nodes:[],edges:[_]}),te.current?.blur()):be([t])),o&&o(de,_)},he=c?de=>{c(de,{..._})}:void 0,fe=u?de=>{u(de,{..._})}:void 0,K=d?de=>{d(de,{..._})}:void 0,ue=h?de=>{h(de,{..._})}:void 0,pe=p?de=>{p(de,{..._})}:void 0,xe=de=>{if(!j&&db.includes(de.key)&&U){const{unselectNodesAndEdges:be,addSelectedEdges:Ee}=G.getState();de.key==="Escape"?(te.current?.blur(),be({edges:[_]})):Ee([t])}};return x.jsx("svg",{style:{zIndex:z},children:x.jsxs("g",{className:gt(["react-flow__edge",`react-flow__edge-${T}`,_.className,N,{selected:_.selected,animated:_.animated,inactive:!U&&!o,updating:Y,selectable:U}]),onClick:ce,onDoubleClick:he,onContextMenu:fe,onMouseEnter:K,onMouseMove:ue,onMouseLeave:pe,onKeyDown:k?xe:void 0,tabIndex:k?0:void 0,role:_.ariaRole??(k?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":k?`${Gb}-${w}`:void 0,ref:te,..._.domAttributes,children:[!W&&x.jsx(M,{id:t,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:U,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:B,sourceY:I,targetX:Q,targetY:se,sourcePosition:D,targetPosition:$,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:ne,markerEnd:ie,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),R&&x.jsx(aM,{edge:_,isReconnectable:R,reconnectRadius:v,onReconnect:g,onReconnectStart:y,onReconnectEnd:S,sourceX:B,sourceY:I,targetX:Q,targetY:se,sourcePosition:D,targetPosition:$,setUpdateHover:X,setReconnecting:L})]})})}var rM=V.memo(oM);const cM=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function m1({defaultMarkerColor:t,onlyRenderVisibleElements:n,rfId:s,edgeTypes:a,noPanClassName:o,onReconnect:c,onEdgeContextMenu:u,onEdgeMouseEnter:d,onEdgeMouseMove:h,onEdgeMouseLeave:p,onEdgeClick:v,reconnectRadius:g,onEdgeDoubleClick:y,onReconnectStart:S,onReconnectEnd:w,disableKeyboardA11y:E}){const{edgesFocusable:N,edgesReconnectable:C,elementsSelectable:j,onError:_}=Re(cM,tt),A=KT(n);return x.jsxs("div",{className:"react-flow__edges",children:[x.jsx(WT,{defaultColor:t,rfId:s}),A.map(T=>x.jsx(rM,{id:T,edgesFocusable:N,edgesReconnectable:C,elementsSelectable:j,noPanClassName:o,onReconnect:c,onContextMenu:u,onMouseEnter:d,onMouseMove:h,onMouseLeave:p,onClick:v,reconnectRadius:g,onDoubleClick:y,onReconnectStart:S,onReconnectEnd:w,rfId:s,onError:_,edgeTypes:a,disableKeyboardA11y:E},T))]})}m1.displayName="EdgeRenderer";const uM=V.memo(m1),fM=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function dM({children:t}){const n=Re(fM);return x.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:t})}function hM(t){const n=ru(),s=V.useRef(!1);V.useEffect(()=>{!s.current&&n.viewportInitialized&&t&&(setTimeout(()=>t(n),1),s.current=!0)},[t,n.viewportInitialized])}const mM=t=>t.panZoom?.syncViewport;function pM(t){const n=Re(mM),s=it();return V.useEffect(()=>{t&&(n?.(t),s.setState({transform:[t.x,t.y,t.zoom]}))},[t,n]),null}function gM(t){return t.connection.inProgress?{...t.connection,to:Fl(t.connection.to,t.transform)}:{...t.connection}}function yM(t){return gM}function vM(t){const n=yM();return Re(n,tt)}const bM=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function SM({containerStyle:t,style:n,type:s,component:a}){const{nodesConnectable:o,width:c,height:u,isValid:d,inProgress:h}=Re(bM,tt);return!(c&&o&&h)?null:x.jsx("svg",{style:t,width:c,height:u,className:"react-flow__connectionline react-flow__container",children:x.jsx("g",{className:gt(["react-flow__connection",pb(d)]),children:x.jsx(p1,{style:n,type:s,CustomComponent:a,isValid:d})})})}const p1=({style:t,type:n=es.Bezier,CustomComponent:s,isValid:a})=>{const{inProgress:o,from:c,fromNode:u,fromHandle:d,fromPosition:h,to:p,toNode:v,toHandle:g,toPosition:y,pointer:S}=vM();if(!o)return;if(s)return x.jsx(s,{connectionLineType:n,connectionLineStyle:t,fromNode:u,fromHandle:d,fromX:c.x,fromY:c.y,toX:p.x,toY:p.y,fromPosition:h,toPosition:y,connectionStatus:pb(a),toNode:v,toHandle:g,pointer:S});let w="";const E={sourceX:c.x,sourceY:c.y,sourcePosition:h,targetX:p.x,targetY:p.y,targetPosition:y};switch(n){case es.Bezier:[w]=Tb(E);break;case es.SimpleBezier:[w]=n1(E);break;case es.Step:[w]=vh({...E,borderRadius:0});break;case es.SmoothStep:[w]=vh(E);break;default:[w]=Cb(E)}return x.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:t})};p1.displayName="ConnectionLine";const wM={};function uv(t=wM){V.useRef(t),it(),V.useEffect(()=>{},[t])}function xM(){it(),V.useRef(!1),V.useEffect(()=>{},[])}function g1({nodeTypes:t,edgeTypes:n,onInit:s,onNodeClick:a,onEdgeClick:o,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:p,onNodeContextMenu:v,onSelectionContextMenu:g,onSelectionStart:y,onSelectionEnd:S,connectionLineType:w,connectionLineStyle:E,connectionLineComponent:N,connectionLineContainerStyle:C,selectionKeyCode:j,selectionOnDrag:_,selectionMode:A,multiSelectionKeyCode:T,panActivationKeyCode:M,zoomActivationKeyCode:k,deleteKeyCode:R,onlyRenderVisibleElements:U,elementsSelectable:te,defaultViewport:Y,translateExtent:X,minZoom:W,maxZoom:L,preventScrolling:G,defaultMarkerColor:z,zoomOnScroll:B,zoomOnPinch:I,panOnScroll:Q,panOnScrollSpeed:se,panOnScrollMode:D,zoomOnDoubleClick:$,panOnDrag:ne,autoPanOnSelection:ie,onPaneClick:ce,onPaneMouseEnter:he,onPaneMouseMove:fe,onPaneMouseLeave:K,onPaneScroll:ue,onPaneContextMenu:pe,paneClickDistance:xe,nodeClickDistance:de,onEdgeContextMenu:be,onEdgeMouseEnter:Ee,onEdgeMouseMove:ze,onEdgeMouseLeave:Ie,reconnectRadius:wt,onReconnect:We,onReconnectStart:yt,onReconnectEnd:Et,noDragClassName:zt,noWheelClassName:Yn,noPanClassName:$t,disableKeyboardA11y:Pe,nodeExtent:rt,rfId:Lt,viewport:Qe,onViewportChange:Dt}){return uv(t),uv(n),xM(),hM(s),pM(Qe),x.jsx(BT,{onPaneClick:ce,onPaneMouseEnter:he,onPaneMouseMove:fe,onPaneMouseLeave:K,onPaneContextMenu:pe,onPaneScroll:ue,paneClickDistance:xe,deleteKeyCode:R,selectionKeyCode:j,selectionOnDrag:_,selectionMode:A,onSelectionStart:y,onSelectionEnd:S,multiSelectionKeyCode:T,panActivationKeyCode:M,zoomActivationKeyCode:k,elementsSelectable:te,zoomOnScroll:B,zoomOnPinch:I,zoomOnDoubleClick:$,panOnScroll:Q,panOnScrollSpeed:se,panOnScrollMode:D,panOnDrag:ne,autoPanOnSelection:ie,defaultViewport:Y,translateExtent:X,minZoom:W,maxZoom:L,onSelectionContextMenu:g,preventScrolling:G,noDragClassName:zt,noWheelClassName:Yn,noPanClassName:$t,disableKeyboardA11y:Pe,onViewportChange:Dt,isControlledViewport:!!Qe,children:x.jsxs(dM,{children:[x.jsx(uM,{edgeTypes:n,onEdgeClick:o,onEdgeDoubleClick:u,onReconnect:We,onReconnectStart:yt,onReconnectEnd:Et,onlyRenderVisibleElements:U,onEdgeContextMenu:be,onEdgeMouseEnter:Ee,onEdgeMouseMove:ze,onEdgeMouseLeave:Ie,reconnectRadius:wt,defaultMarkerColor:z,noPanClassName:$t,disableKeyboardA11y:Pe,rfId:Lt}),x.jsx(SM,{style:E,type:w,component:N,containerStyle:C}),x.jsx("div",{className:"react-flow__edgelabel-renderer"}),x.jsx(XT,{nodeTypes:t,onNodeClick:a,onNodeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:p,onNodeContextMenu:v,nodeClickDistance:de,onlyRenderVisibleElements:U,noPanClassName:$t,noDragClassName:zt,disableKeyboardA11y:Pe,nodeExtent:rt,rfId:Lt}),x.jsx("div",{className:"react-flow__viewport-portal"})]})})}g1.displayName="GraphView";const EM=V.memo(g1),NM=Sb(),fv=({nodes:t,edges:n,defaultNodes:s,defaultEdges:a,width:o,height:c,fitView:u,fitViewOptions:d,minZoom:h=.5,maxZoom:p=2,nodeOrigin:v,nodeExtent:g,zIndexMode:y="basic"}={})=>{const S=new Map,w=new Map,E=new Map,N=new Map,C=a??n??[],j=s??t??[],_=v??[0,0],A=g??bo;Db(E,N,C);const{nodesInitialized:T}=Sh(j,S,w,{nodeOrigin:_,nodeExtent:A,zIndexMode:y});let M=[0,0,1];if(u&&o&&c){const k=jo(S,{filter:Y=>!!((Y.width||Y.initialWidth)&&(Y.height||Y.initialHeight))}),{x:R,y:U,zoom:te}=Gh(k,o,c,h,p,d?.padding??.1);M=[R,U,te]}return{rfId:"1",width:o??0,height:c??0,transform:M,nodes:j,nodesInitialized:T,nodeLookup:S,parentLookup:w,edges:C,edgeLookup:N,connectionLookup:E,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:s!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:p,translateExtent:bo,nodeExtent:A,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Yl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,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:u??!1,fitViewOptions:d,fitViewResolver:null,connection:{...mb},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:NM,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:hb,zIndexMode:y,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},_M=({nodes:t,edges:n,defaultNodes:s,defaultEdges:a,width:o,height:c,fitView:u,fitViewOptions:d,minZoom:h,maxZoom:p,nodeOrigin:v,nodeExtent:g,zIndexMode:y})=>BA((S,w)=>{async function E(){const{nodeLookup:N,panZoom:C,fitViewOptions:j,fitViewResolver:_,width:A,height:T,minZoom:M,maxZoom:k}=w();C&&(await k_({nodes:N,width:A,height:T,panZoom:C,minZoom:M,maxZoom:k},j),_?.resolve(!0),S({fitViewResolver:null}))}return{...fv({nodes:t,edges:n,width:o,height:c,fitView:u,fitViewOptions:d,minZoom:h,maxZoom:p,nodeOrigin:v,nodeExtent:g,defaultNodes:s,defaultEdges:a,zIndexMode:y}),setNodes:N=>{const{nodeLookup:C,parentLookup:j,nodeOrigin:_,elevateNodesOnSelect:A,fitViewQueued:T,zIndexMode:M,nodesSelectionActive:k}=w(),{nodesInitialized:R,hasSelectedNodes:U}=Sh(N,C,j,{nodeOrigin:_,nodeExtent:g,elevateNodesOnSelect:A,checkEquality:!0,zIndexMode:M}),te=k&&U;T&&R?(E(),S({nodes:N,nodesInitialized:R,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:te})):S({nodes:N,nodesInitialized:R,nodesSelectionActive:te})},setEdges:N=>{const{connectionLookup:C,edgeLookup:j}=w();Db(C,j,N),S({edges:N})},setDefaultNodesAndEdges:(N,C)=>{if(N){const{setNodes:j}=w();j(N),S({hasDefaultNodes:!0})}if(C){const{setEdges:j}=w();j(C),S({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:C,nodeLookup:j,parentLookup:_,domNode:A,nodeOrigin:T,nodeExtent:M,debug:k,fitViewQueued:R,zIndexMode:U}=w(),{changes:te,updatedInternals:Y}=nA(N,j,_,A,T,M,U);Y&&(W_(j,_,{nodeOrigin:T,nodeExtent:M,zIndexMode:U}),R?(E(),S({fitViewQueued:!1,fitViewOptions:void 0})):S({}),te?.length>0&&(k&&console.log("React Flow: trigger node changes",te),C?.(te)))},updateNodePositions:(N,C=!1)=>{const j=[];let _=[];const{nodeLookup:A,triggerNodeChanges:T,connection:M,updateConnection:k,onNodesChangeMiddlewareMap:R}=w();for(const[U,te]of N){const Y=A.get(U),X=!!(Y?.expandParent&&Y?.parentId&&te?.position),W={id:U,type:"position",position:X?{x:Math.max(0,te.position.x),y:Math.max(0,te.position.y)}:te.position,dragging:C};if(Y&&M.inProgress&&M.fromNode.id===Y.id){const L=Rs(Y,M.fromHandle,me.Left,!0);k({...M,from:L})}X&&Y.parentId&&j.push({id:U,parentId:Y.parentId,rect:{...te.internals.positionAbsolute,width:te.measured.width??0,height:te.measured.height??0}}),_.push(W)}if(j.length>0){const{parentLookup:U,nodeOrigin:te}=w(),Y=Fh(j,A,U,te);_.push(...Y)}for(const U of R.values())_=U(_);T(_)},triggerNodeChanges:N=>{const{onNodesChange:C,setNodes:j,nodes:_,hasDefaultNodes:A,debug:T}=w();if(N?.length){if(A){const M=lT(N,_);j(M)}T&&console.log("React Flow: trigger node changes",N),C?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:C,setEdges:j,edges:_,hasDefaultEdges:A,debug:T}=w();if(N?.length){if(A){const M=aT(N,_);j(M)}T&&console.log("React Flow: trigger edge changes",N),C?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:C,edgeLookup:j,nodeLookup:_,triggerNodeChanges:A,triggerEdgeChanges:T}=w();if(C){const M=N.map(k=>Ns(k,!0));A(M);return}A(Ml(_,new Set([...N]),!0)),T(Ml(j))},addSelectedEdges:N=>{const{multiSelectionActive:C,edgeLookup:j,nodeLookup:_,triggerNodeChanges:A,triggerEdgeChanges:T}=w();if(C){const M=N.map(k=>Ns(k,!0));T(M);return}T(Ml(j,new Set([...N]))),A(Ml(_,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:C}={})=>{const{edges:j,nodes:_,nodeLookup:A,triggerNodeChanges:T,triggerEdgeChanges:M}=w(),k=N||_,R=C||j,U=[];for(const Y of k){if(!Y.selected)continue;const X=A.get(Y.id);X&&(X.selected=!1),U.push(Ns(Y.id,!1))}const te=[];for(const Y of R)Y.selected&&te.push(Ns(Y.id,!1));T(U),M(te)},setMinZoom:N=>{const{panZoom:C,maxZoom:j}=w();C?.setScaleExtent([N,j]),S({minZoom:N})},setMaxZoom:N=>{const{panZoom:C,minZoom:j}=w();C?.setScaleExtent([j,N]),S({maxZoom:N})},setTranslateExtent:N=>{w().panZoom?.setTranslateExtent(N),S({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:C,triggerNodeChanges:j,triggerEdgeChanges:_,elementsSelectable:A}=w();if(!A)return;const T=C.reduce((k,R)=>R.selected?[...k,Ns(R.id,!1)]:k,[]),M=N.reduce((k,R)=>R.selected?[...k,Ns(R.id,!1)]:k,[]);j(T),_(M)},setNodeExtent:N=>{const{nodes:C,nodeLookup:j,parentLookup:_,nodeOrigin:A,elevateNodesOnSelect:T,nodeExtent:M,zIndexMode:k}=w();N[0][0]===M[0][0]&&N[0][1]===M[0][1]&&N[1][0]===M[1][0]&&N[1][1]===M[1][1]||(Sh(C,j,_,{nodeOrigin:A,nodeExtent:N,elevateNodesOnSelect:T,checkEquality:!1,zIndexMode:k}),S({nodeExtent:N}))},panBy:N=>{const{transform:C,width:j,height:_,panZoom:A,translateExtent:T}=w();return iA({delta:N,panZoom:A,transform:C,translateExtent:T,width:j,height:_})},setCenter:async(N,C,j)=>{const{width:_,height:A,maxZoom:T,panZoom:M}=w();if(!M)return!1;const k=typeof j?.zoom<"u"?j.zoom:T;return await M.setViewport({x:_/2-N*k,y:A/2-C*k,zoom:k},{duration:j?.duration,ease:j?.ease,interpolate:j?.interpolate}),!0},cancelConnection:()=>{S({connection:{...mb}})},updateConnection:N=>{S({connection:N})},reset:()=>S({...fv()})}},Object.is);function y1({initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:a,initialWidth:o,initialHeight:c,initialMinZoom:u,initialMaxZoom:d,initialFitViewOptions:h,fitView:p,nodeOrigin:v,nodeExtent:g,zIndexMode:y,children:S}){const[w]=V.useState(()=>_M({nodes:t,edges:n,defaultNodes:s,defaultEdges:a,width:o,height:c,fitView:p,minZoom:u,maxZoom:d,fitViewOptions:h,nodeOrigin:v,nodeExtent:g,zIndexMode:y}));return x.jsx($A,{value:w,children:x.jsx(dT,{children:S})})}function AM({children:t,nodes:n,edges:s,defaultNodes:a,defaultEdges:o,width:c,height:u,fitView:d,fitViewOptions:h,minZoom:p,maxZoom:v,nodeOrigin:g,nodeExtent:y,zIndexMode:S}){return V.useContext(au)?x.jsx(x.Fragment,{children:t}):x.jsx(y1,{initialNodes:n,initialEdges:s,defaultNodes:a,defaultEdges:o,initialWidth:c,initialHeight:u,fitView:d,initialFitViewOptions:h,initialMinZoom:p,initialMaxZoom:v,nodeOrigin:g,nodeExtent:y,zIndexMode:S,children:t})}const TM={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function MM({nodes:t,edges:n,defaultNodes:s,defaultEdges:a,className:o,nodeTypes:c,edgeTypes:u,onNodeClick:d,onEdgeClick:h,onInit:p,onMove:v,onMoveStart:g,onMoveEnd:y,onConnect:S,onConnectStart:w,onConnectEnd:E,onClickConnectStart:N,onClickConnectEnd:C,onNodeMouseEnter:j,onNodeMouseMove:_,onNodeMouseLeave:A,onNodeContextMenu:T,onNodeDoubleClick:M,onNodeDragStart:k,onNodeDrag:R,onNodeDragStop:U,onNodesDelete:te,onEdgesDelete:Y,onDelete:X,onSelectionChange:W,onSelectionDragStart:L,onSelectionDrag:G,onSelectionDragStop:z,onSelectionContextMenu:B,onSelectionStart:I,onSelectionEnd:Q,onBeforeDelete:se,connectionMode:D,connectionLineType:$=es.Bezier,connectionLineStyle:ne,connectionLineComponent:ie,connectionLineContainerStyle:ce,deleteKeyCode:he="Backspace",selectionKeyCode:fe="Shift",selectionOnDrag:K=!1,selectionMode:ue=So.Full,panActivationKeyCode:pe="Space",multiSelectionKeyCode:xe=Eo()?"Meta":"Control",zoomActivationKeyCode:de=Eo()?"Meta":"Control",snapToGrid:be,snapGrid:Ee,onlyRenderVisibleElements:ze=!1,selectNodesOnDrag:Ie,nodesDraggable:wt,autoPanOnNodeFocus:We,nodesConnectable:yt,nodesFocusable:Et,nodeOrigin:zt=Ib,edgesFocusable:Yn,edgesReconnectable:$t,elementsSelectable:Pe=!0,defaultViewport:rt=WA,minZoom:Lt=.5,maxZoom:Qe=2,translateExtent:Dt=bo,preventScrolling:ls=!0,nodeExtent:vi,defaultMarkerColor:bn="#b1b1b7",zoomOnScroll:ia=!0,zoomOnPinch:Gn=!0,panOnScroll:Nt=!1,panOnScrollSpeed:on=.5,panOnScrollMode:_t=Os.Free,zoomOnDoubleClick:sa=!0,panOnDrag:la=!0,onPaneClick:ae,onPaneMouseEnter:ye,onPaneMouseMove:Me,onPaneMouseLeave:Ze,onPaneScroll:vt,onPaneContextMenu:At,paneClickDistance:In=1,nodeClickDistance:Nu=0,children:qo,onReconnect:aa,onReconnectStart:as,onReconnectEnd:_u,onEdgeContextMenu:Vo,onEdgeDoubleClick:Yo,onEdgeMouseEnter:Go,onEdgeMouseMove:oa,onEdgeMouseLeave:ra,reconnectRadius:Io=10,onNodesChange:Xo,onEdgesChange:kn,noDragClassName:bt="nodrag",noWheelClassName:kt="nowheel",noPanClassName:Xn="nopan",fitView:Us,fitViewOptions:Ko,connectOnClick:Au,attributionPosition:Zo,proOptions:os,defaultEdgeOptions:ca,elevateNodesOnSelect:bi=!0,elevateEdgesOnSelect:Si=!1,disableKeyboardA11y:wi=!1,autoPanOnConnect:xi,autoPanOnNodeDrag:ft,autoPanOnSelection:Qo=!0,autoPanSpeed:Fo,connectionRadius:Kn,isValidConnection:Ei,onError:Tu,style:Jo,id:ua,nodeDragThreshold:Mu,connectionDragThreshold:qs,viewport:Vs,onViewportChange:Sn,width:Ut,height:Wo,colorMode:Cu="light",debug:fa,onScroll:da,ariaLabelConfig:Ys,zIndexMode:Po="basic",...qt},ha){const Gs=ua||"1",ma=nT(Cu),Ni=V.useCallback(pa=>{pa.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),da?.(pa)},[da]);return x.jsx("div",{"data-testid":"rf__wrapper",...qt,onScroll:Ni,style:{...Jo,...TM},ref:ha,className:gt(["react-flow",o,ma]),id:ua,role:"application",children:x.jsxs(AM,{nodes:t,edges:n,width:Ut,height:Wo,fitView:Us,fitViewOptions:Ko,minZoom:Lt,maxZoom:Qe,nodeOrigin:zt,nodeExtent:vi,zIndexMode:Po,children:[x.jsx(tT,{nodes:t,edges:n,defaultNodes:s,defaultEdges:a,onConnect:S,onConnectStart:w,onConnectEnd:E,onClickConnectStart:N,onClickConnectEnd:C,nodesDraggable:wt,autoPanOnNodeFocus:We,nodesConnectable:yt,nodesFocusable:Et,edgesFocusable:Yn,edgesReconnectable:$t,elementsSelectable:Pe,elevateNodesOnSelect:bi,elevateEdgesOnSelect:Si,minZoom:Lt,maxZoom:Qe,nodeExtent:vi,onNodesChange:Xo,onEdgesChange:kn,snapToGrid:be,snapGrid:Ee,connectionMode:D,translateExtent:Dt,connectOnClick:Au,defaultEdgeOptions:ca,fitView:Us,fitViewOptions:Ko,onNodesDelete:te,onEdgesDelete:Y,onDelete:X,onNodeDragStart:k,onNodeDrag:R,onNodeDragStop:U,onSelectionDrag:G,onSelectionDragStart:L,onSelectionDragStop:z,onMove:v,onMoveStart:g,onMoveEnd:y,noPanClassName:Xn,nodeOrigin:zt,rfId:Gs,autoPanOnConnect:xi,autoPanOnNodeDrag:ft,autoPanSpeed:Fo,onError:Tu,connectionRadius:Kn,isValidConnection:Ei,selectNodesOnDrag:Ie,nodeDragThreshold:Mu,connectionDragThreshold:qs,onBeforeDelete:se,debug:fa,ariaLabelConfig:Ys,zIndexMode:Po}),x.jsx(EM,{onInit:p,onNodeClick:d,onEdgeClick:h,onNodeMouseEnter:j,onNodeMouseMove:_,onNodeMouseLeave:A,onNodeContextMenu:T,onNodeDoubleClick:M,nodeTypes:c,edgeTypes:u,connectionLineType:$,connectionLineStyle:ne,connectionLineComponent:ie,connectionLineContainerStyle:ce,selectionKeyCode:fe,selectionOnDrag:K,selectionMode:ue,deleteKeyCode:he,multiSelectionKeyCode:xe,panActivationKeyCode:pe,zoomActivationKeyCode:de,onlyRenderVisibleElements:ze,defaultViewport:rt,translateExtent:Dt,minZoom:Lt,maxZoom:Qe,preventScrolling:ls,zoomOnScroll:ia,zoomOnPinch:Gn,zoomOnDoubleClick:sa,panOnScroll:Nt,panOnScrollSpeed:on,panOnScrollMode:_t,panOnDrag:la,autoPanOnSelection:Qo,onPaneClick:ae,onPaneMouseEnter:ye,onPaneMouseMove:Me,onPaneMouseLeave:Ze,onPaneScroll:vt,onPaneContextMenu:At,paneClickDistance:In,nodeClickDistance:Nu,onSelectionContextMenu:B,onSelectionStart:I,onSelectionEnd:Q,onReconnect:aa,onReconnectStart:as,onReconnectEnd:_u,onEdgeContextMenu:Vo,onEdgeDoubleClick:Yo,onEdgeMouseEnter:Go,onEdgeMouseMove:oa,onEdgeMouseLeave:ra,reconnectRadius:Io,defaultMarkerColor:bn,noDragClassName:bt,noWheelClassName:kt,noPanClassName:Xn,rfId:Gs,disableKeyboardA11y:wi,nodeExtent:vi,viewport:Vs,onViewportChange:Sn}),x.jsx(JA,{onSelectionChange:W}),qo,x.jsx(XA,{proOptions:os,position:Zo}),x.jsx(IA,{rfId:Gs,disableKeyboardA11y:wi})]})})}var CM=Kb(MM);const OM=t=>t.domNode?.querySelector(".react-flow__edgelabel-renderer");function zM({children:t}){const n=Re(OM);return n?HA.createPortal(t,n):null}function DM({dimensions:t,lineWidth:n,variant:s,className:a}){return x.jsx("path",{strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:gt(["react-flow__background-pattern",s,a])})}function kM({radius:t,className:n}){return x.jsx("circle",{cx:t,cy:t,r:t,className:gt(["react-flow__background-pattern","dots",n])})}var ts;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(ts||(ts={}));const jM={[ts.Dots]:1,[ts.Lines]:1,[ts.Cross]:6},RM=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function v1({id:t,variant:n=ts.Dots,gap:s=20,size:a,lineWidth:o=1,offset:c=0,color:u,bgColor:d,style:h,className:p,patternClassName:v}){const g=V.useRef(null),{transform:y,patternId:S}=Re(RM,tt),w=a||jM[n],E=n===ts.Dots,N=n===ts.Cross,C=Array.isArray(s)?s:[s,s],j=[C[0]*y[2]||1,C[1]*y[2]||1],_=w*y[2],A=Array.isArray(c)?c:[c,c],T=N?[_,_]:j,M=[A[0]*y[2]||1+T[0]/2,A[1]*y[2]||1+T[1]/2],k=`${S}${t||""}`;return x.jsxs("svg",{className:gt(["react-flow__background",p]),style:{...h,...cu,"--xy-background-color-props":d,"--xy-background-pattern-color-props":u},ref:g,"data-testid":"rf__background",children:[x.jsx("pattern",{id:k,x:y[0]%j[0],y:y[1]%j[1],width:j[0],height:j[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:E?x.jsx(kM,{radius:_/2,className:v}):x.jsx(DM,{dimensions:T,lineWidth:o,variant:n,className:v})}),x.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}v1.displayName="Background";const LM=V.memo(v1);function BM(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:x.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function HM(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:x.jsx("path",{d:"M0 0h32v4.2H0z"})})}function $M(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:x.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 UM(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.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 qM(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.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 yc({children:t,className:n,...s}){return x.jsx("button",{type:"button",className:gt(["react-flow__controls-button",n]),...s,children:t})}const VM=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function b1({style:t,showZoom:n=!0,showFitView:s=!0,showInteractive:a=!0,fitViewOptions:o,onZoomIn:c,onZoomOut:u,onFitView:d,onInteractiveChange:h,className:p,children:v,position:g="bottom-left",orientation:y="vertical","aria-label":S}){const w=it(),{isInteractive:E,minZoomReached:N,maxZoomReached:C,ariaLabelConfig:j}=Re(VM,tt),{zoomIn:_,zoomOut:A,fitView:T}=ru(),M=()=>{_(),c?.()},k=()=>{A(),u?.()},R=()=>{T(o),d?.()},U=()=>{w.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),h?.(!E)},te=y==="horizontal"?"horizontal":"vertical";return x.jsxs(ou,{className:gt(["react-flow__controls",te,p]),position:g,style:t,"data-testid":"rf__controls","aria-label":S??j["controls.ariaLabel"],children:[n&&x.jsxs(x.Fragment,{children:[x.jsx(yc,{onClick:M,className:"react-flow__controls-zoomin",title:j["controls.zoomIn.ariaLabel"],"aria-label":j["controls.zoomIn.ariaLabel"],disabled:C,children:x.jsx(BM,{})}),x.jsx(yc,{onClick:k,className:"react-flow__controls-zoomout",title:j["controls.zoomOut.ariaLabel"],"aria-label":j["controls.zoomOut.ariaLabel"],disabled:N,children:x.jsx(HM,{})})]}),s&&x.jsx(yc,{className:"react-flow__controls-fitview",onClick:R,title:j["controls.fitView.ariaLabel"],"aria-label":j["controls.fitView.ariaLabel"],children:x.jsx($M,{})}),a&&x.jsx(yc,{className:"react-flow__controls-interactive",onClick:U,title:j["controls.interactive.ariaLabel"],"aria-label":j["controls.interactive.ariaLabel"],children:E?x.jsx(qM,{}):x.jsx(UM,{})}),v]})}b1.displayName="Controls";const YM=V.memo(b1);function GM({id:t,x:n,y:s,width:a,height:o,style:c,color:u,strokeColor:d,strokeWidth:h,className:p,borderRadius:v,shapeRendering:g,selected:y,onClick:S}){const{background:w,backgroundColor:E}=c||{},N=u||w||E;return x.jsx("rect",{className:gt(["react-flow__minimap-node",{selected:y},p]),x:n,y:s,rx:v,ry:v,width:a,height:o,style:{fill:N,stroke:d,strokeWidth:h},shapeRendering:g,onClick:S?C=>S(C,t):void 0})}const IM=V.memo(GM),XM=t=>t.nodes.map(n=>n.id),Pd=t=>t instanceof Function?t:()=>t;function KM({nodeStrokeColor:t,nodeColor:n,nodeClassName:s="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:c=IM,onClick:u}){const d=Re(XM,tt),h=Pd(n),p=Pd(t),v=Pd(s),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return x.jsx(x.Fragment,{children:d.map(y=>x.jsx(QM,{id:y,nodeColorFunc:h,nodeStrokeColorFunc:p,nodeClassNameFunc:v,nodeBorderRadius:a,nodeStrokeWidth:o,NodeComponent:c,onClick:u,shapeRendering:g},y))})}function ZM({id:t,nodeColorFunc:n,nodeStrokeColorFunc:s,nodeClassNameFunc:a,nodeBorderRadius:o,nodeStrokeWidth:c,shapeRendering:u,NodeComponent:d,onClick:h}){const{node:p,x:v,y:g,width:y,height:S}=Re(w=>{const E=w.nodeLookup.get(t);if(!E)return{node:void 0,x:0,y:0,width:0,height:0};const N=E.internals.userNode,{x:C,y:j}=E.internals.positionAbsolute,{width:_,height:A}=yi(N);return{node:N,x:C,y:j,width:_,height:A}},tt);return!p||p.hidden||!wb(p)?null:x.jsx(d,{x:v,y:g,width:y,height:S,style:p.style,selected:!!p.selected,className:a(p),color:n(p),borderRadius:o,strokeColor:s(p),strokeWidth:c,shapeRendering:u,onClick:h,id:p.id})}const QM=V.memo(ZM);var FM=V.memo(KM);const JM=200,WM=150,PM=t=>!t.hidden,eC=t=>{const n={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:n,boundingRect:t.nodeLookup.size>0?bb(jo(t.nodeLookup,{filter:PM}),n):n,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},tC="react-flow__minimap-desc";function S1({style:t,className:n,nodeStrokeColor:s,nodeColor:a,nodeClassName:o="",nodeBorderRadius:c=5,nodeStrokeWidth:u,nodeComponent:d,bgColor:h,maskColor:p,maskStrokeColor:v,maskStrokeWidth:g,position:y="bottom-right",onClick:S,onNodeClick:w,pannable:E=!1,zoomable:N=!1,ariaLabel:C,inversePan:j,zoomStep:_=1,offsetScale:A=5}){const T=it(),M=V.useRef(null),{boundingRect:k,viewBB:R,rfId:U,panZoom:te,translateExtent:Y,flowWidth:X,flowHeight:W,ariaLabelConfig:L}=Re(eC,tt),G=t?.width??JM,z=t?.height??WM,B=k.width/G,I=k.height/z,Q=Math.max(B,I),se=Q*G,D=Q*z,$=A*Q,ne=k.x-(se-k.width)/2-$,ie=k.y-(D-k.height)/2-$,ce=se+$*2,he=D+$*2,fe=`${tC}-${U}`,K=V.useRef(0),ue=V.useRef();K.current=Q,V.useEffect(()=>{if(M.current&&te)return ue.current=dA({domNode:M.current,panZoom:te,getTransform:()=>T.getState().transform,getViewScale:()=>K.current}),()=>{ue.current?.destroy()}},[te]),V.useEffect(()=>{ue.current?.update({translateExtent:Y,width:X,height:W,inversePan:j,pannable:E,zoomStep:_,zoomable:N})},[E,N,j,_,Y,X,W]);const pe=S?be=>{const[Ee,ze]=ue.current?.pointer(be)||[0,0];S(be,{x:Ee,y:ze})}:void 0,xe=w?V.useCallback((be,Ee)=>{const ze=T.getState().nodeLookup.get(Ee).internals.userNode;w(be,ze)},[]):void 0,de=C??L["minimap.ariaLabel"];return x.jsx(ou,{position:y,style:{...t,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*Q:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:gt(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:x.jsxs("svg",{width:G,height:z,viewBox:`${ne} ${ie} ${ce} ${he}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":fe,ref:M,onClick:pe,children:[de&&x.jsx("title",{id:fe,children:de}),x.jsx(FM,{onClick:xe,nodeColor:a,nodeStrokeColor:s,nodeBorderRadius:c,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:d}),x.jsx("path",{className:"react-flow__minimap-mask",d:`M${ne-$},${ie-$}h${ce+$*2}v${he+$*2}h${-ce-$*2}z
|
|
15
|
+
M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}S1.displayName="MiniMap";V.memo(S1);const nC=t=>n=>t?`${Math.max(1/n.transform[2],1)}`:void 0,iC={[Kl.Line]:"right",[Kl.Handle]:"bottom-right"};function sC({nodeId:t,position:n,variant:s=Kl.Handle,className:a,style:o=void 0,children:c,color:u,minWidth:d=10,minHeight:h=10,maxWidth:p=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:y,autoScale:S=!0,shouldResize:w,onResizeStart:E,onResize:N,onResizeEnd:C}){const j=Jb(),_=typeof t=="string"?t:j,A=it(),T=V.useRef(null),M=s===Kl.Handle,k=Re(V.useCallback(nC(M&&S),[M,S]),tt),R=V.useRef(null),U=n??iC[s];V.useEffect(()=>{if(!(!T.current||!_))return R.current||(R.current=_A({domNode:T.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:Y,transform:X,snapGrid:W,snapToGrid:L,nodeOrigin:G,domNode:z}=A.getState();return{nodeLookup:Y,transform:X,snapGrid:W,snapToGrid:L,nodeOrigin:G,paneDomNode:z}},onChange:(Y,X)=>{const{triggerNodeChanges:W,nodeLookup:L,parentLookup:G,nodeOrigin:z}=A.getState(),B=[],I={x:Y.x,y:Y.y},Q=L.get(_);if(Q&&Q.expandParent&&Q.parentId){const se=Q.origin??z,D=Y.width??Q.measured.width??0,$=Y.height??Q.measured.height??0,ne={id:Q.id,parentId:Q.parentId,rect:{width:D,height:$,...xb({x:Y.x??Q.position.x,y:Y.y??Q.position.y},{width:D,height:$},Q.parentId,L,se)}},ie=Fh([ne],L,G,z);B.push(...ie),I.x=Y.x?Math.max(se[0]*D,Y.x):void 0,I.y=Y.y?Math.max(se[1]*$,Y.y):void 0}if(I.x!==void 0&&I.y!==void 0){const se={id:_,type:"position",position:{...I}};B.push(se)}if(Y.width!==void 0&&Y.height!==void 0){const D={id:_,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:Y.width,height:Y.height}};B.push(D)}for(const se of X){const D={...se,type:"position"};B.push(D)}W(B)},onEnd:({width:Y,height:X})=>{const W={id:_,type:"dimensions",resizing:!1,dimensions:{width:Y,height:X}};A.getState().triggerNodeChanges([W])}})),R.current.update({controlPosition:U,boundaries:{minWidth:d,minHeight:h,maxWidth:p,maxHeight:v},keepAspectRatio:g,resizeDirection:y,onResizeStart:E,onResize:N,onResizeEnd:C,shouldResize:w}),()=>{R.current?.destroy()}},[U,d,h,p,v,g,E,N,C,w]);const te=U.split("-");return x.jsx("div",{className:gt(["react-flow__resize-control","nodrag",...te,s,a]),ref:T,style:{...o,scale:k,...u&&{[M?"backgroundColor":"borderColor"]:u}},children:c})}V.memo(sC);const dv=3,lC=new Set(["command-event","event-query"]);function w1(t){return[...new Set(t)]}function x1(t){return t?.trim()?w1(t.split(/\r?\n/).map(n=>aC(n)).filter(n=>!!n)):[]}function aC(t){const n=t.trim();return n?n.replace(/^[-*+]\s+/,"").replace(/^\d+[.)]\s+/,"").trim().match(/^`?([A-Za-z_][A-Za-z0-9_.-]*)`?(?=\s*(?::|-|=|\(|,|$))/)?.[1]:void 0}function oC(t){const n=new Map(t.nodes.map(o=>[o.id,o])),s=new Map(t.nodes.map(o=>[o.id,x1(o.fields)])),a=new Map;for(const o of t.edges){if(!lC.has(o.kind))continue;const c=n.get(o.source),u=n.get(o.target);if(!hv(c)||!hv(u))continue;const d=s.get(o.source)??[],h=s.get(o.target)??[],p=new Set(h),v=d.filter(S=>p.has(S)),g=o.kind==="event-query"?cC(c,h,v):[],y=w1([...v,...g]);a.set(o.id,{sourceFieldNames:d,targetFieldNames:h,sharedFieldNames:v,derivedFieldNames:g,visibleFieldNames:y.slice(0,dv),remainingCount:Math.max(0,y.length-dv),sourceMissingFields:d.length===0,targetMissingFields:h.length===0})}return a}function rC(t,n){if(!n)return;const s=[...t.entries()].filter(([,a])=>a.sharedFieldNames.includes(n)||a.derivedFieldNames.includes(n)).map(([a])=>a);return s.length>0?new Set(s):void 0}function hv(t){return t?.type==="command"||t?.type==="event"||t?.type==="query"}function cC(t,n,s){const a=mv(t.label),o=new Set(s);return n.filter(c=>!o.has(c)&&mv(c).includes(a))}function mv(t){return t.replace(/^(has|is|was|were)/i,"").replace(/been/gi,"").replace(/[^A-Za-z0-9]/g,"").toLowerCase()}const Wh=Symbol.for("yaml.alias"),Eh=Symbol.for("yaml.document"),ns=Symbol.for("yaml.map"),E1=Symbol.for("yaml.pair"),qn=Symbol.for("yaml.scalar"),Jl=Symbol.for("yaml.seq"),vn=Symbol.for("yaml.node.type"),Bs=t=>!!t&&typeof t=="object"&&t[vn]===Wh,Hs=t=>!!t&&typeof t=="object"&&t[vn]===Eh,Wl=t=>!!t&&typeof t=="object"&&t[vn]===ns,nt=t=>!!t&&typeof t=="object"&&t[vn]===E1,Ke=t=>!!t&&typeof t=="object"&&t[vn]===qn,Pl=t=>!!t&&typeof t=="object"&&t[vn]===Jl;function st(t){if(t&&typeof t=="object")switch(t[vn]){case ns:case Jl:return!0}return!1}function lt(t){if(t&&typeof t=="object")switch(t[vn]){case Wh:case ns:case qn:case Jl:return!0}return!1}const N1=t=>(Ke(t)||st(t))&&!!t.anchor,Zt=Symbol("break visit"),_1=Symbol("skip children"),Un=Symbol("remove node");function $s(t,n){const s=A1(n);Hs(t)?Cl(null,t.contents,s,Object.freeze([t]))===Un&&(t.contents=null):Cl(null,t,s,Object.freeze([]))}$s.BREAK=Zt;$s.SKIP=_1;$s.REMOVE=Un;function Cl(t,n,s,a){const o=T1(t,n,s,a);if(lt(o)||nt(o))return M1(t,a,o),Cl(t,o,s,a);if(typeof o!="symbol"){if(st(n)){a=Object.freeze(a.concat(n));for(let c=0;c<n.items.length;++c){const u=Cl(c,n.items[c],s,a);if(typeof u=="number")c=u-1;else{if(u===Zt)return Zt;u===Un&&(n.items.splice(c,1),c-=1)}}}else if(nt(n)){a=Object.freeze(a.concat(n));const c=Cl("key",n.key,s,a);if(c===Zt)return Zt;c===Un&&(n.key=null);const u=Cl("value",n.value,s,a);if(u===Zt)return Zt;u===Un&&(n.value=null)}}return o}async function uu(t,n){const s=A1(n);Hs(t)?await Ol(null,t.contents,s,Object.freeze([t]))===Un&&(t.contents=null):await Ol(null,t,s,Object.freeze([]))}uu.BREAK=Zt;uu.SKIP=_1;uu.REMOVE=Un;async function Ol(t,n,s,a){const o=await T1(t,n,s,a);if(lt(o)||nt(o))return M1(t,a,o),Ol(t,o,s,a);if(typeof o!="symbol"){if(st(n)){a=Object.freeze(a.concat(n));for(let c=0;c<n.items.length;++c){const u=await Ol(c,n.items[c],s,a);if(typeof u=="number")c=u-1;else{if(u===Zt)return Zt;u===Un&&(n.items.splice(c,1),c-=1)}}}else if(nt(n)){a=Object.freeze(a.concat(n));const c=await Ol("key",n.key,s,a);if(c===Zt)return Zt;c===Un&&(n.key=null);const u=await Ol("value",n.value,s,a);if(u===Zt)return Zt;u===Un&&(n.value=null)}}return o}function A1(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function T1(t,n,s,a){if(typeof s=="function")return s(t,n,a);if(Wl(n))return s.Map?.(t,n,a);if(Pl(n))return s.Seq?.(t,n,a);if(nt(n))return s.Pair?.(t,n,a);if(Ke(n))return s.Scalar?.(t,n,a);if(Bs(n))return s.Alias?.(t,n,a)}function M1(t,n,s){const a=n[n.length-1];if(st(a))a.items[t]=s;else if(nt(a))t==="key"?a.key=s:a.value=s;else if(Hs(a))a.contents=s;else{const o=Bs(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${o} parent`)}}const uC={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},fC=t=>t.replace(/[!,[\]{}]/g,n=>uC[n]);class Ht{constructor(n,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Ht.defaultYaml,n),this.tags=Object.assign({},Ht.defaultTags,s)}clone(){const n=new Ht(this.yaml,this.tags);return n.docStart=this.docStart,n}atDocument(){const n=new Ht(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Ht.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Ht.defaultTags);break}return n}add(n,s){this.atNextDocument&&(this.yaml={explicit:Ht.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Ht.defaultTags),this.atNextDocument=!1);const a=n.trim().split(/[ \t]+/),o=a.shift();switch(o){case"%TAG":{if(a.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),a.length<2))return!1;const[c,u]=a;return this.tags[c]=u,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;const[c]=a;if(c==="1.1"||c==="1.2")return this.yaml.version=c,!0;{const u=/^\d+\.\d+$/.test(c);return s(6,`Unsupported YAML version ${c}`,u),!1}}default:return s(0,`Unknown directive ${o}`,!0),!1}}tagName(n,s){if(n==="!")return"!";if(n[0]!=="!")return s(`Not a valid tag: ${n}`),null;if(n[1]==="<"){const u=n.slice(2,-1);return u==="!"||u==="!!"?(s(`Verbatim tags aren't resolved, so ${n} is invalid.`),null):(n[n.length-1]!==">"&&s("Verbatim tags must end with a >"),u)}const[,a,o]=n.match(/^(.*!)([^!]*)$/s);o||s(`The ${n} tag has no suffix`);const c=this.tags[a];if(c)try{return c+decodeURIComponent(o)}catch(u){return s(String(u)),null}return a==="!"?n:(s(`Could not resolve tag: ${n}`),null)}tagString(n){for(const[s,a]of Object.entries(this.tags))if(n.startsWith(a))return s+fC(n.substring(a.length));return n[0]==="!"?n:`!<${n}>`}toString(n){const s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let o;if(n&&a.length>0&<(n.contents)){const c={};$s(n.contents,(u,d)=>{lt(d)&&d.tag&&(c[d.tag]=!0)}),o=Object.keys(c)}else o=[];for(const[c,u]of a)c==="!!"&&u==="tag:yaml.org,2002:"||(!n||o.some(d=>d.startsWith(u)))&&s.push(`%TAG ${c} ${u}`);return s.join(`
|
|
16
|
+
`)}}Ht.defaultYaml={explicit:!1,version:"1.2"};Ht.defaultTags={"!!":"tag:yaml.org,2002:"};function C1(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(s)}return!0}function O1(t){const n=new Set;return $s(t,{Value(s,a){a.anchor&&n.add(a.anchor)}}),n}function z1(t,n){for(let s=1;;++s){const a=`${t}${s}`;if(!n.has(a))return a}}function dC(t,n){const s=[],a=new Map;let o=null;return{onAnchor:c=>{s.push(c),o??(o=O1(t));const u=z1(n,o);return o.add(u),u},setAnchors:()=>{for(const c of s){const u=a.get(c);if(typeof u=="object"&&u.anchor&&(Ke(u.node)||st(u.node)))u.node.anchor=u.anchor;else{const d=new Error("Failed to resolve repeated object (this should not happen)");throw d.source=c,d}}},sourceObjects:a}}function zl(t,n,s,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let o=0,c=a.length;o<c;++o){const u=a[o],d=zl(t,a,String(o),u);d===void 0?delete a[o]:d!==u&&(a[o]=d)}else if(a instanceof Map)for(const o of Array.from(a.keys())){const c=a.get(o),u=zl(t,a,o,c);u===void 0?a.delete(o):u!==c&&a.set(o,u)}else if(a instanceof Set)for(const o of Array.from(a)){const c=zl(t,a,o,o);c===void 0?a.delete(o):c!==o&&(a.delete(o),a.add(c))}else for(const[o,c]of Object.entries(a)){const u=zl(t,a,o,c);u===void 0?delete a[o]:u!==c&&(a[o]=u)}return t.call(n,s,a)}function yn(t,n,s){if(Array.isArray(t))return t.map((a,o)=>yn(a,String(o),s));if(t&&typeof t.toJSON=="function"){if(!s||!N1(t))return t.toJSON(n,s);const a={aliasCount:0,count:1,res:void 0};s.anchors.set(t,a),s.onCreate=c=>{a.res=c,delete s.onCreate};const o=t.toJSON(n,s);return s.onCreate&&s.onCreate(o),o}return typeof t=="bigint"&&!s?.keep?Number(t):t}class Ph{constructor(n){Object.defineProperty(this,vn,{value:n})}clone(){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(n.range=this.range.slice()),n}toJS(n,{mapAsMap:s,maxAliasCount:a,onAnchor:o,reviver:c}={}){if(!Hs(n))throw new TypeError("A document argument is required");const u={anchors:new Map,doc:n,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},d=yn(this,"",u);if(typeof o=="function")for(const{count:h,res:p}of u.anchors.values())o(p,h);return typeof c=="function"?zl(c,{"":d},"",d):d}}class fu extends Ph{constructor(n){super(Wh),this.source=n,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(n,s){if(s?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let a;s?.aliasResolveCache?a=s.aliasResolveCache:(a=[],$s(n,{Node:(c,u)=>{(Bs(u)||N1(u))&&a.push(u)}}),s&&(s.aliasResolveCache=a));let o;for(const c of a){if(c===this)break;c.anchor===this.source&&(o=c)}return o}toJSON(n,s){if(!s)return{source:this.source};const{anchors:a,doc:o,maxAliasCount:c}=s,u=this.resolve(o,s);if(!u){const h=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(h)}let d=a.get(u);if(d||(yn(u,null,s),d=a.get(u)),d?.res===void 0){const h="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(h)}if(c>=0&&(d.count+=1,d.aliasCount===0&&(d.aliasCount=Cc(o,u,a)),d.count*d.aliasCount>c)){const h="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(h)}return d.res}toString(n,s,a){const o=`*${this.source}`;if(n){if(C1(this.source),n.options.verifyAliasOrder&&!n.anchors.has(this.source)){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(c)}if(n.implicitKey)return`${o} `}return o}}function Cc(t,n,s){if(Bs(n)){const a=n.resolve(t),o=s&&a&&s.get(a);return o?o.count*o.aliasCount:0}else if(st(n)){let a=0;for(const o of n.items){const c=Cc(t,o,s);c>a&&(a=c)}return a}else if(nt(n)){const a=Cc(t,n.key,s),o=Cc(t,n.value,s);return Math.max(a,o)}return 1}const D1=t=>!t||typeof t!="function"&&typeof t!="object";class _e extends Ph{constructor(n){super(qn),this.value=n}toJSON(n,s){return s?.keep?this.value:yn(this.value,n,s)}toString(){return String(this.value)}}_e.BLOCK_FOLDED="BLOCK_FOLDED";_e.BLOCK_LITERAL="BLOCK_LITERAL";_e.PLAIN="PLAIN";_e.QUOTE_DOUBLE="QUOTE_DOUBLE";_e.QUOTE_SINGLE="QUOTE_SINGLE";const hC="tag:yaml.org,2002:";function mC(t,n,s){if(n){const a=s.filter(c=>c.tag===n),o=a.find(c=>!c.format)??a[0];if(!o)throw new Error(`Tag ${n} not found`);return o}return s.find(a=>a.identify?.(t)&&!a.format)}function _o(t,n,s){if(Hs(t)&&(t=t.contents),lt(t))return t;if(nt(t)){const g=s.schema[ns].createNode?.(s.schema,null,s);return g.items.push(t),g}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:a,onAnchor:o,onTagObj:c,schema:u,sourceObjects:d}=s;let h;if(a&&t&&typeof t=="object"){if(h=d.get(t),h)return h.anchor??(h.anchor=o(t)),new fu(h.anchor);h={anchor:null,node:null},d.set(t,h)}n?.startsWith("!!")&&(n=hC+n.slice(2));let p=mC(t,n,u.tags);if(!p){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const g=new _e(t);return h&&(h.node=g),g}p=t instanceof Map?u[ns]:Symbol.iterator in Object(t)?u[Jl]:u[ns]}c&&(c(p),delete s.onTagObj);const v=p?.createNode?p.createNode(s.schema,t,s):typeof p?.nodeClass?.from=="function"?p.nodeClass.from(s.schema,t,s):new _e(t);return n?v.tag=n:p.default||(v.tag=p.tag),h&&(h.node=v),v}function Ic(t,n,s){let a=s;for(let o=n.length-1;o>=0;--o){const c=n[o];if(typeof c=="number"&&Number.isInteger(c)&&c>=0){const u=[];u[c]=a,a=u}else a=new Map([[c,a]])}return _o(a,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const uo=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;class k1 extends Ph{constructor(n,s){super(n),Object.defineProperty(this,"schema",{value:s,configurable:!0,enumerable:!1,writable:!0})}clone(n){const s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return n&&(s.schema=n),s.items=s.items.map(a=>lt(a)||nt(a)?a.clone(n):a),this.range&&(s.range=this.range.slice()),s}addIn(n,s){if(uo(n))this.add(s);else{const[a,...o]=n,c=this.get(a,!0);if(st(c))c.addIn(o,s);else if(c===void 0&&this.schema)this.set(a,Ic(this.schema,o,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${o}`)}}deleteIn(n){const[s,...a]=n;if(a.length===0)return this.delete(s);const o=this.get(s,!0);if(st(o))return o.deleteIn(a);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${a}`)}getIn(n,s){const[a,...o]=n,c=this.get(a,!0);return o.length===0?!s&&Ke(c)?c.value:c:st(c)?c.getIn(o,s):void 0}hasAllNullValues(n){return this.items.every(s=>{if(!nt(s))return!1;const a=s.value;return a==null||n&&Ke(a)&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn(n){const[s,...a]=n;if(a.length===0)return this.has(s);const o=this.get(s,!0);return st(o)?o.hasIn(a):!1}setIn(n,s){const[a,...o]=n;if(o.length===0)this.set(a,s);else{const c=this.get(a,!0);if(st(c))c.setIn(o,s);else if(c===void 0&&this.schema)this.set(a,Ic(this.schema,o,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${o}`)}}}const pC=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function mi(t,n){return/^\n+$/.test(t)?t.substring(1):n?t.replace(/^(?! *$)/gm,n):t}const As=(t,n,s)=>t.endsWith(`
|
|
17
|
+
`)?mi(s,n):s.includes(`
|
|
18
|
+
`)?`
|
|
19
|
+
`+mi(s,n):(t.endsWith(" ")?"":" ")+s,j1="flow",Nh="block",Oc="quoted";function du(t,n,s="flow",{indentAtStart:a,lineWidth:o=80,minContentWidth:c=20,onFold:u,onOverflow:d}={}){if(!o||o<0)return t;o<c&&(c=0);const h=Math.max(1+c,1+o-n.length);if(t.length<=h)return t;const p=[],v={};let g=o-n.length;typeof a=="number"&&(a>o-Math.max(2,c)?p.push(0):g=o-a);let y,S,w=!1,E=-1,N=-1,C=-1;s===Nh&&(E=pv(t,E,n.length),E!==-1&&(g=E+h));for(let _;_=t[E+=1];){if(s===Oc&&_==="\\"){switch(N=E,t[E+1]){case"x":E+=3;break;case"u":E+=5;break;case"U":E+=9;break;default:E+=1}C=E}if(_===`
|
|
20
|
+
`)s===Nh&&(E=pv(t,E,n.length)),g=E+n.length+h,y=void 0;else{if(_===" "&&S&&S!==" "&&S!==`
|
|
21
|
+
`&&S!==" "){const A=t[E+1];A&&A!==" "&&A!==`
|
|
22
|
+
`&&A!==" "&&(y=E)}if(E>=g)if(y)p.push(y),g=y+h,y=void 0;else if(s===Oc){for(;S===" "||S===" ";)S=_,_=t[E+=1],w=!0;const A=E>C+1?E-2:N-1;if(v[A])return t;p.push(A),v[A]=!0,g=A+h,y=void 0}else w=!0}S=_}if(w&&d&&d(),p.length===0)return t;u&&u();let j=t.slice(0,p[0]);for(let _=0;_<p.length;++_){const A=p[_],T=p[_+1]||t.length;A===0?j=`
|
|
23
|
+
${n}${t.slice(0,T)}`:(s===Oc&&v[A]&&(j+=`${t[A]}\\`),j+=`
|
|
24
|
+
${n}${t.slice(A+1,T)}`)}return j}function pv(t,n,s){let a=n,o=n+1,c=t[o];for(;c===" "||c===" ";)if(n<o+s)c=t[++n];else{do c=t[++n];while(c&&c!==`
|
|
25
|
+
`);a=n,o=n+1,c=t[o]}return a}const hu=(t,n)=>({indentAtStart:n?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),mu=t=>/^(%|---|\.\.\.)/m.test(t);function gC(t,n,s){if(!n||n<0)return!1;const a=n-s,o=t.length;if(o<=a)return!1;for(let c=0,u=0;c<o;++c)if(t[c]===`
|
|
26
|
+
`){if(c-u>a)return!0;if(u=c+1,o-u<=a)return!1}return!0}function mo(t,n){const s=JSON.stringify(t);if(n.options.doubleQuotedAsJSON)return s;const{implicitKey:a}=n,o=n.options.doubleQuotedMinMultiLineLength,c=n.indent||(mu(t)?" ":"");let u="",d=0;for(let h=0,p=s[h];p;p=s[++h])if(p===" "&&s[h+1]==="\\"&&s[h+2]==="n"&&(u+=s.slice(d,h)+"\\ ",h+=1,d=h,p="\\"),p==="\\")switch(s[h+1]){case"u":{u+=s.slice(d,h);const v=s.substr(h+2,4);switch(v){case"0000":u+="\\0";break;case"0007":u+="\\a";break;case"000b":u+="\\v";break;case"001b":u+="\\e";break;case"0085":u+="\\N";break;case"00a0":u+="\\_";break;case"2028":u+="\\L";break;case"2029":u+="\\P";break;default:v.substr(0,2)==="00"?u+="\\x"+v.substr(2):u+=s.substr(h,6)}h+=5,d=h+1}break;case"n":if(a||s[h+2]==='"'||s.length<o)h+=1;else{for(u+=s.slice(d,h)+`
|
|
27
|
+
|
|
28
|
+
`;s[h+2]==="\\"&&s[h+3]==="n"&&s[h+4]!=='"';)u+=`
|
|
29
|
+
`,h+=2;u+=c,s[h+2]===" "&&(u+="\\"),h+=1,d=h+1}break;default:h+=1}return u=d?u+s.slice(d):s,a?u:du(u,c,Oc,hu(n,!1))}function _h(t,n){if(n.options.singleQuote===!1||n.implicitKey&&t.includes(`
|
|
30
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return mo(t,n);const s=n.indent||(mu(t)?" ":""),a="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
31
|
+
${s}`)+"'";return n.implicitKey?a:du(a,s,j1,hu(n,!1))}function Dl(t,n){const{singleQuote:s}=n.options;let a;if(s===!1)a=mo;else{const o=t.includes('"'),c=t.includes("'");o&&!c?a=_h:c&&!o?a=mo:a=s?_h:mo}return a(t,n)}let Ah;try{Ah=new RegExp(`(^|(?<!
|
|
32
|
+
))
|
|
33
|
+
+(?!
|
|
34
|
+
|$)`,"g")}catch{Ah=/\n+(?!\n|$)/g}function zc({comment:t,type:n,value:s},a,o,c){const{blockQuote:u,commentString:d,lineWidth:h}=a.options;if(!u||/\n[\t ]+$/.test(s))return Dl(s,a);const p=a.indent||(a.forceBlockIndent||mu(s)?" ":""),v=u==="literal"?!0:u==="folded"||n===_e.BLOCK_FOLDED?!1:n===_e.BLOCK_LITERAL?!0:!gC(s,h,p.length);if(!s)return v?`|
|
|
35
|
+
`:`>
|
|
36
|
+
`;let g,y;for(y=s.length;y>0;--y){const T=s[y-1];if(T!==`
|
|
37
|
+
`&&T!==" "&&T!==" ")break}let S=s.substring(y);const w=S.indexOf(`
|
|
38
|
+
`);w===-1?g="-":s===S||w!==S.length-1?(g="+",c&&c()):g="",S&&(s=s.slice(0,-S.length),S[S.length-1]===`
|
|
39
|
+
`&&(S=S.slice(0,-1)),S=S.replace(Ah,`$&${p}`));let E=!1,N,C=-1;for(N=0;N<s.length;++N){const T=s[N];if(T===" ")E=!0;else if(T===`
|
|
40
|
+
`)C=N;else break}let j=s.substring(0,C<N?C+1:N);j&&(s=s.substring(j.length),j=j.replace(/\n+/g,`$&${p}`));let A=(E?p?"2":"1":"")+g;if(t&&(A+=" "+d(t.replace(/ ?[\r\n]+/g," ")),o&&o()),!v){const T=s.replace(/\n+/g,`
|
|
41
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${p}`);let M=!1;const k=hu(a,!0);u!=="folded"&&n!==_e.BLOCK_FOLDED&&(k.onOverflow=()=>{M=!0});const R=du(`${j}${T}${S}`,p,Nh,k);if(!M)return`>${A}
|
|
42
|
+
${p}${R}`}return s=s.replace(/\n+/g,`$&${p}`),`|${A}
|
|
43
|
+
${p}${j}${s}${S}`}function yC(t,n,s,a){const{type:o,value:c}=t,{actualString:u,implicitKey:d,indent:h,indentStep:p,inFlow:v}=n;if(d&&c.includes(`
|
|
44
|
+
`)||v&&/[[\]{},]/.test(c))return Dl(c,n);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return d||v||!c.includes(`
|
|
45
|
+
`)?Dl(c,n):zc(t,n,s,a);if(!d&&!v&&o!==_e.PLAIN&&c.includes(`
|
|
46
|
+
`))return zc(t,n,s,a);if(mu(c)){if(h==="")return n.forceBlockIndent=!0,zc(t,n,s,a);if(d&&h===p)return Dl(c,n)}const g=c.replace(/\n+/g,`$&
|
|
47
|
+
${h}`);if(u){const y=E=>E.default&&E.tag!=="tag:yaml.org,2002:str"&&E.test?.test(g),{compat:S,tags:w}=n.doc.schema;if(w.some(y)||S?.some(y))return Dl(c,n)}return d?g:du(g,h,j1,hu(n,!1))}function Bo(t,n,s,a){const{implicitKey:o,inFlow:c}=n,u=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:d}=t;d!==_e.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(u.value)&&(d=_e.QUOTE_DOUBLE);const h=v=>{switch(v){case _e.BLOCK_FOLDED:case _e.BLOCK_LITERAL:return o||c?Dl(u.value,n):zc(u,n,s,a);case _e.QUOTE_DOUBLE:return mo(u.value,n);case _e.QUOTE_SINGLE:return _h(u.value,n);case _e.PLAIN:return yC(u,n,s,a);default:return null}};let p=h(d);if(p===null){const{defaultKeyType:v,defaultStringType:g}=n.options,y=o&&v||g;if(p=h(y),p===null)throw new Error(`Unsupported default string type ${y}`)}return p}function R1(t,n){const s=Object.assign({blockQuote:!0,commentString:pC,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,n);let a;switch(s.collectionStyle){case"block":a=!1;break;case"flow":a=!0;break;default:a=null}return{anchors:new Set,doc:t,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent=="number"?" ".repeat(s.indent):" ",inFlow:a,options:s}}function vC(t,n){if(n.tag){const o=t.filter(c=>c.tag===n.tag);if(o.length>0)return o.find(c=>c.format===n.format)??o[0]}let s,a;if(Ke(n)){a=n.value;let o=t.filter(c=>c.identify?.(a));if(o.length>1){const c=o.filter(u=>u.test);c.length>0&&(o=c)}s=o.find(c=>c.format===n.format)??o.find(c=>!c.format)}else a=n,s=t.find(o=>o.nodeClass&&a instanceof o.nodeClass);if(!s){const o=a?.constructor?.name??(a===null?"null":typeof a);throw new Error(`Tag not resolved for ${o} value`)}return s}function bC(t,n,{anchors:s,doc:a}){if(!a.directives)return"";const o=[],c=(Ke(t)||st(t))&&t.anchor;c&&C1(c)&&(s.add(c),o.push(`&${c}`));const u=t.tag??(n.default?null:n.tag);return u&&o.push(a.directives.tagString(u)),o.join(" ")}function Zl(t,n,s,a){if(nt(t))return t.toString(n,s,a);if(Bs(t)){if(n.doc.directives)return t.toString(n);if(n.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");n.resolvedAliases?n.resolvedAliases.add(t):n.resolvedAliases=new Set([t]),t=t.resolve(n.doc)}let o;const c=lt(t)?t:n.doc.createNode(t,{onTagObj:h=>o=h});o??(o=vC(n.doc.schema.tags,c));const u=bC(c,o,n);u.length>0&&(n.indentAtStart=(n.indentAtStart??0)+u.length+1);const d=typeof o.stringify=="function"?o.stringify(c,n,s,a):Ke(c)?Bo(c,n,s,a):c.toString(n,s,a);return u?Ke(c)||d[0]==="{"||d[0]==="["?`${u} ${d}`:`${u}
|
|
48
|
+
${n.indent}${d}`:d}function SC({key:t,value:n},s,a,o){const{allNullValues:c,doc:u,indent:d,indentStep:h,options:{commentString:p,indentSeq:v,simpleKeys:g}}=s;let y=lt(t)&&t.comment||null;if(g){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(st(t)||!lt(t)&&typeof t=="object"){const k="With simple keys, collection cannot be used as a key value";throw new Error(k)}}let S=!g&&(!t||y&&n==null&&!s.inFlow||st(t)||(Ke(t)?t.type===_e.BLOCK_FOLDED||t.type===_e.BLOCK_LITERAL:typeof t=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!S&&(g||!c),indent:d+h});let w=!1,E=!1,N=Zl(t,s,()=>w=!0,()=>E=!0);if(!S&&!s.inFlow&&N.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");S=!0}if(s.inFlow){if(c||n==null)return w&&a&&a(),N===""?"?":S?`? ${N}`:N}else if(c&&!g||n==null&&S)return N=`? ${N}`,y&&!w?N+=As(N,s.indent,p(y)):E&&o&&o(),N;w&&(y=null),S?(y&&(N+=As(N,s.indent,p(y))),N=`? ${N}
|
|
49
|
+
${d}:`):(N=`${N}:`,y&&(N+=As(N,s.indent,p(y))));let C,j,_;lt(n)?(C=!!n.spaceBefore,j=n.commentBefore,_=n.comment):(C=!1,j=null,_=null,n&&typeof n=="object"&&(n=u.createNode(n))),s.implicitKey=!1,!S&&!y&&Ke(n)&&(s.indentAtStart=N.length+1),E=!1,!v&&h.length>=2&&!s.inFlow&&!S&&Pl(n)&&!n.flow&&!n.tag&&!n.anchor&&(s.indent=s.indent.substring(2));let A=!1;const T=Zl(n,s,()=>A=!0,()=>E=!0);let M=" ";if(y||C||j){if(M=C?`
|
|
50
|
+
`:"",j){const k=p(j);M+=`
|
|
51
|
+
${mi(k,s.indent)}`}T===""&&!s.inFlow?M===`
|
|
52
|
+
`&&_&&(M=`
|
|
53
|
+
|
|
54
|
+
`):M+=`
|
|
55
|
+
${s.indent}`}else if(!S&&st(n)){const k=T[0],R=T.indexOf(`
|
|
56
|
+
`),U=R!==-1,te=s.inFlow??n.flow??n.items.length===0;if(U||!te){let Y=!1;if(U&&(k==="&"||k==="!")){let X=T.indexOf(" ");k==="&"&&X!==-1&&X<R&&T[X+1]==="!"&&(X=T.indexOf(" ",X+1)),(X===-1||R<X)&&(Y=!0)}Y||(M=`
|
|
57
|
+
${s.indent}`)}}else(T===""||T[0]===`
|
|
58
|
+
`)&&(M="");return N+=M+T,s.inFlow?A&&a&&a():_&&!A?N+=As(N,s.indent,p(_)):E&&o&&o(),N}function L1(t,n){(t==="debug"||t==="warn")&&console.warn(n)}const vc="<<",pi={identify:t=>t===vc||typeof t=="symbol"&&t.description===vc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new _e(Symbol(vc)),{addToJSMap:B1}),stringify:()=>vc},wC=(t,n)=>(pi.identify(n)||Ke(n)&&(!n.type||n.type===_e.PLAIN)&&pi.identify(n.value))&&t?.doc.schema.tags.some(s=>s.tag===pi.tag&&s.default);function B1(t,n,s){const a=H1(t,s);if(Pl(a))for(const o of a.items)eh(t,n,o);else if(Array.isArray(a))for(const o of a)eh(t,n,o);else eh(t,n,a)}function eh(t,n,s){const a=H1(t,s);if(!Wl(a))throw new Error("Merge sources must be maps or map aliases");const o=a.toJSON(null,t,Map);for(const[c,u]of o)n instanceof Map?n.has(c)||n.set(c,u):n instanceof Set?n.add(c):Object.prototype.hasOwnProperty.call(n,c)||Object.defineProperty(n,c,{value:u,writable:!0,enumerable:!0,configurable:!0});return n}function H1(t,n){return t&&Bs(n)?n.resolve(t.doc,t):n}function $1(t,n,{key:s,value:a}){if(lt(s)&&s.addToJSMap)s.addToJSMap(t,n,a);else if(wC(t,s))B1(t,n,a);else{const o=yn(s,"",t);if(n instanceof Map)n.set(o,yn(a,o,t));else if(n instanceof Set)n.add(o);else{const c=xC(s,o,t),u=yn(a,c,t);c in n?Object.defineProperty(n,c,{value:u,writable:!0,enumerable:!0,configurable:!0}):n[c]=u}}return n}function xC(t,n,s){if(n===null)return"";if(typeof n!="object")return String(n);if(lt(t)&&s?.doc){const a=R1(s.doc,{});a.anchors=new Set;for(const c of s.anchors.keys())a.anchors.add(c.anchor);a.inFlow=!0,a.inStringifyKey=!0;const o=t.toString(a);if(!s.mapKeyWarned){let c=JSON.stringify(o);c.length>40&&(c=c.substring(0,36)+'..."'),L1(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${c}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return o}return JSON.stringify(n)}function em(t,n,s){const a=_o(t,void 0,s),o=_o(n,void 0,s);return new Rt(a,o)}class Rt{constructor(n,s=null){Object.defineProperty(this,vn,{value:E1}),this.key=n,this.value=s}clone(n){let{key:s,value:a}=this;return lt(s)&&(s=s.clone(n)),lt(a)&&(a=a.clone(n)),new Rt(s,a)}toJSON(n,s){const a=s?.mapAsMap?new Map:{};return $1(s,a,this)}toString(n,s,a){return n?.doc?SC(this,n,s,a):JSON.stringify(this)}}function U1(t,n,s){return(n.inFlow??t.flow?NC:EC)(t,n,s)}function EC({comment:t,items:n},s,{blockItemPrefix:a,flowChars:o,itemIndent:c,onChompKeep:u,onComment:d}){const{indent:h,options:{commentString:p}}=s,v=Object.assign({},s,{indent:c,type:null});let g=!1;const y=[];for(let w=0;w<n.length;++w){const E=n[w];let N=null;if(lt(E))!g&&E.spaceBefore&&y.push(""),Xc(s,y,E.commentBefore,g),E.comment&&(N=E.comment);else if(nt(E)){const j=lt(E.key)?E.key:null;j&&(!g&&j.spaceBefore&&y.push(""),Xc(s,y,j.commentBefore,g))}g=!1;let C=Zl(E,v,()=>N=null,()=>g=!0);N&&(C+=As(C,c,p(N))),g&&N&&(g=!1),y.push(a+C)}let S;if(y.length===0)S=o.start+o.end;else{S=y[0];for(let w=1;w<y.length;++w){const E=y[w];S+=E?`
|
|
59
|
+
${h}${E}`:`
|
|
60
|
+
`}}return t?(S+=`
|
|
61
|
+
`+mi(p(t),h),d&&d()):g&&u&&u(),S}function NC({items:t},n,{flowChars:s,itemIndent:a}){const{indent:o,indentStep:c,flowCollectionPadding:u,options:{commentString:d}}=n;a+=c;const h=Object.assign({},n,{indent:a,inFlow:!0,type:null});let p=!1,v=0;const g=[];for(let w=0;w<t.length;++w){const E=t[w];let N=null;if(lt(E))E.spaceBefore&&g.push(""),Xc(n,g,E.commentBefore,!1),E.comment&&(N=E.comment);else if(nt(E)){const j=lt(E.key)?E.key:null;j&&(j.spaceBefore&&g.push(""),Xc(n,g,j.commentBefore,!1),j.comment&&(p=!0));const _=lt(E.value)?E.value:null;_?(_.comment&&(N=_.comment),_.commentBefore&&(p=!0)):E.value==null&&j?.comment&&(N=j.comment)}N&&(p=!0);let C=Zl(E,h,()=>N=null);p||(p=g.length>v||C.includes(`
|
|
62
|
+
`)),w<t.length-1?C+=",":n.options.trailingComma&&(n.options.lineWidth>0&&(p||(p=g.reduce((j,_)=>j+_.length+2,2)+(C.length+2)>n.options.lineWidth)),p&&(C+=",")),N&&(C+=As(C,a,d(N))),g.push(C),v=g.length}const{start:y,end:S}=s;if(g.length===0)return y+S;if(!p){const w=g.reduce((E,N)=>E+N.length+2,2);p=n.options.lineWidth>0&&w>n.options.lineWidth}if(p){let w=y;for(const E of g)w+=E?`
|
|
63
|
+
${c}${o}${E}`:`
|
|
64
|
+
`;return`${w}
|
|
65
|
+
${o}${S}`}else return`${y}${u}${g.join(" ")}${u}${S}`}function Xc({indent:t,options:{commentString:n}},s,a,o){if(a&&o&&(a=a.replace(/^\n+/,"")),a){const c=mi(n(a),t);s.push(c.trimStart())}}function Ts(t,n){const s=Ke(n)?n.value:n;for(const a of t)if(nt(a)&&(a.key===n||a.key===s||Ke(a.key)&&a.key.value===s))return a}class ln extends k1{static get tagName(){return"tag:yaml.org,2002:map"}constructor(n){super(ns,n),this.items=[]}static from(n,s,a){const{keepUndefined:o,replacer:c}=a,u=new this(n),d=(h,p)=>{if(typeof c=="function")p=c.call(s,h,p);else if(Array.isArray(c)&&!c.includes(h))return;(p!==void 0||o)&&u.items.push(em(h,p,a))};if(s instanceof Map)for(const[h,p]of s)d(h,p);else if(s&&typeof s=="object")for(const h of Object.keys(s))d(h,s[h]);return typeof n.sortMapEntries=="function"&&u.items.sort(n.sortMapEntries),u}add(n,s){let a;nt(n)?a=n:!n||typeof n!="object"||!("key"in n)?a=new Rt(n,n?.value):a=new Rt(n.key,n.value);const o=Ts(this.items,a.key),c=this.schema?.sortMapEntries;if(o){if(!s)throw new Error(`Key ${a.key} already set`);Ke(o.value)&&D1(a.value)?o.value.value=a.value:o.value=a.value}else if(c){const u=this.items.findIndex(d=>c(a,d)<0);u===-1?this.items.push(a):this.items.splice(u,0,a)}else this.items.push(a)}delete(n){const s=Ts(this.items,n);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(n,s){const o=Ts(this.items,n)?.value;return(!s&&Ke(o)?o.value:o)??void 0}has(n){return!!Ts(this.items,n)}set(n,s){this.add(new Rt(n,s),!0)}toJSON(n,s,a){const o=a?new a:s?.mapAsMap?new Map:{};s?.onCreate&&s.onCreate(o);for(const c of this.items)$1(s,o,c);return o}toString(n,s,a){if(!n)return JSON.stringify(this);for(const o of this.items)if(!nt(o))throw new Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);return!n.allNullValues&&this.hasAllNullValues(!1)&&(n=Object.assign({},n,{allNullValues:!0})),U1(this,n,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:n.indent||"",onChompKeep:a,onComment:s})}}const ea={collection:"map",default:!0,nodeClass:ln,tag:"tag:yaml.org,2002:map",resolve(t,n){return Wl(t)||n("Expected a mapping for this tag"),t},createNode:(t,n,s)=>ln.from(t,n,s)};class is extends k1{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(n){super(Jl,n),this.items=[]}add(n){this.items.push(n)}delete(n){const s=bc(n);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(n,s){const a=bc(n);if(typeof a!="number")return;const o=this.items[a];return!s&&Ke(o)?o.value:o}has(n){const s=bc(n);return typeof s=="number"&&s<this.items.length}set(n,s){const a=bc(n);if(typeof a!="number")throw new Error(`Expected a valid index, not ${n}.`);const o=this.items[a];Ke(o)&&D1(s)?o.value=s:this.items[a]=s}toJSON(n,s){const a=[];s?.onCreate&&s.onCreate(a);let o=0;for(const c of this.items)a.push(yn(c,String(o++),s));return a}toString(n,s,a){return n?U1(this,n,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(n.indent||"")+" ",onChompKeep:a,onComment:s}):JSON.stringify(this)}static from(n,s,a){const{replacer:o}=a,c=new this(n);if(s&&Symbol.iterator in Object(s)){let u=0;for(let d of s){if(typeof o=="function"){const h=s instanceof Set?d:String(u++);d=o.call(s,h,d)}c.items.push(_o(d,void 0,a))}}return c}}function bc(t){let n=Ke(t)?t.value:t;return n&&typeof n=="string"&&(n=Number(n)),typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}const ta={collection:"seq",default:!0,nodeClass:is,tag:"tag:yaml.org,2002:seq",resolve(t,n){return Pl(t)||n("Expected a sequence for this tag"),t},createNode:(t,n,s)=>is.from(t,n,s)},pu={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,n,s,a){return n=Object.assign({actualString:!0},n),Bo(t,n,s,a)}},gu={identify:t=>t==null,createNode:()=>new _e(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new _e(null),stringify:({source:t},n)=>typeof t=="string"&&gu.test.test(t)?t:n.options.nullStr},tm={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new _e(t[0]==="t"||t[0]==="T"),stringify({source:t,value:n},s){if(t&&tm.test.test(t)){const a=t[0]==="t"||t[0]==="T";if(n===a)return t}return n?s.options.trueStr:s.options.falseStr}};function Dn({format:t,minFractionDigits:n,tag:s,value:a}){if(typeof a=="bigint")return String(a);const o=typeof a=="number"?a:Number(a);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let c=Object.is(a,-0)?"-0":JSON.stringify(a);if(!t&&n&&(!s||s==="tag:yaml.org,2002:float")&&/^-?\d/.test(c)&&!c.includes("e")){let u=c.indexOf(".");u<0&&(u=c.length,c+=".");let d=n-(c.length-u-1);for(;d-- >0;)c+="0"}return c}const q1={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Dn},V1={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const n=Number(t.value);return isFinite(n)?n.toExponential():Dn(t)}},Y1={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const n=new _e(parseFloat(t)),s=t.indexOf(".");return s!==-1&&t[t.length-1]==="0"&&(n.minFractionDigits=t.length-s-1),n},stringify:Dn},yu=t=>typeof t=="bigint"||Number.isInteger(t),nm=(t,n,s,{intAsBigInt:a})=>a?BigInt(t):parseInt(t.substring(n),s);function G1(t,n,s){const{value:a}=t;return yu(a)&&a>=0?s+a.toString(n):Dn(t)}const I1={identify:t=>yu(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,n,s)=>nm(t,2,8,s),stringify:t=>G1(t,8,"0o")},X1={identify:yu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,n,s)=>nm(t,0,10,s),stringify:Dn},K1={identify:t=>yu(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,n,s)=>nm(t,2,16,s),stringify:t=>G1(t,16,"0x")},_C=[ea,ta,pu,gu,tm,I1,X1,K1,q1,V1,Y1];function gv(t){return typeof t=="bigint"||Number.isInteger(t)}const Sc=({value:t})=>JSON.stringify(t),AC=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Sc},{identify:t=>t==null,createNode:()=>new _e(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Sc},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Sc},{identify:gv,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,n,{intAsBigInt:s})=>s?BigInt(t):parseInt(t,10),stringify:({value:t})=>gv(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Sc}],TC={default:!0,tag:"",test:/^/,resolve(t,n){return n(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},MC=[ea,ta].concat(AC,TC),im={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,n){if(typeof atob=="function"){const s=atob(t.replace(/[\n\r]/g,"")),a=new Uint8Array(s.length);for(let o=0;o<s.length;++o)a[o]=s.charCodeAt(o);return a}else return n("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:n,value:s},a,o,c){if(!s)return"";const u=s;let d;if(typeof btoa=="function"){let h="";for(let p=0;p<u.length;++p)h+=String.fromCharCode(u[p]);d=btoa(h)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(n??(n=_e.BLOCK_LITERAL),n!==_e.QUOTE_DOUBLE){const h=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),p=Math.ceil(d.length/h),v=new Array(p);for(let g=0,y=0;g<p;++g,y+=h)v[g]=d.substr(y,h);d=v.join(n===_e.BLOCK_LITERAL?`
|
|
66
|
+
`:" ")}return Bo({comment:t,type:n,value:d},a,o,c)}};function Z1(t,n){if(Pl(t))for(let s=0;s<t.items.length;++s){let a=t.items[s];if(!nt(a)){if(Wl(a)){a.items.length>1&&n("Each pair must have its own sequence indicator");const o=a.items[0]||new Rt(new _e(null));if(a.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${a.commentBefore}
|
|
67
|
+
${o.key.commentBefore}`:a.commentBefore),a.comment){const c=o.value??o.key;c.comment=c.comment?`${a.comment}
|
|
68
|
+
${c.comment}`:a.comment}a=o}t.items[s]=nt(a)?a:new Rt(a)}}else n("Expected a sequence for this tag");return t}function Q1(t,n,s){const{replacer:a}=s,o=new is(t);o.tag="tag:yaml.org,2002:pairs";let c=0;if(n&&Symbol.iterator in Object(n))for(let u of n){typeof a=="function"&&(u=a.call(n,String(c++),u));let d,h;if(Array.isArray(u))if(u.length===2)d=u[0],h=u[1];else throw new TypeError(`Expected [key, value] tuple: ${u}`);else if(u&&u instanceof Object){const p=Object.keys(u);if(p.length===1)d=p[0],h=u[d];else throw new TypeError(`Expected tuple with one key, not ${p.length} keys`)}else d=u;o.items.push(em(d,h,s))}return o}const sm={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Z1,createNode:Q1};class Ll extends is{constructor(){super(),this.add=ln.prototype.add.bind(this),this.delete=ln.prototype.delete.bind(this),this.get=ln.prototype.get.bind(this),this.has=ln.prototype.has.bind(this),this.set=ln.prototype.set.bind(this),this.tag=Ll.tag}toJSON(n,s){if(!s)return super.toJSON(n);const a=new Map;s?.onCreate&&s.onCreate(a);for(const o of this.items){let c,u;if(nt(o)?(c=yn(o.key,"",s),u=yn(o.value,c,s)):c=yn(o,"",s),a.has(c))throw new Error("Ordered maps must not include duplicate keys");a.set(c,u)}return a}static from(n,s,a){const o=Q1(n,s,a),c=new this;return c.items=o.items,c}}Ll.tag="tag:yaml.org,2002:omap";const lm={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ll,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,n){const s=Z1(t,n),a=[];for(const{key:o}of s.items)Ke(o)&&(a.includes(o.value)?n(`Ordered maps must not include duplicate keys: ${o.value}`):a.push(o.value));return Object.assign(new Ll,s)},createNode:(t,n,s)=>Ll.from(t,n,s)};function F1({value:t,source:n},s){return n&&(t?J1:W1).test.test(n)?n:t?s.options.trueStr:s.options.falseStr}const J1={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new _e(!0),stringify:F1},W1={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new _e(!1),stringify:F1},CC={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Dn},OC={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const n=Number(t.value);return isFinite(n)?n.toExponential():Dn(t)}},zC={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const n=new _e(parseFloat(t.replace(/_/g,""))),s=t.indexOf(".");if(s!==-1){const a=t.substring(s+1).replace(/_/g,"");a[a.length-1]==="0"&&(n.minFractionDigits=a.length)}return n},stringify:Dn},Ho=t=>typeof t=="bigint"||Number.isInteger(t);function vu(t,n,s,{intAsBigInt:a}){const o=t[0];if((o==="-"||o==="+")&&(n+=1),t=t.substring(n).replace(/_/g,""),a){switch(s){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}const u=BigInt(t);return o==="-"?BigInt(-1)*u:u}const c=parseInt(t,s);return o==="-"?-1*c:c}function am(t,n,s){const{value:a}=t;if(Ho(a)){const o=a.toString(n);return a<0?"-"+s+o.substr(1):s+o}return Dn(t)}const DC={identify:Ho,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,n,s)=>vu(t,2,2,s),stringify:t=>am(t,2,"0b")},kC={identify:Ho,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,n,s)=>vu(t,1,8,s),stringify:t=>am(t,8,"0")},jC={identify:Ho,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,n,s)=>vu(t,0,10,s),stringify:Dn},RC={identify:Ho,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,n,s)=>vu(t,2,16,s),stringify:t=>am(t,16,"0x")};class Bl extends ln{constructor(n){super(n),this.tag=Bl.tag}add(n){let s;nt(n)?s=n:n&&typeof n=="object"&&"key"in n&&"value"in n&&n.value===null?s=new Rt(n.key,null):s=new Rt(n,null),Ts(this.items,s.key)||this.items.push(s)}get(n,s){const a=Ts(this.items,n);return!s&&nt(a)?Ke(a.key)?a.key.value:a.key:a}set(n,s){if(typeof s!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof s}`);const a=Ts(this.items,n);a&&!s?this.items.splice(this.items.indexOf(a),1):!a&&s&&this.items.push(new Rt(n))}toJSON(n,s){return super.toJSON(n,s,Set)}toString(n,s,a){if(!n)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},n,{allNullValues:!0}),s,a);throw new Error("Set items must all have null values")}static from(n,s,a){const{replacer:o}=a,c=new this(n);if(s&&Symbol.iterator in Object(s))for(let u of s)typeof o=="function"&&(u=o.call(s,u,u)),c.items.push(em(u,null,a));return c}}Bl.tag="tag:yaml.org,2002:set";const om={collection:"map",identify:t=>t instanceof Set,nodeClass:Bl,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,n,s)=>Bl.from(t,n,s),resolve(t,n){if(Wl(t)){if(t.hasAllNullValues(!0))return Object.assign(new Bl,t);n("Set items must all have null values")}else n("Expected a mapping for this tag");return t}};function rm(t,n){const s=t[0],a=s==="-"||s==="+"?t.substring(1):t,o=u=>n?BigInt(u):Number(u),c=a.replace(/_/g,"").split(":").reduce((u,d)=>u*o(60)+o(d),o(0));return s==="-"?o(-1)*c:c}function P1(t){let{value:n}=t,s=u=>u;if(typeof n=="bigint")s=u=>BigInt(u);else if(isNaN(n)||!isFinite(n))return Dn(t);let a="";n<0&&(a="-",n*=s(-1));const o=s(60),c=[n%o];return n<60?c.unshift(0):(n=(n-c[0])/o,c.unshift(n%o),n>=60&&(n=(n-c[0])/o,c.unshift(n))),a+c.map(u=>String(u).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const eS={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,n,{intAsBigInt:s})=>rm(t,s),stringify:P1},tS={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>rm(t,!1),stringify:P1},bu={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const n=t.match(bu.test);if(!n)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,a,o,c,u,d]=n.map(Number),h=n[7]?Number((n[7]+"00").substr(1,3)):0;let p=Date.UTC(s,a-1,o,c||0,u||0,d||0,h);const v=n[8];if(v&&v!=="Z"){let g=rm(v,!1);Math.abs(g)<30&&(g*=60),p-=6e4*g}return new Date(p)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},yv=[ea,ta,pu,gu,J1,W1,DC,kC,jC,RC,CC,OC,zC,im,pi,lm,sm,om,eS,tS,bu],vv=new Map([["core",_C],["failsafe",[ea,ta,pu]],["json",MC],["yaml11",yv],["yaml-1.1",yv]]),bv={binary:im,bool:tm,float:Y1,floatExp:V1,floatNaN:q1,floatTime:tS,int:X1,intHex:K1,intOct:I1,intTime:eS,map:ea,merge:pi,null:gu,omap:lm,pairs:sm,seq:ta,set:om,timestamp:bu},LC={"tag:yaml.org,2002:binary":im,"tag:yaml.org,2002:merge":pi,"tag:yaml.org,2002:omap":lm,"tag:yaml.org,2002:pairs":sm,"tag:yaml.org,2002:set":om,"tag:yaml.org,2002:timestamp":bu};function th(t,n,s){const a=vv.get(n);if(a&&!t)return s&&!a.includes(pi)?a.concat(pi):a.slice();let o=a;if(!o)if(Array.isArray(t))o=[];else{const c=Array.from(vv.keys()).filter(u=>u!=="yaml11").map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown schema "${n}"; use one of ${c} or define customTags array`)}if(Array.isArray(t))for(const c of t)o=o.concat(c);else typeof t=="function"&&(o=t(o.slice()));return s&&(o=o.concat(pi)),o.reduce((c,u)=>{const d=typeof u=="string"?bv[u]:u;if(!d){const h=JSON.stringify(u),p=Object.keys(bv).map(v=>JSON.stringify(v)).join(", ");throw new Error(`Unknown custom tag ${h}; use one of ${p}`)}return c.includes(d)||c.push(d),c},[])}const BC=(t,n)=>t.key<n.key?-1:t.key>n.key?1:0;class Su{constructor({compat:n,customTags:s,merge:a,resolveKnownTags:o,schema:c,sortMapEntries:u,toStringDefaults:d}){this.compat=Array.isArray(n)?th(n,"compat"):n?th(null,n):null,this.name=typeof c=="string"&&c||"core",this.knownTags=o?LC:{},this.tags=th(s,this.name,a),this.toStringOptions=d??null,Object.defineProperty(this,ns,{value:ea}),Object.defineProperty(this,qn,{value:pu}),Object.defineProperty(this,Jl,{value:ta}),this.sortMapEntries=typeof u=="function"?u:u===!0?BC:null}clone(){const n=Object.create(Su.prototype,Object.getOwnPropertyDescriptors(this));return n.tags=this.tags.slice(),n}}function HC(t,n){const s=[];let a=n.directives===!0;if(n.directives!==!1&&t.directives){const h=t.directives.toString(t);h?(s.push(h),a=!0):t.directives.docStart&&(a=!0)}a&&s.push("---");const o=R1(t,n),{commentString:c}=o.options;if(t.commentBefore){s.length!==1&&s.unshift("");const h=c(t.commentBefore);s.unshift(mi(h,""))}let u=!1,d=null;if(t.contents){if(lt(t.contents)){if(t.contents.spaceBefore&&a&&s.push(""),t.contents.commentBefore){const v=c(t.contents.commentBefore);s.push(mi(v,""))}o.forceBlockIndent=!!t.comment,d=t.contents.comment}const h=d?void 0:()=>u=!0;let p=Zl(t.contents,o,()=>d=null,h);d&&(p+=As(p,"",c(d))),(p[0]==="|"||p[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${p}`:s.push(p)}else s.push(Zl(t.contents,o));if(t.directives?.docEnd)if(t.comment){const h=c(t.comment);h.includes(`
|
|
69
|
+
`)?(s.push("..."),s.push(mi(h,""))):s.push(`... ${h}`)}else s.push("...");else{let h=t.comment;h&&u&&(h=h.replace(/^\n+/,"")),h&&((!u||d)&&s[s.length-1]!==""&&s.push(""),s.push(mi(c(h),"")))}return s.join(`
|
|
70
|
+
`)+`
|
|
71
|
+
`}class na{constructor(n,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,vn,{value:Eh});let o=null;typeof s=="function"||Array.isArray(s)?o=s:a===void 0&&s&&(a=s,s=void 0);const c=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},a);this.options=c;let{version:u}=c;a?._directives?(this.directives=a._directives.atDocument(),this.directives.yaml.explicit&&(u=this.directives.yaml.version)):this.directives=new Ht({version:u}),this.setSchema(u,a),this.contents=n===void 0?null:this.createNode(n,o,a)}clone(){const n=Object.create(na.prototype,{[vn]:{value:Eh}});return n.commentBefore=this.commentBefore,n.comment=this.comment,n.errors=this.errors.slice(),n.warnings=this.warnings.slice(),n.options=Object.assign({},this.options),this.directives&&(n.directives=this.directives.clone()),n.schema=this.schema.clone(),n.contents=lt(this.contents)?this.contents.clone(n.schema):this.contents,this.range&&(n.range=this.range.slice()),n}add(n){Nl(this.contents)&&this.contents.add(n)}addIn(n,s){Nl(this.contents)&&this.contents.addIn(n,s)}createAlias(n,s){if(!n.anchor){const a=O1(this);n.anchor=!s||a.has(s)?z1(s||"a",a):s}return new fu(n.anchor)}createNode(n,s,a){let o;if(typeof s=="function")n=s.call({"":n},"",n),o=s;else if(Array.isArray(s)){const N=j=>typeof j=="number"||j instanceof String||j instanceof Number,C=s.filter(N).map(String);C.length>0&&(s=s.concat(C)),o=s}else a===void 0&&s&&(a=s,s=void 0);const{aliasDuplicateObjects:c,anchorPrefix:u,flow:d,keepUndefined:h,onTagObj:p,tag:v}=a??{},{onAnchor:g,setAnchors:y,sourceObjects:S}=dC(this,u||"a"),w={aliasDuplicateObjects:c??!0,keepUndefined:h??!1,onAnchor:g,onTagObj:p,replacer:o,schema:this.schema,sourceObjects:S},E=_o(n,v,w);return d&&st(E)&&(E.flow=!0),y(),E}createPair(n,s,a={}){const o=this.createNode(n,null,a),c=this.createNode(s,null,a);return new Rt(o,c)}delete(n){return Nl(this.contents)?this.contents.delete(n):!1}deleteIn(n){return uo(n)?this.contents==null?!1:(this.contents=null,!0):Nl(this.contents)?this.contents.deleteIn(n):!1}get(n,s){return st(this.contents)?this.contents.get(n,s):void 0}getIn(n,s){return uo(n)?!s&&Ke(this.contents)?this.contents.value:this.contents:st(this.contents)?this.contents.getIn(n,s):void 0}has(n){return st(this.contents)?this.contents.has(n):!1}hasIn(n){return uo(n)?this.contents!==void 0:st(this.contents)?this.contents.hasIn(n):!1}set(n,s){this.contents==null?this.contents=Ic(this.schema,[n],s):Nl(this.contents)&&this.contents.set(n,s)}setIn(n,s){uo(n)?this.contents=s:this.contents==null?this.contents=Ic(this.schema,Array.from(n),s):Nl(this.contents)&&this.contents.setIn(n,s)}setSchema(n,s={}){typeof n=="number"&&(n=String(n));let a;switch(n){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ht({version:"1.1"}),a={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=n:this.directives=new Ht({version:n}),a={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,a=null;break;default:{const o=JSON.stringify(n);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${o}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(a)this.schema=new Su(Object.assign(a,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:n,jsonArg:s,mapAsMap:a,maxAliasCount:o,onAnchor:c,reviver:u}={}){const d={anchors:new Map,doc:this,keep:!n,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},h=yn(this.contents,s??"",d);if(typeof c=="function")for(const{count:p,res:v}of d.anchors.values())c(v,p);return typeof u=="function"?zl(u,{"":h},"",h):h}toJSON(n,s){return this.toJS({json:!0,jsonArg:n,mapAsMap:!1,onAnchor:s})}toString(n={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in n&&(!Number.isInteger(n.indent)||Number(n.indent)<=0)){const s=JSON.stringify(n.indent);throw new Error(`"indent" option must be a positive integer, not ${s}`)}return HC(this,n)}}function Nl(t){if(st(t))return!0;throw new Error("Expected a YAML collection as document contents")}class cm extends Error{constructor(n,s,a,o){super(),this.name=n,this.code=a,this.message=o,this.pos=s}}class Ms extends cm{constructor(n,s,a){super("YAMLParseError",n,s,a)}}class nS extends cm{constructor(n,s,a){super("YAMLWarning",n,s,a)}}const Kc=(t,n)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(d=>n.linePos(d));const{line:a,col:o}=s.linePos[0];s.message+=` at line ${a}, column ${o}`;let c=o-1,u=t.substring(n.lineStarts[a-1],n.lineStarts[a]).replace(/[\n\r]+$/,"");if(c>=60&&u.length>80){const d=Math.min(c-39,u.length-79);u="…"+u.substring(d),c-=d-1}if(u.length>80&&(u=u.substring(0,79)+"…"),a>1&&/^ *$/.test(u.substring(0,c))){let d=t.substring(n.lineStarts[a-2],n.lineStarts[a-1]);d.length>80&&(d=d.substring(0,79)+`…
|
|
72
|
+
`),u=d+u}if(/[^ ]/.test(u)){let d=1;const h=s.linePos[1];h?.line===a&&h.col>o&&(d=Math.max(1,Math.min(h.col-o,80-c)));const p=" ".repeat(c)+"^".repeat(d);s.message+=`:
|
|
73
|
+
|
|
74
|
+
${u}
|
|
75
|
+
${p}
|
|
76
|
+
`}};function Ql(t,{flow:n,indicator:s,next:a,offset:o,onError:c,parentIndent:u,startOnNewline:d}){let h=!1,p=d,v=d,g="",y="",S=!1,w=!1,E=null,N=null,C=null,j=null,_=null,A=null,T=null;for(const R of t)switch(w&&(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma"&&c(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),E&&(p&&R.type!=="comment"&&R.type!=="newline"&&c(E,"TAB_AS_INDENT","Tabs are not allowed as indentation"),E=null),R.type){case"space":!n&&(s!=="doc-start"||a?.type!=="flow-collection")&&R.source.includes(" ")&&(E=R),v=!0;break;case"comment":{v||c(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const U=R.source.substring(1)||" ";g?g+=y+U:g=U,y="",p=!1;break}case"newline":p?g?g+=R.source:(!A||s!=="seq-item-ind")&&(h=!0):y+=R.source,p=!0,S=!0,(N||C)&&(j=R),v=!0;break;case"anchor":N&&c(R,"MULTIPLE_ANCHORS","A node can have at most one anchor"),R.source.endsWith(":")&&c(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),N=R,T??(T=R.offset),p=!1,v=!1,w=!0;break;case"tag":{C&&c(R,"MULTIPLE_TAGS","A node can have at most one tag"),C=R,T??(T=R.offset),p=!1,v=!1,w=!0;break}case s:(N||C)&&c(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),A&&c(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${n??"collection"}`),A=R,p=s==="seq-item-ind"||s==="explicit-key-ind",v=!1;break;case"comma":if(n){_&&c(R,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`),_=R,p=!1,v=!1;break}default:c(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),p=!1,v=!1}const M=t[t.length-1],k=M?M.offset+M.source.length:o;return w&&a&&a.type!=="space"&&a.type!=="newline"&&a.type!=="comma"&&(a.type!=="scalar"||a.source!=="")&&c(a.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),E&&(p&&E.indent<=u||a?.type==="block-map"||a?.type==="block-seq")&&c(E,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:A,spaceBefore:h,comment:g,hasNewline:S,anchor:N,tag:C,newlineAfterProp:j,end:k,start:T??k}}function Ao(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
77
|
+
`))return!0;if(t.end){for(const n of t.end)if(n.type==="newline")return!0}return!1;case"flow-collection":for(const n of t.items){for(const s of n.start)if(s.type==="newline")return!0;if(n.sep){for(const s of n.sep)if(s.type==="newline")return!0}if(Ao(n.key)||Ao(n.value))return!0}return!1;default:return!0}}function Th(t,n,s){if(n?.type==="flow-collection"){const a=n.end[0];a.indent===t&&(a.source==="]"||a.source==="}")&&Ao(n)&&s(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function iS(t,n,s){const{uniqueKeys:a}=t.options;if(a===!1)return!1;const o=typeof a=="function"?a:(c,u)=>c===u||Ke(c)&&Ke(u)&&c.value===u.value;return n.some(c=>o(c.key,s))}const Sv="All mapping items must start at the same column";function $C({composeNode:t,composeEmptyNode:n},s,a,o,c){const u=c?.nodeClass??ln,d=new u(s.schema);s.atRoot&&(s.atRoot=!1);let h=a.offset,p=null;for(const v of a.items){const{start:g,key:y,sep:S,value:w}=v,E=Ql(g,{indicator:"explicit-key-ind",next:y??S?.[0],offset:h,onError:o,parentIndent:a.indent,startOnNewline:!0}),N=!E.found;if(N){if(y&&(y.type==="block-seq"?o(h,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==a.indent&&o(h,"BAD_INDENT",Sv)),!E.anchor&&!E.tag&&!S){p=E.end,E.comment&&(d.comment?d.comment+=`
|
|
78
|
+
`+E.comment:d.comment=E.comment);continue}(E.newlineAfterProp||Ao(y))&&o(y??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else E.found?.indent!==a.indent&&o(h,"BAD_INDENT",Sv);s.atKey=!0;const C=E.end,j=y?t(s,y,E,o):n(s,C,g,null,E,o);s.schema.compat&&Th(a.indent,y,o),s.atKey=!1,iS(s,d.items,j)&&o(C,"DUPLICATE_KEY","Map keys must be unique");const _=Ql(S??[],{indicator:"map-value-ind",next:w,offset:j.range[2],onError:o,parentIndent:a.indent,startOnNewline:!y||y.type==="block-scalar"});if(h=_.end,_.found){N&&(w?.type==="block-map"&&!_.hasNewline&&o(h,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&E.start<_.found.offset-1024&&o(j.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const A=w?t(s,w,_,o):n(s,h,S,null,_,o);s.schema.compat&&Th(a.indent,w,o),h=A.range[2];const T=new Rt(j,A);s.options.keepSourceTokens&&(T.srcToken=v),d.items.push(T)}else{N&&o(j.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(j.comment?j.comment+=`
|
|
79
|
+
`+_.comment:j.comment=_.comment);const A=new Rt(j);s.options.keepSourceTokens&&(A.srcToken=v),d.items.push(A)}}return p&&p<h&&o(p,"IMPOSSIBLE","Map comment with trailing content"),d.range=[a.offset,h,p??h],d}function UC({composeNode:t,composeEmptyNode:n},s,a,o,c){const u=c?.nodeClass??is,d=new u(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let h=a.offset,p=null;for(const{start:v,value:g}of a.items){const y=Ql(v,{indicator:"seq-item-ind",next:g,offset:h,onError:o,parentIndent:a.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||g)g?.type==="block-seq"?o(y.end,"BAD_INDENT","All sequence items must start at the same column"):o(h,"MISSING_CHAR","Sequence item without - indicator");else{p=y.end,y.comment&&(d.comment=y.comment);continue}const S=g?t(s,g,y,o):n(s,y.end,v,null,y,o);s.schema.compat&&Th(a.indent,g,o),h=S.range[2],d.items.push(S)}return d.range=[a.offset,h,p??h],d}function $o(t,n,s,a){let o="";if(t){let c=!1,u="";for(const d of t){const{source:h,type:p}=d;switch(p){case"space":c=!0;break;case"comment":{s&&!c&&a(d,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const v=h.substring(1)||" ";o?o+=u+v:o=v,u="";break}case"newline":o&&(u+=h),c=!0;break;default:a(d,"UNEXPECTED_TOKEN",`Unexpected ${p} at node end`)}n+=h.length}}return{comment:o,offset:n}}const nh="Block collections are not allowed within flow collections",ih=t=>t&&(t.type==="block-map"||t.type==="block-seq");function qC({composeNode:t,composeEmptyNode:n},s,a,o,c){const u=a.start.source==="{",d=u?"flow map":"flow sequence",h=c?.nodeClass??(u?ln:is),p=new h(s.schema);p.flow=!0;const v=s.atRoot;v&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let g=a.offset+a.start.source.length;for(let N=0;N<a.items.length;++N){const C=a.items[N],{start:j,key:_,sep:A,value:T}=C,M=Ql(j,{flow:d,indicator:"explicit-key-ind",next:_??A?.[0],offset:g,onError:o,parentIndent:a.indent,startOnNewline:!1});if(!M.found){if(!M.anchor&&!M.tag&&!A&&!T){N===0&&M.comma?o(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`):N<a.items.length-1&&o(M.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${d}`),M.comment&&(p.comment?p.comment+=`
|
|
80
|
+
`+M.comment:p.comment=M.comment),g=M.end;continue}!u&&s.options.strict&&Ao(_)&&o(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(N===0)M.comma&&o(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`);else if(M.comma||o(M.start,"MISSING_CHAR",`Missing , between ${d} items`),M.comment){let k="";e:for(const R of j)switch(R.type){case"comma":case"space":break;case"comment":k=R.source.substring(1);break e;default:break e}if(k){let R=p.items[p.items.length-1];nt(R)&&(R=R.value??R.key),R.comment?R.comment+=`
|
|
81
|
+
`+k:R.comment=k,M.comment=M.comment.substring(k.length+1)}}if(!u&&!A&&!M.found){const k=T?t(s,T,M,o):n(s,M.end,A,null,M,o);p.items.push(k),g=k.range[2],ih(T)&&o(k.range,"BLOCK_IN_FLOW",nh)}else{s.atKey=!0;const k=M.end,R=_?t(s,_,M,o):n(s,k,j,null,M,o);ih(_)&&o(R.range,"BLOCK_IN_FLOW",nh),s.atKey=!1;const U=Ql(A??[],{flow:d,indicator:"map-value-ind",next:T,offset:R.range[2],onError:o,parentIndent:a.indent,startOnNewline:!1});if(U.found){if(!u&&!M.found&&s.options.strict){if(A)for(const X of A){if(X===U.found)break;if(X.type==="newline"){o(X,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}M.start<U.found.offset-1024&&o(U.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else T&&("source"in T&&T.source?.[0]===":"?o(T,"MISSING_CHAR",`Missing space after : in ${d}`):o(U.start,"MISSING_CHAR",`Missing , or : between ${d} items`));const te=T?t(s,T,U,o):U.found?n(s,U.end,A,null,U,o):null;te?ih(T)&&o(te.range,"BLOCK_IN_FLOW",nh):U.comment&&(R.comment?R.comment+=`
|
|
82
|
+
`+U.comment:R.comment=U.comment);const Y=new Rt(R,te);if(s.options.keepSourceTokens&&(Y.srcToken=C),u){const X=p;iS(s,X.items,R)&&o(k,"DUPLICATE_KEY","Map keys must be unique"),X.items.push(Y)}else{const X=new ln(s.schema);X.flow=!0,X.items.push(Y);const W=(te??R).range;X.range=[R.range[0],W[1],W[2]],p.items.push(X)}g=te?te.range[2]:U.end}}const y=u?"}":"]",[S,...w]=a.end;let E=g;if(S?.source===y)E=S.offset+S.source.length;else{const N=d[0].toUpperCase()+d.substring(1),C=v?`${N} must end with a ${y}`:`${N} in block collection must be sufficiently indented and end with a ${y}`;o(g,v?"MISSING_CHAR":"BAD_INDENT",C),S&&S.source.length!==1&&w.unshift(S)}if(w.length>0){const N=$o(w,E,s.options.strict,o);N.comment&&(p.comment?p.comment+=`
|
|
83
|
+
`+N.comment:p.comment=N.comment),p.range=[a.offset,E,N.offset]}else p.range=[a.offset,E,E];return p}function sh(t,n,s,a,o,c){const u=s.type==="block-map"?$C(t,n,s,a,c):s.type==="block-seq"?UC(t,n,s,a,c):qC(t,n,s,a,c),d=u.constructor;return o==="!"||o===d.tagName?(u.tag=d.tagName,u):(o&&(u.tag=o),u)}function VC(t,n,s,a,o){const c=a.tag,u=c?n.directives.tagName(c.source,y=>o(c,"TAG_RESOLVE_FAILED",y)):null;if(s.type==="block-seq"){const{anchor:y,newlineAfterProp:S}=a,w=y&&c?y.offset>c.offset?y:c:y??c;w&&(!S||S.offset<w.offset)&&o(w,"MISSING_CHAR","Missing newline after block sequence props")}const d=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!c||!u||u==="!"||u===ln.tagName&&d==="map"||u===is.tagName&&d==="seq")return sh(t,n,s,o,u);let h=n.schema.tags.find(y=>y.tag===u&&y.collection===d);if(!h){const y=n.schema.knownTags[u];if(y?.collection===d)n.schema.tags.push(Object.assign({},y,{default:!1})),h=y;else return y?o(c,"BAD_COLLECTION_TYPE",`${y.tag} used for ${d} collection, but expects ${y.collection??"scalar"}`,!0):o(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${u}`,!0),sh(t,n,s,o,u)}const p=sh(t,n,s,o,u,h),v=h.resolve?.(p,y=>o(c,"TAG_RESOLVE_FAILED",y),n.options)??p,g=lt(v)?v:new _e(v);return g.range=p.range,g.tag=u,h?.format&&(g.format=h.format),g}function sS(t,n,s){const a=n.offset,o=YC(n,t.options.strict,s);if(!o)return{value:"",type:null,comment:"",range:[a,a,a]};const c=o.mode===">"?_e.BLOCK_FOLDED:_e.BLOCK_LITERAL,u=n.source?GC(n.source):[];let d=u.length;for(let E=u.length-1;E>=0;--E){const N=u[E][1];if(N===""||N==="\r")d=E;else break}if(d===0){const E=o.chomp==="+"&&u.length>0?`
|
|
84
|
+
`.repeat(Math.max(1,u.length-1)):"";let N=a+o.length;return n.source&&(N+=n.source.length),{value:E,type:c,comment:o.comment,range:[a,N,N]}}let h=n.indent+o.indent,p=n.offset+o.length,v=0;for(let E=0;E<d;++E){const[N,C]=u[E];if(C===""||C==="\r")o.indent===0&&N.length>h&&(h=N.length);else{N.length<h&&s(p+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),o.indent===0&&(h=N.length),v=E,h===0&&!t.atRoot&&s(p,"BAD_INDENT","Block scalar values in collections must be indented");break}p+=N.length+C.length+1}for(let E=u.length-1;E>=d;--E)u[E][0].length>h&&(d=E+1);let g="",y="",S=!1;for(let E=0;E<v;++E)g+=u[E][0].slice(h)+`
|
|
85
|
+
`;for(let E=v;E<d;++E){let[N,C]=u[E];p+=N.length+C.length+1;const j=C[C.length-1]==="\r";if(j&&(C=C.slice(0,-1)),C&&N.length<h){const A=`Block scalar lines must not be less indented than their ${o.indent?"explicit indentation indicator":"first line"}`;s(p-C.length-(j?2:1),"BAD_INDENT",A),N=""}c===_e.BLOCK_LITERAL?(g+=y+N.slice(h)+C,y=`
|
|
86
|
+
`):N.length>h||C[0]===" "?(y===" "?y=`
|
|
87
|
+
`:!S&&y===`
|
|
88
|
+
`&&(y=`
|
|
89
|
+
|
|
90
|
+
`),g+=y+N.slice(h)+C,y=`
|
|
91
|
+
`,S=!0):C===""?y===`
|
|
92
|
+
`?g+=`
|
|
93
|
+
`:y=`
|
|
94
|
+
`:(g+=y+C,y=" ",S=!1)}switch(o.chomp){case"-":break;case"+":for(let E=d;E<u.length;++E)g+=`
|
|
95
|
+
`+u[E][0].slice(h);g[g.length-1]!==`
|
|
96
|
+
`&&(g+=`
|
|
97
|
+
`);break;default:g+=`
|
|
98
|
+
`}const w=a+o.length+n.source.length;return{value:g,type:c,comment:o.comment,range:[a,w,w]}}function YC({offset:t,props:n},s,a){if(n[0].type!=="block-scalar-header")return a(n[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:o}=n[0],c=o[0];let u=0,d="",h=-1;for(let y=1;y<o.length;++y){const S=o[y];if(!d&&(S==="-"||S==="+"))d=S;else{const w=Number(S);!u&&w?u=w:h===-1&&(h=t+y)}}h!==-1&&a(h,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${o}`);let p=!1,v="",g=o.length;for(let y=1;y<n.length;++y){const S=n[y];switch(S.type){case"space":p=!0;case"newline":g+=S.source.length;break;case"comment":s&&!p&&a(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),g+=S.source.length,v=S.source.substring(1);break;case"error":a(S,"UNEXPECTED_TOKEN",S.message),g+=S.source.length;break;default:{const w=`Unexpected token in block scalar header: ${S.type}`;a(S,"UNEXPECTED_TOKEN",w);const E=S.source;E&&typeof E=="string"&&(g+=E.length)}}}return{mode:c,indent:u,chomp:d,comment:v,length:g}}function GC(t){const n=t.split(/\n( *)/),s=n[0],a=s.match(/^( *)/),c=[a?.[1]?[a[1],s.slice(a[1].length)]:["",s]];for(let u=1;u<n.length;u+=2)c.push([n[u],n[u+1]]);return c}function lS(t,n,s){const{offset:a,type:o,source:c,end:u}=t;let d,h;const p=(y,S,w)=>s(a+y,S,w);switch(o){case"scalar":d=_e.PLAIN,h=IC(c,p);break;case"single-quoted-scalar":d=_e.QUOTE_SINGLE,h=XC(c,p);break;case"double-quoted-scalar":d=_e.QUOTE_DOUBLE,h=KC(c,p);break;default:return s(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[a,a+c.length,a+c.length]}}const v=a+c.length,g=$o(u,v,n,s);return{value:h,type:d,comment:g.comment,range:[a,v,g.offset]}}function IC(t,n){let s="";switch(t[0]){case" ":s="a tab character";break;case",":s="flow indicator character ,";break;case"%":s="directive indicator character %";break;case"|":case">":{s=`block scalar indicator ${t[0]}`;break}case"@":case"`":{s=`reserved character ${t[0]}`;break}}return s&&n(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`),aS(t)}function XC(t,n){return(t[t.length-1]!=="'"||t.length===1)&&n(t.length,"MISSING_CHAR","Missing closing 'quote"),aS(t.slice(1,-1)).replace(/''/g,"'")}function aS(t){let n,s;try{n=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
99
|
+
`,"sy"),s=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
100
|
+
`,"sy")}catch{n=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let a=n.exec(t);if(!a)return t;let o=a[1],c=" ",u=n.lastIndex;for(s.lastIndex=u;a=s.exec(t);)a[1]===""?c===`
|
|
101
|
+
`?o+=c:c=`
|
|
102
|
+
`:(o+=c+a[1],c=" "),u=s.lastIndex;const d=/[ \t]*(.*)/sy;return d.lastIndex=u,a=d.exec(t),o+c+(a?.[1]??"")}function KC(t,n){let s="";for(let a=1;a<t.length-1;++a){const o=t[a];if(!(o==="\r"&&t[a+1]===`
|
|
103
|
+
`))if(o===`
|
|
104
|
+
`){const{fold:c,offset:u}=ZC(t,a);s+=c,a=u}else if(o==="\\"){let c=t[++a];const u=QC[c];if(u)s+=u;else if(c===`
|
|
105
|
+
`)for(c=t[a+1];c===" "||c===" ";)c=t[++a+1];else if(c==="\r"&&t[a+1]===`
|
|
106
|
+
`)for(c=t[++a+1];c===" "||c===" ";)c=t[++a+1];else if(c==="x"||c==="u"||c==="U"){const d=c==="x"?2:c==="u"?4:8;s+=FC(t,a+1,d,n),a+=d}else{const d=t.substr(a-1,2);n(a-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${d}`),s+=d}}else if(o===" "||o===" "){const c=a;let u=t[a+1];for(;u===" "||u===" ";)u=t[++a+1];u!==`
|
|
107
|
+
`&&!(u==="\r"&&t[a+2]===`
|
|
108
|
+
`)&&(s+=a>c?t.slice(c,a+1):o)}else s+=o}return(t[t.length-1]!=='"'||t.length===1)&&n(t.length,"MISSING_CHAR",'Missing closing "quote'),s}function ZC(t,n){let s="",a=t[n+1];for(;(a===" "||a===" "||a===`
|
|
109
|
+
`||a==="\r")&&!(a==="\r"&&t[n+2]!==`
|
|
110
|
+
`);)a===`
|
|
111
|
+
`&&(s+=`
|
|
112
|
+
`),n+=1,a=t[n+1];return s||(s=" "),{fold:s,offset:n}}const QC={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
113
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function FC(t,n,s,a){const o=t.substr(n,s),u=o.length===s&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,16):NaN;try{return String.fromCodePoint(u)}catch{const d=t.substr(n-2,s+2);return a(n-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${d}`),d}}function oS(t,n,s,a){const{value:o,type:c,comment:u,range:d}=n.type==="block-scalar"?sS(t,n,a):lS(n,t.options.strict,a),h=s?t.directives.tagName(s.source,g=>a(s,"TAG_RESOLVE_FAILED",g)):null;let p;t.options.stringKeys&&t.atKey?p=t.schema[qn]:h?p=JC(t.schema,o,h,s,a):n.type==="scalar"?p=WC(t,o,n,a):p=t.schema[qn];let v;try{const g=p.resolve(o,y=>a(s??n,"TAG_RESOLVE_FAILED",y),t.options);v=Ke(g)?g:new _e(g)}catch(g){const y=g instanceof Error?g.message:String(g);a(s??n,"TAG_RESOLVE_FAILED",y),v=new _e(o)}return v.range=d,v.source=o,c&&(v.type=c),h&&(v.tag=h),p.format&&(v.format=p.format),u&&(v.comment=u),v}function JC(t,n,s,a,o){if(s==="!")return t[qn];const c=[];for(const d of t.tags)if(!d.collection&&d.tag===s)if(d.default&&d.test)c.push(d);else return d;for(const d of c)if(d.test?.test(n))return d;const u=t.knownTags[s];return u&&!u.collection?(t.tags.push(Object.assign({},u,{default:!1,test:void 0})),u):(o(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),t[qn])}function WC({atKey:t,directives:n,schema:s},a,o,c){const u=s.tags.find(d=>(d.default===!0||t&&d.default==="key")&&d.test?.test(a))||s[qn];if(s.compat){const d=s.compat.find(h=>h.default&&h.test?.test(a))??s[qn];if(u.tag!==d.tag){const h=n.tagString(u.tag),p=n.tagString(d.tag),v=`Value may be parsed as either ${h} or ${p}`;c(o,"TAG_RESOLVE_FAILED",v,!0)}}return u}function PC(t,n,s){if(n){s??(s=n.length);for(let a=s-1;a>=0;--a){let o=n[a];switch(o.type){case"space":case"comment":case"newline":t-=o.source.length;continue}for(o=n[++a];o?.type==="space";)t+=o.source.length,o=n[++a];break}}return t}const eO={composeNode:rS,composeEmptyNode:um};function rS(t,n,s,a){const o=t.atKey,{spaceBefore:c,comment:u,anchor:d,tag:h}=s;let p,v=!0;switch(n.type){case"alias":p=tO(t,n,a),(d||h)&&a(n,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":p=oS(t,n,h,a),d&&(p.anchor=d.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{p=VC(eO,t,n,s,a),d&&(p.anchor=d.source.substring(1))}catch(g){const y=g instanceof Error?g.message:String(g);a(n,"RESOURCE_EXHAUSTION",y)}break;default:{const g=n.type==="error"?n.message:`Unsupported token (type: ${n.type})`;a(n,"UNEXPECTED_TOKEN",g),v=!1}}return p??(p=um(t,n.offset,void 0,null,s,a)),d&&p.anchor===""&&a(d,"BAD_ALIAS","Anchor cannot be an empty string"),o&&t.options.stringKeys&&(!Ke(p)||typeof p.value!="string"||p.tag&&p.tag!=="tag:yaml.org,2002:str")&&a(h??n,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(p.spaceBefore=!0),u&&(n.type==="scalar"&&n.source===""?p.comment=u:p.commentBefore=u),t.options.keepSourceTokens&&v&&(p.srcToken=n),p}function um(t,n,s,a,{spaceBefore:o,comment:c,anchor:u,tag:d,end:h},p){const v={type:"scalar",offset:PC(n,s,a),indent:-1,source:""},g=oS(t,v,d,p);return u&&(g.anchor=u.source.substring(1),g.anchor===""&&p(u,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(g.spaceBefore=!0),c&&(g.comment=c,g.range[2]=h),g}function tO({options:t},{offset:n,source:s,end:a},o){const c=new fu(s.substring(1));c.source===""&&o(n,"BAD_ALIAS","Alias cannot be an empty string"),c.source.endsWith(":")&&o(n+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const u=n+s.length,d=$o(a,u,t.strict,o);return c.range=[n,u,d.offset],d.comment&&(c.comment=d.comment),c}function nO(t,n,{offset:s,start:a,value:o,end:c},u){const d=Object.assign({_directives:n},t),h=new na(void 0,d),p={atKey:!1,atRoot:!0,directives:h.directives,options:h.options,schema:h.schema},v=Ql(a,{indicator:"doc-start",next:o??c?.[0],offset:s,onError:u,parentIndent:0,startOnNewline:!0});v.found&&(h.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!v.hasNewline&&u(v.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),h.contents=o?rS(p,o,v,u):um(p,v.end,a,null,v,u);const g=h.contents.range[2],y=$o(c,g,!1,u);return y.comment&&(h.comment=y.comment),h.range=[s,g,y.offset],h}function oo(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];const{offset:n,source:s}=t;return[n,n+(typeof s=="string"?s.length:1)]}function wv(t){let n="",s=!1,a=!1;for(let o=0;o<t.length;++o){const c=t[o];switch(c[0]){case"#":n+=(n===""?"":a?`
|
|
114
|
+
|
|
115
|
+
`:`
|
|
116
|
+
`)+(c.substring(1)||" "),s=!0,a=!1;break;case"%":t[o+1]?.[0]!=="#"&&(o+=1),s=!1;break;default:s||(a=!0),s=!1}}return{comment:n,afterEmptyLine:a}}class fm{constructor(n={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,o,c)=>{const u=oo(s);c?this.warnings.push(new nS(u,a,o)):this.errors.push(new Ms(u,a,o))},this.directives=new Ht({version:n.version||"1.2"}),this.options=n}decorate(n,s){const{comment:a,afterEmptyLine:o}=wv(this.prelude);if(a){const c=n.contents;if(s)n.comment=n.comment?`${n.comment}
|
|
117
|
+
${a}`:a;else if(o||n.directives.docStart||!c)n.commentBefore=a;else if(st(c)&&!c.flow&&c.items.length>0){let u=c.items[0];nt(u)&&(u=u.key);const d=u.commentBefore;u.commentBefore=d?`${a}
|
|
118
|
+
${d}`:a}else{const u=c.commentBefore;c.commentBefore=u?`${a}
|
|
119
|
+
${u}`:a}}if(s){for(let c=0;c<this.errors.length;++c)n.errors.push(this.errors[c]);for(let c=0;c<this.warnings.length;++c)n.warnings.push(this.warnings[c])}else n.errors=this.errors,n.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:wv(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(n,s=!1,a=-1){for(const o of n)yield*this.next(o);yield*this.end(s,a)}*next(n){switch(n.type){case"directive":this.directives.add(n.source,(s,a,o)=>{const c=oo(n);c[0]+=s,this.onError(c,"BAD_DIRECTIVE",a,o)}),this.prelude.push(n.source),this.atDirectives=!0;break;case"document":{const s=nO(this.options,this.directives,n,this.onError);this.atDirectives&&!s.directives.docStart&&this.onError(n,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(s,!1),this.doc&&(yield this.doc),this.doc=s,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(n.source);break;case"error":{const s=n.source?`${n.message}: ${JSON.stringify(n.source)}`:n.message,a=new Ms(oo(n),"UNEXPECTED_TOKEN",s);this.atDirectives||!this.doc?this.errors.push(a):this.doc.errors.push(a);break}case"doc-end":{if(!this.doc){const a="Unexpected doc-end without preceding document";this.errors.push(new Ms(oo(n),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const s=$o(n.end,n.offset+n.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),s.comment){const a=this.doc.comment;this.doc.comment=a?`${a}
|
|
120
|
+
${s.comment}`:s.comment}this.doc.range[2]=s.offset;break}default:this.errors.push(new Ms(oo(n),"UNEXPECTED_TOKEN",`Unsupported token ${n.type}`))}}*end(n=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(n){const a=Object.assign({_directives:this.directives},this.options),o=new na(void 0,a);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),o.range=[0,s,s],this.decorate(o,!1),yield o}}}function iO(t,n=!0,s){if(t){const a=(o,c,u)=>{const d=typeof o=="number"?o:Array.isArray(o)?o[0]:o.offset;if(s)s(d,c,u);else throw new Ms([d,d+1],c,u)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return lS(t,n,a);case"block-scalar":return sS({options:{strict:n}},t,a)}}return null}function sO(t,n){const{implicitKey:s=!1,indent:a,inFlow:o=!1,offset:c=-1,type:u="PLAIN"}=n,d=Bo({type:u,value:t},{implicitKey:s,indent:a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}}),h=n.end??[{type:"newline",offset:-1,indent:a,source:`
|
|
121
|
+
`}];switch(d[0]){case"|":case">":{const p=d.indexOf(`
|
|
122
|
+
`),v=d.substring(0,p),g=d.substring(p+1)+`
|
|
123
|
+
`,y=[{type:"block-scalar-header",offset:c,indent:a,source:v}];return cS(y,h)||y.push({type:"newline",offset:-1,indent:a,source:`
|
|
124
|
+
`}),{type:"block-scalar",offset:c,indent:a,props:y,source:g}}case'"':return{type:"double-quoted-scalar",offset:c,indent:a,source:d,end:h};case"'":return{type:"single-quoted-scalar",offset:c,indent:a,source:d,end:h};default:return{type:"scalar",offset:c,indent:a,source:d,end:h}}}function lO(t,n,s={}){let{afterKey:a=!1,implicitKey:o=!1,inFlow:c=!1,type:u}=s,d="indent"in t?t.indent:null;if(a&&typeof d=="number"&&(d+=2),!u)switch(t.type){case"single-quoted-scalar":u="QUOTE_SINGLE";break;case"double-quoted-scalar":u="QUOTE_DOUBLE";break;case"block-scalar":{const p=t.props[0];if(p.type!=="block-scalar-header")throw new Error("Invalid block scalar header");u=p.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:u="PLAIN"}const h=Bo({type:u,value:n},{implicitKey:o||d===null,indent:d!==null&&d>0?" ".repeat(d):"",inFlow:c,options:{blockQuote:!0,lineWidth:-1}});switch(h[0]){case"|":case">":aO(t,h);break;case'"':lh(t,h,"double-quoted-scalar");break;case"'":lh(t,h,"single-quoted-scalar");break;default:lh(t,h,"scalar")}}function aO(t,n){const s=n.indexOf(`
|
|
125
|
+
`),a=n.substring(0,s),o=n.substring(s+1)+`
|
|
126
|
+
`;if(t.type==="block-scalar"){const c=t.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");c.source=a,t.source=o}else{const{offset:c}=t,u="indent"in t?t.indent:-1,d=[{type:"block-scalar-header",offset:c,indent:u,source:a}];cS(d,"end"in t?t.end:void 0)||d.push({type:"newline",offset:-1,indent:u,source:`
|
|
127
|
+
`});for(const h of Object.keys(t))h!=="type"&&h!=="offset"&&delete t[h];Object.assign(t,{type:"block-scalar",indent:u,props:d,source:o})}}function cS(t,n){if(n)for(const s of n)switch(s.type){case"space":case"comment":t.push(s);break;case"newline":return t.push(s),!0}return!1}function lh(t,n,s){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=s,t.source=n;break;case"block-scalar":{const a=t.props.slice(1);let o=n.length;t.props[0].type==="block-scalar-header"&&(o-=t.props[0].source.length);for(const c of a)c.offset+=o;delete t.props,Object.assign(t,{type:s,source:n,end:a});break}case"block-map":case"block-seq":{const o={type:"newline",offset:t.offset+n.length,indent:t.indent,source:`
|
|
128
|
+
`};delete t.items,Object.assign(t,{type:s,source:n,end:[o]});break}default:{const a="indent"in t?t.indent:-1,o="end"in t&&Array.isArray(t.end)?t.end.filter(c=>c.type==="space"||c.type==="comment"||c.type==="newline"):[];for(const c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:s,indent:a,source:n,end:o})}}}const oO=t=>"type"in t?Zc(t):Dc(t);function Zc(t){switch(t.type){case"block-scalar":{let n="";for(const s of t.props)n+=Zc(s);return n+t.source}case"block-map":case"block-seq":{let n="";for(const s of t.items)n+=Dc(s);return n}case"flow-collection":{let n=t.start.source;for(const s of t.items)n+=Dc(s);for(const s of t.end)n+=s.source;return n}case"document":{let n=Dc(t);if(t.end)for(const s of t.end)n+=s.source;return n}default:{let n=t.source;if("end"in t&&t.end)for(const s of t.end)n+=s.source;return n}}}function Dc({start:t,key:n,sep:s,value:a}){let o="";for(const c of t)o+=c.source;if(n&&(o+=Zc(n)),s)for(const c of s)o+=c.source;return a&&(o+=Zc(a)),o}const Mh=Symbol("break visit"),rO=Symbol("skip children"),uS=Symbol("remove item");function Ls(t,n){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),fS(Object.freeze([]),t,n)}Ls.BREAK=Mh;Ls.SKIP=rO;Ls.REMOVE=uS;Ls.itemAtPath=(t,n)=>{let s=t;for(const[a,o]of n){const c=s?.[a];if(c&&"items"in c)s=c.items[o];else return}return s};Ls.parentCollection=(t,n)=>{const s=Ls.itemAtPath(t,n.slice(0,-1)),a=n[n.length-1][0],o=s?.[a];if(o&&"items"in o)return o;throw new Error("Parent collection not found")};function fS(t,n,s){let a=s(n,t);if(typeof a=="symbol")return a;for(const o of["key","value"]){const c=n[o];if(c&&"items"in c){for(let u=0;u<c.items.length;++u){const d=fS(Object.freeze(t.concat([[o,u]])),c.items[u],s);if(typeof d=="number")u=d-1;else{if(d===Mh)return Mh;d===uS&&(c.items.splice(u,1),u-=1)}}typeof a=="function"&&o==="key"&&(a=a(n,t))}}return typeof a=="function"?a(n,t):a}const wu="\uFEFF",xu="",Eu="",To="",cO=t=>!!t&&"items"in t,uO=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function fO(t){switch(t){case wu:return"<BOM>";case xu:return"<DOC>";case Eu:return"<FLOW_END>";case To:return"<SCALAR>";default:return JSON.stringify(t)}}function dS(t){switch(t){case wu:return"byte-order-mark";case xu:return"doc-mode";case Eu:return"flow-error-end";case To:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
129
|
+
`:case`\r
|
|
130
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const dO=Object.freeze(Object.defineProperty({__proto__:null,BOM:wu,DOCUMENT:xu,FLOW_END:Eu,SCALAR:To,createScalarToken:sO,isCollection:cO,isScalar:uO,prettyToken:fO,resolveAsScalar:iO,setScalarValue:lO,stringify:oO,tokenType:dS,visit:Ls},Symbol.toStringTag,{value:"Module"}));function Nn(t){switch(t){case void 0:case" ":case`
|
|
131
|
+
`:case"\r":case" ":return!0;default:return!1}}const xv=new Set("0123456789ABCDEFabcdef"),hO=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),wc=new Set(",[]{}"),mO=new Set(` ,[]{}
|
|
132
|
+
\r `),ah=t=>!t||mO.has(t);class hS{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(n,s=!1){if(n){if(typeof n!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+n:n,this.lineEndPos=null}this.atEnd=!s;let a=this.next??"stream";for(;a&&(s||this.hasChars(1));)a=yield*this.parseNext(a)}atLineEnd(){let n=this.pos,s=this.buffer[n];for(;s===" "||s===" ";)s=this.buffer[++n];return!s||s==="#"||s===`
|
|
133
|
+
`?!0:s==="\r"?this.buffer[n+1]===`
|
|
134
|
+
`:!1}charAt(n){return this.buffer[this.pos+n]}continueScalar(n){let s=this.buffer[n];if(this.indentNext>0){let a=0;for(;s===" ";)s=this.buffer[++a+n];if(s==="\r"){const o=this.buffer[a+n+1];if(o===`
|
|
135
|
+
`||!o&&!this.atEnd)return n+a+1}return s===`
|
|
136
|
+
`||a>=this.indentNext||!s&&!this.atEnd?n+a:-1}if(s==="-"||s==="."){const a=this.buffer.substr(n,3);if((a==="---"||a==="...")&&Nn(this.buffer[n+3]))return-1}return n}getLine(){let n=this.lineEndPos;return(typeof n!="number"||n!==-1&&n<this.pos)&&(n=this.buffer.indexOf(`
|
|
137
|
+
`,this.pos),this.lineEndPos=n),n===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[n-1]==="\r"&&(n-=1),this.buffer.substring(this.pos,n))}hasChars(n){return this.pos+n<=this.buffer.length}setNext(n){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=n,null}peek(n){return this.buffer.substr(this.pos,n)}*parseNext(n){switch(n){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let n=this.getLine();if(n===null)return this.setNext("stream");if(n[0]===wu&&(yield*this.pushCount(1),n=n.substring(1)),n[0]==="%"){let s=n.length,a=n.indexOf("#");for(;a!==-1;){const c=n[a-1];if(c===" "||c===" "){s=a-1;break}else a=n.indexOf("#",a+1)}for(;;){const c=n[s-1];if(c===" "||c===" ")s-=1;else break}const o=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(n.length-o),this.pushNewline(),"stream"}if(this.atLineEnd()){const s=yield*this.pushSpaces(!0);return yield*this.pushCount(n.length-s),yield*this.pushNewline(),"stream"}return yield xu,yield*this.parseLineStart()}*parseLineStart(){const n=this.charAt(0);if(!n&&!this.atEnd)return this.setNext("line-start");if(n==="-"||n==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const s=this.peek(3);if((s==="---"||s==="...")&&Nn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,s==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Nn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[n,s]=this.peek(2);if(!s&&!this.atEnd)return this.setNext("block-start");if((n==="-"||n==="?"||n===":")&&Nn(s)){const a=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=a,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const n=this.getLine();if(n===null)return this.setNext("doc");let s=yield*this.pushIndicators();switch(n[s]){case"#":yield*this.pushCount(n.length-s);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(ah),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return s+=yield*this.parseBlockScalarHeader(),s+=yield*this.pushSpaces(!0),yield*this.pushCount(n.length-s),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let n,s,a=-1;do n=yield*this.pushNewline(),n>0?(s=yield*this.pushSpaces(!1),this.indentValue=a=s):s=0,s+=yield*this.pushSpaces(!0);while(n+s>0);const o=this.getLine();if(o===null)return this.setNext("flow");if((a!==-1&&a<this.indentNext&&o[0]!=="#"||a===0&&(o.startsWith("---")||o.startsWith("..."))&&Nn(o[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(o[0]==="]"||o[0]==="}")))return this.flowLevel=0,yield Eu,yield*this.parseLineStart();let c=0;for(;o[c]===",";)c+=yield*this.pushCount(1),c+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(c+=yield*this.pushIndicators(),o[c]){case void 0:return"flow";case"#":return yield*this.pushCount(o.length-c),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(ah),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const u=this.charAt(1);if(this.flowKey||Nn(u)||u===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const n=this.charAt(0);let s=this.buffer.indexOf(n,this.pos+1);if(n==="'")for(;s!==-1&&this.buffer[s+1]==="'";)s=this.buffer.indexOf("'",s+2);else for(;s!==-1;){let c=0;for(;this.buffer[s-1-c]==="\\";)c+=1;if(c%2===0)break;s=this.buffer.indexOf('"',s+1)}const a=this.buffer.substring(0,s);let o=a.indexOf(`
|
|
138
|
+
`,this.pos);if(o!==-1){for(;o!==-1;){const c=this.continueScalar(o+1);if(c===-1)break;o=a.indexOf(`
|
|
139
|
+
`,c)}o!==-1&&(s=o-(a[o-1]==="\r"?2:1))}if(s===-1){if(!this.atEnd)return this.setNext("quoted-scalar");s=this.buffer.length}return yield*this.pushToIndex(s+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let n=this.pos;for(;;){const s=this.buffer[++n];if(s==="+")this.blockScalarKeep=!0;else if(s>"0"&&s<="9")this.blockScalarIndent=Number(s)-1;else if(s!=="-")break}return yield*this.pushUntil(s=>Nn(s)||s==="#")}*parseBlockScalar(){let n=this.pos-1,s=0,a;e:for(let c=this.pos;a=this.buffer[c];++c)switch(a){case" ":s+=1;break;case`
|
|
140
|
+
`:n=c,s=0;break;case"\r":{const u=this.buffer[c+1];if(!u&&!this.atEnd)return this.setNext("block-scalar");if(u===`
|
|
141
|
+
`)break}default:break e}if(!a&&!this.atEnd)return this.setNext("block-scalar");if(s>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=s:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const c=this.continueScalar(n+1);if(c===-1)break;n=this.buffer.indexOf(`
|
|
142
|
+
`,c)}while(n!==-1);if(n===-1){if(!this.atEnd)return this.setNext("block-scalar");n=this.buffer.length}}let o=n+1;for(a=this.buffer[o];a===" ";)a=this.buffer[++o];if(a===" "){for(;a===" "||a===" "||a==="\r"||a===`
|
|
143
|
+
`;)a=this.buffer[++o];n=o-1}else if(!this.blockScalarKeep)do{let c=n-1,u=this.buffer[c];u==="\r"&&(u=this.buffer[--c]);const d=c;for(;u===" ";)u=this.buffer[--c];if(u===`
|
|
144
|
+
`&&c>=this.pos&&c+1+s>d)n=c;else break}while(!0);return yield To,yield*this.pushToIndex(n+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const n=this.flowLevel>0;let s=this.pos-1,a=this.pos-1,o;for(;o=this.buffer[++a];)if(o===":"){const c=this.buffer[a+1];if(Nn(c)||n&&wc.has(c))break;s=a}else if(Nn(o)){let c=this.buffer[a+1];if(o==="\r"&&(c===`
|
|
145
|
+
`?(a+=1,o=`
|
|
146
|
+
`,c=this.buffer[a+1]):s=a),c==="#"||n&&wc.has(c))break;if(o===`
|
|
147
|
+
`){const u=this.continueScalar(a+1);if(u===-1)break;a=Math.max(a,u-2)}}else{if(n&&wc.has(o))break;s=a}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield To,yield*this.pushToIndex(s+1,!0),n?"flow":"doc")}*pushCount(n){return n>0?(yield this.buffer.substr(this.pos,n),this.pos+=n,n):0}*pushToIndex(n,s){const a=this.buffer.slice(this.pos,n);return a?(yield a,this.pos+=a.length,a.length):(s&&(yield""),0)}*pushIndicators(){let n=0;e:for(;;){switch(this.charAt(0)){case"!":n+=yield*this.pushTag(),n+=yield*this.pushSpaces(!0);continue e;case"&":n+=yield*this.pushUntil(ah),n+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const s=this.flowLevel>0,a=this.charAt(1);if(Nn(a)||s&&wc.has(a)){s?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,n+=yield*this.pushCount(1),n+=yield*this.pushSpaces(!0);continue e}}}break e}return n}*pushTag(){if(this.charAt(1)==="<"){let n=this.pos+2,s=this.buffer[n];for(;!Nn(s)&&s!==">";)s=this.buffer[++n];return yield*this.pushToIndex(s===">"?n+1:n,!1)}else{let n=this.pos+1,s=this.buffer[n];for(;s;)if(hO.has(s))s=this.buffer[++n];else if(s==="%"&&xv.has(this.buffer[n+1])&&xv.has(this.buffer[n+2]))s=this.buffer[n+=3];else break;return yield*this.pushToIndex(n,!1)}}*pushNewline(){const n=this.buffer[this.pos];return n===`
|
|
148
|
+
`?yield*this.pushCount(1):n==="\r"&&this.charAt(1)===`
|
|
149
|
+
`?yield*this.pushCount(2):0}*pushSpaces(n){let s=this.pos-1,a;do a=this.buffer[++s];while(a===" "||n&&a===" ");const o=s-this.pos;return o>0&&(yield this.buffer.substr(this.pos,o),this.pos=s),o}*pushUntil(n){let s=this.pos,a=this.buffer[s];for(;!n(a);)a=this.buffer[++s];return yield*this.pushToIndex(s,!1)}}class mS{constructor(){this.lineStarts=[],this.addNewLine=n=>this.lineStarts.push(n),this.linePos=n=>{let s=0,a=this.lineStarts.length;for(;s<a;){const c=s+a>>1;this.lineStarts[c]<n?s=c+1:a=c}if(this.lineStarts[s]===n)return{line:s+1,col:1};if(s===0)return{line:0,col:n};const o=this.lineStarts[s-1];return{line:s,col:n-o+1}}}}function Pi(t,n){for(let s=0;s<t.length;++s)if(t[s].type===n)return!0;return!1}function Ev(t){for(let n=0;n<t.length;++n)switch(t[n].type){case"space":case"comment":case"newline":break;default:return n}return-1}function pS(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function xc(t){switch(t.type){case"document":return t.start;case"block-map":{const n=t.items[t.items.length-1];return n.sep??n.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function _l(t){if(t.length===0)return[];let n=t.length;e:for(;--n>=0;)switch(t[n].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++n]?.type==="space";);return t.splice(n,t.length)}function Qc(t,n){if(n.length<1e5)Array.prototype.push.apply(t,n);else for(let s=0;s<n.length;++s)t.push(n[s])}function Nv(t){if(t.start.type==="flow-seq-start")for(const n of t.items)n.sep&&!n.value&&!Pi(n.start,"explicit-key-ind")&&!Pi(n.sep,"map-value-ind")&&(n.key&&(n.value=n.key),delete n.key,pS(n.value)?n.value.end?Qc(n.value.end,n.sep):n.value.end=n.sep:Qc(n.start,n.sep),delete n.sep)}class dm{constructor(n){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new hS,this.onNewLine=n}*parse(n,s=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const a of this.lexer.lex(n,s))yield*this.next(a);s||(yield*this.end())}*next(n){if(this.source=n,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=n.length;return}const s=dS(n);if(s)if(s==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=s,yield*this.step(),s){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+n.length);break;case"space":this.atNewLine&&n[0]===" "&&(this.indent+=n.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=n.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=n.length}else{const a=`Not a YAML token: ${n}`;yield*this.pop({type:"error",offset:this.offset,message:a,source:n}),this.offset+=n.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const n=this.peek(1);if(this.type==="doc-end"&&n?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!n)return yield*this.stream();switch(n.type){case"document":return yield*this.document(n);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(n);case"block-scalar":return yield*this.blockScalar(n);case"block-map":return yield*this.blockMap(n);case"block-seq":return yield*this.blockSequence(n);case"flow-collection":return yield*this.flowCollection(n);case"doc-end":return yield*this.documentEnd(n)}yield*this.pop()}peek(n){return this.stack[this.stack.length-n]}*pop(n){const s=n??this.stack.pop();if(!s)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield s;else{const a=this.peek(1);switch(s.type==="block-scalar"?s.indent="indent"in a?a.indent:0:s.type==="flow-collection"&&a.type==="document"&&(s.indent=0),s.type==="flow-collection"&&Nv(s),a.type){case"document":a.value=s;break;case"block-scalar":a.props.push(s);break;case"block-map":{const o=a.items[a.items.length-1];if(o.value){a.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(o.sep)o.value=s;else{Object.assign(o,{key:s,sep:[]}),this.onKeyLine=!o.explicitKey;return}break}case"block-seq":{const o=a.items[a.items.length-1];o.value?a.items.push({start:[],value:s}):o.value=s;break}case"flow-collection":{const o=a.items[a.items.length-1];!o||o.value?a.items.push({start:[],key:s,sep:[]}):o.sep?o.value=s:Object.assign(o,{key:s,sep:[]});return}default:yield*this.pop(),yield*this.pop(s)}if((a.type==="document"||a.type==="block-map"||a.type==="block-seq")&&(s.type==="block-map"||s.type==="block-seq")){const o=s.items[s.items.length-1];o&&!o.sep&&!o.value&&o.start.length>0&&Ev(o.start)===-1&&(s.indent===0||o.start.every(c=>c.type!=="comment"||c.indent<s.indent))&&(a.type==="document"?a.end=o.start:a.items.push({start:o.start}),s.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const n={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&n.start.push(this.sourceToken),this.stack.push(n);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(n){if(n.value)return yield*this.lineEnd(n);switch(this.type){case"doc-start":{Ev(n.start)!==-1?(yield*this.pop(),yield*this.step()):n.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":n.start.push(this.sourceToken);return}const s=this.startBlockValue(n);s?this.stack.push(s):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(n){if(this.type==="map-value-ind"){const s=xc(this.peek(2)),a=_l(s);let o;n.end?(o=n.end,o.push(this.sourceToken),delete n.end):o=[this.sourceToken];const c={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:a,key:n,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(n)}*blockScalar(n){switch(this.type){case"space":case"comment":case"newline":n.props.push(this.sourceToken);return;case"scalar":if(n.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let s=this.source.indexOf(`
|
|
150
|
+
`)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
|
|
151
|
+
`,s)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(n){const s=n.items[n.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):n.items.push({start:[this.sourceToken]})}else s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)n.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,n.indent)){const o=n.items[n.items.length-2]?.value?.end;if(Array.isArray(o)){Qc(o,s.start),o.push(this.sourceToken),n.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=n.indent){const a=!this.onKeyLine&&this.indent===n.indent,o=a&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(o&&s.sep&&!s.value){const u=[];for(let d=0;d<s.sep.length;++d){const h=s.sep[d];switch(h.type){case"newline":u.push(d);break;case"space":break;case"comment":h.indent>n.indent&&(u.length=0);break;default:u.length=0}}u.length>=2&&(c=s.sep.splice(u[1]))}switch(this.type){case"anchor":case"tag":o||s.value?(c.push(this.sourceToken),n.items.push({start:c}),this.onKeyLine=!0):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"explicit-key-ind":!s.sep&&!s.explicitKey?(s.start.push(this.sourceToken),s.explicitKey=!0):o||s.value?(c.push(this.sourceToken),n.items.push({start:c,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(s.explicitKey)if(s.sep)if(s.value)n.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Pi(s.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]});else if(pS(s.key)&&!Pi(s.sep,"newline")){const u=_l(s.start),d=s.key,h=s.sep;h.push(this.sourceToken),delete s.key,delete s.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:d,sep:h}]})}else c.length>0?s.sep=s.sep.concat(c,this.sourceToken):s.sep.push(this.sourceToken);else if(Pi(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const u=_l(s.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:null,sep:[this.sourceToken]}]})}else s.sep?s.value||o?n.items.push({start:c,key:null,sep:[this.sourceToken]}):Pi(s.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const u=this.flowScalar(this.type);o||s.value?(n.items.push({start:c,key:u,sep:[]}),this.onKeyLine=!0):s.sep?this.stack.push(u):(Object.assign(s,{key:u,sep:[]}),this.onKeyLine=!0);return}default:{const u=this.startBlockValue(n);if(u){if(u.type==="block-seq"){if(!s.explicitKey&&s.sep&&!Pi(s.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else a&&n.items.push({start:c});this.stack.push(u);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(n){const s=n.items[n.items.length-1];switch(this.type){case"newline":if(s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):n.items.push({start:[this.sourceToken]})}else s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)n.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(s.start,n.indent)){const o=n.items[n.items.length-2]?.value?.end;if(Array.isArray(o)){Qc(o,s.start),o.push(this.sourceToken),n.items.pop();return}}s.start.push(this.sourceToken)}return;case"anchor":case"tag":if(s.value||this.indent<=n.indent)break;s.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==n.indent)break;s.value||Pi(s.start,"seq-item-ind")?n.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>n.indent){const a=this.startBlockValue(n);if(a){this.stack.push(a);return}}yield*this.pop(),yield*this.step()}*flowCollection(n){const s=n.items[n.items.length-1];if(this.type==="flow-error-end"){let a;do yield*this.pop(),a=this.peek(1);while(a?.type==="flow-collection")}else if(n.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!s||s.sep?n.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return;case"map-value-ind":!s||s.value?n.items.push({start:[],key:null,sep:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!s||s.value?n.items.push({start:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);!s||s.value?n.items.push({start:[],key:o,sep:[]}):s.sep?this.stack.push(o):Object.assign(s,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":n.end.push(this.sourceToken);return}const a=this.startBlockValue(n);a?this.stack.push(a):(yield*this.pop(),yield*this.step())}else{const a=this.peek(2);if(a.type==="block-map"&&(this.type==="map-value-ind"&&a.indent===n.indent||this.type==="newline"&&!a.items[a.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&a.type!=="flow-collection"){const o=xc(a),c=_l(o);Nv(n);const u=n.end.splice(1,n.end.length);u.push(this.sourceToken);const d={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:c,key:n,sep:u}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=d}else yield*this.lineEnd(n)}}flowScalar(n){if(this.onNewLine){let s=this.source.indexOf(`
|
|
152
|
+
`)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
|
|
153
|
+
`,s)+1}return{type:n,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(n){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const s=xc(n),a=_l(s);return a.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const s=xc(n),a=_l(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(n,s){return this.type!=="comment"||this.indent<=s?!1:n.every(a=>a.type==="newline"||a.type==="space")}*documentEnd(n){this.type!=="doc-mode"&&(n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(n){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function gS(t){const n=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||n&&new mS||null,prettyErrors:n}}function pO(t,n={}){const{lineCounter:s,prettyErrors:a}=gS(n),o=new dm(s?.addNewLine),c=new fm(n),u=Array.from(c.compose(o.parse(t)));if(a&&s)for(const d of u)d.errors.forEach(Kc(t,s)),d.warnings.forEach(Kc(t,s));return u.length>0?u:Object.assign([],{empty:!0},c.streamInfo())}function yS(t,n={}){const{lineCounter:s,prettyErrors:a}=gS(n),o=new dm(s?.addNewLine),c=new fm(n);let u=null;for(const d of c.compose(o.parse(t),!0,t.length))if(!u)u=d;else if(u.options.logLevel!=="silent"){u.errors.push(new Ms(d.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return a&&s&&(u.errors.forEach(Kc(t,s)),u.warnings.forEach(Kc(t,s))),u}function gO(t,n,s){let a;typeof n=="function"?a=n:s===void 0&&n&&typeof n=="object"&&(s=n);const o=yS(t,s);if(!o)return null;if(o.warnings.forEach(c=>L1(o.options.logLevel,c)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:a},s))}function yO(t,n,s){let a=null;if(typeof n=="function"||Array.isArray(n)?a=n:s===void 0&&n&&(s=n),typeof s=="string"&&(s=s.length),typeof s=="number"){const o=Math.round(s);s=o<1?void 0:o>8?{indent:8}:{indent:o}}if(t===void 0){const{keepUndefined:o}=s??n??{};if(!o)return}return Hs(t)&&!a?t.toString(s):new na(t,a,s).toString(s)}const Uo=Object.freeze(Object.defineProperty({__proto__:null,Alias:fu,CST:dO,Composer:fm,Document:na,Lexer:hS,LineCounter:mS,Pair:Rt,Parser:dm,Scalar:_e,Schema:Su,YAMLError:cm,YAMLMap:ln,YAMLParseError:Ms,YAMLSeq:is,YAMLWarning:nS,isAlias:Bs,isCollection:st,isDocument:Hs,isMap:Wl,isNode:lt,isPair:nt,isScalar:Ke,isSeq:Pl,parse:gO,parseAllDocuments:pO,parseDocument:yS,stringify:yO,visit:$s,visitAsync:uu},Symbol.toStringTag,{value:"Module"})),_v=["#2563EB","#7C3AED","#0F766E","#B45309","#BE185D","#4338CA","#047857","#9F1239"];function Ch(t){let n=0;for(const s of t)n=Math.imul(n,31)+s.codePointAt(0)>>>0;return _v[n%_v.length]}function vO(t){if(t===void 0)return{actors:[]};if(!Array.isArray(t))return{actors:[],actorIssues:["screen.actors must be an array of actor IDs."]};const n=[],s=[];for(const a of t)typeof a!="string"||!a.trim()||a!==a.trim()?s.push("screen.actors IDs must be nonempty strings without surrounding whitespace."):n.includes(a)?s.push(`screen.actors lists "${a}" more than once.`):n.push(a);return{actors:n,...s.length?{actorIssues:s}:{}}}function bO(t,n,s){const a=new Map,o=[],c=(d,h=n)=>o.push({message:d,path:h});if(t!==void 0){let d;try{d=Uo.parse(t)}catch(h){c(`Invalid actor registry: ${h instanceof Error?h.message:String(h)}`)}if(!d||typeof d!="object"||Array.isArray(d)||!("actors"in d)||!d.actors||typeof d.actors!="object"||Array.isArray(d.actors))c("Actor registry must contain an actors mapping.");else for(const[h,p]of Object.entries(d.actors)){if(!h.trim()||h!==h.trim()){c("Actor IDs must be nonempty strings without surrounding whitespace.");continue}if(!p||typeof p!="object"||Array.isArray(p)){c(`Actor "${h}" must be a mapping with optional name and color.`);continue}const v=p;let g=h,y=Ch(h);v.name!==void 0&&(typeof v.name!="string"||!v.name.trim()?c(`Actor "${h}" name must be a nonempty string.`):g=v.name.trim()),v.color!==void 0&&(typeof v.color!="string"||!/^#[0-9a-f]{6}$/i.test(v.color)?c(`Actor "${h}" color must be a quoted #RRGGBB value.`):y=v.color.toUpperCase()),a.set(h,{id:h,name:g,color:y})}}const u=new Set(a.keys());for(const d of s){for(const h of d.screen.actorIssues??[])c(h,d.path);if(d.screen.type==="user")for(const h of d.screen.actors)t!==void 0&&!u.has(h)&&c(`screen.actors references undefined actor "${h}".`,d.path),a.has(h)||a.set(h,{id:h,name:h,color:Ch(h)})}return{actors:[...a.values()],actorIssues:o}}function ss(t){return t.normalize("NFKC").replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").toLowerCase()||"unnamed"}function vS(t){return`story_${ss(t).replaceAll("-","_")}`}function bS(t){return`slc_${ss(t).replaceAll("-","_")}`}function SS(t){return`scr_${ss(t).replaceAll("-","_")}`}function wS(t){return`cmd_${ss(t).replaceAll("-","_")}`}function xS(t){return`qry_${ss(t).replaceAll("-","_")}`}function kc(t){return`evt_${ss(t).replaceAll("-","_")}`}function ES(t,n,s){const a=s?ss(s):`case-${n+1}`;return`gwt_${ss(t).replaceAll("-","_")}_${a.replaceAll("-","_")}`}function SO(t,n,s){return`${t}:${n}->${s}`}function wO(t){const n=new Map,s=(a,o)=>{const c=n.get(a)??new Set;c.add(JSON.stringify(o)),n.set(a,c)};for(const a of t.stories)s(vS(a.path),[a.path]);for(const a of t.events)s(kc(a.name),[a.name]);for(const a of t.slices)s(bS(a.path),[a.path]),s(SS(a.path),[a.path]),a.commands.forEach((o,c)=>{s(wS(o.name),Hl(a.path,a.commands,c));for(const u of o.produces)s(kc(u),[u])}),a.queries.forEach((o,c)=>{s(xS(o.name),Hl(a.path,a.queries,c));for(const u of o.fromEvents)s(kc(u),[u])}),a.gwt.forEach((o,c)=>{s(ES(a.path,c,o.name),Hl(a.path,a.gwt,c))});return(a,o)=>n.get(a).size===1?a:`${a}~${encodeURIComponent(JSON.stringify(o))}`}function Hl(t,n,s){const a=n[s].name,o=n.slice(0,s).filter(c=>c.name===a).length;return[t,a??"",String(o)]}function xO(t){const n=[],s=new Map,a=wO(t),o=d=>a(kc(d),[d]),c=new Map,u=(d,h,p,v)=>{const g=SO(d,h,p);s.set(g,{id:g,kind:d,source:h,target:p,...v===void 0?{}:{label:v}})};for(const d of t.stories){const h=a(vS(d.path),[d.path]);for(const p of new Set(d.slices))c.set(p,[...c.get(p)??[],h]);n.push({id:h,type:"story",label:d.name,sourcePath:d.path,description:d.description})}for(const d of t.events)n.push({id:o(d.name),type:"event",label:d.name,sourceName:d.name,sourcePath:d.sourcePath,fields:d.fields,description:d.description});for(const d of t.slices){const h=a(bS(d.path),[d.path]),p=a(SS(d.path),[d.path]),v={storyName:d.storyName,sliceTitle:d.title,sourcePath:d.path,raw:d.raw};n.push({...v,id:h,type:"slice",label:d.title});for(const g of c.get(d.path)??[])u("story-slice",g,h);n.push({...v,id:p,type:d.screen.type==="system"?"processor":"screen",label:d.screen.name??(d.screen.type==="system"?"Processor":"Screen"),actors:d.screen.actors,...d.screen.type==="user"?{actorDefinitions:d.screen.actors.map(g=>t.actors?.find(y=>y.id===g)).filter(g=>!!g)}:{},screenType:d.screen.type}),u("slice-screen",h,p),d.queries.forEach((g,y)=>{const S=a(xS(g.name),Hl(d.path,d.queries,y));n.push({...v,id:S,type:"query",label:g.name,sourceName:g.name,fields:g.fields}),d.screen.reads.includes(g.name)&&u("query-screen",S,p);for(const w of g.fromEvents)u("event-query",o(w),S,w)}),d.commands.forEach((g,y)=>{const S=a(wS(g.name),Hl(d.path,d.commands,y));n.push({...v,id:S,type:"command",label:g.name,sourceName:g.name,fields:g.fields}),d.screen.executes.includes(g.name)&&u("screen-command",p,S);for(const w of g.produces)u("command-event",S,o(w),w)}),d.gwt.forEach((g,y)=>{n.push({...v,id:a(ES(d.path,y,g.name),Hl(d.path,d.gwt,y)),type:"gwt",label:g.name??`Case ${y+1}`,sourceName:g.name,description:g.description,given:g.given,when:g.when,then:g.then})})}return{nodes:n,edges:[...s.values()]}}function kl(t){const n=[];for(const s of t.replaceAll("\\","/").split("/"))!s||s==="."||(s===".."&&n.length>0&&n.at(-1)!==".."?n.pop():n.push(s));return n.join("/")}function NS(t,n=""){const s=kl(t).split("/").at(-1)??t;return n&&s.endsWith(n)?s.slice(0,-n.length):s}function Mo(t){return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}function EO(t,n){const s=Uo.parse(n),a=s?.events&&typeof s.events=="object"?s.events:s??{};return Object.entries(a).map(([o,c])=>({name:o,fields:typeof c?.fields=="string"?c.fields:void 0,description:typeof c?.description=="string"?c.description:void 0,sourcePath:t}))}function NO(t,n){const s=Uo.parse(n);return{name:typeof s?.name=="string"?s.name:NS(t,".yaml"),description:typeof s?.description=="string"?s.description:"",path:t,slices:Mo(s?.slices).map(kl)}}function _O(t){return Array.isArray(t)?t.filter(n=>!!n&&typeof n=="object").map(n=>({name:typeof n.name=="string"?n.name:"",fields:typeof n.fields=="string"?n.fields:void 0,notes:typeof n.notes=="string"?n.notes:void 0,produces:Mo(n.produces)})):[]}function AO(t){return Array.isArray(t)?t.filter(n=>!!n&&typeof n=="object").map(n=>({name:typeof n.name=="string"?n.name:"",fields:typeof n.fields=="string"?n.fields:void 0,notes:typeof n.notes=="string"?n.notes:void 0,fromEvents:Mo(n.from_events)})):[]}function TO(t){return Array.isArray(t)?t.filter(n=>!!n&&typeof n=="object").map(n=>({name:typeof n.name=="string"?n.name:void 0,description:typeof n.description=="string"?n.description:void 0,given:Array.isArray(n.given)?n.given:[],when:Array.isArray(n.when)?n.when:[],then:Array.isArray(n.then)?n.then:[]})):[]}function MO(t){return{type:t?.type==="system"?"system":"user",name:typeof t?.name=="string"?t.name:void 0,...vO(t?.actors),reads:Mo(t?.reads),executes:Mo(t?.executes)}}function CO(t,n,s){const a=Uo.parse(n);return{title:typeof a?.slice=="string"?a.slice:NS(t),path:t,storyName:s.get(t),screen:MO(a?.screen),commands:_O(a?.commands),queries:AO(a?.queries),gwt:TO(a?.gwt),raw:n}}function OO(t,n={}){const s=new Map(t.map(M=>[kl(M.path),M.content])),a=s.get(".event-modeling/config.yaml"),o=a?Uo.parse(a):null,c=o?.paths?.event_model_dir??"event-model",u=o?.paths?.features_dir??"event-model/features",d=o?.paths?.slice_extension??".slice.yaml",h=o?.paths?.events_file??`${c}/events.yaml`,p=kl(o?.paths?.actors_file??`${c}/actors.yaml`),v=o?.paths?.stories_dir??`${c}/stories`,g=s.get(h);if(g===void 0)throw new Error(`Missing events file: ${h}`);const y=EO(h,g),S=[...s.entries()].filter(([M])=>M.split("/").slice(0,-1).join("/")===v&&M.endsWith(".yaml")).sort(([M],[k])=>M.localeCompare(k)).map(([M,k])=>NO(M,k)),w=new Map;for(const M of S)for(const k of M.slices)w.set(kl(k),M.name);const E=S.flatMap(M=>M.slices.map(kl)),N=[...s.keys()].filter(M=>(u===""||M.startsWith(`${u}/`))&&M.endsWith(d)),j=[...new Set([...E,...N])].sort().filter(M=>s.has(M)).map(M=>CO(M,s.get(M)??"",w)),_=bO(s.get(p),p,j),A={root:n.root??"browser-import",config:{language:o?.language,paths:{eventModelDir:c,featuresDir:u,sliceExtension:d,eventsFile:h,actorsFile:p,storiesDir:v}},events:y,stories:S,slices:j,..._},T=xO(A);return{...A,...T}}function _S(t){if(t.type!=="screen")return[];const n=new Map(t.actorDefinitions?.map(s=>[s.id,s]));return[...new Set(t.actors??[])].map(s=>n.get(s)??{id:s,name:s,color:Ch(s)})}function AS(t,n={}){const s=new Map(t.actors?.map(a=>[a.id,a]));for(const a of[...t.nodes,...Object.values(n)])for(const o of _S(a))s.has(o.id)||s.set(o.id,o);return[...s.values()]}function zO(t,n,s={}){const a=new Set(AS(t,s).map(u=>u.id)),o=n.actorIds.filter(u=>a.has(u)),c=n.includeUnassigned&&[...t.nodes,...Object.values(s)].some(u=>u.type==="screen"&&!u.actors?.length);return o.length===n.actorIds.length&&c===n.includeUnassigned?n:{actorIds:o,includeUnassigned:c}}function DO(t,n,s={}){if(n.actorIds.length===0&&!n.includeUnassigned)return{nodeIds:new Set(t.nodes.map(A=>A.id)),relatedNodeIds:new Set};const a=new Set(n.actorIds),o=new Map(t.nodes.map(A=>[A.id,A])),c=new Map;for(const A of t.nodes)A.type==="story"||A.type==="event"||A.sourcePath&&c.set(A.id,A.sourcePath);const u=t.edges.filter(A=>["slice-screen","query-screen","screen-command"].includes(A.kind)),d=()=>{let A=!0;for(;A;){A=!1;for(const T of u){const M=c.get(T.source),k=c.get(T.target);M&&!k?(c.set(T.target,M),A=!0):k&&!M&&(c.set(T.source,k),A=!0)}}};d();for(const A of t.nodes)A.type==="slice"&&!c.has(A.id)&&c.set(A.id,A.id);d();for(const A of t.nodes)(A.type==="screen"||A.type==="processor")&&!c.has(A.id)&&c.set(A.id,A.id);d();const h=A=>A?.type==="screen"&&((A.actors??[]).some(T=>a.has(T))||n.includeUnassigned&&!A.actors?.length),p=t.nodes.filter(A=>h(A)||h(s[A.id])),v=new Set(p.flatMap(A=>{const T=c.get(A.id);return T?[T]:[]})),g=new Set(p.map(A=>A.id));for(const[A,T]of c)v.has(T)&&g.add(A);const y=t.edges.filter(A=>A.kind==="command-event"||A.kind==="event-query"),S=A=>{const T=new Set;for(const M of y)A.has(M.source)&&o.get(M.target)?.type==="event"&&T.add(M.target),A.has(M.target)&&o.get(M.source)?.type==="event"&&T.add(M.source);return T},w=S(g),E=new Set,N=new Set(t.nodes.filter(A=>A.type==="processor").map(A=>c.get(A.id)));for(const A of y){const T=w.has(A.source)?A.target:w.has(A.target)?A.source:void 0,M=T?c.get(T):void 0;M&&N.has(M)&&!v.has(M)&&E.add(M)}const C=new Set;for(const[A,T]of c)E.has(T)&&C.add(A);for(const A of S(C))w.has(A)||C.add(A);const j=new Set([...g,...w,...C]),_=new Set(t.nodes.filter(A=>j.has(A.id)&&A.type!=="event").map(A=>A.storyName));for(const A of t.nodes)A.type==="story"&&_.has(A.label)&&j.add(A.id);return{nodeIds:j,relatedNodeIds:C}}const Fi=180,Wi=80,TS=80,di=430,$l=390,MS=130,_n=178,kO=92,Oh=300,zh=170,Fc=18,Dh=48,oh=30,jc=92,CS=38,jO=42,Av=154,Tv=278,OS=408;function RO(t){return t==="slice-screen"||t==="story-slice"?"#cbd5e1":"#64748b"}function LO(t){if(t==="added")return"#15803d";if(t==="removed")return"#b91c1c";if(t==="changed")return"#b45309"}function BO(t){return t.type==="event"?{sourcePosition:me.Right,targetPosition:me.Left}:{sourcePosition:me.Bottom,targetPosition:me.Top}}function HO(t){return new Map(t.stories.map((n,s)=>[n.name,s]))}function Ul(t,n){return t===0?0:t*n+(t-1)*Fc}function Rc(t,n,s){const a=t.slices.find(o=>o.path===n);return t.nodes.filter(o=>o.type===s&&(o.sourcePath?o.sourcePath===n:o.sliceTitle===a?.title))}function $O(t,n,s){const a=new Set(Rc(t,s,"command").map(c=>c.id));return[...new Set(t.edges.filter(c=>c.kind==="command-event"&&a.has(c.source)).map(c=>c.target))].map(c=>n.get(c)).filter(c=>!!c)}function UO(t,n){return new Map(t.slices.map(s=>{const a=Rc(t,s.path,"query"),o=Rc(t,s.path,"command"),c=$O(t,n,s.path),u=Rc(t,s.path,"gwt"),d=Ul(a.length,_n),h=Ul(o.length,_n),p=d+h+(d>0&&h>0?Dh:0),v=Ul(c.length,_n),g=u.length?Oh:0,y=Math.max(di,p+oh*2,v+oh*2,g+oh*2),S=u.length>0?OS+zh+36:$l;return[s.path,{width:y,height:S,queryIds:a.map(w=>w.id),commandIds:o.map(w=>w.id),eventIds:c.map(w=>w.id),gwtIds:u.map(w=>w.id)}]}))}function qO(t,n){const s=new Map;let a=Wi;for(const o of t.stories){const c=t.slices.filter(v=>v.storyName===o.name),u=c.reduce((v,g)=>v+(n.get(g.path)?.width??di),0),d=Math.max(u+Math.max(c.length-1,0)*MS,di),h=Math.max(...c.map(v=>n.get(v.path)?.height??$l),$l),p=jc+h+CS;s.set(o.name,{y:a,width:d,height:p}),a+=p+TS}return s}function VO(t,n,s,a,o,c){const u=Ul(t.length,c),d=s.x+(a-u)/2;t.forEach((h,p)=>{n.set(h,{x:d+p*(c+Fc),y:s.y+o})})}function YO(t){return t==="essential"?new Set(["command-event","event-query"]):t==="normal"?new Set(["query-screen","screen-command","command-event","event-query"]):new Set(["story-slice","slice-screen","query-screen","screen-command","command-event","event-query"])}function GO(t,n,s="all"){if(!n||s==="all")return new Set(t.stories.map(u=>u.name));if(s==="story")return new Set([n]);const a=new Set([n]),o=new Set(t.nodes.filter(u=>u.storyName===n).map(u=>u.id)),c=new Set(t.edges.filter(u=>o.has(u.source)||o.has(u.target)).flatMap(u=>[u.source,u.target]).filter(u=>t.nodes.find(d=>d.id===u)?.type==="event"));for(const u of t.edges){if(!c.has(u.source)&&!c.has(u.target))continue;const d=t.nodes.find(p=>p.id===u.source),h=t.nodes.find(p=>p.id===u.target);d?.storyName&&a.add(d.storyName),h?.storyName&&a.add(h.storyName)}return a}function IO(t){return t==="event-query"?{sourceSide:"top",targetSide:"bottom"}:t==="query-screen"?{sourceSide:"top",targetSide:"bottom"}:t==="screen-command"?{sourceSide:"bottom",targetSide:"top"}:t==="command-event"?{sourceSide:"bottom",targetSide:"top"}:t==="slice-screen"?{sourceSide:"bottom",targetSide:"top"}:{sourceSide:"right",targetSide:"left"}}function XO(t,n,s,a,o){const c=IO(t),u=n?.sliceTitle&&n.sliceTitle===s?.sliceTitle;if(t==="event-query"&&u)return{...c,route:"same-slice-read"};if(!(t==="event-query"&&n?.sliceTitle!==s?.sliceTitle)||!a||!o)return{...c,route:"semantic"};const h=a.x+a.width/2,p=a.y+a.height/2,v=o.x+o.width/2,g=o.y+o.height/2;return{sourceSide:n?.storyName&&n.storyName===s?.storyName||g>=p?"bottom":"top",targetSide:v>=h?"left":"right",route:"event-read"}}function KO(t,n,s={}){const a=new Map(t.nodes.map(T=>[T.id,T]));t={...t,nodes:t.nodes.map(T=>{if(T.type!=="event")return T;const M=t.edges.find(k=>k.kind==="command-event"&&k.target===T.id);return{...T,storyName:M?a.get(M.source)?.storyName:T.storyName}})};const o=HO(t),c=new Map(t.nodes.map(T=>[T.id,T])),u=UO(t,c),d=T=>T?.sourcePath??t.slices.find(M=>M.title===(T?.sliceTitle??T?.label))?.path??"",h=qO(t,u),p=new Map,v=new Map,g=new Map,y=new Set,S=GO(t,s.focusedStory,s.scope??"all"),w=YO(s.edgeDetail??"normal"),E=DO(t,s.actorFilter??{actorIds:[],includeUnassigned:!1},s.previousNodes);if(n){y.add(n);for(const T of t.edges)T.source===n&&y.add(T.target),T.target===n&&y.add(T.source)}const N=new Map;for(const T of t.stories)N.set(T.name,Fi);for(const T of t.stories)for(const M of T.slices){const k=t.slices.find(te=>te.path===M);if(!k)continue;const R=h.get(T.name)??{y:Wi},U=N.get(T.name)??Fi;g.set(k.path,{x:U,y:R.y+jc}),N.set(T.name,U+(u.get(k.path)?.width??di)+MS)}for(const T of t.slices){if(g.has(T.path))continue;const M=Wi+(o.get(T.storyName??"")??0)*($l+jc+CS+TS),k=Fi;g.set(T.path,{x:k,y:M+jc})}for(const T of t.nodes){if(T.type==="story"&&p.set(T.id,{x:Fi-20,y:h.get(T.label)?.y??Wi}),T.type==="slice"){const M=g.get(d(T))??{x:Fi,y:Wi};p.set(T.id,M)}if(T.type==="screen"||T.type==="processor"){const M=g.get(d(T))??{x:Fi,y:Wi},R=u.get(d(T))?.width??di;p.set(T.id,{x:M.x+(R-_n)/2,y:M.y+jO})}}for(const T of t.slices){const M=g.get(T.path)??{x:Fi,y:Wi},k=u.get(T.path),R=k?.width??di;if(!k)continue;const U=Ul(k.queryIds.length,_n),te=Ul(k.commandIds.length,_n),Y=U+te+(U>0&&te>0?Dh:0);let X=M.x+(R-Y)/2;k.queryIds.forEach((W,L)=>{p.set(W,{x:X+L*(_n+Fc),y:M.y+Av})}),U>0&&(X+=U+(te>0?Dh:0)),k.commandIds.forEach((W,L)=>{p.set(W,{x:X+L*(_n+Fc),y:M.y+Av})}),VO(k.eventIds,p,M,R,Tv,_n);for(const W of k.gwtIds)p.set(W,{x:M.x+(R-Oh)/2,y:M.y+OS})}for(const T of t.nodes.filter(M=>M.type==="event")){const M=t.edges.find(R=>R.kind==="command-event"&&R.target===T.id),k=M?c.get(M.source):void 0;if(!p.has(T.id)){const R=g.get(d(k))??{x:Fi,y:Wi},U=u.get(d(k));p.set(T.id,{x:R.x+((U?.width??di)-_n)/2,y:R.y+Tv})}}const C=t.nodes.map(T=>{const M=p.get(T.id)??{x:0,y:0},k=T.type==="story"||T.type==="slice",R=T.type==="story"?h.get(T.label)?.width??di:u.get(d(T))?.width??di,U=T.type==="story"?h.get(T.label)?.height??$l:u.get(d(T))?.height??$l,te=k?R:T.type==="gwt"?Oh:_n,Y=k?U:T.type==="gwt"?zh:kO;v.set(T.id,{x:M.x,y:M.y,width:te,height:Y});const X=T.type==="gwt"?t.nodes.filter(W=>W.type==="gwt"&&(T.sourcePath?W.sourcePath===T.sourcePath:W.sliceTitle===T.sliceTitle)).filter(W=>E.nodeIds.has(W.id)&&(!W.storyName||S.has(W.storyName))).filter(W=>!s.diffFilter||s.diffFilter==="all"||s.diffNodeStatus?.[W.id]===s.diffFilter):void 0;return{id:T.id,type:k?"groupNode":"eventModelNode",position:M,initialWidth:k||T.type==="gwt"?te:void 0,initialHeight:k||T.type==="gwt"?Y:void 0,selectable:!0,draggable:!1,data:{projectNode:T,scenarios:X,scenarioStatus:s.diffNodeStatus,selectedScenarioId:n,selected:T.id===n||!!X?.some(W=>W.id===n),connected:y.has(T.id),actorRelated:E.relatedNodeIds.has(T.id),diffStatus:s.diffNodeStatus?.[T.id]},hidden:!E.nodeIds.has(T.id)||!!(X&&X[0]?.id!==T.id)||!!(T.storyName&&!S.has(T.storyName))||!!(!X&&s.diffFilter&&s.diffFilter!=="all"&&s.diffNodeStatus?.[T.id]!==s.diffFilter),style:k?{width:R,height:U,zIndex:T.type==="story"?-20:-10,opacity:E.relatedNodeIds.has(T.id)?.72:1}:{width:te,height:T.type==="gwt"?zh:void 0,opacity:E.relatedNodeIds.has(T.id)?.72:1},...BO(T)}}),j=new Set(C.filter(T=>!T.hidden).map(T=>T.id)),A=t.edges.filter(T=>w.has(T.kind)).filter(T=>j.has(T.source)&&j.has(T.target)).map(T=>{const M=c.get(T.source),k=c.get(T.target),R=!!s.focusedEdgeIds?.has(T.id),U=s.diffEdgeStatus?.[T.id],te=LO(U),{sourceSide:Y,targetSide:X,route:W}=XO(T.kind,M,k,v.get(T.source),v.get(T.target));return{id:T.id,source:T.source,target:T.target,type:"eventModelEdge",sourceHandle:`${Y}-source`,targetHandle:`${X}-target`,data:{kind:T.kind,route:W,active:R,diffStatus:U,fieldFlow:s.edgeFieldFlows?.get(T.id),selectedFieldName:s.selectedFieldName,onSelectField:s.onSelectField},markerEnd:{type:wo.ArrowClosed,color:R?"#111827":te??RO(T.kind)},label:s.edgeDetail==="verbose"?T.label:void 0,className:`edge ${R?"edge-active":""} ${U?`edge-diff-${U}`:""}`,hidden:!!(s.diffFilter&&s.diffFilter!=="all"&&U!==s.diffFilter),animated:R}});return{nodes:C,edges:A}}function Co(t,n){return JSON.stringify([t,n.type,n.sourcePath,n.sourceName,n.label,n.sliceTitle])}function ZO(t,n,s,a,o){const c=Co(n,s);if(o!==void 0&&t[c]?.message!==o)return t;if(a)return{...t,[c]:{sessionId:n,identity:hm(s),message:a}};const u={...t};return delete u[c],u}function hm(t){return{type:t.type,sourcePath:t.sourcePath,sourceName:t.sourceName,label:t.label,sliceTitle:t.sliceTitle}}function kh(t,n){return t.type===n.type&&t.sourcePath===n.sourcePath&&t.sourceName===n.sourceName&&t.label===n.label&&t.sliceTitle===n.sliceTitle}function Mv(t,n){const s=t.nodes.find(a=>a.id===n);return s?{identity:hm(s),nodeId:n,snapshotNodes:t.nodes}:void 0}function Ji(t,n){if(!t||!n)return;if(t.nodes===n.snapshotNodes)return t.nodes.find(a=>a.id===n.nodeId&&kh(a,n.identity));const s=t.nodes.filter(a=>kh(a,n.identity));return s.length===1?s[0]:void 0}function QO(t,n){return t.nodes.filter(s=>kh(s,hm(n))).length===1}function zS(t,n){if(!(!n||t?.nodeStatus[n.id]!=="changed"))return t.previousNodes?.[n.id]??t.previousGwtNodes?.[n.id]}function FO(t,n){if(!n)return t;const s=t.nodes.filter(c=>n.nodeStatus[c.id]!=="added").map(c=>{const u=zS(n,c);return u?{...u,id:c.id}:c}),a=new Set(s.map(c=>c.id)),o=t.edges.filter(c=>n.edgeStatus[c.id]!=="added").map(c=>n.previousEdges?.[c.id]?{...n.previousEdges[c.id],id:c.id,source:c.source,target:c.target}:c).filter(c=>a.has(c.source)&&a.has(c.target));return{...t,nodes:s,edges:o}}function JO(t,n){if(!n)return t;const s=t.nodes.filter(c=>n.nodeStatus[c.id]!=="removed"),a=new Set(s.map(c=>c.id)),o=t.edges.filter(c=>n.edgeStatus[c.id]!=="removed"&&a.has(c.source)&&a.has(c.target));return{...t,nodes:s,edges:o}}function WO(t){if(!t||typeof t!="object")return!1;const n=t;return typeof n.sessionId=="string"&&typeof n.token=="string"&&typeof n.revision=="string"&&Array.isArray(n.project?.nodes)&&Array.isArray(n.project?.edges)&&Array.isArray(n.validation?.findings)&&typeof n.stale=="boolean"&&!!n.baseline&&!!(n.feedback&&["idle","queued","working","completed","stopped"].includes(n.feedback.status)&&Array.isArray(n.feedback.history)&&typeof n.feedback.agent?.connected=="boolean")}function PO(t,n,s,a,o,c,u=!1){if(!t)return"Feedback is available when a project session is running.";if(!s)return"Reconnect to the project server before sending feedback.";if(t.stale||t.error)return"The model is stale. Fix the model error before sending feedback.";if(n==="turn")return"Switch to Current or Session diff to send feedback about the current model.";if(c?.nodeStatus[o.id]==="removed")return"This node was removed. Select a current node to send feedback.";if(u)return"Switch to New version to send feedback about the current node. Your draft is preserved.";if(!QO(t.project,o))return"This node is ambiguous. Give same-named nodes distinct names before sending feedback.";if(t.feedback.status==="stopped")return"The session is stopped. Stop the external editor before resuming.";if(a||t.feedback.status==="queued"||t.feedback.status==="working")return"Wait for the current request to finish before sending another."}function mm(t){return t instanceof Error?t.message:String(t)}async function Cv(t){const n=await t.json().catch(()=>{});return typeof n?.error=="string"?n.error:"Request failed ("+t.status+")."}function e3(t,n){const[s,a]=V.useState(),[o,c]=V.useState(),[u,d]=V.useState("checking"),[h,p]=V.useState(),[v,g]=V.useState(!1),[y,S]=V.useState(!1),[w,E]=V.useState(0),N=V.useRef(void 0),C=V.useRef(!1),j=V.useRef(!0),_=V.useRef(null),A=V.useCallback(()=>E(M=>M+1),[]);V.useEffect(()=>(j.current=!0,()=>{j.current=!1,_.current?.abort()}),[]),V.useEffect(()=>{if(!t)return;let M=!1,k,R;d("checking");const U=async()=>{const te=new AbortController;R=te;const Y=setTimeout(()=>te.abort(),5e3);let X=!1;try{const W=await fetch("/api/session?view="+n,{signal:te.signal,cache:"no-store"});if(W.status===404&&!N.current){X=!0,M||d("unavailable");return}if(!W.ok)throw new Error(await Cv(W));if(!W.headers.get("content-type")?.includes("application/json")&&!N.current){X=!0,M||d("unavailable");return}const L=await W.json();if(!WO(L))throw new Error("The project server returned an invalid session snapshot.");if(M)return;N.current&&N.current!==L.sessionId&&(g(!0),_.current?.abort(),C.current=!1),N.current=L.sessionId,a(L),c(n),d("live"),p(void 0),C.current||S(!1)}catch(W){if(M)return;d("offline"),p(te.signal.aborted?"The project server did not respond. Retrying...":mm(W)),C.current||S(!1)}finally{clearTimeout(Y),!M&&!X&&(k=setTimeout(()=>{U()},1e3))}};return U(),()=>{M=!0,R?.abort(),k&&clearTimeout(k)}},[t,n,w]);const T=V.useCallback(async(M,k)=>{if(!s||!t||u!=="live"||o!==n)throw new Error("Wait for the current session to reconnect.");if(C.current||y)throw new Error("A request is already in progress.");const R=new AbortController;_.current=R;const U=setTimeout(()=>R.abort(),1e4);C.current=!0,S(!0);try{const te=await fetch("/api/feedback/"+M,{method:"POST",headers:{"Content-Type":"application/json","X-Emviz-Token":s.token},body:JSON.stringify(k),signal:R.signal});if(!te.ok)throw new Error(await Cv(te))}catch(te){throw j.current&&S(!1),R.signal.aborted?new Error("The server did not confirm the request. The session is refreshing before you retry."):te}finally{clearTimeout(U),C.current=!1,j.current&&A()}},[u,t,y,A,s,o,n]);return{snapshot:s,snapshotView:o,connection:u,error:h,changedSession:v,pending:y,refresh:A,command:T}}const Ov={idle:"Idle",queued:"Queued",working:"Working",completed:"Completed",stopped:"Stopped"};function t3({session:t,view:n,onView:s,drafts:a}){const[o,c]=V.useState(),u=V.useRef(null),d=t.snapshot;if(V.useLayoutEffect(()=>{const w=u.current,E=w?.closest(".app-shell");if(!w||!E)return;const N=()=>E.style.setProperty("--feedback-bottom",w.offsetTop+w.offsetHeight+12+"px");N();const C=new ResizeObserver(N);return C.observe(w),()=>{C.disconnect(),E.style.removeProperty("--feedback-bottom")}},[d?.sessionId]),!d)return null;const h=d.feedback,p=t.connection==="live"&&t.snapshotView===n,v=w=>{c(void 0),t.command(w,{}).catch(E=>c(mm(E)))},g=h.request,y=h.history.filter(w=>w.id!==g?.id),S=g?[...y,g]:y;return x.jsxs("section",{ref:u,className:"feedback-session","aria-label":"Feedback session",children:[x.jsxs("div",{className:"feedback-session-row",children:[x.jsx("div",{className:"segmented",role:"group","aria-label":"Model view",children:[["current","Current"],["session","Session diff"],["turn","Turn diff"]].map(([w,E])=>x.jsx("button",{type:"button","aria-pressed":n===w,onClick:()=>s(w),children:E},w))}),x.jsxs("span",{className:"feedback-state feedback-state-"+h.status,role:"status",children:[Ov[h.status]," · ",h.agent.connected?"Agent connected":"Agent disconnected"]}),x.jsxs("span",{className:"feedback-baseline",children:["Baseline ",d.baseline.kind==="startup"?"startup snapshot":"Git"," · ",d.baseline.label]}),x.jsx("button",{type:"button",onClick:t.refresh,disabled:t.pending,children:"Refresh"}),h.status==="stopped"?x.jsx("button",{type:"button",onClick:()=>v("start"),disabled:!p||t.pending,children:"Resume session"}):x.jsx("button",{type:"button",onClick:()=>v("stop"),disabled:!p||t.pending,children:"Stop session"}),x.jsx(n3,{drafts:a,snapshot:d}),S.length?x.jsxs("details",{className:"feedback-history",children:[x.jsxs("summary",{children:["Feedback history (",S.length,")"]}),x.jsx("ol",{"aria-label":"Feedback history",children:S.map(w=>x.jsxs("li",{"data-request-id":w.id,children:[x.jsx("code",{children:w.reference}),x.jsx("p",{children:w.message}),w.reply?x.jsx("p",{className:"feedback-reply",children:w.reply}):x.jsx("p",{className:"muted",children:w.id===g?.id?Ov[h.status]:"No reply recorded."})]},w.id))})]}):null]}),t.connection==="checking"?x.jsx("p",{role:"status",children:"Refreshing the model..."}):null,t.error||d.error||h.error||o?x.jsx("p",{className:"feedback-error",role:"alert",children:o??t.error??d.error??h.error}):null,d.stale||t.connection==="offline"?x.jsx("p",{className:"feedback-warning",children:"Showing the last available model. Feedback is disabled until the project reconnects and loads valid files."}):null,t.changedSession?x.jsx("p",{className:"feedback-warning",children:"The project server restarted. The previous session history is no longer available."}):null,h.status==="stopped"?x.jsx("p",{className:"feedback-warning",children:"The session is stopped. Stop your external editor before resuming. Stop session cannot stop an external process or undo its file writes."}):x.jsx("p",{className:"feedback-note",children:"Stop session cancels feedback. It cannot stop an external agent process or its file writes."})]})}function n3({drafts:t,snapshot:n}){const[s,a]=V.useState();if(!t.length)return null;const o=async c=>{try{await navigator.clipboard.writeText(c.message),a("Copied draft for "+c.identity.label+".")}catch{a("Copy is unavailable. Select the draft text below and copy it manually.")}};return x.jsxs("details",{className:"feedback-history",children:[x.jsxs("summary",{children:["Unsent feedback drafts (",t.length,")"]}),x.jsxs("ol",{"aria-label":"Unsent feedback drafts",children:[t.map(c=>{const u=Co(c.sessionId,c.identity),d=n.project.nodes.filter(p=>Co(n.sessionId,p)===u&&n.diff?.nodeStatus[p.id]!=="removed"),h=c.sessionId!==n.sessionId?"Saved from a previous session. Copy the text before starting new feedback.":d.length===1?"Saved for the original node. Select that node to continue, or copy the text.":"The original node is no longer available or is ambiguous. Copy this draft to recover it.";return x.jsxs("li",{children:[x.jsx("strong",{children:c.identity.label}),x.jsxs("p",{className:"muted",children:[c.identity.type," · ",c.identity.sourcePath??"No source path"]}),x.jsx("p",{className:"feedback-warning",children:h}),x.jsx("p",{children:c.message}),x.jsx("button",{type:"button",onClick:()=>{o(c)},children:"Copy draft"})]},u)}),s?x.jsx("li",{role:"status",children:s}):null]})]})}function i3({session:t,view:n,node:s,diff:a,showingBefore:o,message:c,onMessageChange:u,onSent:d}){const[h,p]=V.useState(),[v,g]=V.useState(!1),y=V.useRef(void 0),S=t.connection==="live"&&t.snapshotView===n,w=PO(t.snapshot,n,S,t.pending,s,a,o),E=async N=>{if(N.preventDefault(),w||!c.trim()||c.length>4e3||!t.snapshot)return;p(void 0),g(!1);const C={nodeId:s.id,revision:t.snapshot.revision,message:c.trim()},j=JSON.stringify(C);y.current?.key!==j&&(y.current={key:j,clientRequestId:crypto.randomUUID()});try{await t.command("request",{...C,clientRequestId:y.current.clientRequestId}),d(c),y.current=void 0,g(!0)}catch(_){p(mm(_))}};return x.jsxs("form",{className:"feedback-composer","aria-label":"Node feedback",onSubmit:N=>{E(N)},onKeyDown:N=>{N.key!=="Escape"&&N.stopPropagation()},children:[x.jsx("h3",{children:"Send feedback to your agent"}),x.jsx("label",{htmlFor:"feedback-message",children:"Feedback message"}),x.jsx("textarea",{id:"feedback-message",value:c,maxLength:4e3,rows:4,disabled:!!w,"aria-describedby":"feedback-help",placeholder:"Describe the change you want for this node.",onChange:N=>{u(N.target.value),g(!1)}}),x.jsx("p",{className:"muted",id:"feedback-help",children:w??"The external agent receives this node's current source, connections, and validation findings."}),x.jsxs("div",{className:"feedback-composer-actions",children:[x.jsxs("small",{children:[c.length,"/4000"]}),x.jsx("button",{type:"submit",disabled:!!w||!c.trim()||c.length>4e3,children:"Send feedback"})]}),h?x.jsx("p",{className:"feedback-error",role:"alert",children:h}):null,v?x.jsx("p",{role:"status",children:"Feedback queued for your external agent."}):null]})}function $e(t,n,s,a,o){return{id:`${n}:${a??"project"}:${s}`,severity:t,check:n,message:s,path:a,nodeId:o}}function Al(t){const n=new Set,s=new Set;for(const a of t){const o=a.trim().toLowerCase();o&&(n.has(o)&&s.add(a),n.add(o))}return[...s]}const s3=new Set(["sent","built","made","paid","booked","cancelled","canceled","submitted","recorded","created","updated","deleted","placed","notified"]);function l3(t){return t.match(/[A-Z]+(?=[A-Z][a-z]|$)|[A-Z]?[a-z]+|\d+/g)??[t]}function a3(t){const n=t.toLowerCase();return s3.has(n)||/(ed|en|d)$/i.test(t)}function o3(t){return l3(t).some(a3)}function zv(t){return/(Requested|Triggered|Scheduled|Enqueued|Dispatched|Required)$/.test(t)}function r3(t){return["Selected","Shown","Viewed","Clicked","Opened","Closed","Ticked","Incremented","Reached","Displayed","Navigated"].find(n=>t.includes(n))}function c3(t){const n=new Set(t.nodes.map(c=>c.id)),s=new Map;for(const c of n)s.set(c,new Set);for(const c of t.edges)!n.has(c.source)||!n.has(c.target)||(s.get(c.source)?.add(c.target),s.get(c.target)?.add(c.source));let a=0;const o=new Set;for(const c of n){if(o.has(c))continue;a+=1;const u=[c];for(o.add(c);u.length>0;){const d=u.shift();if(d)for(const h of s.get(d)??[])o.has(h)||(o.add(h),u.push(h))}}return a}function u3(t){const n=(t.actorIssues??[]).map(h=>$e("error","A1",h.message,h.path)),s=new Set(t.events.map(h=>h.name)),a=new Set(t.slices.map(h=>h.path)),o=new Map,c=new Map;for(const h of t.stories){h.slices.length>15&&n.push($e("warning","S4",`Story "${h.name}" has ${h.slices.length} slices; consider splitting it.`,h.path));for(const p of h.slices)a.has(p)||n.push($e("error","S2",`Story "${h.name}" lists missing slice "${p}".`,h.path))}for(const h of t.events){h.fields?.trim()||n.push($e("error","C4",`Event "${h.name}" has no fields block.`,h.sourcePath)),!o3(h.name)&&!zv(h.name)&&n.push($e("warning","C3",`Event "${h.name}" does not obviously read as a past-tense domain event.`,h.sourcePath));const p=r3(h.name);p&&n.push($e("warning","D1",`Event "${h.name}" contains red-flag verb "${p}"; confirm this is persisted domain state.`,h.sourcePath))}for(const h of t.slices){const p=h.commands.map(g=>g.name),v=h.queries.map(g=>g.name);for(const g of Al(p))n.push($e("error","L9",`Command "${g}" is duplicated within slice "${h.title}".`,h.path));for(const g of Al(v))n.push($e("error","L9",`Query "${g}" is duplicated within slice "${h.title}".`,h.path));for(const g of Al(h.screen.reads))n.push($e("error","L9",`screen.reads lists "${g}" more than once.`,h.path));for(const g of Al(h.screen.executes))n.push($e("error","L9",`screen.executes lists "${g}" more than once.`,h.path));for(const g of h.screen.reads)v.includes(g)||n.push($e("error","W2",`screen.reads references missing local query "${g}".`,h.path));for(const g of h.screen.executes)p.includes(g)||n.push($e("error","W1",`screen.executes references missing local command "${g}".`,h.path));h.screen.type==="system"&&h.screen.actors.length>0&&n.push($e("error","L5",`System slice "${h.title}" must not declare screen.actors.`,h.path)),h.storyName||n.push($e("warning","M2",`Slice "${h.title}" is not listed by any story.`,h.path)),h.commands.length>0&&h.gwt.length===0&&n.push($e("warning","M1",`Command slice "${h.title}" has no GWT scenarios.`,h.path));for(const g of h.commands){g.fields?.trim()||n.push($e("warning","L6",`Command "${g.name}" has no fields block.`,h.path));for(const y of g.produces)s.has(y)||n.push($e("error","G1",`Command "${g.name}" produces unregistered event "${y}".`,h.path)),o.set(y,[...o.get(y)??[],`${h.title}.${g.name}`])}for(const g of h.queries){g.fields?.trim()||n.push($e("warning","L7",`Query "${g.name}" has no fields block.`,h.path)),g.name.includes("For")||n.push($e("warning","N1",`Query "${g.name}" should use a descriptive <Thing>For<UseCaseOrScreen> name.`,h.path));for(const y of g.fromEvents)s.has(y)||n.push($e("error","G2",`Query "${g.name}" reads unregistered event "${y}".`,h.path)),c.set(y,[...c.get(y)??[],`${h.title}.${g.name}`])}for(const g of h.gwt)for(const y of[...g.given,...g.when,...g.then])(!y.type||!["event","command","query","error"].includes(y.type))&&n.push($e("error","L8",`GWT scenario "${g.name??"Unnamed"}" has invalid item type "${y.type??""}".`,h.path)),y.name||n.push($e("error","L8",`GWT scenario "${g.name??"Unnamed"}" has an item without a name.`,h.path))}for(const h of s){const p=o.get(h)??[],v=c.get(h)??[];p.length===0&&n.push($e("error","G3",`Event "${h}" is registered but no command produces it.`)),p.length>1&&n.push($e("warning","G8",`Event "${h}" has multiple producers: ${p.join(", ")}.`)),p.length>0&&v.length===0&&n.push($e("warning",zv(h)?"G4b":"G4a",`Event "${h}" is produced but no query consumes it.`))}for(const[h,p]of c.entries())(o.get(h)??[]).length===0&&n.push($e("error","G3",`Event "${h}" is read by ${p.join(", ")} but no command produces it.`));for(const h of Al(t.slices.flatMap(p=>p.commands.map(v=>v.name))))n.push($e("warning","M5",`Command name "${h}" is used in multiple slices; command names should be globally unique.`));for(const h of Al(t.slices.flatMap(p=>p.queries.map(v=>v.name))))n.push($e("warning","G7",`Query name "${h}" is used in multiple slices; query names should be globally unique.`));const u=t.slices.filter(h=>h.commands.length>0).length;u>0&&t.events.length/u>2&&n.push($e("warning","M4",`The model has ${(t.events.length/u).toFixed(1)} events per command slice; check for UI/runtime events leaking into the model.`));const d=c3(t);return d>1&&n.push($e("info","I3",`The graph has ${d} disconnected islands.`)),{errors:n.filter(h=>h.severity==="error").length,warnings:n.filter(h=>h.severity==="warning").length,findings:n}}const DS=Jc.createContext({open:()=>{},list:()=>{}});function kS(){return x.jsxs(x.Fragment,{children:[x.jsx(gn,{id:"top-target",type:"target",position:me.Top,style:{left:"46%"}}),x.jsx(gn,{id:"top-source",type:"source",position:me.Top,style:{left:"54%"}}),x.jsx(gn,{id:"bottom-target",type:"target",position:me.Bottom,style:{left:"46%"}}),x.jsx(gn,{id:"bottom-source",type:"source",position:me.Bottom,style:{left:"54%"}}),x.jsx(gn,{id:"left-target",type:"target",position:me.Left,style:{top:"46%"}}),x.jsx(gn,{id:"left-source",type:"source",position:me.Left,style:{top:"54%"}}),x.jsx(gn,{id:"right-target",type:"target",position:me.Right,style:{top:"46%"}}),x.jsx(gn,{id:"right-source",type:"source",position:me.Right,style:{top:"54%"}})]})}function rh({title:t,items:n}){const s=n&&n.length>0?n:[{type:"empty",name:"empty"}];return x.jsxs("div",{className:"gwt-step",children:[x.jsx("div",{className:"gwt-step-title",children:t}),x.jsx("div",{className:"gwt-step-items",children:s.map((a,o)=>x.jsxs("div",{className:`gwt-step-item gwt-step-item-${a.type??"empty"}`,children:[x.jsx("span",{children:a.type??"empty"}),x.jsxs("div",{className:"gwt-item-content",children:[x.jsx("strong",{children:a.name??"empty"}),a.fields?x.jsx("pre",{children:a.fields}):null]})]},`${o}-${a.type??"empty"}-${a.name??""}`))})]})}function f3({nodeData:t}){const n=Jc.useContext(DS),s=t.scenarios??[];return x.jsxs("div",{className:`em-node em-node-gwt ${t.selected?"selected":""} ${t.diffStatus?`diff-node-${t.diffStatus}`:""}`,children:[x.jsx(kS,{}),x.jsxs("div",{className:"node-type",children:["GWT · ",s.length," cases"]}),t.scenarioStatus?x.jsx("div",{className:"gwt-diff-counts",children:["added","removed","changed"].map(a=>`${a}: ${s.filter(o=>t.scenarioStatus?.[o.id]===a).length}`).join(" · ")}):null,x.jsx("div",{className:"gwt-summary nodrag nopan nowheel",children:s.slice(0,3).map(a=>x.jsxs("button",{type:"button","aria-current":t.selectedScenarioId===a.id?"true":void 0,onClick:o=>{o.stopPropagation(),n.open(a.id)},children:[x.jsx("span",{className:"gwt-scenario-name",children:a.label}),t.scenarioStatus?x.jsx("span",{className:"gwt-scenario-status",children:` · ${t.scenarioStatus[a.id]??"unchanged"}`}):null]},a.id))}),x.jsx("div",{className:"gwt-more nodrag nopan nowheel",children:s.length>3?x.jsxs("button",{type:"button",onClick:a=>{a.stopPropagation(),n.list(t.projectNode.id)},children:["+",s.length-3," more"]}):null})]})}function jS({node:t}){const n=_S(t);return n.length===0?null:x.jsx("div",{className:"chips actor-chips nodrag nopan nowheel","aria-label":"Actors",children:n.map(s=>x.jsxs("span",{className:"actor-chip","data-actor-id":s.id,title:s.name+" ("+s.id+")",style:{borderColor:s.color},children:[x.jsx("i",{className:"actor-swatch","aria-hidden":"true",style:{backgroundColor:s.color}}),x.jsx("span",{className:"actor-name",children:s.name})]},s.id))})}function d3({data:t}){const n=t,s=n.projectNode,a=n.diffStatus&&n.diffStatus!=="unchanged"?x.jsx("div",{className:`diff-badge diff-badge-${n.diffStatus}`,children:n.diffStatus}):null;return s.type==="gwt"?x.jsx(f3,{nodeData:n}):x.jsxs("div",{className:`em-node em-node-${s.type} ${n.selected?"selected":""} ${n.connected?"connected":""} ${n.diffStatus?`diff-node-${n.diffStatus}`:""}`,children:[x.jsx(kS,{}),a,x.jsx("div",{className:"node-type",children:s.type}),x.jsx("div",{className:"node-label",children:s.label}),x.jsx(jS,{node:s})]})}function h3({data:t}){const n=t,s=n.projectNode;return x.jsxs("div",{className:`group-node group-${s.type} ${n.selected?"selected":""} ${n.diffStatus?`diff-node-${n.diffStatus}`:""}`,children:[n.diffStatus&&n.diffStatus!=="unchanged"?x.jsx("div",{className:`diff-badge diff-badge-${n.diffStatus}`,children:n.diffStatus}):null,x.jsxs("div",{className:"group-title",children:[s.label,s.type==="slice"&&n.actorRelated?x.jsx("span",{className:"actor-related-badge",children:"Related"}):null]}),s.description?x.jsx("div",{className:"group-description",children:s.description}):null]})}const m3={eventModelNode:d3,groupNode:h3};function Dv(t){return t===me.Top?{x:0,y:-1}:t===me.Right?{x:1,y:0}:t===me.Bottom?{x:0,y:1}:{x:-1,y:0}}function p3({sourceX:t,sourceY:n,targetX:s,targetY:a,sourcePosition:o,targetPosition:c,data:u}){const d=u,h=s-t,p=a-n,v=Math.max(56,Math.min(180,Math.abs(p)*.42)),g=Math.max(70,Math.min(180,Math.abs(h)*.38)),y=Math.max(72,Math.min(180,Math.max(Math.abs(h),Math.abs(p))*.38));if(d?.route==="same-slice-read"){const E=o===me.Top?-1:1,N=c===me.Bottom?1:-1,C=Math.max(72,Math.min(150,Math.abs(p)*.65));return`M ${t},${n} C ${t},${n+E*C} ${s},${a+N*C} ${s},${a}`}if(d?.route==="event-read"){const E=Dv(o),N=Dv(c);return`M ${t},${n} C ${t+E.x*y},${n+E.y*y} ${s+N.x*y},${a+N.y*y} ${s},${a}`}if(o===me.Bottom||o===me.Top){const E=o===me.Top?-1:1,N=c===me.Top?-1:1;return`M ${t},${n} C ${t},${n+E*v} ${s},${a+N*v} ${s},${a}`}const S=o===me.Left?-1:1,w=c===me.Left?-1:1;return`M ${t},${n} C ${t+S*g},${n} ${s+w*g},${a} ${s},${a}`}function g3(t){const n=t.data,s=n?.diffStatus==="added"?"#15803d":n?.diffStatus==="removed"?"#b91c1c":n?.diffStatus==="changed"?"#b45309":void 0,a=n?.active?"#111827":s??"#64748b",o=n?.fieldFlow,c=!!(n?.selectedFieldName&&(o?.sharedFieldNames.includes(n.selectedFieldName)||o?.derivedFieldNames.includes(n.selectedFieldName))),u=(t.sourceX+t.targetX)/2,d=(t.sourceY+t.targetY)/2;return x.jsxs(x.Fragment,{children:[x.jsx(Lo,{path:p3(t),markerEnd:t.markerEnd,style:{...t.style,stroke:a,strokeDasharray:n?.diffStatus==="removed"?"7 5":void 0,strokeWidth:n?.diffStatus&&n.diffStatus!=="unchanged"?2.4:void 0},className:n?.active?"edge-path-active":"edge-path"}),o&&o.visibleFieldNames.length>0&&(n?.active||c)?x.jsx(zM,{children:x.jsxs("div",{className:`edge-field-label nodrag nopan ${n?.active?"active":""} ${c?"field-selected":""}`,style:{transform:`translate(-50%, -50%) translate(${u}px, ${d}px)`},children:[o.visibleFieldNames.map(h=>x.jsx("button",{type:"button",onClick:()=>n?.onSelectField?.(h),children:h},h)),o.remainingCount>0?x.jsxs("span",{children:["+",o.remainingCount]}):null]})}):null]})}const y3={eventModelEdge:g3};function Ec({label:t,description:n,value:s,copiedKey:a,onCopy:o}){return x.jsx("button",{type:"button",className:"copy-action",onClick:()=>o(a,s),children:x.jsxs("span",{children:[x.jsx("strong",{children:t}),x.jsx("small",{children:n})]})})}function RS(t){return t==="query-screen"||t==="screen-command"||t==="command-event"||t==="event-query"}function v3(t){return JSON.stringify(t).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function b3(t){return(t.graphSidecar?.model?.name??t.graphSidecar?.model?.id??"event-model").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"event-model"}async function kv(t){const n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch ${t}: ${n.status}`);return n.text()}async function S3(t,n,s){const a=Array.from(document.querySelectorAll('script[type="module"][src]')).map(p=>new URL(p.src,window.location.href)).filter(p=>!p.pathname.includes("/@vite/")&&!p.pathname.endsWith("/@react-refresh"));if(a.length===0||a.some(p=>p.pathname.includes("/src/")||p.pathname.endsWith(".tsx")))throw new Error("Standalone export requires a built emviz app. Run the packaged CLI or `pnpm --filter @emviz/app build` and open the built app.");const o=Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).map(p=>new URL(p.href,window.location.href)),c=await Promise.all(o.map(p=>kv(p.href))),u=Array.from(document.querySelectorAll("style")).map(p=>p.textContent??"").filter(Boolean),d=await Promise.all(a.map(p=>kv(p.href))),h={project:t,report:n,diff:s,exportedAt:new Date().toISOString()};return["<!doctype html>",'<html lang="en">'," <head>",' <meta charset="UTF-8" />',' <meta name="viewport" content="width=device-width, initial-scale=1.0" />',` <title>emviz - ${t.graphSidecar?.model?.name??"export"}</title>`,` <style>${[...c,...u].join(`
|
|
154
|
+
|
|
155
|
+
`)}</style>`," </head>"," <body>",' <div id="root"></div>',` <script>window.__EMVIZ_EXPORT__ = ${v3(h)};<\/script>`,` <script type="module">${d.join(`
|
|
156
|
+
|
|
157
|
+
`)}<\/script>`," </body>","</html>"].join(`
|
|
158
|
+
`)}function w3({diff:t,filter:n,onFilter:s,onSelect:a}){const o=Object.entries(t.nodeStatus).filter(([,c])=>c!=="unchanged").slice(0,80);return x.jsxs("aside",{className:"panel diff-panel",children:[x.jsx("h2",{children:"Diff"}),x.jsxs("div",{className:"diff-range",children:[x.jsx("code",{children:t.base.label}),x.jsx("span",{children:"to"}),x.jsx("code",{children:t.target.label})]}),x.jsxs("div",{className:"diff-counts",children:[x.jsxs("button",{type:"button",className:n==="added"?"active added":"added",onClick:()=>s(n==="added"?"all":"added"),children:[x.jsx("strong",{children:t.summary.nodes.added}),x.jsx("span",{children:"Added"})]}),x.jsxs("button",{type:"button",className:n==="removed"?"active removed":"removed",onClick:()=>s(n==="removed"?"all":"removed"),children:[x.jsx("strong",{children:t.summary.nodes.removed}),x.jsx("span",{children:"Removed"})]}),x.jsxs("button",{type:"button",className:n==="changed"?"active changed":"changed",onClick:()=>s(n==="changed"?"all":"changed"),children:[x.jsx("strong",{children:t.summary.nodes.changed}),x.jsx("span",{children:"Changed"})]})]}),n!=="all"?x.jsx("button",{type:"button",className:"clear-diff-filter",onClick:()=>s("all"),children:"Show full graph"}):null,x.jsx("h3",{children:"Changed Nodes"}),x.jsx("div",{className:"diff-list",children:o.length===0?x.jsx("p",{className:"muted",children:"No node changes."}):o.map(([c,u])=>x.jsxs("button",{type:"button",className:`diff-list-item ${u}`,onClick:()=>a(c),children:[x.jsx("span",{children:c}),x.jsx("strong",{children:u})]},c))})]})}function x3(t,n){const s=URL.createObjectURL(new Blob([n],{type:"text/html;charset=utf-8"})),a=document.createElement("a");a.href=s,a.download=t,a.click(),URL.revokeObjectURL(s)}async function E3(t){return await Promise.all(Array.from(t).filter(s=>/\.(ya?ml|json)$/i.test(s.name)).map(async s=>({path:s.webkitRelativePath||s.name,content:await s.text()})))}function N3(t){const n=t.find(s=>s.path===".event-modeling/graph.json"||s.path.endsWith("/.event-modeling/graph.json"));if(n)try{return JSON.parse(n.content)}catch{return}}function _3(t){return t.type==="story"?{name:t.label}:t.type==="slice"?{slice:t.label}:t.type==="screen"||t.type==="processor"?{slice:t.sliceTitle??t.label}:t.type==="command"||t.type==="query"?{slice:t.sliceTitle??"",name:t.sourceName??t.label}:{name:t.sourceName??t.label}}function A3(t){const n=t.graphSidecar?.nodes;return n?Object.entries(n).flatMap(([s,a])=>{const o=a,c=t.nodes.filter(u=>{if(o.type==="screen"&&u.type!=="screen"&&u.type!=="processor"||o.type!=="screen"&&o.type!==u.type)return!1;const d=_3(u);return Object.entries(o.selector??{}).every(([h,p])=>d[h]===p)});return c.length===0?[{id:`V1:.event-modeling/graph.json:${s}`,severity:"warning",check:"V1",message:`graph.json node "${s}" selector does not resolve.`,path:".event-modeling/graph.json",nodeId:s}]:c.length>1?[{id:`V2:.event-modeling/graph.json:${s}`,severity:"warning",check:"V2",message:`graph.json node "${s}" selector resolves to ${c.length} nodes.`,path:".event-modeling/graph.json",nodeId:s}]:[]}):[]}function T3({onImport:t,error:n}){return x.jsx("div",{className:"import-panel",children:x.jsxs("div",{className:"import-card",children:[x.jsx("h1",{children:"emviz"}),x.jsx("p",{children:"Import an Event Modeling project folder or select YAML/JSON files to visualize the model."}),x.jsxs("div",{className:"import-actions",children:[x.jsxs("label",{children:["Import folder",x.jsx("input",{type:"file",multiple:!0,webkitdirectory:"",directory:"",onChange:s=>s.currentTarget.files&&t(s.currentTarget.files)})]}),x.jsxs("label",{children:["Import files",x.jsx("input",{type:"file",multiple:!0,accept:".yaml,.yml,.json",onChange:s=>s.currentTarget.files&&t(s.currentTarget.files)})]})]}),n?x.jsx("p",{className:"import-error",children:n}):null]})})}function M3({project:t,selectedNode:n,diff:s,findings:a,selectedFieldName:o,onSelect:c,onSelectField:u,onClearField:d,onPreviewConnection:h,onClearPreview:p,gwtList:v,onGwtList:g,onClose:y,onFocusNode:S,session:w,view:E,draftMessage:N,onDraftChange:C,onDraftSent:j}){const[_,A]=V.useState(),T=zS(s,n),M=n&&T&&_===n?.id?{...T,id:n.id}:n,[k,R]=V.useState(),[U,te]=V.useState(""),Y=V.useRef(null),X=V.useRef(0),W=!!v;V.useLayoutEffect(()=>{W&&Y.current&&(Y.current.scrollTop=X.current)},[W]);const L=K=>{K.key!=="Escape"&&K.stopPropagation()},G=V.useCallback((K,ue)=>{navigator.clipboard?.writeText(ue).then(()=>{R(K),window.setTimeout(()=>R(pe=>pe===K?void 0:pe),1400)})},[]);if(v){const K=U.trim().toLowerCase(),ue=v.filter(pe=>pe.label.toLowerCase().includes(K));return x.jsxs("aside",{ref:Y,className:"panel panel-right gwt-panel","aria-label":"GWT scenarios",onKeyDown:L,onKeyUp:L,onScroll:pe=>{X.current=pe.currentTarget.scrollTop},children:[x.jsx("button",{type:"button",onClick:y,children:"Close"}),x.jsxs("h2",{children:[v[0]?.sliceTitle," · All scenarios (",v.length,")"]}),x.jsxs("div",{className:"gwt-filter",children:[x.jsx("label",{htmlFor:"gwt-name-filter",children:"Filter by scenario name"}),x.jsx("input",{id:"gwt-name-filter",type:"search",value:U,onChange:pe=>{te(pe.target.value),X.current=0,Y.current&&(Y.current.scrollTop=0)}}),x.jsx("button",{type:"button",disabled:!U,onClick:()=>{te(""),X.current=0,Y.current&&(Y.current.scrollTop=0),Y.current?.querySelector("input")?.focus({preventScroll:!0})},children:"Clear filter"})]}),x.jsx("p",{role:"status",children:ue.length?`${ue.length} of ${v.length} scenarios`:"No scenarios match this name."}),x.jsx("div",{className:"gwt-all-list",children:ue.map(pe=>x.jsxs("button",{type:"button","aria-current":M?.id===pe.id?"true":void 0,onClick:()=>{X.current=Y.current?.scrollTop??X.current,c(pe.id)},children:[pe.label,s?` · ${s.nodeStatus[pe.id]??"unchanged"}`:""]},pe.id))})]})}if(!M)return x.jsxs("aside",{className:"panel panel-right",children:[x.jsx("h2",{children:"Selection"}),x.jsx("p",{className:"muted",children:"Select a node to inspect source and connections."})]});const z=!!(T&&_===n?.id)||s?.nodeStatus[M.id]==="removed",B=z?FO(t,s):JO(t,s),I=new Map(B.nodes.map(K=>[K.id,K])),Q=B.edges.filter(K=>{const ue=I.get(K.source),pe=I.get(K.target);return RS(K.kind)&&ue&&pe&&ue.type!=="gwt"&&pe.type!=="gwt"}),se=Q.filter(K=>K.target===M.id),D=Q.filter(K=>K.source===M.id),$=x1(M.fields),ie=`em://${t.graphSidecar?.model?.id??"event_model"}/${M.id}`,ce=M.raw??M.fields??M.description??M.label,he=[`Reference: ${ie}`,`Node: ${M.label} (${M.type})`,`Source: ${M.sourcePath??"unknown"}`,"","Incoming:",...se.length===0?["- none"]:se.map(K=>`- ${I.get(K.source)?.label??K.source} -> ${M.label}`),"","Outgoing:",...D.length===0?["- none"]:D.map(K=>`- ${M.label} -> ${I.get(K.target)?.label??K.target}`),"","Source excerpt:",ce].join(`
|
|
159
|
+
`),fe=`Please update this event model node.
|
|
160
|
+
|
|
161
|
+
Reference:
|
|
162
|
+
${ie}
|
|
163
|
+
|
|
164
|
+
Source path:
|
|
165
|
+
${M.sourcePath??"unknown"}
|
|
166
|
+
|
|
167
|
+
Current context:
|
|
168
|
+
${ce}
|
|
169
|
+
|
|
170
|
+
Goal:
|
|
171
|
+
`;return x.jsxs("aside",{className:`panel panel-right ${M.type==="gwt"?"gwt-panel":""}`,"aria-label":"Node details",onKeyDown:L,onKeyUp:L,children:[M.type==="gwt"?x.jsxs("div",{className:"gwt-panel-actions",children:[x.jsx("button",{type:"button",onClick:()=>g(M.id),children:"All scenarios"}),x.jsx("button",{type:"button",onClick:y,children:"Close"})]}):null,x.jsxs("div",{className:"panel-heading",children:[x.jsx("h2",{children:M.label}),x.jsx("button",{type:"button",className:"icon-button",onClick:()=>S(M.id),"aria-label":"Focus selected node",title:"Focus selected node",children:x.jsx("span",{className:"target-icon","aria-hidden":"true"})})]}),s&&n?x.jsxs("p",{children:[s.nodeStatus[n.id]," · ",z?"Old version":"New version"]}):null,T?x.jsxs("div",{className:"gwt-panel-actions",role:"group","aria-label":"Node version",children:[x.jsx("button",{type:"button","aria-pressed":_!==n?.id,onClick:()=>A(void 0),children:"New version"}),x.jsx("button",{type:"button","aria-pressed":_===n?.id,onClick:()=>A(n?.id),children:"Old version"})]}):null,w?.snapshot&&n?x.jsx(i3,{session:w,view:E,node:n,diff:s,showingBefore:z,message:N,onMessageChange:C,onSent:j},Co(w.snapshot.sessionId,n)):null,M.type==="gwt"?x.jsxs("section",{"aria-label":"Scenario details",children:[M.description?x.jsx("p",{children:M.description}):null,x.jsx(rh,{title:"Given",items:M.given}),x.jsx(rh,{title:"When",items:M.when}),x.jsx(rh,{title:"Then",items:M.then}),x.jsx("p",{className:"muted",children:"YAML below is the source slice, not an individual scenario excerpt."})]}):null,x.jsxs("div",{className:"meta-row",children:[x.jsx("span",{children:"Type"}),x.jsx("strong",{children:M.type})]}),x.jsx(jS,{node:M}),x.jsxs("div",{className:"meta-row",children:[x.jsx("span",{children:"Reference"}),x.jsx("code",{children:ie})]}),M.sourcePath?x.jsxs("div",{className:"meta-row",children:[x.jsx("span",{children:"Source"}),x.jsx("code",{children:M.sourcePath})]}):null,x.jsxs("details",{className:"copy-section",children:[x.jsxs("summary",{children:[x.jsx("span",{children:"Copy for LLM"}),k?x.jsxs("strong",{className:"copy-feedback","aria-live":"polite",children:["Copied ",k]}):null]}),x.jsxs("div",{className:"copy-actions",children:[x.jsx(Ec,{label:"Reference",description:"Stable em:// node handle",value:ie,copiedKey:"reference",onCopy:G}),x.jsx(Ec,{label:"YAML",description:M.type==="gwt"?"Source YAML for the whole slice":"Source excerpt for this node",value:ce,copiedKey:"YAML",onCopy:G}),x.jsx(Ec,{label:"Context",description:"Reference plus incoming/outgoing links",value:he,copiedKey:"context",onCopy:G}),x.jsx(Ec,{label:"Edit prompt",description:"Prompt scaffold for asking an LLM to edit",value:fe,copiedKey:"prompt",onCopy:G})]})]}),x.jsx("h3",{children:"Connections"}),x.jsxs("div",{className:"connection-list",children:[x.jsx("strong",{children:"Incoming"}),se.length===0?x.jsx("p",{className:"muted",children:"None"}):se.map(K=>x.jsx("button",{type:"button",className:"connection-button",onClick:()=>c(K.source),onMouseEnter:()=>h(K.id),onMouseLeave:p,onFocus:()=>h(K.id),onBlur:p,children:x.jsx("span",{children:I.get(K.source)?.label??K.source})},K.id)),x.jsx("strong",{children:"Outgoing"}),D.length===0?x.jsx("p",{className:"muted",children:"None"}):D.map(K=>x.jsx("button",{type:"button",className:"connection-button",onClick:()=>c(K.target),onMouseEnter:()=>h(K.id),onMouseLeave:p,onFocus:()=>h(K.id),onBlur:p,children:x.jsx("span",{children:I.get(K.target)?.label??K.target})},K.id))]}),M.type==="command"||M.type==="event"||M.type==="query"?x.jsxs(x.Fragment,{children:[x.jsx("h3",{children:"Fields"}),x.jsxs("div",{className:"field-panel",children:[$.length===0?x.jsx("p",{className:"field-empty",children:"No fields documented."}):x.jsx("div",{className:"field-list",children:$.map(K=>x.jsx("button",{type:"button",className:o===K?"selected":"",onClick:()=>u(K),children:K},K))}),o?x.jsx("button",{type:"button",className:"clear-field",onClick:d,children:"Clear field focus"}):null]})]}):null,x.jsx("h3",{children:"Findings"}),a.length===0?x.jsx("p",{className:"muted",children:"No findings for this node."}):a.map(K=>x.jsxs("div",{className:`finding finding-${K.severity}`,children:[x.jsx("strong",{children:K.check}),x.jsx("span",{children:K.message})]},K.id)),x.jsx("h3",{children:M.type==="gwt"?"Source slice YAML":"Source"}),x.jsx("pre",{children:ce})]})}function C3({report:t,onSelect:n,open:s,onOpen:a,onClose:o}){const c=t?.errors??0,u=t?.warnings??0,d=c+u;return x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button",className:`validation-fab ${c>0?"has-errors":u>0?"has-warnings":""}`,onClick:a,"aria-expanded":s,"aria-controls":"validation-panel",title:"Open validation",children:[x.jsx("span",{"aria-hidden":"true",children:"!"}),d>0?x.jsx("strong",{"aria-label":`${d} validation findings`,children:d}):null]}),s?x.jsxs("aside",{className:"panel validation-drawer",id:"validation-panel",children:[x.jsxs("div",{className:"panel-heading",children:[x.jsx("h2",{children:"Validation"}),x.jsx("button",{type:"button",className:"panel-close",onClick:o,"aria-label":"Close validation",children:"Close"})]}),t?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"status-row",children:[x.jsxs("span",{className:"status error",children:[t.errors," errors"]}),x.jsxs("span",{className:"status warning",children:[t.warnings," warnings"]})]}),x.jsx("div",{className:"findings-list",children:t.findings.length===0?x.jsx("p",{className:"muted",children:"No validation findings."}):t.findings.map(h=>x.jsxs("div",{className:`finding finding-${h.severity}`,children:[x.jsxs("div",{className:"finding-header",children:[x.jsx("strong",{children:h.check}),h.nodeId?x.jsx("button",{type:"button",onClick:()=>n(h.nodeId),children:"Focus"}):null]}),x.jsx("span",{children:h.message}),h.path?x.jsx("code",{children:h.path}):null]},h.id))})]}):x.jsx("p",{className:"muted",children:"Loading validation..."})]}):null]})}function O3(){const[t,n]=V.useState(),[s,a]=V.useState(),[o,c]=V.useState(),[u,d]=V.useState("all"),[h,p]=V.useState({actorIds:[],includeUnassigned:!1}),v=V.useRef(void 0),[g,y]=V.useState("loading"),[S,w]=V.useState("remote"),[E,N]=V.useState(),[C,j]=V.useState(!1),[_,A]=V.useState("idle"),[T,M]=V.useState(),[k,R]=V.useState({}),[U,te]=V.useState(),[Y,X]=V.useState(),W=Ji(t,U)?.id,L=Ji(t,Y)?.id,G=V.useRef(null),[z,B]=V.useState([]),[I,Q]=V.useState([]),[se,D]=V.useState(""),[$,ne]=V.useState(),[ie,ce]=V.useState(),[he,fe]=V.useState(!1),{setCenter:K,fitView:ue}=ru(),[pe,xe]=V.useState("current"),de=e3(!window.__EMVIZ_EXPORT__&&S==="remote"&&g!=="import",pe),be=V.useRef(void 0),Ee=de.snapshot?JSON.stringify([de.snapshot.sessionId,de.snapshot.revision,pe,de.snapshot.feedback.request?.id,de.snapshot.feedback.status]):void 0,ze={...de,connection:de.connection==="live"&&Ee&&be.current?.key!==Ee?"checking":de.connection};V.useEffect(()=>{if(window.__EMVIZ_EXPORT__?.project){n(window.__EMVIZ_EXPORT__.project),a(window.__EMVIZ_EXPORT__.report),c(window.__EMVIZ_EXPORT__.diff),y("ready"),window.setTimeout(()=>{ue({padding:.18,duration:300})},50);return}if(S==="local"||de.connection!=="unavailable")return;let ae=!1;return Promise.all([fetch("/api/model").then(ye=>ye.json()),fetch("/api/validation").then(ye=>ye.ok?ye.json():void 0).catch(()=>{}),fetch("/api/diff").then(ye=>ye.ok?ye.json():void 0).catch(()=>{})]).then(([ye,Me,Ze])=>{if(!ae){if(!ye||!Array.isArray(ye.nodes)||!Array.isArray(ye.edges))throw new Error("No project server is available.");n(ye),a(Me),c(Ze),y("ready"),window.setTimeout(()=>{ue({padding:.18,duration:300})},50)}}).catch(()=>{ae||y("import")}),()=>{ae=!0}},[ue,de.connection,S]),V.useEffect(()=>{const ae=de.snapshot;if(!ae||de.snapshotView!==pe)return;const ye=Ee;if(be.current?.key===ye)return;const Me=!be.current;be.current&&be.current.sessionId!==ae.sessionId&&(te(void 0),X(void 0),p({actorIds:[],includeUnassigned:!1}),B([]),Q([]),ce(void 0)),be.current={key:ye,sessionId:ae.sessionId},n(ae.project),a(ae.validation),c(ae.diff),y("ready"),ne(void 0),Me&&window.setTimeout(()=>{ue({padding:.18,duration:300})},50)},[ue,de.snapshot,de.snapshotView,Ee,pe]);const Ie=V.useMemo(()=>t?AS(t,o?.previousNodes):[],[t,o?.previousNodes]),wt=!!(t?.nodes.some(ae=>ae.type==="screen"&&!ae.actors?.length)||Object.values(o?.previousNodes??{}).some(ae=>ae.type==="screen"&&!ae.actors?.length));V.useEffect(()=>{if(!t)return;const ae=v.current!==t.root;v.current=t.root,p(ye=>ae?{actorIds:[],includeUnassigned:!1}:zO(t,ye,o?.previousNodes))},[t,o?.previousNodes]),V.useEffect(()=>{t&&(U&&!Ji(t,U)&&te(void 0),Y&&!Ji(t,Y)&&X(void 0),B(ae=>ae.filter(ye=>Ji(t,ye))),Q(ae=>ae.filter(ye=>Ji(t,ye))))},[t,U,Y]);const We=V.useMemo(()=>t?.nodes.find(ae=>ae.id===W),[t,W]),yt=de.snapshot?.sessionId,Et=yt&&We?Co(yt,We):void 0,zt=(ae,ye)=>{!yt||!We||R(Me=>ZO(Me,yt,We,ae,ye))},Yn=V.useMemo(()=>s?.findings.filter(ae=>ae.nodeId===W)??[],[s,W]),$t=V.useMemo(()=>t?oC(t):new Map,[t]),Pe=V.useMemo(()=>{if($)return new Set([$]);const ae=rC($t,ie);if(ae)return ae;if(!t||!W)return;const ye=new Set;for(const Me of t.edges)RS(Me.kind)&&(Me.source===W||Me.target===W)&&ye.add(Me.id);return ye},[$t,$,t,ie,W]),rt=V.useMemo(()=>t?KO(t,W,{focusedEdgeIds:Pe,edgeFieldFlows:$t,selectedFieldName:ie,onSelectField:ce,diffNodeStatus:o?.nodeStatus,diffEdgeStatus:o?.edgeStatus,diffFilter:u,actorFilter:h,previousNodes:o?.previousNodes}):{nodes:[],edges:[]},[h,o?.previousNodes,o?.edgeStatus,o?.nodeStatus,u,$t,Pe,t,ie,W]),Lt=V.useMemo(()=>{if(!t||se.trim().length<2)return[];const ae=se.trim().toLowerCase();return t.nodes.filter(ye=>`${ye.label} ${ye.type} ${ye.sourcePath??""}`.toLowerCase().includes(ae)).slice(0,8)},[t,se]),Qe=V.useCallback((ae,ye=!0,Me=!1)=>{const Ze=rt.nodes.find(At=>At.id===ae);ne(void 0),ye&&W&&W!==ae&&(U&&B(At=>[...At,U]),Q([]));const vt=Ze?.data.projectNode.type==="gwt";if(vt&&!G.current){const At=document.activeElement;G.current=At?.closest(".search-results")?document.querySelector(".search-box input"):At instanceof HTMLElement?At:null}vt||(G.current=null),X(void 0),t&&te(Mv(t,ae)),Ze&&(!vt||Me)&&K(Ze.position.x+80,Ze.position.y+60,{zoom:1.2,duration:350})},[rt.nodes,t,U,W,K]),Dt=V.useCallback(()=>{te(void 0),ne(void 0),ce(void 0),X(void 0);const ae=G.current;G.current=null,ae&&requestAnimationFrame(()=>{ae?.isConnected?ae.focus({preventScroll:!0}):document.querySelector(".canvas")?.focus({preventScroll:!0})})},[]),ls=V.useCallback(ae=>{G.current||(G.current=document.activeElement instanceof HTMLElement?document.activeElement:null),t&&X(Mv(t,ae))},[t]),vi=V.useMemo(()=>({open:Qe,list:ls}),[Qe,ls]),bn=t?.nodes.find(ae=>ae.id===L),ia=bn?t?.nodes.filter(ae=>ae.type==="gwt"&&(bn.sourcePath?ae.sourcePath===bn.sourcePath:ae.sliceTitle===bn.sliceTitle)).filter(ae=>!o||u==="all"||o.nodeStatus[ae.id]===u):void 0;V.useEffect(()=>{(L||We?.type==="gwt")&&((L?document.querySelector(".gwt-all-list button[aria-current]"):null)??document.querySelector(".gwt-panel button"))?.focus({preventScroll:!0})},[L,We?.id,We?.type]);const Gn=V.useCallback(ae=>{const ye=t?.edges.find(Ze=>Ze.id===ae);if(!ye)return;ne(ae);const Me=rt.nodes.filter(Ze=>Ze.id===ye.source||Ze.id===ye.target);Me.length>0&&ue({nodes:Me,padding:.36,duration:260,maxZoom:1.25})},[ue,rt.nodes,t?.edges]),Nt=V.useCallback(()=>{ne(void 0)},[]),on=V.useCallback(()=>{t&&(A("exporting"),M(void 0),j(!1),S3(t,s,o).then(ae=>{x3(`${b3(t)}.emviz.html`,ae)}).catch(ae=>{M(ae instanceof Error?ae.message:String(ae))}).finally(()=>A("idle")))},[o,t,s]);V.useEffect(()=>{const ae=ye=>{ye.key==="Escape"&&(j(!1),Dt())};return window.addEventListener("keydown",ae),()=>window.removeEventListener("keydown",ae)},[Dt]);const _t=V.useCallback(()=>{const ae=z.at(-1);if(!ae)return;B(Me=>Me.slice(0,-1)),U&&Q(Me=>[...Me,U]);const ye=Ji(t,ae);ye&&Qe(ye.id,!1)},[z,Qe,t,U]),sa=V.useCallback(()=>{const ae=I.at(-1);if(!ae)return;Q(Me=>Me.slice(0,-1)),U&&B(Me=>[...Me,U]);const ye=Ji(t,ae);ye&&Qe(ye.id,!1)},[Qe,I,t,U]),la=V.useCallback(ae=>{E3(ae).then(ye=>{const Me=OO(ye),Ze=Me;Ze.graphSidecar=N3(ye)??{model:{id:"browser_import",name:"Browser Import"}},w("local"),n(Ze);const vt=u3(Me),At=A3(Ze);a({errors:vt.errors,warnings:vt.warnings+At.filter(In=>In.severity==="warning").length,findings:[...vt.findings,...At]}),c(void 0),X(void 0),d("all"),p({actorIds:[],includeUnassigned:!1}),te(void 0),ne(void 0),ce(void 0),B([]),Q([]),y("ready"),N(void 0),window.setTimeout(()=>{ue({padding:.18,duration:300})},50)}).catch(ye=>{N(ye instanceof Error?ye.message:String(ye)),y("import")})},[ue]);return g==="import"?x.jsx(T3,{onImport:la,error:E}):t?x.jsxs("div",{className:`app-shell ${o?"diff-mode":""} ${de.snapshot?"has-feedback":""}`,children:[x.jsxs("header",{className:"toolbar",children:[x.jsxs("div",{className:"model-summary",children:[x.jsx("strong",{children:"emviz"}),x.jsxs("span",{children:[t.stories.length," stories"]}),x.jsxs("span",{children:[t.slices.length," slices"]}),x.jsxs("span",{children:[t.nodes.filter(ae=>ae.type==="event").length," events"]})]}),x.jsxs("div",{className:"segmented toolbar-history","aria-label":"Selection history",children:[x.jsx("button",{type:"button",disabled:z.length===0,onClick:_t,"aria-label":"Back",title:"Back",children:"←"}),x.jsx("button",{type:"button",disabled:I.length===0,onClick:sa,"aria-label":"Forward",title:"Forward",children:"→"})]}),x.jsxs("div",{className:"search-box",children:[x.jsx("input",{"aria-label":"Search event model",value:se,onChange:ae=>D(ae.target.value),placeholder:"Search nodes by name or type..."}),Lt.length>0?x.jsx("div",{className:"search-results",children:Lt.map(ae=>x.jsxs("button",{type:"button",onClick:()=>{Qe(ae.id),D("")},children:[x.jsx("span",{children:ae.label}),x.jsx("small",{children:ae.type})]},ae.id))}):null]}),x.jsxs("details",{className:"actor-filter",onKeyDown:ae=>{ae.key==="Escape"&&(ae.preventDefault(),ae.stopPropagation(),ae.currentTarget.open=!1,ae.currentTarget.querySelector("summary")?.focus())},children:[x.jsxs("summary",{children:["Actors · ",h.actorIds.length+Number(h.includeUnassigned)||"All"]}),x.jsxs("div",{className:"actor-filter-popover",children:[x.jsx("p",{children:"Match any selected actor. Related system steps stay visible."}),x.jsxs("div",{className:"actor-filter-options",role:"group","aria-label":"Filter by actor",children:[Ie.map(ae=>x.jsxs("label",{children:[x.jsx("input",{type:"checkbox","aria-label":ae.name===ae.id?ae.name:ae.name+" ("+ae.id+")",checked:h.actorIds.includes(ae.id),onChange:ye=>{const Me=ye.target.checked;p(Ze=>({...Ze,actorIds:Me?[...Ze.actorIds,ae.id]:Ze.actorIds.filter(vt=>vt!==ae.id)}))}}),x.jsx("i",{className:"actor-swatch","aria-hidden":"true",style:{backgroundColor:ae.color}}),x.jsxs("span",{children:[ae.name,ae.name!==ae.id?x.jsx("small",{children:ae.id}):null]})]},ae.id)),wt?x.jsxs("label",{children:[x.jsx("input",{type:"checkbox","aria-label":"Unassigned screens",checked:h.includeUnassigned,onChange:ae=>{const ye=ae.target.checked;p(Me=>({...Me,includeUnassigned:ye}))}}),x.jsx("span",{children:"Unassigned screens"})]}):null]}),x.jsx("button",{type:"button",disabled:h.actorIds.length===0&&!h.includeUnassigned,onClick:()=>p({actorIds:[],includeUnassigned:!1}),children:"Clear actors"})]})]}),x.jsxs("div",{className:"toolbar-menu",children:[x.jsx("button",{type:"button",className:"menu-trigger",onClick:()=>j(ae=>!ae),"aria-haspopup":"menu","aria-expanded":C,"aria-label":"Open menu",title:"Open menu",children:"..."}),C?x.jsx("div",{className:"menu-popover",role:"menu",children:x.jsx("button",{type:"button",role:"menuitem",onClick:on,disabled:_==="exporting",children:_==="exporting"?"Exporting...":"Export"})}):null]}),T?x.jsx("div",{className:"toolbar-error",role:"alert",children:T}):null]}),x.jsx(t3,{session:ze,drafts:Object.values(k),view:pe,onView:ae=>{xe(ae),d("all")}}),x.jsx(C3,{report:s,onSelect:Qe,open:he,onOpen:()=>fe(!0),onClose:()=>fe(!1)}),o?x.jsx(w3,{diff:o,filter:u,onFilter:d,onSelect:Qe}):null,x.jsx(M3,{diff:o,session:de.snapshot?ze:void 0,view:pe,draftMessage:Et?k[Et]?.message??"":"",onDraftChange:zt,onDraftSent:ae=>zt("",ae),gwtList:ia,onGwtList:ls,onClose:Dt,onFocusNode:ae=>Qe(ae,!0,!0),project:t,selectedNode:We,findings:Yn,selectedFieldName:ie,onSelect:Qe,onSelectField:ce,onClearField:()=>ce(void 0),onPreviewConnection:Gn,onClearPreview:Nt},(bn??We)?.type==="gwt"?`gwt:${(bn??We)?.sourcePath??(bn??We)?.sliceTitle}`:"selection"),x.jsxs("main",{className:"canvas",tabIndex:-1,"aria-label":"Event model diagram",children:[(h.actorIds.length>0||h.includeUnassigned)&&!rt.nodes.some(ae=>!ae.hidden&&ae.data.projectNode.type!=="story"&&ae.data.projectNode.type!=="slice")?x.jsx("div",{className:"actor-empty",role:"status",children:"No screens match the selected actors and current filters."}):null,x.jsx(DS.Provider,{value:vi,children:x.jsxs(CM,{nodes:rt.nodes,edges:rt.edges,nodeTypes:m3,edgeTypes:y3,onNodeClick:(ae,ye)=>Qe(ye.id),fitView:!0,minZoom:.2,maxZoom:1.8,nodesDraggable:!1,colorMode:"light",children:[x.jsx(LM,{gap:18,size:1}),x.jsx(YM,{})]})})]})]}):x.jsx("div",{className:"loading",children:x.jsx("div",{children:de.error?x.jsxs(x.Fragment,{children:[x.jsx("p",{role:"alert",children:de.error}),x.jsx("button",{type:"button",onClick:de.refresh,children:"Retry connection"})]}):"Loading event model..."})})}function z3(){return x.jsx(y1,{children:x.jsx(O3,{})})}Qx.createRoot(document.getElementById("root")).render(x.jsx(Jc.StrictMode,{children:x.jsx(z3,{})}));
|