emviz 0.3.2 → 0.5.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.
@@ -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"]'))l(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"&&l(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 l(o){if(o.ep)return;o.ep=!0;const c=s(o);fetch(o.href,c)}})();function Zv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vd={exports:{}},po={};var r0;function lE(){if(r0)return po;r0=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function s(l,o,c){var u=null;if(c!==void 0&&(u=""+c),o.key!==void 0&&(u=""+o.key),"key"in o){c={};for(var h in o)h!=="key"&&(c[h]=o[h])}else c=o;return o=c.ref,{$$typeof:e,type:l,key:u,ref:o!==void 0?o:null,props:c}}return po.Fragment=n,po.jsx=s,po.jsxs=s,po}var c0;function oE(){return c0||(c0=1,Vd.exports=lE()),Vd.exports}var S=oE(),Yd={exports:{}},Ne={};var u0;function rE(){if(u0)return Ne;u0=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),v=Symbol.iterator;function w(k){return k===null||typeof k!="object"?null:(k=v&&k[v]||k["@@iterator"],typeof k=="function"?k:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,A={};function C(k,H,ne){this.props=k,this.context=H,this.refs=A,this.updater=ne||E}C.prototype.isReactComponent={},C.prototype.setState=function(k,H){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,H,"setState")},C.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function z(){}z.prototype=C.prototype;function _(k,H,ne){this.props=k,this.context=H,this.refs=A,this.updater=ne||E}var x=_.prototype=new z;x.constructor=_,N(x,C.prototype),x.isPureReactComponent=!0;var T=Array.isArray;function O(){}var D={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function q(k,H,ne){var ae=ne.ref;return{$$typeof:e,type:k,key:H,ref:ae!==void 0?ae:null,props:ne}}function P(k,H){return q(k.type,H,k.props)}function G(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function X(k){var H={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(ne){return H[ne]})}var W=/\/+/g;function B(k,H){return typeof k=="object"&&k!==null&&k.key!=null?X(""+k.key):H.toString(36)}function K(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(O,O):(k.status="pending",k.then(function(H){k.status==="pending"&&(k.status="fulfilled",k.value=H)},function(H){k.status==="pending"&&(k.status="rejected",k.reason=H)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function j(k,H,ne,ae,fe){var de=typeof k;(de==="undefined"||de==="boolean")&&(k=null);var se=!1;if(k===null)se=!0;else switch(de){case"bigint":case"string":case"number":se=!0;break;case"object":switch(k.$$typeof){case e:case n:se=!0;break;case y:return se=k._init,j(se(k._payload),H,ne,ae,fe)}}if(se)return fe=fe(k),se=ae===""?"."+B(k,0):ae,T(fe)?(ne="",se!=null&&(ne=se.replace(W,"$&/")+"/"),j(fe,H,ne,"",function(Ee){return Ee})):fe!=null&&(G(fe)&&(fe=P(fe,ne+(fe.key==null||k&&k.key===fe.key?"":(""+fe.key).replace(W,"$&/")+"/")+se)),H.push(fe)),1;se=0;var te=ae===""?".":ae+":";if(T(k))for(var ue=0;ue<k.length;ue++)ae=k[ue],de=te+B(ae,ue),se+=j(ae,H,ne,de,fe);else if(ue=w(k),typeof ue=="function")for(k=ue.call(k),ue=0;!(ae=k.next()).done;)ae=ae.value,de=te+B(ae,ue++),se+=j(ae,H,ne,de,fe);else if(de==="object"){if(typeof k.then=="function")return j(K(k),H,ne,ae,fe);throw H=String(k),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return se}function $(k,H,ne){if(k==null)return k;var ae=[],fe=0;return j(k,ae,"","",function(de){return H.call(ne,de,fe++)}),ae}function L(k){if(k._status===-1){var H=k._result;H=H(),H.then(function(ne){(k._status===0||k._status===-1)&&(k._status=1,k._result=ne)},function(ne){(k._status===0||k._status===-1)&&(k._status=2,k._result=ne)}),k._status===-1&&(k._status=0,k._result=H)}if(k._status===1)return k._result.default;throw k._result}var Y=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},ee={map:$,forEach:function(k,H,ne){$(k,function(){H.apply(this,arguments)},ne)},count:function(k){var H=0;return $(k,function(){H++}),H},toArray:function(k){return $(k,function(H){return H})||[]},only:function(k){if(!G(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return Ne.Activity=p,Ne.Children=ee,Ne.Component=C,Ne.Fragment=s,Ne.Profiler=o,Ne.PureComponent=_,Ne.StrictMode=l,Ne.Suspense=d,Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ne.__COMPILER_RUNTIME={__proto__:null,c:function(k){return D.H.useMemoCache(k)}},Ne.cache=function(k){return function(){return k.apply(null,arguments)}},Ne.cacheSignal=function(){return null},Ne.cloneElement=function(k,H,ne){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var ae=N({},k.props),fe=k.key;if(H!=null)for(de in H.key!==void 0&&(fe=""+H.key),H)!R.call(H,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&H.ref===void 0||(ae[de]=H[de]);var de=arguments.length-2;if(de===1)ae.children=ne;else if(1<de){for(var se=Array(de),te=0;te<de;te++)se[te]=arguments[te+2];ae.children=se}return q(k.type,fe,ae)},Ne.createContext=function(k){return k={$$typeof:u,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:c,_context:k},k},Ne.createElement=function(k,H,ne){var ae,fe={},de=null;if(H!=null)for(ae in H.key!==void 0&&(de=""+H.key),H)R.call(H,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(fe[ae]=H[ae]);var se=arguments.length-2;if(se===1)fe.children=ne;else if(1<se){for(var te=Array(se),ue=0;ue<se;ue++)te[ue]=arguments[ue+2];fe.children=te}if(k&&k.defaultProps)for(ae in se=k.defaultProps,se)fe[ae]===void 0&&(fe[ae]=se[ae]);return q(k,de,fe)},Ne.createRef=function(){return{current:null}},Ne.forwardRef=function(k){return{$$typeof:h,render:k}},Ne.isValidElement=G,Ne.lazy=function(k){return{$$typeof:y,_payload:{_status:-1,_result:k},_init:L}},Ne.memo=function(k,H){return{$$typeof:g,type:k,compare:H===void 0?null:H}},Ne.startTransition=function(k){var H=D.T,ne={};D.T=ne;try{var ae=k(),fe=D.S;fe!==null&&fe(ne,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(O,Y)}catch(de){Y(de)}finally{H!==null&&ne.types!==null&&(H.types=ne.types),D.T=H}},Ne.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ne.use=function(k){return D.H.use(k)},Ne.useActionState=function(k,H,ne){return D.H.useActionState(k,H,ne)},Ne.useCallback=function(k,H){return D.H.useCallback(k,H)},Ne.useContext=function(k){return D.H.useContext(k)},Ne.useDebugValue=function(){},Ne.useDeferredValue=function(k,H){return D.H.useDeferredValue(k,H)},Ne.useEffect=function(k,H){return D.H.useEffect(k,H)},Ne.useEffectEvent=function(k){return D.H.useEffectEvent(k)},Ne.useId=function(){return D.H.useId()},Ne.useImperativeHandle=function(k,H,ne){return D.H.useImperativeHandle(k,H,ne)},Ne.useInsertionEffect=function(k,H){return D.H.useInsertionEffect(k,H)},Ne.useLayoutEffect=function(k,H){return D.H.useLayoutEffect(k,H)},Ne.useMemo=function(k,H){return D.H.useMemo(k,H)},Ne.useOptimistic=function(k,H){return D.H.useOptimistic(k,H)},Ne.useReducer=function(k,H,ne){return D.H.useReducer(k,H,ne)},Ne.useRef=function(k){return D.H.useRef(k)},Ne.useState=function(k){return D.H.useState(k)},Ne.useSyncExternalStore=function(k,H,ne){return D.H.useSyncExternalStore(k,H,ne)},Ne.useTransition=function(){return D.H.useTransition()},Ne.version="19.2.7",Ne}var f0;function Yo(){return f0||(f0=1,Yd.exports=rE()),Yd.exports}var V=Yo();const ou=Zv(V);var Gd={exports:{}},yo={},Xd={exports:{}},Kd={};var d0;function cE(){return d0||(d0=1,(function(e){function n(j,$){var L=j.length;j.push($);e:for(;0<L;){var Y=L-1>>>1,ee=j[Y];if(0<o(ee,$))j[Y]=$,j[L]=ee,L=Y;else break e}}function s(j){return j.length===0?null:j[0]}function l(j){if(j.length===0)return null;var $=j[0],L=j.pop();if(L!==$){j[0]=L;e:for(var Y=0,ee=j.length,k=ee>>>1;Y<k;){var H=2*(Y+1)-1,ne=j[H],ae=H+1,fe=j[ae];if(0>o(ne,L))ae<ee&&0>o(fe,ne)?(j[Y]=fe,j[ae]=L,Y=ae):(j[Y]=ne,j[H]=L,Y=H);else if(ae<ee&&0>o(fe,L))j[Y]=fe,j[ae]=L,Y=ae;else break e}}return $}function o(j,$){var L=j.sortIndex-$.sortIndex;return L!==0?L:j.id-$.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,h=u.now();e.unstable_now=function(){return u.now()-h}}var d=[],g=[],y=1,p=null,v=3,w=!1,E=!1,N=!1,A=!1,C=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function x(j){for(var $=s(g);$!==null;){if($.callback===null)l(g);else if($.startTime<=j)l(g),$.sortIndex=$.expirationTime,n(d,$);else break;$=s(g)}}function T(j){if(N=!1,x(j),!E)if(s(d)!==null)E=!0,O||(O=!0,X());else{var $=s(g);$!==null&&K(T,$.startTime-j)}}var O=!1,D=-1,R=5,q=-1;function P(){return A?!0:!(e.unstable_now()-q<R)}function G(){if(A=!1,O){var j=e.unstable_now();q=j;var $=!0;try{e:{E=!1,N&&(N=!1,z(D),D=-1),w=!0;var L=v;try{t:{for(x(j),p=s(d);p!==null&&!(p.expirationTime>j&&P());){var Y=p.callback;if(typeof Y=="function"){p.callback=null,v=p.priorityLevel;var ee=Y(p.expirationTime<=j);if(j=e.unstable_now(),typeof ee=="function"){p.callback=ee,x(j),$=!0;break t}p===s(d)&&l(d),x(j)}else l(d);p=s(d)}if(p!==null)$=!0;else{var k=s(g);k!==null&&K(T,k.startTime-j),$=!1}}break e}finally{p=null,v=L,w=!1}$=void 0}}finally{$?X():O=!1}}}var X;if(typeof _=="function")X=function(){_(G)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,B=W.port2;W.port1.onmessage=G,X=function(){B.postMessage(null)}}else X=function(){C(G,0)};function K(j,$){D=C(function(){j(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(j){switch(v){case 1:case 2:case 3:var $=3;break;default:$=v}var L=v;v=$;try{return j()}finally{v=L}},e.unstable_requestPaint=function(){A=!0},e.unstable_runWithPriority=function(j,$){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var L=v;v=j;try{return $()}finally{v=L}},e.unstable_scheduleCallback=function(j,$,L){var Y=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?Y+L:Y):L=Y,j){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=L+ee,j={id:y++,callback:$,priorityLevel:j,startTime:L,expirationTime:ee,sortIndex:-1},L>Y?(j.sortIndex=L,n(g,j),s(d)===null&&j===s(g)&&(N?(z(D),D=-1):N=!0,K(T,L-Y))):(j.sortIndex=ee,n(d,j),E||w||(E=!0,O||(O=!0,X()))),j},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(j){var $=v;return function(){var L=v;v=$;try{return j.apply(this,arguments)}finally{v=L}}}})(Kd)),Kd}var h0;function uE(){return h0||(h0=1,Xd.exports=cE()),Xd.exports}var Qd={exports:{}},kt={};var m0;function fE(){if(m0)return kt;m0=1;var e=Yo();function n(d){var g="https://react.dev/errors/"+d;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)g+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+d+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var l={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(d,g,y){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:p==null?null:""+p,children:d,containerInfo:g,implementation:y}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(d,g){if(d==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,kt.createPortal=function(d,g){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(n(299));return c(d,g,null,y)},kt.flushSync=function(d){var g=u.T,y=l.p;try{if(u.T=null,l.p=2,d)return d()}finally{u.T=g,l.p=y,l.d.f()}},kt.preconnect=function(d,g){typeof d=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,l.d.C(d,g))},kt.prefetchDNS=function(d){typeof d=="string"&&l.d.D(d)},kt.preinit=function(d,g){if(typeof d=="string"&&g&&typeof g.as=="string"){var y=g.as,p=h(y,g.crossOrigin),v=typeof g.integrity=="string"?g.integrity:void 0,w=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;y==="style"?l.d.S(d,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:p,integrity:v,fetchPriority:w}):y==="script"&&l.d.X(d,{crossOrigin:p,integrity:v,fetchPriority:w,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},kt.preinitModule=function(d,g){if(typeof d=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var y=h(g.as,g.crossOrigin);l.d.M(d,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&l.d.M(d)},kt.preload=function(d,g){if(typeof d=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var y=g.as,p=h(y,g.crossOrigin);l.d.L(d,y,{crossOrigin:p,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},kt.preloadModule=function(d,g){if(typeof d=="string")if(g){var y=h(g.as,g.crossOrigin);l.d.m(d,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else l.d.m(d)},kt.requestFormReset=function(d){l.d.r(d)},kt.unstable_batchedUpdates=function(d,g){return d(g)},kt.useFormState=function(d,g,y){return u.H.useFormState(d,g,y)},kt.useFormStatus=function(){return u.H.useHostTransitionStatus()},kt.version="19.2.7",kt}var g0;function Fv(){if(g0)return Qd.exports;g0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Qd.exports=fE(),Qd.exports}var p0;function dE(){if(p0)return yo;p0=1;var e=uE(),n=Yo(),s=Fv();function l(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)i+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var i=t,a=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(a=i.return),t=i.return;while(t)}return i.tag===3?a:null}function u(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function h(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function d(t){if(c(t)!==t)throw Error(l(188))}function g(t){var i=t.alternate;if(!i){if(i=c(t),i===null)throw Error(l(188));return i!==t?null:t}for(var a=t,r=i;;){var f=a.return;if(f===null)break;var m=f.alternate;if(m===null){if(r=f.return,r!==null){a=r;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===a)return d(f),t;if(m===r)return d(f),i;m=m.sibling}throw Error(l(188))}if(a.return!==r.return)a=f,r=m;else{for(var b=!1,M=f.child;M;){if(M===a){b=!0,a=f,r=m;break}if(M===r){b=!0,r=f,a=m;break}M=M.sibling}if(!b){for(M=m.child;M;){if(M===a){b=!0,a=m,r=f;break}if(M===r){b=!0,r=m,a=f;break}M=M.sibling}if(!b)throw Error(l(189))}}if(a.alternate!==r)throw Error(l(190))}if(a.tag!==3)throw Error(l(188));return a.stateNode.current===a?t:i}function y(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=y(t),i!==null)return i;t=t.sibling}return null}var p=Object.assign,v=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),_=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function X(t){return t===null||typeof t!="object"?null:(t=G&&t[G]||t["@@iterator"],typeof t=="function"?t:null)}var W=Symbol.for("react.client.reference");function B(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===W?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case N:return"Fragment";case C:return"Profiler";case A:return"StrictMode";case T:return"Suspense";case O:return"SuspenseList";case q:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case E:return"Portal";case _:return t.displayName||"Context";case z:return(t._context.displayName||"Context")+".Consumer";case x:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case D:return i=t.displayName||null,i!==null?i:B(t.type)||"Memo";case R:i=t._payload,t=t._init;try{return B(t(i))}catch{}}return null}var K=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},Y=[],ee=-1;function k(t){return{current:t}}function H(t){0>ee||(t.current=Y[ee],Y[ee]=null,ee--)}function ne(t,i){ee++,Y[ee]=t.current,t.current=i}var ae=k(null),fe=k(null),de=k(null),se=k(null);function te(t,i){switch(ne(de,i),ne(fe,t),ne(ae,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?ky(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=ky(i),t=jy(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}H(ae),ne(ae,t)}function ue(){H(ae),H(fe),H(de)}function Ee(t){t.memoizedState!==null&&ne(se,t);var i=ae.current,a=jy(i,t.type);i!==a&&(ne(fe,t),ne(ae,a))}function Se(t){fe.current===t&&(H(ae),H(fe)),se.current===t&&(H(se),fo._currentValue=L)}var ge,ve;function xe(t){if(ge===void 0)try{throw Error()}catch(a){var i=a.stack.trim().match(/\n( *(at )?)/);ge=i&&i[1]||"",ve=-1<a.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+ge+t+ve}var ze=!1;function Ye(t,i){if(!t||ze)return"";ze=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(i){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(ie){var J=ie}Reflect.construct(t,[],ce)}else{try{ce.call()}catch(ie){J=ie}t.call(ce.prototype)}}else{try{throw Error()}catch(ie){J=ie}(ce=t())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(ie){if(ie&&J&&typeof ie.stack=="string")return[ie.stack,J.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],M=m[1];if(b&&M){var U=b.split(`
4
+ `),F=M.split(`
5
+ `);for(f=r=0;r<U.length&&!U[r].includes("DetermineComponentFrameRoot");)r++;for(;f<F.length&&!F[f].includes("DetermineComponentFrameRoot");)f++;if(r===U.length||f===F.length)for(r=U.length-1,f=F.length-1;1<=r&&0<=f&&U[r]!==F[f];)f--;for(;1<=r&&0<=f;r--,f--)if(U[r]!==F[f]){if(r!==1||f!==1)do if(r--,f--,0>f||U[r]!==F[f]){var oe=`
6
+ `+U[r].replace(" at new "," at ");return t.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",t.displayName)),oe}while(1<=r&&0<=f);break}}}finally{ze=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?xe(a):""}function St(t,i){switch(t.tag){case 26:case 27:case 5:return xe(t.type);case 16:return xe("Lazy");case 13:return t.child!==i&&i!==null?xe("Suspense Fallback"):xe("Suspense");case 19:return xe("SuspenseList");case 0:case 15:return Ye(t.type,!1);case 11:return Ye(t.type.render,!1);case 1:return Ye(t.type,!0);case 31:return xe("Activity");default:return""}}function rt(t){try{var i="",a=null;do i+=St(t,a),a=t,t=t.return;while(t);return i}catch(r){return`
7
+ Error generating stack: `+r.message+`
8
+ `+r.stack}}var ht=Object.prototype.hasOwnProperty,Mt=e.unstable_scheduleCallback,De=e.unstable_cancelCallback,Lt=e.unstable_shouldYield,Ht=e.unstable_requestPaint,st=e.unstable_now,zt=e.unstable_getCurrentPriorityLevel,$t=e.unstable_ImmediatePriority,qe=e.unstable_UserBlockingPriority,Nt=e.unstable_NormalPriority,fs=e.unstable_LowPriority,Kn=e.unstable_IdlePriority,yl=e.log,wi=e.unstable_setDisableYieldValue,Bn=null,at=null;function Wt(t){if(typeof yl=="function"&&wi(t),at&&typeof at.setStrictMode=="function")try{at.setStrictMode(Bn,t)}catch{}}var Ge=Math.clz32?Math.clz32:vl,ds=Math.log,hs=Math.LN2;function vl(t){return t>>>=0,t===0?32:31-(ds(t)/hs|0)|0}var Ut=256,xi=262144,Ei=4194304;function wn(t){var i=t&42;if(i!==0)return i;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ni(t,i,a){var r=t.pendingLanes;if(r===0)return 0;var f=0,m=t.suspendedLanes,b=t.pingedLanes;t=t.warmLanes;var M=r&134217727;return M!==0?(r=M&~m,r!==0?f=wn(r):(b&=M,b!==0?f=wn(b):a||(a=M&~t,a!==0&&(f=wn(a))))):(M=r&~m,M!==0?f=wn(M):b!==0?f=wn(b):a||(a=r&~t,a!==0&&(f=wn(a)))),f===0?0:i!==0&&i!==f&&(i&m)===0&&(m=f&-f,a=i&-i,m>=a||m===32&&(a&4194048)!==0)?i:f}function Qn(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function bl(t,i){switch(t){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 Zs(){var t=Ei;return Ei<<=1,(Ei&62914560)===0&&(Ei=4194304),t}function le(t){for(var i=[],a=0;31>a;a++)i.push(t);return i}function me(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ce(t,i,a,r,f,m){var b=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var M=t.entanglements,U=t.expirationTimes,F=t.hiddenUpdates;for(a=b&~a;0<a;){var oe=31-Ge(a),ce=1<<oe;M[oe]=0,U[oe]=-1;var J=F[oe];if(J!==null)for(F[oe]=null,oe=0;oe<J.length;oe++){var ie=J[oe];ie!==null&&(ie.lane&=-536870913)}a&=~ce}r!==0&&Pe(t,r,0),m!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=m&~(b&~i))}function Pe(t,i,a){t.pendingLanes|=i,t.suspendedLanes&=~i;var r=31-Ge(i);t.entangledLanes|=i,t.entanglements[r]=t.entanglements[r]|1073741824|a&261930}function qt(t,i){var a=t.entangledLanes|=i;for(t=t.entanglements;a;){var r=31-Ge(a),f=1<<r;f&i|t[r]&i&&(t[r]|=i),a&=~f}}function Dt(t,i){var a=i&-i;return a=(a&42)!==0?1:ms(a),(a&(t.suspendedLanes|i))!==0?0:a}function ms(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Sl(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function tr(){var t=$.p;return t!==0?t:(t=window.event,t===void 0?32:t0(t.type))}function nr(t,i){var a=$.p;try{return $.p=t,i()}finally{$.p=a}}var Ln=Math.random().toString(36).slice(2),wt="__reactFiber$"+Ln,Ot="__reactProps$"+Ln,Zn="__reactContainer$"+Ln,Fs="__reactEvents$"+Ln,ir="__reactListeners$"+Ln,Du="__reactHandles$"+Ln,sr="__reactResources$"+Ln,gs="__reactMarker$"+Ln;function wl(t){delete t[wt],delete t[Ot],delete t[Fs],delete t[ir],delete t[Du]}function _i(t){var i=t[wt];if(i)return i;for(var a=t.parentNode;a;){if(i=a[Zn]||a[wt]){if(a=i.alternate,i.child!==null||a!==null&&a.child!==null)for(t=$y(t);t!==null;){if(a=t[wt])return a;t=$y(t)}return i}t=a,a=t.parentNode}return null}function Ai(t){if(t=t[wt]||t[Zn]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function Ti(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(l(33))}function Ci(t){var i=t[sr];return i||(i=t[sr]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function mt(t){t[gs]=!0}var ar=new Set,lr={};function Fn(t,i){Mi(t,i),Mi(t+"Capture",i)}function Mi(t,i){for(lr[t]=i,t=0;t<i.length;t++)ar.add(i[t])}var Ru=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]*$"),or={},xl={};function Bu(t){return ht.call(xl,t)?!0:ht.call(or,t)?!1:Ru.test(t)?xl[t]=!0:(or[t]=!0,!1)}function Js(t,i,a){if(Bu(i))if(a===null)t.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var r=i.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+a)}}function Ws(t,i,a){if(a===null)t.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+a)}}function xn(t,i,a,r){if(r===null)t.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(i,a,""+r)}}function It(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function rr(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Lu(t,i,a){var r=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var f=r.get,m=r.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return f.call(this)},set:function(b){a=""+b,m.call(this,b)}}),Object.defineProperty(t,i,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(b){a=""+b},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function El(t){if(!t._valueTracker){var i=rr(t)?"checked":"value";t._valueTracker=Lu(t,i,""+t[i])}}function Nl(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var a=i.getValue(),r="";return t&&(r=rr(t)?t.checked?"true":"false":t.value),t=r,t!==a?(i.setValue(t),!0):!1}function Ps(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var cr=/[\n"\\]/g;function Vt(t){return t.replace(cr,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function _l(t,i,a,r,f,m,b,M){t.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?t.type=b:t.removeAttribute("type"),i!=null?b==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+It(i)):t.value!==""+It(i)&&(t.value=""+It(i)):b!=="submit"&&b!=="reset"||t.removeAttribute("value"),i!=null?Al(t,b,It(i)):a!=null?Al(t,b,It(a)):r!=null&&t.removeAttribute("value"),f==null&&m!=null&&(t.defaultChecked=!!m),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?t.name=""+It(M):t.removeAttribute("name")}function ea(t,i,a,r,f,m,b,M){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),i!=null||a!=null){if(!(m!=="submit"&&m!=="reset"||i!=null)){El(t);return}a=a!=null?""+It(a):"",i=i!=null?""+It(i):a,M||i===t.value||(t.value=i),t.defaultValue=i}r=r??f,r=typeof r!="function"&&typeof r!="symbol"&&!!r,t.checked=M?t.checked:!!r,t.defaultChecked=!!r,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(t.name=b),El(t)}function Al(t,i,a){i==="number"&&Ps(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Oi(t,i,a,r){if(t=t.options,i){i={};for(var f=0;f<a.length;f++)i["$"+a[f]]=!0;for(a=0;a<t.length;a++)f=i.hasOwnProperty("$"+t[a].value),t[a].selected!==f&&(t[a].selected=f),f&&r&&(t[a].defaultSelected=!0)}else{for(a=""+It(a),i=null,f=0;f<t.length;f++){if(t[f].value===a){t[f].selected=!0,r&&(t[f].defaultSelected=!0);return}i!==null||t[f].disabled||(i=t[f])}i!==null&&(i.selected=!0)}}function Tl(t,i,a){if(i!=null&&(i=""+It(i),i!==t.value&&(t.value=i),a==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=a!=null?""+It(a):""}function Tm(t,i,a,r){if(i==null){if(r!=null){if(a!=null)throw Error(l(92));if(K(r)){if(1<r.length)throw Error(l(93));r=r[0]}a=r}a==null&&(a=""),i=a}a=It(i),t.defaultValue=a,r=t.textContent,r===a&&r!==""&&r!==null&&(t.value=r),El(t)}function ta(t,i){if(i){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=i;return}}t.textContent=i}var tw=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 Cm(t,i,a){var r=i.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":r?t.setProperty(i,a):typeof a!="number"||a===0||tw.has(i)?i==="float"?t.cssFloat=a:t[i]=(""+a).trim():t[i]=a+"px"}function Mm(t,i,a){if(i!=null&&typeof i!="object")throw Error(l(62));if(t=t.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||i!=null&&i.hasOwnProperty(r)||(r.indexOf("--")===0?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="");for(var f in i)r=i[f],i.hasOwnProperty(f)&&a[f]!==r&&Cm(t,f,r)}else for(var m in i)i.hasOwnProperty(m)&&Cm(t,m,i[m])}function Hu(t){if(t.indexOf("-")===-1)return!1;switch(t){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 nw=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"]]),iw=/^[\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 ur(t){return iw.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Jn(){}var $u=null;function Uu(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var na=null,ia=null;function Om(t){var i=Ai(t);if(i&&(t=i.stateNode)){var a=t[Ot]||null;e:switch(t=i.stateNode,i.type){case"input":if(_l(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),i=a.name,a.type==="radio"&&i!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Vt(""+i)+'"][type="radio"]'),i=0;i<a.length;i++){var r=a[i];if(r!==t&&r.form===t.form){var f=r[Ot]||null;if(!f)throw Error(l(90));_l(r,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(i=0;i<a.length;i++)r=a[i],r.form===t.form&&Nl(r)}break e;case"textarea":Tl(t,a.value,a.defaultValue);break e;case"select":i=a.value,i!=null&&Oi(t,!!a.multiple,i,!1)}}}var qu=!1;function km(t,i,a){if(qu)return t(i,a);qu=!0;try{var r=t(i);return r}finally{if(qu=!1,(na!==null||ia!==null)&&(Jr(),na&&(i=na,t=ia,ia=na=null,Om(i),t)))for(i=0;i<t.length;i++)Om(t[i])}}function Cl(t,i){var a=t.stateNode;if(a===null)return null;var r=a[Ot]||null;if(r===null)return null;a=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)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(l(231,i,typeof a));return a}var Wn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Iu=!1;if(Wn)try{var Ml={};Object.defineProperty(Ml,"passive",{get:function(){Iu=!0}}),window.addEventListener("test",Ml,Ml),window.removeEventListener("test",Ml,Ml)}catch{Iu=!1}var ki=null,Vu=null,fr=null;function jm(){if(fr)return fr;var t,i=Vu,a=i.length,r,f="value"in ki?ki.value:ki.textContent,m=f.length;for(t=0;t<a&&i[t]===f[t];t++);var b=a-t;for(r=1;r<=b&&i[a-r]===f[m-r];r++);return fr=f.slice(t,1<r?1-r:void 0)}function dr(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function hr(){return!0}function zm(){return!1}function Yt(t){function i(a,r,f,m,b){this._reactName=a,this._targetInst=f,this.type=r,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var M in t)t.hasOwnProperty(M)&&(a=t[M],this[M]=a?a(m):m[M]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?hr:zm,this.isPropagationStopped=zm,this}return p(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=hr)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=hr)},persist:function(){},isPersistent:hr}),i}var ps={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mr=Yt(ps),Ol=p({},ps,{view:0,detail:0}),sw=Yt(Ol),Yu,Gu,kl,gr=p({},Ol,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ku,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==kl&&(kl&&t.type==="mousemove"?(Yu=t.screenX-kl.screenX,Gu=t.screenY-kl.screenY):Gu=Yu=0,kl=t),Yu)},movementY:function(t){return"movementY"in t?t.movementY:Gu}}),Dm=Yt(gr),aw=p({},gr,{dataTransfer:0}),lw=Yt(aw),ow=p({},Ol,{relatedTarget:0}),Xu=Yt(ow),rw=p({},ps,{animationName:0,elapsedTime:0,pseudoElement:0}),cw=Yt(rw),uw=p({},ps,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),fw=Yt(uw),dw=p({},ps,{data:0}),Rm=Yt(dw),hw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mw={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"},gw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pw(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=gw[t])?!!i[t]:!1}function Ku(){return pw}var yw=p({},Ol,{key:function(t){if(t.key){var i=hw[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=dr(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?mw[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ku,charCode:function(t){return t.type==="keypress"?dr(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?dr(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),vw=Yt(yw),bw=p({},gr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bm=Yt(bw),Sw=p({},Ol,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ku}),ww=Yt(Sw),xw=p({},ps,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ew=Yt(xw),Nw=p({},gr,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),_w=Yt(Nw),Aw=p({},ps,{newState:0,oldState:0}),Tw=Yt(Aw),Cw=[9,13,27,32],Qu=Wn&&"CompositionEvent"in window,jl=null;Wn&&"documentMode"in document&&(jl=document.documentMode);var Mw=Wn&&"TextEvent"in window&&!jl,Lm=Wn&&(!Qu||jl&&8<jl&&11>=jl),Hm=" ",$m=!1;function Um(t,i){switch(t){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 qm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var sa=!1;function Ow(t,i){switch(t){case"compositionend":return qm(i);case"keypress":return i.which!==32?null:($m=!0,Hm);case"textInput":return t=i.data,t===Hm&&$m?null:t;default:return null}}function kw(t,i){if(sa)return t==="compositionend"||!Qu&&Um(t,i)?(t=jm(),fr=Vu=ki=null,sa=!1,t):null;switch(t){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 Lm&&i.locale!=="ko"?null:i.data;default:return null}}var jw={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 Im(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!jw[t.type]:i==="textarea"}function Vm(t,i,a,r){na?ia?ia.push(r):ia=[r]:na=r,i=sc(i,"onChange"),0<i.length&&(a=new mr("onChange","change",null,a,r),t.push({event:a,listeners:i}))}var zl=null,Dl=null;function zw(t){_y(t,0)}function pr(t){var i=Ti(t);if(Nl(i))return t}function Ym(t,i){if(t==="change")return i}var Gm=!1;if(Wn){var Zu;if(Wn){var Fu="oninput"in document;if(!Fu){var Xm=document.createElement("div");Xm.setAttribute("oninput","return;"),Fu=typeof Xm.oninput=="function"}Zu=Fu}else Zu=!1;Gm=Zu&&(!document.documentMode||9<document.documentMode)}function Km(){zl&&(zl.detachEvent("onpropertychange",Qm),Dl=zl=null)}function Qm(t){if(t.propertyName==="value"&&pr(Dl)){var i=[];Vm(i,Dl,t,Uu(t)),km(zw,i)}}function Dw(t,i,a){t==="focusin"?(Km(),zl=i,Dl=a,zl.attachEvent("onpropertychange",Qm)):t==="focusout"&&Km()}function Rw(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return pr(Dl)}function Bw(t,i){if(t==="click")return pr(i)}function Lw(t,i){if(t==="input"||t==="change")return pr(i)}function Hw(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var Pt=typeof Object.is=="function"?Object.is:Hw;function Rl(t,i){if(Pt(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var a=Object.keys(t),r=Object.keys(i);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var f=a[r];if(!ht.call(i,f)||!Pt(t[f],i[f]))return!1}return!0}function Zm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Fm(t,i){var a=Zm(t);t=0;for(var r;a;){if(a.nodeType===3){if(r=t+a.textContent.length,t<=i&&r>=i)return{node:a,offset:i-t};t=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Zm(a)}}function Jm(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?Jm(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function Wm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=Ps(t.document);i instanceof t.HTMLIFrameElement;){try{var a=typeof i.contentWindow.location.href=="string"}catch{a=!1}if(a)t=i.contentWindow;else break;i=Ps(t.document)}return i}function Ju(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var $w=Wn&&"documentMode"in document&&11>=document.documentMode,aa=null,Wu=null,Bl=null,Pu=!1;function Pm(t,i,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Pu||aa==null||aa!==Ps(r)||(r=aa,"selectionStart"in r&&Ju(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}),Bl&&Rl(Bl,r)||(Bl=r,r=sc(Wu,"onSelect"),0<r.length&&(i=new mr("onSelect","select",null,i,a),t.push({event:i,listeners:r}),i.target=aa)))}function ys(t,i){var a={};return a[t.toLowerCase()]=i.toLowerCase(),a["Webkit"+t]="webkit"+i,a["Moz"+t]="moz"+i,a}var la={animationend:ys("Animation","AnimationEnd"),animationiteration:ys("Animation","AnimationIteration"),animationstart:ys("Animation","AnimationStart"),transitionrun:ys("Transition","TransitionRun"),transitionstart:ys("Transition","TransitionStart"),transitioncancel:ys("Transition","TransitionCancel"),transitionend:ys("Transition","TransitionEnd")},ef={},eg={};Wn&&(eg=document.createElement("div").style,"AnimationEvent"in window||(delete la.animationend.animation,delete la.animationiteration.animation,delete la.animationstart.animation),"TransitionEvent"in window||delete la.transitionend.transition);function vs(t){if(ef[t])return ef[t];if(!la[t])return t;var i=la[t],a;for(a in i)if(i.hasOwnProperty(a)&&a in eg)return ef[t]=i[a];return t}var tg=vs("animationend"),ng=vs("animationiteration"),ig=vs("animationstart"),Uw=vs("transitionrun"),qw=vs("transitionstart"),Iw=vs("transitioncancel"),sg=vs("transitionend"),ag=new Map,tf="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(" ");tf.push("scrollEnd");function En(t,i){ag.set(t,i),Fn(i,[t])}var yr=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},un=[],oa=0,nf=0;function vr(){for(var t=oa,i=nf=oa=0;i<t;){var a=un[i];un[i++]=null;var r=un[i];un[i++]=null;var f=un[i];un[i++]=null;var m=un[i];if(un[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&&lg(a,f,m)}}function br(t,i,a,r){un[oa++]=t,un[oa++]=i,un[oa++]=a,un[oa++]=r,nf|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function sf(t,i,a,r){return br(t,i,a,r),Sr(t)}function bs(t,i){return br(t,null,null,i),Sr(t)}function lg(t,i,a){t.lanes|=a;var r=t.alternate;r!==null&&(r.lanes|=a);for(var f=!1,m=t.return;m!==null;)m.childLanes|=a,r=m.alternate,r!==null&&(r.childLanes|=a),m.tag===22&&(t=m.stateNode,t===null||t._visibility&1||(f=!0)),t=m,m=m.return;return t.tag===3?(m=t.stateNode,f&&i!==null&&(f=31-Ge(a),t=m.hiddenUpdates,r=t[f],r===null?t[f]=[i]:r.push(i),i.lane=a|536870912),m):null}function Sr(t){if(50<so)throw so=0,hd=null,Error(l(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var ra={};function Vw(t,i,a,r){this.tag=t,this.key=a,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 en(t,i,a,r){return new Vw(t,i,a,r)}function af(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Pn(t,i){var a=t.alternate;return a===null?(a=en(t.tag,i,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=i,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,i=t.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function og(t,i){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,i=a.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function wr(t,i,a,r,f,m){var b=0;if(r=t,typeof t=="function")af(t)&&(b=1);else if(typeof t=="string")b=Qx(t,a,ae.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case q:return t=en(31,a,i,f),t.elementType=q,t.lanes=m,t;case N:return Ss(a.children,f,m,i);case A:b=8,f|=24;break;case C:return t=en(12,a,i,f|2),t.elementType=C,t.lanes=m,t;case T:return t=en(13,a,i,f),t.elementType=T,t.lanes=m,t;case O:return t=en(19,a,i,f),t.elementType=O,t.lanes=m,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case _:b=10;break e;case z:b=9;break e;case x:b=11;break e;case D:b=14;break e;case R:b=16,r=null;break e}b=29,a=Error(l(130,t===null?"null":typeof t,"")),r=null}return i=en(b,a,i,f),i.elementType=t,i.type=r,i.lanes=m,i}function Ss(t,i,a,r){return t=en(7,t,r,i),t.lanes=a,t}function lf(t,i,a){return t=en(6,t,null,i),t.lanes=a,t}function rg(t){var i=en(18,null,null,0);return i.stateNode=t,i}function of(t,i,a){return i=en(4,t.children!==null?t.children:[],t.key,i),i.lanes=a,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var cg=new WeakMap;function fn(t,i){if(typeof t=="object"&&t!==null){var a=cg.get(t);return a!==void 0?a:(i={value:t,source:i,stack:rt(i)},cg.set(t,i),i)}return{value:t,source:i,stack:rt(i)}}var ca=[],ua=0,xr=null,Ll=0,dn=[],hn=0,ji=null,Hn=1,$n="";function ei(t,i){ca[ua++]=Ll,ca[ua++]=xr,xr=t,Ll=i}function ug(t,i,a){dn[hn++]=Hn,dn[hn++]=$n,dn[hn++]=ji,ji=t;var r=Hn;t=$n;var f=32-Ge(r)-1;r&=~(1<<f),a+=1;var m=32-Ge(i)+f;if(30<m){var b=f-f%5;m=(r&(1<<b)-1).toString(32),r>>=b,f-=b,Hn=1<<32-Ge(i)+f|a<<f|r,$n=m+t}else Hn=1<<m|a<<f|r,$n=t}function rf(t){t.return!==null&&(ei(t,1),ug(t,1,0))}function cf(t){for(;t===xr;)xr=ca[--ua],ca[ua]=null,Ll=ca[--ua],ca[ua]=null;for(;t===ji;)ji=dn[--hn],dn[hn]=null,$n=dn[--hn],dn[hn]=null,Hn=dn[--hn],dn[hn]=null}function fg(t,i){dn[hn++]=Hn,dn[hn++]=$n,dn[hn++]=ji,Hn=i.id,$n=i.overflow,ji=t}var _t=null,Je=null,Re=!1,zi=null,mn=!1,uf=Error(l(519));function Di(t){var i=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hl(fn(i,t)),uf}function dg(t){var i=t.stateNode,a=t.type,r=t.memoizedProps;switch(i[wt]=t,i[Ot]=r,a){case"dialog":Oe("cancel",i),Oe("close",i);break;case"iframe":case"object":case"embed":Oe("load",i);break;case"video":case"audio":for(a=0;a<lo.length;a++)Oe(lo[a],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),ea(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),Tm(i,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||i.textContent===""+a||r.suppressHydrationWarning===!0||My(i.textContent,a)?(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=Jn),i=!0):i=!1,i||Di(t,!0)}function hg(t){for(_t=t.return;_t;)switch(_t.tag){case 5:case 31:case 13:mn=!1;return;case 27:case 3:mn=!0;return;default:_t=_t.return}}function fa(t){if(t!==_t)return!1;if(!Re)return hg(t),Re=!0,!1;var i=t.tag,a;if((a=i!==3&&i!==27)&&((a=i===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Cd(t.type,t.memoizedProps)),a=!a),a&&Je&&Di(t),hg(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));Je=Hy(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));Je=Hy(t)}else i===27?(i=Je,Qi(t.type)?(t=zd,zd=null,Je=t):Je=i):Je=_t?pn(t.stateNode.nextSibling):null;return!0}function ws(){Je=_t=null,Re=!1}function ff(){var t=zi;return t!==null&&(Qt===null?Qt=t:Qt.push.apply(Qt,t),zi=null),t}function Hl(t){zi===null?zi=[t]:zi.push(t)}var df=k(null),xs=null,ti=null;function Ri(t,i,a){ne(df,i._currentValue),i._currentValue=a}function ni(t){t._currentValue=df.current,H(df)}function hf(t,i,a){for(;t!==null;){var r=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,r!==null&&(r.childLanes|=i)):r!==null&&(r.childLanes&i)!==i&&(r.childLanes|=i),t===a)break;t=t.return}}function mf(t,i,a,r){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var m=f.dependencies;if(m!==null){var b=f.child;m=m.firstContext;e:for(;m!==null;){var M=m;m=f;for(var U=0;U<i.length;U++)if(M.context===i[U]){m.lanes|=a,M=m.alternate,M!==null&&(M.lanes|=a),hf(m.return,a,t),r||(b=null);break e}m=M.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error(l(341));b.lanes|=a,m=b.alternate,m!==null&&(m.lanes|=a),hf(b,a,t),b=null}else b=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===t){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function da(t,i,a,r){t=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(l(387));if(b=b.memoizedProps,b!==null){var M=f.type;Pt(f.pendingProps.value,b.value)||(t!==null?t.push(M):t=[M])}}else if(f===se.current){if(b=f.alternate,b===null)throw Error(l(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(fo):t=[fo])}f=f.return}t!==null&&mf(i,t,a,r),i.flags|=262144}function Er(t){for(t=t.firstContext;t!==null;){if(!Pt(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Es(t){xs=t,ti=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function At(t){return mg(xs,t)}function Nr(t,i){return xs===null&&Es(t),mg(t,i)}function mg(t,i){var a=i._currentValue;if(i={context:i,memoizedValue:a,next:null},ti===null){if(t===null)throw Error(l(308));ti=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else ti=ti.next=i;return a}var Yw=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(a,r){t.push(r)}};this.abort=function(){i.aborted=!0,t.forEach(function(a){return a()})}},Gw=e.unstable_scheduleCallback,Xw=e.unstable_NormalPriority,gt={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function gf(){return{controller:new Yw,data:new Map,refCount:0}}function $l(t){t.refCount--,t.refCount===0&&Gw(Xw,function(){t.controller.abort()})}var Ul=null,pf=0,ha=0,ma=null;function Kw(t,i){if(Ul===null){var a=Ul=[];pf=0,ha=bd(),ma={status:"pending",value:void 0,then:function(r){a.push(r)}}}return pf++,i.then(gg,gg),i}function gg(){if(--pf===0&&Ul!==null){ma!==null&&(ma.status="fulfilled");var t=Ul;Ul=null,ha=0,ma=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function Qw(t,i){var a=[],r={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return t.then(function(){r.status="fulfilled",r.value=i;for(var f=0;f<a.length;f++)(0,a[f])(i)},function(f){for(r.status="rejected",r.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),r}var pg=j.S;j.S=function(t,i){Pp=st(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Kw(t,i),pg!==null&&pg(t,i)};var Ns=k(null);function yf(){var t=Ns.current;return t!==null?t:Ze.pooledCache}function _r(t,i){i===null?ne(Ns,Ns.current):ne(Ns,i.pool)}function yg(){var t=yf();return t===null?null:{parent:gt._currentValue,pool:t}}var ga=Error(l(460)),vf=Error(l(474)),Ar=Error(l(542)),Tr={then:function(){}};function vg(t){return t=t.status,t==="fulfilled"||t==="rejected"}function bg(t,i,a){switch(a=t[a],a===void 0?t.push(i):a!==i&&(i.then(Jn,Jn),i=a),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,wg(t),t;default:if(typeof i.status=="string")i.then(Jn,Jn);else{if(t=Ze,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=i,t.status="pending",t.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 t=i.reason,wg(t),t}throw As=i,ga}}function _s(t){try{var i=t._init;return i(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(As=a,ga):a}}var As=null;function Sg(){if(As===null)throw Error(l(459));var t=As;return As=null,t}function wg(t){if(t===ga||t===Ar)throw Error(l(483))}var pa=null,ql=0;function Cr(t){var i=ql;return ql+=1,pa===null&&(pa=[]),bg(pa,t,i)}function Il(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function Mr(t,i){throw i.$$typeof===v?Error(l(525)):(t=Object.prototype.toString.call(i),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function xg(t){function i(Q,I){if(t){var Z=Q.deletions;Z===null?(Q.deletions=[I],Q.flags|=16):Z.push(I)}}function a(Q,I){if(!t)return null;for(;I!==null;)i(Q,I),I=I.sibling;return null}function r(Q){for(var I=new Map;Q!==null;)Q.key!==null?I.set(Q.key,Q):I.set(Q.index,Q),Q=Q.sibling;return I}function f(Q,I){return Q=Pn(Q,I),Q.index=0,Q.sibling=null,Q}function m(Q,I,Z){return Q.index=Z,t?(Z=Q.alternate,Z!==null?(Z=Z.index,Z<I?(Q.flags|=67108866,I):Z):(Q.flags|=67108866,I)):(Q.flags|=1048576,I)}function b(Q){return t&&Q.alternate===null&&(Q.flags|=67108866),Q}function M(Q,I,Z,re){return I===null||I.tag!==6?(I=lf(Z,Q.mode,re),I.return=Q,I):(I=f(I,Z),I.return=Q,I)}function U(Q,I,Z,re){var be=Z.type;return be===N?oe(Q,I,Z.props.children,re,Z.key):I!==null&&(I.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===R&&_s(be)===I.type)?(I=f(I,Z.props),Il(I,Z),I.return=Q,I):(I=wr(Z.type,Z.key,Z.props,null,Q.mode,re),Il(I,Z),I.return=Q,I)}function F(Q,I,Z,re){return I===null||I.tag!==4||I.stateNode.containerInfo!==Z.containerInfo||I.stateNode.implementation!==Z.implementation?(I=of(Z,Q.mode,re),I.return=Q,I):(I=f(I,Z.children||[]),I.return=Q,I)}function oe(Q,I,Z,re,be){return I===null||I.tag!==7?(I=Ss(Z,Q.mode,re,be),I.return=Q,I):(I=f(I,Z),I.return=Q,I)}function ce(Q,I,Z){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return I=lf(""+I,Q.mode,Z),I.return=Q,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case w:return Z=wr(I.type,I.key,I.props,null,Q.mode,Z),Il(Z,I),Z.return=Q,Z;case E:return I=of(I,Q.mode,Z),I.return=Q,I;case R:return I=_s(I),ce(Q,I,Z)}if(K(I)||X(I))return I=Ss(I,Q.mode,Z,null),I.return=Q,I;if(typeof I.then=="function")return ce(Q,Cr(I),Z);if(I.$$typeof===_)return ce(Q,Nr(Q,I),Z);Mr(Q,I)}return null}function J(Q,I,Z,re){var be=I!==null?I.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return be!==null?null:M(Q,I,""+Z,re);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case w:return Z.key===be?U(Q,I,Z,re):null;case E:return Z.key===be?F(Q,I,Z,re):null;case R:return Z=_s(Z),J(Q,I,Z,re)}if(K(Z)||X(Z))return be!==null?null:oe(Q,I,Z,re,null);if(typeof Z.then=="function")return J(Q,I,Cr(Z),re);if(Z.$$typeof===_)return J(Q,I,Nr(Q,Z),re);Mr(Q,Z)}return null}function ie(Q,I,Z,re,be){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Q=Q.get(Z)||null,M(I,Q,""+re,be);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case w:return Q=Q.get(re.key===null?Z:re.key)||null,U(I,Q,re,be);case E:return Q=Q.get(re.key===null?Z:re.key)||null,F(I,Q,re,be);case R:return re=_s(re),ie(Q,I,Z,re,be)}if(K(re)||X(re))return Q=Q.get(Z)||null,oe(I,Q,re,be,null);if(typeof re.then=="function")return ie(Q,I,Z,Cr(re),be);if(re.$$typeof===_)return ie(Q,I,Z,Nr(I,re),be);Mr(I,re)}return null}function pe(Q,I,Z,re){for(var be=null,Le=null,ye=I,Te=I=0,je=null;ye!==null&&Te<Z.length;Te++){ye.index>Te?(je=ye,ye=null):je=ye.sibling;var He=J(Q,ye,Z[Te],re);if(He===null){ye===null&&(ye=je);break}t&&ye&&He.alternate===null&&i(Q,ye),I=m(He,I,Te),Le===null?be=He:Le.sibling=He,Le=He,ye=je}if(Te===Z.length)return a(Q,ye),Re&&ei(Q,Te),be;if(ye===null){for(;Te<Z.length;Te++)ye=ce(Q,Z[Te],re),ye!==null&&(I=m(ye,I,Te),Le===null?be=ye:Le.sibling=ye,Le=ye);return Re&&ei(Q,Te),be}for(ye=r(ye);Te<Z.length;Te++)je=ie(ye,Q,Te,Z[Te],re),je!==null&&(t&&je.alternate!==null&&ye.delete(je.key===null?Te:je.key),I=m(je,I,Te),Le===null?be=je:Le.sibling=je,Le=je);return t&&ye.forEach(function(Pi){return i(Q,Pi)}),Re&&ei(Q,Te),be}function we(Q,I,Z,re){if(Z==null)throw Error(l(151));for(var be=null,Le=null,ye=I,Te=I=0,je=null,He=Z.next();ye!==null&&!He.done;Te++,He=Z.next()){ye.index>Te?(je=ye,ye=null):je=ye.sibling;var Pi=J(Q,ye,He.value,re);if(Pi===null){ye===null&&(ye=je);break}t&&ye&&Pi.alternate===null&&i(Q,ye),I=m(Pi,I,Te),Le===null?be=Pi:Le.sibling=Pi,Le=Pi,ye=je}if(He.done)return a(Q,ye),Re&&ei(Q,Te),be;if(ye===null){for(;!He.done;Te++,He=Z.next())He=ce(Q,He.value,re),He!==null&&(I=m(He,I,Te),Le===null?be=He:Le.sibling=He,Le=He);return Re&&ei(Q,Te),be}for(ye=r(ye);!He.done;Te++,He=Z.next())He=ie(ye,Q,Te,He.value,re),He!==null&&(t&&He.alternate!==null&&ye.delete(He.key===null?Te:He.key),I=m(He,I,Te),Le===null?be=He:Le.sibling=He,Le=He);return t&&ye.forEach(function(aE){return i(Q,aE)}),Re&&ei(Q,Te),be}function Qe(Q,I,Z,re){if(typeof Z=="object"&&Z!==null&&Z.type===N&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case w:e:{for(var be=Z.key;I!==null;){if(I.key===be){if(be=Z.type,be===N){if(I.tag===7){a(Q,I.sibling),re=f(I,Z.props.children),re.return=Q,Q=re;break e}}else if(I.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===R&&_s(be)===I.type){a(Q,I.sibling),re=f(I,Z.props),Il(re,Z),re.return=Q,Q=re;break e}a(Q,I);break}else i(Q,I);I=I.sibling}Z.type===N?(re=Ss(Z.props.children,Q.mode,re,Z.key),re.return=Q,Q=re):(re=wr(Z.type,Z.key,Z.props,null,Q.mode,re),Il(re,Z),re.return=Q,Q=re)}return b(Q);case E:e:{for(be=Z.key;I!==null;){if(I.key===be)if(I.tag===4&&I.stateNode.containerInfo===Z.containerInfo&&I.stateNode.implementation===Z.implementation){a(Q,I.sibling),re=f(I,Z.children||[]),re.return=Q,Q=re;break e}else{a(Q,I);break}else i(Q,I);I=I.sibling}re=of(Z,Q.mode,re),re.return=Q,Q=re}return b(Q);case R:return Z=_s(Z),Qe(Q,I,Z,re)}if(K(Z))return pe(Q,I,Z,re);if(X(Z)){if(be=X(Z),typeof be!="function")throw Error(l(150));return Z=be.call(Z),we(Q,I,Z,re)}if(typeof Z.then=="function")return Qe(Q,I,Cr(Z),re);if(Z.$$typeof===_)return Qe(Q,I,Nr(Q,Z),re);Mr(Q,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,I!==null&&I.tag===6?(a(Q,I.sibling),re=f(I,Z),re.return=Q,Q=re):(a(Q,I),re=lf(Z,Q.mode,re),re.return=Q,Q=re),b(Q)):a(Q,I)}return function(Q,I,Z,re){try{ql=0;var be=Qe(Q,I,Z,re);return pa=null,be}catch(ye){if(ye===ga||ye===Ar)throw ye;var Le=en(29,ye,null,Q.mode);return Le.lanes=re,Le.return=Q,Le}}}var Ts=xg(!0),Eg=xg(!1),Bi=!1;function bf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Sf(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Li(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Hi(t,i,a){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,($e&2)!==0){var f=r.pending;return f===null?i.next=i:(i.next=f.next,f.next=i),r.pending=i,i=Sr(t),lg(t,null,a),i}return br(t,r,i,a),Sr(t)}function Vl(t,i,a){if(i=i.updateQueue,i!==null&&(i=i.shared,(a&4194048)!==0)){var r=i.lanes;r&=t.pendingLanes,a|=r,i.lanes=a,qt(t,a)}}function wf(t,i){var a=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var f=null,m=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};m===null?f=m=b:m=m.next=b,a=a.next}while(a!==null);m===null?f=m=i:m=m.next=i}else f=m=i;a={baseState:r.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:r.shared,callbacks:r.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=i:t.next=i,a.lastBaseUpdate=i}var xf=!1;function Yl(){if(xf){var t=ma;if(t!==null)throw t}}function Gl(t,i,a,r){xf=!1;var f=t.updateQueue;Bi=!1;var m=f.firstBaseUpdate,b=f.lastBaseUpdate,M=f.shared.pending;if(M!==null){f.shared.pending=null;var U=M,F=U.next;U.next=null,b===null?m=F:b.next=F,b=U;var oe=t.alternate;oe!==null&&(oe=oe.updateQueue,M=oe.lastBaseUpdate,M!==b&&(M===null?oe.firstBaseUpdate=F:M.next=F,oe.lastBaseUpdate=U))}if(m!==null){var ce=f.baseState;b=0,oe=F=U=null,M=m;do{var J=M.lane&-536870913,ie=J!==M.lane;if(ie?(ke&J)===J:(r&J)===J){J!==0&&J===ha&&(xf=!0),oe!==null&&(oe=oe.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var pe=t,we=M;J=i;var Qe=a;switch(we.tag){case 1:if(pe=we.payload,typeof pe=="function"){ce=pe.call(Qe,ce,J);break e}ce=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=we.payload,J=typeof pe=="function"?pe.call(Qe,ce,J):pe,J==null)break e;ce=p({},ce,J);break e;case 2:Bi=!0}}J=M.callback,J!==null&&(t.flags|=64,ie&&(t.flags|=8192),ie=f.callbacks,ie===null?f.callbacks=[J]:ie.push(J))}else ie={lane:J,tag:M.tag,payload:M.payload,callback:M.callback,next:null},oe===null?(F=oe=ie,U=ce):oe=oe.next=ie,b|=J;if(M=M.next,M===null){if(M=f.shared.pending,M===null)break;ie=M,M=ie.next,ie.next=null,f.lastBaseUpdate=ie,f.shared.pending=null}}while(!0);oe===null&&(U=ce),f.baseState=U,f.firstBaseUpdate=F,f.lastBaseUpdate=oe,m===null&&(f.shared.lanes=0),Vi|=b,t.lanes=b,t.memoizedState=ce}}function Ng(t,i){if(typeof t!="function")throw Error(l(191,t));t.call(i)}function _g(t,i){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)Ng(a[t],i)}var ya=k(null),Or=k(0);function Ag(t,i){t=fi,ne(Or,t),ne(ya,i),fi=t|i.baseLanes}function Ef(){ne(Or,fi),ne(ya,ya.current)}function Nf(){fi=Or.current,H(ya),H(Or)}var tn=k(null),gn=null;function $i(t){var i=t.alternate;ne(ft,ft.current&1),ne(tn,t),gn===null&&(i===null||ya.current!==null||i.memoizedState!==null)&&(gn=t)}function _f(t){ne(ft,ft.current),ne(tn,t),gn===null&&(gn=t)}function Tg(t){t.tag===22?(ne(ft,ft.current),ne(tn,t),gn===null&&(gn=t)):Ui()}function Ui(){ne(ft,ft.current),ne(tn,tn.current)}function nn(t){H(tn),gn===t&&(gn=null),H(ft)}var ft=k(0);function kr(t){for(var i=t;i!==null;){if(i.tag===13){var a=i.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||kd(a)||jd(a)))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===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var ii=0,Ae=null,Xe=null,pt=null,jr=!1,va=!1,Cs=!1,zr=0,Xl=0,ba=null,Zw=0;function ct(){throw Error(l(321))}function Af(t,i){if(i===null)return!1;for(var a=0;a<i.length&&a<t.length;a++)if(!Pt(t[a],i[a]))return!1;return!0}function Tf(t,i,a,r,f,m){return ii=m,Ae=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,j.H=t===null||t.memoizedState===null?up:If,Cs=!1,m=a(r,f),Cs=!1,va&&(m=Mg(i,a,r,f)),Cg(t),m}function Cg(t){j.H=Zl;var i=Xe!==null&&Xe.next!==null;if(ii=0,pt=Xe=Ae=null,jr=!1,Xl=0,ba=null,i)throw Error(l(300));t===null||yt||(t=t.dependencies,t!==null&&Er(t)&&(yt=!0))}function Mg(t,i,a,r){Ae=t;var f=0;do{if(va&&(ba=null),Xl=0,va=!1,25<=f)throw Error(l(301));if(f+=1,pt=Xe=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}j.H=fp,m=i(a,r)}while(va);return m}function Fw(){var t=j.H,i=t.useState()[0];return i=typeof i.then=="function"?Kl(i):i,t=t.useState()[0],(Xe!==null?Xe.memoizedState:null)!==t&&(Ae.flags|=1024),i}function Cf(){var t=zr!==0;return zr=0,t}function Mf(t,i,a){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~a}function Of(t){if(jr){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}jr=!1}ii=0,pt=Xe=Ae=null,va=!1,Xl=zr=0,ba=null}function Rt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pt===null?Ae.memoizedState=pt=t:pt=pt.next=t,pt}function dt(){if(Xe===null){var t=Ae.alternate;t=t!==null?t.memoizedState:null}else t=Xe.next;var i=pt===null?Ae.memoizedState:pt.next;if(i!==null)pt=i,Xe=t;else{if(t===null)throw Ae.alternate===null?Error(l(467)):Error(l(310));Xe=t,t={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},pt===null?Ae.memoizedState=pt=t:pt=pt.next=t}return pt}function Dr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Kl(t){var i=Xl;return Xl+=1,ba===null&&(ba=[]),t=bg(ba,t,i),i=Ae,(pt===null?i.memoizedState:pt.next)===null&&(i=i.alternate,j.H=i===null||i.memoizedState===null?up:If),t}function Rr(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Kl(t);if(t.$$typeof===_)return At(t)}throw Error(l(438,String(t)))}function kf(t){var i=null,a=Ae.updateQueue;if(a!==null&&(i=a.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}),a===null&&(a=Dr(),Ae.updateQueue=a),a.memoCache=i,a=i.data[i.index],a===void 0)for(a=i.data[i.index]=Array(t),r=0;r<t;r++)a[r]=P;return i.index++,a}function si(t,i){return typeof i=="function"?i(t):i}function Br(t){var i=dt();return jf(i,Xe,t)}function jf(t,i,a){var r=t.queue;if(r===null)throw Error(l(311));r.lastRenderedReducer=a;var f=t.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=t.baseState,f===null)t.memoizedState=m;else{i=f.next;var M=b=null,U=null,F=i,oe=!1;do{var ce=F.lane&-536870913;if(ce!==F.lane?(ke&ce)===ce:(ii&ce)===ce){var J=F.revertLane;if(J===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),ce===ha&&(oe=!0);else if((ii&J)===J){F=F.next,J===ha&&(oe=!0);continue}else ce={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},U===null?(M=U=ce,b=m):U=U.next=ce,Ae.lanes|=J,Vi|=J;ce=F.action,Cs&&a(m,ce),m=F.hasEagerState?F.eagerState:a(m,ce)}else J={lane:ce,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},U===null?(M=U=J,b=m):U=U.next=J,Ae.lanes|=ce,Vi|=ce;F=F.next}while(F!==null&&F!==i);if(U===null?b=m:U.next=M,!Pt(m,t.memoizedState)&&(yt=!0,oe&&(a=ma,a!==null)))throw a;t.memoizedState=m,t.baseState=b,t.baseQueue=U,r.lastRenderedState=m}return f===null&&(r.lanes=0),[t.memoizedState,r.dispatch]}function zf(t){var i=dt(),a=i.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=t;var r=a.dispatch,f=a.pending,m=i.memoizedState;if(f!==null){a.pending=null;var b=f=f.next;do m=t(m,b.action),b=b.next;while(b!==f);Pt(m,i.memoizedState)||(yt=!0),i.memoizedState=m,i.baseQueue===null&&(i.baseState=m),a.lastRenderedState=m}return[m,r]}function Og(t,i,a){var r=Ae,f=dt(),m=Re;if(m){if(a===void 0)throw Error(l(407));a=a()}else a=i();var b=!Pt((Xe||f).memoizedState,a);if(b&&(f.memoizedState=a,yt=!0),f=f.queue,Bf(zg.bind(null,r,f,t),[t]),f.getSnapshot!==i||b||pt!==null&&pt.memoizedState.tag&1){if(r.flags|=2048,Sa(9,{destroy:void 0},jg.bind(null,r,f,a,i),null),Ze===null)throw Error(l(349));m||(ii&127)!==0||kg(r,i,a)}return a}function kg(t,i,a){t.flags|=16384,t={getSnapshot:i,value:a},i=Ae.updateQueue,i===null?(i=Dr(),Ae.updateQueue=i,i.stores=[t]):(a=i.stores,a===null?i.stores=[t]:a.push(t))}function jg(t,i,a,r){i.value=a,i.getSnapshot=r,Dg(i)&&Rg(t)}function zg(t,i,a){return a(function(){Dg(i)&&Rg(t)})}function Dg(t){var i=t.getSnapshot;t=t.value;try{var a=i();return!Pt(t,a)}catch{return!0}}function Rg(t){var i=bs(t,2);i!==null&&Zt(i,t,2)}function Df(t){var i=Rt();if(typeof t=="function"){var a=t;if(t=a(),Cs){Wt(!0);try{a()}finally{Wt(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:si,lastRenderedState:t},i}function Bg(t,i,a,r){return t.baseState=a,jf(t,Xe,typeof r=="function"?r:si)}function Jw(t,i,a,r,f){if($r(t))throw Error(l(485));if(t=i.action,t!==null){var m={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){m.listeners.push(b)}};j.T!==null?a(!0):m.isTransition=!1,r(m),a=i.pending,a===null?(m.next=i.pending=m,Lg(i,m)):(m.next=a.next,i.pending=a.next=m)}}function Lg(t,i){var a=i.action,r=i.payload,f=t.state;if(i.isTransition){var m=j.T,b={};j.T=b;try{var M=a(f,r),U=j.S;U!==null&&U(b,M),Hg(t,i,M)}catch(F){Rf(t,i,F)}finally{m!==null&&b.types!==null&&(m.types=b.types),j.T=m}}else try{m=a(f,r),Hg(t,i,m)}catch(F){Rf(t,i,F)}}function Hg(t,i,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){$g(t,i,r)},function(r){return Rf(t,i,r)}):$g(t,i,a)}function $g(t,i,a){i.status="fulfilled",i.value=a,Ug(i),t.state=a,i=t.pending,i!==null&&(a=i.next,a===i?t.pending=null:(a=a.next,i.next=a,Lg(t,a)))}function Rf(t,i,a){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do i.status="rejected",i.reason=a,Ug(i),i=i.next;while(i!==r)}t.action=null}function Ug(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function qg(t,i){return i}function Ig(t,i){if(Re){var a=Ze.formState;if(a!==null){e:{var r=Ae;if(Re){if(Je){t:{for(var f=Je,m=mn;f.nodeType!==8;){if(!m){f=null;break t}if(f=pn(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){Je=pn(f.nextSibling),r=f.data==="F!";break e}}Di(r)}r=!1}r&&(i=a[0])}}return a=Rt(),a.memoizedState=a.baseState=i,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qg,lastRenderedState:i},a.queue=r,a=op.bind(null,Ae,r),r.dispatch=a,r=Df(!1),m=qf.bind(null,Ae,!1,r.queue),r=Rt(),f={state:i,dispatch:null,action:t,pending:null},r.queue=f,a=Jw.bind(null,Ae,f,m,a),f.dispatch=a,r.memoizedState=t,[i,a,!1]}function Vg(t){var i=dt();return Yg(i,Xe,t)}function Yg(t,i,a){if(i=jf(t,i,qg)[0],t=Br(si)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var r=Kl(i)}catch(b){throw b===ga?Ar:b}else r=i;i=dt();var f=i.queue,m=f.dispatch;return a!==i.memoizedState&&(Ae.flags|=2048,Sa(9,{destroy:void 0},Ww.bind(null,f,a),null)),[r,m,t]}function Ww(t,i){t.action=i}function Gg(t){var i=dt(),a=Xe;if(a!==null)return Yg(i,a,t);dt(),i=i.memoizedState,a=dt();var r=a.queue.dispatch;return a.memoizedState=t,[i,r,!1]}function Sa(t,i,a,r){return t={tag:t,create:a,deps:r,inst:i,next:null},i=Ae.updateQueue,i===null&&(i=Dr(),Ae.updateQueue=i),a=i.lastEffect,a===null?i.lastEffect=t.next=t:(r=a.next,a.next=t,t.next=r,i.lastEffect=t),t}function Xg(){return dt().memoizedState}function Lr(t,i,a,r){var f=Rt();Ae.flags|=t,f.memoizedState=Sa(1|i,{destroy:void 0},a,r===void 0?null:r)}function Hr(t,i,a,r){var f=dt();r=r===void 0?null:r;var m=f.memoizedState.inst;Xe!==null&&r!==null&&Af(r,Xe.memoizedState.deps)?f.memoizedState=Sa(i,m,a,r):(Ae.flags|=t,f.memoizedState=Sa(1|i,m,a,r))}function Kg(t,i){Lr(8390656,8,t,i)}function Bf(t,i){Hr(2048,8,t,i)}function Pw(t){Ae.flags|=4;var i=Ae.updateQueue;if(i===null)i=Dr(),Ae.updateQueue=i,i.events=[t];else{var a=i.events;a===null?i.events=[t]:a.push(t)}}function Qg(t){var i=dt().memoizedState;return Pw({ref:i,nextImpl:t}),function(){if(($e&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}function Zg(t,i){return Hr(4,2,t,i)}function Fg(t,i){return Hr(4,4,t,i)}function Jg(t,i){if(typeof i=="function"){t=t();var a=i(t);return function(){typeof a=="function"?a():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function Wg(t,i,a){a=a!=null?a.concat([t]):null,Hr(4,4,Jg.bind(null,i,t),a)}function Lf(){}function Pg(t,i){var a=dt();i=i===void 0?null:i;var r=a.memoizedState;return i!==null&&Af(i,r[1])?r[0]:(a.memoizedState=[t,i],t)}function ep(t,i){var a=dt();i=i===void 0?null:i;var r=a.memoizedState;if(i!==null&&Af(i,r[1]))return r[0];if(r=t(),Cs){Wt(!0);try{t()}finally{Wt(!1)}}return a.memoizedState=[r,i],r}function Hf(t,i,a){return a===void 0||(ii&1073741824)!==0&&(ke&261930)===0?t.memoizedState=i:(t.memoizedState=a,t=ty(),Ae.lanes|=t,Vi|=t,a)}function tp(t,i,a,r){return Pt(a,i)?a:ya.current!==null?(t=Hf(t,a,r),Pt(t,i)||(yt=!0),t):(ii&42)===0||(ii&1073741824)!==0&&(ke&261930)===0?(yt=!0,t.memoizedState=a):(t=ty(),Ae.lanes|=t,Vi|=t,i)}function np(t,i,a,r,f){var m=$.p;$.p=m!==0&&8>m?m:8;var b=j.T,M={};j.T=M,qf(t,!1,i,a);try{var U=f(),F=j.S;if(F!==null&&F(M,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var oe=Qw(U,r);Ql(t,i,oe,ln(t))}else Ql(t,i,r,ln(t))}catch(ce){Ql(t,i,{then:function(){},status:"rejected",reason:ce},ln())}finally{$.p=m,b!==null&&M.types!==null&&(b.types=M.types),j.T=b}}function ex(){}function $f(t,i,a,r){if(t.tag!==5)throw Error(l(476));var f=ip(t).queue;np(t,f,i,L,a===null?ex:function(){return sp(t),a(r)})}function ip(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:si,lastRenderedState:L},next:null};var a={};return i.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:si,lastRenderedState:a},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function sp(t){var i=ip(t);i.next===null&&(i=t.alternate.memoizedState),Ql(t,i.next.queue,{},ln())}function Uf(){return At(fo)}function ap(){return dt().memoizedState}function lp(){return dt().memoizedState}function tx(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var a=ln();t=Li(a);var r=Hi(i,t,a);r!==null&&(Zt(r,i,a),Vl(r,i,a)),i={cache:gf()},t.payload=i;return}i=i.return}}function nx(t,i,a){var r=ln();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},$r(t)?rp(i,a):(a=sf(t,i,a,r),a!==null&&(Zt(a,t,r),cp(a,i,r)))}function op(t,i,a){var r=ln();Ql(t,i,a,r)}function Ql(t,i,a,r){var f={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if($r(t))rp(i,f);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=i.lastRenderedReducer,m!==null))try{var b=i.lastRenderedState,M=m(b,a);if(f.hasEagerState=!0,f.eagerState=M,Pt(M,b))return br(t,i,f,0),Ze===null&&vr(),!1}catch{}if(a=sf(t,i,f,r),a!==null)return Zt(a,t,r),cp(a,i,r),!0}return!1}function qf(t,i,a,r){if(r={lane:2,revertLane:bd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},$r(t)){if(i)throw Error(l(479))}else i=sf(t,a,r,2),i!==null&&Zt(i,t,2)}function $r(t){var i=t.alternate;return t===Ae||i!==null&&i===Ae}function rp(t,i){va=jr=!0;var a=t.pending;a===null?i.next=i:(i.next=a.next,a.next=i),t.pending=i}function cp(t,i,a){if((a&4194048)!==0){var r=i.lanes;r&=t.pendingLanes,a|=r,i.lanes=a,qt(t,a)}}var Zl={readContext:At,use:Rr,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useLayoutEffect:ct,useInsertionEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useSyncExternalStore:ct,useId:ct,useHostTransitionStatus:ct,useFormState:ct,useActionState:ct,useOptimistic:ct,useMemoCache:ct,useCacheRefresh:ct};Zl.useEffectEvent=ct;var up={readContext:At,use:Rr,useCallback:function(t,i){return Rt().memoizedState=[t,i===void 0?null:i],t},useContext:At,useEffect:Kg,useImperativeHandle:function(t,i,a){a=a!=null?a.concat([t]):null,Lr(4194308,4,Jg.bind(null,i,t),a)},useLayoutEffect:function(t,i){return Lr(4194308,4,t,i)},useInsertionEffect:function(t,i){Lr(4,2,t,i)},useMemo:function(t,i){var a=Rt();i=i===void 0?null:i;var r=t();if(Cs){Wt(!0);try{t()}finally{Wt(!1)}}return a.memoizedState=[r,i],r},useReducer:function(t,i,a){var r=Rt();if(a!==void 0){var f=a(i);if(Cs){Wt(!0);try{a(i)}finally{Wt(!1)}}}else f=i;return r.memoizedState=r.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},r.queue=t,t=t.dispatch=nx.bind(null,Ae,t),[r.memoizedState,t]},useRef:function(t){var i=Rt();return t={current:t},i.memoizedState=t},useState:function(t){t=Df(t);var i=t.queue,a=op.bind(null,Ae,i);return i.dispatch=a,[t.memoizedState,a]},useDebugValue:Lf,useDeferredValue:function(t,i){var a=Rt();return Hf(a,t,i)},useTransition:function(){var t=Df(!1);return t=np.bind(null,Ae,t.queue,!0,!1),Rt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,a){var r=Ae,f=Rt();if(Re){if(a===void 0)throw Error(l(407));a=a()}else{if(a=i(),Ze===null)throw Error(l(349));(ke&127)!==0||kg(r,i,a)}f.memoizedState=a;var m={value:a,getSnapshot:i};return f.queue=m,Kg(zg.bind(null,r,m,t),[t]),r.flags|=2048,Sa(9,{destroy:void 0},jg.bind(null,r,m,a,i),null),a},useId:function(){var t=Rt(),i=Ze.identifierPrefix;if(Re){var a=$n,r=Hn;a=(r&~(1<<32-Ge(r)-1)).toString(32)+a,i="_"+i+"R_"+a,a=zr++,0<a&&(i+="H"+a.toString(32)),i+="_"}else a=Zw++,i="_"+i+"r_"+a.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:Uf,useFormState:Ig,useActionState:Ig,useOptimistic:function(t){var i=Rt();i.memoizedState=i.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=a,i=qf.bind(null,Ae,!0,a),a.dispatch=i,[t,i]},useMemoCache:kf,useCacheRefresh:function(){return Rt().memoizedState=tx.bind(null,Ae)},useEffectEvent:function(t){var i=Rt(),a={impl:t};return i.memoizedState=a,function(){if(($e&2)!==0)throw Error(l(440));return a.impl.apply(void 0,arguments)}}},If={readContext:At,use:Rr,useCallback:Pg,useContext:At,useEffect:Bf,useImperativeHandle:Wg,useInsertionEffect:Zg,useLayoutEffect:Fg,useMemo:ep,useReducer:Br,useRef:Xg,useState:function(){return Br(si)},useDebugValue:Lf,useDeferredValue:function(t,i){var a=dt();return tp(a,Xe.memoizedState,t,i)},useTransition:function(){var t=Br(si)[0],i=dt().memoizedState;return[typeof t=="boolean"?t:Kl(t),i]},useSyncExternalStore:Og,useId:ap,useHostTransitionStatus:Uf,useFormState:Vg,useActionState:Vg,useOptimistic:function(t,i){var a=dt();return Bg(a,Xe,t,i)},useMemoCache:kf,useCacheRefresh:lp};If.useEffectEvent=Qg;var fp={readContext:At,use:Rr,useCallback:Pg,useContext:At,useEffect:Bf,useImperativeHandle:Wg,useInsertionEffect:Zg,useLayoutEffect:Fg,useMemo:ep,useReducer:zf,useRef:Xg,useState:function(){return zf(si)},useDebugValue:Lf,useDeferredValue:function(t,i){var a=dt();return Xe===null?Hf(a,t,i):tp(a,Xe.memoizedState,t,i)},useTransition:function(){var t=zf(si)[0],i=dt().memoizedState;return[typeof t=="boolean"?t:Kl(t),i]},useSyncExternalStore:Og,useId:ap,useHostTransitionStatus:Uf,useFormState:Gg,useActionState:Gg,useOptimistic:function(t,i){var a=dt();return Xe!==null?Bg(a,Xe,t,i):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:kf,useCacheRefresh:lp};fp.useEffectEvent=Qg;function Vf(t,i,a,r){i=t.memoizedState,a=a(r,i),a=a==null?i:p({},i,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Yf={enqueueSetState:function(t,i,a){t=t._reactInternals;var r=ln(),f=Li(r);f.payload=i,a!=null&&(f.callback=a),i=Hi(t,f,r),i!==null&&(Zt(i,t,r),Vl(i,t,r))},enqueueReplaceState:function(t,i,a){t=t._reactInternals;var r=ln(),f=Li(r);f.tag=1,f.payload=i,a!=null&&(f.callback=a),i=Hi(t,f,r),i!==null&&(Zt(i,t,r),Vl(i,t,r))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var a=ln(),r=Li(a);r.tag=2,i!=null&&(r.callback=i),i=Hi(t,r,a),i!==null&&(Zt(i,t,a),Vl(i,t,a))}};function dp(t,i,a,r,f,m,b){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,m,b):i.prototype&&i.prototype.isPureReactComponent?!Rl(a,r)||!Rl(f,m):!0}function hp(t,i,a,r){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(a,r),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(a,r),i.state!==t&&Yf.enqueueReplaceState(i,i.state,null)}function Ms(t,i){var a=i;if("ref"in i){a={};for(var r in i)r!=="ref"&&(a[r]=i[r])}if(t=t.defaultProps){a===i&&(a=p({},a));for(var f in t)a[f]===void 0&&(a[f]=t[f])}return a}function mp(t){yr(t)}function gp(t){console.error(t)}function pp(t){yr(t)}function Ur(t,i){try{var a=t.onUncaughtError;a(i.value,{componentStack:i.stack})}catch(r){setTimeout(function(){throw r})}}function yp(t,i,a){try{var r=t.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Gf(t,i,a){return a=Li(a),a.tag=3,a.payload={element:null},a.callback=function(){Ur(t,i)},a}function vp(t){return t=Li(t),t.tag=3,t}function bp(t,i,a,r){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var m=r.value;t.payload=function(){return f(m)},t.callback=function(){yp(i,a,r)}}var b=a.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(t.callback=function(){yp(i,a,r),typeof f!="function"&&(Yi===null?Yi=new Set([this]):Yi.add(this));var M=r.stack;this.componentDidCatch(r.value,{componentStack:M!==null?M:""})})}function ix(t,i,a,r,f){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(i=a.alternate,i!==null&&da(i,a,f,!0),a=tn.current,a!==null){switch(a.tag){case 31:case 13:return gn===null?Wr():a.alternate===null&&ut===0&&(ut=3),a.flags&=-257,a.flags|=65536,a.lanes=f,r===Tr?a.flags|=16384:(i=a.updateQueue,i===null?a.updateQueue=new Set([r]):i.add(r),pd(t,r,f)),!1;case 22:return a.flags|=65536,r===Tr?a.flags|=16384:(i=a.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=i):(a=i.retryQueue,a===null?i.retryQueue=new Set([r]):a.add(r)),pd(t,r,f)),!1}throw Error(l(435,a.tag))}return pd(t,r,f),Wr(),!1}if(Re)return i=tn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=f,r!==uf&&(t=Error(l(422),{cause:r}),Hl(fn(t,a)))):(r!==uf&&(i=Error(l(423),{cause:r}),Hl(fn(i,a))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,r=fn(r,a),f=Gf(t.stateNode,r,f),wf(t,f),ut!==4&&(ut=2)),!1;var m=Error(l(520),{cause:r});if(m=fn(m,a),io===null?io=[m]:io.push(m),ut!==4&&(ut=2),i===null)return!0;r=fn(r,a),a=i;do{switch(a.tag){case 3:return a.flags|=65536,t=f&-f,a.lanes|=t,t=Gf(a.stateNode,r,t),wf(a,t),!1;case 1:if(i=a.type,m=a.stateNode,(a.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Yi===null||!Yi.has(m))))return a.flags|=65536,f&=-f,a.lanes|=f,f=vp(f),bp(f,t,a,r),wf(a,f),!1}a=a.return}while(a!==null);return!1}var Xf=Error(l(461)),yt=!1;function Tt(t,i,a,r){i.child=t===null?Eg(i,null,a,r):Ts(i,t.child,a,r)}function Sp(t,i,a,r,f){a=a.render;var m=i.ref;if("ref"in r){var b={};for(var M in r)M!=="ref"&&(b[M]=r[M])}else b=r;return Es(i),r=Tf(t,i,a,b,m,f),M=Cf(),t!==null&&!yt?(Mf(t,i,f),ai(t,i,f)):(Re&&M&&rf(i),i.flags|=1,Tt(t,i,r,f),i.child)}function wp(t,i,a,r,f){if(t===null){var m=a.type;return typeof m=="function"&&!af(m)&&m.defaultProps===void 0&&a.compare===null?(i.tag=15,i.type=m,xp(t,i,m,r,f)):(t=wr(a.type,null,r,i,i.mode,f),t.ref=i.ref,t.return=i,i.child=t)}if(m=t.child,!ed(t,f)){var b=m.memoizedProps;if(a=a.compare,a=a!==null?a:Rl,a(b,r)&&t.ref===i.ref)return ai(t,i,f)}return i.flags|=1,t=Pn(m,r),t.ref=i.ref,t.return=i,i.child=t}function xp(t,i,a,r,f){if(t!==null){var m=t.memoizedProps;if(Rl(m,r)&&t.ref===i.ref)if(yt=!1,i.pendingProps=r=m,ed(t,f))(t.flags&131072)!==0&&(yt=!0);else return i.lanes=t.lanes,ai(t,i,f)}return Kf(t,i,a,r,f)}function Ep(t,i,a,r){var f=r.children,m=t!==null?t.memoizedState:null;if(t===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|a:a,t!==null){for(r=i.child=t.child,f=0;r!==null;)f=f|r.lanes|r.childLanes,r=r.sibling;r=f&~m}else r=0,i.child=null;return Np(t,i,m,a,r)}if((a&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&_r(i,m!==null?m.cachePool:null),m!==null?Ag(i,m):Ef(),Tg(i);else return r=i.lanes=536870912,Np(t,i,m!==null?m.baseLanes|a:a,a,r)}else m!==null?(_r(i,m.cachePool),Ag(i,m),Ui(),i.memoizedState=null):(t!==null&&_r(i,null),Ef(),Ui());return Tt(t,i,f,a),i.child}function Fl(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Np(t,i,a,r,f){var m=yf();return m=m===null?null:{parent:gt._currentValue,pool:m},i.memoizedState={baseLanes:a,cachePool:m},t!==null&&_r(i,null),Ef(),Tg(i),t!==null&&da(t,i,r,!0),i.childLanes=f,null}function qr(t,i){return i=Vr({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function _p(t,i,a){return Ts(i,t.child,null,a),t=qr(i,i.pendingProps),t.flags|=2,nn(i),i.memoizedState=null,t}function sx(t,i,a){var r=i.pendingProps,f=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(Re){if(r.mode==="hidden")return t=qr(i,r),i.lanes=536870912,Fl(null,t);if(_f(i),(t=Je)?(t=Ly(t,mn),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:ji!==null?{id:Hn,overflow:$n}:null,retryLane:536870912,hydrationErrors:null},a=rg(t),a.return=i,i.child=a,_t=i,Je=null)):t=null,t===null)throw Di(i);return i.lanes=536870912,null}return qr(i,r)}var m=t.memoizedState;if(m!==null){var b=m.dehydrated;if(_f(i),f)if(i.flags&256)i.flags&=-257,i=_p(t,i,a);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(l(558));else if(yt||da(t,i,a,!1),f=(a&t.childLanes)!==0,yt||f){if(r=Ze,r!==null&&(b=Dt(r,a),b!==0&&b!==m.retryLane))throw m.retryLane=b,bs(t,b),Zt(r,t,b),Xf;Wr(),i=_p(t,i,a)}else t=m.treeContext,Je=pn(b.nextSibling),_t=i,Re=!0,zi=null,mn=!1,t!==null&&fg(i,t),i=qr(i,r),i.flags|=4096;return i}return t=Pn(t.child,{mode:r.mode,children:r.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Ir(t,i){var a=i.ref;if(a===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(l(284));(t===null||t.ref!==a)&&(i.flags|=4194816)}}function Kf(t,i,a,r,f){return Es(i),a=Tf(t,i,a,r,void 0,f),r=Cf(),t!==null&&!yt?(Mf(t,i,f),ai(t,i,f)):(Re&&r&&rf(i),i.flags|=1,Tt(t,i,a,f),i.child)}function Ap(t,i,a,r,f,m){return Es(i),i.updateQueue=null,a=Mg(i,r,a,f),Cg(t),r=Cf(),t!==null&&!yt?(Mf(t,i,m),ai(t,i,m)):(Re&&r&&rf(i),i.flags|=1,Tt(t,i,a,m),i.child)}function Tp(t,i,a,r,f){if(Es(i),i.stateNode===null){var m=ra,b=a.contextType;typeof b=="object"&&b!==null&&(m=At(b)),m=new a(r,m),i.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Yf,i.stateNode=m,m._reactInternals=i,m=i.stateNode,m.props=r,m.state=i.memoizedState,m.refs={},bf(i),b=a.contextType,m.context=typeof b=="object"&&b!==null?At(b):ra,m.state=i.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(Vf(i,a,b,r),m.state=i.memoizedState),typeof a.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&&Yf.enqueueReplaceState(m,m.state,null),Gl(i,r,m,f),Yl(),m.state=i.memoizedState),typeof m.componentDidMount=="function"&&(i.flags|=4194308),r=!0}else if(t===null){m=i.stateNode;var M=i.memoizedProps,U=Ms(a,M);m.props=U;var F=m.context,oe=a.contextType;b=ra,typeof oe=="object"&&oe!==null&&(b=At(oe));var ce=a.getDerivedStateFromProps;oe=typeof ce=="function"||typeof m.getSnapshotBeforeUpdate=="function",M=i.pendingProps!==M,oe||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(M||F!==b)&&hp(i,m,r,b),Bi=!1;var J=i.memoizedState;m.state=J,Gl(i,r,m,f),Yl(),F=i.memoizedState,M||J!==F||Bi?(typeof ce=="function"&&(Vf(i,a,ce,r),F=i.memoizedState),(U=Bi||dp(i,a,U,r,J,F,b))?(oe||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=F),m.props=r,m.state=F,m.context=b,r=U):(typeof m.componentDidMount=="function"&&(i.flags|=4194308),r=!1)}else{m=i.stateNode,Sf(t,i),b=i.memoizedProps,oe=Ms(a,b),m.props=oe,ce=i.pendingProps,J=m.context,F=a.contextType,U=ra,typeof F=="object"&&F!==null&&(U=At(F)),M=a.getDerivedStateFromProps,(F=typeof M=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==ce||J!==U)&&hp(i,m,r,U),Bi=!1,J=i.memoizedState,m.state=J,Gl(i,r,m,f),Yl();var ie=i.memoizedState;b!==ce||J!==ie||Bi||t!==null&&t.dependencies!==null&&Er(t.dependencies)?(typeof M=="function"&&(Vf(i,a,M,r),ie=i.memoizedState),(oe=Bi||dp(i,a,oe,r,J,ie,U)||t!==null&&t.dependencies!==null&&Er(t.dependencies))?(F||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(r,ie,U),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(r,ie,U)),typeof m.componentDidUpdate=="function"&&(i.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===t.memoizedProps&&J===t.memoizedState||(i.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&J===t.memoizedState||(i.flags|=1024),i.memoizedProps=r,i.memoizedState=ie),m.props=r,m.state=ie,m.context=U,r=oe):(typeof m.componentDidUpdate!="function"||b===t.memoizedProps&&J===t.memoizedState||(i.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&J===t.memoizedState||(i.flags|=1024),r=!1)}return m=r,Ir(t,i),r=(i.flags&128)!==0,m||r?(m=i.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:m.render(),i.flags|=1,t!==null&&r?(i.child=Ts(i,t.child,null,f),i.child=Ts(i,null,a,f)):Tt(t,i,a,f),i.memoizedState=m.state,t=i.child):t=ai(t,i,f),t}function Cp(t,i,a,r){return ws(),i.flags|=256,Tt(t,i,a,r),i.child}var Qf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zf(t){return{baseLanes:t,cachePool:yg()}}function Ff(t,i,a){return t=t!==null?t.childLanes&~a:0,i&&(t|=an),t}function Mp(t,i,a){var r=i.pendingProps,f=!1,m=(i.flags&128)!==0,b;if((b=m)||(b=t!==null&&t.memoizedState===null?!1:(ft.current&2)!==0),b&&(f=!0,i.flags&=-129),b=(i.flags&32)!==0,i.flags&=-33,t===null){if(Re){if(f?$i(i):Ui(),(t=Je)?(t=Ly(t,mn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:ji!==null?{id:Hn,overflow:$n}:null,retryLane:536870912,hydrationErrors:null},a=rg(t),a.return=i,i.child=a,_t=i,Je=null)):t=null,t===null)throw Di(i);return jd(t)?i.lanes=32:i.lanes=536870912,null}var M=r.children;return r=r.fallback,f?(Ui(),f=i.mode,M=Vr({mode:"hidden",children:M},f),r=Ss(r,f,a,null),M.return=i,r.return=i,M.sibling=r,i.child=M,r=i.child,r.memoizedState=Zf(a),r.childLanes=Ff(t,b,a),i.memoizedState=Qf,Fl(null,r)):($i(i),Jf(i,M))}var U=t.memoizedState;if(U!==null&&(M=U.dehydrated,M!==null)){if(m)i.flags&256?($i(i),i.flags&=-257,i=Wf(t,i,a)):i.memoizedState!==null?(Ui(),i.child=t.child,i.flags|=128,i=null):(Ui(),M=r.fallback,f=i.mode,r=Vr({mode:"visible",children:r.children},f),M=Ss(M,f,a,null),M.flags|=2,r.return=i,M.return=i,r.sibling=M,i.child=r,Ts(i,t.child,null,a),r=i.child,r.memoizedState=Zf(a),r.childLanes=Ff(t,b,a),i.memoizedState=Qf,i=Fl(null,r));else if($i(i),jd(M)){if(b=M.nextSibling&&M.nextSibling.dataset,b)var F=b.dgst;b=F,r=Error(l(419)),r.stack="",r.digest=b,Hl({value:r,source:null,stack:null}),i=Wf(t,i,a)}else if(yt||da(t,i,a,!1),b=(a&t.childLanes)!==0,yt||b){if(b=Ze,b!==null&&(r=Dt(b,a),r!==0&&r!==U.retryLane))throw U.retryLane=r,bs(t,r),Zt(b,t,r),Xf;kd(M)||Wr(),i=Wf(t,i,a)}else kd(M)?(i.flags|=192,i.child=t.child,i=null):(t=U.treeContext,Je=pn(M.nextSibling),_t=i,Re=!0,zi=null,mn=!1,t!==null&&fg(i,t),i=Jf(i,r.children),i.flags|=4096);return i}return f?(Ui(),M=r.fallback,f=i.mode,U=t.child,F=U.sibling,r=Pn(U,{mode:"hidden",children:r.children}),r.subtreeFlags=U.subtreeFlags&65011712,F!==null?M=Pn(F,M):(M=Ss(M,f,a,null),M.flags|=2),M.return=i,r.return=i,r.sibling=M,i.child=r,Fl(null,r),r=i.child,M=t.child.memoizedState,M===null?M=Zf(a):(f=M.cachePool,f!==null?(U=gt._currentValue,f=f.parent!==U?{parent:U,pool:U}:f):f=yg(),M={baseLanes:M.baseLanes|a,cachePool:f}),r.memoizedState=M,r.childLanes=Ff(t,b,a),i.memoizedState=Qf,Fl(t.child,r)):($i(i),a=t.child,t=a.sibling,a=Pn(a,{mode:"visible",children:r.children}),a.return=i,a.sibling=null,t!==null&&(b=i.deletions,b===null?(i.deletions=[t],i.flags|=16):b.push(t)),i.child=a,i.memoizedState=null,a)}function Jf(t,i){return i=Vr({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function Vr(t,i){return t=en(22,t,null,i),t.lanes=0,t}function Wf(t,i,a){return Ts(i,t.child,null,a),t=Jf(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function Op(t,i,a){t.lanes|=i;var r=t.alternate;r!==null&&(r.lanes|=i),hf(t.return,i,a)}function Pf(t,i,a,r,f,m){var b=t.memoizedState;b===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:f,treeForkCount:m}:(b.isBackwards=i,b.rendering=null,b.renderingStartTime=0,b.last=r,b.tail=a,b.tailMode=f,b.treeForkCount=m)}function kp(t,i,a){var r=i.pendingProps,f=r.revealOrder,m=r.tail;r=r.children;var b=ft.current,M=(b&2)!==0;if(M?(b=b&1|2,i.flags|=128):b&=1,ne(ft,b),Tt(t,i,r,a),r=Re?Ll:0,!M&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Op(t,a,i);else if(t.tag===19)Op(t,a,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(f){case"forwards":for(a=i.child,f=null;a!==null;)t=a.alternate,t!==null&&kr(t)===null&&(f=a),a=a.sibling;a=f,a===null?(f=i.child,i.child=null):(f=a.sibling,a.sibling=null),Pf(i,!1,f,a,m,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,f=i.child,i.child=null;f!==null;){if(t=f.alternate,t!==null&&kr(t)===null){i.child=f;break}t=f.sibling,f.sibling=a,a=f,f=t}Pf(i,!0,a,null,m,r);break;case"together":Pf(i,!1,null,null,void 0,r);break;default:i.memoizedState=null}return i.child}function ai(t,i,a){if(t!==null&&(i.dependencies=t.dependencies),Vi|=i.lanes,(a&i.childLanes)===0)if(t!==null){if(da(t,i,a,!1),(a&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(l(153));if(i.child!==null){for(t=i.child,a=Pn(t,t.pendingProps),i.child=a,a.return=i;t.sibling!==null;)t=t.sibling,a=a.sibling=Pn(t,t.pendingProps),a.return=i;a.sibling=null}return i.child}function ed(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&Er(t)))}function ax(t,i,a){switch(i.tag){case 3:te(i,i.stateNode.containerInfo),Ri(i,gt,t.memoizedState.cache),ws();break;case 27:case 5:Ee(i);break;case 4:te(i,i.stateNode.containerInfo);break;case 10:Ri(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,_f(i),null;break;case 13:var r=i.memoizedState;if(r!==null)return r.dehydrated!==null?($i(i),i.flags|=128,null):(a&i.child.childLanes)!==0?Mp(t,i,a):($i(i),t=ai(t,i,a),t!==null?t.sibling:null);$i(i);break;case 19:var f=(t.flags&128)!==0;if(r=(a&i.childLanes)!==0,r||(da(t,i,a,!1),r=(a&i.childLanes)!==0),f){if(r)return kp(t,i,a);i.flags|=128}if(f=i.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),ne(ft,ft.current),r)break;return null;case 22:return i.lanes=0,Ep(t,i,a,i.pendingProps);case 24:Ri(i,gt,t.memoizedState.cache)}return ai(t,i,a)}function jp(t,i,a){if(t!==null)if(t.memoizedProps!==i.pendingProps)yt=!0;else{if(!ed(t,a)&&(i.flags&128)===0)return yt=!1,ax(t,i,a);yt=(t.flags&131072)!==0}else yt=!1,Re&&(i.flags&1048576)!==0&&ug(i,Ll,i.index);switch(i.lanes=0,i.tag){case 16:e:{var r=i.pendingProps;if(t=_s(i.elementType),i.type=t,typeof t=="function")af(t)?(r=Ms(t,r),i.tag=1,i=Tp(null,i,t,r,a)):(i.tag=0,i=Kf(null,i,t,r,a));else{if(t!=null){var f=t.$$typeof;if(f===x){i.tag=11,i=Sp(null,i,t,r,a);break e}else if(f===D){i.tag=14,i=wp(null,i,t,r,a);break e}}throw i=B(t)||t,Error(l(306,i,""))}}return i;case 0:return Kf(t,i,i.type,i.pendingProps,a);case 1:return r=i.type,f=Ms(r,i.pendingProps),Tp(t,i,r,f,a);case 3:e:{if(te(i,i.stateNode.containerInfo),t===null)throw Error(l(387));r=i.pendingProps;var m=i.memoizedState;f=m.element,Sf(t,i),Gl(i,r,null,a);var b=i.memoizedState;if(r=b.cache,Ri(i,gt,r),r!==m.cache&&mf(i,[gt],a,!0),Yl(),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=Cp(t,i,r,a);break e}else if(r!==f){f=fn(Error(l(424)),i),Hl(f),i=Cp(t,i,r,a);break e}else for(t=i.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Je=pn(t.firstChild),_t=i,Re=!0,zi=null,mn=!0,a=Eg(i,null,r,a),i.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ws(),r===f){i=ai(t,i,a);break e}Tt(t,i,r,a)}i=i.child}return i;case 26:return Ir(t,i),t===null?(a=Vy(i.type,null,i.pendingProps,null))?i.memoizedState=a:Re||(a=i.type,t=i.pendingProps,r=ac(de.current).createElement(a),r[wt]=i,r[Ot]=t,Ct(r,a,t),mt(r),i.stateNode=r):i.memoizedState=Vy(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return Ee(i),t===null&&Re&&(r=i.stateNode=Uy(i.type,i.pendingProps,de.current),_t=i,mn=!0,f=Je,Qi(i.type)?(zd=f,Je=pn(r.firstChild)):Je=f),Tt(t,i,i.pendingProps.children,a),Ir(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&Re&&((f=r=Je)&&(r=Rx(r,i.type,i.pendingProps,mn),r!==null?(i.stateNode=r,_t=i,Je=pn(r.firstChild),mn=!1,f=!0):f=!1),f||Di(i)),Ee(i),f=i.type,m=i.pendingProps,b=t!==null?t.memoizedProps:null,r=m.children,Cd(f,m)?r=null:b!==null&&Cd(f,b)&&(i.flags|=32),i.memoizedState!==null&&(f=Tf(t,i,Fw,null,null,a),fo._currentValue=f),Ir(t,i),Tt(t,i,r,a),i.child;case 6:return t===null&&Re&&((t=a=Je)&&(a=Bx(a,i.pendingProps,mn),a!==null?(i.stateNode=a,_t=i,Je=null,t=!0):t=!1),t||Di(i)),null;case 13:return Mp(t,i,a);case 4:return te(i,i.stateNode.containerInfo),r=i.pendingProps,t===null?i.child=Ts(i,null,r,a):Tt(t,i,r,a),i.child;case 11:return Sp(t,i,i.type,i.pendingProps,a);case 7:return Tt(t,i,i.pendingProps,a),i.child;case 8:return Tt(t,i,i.pendingProps.children,a),i.child;case 12:return Tt(t,i,i.pendingProps.children,a),i.child;case 10:return r=i.pendingProps,Ri(i,i.type,r.value),Tt(t,i,r.children,a),i.child;case 9:return f=i.type._context,r=i.pendingProps.children,Es(i),f=At(f),r=r(f),i.flags|=1,Tt(t,i,r,a),i.child;case 14:return wp(t,i,i.type,i.pendingProps,a);case 15:return xp(t,i,i.type,i.pendingProps,a);case 19:return kp(t,i,a);case 31:return sx(t,i,a);case 22:return Ep(t,i,a,i.pendingProps);case 24:return Es(i),r=At(gt),t===null?(f=yf(),f===null&&(f=Ze,m=gf(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=a),f=m),i.memoizedState={parent:r,cache:f},bf(i),Ri(i,gt,f)):((t.lanes&a)!==0&&(Sf(t,i),Gl(i,null,null,a),Yl()),f=t.memoizedState,m=i.memoizedState,f.parent!==r?(f={parent:r,cache:r},i.memoizedState=f,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=f),Ri(i,gt,r)):(r=m.cache,Ri(i,gt,r),r!==f.cache&&mf(i,[gt],a,!0))),Tt(t,i,i.pendingProps.children,a),i.child;case 29:throw i.pendingProps}throw Error(l(156,i.tag))}function li(t){t.flags|=4}function td(t,i,a,r,f){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(ay())t.flags|=8192;else throw As=Tr,vf}else t.flags&=-16777217}function zp(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Qy(i))if(ay())t.flags|=8192;else throw As=Tr,vf}function Yr(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Zs():536870912,t.lanes|=i,Na|=i)}function Jl(t,i){if(!Re)switch(t.tailMode){case"hidden":i=t.tail;for(var a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function We(t){var i=t.alternate!==null&&t.alternate.child===t.child,a=0,r=0;if(i)for(var f=t.child;f!==null;)a|=f.lanes|f.childLanes,r|=f.subtreeFlags&65011712,r|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)a|=f.lanes|f.childLanes,r|=f.subtreeFlags,r|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=r,t.childLanes=a,i}function lx(t,i,a){var r=i.pendingProps;switch(cf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(i),null;case 1:return We(i),null;case 3:return a=i.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),i.memoizedState.cache!==r&&(i.flags|=2048),ni(gt),ue(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(fa(i)?li(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,ff())),We(i),null;case 26:var f=i.type,m=i.memoizedState;return t===null?(li(i),m!==null?(We(i),zp(i,m)):(We(i),td(i,f,null,r,a))):m?m!==t.memoizedState?(li(i),We(i),zp(i,m)):(We(i),i.flags&=-16777217):(t=t.memoizedProps,t!==r&&li(i),We(i),td(i,f,t,r,a)),null;case 27:if(Se(i),a=de.current,f=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==r&&li(i);else{if(!r){if(i.stateNode===null)throw Error(l(166));return We(i),null}t=ae.current,fa(i)?dg(i):(t=Uy(f,r,a),i.stateNode=t,li(i))}return We(i),null;case 5:if(Se(i),f=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==r&&li(i);else{if(!r){if(i.stateNode===null)throw Error(l(166));return We(i),null}if(m=ae.current,fa(i))dg(i);else{var b=ac(de.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[wt]=i,m[Ot]=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(Ct(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&&li(i)}}return We(i),td(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,a),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==r&&li(i);else{if(typeof r!="string"&&i.stateNode===null)throw Error(l(166));if(t=de.current,fa(i)){if(t=i.stateNode,a=i.memoizedProps,r=null,f=_t,f!==null)switch(f.tag){case 27:case 5:r=f.memoizedProps}t[wt]=i,t=!!(t.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||My(t.nodeValue,a)),t||Di(i,!0)}else t=ac(t).createTextNode(r),t[wt]=i,i.stateNode=t}return We(i),null;case 31:if(a=i.memoizedState,t===null||t.memoizedState!==null){if(r=fa(i),a!==null){if(t===null){if(!r)throw Error(l(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[wt]=i}else ws(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;We(i),t=!1}else a=ff(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return i.flags&256?(nn(i),i):(nn(i),null);if((i.flags&128)!==0)throw Error(l(558))}return We(i),null;case 13:if(r=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=fa(i),r!==null&&r.dehydrated!==null){if(t===null){if(!f)throw Error(l(318));if(f=i.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(l(317));f[wt]=i}else ws(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;We(i),f=!1}else f=ff(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return i.flags&256?(nn(i),i):(nn(i),null)}return nn(i),(i.flags&128)!==0?(i.lanes=a,i):(a=r!==null,t=t!==null&&t.memoizedState!==null,a&&(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)),a!==t&&a&&(i.child.flags|=8192),Yr(i,i.updateQueue),We(i),null);case 4:return ue(),t===null&&Ed(i.stateNode.containerInfo),We(i),null;case 10:return ni(i.type),We(i),null;case 19:if(H(ft),r=i.memoizedState,r===null)return We(i),null;if(f=(i.flags&128)!==0,m=r.rendering,m===null)if(f)Jl(r,!1);else{if(ut!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(m=kr(t),m!==null){for(i.flags|=128,Jl(r,!1),t=m.updateQueue,i.updateQueue=t,Yr(i,t),i.subtreeFlags=0,t=a,a=i.child;a!==null;)og(a,t),a=a.sibling;return ne(ft,ft.current&1|2),Re&&ei(i,r.treeForkCount),i.child}t=t.sibling}r.tail!==null&&st()>Zr&&(i.flags|=128,f=!0,Jl(r,!1),i.lanes=4194304)}else{if(!f)if(t=kr(m),t!==null){if(i.flags|=128,f=!0,t=t.updateQueue,i.updateQueue=t,Yr(i,t),Jl(r,!0),r.tail===null&&r.tailMode==="hidden"&&!m.alternate&&!Re)return We(i),null}else 2*st()-r.renderingStartTime>Zr&&a!==536870912&&(i.flags|=128,f=!0,Jl(r,!1),i.lanes=4194304);r.isBackwards?(m.sibling=i.child,i.child=m):(t=r.last,t!==null?t.sibling=m:i.child=m,r.last=m)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=st(),t.sibling=null,a=ft.current,ne(ft,f?a&1|2:a&1),Re&&ei(i,r.treeForkCount),t):(We(i),null);case 22:case 23:return nn(i),Nf(),r=i.memoizedState!==null,t!==null?t.memoizedState!==null!==r&&(i.flags|=8192):r&&(i.flags|=8192),r?(a&536870912)!==0&&(i.flags&128)===0&&(We(i),i.subtreeFlags&6&&(i.flags|=8192)):We(i),a=i.updateQueue,a!==null&&Yr(i,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==a&&(i.flags|=2048),t!==null&&H(Ns),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),i.memoizedState.cache!==a&&(i.flags|=2048),ni(gt),We(i),null;case 25:return null;case 30:return null}throw Error(l(156,i.tag))}function ox(t,i){switch(cf(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return ni(gt),ue(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return Se(i),null;case 31:if(i.memoizedState!==null){if(nn(i),i.alternate===null)throw Error(l(340));ws()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(nn(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(l(340));ws()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return H(ft),null;case 4:return ue(),null;case 10:return ni(i.type),null;case 22:case 23:return nn(i),Nf(),t!==null&&H(Ns),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return ni(gt),null;case 25:return null;default:return null}}function Dp(t,i){switch(cf(i),i.tag){case 3:ni(gt),ue();break;case 26:case 27:case 5:Se(i);break;case 4:ue();break;case 31:i.memoizedState!==null&&nn(i);break;case 13:nn(i);break;case 19:H(ft);break;case 10:ni(i.type);break;case 22:case 23:nn(i),Nf(),t!==null&&H(Ns);break;case 24:ni(gt)}}function Wl(t,i){try{var a=i.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var f=r.next;a=f;do{if((a.tag&t)===t){r=void 0;var m=a.create,b=a.inst;r=m(),b.destroy=r}a=a.next}while(a!==f)}}catch(M){Ve(i,i.return,M)}}function qi(t,i,a){try{var r=i.updateQueue,f=r!==null?r.lastEffect:null;if(f!==null){var m=f.next;r=m;do{if((r.tag&t)===t){var b=r.inst,M=b.destroy;if(M!==void 0){b.destroy=void 0,f=i;var U=a,F=M;try{F()}catch(oe){Ve(f,U,oe)}}}r=r.next}while(r!==m)}}catch(oe){Ve(i,i.return,oe)}}function Rp(t){var i=t.updateQueue;if(i!==null){var a=t.stateNode;try{_g(i,a)}catch(r){Ve(t,t.return,r)}}}function Bp(t,i,a){a.props=Ms(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(r){Ve(t,i,r)}}function Pl(t,i){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var r=t.stateNode;break;case 30:r=t.stateNode;break;default:r=t.stateNode}typeof a=="function"?t.refCleanup=a(r):a.current=r}}catch(f){Ve(t,i,f)}}function Un(t,i){var a=t.ref,r=t.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(f){Ve(t,i,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){Ve(t,i,f)}else a.current=null}function Lp(t){var i=t.type,a=t.memoizedProps,r=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(f){Ve(t,t.return,f)}}function nd(t,i,a){try{var r=t.stateNode;Mx(r,t.type,a,i),r[Ot]=i}catch(f){Ve(t,t.return,f)}}function Hp(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Qi(t.type)||t.tag===4}function id(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Hp(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Qi(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function sd(t,i,a){var r=t.tag;if(r===5||r===6)t=t.stateNode,i?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,i):(i=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,i.appendChild(t),a=a._reactRootContainer,a!=null||i.onclick!==null||(i.onclick=Jn));else if(r!==4&&(r===27&&Qi(t.type)&&(a=t.stateNode,i=null),t=t.child,t!==null))for(sd(t,i,a),t=t.sibling;t!==null;)sd(t,i,a),t=t.sibling}function Gr(t,i,a){var r=t.tag;if(r===5||r===6)t=t.stateNode,i?a.insertBefore(t,i):a.appendChild(t);else if(r!==4&&(r===27&&Qi(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Gr(t,i,a),t=t.sibling;t!==null;)Gr(t,i,a),t=t.sibling}function $p(t){var i=t.stateNode,a=t.memoizedProps;try{for(var r=t.type,f=i.attributes;f.length;)i.removeAttributeNode(f[0]);Ct(i,r,a),i[wt]=t,i[Ot]=a}catch(m){Ve(t,t.return,m)}}var oi=!1,vt=!1,ad=!1,Up=typeof WeakSet=="function"?WeakSet:Set,Et=null;function rx(t,i){if(t=t.containerInfo,Ad=dc,t=Wm(t),Ju(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var f=r.anchorOffset,m=r.focusNode;r=r.focusOffset;try{a.nodeType,m.nodeType}catch{a=null;break e}var b=0,M=-1,U=-1,F=0,oe=0,ce=t,J=null;t:for(;;){for(var ie;ce!==a||f!==0&&ce.nodeType!==3||(M=b+f),ce!==m||r!==0&&ce.nodeType!==3||(U=b+r),ce.nodeType===3&&(b+=ce.nodeValue.length),(ie=ce.firstChild)!==null;)J=ce,ce=ie;for(;;){if(ce===t)break t;if(J===a&&++F===f&&(M=b),J===m&&++oe===r&&(U=b),(ie=ce.nextSibling)!==null)break;ce=J,J=ce.parentNode}ce=ie}a=M===-1||U===-1?null:{start:M,end:U}}else a=null}a=a||{start:0,end:0}}else a=null;for(Td={focusedElem:t,selectionRange:a},dc=!1,Et=i;Et!==null;)if(i=Et,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,Et=t;else for(;Et!==null;){switch(i=Et,m=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)f=t[a],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&m!==null){t=void 0,a=i,f=m.memoizedProps,m=m.memoizedState,r=a.stateNode;try{var pe=Ms(a.type,f);t=r.getSnapshotBeforeUpdate(pe,m),r.__reactInternalSnapshotBeforeUpdate=t}catch(we){Ve(a,a.return,we)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,a=t.nodeType,a===9)Od(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Od(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(l(163))}if(t=i.sibling,t!==null){t.return=i.return,Et=t;break}Et=i.return}}function qp(t,i,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:ci(t,a),r&4&&Wl(5,a);break;case 1:if(ci(t,a),r&4)if(t=a.stateNode,i===null)try{t.componentDidMount()}catch(b){Ve(a,a.return,b)}else{var f=Ms(a.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(f,i,t.__reactInternalSnapshotBeforeUpdate)}catch(b){Ve(a,a.return,b)}}r&64&&Rp(a),r&512&&Pl(a,a.return);break;case 3:if(ci(t,a),r&64&&(t=a.updateQueue,t!==null)){if(i=null,a.child!==null)switch(a.child.tag){case 27:case 5:i=a.child.stateNode;break;case 1:i=a.child.stateNode}try{_g(t,i)}catch(b){Ve(a,a.return,b)}}break;case 27:i===null&&r&4&&$p(a);case 26:case 5:ci(t,a),i===null&&r&4&&Lp(a),r&512&&Pl(a,a.return);break;case 12:ci(t,a);break;case 31:ci(t,a),r&4&&Yp(t,a);break;case 13:ci(t,a),r&4&&Gp(t,a),r&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=yx.bind(null,a),Lx(t,a))));break;case 22:if(r=a.memoizedState!==null||oi,!r){i=i!==null&&i.memoizedState!==null||vt,f=oi;var m=vt;oi=r,(vt=i)&&!m?ui(t,a,(a.subtreeFlags&8772)!==0):ci(t,a),oi=f,vt=m}break;case 30:break;default:ci(t,a)}}function Ip(t){var i=t.alternate;i!==null&&(t.alternate=null,Ip(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&wl(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var et=null,Gt=!1;function ri(t,i,a){for(a=a.child;a!==null;)Vp(t,i,a),a=a.sibling}function Vp(t,i,a){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(Bn,a)}catch{}switch(a.tag){case 26:vt||Un(a,i),ri(t,i,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:vt||Un(a,i);var r=et,f=Gt;Qi(a.type)&&(et=a.stateNode,Gt=!1),ri(t,i,a),ro(a.stateNode),et=r,Gt=f;break;case 5:vt||Un(a,i);case 6:if(r=et,f=Gt,et=null,ri(t,i,a),et=r,Gt=f,et!==null)if(Gt)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(a.stateNode)}catch(m){Ve(a,i,m)}else try{et.removeChild(a.stateNode)}catch(m){Ve(a,i,m)}break;case 18:et!==null&&(Gt?(t=et,Ry(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),ja(t)):Ry(et,a.stateNode));break;case 4:r=et,f=Gt,et=a.stateNode.containerInfo,Gt=!0,ri(t,i,a),et=r,Gt=f;break;case 0:case 11:case 14:case 15:qi(2,a,i),vt||qi(4,a,i),ri(t,i,a);break;case 1:vt||(Un(a,i),r=a.stateNode,typeof r.componentWillUnmount=="function"&&Bp(a,i,r)),ri(t,i,a);break;case 21:ri(t,i,a);break;case 22:vt=(r=vt)||a.memoizedState!==null,ri(t,i,a),vt=r;break;default:ri(t,i,a)}}function Yp(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ja(t)}catch(a){Ve(i,i.return,a)}}}function Gp(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ja(t)}catch(a){Ve(i,i.return,a)}}function cx(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Up),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Up),i;default:throw Error(l(435,t.tag))}}function Xr(t,i){var a=cx(t);i.forEach(function(r){if(!a.has(r)){a.add(r);var f=vx.bind(null,t,r);r.then(f,f)}})}function Xt(t,i){var a=i.deletions;if(a!==null)for(var r=0;r<a.length;r++){var f=a[r],m=t,b=i,M=b;e:for(;M!==null;){switch(M.tag){case 27:if(Qi(M.type)){et=M.stateNode,Gt=!1;break e}break;case 5:et=M.stateNode,Gt=!1;break e;case 3:case 4:et=M.stateNode.containerInfo,Gt=!0;break e}M=M.return}if(et===null)throw Error(l(160));Vp(m,b,f),et=null,Gt=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Xp(i,t),i=i.sibling}var Nn=null;function Xp(t,i){var a=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Xt(i,t),Kt(t),r&4&&(qi(3,t,t.return),Wl(3,t),qi(5,t,t.return));break;case 1:Xt(i,t),Kt(t),r&512&&(vt||a===null||Un(a,a.return)),r&64&&oi&&(t=t.updateQueue,t!==null&&(r=t.callbacks,r!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var f=Nn;if(Xt(i,t),Kt(t),r&512&&(vt||a===null||Un(a,a.return)),r&4){var m=a!==null?a.memoizedState:null;if(r=t.memoizedState,a===null)if(r===null)if(t.stateNode===null){e:{r=t.type,a=t.memoizedProps,f=f.ownerDocument||f;t:switch(r){case"title":m=f.getElementsByTagName("title")[0],(!m||m[gs]||m[wt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(r),f.head.insertBefore(m,f.querySelector("head > title"))),Ct(m,r,a),m[wt]=t,mt(m),r=m;break e;case"link":var b=Xy("link","href",f).get(r+(a.href||""));if(b){for(var M=0;M<b.length;M++)if(m=b[M],m.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&m.getAttribute("rel")===(a.rel==null?null:a.rel)&&m.getAttribute("title")===(a.title==null?null:a.title)&&m.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){b.splice(M,1);break t}}m=f.createElement(r),Ct(m,r,a),f.head.appendChild(m);break;case"meta":if(b=Xy("meta","content",f).get(r+(a.content||""))){for(M=0;M<b.length;M++)if(m=b[M],m.getAttribute("content")===(a.content==null?null:""+a.content)&&m.getAttribute("name")===(a.name==null?null:a.name)&&m.getAttribute("property")===(a.property==null?null:a.property)&&m.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&m.getAttribute("charset")===(a.charSet==null?null:a.charSet)){b.splice(M,1);break t}}m=f.createElement(r),Ct(m,r,a),f.head.appendChild(m);break;default:throw Error(l(468,r))}m[wt]=t,mt(m),r=m}t.stateNode=r}else Ky(f,t.type,t.stateNode);else t.stateNode=Gy(f,r,t.memoizedProps);else m!==r?(m===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):m.count--,r===null?Ky(f,t.type,t.stateNode):Gy(f,r,t.memoizedProps)):r===null&&t.stateNode!==null&&nd(t,t.memoizedProps,a.memoizedProps)}break;case 27:Xt(i,t),Kt(t),r&512&&(vt||a===null||Un(a,a.return)),a!==null&&r&4&&nd(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Xt(i,t),Kt(t),r&512&&(vt||a===null||Un(a,a.return)),t.flags&32){f=t.stateNode;try{ta(f,"")}catch(pe){Ve(t,t.return,pe)}}r&4&&t.stateNode!=null&&(f=t.memoizedProps,nd(t,f,a!==null?a.memoizedProps:f)),r&1024&&(ad=!0);break;case 6:if(Xt(i,t),Kt(t),r&4){if(t.stateNode===null)throw Error(l(162));r=t.memoizedProps,a=t.stateNode;try{a.nodeValue=r}catch(pe){Ve(t,t.return,pe)}}break;case 3:if(rc=null,f=Nn,Nn=lc(i.containerInfo),Xt(i,t),Nn=f,Kt(t),r&4&&a!==null&&a.memoizedState.isDehydrated)try{ja(i.containerInfo)}catch(pe){Ve(t,t.return,pe)}ad&&(ad=!1,Kp(t));break;case 4:r=Nn,Nn=lc(t.stateNode.containerInfo),Xt(i,t),Kt(t),Nn=r;break;case 12:Xt(i,t),Kt(t);break;case 31:Xt(i,t),Kt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Xr(t,r)));break;case 13:Xt(i,t),Kt(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Qr=st()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Xr(t,r)));break;case 22:f=t.memoizedState!==null;var U=a!==null&&a.memoizedState!==null,F=oi,oe=vt;if(oi=F||f,vt=oe||U,Xt(i,t),vt=oe,oi=F,Kt(t),r&8192)e:for(i=t.stateNode,i._visibility=f?i._visibility&-2:i._visibility|1,f&&(a===null||U||oi||vt||Os(t)),a=null,i=t;;){if(i.tag===5||i.tag===26){if(a===null){U=a=i;try{if(m=U.stateNode,f)b=m.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{M=U.stateNode;var ce=U.memoizedProps.style,J=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;M.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(pe){Ve(U,U.return,pe)}}}else if(i.tag===6){if(a===null){U=i;try{U.stateNode.nodeValue=f?"":U.memoizedProps}catch(pe){Ve(U,U.return,pe)}}}else if(i.tag===18){if(a===null){U=i;try{var ie=U.stateNode;f?By(ie,!0):By(U.stateNode,!1)}catch(pe){Ve(U,U.return,pe)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;a===i&&(a=null),i=i.return}a===i&&(a=null),i.sibling.return=i.return,i=i.sibling}r&4&&(r=t.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Xr(t,a))));break;case 19:Xt(i,t),Kt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Xr(t,r)));break;case 30:break;case 21:break;default:Xt(i,t),Kt(t)}}function Kt(t){var i=t.flags;if(i&2){try{for(var a,r=t.return;r!==null;){if(Hp(r)){a=r;break}r=r.return}if(a==null)throw Error(l(160));switch(a.tag){case 27:var f=a.stateNode,m=id(t);Gr(t,m,f);break;case 5:var b=a.stateNode;a.flags&32&&(ta(b,""),a.flags&=-33);var M=id(t);Gr(t,M,b);break;case 3:case 4:var U=a.stateNode.containerInfo,F=id(t);sd(t,F,U);break;default:throw Error(l(161))}}catch(oe){Ve(t,t.return,oe)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function Kp(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;Kp(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function ci(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)qp(t,i.alternate,i),i=i.sibling}function Os(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:qi(4,i,i.return),Os(i);break;case 1:Un(i,i.return);var a=i.stateNode;typeof a.componentWillUnmount=="function"&&Bp(i,i.return,a),Os(i);break;case 27:ro(i.stateNode);case 26:case 5:Un(i,i.return),Os(i);break;case 22:i.memoizedState===null&&Os(i);break;case 30:Os(i);break;default:Os(i)}t=t.sibling}}function ui(t,i,a){for(a=a&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var r=i.alternate,f=t,m=i,b=m.flags;switch(m.tag){case 0:case 11:case 15:ui(f,m,a),Wl(4,m);break;case 1:if(ui(f,m,a),r=m,f=r.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(F){Ve(r,r.return,F)}if(r=m,f=r.updateQueue,f!==null){var M=r.stateNode;try{var U=f.shared.hiddenCallbacks;if(U!==null)for(f.shared.hiddenCallbacks=null,f=0;f<U.length;f++)Ng(U[f],M)}catch(F){Ve(r,r.return,F)}}a&&b&64&&Rp(m),Pl(m,m.return);break;case 27:$p(m);case 26:case 5:ui(f,m,a),a&&r===null&&b&4&&Lp(m),Pl(m,m.return);break;case 12:ui(f,m,a);break;case 31:ui(f,m,a),a&&b&4&&Yp(f,m);break;case 13:ui(f,m,a),a&&b&4&&Gp(f,m);break;case 22:m.memoizedState===null&&ui(f,m,a),Pl(m,m.return);break;case 30:break;default:ui(f,m,a)}i=i.sibling}}function ld(t,i){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&$l(a))}function od(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&$l(t))}function _n(t,i,a,r){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Qp(t,i,a,r),i=i.sibling}function Qp(t,i,a,r){var f=i.flags;switch(i.tag){case 0:case 11:case 15:_n(t,i,a,r),f&2048&&Wl(9,i);break;case 1:_n(t,i,a,r);break;case 3:_n(t,i,a,r),f&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&$l(t)));break;case 12:if(f&2048){_n(t,i,a,r),t=i.stateNode;try{var m=i.memoizedProps,b=m.id,M=m.onPostCommit;typeof M=="function"&&M(b,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(U){Ve(i,i.return,U)}}else _n(t,i,a,r);break;case 31:_n(t,i,a,r);break;case 13:_n(t,i,a,r);break;case 23:break;case 22:m=i.stateNode,b=i.alternate,i.memoizedState!==null?m._visibility&2?_n(t,i,a,r):eo(t,i):m._visibility&2?_n(t,i,a,r):(m._visibility|=2,wa(t,i,a,r,(i.subtreeFlags&10256)!==0||!1)),f&2048&&ld(b,i);break;case 24:_n(t,i,a,r),f&2048&&od(i.alternate,i);break;default:_n(t,i,a,r)}}function wa(t,i,a,r,f){for(f=f&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var m=t,b=i,M=a,U=r,F=b.flags;switch(b.tag){case 0:case 11:case 15:wa(m,b,M,U,f),Wl(8,b);break;case 23:break;case 22:var oe=b.stateNode;b.memoizedState!==null?oe._visibility&2?wa(m,b,M,U,f):eo(m,b):(oe._visibility|=2,wa(m,b,M,U,f)),f&&F&2048&&ld(b.alternate,b);break;case 24:wa(m,b,M,U,f),f&&F&2048&&od(b.alternate,b);break;default:wa(m,b,M,U,f)}i=i.sibling}}function eo(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var a=t,r=i,f=r.flags;switch(r.tag){case 22:eo(a,r),f&2048&&ld(r.alternate,r);break;case 24:eo(a,r),f&2048&&od(r.alternate,r);break;default:eo(a,r)}i=i.sibling}}var to=8192;function xa(t,i,a){if(t.subtreeFlags&to)for(t=t.child;t!==null;)Zp(t,i,a),t=t.sibling}function Zp(t,i,a){switch(t.tag){case 26:xa(t,i,a),t.flags&to&&t.memoizedState!==null&&Zx(a,Nn,t.memoizedState,t.memoizedProps);break;case 5:xa(t,i,a);break;case 3:case 4:var r=Nn;Nn=lc(t.stateNode.containerInfo),xa(t,i,a),Nn=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=to,to=16777216,xa(t,i,a),to=r):xa(t,i,a));break;default:xa(t,i,a)}}function Fp(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function no(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var r=i[a];Et=r,Wp(r,t)}Fp(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Jp(t),t=t.sibling}function Jp(t){switch(t.tag){case 0:case 11:case 15:no(t),t.flags&2048&&qi(9,t,t.return);break;case 3:no(t);break;case 12:no(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,Kr(t)):no(t);break;default:no(t)}}function Kr(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var r=i[a];Et=r,Wp(r,t)}Fp(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:qi(8,i,i.return),Kr(i);break;case 22:a=i.stateNode,a._visibility&2&&(a._visibility&=-3,Kr(i));break;default:Kr(i)}t=t.sibling}}function Wp(t,i){for(;Et!==null;){var a=Et;switch(a.tag){case 0:case 11:case 15:qi(8,a,i);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:$l(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,Et=r;else e:for(a=t;Et!==null;){r=Et;var f=r.sibling,m=r.return;if(Ip(r),r===a){Et=null;break e}if(f!==null){f.return=m,Et=f;break e}Et=m}}}var ux={getCacheForType:function(t){var i=At(gt),a=i.data.get(t);return a===void 0&&(a=t(),i.data.set(t,a)),a},cacheSignal:function(){return At(gt).controller.signal}},fx=typeof WeakMap=="function"?WeakMap:Map,$e=0,Ze=null,Me=null,ke=0,Ie=0,sn=null,Ii=!1,Ea=!1,rd=!1,fi=0,ut=0,Vi=0,ks=0,cd=0,an=0,Na=0,io=null,Qt=null,ud=!1,Qr=0,Pp=0,Zr=1/0,Fr=null,Yi=null,xt=0,Gi=null,_a=null,di=0,fd=0,dd=null,ey=null,so=0,hd=null;function ln(){return($e&2)!==0&&ke!==0?ke&-ke:j.T!==null?bd():tr()}function ty(){if(an===0)if((ke&536870912)===0||Re){var t=xi;xi<<=1,(xi&3932160)===0&&(xi=262144),an=t}else an=536870912;return t=tn.current,t!==null&&(t.flags|=32),an}function Zt(t,i,a){(t===Ze&&(Ie===2||Ie===9)||t.cancelPendingCommit!==null)&&(Aa(t,0),Xi(t,ke,an,!1)),me(t,a),(($e&2)===0||t!==Ze)&&(t===Ze&&(($e&2)===0&&(ks|=a),ut===4&&Xi(t,ke,an,!1)),qn(t))}function ny(t,i,a){if(($e&6)!==0)throw Error(l(327));var r=!a&&(i&127)===0&&(i&t.expiredLanes)===0||Qn(t,i),f=r?mx(t,i):gd(t,i,!0),m=r;do{if(f===0){Ea&&!r&&Xi(t,i,0,!1);break}else{if(a=t.current.alternate,m&&!dx(a)){f=gd(t,i,!1),m=!1;continue}if(f===2){if(m=i,t.errorRecoveryDisabledLanes&m)var b=0;else b=t.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){i=b;e:{var M=t;f=io;var U=M.current.memoizedState.isDehydrated;if(U&&(Aa(M,b).flags|=256),b=gd(M,b,!1),b!==2){if(rd&&!U){M.errorRecoveryDisabledLanes|=m,ks|=m,f=4;break e}m=Qt,Qt=f,m!==null&&(Qt===null?Qt=m:Qt.push.apply(Qt,m))}f=b}if(m=!1,f!==2)continue}}if(f===1){Aa(t,0),Xi(t,i,0,!0);break}e:{switch(r=t,m=f,m){case 0:case 1:throw Error(l(345));case 4:if((i&4194048)!==i)break;case 6:Xi(r,i,an,!Ii);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((i&62914560)===i&&(f=Qr+300-st(),10<f)){if(Xi(r,i,an,!Ii),Ni(r,0,!0)!==0)break e;di=i,r.timeoutHandle=zy(iy.bind(null,r,a,Qt,Fr,ud,i,an,ks,Na,Ii,m,"Throttled",-0,0),f);break e}iy(r,a,Qt,Fr,ud,i,an,ks,Na,Ii,m,null,-0,0)}}break}while(!0);qn(t)}function iy(t,i,a,r,f,m,b,M,U,F,oe,ce,J,ie){if(t.timeoutHandle=-1,ce=i.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jn},Zp(i,m,ce);var pe=(m&62914560)===m?Qr-st():(m&4194048)===m?Pp-st():0;if(pe=Fx(ce,pe),pe!==null){di=m,t.cancelPendingCommit=pe(fy.bind(null,t,i,m,a,r,f,b,M,U,oe,ce,null,J,ie)),Xi(t,m,b,!F);return}}fy(t,i,m,a,r,f,b,M,U)}function dx(t){for(var i=t;;){var a=i.tag;if((a===0||a===11||a===15)&&i.flags&16384&&(a=i.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var f=a[r],m=f.getSnapshot;f=f.value;try{if(!Pt(m(),f))return!1}catch{return!1}}if(a=i.child,i.subtreeFlags&16384&&a!==null)a.return=i,i=a;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Xi(t,i,a,r){i&=~cd,i&=~ks,t.suspendedLanes|=i,t.pingedLanes&=~i,r&&(t.warmLanes|=i),r=t.expirationTimes;for(var f=i;0<f;){var m=31-Ge(f),b=1<<m;r[m]=-1,f&=~b}a!==0&&Pe(t,a,i)}function Jr(){return($e&6)===0?(ao(0),!1):!0}function md(){if(Me!==null){if(Ie===0)var t=Me.return;else t=Me,ti=xs=null,Of(t),pa=null,ql=0,t=Me;for(;t!==null;)Dp(t.alternate,t),t=t.return;Me=null}}function Aa(t,i){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,jx(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),di=0,md(),Ze=t,Me=a=Pn(t.current,null),ke=i,Ie=0,sn=null,Ii=!1,Ea=Qn(t,i),rd=!1,Na=an=cd=ks=Vi=ut=0,Qt=io=null,ud=!1,(i&8)!==0&&(i|=i&32);var r=t.entangledLanes;if(r!==0)for(t=t.entanglements,r&=i;0<r;){var f=31-Ge(r),m=1<<f;i|=t[f],r&=~m}return fi=i,vr(),a}function sy(t,i){Ae=null,j.H=Zl,i===ga||i===Ar?(i=Sg(),Ie=3):i===vf?(i=Sg(),Ie=4):Ie=i===Xf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,sn=i,Me===null&&(ut=1,Ur(t,fn(i,t.current)))}function ay(){var t=tn.current;return t===null?!0:(ke&4194048)===ke?gn===null:(ke&62914560)===ke||(ke&536870912)!==0?t===gn:!1}function ly(){var t=j.H;return j.H=Zl,t===null?Zl:t}function oy(){var t=j.A;return j.A=ux,t}function Wr(){ut=4,Ii||(ke&4194048)!==ke&&tn.current!==null||(Ea=!0),(Vi&134217727)===0&&(ks&134217727)===0||Ze===null||Xi(Ze,ke,an,!1)}function gd(t,i,a){var r=$e;$e|=2;var f=ly(),m=oy();(Ze!==t||ke!==i)&&(Fr=null,Aa(t,i)),i=!1;var b=ut;e:do try{if(Ie!==0&&Me!==null){var M=Me,U=sn;switch(Ie){case 8:md(),b=6;break e;case 3:case 2:case 9:case 6:tn.current===null&&(i=!0);var F=Ie;if(Ie=0,sn=null,Ta(t,M,U,F),a&&Ea){b=0;break e}break;default:F=Ie,Ie=0,sn=null,Ta(t,M,U,F)}}hx(),b=ut;break}catch(oe){sy(t,oe)}while(!0);return i&&t.shellSuspendCounter++,ti=xs=null,$e=r,j.H=f,j.A=m,Me===null&&(Ze=null,ke=0,vr()),b}function hx(){for(;Me!==null;)ry(Me)}function mx(t,i){var a=$e;$e|=2;var r=ly(),f=oy();Ze!==t||ke!==i?(Fr=null,Zr=st()+500,Aa(t,i)):Ea=Qn(t,i);e:do try{if(Ie!==0&&Me!==null){i=Me;var m=sn;t:switch(Ie){case 1:Ie=0,sn=null,Ta(t,i,m,1);break;case 2:case 9:if(vg(m)){Ie=0,sn=null,cy(i);break}i=function(){Ie!==2&&Ie!==9||Ze!==t||(Ie=7),qn(t)},m.then(i,i);break e;case 3:Ie=7;break e;case 4:Ie=5;break e;case 7:vg(m)?(Ie=0,sn=null,cy(i)):(Ie=0,sn=null,Ta(t,i,m,7));break;case 5:var b=null;switch(Me.tag){case 26:b=Me.memoizedState;case 5:case 27:var M=Me;if(b?Qy(b):M.stateNode.complete){Ie=0,sn=null;var U=M.sibling;if(U!==null)Me=U;else{var F=M.return;F!==null?(Me=F,Pr(F)):Me=null}break t}}Ie=0,sn=null,Ta(t,i,m,5);break;case 6:Ie=0,sn=null,Ta(t,i,m,6);break;case 8:md(),ut=6;break e;default:throw Error(l(462))}}gx();break}catch(oe){sy(t,oe)}while(!0);return ti=xs=null,j.H=r,j.A=f,$e=a,Me!==null?0:(Ze=null,ke=0,vr(),ut)}function gx(){for(;Me!==null&&!Lt();)ry(Me)}function ry(t){var i=jp(t.alternate,t,fi);t.memoizedProps=t.pendingProps,i===null?Pr(t):Me=i}function cy(t){var i=t,a=i.alternate;switch(i.tag){case 15:case 0:i=Ap(a,i,i.pendingProps,i.type,void 0,ke);break;case 11:i=Ap(a,i,i.pendingProps,i.type.render,i.ref,ke);break;case 5:Of(i);default:Dp(a,i),i=Me=og(i,fi),i=jp(a,i,fi)}t.memoizedProps=t.pendingProps,i===null?Pr(t):Me=i}function Ta(t,i,a,r){ti=xs=null,Of(i),pa=null,ql=0;var f=i.return;try{if(ix(t,f,i,a,ke)){ut=1,Ur(t,fn(a,t.current)),Me=null;return}}catch(m){if(f!==null)throw Me=f,m;ut=1,Ur(t,fn(a,t.current)),Me=null;return}i.flags&32768?(Re||r===1?t=!0:Ea||(ke&536870912)!==0?t=!1:(Ii=t=!0,(r===2||r===9||r===3||r===6)&&(r=tn.current,r!==null&&r.tag===13&&(r.flags|=16384))),uy(i,t)):Pr(i)}function Pr(t){var i=t;do{if((i.flags&32768)!==0){uy(i,Ii);return}t=i.return;var a=lx(i.alternate,i,fi);if(a!==null){Me=a;return}if(i=i.sibling,i!==null){Me=i;return}Me=i=t}while(i!==null);ut===0&&(ut=5)}function uy(t,i){do{var a=ox(t.alternate,t);if(a!==null){a.flags&=32767,Me=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!i&&(t=t.sibling,t!==null)){Me=t;return}Me=t=a}while(t!==null);ut=6,Me=null}function fy(t,i,a,r,f,m,b,M,U){t.cancelPendingCommit=null;do ec();while(xt!==0);if(($e&6)!==0)throw Error(l(327));if(i!==null){if(i===t.current)throw Error(l(177));if(m=i.lanes|i.childLanes,m|=nf,Ce(t,a,m,b,M,U),t===Ze&&(Me=Ze=null,ke=0),_a=i,Gi=t,di=a,fd=m,dd=f,ey=r,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,bx(Nt,function(){return py(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||r){r=j.T,j.T=null,f=$.p,$.p=2,b=$e,$e|=4;try{rx(t,i,a)}finally{$e=b,$.p=f,j.T=r}}xt=1,dy(),hy(),my()}}function dy(){if(xt===1){xt=0;var t=Gi,i=_a,a=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||a){a=j.T,j.T=null;var r=$.p;$.p=2;var f=$e;$e|=4;try{Xp(i,t);var m=Td,b=Wm(t.containerInfo),M=m.focusedElem,U=m.selectionRange;if(b!==M&&M&&M.ownerDocument&&Jm(M.ownerDocument.documentElement,M)){if(U!==null&&Ju(M)){var F=U.start,oe=U.end;if(oe===void 0&&(oe=F),"selectionStart"in M)M.selectionStart=F,M.selectionEnd=Math.min(oe,M.value.length);else{var ce=M.ownerDocument||document,J=ce&&ce.defaultView||window;if(J.getSelection){var ie=J.getSelection(),pe=M.textContent.length,we=Math.min(U.start,pe),Qe=U.end===void 0?we:Math.min(U.end,pe);!ie.extend&&we>Qe&&(b=Qe,Qe=we,we=b);var Q=Fm(M,we),I=Fm(M,Qe);if(Q&&I&&(ie.rangeCount!==1||ie.anchorNode!==Q.node||ie.anchorOffset!==Q.offset||ie.focusNode!==I.node||ie.focusOffset!==I.offset)){var Z=ce.createRange();Z.setStart(Q.node,Q.offset),ie.removeAllRanges(),we>Qe?(ie.addRange(Z),ie.extend(I.node,I.offset)):(Z.setEnd(I.node,I.offset),ie.addRange(Z))}}}}for(ce=[],ie=M;ie=ie.parentNode;)ie.nodeType===1&&ce.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<ce.length;M++){var re=ce[M];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}dc=!!Ad,Td=Ad=null}finally{$e=f,$.p=r,j.T=a}}t.current=i,xt=2}}function hy(){if(xt===2){xt=0;var t=Gi,i=_a,a=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||a){a=j.T,j.T=null;var r=$.p;$.p=2;var f=$e;$e|=4;try{qp(t,i.alternate,i)}finally{$e=f,$.p=r,j.T=a}}xt=3}}function my(){if(xt===4||xt===3){xt=0,Ht();var t=Gi,i=_a,a=di,r=ey;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?xt=5:(xt=0,_a=Gi=null,gy(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(Yi=null),Sl(a),i=i.stateNode,at&&typeof at.onCommitFiberRoot=="function")try{at.onCommitFiberRoot(Bn,i,void 0,(i.current.flags&128)===128)}catch{}if(r!==null){i=j.T,f=$.p,$.p=2,j.T=null;try{for(var m=t.onRecoverableError,b=0;b<r.length;b++){var M=r[b];m(M.value,{componentStack:M.stack})}}finally{j.T=i,$.p=f}}(di&3)!==0&&ec(),qn(t),f=t.pendingLanes,(a&261930)!==0&&(f&42)!==0?t===hd?so++:(so=0,hd=t):so=0,ao(0)}}function gy(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,$l(i)))}function ec(){return dy(),hy(),my(),py()}function py(){if(xt!==5)return!1;var t=Gi,i=fd;fd=0;var a=Sl(di),r=j.T,f=$.p;try{$.p=32>a?32:a,j.T=null,a=dd,dd=null;var m=Gi,b=di;if(xt=0,_a=Gi=null,di=0,($e&6)!==0)throw Error(l(331));var M=$e;if($e|=4,Jp(m.current),Qp(m,m.current,b,a),$e=M,ao(0,!1),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(Bn,m)}catch{}return!0}finally{$.p=f,j.T=r,gy(t,i)}}function yy(t,i,a){i=fn(a,i),i=Gf(t.stateNode,i,2),t=Hi(t,i,2),t!==null&&(me(t,2),qn(t))}function Ve(t,i,a){if(t.tag===3)yy(t,t,a);else for(;i!==null;){if(i.tag===3){yy(i,t,a);break}else if(i.tag===1){var r=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Yi===null||!Yi.has(r))){t=fn(a,t),a=vp(2),r=Hi(i,a,2),r!==null&&(bp(a,r,i,t),me(r,2),qn(r));break}}i=i.return}}function pd(t,i,a){var r=t.pingCache;if(r===null){r=t.pingCache=new fx;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(a)||(rd=!0,f.add(a),t=px.bind(null,t,i,a),i.then(t,t))}function px(t,i,a){var r=t.pingCache;r!==null&&r.delete(i),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Ze===t&&(ke&a)===a&&(ut===4||ut===3&&(ke&62914560)===ke&&300>st()-Qr?($e&2)===0&&Aa(t,0):cd|=a,Na===ke&&(Na=0)),qn(t)}function vy(t,i){i===0&&(i=Zs()),t=bs(t,i),t!==null&&(me(t,i),qn(t))}function yx(t){var i=t.memoizedState,a=0;i!==null&&(a=i.retryLane),vy(t,a)}function vx(t,i){var a=0;switch(t.tag){case 31:case 13:var r=t.stateNode,f=t.memoizedState;f!==null&&(a=f.retryLane);break;case 19:r=t.stateNode;break;case 22:r=t.stateNode._retryCache;break;default:throw Error(l(314))}r!==null&&r.delete(i),vy(t,a)}function bx(t,i){return Mt(t,i)}var tc=null,Ca=null,yd=!1,nc=!1,vd=!1,Ki=0;function qn(t){t!==Ca&&t.next===null&&(Ca===null?tc=Ca=t:Ca=Ca.next=t),nc=!0,yd||(yd=!0,wx())}function ao(t,i){if(!vd&&nc){vd=!0;do for(var a=!1,r=tc;r!==null;){if(t!==0){var f=r.pendingLanes;if(f===0)var m=0;else{var b=r.suspendedLanes,M=r.pingedLanes;m=(1<<31-Ge(42|t)+1)-1,m&=f&~(b&~M),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(a=!0,xy(r,m))}else m=ke,m=Ni(r,r===Ze?m:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(m&3)===0||Qn(r,m)||(a=!0,xy(r,m));r=r.next}while(a);vd=!1}}function Sx(){by()}function by(){nc=yd=!1;var t=0;Ki!==0&&kx()&&(t=Ki);for(var i=st(),a=null,r=tc;r!==null;){var f=r.next,m=Sy(r,i);m===0?(r.next=null,a===null?tc=f:a.next=f,f===null&&(Ca=a)):(a=r,(t!==0||(m&3)!==0)&&(nc=!0)),r=f}xt!==0&&xt!==5||ao(t),Ki!==0&&(Ki=0)}function Sy(t,i){for(var a=t.suspendedLanes,r=t.pingedLanes,f=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var b=31-Ge(m),M=1<<b,U=f[b];U===-1?((M&a)===0||(M&r)!==0)&&(f[b]=bl(M,i)):U<=i&&(t.expiredLanes|=M),m&=~M}if(i=Ze,a=ke,a=Ni(t,t===i?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,a===0||t===i&&(Ie===2||Ie===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&De(r),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Qn(t,a)){if(i=a&-a,i===t.callbackPriority)return i;switch(r!==null&&De(r),Sl(a)){case 2:case 8:a=qe;break;case 32:a=Nt;break;case 268435456:a=Kn;break;default:a=Nt}return r=wy.bind(null,t),a=Mt(a,r),t.callbackPriority=i,t.callbackNode=a,i}return r!==null&&r!==null&&De(r),t.callbackPriority=2,t.callbackNode=null,2}function wy(t,i){if(xt!==0&&xt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(ec()&&t.callbackNode!==a)return null;var r=ke;return r=Ni(t,t===Ze?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(ny(t,r,i),Sy(t,st()),t.callbackNode!=null&&t.callbackNode===a?wy.bind(null,t):null)}function xy(t,i){if(ec())return null;ny(t,i,!0)}function wx(){zx(function(){($e&6)!==0?Mt($t,Sx):by()})}function bd(){if(Ki===0){var t=ha;t===0&&(t=Ut,Ut<<=1,(Ut&261888)===0&&(Ut=256)),Ki=t}return Ki}function Ey(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:ur(""+t)}function Ny(t,i){var a=i.ownerDocument.createElement("input");return a.name=i.name,a.value=i.value,t.id&&a.setAttribute("form",t.id),i.parentNode.insertBefore(a,i),t=new FormData(t),a.parentNode.removeChild(a),t}function xx(t,i,a,r,f){if(i==="submit"&&a&&a.stateNode===f){var m=Ey((f[Ot]||null).action),b=r.submitter;b&&(i=(i=b[Ot]||null)?Ey(i.formAction):b.getAttribute("formAction"),i!==null&&(m=i,b=null));var M=new mr("action","action",null,r,f);t.push({event:M,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Ki!==0){var U=b?Ny(f,b):new FormData(f);$f(a,{pending:!0,data:U,method:f.method,action:m},null,U)}}else typeof m=="function"&&(M.preventDefault(),U=b?Ny(f,b):new FormData(f),$f(a,{pending:!0,data:U,method:f.method,action:m},m,U))},currentTarget:f}]})}}for(var Sd=0;Sd<tf.length;Sd++){var wd=tf[Sd],Ex=wd.toLowerCase(),Nx=wd[0].toUpperCase()+wd.slice(1);En(Ex,"on"+Nx)}En(tg,"onAnimationEnd"),En(ng,"onAnimationIteration"),En(ig,"onAnimationStart"),En("dblclick","onDoubleClick"),En("focusin","onFocus"),En("focusout","onBlur"),En(Uw,"onTransitionRun"),En(qw,"onTransitionStart"),En(Iw,"onTransitionCancel"),En(sg,"onTransitionEnd"),Mi("onMouseEnter",["mouseout","mouseover"]),Mi("onMouseLeave",["mouseout","mouseover"]),Mi("onPointerEnter",["pointerout","pointerover"]),Mi("onPointerLeave",["pointerout","pointerover"]),Fn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Fn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Fn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Fn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Fn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Fn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lo="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(" "),_x=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(lo));function _y(t,i){i=(i&4)!==0;for(var a=0;a<t.length;a++){var r=t[a],f=r.event;r=r.listeners;e:{var m=void 0;if(i)for(var b=r.length-1;0<=b;b--){var M=r[b],U=M.instance,F=M.currentTarget;if(M=M.listener,U!==m&&f.isPropagationStopped())break e;m=M,f.currentTarget=F;try{m(f)}catch(oe){yr(oe)}f.currentTarget=null,m=U}else for(b=0;b<r.length;b++){if(M=r[b],U=M.instance,F=M.currentTarget,M=M.listener,U!==m&&f.isPropagationStopped())break e;m=M,f.currentTarget=F;try{m(f)}catch(oe){yr(oe)}f.currentTarget=null,m=U}}}}function Oe(t,i){var a=i[Fs];a===void 0&&(a=i[Fs]=new Set);var r=t+"__bubble";a.has(r)||(Ay(i,t,2,!1),a.add(r))}function xd(t,i,a){var r=0;i&&(r|=4),Ay(a,t,r,i)}var ic="_reactListening"+Math.random().toString(36).slice(2);function Ed(t){if(!t[ic]){t[ic]=!0,ar.forEach(function(a){a!=="selectionchange"&&(_x.has(a)||xd(a,!1,t),xd(a,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[ic]||(i[ic]=!0,xd("selectionchange",!1,i))}}function Ay(t,i,a,r){switch(t0(i)){case 2:var f=Px;break;case 8:f=eE;break;default:f=Hd}a=f.bind(null,i,a,t),f=void 0,!Iu||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(f=!0),r?f!==void 0?t.addEventListener(i,a,{capture:!0,passive:f}):t.addEventListener(i,a,!0):f!==void 0?t.addEventListener(i,a,{passive:f}):t.addEventListener(i,a,!1)}function Nd(t,i,a,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 M=r.stateNode.containerInfo;if(M===f)break;if(b===4)for(b=r.return;b!==null;){var U=b.tag;if((U===3||U===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;M!==null;){if(b=_i(M),b===null)return;if(U=b.tag,U===5||U===6||U===26||U===27){r=m=b;continue e}M=M.parentNode}}r=r.return}km(function(){var F=m,oe=Uu(a),ce=[];e:{var J=ag.get(t);if(J!==void 0){var ie=mr,pe=t;switch(t){case"keypress":if(dr(a)===0)break e;case"keydown":case"keyup":ie=vw;break;case"focusin":pe="focus",ie=Xu;break;case"focusout":pe="blur",ie=Xu;break;case"beforeblur":case"afterblur":ie=Xu;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=Dm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=lw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=ww;break;case tg:case ng:case ig:ie=cw;break;case sg:ie=Ew;break;case"scroll":case"scrollend":ie=sw;break;case"wheel":ie=_w;break;case"copy":case"cut":case"paste":ie=fw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Bm;break;case"toggle":case"beforetoggle":ie=Tw}var we=(i&4)!==0,Qe=!we&&(t==="scroll"||t==="scrollend"),Q=we?J!==null?J+"Capture":null:J;we=[];for(var I=F,Z;I!==null;){var re=I;if(Z=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||Z===null||Q===null||(re=Cl(I,Q),re!=null&&we.push(oo(I,re,Z))),Qe)break;I=I.return}0<we.length&&(J=new ie(J,pe,null,a,oe),ce.push({event:J,listeners:we}))}}if((i&7)===0){e:{if(J=t==="mouseover"||t==="pointerover",ie=t==="mouseout"||t==="pointerout",J&&a!==$u&&(pe=a.relatedTarget||a.fromElement)&&(_i(pe)||pe[Zn]))break e;if((ie||J)&&(J=oe.window===oe?oe:(J=oe.ownerDocument)?J.defaultView||J.parentWindow:window,ie?(pe=a.relatedTarget||a.toElement,ie=F,pe=pe?_i(pe):null,pe!==null&&(Qe=c(pe),we=pe.tag,pe!==Qe||we!==5&&we!==27&&we!==6)&&(pe=null)):(ie=null,pe=F),ie!==pe)){if(we=Dm,re="onMouseLeave",Q="onMouseEnter",I="mouse",(t==="pointerout"||t==="pointerover")&&(we=Bm,re="onPointerLeave",Q="onPointerEnter",I="pointer"),Qe=ie==null?J:Ti(ie),Z=pe==null?J:Ti(pe),J=new we(re,I+"leave",ie,a,oe),J.target=Qe,J.relatedTarget=Z,re=null,_i(oe)===F&&(we=new we(Q,I+"enter",pe,a,oe),we.target=Z,we.relatedTarget=Qe,re=we),Qe=re,ie&&pe)t:{for(we=Ax,Q=ie,I=pe,Z=0,re=Q;re;re=we(re))Z++;re=0;for(var be=I;be;be=we(be))re++;for(;0<Z-re;)Q=we(Q),Z--;for(;0<re-Z;)I=we(I),re--;for(;Z--;){if(Q===I||I!==null&&Q===I.alternate){we=Q;break t}Q=we(Q),I=we(I)}we=null}else we=null;ie!==null&&Ty(ce,J,ie,we,!1),pe!==null&&Qe!==null&&Ty(ce,Qe,pe,we,!0)}}e:{if(J=F?Ti(F):window,ie=J.nodeName&&J.nodeName.toLowerCase(),ie==="select"||ie==="input"&&J.type==="file")var Le=Ym;else if(Im(J))if(Gm)Le=Lw;else{Le=Rw;var ye=Dw}else ie=J.nodeName,!ie||ie.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?F&&Hu(F.elementType)&&(Le=Ym):Le=Bw;if(Le&&(Le=Le(t,F))){Vm(ce,Le,a,oe);break e}ye&&ye(t,J,F),t==="focusout"&&F&&J.type==="number"&&F.memoizedProps.value!=null&&Al(J,"number",J.value)}switch(ye=F?Ti(F):window,t){case"focusin":(Im(ye)||ye.contentEditable==="true")&&(aa=ye,Wu=F,Bl=null);break;case"focusout":Bl=Wu=aa=null;break;case"mousedown":Pu=!0;break;case"contextmenu":case"mouseup":case"dragend":Pu=!1,Pm(ce,a,oe);break;case"selectionchange":if($w)break;case"keydown":case"keyup":Pm(ce,a,oe)}var Te;if(Qu)e:{switch(t){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else sa?Um(t,a)&&(je="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(je="onCompositionStart");je&&(Lm&&a.locale!=="ko"&&(sa||je!=="onCompositionStart"?je==="onCompositionEnd"&&sa&&(Te=jm()):(ki=oe,Vu="value"in ki?ki.value:ki.textContent,sa=!0)),ye=sc(F,je),0<ye.length&&(je=new Rm(je,t,null,a,oe),ce.push({event:je,listeners:ye}),Te?je.data=Te:(Te=qm(a),Te!==null&&(je.data=Te)))),(Te=Mw?Ow(t,a):kw(t,a))&&(je=sc(F,"onBeforeInput"),0<je.length&&(ye=new Rm("onBeforeInput","beforeinput",null,a,oe),ce.push({event:ye,listeners:je}),ye.data=Te)),xx(ce,t,F,a,oe)}_y(ce,i)})}function oo(t,i,a){return{instance:t,listener:i,currentTarget:a}}function sc(t,i){for(var a=i+"Capture",r=[];t!==null;){var f=t,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=Cl(t,a),f!=null&&r.unshift(oo(t,f,m)),f=Cl(t,i),f!=null&&r.push(oo(t,f,m))),t.tag===3)return r;t=t.return}return[]}function Ax(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Ty(t,i,a,r,f){for(var m=i._reactName,b=[];a!==null&&a!==r;){var M=a,U=M.alternate,F=M.stateNode;if(M=M.tag,U!==null&&U===r)break;M!==5&&M!==26&&M!==27||F===null||(U=F,f?(F=Cl(a,m),F!=null&&b.unshift(oo(a,F,U))):f||(F=Cl(a,m),F!=null&&b.push(oo(a,F,U)))),a=a.return}b.length!==0&&t.push({event:i,listeners:b})}var Tx=/\r\n?/g,Cx=/\u0000|\uFFFD/g;function Cy(t){return(typeof t=="string"?t:""+t).replace(Tx,`
9
+ `).replace(Cx,"")}function My(t,i){return i=Cy(i),Cy(t)===i}function Ke(t,i,a,r,f,m){switch(a){case"children":typeof r=="string"?i==="body"||i==="textarea"&&r===""||ta(t,r):(typeof r=="number"||typeof r=="bigint")&&i!=="body"&&ta(t,""+r);break;case"className":Ws(t,"class",r);break;case"tabIndex":Ws(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Ws(t,a,r);break;case"style":Mm(t,r,m);break;case"data":if(i!=="object"){Ws(t,"data",r);break}case"src":case"href":if(r===""&&(i!=="a"||a!=="href")){t.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(a);break}r=ur(""+r),t.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){t.setAttribute(a,"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"&&(a==="formAction"?(i!=="input"&&Ke(t,i,"name",f.name,f,null),Ke(t,i,"formEncType",f.formEncType,f,null),Ke(t,i,"formMethod",f.formMethod,f,null),Ke(t,i,"formTarget",f.formTarget,f,null)):(Ke(t,i,"encType",f.encType,f,null),Ke(t,i,"method",f.method,f,null),Ke(t,i,"target",f.target,f,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(a);break}r=ur(""+r),t.setAttribute(a,r);break;case"onClick":r!=null&&(t.onclick=Jn);break;case"onScroll":r!=null&&Oe("scroll",t);break;case"onScrollEnd":r!=null&&Oe("scrollend",t);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(l(61));if(a=r.__html,a!=null){if(f.children!=null)throw Error(l(60));t.innerHTML=a}}break;case"multiple":t.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":t.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"){t.removeAttribute("xlink:href");break}a=ur(""+r),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);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"?t.setAttribute(a,""+r):t.removeAttribute(a);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"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":r===!0?t.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(a,r):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?t.setAttribute(a,r):t.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?t.removeAttribute(a):t.setAttribute(a,r);break;case"popover":Oe("beforetoggle",t),Oe("toggle",t),Js(t,"popover",r);break;case"xlinkActuate":xn(t,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":xn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":xn(t,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":xn(t,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":xn(t,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":xn(t,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":xn(t,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":xn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":xn(t,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Js(t,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=nw.get(a)||a,Js(t,a,r))}}function _d(t,i,a,r,f,m){switch(a){case"style":Mm(t,r,m);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(l(61));if(a=r.__html,a!=null){if(f.children!=null)throw Error(l(60));t.innerHTML=a}}break;case"children":typeof r=="string"?ta(t,r):(typeof r=="number"||typeof r=="bigint")&&ta(t,""+r);break;case"onScroll":r!=null&&Oe("scroll",t);break;case"onScrollEnd":r!=null&&Oe("scrollend",t);break;case"onClick":r!=null&&(t.onclick=Jn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!lr.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),i=a.slice(2,f?a.length-7:void 0),m=t[Ot]||null,m=m!=null?m[a]:null,typeof m=="function"&&t.removeEventListener(i,m,f),typeof r=="function")){typeof m!="function"&&m!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(i,r,f);break e}a in t?t[a]=r:r===!0?t.setAttribute(a,""):Js(t,a,r)}}}function Ct(t,i,a){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Oe("error",t),Oe("load",t);var r=!1,f=!1,m;for(m in a)if(a.hasOwnProperty(m)){var b=a[m];if(b!=null)switch(m){case"src":r=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,i));default:Ke(t,i,m,b,a,null)}}f&&Ke(t,i,"srcSet",a.srcSet,a,null),r&&Ke(t,i,"src",a.src,a,null);return;case"input":Oe("invalid",t);var M=m=b=f=null,U=null,F=null;for(r in a)if(a.hasOwnProperty(r)){var oe=a[r];if(oe!=null)switch(r){case"name":f=oe;break;case"type":b=oe;break;case"checked":U=oe;break;case"defaultChecked":F=oe;break;case"value":m=oe;break;case"defaultValue":M=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(l(137,i));break;default:Ke(t,i,r,oe,a,null)}}ea(t,m,M,U,F,b,f,!1);return;case"select":Oe("invalid",t),r=b=m=null;for(f in a)if(a.hasOwnProperty(f)&&(M=a[f],M!=null))switch(f){case"value":m=M;break;case"defaultValue":b=M;break;case"multiple":r=M;default:Ke(t,i,f,M,a,null)}i=m,a=b,t.multiple=!!r,i!=null?Oi(t,!!r,i,!1):a!=null&&Oi(t,!!r,a,!0);return;case"textarea":Oe("invalid",t),m=f=r=null;for(b in a)if(a.hasOwnProperty(b)&&(M=a[b],M!=null))switch(b){case"value":r=M;break;case"defaultValue":f=M;break;case"children":m=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(l(91));break;default:Ke(t,i,b,M,a,null)}Tm(t,r,f,m);return;case"option":for(U in a)a.hasOwnProperty(U)&&(r=a[U],r!=null)&&(U==="selected"?t.selected=r&&typeof r!="function"&&typeof r!="symbol":Ke(t,i,U,r,a,null));return;case"dialog":Oe("beforetoggle",t),Oe("toggle",t),Oe("cancel",t),Oe("close",t);break;case"iframe":case"object":Oe("load",t);break;case"video":case"audio":for(r=0;r<lo.length;r++)Oe(lo[r],t);break;case"image":Oe("error",t),Oe("load",t);break;case"details":Oe("toggle",t);break;case"embed":case"source":case"link":Oe("error",t),Oe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in a)if(a.hasOwnProperty(F)&&(r=a[F],r!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,i));default:Ke(t,i,F,r,a,null)}return;default:if(Hu(i)){for(oe in a)a.hasOwnProperty(oe)&&(r=a[oe],r!==void 0&&_d(t,i,oe,r,a,void 0));return}}for(M in a)a.hasOwnProperty(M)&&(r=a[M],r!=null&&Ke(t,i,M,r,a,null))}function Mx(t,i,a,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,M=null,U=null,F=null,oe=null;for(ie in a){var ce=a[ie];if(a.hasOwnProperty(ie)&&ce!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":U=ce;default:r.hasOwnProperty(ie)||Ke(t,i,ie,null,r,ce)}}for(var J in r){var ie=r[J];if(ce=a[J],r.hasOwnProperty(J)&&(ie!=null||ce!=null))switch(J){case"type":m=ie;break;case"name":f=ie;break;case"checked":F=ie;break;case"defaultChecked":oe=ie;break;case"value":b=ie;break;case"defaultValue":M=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(l(137,i));break;default:ie!==ce&&Ke(t,i,J,ie,r,ce)}}_l(t,b,M,U,F,oe,m,f);return;case"select":ie=b=M=J=null;for(m in a)if(U=a[m],a.hasOwnProperty(m)&&U!=null)switch(m){case"value":break;case"multiple":ie=U;default:r.hasOwnProperty(m)||Ke(t,i,m,null,r,U)}for(f in r)if(m=r[f],U=a[f],r.hasOwnProperty(f)&&(m!=null||U!=null))switch(f){case"value":J=m;break;case"defaultValue":M=m;break;case"multiple":b=m;default:m!==U&&Ke(t,i,f,m,r,U)}i=M,a=b,r=ie,J!=null?Oi(t,!!a,J,!1):!!r!=!!a&&(i!=null?Oi(t,!!a,i,!0):Oi(t,!!a,a?[]:"",!1));return;case"textarea":ie=J=null;for(M in a)if(f=a[M],a.hasOwnProperty(M)&&f!=null&&!r.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:Ke(t,i,M,null,r,f)}for(b in r)if(f=r[b],m=a[b],r.hasOwnProperty(b)&&(f!=null||m!=null))switch(b){case"value":J=f;break;case"defaultValue":ie=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(l(91));break;default:f!==m&&Ke(t,i,b,f,r,m)}Tl(t,J,ie);return;case"option":for(var pe in a)J=a[pe],a.hasOwnProperty(pe)&&J!=null&&!r.hasOwnProperty(pe)&&(pe==="selected"?t.selected=!1:Ke(t,i,pe,null,r,J));for(U in r)J=r[U],ie=a[U],r.hasOwnProperty(U)&&J!==ie&&(J!=null||ie!=null)&&(U==="selected"?t.selected=J&&typeof J!="function"&&typeof J!="symbol":Ke(t,i,U,J,r,ie));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 a)J=a[we],a.hasOwnProperty(we)&&J!=null&&!r.hasOwnProperty(we)&&Ke(t,i,we,null,r,J);for(F in r)if(J=r[F],ie=a[F],r.hasOwnProperty(F)&&J!==ie&&(J!=null||ie!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(l(137,i));break;default:Ke(t,i,F,J,r,ie)}return;default:if(Hu(i)){for(var Qe in a)J=a[Qe],a.hasOwnProperty(Qe)&&J!==void 0&&!r.hasOwnProperty(Qe)&&_d(t,i,Qe,void 0,r,J);for(oe in r)J=r[oe],ie=a[oe],!r.hasOwnProperty(oe)||J===ie||J===void 0&&ie===void 0||_d(t,i,oe,J,r,ie);return}}for(var Q in a)J=a[Q],a.hasOwnProperty(Q)&&J!=null&&!r.hasOwnProperty(Q)&&Ke(t,i,Q,null,r,J);for(ce in r)J=r[ce],ie=a[ce],!r.hasOwnProperty(ce)||J===ie||J==null&&ie==null||Ke(t,i,ce,J,r,ie)}function Oy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ox(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var f=a[r],m=f.transferSize,b=f.initiatorType,M=f.duration;if(m&&M&&Oy(b)){for(b=0,M=f.responseEnd,r+=1;r<a.length;r++){var U=a[r],F=U.startTime;if(F>M)break;var oe=U.transferSize,ce=U.initiatorType;oe&&Oy(ce)&&(U=U.responseEnd,b+=oe*(U<M?1:(M-F)/(U-F)))}if(--r,i+=8*(m+b)/(f.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Ad=null,Td=null;function ac(t){return t.nodeType===9?t:t.ownerDocument}function ky(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function jy(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function Cd(t,i){return t==="textarea"||t==="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 Md=null;function kx(){var t=window.event;return t&&t.type==="popstate"?t===Md?!1:(Md=t,!0):(Md=null,!1)}var zy=typeof setTimeout=="function"?setTimeout:void 0,jx=typeof clearTimeout=="function"?clearTimeout:void 0,Dy=typeof Promise=="function"?Promise:void 0,zx=typeof queueMicrotask=="function"?queueMicrotask:typeof Dy<"u"?function(t){return Dy.resolve(null).then(t).catch(Dx)}:zy;function Dx(t){setTimeout(function(){throw t})}function Qi(t){return t==="head"}function Ry(t,i){var a=i,r=0;do{var f=a.nextSibling;if(t.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"||a==="/&"){if(r===0){t.removeChild(f),ja(i);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")ro(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,ro(a);for(var m=a.firstChild;m;){var b=m.nextSibling,M=m.nodeName;m[gs]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&m.rel.toLowerCase()==="stylesheet"||a.removeChild(m),m=b}}else a==="body"&&ro(t.ownerDocument.body);a=f}while(a);ja(i)}function By(t,i){var a=t;t=0;do{var r=a.nextSibling;if(a.nodeType===1?i?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(i?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=r}while(a)}function Od(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var a=i;switch(i=i.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Od(a),wl(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function Rx(t,i,a,r){for(;t.nodeType===1;){var f=a;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!r&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(r){if(!t[gs])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(m=t.getAttribute("rel"),m==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(m!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(m=t.getAttribute("src"),(m!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===m)return t}else return t;if(t=pn(t.nextSibling),t===null)break}return null}function Bx(t,i,a){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=pn(t.nextSibling),t===null))return null;return t}function Ly(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=pn(t.nextSibling),t===null))return null;return t}function kd(t){return t.data==="$?"||t.data==="$~"}function jd(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Lx(t,i){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||a.readyState!=="loading")i();else{var r=function(){i(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),t._reactRetry=r}}function pn(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var zd=null;function Hy(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(i===0)return pn(t.nextSibling);i--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||i++}t=t.nextSibling}return null}function $y(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(i===0)return t;i--}else a!=="/$"&&a!=="/&"||i++}t=t.previousSibling}return null}function Uy(t,i,a){switch(i=ac(a),t){case"html":if(t=i.documentElement,!t)throw Error(l(452));return t;case"head":if(t=i.head,!t)throw Error(l(453));return t;case"body":if(t=i.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function ro(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);wl(t)}var yn=new Map,qy=new Set;function lc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var hi=$.d;$.d={f:Hx,r:$x,D:Ux,C:qx,L:Ix,m:Vx,X:Gx,S:Yx,M:Xx};function Hx(){var t=hi.f(),i=Jr();return t||i}function $x(t){var i=Ai(t);i!==null&&i.tag===5&&i.type==="form"?sp(i):hi.r(t)}var Ma=typeof document>"u"?null:document;function Iy(t,i,a){var r=Ma;if(r&&typeof i=="string"&&i){var f=Vt(i);f='link[rel="'+t+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),qy.has(f)||(qy.add(f),t={rel:t,crossOrigin:a,href:i},r.querySelector(f)===null&&(i=r.createElement("link"),Ct(i,"link",t),mt(i),r.head.appendChild(i)))}}function Ux(t){hi.D(t),Iy("dns-prefetch",t,null)}function qx(t,i){hi.C(t,i),Iy("preconnect",t,i)}function Ix(t,i,a){hi.L(t,i,a);var r=Ma;if(r&&t&&i){var f='link[rel="preload"][as="'+Vt(i)+'"]';i==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+Vt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+Vt(a.imageSizes)+'"]')):f+='[href="'+Vt(t)+'"]';var m=f;switch(i){case"style":m=Oa(t);break;case"script":m=ka(t)}yn.has(m)||(t=p({rel:"preload",href:i==="image"&&a&&a.imageSrcSet?void 0:t,as:i},a),yn.set(m,t),r.querySelector(f)!==null||i==="style"&&r.querySelector(co(m))||i==="script"&&r.querySelector(uo(m))||(i=r.createElement("link"),Ct(i,"link",t),mt(i),r.head.appendChild(i)))}}function Vx(t,i){hi.m(t,i);var a=Ma;if(a&&t){var r=i&&typeof i.as=="string"?i.as:"script",f='link[rel="modulepreload"][as="'+Vt(r)+'"][href="'+Vt(t)+'"]',m=f;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=ka(t)}if(!yn.has(m)&&(t=p({rel:"modulepreload",href:t},i),yn.set(m,t),a.querySelector(f)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(uo(m)))return}r=a.createElement("link"),Ct(r,"link",t),mt(r),a.head.appendChild(r)}}}function Yx(t,i,a){hi.S(t,i,a);var r=Ma;if(r&&t){var f=Ci(r).hoistableStyles,m=Oa(t);i=i||"default";var b=f.get(m);if(!b){var M={loading:0,preload:null};if(b=r.querySelector(co(m)))M.loading=5;else{t=p({rel:"stylesheet",href:t,"data-precedence":i},a),(a=yn.get(m))&&Dd(t,a);var U=b=r.createElement("link");mt(U),Ct(U,"link",t),U._p=new Promise(function(F,oe){U.onload=F,U.onerror=oe}),U.addEventListener("load",function(){M.loading|=1}),U.addEventListener("error",function(){M.loading|=2}),M.loading|=4,oc(b,i,r)}b={type:"stylesheet",instance:b,count:1,state:M},f.set(m,b)}}}function Gx(t,i){hi.X(t,i);var a=Ma;if(a&&t){var r=Ci(a).hoistableScripts,f=ka(t),m=r.get(f);m||(m=a.querySelector(uo(f)),m||(t=p({src:t,async:!0},i),(i=yn.get(f))&&Rd(t,i),m=a.createElement("script"),mt(m),Ct(m,"link",t),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},r.set(f,m))}}function Xx(t,i){hi.M(t,i);var a=Ma;if(a&&t){var r=Ci(a).hoistableScripts,f=ka(t),m=r.get(f);m||(m=a.querySelector(uo(f)),m||(t=p({src:t,async:!0,type:"module"},i),(i=yn.get(f))&&Rd(t,i),m=a.createElement("script"),mt(m),Ct(m,"link",t),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},r.set(f,m))}}function Vy(t,i,a,r){var f=(f=de.current)?lc(f):null;if(!f)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(i=Oa(a.href),a=Ci(f).hoistableStyles,r=a.get(i),r||(r={type:"style",instance:null,count:0,state:null},a.set(i,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=Oa(a.href);var m=Ci(f).hoistableStyles,b=m.get(t);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,b),(m=f.querySelector(co(t)))&&!m._p&&(b.instance=m,b.state.loading=5),yn.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},yn.set(t,a),m||Kx(f,t,a,b.state))),i&&r===null)throw Error(l(528,""));return b}if(i&&r!==null)throw Error(l(529,""));return null;case"script":return i=a.async,a=a.src,typeof a=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ka(a),a=Ci(f).hoistableScripts,r=a.get(i),r||(r={type:"script",instance:null,count:0,state:null},a.set(i,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function Oa(t){return'href="'+Vt(t)+'"'}function co(t){return'link[rel="stylesheet"]['+t+"]"}function Yy(t){return p({},t,{"data-precedence":t.precedence,precedence:null})}function Kx(t,i,a,r){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?r.loading=1:(i=t.createElement("link"),r.preload=i,i.addEventListener("load",function(){return r.loading|=1}),i.addEventListener("error",function(){return r.loading|=2}),Ct(i,"link",a),mt(i),t.head.appendChild(i))}function ka(t){return'[src="'+Vt(t)+'"]'}function uo(t){return"script[async]"+t}function Gy(t,i,a){if(i.count++,i.instance===null)switch(i.type){case"style":var r=t.querySelector('style[data-href~="'+Vt(a.href)+'"]');if(r)return i.instance=r,mt(r),r;var f=p({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(t.ownerDocument||t).createElement("style"),mt(r),Ct(r,"style",f),oc(r,a.precedence,t),i.instance=r;case"stylesheet":f=Oa(a.href);var m=t.querySelector(co(f));if(m)return i.state.loading|=4,i.instance=m,mt(m),m;r=Yy(a),(f=yn.get(f))&&Dd(r,f),m=(t.ownerDocument||t).createElement("link"),mt(m);var b=m;return b._p=new Promise(function(M,U){b.onload=M,b.onerror=U}),Ct(m,"link",r),i.state.loading|=4,oc(m,a.precedence,t),i.instance=m;case"script":return m=ka(a.src),(f=t.querySelector(uo(m)))?(i.instance=f,mt(f),f):(r=a,(f=yn.get(m))&&(r=p({},a),Rd(r,f)),t=t.ownerDocument||t,f=t.createElement("script"),mt(f),Ct(f,"link",r),t.head.appendChild(f),i.instance=f);case"void":return null;default:throw Error(l(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(r=i.instance,i.state.loading|=4,oc(r,a.precedence,t));return i.instance}function oc(t,i,a){for(var r=a.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 M=r[b];if(M.dataset.precedence===i)m=M;else if(m!==f)break}m?m.parentNode.insertBefore(t,m.nextSibling):(i=a.nodeType===9?a.head:a,i.insertBefore(t,i.firstChild))}function Dd(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function Rd(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var rc=null;function Xy(t,i,a){if(rc===null){var r=new Map,f=rc=new Map;f.set(a,r)}else f=rc,r=f.get(a),r||(r=new Map,f.set(a,r));if(r.has(t))return r;for(r.set(t,null),a=a.getElementsByTagName(t),f=0;f<a.length;f++){var m=a[f];if(!(m[gs]||m[wt]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(i)||"";b=t+b;var M=r.get(b);M?M.push(m):r.set(b,[m])}}return r}function Ky(t,i,a){t=t.ownerDocument||t,t.head.insertBefore(a,i==="title"?t.querySelector("head > title"):null)}function Qx(t,i,a){if(a===1||i.itemProp!=null)return!1;switch(t){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"?(t=i.disabled,typeof i.precedence=="string"&&t==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 Qy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Zx(t,i,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var f=Oa(r.href),m=i.querySelector(co(f));if(m){i=m._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=cc.bind(t),i.then(t,t)),a.state.loading|=4,a.instance=m,mt(m);return}m=i.ownerDocument||i,r=Yy(r),(f=yn.get(f))&&Dd(r,f),m=m.createElement("link"),mt(m);var b=m;b._p=new Promise(function(M,U){b.onload=M,b.onerror=U}),Ct(m,"link",r),a.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,i),(i=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=cc.bind(t),i.addEventListener("load",a),i.addEventListener("error",a))}}var Bd=0;function Fx(t,i){return t.stylesheets&&t.count===0&&fc(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var r=setTimeout(function(){if(t.stylesheets&&fc(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+i);0<t.imgBytes&&Bd===0&&(Bd=62500*Ox());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&fc(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>Bd?50:800)+i);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(f)}}:null}function cc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var uc=null;function fc(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,uc=new Map,i.forEach(Jx,t),uc=null,cc.call(t))}function Jx(t,i){if(!(i.state.loading&4)){var a=uc.get(t);if(a)var r=a.get(null);else{a=new Map,uc.set(t,a);for(var f=t.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")&&(a.set(b.dataset.precedence,b),r=b)}r&&a.set(null,r)}f=i.instance,b=f.getAttribute("data-precedence"),m=a.get(b)||r,m===r&&a.set(null,f),a.set(b,f),this.count++,r=cc.bind(this),f.addEventListener("load",r),f.addEventListener("error",r),m?m.parentNode.insertBefore(f,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),i.state.loading|=4}}var fo={$$typeof:_,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function Wx(t,i,a,r,f,m,b,M,U){this.tag=1,this.containerInfo=t,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=le(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=le(0),this.hiddenUpdates=le(null),this.identifierPrefix=r,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function Zy(t,i,a,r,f,m,b,M,U,F,oe,ce){return t=new Wx(t,i,a,b,U,F,oe,ce,M),i=1,m===!0&&(i|=24),m=en(3,null,null,i),t.current=m,m.stateNode=t,i=gf(),i.refCount++,t.pooledCache=i,i.refCount++,m.memoizedState={element:r,isDehydrated:a,cache:i},bf(m),t}function Fy(t){return t?(t=ra,t):ra}function Jy(t,i,a,r,f,m){f=Fy(f),r.context===null?r.context=f:r.pendingContext=f,r=Li(i),r.payload={element:a},m=m===void 0?null:m,m!==null&&(r.callback=m),a=Hi(t,r,i),a!==null&&(Zt(a,t,i),Vl(a,t,i))}function Wy(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<i?a:i}}function Ld(t,i){Wy(t,i),(t=t.alternate)&&Wy(t,i)}function Py(t){if(t.tag===13||t.tag===31){var i=bs(t,67108864);i!==null&&Zt(i,t,67108864),Ld(t,67108864)}}function e0(t){if(t.tag===13||t.tag===31){var i=ln();i=ms(i);var a=bs(t,i);a!==null&&Zt(a,t,i),Ld(t,i)}}var dc=!0;function Px(t,i,a,r){var f=j.T;j.T=null;var m=$.p;try{$.p=2,Hd(t,i,a,r)}finally{$.p=m,j.T=f}}function eE(t,i,a,r){var f=j.T;j.T=null;var m=$.p;try{$.p=8,Hd(t,i,a,r)}finally{$.p=m,j.T=f}}function Hd(t,i,a,r){if(dc){var f=$d(r);if(f===null)Nd(t,i,r,hc,a),n0(t,r);else if(nE(f,t,i,a,r))r.stopPropagation();else if(n0(t,r),i&4&&-1<tE.indexOf(t)){for(;f!==null;){var m=Ai(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=wn(m.pendingLanes);if(b!==0){var M=m;for(M.pendingLanes|=2,M.entangledLanes|=2;b;){var U=1<<31-Ge(b);M.entanglements[1]|=U,b&=~U}qn(m),($e&6)===0&&(Zr=st()+500,ao(0))}}break;case 31:case 13:M=bs(m,2),M!==null&&Zt(M,m,2),Jr(),Ld(m,2)}if(m=$d(r),m===null&&Nd(t,i,r,hc,a),m===f)break;f=m}f!==null&&r.stopPropagation()}else Nd(t,i,r,null,a)}}function $d(t){return t=Uu(t),Ud(t)}var hc=null;function Ud(t){if(hc=null,t=_i(t),t!==null){var i=c(t);if(i===null)t=null;else{var a=i.tag;if(a===13){if(t=u(i),t!==null)return t;t=null}else if(a===31){if(t=h(i),t!==null)return t;t=null}else if(a===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return hc=t,null}function t0(t){switch(t){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(zt()){case $t:return 2;case qe:return 8;case Nt:case fs:return 32;case Kn:return 268435456;default:return 32}default:return 32}}var qd=!1,Zi=null,Fi=null,Ji=null,ho=new Map,mo=new Map,Wi=[],tE="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 n0(t,i){switch(t){case"focusin":case"focusout":Zi=null;break;case"dragenter":case"dragleave":Fi=null;break;case"mouseover":case"mouseout":Ji=null;break;case"pointerover":case"pointerout":ho.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":mo.delete(i.pointerId)}}function go(t,i,a,r,f,m){return t===null||t.nativeEvent!==m?(t={blockedOn:i,domEventName:a,eventSystemFlags:r,nativeEvent:m,targetContainers:[f]},i!==null&&(i=Ai(i),i!==null&&Py(i)),t):(t.eventSystemFlags|=r,i=t.targetContainers,f!==null&&i.indexOf(f)===-1&&i.push(f),t)}function nE(t,i,a,r,f){switch(i){case"focusin":return Zi=go(Zi,t,i,a,r,f),!0;case"dragenter":return Fi=go(Fi,t,i,a,r,f),!0;case"mouseover":return Ji=go(Ji,t,i,a,r,f),!0;case"pointerover":var m=f.pointerId;return ho.set(m,go(ho.get(m)||null,t,i,a,r,f)),!0;case"gotpointercapture":return m=f.pointerId,mo.set(m,go(mo.get(m)||null,t,i,a,r,f)),!0}return!1}function i0(t){var i=_i(t.target);if(i!==null){var a=c(i);if(a!==null){if(i=a.tag,i===13){if(i=u(a),i!==null){t.blockedOn=i,nr(t.priority,function(){e0(a)});return}}else if(i===31){if(i=h(a),i!==null){t.blockedOn=i,nr(t.priority,function(){e0(a)});return}}else if(i===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function mc(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var a=$d(t.nativeEvent);if(a===null){a=t.nativeEvent;var r=new a.constructor(a.type,a);$u=r,a.target.dispatchEvent(r),$u=null}else return i=Ai(a),i!==null&&Py(i),t.blockedOn=a,!1;i.shift()}return!0}function s0(t,i,a){mc(t)&&a.delete(i)}function iE(){qd=!1,Zi!==null&&mc(Zi)&&(Zi=null),Fi!==null&&mc(Fi)&&(Fi=null),Ji!==null&&mc(Ji)&&(Ji=null),ho.forEach(s0),mo.forEach(s0)}function gc(t,i){t.blockedOn===i&&(t.blockedOn=null,qd||(qd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,iE)))}var pc=null;function a0(t){pc!==t&&(pc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){pc===t&&(pc=null);for(var i=0;i<t.length;i+=3){var a=t[i],r=t[i+1],f=t[i+2];if(typeof r!="function"){if(Ud(r||a)===null)continue;break}var m=Ai(a);m!==null&&(t.splice(i,3),i-=3,$f(m,{pending:!0,data:f,method:a.method,action:r},r,f))}}))}function ja(t){function i(U){return gc(U,t)}Zi!==null&&gc(Zi,t),Fi!==null&&gc(Fi,t),Ji!==null&&gc(Ji,t),ho.forEach(i),mo.forEach(i);for(var a=0;a<Wi.length;a++){var r=Wi[a];r.blockedOn===t&&(r.blockedOn=null)}for(;0<Wi.length&&(a=Wi[0],a.blockedOn===null);)i0(a),a.blockedOn===null&&Wi.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var f=a[r],m=a[r+1],b=f[Ot]||null;if(typeof m=="function")b||a0(a);else if(b){var M=null;if(m&&m.hasAttribute("formAction")){if(f=m,b=m[Ot]||null)M=b.formAction;else if(Ud(f)!==null)continue}else M=b.action;typeof M=="function"?a[r+1]=M:(a.splice(r,3),r-=3),a0(a)}}}function l0(){function t(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(a,20)}function a(){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",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),f!==null&&(f(),f=null)}}}function Id(t){this._internalRoot=t}yc.prototype.render=Id.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(l(409));var a=i.current,r=ln();Jy(a,r,t,i,null,null)},yc.prototype.unmount=Id.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;Jy(t.current,2,null,t,null,null),Jr(),i[Zn]=null}};function yc(t){this._internalRoot=t}yc.prototype.unstable_scheduleHydration=function(t){if(t){var i=tr();t={blockedOn:null,target:t,priority:i};for(var a=0;a<Wi.length&&i!==0&&i<Wi[a].priority;a++);Wi.splice(a,0,t),a===0&&i0(t)}};var o0=n.version;if(o0!=="19.2.7")throw Error(l(527,o0,"19.2.7"));$.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=g(i),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var sE={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vc.isDisabled&&vc.supportsFiber)try{Bn=vc.inject(sE),at=vc}catch{}}return yo.createRoot=function(t,i){if(!o(t))throw Error(l(299));var a=!1,r="",f=mp,m=gp,b=pp;return i!=null&&(i.unstable_strictMode===!0&&(a=!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=Zy(t,1,!1,null,null,a,r,null,f,m,b,l0),t[Zn]=i.current,Ed(t),new Id(i)},yo.hydrateRoot=function(t,i,a){if(!o(t))throw Error(l(299));var r=!1,f="",m=mp,b=gp,M=pp,U=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(m=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(M=a.onRecoverableError),a.formState!==void 0&&(U=a.formState)),i=Zy(t,1,!0,i,a??null,r,f,U,m,b,M,l0),i.context=Fy(null),a=i.current,r=ln(),r=ms(r),f=Li(r),f.callback=null,Hi(a,f,r),a=r,i.current.lanes=a,me(i,a),qn(i),t[Zn]=i.current,Ed(t),new yc(i)},yo.version="19.2.7",yo}var y0;function hE(){if(y0)return Gd.exports;y0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Gd.exports=dE(),Gd.exports}var mE=hE();function bt(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let s=0,l;s<e.length;s++)(l=bt(e[s]))!==""&&(n+=(n&&" ")+l);else for(let s in e)e[s]&&(n+=(n&&" ")+s);return n}var gE={value:()=>{}};function ru(){for(var e=0,n=arguments.length,s={},l;e<n;++e){if(!(l=arguments[e]+"")||l in s||/[\s.]/.test(l))throw new Error("illegal type: "+l);s[l]=[]}return new Dc(s)}function Dc(e){this._=e}function pE(e,n){return e.trim().split(/^|\s+/).map(function(s){var l="",o=s.indexOf(".");if(o>=0&&(l=s.slice(o+1),s=s.slice(0,o)),s&&!n.hasOwnProperty(s))throw new Error("unknown type: "+s);return{type:s,name:l}})}Dc.prototype=ru.prototype={constructor:Dc,on:function(e,n){var s=this._,l=pE(e+"",s),o,c=-1,u=l.length;if(arguments.length<2){for(;++c<u;)if((o=(e=l[c]).type)&&(o=yE(s[o],e.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++c<u;)if(o=(e=l[c]).type)s[o]=v0(s[o],e.name,n);else if(n==null)for(o in s)s[o]=v0(s[o],e.name,null);return this},copy:function(){var e={},n=this._;for(var s in n)e[s]=n[s].slice();return new Dc(e)},call:function(e,n){if((o=arguments.length-2)>0)for(var s=new Array(o),l=0,o,c;l<o;++l)s[l]=arguments[l+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(c=this._[e],l=0,o=c.length;l<o;++l)c[l].value.apply(n,s)},apply:function(e,n,s){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var l=this._[e],o=0,c=l.length;o<c;++o)l[o].value.apply(n,s)}};function yE(e,n){for(var s=0,l=e.length,o;s<l;++s)if((o=e[s]).name===n)return o.value}function v0(e,n,s){for(var l=0,o=e.length;l<o;++l)if(e[l].name===n){e[l]=gE,e=e.slice(0,l).concat(e.slice(l+1));break}return s!=null&&e.push({name:n,value:s}),e}var vh="http://www.w3.org/1999/xhtml";const b0={svg:"http://www.w3.org/2000/svg",xhtml:vh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function cu(e){var n=e+="",s=n.indexOf(":");return s>=0&&(n=e.slice(0,s))!=="xmlns"&&(e=e.slice(s+1)),b0.hasOwnProperty(n)?{space:b0[n],local:e}:e}function vE(e){return function(){var n=this.ownerDocument,s=this.namespaceURI;return s===vh&&n.documentElement.namespaceURI===vh?n.createElement(e):n.createElementNS(s,e)}}function bE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Jv(e){var n=cu(e);return(n.local?bE:vE)(n)}function SE(){}function Yh(e){return e==null?SE:function(){return this.querySelector(e)}}function wE(e){typeof e!="function"&&(e=Yh(e));for(var n=this._groups,s=n.length,l=new Array(s),o=0;o<s;++o)for(var c=n[o],u=c.length,h=l[o]=new Array(u),d,g,y=0;y<u;++y)(d=c[y])&&(g=e.call(d,d.__data__,y,c))&&("__data__"in d&&(g.__data__=d.__data__),h[y]=g);return new cn(l,this._parents)}function xE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function EE(){return[]}function Wv(e){return e==null?EE:function(){return this.querySelectorAll(e)}}function NE(e){return function(){return xE(e.apply(this,arguments))}}function _E(e){typeof e=="function"?e=NE(e):e=Wv(e);for(var n=this._groups,s=n.length,l=[],o=[],c=0;c<s;++c)for(var u=n[c],h=u.length,d,g=0;g<h;++g)(d=u[g])&&(l.push(e.call(d,d.__data__,g,u)),o.push(d));return new cn(l,o)}function Pv(e){return function(){return this.matches(e)}}function eb(e){return function(n){return n.matches(e)}}var AE=Array.prototype.find;function TE(e){return function(){return AE.call(this.children,e)}}function CE(){return this.firstElementChild}function ME(e){return this.select(e==null?CE:TE(typeof e=="function"?e:eb(e)))}var OE=Array.prototype.filter;function kE(){return Array.from(this.children)}function jE(e){return function(){return OE.call(this.children,e)}}function zE(e){return this.selectAll(e==null?kE:jE(typeof e=="function"?e:eb(e)))}function DE(e){typeof e!="function"&&(e=Pv(e));for(var n=this._groups,s=n.length,l=new Array(s),o=0;o<s;++o)for(var c=n[o],u=c.length,h=l[o]=[],d,g=0;g<u;++g)(d=c[g])&&e.call(d,d.__data__,g,c)&&h.push(d);return new cn(l,this._parents)}function tb(e){return new Array(e.length)}function RE(){return new cn(this._enter||this._groups.map(tb),this._parents)}function Xc(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Xc.prototype={constructor:Xc,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function BE(e){return function(){return e}}function LE(e,n,s,l,o,c){for(var u=0,h,d=n.length,g=c.length;u<g;++u)(h=n[u])?(h.__data__=c[u],l[u]=h):s[u]=new Xc(e,c[u]);for(;u<d;++u)(h=n[u])&&(o[u]=h)}function HE(e,n,s,l,o,c,u){var h,d,g=new Map,y=n.length,p=c.length,v=new Array(y),w;for(h=0;h<y;++h)(d=n[h])&&(v[h]=w=u.call(d,d.__data__,h,n)+"",g.has(w)?o[h]=d:g.set(w,d));for(h=0;h<p;++h)w=u.call(e,c[h],h,c)+"",(d=g.get(w))?(l[h]=d,d.__data__=c[h],g.delete(w)):s[h]=new Xc(e,c[h]);for(h=0;h<y;++h)(d=n[h])&&g.get(v[h])===d&&(o[h]=d)}function $E(e){return e.__data__}function UE(e,n){if(!arguments.length)return Array.from(this,$E);var s=n?HE:LE,l=this._parents,o=this._groups;typeof e!="function"&&(e=BE(e));for(var c=o.length,u=new Array(c),h=new Array(c),d=new Array(c),g=0;g<c;++g){var y=l[g],p=o[g],v=p.length,w=qE(e.call(y,y&&y.__data__,g,l)),E=w.length,N=h[g]=new Array(E),A=u[g]=new Array(E),C=d[g]=new Array(v);s(y,p,N,A,C,w,n);for(var z=0,_=0,x,T;z<E;++z)if(x=N[z]){for(z>=_&&(_=z+1);!(T=A[_])&&++_<E;);x._next=T||null}}return u=new cn(u,l),u._enter=h,u._exit=d,u}function qE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function IE(){return new cn(this._exit||this._groups.map(tb),this._parents)}function VE(e,n,s){var l=this.enter(),o=this,c=this.exit();return typeof e=="function"?(l=e(l),l&&(l=l.selection())):l=l.append(e+""),n!=null&&(o=n(o),o&&(o=o.selection())),s==null?c.remove():s(c),l&&o?l.merge(o).order():o}function YE(e){for(var n=e.selection?e.selection():e,s=this._groups,l=n._groups,o=s.length,c=l.length,u=Math.min(o,c),h=new Array(o),d=0;d<u;++d)for(var g=s[d],y=l[d],p=g.length,v=h[d]=new Array(p),w,E=0;E<p;++E)(w=g[E]||y[E])&&(v[E]=w);for(;d<o;++d)h[d]=s[d];return new cn(h,this._parents)}function GE(){for(var e=this._groups,n=-1,s=e.length;++n<s;)for(var l=e[n],o=l.length-1,c=l[o],u;--o>=0;)(u=l[o])&&(c&&u.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(u,c),c=u);return this}function XE(e){e||(e=KE);function n(p,v){return p&&v?e(p.__data__,v.__data__):!p-!v}for(var s=this._groups,l=s.length,o=new Array(l),c=0;c<l;++c){for(var u=s[c],h=u.length,d=o[c]=new Array(h),g,y=0;y<h;++y)(g=u[y])&&(d[y]=g);d.sort(n)}return new cn(o,this._parents).order()}function KE(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function QE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ZE(){return Array.from(this)}function FE(){for(var e=this._groups,n=0,s=e.length;n<s;++n)for(var l=e[n],o=0,c=l.length;o<c;++o){var u=l[o];if(u)return u}return null}function JE(){let e=0;for(const n of this)++e;return e}function WE(){return!this.node()}function PE(e){for(var n=this._groups,s=0,l=n.length;s<l;++s)for(var o=n[s],c=0,u=o.length,h;c<u;++c)(h=o[c])&&e.call(h,h.__data__,c,o);return this}function eN(e){return function(){this.removeAttribute(e)}}function tN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function nN(e,n){return function(){this.setAttribute(e,n)}}function iN(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function sN(e,n){return function(){var s=n.apply(this,arguments);s==null?this.removeAttribute(e):this.setAttribute(e,s)}}function aN(e,n){return function(){var s=n.apply(this,arguments);s==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,s)}}function lN(e,n){var s=cu(e);if(arguments.length<2){var l=this.node();return s.local?l.getAttributeNS(s.space,s.local):l.getAttribute(s)}return this.each((n==null?s.local?tN:eN:typeof n=="function"?s.local?aN:sN:s.local?iN:nN)(s,n))}function nb(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function oN(e){return function(){this.style.removeProperty(e)}}function rN(e,n,s){return function(){this.style.setProperty(e,n,s)}}function cN(e,n,s){return function(){var l=n.apply(this,arguments);l==null?this.style.removeProperty(e):this.style.setProperty(e,l,s)}}function uN(e,n,s){return arguments.length>1?this.each((n==null?oN:typeof n=="function"?cN:rN)(e,n,s??"")):Pa(this.node(),e)}function Pa(e,n){return e.style.getPropertyValue(n)||nb(e).getComputedStyle(e,null).getPropertyValue(n)}function fN(e){return function(){delete this[e]}}function dN(e,n){return function(){this[e]=n}}function hN(e,n){return function(){var s=n.apply(this,arguments);s==null?delete this[e]:this[e]=s}}function mN(e,n){return arguments.length>1?this.each((n==null?fN:typeof n=="function"?hN:dN)(e,n)):this.node()[e]}function ib(e){return e.trim().split(/^|\s+/)}function Gh(e){return e.classList||new sb(e)}function sb(e){this._node=e,this._names=ib(e.getAttribute("class")||"")}sb.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ab(e,n){for(var s=Gh(e),l=-1,o=n.length;++l<o;)s.add(n[l])}function lb(e,n){for(var s=Gh(e),l=-1,o=n.length;++l<o;)s.remove(n[l])}function gN(e){return function(){ab(this,e)}}function pN(e){return function(){lb(this,e)}}function yN(e,n){return function(){(n.apply(this,arguments)?ab:lb)(this,e)}}function vN(e,n){var s=ib(e+"");if(arguments.length<2){for(var l=Gh(this.node()),o=-1,c=s.length;++o<c;)if(!l.contains(s[o]))return!1;return!0}return this.each((typeof n=="function"?yN:n?gN:pN)(s,n))}function bN(){this.textContent=""}function SN(e){return function(){this.textContent=e}}function wN(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function xN(e){return arguments.length?this.each(e==null?bN:(typeof e=="function"?wN:SN)(e)):this.node().textContent}function EN(){this.innerHTML=""}function NN(e){return function(){this.innerHTML=e}}function _N(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function AN(e){return arguments.length?this.each(e==null?EN:(typeof e=="function"?_N:NN)(e)):this.node().innerHTML}function TN(){this.nextSibling&&this.parentNode.appendChild(this)}function CN(){return this.each(TN)}function MN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ON(){return this.each(MN)}function kN(e){var n=typeof e=="function"?e:Jv(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function jN(){return null}function zN(e,n){var s=typeof e=="function"?e:Jv(e),l=n==null?jN:typeof n=="function"?n:Yh(n);return this.select(function(){return this.insertBefore(s.apply(this,arguments),l.apply(this,arguments)||null)})}function DN(){var e=this.parentNode;e&&e.removeChild(this)}function RN(){return this.each(DN)}function BN(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function LN(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function HN(e){return this.select(e?LN:BN)}function $N(e){return arguments.length?this.property("__data__",e):this.node().__data__}function UN(e){return function(n){e.call(this,n,this.__data__)}}function qN(e){return e.trim().split(/^|\s+/).map(function(n){var s="",l=n.indexOf(".");return l>=0&&(s=n.slice(l+1),n=n.slice(0,l)),{type:n,name:s}})}function IN(e){return function(){var n=this.__on;if(n){for(var s=0,l=-1,o=n.length,c;s<o;++s)c=n[s],(!e.type||c.type===e.type)&&c.name===e.name?this.removeEventListener(c.type,c.listener,c.options):n[++l]=c;++l?n.length=l:delete this.__on}}}function VN(e,n,s){return function(){var l=this.__on,o,c=UN(n);if(l){for(var u=0,h=l.length;u<h;++u)if((o=l[u]).type===e.type&&o.name===e.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(e.type,c,s),o={type:e.type,name:e.name,value:n,listener:c,options:s},l?l.push(o):this.__on=[o]}}function YN(e,n,s){var l=qN(e+""),o,c=l.length,u;if(arguments.length<2){var h=this.node().__on;if(h){for(var d=0,g=h.length,y;d<g;++d)for(o=0,y=h[d];o<c;++o)if((u=l[o]).type===y.type&&u.name===y.name)return y.value}return}for(h=n?VN:IN,o=0;o<c;++o)this.each(h(l[o],n,s));return this}function ob(e,n,s){var l=nb(e),o=l.CustomEvent;typeof o=="function"?o=new o(n,s):(o=l.document.createEvent("Event"),s?(o.initEvent(n,s.bubbles,s.cancelable),o.detail=s.detail):o.initEvent(n,!1,!1)),e.dispatchEvent(o)}function GN(e,n){return function(){return ob(this,e,n)}}function XN(e,n){return function(){return ob(this,e,n.apply(this,arguments))}}function KN(e,n){return this.each((typeof n=="function"?XN:GN)(e,n))}function*QN(){for(var e=this._groups,n=0,s=e.length;n<s;++n)for(var l=e[n],o=0,c=l.length,u;o<c;++o)(u=l[o])&&(yield u)}var rb=[null];function cn(e,n){this._groups=e,this._parents=n}function Go(){return new cn([[document.documentElement]],rb)}function ZN(){return this}cn.prototype=Go.prototype={constructor:cn,select:wE,selectAll:_E,selectChild:ME,selectChildren:zE,filter:DE,data:UE,enter:RE,exit:IE,join:VE,merge:YE,selection:ZN,order:GE,sort:XE,call:QE,nodes:ZE,node:FE,size:JE,empty:WE,each:PE,attr:lN,style:uN,property:mN,classed:vN,text:xN,html:AN,raise:CN,lower:ON,append:kN,insert:zN,remove:RN,clone:HN,datum:$N,on:YN,dispatch:KN,[Symbol.iterator]:QN};function on(e){return typeof e=="string"?new cn([[document.querySelector(e)]],[document.documentElement]):new cn([[e]],rb)}function FN(e){let n;for(;n=e.sourceEvent;)e=n;return e}function Cn(e,n){if(e=FN(e),n===void 0&&(n=e.currentTarget),n){var s=n.ownerSVGElement||n;if(s.createSVGPoint){var l=s.createSVGPoint();return l.x=e.clientX,l.y=e.clientY,l=l.matrixTransform(n.getScreenCTM().inverse()),[l.x,l.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}}return[e.pageX,e.pageY]}const JN={passive:!1},Mo={capture:!0,passive:!1};function Zd(e){e.stopImmediatePropagation()}function Ga(e){e.preventDefault(),e.stopImmediatePropagation()}function cb(e){var n=e.document.documentElement,s=on(e).on("dragstart.drag",Ga,Mo);"onselectstart"in n?s.on("selectstart.drag",Ga,Mo):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function ub(e,n){var s=e.document.documentElement,l=on(e).on("dragstart.drag",null);n&&(l.on("click.drag",Ga,Mo),setTimeout(function(){l.on("click.drag",null)},0)),"onselectstart"in s?l.on("selectstart.drag",null):(s.style.MozUserSelect=s.__noselect,delete s.__noselect)}const bc=e=>()=>e;function bh(e,{sourceEvent:n,subject:s,target:l,identifier:o,active:c,x:u,y:h,dx:d,dy:g,dispatch:y}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:s,enumerable:!0,configurable:!0},target:{value:l,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:h,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:g,enumerable:!0,configurable:!0},_:{value:y}})}bh.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function WN(e){return!e.ctrlKey&&!e.button}function PN(){return this.parentNode}function e2(e,n){return n??{x:e.x,y:e.y}}function t2(){return navigator.maxTouchPoints||"ontouchstart"in this}function fb(){var e=WN,n=PN,s=e2,l=t2,o={},c=ru("start","drag","end"),u=0,h,d,g,y,p=0;function v(x){x.on("mousedown.drag",w).filter(l).on("touchstart.drag",A).on("touchmove.drag",C,JN).on("touchend.drag touchcancel.drag",z).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(x,T){if(!(y||!e.call(this,x,T))){var O=_(this,n.call(this,x,T),x,T,"mouse");O&&(on(x.view).on("mousemove.drag",E,Mo).on("mouseup.drag",N,Mo),cb(x.view),Zd(x),g=!1,h=x.clientX,d=x.clientY,O("start",x))}}function E(x){if(Ga(x),!g){var T=x.clientX-h,O=x.clientY-d;g=T*T+O*O>p}o.mouse("drag",x)}function N(x){on(x.view).on("mousemove.drag mouseup.drag",null),ub(x.view,g),Ga(x),o.mouse("end",x)}function A(x,T){if(e.call(this,x,T)){var O=x.changedTouches,D=n.call(this,x,T),R=O.length,q,P;for(q=0;q<R;++q)(P=_(this,D,x,T,O[q].identifier,O[q]))&&(Zd(x),P("start",x,O[q]))}}function C(x){var T=x.changedTouches,O=T.length,D,R;for(D=0;D<O;++D)(R=o[T[D].identifier])&&(Ga(x),R("drag",x,T[D]))}function z(x){var T=x.changedTouches,O=T.length,D,R;for(y&&clearTimeout(y),y=setTimeout(function(){y=null},500),D=0;D<O;++D)(R=o[T[D].identifier])&&(Zd(x),R("end",x,T[D]))}function _(x,T,O,D,R,q){var P=c.copy(),G=Cn(q||O,T),X,W,B;if((B=s.call(x,new bh("beforestart",{sourceEvent:O,target:v,identifier:R,active:u,x:G[0],y:G[1],dx:0,dy:0,dispatch:P}),D))!=null)return X=B.x-G[0]||0,W=B.y-G[1]||0,function K(j,$,L){var Y=G,ee;switch(j){case"start":o[R]=K,ee=u++;break;case"end":delete o[R],--u;case"drag":G=Cn(L||$,T),ee=u;break}P.call(j,x,new bh(j,{sourceEvent:$,subject:B,target:v,identifier:R,active:ee,x:G[0]+X,y:G[1]+W,dx:G[0]-Y[0],dy:G[1]-Y[1],dispatch:P}),D)}}return v.filter=function(x){return arguments.length?(e=typeof x=="function"?x:bc(!!x),v):e},v.container=function(x){return arguments.length?(n=typeof x=="function"?x:bc(x),v):n},v.subject=function(x){return arguments.length?(s=typeof x=="function"?x:bc(x),v):s},v.touchable=function(x){return arguments.length?(l=typeof x=="function"?x:bc(!!x),v):l},v.on=function(){var x=c.on.apply(c,arguments);return x===c?v:x},v.clickDistance=function(x){return arguments.length?(p=(x=+x)*x,v):Math.sqrt(p)},v}function Xh(e,n,s){e.prototype=n.prototype=s,s.constructor=e}function db(e,n){var s=Object.create(e.prototype);for(var l in n)s[l]=n[l];return s}function Xo(){}var Oo=.7,Kc=1/Oo,Xa="\\s*([+-]?\\d+)\\s*",ko="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Vn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",n2=/^#([0-9a-f]{3,8})$/,i2=new RegExp(`^rgb\\(${Xa},${Xa},${Xa}\\)$`),s2=new RegExp(`^rgb\\(${Vn},${Vn},${Vn}\\)$`),a2=new RegExp(`^rgba\\(${Xa},${Xa},${Xa},${ko}\\)$`),l2=new RegExp(`^rgba\\(${Vn},${Vn},${Vn},${ko}\\)$`),o2=new RegExp(`^hsl\\(${ko},${Vn},${Vn}\\)$`),r2=new RegExp(`^hsla\\(${ko},${Vn},${Vn},${ko}\\)$`),S0={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};Xh(Xo,$s,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:w0,formatHex:w0,formatHex8:c2,formatHsl:u2,formatRgb:x0,toString:x0});function w0(){return this.rgb().formatHex()}function c2(){return this.rgb().formatHex8()}function u2(){return hb(this).formatHsl()}function x0(){return this.rgb().formatRgb()}function $s(e){var n,s;return e=(e+"").trim().toLowerCase(),(n=n2.exec(e))?(s=n[1].length,n=parseInt(n[1],16),s===6?E0(n):s===3?new Jt(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):s===8?Sc(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):s===4?Sc(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=i2.exec(e))?new Jt(n[1],n[2],n[3],1):(n=s2.exec(e))?new Jt(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=a2.exec(e))?Sc(n[1],n[2],n[3],n[4]):(n=l2.exec(e))?Sc(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=o2.exec(e))?A0(n[1],n[2]/100,n[3]/100,1):(n=r2.exec(e))?A0(n[1],n[2]/100,n[3]/100,n[4]):S0.hasOwnProperty(e)?E0(S0[e]):e==="transparent"?new Jt(NaN,NaN,NaN,0):null}function E0(e){return new Jt(e>>16&255,e>>8&255,e&255,1)}function Sc(e,n,s,l){return l<=0&&(e=n=s=NaN),new Jt(e,n,s,l)}function f2(e){return e instanceof Xo||(e=$s(e)),e?(e=e.rgb(),new Jt(e.r,e.g,e.b,e.opacity)):new Jt}function Sh(e,n,s,l){return arguments.length===1?f2(e):new Jt(e,n,s,l??1)}function Jt(e,n,s,l){this.r=+e,this.g=+n,this.b=+s,this.opacity=+l}Xh(Jt,Sh,db(Xo,{brighter(e){return e=e==null?Kc:Math.pow(Kc,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Oo:Math.pow(Oo,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Jt(Ls(this.r),Ls(this.g),Ls(this.b),Qc(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:N0,formatHex:N0,formatHex8:d2,formatRgb:_0,toString:_0}));function N0(){return`#${zs(this.r)}${zs(this.g)}${zs(this.b)}`}function d2(){return`#${zs(this.r)}${zs(this.g)}${zs(this.b)}${zs((isNaN(this.opacity)?1:this.opacity)*255)}`}function _0(){const e=Qc(this.opacity);return`${e===1?"rgb(":"rgba("}${Ls(this.r)}, ${Ls(this.g)}, ${Ls(this.b)}${e===1?")":`, ${e})`}`}function Qc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ls(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zs(e){return e=Ls(e),(e<16?"0":"")+e.toString(16)}function A0(e,n,s,l){return l<=0?e=n=s=NaN:s<=0||s>=1?e=n=NaN:n<=0&&(e=NaN),new On(e,n,s,l)}function hb(e){if(e instanceof On)return new On(e.h,e.s,e.l,e.opacity);if(e instanceof Xo||(e=$s(e)),!e)return new On;if(e instanceof On)return e;e=e.rgb();var n=e.r/255,s=e.g/255,l=e.b/255,o=Math.min(n,s,l),c=Math.max(n,s,l),u=NaN,h=c-o,d=(c+o)/2;return h?(n===c?u=(s-l)/h+(s<l)*6:s===c?u=(l-n)/h+2:u=(n-s)/h+4,h/=d<.5?c+o:2-c-o,u*=60):h=d>0&&d<1?0:u,new On(u,h,d,e.opacity)}function h2(e,n,s,l){return arguments.length===1?hb(e):new On(e,n,s,l??1)}function On(e,n,s,l){this.h=+e,this.s=+n,this.l=+s,this.opacity=+l}Xh(On,h2,db(Xo,{brighter(e){return e=e==null?Kc:Math.pow(Kc,e),new On(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Oo:Math.pow(Oo,e),new On(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,s=this.l,l=s+(s<.5?s:1-s)*n,o=2*s-l;return new Jt(Fd(e>=240?e-240:e+120,o,l),Fd(e,o,l),Fd(e<120?e+240:e-120,o,l),this.opacity)},clamp(){return new On(T0(this.h),wc(this.s),wc(this.l),Qc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Qc(this.opacity);return`${e===1?"hsl(":"hsla("}${T0(this.h)}, ${wc(this.s)*100}%, ${wc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function T0(e){return e=(e||0)%360,e<0?e+360:e}function wc(e){return Math.max(0,Math.min(1,e||0))}function Fd(e,n,s){return(e<60?n+(s-n)*e/60:e<180?s:e<240?n+(s-n)*(240-e)/60:n)*255}const Kh=e=>()=>e;function m2(e,n){return function(s){return e+s*n}}function g2(e,n,s){return e=Math.pow(e,s),n=Math.pow(n,s)-e,s=1/s,function(l){return Math.pow(e+l*n,s)}}function p2(e){return(e=+e)==1?mb:function(n,s){return s-n?g2(n,s,e):Kh(isNaN(n)?s:n)}}function mb(e,n){var s=n-e;return s?m2(e,s):Kh(isNaN(e)?n:e)}const Zc=(function e(n){var s=p2(n);function l(o,c){var u=s((o=Sh(o)).r,(c=Sh(c)).r),h=s(o.g,c.g),d=s(o.b,c.b),g=mb(o.opacity,c.opacity);return function(y){return o.r=u(y),o.g=h(y),o.b=d(y),o.opacity=g(y),o+""}}return l.gamma=e,l})(1);function y2(e,n){n||(n=[]);var s=e?Math.min(n.length,e.length):0,l=n.slice(),o;return function(c){for(o=0;o<s;++o)l[o]=e[o]*(1-c)+n[o]*c;return l}}function v2(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function b2(e,n){var s=n?n.length:0,l=e?Math.min(s,e.length):0,o=new Array(l),c=new Array(s),u;for(u=0;u<l;++u)o[u]=_o(e[u],n[u]);for(;u<s;++u)c[u]=n[u];return function(h){for(u=0;u<l;++u)c[u]=o[u](h);return c}}function S2(e,n){var s=new Date;return e=+e,n=+n,function(l){return s.setTime(e*(1-l)+n*l),s}}function In(e,n){return e=+e,n=+n,function(s){return e*(1-s)+n*s}}function w2(e,n){var s={},l={},o;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(o in n)o in e?s[o]=_o(e[o],n[o]):l[o]=n[o];return function(c){for(o in s)l[o]=s[o](c);return l}}var wh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Jd=new RegExp(wh.source,"g");function x2(e){return function(){return e}}function E2(e){return function(n){return e(n)+""}}function gb(e,n){var s=wh.lastIndex=Jd.lastIndex=0,l,o,c,u=-1,h=[],d=[];for(e=e+"",n=n+"";(l=wh.exec(e))&&(o=Jd.exec(n));)(c=o.index)>s&&(c=n.slice(s,c),h[u]?h[u]+=c:h[++u]=c),(l=l[0])===(o=o[0])?h[u]?h[u]+=o:h[++u]=o:(h[++u]=null,d.push({i:u,x:In(l,o)})),s=Jd.lastIndex;return s<n.length&&(c=n.slice(s),h[u]?h[u]+=c:h[++u]=c),h.length<2?d[0]?E2(d[0].x):x2(n):(n=d.length,function(g){for(var y=0,p;y<n;++y)h[(p=d[y]).i]=p.x(g);return h.join("")})}function _o(e,n){var s=typeof n,l;return n==null||s==="boolean"?Kh(n):(s==="number"?In:s==="string"?(l=$s(n))?(n=l,Zc):gb:n instanceof $s?Zc:n instanceof Date?S2:v2(n)?y2:Array.isArray(n)?b2:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?w2:In)(e,n)}var C0=180/Math.PI,xh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function pb(e,n,s,l,o,c){var u,h,d;return(u=Math.sqrt(e*e+n*n))&&(e/=u,n/=u),(d=e*s+n*l)&&(s-=e*d,l-=n*d),(h=Math.sqrt(s*s+l*l))&&(s/=h,l/=h,d/=h),e*l<n*s&&(e=-e,n=-n,d=-d,u=-u),{translateX:o,translateY:c,rotate:Math.atan2(n,e)*C0,skewX:Math.atan(d)*C0,scaleX:u,scaleY:h}}var xc;function N2(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?xh:pb(n.a,n.b,n.c,n.d,n.e,n.f)}function _2(e){return e==null||(xc||(xc=document.createElementNS("http://www.w3.org/2000/svg","g")),xc.setAttribute("transform",e),!(e=xc.transform.baseVal.consolidate()))?xh:(e=e.matrix,pb(e.a,e.b,e.c,e.d,e.e,e.f))}function yb(e,n,s,l){function o(g){return g.length?g.pop()+" ":""}function c(g,y,p,v,w,E){if(g!==p||y!==v){var N=w.push("translate(",null,n,null,s);E.push({i:N-4,x:In(g,p)},{i:N-2,x:In(y,v)})}else(p||v)&&w.push("translate("+p+n+v+s)}function u(g,y,p,v){g!==y?(g-y>180?y+=360:y-g>180&&(g+=360),v.push({i:p.push(o(p)+"rotate(",null,l)-2,x:In(g,y)})):y&&p.push(o(p)+"rotate("+y+l)}function h(g,y,p,v){g!==y?v.push({i:p.push(o(p)+"skewX(",null,l)-2,x:In(g,y)}):y&&p.push(o(p)+"skewX("+y+l)}function d(g,y,p,v,w,E){if(g!==p||y!==v){var N=w.push(o(w)+"scale(",null,",",null,")");E.push({i:N-4,x:In(g,p)},{i:N-2,x:In(y,v)})}else(p!==1||v!==1)&&w.push(o(w)+"scale("+p+","+v+")")}return function(g,y){var p=[],v=[];return g=e(g),y=e(y),c(g.translateX,g.translateY,y.translateX,y.translateY,p,v),u(g.rotate,y.rotate,p,v),h(g.skewX,y.skewX,p,v),d(g.scaleX,g.scaleY,y.scaleX,y.scaleY,p,v),g=y=null,function(w){for(var E=-1,N=v.length,A;++E<N;)p[(A=v[E]).i]=A.x(w);return p.join("")}}}var A2=yb(N2,"px, ","px)","deg)"),T2=yb(_2,", ",")",")"),C2=1e-12;function M0(e){return((e=Math.exp(e))+1/e)/2}function M2(e){return((e=Math.exp(e))-1/e)/2}function O2(e){return((e=Math.exp(2*e))-1)/(e+1)}const Rc=(function e(n,s,l){function o(c,u){var h=c[0],d=c[1],g=c[2],y=u[0],p=u[1],v=u[2],w=y-h,E=p-d,N=w*w+E*E,A,C;if(N<C2)C=Math.log(v/g)/n,A=function(D){return[h+D*w,d+D*E,g*Math.exp(n*D*C)]};else{var z=Math.sqrt(N),_=(v*v-g*g+l*N)/(2*g*s*z),x=(v*v-g*g-l*N)/(2*v*s*z),T=Math.log(Math.sqrt(_*_+1)-_),O=Math.log(Math.sqrt(x*x+1)-x);C=(O-T)/n,A=function(D){var R=D*C,q=M0(T),P=g/(s*z)*(q*O2(n*R+T)-M2(T));return[h+P*w,d+P*E,g*q/M0(n*R+T)]}}return A.duration=C*1e3*n/Math.SQRT2,A}return o.rho=function(c){var u=Math.max(.001,+c),h=u*u,d=h*h;return e(u,h,d)},o})(Math.SQRT2,2,4);var el=0,wo=0,vo=0,vb=1e3,Fc,xo,Jc=0,Us=0,uu=0,jo=typeof performance=="object"&&performance.now?performance:Date,bb=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Qh(){return Us||(bb(k2),Us=jo.now()+uu)}function k2(){Us=0}function Wc(){this._call=this._time=this._next=null}Wc.prototype=Sb.prototype={constructor:Wc,restart:function(e,n,s){if(typeof e!="function")throw new TypeError("callback is not a function");s=(s==null?Qh():+s)+(n==null?0:+n),!this._next&&xo!==this&&(xo?xo._next=this:Fc=this,xo=this),this._call=e,this._time=s,Eh()},stop:function(){this._call&&(this._call=null,this._time=1/0,Eh())}};function Sb(e,n,s){var l=new Wc;return l.restart(e,n,s),l}function j2(){Qh(),++el;for(var e=Fc,n;e;)(n=Us-e._time)>=0&&e._call.call(void 0,n),e=e._next;--el}function O0(){Us=(Jc=jo.now())+uu,el=wo=0;try{j2()}finally{el=0,D2(),Us=0}}function z2(){var e=jo.now(),n=e-Jc;n>vb&&(uu-=n,Jc=e)}function D2(){for(var e,n=Fc,s,l=1/0;n;)n._call?(l>n._time&&(l=n._time),e=n,n=n._next):(s=n._next,n._next=null,n=e?e._next=s:Fc=s);xo=e,Eh(l)}function Eh(e){if(!el){wo&&(wo=clearTimeout(wo));var n=e-Us;n>24?(e<1/0&&(wo=setTimeout(O0,e-jo.now()-uu)),vo&&(vo=clearInterval(vo))):(vo||(Jc=jo.now(),vo=setInterval(z2,vb)),el=1,bb(O0))}}function k0(e,n,s){var l=new Wc;return n=n==null?0:+n,l.restart(o=>{l.stop(),e(o+n)},n,s),l}var R2=ru("start","end","cancel","interrupt"),B2=[],wb=0,j0=1,Nh=2,Bc=3,z0=4,_h=5,Lc=6;function fu(e,n,s,l,o,c){var u=e.__transition;if(!u)e.__transition={};else if(s in u)return;L2(e,s,{name:n,index:l,group:o,on:R2,tween:B2,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:wb})}function Zh(e,n){var s=Dn(e,n);if(s.state>wb)throw new Error("too late; already scheduled");return s}function Xn(e,n){var s=Dn(e,n);if(s.state>Bc)throw new Error("too late; already running");return s}function Dn(e,n){var s=e.__transition;if(!s||!(s=s[n]))throw new Error("transition not found");return s}function L2(e,n,s){var l=e.__transition,o;l[n]=s,s.timer=Sb(c,0,s.time);function c(g){s.state=j0,s.timer.restart(u,s.delay,s.time),s.delay<=g&&u(g-s.delay)}function u(g){var y,p,v,w;if(s.state!==j0)return d();for(y in l)if(w=l[y],w.name===s.name){if(w.state===Bc)return k0(u);w.state===z0?(w.state=Lc,w.timer.stop(),w.on.call("interrupt",e,e.__data__,w.index,w.group),delete l[y]):+y<n&&(w.state=Lc,w.timer.stop(),w.on.call("cancel",e,e.__data__,w.index,w.group),delete l[y])}if(k0(function(){s.state===Bc&&(s.state=z0,s.timer.restart(h,s.delay,s.time),h(g))}),s.state=Nh,s.on.call("start",e,e.__data__,s.index,s.group),s.state===Nh){for(s.state=Bc,o=new Array(v=s.tween.length),y=0,p=-1;y<v;++y)(w=s.tween[y].value.call(e,e.__data__,s.index,s.group))&&(o[++p]=w);o.length=p+1}}function h(g){for(var y=g<s.duration?s.ease.call(null,g/s.duration):(s.timer.restart(d),s.state=_h,1),p=-1,v=o.length;++p<v;)o[p].call(e,y);s.state===_h&&(s.on.call("end",e,e.__data__,s.index,s.group),d())}function d(){s.state=Lc,s.timer.stop(),delete l[n];for(var g in l)return;delete e.__transition}}function Hc(e,n){var s=e.__transition,l,o,c=!0,u;if(s){n=n==null?null:n+"";for(u in s){if((l=s[u]).name!==n){c=!1;continue}o=l.state>Nh&&l.state<_h,l.state=Lc,l.timer.stop(),l.on.call(o?"interrupt":"cancel",e,e.__data__,l.index,l.group),delete s[u]}c&&delete e.__transition}}function H2(e){return this.each(function(){Hc(this,e)})}function $2(e,n){var s,l;return function(){var o=Xn(this,e),c=o.tween;if(c!==s){l=s=c;for(var u=0,h=l.length;u<h;++u)if(l[u].name===n){l=l.slice(),l.splice(u,1);break}}o.tween=l}}function U2(e,n,s){var l,o;if(typeof s!="function")throw new Error;return function(){var c=Xn(this,e),u=c.tween;if(u!==l){o=(l=u).slice();for(var h={name:n,value:s},d=0,g=o.length;d<g;++d)if(o[d].name===n){o[d]=h;break}d===g&&o.push(h)}c.tween=o}}function q2(e,n){var s=this._id;if(e+="",arguments.length<2){for(var l=Dn(this.node(),s).tween,o=0,c=l.length,u;o<c;++o)if((u=l[o]).name===e)return u.value;return null}return this.each((n==null?$2:U2)(s,e,n))}function Fh(e,n,s){var l=e._id;return e.each(function(){var o=Xn(this,l);(o.value||(o.value={}))[n]=s.apply(this,arguments)}),function(o){return Dn(o,l).value[n]}}function xb(e,n){var s;return(typeof n=="number"?In:n instanceof $s?Zc:(s=$s(n))?(n=s,Zc):gb)(e,n)}function I2(e){return function(){this.removeAttribute(e)}}function V2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Y2(e,n,s){var l,o=s+"",c;return function(){var u=this.getAttribute(e);return u===o?null:u===l?c:c=n(l=u,s)}}function G2(e,n,s){var l,o=s+"",c;return function(){var u=this.getAttributeNS(e.space,e.local);return u===o?null:u===l?c:c=n(l=u,s)}}function X2(e,n,s){var l,o,c;return function(){var u,h=s(this),d;return h==null?void this.removeAttribute(e):(u=this.getAttribute(e),d=h+"",u===d?null:u===l&&d===o?c:(o=d,c=n(l=u,h)))}}function K2(e,n,s){var l,o,c;return function(){var u,h=s(this),d;return h==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),d=h+"",u===d?null:u===l&&d===o?c:(o=d,c=n(l=u,h)))}}function Q2(e,n){var s=cu(e),l=s==="transform"?T2:xb;return this.attrTween(e,typeof n=="function"?(s.local?K2:X2)(s,l,Fh(this,"attr."+e,n)):n==null?(s.local?V2:I2)(s):(s.local?G2:Y2)(s,l,n))}function Z2(e,n){return function(s){this.setAttribute(e,n.call(this,s))}}function F2(e,n){return function(s){this.setAttributeNS(e.space,e.local,n.call(this,s))}}function J2(e,n){var s,l;function o(){var c=n.apply(this,arguments);return c!==l&&(s=(l=c)&&F2(e,c)),s}return o._value=n,o}function W2(e,n){var s,l;function o(){var c=n.apply(this,arguments);return c!==l&&(s=(l=c)&&Z2(e,c)),s}return o._value=n,o}function P2(e,n){var s="attr."+e;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 l=cu(e);return this.tween(s,(l.local?J2:W2)(l,n))}function e_(e,n){return function(){Zh(this,e).delay=+n.apply(this,arguments)}}function t_(e,n){return n=+n,function(){Zh(this,e).delay=n}}function n_(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?e_:t_)(n,e)):Dn(this.node(),n).delay}function i_(e,n){return function(){Xn(this,e).duration=+n.apply(this,arguments)}}function s_(e,n){return n=+n,function(){Xn(this,e).duration=n}}function a_(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?i_:s_)(n,e)):Dn(this.node(),n).duration}function l_(e,n){if(typeof n!="function")throw new Error;return function(){Xn(this,e).ease=n}}function o_(e){var n=this._id;return arguments.length?this.each(l_(n,e)):Dn(this.node(),n).ease}function r_(e,n){return function(){var s=n.apply(this,arguments);if(typeof s!="function")throw new Error;Xn(this,e).ease=s}}function c_(e){if(typeof e!="function")throw new Error;return this.each(r_(this._id,e))}function u_(e){typeof e!="function"&&(e=Pv(e));for(var n=this._groups,s=n.length,l=new Array(s),o=0;o<s;++o)for(var c=n[o],u=c.length,h=l[o]=[],d,g=0;g<u;++g)(d=c[g])&&e.call(d,d.__data__,g,c)&&h.push(d);return new bi(l,this._parents,this._name,this._id)}function f_(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,s=e._groups,l=n.length,o=s.length,c=Math.min(l,o),u=new Array(l),h=0;h<c;++h)for(var d=n[h],g=s[h],y=d.length,p=u[h]=new Array(y),v,w=0;w<y;++w)(v=d[w]||g[w])&&(p[w]=v);for(;h<l;++h)u[h]=n[h];return new bi(u,this._parents,this._name,this._id)}function d_(e){return(e+"").trim().split(/^|\s+/).every(function(n){var s=n.indexOf(".");return s>=0&&(n=n.slice(0,s)),!n||n==="start"})}function h_(e,n,s){var l,o,c=d_(n)?Zh:Xn;return function(){var u=c(this,e),h=u.on;h!==l&&(o=(l=h).copy()).on(n,s),u.on=o}}function m_(e,n){var s=this._id;return arguments.length<2?Dn(this.node(),s).on.on(e):this.each(h_(s,e,n))}function g_(e){return function(){var n=this.parentNode;for(var s in this.__transition)if(+s!==e)return;n&&n.removeChild(this)}}function p_(){return this.on("end.remove",g_(this._id))}function y_(e){var n=this._name,s=this._id;typeof e!="function"&&(e=Yh(e));for(var l=this._groups,o=l.length,c=new Array(o),u=0;u<o;++u)for(var h=l[u],d=h.length,g=c[u]=new Array(d),y,p,v=0;v<d;++v)(y=h[v])&&(p=e.call(y,y.__data__,v,h))&&("__data__"in y&&(p.__data__=y.__data__),g[v]=p,fu(g[v],n,s,v,g,Dn(y,s)));return new bi(c,this._parents,n,s)}function v_(e){var n=this._name,s=this._id;typeof e!="function"&&(e=Wv(e));for(var l=this._groups,o=l.length,c=[],u=[],h=0;h<o;++h)for(var d=l[h],g=d.length,y,p=0;p<g;++p)if(y=d[p]){for(var v=e.call(y,y.__data__,p,d),w,E=Dn(y,s),N=0,A=v.length;N<A;++N)(w=v[N])&&fu(w,n,s,N,v,E);c.push(v),u.push(y)}return new bi(c,u,n,s)}var b_=Go.prototype.constructor;function S_(){return new b_(this._groups,this._parents)}function w_(e,n){var s,l,o;return function(){var c=Pa(this,e),u=(this.style.removeProperty(e),Pa(this,e));return c===u?null:c===s&&u===l?o:o=n(s=c,l=u)}}function Eb(e){return function(){this.style.removeProperty(e)}}function x_(e,n,s){var l,o=s+"",c;return function(){var u=Pa(this,e);return u===o?null:u===l?c:c=n(l=u,s)}}function E_(e,n,s){var l,o,c;return function(){var u=Pa(this,e),h=s(this),d=h+"";return h==null&&(d=h=(this.style.removeProperty(e),Pa(this,e))),u===d?null:u===l&&d===o?c:(o=d,c=n(l=u,h))}}function N_(e,n){var s,l,o,c="style."+n,u="end."+c,h;return function(){var d=Xn(this,e),g=d.on,y=d.value[c]==null?h||(h=Eb(n)):void 0;(g!==s||o!==y)&&(l=(s=g).copy()).on(u,o=y),d.on=l}}function __(e,n,s){var l=(e+="")=="transform"?A2:xb;return n==null?this.styleTween(e,w_(e,l)).on("end.style."+e,Eb(e)):typeof n=="function"?this.styleTween(e,E_(e,l,Fh(this,"style."+e,n))).each(N_(this._id,e)):this.styleTween(e,x_(e,l,n),s).on("end.style."+e,null)}function A_(e,n,s){return function(l){this.style.setProperty(e,n.call(this,l),s)}}function T_(e,n,s){var l,o;function c(){var u=n.apply(this,arguments);return u!==o&&(l=(o=u)&&A_(e,u,s)),l}return c._value=n,c}function C_(e,n,s){var l="style."+(e+="");if(arguments.length<2)return(l=this.tween(l))&&l._value;if(n==null)return this.tween(l,null);if(typeof n!="function")throw new Error;return this.tween(l,T_(e,n,s??""))}function M_(e){return function(){this.textContent=e}}function O_(e){return function(){var n=e(this);this.textContent=n??""}}function k_(e){return this.tween("text",typeof e=="function"?O_(Fh(this,"text",e)):M_(e==null?"":e+""))}function j_(e){return function(n){this.textContent=e.call(this,n)}}function z_(e){var n,s;function l(){var o=e.apply(this,arguments);return o!==s&&(n=(s=o)&&j_(o)),n}return l._value=e,l}function D_(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,z_(e))}function R_(){for(var e=this._name,n=this._id,s=Nb(),l=this._groups,o=l.length,c=0;c<o;++c)for(var u=l[c],h=u.length,d,g=0;g<h;++g)if(d=u[g]){var y=Dn(d,n);fu(d,e,s,g,u,{time:y.time+y.delay+y.duration,delay:0,duration:y.duration,ease:y.ease})}return new bi(l,this._parents,e,s)}function B_(){var e,n,s=this,l=s._id,o=s.size();return new Promise(function(c,u){var h={value:u},d={value:function(){--o===0&&c()}};s.each(function(){var g=Xn(this,l),y=g.on;y!==e&&(n=(e=y).copy(),n._.cancel.push(h),n._.interrupt.push(h),n._.end.push(d)),g.on=n}),o===0&&c()})}var L_=0;function bi(e,n,s,l){this._groups=e,this._parents=n,this._name=s,this._id=l}function Nb(){return++L_}var mi=Go.prototype;bi.prototype={constructor:bi,select:y_,selectAll:v_,selectChild:mi.selectChild,selectChildren:mi.selectChildren,filter:u_,merge:f_,selection:S_,transition:R_,call:mi.call,nodes:mi.nodes,node:mi.node,size:mi.size,empty:mi.empty,each:mi.each,on:m_,attr:Q2,attrTween:P2,style:__,styleTween:C_,text:k_,textTween:D_,remove:p_,tween:q2,delay:n_,duration:a_,ease:o_,easeVarying:c_,end:B_,[Symbol.iterator]:mi[Symbol.iterator]};function H_(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var $_={time:null,delay:0,duration:250,ease:H_};function U_(e,n){for(var s;!(s=e.__transition)||!(s=s[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return s}function q_(e){var n,s;e instanceof bi?(n=e._id,e=e._name):(n=Nb(),(s=$_).time=Qh(),e=e==null?null:e+"");for(var l=this._groups,o=l.length,c=0;c<o;++c)for(var u=l[c],h=u.length,d,g=0;g<h;++g)(d=u[g])&&fu(d,e,n,g,u,s||U_(d,n));return new bi(l,this._parents,e,n)}Go.prototype.interrupt=H2;Go.prototype.transition=q_;const Ec=e=>()=>e;function I_(e,{sourceEvent:n,target:s,transform:l,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},transform:{value:l,enumerable:!0,configurable:!0},_:{value:o}})}function pi(e,n,s){this.k=e,this.x=n,this.y=s}pi.prototype={constructor:pi,scale:function(e){return e===1?this:new pi(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new pi(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var du=new pi(1,0,0);_b.prototype=pi.prototype;function _b(e){for(;!e.__zoom;)if(!(e=e.parentNode))return du;return e.__zoom}function Wd(e){e.stopImmediatePropagation()}function bo(e){e.preventDefault(),e.stopImmediatePropagation()}function V_(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Y_(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function D0(){return this.__zoom||du}function G_(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function X_(){return navigator.maxTouchPoints||"ontouchstart"in this}function K_(e,n,s){var l=e.invertX(n[0][0])-s[0][0],o=e.invertX(n[1][0])-s[1][0],c=e.invertY(n[0][1])-s[0][1],u=e.invertY(n[1][1])-s[1][1];return e.translate(o>l?(l+o)/2:Math.min(0,l)||Math.max(0,o),u>c?(c+u)/2:Math.min(0,c)||Math.max(0,u))}function Ab(){var e=V_,n=Y_,s=K_,l=G_,o=X_,c=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],h=250,d=Rc,g=ru("start","zoom","end"),y,p,v,w=500,E=150,N=0,A=10;function C(B){B.property("__zoom",D0).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",q).on("dblclick.zoom",P).filter(o).on("touchstart.zoom",G).on("touchmove.zoom",X).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(B,K,j,$){var L=B.selection?B.selection():B;L.property("__zoom",D0),B!==L?T(B,K,j,$):L.interrupt().each(function(){O(this,arguments).event($).start().zoom(null,typeof K=="function"?K.apply(this,arguments):K).end()})},C.scaleBy=function(B,K,j,$){C.scaleTo(B,function(){var L=this.__zoom.k,Y=typeof K=="function"?K.apply(this,arguments):K;return L*Y},j,$)},C.scaleTo=function(B,K,j,$){C.transform(B,function(){var L=n.apply(this,arguments),Y=this.__zoom,ee=j==null?x(L):typeof j=="function"?j.apply(this,arguments):j,k=Y.invert(ee),H=typeof K=="function"?K.apply(this,arguments):K;return s(_(z(Y,H),ee,k),L,u)},j,$)},C.translateBy=function(B,K,j,$){C.transform(B,function(){return s(this.__zoom.translate(typeof K=="function"?K.apply(this,arguments):K,typeof j=="function"?j.apply(this,arguments):j),n.apply(this,arguments),u)},null,$)},C.translateTo=function(B,K,j,$,L){C.transform(B,function(){var Y=n.apply(this,arguments),ee=this.__zoom,k=$==null?x(Y):typeof $=="function"?$.apply(this,arguments):$;return s(du.translate(k[0],k[1]).scale(ee.k).translate(typeof K=="function"?-K.apply(this,arguments):-K,typeof j=="function"?-j.apply(this,arguments):-j),Y,u)},$,L)};function z(B,K){return K=Math.max(c[0],Math.min(c[1],K)),K===B.k?B:new pi(K,B.x,B.y)}function _(B,K,j){var $=K[0]-j[0]*B.k,L=K[1]-j[1]*B.k;return $===B.x&&L===B.y?B:new pi(B.k,$,L)}function x(B){return[(+B[0][0]+ +B[1][0])/2,(+B[0][1]+ +B[1][1])/2]}function T(B,K,j,$){B.on("start.zoom",function(){O(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){O(this,arguments).event($).end()}).tween("zoom",function(){var L=this,Y=arguments,ee=O(L,Y).event($),k=n.apply(L,Y),H=j==null?x(k):typeof j=="function"?j.apply(L,Y):j,ne=Math.max(k[1][0]-k[0][0],k[1][1]-k[0][1]),ae=L.__zoom,fe=typeof K=="function"?K.apply(L,Y):K,de=d(ae.invert(H).concat(ne/ae.k),fe.invert(H).concat(ne/fe.k));return function(se){if(se===1)se=fe;else{var te=de(se),ue=ne/te[2];se=new pi(ue,H[0]-te[0]*ue,H[1]-te[1]*ue)}ee.zoom(null,se)}})}function O(B,K,j){return!j&&B.__zooming||new D(B,K)}function D(B,K){this.that=B,this.args=K,this.active=0,this.sourceEvent=null,this.extent=n.apply(B,K),this.taps=0}D.prototype={event:function(B){return B&&(this.sourceEvent=B),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(B,K){return this.mouse&&B!=="mouse"&&(this.mouse[1]=K.invert(this.mouse[0])),this.touch0&&B!=="touch"&&(this.touch0[1]=K.invert(this.touch0[0])),this.touch1&&B!=="touch"&&(this.touch1[1]=K.invert(this.touch1[0])),this.that.__zoom=K,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(B){var K=on(this.that).datum();g.call(B,this.that,new I_(B,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:g}),K)}};function R(B,...K){if(!e.apply(this,arguments))return;var j=O(this,K).event(B),$=this.__zoom,L=Math.max(c[0],Math.min(c[1],$.k*Math.pow(2,l.apply(this,arguments)))),Y=Cn(B);if(j.wheel)(j.mouse[0][0]!==Y[0]||j.mouse[0][1]!==Y[1])&&(j.mouse[1]=$.invert(j.mouse[0]=Y)),clearTimeout(j.wheel);else{if($.k===L)return;j.mouse=[Y,$.invert(Y)],Hc(this),j.start()}bo(B),j.wheel=setTimeout(ee,E),j.zoom("mouse",s(_(z($,L),j.mouse[0],j.mouse[1]),j.extent,u));function ee(){j.wheel=null,j.end()}}function q(B,...K){if(v||!e.apply(this,arguments))return;var j=B.currentTarget,$=O(this,K,!0).event(B),L=on(B.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",ne,!0),Y=Cn(B,j),ee=B.clientX,k=B.clientY;cb(B.view),Wd(B),$.mouse=[Y,this.__zoom.invert(Y)],Hc(this),$.start();function H(ae){if(bo(ae),!$.moved){var fe=ae.clientX-ee,de=ae.clientY-k;$.moved=fe*fe+de*de>N}$.event(ae).zoom("mouse",s(_($.that.__zoom,$.mouse[0]=Cn(ae,j),$.mouse[1]),$.extent,u))}function ne(ae){L.on("mousemove.zoom mouseup.zoom",null),ub(ae.view,$.moved),bo(ae),$.event(ae).end()}}function P(B,...K){if(e.apply(this,arguments)){var j=this.__zoom,$=Cn(B.changedTouches?B.changedTouches[0]:B,this),L=j.invert($),Y=j.k*(B.shiftKey?.5:2),ee=s(_(z(j,Y),$,L),n.apply(this,K),u);bo(B),h>0?on(this).transition().duration(h).call(T,ee,$,B):on(this).call(C.transform,ee,$,B)}}function G(B,...K){if(e.apply(this,arguments)){var j=B.touches,$=j.length,L=O(this,K,B.changedTouches.length===$).event(B),Y,ee,k,H;for(Wd(B),ee=0;ee<$;++ee)k=j[ee],H=Cn(k,this),H=[H,this.__zoom.invert(H),k.identifier],L.touch0?!L.touch1&&L.touch0[2]!==H[2]&&(L.touch1=H,L.taps=0):(L.touch0=H,Y=!0,L.taps=1+!!y);y&&(y=clearTimeout(y)),Y&&(L.taps<2&&(p=H[0],y=setTimeout(function(){y=null},w)),Hc(this),L.start())}}function X(B,...K){if(this.__zooming){var j=O(this,K).event(B),$=B.changedTouches,L=$.length,Y,ee,k,H;for(bo(B),Y=0;Y<L;++Y)ee=$[Y],k=Cn(ee,this),j.touch0&&j.touch0[2]===ee.identifier?j.touch0[0]=k:j.touch1&&j.touch1[2]===ee.identifier&&(j.touch1[0]=k);if(ee=j.that.__zoom,j.touch1){var ne=j.touch0[0],ae=j.touch0[1],fe=j.touch1[0],de=j.touch1[1],se=(se=fe[0]-ne[0])*se+(se=fe[1]-ne[1])*se,te=(te=de[0]-ae[0])*te+(te=de[1]-ae[1])*te;ee=z(ee,Math.sqrt(se/te)),k=[(ne[0]+fe[0])/2,(ne[1]+fe[1])/2],H=[(ae[0]+de[0])/2,(ae[1]+de[1])/2]}else if(j.touch0)k=j.touch0[0],H=j.touch0[1];else return;j.zoom("touch",s(_(ee,k,H),j.extent,u))}}function W(B,...K){if(this.__zooming){var j=O(this,K).event(B),$=B.changedTouches,L=$.length,Y,ee;for(Wd(B),v&&clearTimeout(v),v=setTimeout(function(){v=null},w),Y=0;Y<L;++Y)ee=$[Y],j.touch0&&j.touch0[2]===ee.identifier?delete j.touch0:j.touch1&&j.touch1[2]===ee.identifier&&delete j.touch1;if(j.touch1&&!j.touch0&&(j.touch0=j.touch1,delete j.touch1),j.touch0)j.touch0[1]=this.__zoom.invert(j.touch0[0]);else if(j.end(),j.taps===2&&(ee=Cn(ee,this),Math.hypot(p[0]-ee[0],p[1]-ee[1])<A)){var k=on(this).on("dblclick.zoom");k&&k.apply(this,arguments)}}}return C.wheelDelta=function(B){return arguments.length?(l=typeof B=="function"?B:Ec(+B),C):l},C.filter=function(B){return arguments.length?(e=typeof B=="function"?B:Ec(!!B),C):e},C.touchable=function(B){return arguments.length?(o=typeof B=="function"?B:Ec(!!B),C):o},C.extent=function(B){return arguments.length?(n=typeof B=="function"?B:Ec([[+B[0][0],+B[0][1]],[+B[1][0],+B[1][1]]]),C):n},C.scaleExtent=function(B){return arguments.length?(c[0]=+B[0],c[1]=+B[1],C):[c[0],c[1]]},C.translateExtent=function(B){return arguments.length?(u[0][0]=+B[0][0],u[1][0]=+B[1][0],u[0][1]=+B[0][1],u[1][1]=+B[1][1],C):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},C.constrain=function(B){return arguments.length?(s=B,C):s},C.duration=function(B){return arguments.length?(h=+B,C):h},C.interpolate=function(B){return arguments.length?(d=B,C):d},C.on=function(){var B=g.on.apply(g,arguments);return B===g?C:B},C.clickDistance=function(B){return arguments.length?(N=(B=+B)*B,C):Math.sqrt(N)},C.tapDistance=function(B){return arguments.length?(A=+B,C):A},C}const zn={error001:(e="react")=>`Seems like you have not used zustand provider as an ancestor. Help: https://${e}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:e=>`Node type "${e}" 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:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:s,targetHandle:l})=>`Couldn't create edge for ${e} handle id: "${e==="source"?s:l}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},zo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Tb=["Enter"," ","Escape"],Cb={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:s})=>`Moved selected node ${e}. 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 tl;(function(e){e.Strict="strict",e.Loose="loose"})(tl||(tl={}));var Hs;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Hs||(Hs={}));var Do;(function(e){e.Partial="partial",e.Full="full"})(Do||(Do={}));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 ls;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ls||(ls={}));var Ro;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ro||(Ro={}));var he;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(he||(he={}));const R0={[he.Left]:he.Right,[he.Right]:he.Left,[he.Top]:he.Bottom,[he.Bottom]:he.Top};function Ob(e){return e===null?null:e?"valid":"invalid"}const kb=e=>"id"in e&&"source"in e&&"target"in e,Q_=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Jh=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ko=(e,n=[0,0])=>{const{width:s,height:l}=Si(e),o=e.origin??n,c=s*o[0],u=l*o[1];return{x:e.position.x-c,y:e.position.y-u}},Z_=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const s=e.reduce((l,o)=>{const c=typeof o=="string";let u=!n.nodeLookup&&!c?o:void 0;n.nodeLookup&&(u=c?n.nodeLookup.get(o):Jh(o)?o:n.nodeLookup.get(o.id));const h=u?Pc(u,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return hu(l,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return mu(s)},Qo=(e,n={})=>{let s={x:1/0,y:1/0,x2:-1/0,y2:-1/0},l=!1;return e.forEach(o=>{(n.filter===void 0||n.filter(o))&&(s=hu(s,Pc(o)),l=!0)}),l?mu(s):{x:0,y:0,width:0,height:0}},Wh=(e,n,[s,l,o]=[0,0,1],c=!1,u=!1)=>{const h={...cl(n,[s,l,o]),width:n.width/o,height:n.height/o},d=[];for(const g of e.values()){const{measured:y,selectable:p=!0,hidden:v=!1}=g;if(u&&!p||v)continue;const w=y.width??g.width??g.initialWidth??null,E=y.height??g.height??g.initialHeight??null,N=Bo(h,il(g)),A=(w??0)*(E??0),C=c&&N>0;(!g.internals.handleBounds||C||N>=A||g.dragging)&&d.push(g)}return d},F_=(e,n)=>{const s=new Set;return e.forEach(l=>{s.add(l.id)}),n.filter(l=>s.has(l.source)||s.has(l.target))};function J_(e,n){const s=new Map,l=n?.nodes?new Set(n.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&(n?.includeHiddenNodes||!o.hidden)&&(!l||l.has(o.id))&&s.set(o.id,o)}),s}async function W_({nodes:e,width:n,height:s,panZoom:l,minZoom:o,maxZoom:c},u){if(e.size===0)return!0;const h=J_(e,u),d=Qo(h),g=em(d,n,s,u?.minZoom??o,u?.maxZoom??c,u?.padding??.1);return await l.setViewport(g,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),!0}function jb({nodeId:e,nextPosition:n,nodeLookup:s,nodeOrigin:l=[0,0],nodeExtent:o,onError:c}){const u=s.get(e),h=u.parentId?s.get(u.parentId):void 0,{x:d,y:g}=h?h.internals.positionAbsolute:{x:0,y:0},y=u.origin??l;let p=u.extent||o;if(u.extent==="parent"&&!u.expandParent)if(!h)c?.("005",zn.error005());else{const w=h.measured.width,E=h.measured.height;w&&E&&(p=[[d,g],[d+w,g+E]])}else h&&Is(u.extent)&&(p=[[u.extent[0][0]+d,u.extent[0][1]+g],[u.extent[1][0]+d,u.extent[1][1]+g]]);const v=Is(p)?qs(n,p,u.measured):n;return(u.measured.width===void 0||u.measured.height===void 0)&&c?.("015",zn.error015()),{position:{x:v.x-d+(u.measured.width??0)*y[0],y:v.y-g+(u.measured.height??0)*y[1]},positionAbsolute:v}}async function P_({nodesToRemove:e=[],edgesToRemove:n=[],nodes:s,edges:l,onBeforeDelete:o}){const c=new Set(e.map(v=>v.id)),u=[];for(const v of s){if(v.deletable===!1)continue;const w=c.has(v.id),E=!w&&v.parentId&&u.find(N=>N.id===v.parentId);(w||E)&&u.push(v)}const h=new Set(n.map(v=>v.id)),d=l.filter(v=>v.deletable!==!1),y=F_(u,d);for(const v of d)h.has(v.id)&&!y.find(E=>E.id===v.id)&&y.push(v);if(!o)return{edges:y,nodes:u};const p=await o({nodes:u,edges:y});return typeof p=="boolean"?p?{edges:y,nodes:u}:{edges:[],nodes:[]}:p}const nl=(e,n=0,s=1)=>Math.min(Math.max(e,n),s),qs=(e={x:0,y:0},n,s)=>({x:nl(e.x,n[0][0],n[1][0]-(s?.width??0)),y:nl(e.y,n[0][1],n[1][1]-(s?.height??0))});function zb(e,n,s){const{width:l,height:o}=Si(s),{x:c,y:u}=s.internals.positionAbsolute;return qs(e,[[c,u],[c+l,u+o]],n)}const B0=(e,n,s)=>e<n?nl(Math.abs(e-n),1,n)/n:e>s?-nl(Math.abs(e-s),1,n)/n:0,Ph=(e,n,s=15,l=40)=>{const o=B0(e.x,l,n.width-l)*s,c=B0(e.y,l,n.height-l)*s;return[o,c]},hu=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),Ah=({x:e,y:n,width:s,height:l})=>({x:e,y:n,x2:e+s,y2:n+l}),mu=({x:e,y:n,x2:s,y2:l})=>({x:e,y:n,width:s-e,height:l-n}),il=(e,n=[0,0])=>{const{x:s,y:l}=Jh(e)?e.internals.positionAbsolute:Ko(e,n);return{x:s,y:l,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Pc=(e,n=[0,0])=>{const{x:s,y:l}=Jh(e)?e.internals.positionAbsolute:Ko(e,n);return{x:s,y:l,x2:s+(e.measured?.width??e.width??e.initialWidth??0),y2:l+(e.measured?.height??e.height??e.initialHeight??0)}},Db=(e,n)=>mu(hu(Ah(e),Ah(n))),Bo=(e,n)=>{const s=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),l=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(s*l)},L0=e=>kn(e.width)&&kn(e.height)&&kn(e.x)&&kn(e.y),kn=e=>!isNaN(e)&&isFinite(e),Rb=(e,n)=>(s,l)=>{},Zo=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),cl=({x:e,y:n},[s,l,o],c=!1,u=[1,1])=>{const h={x:(e-s)/o,y:(n-l)/o};return c?Zo(h,u):h},sl=({x:e,y:n},[s,l,o])=>({x:e*o+s,y:n*o+l});function za(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const s=parseFloat(e);if(!Number.isNaN(s))return Math.floor(s)}if(typeof e=="string"&&e.endsWith("%")){const s=parseFloat(e);if(!Number.isNaN(s))return Math.floor(n*s*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function eA(e,n,s){if(typeof e=="string"||typeof e=="number"){const l=za(e,s),o=za(e,n);return{top:l,right:o,bottom:l,left:o,x:o*2,y:l*2}}if(typeof e=="object"){const l=za(e.top??e.y??0,s),o=za(e.bottom??e.y??0,s),c=za(e.left??e.x??0,n),u=za(e.right??e.x??0,n);return{top:l,right:u,bottom:o,left:c,x:c+u,y:l+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function tA(e,n,s,l,o,c){const{x:u,y:h}=sl(e,[n,s,l]),{x:d,y:g}=sl({x:e.x+e.width,y:e.y+e.height},[n,s,l]),y=o-d,p=c-g;return{left:Math.floor(u),top:Math.floor(h),right:Math.floor(y),bottom:Math.floor(p)}}const em=(e,n,s,l,o,c)=>{const u=eA(c,n,s),h=(n-u.x)/e.width,d=(s-u.y)/e.height,g=Math.min(h,d),y=nl(g,l,o),p=e.x+e.width/2,v=e.y+e.height/2,w=n/2-p*y,E=s/2-v*y,N=tA(e,w,E,y,n,s),A={left:Math.min(N.left-u.left,0),top:Math.min(N.top-u.top,0),right:Math.min(N.right-u.right,0),bottom:Math.min(N.bottom-u.bottom,0)};return{x:w-A.left+A.right,y:E-A.top+A.bottom,zoom:y}},Lo=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Is(e){return e!=null&&e!=="parent"}function Si(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Bb(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Lb(e,n={width:0,height:0},s,l,o){const c={...e},u=l.get(s);if(u){const h=u.origin||o;c.x+=u.internals.positionAbsolute.x-(n.width??0)*h[0],c.y+=u.internals.positionAbsolute.y-(n.height??0)*h[1]}return c}function H0(e,n){if(e.size!==n.size)return!1;for(const s of e)if(!n.has(s))return!1;return!0}function nA(){let e,n;return{promise:new Promise((l,o)=>{e=l,n=o}),resolve:e,reject:n}}function iA(e){return{...Cb,...e||{}}}function Ao(e,{snapGrid:n=[0,0],snapToGrid:s=!1,transform:l,containerBounds:o}){const{x:c,y:u}=jn(e),h=cl({x:c-(o?.left??0),y:u-(o?.top??0)},l),{x:d,y:g}=s?Zo(h,n):h;return{xSnapped:d,ySnapped:g,...h}}const tm=e=>({width:e.offsetWidth,height:e.offsetHeight}),Hb=e=>e?.getRootNode?.()||window?.document,sA=["INPUT","SELECT","TEXTAREA"];function $b(e){const n=e.composedPath?.()?.[0]||e.target;return n?.nodeType!==1?!1:sA.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const Ub=e=>"clientX"in e,jn=(e,n)=>{const s=Ub(e),l=s?e.clientX:e.touches?.[0].clientX,o=s?e.clientY:e.touches?.[0].clientY;return{x:l-(n?.left??0),y:o-(n?.top??0)}},$0=(e,n,s,l,o)=>{const c=n.querySelectorAll(`.${e}`);return!c||!c.length?null:Array.from(c).map(u=>{const h=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:o,position:u.getAttribute("data-handlepos"),x:(h.left-s.left)/l,y:(h.top-s.top)/l,...tm(u)}})};function qb({sourceX:e,sourceY:n,targetX:s,targetY:l,sourceControlX:o,sourceControlY:c,targetControlX:u,targetControlY:h}){const d=e*.125+o*.375+u*.375+s*.125,g=n*.125+c*.375+h*.375+l*.125,y=Math.abs(d-e),p=Math.abs(g-n);return[d,g,y,p]}function Nc(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function U0({pos:e,x1:n,y1:s,x2:l,y2:o,c}){switch(e){case he.Left:return[n-Nc(n-l,c),s];case he.Right:return[n+Nc(l-n,c),s];case he.Top:return[n,s-Nc(s-o,c)];case he.Bottom:return[n,s+Nc(o-s,c)]}}function Ib({sourceX:e,sourceY:n,sourcePosition:s=he.Bottom,targetX:l,targetY:o,targetPosition:c=he.Top,curvature:u=.25}){const[h,d]=U0({pos:s,x1:e,y1:n,x2:l,y2:o,c:u}),[g,y]=U0({pos:c,x1:l,y1:o,x2:e,y2:n,c:u}),[p,v,w,E]=qb({sourceX:e,sourceY:n,targetX:l,targetY:o,sourceControlX:h,sourceControlY:d,targetControlX:g,targetControlY:y});return[`M${e},${n} C${h},${d} ${g},${y} ${l},${o}`,p,v,w,E]}function Vb({sourceX:e,sourceY:n,targetX:s,targetY:l}){const o=Math.abs(s-e)/2,c=s<e?s+o:s-o,u=Math.abs(l-n)/2,h=l<n?l+u:l-u;return[c,h,o,u]}function aA({sourceNode:e,targetNode:n,selected:s=!1,zIndex:l=0,elevateOnSelect:o=!1,zIndexMode:c="basic"}){if(c==="manual")return l;const u=o&&s?l+1e3:l,h=Math.max(e.parentId||o&&e.selected?e.internals.z:0,n.parentId||o&&n.selected?n.internals.z:0);return u+h}function lA({sourceNode:e,targetNode:n,width:s,height:l,transform:o}){const c=hu(Pc(e),Pc(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:l/o[2]};return Bo(u,mu(c))>0}const oA=({source:e,sourceHandle:n,target:s,targetHandle:l})=>`xy-edge__${e}${n||""}-${s}${l||""}`,rA=(e,n)=>n.some(s=>s.source===e.source&&s.target===e.target&&(s.sourceHandle===e.sourceHandle||!s.sourceHandle&&!e.sourceHandle)&&(s.targetHandle===e.targetHandle||!s.targetHandle&&!e.targetHandle)),cA=(e,n,s={})=>{if(!e.source||!e.target)return s.onError?.("006",zn.error006()),n;const l=s.getEdgeId||oA;let o;return kb(e)?o={...e}:o={...e,id:l(e)},rA(o,n)?n:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,n.concat(o))};function Yb({sourceX:e,sourceY:n,targetX:s,targetY:l}){const[o,c,u,h]=Vb({sourceX:e,sourceY:n,targetX:s,targetY:l});return[`M ${e},${n}L ${s},${l}`,o,c,u,h]}const q0={[he.Left]:{x:-1,y:0},[he.Right]:{x:1,y:0},[he.Top]:{x:0,y:-1},[he.Bottom]:{x:0,y:1}},uA=({source:e,sourcePosition:n=he.Bottom,target:s})=>n===he.Left||n===he.Right?e.x<s.x?{x:1,y:0}:{x:-1,y:0}:e.y<s.y?{x:0,y:1}:{x:0,y:-1},I0=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function fA({source:e,sourcePosition:n=he.Bottom,target:s,targetPosition:l=he.Top,center:o,offset:c,stepPosition:u}){const h=q0[n],d=q0[l],g={x:e.x+h.x*c,y:e.y+h.y*c},y={x:s.x+d.x*c,y:s.y+d.y*c},p=uA({source:g,sourcePosition:n,target:y}),v=p.x!==0?"x":"y",w=p[v];let E=[],N,A;const C={x:0,y:0},z={x:0,y:0},[,,_,x]=Vb({sourceX:e.x,sourceY:e.y,targetX:s.x,targetY:s.y});if(h[v]*d[v]===-1){v==="x"?(N=o.x??g.x+(y.x-g.x)*u,A=o.y??(g.y+y.y)/2):(N=o.x??(g.x+y.x)/2,A=o.y??g.y+(y.y-g.y)*u);const R=[{x:N,y:g.y},{x:N,y:y.y}],q=[{x:g.x,y:A},{x:y.x,y:A}];h[v]===w?E=v==="x"?R:q:E=v==="x"?q:R}else{const R=[{x:g.x,y:y.y}],q=[{x:y.x,y:g.y}];if(v==="x"?E=h.x===w?q:R:E=h.y===w?R:q,n===l){const B=Math.abs(e[v]-s[v]);if(B<=c){const K=Math.min(c-1,c-B);h[v]===w?C[v]=(g[v]>e[v]?-1:1)*K:z[v]=(y[v]>s[v]?-1:1)*K}}if(n!==l){const B=v==="x"?"y":"x",K=h[v]===d[B],j=g[B]>y[B],$=g[B]<y[B];(h[v]===1&&(!K&&j||K&&$)||h[v]!==1&&(!K&&$||K&&j))&&(E=v==="x"?R:q)}const P={x:g.x+C.x,y:g.y+C.y},G={x:y.x+z.x,y:y.y+z.y},X=Math.max(Math.abs(P.x-E[0].x),Math.abs(G.x-E[0].x)),W=Math.max(Math.abs(P.y-E[0].y),Math.abs(G.y-E[0].y));X>=W?(N=(P.x+G.x)/2,A=E[0].y):(N=E[0].x,A=(P.y+G.y)/2)}const T={x:g.x+C.x,y:g.y+C.y},O={x:y.x+z.x,y:y.y+z.y};return[[e,...T.x!==E[0].x||T.y!==E[0].y?[T]:[],...E,...O.x!==E[E.length-1].x||O.y!==E[E.length-1].y?[O]:[],s],N,A,_,x]}function dA(e,n,s,l){const o=Math.min(I0(e,n)/2,I0(n,s)/2,l),{x:c,y:u}=n;if(e.x===c&&c===s.x||e.y===u&&u===s.y)return`L${c} ${u}`;if(e.y===u){const g=e.x<s.x?-1:1,y=e.y<s.y?1:-1;return`L ${c+o*g},${u}Q ${c},${u} ${c},${u+o*y}`}const h=e.x<s.x?1:-1,d=e.y<s.y?-1:1;return`L ${c},${u+o*d}Q ${c},${u} ${c+o*h},${u}`}function Th({sourceX:e,sourceY:n,sourcePosition:s=he.Bottom,targetX:l,targetY:o,targetPosition:c=he.Top,borderRadius:u=5,centerX:h,centerY:d,offset:g=20,stepPosition:y=.5}){const[p,v,w,E,N]=fA({source:{x:e,y:n},sourcePosition:s,target:{x:l,y:o},targetPosition:c,center:{x:h,y:d},offset:g,stepPosition:y});let A=`M${p[0].x} ${p[0].y}`;for(let C=1;C<p.length-1;C++)A+=dA(p[C-1],p[C],p[C+1],u);return A+=`L${p[p.length-1].x} ${p[p.length-1].y}`,[A,v,w,E,N]}function V0(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function hA(e){const{sourceNode:n,targetNode:s}=e;if(!V0(n)||!V0(s))return null;const l=n.internals.handleBounds||Y0(n.handles),o=s.internals.handleBounds||Y0(s.handles),c=G0(l?.source??[],e.sourceHandle),u=G0(e.connectionMode===tl.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!c||!u)return e.onError?.("008",zn.error008(c?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const h=c?.position||he.Bottom,d=u?.position||he.Top,g=Vs(n,c,h),y=Vs(s,u,d);return{sourceX:g.x,sourceY:g.y,targetX:y.x,targetY:y.y,sourcePosition:h,targetPosition:d}}function Y0(e){if(!e)return null;const n=[],s=[];for(const l of e)l.width=l.width??1,l.height=l.height??1,l.type==="source"?n.push(l):l.type==="target"&&s.push(l);return{source:n,target:s}}function Vs(e,n,s=he.Left,l=!1){const o=(n?.x??0)+e.internals.positionAbsolute.x,c=(n?.y??0)+e.internals.positionAbsolute.y,{width:u,height:h}=n??Si(e);if(l)return{x:o+u/2,y:c+h/2};switch(n?.position??s){case he.Top:return{x:o+u/2,y:c};case he.Right:return{x:o+u,y:c+h/2};case he.Bottom:return{x:o+u/2,y:c+h};case he.Left:return{x:o,y:c+h/2}}}function G0(e,n){return e&&(n?e.find(s=>s.id===n):e[0])||null}function Ch(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(l=>`${l}=${e[l]}`).join("&")}`:""}function mA(e,{id:n,defaultColor:s,defaultMarkerStart:l,defaultMarkerEnd:o}){const c=new Set;return e.reduce((u,h)=>([h.markerStart||l,h.markerEnd||o].forEach(d=>{if(d&&typeof d=="object"){const g=Ch(d,n);c.has(g)||(u.push({id:g,color:d.color||s,...d}),c.add(g))}}),u),[]).sort((u,h)=>u.id.localeCompare(h.id))}const Gb=1e3,gA=10,nm={nodeOrigin:[0,0],nodeExtent:zo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},pA={...nm,checkEquality:!0};function im(e,n){const s={...e};for(const l in n)n[l]!==void 0&&(s[l]=n[l]);return s}function yA(e,n,s){const l=im(nm,s);for(const o of e.values())if(o.parentId)am(o,e,n,l);else{const c=Ko(o,l.nodeOrigin),u=Is(o.extent)?o.extent:l.nodeExtent,h=qs(c,u,Si(o));o.internals.positionAbsolute=h}}function vA(e,n){if(!e.handles)return e.measured?n?.internals.handleBounds:void 0;const s=[],l=[];for(const o of e.handles){const c={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?s.push(c):o.type==="target"&&l.push(c)}return{source:s,target:l}}function sm(e){return e==="manual"}function Mh(e,n,s,l={}){const o=im(pA,l),c={i:0},u=new Map(n),h=o?.elevateNodesOnSelect&&!sm(o.zIndexMode)?Gb:0;let d=e.length>0,g=!1;n.clear(),s.clear();for(const y of e){let p=u.get(y.id);if(o.checkEquality&&y===p?.internals.userNode)n.set(y.id,p);else{const v=Ko(y,o.nodeOrigin),w=Is(y.extent)?y.extent:o.nodeExtent,E=qs(v,w,Si(y));p={...o.defaults,...y,measured:{width:y.measured?.width,height:y.measured?.height},internals:{positionAbsolute:E,handleBounds:vA(y,p),z:Xb(y,h,o.zIndexMode),userNode:y}},n.set(y.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(d=!1),y.parentId&&am(p,n,s,l,c),g||=y.selected??!1}return{nodesInitialized:d,hasSelectedNodes:g}}function bA(e,n){if(!e.parentId)return;const s=n.get(e.parentId);s?s.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function am(e,n,s,l,o){const{elevateNodesOnSelect:c,nodeOrigin:u,nodeExtent:h,zIndexMode:d}=im(nm,l),g=e.parentId,y=n.get(g);if(!y){console.warn(`Parent node ${g} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}bA(e,s),o&&!y.parentId&&y.internals.rootParentIndex===void 0&&d==="auto"&&(y.internals.rootParentIndex=++o.i,y.internals.z=y.internals.z+o.i*gA),o&&y.internals.rootParentIndex!==void 0&&(o.i=y.internals.rootParentIndex);const p=c&&!sm(d)?Gb:0,{x:v,y:w,z:E}=SA(e,y,u,h,p,d),{positionAbsolute:N}=e.internals,A=v!==N.x||w!==N.y;(A||E!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:A?{x:v,y:w}:N,z:E}})}function Xb(e,n,s){const l=kn(e.zIndex)?e.zIndex:0;return sm(s)?l:l+(e.selected?n:0)}function SA(e,n,s,l,o,c){const{x:u,y:h}=n.internals.positionAbsolute,d=Si(e),g=Ko(e,s),y=Is(e.extent)?qs(g,e.extent,d):g;let p=qs({x:u+y.x,y:h+y.y},l,d);e.extent==="parent"&&(p=zb(p,d,n));const v=Xb(e,o,c),w=n.internals.z??0;return{x:p.x,y:p.y,z:w>=v?w+1:v}}function lm(e,n,s,l=[0,0]){const o=[],c=new Map;for(const u of e){const h=n.get(u.parentId);if(!h)continue;const d=c.get(u.parentId)?.expandedRect??il(h),g=Db(d,u.rect);c.set(u.parentId,{expandedRect:g,parent:h})}return c.size>0&&c.forEach(({expandedRect:u,parent:h},d)=>{const g=h.internals.positionAbsolute,y=Si(h),p=h.origin??l,v=u.x<g.x?Math.round(Math.abs(g.x-u.x)):0,w=u.y<g.y?Math.round(Math.abs(g.y-u.y)):0,E=Math.max(y.width,Math.round(u.width)),N=Math.max(y.height,Math.round(u.height)),A=(E-y.width)*p[0],C=(N-y.height)*p[1];(v>0||w>0||A||C)&&(o.push({id:d,type:"position",position:{x:h.position.x-v+A,y:h.position.y-w+C}}),s.get(d)?.forEach(z=>{e.some(_=>_.id===z.id)||o.push({id:z.id,type:"position",position:{x:z.position.x+v,y:z.position.y+w}})})),(y.width<u.width||y.height<u.height||v||w)&&o.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:E+(v?p[0]*v-A:0),height:N+(w?p[1]*w-C:0)}})}),o}function wA(e,n,s,l,o,c,u){const h=l?.querySelector(".xyflow__viewport");let d=!1;if(!h)return{changes:[],updatedInternals:d};const g=[],y=window.getComputedStyle(h),{m22:p}=new window.DOMMatrixReadOnly(y.transform),v=[];for(const w of e.values()){const E=n.get(w.id);if(!E)continue;if(E.hidden){n.set(E.id,{...E,internals:{...E.internals,handleBounds:void 0}}),d=!0;continue}const N=tm(w.nodeElement),A=E.measured.width!==N.width||E.measured.height!==N.height;if(!!(N.width&&N.height&&(A||!E.internals.handleBounds||w.force))){const z=w.nodeElement.getBoundingClientRect(),_=Is(E.extent)?E.extent:c;let{positionAbsolute:x}=E.internals;E.parentId&&E.extent==="parent"?x=zb(x,N,n.get(E.parentId)):_&&(x=qs(x,_,N));const T={...E,measured:N,internals:{...E.internals,positionAbsolute:x,handleBounds:{source:$0("source",w.nodeElement,z,p,E.id),target:$0("target",w.nodeElement,z,p,E.id)}}};n.set(E.id,T),E.parentId&&am(T,n,s,{nodeOrigin:o,zIndexMode:u}),d=!0,A&&(g.push({id:E.id,type:"dimensions",dimensions:N}),E.expandParent&&E.parentId&&v.push({id:E.id,parentId:E.parentId,rect:il(T,o)}))}}if(v.length>0){const w=lm(v,n,s,o);g.push(...w)}return{changes:g,updatedInternals:d}}async function xA({delta:e,panZoom:n,transform:s,translateExtent:l,width:o,height:c}){if(!n||!e.x&&!e.y)return!1;const u=await n.setViewportConstrained({x:s[0]+e.x,y:s[1]+e.y,zoom:s[2]},[[0,0],[o,c]],l);return!!u&&(u.x!==s[0]||u.y!==s[1]||u.k!==s[2])}function X0(e,n,s,l,o,c){let u=o;const h=l.get(u)||new Map;l.set(u,h.set(s,n)),u=`${o}-${e}`;const d=l.get(u)||new Map;if(l.set(u,d.set(s,n)),c){u=`${o}-${e}-${c}`;const g=l.get(u)||new Map;l.set(u,g.set(s,n))}}function Kb(e,n,s){e.clear(),n.clear();for(const l of s){const{source:o,target:c,sourceHandle:u=null,targetHandle:h=null}=l,d={edgeId:l.id,source:o,target:c,sourceHandle:u,targetHandle:h},g=`${o}-${u}--${c}-${h}`,y=`${c}-${h}--${o}-${u}`;X0("source",d,y,e,o,u),X0("target",d,g,e,c,h),n.set(l.id,l)}}function Qb(e,n){if(!e.parentId)return!1;const s=n.get(e.parentId);return s?s.selected?!0:Qb(s,n):!1}function K0(e,n,s){let l=e;do{if(l?.matches?.(n))return!0;if(l===s)return!1;l=l?.parentElement}while(l);return!1}function EA(e,n,s,l){const o=new Map;for(const[c,u]of e)if((u.selected||u.id===l)&&(!u.parentId||!Qb(u,e))&&(u.draggable||n&&typeof u.draggable>"u")){const h=e.get(c);h&&o.set(c,{id:c,position:h.position||{x:0,y:0},distance:{x:s.x-h.internals.positionAbsolute.x,y:s.y-h.internals.positionAbsolute.y},extent:h.extent,parentId:h.parentId,origin:h.origin,expandParent:h.expandParent,internals:{positionAbsolute:h.internals.positionAbsolute||{x:0,y:0}},measured:{width:h.measured.width??0,height:h.measured.height??0}})}return o}function Pd({nodeId:e,dragItems:n,nodeLookup:s,dragging:l=!0}){const o=[];for(const[u,h]of n){const d=s.get(u)?.internals.userNode;d&&o.push({...d,position:h.position,dragging:l})}if(!e)return[o[0],o];const c=s.get(e)?.internals.userNode;return[c?{...c,position:n.get(e)?.position||c.position,dragging:l}:o[0],o]}function NA({dragItems:e,snapGrid:n,x:s,y:l}){const o=e.values().next().value;if(!o)return null;const c={x:s-o.distance.x,y:l-o.distance.y},u=Zo(c,n);return{x:u.x-c.x,y:u.y-c.y}}function _A({onNodeMouseDown:e,getStoreItems:n,onDragStart:s,onDrag:l,onDragStop:o}){let c={x:null,y:null},u=0,h=new Map,d=!1,g={x:0,y:0},y=null,p=!1,v=null,w=!1,E=!1,N=null;function A({noDragClassName:z,handleSelector:_,domNode:x,isSelectable:T,nodeId:O,nodeClickDistance:D=0}){v=on(x);function R({x:X,y:W}){const{nodeLookup:B,nodeExtent:K,snapGrid:j,snapToGrid:$,nodeOrigin:L,onNodeDrag:Y,onSelectionDrag:ee,onError:k,updateNodePositions:H}=n();c={x:X,y:W};let ne=!1;const ae=h.size>1,fe=ae&&K?Ah(Qo(h)):null,de=ae&&$?NA({dragItems:h,snapGrid:j,x:X,y:W}):null;for(const[se,te]of h){if(!B.has(se))continue;let ue={x:X-te.distance.x,y:W-te.distance.y};$&&(ue=de?{x:Math.round(ue.x+de.x),y:Math.round(ue.y+de.y)}:Zo(ue,j));let Ee=null;if(ae&&K&&!te.extent&&fe){const{positionAbsolute:ve}=te.internals,xe=ve.x-fe.x+K[0][0],ze=ve.x+te.measured.width-fe.x2+K[1][0],Ye=ve.y-fe.y+K[0][1],St=ve.y+te.measured.height-fe.y2+K[1][1];Ee=[[xe,Ye],[ze,St]]}const{position:Se,positionAbsolute:ge}=jb({nodeId:se,nextPosition:ue,nodeLookup:B,nodeExtent:Ee||K,nodeOrigin:L,onError:k});ne=ne||te.position.x!==Se.x||te.position.y!==Se.y,te.position=Se,te.internals.positionAbsolute=ge}if(E=E||ne,!!ne&&(H(h,!0),N&&(l||Y||!O&&ee))){const[se,te]=Pd({nodeId:O,dragItems:h,nodeLookup:B});l?.(N,h,se,te),Y?.(N,se,te),O||ee?.(N,te)}}async function q(){if(!y)return;const{transform:X,panBy:W,autoPanSpeed:B,autoPanOnNodeDrag:K}=n();if(!K){d=!1,cancelAnimationFrame(u);return}const[j,$]=Ph(g,y,B);(j!==0||$!==0)&&(c.x=(c.x??0)-j/X[2],c.y=(c.y??0)-$/X[2],await W({x:j,y:$})&&R(c)),u=requestAnimationFrame(q)}function P(X){const{nodeLookup:W,multiSelectionActive:B,nodesDraggable:K,transform:j,snapGrid:$,snapToGrid:L,selectNodesOnDrag:Y,onNodeDragStart:ee,onSelectionDragStart:k,unselectNodesAndEdges:H}=n();p=!0,(!Y||!T)&&!B&&O&&(W.get(O)?.selected||H()),T&&Y&&O&&e?.(O);const ne=Ao(X.sourceEvent,{transform:j,snapGrid:$,snapToGrid:L,containerBounds:y});if(c=ne,h=EA(W,K,ne,O),h.size>0&&(s||ee||!O&&k)){const[ae,fe]=Pd({nodeId:O,dragItems:h,nodeLookup:W});s?.(X.sourceEvent,h,ae,fe),ee?.(X.sourceEvent,ae,fe),O||k?.(X.sourceEvent,fe)}}const G=fb().clickDistance(D).on("start",X=>{const{domNode:W,nodeDragThreshold:B,transform:K,snapGrid:j,snapToGrid:$}=n();y=W?.getBoundingClientRect()||null,w=!1,E=!1,N=X.sourceEvent,B===0&&P(X),c=Ao(X.sourceEvent,{transform:K,snapGrid:j,snapToGrid:$,containerBounds:y}),g=jn(X.sourceEvent,y)}).on("drag",X=>{const{autoPanOnNodeDrag:W,transform:B,snapGrid:K,snapToGrid:j,nodeDragThreshold:$,nodeLookup:L}=n(),Y=Ao(X.sourceEvent,{transform:B,snapGrid:K,snapToGrid:j,containerBounds:y});if(N=X.sourceEvent,(X.sourceEvent.type==="touchmove"&&X.sourceEvent.touches.length>1||O&&!L.has(O))&&(w=!0),!w){if(!d&&W&&p&&(d=!0,q()),!p){const ee=jn(X.sourceEvent,y),k=ee.x-g.x,H=ee.y-g.y;Math.sqrt(k*k+H*H)>$&&P(X)}(c.x!==Y.xSnapped||c.y!==Y.ySnapped)&&h&&p&&(g=jn(X.sourceEvent,y),R(Y))}}).on("end",X=>{if(!p||w){w&&h.size>0&&n().updateNodePositions(h,!1);return}if(d=!1,p=!1,cancelAnimationFrame(u),h.size>0){const{nodeLookup:W,updateNodePositions:B,onNodeDragStop:K,onSelectionDragStop:j}=n();if(E&&(B(h,!1),E=!1),o||K||!O&&j){const[$,L]=Pd({nodeId:O,dragItems:h,nodeLookup:W,dragging:!1});o?.(X.sourceEvent,h,$,L),K?.(X.sourceEvent,$,L),O||j?.(X.sourceEvent,L)}}}).filter(X=>{const W=X.target;return!X.button&&(!z||!K0(W,`.${z}`,x))&&(!_||K0(W,_,x))});v.call(G)}function C(){v?.on(".drag",null)}return{update:A,destroy:C}}function AA(e,n,s){const l=[],o={x:e.x-s,y:e.y-s,width:s*2,height:s*2};for(const c of n.values())Bo(o,il(c))>0&&l.push(c);return l}const TA=250;function CA(e,n,s,l){let o=[],c=1/0;const u=AA(e,s,n+TA);for(const h of u){const d=[...h.internals.handleBounds?.source??[],...h.internals.handleBounds?.target??[]];for(const g of d){if(l.nodeId===g.nodeId&&l.type===g.type&&l.id===g.id)continue;const{x:y,y:p}=Vs(h,g,g.position,!0),v=Math.sqrt(Math.pow(y-e.x,2)+Math.pow(p-e.y,2));v>n||(v<c?(o=[{...g,x:y,y:p}],c=v):v===c&&o.push({...g,x:y,y:p}))}}if(!o.length)return null;if(o.length>1){const h=l.type==="source"?"target":"source";return o.find(d=>d.type===h)??o[0]}return o[0]}function Zb(e,n,s,l,o,c=!1){const u=l.get(e);if(!u)return null;const h=o==="strict"?u.internals.handleBounds?.[n]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],d=(s?h?.find(g=>g.id===s):h?.[0])??null;return d&&c?{...d,...Vs(u,d,d.position,!0)}:d}function Fb(e,n){return e||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function MA(e,n){let s=null;return n?s=!0:e&&!n&&(s=!1),s}const Jb=()=>!0;function OA(e,{connectionMode:n,connectionRadius:s,handleId:l,nodeId:o,edgeUpdaterType:c,isTarget:u,domNode:h,nodeLookup:d,lib:g,autoPanOnConnect:y,flowId:p,panBy:v,cancelConnection:w,onConnectStart:E,onConnect:N,onConnectEnd:A,isValidConnection:C=Jb,onReconnectEnd:z,updateConnection:_,getTransform:x,getFromHandle:T,autoPanSpeed:O,dragThreshold:D=1,handleDomNode:R}){const q=Hb(e.target);let P=0,G;const{x:X,y:W}=jn(e),B=Fb(c,R),K=h?.getBoundingClientRect();let j=!1;if(!K||!B)return;const $=Zb(o,B,l,d,n);if(!$)return;let L=jn(e,K),Y=!1,ee=null,k=!1,H=null;function ne(){if(!y||!K)return;const[Se,ge]=Ph(L,K,O);v({x:Se,y:ge}),P=requestAnimationFrame(ne)}const ae={...$,nodeId:o,type:B,position:$.position},fe=d.get(o);let se={inProgress:!0,isValid:null,from:Vs(fe,ae,he.Left,!0),fromHandle:ae,fromPosition:ae.position,fromNode:fe,to:L,toHandle:null,toPosition:R0[ae.position],toNode:null,pointer:L};function te(){j=!0,_(se),E?.(e,{nodeId:o,handleId:l,handleType:B})}D===0&&te();function ue(Se){if(!j){const{x:St,y:rt}=jn(Se),ht=St-X,Mt=rt-W;if(!(ht*ht+Mt*Mt>D*D))return;te()}if(!T()||!ae){Ee(Se);return}const ge=x();L=jn(Se,K),G=CA(cl(L,ge,!1,[1,1]),s,d,ae),Y||(ne(),Y=!0);const ve=Wb(Se,{handle:G,connectionMode:n,fromNodeId:o,fromHandleId:l,fromType:u?"target":"source",isValidConnection:C,doc:q,lib:g,flowId:p,nodeLookup:d});H=ve.handleDomNode,ee=ve.connection,k=MA(!!G,ve.isValid);const xe=d.get(o),ze=xe?Vs(xe,ae,he.Left,!0):se.from,Ye={...se,from:ze,isValid:k,to:ve.toHandle&&k?sl({x:ve.toHandle.x,y:ve.toHandle.y},ge):L,toHandle:ve.toHandle,toPosition:k&&ve.toHandle?ve.toHandle.position:R0[ae.position],toNode:ve.toHandle?d.get(ve.toHandle.nodeId):null,pointer:L};_(Ye),se=Ye}function Ee(Se){if(!("touches"in Se&&Se.touches.length>0)){if(j){(G||H)&&ee&&k&&N?.(ee);const{inProgress:ge,...ve}=se,xe={...ve,toPosition:se.toHandle?se.toPosition:null};A?.(Se,xe),c&&z?.(Se,xe)}w(),cancelAnimationFrame(P),Y=!1,k=!1,ee=null,H=null,q.removeEventListener("mousemove",ue),q.removeEventListener("mouseup",Ee),q.removeEventListener("touchmove",ue),q.removeEventListener("touchend",Ee)}}q.addEventListener("mousemove",ue),q.addEventListener("mouseup",Ee),q.addEventListener("touchmove",ue),q.addEventListener("touchend",Ee)}function Wb(e,{handle:n,connectionMode:s,fromNodeId:l,fromHandleId:o,fromType:c,doc:u,lib:h,flowId:d,isValidConnection:g=Jb,nodeLookup:y}){const p=c==="target",v=n?u.querySelector(`.${h}-flow__handle[data-id="${d}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x:w,y:E}=jn(e),N=u.elementFromPoint(w,E),A=N?.classList.contains(`${h}-flow__handle`)?N:v,C={handleDomNode:A,isValid:!1,connection:null,toHandle:null};if(A){const z=Fb(void 0,A),_=A.getAttribute("data-nodeid"),x=A.getAttribute("data-handleid"),T=A.classList.contains("connectable"),O=A.classList.contains("connectableend");if(!_||!z)return C;const D={source:p?_:l,sourceHandle:p?x:o,target:p?l:_,targetHandle:p?o:x};C.connection=D;const q=T&&O&&(s===tl.Strict?p&&z==="source"||!p&&z==="target":_!==l||x!==o);C.isValid=q&&g(D),C.toHandle=Zb(_,z,x,y,s,!0)}return C}const Oh={onPointerDown:OA,isValid:Wb};function kA({domNode:e,panZoom:n,getTransform:s,getViewScale:l}){const o=on(e);function c({translateExtent:h,width:d,height:g,zoomStep:y=1,pannable:p=!0,zoomable:v=!0,inversePan:w=!1}){const E=_=>{if(_.sourceEvent.type!=="wheel"||!n)return;const x=s(),T=_.sourceEvent.ctrlKey&&Lo()?10:1,O=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*y,D=x[2]*Math.pow(2,O*T);n.scaleTo(D)};let N=[0,0];const A=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(N=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},C=_=>{const x=s();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!n)return;const T=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],O=[T[0]-N[0],T[1]-N[1]];N=T;const D=l()*Math.max(x[2],Math.log(x[2]))*(w?-1:1),R={x:x[0]-O[0]*D,y:x[1]-O[1]*D},q=[[0,0],[d,g]];n.setViewportConstrained({x:R.x,y:R.y,zoom:x[2]},q,h)},z=Ab().on("start",A).on("zoom",p?C:null).on("zoom.wheel",v?E:null);o.call(z,{})}function u(){o.on("zoom",null)}return{update:c,destroy:u,pointer:Cn}}const gu=e=>({x:e.x,y:e.y,zoom:e.k}),eh=({x:e,y:n,zoom:s})=>du.translate(e,n).scale(s),Ha=(e,n)=>e.target.closest(`.${n}`),Pb=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),jA=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,th=(e,n=0,s=jA,l=()=>{})=>{const o=typeof n=="number"&&n>0;return o||l(),o?e.transition().duration(n).ease(s).on("end",l):e},e1=e=>{const n=e.ctrlKey&&Lo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function zA({zoomPanValues:e,noWheelClassName:n,d3Selection:s,d3Zoom:l,panOnScrollMode:o,panOnScrollSpeed:c,zoomOnPinch:u,onPanZoomStart:h,onPanZoom:d,onPanZoomEnd:g}){return y=>{if(Ha(y,n))return y.ctrlKey&&y.preventDefault(),!1;y.preventDefault(),y.stopImmediatePropagation();const p=s.property("__zoom").k||1;if(y.ctrlKey&&u){const A=Cn(y),C=e1(y),z=p*Math.pow(2,C);l.scaleTo(s,z,A,y);return}const v=y.deltaMode===1?20:1;let w=o===Hs.Vertical?0:y.deltaX*v,E=o===Hs.Horizontal?0:y.deltaY*v;!Lo()&&y.shiftKey&&o!==Hs.Vertical&&(w=y.deltaY*v,E=0),l.translateBy(s,-(w/p)*c,-(E/p)*c,{internal:!0});const N=gu(s.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(d?.(y,N),e.panScrollTimeout=setTimeout(()=>{g?.(y,N),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,h?.(y,N))}}function DA({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:s}){return function(l,o){const c=l.type==="wheel",u=!n&&c&&!l.ctrlKey,h=Ha(l,e);if(l.ctrlKey&&c&&h&&l.preventDefault(),u||h)return null;l.preventDefault(),s.call(this,l,o)}}function RA({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:s}){return l=>{if(l.sourceEvent?.internal)return;const o=gu(l.transform);e.mouseButton=l.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,l.sourceEvent?.type==="mousedown"&&n(!0),s&&s?.(l.sourceEvent,o)}}function BA({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:s,onTransformChange:l,onPanZoom:o}){return c=>{e.usedRightMouseButton=!!(s&&Pb(n,e.mouseButton??0)),c.sourceEvent?.sync||l([c.transform.x,c.transform.y,c.transform.k]),o&&!c.sourceEvent?.internal&&o?.(c.sourceEvent,gu(c.transform))}}function LA({zoomPanValues:e,panOnDrag:n,panOnScroll:s,onDraggingChange:l,onPanZoomEnd:o,onPaneContextMenu:c}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,c&&Pb(n,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&c(u.sourceEvent),e.usedRightMouseButton=!1,l(!1),o)){const h=gu(u.transform);e.prevViewport=h,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(u.sourceEvent,h)},s?150:0)}}}function HA({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:s,panOnDrag:l,panOnScroll:o,zoomOnDoubleClick:c,userSelectionActive:u,noWheelClassName:h,noPanClassName:d,lib:g,connectionInProgress:y}){return p=>{const v=e||n,w=s&&p.ctrlKey,E=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(Ha(p,`${g}-flow__node`)||Ha(p,`${g}-flow__edge`)))return!0;if(!l&&!v&&!o&&!c&&!s||u||y&&!E||Ha(p,h)&&E||Ha(p,d)&&(!E||o&&E&&!e)||!s&&p.ctrlKey&&E)return!1;if(!s&&p.type==="touchstart"&&p.touches?.length>1)return p.preventDefault(),!1;if(!v&&!o&&!w&&E||!l&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(l)&&!l.includes(p.button)&&p.type==="mousedown")return!1;const N=Array.isArray(l)&&l.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||E)&&N}}function $A({domNode:e,minZoom:n,maxZoom:s,translateExtent:l,viewport:o,onPanZoom:c,onPanZoomStart:u,onPanZoomEnd:h,onDraggingChange:d}){const g={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},y=e.getBoundingClientRect(),p=Ab().scaleExtent([n,s]).translateExtent(l),v=on(e).call(p);z({x:o.x,y:o.y,zoom:nl(o.zoom,n,s)},[[0,0],[y.width,y.height]],l);const w=v.on("wheel.zoom"),E=v.on("dblclick.zoom");p.wheelDelta(e1);async function N(G,X){return v?new Promise(W=>{p?.interpolate(X?.interpolate==="linear"?_o:Rc).transform(th(v,X?.duration,X?.ease,()=>W(!0)),G)}):!1}function A({noWheelClassName:G,noPanClassName:X,onPaneContextMenu:W,userSelectionActive:B,panOnScroll:K,panOnDrag:j,panOnScrollMode:$,panOnScrollSpeed:L,preventScrolling:Y,zoomOnPinch:ee,zoomOnScroll:k,zoomOnDoubleClick:H,zoomActivationKeyPressed:ne,lib:ae,onTransformChange:fe,connectionInProgress:de,paneClickDistance:se,selectionOnDrag:te}){B&&!g.isZoomingOrPanning&&C();const ue=K&&!ne&&!B;p.clickDistance(te?1/0:!kn(se)||se<0?0:se);const Ee=ue?zA({zoomPanValues:g,noWheelClassName:G,d3Selection:v,d3Zoom:p,panOnScrollMode:$,panOnScrollSpeed:L,zoomOnPinch:ee,onPanZoomStart:u,onPanZoom:c,onPanZoomEnd:h}):DA({noWheelClassName:G,preventScrolling:Y,d3ZoomHandler:w});v.on("wheel.zoom",Ee,{passive:!1});const Se=RA({zoomPanValues:g,onDraggingChange:d,onPanZoomStart:u});p.on("start",Se);const ge=BA({zoomPanValues:g,panOnDrag:j,onPaneContextMenu:!!W,onPanZoom:c,onTransformChange:fe});p.on("zoom",ge);const ve=LA({zoomPanValues:g,panOnDrag:j,panOnScroll:K,onPaneContextMenu:W,onPanZoomEnd:h,onDraggingChange:d});p.on("end",ve);const xe=HA({zoomActivationKeyPressed:ne,panOnDrag:j,zoomOnScroll:k,panOnScroll:K,zoomOnDoubleClick:H,zoomOnPinch:ee,userSelectionActive:B,noPanClassName:X,noWheelClassName:G,lib:ae,connectionInProgress:de});p.filter(xe),H?v.on("dblclick.zoom",E):v.on("dblclick.zoom",null)}function C(){p.on("zoom",null)}async function z(G,X,W){const B=eh(G),K=p?.constrain()(B,X,W);return K&&await N(K),K}async function _(G,X){const W=eh(G);return await N(W,X),W}function x(G){if(v){const X=eh(G),W=v.property("__zoom");(W.k!==G.zoom||W.x!==G.x||W.y!==G.y)&&p?.transform(v,X,null,{sync:!0})}}function T(){const G=v?_b(v.node()):{x:0,y:0,k:1};return{x:G.x,y:G.y,zoom:G.k}}async function O(G,X){return v?new Promise(W=>{p?.interpolate(X?.interpolate==="linear"?_o:Rc).scaleTo(th(v,X?.duration,X?.ease,()=>W(!0)),G)}):!1}async function D(G,X){return v?new Promise(W=>{p?.interpolate(X?.interpolate==="linear"?_o:Rc).scaleBy(th(v,X?.duration,X?.ease,()=>W(!0)),G)}):!1}function R(G){p?.scaleExtent(G)}function q(G){p?.translateExtent(G)}function P(G){const X=!kn(G)||G<0?0:G;p?.clickDistance(X)}return{update:A,destroy:C,setViewport:_,setViewportConstrained:z,getViewport:T,scaleTo:O,scaleBy:D,setScaleExtent:R,setTranslateExtent:q,syncViewport:x,setClickDistance:P}}var al;(function(e){e.Line="line",e.Handle="handle"})(al||(al={}));function UA({width:e,prevWidth:n,height:s,prevHeight:l,affectsX:o,affectsY:c}){const u=e-n,h=s-l,d=[u>0?1:u<0?-1:0,h>0?1:h<0?-1:0];return u&&o&&(d[0]=d[0]*-1),h&&c&&(d[1]=d[1]*-1),d}function Q0(e){const n=e.includes("right")||e.includes("left"),s=e.includes("bottom")||e.includes("top"),l=e.includes("left"),o=e.includes("top");return{isHorizontal:n,isVertical:s,affectsX:l,affectsY:o}}function es(e,n){return Math.max(0,n-e)}function ts(e,n){return Math.max(0,e-n)}function _c(e,n,s){return Math.max(0,n-e,e-s)}function Z0(e,n){return e?!n:n}function qA(e,n,s,l,o,c,u,h){let{affectsX:d,affectsY:g}=n;const{isHorizontal:y,isVertical:p}=n,v=y&&p,{xSnapped:w,ySnapped:E}=s,{minWidth:N,maxWidth:A,minHeight:C,maxHeight:z}=l,{x:_,y:x,width:T,height:O,aspectRatio:D}=e;let R=Math.floor(y?w-e.pointerX:0),q=Math.floor(p?E-e.pointerY:0);const P=T+(d?-R:R),G=O+(g?-q:q),X=-c[0]*T,W=-c[1]*O;let B=_c(P,N,A),K=_c(G,C,z);if(u){let L=0,Y=0;d&&R<0?L=es(_+R+X,u[0][0]):!d&&R>0&&(L=ts(_+P+X,u[1][0])),g&&q<0?Y=es(x+q+W,u[0][1]):!g&&q>0&&(Y=ts(x+G+W,u[1][1])),B=Math.max(B,L),K=Math.max(K,Y)}if(h){let L=0,Y=0;d&&R>0?L=ts(_+R,h[0][0]):!d&&R<0&&(L=es(_+P,h[1][0])),g&&q>0?Y=ts(x+q,h[0][1]):!g&&q<0&&(Y=es(x+G,h[1][1])),B=Math.max(B,L),K=Math.max(K,Y)}if(o){if(y){const L=_c(P/D,C,z)*D;if(B=Math.max(B,L),u){let Y=0;!d&&!g||d&&!g&&v?Y=ts(x+W+P/D,u[1][1])*D:Y=es(x+W+(d?R:-R)/D,u[0][1])*D,B=Math.max(B,Y)}if(h){let Y=0;!d&&!g||d&&!g&&v?Y=es(x+P/D,h[1][1])*D:Y=ts(x+(d?R:-R)/D,h[0][1])*D,B=Math.max(B,Y)}}if(p){const L=_c(G*D,N,A)/D;if(K=Math.max(K,L),u){let Y=0;!d&&!g||g&&!d&&v?Y=ts(_+G*D+X,u[1][0])/D:Y=es(_+(g?q:-q)*D+X,u[0][0])/D,K=Math.max(K,Y)}if(h){let Y=0;!d&&!g||g&&!d&&v?Y=es(_+G*D,h[1][0])/D:Y=ts(_+(g?q:-q)*D,h[0][0])/D,K=Math.max(K,Y)}}}q=q+(q<0?K:-K),R=R+(R<0?B:-B),o&&(v?P>G*D?q=(Z0(d,g)?-R:R)/D:R=(Z0(d,g)?-q:q)*D:y?(q=R/D,g=d):(R=q*D,d=g));const j=d?_+R:_,$=g?x+q:x;return{width:T+(d?-R:R),height:O+(g?-q:q),x:c[0]*R*(d?-1:1)+j,y:c[1]*q*(g?-1:1)+$}}const t1={width:0,height:0,x:0,y:0},IA={...t1,pointerX:0,pointerY:0,aspectRatio:1};function VA(e,n,s){const l=n.position.x+e.position.x,o=n.position.y+e.position.y,c=e.measured.width??0,u=e.measured.height??0,h=s[0]*c,d=s[1]*u;return[[l-h,o-d],[l+c-h,o+u-d]]}function YA({domNode:e,nodeId:n,getStoreItems:s,onChange:l,onEnd:o}){const c=on(e);let u={controlDirection:Q0("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function h({controlPosition:g,boundaries:y,keepAspectRatio:p,resizeDirection:v,onResizeStart:w,onResize:E,onResizeEnd:N,shouldResize:A}){let C={...t1},z={...IA};u={boundaries:y,resizeDirection:v,keepAspectRatio:p,controlDirection:Q0(g)};let _,x=null,T=[],O,D,R,q=!1;const P=fb().on("start",G=>{const{nodeLookup:X,transform:W,snapGrid:B,snapToGrid:K,nodeOrigin:j,paneDomNode:$}=s();if(_=X.get(n),!_)return;x=$?.getBoundingClientRect()??null;const{xSnapped:L,ySnapped:Y}=Ao(G.sourceEvent,{transform:W,snapGrid:B,snapToGrid:K,containerBounds:x});C={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},z={...C,pointerX:L,pointerY:Y,aspectRatio:C.width/C.height},O=void 0,D=Is(_.extent)?_.extent:void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(O=X.get(_.parentId)),O&&_.extent==="parent"&&(D=[[0,0],[O.measured.width,O.measured.height]]),T=[],R=void 0;for(const[ee,k]of X)if(k.parentId===n&&(T.push({id:ee,position:{...k.position},extent:k.extent}),k.extent==="parent"||k.expandParent)){const H=VA(k,_,k.origin??j);R?R=[[Math.min(H[0][0],R[0][0]),Math.min(H[0][1],R[0][1])],[Math.max(H[1][0],R[1][0]),Math.max(H[1][1],R[1][1])]]:R=H}w?.(G,{...C})}).on("drag",G=>{const{transform:X,snapGrid:W,snapToGrid:B,nodeOrigin:K}=s(),j=Ao(G.sourceEvent,{transform:X,snapGrid:W,snapToGrid:B,containerBounds:x}),$=[];if(!_)return;const{x:L,y:Y,width:ee,height:k}=C,H={},ne=_.origin??K,{width:ae,height:fe,x:de,y:se}=qA(z,u.controlDirection,j,u.boundaries,u.keepAspectRatio,ne,D,R),te=ae!==ee,ue=fe!==k,Ee=de!==L&&te,Se=se!==Y&&ue;if(!Ee&&!Se&&!te&&!ue)return;if((Ee||Se||ne[0]===1||ne[1]===1)&&(H.x=Ee?de:C.x,H.y=Se?se:C.y,C.x=H.x,C.y=H.y,T.length>0)){const ze=de-L,Ye=se-Y;for(const St of T)St.position={x:St.position.x-ze+ne[0]*(ae-ee),y:St.position.y-Ye+ne[1]*(fe-k)},$.push(St)}if((te||ue)&&(H.width=te&&(!u.resizeDirection||u.resizeDirection==="horizontal")?ae:C.width,H.height=ue&&(!u.resizeDirection||u.resizeDirection==="vertical")?fe:C.height,C.width=H.width,C.height=H.height),O&&_.expandParent){const ze=ne[0]*(H.width??0);H.x&&H.x<ze&&(C.x=ze,z.x=z.x-(H.x-ze));const Ye=ne[1]*(H.height??0);H.y&&H.y<Ye&&(C.y=Ye,z.y=z.y-(H.y-Ye))}const ge=UA({width:C.width,prevWidth:ee,height:C.height,prevHeight:k,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),ve={...C,direction:ge};A?.(G,ve)!==!1&&(q=!0,E?.(G,ve),l(H,$))}).on("end",G=>{q&&(N?.(G,{...C}),o?.({...C}),q=!1)});c.call(P)}function d(){c.on(".drag",null)}return{update:h,destroy:d}}var nh={exports:{}},ih={},sh={exports:{}},ah={};var F0;function GA(){if(F0)return ah;F0=1;var e=Yo();function n(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var s=typeof Object.is=="function"?Object.is:n,l=e.useState,o=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue;function h(p,v){var w=v(),E=l({inst:{value:w,getSnapshot:v}}),N=E[0].inst,A=E[1];return c(function(){N.value=w,N.getSnapshot=v,d(N)&&A({inst:N})},[p,w,v]),o(function(){return d(N)&&A({inst:N}),p(function(){d(N)&&A({inst:N})})},[p]),u(w),w}function d(p){var v=p.getSnapshot;p=p.value;try{var w=v();return!s(p,w)}catch{return!0}}function g(p,v){return v()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:h;return ah.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,ah}var J0;function XA(){return J0||(J0=1,sh.exports=GA()),sh.exports}var W0;function KA(){if(W0)return ih;W0=1;var e=Yo(),n=XA();function s(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var l=typeof Object.is=="function"?Object.is:s,o=n.useSyncExternalStore,c=e.useRef,u=e.useEffect,h=e.useMemo,d=e.useDebugValue;return ih.useSyncExternalStoreWithSelector=function(g,y,p,v,w){var E=c(null);if(E.current===null){var N={hasValue:!1,value:null};E.current=N}else N=E.current;E=h(function(){function C(O){if(!z){if(z=!0,_=O,O=v(O),w!==void 0&&N.hasValue){var D=N.value;if(w(D,O))return x=D}return x=O}if(D=x,l(_,O))return D;var R=v(O);return w!==void 0&&w(D,R)?(_=O,D):(_=O,x=R)}var z=!1,_,x,T=p===void 0?null:p;return[function(){return C(y())},T===null?void 0:function(){return C(T())}]},[y,p,v,w]);var A=o(g,E[0],E[1]);return u(function(){N.hasValue=!0,N.value=A},[A]),d(A),A},ih}var P0;function QA(){return P0||(P0=1,nh.exports=KA()),nh.exports}var ZA=QA();const FA=Zv(ZA),JA={},ev=e=>{let n;const s=new Set,l=(y,p)=>{const v=typeof y=="function"?y(n):y;if(!Object.is(v,n)){const w=n;n=p??(typeof v!="object"||v===null)?v:Object.assign({},n,v),s.forEach(E=>E(n,w))}},o=()=>n,d={setState:l,getState:o,getInitialState:()=>g,subscribe:y=>(s.add(y),()=>s.delete(y)),destroy:()=>{(JA?"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()}},g=n=e(l,o,d);return d},WA=e=>e?ev(e):ev,{useDebugValue:PA}=ou,{useSyncExternalStoreWithSelector:eT}=FA,tT=e=>e;function n1(e,n=tT,s){const l=eT(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,s);return PA(l),l}const tv=(e,n)=>{const s=WA(e),l=(o,c=n)=>n1(s,o,c);return Object.assign(l,s),l},nT=(e,n)=>e?tv(e,n):tv;function tt(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[l,o]of e)if(!Object.is(o,n.get(l)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const l of e)if(!n.has(l))return!1;return!0}const s=Object.keys(e);if(s.length!==Object.keys(n).length)return!1;for(const l of s)if(!Object.prototype.hasOwnProperty.call(n,l)||!Object.is(e[l],n[l]))return!1;return!0}var iT=Fv();const pu=V.createContext(null),sT=pu.Provider,i1=zn.error001("react");function Be(e,n){const s=V.useContext(pu);if(s===null)throw new Error(i1);return n1(s,e,n)}function it(){const e=V.useContext(pu);if(e===null)throw new Error(i1);return V.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const nv={display:"none"},aT={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},s1="react-flow__node-desc",a1="react-flow__edge-desc",lT="react-flow__aria-live",oT=e=>e.ariaLiveMessage,rT=e=>e.ariaLabelConfig;function cT({rfId:e}){const n=Be(oT);return S.jsx("div",{id:`${lT}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:aT,children:n})}function uT({rfId:e,disableKeyboardA11y:n}){const s=Be(rT);return S.jsxs(S.Fragment,{children:[S.jsx("div",{id:`${s1}-${e}`,style:nv,children:n?s["node.a11yDescription.default"]:s["node.a11yDescription.keyboardDisabled"]}),S.jsx("div",{id:`${a1}-${e}`,style:nv,children:s["edge.a11yDescription.default"]}),!n&&S.jsx(cT,{rfId:e})]})}const yu=V.forwardRef(({position:e="top-left",children:n,className:s,style:l,...o},c)=>{const u=`${e}`.split("-");return S.jsx("div",{className:bt(["react-flow__panel",s,...u]),style:l,ref:c,...o,children:n})});yu.displayName="Panel";function fT({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:S.jsx(yu,{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:S.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const dT=e=>{const n=[],s=[];for(const[,l]of e.nodeLookup)l.selected&&n.push(l.internals.userNode);for(const[,l]of e.edgeLookup)l.selected&&s.push(l);return{selectedNodes:n,selectedEdges:s}},Ac=e=>e.id;function hT(e,n){return tt(e.selectedNodes.map(Ac),n.selectedNodes.map(Ac))&&tt(e.selectedEdges.map(Ac),n.selectedEdges.map(Ac))}function mT({onSelectionChange:e}){const n=it(),{selectedNodes:s,selectedEdges:l}=Be(dT,hT);return V.useEffect(()=>{const o={nodes:s,edges:l};e?.(o),n.getState().onSelectionChangeHandlers.forEach(c=>c(o))},[s,l,e]),null}const gT=e=>!!e.onSelectionChangeHandlers;function pT({onSelectionChange:e}){const n=Be(gT);return e||n?S.jsx(mT,{onSelectionChange:e}):null}const l1=[0,0],yT={x:0,y:0,zoom:1},vT=["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"],iv=[...vT,"rfId"],bT=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),sv={translateExtent:zo,nodeOrigin:l1,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function ST(e){const{setNodes:n,setEdges:s,setMinZoom:l,setMaxZoom:o,setTranslateExtent:c,setNodeExtent:u,reset:h,setDefaultNodesAndEdges:d}=Be(bT,tt),g=it();V.useEffect(()=>(d(e.defaultNodes,e.defaultEdges),()=>{y.current=sv,h()}),[]);const y=V.useRef(sv);return V.useEffect(()=>{for(const p of iv){const v=e[p],w=y.current[p];v!==w&&(typeof e[p]>"u"||(p==="nodes"?n(v):p==="edges"?s(v):p==="minZoom"?l(v):p==="maxZoom"?o(v):p==="translateExtent"?c(v):p==="nodeExtent"?u(v):p==="ariaLabelConfig"?g.setState({ariaLabelConfig:iA(v)}):p==="fitView"?g.setState({fitViewQueued:v}):p==="fitViewOptions"?g.setState({fitViewOptions:v}):g.setState({[p]:v})))}y.current=e},iv.map(p=>e[p])),null}function av(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function wT(e){const[n,s]=V.useState(e==="system"?null:e);return V.useEffect(()=>{if(e!=="system"){s(e);return}const l=av(),o=()=>s(l?.matches?"dark":"light");return o(),l?.addEventListener("change",o),()=>{l?.removeEventListener("change",o)}},[e]),n!==null?n:av()?.matches?"dark":"light"}const lv=typeof document<"u"?document:null;function Ho(e=null,n={target:lv,actInsideInputWithModifier:!0}){const[s,l]=V.useState(!1),o=V.useRef(!1),c=V.useRef(new Set([])),[u,h]=V.useMemo(()=>{if(e!==null){const g=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
10
+ `).replace(`
11
+
12
+ `,`
13
+ +`).split(`
14
+ `)),y=g.reduce((p,v)=>p.concat(...v),[]);return[g,y]}return[[],[]]},[e]);return V.useEffect(()=>{const d=n?.target??lv,g=n?.actInsideInputWithModifier??!0;if(e!==null){const y=w=>{if(o.current=w.ctrlKey||w.metaKey||w.shiftKey||w.altKey,(!o.current||o.current&&!g)&&$b(w))return!1;const N=rv(w.code,h);if(c.current.add(w[N]),ov(u,c.current,!1)){const A=w.composedPath?.()?.[0]||w.target,C=A?.nodeName==="BUTTON"||A?.nodeName==="A";n.preventDefault!==!1&&(o.current||!C)&&w.preventDefault(),l(!0)}},p=w=>{const E=rv(w.code,h);ov(u,c.current,!0)?(l(!1),c.current.clear()):c.current.delete(w[E]),w.key==="Meta"&&c.current.clear(),o.current=!1},v=()=>{c.current.clear(),l(!1)};return d?.addEventListener("keydown",y),d?.addEventListener("keyup",p),window.addEventListener("blur",v),window.addEventListener("contextmenu",v),()=>{d?.removeEventListener("keydown",y),d?.removeEventListener("keyup",p),window.removeEventListener("blur",v),window.removeEventListener("contextmenu",v)}}},[e,l]),s}function ov(e,n,s){return e.filter(l=>s||l.length===n.size).some(l=>l.every(o=>n.has(o)))}function rv(e,n){return n.includes(e)?"code":"key"}const xT=()=>{const e=it();return V.useMemo(()=>({zoomIn:async n=>{const{panZoom:s}=e.getState();return s?s.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:s}=e.getState();return s?s.scaleBy(1/1.2,n):!1},zoomTo:async(n,s)=>{const{panZoom:l}=e.getState();return l?l.scaleTo(n,s):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,s)=>{const{transform:[l,o,c],panZoom:u}=e.getState();return u?(await u.setViewport({x:n.x??l,y:n.y??o,zoom:n.zoom??c},s),!0):!1},getViewport:()=>{const[n,s,l]=e.getState().transform;return{x:n,y:s,zoom:l}},setCenter:async(n,s,l)=>e.getState().setCenter(n,s,l),fitBounds:async(n,s)=>{const{width:l,height:o,minZoom:c,maxZoom:u,panZoom:h}=e.getState(),d=em(n,l,o,c,u,s?.padding??.1);return h?(await h.setViewport(d,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),!0):!1},screenToFlowPosition:(n,s={})=>{const{transform:l,snapGrid:o,snapToGrid:c,domNode:u}=e.getState();if(!u)return n;const{x:h,y:d}=u.getBoundingClientRect(),g={x:n.x-h,y:n.y-d},y=s.snapGrid??o,p=s.snapToGrid??c;return cl(g,l,p,y)},flowToScreenPosition:n=>{const{transform:s,domNode:l}=e.getState();if(!l)return n;const{x:o,y:c}=l.getBoundingClientRect(),u=sl(n,s);return{x:u.x+o,y:u.y+c}}}),[])};function o1(e,n){const s=[],l=new Map,o=[];for(const c of e)if(c.type==="add"){o.push(c);continue}else if(c.type==="remove"||c.type==="replace")l.set(c.id,[c]);else{const u=l.get(c.id);u?u.push(c):l.set(c.id,[c])}for(const c of n){const u=l.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 h={...c};for(const d of u)ET(d,h);s.push(h)}return o.length&&o.forEach(c=>{c.index!==void 0?s.splice(c.index,0,{...c.item}):s.push({...c.item})}),s}function ET(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function NT(e,n){return o1(e,n)}function _T(e,n){return o1(e,n)}function js(e,n){return{id:e,type:"select",selected:n}}function $a(e,n=new Set,s=!1){const l=[];for(const[o,c]of e){const u=n.has(o);!(c.selected===void 0&&!u)&&c.selected!==u&&(s&&(c.selected=u),l.push(js(c.id,u)))}return l}function cv({items:e=[],lookup:n}){const s=[],l=new Map(e.map(o=>[o.id,o]));for(const[o,c]of e.entries()){const u=n.get(c.id),h=u?.internals?.userNode??u;h!==void 0&&h!==c&&s.push({id:c.id,item:c,type:"replace"}),h===void 0&&s.push({item:c,type:"add",index:o})}for(const[o]of n)l.get(o)===void 0&&s.push({id:o,type:"remove"});return s}function uv(e){return{id:e.id,type:"remove"}}const AT=Rb();function TT(e,n,s={}){return cA(e,n,{...s,onError:s.onError??AT})}const fv=e=>Q_(e),CT=e=>kb(e);function r1(e){return V.forwardRef(e)}const MT=typeof window<"u"?V.useLayoutEffect:V.useEffect;function dv(e){const[n,s]=V.useState(BigInt(0)),[l]=V.useState(()=>OT(()=>s(o=>o+BigInt(1))));return MT(()=>{const o=l.get();o.length&&(e(o),l.reset())},[n]),l}function OT(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:s=>{n.push(s),e()}}}const c1=V.createContext(null);function kT({children:e}){const n=it(),s=V.useCallback(h=>{const{nodes:d=[],setNodes:g,hasDefaultNodes:y,onNodesChange:p,nodeLookup:v,fitViewQueued:w,onNodesChangeMiddlewareMap:E}=n.getState();let N=d;for(const C of h)N=typeof C=="function"?C(N):C;let A=cv({items:N,lookup:v});for(const C of E.values())A=C(A);y&&g(N),A.length>0?p?.(A):w&&window.requestAnimationFrame(()=>{const{fitViewQueued:C,nodes:z,setNodes:_}=n.getState();C&&_(z)})},[]),l=dv(s),o=V.useCallback(h=>{const{edges:d=[],setEdges:g,hasDefaultEdges:y,onEdgesChange:p,edgeLookup:v}=n.getState();let w=d;for(const E of h)w=typeof E=="function"?E(w):E;y?g(w):p&&p(cv({items:w,lookup:v}))},[]),c=dv(o),u=V.useMemo(()=>({nodeQueue:l,edgeQueue:c}),[]);return S.jsx(c1.Provider,{value:u,children:e})}function jT(){const e=V.useContext(c1);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const zT=e=>!!e.panZoom;function vu(){const e=xT(),n=it(),s=jT(),l=Be(zT),o=V.useMemo(()=>{const c=p=>n.getState().nodeLookup.get(p),u=p=>{s.nodeQueue.push(p)},h=p=>{s.edgeQueue.push(p)},d=p=>{const{nodeLookup:v,nodeOrigin:w}=n.getState(),E=fv(p)?p:v.get(p.id),N=E.parentId?Lb(E.position,E.measured,E.parentId,v,w):E.position,A={...E,position:N,width:E.measured?.width??E.width,height:E.measured?.height??E.height};return il(A)},g=(p,v,w={replace:!1})=>{u(E=>E.map(N=>{if(N.id===p){const A=typeof v=="function"?v(N):v;return w.replace&&fv(A)?A:{...N,...A}}return N}))},y=(p,v,w={replace:!1})=>{h(E=>E.map(N=>{if(N.id===p){const A=typeof v=="function"?v(N):v;return w.replace&&CT(A)?A:{...N,...A}}return N}))};return{getNodes:()=>n.getState().nodes.map(p=>({...p})),getNode:p=>c(p)?.internals.userNode,getInternalNode:c,getEdges:()=>{const{edges:p=[]}=n.getState();return p.map(v=>({...v}))},getEdge:p=>n.getState().edgeLookup.get(p),setNodes:u,setEdges:h,addNodes:p=>{const v=Array.isArray(p)?p:[p];s.nodeQueue.push(w=>[...w,...v])},addEdges:p=>{const v=Array.isArray(p)?p:[p];s.edgeQueue.push(w=>[...w,...v])},toObject:()=>{const{nodes:p=[],edges:v=[],transform:w}=n.getState(),[E,N,A]=w;return{nodes:p.map(C=>({...C})),edges:v.map(C=>({...C})),viewport:{x:E,y:N,zoom:A}}},deleteElements:async({nodes:p=[],edges:v=[]})=>{const{nodes:w,edges:E,onNodesDelete:N,onEdgesDelete:A,triggerNodeChanges:C,triggerEdgeChanges:z,onDelete:_,onBeforeDelete:x}=n.getState(),{nodes:T,edges:O}=await P_({nodesToRemove:p,edgesToRemove:v,nodes:w,edges:E,onBeforeDelete:x}),D=O.length>0,R=T.length>0;if(D){const q=O.map(uv);A?.(O),z(q)}if(R){const q=T.map(uv);N?.(T),C(q)}return(R||D)&&_?.({nodes:T,edges:O}),{deletedNodes:T,deletedEdges:O}},getIntersectingNodes:(p,v=!0,w)=>{const E=L0(p),N=E?p:d(p),A=w!==void 0;return N?(w||n.getState().nodes).filter(C=>{const z=n.getState().nodeLookup.get(C.id);if(z&&!E&&(C.id===p.id||!z.internals.positionAbsolute))return!1;const _=il(A?C:z),x=Bo(_,N);return v&&x>0||x>=_.width*_.height||x>=N.width*N.height}):[]},isNodeIntersecting:(p,v,w=!0)=>{const N=L0(p)?p:d(p);if(!N)return!1;const A=Bo(N,v);return w&&A>0||A>=v.width*v.height||A>=N.width*N.height},updateNode:g,updateNodeData:(p,v,w={replace:!1})=>{g(p,E=>{const N=typeof v=="function"?v(E):v;return w.replace?{...E,data:N}:{...E,data:{...E.data,...N}}},w)},updateEdge:y,updateEdgeData:(p,v,w={replace:!1})=>{y(p,E=>{const N=typeof v=="function"?v(E):v;return w.replace?{...E,data:N}:{...E,data:{...E.data,...N}}},w)},getNodesBounds:p=>{const{nodeLookup:v,nodeOrigin:w}=n.getState();return Z_(p,{nodeLookup:v,nodeOrigin:w})},getHandleConnections:({type:p,id:v,nodeId:w})=>Array.from(n.getState().connectionLookup.get(`${w}-${p}${v?`-${v}`:""}`)?.values()??[]),getNodeConnections:({type:p,handleId:v,nodeId:w})=>Array.from(n.getState().connectionLookup.get(`${w}${p?v?`-${p}-${v}`:`-${p}`:""}`)?.values()??[]),fitView:async p=>{const v=n.getState().fitViewResolver??nA();return n.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:v}),s.nodeQueue.push(w=>[...w]),v.promise}}},[]);return V.useMemo(()=>({...o,...e,viewportInitialized:l}),[l])}const hv=e=>e.selected,DT=typeof window<"u"?window:void 0;function RT({deleteKeyCode:e,multiSelectionKeyCode:n}){const s=it(),{deleteElements:l}=vu(),o=Ho(e,{actInsideInputWithModifier:!1}),c=Ho(n,{target:DT});V.useEffect(()=>{if(o){const{edges:u,nodes:h}=s.getState();l({nodes:h.filter(hv),edges:u.filter(hv)}),s.setState({nodesSelectionActive:!1})}},[o]),V.useEffect(()=>{s.setState({multiSelectionActive:c})},[c])}function BT(e){const n=it();V.useEffect(()=>{const s=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const l=tm(e.current);(l.height===0||l.width===0)&&n.getState().onError?.("004",zn.error004()),n.setState({width:l.width||500,height:l.height||500})};if(e.current){s(),window.addEventListener("resize",s);const l=new ResizeObserver(()=>s());return l.observe(e.current),()=>{window.removeEventListener("resize",s),l&&e.current&&l.unobserve(e.current)}}},[])}const bu={position:"absolute",width:"100%",height:"100%",top:0,left:0},LT=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function HT({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:s=!0,panOnScroll:l=!1,panOnScrollSpeed:o=.5,panOnScrollMode:c=Hs.Free,zoomOnDoubleClick:u=!0,panOnDrag:h=!0,defaultViewport:d,translateExtent:g,minZoom:y,maxZoom:p,zoomActivationKeyCode:v,preventScrolling:w=!0,children:E,noWheelClassName:N,noPanClassName:A,onViewportChange:C,isControlledViewport:z,paneClickDistance:_,selectionOnDrag:x}){const T=it(),O=V.useRef(null),{userSelectionActive:D,lib:R,connectionInProgress:q}=Be(LT,tt),P=Ho(v),G=V.useRef();BT(O);const X=V.useCallback(W=>{C?.({x:W[0],y:W[1],zoom:W[2]}),z||T.setState({transform:W})},[C,z]);return V.useEffect(()=>{if(O.current){G.current=$A({domNode:O.current,minZoom:y,maxZoom:p,translateExtent:g,viewport:d,onDraggingChange:j=>T.setState($=>$.paneDragging===j?$:{paneDragging:j}),onPanZoomStart:(j,$)=>{const{onViewportChangeStart:L,onMoveStart:Y}=T.getState();Y?.(j,$),L?.($)},onPanZoom:(j,$)=>{const{onViewportChange:L,onMove:Y}=T.getState();Y?.(j,$),L?.($)},onPanZoomEnd:(j,$)=>{const{onViewportChangeEnd:L,onMoveEnd:Y}=T.getState();Y?.(j,$),L?.($)}});const{x:W,y:B,zoom:K}=G.current.getViewport();return T.setState({panZoom:G.current,transform:[W,B,K],domNode:O.current.closest(".react-flow")}),()=>{G.current?.destroy()}}},[]),V.useEffect(()=>{G.current?.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:s,panOnScroll:l,panOnScrollSpeed:o,panOnScrollMode:c,zoomOnDoubleClick:u,panOnDrag:h,zoomActivationKeyPressed:P,preventScrolling:w,noPanClassName:A,userSelectionActive:D,noWheelClassName:N,lib:R,onTransformChange:X,connectionInProgress:q,selectionOnDrag:x,paneClickDistance:_})},[e,n,s,l,o,c,u,h,P,w,A,D,N,R,X,q,x,_]),S.jsx("div",{className:"react-flow__renderer",ref:O,style:bu,children:E})}const $T=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function UT(){const{userSelectionActive:e,userSelectionRect:n}=Be($T,tt);return e&&n?S.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 lh=(e,n)=>s=>{s.target===n.current&&e?.(s)},qT=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function IT({isSelecting:e,selectionKeyPressed:n,selectionMode:s=Do.Full,panOnDrag:l,autoPanOnSelection:o,paneClickDistance:c,selectionOnDrag:u,onSelectionStart:h,onSelectionEnd:d,onPaneClick:g,onPaneContextMenu:y,onPaneScroll:p,onPaneMouseEnter:v,onPaneMouseMove:w,onPaneMouseLeave:E,children:N}){const A=V.useRef(0),C=it(),{userSelectionActive:z,elementsSelectable:_,dragging:x,connectionInProgress:T,panBy:O,autoPanSpeed:D}=Be(qT,tt),R=_&&(e||z),q=V.useRef(null),P=V.useRef(),G=V.useRef(new Set),X=V.useRef(new Set),W=V.useRef(!1),B=V.useRef({x:0,y:0}),K=V.useRef(!1),j=te=>{if(W.current||T){W.current=!1;return}g?.(te),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},$=te=>{if(Array.isArray(l)&&l?.includes(2)){te.preventDefault();return}y?.(te)},L=p?te=>p(te):void 0,Y=te=>{W.current&&(te.stopPropagation(),W.current=!1)},ee=te=>{const{domNode:ue,transform:Ee}=C.getState();if(P.current=ue?.getBoundingClientRect(),!P.current)return;const Se=te.target===q.current;if(!Se&&!!te.target.closest(".nokey")||!e||!(u&&Se||n)||te.button!==0||!te.isPrimary)return;te.target?.setPointerCapture?.(te.pointerId),W.current=!1;const{x:xe,y:ze}=jn(te.nativeEvent,P.current),Ye=cl({x:xe,y:ze},Ee);C.setState({userSelectionRect:{width:0,height:0,startX:Ye.x,startY:Ye.y,x:xe,y:ze}}),Se||(te.stopPropagation(),te.preventDefault())};function k(te,ue){const{userSelectionRect:Ee}=C.getState();if(!Ee)return;const{transform:Se,nodeLookup:ge,edgeLookup:ve,connectionLookup:xe,triggerNodeChanges:ze,triggerEdgeChanges:Ye,defaultEdgeOptions:St}=C.getState(),rt={x:Ee.startX,y:Ee.startY},{x:ht,y:Mt}=sl(rt,Se),De={startX:rt.x,startY:rt.y,x:te<ht?te:ht,y:ue<Mt?ue:Mt,width:Math.abs(te-ht),height:Math.abs(ue-Mt)},Lt=G.current,Ht=X.current;G.current=new Set(Wh(ge,De,Se,s===Do.Partial,!0).map(zt=>zt.id)),X.current=new Set;const st=St?.selectable??!0;for(const zt of G.current){const $t=xe.get(zt);if($t)for(const{edgeId:qe}of $t.values()){const Nt=ve.get(qe);Nt&&(Nt.selectable??st)&&X.current.add(qe)}}if(!H0(Lt,G.current)){const zt=$a(ge,G.current,!0);ze(zt)}if(!H0(Ht,X.current)){const zt=$a(ve,X.current);Ye(zt)}C.setState({userSelectionRect:De,userSelectionActive:!0,nodesSelectionActive:!1})}function H(){if(!o||!P.current)return;const[te,ue]=Ph(B.current,P.current,D);O({x:te,y:ue}).then(Ee=>{if(!W.current||!Ee){A.current=requestAnimationFrame(H);return}const{x:Se,y:ge}=B.current;k(Se,ge),A.current=requestAnimationFrame(H)})}const ne=()=>{cancelAnimationFrame(A.current),A.current=0,K.current=!1};V.useEffect(()=>()=>ne(),[]);const ae=te=>{const{userSelectionRect:ue,transform:Ee,resetSelectedElements:Se}=C.getState();if(!P.current||!ue)return;const{x:ge,y:ve}=jn(te.nativeEvent,P.current);B.current={x:ge,y:ve};const xe=sl({x:ue.startX,y:ue.startY},Ee);if(!W.current){const ze=n?0:c;if(Math.hypot(ge-xe.x,ve-xe.y)<=ze)return;Se(),h?.(te)}W.current=!0,K.current||(H(),K.current=!0),k(ge,ve)},fe=te=>{te.button===0&&(te.target?.releasePointerCapture?.(te.pointerId),!z&&te.target===q.current&&C.getState().userSelectionRect&&j?.(te),C.setState({userSelectionActive:!1,userSelectionRect:null}),W.current&&(d?.(te),C.setState({nodesSelectionActive:G.current.size>0})),ne())},de=te=>{te.target?.releasePointerCapture?.(te.pointerId),ne()},se=l===!0||Array.isArray(l)&&l.includes(0);return S.jsxs("div",{className:bt(["react-flow__pane",{draggable:se,dragging:x,selection:e}]),onClick:R?void 0:lh(j,q),onContextMenu:lh($,q),onWheel:lh(L,q),onPointerEnter:R?void 0:v,onPointerMove:R?ae:w,onPointerUp:R?fe:void 0,onPointerCancel:R?de:void 0,onPointerDownCapture:R?ee:void 0,onClickCapture:R?Y:void 0,onPointerLeave:E,ref:q,style:bu,children:[N,S.jsx(UT,{})]})}function kh({id:e,store:n,unselect:s=!1,nodeRef:l}){const{addSelectedNodes:o,unselectNodesAndEdges:c,multiSelectionActive:u,nodeLookup:h,onError:d}=n.getState(),g=h.get(e);if(!g){d?.("012",zn.error012(e));return}n.setState({nodesSelectionActive:!1}),g.selected?(s||g.selected&&u)&&(c({nodes:[g],edges:[]}),requestAnimationFrame(()=>l?.current?.blur())):o([e])}function u1({nodeRef:e,disabled:n=!1,noDragClassName:s,handleSelector:l,nodeId:o,isSelectable:c,nodeClickDistance:u}){const h=it(),[d,g]=V.useState(!1),y=V.useRef();return V.useEffect(()=>{y.current=_A({getStoreItems:()=>h.getState(),onNodeMouseDown:p=>{kh({id:p,store:h,nodeRef:e})},onDragStart:()=>{g(!0)},onDragStop:()=>{g(!1)}})},[]),V.useEffect(()=>{if(!(n||!e.current||!y.current))return y.current.update({noDragClassName:s,handleSelector:l,domNode:e.current,isSelectable:c,nodeId:o,nodeClickDistance:u}),()=>{y.current?.destroy()}},[s,l,n,c,e,o,u]),d}const VT=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function f1(){const e=it();return V.useCallback(s=>{const{nodeExtent:l,snapToGrid:o,snapGrid:c,nodesDraggable:u,onError:h,updateNodePositions:d,nodeLookup:g,nodeOrigin:y}=e.getState(),p=new Map,v=VT(u),w=o?c[0]:5,E=o?c[1]:5,N=s.direction.x*w*s.factor,A=s.direction.y*E*s.factor;for(const[,C]of g){if(!v(C))continue;let z={x:C.internals.positionAbsolute.x+N,y:C.internals.positionAbsolute.y+A};o&&(z=Zo(z,c));const{position:_,positionAbsolute:x}=jb({nodeId:C.id,nextPosition:z,nodeLookup:g,nodeExtent:l,nodeOrigin:y,onError:h});C.position=_,C.internals.positionAbsolute=x,p.set(C.id,C)}d(p)},[])}const om=V.createContext(null),YT=om.Provider;om.Consumer;const d1=()=>V.useContext(om),GT=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),XT=(e,n,s)=>l=>{const{connectionClickStartHandle:o,connectionMode:c,connection:u}=l,{fromHandle:h,toHandle:d,isValid:g}=u,y=d?.nodeId===e&&d?.id===n&&d?.type===s;return{connectingFrom:h?.nodeId===e&&h?.id===n&&h?.type===s,connectingTo:y,clickConnecting:o?.nodeId===e&&o?.id===n&&o?.type===s,isPossibleEndHandle:c===tl.Strict?h?.type!==s:e!==h?.nodeId||n!==h?.id,connectionInProcess:!!h,clickConnectionInProcess:!!o,valid:y&&g}};function KT({type:e="source",position:n=he.Top,isValidConnection:s,isConnectable:l=!0,isConnectableStart:o=!0,isConnectableEnd:c=!0,id:u,onConnect:h,children:d,className:g,onMouseDown:y,onTouchStart:p,...v},w){const E=u||null,N=e==="target",A=it(),C=d1(),{connectOnClick:z,noPanClassName:_,rfId:x}=Be(GT,tt),{connectingFrom:T,connectingTo:O,clickConnecting:D,isPossibleEndHandle:R,connectionInProcess:q,clickConnectionInProcess:P,valid:G}=Be(XT(C,E,e),tt);C||A.getState().onError?.("010",zn.error010());const X=K=>{const{defaultEdgeOptions:j,onConnect:$,hasDefaultEdges:L}=A.getState(),Y={...j,...K};if(L){const{edges:ee,setEdges:k,onError:H}=A.getState();k(TT(Y,ee,{onError:H}))}$?.(Y),h?.(Y)},W=K=>{if(!C)return;const j=Ub(K.nativeEvent);if(o&&(j&&K.button===0||!j)){const $=A.getState();Oh.onPointerDown(K.nativeEvent,{handleDomNode:K.currentTarget,autoPanOnConnect:$.autoPanOnConnect,connectionMode:$.connectionMode,connectionRadius:$.connectionRadius,domNode:$.domNode,nodeLookup:$.nodeLookup,lib:$.lib,isTarget:N,handleId:E,nodeId:C,flowId:$.rfId,panBy:$.panBy,cancelConnection:$.cancelConnection,onConnectStart:$.onConnectStart,onConnectEnd:(...L)=>A.getState().onConnectEnd?.(...L),updateConnection:$.updateConnection,onConnect:X,isValidConnection:s||((...L)=>A.getState().isValidConnection?.(...L)??!0),getTransform:()=>A.getState().transform,getFromHandle:()=>A.getState().connection.fromHandle,autoPanSpeed:$.autoPanSpeed,dragThreshold:$.connectionDragThreshold})}j?y?.(K):p?.(K)},B=K=>{const{onClickConnectStart:j,onClickConnectEnd:$,connectionClickStartHandle:L,connectionMode:Y,isValidConnection:ee,lib:k,rfId:H,nodeLookup:ne,connection:ae}=A.getState();if(!C||!L&&!o)return;if(!L){j?.(K.nativeEvent,{nodeId:C,handleId:E,handleType:e}),A.setState({connectionClickStartHandle:{nodeId:C,type:e,id:E}});return}const fe=Hb(K.target),de=s||ee,{connection:se,isValid:te}=Oh.isValid(K.nativeEvent,{handle:{nodeId:C,id:E,type:e},connectionMode:Y,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:de,flowId:H,doc:fe,lib:k,nodeLookup:ne});te&&se&&X(se);const ue=structuredClone(ae);delete ue.inProgress,ue.toPosition=ue.toHandle?ue.toHandle.position:null,$?.(K,ue),A.setState({connectionClickStartHandle:null})};return S.jsx("div",{"data-handleid":E,"data-nodeid":C,"data-handlepos":n,"data-id":`${x}-${C}-${E}-${e}`,className:bt(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",_,g,{source:!N,target:N,connectable:l,connectablestart:o,connectableend:c,clickconnecting:D,connectingfrom:T,connectingto:O,valid:G,connectionindicator:l&&(!q||R)&&(q||P?c:o)}]),onMouseDown:W,onTouchStart:W,onClick:z?B:void 0,ref:w,...v,children:d})}const vn=V.memo(r1(KT));function QT({data:e,isConnectable:n,sourcePosition:s=he.Bottom}){return S.jsxs(S.Fragment,{children:[e?.label,S.jsx(vn,{type:"source",position:s,isConnectable:n})]})}function ZT({data:e,isConnectable:n,targetPosition:s=he.Top,sourcePosition:l=he.Bottom}){return S.jsxs(S.Fragment,{children:[S.jsx(vn,{type:"target",position:s,isConnectable:n}),e?.label,S.jsx(vn,{type:"source",position:l,isConnectable:n})]})}function FT(){return null}function JT({data:e,isConnectable:n,targetPosition:s=he.Top}){return S.jsxs(S.Fragment,{children:[S.jsx(vn,{type:"target",position:s,isConnectable:n}),e?.label]})}const eu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},mv={input:QT,default:ZT,output:JT,group:FT};function WT(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const PT=e=>{const{width:n,height:s,x:l,y:o}=Qo(e.nodeLookup,{filter:c=>!!c.selected});return{width:kn(n)?n:null,height:kn(s)?s:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${l}px,${o}px)`}};function eC({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:s}){const l=it(),{width:o,height:c,transformString:u,userSelectionActive:h}=Be(PT,tt),d=f1(),g=V.useRef(null);V.useEffect(()=>{s||g.current?.focus({preventScroll:!0})},[s]);const y=!h&&o!==null&&c!==null;if(u1({nodeRef:g,disabled:!y}),!y)return null;const p=e?w=>{const E=l.getState().nodes.filter(N=>N.selected);e(w,E)}:void 0,v=w=>{Object.prototype.hasOwnProperty.call(eu,w.key)&&(w.preventDefault(),d({direction:eu[w.key],factor:w.shiftKey?4:1}))};return S.jsx("div",{className:bt(["react-flow__nodesselection","react-flow__container",n]),style:{transform:u},children:S.jsx("div",{ref:g,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:s?void 0:-1,onKeyDown:s?void 0:v,style:{width:o,height:c}})})}const gv=typeof window<"u"?window:void 0,tC=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function h1({children:e,onPaneClick:n,onPaneMouseEnter:s,onPaneMouseMove:l,onPaneMouseLeave:o,onPaneContextMenu:c,onPaneScroll:u,paneClickDistance:h,deleteKeyCode:d,selectionKeyCode:g,selectionOnDrag:y,selectionMode:p,onSelectionStart:v,onSelectionEnd:w,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:A,elementsSelectable:C,zoomOnScroll:z,zoomOnPinch:_,panOnScroll:x,panOnScrollSpeed:T,panOnScrollMode:O,zoomOnDoubleClick:D,panOnDrag:R,autoPanOnSelection:q,defaultViewport:P,translateExtent:G,minZoom:X,maxZoom:W,preventScrolling:B,onSelectionContextMenu:K,noWheelClassName:j,noPanClassName:$,disableKeyboardA11y:L,onViewportChange:Y,isControlledViewport:ee}){const{nodesSelectionActive:k,userSelectionActive:H}=Be(tC,tt),ne=Ho(g,{target:gv}),ae=Ho(N,{target:gv}),fe=ae||R,de=ae||x,se=y&&fe!==!0,te=ne||H||se;return RT({deleteKeyCode:d,multiSelectionKeyCode:E}),S.jsx(HT,{onPaneContextMenu:c,elementsSelectable:C,zoomOnScroll:z,zoomOnPinch:_,panOnScroll:de,panOnScrollSpeed:T,panOnScrollMode:O,zoomOnDoubleClick:D,panOnDrag:!ne&&fe,defaultViewport:P,translateExtent:G,minZoom:X,maxZoom:W,zoomActivationKeyCode:A,preventScrolling:B,noWheelClassName:j,noPanClassName:$,onViewportChange:Y,isControlledViewport:ee,paneClickDistance:h,selectionOnDrag:se,children:S.jsxs(IT,{onSelectionStart:v,onSelectionEnd:w,onPaneClick:n,onPaneMouseEnter:s,onPaneMouseMove:l,onPaneMouseLeave:o,onPaneContextMenu:c,onPaneScroll:u,panOnDrag:fe,autoPanOnSelection:q,isSelecting:!!te,selectionMode:p,selectionKeyPressed:ne,paneClickDistance:h,selectionOnDrag:se,children:[e,k&&S.jsx(eC,{onSelectionContextMenu:K,noPanClassName:$,disableKeyboardA11y:L})]})})}h1.displayName="FlowRenderer";const nC=V.memo(h1),iC=e=>n=>e?Wh(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 sC(e){return Be(V.useCallback(iC(e),[e]),tt)}const aC=e=>e.updateNodeInternals;function lC(){const e=Be(aC),[n]=V.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(s=>{const l=new Map;s.forEach(o=>{const c=o.target.getAttribute("data-id");l.set(c,{id:c,nodeElement:o.target,force:!0})}),e(l)}));return V.useEffect(()=>()=>{n?.disconnect()},[n]),n}function oC({node:e,nodeType:n,hasDimensions:s,resizeObserver:l}){const o=it(),c=V.useRef(null),u=V.useRef(null),h=V.useRef(e.sourcePosition),d=V.useRef(e.targetPosition),g=V.useRef(n),y=s&&!!e.internals.handleBounds;return V.useEffect(()=>{c.current&&!e.hidden&&(!y||u.current!==c.current)&&(u.current&&l?.unobserve(u.current),l?.observe(c.current),u.current=c.current)},[y,e.hidden]),V.useEffect(()=>()=>{u.current&&(l?.unobserve(u.current),u.current=null)},[]),V.useEffect(()=>{if(c.current){const p=g.current!==n,v=h.current!==e.sourcePosition,w=d.current!==e.targetPosition;(p||v||w)&&(g.current=n,h.current=e.sourcePosition,d.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:c.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),c}function rC({id:e,onClick:n,onMouseEnter:s,onMouseMove:l,onMouseLeave:o,onContextMenu:c,onDoubleClick:u,nodesDraggable:h,elementsSelectable:d,nodesConnectable:g,nodesFocusable:y,resizeObserver:p,noDragClassName:v,noPanClassName:w,disableKeyboardA11y:E,rfId:N,nodeTypes:A,nodeClickDistance:C,onError:z}){const{node:_,internals:x,isParent:T}=Be(te=>{const ue=te.nodeLookup.get(e),Ee=te.parentLookup.has(e);return{node:ue,internals:ue.internals,isParent:Ee}},tt);let O=_.type||"default",D=A?.[O]||mv[O];D===void 0&&(z?.("003",zn.error003(O)),O="default",D=A?.default||mv.default);const R=!!(_.draggable||h&&typeof _.draggable>"u"),q=!!(_.selectable||d&&typeof _.selectable>"u"),P=!!(_.connectable||g&&typeof _.connectable>"u"),G=!!(_.focusable||y&&typeof _.focusable>"u"),X=it(),W=Bb(_),B=oC({node:_,nodeType:O,hasDimensions:W,resizeObserver:p}),K=u1({nodeRef:B,disabled:_.hidden||!R,noDragClassName:v,handleSelector:_.dragHandle,nodeId:e,isSelectable:q,nodeClickDistance:C}),j=f1();if(_.hidden)return null;const $=Si(_),L=WT(_),Y=q||R||n||s||l||o,ee=s?te=>s(te,{...x.userNode}):void 0,k=l?te=>l(te,{...x.userNode}):void 0,H=o?te=>o(te,{...x.userNode}):void 0,ne=c?te=>c(te,{...x.userNode}):void 0,ae=u?te=>u(te,{...x.userNode}):void 0,fe=te=>{const{selectNodesOnDrag:ue,nodeDragThreshold:Ee}=X.getState();q&&(!ue||!R||Ee>0)&&kh({id:e,store:X,nodeRef:B}),n&&n(te,{...x.userNode})},de=te=>{if(!($b(te.nativeEvent)||E)){if(Tb.includes(te.key)&&q){const ue=te.key==="Escape";kh({id:e,store:X,unselect:ue,nodeRef:B})}else if(R&&_.selected&&Object.prototype.hasOwnProperty.call(eu,te.key)){te.preventDefault();const{ariaLabelConfig:ue}=X.getState();X.setState({ariaLiveMessage:ue["node.a11yDescription.ariaLiveMessage"]({direction:te.key.replace("Arrow","").toLowerCase(),x:~~x.positionAbsolute.x,y:~~x.positionAbsolute.y})}),j({direction:eu[te.key],factor:te.shiftKey?4:1})}}},se=()=>{if(E||!B.current?.matches(":focus-visible"))return;const{transform:te,width:ue,height:Ee,autoPanOnNodeFocus:Se,setCenter:ge}=X.getState();if(!Se)return;Wh(new Map([[e,_]]),{x:0,y:0,width:ue,height:Ee},te,!0).length>0||ge(_.position.x+$.width/2,_.position.y+$.height/2,{zoom:te[2]})};return S.jsx("div",{className:bt(["react-flow__node",`react-flow__node-${O}`,{[w]:R},_.className,{selected:_.selected,selectable:q,parent:T,draggable:R,dragging:K}]),ref:B,style:{zIndex:x.z,transform:`translate(${x.positionAbsolute.x}px,${x.positionAbsolute.y}px)`,pointerEvents:Y?"all":"none",visibility:W?"visible":"hidden",..._.style,...L},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:ee,onMouseMove:k,onMouseLeave:H,onContextMenu:ne,onClick:fe,onDoubleClick:ae,onKeyDown:G?de:void 0,tabIndex:G?0:void 0,onFocus:G?se:void 0,role:_.ariaRole??(G?"group":void 0),"aria-roledescription":"node","aria-describedby":E?void 0:`${s1}-${N}`,"aria-label":_.ariaLabel,..._.domAttributes,children:S.jsx(YT,{value:e,children:S.jsx(D,{id:e,data:_.data,type:O,positionAbsoluteX:x.positionAbsolute.x,positionAbsoluteY:x.positionAbsolute.y,selected:_.selected??!1,selectable:q,draggable:R,deletable:_.deletable??!0,isConnectable:P,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:K,dragHandle:_.dragHandle,zIndex:x.z,parentId:_.parentId,...$})})})}var cC=V.memo(rC);const uC=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function m1(e){const{nodesDraggable:n,nodesConnectable:s,nodesFocusable:l,elementsSelectable:o,onError:c}=Be(uC,tt),u=sC(e.onlyRenderVisibleElements),h=lC();return S.jsx("div",{className:"react-flow__nodes",style:bu,children:u.map(d=>S.jsx(cC,{id:d,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:h,nodesDraggable:n,nodesConnectable:s,nodesFocusable:l,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:c},d))})}m1.displayName="NodeRenderer";const fC=V.memo(m1);function dC(e){return Be(V.useCallback(s=>{if(!e)return s.edges.map(o=>o.id);const l=[];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&&lA({sourceNode:c,targetNode:u,width:s.width,height:s.height,transform:s.transform})&&l.push(o.id)}return l},[e]),tt)}const hC=({color:e="none",strokeWidth:n=1})=>{const s={strokeWidth:n,...e&&{stroke:e}};return S.jsx("polyline",{className:"arrow",style:s,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},mC=({color:e="none",strokeWidth:n=1})=>{const s={strokeWidth:n,...e&&{stroke:e,fill:e}};return S.jsx("polyline",{className:"arrowclosed",style:s,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},pv={[Ro.Arrow]:hC,[Ro.ArrowClosed]:mC};function gC(e){const n=it();return V.useMemo(()=>Object.prototype.hasOwnProperty.call(pv,e)?pv[e]:(n.getState().onError?.("009",zn.error009(e)),null),[e])}const pC=({id:e,type:n,color:s,width:l=12.5,height:o=12.5,markerUnits:c="strokeWidth",strokeWidth:u,orient:h="auto-start-reverse"})=>{const d=gC(n);return d?S.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${l}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:h,refX:"0",refY:"0",children:S.jsx(d,{color:s,strokeWidth:u})}):null},g1=({defaultColor:e,rfId:n})=>{const s=Be(c=>c.edges),l=Be(c=>c.defaultEdgeOptions),o=V.useMemo(()=>mA(s,{id:n,defaultColor:e,defaultMarkerStart:l?.markerStart,defaultMarkerEnd:l?.markerEnd}),[s,l,n,e]);return o.length?S.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:S.jsx("defs",{children:o.map(c=>S.jsx(pC,{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};g1.displayName="MarkerDefinitions";var yC=V.memo(g1);function p1({x:e,y:n,label:s,labelStyle:l,labelShowBg:o=!0,labelBgStyle:c,labelBgPadding:u=[2,4],labelBgBorderRadius:h=2,children:d,className:g,...y}){const[p,v]=V.useState({x:1,y:0,width:0,height:0}),w=bt(["react-flow__edge-textwrapper",g]),E=V.useRef(null);return V.useEffect(()=>{if(E.current){const N=E.current.getBBox();v({x:N.x,y:N.y,width:N.width,height:N.height})}},[s]),s?S.jsxs("g",{transform:`translate(${e-p.width/2} ${n-p.height/2})`,className:w,visibility:p.width?"visible":"hidden",...y,children:[o&&S.jsx("rect",{width:p.width+2*u[0],x:-u[0],y:-u[1],height:p.height+2*u[1],className:"react-flow__edge-textbg",style:c,rx:h,ry:h}),S.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:E,style:l,children:s}),d]}):null}p1.displayName="EdgeText";const vC=V.memo(p1);function Fo({path:e,labelX:n,labelY:s,label:l,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d,interactionWidth:g=20,...y}){return S.jsxs(S.Fragment,{children:[S.jsx("path",{...y,d:e,fill:"none",className:bt(["react-flow__edge-path",y.className])}),g?S.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:g,className:"react-flow__edge-interaction"}):null,l&&kn(n)&&kn(s)?S.jsx(vC,{x:n,y:s,label:l,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d}):null]})}function yv({pos:e,x1:n,y1:s,x2:l,y2:o}){return e===he.Left||e===he.Right?[.5*(n+l),s]:[n,.5*(s+o)]}function y1({sourceX:e,sourceY:n,sourcePosition:s=he.Bottom,targetX:l,targetY:o,targetPosition:c=he.Top}){const[u,h]=yv({pos:s,x1:e,y1:n,x2:l,y2:o}),[d,g]=yv({pos:c,x1:l,y1:o,x2:e,y2:n}),[y,p,v,w]=qb({sourceX:e,sourceY:n,targetX:l,targetY:o,sourceControlX:u,sourceControlY:h,targetControlX:d,targetControlY:g});return[`M${e},${n} C${u},${h} ${d},${g} ${l},${o}`,y,p,v,w]}function v1(e){return V.memo(({id:n,sourceX:s,sourceY:l,targetX:o,targetY:c,sourcePosition:u,targetPosition:h,label:d,labelStyle:g,labelShowBg:y,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:w,style:E,markerEnd:N,markerStart:A,interactionWidth:C})=>{const[z,_,x]=y1({sourceX:s,sourceY:l,sourcePosition:u,targetX:o,targetY:c,targetPosition:h}),T=e.isInternal?void 0:n;return S.jsx(Fo,{id:T,path:z,labelX:_,labelY:x,label:d,labelStyle:g,labelShowBg:y,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:w,style:E,markerEnd:N,markerStart:A,interactionWidth:C})})}const bC=v1({isInternal:!1}),b1=v1({isInternal:!0});bC.displayName="SimpleBezierEdge";b1.displayName="SimpleBezierEdgeInternal";function S1(e){return V.memo(({id:n,sourceX:s,sourceY:l,targetX:o,targetY:c,label:u,labelStyle:h,labelShowBg:d,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:p,style:v,sourcePosition:w=he.Bottom,targetPosition:E=he.Top,markerEnd:N,markerStart:A,pathOptions:C,interactionWidth:z})=>{const[_,x,T]=Th({sourceX:s,sourceY:l,sourcePosition:w,targetX:o,targetY:c,targetPosition:E,borderRadius:C?.borderRadius,offset:C?.offset,stepPosition:C?.stepPosition}),O=e.isInternal?void 0:n;return S.jsx(Fo,{id:O,path:_,labelX:x,labelY:T,label:u,labelStyle:h,labelShowBg:d,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:p,style:v,markerEnd:N,markerStart:A,interactionWidth:z})})}const w1=S1({isInternal:!1}),x1=S1({isInternal:!0});w1.displayName="SmoothStepEdge";x1.displayName="SmoothStepEdgeInternal";function E1(e){return V.memo(({id:n,...s})=>{const l=e.isInternal?void 0:n;return S.jsx(w1,{...s,id:l,pathOptions:V.useMemo(()=>({borderRadius:0,offset:s.pathOptions?.offset}),[s.pathOptions?.offset])})})}const SC=E1({isInternal:!1}),N1=E1({isInternal:!0});SC.displayName="StepEdge";N1.displayName="StepEdgeInternal";function _1(e){return V.memo(({id:n,sourceX:s,sourceY:l,targetX:o,targetY:c,label:u,labelStyle:h,labelShowBg:d,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:p,style:v,markerEnd:w,markerStart:E,interactionWidth:N})=>{const[A,C,z]=Yb({sourceX:s,sourceY:l,targetX:o,targetY:c}),_=e.isInternal?void 0:n;return S.jsx(Fo,{id:_,path:A,labelX:C,labelY:z,label:u,labelStyle:h,labelShowBg:d,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:p,style:v,markerEnd:w,markerStart:E,interactionWidth:N})})}const wC=_1({isInternal:!1}),A1=_1({isInternal:!0});wC.displayName="StraightEdge";A1.displayName="StraightEdgeInternal";function T1(e){return V.memo(({id:n,sourceX:s,sourceY:l,targetX:o,targetY:c,sourcePosition:u=he.Bottom,targetPosition:h=he.Top,label:d,labelStyle:g,labelShowBg:y,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:w,style:E,markerEnd:N,markerStart:A,pathOptions:C,interactionWidth:z})=>{const[_,x,T]=Ib({sourceX:s,sourceY:l,sourcePosition:u,targetX:o,targetY:c,targetPosition:h,curvature:C?.curvature}),O=e.isInternal?void 0:n;return S.jsx(Fo,{id:O,path:_,labelX:x,labelY:T,label:d,labelStyle:g,labelShowBg:y,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:w,style:E,markerEnd:N,markerStart:A,interactionWidth:z})})}const xC=T1({isInternal:!1}),C1=T1({isInternal:!0});xC.displayName="BezierEdge";C1.displayName="BezierEdgeInternal";const vv={default:C1,straight:A1,step:N1,smoothstep:x1,simplebezier:b1},bv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},EC=(e,n,s)=>s===he.Left?e-n:s===he.Right?e+n:e,NC=(e,n,s)=>s===he.Top?e-n:s===he.Bottom?e+n:e,Sv="react-flow__edgeupdater";function wv({position:e,centerX:n,centerY:s,radius:l=10,onMouseDown:o,onMouseEnter:c,onMouseOut:u,type:h}){return S.jsx("circle",{onMouseDown:o,onMouseEnter:c,onMouseOut:u,className:bt([Sv,`${Sv}-${h}`]),cx:EC(n,l,e),cy:NC(s,l,e),r:l,stroke:"transparent",fill:"transparent"})}function _C({isReconnectable:e,reconnectRadius:n,edge:s,sourceX:l,sourceY:o,targetX:c,targetY:u,sourcePosition:h,targetPosition:d,onReconnect:g,onReconnectStart:y,onReconnectEnd:p,setReconnecting:v,setUpdateHover:w}){const E=it(),N=(x,T)=>{if(x.button!==0)return;const{autoPanOnConnect:O,domNode:D,connectionMode:R,connectionRadius:q,lib:P,onConnectStart:G,cancelConnection:X,nodeLookup:W,rfId:B,panBy:K,updateConnection:j}=E.getState(),$=T.type==="target",L=(k,H)=>{v(!1),p?.(k,s,T.type,H)},Y=k=>g?.(s,k),ee=(k,H)=>{v(!0),y?.(x,s,T.type),G?.(k,H)};Oh.onPointerDown(x.nativeEvent,{autoPanOnConnect:O,connectionMode:R,connectionRadius:q,domNode:D,handleId:T.id,nodeId:T.nodeId,nodeLookup:W,isTarget:$,edgeUpdaterType:T.type,lib:P,flowId:B,cancelConnection:X,panBy:K,isValidConnection:(...k)=>E.getState().isValidConnection?.(...k)??!0,onConnect:Y,onConnectStart:ee,onConnectEnd:(...k)=>E.getState().onConnectEnd?.(...k),onReconnectEnd:L,updateConnection:j,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,dragThreshold:E.getState().connectionDragThreshold,handleDomNode:x.currentTarget})},A=x=>N(x,{nodeId:s.target,id:s.targetHandle??null,type:"target"}),C=x=>N(x,{nodeId:s.source,id:s.sourceHandle??null,type:"source"}),z=()=>w(!0),_=()=>w(!1);return S.jsxs(S.Fragment,{children:[(e===!0||e==="source")&&S.jsx(wv,{position:h,centerX:l,centerY:o,radius:n,onMouseDown:A,onMouseEnter:z,onMouseOut:_,type:"source"}),(e===!0||e==="target")&&S.jsx(wv,{position:d,centerX:c,centerY:u,radius:n,onMouseDown:C,onMouseEnter:z,onMouseOut:_,type:"target"})]})}function AC({id:e,edgesFocusable:n,edgesReconnectable:s,elementsSelectable:l,onClick:o,onDoubleClick:c,onContextMenu:u,onMouseEnter:h,onMouseMove:d,onMouseLeave:g,reconnectRadius:y,onReconnect:p,onReconnectStart:v,onReconnectEnd:w,rfId:E,edgeTypes:N,noPanClassName:A,onError:C,disableKeyboardA11y:z}){let _=Be(ge=>ge.edgeLookup.get(e));const x=Be(ge=>ge.defaultEdgeOptions);_=x?{...x,..._}:_;let T=_.type||"default",O=N?.[T]||vv[T];O===void 0&&(C?.("011",zn.error011(T)),T="default",O=N?.default||vv.default);const D=!!(_.focusable||n&&typeof _.focusable>"u"),R=typeof p<"u"&&(_.reconnectable||s&&typeof _.reconnectable>"u"),q=!!(_.selectable||l&&typeof _.selectable>"u"),P=V.useRef(null),[G,X]=V.useState(!1),[W,B]=V.useState(!1),K=it(),{zIndex:j,sourceX:$,sourceY:L,targetX:Y,targetY:ee,sourcePosition:k,targetPosition:H}=Be(V.useCallback(ge=>{const ve=ge.nodeLookup.get(_.source),xe=ge.nodeLookup.get(_.target);if(!ve||!xe)return{zIndex:_.zIndex,...bv};const ze=hA({id:e,sourceNode:ve,targetNode:xe,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:ge.connectionMode,onError:C});return{zIndex:aA({selected:_.selected,zIndex:_.zIndex,sourceNode:ve,targetNode:xe,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode}),...ze||bv}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),tt),ne=V.useMemo(()=>_.markerStart?`url('#${Ch(_.markerStart,E)}')`:void 0,[_.markerStart,E]),ae=V.useMemo(()=>_.markerEnd?`url('#${Ch(_.markerEnd,E)}')`:void 0,[_.markerEnd,E]);if(_.hidden||$===null||L===null||Y===null||ee===null)return null;const fe=ge=>{const{addSelectedEdges:ve,unselectNodesAndEdges:xe,multiSelectionActive:ze}=K.getState();q&&(K.setState({nodesSelectionActive:!1}),_.selected&&ze?(xe({nodes:[],edges:[_]}),P.current?.blur()):ve([e])),o&&o(ge,_)},de=c?ge=>{c(ge,{..._})}:void 0,se=u?ge=>{u(ge,{..._})}:void 0,te=h?ge=>{h(ge,{..._})}:void 0,ue=d?ge=>{d(ge,{..._})}:void 0,Ee=g?ge=>{g(ge,{..._})}:void 0,Se=ge=>{if(!z&&Tb.includes(ge.key)&&q){const{unselectNodesAndEdges:ve,addSelectedEdges:xe}=K.getState();ge.key==="Escape"?(P.current?.blur(),ve({edges:[_]})):xe([e])}};return S.jsx("svg",{style:{zIndex:j},children:S.jsxs("g",{className:bt(["react-flow__edge",`react-flow__edge-${T}`,_.className,A,{selected:_.selected,animated:_.animated,inactive:!q&&!o,updating:G,selectable:q}]),onClick:fe,onDoubleClick:de,onContextMenu:se,onMouseEnter:te,onMouseMove:ue,onMouseLeave:Ee,onKeyDown:D?Se:void 0,tabIndex:D?0:void 0,role:_.ariaRole??(D?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":D?`${a1}-${E}`:void 0,ref:P,..._.domAttributes,children:[!W&&S.jsx(O,{id:e,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:q,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:$,sourceY:L,targetX:Y,targetY:ee,sourcePosition:k,targetPosition:H,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:ne,markerEnd:ae,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),R&&S.jsx(_C,{edge:_,isReconnectable:R,reconnectRadius:y,onReconnect:p,onReconnectStart:v,onReconnectEnd:w,sourceX:$,sourceY:L,targetX:Y,targetY:ee,sourcePosition:k,targetPosition:H,setUpdateHover:X,setReconnecting:B})]})})}var TC=V.memo(AC);const CC=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function M1({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:s,edgeTypes:l,noPanClassName:o,onReconnect:c,onEdgeContextMenu:u,onEdgeMouseEnter:h,onEdgeMouseMove:d,onEdgeMouseLeave:g,onEdgeClick:y,reconnectRadius:p,onEdgeDoubleClick:v,onReconnectStart:w,onReconnectEnd:E,disableKeyboardA11y:N}){const{edgesFocusable:A,edgesReconnectable:C,elementsSelectable:z,onError:_}=Be(CC,tt),x=dC(n);return S.jsxs("div",{className:"react-flow__edges",children:[S.jsx(yC,{defaultColor:e,rfId:s}),x.map(T=>S.jsx(TC,{id:T,edgesFocusable:A,edgesReconnectable:C,elementsSelectable:z,noPanClassName:o,onReconnect:c,onContextMenu:u,onMouseEnter:h,onMouseMove:d,onMouseLeave:g,onClick:y,reconnectRadius:p,onDoubleClick:v,onReconnectStart:w,onReconnectEnd:E,rfId:s,onError:_,edgeTypes:l,disableKeyboardA11y:N},T))]})}M1.displayName="EdgeRenderer";const MC=V.memo(M1),OC=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function kC({children:e}){const n=Be(OC);return S.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function jC(e){const n=vu(),s=V.useRef(!1);V.useEffect(()=>{!s.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),s.current=!0)},[e,n.viewportInitialized])}const zC=e=>e.panZoom?.syncViewport;function DC(e){const n=Be(zC),s=it();return V.useEffect(()=>{e&&(n?.(e),s.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function RC(e){return e.connection.inProgress?{...e.connection,to:cl(e.connection.to,e.transform)}:{...e.connection}}function BC(e){return RC}function LC(e){const n=BC();return Be(n,tt)}const HC=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function $C({containerStyle:e,style:n,type:s,component:l}){const{nodesConnectable:o,width:c,height:u,isValid:h,inProgress:d}=Be(HC,tt);return!(c&&o&&d)?null:S.jsx("svg",{style:e,width:c,height:u,className:"react-flow__connectionline react-flow__container",children:S.jsx("g",{className:bt(["react-flow__connection",Ob(h)]),children:S.jsx(O1,{style:n,type:s,CustomComponent:l,isValid:h})})})}const O1=({style:e,type:n=ls.Bezier,CustomComponent:s,isValid:l})=>{const{inProgress:o,from:c,fromNode:u,fromHandle:h,fromPosition:d,to:g,toNode:y,toHandle:p,toPosition:v,pointer:w}=LC();if(!o)return;if(s)return S.jsx(s,{connectionLineType:n,connectionLineStyle:e,fromNode:u,fromHandle:h,fromX:c.x,fromY:c.y,toX:g.x,toY:g.y,fromPosition:d,toPosition:v,connectionStatus:Ob(l),toNode:y,toHandle:p,pointer:w});let E="";const N={sourceX:c.x,sourceY:c.y,sourcePosition:d,targetX:g.x,targetY:g.y,targetPosition:v};switch(n){case ls.Bezier:[E]=Ib(N);break;case ls.SimpleBezier:[E]=y1(N);break;case ls.Step:[E]=Th({...N,borderRadius:0});break;case ls.SmoothStep:[E]=Th(N);break;default:[E]=Yb(N)}return S.jsx("path",{d:E,fill:"none",className:"react-flow__connection-path",style:e})};O1.displayName="ConnectionLine";const UC={};function xv(e=UC){V.useRef(e),it(),V.useEffect(()=>{},[e])}function qC(){it(),V.useRef(!1),V.useEffect(()=>{},[])}function k1({nodeTypes:e,edgeTypes:n,onInit:s,onNodeClick:l,onEdgeClick:o,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:h,onNodeMouseMove:d,onNodeMouseLeave:g,onNodeContextMenu:y,onSelectionContextMenu:p,onSelectionStart:v,onSelectionEnd:w,connectionLineType:E,connectionLineStyle:N,connectionLineComponent:A,connectionLineContainerStyle:C,selectionKeyCode:z,selectionOnDrag:_,selectionMode:x,multiSelectionKeyCode:T,panActivationKeyCode:O,zoomActivationKeyCode:D,deleteKeyCode:R,onlyRenderVisibleElements:q,elementsSelectable:P,defaultViewport:G,translateExtent:X,minZoom:W,maxZoom:B,preventScrolling:K,defaultMarkerColor:j,zoomOnScroll:$,zoomOnPinch:L,panOnScroll:Y,panOnScrollSpeed:ee,panOnScrollMode:k,zoomOnDoubleClick:H,panOnDrag:ne,autoPanOnSelection:ae,onPaneClick:fe,onPaneMouseEnter:de,onPaneMouseMove:se,onPaneMouseLeave:te,onPaneScroll:ue,onPaneContextMenu:Ee,paneClickDistance:Se,nodeClickDistance:ge,onEdgeContextMenu:ve,onEdgeMouseEnter:xe,onEdgeMouseMove:ze,onEdgeMouseLeave:Ye,reconnectRadius:St,onReconnect:rt,onReconnectStart:ht,onReconnectEnd:Mt,noDragClassName:De,noWheelClassName:Lt,noPanClassName:Ht,disableKeyboardA11y:st,nodeExtent:zt,rfId:$t,viewport:qe,onViewportChange:Nt}){return xv(e),xv(n),qC(),jC(s),DC(qe),S.jsx(nC,{onPaneClick:fe,onPaneMouseEnter:de,onPaneMouseMove:se,onPaneMouseLeave:te,onPaneContextMenu:Ee,onPaneScroll:ue,paneClickDistance:Se,deleteKeyCode:R,selectionKeyCode:z,selectionOnDrag:_,selectionMode:x,onSelectionStart:v,onSelectionEnd:w,multiSelectionKeyCode:T,panActivationKeyCode:O,zoomActivationKeyCode:D,elementsSelectable:P,zoomOnScroll:$,zoomOnPinch:L,zoomOnDoubleClick:H,panOnScroll:Y,panOnScrollSpeed:ee,panOnScrollMode:k,panOnDrag:ne,autoPanOnSelection:ae,defaultViewport:G,translateExtent:X,minZoom:W,maxZoom:B,onSelectionContextMenu:p,preventScrolling:K,noDragClassName:De,noWheelClassName:Lt,noPanClassName:Ht,disableKeyboardA11y:st,onViewportChange:Nt,isControlledViewport:!!qe,children:S.jsxs(kC,{children:[S.jsx(MC,{edgeTypes:n,onEdgeClick:o,onEdgeDoubleClick:u,onReconnect:rt,onReconnectStart:ht,onReconnectEnd:Mt,onlyRenderVisibleElements:q,onEdgeContextMenu:ve,onEdgeMouseEnter:xe,onEdgeMouseMove:ze,onEdgeMouseLeave:Ye,reconnectRadius:St,defaultMarkerColor:j,noPanClassName:Ht,disableKeyboardA11y:st,rfId:$t}),S.jsx($C,{style:N,type:E,component:A,containerStyle:C}),S.jsx("div",{className:"react-flow__edgelabel-renderer"}),S.jsx(fC,{nodeTypes:e,onNodeClick:l,onNodeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:d,onNodeMouseLeave:g,onNodeContextMenu:y,nodeClickDistance:ge,onlyRenderVisibleElements:q,noPanClassName:Ht,noDragClassName:De,disableKeyboardA11y:st,nodeExtent:zt,rfId:$t}),S.jsx("div",{className:"react-flow__viewport-portal"})]})})}k1.displayName="GraphView";const IC=V.memo(k1),VC=Rb(),Ev=({nodes:e,edges:n,defaultNodes:s,defaultEdges:l,width:o,height:c,fitView:u,fitViewOptions:h,minZoom:d=.5,maxZoom:g=2,nodeOrigin:y,nodeExtent:p,zIndexMode:v="basic"}={})=>{const w=new Map,E=new Map,N=new Map,A=new Map,C=l??n??[],z=s??e??[],_=y??[0,0],x=p??zo;Kb(N,A,C);const{nodesInitialized:T}=Mh(z,w,E,{nodeOrigin:_,nodeExtent:x,zIndexMode:v});let O=[0,0,1];if(u&&o&&c){const D=Qo(w,{filter:G=>!!((G.width||G.initialWidth)&&(G.height||G.initialHeight))}),{x:R,y:q,zoom:P}=em(D,o,c,d,g,h?.padding??.1);O=[R,q,P]}return{rfId:"1",width:o??0,height:c??0,transform:O,nodes:z,nodesInitialized:T,nodeLookup:w,parentLookup:E,edges:C,edgeLookup:A,connectionLookup:N,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:s!==void 0,hasDefaultEdges:l!==void 0,panZoom:null,minZoom:d,maxZoom:g,translateExtent:zo,nodeExtent:x,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:tl.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:h,fitViewResolver:null,connection:{...Mb},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:VC,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Cb,zIndexMode:v,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},YC=({nodes:e,edges:n,defaultNodes:s,defaultEdges:l,width:o,height:c,fitView:u,fitViewOptions:h,minZoom:d,maxZoom:g,nodeOrigin:y,nodeExtent:p,zIndexMode:v})=>nT((w,E)=>{async function N(){const{nodeLookup:A,panZoom:C,fitViewOptions:z,fitViewResolver:_,width:x,height:T,minZoom:O,maxZoom:D}=E();C&&(await W_({nodes:A,width:x,height:T,panZoom:C,minZoom:O,maxZoom:D},z),_?.resolve(!0),w({fitViewResolver:null}))}return{...Ev({nodes:e,edges:n,width:o,height:c,fitView:u,fitViewOptions:h,minZoom:d,maxZoom:g,nodeOrigin:y,nodeExtent:p,defaultNodes:s,defaultEdges:l,zIndexMode:v}),setNodes:A=>{const{nodeLookup:C,parentLookup:z,nodeOrigin:_,elevateNodesOnSelect:x,fitViewQueued:T,zIndexMode:O,nodesSelectionActive:D}=E(),{nodesInitialized:R,hasSelectedNodes:q}=Mh(A,C,z,{nodeOrigin:_,nodeExtent:p,elevateNodesOnSelect:x,checkEquality:!0,zIndexMode:O}),P=D&&q;T&&R?(N(),w({nodes:A,nodesInitialized:R,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:P})):w({nodes:A,nodesInitialized:R,nodesSelectionActive:P})},setEdges:A=>{const{connectionLookup:C,edgeLookup:z}=E();Kb(C,z,A),w({edges:A})},setDefaultNodesAndEdges:(A,C)=>{if(A){const{setNodes:z}=E();z(A),w({hasDefaultNodes:!0})}if(C){const{setEdges:z}=E();z(C),w({hasDefaultEdges:!0})}},updateNodeInternals:A=>{const{triggerNodeChanges:C,nodeLookup:z,parentLookup:_,domNode:x,nodeOrigin:T,nodeExtent:O,debug:D,fitViewQueued:R,zIndexMode:q}=E(),{changes:P,updatedInternals:G}=wA(A,z,_,x,T,O,q);G&&(yA(z,_,{nodeOrigin:T,nodeExtent:O,zIndexMode:q}),R?(N(),w({fitViewQueued:!1,fitViewOptions:void 0})):w({}),P?.length>0&&(D&&console.log("React Flow: trigger node changes",P),C?.(P)))},updateNodePositions:(A,C=!1)=>{const z=[];let _=[];const{nodeLookup:x,triggerNodeChanges:T,connection:O,updateConnection:D,onNodesChangeMiddlewareMap:R}=E();for(const[q,P]of A){const G=x.get(q),X=!!(G?.expandParent&&G?.parentId&&P?.position),W={id:q,type:"position",position:X?{x:Math.max(0,P.position.x),y:Math.max(0,P.position.y)}:P.position,dragging:C};if(G&&O.inProgress&&O.fromNode.id===G.id){const B=Vs(G,O.fromHandle,he.Left,!0);D({...O,from:B})}X&&G.parentId&&z.push({id:q,parentId:G.parentId,rect:{...P.internals.positionAbsolute,width:P.measured.width??0,height:P.measured.height??0}}),_.push(W)}if(z.length>0){const{parentLookup:q,nodeOrigin:P}=E(),G=lm(z,x,q,P);_.push(...G)}for(const q of R.values())_=q(_);T(_)},triggerNodeChanges:A=>{const{onNodesChange:C,setNodes:z,nodes:_,hasDefaultNodes:x,debug:T}=E();if(A?.length){if(x){const O=NT(A,_);z(O)}T&&console.log("React Flow: trigger node changes",A),C?.(A)}},triggerEdgeChanges:A=>{const{onEdgesChange:C,setEdges:z,edges:_,hasDefaultEdges:x,debug:T}=E();if(A?.length){if(x){const O=_T(A,_);z(O)}T&&console.log("React Flow: trigger edge changes",A),C?.(A)}},addSelectedNodes:A=>{const{multiSelectionActive:C,edgeLookup:z,nodeLookup:_,triggerNodeChanges:x,triggerEdgeChanges:T}=E();if(C){const O=A.map(D=>js(D,!0));x(O);return}x($a(_,new Set([...A]),!0)),T($a(z))},addSelectedEdges:A=>{const{multiSelectionActive:C,edgeLookup:z,nodeLookup:_,triggerNodeChanges:x,triggerEdgeChanges:T}=E();if(C){const O=A.map(D=>js(D,!0));T(O);return}T($a(z,new Set([...A]))),x($a(_,new Set,!0))},unselectNodesAndEdges:({nodes:A,edges:C}={})=>{const{edges:z,nodes:_,nodeLookup:x,triggerNodeChanges:T,triggerEdgeChanges:O}=E(),D=A||_,R=C||z,q=[];for(const G of D){if(!G.selected)continue;const X=x.get(G.id);X&&(X.selected=!1),q.push(js(G.id,!1))}const P=[];for(const G of R)G.selected&&P.push(js(G.id,!1));T(q),O(P)},setMinZoom:A=>{const{panZoom:C,maxZoom:z}=E();C?.setScaleExtent([A,z]),w({minZoom:A})},setMaxZoom:A=>{const{panZoom:C,minZoom:z}=E();C?.setScaleExtent([z,A]),w({maxZoom:A})},setTranslateExtent:A=>{E().panZoom?.setTranslateExtent(A),w({translateExtent:A})},resetSelectedElements:()=>{const{edges:A,nodes:C,triggerNodeChanges:z,triggerEdgeChanges:_,elementsSelectable:x}=E();if(!x)return;const T=C.reduce((D,R)=>R.selected?[...D,js(R.id,!1)]:D,[]),O=A.reduce((D,R)=>R.selected?[...D,js(R.id,!1)]:D,[]);z(T),_(O)},setNodeExtent:A=>{const{nodes:C,nodeLookup:z,parentLookup:_,nodeOrigin:x,elevateNodesOnSelect:T,nodeExtent:O,zIndexMode:D}=E();A[0][0]===O[0][0]&&A[0][1]===O[0][1]&&A[1][0]===O[1][0]&&A[1][1]===O[1][1]||(Mh(C,z,_,{nodeOrigin:x,nodeExtent:A,elevateNodesOnSelect:T,checkEquality:!1,zIndexMode:D}),w({nodeExtent:A}))},panBy:A=>{const{transform:C,width:z,height:_,panZoom:x,translateExtent:T}=E();return xA({delta:A,panZoom:x,transform:C,translateExtent:T,width:z,height:_})},setCenter:async(A,C,z)=>{const{width:_,height:x,maxZoom:T,panZoom:O}=E();if(!O)return!1;const D=typeof z?.zoom<"u"?z.zoom:T;return await O.setViewport({x:_/2-A*D,y:x/2-C*D,zoom:D},{duration:z?.duration,ease:z?.ease,interpolate:z?.interpolate}),!0},cancelConnection:()=>{w({connection:{...Mb}})},updateConnection:A=>{w({connection:A})},reset:()=>w({...Ev()})}},Object.is);function j1({initialNodes:e,initialEdges:n,defaultNodes:s,defaultEdges:l,initialWidth:o,initialHeight:c,initialMinZoom:u,initialMaxZoom:h,initialFitViewOptions:d,fitView:g,nodeOrigin:y,nodeExtent:p,zIndexMode:v,children:w}){const[E]=V.useState(()=>YC({nodes:e,edges:n,defaultNodes:s,defaultEdges:l,width:o,height:c,fitView:g,minZoom:u,maxZoom:h,fitViewOptions:d,nodeOrigin:y,nodeExtent:p,zIndexMode:v}));return S.jsx(sT,{value:E,children:S.jsx(kT,{children:w})})}function GC({children:e,nodes:n,edges:s,defaultNodes:l,defaultEdges:o,width:c,height:u,fitView:h,fitViewOptions:d,minZoom:g,maxZoom:y,nodeOrigin:p,nodeExtent:v,zIndexMode:w}){return V.useContext(pu)?S.jsx(S.Fragment,{children:e}):S.jsx(j1,{initialNodes:n,initialEdges:s,defaultNodes:l,defaultEdges:o,initialWidth:c,initialHeight:u,fitView:h,initialFitViewOptions:d,initialMinZoom:g,initialMaxZoom:y,nodeOrigin:p,nodeExtent:v,zIndexMode:w,children:e})}const XC={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function KC({nodes:e,edges:n,defaultNodes:s,defaultEdges:l,className:o,nodeTypes:c,edgeTypes:u,onNodeClick:h,onEdgeClick:d,onInit:g,onMove:y,onMoveStart:p,onMoveEnd:v,onConnect:w,onConnectStart:E,onConnectEnd:N,onClickConnectStart:A,onClickConnectEnd:C,onNodeMouseEnter:z,onNodeMouseMove:_,onNodeMouseLeave:x,onNodeContextMenu:T,onNodeDoubleClick:O,onNodeDragStart:D,onNodeDrag:R,onNodeDragStop:q,onNodesDelete:P,onEdgesDelete:G,onDelete:X,onSelectionChange:W,onSelectionDragStart:B,onSelectionDrag:K,onSelectionDragStop:j,onSelectionContextMenu:$,onSelectionStart:L,onSelectionEnd:Y,onBeforeDelete:ee,connectionMode:k,connectionLineType:H=ls.Bezier,connectionLineStyle:ne,connectionLineComponent:ae,connectionLineContainerStyle:fe,deleteKeyCode:de="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:te=!1,selectionMode:ue=Do.Full,panActivationKeyCode:Ee="Space",multiSelectionKeyCode:Se=Lo()?"Meta":"Control",zoomActivationKeyCode:ge=Lo()?"Meta":"Control",snapToGrid:ve,snapGrid:xe,onlyRenderVisibleElements:ze=!1,selectNodesOnDrag:Ye,nodesDraggable:St,autoPanOnNodeFocus:rt,nodesConnectable:ht,nodesFocusable:Mt,nodeOrigin:De=l1,edgesFocusable:Lt,edgesReconnectable:Ht,elementsSelectable:st=!0,defaultViewport:zt=yT,minZoom:$t=.5,maxZoom:qe=2,translateExtent:Nt=zo,preventScrolling:fs=!0,nodeExtent:Kn,defaultMarkerColor:yl="#b1b1b7",zoomOnScroll:wi=!0,zoomOnPinch:Bn=!0,panOnScroll:at=!1,panOnScrollSpeed:Wt=.5,panOnScrollMode:Ge=Hs.Free,zoomOnDoubleClick:ds=!0,panOnDrag:hs=!0,onPaneClick:vl,onPaneMouseEnter:Ut,onPaneMouseMove:xi,onPaneMouseLeave:Ei,onPaneScroll:wn,onPaneContextMenu:Ni,paneClickDistance:Qn=1,nodeClickDistance:bl=0,children:Zs,onReconnect:le,onReconnectStart:me,onReconnectEnd:Ce,onEdgeContextMenu:Pe,onEdgeDoubleClick:qt,onEdgeMouseEnter:Dt,onEdgeMouseMove:ms,onEdgeMouseLeave:Sl,reconnectRadius:tr=10,onNodesChange:nr,onEdgesChange:Ln,noDragClassName:wt="nodrag",noWheelClassName:Ot="nowheel",noPanClassName:Zn="nopan",fitView:Fs,fitViewOptions:ir,connectOnClick:Du,attributionPosition:sr,proOptions:gs,defaultEdgeOptions:wl,elevateNodesOnSelect:_i=!0,elevateEdgesOnSelect:Ai=!1,disableKeyboardA11y:Ti=!1,autoPanOnConnect:Ci,autoPanOnNodeDrag:mt,autoPanOnSelection:ar=!0,autoPanSpeed:lr,connectionRadius:Fn,isValidConnection:Mi,onError:Ru,style:or,id:xl,nodeDragThreshold:Bu,connectionDragThreshold:Js,viewport:Ws,onViewportChange:xn,width:It,height:rr,colorMode:Lu="light",debug:El,onScroll:Nl,ariaLabelConfig:Ps,zIndexMode:cr="basic",...Vt},_l){const ea=xl||"1",Al=wT(Lu),Oi=V.useCallback(Tl=>{Tl.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Nl?.(Tl)},[Nl]);return S.jsx("div",{"data-testid":"rf__wrapper",...Vt,onScroll:Oi,style:{...or,...XC},ref:_l,className:bt(["react-flow",o,Al]),id:xl,role:"application",children:S.jsxs(GC,{nodes:e,edges:n,width:It,height:rr,fitView:Fs,fitViewOptions:ir,minZoom:$t,maxZoom:qe,nodeOrigin:De,nodeExtent:Kn,zIndexMode:cr,children:[S.jsx(ST,{nodes:e,edges:n,defaultNodes:s,defaultEdges:l,onConnect:w,onConnectStart:E,onConnectEnd:N,onClickConnectStart:A,onClickConnectEnd:C,nodesDraggable:St,autoPanOnNodeFocus:rt,nodesConnectable:ht,nodesFocusable:Mt,edgesFocusable:Lt,edgesReconnectable:Ht,elementsSelectable:st,elevateNodesOnSelect:_i,elevateEdgesOnSelect:Ai,minZoom:$t,maxZoom:qe,nodeExtent:Kn,onNodesChange:nr,onEdgesChange:Ln,snapToGrid:ve,snapGrid:xe,connectionMode:k,translateExtent:Nt,connectOnClick:Du,defaultEdgeOptions:wl,fitView:Fs,fitViewOptions:ir,onNodesDelete:P,onEdgesDelete:G,onDelete:X,onNodeDragStart:D,onNodeDrag:R,onNodeDragStop:q,onSelectionDrag:K,onSelectionDragStart:B,onSelectionDragStop:j,onMove:y,onMoveStart:p,onMoveEnd:v,noPanClassName:Zn,nodeOrigin:De,rfId:ea,autoPanOnConnect:Ci,autoPanOnNodeDrag:mt,autoPanSpeed:lr,onError:Ru,connectionRadius:Fn,isValidConnection:Mi,selectNodesOnDrag:Ye,nodeDragThreshold:Bu,connectionDragThreshold:Js,onBeforeDelete:ee,debug:El,ariaLabelConfig:Ps,zIndexMode:cr}),S.jsx(IC,{onInit:g,onNodeClick:h,onEdgeClick:d,onNodeMouseEnter:z,onNodeMouseMove:_,onNodeMouseLeave:x,onNodeContextMenu:T,onNodeDoubleClick:O,nodeTypes:c,edgeTypes:u,connectionLineType:H,connectionLineStyle:ne,connectionLineComponent:ae,connectionLineContainerStyle:fe,selectionKeyCode:se,selectionOnDrag:te,selectionMode:ue,deleteKeyCode:de,multiSelectionKeyCode:Se,panActivationKeyCode:Ee,zoomActivationKeyCode:ge,onlyRenderVisibleElements:ze,defaultViewport:zt,translateExtent:Nt,minZoom:$t,maxZoom:qe,preventScrolling:fs,zoomOnScroll:wi,zoomOnPinch:Bn,zoomOnDoubleClick:ds,panOnScroll:at,panOnScrollSpeed:Wt,panOnScrollMode:Ge,panOnDrag:hs,autoPanOnSelection:ar,onPaneClick:vl,onPaneMouseEnter:Ut,onPaneMouseMove:xi,onPaneMouseLeave:Ei,onPaneScroll:wn,onPaneContextMenu:Ni,paneClickDistance:Qn,nodeClickDistance:bl,onSelectionContextMenu:$,onSelectionStart:L,onSelectionEnd:Y,onReconnect:le,onReconnectStart:me,onReconnectEnd:Ce,onEdgeContextMenu:Pe,onEdgeDoubleClick:qt,onEdgeMouseEnter:Dt,onEdgeMouseMove:ms,onEdgeMouseLeave:Sl,reconnectRadius:tr,defaultMarkerColor:yl,noDragClassName:wt,noWheelClassName:Ot,noPanClassName:Zn,rfId:ea,disableKeyboardA11y:Ti,nodeExtent:Kn,viewport:Ws,onViewportChange:xn}),S.jsx(pT,{onSelectionChange:W}),Zs,S.jsx(fT,{proOptions:gs,position:sr}),S.jsx(uT,{rfId:ea,disableKeyboardA11y:Ti})]})})}var QC=r1(KC);const ZC=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function FC({children:e}){const n=Be(ZC);return n?iT.createPortal(e,n):null}function JC({dimensions:e,lineWidth:n,variant:s,className:l}){return S.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:bt(["react-flow__background-pattern",s,l])})}function WC({radius:e,className:n}){return S.jsx("circle",{cx:e,cy:e,r:e,className:bt(["react-flow__background-pattern","dots",n])})}var os;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(os||(os={}));const PC={[os.Dots]:1,[os.Lines]:1,[os.Cross]:6},eM=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function z1({id:e,variant:n=os.Dots,gap:s=20,size:l,lineWidth:o=1,offset:c=0,color:u,bgColor:h,style:d,className:g,patternClassName:y}){const p=V.useRef(null),{transform:v,patternId:w}=Be(eM,tt),E=l||PC[n],N=n===os.Dots,A=n===os.Cross,C=Array.isArray(s)?s:[s,s],z=[C[0]*v[2]||1,C[1]*v[2]||1],_=E*v[2],x=Array.isArray(c)?c:[c,c],T=A?[_,_]:z,O=[x[0]*v[2]||1+T[0]/2,x[1]*v[2]||1+T[1]/2],D=`${w}${e||""}`;return S.jsxs("svg",{className:bt(["react-flow__background",g]),style:{...d,...bu,"--xy-background-color-props":h,"--xy-background-pattern-color-props":u},ref:p,"data-testid":"rf__background",children:[S.jsx("pattern",{id:D,x:v[0]%z[0],y:v[1]%z[1],width:z[0],height:z[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${O[0]},-${O[1]})`,children:N?S.jsx(WC,{radius:_/2,className:y}):S.jsx(JC,{dimensions:T,lineWidth:o,variant:n,className:y})}),S.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${D})`})]})}z1.displayName="Background";const tM=V.memo(z1);function nM(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:S.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function iM(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:S.jsx("path",{d:"M0 0h32v4.2H0z"})})}function sM(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:S.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function aM(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:S.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function lM(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:S.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Tc({children:e,className:n,...s}){return S.jsx("button",{type:"button",className:bt(["react-flow__controls-button",n]),...s,children:e})}const oM=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function D1({style:e,showZoom:n=!0,showFitView:s=!0,showInteractive:l=!0,fitViewOptions:o,onZoomIn:c,onZoomOut:u,onFitView:h,onInteractiveChange:d,className:g,children:y,position:p="bottom-left",orientation:v="vertical","aria-label":w}){const E=it(),{isInteractive:N,minZoomReached:A,maxZoomReached:C,ariaLabelConfig:z}=Be(oM,tt),{zoomIn:_,zoomOut:x,fitView:T}=vu(),O=()=>{_(),c?.()},D=()=>{x(),u?.()},R=()=>{T(o),h?.()},q=()=>{E.setState({nodesDraggable:!N,nodesConnectable:!N,elementsSelectable:!N}),d?.(!N)},P=v==="horizontal"?"horizontal":"vertical";return S.jsxs(yu,{className:bt(["react-flow__controls",P,g]),position:p,style:e,"data-testid":"rf__controls","aria-label":w??z["controls.ariaLabel"],children:[n&&S.jsxs(S.Fragment,{children:[S.jsx(Tc,{onClick:O,className:"react-flow__controls-zoomin",title:z["controls.zoomIn.ariaLabel"],"aria-label":z["controls.zoomIn.ariaLabel"],disabled:C,children:S.jsx(nM,{})}),S.jsx(Tc,{onClick:D,className:"react-flow__controls-zoomout",title:z["controls.zoomOut.ariaLabel"],"aria-label":z["controls.zoomOut.ariaLabel"],disabled:A,children:S.jsx(iM,{})})]}),s&&S.jsx(Tc,{className:"react-flow__controls-fitview",onClick:R,title:z["controls.fitView.ariaLabel"],"aria-label":z["controls.fitView.ariaLabel"],children:S.jsx(sM,{})}),l&&S.jsx(Tc,{className:"react-flow__controls-interactive",onClick:q,title:z["controls.interactive.ariaLabel"],"aria-label":z["controls.interactive.ariaLabel"],children:N?S.jsx(lM,{}):S.jsx(aM,{})}),y]})}D1.displayName="Controls";const rM=V.memo(D1);function cM({id:e,x:n,y:s,width:l,height:o,style:c,color:u,strokeColor:h,strokeWidth:d,className:g,borderRadius:y,shapeRendering:p,selected:v,onClick:w}){const{background:E,backgroundColor:N}=c||{},A=u||E||N;return S.jsx("rect",{className:bt(["react-flow__minimap-node",{selected:v},g]),x:n,y:s,rx:y,ry:y,width:l,height:o,style:{fill:A,stroke:h,strokeWidth:d},shapeRendering:p,onClick:w?C=>w(C,e):void 0})}const uM=V.memo(cM),fM=e=>e.nodes.map(n=>n.id),oh=e=>e instanceof Function?e:()=>e;function dM({nodeStrokeColor:e,nodeColor:n,nodeClassName:s="",nodeBorderRadius:l=5,nodeStrokeWidth:o,nodeComponent:c=uM,onClick:u}){const h=Be(fM,tt),d=oh(n),g=oh(e),y=oh(s),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return S.jsx(S.Fragment,{children:h.map(v=>S.jsx(mM,{id:v,nodeColorFunc:d,nodeStrokeColorFunc:g,nodeClassNameFunc:y,nodeBorderRadius:l,nodeStrokeWidth:o,NodeComponent:c,onClick:u,shapeRendering:p},v))})}function hM({id:e,nodeColorFunc:n,nodeStrokeColorFunc:s,nodeClassNameFunc:l,nodeBorderRadius:o,nodeStrokeWidth:c,shapeRendering:u,NodeComponent:h,onClick:d}){const{node:g,x:y,y:p,width:v,height:w}=Be(E=>{const N=E.nodeLookup.get(e);if(!N)return{node:void 0,x:0,y:0,width:0,height:0};const A=N.internals.userNode,{x:C,y:z}=N.internals.positionAbsolute,{width:_,height:x}=Si(A);return{node:A,x:C,y:z,width:_,height:x}},tt);return!g||g.hidden||!Bb(g)?null:S.jsx(h,{x:y,y:p,width:v,height:w,style:g.style,selected:!!g.selected,className:l(g),color:n(g),borderRadius:o,strokeColor:s(g),strokeWidth:c,shapeRendering:u,onClick:d,id:g.id})}const mM=V.memo(hM);var gM=V.memo(dM);const pM=200,yM=150,vM=e=>!e.hidden,bM=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?Db(Qo(e.nodeLookup,{filter:vM}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},SM="react-flow__minimap-desc";function R1({style:e,className:n,nodeStrokeColor:s,nodeColor:l,nodeClassName:o="",nodeBorderRadius:c=5,nodeStrokeWidth:u,nodeComponent:h,bgColor:d,maskColor:g,maskStrokeColor:y,maskStrokeWidth:p,position:v="bottom-right",onClick:w,onNodeClick:E,pannable:N=!1,zoomable:A=!1,ariaLabel:C,inversePan:z,zoomStep:_=1,offsetScale:x=5}){const T=it(),O=V.useRef(null),{boundingRect:D,viewBB:R,rfId:q,panZoom:P,translateExtent:G,flowWidth:X,flowHeight:W,ariaLabelConfig:B}=Be(bM,tt),K=e?.width??pM,j=e?.height??yM,$=D.width/K,L=D.height/j,Y=Math.max($,L),ee=Y*K,k=Y*j,H=x*Y,ne=D.x-(ee-D.width)/2-H,ae=D.y-(k-D.height)/2-H,fe=ee+H*2,de=k+H*2,se=`${SM}-${q}`,te=V.useRef(0),ue=V.useRef();te.current=Y,V.useEffect(()=>{if(O.current&&P)return ue.current=kA({domNode:O.current,panZoom:P,getTransform:()=>T.getState().transform,getViewScale:()=>te.current}),()=>{ue.current?.destroy()}},[P]),V.useEffect(()=>{ue.current?.update({translateExtent:G,width:X,height:W,inversePan:z,pannable:N,zoomStep:_,zoomable:A})},[N,A,z,_,G,X,W]);const Ee=w?ve=>{const[xe,ze]=ue.current?.pointer(ve)||[0,0];w(ve,{x:xe,y:ze})}:void 0,Se=E?V.useCallback((ve,xe)=>{const ze=T.getState().nodeLookup.get(xe).internals.userNode;E(ve,ze)},[]):void 0,ge=C??B["minimap.ariaLabel"];return S.jsx(yu,{position:v,style:{...e,"--xy-minimap-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-background-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-color-props":typeof y=="string"?y:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*Y:void 0,"--xy-minimap-node-background-color-props":typeof l=="string"?l: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:bt(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:S.jsxs("svg",{width:K,height:j,viewBox:`${ne} ${ae} ${fe} ${de}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:O,onClick:Ee,children:[ge&&S.jsx("title",{id:se,children:ge}),S.jsx(gM,{onClick:Se,nodeColor:l,nodeStrokeColor:s,nodeBorderRadius:c,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:h}),S.jsx("path",{className:"react-flow__minimap-mask",d:`M${ne-H},${ae-H}h${fe+H*2}v${de+H*2}h${-fe-H*2}z
15
+ M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}R1.displayName="MiniMap";V.memo(R1);const wM=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,xM={[al.Line]:"right",[al.Handle]:"bottom-right"};function EM({nodeId:e,position:n,variant:s=al.Handle,className:l,style:o=void 0,children:c,color:u,minWidth:h=10,minHeight:d=10,maxWidth:g=Number.MAX_VALUE,maxHeight:y=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:v,autoScale:w=!0,shouldResize:E,onResizeStart:N,onResize:A,onResizeEnd:C}){const z=d1(),_=typeof e=="string"?e:z,x=it(),T=V.useRef(null),O=s===al.Handle,D=Be(V.useCallback(wM(O&&w),[O,w]),tt),R=V.useRef(null),q=n??xM[s];V.useEffect(()=>{if(!(!T.current||!_))return R.current||(R.current=YA({domNode:T.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:G,transform:X,snapGrid:W,snapToGrid:B,nodeOrigin:K,domNode:j}=x.getState();return{nodeLookup:G,transform:X,snapGrid:W,snapToGrid:B,nodeOrigin:K,paneDomNode:j}},onChange:(G,X)=>{const{triggerNodeChanges:W,nodeLookup:B,parentLookup:K,nodeOrigin:j}=x.getState(),$=[],L={x:G.x,y:G.y},Y=B.get(_);if(Y&&Y.expandParent&&Y.parentId){const ee=Y.origin??j,k=G.width??Y.measured.width??0,H=G.height??Y.measured.height??0,ne={id:Y.id,parentId:Y.parentId,rect:{width:k,height:H,...Lb({x:G.x??Y.position.x,y:G.y??Y.position.y},{width:k,height:H},Y.parentId,B,ee)}},ae=lm([ne],B,K,j);$.push(...ae),L.x=G.x?Math.max(ee[0]*k,G.x):void 0,L.y=G.y?Math.max(ee[1]*H,G.y):void 0}if(L.x!==void 0&&L.y!==void 0){const ee={id:_,type:"position",position:{...L}};$.push(ee)}if(G.width!==void 0&&G.height!==void 0){const k={id:_,type:"dimensions",resizing:!0,setAttributes:v?v==="horizontal"?"width":"height":!0,dimensions:{width:G.width,height:G.height}};$.push(k)}for(const ee of X){const k={...ee,type:"position"};$.push(k)}W($)},onEnd:({width:G,height:X})=>{const W={id:_,type:"dimensions",resizing:!1,dimensions:{width:G,height:X}};x.getState().triggerNodeChanges([W])}})),R.current.update({controlPosition:q,boundaries:{minWidth:h,minHeight:d,maxWidth:g,maxHeight:y},keepAspectRatio:p,resizeDirection:v,onResizeStart:N,onResize:A,onResizeEnd:C,shouldResize:E}),()=>{R.current?.destroy()}},[q,h,d,g,y,p,N,A,C,E]);const P=q.split("-");return S.jsx("div",{className:bt(["react-flow__resize-control","nodrag",...P,s,l]),ref:T,style:{...o,scale:D,...u&&{[O?"backgroundColor":"borderColor"]:u}},children:c})}V.memo(EM);const rh="emviz.viewerToken";let Da;function NM(){const e=new URLSearchParams(window.location.hash.slice(1));if(e.has("token")){const n=e.get("token")??"";Da=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(n)?n:void 0;try{Da?window.sessionStorage.setItem(rh,Da):window.sessionStorage.removeItem(rh)}catch{}window.history.replaceState(window.history.state,"",window.location.pathname+window.location.search)}if(!Da)try{Da=window.sessionStorage.getItem(rh)??void 0}catch{}return Da}function To(e,n={}){const s=new URL(e,window.location.href);if(s.origin!==window.location.origin||s.username||s.password||!s.pathname.startsWith("/api/"))throw new Error("API requests must stay on this server.");const l=new Headers(n.headers),o=NM();return o&&!l.has("X-Emviz-Token")&&l.set("X-Emviz-Token",o),fetch(s.href,{...n,headers:l,redirect:"error"})}function Nv(){const e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;const n=Array.from(e,s=>s.toString(16).padStart(2,"0")).join("");return n.slice(0,8)+"-"+n.slice(8,12)+"-"+n.slice(12,16)+"-"+n.slice(16,20)+"-"+n.slice(20)}const _v=3,_M=new Set(["command-event","event-query"]);function B1(e){return[...new Set(e)]}function L1(e){return e?.trim()?B1(e.split(/\r?\n/).map(n=>AM(n)).filter(n=>!!n)):[]}function AM(e){const n=e.trim();return n?n.replace(/^[-*+]\s+/,"").replace(/^\d+[.)]\s+/,"").trim().match(/^`?([A-Za-z_][A-Za-z0-9_.-]*)`?(?=\s*(?::|-|=|\(|,|$))/)?.[1]:void 0}function TM(e){const n=new Map(e.nodes.map(o=>[o.id,o])),s=new Map(e.nodes.map(o=>[o.id,L1(o.fields)])),l=new Map;for(const o of e.edges){if(!_M.has(o.kind))continue;const c=n.get(o.source),u=n.get(o.target);if(!Av(c)||!Av(u))continue;const h=s.get(o.source)??[],d=s.get(o.target)??[],g=new Set(d),y=h.filter(w=>g.has(w)),p=o.kind==="event-query"?MM(c,d,y):[],v=B1([...y,...p]);l.set(o.id,{sourceFieldNames:h,targetFieldNames:d,sharedFieldNames:y,derivedFieldNames:p,visibleFieldNames:v.slice(0,_v),remainingCount:Math.max(0,v.length-_v),sourceMissingFields:h.length===0,targetMissingFields:d.length===0})}return l}function CM(e,n){if(!n)return;const s=[...e.entries()].filter(([,l])=>l.sharedFieldNames.includes(n)||l.derivedFieldNames.includes(n)).map(([l])=>l);return s.length>0?new Set(s):void 0}function Av(e){return e?.type==="command"||e?.type==="event"||e?.type==="query"}function MM(e,n,s){const l=Tv(e.label),o=new Set(s);return n.filter(c=>!o.has(c)&&Tv(c).includes(l))}function Tv(e){return e.replace(/^(has|is|was|were)/i,"").replace(/been/gi,"").replace(/[^A-Za-z0-9]/g,"").toLowerCase()}const rm=Symbol.for("yaml.alias"),jh=Symbol.for("yaml.document"),rs=Symbol.for("yaml.map"),H1=Symbol.for("yaml.pair"),Gn=Symbol.for("yaml.scalar"),ul=Symbol.for("yaml.seq"),Sn=Symbol.for("yaml.node.type"),Xs=e=>!!e&&typeof e=="object"&&e[Sn]===rm,Ks=e=>!!e&&typeof e=="object"&&e[Sn]===jh,fl=e=>!!e&&typeof e=="object"&&e[Sn]===rs,nt=e=>!!e&&typeof e=="object"&&e[Sn]===H1,Fe=e=>!!e&&typeof e=="object"&&e[Sn]===Gn,dl=e=>!!e&&typeof e=="object"&&e[Sn]===ul;function lt(e){if(e&&typeof e=="object")switch(e[Sn]){case rs:case ul:return!0}return!1}function ot(e){if(e&&typeof e=="object")switch(e[Sn]){case rm:case rs:case Gn:case ul:return!0}return!1}const $1=e=>(Fe(e)||lt(e))&&!!e.anchor,Ft=Symbol("break visit"),U1=Symbol("skip children"),Yn=Symbol("remove node");function Qs(e,n){const s=q1(n);Ks(e)?Ua(null,e.contents,s,Object.freeze([e]))===Yn&&(e.contents=null):Ua(null,e,s,Object.freeze([]))}Qs.BREAK=Ft;Qs.SKIP=U1;Qs.REMOVE=Yn;function Ua(e,n,s,l){const o=I1(e,n,s,l);if(ot(o)||nt(o))return V1(e,l,o),Ua(e,o,s,l);if(typeof o!="symbol"){if(lt(n)){l=Object.freeze(l.concat(n));for(let c=0;c<n.items.length;++c){const u=Ua(c,n.items[c],s,l);if(typeof u=="number")c=u-1;else{if(u===Ft)return Ft;u===Yn&&(n.items.splice(c,1),c-=1)}}}else if(nt(n)){l=Object.freeze(l.concat(n));const c=Ua("key",n.key,s,l);if(c===Ft)return Ft;c===Yn&&(n.key=null);const u=Ua("value",n.value,s,l);if(u===Ft)return Ft;u===Yn&&(n.value=null)}}return o}async function Su(e,n){const s=q1(n);Ks(e)?await qa(null,e.contents,s,Object.freeze([e]))===Yn&&(e.contents=null):await qa(null,e,s,Object.freeze([]))}Su.BREAK=Ft;Su.SKIP=U1;Su.REMOVE=Yn;async function qa(e,n,s,l){const o=await I1(e,n,s,l);if(ot(o)||nt(o))return V1(e,l,o),qa(e,o,s,l);if(typeof o!="symbol"){if(lt(n)){l=Object.freeze(l.concat(n));for(let c=0;c<n.items.length;++c){const u=await qa(c,n.items[c],s,l);if(typeof u=="number")c=u-1;else{if(u===Ft)return Ft;u===Yn&&(n.items.splice(c,1),c-=1)}}}else if(nt(n)){l=Object.freeze(l.concat(n));const c=await qa("key",n.key,s,l);if(c===Ft)return Ft;c===Yn&&(n.key=null);const u=await qa("value",n.value,s,l);if(u===Ft)return Ft;u===Yn&&(n.value=null)}}return o}function q1(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function I1(e,n,s,l){if(typeof s=="function")return s(e,n,l);if(fl(n))return s.Map?.(e,n,l);if(dl(n))return s.Seq?.(e,n,l);if(nt(n))return s.Pair?.(e,n,l);if(Fe(n))return s.Scalar?.(e,n,l);if(Xs(n))return s.Alias?.(e,n,l)}function V1(e,n,s){const l=n[n.length-1];if(lt(l))l.items[e]=s;else if(nt(l))e==="key"?l.key=s:l.value=s;else if(Ks(l))l.contents=s;else{const o=Xs(l)?"alias":"scalar";throw new Error(`Cannot replace node with ${o} parent`)}}const OM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},kM=e=>e.replace(/[!,[\]{}]/g,n=>OM[n]);class Bt{constructor(n,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Bt.defaultYaml,n),this.tags=Object.assign({},Bt.defaultTags,s)}clone(){const n=new Bt(this.yaml,this.tags);return n.docStart=this.docStart,n}atDocument(){const n=new Bt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Bt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Bt.defaultTags);break}return n}add(n,s){this.atNextDocument&&(this.yaml={explicit:Bt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Bt.defaultTags),this.atNextDocument=!1);const l=n.trim().split(/[ \t]+/),o=l.shift();switch(o){case"%TAG":{if(l.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),l.length<2))return!1;const[c,u]=l;return this.tags[c]=u,!0}case"%YAML":{if(this.yaml.explicit=!0,l.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;const[c]=l;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[,l,o]=n.match(/^(.*!)([^!]*)$/s);o||s(`The ${n} tag has no suffix`);const c=this.tags[l];if(c)try{return c+decodeURIComponent(o)}catch(u){return s(String(u)),null}return l==="!"?n:(s(`Could not resolve tag: ${n}`),null)}tagString(n){for(const[s,l]of Object.entries(this.tags))if(n.startsWith(l))return s+kM(n.substring(l.length));return n[0]==="!"?n:`!<${n}>`}toString(n){const s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],l=Object.entries(this.tags);let o;if(n&&l.length>0&&ot(n.contents)){const c={};Qs(n.contents,(u,h)=>{ot(h)&&h.tag&&(c[h.tag]=!0)}),o=Object.keys(c)}else o=[];for(const[c,u]of l)c==="!!"&&u==="tag:yaml.org,2002:"||(!n||o.some(h=>h.startsWith(u)))&&s.push(`%TAG ${c} ${u}`);return s.join(`
16
+ `)}}Bt.defaultYaml={explicit:!1,version:"1.2"};Bt.defaultTags={"!!":"tag:yaml.org,2002:"};function Y1(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(s)}return!0}function G1(e){const n=new Set;return Qs(e,{Value(s,l){l.anchor&&n.add(l.anchor)}}),n}function X1(e,n){for(let s=1;;++s){const l=`${e}${s}`;if(!n.has(l))return l}}function jM(e,n){const s=[],l=new Map;let o=null;return{onAnchor:c=>{s.push(c),o??(o=G1(e));const u=X1(n,o);return o.add(u),u},setAnchors:()=>{for(const c of s){const u=l.get(c);if(typeof u=="object"&&u.anchor&&(Fe(u.node)||lt(u.node)))u.node.anchor=u.anchor;else{const h=new Error("Failed to resolve repeated object (this should not happen)");throw h.source=c,h}}},sourceObjects:l}}function Ia(e,n,s,l){if(l&&typeof l=="object")if(Array.isArray(l))for(let o=0,c=l.length;o<c;++o){const u=l[o],h=Ia(e,l,String(o),u);h===void 0?delete l[o]:h!==u&&(l[o]=h)}else if(l instanceof Map)for(const o of Array.from(l.keys())){const c=l.get(o),u=Ia(e,l,o,c);u===void 0?l.delete(o):u!==c&&l.set(o,u)}else if(l instanceof Set)for(const o of Array.from(l)){const c=Ia(e,l,o,o);c===void 0?l.delete(o):c!==o&&(l.delete(o),l.add(c))}else for(const[o,c]of Object.entries(l)){const u=Ia(e,l,o,c);u===void 0?delete l[o]:u!==c&&(l[o]=u)}return e.call(n,s,l)}function bn(e,n,s){if(Array.isArray(e))return e.map((l,o)=>bn(l,String(o),s));if(e&&typeof e.toJSON=="function"){if(!s||!$1(e))return e.toJSON(n,s);const l={aliasCount:0,count:1,res:void 0};s.anchors.set(e,l),s.onCreate=c=>{l.res=c,delete s.onCreate};const o=e.toJSON(n,s);return s.onCreate&&s.onCreate(o),o}return typeof e=="bigint"&&!s?.keep?Number(e):e}class cm{constructor(n){Object.defineProperty(this,Sn,{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:l,onAnchor:o,reviver:c}={}){if(!Ks(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 l=="number"?l:100},h=bn(this,"",u);if(typeof o=="function")for(const{count:d,res:g}of u.anchors.values())o(g,d);return typeof c=="function"?Ia(c,{"":h},"",h):h}}class wu extends cm{constructor(n){super(rm),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 l;s?.aliasResolveCache?l=s.aliasResolveCache:(l=[],Qs(n,{Node:(c,u)=>{(Xs(u)||$1(u))&&l.push(u)}}),s&&(s.aliasResolveCache=l));let o;for(const c of l){if(c===this)break;c.anchor===this.source&&(o=c)}return o}toJSON(n,s){if(!s)return{source:this.source};const{anchors:l,doc:o,maxAliasCount:c}=s,u=this.resolve(o,s);if(!u){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let h=l.get(u);if(h||(bn(u,null,s),h=l.get(u)),h?.res===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(c>=0&&(h.count+=1,h.aliasCount===0&&(h.aliasCount=$c(o,u,l)),h.count*h.aliasCount>c)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return h.res}toString(n,s,l){const o=`*${this.source}`;if(n){if(Y1(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 $c(e,n,s){if(Xs(n)){const l=n.resolve(e),o=s&&l&&s.get(l);return o?o.count*o.aliasCount:0}else if(lt(n)){let l=0;for(const o of n.items){const c=$c(e,o,s);c>l&&(l=c)}return l}else if(nt(n)){const l=$c(e,n.key,s),o=$c(e,n.value,s);return Math.max(l,o)}return 1}const K1=e=>!e||typeof e!="function"&&typeof e!="object";class _e extends cm{constructor(n){super(Gn),this.value=n}toJSON(n,s){return s?.keep?this.value:bn(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 zM="tag:yaml.org,2002:";function DM(e,n,s){if(n){const l=s.filter(c=>c.tag===n),o=l.find(c=>!c.format)??l[0];if(!o)throw new Error(`Tag ${n} not found`);return o}return s.find(l=>l.identify?.(e)&&!l.format)}function $o(e,n,s){if(Ks(e)&&(e=e.contents),ot(e))return e;if(nt(e)){const p=s.schema[rs].createNode?.(s.schema,null,s);return p.items.push(e),p}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:l,onAnchor:o,onTagObj:c,schema:u,sourceObjects:h}=s;let d;if(l&&e&&typeof e=="object"){if(d=h.get(e),d)return d.anchor??(d.anchor=o(e)),new wu(d.anchor);d={anchor:null,node:null},h.set(e,d)}n?.startsWith("!!")&&(n=zM+n.slice(2));let g=DM(e,n,u.tags);if(!g){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const p=new _e(e);return d&&(d.node=p),p}g=e instanceof Map?u[rs]:Symbol.iterator in Object(e)?u[ul]:u[rs]}c&&(c(g),delete s.onTagObj);const y=g?.createNode?g.createNode(s.schema,e,s):typeof g?.nodeClass?.from=="function"?g.nodeClass.from(s.schema,e,s):new _e(e);return n?y.tag=n:g.default||(y.tag=g.tag),d&&(d.node=y),y}function tu(e,n,s){let l=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]=l,l=u}else l=new Map([[c,l]])}return $o(l,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Eo=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class Q1 extends cm{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(l=>ot(l)||nt(l)?l.clone(n):l),this.range&&(s.range=this.range.slice()),s}addIn(n,s){if(Eo(n))this.add(s);else{const[l,...o]=n,c=this.get(l,!0);if(lt(c))c.addIn(o,s);else if(c===void 0&&this.schema)this.set(l,tu(this.schema,o,s));else throw new Error(`Expected YAML collection at ${l}. Remaining path: ${o}`)}}deleteIn(n){const[s,...l]=n;if(l.length===0)return this.delete(s);const o=this.get(s,!0);if(lt(o))return o.deleteIn(l);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${l}`)}getIn(n,s){const[l,...o]=n,c=this.get(l,!0);return o.length===0?!s&&Fe(c)?c.value:c:lt(c)?c.getIn(o,s):void 0}hasAllNullValues(n){return this.items.every(s=>{if(!nt(s))return!1;const l=s.value;return l==null||n&&Fe(l)&&l.value==null&&!l.commentBefore&&!l.comment&&!l.tag})}hasIn(n){const[s,...l]=n;if(l.length===0)return this.has(s);const o=this.get(s,!0);return lt(o)?o.hasIn(l):!1}setIn(n,s){const[l,...o]=n;if(o.length===0)this.set(l,s);else{const c=this.get(l,!0);if(lt(c))c.setIn(o,s);else if(c===void 0&&this.schema)this.set(l,tu(this.schema,o,s));else throw new Error(`Expected YAML collection at ${l}. Remaining path: ${o}`)}}}const RM=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function yi(e,n){return/^\n+$/.test(e)?e.substring(1):n?e.replace(/^(?! *$)/gm,n):e}const Ds=(e,n,s)=>e.endsWith(`
17
+ `)?yi(s,n):s.includes(`
18
+ `)?`
19
+ `+yi(s,n):(e.endsWith(" ")?"":" ")+s,Z1="flow",zh="block",Uc="quoted";function xu(e,n,s="flow",{indentAtStart:l,lineWidth:o=80,minContentWidth:c=20,onFold:u,onOverflow:h}={}){if(!o||o<0)return e;o<c&&(c=0);const d=Math.max(1+c,1+o-n.length);if(e.length<=d)return e;const g=[],y={};let p=o-n.length;typeof l=="number"&&(l>o-Math.max(2,c)?g.push(0):p=o-l);let v,w,E=!1,N=-1,A=-1,C=-1;s===zh&&(N=Cv(e,N,n.length),N!==-1&&(p=N+d));for(let _;_=e[N+=1];){if(s===Uc&&_==="\\"){switch(A=N,e[N+1]){case"x":N+=3;break;case"u":N+=5;break;case"U":N+=9;break;default:N+=1}C=N}if(_===`
20
+ `)s===zh&&(N=Cv(e,N,n.length)),p=N+n.length+d,v=void 0;else{if(_===" "&&w&&w!==" "&&w!==`
21
+ `&&w!==" "){const x=e[N+1];x&&x!==" "&&x!==`
22
+ `&&x!==" "&&(v=N)}if(N>=p)if(v)g.push(v),p=v+d,v=void 0;else if(s===Uc){for(;w===" "||w===" ";)w=_,_=e[N+=1],E=!0;const x=N>C+1?N-2:A-1;if(y[x])return e;g.push(x),y[x]=!0,p=x+d,v=void 0}else E=!0}w=_}if(E&&h&&h(),g.length===0)return e;u&&u();let z=e.slice(0,g[0]);for(let _=0;_<g.length;++_){const x=g[_],T=g[_+1]||e.length;x===0?z=`
23
+ ${n}${e.slice(0,T)}`:(s===Uc&&y[x]&&(z+=`${e[x]}\\`),z+=`
24
+ ${n}${e.slice(x+1,T)}`)}return z}function Cv(e,n,s){let l=n,o=n+1,c=e[o];for(;c===" "||c===" ";)if(n<o+s)c=e[++n];else{do c=e[++n];while(c&&c!==`
25
+ `);l=n,o=n+1,c=e[o]}return l}const Eu=(e,n)=>({indentAtStart:n?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Nu=e=>/^(%|---|\.\.\.)/m.test(e);function BM(e,n,s){if(!n||n<0)return!1;const l=n-s,o=e.length;if(o<=l)return!1;for(let c=0,u=0;c<o;++c)if(e[c]===`
26
+ `){if(c-u>l)return!0;if(u=c+1,o-u<=l)return!1}return!0}function Co(e,n){const s=JSON.stringify(e);if(n.options.doubleQuotedAsJSON)return s;const{implicitKey:l}=n,o=n.options.doubleQuotedMinMultiLineLength,c=n.indent||(Nu(e)?" ":"");let u="",h=0;for(let d=0,g=s[d];g;g=s[++d])if(g===" "&&s[d+1]==="\\"&&s[d+2]==="n"&&(u+=s.slice(h,d)+"\\ ",d+=1,h=d,g="\\"),g==="\\")switch(s[d+1]){case"u":{u+=s.slice(h,d);const y=s.substr(d+2,4);switch(y){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:y.substr(0,2)==="00"?u+="\\x"+y.substr(2):u+=s.substr(d,6)}d+=5,h=d+1}break;case"n":if(l||s[d+2]==='"'||s.length<o)d+=1;else{for(u+=s.slice(h,d)+`
27
+
28
+ `;s[d+2]==="\\"&&s[d+3]==="n"&&s[d+4]!=='"';)u+=`
29
+ `,d+=2;u+=c,s[d+2]===" "&&(u+="\\"),d+=1,h=d+1}break;default:d+=1}return u=h?u+s.slice(h):s,l?u:xu(u,c,Uc,Eu(n,!1))}function Dh(e,n){if(n.options.singleQuote===!1||n.implicitKey&&e.includes(`
30
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Co(e,n);const s=n.indent||(Nu(e)?" ":""),l="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
31
+ ${s}`)+"'";return n.implicitKey?l:xu(l,s,Z1,Eu(n,!1))}function Va(e,n){const{singleQuote:s}=n.options;let l;if(s===!1)l=Co;else{const o=e.includes('"'),c=e.includes("'");o&&!c?l=Dh:c&&!o?l=Co:l=s?Dh:Co}return l(e,n)}let Rh;try{Rh=new RegExp(`(^|(?<!
32
+ ))
33
+ +(?!
34
+ |$)`,"g")}catch{Rh=/\n+(?!\n|$)/g}function qc({comment:e,type:n,value:s},l,o,c){const{blockQuote:u,commentString:h,lineWidth:d}=l.options;if(!u||/\n[\t ]+$/.test(s))return Va(s,l);const g=l.indent||(l.forceBlockIndent||Nu(s)?" ":""),y=u==="literal"?!0:u==="folded"||n===_e.BLOCK_FOLDED?!1:n===_e.BLOCK_LITERAL?!0:!BM(s,d,g.length);if(!s)return y?`|
35
+ `:`>
36
+ `;let p,v;for(v=s.length;v>0;--v){const T=s[v-1];if(T!==`
37
+ `&&T!==" "&&T!==" ")break}let w=s.substring(v);const E=w.indexOf(`
38
+ `);E===-1?p="-":s===w||E!==w.length-1?(p="+",c&&c()):p="",w&&(s=s.slice(0,-w.length),w[w.length-1]===`
39
+ `&&(w=w.slice(0,-1)),w=w.replace(Rh,`$&${g}`));let N=!1,A,C=-1;for(A=0;A<s.length;++A){const T=s[A];if(T===" ")N=!0;else if(T===`
40
+ `)C=A;else break}let z=s.substring(0,C<A?C+1:A);z&&(s=s.substring(z.length),z=z.replace(/\n+/g,`$&${g}`));let x=(N?g?"2":"1":"")+p;if(e&&(x+=" "+h(e.replace(/ ?[\r\n]+/g," ")),o&&o()),!y){const T=s.replace(/\n+/g,`
41
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${g}`);let O=!1;const D=Eu(l,!0);u!=="folded"&&n!==_e.BLOCK_FOLDED&&(D.onOverflow=()=>{O=!0});const R=xu(`${z}${T}${w}`,g,zh,D);if(!O)return`>${x}
42
+ ${g}${R}`}return s=s.replace(/\n+/g,`$&${g}`),`|${x}
43
+ ${g}${z}${s}${w}`}function LM(e,n,s,l){const{type:o,value:c}=e,{actualString:u,implicitKey:h,indent:d,indentStep:g,inFlow:y}=n;if(h&&c.includes(`
44
+ `)||y&&/[[\]{},]/.test(c))return Va(c,n);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return h||y||!c.includes(`
45
+ `)?Va(c,n):qc(e,n,s,l);if(!h&&!y&&o!==_e.PLAIN&&c.includes(`
46
+ `))return qc(e,n,s,l);if(Nu(c)){if(d==="")return n.forceBlockIndent=!0,qc(e,n,s,l);if(h&&d===g)return Va(c,n)}const p=c.replace(/\n+/g,`$&
47
+ ${d}`);if(u){const v=N=>N.default&&N.tag!=="tag:yaml.org,2002:str"&&N.test?.test(p),{compat:w,tags:E}=n.doc.schema;if(E.some(v)||w?.some(v))return Va(c,n)}return h?p:xu(p,d,Z1,Eu(n,!1))}function Jo(e,n,s,l){const{implicitKey:o,inFlow:c}=n,u=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:h}=e;h!==_e.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(u.value)&&(h=_e.QUOTE_DOUBLE);const d=y=>{switch(y){case _e.BLOCK_FOLDED:case _e.BLOCK_LITERAL:return o||c?Va(u.value,n):qc(u,n,s,l);case _e.QUOTE_DOUBLE:return Co(u.value,n);case _e.QUOTE_SINGLE:return Dh(u.value,n);case _e.PLAIN:return LM(u,n,s,l);default:return null}};let g=d(h);if(g===null){const{defaultKeyType:y,defaultStringType:p}=n.options,v=o&&y||p;if(g=d(v),g===null)throw new Error(`Unsupported default string type ${v}`)}return g}function F1(e,n){const s=Object.assign({blockQuote:!0,commentString:RM,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},e.schema.toStringOptions,n);let l;switch(s.collectionStyle){case"block":l=!1;break;case"flow":l=!0;break;default:l=null}return{anchors:new Set,doc:e,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent=="number"?" ".repeat(s.indent):" ",inFlow:l,options:s}}function HM(e,n){if(n.tag){const o=e.filter(c=>c.tag===n.tag);if(o.length>0)return o.find(c=>c.format===n.format)??o[0]}let s,l;if(Fe(n)){l=n.value;let o=e.filter(c=>c.identify?.(l));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 l=n,s=e.find(o=>o.nodeClass&&l instanceof o.nodeClass);if(!s){const o=l?.constructor?.name??(l===null?"null":typeof l);throw new Error(`Tag not resolved for ${o} value`)}return s}function $M(e,n,{anchors:s,doc:l}){if(!l.directives)return"";const o=[],c=(Fe(e)||lt(e))&&e.anchor;c&&Y1(c)&&(s.add(c),o.push(`&${c}`));const u=e.tag??(n.default?null:n.tag);return u&&o.push(l.directives.tagString(u)),o.join(" ")}function ll(e,n,s,l){if(nt(e))return e.toString(n,s,l);if(Xs(e)){if(n.doc.directives)return e.toString(n);if(n.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");n.resolvedAliases?n.resolvedAliases.add(e):n.resolvedAliases=new Set([e]),e=e.resolve(n.doc)}let o;const c=ot(e)?e:n.doc.createNode(e,{onTagObj:d=>o=d});o??(o=HM(n.doc.schema.tags,c));const u=$M(c,o,n);u.length>0&&(n.indentAtStart=(n.indentAtStart??0)+u.length+1);const h=typeof o.stringify=="function"?o.stringify(c,n,s,l):Fe(c)?Jo(c,n,s,l):c.toString(n,s,l);return u?Fe(c)||h[0]==="{"||h[0]==="["?`${u} ${h}`:`${u}
48
+ ${n.indent}${h}`:h}function UM({key:e,value:n},s,l,o){const{allNullValues:c,doc:u,indent:h,indentStep:d,options:{commentString:g,indentSeq:y,simpleKeys:p}}=s;let v=ot(e)&&e.comment||null;if(p){if(v)throw new Error("With simple keys, key nodes cannot have comments");if(lt(e)||!ot(e)&&typeof e=="object"){const D="With simple keys, collection cannot be used as a key value";throw new Error(D)}}let w=!p&&(!e||v&&n==null&&!s.inFlow||lt(e)||(Fe(e)?e.type===_e.BLOCK_FOLDED||e.type===_e.BLOCK_LITERAL:typeof e=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!w&&(p||!c),indent:h+d});let E=!1,N=!1,A=ll(e,s,()=>E=!0,()=>N=!0);if(!w&&!s.inFlow&&A.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");w=!0}if(s.inFlow){if(c||n==null)return E&&l&&l(),A===""?"?":w?`? ${A}`:A}else if(c&&!p||n==null&&w)return A=`? ${A}`,v&&!E?A+=Ds(A,s.indent,g(v)):N&&o&&o(),A;E&&(v=null),w?(v&&(A+=Ds(A,s.indent,g(v))),A=`? ${A}
49
+ ${h}:`):(A=`${A}:`,v&&(A+=Ds(A,s.indent,g(v))));let C,z,_;ot(n)?(C=!!n.spaceBefore,z=n.commentBefore,_=n.comment):(C=!1,z=null,_=null,n&&typeof n=="object"&&(n=u.createNode(n))),s.implicitKey=!1,!w&&!v&&Fe(n)&&(s.indentAtStart=A.length+1),N=!1,!y&&d.length>=2&&!s.inFlow&&!w&&dl(n)&&!n.flow&&!n.tag&&!n.anchor&&(s.indent=s.indent.substring(2));let x=!1;const T=ll(n,s,()=>x=!0,()=>N=!0);let O=" ";if(v||C||z){if(O=C?`
50
+ `:"",z){const D=g(z);O+=`
51
+ ${yi(D,s.indent)}`}T===""&&!s.inFlow?O===`
52
+ `&&_&&(O=`
53
+
54
+ `):O+=`
55
+ ${s.indent}`}else if(!w&&lt(n)){const D=T[0],R=T.indexOf(`
56
+ `),q=R!==-1,P=s.inFlow??n.flow??n.items.length===0;if(q||!P){let G=!1;if(q&&(D==="&"||D==="!")){let X=T.indexOf(" ");D==="&"&&X!==-1&&X<R&&T[X+1]==="!"&&(X=T.indexOf(" ",X+1)),(X===-1||R<X)&&(G=!0)}G||(O=`
57
+ ${s.indent}`)}}else(T===""||T[0]===`
58
+ `)&&(O="");return A+=O+T,s.inFlow?x&&l&&l():_&&!x?A+=Ds(A,s.indent,g(_)):N&&o&&o(),A}function J1(e,n){(e==="debug"||e==="warn")&&console.warn(n)}const Cc="<<",vi={identify:e=>e===Cc||typeof e=="symbol"&&e.description===Cc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new _e(Symbol(Cc)),{addToJSMap:W1}),stringify:()=>Cc},qM=(e,n)=>(vi.identify(n)||Fe(n)&&(!n.type||n.type===_e.PLAIN)&&vi.identify(n.value))&&e?.doc.schema.tags.some(s=>s.tag===vi.tag&&s.default);function W1(e,n,s){const l=P1(e,s);if(dl(l))for(const o of l.items)ch(e,n,o);else if(Array.isArray(l))for(const o of l)ch(e,n,o);else ch(e,n,l)}function ch(e,n,s){const l=P1(e,s);if(!fl(l))throw new Error("Merge sources must be maps or map aliases");const o=l.toJSON(null,e,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 P1(e,n){return e&&Xs(n)?n.resolve(e.doc,e):n}function eS(e,n,{key:s,value:l}){if(ot(s)&&s.addToJSMap)s.addToJSMap(e,n,l);else if(qM(e,s))W1(e,n,l);else{const o=bn(s,"",e);if(n instanceof Map)n.set(o,bn(l,o,e));else if(n instanceof Set)n.add(o);else{const c=IM(s,o,e),u=bn(l,c,e);c in n?Object.defineProperty(n,c,{value:u,writable:!0,enumerable:!0,configurable:!0}):n[c]=u}}return n}function IM(e,n,s){if(n===null)return"";if(typeof n!="object")return String(n);if(ot(e)&&s?.doc){const l=F1(s.doc,{});l.anchors=new Set;for(const c of s.anchors.keys())l.anchors.add(c.anchor);l.inFlow=!0,l.inStringifyKey=!0;const o=e.toString(l);if(!s.mapKeyWarned){let c=JSON.stringify(o);c.length>40&&(c=c.substring(0,36)+'..."'),J1(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 um(e,n,s){const l=$o(e,void 0,s),o=$o(n,void 0,s);return new jt(l,o)}class jt{constructor(n,s=null){Object.defineProperty(this,Sn,{value:H1}),this.key=n,this.value=s}clone(n){let{key:s,value:l}=this;return ot(s)&&(s=s.clone(n)),ot(l)&&(l=l.clone(n)),new jt(s,l)}toJSON(n,s){const l=s?.mapAsMap?new Map:{};return eS(s,l,this)}toString(n,s,l){return n?.doc?UM(this,n,s,l):JSON.stringify(this)}}function tS(e,n,s){return(n.inFlow??e.flow?YM:VM)(e,n,s)}function VM({comment:e,items:n},s,{blockItemPrefix:l,flowChars:o,itemIndent:c,onChompKeep:u,onComment:h}){const{indent:d,options:{commentString:g}}=s,y=Object.assign({},s,{indent:c,type:null});let p=!1;const v=[];for(let E=0;E<n.length;++E){const N=n[E];let A=null;if(ot(N))!p&&N.spaceBefore&&v.push(""),nu(s,v,N.commentBefore,p),N.comment&&(A=N.comment);else if(nt(N)){const z=ot(N.key)?N.key:null;z&&(!p&&z.spaceBefore&&v.push(""),nu(s,v,z.commentBefore,p))}p=!1;let C=ll(N,y,()=>A=null,()=>p=!0);A&&(C+=Ds(C,c,g(A))),p&&A&&(p=!1),v.push(l+C)}let w;if(v.length===0)w=o.start+o.end;else{w=v[0];for(let E=1;E<v.length;++E){const N=v[E];w+=N?`
59
+ ${d}${N}`:`
60
+ `}}return e?(w+=`
61
+ `+yi(g(e),d),h&&h()):p&&u&&u(),w}function YM({items:e},n,{flowChars:s,itemIndent:l}){const{indent:o,indentStep:c,flowCollectionPadding:u,options:{commentString:h}}=n;l+=c;const d=Object.assign({},n,{indent:l,inFlow:!0,type:null});let g=!1,y=0;const p=[];for(let E=0;E<e.length;++E){const N=e[E];let A=null;if(ot(N))N.spaceBefore&&p.push(""),nu(n,p,N.commentBefore,!1),N.comment&&(A=N.comment);else if(nt(N)){const z=ot(N.key)?N.key:null;z&&(z.spaceBefore&&p.push(""),nu(n,p,z.commentBefore,!1),z.comment&&(g=!0));const _=ot(N.value)?N.value:null;_?(_.comment&&(A=_.comment),_.commentBefore&&(g=!0)):N.value==null&&z?.comment&&(A=z.comment)}A&&(g=!0);let C=ll(N,d,()=>A=null);g||(g=p.length>y||C.includes(`
62
+ `)),E<e.length-1?C+=",":n.options.trailingComma&&(n.options.lineWidth>0&&(g||(g=p.reduce((z,_)=>z+_.length+2,2)+(C.length+2)>n.options.lineWidth)),g&&(C+=",")),A&&(C+=Ds(C,l,h(A))),p.push(C),y=p.length}const{start:v,end:w}=s;if(p.length===0)return v+w;if(!g){const E=p.reduce((N,A)=>N+A.length+2,2);g=n.options.lineWidth>0&&E>n.options.lineWidth}if(g){let E=v;for(const N of p)E+=N?`
63
+ ${c}${o}${N}`:`
64
+ `;return`${E}
65
+ ${o}${w}`}else return`${v}${u}${p.join(" ")}${u}${w}`}function nu({indent:e,options:{commentString:n}},s,l,o){if(l&&o&&(l=l.replace(/^\n+/,"")),l){const c=yi(n(l),e);s.push(c.trimStart())}}function Rs(e,n){const s=Fe(n)?n.value:n;for(const l of e)if(nt(l)&&(l.key===n||l.key===s||Fe(l.key)&&l.key.value===s))return l}class rn extends Q1{static get tagName(){return"tag:yaml.org,2002:map"}constructor(n){super(rs,n),this.items=[]}static from(n,s,l){const{keepUndefined:o,replacer:c}=l,u=new this(n),h=(d,g)=>{if(typeof c=="function")g=c.call(s,d,g);else if(Array.isArray(c)&&!c.includes(d))return;(g!==void 0||o)&&u.items.push(um(d,g,l))};if(s instanceof Map)for(const[d,g]of s)h(d,g);else if(s&&typeof s=="object")for(const d of Object.keys(s))h(d,s[d]);return typeof n.sortMapEntries=="function"&&u.items.sort(n.sortMapEntries),u}add(n,s){let l;nt(n)?l=n:!n||typeof n!="object"||!("key"in n)?l=new jt(n,n?.value):l=new jt(n.key,n.value);const o=Rs(this.items,l.key),c=this.schema?.sortMapEntries;if(o){if(!s)throw new Error(`Key ${l.key} already set`);Fe(o.value)&&K1(l.value)?o.value.value=l.value:o.value=l.value}else if(c){const u=this.items.findIndex(h=>c(l,h)<0);u===-1?this.items.push(l):this.items.splice(u,0,l)}else this.items.push(l)}delete(n){const s=Rs(this.items,n);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(n,s){const o=Rs(this.items,n)?.value;return(!s&&Fe(o)?o.value:o)??void 0}has(n){return!!Rs(this.items,n)}set(n,s){this.add(new jt(n,s),!0)}toJSON(n,s,l){const o=l?new l:s?.mapAsMap?new Map:{};s?.onCreate&&s.onCreate(o);for(const c of this.items)eS(s,o,c);return o}toString(n,s,l){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})),tS(this,n,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:n.indent||"",onChompKeep:l,onComment:s})}}const hl={collection:"map",default:!0,nodeClass:rn,tag:"tag:yaml.org,2002:map",resolve(e,n){return fl(e)||n("Expected a mapping for this tag"),e},createNode:(e,n,s)=>rn.from(e,n,s)};class cs extends Q1{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(n){super(ul,n),this.items=[]}add(n){this.items.push(n)}delete(n){const s=Mc(n);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(n,s){const l=Mc(n);if(typeof l!="number")return;const o=this.items[l];return!s&&Fe(o)?o.value:o}has(n){const s=Mc(n);return typeof s=="number"&&s<this.items.length}set(n,s){const l=Mc(n);if(typeof l!="number")throw new Error(`Expected a valid index, not ${n}.`);const o=this.items[l];Fe(o)&&K1(s)?o.value=s:this.items[l]=s}toJSON(n,s){const l=[];s?.onCreate&&s.onCreate(l);let o=0;for(const c of this.items)l.push(bn(c,String(o++),s));return l}toString(n,s,l){return n?tS(this,n,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(n.indent||"")+" ",onChompKeep:l,onComment:s}):JSON.stringify(this)}static from(n,s,l){const{replacer:o}=l,c=new this(n);if(s&&Symbol.iterator in Object(s)){let u=0;for(let h of s){if(typeof o=="function"){const d=s instanceof Set?h:String(u++);h=o.call(s,d,h)}c.items.push($o(h,void 0,l))}}return c}}function Mc(e){let n=Fe(e)?e.value:e;return n&&typeof n=="string"&&(n=Number(n)),typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}const ml={collection:"seq",default:!0,nodeClass:cs,tag:"tag:yaml.org,2002:seq",resolve(e,n){return dl(e)||n("Expected a sequence for this tag"),e},createNode:(e,n,s)=>cs.from(e,n,s)},_u={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,n,s,l){return n=Object.assign({actualString:!0},n),Jo(e,n,s,l)}},Au={identify:e=>e==null,createNode:()=>new _e(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new _e(null),stringify:({source:e},n)=>typeof e=="string"&&Au.test.test(e)?e:n.options.nullStr},fm={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new _e(e[0]==="t"||e[0]==="T"),stringify({source:e,value:n},s){if(e&&fm.test.test(e)){const l=e[0]==="t"||e[0]==="T";if(n===l)return e}return n?s.options.trueStr:s.options.falseStr}};function Rn({format:e,minFractionDigits:n,tag:s,value:l}){if(typeof l=="bigint")return String(l);const o=typeof l=="number"?l:Number(l);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let c=Object.is(l,-0)?"-0":JSON.stringify(l);if(!e&&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 h=n-(c.length-u-1);for(;h-- >0;)c+="0"}return c}const nS={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Rn},iS={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():Rn(e)}},sS={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const n=new _e(parseFloat(e)),s=e.indexOf(".");return s!==-1&&e[e.length-1]==="0"&&(n.minFractionDigits=e.length-s-1),n},stringify:Rn},Tu=e=>typeof e=="bigint"||Number.isInteger(e),dm=(e,n,s,{intAsBigInt:l})=>l?BigInt(e):parseInt(e.substring(n),s);function aS(e,n,s){const{value:l}=e;return Tu(l)&&l>=0?s+l.toString(n):Rn(e)}const lS={identify:e=>Tu(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,n,s)=>dm(e,2,8,s),stringify:e=>aS(e,8,"0o")},oS={identify:Tu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,n,s)=>dm(e,0,10,s),stringify:Rn},rS={identify:e=>Tu(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,n,s)=>dm(e,2,16,s),stringify:e=>aS(e,16,"0x")},GM=[hl,ml,_u,Au,fm,lS,oS,rS,nS,iS,sS];function Mv(e){return typeof e=="bigint"||Number.isInteger(e)}const Oc=({value:e})=>JSON.stringify(e),XM=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Oc},{identify:e=>e==null,createNode:()=>new _e(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Oc},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Oc},{identify:Mv,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e,10),stringify:({value:e})=>Mv(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Oc}],KM={default:!0,tag:"",test:/^/,resolve(e,n){return n(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},QM=[hl,ml].concat(XM,KM),hm={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,n){if(typeof atob=="function"){const s=atob(e.replace(/[\n\r]/g,"")),l=new Uint8Array(s.length);for(let o=0;o<s.length;++o)l[o]=s.charCodeAt(o);return l}else return n("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:n,value:s},l,o,c){if(!s)return"";const u=s;let h;if(typeof btoa=="function"){let d="";for(let g=0;g<u.length;++g)d+=String.fromCharCode(u[g]);h=btoa(d)}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 d=Math.max(l.options.lineWidth-l.indent.length,l.options.minContentWidth),g=Math.ceil(h.length/d),y=new Array(g);for(let p=0,v=0;p<g;++p,v+=d)y[p]=h.substr(v,d);h=y.join(n===_e.BLOCK_LITERAL?`
66
+ `:" ")}return Jo({comment:e,type:n,value:h},l,o,c)}};function cS(e,n){if(dl(e))for(let s=0;s<e.items.length;++s){let l=e.items[s];if(!nt(l)){if(fl(l)){l.items.length>1&&n("Each pair must have its own sequence indicator");const o=l.items[0]||new jt(new _e(null));if(l.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${l.commentBefore}
67
+ ${o.key.commentBefore}`:l.commentBefore),l.comment){const c=o.value??o.key;c.comment=c.comment?`${l.comment}
68
+ ${c.comment}`:l.comment}l=o}e.items[s]=nt(l)?l:new jt(l)}}else n("Expected a sequence for this tag");return e}function uS(e,n,s){const{replacer:l}=s,o=new cs(e);o.tag="tag:yaml.org,2002:pairs";let c=0;if(n&&Symbol.iterator in Object(n))for(let u of n){typeof l=="function"&&(u=l.call(n,String(c++),u));let h,d;if(Array.isArray(u))if(u.length===2)h=u[0],d=u[1];else throw new TypeError(`Expected [key, value] tuple: ${u}`);else if(u&&u instanceof Object){const g=Object.keys(u);if(g.length===1)h=g[0],d=u[h];else throw new TypeError(`Expected tuple with one key, not ${g.length} keys`)}else h=u;o.items.push(um(h,d,s))}return o}const mm={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:cS,createNode:uS};class Ka extends cs{constructor(){super(),this.add=rn.prototype.add.bind(this),this.delete=rn.prototype.delete.bind(this),this.get=rn.prototype.get.bind(this),this.has=rn.prototype.has.bind(this),this.set=rn.prototype.set.bind(this),this.tag=Ka.tag}toJSON(n,s){if(!s)return super.toJSON(n);const l=new Map;s?.onCreate&&s.onCreate(l);for(const o of this.items){let c,u;if(nt(o)?(c=bn(o.key,"",s),u=bn(o.value,c,s)):c=bn(o,"",s),l.has(c))throw new Error("Ordered maps must not include duplicate keys");l.set(c,u)}return l}static from(n,s,l){const o=uS(n,s,l),c=new this;return c.items=o.items,c}}Ka.tag="tag:yaml.org,2002:omap";const gm={collection:"seq",identify:e=>e instanceof Map,nodeClass:Ka,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,n){const s=cS(e,n),l=[];for(const{key:o}of s.items)Fe(o)&&(l.includes(o.value)?n(`Ordered maps must not include duplicate keys: ${o.value}`):l.push(o.value));return Object.assign(new Ka,s)},createNode:(e,n,s)=>Ka.from(e,n,s)};function fS({value:e,source:n},s){return n&&(e?dS:hS).test.test(n)?n:e?s.options.trueStr:s.options.falseStr}const dS={identify:e=>e===!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:fS},hS={identify:e=>e===!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:fS},ZM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Rn},FM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():Rn(e)}},JM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const n=new _e(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(s!==-1){const l=e.substring(s+1).replace(/_/g,"");l[l.length-1]==="0"&&(n.minFractionDigits=l.length)}return n},stringify:Rn},Wo=e=>typeof e=="bigint"||Number.isInteger(e);function Cu(e,n,s,{intAsBigInt:l}){const o=e[0];if((o==="-"||o==="+")&&(n+=1),e=e.substring(n).replace(/_/g,""),l){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const u=BigInt(e);return o==="-"?BigInt(-1)*u:u}const c=parseInt(e,s);return o==="-"?-1*c:c}function pm(e,n,s){const{value:l}=e;if(Wo(l)){const o=l.toString(n);return l<0?"-"+s+o.substr(1):s+o}return Rn(e)}const WM={identify:Wo,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,n,s)=>Cu(e,2,2,s),stringify:e=>pm(e,2,"0b")},PM={identify:Wo,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,n,s)=>Cu(e,1,8,s),stringify:e=>pm(e,8,"0")},eO={identify:Wo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,n,s)=>Cu(e,0,10,s),stringify:Rn},tO={identify:Wo,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,n,s)=>Cu(e,2,16,s),stringify:e=>pm(e,16,"0x")};class Qa extends rn{constructor(n){super(n),this.tag=Qa.tag}add(n){let s;nt(n)?s=n:n&&typeof n=="object"&&"key"in n&&"value"in n&&n.value===null?s=new jt(n.key,null):s=new jt(n,null),Rs(this.items,s.key)||this.items.push(s)}get(n,s){const l=Rs(this.items,n);return!s&&nt(l)?Fe(l.key)?l.key.value:l.key:l}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 l=Rs(this.items,n);l&&!s?this.items.splice(this.items.indexOf(l),1):!l&&s&&this.items.push(new jt(n))}toJSON(n,s){return super.toJSON(n,s,Set)}toString(n,s,l){if(!n)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},n,{allNullValues:!0}),s,l);throw new Error("Set items must all have null values")}static from(n,s,l){const{replacer:o}=l,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(um(u,null,l));return c}}Qa.tag="tag:yaml.org,2002:set";const ym={collection:"map",identify:e=>e instanceof Set,nodeClass:Qa,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,n,s)=>Qa.from(e,n,s),resolve(e,n){if(fl(e)){if(e.hasAllNullValues(!0))return Object.assign(new Qa,e);n("Set items must all have null values")}else n("Expected a mapping for this tag");return e}};function vm(e,n){const s=e[0],l=s==="-"||s==="+"?e.substring(1):e,o=u=>n?BigInt(u):Number(u),c=l.replace(/_/g,"").split(":").reduce((u,h)=>u*o(60)+o(h),o(0));return s==="-"?o(-1)*c:c}function mS(e){let{value:n}=e,s=u=>u;if(typeof n=="bigint")s=u=>BigInt(u);else if(isNaN(n)||!isFinite(n))return Rn(e);let l="";n<0&&(l="-",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))),l+c.map(u=>String(u).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const gS={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,n,{intAsBigInt:s})=>vm(e,s),stringify:mS},pS={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>vm(e,!1),stringify:mS},Mu={identify:e=>e 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(e){const n=e.match(Mu.test);if(!n)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,l,o,c,u,h]=n.map(Number),d=n[7]?Number((n[7]+"00").substr(1,3)):0;let g=Date.UTC(s,l-1,o,c||0,u||0,h||0,d);const y=n[8];if(y&&y!=="Z"){let p=vm(y,!1);Math.abs(p)<30&&(p*=60),g-=6e4*p}return new Date(g)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Ov=[hl,ml,_u,Au,dS,hS,WM,PM,eO,tO,ZM,FM,JM,hm,vi,gm,mm,ym,gS,pS,Mu],kv=new Map([["core",GM],["failsafe",[hl,ml,_u]],["json",QM],["yaml11",Ov],["yaml-1.1",Ov]]),jv={binary:hm,bool:fm,float:sS,floatExp:iS,floatNaN:nS,floatTime:pS,int:oS,intHex:rS,intOct:lS,intTime:gS,map:hl,merge:vi,null:Au,omap:gm,pairs:mm,seq:ml,set:ym,timestamp:Mu},nO={"tag:yaml.org,2002:binary":hm,"tag:yaml.org,2002:merge":vi,"tag:yaml.org,2002:omap":gm,"tag:yaml.org,2002:pairs":mm,"tag:yaml.org,2002:set":ym,"tag:yaml.org,2002:timestamp":Mu};function uh(e,n,s){const l=kv.get(n);if(l&&!e)return s&&!l.includes(vi)?l.concat(vi):l.slice();let o=l;if(!o)if(Array.isArray(e))o=[];else{const c=Array.from(kv.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(e))for(const c of e)o=o.concat(c);else typeof e=="function"&&(o=e(o.slice()));return s&&(o=o.concat(vi)),o.reduce((c,u)=>{const h=typeof u=="string"?jv[u]:u;if(!h){const d=JSON.stringify(u),g=Object.keys(jv).map(y=>JSON.stringify(y)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${g}`)}return c.includes(h)||c.push(h),c},[])}const iO=(e,n)=>e.key<n.key?-1:e.key>n.key?1:0;class Ou{constructor({compat:n,customTags:s,merge:l,resolveKnownTags:o,schema:c,sortMapEntries:u,toStringDefaults:h}){this.compat=Array.isArray(n)?uh(n,"compat"):n?uh(null,n):null,this.name=typeof c=="string"&&c||"core",this.knownTags=o?nO:{},this.tags=uh(s,this.name,l),this.toStringOptions=h??null,Object.defineProperty(this,rs,{value:hl}),Object.defineProperty(this,Gn,{value:_u}),Object.defineProperty(this,ul,{value:ml}),this.sortMapEntries=typeof u=="function"?u:u===!0?iO:null}clone(){const n=Object.create(Ou.prototype,Object.getOwnPropertyDescriptors(this));return n.tags=this.tags.slice(),n}}function sO(e,n){const s=[];let l=n.directives===!0;if(n.directives!==!1&&e.directives){const d=e.directives.toString(e);d?(s.push(d),l=!0):e.directives.docStart&&(l=!0)}l&&s.push("---");const o=F1(e,n),{commentString:c}=o.options;if(e.commentBefore){s.length!==1&&s.unshift("");const d=c(e.commentBefore);s.unshift(yi(d,""))}let u=!1,h=null;if(e.contents){if(ot(e.contents)){if(e.contents.spaceBefore&&l&&s.push(""),e.contents.commentBefore){const y=c(e.contents.commentBefore);s.push(yi(y,""))}o.forceBlockIndent=!!e.comment,h=e.contents.comment}const d=h?void 0:()=>u=!0;let g=ll(e.contents,o,()=>h=null,d);h&&(g+=Ds(g,"",c(h))),(g[0]==="|"||g[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${g}`:s.push(g)}else s.push(ll(e.contents,o));if(e.directives?.docEnd)if(e.comment){const d=c(e.comment);d.includes(`
69
+ `)?(s.push("..."),s.push(yi(d,""))):s.push(`... ${d}`)}else s.push("...");else{let d=e.comment;d&&u&&(d=d.replace(/^\n+/,"")),d&&((!u||h)&&s[s.length-1]!==""&&s.push(""),s.push(yi(c(d),"")))}return s.join(`
70
+ `)+`
71
+ `}class gl{constructor(n,s,l){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Sn,{value:jh});let o=null;typeof s=="function"||Array.isArray(s)?o=s:l===void 0&&s&&(l=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"},l);this.options=c;let{version:u}=c;l?._directives?(this.directives=l._directives.atDocument(),this.directives.yaml.explicit&&(u=this.directives.yaml.version)):this.directives=new Bt({version:u}),this.setSchema(u,l),this.contents=n===void 0?null:this.createNode(n,o,l)}clone(){const n=Object.create(gl.prototype,{[Sn]:{value:jh}});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=ot(this.contents)?this.contents.clone(n.schema):this.contents,this.range&&(n.range=this.range.slice()),n}add(n){Ra(this.contents)&&this.contents.add(n)}addIn(n,s){Ra(this.contents)&&this.contents.addIn(n,s)}createAlias(n,s){if(!n.anchor){const l=G1(this);n.anchor=!s||l.has(s)?X1(s||"a",l):s}return new wu(n.anchor)}createNode(n,s,l){let o;if(typeof s=="function")n=s.call({"":n},"",n),o=s;else if(Array.isArray(s)){const A=z=>typeof z=="number"||z instanceof String||z instanceof Number,C=s.filter(A).map(String);C.length>0&&(s=s.concat(C)),o=s}else l===void 0&&s&&(l=s,s=void 0);const{aliasDuplicateObjects:c,anchorPrefix:u,flow:h,keepUndefined:d,onTagObj:g,tag:y}=l??{},{onAnchor:p,setAnchors:v,sourceObjects:w}=jM(this,u||"a"),E={aliasDuplicateObjects:c??!0,keepUndefined:d??!1,onAnchor:p,onTagObj:g,replacer:o,schema:this.schema,sourceObjects:w},N=$o(n,y,E);return h&&lt(N)&&(N.flow=!0),v(),N}createPair(n,s,l={}){const o=this.createNode(n,null,l),c=this.createNode(s,null,l);return new jt(o,c)}delete(n){return Ra(this.contents)?this.contents.delete(n):!1}deleteIn(n){return Eo(n)?this.contents==null?!1:(this.contents=null,!0):Ra(this.contents)?this.contents.deleteIn(n):!1}get(n,s){return lt(this.contents)?this.contents.get(n,s):void 0}getIn(n,s){return Eo(n)?!s&&Fe(this.contents)?this.contents.value:this.contents:lt(this.contents)?this.contents.getIn(n,s):void 0}has(n){return lt(this.contents)?this.contents.has(n):!1}hasIn(n){return Eo(n)?this.contents!==void 0:lt(this.contents)?this.contents.hasIn(n):!1}set(n,s){this.contents==null?this.contents=tu(this.schema,[n],s):Ra(this.contents)&&this.contents.set(n,s)}setIn(n,s){Eo(n)?this.contents=s:this.contents==null?this.contents=tu(this.schema,Array.from(n),s):Ra(this.contents)&&this.contents.setIn(n,s)}setSchema(n,s={}){typeof n=="number"&&(n=String(n));let l;switch(n){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Bt({version:"1.1"}),l={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=n:this.directives=new Bt({version:n}),l={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,l=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(l)this.schema=new Ou(Object.assign(l,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:n,jsonArg:s,mapAsMap:l,maxAliasCount:o,onAnchor:c,reviver:u}={}){const h={anchors:new Map,doc:this,keep:!n,mapAsMap:l===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},d=bn(this.contents,s??"",h);if(typeof c=="function")for(const{count:g,res:y}of h.anchors.values())c(y,g);return typeof u=="function"?Ia(u,{"":d},"",d):d}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 sO(this,n)}}function Ra(e){if(lt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class bm extends Error{constructor(n,s,l,o){super(),this.name=n,this.code=l,this.message=o,this.pos=s}}class Bs extends bm{constructor(n,s,l){super("YAMLParseError",n,s,l)}}class yS extends bm{constructor(n,s,l){super("YAMLWarning",n,s,l)}}const iu=(e,n)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(h=>n.linePos(h));const{line:l,col:o}=s.linePos[0];s.message+=` at line ${l}, column ${o}`;let c=o-1,u=e.substring(n.lineStarts[l-1],n.lineStarts[l]).replace(/[\n\r]+$/,"");if(c>=60&&u.length>80){const h=Math.min(c-39,u.length-79);u="…"+u.substring(h),c-=h-1}if(u.length>80&&(u=u.substring(0,79)+"…"),l>1&&/^ *$/.test(u.substring(0,c))){let h=e.substring(n.lineStarts[l-2],n.lineStarts[l-1]);h.length>80&&(h=h.substring(0,79)+`…
72
+ `),u=h+u}if(/[^ ]/.test(u)){let h=1;const d=s.linePos[1];d?.line===l&&d.col>o&&(h=Math.max(1,Math.min(d.col-o,80-c)));const g=" ".repeat(c)+"^".repeat(h);s.message+=`:
73
+
74
+ ${u}
75
+ ${g}
76
+ `}};function ol(e,{flow:n,indicator:s,next:l,offset:o,onError:c,parentIndent:u,startOnNewline:h}){let d=!1,g=h,y=h,p="",v="",w=!1,E=!1,N=null,A=null,C=null,z=null,_=null,x=null,T=null;for(const R of e)switch(E&&(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"),E=!1),N&&(g&&R.type!=="comment"&&R.type!=="newline"&&c(N,"TAB_AS_INDENT","Tabs are not allowed as indentation"),N=null),R.type){case"space":!n&&(s!=="doc-start"||l?.type!=="flow-collection")&&R.source.includes(" ")&&(N=R),y=!0;break;case"comment":{y||c(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const q=R.source.substring(1)||" ";p?p+=v+q:p=q,v="",g=!1;break}case"newline":g?p?p+=R.source:(!x||s!=="seq-item-ind")&&(d=!0):v+=R.source,g=!0,w=!0,(A||C)&&(z=R),y=!0;break;case"anchor":A&&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),A=R,T??(T=R.offset),g=!1,y=!1,E=!0;break;case"tag":{C&&c(R,"MULTIPLE_TAGS","A node can have at most one tag"),C=R,T??(T=R.offset),g=!1,y=!1,E=!0;break}case s:(A||C)&&c(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),x&&c(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${n??"collection"}`),x=R,g=s==="seq-item-ind"||s==="explicit-key-ind",y=!1;break;case"comma":if(n){_&&c(R,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`),_=R,g=!1,y=!1;break}default:c(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),g=!1,y=!1}const O=e[e.length-1],D=O?O.offset+O.source.length:o;return E&&l&&l.type!=="space"&&l.type!=="newline"&&l.type!=="comma"&&(l.type!=="scalar"||l.source!=="")&&c(l.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),N&&(g&&N.indent<=u||l?.type==="block-map"||l?.type==="block-seq")&&c(N,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:x,spaceBefore:d,comment:p,hasNewline:w,anchor:A,tag:C,newlineAfterProp:z,end:D,start:T??D}}function Uo(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
77
+ `))return!0;if(e.end){for(const n of e.end)if(n.type==="newline")return!0}return!1;case"flow-collection":for(const n of e.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(Uo(n.key)||Uo(n.value))return!0}return!1;default:return!0}}function Bh(e,n,s){if(n?.type==="flow-collection"){const l=n.end[0];l.indent===e&&(l.source==="]"||l.source==="}")&&Uo(n)&&s(l,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function vS(e,n,s){const{uniqueKeys:l}=e.options;if(l===!1)return!1;const o=typeof l=="function"?l:(c,u)=>c===u||Fe(c)&&Fe(u)&&c.value===u.value;return n.some(c=>o(c.key,s))}const zv="All mapping items must start at the same column";function aO({composeNode:e,composeEmptyNode:n},s,l,o,c){const u=c?.nodeClass??rn,h=new u(s.schema);s.atRoot&&(s.atRoot=!1);let d=l.offset,g=null;for(const y of l.items){const{start:p,key:v,sep:w,value:E}=y,N=ol(p,{indicator:"explicit-key-ind",next:v??w?.[0],offset:d,onError:o,parentIndent:l.indent,startOnNewline:!0}),A=!N.found;if(A){if(v&&(v.type==="block-seq"?o(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==l.indent&&o(d,"BAD_INDENT",zv)),!N.anchor&&!N.tag&&!w){g=N.end,N.comment&&(h.comment?h.comment+=`
78
+ `+N.comment:h.comment=N.comment);continue}(N.newlineAfterProp||Uo(v))&&o(v??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else N.found?.indent!==l.indent&&o(d,"BAD_INDENT",zv);s.atKey=!0;const C=N.end,z=v?e(s,v,N,o):n(s,C,p,null,N,o);s.schema.compat&&Bh(l.indent,v,o),s.atKey=!1,vS(s,h.items,z)&&o(C,"DUPLICATE_KEY","Map keys must be unique");const _=ol(w??[],{indicator:"map-value-ind",next:E,offset:z.range[2],onError:o,parentIndent:l.indent,startOnNewline:!v||v.type==="block-scalar"});if(d=_.end,_.found){A&&(E?.type==="block-map"&&!_.hasNewline&&o(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&N.start<_.found.offset-1024&&o(z.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const x=E?e(s,E,_,o):n(s,d,w,null,_,o);s.schema.compat&&Bh(l.indent,E,o),d=x.range[2];const T=new jt(z,x);s.options.keepSourceTokens&&(T.srcToken=y),h.items.push(T)}else{A&&o(z.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(z.comment?z.comment+=`
79
+ `+_.comment:z.comment=_.comment);const x=new jt(z);s.options.keepSourceTokens&&(x.srcToken=y),h.items.push(x)}}return g&&g<d&&o(g,"IMPOSSIBLE","Map comment with trailing content"),h.range=[l.offset,d,g??d],h}function lO({composeNode:e,composeEmptyNode:n},s,l,o,c){const u=c?.nodeClass??cs,h=new u(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let d=l.offset,g=null;for(const{start:y,value:p}of l.items){const v=ol(y,{indicator:"seq-item-ind",next:p,offset:d,onError:o,parentIndent:l.indent,startOnNewline:!0});if(!v.found)if(v.anchor||v.tag||p)p?.type==="block-seq"?o(v.end,"BAD_INDENT","All sequence items must start at the same column"):o(d,"MISSING_CHAR","Sequence item without - indicator");else{g=v.end,v.comment&&(h.comment=v.comment);continue}const w=p?e(s,p,v,o):n(s,v.end,y,null,v,o);s.schema.compat&&Bh(l.indent,p,o),d=w.range[2],h.items.push(w)}return h.range=[l.offset,d,g??d],h}function Po(e,n,s,l){let o="";if(e){let c=!1,u="";for(const h of e){const{source:d,type:g}=h;switch(g){case"space":c=!0;break;case"comment":{s&&!c&&l(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const y=d.substring(1)||" ";o?o+=u+y:o=y,u="";break}case"newline":o&&(u+=d),c=!0;break;default:l(h,"UNEXPECTED_TOKEN",`Unexpected ${g} at node end`)}n+=d.length}}return{comment:o,offset:n}}const fh="Block collections are not allowed within flow collections",dh=e=>e&&(e.type==="block-map"||e.type==="block-seq");function oO({composeNode:e,composeEmptyNode:n},s,l,o,c){const u=l.start.source==="{",h=u?"flow map":"flow sequence",d=c?.nodeClass??(u?rn:cs),g=new d(s.schema);g.flow=!0;const y=s.atRoot;y&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let p=l.offset+l.start.source.length;for(let A=0;A<l.items.length;++A){const C=l.items[A],{start:z,key:_,sep:x,value:T}=C,O=ol(z,{flow:h,indicator:"explicit-key-ind",next:_??x?.[0],offset:p,onError:o,parentIndent:l.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!x&&!T){A===0&&O.comma?o(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${h}`):A<l.items.length-1&&o(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${h}`),O.comment&&(g.comment?g.comment+=`
80
+ `+O.comment:g.comment=O.comment),p=O.end;continue}!u&&s.options.strict&&Uo(_)&&o(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(A===0)O.comma&&o(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${h}`);else if(O.comma||o(O.start,"MISSING_CHAR",`Missing , between ${h} items`),O.comment){let D="";e:for(const R of z)switch(R.type){case"comma":case"space":break;case"comment":D=R.source.substring(1);break e;default:break e}if(D){let R=g.items[g.items.length-1];nt(R)&&(R=R.value??R.key),R.comment?R.comment+=`
81
+ `+D:R.comment=D,O.comment=O.comment.substring(D.length+1)}}if(!u&&!x&&!O.found){const D=T?e(s,T,O,o):n(s,O.end,x,null,O,o);g.items.push(D),p=D.range[2],dh(T)&&o(D.range,"BLOCK_IN_FLOW",fh)}else{s.atKey=!0;const D=O.end,R=_?e(s,_,O,o):n(s,D,z,null,O,o);dh(_)&&o(R.range,"BLOCK_IN_FLOW",fh),s.atKey=!1;const q=ol(x??[],{flow:h,indicator:"map-value-ind",next:T,offset:R.range[2],onError:o,parentIndent:l.indent,startOnNewline:!1});if(q.found){if(!u&&!O.found&&s.options.strict){if(x)for(const X of x){if(X===q.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}}O.start<q.found.offset-1024&&o(q.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 ${h}`):o(q.start,"MISSING_CHAR",`Missing , or : between ${h} items`));const P=T?e(s,T,q,o):q.found?n(s,q.end,x,null,q,o):null;P?dh(T)&&o(P.range,"BLOCK_IN_FLOW",fh):q.comment&&(R.comment?R.comment+=`
82
+ `+q.comment:R.comment=q.comment);const G=new jt(R,P);if(s.options.keepSourceTokens&&(G.srcToken=C),u){const X=g;vS(s,X.items,R)&&o(D,"DUPLICATE_KEY","Map keys must be unique"),X.items.push(G)}else{const X=new rn(s.schema);X.flow=!0,X.items.push(G);const W=(P??R).range;X.range=[R.range[0],W[1],W[2]],g.items.push(X)}p=P?P.range[2]:q.end}}const v=u?"}":"]",[w,...E]=l.end;let N=p;if(w?.source===v)N=w.offset+w.source.length;else{const A=h[0].toUpperCase()+h.substring(1),C=y?`${A} must end with a ${v}`:`${A} in block collection must be sufficiently indented and end with a ${v}`;o(p,y?"MISSING_CHAR":"BAD_INDENT",C),w&&w.source.length!==1&&E.unshift(w)}if(E.length>0){const A=Po(E,N,s.options.strict,o);A.comment&&(g.comment?g.comment+=`
83
+ `+A.comment:g.comment=A.comment),g.range=[l.offset,N,A.offset]}else g.range=[l.offset,N,N];return g}function hh(e,n,s,l,o,c){const u=s.type==="block-map"?aO(e,n,s,l,c):s.type==="block-seq"?lO(e,n,s,l,c):oO(e,n,s,l,c),h=u.constructor;return o==="!"||o===h.tagName?(u.tag=h.tagName,u):(o&&(u.tag=o),u)}function rO(e,n,s,l,o){const c=l.tag,u=c?n.directives.tagName(c.source,v=>o(c,"TAG_RESOLVE_FAILED",v)):null;if(s.type==="block-seq"){const{anchor:v,newlineAfterProp:w}=l,E=v&&c?v.offset>c.offset?v:c:v??c;E&&(!w||w.offset<E.offset)&&o(E,"MISSING_CHAR","Missing newline after block sequence props")}const h=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!c||!u||u==="!"||u===rn.tagName&&h==="map"||u===cs.tagName&&h==="seq")return hh(e,n,s,o,u);let d=n.schema.tags.find(v=>v.tag===u&&v.collection===h);if(!d){const v=n.schema.knownTags[u];if(v?.collection===h)n.schema.tags.push(Object.assign({},v,{default:!1})),d=v;else return v?o(c,"BAD_COLLECTION_TYPE",`${v.tag} used for ${h} collection, but expects ${v.collection??"scalar"}`,!0):o(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${u}`,!0),hh(e,n,s,o,u)}const g=hh(e,n,s,o,u,d),y=d.resolve?.(g,v=>o(c,"TAG_RESOLVE_FAILED",v),n.options)??g,p=ot(y)?y:new _e(y);return p.range=g.range,p.tag=u,d?.format&&(p.format=d.format),p}function bS(e,n,s){const l=n.offset,o=cO(n,e.options.strict,s);if(!o)return{value:"",type:null,comment:"",range:[l,l,l]};const c=o.mode===">"?_e.BLOCK_FOLDED:_e.BLOCK_LITERAL,u=n.source?uO(n.source):[];let h=u.length;for(let N=u.length-1;N>=0;--N){const A=u[N][1];if(A===""||A==="\r")h=N;else break}if(h===0){const N=o.chomp==="+"&&u.length>0?`
84
+ `.repeat(Math.max(1,u.length-1)):"";let A=l+o.length;return n.source&&(A+=n.source.length),{value:N,type:c,comment:o.comment,range:[l,A,A]}}let d=n.indent+o.indent,g=n.offset+o.length,y=0;for(let N=0;N<h;++N){const[A,C]=u[N];if(C===""||C==="\r")o.indent===0&&A.length>d&&(d=A.length);else{A.length<d&&s(g+A.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),o.indent===0&&(d=A.length),y=N,d===0&&!e.atRoot&&s(g,"BAD_INDENT","Block scalar values in collections must be indented");break}g+=A.length+C.length+1}for(let N=u.length-1;N>=h;--N)u[N][0].length>d&&(h=N+1);let p="",v="",w=!1;for(let N=0;N<y;++N)p+=u[N][0].slice(d)+`
85
+ `;for(let N=y;N<h;++N){let[A,C]=u[N];g+=A.length+C.length+1;const z=C[C.length-1]==="\r";if(z&&(C=C.slice(0,-1)),C&&A.length<d){const x=`Block scalar lines must not be less indented than their ${o.indent?"explicit indentation indicator":"first line"}`;s(g-C.length-(z?2:1),"BAD_INDENT",x),A=""}c===_e.BLOCK_LITERAL?(p+=v+A.slice(d)+C,v=`
86
+ `):A.length>d||C[0]===" "?(v===" "?v=`
87
+ `:!w&&v===`
88
+ `&&(v=`
89
+
90
+ `),p+=v+A.slice(d)+C,v=`
91
+ `,w=!0):C===""?v===`
92
+ `?p+=`
93
+ `:v=`
94
+ `:(p+=v+C,v=" ",w=!1)}switch(o.chomp){case"-":break;case"+":for(let N=h;N<u.length;++N)p+=`
95
+ `+u[N][0].slice(d);p[p.length-1]!==`
96
+ `&&(p+=`
97
+ `);break;default:p+=`
98
+ `}const E=l+o.length+n.source.length;return{value:p,type:c,comment:o.comment,range:[l,E,E]}}function cO({offset:e,props:n},s,l){if(n[0].type!=="block-scalar-header")return l(n[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:o}=n[0],c=o[0];let u=0,h="",d=-1;for(let v=1;v<o.length;++v){const w=o[v];if(!h&&(w==="-"||w==="+"))h=w;else{const E=Number(w);!u&&E?u=E:d===-1&&(d=e+v)}}d!==-1&&l(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${o}`);let g=!1,y="",p=o.length;for(let v=1;v<n.length;++v){const w=n[v];switch(w.type){case"space":g=!0;case"newline":p+=w.source.length;break;case"comment":s&&!g&&l(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),p+=w.source.length,y=w.source.substring(1);break;case"error":l(w,"UNEXPECTED_TOKEN",w.message),p+=w.source.length;break;default:{const E=`Unexpected token in block scalar header: ${w.type}`;l(w,"UNEXPECTED_TOKEN",E);const N=w.source;N&&typeof N=="string"&&(p+=N.length)}}}return{mode:c,indent:u,chomp:h,comment:y,length:p}}function uO(e){const n=e.split(/\n( *)/),s=n[0],l=s.match(/^( *)/),c=[l?.[1]?[l[1],s.slice(l[1].length)]:["",s]];for(let u=1;u<n.length;u+=2)c.push([n[u],n[u+1]]);return c}function SS(e,n,s){const{offset:l,type:o,source:c,end:u}=e;let h,d;const g=(v,w,E)=>s(l+v,w,E);switch(o){case"scalar":h=_e.PLAIN,d=fO(c,g);break;case"single-quoted-scalar":h=_e.QUOTE_SINGLE,d=dO(c,g);break;case"double-quoted-scalar":h=_e.QUOTE_DOUBLE,d=hO(c,g);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[l,l+c.length,l+c.length]}}const y=l+c.length,p=Po(u,y,n,s);return{value:d,type:h,comment:p.comment,range:[l,y,p.offset]}}function fO(e,n){let s="";switch(e[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 ${e[0]}`;break}case"@":case"`":{s=`reserved character ${e[0]}`;break}}return s&&n(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`),wS(e)}function dO(e,n){return(e[e.length-1]!=="'"||e.length===1)&&n(e.length,"MISSING_CHAR","Missing closing 'quote"),wS(e.slice(1,-1)).replace(/''/g,"'")}function wS(e){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 l=n.exec(e);if(!l)return e;let o=l[1],c=" ",u=n.lastIndex;for(s.lastIndex=u;l=s.exec(e);)l[1]===""?c===`
101
+ `?o+=c:c=`
102
+ `:(o+=c+l[1],c=" "),u=s.lastIndex;const h=/[ \t]*(.*)/sy;return h.lastIndex=u,l=h.exec(e),o+c+(l?.[1]??"")}function hO(e,n){let s="";for(let l=1;l<e.length-1;++l){const o=e[l];if(!(o==="\r"&&e[l+1]===`
103
+ `))if(o===`
104
+ `){const{fold:c,offset:u}=mO(e,l);s+=c,l=u}else if(o==="\\"){let c=e[++l];const u=gO[c];if(u)s+=u;else if(c===`
105
+ `)for(c=e[l+1];c===" "||c===" ";)c=e[++l+1];else if(c==="\r"&&e[l+1]===`
106
+ `)for(c=e[++l+1];c===" "||c===" ";)c=e[++l+1];else if(c==="x"||c==="u"||c==="U"){const h=c==="x"?2:c==="u"?4:8;s+=pO(e,l+1,h,n),l+=h}else{const h=e.substr(l-1,2);n(l-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${h}`),s+=h}}else if(o===" "||o===" "){const c=l;let u=e[l+1];for(;u===" "||u===" ";)u=e[++l+1];u!==`
107
+ `&&!(u==="\r"&&e[l+2]===`
108
+ `)&&(s+=l>c?e.slice(c,l+1):o)}else s+=o}return(e[e.length-1]!=='"'||e.length===1)&&n(e.length,"MISSING_CHAR",'Missing closing "quote'),s}function mO(e,n){let s="",l=e[n+1];for(;(l===" "||l===" "||l===`
109
+ `||l==="\r")&&!(l==="\r"&&e[n+2]!==`
110
+ `);)l===`
111
+ `&&(s+=`
112
+ `),n+=1,l=e[n+1];return s||(s=" "),{fold:s,offset:n}}const gO={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
113
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function pO(e,n,s,l){const o=e.substr(n,s),u=o.length===s&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,16):NaN;try{return String.fromCodePoint(u)}catch{const h=e.substr(n-2,s+2);return l(n-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${h}`),h}}function xS(e,n,s,l){const{value:o,type:c,comment:u,range:h}=n.type==="block-scalar"?bS(e,n,l):SS(n,e.options.strict,l),d=s?e.directives.tagName(s.source,p=>l(s,"TAG_RESOLVE_FAILED",p)):null;let g;e.options.stringKeys&&e.atKey?g=e.schema[Gn]:d?g=yO(e.schema,o,d,s,l):n.type==="scalar"?g=vO(e,o,n,l):g=e.schema[Gn];let y;try{const p=g.resolve(o,v=>l(s??n,"TAG_RESOLVE_FAILED",v),e.options);y=Fe(p)?p:new _e(p)}catch(p){const v=p instanceof Error?p.message:String(p);l(s??n,"TAG_RESOLVE_FAILED",v),y=new _e(o)}return y.range=h,y.source=o,c&&(y.type=c),d&&(y.tag=d),g.format&&(y.format=g.format),u&&(y.comment=u),y}function yO(e,n,s,l,o){if(s==="!")return e[Gn];const c=[];for(const h of e.tags)if(!h.collection&&h.tag===s)if(h.default&&h.test)c.push(h);else return h;for(const h of c)if(h.test?.test(n))return h;const u=e.knownTags[s];return u&&!u.collection?(e.tags.push(Object.assign({},u,{default:!1,test:void 0})),u):(o(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),e[Gn])}function vO({atKey:e,directives:n,schema:s},l,o,c){const u=s.tags.find(h=>(h.default===!0||e&&h.default==="key")&&h.test?.test(l))||s[Gn];if(s.compat){const h=s.compat.find(d=>d.default&&d.test?.test(l))??s[Gn];if(u.tag!==h.tag){const d=n.tagString(u.tag),g=n.tagString(h.tag),y=`Value may be parsed as either ${d} or ${g}`;c(o,"TAG_RESOLVE_FAILED",y,!0)}}return u}function bO(e,n,s){if(n){s??(s=n.length);for(let l=s-1;l>=0;--l){let o=n[l];switch(o.type){case"space":case"comment":case"newline":e-=o.source.length;continue}for(o=n[++l];o?.type==="space";)e+=o.source.length,o=n[++l];break}}return e}const SO={composeNode:ES,composeEmptyNode:Sm};function ES(e,n,s,l){const o=e.atKey,{spaceBefore:c,comment:u,anchor:h,tag:d}=s;let g,y=!0;switch(n.type){case"alias":g=wO(e,n,l),(h||d)&&l(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":g=xS(e,n,d,l),h&&(g.anchor=h.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{g=rO(SO,e,n,s,l),h&&(g.anchor=h.source.substring(1))}catch(p){const v=p instanceof Error?p.message:String(p);l(n,"RESOURCE_EXHAUSTION",v)}break;default:{const p=n.type==="error"?n.message:`Unsupported token (type: ${n.type})`;l(n,"UNEXPECTED_TOKEN",p),y=!1}}return g??(g=Sm(e,n.offset,void 0,null,s,l)),h&&g.anchor===""&&l(h,"BAD_ALIAS","Anchor cannot be an empty string"),o&&e.options.stringKeys&&(!Fe(g)||typeof g.value!="string"||g.tag&&g.tag!=="tag:yaml.org,2002:str")&&l(d??n,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(g.spaceBefore=!0),u&&(n.type==="scalar"&&n.source===""?g.comment=u:g.commentBefore=u),e.options.keepSourceTokens&&y&&(g.srcToken=n),g}function Sm(e,n,s,l,{spaceBefore:o,comment:c,anchor:u,tag:h,end:d},g){const y={type:"scalar",offset:bO(n,s,l),indent:-1,source:""},p=xS(e,y,h,g);return u&&(p.anchor=u.source.substring(1),p.anchor===""&&g(u,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(p.spaceBefore=!0),c&&(p.comment=c,p.range[2]=d),p}function wO({options:e},{offset:n,source:s,end:l},o){const c=new wu(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,h=Po(l,u,e.strict,o);return c.range=[n,u,h.offset],h.comment&&(c.comment=h.comment),c}function xO(e,n,{offset:s,start:l,value:o,end:c},u){const h=Object.assign({_directives:n},e),d=new gl(void 0,h),g={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},y=ol(l,{indicator:"doc-start",next:o??c?.[0],offset:s,onError:u,parentIndent:0,startOnNewline:!0});y.found&&(d.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!y.hasNewline&&u(y.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=o?ES(g,o,y,u):Sm(g,y.end,l,null,y,u);const p=d.contents.range[2],v=Po(c,p,!1,u);return v.comment&&(d.comment=v.comment),d.range=[s,p,v.offset],d}function So(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:n,source:s}=e;return[n,n+(typeof s=="string"?s.length:1)]}function Dv(e){let n="",s=!1,l=!1;for(let o=0;o<e.length;++o){const c=e[o];switch(c[0]){case"#":n+=(n===""?"":l?`
114
+
115
+ `:`
116
+ `)+(c.substring(1)||" "),s=!0,l=!1;break;case"%":e[o+1]?.[0]!=="#"&&(o+=1),s=!1;break;default:s||(l=!0),s=!1}}return{comment:n,afterEmptyLine:l}}class wm{constructor(n={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,l,o,c)=>{const u=So(s);c?this.warnings.push(new yS(u,l,o)):this.errors.push(new Bs(u,l,o))},this.directives=new Bt({version:n.version||"1.2"}),this.options=n}decorate(n,s){const{comment:l,afterEmptyLine:o}=Dv(this.prelude);if(l){const c=n.contents;if(s)n.comment=n.comment?`${n.comment}
117
+ ${l}`:l;else if(o||n.directives.docStart||!c)n.commentBefore=l;else if(lt(c)&&!c.flow&&c.items.length>0){let u=c.items[0];nt(u)&&(u=u.key);const h=u.commentBefore;u.commentBefore=h?`${l}
118
+ ${h}`:l}else{const u=c.commentBefore;c.commentBefore=u?`${l}
119
+ ${u}`:l}}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:Dv(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(n,s=!1,l=-1){for(const o of n)yield*this.next(o);yield*this.end(s,l)}*next(n){switch(n.type){case"directive":this.directives.add(n.source,(s,l,o)=>{const c=So(n);c[0]+=s,this.onError(c,"BAD_DIRECTIVE",l,o)}),this.prelude.push(n.source),this.atDirectives=!0;break;case"document":{const s=xO(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,l=new Bs(So(n),"UNEXPECTED_TOKEN",s);this.atDirectives||!this.doc?this.errors.push(l):this.doc.errors.push(l);break}case"doc-end":{if(!this.doc){const l="Unexpected doc-end without preceding document";this.errors.push(new Bs(So(n),"UNEXPECTED_TOKEN",l));break}this.doc.directives.docEnd=!0;const s=Po(n.end,n.offset+n.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),s.comment){const l=this.doc.comment;this.doc.comment=l?`${l}
120
+ ${s.comment}`:s.comment}this.doc.range[2]=s.offset;break}default:this.errors.push(new Bs(So(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 l=Object.assign({_directives:this.directives},this.options),o=new gl(void 0,l);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),o.range=[0,s,s],this.decorate(o,!1),yield o}}}function EO(e,n=!0,s){if(e){const l=(o,c,u)=>{const h=typeof o=="number"?o:Array.isArray(o)?o[0]:o.offset;if(s)s(h,c,u);else throw new Bs([h,h+1],c,u)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return SS(e,n,l);case"block-scalar":return bS({options:{strict:n}},e,l)}}return null}function NO(e,n){const{implicitKey:s=!1,indent:l,inFlow:o=!1,offset:c=-1,type:u="PLAIN"}=n,h=Jo({type:u,value:e},{implicitKey:s,indent:l>0?" ".repeat(l):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}}),d=n.end??[{type:"newline",offset:-1,indent:l,source:`
121
+ `}];switch(h[0]){case"|":case">":{const g=h.indexOf(`
122
+ `),y=h.substring(0,g),p=h.substring(g+1)+`
123
+ `,v=[{type:"block-scalar-header",offset:c,indent:l,source:y}];return NS(v,d)||v.push({type:"newline",offset:-1,indent:l,source:`
124
+ `}),{type:"block-scalar",offset:c,indent:l,props:v,source:p}}case'"':return{type:"double-quoted-scalar",offset:c,indent:l,source:h,end:d};case"'":return{type:"single-quoted-scalar",offset:c,indent:l,source:h,end:d};default:return{type:"scalar",offset:c,indent:l,source:h,end:d}}}function _O(e,n,s={}){let{afterKey:l=!1,implicitKey:o=!1,inFlow:c=!1,type:u}=s,h="indent"in e?e.indent:null;if(l&&typeof h=="number"&&(h+=2),!u)switch(e.type){case"single-quoted-scalar":u="QUOTE_SINGLE";break;case"double-quoted-scalar":u="QUOTE_DOUBLE";break;case"block-scalar":{const g=e.props[0];if(g.type!=="block-scalar-header")throw new Error("Invalid block scalar header");u=g.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:u="PLAIN"}const d=Jo({type:u,value:n},{implicitKey:o||h===null,indent:h!==null&&h>0?" ".repeat(h):"",inFlow:c,options:{blockQuote:!0,lineWidth:-1}});switch(d[0]){case"|":case">":AO(e,d);break;case'"':mh(e,d,"double-quoted-scalar");break;case"'":mh(e,d,"single-quoted-scalar");break;default:mh(e,d,"scalar")}}function AO(e,n){const s=n.indexOf(`
125
+ `),l=n.substring(0,s),o=n.substring(s+1)+`
126
+ `;if(e.type==="block-scalar"){const c=e.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");c.source=l,e.source=o}else{const{offset:c}=e,u="indent"in e?e.indent:-1,h=[{type:"block-scalar-header",offset:c,indent:u,source:l}];NS(h,"end"in e?e.end:void 0)||h.push({type:"newline",offset:-1,indent:u,source:`
127
+ `});for(const d of Object.keys(e))d!=="type"&&d!=="offset"&&delete e[d];Object.assign(e,{type:"block-scalar",indent:u,props:h,source:o})}}function NS(e,n){if(n)for(const s of n)switch(s.type){case"space":case"comment":e.push(s);break;case"newline":return e.push(s),!0}return!1}function mh(e,n,s){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=s,e.source=n;break;case"block-scalar":{const l=e.props.slice(1);let o=n.length;e.props[0].type==="block-scalar-header"&&(o-=e.props[0].source.length);for(const c of l)c.offset+=o;delete e.props,Object.assign(e,{type:s,source:n,end:l});break}case"block-map":case"block-seq":{const o={type:"newline",offset:e.offset+n.length,indent:e.indent,source:`
128
+ `};delete e.items,Object.assign(e,{type:s,source:n,end:[o]});break}default:{const l="indent"in e?e.indent:-1,o="end"in e&&Array.isArray(e.end)?e.end.filter(c=>c.type==="space"||c.type==="comment"||c.type==="newline"):[];for(const c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:s,indent:l,source:n,end:o})}}}const TO=e=>"type"in e?su(e):Ic(e);function su(e){switch(e.type){case"block-scalar":{let n="";for(const s of e.props)n+=su(s);return n+e.source}case"block-map":case"block-seq":{let n="";for(const s of e.items)n+=Ic(s);return n}case"flow-collection":{let n=e.start.source;for(const s of e.items)n+=Ic(s);for(const s of e.end)n+=s.source;return n}case"document":{let n=Ic(e);if(e.end)for(const s of e.end)n+=s.source;return n}default:{let n=e.source;if("end"in e&&e.end)for(const s of e.end)n+=s.source;return n}}}function Ic({start:e,key:n,sep:s,value:l}){let o="";for(const c of e)o+=c.source;if(n&&(o+=su(n)),s)for(const c of s)o+=c.source;return l&&(o+=su(l)),o}const Lh=Symbol("break visit"),CO=Symbol("skip children"),_S=Symbol("remove item");function Ys(e,n){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),AS(Object.freeze([]),e,n)}Ys.BREAK=Lh;Ys.SKIP=CO;Ys.REMOVE=_S;Ys.itemAtPath=(e,n)=>{let s=e;for(const[l,o]of n){const c=s?.[l];if(c&&"items"in c)s=c.items[o];else return}return s};Ys.parentCollection=(e,n)=>{const s=Ys.itemAtPath(e,n.slice(0,-1)),l=n[n.length-1][0],o=s?.[l];if(o&&"items"in o)return o;throw new Error("Parent collection not found")};function AS(e,n,s){let l=s(n,e);if(typeof l=="symbol")return l;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 h=AS(Object.freeze(e.concat([[o,u]])),c.items[u],s);if(typeof h=="number")u=h-1;else{if(h===Lh)return Lh;h===_S&&(c.items.splice(u,1),u-=1)}}typeof l=="function"&&o==="key"&&(l=l(n,e))}}return typeof l=="function"?l(n,e):l}const ku="\uFEFF",ju="",zu="",qo="",MO=e=>!!e&&"items"in e,OO=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function kO(e){switch(e){case ku:return"<BOM>";case ju:return"<DOC>";case zu:return"<FLOW_END>";case qo:return"<SCALAR>";default:return JSON.stringify(e)}}function TS(e){switch(e){case ku:return"byte-order-mark";case ju:return"doc-mode";case zu:return"flow-error-end";case qo: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(e[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 jO=Object.freeze(Object.defineProperty({__proto__:null,BOM:ku,DOCUMENT:ju,FLOW_END:zu,SCALAR:qo,createScalarToken:NO,isCollection:MO,isScalar:OO,prettyToken:kO,resolveAsScalar:EO,setScalarValue:_O,stringify:TO,tokenType:TS,visit:Ys},Symbol.toStringTag,{value:"Module"}));function An(e){switch(e){case void 0:case" ":case`
131
+ `:case"\r":case" ":return!0;default:return!1}}const Rv=new Set("0123456789ABCDEFabcdef"),zO=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),kc=new Set(",[]{}"),DO=new Set(` ,[]{}
132
+ \r `),gh=e=>!e||DO.has(e);class CS{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 l=this.next??"stream";for(;l&&(s||this.hasChars(1));)l=yield*this.parseNext(l)}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 l=0;for(;s===" ";)s=this.buffer[++l+n];if(s==="\r"){const o=this.buffer[l+n+1];if(o===`
135
+ `||!o&&!this.atEnd)return n+l+1}return s===`
136
+ `||l>=this.indentNext||!s&&!this.atEnd?n+l:-1}if(s==="-"||s==="."){const l=this.buffer.substr(n,3);if((l==="---"||l==="...")&&An(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]===ku&&(yield*this.pushCount(1),n=n.substring(1)),n[0]==="%"){let s=n.length,l=n.indexOf("#");for(;l!==-1;){const c=n[l-1];if(c===" "||c===" "){s=l-1;break}else l=n.indexOf("#",l+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 ju,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==="...")&&An(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&&!An(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===":")&&An(s)){const l=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=l,"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(gh),"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,l=-1;do n=yield*this.pushNewline(),n>0?(s=yield*this.pushSpaces(!1),this.indentValue=l=s):s=0,s+=yield*this.pushSpaces(!0);while(n+s>0);const o=this.getLine();if(o===null)return this.setNext("flow");if((l!==-1&&l<this.indentNext&&o[0]!=="#"||l===0&&(o.startsWith("---")||o.startsWith("..."))&&An(o[3]))&&!(l===this.indentNext-1&&this.flowLevel===1&&(o[0]==="]"||o[0]==="}")))return this.flowLevel=0,yield zu,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(gh),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const u=this.charAt(1);if(this.flowKey||An(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 l=this.buffer.substring(0,s);let o=l.indexOf(`
138
+ `,this.pos);if(o!==-1){for(;o!==-1;){const c=this.continueScalar(o+1);if(c===-1)break;o=l.indexOf(`
139
+ `,c)}o!==-1&&(s=o-(l[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=>An(s)||s==="#")}*parseBlockScalar(){let n=this.pos-1,s=0,l;e:for(let c=this.pos;l=this.buffer[c];++c)switch(l){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(!l&&!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(l=this.buffer[o];l===" ";)l=this.buffer[++o];if(l===" "){for(;l===" "||l===" "||l==="\r"||l===`
143
+ `;)l=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 h=c;for(;u===" ";)u=this.buffer[--c];if(u===`
144
+ `&&c>=this.pos&&c+1+s>h)n=c;else break}while(!0);return yield qo,yield*this.pushToIndex(n+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const n=this.flowLevel>0;let s=this.pos-1,l=this.pos-1,o;for(;o=this.buffer[++l];)if(o===":"){const c=this.buffer[l+1];if(An(c)||n&&kc.has(c))break;s=l}else if(An(o)){let c=this.buffer[l+1];if(o==="\r"&&(c===`
145
+ `?(l+=1,o=`
146
+ `,c=this.buffer[l+1]):s=l),c==="#"||n&&kc.has(c))break;if(o===`
147
+ `){const u=this.continueScalar(l+1);if(u===-1)break;l=Math.max(l,u-2)}}else{if(n&&kc.has(o))break;s=l}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield qo,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 l=this.buffer.slice(this.pos,n);return l?(yield l,this.pos+=l.length,l.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(gh),n+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const s=this.flowLevel>0,l=this.charAt(1);if(An(l)||s&&kc.has(l)){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(;!An(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(zO.has(s))s=this.buffer[++n];else if(s==="%"&&Rv.has(this.buffer[n+1])&&Rv.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,l;do l=this.buffer[++s];while(l===" "||n&&l===" ");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,l=this.buffer[s];for(;!n(l);)l=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,l=this.lineStarts.length;for(;s<l;){const c=s+l>>1;this.lineStarts[c]<n?s=c+1:l=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 as(e,n){for(let s=0;s<e.length;++s)if(e[s].type===n)return!0;return!1}function Bv(e){for(let n=0;n<e.length;++n)switch(e[n].type){case"space":case"comment":case"newline":break;default:return n}return-1}function OS(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function jc(e){switch(e.type){case"document":return e.start;case"block-map":{const n=e.items[e.items.length-1];return n.sep??n.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Ba(e){if(e.length===0)return[];let n=e.length;e:for(;--n>=0;)switch(e[n].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++n]?.type==="space";);return e.splice(n,e.length)}function au(e,n){if(n.length<1e5)Array.prototype.push.apply(e,n);else for(let s=0;s<n.length;++s)e.push(n[s])}function Lv(e){if(e.start.type==="flow-seq-start")for(const n of e.items)n.sep&&!n.value&&!as(n.start,"explicit-key-ind")&&!as(n.sep,"map-value-ind")&&(n.key&&(n.value=n.key),delete n.key,OS(n.value)?n.value.end?au(n.value.end,n.sep):n.value.end=n.sep:au(n.start,n.sep),delete n.sep)}class xm{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 CS,this.onNewLine=n}*parse(n,s=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const l of this.lexer.lex(n,s))yield*this.next(l);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=TS(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 l=`Not a YAML token: ${n}`;yield*this.pop({type:"error",offset:this.offset,message:l,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 l=this.peek(1);switch(s.type==="block-scalar"?s.indent="indent"in l?l.indent:0:s.type==="flow-collection"&&l.type==="document"&&(s.indent=0),s.type==="flow-collection"&&Lv(s),l.type){case"document":l.value=s;break;case"block-scalar":l.props.push(s);break;case"block-map":{const o=l.items[l.items.length-1];if(o.value){l.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=l.items[l.items.length-1];o.value?l.items.push({start:[],value:s}):o.value=s;break}case"flow-collection":{const o=l.items[l.items.length-1];!o||o.value?l.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((l.type==="document"||l.type==="block-map"||l.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&&Bv(o.start)===-1&&(s.indent===0||o.start.every(c=>c.type!=="comment"||c.indent<s.indent))&&(l.type==="document"?l.end=o.start:l.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":{Bv(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=jc(this.peek(2)),l=Ba(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:l,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 l="end"in s.value?s.value.end:void 0;(Array.isArray(l)?l[l.length-1]:void 0)?.type==="comment"?l?.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)){au(o,s.start),o.push(this.sourceToken),n.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=n.indent){const l=!this.onKeyLine&&this.indent===n.indent,o=l&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(o&&s.sep&&!s.value){const u=[];for(let h=0;h<s.sep.length;++h){const d=s.sep[h];switch(d.type){case"newline":u.push(h);break;case"space":break;case"comment":d.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(as(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(OS(s.key)&&!as(s.sep,"newline")){const u=Ba(s.start),h=s.key,d=s.sep;d.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:h,sep:d}]})}else c.length>0?s.sep=s.sep.concat(c,this.sourceToken):s.sep.push(this.sourceToken);else if(as(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const u=Ba(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]}):as(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&&!as(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 l&&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 l="end"in s.value?s.value.end:void 0;(Array.isArray(l)?l[l.length-1]:void 0)?.type==="comment"?l?.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)){au(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||as(s.start,"seq-item-ind")?n.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>n.indent){const l=this.startBlockValue(n);if(l){this.stack.push(l);return}}yield*this.pop(),yield*this.step()}*flowCollection(n){const s=n.items[n.items.length-1];if(this.type==="flow-error-end"){let l;do yield*this.pop(),l=this.peek(1);while(l?.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 l=this.startBlockValue(n);l?this.stack.push(l):(yield*this.pop(),yield*this.step())}else{const l=this.peek(2);if(l.type==="block-map"&&(this.type==="map-value-ind"&&l.indent===n.indent||this.type==="newline"&&!l.items[l.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&l.type!=="flow-collection"){const o=jc(l),c=Ba(o);Lv(n);const u=n.end.splice(1,n.end.length);u.push(this.sourceToken);const h={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]=h}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=jc(n),l=Ba(s);return l.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const s=jc(n),l=Ba(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(n,s){return this.type!=="comment"||this.indent<=s?!1:n.every(l=>l.type==="newline"||l.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 kS(e){const n=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||n&&new MS||null,prettyErrors:n}}function RO(e,n={}){const{lineCounter:s,prettyErrors:l}=kS(n),o=new xm(s?.addNewLine),c=new wm(n),u=Array.from(c.compose(o.parse(e)));if(l&&s)for(const h of u)h.errors.forEach(iu(e,s)),h.warnings.forEach(iu(e,s));return u.length>0?u:Object.assign([],{empty:!0},c.streamInfo())}function jS(e,n={}){const{lineCounter:s,prettyErrors:l}=kS(n),o=new xm(s?.addNewLine),c=new wm(n);let u=null;for(const h of c.compose(o.parse(e),!0,e.length))if(!u)u=h;else if(u.options.logLevel!=="silent"){u.errors.push(new Bs(h.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return l&&s&&(u.errors.forEach(iu(e,s)),u.warnings.forEach(iu(e,s))),u}function BO(e,n,s){let l;typeof n=="function"?l=n:s===void 0&&n&&typeof n=="object"&&(s=n);const o=jS(e,s);if(!o)return null;if(o.warnings.forEach(c=>J1(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:l},s))}function LO(e,n,s){let l=null;if(typeof n=="function"||Array.isArray(n)?l=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(e===void 0){const{keepUndefined:o}=s??n??{};if(!o)return}return Ks(e)&&!l?e.toString(s):new gl(e,l,s).toString(s)}const er=Object.freeze(Object.defineProperty({__proto__:null,Alias:wu,CST:jO,Composer:wm,Document:gl,Lexer:CS,LineCounter:MS,Pair:jt,Parser:xm,Scalar:_e,Schema:Ou,YAMLError:bm,YAMLMap:rn,YAMLParseError:Bs,YAMLSeq:cs,YAMLWarning:yS,isAlias:Xs,isCollection:lt,isDocument:Ks,isMap:fl,isNode:ot,isPair:nt,isScalar:Fe,isSeq:dl,parse:BO,parseAllDocuments:RO,parseDocument:jS,stringify:LO,visit:Qs,visitAsync:Su},Symbol.toStringTag,{value:"Module"})),Hv=["#2563EB","#7C3AED","#0F766E","#B45309","#BE185D","#4338CA","#047857","#9F1239"];function Hh(e){let n=0;for(const s of e)n=Math.imul(n,31)+s.codePointAt(0)>>>0;return Hv[n%Hv.length]}function HO(e){if(e===void 0)return{actors:[]};if(!Array.isArray(e))return{actors:[],actorIssues:["screen.actors must be an array of actor IDs."]};const n=[],s=[];for(const l of e)typeof l!="string"||!l.trim()||l!==l.trim()?s.push("screen.actors IDs must be nonempty strings without surrounding whitespace."):n.includes(l)?s.push(`screen.actors lists "${l}" more than once.`):n.push(l);return{actors:n,...s.length?{actorIssues:s}:{}}}function $O(e,n,s){const l=new Map,o=[],c=(h,d=n)=>o.push({message:h,path:d});if(e!==void 0){let h;try{h=er.parse(e)}catch(d){c(`Invalid actor registry: ${d instanceof Error?d.message:String(d)}`)}if(!h||typeof h!="object"||Array.isArray(h)||!("actors"in h)||!h.actors||typeof h.actors!="object"||Array.isArray(h.actors))c("Actor registry must contain an actors mapping.");else for(const[d,g]of Object.entries(h.actors)){if(!d.trim()||d!==d.trim()){c("Actor IDs must be nonempty strings without surrounding whitespace.");continue}if(!g||typeof g!="object"||Array.isArray(g)){c(`Actor "${d}" must be a mapping with optional name and color.`);continue}const y=g;let p=d,v=Hh(d);y.name!==void 0&&(typeof y.name!="string"||!y.name.trim()?c(`Actor "${d}" name must be a nonempty string.`):p=y.name.trim()),y.color!==void 0&&(typeof y.color!="string"||!/^#[0-9a-f]{6}$/i.test(y.color)?c(`Actor "${d}" color must be a quoted #RRGGBB value.`):v=y.color.toUpperCase()),l.set(d,{id:d,name:p,color:v})}}const u=new Set(l.keys());for(const h of s){for(const d of h.screen.actorIssues??[])c(d,h.path);if(h.screen.type==="user")for(const d of h.screen.actors)e!==void 0&&!u.has(d)&&c(`screen.actors references undefined actor "${d}".`,h.path),l.has(d)||l.set(d,{id:d,name:d,color:Hh(d)})}return{actors:[...l.values()],actorIssues:o}}function us(e){return e.normalize("NFKC").replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").toLowerCase()||"unnamed"}function zS(e){return`story_${us(e).replaceAll("-","_")}`}function DS(e){return`slc_${us(e).replaceAll("-","_")}`}function RS(e){return`scr_${us(e).replaceAll("-","_")}`}function BS(e){return`cmd_${us(e).replaceAll("-","_")}`}function LS(e){return`qry_${us(e).replaceAll("-","_")}`}function Vc(e){return`evt_${us(e).replaceAll("-","_")}`}function HS(e,n,s){const l=s?us(s):`case-${n+1}`;return`gwt_${us(e).replaceAll("-","_")}_${l.replaceAll("-","_")}`}function UO(e,n,s){return`${e}:${n}->${s}`}function qO(e){const n=new Map,s=(l,o)=>{const c=n.get(l)??new Set;c.add(JSON.stringify(o)),n.set(l,c)};for(const l of e.stories)s(zS(l.path),[l.path]);for(const l of e.events)s(Vc(l.name),[l.name]);for(const l of e.slices)s(DS(l.path),[l.path]),s(RS(l.path),[l.path]),l.commands.forEach((o,c)=>{s(BS(o.name),Za(l.path,l.commands,c));for(const u of o.produces)s(Vc(u),[u])}),l.queries.forEach((o,c)=>{s(LS(o.name),Za(l.path,l.queries,c));for(const u of o.fromEvents)s(Vc(u),[u])}),l.gwt.forEach((o,c)=>{s(HS(l.path,c,o.name),Za(l.path,l.gwt,c))});return(l,o)=>n.get(l).size===1?l:`${l}~${encodeURIComponent(JSON.stringify(o))}`}function Za(e,n,s){const l=n[s].name,o=n.slice(0,s).filter(c=>c.name===l).length;return[e,l??"",String(o)]}function IO(e){const n=[],s=new Map,l=qO(e),o=h=>l(Vc(h),[h]),c=new Map,u=(h,d,g,y)=>{const p=UO(h,d,g);s.set(p,{id:p,kind:h,source:d,target:g,...y===void 0?{}:{label:y}})};for(const h of e.stories){const d=l(zS(h.path),[h.path]);for(const g of new Set(h.slices))c.set(g,[...c.get(g)??[],d]);n.push({id:d,type:"story",label:h.name,sourcePath:h.path,description:h.description})}for(const h of e.events)n.push({id:o(h.name),type:"event",label:h.name,sourceName:h.name,sourcePath:h.sourcePath,fields:h.fields,description:h.description});for(const h of e.slices){const d=l(DS(h.path),[h.path]),g=l(RS(h.path),[h.path]),y={storyName:h.storyName,sliceTitle:h.title,sourcePath:h.path,raw:h.raw};n.push({...y,id:d,type:"slice",label:h.title});for(const p of c.get(h.path)??[])u("story-slice",p,d);n.push({...y,id:g,type:h.screen.type==="system"?"processor":"screen",label:h.screen.name??(h.screen.type==="system"?"Processor":"Screen"),actors:h.screen.actors,...h.screen.type==="user"?{actorDefinitions:h.screen.actors.map(p=>e.actors?.find(v=>v.id===p)).filter(p=>!!p)}:{},screenType:h.screen.type}),u("slice-screen",d,g),h.queries.forEach((p,v)=>{const w=l(LS(p.name),Za(h.path,h.queries,v));n.push({...y,id:w,type:"query",label:p.name,sourceName:p.name,fields:p.fields}),h.screen.reads.includes(p.name)&&u("query-screen",w,g);for(const E of p.fromEvents)u("event-query",o(E),w,E)}),h.commands.forEach((p,v)=>{const w=l(BS(p.name),Za(h.path,h.commands,v));n.push({...y,id:w,type:"command",label:p.name,sourceName:p.name,fields:p.fields}),h.screen.executes.includes(p.name)&&u("screen-command",g,w);for(const E of p.produces)u("command-event",w,o(E),E)}),h.gwt.forEach((p,v)=>{n.push({...y,id:l(HS(h.path,v,p.name),Za(h.path,h.gwt,v)),type:"gwt",label:p.name??`Case ${v+1}`,sourceName:p.name,description:p.description,given:p.given,when:p.when,then:p.then})})}return{nodes:n,edges:[...s.values()]}}function Ya(e){const n=[];for(const s of e.replaceAll("\\","/").split("/"))!s||s==="."||(s===".."&&n.length>0&&n.at(-1)!==".."?n.pop():n.push(s));return n.join("/")}function $S(e,n=""){const s=Ya(e).split("/").at(-1)??e;return n&&s.endsWith(n)?s.slice(0,-n.length):s}function Io(e){return Array.isArray(e)?e.filter(n=>typeof n=="string"):[]}function VO(e,n){const s=er.parse(n),l=s?.events&&typeof s.events=="object"?s.events:s??{};return Object.entries(l).map(([o,c])=>({name:o,fields:typeof c?.fields=="string"?c.fields:void 0,description:typeof c?.description=="string"?c.description:void 0,sourcePath:e}))}function YO(e,n){const s=er.parse(n);return{name:typeof s?.name=="string"?s.name:$S(e,".yaml"),description:typeof s?.description=="string"?s.description:"",path:e,slices:Io(s?.slices).map(Ya)}}function GO(e){return Array.isArray(e)?e.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:Io(n.produces)})):[]}function XO(e){return Array.isArray(e)?e.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:Io(n.from_events)})):[]}function KO(e){return Array.isArray(e)?e.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 QO(e){return{type:e?.type==="system"?"system":"user",name:typeof e?.name=="string"?e.name:void 0,...HO(e?.actors),reads:Io(e?.reads),executes:Io(e?.executes)}}function ZO(e,n,s){const l=er.parse(n);return{title:typeof l?.slice=="string"?l.slice:$S(e),path:e,storyName:s.get(e),screen:QO(l?.screen),commands:GO(l?.commands),queries:XO(l?.queries),gwt:KO(l?.gwt),raw:n}}function FO(e,n={}){const s=new Map(e.map(O=>[Ya(O.path),O.content])),l=s.get(".event-modeling/config.yaml"),o=l?er.parse(l):null,c=o?.paths?.event_model_dir??"event-model",u=o?.paths?.features_dir??"event-model/features",h=o?.paths?.slice_extension??".slice.yaml",d=o?.paths?.events_file??`${c}/events.yaml`,g=Ya(o?.paths?.actors_file??`${c}/actors.yaml`),y=o?.paths?.stories_dir??`${c}/stories`,p=s.get(d);if(p===void 0)throw new Error(`Missing events file: ${d}`);const v=VO(d,p),w=[...s.entries()].filter(([O])=>O.split("/").slice(0,-1).join("/")===y&&O.endsWith(".yaml")).sort(([O],[D])=>O.localeCompare(D)).map(([O,D])=>YO(O,D)),E=new Map;for(const O of w)for(const D of O.slices)E.set(Ya(D),O.name);const N=w.flatMap(O=>O.slices.map(Ya)),A=[...s.keys()].filter(O=>(u===""||O.startsWith(`${u}/`))&&O.endsWith(h)),z=[...new Set([...N,...A])].sort().filter(O=>s.has(O)).map(O=>ZO(O,s.get(O)??"",E)),_=$O(s.get(g),g,z),x={root:n.root??"browser-import",config:{language:o?.language,paths:{eventModelDir:c,featuresDir:u,sliceExtension:h,eventsFile:d,actorsFile:g,storiesDir:y}},events:v,stories:w,slices:z,..._},T=IO(x);return{...x,...T}}function US(e){if(e.type!=="screen")return[];const n=new Map(e.actorDefinitions?.map(s=>[s.id,s]));return[...new Set(e.actors??[])].map(s=>n.get(s)??{id:s,name:s,color:Hh(s)})}function qS(e,n={}){const s=new Map(e.actors?.map(l=>[l.id,l]));for(const l of[...e.nodes,...Object.values(n)])for(const o of US(l))s.has(o.id)||s.set(o.id,o);return[...s.values()]}function JO(e,n,s={}){const l=new Set(qS(e,s).map(u=>u.id)),o=n.actorIds.filter(u=>l.has(u)),c=n.includeUnassigned&&[...e.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 WO(e,n,s={}){if(n.actorIds.length===0&&!n.includeUnassigned)return{nodeIds:new Set(e.nodes.map(x=>x.id)),relatedNodeIds:new Set};const l=new Set(n.actorIds),o=new Map(e.nodes.map(x=>[x.id,x])),c=new Map;for(const x of e.nodes)x.type==="story"||x.type==="event"||x.sourcePath&&c.set(x.id,x.sourcePath);const u=e.edges.filter(x=>["slice-screen","query-screen","screen-command"].includes(x.kind)),h=()=>{let x=!0;for(;x;){x=!1;for(const T of u){const O=c.get(T.source),D=c.get(T.target);O&&!D?(c.set(T.target,O),x=!0):D&&!O&&(c.set(T.source,D),x=!0)}}};h();for(const x of e.nodes)x.type==="slice"&&!c.has(x.id)&&c.set(x.id,x.id);h();for(const x of e.nodes)(x.type==="screen"||x.type==="processor")&&!c.has(x.id)&&c.set(x.id,x.id);h();const d=x=>x?.type==="screen"&&((x.actors??[]).some(T=>l.has(T))||n.includeUnassigned&&!x.actors?.length),g=e.nodes.filter(x=>d(x)||d(s[x.id])),y=new Set(g.flatMap(x=>{const T=c.get(x.id);return T?[T]:[]})),p=new Set(g.map(x=>x.id));for(const[x,T]of c)y.has(T)&&p.add(x);const v=e.edges.filter(x=>x.kind==="command-event"||x.kind==="event-query"),w=x=>{const T=new Set;for(const O of v)x.has(O.source)&&o.get(O.target)?.type==="event"&&T.add(O.target),x.has(O.target)&&o.get(O.source)?.type==="event"&&T.add(O.source);return T},E=w(p),N=new Set,A=new Set(e.nodes.filter(x=>x.type==="processor").map(x=>c.get(x.id)));for(const x of v){const T=E.has(x.source)?x.target:E.has(x.target)?x.source:void 0,O=T?c.get(T):void 0;O&&A.has(O)&&!y.has(O)&&N.add(O)}const C=new Set;for(const[x,T]of c)N.has(T)&&C.add(x);for(const x of w(C))E.has(x)||C.add(x);const z=new Set([...p,...E,...C]),_=new Set(e.nodes.filter(x=>z.has(x.id)&&x.type!=="event").map(x=>x.storyName));for(const x of e.nodes)x.type==="story"&&_.has(x.label)&&z.add(x.id);return{nodeIds:z,relatedNodeIds:C}}const ns=180,ss=80,IS=80,gi=430,Fa=390,VS=130,Tn=178,PO=92,$h=300,Uh=170,lu=18,qh=48,ph=30,Yc=92,YS=38,e3=42,$v=154,Uv=278,GS=408;function t3(e){return e==="slice-screen"||e==="story-slice"?"#cbd5e1":"#64748b"}function n3(e){if(e==="added")return"#15803d";if(e==="removed")return"#b91c1c";if(e==="changed")return"#b45309"}function i3(e){return e.type==="event"?{sourcePosition:he.Right,targetPosition:he.Left}:{sourcePosition:he.Bottom,targetPosition:he.Top}}function s3(e){return new Map(e.stories.map((n,s)=>[n.name,s]))}function Ja(e,n){return e===0?0:e*n+(e-1)*lu}function Gc(e,n,s){const l=e.slices.find(o=>o.path===n);return e.nodes.filter(o=>o.type===s&&(o.sourcePath?o.sourcePath===n:o.sliceTitle===l?.title))}function a3(e,n,s){const l=new Set(Gc(e,s,"command").map(c=>c.id));return[...new Set(e.edges.filter(c=>c.kind==="command-event"&&l.has(c.source)).map(c=>c.target))].map(c=>n.get(c)).filter(c=>!!c)}function l3(e,n){return new Map(e.slices.map(s=>{const l=Gc(e,s.path,"query"),o=Gc(e,s.path,"command"),c=a3(e,n,s.path),u=Gc(e,s.path,"gwt"),h=Ja(l.length,Tn),d=Ja(o.length,Tn),g=h+d+(h>0&&d>0?qh:0),y=Ja(c.length,Tn),p=u.length?$h:0,v=Math.max(gi,g+ph*2,y+ph*2,p+ph*2),w=u.length>0?GS+Uh+36:Fa;return[s.path,{width:v,height:w,queryIds:l.map(E=>E.id),commandIds:o.map(E=>E.id),eventIds:c.map(E=>E.id),gwtIds:u.map(E=>E.id)}]}))}function o3(e,n){const s=new Map;let l=ss;for(const o of e.stories){const c=e.slices.filter(y=>y.storyName===o.name),u=c.reduce((y,p)=>y+(n.get(p.path)?.width??gi),0),h=Math.max(u+Math.max(c.length-1,0)*VS,gi),d=Math.max(...c.map(y=>n.get(y.path)?.height??Fa),Fa),g=Yc+d+YS;s.set(o.name,{y:l,width:h,height:g}),l+=g+IS}return s}function r3(e,n,s,l,o,c){const u=Ja(e.length,c),h=s.x+(l-u)/2;e.forEach((d,g)=>{n.set(d,{x:h+g*(c+lu),y:s.y+o})})}function c3(e){return e==="essential"?new Set(["command-event","event-query"]):e==="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 u3(e,n,s="all"){if(!n||s==="all")return new Set(e.stories.map(u=>u.name));if(s==="story")return new Set([n]);const l=new Set([n]),o=new Set(e.nodes.filter(u=>u.storyName===n).map(u=>u.id)),c=new Set(e.edges.filter(u=>o.has(u.source)||o.has(u.target)).flatMap(u=>[u.source,u.target]).filter(u=>e.nodes.find(h=>h.id===u)?.type==="event"));for(const u of e.edges){if(!c.has(u.source)&&!c.has(u.target))continue;const h=e.nodes.find(g=>g.id===u.source),d=e.nodes.find(g=>g.id===u.target);h?.storyName&&l.add(h.storyName),d?.storyName&&l.add(d.storyName)}return l}function f3(e){return e==="event-query"?{sourceSide:"top",targetSide:"bottom"}:e==="query-screen"?{sourceSide:"top",targetSide:"bottom"}:e==="screen-command"?{sourceSide:"bottom",targetSide:"top"}:e==="command-event"?{sourceSide:"bottom",targetSide:"top"}:e==="slice-screen"?{sourceSide:"bottom",targetSide:"top"}:{sourceSide:"right",targetSide:"left"}}function d3(e,n,s,l,o){const c=f3(e),u=n?.sliceTitle&&n.sliceTitle===s?.sliceTitle;if(e==="event-query"&&u)return{...c,route:"same-slice-read"};if(!(e==="event-query"&&n?.sliceTitle!==s?.sliceTitle)||!l||!o)return{...c,route:"semantic"};const d=l.x+l.width/2,g=l.y+l.height/2,y=o.x+o.width/2,p=o.y+o.height/2;return{sourceSide:n?.storyName&&n.storyName===s?.storyName||p>=g?"bottom":"top",targetSide:y>=d?"left":"right",route:"event-read"}}function h3(e,n,s={}){const l=new Map(e.nodes.map(T=>[T.id,T]));e={...e,nodes:e.nodes.map(T=>{if(T.type!=="event")return T;const O=e.edges.find(D=>D.kind==="command-event"&&D.target===T.id);return{...T,storyName:O?l.get(O.source)?.storyName:T.storyName}})};const o=s3(e),c=new Map(e.nodes.map(T=>[T.id,T])),u=l3(e,c),h=T=>T?.sourcePath??e.slices.find(O=>O.title===(T?.sliceTitle??T?.label))?.path??"",d=o3(e,u),g=new Map,y=new Map,p=new Map,v=new Set,w=u3(e,s.focusedStory,s.scope??"all"),E=c3(s.edgeDetail??"normal"),N=WO(e,s.actorFilter??{actorIds:[],includeUnassigned:!1},s.previousNodes);if(n){v.add(n);for(const T of e.edges)T.source===n&&v.add(T.target),T.target===n&&v.add(T.source)}const A=new Map;for(const T of e.stories)A.set(T.name,ns);for(const T of e.stories)for(const O of T.slices){const D=e.slices.find(P=>P.path===O);if(!D)continue;const R=d.get(T.name)??{y:ss},q=A.get(T.name)??ns;p.set(D.path,{x:q,y:R.y+Yc}),A.set(T.name,q+(u.get(D.path)?.width??gi)+VS)}for(const T of e.slices){if(p.has(T.path))continue;const O=ss+(o.get(T.storyName??"")??0)*(Fa+Yc+YS+IS),D=ns;p.set(T.path,{x:D,y:O+Yc})}for(const T of e.nodes){if(T.type==="story"&&g.set(T.id,{x:ns-20,y:d.get(T.label)?.y??ss}),T.type==="slice"){const O=p.get(h(T))??{x:ns,y:ss};g.set(T.id,O)}if(T.type==="screen"||T.type==="processor"){const O=p.get(h(T))??{x:ns,y:ss},R=u.get(h(T))?.width??gi;g.set(T.id,{x:O.x+(R-Tn)/2,y:O.y+e3})}}for(const T of e.slices){const O=p.get(T.path)??{x:ns,y:ss},D=u.get(T.path),R=D?.width??gi;if(!D)continue;const q=Ja(D.queryIds.length,Tn),P=Ja(D.commandIds.length,Tn),G=q+P+(q>0&&P>0?qh:0);let X=O.x+(R-G)/2;D.queryIds.forEach((W,B)=>{g.set(W,{x:X+B*(Tn+lu),y:O.y+$v})}),q>0&&(X+=q+(P>0?qh:0)),D.commandIds.forEach((W,B)=>{g.set(W,{x:X+B*(Tn+lu),y:O.y+$v})}),r3(D.eventIds,g,O,R,Uv,Tn);for(const W of D.gwtIds)g.set(W,{x:O.x+(R-$h)/2,y:O.y+GS})}for(const T of e.nodes.filter(O=>O.type==="event")){const O=e.edges.find(R=>R.kind==="command-event"&&R.target===T.id),D=O?c.get(O.source):void 0;if(!g.has(T.id)){const R=p.get(h(D))??{x:ns,y:ss},q=u.get(h(D));g.set(T.id,{x:R.x+((q?.width??gi)-Tn)/2,y:R.y+Uv})}}const C=e.nodes.map(T=>{const O=g.get(T.id)??{x:0,y:0},D=T.type==="story"||T.type==="slice",R=T.type==="story"?d.get(T.label)?.width??gi:u.get(h(T))?.width??gi,q=T.type==="story"?d.get(T.label)?.height??Fa:u.get(h(T))?.height??Fa,P=D?R:T.type==="gwt"?$h:Tn,G=D?q:T.type==="gwt"?Uh:PO;y.set(T.id,{x:O.x,y:O.y,width:P,height:G});const X=T.type==="gwt"?e.nodes.filter(W=>W.type==="gwt"&&(T.sourcePath?W.sourcePath===T.sourcePath:W.sliceTitle===T.sliceTitle)).filter(W=>N.nodeIds.has(W.id)&&(!W.storyName||w.has(W.storyName))).filter(W=>!s.diffFilter||s.diffFilter==="all"||s.diffNodeStatus?.[W.id]===s.diffFilter):void 0;return{id:T.id,type:D?"groupNode":"eventModelNode",position:O,initialWidth:D||T.type==="gwt"?P:void 0,initialHeight:D||T.type==="gwt"?G: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:v.has(T.id),actorRelated:N.relatedNodeIds.has(T.id),diffStatus:s.diffNodeStatus?.[T.id]},hidden:!N.nodeIds.has(T.id)||!!(X&&X[0]?.id!==T.id)||!!(T.storyName&&!w.has(T.storyName))||!!(!X&&s.diffFilter&&s.diffFilter!=="all"&&s.diffNodeStatus?.[T.id]!==s.diffFilter),style:D?{width:R,height:q,zIndex:T.type==="story"?-20:-10,opacity:N.relatedNodeIds.has(T.id)?.72:1}:{width:P,height:T.type==="gwt"?Uh:void 0,opacity:N.relatedNodeIds.has(T.id)?.72:1},...i3(T)}}),z=new Set(C.filter(T=>!T.hidden).map(T=>T.id)),x=e.edges.filter(T=>E.has(T.kind)).filter(T=>z.has(T.source)&&z.has(T.target)).map(T=>{const O=c.get(T.source),D=c.get(T.target),R=!!s.focusedEdgeIds?.has(T.id),q=s.diffEdgeStatus?.[T.id],P=n3(q),{sourceSide:G,targetSide:X,route:W}=d3(T.kind,O,D,y.get(T.source),y.get(T.target));return{id:T.id,source:T.source,target:T.target,type:"eventModelEdge",sourceHandle:`${G}-source`,targetHandle:`${X}-target`,data:{kind:T.kind,route:W,active:R,diffStatus:q,fieldFlow:s.edgeFieldFlows?.get(T.id),selectedFieldName:s.selectedFieldName,onSelectField:s.onSelectField},markerEnd:{type:Ro.ArrowClosed,color:R?"#111827":P??t3(T.kind)},label:s.edgeDetail==="verbose"?T.label:void 0,className:`edge ${R?"edge-active":""} ${q?`edge-diff-${q}`:""}`,hidden:!!(s.diffFilter&&s.diffFilter!=="all"&&q!==s.diffFilter),animated:R}});return{nodes:C,edges:x}}function Gs(e,n){return JSON.stringify([e,n.type,n.sourcePath,n.sourceName,n.label,n.sliceTitle])}function m3(e,n,s,l,o){const c=Gs(n,s);if(o!==void 0&&e[c]?.message!==o)return e;if(l)return{...e,[c]:{sessionId:n,identity:rl(s),message:l}};const u={...e};return delete u[c],u}function rl(e){return{type:e.type,sourcePath:e.sourcePath,sourceName:e.sourceName,label:e.label,sliceTitle:e.sliceTitle}}function Ih(e,n){return e.type===n.type&&e.sourcePath===n.sourcePath&&e.sourceName===n.sourceName&&e.label===n.label&&e.sliceTitle===n.sliceTitle}function qv(e,n){const s=e.nodes.find(l=>l.id===n);return s?{identity:rl(s),nodeId:n,snapshotNodes:e.nodes}:void 0}function is(e,n){if(!e||!n)return;if(e.nodes===n.snapshotNodes)return e.nodes.find(l=>l.id===n.nodeId&&Ih(l,n.identity));const s=e.nodes.filter(l=>Ih(l,n.identity));return s.length===1?s[0]:void 0}function g3(e,n){return e.nodes.filter(s=>Ih(s,rl(n))).length===1}function Em(e,n){if(!(!n||e?.nodeStatus[n.id]!=="changed"))return e.previousNodes?.[n.id]??e.previousGwtNodes?.[n.id]}function p3(e,n){if(!n)return e;const s=e.nodes.filter(c=>n.nodeStatus[c.id]!=="added").map(c=>{const u=Em(n,c);return u?{...u,id:c.id}:c}),l=new Set(s.map(c=>c.id)),o=e.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=>l.has(c.source)&&l.has(c.target));return{...e,nodes:s,edges:o}}function y3(e,n){if(!n)return e;const s=e.nodes.filter(c=>n.nodeStatus[c.id]!=="removed"),l=new Set(s.map(c=>c.id)),o=e.edges.filter(c=>n.edgeStatus[c.id]!=="removed"&&l.has(c.source)&&l.has(c.target));return{...e,nodes:s,edges:o}}function v3(e){if(!e||typeof e!="object")return!1;const n=e;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 b3(e,n,s,l,o,c=!1){if(!e)return"Feedback is available when a project session is running.";if(!s)return"Reconnect to the project server before adding feedback.";if(e.stale||e.error)return"The model is stale. Fix the model error before adding feedback.";if(n==="turn")return"Switch to Current or Session diff to add feedback about the current model.";if(o?.nodeStatus[l.id]==="removed")return"This node was removed. Select a current node to add feedback.";if(c)return"Switch to New version to add feedback about the current node. Your draft is preserved.";if(!g3(e.project,l))return"This node is ambiguous. Give same-named nodes distinct names before adding feedback.";if(n==="session"&&!e.currentNodeIds)return"Refresh the project server before adding feedback from Session diff.";if(e.currentNodeIds&&!e.currentNodeIds[l.id])return"This node has no unique current target. Select a current node to add feedback."}const Nm=20,Wa=4e3,S3=16e3,w3=128*1024;function _m(){return{version:1,drafts:{},queue:{items:[]}}}function Iv(e,n,s,l){const o=e.currentNodeIds?.[n.id]??n.id;return{id:l,sessionId:e.sessionId,projectRoot:e.project.root,nodeId:o,reference:"em://"+(e.project.graphSidecar?.model?.id??"event_model")+"/"+o,revision:e.revision,identity:rl(n),message:s.trim()}}function pl(e){if(e.length>Nm)return"The Queue can hold up to 20 items. Send or remove an item first.";if(e.some(s=>!s.message.trim()||s.message.length>Wa))return"Each queued message must contain 1 to 4000 characters.";if(e.reduce((s,l)=>s+l.message.length,0)>S3)return"The Queue can contain up to 16000 message characters.";if(e.some(s=>!Vo(s)))return"A captured target exceeds the server limits. Copy the feedback before removing it.";const n={clientBatchId:"0".repeat(100),items:e.map(({id:s,nodeId:l,reference:o,revision:c,message:u})=>({id:s,nodeId:l,reference:o,revision:c,message:u}))};if(new TextEncoder().encode(JSON.stringify(n)).byteLength>w3)return"This Queue exceeds the 128 KiB request limit. Remove an item before sending."}function Am(e,n){return!!e.submission?.body.items.some(s=>s.id===n)}function x3(e,n){if(e.items.some(o=>o.id===n.id))return e;const s=[...e.items,n],l=pl(s);return l?{...e,error:l}:{...e,items:s,error:void 0,notice:void 0}}function E3(e,n,s){if(Am(e,n))return e;const l=e.items.map(c=>c.id===n?{...c,message:s.trim()}:c),o=pl(l);return o?{...e,error:o}:{...e,items:l,editing:void 0,error:void 0,notice:void 0}}function N3(e,n){return Am(e,n)?e:{...e,items:e.items.filter(s=>s.id!==n),editing:e.editing?.id===n?void 0:e.editing,error:void 0,notice:void 0}}function XS(e,n){if(e.sessionId!==n.sessionId)return"This item belongs to a previous session. Copy it, then add feedback for a current node.";if(e.projectRoot!==n.project.root)return"This item belongs to another project. Copy it, then add feedback for the current project.";if(e.revision!==n.revision)return"The model changed after this item was added. Copy it, then review and add it again.";const s=n.project.nodes.filter(o=>Gs(n.sessionId,o)===Gs(e.sessionId,e.identity)&&n.diff?.nodeStatus[o.id]!=="removed");if(s.length!==1||(n.currentNodeIds?.[s[0].id]??s[0].id)!==e.nodeId)return"The original node is missing or ambiguous. Copy the text before removing this item.";const l="em://"+(n.project.graphSidecar?.model?.id??"event_model")+"/"+e.nodeId;if(e.reference!==l)return"The model reference changed. Review and add this feedback again."}function _3(e,n,s,l,o){if(!n||!l)return"Reconnect to the project server before sending the Queue.";if(e.submission?.sessionId!==void 0&&(e.submission.sessionId!==n.sessionId||e.submission.projectRoot!==n.project.root))return"The project changed or the server restarted before this batch could be confirmed.";if(o||e.submission?.phase==="sending")return"Waiting for the server to confirm this batch.";if(!e.submission)return e.editing?"Save or cancel the Queue edit before sending.":e.items.length?n.stale||n.error?"The model is stale. Fix the model error before sending.":s==="turn"?"Switch to Current or Session diff before sending.":n.feedback.status==="stopped"?"Resume the session before sending.":n.feedback.status==="queued"||n.feedback.status==="working"?"Wait for the current request to finish before sending.":e.items.some(c=>XS(c,n))?"Review the flagged Queue items before sending. Their captured targets have not been changed.":pl(e.items):"Add feedback to the Queue before sending."}function A3(e,n){return e.submission?.phase==="sending"?e:e.submission?{...e,submission:{...e.submission,phase:"sending"},error:void 0}:!e.items.length||e.editing||pl(e.items)?e:{...e,error:void 0,notice:void 0,submission:{sessionId:e.items[0].sessionId,projectRoot:e.items[0].projectRoot,phase:"sending",body:{clientBatchId:n,items:e.items.map(({id:s,nodeId:l,reference:o,revision:c,message:u})=>({id:s,nodeId:l,reference:o,revision:c,message:u}))}}}}function T3(e,n,s,l){return e.submission?.body.clientBatchId!==n?e:{...e,submission:l?{...e.submission,phase:"uncertain"}:void 0,error:s}}function KS(e,n){if(e.submission?.body.clientBatchId!==n)return e;const s=new Set(e.submission.body.items.map(l=>l.id));return{items:e.items.filter(l=>!s.has(l.id)),editing:e.editing&&!s.has(e.editing.id)?e.editing:void 0,notice:"Feedback sent as one request to your external agent."}}function C3(e,n){return!e.submission||e.submission.sessionId===n.sessionId&&e.submission.projectRoot===n.project.root?e:{...e,submission:void 0,error:"The previous send remains unconfirmed. Its Queue items are preserved for review and cannot be sent to the new session."}}function QS(e,n){if(!Mn(e)||typeof e.id!="string"||!e.id.trim()||typeof n.clientBatchId!="string"||e.clientBatchId!==n.clientBatchId||!Array.isArray(e.items)||!Array.isArray(n.items)||e.items.length!==n.items.length||!e.items.every(Vo)||!n.items.every(Vo))return!1;const s=n.items;return e.items.every((l,o)=>{const c=s[o];return l.id===c.id&&l.nodeId===c.nodeId&&l.reference===c.reference&&l.revision===c.revision&&l.message===c.message})}function M3(e,n){const s=e.submission;if(!s)return e;if(s.sessionId!==n.sessionId||s.projectRoot!==n.project.root){const c="The project changed or its server restarted. The previous send could not be confirmed. Release the previous-session batch to review its preserved items.";return e.error===c&&s.phase==="uncertain"?e:{...e,submission:{...s,phase:"uncertain"},error:c}}const o=[...n.feedback.history,...n.feedback.request?[n.feedback.request]:[]].find(c=>c.clientBatchId===s.body.clientBatchId);return o?QS(o,s.body)?KS(e,s.body.clientBatchId):{...e,submission:{...s,phase:"uncertain"},error:"The server returned different items for this batch ID. The original Queue is preserved."}:e}function Mn(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function ZS(e){return Mn(e)&&typeof e.type=="string"&&["story","slice","screen","processor","command","event","query","gwt"].includes(e.type)&&typeof e.label=="string"&&["sourcePath","sourceName","sliceTitle"].every(n=>e[n]===void 0||typeof e[n]=="string")}function Vo(e){return Mn(e)&&typeof e.id=="string"&&e.id.length>0&&e.id.length<=100&&typeof e.nodeId=="string"&&e.nodeId.length>0&&e.nodeId.length<=500&&typeof e.reference=="string"&&e.reference.length>0&&e.reference.length<=1e3&&typeof e.revision=="string"&&e.revision.length>0&&e.revision.length<=100&&typeof e.message=="string"&&!!e.message.trim()&&e.message.length<=Wa}function O3(e){return Mn(e)&&typeof e.sessionId=="string"&&typeof e.projectRoot=="string"&&ZS(e.identity)&&Vo(e)}const FS="Some saved feedback could not be recovered. A previous send may already have arrived. The original saved data has been kept. Review the agent history before replacing the damaged saved copy and sending again.";function Vv(){return{..._m(),recoveryWarning:FS}}function k3(e){if(!e)return _m();try{const n=JSON.parse(e);if(!Mn(n)||n.version!==1||!Mn(n.drafts)||!Mn(n.queue)||!Array.isArray(n.queue.items))return Vv();const s={};for(const d of Object.values(n.drafts))!Mn(d)||typeof d.sessionId!="string"||!ZS(d.identity)||typeof d.message!="string"||d.message.length>Wa||(s[Gs(d.sessionId,d.identity)]={sessionId:d.sessionId,identity:rl(d.identity),message:d.message});const l=[];for(const d of n.queue.items)O3(d)&&(l.some(g=>g.id===d.id)||l.push({id:d.id,sessionId:d.sessionId,projectRoot:d.projectRoot,nodeId:d.nodeId,reference:d.reference,revision:d.revision,message:d.message,identity:rl(d.identity)}));const o={items:l},c=n.queue.editing;Mn(c)&&typeof c.id=="string"&&typeof c.message=="string"&&l.some(d=>d.id===c.id)&&(o.editing={id:c.id,message:c.message});const u=n.queue.submission;if(Mn(u)&&typeof u.sessionId=="string"&&typeof u.projectRoot=="string"&&Mn(u.body)&&typeof u.body.clientBatchId=="string"&&u.body.clientBatchId.length>0&&u.body.clientBatchId.length<=100&&Array.isArray(u.body.items)&&u.body.items.length>0&&u.body.items.length<=Nm&&u.body.items.every(Vo)){const d=u.body.items.map(({id:g,nodeId:y,reference:p,revision:v,message:w})=>({id:g,nodeId:y,reference:p,revision:v,message:w}));new Set(d.map(g=>g.id)).size===d.length&&d.every(g=>l.some(y=>y.id===g.id&&y.sessionId===u.sessionId&&y.projectRoot===u.projectRoot&&y.nodeId===g.nodeId&&y.reference===g.reference&&y.revision===g.revision&&y.message===g.message))&&(o.editing=o.editing&&!d.some(g=>g.id===o.editing?.id)?o.editing:void 0,o.submission={sessionId:u.sessionId,projectRoot:u.projectRoot,phase:"uncertain",body:{clientBatchId:u.body.clientBatchId,items:d}},o.error="A previous send was not confirmed. Refresh to check its status, or retry the same batch.")}const h=Object.keys(s).length!==Object.keys(n.drafts).length||l.length!==n.queue.items.length||!!pl(l)||u!==void 0&&!o.submission;return{version:1,drafts:s,queue:o,recoveryWarning:h?FS:void 0}}catch{return Vv()}}function j3(e){return JSON.stringify({version:1,drafts:e.drafts,queue:{items:e.queue.items,editing:e.queue.editing,submission:e.queue.submission}})}class No extends Error{constructor(n,s){super(n),this.uncertain=s,this.name="FeedbackCommandError"}uncertain}function Vh(e){return e instanceof Error?e.message:String(e)}async function Yv(e){const n=await e.json().catch(()=>{});return typeof n?.error=="string"?n.error:"Request failed ("+e.status+")."}function z3(e,n){const[s,l]=V.useState(),[o,c]=V.useState(),[u,h]=V.useState("checking"),[d,g]=V.useState(),[y,p]=V.useState(!1),[v,w]=V.useState(!1),[E,N]=V.useState(0),A=V.useRef(void 0),C=V.useRef(!1),z=V.useRef(!0),_=V.useRef(null),x=V.useCallback(()=>N(O=>O+1),[]);V.useEffect(()=>(z.current=!0,()=>{z.current=!1,_.current?.abort()}),[]),V.useEffect(()=>{if(!e)return;let O=!1,D,R;h("checking");const q=async()=>{const P=new AbortController;R=P;const G=setTimeout(()=>P.abort(),5e3);let X=!1;try{const W=await To("/api/session?view="+n,{signal:P.signal,cache:"no-store"});if(W.status===404&&!A.current){X=!0,O||h("unavailable");return}if(!W.ok)throw new Error(await Yv(W));if(!W.headers.get("content-type")?.includes("application/json")&&!A.current){X=!0,O||h("unavailable");return}const B=await W.json();if(!v3(B))throw new Error("The project server returned an invalid session snapshot.");if(O)return;A.current&&A.current!==B.sessionId&&(p(!0),_.current?.abort(),C.current=!1),A.current=B.sessionId,l(B),c(n),h("live"),g(void 0),C.current||w(!1)}catch(W){if(O)return;h("offline"),g(P.signal.aborted?"The project server did not respond. Retrying...":Vh(W)),C.current||w(!1)}finally{clearTimeout(G),!O&&!X&&(D=setTimeout(()=>{q()},1e3))}};return q(),()=>{O=!0,R?.abort(),D&&clearTimeout(D)}},[e,n,E]);const T=V.useCallback(async(O,D)=>{if(!s||!e||u!=="live"||o!==n)throw new Error("Wait for the current session to reconnect.");if(C.current||v)throw new Error("A request is already in progress.");const R=new AbortController;_.current=R;const q=setTimeout(()=>R.abort(),1e4);C.current=!0,w(!0);try{const P=await To("/api/feedback/"+O,{method:"POST",headers:{"Content-Type":"application/json","X-Emviz-Token":s.token},body:JSON.stringify(D),signal:R.signal});if(!P.ok)throw new No(await Yv(P),P.status>=500);if(O==="batch"){const G=await P.json().catch(()=>{});if(!QS(G,D))throw new No("The server did not return a matching batch confirmation. Refresh to check delivery, or retry the same batch.",!0)}}catch(P){throw z.current&&w(!1),P instanceof No?P:new No("The server did not confirm the request. Refresh to check its status, or retry the same batch.",!0)}finally{clearTimeout(q),C.current=!1,z.current&&x()}},[u,e,v,x,s,o,n]);return{snapshot:s,snapshotView:o,connection:u,error:d,changedSession:y,pending:v,refresh:x,command:T}}const Gv={idle:"Idle",queued:"Queued",working:"Working",completed:"Completed",stopped:"Stopped"};function D3({session:e,view:n,onView:s,node:l,diff:o,showingBefore:c,message:u,onMessageChange:h,onAdded:d,drafts:g,queue:y,onQueueChange:p,storageNeedsReview:v}){const[w,E]=V.useState(),[N,A]=V.useState(),C=V.useRef(!1),z=e.snapshot,_=e.connection==="live"&&e.snapshotView===n,x=l?b3(z,n,_,l,o,c):"Select a current node to write feedback.",T=v?"Review the damaged saved feedback before sending. A previous batch may already have arrived.":_3(y,z,n,_,e.pending),O=z&&l?Iv(z,l,u,"preview"):void 0,D=x??(O&&u.trim()?pl([...y.items,O]):void 0),R=z?.feedback,q=_&&!z?.stale&&!z?.error,P=q&&R?.agent.connected,G=R?.request,X=R?.history.filter(L=>L.id!==G?.id)??[],W=G?[...X,G]:X,B=L=>{E(void 0),e.command(L,{}).catch(Y=>E(Vh(Y)))},K=L=>{if(L.preventDefault(),D||!z||!l||!u.trim())return;const Y=Iv(z,l,u,Nv());p(ee=>x3(ee,Y)),d(u)},j=async()=>{if(T||C.current)return;const L=A3(y,y.submission?.body.clientBatchId??Nv()),Y=L.submission;if(Y){C.current=!0,p(L);try{await e.command("batch",Y.body),p(ee=>KS(ee,Y.body.clientBatchId))}catch(ee){p(k=>T3(k,Y.body.clientBatchId,Vh(ee),ee instanceof No&&ee.uncertain))}finally{C.current=!1}}},$=async L=>{try{await navigator.clipboard.writeText(L),A("Copied queued feedback.")}catch{A("Copy is unavailable. Select the message text and copy it manually.")}};return S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"agent-content",children:[S.jsxs("section",{className:"feedback-session","aria-label":"Feedback session",children:[S.jsxs("div",{className:"feedback-session-heading",children:[S.jsx("h2",{children:"Agent"}),S.jsx("span",{className:"feedback-state feedback-state-"+(R?.status??"idle"),role:"status",children:R?Gv[R.status]:"No session"})]}),S.jsxs("p",{className:"agent-presence",children:[S.jsx("span",{"aria-hidden":"true",className:P?"presence-dot connected":"presence-dot"}),q?P?"Agent connected":"Agent disconnected":"Agent status unavailable"]}),S.jsxs("div",{className:"feedback-session-actions",children:[S.jsx("button",{type:"button",onClick:e.refresh,disabled:e.pending,children:"Refresh"}),R?R.status==="stopped"?S.jsx("button",{type:"button",onClick:()=>B("start"),disabled:!_||e.pending,children:"Resume session"}):S.jsx("button",{type:"button",onClick:()=>B("stop"),disabled:!_||e.pending,children:"Stop session"}):null]}),z?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"segmented feedback-views",role:"group","aria-label":"Model view",children:[["current","Current"],["session","Session diff"],["turn","Turn diff"]].map(([L,Y])=>S.jsx("button",{type:"button","aria-pressed":n===L,onClick:()=>s(L),children:Y},L))}),S.jsxs("p",{className:"feedback-baseline",children:["Baseline ",z.baseline.kind==="startup"?"startup snapshot":"Git"," · ",z.baseline.label]})]}):S.jsx("p",{className:"muted",children:"Feedback is available when a project session is running."}),e.connection==="checking"?S.jsx("p",{role:"status",children:"Refreshing the model..."}):null,e.error||z?.error||R?.error||w?S.jsx("p",{className:"feedback-error",role:"alert",children:w??e.error??z?.error??R?.error}):null,z?.stale||e.connection==="offline"?S.jsx("p",{className:"feedback-warning",children:"Showing the last available model and agent status. Feedback stays local until the project reconnects and loads valid files."}):null,e.changedSession?S.jsx("p",{className:"feedback-warning",children:"The project server restarted. The previous session history is no longer available."}):null,R?.status==="stopped"?S.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."}):R?S.jsx("p",{className:"feedback-note",children:"Stop session cancels feedback. It cannot stop an external agent process or its file writes."}):null]}),l&&z?S.jsxs("form",{className:"feedback-composer","aria-label":"Node feedback",onSubmit:K,children:[S.jsxs("h3",{children:["Feedback for ",l.label]}),S.jsxs("p",{className:"feedback-target",children:[S.jsx("span",{children:l.type}),S.jsx("code",{children:O?.reference})]}),S.jsx("label",{htmlFor:"feedback-message",children:"Feedback message"}),S.jsx("textarea",{id:"feedback-message",value:u,maxLength:Wa,rows:4,disabled:!!x,"aria-describedby":"feedback-help",placeholder:"Describe the change you want for this node.",onChange:L=>h(L.target.value)}),S.jsx("p",{className:"muted",id:"feedback-help",children:D??"Add this note to your local Queue. Send to Agent sends the whole Queue as one request."}),S.jsxs("div",{className:"feedback-composer-actions",children:[S.jsxs("small",{children:[u.length,"/",Wa]}),S.jsx("button",{type:"submit",disabled:!!D||!u.trim(),children:"Add to Queue"})]})]}):S.jsx("p",{className:"agent-empty",children:"Select a current node to write feedback. Your Queue stays here as you move around the model."}),S.jsxs("section",{className:"feedback-queue","aria-label":"Feedback Queue",children:[S.jsxs("div",{className:"feedback-queue-heading",children:[S.jsx("h3",{children:"Queue"}),S.jsxs("span",{children:[y.items.length,"/",Nm," · Unsent"]})]}),y.items.length?S.jsx("ol",{children:y.items.map(L=>{const Y=Am(y,L.id),ee=z?XS(L,z):void 0,k=y.editing?.id===L.id;return S.jsxs("li",{"data-queue-id":L.id,className:ee?"feedback-queue-item needs-review":"feedback-queue-item",children:[S.jsxs("div",{className:"feedback-queue-item-heading",children:[S.jsx("strong",{children:L.identity.label}),S.jsx("small",{children:Y?y.submission?.phase==="sending"?"Sending...":"Awaiting confirmation":"Unsent"})]}),S.jsx("code",{children:L.reference}),S.jsxs("p",{className:"feedback-captured",children:[L.identity.type," · Revision ",L.revision.slice(0,12)]}),ee?S.jsx("p",{className:"feedback-warning",children:ee}):null,k?S.jsxs(S.Fragment,{children:[S.jsxs("label",{className:"sr-only",htmlFor:"queue-edit-"+L.id,children:["Edit queued feedback for ",L.identity.label]}),S.jsx("textarea",{id:"queue-edit-"+L.id,value:y.editing?.message??"",maxLength:Wa,rows:4,onChange:H=>p(ne=>({...ne,editing:{id:L.id,message:H.target.value}}))}),S.jsxs("div",{className:"feedback-queue-actions",children:[S.jsx("button",{type:"button",onClick:()=>p(H=>E3(H,L.id,H.editing?.message??L.message)),disabled:!y.editing?.message.trim(),children:"Save"}),S.jsx("button",{type:"button",onClick:()=>p(H=>({...H,editing:void 0})),children:"Cancel"})]})]}):S.jsxs(S.Fragment,{children:[S.jsx("p",{className:"feedback-message",children:L.message}),S.jsxs("div",{className:"feedback-queue-actions",children:[S.jsx("button",{type:"button","aria-label":"Edit queued feedback for "+L.identity.label,disabled:Y||!!y.editing,onClick:()=>p(H=>({...H,editing:{id:L.id,message:L.message}})),children:"Edit"}),S.jsx("button",{type:"button","aria-label":"Remove queued feedback for "+L.identity.label,disabled:Y,onClick:()=>p(H=>N3(H,L.id)),children:"Remove"}),S.jsx("button",{type:"button","aria-label":"Copy queued feedback for "+L.identity.label,onClick:()=>{$(L.message)},children:"Copy"})]})]})]},L.id)})}):S.jsx("p",{className:"muted",children:"No queued feedback. Add notes from the nodes you want to change, then send them together."}),N?S.jsx("p",{role:"status",children:N}):null]}),z?S.jsx(R3,{drafts:g,snapshot:z}):null,W.length?S.jsxs("details",{className:"feedback-history",children:[S.jsxs("summary",{children:["Feedback history (",W.length,")"]}),S.jsx("ol",{"aria-label":"Feedback history",children:W.map(L=>S.jsxs("li",{"data-request-id":L.id,children:[L.items?.length?S.jsx("ul",{className:"feedback-request-items",children:L.items.map(Y=>S.jsxs("li",{children:[S.jsx("code",{children:Y.reference}),S.jsx("p",{children:Y.message})]},Y.id))}):S.jsxs(S.Fragment,{children:[S.jsx("code",{children:L.reference}),S.jsx("p",{children:L.message})]}),L.reply?S.jsx("p",{className:"feedback-reply",children:L.reply}):S.jsx("p",{className:"muted",children:L.id===G?.id&&R?Gv[R.status]:"No reply recorded."})]},L.id))})]}):null]}),S.jsxs("footer",{className:"feedback-send",children:[y.submission?.phase==="uncertain"?S.jsx("p",{className:"feedback-warning",children:"The send is not confirmed. These items are locked so a retry uses the same batch ID and contents. Refresh can confirm delivery without sending again."}):null,y.error?S.jsx("p",{className:"feedback-error",role:"alert",children:y.error}):null,z&&y.submission&&(y.submission.sessionId!==z.sessionId||y.submission.projectRoot!==z.project.root)?S.jsx("button",{type:"button",onClick:()=>p(L=>C3(L,z)),children:"Release previous-session batch"}):null,y.notice?S.jsx("p",{role:"status",children:y.notice}):null,T&&y.items.length>0?S.jsx("p",{className:"muted",id:"feedback-send-help",children:T}):null,S.jsx("button",{type:"button",className:"feedback-send-button",onClick:()=>{j()},disabled:!!T,"aria-describedby":T&&y.items.length?"feedback-send-help":void 0,children:y.submission?.phase==="sending"?"Sending...":y.submission?"Retry same batch":"Send to Agent"}),S.jsxs("small",{children:[y.items.length," queued ",y.items.length===1?"item":"items"," · One agent request"]})]})]})}function R3({drafts:e,snapshot:n}){const[s,l]=V.useState();if(!e.length)return null;const o=async c=>{try{await navigator.clipboard.writeText(c.message),l("Copied draft for "+c.identity.label+".")}catch{l("Copy is unavailable. Select the draft text below and copy it manually.")}};return S.jsxs("details",{className:"feedback-history",children:[S.jsxs("summary",{children:["Unsent feedback drafts (",e.length,")"]}),S.jsxs("ol",{"aria-label":"Unsent feedback drafts",children:[e.map(c=>{const u=Gs(c.sessionId,c.identity),h=n.project.nodes.filter(g=>Gs(n.sessionId,g)===u&&n.diff?.nodeStatus[g.id]!=="removed"),d=c.sessionId!==n.sessionId?"Saved from a previous session. Copy the text before starting new feedback.":h.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 S.jsxs("li",{children:[S.jsx("strong",{children:c.identity.label}),S.jsxs("p",{className:"muted",children:[c.identity.type," · ",c.identity.sourcePath??"No source path"]}),S.jsx("p",{className:"feedback-warning",children:d}),S.jsx("p",{children:c.message}),S.jsx("button",{type:"button",onClick:()=>{o(c)},children:"Copy draft"})]},u)}),s?S.jsx("li",{role:"status",children:s}):null]})]})}function Ue(e,n,s,l,o){return{id:`${n}:${l??"project"}:${s}`,severity:e,check:n,message:s,path:l,nodeId:o}}function La(e){const n=new Set,s=new Set;for(const l of e){const o=l.trim().toLowerCase();o&&(n.has(o)&&s.add(l),n.add(o))}return[...s]}const B3=new Set(["sent","built","made","paid","booked","cancelled","canceled","submitted","recorded","created","updated","deleted","placed","notified"]);function L3(e){return e.match(/[A-Z]+(?=[A-Z][a-z]|$)|[A-Z]?[a-z]+|\d+/g)??[e]}function H3(e){const n=e.toLowerCase();return B3.has(n)||/(ed|en|d)$/i.test(e)}function $3(e){return L3(e).some(H3)}function Xv(e){return/(Requested|Triggered|Scheduled|Enqueued|Dispatched|Required)$/.test(e)}function U3(e){return["Selected","Shown","Viewed","Clicked","Opened","Closed","Ticked","Incremented","Reached","Displayed","Navigated"].find(n=>e.includes(n))}function q3(e){const n=new Set(e.nodes.map(c=>c.id)),s=new Map;for(const c of n)s.set(c,new Set);for(const c of e.edges)!n.has(c.source)||!n.has(c.target)||(s.get(c.source)?.add(c.target),s.get(c.target)?.add(c.source));let l=0;const o=new Set;for(const c of n){if(o.has(c))continue;l+=1;const u=[c];for(o.add(c);u.length>0;){const h=u.shift();if(h)for(const d of s.get(h)??[])o.has(d)||(o.add(d),u.push(d))}}return l}function I3(e){const n=(e.actorIssues??[]).map(d=>Ue("error","A1",d.message,d.path)),s=new Set(e.events.map(d=>d.name)),l=new Set(e.slices.map(d=>d.path)),o=new Map,c=new Map;for(const d of e.stories){d.slices.length>15&&n.push(Ue("warning","S4",`Story "${d.name}" has ${d.slices.length} slices; consider splitting it.`,d.path));for(const g of d.slices)l.has(g)||n.push(Ue("error","S2",`Story "${d.name}" lists missing slice "${g}".`,d.path))}for(const d of e.events){d.fields?.trim()||n.push(Ue("error","C4",`Event "${d.name}" has no fields block.`,d.sourcePath)),!$3(d.name)&&!Xv(d.name)&&n.push(Ue("warning","C3",`Event "${d.name}" does not obviously read as a past-tense domain event.`,d.sourcePath));const g=U3(d.name);g&&n.push(Ue("warning","D1",`Event "${d.name}" contains red-flag verb "${g}"; confirm this is persisted domain state.`,d.sourcePath))}for(const d of e.slices){const g=d.commands.map(p=>p.name),y=d.queries.map(p=>p.name);for(const p of La(g))n.push(Ue("error","L9",`Command "${p}" is duplicated within slice "${d.title}".`,d.path));for(const p of La(y))n.push(Ue("error","L9",`Query "${p}" is duplicated within slice "${d.title}".`,d.path));for(const p of La(d.screen.reads))n.push(Ue("error","L9",`screen.reads lists "${p}" more than once.`,d.path));for(const p of La(d.screen.executes))n.push(Ue("error","L9",`screen.executes lists "${p}" more than once.`,d.path));for(const p of d.screen.reads)y.includes(p)||n.push(Ue("error","W2",`screen.reads references missing local query "${p}".`,d.path));for(const p of d.screen.executes)g.includes(p)||n.push(Ue("error","W1",`screen.executes references missing local command "${p}".`,d.path));d.screen.type==="system"&&d.screen.actors.length>0&&n.push(Ue("error","L5",`System slice "${d.title}" must not declare screen.actors.`,d.path)),d.storyName||n.push(Ue("warning","M2",`Slice "${d.title}" is not listed by any story.`,d.path)),d.commands.length>0&&d.gwt.length===0&&n.push(Ue("warning","M1",`Command slice "${d.title}" has no GWT scenarios.`,d.path));for(const p of d.commands){p.fields?.trim()||n.push(Ue("warning","L6",`Command "${p.name}" has no fields block.`,d.path));for(const v of p.produces)s.has(v)||n.push(Ue("error","G1",`Command "${p.name}" produces unregistered event "${v}".`,d.path)),o.set(v,[...o.get(v)??[],`${d.title}.${p.name}`])}for(const p of d.queries){p.fields?.trim()||n.push(Ue("warning","L7",`Query "${p.name}" has no fields block.`,d.path)),p.name.includes("For")||n.push(Ue("warning","N1",`Query "${p.name}" should use a descriptive <Thing>For<UseCaseOrScreen> name.`,d.path));for(const v of p.fromEvents)s.has(v)||n.push(Ue("error","G2",`Query "${p.name}" reads unregistered event "${v}".`,d.path)),c.set(v,[...c.get(v)??[],`${d.title}.${p.name}`])}for(const p of d.gwt)for(const v of[...p.given,...p.when,...p.then])(!v.type||!["event","command","query","error"].includes(v.type))&&n.push(Ue("error","L8",`GWT scenario "${p.name??"Unnamed"}" has invalid item type "${v.type??""}".`,d.path)),v.name||n.push(Ue("error","L8",`GWT scenario "${p.name??"Unnamed"}" has an item without a name.`,d.path))}for(const d of s){const g=o.get(d)??[],y=c.get(d)??[];g.length===0&&n.push(Ue("error","G3",`Event "${d}" is registered but no command produces it.`)),g.length>1&&n.push(Ue("warning","G8",`Event "${d}" has multiple producers: ${g.join(", ")}.`)),g.length>0&&y.length===0&&n.push(Ue("warning",Xv(d)?"G4b":"G4a",`Event "${d}" is produced but no query consumes it.`))}for(const[d,g]of c.entries())(o.get(d)??[]).length===0&&n.push(Ue("error","G3",`Event "${d}" is read by ${g.join(", ")} but no command produces it.`));for(const d of La(e.slices.flatMap(g=>g.commands.map(y=>y.name))))n.push(Ue("warning","M5",`Command name "${d}" is used in multiple slices; command names should be globally unique.`));for(const d of La(e.slices.flatMap(g=>g.queries.map(y=>y.name))))n.push(Ue("warning","G7",`Query name "${d}" is used in multiple slices; query names should be globally unique.`));const u=e.slices.filter(d=>d.commands.length>0).length;u>0&&e.events.length/u>2&&n.push(Ue("warning","M4",`The model has ${(e.events.length/u).toFixed(1)} events per command slice; check for UI/runtime events leaking into the model.`));const h=q3(e);return h>1&&n.push(Ue("info","I3",`The graph has ${h} disconnected islands.`)),{errors:n.filter(d=>d.severity==="error").length,warnings:n.filter(d=>d.severity==="warning").length,findings:n}}const JS=ou.createContext({open:()=>{},list:()=>{}});function WS(){return S.jsxs(S.Fragment,{children:[S.jsx(vn,{id:"top-target",type:"target",position:he.Top,style:{left:"46%"}}),S.jsx(vn,{id:"top-source",type:"source",position:he.Top,style:{left:"54%"}}),S.jsx(vn,{id:"bottom-target",type:"target",position:he.Bottom,style:{left:"46%"}}),S.jsx(vn,{id:"bottom-source",type:"source",position:he.Bottom,style:{left:"54%"}}),S.jsx(vn,{id:"left-target",type:"target",position:he.Left,style:{top:"46%"}}),S.jsx(vn,{id:"left-source",type:"source",position:he.Left,style:{top:"54%"}}),S.jsx(vn,{id:"right-target",type:"target",position:he.Right,style:{top:"46%"}}),S.jsx(vn,{id:"right-source",type:"source",position:he.Right,style:{top:"54%"}})]})}function yh({title:e,items:n}){const s=n&&n.length>0?n:[{type:"empty",name:"empty"}];return S.jsxs("div",{className:"gwt-step",children:[S.jsx("div",{className:"gwt-step-title",children:e}),S.jsx("div",{className:"gwt-step-items",children:s.map((l,o)=>S.jsxs("div",{className:`gwt-step-item gwt-step-item-${l.type??"empty"}`,children:[S.jsx("span",{children:l.type??"empty"}),S.jsxs("div",{className:"gwt-item-content",children:[S.jsx("strong",{children:l.name??"empty"}),l.fields?S.jsx("pre",{children:l.fields}):null]})]},`${o}-${l.type??"empty"}-${l.name??""}`))})]})}function V3({nodeData:e}){const n=ou.useContext(JS),s=e.scenarios??[];return S.jsxs("div",{className:`em-node em-node-gwt ${e.selected?"selected":""} ${e.diffStatus?`diff-node-${e.diffStatus}`:""}`,children:[S.jsx(WS,{}),S.jsxs("div",{className:"node-type",children:["GWT · ",s.length," cases"]}),e.scenarioStatus?S.jsx("div",{className:"gwt-diff-counts",children:["added","removed","changed"].map(l=>`${l}: ${s.filter(o=>e.scenarioStatus?.[o.id]===l).length}`).join(" · ")}):null,S.jsx("div",{className:"gwt-summary nodrag nopan nowheel",children:s.slice(0,3).map(l=>S.jsxs("button",{type:"button","aria-current":e.selectedScenarioId===l.id?"true":void 0,onClick:o=>{o.stopPropagation(),n.open(l.id)},children:[S.jsx("span",{className:"gwt-scenario-name",children:l.label}),e.scenarioStatus?S.jsx("span",{className:"gwt-scenario-status",children:` · ${e.scenarioStatus[l.id]??"unchanged"}`}):null]},l.id))}),S.jsx("div",{className:"gwt-more nodrag nopan nowheel",children:s.length>3?S.jsxs("button",{type:"button",onClick:l=>{l.stopPropagation(),n.list(e.projectNode.id)},children:["+",s.length-3," more"]}):null})]})}function PS({node:e}){const n=US(e);return n.length===0?null:S.jsx("div",{className:"chips actor-chips nodrag nopan nowheel","aria-label":"Actors",children:n.map(s=>S.jsxs("span",{className:"actor-chip","data-actor-id":s.id,title:s.name+" ("+s.id+")",style:{borderColor:s.color},children:[S.jsx("i",{className:"actor-swatch","aria-hidden":"true",style:{backgroundColor:s.color}}),S.jsx("span",{className:"actor-name",children:s.name})]},s.id))})}function Y3({data:e}){const n=e,s=n.projectNode,l=n.diffStatus&&n.diffStatus!=="unchanged"?S.jsx("div",{className:`diff-badge diff-badge-${n.diffStatus}`,children:n.diffStatus}):null;return s.type==="gwt"?S.jsx(V3,{nodeData:n}):S.jsxs("div",{className:`em-node em-node-${s.type} ${n.selected?"selected":""} ${n.connected?"connected":""} ${n.diffStatus?`diff-node-${n.diffStatus}`:""}`,children:[S.jsx(WS,{}),l,S.jsx("div",{className:"node-type",children:s.type}),S.jsx("div",{className:"node-label",children:s.label}),S.jsx(PS,{node:s})]})}function G3({data:e}){const n=e,s=n.projectNode;return S.jsxs("div",{className:`group-node group-${s.type} ${n.selected?"selected":""} ${n.diffStatus?`diff-node-${n.diffStatus}`:""}`,children:[n.diffStatus&&n.diffStatus!=="unchanged"?S.jsx("div",{className:`diff-badge diff-badge-${n.diffStatus}`,children:n.diffStatus}):null,S.jsxs("div",{className:"group-title",children:[s.label,s.type==="slice"&&n.actorRelated?S.jsx("span",{className:"actor-related-badge",children:"Related"}):null]}),s.description?S.jsx("div",{className:"group-description",children:s.description}):null]})}const X3={eventModelNode:Y3,groupNode:G3};function Kv(e){return e===he.Top?{x:0,y:-1}:e===he.Right?{x:1,y:0}:e===he.Bottom?{x:0,y:1}:{x:-1,y:0}}function K3({sourceX:e,sourceY:n,targetX:s,targetY:l,sourcePosition:o,targetPosition:c,data:u}){const h=u,d=s-e,g=l-n,y=Math.max(56,Math.min(180,Math.abs(g)*.42)),p=Math.max(70,Math.min(180,Math.abs(d)*.38)),v=Math.max(72,Math.min(180,Math.max(Math.abs(d),Math.abs(g))*.38));if(h?.route==="same-slice-read"){const N=o===he.Top?-1:1,A=c===he.Bottom?1:-1,C=Math.max(72,Math.min(150,Math.abs(g)*.65));return`M ${e},${n} C ${e},${n+N*C} ${s},${l+A*C} ${s},${l}`}if(h?.route==="event-read"){const N=Kv(o),A=Kv(c);return`M ${e},${n} C ${e+N.x*v},${n+N.y*v} ${s+A.x*v},${l+A.y*v} ${s},${l}`}if(o===he.Bottom||o===he.Top){const N=o===he.Top?-1:1,A=c===he.Top?-1:1;return`M ${e},${n} C ${e},${n+N*y} ${s},${l+A*y} ${s},${l}`}const w=o===he.Left?-1:1,E=c===he.Left?-1:1;return`M ${e},${n} C ${e+w*p},${n} ${s+E*p},${l} ${s},${l}`}function Q3(e){const n=e.data,s=n?.diffStatus==="added"?"#15803d":n?.diffStatus==="removed"?"#b91c1c":n?.diffStatus==="changed"?"#b45309":void 0,l=n?.active?"#111827":s??"#64748b",o=n?.fieldFlow,c=!!(n?.selectedFieldName&&(o?.sharedFieldNames.includes(n.selectedFieldName)||o?.derivedFieldNames.includes(n.selectedFieldName))),u=(e.sourceX+e.targetX)/2,h=(e.sourceY+e.targetY)/2;return S.jsxs(S.Fragment,{children:[S.jsx(Fo,{path:K3(e),markerEnd:e.markerEnd,style:{...e.style,stroke:l,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)?S.jsx(FC,{children:S.jsxs("div",{className:`edge-field-label nodrag nopan ${n?.active?"active":""} ${c?"field-selected":""}`,style:{transform:`translate(-50%, -50%) translate(${u}px, ${h}px)`},children:[o.visibleFieldNames.map(d=>S.jsx("button",{type:"button",onClick:()=>n?.onSelectField?.(d),children:d},d)),o.remainingCount>0?S.jsxs("span",{children:["+",o.remainingCount]}):null]})}):null]})}const Z3={eventModelEdge:Q3};function zc({label:e,description:n,value:s,copiedKey:l,onCopy:o}){return S.jsx("button",{type:"button",className:"copy-action",onClick:()=>o(l,s),children:S.jsxs("span",{children:[S.jsx("strong",{children:e}),S.jsx("small",{children:n})]})})}function ew(e){return e==="query-screen"||e==="screen-command"||e==="command-event"||e==="event-query"}function F3(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function J3(e){return(e.graphSidecar?.model?.name??e.graphSidecar?.model?.id??"event-model").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"event-model"}async function Qv(e){const n=await fetch(e);if(!n.ok)throw new Error(`Failed to fetch ${e}: ${n.status}`);return n.text()}async function W3(e,n,s){const l=Array.from(document.querySelectorAll('script[type="module"][src]')).map(g=>new URL(g.src,window.location.href)).filter(g=>!g.pathname.includes("/@vite/")&&!g.pathname.endsWith("/@react-refresh"));if(l.length===0||l.some(g=>g.pathname.includes("/src/")||g.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(g=>new URL(g.href,window.location.href)),c=await Promise.all(o.map(g=>Qv(g.href))),u=Array.from(document.querySelectorAll("style")).map(g=>g.textContent??"").filter(Boolean),h=await Promise.all(l.map(g=>Qv(g.href))),d={project:e,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 - ${e.graphSidecar?.model?.name??"export"}</title>`,` <style>${[...c,...u].join(`
154
+
155
+ `)}</style>`," </head>"," <body>",' <div id="root"></div>',` <script>window.__EMVIZ_EXPORT__ = ${F3(d)};<\/script>`,` <script type="module">${h.join(`
156
+
157
+ `)}<\/script>`," </body>","</html>"].join(`
158
+ `)}function P3({diff:e,filter:n,onFilter:s,onSelect:l}){const o=Object.entries(e.nodeStatus).filter(([,c])=>c!=="unchanged").slice(0,80);return S.jsxs("aside",{className:"panel diff-panel",children:[S.jsx("h2",{children:"Diff"}),S.jsxs("div",{className:"diff-range",children:[S.jsx("code",{children:e.base.label}),S.jsx("span",{children:"to"}),S.jsx("code",{children:e.target.label})]}),S.jsxs("div",{className:"diff-counts",children:[S.jsxs("button",{type:"button",className:n==="added"?"active added":"added",onClick:()=>s(n==="added"?"all":"added"),children:[S.jsx("strong",{children:e.summary.nodes.added}),S.jsx("span",{children:"Added"})]}),S.jsxs("button",{type:"button",className:n==="removed"?"active removed":"removed",onClick:()=>s(n==="removed"?"all":"removed"),children:[S.jsx("strong",{children:e.summary.nodes.removed}),S.jsx("span",{children:"Removed"})]}),S.jsxs("button",{type:"button",className:n==="changed"?"active changed":"changed",onClick:()=>s(n==="changed"?"all":"changed"),children:[S.jsx("strong",{children:e.summary.nodes.changed}),S.jsx("span",{children:"Changed"})]})]}),n!=="all"?S.jsx("button",{type:"button",className:"clear-diff-filter",onClick:()=>s("all"),children:"Show full graph"}):null,S.jsx("h3",{children:"Changed Nodes"}),S.jsx("div",{className:"diff-list",children:o.length===0?S.jsx("p",{className:"muted",children:"No node changes."}):o.map(([c,u])=>S.jsxs("button",{type:"button",className:`diff-list-item ${u}`,onClick:()=>l(c),children:[S.jsx("span",{children:c}),S.jsx("strong",{children:u})]},c))})]})}function ek(e,n){const s=URL.createObjectURL(new Blob([n],{type:"text/html;charset=utf-8"})),l=document.createElement("a");l.href=s,l.download=e,l.click(),URL.revokeObjectURL(s)}async function tk(e){return await Promise.all(Array.from(e).filter(s=>/\.(ya?ml|json)$/i.test(s.name)).map(async s=>({path:s.webkitRelativePath||s.name,content:await s.text()})))}function nk(e){const n=e.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 ik(e){return e.type==="story"?{name:e.label}:e.type==="slice"?{slice:e.label}:e.type==="screen"||e.type==="processor"?{slice:e.sliceTitle??e.label}:e.type==="command"||e.type==="query"?{slice:e.sliceTitle??"",name:e.sourceName??e.label}:{name:e.sourceName??e.label}}function sk(e){const n=e.graphSidecar?.nodes;return n?Object.entries(n).flatMap(([s,l])=>{const o=l,c=e.nodes.filter(u=>{if(o.type==="screen"&&u.type!=="screen"&&u.type!=="processor"||o.type!=="screen"&&o.type!==u.type)return!1;const h=ik(u);return Object.entries(o.selector??{}).every(([d,g])=>h[d]===g)});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 ak({onImport:e,error:n}){return S.jsx("div",{className:"import-panel",children:S.jsxs("div",{className:"import-card",children:[S.jsx("h1",{children:"emviz"}),S.jsx("p",{children:"Import an Event Modeling project folder or select YAML/JSON files to visualize the model."}),S.jsxs("div",{className:"import-actions",children:[S.jsxs("label",{children:["Import folder",S.jsx("input",{type:"file",multiple:!0,webkitdirectory:"",directory:"",onChange:s=>s.currentTarget.files&&e(s.currentTarget.files)})]}),S.jsxs("label",{children:["Import files",S.jsx("input",{type:"file",multiple:!0,accept:".yaml,.yml,.json",onChange:s=>s.currentTarget.files&&e(s.currentTarget.files)})]})]}),n?S.jsx("p",{className:"import-error",children:n}):null]})})}function lk({tab:e,onTab:n}){return S.jsx("div",{className:"inspector-tabs",role:"tablist","aria-label":"Inspector",children:["details","agent"].map(s=>S.jsx("button",{type:"button",id:"inspector-tab-"+s,role:"tab","aria-selected":e===s,"aria-controls":"inspector-"+s,tabIndex:e===s?0:-1,onClick:()=>n(s),onKeyDown:l=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(l.key))return;l.preventDefault();const o=l.key==="Home"?"details":l.key==="End"||s==="details"?"agent":"details";n(o),requestAnimationFrame(()=>document.getElementById("inspector-tab-"+o)?.focus())},children:s==="details"?"Details":"Agent"},s))})}function ok({project:e,selectedNode:n,diff:s,findings:l,selectedFieldName:o,onSelect:c,onSelectField:u,onClearField:h,onPreviewConnection:d,onClearPreview:g,gwtList:y,onGwtList:p,onClose:v,onFocusNode:w,tab:E,onTab:N,agentPanel:A,oldVersionId:C,onVersion:z}){const _=Em(s,n),x=n&&_&&C===n?.id?{..._,id:n.id}:n,[T,O]=V.useState(),[D,R]=V.useState(""),q=V.useRef(null),P=V.useRef(0),G=!!y;V.useLayoutEffect(()=>{G&&q.current&&(q.current.scrollTop=P.current)},[G,E]);const X=se=>{se.key!=="Escape"&&se.stopPropagation()},W=V.useCallback((se,te)=>{navigator.clipboard?.writeText(te).then(()=>{O(se),window.setTimeout(()=>O(ue=>ue===se?void 0:ue),1400)})},[]),B=S.jsx(lk,{tab:E,onTab:N});if(E==="agent")return S.jsxs("aside",{id:"inspector-agent",className:"panel panel-right agent-panel","aria-label":"Agent",onKeyDown:X,onKeyUp:X,children:[B,A]});if(y){const se=D.trim().toLowerCase(),te=y.filter(ue=>ue.label.toLowerCase().includes(se));return S.jsxs("aside",{ref:q,id:"inspector-details",className:"panel panel-right gwt-panel","aria-label":"GWT scenarios",onKeyDown:X,onKeyUp:X,onScroll:ue=>{P.current=ue.currentTarget.scrollTop},children:[B,S.jsx("button",{type:"button",onClick:v,children:"Close"}),S.jsxs("h2",{children:[y[0]?.sliceTitle," · All scenarios (",y.length,")"]}),S.jsxs("div",{className:"gwt-filter",children:[S.jsx("label",{htmlFor:"gwt-name-filter",children:"Filter by scenario name"}),S.jsx("input",{id:"gwt-name-filter",type:"search",value:D,onChange:ue=>{R(ue.target.value),P.current=0,q.current&&(q.current.scrollTop=0)}}),S.jsx("button",{type:"button",disabled:!D,onClick:()=>{R(""),P.current=0,q.current&&(q.current.scrollTop=0),q.current?.querySelector("input")?.focus({preventScroll:!0})},children:"Clear filter"})]}),S.jsx("p",{role:"status",children:te.length?`${te.length} of ${y.length} scenarios`:"No scenarios match this name."}),S.jsx("div",{className:"gwt-all-list",children:te.map(ue=>S.jsxs("button",{type:"button","aria-current":x?.id===ue.id?"true":void 0,onClick:()=>{P.current=q.current?.scrollTop??P.current,c(ue.id)},children:[ue.label,s?` · ${s.nodeStatus[ue.id]??"unchanged"}`:""]},ue.id))})]})}if(!x)return S.jsxs("aside",{id:"inspector-details",className:"panel panel-right","aria-label":"Node details",children:[B,S.jsx("h2",{children:"Selection"}),S.jsx("p",{className:"muted",children:"Select a node to inspect source and connections."})]});const K=!!(_&&C===n?.id)||s?.nodeStatus[x.id]==="removed",j=K?p3(e,s):y3(e,s),$=new Map(j.nodes.map(se=>[se.id,se])),L=j.edges.filter(se=>{const te=$.get(se.source),ue=$.get(se.target);return ew(se.kind)&&te&&ue&&te.type!=="gwt"&&ue.type!=="gwt"}),Y=L.filter(se=>se.target===x.id),ee=L.filter(se=>se.source===x.id),k=L1(x.fields),ne=`em://${e.graphSidecar?.model?.id??"event_model"}/${x.id}`,ae=x.raw??x.fields??x.description??x.label,fe=[`Reference: ${ne}`,`Node: ${x.label} (${x.type})`,`Source: ${x.sourcePath??"unknown"}`,"","Incoming:",...Y.length===0?["- none"]:Y.map(se=>`- ${$.get(se.source)?.label??se.source} -> ${x.label}`),"","Outgoing:",...ee.length===0?["- none"]:ee.map(se=>`- ${x.label} -> ${$.get(se.target)?.label??se.target}`),"","Source excerpt:",ae].join(`
159
+ `),de=`Please update this event model node.
160
+
161
+ Reference:
162
+ ${ne}
163
+
164
+ Source path:
165
+ ${x.sourcePath??"unknown"}
166
+
167
+ Current context:
168
+ ${ae}
169
+
170
+ Goal:
171
+ `;return S.jsxs("aside",{id:"inspector-details",className:`panel panel-right ${x.type==="gwt"?"gwt-panel":""}`,"aria-label":"Node details",onKeyDown:X,onKeyUp:X,children:[B,x.type==="gwt"?S.jsxs("div",{className:"gwt-panel-actions",children:[S.jsx("button",{type:"button",onClick:()=>p(x.id),children:"All scenarios"}),S.jsx("button",{type:"button",onClick:v,children:"Close"})]}):null,S.jsxs("div",{className:"panel-heading",children:[S.jsx("h2",{children:x.label}),S.jsx("button",{type:"button",className:"icon-button",onClick:()=>w(x.id),"aria-label":"Focus selected node",title:"Focus selected node",children:S.jsx("span",{className:"target-icon","aria-hidden":"true"})})]}),s&&n?S.jsxs("p",{children:[s.nodeStatus[n.id]," · ",K?"Old version":"New version"]}):null,_?S.jsxs("div",{className:"gwt-panel-actions",role:"group","aria-label":"Node version",children:[S.jsx("button",{type:"button","aria-pressed":C!==n?.id,onClick:()=>z(void 0),children:"New version"}),S.jsx("button",{type:"button","aria-pressed":C===n?.id,onClick:()=>z(n?.id),children:"Old version"})]}):null,x.type==="gwt"?S.jsxs("section",{"aria-label":"Scenario details",children:[x.description?S.jsx("p",{children:x.description}):null,S.jsx(yh,{title:"Given",items:x.given}),S.jsx(yh,{title:"When",items:x.when}),S.jsx(yh,{title:"Then",items:x.then}),S.jsx("p",{className:"muted",children:"YAML below is the source slice, not an individual scenario excerpt."})]}):null,S.jsxs("div",{className:"meta-row",children:[S.jsx("span",{children:"Type"}),S.jsx("strong",{children:x.type})]}),S.jsx(PS,{node:x}),S.jsxs("div",{className:"meta-row",children:[S.jsx("span",{children:"Reference"}),S.jsx("code",{children:ne})]}),x.sourcePath?S.jsxs("div",{className:"meta-row",children:[S.jsx("span",{children:"Source"}),S.jsx("code",{children:x.sourcePath})]}):null,S.jsxs("details",{className:"copy-section",children:[S.jsxs("summary",{children:[S.jsx("span",{children:"Copy for LLM"}),T?S.jsxs("strong",{className:"copy-feedback","aria-live":"polite",children:["Copied ",T]}):null]}),S.jsxs("div",{className:"copy-actions",children:[S.jsx(zc,{label:"Reference",description:"Stable em:// node handle",value:ne,copiedKey:"reference",onCopy:W}),S.jsx(zc,{label:"YAML",description:x.type==="gwt"?"Source YAML for the whole slice":"Source excerpt for this node",value:ae,copiedKey:"YAML",onCopy:W}),S.jsx(zc,{label:"Context",description:"Reference plus incoming/outgoing links",value:fe,copiedKey:"context",onCopy:W}),S.jsx(zc,{label:"Edit prompt",description:"Prompt scaffold for asking an LLM to edit",value:de,copiedKey:"prompt",onCopy:W})]})]}),S.jsx("h3",{children:"Connections"}),S.jsxs("div",{className:"connection-list",children:[S.jsx("strong",{children:"Incoming"}),Y.length===0?S.jsx("p",{className:"muted",children:"None"}):Y.map(se=>S.jsx("button",{type:"button",className:"connection-button",onClick:()=>c(se.source),onMouseEnter:()=>d(se.id),onMouseLeave:g,onFocus:()=>d(se.id),onBlur:g,children:S.jsx("span",{children:$.get(se.source)?.label??se.source})},se.id)),S.jsx("strong",{children:"Outgoing"}),ee.length===0?S.jsx("p",{className:"muted",children:"None"}):ee.map(se=>S.jsx("button",{type:"button",className:"connection-button",onClick:()=>c(se.target),onMouseEnter:()=>d(se.id),onMouseLeave:g,onFocus:()=>d(se.id),onBlur:g,children:S.jsx("span",{children:$.get(se.target)?.label??se.target})},se.id))]}),x.type==="command"||x.type==="event"||x.type==="query"?S.jsxs(S.Fragment,{children:[S.jsx("h3",{children:"Fields"}),S.jsxs("div",{className:"field-panel",children:[k.length===0?S.jsx("p",{className:"field-empty",children:"No fields documented."}):S.jsx("div",{className:"field-list",children:k.map(se=>S.jsx("button",{type:"button",className:o===se?"selected":"",onClick:()=>u(se),children:se},se))}),o?S.jsx("button",{type:"button",className:"clear-field",onClick:h,children:"Clear field focus"}):null]})]}):null,S.jsx("h3",{children:"Findings"}),l.length===0?S.jsx("p",{className:"muted",children:"No findings for this node."}):l.map(se=>S.jsxs("div",{className:`finding finding-${se.severity}`,children:[S.jsx("strong",{children:se.check}),S.jsx("span",{children:se.message})]},se.id)),S.jsx("h3",{children:x.type==="gwt"?"Source slice YAML":"Source"}),S.jsx("pre",{children:ae})]})}function rk({report:e,onSelect:n,open:s,onOpen:l,onClose:o}){const c=e?.errors??0,u=e?.warnings??0,h=c+u;return S.jsxs(S.Fragment,{children:[S.jsxs("button",{type:"button",className:`validation-fab ${c>0?"has-errors":u>0?"has-warnings":""}`,onClick:l,"aria-expanded":s,"aria-controls":"validation-panel",title:"Open validation",children:[S.jsx("span",{"aria-hidden":"true",children:"!"}),h>0?S.jsx("strong",{"aria-label":`${h} validation findings`,children:h}):null]}),s?S.jsxs("aside",{className:"panel validation-drawer",id:"validation-panel",children:[S.jsxs("div",{className:"panel-heading",children:[S.jsx("h2",{children:"Validation"}),S.jsx("button",{type:"button",className:"panel-close",onClick:o,"aria-label":"Close validation",children:"Close"})]}),e?S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"status-row",children:[S.jsxs("span",{className:"status error",children:[e.errors," errors"]}),S.jsxs("span",{className:"status warning",children:[e.warnings," warnings"]})]}),S.jsx("div",{className:"findings-list",children:e.findings.length===0?S.jsx("p",{className:"muted",children:"No validation findings."}):e.findings.map(d=>S.jsxs("div",{className:`finding finding-${d.severity}`,children:[S.jsxs("div",{className:"finding-header",children:[S.jsx("strong",{children:d.check}),d.nodeId?S.jsx("button",{type:"button",onClick:()=>n(d.nodeId),children:"Focus"}):null]}),S.jsx("span",{children:d.message}),d.path?S.jsx("code",{children:d.path}):null]},d.id))})]}):S.jsx("p",{className:"muted",children:"Loading validation..."})]}):null]})}function ck(){const[e,n]=V.useState(),[s,l]=V.useState(),[o,c]=V.useState(),[u,h]=V.useState("all"),[d,g]=V.useState({actorIds:[],includeUnassigned:!1}),y=V.useRef(void 0),[p,v]=V.useState("loading"),[w,E]=V.useState("remote"),[N,A]=V.useState(),[C,z]=V.useState(!1),[_,x]=V.useState("idle"),[T,O]=V.useState(),[D,R]=V.useState(()=>{try{return k3(sessionStorage.getItem("emviz:feedback-workspace:v1"))}catch{return _m()}}),{drafts:q,queue:P}=D,[G,X]=V.useState(),[W,B]=V.useState("details"),[K,j]=V.useState(),$=V.useCallback(le=>{R(me=>{const Ce=typeof le=="function"?le(me.queue):le;return Ce===me.queue?me:{...me,queue:Ce}})},[]);V.useEffect(()=>{if(D.recoveryWarning){X(D.recoveryWarning);return}try{sessionStorage.setItem("emviz:feedback-workspace:v1",j3(D)),X(void 0)}catch{X("Browser storage is unavailable. Your drafts and Queue are kept in this tab, but reloading the page may lose them.")}},[D]);const[L,Y]=V.useState(),[ee,k]=V.useState(),H=is(e,L)?.id,ne=is(e,ee)?.id,ae=V.useRef(null),[fe,de]=V.useState([]),[se,te]=V.useState([]),[ue,Ee]=V.useState(""),[Se,ge]=V.useState(),[ve,xe]=V.useState(),[ze,Ye]=V.useState(!1),{setCenter:St,fitView:rt}=vu(),[ht,Mt]=V.useState("current"),De=z3(!window.__EMVIZ_EXPORT__&&w==="remote"&&p!=="import",ht);V.useEffect(()=>{De.snapshot&&$(le=>M3(le,De.snapshot))},[De.snapshot,$]);const Lt=V.useRef(void 0),Ht=De.snapshot?JSON.stringify([De.snapshot.sessionId,De.snapshot.revision,ht,De.snapshot.feedback.request?.id,De.snapshot.feedback.status]):void 0,st={...De,connection:w!=="remote"||window.__EMVIZ_EXPORT__?"unavailable":De.connection==="live"&&Ht&&Lt.current?.key!==Ht?"checking":De.connection};V.useEffect(()=>{if(window.__EMVIZ_EXPORT__?.project){n(window.__EMVIZ_EXPORT__.project),l(window.__EMVIZ_EXPORT__.report),c(window.__EMVIZ_EXPORT__.diff),v("ready"),window.setTimeout(()=>{rt({padding:.18,duration:300})},50);return}if(w==="local"||De.connection!=="unavailable")return;let le=!1;return Promise.all([To("/api/model").then(me=>me.json()),To("/api/validation").then(me=>me.ok?me.json():void 0).catch(()=>{}),To("/api/diff").then(me=>me.ok?me.json():void 0).catch(()=>{})]).then(([me,Ce,Pe])=>{if(!le){if(!me||!Array.isArray(me.nodes)||!Array.isArray(me.edges))throw new Error("No project server is available.");n(me),l(Ce),c(Pe),v("ready"),window.setTimeout(()=>{rt({padding:.18,duration:300})},50)}}).catch(()=>{le||v("import")}),()=>{le=!0}},[rt,De.connection,w]),V.useEffect(()=>{const le=De.snapshot;if(!le||De.snapshotView!==ht)return;const me=Ht;if(Lt.current?.key===me)return;const Ce=!Lt.current;Lt.current&&Lt.current.sessionId!==le.sessionId&&(Y(void 0),k(void 0),g({actorIds:[],includeUnassigned:!1}),de([]),te([]),xe(void 0)),Lt.current={key:me,sessionId:le.sessionId},n(le.project),l(le.validation),c(le.diff),v("ready"),ge(void 0),Ce&&window.setTimeout(()=>{rt({padding:.18,duration:300})},50)},[rt,De.snapshot,De.snapshotView,Ht,ht]);const zt=V.useMemo(()=>e?qS(e,o?.previousNodes):[],[e,o?.previousNodes]),$t=!!(e?.nodes.some(le=>le.type==="screen"&&!le.actors?.length)||Object.values(o?.previousNodes??{}).some(le=>le.type==="screen"&&!le.actors?.length));V.useEffect(()=>{if(!e)return;const le=y.current!==e.root;y.current=e.root,g(me=>le?{actorIds:[],includeUnassigned:!1}:JO(e,me,o?.previousNodes))},[e,o?.previousNodes]),V.useEffect(()=>{e&&(L&&!is(e,L)&&Y(void 0),ee&&!is(e,ee)&&k(void 0),de(le=>le.filter(me=>is(e,me))),te(le=>le.filter(me=>is(e,me))))},[e,L,ee]);const qe=V.useMemo(()=>e?.nodes.find(le=>le.id===H),[e,H]),Nt=De.snapshot?.sessionId,fs=Nt&&qe?Gs(Nt,qe):void 0;V.useEffect(()=>j(void 0),[fs]);const Kn=(le,me)=>{!Nt||!qe||R(Ce=>({...Ce,drafts:m3(Ce.drafts,Nt,qe,le,me)}))},yl=V.useMemo(()=>s?.findings.filter(le=>le.nodeId===H)??[],[s,H]),wi=V.useMemo(()=>e?TM(e):new Map,[e]),Bn=V.useMemo(()=>{if(Se)return new Set([Se]);const le=CM(wi,ve);if(le)return le;if(!e||!H)return;const me=new Set;for(const Ce of e.edges)ew(Ce.kind)&&(Ce.source===H||Ce.target===H)&&me.add(Ce.id);return me},[wi,Se,e,ve,H]),at=V.useMemo(()=>e?h3(e,H,{focusedEdgeIds:Bn,edgeFieldFlows:wi,selectedFieldName:ve,onSelectField:xe,diffNodeStatus:o?.nodeStatus,diffEdgeStatus:o?.edgeStatus,diffFilter:u,actorFilter:d,previousNodes:o?.previousNodes}):{nodes:[],edges:[]},[d,o?.previousNodes,o?.edgeStatus,o?.nodeStatus,u,wi,Bn,e,ve,H]),Wt=V.useMemo(()=>{if(!e||ue.trim().length<2)return[];const le=ue.trim().toLowerCase();return e.nodes.filter(me=>`${me.label} ${me.type} ${me.sourcePath??""}`.toLowerCase().includes(le)).slice(0,8)},[e,ue]),Ge=V.useCallback((le,me=!0,Ce=!1)=>{const Pe=at.nodes.find(Dt=>Dt.id===le);ge(void 0),me&&H&&H!==le&&(L&&de(Dt=>[...Dt,L]),te([]));const qt=Pe?.data.projectNode.type==="gwt";if(qt&&!ae.current){const Dt=document.activeElement;ae.current=Dt?.closest(".search-results")?document.querySelector(".search-box input"):Dt instanceof HTMLElement?Dt:null}qt||(ae.current=null),k(void 0),e&&Y(qv(e,le)),Pe&&(!qt||Ce)&&St(Pe.position.x+80,Pe.position.y+60,{zoom:1.2,duration:350})},[at.nodes,e,L,H,St]),ds=V.useCallback(()=>{Y(void 0),ge(void 0),xe(void 0),k(void 0);const le=ae.current;ae.current=null,le&&requestAnimationFrame(()=>{le?.isConnected?le.focus({preventScroll:!0}):document.querySelector(".canvas")?.focus({preventScroll:!0})})},[]),hs=V.useCallback(le=>{ae.current||(ae.current=document.activeElement instanceof HTMLElement?document.activeElement:null),e&&k(qv(e,le))},[e]),vl=V.useMemo(()=>({open:Ge,list:hs}),[Ge,hs]),Ut=e?.nodes.find(le=>le.id===ne),xi=Ut?e?.nodes.filter(le=>le.type==="gwt"&&(Ut.sourcePath?le.sourcePath===Ut.sourcePath:le.sliceTitle===Ut.sliceTitle)).filter(le=>!o||u==="all"||o.nodeStatus[le.id]===u):void 0;V.useEffect(()=>{(ne||qe?.type==="gwt")&&((ne?document.querySelector(".gwt-all-list button[aria-current]"):null)??document.querySelector('.gwt-panel button:not([role="tab"])'))?.focus({preventScroll:!0})},[ne,qe?.id,qe?.type]);const Ei=V.useCallback(le=>{const me=e?.edges.find(Pe=>Pe.id===le);if(!me)return;ge(le);const Ce=at.nodes.filter(Pe=>Pe.id===me.source||Pe.id===me.target);Ce.length>0&&rt({nodes:Ce,padding:.36,duration:260,maxZoom:1.25})},[rt,at.nodes,e?.edges]),wn=V.useCallback(()=>{ge(void 0)},[]),Ni=V.useCallback(()=>{e&&(x("exporting"),O(void 0),z(!1),W3(e,s,o).then(le=>{ek(`${J3(e)}.emviz.html`,le)}).catch(le=>{O(le instanceof Error?le.message:String(le))}).finally(()=>x("idle")))},[o,e,s]);V.useEffect(()=>{const le=me=>{me.key==="Escape"&&(z(!1),ds())};return window.addEventListener("keydown",le),()=>window.removeEventListener("keydown",le)},[ds]);const Qn=V.useCallback(()=>{const le=fe.at(-1);if(!le)return;de(Ce=>Ce.slice(0,-1)),L&&te(Ce=>[...Ce,L]);const me=is(e,le);me&&Ge(me.id,!1)},[fe,Ge,e,L]),bl=V.useCallback(()=>{const le=se.at(-1);if(!le)return;te(Ce=>Ce.slice(0,-1)),L&&de(Ce=>[...Ce,L]);const me=is(e,le);me&&Ge(me.id,!1)},[Ge,se,e,L]),Zs=V.useCallback(le=>{tk(le).then(me=>{const Ce=FO(me),Pe=Ce;Pe.graphSidecar=nk(me)??{model:{id:"browser_import",name:"Browser Import"}},E("local"),n(Pe);const qt=I3(Ce),Dt=sk(Pe);l({errors:qt.errors,warnings:qt.warnings+Dt.filter(ms=>ms.severity==="warning").length,findings:[...qt.findings,...Dt]}),c(void 0),k(void 0),h("all"),g({actorIds:[],includeUnassigned:!1}),Y(void 0),ge(void 0),xe(void 0),de([]),te([]),v("ready"),A(void 0),window.setTimeout(()=>{rt({padding:.18,duration:300})},50)}).catch(me=>{A(me instanceof Error?me.message:String(me)),v("import")})},[rt]);return p==="import"?S.jsx(ak,{onImport:Zs,error:N}):e?S.jsxs("div",{className:`app-shell ${o?"diff-mode":""}`,children:[S.jsxs("header",{className:"toolbar",children:[S.jsxs("div",{className:"model-summary",children:[S.jsx("strong",{children:"emviz"}),S.jsxs("span",{children:[e.stories.length," stories"]}),S.jsxs("span",{children:[e.slices.length," slices"]}),S.jsxs("span",{children:[e.nodes.filter(le=>le.type==="event").length," events"]})]}),S.jsxs("div",{className:"segmented toolbar-history","aria-label":"Selection history",children:[S.jsx("button",{type:"button",disabled:fe.length===0,onClick:Qn,"aria-label":"Back",title:"Back",children:"←"}),S.jsx("button",{type:"button",disabled:se.length===0,onClick:bl,"aria-label":"Forward",title:"Forward",children:"→"})]}),S.jsxs("div",{className:"search-box",children:[S.jsx("input",{"aria-label":"Search event model",value:ue,onChange:le=>Ee(le.target.value),placeholder:"Search nodes by name or type..."}),Wt.length>0?S.jsx("div",{className:"search-results",children:Wt.map(le=>S.jsxs("button",{type:"button",onClick:()=>{Ge(le.id),Ee("")},children:[S.jsx("span",{children:le.label}),S.jsx("small",{children:le.type})]},le.id))}):null]}),S.jsxs("details",{className:"actor-filter",onKeyDown:le=>{le.key==="Escape"&&(le.preventDefault(),le.stopPropagation(),le.currentTarget.open=!1,le.currentTarget.querySelector("summary")?.focus())},children:[S.jsxs("summary",{children:["Actors · ",d.actorIds.length+Number(d.includeUnassigned)||"All"]}),S.jsxs("div",{className:"actor-filter-popover",children:[S.jsx("p",{children:"Match any selected actor. Related system steps stay visible."}),S.jsxs("div",{className:"actor-filter-options",role:"group","aria-label":"Filter by actor",children:[zt.map(le=>S.jsxs("label",{children:[S.jsx("input",{type:"checkbox","aria-label":le.name===le.id?le.name:le.name+" ("+le.id+")",checked:d.actorIds.includes(le.id),onChange:me=>{const Ce=me.target.checked;g(Pe=>({...Pe,actorIds:Ce?[...Pe.actorIds,le.id]:Pe.actorIds.filter(qt=>qt!==le.id)}))}}),S.jsx("i",{className:"actor-swatch","aria-hidden":"true",style:{backgroundColor:le.color}}),S.jsxs("span",{children:[le.name,le.name!==le.id?S.jsx("small",{children:le.id}):null]})]},le.id)),$t?S.jsxs("label",{children:[S.jsx("input",{type:"checkbox","aria-label":"Unassigned screens",checked:d.includeUnassigned,onChange:le=>{const me=le.target.checked;g(Ce=>({...Ce,includeUnassigned:me}))}}),S.jsx("span",{children:"Unassigned screens"})]}):null]}),S.jsx("button",{type:"button",disabled:d.actorIds.length===0&&!d.includeUnassigned,onClick:()=>g({actorIds:[],includeUnassigned:!1}),children:"Clear actors"})]})]}),S.jsxs("div",{className:"toolbar-menu",children:[S.jsx("button",{type:"button",className:"menu-trigger",onClick:()=>z(le=>!le),"aria-haspopup":"menu","aria-expanded":C,"aria-label":"Open menu",title:"Open menu",children:"..."}),C?S.jsx("div",{className:"menu-popover",role:"menu",children:S.jsx("button",{type:"button",role:"menuitem",onClick:Ni,disabled:_==="exporting",children:_==="exporting"?"Exporting...":"Export"})}):null]}),T?S.jsx("div",{className:"toolbar-error",role:"alert",children:T}):null]}),S.jsx(rk,{report:s,onSelect:Ge,open:ze,onOpen:()=>Ye(!0),onClose:()=>Ye(!1)}),o?S.jsx(P3,{diff:o,filter:u,onFilter:h,onSelect:Ge}):null,S.jsx(ok,{diff:o,tab:W,onTab:B,oldVersionId:K,onVersion:j,agentPanel:S.jsxs(S.Fragment,{children:[G?S.jsxs("div",{className:"feedback-storage-warning",children:[S.jsx("p",{className:"feedback-warning",role:"alert",children:G}),D.recoveryWarning?S.jsx("button",{type:"button",onClick:()=>R(le=>({...le,recoveryWarning:void 0})),children:"Replace damaged saved feedback"}):null]}):null,S.jsx(D3,{session:st,drafts:Object.values(q),view:ht,onView:le=>{Mt(le),h("all")},node:qe,diff:o,showingBefore:!!(Em(o,qe)&&K===qe?.id)||!!(qe&&o?.nodeStatus[qe.id]==="removed"),message:fs?q[fs]?.message??"":"",onMessageChange:Kn,onAdded:le=>Kn("",le),queue:P,onQueueChange:$,storageNeedsReview:!!D.recoveryWarning})]}),gwtList:xi,onGwtList:hs,onClose:ds,onFocusNode:le=>Ge(le,!0,!0),project:e,selectedNode:qe,findings:yl,selectedFieldName:ve,onSelect:Ge,onSelectField:xe,onClearField:()=>xe(void 0),onPreviewConnection:Ei,onClearPreview:wn},(Ut??qe)?.type==="gwt"?`gwt:${(Ut??qe)?.sourcePath??(Ut??qe)?.sliceTitle}`:"selection"),S.jsxs("main",{className:"canvas",tabIndex:-1,"aria-label":"Event model diagram",children:[(d.actorIds.length>0||d.includeUnassigned)&&!at.nodes.some(le=>!le.hidden&&le.data.projectNode.type!=="story"&&le.data.projectNode.type!=="slice")?S.jsx("div",{className:"actor-empty",role:"status",children:"No screens match the selected actors and current filters."}):null,S.jsx(JS.Provider,{value:vl,children:S.jsxs(QC,{nodes:at.nodes,edges:at.edges,nodeTypes:X3,edgeTypes:Z3,onNodeClick:(le,me)=>Ge(me.id),fitView:!0,minZoom:.2,maxZoom:1.8,nodesDraggable:!1,colorMode:"light",children:[S.jsx(tM,{gap:18,size:1}),S.jsx(rM,{})]})})]})]}):S.jsx("div",{className:"loading",children:S.jsx("div",{children:De.error?S.jsxs(S.Fragment,{children:[S.jsx("p",{role:"alert",children:De.error}),S.jsx("button",{type:"button",onClick:De.refresh,children:"Retry connection"})]}):"Loading event model..."})})}function uk(){return S.jsx(j1,{children:S.jsx(ck,{})})}mE.createRoot(document.getElementById("root")).render(S.jsx(ou.StrictMode,{children:S.jsx(uk,{})}));