emviz 0.8.1 → 0.8.2
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.
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function s(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(o){if(o.ep)return;o.ep=!0;const c=s(o);fetch(o.href,c)}})();function db(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jd={exports:{}},To={};var S0;function AE(){if(S0)return To;S0=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function s(a,o,c){var u=null;if(c!==void 0&&(u=""+c),o.key!==void 0&&(u=""+o.key),"key"in o){c={};for(var d in o)d!=="key"&&(c[d]=o[d])}else c=o;return o=c.ref,{$$typeof:e,type:a,key:u,ref:o!==void 0?o:null,props:c}}return To.Fragment=n,To.jsx=s,To.jsxs=s,To}var w0;function TE(){return w0||(w0=1,Jd.exports=AE()),Jd.exports}var b=TE(),Wd={exports:{}},_e={};var x0;function CE(){if(x0)return _e;x0=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function x(w){return w===null||typeof w!="object"?null:(w=v&&w[v]||w["@@iterator"],typeof w=="function"?w:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,T={};function C(w,z,F){this.props=w,this.context=z,this.refs=T,this.updater=F||E}C.prototype.isReactComponent={},C.prototype.setState=function(w,z){if(typeof w!="object"&&typeof w!="function"&&w!=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,w,z,"setState")},C.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function k(){}k.prototype=C.prototype;function _(w,z,F){this.props=w,this.context=z,this.refs=T,this.updater=F||E}var N=_.prototype=new k;N.constructor=_,A(N,C.prototype),N.isPureReactComponent=!0;var j=Array.isArray;function D(){}var B={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function U(w,z,F){var P=F.ref;return{$$typeof:e,type:w,key:z,ref:P!==void 0?P:null,props:F}}function q(w,z){return U(w.type,z,w.props)}function Y(w){return typeof w=="object"&&w!==null&&w.$$typeof===e}function Z(w){var z={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(F){return z[F]})}var le=/\/+/g;function L(w,z){return typeof w=="object"&&w!==null&&w.key!=null?Z(""+w.key):z.toString(36)}function K(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(D,D):(w.status="pending",w.then(function(z){w.status==="pending"&&(w.status="fulfilled",w.value=z)},function(z){w.status==="pending"&&(w.status="rejected",w.reason=z)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function O(w,z,F,P,fe){var de=typeof w;(de==="undefined"||de==="boolean")&&(w=null);var ie=!1;if(w===null)ie=!0;else switch(de){case"bigint":case"string":case"number":ie=!0;break;case"object":switch(w.$$typeof){case e:case n:ie=!0;break;case y:return ie=w._init,O(ie(w._payload),z,F,P,fe)}}if(ie)return fe=fe(w),ie=P===""?"."+L(w,0):P,j(fe)?(F="",ie!=null&&(F=ie.replace(le,"$&/")+"/"),O(fe,z,F,"",function(ve){return ve})):fe!=null&&(Y(fe)&&(fe=q(fe,F+(fe.key==null||w&&w.key===fe.key?"":(""+fe.key).replace(le,"$&/")+"/")+ie)),z.push(fe)),1;ie=0;var te=P===""?".":P+":";if(j(w))for(var oe=0;oe<w.length;oe++)P=w[oe],de=te+L(P,oe),ie+=O(P,z,F,de,fe);else if(oe=x(w),typeof oe=="function")for(w=oe.call(w),oe=0;!(P=w.next()).done;)P=P.value,de=te+L(P,oe++),ie+=O(P,z,F,de,fe);else if(de==="object"){if(typeof w.then=="function")return O(K(w),z,F,P,fe);throw z=String(w),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return ie}function H(w,z,F){if(w==null)return w;var P=[],fe=0;return O(w,P,"","",function(de){return z.call(F,de,fe++)}),P}function $(w){if(w._status===-1){var z=w._result;z=z(),z.then(function(F){(w._status===0||w._status===-1)&&(w._status=1,w._result=F)},function(F){(w._status===0||w._status===-1)&&(w._status=2,w._result=F)}),w._status===-1&&(w._status=0,w._result=z)}if(w._status===1)return w._result.default;throw w._result}var X=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},se={map:H,forEach:function(w,z,F){H(w,function(){z.apply(this,arguments)},F)},count:function(w){var z=0;return H(w,function(){z++}),z},toArray:function(w){return H(w,function(z){return z})||[]},only:function(w){if(!Y(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return _e.Activity=g,_e.Children=se,_e.Component=C,_e.Fragment=s,_e.Profiler=o,_e.PureComponent=_,_e.StrictMode=a,_e.Suspense=h,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,_e.__COMPILER_RUNTIME={__proto__:null,c:function(w){return B.H.useMemoCache(w)}},_e.cache=function(w){return function(){return w.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(w,z,F){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var P=A({},w.props),fe=w.key;if(z!=null)for(de in z.key!==void 0&&(fe=""+z.key),z)!R.call(z,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&z.ref===void 0||(P[de]=z[de]);var de=arguments.length-2;if(de===1)P.children=F;else if(1<de){for(var ie=Array(de),te=0;te<de;te++)ie[te]=arguments[te+2];P.children=ie}return U(w.type,fe,P)},_e.createContext=function(w){return w={$$typeof:u,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:c,_context:w},w},_e.createElement=function(w,z,F){var P,fe={},de=null;if(z!=null)for(P in z.key!==void 0&&(de=""+z.key),z)R.call(z,P)&&P!=="key"&&P!=="__self"&&P!=="__source"&&(fe[P]=z[P]);var ie=arguments.length-2;if(ie===1)fe.children=F;else if(1<ie){for(var te=Array(ie),oe=0;oe<ie;oe++)te[oe]=arguments[oe+2];fe.children=te}if(w&&w.defaultProps)for(P in ie=w.defaultProps,ie)fe[P]===void 0&&(fe[P]=ie[P]);return U(w,de,fe)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(w){return{$$typeof:d,render:w}},_e.isValidElement=Y,_e.lazy=function(w){return{$$typeof:y,_payload:{_status:-1,_result:w},_init:$}},_e.memo=function(w,z){return{$$typeof:p,type:w,compare:z===void 0?null:z}},_e.startTransition=function(w){var z=B.T,F={};B.T=F;try{var P=w(),fe=B.S;fe!==null&&fe(F,P),typeof P=="object"&&P!==null&&typeof P.then=="function"&&P.then(D,X)}catch(de){X(de)}finally{z!==null&&F.types!==null&&(z.types=F.types),B.T=z}},_e.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},_e.use=function(w){return B.H.use(w)},_e.useActionState=function(w,z,F){return B.H.useActionState(w,z,F)},_e.useCallback=function(w,z){return B.H.useCallback(w,z)},_e.useContext=function(w){return B.H.useContext(w)},_e.useDebugValue=function(){},_e.useDeferredValue=function(w,z){return B.H.useDeferredValue(w,z)},_e.useEffect=function(w,z){return B.H.useEffect(w,z)},_e.useEffectEvent=function(w){return B.H.useEffectEvent(w)},_e.useId=function(){return B.H.useId()},_e.useImperativeHandle=function(w,z,F){return B.H.useImperativeHandle(w,z,F)},_e.useInsertionEffect=function(w,z){return B.H.useInsertionEffect(w,z)},_e.useLayoutEffect=function(w,z){return B.H.useLayoutEffect(w,z)},_e.useMemo=function(w,z){return B.H.useMemo(w,z)},_e.useOptimistic=function(w,z){return B.H.useOptimistic(w,z)},_e.useReducer=function(w,z,F){return B.H.useReducer(w,z,F)},_e.useRef=function(w){return B.H.useRef(w)},_e.useState=function(w){return B.H.useState(w)},_e.useSyncExternalStore=function(w,z,F){return B.H.useSyncExternalStore(w,z,F)},_e.useTransition=function(){return B.H.useTransition()},_e.version="19.2.7",_e}var E0;function ar(){return E0||(E0=1,Wd.exports=CE()),Wd.exports}var V=ar();const Sl=db(V);var Pd={exports:{}},Co={},eh={exports:{}},th={};var N0;function ME(){return N0||(N0=1,(function(e){function n(O,H){var $=O.length;O.push(H);e:for(;0<$;){var X=$-1>>>1,se=O[X];if(0<o(se,H))O[X]=H,O[$]=se,$=X;else break e}}function s(O){return O.length===0?null:O[0]}function a(O){if(O.length===0)return null;var H=O[0],$=O.pop();if($!==H){O[0]=$;e:for(var X=0,se=O.length,w=se>>>1;X<w;){var z=2*(X+1)-1,F=O[z],P=z+1,fe=O[P];if(0>o(F,$))P<se&&0>o(fe,F)?(O[X]=fe,O[P]=$,X=P):(O[X]=F,O[z]=$,X=z);else if(P<se&&0>o(fe,$))O[X]=fe,O[P]=$,X=P;else break e}}return H}function o(O,H){var $=O.sortIndex-H.sortIndex;return $!==0?$:O.id-H.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,d=u.now();e.unstable_now=function(){return u.now()-d}}var h=[],p=[],y=1,g=null,v=3,x=!1,E=!1,A=!1,T=!1,C=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function N(O){for(var H=s(p);H!==null;){if(H.callback===null)a(p);else if(H.startTime<=O)a(p),H.sortIndex=H.expirationTime,n(h,H);else break;H=s(p)}}function j(O){if(A=!1,N(O),!E)if(s(h)!==null)E=!0,D||(D=!0,Z());else{var H=s(p);H!==null&&K(j,H.startTime-O)}}var D=!1,B=-1,R=5,U=-1;function q(){return T?!0:!(e.unstable_now()-U<R)}function Y(){if(T=!1,D){var O=e.unstable_now();U=O;var H=!0;try{e:{E=!1,A&&(A=!1,k(B),B=-1),x=!0;var $=v;try{t:{for(N(O),g=s(h);g!==null&&!(g.expirationTime>O&&q());){var X=g.callback;if(typeof X=="function"){g.callback=null,v=g.priorityLevel;var se=X(g.expirationTime<=O);if(O=e.unstable_now(),typeof se=="function"){g.callback=se,N(O),H=!0;break t}g===s(h)&&a(h),N(O)}else a(h);g=s(h)}if(g!==null)H=!0;else{var w=s(p);w!==null&&K(j,w.startTime-O),H=!1}}break e}finally{g=null,v=$,x=!1}H=void 0}}finally{H?Z():D=!1}}}var Z;if(typeof _=="function")Z=function(){_(Y)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,L=le.port2;le.port1.onmessage=Y,Z=function(){L.postMessage(null)}}else Z=function(){C(Y,0)};function K(O,H){B=C(function(){O(e.unstable_now())},H)}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(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(O){switch(v){case 1:case 2:case 3:var H=3;break;default:H=v}var $=v;v=H;try{return O()}finally{v=$}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(O,H){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var $=v;v=O;try{return H()}finally{v=$}},e.unstable_scheduleCallback=function(O,H,$){var X=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?X+$:X):$=X,O){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=$+se,O={id:y++,callback:H,priorityLevel:O,startTime:$,expirationTime:se,sortIndex:-1},$>X?(O.sortIndex=$,n(p,O),s(h)===null&&O===s(p)&&(A?(k(B),B=-1):A=!0,K(j,$-X))):(O.sortIndex=se,n(h,O),E||x||(E=!0,D||(D=!0,Z()))),O},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(O){var H=v;return function(){var $=v;v=H;try{return O.apply(this,arguments)}finally{v=$}}}})(th)),th}var _0;function OE(){return _0||(_0=1,eh.exports=ME()),eh.exports}var nh={exports:{}},Rt={};var A0;function kE(){if(A0)return Rt;A0=1;var e=ar();function n(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var a={d:{f:s,r:function(){throw Error(n(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(h,p,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:h,containerInfo:p,implementation:y}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Rt.createPortal=function(h,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return c(h,p,null,y)},Rt.flushSync=function(h){var p=u.T,y=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=p,a.p=y,a.d.f()}},Rt.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(h,p))},Rt.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},Rt.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var y=p.as,g=d(y,p.crossOrigin),v=typeof p.integrity=="string"?p.integrity:void 0,x=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?a.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:x}):y==="script"&&a.d.X(h,{crossOrigin:g,integrity:v,fetchPriority:x,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Rt.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=d(p.as,p.crossOrigin);a.d.M(h,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(h)},Rt.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,g=d(y,p.crossOrigin);a.d.L(h,y,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Rt.preloadModule=function(h,p){if(typeof h=="string")if(p){var y=d(p.as,p.crossOrigin);a.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(h)},Rt.requestFormReset=function(h){a.d.r(h)},Rt.unstable_batchedUpdates=function(h,p){return h(p)},Rt.useFormState=function(h,p,y){return u.H.useFormState(h,p,y)},Rt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Rt.version="19.2.7",Rt}var T0;function hb(){if(T0)return nh.exports;T0=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(),nh.exports=kE(),nh.exports}var C0;function zE(){if(C0)return Co;C0=1;var e=OE(),n=ar(),s=hb();function a(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+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,l=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(l=i.return),t=i.return;while(t)}return i.tag===3?l: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 d(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 h(t){if(c(t)!==t)throw Error(a(188))}function p(t){var i=t.alternate;if(!i){if(i=c(t),i===null)throw Error(a(188));return i!==t?null:t}for(var l=t,r=i;;){var f=l.return;if(f===null)break;var m=f.alternate;if(m===null){if(r=f.return,r!==null){l=r;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===l)return h(f),t;if(m===r)return h(f),i;m=m.sibling}throw Error(a(188))}if(l.return!==r.return)l=f,r=m;else{for(var S=!1,M=f.child;M;){if(M===l){S=!0,l=f,r=m;break}if(M===r){S=!0,r=f,l=m;break}M=M.sibling}if(!S){for(M=m.child;M;){if(M===l){S=!0,l=m,r=f;break}if(M===r){S=!0,r=m,l=f;break}M=M.sibling}if(!S)throw Error(a(189))}}if(l.alternate!==r)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?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 g=Object.assign,v=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),_=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function Z(t){return t===null||typeof t!="object"?null:(t=Y&&t[Y]||t["@@iterator"],typeof t=="function"?t:null)}var le=Symbol.for("react.client.reference");function L(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===le?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case A:return"Fragment";case C:return"Profiler";case T:return"StrictMode";case j:return"Suspense";case D:return"SuspenseList";case U:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case E:return"Portal";case _:return t.displayName||"Context";case k:return(t._context.displayName||"Context")+".Consumer";case N:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case B:return i=t.displayName||null,i!==null?i:L(t.type)||"Memo";case R:i=t._payload,t=t._init;try{return L(t(i))}catch{}}return null}var K=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},X=[],se=-1;function w(t){return{current:t}}function z(t){0>se||(t.current=X[se],X[se]=null,se--)}function F(t,i){se++,X[se]=t.current,t.current=i}var P=w(null),fe=w(null),de=w(null),ie=w(null);function te(t,i){switch(F(de,i),F(fe,t),F(P,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?Vy(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=Vy(i),t=Yy(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}z(P),F(P,t)}function oe(){z(P),z(fe),z(de)}function ve(t){t.memoizedState!==null&&F(ie,t);var i=P.current,l=Yy(i,t.type);i!==l&&(F(fe,t),F(P,l))}function Se(t){fe.current===t&&(z(P),z(fe)),ie.current===t&&(z(ie),Eo._currentValue=$)}var me,ge;function xe(t){if(me===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);me=i&&i[1]||"",ge=-1<l.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+me+t+ge}var Ce=!1;function Ue(t,i){if(!t||Ce)return"";Ce=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(i){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(ae){var ne=ae}Reflect.construct(t,[],ue)}else{try{ue.call()}catch(ae){ne=ae}t.call(ue.prototype)}}else{try{throw Error()}catch(ae){ne=ae}(ue=t())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(ae){if(ae&&ne&&typeof ae.stack=="string")return[ae.stack,ne.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(),S=m[0],M=m[1];if(S&&M){var I=S.split(`
|
|
4
|
-
`),ee=M.split(`
|
|
5
|
-
`);for(f=r=0;r<I.length&&!I[r].includes("DetermineComponentFrameRoot");)r++;for(;f<ee.length&&!ee[f].includes("DetermineComponentFrameRoot");)f++;if(r===I.length||f===ee.length)for(r=I.length-1,f=ee.length-1;1<=r&&0<=f&&I[r]!==ee[f];)f--;for(;1<=r&&0<=f;r--,f--)if(I[r]!==ee[f]){if(r!==1||f!==1)do if(r--,f--,0>f||I[r]!==ee[f]){var re=`
|
|
6
|
-
`+I[r].replace(" at new "," at ");return t.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",t.displayName)),re}while(1<=r&&0<=f);break}}}finally{Ce=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?xe(l):""}function Pe(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 Ue(t.type,!1);case 11:return Ue(t.type.render,!1);case 1:return Ue(t.type,!0);case 31:return xe("Activity");default:return""}}function zt(t){try{var i="",l=null;do i+=Pe(t,l),l=t,t=t.return;while(t);return i}catch(r){return`
|
|
7
|
-
Error generating stack: `+r.message+`
|
|
8
|
-
`+r.stack}}var ot=Object.prototype.hasOwnProperty,xt=e.unstable_scheduleCallback,Dt=e.unstable_cancelCallback,kn=e.unstable_shouldYield,_t=e.unstable_requestPaint,Ke=e.unstable_now,ut=e.unstable_getCurrentPriorityLevel,Ut=e.unstable_ImmediatePriority,Lt=e.unstable_UserBlockingPriority,jt=e.unstable_NormalPriority,hn=e.unstable_LowPriority,mn=e.unstable_IdlePriority,Ml=e.log,Fe=e.unstable_setDisableYieldValue,It=null,mt=null;function pn(t){if(typeof Ml=="function"&&Fe(t),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(It,t)}catch{}}var At=Math.clz32?Math.clz32:Ri,Ol=Math.log,pt=Math.LN2;function Ri(t){return t>>>=0,t===0?32:31-(Ol(t)/pt|0)|0}var Qn=256,ri=262144,Bi=4194304;function qt(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 ci(t,i,l){var r=t.pendingLanes;if(r===0)return 0;var f=0,m=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var M=r&134217727;return M!==0?(r=M&~m,r!==0?f=qt(r):(S&=M,S!==0?f=qt(S):l||(l=M&~t,l!==0&&(f=qt(l))))):(M=r&~m,M!==0?f=qt(M):S!==0?f=qt(S):l||(l=r&~t,l!==0&&(f=qt(l)))),f===0?0:i!==0&&i!==f&&(i&m)===0&&(m=f&-f,l=i&-i,m>=l||m===32&&(l&4194048)!==0)?i:f}function ft(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function ia(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 Tt(){var t=Bi;return Bi<<=1,(Bi&62914560)===0&&(Bi=4194304),t}function ui(t){for(var i=[],l=0;31>l;l++)i.push(t);return i}function zn(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function kl(t,i,l,r,f,m){var S=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var M=t.entanglements,I=t.expirationTimes,ee=t.hiddenUpdates;for(l=S&~l;0<l;){var re=31-At(l),ue=1<<re;M[re]=0,I[re]=-1;var ne=ee[re];if(ne!==null)for(ee[re]=null,re=0;re<ne.length;re++){var ae=ne[re];ae!==null&&(ae.lane&=-536870913)}l&=~ue}r!==0&&gn(t,r,0),m!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=m&~(S&~i))}function gn(t,i,l){t.pendingLanes|=i,t.suspendedLanes&=~i;var r=31-At(i);t.entangledLanes|=i,t.entanglements[r]=t.entanglements[r]|1073741824|l&261930}function sa(t,i){var l=t.entangledLanes|=i;for(t=t.entanglements;l;){var r=31-At(l),f=1<<r;f&i|t[r]&i&&(t[r]|=i),l&=~f}}function aa(t,i){var l=i&-i;return l=(l&42)!==0?1:ws(l),(l&(t.suspendedLanes|i))!==0?0:l}function ws(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 xs(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function la(){var t=H.p;return t!==0?t:(t=window.event,t===void 0?32:h0(t.type))}function oa(t,i){var l=H.p;try{return H.p=t,i()}finally{H.p=l}}var yn=Math.random().toString(36).slice(2),J="__reactFiber$"+yn,he="__reactProps$"+yn,Ne="__reactContainer$"+yn,Ie="__reactEvents$"+yn,tn="__reactListeners$"+yn,Fn="__reactHandles$"+yn,et="__reactResources$"+yn,vn="__reactMarker$"+yn;function zl(t){delete t[J],delete t[he],delete t[Ie],delete t[tn],delete t[Fn]}function Li(t){var i=t[J];if(i)return i;for(var l=t.parentNode;l;){if(i=l[Ne]||l[J]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(t=Jy(t);t!==null;){if(l=t[J])return l;t=Jy(t)}return i}t=l,l=t.parentNode}return null}function $i(t){if(t=t[J]||t[Ne]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function Hi(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(a(33))}function Ui(t){var i=t[et];return i||(i=t[et]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function gt(t){t[vn]=!0}var gr=new Set,yr={};function fi(t,i){Ii(t,i),Ii(t+"Capture",i)}function Ii(t,i){for(yr[t]=i,t=0;t<i.length;t++)gr.add(i[t])}var Vu=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]*$"),vr={},Dl={};function Yu(t){return ot.call(Dl,t)?!0:ot.call(vr,t)?!1:Vu.test(t)?Dl[t]=!0:(vr[t]=!0,!1)}function ra(t,i,l){if(Yu(i))if(l===null)t.removeAttribute(i);else{switch(typeof l){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,""+l)}}function ca(t,i,l){if(l===null)t.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+l)}}function Dn(t,i,l,r){if(r===null)t.removeAttribute(l);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(i,l,""+r)}}function Vt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function br(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Gu(t,i,l){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(S){l=""+S,m.call(this,S)}}),Object.defineProperty(t,i,{enumerable:r.enumerable}),{getValue:function(){return l},setValue:function(S){l=""+S},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function jl(t){if(!t._valueTracker){var i=br(t)?"checked":"value";t._valueTracker=Gu(t,i,""+t[i])}}function Rl(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var l=i.getValue(),r="";return t&&(r=br(t)?t.checked?"true":"false":t.value),t=r,t!==l?(i.setValue(t),!0):!1}function ua(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 Sr=/[\n"\\]/g;function Yt(t){return t.replace(Sr,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Bl(t,i,l,r,f,m,S,M){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),i!=null?S==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+Vt(i)):t.value!==""+Vt(i)&&(t.value=""+Vt(i)):S!=="submit"&&S!=="reset"||t.removeAttribute("value"),i!=null?Ll(t,S,Vt(i)):l!=null?Ll(t,S,Vt(l)):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=""+Vt(M):t.removeAttribute("name")}function fa(t,i,l,r,f,m,S,M){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),i!=null||l!=null){if(!(m!=="submit"&&m!=="reset"||i!=null)){jl(t);return}l=l!=null?""+Vt(l):"",i=i!=null?""+Vt(i):l,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,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S),jl(t)}function Ll(t,i,l){i==="number"&&ua(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function qi(t,i,l,r){if(t=t.options,i){i={};for(var f=0;f<l.length;f++)i["$"+l[f]]=!0;for(l=0;l<t.length;l++)f=i.hasOwnProperty("$"+t[l].value),t[l].selected!==f&&(t[l].selected=f),f&&r&&(t[l].defaultSelected=!0)}else{for(l=""+Vt(l),i=null,f=0;f<t.length;f++){if(t[f].value===l){t[f].selected=!0,r&&(t[f].defaultSelected=!0);return}i!==null||t[f].disabled||(i=t[f])}i!==null&&(i.selected=!0)}}function $l(t,i,l){if(i!=null&&(i=""+Vt(i),i!==t.value&&(t.value=i),l==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=l!=null?""+Vt(l):""}function Hm(t,i,l,r){if(i==null){if(r!=null){if(l!=null)throw Error(a(92));if(K(r)){if(1<r.length)throw Error(a(93));r=r[0]}l=r}l==null&&(l=""),i=l}l=Vt(i),t.defaultValue=l,r=t.textContent,r===l&&r!==""&&r!==null&&(t.value=r),jl(t)}function da(t,i){if(i){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=i;return}}t.textContent=i}var ww=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 Um(t,i,l){var r=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?r?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":r?t.setProperty(i,l):typeof l!="number"||l===0||ww.has(i)?i==="float"?t.cssFloat=l:t[i]=(""+l).trim():t[i]=l+"px"}function Im(t,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(t=t.style,l!=null){for(var r in l)!l.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)&&l[f]!==r&&Um(t,f,r)}else for(var m in i)i.hasOwnProperty(m)&&Um(t,m,i[m])}function Xu(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 xw=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"]]),Ew=/^[\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 wr(t){return Ew.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function di(){}var Ku=null;function Zu(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ha=null,ma=null;function qm(t){var i=$i(t);if(i&&(t=i.stateNode)){var l=t[he]||null;e:switch(t=i.stateNode,i.type){case"input":if(Bl(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Yt(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var r=l[i];if(r!==t&&r.form===t.form){var f=r[he]||null;if(!f)throw Error(a(90));Bl(r,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(i=0;i<l.length;i++)r=l[i],r.form===t.form&&Rl(r)}break e;case"textarea":$l(t,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&qi(t,!!l.multiple,i,!1)}}}var Qu=!1;function Vm(t,i,l){if(Qu)return t(i,l);Qu=!0;try{var r=t(i);return r}finally{if(Qu=!1,(ha!==null||ma!==null)&&(rc(),ha&&(i=ha,t=ma,ma=ha=null,qm(i),t)))for(i=0;i<t.length;i++)qm(t[i])}}function Hl(t,i){var l=t.stateNode;if(l===null)return null;var r=l[he]||null;if(r===null)return null;l=r[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(a(231,i,typeof l));return l}var hi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fu=!1;if(hi)try{var Ul={};Object.defineProperty(Ul,"passive",{get:function(){Fu=!0}}),window.addEventListener("test",Ul,Ul),window.removeEventListener("test",Ul,Ul)}catch{Fu=!1}var Vi=null,Ju=null,xr=null;function Ym(){if(xr)return xr;var t,i=Ju,l=i.length,r,f="value"in Vi?Vi.value:Vi.textContent,m=f.length;for(t=0;t<l&&i[t]===f[t];t++);var S=l-t;for(r=1;r<=S&&i[l-r]===f[m-r];r++);return xr=f.slice(t,1<r?1-r:void 0)}function Er(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 Nr(){return!0}function Gm(){return!1}function Gt(t){function i(l,r,f,m,S){this._reactName=l,this._targetInst=f,this.type=r,this.nativeEvent=m,this.target=S,this.currentTarget=null;for(var M in t)t.hasOwnProperty(M)&&(l=t[M],this[M]=l?l(m):m[M]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Nr:Gm,this.isPropagationStopped=Gm,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Nr)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Nr)},persist:function(){},isPersistent:Nr}),i}var Es={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_r=Gt(Es),Il=g({},Es,{view:0,detail:0}),Nw=Gt(Il),Wu,Pu,ql,Ar=g({},Il,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tf,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!==ql&&(ql&&t.type==="mousemove"?(Wu=t.screenX-ql.screenX,Pu=t.screenY-ql.screenY):Pu=Wu=0,ql=t),Wu)},movementY:function(t){return"movementY"in t?t.movementY:Pu}}),Xm=Gt(Ar),_w=g({},Ar,{dataTransfer:0}),Aw=Gt(_w),Tw=g({},Il,{relatedTarget:0}),ef=Gt(Tw),Cw=g({},Es,{animationName:0,elapsedTime:0,pseudoElement:0}),Mw=Gt(Cw),Ow=g({},Es,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),kw=Gt(Ow),zw=g({},Es,{data:0}),Km=Gt(zw),Dw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jw={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"},Rw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Bw(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=Rw[t])?!!i[t]:!1}function tf(){return Bw}var Lw=g({},Il,{key:function(t){if(t.key){var i=Dw[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=Er(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?jw[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tf,charCode:function(t){return t.type==="keypress"?Er(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Er(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),$w=Gt(Lw),Hw=g({},Ar,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zm=Gt(Hw),Uw=g({},Il,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tf}),Iw=Gt(Uw),qw=g({},Es,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vw=Gt(qw),Yw=g({},Ar,{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}),Gw=Gt(Yw),Xw=g({},Es,{newState:0,oldState:0}),Kw=Gt(Xw),Zw=[9,13,27,32],nf=hi&&"CompositionEvent"in window,Vl=null;hi&&"documentMode"in document&&(Vl=document.documentMode);var Qw=hi&&"TextEvent"in window&&!Vl,Qm=hi&&(!nf||Vl&&8<Vl&&11>=Vl),Fm=" ",Jm=!1;function Wm(t,i){switch(t){case"keyup":return Zw.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var pa=!1;function Fw(t,i){switch(t){case"compositionend":return Pm(i);case"keypress":return i.which!==32?null:(Jm=!0,Fm);case"textInput":return t=i.data,t===Fm&&Jm?null:t;default:return null}}function Jw(t,i){if(pa)return t==="compositionend"||!nf&&Wm(t,i)?(t=Ym(),xr=Ju=Vi=null,pa=!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 Qm&&i.locale!=="ko"?null:i.data;default:return null}}var Ww={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 ep(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!Ww[t.type]:i==="textarea"}function tp(t,i,l,r){ha?ma?ma.push(r):ma=[r]:ha=r,i=pc(i,"onChange"),0<i.length&&(l=new _r("onChange","change",null,l,r),t.push({event:l,listeners:i}))}var Yl=null,Gl=null;function Pw(t){Ly(t,0)}function Tr(t){var i=Hi(t);if(Rl(i))return t}function np(t,i){if(t==="change")return i}var ip=!1;if(hi){var sf;if(hi){var af="oninput"in document;if(!af){var sp=document.createElement("div");sp.setAttribute("oninput","return;"),af=typeof sp.oninput=="function"}sf=af}else sf=!1;ip=sf&&(!document.documentMode||9<document.documentMode)}function ap(){Yl&&(Yl.detachEvent("onpropertychange",lp),Gl=Yl=null)}function lp(t){if(t.propertyName==="value"&&Tr(Gl)){var i=[];tp(i,Gl,t,Zu(t)),Vm(Pw,i)}}function ex(t,i,l){t==="focusin"?(ap(),Yl=i,Gl=l,Yl.attachEvent("onpropertychange",lp)):t==="focusout"&&ap()}function tx(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Tr(Gl)}function nx(t,i){if(t==="click")return Tr(i)}function ix(t,i){if(t==="input"||t==="change")return Tr(i)}function sx(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var nn=typeof Object.is=="function"?Object.is:sx;function Xl(t,i){if(nn(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var l=Object.keys(t),r=Object.keys(i);if(l.length!==r.length)return!1;for(r=0;r<l.length;r++){var f=l[r];if(!ot.call(i,f)||!nn(t[f],i[f]))return!1}return!0}function op(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function rp(t,i){var l=op(t);t=0;for(var r;l;){if(l.nodeType===3){if(r=t+l.textContent.length,t<=i&&r>=i)return{node:l,offset:i-t};t=r}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=op(l)}}function cp(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?cp(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function up(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=ua(t.document);i instanceof t.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)t=i.contentWindow;else break;i=ua(t.document)}return i}function lf(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 ax=hi&&"documentMode"in document&&11>=document.documentMode,ga=null,of=null,Kl=null,rf=!1;function fp(t,i,l){var r=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;rf||ga==null||ga!==ua(r)||(r=ga,"selectionStart"in r&&lf(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}),Kl&&Xl(Kl,r)||(Kl=r,r=pc(of,"onSelect"),0<r.length&&(i=new _r("onSelect","select",null,i,l),t.push({event:i,listeners:r}),i.target=ga)))}function Ns(t,i){var l={};return l[t.toLowerCase()]=i.toLowerCase(),l["Webkit"+t]="webkit"+i,l["Moz"+t]="moz"+i,l}var ya={animationend:Ns("Animation","AnimationEnd"),animationiteration:Ns("Animation","AnimationIteration"),animationstart:Ns("Animation","AnimationStart"),transitionrun:Ns("Transition","TransitionRun"),transitionstart:Ns("Transition","TransitionStart"),transitioncancel:Ns("Transition","TransitionCancel"),transitionend:Ns("Transition","TransitionEnd")},cf={},dp={};hi&&(dp=document.createElement("div").style,"AnimationEvent"in window||(delete ya.animationend.animation,delete ya.animationiteration.animation,delete ya.animationstart.animation),"TransitionEvent"in window||delete ya.transitionend.transition);function _s(t){if(cf[t])return cf[t];if(!ya[t])return t;var i=ya[t],l;for(l in i)if(i.hasOwnProperty(l)&&l in dp)return cf[t]=i[l];return t}var hp=_s("animationend"),mp=_s("animationiteration"),pp=_s("animationstart"),lx=_s("transitionrun"),ox=_s("transitionstart"),rx=_s("transitioncancel"),gp=_s("transitionend"),yp=new Map,uf="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(" ");uf.push("scrollEnd");function jn(t,i){yp.set(t,i),fi(i,[t])}var Cr=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)},bn=[],va=0,ff=0;function Mr(){for(var t=va,i=ff=va=0;i<t;){var l=bn[i];bn[i++]=null;var r=bn[i];bn[i++]=null;var f=bn[i];bn[i++]=null;var m=bn[i];if(bn[i++]=null,r!==null&&f!==null){var S=r.pending;S===null?f.next=f:(f.next=S.next,S.next=f),r.pending=f}m!==0&&vp(l,f,m)}}function Or(t,i,l,r){bn[va++]=t,bn[va++]=i,bn[va++]=l,bn[va++]=r,ff|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function df(t,i,l,r){return Or(t,i,l,r),kr(t)}function As(t,i){return Or(t,null,null,i),kr(t)}function vp(t,i,l){t.lanes|=l;var r=t.alternate;r!==null&&(r.lanes|=l);for(var f=!1,m=t.return;m!==null;)m.childLanes|=l,r=m.alternate,r!==null&&(r.childLanes|=l),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-At(l),t=m.hiddenUpdates,r=t[f],r===null?t[f]=[i]:r.push(i),i.lane=l|536870912),m):null}function kr(t){if(50<go)throw go=0,wd=null,Error(a(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var ba={};function cx(t,i,l,r){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sn(t,i,l,r){return new cx(t,i,l,r)}function hf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function mi(t,i){var l=t.alternate;return l===null?(l=sn(t.tag,i,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=i,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,i=t.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function bp(t,i){t.flags&=65011714;var l=t.alternate;return l===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=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,i=l.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function zr(t,i,l,r,f,m){var S=0;if(r=t,typeof t=="function")hf(t)&&(S=1);else if(typeof t=="string")S=mE(t,l,P.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case U:return t=sn(31,l,i,f),t.elementType=U,t.lanes=m,t;case A:return Ts(l.children,f,m,i);case T:S=8,f|=24;break;case C:return t=sn(12,l,i,f|2),t.elementType=C,t.lanes=m,t;case j:return t=sn(13,l,i,f),t.elementType=j,t.lanes=m,t;case D:return t=sn(19,l,i,f),t.elementType=D,t.lanes=m,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case _:S=10;break e;case k:S=9;break e;case N:S=11;break e;case B:S=14;break e;case R:S=16,r=null;break e}S=29,l=Error(a(130,t===null?"null":typeof t,"")),r=null}return i=sn(S,l,i,f),i.elementType=t,i.type=r,i.lanes=m,i}function Ts(t,i,l,r){return t=sn(7,t,r,i),t.lanes=l,t}function mf(t,i,l){return t=sn(6,t,null,i),t.lanes=l,t}function Sp(t){var i=sn(18,null,null,0);return i.stateNode=t,i}function pf(t,i,l){return i=sn(4,t.children!==null?t.children:[],t.key,i),i.lanes=l,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var wp=new WeakMap;function Sn(t,i){if(typeof t=="object"&&t!==null){var l=wp.get(t);return l!==void 0?l:(i={value:t,source:i,stack:zt(i)},wp.set(t,i),i)}return{value:t,source:i,stack:zt(i)}}var Sa=[],wa=0,Dr=null,Zl=0,wn=[],xn=0,Yi=null,Jn=1,Wn="";function pi(t,i){Sa[wa++]=Zl,Sa[wa++]=Dr,Dr=t,Zl=i}function xp(t,i,l){wn[xn++]=Jn,wn[xn++]=Wn,wn[xn++]=Yi,Yi=t;var r=Jn;t=Wn;var f=32-At(r)-1;r&=~(1<<f),l+=1;var m=32-At(i)+f;if(30<m){var S=f-f%5;m=(r&(1<<S)-1).toString(32),r>>=S,f-=S,Jn=1<<32-At(i)+f|l<<f|r,Wn=m+t}else Jn=1<<m|l<<f|r,Wn=t}function gf(t){t.return!==null&&(pi(t,1),xp(t,1,0))}function yf(t){for(;t===Dr;)Dr=Sa[--wa],Sa[wa]=null,Zl=Sa[--wa],Sa[wa]=null;for(;t===Yi;)Yi=wn[--xn],wn[xn]=null,Wn=wn[--xn],wn[xn]=null,Jn=wn[--xn],wn[xn]=null}function Ep(t,i){wn[xn++]=Jn,wn[xn++]=Wn,wn[xn++]=Yi,Jn=i.id,Wn=i.overflow,Yi=t}var Ct=null,Je=null,je=!1,Gi=null,En=!1,vf=Error(a(519));function Xi(t){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ql(Sn(i,t)),vf}function Np(t){var i=t.stateNode,l=t.type,r=t.memoizedProps;switch(i[J]=t,i[he]=r,l){case"dialog":ke("cancel",i),ke("close",i);break;case"iframe":case"object":case"embed":ke("load",i);break;case"video":case"audio":for(l=0;l<vo.length;l++)ke(vo[l],i);break;case"source":ke("error",i);break;case"img":case"image":case"link":ke("error",i),ke("load",i);break;case"details":ke("toggle",i);break;case"input":ke("invalid",i),fa(i,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ke("invalid",i);break;case"textarea":ke("invalid",i),Hm(i,r.value,r.defaultValue,r.children)}l=r.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||r.suppressHydrationWarning===!0||Iy(i.textContent,l)?(r.popover!=null&&(ke("beforetoggle",i),ke("toggle",i)),r.onScroll!=null&&ke("scroll",i),r.onScrollEnd!=null&&ke("scrollend",i),r.onClick!=null&&(i.onclick=di),i=!0):i=!1,i||Xi(t,!0)}function _p(t){for(Ct=t.return;Ct;)switch(Ct.tag){case 5:case 31:case 13:En=!1;return;case 27:case 3:En=!0;return;default:Ct=Ct.return}}function xa(t){if(t!==Ct)return!1;if(!je)return _p(t),je=!0,!1;var i=t.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Bd(t.type,t.memoizedProps)),l=!l),l&&Je&&Xi(t),_p(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Je=Fy(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Je=Fy(t)}else i===27?(i=Je,ls(t.type)?(t=Id,Id=null,Je=t):Je=i):Je=Ct?_n(t.stateNode.nextSibling):null;return!0}function Cs(){Je=Ct=null,je=!1}function bf(){var t=Gi;return t!==null&&(Qt===null?Qt=t:Qt.push.apply(Qt,t),Gi=null),t}function Ql(t){Gi===null?Gi=[t]:Gi.push(t)}var Sf=w(null),Ms=null,gi=null;function Ki(t,i,l){F(Sf,i._currentValue),i._currentValue=l}function yi(t){t._currentValue=Sf.current,z(Sf)}function wf(t,i,l){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===l)break;t=t.return}}function xf(t,i,l,r){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var m=f.dependencies;if(m!==null){var S=f.child;m=m.firstContext;e:for(;m!==null;){var M=m;m=f;for(var I=0;I<i.length;I++)if(M.context===i[I]){m.lanes|=l,M=m.alternate,M!==null&&(M.lanes|=l),wf(m.return,l,t),r||(S=null);break e}m=M.next}}else if(f.tag===18){if(S=f.return,S===null)throw Error(a(341));S.lanes|=l,m=S.alternate,m!==null&&(m.lanes|=l),wf(S,l,t),S=null}else S=f.child;if(S!==null)S.return=f;else for(S=f;S!==null;){if(S===t){S=null;break}if(f=S.sibling,f!==null){f.return=S.return,S=f;break}S=S.return}f=S}}function Ea(t,i,l,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 S=f.alternate;if(S===null)throw Error(a(387));if(S=S.memoizedProps,S!==null){var M=f.type;nn(f.pendingProps.value,S.value)||(t!==null?t.push(M):t=[M])}}else if(f===ie.current){if(S=f.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(Eo):t=[Eo])}f=f.return}t!==null&&xf(i,t,l,r),i.flags|=262144}function jr(t){for(t=t.firstContext;t!==null;){if(!nn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Os(t){Ms=t,gi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Mt(t){return Ap(Ms,t)}function Rr(t,i){return Ms===null&&Os(t),Ap(t,i)}function Ap(t,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},gi===null){if(t===null)throw Error(a(308));gi=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else gi=gi.next=i;return l}var ux=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(l,r){t.push(r)}};this.abort=function(){i.aborted=!0,t.forEach(function(l){return l()})}},fx=e.unstable_scheduleCallback,dx=e.unstable_NormalPriority,yt={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ef(){return{controller:new ux,data:new Map,refCount:0}}function Fl(t){t.refCount--,t.refCount===0&&fx(dx,function(){t.controller.abort()})}var Jl=null,Nf=0,Na=0,_a=null;function hx(t,i){if(Jl===null){var l=Jl=[];Nf=0,Na=Td(),_a={status:"pending",value:void 0,then:function(r){l.push(r)}}}return Nf++,i.then(Tp,Tp),i}function Tp(){if(--Nf===0&&Jl!==null){_a!==null&&(_a.status="fulfilled");var t=Jl;Jl=null,Na=0,_a=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function mx(t,i){var l=[],r={status:"pending",value:null,reason:null,then:function(f){l.push(f)}};return t.then(function(){r.status="fulfilled",r.value=i;for(var f=0;f<l.length;f++)(0,l[f])(i)},function(f){for(r.status="rejected",r.reason=f,f=0;f<l.length;f++)(0,l[f])(void 0)}),r}var Cp=O.S;O.S=function(t,i){fy=Ke(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&hx(t,i),Cp!==null&&Cp(t,i)};var ks=w(null);function _f(){var t=ks.current;return t!==null?t:Ze.pooledCache}function Br(t,i){i===null?F(ks,ks.current):F(ks,i.pool)}function Mp(){var t=_f();return t===null?null:{parent:yt._currentValue,pool:t}}var Aa=Error(a(460)),Af=Error(a(474)),Lr=Error(a(542)),$r={then:function(){}};function Op(t){return t=t.status,t==="fulfilled"||t==="rejected"}function kp(t,i,l){switch(l=t[l],l===void 0?t.push(i):l!==i&&(i.then(di,di),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,Dp(t),t;default:if(typeof i.status=="string")i.then(di,di);else{if(t=Ze,t!==null&&100<t.shellSuspendCounter)throw Error(a(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,Dp(t),t}throw Ds=i,Aa}}function zs(t){try{var i=t._init;return i(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Ds=l,Aa):l}}var Ds=null;function zp(){if(Ds===null)throw Error(a(459));var t=Ds;return Ds=null,t}function Dp(t){if(t===Aa||t===Lr)throw Error(a(483))}var Ta=null,Wl=0;function Hr(t){var i=Wl;return Wl+=1,Ta===null&&(Ta=[]),kp(Ta,t,i)}function Pl(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function Ur(t,i){throw i.$$typeof===v?Error(a(525)):(t=Object.prototype.toString.call(i),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function jp(t){function i(Q,G){if(t){var W=Q.deletions;W===null?(Q.deletions=[G],Q.flags|=16):W.push(G)}}function l(Q,G){if(!t)return null;for(;G!==null;)i(Q,G),G=G.sibling;return null}function r(Q){for(var G=new Map;Q!==null;)Q.key!==null?G.set(Q.key,Q):G.set(Q.index,Q),Q=Q.sibling;return G}function f(Q,G){return Q=mi(Q,G),Q.index=0,Q.sibling=null,Q}function m(Q,G,W){return Q.index=W,t?(W=Q.alternate,W!==null?(W=W.index,W<G?(Q.flags|=67108866,G):W):(Q.flags|=67108866,G)):(Q.flags|=1048576,G)}function S(Q){return t&&Q.alternate===null&&(Q.flags|=67108866),Q}function M(Q,G,W,ce){return G===null||G.tag!==6?(G=mf(W,Q.mode,ce),G.return=Q,G):(G=f(G,W),G.return=Q,G)}function I(Q,G,W,ce){var we=W.type;return we===A?re(Q,G,W.props.children,ce,W.key):G!==null&&(G.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===R&&zs(we)===G.type)?(G=f(G,W.props),Pl(G,W),G.return=Q,G):(G=zr(W.type,W.key,W.props,null,Q.mode,ce),Pl(G,W),G.return=Q,G)}function ee(Q,G,W,ce){return G===null||G.tag!==4||G.stateNode.containerInfo!==W.containerInfo||G.stateNode.implementation!==W.implementation?(G=pf(W,Q.mode,ce),G.return=Q,G):(G=f(G,W.children||[]),G.return=Q,G)}function re(Q,G,W,ce,we){return G===null||G.tag!==7?(G=Ts(W,Q.mode,ce,we),G.return=Q,G):(G=f(G,W),G.return=Q,G)}function ue(Q,G,W){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=mf(""+G,Q.mode,W),G.return=Q,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case x:return W=zr(G.type,G.key,G.props,null,Q.mode,W),Pl(W,G),W.return=Q,W;case E:return G=pf(G,Q.mode,W),G.return=Q,G;case R:return G=zs(G),ue(Q,G,W)}if(K(G)||Z(G))return G=Ts(G,Q.mode,W,null),G.return=Q,G;if(typeof G.then=="function")return ue(Q,Hr(G),W);if(G.$$typeof===_)return ue(Q,Rr(Q,G),W);Ur(Q,G)}return null}function ne(Q,G,W,ce){var we=G!==null?G.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return we!==null?null:M(Q,G,""+W,ce);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case x:return W.key===we?I(Q,G,W,ce):null;case E:return W.key===we?ee(Q,G,W,ce):null;case R:return W=zs(W),ne(Q,G,W,ce)}if(K(W)||Z(W))return we!==null?null:re(Q,G,W,ce,null);if(typeof W.then=="function")return ne(Q,G,Hr(W),ce);if(W.$$typeof===_)return ne(Q,G,Rr(Q,W),ce);Ur(Q,W)}return null}function ae(Q,G,W,ce,we){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Q=Q.get(W)||null,M(G,Q,""+ce,we);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:return Q=Q.get(ce.key===null?W:ce.key)||null,I(G,Q,ce,we);case E:return Q=Q.get(ce.key===null?W:ce.key)||null,ee(G,Q,ce,we);case R:return ce=zs(ce),ae(Q,G,W,ce,we)}if(K(ce)||Z(ce))return Q=Q.get(W)||null,re(G,Q,ce,we,null);if(typeof ce.then=="function")return ae(Q,G,W,Hr(ce),we);if(ce.$$typeof===_)return ae(Q,G,W,Rr(G,ce),we);Ur(G,ce)}return null}function ye(Q,G,W,ce){for(var we=null,Be=null,be=G,Me=G=0,De=null;be!==null&&Me<W.length;Me++){be.index>Me?(De=be,be=null):De=be.sibling;var Le=ne(Q,be,W[Me],ce);if(Le===null){be===null&&(be=De);break}t&&be&&Le.alternate===null&&i(Q,be),G=m(Le,G,Me),Be===null?we=Le:Be.sibling=Le,Be=Le,be=De}if(Me===W.length)return l(Q,be),je&&pi(Q,Me),we;if(be===null){for(;Me<W.length;Me++)be=ue(Q,W[Me],ce),be!==null&&(G=m(be,G,Me),Be===null?we=be:Be.sibling=be,Be=be);return je&&pi(Q,Me),we}for(be=r(be);Me<W.length;Me++)De=ae(be,Q,Me,W[Me],ce),De!==null&&(t&&De.alternate!==null&&be.delete(De.key===null?Me:De.key),G=m(De,G,Me),Be===null?we=De:Be.sibling=De,Be=De);return t&&be.forEach(function(fs){return i(Q,fs)}),je&&pi(Q,Me),we}function Ee(Q,G,W,ce){if(W==null)throw Error(a(151));for(var we=null,Be=null,be=G,Me=G=0,De=null,Le=W.next();be!==null&&!Le.done;Me++,Le=W.next()){be.index>Me?(De=be,be=null):De=be.sibling;var fs=ne(Q,be,Le.value,ce);if(fs===null){be===null&&(be=De);break}t&&be&&fs.alternate===null&&i(Q,be),G=m(fs,G,Me),Be===null?we=fs:Be.sibling=fs,Be=fs,be=De}if(Le.done)return l(Q,be),je&&pi(Q,Me),we;if(be===null){for(;!Le.done;Me++,Le=W.next())Le=ue(Q,Le.value,ce),Le!==null&&(G=m(Le,G,Me),Be===null?we=Le:Be.sibling=Le,Be=Le);return je&&pi(Q,Me),we}for(be=r(be);!Le.done;Me++,Le=W.next())Le=ae(be,Q,Me,Le.value,ce),Le!==null&&(t&&Le.alternate!==null&&be.delete(Le.key===null?Me:Le.key),G=m(Le,G,Me),Be===null?we=Le:Be.sibling=Le,Be=Le);return t&&be.forEach(function(_E){return i(Q,_E)}),je&&pi(Q,Me),we}function Xe(Q,G,W,ce){if(typeof W=="object"&&W!==null&&W.type===A&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case x:e:{for(var we=W.key;G!==null;){if(G.key===we){if(we=W.type,we===A){if(G.tag===7){l(Q,G.sibling),ce=f(G,W.props.children),ce.return=Q,Q=ce;break e}}else if(G.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===R&&zs(we)===G.type){l(Q,G.sibling),ce=f(G,W.props),Pl(ce,W),ce.return=Q,Q=ce;break e}l(Q,G);break}else i(Q,G);G=G.sibling}W.type===A?(ce=Ts(W.props.children,Q.mode,ce,W.key),ce.return=Q,Q=ce):(ce=zr(W.type,W.key,W.props,null,Q.mode,ce),Pl(ce,W),ce.return=Q,Q=ce)}return S(Q);case E:e:{for(we=W.key;G!==null;){if(G.key===we)if(G.tag===4&&G.stateNode.containerInfo===W.containerInfo&&G.stateNode.implementation===W.implementation){l(Q,G.sibling),ce=f(G,W.children||[]),ce.return=Q,Q=ce;break e}else{l(Q,G);break}else i(Q,G);G=G.sibling}ce=pf(W,Q.mode,ce),ce.return=Q,Q=ce}return S(Q);case R:return W=zs(W),Xe(Q,G,W,ce)}if(K(W))return ye(Q,G,W,ce);if(Z(W)){if(we=Z(W),typeof we!="function")throw Error(a(150));return W=we.call(W),Ee(Q,G,W,ce)}if(typeof W.then=="function")return Xe(Q,G,Hr(W),ce);if(W.$$typeof===_)return Xe(Q,G,Rr(Q,W),ce);Ur(Q,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,G!==null&&G.tag===6?(l(Q,G.sibling),ce=f(G,W),ce.return=Q,Q=ce):(l(Q,G),ce=mf(W,Q.mode,ce),ce.return=Q,Q=ce),S(Q)):l(Q,G)}return function(Q,G,W,ce){try{Wl=0;var we=Xe(Q,G,W,ce);return Ta=null,we}catch(be){if(be===Aa||be===Lr)throw be;var Be=sn(29,be,null,Q.mode);return Be.lanes=ce,Be.return=Q,Be}}}var js=jp(!0),Rp=jp(!1),Zi=!1;function Tf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cf(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 Qi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Fi(t,i,l){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=kr(t),vp(t,null,l),i}return Or(t,r,i,l),kr(t)}function eo(t,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var r=i.lanes;r&=t.pendingLanes,l|=r,i.lanes=l,sa(t,l)}}function Mf(t,i){var l=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,l===r)){var f=null,m=null;if(l=l.firstBaseUpdate,l!==null){do{var S={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};m===null?f=m=S:m=m.next=S,l=l.next}while(l!==null);m===null?f=m=i:m=m.next=i}else f=m=i;l={baseState:r.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:r.shared,callbacks:r.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=i:t.next=i,l.lastBaseUpdate=i}var Of=!1;function to(){if(Of){var t=_a;if(t!==null)throw t}}function no(t,i,l,r){Of=!1;var f=t.updateQueue;Zi=!1;var m=f.firstBaseUpdate,S=f.lastBaseUpdate,M=f.shared.pending;if(M!==null){f.shared.pending=null;var I=M,ee=I.next;I.next=null,S===null?m=ee:S.next=ee,S=I;var re=t.alternate;re!==null&&(re=re.updateQueue,M=re.lastBaseUpdate,M!==S&&(M===null?re.firstBaseUpdate=ee:M.next=ee,re.lastBaseUpdate=I))}if(m!==null){var ue=f.baseState;S=0,re=ee=I=null,M=m;do{var ne=M.lane&-536870913,ae=ne!==M.lane;if(ae?(ze&ne)===ne:(r&ne)===ne){ne!==0&&ne===Na&&(Of=!0),re!==null&&(re=re.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var ye=t,Ee=M;ne=i;var Xe=l;switch(Ee.tag){case 1:if(ye=Ee.payload,typeof ye=="function"){ue=ye.call(Xe,ue,ne);break e}ue=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Ee.payload,ne=typeof ye=="function"?ye.call(Xe,ue,ne):ye,ne==null)break e;ue=g({},ue,ne);break e;case 2:Zi=!0}}ne=M.callback,ne!==null&&(t.flags|=64,ae&&(t.flags|=8192),ae=f.callbacks,ae===null?f.callbacks=[ne]:ae.push(ne))}else ae={lane:ne,tag:M.tag,payload:M.payload,callback:M.callback,next:null},re===null?(ee=re=ae,I=ue):re=re.next=ae,S|=ne;if(M=M.next,M===null){if(M=f.shared.pending,M===null)break;ae=M,M=ae.next,ae.next=null,f.lastBaseUpdate=ae,f.shared.pending=null}}while(!0);re===null&&(I=ue),f.baseState=I,f.firstBaseUpdate=ee,f.lastBaseUpdate=re,m===null&&(f.shared.lanes=0),ts|=S,t.lanes=S,t.memoizedState=ue}}function Bp(t,i){if(typeof t!="function")throw Error(a(191,t));t.call(i)}function Lp(t,i){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Bp(l[t],i)}var Ca=w(null),Ir=w(0);function $p(t,i){t=Ai,F(Ir,t),F(Ca,i),Ai=t|i.baseLanes}function kf(){F(Ir,Ai),F(Ca,Ca.current)}function zf(){Ai=Ir.current,z(Ca),z(Ir)}var an=w(null),Nn=null;function Ji(t){var i=t.alternate;F(dt,dt.current&1),F(an,t),Nn===null&&(i===null||Ca.current!==null||i.memoizedState!==null)&&(Nn=t)}function Df(t){F(dt,dt.current),F(an,t),Nn===null&&(Nn=t)}function Hp(t){t.tag===22?(F(dt,dt.current),F(an,t),Nn===null&&(Nn=t)):Wi()}function Wi(){F(dt,dt.current),F(an,an.current)}function ln(t){z(an),Nn===t&&(Nn=null),z(dt)}var dt=w(0);function qr(t){for(var i=t;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Hd(l)||Ud(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===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 vi=0,Te=null,Ye=null,vt=null,Vr=!1,Ma=!1,Rs=!1,Yr=0,io=0,Oa=null,px=0;function rt(){throw Error(a(321))}function jf(t,i){if(i===null)return!1;for(var l=0;l<i.length&&l<t.length;l++)if(!nn(t[l],i[l]))return!1;return!0}function Rf(t,i,l,r,f,m){return vi=m,Te=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,O.H=t===null||t.memoizedState===null?xg:Ff,Rs=!1,m=l(r,f),Rs=!1,Ma&&(m=Ip(i,l,r,f)),Up(t),m}function Up(t){O.H=lo;var i=Ye!==null&&Ye.next!==null;if(vi=0,vt=Ye=Te=null,Vr=!1,io=0,Oa=null,i)throw Error(a(300));t===null||bt||(t=t.dependencies,t!==null&&jr(t)&&(bt=!0))}function Ip(t,i,l,r){Te=t;var f=0;do{if(Ma&&(Oa=null),io=0,Ma=!1,25<=f)throw Error(a(301));if(f+=1,vt=Ye=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}O.H=Eg,m=i(l,r)}while(Ma);return m}function gx(){var t=O.H,i=t.useState()[0];return i=typeof i.then=="function"?so(i):i,t=t.useState()[0],(Ye!==null?Ye.memoizedState:null)!==t&&(Te.flags|=1024),i}function Bf(){var t=Yr!==0;return Yr=0,t}function Lf(t,i,l){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~l}function $f(t){if(Vr){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}Vr=!1}vi=0,vt=Ye=Te=null,Ma=!1,io=Yr=0,Oa=null}function $t(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?Te.memoizedState=vt=t:vt=vt.next=t,vt}function ht(){if(Ye===null){var t=Te.alternate;t=t!==null?t.memoizedState:null}else t=Ye.next;var i=vt===null?Te.memoizedState:vt.next;if(i!==null)vt=i,Ye=t;else{if(t===null)throw Te.alternate===null?Error(a(467)):Error(a(310));Ye=t,t={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},vt===null?Te.memoizedState=vt=t:vt=vt.next=t}return vt}function Gr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function so(t){var i=io;return io+=1,Oa===null&&(Oa=[]),t=kp(Oa,t,i),i=Te,(vt===null?i.memoizedState:vt.next)===null&&(i=i.alternate,O.H=i===null||i.memoizedState===null?xg:Ff),t}function Xr(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return so(t);if(t.$$typeof===_)return Mt(t)}throw Error(a(438,String(t)))}function Hf(t){var i=null,l=Te.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var r=Te.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(i={data:r.data.map(function(f){return f.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=Gr(),Te.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(t),r=0;r<t;r++)l[r]=q;return i.index++,l}function bi(t,i){return typeof i=="function"?i(t):i}function Kr(t){var i=ht();return Uf(i,Ye,t)}function Uf(t,i,l){var r=t.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=l;var f=t.baseQueue,m=r.pending;if(m!==null){if(f!==null){var S=f.next;f.next=m.next,m.next=S}i.baseQueue=f=m,r.pending=null}if(m=t.baseState,f===null)t.memoizedState=m;else{i=f.next;var M=S=null,I=null,ee=i,re=!1;do{var ue=ee.lane&-536870913;if(ue!==ee.lane?(ze&ue)===ue:(vi&ue)===ue){var ne=ee.revertLane;if(ne===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),ue===Na&&(re=!0);else if((vi&ne)===ne){ee=ee.next,ne===Na&&(re=!0);continue}else ue={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},I===null?(M=I=ue,S=m):I=I.next=ue,Te.lanes|=ne,ts|=ne;ue=ee.action,Rs&&l(m,ue),m=ee.hasEagerState?ee.eagerState:l(m,ue)}else ne={lane:ue,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},I===null?(M=I=ne,S=m):I=I.next=ne,Te.lanes|=ue,ts|=ue;ee=ee.next}while(ee!==null&&ee!==i);if(I===null?S=m:I.next=M,!nn(m,t.memoizedState)&&(bt=!0,re&&(l=_a,l!==null)))throw l;t.memoizedState=m,t.baseState=S,t.baseQueue=I,r.lastRenderedState=m}return f===null&&(r.lanes=0),[t.memoizedState,r.dispatch]}function If(t){var i=ht(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=t;var r=l.dispatch,f=l.pending,m=i.memoizedState;if(f!==null){l.pending=null;var S=f=f.next;do m=t(m,S.action),S=S.next;while(S!==f);nn(m,i.memoizedState)||(bt=!0),i.memoizedState=m,i.baseQueue===null&&(i.baseState=m),l.lastRenderedState=m}return[m,r]}function qp(t,i,l){var r=Te,f=ht(),m=je;if(m){if(l===void 0)throw Error(a(407));l=l()}else l=i();var S=!nn((Ye||f).memoizedState,l);if(S&&(f.memoizedState=l,bt=!0),f=f.queue,Yf(Gp.bind(null,r,f,t),[t]),f.getSnapshot!==i||S||vt!==null&&vt.memoizedState.tag&1){if(r.flags|=2048,ka(9,{destroy:void 0},Yp.bind(null,r,f,l,i),null),Ze===null)throw Error(a(349));m||(vi&127)!==0||Vp(r,i,l)}return l}function Vp(t,i,l){t.flags|=16384,t={getSnapshot:i,value:l},i=Te.updateQueue,i===null?(i=Gr(),Te.updateQueue=i,i.stores=[t]):(l=i.stores,l===null?i.stores=[t]:l.push(t))}function Yp(t,i,l,r){i.value=l,i.getSnapshot=r,Xp(i)&&Kp(t)}function Gp(t,i,l){return l(function(){Xp(i)&&Kp(t)})}function Xp(t){var i=t.getSnapshot;t=t.value;try{var l=i();return!nn(t,l)}catch{return!0}}function Kp(t){var i=As(t,2);i!==null&&Ft(i,t,2)}function qf(t){var i=$t();if(typeof t=="function"){var l=t;if(t=l(),Rs){pn(!0);try{l()}finally{pn(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bi,lastRenderedState:t},i}function Zp(t,i,l,r){return t.baseState=l,Uf(t,Ye,typeof r=="function"?r:bi)}function yx(t,i,l,r,f){if(Fr(t))throw Error(a(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(S){m.listeners.push(S)}};O.T!==null?l(!0):m.isTransition=!1,r(m),l=i.pending,l===null?(m.next=i.pending=m,Qp(i,m)):(m.next=l.next,i.pending=l.next=m)}}function Qp(t,i){var l=i.action,r=i.payload,f=t.state;if(i.isTransition){var m=O.T,S={};O.T=S;try{var M=l(f,r),I=O.S;I!==null&&I(S,M),Fp(t,i,M)}catch(ee){Vf(t,i,ee)}finally{m!==null&&S.types!==null&&(m.types=S.types),O.T=m}}else try{m=l(f,r),Fp(t,i,m)}catch(ee){Vf(t,i,ee)}}function Fp(t,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(r){Jp(t,i,r)},function(r){return Vf(t,i,r)}):Jp(t,i,l)}function Jp(t,i,l){i.status="fulfilled",i.value=l,Wp(i),t.state=l,i=t.pending,i!==null&&(l=i.next,l===i?t.pending=null:(l=l.next,i.next=l,Qp(t,l)))}function Vf(t,i,l){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do i.status="rejected",i.reason=l,Wp(i),i=i.next;while(i!==r)}t.action=null}function Wp(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function Pp(t,i){return i}function eg(t,i){if(je){var l=Ze.formState;if(l!==null){e:{var r=Te;if(je){if(Je){t:{for(var f=Je,m=En;f.nodeType!==8;){if(!m){f=null;break t}if(f=_n(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){Je=_n(f.nextSibling),r=f.data==="F!";break e}}Xi(r)}r=!1}r&&(i=l[0])}}return l=$t(),l.memoizedState=l.baseState=i,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pp,lastRenderedState:i},l.queue=r,l=bg.bind(null,Te,r),r.dispatch=l,r=qf(!1),m=Qf.bind(null,Te,!1,r.queue),r=$t(),f={state:i,dispatch:null,action:t,pending:null},r.queue=f,l=yx.bind(null,Te,f,m,l),f.dispatch=l,r.memoizedState=t,[i,l,!1]}function tg(t){var i=ht();return ng(i,Ye,t)}function ng(t,i,l){if(i=Uf(t,i,Pp)[0],t=Kr(bi)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var r=so(i)}catch(S){throw S===Aa?Lr:S}else r=i;i=ht();var f=i.queue,m=f.dispatch;return l!==i.memoizedState&&(Te.flags|=2048,ka(9,{destroy:void 0},vx.bind(null,f,l),null)),[r,m,t]}function vx(t,i){t.action=i}function ig(t){var i=ht(),l=Ye;if(l!==null)return ng(i,l,t);ht(),i=i.memoizedState,l=ht();var r=l.queue.dispatch;return l.memoizedState=t,[i,r,!1]}function ka(t,i,l,r){return t={tag:t,create:l,deps:r,inst:i,next:null},i=Te.updateQueue,i===null&&(i=Gr(),Te.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=t.next=t:(r=l.next,l.next=t,t.next=r,i.lastEffect=t),t}function sg(){return ht().memoizedState}function Zr(t,i,l,r){var f=$t();Te.flags|=t,f.memoizedState=ka(1|i,{destroy:void 0},l,r===void 0?null:r)}function Qr(t,i,l,r){var f=ht();r=r===void 0?null:r;var m=f.memoizedState.inst;Ye!==null&&r!==null&&jf(r,Ye.memoizedState.deps)?f.memoizedState=ka(i,m,l,r):(Te.flags|=t,f.memoizedState=ka(1|i,m,l,r))}function ag(t,i){Zr(8390656,8,t,i)}function Yf(t,i){Qr(2048,8,t,i)}function bx(t){Te.flags|=4;var i=Te.updateQueue;if(i===null)i=Gr(),Te.updateQueue=i,i.events=[t];else{var l=i.events;l===null?i.events=[t]:l.push(t)}}function lg(t){var i=ht().memoizedState;return bx({ref:i,nextImpl:t}),function(){if(($e&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function og(t,i){return Qr(4,2,t,i)}function rg(t,i){return Qr(4,4,t,i)}function cg(t,i){if(typeof i=="function"){t=t();var l=i(t);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function ug(t,i,l){l=l!=null?l.concat([t]):null,Qr(4,4,cg.bind(null,i,t),l)}function Gf(){}function fg(t,i){var l=ht();i=i===void 0?null:i;var r=l.memoizedState;return i!==null&&jf(i,r[1])?r[0]:(l.memoizedState=[t,i],t)}function dg(t,i){var l=ht();i=i===void 0?null:i;var r=l.memoizedState;if(i!==null&&jf(i,r[1]))return r[0];if(r=t(),Rs){pn(!0);try{t()}finally{pn(!1)}}return l.memoizedState=[r,i],r}function Xf(t,i,l){return l===void 0||(vi&1073741824)!==0&&(ze&261930)===0?t.memoizedState=i:(t.memoizedState=l,t=hy(),Te.lanes|=t,ts|=t,l)}function hg(t,i,l,r){return nn(l,i)?l:Ca.current!==null?(t=Xf(t,l,r),nn(t,i)||(bt=!0),t):(vi&42)===0||(vi&1073741824)!==0&&(ze&261930)===0?(bt=!0,t.memoizedState=l):(t=hy(),Te.lanes|=t,ts|=t,i)}function mg(t,i,l,r,f){var m=H.p;H.p=m!==0&&8>m?m:8;var S=O.T,M={};O.T=M,Qf(t,!1,i,l);try{var I=f(),ee=O.S;if(ee!==null&&ee(M,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var re=mx(I,r);ao(t,i,re,cn(t))}else ao(t,i,r,cn(t))}catch(ue){ao(t,i,{then:function(){},status:"rejected",reason:ue},cn())}finally{H.p=m,S!==null&&M.types!==null&&(S.types=M.types),O.T=S}}function Sx(){}function Kf(t,i,l,r){if(t.tag!==5)throw Error(a(476));var f=pg(t).queue;mg(t,f,i,$,l===null?Sx:function(){return gg(t),l(r)})}function pg(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bi,lastRenderedState:$},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bi,lastRenderedState:l},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function gg(t){var i=pg(t);i.next===null&&(i=t.alternate.memoizedState),ao(t,i.next.queue,{},cn())}function Zf(){return Mt(Eo)}function yg(){return ht().memoizedState}function vg(){return ht().memoizedState}function wx(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var l=cn();t=Qi(l);var r=Fi(i,t,l);r!==null&&(Ft(r,i,l),eo(r,i,l)),i={cache:Ef()},t.payload=i;return}i=i.return}}function xx(t,i,l){var r=cn();l={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Fr(t)?Sg(i,l):(l=df(t,i,l,r),l!==null&&(Ft(l,t,r),wg(l,i,r)))}function bg(t,i,l){var r=cn();ao(t,i,l,r)}function ao(t,i,l,r){var f={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Fr(t))Sg(i,f);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=i.lastRenderedReducer,m!==null))try{var S=i.lastRenderedState,M=m(S,l);if(f.hasEagerState=!0,f.eagerState=M,nn(M,S))return Or(t,i,f,0),Ze===null&&Mr(),!1}catch{}if(l=df(t,i,f,r),l!==null)return Ft(l,t,r),wg(l,i,r),!0}return!1}function Qf(t,i,l,r){if(r={lane:2,revertLane:Td(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Fr(t)){if(i)throw Error(a(479))}else i=df(t,l,r,2),i!==null&&Ft(i,t,2)}function Fr(t){var i=t.alternate;return t===Te||i!==null&&i===Te}function Sg(t,i){Ma=Vr=!0;var l=t.pending;l===null?i.next=i:(i.next=l.next,l.next=i),t.pending=i}function wg(t,i,l){if((l&4194048)!==0){var r=i.lanes;r&=t.pendingLanes,l|=r,i.lanes=l,sa(t,l)}}var lo={readContext:Mt,use:Xr,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useLayoutEffect:rt,useInsertionEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useSyncExternalStore:rt,useId:rt,useHostTransitionStatus:rt,useFormState:rt,useActionState:rt,useOptimistic:rt,useMemoCache:rt,useCacheRefresh:rt};lo.useEffectEvent=rt;var xg={readContext:Mt,use:Xr,useCallback:function(t,i){return $t().memoizedState=[t,i===void 0?null:i],t},useContext:Mt,useEffect:ag,useImperativeHandle:function(t,i,l){l=l!=null?l.concat([t]):null,Zr(4194308,4,cg.bind(null,i,t),l)},useLayoutEffect:function(t,i){return Zr(4194308,4,t,i)},useInsertionEffect:function(t,i){Zr(4,2,t,i)},useMemo:function(t,i){var l=$t();i=i===void 0?null:i;var r=t();if(Rs){pn(!0);try{t()}finally{pn(!1)}}return l.memoizedState=[r,i],r},useReducer:function(t,i,l){var r=$t();if(l!==void 0){var f=l(i);if(Rs){pn(!0);try{l(i)}finally{pn(!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=xx.bind(null,Te,t),[r.memoizedState,t]},useRef:function(t){var i=$t();return t={current:t},i.memoizedState=t},useState:function(t){t=qf(t);var i=t.queue,l=bg.bind(null,Te,i);return i.dispatch=l,[t.memoizedState,l]},useDebugValue:Gf,useDeferredValue:function(t,i){var l=$t();return Xf(l,t,i)},useTransition:function(){var t=qf(!1);return t=mg.bind(null,Te,t.queue,!0,!1),$t().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,l){var r=Te,f=$t();if(je){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),Ze===null)throw Error(a(349));(ze&127)!==0||Vp(r,i,l)}f.memoizedState=l;var m={value:l,getSnapshot:i};return f.queue=m,ag(Gp.bind(null,r,m,t),[t]),r.flags|=2048,ka(9,{destroy:void 0},Yp.bind(null,r,m,l,i),null),l},useId:function(){var t=$t(),i=Ze.identifierPrefix;if(je){var l=Wn,r=Jn;l=(r&~(1<<32-At(r)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Yr++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=px++,i="_"+i+"r_"+l.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:Zf,useFormState:eg,useActionState:eg,useOptimistic:function(t){var i=$t();i.memoizedState=i.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=Qf.bind(null,Te,!0,l),l.dispatch=i,[t,i]},useMemoCache:Hf,useCacheRefresh:function(){return $t().memoizedState=wx.bind(null,Te)},useEffectEvent:function(t){var i=$t(),l={impl:t};return i.memoizedState=l,function(){if(($e&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},Ff={readContext:Mt,use:Xr,useCallback:fg,useContext:Mt,useEffect:Yf,useImperativeHandle:ug,useInsertionEffect:og,useLayoutEffect:rg,useMemo:dg,useReducer:Kr,useRef:sg,useState:function(){return Kr(bi)},useDebugValue:Gf,useDeferredValue:function(t,i){var l=ht();return hg(l,Ye.memoizedState,t,i)},useTransition:function(){var t=Kr(bi)[0],i=ht().memoizedState;return[typeof t=="boolean"?t:so(t),i]},useSyncExternalStore:qp,useId:yg,useHostTransitionStatus:Zf,useFormState:tg,useActionState:tg,useOptimistic:function(t,i){var l=ht();return Zp(l,Ye,t,i)},useMemoCache:Hf,useCacheRefresh:vg};Ff.useEffectEvent=lg;var Eg={readContext:Mt,use:Xr,useCallback:fg,useContext:Mt,useEffect:Yf,useImperativeHandle:ug,useInsertionEffect:og,useLayoutEffect:rg,useMemo:dg,useReducer:If,useRef:sg,useState:function(){return If(bi)},useDebugValue:Gf,useDeferredValue:function(t,i){var l=ht();return Ye===null?Xf(l,t,i):hg(l,Ye.memoizedState,t,i)},useTransition:function(){var t=If(bi)[0],i=ht().memoizedState;return[typeof t=="boolean"?t:so(t),i]},useSyncExternalStore:qp,useId:yg,useHostTransitionStatus:Zf,useFormState:ig,useActionState:ig,useOptimistic:function(t,i){var l=ht();return Ye!==null?Zp(l,Ye,t,i):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Hf,useCacheRefresh:vg};Eg.useEffectEvent=lg;function Jf(t,i,l,r){i=t.memoizedState,l=l(r,i),l=l==null?i:g({},i,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Wf={enqueueSetState:function(t,i,l){t=t._reactInternals;var r=cn(),f=Qi(r);f.payload=i,l!=null&&(f.callback=l),i=Fi(t,f,r),i!==null&&(Ft(i,t,r),eo(i,t,r))},enqueueReplaceState:function(t,i,l){t=t._reactInternals;var r=cn(),f=Qi(r);f.tag=1,f.payload=i,l!=null&&(f.callback=l),i=Fi(t,f,r),i!==null&&(Ft(i,t,r),eo(i,t,r))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var l=cn(),r=Qi(l);r.tag=2,i!=null&&(r.callback=i),i=Fi(t,r,l),i!==null&&(Ft(i,t,l),eo(i,t,l))}};function Ng(t,i,l,r,f,m,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,m,S):i.prototype&&i.prototype.isPureReactComponent?!Xl(l,r)||!Xl(f,m):!0}function _g(t,i,l,r){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,r),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,r),i.state!==t&&Wf.enqueueReplaceState(i,i.state,null)}function Bs(t,i){var l=i;if("ref"in i){l={};for(var r in i)r!=="ref"&&(l[r]=i[r])}if(t=t.defaultProps){l===i&&(l=g({},l));for(var f in t)l[f]===void 0&&(l[f]=t[f])}return l}function Ag(t){Cr(t)}function Tg(t){console.error(t)}function Cg(t){Cr(t)}function Jr(t,i){try{var l=t.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(r){setTimeout(function(){throw r})}}function Mg(t,i,l){try{var r=t.onCaughtError;r(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Pf(t,i,l){return l=Qi(l),l.tag=3,l.payload={element:null},l.callback=function(){Jr(t,i)},l}function Og(t){return t=Qi(t),t.tag=3,t}function kg(t,i,l,r){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var m=r.value;t.payload=function(){return f(m)},t.callback=function(){Mg(i,l,r)}}var S=l.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){Mg(i,l,r),typeof f!="function"&&(ns===null?ns=new Set([this]):ns.add(this));var M=r.stack;this.componentDidCatch(r.value,{componentStack:M!==null?M:""})})}function Ex(t,i,l,r,f){if(l.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(i=l.alternate,i!==null&&Ea(i,l,f,!0),l=an.current,l!==null){switch(l.tag){case 31:case 13:return Nn===null?cc():l.alternate===null&&ct===0&&(ct=3),l.flags&=-257,l.flags|=65536,l.lanes=f,r===$r?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([r]):i.add(r),Nd(t,r,f)),!1;case 22:return l.flags|=65536,r===$r?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([r])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([r]):l.add(r)),Nd(t,r,f)),!1}throw Error(a(435,l.tag))}return Nd(t,r,f),cc(),!1}if(je)return i=an.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=f,r!==vf&&(t=Error(a(422),{cause:r}),Ql(Sn(t,l)))):(r!==vf&&(i=Error(a(423),{cause:r}),Ql(Sn(i,l))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,r=Sn(r,l),f=Pf(t.stateNode,r,f),Mf(t,f),ct!==4&&(ct=2)),!1;var m=Error(a(520),{cause:r});if(m=Sn(m,l),po===null?po=[m]:po.push(m),ct!==4&&(ct=2),i===null)return!0;r=Sn(r,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,t=f&-f,l.lanes|=t,t=Pf(l.stateNode,r,t),Mf(l,t),!1;case 1:if(i=l.type,m=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(ns===null||!ns.has(m))))return l.flags|=65536,f&=-f,l.lanes|=f,f=Og(f),kg(f,t,l,r),Mf(l,f),!1}l=l.return}while(l!==null);return!1}var ed=Error(a(461)),bt=!1;function Ot(t,i,l,r){i.child=t===null?Rp(i,null,l,r):js(i,t.child,l,r)}function zg(t,i,l,r,f){l=l.render;var m=i.ref;if("ref"in r){var S={};for(var M in r)M!=="ref"&&(S[M]=r[M])}else S=r;return Os(i),r=Rf(t,i,l,S,m,f),M=Bf(),t!==null&&!bt?(Lf(t,i,f),Si(t,i,f)):(je&&M&&gf(i),i.flags|=1,Ot(t,i,r,f),i.child)}function Dg(t,i,l,r,f){if(t===null){var m=l.type;return typeof m=="function"&&!hf(m)&&m.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=m,jg(t,i,m,r,f)):(t=zr(l.type,null,r,i,i.mode,f),t.ref=i.ref,t.return=i,i.child=t)}if(m=t.child,!rd(t,f)){var S=m.memoizedProps;if(l=l.compare,l=l!==null?l:Xl,l(S,r)&&t.ref===i.ref)return Si(t,i,f)}return i.flags|=1,t=mi(m,r),t.ref=i.ref,t.return=i,i.child=t}function jg(t,i,l,r,f){if(t!==null){var m=t.memoizedProps;if(Xl(m,r)&&t.ref===i.ref)if(bt=!1,i.pendingProps=r=m,rd(t,f))(t.flags&131072)!==0&&(bt=!0);else return i.lanes=t.lanes,Si(t,i,f)}return td(t,i,l,r,f)}function Rg(t,i,l,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|l:l,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 Bg(t,i,m,l,r)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&Br(i,m!==null?m.cachePool:null),m!==null?$p(i,m):kf(),Hp(i);else return r=i.lanes=536870912,Bg(t,i,m!==null?m.baseLanes|l:l,l,r)}else m!==null?(Br(i,m.cachePool),$p(i,m),Wi(),i.memoizedState=null):(t!==null&&Br(i,null),kf(),Wi());return Ot(t,i,f,l),i.child}function oo(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Bg(t,i,l,r,f){var m=_f();return m=m===null?null:{parent:yt._currentValue,pool:m},i.memoizedState={baseLanes:l,cachePool:m},t!==null&&Br(i,null),kf(),Hp(i),t!==null&&Ea(t,i,r,!0),i.childLanes=f,null}function Wr(t,i){return i=ec({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function Lg(t,i,l){return js(i,t.child,null,l),t=Wr(i,i.pendingProps),t.flags|=2,ln(i),i.memoizedState=null,t}function Nx(t,i,l){var r=i.pendingProps,f=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(je){if(r.mode==="hidden")return t=Wr(i,r),i.lanes=536870912,oo(null,t);if(Df(i),(t=Je)?(t=Qy(t,En),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Yi!==null?{id:Jn,overflow:Wn}:null,retryLane:536870912,hydrationErrors:null},l=Sp(t),l.return=i,i.child=l,Ct=i,Je=null)):t=null,t===null)throw Xi(i);return i.lanes=536870912,null}return Wr(i,r)}var m=t.memoizedState;if(m!==null){var S=m.dehydrated;if(Df(i),f)if(i.flags&256)i.flags&=-257,i=Lg(t,i,l);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(a(558));else if(bt||Ea(t,i,l,!1),f=(l&t.childLanes)!==0,bt||f){if(r=Ze,r!==null&&(S=aa(r,l),S!==0&&S!==m.retryLane))throw m.retryLane=S,As(t,S),Ft(r,t,S),ed;cc(),i=Lg(t,i,l)}else t=m.treeContext,Je=_n(S.nextSibling),Ct=i,je=!0,Gi=null,En=!1,t!==null&&Ep(i,t),i=Wr(i,r),i.flags|=4096;return i}return t=mi(t.child,{mode:r.mode,children:r.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Pr(t,i){var l=i.ref;if(l===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(t===null||t.ref!==l)&&(i.flags|=4194816)}}function td(t,i,l,r,f){return Os(i),l=Rf(t,i,l,r,void 0,f),r=Bf(),t!==null&&!bt?(Lf(t,i,f),Si(t,i,f)):(je&&r&&gf(i),i.flags|=1,Ot(t,i,l,f),i.child)}function $g(t,i,l,r,f,m){return Os(i),i.updateQueue=null,l=Ip(i,r,l,f),Up(t),r=Bf(),t!==null&&!bt?(Lf(t,i,m),Si(t,i,m)):(je&&r&&gf(i),i.flags|=1,Ot(t,i,l,m),i.child)}function Hg(t,i,l,r,f){if(Os(i),i.stateNode===null){var m=ba,S=l.contextType;typeof S=="object"&&S!==null&&(m=Mt(S)),m=new l(r,m),i.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Wf,i.stateNode=m,m._reactInternals=i,m=i.stateNode,m.props=r,m.state=i.memoizedState,m.refs={},Tf(i),S=l.contextType,m.context=typeof S=="object"&&S!==null?Mt(S):ba,m.state=i.memoizedState,S=l.getDerivedStateFromProps,typeof S=="function"&&(Jf(i,l,S,r),m.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(S=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),S!==m.state&&Wf.enqueueReplaceState(m,m.state,null),no(i,r,m,f),to(),m.state=i.memoizedState),typeof m.componentDidMount=="function"&&(i.flags|=4194308),r=!0}else if(t===null){m=i.stateNode;var M=i.memoizedProps,I=Bs(l,M);m.props=I;var ee=m.context,re=l.contextType;S=ba,typeof re=="object"&&re!==null&&(S=Mt(re));var ue=l.getDerivedStateFromProps;re=typeof ue=="function"||typeof m.getSnapshotBeforeUpdate=="function",M=i.pendingProps!==M,re||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(M||ee!==S)&&_g(i,m,r,S),Zi=!1;var ne=i.memoizedState;m.state=ne,no(i,r,m,f),to(),ee=i.memoizedState,M||ne!==ee||Zi?(typeof ue=="function"&&(Jf(i,l,ue,r),ee=i.memoizedState),(I=Zi||Ng(i,l,I,r,ne,ee,S))?(re||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=ee),m.props=r,m.state=ee,m.context=S,r=I):(typeof m.componentDidMount=="function"&&(i.flags|=4194308),r=!1)}else{m=i.stateNode,Cf(t,i),S=i.memoizedProps,re=Bs(l,S),m.props=re,ue=i.pendingProps,ne=m.context,ee=l.contextType,I=ba,typeof ee=="object"&&ee!==null&&(I=Mt(ee)),M=l.getDerivedStateFromProps,(ee=typeof M=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(S!==ue||ne!==I)&&_g(i,m,r,I),Zi=!1,ne=i.memoizedState,m.state=ne,no(i,r,m,f),to();var ae=i.memoizedState;S!==ue||ne!==ae||Zi||t!==null&&t.dependencies!==null&&jr(t.dependencies)?(typeof M=="function"&&(Jf(i,l,M,r),ae=i.memoizedState),(re=Zi||Ng(i,l,re,r,ne,ae,I)||t!==null&&t.dependencies!==null&&jr(t.dependencies))?(ee||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(r,ae,I),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(r,ae,I)),typeof m.componentDidUpdate=="function"&&(i.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof m.componentDidUpdate!="function"||S===t.memoizedProps&&ne===t.memoizedState||(i.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ne===t.memoizedState||(i.flags|=1024),i.memoizedProps=r,i.memoizedState=ae),m.props=r,m.state=ae,m.context=I,r=re):(typeof m.componentDidUpdate!="function"||S===t.memoizedProps&&ne===t.memoizedState||(i.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ne===t.memoizedState||(i.flags|=1024),r=!1)}return m=r,Pr(t,i),r=(i.flags&128)!==0,m||r?(m=i.stateNode,l=r&&typeof l.getDerivedStateFromError!="function"?null:m.render(),i.flags|=1,t!==null&&r?(i.child=js(i,t.child,null,f),i.child=js(i,null,l,f)):Ot(t,i,l,f),i.memoizedState=m.state,t=i.child):t=Si(t,i,f),t}function Ug(t,i,l,r){return Cs(),i.flags|=256,Ot(t,i,l,r),i.child}var nd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function id(t){return{baseLanes:t,cachePool:Mp()}}function sd(t,i,l){return t=t!==null?t.childLanes&~l:0,i&&(t|=rn),t}function Ig(t,i,l){var r=i.pendingProps,f=!1,m=(i.flags&128)!==0,S;if((S=m)||(S=t!==null&&t.memoizedState===null?!1:(dt.current&2)!==0),S&&(f=!0,i.flags&=-129),S=(i.flags&32)!==0,i.flags&=-33,t===null){if(je){if(f?Ji(i):Wi(),(t=Je)?(t=Qy(t,En),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Yi!==null?{id:Jn,overflow:Wn}:null,retryLane:536870912,hydrationErrors:null},l=Sp(t),l.return=i,i.child=l,Ct=i,Je=null)):t=null,t===null)throw Xi(i);return Ud(t)?i.lanes=32:i.lanes=536870912,null}var M=r.children;return r=r.fallback,f?(Wi(),f=i.mode,M=ec({mode:"hidden",children:M},f),r=Ts(r,f,l,null),M.return=i,r.return=i,M.sibling=r,i.child=M,r=i.child,r.memoizedState=id(l),r.childLanes=sd(t,S,l),i.memoizedState=nd,oo(null,r)):(Ji(i),ad(i,M))}var I=t.memoizedState;if(I!==null&&(M=I.dehydrated,M!==null)){if(m)i.flags&256?(Ji(i),i.flags&=-257,i=ld(t,i,l)):i.memoizedState!==null?(Wi(),i.child=t.child,i.flags|=128,i=null):(Wi(),M=r.fallback,f=i.mode,r=ec({mode:"visible",children:r.children},f),M=Ts(M,f,l,null),M.flags|=2,r.return=i,M.return=i,r.sibling=M,i.child=r,js(i,t.child,null,l),r=i.child,r.memoizedState=id(l),r.childLanes=sd(t,S,l),i.memoizedState=nd,i=oo(null,r));else if(Ji(i),Ud(M)){if(S=M.nextSibling&&M.nextSibling.dataset,S)var ee=S.dgst;S=ee,r=Error(a(419)),r.stack="",r.digest=S,Ql({value:r,source:null,stack:null}),i=ld(t,i,l)}else if(bt||Ea(t,i,l,!1),S=(l&t.childLanes)!==0,bt||S){if(S=Ze,S!==null&&(r=aa(S,l),r!==0&&r!==I.retryLane))throw I.retryLane=r,As(t,r),Ft(S,t,r),ed;Hd(M)||cc(),i=ld(t,i,l)}else Hd(M)?(i.flags|=192,i.child=t.child,i=null):(t=I.treeContext,Je=_n(M.nextSibling),Ct=i,je=!0,Gi=null,En=!1,t!==null&&Ep(i,t),i=ad(i,r.children),i.flags|=4096);return i}return f?(Wi(),M=r.fallback,f=i.mode,I=t.child,ee=I.sibling,r=mi(I,{mode:"hidden",children:r.children}),r.subtreeFlags=I.subtreeFlags&65011712,ee!==null?M=mi(ee,M):(M=Ts(M,f,l,null),M.flags|=2),M.return=i,r.return=i,r.sibling=M,i.child=r,oo(null,r),r=i.child,M=t.child.memoizedState,M===null?M=id(l):(f=M.cachePool,f!==null?(I=yt._currentValue,f=f.parent!==I?{parent:I,pool:I}:f):f=Mp(),M={baseLanes:M.baseLanes|l,cachePool:f}),r.memoizedState=M,r.childLanes=sd(t,S,l),i.memoizedState=nd,oo(t.child,r)):(Ji(i),l=t.child,t=l.sibling,l=mi(l,{mode:"visible",children:r.children}),l.return=i,l.sibling=null,t!==null&&(S=i.deletions,S===null?(i.deletions=[t],i.flags|=16):S.push(t)),i.child=l,i.memoizedState=null,l)}function ad(t,i){return i=ec({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function ec(t,i){return t=sn(22,t,null,i),t.lanes=0,t}function ld(t,i,l){return js(i,t.child,null,l),t=ad(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function qg(t,i,l){t.lanes|=i;var r=t.alternate;r!==null&&(r.lanes|=i),wf(t.return,i,l)}function od(t,i,l,r,f,m){var S=t.memoizedState;S===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:r,tail:l,tailMode:f,treeForkCount:m}:(S.isBackwards=i,S.rendering=null,S.renderingStartTime=0,S.last=r,S.tail=l,S.tailMode=f,S.treeForkCount=m)}function Vg(t,i,l){var r=i.pendingProps,f=r.revealOrder,m=r.tail;r=r.children;var S=dt.current,M=(S&2)!==0;if(M?(S=S&1|2,i.flags|=128):S&=1,F(dt,S),Ot(t,i,r,l),r=je?Zl:0,!M&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&qg(t,l,i);else if(t.tag===19)qg(t,l,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(l=i.child,f=null;l!==null;)t=l.alternate,t!==null&&qr(t)===null&&(f=l),l=l.sibling;l=f,l===null?(f=i.child,i.child=null):(f=l.sibling,l.sibling=null),od(i,!1,f,l,m,r);break;case"backwards":case"unstable_legacy-backwards":for(l=null,f=i.child,i.child=null;f!==null;){if(t=f.alternate,t!==null&&qr(t)===null){i.child=f;break}t=f.sibling,f.sibling=l,l=f,f=t}od(i,!0,l,null,m,r);break;case"together":od(i,!1,null,null,void 0,r);break;default:i.memoizedState=null}return i.child}function Si(t,i,l){if(t!==null&&(i.dependencies=t.dependencies),ts|=i.lanes,(l&i.childLanes)===0)if(t!==null){if(Ea(t,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(a(153));if(i.child!==null){for(t=i.child,l=mi(t,t.pendingProps),i.child=l,l.return=i;t.sibling!==null;)t=t.sibling,l=l.sibling=mi(t,t.pendingProps),l.return=i;l.sibling=null}return i.child}function rd(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&jr(t)))}function _x(t,i,l){switch(i.tag){case 3:te(i,i.stateNode.containerInfo),Ki(i,yt,t.memoizedState.cache),Cs();break;case 27:case 5:ve(i);break;case 4:te(i,i.stateNode.containerInfo);break;case 10:Ki(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Df(i),null;break;case 13:var r=i.memoizedState;if(r!==null)return r.dehydrated!==null?(Ji(i),i.flags|=128,null):(l&i.child.childLanes)!==0?Ig(t,i,l):(Ji(i),t=Si(t,i,l),t!==null?t.sibling:null);Ji(i);break;case 19:var f=(t.flags&128)!==0;if(r=(l&i.childLanes)!==0,r||(Ea(t,i,l,!1),r=(l&i.childLanes)!==0),f){if(r)return Vg(t,i,l);i.flags|=128}if(f=i.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),F(dt,dt.current),r)break;return null;case 22:return i.lanes=0,Rg(t,i,l,i.pendingProps);case 24:Ki(i,yt,t.memoizedState.cache)}return Si(t,i,l)}function Yg(t,i,l){if(t!==null)if(t.memoizedProps!==i.pendingProps)bt=!0;else{if(!rd(t,l)&&(i.flags&128)===0)return bt=!1,_x(t,i,l);bt=(t.flags&131072)!==0}else bt=!1,je&&(i.flags&1048576)!==0&&xp(i,Zl,i.index);switch(i.lanes=0,i.tag){case 16:e:{var r=i.pendingProps;if(t=zs(i.elementType),i.type=t,typeof t=="function")hf(t)?(r=Bs(t,r),i.tag=1,i=Hg(null,i,t,r,l)):(i.tag=0,i=td(null,i,t,r,l));else{if(t!=null){var f=t.$$typeof;if(f===N){i.tag=11,i=zg(null,i,t,r,l);break e}else if(f===B){i.tag=14,i=Dg(null,i,t,r,l);break e}}throw i=L(t)||t,Error(a(306,i,""))}}return i;case 0:return td(t,i,i.type,i.pendingProps,l);case 1:return r=i.type,f=Bs(r,i.pendingProps),Hg(t,i,r,f,l);case 3:e:{if(te(i,i.stateNode.containerInfo),t===null)throw Error(a(387));r=i.pendingProps;var m=i.memoizedState;f=m.element,Cf(t,i),no(i,r,null,l);var S=i.memoizedState;if(r=S.cache,Ki(i,yt,r),r!==m.cache&&xf(i,[yt],l,!0),to(),r=S.element,m.isDehydrated)if(m={element:r,isDehydrated:!1,cache:S.cache},i.updateQueue.baseState=m,i.memoizedState=m,i.flags&256){i=Ug(t,i,r,l);break e}else if(r!==f){f=Sn(Error(a(424)),i),Ql(f),i=Ug(t,i,r,l);break e}else for(t=i.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Je=_n(t.firstChild),Ct=i,je=!0,Gi=null,En=!0,l=Rp(i,null,r,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Cs(),r===f){i=Si(t,i,l);break e}Ot(t,i,r,l)}i=i.child}return i;case 26:return Pr(t,i),t===null?(l=t0(i.type,null,i.pendingProps,null))?i.memoizedState=l:je||(l=i.type,t=i.pendingProps,r=gc(de.current).createElement(l),r[J]=i,r[he]=t,kt(r,l,t),gt(r),i.stateNode=r):i.memoizedState=t0(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return ve(i),t===null&&je&&(r=i.stateNode=Wy(i.type,i.pendingProps,de.current),Ct=i,En=!0,f=Je,ls(i.type)?(Id=f,Je=_n(r.firstChild)):Je=f),Ot(t,i,i.pendingProps.children,l),Pr(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&je&&((f=r=Je)&&(r=tE(r,i.type,i.pendingProps,En),r!==null?(i.stateNode=r,Ct=i,Je=_n(r.firstChild),En=!1,f=!0):f=!1),f||Xi(i)),ve(i),f=i.type,m=i.pendingProps,S=t!==null?t.memoizedProps:null,r=m.children,Bd(f,m)?r=null:S!==null&&Bd(f,S)&&(i.flags|=32),i.memoizedState!==null&&(f=Rf(t,i,gx,null,null,l),Eo._currentValue=f),Pr(t,i),Ot(t,i,r,l),i.child;case 6:return t===null&&je&&((t=l=Je)&&(l=nE(l,i.pendingProps,En),l!==null?(i.stateNode=l,Ct=i,Je=null,t=!0):t=!1),t||Xi(i)),null;case 13:return Ig(t,i,l);case 4:return te(i,i.stateNode.containerInfo),r=i.pendingProps,t===null?i.child=js(i,null,r,l):Ot(t,i,r,l),i.child;case 11:return zg(t,i,i.type,i.pendingProps,l);case 7:return Ot(t,i,i.pendingProps,l),i.child;case 8:return Ot(t,i,i.pendingProps.children,l),i.child;case 12:return Ot(t,i,i.pendingProps.children,l),i.child;case 10:return r=i.pendingProps,Ki(i,i.type,r.value),Ot(t,i,r.children,l),i.child;case 9:return f=i.type._context,r=i.pendingProps.children,Os(i),f=Mt(f),r=r(f),i.flags|=1,Ot(t,i,r,l),i.child;case 14:return Dg(t,i,i.type,i.pendingProps,l);case 15:return jg(t,i,i.type,i.pendingProps,l);case 19:return Vg(t,i,l);case 31:return Nx(t,i,l);case 22:return Rg(t,i,l,i.pendingProps);case 24:return Os(i),r=Mt(yt),t===null?(f=_f(),f===null&&(f=Ze,m=Ef(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=l),f=m),i.memoizedState={parent:r,cache:f},Tf(i),Ki(i,yt,f)):((t.lanes&l)!==0&&(Cf(t,i),no(i,null,null,l),to()),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),Ki(i,yt,r)):(r=m.cache,Ki(i,yt,r),r!==f.cache&&xf(i,[yt],l,!0))),Ot(t,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function wi(t){t.flags|=4}function cd(t,i,l,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(yy())t.flags|=8192;else throw Ds=$r,Af}else t.flags&=-16777217}function Gg(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!l0(i))if(yy())t.flags|=8192;else throw Ds=$r,Af}function tc(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Tt():536870912,t.lanes|=i,Ra|=i)}function ro(t,i){if(!je)switch(t.tailMode){case"hidden":i=t.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var r=null;l!==null;)l.alternate!==null&&(r=l),l=l.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,l=0,r=0;if(i)for(var f=t.child;f!==null;)l|=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;)l|=f.lanes|f.childLanes,r|=f.subtreeFlags,r|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=r,t.childLanes=l,i}function Ax(t,i,l){var r=i.pendingProps;switch(yf(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 l=i.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),i.memoizedState.cache!==r&&(i.flags|=2048),yi(yt),oe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(xa(i)?wi(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,bf())),We(i),null;case 26:var f=i.type,m=i.memoizedState;return t===null?(wi(i),m!==null?(We(i),Gg(i,m)):(We(i),cd(i,f,null,r,l))):m?m!==t.memoizedState?(wi(i),We(i),Gg(i,m)):(We(i),i.flags&=-16777217):(t=t.memoizedProps,t!==r&&wi(i),We(i),cd(i,f,t,r,l)),null;case 27:if(Se(i),l=de.current,f=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==r&&wi(i);else{if(!r){if(i.stateNode===null)throw Error(a(166));return We(i),null}t=P.current,xa(i)?Np(i):(t=Wy(f,r,l),i.stateNode=t,wi(i))}return We(i),null;case 5:if(Se(i),f=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==r&&wi(i);else{if(!r){if(i.stateNode===null)throw Error(a(166));return We(i),null}if(m=P.current,xa(i))Np(i);else{var S=gc(de.current);switch(m){case 1:m=S.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:m=S.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":m=S.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":m=S.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":m=S.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof r.is=="string"?S.createElement("select",{is:r.is}):S.createElement("select"),r.multiple?m.multiple=!0:r.size&&(m.size=r.size);break;default:m=typeof r.is=="string"?S.createElement(f,{is:r.is}):S.createElement(f)}}m[J]=i,m[he]=r;e:for(S=i.child;S!==null;){if(S.tag===5||S.tag===6)m.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===i)break e;for(;S.sibling===null;){if(S.return===null||S.return===i)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}i.stateNode=m;e:switch(kt(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&&wi(i)}}return We(i),cd(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,l),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==r&&wi(i);else{if(typeof r!="string"&&i.stateNode===null)throw Error(a(166));if(t=de.current,xa(i)){if(t=i.stateNode,l=i.memoizedProps,r=null,f=Ct,f!==null)switch(f.tag){case 27:case 5:r=f.memoizedProps}t[J]=i,t=!!(t.nodeValue===l||r!==null&&r.suppressHydrationWarning===!0||Iy(t.nodeValue,l)),t||Xi(i,!0)}else t=gc(t).createTextNode(r),t[J]=i,i.stateNode=t}return We(i),null;case 31:if(l=i.memoizedState,t===null||t.memoizedState!==null){if(r=xa(i),l!==null){if(t===null){if(!r)throw Error(a(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[J]=i}else Cs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;We(i),t=!1}else l=bf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return i.flags&256?(ln(i),i):(ln(i),null);if((i.flags&128)!==0)throw Error(a(558))}return We(i),null;case 13:if(r=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=xa(i),r!==null&&r.dehydrated!==null){if(t===null){if(!f)throw Error(a(318));if(f=i.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(317));f[J]=i}else Cs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;We(i),f=!1}else f=bf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return i.flags&256?(ln(i),i):(ln(i),null)}return ln(i),(i.flags&128)!==0?(i.lanes=l,i):(l=r!==null,t=t!==null&&t.memoizedState!==null,l&&(r=i.child,f=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(f=r.alternate.memoizedState.cachePool.pool),m=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(m=r.memoizedState.cachePool.pool),m!==f&&(r.flags|=2048)),l!==t&&l&&(i.child.flags|=8192),tc(i,i.updateQueue),We(i),null);case 4:return oe(),t===null&&kd(i.stateNode.containerInfo),We(i),null;case 10:return yi(i.type),We(i),null;case 19:if(z(dt),r=i.memoizedState,r===null)return We(i),null;if(f=(i.flags&128)!==0,m=r.rendering,m===null)if(f)ro(r,!1);else{if(ct!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(m=qr(t),m!==null){for(i.flags|=128,ro(r,!1),t=m.updateQueue,i.updateQueue=t,tc(i,t),i.subtreeFlags=0,t=l,l=i.child;l!==null;)bp(l,t),l=l.sibling;return F(dt,dt.current&1|2),je&&pi(i,r.treeForkCount),i.child}t=t.sibling}r.tail!==null&&Ke()>lc&&(i.flags|=128,f=!0,ro(r,!1),i.lanes=4194304)}else{if(!f)if(t=qr(m),t!==null){if(i.flags|=128,f=!0,t=t.updateQueue,i.updateQueue=t,tc(i,t),ro(r,!0),r.tail===null&&r.tailMode==="hidden"&&!m.alternate&&!je)return We(i),null}else 2*Ke()-r.renderingStartTime>lc&&l!==536870912&&(i.flags|=128,f=!0,ro(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=Ke(),t.sibling=null,l=dt.current,F(dt,f?l&1|2:l&1),je&&pi(i,r.treeForkCount),t):(We(i),null);case 22:case 23:return ln(i),zf(),r=i.memoizedState!==null,t!==null?t.memoizedState!==null!==r&&(i.flags|=8192):r&&(i.flags|=8192),r?(l&536870912)!==0&&(i.flags&128)===0&&(We(i),i.subtreeFlags&6&&(i.flags|=8192)):We(i),l=i.updateQueue,l!==null&&tc(i,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==l&&(i.flags|=2048),t!==null&&z(ks),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),yi(yt),We(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function Tx(t,i){switch(yf(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return yi(yt),oe(),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(ln(i),i.alternate===null)throw Error(a(340));Cs()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(ln(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Cs()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return z(dt),null;case 4:return oe(),null;case 10:return yi(i.type),null;case 22:case 23:return ln(i),zf(),t!==null&&z(ks),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return yi(yt),null;case 25:return null;default:return null}}function Xg(t,i){switch(yf(i),i.tag){case 3:yi(yt),oe();break;case 26:case 27:case 5:Se(i);break;case 4:oe();break;case 31:i.memoizedState!==null&&ln(i);break;case 13:ln(i);break;case 19:z(dt);break;case 10:yi(i.type);break;case 22:case 23:ln(i),zf(),t!==null&&z(ks);break;case 24:yi(yt)}}function co(t,i){try{var l=i.updateQueue,r=l!==null?l.lastEffect:null;if(r!==null){var f=r.next;l=f;do{if((l.tag&t)===t){r=void 0;var m=l.create,S=l.inst;r=m(),S.destroy=r}l=l.next}while(l!==f)}}catch(M){Ve(i,i.return,M)}}function Pi(t,i,l){try{var r=i.updateQueue,f=r!==null?r.lastEffect:null;if(f!==null){var m=f.next;r=m;do{if((r.tag&t)===t){var S=r.inst,M=S.destroy;if(M!==void 0){S.destroy=void 0,f=i;var I=l,ee=M;try{ee()}catch(re){Ve(f,I,re)}}}r=r.next}while(r!==m)}}catch(re){Ve(i,i.return,re)}}function Kg(t){var i=t.updateQueue;if(i!==null){var l=t.stateNode;try{Lp(i,l)}catch(r){Ve(t,t.return,r)}}}function Zg(t,i,l){l.props=Bs(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(r){Ve(t,i,r)}}function uo(t,i){try{var l=t.ref;if(l!==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 l=="function"?t.refCleanup=l(r):l.current=r}}catch(f){Ve(t,i,f)}}function Pn(t,i){var l=t.ref,r=t.refCleanup;if(l!==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 l=="function")try{l(null)}catch(f){Ve(t,i,f)}else l.current=null}function Qg(t){var i=t.type,l=t.memoizedProps,r=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break e;case"img":l.src?r.src=l.src:l.srcSet&&(r.srcset=l.srcSet)}}catch(f){Ve(t,t.return,f)}}function ud(t,i,l){try{var r=t.stateNode;Qx(r,t.type,l,i),r[he]=i}catch(f){Ve(t,t.return,f)}}function Fg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ls(t.type)||t.tag===4}function fd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Fg(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&&ls(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 dd(t,i,l){var r=t.tag;if(r===5||r===6)t=t.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(t),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=di));else if(r!==4&&(r===27&&ls(t.type)&&(l=t.stateNode,i=null),t=t.child,t!==null))for(dd(t,i,l),t=t.sibling;t!==null;)dd(t,i,l),t=t.sibling}function nc(t,i,l){var r=t.tag;if(r===5||r===6)t=t.stateNode,i?l.insertBefore(t,i):l.appendChild(t);else if(r!==4&&(r===27&&ls(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(nc(t,i,l),t=t.sibling;t!==null;)nc(t,i,l),t=t.sibling}function Jg(t){var i=t.stateNode,l=t.memoizedProps;try{for(var r=t.type,f=i.attributes;f.length;)i.removeAttributeNode(f[0]);kt(i,r,l),i[J]=t,i[he]=l}catch(m){Ve(t,t.return,m)}}var xi=!1,St=!1,hd=!1,Wg=typeof WeakSet=="function"?WeakSet:Set,Nt=null;function Cx(t,i){if(t=t.containerInfo,jd=Ec,t=up(t),lf(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var r=l.getSelection&&l.getSelection();if(r&&r.rangeCount!==0){l=r.anchorNode;var f=r.anchorOffset,m=r.focusNode;r=r.focusOffset;try{l.nodeType,m.nodeType}catch{l=null;break e}var S=0,M=-1,I=-1,ee=0,re=0,ue=t,ne=null;t:for(;;){for(var ae;ue!==l||f!==0&&ue.nodeType!==3||(M=S+f),ue!==m||r!==0&&ue.nodeType!==3||(I=S+r),ue.nodeType===3&&(S+=ue.nodeValue.length),(ae=ue.firstChild)!==null;)ne=ue,ue=ae;for(;;){if(ue===t)break t;if(ne===l&&++ee===f&&(M=S),ne===m&&++re===r&&(I=S),(ae=ue.nextSibling)!==null)break;ue=ne,ne=ue.parentNode}ue=ae}l=M===-1||I===-1?null:{start:M,end:I}}else l=null}l=l||{start:0,end:0}}else l=null;for(Rd={focusedElem:t,selectionRange:l},Ec=!1,Nt=i;Nt!==null;)if(i=Nt,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,Nt=t;else for(;Nt!==null;){switch(i=Nt,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(l=0;l<t.length;l++)f=t[l],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&m!==null){t=void 0,l=i,f=m.memoizedProps,m=m.memoizedState,r=l.stateNode;try{var ye=Bs(l.type,f);t=r.getSnapshotBeforeUpdate(ye,m),r.__reactInternalSnapshotBeforeUpdate=t}catch(Ee){Ve(l,l.return,Ee)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,l=t.nodeType,l===9)$d(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":$d(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(a(163))}if(t=i.sibling,t!==null){t.return=i.return,Nt=t;break}Nt=i.return}}function Pg(t,i,l){var r=l.flags;switch(l.tag){case 0:case 11:case 15:Ni(t,l),r&4&&co(5,l);break;case 1:if(Ni(t,l),r&4)if(t=l.stateNode,i===null)try{t.componentDidMount()}catch(S){Ve(l,l.return,S)}else{var f=Bs(l.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(f,i,t.__reactInternalSnapshotBeforeUpdate)}catch(S){Ve(l,l.return,S)}}r&64&&Kg(l),r&512&&uo(l,l.return);break;case 3:if(Ni(t,l),r&64&&(t=l.updateQueue,t!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{Lp(t,i)}catch(S){Ve(l,l.return,S)}}break;case 27:i===null&&r&4&&Jg(l);case 26:case 5:Ni(t,l),i===null&&r&4&&Qg(l),r&512&&uo(l,l.return);break;case 12:Ni(t,l);break;case 31:Ni(t,l),r&4&&ny(t,l);break;case 13:Ni(t,l),r&4&&iy(t,l),r&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=Lx.bind(null,l),iE(t,l))));break;case 22:if(r=l.memoizedState!==null||xi,!r){i=i!==null&&i.memoizedState!==null||St,f=xi;var m=St;xi=r,(St=i)&&!m?_i(t,l,(l.subtreeFlags&8772)!==0):Ni(t,l),xi=f,St=m}break;case 30:break;default:Ni(t,l)}}function ey(t){var i=t.alternate;i!==null&&(t.alternate=null,ey(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&zl(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 tt=null,Xt=!1;function Ei(t,i,l){for(l=l.child;l!==null;)ty(t,i,l),l=l.sibling}function ty(t,i,l){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(It,l)}catch{}switch(l.tag){case 26:St||Pn(l,i),Ei(t,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:St||Pn(l,i);var r=tt,f=Xt;ls(l.type)&&(tt=l.stateNode,Xt=!1),Ei(t,i,l),So(l.stateNode),tt=r,Xt=f;break;case 5:St||Pn(l,i);case 6:if(r=tt,f=Xt,tt=null,Ei(t,i,l),tt=r,Xt=f,tt!==null)if(Xt)try{(tt.nodeType===9?tt.body:tt.nodeName==="HTML"?tt.ownerDocument.body:tt).removeChild(l.stateNode)}catch(m){Ve(l,i,m)}else try{tt.removeChild(l.stateNode)}catch(m){Ve(l,i,m)}break;case 18:tt!==null&&(Xt?(t=tt,Ky(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Va(t)):Ky(tt,l.stateNode));break;case 4:r=tt,f=Xt,tt=l.stateNode.containerInfo,Xt=!0,Ei(t,i,l),tt=r,Xt=f;break;case 0:case 11:case 14:case 15:Pi(2,l,i),St||Pi(4,l,i),Ei(t,i,l);break;case 1:St||(Pn(l,i),r=l.stateNode,typeof r.componentWillUnmount=="function"&&Zg(l,i,r)),Ei(t,i,l);break;case 21:Ei(t,i,l);break;case 22:St=(r=St)||l.memoizedState!==null,Ei(t,i,l),St=r;break;default:Ei(t,i,l)}}function ny(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Va(t)}catch(l){Ve(i,i.return,l)}}}function iy(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Va(t)}catch(l){Ve(i,i.return,l)}}function Mx(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Wg),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Wg),i;default:throw Error(a(435,t.tag))}}function ic(t,i){var l=Mx(t);i.forEach(function(r){if(!l.has(r)){l.add(r);var f=$x.bind(null,t,r);r.then(f,f)}})}function Kt(t,i){var l=i.deletions;if(l!==null)for(var r=0;r<l.length;r++){var f=l[r],m=t,S=i,M=S;e:for(;M!==null;){switch(M.tag){case 27:if(ls(M.type)){tt=M.stateNode,Xt=!1;break e}break;case 5:tt=M.stateNode,Xt=!1;break e;case 3:case 4:tt=M.stateNode.containerInfo,Xt=!0;break e}M=M.return}if(tt===null)throw Error(a(160));ty(m,S,f),tt=null,Xt=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)sy(i,t),i=i.sibling}var Rn=null;function sy(t,i){var l=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Kt(i,t),Zt(t),r&4&&(Pi(3,t,t.return),co(3,t),Pi(5,t,t.return));break;case 1:Kt(i,t),Zt(t),r&512&&(St||l===null||Pn(l,l.return)),r&64&&xi&&(t=t.updateQueue,t!==null&&(r=t.callbacks,r!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?r:l.concat(r))));break;case 26:var f=Rn;if(Kt(i,t),Zt(t),r&512&&(St||l===null||Pn(l,l.return)),r&4){var m=l!==null?l.memoizedState:null;if(r=t.memoizedState,l===null)if(r===null)if(t.stateNode===null){e:{r=t.type,l=t.memoizedProps,f=f.ownerDocument||f;t:switch(r){case"title":m=f.getElementsByTagName("title")[0],(!m||m[vn]||m[J]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(r),f.head.insertBefore(m,f.querySelector("head > title"))),kt(m,r,l),m[J]=t,gt(m),r=m;break e;case"link":var S=s0("link","href",f).get(r+(l.href||""));if(S){for(var M=0;M<S.length;M++)if(m=S[M],m.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&m.getAttribute("rel")===(l.rel==null?null:l.rel)&&m.getAttribute("title")===(l.title==null?null:l.title)&&m.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){S.splice(M,1);break t}}m=f.createElement(r),kt(m,r,l),f.head.appendChild(m);break;case"meta":if(S=s0("meta","content",f).get(r+(l.content||""))){for(M=0;M<S.length;M++)if(m=S[M],m.getAttribute("content")===(l.content==null?null:""+l.content)&&m.getAttribute("name")===(l.name==null?null:l.name)&&m.getAttribute("property")===(l.property==null?null:l.property)&&m.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&m.getAttribute("charset")===(l.charSet==null?null:l.charSet)){S.splice(M,1);break t}}m=f.createElement(r),kt(m,r,l),f.head.appendChild(m);break;default:throw Error(a(468,r))}m[J]=t,gt(m),r=m}t.stateNode=r}else a0(f,t.type,t.stateNode);else t.stateNode=i0(f,r,t.memoizedProps);else m!==r?(m===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):m.count--,r===null?a0(f,t.type,t.stateNode):i0(f,r,t.memoizedProps)):r===null&&t.stateNode!==null&&ud(t,t.memoizedProps,l.memoizedProps)}break;case 27:Kt(i,t),Zt(t),r&512&&(St||l===null||Pn(l,l.return)),l!==null&&r&4&&ud(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Kt(i,t),Zt(t),r&512&&(St||l===null||Pn(l,l.return)),t.flags&32){f=t.stateNode;try{da(f,"")}catch(ye){Ve(t,t.return,ye)}}r&4&&t.stateNode!=null&&(f=t.memoizedProps,ud(t,f,l!==null?l.memoizedProps:f)),r&1024&&(hd=!0);break;case 6:if(Kt(i,t),Zt(t),r&4){if(t.stateNode===null)throw Error(a(162));r=t.memoizedProps,l=t.stateNode;try{l.nodeValue=r}catch(ye){Ve(t,t.return,ye)}}break;case 3:if(bc=null,f=Rn,Rn=yc(i.containerInfo),Kt(i,t),Rn=f,Zt(t),r&4&&l!==null&&l.memoizedState.isDehydrated)try{Va(i.containerInfo)}catch(ye){Ve(t,t.return,ye)}hd&&(hd=!1,ay(t));break;case 4:r=Rn,Rn=yc(t.stateNode.containerInfo),Kt(i,t),Zt(t),Rn=r;break;case 12:Kt(i,t),Zt(t);break;case 31:Kt(i,t),Zt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,ic(t,r)));break;case 13:Kt(i,t),Zt(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(ac=Ke()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,ic(t,r)));break;case 22:f=t.memoizedState!==null;var I=l!==null&&l.memoizedState!==null,ee=xi,re=St;if(xi=ee||f,St=re||I,Kt(i,t),St=re,xi=ee,Zt(t),r&8192)e:for(i=t.stateNode,i._visibility=f?i._visibility&-2:i._visibility|1,f&&(l===null||I||xi||St||Ls(t)),l=null,i=t;;){if(i.tag===5||i.tag===26){if(l===null){I=l=i;try{if(m=I.stateNode,f)S=m.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{M=I.stateNode;var ue=I.memoizedProps.style,ne=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;M.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(ye){Ve(I,I.return,ye)}}}else if(i.tag===6){if(l===null){I=i;try{I.stateNode.nodeValue=f?"":I.memoizedProps}catch(ye){Ve(I,I.return,ye)}}}else if(i.tag===18){if(l===null){I=i;try{var ae=I.stateNode;f?Zy(ae,!0):Zy(I.stateNode,!1)}catch(ye){Ve(I,I.return,ye)}}}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;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}r&4&&(r=t.updateQueue,r!==null&&(l=r.retryQueue,l!==null&&(r.retryQueue=null,ic(t,l))));break;case 19:Kt(i,t),Zt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,ic(t,r)));break;case 30:break;case 21:break;default:Kt(i,t),Zt(t)}}function Zt(t){var i=t.flags;if(i&2){try{for(var l,r=t.return;r!==null;){if(Fg(r)){l=r;break}r=r.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var f=l.stateNode,m=fd(t);nc(t,m,f);break;case 5:var S=l.stateNode;l.flags&32&&(da(S,""),l.flags&=-33);var M=fd(t);nc(t,M,S);break;case 3:case 4:var I=l.stateNode.containerInfo,ee=fd(t);dd(t,ee,I);break;default:throw Error(a(161))}}catch(re){Ve(t,t.return,re)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function ay(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;ay(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function Ni(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Pg(t,i.alternate,i),i=i.sibling}function Ls(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:Pi(4,i,i.return),Ls(i);break;case 1:Pn(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&Zg(i,i.return,l),Ls(i);break;case 27:So(i.stateNode);case 26:case 5:Pn(i,i.return),Ls(i);break;case 22:i.memoizedState===null&&Ls(i);break;case 30:Ls(i);break;default:Ls(i)}t=t.sibling}}function _i(t,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var r=i.alternate,f=t,m=i,S=m.flags;switch(m.tag){case 0:case 11:case 15:_i(f,m,l),co(4,m);break;case 1:if(_i(f,m,l),r=m,f=r.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(ee){Ve(r,r.return,ee)}if(r=m,f=r.updateQueue,f!==null){var M=r.stateNode;try{var I=f.shared.hiddenCallbacks;if(I!==null)for(f.shared.hiddenCallbacks=null,f=0;f<I.length;f++)Bp(I[f],M)}catch(ee){Ve(r,r.return,ee)}}l&&S&64&&Kg(m),uo(m,m.return);break;case 27:Jg(m);case 26:case 5:_i(f,m,l),l&&r===null&&S&4&&Qg(m),uo(m,m.return);break;case 12:_i(f,m,l);break;case 31:_i(f,m,l),l&&S&4&&ny(f,m);break;case 13:_i(f,m,l),l&&S&4&&iy(f,m);break;case 22:m.memoizedState===null&&_i(f,m,l),uo(m,m.return);break;case 30:break;default:_i(f,m,l)}i=i.sibling}}function md(t,i){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&Fl(l))}function pd(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Fl(t))}function Bn(t,i,l,r){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)ly(t,i,l,r),i=i.sibling}function ly(t,i,l,r){var f=i.flags;switch(i.tag){case 0:case 11:case 15:Bn(t,i,l,r),f&2048&&co(9,i);break;case 1:Bn(t,i,l,r);break;case 3:Bn(t,i,l,r),f&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Fl(t)));break;case 12:if(f&2048){Bn(t,i,l,r),t=i.stateNode;try{var m=i.memoizedProps,S=m.id,M=m.onPostCommit;typeof M=="function"&&M(S,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(I){Ve(i,i.return,I)}}else Bn(t,i,l,r);break;case 31:Bn(t,i,l,r);break;case 13:Bn(t,i,l,r);break;case 23:break;case 22:m=i.stateNode,S=i.alternate,i.memoizedState!==null?m._visibility&2?Bn(t,i,l,r):fo(t,i):m._visibility&2?Bn(t,i,l,r):(m._visibility|=2,za(t,i,l,r,(i.subtreeFlags&10256)!==0||!1)),f&2048&&md(S,i);break;case 24:Bn(t,i,l,r),f&2048&&pd(i.alternate,i);break;default:Bn(t,i,l,r)}}function za(t,i,l,r,f){for(f=f&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var m=t,S=i,M=l,I=r,ee=S.flags;switch(S.tag){case 0:case 11:case 15:za(m,S,M,I,f),co(8,S);break;case 23:break;case 22:var re=S.stateNode;S.memoizedState!==null?re._visibility&2?za(m,S,M,I,f):fo(m,S):(re._visibility|=2,za(m,S,M,I,f)),f&&ee&2048&&md(S.alternate,S);break;case 24:za(m,S,M,I,f),f&&ee&2048&&pd(S.alternate,S);break;default:za(m,S,M,I,f)}i=i.sibling}}function fo(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=t,r=i,f=r.flags;switch(r.tag){case 22:fo(l,r),f&2048&&md(r.alternate,r);break;case 24:fo(l,r),f&2048&&pd(r.alternate,r);break;default:fo(l,r)}i=i.sibling}}var ho=8192;function Da(t,i,l){if(t.subtreeFlags&ho)for(t=t.child;t!==null;)oy(t,i,l),t=t.sibling}function oy(t,i,l){switch(t.tag){case 26:Da(t,i,l),t.flags&ho&&t.memoizedState!==null&&pE(l,Rn,t.memoizedState,t.memoizedProps);break;case 5:Da(t,i,l);break;case 3:case 4:var r=Rn;Rn=yc(t.stateNode.containerInfo),Da(t,i,l),Rn=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=ho,ho=16777216,Da(t,i,l),ho=r):Da(t,i,l));break;default:Da(t,i,l)}}function ry(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 mo(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var r=i[l];Nt=r,uy(r,t)}ry(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)cy(t),t=t.sibling}function cy(t){switch(t.tag){case 0:case 11:case 15:mo(t),t.flags&2048&&Pi(9,t,t.return);break;case 3:mo(t);break;case 12:mo(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,sc(t)):mo(t);break;default:mo(t)}}function sc(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var r=i[l];Nt=r,uy(r,t)}ry(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:Pi(8,i,i.return),sc(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,sc(i));break;default:sc(i)}t=t.sibling}}function uy(t,i){for(;Nt!==null;){var l=Nt;switch(l.tag){case 0:case 11:case 15:Pi(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var r=l.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Fl(l.memoizedState.cache)}if(r=l.child,r!==null)r.return=l,Nt=r;else e:for(l=t;Nt!==null;){r=Nt;var f=r.sibling,m=r.return;if(ey(r),r===l){Nt=null;break e}if(f!==null){f.return=m,Nt=f;break e}Nt=m}}}var Ox={getCacheForType:function(t){var i=Mt(yt),l=i.data.get(t);return l===void 0&&(l=t(),i.data.set(t,l)),l},cacheSignal:function(){return Mt(yt).controller.signal}},kx=typeof WeakMap=="function"?WeakMap:Map,$e=0,Ze=null,Oe=null,ze=0,qe=0,on=null,es=!1,ja=!1,gd=!1,Ai=0,ct=0,ts=0,$s=0,yd=0,rn=0,Ra=0,po=null,Qt=null,vd=!1,ac=0,fy=0,lc=1/0,oc=null,ns=null,Et=0,is=null,Ba=null,Ti=0,bd=0,Sd=null,dy=null,go=0,wd=null;function cn(){return($e&2)!==0&&ze!==0?ze&-ze:O.T!==null?Td():la()}function hy(){if(rn===0)if((ze&536870912)===0||je){var t=ri;ri<<=1,(ri&3932160)===0&&(ri=262144),rn=t}else rn=536870912;return t=an.current,t!==null&&(t.flags|=32),rn}function Ft(t,i,l){(t===Ze&&(qe===2||qe===9)||t.cancelPendingCommit!==null)&&(La(t,0),ss(t,ze,rn,!1)),zn(t,l),(($e&2)===0||t!==Ze)&&(t===Ze&&(($e&2)===0&&($s|=l),ct===4&&ss(t,ze,rn,!1)),ei(t))}function my(t,i,l){if(($e&6)!==0)throw Error(a(327));var r=!l&&(i&127)===0&&(i&t.expiredLanes)===0||ft(t,i),f=r?jx(t,i):Ed(t,i,!0),m=r;do{if(f===0){ja&&!r&&ss(t,i,0,!1);break}else{if(l=t.current.alternate,m&&!zx(l)){f=Ed(t,i,!1),m=!1;continue}if(f===2){if(m=i,t.errorRecoveryDisabledLanes&m)var S=0;else S=t.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){i=S;e:{var M=t;f=po;var I=M.current.memoizedState.isDehydrated;if(I&&(La(M,S).flags|=256),S=Ed(M,S,!1),S!==2){if(gd&&!I){M.errorRecoveryDisabledLanes|=m,$s|=m,f=4;break e}m=Qt,Qt=f,m!==null&&(Qt===null?Qt=m:Qt.push.apply(Qt,m))}f=S}if(m=!1,f!==2)continue}}if(f===1){La(t,0),ss(t,i,0,!0);break}e:{switch(r=t,m=f,m){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:ss(r,i,rn,!es);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(f=ac+300-Ke(),10<f)){if(ss(r,i,rn,!es),ci(r,0,!0)!==0)break e;Ti=i,r.timeoutHandle=Gy(py.bind(null,r,l,Qt,oc,vd,i,rn,$s,Ra,es,m,"Throttled",-0,0),f);break e}py(r,l,Qt,oc,vd,i,rn,$s,Ra,es,m,null,-0,0)}}break}while(!0);ei(t)}function py(t,i,l,r,f,m,S,M,I,ee,re,ue,ne,ae){if(t.timeoutHandle=-1,ue=i.subtreeFlags,ue&8192||(ue&16785408)===16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:di},oy(i,m,ue);var ye=(m&62914560)===m?ac-Ke():(m&4194048)===m?fy-Ke():0;if(ye=gE(ue,ye),ye!==null){Ti=m,t.cancelPendingCommit=ye(Ey.bind(null,t,i,m,l,r,f,S,M,I,re,ue,null,ne,ae)),ss(t,m,S,!ee);return}}Ey(t,i,m,l,r,f,S,M,I)}function zx(t){for(var i=t;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var r=0;r<l.length;r++){var f=l[r],m=f.getSnapshot;f=f.value;try{if(!nn(m(),f))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;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 ss(t,i,l,r){i&=~yd,i&=~$s,t.suspendedLanes|=i,t.pingedLanes&=~i,r&&(t.warmLanes|=i),r=t.expirationTimes;for(var f=i;0<f;){var m=31-At(f),S=1<<m;r[m]=-1,f&=~S}l!==0&&gn(t,l,i)}function rc(){return($e&6)===0?(yo(0),!1):!0}function xd(){if(Oe!==null){if(qe===0)var t=Oe.return;else t=Oe,gi=Ms=null,$f(t),Ta=null,Wl=0,t=Oe;for(;t!==null;)Xg(t.alternate,t),t=t.return;Oe=null}}function La(t,i){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,Wx(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Ti=0,xd(),Ze=t,Oe=l=mi(t.current,null),ze=i,qe=0,on=null,es=!1,ja=ft(t,i),gd=!1,Ra=rn=yd=$s=ts=ct=0,Qt=po=null,vd=!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-At(r),m=1<<f;i|=t[f],r&=~m}return Ai=i,Mr(),l}function gy(t,i){Te=null,O.H=lo,i===Aa||i===Lr?(i=zp(),qe=3):i===Af?(i=zp(),qe=4):qe=i===ed?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,on=i,Oe===null&&(ct=1,Jr(t,Sn(i,t.current)))}function yy(){var t=an.current;return t===null?!0:(ze&4194048)===ze?Nn===null:(ze&62914560)===ze||(ze&536870912)!==0?t===Nn:!1}function vy(){var t=O.H;return O.H=lo,t===null?lo:t}function by(){var t=O.A;return O.A=Ox,t}function cc(){ct=4,es||(ze&4194048)!==ze&&an.current!==null||(ja=!0),(ts&134217727)===0&&($s&134217727)===0||Ze===null||ss(Ze,ze,rn,!1)}function Ed(t,i,l){var r=$e;$e|=2;var f=vy(),m=by();(Ze!==t||ze!==i)&&(oc=null,La(t,i)),i=!1;var S=ct;e:do try{if(qe!==0&&Oe!==null){var M=Oe,I=on;switch(qe){case 8:xd(),S=6;break e;case 3:case 2:case 9:case 6:an.current===null&&(i=!0);var ee=qe;if(qe=0,on=null,$a(t,M,I,ee),l&&ja){S=0;break e}break;default:ee=qe,qe=0,on=null,$a(t,M,I,ee)}}Dx(),S=ct;break}catch(re){gy(t,re)}while(!0);return i&&t.shellSuspendCounter++,gi=Ms=null,$e=r,O.H=f,O.A=m,Oe===null&&(Ze=null,ze=0,Mr()),S}function Dx(){for(;Oe!==null;)Sy(Oe)}function jx(t,i){var l=$e;$e|=2;var r=vy(),f=by();Ze!==t||ze!==i?(oc=null,lc=Ke()+500,La(t,i)):ja=ft(t,i);e:do try{if(qe!==0&&Oe!==null){i=Oe;var m=on;t:switch(qe){case 1:qe=0,on=null,$a(t,i,m,1);break;case 2:case 9:if(Op(m)){qe=0,on=null,wy(i);break}i=function(){qe!==2&&qe!==9||Ze!==t||(qe=7),ei(t)},m.then(i,i);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:Op(m)?(qe=0,on=null,wy(i)):(qe=0,on=null,$a(t,i,m,7));break;case 5:var S=null;switch(Oe.tag){case 26:S=Oe.memoizedState;case 5:case 27:var M=Oe;if(S?l0(S):M.stateNode.complete){qe=0,on=null;var I=M.sibling;if(I!==null)Oe=I;else{var ee=M.return;ee!==null?(Oe=ee,uc(ee)):Oe=null}break t}}qe=0,on=null,$a(t,i,m,5);break;case 6:qe=0,on=null,$a(t,i,m,6);break;case 8:xd(),ct=6;break e;default:throw Error(a(462))}}Rx();break}catch(re){gy(t,re)}while(!0);return gi=Ms=null,O.H=r,O.A=f,$e=l,Oe!==null?0:(Ze=null,ze=0,Mr(),ct)}function Rx(){for(;Oe!==null&&!kn();)Sy(Oe)}function Sy(t){var i=Yg(t.alternate,t,Ai);t.memoizedProps=t.pendingProps,i===null?uc(t):Oe=i}function wy(t){var i=t,l=i.alternate;switch(i.tag){case 15:case 0:i=$g(l,i,i.pendingProps,i.type,void 0,ze);break;case 11:i=$g(l,i,i.pendingProps,i.type.render,i.ref,ze);break;case 5:$f(i);default:Xg(l,i),i=Oe=bp(i,Ai),i=Yg(l,i,Ai)}t.memoizedProps=t.pendingProps,i===null?uc(t):Oe=i}function $a(t,i,l,r){gi=Ms=null,$f(i),Ta=null,Wl=0;var f=i.return;try{if(Ex(t,f,i,l,ze)){ct=1,Jr(t,Sn(l,t.current)),Oe=null;return}}catch(m){if(f!==null)throw Oe=f,m;ct=1,Jr(t,Sn(l,t.current)),Oe=null;return}i.flags&32768?(je||r===1?t=!0:ja||(ze&536870912)!==0?t=!1:(es=t=!0,(r===2||r===9||r===3||r===6)&&(r=an.current,r!==null&&r.tag===13&&(r.flags|=16384))),xy(i,t)):uc(i)}function uc(t){var i=t;do{if((i.flags&32768)!==0){xy(i,es);return}t=i.return;var l=Ax(i.alternate,i,Ai);if(l!==null){Oe=l;return}if(i=i.sibling,i!==null){Oe=i;return}Oe=i=t}while(i!==null);ct===0&&(ct=5)}function xy(t,i){do{var l=Tx(t.alternate,t);if(l!==null){l.flags&=32767,Oe=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(t=t.sibling,t!==null)){Oe=t;return}Oe=t=l}while(t!==null);ct=6,Oe=null}function Ey(t,i,l,r,f,m,S,M,I){t.cancelPendingCommit=null;do fc();while(Et!==0);if(($e&6)!==0)throw Error(a(327));if(i!==null){if(i===t.current)throw Error(a(177));if(m=i.lanes|i.childLanes,m|=ff,kl(t,l,m,S,M,I),t===Ze&&(Oe=Ze=null,ze=0),Ba=i,is=t,Ti=l,bd=m,Sd=f,dy=r,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Hx(jt,function(){return Cy(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||r){r=O.T,O.T=null,f=H.p,H.p=2,S=$e,$e|=4;try{Cx(t,i,l)}finally{$e=S,H.p=f,O.T=r}}Et=1,Ny(),_y(),Ay()}}function Ny(){if(Et===1){Et=0;var t=is,i=Ba,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=O.T,O.T=null;var r=H.p;H.p=2;var f=$e;$e|=4;try{sy(i,t);var m=Rd,S=up(t.containerInfo),M=m.focusedElem,I=m.selectionRange;if(S!==M&&M&&M.ownerDocument&&cp(M.ownerDocument.documentElement,M)){if(I!==null&&lf(M)){var ee=I.start,re=I.end;if(re===void 0&&(re=ee),"selectionStart"in M)M.selectionStart=ee,M.selectionEnd=Math.min(re,M.value.length);else{var ue=M.ownerDocument||document,ne=ue&&ue.defaultView||window;if(ne.getSelection){var ae=ne.getSelection(),ye=M.textContent.length,Ee=Math.min(I.start,ye),Xe=I.end===void 0?Ee:Math.min(I.end,ye);!ae.extend&&Ee>Xe&&(S=Xe,Xe=Ee,Ee=S);var Q=rp(M,Ee),G=rp(M,Xe);if(Q&&G&&(ae.rangeCount!==1||ae.anchorNode!==Q.node||ae.anchorOffset!==Q.offset||ae.focusNode!==G.node||ae.focusOffset!==G.offset)){var W=ue.createRange();W.setStart(Q.node,Q.offset),ae.removeAllRanges(),Ee>Xe?(ae.addRange(W),ae.extend(G.node,G.offset)):(W.setEnd(G.node,G.offset),ae.addRange(W))}}}}for(ue=[],ae=M;ae=ae.parentNode;)ae.nodeType===1&&ue.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<ue.length;M++){var ce=ue[M];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Ec=!!jd,Rd=jd=null}finally{$e=f,H.p=r,O.T=l}}t.current=i,Et=2}}function _y(){if(Et===2){Et=0;var t=is,i=Ba,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=O.T,O.T=null;var r=H.p;H.p=2;var f=$e;$e|=4;try{Pg(t,i.alternate,i)}finally{$e=f,H.p=r,O.T=l}}Et=3}}function Ay(){if(Et===4||Et===3){Et=0,_t();var t=is,i=Ba,l=Ti,r=dy;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Et=5:(Et=0,Ba=is=null,Ty(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(ns=null),xs(l),i=i.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(It,i,void 0,(i.current.flags&128)===128)}catch{}if(r!==null){i=O.T,f=H.p,H.p=2,O.T=null;try{for(var m=t.onRecoverableError,S=0;S<r.length;S++){var M=r[S];m(M.value,{componentStack:M.stack})}}finally{O.T=i,H.p=f}}(Ti&3)!==0&&fc(),ei(t),f=t.pendingLanes,(l&261930)!==0&&(f&42)!==0?t===wd?go++:(go=0,wd=t):go=0,yo(0)}}function Ty(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,Fl(i)))}function fc(){return Ny(),_y(),Ay(),Cy()}function Cy(){if(Et!==5)return!1;var t=is,i=bd;bd=0;var l=xs(Ti),r=O.T,f=H.p;try{H.p=32>l?32:l,O.T=null,l=Sd,Sd=null;var m=is,S=Ti;if(Et=0,Ba=is=null,Ti=0,($e&6)!==0)throw Error(a(331));var M=$e;if($e|=4,cy(m.current),ly(m,m.current,S,l),$e=M,yo(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(It,m)}catch{}return!0}finally{H.p=f,O.T=r,Ty(t,i)}}function My(t,i,l){i=Sn(l,i),i=Pf(t.stateNode,i,2),t=Fi(t,i,2),t!==null&&(zn(t,2),ei(t))}function Ve(t,i,l){if(t.tag===3)My(t,t,l);else for(;i!==null;){if(i.tag===3){My(i,t,l);break}else if(i.tag===1){var r=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ns===null||!ns.has(r))){t=Sn(l,t),l=Og(2),r=Fi(i,l,2),r!==null&&(kg(l,r,i,t),zn(r,2),ei(r));break}}i=i.return}}function Nd(t,i,l){var r=t.pingCache;if(r===null){r=t.pingCache=new kx;var f=new Set;r.set(i,f)}else f=r.get(i),f===void 0&&(f=new Set,r.set(i,f));f.has(l)||(gd=!0,f.add(l),t=Bx.bind(null,t,i,l),i.then(t,t))}function Bx(t,i,l){var r=t.pingCache;r!==null&&r.delete(i),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,Ze===t&&(ze&l)===l&&(ct===4||ct===3&&(ze&62914560)===ze&&300>Ke()-ac?($e&2)===0&&La(t,0):yd|=l,Ra===ze&&(Ra=0)),ei(t)}function Oy(t,i){i===0&&(i=Tt()),t=As(t,i),t!==null&&(zn(t,i),ei(t))}function Lx(t){var i=t.memoizedState,l=0;i!==null&&(l=i.retryLane),Oy(t,l)}function $x(t,i){var l=0;switch(t.tag){case 31:case 13:var r=t.stateNode,f=t.memoizedState;f!==null&&(l=f.retryLane);break;case 19:r=t.stateNode;break;case 22:r=t.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(i),Oy(t,l)}function Hx(t,i){return xt(t,i)}var dc=null,Ha=null,_d=!1,hc=!1,Ad=!1,as=0;function ei(t){t!==Ha&&t.next===null&&(Ha===null?dc=Ha=t:Ha=Ha.next=t),hc=!0,_d||(_d=!0,Ix())}function yo(t,i){if(!Ad&&hc){Ad=!0;do for(var l=!1,r=dc;r!==null;){if(t!==0){var f=r.pendingLanes;if(f===0)var m=0;else{var S=r.suspendedLanes,M=r.pingedLanes;m=(1<<31-At(42|t)+1)-1,m&=f&~(S&~M),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(l=!0,jy(r,m))}else m=ze,m=ci(r,r===Ze?m:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(m&3)===0||ft(r,m)||(l=!0,jy(r,m));r=r.next}while(l);Ad=!1}}function Ux(){ky()}function ky(){hc=_d=!1;var t=0;as!==0&&Jx()&&(t=as);for(var i=Ke(),l=null,r=dc;r!==null;){var f=r.next,m=zy(r,i);m===0?(r.next=null,l===null?dc=f:l.next=f,f===null&&(Ha=l)):(l=r,(t!==0||(m&3)!==0)&&(hc=!0)),r=f}Et!==0&&Et!==5||yo(t),as!==0&&(as=0)}function zy(t,i){for(var l=t.suspendedLanes,r=t.pingedLanes,f=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var S=31-At(m),M=1<<S,I=f[S];I===-1?((M&l)===0||(M&r)!==0)&&(f[S]=ia(M,i)):I<=i&&(t.expiredLanes|=M),m&=~M}if(i=Ze,l=ze,l=ci(t,t===i?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,l===0||t===i&&(qe===2||qe===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&Dt(r),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||ft(t,l)){if(i=l&-l,i===t.callbackPriority)return i;switch(r!==null&&Dt(r),xs(l)){case 2:case 8:l=Lt;break;case 32:l=jt;break;case 268435456:l=mn;break;default:l=jt}return r=Dy.bind(null,t),l=xt(l,r),t.callbackPriority=i,t.callbackNode=l,i}return r!==null&&r!==null&&Dt(r),t.callbackPriority=2,t.callbackNode=null,2}function Dy(t,i){if(Et!==0&&Et!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(fc()&&t.callbackNode!==l)return null;var r=ze;return r=ci(t,t===Ze?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(my(t,r,i),zy(t,Ke()),t.callbackNode!=null&&t.callbackNode===l?Dy.bind(null,t):null)}function jy(t,i){if(fc())return null;my(t,i,!0)}function Ix(){Px(function(){($e&6)!==0?xt(Ut,Ux):ky()})}function Td(){if(as===0){var t=Na;t===0&&(t=Qn,Qn<<=1,(Qn&261888)===0&&(Qn=256)),as=t}return as}function Ry(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:wr(""+t)}function By(t,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,t.id&&l.setAttribute("form",t.id),i.parentNode.insertBefore(l,i),t=new FormData(t),l.parentNode.removeChild(l),t}function qx(t,i,l,r,f){if(i==="submit"&&l&&l.stateNode===f){var m=Ry((f[he]||null).action),S=r.submitter;S&&(i=(i=S[he]||null)?Ry(i.formAction):S.getAttribute("formAction"),i!==null&&(m=i,S=null));var M=new _r("action","action",null,r,f);t.push({event:M,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(as!==0){var I=S?By(f,S):new FormData(f);Kf(l,{pending:!0,data:I,method:f.method,action:m},null,I)}}else typeof m=="function"&&(M.preventDefault(),I=S?By(f,S):new FormData(f),Kf(l,{pending:!0,data:I,method:f.method,action:m},m,I))},currentTarget:f}]})}}for(var Cd=0;Cd<uf.length;Cd++){var Md=uf[Cd],Vx=Md.toLowerCase(),Yx=Md[0].toUpperCase()+Md.slice(1);jn(Vx,"on"+Yx)}jn(hp,"onAnimationEnd"),jn(mp,"onAnimationIteration"),jn(pp,"onAnimationStart"),jn("dblclick","onDoubleClick"),jn("focusin","onFocus"),jn("focusout","onBlur"),jn(lx,"onTransitionRun"),jn(ox,"onTransitionStart"),jn(rx,"onTransitionCancel"),jn(gp,"onTransitionEnd"),Ii("onMouseEnter",["mouseout","mouseover"]),Ii("onMouseLeave",["mouseout","mouseover"]),Ii("onPointerEnter",["pointerout","pointerover"]),Ii("onPointerLeave",["pointerout","pointerover"]),fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fi("onBeforeInput",["compositionend","keypress","textInput","paste"]),fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vo="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(" "),Gx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vo));function Ly(t,i){i=(i&4)!==0;for(var l=0;l<t.length;l++){var r=t[l],f=r.event;r=r.listeners;e:{var m=void 0;if(i)for(var S=r.length-1;0<=S;S--){var M=r[S],I=M.instance,ee=M.currentTarget;if(M=M.listener,I!==m&&f.isPropagationStopped())break e;m=M,f.currentTarget=ee;try{m(f)}catch(re){Cr(re)}f.currentTarget=null,m=I}else for(S=0;S<r.length;S++){if(M=r[S],I=M.instance,ee=M.currentTarget,M=M.listener,I!==m&&f.isPropagationStopped())break e;m=M,f.currentTarget=ee;try{m(f)}catch(re){Cr(re)}f.currentTarget=null,m=I}}}}function ke(t,i){var l=i[Ie];l===void 0&&(l=i[Ie]=new Set);var r=t+"__bubble";l.has(r)||($y(i,t,2,!1),l.add(r))}function Od(t,i,l){var r=0;i&&(r|=4),$y(l,t,r,i)}var mc="_reactListening"+Math.random().toString(36).slice(2);function kd(t){if(!t[mc]){t[mc]=!0,gr.forEach(function(l){l!=="selectionchange"&&(Gx.has(l)||Od(l,!1,t),Od(l,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[mc]||(i[mc]=!0,Od("selectionchange",!1,i))}}function $y(t,i,l,r){switch(h0(i)){case 2:var f=bE;break;case 8:f=SE;break;default:f=Xd}l=f.bind(null,i,l,t),f=void 0,!Fu||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(f=!0),r?f!==void 0?t.addEventListener(i,l,{capture:!0,passive:f}):t.addEventListener(i,l,!0):f!==void 0?t.addEventListener(i,l,{passive:f}):t.addEventListener(i,l,!1)}function zd(t,i,l,r,f){var m=r;if((i&1)===0&&(i&2)===0&&r!==null)e:for(;;){if(r===null)return;var S=r.tag;if(S===3||S===4){var M=r.stateNode.containerInfo;if(M===f)break;if(S===4)for(S=r.return;S!==null;){var I=S.tag;if((I===3||I===4)&&S.stateNode.containerInfo===f)return;S=S.return}for(;M!==null;){if(S=Li(M),S===null)return;if(I=S.tag,I===5||I===6||I===26||I===27){r=m=S;continue e}M=M.parentNode}}r=r.return}Vm(function(){var ee=m,re=Zu(l),ue=[];e:{var ne=yp.get(t);if(ne!==void 0){var ae=_r,ye=t;switch(t){case"keypress":if(Er(l)===0)break e;case"keydown":case"keyup":ae=$w;break;case"focusin":ye="focus",ae=ef;break;case"focusout":ye="blur",ae=ef;break;case"beforeblur":case"afterblur":ae=ef;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=Xm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=Aw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=Iw;break;case hp:case mp:case pp:ae=Mw;break;case gp:ae=Vw;break;case"scroll":case"scrollend":ae=Nw;break;case"wheel":ae=Gw;break;case"copy":case"cut":case"paste":ae=kw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=Zm;break;case"toggle":case"beforetoggle":ae=Kw}var Ee=(i&4)!==0,Xe=!Ee&&(t==="scroll"||t==="scrollend"),Q=Ee?ne!==null?ne+"Capture":null:ne;Ee=[];for(var G=ee,W;G!==null;){var ce=G;if(W=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||W===null||Q===null||(ce=Hl(G,Q),ce!=null&&Ee.push(bo(G,ce,W))),Xe)break;G=G.return}0<Ee.length&&(ne=new ae(ne,ye,null,l,re),ue.push({event:ne,listeners:Ee}))}}if((i&7)===0){e:{if(ne=t==="mouseover"||t==="pointerover",ae=t==="mouseout"||t==="pointerout",ne&&l!==Ku&&(ye=l.relatedTarget||l.fromElement)&&(Li(ye)||ye[Ne]))break e;if((ae||ne)&&(ne=re.window===re?re:(ne=re.ownerDocument)?ne.defaultView||ne.parentWindow:window,ae?(ye=l.relatedTarget||l.toElement,ae=ee,ye=ye?Li(ye):null,ye!==null&&(Xe=c(ye),Ee=ye.tag,ye!==Xe||Ee!==5&&Ee!==27&&Ee!==6)&&(ye=null)):(ae=null,ye=ee),ae!==ye)){if(Ee=Xm,ce="onMouseLeave",Q="onMouseEnter",G="mouse",(t==="pointerout"||t==="pointerover")&&(Ee=Zm,ce="onPointerLeave",Q="onPointerEnter",G="pointer"),Xe=ae==null?ne:Hi(ae),W=ye==null?ne:Hi(ye),ne=new Ee(ce,G+"leave",ae,l,re),ne.target=Xe,ne.relatedTarget=W,ce=null,Li(re)===ee&&(Ee=new Ee(Q,G+"enter",ye,l,re),Ee.target=W,Ee.relatedTarget=Xe,ce=Ee),Xe=ce,ae&&ye)t:{for(Ee=Xx,Q=ae,G=ye,W=0,ce=Q;ce;ce=Ee(ce))W++;ce=0;for(var we=G;we;we=Ee(we))ce++;for(;0<W-ce;)Q=Ee(Q),W--;for(;0<ce-W;)G=Ee(G),ce--;for(;W--;){if(Q===G||G!==null&&Q===G.alternate){Ee=Q;break t}Q=Ee(Q),G=Ee(G)}Ee=null}else Ee=null;ae!==null&&Hy(ue,ne,ae,Ee,!1),ye!==null&&Xe!==null&&Hy(ue,Xe,ye,Ee,!0)}}e:{if(ne=ee?Hi(ee):window,ae=ne.nodeName&&ne.nodeName.toLowerCase(),ae==="select"||ae==="input"&&ne.type==="file")var Be=np;else if(ep(ne))if(ip)Be=ix;else{Be=tx;var be=ex}else ae=ne.nodeName,!ae||ae.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?ee&&Xu(ee.elementType)&&(Be=np):Be=nx;if(Be&&(Be=Be(t,ee))){tp(ue,Be,l,re);break e}be&&be(t,ne,ee),t==="focusout"&&ee&&ne.type==="number"&&ee.memoizedProps.value!=null&&Ll(ne,"number",ne.value)}switch(be=ee?Hi(ee):window,t){case"focusin":(ep(be)||be.contentEditable==="true")&&(ga=be,of=ee,Kl=null);break;case"focusout":Kl=of=ga=null;break;case"mousedown":rf=!0;break;case"contextmenu":case"mouseup":case"dragend":rf=!1,fp(ue,l,re);break;case"selectionchange":if(ax)break;case"keydown":case"keyup":fp(ue,l,re)}var Me;if(nf)e:{switch(t){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else pa?Wm(t,l)&&(De="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(De="onCompositionStart");De&&(Qm&&l.locale!=="ko"&&(pa||De!=="onCompositionStart"?De==="onCompositionEnd"&&pa&&(Me=Ym()):(Vi=re,Ju="value"in Vi?Vi.value:Vi.textContent,pa=!0)),be=pc(ee,De),0<be.length&&(De=new Km(De,t,null,l,re),ue.push({event:De,listeners:be}),Me?De.data=Me:(Me=Pm(l),Me!==null&&(De.data=Me)))),(Me=Qw?Fw(t,l):Jw(t,l))&&(De=pc(ee,"onBeforeInput"),0<De.length&&(be=new Km("onBeforeInput","beforeinput",null,l,re),ue.push({event:be,listeners:De}),be.data=Me)),qx(ue,t,ee,l,re)}Ly(ue,i)})}function bo(t,i,l){return{instance:t,listener:i,currentTarget:l}}function pc(t,i){for(var l=i+"Capture",r=[];t!==null;){var f=t,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=Hl(t,l),f!=null&&r.unshift(bo(t,f,m)),f=Hl(t,i),f!=null&&r.push(bo(t,f,m))),t.tag===3)return r;t=t.return}return[]}function Xx(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Hy(t,i,l,r,f){for(var m=i._reactName,S=[];l!==null&&l!==r;){var M=l,I=M.alternate,ee=M.stateNode;if(M=M.tag,I!==null&&I===r)break;M!==5&&M!==26&&M!==27||ee===null||(I=ee,f?(ee=Hl(l,m),ee!=null&&S.unshift(bo(l,ee,I))):f||(ee=Hl(l,m),ee!=null&&S.push(bo(l,ee,I)))),l=l.return}S.length!==0&&t.push({event:i,listeners:S})}var Kx=/\r\n?/g,Zx=/\u0000|\uFFFD/g;function Uy(t){return(typeof t=="string"?t:""+t).replace(Kx,`
|
|
9
|
-
`).replace(Zx,"")}function Iy(t,i){return i=Uy(i),Uy(t)===i}function Ge(t,i,l,r,f,m){switch(l){case"children":typeof r=="string"?i==="body"||i==="textarea"&&r===""||da(t,r):(typeof r=="number"||typeof r=="bigint")&&i!=="body"&&da(t,""+r);break;case"className":ca(t,"class",r);break;case"tabIndex":ca(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":ca(t,l,r);break;case"style":Im(t,r,m);break;case"data":if(i!=="object"){ca(t,"data",r);break}case"src":case"href":if(r===""&&(i!=="a"||l!=="href")){t.removeAttribute(l);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(l);break}r=wr(""+r),t.setAttribute(l,r);break;case"action":case"formAction":if(typeof r=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(l==="formAction"?(i!=="input"&&Ge(t,i,"name",f.name,f,null),Ge(t,i,"formEncType",f.formEncType,f,null),Ge(t,i,"formMethod",f.formMethod,f,null),Ge(t,i,"formTarget",f.formTarget,f,null)):(Ge(t,i,"encType",f.encType,f,null),Ge(t,i,"method",f.method,f,null),Ge(t,i,"target",f.target,f,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(l);break}r=wr(""+r),t.setAttribute(l,r);break;case"onClick":r!=null&&(t.onclick=di);break;case"onScroll":r!=null&&ke("scroll",t);break;case"onScrollEnd":r!=null&&ke("scrollend",t);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(a(61));if(l=r.__html,l!=null){if(f.children!=null)throw Error(a(60));t.innerHTML=l}}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}l=wr(""+r),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(l,""+r):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":r===!0?t.setAttribute(l,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(l,r):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?t.setAttribute(l,r):t.removeAttribute(l);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?t.removeAttribute(l):t.setAttribute(l,r);break;case"popover":ke("beforetoggle",t),ke("toggle",t),ra(t,"popover",r);break;case"xlinkActuate":Dn(t,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Dn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Dn(t,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Dn(t,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Dn(t,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Dn(t,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Dn(t,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Dn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Dn(t,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":ra(t,"is",r);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=xw.get(l)||l,ra(t,l,r))}}function Dd(t,i,l,r,f,m){switch(l){case"style":Im(t,r,m);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(a(61));if(l=r.__html,l!=null){if(f.children!=null)throw Error(a(60));t.innerHTML=l}}break;case"children":typeof r=="string"?da(t,r):(typeof r=="number"||typeof r=="bigint")&&da(t,""+r);break;case"onScroll":r!=null&&ke("scroll",t);break;case"onScrollEnd":r!=null&&ke("scrollend",t);break;case"onClick":r!=null&&(t.onclick=di);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yr.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),i=l.slice(2,f?l.length-7:void 0),m=t[he]||null,m=m!=null?m[l]:null,typeof m=="function"&&t.removeEventListener(i,m,f),typeof r=="function")){typeof m!="function"&&m!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(i,r,f);break e}l in t?t[l]=r:r===!0?t.setAttribute(l,""):ra(t,l,r)}}}function kt(t,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",t),ke("load",t);var r=!1,f=!1,m;for(m in l)if(l.hasOwnProperty(m)){var S=l[m];if(S!=null)switch(m){case"src":r=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Ge(t,i,m,S,l,null)}}f&&Ge(t,i,"srcSet",l.srcSet,l,null),r&&Ge(t,i,"src",l.src,l,null);return;case"input":ke("invalid",t);var M=m=S=f=null,I=null,ee=null;for(r in l)if(l.hasOwnProperty(r)){var re=l[r];if(re!=null)switch(r){case"name":f=re;break;case"type":S=re;break;case"checked":I=re;break;case"defaultChecked":ee=re;break;case"value":m=re;break;case"defaultValue":M=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,i));break;default:Ge(t,i,r,re,l,null)}}fa(t,m,M,I,ee,S,f,!1);return;case"select":ke("invalid",t),r=S=m=null;for(f in l)if(l.hasOwnProperty(f)&&(M=l[f],M!=null))switch(f){case"value":m=M;break;case"defaultValue":S=M;break;case"multiple":r=M;default:Ge(t,i,f,M,l,null)}i=m,l=S,t.multiple=!!r,i!=null?qi(t,!!r,i,!1):l!=null&&qi(t,!!r,l,!0);return;case"textarea":ke("invalid",t),m=f=r=null;for(S in l)if(l.hasOwnProperty(S)&&(M=l[S],M!=null))switch(S){case"value":r=M;break;case"defaultValue":f=M;break;case"children":m=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(a(91));break;default:Ge(t,i,S,M,l,null)}Hm(t,r,f,m);return;case"option":for(I in l)l.hasOwnProperty(I)&&(r=l[I],r!=null)&&(I==="selected"?t.selected=r&&typeof r!="function"&&typeof r!="symbol":Ge(t,i,I,r,l,null));return;case"dialog":ke("beforetoggle",t),ke("toggle",t),ke("cancel",t),ke("close",t);break;case"iframe":case"object":ke("load",t);break;case"video":case"audio":for(r=0;r<vo.length;r++)ke(vo[r],t);break;case"image":ke("error",t),ke("load",t);break;case"details":ke("toggle",t);break;case"embed":case"source":case"link":ke("error",t),ke("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(ee in l)if(l.hasOwnProperty(ee)&&(r=l[ee],r!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Ge(t,i,ee,r,l,null)}return;default:if(Xu(i)){for(re in l)l.hasOwnProperty(re)&&(r=l[re],r!==void 0&&Dd(t,i,re,r,l,void 0));return}}for(M in l)l.hasOwnProperty(M)&&(r=l[M],r!=null&&Ge(t,i,M,r,l,null))}function Qx(t,i,l,r){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,S=null,M=null,I=null,ee=null,re=null;for(ae in l){var ue=l[ae];if(l.hasOwnProperty(ae)&&ue!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":I=ue;default:r.hasOwnProperty(ae)||Ge(t,i,ae,null,r,ue)}}for(var ne in r){var ae=r[ne];if(ue=l[ne],r.hasOwnProperty(ne)&&(ae!=null||ue!=null))switch(ne){case"type":m=ae;break;case"name":f=ae;break;case"checked":ee=ae;break;case"defaultChecked":re=ae;break;case"value":S=ae;break;case"defaultValue":M=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(a(137,i));break;default:ae!==ue&&Ge(t,i,ne,ae,r,ue)}}Bl(t,S,M,I,ee,re,m,f);return;case"select":ae=S=M=ne=null;for(m in l)if(I=l[m],l.hasOwnProperty(m)&&I!=null)switch(m){case"value":break;case"multiple":ae=I;default:r.hasOwnProperty(m)||Ge(t,i,m,null,r,I)}for(f in r)if(m=r[f],I=l[f],r.hasOwnProperty(f)&&(m!=null||I!=null))switch(f){case"value":ne=m;break;case"defaultValue":M=m;break;case"multiple":S=m;default:m!==I&&Ge(t,i,f,m,r,I)}i=M,l=S,r=ae,ne!=null?qi(t,!!l,ne,!1):!!r!=!!l&&(i!=null?qi(t,!!l,i,!0):qi(t,!!l,l?[]:"",!1));return;case"textarea":ae=ne=null;for(M in l)if(f=l[M],l.hasOwnProperty(M)&&f!=null&&!r.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:Ge(t,i,M,null,r,f)}for(S in r)if(f=r[S],m=l[S],r.hasOwnProperty(S)&&(f!=null||m!=null))switch(S){case"value":ne=f;break;case"defaultValue":ae=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(a(91));break;default:f!==m&&Ge(t,i,S,f,r,m)}$l(t,ne,ae);return;case"option":for(var ye in l)ne=l[ye],l.hasOwnProperty(ye)&&ne!=null&&!r.hasOwnProperty(ye)&&(ye==="selected"?t.selected=!1:Ge(t,i,ye,null,r,ne));for(I in r)ne=r[I],ae=l[I],r.hasOwnProperty(I)&&ne!==ae&&(ne!=null||ae!=null)&&(I==="selected"?t.selected=ne&&typeof ne!="function"&&typeof ne!="symbol":Ge(t,i,I,ne,r,ae));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 Ee in l)ne=l[Ee],l.hasOwnProperty(Ee)&&ne!=null&&!r.hasOwnProperty(Ee)&&Ge(t,i,Ee,null,r,ne);for(ee in r)if(ne=r[ee],ae=l[ee],r.hasOwnProperty(ee)&&ne!==ae&&(ne!=null||ae!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,i));break;default:Ge(t,i,ee,ne,r,ae)}return;default:if(Xu(i)){for(var Xe in l)ne=l[Xe],l.hasOwnProperty(Xe)&&ne!==void 0&&!r.hasOwnProperty(Xe)&&Dd(t,i,Xe,void 0,r,ne);for(re in r)ne=r[re],ae=l[re],!r.hasOwnProperty(re)||ne===ae||ne===void 0&&ae===void 0||Dd(t,i,re,ne,r,ae);return}}for(var Q in l)ne=l[Q],l.hasOwnProperty(Q)&&ne!=null&&!r.hasOwnProperty(Q)&&Ge(t,i,Q,null,r,ne);for(ue in r)ne=r[ue],ae=l[ue],!r.hasOwnProperty(ue)||ne===ae||ne==null&&ae==null||Ge(t,i,ue,ne,r,ae)}function qy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Fx(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,l=performance.getEntriesByType("resource"),r=0;r<l.length;r++){var f=l[r],m=f.transferSize,S=f.initiatorType,M=f.duration;if(m&&M&&qy(S)){for(S=0,M=f.responseEnd,r+=1;r<l.length;r++){var I=l[r],ee=I.startTime;if(ee>M)break;var re=I.transferSize,ue=I.initiatorType;re&&qy(ue)&&(I=I.responseEnd,S+=re*(I<M?1:(M-ee)/(I-ee)))}if(--r,i+=8*(m+S)/(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 jd=null,Rd=null;function gc(t){return t.nodeType===9?t:t.ownerDocument}function Vy(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 Yy(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 Bd(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 Ld=null;function Jx(){var t=window.event;return t&&t.type==="popstate"?t===Ld?!1:(Ld=t,!0):(Ld=null,!1)}var Gy=typeof setTimeout=="function"?setTimeout:void 0,Wx=typeof clearTimeout=="function"?clearTimeout:void 0,Xy=typeof Promise=="function"?Promise:void 0,Px=typeof queueMicrotask=="function"?queueMicrotask:typeof Xy<"u"?function(t){return Xy.resolve(null).then(t).catch(eE)}:Gy;function eE(t){setTimeout(function(){throw t})}function ls(t){return t==="head"}function Ky(t,i){var l=i,r=0;do{var f=l.nextSibling;if(t.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"||l==="/&"){if(r===0){t.removeChild(f),Va(i);return}r--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")r++;else if(l==="html")So(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,So(l);for(var m=l.firstChild;m;){var S=m.nextSibling,M=m.nodeName;m[vn]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&m.rel.toLowerCase()==="stylesheet"||l.removeChild(m),m=S}}else l==="body"&&So(t.ownerDocument.body);l=f}while(l);Va(i)}function Zy(t,i){var l=t;t=0;do{var r=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),r&&r.nodeType===8)if(l=r.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=r}while(l)}function $d(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":$d(l),zl(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function tE(t,i,l,r){for(;t.nodeType===1;){var f=l;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!r&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(r){if(!t[vn])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=_n(t.nextSibling),t===null)break}return null}function nE(t,i,l){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=_n(t.nextSibling),t===null))return null;return t}function Qy(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=_n(t.nextSibling),t===null))return null;return t}function Hd(t){return t.data==="$?"||t.data==="$~"}function Ud(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function iE(t,i){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||l.readyState!=="loading")i();else{var r=function(){i(),l.removeEventListener("DOMContentLoaded",r)};l.addEventListener("DOMContentLoaded",r),t._reactRetry=r}}function _n(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 Id=null;function Fy(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(i===0)return _n(t.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}t=t.nextSibling}return null}function Jy(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return t;i--}else l!=="/$"&&l!=="/&"||i++}t=t.previousSibling}return null}function Wy(t,i,l){switch(i=gc(l),t){case"html":if(t=i.documentElement,!t)throw Error(a(452));return t;case"head":if(t=i.head,!t)throw Error(a(453));return t;case"body":if(t=i.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function So(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zl(t)}var An=new Map,Py=new Set;function yc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ci=H.d;H.d={f:sE,r:aE,D:lE,C:oE,L:rE,m:cE,X:fE,S:uE,M:dE};function sE(){var t=Ci.f(),i=rc();return t||i}function aE(t){var i=$i(t);i!==null&&i.tag===5&&i.type==="form"?gg(i):Ci.r(t)}var Ua=typeof document>"u"?null:document;function e0(t,i,l){var r=Ua;if(r&&typeof i=="string"&&i){var f=Yt(i);f='link[rel="'+t+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),Py.has(f)||(Py.add(f),t={rel:t,crossOrigin:l,href:i},r.querySelector(f)===null&&(i=r.createElement("link"),kt(i,"link",t),gt(i),r.head.appendChild(i)))}}function lE(t){Ci.D(t),e0("dns-prefetch",t,null)}function oE(t,i){Ci.C(t,i),e0("preconnect",t,i)}function rE(t,i,l){Ci.L(t,i,l);var r=Ua;if(r&&t&&i){var f='link[rel="preload"][as="'+Yt(i)+'"]';i==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+Yt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+Yt(l.imageSizes)+'"]')):f+='[href="'+Yt(t)+'"]';var m=f;switch(i){case"style":m=Ia(t);break;case"script":m=qa(t)}An.has(m)||(t=g({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:t,as:i},l),An.set(m,t),r.querySelector(f)!==null||i==="style"&&r.querySelector(wo(m))||i==="script"&&r.querySelector(xo(m))||(i=r.createElement("link"),kt(i,"link",t),gt(i),r.head.appendChild(i)))}}function cE(t,i){Ci.m(t,i);var l=Ua;if(l&&t){var r=i&&typeof i.as=="string"?i.as:"script",f='link[rel="modulepreload"][as="'+Yt(r)+'"][href="'+Yt(t)+'"]',m=f;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=qa(t)}if(!An.has(m)&&(t=g({rel:"modulepreload",href:t},i),An.set(m,t),l.querySelector(f)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(xo(m)))return}r=l.createElement("link"),kt(r,"link",t),gt(r),l.head.appendChild(r)}}}function uE(t,i,l){Ci.S(t,i,l);var r=Ua;if(r&&t){var f=Ui(r).hoistableStyles,m=Ia(t);i=i||"default";var S=f.get(m);if(!S){var M={loading:0,preload:null};if(S=r.querySelector(wo(m)))M.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":i},l),(l=An.get(m))&&qd(t,l);var I=S=r.createElement("link");gt(I),kt(I,"link",t),I._p=new Promise(function(ee,re){I.onload=ee,I.onerror=re}),I.addEventListener("load",function(){M.loading|=1}),I.addEventListener("error",function(){M.loading|=2}),M.loading|=4,vc(S,i,r)}S={type:"stylesheet",instance:S,count:1,state:M},f.set(m,S)}}}function fE(t,i){Ci.X(t,i);var l=Ua;if(l&&t){var r=Ui(l).hoistableScripts,f=qa(t),m=r.get(f);m||(m=l.querySelector(xo(f)),m||(t=g({src:t,async:!0},i),(i=An.get(f))&&Vd(t,i),m=l.createElement("script"),gt(m),kt(m,"link",t),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},r.set(f,m))}}function dE(t,i){Ci.M(t,i);var l=Ua;if(l&&t){var r=Ui(l).hoistableScripts,f=qa(t),m=r.get(f);m||(m=l.querySelector(xo(f)),m||(t=g({src:t,async:!0,type:"module"},i),(i=An.get(f))&&Vd(t,i),m=l.createElement("script"),gt(m),kt(m,"link",t),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},r.set(f,m))}}function t0(t,i,l,r){var f=(f=de.current)?yc(f):null;if(!f)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=Ia(l.href),l=Ui(f).hoistableStyles,r=l.get(i),r||(r={type:"style",instance:null,count:0,state:null},l.set(i,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=Ia(l.href);var m=Ui(f).hoistableStyles,S=m.get(t);if(S||(f=f.ownerDocument||f,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,S),(m=f.querySelector(wo(t)))&&!m._p&&(S.instance=m,S.state.loading=5),An.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},An.set(t,l),m||hE(f,t,l,S.state))),i&&r===null)throw Error(a(528,""));return S}if(i&&r!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=qa(l),l=Ui(f).hoistableScripts,r=l.get(i),r||(r={type:"script",instance:null,count:0,state:null},l.set(i,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function Ia(t){return'href="'+Yt(t)+'"'}function wo(t){return'link[rel="stylesheet"]['+t+"]"}function n0(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function hE(t,i,l,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}),kt(i,"link",l),gt(i),t.head.appendChild(i))}function qa(t){return'[src="'+Yt(t)+'"]'}function xo(t){return"script[async]"+t}function i0(t,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var r=t.querySelector('style[data-href~="'+Yt(l.href)+'"]');if(r)return i.instance=r,gt(r),r;var f=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return r=(t.ownerDocument||t).createElement("style"),gt(r),kt(r,"style",f),vc(r,l.precedence,t),i.instance=r;case"stylesheet":f=Ia(l.href);var m=t.querySelector(wo(f));if(m)return i.state.loading|=4,i.instance=m,gt(m),m;r=n0(l),(f=An.get(f))&&qd(r,f),m=(t.ownerDocument||t).createElement("link"),gt(m);var S=m;return S._p=new Promise(function(M,I){S.onload=M,S.onerror=I}),kt(m,"link",r),i.state.loading|=4,vc(m,l.precedence,t),i.instance=m;case"script":return m=qa(l.src),(f=t.querySelector(xo(m)))?(i.instance=f,gt(f),f):(r=l,(f=An.get(m))&&(r=g({},l),Vd(r,f)),t=t.ownerDocument||t,f=t.createElement("script"),gt(f),kt(f,"link",r),t.head.appendChild(f),i.instance=f);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(r=i.instance,i.state.loading|=4,vc(r,l.precedence,t));return i.instance}function vc(t,i,l){for(var r=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=r.length?r[r.length-1]:null,m=f,S=0;S<r.length;S++){var M=r[S];if(M.dataset.precedence===i)m=M;else if(m!==f)break}m?m.parentNode.insertBefore(t,m.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(t,i.firstChild))}function qd(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function Vd(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var bc=null;function s0(t,i,l){if(bc===null){var r=new Map,f=bc=new Map;f.set(l,r)}else f=bc,r=f.get(l),r||(r=new Map,f.set(l,r));if(r.has(t))return r;for(r.set(t,null),l=l.getElementsByTagName(t),f=0;f<l.length;f++){var m=l[f];if(!(m[vn]||m[J]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var S=m.getAttribute(i)||"";S=t+S;var M=r.get(S);M?M.push(m):r.set(S,[m])}}return r}function a0(t,i,l){t=t.ownerDocument||t,t.head.insertBefore(l,i==="title"?t.querySelector("head > title"):null)}function mE(t,i,l){if(l===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 l0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function pE(t,i,l,r){if(l.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var f=Ia(r.href),m=i.querySelector(wo(f));if(m){i=m._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=Sc.bind(t),i.then(t,t)),l.state.loading|=4,l.instance=m,gt(m);return}m=i.ownerDocument||i,r=n0(r),(f=An.get(f))&&qd(r,f),m=m.createElement("link"),gt(m);var S=m;S._p=new Promise(function(M,I){S.onload=M,S.onerror=I}),kt(m,"link",r),l.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Sc.bind(t),i.addEventListener("load",l),i.addEventListener("error",l))}}var Yd=0;function gE(t,i){return t.stylesheets&&t.count===0&&xc(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var r=setTimeout(function(){if(t.stylesheets&&xc(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+i);0<t.imgBytes&&Yd===0&&(Yd=62500*Fx());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&xc(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>Yd?50:800)+i);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(f)}}:null}function Sc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var wc=null;function xc(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,wc=new Map,i.forEach(yE,t),wc=null,Sc.call(t))}function yE(t,i){if(!(i.state.loading&4)){var l=wc.get(t);if(l)var r=l.get(null);else{l=new Map,wc.set(t,l);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var S=f[m];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(l.set(S.dataset.precedence,S),r=S)}r&&l.set(null,r)}f=i.instance,S=f.getAttribute("data-precedence"),m=l.get(S)||r,m===r&&l.set(null,f),l.set(S,f),this.count++,r=Sc.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 Eo={$$typeof:_,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function vE(t,i,l,r,f,m,S,M,I){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=ui(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ui(0),this.hiddenUpdates=ui(null),this.identifierPrefix=r,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function o0(t,i,l,r,f,m,S,M,I,ee,re,ue){return t=new vE(t,i,l,S,I,ee,re,ue,M),i=1,m===!0&&(i|=24),m=sn(3,null,null,i),t.current=m,m.stateNode=t,i=Ef(),i.refCount++,t.pooledCache=i,i.refCount++,m.memoizedState={element:r,isDehydrated:l,cache:i},Tf(m),t}function r0(t){return t?(t=ba,t):ba}function c0(t,i,l,r,f,m){f=r0(f),r.context===null?r.context=f:r.pendingContext=f,r=Qi(i),r.payload={element:l},m=m===void 0?null:m,m!==null&&(r.callback=m),l=Fi(t,r,i),l!==null&&(Ft(l,t,i),eo(l,t,i))}function u0(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<i?l:i}}function Gd(t,i){u0(t,i),(t=t.alternate)&&u0(t,i)}function f0(t){if(t.tag===13||t.tag===31){var i=As(t,67108864);i!==null&&Ft(i,t,67108864),Gd(t,67108864)}}function d0(t){if(t.tag===13||t.tag===31){var i=cn();i=ws(i);var l=As(t,i);l!==null&&Ft(l,t,i),Gd(t,i)}}var Ec=!0;function bE(t,i,l,r){var f=O.T;O.T=null;var m=H.p;try{H.p=2,Xd(t,i,l,r)}finally{H.p=m,O.T=f}}function SE(t,i,l,r){var f=O.T;O.T=null;var m=H.p;try{H.p=8,Xd(t,i,l,r)}finally{H.p=m,O.T=f}}function Xd(t,i,l,r){if(Ec){var f=Kd(r);if(f===null)zd(t,i,r,Nc,l),m0(t,r);else if(xE(f,t,i,l,r))r.stopPropagation();else if(m0(t,r),i&4&&-1<wE.indexOf(t)){for(;f!==null;){var m=$i(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var S=qt(m.pendingLanes);if(S!==0){var M=m;for(M.pendingLanes|=2,M.entangledLanes|=2;S;){var I=1<<31-At(S);M.entanglements[1]|=I,S&=~I}ei(m),($e&6)===0&&(lc=Ke()+500,yo(0))}}break;case 31:case 13:M=As(m,2),M!==null&&Ft(M,m,2),rc(),Gd(m,2)}if(m=Kd(r),m===null&&zd(t,i,r,Nc,l),m===f)break;f=m}f!==null&&r.stopPropagation()}else zd(t,i,r,null,l)}}function Kd(t){return t=Zu(t),Zd(t)}var Nc=null;function Zd(t){if(Nc=null,t=Li(t),t!==null){var i=c(t);if(i===null)t=null;else{var l=i.tag;if(l===13){if(t=u(i),t!==null)return t;t=null}else if(l===31){if(t=d(i),t!==null)return t;t=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return Nc=t,null}function h0(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(ut()){case Ut:return 2;case Lt:return 8;case jt:case hn:return 32;case mn:return 268435456;default:return 32}default:return 32}}var Qd=!1,os=null,rs=null,cs=null,No=new Map,_o=new Map,us=[],wE="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 m0(t,i){switch(t){case"focusin":case"focusout":os=null;break;case"dragenter":case"dragleave":rs=null;break;case"mouseover":case"mouseout":cs=null;break;case"pointerover":case"pointerout":No.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":_o.delete(i.pointerId)}}function Ao(t,i,l,r,f,m){return t===null||t.nativeEvent!==m?(t={blockedOn:i,domEventName:l,eventSystemFlags:r,nativeEvent:m,targetContainers:[f]},i!==null&&(i=$i(i),i!==null&&f0(i)),t):(t.eventSystemFlags|=r,i=t.targetContainers,f!==null&&i.indexOf(f)===-1&&i.push(f),t)}function xE(t,i,l,r,f){switch(i){case"focusin":return os=Ao(os,t,i,l,r,f),!0;case"dragenter":return rs=Ao(rs,t,i,l,r,f),!0;case"mouseover":return cs=Ao(cs,t,i,l,r,f),!0;case"pointerover":var m=f.pointerId;return No.set(m,Ao(No.get(m)||null,t,i,l,r,f)),!0;case"gotpointercapture":return m=f.pointerId,_o.set(m,Ao(_o.get(m)||null,t,i,l,r,f)),!0}return!1}function p0(t){var i=Li(t.target);if(i!==null){var l=c(i);if(l!==null){if(i=l.tag,i===13){if(i=u(l),i!==null){t.blockedOn=i,oa(t.priority,function(){d0(l)});return}}else if(i===31){if(i=d(l),i!==null){t.blockedOn=i,oa(t.priority,function(){d0(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function _c(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var l=Kd(t.nativeEvent);if(l===null){l=t.nativeEvent;var r=new l.constructor(l.type,l);Ku=r,l.target.dispatchEvent(r),Ku=null}else return i=$i(l),i!==null&&f0(i),t.blockedOn=l,!1;i.shift()}return!0}function g0(t,i,l){_c(t)&&l.delete(i)}function EE(){Qd=!1,os!==null&&_c(os)&&(os=null),rs!==null&&_c(rs)&&(rs=null),cs!==null&&_c(cs)&&(cs=null),No.forEach(g0),_o.forEach(g0)}function Ac(t,i){t.blockedOn===i&&(t.blockedOn=null,Qd||(Qd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,EE)))}var Tc=null;function y0(t){Tc!==t&&(Tc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Tc===t&&(Tc=null);for(var i=0;i<t.length;i+=3){var l=t[i],r=t[i+1],f=t[i+2];if(typeof r!="function"){if(Zd(r||l)===null)continue;break}var m=$i(l);m!==null&&(t.splice(i,3),i-=3,Kf(m,{pending:!0,data:f,method:l.method,action:r},r,f))}}))}function Va(t){function i(I){return Ac(I,t)}os!==null&&Ac(os,t),rs!==null&&Ac(rs,t),cs!==null&&Ac(cs,t),No.forEach(i),_o.forEach(i);for(var l=0;l<us.length;l++){var r=us[l];r.blockedOn===t&&(r.blockedOn=null)}for(;0<us.length&&(l=us[0],l.blockedOn===null);)p0(l),l.blockedOn===null&&us.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(r=0;r<l.length;r+=3){var f=l[r],m=l[r+1],S=f[he]||null;if(typeof m=="function")S||y0(l);else if(S){var M=null;if(m&&m.hasAttribute("formAction")){if(f=m,S=m[he]||null)M=S.formAction;else if(Zd(f)!==null)continue}else M=S.action;typeof M=="function"?l[r+1]=M:(l.splice(r,3),r-=3),y0(l)}}}function v0(){function t(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(S){return f=S})},focusReset:"manual",scroll:"manual"})}function i(){f!==null&&(f(),f=null),r||setTimeout(l,20)}function l(){if(!r&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){r=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),f!==null&&(f(),f=null)}}}function Fd(t){this._internalRoot=t}Cc.prototype.render=Fd.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,r=cn();c0(l,r,t,i,null,null)},Cc.prototype.unmount=Fd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;c0(t.current,2,null,t,null,null),rc(),i[Ne]=null}};function Cc(t){this._internalRoot=t}Cc.prototype.unstable_scheduleHydration=function(t){if(t){var i=la();t={blockedOn:null,target:t,priority:i};for(var l=0;l<us.length&&i!==0&&i<us[l].priority;l++);us.splice(l,0,t),l===0&&p0(t)}};var b0=n.version;if(b0!=="19.2.7")throw Error(a(527,b0,"19.2.7"));H.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=p(i),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var NE={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mc.isDisabled&&Mc.supportsFiber)try{It=Mc.inject(NE),mt=Mc}catch{}}return Co.createRoot=function(t,i){if(!o(t))throw Error(a(299));var l=!1,r="",f=Ag,m=Tg,S=Cg;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(f=i.onUncaughtError),i.onCaughtError!==void 0&&(m=i.onCaughtError),i.onRecoverableError!==void 0&&(S=i.onRecoverableError)),i=o0(t,1,!1,null,null,l,r,null,f,m,S,v0),t[Ne]=i.current,kd(t),new Fd(i)},Co.hydrateRoot=function(t,i,l){if(!o(t))throw Error(a(299));var r=!1,f="",m=Ag,S=Tg,M=Cg,I=null;return l!=null&&(l.unstable_strictMode===!0&&(r=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(m=l.onUncaughtError),l.onCaughtError!==void 0&&(S=l.onCaughtError),l.onRecoverableError!==void 0&&(M=l.onRecoverableError),l.formState!==void 0&&(I=l.formState)),i=o0(t,1,!0,i,l??null,r,f,I,m,S,M,v0),i.context=r0(null),l=i.current,r=cn(),r=ws(r),f=Qi(r),f.callback=null,Fi(l,f,r),l=r,i.current.lanes=l,zn(i,l),ei(i),t[Ne]=i.current,kd(t),new Cc(i)},Co.version="19.2.7",Co}var M0;function DE(){if(M0)return Pd.exports;M0=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(),Pd.exports=zE(),Pd.exports}var jE=DE();function wt(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let s=0,a;s<e.length;s++)(a=wt(e[s]))!==""&&(n+=(n&&" ")+a);else for(let s in e)e[s]&&(n+=(n&&" ")+s);return n}var RE={value:()=>{}};function vu(){for(var e=0,n=arguments.length,s={},a;e<n;++e){if(!(a=arguments[e]+"")||a in s||/[\s.]/.test(a))throw new Error("illegal type: "+a);s[a]=[]}return new Gc(s)}function Gc(e){this._=e}function BE(e,n){return e.trim().split(/^|\s+/).map(function(s){var a="",o=s.indexOf(".");if(o>=0&&(a=s.slice(o+1),s=s.slice(0,o)),s&&!n.hasOwnProperty(s))throw new Error("unknown type: "+s);return{type:s,name:a}})}Gc.prototype=vu.prototype={constructor:Gc,on:function(e,n){var s=this._,a=BE(e+"",s),o,c=-1,u=a.length;if(arguments.length<2){for(;++c<u;)if((o=(e=a[c]).type)&&(o=LE(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=a[c]).type)s[o]=O0(s[o],e.name,n);else if(n==null)for(o in s)s[o]=O0(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 Gc(e)},call:function(e,n){if((o=arguments.length-2)>0)for(var s=new Array(o),a=0,o,c;a<o;++a)s[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(c=this._[e],a=0,o=c.length;a<o;++a)c[a].value.apply(n,s)},apply:function(e,n,s){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var a=this._[e],o=0,c=a.length;o<c;++o)a[o].value.apply(n,s)}};function LE(e,n){for(var s=0,a=e.length,o;s<a;++s)if((o=e[s]).name===n)return o.value}function O0(e,n,s){for(var a=0,o=e.length;a<o;++a)if(e[a].name===n){e[a]=RE,e=e.slice(0,a).concat(e.slice(a+1));break}return s!=null&&e.push({name:n,value:s}),e}var Ch="http://www.w3.org/1999/xhtml";const k0={svg:"http://www.w3.org/2000/svg",xhtml:Ch,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function bu(e){var n=e+="",s=n.indexOf(":");return s>=0&&(n=e.slice(0,s))!=="xmlns"&&(e=e.slice(s+1)),k0.hasOwnProperty(n)?{space:k0[n],local:e}:e}function $E(e){return function(){var n=this.ownerDocument,s=this.namespaceURI;return s===Ch&&n.documentElement.namespaceURI===Ch?n.createElement(e):n.createElementNS(s,e)}}function HE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mb(e){var n=bu(e);return(n.local?HE:$E)(n)}function UE(){}function tm(e){return e==null?UE:function(){return this.querySelector(e)}}function IE(e){typeof e!="function"&&(e=tm(e));for(var n=this._groups,s=n.length,a=new Array(s),o=0;o<s;++o)for(var c=n[o],u=c.length,d=a[o]=new Array(u),h,p,y=0;y<u;++y)(h=c[y])&&(p=e.call(h,h.__data__,y,c))&&("__data__"in h&&(p.__data__=h.__data__),d[y]=p);return new dn(a,this._parents)}function qE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function VE(){return[]}function pb(e){return e==null?VE:function(){return this.querySelectorAll(e)}}function YE(e){return function(){return qE(e.apply(this,arguments))}}function GE(e){typeof e=="function"?e=YE(e):e=pb(e);for(var n=this._groups,s=n.length,a=[],o=[],c=0;c<s;++c)for(var u=n[c],d=u.length,h,p=0;p<d;++p)(h=u[p])&&(a.push(e.call(h,h.__data__,p,u)),o.push(h));return new dn(a,o)}function gb(e){return function(){return this.matches(e)}}function yb(e){return function(n){return n.matches(e)}}var XE=Array.prototype.find;function KE(e){return function(){return XE.call(this.children,e)}}function ZE(){return this.firstElementChild}function QE(e){return this.select(e==null?ZE:KE(typeof e=="function"?e:yb(e)))}var FE=Array.prototype.filter;function JE(){return Array.from(this.children)}function WE(e){return function(){return FE.call(this.children,e)}}function PE(e){return this.selectAll(e==null?JE:WE(typeof e=="function"?e:yb(e)))}function eN(e){typeof e!="function"&&(e=gb(e));for(var n=this._groups,s=n.length,a=new Array(s),o=0;o<s;++o)for(var c=n[o],u=c.length,d=a[o]=[],h,p=0;p<u;++p)(h=c[p])&&e.call(h,h.__data__,p,c)&&d.push(h);return new dn(a,this._parents)}function vb(e){return new Array(e.length)}function tN(){return new dn(this._enter||this._groups.map(vb),this._parents)}function iu(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}iu.prototype={constructor:iu,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 nN(e){return function(){return e}}function iN(e,n,s,a,o,c){for(var u=0,d,h=n.length,p=c.length;u<p;++u)(d=n[u])?(d.__data__=c[u],a[u]=d):s[u]=new iu(e,c[u]);for(;u<h;++u)(d=n[u])&&(o[u]=d)}function sN(e,n,s,a,o,c,u){var d,h,p=new Map,y=n.length,g=c.length,v=new Array(y),x;for(d=0;d<y;++d)(h=n[d])&&(v[d]=x=u.call(h,h.__data__,d,n)+"",p.has(x)?o[d]=h:p.set(x,h));for(d=0;d<g;++d)x=u.call(e,c[d],d,c)+"",(h=p.get(x))?(a[d]=h,h.__data__=c[d],p.delete(x)):s[d]=new iu(e,c[d]);for(d=0;d<y;++d)(h=n[d])&&p.get(v[d])===h&&(o[d]=h)}function aN(e){return e.__data__}function lN(e,n){if(!arguments.length)return Array.from(this,aN);var s=n?sN:iN,a=this._parents,o=this._groups;typeof e!="function"&&(e=nN(e));for(var c=o.length,u=new Array(c),d=new Array(c),h=new Array(c),p=0;p<c;++p){var y=a[p],g=o[p],v=g.length,x=oN(e.call(y,y&&y.__data__,p,a)),E=x.length,A=d[p]=new Array(E),T=u[p]=new Array(E),C=h[p]=new Array(v);s(y,g,A,T,C,x,n);for(var k=0,_=0,N,j;k<E;++k)if(N=A[k]){for(k>=_&&(_=k+1);!(j=T[_])&&++_<E;);N._next=j||null}}return u=new dn(u,a),u._enter=d,u._exit=h,u}function oN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function rN(){return new dn(this._exit||this._groups.map(vb),this._parents)}function cN(e,n,s){var a=this.enter(),o=this,c=this.exit();return typeof e=="function"?(a=e(a),a&&(a=a.selection())):a=a.append(e+""),n!=null&&(o=n(o),o&&(o=o.selection())),s==null?c.remove():s(c),a&&o?a.merge(o).order():o}function uN(e){for(var n=e.selection?e.selection():e,s=this._groups,a=n._groups,o=s.length,c=a.length,u=Math.min(o,c),d=new Array(o),h=0;h<u;++h)for(var p=s[h],y=a[h],g=p.length,v=d[h]=new Array(g),x,E=0;E<g;++E)(x=p[E]||y[E])&&(v[E]=x);for(;h<o;++h)d[h]=s[h];return new dn(d,this._parents)}function fN(){for(var e=this._groups,n=-1,s=e.length;++n<s;)for(var a=e[n],o=a.length-1,c=a[o],u;--o>=0;)(u=a[o])&&(c&&u.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(u,c),c=u);return this}function dN(e){e||(e=hN);function n(g,v){return g&&v?e(g.__data__,v.__data__):!g-!v}for(var s=this._groups,a=s.length,o=new Array(a),c=0;c<a;++c){for(var u=s[c],d=u.length,h=o[c]=new Array(d),p,y=0;y<d;++y)(p=u[y])&&(h[y]=p);h.sort(n)}return new dn(o,this._parents).order()}function hN(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function mN(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function pN(){return Array.from(this)}function gN(){for(var e=this._groups,n=0,s=e.length;n<s;++n)for(var a=e[n],o=0,c=a.length;o<c;++o){var u=a[o];if(u)return u}return null}function yN(){let e=0;for(const n of this)++e;return e}function vN(){return!this.node()}function bN(e){for(var n=this._groups,s=0,a=n.length;s<a;++s)for(var o=n[s],c=0,u=o.length,d;c<u;++c)(d=o[c])&&e.call(d,d.__data__,c,o);return this}function SN(e){return function(){this.removeAttribute(e)}}function wN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function xN(e,n){return function(){this.setAttribute(e,n)}}function EN(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function NN(e,n){return function(){var s=n.apply(this,arguments);s==null?this.removeAttribute(e):this.setAttribute(e,s)}}function _N(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 AN(e,n){var s=bu(e);if(arguments.length<2){var a=this.node();return s.local?a.getAttributeNS(s.space,s.local):a.getAttribute(s)}return this.each((n==null?s.local?wN:SN:typeof n=="function"?s.local?_N:NN:s.local?EN:xN)(s,n))}function bb(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function TN(e){return function(){this.style.removeProperty(e)}}function CN(e,n,s){return function(){this.style.setProperty(e,n,s)}}function MN(e,n,s){return function(){var a=n.apply(this,arguments);a==null?this.style.removeProperty(e):this.style.setProperty(e,a,s)}}function ON(e,n,s){return arguments.length>1?this.each((n==null?TN:typeof n=="function"?MN:CN)(e,n,s??"")):ul(this.node(),e)}function ul(e,n){return e.style.getPropertyValue(n)||bb(e).getComputedStyle(e,null).getPropertyValue(n)}function kN(e){return function(){delete this[e]}}function zN(e,n){return function(){this[e]=n}}function DN(e,n){return function(){var s=n.apply(this,arguments);s==null?delete this[e]:this[e]=s}}function jN(e,n){return arguments.length>1?this.each((n==null?kN:typeof n=="function"?DN:zN)(e,n)):this.node()[e]}function Sb(e){return e.trim().split(/^|\s+/)}function nm(e){return e.classList||new wb(e)}function wb(e){this._node=e,this._names=Sb(e.getAttribute("class")||"")}wb.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 xb(e,n){for(var s=nm(e),a=-1,o=n.length;++a<o;)s.add(n[a])}function Eb(e,n){for(var s=nm(e),a=-1,o=n.length;++a<o;)s.remove(n[a])}function RN(e){return function(){xb(this,e)}}function BN(e){return function(){Eb(this,e)}}function LN(e,n){return function(){(n.apply(this,arguments)?xb:Eb)(this,e)}}function $N(e,n){var s=Sb(e+"");if(arguments.length<2){for(var a=nm(this.node()),o=-1,c=s.length;++o<c;)if(!a.contains(s[o]))return!1;return!0}return this.each((typeof n=="function"?LN:n?RN:BN)(s,n))}function HN(){this.textContent=""}function UN(e){return function(){this.textContent=e}}function IN(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function qN(e){return arguments.length?this.each(e==null?HN:(typeof e=="function"?IN:UN)(e)):this.node().textContent}function VN(){this.innerHTML=""}function YN(e){return function(){this.innerHTML=e}}function GN(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function XN(e){return arguments.length?this.each(e==null?VN:(typeof e=="function"?GN:YN)(e)):this.node().innerHTML}function KN(){this.nextSibling&&this.parentNode.appendChild(this)}function ZN(){return this.each(KN)}function QN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function FN(){return this.each(QN)}function JN(e){var n=typeof e=="function"?e:mb(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function WN(){return null}function PN(e,n){var s=typeof e=="function"?e:mb(e),a=n==null?WN:typeof n=="function"?n:tm(n);return this.select(function(){return this.insertBefore(s.apply(this,arguments),a.apply(this,arguments)||null)})}function e2(){var e=this.parentNode;e&&e.removeChild(this)}function t2(){return this.each(e2)}function n2(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function i2(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function s2(e){return this.select(e?i2:n2)}function a2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function l2(e){return function(n){e.call(this,n,this.__data__)}}function o2(e){return e.trim().split(/^|\s+/).map(function(n){var s="",a=n.indexOf(".");return a>=0&&(s=n.slice(a+1),n=n.slice(0,a)),{type:n,name:s}})}function r2(e){return function(){var n=this.__on;if(n){for(var s=0,a=-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[++a]=c;++a?n.length=a:delete this.__on}}}function c2(e,n,s){return function(){var a=this.__on,o,c=l2(n);if(a){for(var u=0,d=a.length;u<d;++u)if((o=a[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},a?a.push(o):this.__on=[o]}}function u2(e,n,s){var a=o2(e+""),o,c=a.length,u;if(arguments.length<2){var d=this.node().__on;if(d){for(var h=0,p=d.length,y;h<p;++h)for(o=0,y=d[h];o<c;++o)if((u=a[o]).type===y.type&&u.name===y.name)return y.value}return}for(d=n?c2:r2,o=0;o<c;++o)this.each(d(a[o],n,s));return this}function Nb(e,n,s){var a=bb(e),o=a.CustomEvent;typeof o=="function"?o=new o(n,s):(o=a.document.createEvent("Event"),s?(o.initEvent(n,s.bubbles,s.cancelable),o.detail=s.detail):o.initEvent(n,!1,!1)),e.dispatchEvent(o)}function f2(e,n){return function(){return Nb(this,e,n)}}function d2(e,n){return function(){return Nb(this,e,n.apply(this,arguments))}}function h2(e,n){return this.each((typeof n=="function"?d2:f2)(e,n))}function*m2(){for(var e=this._groups,n=0,s=e.length;n<s;++n)for(var a=e[n],o=0,c=a.length,u;o<c;++o)(u=a[o])&&(yield u)}var _b=[null];function dn(e,n){this._groups=e,this._parents=n}function lr(){return new dn([[document.documentElement]],_b)}function p2(){return this}dn.prototype=lr.prototype={constructor:dn,select:IE,selectAll:GE,selectChild:QE,selectChildren:PE,filter:eN,data:lN,enter:tN,exit:rN,join:cN,merge:uN,selection:p2,order:fN,sort:dN,call:mN,nodes:pN,node:gN,size:yN,empty:vN,each:bN,attr:AN,style:ON,property:jN,classed:$N,text:qN,html:XN,raise:ZN,lower:FN,append:JN,insert:PN,remove:t2,clone:s2,datum:a2,on:u2,dispatch:h2,[Symbol.iterator]:m2};function un(e){return typeof e=="string"?new dn([[document.querySelector(e)]],[document.documentElement]):new dn([[e]],_b)}function g2(e){let n;for(;n=e.sourceEvent;)e=n;return e}function Un(e,n){if(e=g2(e),n===void 0&&(n=e.currentTarget),n){var s=n.ownerSVGElement||n;if(s.createSVGPoint){var a=s.createSVGPoint();return a.x=e.clientX,a.y=e.clientY,a=a.matrixTransform(n.getScreenCTM().inverse()),[a.x,a.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 y2={passive:!1},Vo={capture:!0,passive:!1};function ih(e){e.stopImmediatePropagation()}function nl(e){e.preventDefault(),e.stopImmediatePropagation()}function Ab(e){var n=e.document.documentElement,s=un(e).on("dragstart.drag",nl,Vo);"onselectstart"in n?s.on("selectstart.drag",nl,Vo):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Tb(e,n){var s=e.document.documentElement,a=un(e).on("dragstart.drag",null);n&&(a.on("click.drag",nl,Vo),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in s?a.on("selectstart.drag",null):(s.style.MozUserSelect=s.__noselect,delete s.__noselect)}const Oc=e=>()=>e;function Mh(e,{sourceEvent:n,subject:s,target:a,identifier:o,active:c,x:u,y:d,dx:h,dy:p,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:a,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:d,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:y}})}Mh.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function v2(e){return!e.ctrlKey&&!e.button}function b2(){return this.parentNode}function S2(e,n){return n??{x:e.x,y:e.y}}function w2(){return navigator.maxTouchPoints||"ontouchstart"in this}function Cb(){var e=v2,n=b2,s=S2,a=w2,o={},c=vu("start","drag","end"),u=0,d,h,p,y,g=0;function v(N){N.on("mousedown.drag",x).filter(a).on("touchstart.drag",T).on("touchmove.drag",C,y2).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(N,j){if(!(y||!e.call(this,N,j))){var D=_(this,n.call(this,N,j),N,j,"mouse");D&&(un(N.view).on("mousemove.drag",E,Vo).on("mouseup.drag",A,Vo),Ab(N.view),ih(N),p=!1,d=N.clientX,h=N.clientY,D("start",N))}}function E(N){if(nl(N),!p){var j=N.clientX-d,D=N.clientY-h;p=j*j+D*D>g}o.mouse("drag",N)}function A(N){un(N.view).on("mousemove.drag mouseup.drag",null),Tb(N.view,p),nl(N),o.mouse("end",N)}function T(N,j){if(e.call(this,N,j)){var D=N.changedTouches,B=n.call(this,N,j),R=D.length,U,q;for(U=0;U<R;++U)(q=_(this,B,N,j,D[U].identifier,D[U]))&&(ih(N),q("start",N,D[U]))}}function C(N){var j=N.changedTouches,D=j.length,B,R;for(B=0;B<D;++B)(R=o[j[B].identifier])&&(nl(N),R("drag",N,j[B]))}function k(N){var j=N.changedTouches,D=j.length,B,R;for(y&&clearTimeout(y),y=setTimeout(function(){y=null},500),B=0;B<D;++B)(R=o[j[B].identifier])&&(ih(N),R("end",N,j[B]))}function _(N,j,D,B,R,U){var q=c.copy(),Y=Un(U||D,j),Z,le,L;if((L=s.call(N,new Mh("beforestart",{sourceEvent:D,target:v,identifier:R,active:u,x:Y[0],y:Y[1],dx:0,dy:0,dispatch:q}),B))!=null)return Z=L.x-Y[0]||0,le=L.y-Y[1]||0,function K(O,H,$){var X=Y,se;switch(O){case"start":o[R]=K,se=u++;break;case"end":delete o[R],--u;case"drag":Y=Un($||H,j),se=u;break}q.call(O,N,new Mh(O,{sourceEvent:H,subject:L,target:v,identifier:R,active:se,x:Y[0]+Z,y:Y[1]+le,dx:Y[0]-X[0],dy:Y[1]-X[1],dispatch:q}),B)}}return v.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Oc(!!N),v):e},v.container=function(N){return arguments.length?(n=typeof N=="function"?N:Oc(N),v):n},v.subject=function(N){return arguments.length?(s=typeof N=="function"?N:Oc(N),v):s},v.touchable=function(N){return arguments.length?(a=typeof N=="function"?N:Oc(!!N),v):a},v.on=function(){var N=c.on.apply(c,arguments);return N===c?v:N},v.clickDistance=function(N){return arguments.length?(g=(N=+N)*N,v):Math.sqrt(g)},v}function im(e,n,s){e.prototype=n.prototype=s,s.constructor=e}function Mb(e,n){var s=Object.create(e.prototype);for(var a in n)s[a]=n[a];return s}function or(){}var Yo=.7,su=1/Yo,il="\\s*([+-]?\\d+)\\s*",Go="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",si="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",x2=/^#([0-9a-f]{3,8})$/,E2=new RegExp(`^rgb\\(${il},${il},${il}\\)$`),N2=new RegExp(`^rgb\\(${si},${si},${si}\\)$`),_2=new RegExp(`^rgba\\(${il},${il},${il},${Go}\\)$`),A2=new RegExp(`^rgba\\(${si},${si},${si},${Go}\\)$`),T2=new RegExp(`^hsl\\(${Go},${si},${si}\\)$`),C2=new RegExp(`^hsla\\(${Go},${si},${si},${Go}\\)$`),z0={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};im(or,Xs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:D0,formatHex:D0,formatHex8:M2,formatHsl:O2,formatRgb:j0,toString:j0});function D0(){return this.rgb().formatHex()}function M2(){return this.rgb().formatHex8()}function O2(){return Ob(this).formatHsl()}function j0(){return this.rgb().formatRgb()}function Xs(e){var n,s;return e=(e+"").trim().toLowerCase(),(n=x2.exec(e))?(s=n[1].length,n=parseInt(n[1],16),s===6?R0(n):s===3?new Pt(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):s===8?kc(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):s===4?kc(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=E2.exec(e))?new Pt(n[1],n[2],n[3],1):(n=N2.exec(e))?new Pt(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=_2.exec(e))?kc(n[1],n[2],n[3],n[4]):(n=A2.exec(e))?kc(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=T2.exec(e))?$0(n[1],n[2]/100,n[3]/100,1):(n=C2.exec(e))?$0(n[1],n[2]/100,n[3]/100,n[4]):z0.hasOwnProperty(e)?R0(z0[e]):e==="transparent"?new Pt(NaN,NaN,NaN,0):null}function R0(e){return new Pt(e>>16&255,e>>8&255,e&255,1)}function kc(e,n,s,a){return a<=0&&(e=n=s=NaN),new Pt(e,n,s,a)}function k2(e){return e instanceof or||(e=Xs(e)),e?(e=e.rgb(),new Pt(e.r,e.g,e.b,e.opacity)):new Pt}function Oh(e,n,s,a){return arguments.length===1?k2(e):new Pt(e,n,s,a??1)}function Pt(e,n,s,a){this.r=+e,this.g=+n,this.b=+s,this.opacity=+a}im(Pt,Oh,Mb(or,{brighter(e){return e=e==null?su:Math.pow(su,e),new Pt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Yo:Math.pow(Yo,e),new Pt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pt(Ys(this.r),Ys(this.g),Ys(this.b),au(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:B0,formatHex:B0,formatHex8:z2,formatRgb:L0,toString:L0}));function B0(){return`#${Us(this.r)}${Us(this.g)}${Us(this.b)}`}function z2(){return`#${Us(this.r)}${Us(this.g)}${Us(this.b)}${Us((isNaN(this.opacity)?1:this.opacity)*255)}`}function L0(){const e=au(this.opacity);return`${e===1?"rgb(":"rgba("}${Ys(this.r)}, ${Ys(this.g)}, ${Ys(this.b)}${e===1?")":`, ${e})`}`}function au(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ys(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Us(e){return e=Ys(e),(e<16?"0":"")+e.toString(16)}function $0(e,n,s,a){return a<=0?e=n=s=NaN:s<=0||s>=1?e=n=NaN:n<=0&&(e=NaN),new qn(e,n,s,a)}function Ob(e){if(e instanceof qn)return new qn(e.h,e.s,e.l,e.opacity);if(e instanceof or||(e=Xs(e)),!e)return new qn;if(e instanceof qn)return e;e=e.rgb();var n=e.r/255,s=e.g/255,a=e.b/255,o=Math.min(n,s,a),c=Math.max(n,s,a),u=NaN,d=c-o,h=(c+o)/2;return d?(n===c?u=(s-a)/d+(s<a)*6:s===c?u=(a-n)/d+2:u=(n-s)/d+4,d/=h<.5?c+o:2-c-o,u*=60):d=h>0&&h<1?0:u,new qn(u,d,h,e.opacity)}function D2(e,n,s,a){return arguments.length===1?Ob(e):new qn(e,n,s,a??1)}function qn(e,n,s,a){this.h=+e,this.s=+n,this.l=+s,this.opacity=+a}im(qn,D2,Mb(or,{brighter(e){return e=e==null?su:Math.pow(su,e),new qn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Yo:Math.pow(Yo,e),new qn(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,a=s+(s<.5?s:1-s)*n,o=2*s-a;return new Pt(sh(e>=240?e-240:e+120,o,a),sh(e,o,a),sh(e<120?e+240:e-120,o,a),this.opacity)},clamp(){return new qn(H0(this.h),zc(this.s),zc(this.l),au(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=au(this.opacity);return`${e===1?"hsl(":"hsla("}${H0(this.h)}, ${zc(this.s)*100}%, ${zc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function H0(e){return e=(e||0)%360,e<0?e+360:e}function zc(e){return Math.max(0,Math.min(1,e||0))}function sh(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 sm=e=>()=>e;function j2(e,n){return function(s){return e+s*n}}function R2(e,n,s){return e=Math.pow(e,s),n=Math.pow(n,s)-e,s=1/s,function(a){return Math.pow(e+a*n,s)}}function B2(e){return(e=+e)==1?kb:function(n,s){return s-n?R2(n,s,e):sm(isNaN(n)?s:n)}}function kb(e,n){var s=n-e;return s?j2(e,s):sm(isNaN(e)?n:e)}const lu=(function e(n){var s=B2(n);function a(o,c){var u=s((o=Oh(o)).r,(c=Oh(c)).r),d=s(o.g,c.g),h=s(o.b,c.b),p=kb(o.opacity,c.opacity);return function(y){return o.r=u(y),o.g=d(y),o.b=h(y),o.opacity=p(y),o+""}}return a.gamma=e,a})(1);function L2(e,n){n||(n=[]);var s=e?Math.min(n.length,e.length):0,a=n.slice(),o;return function(c){for(o=0;o<s;++o)a[o]=e[o]*(1-c)+n[o]*c;return a}}function $2(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function H2(e,n){var s=n?n.length:0,a=e?Math.min(s,e.length):0,o=new Array(a),c=new Array(s),u;for(u=0;u<a;++u)o[u]=Lo(e[u],n[u]);for(;u<s;++u)c[u]=n[u];return function(d){for(u=0;u<a;++u)c[u]=o[u](d);return c}}function U2(e,n){var s=new Date;return e=+e,n=+n,function(a){return s.setTime(e*(1-a)+n*a),s}}function ni(e,n){return e=+e,n=+n,function(s){return e*(1-s)+n*s}}function I2(e,n){var s={},a={},o;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(o in n)o in e?s[o]=Lo(e[o],n[o]):a[o]=n[o];return function(c){for(o in s)a[o]=s[o](c);return a}}var kh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ah=new RegExp(kh.source,"g");function q2(e){return function(){return e}}function V2(e){return function(n){return e(n)+""}}function zb(e,n){var s=kh.lastIndex=ah.lastIndex=0,a,o,c,u=-1,d=[],h=[];for(e=e+"",n=n+"";(a=kh.exec(e))&&(o=ah.exec(n));)(c=o.index)>s&&(c=n.slice(s,c),d[u]?d[u]+=c:d[++u]=c),(a=a[0])===(o=o[0])?d[u]?d[u]+=o:d[++u]=o:(d[++u]=null,h.push({i:u,x:ni(a,o)})),s=ah.lastIndex;return s<n.length&&(c=n.slice(s),d[u]?d[u]+=c:d[++u]=c),d.length<2?h[0]?V2(h[0].x):q2(n):(n=h.length,function(p){for(var y=0,g;y<n;++y)d[(g=h[y]).i]=g.x(p);return d.join("")})}function Lo(e,n){var s=typeof n,a;return n==null||s==="boolean"?sm(n):(s==="number"?ni:s==="string"?(a=Xs(n))?(n=a,lu):zb:n instanceof Xs?lu:n instanceof Date?U2:$2(n)?L2:Array.isArray(n)?H2:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?I2:ni)(e,n)}var U0=180/Math.PI,zh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Db(e,n,s,a,o,c){var u,d,h;return(u=Math.sqrt(e*e+n*n))&&(e/=u,n/=u),(h=e*s+n*a)&&(s-=e*h,a-=n*h),(d=Math.sqrt(s*s+a*a))&&(s/=d,a/=d,h/=d),e*a<n*s&&(e=-e,n=-n,h=-h,u=-u),{translateX:o,translateY:c,rotate:Math.atan2(n,e)*U0,skewX:Math.atan(h)*U0,scaleX:u,scaleY:d}}var Dc;function Y2(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?zh:Db(n.a,n.b,n.c,n.d,n.e,n.f)}function G2(e){return e==null||(Dc||(Dc=document.createElementNS("http://www.w3.org/2000/svg","g")),Dc.setAttribute("transform",e),!(e=Dc.transform.baseVal.consolidate()))?zh:(e=e.matrix,Db(e.a,e.b,e.c,e.d,e.e,e.f))}function jb(e,n,s,a){function o(p){return p.length?p.pop()+" ":""}function c(p,y,g,v,x,E){if(p!==g||y!==v){var A=x.push("translate(",null,n,null,s);E.push({i:A-4,x:ni(p,g)},{i:A-2,x:ni(y,v)})}else(g||v)&&x.push("translate("+g+n+v+s)}function u(p,y,g,v){p!==y?(p-y>180?y+=360:y-p>180&&(p+=360),v.push({i:g.push(o(g)+"rotate(",null,a)-2,x:ni(p,y)})):y&&g.push(o(g)+"rotate("+y+a)}function d(p,y,g,v){p!==y?v.push({i:g.push(o(g)+"skewX(",null,a)-2,x:ni(p,y)}):y&&g.push(o(g)+"skewX("+y+a)}function h(p,y,g,v,x,E){if(p!==g||y!==v){var A=x.push(o(x)+"scale(",null,",",null,")");E.push({i:A-4,x:ni(p,g)},{i:A-2,x:ni(y,v)})}else(g!==1||v!==1)&&x.push(o(x)+"scale("+g+","+v+")")}return function(p,y){var g=[],v=[];return p=e(p),y=e(y),c(p.translateX,p.translateY,y.translateX,y.translateY,g,v),u(p.rotate,y.rotate,g,v),d(p.skewX,y.skewX,g,v),h(p.scaleX,p.scaleY,y.scaleX,y.scaleY,g,v),p=y=null,function(x){for(var E=-1,A=v.length,T;++E<A;)g[(T=v[E]).i]=T.x(x);return g.join("")}}}var X2=jb(Y2,"px, ","px)","deg)"),K2=jb(G2,", ",")",")"),Z2=1e-12;function I0(e){return((e=Math.exp(e))+1/e)/2}function Q2(e){return((e=Math.exp(e))-1/e)/2}function F2(e){return((e=Math.exp(2*e))-1)/(e+1)}const Xc=(function e(n,s,a){function o(c,u){var d=c[0],h=c[1],p=c[2],y=u[0],g=u[1],v=u[2],x=y-d,E=g-h,A=x*x+E*E,T,C;if(A<Z2)C=Math.log(v/p)/n,T=function(B){return[d+B*x,h+B*E,p*Math.exp(n*B*C)]};else{var k=Math.sqrt(A),_=(v*v-p*p+a*A)/(2*p*s*k),N=(v*v-p*p-a*A)/(2*v*s*k),j=Math.log(Math.sqrt(_*_+1)-_),D=Math.log(Math.sqrt(N*N+1)-N);C=(D-j)/n,T=function(B){var R=B*C,U=I0(j),q=p/(s*k)*(U*F2(n*R+j)-Q2(j));return[d+q*x,h+q*E,p*U/I0(n*R+j)]}}return T.duration=C*1e3*n/Math.SQRT2,T}return o.rho=function(c){var u=Math.max(.001,+c),d=u*u,h=d*d;return e(u,d,h)},o})(Math.SQRT2,2,4);var fl=0,zo=0,Mo=0,Rb=1e3,ou,Do,ru=0,Ks=0,Su=0,Xo=typeof performance=="object"&&performance.now?performance:Date,Bb=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function am(){return Ks||(Bb(J2),Ks=Xo.now()+Su)}function J2(){Ks=0}function cu(){this._call=this._time=this._next=null}cu.prototype=Lb.prototype={constructor:cu,restart:function(e,n,s){if(typeof e!="function")throw new TypeError("callback is not a function");s=(s==null?am():+s)+(n==null?0:+n),!this._next&&Do!==this&&(Do?Do._next=this:ou=this,Do=this),this._call=e,this._time=s,Dh()},stop:function(){this._call&&(this._call=null,this._time=1/0,Dh())}};function Lb(e,n,s){var a=new cu;return a.restart(e,n,s),a}function W2(){am(),++fl;for(var e=ou,n;e;)(n=Ks-e._time)>=0&&e._call.call(void 0,n),e=e._next;--fl}function q0(){Ks=(ru=Xo.now())+Su,fl=zo=0;try{W2()}finally{fl=0,e_(),Ks=0}}function P2(){var e=Xo.now(),n=e-ru;n>Rb&&(Su-=n,ru=e)}function e_(){for(var e,n=ou,s,a=1/0;n;)n._call?(a>n._time&&(a=n._time),e=n,n=n._next):(s=n._next,n._next=null,n=e?e._next=s:ou=s);Do=e,Dh(a)}function Dh(e){if(!fl){zo&&(zo=clearTimeout(zo));var n=e-Ks;n>24?(e<1/0&&(zo=setTimeout(q0,e-Xo.now()-Su)),Mo&&(Mo=clearInterval(Mo))):(Mo||(ru=Xo.now(),Mo=setInterval(P2,Rb)),fl=1,Bb(q0))}}function V0(e,n,s){var a=new cu;return n=n==null?0:+n,a.restart(o=>{a.stop(),e(o+n)},n,s),a}var t_=vu("start","end","cancel","interrupt"),n_=[],$b=0,Y0=1,jh=2,Kc=3,G0=4,Rh=5,Zc=6;function wu(e,n,s,a,o,c){var u=e.__transition;if(!u)e.__transition={};else if(s in u)return;i_(e,s,{name:n,index:a,group:o,on:t_,tween:n_,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:$b})}function lm(e,n){var s=Kn(e,n);if(s.state>$b)throw new Error("too late; already scheduled");return s}function oi(e,n){var s=Kn(e,n);if(s.state>Kc)throw new Error("too late; already running");return s}function Kn(e,n){var s=e.__transition;if(!s||!(s=s[n]))throw new Error("transition not found");return s}function i_(e,n,s){var a=e.__transition,o;a[n]=s,s.timer=Lb(c,0,s.time);function c(p){s.state=Y0,s.timer.restart(u,s.delay,s.time),s.delay<=p&&u(p-s.delay)}function u(p){var y,g,v,x;if(s.state!==Y0)return h();for(y in a)if(x=a[y],x.name===s.name){if(x.state===Kc)return V0(u);x.state===G0?(x.state=Zc,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete a[y]):+y<n&&(x.state=Zc,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete a[y])}if(V0(function(){s.state===Kc&&(s.state=G0,s.timer.restart(d,s.delay,s.time),d(p))}),s.state=jh,s.on.call("start",e,e.__data__,s.index,s.group),s.state===jh){for(s.state=Kc,o=new Array(v=s.tween.length),y=0,g=-1;y<v;++y)(x=s.tween[y].value.call(e,e.__data__,s.index,s.group))&&(o[++g]=x);o.length=g+1}}function d(p){for(var y=p<s.duration?s.ease.call(null,p/s.duration):(s.timer.restart(h),s.state=Rh,1),g=-1,v=o.length;++g<v;)o[g].call(e,y);s.state===Rh&&(s.on.call("end",e,e.__data__,s.index,s.group),h())}function h(){s.state=Zc,s.timer.stop(),delete a[n];for(var p in a)return;delete e.__transition}}function Qc(e,n){var s=e.__transition,a,o,c=!0,u;if(s){n=n==null?null:n+"";for(u in s){if((a=s[u]).name!==n){c=!1;continue}o=a.state>jh&&a.state<Rh,a.state=Zc,a.timer.stop(),a.on.call(o?"interrupt":"cancel",e,e.__data__,a.index,a.group),delete s[u]}c&&delete e.__transition}}function s_(e){return this.each(function(){Qc(this,e)})}function a_(e,n){var s,a;return function(){var o=oi(this,e),c=o.tween;if(c!==s){a=s=c;for(var u=0,d=a.length;u<d;++u)if(a[u].name===n){a=a.slice(),a.splice(u,1);break}}o.tween=a}}function l_(e,n,s){var a,o;if(typeof s!="function")throw new Error;return function(){var c=oi(this,e),u=c.tween;if(u!==a){o=(a=u).slice();for(var d={name:n,value:s},h=0,p=o.length;h<p;++h)if(o[h].name===n){o[h]=d;break}h===p&&o.push(d)}c.tween=o}}function o_(e,n){var s=this._id;if(e+="",arguments.length<2){for(var a=Kn(this.node(),s).tween,o=0,c=a.length,u;o<c;++o)if((u=a[o]).name===e)return u.value;return null}return this.each((n==null?a_:l_)(s,e,n))}function om(e,n,s){var a=e._id;return e.each(function(){var o=oi(this,a);(o.value||(o.value={}))[n]=s.apply(this,arguments)}),function(o){return Kn(o,a).value[n]}}function Hb(e,n){var s;return(typeof n=="number"?ni:n instanceof Xs?lu:(s=Xs(n))?(n=s,lu):zb)(e,n)}function r_(e){return function(){this.removeAttribute(e)}}function c_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function u_(e,n,s){var a,o=s+"",c;return function(){var u=this.getAttribute(e);return u===o?null:u===a?c:c=n(a=u,s)}}function f_(e,n,s){var a,o=s+"",c;return function(){var u=this.getAttributeNS(e.space,e.local);return u===o?null:u===a?c:c=n(a=u,s)}}function d_(e,n,s){var a,o,c;return function(){var u,d=s(this),h;return d==null?void this.removeAttribute(e):(u=this.getAttribute(e),h=d+"",u===h?null:u===a&&h===o?c:(o=h,c=n(a=u,d)))}}function h_(e,n,s){var a,o,c;return function(){var u,d=s(this),h;return d==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),h=d+"",u===h?null:u===a&&h===o?c:(o=h,c=n(a=u,d)))}}function m_(e,n){var s=bu(e),a=s==="transform"?K2:Hb;return this.attrTween(e,typeof n=="function"?(s.local?h_:d_)(s,a,om(this,"attr."+e,n)):n==null?(s.local?c_:r_)(s):(s.local?f_:u_)(s,a,n))}function p_(e,n){return function(s){this.setAttribute(e,n.call(this,s))}}function g_(e,n){return function(s){this.setAttributeNS(e.space,e.local,n.call(this,s))}}function y_(e,n){var s,a;function o(){var c=n.apply(this,arguments);return c!==a&&(s=(a=c)&&g_(e,c)),s}return o._value=n,o}function v_(e,n){var s,a;function o(){var c=n.apply(this,arguments);return c!==a&&(s=(a=c)&&p_(e,c)),s}return o._value=n,o}function b_(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 a=bu(e);return this.tween(s,(a.local?y_:v_)(a,n))}function S_(e,n){return function(){lm(this,e).delay=+n.apply(this,arguments)}}function w_(e,n){return n=+n,function(){lm(this,e).delay=n}}function x_(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?S_:w_)(n,e)):Kn(this.node(),n).delay}function E_(e,n){return function(){oi(this,e).duration=+n.apply(this,arguments)}}function N_(e,n){return n=+n,function(){oi(this,e).duration=n}}function __(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?E_:N_)(n,e)):Kn(this.node(),n).duration}function A_(e,n){if(typeof n!="function")throw new Error;return function(){oi(this,e).ease=n}}function T_(e){var n=this._id;return arguments.length?this.each(A_(n,e)):Kn(this.node(),n).ease}function C_(e,n){return function(){var s=n.apply(this,arguments);if(typeof s!="function")throw new Error;oi(this,e).ease=s}}function M_(e){if(typeof e!="function")throw new Error;return this.each(C_(this._id,e))}function O_(e){typeof e!="function"&&(e=gb(e));for(var n=this._groups,s=n.length,a=new Array(s),o=0;o<s;++o)for(var c=n[o],u=c.length,d=a[o]=[],h,p=0;p<u;++p)(h=c[p])&&e.call(h,h.__data__,p,c)&&d.push(h);return new Di(a,this._parents,this._name,this._id)}function k_(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,s=e._groups,a=n.length,o=s.length,c=Math.min(a,o),u=new Array(a),d=0;d<c;++d)for(var h=n[d],p=s[d],y=h.length,g=u[d]=new Array(y),v,x=0;x<y;++x)(v=h[x]||p[x])&&(g[x]=v);for(;d<a;++d)u[d]=n[d];return new Di(u,this._parents,this._name,this._id)}function z_(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 D_(e,n,s){var a,o,c=z_(n)?lm:oi;return function(){var u=c(this,e),d=u.on;d!==a&&(o=(a=d).copy()).on(n,s),u.on=o}}function j_(e,n){var s=this._id;return arguments.length<2?Kn(this.node(),s).on.on(e):this.each(D_(s,e,n))}function R_(e){return function(){var n=this.parentNode;for(var s in this.__transition)if(+s!==e)return;n&&n.removeChild(this)}}function B_(){return this.on("end.remove",R_(this._id))}function L_(e){var n=this._name,s=this._id;typeof e!="function"&&(e=tm(e));for(var a=this._groups,o=a.length,c=new Array(o),u=0;u<o;++u)for(var d=a[u],h=d.length,p=c[u]=new Array(h),y,g,v=0;v<h;++v)(y=d[v])&&(g=e.call(y,y.__data__,v,d))&&("__data__"in y&&(g.__data__=y.__data__),p[v]=g,wu(p[v],n,s,v,p,Kn(y,s)));return new Di(c,this._parents,n,s)}function $_(e){var n=this._name,s=this._id;typeof e!="function"&&(e=pb(e));for(var a=this._groups,o=a.length,c=[],u=[],d=0;d<o;++d)for(var h=a[d],p=h.length,y,g=0;g<p;++g)if(y=h[g]){for(var v=e.call(y,y.__data__,g,h),x,E=Kn(y,s),A=0,T=v.length;A<T;++A)(x=v[A])&&wu(x,n,s,A,v,E);c.push(v),u.push(y)}return new Di(c,u,n,s)}var H_=lr.prototype.constructor;function U_(){return new H_(this._groups,this._parents)}function I_(e,n){var s,a,o;return function(){var c=ul(this,e),u=(this.style.removeProperty(e),ul(this,e));return c===u?null:c===s&&u===a?o:o=n(s=c,a=u)}}function Ub(e){return function(){this.style.removeProperty(e)}}function q_(e,n,s){var a,o=s+"",c;return function(){var u=ul(this,e);return u===o?null:u===a?c:c=n(a=u,s)}}function V_(e,n,s){var a,o,c;return function(){var u=ul(this,e),d=s(this),h=d+"";return d==null&&(h=d=(this.style.removeProperty(e),ul(this,e))),u===h?null:u===a&&h===o?c:(o=h,c=n(a=u,d))}}function Y_(e,n){var s,a,o,c="style."+n,u="end."+c,d;return function(){var h=oi(this,e),p=h.on,y=h.value[c]==null?d||(d=Ub(n)):void 0;(p!==s||o!==y)&&(a=(s=p).copy()).on(u,o=y),h.on=a}}function G_(e,n,s){var a=(e+="")=="transform"?X2:Hb;return n==null?this.styleTween(e,I_(e,a)).on("end.style."+e,Ub(e)):typeof n=="function"?this.styleTween(e,V_(e,a,om(this,"style."+e,n))).each(Y_(this._id,e)):this.styleTween(e,q_(e,a,n),s).on("end.style."+e,null)}function X_(e,n,s){return function(a){this.style.setProperty(e,n.call(this,a),s)}}function K_(e,n,s){var a,o;function c(){var u=n.apply(this,arguments);return u!==o&&(a=(o=u)&&X_(e,u,s)),a}return c._value=n,c}function Z_(e,n,s){var a="style."+(e+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(n==null)return this.tween(a,null);if(typeof n!="function")throw new Error;return this.tween(a,K_(e,n,s??""))}function Q_(e){return function(){this.textContent=e}}function F_(e){return function(){var n=e(this);this.textContent=n??""}}function J_(e){return this.tween("text",typeof e=="function"?F_(om(this,"text",e)):Q_(e==null?"":e+""))}function W_(e){return function(n){this.textContent=e.call(this,n)}}function P_(e){var n,s;function a(){var o=e.apply(this,arguments);return o!==s&&(n=(s=o)&&W_(o)),n}return a._value=e,a}function eA(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,P_(e))}function tA(){for(var e=this._name,n=this._id,s=Ib(),a=this._groups,o=a.length,c=0;c<o;++c)for(var u=a[c],d=u.length,h,p=0;p<d;++p)if(h=u[p]){var y=Kn(h,n);wu(h,e,s,p,u,{time:y.time+y.delay+y.duration,delay:0,duration:y.duration,ease:y.ease})}return new Di(a,this._parents,e,s)}function nA(){var e,n,s=this,a=s._id,o=s.size();return new Promise(function(c,u){var d={value:u},h={value:function(){--o===0&&c()}};s.each(function(){var p=oi(this,a),y=p.on;y!==e&&(n=(e=y).copy(),n._.cancel.push(d),n._.interrupt.push(d),n._.end.push(h)),p.on=n}),o===0&&c()})}var iA=0;function Di(e,n,s,a){this._groups=e,this._parents=n,this._name=s,this._id=a}function Ib(){return++iA}var Mi=lr.prototype;Di.prototype={constructor:Di,select:L_,selectAll:$_,selectChild:Mi.selectChild,selectChildren:Mi.selectChildren,filter:O_,merge:k_,selection:U_,transition:tA,call:Mi.call,nodes:Mi.nodes,node:Mi.node,size:Mi.size,empty:Mi.empty,each:Mi.each,on:j_,attr:m_,attrTween:b_,style:G_,styleTween:Z_,text:J_,textTween:eA,remove:B_,tween:o_,delay:x_,duration:__,ease:T_,easeVarying:M_,end:nA,[Symbol.iterator]:Mi[Symbol.iterator]};function sA(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var aA={time:null,delay:0,duration:250,ease:sA};function lA(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 oA(e){var n,s;e instanceof Di?(n=e._id,e=e._name):(n=Ib(),(s=aA).time=am(),e=e==null?null:e+"");for(var a=this._groups,o=a.length,c=0;c<o;++c)for(var u=a[c],d=u.length,h,p=0;p<d;++p)(h=u[p])&&wu(h,e,n,p,u,s||lA(h,n));return new Di(a,this._parents,e,n)}lr.prototype.interrupt=s_;lr.prototype.transition=oA;const jc=e=>()=>e;function rA(e,{sourceEvent:n,target:s,transform:a,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:a,enumerable:!0,configurable:!0},_:{value:o}})}function Oi(e,n,s){this.k=e,this.x=n,this.y=s}Oi.prototype={constructor:Oi,scale:function(e){return e===1?this:new Oi(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Oi(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 xu=new Oi(1,0,0);qb.prototype=Oi.prototype;function qb(e){for(;!e.__zoom;)if(!(e=e.parentNode))return xu;return e.__zoom}function lh(e){e.stopImmediatePropagation()}function Oo(e){e.preventDefault(),e.stopImmediatePropagation()}function cA(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function uA(){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 X0(){return this.__zoom||xu}function fA(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function dA(){return navigator.maxTouchPoints||"ontouchstart"in this}function hA(e,n,s){var a=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>a?(a+o)/2:Math.min(0,a)||Math.max(0,o),u>c?(c+u)/2:Math.min(0,c)||Math.max(0,u))}function Vb(){var e=cA,n=uA,s=hA,a=fA,o=dA,c=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],d=250,h=Xc,p=vu("start","zoom","end"),y,g,v,x=500,E=150,A=0,T=10;function C(L){L.property("__zoom",X0).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",q).filter(o).on("touchstart.zoom",Y).on("touchmove.zoom",Z).on("touchend.zoom touchcancel.zoom",le).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(L,K,O,H){var $=L.selection?L.selection():L;$.property("__zoom",X0),L!==$?j(L,K,O,H):$.interrupt().each(function(){D(this,arguments).event(H).start().zoom(null,typeof K=="function"?K.apply(this,arguments):K).end()})},C.scaleBy=function(L,K,O,H){C.scaleTo(L,function(){var $=this.__zoom.k,X=typeof K=="function"?K.apply(this,arguments):K;return $*X},O,H)},C.scaleTo=function(L,K,O,H){C.transform(L,function(){var $=n.apply(this,arguments),X=this.__zoom,se=O==null?N($):typeof O=="function"?O.apply(this,arguments):O,w=X.invert(se),z=typeof K=="function"?K.apply(this,arguments):K;return s(_(k(X,z),se,w),$,u)},O,H)},C.translateBy=function(L,K,O,H){C.transform(L,function(){return s(this.__zoom.translate(typeof K=="function"?K.apply(this,arguments):K,typeof O=="function"?O.apply(this,arguments):O),n.apply(this,arguments),u)},null,H)},C.translateTo=function(L,K,O,H,$){C.transform(L,function(){var X=n.apply(this,arguments),se=this.__zoom,w=H==null?N(X):typeof H=="function"?H.apply(this,arguments):H;return s(xu.translate(w[0],w[1]).scale(se.k).translate(typeof K=="function"?-K.apply(this,arguments):-K,typeof O=="function"?-O.apply(this,arguments):-O),X,u)},H,$)};function k(L,K){return K=Math.max(c[0],Math.min(c[1],K)),K===L.k?L:new Oi(K,L.x,L.y)}function _(L,K,O){var H=K[0]-O[0]*L.k,$=K[1]-O[1]*L.k;return H===L.x&&$===L.y?L:new Oi(L.k,H,$)}function N(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function j(L,K,O,H){L.on("start.zoom",function(){D(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){D(this,arguments).event(H).end()}).tween("zoom",function(){var $=this,X=arguments,se=D($,X).event(H),w=n.apply($,X),z=O==null?N(w):typeof O=="function"?O.apply($,X):O,F=Math.max(w[1][0]-w[0][0],w[1][1]-w[0][1]),P=$.__zoom,fe=typeof K=="function"?K.apply($,X):K,de=h(P.invert(z).concat(F/P.k),fe.invert(z).concat(F/fe.k));return function(ie){if(ie===1)ie=fe;else{var te=de(ie),oe=F/te[2];ie=new Oi(oe,z[0]-te[0]*oe,z[1]-te[1]*oe)}se.zoom(null,ie)}})}function D(L,K,O){return!O&&L.__zooming||new B(L,K)}function B(L,K){this.that=L,this.args=K,this.active=0,this.sourceEvent=null,this.extent=n.apply(L,K),this.taps=0}B.prototype={event:function(L){return L&&(this.sourceEvent=L),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(L,K){return this.mouse&&L!=="mouse"&&(this.mouse[1]=K.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=K.invert(this.touch0[0])),this.touch1&&L!=="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(L){var K=un(this.that).datum();p.call(L,this.that,new rA(L,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:p}),K)}};function R(L,...K){if(!e.apply(this,arguments))return;var O=D(this,K).event(L),H=this.__zoom,$=Math.max(c[0],Math.min(c[1],H.k*Math.pow(2,a.apply(this,arguments)))),X=Un(L);if(O.wheel)(O.mouse[0][0]!==X[0]||O.mouse[0][1]!==X[1])&&(O.mouse[1]=H.invert(O.mouse[0]=X)),clearTimeout(O.wheel);else{if(H.k===$)return;O.mouse=[X,H.invert(X)],Qc(this),O.start()}Oo(L),O.wheel=setTimeout(se,E),O.zoom("mouse",s(_(k(H,$),O.mouse[0],O.mouse[1]),O.extent,u));function se(){O.wheel=null,O.end()}}function U(L,...K){if(v||!e.apply(this,arguments))return;var O=L.currentTarget,H=D(this,K,!0).event(L),$=un(L.view).on("mousemove.zoom",z,!0).on("mouseup.zoom",F,!0),X=Un(L,O),se=L.clientX,w=L.clientY;Ab(L.view),lh(L),H.mouse=[X,this.__zoom.invert(X)],Qc(this),H.start();function z(P){if(Oo(P),!H.moved){var fe=P.clientX-se,de=P.clientY-w;H.moved=fe*fe+de*de>A}H.event(P).zoom("mouse",s(_(H.that.__zoom,H.mouse[0]=Un(P,O),H.mouse[1]),H.extent,u))}function F(P){$.on("mousemove.zoom mouseup.zoom",null),Tb(P.view,H.moved),Oo(P),H.event(P).end()}}function q(L,...K){if(e.apply(this,arguments)){var O=this.__zoom,H=Un(L.changedTouches?L.changedTouches[0]:L,this),$=O.invert(H),X=O.k*(L.shiftKey?.5:2),se=s(_(k(O,X),H,$),n.apply(this,K),u);Oo(L),d>0?un(this).transition().duration(d).call(j,se,H,L):un(this).call(C.transform,se,H,L)}}function Y(L,...K){if(e.apply(this,arguments)){var O=L.touches,H=O.length,$=D(this,K,L.changedTouches.length===H).event(L),X,se,w,z;for(lh(L),se=0;se<H;++se)w=O[se],z=Un(w,this),z=[z,this.__zoom.invert(z),w.identifier],$.touch0?!$.touch1&&$.touch0[2]!==z[2]&&($.touch1=z,$.taps=0):($.touch0=z,X=!0,$.taps=1+!!y);y&&(y=clearTimeout(y)),X&&($.taps<2&&(g=z[0],y=setTimeout(function(){y=null},x)),Qc(this),$.start())}}function Z(L,...K){if(this.__zooming){var O=D(this,K).event(L),H=L.changedTouches,$=H.length,X,se,w,z;for(Oo(L),X=0;X<$;++X)se=H[X],w=Un(se,this),O.touch0&&O.touch0[2]===se.identifier?O.touch0[0]=w:O.touch1&&O.touch1[2]===se.identifier&&(O.touch1[0]=w);if(se=O.that.__zoom,O.touch1){var F=O.touch0[0],P=O.touch0[1],fe=O.touch1[0],de=O.touch1[1],ie=(ie=fe[0]-F[0])*ie+(ie=fe[1]-F[1])*ie,te=(te=de[0]-P[0])*te+(te=de[1]-P[1])*te;se=k(se,Math.sqrt(ie/te)),w=[(F[0]+fe[0])/2,(F[1]+fe[1])/2],z=[(P[0]+de[0])/2,(P[1]+de[1])/2]}else if(O.touch0)w=O.touch0[0],z=O.touch0[1];else return;O.zoom("touch",s(_(se,w,z),O.extent,u))}}function le(L,...K){if(this.__zooming){var O=D(this,K).event(L),H=L.changedTouches,$=H.length,X,se;for(lh(L),v&&clearTimeout(v),v=setTimeout(function(){v=null},x),X=0;X<$;++X)se=H[X],O.touch0&&O.touch0[2]===se.identifier?delete O.touch0:O.touch1&&O.touch1[2]===se.identifier&&delete O.touch1;if(O.touch1&&!O.touch0&&(O.touch0=O.touch1,delete O.touch1),O.touch0)O.touch0[1]=this.__zoom.invert(O.touch0[0]);else if(O.end(),O.taps===2&&(se=Un(se,this),Math.hypot(g[0]-se[0],g[1]-se[1])<T)){var w=un(this).on("dblclick.zoom");w&&w.apply(this,arguments)}}}return C.wheelDelta=function(L){return arguments.length?(a=typeof L=="function"?L:jc(+L),C):a},C.filter=function(L){return arguments.length?(e=typeof L=="function"?L:jc(!!L),C):e},C.touchable=function(L){return arguments.length?(o=typeof L=="function"?L:jc(!!L),C):o},C.extent=function(L){return arguments.length?(n=typeof L=="function"?L:jc([[+L[0][0],+L[0][1]],[+L[1][0],+L[1][1]]]),C):n},C.scaleExtent=function(L){return arguments.length?(c[0]=+L[0],c[1]=+L[1],C):[c[0],c[1]]},C.translateExtent=function(L){return arguments.length?(u[0][0]=+L[0][0],u[1][0]=+L[1][0],u[0][1]=+L[0][1],u[1][1]=+L[1][1],C):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},C.constrain=function(L){return arguments.length?(s=L,C):s},C.duration=function(L){return arguments.length?(d=+L,C):d},C.interpolate=function(L){return arguments.length?(h=L,C):h},C.on=function(){var L=p.on.apply(p,arguments);return L===p?C:L},C.clickDistance=function(L){return arguments.length?(A=(L=+L)*L,C):Math.sqrt(A)},C.tapDistance=function(L){return arguments.length?(T=+L,C):T},C}const Xn={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:a})=>`Couldn't create edge for ${e} handle id: "${e==="source"?s:a}", 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.`},Ko=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Yb=["Enter"," ","Escape"],Gb={"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 dl;(function(e){e.Strict="strict",e.Loose="loose"})(dl||(dl={}));var Gs;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Gs||(Gs={}));var Zo;(function(e){e.Partial="partial",e.Full="full"})(Zo||(Zo={}));const Xb={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var gs;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(gs||(gs={}));var Qo;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Qo||(Qo={}));var pe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(pe||(pe={}));const K0={[pe.Left]:pe.Right,[pe.Right]:pe.Left,[pe.Top]:pe.Bottom,[pe.Bottom]:pe.Top};function Kb(e){return e===null?null:e?"valid":"invalid"}const Zb=e=>"id"in e&&"source"in e&&"target"in e,mA=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),rm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),rr=(e,n=[0,0])=>{const{width:s,height:a}=ji(e),o=e.origin??n,c=s*o[0],u=a*o[1];return{x:e.position.x-c,y:e.position.y-u}},pA=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const s=e.reduce((a,o)=>{const c=typeof o=="string";let u=!n.nodeLookup&&!c?o:void 0;n.nodeLookup&&(u=c?n.nodeLookup.get(o):rm(o)?o:n.nodeLookup.get(o.id));const d=u?uu(u,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Eu(a,d)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Nu(s)},cr=(e,n={})=>{let s={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return e.forEach(o=>{(n.filter===void 0||n.filter(o))&&(s=Eu(s,uu(o)),a=!0)}),a?Nu(s):{x:0,y:0,width:0,height:0}},cm=(e,n,[s,a,o]=[0,0,1],c=!1,u=!1)=>{const d={...wl(n,[s,a,o]),width:n.width/o,height:n.height/o},h=[];for(const p of e.values()){const{measured:y,selectable:g=!0,hidden:v=!1}=p;if(u&&!g||v)continue;const x=y.width??p.width??p.initialWidth??null,E=y.height??p.height??p.initialHeight??null,A=Fo(d,ml(p)),T=(x??0)*(E??0),C=c&&A>0;(!p.internals.handleBounds||C||A>=T||p.dragging)&&h.push(p)}return h},gA=(e,n)=>{const s=new Set;return e.forEach(a=>{s.add(a.id)}),n.filter(a=>s.has(a.source)||s.has(a.target))};function yA(e,n){const s=new Map,a=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)&&(!a||a.has(o.id))&&s.set(o.id,o)}),s}async function vA({nodes:e,width:n,height:s,panZoom:a,minZoom:o,maxZoom:c},u){if(e.size===0)return!0;const d=yA(e,u),h=cr(d),p=fm(h,n,s,u?.minZoom??o,u?.maxZoom??c,u?.padding??.1);return await a.setViewport(p,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),!0}function Qb({nodeId:e,nextPosition:n,nodeLookup:s,nodeOrigin:a=[0,0],nodeExtent:o,onError:c}){const u=s.get(e),d=u.parentId?s.get(u.parentId):void 0,{x:h,y:p}=d?d.internals.positionAbsolute:{x:0,y:0},y=u.origin??a;let g=u.extent||o;if(u.extent==="parent"&&!u.expandParent)if(!d)c?.("005",Xn.error005());else{const x=d.measured.width,E=d.measured.height;x&&E&&(g=[[h,p],[h+x,p+E]])}else d&&Qs(u.extent)&&(g=[[u.extent[0][0]+h,u.extent[0][1]+p],[u.extent[1][0]+h,u.extent[1][1]+p]]);const v=Qs(g)?Zs(n,g,u.measured):n;return(u.measured.width===void 0||u.measured.height===void 0)&&c?.("015",Xn.error015()),{position:{x:v.x-h+(u.measured.width??0)*y[0],y:v.y-p+(u.measured.height??0)*y[1]},positionAbsolute:v}}async function bA({nodesToRemove:e=[],edgesToRemove:n=[],nodes:s,edges:a,onBeforeDelete:o}){const c=new Set(e.map(v=>v.id)),u=[];for(const v of s){if(v.deletable===!1)continue;const x=c.has(v.id),E=!x&&v.parentId&&u.find(A=>A.id===v.parentId);(x||E)&&u.push(v)}const d=new Set(n.map(v=>v.id)),h=a.filter(v=>v.deletable!==!1),y=gA(u,h);for(const v of h)d.has(v.id)&&!y.find(E=>E.id===v.id)&&y.push(v);if(!o)return{edges:y,nodes:u};const g=await o({nodes:u,edges:y});return typeof g=="boolean"?g?{edges:y,nodes:u}:{edges:[],nodes:[]}:g}const hl=(e,n=0,s=1)=>Math.min(Math.max(e,n),s),Zs=(e={x:0,y:0},n,s)=>({x:hl(e.x,n[0][0],n[1][0]-(s?.width??0)),y:hl(e.y,n[0][1],n[1][1]-(s?.height??0))});function Fb(e,n,s){const{width:a,height:o}=ji(s),{x:c,y:u}=s.internals.positionAbsolute;return Zs(e,[[c,u],[c+a,u+o]],n)}const Z0=(e,n,s)=>e<n?hl(Math.abs(e-n),1,n)/n:e>s?-hl(Math.abs(e-s),1,n)/n:0,um=(e,n,s=15,a=40)=>{const o=Z0(e.x,a,n.width-a)*s,c=Z0(e.y,a,n.height-a)*s;return[o,c]},Eu=(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)}),Bh=({x:e,y:n,width:s,height:a})=>({x:e,y:n,x2:e+s,y2:n+a}),Nu=({x:e,y:n,x2:s,y2:a})=>({x:e,y:n,width:s-e,height:a-n}),ml=(e,n=[0,0])=>{const{x:s,y:a}=rm(e)?e.internals.positionAbsolute:rr(e,n);return{x:s,y:a,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},uu=(e,n=[0,0])=>{const{x:s,y:a}=rm(e)?e.internals.positionAbsolute:rr(e,n);return{x:s,y:a,x2:s+(e.measured?.width??e.width??e.initialWidth??0),y2:a+(e.measured?.height??e.height??e.initialHeight??0)}},Jb=(e,n)=>Nu(Eu(Bh(e),Bh(n))),Fo=(e,n)=>{const s=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),a=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(s*a)},Q0=e=>Vn(e.width)&&Vn(e.height)&&Vn(e.x)&&Vn(e.y),Vn=e=>!isNaN(e)&&isFinite(e),Wb=(e,n)=>(s,a)=>{},ur=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),wl=({x:e,y:n},[s,a,o],c=!1,u=[1,1])=>{const d={x:(e-s)/o,y:(n-a)/o};return c?ur(d,u):d},pl=({x:e,y:n},[s,a,o])=>({x:e*o+s,y:n*o+a});function Ya(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 SA(e,n,s){if(typeof e=="string"||typeof e=="number"){const a=Ya(e,s),o=Ya(e,n);return{top:a,right:o,bottom:a,left:o,x:o*2,y:a*2}}if(typeof e=="object"){const a=Ya(e.top??e.y??0,s),o=Ya(e.bottom??e.y??0,s),c=Ya(e.left??e.x??0,n),u=Ya(e.right??e.x??0,n);return{top:a,right:u,bottom:o,left:c,x:c+u,y:a+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function wA(e,n,s,a,o,c){const{x:u,y:d}=pl(e,[n,s,a]),{x:h,y:p}=pl({x:e.x+e.width,y:e.y+e.height},[n,s,a]),y=o-h,g=c-p;return{left:Math.floor(u),top:Math.floor(d),right:Math.floor(y),bottom:Math.floor(g)}}const fm=(e,n,s,a,o,c)=>{const u=SA(c,n,s),d=(n-u.x)/e.width,h=(s-u.y)/e.height,p=Math.min(d,h),y=hl(p,a,o),g=e.x+e.width/2,v=e.y+e.height/2,x=n/2-g*y,E=s/2-v*y,A=wA(e,x,E,y,n,s),T={left:Math.min(A.left-u.left,0),top:Math.min(A.top-u.top,0),right:Math.min(A.right-u.right,0),bottom:Math.min(A.bottom-u.bottom,0)};return{x:x-T.left+T.right,y:E-T.top+T.bottom,zoom:y}},Jo=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Qs(e){return e!=null&&e!=="parent"}function ji(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Pb(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function e1(e,n={width:0,height:0},s,a,o){const c={...e},u=a.get(s);if(u){const d=u.origin||o;c.x+=u.internals.positionAbsolute.x-(n.width??0)*d[0],c.y+=u.internals.positionAbsolute.y-(n.height??0)*d[1]}return c}function F0(e,n){if(e.size!==n.size)return!1;for(const s of e)if(!n.has(s))return!1;return!0}function xA(){let e,n;return{promise:new Promise((a,o)=>{e=a,n=o}),resolve:e,reject:n}}function EA(e){return{...Gb,...e||{}}}function $o(e,{snapGrid:n=[0,0],snapToGrid:s=!1,transform:a,containerBounds:o}){const{x:c,y:u}=Yn(e),d=wl({x:c-(o?.left??0),y:u-(o?.top??0)},a),{x:h,y:p}=s?ur(d,n):d;return{xSnapped:h,ySnapped:p,...d}}const dm=e=>({width:e.offsetWidth,height:e.offsetHeight}),t1=e=>e?.getRootNode?.()||window?.document,NA=["INPUT","SELECT","TEXTAREA"];function n1(e){const n=e.composedPath?.()?.[0]||e.target;return n?.nodeType!==1?!1:NA.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const i1=e=>"clientX"in e,Yn=(e,n)=>{const s=i1(e),a=s?e.clientX:e.touches?.[0].clientX,o=s?e.clientY:e.touches?.[0].clientY;return{x:a-(n?.left??0),y:o-(n?.top??0)}},J0=(e,n,s,a,o)=>{const c=n.querySelectorAll(`.${e}`);return!c||!c.length?null:Array.from(c).map(u=>{const d=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:o,position:u.getAttribute("data-handlepos"),x:(d.left-s.left)/a,y:(d.top-s.top)/a,...dm(u)}})};function s1({sourceX:e,sourceY:n,targetX:s,targetY:a,sourceControlX:o,sourceControlY:c,targetControlX:u,targetControlY:d}){const h=e*.125+o*.375+u*.375+s*.125,p=n*.125+c*.375+d*.375+a*.125,y=Math.abs(h-e),g=Math.abs(p-n);return[h,p,y,g]}function Rc(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function W0({pos:e,x1:n,y1:s,x2:a,y2:o,c}){switch(e){case pe.Left:return[n-Rc(n-a,c),s];case pe.Right:return[n+Rc(a-n,c),s];case pe.Top:return[n,s-Rc(s-o,c)];case pe.Bottom:return[n,s+Rc(o-s,c)]}}function a1({sourceX:e,sourceY:n,sourcePosition:s=pe.Bottom,targetX:a,targetY:o,targetPosition:c=pe.Top,curvature:u=.25}){const[d,h]=W0({pos:s,x1:e,y1:n,x2:a,y2:o,c:u}),[p,y]=W0({pos:c,x1:a,y1:o,x2:e,y2:n,c:u}),[g,v,x,E]=s1({sourceX:e,sourceY:n,targetX:a,targetY:o,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:y});return[`M${e},${n} C${d},${h} ${p},${y} ${a},${o}`,g,v,x,E]}function l1({sourceX:e,sourceY:n,targetX:s,targetY:a}){const o=Math.abs(s-e)/2,c=s<e?s+o:s-o,u=Math.abs(a-n)/2,d=a<n?a+u:a-u;return[c,d,o,u]}function _A({sourceNode:e,targetNode:n,selected:s=!1,zIndex:a=0,elevateOnSelect:o=!1,zIndexMode:c="basic"}){if(c==="manual")return a;const u=o&&s?a+1e3:a,d=Math.max(e.parentId||o&&e.selected?e.internals.z:0,n.parentId||o&&n.selected?n.internals.z:0);return u+d}function AA({sourceNode:e,targetNode:n,width:s,height:a,transform:o}){const c=Eu(uu(e),uu(n));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u={x:-o[0]/o[2],y:-o[1]/o[2],width:s/o[2],height:a/o[2]};return Fo(u,Nu(c))>0}const TA=({source:e,sourceHandle:n,target:s,targetHandle:a})=>`xy-edge__${e}${n||""}-${s}${a||""}`,CA=(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)),MA=(e,n,s={})=>{if(!e.source||!e.target)return s.onError?.("006",Xn.error006()),n;const a=s.getEdgeId||TA;let o;return Zb(e)?o={...e}:o={...e,id:a(e)},CA(o,n)?n:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,n.concat(o))};function o1({sourceX:e,sourceY:n,targetX:s,targetY:a}){const[o,c,u,d]=l1({sourceX:e,sourceY:n,targetX:s,targetY:a});return[`M ${e},${n}L ${s},${a}`,o,c,u,d]}const P0={[pe.Left]:{x:-1,y:0},[pe.Right]:{x:1,y:0},[pe.Top]:{x:0,y:-1},[pe.Bottom]:{x:0,y:1}},OA=({source:e,sourcePosition:n=pe.Bottom,target:s})=>n===pe.Left||n===pe.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},ev=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function kA({source:e,sourcePosition:n=pe.Bottom,target:s,targetPosition:a=pe.Top,center:o,offset:c,stepPosition:u}){const d=P0[n],h=P0[a],p={x:e.x+d.x*c,y:e.y+d.y*c},y={x:s.x+h.x*c,y:s.y+h.y*c},g=OA({source:p,sourcePosition:n,target:y}),v=g.x!==0?"x":"y",x=g[v];let E=[],A,T;const C={x:0,y:0},k={x:0,y:0},[,,_,N]=l1({sourceX:e.x,sourceY:e.y,targetX:s.x,targetY:s.y});if(d[v]*h[v]===-1){v==="x"?(A=o.x??p.x+(y.x-p.x)*u,T=o.y??(p.y+y.y)/2):(A=o.x??(p.x+y.x)/2,T=o.y??p.y+(y.y-p.y)*u);const R=[{x:A,y:p.y},{x:A,y:y.y}],U=[{x:p.x,y:T},{x:y.x,y:T}];d[v]===x?E=v==="x"?R:U:E=v==="x"?U:R}else{const R=[{x:p.x,y:y.y}],U=[{x:y.x,y:p.y}];if(v==="x"?E=d.x===x?U:R:E=d.y===x?R:U,n===a){const L=Math.abs(e[v]-s[v]);if(L<=c){const K=Math.min(c-1,c-L);d[v]===x?C[v]=(p[v]>e[v]?-1:1)*K:k[v]=(y[v]>s[v]?-1:1)*K}}if(n!==a){const L=v==="x"?"y":"x",K=d[v]===h[L],O=p[L]>y[L],H=p[L]<y[L];(d[v]===1&&(!K&&O||K&&H)||d[v]!==1&&(!K&&H||K&&O))&&(E=v==="x"?R:U)}const q={x:p.x+C.x,y:p.y+C.y},Y={x:y.x+k.x,y:y.y+k.y},Z=Math.max(Math.abs(q.x-E[0].x),Math.abs(Y.x-E[0].x)),le=Math.max(Math.abs(q.y-E[0].y),Math.abs(Y.y-E[0].y));Z>=le?(A=(q.x+Y.x)/2,T=E[0].y):(A=E[0].x,T=(q.y+Y.y)/2)}const j={x:p.x+C.x,y:p.y+C.y},D={x:y.x+k.x,y:y.y+k.y};return[[e,...j.x!==E[0].x||j.y!==E[0].y?[j]:[],...E,...D.x!==E[E.length-1].x||D.y!==E[E.length-1].y?[D]:[],s],A,T,_,N]}function zA(e,n,s,a){const o=Math.min(ev(e,n)/2,ev(n,s)/2,a),{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 p=e.x<s.x?-1:1,y=e.y<s.y?1:-1;return`L ${c+o*p},${u}Q ${c},${u} ${c},${u+o*y}`}const d=e.x<s.x?1:-1,h=e.y<s.y?-1:1;return`L ${c},${u+o*h}Q ${c},${u} ${c+o*d},${u}`}function Lh({sourceX:e,sourceY:n,sourcePosition:s=pe.Bottom,targetX:a,targetY:o,targetPosition:c=pe.Top,borderRadius:u=5,centerX:d,centerY:h,offset:p=20,stepPosition:y=.5}){const[g,v,x,E,A]=kA({source:{x:e,y:n},sourcePosition:s,target:{x:a,y:o},targetPosition:c,center:{x:d,y:h},offset:p,stepPosition:y});let T=`M${g[0].x} ${g[0].y}`;for(let C=1;C<g.length-1;C++)T+=zA(g[C-1],g[C],g[C+1],u);return T+=`L${g[g.length-1].x} ${g[g.length-1].y}`,[T,v,x,E,A]}function tv(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function DA(e){const{sourceNode:n,targetNode:s}=e;if(!tv(n)||!tv(s))return null;const a=n.internals.handleBounds||nv(n.handles),o=s.internals.handleBounds||nv(s.handles),c=iv(a?.source??[],e.sourceHandle),u=iv(e.connectionMode===dl.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!c||!u)return e.onError?.("008",Xn.error008(c?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const d=c?.position||pe.Bottom,h=u?.position||pe.Top,p=Fs(n,c,d),y=Fs(s,u,h);return{sourceX:p.x,sourceY:p.y,targetX:y.x,targetY:y.y,sourcePosition:d,targetPosition:h}}function nv(e){if(!e)return null;const n=[],s=[];for(const a of e)a.width=a.width??1,a.height=a.height??1,a.type==="source"?n.push(a):a.type==="target"&&s.push(a);return{source:n,target:s}}function Fs(e,n,s=pe.Left,a=!1){const o=(n?.x??0)+e.internals.positionAbsolute.x,c=(n?.y??0)+e.internals.positionAbsolute.y,{width:u,height:d}=n??ji(e);if(a)return{x:o+u/2,y:c+d/2};switch(n?.position??s){case pe.Top:return{x:o+u/2,y:c};case pe.Right:return{x:o+u,y:c+d/2};case pe.Bottom:return{x:o+u/2,y:c+d};case pe.Left:return{x:o,y:c+d/2}}}function iv(e,n){return e&&(n?e.find(s=>s.id===n):e[0])||null}function $h(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(a=>`${a}=${e[a]}`).join("&")}`:""}function jA(e,{id:n,defaultColor:s,defaultMarkerStart:a,defaultMarkerEnd:o}){const c=new Set;return e.reduce((u,d)=>([d.markerStart||a,d.markerEnd||o].forEach(h=>{if(h&&typeof h=="object"){const p=$h(h,n);c.has(p)||(u.push({id:p,color:h.color||s,...h}),c.add(p))}}),u),[]).sort((u,d)=>u.id.localeCompare(d.id))}const r1=1e3,RA=10,hm={nodeOrigin:[0,0],nodeExtent:Ko,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},BA={...hm,checkEquality:!0};function mm(e,n){const s={...e};for(const a in n)n[a]!==void 0&&(s[a]=n[a]);return s}function LA(e,n,s){const a=mm(hm,s);for(const o of e.values())if(o.parentId)gm(o,e,n,a);else{const c=rr(o,a.nodeOrigin),u=Qs(o.extent)?o.extent:a.nodeExtent,d=Zs(c,u,ji(o));o.internals.positionAbsolute=d}}function $A(e,n){if(!e.handles)return e.measured?n?.internals.handleBounds:void 0;const s=[],a=[];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"&&a.push(c)}return{source:s,target:a}}function pm(e){return e==="manual"}function Hh(e,n,s,a={}){const o=mm(BA,a),c={i:0},u=new Map(n),d=o?.elevateNodesOnSelect&&!pm(o.zIndexMode)?r1:0;let h=e.length>0,p=!1;n.clear(),s.clear();for(const y of e){let g=u.get(y.id);if(o.checkEquality&&y===g?.internals.userNode)n.set(y.id,g);else{const v=rr(y,o.nodeOrigin),x=Qs(y.extent)?y.extent:o.nodeExtent,E=Zs(v,x,ji(y));g={...o.defaults,...y,measured:{width:y.measured?.width,height:y.measured?.height},internals:{positionAbsolute:E,handleBounds:$A(y,g),z:c1(y,d,o.zIndexMode),userNode:y}},n.set(y.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(h=!1),y.parentId&&gm(g,n,s,a,c),p||=y.selected??!1}return{nodesInitialized:h,hasSelectedNodes:p}}function HA(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 gm(e,n,s,a,o){const{elevateNodesOnSelect:c,nodeOrigin:u,nodeExtent:d,zIndexMode:h}=mm(hm,a),p=e.parentId,y=n.get(p);if(!y){console.warn(`Parent node ${p} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}HA(e,s),o&&!y.parentId&&y.internals.rootParentIndex===void 0&&h==="auto"&&(y.internals.rootParentIndex=++o.i,y.internals.z=y.internals.z+o.i*RA),o&&y.internals.rootParentIndex!==void 0&&(o.i=y.internals.rootParentIndex);const g=c&&!pm(h)?r1:0,{x:v,y:x,z:E}=UA(e,y,u,d,g,h),{positionAbsolute:A}=e.internals,T=v!==A.x||x!==A.y;(T||E!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:T?{x:v,y:x}:A,z:E}})}function c1(e,n,s){const a=Vn(e.zIndex)?e.zIndex:0;return pm(s)?a:a+(e.selected?n:0)}function UA(e,n,s,a,o,c){const{x:u,y:d}=n.internals.positionAbsolute,h=ji(e),p=rr(e,s),y=Qs(e.extent)?Zs(p,e.extent,h):p;let g=Zs({x:u+y.x,y:d+y.y},a,h);e.extent==="parent"&&(g=Fb(g,h,n));const v=c1(e,o,c),x=n.internals.z??0;return{x:g.x,y:g.y,z:x>=v?x+1:v}}function ym(e,n,s,a=[0,0]){const o=[],c=new Map;for(const u of e){const d=n.get(u.parentId);if(!d)continue;const h=c.get(u.parentId)?.expandedRect??ml(d),p=Jb(h,u.rect);c.set(u.parentId,{expandedRect:p,parent:d})}return c.size>0&&c.forEach(({expandedRect:u,parent:d},h)=>{const p=d.internals.positionAbsolute,y=ji(d),g=d.origin??a,v=u.x<p.x?Math.round(Math.abs(p.x-u.x)):0,x=u.y<p.y?Math.round(Math.abs(p.y-u.y)):0,E=Math.max(y.width,Math.round(u.width)),A=Math.max(y.height,Math.round(u.height)),T=(E-y.width)*g[0],C=(A-y.height)*g[1];(v>0||x>0||T||C)&&(o.push({id:h,type:"position",position:{x:d.position.x-v+T,y:d.position.y-x+C}}),s.get(h)?.forEach(k=>{e.some(_=>_.id===k.id)||o.push({id:k.id,type:"position",position:{x:k.position.x+v,y:k.position.y+x}})})),(y.width<u.width||y.height<u.height||v||x)&&o.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:E+(v?g[0]*v-T:0),height:A+(x?g[1]*x-C:0)}})}),o}function IA(e,n,s,a,o,c,u){const d=a?.querySelector(".xyflow__viewport");let h=!1;if(!d)return{changes:[],updatedInternals:h};const p=[],y=window.getComputedStyle(d),{m22:g}=new window.DOMMatrixReadOnly(y.transform),v=[];for(const x of e.values()){const E=n.get(x.id);if(!E)continue;if(E.hidden){n.set(E.id,{...E,internals:{...E.internals,handleBounds:void 0}}),h=!0;continue}const A=dm(x.nodeElement),T=E.measured.width!==A.width||E.measured.height!==A.height;if(!!(A.width&&A.height&&(T||!E.internals.handleBounds||x.force))){const k=x.nodeElement.getBoundingClientRect(),_=Qs(E.extent)?E.extent:c;let{positionAbsolute:N}=E.internals;E.parentId&&E.extent==="parent"?N=Fb(N,A,n.get(E.parentId)):_&&(N=Zs(N,_,A));const j={...E,measured:A,internals:{...E.internals,positionAbsolute:N,handleBounds:{source:J0("source",x.nodeElement,k,g,E.id),target:J0("target",x.nodeElement,k,g,E.id)}}};n.set(E.id,j),E.parentId&&gm(j,n,s,{nodeOrigin:o,zIndexMode:u}),h=!0,T&&(p.push({id:E.id,type:"dimensions",dimensions:A}),E.expandParent&&E.parentId&&v.push({id:E.id,parentId:E.parentId,rect:ml(j,o)}))}}if(v.length>0){const x=ym(v,n,s,o);p.push(...x)}return{changes:p,updatedInternals:h}}async function qA({delta:e,panZoom:n,transform:s,translateExtent:a,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]],a);return!!u&&(u.x!==s[0]||u.y!==s[1]||u.k!==s[2])}function sv(e,n,s,a,o,c){let u=o;const d=a.get(u)||new Map;a.set(u,d.set(s,n)),u=`${o}-${e}`;const h=a.get(u)||new Map;if(a.set(u,h.set(s,n)),c){u=`${o}-${e}-${c}`;const p=a.get(u)||new Map;a.set(u,p.set(s,n))}}function u1(e,n,s){e.clear(),n.clear();for(const a of s){const{source:o,target:c,sourceHandle:u=null,targetHandle:d=null}=a,h={edgeId:a.id,source:o,target:c,sourceHandle:u,targetHandle:d},p=`${o}-${u}--${c}-${d}`,y=`${c}-${d}--${o}-${u}`;sv("source",h,y,e,o,u),sv("target",h,p,e,c,d),n.set(a.id,a)}}function f1(e,n){if(!e.parentId)return!1;const s=n.get(e.parentId);return s?s.selected?!0:f1(s,n):!1}function av(e,n,s){let a=e;do{if(a?.matches?.(n))return!0;if(a===s)return!1;a=a?.parentElement}while(a);return!1}function VA(e,n,s,a){const o=new Map;for(const[c,u]of e)if((u.selected||u.id===a)&&(!u.parentId||!f1(u,e))&&(u.draggable||n&&typeof u.draggable>"u")){const d=e.get(c);d&&o.set(c,{id:c,position:d.position||{x:0,y:0},distance:{x:s.x-d.internals.positionAbsolute.x,y:s.y-d.internals.positionAbsolute.y},extent:d.extent,parentId:d.parentId,origin:d.origin,expandParent:d.expandParent,internals:{positionAbsolute:d.internals.positionAbsolute||{x:0,y:0}},measured:{width:d.measured.width??0,height:d.measured.height??0}})}return o}function oh({nodeId:e,dragItems:n,nodeLookup:s,dragging:a=!0}){const o=[];for(const[u,d]of n){const h=s.get(u)?.internals.userNode;h&&o.push({...h,position:d.position,dragging:a})}if(!e)return[o[0],o];const c=s.get(e)?.internals.userNode;return[c?{...c,position:n.get(e)?.position||c.position,dragging:a}:o[0],o]}function YA({dragItems:e,snapGrid:n,x:s,y:a}){const o=e.values().next().value;if(!o)return null;const c={x:s-o.distance.x,y:a-o.distance.y},u=ur(c,n);return{x:u.x-c.x,y:u.y-c.y}}function GA({onNodeMouseDown:e,getStoreItems:n,onDragStart:s,onDrag:a,onDragStop:o}){let c={x:null,y:null},u=0,d=new Map,h=!1,p={x:0,y:0},y=null,g=!1,v=null,x=!1,E=!1,A=null;function T({noDragClassName:k,handleSelector:_,domNode:N,isSelectable:j,nodeId:D,nodeClickDistance:B=0}){v=un(N);function R({x:Z,y:le}){const{nodeLookup:L,nodeExtent:K,snapGrid:O,snapToGrid:H,nodeOrigin:$,onNodeDrag:X,onSelectionDrag:se,onError:w,updateNodePositions:z}=n();c={x:Z,y:le};let F=!1;const P=d.size>1,fe=P&&K?Bh(cr(d)):null,de=P&&H?YA({dragItems:d,snapGrid:O,x:Z,y:le}):null;for(const[ie,te]of d){if(!L.has(ie))continue;let oe={x:Z-te.distance.x,y:le-te.distance.y};H&&(oe=de?{x:Math.round(oe.x+de.x),y:Math.round(oe.y+de.y)}:ur(oe,O));let ve=null;if(P&&K&&!te.extent&&fe){const{positionAbsolute:ge}=te.internals,xe=ge.x-fe.x+K[0][0],Ce=ge.x+te.measured.width-fe.x2+K[1][0],Ue=ge.y-fe.y+K[0][1],Pe=ge.y+te.measured.height-fe.y2+K[1][1];ve=[[xe,Ue],[Ce,Pe]]}const{position:Se,positionAbsolute:me}=Qb({nodeId:ie,nextPosition:oe,nodeLookup:L,nodeExtent:ve||K,nodeOrigin:$,onError:w});F=F||te.position.x!==Se.x||te.position.y!==Se.y,te.position=Se,te.internals.positionAbsolute=me}if(E=E||F,!!F&&(z(d,!0),A&&(a||X||!D&&se))){const[ie,te]=oh({nodeId:D,dragItems:d,nodeLookup:L});a?.(A,d,ie,te),X?.(A,ie,te),D||se?.(A,te)}}async function U(){if(!y)return;const{transform:Z,panBy:le,autoPanSpeed:L,autoPanOnNodeDrag:K}=n();if(!K){h=!1,cancelAnimationFrame(u);return}const[O,H]=um(p,y,L);(O!==0||H!==0)&&(c.x=(c.x??0)-O/Z[2],c.y=(c.y??0)-H/Z[2],await le({x:O,y:H})&&R(c)),u=requestAnimationFrame(U)}function q(Z){const{nodeLookup:le,multiSelectionActive:L,nodesDraggable:K,transform:O,snapGrid:H,snapToGrid:$,selectNodesOnDrag:X,onNodeDragStart:se,onSelectionDragStart:w,unselectNodesAndEdges:z}=n();g=!0,(!X||!j)&&!L&&D&&(le.get(D)?.selected||z()),j&&X&&D&&e?.(D);const F=$o(Z.sourceEvent,{transform:O,snapGrid:H,snapToGrid:$,containerBounds:y});if(c=F,d=VA(le,K,F,D),d.size>0&&(s||se||!D&&w)){const[P,fe]=oh({nodeId:D,dragItems:d,nodeLookup:le});s?.(Z.sourceEvent,d,P,fe),se?.(Z.sourceEvent,P,fe),D||w?.(Z.sourceEvent,fe)}}const Y=Cb().clickDistance(B).on("start",Z=>{const{domNode:le,nodeDragThreshold:L,transform:K,snapGrid:O,snapToGrid:H}=n();y=le?.getBoundingClientRect()||null,x=!1,E=!1,A=Z.sourceEvent,L===0&&q(Z),c=$o(Z.sourceEvent,{transform:K,snapGrid:O,snapToGrid:H,containerBounds:y}),p=Yn(Z.sourceEvent,y)}).on("drag",Z=>{const{autoPanOnNodeDrag:le,transform:L,snapGrid:K,snapToGrid:O,nodeDragThreshold:H,nodeLookup:$}=n(),X=$o(Z.sourceEvent,{transform:L,snapGrid:K,snapToGrid:O,containerBounds:y});if(A=Z.sourceEvent,(Z.sourceEvent.type==="touchmove"&&Z.sourceEvent.touches.length>1||D&&!$.has(D))&&(x=!0),!x){if(!h&&le&&g&&(h=!0,U()),!g){const se=Yn(Z.sourceEvent,y),w=se.x-p.x,z=se.y-p.y;Math.sqrt(w*w+z*z)>H&&q(Z)}(c.x!==X.xSnapped||c.y!==X.ySnapped)&&d&&g&&(p=Yn(Z.sourceEvent,y),R(X))}}).on("end",Z=>{if(!g||x){x&&d.size>0&&n().updateNodePositions(d,!1);return}if(h=!1,g=!1,cancelAnimationFrame(u),d.size>0){const{nodeLookup:le,updateNodePositions:L,onNodeDragStop:K,onSelectionDragStop:O}=n();if(E&&(L(d,!1),E=!1),o||K||!D&&O){const[H,$]=oh({nodeId:D,dragItems:d,nodeLookup:le,dragging:!1});o?.(Z.sourceEvent,d,H,$),K?.(Z.sourceEvent,H,$),D||O?.(Z.sourceEvent,$)}}}).filter(Z=>{const le=Z.target;return!Z.button&&(!k||!av(le,`.${k}`,N))&&(!_||av(le,_,N))});v.call(Y)}function C(){v?.on(".drag",null)}return{update:T,destroy:C}}function XA(e,n,s){const a=[],o={x:e.x-s,y:e.y-s,width:s*2,height:s*2};for(const c of n.values())Fo(o,ml(c))>0&&a.push(c);return a}const KA=250;function ZA(e,n,s,a){let o=[],c=1/0;const u=XA(e,s,n+KA);for(const d of u){const h=[...d.internals.handleBounds?.source??[],...d.internals.handleBounds?.target??[]];for(const p of h){if(a.nodeId===p.nodeId&&a.type===p.type&&a.id===p.id)continue;const{x:y,y:g}=Fs(d,p,p.position,!0),v=Math.sqrt(Math.pow(y-e.x,2)+Math.pow(g-e.y,2));v>n||(v<c?(o=[{...p,x:y,y:g}],c=v):v===c&&o.push({...p,x:y,y:g}))}}if(!o.length)return null;if(o.length>1){const d=a.type==="source"?"target":"source";return o.find(h=>h.type===d)??o[0]}return o[0]}function d1(e,n,s,a,o,c=!1){const u=a.get(e);if(!u)return null;const d=o==="strict"?u.internals.handleBounds?.[n]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],h=(s?d?.find(p=>p.id===s):d?.[0])??null;return h&&c?{...h,...Fs(u,h,h.position,!0)}:h}function h1(e,n){return e||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function QA(e,n){let s=null;return n?s=!0:e&&!n&&(s=!1),s}const m1=()=>!0;function FA(e,{connectionMode:n,connectionRadius:s,handleId:a,nodeId:o,edgeUpdaterType:c,isTarget:u,domNode:d,nodeLookup:h,lib:p,autoPanOnConnect:y,flowId:g,panBy:v,cancelConnection:x,onConnectStart:E,onConnect:A,onConnectEnd:T,isValidConnection:C=m1,onReconnectEnd:k,updateConnection:_,getTransform:N,getFromHandle:j,autoPanSpeed:D,dragThreshold:B=1,handleDomNode:R}){const U=t1(e.target);let q=0,Y;const{x:Z,y:le}=Yn(e),L=h1(c,R),K=d?.getBoundingClientRect();let O=!1;if(!K||!L)return;const H=d1(o,L,a,h,n);if(!H)return;let $=Yn(e,K),X=!1,se=null,w=!1,z=null;function F(){if(!y||!K)return;const[Se,me]=um($,K,D);v({x:Se,y:me}),q=requestAnimationFrame(F)}const P={...H,nodeId:o,type:L,position:H.position},fe=h.get(o);let ie={inProgress:!0,isValid:null,from:Fs(fe,P,pe.Left,!0),fromHandle:P,fromPosition:P.position,fromNode:fe,to:$,toHandle:null,toPosition:K0[P.position],toNode:null,pointer:$};function te(){O=!0,_(ie),E?.(e,{nodeId:o,handleId:a,handleType:L})}B===0&&te();function oe(Se){if(!O){const{x:Pe,y:zt}=Yn(Se),ot=Pe-Z,xt=zt-le;if(!(ot*ot+xt*xt>B*B))return;te()}if(!j()||!P){ve(Se);return}const me=N();$=Yn(Se,K),Y=ZA(wl($,me,!1,[1,1]),s,h,P),X||(F(),X=!0);const ge=p1(Se,{handle:Y,connectionMode:n,fromNodeId:o,fromHandleId:a,fromType:u?"target":"source",isValidConnection:C,doc:U,lib:p,flowId:g,nodeLookup:h});z=ge.handleDomNode,se=ge.connection,w=QA(!!Y,ge.isValid);const xe=h.get(o),Ce=xe?Fs(xe,P,pe.Left,!0):ie.from,Ue={...ie,from:Ce,isValid:w,to:ge.toHandle&&w?pl({x:ge.toHandle.x,y:ge.toHandle.y},me):$,toHandle:ge.toHandle,toPosition:w&&ge.toHandle?ge.toHandle.position:K0[P.position],toNode:ge.toHandle?h.get(ge.toHandle.nodeId):null,pointer:$};_(Ue),ie=Ue}function ve(Se){if(!("touches"in Se&&Se.touches.length>0)){if(O){(Y||z)&&se&&w&&A?.(se);const{inProgress:me,...ge}=ie,xe={...ge,toPosition:ie.toHandle?ie.toPosition:null};T?.(Se,xe),c&&k?.(Se,xe)}x(),cancelAnimationFrame(q),X=!1,w=!1,se=null,z=null,U.removeEventListener("mousemove",oe),U.removeEventListener("mouseup",ve),U.removeEventListener("touchmove",oe),U.removeEventListener("touchend",ve)}}U.addEventListener("mousemove",oe),U.addEventListener("mouseup",ve),U.addEventListener("touchmove",oe),U.addEventListener("touchend",ve)}function p1(e,{handle:n,connectionMode:s,fromNodeId:a,fromHandleId:o,fromType:c,doc:u,lib:d,flowId:h,isValidConnection:p=m1,nodeLookup:y}){const g=c==="target",v=n?u.querySelector(`.${d}-flow__handle[data-id="${h}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x,y:E}=Yn(e),A=u.elementFromPoint(x,E),T=A?.classList.contains(`${d}-flow__handle`)?A:v,C={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){const k=h1(void 0,T),_=T.getAttribute("data-nodeid"),N=T.getAttribute("data-handleid"),j=T.classList.contains("connectable"),D=T.classList.contains("connectableend");if(!_||!k)return C;const B={source:g?_:a,sourceHandle:g?N:o,target:g?a:_,targetHandle:g?o:N};C.connection=B;const U=j&&D&&(s===dl.Strict?g&&k==="source"||!g&&k==="target":_!==a||N!==o);C.isValid=U&&p(B),C.toHandle=d1(_,k,N,y,s,!0)}return C}const Uh={onPointerDown:FA,isValid:p1};function JA({domNode:e,panZoom:n,getTransform:s,getViewScale:a}){const o=un(e);function c({translateExtent:d,width:h,height:p,zoomStep:y=1,pannable:g=!0,zoomable:v=!0,inversePan:x=!1}){const E=_=>{if(_.sourceEvent.type!=="wheel"||!n)return;const N=s(),j=_.sourceEvent.ctrlKey&&Jo()?10:1,D=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*y,B=N[2]*Math.pow(2,D*j);n.scaleTo(B)};let A=[0,0];const T=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(A=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},C=_=>{const N=s();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!n)return;const j=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],D=[j[0]-A[0],j[1]-A[1]];A=j;const B=a()*Math.max(N[2],Math.log(N[2]))*(x?-1:1),R={x:N[0]-D[0]*B,y:N[1]-D[1]*B},U=[[0,0],[h,p]];n.setViewportConstrained({x:R.x,y:R.y,zoom:N[2]},U,d)},k=Vb().on("start",T).on("zoom",g?C:null).on("zoom.wheel",v?E:null);o.call(k,{})}function u(){o.on("zoom",null)}return{update:c,destroy:u,pointer:Un}}const _u=e=>({x:e.x,y:e.y,zoom:e.k}),rh=({x:e,y:n,zoom:s})=>xu.translate(e,n).scale(s),Qa=(e,n)=>e.target.closest(`.${n}`),g1=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),WA=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,ch=(e,n=0,s=WA,a=()=>{})=>{const o=typeof n=="number"&&n>0;return o||a(),o?e.transition().duration(n).ease(s).on("end",a):e},y1=e=>{const n=e.ctrlKey&&Jo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function PA({zoomPanValues:e,noWheelClassName:n,d3Selection:s,d3Zoom:a,panOnScrollMode:o,panOnScrollSpeed:c,zoomOnPinch:u,onPanZoomStart:d,onPanZoom:h,onPanZoomEnd:p}){return y=>{if(Qa(y,n))return y.ctrlKey&&y.preventDefault(),!1;y.preventDefault(),y.stopImmediatePropagation();const g=s.property("__zoom").k||1;if(y.ctrlKey&&u){const T=Un(y),C=y1(y),k=g*Math.pow(2,C);a.scaleTo(s,k,T,y);return}const v=y.deltaMode===1?20:1;let x=o===Gs.Vertical?0:y.deltaX*v,E=o===Gs.Horizontal?0:y.deltaY*v;!Jo()&&y.shiftKey&&o!==Gs.Vertical&&(x=y.deltaY*v,E=0),a.translateBy(s,-(x/g)*c,-(E/g)*c,{internal:!0});const A=_u(s.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h?.(y,A),e.panScrollTimeout=setTimeout(()=>{p?.(y,A),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,d?.(y,A))}}function eT({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:s}){return function(a,o){const c=a.type==="wheel",u=!n&&c&&!a.ctrlKey,d=Qa(a,e);if(a.ctrlKey&&c&&d&&a.preventDefault(),u||d)return null;a.preventDefault(),s.call(this,a,o)}}function tT({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:s}){return a=>{if(a.sourceEvent?.internal)return;const o=_u(a.transform);e.mouseButton=a.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,a.sourceEvent?.type==="mousedown"&&n(!0),s&&s?.(a.sourceEvent,o)}}function nT({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:s,onTransformChange:a,onPanZoom:o}){return c=>{e.usedRightMouseButton=!!(s&&g1(n,e.mouseButton??0)),c.sourceEvent?.sync||a([c.transform.x,c.transform.y,c.transform.k]),o&&!c.sourceEvent?.internal&&o?.(c.sourceEvent,_u(c.transform))}}function iT({zoomPanValues:e,panOnDrag:n,panOnScroll:s,onDraggingChange:a,onPanZoomEnd:o,onPaneContextMenu:c}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,c&&g1(n,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&c(u.sourceEvent),e.usedRightMouseButton=!1,a(!1),o)){const d=_u(u.transform);e.prevViewport=d,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(u.sourceEvent,d)},s?150:0)}}}function sT({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:s,panOnDrag:a,panOnScroll:o,zoomOnDoubleClick:c,userSelectionActive:u,noWheelClassName:d,noPanClassName:h,lib:p,connectionInProgress:y}){return g=>{const v=e||n,x=s&&g.ctrlKey,E=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Qa(g,`${p}-flow__node`)||Qa(g,`${p}-flow__edge`)))return!0;if(!a&&!v&&!o&&!c&&!s||u||y&&!E||Qa(g,d)&&E||Qa(g,h)&&(!E||o&&E&&!e)||!s&&g.ctrlKey&&E)return!1;if(!s&&g.type==="touchstart"&&g.touches?.length>1)return g.preventDefault(),!1;if(!v&&!o&&!x&&E||!a&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(a)&&!a.includes(g.button)&&g.type==="mousedown")return!1;const A=Array.isArray(a)&&a.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||E)&&A}}function aT({domNode:e,minZoom:n,maxZoom:s,translateExtent:a,viewport:o,onPanZoom:c,onPanZoomStart:u,onPanZoomEnd:d,onDraggingChange:h}){const p={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},y=e.getBoundingClientRect(),g=Vb().scaleExtent([n,s]).translateExtent(a),v=un(e).call(g);k({x:o.x,y:o.y,zoom:hl(o.zoom,n,s)},[[0,0],[y.width,y.height]],a);const x=v.on("wheel.zoom"),E=v.on("dblclick.zoom");g.wheelDelta(y1);async function A(Y,Z){return v?new Promise(le=>{g?.interpolate(Z?.interpolate==="linear"?Lo:Xc).transform(ch(v,Z?.duration,Z?.ease,()=>le(!0)),Y)}):!1}function T({noWheelClassName:Y,noPanClassName:Z,onPaneContextMenu:le,userSelectionActive:L,panOnScroll:K,panOnDrag:O,panOnScrollMode:H,panOnScrollSpeed:$,preventScrolling:X,zoomOnPinch:se,zoomOnScroll:w,zoomOnDoubleClick:z,zoomActivationKeyPressed:F,lib:P,onTransformChange:fe,connectionInProgress:de,paneClickDistance:ie,selectionOnDrag:te}){L&&!p.isZoomingOrPanning&&C();const oe=K&&!F&&!L;g.clickDistance(te?1/0:!Vn(ie)||ie<0?0:ie);const ve=oe?PA({zoomPanValues:p,noWheelClassName:Y,d3Selection:v,d3Zoom:g,panOnScrollMode:H,panOnScrollSpeed:$,zoomOnPinch:se,onPanZoomStart:u,onPanZoom:c,onPanZoomEnd:d}):eT({noWheelClassName:Y,preventScrolling:X,d3ZoomHandler:x});v.on("wheel.zoom",ve,{passive:!1});const Se=tT({zoomPanValues:p,onDraggingChange:h,onPanZoomStart:u});g.on("start",Se);const me=nT({zoomPanValues:p,panOnDrag:O,onPaneContextMenu:!!le,onPanZoom:c,onTransformChange:fe});g.on("zoom",me);const ge=iT({zoomPanValues:p,panOnDrag:O,panOnScroll:K,onPaneContextMenu:le,onPanZoomEnd:d,onDraggingChange:h});g.on("end",ge);const xe=sT({zoomActivationKeyPressed:F,panOnDrag:O,zoomOnScroll:w,panOnScroll:K,zoomOnDoubleClick:z,zoomOnPinch:se,userSelectionActive:L,noPanClassName:Z,noWheelClassName:Y,lib:P,connectionInProgress:de});g.filter(xe),z?v.on("dblclick.zoom",E):v.on("dblclick.zoom",null)}function C(){g.on("zoom",null)}async function k(Y,Z,le){const L=rh(Y),K=g?.constrain()(L,Z,le);return K&&await A(K),K}async function _(Y,Z){const le=rh(Y);return await A(le,Z),le}function N(Y){if(v){const Z=rh(Y),le=v.property("__zoom");(le.k!==Y.zoom||le.x!==Y.x||le.y!==Y.y)&&g?.transform(v,Z,null,{sync:!0})}}function j(){const Y=v?qb(v.node()):{x:0,y:0,k:1};return{x:Y.x,y:Y.y,zoom:Y.k}}async function D(Y,Z){return v?new Promise(le=>{g?.interpolate(Z?.interpolate==="linear"?Lo:Xc).scaleTo(ch(v,Z?.duration,Z?.ease,()=>le(!0)),Y)}):!1}async function B(Y,Z){return v?new Promise(le=>{g?.interpolate(Z?.interpolate==="linear"?Lo:Xc).scaleBy(ch(v,Z?.duration,Z?.ease,()=>le(!0)),Y)}):!1}function R(Y){g?.scaleExtent(Y)}function U(Y){g?.translateExtent(Y)}function q(Y){const Z=!Vn(Y)||Y<0?0:Y;g?.clickDistance(Z)}return{update:T,destroy:C,setViewport:_,setViewportConstrained:k,getViewport:j,scaleTo:D,scaleBy:B,setScaleExtent:R,setTranslateExtent:U,syncViewport:N,setClickDistance:q}}var gl;(function(e){e.Line="line",e.Handle="handle"})(gl||(gl={}));function lT({width:e,prevWidth:n,height:s,prevHeight:a,affectsX:o,affectsY:c}){const u=e-n,d=s-a,h=[u>0?1:u<0?-1:0,d>0?1:d<0?-1:0];return u&&o&&(h[0]=h[0]*-1),d&&c&&(h[1]=h[1]*-1),h}function lv(e){const n=e.includes("right")||e.includes("left"),s=e.includes("bottom")||e.includes("top"),a=e.includes("left"),o=e.includes("top");return{isHorizontal:n,isVertical:s,affectsX:a,affectsY:o}}function ds(e,n){return Math.max(0,n-e)}function hs(e,n){return Math.max(0,e-n)}function Bc(e,n,s){return Math.max(0,n-e,e-s)}function ov(e,n){return e?!n:n}function oT(e,n,s,a,o,c,u,d){let{affectsX:h,affectsY:p}=n;const{isHorizontal:y,isVertical:g}=n,v=y&&g,{xSnapped:x,ySnapped:E}=s,{minWidth:A,maxWidth:T,minHeight:C,maxHeight:k}=a,{x:_,y:N,width:j,height:D,aspectRatio:B}=e;let R=Math.floor(y?x-e.pointerX:0),U=Math.floor(g?E-e.pointerY:0);const q=j+(h?-R:R),Y=D+(p?-U:U),Z=-c[0]*j,le=-c[1]*D;let L=Bc(q,A,T),K=Bc(Y,C,k);if(u){let $=0,X=0;h&&R<0?$=ds(_+R+Z,u[0][0]):!h&&R>0&&($=hs(_+q+Z,u[1][0])),p&&U<0?X=ds(N+U+le,u[0][1]):!p&&U>0&&(X=hs(N+Y+le,u[1][1])),L=Math.max(L,$),K=Math.max(K,X)}if(d){let $=0,X=0;h&&R>0?$=hs(_+R,d[0][0]):!h&&R<0&&($=ds(_+q,d[1][0])),p&&U>0?X=hs(N+U,d[0][1]):!p&&U<0&&(X=ds(N+Y,d[1][1])),L=Math.max(L,$),K=Math.max(K,X)}if(o){if(y){const $=Bc(q/B,C,k)*B;if(L=Math.max(L,$),u){let X=0;!h&&!p||h&&!p&&v?X=hs(N+le+q/B,u[1][1])*B:X=ds(N+le+(h?R:-R)/B,u[0][1])*B,L=Math.max(L,X)}if(d){let X=0;!h&&!p||h&&!p&&v?X=ds(N+q/B,d[1][1])*B:X=hs(N+(h?R:-R)/B,d[0][1])*B,L=Math.max(L,X)}}if(g){const $=Bc(Y*B,A,T)/B;if(K=Math.max(K,$),u){let X=0;!h&&!p||p&&!h&&v?X=hs(_+Y*B+Z,u[1][0])/B:X=ds(_+(p?U:-U)*B+Z,u[0][0])/B,K=Math.max(K,X)}if(d){let X=0;!h&&!p||p&&!h&&v?X=ds(_+Y*B,d[1][0])/B:X=hs(_+(p?U:-U)*B,d[0][0])/B,K=Math.max(K,X)}}}U=U+(U<0?K:-K),R=R+(R<0?L:-L),o&&(v?q>Y*B?U=(ov(h,p)?-R:R)/B:R=(ov(h,p)?-U:U)*B:y?(U=R/B,p=h):(R=U*B,h=p));const O=h?_+R:_,H=p?N+U:N;return{width:j+(h?-R:R),height:D+(p?-U:U),x:c[0]*R*(h?-1:1)+O,y:c[1]*U*(p?-1:1)+H}}const v1={width:0,height:0,x:0,y:0},rT={...v1,pointerX:0,pointerY:0,aspectRatio:1};function cT(e,n,s){const a=n.position.x+e.position.x,o=n.position.y+e.position.y,c=e.measured.width??0,u=e.measured.height??0,d=s[0]*c,h=s[1]*u;return[[a-d,o-h],[a+c-d,o+u-h]]}function uT({domNode:e,nodeId:n,getStoreItems:s,onChange:a,onEnd:o}){const c=un(e);let u={controlDirection:lv("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function d({controlPosition:p,boundaries:y,keepAspectRatio:g,resizeDirection:v,onResizeStart:x,onResize:E,onResizeEnd:A,shouldResize:T}){let C={...v1},k={...rT};u={boundaries:y,resizeDirection:v,keepAspectRatio:g,controlDirection:lv(p)};let _,N=null,j=[],D,B,R,U=!1;const q=Cb().on("start",Y=>{const{nodeLookup:Z,transform:le,snapGrid:L,snapToGrid:K,nodeOrigin:O,paneDomNode:H}=s();if(_=Z.get(n),!_)return;N=H?.getBoundingClientRect()??null;const{xSnapped:$,ySnapped:X}=$o(Y.sourceEvent,{transform:le,snapGrid:L,snapToGrid:K,containerBounds:N});C={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},k={...C,pointerX:$,pointerY:X,aspectRatio:C.width/C.height},D=void 0,B=Qs(_.extent)?_.extent:void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(D=Z.get(_.parentId)),D&&_.extent==="parent"&&(B=[[0,0],[D.measured.width,D.measured.height]]),j=[],R=void 0;for(const[se,w]of Z)if(w.parentId===n&&(j.push({id:se,position:{...w.position},extent:w.extent}),w.extent==="parent"||w.expandParent)){const z=cT(w,_,w.origin??O);R?R=[[Math.min(z[0][0],R[0][0]),Math.min(z[0][1],R[0][1])],[Math.max(z[1][0],R[1][0]),Math.max(z[1][1],R[1][1])]]:R=z}x?.(Y,{...C})}).on("drag",Y=>{const{transform:Z,snapGrid:le,snapToGrid:L,nodeOrigin:K}=s(),O=$o(Y.sourceEvent,{transform:Z,snapGrid:le,snapToGrid:L,containerBounds:N}),H=[];if(!_)return;const{x:$,y:X,width:se,height:w}=C,z={},F=_.origin??K,{width:P,height:fe,x:de,y:ie}=oT(k,u.controlDirection,O,u.boundaries,u.keepAspectRatio,F,B,R),te=P!==se,oe=fe!==w,ve=de!==$&&te,Se=ie!==X&&oe;if(!ve&&!Se&&!te&&!oe)return;if((ve||Se||F[0]===1||F[1]===1)&&(z.x=ve?de:C.x,z.y=Se?ie:C.y,C.x=z.x,C.y=z.y,j.length>0)){const Ce=de-$,Ue=ie-X;for(const Pe of j)Pe.position={x:Pe.position.x-Ce+F[0]*(P-se),y:Pe.position.y-Ue+F[1]*(fe-w)},H.push(Pe)}if((te||oe)&&(z.width=te&&(!u.resizeDirection||u.resizeDirection==="horizontal")?P:C.width,z.height=oe&&(!u.resizeDirection||u.resizeDirection==="vertical")?fe:C.height,C.width=z.width,C.height=z.height),D&&_.expandParent){const Ce=F[0]*(z.width??0);z.x&&z.x<Ce&&(C.x=Ce,k.x=k.x-(z.x-Ce));const Ue=F[1]*(z.height??0);z.y&&z.y<Ue&&(C.y=Ue,k.y=k.y-(z.y-Ue))}const me=lT({width:C.width,prevWidth:se,height:C.height,prevHeight:w,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),ge={...C,direction:me};T?.(Y,ge)!==!1&&(U=!0,E?.(Y,ge),a(z,H))}).on("end",Y=>{U&&(A?.(Y,{...C}),o?.({...C}),U=!1)});c.call(q)}function h(){c.on(".drag",null)}return{update:d,destroy:h}}var uh={exports:{}},fh={},dh={exports:{}},hh={};var rv;function fT(){if(rv)return hh;rv=1;var e=ar();function n(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var s=typeof Object.is=="function"?Object.is:n,a=e.useState,o=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue;function d(g,v){var x=v(),E=a({inst:{value:x,getSnapshot:v}}),A=E[0].inst,T=E[1];return c(function(){A.value=x,A.getSnapshot=v,h(A)&&T({inst:A})},[g,x,v]),o(function(){return h(A)&&T({inst:A}),g(function(){h(A)&&T({inst:A})})},[g]),u(x),x}function h(g){var v=g.getSnapshot;g=g.value;try{var x=v();return!s(g,x)}catch{return!0}}function p(g,v){return v()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:d;return hh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,hh}var cv;function dT(){return cv||(cv=1,dh.exports=fT()),dh.exports}var uv;function hT(){if(uv)return fh;uv=1;var e=ar(),n=dT();function s(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var a=typeof Object.is=="function"?Object.is:s,o=n.useSyncExternalStore,c=e.useRef,u=e.useEffect,d=e.useMemo,h=e.useDebugValue;return fh.useSyncExternalStoreWithSelector=function(p,y,g,v,x){var E=c(null);if(E.current===null){var A={hasValue:!1,value:null};E.current=A}else A=E.current;E=d(function(){function C(D){if(!k){if(k=!0,_=D,D=v(D),x!==void 0&&A.hasValue){var B=A.value;if(x(B,D))return N=B}return N=D}if(B=N,a(_,D))return B;var R=v(D);return x!==void 0&&x(B,R)?(_=D,B):(_=D,N=R)}var k=!1,_,N,j=g===void 0?null:g;return[function(){return C(y())},j===null?void 0:function(){return C(j())}]},[y,g,v,x]);var T=o(p,E[0],E[1]);return u(function(){A.hasValue=!0,A.value=T},[T]),h(T),T},fh}var fv;function mT(){return fv||(fv=1,uh.exports=hT()),uh.exports}var pT=mT();const gT=db(pT),yT={},dv=e=>{let n;const s=new Set,a=(y,g)=>{const v=typeof y=="function"?y(n):y;if(!Object.is(v,n)){const x=n;n=g??(typeof v!="object"||v===null)?v:Object.assign({},n,v),s.forEach(E=>E(n,x))}},o=()=>n,h={setState:a,getState:o,getInitialState:()=>p,subscribe:y=>(s.add(y),()=>s.delete(y)),destroy:()=>{(yT?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),s.clear()}},p=n=e(a,o,h);return h},vT=e=>e?dv(e):dv,{useDebugValue:bT}=Sl,{useSyncExternalStoreWithSelector:ST}=gT,wT=e=>e;function b1(e,n=wT,s){const a=ST(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,s);return bT(a),a}const hv=(e,n)=>{const s=vT(e),a=(o,c=n)=>b1(s,o,c);return Object.assign(a,s),a},xT=(e,n)=>e?hv(e,n):hv;function nt(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[a,o]of e)if(!Object.is(o,n.get(a)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const a of e)if(!n.has(a))return!1;return!0}const s=Object.keys(e);if(s.length!==Object.keys(n).length)return!1;for(const a of s)if(!Object.prototype.hasOwnProperty.call(n,a)||!Object.is(e[a],n[a]))return!1;return!0}var ET=hb();const Au=V.createContext(null),NT=Au.Provider,S1=Xn.error001("react");function Re(e,n){const s=V.useContext(Au);if(s===null)throw new Error(S1);return b1(s,e,n)}function st(){const e=V.useContext(Au);if(e===null)throw new Error(S1);return V.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const mv={display:"none"},_T={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},w1="react-flow__node-desc",x1="react-flow__edge-desc",AT="react-flow__aria-live",TT=e=>e.ariaLiveMessage,CT=e=>e.ariaLabelConfig;function MT({rfId:e}){const n=Re(TT);return b.jsx("div",{id:`${AT}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:_T,children:n})}function OT({rfId:e,disableKeyboardA11y:n}){const s=Re(CT);return b.jsxs(b.Fragment,{children:[b.jsx("div",{id:`${w1}-${e}`,style:mv,children:n?s["node.a11yDescription.default"]:s["node.a11yDescription.keyboardDisabled"]}),b.jsx("div",{id:`${x1}-${e}`,style:mv,children:s["edge.a11yDescription.default"]}),!n&&b.jsx(MT,{rfId:e})]})}const Tu=V.forwardRef(({position:e="top-left",children:n,className:s,style:a,...o},c)=>{const u=`${e}`.split("-");return b.jsx("div",{className:wt(["react-flow__panel",s,...u]),style:a,ref:c,...o,children:n})});Tu.displayName="Panel";function kT({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:b.jsx(Tu,{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:b.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const zT=e=>{const n=[],s=[];for(const[,a]of e.nodeLookup)a.selected&&n.push(a.internals.userNode);for(const[,a]of e.edgeLookup)a.selected&&s.push(a);return{selectedNodes:n,selectedEdges:s}},Lc=e=>e.id;function DT(e,n){return nt(e.selectedNodes.map(Lc),n.selectedNodes.map(Lc))&&nt(e.selectedEdges.map(Lc),n.selectedEdges.map(Lc))}function jT({onSelectionChange:e}){const n=st(),{selectedNodes:s,selectedEdges:a}=Re(zT,DT);return V.useEffect(()=>{const o={nodes:s,edges:a};e?.(o),n.getState().onSelectionChangeHandlers.forEach(c=>c(o))},[s,a,e]),null}const RT=e=>!!e.onSelectionChangeHandlers;function BT({onSelectionChange:e}){const n=Re(RT);return e||n?b.jsx(jT,{onSelectionChange:e}):null}const E1=[0,0],LT={x:0,y:0,zoom:1},$T=["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"],pv=[...$T,"rfId"],HT=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}),gv={translateExtent:Ko,nodeOrigin:E1,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function UT(e){const{setNodes:n,setEdges:s,setMinZoom:a,setMaxZoom:o,setTranslateExtent:c,setNodeExtent:u,reset:d,setDefaultNodesAndEdges:h}=Re(HT,nt),p=st();V.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{y.current=gv,d()}),[]);const y=V.useRef(gv);return V.useEffect(()=>{for(const g of pv){const v=e[g],x=y.current[g];v!==x&&(typeof e[g]>"u"||(g==="nodes"?n(v):g==="edges"?s(v):g==="minZoom"?a(v):g==="maxZoom"?o(v):g==="translateExtent"?c(v):g==="nodeExtent"?u(v):g==="ariaLabelConfig"?p.setState({ariaLabelConfig:EA(v)}):g==="fitView"?p.setState({fitViewQueued:v}):g==="fitViewOptions"?p.setState({fitViewOptions:v}):p.setState({[g]:v})))}y.current=e},pv.map(g=>e[g])),null}function yv(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function IT(e){const[n,s]=V.useState(e==="system"?null:e);return V.useEffect(()=>{if(e!=="system"){s(e);return}const a=yv(),o=()=>s(a?.matches?"dark":"light");return o(),a?.addEventListener("change",o),()=>{a?.removeEventListener("change",o)}},[e]),n!==null?n:yv()?.matches?"dark":"light"}const vv=typeof document<"u"?document:null;function Wo(e=null,n={target:vv,actInsideInputWithModifier:!0}){const[s,a]=V.useState(!1),o=V.useRef(!1),c=V.useRef(new Set([])),[u,d]=V.useMemo(()=>{if(e!==null){const p=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
|
|
10
|
-
`).replace(`
|
|
11
|
-
|
|
12
|
-
`,`
|
|
13
|
-
+`).split(`
|
|
14
|
-
`)),y=p.reduce((g,v)=>g.concat(...v),[]);return[p,y]}return[[],[]]},[e]);return V.useEffect(()=>{const h=n?.target??vv,p=n?.actInsideInputWithModifier??!0;if(e!==null){const y=x=>{if(o.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!o.current||o.current&&!p)&&n1(x))return!1;const A=Sv(x.code,d);if(c.current.add(x[A]),bv(u,c.current,!1)){const T=x.composedPath?.()?.[0]||x.target,C=T?.nodeName==="BUTTON"||T?.nodeName==="A";n.preventDefault!==!1&&(o.current||!C)&&x.preventDefault(),a(!0)}},g=x=>{const E=Sv(x.code,d);bv(u,c.current,!0)?(a(!1),c.current.clear()):c.current.delete(x[E]),x.key==="Meta"&&c.current.clear(),o.current=!1},v=()=>{c.current.clear(),a(!1)};return h?.addEventListener("keydown",y),h?.addEventListener("keyup",g),window.addEventListener("blur",v),window.addEventListener("contextmenu",v),()=>{h?.removeEventListener("keydown",y),h?.removeEventListener("keyup",g),window.removeEventListener("blur",v),window.removeEventListener("contextmenu",v)}}},[e,a]),s}function bv(e,n,s){return e.filter(a=>s||a.length===n.size).some(a=>a.every(o=>n.has(o)))}function Sv(e,n){return n.includes(e)?"code":"key"}const qT=()=>{const e=st();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:a}=e.getState();return a?a.scaleTo(n,s):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,s)=>{const{transform:[a,o,c],panZoom:u}=e.getState();return u?(await u.setViewport({x:n.x??a,y:n.y??o,zoom:n.zoom??c},s),!0):!1},getViewport:()=>{const[n,s,a]=e.getState().transform;return{x:n,y:s,zoom:a}},setCenter:async(n,s,a)=>e.getState().setCenter(n,s,a),fitBounds:async(n,s)=>{const{width:a,height:o,minZoom:c,maxZoom:u,panZoom:d}=e.getState(),h=fm(n,a,o,c,u,s?.padding??.1);return d?(await d.setViewport(h,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),!0):!1},screenToFlowPosition:(n,s={})=>{const{transform:a,snapGrid:o,snapToGrid:c,domNode:u}=e.getState();if(!u)return n;const{x:d,y:h}=u.getBoundingClientRect(),p={x:n.x-d,y:n.y-h},y=s.snapGrid??o,g=s.snapToGrid??c;return wl(p,a,g,y)},flowToScreenPosition:n=>{const{transform:s,domNode:a}=e.getState();if(!a)return n;const{x:o,y:c}=a.getBoundingClientRect(),u=pl(n,s);return{x:u.x+o,y:u.y+c}}}),[])};function N1(e,n){const s=[],a=new Map,o=[];for(const c of e)if(c.type==="add"){o.push(c);continue}else if(c.type==="remove"||c.type==="replace")a.set(c.id,[c]);else{const u=a.get(c.id);u?u.push(c):a.set(c.id,[c])}for(const c of n){const u=a.get(c.id);if(!u){s.push(c);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){s.push({...u[0].item});continue}const d={...c};for(const h of u)VT(h,d);s.push(d)}return o.length&&o.forEach(c=>{c.index!==void 0?s.splice(c.index,0,{...c.item}):s.push({...c.item})}),s}function VT(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 YT(e,n){return N1(e,n)}function GT(e,n){return N1(e,n)}function Hs(e,n){return{id:e,type:"select",selected:n}}function Fa(e,n=new Set,s=!1){const a=[];for(const[o,c]of e){const u=n.has(o);!(c.selected===void 0&&!u)&&c.selected!==u&&(s&&(c.selected=u),a.push(Hs(c.id,u)))}return a}function wv({items:e=[],lookup:n}){const s=[],a=new Map(e.map(o=>[o.id,o]));for(const[o,c]of e.entries()){const u=n.get(c.id),d=u?.internals?.userNode??u;d!==void 0&&d!==c&&s.push({id:c.id,item:c,type:"replace"}),d===void 0&&s.push({item:c,type:"add",index:o})}for(const[o]of n)a.get(o)===void 0&&s.push({id:o,type:"remove"});return s}function xv(e){return{id:e.id,type:"remove"}}const XT=Wb();function KT(e,n,s={}){return MA(e,n,{...s,onError:s.onError??XT})}const Ev=e=>mA(e),ZT=e=>Zb(e);function _1(e){return V.forwardRef(e)}const QT=typeof window<"u"?V.useLayoutEffect:V.useEffect;function Nv(e){const[n,s]=V.useState(BigInt(0)),[a]=V.useState(()=>FT(()=>s(o=>o+BigInt(1))));return QT(()=>{const o=a.get();o.length&&(e(o),a.reset())},[n]),a}function FT(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:s=>{n.push(s),e()}}}const A1=V.createContext(null);function JT({children:e}){const n=st(),s=V.useCallback(d=>{const{nodes:h=[],setNodes:p,hasDefaultNodes:y,onNodesChange:g,nodeLookup:v,fitViewQueued:x,onNodesChangeMiddlewareMap:E}=n.getState();let A=h;for(const C of d)A=typeof C=="function"?C(A):C;let T=wv({items:A,lookup:v});for(const C of E.values())T=C(T);y&&p(A),T.length>0?g?.(T):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:C,nodes:k,setNodes:_}=n.getState();C&&_(k)})},[]),a=Nv(s),o=V.useCallback(d=>{const{edges:h=[],setEdges:p,hasDefaultEdges:y,onEdgesChange:g,edgeLookup:v}=n.getState();let x=h;for(const E of d)x=typeof E=="function"?E(x):E;y?p(x):g&&g(wv({items:x,lookup:v}))},[]),c=Nv(o),u=V.useMemo(()=>({nodeQueue:a,edgeQueue:c}),[]);return b.jsx(A1.Provider,{value:u,children:e})}function WT(){const e=V.useContext(A1);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const PT=e=>!!e.panZoom;function fr(){const e=qT(),n=st(),s=WT(),a=Re(PT),o=V.useMemo(()=>{const c=g=>n.getState().nodeLookup.get(g),u=g=>{s.nodeQueue.push(g)},d=g=>{s.edgeQueue.push(g)},h=g=>{const{nodeLookup:v,nodeOrigin:x}=n.getState(),E=Ev(g)?g:v.get(g.id),A=E.parentId?e1(E.position,E.measured,E.parentId,v,x):E.position,T={...E,position:A,width:E.measured?.width??E.width,height:E.measured?.height??E.height};return ml(T)},p=(g,v,x={replace:!1})=>{u(E=>E.map(A=>{if(A.id===g){const T=typeof v=="function"?v(A):v;return x.replace&&Ev(T)?T:{...A,...T}}return A}))},y=(g,v,x={replace:!1})=>{d(E=>E.map(A=>{if(A.id===g){const T=typeof v=="function"?v(A):v;return x.replace&&ZT(T)?T:{...A,...T}}return A}))};return{getNodes:()=>n.getState().nodes.map(g=>({...g})),getNode:g=>c(g)?.internals.userNode,getInternalNode:c,getEdges:()=>{const{edges:g=[]}=n.getState();return g.map(v=>({...v}))},getEdge:g=>n.getState().edgeLookup.get(g),setNodes:u,setEdges:d,addNodes:g=>{const v=Array.isArray(g)?g:[g];s.nodeQueue.push(x=>[...x,...v])},addEdges:g=>{const v=Array.isArray(g)?g:[g];s.edgeQueue.push(x=>[...x,...v])},toObject:()=>{const{nodes:g=[],edges:v=[],transform:x}=n.getState(),[E,A,T]=x;return{nodes:g.map(C=>({...C})),edges:v.map(C=>({...C})),viewport:{x:E,y:A,zoom:T}}},deleteElements:async({nodes:g=[],edges:v=[]})=>{const{nodes:x,edges:E,onNodesDelete:A,onEdgesDelete:T,triggerNodeChanges:C,triggerEdgeChanges:k,onDelete:_,onBeforeDelete:N}=n.getState(),{nodes:j,edges:D}=await bA({nodesToRemove:g,edgesToRemove:v,nodes:x,edges:E,onBeforeDelete:N}),B=D.length>0,R=j.length>0;if(B){const U=D.map(xv);T?.(D),k(U)}if(R){const U=j.map(xv);A?.(j),C(U)}return(R||B)&&_?.({nodes:j,edges:D}),{deletedNodes:j,deletedEdges:D}},getIntersectingNodes:(g,v=!0,x)=>{const E=Q0(g),A=E?g:h(g),T=x!==void 0;return A?(x||n.getState().nodes).filter(C=>{const k=n.getState().nodeLookup.get(C.id);if(k&&!E&&(C.id===g.id||!k.internals.positionAbsolute))return!1;const _=ml(T?C:k),N=Fo(_,A);return v&&N>0||N>=_.width*_.height||N>=A.width*A.height}):[]},isNodeIntersecting:(g,v,x=!0)=>{const A=Q0(g)?g:h(g);if(!A)return!1;const T=Fo(A,v);return x&&T>0||T>=v.width*v.height||T>=A.width*A.height},updateNode:p,updateNodeData:(g,v,x={replace:!1})=>{p(g,E=>{const A=typeof v=="function"?v(E):v;return x.replace?{...E,data:A}:{...E,data:{...E.data,...A}}},x)},updateEdge:y,updateEdgeData:(g,v,x={replace:!1})=>{y(g,E=>{const A=typeof v=="function"?v(E):v;return x.replace?{...E,data:A}:{...E,data:{...E.data,...A}}},x)},getNodesBounds:g=>{const{nodeLookup:v,nodeOrigin:x}=n.getState();return pA(g,{nodeLookup:v,nodeOrigin:x})},getHandleConnections:({type:g,id:v,nodeId:x})=>Array.from(n.getState().connectionLookup.get(`${x}-${g}${v?`-${v}`:""}`)?.values()??[]),getNodeConnections:({type:g,handleId:v,nodeId:x})=>Array.from(n.getState().connectionLookup.get(`${x}${g?v?`-${g}-${v}`:`-${g}`:""}`)?.values()??[]),fitView:async g=>{const v=n.getState().fitViewResolver??xA();return n.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:v}),s.nodeQueue.push(x=>[...x]),v.promise}}},[]);return V.useMemo(()=>({...o,...e,viewportInitialized:a}),[a])}const _v=e=>e.selected,eC=typeof window<"u"?window:void 0;function tC({deleteKeyCode:e,multiSelectionKeyCode:n}){const s=st(),{deleteElements:a}=fr(),o=Wo(e,{actInsideInputWithModifier:!1}),c=Wo(n,{target:eC});V.useEffect(()=>{if(o){const{edges:u,nodes:d}=s.getState();a({nodes:d.filter(_v),edges:u.filter(_v)}),s.setState({nodesSelectionActive:!1})}},[o]),V.useEffect(()=>{s.setState({multiSelectionActive:c})},[c])}function nC(e){const n=st();V.useEffect(()=>{const s=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const a=dm(e.current);(a.height===0||a.width===0)&&n.getState().onError?.("004",Xn.error004()),n.setState({width:a.width||500,height:a.height||500})};if(e.current){s(),window.addEventListener("resize",s);const a=new ResizeObserver(()=>s());return a.observe(e.current),()=>{window.removeEventListener("resize",s),a&&e.current&&a.unobserve(e.current)}}},[])}const Cu={position:"absolute",width:"100%",height:"100%",top:0,left:0},iC=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function sC({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:s=!0,panOnScroll:a=!1,panOnScrollSpeed:o=.5,panOnScrollMode:c=Gs.Free,zoomOnDoubleClick:u=!0,panOnDrag:d=!0,defaultViewport:h,translateExtent:p,minZoom:y,maxZoom:g,zoomActivationKeyCode:v,preventScrolling:x=!0,children:E,noWheelClassName:A,noPanClassName:T,onViewportChange:C,isControlledViewport:k,paneClickDistance:_,selectionOnDrag:N}){const j=st(),D=V.useRef(null),{userSelectionActive:B,lib:R,connectionInProgress:U}=Re(iC,nt),q=Wo(v),Y=V.useRef();nC(D);const Z=V.useCallback(le=>{C?.({x:le[0],y:le[1],zoom:le[2]}),k||j.setState({transform:le})},[C,k]);return V.useEffect(()=>{if(D.current){Y.current=aT({domNode:D.current,minZoom:y,maxZoom:g,translateExtent:p,viewport:h,onDraggingChange:O=>j.setState(H=>H.paneDragging===O?H:{paneDragging:O}),onPanZoomStart:(O,H)=>{const{onViewportChangeStart:$,onMoveStart:X}=j.getState();X?.(O,H),$?.(H)},onPanZoom:(O,H)=>{const{onViewportChange:$,onMove:X}=j.getState();X?.(O,H),$?.(H)},onPanZoomEnd:(O,H)=>{const{onViewportChangeEnd:$,onMoveEnd:X}=j.getState();X?.(O,H),$?.(H)}});const{x:le,y:L,zoom:K}=Y.current.getViewport();return j.setState({panZoom:Y.current,transform:[le,L,K],domNode:D.current.closest(".react-flow")}),()=>{Y.current?.destroy()}}},[]),V.useEffect(()=>{Y.current?.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:s,panOnScroll:a,panOnScrollSpeed:o,panOnScrollMode:c,zoomOnDoubleClick:u,panOnDrag:d,zoomActivationKeyPressed:q,preventScrolling:x,noPanClassName:T,userSelectionActive:B,noWheelClassName:A,lib:R,onTransformChange:Z,connectionInProgress:U,selectionOnDrag:N,paneClickDistance:_})},[e,n,s,a,o,c,u,d,q,x,T,B,A,R,Z,U,N,_]),b.jsx("div",{className:"react-flow__renderer",ref:D,style:Cu,children:E})}const aC=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function lC(){const{userSelectionActive:e,userSelectionRect:n}=Re(aC,nt);return e&&n?b.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 mh=(e,n)=>s=>{s.target===n.current&&e?.(s)},oC=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function rC({isSelecting:e,selectionKeyPressed:n,selectionMode:s=Zo.Full,panOnDrag:a,autoPanOnSelection:o,paneClickDistance:c,selectionOnDrag:u,onSelectionStart:d,onSelectionEnd:h,onPaneClick:p,onPaneContextMenu:y,onPaneScroll:g,onPaneMouseEnter:v,onPaneMouseMove:x,onPaneMouseLeave:E,children:A}){const T=V.useRef(0),C=st(),{userSelectionActive:k,elementsSelectable:_,dragging:N,connectionInProgress:j,panBy:D,autoPanSpeed:B}=Re(oC,nt),R=_&&(e||k),U=V.useRef(null),q=V.useRef(),Y=V.useRef(new Set),Z=V.useRef(new Set),le=V.useRef(!1),L=V.useRef({x:0,y:0}),K=V.useRef(!1),O=te=>{if(le.current||j){le.current=!1;return}p?.(te),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},H=te=>{if(Array.isArray(a)&&a?.includes(2)){te.preventDefault();return}y?.(te)},$=g?te=>g(te):void 0,X=te=>{le.current&&(te.stopPropagation(),le.current=!1)},se=te=>{const{domNode:oe,transform:ve}=C.getState();if(q.current=oe?.getBoundingClientRect(),!q.current)return;const Se=te.target===U.current;if(!Se&&!!te.target.closest(".nokey")||!e||!(u&&Se||n)||te.button!==0||!te.isPrimary)return;te.target?.setPointerCapture?.(te.pointerId),le.current=!1;const{x:xe,y:Ce}=Yn(te.nativeEvent,q.current),Ue=wl({x:xe,y:Ce},ve);C.setState({userSelectionRect:{width:0,height:0,startX:Ue.x,startY:Ue.y,x:xe,y:Ce}}),Se||(te.stopPropagation(),te.preventDefault())};function w(te,oe){const{userSelectionRect:ve}=C.getState();if(!ve)return;const{transform:Se,nodeLookup:me,edgeLookup:ge,connectionLookup:xe,triggerNodeChanges:Ce,triggerEdgeChanges:Ue,defaultEdgeOptions:Pe}=C.getState(),zt={x:ve.startX,y:ve.startY},{x:ot,y:xt}=pl(zt,Se),Dt={startX:zt.x,startY:zt.y,x:te<ot?te:ot,y:oe<xt?oe:xt,width:Math.abs(te-ot),height:Math.abs(oe-xt)},kn=Y.current,_t=Z.current;Y.current=new Set(cm(me,Dt,Se,s===Zo.Partial,!0).map(ut=>ut.id)),Z.current=new Set;const Ke=Pe?.selectable??!0;for(const ut of Y.current){const Ut=xe.get(ut);if(Ut)for(const{edgeId:Lt}of Ut.values()){const jt=ge.get(Lt);jt&&(jt.selectable??Ke)&&Z.current.add(Lt)}}if(!F0(kn,Y.current)){const ut=Fa(me,Y.current,!0);Ce(ut)}if(!F0(_t,Z.current)){const ut=Fa(ge,Z.current);Ue(ut)}C.setState({userSelectionRect:Dt,userSelectionActive:!0,nodesSelectionActive:!1})}function z(){if(!o||!q.current)return;const[te,oe]=um(L.current,q.current,B);D({x:te,y:oe}).then(ve=>{if(!le.current||!ve){T.current=requestAnimationFrame(z);return}const{x:Se,y:me}=L.current;w(Se,me),T.current=requestAnimationFrame(z)})}const F=()=>{cancelAnimationFrame(T.current),T.current=0,K.current=!1};V.useEffect(()=>()=>F(),[]);const P=te=>{const{userSelectionRect:oe,transform:ve,resetSelectedElements:Se}=C.getState();if(!q.current||!oe)return;const{x:me,y:ge}=Yn(te.nativeEvent,q.current);L.current={x:me,y:ge};const xe=pl({x:oe.startX,y:oe.startY},ve);if(!le.current){const Ce=n?0:c;if(Math.hypot(me-xe.x,ge-xe.y)<=Ce)return;Se(),d?.(te)}le.current=!0,K.current||(z(),K.current=!0),w(me,ge)},fe=te=>{te.button===0&&(te.target?.releasePointerCapture?.(te.pointerId),!k&&te.target===U.current&&C.getState().userSelectionRect&&O?.(te),C.setState({userSelectionActive:!1,userSelectionRect:null}),le.current&&(h?.(te),C.setState({nodesSelectionActive:Y.current.size>0})),F())},de=te=>{te.target?.releasePointerCapture?.(te.pointerId),F()},ie=a===!0||Array.isArray(a)&&a.includes(0);return b.jsxs("div",{className:wt(["react-flow__pane",{draggable:ie,dragging:N,selection:e}]),onClick:R?void 0:mh(O,U),onContextMenu:mh(H,U),onWheel:mh($,U),onPointerEnter:R?void 0:v,onPointerMove:R?P:x,onPointerUp:R?fe:void 0,onPointerCancel:R?de:void 0,onPointerDownCapture:R?se:void 0,onClickCapture:R?X:void 0,onPointerLeave:E,ref:U,style:Cu,children:[A,b.jsx(lC,{})]})}function Ih({id:e,store:n,unselect:s=!1,nodeRef:a}){const{addSelectedNodes:o,unselectNodesAndEdges:c,multiSelectionActive:u,nodeLookup:d,onError:h}=n.getState(),p=d.get(e);if(!p){h?.("012",Xn.error012(e));return}n.setState({nodesSelectionActive:!1}),p.selected?(s||p.selected&&u)&&(c({nodes:[p],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):o([e])}function T1({nodeRef:e,disabled:n=!1,noDragClassName:s,handleSelector:a,nodeId:o,isSelectable:c,nodeClickDistance:u}){const d=st(),[h,p]=V.useState(!1),y=V.useRef();return V.useEffect(()=>{y.current=GA({getStoreItems:()=>d.getState(),onNodeMouseDown:g=>{Ih({id:g,store:d,nodeRef:e})},onDragStart:()=>{p(!0)},onDragStop:()=>{p(!1)}})},[]),V.useEffect(()=>{if(!(n||!e.current||!y.current))return y.current.update({noDragClassName:s,handleSelector:a,domNode:e.current,isSelectable:c,nodeId:o,nodeClickDistance:u}),()=>{y.current?.destroy()}},[s,a,n,c,e,o,u]),h}const cC=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function C1(){const e=st();return V.useCallback(s=>{const{nodeExtent:a,snapToGrid:o,snapGrid:c,nodesDraggable:u,onError:d,updateNodePositions:h,nodeLookup:p,nodeOrigin:y}=e.getState(),g=new Map,v=cC(u),x=o?c[0]:5,E=o?c[1]:5,A=s.direction.x*x*s.factor,T=s.direction.y*E*s.factor;for(const[,C]of p){if(!v(C))continue;let k={x:C.internals.positionAbsolute.x+A,y:C.internals.positionAbsolute.y+T};o&&(k=ur(k,c));const{position:_,positionAbsolute:N}=Qb({nodeId:C.id,nextPosition:k,nodeLookup:p,nodeExtent:a,nodeOrigin:y,onError:d});C.position=_,C.internals.positionAbsolute=N,g.set(C.id,C)}h(g)},[])}const vm=V.createContext(null),uC=vm.Provider;vm.Consumer;const M1=()=>V.useContext(vm),fC=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),dC=(e,n,s)=>a=>{const{connectionClickStartHandle:o,connectionMode:c,connection:u}=a,{fromHandle:d,toHandle:h,isValid:p}=u,y=h?.nodeId===e&&h?.id===n&&h?.type===s;return{connectingFrom:d?.nodeId===e&&d?.id===n&&d?.type===s,connectingTo:y,clickConnecting:o?.nodeId===e&&o?.id===n&&o?.type===s,isPossibleEndHandle:c===dl.Strict?d?.type!==s:e!==d?.nodeId||n!==d?.id,connectionInProcess:!!d,clickConnectionInProcess:!!o,valid:y&&p}};function hC({type:e="source",position:n=pe.Top,isValidConnection:s,isConnectable:a=!0,isConnectableStart:o=!0,isConnectableEnd:c=!0,id:u,onConnect:d,children:h,className:p,onMouseDown:y,onTouchStart:g,...v},x){const E=u||null,A=e==="target",T=st(),C=M1(),{connectOnClick:k,noPanClassName:_,rfId:N}=Re(fC,nt),{connectingFrom:j,connectingTo:D,clickConnecting:B,isPossibleEndHandle:R,connectionInProcess:U,clickConnectionInProcess:q,valid:Y}=Re(dC(C,E,e),nt);C||T.getState().onError?.("010",Xn.error010());const Z=K=>{const{defaultEdgeOptions:O,onConnect:H,hasDefaultEdges:$}=T.getState(),X={...O,...K};if($){const{edges:se,setEdges:w,onError:z}=T.getState();w(KT(X,se,{onError:z}))}H?.(X),d?.(X)},le=K=>{if(!C)return;const O=i1(K.nativeEvent);if(o&&(O&&K.button===0||!O)){const H=T.getState();Uh.onPointerDown(K.nativeEvent,{handleDomNode:K.currentTarget,autoPanOnConnect:H.autoPanOnConnect,connectionMode:H.connectionMode,connectionRadius:H.connectionRadius,domNode:H.domNode,nodeLookup:H.nodeLookup,lib:H.lib,isTarget:A,handleId:E,nodeId:C,flowId:H.rfId,panBy:H.panBy,cancelConnection:H.cancelConnection,onConnectStart:H.onConnectStart,onConnectEnd:(...$)=>T.getState().onConnectEnd?.(...$),updateConnection:H.updateConnection,onConnect:Z,isValidConnection:s||((...$)=>T.getState().isValidConnection?.(...$)??!0),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:H.autoPanSpeed,dragThreshold:H.connectionDragThreshold})}O?y?.(K):g?.(K)},L=K=>{const{onClickConnectStart:O,onClickConnectEnd:H,connectionClickStartHandle:$,connectionMode:X,isValidConnection:se,lib:w,rfId:z,nodeLookup:F,connection:P}=T.getState();if(!C||!$&&!o)return;if(!$){O?.(K.nativeEvent,{nodeId:C,handleId:E,handleType:e}),T.setState({connectionClickStartHandle:{nodeId:C,type:e,id:E}});return}const fe=t1(K.target),de=s||se,{connection:ie,isValid:te}=Uh.isValid(K.nativeEvent,{handle:{nodeId:C,id:E,type:e},connectionMode:X,fromNodeId:$.nodeId,fromHandleId:$.id||null,fromType:$.type,isValidConnection:de,flowId:z,doc:fe,lib:w,nodeLookup:F});te&&ie&&Z(ie);const oe=structuredClone(P);delete oe.inProgress,oe.toPosition=oe.toHandle?oe.toHandle.position:null,H?.(K,oe),T.setState({connectionClickStartHandle:null})};return b.jsx("div",{"data-handleid":E,"data-nodeid":C,"data-handlepos":n,"data-id":`${N}-${C}-${E}-${e}`,className:wt(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",_,p,{source:!A,target:A,connectable:a,connectablestart:o,connectableend:c,clickconnecting:B,connectingfrom:j,connectingto:D,valid:Y,connectionindicator:a&&(!U||R)&&(U||q?c:o)}]),onMouseDown:le,onTouchStart:le,onClick:k?L:void 0,ref:x,...v,children:h})}const Cn=V.memo(_1(hC));function mC({data:e,isConnectable:n,sourcePosition:s=pe.Bottom}){return b.jsxs(b.Fragment,{children:[e?.label,b.jsx(Cn,{type:"source",position:s,isConnectable:n})]})}function pC({data:e,isConnectable:n,targetPosition:s=pe.Top,sourcePosition:a=pe.Bottom}){return b.jsxs(b.Fragment,{children:[b.jsx(Cn,{type:"target",position:s,isConnectable:n}),e?.label,b.jsx(Cn,{type:"source",position:a,isConnectable:n})]})}function gC(){return null}function yC({data:e,isConnectable:n,targetPosition:s=pe.Top}){return b.jsxs(b.Fragment,{children:[b.jsx(Cn,{type:"target",position:s,isConnectable:n}),e?.label]})}const fu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Av={input:mC,default:pC,output:yC,group:gC};function vC(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 bC=e=>{const{width:n,height:s,x:a,y:o}=cr(e.nodeLookup,{filter:c=>!!c.selected});return{width:Vn(n)?n:null,height:Vn(s)?s:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${a}px,${o}px)`}};function SC({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:s}){const a=st(),{width:o,height:c,transformString:u,userSelectionActive:d}=Re(bC,nt),h=C1(),p=V.useRef(null);V.useEffect(()=>{s||p.current?.focus({preventScroll:!0})},[s]);const y=!d&&o!==null&&c!==null;if(T1({nodeRef:p,disabled:!y}),!y)return null;const g=e?x=>{const E=a.getState().nodes.filter(A=>A.selected);e(x,E)}:void 0,v=x=>{Object.prototype.hasOwnProperty.call(fu,x.key)&&(x.preventDefault(),h({direction:fu[x.key],factor:x.shiftKey?4:1}))};return b.jsx("div",{className:wt(["react-flow__nodesselection","react-flow__container",n]),style:{transform:u},children:b.jsx("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:s?void 0:-1,onKeyDown:s?void 0:v,style:{width:o,height:c}})})}const Tv=typeof window<"u"?window:void 0,wC=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function O1({children:e,onPaneClick:n,onPaneMouseEnter:s,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:c,onPaneScroll:u,paneClickDistance:d,deleteKeyCode:h,selectionKeyCode:p,selectionOnDrag:y,selectionMode:g,onSelectionStart:v,onSelectionEnd:x,multiSelectionKeyCode:E,panActivationKeyCode:A,zoomActivationKeyCode:T,elementsSelectable:C,zoomOnScroll:k,zoomOnPinch:_,panOnScroll:N,panOnScrollSpeed:j,panOnScrollMode:D,zoomOnDoubleClick:B,panOnDrag:R,autoPanOnSelection:U,defaultViewport:q,translateExtent:Y,minZoom:Z,maxZoom:le,preventScrolling:L,onSelectionContextMenu:K,noWheelClassName:O,noPanClassName:H,disableKeyboardA11y:$,onViewportChange:X,isControlledViewport:se}){const{nodesSelectionActive:w,userSelectionActive:z}=Re(wC,nt),F=Wo(p,{target:Tv}),P=Wo(A,{target:Tv}),fe=P||R,de=P||N,ie=y&&fe!==!0,te=F||z||ie;return tC({deleteKeyCode:h,multiSelectionKeyCode:E}),b.jsx(sC,{onPaneContextMenu:c,elementsSelectable:C,zoomOnScroll:k,zoomOnPinch:_,panOnScroll:de,panOnScrollSpeed:j,panOnScrollMode:D,zoomOnDoubleClick:B,panOnDrag:!F&&fe,defaultViewport:q,translateExtent:Y,minZoom:Z,maxZoom:le,zoomActivationKeyCode:T,preventScrolling:L,noWheelClassName:O,noPanClassName:H,onViewportChange:X,isControlledViewport:se,paneClickDistance:d,selectionOnDrag:ie,children:b.jsxs(rC,{onSelectionStart:v,onSelectionEnd:x,onPaneClick:n,onPaneMouseEnter:s,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:c,onPaneScroll:u,panOnDrag:fe,autoPanOnSelection:U,isSelecting:!!te,selectionMode:g,selectionKeyPressed:F,paneClickDistance:d,selectionOnDrag:ie,children:[e,w&&b.jsx(SC,{onSelectionContextMenu:K,noPanClassName:H,disableKeyboardA11y:$})]})})}O1.displayName="FlowRenderer";const xC=V.memo(O1),EC=e=>n=>e?cm(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 NC(e){return Re(V.useCallback(EC(e),[e]),nt)}const _C=e=>e.updateNodeInternals;function AC(){const e=Re(_C),[n]=V.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(s=>{const a=new Map;s.forEach(o=>{const c=o.target.getAttribute("data-id");a.set(c,{id:c,nodeElement:o.target,force:!0})}),e(a)}));return V.useEffect(()=>()=>{n?.disconnect()},[n]),n}function TC({node:e,nodeType:n,hasDimensions:s,resizeObserver:a}){const o=st(),c=V.useRef(null),u=V.useRef(null),d=V.useRef(e.sourcePosition),h=V.useRef(e.targetPosition),p=V.useRef(n),y=s&&!!e.internals.handleBounds;return V.useEffect(()=>{c.current&&!e.hidden&&(!y||u.current!==c.current)&&(u.current&&a?.unobserve(u.current),a?.observe(c.current),u.current=c.current)},[y,e.hidden]),V.useEffect(()=>()=>{u.current&&(a?.unobserve(u.current),u.current=null)},[]),V.useEffect(()=>{if(c.current){const g=p.current!==n,v=d.current!==e.sourcePosition,x=h.current!==e.targetPosition;(g||v||x)&&(p.current=n,d.current=e.sourcePosition,h.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 CC({id:e,onClick:n,onMouseEnter:s,onMouseMove:a,onMouseLeave:o,onContextMenu:c,onDoubleClick:u,nodesDraggable:d,elementsSelectable:h,nodesConnectable:p,nodesFocusable:y,resizeObserver:g,noDragClassName:v,noPanClassName:x,disableKeyboardA11y:E,rfId:A,nodeTypes:T,nodeClickDistance:C,onError:k}){const{node:_,internals:N,isParent:j}=Re(te=>{const oe=te.nodeLookup.get(e),ve=te.parentLookup.has(e);return{node:oe,internals:oe.internals,isParent:ve}},nt);let D=_.type||"default",B=T?.[D]||Av[D];B===void 0&&(k?.("003",Xn.error003(D)),D="default",B=T?.default||Av.default);const R=!!(_.draggable||d&&typeof _.draggable>"u"),U=!!(_.selectable||h&&typeof _.selectable>"u"),q=!!(_.connectable||p&&typeof _.connectable>"u"),Y=!!(_.focusable||y&&typeof _.focusable>"u"),Z=st(),le=Pb(_),L=TC({node:_,nodeType:D,hasDimensions:le,resizeObserver:g}),K=T1({nodeRef:L,disabled:_.hidden||!R,noDragClassName:v,handleSelector:_.dragHandle,nodeId:e,isSelectable:U,nodeClickDistance:C}),O=C1();if(_.hidden)return null;const H=ji(_),$=vC(_),X=U||R||n||s||a||o,se=s?te=>s(te,{...N.userNode}):void 0,w=a?te=>a(te,{...N.userNode}):void 0,z=o?te=>o(te,{...N.userNode}):void 0,F=c?te=>c(te,{...N.userNode}):void 0,P=u?te=>u(te,{...N.userNode}):void 0,fe=te=>{const{selectNodesOnDrag:oe,nodeDragThreshold:ve}=Z.getState();U&&(!oe||!R||ve>0)&&Ih({id:e,store:Z,nodeRef:L}),n&&n(te,{...N.userNode})},de=te=>{if(!(n1(te.nativeEvent)||E)){if(Yb.includes(te.key)&&U){const oe=te.key==="Escape";Ih({id:e,store:Z,unselect:oe,nodeRef:L})}else if(R&&_.selected&&Object.prototype.hasOwnProperty.call(fu,te.key)){te.preventDefault();const{ariaLabelConfig:oe}=Z.getState();Z.setState({ariaLiveMessage:oe["node.a11yDescription.ariaLiveMessage"]({direction:te.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),O({direction:fu[te.key],factor:te.shiftKey?4:1})}}},ie=()=>{if(E||!L.current?.matches(":focus-visible"))return;const{transform:te,width:oe,height:ve,autoPanOnNodeFocus:Se,setCenter:me}=Z.getState();if(!Se)return;cm(new Map([[e,_]]),{x:0,y:0,width:oe,height:ve},te,!0).length>0||me(_.position.x+H.width/2,_.position.y+H.height/2,{zoom:te[2]})};return b.jsx("div",{className:wt(["react-flow__node",`react-flow__node-${D}`,{[x]:R},_.className,{selected:_.selected,selectable:U,parent:j,draggable:R,dragging:K}]),ref:L,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:X?"all":"none",visibility:le?"visible":"hidden",..._.style,...$},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:se,onMouseMove:w,onMouseLeave:z,onContextMenu:F,onClick:fe,onDoubleClick:P,onKeyDown:Y?de:void 0,tabIndex:Y?0:void 0,onFocus:Y?ie:void 0,role:_.ariaRole??(Y?"group":void 0),"aria-roledescription":"node","aria-describedby":E?void 0:`${w1}-${A}`,"aria-label":_.ariaLabel,..._.domAttributes,children:b.jsx(uC,{value:e,children:b.jsx(B,{id:e,data:_.data,type:D,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:_.selected??!1,selectable:U,draggable:R,deletable:_.deletable??!0,isConnectable:q,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:K,dragHandle:_.dragHandle,zIndex:N.z,parentId:_.parentId,...H})})})}var MC=V.memo(CC);const OC=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function k1(e){const{nodesDraggable:n,nodesConnectable:s,nodesFocusable:a,elementsSelectable:o,onError:c}=Re(OC,nt),u=NC(e.onlyRenderVisibleElements),d=AC();return b.jsx("div",{className:"react-flow__nodes",style:Cu,children:u.map(h=>b.jsx(MC,{id:h,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:d,nodesDraggable:n,nodesConnectable:s,nodesFocusable:a,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:c},h))})}k1.displayName="NodeRenderer";const kC=V.memo(k1);function zC(e){return Re(V.useCallback(s=>{if(!e)return s.edges.map(o=>o.id);const a=[];if(s.width&&s.height)for(const o of s.edges){const c=s.nodeLookup.get(o.source),u=s.nodeLookup.get(o.target);c&&u&&AA({sourceNode:c,targetNode:u,width:s.width,height:s.height,transform:s.transform})&&a.push(o.id)}return a},[e]),nt)}const DC=({color:e="none",strokeWidth:n=1})=>{const s={strokeWidth:n,...e&&{stroke:e}};return b.jsx("polyline",{className:"arrow",style:s,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},jC=({color:e="none",strokeWidth:n=1})=>{const s={strokeWidth:n,...e&&{stroke:e,fill:e}};return b.jsx("polyline",{className:"arrowclosed",style:s,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Cv={[Qo.Arrow]:DC,[Qo.ArrowClosed]:jC};function RC(e){const n=st();return V.useMemo(()=>Object.prototype.hasOwnProperty.call(Cv,e)?Cv[e]:(n.getState().onError?.("009",Xn.error009(e)),null),[e])}const BC=({id:e,type:n,color:s,width:a=12.5,height:o=12.5,markerUnits:c="strokeWidth",strokeWidth:u,orient:d="auto-start-reverse"})=>{const h=RC(n);return h?b.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${a}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:d,refX:"0",refY:"0",children:b.jsx(h,{color:s,strokeWidth:u})}):null},z1=({defaultColor:e,rfId:n})=>{const s=Re(c=>c.edges),a=Re(c=>c.defaultEdgeOptions),o=V.useMemo(()=>jA(s,{id:n,defaultColor:e,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[s,a,n,e]);return o.length?b.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:b.jsx("defs",{children:o.map(c=>b.jsx(BC,{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};z1.displayName="MarkerDefinitions";var LC=V.memo(z1);function D1({x:e,y:n,label:s,labelStyle:a,labelShowBg:o=!0,labelBgStyle:c,labelBgPadding:u=[2,4],labelBgBorderRadius:d=2,children:h,className:p,...y}){const[g,v]=V.useState({x:1,y:0,width:0,height:0}),x=wt(["react-flow__edge-textwrapper",p]),E=V.useRef(null);return V.useEffect(()=>{if(E.current){const A=E.current.getBBox();v({x:A.x,y:A.y,width:A.width,height:A.height})}},[s]),s?b.jsxs("g",{transform:`translate(${e-g.width/2} ${n-g.height/2})`,className:x,visibility:g.width?"visible":"hidden",...y,children:[o&&b.jsx("rect",{width:g.width+2*u[0],x:-u[0],y:-u[1],height:g.height+2*u[1],className:"react-flow__edge-textbg",style:c,rx:d,ry:d}),b.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:E,style:a,children:s}),h]}):null}D1.displayName="EdgeText";const $C=V.memo(D1);function dr({path:e,labelX:n,labelY:s,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,interactionWidth:p=20,...y}){return b.jsxs(b.Fragment,{children:[b.jsx("path",{...y,d:e,fill:"none",className:wt(["react-flow__edge-path",y.className])}),p?b.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}):null,a&&Vn(n)&&Vn(s)?b.jsx($C,{x:n,y:s,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h}):null]})}function Mv({pos:e,x1:n,y1:s,x2:a,y2:o}){return e===pe.Left||e===pe.Right?[.5*(n+a),s]:[n,.5*(s+o)]}function j1({sourceX:e,sourceY:n,sourcePosition:s=pe.Bottom,targetX:a,targetY:o,targetPosition:c=pe.Top}){const[u,d]=Mv({pos:s,x1:e,y1:n,x2:a,y2:o}),[h,p]=Mv({pos:c,x1:a,y1:o,x2:e,y2:n}),[y,g,v,x]=s1({sourceX:e,sourceY:n,targetX:a,targetY:o,sourceControlX:u,sourceControlY:d,targetControlX:h,targetControlY:p});return[`M${e},${n} C${u},${d} ${h},${p} ${a},${o}`,y,g,v,x]}function R1(e){return V.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,sourcePosition:u,targetPosition:d,label:h,labelStyle:p,labelShowBg:y,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:x,style:E,markerEnd:A,markerStart:T,interactionWidth:C})=>{const[k,_,N]=j1({sourceX:s,sourceY:a,sourcePosition:u,targetX:o,targetY:c,targetPosition:d}),j=e.isInternal?void 0:n;return b.jsx(dr,{id:j,path:k,labelX:_,labelY:N,label:h,labelStyle:p,labelShowBg:y,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:x,style:E,markerEnd:A,markerStart:T,interactionWidth:C})})}const HC=R1({isInternal:!1}),B1=R1({isInternal:!0});HC.displayName="SimpleBezierEdge";B1.displayName="SimpleBezierEdgeInternal";function L1(e){return V.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:g,style:v,sourcePosition:x=pe.Bottom,targetPosition:E=pe.Top,markerEnd:A,markerStart:T,pathOptions:C,interactionWidth:k})=>{const[_,N,j]=Lh({sourceX:s,sourceY:a,sourcePosition:x,targetX:o,targetY:c,targetPosition:E,borderRadius:C?.borderRadius,offset:C?.offset,stepPosition:C?.stepPosition}),D=e.isInternal?void 0:n;return b.jsx(dr,{id:D,path:_,labelX:N,labelY:j,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:g,style:v,markerEnd:A,markerStart:T,interactionWidth:k})})}const $1=L1({isInternal:!1}),H1=L1({isInternal:!0});$1.displayName="SmoothStepEdge";H1.displayName="SmoothStepEdgeInternal";function U1(e){return V.memo(({id:n,...s})=>{const a=e.isInternal?void 0:n;return b.jsx($1,{...s,id:a,pathOptions:V.useMemo(()=>({borderRadius:0,offset:s.pathOptions?.offset}),[s.pathOptions?.offset])})})}const UC=U1({isInternal:!1}),I1=U1({isInternal:!0});UC.displayName="StepEdge";I1.displayName="StepEdgeInternal";function q1(e){return V.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:g,style:v,markerEnd:x,markerStart:E,interactionWidth:A})=>{const[T,C,k]=o1({sourceX:s,sourceY:a,targetX:o,targetY:c}),_=e.isInternal?void 0:n;return b.jsx(dr,{id:_,path:T,labelX:C,labelY:k,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:g,style:v,markerEnd:x,markerStart:E,interactionWidth:A})})}const IC=q1({isInternal:!1}),V1=q1({isInternal:!0});IC.displayName="StraightEdge";V1.displayName="StraightEdgeInternal";function Y1(e){return V.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,sourcePosition:u=pe.Bottom,targetPosition:d=pe.Top,label:h,labelStyle:p,labelShowBg:y,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:x,style:E,markerEnd:A,markerStart:T,pathOptions:C,interactionWidth:k})=>{const[_,N,j]=a1({sourceX:s,sourceY:a,sourcePosition:u,targetX:o,targetY:c,targetPosition:d,curvature:C?.curvature}),D=e.isInternal?void 0:n;return b.jsx(dr,{id:D,path:_,labelX:N,labelY:j,label:h,labelStyle:p,labelShowBg:y,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:x,style:E,markerEnd:A,markerStart:T,interactionWidth:k})})}const qC=Y1({isInternal:!1}),G1=Y1({isInternal:!0});qC.displayName="BezierEdge";G1.displayName="BezierEdgeInternal";const Ov={default:G1,straight:V1,step:I1,smoothstep:H1,simplebezier:B1},kv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},VC=(e,n,s)=>s===pe.Left?e-n:s===pe.Right?e+n:e,YC=(e,n,s)=>s===pe.Top?e-n:s===pe.Bottom?e+n:e,zv="react-flow__edgeupdater";function Dv({position:e,centerX:n,centerY:s,radius:a=10,onMouseDown:o,onMouseEnter:c,onMouseOut:u,type:d}){return b.jsx("circle",{onMouseDown:o,onMouseEnter:c,onMouseOut:u,className:wt([zv,`${zv}-${d}`]),cx:VC(n,a,e),cy:YC(s,a,e),r:a,stroke:"transparent",fill:"transparent"})}function GC({isReconnectable:e,reconnectRadius:n,edge:s,sourceX:a,sourceY:o,targetX:c,targetY:u,sourcePosition:d,targetPosition:h,onReconnect:p,onReconnectStart:y,onReconnectEnd:g,setReconnecting:v,setUpdateHover:x}){const E=st(),A=(N,j)=>{if(N.button!==0)return;const{autoPanOnConnect:D,domNode:B,connectionMode:R,connectionRadius:U,lib:q,onConnectStart:Y,cancelConnection:Z,nodeLookup:le,rfId:L,panBy:K,updateConnection:O}=E.getState(),H=j.type==="target",$=(w,z)=>{v(!1),g?.(w,s,j.type,z)},X=w=>p?.(s,w),se=(w,z)=>{v(!0),y?.(N,s,j.type),Y?.(w,z)};Uh.onPointerDown(N.nativeEvent,{autoPanOnConnect:D,connectionMode:R,connectionRadius:U,domNode:B,handleId:j.id,nodeId:j.nodeId,nodeLookup:le,isTarget:H,edgeUpdaterType:j.type,lib:q,flowId:L,cancelConnection:Z,panBy:K,isValidConnection:(...w)=>E.getState().isValidConnection?.(...w)??!0,onConnect:X,onConnectStart:se,onConnectEnd:(...w)=>E.getState().onConnectEnd?.(...w),onReconnectEnd:$,updateConnection:O,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,dragThreshold:E.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},T=N=>A(N,{nodeId:s.target,id:s.targetHandle??null,type:"target"}),C=N=>A(N,{nodeId:s.source,id:s.sourceHandle??null,type:"source"}),k=()=>x(!0),_=()=>x(!1);return b.jsxs(b.Fragment,{children:[(e===!0||e==="source")&&b.jsx(Dv,{position:d,centerX:a,centerY:o,radius:n,onMouseDown:T,onMouseEnter:k,onMouseOut:_,type:"source"}),(e===!0||e==="target")&&b.jsx(Dv,{position:h,centerX:c,centerY:u,radius:n,onMouseDown:C,onMouseEnter:k,onMouseOut:_,type:"target"})]})}function XC({id:e,edgesFocusable:n,edgesReconnectable:s,elementsSelectable:a,onClick:o,onDoubleClick:c,onContextMenu:u,onMouseEnter:d,onMouseMove:h,onMouseLeave:p,reconnectRadius:y,onReconnect:g,onReconnectStart:v,onReconnectEnd:x,rfId:E,edgeTypes:A,noPanClassName:T,onError:C,disableKeyboardA11y:k}){let _=Re(me=>me.edgeLookup.get(e));const N=Re(me=>me.defaultEdgeOptions);_=N?{...N,..._}:_;let j=_.type||"default",D=A?.[j]||Ov[j];D===void 0&&(C?.("011",Xn.error011(j)),j="default",D=A?.default||Ov.default);const B=!!(_.focusable||n&&typeof _.focusable>"u"),R=typeof g<"u"&&(_.reconnectable||s&&typeof _.reconnectable>"u"),U=!!(_.selectable||a&&typeof _.selectable>"u"),q=V.useRef(null),[Y,Z]=V.useState(!1),[le,L]=V.useState(!1),K=st(),{zIndex:O,sourceX:H,sourceY:$,targetX:X,targetY:se,sourcePosition:w,targetPosition:z}=Re(V.useCallback(me=>{const ge=me.nodeLookup.get(_.source),xe=me.nodeLookup.get(_.target);if(!ge||!xe)return{zIndex:_.zIndex,...kv};const Ce=DA({id:e,sourceNode:ge,targetNode:xe,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:me.connectionMode,onError:C});return{zIndex:_A({selected:_.selected,zIndex:_.zIndex,sourceNode:ge,targetNode:xe,elevateOnSelect:me.elevateEdgesOnSelect,zIndexMode:me.zIndexMode}),...Ce||kv}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),nt),F=V.useMemo(()=>_.markerStart?`url('#${$h(_.markerStart,E)}')`:void 0,[_.markerStart,E]),P=V.useMemo(()=>_.markerEnd?`url('#${$h(_.markerEnd,E)}')`:void 0,[_.markerEnd,E]);if(_.hidden||H===null||$===null||X===null||se===null)return null;const fe=me=>{const{addSelectedEdges:ge,unselectNodesAndEdges:xe,multiSelectionActive:Ce}=K.getState();U&&(K.setState({nodesSelectionActive:!1}),_.selected&&Ce?(xe({nodes:[],edges:[_]}),q.current?.blur()):ge([e])),o&&o(me,_)},de=c?me=>{c(me,{..._})}:void 0,ie=u?me=>{u(me,{..._})}:void 0,te=d?me=>{d(me,{..._})}:void 0,oe=h?me=>{h(me,{..._})}:void 0,ve=p?me=>{p(me,{..._})}:void 0,Se=me=>{if(!k&&Yb.includes(me.key)&&U){const{unselectNodesAndEdges:ge,addSelectedEdges:xe}=K.getState();me.key==="Escape"?(q.current?.blur(),ge({edges:[_]})):xe([e])}};return b.jsx("svg",{style:{zIndex:O},children:b.jsxs("g",{className:wt(["react-flow__edge",`react-flow__edge-${j}`,_.className,T,{selected:_.selected,animated:_.animated,inactive:!U&&!o,updating:Y,selectable:U}]),onClick:fe,onDoubleClick:de,onContextMenu:ie,onMouseEnter:te,onMouseMove:oe,onMouseLeave:ve,onKeyDown:B?Se:void 0,tabIndex:B?0:void 0,role:_.ariaRole??(B?"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":B?`${x1}-${E}`:void 0,ref:q,..._.domAttributes,children:[!le&&b.jsx(D,{id:e,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:U,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:H,sourceY:$,targetX:X,targetY:se,sourcePosition:w,targetPosition:z,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:F,markerEnd:P,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),R&&b.jsx(GC,{edge:_,isReconnectable:R,reconnectRadius:y,onReconnect:g,onReconnectStart:v,onReconnectEnd:x,sourceX:H,sourceY:$,targetX:X,targetY:se,sourcePosition:w,targetPosition:z,setUpdateHover:Z,setReconnecting:L})]})})}var KC=V.memo(XC);const ZC=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function X1({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:s,edgeTypes:a,noPanClassName:o,onReconnect:c,onEdgeContextMenu:u,onEdgeMouseEnter:d,onEdgeMouseMove:h,onEdgeMouseLeave:p,onEdgeClick:y,reconnectRadius:g,onEdgeDoubleClick:v,onReconnectStart:x,onReconnectEnd:E,disableKeyboardA11y:A}){const{edgesFocusable:T,edgesReconnectable:C,elementsSelectable:k,onError:_}=Re(ZC,nt),N=zC(n);return b.jsxs("div",{className:"react-flow__edges",children:[b.jsx(LC,{defaultColor:e,rfId:s}),N.map(j=>b.jsx(KC,{id:j,edgesFocusable:T,edgesReconnectable:C,elementsSelectable:k,noPanClassName:o,onReconnect:c,onContextMenu:u,onMouseEnter:d,onMouseMove:h,onMouseLeave:p,onClick:y,reconnectRadius:g,onDoubleClick:v,onReconnectStart:x,onReconnectEnd:E,rfId:s,onError:_,edgeTypes:a,disableKeyboardA11y:A},j))]})}X1.displayName="EdgeRenderer";const QC=V.memo(X1),FC=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function JC({children:e}){const n=Re(FC);return b.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function WC(e){const n=fr(),s=V.useRef(!1);V.useEffect(()=>{!s.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),s.current=!0)},[e,n.viewportInitialized])}const PC=e=>e.panZoom?.syncViewport;function eM(e){const n=Re(PC),s=st();return V.useEffect(()=>{e&&(n?.(e),s.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function tM(e){return e.connection.inProgress?{...e.connection,to:wl(e.connection.to,e.transform)}:{...e.connection}}function nM(e){return tM}function iM(e){const n=nM();return Re(n,nt)}const sM=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function aM({containerStyle:e,style:n,type:s,component:a}){const{nodesConnectable:o,width:c,height:u,isValid:d,inProgress:h}=Re(sM,nt);return!(c&&o&&h)?null:b.jsx("svg",{style:e,width:c,height:u,className:"react-flow__connectionline react-flow__container",children:b.jsx("g",{className:wt(["react-flow__connection",Kb(d)]),children:b.jsx(K1,{style:n,type:s,CustomComponent:a,isValid:d})})})}const K1=({style:e,type:n=gs.Bezier,CustomComponent:s,isValid:a})=>{const{inProgress:o,from:c,fromNode:u,fromHandle:d,fromPosition:h,to:p,toNode:y,toHandle:g,toPosition:v,pointer:x}=iM();if(!o)return;if(s)return b.jsx(s,{connectionLineType:n,connectionLineStyle:e,fromNode:u,fromHandle:d,fromX:c.x,fromY:c.y,toX:p.x,toY:p.y,fromPosition:h,toPosition:v,connectionStatus:Kb(a),toNode:y,toHandle:g,pointer:x});let E="";const A={sourceX:c.x,sourceY:c.y,sourcePosition:h,targetX:p.x,targetY:p.y,targetPosition:v};switch(n){case gs.Bezier:[E]=a1(A);break;case gs.SimpleBezier:[E]=j1(A);break;case gs.Step:[E]=Lh({...A,borderRadius:0});break;case gs.SmoothStep:[E]=Lh(A);break;default:[E]=o1(A)}return b.jsx("path",{d:E,fill:"none",className:"react-flow__connection-path",style:e})};K1.displayName="ConnectionLine";const lM={};function jv(e=lM){V.useRef(e),st(),V.useEffect(()=>{},[e])}function oM(){st(),V.useRef(!1),V.useEffect(()=>{},[])}function Z1({nodeTypes:e,edgeTypes:n,onInit:s,onNodeClick:a,onEdgeClick:o,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:p,onNodeContextMenu:y,onSelectionContextMenu:g,onSelectionStart:v,onSelectionEnd:x,connectionLineType:E,connectionLineStyle:A,connectionLineComponent:T,connectionLineContainerStyle:C,selectionKeyCode:k,selectionOnDrag:_,selectionMode:N,multiSelectionKeyCode:j,panActivationKeyCode:D,zoomActivationKeyCode:B,deleteKeyCode:R,onlyRenderVisibleElements:U,elementsSelectable:q,defaultViewport:Y,translateExtent:Z,minZoom:le,maxZoom:L,preventScrolling:K,defaultMarkerColor:O,zoomOnScroll:H,zoomOnPinch:$,panOnScroll:X,panOnScrollSpeed:se,panOnScrollMode:w,zoomOnDoubleClick:z,panOnDrag:F,autoPanOnSelection:P,onPaneClick:fe,onPaneMouseEnter:de,onPaneMouseMove:ie,onPaneMouseLeave:te,onPaneScroll:oe,onPaneContextMenu:ve,paneClickDistance:Se,nodeClickDistance:me,onEdgeContextMenu:ge,onEdgeMouseEnter:xe,onEdgeMouseMove:Ce,onEdgeMouseLeave:Ue,reconnectRadius:Pe,onReconnect:zt,onReconnectStart:ot,onReconnectEnd:xt,noDragClassName:Dt,noWheelClassName:kn,noPanClassName:_t,disableKeyboardA11y:Ke,nodeExtent:ut,rfId:Ut,viewport:Lt,onViewportChange:jt}){return jv(e),jv(n),oM(),WC(s),eM(Lt),b.jsx(xC,{onPaneClick:fe,onPaneMouseEnter:de,onPaneMouseMove:ie,onPaneMouseLeave:te,onPaneContextMenu:ve,onPaneScroll:oe,paneClickDistance:Se,deleteKeyCode:R,selectionKeyCode:k,selectionOnDrag:_,selectionMode:N,onSelectionStart:v,onSelectionEnd:x,multiSelectionKeyCode:j,panActivationKeyCode:D,zoomActivationKeyCode:B,elementsSelectable:q,zoomOnScroll:H,zoomOnPinch:$,zoomOnDoubleClick:z,panOnScroll:X,panOnScrollSpeed:se,panOnScrollMode:w,panOnDrag:F,autoPanOnSelection:P,defaultViewport:Y,translateExtent:Z,minZoom:le,maxZoom:L,onSelectionContextMenu:g,preventScrolling:K,noDragClassName:Dt,noWheelClassName:kn,noPanClassName:_t,disableKeyboardA11y:Ke,onViewportChange:jt,isControlledViewport:!!Lt,children:b.jsxs(JC,{children:[b.jsx(QC,{edgeTypes:n,onEdgeClick:o,onEdgeDoubleClick:u,onReconnect:zt,onReconnectStart:ot,onReconnectEnd:xt,onlyRenderVisibleElements:U,onEdgeContextMenu:ge,onEdgeMouseEnter:xe,onEdgeMouseMove:Ce,onEdgeMouseLeave:Ue,reconnectRadius:Pe,defaultMarkerColor:O,noPanClassName:_t,disableKeyboardA11y:Ke,rfId:Ut}),b.jsx(aM,{style:A,type:E,component:T,containerStyle:C}),b.jsx("div",{className:"react-flow__edgelabel-renderer"}),b.jsx(kC,{nodeTypes:e,onNodeClick:a,onNodeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:p,onNodeContextMenu:y,nodeClickDistance:me,onlyRenderVisibleElements:U,noPanClassName:_t,noDragClassName:Dt,disableKeyboardA11y:Ke,nodeExtent:ut,rfId:Ut}),b.jsx("div",{className:"react-flow__viewport-portal"})]})})}Z1.displayName="GraphView";const rM=V.memo(Z1),cM=Wb(),Rv=({nodes:e,edges:n,defaultNodes:s,defaultEdges:a,width:o,height:c,fitView:u,fitViewOptions:d,minZoom:h=.5,maxZoom:p=2,nodeOrigin:y,nodeExtent:g,zIndexMode:v="basic"}={})=>{const x=new Map,E=new Map,A=new Map,T=new Map,C=a??n??[],k=s??e??[],_=y??[0,0],N=g??Ko;u1(A,T,C);const{nodesInitialized:j}=Hh(k,x,E,{nodeOrigin:_,nodeExtent:N,zIndexMode:v});let D=[0,0,1];if(u&&o&&c){const B=cr(x,{filter:Y=>!!((Y.width||Y.initialWidth)&&(Y.height||Y.initialHeight))}),{x:R,y:U,zoom:q}=fm(B,o,c,h,p,d?.padding??.1);D=[R,U,q]}return{rfId:"1",width:o??0,height:c??0,transform:D,nodes:k,nodesInitialized:j,nodeLookup:x,parentLookup:E,edges:C,edgeLookup:T,connectionLookup:A,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:s!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:p,translateExtent:Ko,nodeExtent:N,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:dl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:u??!1,fitViewOptions:d,fitViewResolver:null,connection:{...Xb},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:cM,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Gb,zIndexMode:v,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},uM=({nodes:e,edges:n,defaultNodes:s,defaultEdges:a,width:o,height:c,fitView:u,fitViewOptions:d,minZoom:h,maxZoom:p,nodeOrigin:y,nodeExtent:g,zIndexMode:v})=>xT((x,E)=>{async function A(){const{nodeLookup:T,panZoom:C,fitViewOptions:k,fitViewResolver:_,width:N,height:j,minZoom:D,maxZoom:B}=E();C&&(await vA({nodes:T,width:N,height:j,panZoom:C,minZoom:D,maxZoom:B},k),_?.resolve(!0),x({fitViewResolver:null}))}return{...Rv({nodes:e,edges:n,width:o,height:c,fitView:u,fitViewOptions:d,minZoom:h,maxZoom:p,nodeOrigin:y,nodeExtent:g,defaultNodes:s,defaultEdges:a,zIndexMode:v}),setNodes:T=>{const{nodeLookup:C,parentLookup:k,nodeOrigin:_,elevateNodesOnSelect:N,fitViewQueued:j,zIndexMode:D,nodesSelectionActive:B}=E(),{nodesInitialized:R,hasSelectedNodes:U}=Hh(T,C,k,{nodeOrigin:_,nodeExtent:g,elevateNodesOnSelect:N,checkEquality:!0,zIndexMode:D}),q=B&&U;j&&R?(A(),x({nodes:T,nodesInitialized:R,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:q})):x({nodes:T,nodesInitialized:R,nodesSelectionActive:q})},setEdges:T=>{const{connectionLookup:C,edgeLookup:k}=E();u1(C,k,T),x({edges:T})},setDefaultNodesAndEdges:(T,C)=>{if(T){const{setNodes:k}=E();k(T),x({hasDefaultNodes:!0})}if(C){const{setEdges:k}=E();k(C),x({hasDefaultEdges:!0})}},updateNodeInternals:T=>{const{triggerNodeChanges:C,nodeLookup:k,parentLookup:_,domNode:N,nodeOrigin:j,nodeExtent:D,debug:B,fitViewQueued:R,zIndexMode:U}=E(),{changes:q,updatedInternals:Y}=IA(T,k,_,N,j,D,U);Y&&(LA(k,_,{nodeOrigin:j,nodeExtent:D,zIndexMode:U}),R?(A(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),q?.length>0&&(B&&console.log("React Flow: trigger node changes",q),C?.(q)))},updateNodePositions:(T,C=!1)=>{const k=[];let _=[];const{nodeLookup:N,triggerNodeChanges:j,connection:D,updateConnection:B,onNodesChangeMiddlewareMap:R}=E();for(const[U,q]of T){const Y=N.get(U),Z=!!(Y?.expandParent&&Y?.parentId&&q?.position),le={id:U,type:"position",position:Z?{x:Math.max(0,q.position.x),y:Math.max(0,q.position.y)}:q.position,dragging:C};if(Y&&D.inProgress&&D.fromNode.id===Y.id){const L=Fs(Y,D.fromHandle,pe.Left,!0);B({...D,from:L})}Z&&Y.parentId&&k.push({id:U,parentId:Y.parentId,rect:{...q.internals.positionAbsolute,width:q.measured.width??0,height:q.measured.height??0}}),_.push(le)}if(k.length>0){const{parentLookup:U,nodeOrigin:q}=E(),Y=ym(k,N,U,q);_.push(...Y)}for(const U of R.values())_=U(_);j(_)},triggerNodeChanges:T=>{const{onNodesChange:C,setNodes:k,nodes:_,hasDefaultNodes:N,debug:j}=E();if(T?.length){if(N){const D=YT(T,_);k(D)}j&&console.log("React Flow: trigger node changes",T),C?.(T)}},triggerEdgeChanges:T=>{const{onEdgesChange:C,setEdges:k,edges:_,hasDefaultEdges:N,debug:j}=E();if(T?.length){if(N){const D=GT(T,_);k(D)}j&&console.log("React Flow: trigger edge changes",T),C?.(T)}},addSelectedNodes:T=>{const{multiSelectionActive:C,edgeLookup:k,nodeLookup:_,triggerNodeChanges:N,triggerEdgeChanges:j}=E();if(C){const D=T.map(B=>Hs(B,!0));N(D);return}N(Fa(_,new Set([...T]),!0)),j(Fa(k))},addSelectedEdges:T=>{const{multiSelectionActive:C,edgeLookup:k,nodeLookup:_,triggerNodeChanges:N,triggerEdgeChanges:j}=E();if(C){const D=T.map(B=>Hs(B,!0));j(D);return}j(Fa(k,new Set([...T]))),N(Fa(_,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:C}={})=>{const{edges:k,nodes:_,nodeLookup:N,triggerNodeChanges:j,triggerEdgeChanges:D}=E(),B=T||_,R=C||k,U=[];for(const Y of B){if(!Y.selected)continue;const Z=N.get(Y.id);Z&&(Z.selected=!1),U.push(Hs(Y.id,!1))}const q=[];for(const Y of R)Y.selected&&q.push(Hs(Y.id,!1));j(U),D(q)},setMinZoom:T=>{const{panZoom:C,maxZoom:k}=E();C?.setScaleExtent([T,k]),x({minZoom:T})},setMaxZoom:T=>{const{panZoom:C,minZoom:k}=E();C?.setScaleExtent([k,T]),x({maxZoom:T})},setTranslateExtent:T=>{E().panZoom?.setTranslateExtent(T),x({translateExtent:T})},resetSelectedElements:()=>{const{edges:T,nodes:C,triggerNodeChanges:k,triggerEdgeChanges:_,elementsSelectable:N}=E();if(!N)return;const j=C.reduce((B,R)=>R.selected?[...B,Hs(R.id,!1)]:B,[]),D=T.reduce((B,R)=>R.selected?[...B,Hs(R.id,!1)]:B,[]);k(j),_(D)},setNodeExtent:T=>{const{nodes:C,nodeLookup:k,parentLookup:_,nodeOrigin:N,elevateNodesOnSelect:j,nodeExtent:D,zIndexMode:B}=E();T[0][0]===D[0][0]&&T[0][1]===D[0][1]&&T[1][0]===D[1][0]&&T[1][1]===D[1][1]||(Hh(C,k,_,{nodeOrigin:N,nodeExtent:T,elevateNodesOnSelect:j,checkEquality:!1,zIndexMode:B}),x({nodeExtent:T}))},panBy:T=>{const{transform:C,width:k,height:_,panZoom:N,translateExtent:j}=E();return qA({delta:T,panZoom:N,transform:C,translateExtent:j,width:k,height:_})},setCenter:async(T,C,k)=>{const{width:_,height:N,maxZoom:j,panZoom:D}=E();if(!D)return!1;const B=typeof k?.zoom<"u"?k.zoom:j;return await D.setViewport({x:_/2-T*B,y:N/2-C*B,zoom:B},{duration:k?.duration,ease:k?.ease,interpolate:k?.interpolate}),!0},cancelConnection:()=>{x({connection:{...Xb}})},updateConnection:T=>{x({connection:T})},reset:()=>x({...Rv()})}},Object.is);function Q1({initialNodes:e,initialEdges:n,defaultNodes:s,defaultEdges:a,initialWidth:o,initialHeight:c,initialMinZoom:u,initialMaxZoom:d,initialFitViewOptions:h,fitView:p,nodeOrigin:y,nodeExtent:g,zIndexMode:v,children:x}){const[E]=V.useState(()=>uM({nodes:e,edges:n,defaultNodes:s,defaultEdges:a,width:o,height:c,fitView:p,minZoom:u,maxZoom:d,fitViewOptions:h,nodeOrigin:y,nodeExtent:g,zIndexMode:v}));return b.jsx(NT,{value:E,children:b.jsx(JT,{children:x})})}function fM({children:e,nodes:n,edges:s,defaultNodes:a,defaultEdges:o,width:c,height:u,fitView:d,fitViewOptions:h,minZoom:p,maxZoom:y,nodeOrigin:g,nodeExtent:v,zIndexMode:x}){return V.useContext(Au)?b.jsx(b.Fragment,{children:e}):b.jsx(Q1,{initialNodes:n,initialEdges:s,defaultNodes:a,defaultEdges:o,initialWidth:c,initialHeight:u,fitView:d,initialFitViewOptions:h,initialMinZoom:p,initialMaxZoom:y,nodeOrigin:g,nodeExtent:v,zIndexMode:x,children:e})}const dM={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function hM({nodes:e,edges:n,defaultNodes:s,defaultEdges:a,className:o,nodeTypes:c,edgeTypes:u,onNodeClick:d,onEdgeClick:h,onInit:p,onMove:y,onMoveStart:g,onMoveEnd:v,onConnect:x,onConnectStart:E,onConnectEnd:A,onClickConnectStart:T,onClickConnectEnd:C,onNodeMouseEnter:k,onNodeMouseMove:_,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:D,onNodeDragStart:B,onNodeDrag:R,onNodeDragStop:U,onNodesDelete:q,onEdgesDelete:Y,onDelete:Z,onSelectionChange:le,onSelectionDragStart:L,onSelectionDrag:K,onSelectionDragStop:O,onSelectionContextMenu:H,onSelectionStart:$,onSelectionEnd:X,onBeforeDelete:se,connectionMode:w,connectionLineType:z=gs.Bezier,connectionLineStyle:F,connectionLineComponent:P,connectionLineContainerStyle:fe,deleteKeyCode:de="Backspace",selectionKeyCode:ie="Shift",selectionOnDrag:te=!1,selectionMode:oe=Zo.Full,panActivationKeyCode:ve="Space",multiSelectionKeyCode:Se=Jo()?"Meta":"Control",zoomActivationKeyCode:me=Jo()?"Meta":"Control",snapToGrid:ge,snapGrid:xe,onlyRenderVisibleElements:Ce=!1,selectNodesOnDrag:Ue,nodesDraggable:Pe,autoPanOnNodeFocus:zt,nodesConnectable:ot,nodesFocusable:xt,nodeOrigin:Dt=E1,edgesFocusable:kn,edgesReconnectable:_t,elementsSelectable:Ke=!0,defaultViewport:ut=LT,minZoom:Ut=.5,maxZoom:Lt=2,translateExtent:jt=Ko,preventScrolling:hn=!0,nodeExtent:mn,defaultMarkerColor:Ml="#b1b1b7",zoomOnScroll:Fe=!0,zoomOnPinch:It=!0,panOnScroll:mt=!1,panOnScrollSpeed:pn=.5,panOnScrollMode:At=Gs.Free,zoomOnDoubleClick:Ol=!0,panOnDrag:pt=!0,onPaneClick:Ri,onPaneMouseEnter:Qn,onPaneMouseMove:ri,onPaneMouseLeave:Bi,onPaneScroll:qt,onPaneContextMenu:ci,paneClickDistance:ft=1,nodeClickDistance:ia=0,children:Tt,onReconnect:ui,onReconnectStart:zn,onReconnectEnd:kl,onEdgeContextMenu:gn,onEdgeDoubleClick:sa,onEdgeMouseEnter:aa,onEdgeMouseMove:ws,onEdgeMouseLeave:xs,reconnectRadius:la=10,onNodesChange:oa,onEdgesChange:yn,noDragClassName:J="nodrag",noWheelClassName:he="nowheel",noPanClassName:Ne="nopan",fitView:Ie,fitViewOptions:tn,connectOnClick:Fn,attributionPosition:et,proOptions:vn,defaultEdgeOptions:zl,elevateNodesOnSelect:Li=!0,elevateEdgesOnSelect:$i=!1,disableKeyboardA11y:Hi=!1,autoPanOnConnect:Ui,autoPanOnNodeDrag:gt,autoPanOnSelection:gr=!0,autoPanSpeed:yr,connectionRadius:fi,isValidConnection:Ii,onError:Vu,style:vr,id:Dl,nodeDragThreshold:Yu,connectionDragThreshold:ra,viewport:ca,onViewportChange:Dn,width:Vt,height:br,colorMode:Gu="light",debug:jl,onScroll:Rl,ariaLabelConfig:ua,zIndexMode:Sr="basic",...Yt},Bl){const fa=Dl||"1",Ll=IT(Gu),qi=V.useCallback($l=>{$l.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Rl?.($l)},[Rl]);return b.jsx("div",{"data-testid":"rf__wrapper",...Yt,onScroll:qi,style:{...vr,...dM},ref:Bl,className:wt(["react-flow",o,Ll]),id:Dl,role:"application",children:b.jsxs(fM,{nodes:e,edges:n,width:Vt,height:br,fitView:Ie,fitViewOptions:tn,minZoom:Ut,maxZoom:Lt,nodeOrigin:Dt,nodeExtent:mn,zIndexMode:Sr,children:[b.jsx(UT,{nodes:e,edges:n,defaultNodes:s,defaultEdges:a,onConnect:x,onConnectStart:E,onConnectEnd:A,onClickConnectStart:T,onClickConnectEnd:C,nodesDraggable:Pe,autoPanOnNodeFocus:zt,nodesConnectable:ot,nodesFocusable:xt,edgesFocusable:kn,edgesReconnectable:_t,elementsSelectable:Ke,elevateNodesOnSelect:Li,elevateEdgesOnSelect:$i,minZoom:Ut,maxZoom:Lt,nodeExtent:mn,onNodesChange:oa,onEdgesChange:yn,snapToGrid:ge,snapGrid:xe,connectionMode:w,translateExtent:jt,connectOnClick:Fn,defaultEdgeOptions:zl,fitView:Ie,fitViewOptions:tn,onNodesDelete:q,onEdgesDelete:Y,onDelete:Z,onNodeDragStart:B,onNodeDrag:R,onNodeDragStop:U,onSelectionDrag:K,onSelectionDragStart:L,onSelectionDragStop:O,onMove:y,onMoveStart:g,onMoveEnd:v,noPanClassName:Ne,nodeOrigin:Dt,rfId:fa,autoPanOnConnect:Ui,autoPanOnNodeDrag:gt,autoPanSpeed:yr,onError:Vu,connectionRadius:fi,isValidConnection:Ii,selectNodesOnDrag:Ue,nodeDragThreshold:Yu,connectionDragThreshold:ra,onBeforeDelete:se,debug:jl,ariaLabelConfig:ua,zIndexMode:Sr}),b.jsx(rM,{onInit:p,onNodeClick:d,onEdgeClick:h,onNodeMouseEnter:k,onNodeMouseMove:_,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:D,nodeTypes:c,edgeTypes:u,connectionLineType:z,connectionLineStyle:F,connectionLineComponent:P,connectionLineContainerStyle:fe,selectionKeyCode:ie,selectionOnDrag:te,selectionMode:oe,deleteKeyCode:de,multiSelectionKeyCode:Se,panActivationKeyCode:ve,zoomActivationKeyCode:me,onlyRenderVisibleElements:Ce,defaultViewport:ut,translateExtent:jt,minZoom:Ut,maxZoom:Lt,preventScrolling:hn,zoomOnScroll:Fe,zoomOnPinch:It,zoomOnDoubleClick:Ol,panOnScroll:mt,panOnScrollSpeed:pn,panOnScrollMode:At,panOnDrag:pt,autoPanOnSelection:gr,onPaneClick:Ri,onPaneMouseEnter:Qn,onPaneMouseMove:ri,onPaneMouseLeave:Bi,onPaneScroll:qt,onPaneContextMenu:ci,paneClickDistance:ft,nodeClickDistance:ia,onSelectionContextMenu:H,onSelectionStart:$,onSelectionEnd:X,onReconnect:ui,onReconnectStart:zn,onReconnectEnd:kl,onEdgeContextMenu:gn,onEdgeDoubleClick:sa,onEdgeMouseEnter:aa,onEdgeMouseMove:ws,onEdgeMouseLeave:xs,reconnectRadius:la,defaultMarkerColor:Ml,noDragClassName:J,noWheelClassName:he,noPanClassName:Ne,rfId:fa,disableKeyboardA11y:Hi,nodeExtent:mn,viewport:ca,onViewportChange:Dn}),b.jsx(BT,{onSelectionChange:le}),Tt,b.jsx(kT,{proOptions:vn,position:et}),b.jsx(OT,{rfId:fa,disableKeyboardA11y:Hi})]})})}var mM=_1(hM);const pM=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function gM({children:e}){const n=Re(pM);return n?ET.createPortal(e,n):null}function yM({dimensions:e,lineWidth:n,variant:s,className:a}){return b.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:wt(["react-flow__background-pattern",s,a])})}function vM({radius:e,className:n}){return b.jsx("circle",{cx:e,cy:e,r:e,className:wt(["react-flow__background-pattern","dots",n])})}var ys;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ys||(ys={}));const bM={[ys.Dots]:1,[ys.Lines]:1,[ys.Cross]:6},SM=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function F1({id:e,variant:n=ys.Dots,gap:s=20,size:a,lineWidth:o=1,offset:c=0,color:u,bgColor:d,style:h,className:p,patternClassName:y}){const g=V.useRef(null),{transform:v,patternId:x}=Re(SM,nt),E=a||bM[n],A=n===ys.Dots,T=n===ys.Cross,C=Array.isArray(s)?s:[s,s],k=[C[0]*v[2]||1,C[1]*v[2]||1],_=E*v[2],N=Array.isArray(c)?c:[c,c],j=T?[_,_]:k,D=[N[0]*v[2]||1+j[0]/2,N[1]*v[2]||1+j[1]/2],B=`${x}${e||""}`;return b.jsxs("svg",{className:wt(["react-flow__background",p]),style:{...h,...Cu,"--xy-background-color-props":d,"--xy-background-pattern-color-props":u},ref:g,"data-testid":"rf__background",children:[b.jsx("pattern",{id:B,x:v[0]%k[0],y:v[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${D[0]},-${D[1]})`,children:A?b.jsx(vM,{radius:_/2,className:y}):b.jsx(yM,{dimensions:j,lineWidth:o,variant:n,className:y})}),b.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${B})`})]})}F1.displayName="Background";const wM=V.memo(F1);function xM(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:b.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function EM(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:b.jsx("path",{d:"M0 0h32v4.2H0z"})})}function NM(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:b.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 _M(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.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 AM(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.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 $c({children:e,className:n,...s}){return b.jsx("button",{type:"button",className:wt(["react-flow__controls-button",n]),...s,children:e})}const TM=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function J1({style:e,showZoom:n=!0,showFitView:s=!0,showInteractive:a=!0,fitViewOptions:o,onZoomIn:c,onZoomOut:u,onFitView:d,onInteractiveChange:h,className:p,children:y,position:g="bottom-left",orientation:v="vertical","aria-label":x}){const E=st(),{isInteractive:A,minZoomReached:T,maxZoomReached:C,ariaLabelConfig:k}=Re(TM,nt),{zoomIn:_,zoomOut:N,fitView:j}=fr(),D=()=>{_(),c?.()},B=()=>{N(),u?.()},R=()=>{j(o),d?.()},U=()=>{E.setState({nodesDraggable:!A,nodesConnectable:!A,elementsSelectable:!A}),h?.(!A)},q=v==="horizontal"?"horizontal":"vertical";return b.jsxs(Tu,{className:wt(["react-flow__controls",q,p]),position:g,style:e,"data-testid":"rf__controls","aria-label":x??k["controls.ariaLabel"],children:[n&&b.jsxs(b.Fragment,{children:[b.jsx($c,{onClick:D,className:"react-flow__controls-zoomin",title:k["controls.zoomIn.ariaLabel"],"aria-label":k["controls.zoomIn.ariaLabel"],disabled:C,children:b.jsx(xM,{})}),b.jsx($c,{onClick:B,className:"react-flow__controls-zoomout",title:k["controls.zoomOut.ariaLabel"],"aria-label":k["controls.zoomOut.ariaLabel"],disabled:T,children:b.jsx(EM,{})})]}),s&&b.jsx($c,{className:"react-flow__controls-fitview",onClick:R,title:k["controls.fitView.ariaLabel"],"aria-label":k["controls.fitView.ariaLabel"],children:b.jsx(NM,{})}),a&&b.jsx($c,{className:"react-flow__controls-interactive",onClick:U,title:k["controls.interactive.ariaLabel"],"aria-label":k["controls.interactive.ariaLabel"],children:A?b.jsx(AM,{}):b.jsx(_M,{})}),y]})}J1.displayName="Controls";const CM=V.memo(J1);function MM({id:e,x:n,y:s,width:a,height:o,style:c,color:u,strokeColor:d,strokeWidth:h,className:p,borderRadius:y,shapeRendering:g,selected:v,onClick:x}){const{background:E,backgroundColor:A}=c||{},T=u||E||A;return b.jsx("rect",{className:wt(["react-flow__minimap-node",{selected:v},p]),x:n,y:s,rx:y,ry:y,width:a,height:o,style:{fill:T,stroke:d,strokeWidth:h},shapeRendering:g,onClick:x?C=>x(C,e):void 0})}const OM=V.memo(MM),kM=e=>e.nodes.map(n=>n.id),ph=e=>e instanceof Function?e:()=>e;function zM({nodeStrokeColor:e,nodeColor:n,nodeClassName:s="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:c=OM,onClick:u}){const d=Re(kM,nt),h=ph(n),p=ph(e),y=ph(s),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return b.jsx(b.Fragment,{children:d.map(v=>b.jsx(jM,{id:v,nodeColorFunc:h,nodeStrokeColorFunc:p,nodeClassNameFunc:y,nodeBorderRadius:a,nodeStrokeWidth:o,NodeComponent:c,onClick:u,shapeRendering:g},v))})}function DM({id:e,nodeColorFunc:n,nodeStrokeColorFunc:s,nodeClassNameFunc:a,nodeBorderRadius:o,nodeStrokeWidth:c,shapeRendering:u,NodeComponent:d,onClick:h}){const{node:p,x:y,y:g,width:v,height:x}=Re(E=>{const A=E.nodeLookup.get(e);if(!A)return{node:void 0,x:0,y:0,width:0,height:0};const T=A.internals.userNode,{x:C,y:k}=A.internals.positionAbsolute,{width:_,height:N}=ji(T);return{node:T,x:C,y:k,width:_,height:N}},nt);return!p||p.hidden||!Pb(p)?null:b.jsx(d,{x:y,y:g,width:v,height:x,style:p.style,selected:!!p.selected,className:a(p),color:n(p),borderRadius:o,strokeColor:s(p),strokeWidth:c,shapeRendering:u,onClick:h,id:p.id})}const jM=V.memo(DM);var RM=V.memo(zM);const BM=200,LM=150,$M=e=>!e.hidden,HM=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?Jb(cr(e.nodeLookup,{filter:$M}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},UM="react-flow__minimap-desc";function W1({style:e,className:n,nodeStrokeColor:s,nodeColor:a,nodeClassName:o="",nodeBorderRadius:c=5,nodeStrokeWidth:u,nodeComponent:d,bgColor:h,maskColor:p,maskStrokeColor:y,maskStrokeWidth:g,position:v="bottom-right",onClick:x,onNodeClick:E,pannable:A=!1,zoomable:T=!1,ariaLabel:C,inversePan:k,zoomStep:_=1,offsetScale:N=5}){const j=st(),D=V.useRef(null),{boundingRect:B,viewBB:R,rfId:U,panZoom:q,translateExtent:Y,flowWidth:Z,flowHeight:le,ariaLabelConfig:L}=Re(HM,nt),K=e?.width??BM,O=e?.height??LM,H=B.width/K,$=B.height/O,X=Math.max(H,$),se=X*K,w=X*O,z=N*X,F=B.x-(se-B.width)/2-z,P=B.y-(w-B.height)/2-z,fe=se+z*2,de=w+z*2,ie=`${UM}-${U}`,te=V.useRef(0),oe=V.useRef();te.current=X,V.useEffect(()=>{if(D.current&&q)return oe.current=JA({domNode:D.current,panZoom:q,getTransform:()=>j.getState().transform,getViewScale:()=>te.current}),()=>{oe.current?.destroy()}},[q]),V.useEffect(()=>{oe.current?.update({translateExtent:Y,width:Z,height:le,inversePan:k,pannable:A,zoomStep:_,zoomable:T})},[A,T,k,_,Y,Z,le]);const ve=x?ge=>{const[xe,Ce]=oe.current?.pointer(ge)||[0,0];x(ge,{x:xe,y:Ce})}:void 0,Se=E?V.useCallback((ge,xe)=>{const Ce=j.getState().nodeLookup.get(xe).internals.userNode;E(ge,Ce)},[]):void 0,me=C??L["minimap.ariaLabel"];return b.jsx(Tu,{position:v,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-color-props":typeof y=="string"?y:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*X:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:wt(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:b.jsxs("svg",{width:K,height:O,viewBox:`${F} ${P} ${fe} ${de}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ie,ref:D,onClick:ve,children:[me&&b.jsx("title",{id:ie,children:me}),b.jsx(RM,{onClick:Se,nodeColor:a,nodeStrokeColor:s,nodeBorderRadius:c,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:d}),b.jsx("path",{className:"react-flow__minimap-mask",d:`M${F-z},${P-z}h${fe+z*2}v${de+z*2}h${-fe-z*2}z
|
|
15
|
-
M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}W1.displayName="MiniMap";V.memo(W1);const IM=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,qM={[gl.Line]:"right",[gl.Handle]:"bottom-right"};function VM({nodeId:e,position:n,variant:s=gl.Handle,className:a,style:o=void 0,children:c,color:u,minWidth:d=10,minHeight:h=10,maxWidth:p=Number.MAX_VALUE,maxHeight:y=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:v,autoScale:x=!0,shouldResize:E,onResizeStart:A,onResize:T,onResizeEnd:C}){const k=M1(),_=typeof e=="string"?e:k,N=st(),j=V.useRef(null),D=s===gl.Handle,B=Re(V.useCallback(IM(D&&x),[D,x]),nt),R=V.useRef(null),U=n??qM[s];V.useEffect(()=>{if(!(!j.current||!_))return R.current||(R.current=uT({domNode:j.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:Y,transform:Z,snapGrid:le,snapToGrid:L,nodeOrigin:K,domNode:O}=N.getState();return{nodeLookup:Y,transform:Z,snapGrid:le,snapToGrid:L,nodeOrigin:K,paneDomNode:O}},onChange:(Y,Z)=>{const{triggerNodeChanges:le,nodeLookup:L,parentLookup:K,nodeOrigin:O}=N.getState(),H=[],$={x:Y.x,y:Y.y},X=L.get(_);if(X&&X.expandParent&&X.parentId){const se=X.origin??O,w=Y.width??X.measured.width??0,z=Y.height??X.measured.height??0,F={id:X.id,parentId:X.parentId,rect:{width:w,height:z,...e1({x:Y.x??X.position.x,y:Y.y??X.position.y},{width:w,height:z},X.parentId,L,se)}},P=ym([F],L,K,O);H.push(...P),$.x=Y.x?Math.max(se[0]*w,Y.x):void 0,$.y=Y.y?Math.max(se[1]*z,Y.y):void 0}if($.x!==void 0&&$.y!==void 0){const se={id:_,type:"position",position:{...$}};H.push(se)}if(Y.width!==void 0&&Y.height!==void 0){const w={id:_,type:"dimensions",resizing:!0,setAttributes:v?v==="horizontal"?"width":"height":!0,dimensions:{width:Y.width,height:Y.height}};H.push(w)}for(const se of Z){const w={...se,type:"position"};H.push(w)}le(H)},onEnd:({width:Y,height:Z})=>{const le={id:_,type:"dimensions",resizing:!1,dimensions:{width:Y,height:Z}};N.getState().triggerNodeChanges([le])}})),R.current.update({controlPosition:U,boundaries:{minWidth:d,minHeight:h,maxWidth:p,maxHeight:y},keepAspectRatio:g,resizeDirection:v,onResizeStart:A,onResize:T,onResizeEnd:C,shouldResize:E}),()=>{R.current?.destroy()}},[U,d,h,p,y,g,A,T,C,E]);const q=U.split("-");return b.jsx("div",{className:wt(["react-flow__resize-control","nodrag",...q,s,a]),ref:j,style:{...o,scale:B,...u&&{[D?"backgroundColor":"borderColor"]:u}},children:c})}V.memo(VM);const gh="emviz.viewerToken";let Ga;function YM(){const e=new URLSearchParams(window.location.hash.slice(1));if(e.has("token")){const n=e.get("token")??"";Ga=/^[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{Ga?window.sessionStorage.setItem(gh,Ga):window.sessionStorage.removeItem(gh)}catch{}window.history.replaceState(window.history.state,"",window.location.pathname+window.location.search)}if(!Ga)try{Ga=window.sessionStorage.getItem(gh)??void 0}catch{}return Ga}function Ho(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 a=new Headers(n.headers),o=YM();return o&&!a.has("X-Emviz-Token")&&a.set("X-Emviz-Token",o),fetch(s.href,{...n,headers:a,redirect:"error"})}function Bv(){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 Lv=3,GM=new Set(["command-event","event-query"]);function P1(e){return[...new Set(e)]}function eS(e){return e?.trim()?P1(e.split(/\r?\n/).map(n=>XM(n)).filter(n=>!!n)):[]}function XM(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 KM(e){const n=new Map(e.nodes.map(o=>[o.id,o])),s=new Map(e.nodes.map(o=>[o.id,eS(o.fields)])),a=new Map;for(const o of e.edges){if(!GM.has(o.kind))continue;const c=n.get(o.source),u=n.get(o.target);if(!$v(c)||!$v(u))continue;const d=s.get(o.source)??[],h=s.get(o.target)??[],p=new Set(h),y=d.filter(x=>p.has(x)),g=o.kind==="event-query"?QM(c,h,y):[],v=P1([...y,...g]);a.set(o.id,{sourceFieldNames:d,targetFieldNames:h,sharedFieldNames:y,derivedFieldNames:g,visibleFieldNames:v.slice(0,Lv),remainingCount:Math.max(0,v.length-Lv),sourceMissingFields:d.length===0,targetMissingFields:h.length===0})}return a}function ZM(e,n){if(!n)return;const s=[...e.entries()].filter(([,a])=>a.sharedFieldNames.includes(n)||a.derivedFieldNames.includes(n)).map(([a])=>a);return s.length>0?new Set(s):void 0}function $v(e){return e?.type==="command"||e?.type==="event"||e?.type==="query"}function QM(e,n,s){const a=Hv(e.label),o=new Set(s);return n.filter(c=>!o.has(c)&&Hv(c).includes(a))}function Hv(e){return e.replace(/^(has|is|was|were)/i,"").replace(/been/gi,"").replace(/[^A-Za-z0-9]/g,"").toLowerCase()}const Gn=e=>e.id??e.name,Wt=e=>e.storyId??e.storyName;function FM(e,n){if(!n)return e;const s=new Map(e.stories.map(g=>[Gn(g),g])),a=n.steps.flatMap(g=>{const v=s.get(g.storyId);return v?[v]:[]}),o=new Set(a.map(Gn)),c=new Map(a.flatMap(g=>g.slices.map(v=>[v,g]))),u=e.slices.filter(g=>c.has(g.path)).map(g=>{const v=c.get(g.path);return{...g,storyName:v.name,storyId:Gn(v)}}),d=g=>g.sourcePath??e.slices.find(v=>v.title===(g.sliceTitle??g.label))?.path,h=e.nodes.filter(g=>g.type!=="event"&&(g.type==="story"?o.has(g.storyId??g.label):c.has(d(g)??""))),p=new Set(h.map(g=>g.id));for(const g of e.edges)g.kind==="command-event"&&p.has(g.source)&&p.add(g.target),g.kind==="event-query"&&p.has(g.target)&&p.add(g.source);const y=e.nodes.filter(g=>p.has(g.id)).map(g=>{if(g.type==="story"||g.type==="event")return g;const v=c.get(d(g)??"");return v?{...g,storyName:v.name,storyId:Gn(v)}:g});return{...e,stories:a,slices:u,nodes:y,edges:e.edges.filter(g=>p.has(g.source)&&p.has(g.target))}}function JM(e){const n=new Map(e.steps.map(o=>[o.id,o])),s=new Map,a=new Set(n.keys());for(;a.size;){let o=!1;for(const c of a){const u=n.get(c);u.after.some(d=>n.has(d)&&!s.has(d))||(s.set(c,Math.max(0,...u.after.map(d=>(s.get(d)??-1)+1))),a.delete(c),o=!0)}if(!o){for(const c of a)s.set(c,0);break}}return new Map(e.steps.map(o=>[o.storyId,s.get(o.id)??0]))}function yh(e,n){return n?void 0:e}function en(e){return e.id??e.path}function WM(e,n=!1){const s=new Map,a=new Map,o=new Map,c=new Map,u=new Map(e.slices.map(y=>[y.path,y])),d=new Map(e.stories.map(y=>[en(y),y])),h=y=>{const g=y.storyId??(y.type==="story"?y.label:Wt(y)),v=e.stories.filter(E=>Gn(E)===g);if(y.storyId&&v.length===1)return v[0];const x=e.stories.filter(E=>E.path===y.sourcePath);return x.length===1?x[0]:v.length===1?v[0]:void 0};for(const y of e.slices){const g=y.storyId??y.storyName,v=e.stories.filter(E=>Gn(E)===g),x=v.find(E=>E.slices.includes(y.path))??(v.length===1?v[0]:void 0)??e.stories.find(E=>E.slices.includes(y.path));x&&c.set(y.path,en(x))}const p=y=>{if(y.sourcePath&&u.has(y.sourcePath))return y.sourcePath;const g=y.sliceTitle??(y.type==="slice"?y.label:void 0);if(!g)return;const v=Wt(y),x=e.slices.filter(E=>E.title===g&&(!v||(E.storyId??E.storyName)===v));return x.length===1?x[0].path:void 0};for(const y of e.nodes){if(y.type==="story"){const A=h(y);A&&(a.set(y.id,Gn(A)),o.set(y.id,en(A)));continue}if(y.type==="event")continue;const g=p(y);g&&s.set(y.id,g);const v=g?c.get(g):void 0,x=v?d.get(v):h(y),E=x?Gn(x):g?u.get(g)?.storyId??u.get(g)?.storyName:Wt(y);E&&a.set(y.id,E),x&&o.set(y.id,en(x))}for(const y of e.nodes){if(y.type!=="event")continue;const g=e.edges.find(A=>A.kind==="command-event"&&A.target===y.id),v=g?s.get(g.source):n?void 0:p(y);v&&s.set(y.id,v);const x=g?a.get(g.source):v?u.get(v)?.storyId??u.get(v)?.storyName:void 0,E=g?o.get(g.source):v?c.get(v):void 0;x&&a.set(y.id,x),E&&o.set(y.id,E)}return{sliceByNode:s,storyByNode:a,stableStoryByNode:o,stableStoryBySlice:c}}function PM(e,n,s,a){if(n==="all")return!0;const o=a.sliceByNode.get(e.source),c=a.sliceByNode.get(e.target);if(o&&o===c)return!0;if(n==="intra-slice"||!s)return!1;if(s.type==="slice"){const u=a.sliceByNode.get(s.id);return!!(u&&(o===u||c===u))}return e.source===s.id||e.target===s.id}function eO(e,n){const s=e.graphSidecar?.model?.id,a=e.root&&e.root!=="browser-import"?["root",e.root,s??null]:s&&s!=="browser_import"?["model",s]:["sources",...new Set(e.stories.map(o=>o.path).sort())];return"emviz:collapsed-stories:v1:"+encodeURIComponent(JSON.stringify([a,n??null]))}function tO(e,n,s){try{const a=(s??window.localStorage).getItem(e);if(!a)return new Set;const o=JSON.parse(a);return!Array.isArray(o)||o.some(c=>typeof c!="string")?new Set:new Set(o.filter(c=>!n||n.has(c)))}catch{return new Set}}function nO(e,n,s){try{return(s??window.localStorage).setItem(e,JSON.stringify([...n].sort())),!0}catch{return!1}}function iO(e,n){return"browser-import:"+JSON.stringify(e&&e!=="browser_import"?["model",e]:["session",n])}const bm=Symbol.for("yaml.alias"),qh=Symbol.for("yaml.document"),vs=Symbol.for("yaml.map"),tS=Symbol.for("yaml.pair"),li=Symbol.for("yaml.scalar"),xl=Symbol.for("yaml.seq"),On=Symbol.for("yaml.node.type"),Ps=e=>!!e&&typeof e=="object"&&e[On]===bm,ea=e=>!!e&&typeof e=="object"&&e[On]===qh,El=e=>!!e&&typeof e=="object"&&e[On]===vs,it=e=>!!e&&typeof e=="object"&&e[On]===tS,Qe=e=>!!e&&typeof e=="object"&&e[On]===li,Nl=e=>!!e&&typeof e=="object"&&e[On]===xl;function at(e){if(e&&typeof e=="object")switch(e[On]){case vs:case xl:return!0}return!1}function lt(e){if(e&&typeof e=="object")switch(e[On]){case bm:case vs:case li:case xl:return!0}return!1}const nS=e=>(Qe(e)||at(e))&&!!e.anchor,Jt=Symbol("break visit"),iS=Symbol("skip children"),ai=Symbol("remove node");function ta(e,n){const s=sS(n);ea(e)?Ja(null,e.contents,s,Object.freeze([e]))===ai&&(e.contents=null):Ja(null,e,s,Object.freeze([]))}ta.BREAK=Jt;ta.SKIP=iS;ta.REMOVE=ai;function Ja(e,n,s,a){const o=aS(e,n,s,a);if(lt(o)||it(o))return lS(e,a,o),Ja(e,o,s,a);if(typeof o!="symbol"){if(at(n)){a=Object.freeze(a.concat(n));for(let c=0;c<n.items.length;++c){const u=Ja(c,n.items[c],s,a);if(typeof u=="number")c=u-1;else{if(u===Jt)return Jt;u===ai&&(n.items.splice(c,1),c-=1)}}}else if(it(n)){a=Object.freeze(a.concat(n));const c=Ja("key",n.key,s,a);if(c===Jt)return Jt;c===ai&&(n.key=null);const u=Ja("value",n.value,s,a);if(u===Jt)return Jt;u===ai&&(n.value=null)}}return o}async function Mu(e,n){const s=sS(n);ea(e)?await Wa(null,e.contents,s,Object.freeze([e]))===ai&&(e.contents=null):await Wa(null,e,s,Object.freeze([]))}Mu.BREAK=Jt;Mu.SKIP=iS;Mu.REMOVE=ai;async function Wa(e,n,s,a){const o=await aS(e,n,s,a);if(lt(o)||it(o))return lS(e,a,o),Wa(e,o,s,a);if(typeof o!="symbol"){if(at(n)){a=Object.freeze(a.concat(n));for(let c=0;c<n.items.length;++c){const u=await Wa(c,n.items[c],s,a);if(typeof u=="number")c=u-1;else{if(u===Jt)return Jt;u===ai&&(n.items.splice(c,1),c-=1)}}}else if(it(n)){a=Object.freeze(a.concat(n));const c=await Wa("key",n.key,s,a);if(c===Jt)return Jt;c===ai&&(n.key=null);const u=await Wa("value",n.value,s,a);if(u===Jt)return Jt;u===ai&&(n.value=null)}}return o}function sS(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 aS(e,n,s,a){if(typeof s=="function")return s(e,n,a);if(El(n))return s.Map?.(e,n,a);if(Nl(n))return s.Seq?.(e,n,a);if(it(n))return s.Pair?.(e,n,a);if(Qe(n))return s.Scalar?.(e,n,a);if(Ps(n))return s.Alias?.(e,n,a)}function lS(e,n,s){const a=n[n.length-1];if(at(a))a.items[e]=s;else if(it(a))e==="key"?a.key=s:a.value=s;else if(ea(a))a.contents=s;else{const o=Ps(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${o} parent`)}}const sO={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},aO=e=>e.replace(/[!,[\]{}]/g,n=>sO[n]);class Ht{constructor(n,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Ht.defaultYaml,n),this.tags=Object.assign({},Ht.defaultTags,s)}clone(){const n=new Ht(this.yaml,this.tags);return n.docStart=this.docStart,n}atDocument(){const n=new Ht(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Ht.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Ht.defaultTags);break}return n}add(n,s){this.atNextDocument&&(this.yaml={explicit:Ht.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Ht.defaultTags),this.atNextDocument=!1);const a=n.trim().split(/[ \t]+/),o=a.shift();switch(o){case"%TAG":{if(a.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),a.length<2))return!1;const[c,u]=a;return this.tags[c]=u,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;const[c]=a;if(c==="1.1"||c==="1.2")return this.yaml.version=c,!0;{const u=/^\d+\.\d+$/.test(c);return s(6,`Unsupported YAML version ${c}`,u),!1}}default:return s(0,`Unknown directive ${o}`,!0),!1}}tagName(n,s){if(n==="!")return"!";if(n[0]!=="!")return s(`Not a valid tag: ${n}`),null;if(n[1]==="<"){const u=n.slice(2,-1);return u==="!"||u==="!!"?(s(`Verbatim tags aren't resolved, so ${n} is invalid.`),null):(n[n.length-1]!==">"&&s("Verbatim tags must end with a >"),u)}const[,a,o]=n.match(/^(.*!)([^!]*)$/s);o||s(`The ${n} tag has no suffix`);const c=this.tags[a];if(c)try{return c+decodeURIComponent(o)}catch(u){return s(String(u)),null}return a==="!"?n:(s(`Could not resolve tag: ${n}`),null)}tagString(n){for(const[s,a]of Object.entries(this.tags))if(n.startsWith(a))return s+aO(n.substring(a.length));return n[0]==="!"?n:`!<${n}>`}toString(n){const s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let o;if(n&&a.length>0&<(n.contents)){const c={};ta(n.contents,(u,d)=>{lt(d)&&d.tag&&(c[d.tag]=!0)}),o=Object.keys(c)}else o=[];for(const[c,u]of a)c==="!!"&&u==="tag:yaml.org,2002:"||(!n||o.some(d=>d.startsWith(u)))&&s.push(`%TAG ${c} ${u}`);return s.join(`
|
|
16
|
-
`)}}Ht.defaultYaml={explicit:!1,version:"1.2"};Ht.defaultTags={"!!":"tag:yaml.org,2002:"};function oS(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 rS(e){const n=new Set;return ta(e,{Value(s,a){a.anchor&&n.add(a.anchor)}}),n}function cS(e,n){for(let s=1;;++s){const a=`${e}${s}`;if(!n.has(a))return a}}function lO(e,n){const s=[],a=new Map;let o=null;return{onAnchor:c=>{s.push(c),o??(o=rS(e));const u=cS(n,o);return o.add(u),u},setAnchors:()=>{for(const c of s){const u=a.get(c);if(typeof u=="object"&&u.anchor&&(Qe(u.node)||at(u.node)))u.node.anchor=u.anchor;else{const d=new Error("Failed to resolve repeated object (this should not happen)");throw d.source=c,d}}},sourceObjects:a}}function Pa(e,n,s,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let o=0,c=a.length;o<c;++o){const u=a[o],d=Pa(e,a,String(o),u);d===void 0?delete a[o]:d!==u&&(a[o]=d)}else if(a instanceof Map)for(const o of Array.from(a.keys())){const c=a.get(o),u=Pa(e,a,o,c);u===void 0?a.delete(o):u!==c&&a.set(o,u)}else if(a instanceof Set)for(const o of Array.from(a)){const c=Pa(e,a,o,o);c===void 0?a.delete(o):c!==o&&(a.delete(o),a.add(c))}else for(const[o,c]of Object.entries(a)){const u=Pa(e,a,o,c);u===void 0?delete a[o]:u!==c&&(a[o]=u)}return e.call(n,s,a)}function Mn(e,n,s){if(Array.isArray(e))return e.map((a,o)=>Mn(a,String(o),s));if(e&&typeof e.toJSON=="function"){if(!s||!nS(e))return e.toJSON(n,s);const a={aliasCount:0,count:1,res:void 0};s.anchors.set(e,a),s.onCreate=c=>{a.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 Sm{constructor(n){Object.defineProperty(this,On,{value:n})}clone(){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(n.range=this.range.slice()),n}toJS(n,{mapAsMap:s,maxAliasCount:a,onAnchor:o,reviver:c}={}){if(!ea(n))throw new TypeError("A document argument is required");const u={anchors:new Map,doc:n,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},d=Mn(this,"",u);if(typeof o=="function")for(const{count:h,res:p}of u.anchors.values())o(p,h);return typeof c=="function"?Pa(c,{"":d},"",d):d}}class Ou extends Sm{constructor(n){super(bm),this.source=n,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(n,s){if(s?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let a;s?.aliasResolveCache?a=s.aliasResolveCache:(a=[],ta(n,{Node:(c,u)=>{(Ps(u)||nS(u))&&a.push(u)}}),s&&(s.aliasResolveCache=a));let o;for(const c of a){if(c===this)break;c.anchor===this.source&&(o=c)}return o}toJSON(n,s){if(!s)return{source:this.source};const{anchors:a,doc:o,maxAliasCount:c}=s,u=this.resolve(o,s);if(!u){const h=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(h)}let d=a.get(u);if(d||(Mn(u,null,s),d=a.get(u)),d?.res===void 0){const h="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(h)}if(c>=0&&(d.count+=1,d.aliasCount===0&&(d.aliasCount=Fc(o,u,a)),d.count*d.aliasCount>c)){const h="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(h)}return d.res}toString(n,s,a){const o=`*${this.source}`;if(n){if(oS(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 Fc(e,n,s){if(Ps(n)){const a=n.resolve(e),o=s&&a&&s.get(a);return o?o.count*o.aliasCount:0}else if(at(n)){let a=0;for(const o of n.items){const c=Fc(e,o,s);c>a&&(a=c)}return a}else if(it(n)){const a=Fc(e,n.key,s),o=Fc(e,n.value,s);return Math.max(a,o)}return 1}const uS=e=>!e||typeof e!="function"&&typeof e!="object";class Ae extends Sm{constructor(n){super(li),this.value=n}toJSON(n,s){return s?.keep?this.value:Mn(this.value,n,s)}toString(){return String(this.value)}}Ae.BLOCK_FOLDED="BLOCK_FOLDED";Ae.BLOCK_LITERAL="BLOCK_LITERAL";Ae.PLAIN="PLAIN";Ae.QUOTE_DOUBLE="QUOTE_DOUBLE";Ae.QUOTE_SINGLE="QUOTE_SINGLE";const oO="tag:yaml.org,2002:";function rO(e,n,s){if(n){const a=s.filter(c=>c.tag===n),o=a.find(c=>!c.format)??a[0];if(!o)throw new Error(`Tag ${n} not found`);return o}return s.find(a=>a.identify?.(e)&&!a.format)}function Po(e,n,s){if(ea(e)&&(e=e.contents),lt(e))return e;if(it(e)){const g=s.schema[vs].createNode?.(s.schema,null,s);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:a,onAnchor:o,onTagObj:c,schema:u,sourceObjects:d}=s;let h;if(a&&e&&typeof e=="object"){if(h=d.get(e),h)return h.anchor??(h.anchor=o(e)),new Ou(h.anchor);h={anchor:null,node:null},d.set(e,h)}n?.startsWith("!!")&&(n=oO+n.slice(2));let p=rO(e,n,u.tags);if(!p){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new Ae(e);return h&&(h.node=g),g}p=e instanceof Map?u[vs]:Symbol.iterator in Object(e)?u[xl]:u[vs]}c&&(c(p),delete s.onTagObj);const y=p?.createNode?p.createNode(s.schema,e,s):typeof p?.nodeClass?.from=="function"?p.nodeClass.from(s.schema,e,s):new Ae(e);return n?y.tag=n:p.default||(y.tag=p.tag),h&&(h.node=y),y}function du(e,n,s){let a=s;for(let o=n.length-1;o>=0;--o){const c=n[o];if(typeof c=="number"&&Number.isInteger(c)&&c>=0){const u=[];u[c]=a,a=u}else a=new Map([[c,a]])}return Po(a,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const jo=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class fS extends Sm{constructor(n,s){super(n),Object.defineProperty(this,"schema",{value:s,configurable:!0,enumerable:!1,writable:!0})}clone(n){const s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return n&&(s.schema=n),s.items=s.items.map(a=>lt(a)||it(a)?a.clone(n):a),this.range&&(s.range=this.range.slice()),s}addIn(n,s){if(jo(n))this.add(s);else{const[a,...o]=n,c=this.get(a,!0);if(at(c))c.addIn(o,s);else if(c===void 0&&this.schema)this.set(a,du(this.schema,o,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${o}`)}}deleteIn(n){const[s,...a]=n;if(a.length===0)return this.delete(s);const o=this.get(s,!0);if(at(o))return o.deleteIn(a);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${a}`)}getIn(n,s){const[a,...o]=n,c=this.get(a,!0);return o.length===0?!s&&Qe(c)?c.value:c:at(c)?c.getIn(o,s):void 0}hasAllNullValues(n){return this.items.every(s=>{if(!it(s))return!1;const a=s.value;return a==null||n&&Qe(a)&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn(n){const[s,...a]=n;if(a.length===0)return this.has(s);const o=this.get(s,!0);return at(o)?o.hasIn(a):!1}setIn(n,s){const[a,...o]=n;if(o.length===0)this.set(a,s);else{const c=this.get(a,!0);if(at(c))c.setIn(o,s);else if(c===void 0&&this.schema)this.set(a,du(this.schema,o,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${o}`)}}}const cO=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ki(e,n){return/^\n+$/.test(e)?e.substring(1):n?e.replace(/^(?! *$)/gm,n):e}const Is=(e,n,s)=>e.endsWith(`
|
|
17
|
-
`)?ki(s,n):s.includes(`
|
|
18
|
-
`)?`
|
|
19
|
-
`+ki(s,n):(e.endsWith(" ")?"":" ")+s,dS="flow",Vh="block",Jc="quoted";function ku(e,n,s="flow",{indentAtStart:a,lineWidth:o=80,minContentWidth:c=20,onFold:u,onOverflow:d}={}){if(!o||o<0)return e;o<c&&(c=0);const h=Math.max(1+c,1+o-n.length);if(e.length<=h)return e;const p=[],y={};let g=o-n.length;typeof a=="number"&&(a>o-Math.max(2,c)?p.push(0):g=o-a);let v,x,E=!1,A=-1,T=-1,C=-1;s===Vh&&(A=Uv(e,A,n.length),A!==-1&&(g=A+h));for(let _;_=e[A+=1];){if(s===Jc&&_==="\\"){switch(T=A,e[A+1]){case"x":A+=3;break;case"u":A+=5;break;case"U":A+=9;break;default:A+=1}C=A}if(_===`
|
|
20
|
-
`)s===Vh&&(A=Uv(e,A,n.length)),g=A+n.length+h,v=void 0;else{if(_===" "&&x&&x!==" "&&x!==`
|
|
21
|
-
`&&x!==" "){const N=e[A+1];N&&N!==" "&&N!==`
|
|
22
|
-
`&&N!==" "&&(v=A)}if(A>=g)if(v)p.push(v),g=v+h,v=void 0;else if(s===Jc){for(;x===" "||x===" ";)x=_,_=e[A+=1],E=!0;const N=A>C+1?A-2:T-1;if(y[N])return e;p.push(N),y[N]=!0,g=N+h,v=void 0}else E=!0}x=_}if(E&&d&&d(),p.length===0)return e;u&&u();let k=e.slice(0,p[0]);for(let _=0;_<p.length;++_){const N=p[_],j=p[_+1]||e.length;N===0?k=`
|
|
23
|
-
${n}${e.slice(0,j)}`:(s===Jc&&y[N]&&(k+=`${e[N]}\\`),k+=`
|
|
24
|
-
${n}${e.slice(N+1,j)}`)}return k}function Uv(e,n,s){let a=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
|
-
`);a=n,o=n+1,c=e[o]}return a}const zu=(e,n)=>({indentAtStart:n?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Du=e=>/^(%|---|\.\.\.)/m.test(e);function uO(e,n,s){if(!n||n<0)return!1;const a=n-s,o=e.length;if(o<=a)return!1;for(let c=0,u=0;c<o;++c)if(e[c]===`
|
|
26
|
-
`){if(c-u>a)return!0;if(u=c+1,o-u<=a)return!1}return!0}function Uo(e,n){const s=JSON.stringify(e);if(n.options.doubleQuotedAsJSON)return s;const{implicitKey:a}=n,o=n.options.doubleQuotedMinMultiLineLength,c=n.indent||(Du(e)?" ":"");let u="",d=0;for(let h=0,p=s[h];p;p=s[++h])if(p===" "&&s[h+1]==="\\"&&s[h+2]==="n"&&(u+=s.slice(d,h)+"\\ ",h+=1,d=h,p="\\"),p==="\\")switch(s[h+1]){case"u":{u+=s.slice(d,h);const y=s.substr(h+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(h,6)}h+=5,d=h+1}break;case"n":if(a||s[h+2]==='"'||s.length<o)h+=1;else{for(u+=s.slice(d,h)+`
|
|
27
|
-
|
|
28
|
-
`;s[h+2]==="\\"&&s[h+3]==="n"&&s[h+4]!=='"';)u+=`
|
|
29
|
-
`,h+=2;u+=c,s[h+2]===" "&&(u+="\\"),h+=1,d=h+1}break;default:h+=1}return u=d?u+s.slice(d):s,a?u:ku(u,c,Jc,zu(n,!1))}function Yh(e,n){if(n.options.singleQuote===!1||n.implicitKey&&e.includes(`
|
|
30
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return Uo(e,n);const s=n.indent||(Du(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
31
|
-
${s}`)+"'";return n.implicitKey?a:ku(a,s,dS,zu(n,!1))}function el(e,n){const{singleQuote:s}=n.options;let a;if(s===!1)a=Uo;else{const o=e.includes('"'),c=e.includes("'");o&&!c?a=Yh:c&&!o?a=Uo:a=s?Yh:Uo}return a(e,n)}let Gh;try{Gh=new RegExp(`(^|(?<!
|
|
32
|
-
))
|
|
33
|
-
+(?!
|
|
34
|
-
|$)`,"g")}catch{Gh=/\n+(?!\n|$)/g}function Wc({comment:e,type:n,value:s},a,o,c){const{blockQuote:u,commentString:d,lineWidth:h}=a.options;if(!u||/\n[\t ]+$/.test(s))return el(s,a);const p=a.indent||(a.forceBlockIndent||Du(s)?" ":""),y=u==="literal"?!0:u==="folded"||n===Ae.BLOCK_FOLDED?!1:n===Ae.BLOCK_LITERAL?!0:!uO(s,h,p.length);if(!s)return y?`|
|
|
35
|
-
`:`>
|
|
36
|
-
`;let g,v;for(v=s.length;v>0;--v){const j=s[v-1];if(j!==`
|
|
37
|
-
`&&j!==" "&&j!==" ")break}let x=s.substring(v);const E=x.indexOf(`
|
|
38
|
-
`);E===-1?g="-":s===x||E!==x.length-1?(g="+",c&&c()):g="",x&&(s=s.slice(0,-x.length),x[x.length-1]===`
|
|
39
|
-
`&&(x=x.slice(0,-1)),x=x.replace(Gh,`$&${p}`));let A=!1,T,C=-1;for(T=0;T<s.length;++T){const j=s[T];if(j===" ")A=!0;else if(j===`
|
|
40
|
-
`)C=T;else break}let k=s.substring(0,C<T?C+1:T);k&&(s=s.substring(k.length),k=k.replace(/\n+/g,`$&${p}`));let N=(A?p?"2":"1":"")+g;if(e&&(N+=" "+d(e.replace(/ ?[\r\n]+/g," ")),o&&o()),!y){const j=s.replace(/\n+/g,`
|
|
41
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${p}`);let D=!1;const B=zu(a,!0);u!=="folded"&&n!==Ae.BLOCK_FOLDED&&(B.onOverflow=()=>{D=!0});const R=ku(`${k}${j}${x}`,p,Vh,B);if(!D)return`>${N}
|
|
42
|
-
${p}${R}`}return s=s.replace(/\n+/g,`$&${p}`),`|${N}
|
|
43
|
-
${p}${k}${s}${x}`}function fO(e,n,s,a){const{type:o,value:c}=e,{actualString:u,implicitKey:d,indent:h,indentStep:p,inFlow:y}=n;if(d&&c.includes(`
|
|
44
|
-
`)||y&&/[[\]{},]/.test(c))return el(c,n);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return d||y||!c.includes(`
|
|
45
|
-
`)?el(c,n):Wc(e,n,s,a);if(!d&&!y&&o!==Ae.PLAIN&&c.includes(`
|
|
46
|
-
`))return Wc(e,n,s,a);if(Du(c)){if(h==="")return n.forceBlockIndent=!0,Wc(e,n,s,a);if(d&&h===p)return el(c,n)}const g=c.replace(/\n+/g,`$&
|
|
47
|
-
${h}`);if(u){const v=A=>A.default&&A.tag!=="tag:yaml.org,2002:str"&&A.test?.test(g),{compat:x,tags:E}=n.doc.schema;if(E.some(v)||x?.some(v))return el(c,n)}return d?g:ku(g,h,dS,zu(n,!1))}function hr(e,n,s,a){const{implicitKey:o,inFlow:c}=n,u=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:d}=e;d!==Ae.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(u.value)&&(d=Ae.QUOTE_DOUBLE);const h=y=>{switch(y){case Ae.BLOCK_FOLDED:case Ae.BLOCK_LITERAL:return o||c?el(u.value,n):Wc(u,n,s,a);case Ae.QUOTE_DOUBLE:return Uo(u.value,n);case Ae.QUOTE_SINGLE:return Yh(u.value,n);case Ae.PLAIN:return fO(u,n,s,a);default:return null}};let p=h(d);if(p===null){const{defaultKeyType:y,defaultStringType:g}=n.options,v=o&&y||g;if(p=h(v),p===null)throw new Error(`Unsupported default string type ${v}`)}return p}function hS(e,n){const s=Object.assign({blockQuote:!0,commentString:cO,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 a;switch(s.collectionStyle){case"block":a=!1;break;case"flow":a=!0;break;default:a=null}return{anchors:new Set,doc:e,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent=="number"?" ".repeat(s.indent):" ",inFlow:a,options:s}}function dO(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,a;if(Qe(n)){a=n.value;let o=e.filter(c=>c.identify?.(a));if(o.length>1){const c=o.filter(u=>u.test);c.length>0&&(o=c)}s=o.find(c=>c.format===n.format)??o.find(c=>!c.format)}else a=n,s=e.find(o=>o.nodeClass&&a instanceof o.nodeClass);if(!s){const o=a?.constructor?.name??(a===null?"null":typeof a);throw new Error(`Tag not resolved for ${o} value`)}return s}function hO(e,n,{anchors:s,doc:a}){if(!a.directives)return"";const o=[],c=(Qe(e)||at(e))&&e.anchor;c&&oS(c)&&(s.add(c),o.push(`&${c}`));const u=e.tag??(n.default?null:n.tag);return u&&o.push(a.directives.tagString(u)),o.join(" ")}function yl(e,n,s,a){if(it(e))return e.toString(n,s,a);if(Ps(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=lt(e)?e:n.doc.createNode(e,{onTagObj:h=>o=h});o??(o=dO(n.doc.schema.tags,c));const u=hO(c,o,n);u.length>0&&(n.indentAtStart=(n.indentAtStart??0)+u.length+1);const d=typeof o.stringify=="function"?o.stringify(c,n,s,a):Qe(c)?hr(c,n,s,a):c.toString(n,s,a);return u?Qe(c)||d[0]==="{"||d[0]==="["?`${u} ${d}`:`${u}
|
|
48
|
-
${n.indent}${d}`:d}function mO({key:e,value:n},s,a,o){const{allNullValues:c,doc:u,indent:d,indentStep:h,options:{commentString:p,indentSeq:y,simpleKeys:g}}=s;let v=lt(e)&&e.comment||null;if(g){if(v)throw new Error("With simple keys, key nodes cannot have comments");if(at(e)||!lt(e)&&typeof e=="object"){const B="With simple keys, collection cannot be used as a key value";throw new Error(B)}}let x=!g&&(!e||v&&n==null&&!s.inFlow||at(e)||(Qe(e)?e.type===Ae.BLOCK_FOLDED||e.type===Ae.BLOCK_LITERAL:typeof e=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!x&&(g||!c),indent:d+h});let E=!1,A=!1,T=yl(e,s,()=>E=!0,()=>A=!0);if(!x&&!s.inFlow&&T.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");x=!0}if(s.inFlow){if(c||n==null)return E&&a&&a(),T===""?"?":x?`? ${T}`:T}else if(c&&!g||n==null&&x)return T=`? ${T}`,v&&!E?T+=Is(T,s.indent,p(v)):A&&o&&o(),T;E&&(v=null),x?(v&&(T+=Is(T,s.indent,p(v))),T=`? ${T}
|
|
49
|
-
${d}:`):(T=`${T}:`,v&&(T+=Is(T,s.indent,p(v))));let C,k,_;lt(n)?(C=!!n.spaceBefore,k=n.commentBefore,_=n.comment):(C=!1,k=null,_=null,n&&typeof n=="object"&&(n=u.createNode(n))),s.implicitKey=!1,!x&&!v&&Qe(n)&&(s.indentAtStart=T.length+1),A=!1,!y&&h.length>=2&&!s.inFlow&&!x&&Nl(n)&&!n.flow&&!n.tag&&!n.anchor&&(s.indent=s.indent.substring(2));let N=!1;const j=yl(n,s,()=>N=!0,()=>A=!0);let D=" ";if(v||C||k){if(D=C?`
|
|
50
|
-
`:"",k){const B=p(k);D+=`
|
|
51
|
-
${ki(B,s.indent)}`}j===""&&!s.inFlow?D===`
|
|
52
|
-
`&&_&&(D=`
|
|
53
|
-
|
|
54
|
-
`):D+=`
|
|
55
|
-
${s.indent}`}else if(!x&&at(n)){const B=j[0],R=j.indexOf(`
|
|
56
|
-
`),U=R!==-1,q=s.inFlow??n.flow??n.items.length===0;if(U||!q){let Y=!1;if(U&&(B==="&"||B==="!")){let Z=j.indexOf(" ");B==="&"&&Z!==-1&&Z<R&&j[Z+1]==="!"&&(Z=j.indexOf(" ",Z+1)),(Z===-1||R<Z)&&(Y=!0)}Y||(D=`
|
|
57
|
-
${s.indent}`)}}else(j===""||j[0]===`
|
|
58
|
-
`)&&(D="");return T+=D+j,s.inFlow?N&&a&&a():_&&!N?T+=Is(T,s.indent,p(_)):A&&o&&o(),T}function mS(e,n){(e==="debug"||e==="warn")&&console.warn(n)}const Hc="<<",zi={identify:e=>e===Hc||typeof e=="symbol"&&e.description===Hc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ae(Symbol(Hc)),{addToJSMap:pS}),stringify:()=>Hc},pO=(e,n)=>(zi.identify(n)||Qe(n)&&(!n.type||n.type===Ae.PLAIN)&&zi.identify(n.value))&&e?.doc.schema.tags.some(s=>s.tag===zi.tag&&s.default);function pS(e,n,s){const a=gS(e,s);if(Nl(a))for(const o of a.items)vh(e,n,o);else if(Array.isArray(a))for(const o of a)vh(e,n,o);else vh(e,n,a)}function vh(e,n,s){const a=gS(e,s);if(!El(a))throw new Error("Merge sources must be maps or map aliases");const o=a.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 gS(e,n){return e&&Ps(n)?n.resolve(e.doc,e):n}function yS(e,n,{key:s,value:a}){if(lt(s)&&s.addToJSMap)s.addToJSMap(e,n,a);else if(pO(e,s))pS(e,n,a);else{const o=Mn(s,"",e);if(n instanceof Map)n.set(o,Mn(a,o,e));else if(n instanceof Set)n.add(o);else{const c=gO(s,o,e),u=Mn(a,c,e);c in n?Object.defineProperty(n,c,{value:u,writable:!0,enumerable:!0,configurable:!0}):n[c]=u}}return n}function gO(e,n,s){if(n===null)return"";if(typeof n!="object")return String(n);if(lt(e)&&s?.doc){const a=hS(s.doc,{});a.anchors=new Set;for(const c of s.anchors.keys())a.anchors.add(c.anchor);a.inFlow=!0,a.inStringifyKey=!0;const o=e.toString(a);if(!s.mapKeyWarned){let c=JSON.stringify(o);c.length>40&&(c=c.substring(0,36)+'..."'),mS(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 wm(e,n,s){const a=Po(e,void 0,s),o=Po(n,void 0,s);return new Bt(a,o)}class Bt{constructor(n,s=null){Object.defineProperty(this,On,{value:tS}),this.key=n,this.value=s}clone(n){let{key:s,value:a}=this;return lt(s)&&(s=s.clone(n)),lt(a)&&(a=a.clone(n)),new Bt(s,a)}toJSON(n,s){const a=s?.mapAsMap?new Map:{};return yS(s,a,this)}toString(n,s,a){return n?.doc?mO(this,n,s,a):JSON.stringify(this)}}function vS(e,n,s){return(n.inFlow??e.flow?vO:yO)(e,n,s)}function yO({comment:e,items:n},s,{blockItemPrefix:a,flowChars:o,itemIndent:c,onChompKeep:u,onComment:d}){const{indent:h,options:{commentString:p}}=s,y=Object.assign({},s,{indent:c,type:null});let g=!1;const v=[];for(let E=0;E<n.length;++E){const A=n[E];let T=null;if(lt(A))!g&&A.spaceBefore&&v.push(""),hu(s,v,A.commentBefore,g),A.comment&&(T=A.comment);else if(it(A)){const k=lt(A.key)?A.key:null;k&&(!g&&k.spaceBefore&&v.push(""),hu(s,v,k.commentBefore,g))}g=!1;let C=yl(A,y,()=>T=null,()=>g=!0);T&&(C+=Is(C,c,p(T))),g&&T&&(g=!1),v.push(a+C)}let x;if(v.length===0)x=o.start+o.end;else{x=v[0];for(let E=1;E<v.length;++E){const A=v[E];x+=A?`
|
|
59
|
-
${h}${A}`:`
|
|
60
|
-
`}}return e?(x+=`
|
|
61
|
-
`+ki(p(e),h),d&&d()):g&&u&&u(),x}function vO({items:e},n,{flowChars:s,itemIndent:a}){const{indent:o,indentStep:c,flowCollectionPadding:u,options:{commentString:d}}=n;a+=c;const h=Object.assign({},n,{indent:a,inFlow:!0,type:null});let p=!1,y=0;const g=[];for(let E=0;E<e.length;++E){const A=e[E];let T=null;if(lt(A))A.spaceBefore&&g.push(""),hu(n,g,A.commentBefore,!1),A.comment&&(T=A.comment);else if(it(A)){const k=lt(A.key)?A.key:null;k&&(k.spaceBefore&&g.push(""),hu(n,g,k.commentBefore,!1),k.comment&&(p=!0));const _=lt(A.value)?A.value:null;_?(_.comment&&(T=_.comment),_.commentBefore&&(p=!0)):A.value==null&&k?.comment&&(T=k.comment)}T&&(p=!0);let C=yl(A,h,()=>T=null);p||(p=g.length>y||C.includes(`
|
|
62
|
-
`)),E<e.length-1?C+=",":n.options.trailingComma&&(n.options.lineWidth>0&&(p||(p=g.reduce((k,_)=>k+_.length+2,2)+(C.length+2)>n.options.lineWidth)),p&&(C+=",")),T&&(C+=Is(C,a,d(T))),g.push(C),y=g.length}const{start:v,end:x}=s;if(g.length===0)return v+x;if(!p){const E=g.reduce((A,T)=>A+T.length+2,2);p=n.options.lineWidth>0&&E>n.options.lineWidth}if(p){let E=v;for(const A of g)E+=A?`
|
|
63
|
-
${c}${o}${A}`:`
|
|
64
|
-
`;return`${E}
|
|
65
|
-
${o}${x}`}else return`${v}${u}${g.join(" ")}${u}${x}`}function hu({indent:e,options:{commentString:n}},s,a,o){if(a&&o&&(a=a.replace(/^\n+/,"")),a){const c=ki(n(a),e);s.push(c.trimStart())}}function qs(e,n){const s=Qe(n)?n.value:n;for(const a of e)if(it(a)&&(a.key===n||a.key===s||Qe(a.key)&&a.key.value===s))return a}class fn extends fS{static get tagName(){return"tag:yaml.org,2002:map"}constructor(n){super(vs,n),this.items=[]}static from(n,s,a){const{keepUndefined:o,replacer:c}=a,u=new this(n),d=(h,p)=>{if(typeof c=="function")p=c.call(s,h,p);else if(Array.isArray(c)&&!c.includes(h))return;(p!==void 0||o)&&u.items.push(wm(h,p,a))};if(s instanceof Map)for(const[h,p]of s)d(h,p);else if(s&&typeof s=="object")for(const h of Object.keys(s))d(h,s[h]);return typeof n.sortMapEntries=="function"&&u.items.sort(n.sortMapEntries),u}add(n,s){let a;it(n)?a=n:!n||typeof n!="object"||!("key"in n)?a=new Bt(n,n?.value):a=new Bt(n.key,n.value);const o=qs(this.items,a.key),c=this.schema?.sortMapEntries;if(o){if(!s)throw new Error(`Key ${a.key} already set`);Qe(o.value)&&uS(a.value)?o.value.value=a.value:o.value=a.value}else if(c){const u=this.items.findIndex(d=>c(a,d)<0);u===-1?this.items.push(a):this.items.splice(u,0,a)}else this.items.push(a)}delete(n){const s=qs(this.items,n);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(n,s){const o=qs(this.items,n)?.value;return(!s&&Qe(o)?o.value:o)??void 0}has(n){return!!qs(this.items,n)}set(n,s){this.add(new Bt(n,s),!0)}toJSON(n,s,a){const o=a?new a:s?.mapAsMap?new Map:{};s?.onCreate&&s.onCreate(o);for(const c of this.items)yS(s,o,c);return o}toString(n,s,a){if(!n)return JSON.stringify(this);for(const o of this.items)if(!it(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})),vS(this,n,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:n.indent||"",onChompKeep:a,onComment:s})}}const _l={collection:"map",default:!0,nodeClass:fn,tag:"tag:yaml.org,2002:map",resolve(e,n){return El(e)||n("Expected a mapping for this tag"),e},createNode:(e,n,s)=>fn.from(e,n,s)};class bs extends fS{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(n){super(xl,n),this.items=[]}add(n){this.items.push(n)}delete(n){const s=Uc(n);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(n,s){const a=Uc(n);if(typeof a!="number")return;const o=this.items[a];return!s&&Qe(o)?o.value:o}has(n){const s=Uc(n);return typeof s=="number"&&s<this.items.length}set(n,s){const a=Uc(n);if(typeof a!="number")throw new Error(`Expected a valid index, not ${n}.`);const o=this.items[a];Qe(o)&&uS(s)?o.value=s:this.items[a]=s}toJSON(n,s){const a=[];s?.onCreate&&s.onCreate(a);let o=0;for(const c of this.items)a.push(Mn(c,String(o++),s));return a}toString(n,s,a){return n?vS(this,n,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(n.indent||"")+" ",onChompKeep:a,onComment:s}):JSON.stringify(this)}static from(n,s,a){const{replacer:o}=a,c=new this(n);if(s&&Symbol.iterator in Object(s)){let u=0;for(let d of s){if(typeof o=="function"){const h=s instanceof Set?d:String(u++);d=o.call(s,h,d)}c.items.push(Po(d,void 0,a))}}return c}}function Uc(e){let n=Qe(e)?e.value:e;return n&&typeof n=="string"&&(n=Number(n)),typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}const Al={collection:"seq",default:!0,nodeClass:bs,tag:"tag:yaml.org,2002:seq",resolve(e,n){return Nl(e)||n("Expected a sequence for this tag"),e},createNode:(e,n,s)=>bs.from(e,n,s)},ju={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,n,s,a){return n=Object.assign({actualString:!0},n),hr(e,n,s,a)}},Ru={identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ae(null),stringify:({source:e},n)=>typeof e=="string"&&Ru.test.test(e)?e:n.options.nullStr},xm={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Ae(e[0]==="t"||e[0]==="T"),stringify({source:e,value:n},s){if(e&&xm.test.test(e)){const a=e[0]==="t"||e[0]==="T";if(n===a)return e}return n?s.options.trueStr:s.options.falseStr}};function Zn({format:e,minFractionDigits:n,tag:s,value:a}){if(typeof a=="bigint")return String(a);const o=typeof a=="number"?a:Number(a);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let c=Object.is(a,-0)?"-0":JSON.stringify(a);if(!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 d=n-(c.length-u-1);for(;d-- >0;)c+="0"}return c}const bS={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:Zn},SS={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():Zn(e)}},wS={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 Ae(parseFloat(e)),s=e.indexOf(".");return s!==-1&&e[e.length-1]==="0"&&(n.minFractionDigits=e.length-s-1),n},stringify:Zn},Bu=e=>typeof e=="bigint"||Number.isInteger(e),Em=(e,n,s,{intAsBigInt:a})=>a?BigInt(e):parseInt(e.substring(n),s);function xS(e,n,s){const{value:a}=e;return Bu(a)&&a>=0?s+a.toString(n):Zn(e)}const ES={identify:e=>Bu(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,n,s)=>Em(e,2,8,s),stringify:e=>xS(e,8,"0o")},NS={identify:Bu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,n,s)=>Em(e,0,10,s),stringify:Zn},_S={identify:e=>Bu(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,n,s)=>Em(e,2,16,s),stringify:e=>xS(e,16,"0x")},bO=[_l,Al,ju,Ru,xm,ES,NS,_S,bS,SS,wS];function Iv(e){return typeof e=="bigint"||Number.isInteger(e)}const Ic=({value:e})=>JSON.stringify(e),SO=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Ic},{identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ic},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Ic},{identify:Iv,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})=>Iv(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:Ic}],wO={default:!0,tag:"",test:/^/,resolve(e,n){return n(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},xO=[_l,Al].concat(SO,wO),Nm={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,"")),a=new Uint8Array(s.length);for(let o=0;o<s.length;++o)a[o]=s.charCodeAt(o);return a}else return n("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:n,value:s},a,o,c){if(!s)return"";const u=s;let d;if(typeof btoa=="function"){let h="";for(let p=0;p<u.length;++p)h+=String.fromCharCode(u[p]);d=btoa(h)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(n??(n=Ae.BLOCK_LITERAL),n!==Ae.QUOTE_DOUBLE){const h=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),p=Math.ceil(d.length/h),y=new Array(p);for(let g=0,v=0;g<p;++g,v+=h)y[g]=d.substr(v,h);d=y.join(n===Ae.BLOCK_LITERAL?`
|
|
66
|
-
`:" ")}return hr({comment:e,type:n,value:d},a,o,c)}};function AS(e,n){if(Nl(e))for(let s=0;s<e.items.length;++s){let a=e.items[s];if(!it(a)){if(El(a)){a.items.length>1&&n("Each pair must have its own sequence indicator");const o=a.items[0]||new Bt(new Ae(null));if(a.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${a.commentBefore}
|
|
67
|
-
${o.key.commentBefore}`:a.commentBefore),a.comment){const c=o.value??o.key;c.comment=c.comment?`${a.comment}
|
|
68
|
-
${c.comment}`:a.comment}a=o}e.items[s]=it(a)?a:new Bt(a)}}else n("Expected a sequence for this tag");return e}function TS(e,n,s){const{replacer:a}=s,o=new bs(e);o.tag="tag:yaml.org,2002:pairs";let c=0;if(n&&Symbol.iterator in Object(n))for(let u of n){typeof a=="function"&&(u=a.call(n,String(c++),u));let d,h;if(Array.isArray(u))if(u.length===2)d=u[0],h=u[1];else throw new TypeError(`Expected [key, value] tuple: ${u}`);else if(u&&u instanceof Object){const p=Object.keys(u);if(p.length===1)d=p[0],h=u[d];else throw new TypeError(`Expected tuple with one key, not ${p.length} keys`)}else d=u;o.items.push(wm(d,h,s))}return o}const _m={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:AS,createNode:TS};class sl extends bs{constructor(){super(),this.add=fn.prototype.add.bind(this),this.delete=fn.prototype.delete.bind(this),this.get=fn.prototype.get.bind(this),this.has=fn.prototype.has.bind(this),this.set=fn.prototype.set.bind(this),this.tag=sl.tag}toJSON(n,s){if(!s)return super.toJSON(n);const a=new Map;s?.onCreate&&s.onCreate(a);for(const o of this.items){let c,u;if(it(o)?(c=Mn(o.key,"",s),u=Mn(o.value,c,s)):c=Mn(o,"",s),a.has(c))throw new Error("Ordered maps must not include duplicate keys");a.set(c,u)}return a}static from(n,s,a){const o=TS(n,s,a),c=new this;return c.items=o.items,c}}sl.tag="tag:yaml.org,2002:omap";const Am={collection:"seq",identify:e=>e instanceof Map,nodeClass:sl,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,n){const s=AS(e,n),a=[];for(const{key:o}of s.items)Qe(o)&&(a.includes(o.value)?n(`Ordered maps must not include duplicate keys: ${o.value}`):a.push(o.value));return Object.assign(new sl,s)},createNode:(e,n,s)=>sl.from(e,n,s)};function CS({value:e,source:n},s){return n&&(e?MS:OS).test.test(n)?n:e?s.options.trueStr:s.options.falseStr}const MS={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 Ae(!0),stringify:CS},OS={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 Ae(!1),stringify:CS},EO={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:Zn},NO={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():Zn(e)}},_O={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 Ae(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(s!==-1){const a=e.substring(s+1).replace(/_/g,"");a[a.length-1]==="0"&&(n.minFractionDigits=a.length)}return n},stringify:Zn},mr=e=>typeof e=="bigint"||Number.isInteger(e);function Lu(e,n,s,{intAsBigInt:a}){const o=e[0];if((o==="-"||o==="+")&&(n+=1),e=e.substring(n).replace(/_/g,""),a){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 Tm(e,n,s){const{value:a}=e;if(mr(a)){const o=a.toString(n);return a<0?"-"+s+o.substr(1):s+o}return Zn(e)}const AO={identify:mr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,n,s)=>Lu(e,2,2,s),stringify:e=>Tm(e,2,"0b")},TO={identify:mr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,n,s)=>Lu(e,1,8,s),stringify:e=>Tm(e,8,"0")},CO={identify:mr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,n,s)=>Lu(e,0,10,s),stringify:Zn},MO={identify:mr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,n,s)=>Lu(e,2,16,s),stringify:e=>Tm(e,16,"0x")};class al extends fn{constructor(n){super(n),this.tag=al.tag}add(n){let s;it(n)?s=n:n&&typeof n=="object"&&"key"in n&&"value"in n&&n.value===null?s=new Bt(n.key,null):s=new Bt(n,null),qs(this.items,s.key)||this.items.push(s)}get(n,s){const a=qs(this.items,n);return!s&&it(a)?Qe(a.key)?a.key.value:a.key:a}set(n,s){if(typeof s!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof s}`);const a=qs(this.items,n);a&&!s?this.items.splice(this.items.indexOf(a),1):!a&&s&&this.items.push(new Bt(n))}toJSON(n,s){return super.toJSON(n,s,Set)}toString(n,s,a){if(!n)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},n,{allNullValues:!0}),s,a);throw new Error("Set items must all have null values")}static from(n,s,a){const{replacer:o}=a,c=new this(n);if(s&&Symbol.iterator in Object(s))for(let u of s)typeof o=="function"&&(u=o.call(s,u,u)),c.items.push(wm(u,null,a));return c}}al.tag="tag:yaml.org,2002:set";const Cm={collection:"map",identify:e=>e instanceof Set,nodeClass:al,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,n,s)=>al.from(e,n,s),resolve(e,n){if(El(e)){if(e.hasAllNullValues(!0))return Object.assign(new al,e);n("Set items must all have null values")}else n("Expected a mapping for this tag");return e}};function Mm(e,n){const s=e[0],a=s==="-"||s==="+"?e.substring(1):e,o=u=>n?BigInt(u):Number(u),c=a.replace(/_/g,"").split(":").reduce((u,d)=>u*o(60)+o(d),o(0));return s==="-"?o(-1)*c:c}function kS(e){let{value:n}=e,s=u=>u;if(typeof n=="bigint")s=u=>BigInt(u);else if(isNaN(n)||!isFinite(n))return Zn(e);let a="";n<0&&(a="-",n*=s(-1));const o=s(60),c=[n%o];return n<60?c.unshift(0):(n=(n-c[0])/o,c.unshift(n%o),n>=60&&(n=(n-c[0])/o,c.unshift(n))),a+c.map(u=>String(u).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const zS={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})=>Mm(e,s),stringify:kS},DS={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=>Mm(e,!1),stringify:kS},$u={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($u.test);if(!n)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,a,o,c,u,d]=n.map(Number),h=n[7]?Number((n[7]+"00").substr(1,3)):0;let p=Date.UTC(s,a-1,o,c||0,u||0,d||0,h);const y=n[8];if(y&&y!=="Z"){let g=Mm(y,!1);Math.abs(g)<30&&(g*=60),p-=6e4*g}return new Date(p)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},qv=[_l,Al,ju,Ru,MS,OS,AO,TO,CO,MO,EO,NO,_O,Nm,zi,Am,_m,Cm,zS,DS,$u],Vv=new Map([["core",bO],["failsafe",[_l,Al,ju]],["json",xO],["yaml11",qv],["yaml-1.1",qv]]),Yv={binary:Nm,bool:xm,float:wS,floatExp:SS,floatNaN:bS,floatTime:DS,int:NS,intHex:_S,intOct:ES,intTime:zS,map:_l,merge:zi,null:Ru,omap:Am,pairs:_m,seq:Al,set:Cm,timestamp:$u},OO={"tag:yaml.org,2002:binary":Nm,"tag:yaml.org,2002:merge":zi,"tag:yaml.org,2002:omap":Am,"tag:yaml.org,2002:pairs":_m,"tag:yaml.org,2002:set":Cm,"tag:yaml.org,2002:timestamp":$u};function bh(e,n,s){const a=Vv.get(n);if(a&&!e)return s&&!a.includes(zi)?a.concat(zi):a.slice();let o=a;if(!o)if(Array.isArray(e))o=[];else{const c=Array.from(Vv.keys()).filter(u=>u!=="yaml11").map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown schema "${n}"; use one of ${c} or define customTags array`)}if(Array.isArray(e))for(const c of e)o=o.concat(c);else typeof e=="function"&&(o=e(o.slice()));return s&&(o=o.concat(zi)),o.reduce((c,u)=>{const d=typeof u=="string"?Yv[u]:u;if(!d){const h=JSON.stringify(u),p=Object.keys(Yv).map(y=>JSON.stringify(y)).join(", ");throw new Error(`Unknown custom tag ${h}; use one of ${p}`)}return c.includes(d)||c.push(d),c},[])}const kO=(e,n)=>e.key<n.key?-1:e.key>n.key?1:0;class Hu{constructor({compat:n,customTags:s,merge:a,resolveKnownTags:o,schema:c,sortMapEntries:u,toStringDefaults:d}){this.compat=Array.isArray(n)?bh(n,"compat"):n?bh(null,n):null,this.name=typeof c=="string"&&c||"core",this.knownTags=o?OO:{},this.tags=bh(s,this.name,a),this.toStringOptions=d??null,Object.defineProperty(this,vs,{value:_l}),Object.defineProperty(this,li,{value:ju}),Object.defineProperty(this,xl,{value:Al}),this.sortMapEntries=typeof u=="function"?u:u===!0?kO:null}clone(){const n=Object.create(Hu.prototype,Object.getOwnPropertyDescriptors(this));return n.tags=this.tags.slice(),n}}function zO(e,n){const s=[];let a=n.directives===!0;if(n.directives!==!1&&e.directives){const h=e.directives.toString(e);h?(s.push(h),a=!0):e.directives.docStart&&(a=!0)}a&&s.push("---");const o=hS(e,n),{commentString:c}=o.options;if(e.commentBefore){s.length!==1&&s.unshift("");const h=c(e.commentBefore);s.unshift(ki(h,""))}let u=!1,d=null;if(e.contents){if(lt(e.contents)){if(e.contents.spaceBefore&&a&&s.push(""),e.contents.commentBefore){const y=c(e.contents.commentBefore);s.push(ki(y,""))}o.forceBlockIndent=!!e.comment,d=e.contents.comment}const h=d?void 0:()=>u=!0;let p=yl(e.contents,o,()=>d=null,h);d&&(p+=Is(p,"",c(d))),(p[0]==="|"||p[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${p}`:s.push(p)}else s.push(yl(e.contents,o));if(e.directives?.docEnd)if(e.comment){const h=c(e.comment);h.includes(`
|
|
69
|
-
`)?(s.push("..."),s.push(ki(h,""))):s.push(`... ${h}`)}else s.push("...");else{let h=e.comment;h&&u&&(h=h.replace(/^\n+/,"")),h&&((!u||d)&&s[s.length-1]!==""&&s.push(""),s.push(ki(c(h),"")))}return s.join(`
|
|
70
|
-
`)+`
|
|
71
|
-
`}class Tl{constructor(n,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,On,{value:qh});let o=null;typeof s=="function"||Array.isArray(s)?o=s:a===void 0&&s&&(a=s,s=void 0);const c=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},a);this.options=c;let{version:u}=c;a?._directives?(this.directives=a._directives.atDocument(),this.directives.yaml.explicit&&(u=this.directives.yaml.version)):this.directives=new Ht({version:u}),this.setSchema(u,a),this.contents=n===void 0?null:this.createNode(n,o,a)}clone(){const n=Object.create(Tl.prototype,{[On]:{value:qh}});return n.commentBefore=this.commentBefore,n.comment=this.comment,n.errors=this.errors.slice(),n.warnings=this.warnings.slice(),n.options=Object.assign({},this.options),this.directives&&(n.directives=this.directives.clone()),n.schema=this.schema.clone(),n.contents=lt(this.contents)?this.contents.clone(n.schema):this.contents,this.range&&(n.range=this.range.slice()),n}add(n){Xa(this.contents)&&this.contents.add(n)}addIn(n,s){Xa(this.contents)&&this.contents.addIn(n,s)}createAlias(n,s){if(!n.anchor){const a=rS(this);n.anchor=!s||a.has(s)?cS(s||"a",a):s}return new Ou(n.anchor)}createNode(n,s,a){let o;if(typeof s=="function")n=s.call({"":n},"",n),o=s;else if(Array.isArray(s)){const T=k=>typeof k=="number"||k instanceof String||k instanceof Number,C=s.filter(T).map(String);C.length>0&&(s=s.concat(C)),o=s}else a===void 0&&s&&(a=s,s=void 0);const{aliasDuplicateObjects:c,anchorPrefix:u,flow:d,keepUndefined:h,onTagObj:p,tag:y}=a??{},{onAnchor:g,setAnchors:v,sourceObjects:x}=lO(this,u||"a"),E={aliasDuplicateObjects:c??!0,keepUndefined:h??!1,onAnchor:g,onTagObj:p,replacer:o,schema:this.schema,sourceObjects:x},A=Po(n,y,E);return d&&at(A)&&(A.flow=!0),v(),A}createPair(n,s,a={}){const o=this.createNode(n,null,a),c=this.createNode(s,null,a);return new Bt(o,c)}delete(n){return Xa(this.contents)?this.contents.delete(n):!1}deleteIn(n){return jo(n)?this.contents==null?!1:(this.contents=null,!0):Xa(this.contents)?this.contents.deleteIn(n):!1}get(n,s){return at(this.contents)?this.contents.get(n,s):void 0}getIn(n,s){return jo(n)?!s&&Qe(this.contents)?this.contents.value:this.contents:at(this.contents)?this.contents.getIn(n,s):void 0}has(n){return at(this.contents)?this.contents.has(n):!1}hasIn(n){return jo(n)?this.contents!==void 0:at(this.contents)?this.contents.hasIn(n):!1}set(n,s){this.contents==null?this.contents=du(this.schema,[n],s):Xa(this.contents)&&this.contents.set(n,s)}setIn(n,s){jo(n)?this.contents=s:this.contents==null?this.contents=du(this.schema,Array.from(n),s):Xa(this.contents)&&this.contents.setIn(n,s)}setSchema(n,s={}){typeof n=="number"&&(n=String(n));let a;switch(n){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ht({version:"1.1"}),a={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=n:this.directives=new Ht({version:n}),a={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,a=null;break;default:{const o=JSON.stringify(n);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${o}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(a)this.schema=new Hu(Object.assign(a,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:n,jsonArg:s,mapAsMap:a,maxAliasCount:o,onAnchor:c,reviver:u}={}){const d={anchors:new Map,doc:this,keep:!n,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},h=Mn(this.contents,s??"",d);if(typeof c=="function")for(const{count:p,res:y}of d.anchors.values())c(y,p);return typeof u=="function"?Pa(u,{"":h},"",h):h}toJSON(n,s){return this.toJS({json:!0,jsonArg:n,mapAsMap:!1,onAnchor:s})}toString(n={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in n&&(!Number.isInteger(n.indent)||Number(n.indent)<=0)){const s=JSON.stringify(n.indent);throw new Error(`"indent" option must be a positive integer, not ${s}`)}return zO(this,n)}}function Xa(e){if(at(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Om extends Error{constructor(n,s,a,o){super(),this.name=n,this.code=a,this.message=o,this.pos=s}}class Vs extends Om{constructor(n,s,a){super("YAMLParseError",n,s,a)}}class jS extends Om{constructor(n,s,a){super("YAMLWarning",n,s,a)}}const mu=(e,n)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(d=>n.linePos(d));const{line:a,col:o}=s.linePos[0];s.message+=` at line ${a}, column ${o}`;let c=o-1,u=e.substring(n.lineStarts[a-1],n.lineStarts[a]).replace(/[\n\r]+$/,"");if(c>=60&&u.length>80){const d=Math.min(c-39,u.length-79);u="…"+u.substring(d),c-=d-1}if(u.length>80&&(u=u.substring(0,79)+"…"),a>1&&/^ *$/.test(u.substring(0,c))){let d=e.substring(n.lineStarts[a-2],n.lineStarts[a-1]);d.length>80&&(d=d.substring(0,79)+`…
|
|
72
|
-
`),u=d+u}if(/[^ ]/.test(u)){let d=1;const h=s.linePos[1];h?.line===a&&h.col>o&&(d=Math.max(1,Math.min(h.col-o,80-c)));const p=" ".repeat(c)+"^".repeat(d);s.message+=`:
|
|
73
|
-
|
|
74
|
-
${u}
|
|
75
|
-
${p}
|
|
76
|
-
`}};function vl(e,{flow:n,indicator:s,next:a,offset:o,onError:c,parentIndent:u,startOnNewline:d}){let h=!1,p=d,y=d,g="",v="",x=!1,E=!1,A=null,T=null,C=null,k=null,_=null,N=null,j=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),A&&(p&&R.type!=="comment"&&R.type!=="newline"&&c(A,"TAB_AS_INDENT","Tabs are not allowed as indentation"),A=null),R.type){case"space":!n&&(s!=="doc-start"||a?.type!=="flow-collection")&&R.source.includes(" ")&&(A=R),y=!0;break;case"comment":{y||c(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const U=R.source.substring(1)||" ";g?g+=v+U:g=U,v="",p=!1;break}case"newline":p?g?g+=R.source:(!N||s!=="seq-item-ind")&&(h=!0):v+=R.source,p=!0,x=!0,(T||C)&&(k=R),y=!0;break;case"anchor":T&&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),T=R,j??(j=R.offset),p=!1,y=!1,E=!0;break;case"tag":{C&&c(R,"MULTIPLE_TAGS","A node can have at most one tag"),C=R,j??(j=R.offset),p=!1,y=!1,E=!0;break}case s:(T||C)&&c(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),N&&c(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${n??"collection"}`),N=R,p=s==="seq-item-ind"||s==="explicit-key-ind",y=!1;break;case"comma":if(n){_&&c(R,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`),_=R,p=!1,y=!1;break}default:c(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),p=!1,y=!1}const D=e[e.length-1],B=D?D.offset+D.source.length:o;return E&&a&&a.type!=="space"&&a.type!=="newline"&&a.type!=="comma"&&(a.type!=="scalar"||a.source!=="")&&c(a.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),A&&(p&&A.indent<=u||a?.type==="block-map"||a?.type==="block-seq")&&c(A,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:N,spaceBefore:h,comment:g,hasNewline:x,anchor:T,tag:C,newlineAfterProp:k,end:B,start:j??B}}function er(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(er(n.key)||er(n.value))return!0}return!1;default:return!0}}function Xh(e,n,s){if(n?.type==="flow-collection"){const a=n.end[0];a.indent===e&&(a.source==="]"||a.source==="}")&&er(n)&&s(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function RS(e,n,s){const{uniqueKeys:a}=e.options;if(a===!1)return!1;const o=typeof a=="function"?a:(c,u)=>c===u||Qe(c)&&Qe(u)&&c.value===u.value;return n.some(c=>o(c.key,s))}const Gv="All mapping items must start at the same column";function DO({composeNode:e,composeEmptyNode:n},s,a,o,c){const u=c?.nodeClass??fn,d=new u(s.schema);s.atRoot&&(s.atRoot=!1);let h=a.offset,p=null;for(const y of a.items){const{start:g,key:v,sep:x,value:E}=y,A=vl(g,{indicator:"explicit-key-ind",next:v??x?.[0],offset:h,onError:o,parentIndent:a.indent,startOnNewline:!0}),T=!A.found;if(T){if(v&&(v.type==="block-seq"?o(h,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==a.indent&&o(h,"BAD_INDENT",Gv)),!A.anchor&&!A.tag&&!x){p=A.end,A.comment&&(d.comment?d.comment+=`
|
|
78
|
-
`+A.comment:d.comment=A.comment);continue}(A.newlineAfterProp||er(v))&&o(v??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else A.found?.indent!==a.indent&&o(h,"BAD_INDENT",Gv);s.atKey=!0;const C=A.end,k=v?e(s,v,A,o):n(s,C,g,null,A,o);s.schema.compat&&Xh(a.indent,v,o),s.atKey=!1,RS(s,d.items,k)&&o(C,"DUPLICATE_KEY","Map keys must be unique");const _=vl(x??[],{indicator:"map-value-ind",next:E,offset:k.range[2],onError:o,parentIndent:a.indent,startOnNewline:!v||v.type==="block-scalar"});if(h=_.end,_.found){T&&(E?.type==="block-map"&&!_.hasNewline&&o(h,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&A.start<_.found.offset-1024&&o(k.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const N=E?e(s,E,_,o):n(s,h,x,null,_,o);s.schema.compat&&Xh(a.indent,E,o),h=N.range[2];const j=new Bt(k,N);s.options.keepSourceTokens&&(j.srcToken=y),d.items.push(j)}else{T&&o(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(k.comment?k.comment+=`
|
|
79
|
-
`+_.comment:k.comment=_.comment);const N=new Bt(k);s.options.keepSourceTokens&&(N.srcToken=y),d.items.push(N)}}return p&&p<h&&o(p,"IMPOSSIBLE","Map comment with trailing content"),d.range=[a.offset,h,p??h],d}function jO({composeNode:e,composeEmptyNode:n},s,a,o,c){const u=c?.nodeClass??bs,d=new u(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let h=a.offset,p=null;for(const{start:y,value:g}of a.items){const v=vl(y,{indicator:"seq-item-ind",next:g,offset:h,onError:o,parentIndent:a.indent,startOnNewline:!0});if(!v.found)if(v.anchor||v.tag||g)g?.type==="block-seq"?o(v.end,"BAD_INDENT","All sequence items must start at the same column"):o(h,"MISSING_CHAR","Sequence item without - indicator");else{p=v.end,v.comment&&(d.comment=v.comment);continue}const x=g?e(s,g,v,o):n(s,v.end,y,null,v,o);s.schema.compat&&Xh(a.indent,g,o),h=x.range[2],d.items.push(x)}return d.range=[a.offset,h,p??h],d}function pr(e,n,s,a){let o="";if(e){let c=!1,u="";for(const d of e){const{source:h,type:p}=d;switch(p){case"space":c=!0;break;case"comment":{s&&!c&&a(d,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const y=h.substring(1)||" ";o?o+=u+y:o=y,u="";break}case"newline":o&&(u+=h),c=!0;break;default:a(d,"UNEXPECTED_TOKEN",`Unexpected ${p} at node end`)}n+=h.length}}return{comment:o,offset:n}}const Sh="Block collections are not allowed within flow collections",wh=e=>e&&(e.type==="block-map"||e.type==="block-seq");function RO({composeNode:e,composeEmptyNode:n},s,a,o,c){const u=a.start.source==="{",d=u?"flow map":"flow sequence",h=c?.nodeClass??(u?fn:bs),p=new h(s.schema);p.flow=!0;const y=s.atRoot;y&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let g=a.offset+a.start.source.length;for(let T=0;T<a.items.length;++T){const C=a.items[T],{start:k,key:_,sep:N,value:j}=C,D=vl(k,{flow:d,indicator:"explicit-key-ind",next:_??N?.[0],offset:g,onError:o,parentIndent:a.indent,startOnNewline:!1});if(!D.found){if(!D.anchor&&!D.tag&&!N&&!j){T===0&&D.comma?o(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`):T<a.items.length-1&&o(D.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${d}`),D.comment&&(p.comment?p.comment+=`
|
|
80
|
-
`+D.comment:p.comment=D.comment),g=D.end;continue}!u&&s.options.strict&&er(_)&&o(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(T===0)D.comma&&o(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`);else if(D.comma||o(D.start,"MISSING_CHAR",`Missing , between ${d} items`),D.comment){let B="";e:for(const R of k)switch(R.type){case"comma":case"space":break;case"comment":B=R.source.substring(1);break e;default:break e}if(B){let R=p.items[p.items.length-1];it(R)&&(R=R.value??R.key),R.comment?R.comment+=`
|
|
81
|
-
`+B:R.comment=B,D.comment=D.comment.substring(B.length+1)}}if(!u&&!N&&!D.found){const B=j?e(s,j,D,o):n(s,D.end,N,null,D,o);p.items.push(B),g=B.range[2],wh(j)&&o(B.range,"BLOCK_IN_FLOW",Sh)}else{s.atKey=!0;const B=D.end,R=_?e(s,_,D,o):n(s,B,k,null,D,o);wh(_)&&o(R.range,"BLOCK_IN_FLOW",Sh),s.atKey=!1;const U=vl(N??[],{flow:d,indicator:"map-value-ind",next:j,offset:R.range[2],onError:o,parentIndent:a.indent,startOnNewline:!1});if(U.found){if(!u&&!D.found&&s.options.strict){if(N)for(const Z of N){if(Z===U.found)break;if(Z.type==="newline"){o(Z,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}D.start<U.found.offset-1024&&o(U.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else j&&("source"in j&&j.source?.[0]===":"?o(j,"MISSING_CHAR",`Missing space after : in ${d}`):o(U.start,"MISSING_CHAR",`Missing , or : between ${d} items`));const q=j?e(s,j,U,o):U.found?n(s,U.end,N,null,U,o):null;q?wh(j)&&o(q.range,"BLOCK_IN_FLOW",Sh):U.comment&&(R.comment?R.comment+=`
|
|
82
|
-
`+U.comment:R.comment=U.comment);const Y=new Bt(R,q);if(s.options.keepSourceTokens&&(Y.srcToken=C),u){const Z=p;RS(s,Z.items,R)&&o(B,"DUPLICATE_KEY","Map keys must be unique"),Z.items.push(Y)}else{const Z=new fn(s.schema);Z.flow=!0,Z.items.push(Y);const le=(q??R).range;Z.range=[R.range[0],le[1],le[2]],p.items.push(Z)}g=q?q.range[2]:U.end}}const v=u?"}":"]",[x,...E]=a.end;let A=g;if(x?.source===v)A=x.offset+x.source.length;else{const T=d[0].toUpperCase()+d.substring(1),C=y?`${T} must end with a ${v}`:`${T} in block collection must be sufficiently indented and end with a ${v}`;o(g,y?"MISSING_CHAR":"BAD_INDENT",C),x&&x.source.length!==1&&E.unshift(x)}if(E.length>0){const T=pr(E,A,s.options.strict,o);T.comment&&(p.comment?p.comment+=`
|
|
83
|
-
`+T.comment:p.comment=T.comment),p.range=[a.offset,A,T.offset]}else p.range=[a.offset,A,A];return p}function xh(e,n,s,a,o,c){const u=s.type==="block-map"?DO(e,n,s,a,c):s.type==="block-seq"?jO(e,n,s,a,c):RO(e,n,s,a,c),d=u.constructor;return o==="!"||o===d.tagName?(u.tag=d.tagName,u):(o&&(u.tag=o),u)}function BO(e,n,s,a,o){const c=a.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:x}=a,E=v&&c?v.offset>c.offset?v:c:v??c;E&&(!x||x.offset<E.offset)&&o(E,"MISSING_CHAR","Missing newline after block sequence props")}const d=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!c||!u||u==="!"||u===fn.tagName&&d==="map"||u===bs.tagName&&d==="seq")return xh(e,n,s,o,u);let h=n.schema.tags.find(v=>v.tag===u&&v.collection===d);if(!h){const v=n.schema.knownTags[u];if(v?.collection===d)n.schema.tags.push(Object.assign({},v,{default:!1})),h=v;else return v?o(c,"BAD_COLLECTION_TYPE",`${v.tag} used for ${d} collection, but expects ${v.collection??"scalar"}`,!0):o(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${u}`,!0),xh(e,n,s,o,u)}const p=xh(e,n,s,o,u,h),y=h.resolve?.(p,v=>o(c,"TAG_RESOLVE_FAILED",v),n.options)??p,g=lt(y)?y:new Ae(y);return g.range=p.range,g.tag=u,h?.format&&(g.format=h.format),g}function BS(e,n,s){const a=n.offset,o=LO(n,e.options.strict,s);if(!o)return{value:"",type:null,comment:"",range:[a,a,a]};const c=o.mode===">"?Ae.BLOCK_FOLDED:Ae.BLOCK_LITERAL,u=n.source?$O(n.source):[];let d=u.length;for(let A=u.length-1;A>=0;--A){const T=u[A][1];if(T===""||T==="\r")d=A;else break}if(d===0){const A=o.chomp==="+"&&u.length>0?`
|
|
84
|
-
`.repeat(Math.max(1,u.length-1)):"";let T=a+o.length;return n.source&&(T+=n.source.length),{value:A,type:c,comment:o.comment,range:[a,T,T]}}let h=n.indent+o.indent,p=n.offset+o.length,y=0;for(let A=0;A<d;++A){const[T,C]=u[A];if(C===""||C==="\r")o.indent===0&&T.length>h&&(h=T.length);else{T.length<h&&s(p+T.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),o.indent===0&&(h=T.length),y=A,h===0&&!e.atRoot&&s(p,"BAD_INDENT","Block scalar values in collections must be indented");break}p+=T.length+C.length+1}for(let A=u.length-1;A>=d;--A)u[A][0].length>h&&(d=A+1);let g="",v="",x=!1;for(let A=0;A<y;++A)g+=u[A][0].slice(h)+`
|
|
85
|
-
`;for(let A=y;A<d;++A){let[T,C]=u[A];p+=T.length+C.length+1;const k=C[C.length-1]==="\r";if(k&&(C=C.slice(0,-1)),C&&T.length<h){const N=`Block scalar lines must not be less indented than their ${o.indent?"explicit indentation indicator":"first line"}`;s(p-C.length-(k?2:1),"BAD_INDENT",N),T=""}c===Ae.BLOCK_LITERAL?(g+=v+T.slice(h)+C,v=`
|
|
86
|
-
`):T.length>h||C[0]===" "?(v===" "?v=`
|
|
87
|
-
`:!x&&v===`
|
|
88
|
-
`&&(v=`
|
|
89
|
-
|
|
90
|
-
`),g+=v+T.slice(h)+C,v=`
|
|
91
|
-
`,x=!0):C===""?v===`
|
|
92
|
-
`?g+=`
|
|
93
|
-
`:v=`
|
|
94
|
-
`:(g+=v+C,v=" ",x=!1)}switch(o.chomp){case"-":break;case"+":for(let A=d;A<u.length;++A)g+=`
|
|
95
|
-
`+u[A][0].slice(h);g[g.length-1]!==`
|
|
96
|
-
`&&(g+=`
|
|
97
|
-
`);break;default:g+=`
|
|
98
|
-
`}const E=a+o.length+n.source.length;return{value:g,type:c,comment:o.comment,range:[a,E,E]}}function LO({offset:e,props:n},s,a){if(n[0].type!=="block-scalar-header")return a(n[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:o}=n[0],c=o[0];let u=0,d="",h=-1;for(let v=1;v<o.length;++v){const x=o[v];if(!d&&(x==="-"||x==="+"))d=x;else{const E=Number(x);!u&&E?u=E:h===-1&&(h=e+v)}}h!==-1&&a(h,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${o}`);let p=!1,y="",g=o.length;for(let v=1;v<n.length;++v){const x=n[v];switch(x.type){case"space":p=!0;case"newline":g+=x.source.length;break;case"comment":s&&!p&&a(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),g+=x.source.length,y=x.source.substring(1);break;case"error":a(x,"UNEXPECTED_TOKEN",x.message),g+=x.source.length;break;default:{const E=`Unexpected token in block scalar header: ${x.type}`;a(x,"UNEXPECTED_TOKEN",E);const A=x.source;A&&typeof A=="string"&&(g+=A.length)}}}return{mode:c,indent:u,chomp:d,comment:y,length:g}}function $O(e){const n=e.split(/\n( *)/),s=n[0],a=s.match(/^( *)/),c=[a?.[1]?[a[1],s.slice(a[1].length)]:["",s]];for(let u=1;u<n.length;u+=2)c.push([n[u],n[u+1]]);return c}function LS(e,n,s){const{offset:a,type:o,source:c,end:u}=e;let d,h;const p=(v,x,E)=>s(a+v,x,E);switch(o){case"scalar":d=Ae.PLAIN,h=HO(c,p);break;case"single-quoted-scalar":d=Ae.QUOTE_SINGLE,h=UO(c,p);break;case"double-quoted-scalar":d=Ae.QUOTE_DOUBLE,h=IO(c,p);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[a,a+c.length,a+c.length]}}const y=a+c.length,g=pr(u,y,n,s);return{value:h,type:d,comment:g.comment,range:[a,y,g.offset]}}function HO(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}`),$S(e)}function UO(e,n){return(e[e.length-1]!=="'"||e.length===1)&&n(e.length,"MISSING_CHAR","Missing closing 'quote"),$S(e.slice(1,-1)).replace(/''/g,"'")}function $S(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 a=n.exec(e);if(!a)return e;let o=a[1],c=" ",u=n.lastIndex;for(s.lastIndex=u;a=s.exec(e);)a[1]===""?c===`
|
|
101
|
-
`?o+=c:c=`
|
|
102
|
-
`:(o+=c+a[1],c=" "),u=s.lastIndex;const d=/[ \t]*(.*)/sy;return d.lastIndex=u,a=d.exec(e),o+c+(a?.[1]??"")}function IO(e,n){let s="";for(let a=1;a<e.length-1;++a){const o=e[a];if(!(o==="\r"&&e[a+1]===`
|
|
103
|
-
`))if(o===`
|
|
104
|
-
`){const{fold:c,offset:u}=qO(e,a);s+=c,a=u}else if(o==="\\"){let c=e[++a];const u=VO[c];if(u)s+=u;else if(c===`
|
|
105
|
-
`)for(c=e[a+1];c===" "||c===" ";)c=e[++a+1];else if(c==="\r"&&e[a+1]===`
|
|
106
|
-
`)for(c=e[++a+1];c===" "||c===" ";)c=e[++a+1];else if(c==="x"||c==="u"||c==="U"){const d=c==="x"?2:c==="u"?4:8;s+=YO(e,a+1,d,n),a+=d}else{const d=e.substr(a-1,2);n(a-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${d}`),s+=d}}else if(o===" "||o===" "){const c=a;let u=e[a+1];for(;u===" "||u===" ";)u=e[++a+1];u!==`
|
|
107
|
-
`&&!(u==="\r"&&e[a+2]===`
|
|
108
|
-
`)&&(s+=a>c?e.slice(c,a+1):o)}else s+=o}return(e[e.length-1]!=='"'||e.length===1)&&n(e.length,"MISSING_CHAR",'Missing closing "quote'),s}function qO(e,n){let s="",a=e[n+1];for(;(a===" "||a===" "||a===`
|
|
109
|
-
`||a==="\r")&&!(a==="\r"&&e[n+2]!==`
|
|
110
|
-
`);)a===`
|
|
111
|
-
`&&(s+=`
|
|
112
|
-
`),n+=1,a=e[n+1];return s||(s=" "),{fold:s,offset:n}}const VO={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
113
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function YO(e,n,s,a){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 d=e.substr(n-2,s+2);return a(n-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${d}`),d}}function HS(e,n,s,a){const{value:o,type:c,comment:u,range:d}=n.type==="block-scalar"?BS(e,n,a):LS(n,e.options.strict,a),h=s?e.directives.tagName(s.source,g=>a(s,"TAG_RESOLVE_FAILED",g)):null;let p;e.options.stringKeys&&e.atKey?p=e.schema[li]:h?p=GO(e.schema,o,h,s,a):n.type==="scalar"?p=XO(e,o,n,a):p=e.schema[li];let y;try{const g=p.resolve(o,v=>a(s??n,"TAG_RESOLVE_FAILED",v),e.options);y=Qe(g)?g:new Ae(g)}catch(g){const v=g instanceof Error?g.message:String(g);a(s??n,"TAG_RESOLVE_FAILED",v),y=new Ae(o)}return y.range=d,y.source=o,c&&(y.type=c),h&&(y.tag=h),p.format&&(y.format=p.format),u&&(y.comment=u),y}function GO(e,n,s,a,o){if(s==="!")return e[li];const c=[];for(const d of e.tags)if(!d.collection&&d.tag===s)if(d.default&&d.test)c.push(d);else return d;for(const d of c)if(d.test?.test(n))return d;const u=e.knownTags[s];return u&&!u.collection?(e.tags.push(Object.assign({},u,{default:!1,test:void 0})),u):(o(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),e[li])}function XO({atKey:e,directives:n,schema:s},a,o,c){const u=s.tags.find(d=>(d.default===!0||e&&d.default==="key")&&d.test?.test(a))||s[li];if(s.compat){const d=s.compat.find(h=>h.default&&h.test?.test(a))??s[li];if(u.tag!==d.tag){const h=n.tagString(u.tag),p=n.tagString(d.tag),y=`Value may be parsed as either ${h} or ${p}`;c(o,"TAG_RESOLVE_FAILED",y,!0)}}return u}function KO(e,n,s){if(n){s??(s=n.length);for(let a=s-1;a>=0;--a){let o=n[a];switch(o.type){case"space":case"comment":case"newline":e-=o.source.length;continue}for(o=n[++a];o?.type==="space";)e+=o.source.length,o=n[++a];break}}return e}const ZO={composeNode:US,composeEmptyNode:km};function US(e,n,s,a){const o=e.atKey,{spaceBefore:c,comment:u,anchor:d,tag:h}=s;let p,y=!0;switch(n.type){case"alias":p=QO(e,n,a),(d||h)&&a(n,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":p=HS(e,n,h,a),d&&(p.anchor=d.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{p=BO(ZO,e,n,s,a),d&&(p.anchor=d.source.substring(1))}catch(g){const v=g instanceof Error?g.message:String(g);a(n,"RESOURCE_EXHAUSTION",v)}break;default:{const g=n.type==="error"?n.message:`Unsupported token (type: ${n.type})`;a(n,"UNEXPECTED_TOKEN",g),y=!1}}return p??(p=km(e,n.offset,void 0,null,s,a)),d&&p.anchor===""&&a(d,"BAD_ALIAS","Anchor cannot be an empty string"),o&&e.options.stringKeys&&(!Qe(p)||typeof p.value!="string"||p.tag&&p.tag!=="tag:yaml.org,2002:str")&&a(h??n,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(p.spaceBefore=!0),u&&(n.type==="scalar"&&n.source===""?p.comment=u:p.commentBefore=u),e.options.keepSourceTokens&&y&&(p.srcToken=n),p}function km(e,n,s,a,{spaceBefore:o,comment:c,anchor:u,tag:d,end:h},p){const y={type:"scalar",offset:KO(n,s,a),indent:-1,source:""},g=HS(e,y,d,p);return u&&(g.anchor=u.source.substring(1),g.anchor===""&&p(u,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(g.spaceBefore=!0),c&&(g.comment=c,g.range[2]=h),g}function QO({options:e},{offset:n,source:s,end:a},o){const c=new Ou(s.substring(1));c.source===""&&o(n,"BAD_ALIAS","Alias cannot be an empty string"),c.source.endsWith(":")&&o(n+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const u=n+s.length,d=pr(a,u,e.strict,o);return c.range=[n,u,d.offset],d.comment&&(c.comment=d.comment),c}function FO(e,n,{offset:s,start:a,value:o,end:c},u){const d=Object.assign({_directives:n},e),h=new Tl(void 0,d),p={atKey:!1,atRoot:!0,directives:h.directives,options:h.options,schema:h.schema},y=vl(a,{indicator:"doc-start",next:o??c?.[0],offset:s,onError:u,parentIndent:0,startOnNewline:!0});y.found&&(h.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")),h.contents=o?US(p,o,y,u):km(p,y.end,a,null,y,u);const g=h.contents.range[2],v=pr(c,g,!1,u);return v.comment&&(h.comment=v.comment),h.range=[s,g,v.offset],h}function ko(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 Xv(e){let n="",s=!1,a=!1;for(let o=0;o<e.length;++o){const c=e[o];switch(c[0]){case"#":n+=(n===""?"":a?`
|
|
114
|
-
|
|
115
|
-
`:`
|
|
116
|
-
`)+(c.substring(1)||" "),s=!0,a=!1;break;case"%":e[o+1]?.[0]!=="#"&&(o+=1),s=!1;break;default:s||(a=!0),s=!1}}return{comment:n,afterEmptyLine:a}}class zm{constructor(n={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,o,c)=>{const u=ko(s);c?this.warnings.push(new jS(u,a,o)):this.errors.push(new Vs(u,a,o))},this.directives=new Ht({version:n.version||"1.2"}),this.options=n}decorate(n,s){const{comment:a,afterEmptyLine:o}=Xv(this.prelude);if(a){const c=n.contents;if(s)n.comment=n.comment?`${n.comment}
|
|
117
|
-
${a}`:a;else if(o||n.directives.docStart||!c)n.commentBefore=a;else if(at(c)&&!c.flow&&c.items.length>0){let u=c.items[0];it(u)&&(u=u.key);const d=u.commentBefore;u.commentBefore=d?`${a}
|
|
118
|
-
${d}`:a}else{const u=c.commentBefore;c.commentBefore=u?`${a}
|
|
119
|
-
${u}`:a}}if(s){for(let c=0;c<this.errors.length;++c)n.errors.push(this.errors[c]);for(let c=0;c<this.warnings.length;++c)n.warnings.push(this.warnings[c])}else n.errors=this.errors,n.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Xv(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(n,s=!1,a=-1){for(const o of n)yield*this.next(o);yield*this.end(s,a)}*next(n){switch(n.type){case"directive":this.directives.add(n.source,(s,a,o)=>{const c=ko(n);c[0]+=s,this.onError(c,"BAD_DIRECTIVE",a,o)}),this.prelude.push(n.source),this.atDirectives=!0;break;case"document":{const s=FO(this.options,this.directives,n,this.onError);this.atDirectives&&!s.directives.docStart&&this.onError(n,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(s,!1),this.doc&&(yield this.doc),this.doc=s,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(n.source);break;case"error":{const s=n.source?`${n.message}: ${JSON.stringify(n.source)}`:n.message,a=new Vs(ko(n),"UNEXPECTED_TOKEN",s);this.atDirectives||!this.doc?this.errors.push(a):this.doc.errors.push(a);break}case"doc-end":{if(!this.doc){const a="Unexpected doc-end without preceding document";this.errors.push(new Vs(ko(n),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const s=pr(n.end,n.offset+n.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),s.comment){const a=this.doc.comment;this.doc.comment=a?`${a}
|
|
120
|
-
${s.comment}`:s.comment}this.doc.range[2]=s.offset;break}default:this.errors.push(new Vs(ko(n),"UNEXPECTED_TOKEN",`Unsupported token ${n.type}`))}}*end(n=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(n){const a=Object.assign({_directives:this.directives},this.options),o=new Tl(void 0,a);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),o.range=[0,s,s],this.decorate(o,!1),yield o}}}function JO(e,n=!0,s){if(e){const a=(o,c,u)=>{const d=typeof o=="number"?o:Array.isArray(o)?o[0]:o.offset;if(s)s(d,c,u);else throw new Vs([d,d+1],c,u)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return LS(e,n,a);case"block-scalar":return BS({options:{strict:n}},e,a)}}return null}function WO(e,n){const{implicitKey:s=!1,indent:a,inFlow:o=!1,offset:c=-1,type:u="PLAIN"}=n,d=hr({type:u,value:e},{implicitKey:s,indent:a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}}),h=n.end??[{type:"newline",offset:-1,indent:a,source:`
|
|
121
|
-
`}];switch(d[0]){case"|":case">":{const p=d.indexOf(`
|
|
122
|
-
`),y=d.substring(0,p),g=d.substring(p+1)+`
|
|
123
|
-
`,v=[{type:"block-scalar-header",offset:c,indent:a,source:y}];return IS(v,h)||v.push({type:"newline",offset:-1,indent:a,source:`
|
|
124
|
-
`}),{type:"block-scalar",offset:c,indent:a,props:v,source:g}}case'"':return{type:"double-quoted-scalar",offset:c,indent:a,source:d,end:h};case"'":return{type:"single-quoted-scalar",offset:c,indent:a,source:d,end:h};default:return{type:"scalar",offset:c,indent:a,source:d,end:h}}}function PO(e,n,s={}){let{afterKey:a=!1,implicitKey:o=!1,inFlow:c=!1,type:u}=s,d="indent"in e?e.indent:null;if(a&&typeof d=="number"&&(d+=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 p=e.props[0];if(p.type!=="block-scalar-header")throw new Error("Invalid block scalar header");u=p.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:u="PLAIN"}const h=hr({type:u,value:n},{implicitKey:o||d===null,indent:d!==null&&d>0?" ".repeat(d):"",inFlow:c,options:{blockQuote:!0,lineWidth:-1}});switch(h[0]){case"|":case">":e3(e,h);break;case'"':Eh(e,h,"double-quoted-scalar");break;case"'":Eh(e,h,"single-quoted-scalar");break;default:Eh(e,h,"scalar")}}function e3(e,n){const s=n.indexOf(`
|
|
125
|
-
`),a=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=a,e.source=o}else{const{offset:c}=e,u="indent"in e?e.indent:-1,d=[{type:"block-scalar-header",offset:c,indent:u,source:a}];IS(d,"end"in e?e.end:void 0)||d.push({type:"newline",offset:-1,indent:u,source:`
|
|
127
|
-
`});for(const h of Object.keys(e))h!=="type"&&h!=="offset"&&delete e[h];Object.assign(e,{type:"block-scalar",indent:u,props:d,source:o})}}function IS(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 Eh(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 a=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 a)c.offset+=o;delete e.props,Object.assign(e,{type:s,source:n,end:a});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 a="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:a,source:n,end:o})}}}const t3=e=>"type"in e?pu(e):Pc(e);function pu(e){switch(e.type){case"block-scalar":{let n="";for(const s of e.props)n+=pu(s);return n+e.source}case"block-map":case"block-seq":{let n="";for(const s of e.items)n+=Pc(s);return n}case"flow-collection":{let n=e.start.source;for(const s of e.items)n+=Pc(s);for(const s of e.end)n+=s.source;return n}case"document":{let n=Pc(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 Pc({start:e,key:n,sep:s,value:a}){let o="";for(const c of e)o+=c.source;if(n&&(o+=pu(n)),s)for(const c of s)o+=c.source;return a&&(o+=pu(a)),o}const Kh=Symbol("break visit"),n3=Symbol("skip children"),qS=Symbol("remove item");function Js(e,n){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),VS(Object.freeze([]),e,n)}Js.BREAK=Kh;Js.SKIP=n3;Js.REMOVE=qS;Js.itemAtPath=(e,n)=>{let s=e;for(const[a,o]of n){const c=s?.[a];if(c&&"items"in c)s=c.items[o];else return}return s};Js.parentCollection=(e,n)=>{const s=Js.itemAtPath(e,n.slice(0,-1)),a=n[n.length-1][0],o=s?.[a];if(o&&"items"in o)return o;throw new Error("Parent collection not found")};function VS(e,n,s){let a=s(n,e);if(typeof a=="symbol")return a;for(const o of["key","value"]){const c=n[o];if(c&&"items"in c){for(let u=0;u<c.items.length;++u){const d=VS(Object.freeze(e.concat([[o,u]])),c.items[u],s);if(typeof d=="number")u=d-1;else{if(d===Kh)return Kh;d===qS&&(c.items.splice(u,1),u-=1)}}typeof a=="function"&&o==="key"&&(a=a(n,e))}}return typeof a=="function"?a(n,e):a}const Uu="\uFEFF",Iu="",qu="",tr="",i3=e=>!!e&&"items"in e,s3=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function a3(e){switch(e){case Uu:return"<BOM>";case Iu:return"<DOC>";case qu:return"<FLOW_END>";case tr:return"<SCALAR>";default:return JSON.stringify(e)}}function YS(e){switch(e){case Uu:return"byte-order-mark";case Iu:return"doc-mode";case qu:return"flow-error-end";case tr: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 l3=Object.freeze(Object.defineProperty({__proto__:null,BOM:Uu,DOCUMENT:Iu,FLOW_END:qu,SCALAR:tr,createScalarToken:WO,isCollection:i3,isScalar:s3,prettyToken:a3,resolveAsScalar:JO,setScalarValue:PO,stringify:t3,tokenType:YS,visit:Js},Symbol.toStringTag,{value:"Module"}));function Ln(e){switch(e){case void 0:case" ":case`
|
|
131
|
-
`:case"\r":case" ":return!0;default:return!1}}const Kv=new Set("0123456789ABCDEFabcdef"),o3=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),qc=new Set(",[]{}"),r3=new Set(` ,[]{}
|
|
132
|
-
\r `),Nh=e=>!e||r3.has(e);class GS{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(n,s=!1){if(n){if(typeof n!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+n:n,this.lineEndPos=null}this.atEnd=!s;let a=this.next??"stream";for(;a&&(s||this.hasChars(1));)a=yield*this.parseNext(a)}atLineEnd(){let n=this.pos,s=this.buffer[n];for(;s===" "||s===" ";)s=this.buffer[++n];return!s||s==="#"||s===`
|
|
133
|
-
`?!0:s==="\r"?this.buffer[n+1]===`
|
|
134
|
-
`:!1}charAt(n){return this.buffer[this.pos+n]}continueScalar(n){let s=this.buffer[n];if(this.indentNext>0){let a=0;for(;s===" ";)s=this.buffer[++a+n];if(s==="\r"){const o=this.buffer[a+n+1];if(o===`
|
|
135
|
-
`||!o&&!this.atEnd)return n+a+1}return s===`
|
|
136
|
-
`||a>=this.indentNext||!s&&!this.atEnd?n+a:-1}if(s==="-"||s==="."){const a=this.buffer.substr(n,3);if((a==="---"||a==="...")&&Ln(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]===Uu&&(yield*this.pushCount(1),n=n.substring(1)),n[0]==="%"){let s=n.length,a=n.indexOf("#");for(;a!==-1;){const c=n[a-1];if(c===" "||c===" "){s=a-1;break}else a=n.indexOf("#",a+1)}for(;;){const c=n[s-1];if(c===" "||c===" ")s-=1;else break}const o=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(n.length-o),this.pushNewline(),"stream"}if(this.atLineEnd()){const s=yield*this.pushSpaces(!0);return yield*this.pushCount(n.length-s),yield*this.pushNewline(),"stream"}return yield Iu,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==="...")&&Ln(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&&!Ln(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===":")&&Ln(s)){const a=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=a,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const n=this.getLine();if(n===null)return this.setNext("doc");let s=yield*this.pushIndicators();switch(n[s]){case"#":yield*this.pushCount(n.length-s);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Nh),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return s+=yield*this.parseBlockScalarHeader(),s+=yield*this.pushSpaces(!0),yield*this.pushCount(n.length-s),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let n,s,a=-1;do n=yield*this.pushNewline(),n>0?(s=yield*this.pushSpaces(!1),this.indentValue=a=s):s=0,s+=yield*this.pushSpaces(!0);while(n+s>0);const o=this.getLine();if(o===null)return this.setNext("flow");if((a!==-1&&a<this.indentNext&&o[0]!=="#"||a===0&&(o.startsWith("---")||o.startsWith("..."))&&Ln(o[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(o[0]==="]"||o[0]==="}")))return this.flowLevel=0,yield qu,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(Nh),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const u=this.charAt(1);if(this.flowKey||Ln(u)||u===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const n=this.charAt(0);let s=this.buffer.indexOf(n,this.pos+1);if(n==="'")for(;s!==-1&&this.buffer[s+1]==="'";)s=this.buffer.indexOf("'",s+2);else for(;s!==-1;){let c=0;for(;this.buffer[s-1-c]==="\\";)c+=1;if(c%2===0)break;s=this.buffer.indexOf('"',s+1)}const a=this.buffer.substring(0,s);let o=a.indexOf(`
|
|
138
|
-
`,this.pos);if(o!==-1){for(;o!==-1;){const c=this.continueScalar(o+1);if(c===-1)break;o=a.indexOf(`
|
|
139
|
-
`,c)}o!==-1&&(s=o-(a[o-1]==="\r"?2:1))}if(s===-1){if(!this.atEnd)return this.setNext("quoted-scalar");s=this.buffer.length}return yield*this.pushToIndex(s+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let n=this.pos;for(;;){const s=this.buffer[++n];if(s==="+")this.blockScalarKeep=!0;else if(s>"0"&&s<="9")this.blockScalarIndent=Number(s)-1;else if(s!=="-")break}return yield*this.pushUntil(s=>Ln(s)||s==="#")}*parseBlockScalar(){let n=this.pos-1,s=0,a;e:for(let c=this.pos;a=this.buffer[c];++c)switch(a){case" ":s+=1;break;case`
|
|
140
|
-
`:n=c,s=0;break;case"\r":{const u=this.buffer[c+1];if(!u&&!this.atEnd)return this.setNext("block-scalar");if(u===`
|
|
141
|
-
`)break}default:break e}if(!a&&!this.atEnd)return this.setNext("block-scalar");if(s>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=s:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const c=this.continueScalar(n+1);if(c===-1)break;n=this.buffer.indexOf(`
|
|
142
|
-
`,c)}while(n!==-1);if(n===-1){if(!this.atEnd)return this.setNext("block-scalar");n=this.buffer.length}}let o=n+1;for(a=this.buffer[o];a===" ";)a=this.buffer[++o];if(a===" "){for(;a===" "||a===" "||a==="\r"||a===`
|
|
143
|
-
`;)a=this.buffer[++o];n=o-1}else if(!this.blockScalarKeep)do{let c=n-1,u=this.buffer[c];u==="\r"&&(u=this.buffer[--c]);const d=c;for(;u===" ";)u=this.buffer[--c];if(u===`
|
|
144
|
-
`&&c>=this.pos&&c+1+s>d)n=c;else break}while(!0);return yield tr,yield*this.pushToIndex(n+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const n=this.flowLevel>0;let s=this.pos-1,a=this.pos-1,o;for(;o=this.buffer[++a];)if(o===":"){const c=this.buffer[a+1];if(Ln(c)||n&&qc.has(c))break;s=a}else if(Ln(o)){let c=this.buffer[a+1];if(o==="\r"&&(c===`
|
|
145
|
-
`?(a+=1,o=`
|
|
146
|
-
`,c=this.buffer[a+1]):s=a),c==="#"||n&&qc.has(c))break;if(o===`
|
|
147
|
-
`){const u=this.continueScalar(a+1);if(u===-1)break;a=Math.max(a,u-2)}}else{if(n&&qc.has(o))break;s=a}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield tr,yield*this.pushToIndex(s+1,!0),n?"flow":"doc")}*pushCount(n){return n>0?(yield this.buffer.substr(this.pos,n),this.pos+=n,n):0}*pushToIndex(n,s){const a=this.buffer.slice(this.pos,n);return a?(yield a,this.pos+=a.length,a.length):(s&&(yield""),0)}*pushIndicators(){let n=0;e:for(;;){switch(this.charAt(0)){case"!":n+=yield*this.pushTag(),n+=yield*this.pushSpaces(!0);continue e;case"&":n+=yield*this.pushUntil(Nh),n+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const s=this.flowLevel>0,a=this.charAt(1);if(Ln(a)||s&&qc.has(a)){s?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,n+=yield*this.pushCount(1),n+=yield*this.pushSpaces(!0);continue e}}}break e}return n}*pushTag(){if(this.charAt(1)==="<"){let n=this.pos+2,s=this.buffer[n];for(;!Ln(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(o3.has(s))s=this.buffer[++n];else if(s==="%"&&Kv.has(this.buffer[n+1])&&Kv.has(this.buffer[n+2]))s=this.buffer[n+=3];else break;return yield*this.pushToIndex(n,!1)}}*pushNewline(){const n=this.buffer[this.pos];return n===`
|
|
148
|
-
`?yield*this.pushCount(1):n==="\r"&&this.charAt(1)===`
|
|
149
|
-
`?yield*this.pushCount(2):0}*pushSpaces(n){let s=this.pos-1,a;do a=this.buffer[++s];while(a===" "||n&&a===" ");const o=s-this.pos;return o>0&&(yield this.buffer.substr(this.pos,o),this.pos=s),o}*pushUntil(n){let s=this.pos,a=this.buffer[s];for(;!n(a);)a=this.buffer[++s];return yield*this.pushToIndex(s,!1)}}class XS{constructor(){this.lineStarts=[],this.addNewLine=n=>this.lineStarts.push(n),this.linePos=n=>{let s=0,a=this.lineStarts.length;for(;s<a;){const c=s+a>>1;this.lineStarts[c]<n?s=c+1:a=c}if(this.lineStarts[s]===n)return{line:s+1,col:1};if(s===0)return{line:0,col:n};const o=this.lineStarts[s-1];return{line:s,col:n-o+1}}}}function ps(e,n){for(let s=0;s<e.length;++s)if(e[s].type===n)return!0;return!1}function Zv(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 KS(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 Vc(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 Ka(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 gu(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 Qv(e){if(e.start.type==="flow-seq-start")for(const n of e.items)n.sep&&!n.value&&!ps(n.start,"explicit-key-ind")&&!ps(n.sep,"map-value-ind")&&(n.key&&(n.value=n.key),delete n.key,KS(n.value)?n.value.end?gu(n.value.end,n.sep):n.value.end=n.sep:gu(n.start,n.sep),delete n.sep)}class Dm{constructor(n){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new GS,this.onNewLine=n}*parse(n,s=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const a of this.lexer.lex(n,s))yield*this.next(a);s||(yield*this.end())}*next(n){if(this.source=n,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=n.length;return}const s=YS(n);if(s)if(s==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=s,yield*this.step(),s){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+n.length);break;case"space":this.atNewLine&&n[0]===" "&&(this.indent+=n.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=n.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=n.length}else{const a=`Not a YAML token: ${n}`;yield*this.pop({type:"error",offset:this.offset,message:a,source:n}),this.offset+=n.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const n=this.peek(1);if(this.type==="doc-end"&&n?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!n)return yield*this.stream();switch(n.type){case"document":return yield*this.document(n);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(n);case"block-scalar":return yield*this.blockScalar(n);case"block-map":return yield*this.blockMap(n);case"block-seq":return yield*this.blockSequence(n);case"flow-collection":return yield*this.flowCollection(n);case"doc-end":return yield*this.documentEnd(n)}yield*this.pop()}peek(n){return this.stack[this.stack.length-n]}*pop(n){const s=n??this.stack.pop();if(!s)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield s;else{const a=this.peek(1);switch(s.type==="block-scalar"?s.indent="indent"in a?a.indent:0:s.type==="flow-collection"&&a.type==="document"&&(s.indent=0),s.type==="flow-collection"&&Qv(s),a.type){case"document":a.value=s;break;case"block-scalar":a.props.push(s);break;case"block-map":{const o=a.items[a.items.length-1];if(o.value){a.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(o.sep)o.value=s;else{Object.assign(o,{key:s,sep:[]}),this.onKeyLine=!o.explicitKey;return}break}case"block-seq":{const o=a.items[a.items.length-1];o.value?a.items.push({start:[],value:s}):o.value=s;break}case"flow-collection":{const o=a.items[a.items.length-1];!o||o.value?a.items.push({start:[],key:s,sep:[]}):o.sep?o.value=s:Object.assign(o,{key:s,sep:[]});return}default:yield*this.pop(),yield*this.pop(s)}if((a.type==="document"||a.type==="block-map"||a.type==="block-seq")&&(s.type==="block-map"||s.type==="block-seq")){const o=s.items[s.items.length-1];o&&!o.sep&&!o.value&&o.start.length>0&&Zv(o.start)===-1&&(s.indent===0||o.start.every(c=>c.type!=="comment"||c.indent<s.indent))&&(a.type==="document"?a.end=o.start:a.items.push({start:o.start}),s.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const n={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&n.start.push(this.sourceToken),this.stack.push(n);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(n){if(n.value)return yield*this.lineEnd(n);switch(this.type){case"doc-start":{Zv(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=Vc(this.peek(2)),a=Ka(s);let o;n.end?(o=n.end,o.push(this.sourceToken),delete n.end):o=[this.sourceToken];const c={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:a,key:n,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(n)}*blockScalar(n){switch(this.type){case"space":case"comment":case"newline":n.props.push(this.sourceToken);return;case"scalar":if(n.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let s=this.source.indexOf(`
|
|
150
|
-
`)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
|
|
151
|
-
`,s)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(n){const s=n.items[n.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):n.items.push({start:[this.sourceToken]})}else s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)n.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,n.indent)){const o=n.items[n.items.length-2]?.value?.end;if(Array.isArray(o)){gu(o,s.start),o.push(this.sourceToken),n.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=n.indent){const a=!this.onKeyLine&&this.indent===n.indent,o=a&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(o&&s.sep&&!s.value){const u=[];for(let d=0;d<s.sep.length;++d){const h=s.sep[d];switch(h.type){case"newline":u.push(d);break;case"space":break;case"comment":h.indent>n.indent&&(u.length=0);break;default:u.length=0}}u.length>=2&&(c=s.sep.splice(u[1]))}switch(this.type){case"anchor":case"tag":o||s.value?(c.push(this.sourceToken),n.items.push({start:c}),this.onKeyLine=!0):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"explicit-key-ind":!s.sep&&!s.explicitKey?(s.start.push(this.sourceToken),s.explicitKey=!0):o||s.value?(c.push(this.sourceToken),n.items.push({start:c,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(s.explicitKey)if(s.sep)if(s.value)n.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ps(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(KS(s.key)&&!ps(s.sep,"newline")){const u=Ka(s.start),d=s.key,h=s.sep;h.push(this.sourceToken),delete s.key,delete s.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:d,sep:h}]})}else c.length>0?s.sep=s.sep.concat(c,this.sourceToken):s.sep.push(this.sourceToken);else if(ps(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const u=Ka(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]}):ps(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&&!ps(s.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else a&&n.items.push({start:c});this.stack.push(u);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(n){const s=n.items[n.items.length-1];switch(this.type){case"newline":if(s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):n.items.push({start:[this.sourceToken]})}else s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)n.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(s.start,n.indent)){const o=n.items[n.items.length-2]?.value?.end;if(Array.isArray(o)){gu(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||ps(s.start,"seq-item-ind")?n.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>n.indent){const a=this.startBlockValue(n);if(a){this.stack.push(a);return}}yield*this.pop(),yield*this.step()}*flowCollection(n){const s=n.items[n.items.length-1];if(this.type==="flow-error-end"){let a;do yield*this.pop(),a=this.peek(1);while(a?.type==="flow-collection")}else if(n.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!s||s.sep?n.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return;case"map-value-ind":!s||s.value?n.items.push({start:[],key:null,sep:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!s||s.value?n.items.push({start:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);!s||s.value?n.items.push({start:[],key:o,sep:[]}):s.sep?this.stack.push(o):Object.assign(s,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":n.end.push(this.sourceToken);return}const a=this.startBlockValue(n);a?this.stack.push(a):(yield*this.pop(),yield*this.step())}else{const a=this.peek(2);if(a.type==="block-map"&&(this.type==="map-value-ind"&&a.indent===n.indent||this.type==="newline"&&!a.items[a.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&a.type!=="flow-collection"){const o=Vc(a),c=Ka(o);Qv(n);const u=n.end.splice(1,n.end.length);u.push(this.sourceToken);const d={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:c,key:n,sep:u}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=d}else yield*this.lineEnd(n)}}flowScalar(n){if(this.onNewLine){let s=this.source.indexOf(`
|
|
152
|
-
`)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
|
|
153
|
-
`,s)+1}return{type:n,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(n){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const s=Vc(n),a=Ka(s);return a.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const s=Vc(n),a=Ka(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(n,s){return this.type!=="comment"||this.indent<=s?!1:n.every(a=>a.type==="newline"||a.type==="space")}*documentEnd(n){this.type!=="doc-mode"&&(n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(n){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function ZS(e){const n=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||n&&new XS||null,prettyErrors:n}}function c3(e,n={}){const{lineCounter:s,prettyErrors:a}=ZS(n),o=new Dm(s?.addNewLine),c=new zm(n),u=Array.from(c.compose(o.parse(e)));if(a&&s)for(const d of u)d.errors.forEach(mu(e,s)),d.warnings.forEach(mu(e,s));return u.length>0?u:Object.assign([],{empty:!0},c.streamInfo())}function QS(e,n={}){const{lineCounter:s,prettyErrors:a}=ZS(n),o=new Dm(s?.addNewLine),c=new zm(n);let u=null;for(const d of c.compose(o.parse(e),!0,e.length))if(!u)u=d;else if(u.options.logLevel!=="silent"){u.errors.push(new Vs(d.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return a&&s&&(u.errors.forEach(mu(e,s)),u.warnings.forEach(mu(e,s))),u}function u3(e,n,s){let a;typeof n=="function"?a=n:s===void 0&&n&&typeof n=="object"&&(s=n);const o=QS(e,s);if(!o)return null;if(o.warnings.forEach(c=>mS(o.options.logLevel,c)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:a},s))}function f3(e,n,s){let a=null;if(typeof n=="function"||Array.isArray(n)?a=n:s===void 0&&n&&(s=n),typeof s=="string"&&(s=s.length),typeof s=="number"){const o=Math.round(s);s=o<1?void 0:o>8?{indent:8}:{indent:o}}if(e===void 0){const{keepUndefined:o}=s??n??{};if(!o)return}return ea(e)&&!a?e.toString(s):new Tl(e,a,s).toString(s)}const na=Object.freeze(Object.defineProperty({__proto__:null,Alias:Ou,CST:l3,Composer:zm,Document:Tl,Lexer:GS,LineCounter:XS,Pair:Bt,Parser:Dm,Scalar:Ae,Schema:Hu,YAMLError:Om,YAMLMap:fn,YAMLParseError:Vs,YAMLSeq:bs,YAMLWarning:jS,isAlias:Ps,isCollection:at,isDocument:ea,isMap:El,isNode:lt,isPair:it,isScalar:Qe,isSeq:Nl,parse:u3,parseAllDocuments:c3,parseDocument:QS,stringify:f3,visit:ta,visitAsync:Mu},Symbol.toStringTag,{value:"Module"}));function FS(e){if(!(typeof e!="string"||!/^https?:\/\/[^/@]/i.test(e)||/[\s\u0000-\u001f\u007f\\]/u.test(e)))try{const n=new URL(e);return!["https:","http:"].includes(n.protocol)||!n.hostname||n.username||n.password||e.split(/[/?#]/)[2].includes("@")?void 0:e}catch{return}}function JS(e,n=""){if(!e||typeof e!="object"||Array.isArray(e)||!Object.hasOwn(e,"url"))return{link:{},issues:[]};const s=e,a=FS(s.url);if(s.type!=="system"&&a!==void 0)return{link:{url:a},issues:[]};const o=s.type==="system"?"screen.url is only supported on user screens.":"screen.url must be an absolute HTTP or HTTPS URL without credentials, whitespace, or control characters.";return{link:{},issues:[{check:"L10",path:n,message:o}]}}function Ro(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function $n(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function d3(e,n,s){let a;try{a=na.parse(e)}catch(c){return[{check:"F1",path:n,message:`Invalid YAML: ${c instanceof Error?c.message:String(c)}`}]}if(!Ro(a))return[];const o=s==="slice"?JS(a.screen,n).issues:[];return a.kind!==void 0&&a.kind!==s&&o.push({check:"F1",path:n,message:`Expected kind "${s}", received "${String(a.kind)}".`}),a.schema_version!==void 0&&a.schema_version!==1&&o.push({check:"F1",path:n,message:`Unsupported schema_version "${String(a.schema_version)}". Supported version is 1.`}),a.kind===void 0!=(a.schema_version===void 0)&&o.push({check:"F1",path:n,message:"kind and schema_version must be supplied together."}),o}function h3(e){const n=[],s=[],a=[],o=new Set;for(const c of e){const u=v=>a.push({check:"F1",path:c.path,message:v});let d;try{d=na.parse(c.content)}catch(v){u(`Invalid feature YAML: ${v instanceof Error?v.message:String(v)}`);continue}if(!Ro(d)){u("Feature document must be a mapping.");continue}if(d.kind!=="feature"||d.schema_version!==1){u('Feature document requires kind "feature" and schema_version 1.');continue}if(!$n(d.id)){u("Feature requires a nonempty string id.");continue}if(o.has(d.id)){u(`Duplicate feature id "${d.id}".`);continue}o.add(d.id);const h=a.length;$n(d.name)||u("Feature name must be a nonempty string without surrounding whitespace.");const p=$n(d.name)?d.name:c.path,y=new Map;if(!Array.isArray(d.stories))u("Feature stories must be an array.");else for(const v of d.stories){if(!Ro(v)||!$n(v.id)){u("Each story requires a nonempty string id.");continue}if(y.has(v.id)){u(`Duplicate story id "${v.id}".`);continue}$n(v.name)||u(`Story "${v.id}" requires a nonempty name.`);const x=[];if(!Array.isArray(v.slices))u(`Story "${v.id}" slices must be an array.`);else for(const A of v.slices){if(!$n(A)||A.startsWith("/")||/^[A-Za-z]:/.test(A)||A.includes("\\")||A.split("/").includes("..")){u(`Story "${v.id}" slice references must be project-relative paths without parent traversal.`);continue}const T=A.split("/").filter(C=>C&&C!==".").join("/");if(!T){u(`Story "${v.id}" slice reference must identify a file, not the project root.`);continue}x.includes(T)?u(`Story "${v.id}" repeats slice "${T}".`):x.push(T)}const E={id:JSON.stringify([d.id,v.id]),localId:v.id,featureName:p,name:$n(v.name)?v.name:v.id,description:typeof v.description=="string"?v.description:"",path:c.path,slices:x};y.set(v.id,E),n.push(E)}if(a.length>h)continue;if(!Array.isArray(d.timelines)){u("Feature timelines must be an array.");continue}const g=new Set;for(const v of d.timelines){const x=a.length;if(!Ro(v)||!$n(v.id)){u("Each timeline requires a nonempty string id.");continue}if(g.has(v.id)){u(`Duplicate timeline id "${v.id}".`);continue}if(g.add(v.id),$n(v.name)||u(`Timeline "${v.id}" requires a nonempty name.`),!Array.isArray(v.steps)||v.steps.length===0){u(`Timeline "${v.id}" steps must be a nonempty array.`);continue}const E=[],A=new Set,T=new Set,C=new Set;for(const _ of v.steps){if(!Ro(_)||!$n(_.id)){u(`Timeline "${v.id}" requires a string id for every step.`);continue}A.has(_.id)&&u(`Timeline "${v.id}" repeats step id "${_.id}".`),A.add(_.id);const N=typeof _.story=="string"?y.get(_.story):void 0;if(!N){u(`Timeline "${v.id}" step "${_.id}" references unknown story "${String(_.story)}".`);continue}T.has(N.id)&&u(`Timeline "${v.id}" repeats story "${_.story}". Use separate timelines for alternative presentations.`),T.add(N.id);for(const D of N.slices)C.has(D)&&u(`Timeline "${v.id}" repeats slice "${D}" across stories.`),C.add(D);const j=[];if(_.after!==void 0)if(!Array.isArray(_.after)||!_.after.every($n))u(`Timeline "${v.id}" step "${_.id}" after must be an array of step ids.`);else for(const D of _.after)j.includes(D)?u(`Step "${_.id}" repeats predecessor "${D}".`):j.push(D);E.push({id:_.id,storyId:N.id,after:j})}for(const _ of E)for(const N of _.after)A.has(N)||u(`Step "${_.id}" references unknown predecessor "${N}".`);const k=new Set(E.map(_=>_.id));for(;k.size>0;){const _=E.filter(N=>k.has(N.id)&&N.after.every(j=>!k.has(j)));if(_.length===0){u(`Timeline "${v.id}" contains a layout cycle involving ${[...k].join(", ")}.`);break}for(const N of _)k.delete(N.id)}a.length===x&&s.push({id:JSON.stringify([d.id,v.id]),name:v.name,path:c.path,steps:E})}}return{stories:n,timelines:s,modelIssues:a}}const Fv=["#2563EB","#7C3AED","#0F766E","#B45309","#BE185D","#4338CA","#047857","#9F1239"];function Zh(e){let n=0;for(const s of e)n=Math.imul(n,31)+s.codePointAt(0)>>>0;return Fv[n%Fv.length]}function m3(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 a of e)typeof a!="string"||!a.trim()||a!==a.trim()?s.push("screen.actors IDs must be nonempty strings without surrounding whitespace."):n.includes(a)?s.push(`screen.actors lists "${a}" more than once.`):n.push(a);return{actors:n,...s.length?{actorIssues:s}:{}}}function p3(e,n,s){const a=new Map,o=[],c=(d,h=n)=>o.push({message:d,path:h});if(e!==void 0){let d;try{d=na.parse(e)}catch(h){c(`Invalid actor registry: ${h instanceof Error?h.message:String(h)}`)}if(!d||typeof d!="object"||Array.isArray(d)||!("actors"in d)||!d.actors||typeof d.actors!="object"||Array.isArray(d.actors))c("Actor registry must contain an actors mapping.");else for(const[h,p]of Object.entries(d.actors)){if(!h.trim()||h!==h.trim()){c("Actor IDs must be nonempty strings without surrounding whitespace.");continue}if(!p||typeof p!="object"||Array.isArray(p)){c(`Actor "${h}" must be a mapping with optional name and color.`);continue}const y=p;let g=h,v=Zh(h);y.name!==void 0&&(typeof y.name!="string"||!y.name.trim()?c(`Actor "${h}" name must be a nonempty string.`):g=y.name.trim()),y.color!==void 0&&(typeof y.color!="string"||!/^#[0-9a-f]{6}$/i.test(y.color)?c(`Actor "${h}" color must be a quoted #RRGGBB value.`):v=y.color.toUpperCase()),a.set(h,{id:h,name:g,color:v})}}const u=new Set(a.keys());for(const d of s){for(const h of d.screen.actorIssues??[])c(h,d.path);if(d.screen.type==="user")for(const h of d.screen.actors)e!==void 0&&!u.has(h)&&c(`screen.actors references undefined actor "${h}".`,d.path),a.has(h)||a.set(h,{id:h,name:h,color:Zh(h)})}return{actors:[...a.values()],actorIssues:o}}function Ss(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 WS(e){return`story_${Ss(e).replaceAll("-","_")}`}function PS(e){return`slc_${Ss(e).replaceAll("-","_")}`}function ew(e){return`scr_${Ss(e).replaceAll("-","_")}`}function tw(e){return`cmd_${Ss(e).replaceAll("-","_")}`}function nw(e){return`qry_${Ss(e).replaceAll("-","_")}`}function eu(e){return`evt_${Ss(e).replaceAll("-","_")}`}function iw(e,n,s){const a=s?Ss(s):`case-${n+1}`;return`gwt_${Ss(e).replaceAll("-","_")}_${a.replaceAll("-","_")}`}function g3(e,n,s){return`${e}:${n}->${s}`}function y3(e){const n=new Map,s=(a,o)=>{const c=n.get(a)??new Set;c.add(JSON.stringify(o)),n.set(a,c)};for(const a of e.stories)s(WS(a.id??a.path),[a.id??a.path]);for(const a of e.events)s(eu(a.name),[a.name]);for(const a of e.slices)s(PS(a.path),[a.path]),s(ew(a.path),[a.path]),a.commands.forEach((o,c)=>{s(tw(o.name),ll(a.path,a.commands,c));for(const u of o.produces)s(eu(u),[u])}),a.queries.forEach((o,c)=>{s(nw(o.name),ll(a.path,a.queries,c));for(const u of o.fromEvents)s(eu(u),[u])}),a.gwt.forEach((o,c)=>{s(iw(a.path,c,o.name),ll(a.path,a.gwt,c))});return(a,o)=>n.get(a).size===1?a:`${a}~${encodeURIComponent(JSON.stringify(o))}`}function ll(e,n,s){const a=n[s].name,o=n.slice(0,s).filter(c=>c.name===a).length;return[e,a??"",String(o)]}function v3(e){const n=[],s=new Map,a=y3(e),o=d=>a(eu(d),[d]),c=new Map,u=(d,h,p,y)=>{const g=g3(d,h,p);s.set(g,{id:g,kind:d,source:h,target:p,...y===void 0?{}:{label:y}})};for(const d of e.stories){const h=a(WS(d.id??d.path),[d.id??d.path]);for(const p of new Set(d.slices))c.set(p,[...c.get(p)??[],h]);n.push({id:h,type:"story",label:d.name,storyId:d.id,sourceName:d.localId,sourcePath:d.path,description:d.description})}for(const d of e.events)n.push({id:o(d.name),type:"event",label:d.name,sourceName:d.name,sourcePath:d.sourcePath,fields:d.fields,description:d.description});for(const d of e.slices){const h=a(PS(d.path),[d.path]),p=a(ew(d.path),[d.path]),y={storyName:d.storyName,storyId:d.storyId,sliceTitle:d.title,sourcePath:d.path,raw:d.raw};n.push({...y,id:h,type:"slice",label:d.title});for(const g of c.get(d.path)??[])u("story-slice",g,h);n.push({...y,id:p,type:d.screen.type==="system"?"processor":"screen",label:d.screen.name??(d.screen.type==="system"?"Processor":"Screen"),actors:d.screen.actors,...d.screen.type==="user"?{actorDefinitions:d.screen.actors.map(g=>e.actors?.find(v=>v.id===g)).filter(g=>!!g)}:{},...d.screen.url===void 0?{}:{url:d.screen.url},screenType:d.screen.type}),u("slice-screen",h,p),d.queries.forEach((g,v)=>{const x=a(nw(g.name),ll(d.path,d.queries,v));n.push({...y,id:x,type:"query",label:g.name,sourceName:g.name,fields:g.fields}),d.screen.reads.includes(g.name)&&u("query-screen",x,p);for(const E of g.fromEvents)u("event-query",o(E),x,E)}),d.commands.forEach((g,v)=>{const x=a(tw(g.name),ll(d.path,d.commands,v));n.push({...y,id:x,type:"command",label:g.name,sourceName:g.name,fields:g.fields}),d.screen.executes.includes(g.name)&&u("screen-command",p,x);for(const E of g.produces)u("command-event",x,o(E),E)}),d.gwt.forEach((g,v)=>{n.push({...y,id:a(iw(d.path,v,g.name),ll(d.path,d.gwt,v)),type:"gwt",label:g.name??`Case ${v+1}`,sourceName:g.name,description:g.description,given:g.given,when:g.when,then:g.then})})}return{nodes:n,edges:[...s.values()]}}function tl(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 sw(e,n=""){const s=tl(e).split("/").at(-1)??e;return n&&s.endsWith(n)?s.slice(0,-n.length):s}function nr(e){return Array.isArray(e)?e.filter(n=>typeof n=="string"):[]}function b3(e,n){const s=na.parse(n),a=s?.events&&typeof s.events=="object"?s.events:s??{};return Object.entries(a).map(([o,c])=>({name:o,fields:typeof c?.fields=="string"?c.fields:void 0,description:typeof c?.description=="string"?c.description:void 0,sourcePath:e}))}function S3(e,n){const s=na.parse(n);return{name:typeof s?.name=="string"?s.name:sw(e,".yaml"),description:typeof s?.description=="string"?s.description:"",path:e,slices:nr(s?.slices).map(tl)}}function w3(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:nr(n.produces)})):[]}function x3(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:nr(n.from_events)})):[]}function E3(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 N3(e){return{type:e?.type==="system"?"system":"user",name:typeof e?.name=="string"?e.name:void 0,...m3(e?.actors),...JS(e).link,reads:nr(e?.reads),executes:nr(e?.executes)}}function _3(e,n,s){const a=na.parse(n);return{title:typeof a?.slice=="string"?a.slice:sw(e),path:e,storyName:s.get(e)?.name,storyId:s.get(e)?.id,screen:N3(a?.screen),commands:w3(a?.commands),queries:x3(a?.queries),gwt:E3(a?.gwt),raw:n}}function A3(e,n={}){const s=new Map(e.map(U=>[tl(U.path),U.content])),a=s.get(".event-modeling/config.yaml"),o=a?na.parse(a):null,c=o?.paths?.event_model_dir??"event-model",u=o?.paths?.features_dir??"event-model/features",d=o?.paths?.slice_extension??".slice.yaml",h=o?.paths?.events_file??`${c}/events.yaml`,p=tl(o?.paths?.actors_file??`${c}/actors.yaml`),y=o?.paths?.stories_dir??`${c}/stories`,g=s.get(h);if(g===void 0)throw new Error(`Missing events file: ${h}`);const v=b3(h,g),x=h3([...s.entries()].filter(([U])=>(u===""||U.startsWith(`${u}/`))&&U.endsWith(".feature.yaml")).sort(([U],[q])=>U<q?-1:U>q?1:0).map(([U,q])=>({path:U,content:q}))),E=[...s.entries()].filter(([U])=>U.split("/").slice(0,-1).join("/")===y&&U.endsWith(".yaml")).sort(([U],[q])=>U.localeCompare(q)).map(([U,q])=>S3(U,q));E.push(...x.stories);const A=new Map;for(const U of E)for(const q of U.slices)A.set(tl(q),U);const T=E.flatMap(U=>U.slices.map(tl)),C=[...s.keys()].filter(U=>(u===""||U.startsWith(`${u}/`))&&U.endsWith(d)),_=[...new Set([...T,...C])].sort().filter(U=>s.has(U)).map(U=>_3(U,s.get(U)??"",A)),N=p3(s.get(p),p,_),j=[{path:h,kind:"events"},...E.filter(U=>!U.id).map(U=>({path:U.path,kind:"story"})),..._.map(U=>({path:U.path,kind:"slice"})),...s.has(p)?[{path:p,kind:"actors"}]:[]],D=[...x.modelIssues,...j.flatMap(U=>d3(s.get(U.path)??"",U.path,U.kind))],B={root:n.root??"browser-import",config:{language:o?.language,paths:{eventModelDir:c,featuresDir:u,sliceExtension:d,eventsFile:h,actorsFile:p,storiesDir:y}},events:v,stories:E,timelines:x.timelines,modelIssues:D,slices:_,...N},R=v3(B);return{...B,...R}}function aw(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:Zh(s)})}function lw(e,n={}){const s=new Map(e.actors?.map(a=>[a.id,a]));for(const a of[...e.nodes,...Object.values(n)])for(const o of aw(a))s.has(o.id)||s.set(o.id,o);return[...s.values()]}function T3(e,n,s={}){const a=new Set(lw(e,s).map(u=>u.id)),o=n.actorIds.filter(u=>a.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 C3(e,n,s={}){if(n.actorIds.length===0&&!n.includeUnassigned)return{nodeIds:new Set(e.nodes.map(N=>N.id)),relatedNodeIds:new Set};const a=new Set(n.actorIds),o=new Map(e.nodes.map(N=>[N.id,N])),c=new Map;for(const N of e.nodes)N.type==="story"||N.type==="event"||N.sourcePath&&c.set(N.id,N.sourcePath);const u=e.edges.filter(N=>["slice-screen","query-screen","screen-command"].includes(N.kind)),d=()=>{let N=!0;for(;N;){N=!1;for(const j of u){const D=c.get(j.source),B=c.get(j.target);D&&!B?(c.set(j.target,D),N=!0):B&&!D&&(c.set(j.source,B),N=!0)}}};d();for(const N of e.nodes)N.type==="slice"&&!c.has(N.id)&&c.set(N.id,N.id);d();for(const N of e.nodes)(N.type==="screen"||N.type==="processor")&&!c.has(N.id)&&c.set(N.id,N.id);d();const h=N=>N?.type==="screen"&&((N.actors??[]).some(j=>a.has(j))||n.includeUnassigned&&!N.actors?.length),p=e.nodes.filter(N=>h(N)||h(s[N.id])),y=new Set(p.flatMap(N=>{const j=c.get(N.id);return j?[j]:[]})),g=new Set(p.map(N=>N.id));for(const[N,j]of c)y.has(j)&&g.add(N);const v=e.edges.filter(N=>N.kind==="command-event"||N.kind==="event-query"),x=N=>{const j=new Set;for(const D of v)N.has(D.source)&&o.get(D.target)?.type==="event"&&j.add(D.target),N.has(D.target)&&o.get(D.source)?.type==="event"&&j.add(D.source);return j},E=x(g),A=new Set,T=new Set(e.nodes.filter(N=>N.type==="processor").map(N=>c.get(N.id)));for(const N of v){const j=E.has(N.source)?N.target:E.has(N.target)?N.source:void 0,D=j?c.get(j):void 0;D&&T.has(D)&&!y.has(D)&&A.add(D)}const C=new Set;for(const[N,j]of c)A.has(j)&&C.add(N);for(const N of x(C))E.has(N)||C.add(N);const k=new Set([...g,...E,...C]),_=new Set(e.nodes.filter(N=>k.has(N.id)&&N.type!=="event").map(Wt));for(const N of e.nodes)N.type==="story"&&_.has(N.storyId??N.label)&&k.add(N.id);return{nodeIds:k,relatedNodeIds:C}}const Hn=180,ti=80,Qh=80,ii=430,ol=390,yu=130,Tn=178,Jv=92,Fh=300,Jh=170,Io=18,Wh=48,_h=30,qo=92,ow=38,M3=42,Wv=154,Pv=278,rw=408;function O3(e){return e==="slice-screen"||e==="story-slice"?"#cbd5e1":"#64748b"}function k3(e){if(e==="added")return"#15803d";if(e==="removed")return"#b91c1c";if(e==="changed")return"#b45309"}function z3(e){return e.type==="event"?{sourcePosition:pe.Right,targetPosition:pe.Left}:{sourcePosition:pe.Bottom,targetPosition:pe.Top}}function D3(e){return new Map(e.stories.map((n,s)=>[en(n),s]))}function rl(e,n){return e===0?0:e*n+(e-1)*Io}function tu(e,n,s){const a=e.slices.find(o=>o.path===n);return e.nodes.filter(o=>o.type===s&&(o.sourcePath?o.sourcePath===n:o.sliceTitle===a?.title))}function j3(e,n,s){const a=new Set(tu(e,s,"command").map(c=>c.id));return[...new Set(e.edges.filter(c=>c.kind==="command-event"&&a.has(c.source)&&e.edges.find(u=>u.kind==="command-event"&&u.target===c.target)?.id===c.id).map(c=>c.target))].map(c=>n.get(c)).filter(c=>!!c)}function R3(e,n){return new Map(e.slices.map(s=>{const a=tu(e,s.path,"query"),o=tu(e,s.path,"command"),c=j3(e,n,s.path),u=tu(e,s.path,"gwt"),d=rl(a.length,Tn),h=rl(o.length,Tn),p=d+h+(d>0&&h>0?Wh:0),y=rl(c.length,Tn),g=u.length?Fh:0,v=Math.max(ii,p+_h*2,y+_h*2,g+_h*2),x=u.length>0?rw+Jh+36:ol;return[s.path,{width:v,height:x,queryIds:a.map(E=>E.id),commandIds:o.map(E=>E.id),eventIds:c.map(E=>E.id),gwtIds:u.map(E=>E.id)}]}))}function B3(e,n,s,a,o=new Set){const c=new Map;let u=ti;for(const d of e.stories){const h=e.slices.filter(E=>s.get(E.path)===en(d)),p=h.reduce((E,A)=>E+(n.get(A.path)?.width??ii),0),y=o.has(en(d)),g=y?ii:Math.max(p+Math.max(h.length-1,0)*yu,ii),v=Math.max(...h.map(E=>n.get(E.path)?.height??ol),ol),x=y?qo:qo+v+ow;c.set(en(d),{x:Hn,y:u,width:g,height:x}),u+=x+Qh}if(a){const d=JM(a);let h=Hn;const p=[...new Set(e.stories.map(y=>d.get(Gn(y))??0))].sort((y,g)=>y-g);for(const y of p){let g=ti,v=0;for(const x of e.stories.filter(E=>d.get(Gn(E))===y)){const E=c.get(en(x));E.x=h,E.y=g,g+=E.height+Qh,v=Math.max(v,E.width)}h+=v+yu}}return c}function L3(e,n,s,a,o,c){const u=rl(e.length,c),d=s.x+(a-u)/2;e.forEach((h,p)=>{n.set(h,{x:d+p*(c+Io),y:s.y+o})})}function $3(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 H3(e,n,s="all"){if(!n||s==="all")return new Set(e.stories.map(Gn));if(s==="story")return new Set([n]);const a=new Set([n]),o=new Set(e.nodes.filter(u=>Wt(u)===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(d=>d.id===u)?.type==="event"));for(const u of e.edges){if(!c.has(u.source)&&!c.has(u.target))continue;const d=e.nodes.find(p=>p.id===u.source),h=e.nodes.find(p=>p.id===u.target);d&&Wt(d)&&a.add(Wt(d)),h&&Wt(h)&&a.add(Wt(h))}return a}function U3(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 I3(e,n,s,a,o,c,u){const d=U3(e),h=c??!!(n?.sliceTitle&&n.sliceTitle===s?.sliceTitle);if(e==="event-query"&&h)return{...d,route:"same-slice-read"};if(!(e==="event-query"&&!h)||!a||!o)return{...d,route:"semantic"};const y=a.x+a.width/2,g=a.y+a.height/2,v=o.x+o.width/2,x=o.y+o.height/2;return{sourceSide:(u??!!(n&&s&&Wt(n)&&Wt(n)===Wt(s)))||x>=g?"bottom":"top",targetSide:v>=y?"left":"right",route:"event-read"}}function eb(e,n,s={}){const a=e.timelines?.find(w=>w.id===s.timelineId);e=FM(e,a);const o=new Map(e.nodes.map(w=>[w.id,w]));e={...e,nodes:e.nodes.map(w=>{if(w.type!=="event")return w;const z=e.edges.find(F=>F.kind==="command-event"&&F.target===w.id);return{...w,storyName:z?o.get(z.source)?.storyName:a?void 0:w.storyName,storyId:z?o.get(z.source)?.storyId:a?void 0:w.storyId}})};const c=WM(e,!!a),u=s.actorFilter??{actorIds:[],includeUnassigned:!1},d=C3(e,u,s.previousNodes),h=u.actorIds.length>0||u.includeUnassigned,p=new Set(e.nodes.filter(w=>w.type==="slice"&&d.nodeIds.has(w.id)).map(w=>c.sliceByNode.get(w.id))),y=h?{...e,stories:e.stories.filter(w=>e.nodes.some(z=>z.type==="story"&&d.nodeIds.has(z.id)&&c.stableStoryByNode.get(z.id)===en(w))),slices:e.slices.filter(w=>p.has(w.path)),nodes:e.nodes.filter(w=>d.nodeIds.has(w.id)),edges:e.edges.filter(w=>d.nodeIds.has(w.source)&&d.nodeIds.has(w.target))}:e,g=D3(y),v=new Map(e.nodes.map(w=>[w.id,w])),x=new Map(y.nodes.map(w=>[w.id,w])),E=R3(y,x),A=new Set(e.slices.map(w=>w.path)),T=new Map(e.stories.map(w=>[en(w),new Set(w.slices.filter(z=>A.has(z))).size])),C=s.collapsedStoryIds??new Set,k=new Map;for(const w of e.nodes){const z=c.stableStoryByNode.get(w.id);w.type==="story"&&z&&k.set(z,w.id)}const _=w=>w?.sourcePath??e.slices.find(z=>z.title===(w?.sliceTitle??w?.label))?.path??"",N=B3(y,E,c.stableStoryBySlice,a,C),j=new Map,D=new Map,B=new Map,R=new Set,U=H3(e,s.focusedStory,s.scope??"all"),q=$3(s.edgeDetail??"normal");if(n){R.add(n);for(const w of e.edges)w.source===n&&R.add(w.target),w.target===n&&R.add(w.source)}const Y=new Map;for(const w of y.stories){const z=en(w);Y.set(z,N.get(z)?.x??Hn)}for(const w of y.stories){const z=en(w);for(const F of new Set(w.slices)){const P=y.slices.find(ie=>ie.path===F);if(!P||c.stableStoryBySlice.get(P.path)!==z)continue;const fe=N.get(z)??{y:ti},de=Y.get(z)??Hn;B.set(P.path,{x:de,y:fe.y+qo}),Y.set(z,de+(E.get(P.path)?.width??ii)+yu)}}for(const w of y.slices){if(B.has(w.path))continue;const z=c.stableStoryBySlice.get(w.path)??"",F=N.get(z)?.y??ti+(g.get(z)??0)*(ol+qo+ow+Qh),P=Hn;B.set(w.path,{x:P,y:F+qo})}for(const w of y.nodes){if(w.type==="story"){const z=N.get(c.stableStoryByNode.get(w.id)??"");j.set(w.id,{x:(z?.x??Hn)-20,y:z?.y??ti})}if(w.type==="slice"){const z=B.get(_(w))??{x:Hn,y:ti};j.set(w.id,z)}if(w.type==="screen"||w.type==="processor"){const z=B.get(_(w))??{x:Hn,y:ti},P=E.get(_(w))?.width??ii;j.set(w.id,{x:z.x+(P-Tn)/2,y:z.y+M3})}}for(const w of y.slices){const z=B.get(w.path)??{x:Hn,y:ti},F=E.get(w.path),P=F?.width??ii;if(!F)continue;const fe=rl(F.queryIds.length,Tn),de=rl(F.commandIds.length,Tn),ie=fe+de+(fe>0&&de>0?Wh:0);let te=z.x+(P-ie)/2;F.queryIds.forEach((oe,ve)=>{j.set(oe,{x:te+ve*(Tn+Io),y:z.y+Wv})}),fe>0&&(te+=fe+(de>0?Wh:0)),F.commandIds.forEach((oe,ve)=>{j.set(oe,{x:te+ve*(Tn+Io),y:z.y+Wv})}),L3(F.eventIds,j,z,P,Pv,Tn);for(const oe of F.gwtIds)j.set(oe,{x:z.x+(P-Fh)/2,y:z.y+rw})}let Z=0;for(const w of y.nodes.filter(z=>z.type==="event")){const z=y.edges.find(P=>P.kind==="command-event"&&P.target===w.id),F=z?x.get(z.source):void 0;if(!j.has(w.id)){if((a||h)&&!F){j.set(w.id,{x:Hn-Tn-yu,y:ti+Z++*(Jv+Io)});continue}const P=B.get(_(F))??{x:Hn,y:ti},fe=E.get(_(F));j.set(w.id,{x:P.x+((fe?.width??ii)-Tn)/2,y:P.y+Pv})}}const le=new Set,L=e.nodes.map(w=>{const z=j.get(w.id)??{x:0,y:0},F=w.type==="story"||w.type==="slice",P=c.stableStoryByNode.get(w.id),fe=w.type==="story"?N.get(P??"")?.width??ii:E.get(_(w))?.width??ii,de=w.type==="story"?N.get(P??"")?.height??ol:E.get(_(w))?.height??ol,ie=F?fe:w.type==="gwt"?Fh:Tn,te=F?de:w.type==="gwt"?Jh:Jv;D.set(w.id,{x:z.x,y:z.y,width:ie,height:te});const oe=w.type==="gwt"?e.nodes.filter(me=>me.type==="gwt"&&(w.sourcePath?me.sourcePath===w.sourcePath:me.sliceTitle===w.sliceTitle)).filter(me=>d.nodeIds.has(me.id)&&(!Wt(me)||U.has(Wt(me)))).filter(me=>!s.diffFilter||s.diffFilter==="all"||s.diffNodeStatus?.[me.id]===s.diffFilter):void 0,ve=!!(P&&C.has(P)),Se=!d.nodeIds.has(w.id)||!!(oe&&oe[0]?.id!==w.id)||!!(c.storyByNode.get(w.id)&&!U.has(c.storyByNode.get(w.id)))||!!(!oe&&s.diffFilter&&s.diffFilter!=="all"&&s.diffNodeStatus?.[w.id]!==s.diffFilter);return Se||le.add(w.id),{id:w.id,type:F?"groupNode":"eventModelNode",position:z,initialWidth:F||w.type==="gwt"?ie:void 0,initialHeight:F||w.type==="gwt"?te:void 0,selectable:!0,draggable:!1,data:{projectNode:w,storyId:P,collapsed:w.type==="story"?ve:void 0,sliceCount:w.type==="story"?T.get(P??"")??0:void 0,scenarios:oe,scenarioStatus:s.diffNodeStatus,selectedScenarioId:n,selected:w.id===n||!!oe?.some(me=>me.id===n),connected:R.has(w.id),actorRelated:d.relatedNodeIds.has(w.id),diffStatus:s.diffNodeStatus?.[w.id]},hidden:Se||w.type!=="story"&&ve,style:F?{width:fe,height:de,zIndex:w.type==="story"?-20:-10,opacity:d.relatedNodeIds.has(w.id)?.72:1}:{width:ie,height:w.type==="gwt"?Jh:void 0,opacity:d.relatedNodeIds.has(w.id)?.72:1},...z3(w)}});for(const w of L)w.data.projectNode.type!=="story"||!w.data.collapsed||e.nodes.some(z=>z.type!=="story"&&le.has(z.id)&&c.stableStoryByNode.get(z.id)===w.data.storyId)&&(w.hidden=!1);const K=new Set(L.filter(w=>!w.hidden).map(w=>w.id)),O=w=>{const z=c.stableStoryByNode.get(w);return z&&C.has(z)?k.get(z)??w:w},H=n?v.get(n):void 0,X=e.edges.filter(w=>q.has(w.kind)).filter(w=>PM(w,s.edgeVisibility??"auto",H,c)).filter(w=>le.has(w.source)&&le.has(w.target)).filter(w=>K.has(O(w.source))&&K.has(O(w.target))).filter(w=>O(w.source)!==O(w.target)||O(w.source)===w.source&&O(w.target)===w.target).map(w=>{const z=O(w.source),F=O(w.target),P=z!==w.source||F!==w.target,fe=v.get(w.source),de=v.get(w.target),ie=!!s.focusedEdgeIds?.has(w.id),te=s.diffEdgeStatus?.[w.id],oe=k3(te),ve=c.sliceByNode.get(w.source),Se=c.stableStoryByNode.get(w.source),{sourceSide:me,targetSide:ge,route:xe}=P?{sourceSide:"right",targetSide:"left",route:"event-read"}:I3(w.kind,fe,de,D.get(z),D.get(F),!!(ve&&ve===c.sliceByNode.get(w.target)),!!(Se&&Se===c.stableStoryByNode.get(w.target)));return{id:w.id,source:z,target:F,type:"eventModelEdge",sourceHandle:`${me}-source`,targetHandle:`${ge}-target`,data:{kind:w.kind,sourceNodeId:w.source,targetNodeId:w.target,proxy:P,route:xe,active:ie,diffStatus:te,fieldFlow:s.edgeFieldFlows?.get(w.id),selectedFieldName:s.selectedFieldName,onSelectField:s.onSelectField},markerEnd:{type:Qo.ArrowClosed,color:ie?"#111827":oe??O3(w.kind)},label:s.edgeDetail==="verbose"?w.label:void 0,className:`edge ${ie?"edge-active":""} ${te?`edge-diff-${te}`:""}`,hidden:!!(s.diffFilter&&s.diffFilter!=="all"&&te!==s.diffFilter),animated:ie}}),se={stories:0,slices:0,events:0};for(const w of L){const z=w.data.projectNode.type;z==="story"&&!w.hidden&&se.stories++,z==="slice"&&le.has(w.id)&&se.slices++,z==="event"&&le.has(w.id)&&se.events++}return{nodes:L,edges:X,counts:se}}const q3=.2,V3=1.8,tb=16,Y3=.0025;function G3(e,n){const s=e.deltaMode===1?tb:e.deltaMode===2?n.width:1,a=e.deltaMode===1?tb:e.deltaMode===2?n.height:1;return{x:e.deltaX*s,y:e.deltaY*a}}function cw(e,n){return{...e,x:e.x+n.x,y:e.y+n.y}}function uw(e,n,s){if(Number.isNaN(s)||e.zoom<=0)return e;const a=Math.min(V3,Math.max(q3,s)),o=a/e.zoom;return{x:n.x-(n.x-e.x)*o,y:n.y-(n.y-e.y)*o,zoom:a}}function X3(e,n,s,a){const o=G3(n,s);if(!Number.isFinite(o.x)||!Number.isFinite(o.y))return e;if(n.metaKey||n.ctrlKey){const d=Math.max(-1e3,Math.min(1e3,o.y||o.x));return uw(e,a,e.zoom*Math.exp(-d*Y3))}const c=n.shiftKey?o.x||o.y:o.x,u=n.shiftKey?0:o.y;return cw(e,{x:-c,y:-u})}function ir(e){return e instanceof Element?e:null}function nu(e){return!!ir(e)?.closest('input, textarea, select, [role="textbox"], [contenteditable]:not([contenteditable="false"])')}function Ah(e){return!!ir(e)?.closest(".react-flow__controls, .react-flow__panel, [data-canvas-navigation-ignore]")}function nb(e){const n=ir(e)?.closest('button, a[href], summary, [role="button"], [role="tab"], [role="checkbox"], [role="switch"]');return nu(e)||!!(n&&!n.classList.contains("react-flow__node"))}function ib(e){return e.code==="Space"||e.key===" "||e.key==="Spacebar"}function K3({children:e}){const n=V.useRef(null),[s,a]=V.useState("idle"),{getViewport:o,setViewport:c}=fr();return V.useEffect(()=>{const u=n.current;if(!u)return;let d=!1,h=null,p=!1,y=null;const g=()=>{const q=h?.pointerId;h=null,q!==void 0&&u.hasPointerCapture(q)&&u.releasePointerCapture(q),a(d?"ready":"idle")},v=()=>{d=!1,y=null,g()},x=q=>{if(q.key==="Escape"){v();return}if(!ib(q)||q.isComposing||q.altKey||q.ctrlKey||q.metaKey||nb(q.target))return;const Y=ir(q.target);Y&&Y!==document.body&&Y!==document.documentElement&&!u.contains(Y)||(q.preventDefault(),q.stopPropagation(),d=!0,h||a("ready"))},E=q=>{ib(q)&&(d&&q.preventDefault(),v())},A=q=>{(!u.contains(ir(q.target))||nb(q.target))&&v()},T=()=>{document.hidden&&v()},C=q=>{if(h||(p=!1),!(!d||h||q.button!==0||q.isPrimary===!1||q.pointerType==="touch"||nu(q.target)||Ah(q.target))){q.preventDefault(),q.stopImmediatePropagation(),h={pointerId:q.pointerId,x:q.clientX,y:q.clientY},p=!0,a("dragging");try{u.setPointerCapture(q.pointerId)}catch{}}},k=q=>{if(!h||h.pointerId!==q.pointerId)return;if(q.preventDefault(),q.stopImmediatePropagation(),(q.buttons&1)===0){g();return}const Y={x:q.clientX-h.x,y:q.clientY-h.y};h.x=q.clientX,h.y=q.clientY,c(cw(o(),Y))},_=q=>{!h||h.pointerId!==q.pointerId||(q.preventDefault(),q.stopImmediatePropagation(),g())},N=q=>{h?.pointerId===q.pointerId&&g()},j=q=>{!p||q.detail===0||(p=!1,q.preventDefault(),q.stopImmediatePropagation())},D=q=>{if(nu(q.target)||Ah(q.target)||(q.preventDefault(),q.stopImmediatePropagation(),y!==null))return;const Y=u.getBoundingClientRect(),Z={x:q.clientX-Y.left,y:q.clientY-Y.top};c(X3(o(),q,Y,Z))},B=q=>{nu(q.target)||Ah(q.target)||(q.preventDefault(),q.stopImmediatePropagation(),y=o().zoom)},R=q=>{if(y===null)return;q.preventDefault(),q.stopImmediatePropagation();const Y=q;if(!Number.isFinite(Y.scale)||!Y.scale||Y.scale<=0)return;const Z=u.getBoundingClientRect(),le={x:typeof Y.clientX=="number"?Y.clientX-Z.left:Z.width/2,y:typeof Y.clientY=="number"?Y.clientY-Z.top:Z.height/2};c(uw(o(),le,y*Y.scale))},U=q=>{y!==null&&(q.preventDefault(),q.stopImmediatePropagation(),y=null)};return window.addEventListener("keydown",x,!0),window.addEventListener("keyup",E,!0),window.addEventListener("blur",v),window.addEventListener("focusin",A),document.addEventListener("visibilitychange",T),u.addEventListener("pointerdown",C,!0),window.addEventListener("pointermove",k,{capture:!0,passive:!1}),window.addEventListener("pointerup",_,!0),window.addEventListener("pointercancel",_,!0),u.addEventListener("lostpointercapture",N),u.addEventListener("click",j,!0),u.addEventListener("wheel",D,{capture:!0,passive:!1}),u.addEventListener("gesturestart",B,{capture:!0,passive:!1}),u.addEventListener("gesturechange",R,{capture:!0,passive:!1}),u.addEventListener("gestureend",U,{capture:!0,passive:!1}),()=>{window.removeEventListener("keydown",x,!0),window.removeEventListener("keyup",E,!0),window.removeEventListener("blur",v),window.removeEventListener("focusin",A),document.removeEventListener("visibilitychange",T),u.removeEventListener("pointerdown",C,!0),window.removeEventListener("pointermove",k,!0),window.removeEventListener("pointerup",_,!0),window.removeEventListener("pointercancel",_,!0),u.removeEventListener("lostpointercapture",N),u.removeEventListener("click",j,!0),u.removeEventListener("wheel",D,!0),u.removeEventListener("gesturestart",B,!0),u.removeEventListener("gesturechange",R,!0),u.removeEventListener("gestureend",U,!0);const q=h?.pointerId;h=null,q!==void 0&&u.hasPointerCapture(q)&&u.releasePointerCapture(q)}},[o,c]),b.jsxs("main",{ref:n,className:"canvas",tabIndex:-1,"aria-label":"Event model diagram","aria-description":"Hold Space and drag to pan. Scroll to pan, Shift scroll to pan horizontally, Command on Mac or Control on Windows and Linux with scroll to zoom. Pinch to zoom.","data-navigation-mode":s,children:[e,b.jsx("div",{className:"canvas-navigation-help","aria-hidden":"true",children:"Space + drag to pan · Scroll to pan · Shift to pan sideways · ⌘/Ctrl + scroll to zoom"})]})}function fw({node:e,compact:n=!1}){if(e.type!=="screen"||e.screenType==="system")return null;const s=FS(e.url);return s?b.jsxs("a",{className:n?"screen-link screen-link-compact nodrag nopan":"screen-link screen-link-details",href:s,target:"_blank",rel:"noopener noreferrer","data-canvas-navigation-ignore":!0,"aria-label":`Open reference for ${e.label} in a new tab`,title:`Open reference in new tab: ${s}`,onPointerDown:a=>a.stopPropagation(),onClick:a=>a.stopPropagation(),onKeyDown:a=>a.stopPropagation(),onKeyUp:a=>a.stopPropagation(),children:[b.jsx("svg",{viewBox:"0 0 20 20",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:b.jsx("path",{d:"M11 3h6v6M17 3l-9 9M8 4H4a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-4"})}),n?null:b.jsxs("span",{children:["Open reference · ",new URL(s).hostname]})]}):null}function Ws(e,n){return JSON.stringify([e,n.type,n.sourcePath,n.sourceName,n.label,n.sliceTitle])}function Z3(e,n,s,a,o){const c=Ws(n,s);if(o!==void 0&&e[c]?.message!==o)return e;if(a)return{...e,[c]:{sessionId:n,identity:bl(s),message:a}};const u={...e};return delete u[c],u}function bl(e){return{type:e.type,sourcePath:e.sourcePath,sourceName:e.sourceName,label:e.label,sliceTitle:e.sliceTitle}}function Ph(e,n){return e.type===n.type&&e.sourcePath===n.sourcePath&&e.sourceName===n.sourceName&&e.label===n.label&&e.sliceTitle===n.sliceTitle}function sb(e,n){const s=e.nodes.find(a=>a.id===n);return s?{identity:bl(s),nodeId:n,snapshotNodes:e.nodes}:void 0}function ms(e,n){if(!e||!n)return;if(e.nodes===n.snapshotNodes)return e.nodes.find(a=>a.id===n.nodeId&&Ph(a,n.identity));const s=e.nodes.filter(a=>Ph(a,n.identity));return s.length===1?s[0]:void 0}function Q3(e,n){return e.nodes.filter(s=>Ph(s,bl(n))).length===1}function jm(e,n){if(!(!n||e?.nodeStatus[n.id]!=="changed"))return e.previousNodes?.[n.id]??e.previousGwtNodes?.[n.id]}function F3(e,n){if(!n)return e;const s=e.nodes.filter(c=>n.nodeStatus[c.id]!=="added").map(c=>{const u=jm(n,c);return u?{...u,id:c.id}:c}),a=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=>a.has(c.source)&&a.has(c.target));return{...e,nodes:s,edges:o}}function J3(e,n){if(!n)return e;const s=e.nodes.filter(c=>n.nodeStatus[c.id]!=="removed"),a=new Set(s.map(c=>c.id)),o=e.edges.filter(c=>n.edgeStatus[c.id]!=="removed"&&a.has(c.source)&&a.has(c.target));return{...e,nodes:s,edges:o}}function W3(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 P3(e,n,s,a,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[a.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(!Q3(e.project,a))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[a.id])return"This node has no unique current target. Select a current node to add feedback."}const Rm=20,cl=4e3,ek=16e3,tk=128*1024;function Bm(){return{version:1,drafts:{},queue:{items:[]}}}function ab(e,n,s,a){const o=e.currentNodeIds?.[n.id]??n.id;return{id:a,sessionId:e.sessionId,projectRoot:e.project.root,nodeId:o,reference:"em://"+(e.project.graphSidecar?.model?.id??"event_model")+"/"+o,revision:e.revision,identity:bl(n),message:s.trim()}}function Cl(e){if(e.length>Rm)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>cl))return"Each queued message must contain 1 to 4000 characters.";if(e.reduce((s,a)=>s+a.message.length,0)>ek)return"The Queue can contain up to 16000 message characters.";if(e.some(s=>!sr(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:a,reference:o,revision:c,message:u})=>({id:s,nodeId:a,reference:o,revision:c,message:u}))};if(new TextEncoder().encode(JSON.stringify(n)).byteLength>tk)return"This Queue exceeds the 128 KiB request limit. Remove an item before sending."}function Lm(e,n){return!!e.submission?.body.items.some(s=>s.id===n)}function nk(e,n){if(e.items.some(o=>o.id===n.id))return e;const s=[...e.items,n],a=Cl(s);return a?{...e,error:a}:{...e,items:s,error:void 0,notice:void 0}}function ik(e,n,s){if(Lm(e,n))return e;const a=e.items.map(c=>c.id===n?{...c,message:s.trim()}:c),o=Cl(a);return o?{...e,error:o}:{...e,items:a,editing:void 0,error:void 0,notice:void 0}}function sk(e,n){return Lm(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 dw(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=>Ws(n.sessionId,o)===Ws(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 a="em://"+(n.project.graphSidecar?.model?.id??"event_model")+"/"+e.nodeId;if(e.reference!==a)return"The model reference changed. Review and add this feedback again."}function ak(e,n,s,a,o){if(!n||!a)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=>dw(c,n))?"Review the flagged Queue items before sending. Their captured targets have not been changed.":Cl(e.items):"Add feedback to the Queue before sending."}function lk(e,n){return e.submission?.phase==="sending"?e:e.submission?{...e,submission:{...e.submission,phase:"sending"},error:void 0}:!e.items.length||e.editing||Cl(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:a,reference:o,revision:c,message:u})=>({id:s,nodeId:a,reference:o,revision:c,message:u}))}}}}function ok(e,n,s,a){return e.submission?.body.clientBatchId!==n?e:{...e,submission:a?{...e.submission,phase:"uncertain"}:void 0,error:s}}function hw(e,n){if(e.submission?.body.clientBatchId!==n)return e;const s=new Set(e.submission.body.items.map(a=>a.id));return{items:e.items.filter(a=>!s.has(a.id)),editing:e.editing&&!s.has(e.editing.id)?e.editing:void 0,notice:"Feedback sent as one request to your external agent."}}function rk(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 mw(e,n){if(!In(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(sr)||!n.items.every(sr))return!1;const s=n.items;return e.items.every((a,o)=>{const c=s[o];return a.id===c.id&&a.nodeId===c.nodeId&&a.reference===c.reference&&a.revision===c.revision&&a.message===c.message})}function ck(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?mw(o,s.body)?hw(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 In(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function pw(e){return In(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 sr(e){return In(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<=cl}function uk(e){return In(e)&&typeof e.sessionId=="string"&&typeof e.projectRoot=="string"&&pw(e.identity)&&sr(e)}const gw="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 lb(){return{...Bm(),recoveryWarning:gw}}function fk(e){if(!e)return Bm();try{const n=JSON.parse(e);if(!In(n)||n.version!==1||!In(n.drafts)||!In(n.queue)||!Array.isArray(n.queue.items))return lb();const s={};for(const h of Object.values(n.drafts))!In(h)||typeof h.sessionId!="string"||!pw(h.identity)||typeof h.message!="string"||h.message.length>cl||(s[Ws(h.sessionId,h.identity)]={sessionId:h.sessionId,identity:bl(h.identity),message:h.message});const a=[];for(const h of n.queue.items)uk(h)&&(a.some(p=>p.id===h.id)||a.push({id:h.id,sessionId:h.sessionId,projectRoot:h.projectRoot,nodeId:h.nodeId,reference:h.reference,revision:h.revision,message:h.message,identity:bl(h.identity)}));const o={items:a},c=n.queue.editing;In(c)&&typeof c.id=="string"&&typeof c.message=="string"&&a.some(h=>h.id===c.id)&&(o.editing={id:c.id,message:c.message});const u=n.queue.submission;if(In(u)&&typeof u.sessionId=="string"&&typeof u.projectRoot=="string"&&In(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<=Rm&&u.body.items.every(sr)){const h=u.body.items.map(({id:p,nodeId:y,reference:g,revision:v,message:x})=>({id:p,nodeId:y,reference:g,revision:v,message:x}));new Set(h.map(p=>p.id)).size===h.length&&h.every(p=>a.some(y=>y.id===p.id&&y.sessionId===u.sessionId&&y.projectRoot===u.projectRoot&&y.nodeId===p.nodeId&&y.reference===p.reference&&y.revision===p.revision&&y.message===p.message))&&(o.editing=o.editing&&!h.some(p=>p.id===o.editing?.id)?o.editing:void 0,o.submission={sessionId:u.sessionId,projectRoot:u.projectRoot,phase:"uncertain",body:{clientBatchId:u.body.clientBatchId,items:h}},o.error="A previous send was not confirmed. Refresh to check its status, or retry the same batch.")}const d=Object.keys(s).length!==Object.keys(n.drafts).length||a.length!==n.queue.items.length||!!Cl(a)||u!==void 0&&!o.submission;return{version:1,drafts:s,queue:o,recoveryWarning:d?gw:void 0}}catch{return lb()}}function dk(e){return JSON.stringify({version:1,drafts:e.drafts,queue:{items:e.queue.items,editing:e.queue.editing,submission:e.queue.submission}})}class Bo extends Error{constructor(n,s){super(n),this.uncertain=s,this.name="FeedbackCommandError"}uncertain}function em(e){return e instanceof Error?e.message:String(e)}async function ob(e){const n=await e.json().catch(()=>{});return typeof n?.error=="string"?n.error:"Request failed ("+e.status+")."}function hk(e,n){const[s,a]=V.useState(),[o,c]=V.useState(),[u,d]=V.useState("checking"),[h,p]=V.useState(),[y,g]=V.useState(!1),[v,x]=V.useState(!1),[E,A]=V.useState(0),T=V.useRef(void 0),C=V.useRef(!1),k=V.useRef(!0),_=V.useRef(null),N=V.useCallback(()=>A(D=>D+1),[]);V.useEffect(()=>(k.current=!0,()=>{k.current=!1,_.current?.abort()}),[]),V.useEffect(()=>{if(!e)return;let D=!1,B,R;d("checking");const U=async()=>{const q=new AbortController;R=q;const Y=setTimeout(()=>q.abort(),5e3);let Z=!1;try{const le=await Ho("/api/session?view="+n,{signal:q.signal,cache:"no-store"});if(le.status===404&&!T.current){Z=!0,D||d("unavailable");return}if(!le.ok)throw new Error(await ob(le));if(!le.headers.get("content-type")?.includes("application/json")&&!T.current){Z=!0,D||d("unavailable");return}const L=await le.json();if(!W3(L))throw new Error("The project server returned an invalid session snapshot.");if(D)return;T.current&&T.current!==L.sessionId&&(g(!0),_.current?.abort(),C.current=!1),T.current=L.sessionId,a(L),c(n),d("live"),p(void 0),C.current||x(!1)}catch(le){if(D)return;d("offline"),p(q.signal.aborted?"The project server did not respond. Retrying...":em(le)),C.current||x(!1)}finally{clearTimeout(Y),!D&&!Z&&(B=setTimeout(()=>{U()},1e3))}};return U(),()=>{D=!0,R?.abort(),B&&clearTimeout(B)}},[e,n,E]);const j=V.useCallback(async(D,B)=>{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 U=setTimeout(()=>R.abort(),1e4);C.current=!0,x(!0);try{const q=await Ho("/api/feedback/"+D,{method:"POST",headers:{"Content-Type":"application/json","X-Emviz-Token":s.token},body:JSON.stringify(B),signal:R.signal});if(!q.ok)throw new Bo(await ob(q),q.status>=500);if(D==="batch"){const Y=await q.json().catch(()=>{});if(!mw(Y,B))throw new Bo("The server did not return a matching batch confirmation. Refresh to check delivery, or retry the same batch.",!0)}}catch(q){throw k.current&&x(!1),q instanceof Bo?q:new Bo("The server did not confirm the request. Refresh to check its status, or retry the same batch.",!0)}finally{clearTimeout(U),C.current=!1,k.current&&N()}},[u,e,v,N,s,o,n]);return{snapshot:s,snapshotView:o,connection:u,error:h,changedSession:y,pending:v,refresh:N,command:j}}const rb={idle:"Idle",queued:"Queued",working:"Working",completed:"Completed",stopped:"Stopped"};function mk({session:e,view:n,onView:s,node:a,diff:o,showingBefore:c,message:u,onMessageChange:d,onAdded:h,drafts:p,queue:y,onQueueChange:g,storageNeedsReview:v}){const[x,E]=V.useState(),[A,T]=V.useState(),C=V.useRef(!1),k=e.snapshot,_=e.connection==="live"&&e.snapshotView===n,N=a?P3(k,n,_,a,o,c):"Select a current node to write feedback.",j=v?"Review the damaged saved feedback before sending. A previous batch may already have arrived.":ak(y,k,n,_,e.pending),D=k&&a?ab(k,a,u,"preview"):void 0,B=N??(D&&u.trim()?Cl([...y.items,D]):void 0),R=k?.feedback,U=_&&!k?.stale&&!k?.error,q=U&&R?.agent.connected,Y=R?.request,Z=R?.history.filter($=>$.id!==Y?.id)??[],le=Y?[...Z,Y]:Z,L=$=>{E(void 0),e.command($,{}).catch(X=>E(em(X)))},K=$=>{if($.preventDefault(),B||!k||!a||!u.trim())return;const X=ab(k,a,u,Bv());g(se=>nk(se,X)),h(u)},O=async()=>{if(j||C.current)return;const $=lk(y,y.submission?.body.clientBatchId??Bv()),X=$.submission;if(X){C.current=!0,g($);try{await e.command("batch",X.body),g(se=>hw(se,X.body.clientBatchId))}catch(se){g(w=>ok(w,X.body.clientBatchId,em(se),se instanceof Bo&&se.uncertain))}finally{C.current=!1}}},H=async $=>{try{await navigator.clipboard.writeText($),T("Copied queued feedback.")}catch{T("Copy is unavailable. Select the message text and copy it manually.")}};return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"agent-content",children:[b.jsxs("section",{className:"feedback-session","aria-label":"Feedback session",children:[b.jsxs("div",{className:"feedback-session-heading",children:[b.jsx("h2",{children:"Agent"}),b.jsx("span",{className:"feedback-state feedback-state-"+(R?.status??"idle"),role:"status",children:R?rb[R.status]:"No session"})]}),b.jsxs("p",{className:"agent-presence",children:[b.jsx("span",{"aria-hidden":"true",className:q?"presence-dot connected":"presence-dot"}),U?q?"Agent connected":"Agent disconnected":"Agent status unavailable"]}),b.jsxs("div",{className:"feedback-session-actions",children:[b.jsx("button",{type:"button",onClick:e.refresh,disabled:e.pending,children:"Refresh"}),R?R.status==="stopped"?b.jsx("button",{type:"button",onClick:()=>L("start"),disabled:!_||e.pending,children:"Resume session"}):b.jsx("button",{type:"button",onClick:()=>L("stop"),disabled:!_||e.pending,children:"Stop session"}):null]}),k?b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"segmented feedback-views",role:"group","aria-label":"Model view",children:[["current","Current"],["session","Session diff"],["turn","Turn diff"]].map(([$,X])=>b.jsx("button",{type:"button","aria-pressed":n===$,onClick:()=>s($),children:X},$))}),b.jsxs("p",{className:"feedback-baseline",children:["Baseline ",k.baseline.kind==="startup"?"startup snapshot":"Git"," · ",k.baseline.label]})]}):b.jsx("p",{className:"muted",children:"Feedback is available when a project session is running."}),e.connection==="checking"?b.jsx("p",{role:"status",children:"Refreshing the model..."}):null,e.error||k?.error||R?.error||x?b.jsx("p",{className:"feedback-error",role:"alert",children:x??e.error??k?.error??R?.error}):null,k?.stale||e.connection==="offline"?b.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?b.jsx("p",{className:"feedback-warning",children:"The project server restarted. The previous session history is no longer available."}):null,R?.status==="stopped"?b.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?b.jsx("p",{className:"feedback-note",children:"Stop session cancels feedback. It cannot stop an external agent process or its file writes."}):null]}),a&&k?b.jsxs("form",{className:"feedback-composer","aria-label":"Node feedback",onSubmit:K,children:[b.jsxs("h3",{children:["Feedback for ",a.label]}),b.jsxs("p",{className:"feedback-target",children:[b.jsx("span",{children:a.type}),b.jsx("code",{children:D?.reference})]}),b.jsx("label",{htmlFor:"feedback-message",children:"Feedback message"}),b.jsx("textarea",{id:"feedback-message",value:u,maxLength:cl,rows:4,disabled:!!N,"aria-describedby":"feedback-help",placeholder:"Describe the change you want for this node.",onChange:$=>d($.target.value)}),b.jsx("p",{className:"muted",id:"feedback-help",children:B??"Add this note to your local Queue. Send to Agent sends the whole Queue as one request."}),b.jsxs("div",{className:"feedback-composer-actions",children:[b.jsxs("small",{children:[u.length,"/",cl]}),b.jsx("button",{type:"submit",disabled:!!B||!u.trim(),children:"Add to Queue"})]})]}):b.jsx("p",{className:"agent-empty",children:"Select a current node to write feedback. Your Queue stays here as you move around the model."}),b.jsxs("section",{className:"feedback-queue","aria-label":"Feedback Queue",children:[b.jsxs("div",{className:"feedback-queue-heading",children:[b.jsx("h3",{children:"Queue"}),b.jsxs("span",{children:[y.items.length,"/",Rm," · Unsent"]})]}),y.items.length?b.jsx("ol",{children:y.items.map($=>{const X=Lm(y,$.id),se=k?dw($,k):void 0,w=y.editing?.id===$.id;return b.jsxs("li",{"data-queue-id":$.id,className:se?"feedback-queue-item needs-review":"feedback-queue-item",children:[b.jsxs("div",{className:"feedback-queue-item-heading",children:[b.jsx("strong",{children:$.identity.label}),b.jsx("small",{children:X?y.submission?.phase==="sending"?"Sending...":"Awaiting confirmation":"Unsent"})]}),b.jsx("code",{children:$.reference}),b.jsxs("p",{className:"feedback-captured",children:[$.identity.type," · Revision ",$.revision.slice(0,12)]}),se?b.jsx("p",{className:"feedback-warning",children:se}):null,w?b.jsxs(b.Fragment,{children:[b.jsxs("label",{className:"sr-only",htmlFor:"queue-edit-"+$.id,children:["Edit queued feedback for ",$.identity.label]}),b.jsx("textarea",{id:"queue-edit-"+$.id,value:y.editing?.message??"",maxLength:cl,rows:4,onChange:z=>g(F=>({...F,editing:{id:$.id,message:z.target.value}}))}),b.jsxs("div",{className:"feedback-queue-actions",children:[b.jsx("button",{type:"button",onClick:()=>g(z=>ik(z,$.id,z.editing?.message??$.message)),disabled:!y.editing?.message.trim(),children:"Save"}),b.jsx("button",{type:"button",onClick:()=>g(z=>({...z,editing:void 0})),children:"Cancel"})]})]}):b.jsxs(b.Fragment,{children:[b.jsx("p",{className:"feedback-message",children:$.message}),b.jsxs("div",{className:"feedback-queue-actions",children:[b.jsx("button",{type:"button","aria-label":"Edit queued feedback for "+$.identity.label,disabled:X||!!y.editing,onClick:()=>g(z=>({...z,editing:{id:$.id,message:$.message}})),children:"Edit"}),b.jsx("button",{type:"button","aria-label":"Remove queued feedback for "+$.identity.label,disabled:X,onClick:()=>g(z=>sk(z,$.id)),children:"Remove"}),b.jsx("button",{type:"button","aria-label":"Copy queued feedback for "+$.identity.label,onClick:()=>{H($.message)},children:"Copy"})]})]})]},$.id)})}):b.jsx("p",{className:"muted",children:"No queued feedback. Add notes from the nodes you want to change, then send them together."}),A?b.jsx("p",{role:"status",children:A}):null]}),k?b.jsx(pk,{drafts:p,snapshot:k}):null,le.length?b.jsxs("details",{className:"feedback-history",children:[b.jsxs("summary",{children:["Feedback history (",le.length,")"]}),b.jsx("ol",{"aria-label":"Feedback history",children:le.map($=>b.jsxs("li",{"data-request-id":$.id,children:[$.items?.length?b.jsx("ul",{className:"feedback-request-items",children:$.items.map(X=>b.jsxs("li",{children:[b.jsx("code",{children:X.reference}),b.jsx("p",{children:X.message})]},X.id))}):b.jsxs(b.Fragment,{children:[b.jsx("code",{children:$.reference}),b.jsx("p",{children:$.message})]}),$.reply?b.jsx("p",{className:"feedback-reply",children:$.reply}):b.jsx("p",{className:"muted",children:$.id===Y?.id&&R?rb[R.status]:"No reply recorded."})]},$.id))})]}):null]}),b.jsxs("footer",{className:"feedback-send",children:[y.submission?.phase==="uncertain"?b.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?b.jsx("p",{className:"feedback-error",role:"alert",children:y.error}):null,k&&y.submission&&(y.submission.sessionId!==k.sessionId||y.submission.projectRoot!==k.project.root)?b.jsx("button",{type:"button",onClick:()=>g($=>rk($,k)),children:"Release previous-session batch"}):null,y.notice?b.jsx("p",{role:"status",children:y.notice}):null,j&&y.items.length>0?b.jsx("p",{className:"muted",id:"feedback-send-help",children:j}):null,b.jsx("button",{type:"button",className:"feedback-send-button",onClick:()=>{O()},disabled:!!j,"aria-describedby":j&&y.items.length?"feedback-send-help":void 0,children:y.submission?.phase==="sending"?"Sending...":y.submission?"Retry same batch":"Send to Agent"}),b.jsxs("small",{children:[y.items.length," queued ",y.items.length===1?"item":"items"," · One agent request"]})]})]})}function pk({drafts:e,snapshot:n}){const[s,a]=V.useState();if(!e.length)return null;const o=async c=>{try{await navigator.clipboard.writeText(c.message),a("Copied draft for "+c.identity.label+".")}catch{a("Copy is unavailable. Select the draft text below and copy it manually.")}};return b.jsxs("details",{className:"feedback-history",children:[b.jsxs("summary",{children:["Unsent feedback drafts (",e.length,")"]}),b.jsxs("ol",{"aria-label":"Unsent feedback drafts",children:[e.map(c=>{const u=Ws(c.sessionId,c.identity),d=n.project.nodes.filter(p=>Ws(n.sessionId,p)===u&&n.diff?.nodeStatus[p.id]!=="removed"),h=c.sessionId!==n.sessionId?"Saved from a previous session. Copy the text before starting new feedback.":d.length===1?"Saved for the original node. Select that node to continue, or copy the text.":"The original node is no longer available or is ambiguous. Copy this draft to recover it.";return b.jsxs("li",{children:[b.jsx("strong",{children:c.identity.label}),b.jsxs("p",{className:"muted",children:[c.identity.type," · ",c.identity.sourcePath??"No source path"]}),b.jsx("p",{className:"feedback-warning",children:h}),b.jsx("p",{children:c.message}),b.jsx("button",{type:"button",onClick:()=>{o(c)},children:"Copy draft"})]},u)}),s?b.jsx("li",{role:"status",children:s}):null]})]})}function He(e,n,s,a,o){return{id:`${n}:${a??"project"}:${s}`,severity:e,check:n,message:s,path:a,nodeId:o}}function Za(e){const n=new Set,s=new Set;for(const a of e){const o=a.trim().toLowerCase();o&&(n.has(o)&&s.add(a),n.add(o))}return[...s]}const gk=new Set(["sent","built","made","paid","booked","cancelled","canceled","submitted","recorded","created","updated","deleted","placed","notified"]);function yk(e){return e.match(/[A-Z]+(?=[A-Z][a-z]|$)|[A-Z]?[a-z]+|\d+/g)??[e]}function vk(e){const n=e.toLowerCase();return gk.has(n)||/(ed|en|d)$/i.test(e)}function bk(e){return yk(e).some(vk)}function cb(e){return/(Requested|Triggered|Scheduled|Enqueued|Dispatched|Required)$/.test(e)}function Sk(e){return["Selected","Shown","Viewed","Clicked","Opened","Closed","Ticked","Incremented","Reached","Displayed","Navigated"].find(n=>e.includes(n))}function wk(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 a=0;const o=new Set;for(const c of n){if(o.has(c))continue;a+=1;const u=[c];for(o.add(c);u.length>0;){const d=u.shift();if(d)for(const h of s.get(d)??[])o.has(h)||(o.add(h),u.push(h))}}return a}function xk(e){const n=[...(e.actorIssues??[]).map(h=>He("error","A1",h.message,h.path)),...(e.modelIssues??[]).map(h=>He("error",h.check,h.message,h.path))],s=new Set(e.events.map(h=>h.name)),a=new Set(e.slices.map(h=>h.path)),o=new Map,c=new Map;for(const h of e.stories){h.slices.length>15&&n.push(He("warning","S4",`Story "${h.name}" has ${h.slices.length} slices; consider splitting it.`,h.path));for(const p of h.slices)a.has(p)||n.push(He("error","S2",`Story "${h.name}" lists missing slice "${p}".`,h.path))}for(const h of e.events){h.fields?.trim()||n.push(He("error","C4",`Event "${h.name}" has no fields block.`,h.sourcePath)),!bk(h.name)&&!cb(h.name)&&n.push(He("warning","C3",`Event "${h.name}" does not obviously read as a past-tense domain event.`,h.sourcePath));const p=Sk(h.name);p&&n.push(He("warning","D1",`Event "${h.name}" contains red-flag verb "${p}"; confirm this is persisted domain state.`,h.sourcePath))}for(const h of e.slices){const p=h.commands.map(g=>g.name),y=h.queries.map(g=>g.name);for(const g of Za(p))n.push(He("error","L9",`Command "${g}" is duplicated within slice "${h.title}".`,h.path));for(const g of Za(y))n.push(He("error","L9",`Query "${g}" is duplicated within slice "${h.title}".`,h.path));for(const g of Za(h.screen.reads))n.push(He("error","L9",`screen.reads lists "${g}" more than once.`,h.path));for(const g of Za(h.screen.executes))n.push(He("error","L9",`screen.executes lists "${g}" more than once.`,h.path));for(const g of h.screen.reads)y.includes(g)||n.push(He("error","W2",`screen.reads references missing local query "${g}".`,h.path));for(const g of h.screen.executes)p.includes(g)||n.push(He("error","W1",`screen.executes references missing local command "${g}".`,h.path));h.screen.type==="system"&&h.screen.actors.length>0&&n.push(He("error","L5",`System slice "${h.title}" must not declare screen.actors.`,h.path)),h.storyName||n.push(He("warning","M2",`Slice "${h.title}" is not listed by any story.`,h.path)),h.commands.length>0&&h.gwt.length===0&&n.push(He("warning","M1",`Command slice "${h.title}" has no GWT scenarios.`,h.path));for(const g of h.commands){g.fields?.trim()||n.push(He("warning","L6",`Command "${g.name}" has no fields block.`,h.path));for(const v of g.produces)s.has(v)||n.push(He("error","G1",`Command "${g.name}" produces unregistered event "${v}".`,h.path)),o.set(v,[...o.get(v)??[],`${h.title}.${g.name}`])}for(const g of h.queries){g.fields?.trim()||n.push(He("warning","L7",`Query "${g.name}" has no fields block.`,h.path)),g.name.includes("For")||n.push(He("warning","N1",`Query "${g.name}" should use a descriptive <Thing>For<UseCaseOrScreen> name.`,h.path));for(const v of g.fromEvents)s.has(v)||n.push(He("error","G2",`Query "${g.name}" reads unregistered event "${v}".`,h.path)),c.set(v,[...c.get(v)??[],`${h.title}.${g.name}`])}for(const g of h.gwt)for(const v of[...g.given,...g.when,...g.then])(!v.type||!["event","command","query","error"].includes(v.type))&&n.push(He("error","L8",`GWT scenario "${g.name??"Unnamed"}" has invalid item type "${v.type??""}".`,h.path)),v.name||n.push(He("error","L8",`GWT scenario "${g.name??"Unnamed"}" has an item without a name.`,h.path))}for(const h of s){const p=o.get(h)??[],y=c.get(h)??[];p.length===0&&n.push(He("error","G3",`Event "${h}" is registered but no command produces it.`)),p.length>1&&n.push(He("warning","G8",`Event "${h}" has multiple producers: ${p.join(", ")}.`)),p.length>0&&y.length===0&&n.push(He("warning",cb(h)?"G4b":"G4a",`Event "${h}" is produced but no query consumes it.`))}for(const[h,p]of c.entries())(o.get(h)??[]).length===0&&n.push(He("error","G3",`Event "${h}" is read by ${p.join(", ")} but no command produces it.`));for(const h of Za(e.slices.flatMap(p=>p.commands.map(y=>y.name))))n.push(He("warning","M5",`Command name "${h}" is used in multiple slices; command names should be globally unique.`));for(const h of Za(e.slices.flatMap(p=>p.queries.map(y=>y.name))))n.push(He("warning","G7",`Query name "${h}" is used in multiple slices; query names should be globally unique.`));const u=e.slices.filter(h=>h.commands.length>0).length;u>0&&e.events.length/u>2&&n.push(He("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 d=wk(e);return d>1&&n.push(He("info","I3",`The graph has ${d} disconnected islands.`)),{errors:n.filter(h=>h.severity==="error").length,warnings:n.filter(h=>h.severity==="warning").length,findings:n}}const yw=Sl.createContext(()=>{}),vw=Sl.createContext({open:()=>{},list:()=>{}});function $m(){return b.jsxs(b.Fragment,{children:[b.jsx(Cn,{id:"top-target",type:"target",position:pe.Top,style:{left:"46%"}}),b.jsx(Cn,{id:"top-source",type:"source",position:pe.Top,style:{left:"54%"}}),b.jsx(Cn,{id:"bottom-target",type:"target",position:pe.Bottom,style:{left:"46%"}}),b.jsx(Cn,{id:"bottom-source",type:"source",position:pe.Bottom,style:{left:"54%"}}),b.jsx(Cn,{id:"left-target",type:"target",position:pe.Left,style:{top:"46%"}}),b.jsx(Cn,{id:"left-source",type:"source",position:pe.Left,style:{top:"54%"}}),b.jsx(Cn,{id:"right-target",type:"target",position:pe.Right,style:{top:"46%"}}),b.jsx(Cn,{id:"right-source",type:"source",position:pe.Right,style:{top:"54%"}})]})}function Th({title:e,items:n}){const s=n&&n.length>0?n:[{type:"empty",name:"empty"}];return b.jsxs("div",{className:"gwt-step",children:[b.jsx("div",{className:"gwt-step-title",children:e}),b.jsx("div",{className:"gwt-step-items",children:s.map((a,o)=>b.jsxs("div",{className:`gwt-step-item gwt-step-item-${a.type??"empty"}`,children:[b.jsx("span",{children:a.type??"empty"}),b.jsxs("div",{className:"gwt-item-content",children:[b.jsx("strong",{children:a.name??"empty"}),a.fields?b.jsx("pre",{children:a.fields}):null]})]},`${o}-${a.type??"empty"}-${a.name??""}`))})]})}function Ek({nodeData:e}){const n=Sl.useContext(vw),s=e.scenarios??[];return b.jsxs("div",{className:`em-node em-node-gwt ${e.selected?"selected":""} ${e.diffStatus?`diff-node-${e.diffStatus}`:""}`,children:[b.jsx($m,{}),b.jsxs("div",{className:"node-type",children:["GWT · ",s.length," cases"]}),e.scenarioStatus?b.jsx("div",{className:"gwt-diff-counts",children:["added","removed","changed"].map(a=>`${a}: ${s.filter(o=>e.scenarioStatus?.[o.id]===a).length}`).join(" · ")}):null,b.jsx("div",{className:"gwt-summary nodrag nopan nowheel",children:s.slice(0,3).map(a=>b.jsxs("button",{type:"button","aria-current":e.selectedScenarioId===a.id?"true":void 0,onClick:o=>{o.stopPropagation(),n.open(a.id)},children:[b.jsx("span",{className:"gwt-scenario-name",children:a.label}),e.scenarioStatus?b.jsx("span",{className:"gwt-scenario-status",children:` · ${e.scenarioStatus[a.id]??"unchanged"}`}):null]},a.id))}),b.jsx("div",{className:"gwt-more nodrag nopan nowheel",children:s.length>3?b.jsxs("button",{type:"button",onClick:a=>{a.stopPropagation(),n.list(e.projectNode.id)},children:["+",s.length-3," more"]}):null})]})}function bw({node:e}){const n=aw(e);return n.length===0?null:b.jsx("div",{className:"chips actor-chips nodrag nopan nowheel","aria-label":"Actors",children:n.map(s=>b.jsxs("span",{className:"actor-chip","data-actor-id":s.id,title:s.name+" ("+s.id+")",style:{borderColor:s.color},children:[b.jsx("i",{className:"actor-swatch","aria-hidden":"true",style:{backgroundColor:s.color}}),b.jsx("span",{className:"actor-name",children:s.name})]},s.id))})}function Nk({data:e}){const n=e,s=n.projectNode,a=n.diffStatus&&n.diffStatus!=="unchanged"?b.jsx("div",{className:`diff-badge diff-badge-${n.diffStatus}`,children:n.diffStatus}):null;return s.type==="gwt"?b.jsx(Ek,{nodeData:n}):b.jsxs("div",{className:`em-node em-node-${s.type} ${n.selected?"selected":""} ${n.connected?"connected":""} ${n.diffStatus?`diff-node-${n.diffStatus}`:""}`,children:[b.jsx($m,{}),a,b.jsxs("div",{className:"node-heading",children:[b.jsx("div",{className:"node-type",children:s.type}),b.jsx(fw,{node:s,compact:!0})]}),b.jsx("div",{className:"node-label",children:s.label}),b.jsx(bw,{node:s})]})}function _k({data:e}){const n=Sl.useContext(yw),s=e,a=s.projectNode;return b.jsxs("div",{className:`group-node group-${a.type} ${s.selected?"selected":""} ${s.diffStatus?`diff-node-${s.diffStatus}`:""}`,children:[s.diffStatus&&s.diffStatus!=="unchanged"?b.jsx("div",{className:`diff-badge diff-badge-${s.diffStatus}`,children:s.diffStatus}):null,a.type==="story"?b.jsx($m,{}):null,b.jsxs("div",{className:"group-title",children:[a.type==="story"&&s.storyId?b.jsxs("button",{type:"button",className:"story-toggle nodrag nopan","aria-label":`${s.collapsed?"Expand":"Collapse"} ${a.label}`,"aria-expanded":!s.collapsed,onClick:o=>{o.stopPropagation(),n(s.storyId)},children:[b.jsx("span",{"aria-hidden":"true",children:s.collapsed?"▸":"▾"})," ",a.label,b.jsxs("span",{className:"story-slice-count",children:[s.sliceCount??0," slices"]})]}):a.label,a.type==="slice"&&s.actorRelated?b.jsx("span",{className:"actor-related-badge",children:"Related"}):null]}),a.description&&!s.collapsed?b.jsx("div",{className:"group-description",children:a.description}):null]})}const Ak={eventModelNode:Nk,groupNode:_k};function ub(e){return e===pe.Top?{x:0,y:-1}:e===pe.Right?{x:1,y:0}:e===pe.Bottom?{x:0,y:1}:{x:-1,y:0}}function Tk({sourceX:e,sourceY:n,targetX:s,targetY:a,sourcePosition:o,targetPosition:c,data:u}){const d=u,h=s-e,p=a-n,y=Math.max(56,Math.min(180,Math.abs(p)*.42)),g=Math.max(70,Math.min(180,Math.abs(h)*.38)),v=Math.max(72,Math.min(180,Math.max(Math.abs(h),Math.abs(p))*.38));if(d?.route==="same-slice-read"){const A=o===pe.Top?-1:1,T=c===pe.Bottom?1:-1,C=Math.max(72,Math.min(150,Math.abs(p)*.65));return`M ${e},${n} C ${e},${n+A*C} ${s},${a+T*C} ${s},${a}`}if(d?.route==="event-read"){const A=ub(o),T=ub(c);return`M ${e},${n} C ${e+A.x*v},${n+A.y*v} ${s+T.x*v},${a+T.y*v} ${s},${a}`}if(o===pe.Bottom||o===pe.Top){const A=o===pe.Top?-1:1,T=c===pe.Top?-1:1;return`M ${e},${n} C ${e},${n+A*y} ${s},${a+T*y} ${s},${a}`}const x=o===pe.Left?-1:1,E=c===pe.Left?-1:1;return`M ${e},${n} C ${e+x*g},${n} ${s+E*g},${a} ${s},${a}`}function Ck(e){const n=e.data,s=n?.diffStatus==="added"?"#15803d":n?.diffStatus==="removed"?"#b91c1c":n?.diffStatus==="changed"?"#b45309":void 0,a=n?.active?"#111827":s??"#64748b",o=n?.fieldFlow,c=!!(n?.selectedFieldName&&(o?.sharedFieldNames.includes(n.selectedFieldName)||o?.derivedFieldNames.includes(n.selectedFieldName))),u=(e.sourceX+e.targetX)/2,d=(e.sourceY+e.targetY)/2;return b.jsxs(b.Fragment,{children:[b.jsx(dr,{path:Tk(e),markerEnd:e.markerEnd,style:{...e.style,stroke:a,strokeDasharray:n?.diffStatus==="removed"?"7 5":void 0,strokeWidth:n?.diffStatus&&n.diffStatus!=="unchanged"?2.4:void 0},className:n?.active?"edge-path-active":"edge-path"}),o&&o.visibleFieldNames.length>0&&(n?.active||c)?b.jsx(gM,{children:b.jsxs("div",{className:`edge-field-label nodrag nopan ${n?.active?"active":""} ${c?"field-selected":""}`,style:{transform:`translate(-50%, -50%) translate(${u}px, ${d}px)`},children:[o.visibleFieldNames.map(h=>b.jsx("button",{type:"button",onClick:()=>n?.onSelectField?.(h),children:h},h)),o.remainingCount>0?b.jsxs("span",{children:["+",o.remainingCount]}):null]})}):null]})}const Mk={eventModelEdge:Ck};function Yc({label:e,description:n,value:s,copiedKey:a,onCopy:o}){return b.jsx("button",{type:"button",className:"copy-action",onClick:()=>o(a,s),children:b.jsxs("span",{children:[b.jsx("strong",{children:e}),b.jsx("small",{children:n})]})})}function Sw(e){return e==="query-screen"||e==="screen-command"||e==="command-event"||e==="event-query"}function Ok(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function kk(e){return(e.graphSidecar?.model?.name??e.graphSidecar?.model?.id??"event-model").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"event-model"}async function fb(e){const n=await fetch(e);if(!n.ok)throw new Error(`Failed to fetch ${e}: ${n.status}`);return n.text()}async function zk(e,n,s,a){const o=Array.from(document.querySelectorAll('script[type="module"][src]')).map(y=>new URL(y.src,window.location.href)).filter(y=>!y.pathname.includes("/@vite/")&&!y.pathname.endsWith("/@react-refresh"));if(o.length===0||o.some(y=>y.pathname.includes("/src/")||y.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 c=Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).map(y=>new URL(y.href,window.location.href)),u=await Promise.all(c.map(y=>fb(y.href))),d=Array.from(document.querySelectorAll("style")).map(y=>y.textContent??"").filter(Boolean),h=await Promise.all(o.map(y=>fb(y.href))),p={project:e,report:n,diff:s,timelineId:a,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>${[...u,...d].join(`
|
|
154
|
-
|
|
155
|
-
`)}</style>`," </head>"," <body>",' <div id="root"></div>',` <script>window.__EMVIZ_EXPORT__ = ${Ok(p)};<\/script>`,` <script type="module">${h.join(`
|
|
156
|
-
|
|
157
|
-
`)}<\/script>`," </body>","</html>"].join(`
|
|
158
|
-
`)}function Dk({diff:e,filter:n,onFilter:s,onSelect:a}){const o=Object.entries(e.nodeStatus).filter(([,c])=>c!=="unchanged").slice(0,80);return b.jsxs("aside",{className:"panel diff-panel",children:[b.jsx("h2",{children:"Diff"}),b.jsx("p",{children:"All stories are shown in diff views so removed items remain accessible."}),e.timelinesChanged?b.jsx("p",{role:"status",children:"Timeline layout changed. Ordering does not add event dependencies."}):null,b.jsxs("div",{className:"diff-range",children:[b.jsx("code",{children:e.base.label}),b.jsx("span",{children:"to"}),b.jsx("code",{children:e.target.label})]}),b.jsxs("div",{className:"diff-counts",children:[b.jsxs("button",{type:"button",className:n==="added"?"active added":"added",onClick:()=>s(n==="added"?"all":"added"),children:[b.jsx("strong",{children:e.summary.nodes.added}),b.jsx("span",{children:"Added"})]}),b.jsxs("button",{type:"button",className:n==="removed"?"active removed":"removed",onClick:()=>s(n==="removed"?"all":"removed"),children:[b.jsx("strong",{children:e.summary.nodes.removed}),b.jsx("span",{children:"Removed"})]}),b.jsxs("button",{type:"button",className:n==="changed"?"active changed":"changed",onClick:()=>s(n==="changed"?"all":"changed"),children:[b.jsx("strong",{children:e.summary.nodes.changed}),b.jsx("span",{children:"Changed"})]})]}),n!=="all"?b.jsx("button",{type:"button",className:"clear-diff-filter",onClick:()=>s("all"),children:"Show full graph"}):null,b.jsx("h3",{children:"Changed Nodes"}),b.jsx("div",{className:"diff-list",children:o.length===0?b.jsx("p",{className:"muted",children:"No node changes."}):o.map(([c,u])=>b.jsxs("button",{type:"button",className:`diff-list-item ${u}`,onClick:()=>a(c),children:[b.jsx("span",{children:c}),b.jsx("strong",{children:u})]},c))})]})}function jk(e,n){const s=URL.createObjectURL(new Blob([n],{type:"text/html;charset=utf-8"})),a=document.createElement("a");a.href=s,a.download=e,a.click(),URL.revokeObjectURL(s)}async function Rk(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 Bk(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 Lk(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 $k(e){const n=e.graphSidecar?.nodes;return n?Object.entries(n).flatMap(([s,a])=>{const o=a,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 d=Lk(u);return Object.entries(o.selector??{}).every(([h,p])=>d[h]===p)});return c.length===0?[{id:`V1:.event-modeling/graph.json:${s}`,severity:"warning",check:"V1",message:`graph.json node "${s}" selector does not resolve.`,path:".event-modeling/graph.json",nodeId:s}]:c.length>1?[{id:`V2:.event-modeling/graph.json:${s}`,severity:"warning",check:"V2",message:`graph.json node "${s}" selector resolves to ${c.length} nodes.`,path:".event-modeling/graph.json",nodeId:s}]:[]}):[]}function Hk({onImport:e,error:n}){return b.jsx("div",{className:"import-panel",children:b.jsxs("div",{className:"import-card",children:[b.jsx("h1",{children:"emviz"}),b.jsx("p",{children:"Import an Event Modeling project folder or select YAML/JSON files to visualize the model."}),b.jsxs("div",{className:"import-actions",children:[b.jsxs("label",{children:["Import folder",b.jsx("input",{type:"file",multiple:!0,webkitdirectory:"",directory:"",onChange:s=>s.currentTarget.files&&e(s.currentTarget.files)})]}),b.jsxs("label",{children:["Import files",b.jsx("input",{type:"file",multiple:!0,accept:".yaml,.yml,.json",onChange:s=>s.currentTarget.files&&e(s.currentTarget.files)})]})]}),n?b.jsx("p",{className:"import-error",children:n}):null]})})}function Uk({tab:e,onTab:n}){return b.jsx("div",{className:"inspector-tabs",role:"tablist","aria-label":"Inspector",children:["details","agent"].map(s=>b.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:a=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(a.key))return;a.preventDefault();const o=a.key==="Home"?"details":a.key==="End"||s==="details"?"agent":"details";n(o),requestAnimationFrame(()=>document.getElementById("inspector-tab-"+o)?.focus())},children:s==="details"?"Details":"Agent"},s))})}function Ik({project:e,selectedNode:n,diff:s,findings:a,selectedFieldName:o,onSelect:c,onSelectField:u,onClearField:d,onPreviewConnection:h,onClearPreview:p,gwtList:y,onGwtList:g,onClose:v,onFocusNode:x,tab:E,onTab:A,agentPanel:T,oldVersionId:C,onVersion:k}){const _=jm(s,n),N=n&&_&&C===n?.id?{..._,id:n.id}:n,[j,D]=V.useState(),[B,R]=V.useState(""),U=V.useRef(null),q=V.useRef(0),Y=!!y;V.useLayoutEffect(()=>{Y&&U.current&&(U.current.scrollTop=q.current)},[Y,E]);const Z=ie=>{ie.key!=="Escape"&&ie.stopPropagation()},le=V.useCallback((ie,te)=>{navigator.clipboard?.writeText(te).then(()=>{D(ie),window.setTimeout(()=>D(oe=>oe===ie?void 0:oe),1400)})},[]),L=b.jsx(Uk,{tab:E,onTab:A});if(E==="agent")return b.jsxs("aside",{id:"inspector-agent",className:"panel panel-right agent-panel","aria-label":"Agent",onKeyDown:Z,onKeyUp:Z,children:[L,T]});if(y){const ie=B.trim().toLowerCase(),te=y.filter(oe=>oe.label.toLowerCase().includes(ie));return b.jsxs("aside",{ref:U,id:"inspector-details",className:"panel panel-right gwt-panel","aria-label":"GWT scenarios",onKeyDown:Z,onKeyUp:Z,onScroll:oe=>{q.current=oe.currentTarget.scrollTop},children:[L,b.jsx("button",{type:"button",onClick:v,children:"Close"}),b.jsxs("h2",{children:[y[0]?.sliceTitle," · All scenarios (",y.length,")"]}),b.jsxs("div",{className:"gwt-filter",children:[b.jsx("label",{htmlFor:"gwt-name-filter",children:"Filter by scenario name"}),b.jsx("input",{id:"gwt-name-filter",type:"search",value:B,onChange:oe=>{R(oe.target.value),q.current=0,U.current&&(U.current.scrollTop=0)}}),b.jsx("button",{type:"button",disabled:!B,onClick:()=>{R(""),q.current=0,U.current&&(U.current.scrollTop=0),U.current?.querySelector("input")?.focus({preventScroll:!0})},children:"Clear filter"})]}),b.jsx("p",{role:"status",children:te.length?`${te.length} of ${y.length} scenarios`:"No scenarios match this name."}),b.jsx("div",{className:"gwt-all-list",children:te.map(oe=>b.jsxs("button",{type:"button","aria-current":N?.id===oe.id?"true":void 0,onClick:()=>{q.current=U.current?.scrollTop??q.current,c(oe.id)},children:[oe.label,s?` · ${s.nodeStatus[oe.id]??"unchanged"}`:""]},oe.id))})]})}if(!N)return b.jsxs("aside",{id:"inspector-details",className:"panel panel-right","aria-label":"Node details",children:[L,b.jsx("h2",{children:"Selection"}),b.jsx("p",{className:"muted",children:"Select a node to inspect source and connections."})]});const K=!!(_&&C===n?.id)||s?.nodeStatus[N.id]==="removed",O=K?F3(e,s):J3(e,s),H=new Map(O.nodes.map(ie=>[ie.id,ie])),$=O.edges.filter(ie=>{const te=H.get(ie.source),oe=H.get(ie.target);return Sw(ie.kind)&&te&&oe&&te.type!=="gwt"&&oe.type!=="gwt"}),X=$.filter(ie=>ie.target===N.id),se=$.filter(ie=>ie.source===N.id),w=eS(N.fields),F=`em://${e.graphSidecar?.model?.id??"event_model"}/${N.id}`,P=N.raw??N.fields??N.description??N.label,fe=[`Reference: ${F}`,`Node: ${N.label} (${N.type})`,`Source: ${N.sourcePath??"unknown"}`,"","Incoming:",...X.length===0?["- none"]:X.map(ie=>`- ${H.get(ie.source)?.label??ie.source} -> ${N.label}`),"","Outgoing:",...se.length===0?["- none"]:se.map(ie=>`- ${N.label} -> ${H.get(ie.target)?.label??ie.target}`),"","Source excerpt:",P].join(`
|
|
159
|
-
`),de=`Please update this event model node.
|
|
160
|
-
|
|
161
|
-
Reference:
|
|
162
|
-
${F}
|
|
163
|
-
|
|
164
|
-
Source path:
|
|
165
|
-
${N.sourcePath??"unknown"}
|
|
166
|
-
|
|
167
|
-
Current context:
|
|
168
|
-
${P}
|
|
169
|
-
|
|
170
|
-
Goal:
|
|
171
|
-
`;return b.jsxs("aside",{id:"inspector-details",className:`panel panel-right ${N.type==="gwt"?"gwt-panel":""}`,"aria-label":"Node details",onKeyDown:Z,onKeyUp:Z,children:[L,N.type==="gwt"?b.jsxs("div",{className:"gwt-panel-actions",children:[b.jsx("button",{type:"button",onClick:()=>g(N.id),children:"All scenarios"}),b.jsx("button",{type:"button",onClick:v,children:"Close"})]}):null,b.jsxs("div",{className:"panel-heading",children:[b.jsx("h2",{children:N.label}),b.jsx("button",{type:"button",className:"icon-button",onClick:()=>x(N.id),"aria-label":"Focus selected node",title:"Focus selected node",children:b.jsx("span",{className:"target-icon","aria-hidden":"true"})})]}),s&&n?b.jsxs("p",{children:[s.nodeStatus[n.id]," · ",K?"Old version":"New version"]}):null,_?b.jsxs("div",{className:"gwt-panel-actions",role:"group","aria-label":"Node version",children:[b.jsx("button",{type:"button","aria-pressed":C!==n?.id,onClick:()=>k(void 0),children:"New version"}),b.jsx("button",{type:"button","aria-pressed":C===n?.id,onClick:()=>k(n?.id),children:"Old version"})]}):null,N.type==="gwt"?b.jsxs("section",{"aria-label":"Scenario details",children:[N.description?b.jsx("p",{children:N.description}):null,b.jsx(Th,{title:"Given",items:N.given}),b.jsx(Th,{title:"When",items:N.when}),b.jsx(Th,{title:"Then",items:N.then}),b.jsx("p",{className:"muted",children:"YAML below is the source slice, not an individual scenario excerpt."})]}):null,b.jsxs("div",{className:"meta-row",children:[b.jsx("span",{children:"Type"}),b.jsx("strong",{children:N.type})]}),b.jsx(bw,{node:N}),b.jsx(fw,{node:N}),b.jsxs("div",{className:"meta-row",children:[b.jsx("span",{children:"Reference"}),b.jsx("code",{children:F})]}),N.sourcePath?b.jsxs("div",{className:"meta-row",children:[b.jsx("span",{children:"Source"}),b.jsx("code",{children:N.sourcePath})]}):null,b.jsxs("details",{className:"copy-section",children:[b.jsxs("summary",{children:[b.jsx("span",{children:"Copy for LLM"}),j?b.jsxs("strong",{className:"copy-feedback","aria-live":"polite",children:["Copied ",j]}):null]}),b.jsxs("div",{className:"copy-actions",children:[b.jsx(Yc,{label:"Reference",description:"Stable em:// node handle",value:F,copiedKey:"reference",onCopy:le}),b.jsx(Yc,{label:"YAML",description:N.type==="gwt"?"Source YAML for the whole slice":"Source excerpt for this node",value:P,copiedKey:"YAML",onCopy:le}),b.jsx(Yc,{label:"Context",description:"Reference plus incoming/outgoing links",value:fe,copiedKey:"context",onCopy:le}),b.jsx(Yc,{label:"Edit prompt",description:"Prompt scaffold for asking an LLM to edit",value:de,copiedKey:"prompt",onCopy:le})]})]}),b.jsx("h3",{children:"Connections"}),b.jsxs("div",{className:"connection-list",children:[b.jsx("strong",{children:"Incoming"}),X.length===0?b.jsx("p",{className:"muted",children:"None"}):X.map(ie=>b.jsx("button",{type:"button",className:"connection-button",onClick:()=>c(ie.source),onMouseEnter:()=>h(ie.id),onMouseLeave:p,onFocus:()=>h(ie.id),onBlur:p,children:b.jsx("span",{children:H.get(ie.source)?.label??ie.source})},ie.id)),b.jsx("strong",{children:"Outgoing"}),se.length===0?b.jsx("p",{className:"muted",children:"None"}):se.map(ie=>b.jsx("button",{type:"button",className:"connection-button",onClick:()=>c(ie.target),onMouseEnter:()=>h(ie.id),onMouseLeave:p,onFocus:()=>h(ie.id),onBlur:p,children:b.jsx("span",{children:H.get(ie.target)?.label??ie.target})},ie.id))]}),N.type==="command"||N.type==="event"||N.type==="query"?b.jsxs(b.Fragment,{children:[b.jsx("h3",{children:"Fields"}),b.jsxs("div",{className:"field-panel",children:[w.length===0?b.jsx("p",{className:"field-empty",children:"No fields documented."}):b.jsx("div",{className:"field-list",children:w.map(ie=>b.jsx("button",{type:"button",className:o===ie?"selected":"",onClick:()=>u(ie),children:ie},ie))}),o?b.jsx("button",{type:"button",className:"clear-field",onClick:d,children:"Clear field focus"}):null]})]}):null,b.jsx("h3",{children:"Findings"}),a.length===0?b.jsx("p",{className:"muted",children:"No findings for this node."}):a.map(ie=>b.jsxs("div",{className:`finding finding-${ie.severity}`,children:[b.jsx("strong",{children:ie.check}),b.jsx("span",{children:ie.message})]},ie.id)),b.jsx("h3",{children:N.type==="gwt"?"Source slice YAML":"Source"}),b.jsx("pre",{children:P})]})}function qk({report:e,onSelect:n,open:s,onOpen:a,onClose:o}){const c=e?.errors??0,u=e?.warnings??0,d=c+u;return b.jsxs(b.Fragment,{children:[b.jsxs("button",{type:"button",className:`validation-fab ${c>0?"has-errors":u>0?"has-warnings":""}`,onClick:a,"aria-expanded":s,"aria-controls":"validation-panel",title:"Open validation",children:[b.jsx("span",{"aria-hidden":"true",children:"!"}),d>0?b.jsx("strong",{"aria-label":`${d} validation findings`,children:d}):null]}),s?b.jsxs("aside",{className:"panel validation-drawer",id:"validation-panel",children:[b.jsxs("div",{className:"panel-heading",children:[b.jsx("h2",{children:"Validation"}),b.jsx("button",{type:"button",className:"panel-close",onClick:o,"aria-label":"Close validation",children:"Close"})]}),e?b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"status-row",children:[b.jsxs("span",{className:"status error",children:[e.errors," errors"]}),b.jsxs("span",{className:"status warning",children:[e.warnings," warnings"]})]}),b.jsx("div",{className:"findings-list",children:e.findings.length===0?b.jsx("p",{className:"muted",children:"No validation findings."}):e.findings.map(h=>b.jsxs("div",{className:`finding finding-${h.severity}`,children:[b.jsxs("div",{className:"finding-header",children:[b.jsx("strong",{children:h.check}),h.nodeId?b.jsx("button",{type:"button",onClick:()=>n(h.nodeId),children:"Focus"}):null]}),b.jsx("span",{children:h.message}),h.path?b.jsx("code",{children:h.path}):null]},h.id))})]}):b.jsx("p",{className:"muted",children:"Loading validation..."})]}):null]})}function Vk(){const[e,n]=V.useState(),[s,a]=V.useState(),[o,c]=V.useState(),[u,d]=V.useState(()=>window.__EMVIZ_EXPORT__?.timelineId),[h,p]=V.useState("auto"),[y,g]=V.useState(()=>new Map),v=e?eO(e,yh(u,!!o)):"",x=V.useMemo(()=>v?tO(v):new Set,[v]),E=y.get(v)??x,A=V.useCallback(J=>{v&&(g(he=>new Map(he).set(v,J)),nO(v,J))},[v]),T=V.useCallback(J=>{const he=new Set(E);he.has(J)?he.delete(J):he.add(J),A(he)},[A,E]),[C,k]=V.useState("all"),[_,N]=V.useState({actorIds:[],includeUnassigned:!1}),j=V.useRef(void 0),[D,B]=V.useState("loading"),[R,U]=V.useState("remote"),[q,Y]=V.useState(),[Z,le]=V.useState(!1),[L,K]=V.useState("idle"),[O,H]=V.useState(),[$,X]=V.useState(()=>{try{return fk(sessionStorage.getItem("emviz:feedback-workspace:v1"))}catch{return Bm()}}),{drafts:se,queue:w}=$,[z,F]=V.useState(),[P,fe]=V.useState("details"),[de,ie]=V.useState(),te=V.useCallback(J=>{X(he=>{const Ne=typeof J=="function"?J(he.queue):J;return Ne===he.queue?he:{...he,queue:Ne}})},[]);V.useEffect(()=>{if($.recoveryWarning){F($.recoveryWarning);return}try{sessionStorage.setItem("emviz:feedback-workspace:v1",dk($)),F(void 0)}catch{F("Browser storage is unavailable. Your drafts and Queue are kept in this tab, but reloading the page may lose them.")}},[$]);const[oe,ve]=V.useState(),[Se,me]=V.useState(),ge=ms(e,oe)?.id,xe=ms(e,Se)?.id,Ce=V.useRef(null),[Ue,Pe]=V.useState([]),[zt,ot]=V.useState([]),[xt,Dt]=V.useState(""),[kn,_t]=V.useState(),[Ke,ut]=V.useState(),[Ut,Lt]=V.useState(!1),{setCenter:jt,fitView:hn}=fr(),[mn,Ml]=V.useState("current"),Fe=hk(!window.__EMVIZ_EXPORT__&&R==="remote"&&D!=="import",mn);V.useEffect(()=>{Fe.snapshot&&te(J=>ck(J,Fe.snapshot))},[Fe.snapshot,te]);const It=V.useRef(void 0),mt=Fe.snapshot?JSON.stringify([Fe.snapshot.sessionId,Fe.snapshot.revision,mn,Fe.snapshot.feedback.request?.id,Fe.snapshot.feedback.status]):void 0,pn={...Fe,connection:R!=="remote"||window.__EMVIZ_EXPORT__?"unavailable":Fe.connection==="live"&&mt&&It.current?.key!==mt?"checking":Fe.connection};V.useEffect(()=>{if(window.__EMVIZ_EXPORT__?.project){n(window.__EMVIZ_EXPORT__.project),a(window.__EMVIZ_EXPORT__.report),c(window.__EMVIZ_EXPORT__.diff),B("ready"),window.setTimeout(()=>{hn({padding:.18,duration:300})},50);return}if(R==="local"||Fe.connection!=="unavailable")return;let J=!1;return Promise.all([Ho("/api/model").then(he=>he.json()),Ho("/api/validation").then(he=>he.ok?he.json():void 0).catch(()=>{}),Ho("/api/diff").then(he=>he.ok?he.json():void 0).catch(()=>{})]).then(([he,Ne,Ie])=>{if(!J){if(!he||!Array.isArray(he.nodes)||!Array.isArray(he.edges))throw new Error("No project server is available.");n(he),a(Ne),c(Ie),B("ready"),window.setTimeout(()=>{hn({padding:.18,duration:300})},50)}}).catch(()=>{J||B("import")}),()=>{J=!0}},[hn,Fe.connection,R]),V.useEffect(()=>{const J=Fe.snapshot;if(!J||Fe.snapshotView!==mn)return;const he=mt;if(It.current?.key===he)return;const Ne=!It.current;It.current&&It.current.sessionId!==J.sessionId&&(ve(void 0),me(void 0),N({actorIds:[],includeUnassigned:!1}),Pe([]),ot([]),ut(void 0)),It.current={key:he,sessionId:J.sessionId},n(J.project),a(J.validation),c(J.diff),B("ready"),_t(void 0),Ne&&window.setTimeout(()=>{hn({padding:.18,duration:300})},50)},[hn,Fe.snapshot,Fe.snapshotView,mt,mn]);const At=V.useMemo(()=>e?lw(e,o?.previousNodes):[],[e,o?.previousNodes]),Ol=!!(e?.nodes.some(J=>J.type==="screen"&&!J.actors?.length)||Object.values(o?.previousNodes??{}).some(J=>J.type==="screen"&&!J.actors?.length));V.useEffect(()=>{if(!e)return;const J=j.current!==e.root;j.current=e.root,N(he=>J?{actorIds:[],includeUnassigned:!1}:T3(e,he,o?.previousNodes))},[e,o?.previousNodes]),V.useEffect(()=>{e&&(oe&&!ms(e,oe)&&ve(void 0),Se&&!ms(e,Se)&&me(void 0),Pe(J=>J.filter(he=>ms(e,he))),ot(J=>J.filter(he=>ms(e,he))))},[e,oe,Se]);const pt=V.useMemo(()=>e?.nodes.find(J=>J.id===ge),[e,ge]),Ri=Fe.snapshot?.sessionId,Qn=Ri&&pt?Ws(Ri,pt):void 0;V.useEffect(()=>ie(void 0),[Qn]);const ri=(J,he)=>{!Ri||!pt||X(Ne=>({...Ne,drafts:Z3(Ne.drafts,Ri,pt,J,he)}))},Bi=V.useMemo(()=>s?.findings.filter(J=>J.nodeId===ge)??[],[s,ge]),qt=V.useMemo(()=>e?KM(e):new Map,[e]),ci=V.useMemo(()=>{if(kn)return new Set([kn]);const J=ZM(qt,Ke);if(J)return J;if(!e||!ge)return;const he=new Set;for(const Ne of e.edges)Sw(Ne.kind)&&(Ne.source===ge||Ne.target===ge)&&he.add(Ne.id);return he},[qt,kn,e,Ke,ge]),ft=V.useMemo(()=>e?eb(e,ge,{timelineId:yh(u,!!o),edgeVisibility:h,collapsedStoryIds:E,focusedEdgeIds:ci,edgeFieldFlows:qt,selectedFieldName:Ke,onSelectField:ut,diffNodeStatus:o?.nodeStatus,diffEdgeStatus:o?.edgeStatus,diffFilter:C,actorFilter:_,previousNodes:o?.previousNodes}):{nodes:[],edges:[],counts:{stories:0,slices:0,events:0}},[u,h,E,_,o?.previousNodes,o?.edgeStatus,o?.nodeStatus,C,qt,ci,e,Ke,ge]);V.useEffect(()=>{u&&e&&!e.timelines?.some(J=>J.id===u)&&d(void 0)},[e,u]),V.useEffect(()=>{if(!u||o)return;const J=new Set(ft.nodes.map(he=>he.id));ge&&!J.has(ge)&&ve(void 0),xe&&!J.has(xe)&&me(void 0)},[ft.nodes,u,ge,xe,o]);const ia=V.useMemo(()=>{if(!e||xt.trim().length<2)return[];const J=xt.trim().toLowerCase(),he=new Set(ft.nodes.map(Ne=>Ne.id));return e.nodes.filter(Ne=>he.has(Ne.id)&&`${Ne.label} ${Ne.type} ${Ne.sourcePath??""}`.toLowerCase().includes(J)).slice(0,8)},[e,xt,ft.nodes]),Tt=V.useCallback((J,he=!0,Ne=!1)=>{let Ie=ft.nodes.find(et=>et.id===J);const tn=!!(!Ie&&u&&e?.nodes.some(et=>et.id===J));tn&&e&&(d(void 0),Ie=eb(e).nodes.find(et=>et.id===J)),_t(void 0),he&&ge&&ge!==J&&(oe&&Pe(et=>[...et,oe]),ot([]));const Fn=Ie?.data.projectNode.type==="gwt";if(Fn&&!Ce.current){const et=document.activeElement;Ce.current=et?.closest(".search-results")?document.querySelector(".search-box input"):et instanceof HTMLElement?et:null}if(Fn||(Ce.current=null),me(void 0),e&&ve(sb(e,J)),Ie&&Ne){Ie.hidden&&Ie.data.storyId&&(Ie=ft.nodes.find(vn=>vn.data.collapsed&&vn.data.storyId===Ie.data.storyId)??Ie);const et={x:Ie.position.x+(Ie.initialWidth??178)/2,y:Ie.position.y+(Ie.initialHeight??92)/2};tn?window.setTimeout(()=>{jt(et.x,et.y,{zoom:1.2,duration:350})},50):jt(et.x,et.y,{zoom:1.2,duration:350})}},[ft.nodes,e,oe,ge,jt,u]),ui=V.useCallback(()=>{ve(void 0),_t(void 0),ut(void 0),me(void 0);const J=Ce.current;Ce.current=null,J&&requestAnimationFrame(()=>{J?.isConnected?J.focus({preventScroll:!0}):document.querySelector(".canvas")?.focus({preventScroll:!0})})},[]),zn=V.useCallback(J=>{Ce.current||(Ce.current=document.activeElement instanceof HTMLElement?document.activeElement:null),e&&me(sb(e,J))},[e]),kl=V.useMemo(()=>({open:Tt,list:zn}),[Tt,zn]),gn=e?.nodes.find(J=>J.id===xe),sa=gn?e?.nodes.filter(J=>J.type==="gwt"&&(gn.sourcePath?J.sourcePath===gn.sourcePath:J.sliceTitle===gn.sliceTitle)).filter(J=>!o||C==="all"||o.nodeStatus[J.id]===C):void 0;V.useEffect(()=>{(xe||pt?.type==="gwt")&&((xe?document.querySelector(".gwt-all-list button[aria-current]"):null)??document.querySelector('.gwt-panel button:not([role="tab"])'))?.focus({preventScroll:!0})},[xe,pt?.id,pt?.type]);const aa=V.useCallback(J=>{e?.edges.find(Ne=>Ne.id===J)&&_t(J)},[e?.edges]),ws=V.useCallback(()=>{_t(void 0)},[]),xs=V.useCallback(()=>{e&&(K("exporting"),H(void 0),le(!1),zk(e,s,o,u).then(J=>{jk(`${kk(e)}.emviz.html`,J)}).catch(J=>{H(J instanceof Error?J.message:String(J))}).finally(()=>K("idle")))},[o,e,s,u]);V.useEffect(()=>{const J=he=>{he.key==="Escape"&&(le(!1),ui())};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[ui]);const la=V.useCallback(()=>{const J=Ue.at(-1);if(!J)return;Pe(Ne=>Ne.slice(0,-1)),oe&&ot(Ne=>[...Ne,oe]);const he=ms(e,J);he&&Tt(he.id,!1)},[Ue,Tt,e,oe]),oa=V.useCallback(()=>{const J=zt.at(-1);if(!J)return;ot(Ne=>Ne.slice(0,-1)),oe&&Pe(Ne=>[...Ne,oe]);const he=ms(e,J);he&&Tt(he.id,!1)},[Tt,zt,e,oe]),yn=V.useCallback(J=>{Rk(J).then(he=>{const Ne=Bk(he),Ie=A3(he,{root:iO(Ne?.model?.id,crypto.getRandomValues(new Uint32Array(4)).join("-"))}),tn=Ie;tn.graphSidecar=Ne??{model:{id:"browser_import",name:"Browser Import"}},d(void 0),U("local"),n(tn);const Fn=xk(Ie),et=$k(tn);a({errors:Fn.errors,warnings:Fn.warnings+et.filter(vn=>vn.severity==="warning").length,findings:[...Fn.findings,...et]}),c(void 0),me(void 0),k("all"),N({actorIds:[],includeUnassigned:!1}),ve(void 0),_t(void 0),ut(void 0),Pe([]),ot([]),B("ready"),Y(void 0),window.setTimeout(()=>{hn({padding:.18,duration:300})},50)}).catch(he=>{Y(he instanceof Error?he.message:String(he)),B("import")})},[hn]);return D==="import"?b.jsx(Hk,{onImport:yn,error:q}):e?b.jsxs("div",{className:`app-shell ${o?"diff-mode":""}`,children:[b.jsxs("header",{className:"toolbar",children:[b.jsxs("div",{className:"model-summary",children:[b.jsx("strong",{children:"emviz"}),b.jsxs("span",{children:[ft.counts.stories," stories"]}),b.jsxs("span",{children:[ft.counts.slices," slices"]}),b.jsxs("span",{children:[ft.counts.events," events"]})]}),e.timelines?.length?b.jsxs("label",{className:"timeline-picker",children:[b.jsx("span",{children:"Timeline"}),b.jsxs("select",{"aria-label":"Timeline",disabled:!!o,title:o?"Diff shows all stories, including removed items.":void 0,value:yh(u,!!o)??"",onChange:J=>{d(J.target.value||void 0),ve(void 0),me(void 0),Pe([]),ot([]),_t(void 0),ut(void 0),window.setTimeout(()=>{hn({padding:.18,duration:300})},50)},children:[b.jsx("option",{value:"",children:"All stories"}),e.timelines?.map(J=>b.jsxs("option",{value:J.id,children:[J.name," · ",J.path]},J.id))]})]}):null,b.jsxs("label",{className:"edge-visibility-picker",children:[b.jsx("span",{children:"Edges"}),b.jsxs("select",{"aria-label":"Edge visibility",value:h,onChange:J=>p(J.target.value),children:[b.jsx("option",{value:"auto",children:"Auto"}),b.jsx("option",{value:"intra-slice",children:"Intra-slice only"}),b.jsx("option",{value:"all",children:"All"})]})]}),b.jsxs("div",{className:"segmented story-controls","aria-label":"Story visibility",children:[b.jsx("button",{type:"button",onClick:()=>A(new Set),children:"Expand all stories"}),b.jsx("button",{type:"button",onClick:()=>A(new Set(e.stories.map(en))),children:"Collapse all stories"})]}),b.jsxs("div",{className:"segmented toolbar-history","aria-label":"Selection history",children:[b.jsx("button",{type:"button",disabled:Ue.length===0,onClick:la,"aria-label":"Back",title:"Back",children:"←"}),b.jsx("button",{type:"button",disabled:zt.length===0,onClick:oa,"aria-label":"Forward",title:"Forward",children:"→"})]}),b.jsxs("div",{className:"search-box",children:[b.jsx("input",{"aria-label":"Search event model",value:xt,onChange:J=>Dt(J.target.value),placeholder:"Search nodes by name or type..."}),ia.length>0?b.jsx("div",{className:"search-results",children:ia.map(J=>b.jsxs("button",{type:"button",onClick:()=>{Tt(J.id),Dt("")},children:[b.jsx("span",{children:J.label}),b.jsx("small",{children:J.type})]},J.id))}):null]}),b.jsxs("details",{className:"actor-filter",onKeyDown:J=>{J.key==="Escape"&&(J.preventDefault(),J.stopPropagation(),J.currentTarget.open=!1,J.currentTarget.querySelector("summary")?.focus())},children:[b.jsxs("summary",{children:["Actors · ",_.actorIds.length+Number(_.includeUnassigned)||"All"]}),b.jsxs("div",{className:"actor-filter-popover",children:[b.jsx("p",{children:"Match any selected actor. Related system steps stay visible."}),b.jsxs("div",{className:"actor-filter-options",role:"group","aria-label":"Filter by actor",children:[At.map(J=>b.jsxs("label",{children:[b.jsx("input",{type:"checkbox","aria-label":J.name===J.id?J.name:J.name+" ("+J.id+")",checked:_.actorIds.includes(J.id),onChange:he=>{const Ne=he.target.checked;N(Ie=>({...Ie,actorIds:Ne?[...Ie.actorIds,J.id]:Ie.actorIds.filter(tn=>tn!==J.id)}))}}),b.jsx("i",{className:"actor-swatch","aria-hidden":"true",style:{backgroundColor:J.color}}),b.jsxs("span",{children:[J.name,J.name!==J.id?b.jsx("small",{children:J.id}):null]})]},J.id)),Ol?b.jsxs("label",{children:[b.jsx("input",{type:"checkbox","aria-label":"Unassigned screens",checked:_.includeUnassigned,onChange:J=>{const he=J.target.checked;N(Ne=>({...Ne,includeUnassigned:he}))}}),b.jsx("span",{children:"Unassigned screens"})]}):null]}),b.jsx("button",{type:"button",disabled:_.actorIds.length===0&&!_.includeUnassigned,onClick:()=>N({actorIds:[],includeUnassigned:!1}),children:"Clear actors"})]})]}),b.jsxs("div",{className:"toolbar-menu",children:[b.jsx("button",{type:"button",className:"menu-trigger",onClick:()=>le(J=>!J),"aria-haspopup":"menu","aria-expanded":Z,"aria-label":"Open menu",title:"Open menu",children:"..."}),Z?b.jsx("div",{className:"menu-popover",role:"menu",children:b.jsx("button",{type:"button",role:"menuitem",onClick:xs,disabled:L==="exporting",children:L==="exporting"?"Exporting...":"Export"})}):null]}),O?b.jsx("div",{className:"toolbar-error",role:"alert",children:O}):null]}),b.jsxs("div",{className:"workspace",children:[b.jsx(qk,{report:s,onSelect:Tt,open:Ut,onOpen:()=>Lt(!0),onClose:()=>Lt(!1)}),o?b.jsx(Dk,{diff:o,filter:C,onFilter:k,onSelect:Tt}):null,b.jsx(Ik,{diff:o,tab:P,onTab:fe,oldVersionId:de,onVersion:ie,agentPanel:b.jsxs(b.Fragment,{children:[z?b.jsxs("div",{className:"feedback-storage-warning",children:[b.jsx("p",{className:"feedback-warning",role:"alert",children:z}),$.recoveryWarning?b.jsx("button",{type:"button",onClick:()=>X(J=>({...J,recoveryWarning:void 0})),children:"Replace damaged saved feedback"}):null]}):null,b.jsx(mk,{session:pn,drafts:Object.values(se),view:mn,onView:J=>{Ml(J),k("all")},node:pt,diff:o,showingBefore:!!(jm(o,pt)&&de===pt?.id)||!!(pt&&o?.nodeStatus[pt.id]==="removed"),message:Qn?se[Qn]?.message??"":"",onMessageChange:ri,onAdded:J=>ri("",J),queue:w,onQueueChange:te,storageNeedsReview:!!$.recoveryWarning})]}),gwtList:sa,onGwtList:zn,onClose:ui,onFocusNode:J=>Tt(J,!0,!0),project:e,selectedNode:pt,findings:Bi,selectedFieldName:Ke,onSelect:Tt,onSelectField:ut,onClearField:()=>ut(void 0),onPreviewConnection:aa,onClearPreview:ws},(gn??pt)?.type==="gwt"?`gwt:${(gn??pt)?.sourcePath??(gn??pt)?.sliceTitle}`:"selection"),b.jsxs(K3,{children:[(_.actorIds.length>0||_.includeUnassigned)&&!ft.nodes.some(J=>!J.hidden&&(J.data.projectNode.type!=="story"&&J.data.projectNode.type!=="slice"||J.data.collapsed&&(J.data.sliceCount??0)>0))?b.jsx("div",{className:"actor-empty",role:"status",children:"No screens match the selected actors and current filters."}):null,b.jsx(yw.Provider,{value:T,children:b.jsx(vw.Provider,{value:kl,children:b.jsxs(mM,{nodes:ft.nodes,edges:ft.edges,nodeTypes:Ak,edgeTypes:Mk,onNodeClick:(J,he)=>Tt(he.id),fitView:!0,minZoom:.2,maxZoom:1.8,nodesDraggable:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomActivationKeyCode:null,panActivationKeyCode:null,zoomOnDoubleClick:!1,autoPanOnNodeFocus:!1,colorMode:"light",children:[b.jsx(wM,{gap:18,size:1}),b.jsx(CM,{})]})})})]})]})]}):b.jsx("div",{className:"loading",children:b.jsx("div",{children:Fe.error?b.jsxs(b.Fragment,{children:[b.jsx("p",{role:"alert",children:Fe.error}),b.jsx("button",{type:"button",onClick:Fe.refresh,children:"Retry connection"})]}):"Loading event model..."})})}function Yk(){return b.jsx(Q1,{children:b.jsx(Vk,{})})}jE.createRoot(document.getElementById("root")).render(b.jsx(Sl.StrictMode,{children:b.jsx(Yk,{})}));
|