@swarmvaultai/viewer 3.1.0 β 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/assets/index-B0uvRPDV.css +1 -0
- package/dist/assets/index-KHPMdnQT.js +368 -0
- package/dist/index.html +2 -2
- package/dist/lib.d.ts +66 -1
- package/dist/lib.js +63 -0
- package/package.json +10 -9
- package/LICENSE +0 -21
- package/dist/assets/index-CRcCxyS8.css +0 -1
- package/dist/assets/index-DejkTRrx.js +0 -368
|
@@ -1,368 +0,0 @@
|
|
|
1
|
-
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const s of l.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function xu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wv={exports:{}},Po={};var TE;function K_(){if(TE)return Po;TE=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,l){var s=null;if(l!==void 0&&(s=""+l),i.key!==void 0&&(s=""+i.key),"key"in i){l={};for(var u in i)u!=="key"&&(l[u]=i[u])}else l=i;return i=l.ref,{$$typeof:t,type:r,key:s,ref:i!==void 0?i:null,props:l}}return Po.Fragment=e,Po.jsx=n,Po.jsxs=n,Po}var DE;function Y_(){return DE||(DE=1,wv.exports=K_()),wv.exports}var D=Y_(),Sv={exports:{}},wt={};var AE;function X_(){if(AE)return wt;AE=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),p=Symbol.iterator;function m(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function E(F,q,L){this.props=F,this.context=q,this.refs=w,this.updater=L||y}E.prototype.isReactComponent={},E.prototype.setState=function(F,q){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,q,"setState")},E.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function C(){}C.prototype=E.prototype;function T(F,q,L){this.props=F,this.context=q,this.refs=w,this.updater=L||y}var A=T.prototype=new C;A.constructor=T,S(A,E.prototype),A.isPureReactComponent=!0;var k=Array.isArray;function N(){}var _={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function U(F,q,L){var W=L.ref;return{$$typeof:t,type:F,key:q,ref:W!==void 0?W:null,props:L}}function M(F,q){return U(F.type,q,F.props)}function I(F){return typeof F=="object"&&F!==null&&F.$$typeof===t}function P(F){var q={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(L){return q[L]})}var j=/\/+/g;function K(F,q){return typeof F=="object"&&F!==null&&F.key!=null?P(""+F.key):q.toString(36)}function $(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(N,N):(F.status="pending",F.then(function(q){F.status==="pending"&&(F.status="fulfilled",F.value=q)},function(q){F.status==="pending"&&(F.status="rejected",F.reason=q)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function B(F,q,L,W,ae){var se=typeof F;(se==="undefined"||se==="boolean")&&(F=null);var me=!1;if(F===null)me=!0;else switch(se){case"bigint":case"string":case"number":me=!0;break;case"object":switch(F.$$typeof){case t:case e:me=!0;break;case h:return me=F._init,B(me(F._payload),q,L,W,ae)}}if(me)return ae=ae(F),me=W===""?"."+K(F,0):W,k(ae)?(L="",me!=null&&(L=me.replace(j,"$&/")+"/"),B(ae,q,L,"",function(ee){return ee})):ae!=null&&(I(ae)&&(ae=M(ae,L+(ae.key==null||F&&F.key===ae.key?"":(""+ae.key).replace(j,"$&/")+"/")+me)),q.push(ae)),1;me=0;var Ne=W===""?".":W+":";if(k(F))for(var pe=0;pe<F.length;pe++)W=F[pe],se=Ne+K(W,pe),me+=B(W,q,L,se,ae);else if(pe=m(F),typeof pe=="function")for(F=pe.call(F),pe=0;!(W=F.next()).done;)W=W.value,se=Ne+K(W,pe++),me+=B(W,q,L,se,ae);else if(se==="object"){if(typeof F.then=="function")return B($(F),q,L,W,ae);throw q=String(F),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return me}function H(F,q,L){if(F==null)return F;var W=[],ae=0;return B(F,W,"","",function(se){return q.call(L,se,ae++)}),W}function Y(F){if(F._status===-1){var q=F._result;q=q(),q.then(function(L){(F._status===0||F._status===-1)&&(F._status=1,F._result=L)},function(L){(F._status===0||F._status===-1)&&(F._status=2,F._result=L)}),F._status===-1&&(F._status=0,F._result=q)}if(F._status===1)return F._result.default;throw F._result}var Q=typeof reportError=="function"?reportError:function(F){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof F=="object"&&F!==null&&typeof F.message=="string"?String(F.message):String(F),error:F});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",F);return}console.error(F)},z={map:H,forEach:function(F,q,L){H(F,function(){q.apply(this,arguments)},L)},count:function(F){var q=0;return H(F,function(){q++}),q},toArray:function(F){return H(F,function(q){return q})||[]},only:function(F){if(!I(F))throw Error("React.Children.only expected to receive a single React element child.");return F}};return wt.Activity=v,wt.Children=z,wt.Component=E,wt.Fragment=n,wt.Profiler=i,wt.PureComponent=T,wt.StrictMode=r,wt.Suspense=f,wt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,wt.__COMPILER_RUNTIME={__proto__:null,c:function(F){return _.H.useMemoCache(F)}},wt.cache=function(F){return function(){return F.apply(null,arguments)}},wt.cacheSignal=function(){return null},wt.cloneElement=function(F,q,L){if(F==null)throw Error("The argument must be a React element, but you passed "+F+".");var W=S({},F.props),ae=F.key;if(q!=null)for(se in q.key!==void 0&&(ae=""+q.key),q)!O.call(q,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&q.ref===void 0||(W[se]=q[se]);var se=arguments.length-2;if(se===1)W.children=L;else if(1<se){for(var me=Array(se),Ne=0;Ne<se;Ne++)me[Ne]=arguments[Ne+2];W.children=me}return U(F.type,ae,W)},wt.createContext=function(F){return F={$$typeof:s,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null},F.Provider=F,F.Consumer={$$typeof:l,_context:F},F},wt.createElement=function(F,q,L){var W,ae={},se=null;if(q!=null)for(W in q.key!==void 0&&(se=""+q.key),q)O.call(q,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(ae[W]=q[W]);var me=arguments.length-2;if(me===1)ae.children=L;else if(1<me){for(var Ne=Array(me),pe=0;pe<me;pe++)Ne[pe]=arguments[pe+2];ae.children=Ne}if(F&&F.defaultProps)for(W in me=F.defaultProps,me)ae[W]===void 0&&(ae[W]=me[W]);return U(F,se,ae)},wt.createRef=function(){return{current:null}},wt.forwardRef=function(F){return{$$typeof:u,render:F}},wt.isValidElement=I,wt.lazy=function(F){return{$$typeof:h,_payload:{_status:-1,_result:F},_init:Y}},wt.memo=function(F,q){return{$$typeof:c,type:F,compare:q===void 0?null:q}},wt.startTransition=function(F){var q=_.T,L={};_.T=L;try{var W=F(),ae=_.S;ae!==null&&ae(L,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(N,Q)}catch(se){Q(se)}finally{q!==null&&L.types!==null&&(q.types=L.types),_.T=q}},wt.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},wt.use=function(F){return _.H.use(F)},wt.useActionState=function(F,q,L){return _.H.useActionState(F,q,L)},wt.useCallback=function(F,q){return _.H.useCallback(F,q)},wt.useContext=function(F){return _.H.useContext(F)},wt.useDebugValue=function(){},wt.useDeferredValue=function(F,q){return _.H.useDeferredValue(F,q)},wt.useEffect=function(F,q){return _.H.useEffect(F,q)},wt.useEffectEvent=function(F){return _.H.useEffectEvent(F)},wt.useId=function(){return _.H.useId()},wt.useImperativeHandle=function(F,q,L){return _.H.useImperativeHandle(F,q,L)},wt.useInsertionEffect=function(F,q){return _.H.useInsertionEffect(F,q)},wt.useLayoutEffect=function(F,q){return _.H.useLayoutEffect(F,q)},wt.useMemo=function(F,q){return _.H.useMemo(F,q)},wt.useOptimistic=function(F,q){return _.H.useOptimistic(F,q)},wt.useReducer=function(F,q,L){return _.H.useReducer(F,q,L)},wt.useRef=function(F){return _.H.useRef(F)},wt.useState=function(F){return _.H.useState(F)},wt.useSyncExternalStore=function(F,q,L){return _.H.useSyncExternalStore(F,q,L)},wt.useTransition=function(){return _.H.useTransition()},wt.version="19.2.4",wt}var _E;function am(){return _E||(_E=1,Sv.exports=X_()),Sv.exports}var ge=am();const Z_=xu(ge);var Cv={exports:{}},Uo={},Tv={exports:{}},Dv={};var NE;function Q_(){return NE||(NE=1,(function(t){function e(B,H){var Y=B.length;B.push(H);e:for(;0<Y;){var Q=Y-1>>>1,z=B[Q];if(0<i(z,H))B[Q]=H,B[Y]=z,Y=Q;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var H=B[0],Y=B.pop();if(Y!==H){B[0]=Y;e:for(var Q=0,z=B.length,F=z>>>1;Q<F;){var q=2*(Q+1)-1,L=B[q],W=q+1,ae=B[W];if(0>i(L,Y))W<z&&0>i(ae,L)?(B[Q]=ae,B[W]=Y,Q=W):(B[Q]=L,B[q]=Y,Q=q);else if(W<z&&0>i(ae,Y))B[Q]=ae,B[W]=Y,Q=W;else break e}}return H}function i(B,H){var Y=B.sortIndex-H.sortIndex;return Y!==0?Y:B.id-H.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var s=Date,u=s.now();t.unstable_now=function(){return s.now()-u}}var f=[],c=[],h=1,v=null,p=3,m=!1,y=!1,S=!1,w=!1,E=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function A(B){for(var H=n(c);H!==null;){if(H.callback===null)r(c);else if(H.startTime<=B)r(c),H.sortIndex=H.expirationTime,e(f,H);else break;H=n(c)}}function k(B){if(S=!1,A(B),!y)if(n(f)!==null)y=!0,N||(N=!0,P());else{var H=n(c);H!==null&&$(k,H.startTime-B)}}var N=!1,_=-1,O=5,U=-1;function M(){return w?!0:!(t.unstable_now()-U<O)}function I(){if(w=!1,N){var B=t.unstable_now();U=B;var H=!0;try{e:{y=!1,S&&(S=!1,C(_),_=-1),m=!0;var Y=p;try{t:{for(A(B),v=n(f);v!==null&&!(v.expirationTime>B&&M());){var Q=v.callback;if(typeof Q=="function"){v.callback=null,p=v.priorityLevel;var z=Q(v.expirationTime<=B);if(B=t.unstable_now(),typeof z=="function"){v.callback=z,A(B),H=!0;break t}v===n(f)&&r(f),A(B)}else r(f);v=n(f)}if(v!==null)H=!0;else{var F=n(c);F!==null&&$(k,F.startTime-B),H=!1}}break e}finally{v=null,p=Y,m=!1}H=void 0}}finally{H?P():N=!1}}}var P;if(typeof T=="function")P=function(){T(I)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,K=j.port2;j.port1.onmessage=I,P=function(){K.postMessage(null)}}else P=function(){E(I,0)};function $(B,H){_=E(function(){B(t.unstable_now())},H)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(B){B.callback=null},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_next=function(B){switch(p){case 1:case 2:case 3:var H=3;break;default:H=p}var Y=p;p=H;try{return B()}finally{p=Y}},t.unstable_requestPaint=function(){w=!0},t.unstable_runWithPriority=function(B,H){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var Y=p;p=B;try{return H()}finally{p=Y}},t.unstable_scheduleCallback=function(B,H,Y){var Q=t.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?Q+Y:Q):Y=Q,B){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=Y+z,B={id:h++,callback:H,priorityLevel:B,startTime:Y,expirationTime:z,sortIndex:-1},Y>Q?(B.sortIndex=Y,e(c,B),n(f)===null&&B===n(c)&&(S?(C(_),_=-1):S=!0,$(k,Y-Q))):(B.sortIndex=z,e(f,B),y||m||(y=!0,N||(N=!0,P()))),B},t.unstable_shouldYield=M,t.unstable_wrapCallback=function(B){var H=p;return function(){var Y=p;p=H;try{return B.apply(this,arguments)}finally{p=Y}}}})(Dv)),Dv}var kE;function W_(){return kE||(kE=1,Tv.exports=Q_()),Tv.exports}var Av={exports:{}},ur={};var RE;function J_(){if(RE)return ur;RE=1;var t=am();function e(f){var c="https://react.dev/errors/"+f;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+f+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function l(f,c,h){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:v==null?null:""+v,children:f,containerInfo:c,implementation:h}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,c){if(f==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return ur.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ur.createPortal=function(f,c){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(e(299));return l(f,c,null,h)},ur.flushSync=function(f){var c=s.T,h=r.p;try{if(s.T=null,r.p=2,f)return f()}finally{s.T=c,r.p=h,r.d.f()}},ur.preconnect=function(f,c){typeof f=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,r.d.C(f,c))},ur.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},ur.preinit=function(f,c){if(typeof f=="string"&&c&&typeof c.as=="string"){var h=c.as,v=u(h,c.crossOrigin),p=typeof c.integrity=="string"?c.integrity:void 0,m=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;h==="style"?r.d.S(f,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:v,integrity:p,fetchPriority:m}):h==="script"&&r.d.X(f,{crossOrigin:v,integrity:p,fetchPriority:m,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},ur.preinitModule=function(f,c){if(typeof f=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var h=u(c.as,c.crossOrigin);r.d.M(f,{crossOrigin:h,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&r.d.M(f)},ur.preload=function(f,c){if(typeof f=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var h=c.as,v=u(h,c.crossOrigin);r.d.L(f,h,{crossOrigin:v,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},ur.preloadModule=function(f,c){if(typeof f=="string")if(c){var h=u(c.as,c.crossOrigin);r.d.m(f,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:h,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else r.d.m(f)},ur.requestFormReset=function(f){r.d.r(f)},ur.unstable_batchedUpdates=function(f,c){return f(c)},ur.useFormState=function(f,c,h){return s.H.useFormState(f,c,h)},ur.useFormStatus=function(){return s.H.useHostTransitionStatus()},ur.version="19.2.4",ur}var ME;function eN(){if(ME)return Av.exports;ME=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Av.exports=J_(),Av.exports}var OE;function tN(){if(OE)return Uo;OE=1;var t=W_(),e=am(),n=eN();function r(a){var o="https://react.dev/errors/"+a;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)o+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+a+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function l(a){var o=a,d=a;if(a.alternate)for(;o.return;)o=o.return;else{a=o;do o=a,(o.flags&4098)!==0&&(d=o.return),a=o.return;while(a)}return o.tag===3?d:null}function s(a){if(a.tag===13){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function u(a){if(a.tag===31){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function f(a){if(l(a)!==a)throw Error(r(188))}function c(a){var o=a.alternate;if(!o){if(o=l(a),o===null)throw Error(r(188));return o!==a?null:a}for(var d=a,g=o;;){var b=d.return;if(b===null)break;var x=b.alternate;if(x===null){if(g=b.return,g!==null){d=g;continue}break}if(b.child===x.child){for(x=b.child;x;){if(x===d)return f(b),a;if(x===g)return f(b),o;x=x.sibling}throw Error(r(188))}if(d.return!==g.return)d=b,g=x;else{for(var R=!1,V=b.child;V;){if(V===d){R=!0,d=b,g=x;break}if(V===g){R=!0,g=b,d=x;break}V=V.sibling}if(!R){for(V=x.child;V;){if(V===d){R=!0,d=x,g=b;break}if(V===g){R=!0,g=x,d=b;break}V=V.sibling}if(!R)throw Error(r(189))}}if(d.alternate!==g)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?a:o}function h(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a;for(a=a.child;a!==null;){if(o=h(a),o!==null)return o;a=a.sibling}return null}var v=Object.assign,p=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),T=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function P(a){return a===null||typeof a!="object"?null:(a=I&&a[I]||a["@@iterator"],typeof a=="function"?a:null)}var j=Symbol.for("react.client.reference");function K(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===j?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case S:return"Fragment";case E:return"Profiler";case w:return"StrictMode";case k:return"Suspense";case N:return"SuspenseList";case U:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case y:return"Portal";case T:return a.displayName||"Context";case C:return(a._context.displayName||"Context")+".Consumer";case A:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case _:return o=a.displayName||null,o!==null?o:K(a.type)||"Memo";case O:o=a._payload,a=a._init;try{return K(a(o))}catch{}}return null}var $=Array.isArray,B=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},Q=[],z=-1;function F(a){return{current:a}}function q(a){0>z||(a.current=Q[z],Q[z]=null,z--)}function L(a,o){z++,Q[z]=a.current,a.current=o}var W=F(null),ae=F(null),se=F(null),me=F(null);function Ne(a,o){switch(L(se,o),L(ae,a),L(W,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?Y0(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=Y0(o),a=X0(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}q(W),L(W,a)}function pe(){q(W),q(ae),q(se)}function ee(a){a.memoizedState!==null&&L(me,a);var o=W.current,d=X0(o,a.type);o!==d&&(L(ae,a),L(W,d))}function le(a){ae.current===a&&(q(W),q(ae)),me.current===a&&(q(me),Lo._currentValue=Y)}var fe,xe;function Re(a){if(fe===void 0)try{throw Error()}catch(d){var o=d.stack.trim().match(/\n( *(at )?)/);fe=o&&o[1]||"",xe=-1<d.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+fe+a+xe}var Xe=!1;function Ke(a,o){if(!a||Xe)return"";Xe=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(o){var Ae=function(){throw Error()};if(Object.defineProperty(Ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ae,[])}catch(ye){var ve=ye}Reflect.construct(a,[],Ae)}else{try{Ae.call()}catch(ye){ve=ye}a.call(Ae.prototype)}}else{try{throw Error()}catch(ye){ve=ye}(Ae=a())&&typeof Ae.catch=="function"&&Ae.catch(function(){})}}catch(ye){if(ye&&ve&&typeof ye.stack=="string")return[ye.stack,ve.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=g.DetermineComponentFrameRoot(),R=x[0],V=x[1];if(R&&V){var Z=R.split(`
|
|
4
|
-
`),he=V.split(`
|
|
5
|
-
`);for(b=g=0;g<Z.length&&!Z[g].includes("DetermineComponentFrameRoot");)g++;for(;b<he.length&&!he[b].includes("DetermineComponentFrameRoot");)b++;if(g===Z.length||b===he.length)for(g=Z.length-1,b=he.length-1;1<=g&&0<=b&&Z[g]!==he[b];)b--;for(;1<=g&&0<=b;g--,b--)if(Z[g]!==he[b]){if(g!==1||b!==1)do if(g--,b--,0>b||Z[g]!==he[b]){var we=`
|
|
6
|
-
`+Z[g].replace(" at new "," at ");return a.displayName&&we.includes("<anonymous>")&&(we=we.replace("<anonymous>",a.displayName)),we}while(1<=g&&0<=b);break}}}finally{Xe=!1,Error.prepareStackTrace=d}return(d=a?a.displayName||a.name:"")?Re(d):""}function ot(a,o){switch(a.tag){case 26:case 27:case 5:return Re(a.type);case 16:return Re("Lazy");case 13:return a.child!==o&&o!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return Ke(a.type,!1);case 11:return Ke(a.type.render,!1);case 1:return Ke(a.type,!0);case 31:return Re("Activity");default:return""}}function et(a){try{var o="",d=null;do o+=ot(a,d),d=a,a=a.return;while(a);return o}catch(g){return`
|
|
7
|
-
Error generating stack: `+g.message+`
|
|
8
|
-
`+g.stack}}var We=Object.prototype.hasOwnProperty,ze=t.unstable_scheduleCallback,Je=t.unstable_cancelCallback,Ye=t.unstable_shouldYield,ut=t.unstable_requestPaint,je=t.unstable_now,gt=t.unstable_getCurrentPriorityLevel,ue=t.unstable_ImmediatePriority,Se=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,Ve=t.unstable_LowPriority,qe=t.unstable_IdlePriority,Fe=t.log,be=t.unstable_setDisableYieldValue,G=null,ne=null;function de(a){if(typeof Fe=="function"&&be(a),ne&&typeof ne.setStrictMode=="function")try{ne.setStrictMode(G,a)}catch{}}var oe=Math.clz32?Math.clz32:De,Ee=Math.log,Pe=Math.LN2;function De(a){return a>>>=0,a===0?32:31-(Ee(a)/Pe|0)|0}var Qe=256,$e=262144,rt=4194304;function it(a){var o=a&42;if(o!==0)return o;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function X(a,o,d){var g=a.pendingLanes;if(g===0)return 0;var b=0,x=a.suspendedLanes,R=a.pingedLanes;a=a.warmLanes;var V=g&134217727;return V!==0?(g=V&~x,g!==0?b=it(g):(R&=V,R!==0?b=it(R):d||(d=V&~a,d!==0&&(b=it(d))))):(V=g&~x,V!==0?b=it(V):R!==0?b=it(R):d||(d=g&~a,d!==0&&(b=it(d)))),b===0?0:o!==0&&o!==b&&(o&x)===0&&(x=b&-b,d=o&-o,x>=d||x===32&&(d&4194048)!==0)?o:b}function re(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function Ce(a,o){switch(a){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 Oe(){var a=rt;return rt<<=1,(rt&62914560)===0&&(rt=4194304),a}function yt(a){for(var o=[],d=0;31>d;d++)o.push(a);return o}function dt(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function He(a,o,d,g,b,x){var R=a.pendingLanes;a.pendingLanes=d,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=d,a.entangledLanes&=d,a.errorRecoveryDisabledLanes&=d,a.shellSuspendCounter=0;var V=a.entanglements,Z=a.expirationTimes,he=a.hiddenUpdates;for(d=R&~d;0<d;){var we=31-oe(d),Ae=1<<we;V[we]=0,Z[we]=-1;var ve=he[we];if(ve!==null)for(he[we]=null,we=0;we<ve.length;we++){var ye=ve[we];ye!==null&&(ye.lane&=-536870913)}d&=~Ae}g!==0&&Be(a,g,0),x!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=x&~(R&~o))}function Be(a,o,d){a.pendingLanes|=o,a.suspendedLanes&=~o;var g=31-oe(o);a.entangledLanes|=o,a.entanglements[g]=a.entanglements[g]|1073741824|d&261930}function Ze(a,o){var d=a.entangledLanes|=o;for(a=a.entanglements;d;){var g=31-oe(d),b=1<<g;b&o|a[g]&o&&(a[g]|=o),d&=~b}}function Et(a,o){var d=o&-o;return d=(d&42)!==0?1:xt(d),(d&(a.suspendedLanes|o))!==0?0:d}function xt(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Rn(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Kt(){var a=H.p;return a!==0?a:(a=window.event,a===void 0?32:yE(a.type))}function pn(a,o){var d=H.p;try{return H.p=a,o()}finally{H.p=d}}var wn=Math.random().toString(36).slice(2),Tt="__reactFiber$"+wn,mn="__reactProps$"+wn,$n="__reactContainer$"+wn,Sn="__reactEvents$"+wn,yn="__reactListeners$"+wn,bn="__reactHandles$"+wn,Vr="__reactResources$"+wn,Cn="__reactMarker$"+wn;function sr(a){delete a[Tt],delete a[mn],delete a[Sn],delete a[yn],delete a[bn]}function Un(a){var o=a[Tt];if(o)return o;for(var d=a.parentNode;d;){if(o=d[$n]||d[Tt]){if(d=o.alternate,o.child!==null||d!==null&&d.child!==null)for(a=nE(a);a!==null;){if(d=a[Tt])return d;a=nE(a)}return o}a=d,d=a.parentNode}return null}function or(a){if(a=a[Tt]||a[$n]){var o=a.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return a}return null}function $r(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a.stateNode;throw Error(r(33))}function Kr(a){var o=a[Vr];return o||(o=a[Vr]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function nn(a){a[Cn]=!0}var sa=new Set,wr={};function Qn(a,o){ke(a,o),ke(a+"Capture",o)}function ke(a,o){for(wr[a]=o,a=0;a<o.length;a++)sa.add(o[a])}var at=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]*$"),St={},te={};function _e(a){return We.call(te,a)?!0:We.call(St,a)?!1:at.test(a)?te[a]=!0:(St[a]=!0,!1)}function Me(a,o,d){if(_e(o))if(d===null)a.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":a.removeAttribute(o);return;case"boolean":var g=o.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){a.removeAttribute(o);return}}a.setAttribute(o,""+d)}}function bt(a,o,d){if(d===null)a.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(o);return}a.setAttribute(o,""+d)}}function Tn(a,o,d,g){if(g===null)a.removeAttribute(d);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(d);return}a.setAttributeNS(o,d,""+g)}}function At(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function cn(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Ol(a,o,d){var g=Object.getOwnPropertyDescriptor(a.constructor.prototype,o);if(!a.hasOwnProperty(o)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var b=g.get,x=g.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return b.call(this)},set:function(R){d=""+R,x.call(this,R)}}),Object.defineProperty(a,o,{enumerable:g.enumerable}),{getValue:function(){return d},setValue:function(R){d=""+R},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function Yi(a){if(!a._valueTracker){var o=cn(a)?"checked":"value";a._valueTracker=Ol(a,o,""+a[o])}}function Xi(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var d=o.getValue(),g="";return a&&(g=cn(a)?a.checked?"true":"false":a.value),a=g,a!==d?(o.setValue(a),!0):!1}function Bl(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var xd=/[\n"\\]/g;function Sr(a){return a.replace(xd,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Ys(a,o,d,g,b,x,R,V){a.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?a.type=R:a.removeAttribute("type"),o!=null?R==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+At(o)):a.value!==""+At(o)&&(a.value=""+At(o)):R!=="submit"&&R!=="reset"||a.removeAttribute("value"),o!=null?Ll(a,R,At(o)):d!=null?Ll(a,R,At(d)):g!=null&&a.removeAttribute("value"),b==null&&x!=null&&(a.defaultChecked=!!x),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?a.name=""+At(V):a.removeAttribute("name")}function Zi(a,o,d,g,b,x,R,V){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(a.type=x),o!=null||d!=null){if(!(x!=="submit"&&x!=="reset"||o!=null)){Yi(a);return}d=d!=null?""+At(d):"",o=o!=null?""+At(o):d,V||o===a.value||(a.value=o),a.defaultValue=o}g=g??b,g=typeof g!="function"&&typeof g!="symbol"&&!!g,a.checked=V?a.checked:!!g,a.defaultChecked=!!g,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(a.name=R),Yi(a)}function Ll(a,o,d){o==="number"&&Bl(a.ownerDocument)===a||a.defaultValue===""+d||(a.defaultValue=""+d)}function Wn(a,o,d,g){if(a=a.options,o){o={};for(var b=0;b<d.length;b++)o["$"+d[b]]=!0;for(d=0;d<a.length;d++)b=o.hasOwnProperty("$"+a[d].value),a[d].selected!==b&&(a[d].selected=b),b&&g&&(a[d].defaultSelected=!0)}else{for(d=""+At(d),o=null,b=0;b<a.length;b++){if(a[b].value===d){a[b].selected=!0,g&&(a[b].defaultSelected=!0);return}o!==null||a[b].disabled||(o=a[b])}o!==null&&(o.selected=!0)}}function Pu(a,o,d){if(o!=null&&(o=""+At(o),o!==a.value&&(a.value=o),d==null)){a.defaultValue!==o&&(a.defaultValue=o);return}a.defaultValue=d!=null?""+At(d):""}function Fl(a,o,d,g){if(o==null){if(g!=null){if(d!=null)throw Error(r(92));if($(g)){if(1<g.length)throw Error(r(93));g=g[0]}d=g}d==null&&(d=""),o=d}d=At(o),a.defaultValue=d,g=a.textContent,g===d&&g!==""&&g!==null&&(a.value=g),Yi(a)}function mt(a,o){if(o){var d=a.firstChild;if(d&&d===a.lastChild&&d.nodeType===3){d.nodeValue=o;return}}a.textContent=o}var Uu=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 Mn(a,o,d){var g=o.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?g?a.setProperty(o,""):o==="float"?a.cssFloat="":a[o]="":g?a.setProperty(o,d):typeof d!="number"||d===0||Uu.has(o)?o==="float"?a.cssFloat=d:a[o]=(""+d).trim():a[o]=d+"px"}function Yt(a,o,d){if(o!=null&&typeof o!="object")throw Error(r(62));if(a=a.style,d!=null){for(var g in d)!d.hasOwnProperty(g)||o!=null&&o.hasOwnProperty(g)||(g.indexOf("--")===0?a.setProperty(g,""):g==="float"?a.cssFloat="":a[g]="");for(var b in o)g=o[b],o.hasOwnProperty(b)&&d[b]!==g&&Mn(a,b,g)}else for(var x in o)o.hasOwnProperty(x)&&Mn(a,x,o[x])}function ei(a){if(a.indexOf("-")===-1)return!1;switch(a){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 Na=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"]]),Xs=/^[\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 ti(a){return Xs.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Ue(){}var lt=null;function Ct(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Bt=null,En=null;function Yr(a){var o=or(a);if(o&&(a=o.stateNode)){var d=a[mn]||null;e:switch(a=o.stateNode,o.type){case"input":if(Ys(a,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),o=d.name,d.type==="radio"&&o!=null){for(d=a;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+Sr(""+o)+'"][type="radio"]'),o=0;o<d.length;o++){var g=d[o];if(g!==a&&g.form===a.form){var b=g[mn]||null;if(!b)throw Error(r(90));Ys(g,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(o=0;o<d.length;o++)g=d[o],g.form===a.form&&Xi(g)}break e;case"textarea":Pu(a,d.value,d.defaultValue);break e;case"select":o=d.value,o!=null&&Wn(a,!!d.multiple,o,!1)}}}var Zs=!1;function qu(a,o,d){if(Zs)return a(o,d);Zs=!0;try{var g=a(o);return g}finally{if(Zs=!1,(Bt!==null||En!==null)&&(_c(),Bt&&(o=Bt,a=En,En=Bt=null,Yr(o),a)))for(o=0;o<a.length;o++)Yr(a[o])}}function Qs(a,o){var d=a.stateNode;if(d===null)return null;var g=d[mn]||null;if(g===null)return null;d=g[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(a=a.type,g=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!g;break e;default:a=!1}if(a)return null;if(d&&typeof d!="function")throw Error(r(231,o,typeof d));return d}var ka=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wd=!1;if(ka)try{var Ws={};Object.defineProperty(Ws,"passive",{get:function(){wd=!0}}),window.addEventListener("test",Ws,Ws),window.removeEventListener("test",Ws,Ws)}catch{wd=!1}var ni=null,Sd=null,ju=null;function Xm(){if(ju)return ju;var a,o=Sd,d=o.length,g,b="value"in ni?ni.value:ni.textContent,x=b.length;for(a=0;a<d&&o[a]===b[a];a++);var R=d-a;for(g=1;g<=R&&o[d-g]===b[x-g];g++);return ju=b.slice(a,1<g?1-g:void 0)}function Hu(a){var o=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&o===13&&(a=13)):a=o,a===10&&(a=13),32<=a||a===13?a:0}function Gu(){return!0}function Zm(){return!1}function Cr(a){function o(d,g,b,x,R){this._reactName=d,this._targetInst=b,this.type=g,this.nativeEvent=x,this.target=R,this.currentTarget=null;for(var V in a)a.hasOwnProperty(V)&&(d=a[V],this[V]=d?d(x):x[V]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Gu:Zm,this.isPropagationStopped=Zm,this}return v(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Gu)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Gu)},persist:function(){},isPersistent:Gu}),o}var Qi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vu=Cr(Qi),Js=v({},Qi,{view:0,detail:0}),VD=Cr(Js),Cd,Td,eo,$u=v({},Js,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ad,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==eo&&(eo&&a.type==="mousemove"?(Cd=a.screenX-eo.screenX,Td=a.screenY-eo.screenY):Td=Cd=0,eo=a),Cd)},movementY:function(a){return"movementY"in a?a.movementY:Td}}),Qm=Cr($u),$D=v({},$u,{dataTransfer:0}),KD=Cr($D),YD=v({},Js,{relatedTarget:0}),Dd=Cr(YD),XD=v({},Qi,{animationName:0,elapsedTime:0,pseudoElement:0}),ZD=Cr(XD),QD=v({},Qi,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),WD=Cr(QD),JD=v({},Qi,{data:0}),Wm=Cr(JD),eA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tA={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"},nA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rA(a){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(a):(a=nA[a])?!!o[a]:!1}function Ad(){return rA}var aA=v({},Js,{key:function(a){if(a.key){var o=eA[a.key]||a.key;if(o!=="Unidentified")return o}return a.type==="keypress"?(a=Hu(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?tA[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ad,charCode:function(a){return a.type==="keypress"?Hu(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Hu(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),iA=Cr(aA),lA=v({},$u,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jm=Cr(lA),sA=v({},Js,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ad}),oA=Cr(sA),uA=v({},Qi,{propertyName:0,elapsedTime:0,pseudoElement:0}),cA=Cr(uA),fA=v({},$u,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),dA=Cr(fA),hA=v({},Qi,{newState:0,oldState:0}),vA=Cr(hA),gA=[9,13,27,32],_d=ka&&"CompositionEvent"in window,to=null;ka&&"documentMode"in document&&(to=document.documentMode);var pA=ka&&"TextEvent"in window&&!to,ey=ka&&(!_d||to&&8<to&&11>=to),ty=" ",ny=!1;function ry(a,o){switch(a){case"keyup":return gA.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ay(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Il=!1;function mA(a,o){switch(a){case"compositionend":return ay(o);case"keypress":return o.which!==32?null:(ny=!0,ty);case"textInput":return a=o.data,a===ty&&ny?null:a;default:return null}}function yA(a,o){if(Il)return a==="compositionend"||!_d&&ry(a,o)?(a=Xm(),ju=Sd=ni=null,Il=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return ey&&o.locale!=="ko"?null:o.data;default:return null}}var bA={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 iy(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o==="input"?!!bA[a.type]:o==="textarea"}function ly(a,o,d,g){Bt?En?En.push(g):En=[g]:Bt=g,o=Lc(o,"onChange"),0<o.length&&(d=new Vu("onChange","change",null,d,g),a.push({event:d,listeners:o}))}var no=null,ro=null;function EA(a){j0(a,0)}function Ku(a){var o=$r(a);if(Xi(o))return a}function sy(a,o){if(a==="change")return o}var oy=!1;if(ka){var Nd;if(ka){var kd="oninput"in document;if(!kd){var uy=document.createElement("div");uy.setAttribute("oninput","return;"),kd=typeof uy.oninput=="function"}Nd=kd}else Nd=!1;oy=Nd&&(!document.documentMode||9<document.documentMode)}function cy(){no&&(no.detachEvent("onpropertychange",fy),ro=no=null)}function fy(a){if(a.propertyName==="value"&&Ku(ro)){var o=[];ly(o,ro,a,Ct(a)),qu(EA,o)}}function xA(a,o,d){a==="focusin"?(cy(),no=o,ro=d,no.attachEvent("onpropertychange",fy)):a==="focusout"&&cy()}function wA(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Ku(ro)}function SA(a,o){if(a==="click")return Ku(o)}function CA(a,o){if(a==="input"||a==="change")return Ku(o)}function TA(a,o){return a===o&&(a!==0||1/a===1/o)||a!==a&&o!==o}var Lr=typeof Object.is=="function"?Object.is:TA;function ao(a,o){if(Lr(a,o))return!0;if(typeof a!="object"||a===null||typeof o!="object"||o===null)return!1;var d=Object.keys(a),g=Object.keys(o);if(d.length!==g.length)return!1;for(g=0;g<d.length;g++){var b=d[g];if(!We.call(o,b)||!Lr(a[b],o[b]))return!1}return!0}function dy(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function hy(a,o){var d=dy(a);a=0;for(var g;d;){if(d.nodeType===3){if(g=a+d.textContent.length,a<=o&&g>=o)return{node:d,offset:o-a};a=g}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=dy(d)}}function vy(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?vy(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function gy(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=Bl(a.document);o instanceof a.HTMLIFrameElement;){try{var d=typeof o.contentWindow.location.href=="string"}catch{d=!1}if(d)a=o.contentWindow;else break;o=Bl(a.document)}return o}function Rd(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}var DA=ka&&"documentMode"in document&&11>=document.documentMode,zl=null,Md=null,io=null,Od=!1;function py(a,o,d){var g=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Od||zl==null||zl!==Bl(g)||(g=zl,"selectionStart"in g&&Rd(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),io&&ao(io,g)||(io=g,g=Lc(Md,"onSelect"),0<g.length&&(o=new Vu("onSelect","select",null,o,d),a.push({event:o,listeners:g}),o.target=zl)))}function Wi(a,o){var d={};return d[a.toLowerCase()]=o.toLowerCase(),d["Webkit"+a]="webkit"+o,d["Moz"+a]="moz"+o,d}var Pl={animationend:Wi("Animation","AnimationEnd"),animationiteration:Wi("Animation","AnimationIteration"),animationstart:Wi("Animation","AnimationStart"),transitionrun:Wi("Transition","TransitionRun"),transitionstart:Wi("Transition","TransitionStart"),transitioncancel:Wi("Transition","TransitionCancel"),transitionend:Wi("Transition","TransitionEnd")},Bd={},my={};ka&&(my=document.createElement("div").style,"AnimationEvent"in window||(delete Pl.animationend.animation,delete Pl.animationiteration.animation,delete Pl.animationstart.animation),"TransitionEvent"in window||delete Pl.transitionend.transition);function Ji(a){if(Bd[a])return Bd[a];if(!Pl[a])return a;var o=Pl[a],d;for(d in o)if(o.hasOwnProperty(d)&&d in my)return Bd[a]=o[d];return a}var yy=Ji("animationend"),by=Ji("animationiteration"),Ey=Ji("animationstart"),AA=Ji("transitionrun"),_A=Ji("transitionstart"),NA=Ji("transitioncancel"),xy=Ji("transitionend"),wy=new Map,Ld="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(" ");Ld.push("scrollEnd");function oa(a,o){wy.set(a,o),Qn(o,[a])}var Yu=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Xr=[],Ul=0,Fd=0;function Xu(){for(var a=Ul,o=Fd=Ul=0;o<a;){var d=Xr[o];Xr[o++]=null;var g=Xr[o];Xr[o++]=null;var b=Xr[o];Xr[o++]=null;var x=Xr[o];if(Xr[o++]=null,g!==null&&b!==null){var R=g.pending;R===null?b.next=b:(b.next=R.next,R.next=b),g.pending=b}x!==0&&Sy(d,b,x)}}function Zu(a,o,d,g){Xr[Ul++]=a,Xr[Ul++]=o,Xr[Ul++]=d,Xr[Ul++]=g,Fd|=g,a.lanes|=g,a=a.alternate,a!==null&&(a.lanes|=g)}function Id(a,o,d,g){return Zu(a,o,d,g),Qu(a)}function el(a,o){return Zu(a,null,null,o),Qu(a)}function Sy(a,o,d){a.lanes|=d;var g=a.alternate;g!==null&&(g.lanes|=d);for(var b=!1,x=a.return;x!==null;)x.childLanes|=d,g=x.alternate,g!==null&&(g.childLanes|=d),x.tag===22&&(a=x.stateNode,a===null||a._visibility&1||(b=!0)),a=x,x=x.return;return a.tag===3?(x=a.stateNode,b&&o!==null&&(b=31-oe(d),a=x.hiddenUpdates,g=a[b],g===null?a[b]=[o]:g.push(o),o.lane=d|536870912),x):null}function Qu(a){if(50<_o)throw _o=0,$h=null,Error(r(185));for(var o=a.return;o!==null;)a=o,o=a.return;return a.tag===3?a.stateNode:null}var ql={};function kA(a,o,d,g){this.tag=a,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fr(a,o,d,g){return new kA(a,o,d,g)}function zd(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Ra(a,o){var d=a.alternate;return d===null?(d=Fr(a.tag,o,a.key,a.mode),d.elementType=a.elementType,d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=o,d.type=a.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=a.flags&65011712,d.childLanes=a.childLanes,d.lanes=a.lanes,d.child=a.child,d.memoizedProps=a.memoizedProps,d.memoizedState=a.memoizedState,d.updateQueue=a.updateQueue,o=a.dependencies,d.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},d.sibling=a.sibling,d.index=a.index,d.ref=a.ref,d.refCleanup=a.refCleanup,d}function Cy(a,o){a.flags&=65011714;var d=a.alternate;return d===null?(a.childLanes=0,a.lanes=o,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=d.childLanes,a.lanes=d.lanes,a.child=d.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=d.memoizedProps,a.memoizedState=d.memoizedState,a.updateQueue=d.updateQueue,a.type=d.type,o=d.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),a}function Wu(a,o,d,g,b,x){var R=0;if(g=a,typeof a=="function")zd(a)&&(R=1);else if(typeof a=="string")R=L_(a,d,W.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case U:return a=Fr(31,d,o,b),a.elementType=U,a.lanes=x,a;case S:return tl(d.children,b,x,o);case w:R=8,b|=24;break;case E:return a=Fr(12,d,o,b|2),a.elementType=E,a.lanes=x,a;case k:return a=Fr(13,d,o,b),a.elementType=k,a.lanes=x,a;case N:return a=Fr(19,d,o,b),a.elementType=N,a.lanes=x,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case T:R=10;break e;case C:R=9;break e;case A:R=11;break e;case _:R=14;break e;case O:R=16,g=null;break e}R=29,d=Error(r(130,a===null?"null":typeof a,"")),g=null}return o=Fr(R,d,o,b),o.elementType=a,o.type=g,o.lanes=x,o}function tl(a,o,d,g){return a=Fr(7,a,g,o),a.lanes=d,a}function Pd(a,o,d){return a=Fr(6,a,null,o),a.lanes=d,a}function Ty(a){var o=Fr(18,null,null,0);return o.stateNode=a,o}function Ud(a,o,d){return o=Fr(4,a.children!==null?a.children:[],a.key,o),o.lanes=d,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}var Dy=new WeakMap;function Zr(a,o){if(typeof a=="object"&&a!==null){var d=Dy.get(a);return d!==void 0?d:(o={value:a,source:o,stack:et(o)},Dy.set(a,o),o)}return{value:a,source:o,stack:et(o)}}var jl=[],Hl=0,Ju=null,lo=0,Qr=[],Wr=0,ri=null,ga=1,pa="";function Ma(a,o){jl[Hl++]=lo,jl[Hl++]=Ju,Ju=a,lo=o}function Ay(a,o,d){Qr[Wr++]=ga,Qr[Wr++]=pa,Qr[Wr++]=ri,ri=a;var g=ga;a=pa;var b=32-oe(g)-1;g&=~(1<<b),d+=1;var x=32-oe(o)+b;if(30<x){var R=b-b%5;x=(g&(1<<R)-1).toString(32),g>>=R,b-=R,ga=1<<32-oe(o)+b|d<<b|g,pa=x+a}else ga=1<<x|d<<b|g,pa=a}function qd(a){a.return!==null&&(Ma(a,1),Ay(a,1,0))}function jd(a){for(;a===Ju;)Ju=jl[--Hl],jl[Hl]=null,lo=jl[--Hl],jl[Hl]=null;for(;a===ri;)ri=Qr[--Wr],Qr[Wr]=null,pa=Qr[--Wr],Qr[Wr]=null,ga=Qr[--Wr],Qr[Wr]=null}function _y(a,o){Qr[Wr++]=ga,Qr[Wr++]=pa,Qr[Wr++]=ri,ga=o.id,pa=o.overflow,ri=a}var Jn=null,fn=null,It=!1,ai=null,Jr=!1,Hd=Error(r(519));function ii(a){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw so(Zr(o,a)),Hd}function Ny(a){var o=a.stateNode,d=a.type,g=a.memoizedProps;switch(o[Tt]=a,o[mn]=g,d){case"dialog":Mt("cancel",o),Mt("close",o);break;case"iframe":case"object":case"embed":Mt("load",o);break;case"video":case"audio":for(d=0;d<ko.length;d++)Mt(ko[d],o);break;case"source":Mt("error",o);break;case"img":case"image":case"link":Mt("error",o),Mt("load",o);break;case"details":Mt("toggle",o);break;case"input":Mt("invalid",o),Zi(o,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Mt("invalid",o);break;case"textarea":Mt("invalid",o),Fl(o,g.value,g.defaultValue,g.children)}d=g.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||o.textContent===""+d||g.suppressHydrationWarning===!0||$0(o.textContent,d)?(g.popover!=null&&(Mt("beforetoggle",o),Mt("toggle",o)),g.onScroll!=null&&Mt("scroll",o),g.onScrollEnd!=null&&Mt("scrollend",o),g.onClick!=null&&(o.onclick=Ue),o=!0):o=!1,o||ii(a,!0)}function ky(a){for(Jn=a.return;Jn;)switch(Jn.tag){case 5:case 31:case 13:Jr=!1;return;case 27:case 3:Jr=!0;return;default:Jn=Jn.return}}function Gl(a){if(a!==Jn)return!1;if(!It)return ky(a),It=!0,!1;var o=a.tag,d;if((d=o!==3&&o!==27)&&((d=o===5)&&(d=a.type,d=!(d!=="form"&&d!=="button")||sv(a.type,a.memoizedProps)),d=!d),d&&fn&&ii(a),ky(a),o===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));fn=tE(a)}else if(o===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));fn=tE(a)}else o===27?(o=fn,bi(a.type)?(a=dv,dv=null,fn=a):fn=o):fn=Jn?ta(a.stateNode.nextSibling):null;return!0}function nl(){fn=Jn=null,It=!1}function Gd(){var a=ai;return a!==null&&(_r===null?_r=a:_r.push.apply(_r,a),ai=null),a}function so(a){ai===null?ai=[a]:ai.push(a)}var Vd=F(null),rl=null,Oa=null;function li(a,o,d){L(Vd,o._currentValue),o._currentValue=d}function Ba(a){a._currentValue=Vd.current,q(Vd)}function $d(a,o,d){for(;a!==null;){var g=a.alternate;if((a.childLanes&o)!==o?(a.childLanes|=o,g!==null&&(g.childLanes|=o)):g!==null&&(g.childLanes&o)!==o&&(g.childLanes|=o),a===d)break;a=a.return}}function Kd(a,o,d,g){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var x=b.dependencies;if(x!==null){var R=b.child;x=x.firstContext;e:for(;x!==null;){var V=x;x=b;for(var Z=0;Z<o.length;Z++)if(V.context===o[Z]){x.lanes|=d,V=x.alternate,V!==null&&(V.lanes|=d),$d(x.return,d,a),g||(R=null);break e}x=V.next}}else if(b.tag===18){if(R=b.return,R===null)throw Error(r(341));R.lanes|=d,x=R.alternate,x!==null&&(x.lanes|=d),$d(R,d,a),R=null}else R=b.child;if(R!==null)R.return=b;else for(R=b;R!==null;){if(R===a){R=null;break}if(b=R.sibling,b!==null){b.return=R.return,R=b;break}R=R.return}b=R}}function Vl(a,o,d,g){a=null;for(var b=o,x=!1;b!==null;){if(!x){if((b.flags&524288)!==0)x=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var R=b.alternate;if(R===null)throw Error(r(387));if(R=R.memoizedProps,R!==null){var V=b.type;Lr(b.pendingProps.value,R.value)||(a!==null?a.push(V):a=[V])}}else if(b===me.current){if(R=b.alternate,R===null)throw Error(r(387));R.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(Lo):a=[Lo])}b=b.return}a!==null&&Kd(o,a,d,g),o.flags|=262144}function ec(a){for(a=a.firstContext;a!==null;){if(!Lr(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function al(a){rl=a,Oa=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function er(a){return Ry(rl,a)}function tc(a,o){return rl===null&&al(a),Ry(a,o)}function Ry(a,o){var d=o._currentValue;if(o={context:o,memoizedValue:d,next:null},Oa===null){if(a===null)throw Error(r(308));Oa=o,a.dependencies={lanes:0,firstContext:o},a.flags|=524288}else Oa=Oa.next=o;return d}var RA=typeof AbortController<"u"?AbortController:function(){var a=[],o=this.signal={aborted:!1,addEventListener:function(d,g){a.push(g)}};this.abort=function(){o.aborted=!0,a.forEach(function(d){return d()})}},MA=t.unstable_scheduleCallback,OA=t.unstable_NormalPriority,On={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Yd(){return{controller:new RA,data:new Map,refCount:0}}function oo(a){a.refCount--,a.refCount===0&&MA(OA,function(){a.controller.abort()})}var uo=null,Xd=0,$l=0,Kl=null;function BA(a,o){if(uo===null){var d=uo=[];Xd=0,$l=Wh(),Kl={status:"pending",value:void 0,then:function(g){d.push(g)}}}return Xd++,o.then(My,My),o}function My(){if(--Xd===0&&uo!==null){Kl!==null&&(Kl.status="fulfilled");var a=uo;uo=null,$l=0,Kl=null;for(var o=0;o<a.length;o++)(0,a[o])()}}function LA(a,o){var d=[],g={status:"pending",value:null,reason:null,then:function(b){d.push(b)}};return a.then(function(){g.status="fulfilled",g.value=o;for(var b=0;b<d.length;b++)(0,d[b])(o)},function(b){for(g.status="rejected",g.reason=b,b=0;b<d.length;b++)(0,d[b])(void 0)}),g}var Oy=B.S;B.S=function(a,o){p0=je(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&BA(a,o),Oy!==null&&Oy(a,o)};var il=F(null);function Zd(){var a=il.current;return a!==null?a:rn.pooledCache}function nc(a,o){o===null?L(il,il.current):L(il,o.pool)}function By(){var a=Zd();return a===null?null:{parent:On._currentValue,pool:a}}var Yl=Error(r(460)),Qd=Error(r(474)),rc=Error(r(542)),ac={then:function(){}};function Ly(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Fy(a,o,d){switch(d=a[d],d===void 0?a.push(o):d!==o&&(o.then(Ue,Ue),o=d),o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,zy(a),a;default:if(typeof o.status=="string")o.then(Ue,Ue);else{if(a=rn,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=o,a.status="pending",a.then(function(g){if(o.status==="pending"){var b=o;b.status="fulfilled",b.value=g}},function(g){if(o.status==="pending"){var b=o;b.status="rejected",b.reason=g}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,zy(a),a}throw sl=o,Yl}}function ll(a){try{var o=a._init;return o(a._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(sl=d,Yl):d}}var sl=null;function Iy(){if(sl===null)throw Error(r(459));var a=sl;return sl=null,a}function zy(a){if(a===Yl||a===rc)throw Error(r(483))}var Xl=null,co=0;function ic(a){var o=co;return co+=1,Xl===null&&(Xl=[]),Fy(Xl,a,o)}function fo(a,o){o=o.props.ref,a.ref=o!==void 0?o:null}function lc(a,o){throw o.$$typeof===p?Error(r(525)):(a=Object.prototype.toString.call(o),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":a)))}function Py(a){function o(ie,J){if(a){var ce=ie.deletions;ce===null?(ie.deletions=[J],ie.flags|=16):ce.push(J)}}function d(ie,J){if(!a)return null;for(;J!==null;)o(ie,J),J=J.sibling;return null}function g(ie){for(var J=new Map;ie!==null;)ie.key!==null?J.set(ie.key,ie):J.set(ie.index,ie),ie=ie.sibling;return J}function b(ie,J){return ie=Ra(ie,J),ie.index=0,ie.sibling=null,ie}function x(ie,J,ce){return ie.index=ce,a?(ce=ie.alternate,ce!==null?(ce=ce.index,ce<J?(ie.flags|=67108866,J):ce):(ie.flags|=67108866,J)):(ie.flags|=1048576,J)}function R(ie){return a&&ie.alternate===null&&(ie.flags|=67108866),ie}function V(ie,J,ce,Te){return J===null||J.tag!==6?(J=Pd(ce,ie.mode,Te),J.return=ie,J):(J=b(J,ce),J.return=ie,J)}function Z(ie,J,ce,Te){var ft=ce.type;return ft===S?we(ie,J,ce.props.children,Te,ce.key):J!==null&&(J.elementType===ft||typeof ft=="object"&&ft!==null&&ft.$$typeof===O&&ll(ft)===J.type)?(J=b(J,ce.props),fo(J,ce),J.return=ie,J):(J=Wu(ce.type,ce.key,ce.props,null,ie.mode,Te),fo(J,ce),J.return=ie,J)}function he(ie,J,ce,Te){return J===null||J.tag!==4||J.stateNode.containerInfo!==ce.containerInfo||J.stateNode.implementation!==ce.implementation?(J=Ud(ce,ie.mode,Te),J.return=ie,J):(J=b(J,ce.children||[]),J.return=ie,J)}function we(ie,J,ce,Te,ft){return J===null||J.tag!==7?(J=tl(ce,ie.mode,Te,ft),J.return=ie,J):(J=b(J,ce),J.return=ie,J)}function Ae(ie,J,ce){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=Pd(""+J,ie.mode,ce),J.return=ie,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case m:return ce=Wu(J.type,J.key,J.props,null,ie.mode,ce),fo(ce,J),ce.return=ie,ce;case y:return J=Ud(J,ie.mode,ce),J.return=ie,J;case O:return J=ll(J),Ae(ie,J,ce)}if($(J)||P(J))return J=tl(J,ie.mode,ce,null),J.return=ie,J;if(typeof J.then=="function")return Ae(ie,ic(J),ce);if(J.$$typeof===T)return Ae(ie,tc(ie,J),ce);lc(ie,J)}return null}function ve(ie,J,ce,Te){var ft=J!==null?J.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return ft!==null?null:V(ie,J,""+ce,Te);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case m:return ce.key===ft?Z(ie,J,ce,Te):null;case y:return ce.key===ft?he(ie,J,ce,Te):null;case O:return ce=ll(ce),ve(ie,J,ce,Te)}if($(ce)||P(ce))return ft!==null?null:we(ie,J,ce,Te,null);if(typeof ce.then=="function")return ve(ie,J,ic(ce),Te);if(ce.$$typeof===T)return ve(ie,J,tc(ie,ce),Te);lc(ie,ce)}return null}function ye(ie,J,ce,Te,ft){if(typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint")return ie=ie.get(ce)||null,V(J,ie,""+Te,ft);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case m:return ie=ie.get(Te.key===null?ce:Te.key)||null,Z(J,ie,Te,ft);case y:return ie=ie.get(Te.key===null?ce:Te.key)||null,he(J,ie,Te,ft);case O:return Te=ll(Te),ye(ie,J,ce,Te,ft)}if($(Te)||P(Te))return ie=ie.get(ce)||null,we(J,ie,Te,ft,null);if(typeof Te.then=="function")return ye(ie,J,ce,ic(Te),ft);if(Te.$$typeof===T)return ye(ie,J,ce,tc(J,Te),ft);lc(J,Te)}return null}function nt(ie,J,ce,Te){for(var ft=null,qt=null,st=J,_t=J=0,Ft=null;st!==null&&_t<ce.length;_t++){st.index>_t?(Ft=st,st=null):Ft=st.sibling;var jt=ve(ie,st,ce[_t],Te);if(jt===null){st===null&&(st=Ft);break}a&&st&&jt.alternate===null&&o(ie,st),J=x(jt,J,_t),qt===null?ft=jt:qt.sibling=jt,qt=jt,st=Ft}if(_t===ce.length)return d(ie,st),It&&Ma(ie,_t),ft;if(st===null){for(;_t<ce.length;_t++)st=Ae(ie,ce[_t],Te),st!==null&&(J=x(st,J,_t),qt===null?ft=st:qt.sibling=st,qt=st);return It&&Ma(ie,_t),ft}for(st=g(st);_t<ce.length;_t++)Ft=ye(st,ie,_t,ce[_t],Te),Ft!==null&&(a&&Ft.alternate!==null&&st.delete(Ft.key===null?_t:Ft.key),J=x(Ft,J,_t),qt===null?ft=Ft:qt.sibling=Ft,qt=Ft);return a&&st.forEach(function(Ci){return o(ie,Ci)}),It&&Ma(ie,_t),ft}function pt(ie,J,ce,Te){if(ce==null)throw Error(r(151));for(var ft=null,qt=null,st=J,_t=J=0,Ft=null,jt=ce.next();st!==null&&!jt.done;_t++,jt=ce.next()){st.index>_t?(Ft=st,st=null):Ft=st.sibling;var Ci=ve(ie,st,jt.value,Te);if(Ci===null){st===null&&(st=Ft);break}a&&st&&Ci.alternate===null&&o(ie,st),J=x(Ci,J,_t),qt===null?ft=Ci:qt.sibling=Ci,qt=Ci,st=Ft}if(jt.done)return d(ie,st),It&&Ma(ie,_t),ft;if(st===null){for(;!jt.done;_t++,jt=ce.next())jt=Ae(ie,jt.value,Te),jt!==null&&(J=x(jt,J,_t),qt===null?ft=jt:qt.sibling=jt,qt=jt);return It&&Ma(ie,_t),ft}for(st=g(st);!jt.done;_t++,jt=ce.next())jt=ye(st,ie,_t,jt.value,Te),jt!==null&&(a&&jt.alternate!==null&&st.delete(jt.key===null?_t:jt.key),J=x(jt,J,_t),qt===null?ft=jt:qt.sibling=jt,qt=jt);return a&&st.forEach(function($_){return o(ie,$_)}),It&&Ma(ie,_t),ft}function Jt(ie,J,ce,Te){if(typeof ce=="object"&&ce!==null&&ce.type===S&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case m:e:{for(var ft=ce.key;J!==null;){if(J.key===ft){if(ft=ce.type,ft===S){if(J.tag===7){d(ie,J.sibling),Te=b(J,ce.props.children),Te.return=ie,ie=Te;break e}}else if(J.elementType===ft||typeof ft=="object"&&ft!==null&&ft.$$typeof===O&&ll(ft)===J.type){d(ie,J.sibling),Te=b(J,ce.props),fo(Te,ce),Te.return=ie,ie=Te;break e}d(ie,J);break}else o(ie,J);J=J.sibling}ce.type===S?(Te=tl(ce.props.children,ie.mode,Te,ce.key),Te.return=ie,ie=Te):(Te=Wu(ce.type,ce.key,ce.props,null,ie.mode,Te),fo(Te,ce),Te.return=ie,ie=Te)}return R(ie);case y:e:{for(ft=ce.key;J!==null;){if(J.key===ft)if(J.tag===4&&J.stateNode.containerInfo===ce.containerInfo&&J.stateNode.implementation===ce.implementation){d(ie,J.sibling),Te=b(J,ce.children||[]),Te.return=ie,ie=Te;break e}else{d(ie,J);break}else o(ie,J);J=J.sibling}Te=Ud(ce,ie.mode,Te),Te.return=ie,ie=Te}return R(ie);case O:return ce=ll(ce),Jt(ie,J,ce,Te)}if($(ce))return nt(ie,J,ce,Te);if(P(ce)){if(ft=P(ce),typeof ft!="function")throw Error(r(150));return ce=ft.call(ce),pt(ie,J,ce,Te)}if(typeof ce.then=="function")return Jt(ie,J,ic(ce),Te);if(ce.$$typeof===T)return Jt(ie,J,tc(ie,ce),Te);lc(ie,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,J!==null&&J.tag===6?(d(ie,J.sibling),Te=b(J,ce),Te.return=ie,ie=Te):(d(ie,J),Te=Pd(ce,ie.mode,Te),Te.return=ie,ie=Te),R(ie)):d(ie,J)}return function(ie,J,ce,Te){try{co=0;var ft=Jt(ie,J,ce,Te);return Xl=null,ft}catch(st){if(st===Yl||st===rc)throw st;var qt=Fr(29,st,null,ie.mode);return qt.lanes=Te,qt.return=ie,qt}}}var ol=Py(!0),Uy=Py(!1),si=!1;function Wd(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jd(a,o){a=a.updateQueue,o.updateQueue===a&&(o.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function oi(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ui(a,o,d){var g=a.updateQueue;if(g===null)return null;if(g=g.shared,(Gt&2)!==0){var b=g.pending;return b===null?o.next=o:(o.next=b.next,b.next=o),g.pending=o,o=Qu(a),Sy(a,null,d),o}return Zu(a,g,o,d),Qu(a)}function ho(a,o,d){if(o=o.updateQueue,o!==null&&(o=o.shared,(d&4194048)!==0)){var g=o.lanes;g&=a.pendingLanes,d|=g,o.lanes=d,Ze(a,d)}}function eh(a,o){var d=a.updateQueue,g=a.alternate;if(g!==null&&(g=g.updateQueue,d===g)){var b=null,x=null;if(d=d.firstBaseUpdate,d!==null){do{var R={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};x===null?b=x=R:x=x.next=R,d=d.next}while(d!==null);x===null?b=x=o:x=x.next=o}else b=x=o;d={baseState:g.baseState,firstBaseUpdate:b,lastBaseUpdate:x,shared:g.shared,callbacks:g.callbacks},a.updateQueue=d;return}a=d.lastBaseUpdate,a===null?d.firstBaseUpdate=o:a.next=o,d.lastBaseUpdate=o}var th=!1;function vo(){if(th){var a=Kl;if(a!==null)throw a}}function go(a,o,d,g){th=!1;var b=a.updateQueue;si=!1;var x=b.firstBaseUpdate,R=b.lastBaseUpdate,V=b.shared.pending;if(V!==null){b.shared.pending=null;var Z=V,he=Z.next;Z.next=null,R===null?x=he:R.next=he,R=Z;var we=a.alternate;we!==null&&(we=we.updateQueue,V=we.lastBaseUpdate,V!==R&&(V===null?we.firstBaseUpdate=he:V.next=he,we.lastBaseUpdate=Z))}if(x!==null){var Ae=b.baseState;R=0,we=he=Z=null,V=x;do{var ve=V.lane&-536870913,ye=ve!==V.lane;if(ye?(Lt&ve)===ve:(g&ve)===ve){ve!==0&&ve===$l&&(th=!0),we!==null&&(we=we.next={lane:0,tag:V.tag,payload:V.payload,callback:null,next:null});e:{var nt=a,pt=V;ve=o;var Jt=d;switch(pt.tag){case 1:if(nt=pt.payload,typeof nt=="function"){Ae=nt.call(Jt,Ae,ve);break e}Ae=nt;break e;case 3:nt.flags=nt.flags&-65537|128;case 0:if(nt=pt.payload,ve=typeof nt=="function"?nt.call(Jt,Ae,ve):nt,ve==null)break e;Ae=v({},Ae,ve);break e;case 2:si=!0}}ve=V.callback,ve!==null&&(a.flags|=64,ye&&(a.flags|=8192),ye=b.callbacks,ye===null?b.callbacks=[ve]:ye.push(ve))}else ye={lane:ve,tag:V.tag,payload:V.payload,callback:V.callback,next:null},we===null?(he=we=ye,Z=Ae):we=we.next=ye,R|=ve;if(V=V.next,V===null){if(V=b.shared.pending,V===null)break;ye=V,V=ye.next,ye.next=null,b.lastBaseUpdate=ye,b.shared.pending=null}}while(!0);we===null&&(Z=Ae),b.baseState=Z,b.firstBaseUpdate=he,b.lastBaseUpdate=we,x===null&&(b.shared.lanes=0),vi|=R,a.lanes=R,a.memoizedState=Ae}}function qy(a,o){if(typeof a!="function")throw Error(r(191,a));a.call(o)}function jy(a,o){var d=a.callbacks;if(d!==null)for(a.callbacks=null,a=0;a<d.length;a++)qy(d[a],o)}var Zl=F(null),sc=F(0);function Hy(a,o){a=Ha,L(sc,a),L(Zl,o),Ha=a|o.baseLanes}function nh(){L(sc,Ha),L(Zl,Zl.current)}function rh(){Ha=sc.current,q(Zl),q(sc)}var Ir=F(null),ea=null;function ci(a){var o=a.alternate;L(Nn,Nn.current&1),L(Ir,a),ea===null&&(o===null||Zl.current!==null||o.memoizedState!==null)&&(ea=a)}function ah(a){L(Nn,Nn.current),L(Ir,a),ea===null&&(ea=a)}function Gy(a){a.tag===22?(L(Nn,Nn.current),L(Ir,a),ea===null&&(ea=a)):fi()}function fi(){L(Nn,Nn.current),L(Ir,Ir.current)}function zr(a){q(Ir),ea===a&&(ea=null),q(Nn)}var Nn=F(0);function oc(a){for(var o=a;o!==null;){if(o.tag===13){var d=o.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||cv(d)||fv(d)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var La=0,Dt=null,Qt=null,Bn=null,uc=!1,Ql=!1,ul=!1,cc=0,po=0,Wl=null,FA=0;function Dn(){throw Error(r(321))}function ih(a,o){if(o===null)return!1;for(var d=0;d<o.length&&d<a.length;d++)if(!Lr(a[d],o[d]))return!1;return!0}function lh(a,o,d,g,b,x){return La=x,Dt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,B.H=a===null||a.memoizedState===null?Ab:xh,ul=!1,x=d(g,b),ul=!1,Ql&&(x=$y(o,d,g,b)),Vy(a),x}function Vy(a){B.H=bo;var o=Qt!==null&&Qt.next!==null;if(La=0,Bn=Qt=Dt=null,uc=!1,po=0,Wl=null,o)throw Error(r(300));a===null||Ln||(a=a.dependencies,a!==null&&ec(a)&&(Ln=!0))}function $y(a,o,d,g){Dt=a;var b=0;do{if(Ql&&(Wl=null),po=0,Ql=!1,25<=b)throw Error(r(301));if(b+=1,Bn=Qt=null,a.updateQueue!=null){var x=a.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}B.H=_b,x=o(d,g)}while(Ql);return x}function IA(){var a=B.H,o=a.useState()[0];return o=typeof o.then=="function"?mo(o):o,a=a.useState()[0],(Qt!==null?Qt.memoizedState:null)!==a&&(Dt.flags|=1024),o}function sh(){var a=cc!==0;return cc=0,a}function oh(a,o,d){o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~d}function uh(a){if(uc){for(a=a.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}uc=!1}La=0,Bn=Qt=Dt=null,Ql=!1,po=cc=0,Wl=null}function gr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bn===null?Dt.memoizedState=Bn=a:Bn=Bn.next=a,Bn}function kn(){if(Qt===null){var a=Dt.alternate;a=a!==null?a.memoizedState:null}else a=Qt.next;var o=Bn===null?Dt.memoizedState:Bn.next;if(o!==null)Bn=o,Qt=a;else{if(a===null)throw Dt.alternate===null?Error(r(467)):Error(r(310));Qt=a,a={memoizedState:Qt.memoizedState,baseState:Qt.baseState,baseQueue:Qt.baseQueue,queue:Qt.queue,next:null},Bn===null?Dt.memoizedState=Bn=a:Bn=Bn.next=a}return Bn}function fc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function mo(a){var o=po;return po+=1,Wl===null&&(Wl=[]),a=Fy(Wl,a,o),o=Dt,(Bn===null?o.memoizedState:Bn.next)===null&&(o=o.alternate,B.H=o===null||o.memoizedState===null?Ab:xh),a}function dc(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return mo(a);if(a.$$typeof===T)return er(a)}throw Error(r(438,String(a)))}function ch(a){var o=null,d=Dt.updateQueue;if(d!==null&&(o=d.memoCache),o==null){var g=Dt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(o={data:g.data.map(function(b){return b.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),d===null&&(d=fc(),Dt.updateQueue=d),d.memoCache=o,d=o.data[o.index],d===void 0)for(d=o.data[o.index]=Array(a),g=0;g<a;g++)d[g]=M;return o.index++,d}function Fa(a,o){return typeof o=="function"?o(a):o}function hc(a){var o=kn();return fh(o,Qt,a)}function fh(a,o,d){var g=a.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=d;var b=a.baseQueue,x=g.pending;if(x!==null){if(b!==null){var R=b.next;b.next=x.next,x.next=R}o.baseQueue=b=x,g.pending=null}if(x=a.baseState,b===null)a.memoizedState=x;else{o=b.next;var V=R=null,Z=null,he=o,we=!1;do{var Ae=he.lane&-536870913;if(Ae!==he.lane?(Lt&Ae)===Ae:(La&Ae)===Ae){var ve=he.revertLane;if(ve===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null}),Ae===$l&&(we=!0);else if((La&ve)===ve){he=he.next,ve===$l&&(we=!0);continue}else Ae={lane:0,revertLane:he.revertLane,gesture:null,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null},Z===null?(V=Z=Ae,R=x):Z=Z.next=Ae,Dt.lanes|=ve,vi|=ve;Ae=he.action,ul&&d(x,Ae),x=he.hasEagerState?he.eagerState:d(x,Ae)}else ve={lane:Ae,revertLane:he.revertLane,gesture:he.gesture,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null},Z===null?(V=Z=ve,R=x):Z=Z.next=ve,Dt.lanes|=Ae,vi|=Ae;he=he.next}while(he!==null&&he!==o);if(Z===null?R=x:Z.next=V,!Lr(x,a.memoizedState)&&(Ln=!0,we&&(d=Kl,d!==null)))throw d;a.memoizedState=x,a.baseState=R,a.baseQueue=Z,g.lastRenderedState=x}return b===null&&(g.lanes=0),[a.memoizedState,g.dispatch]}function dh(a){var o=kn(),d=o.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=a;var g=d.dispatch,b=d.pending,x=o.memoizedState;if(b!==null){d.pending=null;var R=b=b.next;do x=a(x,R.action),R=R.next;while(R!==b);Lr(x,o.memoizedState)||(Ln=!0),o.memoizedState=x,o.baseQueue===null&&(o.baseState=x),d.lastRenderedState=x}return[x,g]}function Ky(a,o,d){var g=Dt,b=kn(),x=It;if(x){if(d===void 0)throw Error(r(407));d=d()}else d=o();var R=!Lr((Qt||b).memoizedState,d);if(R&&(b.memoizedState=d,Ln=!0),b=b.queue,gh(Zy.bind(null,g,b,a),[a]),b.getSnapshot!==o||R||Bn!==null&&Bn.memoizedState.tag&1){if(g.flags|=2048,Jl(9,{destroy:void 0},Xy.bind(null,g,b,d,o),null),rn===null)throw Error(r(349));x||(La&127)!==0||Yy(g,o,d)}return d}function Yy(a,o,d){a.flags|=16384,a={getSnapshot:o,value:d},o=Dt.updateQueue,o===null?(o=fc(),Dt.updateQueue=o,o.stores=[a]):(d=o.stores,d===null?o.stores=[a]:d.push(a))}function Xy(a,o,d,g){o.value=d,o.getSnapshot=g,Qy(o)&&Wy(a)}function Zy(a,o,d){return d(function(){Qy(o)&&Wy(a)})}function Qy(a){var o=a.getSnapshot;a=a.value;try{var d=o();return!Lr(a,d)}catch{return!0}}function Wy(a){var o=el(a,2);o!==null&&Nr(o,a,2)}function hh(a){var o=gr();if(typeof a=="function"){var d=a;if(a=d(),ul){de(!0);try{d()}finally{de(!1)}}}return o.memoizedState=o.baseState=a,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:a},o}function Jy(a,o,d,g){return a.baseState=d,fh(a,Qt,typeof g=="function"?g:Fa)}function zA(a,o,d,g,b){if(pc(a))throw Error(r(485));if(a=o.action,a!==null){var x={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){x.listeners.push(R)}};B.T!==null?d(!0):x.isTransition=!1,g(x),d=o.pending,d===null?(x.next=o.pending=x,eb(o,x)):(x.next=d.next,o.pending=d.next=x)}}function eb(a,o){var d=o.action,g=o.payload,b=a.state;if(o.isTransition){var x=B.T,R={};B.T=R;try{var V=d(b,g),Z=B.S;Z!==null&&Z(R,V),tb(a,o,V)}catch(he){vh(a,o,he)}finally{x!==null&&R.types!==null&&(x.types=R.types),B.T=x}}else try{x=d(b,g),tb(a,o,x)}catch(he){vh(a,o,he)}}function tb(a,o,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(g){nb(a,o,g)},function(g){return vh(a,o,g)}):nb(a,o,d)}function nb(a,o,d){o.status="fulfilled",o.value=d,rb(o),a.state=d,o=a.pending,o!==null&&(d=o.next,d===o?a.pending=null:(d=d.next,o.next=d,eb(a,d)))}function vh(a,o,d){var g=a.pending;if(a.pending=null,g!==null){g=g.next;do o.status="rejected",o.reason=d,rb(o),o=o.next;while(o!==g)}a.action=null}function rb(a){a=a.listeners;for(var o=0;o<a.length;o++)(0,a[o])()}function ab(a,o){return o}function ib(a,o){if(It){var d=rn.formState;if(d!==null){e:{var g=Dt;if(It){if(fn){t:{for(var b=fn,x=Jr;b.nodeType!==8;){if(!x){b=null;break t}if(b=ta(b.nextSibling),b===null){b=null;break t}}x=b.data,b=x==="F!"||x==="F"?b:null}if(b){fn=ta(b.nextSibling),g=b.data==="F!";break e}}ii(g)}g=!1}g&&(o=d[0])}}return d=gr(),d.memoizedState=d.baseState=o,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ab,lastRenderedState:o},d.queue=g,d=Cb.bind(null,Dt,g),g.dispatch=d,g=hh(!1),x=Eh.bind(null,Dt,!1,g.queue),g=gr(),b={state:o,dispatch:null,action:a,pending:null},g.queue=b,d=zA.bind(null,Dt,b,x,d),b.dispatch=d,g.memoizedState=a,[o,d,!1]}function lb(a){var o=kn();return sb(o,Qt,a)}function sb(a,o,d){if(o=fh(a,o,ab)[0],a=hc(Fa)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var g=mo(o)}catch(R){throw R===Yl?rc:R}else g=o;o=kn();var b=o.queue,x=b.dispatch;return d!==o.memoizedState&&(Dt.flags|=2048,Jl(9,{destroy:void 0},PA.bind(null,b,d),null)),[g,x,a]}function PA(a,o){a.action=o}function ob(a){var o=kn(),d=Qt;if(d!==null)return sb(o,d,a);kn(),o=o.memoizedState,d=kn();var g=d.queue.dispatch;return d.memoizedState=a,[o,g,!1]}function Jl(a,o,d,g){return a={tag:a,create:d,deps:g,inst:o,next:null},o=Dt.updateQueue,o===null&&(o=fc(),Dt.updateQueue=o),d=o.lastEffect,d===null?o.lastEffect=a.next=a:(g=d.next,d.next=a,a.next=g,o.lastEffect=a),a}function ub(){return kn().memoizedState}function vc(a,o,d,g){var b=gr();Dt.flags|=a,b.memoizedState=Jl(1|o,{destroy:void 0},d,g===void 0?null:g)}function gc(a,o,d,g){var b=kn();g=g===void 0?null:g;var x=b.memoizedState.inst;Qt!==null&&g!==null&&ih(g,Qt.memoizedState.deps)?b.memoizedState=Jl(o,x,d,g):(Dt.flags|=a,b.memoizedState=Jl(1|o,x,d,g))}function cb(a,o){vc(8390656,8,a,o)}function gh(a,o){gc(2048,8,a,o)}function UA(a){Dt.flags|=4;var o=Dt.updateQueue;if(o===null)o=fc(),Dt.updateQueue=o,o.events=[a];else{var d=o.events;d===null?o.events=[a]:d.push(a)}}function fb(a){var o=kn().memoizedState;return UA({ref:o,nextImpl:a}),function(){if((Gt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function db(a,o){return gc(4,2,a,o)}function hb(a,o){return gc(4,4,a,o)}function vb(a,o){if(typeof o=="function"){a=a();var d=o(a);return function(){typeof d=="function"?d():o(null)}}if(o!=null)return a=a(),o.current=a,function(){o.current=null}}function gb(a,o,d){d=d!=null?d.concat([a]):null,gc(4,4,vb.bind(null,o,a),d)}function ph(){}function pb(a,o){var d=kn();o=o===void 0?null:o;var g=d.memoizedState;return o!==null&&ih(o,g[1])?g[0]:(d.memoizedState=[a,o],a)}function mb(a,o){var d=kn();o=o===void 0?null:o;var g=d.memoizedState;if(o!==null&&ih(o,g[1]))return g[0];if(g=a(),ul){de(!0);try{a()}finally{de(!1)}}return d.memoizedState=[g,o],g}function mh(a,o,d){return d===void 0||(La&1073741824)!==0&&(Lt&261930)===0?a.memoizedState=o:(a.memoizedState=d,a=y0(),Dt.lanes|=a,vi|=a,d)}function yb(a,o,d,g){return Lr(d,o)?d:Zl.current!==null?(a=mh(a,d,g),Lr(a,o)||(Ln=!0),a):(La&42)===0||(La&1073741824)!==0&&(Lt&261930)===0?(Ln=!0,a.memoizedState=d):(a=y0(),Dt.lanes|=a,vi|=a,o)}function bb(a,o,d,g,b){var x=H.p;H.p=x!==0&&8>x?x:8;var R=B.T,V={};B.T=V,Eh(a,!1,o,d);try{var Z=b(),he=B.S;if(he!==null&&he(V,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var we=LA(Z,g);yo(a,o,we,qr(a))}else yo(a,o,g,qr(a))}catch(Ae){yo(a,o,{then:function(){},status:"rejected",reason:Ae},qr())}finally{H.p=x,R!==null&&V.types!==null&&(R.types=V.types),B.T=R}}function qA(){}function yh(a,o,d,g){if(a.tag!==5)throw Error(r(476));var b=Eb(a).queue;bb(a,b,o,Y,d===null?qA:function(){return xb(a),d(g)})}function Eb(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:Y},next:null};var d={};return o.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:d},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function xb(a){var o=Eb(a);o.next===null&&(o=a.alternate.memoizedState),yo(a,o.next.queue,{},qr())}function bh(){return er(Lo)}function wb(){return kn().memoizedState}function Sb(){return kn().memoizedState}function jA(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var d=qr();a=oi(d);var g=ui(o,a,d);g!==null&&(Nr(g,o,d),ho(g,o,d)),o={cache:Yd()},a.payload=o;return}o=o.return}}function HA(a,o,d){var g=qr();d={lane:g,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},pc(a)?Tb(o,d):(d=Id(a,o,d,g),d!==null&&(Nr(d,a,g),Db(d,o,g)))}function Cb(a,o,d){var g=qr();yo(a,o,d,g)}function yo(a,o,d,g){var b={lane:g,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(pc(a))Tb(o,b);else{var x=a.alternate;if(a.lanes===0&&(x===null||x.lanes===0)&&(x=o.lastRenderedReducer,x!==null))try{var R=o.lastRenderedState,V=x(R,d);if(b.hasEagerState=!0,b.eagerState=V,Lr(V,R))return Zu(a,o,b,0),rn===null&&Xu(),!1}catch{}if(d=Id(a,o,b,g),d!==null)return Nr(d,a,g),Db(d,o,g),!0}return!1}function Eh(a,o,d,g){if(g={lane:2,revertLane:Wh(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},pc(a)){if(o)throw Error(r(479))}else o=Id(a,d,g,2),o!==null&&Nr(o,a,2)}function pc(a){var o=a.alternate;return a===Dt||o!==null&&o===Dt}function Tb(a,o){Ql=uc=!0;var d=a.pending;d===null?o.next=o:(o.next=d.next,d.next=o),a.pending=o}function Db(a,o,d){if((d&4194048)!==0){var g=o.lanes;g&=a.pendingLanes,d|=g,o.lanes=d,Ze(a,d)}}var bo={readContext:er,use:dc,useCallback:Dn,useContext:Dn,useEffect:Dn,useImperativeHandle:Dn,useLayoutEffect:Dn,useInsertionEffect:Dn,useMemo:Dn,useReducer:Dn,useRef:Dn,useState:Dn,useDebugValue:Dn,useDeferredValue:Dn,useTransition:Dn,useSyncExternalStore:Dn,useId:Dn,useHostTransitionStatus:Dn,useFormState:Dn,useActionState:Dn,useOptimistic:Dn,useMemoCache:Dn,useCacheRefresh:Dn};bo.useEffectEvent=Dn;var Ab={readContext:er,use:dc,useCallback:function(a,o){return gr().memoizedState=[a,o===void 0?null:o],a},useContext:er,useEffect:cb,useImperativeHandle:function(a,o,d){d=d!=null?d.concat([a]):null,vc(4194308,4,vb.bind(null,o,a),d)},useLayoutEffect:function(a,o){return vc(4194308,4,a,o)},useInsertionEffect:function(a,o){vc(4,2,a,o)},useMemo:function(a,o){var d=gr();o=o===void 0?null:o;var g=a();if(ul){de(!0);try{a()}finally{de(!1)}}return d.memoizedState=[g,o],g},useReducer:function(a,o,d){var g=gr();if(d!==void 0){var b=d(o);if(ul){de(!0);try{d(o)}finally{de(!1)}}}else b=o;return g.memoizedState=g.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},g.queue=a,a=a.dispatch=HA.bind(null,Dt,a),[g.memoizedState,a]},useRef:function(a){var o=gr();return a={current:a},o.memoizedState=a},useState:function(a){a=hh(a);var o=a.queue,d=Cb.bind(null,Dt,o);return o.dispatch=d,[a.memoizedState,d]},useDebugValue:ph,useDeferredValue:function(a,o){var d=gr();return mh(d,a,o)},useTransition:function(){var a=hh(!1);return a=bb.bind(null,Dt,a.queue,!0,!1),gr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,d){var g=Dt,b=gr();if(It){if(d===void 0)throw Error(r(407));d=d()}else{if(d=o(),rn===null)throw Error(r(349));(Lt&127)!==0||Yy(g,o,d)}b.memoizedState=d;var x={value:d,getSnapshot:o};return b.queue=x,cb(Zy.bind(null,g,x,a),[a]),g.flags|=2048,Jl(9,{destroy:void 0},Xy.bind(null,g,x,d,o),null),d},useId:function(){var a=gr(),o=rn.identifierPrefix;if(It){var d=pa,g=ga;d=(g&~(1<<32-oe(g)-1)).toString(32)+d,o="_"+o+"R_"+d,d=cc++,0<d&&(o+="H"+d.toString(32)),o+="_"}else d=FA++,o="_"+o+"r_"+d.toString(32)+"_";return a.memoizedState=o},useHostTransitionStatus:bh,useFormState:ib,useActionState:ib,useOptimistic:function(a){var o=gr();o.memoizedState=o.baseState=a;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=d,o=Eh.bind(null,Dt,!0,d),d.dispatch=o,[a,o]},useMemoCache:ch,useCacheRefresh:function(){return gr().memoizedState=jA.bind(null,Dt)},useEffectEvent:function(a){var o=gr(),d={impl:a};return o.memoizedState=d,function(){if((Gt&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},xh={readContext:er,use:dc,useCallback:pb,useContext:er,useEffect:gh,useImperativeHandle:gb,useInsertionEffect:db,useLayoutEffect:hb,useMemo:mb,useReducer:hc,useRef:ub,useState:function(){return hc(Fa)},useDebugValue:ph,useDeferredValue:function(a,o){var d=kn();return yb(d,Qt.memoizedState,a,o)},useTransition:function(){var a=hc(Fa)[0],o=kn().memoizedState;return[typeof a=="boolean"?a:mo(a),o]},useSyncExternalStore:Ky,useId:wb,useHostTransitionStatus:bh,useFormState:lb,useActionState:lb,useOptimistic:function(a,o){var d=kn();return Jy(d,Qt,a,o)},useMemoCache:ch,useCacheRefresh:Sb};xh.useEffectEvent=fb;var _b={readContext:er,use:dc,useCallback:pb,useContext:er,useEffect:gh,useImperativeHandle:gb,useInsertionEffect:db,useLayoutEffect:hb,useMemo:mb,useReducer:dh,useRef:ub,useState:function(){return dh(Fa)},useDebugValue:ph,useDeferredValue:function(a,o){var d=kn();return Qt===null?mh(d,a,o):yb(d,Qt.memoizedState,a,o)},useTransition:function(){var a=dh(Fa)[0],o=kn().memoizedState;return[typeof a=="boolean"?a:mo(a),o]},useSyncExternalStore:Ky,useId:wb,useHostTransitionStatus:bh,useFormState:ob,useActionState:ob,useOptimistic:function(a,o){var d=kn();return Qt!==null?Jy(d,Qt,a,o):(d.baseState=a,[a,d.queue.dispatch])},useMemoCache:ch,useCacheRefresh:Sb};_b.useEffectEvent=fb;function wh(a,o,d,g){o=a.memoizedState,d=d(g,o),d=d==null?o:v({},o,d),a.memoizedState=d,a.lanes===0&&(a.updateQueue.baseState=d)}var Sh={enqueueSetState:function(a,o,d){a=a._reactInternals;var g=qr(),b=oi(g);b.payload=o,d!=null&&(b.callback=d),o=ui(a,b,g),o!==null&&(Nr(o,a,g),ho(o,a,g))},enqueueReplaceState:function(a,o,d){a=a._reactInternals;var g=qr(),b=oi(g);b.tag=1,b.payload=o,d!=null&&(b.callback=d),o=ui(a,b,g),o!==null&&(Nr(o,a,g),ho(o,a,g))},enqueueForceUpdate:function(a,o){a=a._reactInternals;var d=qr(),g=oi(d);g.tag=2,o!=null&&(g.callback=o),o=ui(a,g,d),o!==null&&(Nr(o,a,d),ho(o,a,d))}};function Nb(a,o,d,g,b,x,R){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(g,x,R):o.prototype&&o.prototype.isPureReactComponent?!ao(d,g)||!ao(b,x):!0}function kb(a,o,d,g){a=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(d,g),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(d,g),o.state!==a&&Sh.enqueueReplaceState(o,o.state,null)}function cl(a,o){var d=o;if("ref"in o){d={};for(var g in o)g!=="ref"&&(d[g]=o[g])}if(a=a.defaultProps){d===o&&(d=v({},d));for(var b in a)d[b]===void 0&&(d[b]=a[b])}return d}function Rb(a){Yu(a)}function Mb(a){console.error(a)}function Ob(a){Yu(a)}function mc(a,o){try{var d=a.onUncaughtError;d(o.value,{componentStack:o.stack})}catch(g){setTimeout(function(){throw g})}}function Bb(a,o,d){try{var g=a.onCaughtError;g(d.value,{componentStack:d.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Ch(a,o,d){return d=oi(d),d.tag=3,d.payload={element:null},d.callback=function(){mc(a,o)},d}function Lb(a){return a=oi(a),a.tag=3,a}function Fb(a,o,d,g){var b=d.type.getDerivedStateFromError;if(typeof b=="function"){var x=g.value;a.payload=function(){return b(x)},a.callback=function(){Bb(o,d,g)}}var R=d.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(a.callback=function(){Bb(o,d,g),typeof b!="function"&&(gi===null?gi=new Set([this]):gi.add(this));var V=g.stack;this.componentDidCatch(g.value,{componentStack:V!==null?V:""})})}function GA(a,o,d,g,b){if(d.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(o=d.alternate,o!==null&&Vl(o,d,b,!0),d=Ir.current,d!==null){switch(d.tag){case 31:case 13:return ea===null?Nc():d.alternate===null&&An===0&&(An=3),d.flags&=-257,d.flags|=65536,d.lanes=b,g===ac?d.flags|=16384:(o=d.updateQueue,o===null?d.updateQueue=new Set([g]):o.add(g),Xh(a,g,b)),!1;case 22:return d.flags|=65536,g===ac?d.flags|=16384:(o=d.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([g])},d.updateQueue=o):(d=o.retryQueue,d===null?o.retryQueue=new Set([g]):d.add(g)),Xh(a,g,b)),!1}throw Error(r(435,d.tag))}return Xh(a,g,b),Nc(),!1}if(It)return o=Ir.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=b,g!==Hd&&(a=Error(r(422),{cause:g}),so(Zr(a,d)))):(g!==Hd&&(o=Error(r(423),{cause:g}),so(Zr(o,d))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,g=Zr(g,d),b=Ch(a.stateNode,g,b),eh(a,b),An!==4&&(An=2)),!1;var x=Error(r(520),{cause:g});if(x=Zr(x,d),Ao===null?Ao=[x]:Ao.push(x),An!==4&&(An=2),o===null)return!0;g=Zr(g,d),d=o;do{switch(d.tag){case 3:return d.flags|=65536,a=b&-b,d.lanes|=a,a=Ch(d.stateNode,g,a),eh(d,a),!1;case 1:if(o=d.type,x=d.stateNode,(d.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(gi===null||!gi.has(x))))return d.flags|=65536,b&=-b,d.lanes|=b,b=Lb(b),Fb(b,a,d,g),eh(d,b),!1}d=d.return}while(d!==null);return!1}var Th=Error(r(461)),Ln=!1;function tr(a,o,d,g){o.child=a===null?Uy(o,null,d,g):ol(o,a.child,d,g)}function Ib(a,o,d,g,b){d=d.render;var x=o.ref;if("ref"in g){var R={};for(var V in g)V!=="ref"&&(R[V]=g[V])}else R=g;return al(o),g=lh(a,o,d,R,x,b),V=sh(),a!==null&&!Ln?(oh(a,o,b),Ia(a,o,b)):(It&&V&&qd(o),o.flags|=1,tr(a,o,g,b),o.child)}function zb(a,o,d,g,b){if(a===null){var x=d.type;return typeof x=="function"&&!zd(x)&&x.defaultProps===void 0&&d.compare===null?(o.tag=15,o.type=x,Pb(a,o,x,g,b)):(a=Wu(d.type,null,g,o,o.mode,b),a.ref=o.ref,a.return=o,o.child=a)}if(x=a.child,!Oh(a,b)){var R=x.memoizedProps;if(d=d.compare,d=d!==null?d:ao,d(R,g)&&a.ref===o.ref)return Ia(a,o,b)}return o.flags|=1,a=Ra(x,g),a.ref=o.ref,a.return=o,o.child=a}function Pb(a,o,d,g,b){if(a!==null){var x=a.memoizedProps;if(ao(x,g)&&a.ref===o.ref)if(Ln=!1,o.pendingProps=g=x,Oh(a,b))(a.flags&131072)!==0&&(Ln=!0);else return o.lanes=a.lanes,Ia(a,o,b)}return Dh(a,o,d,g,b)}function Ub(a,o,d,g){var b=g.children,x=a!==null?a.memoizedState:null;if(a===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((o.flags&128)!==0){if(x=x!==null?x.baseLanes|d:d,a!==null){for(g=o.child=a.child,b=0;g!==null;)b=b|g.lanes|g.childLanes,g=g.sibling;g=b&~x}else g=0,o.child=null;return qb(a,o,x,d,g)}if((d&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},a!==null&&nc(o,x!==null?x.cachePool:null),x!==null?Hy(o,x):nh(),Gy(o);else return g=o.lanes=536870912,qb(a,o,x!==null?x.baseLanes|d:d,d,g)}else x!==null?(nc(o,x.cachePool),Hy(o,x),fi(),o.memoizedState=null):(a!==null&&nc(o,null),nh(),fi());return tr(a,o,b,d),o.child}function Eo(a,o){return a!==null&&a.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function qb(a,o,d,g,b){var x=Zd();return x=x===null?null:{parent:On._currentValue,pool:x},o.memoizedState={baseLanes:d,cachePool:x},a!==null&&nc(o,null),nh(),Gy(o),a!==null&&Vl(a,o,g,!0),o.childLanes=b,null}function yc(a,o){return o=Ec({mode:o.mode,children:o.children},a.mode),o.ref=a.ref,a.child=o,o.return=a,o}function jb(a,o,d){return ol(o,a.child,null,d),a=yc(o,o.pendingProps),a.flags|=2,zr(o),o.memoizedState=null,a}function VA(a,o,d){var g=o.pendingProps,b=(o.flags&128)!==0;if(o.flags&=-129,a===null){if(It){if(g.mode==="hidden")return a=yc(o,g),o.lanes=536870912,Eo(null,a);if(ah(o),(a=fn)?(a=eE(a,Jr),a=a!==null&&a.data==="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:ri!==null?{id:ga,overflow:pa}:null,retryLane:536870912,hydrationErrors:null},d=Ty(a),d.return=o,o.child=d,Jn=o,fn=null)):a=null,a===null)throw ii(o);return o.lanes=536870912,null}return yc(o,g)}var x=a.memoizedState;if(x!==null){var R=x.dehydrated;if(ah(o),b)if(o.flags&256)o.flags&=-257,o=jb(a,o,d);else if(o.memoizedState!==null)o.child=a.child,o.flags|=128,o=null;else throw Error(r(558));else if(Ln||Vl(a,o,d,!1),b=(d&a.childLanes)!==0,Ln||b){if(g=rn,g!==null&&(R=Et(g,d),R!==0&&R!==x.retryLane))throw x.retryLane=R,el(a,R),Nr(g,a,R),Th;Nc(),o=jb(a,o,d)}else a=x.treeContext,fn=ta(R.nextSibling),Jn=o,It=!0,ai=null,Jr=!1,a!==null&&_y(o,a),o=yc(o,g),o.flags|=4096;return o}return a=Ra(a.child,{mode:g.mode,children:g.children}),a.ref=o.ref,o.child=a,a.return=o,a}function bc(a,o){var d=o.ref;if(d===null)a!==null&&a.ref!==null&&(o.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(a===null||a.ref!==d)&&(o.flags|=4194816)}}function Dh(a,o,d,g,b){return al(o),d=lh(a,o,d,g,void 0,b),g=sh(),a!==null&&!Ln?(oh(a,o,b),Ia(a,o,b)):(It&&g&&qd(o),o.flags|=1,tr(a,o,d,b),o.child)}function Hb(a,o,d,g,b,x){return al(o),o.updateQueue=null,d=$y(o,g,d,b),Vy(a),g=sh(),a!==null&&!Ln?(oh(a,o,x),Ia(a,o,x)):(It&&g&&qd(o),o.flags|=1,tr(a,o,d,x),o.child)}function Gb(a,o,d,g,b){if(al(o),o.stateNode===null){var x=ql,R=d.contextType;typeof R=="object"&&R!==null&&(x=er(R)),x=new d(g,x),o.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Sh,o.stateNode=x,x._reactInternals=o,x=o.stateNode,x.props=g,x.state=o.memoizedState,x.refs={},Wd(o),R=d.contextType,x.context=typeof R=="object"&&R!==null?er(R):ql,x.state=o.memoizedState,R=d.getDerivedStateFromProps,typeof R=="function"&&(wh(o,d,R,g),x.state=o.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(R=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),R!==x.state&&Sh.enqueueReplaceState(x,x.state,null),go(o,g,x,b),vo(),x.state=o.memoizedState),typeof x.componentDidMount=="function"&&(o.flags|=4194308),g=!0}else if(a===null){x=o.stateNode;var V=o.memoizedProps,Z=cl(d,V);x.props=Z;var he=x.context,we=d.contextType;R=ql,typeof we=="object"&&we!==null&&(R=er(we));var Ae=d.getDerivedStateFromProps;we=typeof Ae=="function"||typeof x.getSnapshotBeforeUpdate=="function",V=o.pendingProps!==V,we||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(V||he!==R)&&kb(o,x,g,R),si=!1;var ve=o.memoizedState;x.state=ve,go(o,g,x,b),vo(),he=o.memoizedState,V||ve!==he||si?(typeof Ae=="function"&&(wh(o,d,Ae,g),he=o.memoizedState),(Z=si||Nb(o,d,Z,g,ve,he,R))?(we||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(o.flags|=4194308)):(typeof x.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=g,o.memoizedState=he),x.props=g,x.state=he,x.context=R,g=Z):(typeof x.componentDidMount=="function"&&(o.flags|=4194308),g=!1)}else{x=o.stateNode,Jd(a,o),R=o.memoizedProps,we=cl(d,R),x.props=we,Ae=o.pendingProps,ve=x.context,he=d.contextType,Z=ql,typeof he=="object"&&he!==null&&(Z=er(he)),V=d.getDerivedStateFromProps,(he=typeof V=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(R!==Ae||ve!==Z)&&kb(o,x,g,Z),si=!1,ve=o.memoizedState,x.state=ve,go(o,g,x,b),vo();var ye=o.memoizedState;R!==Ae||ve!==ye||si||a!==null&&a.dependencies!==null&&ec(a.dependencies)?(typeof V=="function"&&(wh(o,d,V,g),ye=o.memoizedState),(we=si||Nb(o,d,we,g,ve,ye,Z)||a!==null&&a.dependencies!==null&&ec(a.dependencies))?(he||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(g,ye,Z),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(g,ye,Z)),typeof x.componentDidUpdate=="function"&&(o.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof x.componentDidUpdate!="function"||R===a.memoizedProps&&ve===a.memoizedState||(o.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||R===a.memoizedProps&&ve===a.memoizedState||(o.flags|=1024),o.memoizedProps=g,o.memoizedState=ye),x.props=g,x.state=ye,x.context=Z,g=we):(typeof x.componentDidUpdate!="function"||R===a.memoizedProps&&ve===a.memoizedState||(o.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||R===a.memoizedProps&&ve===a.memoizedState||(o.flags|=1024),g=!1)}return x=g,bc(a,o),g=(o.flags&128)!==0,x||g?(x=o.stateNode,d=g&&typeof d.getDerivedStateFromError!="function"?null:x.render(),o.flags|=1,a!==null&&g?(o.child=ol(o,a.child,null,b),o.child=ol(o,null,d,b)):tr(a,o,d,b),o.memoizedState=x.state,a=o.child):a=Ia(a,o,b),a}function Vb(a,o,d,g){return nl(),o.flags|=256,tr(a,o,d,g),o.child}var Ah={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _h(a){return{baseLanes:a,cachePool:By()}}function Nh(a,o,d){return a=a!==null?a.childLanes&~d:0,o&&(a|=Ur),a}function $b(a,o,d){var g=o.pendingProps,b=!1,x=(o.flags&128)!==0,R;if((R=x)||(R=a!==null&&a.memoizedState===null?!1:(Nn.current&2)!==0),R&&(b=!0,o.flags&=-129),R=(o.flags&32)!==0,o.flags&=-33,a===null){if(It){if(b?ci(o):fi(),(a=fn)?(a=eE(a,Jr),a=a!==null&&a.data!=="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:ri!==null?{id:ga,overflow:pa}:null,retryLane:536870912,hydrationErrors:null},d=Ty(a),d.return=o,o.child=d,Jn=o,fn=null)):a=null,a===null)throw ii(o);return fv(a)?o.lanes=32:o.lanes=536870912,null}var V=g.children;return g=g.fallback,b?(fi(),b=o.mode,V=Ec({mode:"hidden",children:V},b),g=tl(g,b,d,null),V.return=o,g.return=o,V.sibling=g,o.child=V,g=o.child,g.memoizedState=_h(d),g.childLanes=Nh(a,R,d),o.memoizedState=Ah,Eo(null,g)):(ci(o),kh(o,V))}var Z=a.memoizedState;if(Z!==null&&(V=Z.dehydrated,V!==null)){if(x)o.flags&256?(ci(o),o.flags&=-257,o=Rh(a,o,d)):o.memoizedState!==null?(fi(),o.child=a.child,o.flags|=128,o=null):(fi(),V=g.fallback,b=o.mode,g=Ec({mode:"visible",children:g.children},b),V=tl(V,b,d,null),V.flags|=2,g.return=o,V.return=o,g.sibling=V,o.child=g,ol(o,a.child,null,d),g=o.child,g.memoizedState=_h(d),g.childLanes=Nh(a,R,d),o.memoizedState=Ah,o=Eo(null,g));else if(ci(o),fv(V)){if(R=V.nextSibling&&V.nextSibling.dataset,R)var he=R.dgst;R=he,g=Error(r(419)),g.stack="",g.digest=R,so({value:g,source:null,stack:null}),o=Rh(a,o,d)}else if(Ln||Vl(a,o,d,!1),R=(d&a.childLanes)!==0,Ln||R){if(R=rn,R!==null&&(g=Et(R,d),g!==0&&g!==Z.retryLane))throw Z.retryLane=g,el(a,g),Nr(R,a,g),Th;cv(V)||Nc(),o=Rh(a,o,d)}else cv(V)?(o.flags|=192,o.child=a.child,o=null):(a=Z.treeContext,fn=ta(V.nextSibling),Jn=o,It=!0,ai=null,Jr=!1,a!==null&&_y(o,a),o=kh(o,g.children),o.flags|=4096);return o}return b?(fi(),V=g.fallback,b=o.mode,Z=a.child,he=Z.sibling,g=Ra(Z,{mode:"hidden",children:g.children}),g.subtreeFlags=Z.subtreeFlags&65011712,he!==null?V=Ra(he,V):(V=tl(V,b,d,null),V.flags|=2),V.return=o,g.return=o,g.sibling=V,o.child=g,Eo(null,g),g=o.child,V=a.child.memoizedState,V===null?V=_h(d):(b=V.cachePool,b!==null?(Z=On._currentValue,b=b.parent!==Z?{parent:Z,pool:Z}:b):b=By(),V={baseLanes:V.baseLanes|d,cachePool:b}),g.memoizedState=V,g.childLanes=Nh(a,R,d),o.memoizedState=Ah,Eo(a.child,g)):(ci(o),d=a.child,a=d.sibling,d=Ra(d,{mode:"visible",children:g.children}),d.return=o,d.sibling=null,a!==null&&(R=o.deletions,R===null?(o.deletions=[a],o.flags|=16):R.push(a)),o.child=d,o.memoizedState=null,d)}function kh(a,o){return o=Ec({mode:"visible",children:o},a.mode),o.return=a,a.child=o}function Ec(a,o){return a=Fr(22,a,null,o),a.lanes=0,a}function Rh(a,o,d){return ol(o,a.child,null,d),a=kh(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function Kb(a,o,d){a.lanes|=o;var g=a.alternate;g!==null&&(g.lanes|=o),$d(a.return,o,d)}function Mh(a,o,d,g,b,x){var R=a.memoizedState;R===null?a.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:g,tail:d,tailMode:b,treeForkCount:x}:(R.isBackwards=o,R.rendering=null,R.renderingStartTime=0,R.last=g,R.tail=d,R.tailMode=b,R.treeForkCount=x)}function Yb(a,o,d){var g=o.pendingProps,b=g.revealOrder,x=g.tail;g=g.children;var R=Nn.current,V=(R&2)!==0;if(V?(R=R&1|2,o.flags|=128):R&=1,L(Nn,R),tr(a,o,g,d),g=It?lo:0,!V&&a!==null&&(a.flags&128)!==0)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Kb(a,d,o);else if(a.tag===19)Kb(a,d,o);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(b){case"forwards":for(d=o.child,b=null;d!==null;)a=d.alternate,a!==null&&oc(a)===null&&(b=d),d=d.sibling;d=b,d===null?(b=o.child,o.child=null):(b=d.sibling,d.sibling=null),Mh(o,!1,b,d,x,g);break;case"backwards":case"unstable_legacy-backwards":for(d=null,b=o.child,o.child=null;b!==null;){if(a=b.alternate,a!==null&&oc(a)===null){o.child=b;break}a=b.sibling,b.sibling=d,d=b,b=a}Mh(o,!0,d,null,x,g);break;case"together":Mh(o,!1,null,null,void 0,g);break;default:o.memoizedState=null}return o.child}function Ia(a,o,d){if(a!==null&&(o.dependencies=a.dependencies),vi|=o.lanes,(d&o.childLanes)===0)if(a!==null){if(Vl(a,o,d,!1),(d&o.childLanes)===0)return null}else return null;if(a!==null&&o.child!==a.child)throw Error(r(153));if(o.child!==null){for(a=o.child,d=Ra(a,a.pendingProps),o.child=d,d.return=o;a.sibling!==null;)a=a.sibling,d=d.sibling=Ra(a,a.pendingProps),d.return=o;d.sibling=null}return o.child}function Oh(a,o){return(a.lanes&o)!==0?!0:(a=a.dependencies,!!(a!==null&&ec(a)))}function $A(a,o,d){switch(o.tag){case 3:Ne(o,o.stateNode.containerInfo),li(o,On,a.memoizedState.cache),nl();break;case 27:case 5:ee(o);break;case 4:Ne(o,o.stateNode.containerInfo);break;case 10:li(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,ah(o),null;break;case 13:var g=o.memoizedState;if(g!==null)return g.dehydrated!==null?(ci(o),o.flags|=128,null):(d&o.child.childLanes)!==0?$b(a,o,d):(ci(o),a=Ia(a,o,d),a!==null?a.sibling:null);ci(o);break;case 19:var b=(a.flags&128)!==0;if(g=(d&o.childLanes)!==0,g||(Vl(a,o,d,!1),g=(d&o.childLanes)!==0),b){if(g)return Yb(a,o,d);o.flags|=128}if(b=o.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),L(Nn,Nn.current),g)break;return null;case 22:return o.lanes=0,Ub(a,o,d,o.pendingProps);case 24:li(o,On,a.memoizedState.cache)}return Ia(a,o,d)}function Xb(a,o,d){if(a!==null)if(a.memoizedProps!==o.pendingProps)Ln=!0;else{if(!Oh(a,d)&&(o.flags&128)===0)return Ln=!1,$A(a,o,d);Ln=(a.flags&131072)!==0}else Ln=!1,It&&(o.flags&1048576)!==0&&Ay(o,lo,o.index);switch(o.lanes=0,o.tag){case 16:e:{var g=o.pendingProps;if(a=ll(o.elementType),o.type=a,typeof a=="function")zd(a)?(g=cl(a,g),o.tag=1,o=Gb(null,o,a,g,d)):(o.tag=0,o=Dh(null,o,a,g,d));else{if(a!=null){var b=a.$$typeof;if(b===A){o.tag=11,o=Ib(null,o,a,g,d);break e}else if(b===_){o.tag=14,o=zb(null,o,a,g,d);break e}}throw o=K(a)||a,Error(r(306,o,""))}}return o;case 0:return Dh(a,o,o.type,o.pendingProps,d);case 1:return g=o.type,b=cl(g,o.pendingProps),Gb(a,o,g,b,d);case 3:e:{if(Ne(o,o.stateNode.containerInfo),a===null)throw Error(r(387));g=o.pendingProps;var x=o.memoizedState;b=x.element,Jd(a,o),go(o,g,null,d);var R=o.memoizedState;if(g=R.cache,li(o,On,g),g!==x.cache&&Kd(o,[On],d,!0),vo(),g=R.element,x.isDehydrated)if(x={element:g,isDehydrated:!1,cache:R.cache},o.updateQueue.baseState=x,o.memoizedState=x,o.flags&256){o=Vb(a,o,g,d);break e}else if(g!==b){b=Zr(Error(r(424)),o),so(b),o=Vb(a,o,g,d);break e}else for(a=o.stateNode.containerInfo,a.nodeType===9?a=a.body:a=a.nodeName==="HTML"?a.ownerDocument.body:a,fn=ta(a.firstChild),Jn=o,It=!0,ai=null,Jr=!0,d=Uy(o,null,g,d),o.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(nl(),g===b){o=Ia(a,o,d);break e}tr(a,o,g,d)}o=o.child}return o;case 26:return bc(a,o),a===null?(d=lE(o.type,null,o.pendingProps,null))?o.memoizedState=d:It||(d=o.type,a=o.pendingProps,g=Fc(se.current).createElement(d),g[Tt]=o,g[mn]=a,nr(g,d,a),nn(g),o.stateNode=g):o.memoizedState=lE(o.type,a.memoizedProps,o.pendingProps,a.memoizedState),null;case 27:return ee(o),a===null&&It&&(g=o.stateNode=rE(o.type,o.pendingProps,se.current),Jn=o,Jr=!0,b=fn,bi(o.type)?(dv=b,fn=ta(g.firstChild)):fn=b),tr(a,o,o.pendingProps.children,d),bc(a,o),a===null&&(o.flags|=4194304),o.child;case 5:return a===null&&It&&((b=g=fn)&&(g=w_(g,o.type,o.pendingProps,Jr),g!==null?(o.stateNode=g,Jn=o,fn=ta(g.firstChild),Jr=!1,b=!0):b=!1),b||ii(o)),ee(o),b=o.type,x=o.pendingProps,R=a!==null?a.memoizedProps:null,g=x.children,sv(b,x)?g=null:R!==null&&sv(b,R)&&(o.flags|=32),o.memoizedState!==null&&(b=lh(a,o,IA,null,null,d),Lo._currentValue=b),bc(a,o),tr(a,o,g,d),o.child;case 6:return a===null&&It&&((a=d=fn)&&(d=S_(d,o.pendingProps,Jr),d!==null?(o.stateNode=d,Jn=o,fn=null,a=!0):a=!1),a||ii(o)),null;case 13:return $b(a,o,d);case 4:return Ne(o,o.stateNode.containerInfo),g=o.pendingProps,a===null?o.child=ol(o,null,g,d):tr(a,o,g,d),o.child;case 11:return Ib(a,o,o.type,o.pendingProps,d);case 7:return tr(a,o,o.pendingProps,d),o.child;case 8:return tr(a,o,o.pendingProps.children,d),o.child;case 12:return tr(a,o,o.pendingProps.children,d),o.child;case 10:return g=o.pendingProps,li(o,o.type,g.value),tr(a,o,g.children,d),o.child;case 9:return b=o.type._context,g=o.pendingProps.children,al(o),b=er(b),g=g(b),o.flags|=1,tr(a,o,g,d),o.child;case 14:return zb(a,o,o.type,o.pendingProps,d);case 15:return Pb(a,o,o.type,o.pendingProps,d);case 19:return Yb(a,o,d);case 31:return VA(a,o,d);case 22:return Ub(a,o,d,o.pendingProps);case 24:return al(o),g=er(On),a===null?(b=Zd(),b===null&&(b=rn,x=Yd(),b.pooledCache=x,x.refCount++,x!==null&&(b.pooledCacheLanes|=d),b=x),o.memoizedState={parent:g,cache:b},Wd(o),li(o,On,b)):((a.lanes&d)!==0&&(Jd(a,o),go(o,null,null,d),vo()),b=a.memoizedState,x=o.memoizedState,b.parent!==g?(b={parent:g,cache:g},o.memoizedState=b,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=b),li(o,On,g)):(g=x.cache,li(o,On,g),g!==b.cache&&Kd(o,[On],d,!0))),tr(a,o,o.pendingProps.children,d),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function za(a){a.flags|=4}function Bh(a,o,d,g,b){if((o=(a.mode&32)!==0)&&(o=!1),o){if(a.flags|=16777216,(b&335544128)===b)if(a.stateNode.complete)a.flags|=8192;else if(w0())a.flags|=8192;else throw sl=ac,Qd}else a.flags&=-16777217}function Zb(a,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!fE(o))if(w0())a.flags|=8192;else throw sl=ac,Qd}function xc(a,o){o!==null&&(a.flags|=4),a.flags&16384&&(o=a.tag!==22?Oe():536870912,a.lanes|=o,rs|=o)}function xo(a,o){if(!It)switch(a.tailMode){case"hidden":o=a.tail;for(var d=null;o!==null;)o.alternate!==null&&(d=o),o=o.sibling;d===null?a.tail=null:d.sibling=null;break;case"collapsed":d=a.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?o||a.tail===null?a.tail=null:a.tail.sibling=null:g.sibling=null}}function dn(a){var o=a.alternate!==null&&a.alternate.child===a.child,d=0,g=0;if(o)for(var b=a.child;b!==null;)d|=b.lanes|b.childLanes,g|=b.subtreeFlags&65011712,g|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)d|=b.lanes|b.childLanes,g|=b.subtreeFlags,g|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=g,a.childLanes=d,o}function KA(a,o,d){var g=o.pendingProps;switch(jd(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dn(o),null;case 1:return dn(o),null;case 3:return d=o.stateNode,g=null,a!==null&&(g=a.memoizedState.cache),o.memoizedState.cache!==g&&(o.flags|=2048),Ba(On),pe(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(a===null||a.child===null)&&(Gl(o)?za(o):a===null||a.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Gd())),dn(o),null;case 26:var b=o.type,x=o.memoizedState;return a===null?(za(o),x!==null?(dn(o),Zb(o,x)):(dn(o),Bh(o,b,null,g,d))):x?x!==a.memoizedState?(za(o),dn(o),Zb(o,x)):(dn(o),o.flags&=-16777217):(a=a.memoizedProps,a!==g&&za(o),dn(o),Bh(o,b,a,g,d)),null;case 27:if(le(o),d=se.current,b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==g&&za(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return dn(o),null}a=W.current,Gl(o)?Ny(o):(a=rE(b,g,d),o.stateNode=a,za(o))}return dn(o),null;case 5:if(le(o),b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==g&&za(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return dn(o),null}if(x=W.current,Gl(o))Ny(o);else{var R=Fc(se.current);switch(x){case 1:x=R.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:x=R.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":x=R.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":x=R.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":x=R.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof g.is=="string"?R.createElement("select",{is:g.is}):R.createElement("select"),g.multiple?x.multiple=!0:g.size&&(x.size=g.size);break;default:x=typeof g.is=="string"?R.createElement(b,{is:g.is}):R.createElement(b)}}x[Tt]=o,x[mn]=g;e:for(R=o.child;R!==null;){if(R.tag===5||R.tag===6)x.appendChild(R.stateNode);else if(R.tag!==4&&R.tag!==27&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===o)break e;for(;R.sibling===null;){if(R.return===null||R.return===o)break e;R=R.return}R.sibling.return=R.return,R=R.sibling}o.stateNode=x;e:switch(nr(x,b,g),b){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&za(o)}}return dn(o),Bh(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,d),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==g&&za(o);else{if(typeof g!="string"&&o.stateNode===null)throw Error(r(166));if(a=se.current,Gl(o)){if(a=o.stateNode,d=o.memoizedProps,g=null,b=Jn,b!==null)switch(b.tag){case 27:case 5:g=b.memoizedProps}a[Tt]=o,a=!!(a.nodeValue===d||g!==null&&g.suppressHydrationWarning===!0||$0(a.nodeValue,d)),a||ii(o,!0)}else a=Fc(a).createTextNode(g),a[Tt]=o,o.stateNode=a}return dn(o),null;case 31:if(d=o.memoizedState,a===null||a.memoizedState!==null){if(g=Gl(o),d!==null){if(a===null){if(!g)throw Error(r(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[Tt]=o}else nl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;dn(o),a=!1}else d=Gd(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=d),a=!0;if(!a)return o.flags&256?(zr(o),o):(zr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return dn(o),null;case 13:if(g=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=Gl(o),g!==null&&g.dehydrated!==null){if(a===null){if(!b)throw Error(r(318));if(b=o.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[Tt]=o}else nl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;dn(o),b=!1}else b=Gd(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return o.flags&256?(zr(o),o):(zr(o),null)}return zr(o),(o.flags&128)!==0?(o.lanes=d,o):(d=g!==null,a=a!==null&&a.memoizedState!==null,d&&(g=o.child,b=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(b=g.alternate.memoizedState.cachePool.pool),x=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(x=g.memoizedState.cachePool.pool),x!==b&&(g.flags|=2048)),d!==a&&d&&(o.child.flags|=8192),xc(o,o.updateQueue),dn(o),null);case 4:return pe(),a===null&&nv(o.stateNode.containerInfo),dn(o),null;case 10:return Ba(o.type),dn(o),null;case 19:if(q(Nn),g=o.memoizedState,g===null)return dn(o),null;if(b=(o.flags&128)!==0,x=g.rendering,x===null)if(b)xo(g,!1);else{if(An!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(x=oc(a),x!==null){for(o.flags|=128,xo(g,!1),a=x.updateQueue,o.updateQueue=a,xc(o,a),o.subtreeFlags=0,a=d,d=o.child;d!==null;)Cy(d,a),d=d.sibling;return L(Nn,Nn.current&1|2),It&&Ma(o,g.treeForkCount),o.child}a=a.sibling}g.tail!==null&&je()>Dc&&(o.flags|=128,b=!0,xo(g,!1),o.lanes=4194304)}else{if(!b)if(a=oc(x),a!==null){if(o.flags|=128,b=!0,a=a.updateQueue,o.updateQueue=a,xc(o,a),xo(g,!0),g.tail===null&&g.tailMode==="hidden"&&!x.alternate&&!It)return dn(o),null}else 2*je()-g.renderingStartTime>Dc&&d!==536870912&&(o.flags|=128,b=!0,xo(g,!1),o.lanes=4194304);g.isBackwards?(x.sibling=o.child,o.child=x):(a=g.last,a!==null?a.sibling=x:o.child=x,g.last=x)}return g.tail!==null?(a=g.tail,g.rendering=a,g.tail=a.sibling,g.renderingStartTime=je(),a.sibling=null,d=Nn.current,L(Nn,b?d&1|2:d&1),It&&Ma(o,g.treeForkCount),a):(dn(o),null);case 22:case 23:return zr(o),rh(),g=o.memoizedState!==null,a!==null?a.memoizedState!==null!==g&&(o.flags|=8192):g&&(o.flags|=8192),g?(d&536870912)!==0&&(o.flags&128)===0&&(dn(o),o.subtreeFlags&6&&(o.flags|=8192)):dn(o),d=o.updateQueue,d!==null&&xc(o,d.retryQueue),d=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),g=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(g=o.memoizedState.cachePool.pool),g!==d&&(o.flags|=2048),a!==null&&q(il),null;case 24:return d=null,a!==null&&(d=a.memoizedState.cache),o.memoizedState.cache!==d&&(o.flags|=2048),Ba(On),dn(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function YA(a,o){switch(jd(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return Ba(On),pe(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return le(o),null;case 31:if(o.memoizedState!==null){if(zr(o),o.alternate===null)throw Error(r(340));nl()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(zr(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(r(340));nl()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return q(Nn),null;case 4:return pe(),null;case 10:return Ba(o.type),null;case 22:case 23:return zr(o),rh(),a!==null&&q(il),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return Ba(On),null;case 25:return null;default:return null}}function Qb(a,o){switch(jd(o),o.tag){case 3:Ba(On),pe();break;case 26:case 27:case 5:le(o);break;case 4:pe();break;case 31:o.memoizedState!==null&&zr(o);break;case 13:zr(o);break;case 19:q(Nn);break;case 10:Ba(o.type);break;case 22:case 23:zr(o),rh(),a!==null&&q(il);break;case 24:Ba(On)}}function wo(a,o){try{var d=o.updateQueue,g=d!==null?d.lastEffect:null;if(g!==null){var b=g.next;d=b;do{if((d.tag&a)===a){g=void 0;var x=d.create,R=d.inst;g=x(),R.destroy=g}d=d.next}while(d!==b)}}catch(V){Zt(o,o.return,V)}}function di(a,o,d){try{var g=o.updateQueue,b=g!==null?g.lastEffect:null;if(b!==null){var x=b.next;g=x;do{if((g.tag&a)===a){var R=g.inst,V=R.destroy;if(V!==void 0){R.destroy=void 0,b=o;var Z=d,he=V;try{he()}catch(we){Zt(b,Z,we)}}}g=g.next}while(g!==x)}}catch(we){Zt(o,o.return,we)}}function Wb(a){var o=a.updateQueue;if(o!==null){var d=a.stateNode;try{jy(o,d)}catch(g){Zt(a,a.return,g)}}}function Jb(a,o,d){d.props=cl(a.type,a.memoizedProps),d.state=a.memoizedState;try{d.componentWillUnmount()}catch(g){Zt(a,o,g)}}function So(a,o){try{var d=a.ref;if(d!==null){switch(a.tag){case 26:case 27:case 5:var g=a.stateNode;break;case 30:g=a.stateNode;break;default:g=a.stateNode}typeof d=="function"?a.refCleanup=d(g):d.current=g}}catch(b){Zt(a,o,b)}}function ma(a,o){var d=a.ref,g=a.refCleanup;if(d!==null)if(typeof g=="function")try{g()}catch(b){Zt(a,o,b)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(b){Zt(a,o,b)}else d.current=null}function e0(a){var o=a.type,d=a.memoizedProps,g=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":d.autoFocus&&g.focus();break e;case"img":d.src?g.src=d.src:d.srcSet&&(g.srcset=d.srcSet)}}catch(b){Zt(a,a.return,b)}}function Lh(a,o,d){try{var g=a.stateNode;p_(g,a.type,d,o),g[mn]=o}catch(b){Zt(a,a.return,b)}}function t0(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&bi(a.type)||a.tag===4}function Fh(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||t0(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&bi(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Ih(a,o,d){var g=a.tag;if(g===5||g===6)a=a.stateNode,o?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(a,o):(o=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,o.appendChild(a),d=d._reactRootContainer,d!=null||o.onclick!==null||(o.onclick=Ue));else if(g!==4&&(g===27&&bi(a.type)&&(d=a.stateNode,o=null),a=a.child,a!==null))for(Ih(a,o,d),a=a.sibling;a!==null;)Ih(a,o,d),a=a.sibling}function wc(a,o,d){var g=a.tag;if(g===5||g===6)a=a.stateNode,o?d.insertBefore(a,o):d.appendChild(a);else if(g!==4&&(g===27&&bi(a.type)&&(d=a.stateNode),a=a.child,a!==null))for(wc(a,o,d),a=a.sibling;a!==null;)wc(a,o,d),a=a.sibling}function n0(a){var o=a.stateNode,d=a.memoizedProps;try{for(var g=a.type,b=o.attributes;b.length;)o.removeAttributeNode(b[0]);nr(o,g,d),o[Tt]=a,o[mn]=d}catch(x){Zt(a,a.return,x)}}var Pa=!1,Fn=!1,zh=!1,r0=typeof WeakSet=="function"?WeakSet:Set,Kn=null;function XA(a,o){if(a=a.containerInfo,iv=Hc,a=gy(a),Rd(a)){if("selectionStart"in a)var d={start:a.selectionStart,end:a.selectionEnd};else e:{d=(d=a.ownerDocument)&&d.defaultView||window;var g=d.getSelection&&d.getSelection();if(g&&g.rangeCount!==0){d=g.anchorNode;var b=g.anchorOffset,x=g.focusNode;g=g.focusOffset;try{d.nodeType,x.nodeType}catch{d=null;break e}var R=0,V=-1,Z=-1,he=0,we=0,Ae=a,ve=null;t:for(;;){for(var ye;Ae!==d||b!==0&&Ae.nodeType!==3||(V=R+b),Ae!==x||g!==0&&Ae.nodeType!==3||(Z=R+g),Ae.nodeType===3&&(R+=Ae.nodeValue.length),(ye=Ae.firstChild)!==null;)ve=Ae,Ae=ye;for(;;){if(Ae===a)break t;if(ve===d&&++he===b&&(V=R),ve===x&&++we===g&&(Z=R),(ye=Ae.nextSibling)!==null)break;Ae=ve,ve=Ae.parentNode}Ae=ye}d=V===-1||Z===-1?null:{start:V,end:Z}}else d=null}d=d||{start:0,end:0}}else d=null;for(lv={focusedElem:a,selectionRange:d},Hc=!1,Kn=o;Kn!==null;)if(o=Kn,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,Kn=a;else for(;Kn!==null;){switch(o=Kn,x=o.alternate,a=o.flags,o.tag){case 0:if((a&4)!==0&&(a=o.updateQueue,a=a!==null?a.events:null,a!==null))for(d=0;d<a.length;d++)b=a[d],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&x!==null){a=void 0,d=o,b=x.memoizedProps,x=x.memoizedState,g=d.stateNode;try{var nt=cl(d.type,b);a=g.getSnapshotBeforeUpdate(nt,x),g.__reactInternalSnapshotBeforeUpdate=a}catch(pt){Zt(d,d.return,pt)}}break;case 3:if((a&1024)!==0){if(a=o.stateNode.containerInfo,d=a.nodeType,d===9)uv(a);else if(d===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":uv(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=o.sibling,a!==null){a.return=o.return,Kn=a;break}Kn=o.return}}function a0(a,o,d){var g=d.flags;switch(d.tag){case 0:case 11:case 15:qa(a,d),g&4&&wo(5,d);break;case 1:if(qa(a,d),g&4)if(a=d.stateNode,o===null)try{a.componentDidMount()}catch(R){Zt(d,d.return,R)}else{var b=cl(d.type,o.memoizedProps);o=o.memoizedState;try{a.componentDidUpdate(b,o,a.__reactInternalSnapshotBeforeUpdate)}catch(R){Zt(d,d.return,R)}}g&64&&Wb(d),g&512&&So(d,d.return);break;case 3:if(qa(a,d),g&64&&(a=d.updateQueue,a!==null)){if(o=null,d.child!==null)switch(d.child.tag){case 27:case 5:o=d.child.stateNode;break;case 1:o=d.child.stateNode}try{jy(a,o)}catch(R){Zt(d,d.return,R)}}break;case 27:o===null&&g&4&&n0(d);case 26:case 5:qa(a,d),o===null&&g&4&&e0(d),g&512&&So(d,d.return);break;case 12:qa(a,d);break;case 31:qa(a,d),g&4&&s0(a,d);break;case 13:qa(a,d),g&4&&o0(a,d),g&64&&(a=d.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(d=a_.bind(null,d),C_(a,d))));break;case 22:if(g=d.memoizedState!==null||Pa,!g){o=o!==null&&o.memoizedState!==null||Fn,b=Pa;var x=Fn;Pa=g,(Fn=o)&&!x?ja(a,d,(d.subtreeFlags&8772)!==0):qa(a,d),Pa=b,Fn=x}break;case 30:break;default:qa(a,d)}}function i0(a){var o=a.alternate;o!==null&&(a.alternate=null,i0(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&sr(o)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var vn=null,Tr=!1;function Ua(a,o,d){for(d=d.child;d!==null;)l0(a,o,d),d=d.sibling}function l0(a,o,d){if(ne&&typeof ne.onCommitFiberUnmount=="function")try{ne.onCommitFiberUnmount(G,d)}catch{}switch(d.tag){case 26:Fn||ma(d,o),Ua(a,o,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:Fn||ma(d,o);var g=vn,b=Tr;bi(d.type)&&(vn=d.stateNode,Tr=!1),Ua(a,o,d),Mo(d.stateNode),vn=g,Tr=b;break;case 5:Fn||ma(d,o);case 6:if(g=vn,b=Tr,vn=null,Ua(a,o,d),vn=g,Tr=b,vn!==null)if(Tr)try{(vn.nodeType===9?vn.body:vn.nodeName==="HTML"?vn.ownerDocument.body:vn).removeChild(d.stateNode)}catch(x){Zt(d,o,x)}else try{vn.removeChild(d.stateNode)}catch(x){Zt(d,o,x)}break;case 18:vn!==null&&(Tr?(a=vn,W0(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,d.stateNode),fs(a)):W0(vn,d.stateNode));break;case 4:g=vn,b=Tr,vn=d.stateNode.containerInfo,Tr=!0,Ua(a,o,d),vn=g,Tr=b;break;case 0:case 11:case 14:case 15:di(2,d,o),Fn||di(4,d,o),Ua(a,o,d);break;case 1:Fn||(ma(d,o),g=d.stateNode,typeof g.componentWillUnmount=="function"&&Jb(d,o,g)),Ua(a,o,d);break;case 21:Ua(a,o,d);break;case 22:Fn=(g=Fn)||d.memoizedState!==null,Ua(a,o,d),Fn=g;break;default:Ua(a,o,d)}}function s0(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{fs(a)}catch(d){Zt(o,o.return,d)}}}function o0(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{fs(a)}catch(d){Zt(o,o.return,d)}}function ZA(a){switch(a.tag){case 31:case 13:case 19:var o=a.stateNode;return o===null&&(o=a.stateNode=new r0),o;case 22:return a=a.stateNode,o=a._retryCache,o===null&&(o=a._retryCache=new r0),o;default:throw Error(r(435,a.tag))}}function Sc(a,o){var d=ZA(a);o.forEach(function(g){if(!d.has(g)){d.add(g);var b=i_.bind(null,a,g);g.then(b,b)}})}function Dr(a,o){var d=o.deletions;if(d!==null)for(var g=0;g<d.length;g++){var b=d[g],x=a,R=o,V=R;e:for(;V!==null;){switch(V.tag){case 27:if(bi(V.type)){vn=V.stateNode,Tr=!1;break e}break;case 5:vn=V.stateNode,Tr=!1;break e;case 3:case 4:vn=V.stateNode.containerInfo,Tr=!0;break e}V=V.return}if(vn===null)throw Error(r(160));l0(x,R,b),vn=null,Tr=!1,x=b.alternate,x!==null&&(x.return=null),b.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)u0(o,a),o=o.sibling}var ua=null;function u0(a,o){var d=a.alternate,g=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Dr(o,a),Ar(a),g&4&&(di(3,a,a.return),wo(3,a),di(5,a,a.return));break;case 1:Dr(o,a),Ar(a),g&512&&(Fn||d===null||ma(d,d.return)),g&64&&Pa&&(a=a.updateQueue,a!==null&&(g=a.callbacks,g!==null&&(d=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=d===null?g:d.concat(g))));break;case 26:var b=ua;if(Dr(o,a),Ar(a),g&512&&(Fn||d===null||ma(d,d.return)),g&4){var x=d!==null?d.memoizedState:null;if(g=a.memoizedState,d===null)if(g===null)if(a.stateNode===null){e:{g=a.type,d=a.memoizedProps,b=b.ownerDocument||b;t:switch(g){case"title":x=b.getElementsByTagName("title")[0],(!x||x[Cn]||x[Tt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=b.createElement(g),b.head.insertBefore(x,b.querySelector("head > title"))),nr(x,g,d),x[Tt]=a,nn(x),g=x;break e;case"link":var R=uE("link","href",b).get(g+(d.href||""));if(R){for(var V=0;V<R.length;V++)if(x=R[V],x.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&x.getAttribute("rel")===(d.rel==null?null:d.rel)&&x.getAttribute("title")===(d.title==null?null:d.title)&&x.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){R.splice(V,1);break t}}x=b.createElement(g),nr(x,g,d),b.head.appendChild(x);break;case"meta":if(R=uE("meta","content",b).get(g+(d.content||""))){for(V=0;V<R.length;V++)if(x=R[V],x.getAttribute("content")===(d.content==null?null:""+d.content)&&x.getAttribute("name")===(d.name==null?null:d.name)&&x.getAttribute("property")===(d.property==null?null:d.property)&&x.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&x.getAttribute("charset")===(d.charSet==null?null:d.charSet)){R.splice(V,1);break t}}x=b.createElement(g),nr(x,g,d),b.head.appendChild(x);break;default:throw Error(r(468,g))}x[Tt]=a,nn(x),g=x}a.stateNode=g}else cE(b,a.type,a.stateNode);else a.stateNode=oE(b,g,a.memoizedProps);else x!==g?(x===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):x.count--,g===null?cE(b,a.type,a.stateNode):oE(b,g,a.memoizedProps)):g===null&&a.stateNode!==null&&Lh(a,a.memoizedProps,d.memoizedProps)}break;case 27:Dr(o,a),Ar(a),g&512&&(Fn||d===null||ma(d,d.return)),d!==null&&g&4&&Lh(a,a.memoizedProps,d.memoizedProps);break;case 5:if(Dr(o,a),Ar(a),g&512&&(Fn||d===null||ma(d,d.return)),a.flags&32){b=a.stateNode;try{mt(b,"")}catch(nt){Zt(a,a.return,nt)}}g&4&&a.stateNode!=null&&(b=a.memoizedProps,Lh(a,b,d!==null?d.memoizedProps:b)),g&1024&&(zh=!0);break;case 6:if(Dr(o,a),Ar(a),g&4){if(a.stateNode===null)throw Error(r(162));g=a.memoizedProps,d=a.stateNode;try{d.nodeValue=g}catch(nt){Zt(a,a.return,nt)}}break;case 3:if(Pc=null,b=ua,ua=Ic(o.containerInfo),Dr(o,a),ua=b,Ar(a),g&4&&d!==null&&d.memoizedState.isDehydrated)try{fs(o.containerInfo)}catch(nt){Zt(a,a.return,nt)}zh&&(zh=!1,c0(a));break;case 4:g=ua,ua=Ic(a.stateNode.containerInfo),Dr(o,a),Ar(a),ua=g;break;case 12:Dr(o,a),Ar(a);break;case 31:Dr(o,a),Ar(a),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,Sc(a,g)));break;case 13:Dr(o,a),Ar(a),a.child.flags&8192&&a.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Tc=je()),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,Sc(a,g)));break;case 22:b=a.memoizedState!==null;var Z=d!==null&&d.memoizedState!==null,he=Pa,we=Fn;if(Pa=he||b,Fn=we||Z,Dr(o,a),Fn=we,Pa=he,Ar(a),g&8192)e:for(o=a.stateNode,o._visibility=b?o._visibility&-2:o._visibility|1,b&&(d===null||Z||Pa||Fn||fl(a)),d=null,o=a;;){if(o.tag===5||o.tag===26){if(d===null){Z=d=o;try{if(x=Z.stateNode,b)R=x.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none";else{V=Z.stateNode;var Ae=Z.memoizedProps.style,ve=Ae!=null&&Ae.hasOwnProperty("display")?Ae.display:null;V.style.display=ve==null||typeof ve=="boolean"?"":(""+ve).trim()}}catch(nt){Zt(Z,Z.return,nt)}}}else if(o.tag===6){if(d===null){Z=o;try{Z.stateNode.nodeValue=b?"":Z.memoizedProps}catch(nt){Zt(Z,Z.return,nt)}}}else if(o.tag===18){if(d===null){Z=o;try{var ye=Z.stateNode;b?J0(ye,!0):J0(Z.stateNode,!1)}catch(nt){Zt(Z,Z.return,nt)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===a)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;d===o&&(d=null),o=o.return}d===o&&(d=null),o.sibling.return=o.return,o=o.sibling}g&4&&(g=a.updateQueue,g!==null&&(d=g.retryQueue,d!==null&&(g.retryQueue=null,Sc(a,d))));break;case 19:Dr(o,a),Ar(a),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,Sc(a,g)));break;case 30:break;case 21:break;default:Dr(o,a),Ar(a)}}function Ar(a){var o=a.flags;if(o&2){try{for(var d,g=a.return;g!==null;){if(t0(g)){d=g;break}g=g.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var b=d.stateNode,x=Fh(a);wc(a,x,b);break;case 5:var R=d.stateNode;d.flags&32&&(mt(R,""),d.flags&=-33);var V=Fh(a);wc(a,V,R);break;case 3:case 4:var Z=d.stateNode.containerInfo,he=Fh(a);Ih(a,he,Z);break;default:throw Error(r(161))}}catch(we){Zt(a,a.return,we)}a.flags&=-3}o&4096&&(a.flags&=-4097)}function c0(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var o=a;c0(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),a=a.sibling}}function qa(a,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)a0(a,o.alternate,o),o=o.sibling}function fl(a){for(a=a.child;a!==null;){var o=a;switch(o.tag){case 0:case 11:case 14:case 15:di(4,o,o.return),fl(o);break;case 1:ma(o,o.return);var d=o.stateNode;typeof d.componentWillUnmount=="function"&&Jb(o,o.return,d),fl(o);break;case 27:Mo(o.stateNode);case 26:case 5:ma(o,o.return),fl(o);break;case 22:o.memoizedState===null&&fl(o);break;case 30:fl(o);break;default:fl(o)}a=a.sibling}}function ja(a,o,d){for(d=d&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var g=o.alternate,b=a,x=o,R=x.flags;switch(x.tag){case 0:case 11:case 15:ja(b,x,d),wo(4,x);break;case 1:if(ja(b,x,d),g=x,b=g.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(he){Zt(g,g.return,he)}if(g=x,b=g.updateQueue,b!==null){var V=g.stateNode;try{var Z=b.shared.hiddenCallbacks;if(Z!==null)for(b.shared.hiddenCallbacks=null,b=0;b<Z.length;b++)qy(Z[b],V)}catch(he){Zt(g,g.return,he)}}d&&R&64&&Wb(x),So(x,x.return);break;case 27:n0(x);case 26:case 5:ja(b,x,d),d&&g===null&&R&4&&e0(x),So(x,x.return);break;case 12:ja(b,x,d);break;case 31:ja(b,x,d),d&&R&4&&s0(b,x);break;case 13:ja(b,x,d),d&&R&4&&o0(b,x);break;case 22:x.memoizedState===null&&ja(b,x,d),So(x,x.return);break;case 30:break;default:ja(b,x,d)}o=o.sibling}}function Ph(a,o){var d=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),a=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(a=o.memoizedState.cachePool.pool),a!==d&&(a!=null&&a.refCount++,d!=null&&oo(d))}function Uh(a,o){a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&oo(a))}function ca(a,o,d,g){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)f0(a,o,d,g),o=o.sibling}function f0(a,o,d,g){var b=o.flags;switch(o.tag){case 0:case 11:case 15:ca(a,o,d,g),b&2048&&wo(9,o);break;case 1:ca(a,o,d,g);break;case 3:ca(a,o,d,g),b&2048&&(a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&oo(a)));break;case 12:if(b&2048){ca(a,o,d,g),a=o.stateNode;try{var x=o.memoizedProps,R=x.id,V=x.onPostCommit;typeof V=="function"&&V(R,o.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(Z){Zt(o,o.return,Z)}}else ca(a,o,d,g);break;case 31:ca(a,o,d,g);break;case 13:ca(a,o,d,g);break;case 23:break;case 22:x=o.stateNode,R=o.alternate,o.memoizedState!==null?x._visibility&2?ca(a,o,d,g):Co(a,o):x._visibility&2?ca(a,o,d,g):(x._visibility|=2,es(a,o,d,g,(o.subtreeFlags&10256)!==0||!1)),b&2048&&Ph(R,o);break;case 24:ca(a,o,d,g),b&2048&&Uh(o.alternate,o);break;default:ca(a,o,d,g)}}function es(a,o,d,g,b){for(b=b&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var x=a,R=o,V=d,Z=g,he=R.flags;switch(R.tag){case 0:case 11:case 15:es(x,R,V,Z,b),wo(8,R);break;case 23:break;case 22:var we=R.stateNode;R.memoizedState!==null?we._visibility&2?es(x,R,V,Z,b):Co(x,R):(we._visibility|=2,es(x,R,V,Z,b)),b&&he&2048&&Ph(R.alternate,R);break;case 24:es(x,R,V,Z,b),b&&he&2048&&Uh(R.alternate,R);break;default:es(x,R,V,Z,b)}o=o.sibling}}function Co(a,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var d=a,g=o,b=g.flags;switch(g.tag){case 22:Co(d,g),b&2048&&Ph(g.alternate,g);break;case 24:Co(d,g),b&2048&&Uh(g.alternate,g);break;default:Co(d,g)}o=o.sibling}}var To=8192;function ts(a,o,d){if(a.subtreeFlags&To)for(a=a.child;a!==null;)d0(a,o,d),a=a.sibling}function d0(a,o,d){switch(a.tag){case 26:ts(a,o,d),a.flags&To&&a.memoizedState!==null&&F_(d,ua,a.memoizedState,a.memoizedProps);break;case 5:ts(a,o,d);break;case 3:case 4:var g=ua;ua=Ic(a.stateNode.containerInfo),ts(a,o,d),ua=g;break;case 22:a.memoizedState===null&&(g=a.alternate,g!==null&&g.memoizedState!==null?(g=To,To=16777216,ts(a,o,d),To=g):ts(a,o,d));break;default:ts(a,o,d)}}function h0(a){var o=a.alternate;if(o!==null&&(a=o.child,a!==null)){o.child=null;do o=a.sibling,a.sibling=null,a=o;while(a!==null)}}function Do(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var g=o[d];Kn=g,g0(g,a)}h0(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)v0(a),a=a.sibling}function v0(a){switch(a.tag){case 0:case 11:case 15:Do(a),a.flags&2048&&di(9,a,a.return);break;case 3:Do(a);break;case 12:Do(a);break;case 22:var o=a.stateNode;a.memoizedState!==null&&o._visibility&2&&(a.return===null||a.return.tag!==13)?(o._visibility&=-3,Cc(a)):Do(a);break;default:Do(a)}}function Cc(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var g=o[d];Kn=g,g0(g,a)}h0(a)}for(a=a.child;a!==null;){switch(o=a,o.tag){case 0:case 11:case 15:di(8,o,o.return),Cc(o);break;case 22:d=o.stateNode,d._visibility&2&&(d._visibility&=-3,Cc(o));break;default:Cc(o)}a=a.sibling}}function g0(a,o){for(;Kn!==null;){var d=Kn;switch(d.tag){case 0:case 11:case 15:di(8,d,o);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var g=d.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:oo(d.memoizedState.cache)}if(g=d.child,g!==null)g.return=d,Kn=g;else e:for(d=a;Kn!==null;){g=Kn;var b=g.sibling,x=g.return;if(i0(g),g===d){Kn=null;break e}if(b!==null){b.return=x,Kn=b;break e}Kn=x}}}var QA={getCacheForType:function(a){var o=er(On),d=o.data.get(a);return d===void 0&&(d=a(),o.data.set(a,d)),d},cacheSignal:function(){return er(On).controller.signal}},WA=typeof WeakMap=="function"?WeakMap:Map,Gt=0,rn=null,Rt=null,Lt=0,Xt=0,Pr=null,hi=!1,ns=!1,qh=!1,Ha=0,An=0,vi=0,dl=0,jh=0,Ur=0,rs=0,Ao=null,_r=null,Hh=!1,Tc=0,p0=0,Dc=1/0,Ac=null,gi=null,qn=0,pi=null,as=null,Ga=0,Gh=0,Vh=null,m0=null,_o=0,$h=null;function qr(){return(Gt&2)!==0&&Lt!==0?Lt&-Lt:B.T!==null?Wh():Kt()}function y0(){if(Ur===0)if((Lt&536870912)===0||It){var a=$e;$e<<=1,($e&3932160)===0&&($e=262144),Ur=a}else Ur=536870912;return a=Ir.current,a!==null&&(a.flags|=32),Ur}function Nr(a,o,d){(a===rn&&(Xt===2||Xt===9)||a.cancelPendingCommit!==null)&&(is(a,0),mi(a,Lt,Ur,!1)),dt(a,d),((Gt&2)===0||a!==rn)&&(a===rn&&((Gt&2)===0&&(dl|=d),An===4&&mi(a,Lt,Ur,!1)),ya(a))}function b0(a,o,d){if((Gt&6)!==0)throw Error(r(327));var g=!d&&(o&127)===0&&(o&a.expiredLanes)===0||re(a,o),b=g?t_(a,o):Yh(a,o,!0),x=g;do{if(b===0){ns&&!g&&mi(a,o,0,!1);break}else{if(d=a.current.alternate,x&&!JA(d)){b=Yh(a,o,!1),x=!1;continue}if(b===2){if(x=o,a.errorRecoveryDisabledLanes&x)var R=0;else R=a.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){o=R;e:{var V=a;b=Ao;var Z=V.current.memoizedState.isDehydrated;if(Z&&(is(V,R).flags|=256),R=Yh(V,R,!1),R!==2){if(qh&&!Z){V.errorRecoveryDisabledLanes|=x,dl|=x,b=4;break e}x=_r,_r=b,x!==null&&(_r===null?_r=x:_r.push.apply(_r,x))}b=R}if(x=!1,b!==2)continue}}if(b===1){is(a,0),mi(a,o,0,!0);break}e:{switch(g=a,x=b,x){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:mi(g,o,Ur,!hi);break e;case 2:_r=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(b=Tc+300-je(),10<b)){if(mi(g,o,Ur,!hi),X(g,0,!0)!==0)break e;Ga=o,g.timeoutHandle=Z0(E0.bind(null,g,d,_r,Ac,Hh,o,Ur,dl,rs,hi,x,"Throttled",-0,0),b);break e}E0(g,d,_r,Ac,Hh,o,Ur,dl,rs,hi,x,null,-0,0)}}break}while(!0);ya(a)}function E0(a,o,d,g,b,x,R,V,Z,he,we,Ae,ve,ye){if(a.timeoutHandle=-1,Ae=o.subtreeFlags,Ae&8192||(Ae&16785408)===16785408){Ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ue},d0(o,x,Ae);var nt=(x&62914560)===x?Tc-je():(x&4194048)===x?p0-je():0;if(nt=I_(Ae,nt),nt!==null){Ga=x,a.cancelPendingCommit=nt(_0.bind(null,a,o,x,d,g,b,R,V,Z,we,Ae,null,ve,ye)),mi(a,x,R,!he);return}}_0(a,o,x,d,g,b,R,V,Z)}function JA(a){for(var o=a;;){var d=o.tag;if((d===0||d===11||d===15)&&o.flags&16384&&(d=o.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var g=0;g<d.length;g++){var b=d[g],x=b.getSnapshot;b=b.value;try{if(!Lr(x(),b))return!1}catch{return!1}}if(d=o.child,o.subtreeFlags&16384&&d!==null)d.return=o,o=d;else{if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function mi(a,o,d,g){o&=~jh,o&=~dl,a.suspendedLanes|=o,a.pingedLanes&=~o,g&&(a.warmLanes|=o),g=a.expirationTimes;for(var b=o;0<b;){var x=31-oe(b),R=1<<x;g[x]=-1,b&=~R}d!==0&&Be(a,d,o)}function _c(){return(Gt&6)===0?(No(0),!1):!0}function Kh(){if(Rt!==null){if(Xt===0)var a=Rt.return;else a=Rt,Oa=rl=null,uh(a),Xl=null,co=0,a=Rt;for(;a!==null;)Qb(a.alternate,a),a=a.return;Rt=null}}function is(a,o){var d=a.timeoutHandle;d!==-1&&(a.timeoutHandle=-1,b_(d)),d=a.cancelPendingCommit,d!==null&&(a.cancelPendingCommit=null,d()),Ga=0,Kh(),rn=a,Rt=d=Ra(a.current,null),Lt=o,Xt=0,Pr=null,hi=!1,ns=re(a,o),qh=!1,rs=Ur=jh=dl=vi=An=0,_r=Ao=null,Hh=!1,(o&8)!==0&&(o|=o&32);var g=a.entangledLanes;if(g!==0)for(a=a.entanglements,g&=o;0<g;){var b=31-oe(g),x=1<<b;o|=a[b],g&=~x}return Ha=o,Xu(),d}function x0(a,o){Dt=null,B.H=bo,o===Yl||o===rc?(o=Iy(),Xt=3):o===Qd?(o=Iy(),Xt=4):Xt=o===Th?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Pr=o,Rt===null&&(An=1,mc(a,Zr(o,a.current)))}function w0(){var a=Ir.current;return a===null?!0:(Lt&4194048)===Lt?ea===null:(Lt&62914560)===Lt||(Lt&536870912)!==0?a===ea:!1}function S0(){var a=B.H;return B.H=bo,a===null?bo:a}function C0(){var a=B.A;return B.A=QA,a}function Nc(){An=4,hi||(Lt&4194048)!==Lt&&Ir.current!==null||(ns=!0),(vi&134217727)===0&&(dl&134217727)===0||rn===null||mi(rn,Lt,Ur,!1)}function Yh(a,o,d){var g=Gt;Gt|=2;var b=S0(),x=C0();(rn!==a||Lt!==o)&&(Ac=null,is(a,o)),o=!1;var R=An;e:do try{if(Xt!==0&&Rt!==null){var V=Rt,Z=Pr;switch(Xt){case 8:Kh(),R=6;break e;case 3:case 2:case 9:case 6:Ir.current===null&&(o=!0);var he=Xt;if(Xt=0,Pr=null,ls(a,V,Z,he),d&&ns){R=0;break e}break;default:he=Xt,Xt=0,Pr=null,ls(a,V,Z,he)}}e_(),R=An;break}catch(we){x0(a,we)}while(!0);return o&&a.shellSuspendCounter++,Oa=rl=null,Gt=g,B.H=b,B.A=x,Rt===null&&(rn=null,Lt=0,Xu()),R}function e_(){for(;Rt!==null;)T0(Rt)}function t_(a,o){var d=Gt;Gt|=2;var g=S0(),b=C0();rn!==a||Lt!==o?(Ac=null,Dc=je()+500,is(a,o)):ns=re(a,o);e:do try{if(Xt!==0&&Rt!==null){o=Rt;var x=Pr;t:switch(Xt){case 1:Xt=0,Pr=null,ls(a,o,x,1);break;case 2:case 9:if(Ly(x)){Xt=0,Pr=null,D0(o);break}o=function(){Xt!==2&&Xt!==9||rn!==a||(Xt=7),ya(a)},x.then(o,o);break e;case 3:Xt=7;break e;case 4:Xt=5;break e;case 7:Ly(x)?(Xt=0,Pr=null,D0(o)):(Xt=0,Pr=null,ls(a,o,x,7));break;case 5:var R=null;switch(Rt.tag){case 26:R=Rt.memoizedState;case 5:case 27:var V=Rt;if(R?fE(R):V.stateNode.complete){Xt=0,Pr=null;var Z=V.sibling;if(Z!==null)Rt=Z;else{var he=V.return;he!==null?(Rt=he,kc(he)):Rt=null}break t}}Xt=0,Pr=null,ls(a,o,x,5);break;case 6:Xt=0,Pr=null,ls(a,o,x,6);break;case 8:Kh(),An=6;break e;default:throw Error(r(462))}}n_();break}catch(we){x0(a,we)}while(!0);return Oa=rl=null,B.H=g,B.A=b,Gt=d,Rt!==null?0:(rn=null,Lt=0,Xu(),An)}function n_(){for(;Rt!==null&&!Ye();)T0(Rt)}function T0(a){var o=Xb(a.alternate,a,Ha);a.memoizedProps=a.pendingProps,o===null?kc(a):Rt=o}function D0(a){var o=a,d=o.alternate;switch(o.tag){case 15:case 0:o=Hb(d,o,o.pendingProps,o.type,void 0,Lt);break;case 11:o=Hb(d,o,o.pendingProps,o.type.render,o.ref,Lt);break;case 5:uh(o);default:Qb(d,o),o=Rt=Cy(o,Ha),o=Xb(d,o,Ha)}a.memoizedProps=a.pendingProps,o===null?kc(a):Rt=o}function ls(a,o,d,g){Oa=rl=null,uh(o),Xl=null,co=0;var b=o.return;try{if(GA(a,b,o,d,Lt)){An=1,mc(a,Zr(d,a.current)),Rt=null;return}}catch(x){if(b!==null)throw Rt=b,x;An=1,mc(a,Zr(d,a.current)),Rt=null;return}o.flags&32768?(It||g===1?a=!0:ns||(Lt&536870912)!==0?a=!1:(hi=a=!0,(g===2||g===9||g===3||g===6)&&(g=Ir.current,g!==null&&g.tag===13&&(g.flags|=16384))),A0(o,a)):kc(o)}function kc(a){var o=a;do{if((o.flags&32768)!==0){A0(o,hi);return}a=o.return;var d=KA(o.alternate,o,Ha);if(d!==null){Rt=d;return}if(o=o.sibling,o!==null){Rt=o;return}Rt=o=a}while(o!==null);An===0&&(An=5)}function A0(a,o){do{var d=YA(a.alternate,a);if(d!==null){d.flags&=32767,Rt=d;return}if(d=a.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!o&&(a=a.sibling,a!==null)){Rt=a;return}Rt=a=d}while(a!==null);An=6,Rt=null}function _0(a,o,d,g,b,x,R,V,Z){a.cancelPendingCommit=null;do Rc();while(qn!==0);if((Gt&6)!==0)throw Error(r(327));if(o!==null){if(o===a.current)throw Error(r(177));if(x=o.lanes|o.childLanes,x|=Fd,He(a,d,x,R,V,Z),a===rn&&(Rt=rn=null,Lt=0),as=o,pi=a,Ga=d,Gh=x,Vh=b,m0=g,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,l_(Ie,function(){return O0(),null})):(a.callbackNode=null,a.callbackPriority=0),g=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||g){g=B.T,B.T=null,b=H.p,H.p=2,R=Gt,Gt|=4;try{XA(a,o,d)}finally{Gt=R,H.p=b,B.T=g}}qn=1,N0(),k0(),R0()}}function N0(){if(qn===1){qn=0;var a=pi,o=as,d=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||d){d=B.T,B.T=null;var g=H.p;H.p=2;var b=Gt;Gt|=4;try{u0(o,a);var x=lv,R=gy(a.containerInfo),V=x.focusedElem,Z=x.selectionRange;if(R!==V&&V&&V.ownerDocument&&vy(V.ownerDocument.documentElement,V)){if(Z!==null&&Rd(V)){var he=Z.start,we=Z.end;if(we===void 0&&(we=he),"selectionStart"in V)V.selectionStart=he,V.selectionEnd=Math.min(we,V.value.length);else{var Ae=V.ownerDocument||document,ve=Ae&&Ae.defaultView||window;if(ve.getSelection){var ye=ve.getSelection(),nt=V.textContent.length,pt=Math.min(Z.start,nt),Jt=Z.end===void 0?pt:Math.min(Z.end,nt);!ye.extend&&pt>Jt&&(R=Jt,Jt=pt,pt=R);var ie=hy(V,pt),J=hy(V,Jt);if(ie&&J&&(ye.rangeCount!==1||ye.anchorNode!==ie.node||ye.anchorOffset!==ie.offset||ye.focusNode!==J.node||ye.focusOffset!==J.offset)){var ce=Ae.createRange();ce.setStart(ie.node,ie.offset),ye.removeAllRanges(),pt>Jt?(ye.addRange(ce),ye.extend(J.node,J.offset)):(ce.setEnd(J.node,J.offset),ye.addRange(ce))}}}}for(Ae=[],ye=V;ye=ye.parentNode;)ye.nodeType===1&&Ae.push({element:ye,left:ye.scrollLeft,top:ye.scrollTop});for(typeof V.focus=="function"&&V.focus(),V=0;V<Ae.length;V++){var Te=Ae[V];Te.element.scrollLeft=Te.left,Te.element.scrollTop=Te.top}}Hc=!!iv,lv=iv=null}finally{Gt=b,H.p=g,B.T=d}}a.current=o,qn=2}}function k0(){if(qn===2){qn=0;var a=pi,o=as,d=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||d){d=B.T,B.T=null;var g=H.p;H.p=2;var b=Gt;Gt|=4;try{a0(a,o.alternate,o)}finally{Gt=b,H.p=g,B.T=d}}qn=3}}function R0(){if(qn===4||qn===3){qn=0,ut();var a=pi,o=as,d=Ga,g=m0;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?qn=5:(qn=0,as=pi=null,M0(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(gi=null),Rn(d),o=o.stateNode,ne&&typeof ne.onCommitFiberRoot=="function")try{ne.onCommitFiberRoot(G,o,void 0,(o.current.flags&128)===128)}catch{}if(g!==null){o=B.T,b=H.p,H.p=2,B.T=null;try{for(var x=a.onRecoverableError,R=0;R<g.length;R++){var V=g[R];x(V.value,{componentStack:V.stack})}}finally{B.T=o,H.p=b}}(Ga&3)!==0&&Rc(),ya(a),b=a.pendingLanes,(d&261930)!==0&&(b&42)!==0?a===$h?_o++:(_o=0,$h=a):_o=0,No(0)}}function M0(a,o){(a.pooledCacheLanes&=o)===0&&(o=a.pooledCache,o!=null&&(a.pooledCache=null,oo(o)))}function Rc(){return N0(),k0(),R0(),O0()}function O0(){if(qn!==5)return!1;var a=pi,o=Gh;Gh=0;var d=Rn(Ga),g=B.T,b=H.p;try{H.p=32>d?32:d,B.T=null,d=Vh,Vh=null;var x=pi,R=Ga;if(qn=0,as=pi=null,Ga=0,(Gt&6)!==0)throw Error(r(331));var V=Gt;if(Gt|=4,v0(x.current),f0(x,x.current,R,d),Gt=V,No(0,!1),ne&&typeof ne.onPostCommitFiberRoot=="function")try{ne.onPostCommitFiberRoot(G,x)}catch{}return!0}finally{H.p=b,B.T=g,M0(a,o)}}function B0(a,o,d){o=Zr(d,o),o=Ch(a.stateNode,o,2),a=ui(a,o,2),a!==null&&(dt(a,2),ya(a))}function Zt(a,o,d){if(a.tag===3)B0(a,a,d);else for(;o!==null;){if(o.tag===3){B0(o,a,d);break}else if(o.tag===1){var g=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(gi===null||!gi.has(g))){a=Zr(d,a),d=Lb(2),g=ui(o,d,2),g!==null&&(Fb(d,g,o,a),dt(g,2),ya(g));break}}o=o.return}}function Xh(a,o,d){var g=a.pingCache;if(g===null){g=a.pingCache=new WA;var b=new Set;g.set(o,b)}else b=g.get(o),b===void 0&&(b=new Set,g.set(o,b));b.has(d)||(qh=!0,b.add(d),a=r_.bind(null,a,o,d),o.then(a,a))}function r_(a,o,d){var g=a.pingCache;g!==null&&g.delete(o),a.pingedLanes|=a.suspendedLanes&d,a.warmLanes&=~d,rn===a&&(Lt&d)===d&&(An===4||An===3&&(Lt&62914560)===Lt&&300>je()-Tc?(Gt&2)===0&&is(a,0):jh|=d,rs===Lt&&(rs=0)),ya(a)}function L0(a,o){o===0&&(o=Oe()),a=el(a,o),a!==null&&(dt(a,o),ya(a))}function a_(a){var o=a.memoizedState,d=0;o!==null&&(d=o.retryLane),L0(a,d)}function i_(a,o){var d=0;switch(a.tag){case 31:case 13:var g=a.stateNode,b=a.memoizedState;b!==null&&(d=b.retryLane);break;case 19:g=a.stateNode;break;case 22:g=a.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(o),L0(a,d)}function l_(a,o){return ze(a,o)}var Mc=null,ss=null,Zh=!1,Oc=!1,Qh=!1,yi=0;function ya(a){a!==ss&&a.next===null&&(ss===null?Mc=ss=a:ss=ss.next=a),Oc=!0,Zh||(Zh=!0,o_())}function No(a,o){if(!Qh&&Oc){Qh=!0;do for(var d=!1,g=Mc;g!==null;){if(a!==0){var b=g.pendingLanes;if(b===0)var x=0;else{var R=g.suspendedLanes,V=g.pingedLanes;x=(1<<31-oe(42|a)+1)-1,x&=b&~(R&~V),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(d=!0,P0(g,x))}else x=Lt,x=X(g,g===rn?x:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(x&3)===0||re(g,x)||(d=!0,P0(g,x));g=g.next}while(d);Qh=!1}}function s_(){F0()}function F0(){Oc=Zh=!1;var a=0;yi!==0&&y_()&&(a=yi);for(var o=je(),d=null,g=Mc;g!==null;){var b=g.next,x=I0(g,o);x===0?(g.next=null,d===null?Mc=b:d.next=b,b===null&&(ss=d)):(d=g,(a!==0||(x&3)!==0)&&(Oc=!0)),g=b}qn!==0&&qn!==5||No(a),yi!==0&&(yi=0)}function I0(a,o){for(var d=a.suspendedLanes,g=a.pingedLanes,b=a.expirationTimes,x=a.pendingLanes&-62914561;0<x;){var R=31-oe(x),V=1<<R,Z=b[R];Z===-1?((V&d)===0||(V&g)!==0)&&(b[R]=Ce(V,o)):Z<=o&&(a.expiredLanes|=V),x&=~V}if(o=rn,d=Lt,d=X(a,a===o?d:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),g=a.callbackNode,d===0||a===o&&(Xt===2||Xt===9)||a.cancelPendingCommit!==null)return g!==null&&g!==null&&Je(g),a.callbackNode=null,a.callbackPriority=0;if((d&3)===0||re(a,d)){if(o=d&-d,o===a.callbackPriority)return o;switch(g!==null&&Je(g),Rn(d)){case 2:case 8:d=Se;break;case 32:d=Ie;break;case 268435456:d=qe;break;default:d=Ie}return g=z0.bind(null,a),d=ze(d,g),a.callbackPriority=o,a.callbackNode=d,o}return g!==null&&g!==null&&Je(g),a.callbackPriority=2,a.callbackNode=null,2}function z0(a,o){if(qn!==0&&qn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var d=a.callbackNode;if(Rc()&&a.callbackNode!==d)return null;var g=Lt;return g=X(a,a===rn?g:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),g===0?null:(b0(a,g,o),I0(a,je()),a.callbackNode!=null&&a.callbackNode===d?z0.bind(null,a):null)}function P0(a,o){if(Rc())return null;b0(a,o,!0)}function o_(){E_(function(){(Gt&6)!==0?ze(ue,s_):F0()})}function Wh(){if(yi===0){var a=$l;a===0&&(a=Qe,Qe<<=1,(Qe&261888)===0&&(Qe=256)),yi=a}return yi}function U0(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:ti(""+a)}function q0(a,o){var d=o.ownerDocument.createElement("input");return d.name=o.name,d.value=o.value,a.id&&d.setAttribute("form",a.id),o.parentNode.insertBefore(d,o),a=new FormData(a),d.parentNode.removeChild(d),a}function u_(a,o,d,g,b){if(o==="submit"&&d&&d.stateNode===b){var x=U0((b[mn]||null).action),R=g.submitter;R&&(o=(o=R[mn]||null)?U0(o.formAction):R.getAttribute("formAction"),o!==null&&(x=o,R=null));var V=new Vu("action","action",null,g,b);a.push({event:V,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(yi!==0){var Z=R?q0(b,R):new FormData(b);yh(d,{pending:!0,data:Z,method:b.method,action:x},null,Z)}}else typeof x=="function"&&(V.preventDefault(),Z=R?q0(b,R):new FormData(b),yh(d,{pending:!0,data:Z,method:b.method,action:x},x,Z))},currentTarget:b}]})}}for(var Jh=0;Jh<Ld.length;Jh++){var ev=Ld[Jh],c_=ev.toLowerCase(),f_=ev[0].toUpperCase()+ev.slice(1);oa(c_,"on"+f_)}oa(yy,"onAnimationEnd"),oa(by,"onAnimationIteration"),oa(Ey,"onAnimationStart"),oa("dblclick","onDoubleClick"),oa("focusin","onFocus"),oa("focusout","onBlur"),oa(AA,"onTransitionRun"),oa(_A,"onTransitionStart"),oa(NA,"onTransitionCancel"),oa(xy,"onTransitionEnd"),ke("onMouseEnter",["mouseout","mouseover"]),ke("onMouseLeave",["mouseout","mouseover"]),ke("onPointerEnter",["pointerout","pointerover"]),ke("onPointerLeave",["pointerout","pointerover"]),Qn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ko="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(" "),d_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ko));function j0(a,o){o=(o&4)!==0;for(var d=0;d<a.length;d++){var g=a[d],b=g.event;g=g.listeners;e:{var x=void 0;if(o)for(var R=g.length-1;0<=R;R--){var V=g[R],Z=V.instance,he=V.currentTarget;if(V=V.listener,Z!==x&&b.isPropagationStopped())break e;x=V,b.currentTarget=he;try{x(b)}catch(we){Yu(we)}b.currentTarget=null,x=Z}else for(R=0;R<g.length;R++){if(V=g[R],Z=V.instance,he=V.currentTarget,V=V.listener,Z!==x&&b.isPropagationStopped())break e;x=V,b.currentTarget=he;try{x(b)}catch(we){Yu(we)}b.currentTarget=null,x=Z}}}}function Mt(a,o){var d=o[Sn];d===void 0&&(d=o[Sn]=new Set);var g=a+"__bubble";d.has(g)||(H0(o,a,2,!1),d.add(g))}function tv(a,o,d){var g=0;o&&(g|=4),H0(d,a,g,o)}var Bc="_reactListening"+Math.random().toString(36).slice(2);function nv(a){if(!a[Bc]){a[Bc]=!0,sa.forEach(function(d){d!=="selectionchange"&&(d_.has(d)||tv(d,!1,a),tv(d,!0,a))});var o=a.nodeType===9?a:a.ownerDocument;o===null||o[Bc]||(o[Bc]=!0,tv("selectionchange",!1,o))}}function H0(a,o,d,g){switch(yE(o)){case 2:var b=U_;break;case 8:b=q_;break;default:b=mv}d=b.bind(null,o,d,a),b=void 0,!wd||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(b=!0),g?b!==void 0?a.addEventListener(o,d,{capture:!0,passive:b}):a.addEventListener(o,d,!0):b!==void 0?a.addEventListener(o,d,{passive:b}):a.addEventListener(o,d,!1)}function rv(a,o,d,g,b){var x=g;if((o&1)===0&&(o&2)===0&&g!==null)e:for(;;){if(g===null)return;var R=g.tag;if(R===3||R===4){var V=g.stateNode.containerInfo;if(V===b)break;if(R===4)for(R=g.return;R!==null;){var Z=R.tag;if((Z===3||Z===4)&&R.stateNode.containerInfo===b)return;R=R.return}for(;V!==null;){if(R=Un(V),R===null)return;if(Z=R.tag,Z===5||Z===6||Z===26||Z===27){g=x=R;continue e}V=V.parentNode}}g=g.return}qu(function(){var he=x,we=Ct(d),Ae=[];e:{var ve=wy.get(a);if(ve!==void 0){var ye=Vu,nt=a;switch(a){case"keypress":if(Hu(d)===0)break e;case"keydown":case"keyup":ye=iA;break;case"focusin":nt="focus",ye=Dd;break;case"focusout":nt="blur",ye=Dd;break;case"beforeblur":case"afterblur":ye=Dd;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=Qm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=KD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=oA;break;case yy:case by:case Ey:ye=ZD;break;case xy:ye=cA;break;case"scroll":case"scrollend":ye=VD;break;case"wheel":ye=dA;break;case"copy":case"cut":case"paste":ye=WD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=Jm;break;case"toggle":case"beforetoggle":ye=vA}var pt=(o&4)!==0,Jt=!pt&&(a==="scroll"||a==="scrollend"),ie=pt?ve!==null?ve+"Capture":null:ve;pt=[];for(var J=he,ce;J!==null;){var Te=J;if(ce=Te.stateNode,Te=Te.tag,Te!==5&&Te!==26&&Te!==27||ce===null||ie===null||(Te=Qs(J,ie),Te!=null&&pt.push(Ro(J,Te,ce))),Jt)break;J=J.return}0<pt.length&&(ve=new ye(ve,nt,null,d,we),Ae.push({event:ve,listeners:pt}))}}if((o&7)===0){e:{if(ve=a==="mouseover"||a==="pointerover",ye=a==="mouseout"||a==="pointerout",ve&&d!==lt&&(nt=d.relatedTarget||d.fromElement)&&(Un(nt)||nt[$n]))break e;if((ye||ve)&&(ve=we.window===we?we:(ve=we.ownerDocument)?ve.defaultView||ve.parentWindow:window,ye?(nt=d.relatedTarget||d.toElement,ye=he,nt=nt?Un(nt):null,nt!==null&&(Jt=l(nt),pt=nt.tag,nt!==Jt||pt!==5&&pt!==27&&pt!==6)&&(nt=null)):(ye=null,nt=he),ye!==nt)){if(pt=Qm,Te="onMouseLeave",ie="onMouseEnter",J="mouse",(a==="pointerout"||a==="pointerover")&&(pt=Jm,Te="onPointerLeave",ie="onPointerEnter",J="pointer"),Jt=ye==null?ve:$r(ye),ce=nt==null?ve:$r(nt),ve=new pt(Te,J+"leave",ye,d,we),ve.target=Jt,ve.relatedTarget=ce,Te=null,Un(we)===he&&(pt=new pt(ie,J+"enter",nt,d,we),pt.target=ce,pt.relatedTarget=Jt,Te=pt),Jt=Te,ye&&nt)t:{for(pt=h_,ie=ye,J=nt,ce=0,Te=ie;Te;Te=pt(Te))ce++;Te=0;for(var ft=J;ft;ft=pt(ft))Te++;for(;0<ce-Te;)ie=pt(ie),ce--;for(;0<Te-ce;)J=pt(J),Te--;for(;ce--;){if(ie===J||J!==null&&ie===J.alternate){pt=ie;break t}ie=pt(ie),J=pt(J)}pt=null}else pt=null;ye!==null&&G0(Ae,ve,ye,pt,!1),nt!==null&&Jt!==null&&G0(Ae,Jt,nt,pt,!0)}}e:{if(ve=he?$r(he):window,ye=ve.nodeName&&ve.nodeName.toLowerCase(),ye==="select"||ye==="input"&&ve.type==="file")var qt=sy;else if(iy(ve))if(oy)qt=CA;else{qt=wA;var st=xA}else ye=ve.nodeName,!ye||ye.toLowerCase()!=="input"||ve.type!=="checkbox"&&ve.type!=="radio"?he&&ei(he.elementType)&&(qt=sy):qt=SA;if(qt&&(qt=qt(a,he))){ly(Ae,qt,d,we);break e}st&&st(a,ve,he),a==="focusout"&&he&&ve.type==="number"&&he.memoizedProps.value!=null&&Ll(ve,"number",ve.value)}switch(st=he?$r(he):window,a){case"focusin":(iy(st)||st.contentEditable==="true")&&(zl=st,Md=he,io=null);break;case"focusout":io=Md=zl=null;break;case"mousedown":Od=!0;break;case"contextmenu":case"mouseup":case"dragend":Od=!1,py(Ae,d,we);break;case"selectionchange":if(DA)break;case"keydown":case"keyup":py(Ae,d,we)}var _t;if(_d)e:{switch(a){case"compositionstart":var Ft="onCompositionStart";break e;case"compositionend":Ft="onCompositionEnd";break e;case"compositionupdate":Ft="onCompositionUpdate";break e}Ft=void 0}else Il?ry(a,d)&&(Ft="onCompositionEnd"):a==="keydown"&&d.keyCode===229&&(Ft="onCompositionStart");Ft&&(ey&&d.locale!=="ko"&&(Il||Ft!=="onCompositionStart"?Ft==="onCompositionEnd"&&Il&&(_t=Xm()):(ni=we,Sd="value"in ni?ni.value:ni.textContent,Il=!0)),st=Lc(he,Ft),0<st.length&&(Ft=new Wm(Ft,a,null,d,we),Ae.push({event:Ft,listeners:st}),_t?Ft.data=_t:(_t=ay(d),_t!==null&&(Ft.data=_t)))),(_t=pA?mA(a,d):yA(a,d))&&(Ft=Lc(he,"onBeforeInput"),0<Ft.length&&(st=new Wm("onBeforeInput","beforeinput",null,d,we),Ae.push({event:st,listeners:Ft}),st.data=_t)),u_(Ae,a,he,d,we)}j0(Ae,o)})}function Ro(a,o,d){return{instance:a,listener:o,currentTarget:d}}function Lc(a,o){for(var d=o+"Capture",g=[];a!==null;){var b=a,x=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||x===null||(b=Qs(a,d),b!=null&&g.unshift(Ro(a,b,x)),b=Qs(a,o),b!=null&&g.push(Ro(a,b,x))),a.tag===3)return g;a=a.return}return[]}function h_(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function G0(a,o,d,g,b){for(var x=o._reactName,R=[];d!==null&&d!==g;){var V=d,Z=V.alternate,he=V.stateNode;if(V=V.tag,Z!==null&&Z===g)break;V!==5&&V!==26&&V!==27||he===null||(Z=he,b?(he=Qs(d,x),he!=null&&R.unshift(Ro(d,he,Z))):b||(he=Qs(d,x),he!=null&&R.push(Ro(d,he,Z)))),d=d.return}R.length!==0&&a.push({event:o,listeners:R})}var v_=/\r\n?/g,g_=/\u0000|\uFFFD/g;function V0(a){return(typeof a=="string"?a:""+a).replace(v_,`
|
|
9
|
-
`).replace(g_,"")}function $0(a,o){return o=V0(o),V0(a)===o}function Wt(a,o,d,g,b,x){switch(d){case"children":typeof g=="string"?o==="body"||o==="textarea"&&g===""||mt(a,g):(typeof g=="number"||typeof g=="bigint")&&o!=="body"&&mt(a,""+g);break;case"className":bt(a,"class",g);break;case"tabIndex":bt(a,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":bt(a,d,g);break;case"style":Yt(a,g,x);break;case"data":if(o!=="object"){bt(a,"data",g);break}case"src":case"href":if(g===""&&(o!=="a"||d!=="href")){a.removeAttribute(d);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){a.removeAttribute(d);break}g=ti(""+g),a.setAttribute(d,g);break;case"action":case"formAction":if(typeof g=="function"){a.setAttribute(d,"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 x=="function"&&(d==="formAction"?(o!=="input"&&Wt(a,o,"name",b.name,b,null),Wt(a,o,"formEncType",b.formEncType,b,null),Wt(a,o,"formMethod",b.formMethod,b,null),Wt(a,o,"formTarget",b.formTarget,b,null)):(Wt(a,o,"encType",b.encType,b,null),Wt(a,o,"method",b.method,b,null),Wt(a,o,"target",b.target,b,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){a.removeAttribute(d);break}g=ti(""+g),a.setAttribute(d,g);break;case"onClick":g!=null&&(a.onclick=Ue);break;case"onScroll":g!=null&&Mt("scroll",a);break;case"onScrollEnd":g!=null&&Mt("scrollend",a);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(d=g.__html,d!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"multiple":a.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":a.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){a.removeAttribute("xlink:href");break}d=ti(""+g),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(d,""+g):a.removeAttribute(d);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":g&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(d,""):a.removeAttribute(d);break;case"capture":case"download":g===!0?a.setAttribute(d,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(d,g):a.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?a.setAttribute(d,g):a.removeAttribute(d);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?a.removeAttribute(d):a.setAttribute(d,g);break;case"popover":Mt("beforetoggle",a),Mt("toggle",a),Me(a,"popover",g);break;case"xlinkActuate":Tn(a,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Tn(a,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Tn(a,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Tn(a,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Tn(a,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Tn(a,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Tn(a,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Tn(a,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Tn(a,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Me(a,"is",g);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=Na.get(d)||d,Me(a,d,g))}}function av(a,o,d,g,b,x){switch(d){case"style":Yt(a,g,x);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(d=g.__html,d!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"children":typeof g=="string"?mt(a,g):(typeof g=="number"||typeof g=="bigint")&&mt(a,""+g);break;case"onScroll":g!=null&&Mt("scroll",a);break;case"onScrollEnd":g!=null&&Mt("scrollend",a);break;case"onClick":g!=null&&(a.onclick=Ue);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!wr.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(b=d.endsWith("Capture"),o=d.slice(2,b?d.length-7:void 0),x=a[mn]||null,x=x!=null?x[d]:null,typeof x=="function"&&a.removeEventListener(o,x,b),typeof g=="function")){typeof x!="function"&&x!==null&&(d in a?a[d]=null:a.hasAttribute(d)&&a.removeAttribute(d)),a.addEventListener(o,g,b);break e}d in a?a[d]=g:g===!0?a.setAttribute(d,""):Me(a,d,g)}}}function nr(a,o,d){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Mt("error",a),Mt("load",a);var g=!1,b=!1,x;for(x in d)if(d.hasOwnProperty(x)){var R=d[x];if(R!=null)switch(x){case"src":g=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Wt(a,o,x,R,d,null)}}b&&Wt(a,o,"srcSet",d.srcSet,d,null),g&&Wt(a,o,"src",d.src,d,null);return;case"input":Mt("invalid",a);var V=x=R=b=null,Z=null,he=null;for(g in d)if(d.hasOwnProperty(g)){var we=d[g];if(we!=null)switch(g){case"name":b=we;break;case"type":R=we;break;case"checked":Z=we;break;case"defaultChecked":he=we;break;case"value":x=we;break;case"defaultValue":V=we;break;case"children":case"dangerouslySetInnerHTML":if(we!=null)throw Error(r(137,o));break;default:Wt(a,o,g,we,d,null)}}Zi(a,x,V,Z,he,R,b,!1);return;case"select":Mt("invalid",a),g=R=x=null;for(b in d)if(d.hasOwnProperty(b)&&(V=d[b],V!=null))switch(b){case"value":x=V;break;case"defaultValue":R=V;break;case"multiple":g=V;default:Wt(a,o,b,V,d,null)}o=x,d=R,a.multiple=!!g,o!=null?Wn(a,!!g,o,!1):d!=null&&Wn(a,!!g,d,!0);return;case"textarea":Mt("invalid",a),x=b=g=null;for(R in d)if(d.hasOwnProperty(R)&&(V=d[R],V!=null))switch(R){case"value":g=V;break;case"defaultValue":b=V;break;case"children":x=V;break;case"dangerouslySetInnerHTML":if(V!=null)throw Error(r(91));break;default:Wt(a,o,R,V,d,null)}Fl(a,g,b,x);return;case"option":for(Z in d)d.hasOwnProperty(Z)&&(g=d[Z],g!=null)&&(Z==="selected"?a.selected=g&&typeof g!="function"&&typeof g!="symbol":Wt(a,o,Z,g,d,null));return;case"dialog":Mt("beforetoggle",a),Mt("toggle",a),Mt("cancel",a),Mt("close",a);break;case"iframe":case"object":Mt("load",a);break;case"video":case"audio":for(g=0;g<ko.length;g++)Mt(ko[g],a);break;case"image":Mt("error",a),Mt("load",a);break;case"details":Mt("toggle",a);break;case"embed":case"source":case"link":Mt("error",a),Mt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(he in d)if(d.hasOwnProperty(he)&&(g=d[he],g!=null))switch(he){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Wt(a,o,he,g,d,null)}return;default:if(ei(o)){for(we in d)d.hasOwnProperty(we)&&(g=d[we],g!==void 0&&av(a,o,we,g,d,void 0));return}}for(V in d)d.hasOwnProperty(V)&&(g=d[V],g!=null&&Wt(a,o,V,g,d,null))}function p_(a,o,d,g){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,x=null,R=null,V=null,Z=null,he=null,we=null;for(ye in d){var Ae=d[ye];if(d.hasOwnProperty(ye)&&Ae!=null)switch(ye){case"checked":break;case"value":break;case"defaultValue":Z=Ae;default:g.hasOwnProperty(ye)||Wt(a,o,ye,null,g,Ae)}}for(var ve in g){var ye=g[ve];if(Ae=d[ve],g.hasOwnProperty(ve)&&(ye!=null||Ae!=null))switch(ve){case"type":x=ye;break;case"name":b=ye;break;case"checked":he=ye;break;case"defaultChecked":we=ye;break;case"value":R=ye;break;case"defaultValue":V=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(r(137,o));break;default:ye!==Ae&&Wt(a,o,ve,ye,g,Ae)}}Ys(a,R,V,Z,he,we,x,b);return;case"select":ye=R=V=ve=null;for(x in d)if(Z=d[x],d.hasOwnProperty(x)&&Z!=null)switch(x){case"value":break;case"multiple":ye=Z;default:g.hasOwnProperty(x)||Wt(a,o,x,null,g,Z)}for(b in g)if(x=g[b],Z=d[b],g.hasOwnProperty(b)&&(x!=null||Z!=null))switch(b){case"value":ve=x;break;case"defaultValue":V=x;break;case"multiple":R=x;default:x!==Z&&Wt(a,o,b,x,g,Z)}o=V,d=R,g=ye,ve!=null?Wn(a,!!d,ve,!1):!!g!=!!d&&(o!=null?Wn(a,!!d,o,!0):Wn(a,!!d,d?[]:"",!1));return;case"textarea":ye=ve=null;for(V in d)if(b=d[V],d.hasOwnProperty(V)&&b!=null&&!g.hasOwnProperty(V))switch(V){case"value":break;case"children":break;default:Wt(a,o,V,null,g,b)}for(R in g)if(b=g[R],x=d[R],g.hasOwnProperty(R)&&(b!=null||x!=null))switch(R){case"value":ve=b;break;case"defaultValue":ye=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==x&&Wt(a,o,R,b,g,x)}Pu(a,ve,ye);return;case"option":for(var nt in d)ve=d[nt],d.hasOwnProperty(nt)&&ve!=null&&!g.hasOwnProperty(nt)&&(nt==="selected"?a.selected=!1:Wt(a,o,nt,null,g,ve));for(Z in g)ve=g[Z],ye=d[Z],g.hasOwnProperty(Z)&&ve!==ye&&(ve!=null||ye!=null)&&(Z==="selected"?a.selected=ve&&typeof ve!="function"&&typeof ve!="symbol":Wt(a,o,Z,ve,g,ye));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 pt in d)ve=d[pt],d.hasOwnProperty(pt)&&ve!=null&&!g.hasOwnProperty(pt)&&Wt(a,o,pt,null,g,ve);for(he in g)if(ve=g[he],ye=d[he],g.hasOwnProperty(he)&&ve!==ye&&(ve!=null||ye!=null))switch(he){case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,o));break;default:Wt(a,o,he,ve,g,ye)}return;default:if(ei(o)){for(var Jt in d)ve=d[Jt],d.hasOwnProperty(Jt)&&ve!==void 0&&!g.hasOwnProperty(Jt)&&av(a,o,Jt,void 0,g,ve);for(we in g)ve=g[we],ye=d[we],!g.hasOwnProperty(we)||ve===ye||ve===void 0&&ye===void 0||av(a,o,we,ve,g,ye);return}}for(var ie in d)ve=d[ie],d.hasOwnProperty(ie)&&ve!=null&&!g.hasOwnProperty(ie)&&Wt(a,o,ie,null,g,ve);for(Ae in g)ve=g[Ae],ye=d[Ae],!g.hasOwnProperty(Ae)||ve===ye||ve==null&&ye==null||Wt(a,o,Ae,ve,g,ye)}function K0(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function m_(){if(typeof performance.getEntriesByType=="function"){for(var a=0,o=0,d=performance.getEntriesByType("resource"),g=0;g<d.length;g++){var b=d[g],x=b.transferSize,R=b.initiatorType,V=b.duration;if(x&&V&&K0(R)){for(R=0,V=b.responseEnd,g+=1;g<d.length;g++){var Z=d[g],he=Z.startTime;if(he>V)break;var we=Z.transferSize,Ae=Z.initiatorType;we&&K0(Ae)&&(Z=Z.responseEnd,R+=we*(Z<V?1:(V-he)/(Z-he)))}if(--g,o+=8*(x+R)/(b.duration/1e3),a++,10<a)break}}if(0<a)return o/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var iv=null,lv=null;function Fc(a){return a.nodeType===9?a:a.ownerDocument}function Y0(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function X0(a,o){if(a===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&o==="foreignObject"?0:a}function sv(a,o){return a==="textarea"||a==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var ov=null;function y_(){var a=window.event;return a&&a.type==="popstate"?a===ov?!1:(ov=a,!0):(ov=null,!1)}var Z0=typeof setTimeout=="function"?setTimeout:void 0,b_=typeof clearTimeout=="function"?clearTimeout:void 0,Q0=typeof Promise=="function"?Promise:void 0,E_=typeof queueMicrotask=="function"?queueMicrotask:typeof Q0<"u"?function(a){return Q0.resolve(null).then(a).catch(x_)}:Z0;function x_(a){setTimeout(function(){throw a})}function bi(a){return a==="head"}function W0(a,o){var d=o,g=0;do{var b=d.nextSibling;if(a.removeChild(d),b&&b.nodeType===8)if(d=b.data,d==="/$"||d==="/&"){if(g===0){a.removeChild(b),fs(o);return}g--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")g++;else if(d==="html")Mo(a.ownerDocument.documentElement);else if(d==="head"){d=a.ownerDocument.head,Mo(d);for(var x=d.firstChild;x;){var R=x.nextSibling,V=x.nodeName;x[Cn]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&x.rel.toLowerCase()==="stylesheet"||d.removeChild(x),x=R}}else d==="body"&&Mo(a.ownerDocument.body);d=b}while(d);fs(o)}function J0(a,o){var d=a;a=0;do{var g=d.nextSibling;if(d.nodeType===1?o?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(o?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),g&&g.nodeType===8)if(d=g.data,d==="/$"){if(a===0)break;a--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||a++;d=g}while(d)}function uv(a){var o=a.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var d=o;switch(o=o.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":uv(d),sr(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}a.removeChild(d)}}function w_(a,o,d,g){for(;a.nodeType===1;){var b=d;if(a.nodeName.toLowerCase()!==o.toLowerCase()){if(!g&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(g){if(!a[Cn])switch(o){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(x=a.getAttribute("rel"),x==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(x!==b.rel||a.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||a.getAttribute("title")!==(b.title==null?null:b.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(x=a.getAttribute("src"),(x!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&x&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(o==="input"&&a.type==="hidden"){var x=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===x)return a}else return a;if(a=ta(a.nextSibling),a===null)break}return null}function S_(a,o,d){if(o==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!d||(a=ta(a.nextSibling),a===null))return null;return a}function eE(a,o){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!o||(a=ta(a.nextSibling),a===null))return null;return a}function cv(a){return a.data==="$?"||a.data==="$~"}function fv(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function C_(a,o){var d=a.ownerDocument;if(a.data==="$~")a._reactRetry=o;else if(a.data!=="$?"||d.readyState!=="loading")o();else{var g=function(){o(),d.removeEventListener("DOMContentLoaded",g)};d.addEventListener("DOMContentLoaded",g),a._reactRetry=g}}function ta(a){for(;a!=null;a=a.nextSibling){var o=a.nodeType;if(o===1||o===3)break;if(o===8){if(o=a.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return a}var dv=null;function tE(a){a=a.nextSibling;for(var o=0;a;){if(a.nodeType===8){var d=a.data;if(d==="/$"||d==="/&"){if(o===0)return ta(a.nextSibling);o--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||o++}a=a.nextSibling}return null}function nE(a){a=a.previousSibling;for(var o=0;a;){if(a.nodeType===8){var d=a.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(o===0)return a;o--}else d!=="/$"&&d!=="/&"||o++}a=a.previousSibling}return null}function rE(a,o,d){switch(o=Fc(d),a){case"html":if(a=o.documentElement,!a)throw Error(r(452));return a;case"head":if(a=o.head,!a)throw Error(r(453));return a;case"body":if(a=o.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Mo(a){for(var o=a.attributes;o.length;)a.removeAttributeNode(o[0]);sr(a)}var na=new Map,aE=new Set;function Ic(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Va=H.d;H.d={f:T_,r:D_,D:A_,C:__,L:N_,m:k_,X:M_,S:R_,M:O_};function T_(){var a=Va.f(),o=_c();return a||o}function D_(a){var o=or(a);o!==null&&o.tag===5&&o.type==="form"?xb(o):Va.r(a)}var os=typeof document>"u"?null:document;function iE(a,o,d){var g=os;if(g&&typeof o=="string"&&o){var b=Sr(o);b='link[rel="'+a+'"][href="'+b+'"]',typeof d=="string"&&(b+='[crossorigin="'+d+'"]'),aE.has(b)||(aE.add(b),a={rel:a,crossOrigin:d,href:o},g.querySelector(b)===null&&(o=g.createElement("link"),nr(o,"link",a),nn(o),g.head.appendChild(o)))}}function A_(a){Va.D(a),iE("dns-prefetch",a,null)}function __(a,o){Va.C(a,o),iE("preconnect",a,o)}function N_(a,o,d){Va.L(a,o,d);var g=os;if(g&&a&&o){var b='link[rel="preload"][as="'+Sr(o)+'"]';o==="image"&&d&&d.imageSrcSet?(b+='[imagesrcset="'+Sr(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(b+='[imagesizes="'+Sr(d.imageSizes)+'"]')):b+='[href="'+Sr(a)+'"]';var x=b;switch(o){case"style":x=us(a);break;case"script":x=cs(a)}na.has(x)||(a=v({rel:"preload",href:o==="image"&&d&&d.imageSrcSet?void 0:a,as:o},d),na.set(x,a),g.querySelector(b)!==null||o==="style"&&g.querySelector(Oo(x))||o==="script"&&g.querySelector(Bo(x))||(o=g.createElement("link"),nr(o,"link",a),nn(o),g.head.appendChild(o)))}}function k_(a,o){Va.m(a,o);var d=os;if(d&&a){var g=o&&typeof o.as=="string"?o.as:"script",b='link[rel="modulepreload"][as="'+Sr(g)+'"][href="'+Sr(a)+'"]',x=b;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=cs(a)}if(!na.has(x)&&(a=v({rel:"modulepreload",href:a},o),na.set(x,a),d.querySelector(b)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(Bo(x)))return}g=d.createElement("link"),nr(g,"link",a),nn(g),d.head.appendChild(g)}}}function R_(a,o,d){Va.S(a,o,d);var g=os;if(g&&a){var b=Kr(g).hoistableStyles,x=us(a);o=o||"default";var R=b.get(x);if(!R){var V={loading:0,preload:null};if(R=g.querySelector(Oo(x)))V.loading=5;else{a=v({rel:"stylesheet",href:a,"data-precedence":o},d),(d=na.get(x))&&hv(a,d);var Z=R=g.createElement("link");nn(Z),nr(Z,"link",a),Z._p=new Promise(function(he,we){Z.onload=he,Z.onerror=we}),Z.addEventListener("load",function(){V.loading|=1}),Z.addEventListener("error",function(){V.loading|=2}),V.loading|=4,zc(R,o,g)}R={type:"stylesheet",instance:R,count:1,state:V},b.set(x,R)}}}function M_(a,o){Va.X(a,o);var d=os;if(d&&a){var g=Kr(d).hoistableScripts,b=cs(a),x=g.get(b);x||(x=d.querySelector(Bo(b)),x||(a=v({src:a,async:!0},o),(o=na.get(b))&&vv(a,o),x=d.createElement("script"),nn(x),nr(x,"link",a),d.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},g.set(b,x))}}function O_(a,o){Va.M(a,o);var d=os;if(d&&a){var g=Kr(d).hoistableScripts,b=cs(a),x=g.get(b);x||(x=d.querySelector(Bo(b)),x||(a=v({src:a,async:!0,type:"module"},o),(o=na.get(b))&&vv(a,o),x=d.createElement("script"),nn(x),nr(x,"link",a),d.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},g.set(b,x))}}function lE(a,o,d,g){var b=(b=se.current)?Ic(b):null;if(!b)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(o=us(d.href),d=Kr(b).hoistableStyles,g=d.get(o),g||(g={type:"style",instance:null,count:0,state:null},d.set(o,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){a=us(d.href);var x=Kr(b).hoistableStyles,R=x.get(a);if(R||(b=b.ownerDocument||b,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(a,R),(x=b.querySelector(Oo(a)))&&!x._p&&(R.instance=x,R.state.loading=5),na.has(a)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},na.set(a,d),x||B_(b,a,d,R.state))),o&&g===null)throw Error(r(528,""));return R}if(o&&g!==null)throw Error(r(529,""));return null;case"script":return o=d.async,d=d.src,typeof d=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=cs(d),d=Kr(b).hoistableScripts,g=d.get(o),g||(g={type:"script",instance:null,count:0,state:null},d.set(o,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function us(a){return'href="'+Sr(a)+'"'}function Oo(a){return'link[rel="stylesheet"]['+a+"]"}function sE(a){return v({},a,{"data-precedence":a.precedence,precedence:null})}function B_(a,o,d,g){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?g.loading=1:(o=a.createElement("link"),g.preload=o,o.addEventListener("load",function(){return g.loading|=1}),o.addEventListener("error",function(){return g.loading|=2}),nr(o,"link",d),nn(o),a.head.appendChild(o))}function cs(a){return'[src="'+Sr(a)+'"]'}function Bo(a){return"script[async]"+a}function oE(a,o,d){if(o.count++,o.instance===null)switch(o.type){case"style":var g=a.querySelector('style[data-href~="'+Sr(d.href)+'"]');if(g)return o.instance=g,nn(g),g;var b=v({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return g=(a.ownerDocument||a).createElement("style"),nn(g),nr(g,"style",b),zc(g,d.precedence,a),o.instance=g;case"stylesheet":b=us(d.href);var x=a.querySelector(Oo(b));if(x)return o.state.loading|=4,o.instance=x,nn(x),x;g=sE(d),(b=na.get(b))&&hv(g,b),x=(a.ownerDocument||a).createElement("link"),nn(x);var R=x;return R._p=new Promise(function(V,Z){R.onload=V,R.onerror=Z}),nr(x,"link",g),o.state.loading|=4,zc(x,d.precedence,a),o.instance=x;case"script":return x=cs(d.src),(b=a.querySelector(Bo(x)))?(o.instance=b,nn(b),b):(g=d,(b=na.get(x))&&(g=v({},d),vv(g,b)),a=a.ownerDocument||a,b=a.createElement("script"),nn(b),nr(b,"link",g),a.head.appendChild(b),o.instance=b);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(g=o.instance,o.state.loading|=4,zc(g,d.precedence,a));return o.instance}function zc(a,o,d){for(var g=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=g.length?g[g.length-1]:null,x=b,R=0;R<g.length;R++){var V=g[R];if(V.dataset.precedence===o)x=V;else if(x!==b)break}x?x.parentNode.insertBefore(a,x.nextSibling):(o=d.nodeType===9?d.head:d,o.insertBefore(a,o.firstChild))}function hv(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.title==null&&(a.title=o.title)}function vv(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.integrity==null&&(a.integrity=o.integrity)}var Pc=null;function uE(a,o,d){if(Pc===null){var g=new Map,b=Pc=new Map;b.set(d,g)}else b=Pc,g=b.get(d),g||(g=new Map,b.set(d,g));if(g.has(a))return g;for(g.set(a,null),d=d.getElementsByTagName(a),b=0;b<d.length;b++){var x=d[b];if(!(x[Cn]||x[Tt]||a==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var R=x.getAttribute(o)||"";R=a+R;var V=g.get(R);V?V.push(x):g.set(R,[x])}}return g}function cE(a,o,d){a=a.ownerDocument||a,a.head.insertBefore(d,o==="title"?a.querySelector("head > title"):null)}function L_(a,o,d){if(d===1||o.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(a=o.disabled,typeof o.precedence=="string"&&a==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function fE(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function F_(a,o,d,g){if(d.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var b=us(g.href),x=o.querySelector(Oo(b));if(x){o=x._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=Uc.bind(a),o.then(a,a)),d.state.loading|=4,d.instance=x,nn(x);return}x=o.ownerDocument||o,g=sE(g),(b=na.get(b))&&hv(g,b),x=x.createElement("link"),nn(x);var R=x;R._p=new Promise(function(V,Z){R.onload=V,R.onerror=Z}),nr(x,"link",g),d.instance=x}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(d,o),(o=d.state.preload)&&(d.state.loading&3)===0&&(a.count++,d=Uc.bind(a),o.addEventListener("load",d),o.addEventListener("error",d))}}var gv=0;function I_(a,o){return a.stylesheets&&a.count===0&&jc(a,a.stylesheets),0<a.count||0<a.imgCount?function(d){var g=setTimeout(function(){if(a.stylesheets&&jc(a,a.stylesheets),a.unsuspend){var x=a.unsuspend;a.unsuspend=null,x()}},6e4+o);0<a.imgBytes&&gv===0&&(gv=62500*m_());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&jc(a,a.stylesheets),a.unsuspend)){var x=a.unsuspend;a.unsuspend=null,x()}},(a.imgBytes>gv?50:800)+o);return a.unsuspend=d,function(){a.unsuspend=null,clearTimeout(g),clearTimeout(b)}}:null}function Uc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jc(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var qc=null;function jc(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,qc=new Map,o.forEach(z_,a),qc=null,Uc.call(a))}function z_(a,o){if(!(o.state.loading&4)){var d=qc.get(a);if(d)var g=d.get(null);else{d=new Map,qc.set(a,d);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<b.length;x++){var R=b[x];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(d.set(R.dataset.precedence,R),g=R)}g&&d.set(null,g)}b=o.instance,R=b.getAttribute("data-precedence"),x=d.get(R)||g,x===g&&d.set(null,b),d.set(R,b),this.count++,g=Uc.bind(this),b.addEventListener("load",g),b.addEventListener("error",g),x?x.parentNode.insertBefore(b,x.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),o.state.loading|=4}}var Lo={$$typeof:T,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function P_(a,o,d,g,b,x,R,V,Z){this.tag=1,this.containerInfo=a,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=yt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yt(0),this.hiddenUpdates=yt(null),this.identifierPrefix=g,this.onUncaughtError=b,this.onCaughtError=x,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function dE(a,o,d,g,b,x,R,V,Z,he,we,Ae){return a=new P_(a,o,d,R,Z,he,we,Ae,V),o=1,x===!0&&(o|=24),x=Fr(3,null,null,o),a.current=x,x.stateNode=a,o=Yd(),o.refCount++,a.pooledCache=o,o.refCount++,x.memoizedState={element:g,isDehydrated:d,cache:o},Wd(x),a}function hE(a){return a?(a=ql,a):ql}function vE(a,o,d,g,b,x){b=hE(b),g.context===null?g.context=b:g.pendingContext=b,g=oi(o),g.payload={element:d},x=x===void 0?null:x,x!==null&&(g.callback=x),d=ui(a,g,o),d!==null&&(Nr(d,a,o),ho(d,a,o))}function gE(a,o){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var d=a.retryLane;a.retryLane=d!==0&&d<o?d:o}}function pv(a,o){gE(a,o),(a=a.alternate)&&gE(a,o)}function pE(a){if(a.tag===13||a.tag===31){var o=el(a,67108864);o!==null&&Nr(o,a,67108864),pv(a,67108864)}}function mE(a){if(a.tag===13||a.tag===31){var o=qr();o=xt(o);var d=el(a,o);d!==null&&Nr(d,a,o),pv(a,o)}}var Hc=!0;function U_(a,o,d,g){var b=B.T;B.T=null;var x=H.p;try{H.p=2,mv(a,o,d,g)}finally{H.p=x,B.T=b}}function q_(a,o,d,g){var b=B.T;B.T=null;var x=H.p;try{H.p=8,mv(a,o,d,g)}finally{H.p=x,B.T=b}}function mv(a,o,d,g){if(Hc){var b=yv(g);if(b===null)rv(a,o,g,Gc,d),bE(a,g);else if(H_(b,a,o,d,g))g.stopPropagation();else if(bE(a,g),o&4&&-1<j_.indexOf(a)){for(;b!==null;){var x=or(b);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var R=it(x.pendingLanes);if(R!==0){var V=x;for(V.pendingLanes|=2,V.entangledLanes|=2;R;){var Z=1<<31-oe(R);V.entanglements[1]|=Z,R&=~Z}ya(x),(Gt&6)===0&&(Dc=je()+500,No(0))}}break;case 31:case 13:V=el(x,2),V!==null&&Nr(V,x,2),_c(),pv(x,2)}if(x=yv(g),x===null&&rv(a,o,g,Gc,d),x===b)break;b=x}b!==null&&g.stopPropagation()}else rv(a,o,g,null,d)}}function yv(a){return a=Ct(a),bv(a)}var Gc=null;function bv(a){if(Gc=null,a=Un(a),a!==null){var o=l(a);if(o===null)a=null;else{var d=o.tag;if(d===13){if(a=s(o),a!==null)return a;a=null}else if(d===31){if(a=u(o),a!==null)return a;a=null}else if(d===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;a=null}else o!==a&&(a=null)}}return Gc=a,null}function yE(a){switch(a){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(gt()){case ue:return 2;case Se:return 8;case Ie:case Ve:return 32;case qe:return 268435456;default:return 32}default:return 32}}var Ev=!1,Ei=null,xi=null,wi=null,Fo=new Map,Io=new Map,Si=[],j_="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 bE(a,o){switch(a){case"focusin":case"focusout":Ei=null;break;case"dragenter":case"dragleave":xi=null;break;case"mouseover":case"mouseout":wi=null;break;case"pointerover":case"pointerout":Fo.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Io.delete(o.pointerId)}}function zo(a,o,d,g,b,x){return a===null||a.nativeEvent!==x?(a={blockedOn:o,domEventName:d,eventSystemFlags:g,nativeEvent:x,targetContainers:[b]},o!==null&&(o=or(o),o!==null&&pE(o)),a):(a.eventSystemFlags|=g,o=a.targetContainers,b!==null&&o.indexOf(b)===-1&&o.push(b),a)}function H_(a,o,d,g,b){switch(o){case"focusin":return Ei=zo(Ei,a,o,d,g,b),!0;case"dragenter":return xi=zo(xi,a,o,d,g,b),!0;case"mouseover":return wi=zo(wi,a,o,d,g,b),!0;case"pointerover":var x=b.pointerId;return Fo.set(x,zo(Fo.get(x)||null,a,o,d,g,b)),!0;case"gotpointercapture":return x=b.pointerId,Io.set(x,zo(Io.get(x)||null,a,o,d,g,b)),!0}return!1}function EE(a){var o=Un(a.target);if(o!==null){var d=l(o);if(d!==null){if(o=d.tag,o===13){if(o=s(d),o!==null){a.blockedOn=o,pn(a.priority,function(){mE(d)});return}}else if(o===31){if(o=u(d),o!==null){a.blockedOn=o,pn(a.priority,function(){mE(d)});return}}else if(o===3&&d.stateNode.current.memoizedState.isDehydrated){a.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Vc(a){if(a.blockedOn!==null)return!1;for(var o=a.targetContainers;0<o.length;){var d=yv(a.nativeEvent);if(d===null){d=a.nativeEvent;var g=new d.constructor(d.type,d);lt=g,d.target.dispatchEvent(g),lt=null}else return o=or(d),o!==null&&pE(o),a.blockedOn=d,!1;o.shift()}return!0}function xE(a,o,d){Vc(a)&&d.delete(o)}function G_(){Ev=!1,Ei!==null&&Vc(Ei)&&(Ei=null),xi!==null&&Vc(xi)&&(xi=null),wi!==null&&Vc(wi)&&(wi=null),Fo.forEach(xE),Io.forEach(xE)}function $c(a,o){a.blockedOn===o&&(a.blockedOn=null,Ev||(Ev=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,G_)))}var Kc=null;function wE(a){Kc!==a&&(Kc=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Kc===a&&(Kc=null);for(var o=0;o<a.length;o+=3){var d=a[o],g=a[o+1],b=a[o+2];if(typeof g!="function"){if(bv(g||d)===null)continue;break}var x=or(d);x!==null&&(a.splice(o,3),o-=3,yh(x,{pending:!0,data:b,method:d.method,action:g},g,b))}}))}function fs(a){function o(Z){return $c(Z,a)}Ei!==null&&$c(Ei,a),xi!==null&&$c(xi,a),wi!==null&&$c(wi,a),Fo.forEach(o),Io.forEach(o);for(var d=0;d<Si.length;d++){var g=Si[d];g.blockedOn===a&&(g.blockedOn=null)}for(;0<Si.length&&(d=Si[0],d.blockedOn===null);)EE(d),d.blockedOn===null&&Si.shift();if(d=(a.ownerDocument||a).$$reactFormReplay,d!=null)for(g=0;g<d.length;g+=3){var b=d[g],x=d[g+1],R=b[mn]||null;if(typeof x=="function")R||wE(d);else if(R){var V=null;if(x&&x.hasAttribute("formAction")){if(b=x,R=x[mn]||null)V=R.formAction;else if(bv(b)!==null)continue}else V=R.action;typeof V=="function"?d[g+1]=V:(d.splice(g,3),g-=3),wE(d)}}}function SE(){function a(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(R){return b=R})},focusReset:"manual",scroll:"manual"})}function o(){b!==null&&(b(),b=null),g||setTimeout(d,20)}function d(){if(!g&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(d,100),function(){g=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),b!==null&&(b(),b=null)}}}function xv(a){this._internalRoot=a}Yc.prototype.render=xv.prototype.render=function(a){var o=this._internalRoot;if(o===null)throw Error(r(409));var d=o.current,g=qr();vE(d,g,a,o,null,null)},Yc.prototype.unmount=xv.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var o=a.containerInfo;vE(a.current,2,null,a,null,null),_c(),o[$n]=null}};function Yc(a){this._internalRoot=a}Yc.prototype.unstable_scheduleHydration=function(a){if(a){var o=Kt();a={blockedOn:null,target:a,priority:o};for(var d=0;d<Si.length&&o!==0&&o<Si[d].priority;d++);Si.splice(d,0,a),d===0&&EE(a)}};var CE=e.version;if(CE!=="19.2.4")throw Error(r(527,CE,"19.2.4"));H.findDOMNode=function(a){var o=a._reactInternals;if(o===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=c(o),a=a!==null?h(a):null,a=a===null?null:a.stateNode,a};var V_={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xc.isDisabled&&Xc.supportsFiber)try{G=Xc.inject(V_),ne=Xc}catch{}}return Uo.createRoot=function(a,o){if(!i(a))throw Error(r(299));var d=!1,g="",b=Rb,x=Mb,R=Ob;return o!=null&&(o.unstable_strictMode===!0&&(d=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onUncaughtError!==void 0&&(b=o.onUncaughtError),o.onCaughtError!==void 0&&(x=o.onCaughtError),o.onRecoverableError!==void 0&&(R=o.onRecoverableError)),o=dE(a,1,!1,null,null,d,g,null,b,x,R,SE),a[$n]=o.current,nv(a),new xv(o)},Uo.hydrateRoot=function(a,o,d){if(!i(a))throw Error(r(299));var g=!1,b="",x=Rb,R=Mb,V=Ob,Z=null;return d!=null&&(d.unstable_strictMode===!0&&(g=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onUncaughtError!==void 0&&(x=d.onUncaughtError),d.onCaughtError!==void 0&&(R=d.onCaughtError),d.onRecoverableError!==void 0&&(V=d.onRecoverableError),d.formState!==void 0&&(Z=d.formState)),o=dE(a,1,!0,o,d??null,g,b,Z,x,R,V,SE),o.context=hE(null),d=o.current,g=qr(),g=xt(g),b=oi(g),b.callback=null,ui(d,b,g),d=g,o.current.lanes=d,dt(o,d),ya(o),a[$n]=o.current,nv(a),new Yc(o)},Uo.version="19.2.4",Uo}var BE;function nN(){if(BE)return Cv.exports;BE=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Cv.exports=tN(),Cv.exports}var rN=nN();const aN=xu(rN);function iN(t){const e=new Date(t);return Number.isNaN(e.getTime())?t:e.toLocaleTimeString()}function lN({events:t,connected:e,error:n}){return D.jsxs("section",{className:"panel","aria-label":"Activity feed",children:[D.jsxs("h3",{className:"panel-heading",children:["Activity",D.jsx("span",{className:`activity-status-pill ${e?"is-live":"is-offline"}`,children:e?"live":"offline"})]}),n?D.jsx("p",{className:"text-error",children:n}):null,t.length===0?D.jsx("p",{className:"text-muted text-sm",children:e?"Waiting for ingest, compile, lint, or watch events.":"No activity stream available. Run `swarmvault watch` to see live events."}):D.jsx("div",{className:"activity-feed",role:"log","aria-live":"polite",children:t.map(r=>D.jsxs("article",{className:`activity-item activity-${r.level}`,children:[D.jsx("span",{className:"activity-time",children:iN(r.timestamp)}),D.jsxs("div",{children:[D.jsx("p",{className:"activity-message",children:r.message}),D.jsxs("p",{className:"activity-meta",children:[r.type,r.meta?.duration_ms?` Β· ${r.meta.duration_ms}ms`:null]})]})]},r.id))})]})}function LE(t){if(t===void 0)return"β";if(t===null)return"null";if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function sN({changes:t}){return t.length?D.jsxs("table",{className:"diff-frontmatter",children:[D.jsx("thead",{children:D.jsxs("tr",{children:[D.jsx("th",{children:"Field"}),D.jsx("th",{children:"Before"}),D.jsx("th",{children:"After"})]})}),D.jsx("tbody",{children:t.map(e=>D.jsxs("tr",{className:e.protected?"is-protected":void 0,children:[D.jsxs("td",{className:"text-mono",children:[e.key,e.protected?D.jsx("span",{className:"label label-danger",children:" protected"}):null]}),D.jsx("td",{className:"text-mono text-sm",children:LE(e.before)}),D.jsx("td",{className:"text-mono text-sm",children:LE(e.after)})]},e.key))})]}):null}function oN({diff:t,warnings:e}){const[n,r]=ge.useState("unified"),i=t.frontmatterChanges.filter(u=>u.protected),l=ge.useRef(null),s=ge.useRef(null);return ge.useEffect(()=>{if(n!=="split")return;const u=l.current,f=s.current;if(!u||!f)return;let c=!1;const h=(m,y)=>{c||(c=!0,y.scrollTop=m.scrollTop,y.scrollLeft=m.scrollLeft,requestAnimationFrame(()=>{c=!1}))},v=()=>h(u,f),p=()=>h(f,u);return u.addEventListener("scroll",v),f.addEventListener("scroll",p),()=>{u.removeEventListener("scroll",v),f.removeEventListener("scroll",p)}},[n]),D.jsxs("div",{className:"diff-view",children:[e?.length?D.jsx("p",{className:"text-error text-sm",children:e.includes("protected_frontmatter_changed")?"Warning: protected frontmatter fields changed. Verify before accepting.":e.join(", ")}):null,D.jsx(sN,{changes:t.frontmatterChanges}),(i.length===0&&t.frontmatterChanges.length===0,null),D.jsxs("div",{className:"diff-toolbar",children:[D.jsxs("span",{className:"text-muted text-sm",children:["+",t.addedLines," / -",t.removedLines]}),D.jsxs("div",{className:"action-row",children:[D.jsx("button",{type:"button",className:`btn btn-ghost${n==="unified"?" is-active":""}`,onClick:()=>r("unified"),children:"Unified"}),D.jsx("button",{type:"button",className:`btn btn-ghost${n==="split"?" is-active":""}`,onClick:()=>r("split"),children:"Split"})]})]}),t.hunks.map(u=>D.jsxs("div",{className:"diff-hunk",children:[D.jsxs("div",{className:"diff-hunk-header text-mono text-sm",children:["@@ -",u.oldStart,",",u.oldLines," +",u.newStart,",",u.newLines," @@"]}),n==="unified"?D.jsx("pre",{className:"diff-unified",children:u.lines.map((f,c)=>D.jsxs("div",{className:`diff-line diff-${f.type}`,children:[D.jsx("span",{className:"diff-marker",children:f.type==="add"?"+":f.type==="remove"?"-":" "}),D.jsx("span",{className:"diff-text",children:f.value})]},`u-${c}`))}):D.jsxs("div",{className:"diff-split",children:[D.jsx("pre",{ref:l,className:"diff-column diff-column-before",children:u.lines.filter(f=>f.type!=="add").map((f,c)=>D.jsx("div",{className:`diff-line diff-${f.type}`,children:D.jsx("span",{className:"diff-text",children:f.value})},`b-${c}`))}),D.jsx("pre",{ref:s,className:"diff-column diff-column-after",children:u.lines.filter(f=>f.type!=="remove").map((f,c)=>D.jsx("div",{className:`diff-line diff-${f.type}`,children:D.jsx("span",{className:"diff-text",children:f.value})},`a-${c}`))})]})]},`hunk-${u.oldStart}-${u.newStart}`))]})}function uN(t){return t.replace(/\s+/g," ").trim().slice(0,220)}function cN({approvals:t,selectedApprovalId:e,onSelectApproval:n,approvalDetail:r,approvalError:i,actionError:l,busyAction:s,onReviewAction:u,onBulkReview:f,onOpenPage:c}){const[h,v]=ge.useState("pending"),[p,m]=ge.useState(""),[y,S]=ge.useState(()=>new Set),w=ge.useMemo(()=>{if(!r)return[];const N=p.trim().toLowerCase();return r.entries.filter(_=>!(h!=="all"&&_.status!==h||N&&!`${_.title} ${_.kind} ${_.changeType} ${_.nextPath??_.previousPath??""}`.toLowerCase().includes(N)))},[r,h,p]),E=w.filter(N=>N.status==="pending").map(N=>N.pageId),C=E.length>0&&E.every(N=>y.has(N)),T=N=>{S(_=>{const O=new Set(_);return O.has(N)?O.delete(N):O.add(N),O})},A=()=>{S(C?new Set:new Set(E))},k=N=>{!y.size||!f||(f([...y],N),S(new Set))};return D.jsxs("div",{children:[i?D.jsx("p",{className:"text-error",children:i}):null,l?D.jsx("p",{className:"text-error",children:l}):null,t.length?D.jsx("div",{className:"card-list",children:t.map(N=>D.jsxs("button",{type:"button",className:`result-card${e===N.approvalId?" is-active":""}`,onClick:()=>n(N.approvalId),children:[D.jsxs("span",{className:"label",children:["pending ",N.pendingCount]}),D.jsx("strong",{className:"card-title",children:N.approvalId}),D.jsxs("p",{className:"text-muted text-sm",children:["accepted ",N.acceptedCount," / rejected ",N.rejectedCount]})]},N.approvalId))}):D.jsx("p",{className:"text-muted text-sm",children:"No staged approval bundles."}),r?.entries.length?D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:"list-filter-bar",style:{marginTop:8},children:[D.jsx("input",{type:"search",className:"input",placeholder:"Filter entriesβ¦",value:p,onChange:N=>m(N.target.value),"aria-label":"Filter approval entries"}),D.jsxs("select",{className:"input",value:h,onChange:N=>v(N.target.value),"aria-label":"Filter by status",style:{width:"auto"},children:[D.jsx("option",{value:"all",children:"All"}),D.jsx("option",{value:"pending",children:"Pending"}),D.jsx("option",{value:"accepted",children:"Accepted"}),D.jsx("option",{value:"rejected",children:"Rejected"})]})]}),y.size>0&&f?D.jsxs("div",{className:"bulk-toolbar",role:"toolbar","aria-label":"Bulk approval actions",children:[D.jsx("span",{className:"bulk-toolbar-count",children:y.size}),D.jsx("span",{className:"text-muted",children:"selected"}),D.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>k("accept"),children:"Accept all"}),D.jsx("button",{type:"button",className:"btn btn-danger",onClick:()=>k("reject"),children:"Reject all"}),D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>S(new Set),children:"Clear"})]}):null,E.length>0&&f?D.jsxs("label",{className:"checkbox-cell",style:{marginBottom:8},children:[D.jsx("input",{type:"checkbox",checked:C,onChange:A}),D.jsx("span",{className:"text-muted text-xs",children:"Select all pending"})]}):null,D.jsx("div",{className:"card-list",children:w.map(N=>D.jsx(fN,{entry:N,busyAction:s,onReviewAction:u,onOpenPage:c,selected:y.has(N.pageId),onToggleSelected:f?T:void 0},`${N.pageId}:${N.nextPath??N.previousPath??N.changeType}`))})]}):null]})}function fN({entry:t,busyAction:e,onReviewAction:n,onOpenPage:r,selected:i,onToggleSelected:l}){const[s,u]=ge.useState(!1),f=!!t.structuredDiff?.hunks.length,c=t.warnings?.includes("protected_frontmatter_changed")??!1;return D.jsxs("article",{className:`card${i?" is-selected":""}`,children:[D.jsxs("div",{className:"card-row",children:[l&&t.status==="pending"?D.jsx("label",{className:"checkbox-cell",children:D.jsx("input",{type:"checkbox",checked:i,onChange:()=>l(t.pageId),"aria-label":`Select ${t.title}`})}):null,D.jsxs("span",{className:"label",children:[t.status," / ",t.changeType]})]}),D.jsx("strong",{className:"card-title",children:t.title}),D.jsx("p",{className:"text-mono text-sm",children:t.nextPath??t.previousPath}),c?D.jsx("p",{className:"text-error text-sm",children:"Warning: protected frontmatter fields changed."}):null,D.jsxs("div",{className:"action-row",children:[t.stagedContent?D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{r(t.nextPath??t.previousPath??"",t.pageId)},children:"Open page"}):null,f?D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>u(h=>!h),children:s?"Hide diff":"View diff"}):null]}),s&&t.structuredDiff?D.jsx(oN,{diff:t.structuredDiff,warnings:t.warnings}):null,t.status==="pending"?D.jsxs("div",{className:"action-row",children:[D.jsx("button",{type:"button",className:"btn btn-primary",disabled:e===`accept:${t.pageId}`,onClick:()=>n(t.pageId,"accept"),children:"Accept"}),D.jsx("button",{type:"button",className:"btn btn-danger",disabled:e===`reject:${t.pageId}`,onClick:()=>n(t.pageId,"reject"),children:"Reject"})]}):D.jsx("p",{className:"text-secondary text-sm",children:t.currentContent?uN(t.currentContent):"No current content on disk."})]})}function dN({candidates:t,candidateError:e,busyAction:n,onCandidateAction:r,onBulkCandidateAction:i,onOpenPage:l}){const[s,u]=ge.useState(""),[f,c]=ge.useState("all"),[h,v]=ge.useState("score"),[p,m]=ge.useState(()=>new Set),y=ge.useMemo(()=>{const A=s.trim().toLowerCase();return t.filter(k=>f==="all"?!0:k.kind===f).filter(k=>A?`${k.title} ${k.path}`.toLowerCase().includes(A):!0)},[t,s,f]),S=ge.useMemo(()=>{const A=[...y];return h==="title"?A.sort((k,N)=>k.title.localeCompare(N.title)):h==="updated"?A.sort((k,N)=>(N.updatedAt??"").localeCompare(k.updatedAt??"")):A.sort((k,N)=>(N.score??0)-(k.score??0))},[y,h]),w=S.length>0&&S.every(A=>p.has(A.pageId)),E=A=>{m(k=>{const N=new Set(k);return N.has(A)?N.delete(A):N.add(A),N})},C=()=>{m(w?new Set:new Set(S.map(A=>A.pageId)))},T=A=>{!p.size||!i||(i([...p],A),m(new Set))};return D.jsxs("div",{children:[e?D.jsx("p",{className:"text-error",children:e}):null,t.length?D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:"list-filter-bar",children:[D.jsx("input",{type:"search",className:"input",placeholder:"Filter candidatesβ¦",value:s,onChange:A=>u(A.target.value),"aria-label":"Filter candidates"}),D.jsxs("select",{className:"input",value:f,onChange:A=>c(A.target.value),"aria-label":"Filter by kind",style:{width:"auto"},children:[D.jsx("option",{value:"all",children:"All kinds"}),D.jsx("option",{value:"concept",children:"Concepts"}),D.jsx("option",{value:"entity",children:"Entities"})]}),D.jsxs("select",{className:"input",value:h,onChange:A=>v(A.target.value),"aria-label":"Sort",style:{width:"auto"},children:[D.jsx("option",{value:"score",children:"Score"}),D.jsx("option",{value:"title",children:"Title"}),D.jsx("option",{value:"updated",children:"Recent"})]})]}),p.size>0&&i?D.jsxs("div",{className:"bulk-toolbar",role:"toolbar","aria-label":"Bulk candidate actions",children:[D.jsx("span",{className:"bulk-toolbar-count",children:p.size}),D.jsx("span",{className:"text-muted",children:"selected"}),D.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>T("promote"),children:"Promote all"}),D.jsx("button",{type:"button",className:"btn btn-danger",onClick:()=>T("archive"),children:"Archive all"}),D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>m(new Set),children:"Clear"})]}):null,i?D.jsxs("label",{className:"checkbox-cell",style:{marginBottom:8},children:[D.jsx("input",{type:"checkbox",checked:w,onChange:C}),D.jsx("span",{className:"text-muted text-xs",children:"Select all visible"})]}):null,D.jsxs("div",{className:"card-list",children:[S.map(A=>D.jsxs("article",{className:`card${p.has(A.pageId)?" is-selected":""}`,children:[D.jsxs("div",{className:"card-row",children:[i?D.jsx("label",{className:"checkbox-cell",children:D.jsx("input",{type:"checkbox",checked:p.has(A.pageId),onChange:()=>E(A.pageId),"aria-label":`Select ${A.title}`})}):null,D.jsx("span",{className:"label",children:A.kind}),A.score!=null?D.jsxs("span",{className:"chip",title:"Promotion score",children:["score ",A.score.toFixed(2)]}):null]}),D.jsx("strong",{className:"card-title",children:A.title}),D.jsx("p",{className:"text-mono text-sm",children:A.path}),D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{l(A.path,A.pageId)},children:"Open candidate"}),D.jsxs("div",{className:"action-row",children:[D.jsx("button",{type:"button",className:"btn btn-primary",disabled:n===`promote:${A.pageId}`,onClick:()=>r(A.pageId,"promote",A.activePath),children:"Promote"}),D.jsx("button",{type:"button",className:"btn btn-danger",disabled:n===`archive:${A.pageId}`,onClick:()=>r(A.pageId,"archive",A.path),children:"Archive"})]})]},A.pageId)),S.length===0?D.jsx("p",{className:"text-muted text-sm",children:"No candidates match the current filter."}):null]})]}):D.jsx("p",{className:"text-muted text-sm",children:"No candidate pages are waiting for review."})]})}function hN(t,e){const n=`${t.label} ${t.section??""} ${(t.keywords??[]).join(" ")}`.toLowerCase(),r=e.trim().toLowerCase();return r?t.label.toLowerCase().startsWith(r)?100:n.includes(r)?50:r.split(/\s+/).filter(Boolean).every(l=>n.includes(l))?25:0:1}function vN({open:t,onClose:e,commands:n}){const[r,i]=ge.useState(""),[l,s]=ge.useState(0),u=ge.useRef(null),f=ge.useMemo(()=>n.map(h=>({command:h,weight:hN(h,r)})).filter(h=>h.weight>0).sort((h,v)=>v.weight-h.weight||h.command.label.localeCompare(v.command.label)).map(h=>h.command),[n,r]);if(ge.useEffect(()=>{if(t){i(""),s(0);const h=window.setTimeout(()=>u.current?.focus(),30);return()=>window.clearTimeout(h)}},[t]),ge.useEffect(()=>{s(0)},[]),!t)return null;const c=h=>{if(h.key==="ArrowDown")h.preventDefault(),s(v=>Math.min(v+1,f.length-1));else if(h.key==="ArrowUp")h.preventDefault(),s(v=>Math.max(v-1,0));else if(h.key==="Enter"){h.preventDefault();const v=f[l];v&&(v.run(),e())}else h.key==="Escape"&&(h.preventDefault(),e())};return D.jsx("div",{className:"palette-overlay",role:"dialog","aria-modal":"true","aria-label":"Command palette",onClick:h=>{h.target===h.currentTarget&&e()},onKeyDown:h=>{h.key==="Escape"&&e()},children:D.jsxs("div",{className:"palette",children:[D.jsx("input",{ref:u,type:"search",className:"palette-input",placeholder:"Type a commandβ¦",value:r,onChange:h=>i(h.target.value),onKeyDown:c,"aria-label":"Command palette search"}),D.jsx("div",{className:"palette-list",children:f.length===0?D.jsx("div",{className:"palette-empty",children:"No matching commands."}):f.map((h,v)=>D.jsxs("button",{type:"button",className:`palette-item${v===l?" is-active":""}`,onMouseEnter:()=>s(v),onClick:()=>{h.run(),e()},children:[D.jsxs("span",{children:[h.section?D.jsxs("span",{className:"text-muted text-xs",children:[h.section," Β· "]}):null,h.label]}),h.shortcut?D.jsx("span",{className:"palette-item-shortcut",children:h.shortcut}):null]},h.id))})]})})}function Er(){return typeof window<"u"?window.__SWARMVAULT_EMBEDDED_DATA__:void 0}function FE(t){return t.trim().toLowerCase()}function xS(t){return new Map(t.nodes.map(e=>[e.id,e]))}function gN(t){return new Map((t.pages??[]).map(e=>[e.id,e]))}function Tp(t,e){const n=FE(e);return t.nodes.find(r=>r.id===e||FE(r.label)===n||r.pageId===e)??null}function wS(t){const e=new Map;for(const n of t.nodes)e.set(n.id,[]);for(const n of t.edges)e.get(n.source)?.push({nodeId:n.target,edge:n,direction:"outgoing"}),e.get(n.target)?.push({nodeId:n.source,edge:n,direction:"incoming"});return e}function pN(t,e,n){const r=Tp(t,e),i=Tp(t,n);if(!r||!i)return{from:e,to:n,resolvedFromNodeId:r?.id,resolvedToNodeId:i?.id,found:!1,nodeIds:[],edgeIds:[],pageIds:[],summary:"Could not resolve one or both graph targets."};const l=wS(t),s=[r.id],u=new Set([r.id]),f=new Map;for(;s.length;){const y=s.shift();if(y===i.id)break;for(const S of l.get(y)??[])u.has(S.nodeId)||(u.add(S.nodeId),f.set(S.nodeId,{nodeId:y,edgeId:S.edge.id}),s.push(S.nodeId))}if(!u.has(i.id))return{from:e,to:n,resolvedFromNodeId:r.id,resolvedToNodeId:i.id,found:!1,nodeIds:[],edgeIds:[],pageIds:[],summary:`No path found between ${r.label} and ${i.label}.`};const c=[],h=[];let v=i.id;for(;v!==r.id;){c.push(v);const y=f.get(v);if(!y)break;h.push(y.edgeId),v=y.nodeId}c.push(r.id),c.reverse(),h.reverse();const p=xS(t),m=[...new Set(c.flatMap(y=>{const S=p.get(y)?.pageId;return S?[S]:[]}))];return{from:e,to:n,resolvedFromNodeId:r.id,resolvedToNodeId:i.id,found:!0,nodeIds:c,edgeIds:h,pageIds:m,summary:c.map(y=>p.get(y)?.label??y).join(" -> ")}}function mN(t,e){const n=Tp(t,e);if(!n)throw new Error(`Could not resolve graph target: ${e}`);const r=gN(t),i=n.pageId?r.get(n.pageId):void 0,l=xS(t),s=[];for(const c of wS(t).get(n.id)??[]){const h=l.get(c.nodeId);h&&s.push({nodeId:h.id,label:h.label,type:h.type,pageId:h.pageId,relation:c.edge.relation,direction:c.direction,confidence:c.edge.confidence??0,evidenceClass:c.edge.evidenceClass??"unknown"})}s.sort((c,h)=>h.confidence-c.confidence||c.label.localeCompare(h.label));const u=(t.hyperedges??[]).filter(c=>c.nodeIds.includes(n.id)),f=t.communities?.find(c=>c.id===n.communityId);return{target:e,node:n,page:i?{id:i.id,path:i.path,title:i.title}:void 0,community:f?{id:f.id,label:f.label}:void 0,neighbors:s,hyperedges:u,summary:[`Node: ${n.label}`,`Type: ${n.type}`,`Community: ${n.communityId??"none"}`,`Neighbors: ${s.length}`,`Group patterns: ${u.length}`,`Page: ${i?.path??"none"}`].join(`
|
|
10
|
-
`)}}function ds(t,e){const n=new Set,r=[];for(const i of t){const l=e(i);n.has(l)||(n.add(l),r.push(i))}return r}function hl(t,e){const n=t.trim().toLowerCase(),r=e.trim().toLowerCase();if(!n||!r)return 0;if(r===n)return 100;if(r.startsWith(n))return 80;if(r.includes(n))return 60;const i=n.split(/\s+/).filter(Boolean),l=new Set(r.split(/\s+/).filter(Boolean)),s=i.filter(u=>l.has(u)).length;return s?s*10:0}function yN(t,e,n,r){const i=r?.traversal??"bfs",l=Math.max(3,Math.min(r?.budget??12,50)),s=new Map((t.pages??[]).map(_=>[_.id,_])),f=n.map(_=>{const O=s.get(_.pageId),U=Math.max(hl(e,_.title),hl(e,_.path));return!O||U<=0?null:{type:"page",id:O.id,label:O.title,score:U}}).filter(_=>_!==null),c=t.nodes.map(_=>({type:"node",id:_.id,label:_.label,score:Math.max(hl(e,_.label),hl(e,_.id))})).filter(_=>_.score>0),h=(t.hyperedges??[]).map(_=>({type:"hyperedge",id:_.id,label:_.label,score:Math.max(hl(e,_.label),hl(e,_.why),hl(e,_.relation))})).filter(_=>_.score>0),v=ds([...f,...c,...h],_=>`${_.type}:${_.id}`).sort((_,O)=>O.score-_.score||_.label.localeCompare(O.label)).slice(0,12),p=ds([...n.flatMap(_=>s.get(_.pageId)?.nodeIds??[]),...v.filter(_=>_.type==="page").flatMap(_=>s.get(_.id)?.nodeIds??[]),...v.filter(_=>_.type==="node").map(_=>_.id),...v.filter(_=>_.type==="hyperedge").flatMap(_=>(t.hyperedges??[]).find(O=>O.id===_.id)?.nodeIds??[])],_=>_).filter(Boolean),m=new Map,y=(_,O)=>{m.has(_)||m.set(_,[]),m.get(_)?.push(O)};for(const _ of t.edges)y(_.source,{edge:_,nodeId:_.target,direction:"outgoing"}),y(_.target,{edge:_,nodeId:_.source,direction:"incoming"});for(const[_,O]of m.entries())O.sort((U,M)=>(M.edge.confidence??0)-(U.edge.confidence??0)||U.edge.relation.localeCompare(M.edge.relation)),m.set(_,O);const S=[],w=new Set,E=new Set,C=[...p];for(;C.length&&S.length<l;){const _=i==="dfs"?C.pop():C.shift();if(!(!_||E.has(_))){E.add(_),S.push(_);for(const O of m.get(_)??[])if(w.add(O.edge.id),E.has(O.nodeId)||C.push(O.nodeId),S.length+C.length>=l*2)break}}const T=new Map(t.nodes.map(_=>[_.id,_])),A=ds([...n.map(_=>_.pageId),...v.filter(_=>_.type==="page").map(_=>_.id),...S.flatMap(_=>{const O=T.get(_);return O?.pageId?[O.pageId]:[]})],_=>_),k=ds(S.map(_=>T.get(_)?.communityId).filter(_=>!!_),_=>_),N=ds((t.hyperedges??[]).filter(_=>_.nodeIds.some(O=>S.includes(O))).map(_=>_.id),_=>_);return{question:e,traversal:i,seedNodeIds:p,seedPageIds:ds([...n.map(_=>_.pageId),...v.filter(_=>_.type==="page").map(_=>_.id)],_=>_),visitedNodeIds:S,visitedEdgeIds:[...w],hyperedgeIds:N,pageIds:A,communities:k,matches:v,summary:[`Seeds: ${p.join(", ")||"none"}`,`Visited nodes: ${S.length}`,`Visited edges: ${w.size}`,`Touched group patterns: ${N.length}`,`Communities: ${k.join(", ")||"none"}`,`Pages: ${A.join(", ")||"none"}`].join(`
|
|
11
|
-
`)}}function bN(t,e){const n=t.replace(/\s+/g," ").trim();if(!e)return n.slice(0,160);const r=n.toLowerCase().indexOf(e.toLowerCase());if(r<0)return n.slice(0,160);const i=Math.max(0,r-50),l=Math.min(n.length,r+Math.max(e.length,40));return`${i>0?"...":""}${n.slice(i,l)}${l<n.length?"...":""}`}async function EN(t="/api/graph",e){const n=Er();if(n)return n.graph;const r=await fetch(t,e);if(!r.ok)throw new Error(`Failed to load graph artifact: ${r.status} ${r.statusText}`);return r.json()}async function SS(t,e={}){const n=Er(),r=e.limit??10,i=e.kind??"all",l=e.status??"all",s=e.project??"all",u=e.sourceType??"all",f=e.sourceClass??"all";if(n){const v=t.trim().toLowerCase();return v?n.pages.filter(p=>i==="all"?!0:p.kind===i).filter(p=>l==="all"?!0:p.status===l).filter(p=>s==="all"?!0:s==="unassigned"?p.projectIds.length===0:p.projectIds.includes(s)).filter(p=>u==="all"?!0:(p.sourceType??"")===u).filter(p=>f==="all"?!0:(p.sourceClass??"")===f).map(p=>{const m=`${p.title}
|
|
12
|
-
${p.content}`.toLowerCase(),y=m.includes(v)?m.indexOf(v):Number.POSITIVE_INFINITY;return{pageId:p.pageId,path:p.path,title:p.title,snippet:bN(p.content,t),rank:y,kind:p.kind,status:p.status,projectIds:p.projectIds,sourceType:p.sourceType,sourceClass:p.sourceClass}}).filter(p=>Number.isFinite(p.rank)).sort((p,m)=>p.rank-m.rank||p.title.localeCompare(m.title)).slice(0,r):[]}const c=new URLSearchParams({q:t,limit:String(r),kind:i,status:l,project:s,sourceType:u,sourceClass:f}),h=await fetch(`/api/search?${c.toString()}`);if(!h.ok)throw new Error(`Failed to search pages: ${h.status} ${h.statusText}`);return h.json()}async function IE(t){const e=Er();if(e){const r=e.pages.find(i=>i.path===t);if(!r)throw new Error(`Page not found: ${t}`);return{path:r.path,title:r.title,frontmatter:{page_id:r.pageId,kind:r.kind,status:r.status,project_ids:r.projectIds,source_type:r.sourceType,source_class:r.sourceClass},content:r.content,assets:r.assets??[]}}const n=await fetch(`/api/page?path=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(`Failed to load page: ${n.status} ${n.statusText}`);return n.json()}async function xN(t,e={}){const n=Er();if(n){const l=await SS(t,{limit:10});return yN(n.graph,t,l,e)}const r=new URLSearchParams({q:t,traversal:e.traversal??"bfs",budget:String(e.budget??12)}),i=await fetch(`/api/graph/query?${r.toString()}`);if(!i.ok)throw new Error(`Failed to query graph: ${i.status} ${i.statusText}`);return i.json()}async function wN(){const t=Er();if(t)return t.report??null;const e=await fetch("/api/graph-report");if(e.status===404)return null;if(!e.ok)throw new Error(`Failed to load graph report: ${e.status} ${e.statusText}`);return e.json()}async function zE(t,e){const n=Er();if(n)return pN(n.graph,t,e);const r=new URLSearchParams({from:t,to:e}),i=await fetch(`/api/graph/path?${r.toString()}`);if(!i.ok)throw new Error(`Failed to find graph path: ${i.status} ${i.statusText}`);return i.json()}async function SN(t){const e=Er();if(e)return mN(e.graph,t);const n=await fetch(`/api/graph/explain?target=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(`Failed to explain graph target: ${n.status} ${n.statusText}`);return n.json()}async function CN(){if(Er())return[];const t=await fetch("/api/reviews");if(!t.ok)throw new Error(`Failed to load approvals: ${t.status} ${t.statusText}`);return t.json()}async function TN(t){if(Er())throw new Error("Review actions are unavailable in standalone exports.");const e=await fetch(`/api/review?id=${encodeURIComponent(t)}`);if(!e.ok)throw new Error(`Failed to load approval detail: ${e.status} ${e.statusText}`);return e.json()}async function Zc(t,e,n=[]){if(Er())throw new Error("Review actions are unavailable in standalone exports.");const r=await fetch(`/api/review?action=${e}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({approvalId:t,targets:n})});if(!r.ok)throw new Error(`Failed to ${e} review entries: ${r.status} ${r.statusText}`);return r.json()}async function DN(){if(Er())return[];const t=await fetch("/api/candidates");if(!t.ok)throw new Error(`Failed to load candidates: ${t.status} ${t.statusText}`);return t.json()}async function AN(){if(Er())return[];const t=await fetch("/api/memory-tasks");if(t.status===404)return[];if(!t.ok)throw new Error(`Failed to load memory tasks: ${t.status} ${t.statusText}`);return t.json()}async function PE(t,e){if(Er())throw new Error("Candidate actions are unavailable in standalone exports.");const n=await fetch(`/api/candidate?action=${e}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({target:t})});if(!n.ok)throw new Error(`Failed to ${e} candidate: ${n.status} ${n.statusText}`);return n.json()}async function _N(){if(Er())return{generatedAt:"",watchedRepoRoots:[],pendingSemanticRefresh:[]};const t=await fetch("/api/watch-status");if(!t.ok)throw new Error(`Failed to load watch status: ${t.status} ${t.statusText}`);return t.json()}async function NN(){if(Er())return[];const t=await fetch("/api/lint");if(t.status===404)return[];if(!t.ok)throw new Error(`Failed to load lint findings: ${t.status} ${t.statusText}`);return t.json()}function kN(t,e){const n=new Set(e),r=t.nodes.filter(l=>n.has(l.id)),i=t.edges.filter(l=>n.has(l.source)&&n.has(l.target));return{generatedAt:new Date().toISOString(),rootNodeId:e[0],nodes:r,edges:i}}function CS(t,e){if(typeof document>"u")return;const n=document.createElement("a");n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function _v(t,e,n="text/plain"){const r=new Blob([e],{type:n}),i=URL.createObjectURL(r);CS(t,i),setTimeout(()=>URL.revokeObjectURL(i),1500)}function RN(t,e){return!t||!t.png?null:t.png({full:!0,bg:"transparent",output:"base64uri"})}function MN(t){const e=t;return typeof e.svg=="function"?e.svg({full:!0,scale:1}):null}function ON({cyRef:t,graph:e,selectedNodeIds:n,pageMarkdown:r}){const[i,l]=ge.useState(!1),s=()=>{const h=t.current;if(!h)return;const v=RN(h);v&&CS(`swarmvault-graph-${Date.now()}.png`,v),l(!1)},u=()=>{const h=t.current;if(!h)return;const v=MN(h);v&&_v(`swarmvault-graph-${Date.now()}.svg`,v,"image/svg+xml"),l(!1)},f=()=>{if(!e)return;const h=n.length?n:e.nodes.map(p=>p.id),v=kN(e,h);_v(`swarmvault-subgraph-${Date.now()}.json`,JSON.stringify(v,null,2),"application/json"),l(!1)},c=async()=>{if(!r)return;const h=`# ${r.title}
|
|
13
|
-
|
|
14
|
-
${r.content}`;try{await navigator.clipboard.writeText(h)}catch{_v(`${r.title.replace(/[^a-z0-9-_.]+/gi,"-")||"page"}.md`,h,"text/markdown")}l(!1)};return D.jsxs("div",{style:{position:"relative"},children:[D.jsx("button",{type:"button",className:"btn",onClick:()=>l(h=>!h),"aria-expanded":i,"aria-haspopup":"menu",children:"Export βΎ"}),i?D.jsxs("div",{role:"menu",style:{position:"absolute",right:0,top:"calc(100% + 4px)",background:"var(--c-bg-elevated)",border:"1px solid var(--c-border)",borderRadius:"var(--radius-md)",padding:"var(--sp-1)",zIndex:20,boxShadow:"var(--c-shadow-elevated)",display:"flex",flexDirection:"column",minWidth:200},children:[D.jsx("button",{type:"button",role:"menuitem",className:"palette-item",onClick:s,children:"Canvas as PNG"}),D.jsx("button",{type:"button",role:"menuitem",className:"palette-item",onClick:u,children:"Canvas as SVG"}),D.jsxs("button",{type:"button",role:"menuitem",className:"palette-item",onClick:f,children:["Subgraph as JSON (",n.length||(e?.nodes.length??0)," nodes)"]}),D.jsx("button",{type:"button",role:"menuitem",className:"palette-item",onClick:c,disabled:!r,children:"Copy page as markdown"})]}):null]})}const UE=20;function BN({edgeStatusFilter:t,onEdgeStatusChange:e,kindFilter:n,onKindChange:r,pageStatusFilter:i,onPageStatusChange:l,projectFilter:s,onProjectChange:u,projectOptions:f,sourceTypeFilter:c,onSourceTypeChange:h,sourceTypeOptions:v,sourceClassFilter:p,onSourceClassChange:m,sourceClassOptions:y,communityFilter:S,onCommunityChange:w,communityOptions:E,selectedTags:C,onToggleTag:T,onClearTags:A,tagOptions:k,query:N,onQueryChange:_}){const[O,U]=ge.useState(()=>new Set(["graph","tags"])),[M,I]=ge.useState(""),[P,j]=ge.useState(!1),K=q=>{U(L=>{const W=new Set(L);return W.has(q)?W.delete(q):W.add(q),W})},$=ge.useMemo(()=>new Set(C),[C]),B=ge.useMemo(()=>{const q=M.trim().toLowerCase();return q?k.filter(({tag:L})=>L.toLowerCase().includes(q)):k},[k,M]),H=ge.useMemo(()=>P||M.trim().length>0?B:B.slice(0,UE),[B,P,M]),Y=B.length-H.length,Q=[t,S,p].filter(q=>q!=="all").length,z=[n,i,s,c].filter(q=>q!=="all").length,F=C.length;return D.jsxs("div",{className:"sidebar","data-drawer":"sidebar",children:[D.jsx("div",{className:"sidebar-section",children:D.jsxs("label",{className:"filter-group",children:[D.jsx("span",{className:"filter-label",children:"Search"}),D.jsx("input",{type:"search",className:"input",value:N,onChange:q=>_(q.target.value),placeholder:"Pages, outputs, candidatesβ¦","aria-label":"Search pages"})]})}),D.jsxs("div",{className:"sidebar-section",children:[D.jsxs("button",{type:"button",className:`sidebar-section-toggle ${O.has("graph")?"is-expanded":""}`,onClick:()=>K("graph"),children:["Graph",Q>0?D.jsx("span",{className:"filter-badge",children:Q}):null]}),D.jsxs("div",{className:`sidebar-section-body ${O.has("graph")?"is-expanded":""}`,children:[D.jsxs("label",{className:"filter-group",children:[D.jsx("span",{className:"filter-label",children:"Edge status"}),D.jsxs("select",{className:"input",value:t,onChange:q=>e(q.target.value),children:[D.jsx("option",{value:"all",children:"All"}),D.jsx("option",{value:"extracted",children:"Extracted"}),D.jsx("option",{value:"conflicted",children:"Conflicted"}),D.jsx("option",{value:"inferred",children:"Inferred"}),D.jsx("option",{value:"stale",children:"Stale"})]})]}),D.jsxs("label",{className:"filter-group",children:[D.jsx("span",{className:"filter-label",children:"Source class"}),D.jsxs("select",{className:"input",value:p,onChange:q=>m(q.target.value),children:[D.jsx("option",{value:"all",children:"All"}),y.map(q=>D.jsx("option",{value:q,children:q},q))]})]}),D.jsxs("label",{className:"filter-group",children:[D.jsx("span",{className:"filter-label",children:"Community"}),D.jsxs("select",{className:"input",value:S,onChange:q=>w(q.target.value),children:[D.jsx("option",{value:"all",children:"All"}),E.map(q=>D.jsx("option",{value:q,children:q},q))]})]})]})]}),D.jsxs("div",{className:"sidebar-section",children:[D.jsxs("button",{type:"button",className:`sidebar-section-toggle ${O.has("tags")?"is-expanded":""}`,onClick:()=>K("tags"),children:["Tags",F>0?D.jsx("span",{className:"filter-badge",children:F}):null]}),D.jsx("div",{className:`sidebar-section-body ${O.has("tags")?"is-expanded":""}`,children:k.length===0?D.jsx("p",{className:"text-muted text-sm",children:"No tags in this vault yet."}):D.jsxs(D.Fragment,{children:[D.jsxs("label",{className:"filter-group",children:[D.jsx("span",{className:"filter-label",children:"Filter tags"}),D.jsx("input",{type:"search",className:"input",value:M,onChange:q=>I(q.target.value),placeholder:"Search tagsβ¦","aria-label":"Search tags","data-testid":"tag-search-input"})]}),D.jsxs("div",{className:"chip-row","data-testid":"tag-chip-row",children:[D.jsx("button",{type:"button",className:`chip chip-tag${C.length===0?" is-active":""}`,onClick:A,"data-testid":"tag-chip-all",children:"all"}),H.map(({tag:q,count:L})=>{const W=$.has(q);return D.jsxs("button",{type:"button",className:`chip chip-tag${W?" is-active":""}`,onClick:()=>T(q),title:`${L} pages`,"data-testid":`tag-chip-${q}`,"aria-pressed":W,children:["#",q," ",D.jsx("span",{className:"text-muted text-xs",children:L})]},q)})]}),Y>0||P&&B.length>UE?D.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>j(q=>!q),"data-testid":"tag-expander",children:P?"Show fewer tags":`Show all ${B.length} tags`}):null]})})]}),D.jsxs("div",{className:"sidebar-section",children:[D.jsxs("button",{type:"button",className:`sidebar-section-toggle ${O.has("pages")?"is-expanded":""}`,onClick:()=>K("pages"),children:["Pages",z>0?D.jsx("span",{className:"filter-badge",children:z}):null]}),D.jsxs("div",{className:`sidebar-section-body ${O.has("pages")?"is-expanded":""}`,children:[D.jsxs("label",{className:"filter-group",children:[D.jsx("span",{className:"filter-label",children:"Page kind"}),D.jsxs("select",{className:"input",value:n,onChange:q=>r(q.target.value),children:[D.jsx("option",{value:"all",children:"All"}),D.jsx("option",{value:"source",children:"Source"}),D.jsx("option",{value:"module",children:"Module"}),D.jsx("option",{value:"concept",children:"Concept"}),D.jsx("option",{value:"entity",children:"Entity"}),D.jsx("option",{value:"output",children:"Output"}),D.jsx("option",{value:"insight",children:"Insight"}),D.jsx("option",{value:"graph_report",children:"Graph report"}),D.jsx("option",{value:"community_summary",children:"Community summary"}),D.jsx("option",{value:"index",children:"Index"})]})]}),D.jsxs("label",{className:"filter-group",children:[D.jsx("span",{className:"filter-label",children:"Status"}),D.jsxs("select",{className:"input",value:i,onChange:q=>l(q.target.value),children:[D.jsx("option",{value:"all",children:"All"}),D.jsx("option",{value:"active",children:"Active"}),D.jsx("option",{value:"blocked",children:"Blocked"}),D.jsx("option",{value:"completed",children:"Completed"}),D.jsx("option",{value:"candidate",children:"Candidate"}),D.jsx("option",{value:"draft",children:"Draft"}),D.jsx("option",{value:"archived",children:"Archived"})]})]}),D.jsxs("label",{className:"filter-group",children:[D.jsx("span",{className:"filter-label",children:"Project"}),D.jsxs("select",{className:"input",value:s,onChange:q=>u(q.target.value),children:[D.jsx("option",{value:"all",children:"All"}),D.jsx("option",{value:"unassigned",children:"Unassigned"}),f.map(q=>D.jsx("option",{value:q,children:q},q))]})]}),D.jsxs("label",{className:"filter-group",children:[D.jsx("span",{className:"filter-label",children:"Source type"}),D.jsxs("select",{className:"input",value:c,onChange:q=>h(q.target.value),children:[D.jsx("option",{value:"all",children:"All"}),v.map(q=>D.jsx("option",{value:q,children:q},q))]})]})]})]})]})}function Dp(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function LN(t){if(Array.isArray(t))return t}function FN(t){if(Array.isArray(t))return Dp(t)}function ji(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function IN(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,DS(r.key),r)}}function Hi(t,e,n){return e&&IN(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Or(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=im(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
15
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,s=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var f=n.next();return s=f.done,f},e:function(f){u=!0,l=f},f:function(){try{s||n.return==null||n.return()}finally{if(u)throw l}}}}function TS(t,e,n){return(e=DS(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zN(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function PN(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,l,s,u=[],f=!0,c=!1;try{if(l=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;f=!1}else for(;!(f=(r=l.call(n)).done)&&(u.push(r.value),u.length!==e);f=!0);}catch(h){c=!0,i=h}finally{try{if(!f&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return u}}function UN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
16
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qN(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
17
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pn(t,e){return LN(t)||PN(t,e)||im(t,e)||UN()}function Of(t){return FN(t)||zN(t)||im(t)||qN()}function jN(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function DS(t){var e=jN(t,"string");return typeof e=="symbol"?e:e+""}function Gn(t){"@babel/helpers - typeof";return Gn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gn(t)}function im(t,e){if(t){if(typeof t=="string")return Dp(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dp(t,e):void 0}}var jn=typeof window>"u"?null:window,qE=jn?jn.navigator:null;jn&&jn.document;var HN=Gn(""),AS=Gn({}),GN=Gn(function(){}),VN=typeof HTMLElement>"u"?"undefined":Gn(HTMLElement),wu=function(e){return e&&e.instanceString&&xn(e.instanceString)?e.instanceString():null},ct=function(e){return e!=null&&Gn(e)==HN},xn=function(e){return e!=null&&Gn(e)===GN},an=function(e){return!Hr(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Ut=function(e){return e!=null&&Gn(e)===AS&&!an(e)&&e.constructor===Object},$N=function(e){return e!=null&&Gn(e)===AS},Ge=function(e){return e!=null&&Gn(e)===Gn(1)&&!isNaN(e)},KN=function(e){return Ge(e)&&Math.floor(e)===e},Bf=function(e){if(VN!=="undefined")return e!=null&&e instanceof HTMLElement},Hr=function(e){return Su(e)||_S(e)},Su=function(e){return wu(e)==="collection"&&e._private.single},_S=function(e){return wu(e)==="collection"&&!e._private.single},lm=function(e){return wu(e)==="core"},NS=function(e){return wu(e)==="stylesheet"},YN=function(e){return wu(e)==="event"},Fi=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},XN=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},ZN=function(e){return Ut(e)&&Ge(e.x1)&&Ge(e.x2)&&Ge(e.y1)&&Ge(e.y2)},QN=function(e){return $N(e)&&xn(e.then)},WN=function(){return qE&&qE.userAgent.match(/msie|trident|edge/i)},Fs=function(e,n){n||(n=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var l=[],s=0;s<arguments.length;s++)l.push(arguments[s]);return l.join("$")});var r=function(){var l=this,s=arguments,u,f=n.apply(l,s),c=r.cache;return(u=c[f])||(u=c[f]=e.apply(l,s)),u};return r.cache={},r},sm=Fs(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Jf=Fs(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),kS=Fs(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),jE=function(e){return Fi(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Ri=function(e,n){return e.slice(-1*n.length)===n},Hn="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",JN="rgb[a]?\\(("+Hn+"[%]?)\\s*,\\s*("+Hn+"[%]?)\\s*,\\s*("+Hn+"[%]?)(?:\\s*,\\s*("+Hn+"))?\\)",ek="rgb[a]?\\((?:"+Hn+"[%]?)\\s*,\\s*(?:"+Hn+"[%]?)\\s*,\\s*(?:"+Hn+"[%]?)(?:\\s*,\\s*(?:"+Hn+"))?\\)",tk="hsl[a]?\\(("+Hn+")\\s*,\\s*("+Hn+"[%])\\s*,\\s*("+Hn+"[%])(?:\\s*,\\s*("+Hn+"))?\\)",nk="hsl[a]?\\((?:"+Hn+")\\s*,\\s*(?:"+Hn+"[%])\\s*,\\s*(?:"+Hn+"[%])(?:\\s*,\\s*(?:"+Hn+"))?\\)",rk="\\#[0-9a-fA-F]{3}",ak="\\#[0-9a-fA-F]{6}",RS=function(e,n){return e<n?-1:e>n?1:0},ik=function(e,n){return-1*RS(e,n)},vt=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,n=1;n<e.length;n++){var r=e[n];if(r!=null)for(var i=Object.keys(r),l=0;l<i.length;l++){var s=i[l];t[s]=r[s]}}return t},lk=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var n=e.length===4,r,i,l,s=16;return n?(r=parseInt(e[1]+e[1],s),i=parseInt(e[2]+e[2],s),l=parseInt(e[3]+e[3],s)):(r=parseInt(e[1]+e[2],s),i=parseInt(e[3]+e[4],s),l=parseInt(e[5]+e[6],s)),[r,i,l]}},sk=function(e){var n,r,i,l,s,u,f,c;function h(y,S,w){return w<0&&(w+=1),w>1&&(w-=1),w<1/6?y+(S-y)*6*w:w<1/2?S:w<2/3?y+(S-y)*(2/3-w)*6:y}var v=new RegExp("^"+tk+"$").exec(e);if(v){if(r=parseInt(v[1]),r<0?r=(360- -1*r%360)%360:r>360&&(r=r%360),r/=360,i=parseFloat(v[2]),i<0||i>100||(i=i/100,l=parseFloat(v[3]),l<0||l>100)||(l=l/100,s=v[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(i===0)u=f=c=Math.round(l*255);else{var p=l<.5?l*(1+i):l+i-l*i,m=2*l-p;u=Math.round(255*h(m,p,r+1/3)),f=Math.round(255*h(m,p,r)),c=Math.round(255*h(m,p,r-1/3))}n=[u,f,c,s]}return n},ok=function(e){var n,r=new RegExp("^"+JN+"$").exec(e);if(r){n=[];for(var i=[],l=1;l<=3;l++){var s=r[l];if(s[s.length-1]==="%"&&(i[l]=!0),s=parseFloat(s),i[l]&&(s=s/100*255),s<0||s>255)return;n.push(Math.floor(s))}var u=i[1]||i[2]||i[3],f=i[1]&&i[2]&&i[3];if(u&&!f)return;var c=r[4];if(c!==void 0){if(c=parseFloat(c),c<0||c>1)return;n.push(c)}}return n},uk=function(e){return ck[e.toLowerCase()]},MS=function(e){return(an(e)?e:null)||uk(e)||lk(e)||ok(e)||sk(e)},ck={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},OS=function(e){for(var n=e.map,r=e.keys,i=r.length,l=0;l<i;l++){var s=r[l];if(Ut(s))throw Error("Tried to set map with object key");l<r.length-1?(n[s]==null&&(n[s]={}),n=n[s]):n[s]=e.value}},BS=function(e){for(var n=e.map,r=e.keys,i=r.length,l=0;l<i;l++){var s=r[l];if(Ut(s))throw Error("Tried to get map with object key");if(n=n[s],n==null)return n}return n},Qc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Nv,HE;function Tu(){if(HE)return Nv;HE=1;function t(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return Nv=t,Nv}var kv,GE;function fk(){if(GE)return kv;GE=1;var t=typeof Qc=="object"&&Qc&&Qc.Object===Object&&Qc;return kv=t,kv}var Rv,VE;function ed(){if(VE)return Rv;VE=1;var t=fk(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return Rv=n,Rv}var Mv,$E;function dk(){if($E)return Mv;$E=1;var t=ed(),e=function(){return t.Date.now()};return Mv=e,Mv}var Ov,KE;function hk(){if(KE)return Ov;KE=1;var t=/\s/;function e(n){for(var r=n.length;r--&&t.test(n.charAt(r)););return r}return Ov=e,Ov}var Bv,YE;function vk(){if(YE)return Bv;YE=1;var t=hk(),e=/^\s+/;function n(r){return r&&r.slice(0,t(r)+1).replace(e,"")}return Bv=n,Bv}var Lv,XE;function om(){if(XE)return Lv;XE=1;var t=ed(),e=t.Symbol;return Lv=e,Lv}var Fv,ZE;function gk(){if(ZE)return Fv;ZE=1;var t=om(),e=Object.prototype,n=e.hasOwnProperty,r=e.toString,i=t?t.toStringTag:void 0;function l(s){var u=n.call(s,i),f=s[i];try{s[i]=void 0;var c=!0}catch{}var h=r.call(s);return c&&(u?s[i]=f:delete s[i]),h}return Fv=l,Fv}var Iv,QE;function pk(){if(QE)return Iv;QE=1;var t=Object.prototype,e=t.toString;function n(r){return e.call(r)}return Iv=n,Iv}var zv,WE;function LS(){if(WE)return zv;WE=1;var t=om(),e=gk(),n=pk(),r="[object Null]",i="[object Undefined]",l=t?t.toStringTag:void 0;function s(u){return u==null?u===void 0?i:r:l&&l in Object(u)?e(u):n(u)}return zv=s,zv}var Pv,JE;function mk(){if(JE)return Pv;JE=1;function t(e){return e!=null&&typeof e=="object"}return Pv=t,Pv}var Uv,ex;function Du(){if(ex)return Uv;ex=1;var t=LS(),e=mk(),n="[object Symbol]";function r(i){return typeof i=="symbol"||e(i)&&t(i)==n}return Uv=r,Uv}var qv,tx;function yk(){if(tx)return qv;tx=1;var t=vk(),e=Tu(),n=Du(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt;function f(c){if(typeof c=="number")return c;if(n(c))return r;if(e(c)){var h=typeof c.valueOf=="function"?c.valueOf():c;c=e(h)?h+"":h}if(typeof c!="string")return c===0?c:+c;c=t(c);var v=l.test(c);return v||s.test(c)?u(c.slice(2),v?2:8):i.test(c)?r:+c}return qv=f,qv}var jv,nx;function bk(){if(nx)return jv;nx=1;var t=Tu(),e=dk(),n=yk(),r="Expected a function",i=Math.max,l=Math.min;function s(u,f,c){var h,v,p,m,y,S,w=0,E=!1,C=!1,T=!0;if(typeof u!="function")throw new TypeError(r);f=n(f)||0,t(c)&&(E=!!c.leading,C="maxWait"in c,p=C?i(n(c.maxWait)||0,f):p,T="trailing"in c?!!c.trailing:T);function A(j){var K=h,$=v;return h=v=void 0,w=j,m=u.apply($,K),m}function k(j){return w=j,y=setTimeout(O,f),E?A(j):m}function N(j){var K=j-S,$=j-w,B=f-K;return C?l(B,p-$):B}function _(j){var K=j-S,$=j-w;return S===void 0||K>=f||K<0||C&&$>=p}function O(){var j=e();if(_(j))return U(j);y=setTimeout(O,N(j))}function U(j){return y=void 0,T&&h?A(j):(h=v=void 0,m)}function M(){y!==void 0&&clearTimeout(y),w=0,h=S=v=y=void 0}function I(){return y===void 0?m:U(e())}function P(){var j=e(),K=_(j);if(h=arguments,v=this,S=j,K){if(y===void 0)return k(S);if(C)return clearTimeout(y),y=setTimeout(O,f),A(S)}return y===void 0&&(y=setTimeout(O,f)),m}return P.cancel=M,P.flush=I,P}return jv=s,jv}var Ek=bk(),Au=Cu(Ek),Hv=jn?jn.performance:null,FS=Hv&&Hv.now?function(){return Hv.now()}:function(){return Date.now()},xk=(function(){if(jn){if(jn.requestAnimationFrame)return function(t){jn.requestAnimationFrame(t)};if(jn.mozRequestAnimationFrame)return function(t){jn.mozRequestAnimationFrame(t)};if(jn.webkitRequestAnimationFrame)return function(t){jn.webkitRequestAnimationFrame(t)};if(jn.msRequestAnimationFrame)return function(t){jn.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(FS())},1e3/60)}})(),Lf=function(e){return xk(e)},Xa=FS,bl=9261,IS=65599,Cs=5381,zS=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bl,r=n,i;i=e.next(),!i.done;)r=r*IS+i.value|0;return r},uu=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bl;return n*IS+e|0},cu=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Cs;return(n<<5)+n+e|0},wk=function(e,n){return e*2097152+n},Ti=function(e){return e[0]*2097152+e[1]},Wc=function(e,n){return[uu(e[0],n[0]),cu(e[1],n[1])]},rx=function(e,n){var r={value:0,done:!1},i=0,l=e.length,s={next:function(){return i<l?r.value=e[i++]:r.done=!0,r}};return zS(s,n)},wl=function(e,n){var r={value:0,done:!1},i=0,l=e.length,s={next:function(){return i<l?r.value=e.charCodeAt(i++):r.done=!0,r}};return zS(s,n)},PS=function(){return Sk(arguments)},Sk=function(e){for(var n,r=0;r<e.length;r++){var i=e[r];r===0?n=wl(i):n=wl(i,n)}return n};function Ck(t,e,n,r,i){var l=i*Math.PI/180,s=Math.cos(l)*(t-n)-Math.sin(l)*(e-r)+n,u=Math.sin(l)*(t-n)+Math.cos(l)*(e-r)+r;return{x:s,y:u}}var Tk=function(e,n,r,i,l,s){return{x:(e-r)*l+r,y:(n-i)*s+i}};function Dk(t,e,n){if(n===0)return t;var r=(e.x1+e.x2)/2,i=(e.y1+e.y2)/2,l=e.w/e.h,s=1/l,u=Ck(t.x,t.y,r,i,n),f=Tk(u.x,u.y,r,i,l,s);return{x:f.x,y:f.y}}var ax=!0,Ak=console.warn!=null,_k=console.trace!=null,um=Number.MAX_SAFE_INTEGER||9007199254740991,US=function(){return!0},Ff=function(){return!1},ix=function(){return 0},cm=function(){},gn=function(e){throw new Error(e)},qS=function(e){if(e!==void 0)ax=!!e;else return ax},$t=function(e){qS()&&(Ak?console.warn(e):(console.log(e),_k&&console.trace()))},Nk=function(e){return vt({},e)},Ca=function(e){return e==null?e:an(e)?e.slice():Ut(e)?Nk(e):e},kk=function(e){return e.slice()},jS=function(e,n){for(n=e="";e++<36;n+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return n},Rk={},HS=function(){return Rk},ir=function(e){var n=Object.keys(e);return function(r){for(var i={},l=0;l<n.length;l++){var s=n[l],u=r?.[s];i[s]=u===void 0?e[s]:u}return i}},Ii=function(e,n,r){for(var i=e.length-1;i>=0;i--)e[i]===n&&e.splice(i,1)},fm=function(e){e.splice(0,e.length)},Mk=function(e,n){for(var r=0;r<n.length;r++){var i=n[r];e.push(i)}},Rr=function(e,n,r){return r&&(n=kS(r,n)),e[n]},Ka=function(e,n,r,i){r&&(n=kS(r,n)),e[n]=i},Ok=(function(){function t(){ji(this,t),this._obj={}}return Hi(t,[{key:"set",value:function(n,r){return this._obj[n]=r,this}},{key:"delete",value:function(n){return this._obj[n]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(n){return this._obj[n]!==void 0}},{key:"get",value:function(n){return this._obj[n]}}])})(),Ya=typeof Map<"u"?Map:Ok,Bk="undefined",Lk=(function(){function t(e){if(ji(this,t),this._obj=Object.create(null),this.size=0,e!=null){var n;e.instanceString!=null&&e.instanceString()===this.instanceString()?n=e.toArray():n=e;for(var r=0;r<n.length;r++)this.add(n[r])}}return Hi(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(n){var r=this._obj;r[n]!==1&&(r[n]=1,this.size++)}},{key:"delete",value:function(n){var r=this._obj;r[n]===1&&(r[n]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(n){return this._obj[n]===1}},{key:"toArray",value:function(){var n=this;return Object.keys(this._obj).filter(function(r){return n.has(r)})}},{key:"forEach",value:function(n,r){return this.toArray().forEach(n,r)}}])})(),Us=(typeof Set>"u"?"undefined":Gn(Set))!==Bk?Set:Lk,td=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||n===void 0||!lm(e)){gn("An element must have a core reference and parameters set");return}var i=n.group;if(i==null&&(n.data&&n.data.source!=null&&n.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){gn("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var l=this._private={cy:e,single:!0,data:n.data||{},position:n.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!n.selected,selectable:n.selectable===void 0?!0:!!n.selectable,locked:!!n.locked,grabbed:!1,grabbable:n.grabbable===void 0?!0:!!n.grabbable,pannable:n.pannable===void 0?i==="edges":!!n.pannable,active:!1,classes:new Us,animation:{current:[],queue:[]},rscratch:{},scratch:n.scratch||{},edges:[],children:[],parent:n.parent&&n.parent.isNode()?n.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(l.position.x==null&&(l.position.x=0),l.position.y==null&&(l.position.y=0),n.renderedPosition){var s=n.renderedPosition,u=e.pan(),f=e.zoom();l.position={x:(s.x-u.x)/f,y:(s.y-u.y)/f}}var c=[];an(n.classes)?c=n.classes:ct(n.classes)&&(c=n.classes.split(/\s+/));for(var h=0,v=c.length;h<v;h++){var p=c[h];!p||p===""||l.classes.add(p)}this.createEmitter(),(r===void 0||r)&&this.restore();var m=n.style||n.css;m&&($t("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(m))},lx=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(r,i,l){var s;Ut(r)&&!Hr(r)&&(s=r,r=s.roots||s.root,i=s.visit,l=s.directed),l=arguments.length===2&&!xn(i)?i:l,i=xn(i)?i:function(){};for(var u=this._private.cy,f=r=ct(r)?this.filter(r):r,c=[],h=[],v={},p={},m={},y=0,S,w=this.byGroup(),E=w.nodes,C=w.edges,T=0;T<f.length;T++){var A=f[T],k=A.id();A.isNode()&&(c.unshift(A),e.bfs&&(m[k]=!0,h.push(A)),p[k]=0)}for(var N=function(){var j=e.bfs?c.shift():c.pop(),K=j.id();if(e.dfs){if(m[K])return 0;m[K]=!0,h.push(j)}var $=p[K],B=v[K],H=B!=null?B.source():null,Y=B!=null?B.target():null,Q=B==null?void 0:j.same(H)?Y[0]:H[0],z;if(z=i(j,B,Q,y++,$),z===!0)return S=j,1;if(z===!1)return 1;for(var F=j.connectedEdges().filter(function(se){return(!l||se.source().same(j))&&C.has(se)}),q=0;q<F.length;q++){var L=F[q],W=L.connectedNodes().filter(function(se){return!se.same(j)&&E.has(se)}),ae=W.id();W.length!==0&&!m[ae]&&(W=W[0],c.push(W),e.bfs&&(m[ae]=!0,h.push(W)),v[ae]=L,p[ae]=p[K]+1)}},_;c.length!==0&&(_=N(),!(_!==0&&_===1)););for(var O=u.collection(),U=0;U<h.length;U++){var M=h[U],I=v[M.id()];I!=null&&O.push(I),O.push(M)}return{path:u.collection(O),found:u.collection(S)}}},fu={breadthFirstSearch:lx({bfs:!0}),depthFirstSearch:lx({dfs:!0})};fu.bfs=fu.breadthFirstSearch;fu.dfs=fu.depthFirstSearch;var xf={exports:{}},Fk=xf.exports,sx;function Ik(){return sx||(sx=1,(function(t,e){(function(){var n,r,i,l,s,u,f,c,h,v,p,m,y,S,w;i=Math.floor,v=Math.min,r=function(E,C){return E<C?-1:E>C?1:0},h=function(E,C,T,A,k){var N;if(T==null&&(T=0),k==null&&(k=r),T<0)throw new Error("lo must be non-negative");for(A==null&&(A=E.length);T<A;)N=i((T+A)/2),k(C,E[N])<0?A=N:T=N+1;return[].splice.apply(E,[T,T-T].concat(C)),C},u=function(E,C,T){return T==null&&(T=r),E.push(C),S(E,0,E.length-1,T)},s=function(E,C){var T,A;return C==null&&(C=r),T=E.pop(),E.length?(A=E[0],E[0]=T,w(E,0,C)):A=T,A},c=function(E,C,T){var A;return T==null&&(T=r),A=E[0],E[0]=C,w(E,0,T),A},f=function(E,C,T){var A;return T==null&&(T=r),E.length&&T(E[0],C)<0&&(A=[E[0],C],C=A[0],E[0]=A[1],w(E,0,T)),C},l=function(E,C){var T,A,k,N,_,O;for(C==null&&(C=r),N=(function(){O=[];for(var U=0,M=i(E.length/2);0<=M?U<M:U>M;0<=M?U++:U--)O.push(U);return O}).apply(this).reverse(),_=[],A=0,k=N.length;A<k;A++)T=N[A],_.push(w(E,T,C));return _},y=function(E,C,T){var A;if(T==null&&(T=r),A=E.indexOf(C),A!==-1)return S(E,0,A,T),w(E,A,T)},p=function(E,C,T){var A,k,N,_,O;if(T==null&&(T=r),k=E.slice(0,C),!k.length)return k;for(l(k,T),O=E.slice(C),N=0,_=O.length;N<_;N++)A=O[N],f(k,A,T);return k.sort(T).reverse()},m=function(E,C,T){var A,k,N,_,O,U,M,I,P;if(T==null&&(T=r),C*10<=E.length){if(N=E.slice(0,C).sort(T),!N.length)return N;for(k=N[N.length-1],M=E.slice(C),_=0,U=M.length;_<U;_++)A=M[_],T(A,k)<0&&(h(N,A,0,null,T),N.pop(),k=N[N.length-1]);return N}for(l(E,T),P=[],O=0,I=v(C,E.length);0<=I?O<I:O>I;0<=I?++O:--O)P.push(s(E,T));return P},S=function(E,C,T,A){var k,N,_;for(A==null&&(A=r),k=E[T];T>C;){if(_=T-1>>1,N=E[_],A(k,N)<0){E[T]=N,T=_;continue}break}return E[T]=k},w=function(E,C,T){var A,k,N,_,O;for(T==null&&(T=r),k=E.length,O=C,N=E[C],A=2*C+1;A<k;)_=A+1,_<k&&!(T(E[A],E[_])<0)&&(A=_),E[C]=E[A],C=A,A=2*C+1;return E[C]=N,S(E,O,C,T)},n=(function(){E.push=u,E.pop=s,E.replace=c,E.pushpop=f,E.heapify=l,E.updateItem=y,E.nlargest=p,E.nsmallest=m;function E(C){this.cmp=C??r,this.nodes=[]}return E.prototype.push=function(C){return u(this.nodes,C,this.cmp)},E.prototype.pop=function(){return s(this.nodes,this.cmp)},E.prototype.peek=function(){return this.nodes[0]},E.prototype.contains=function(C){return this.nodes.indexOf(C)!==-1},E.prototype.replace=function(C){return c(this.nodes,C,this.cmp)},E.prototype.pushpop=function(C){return f(this.nodes,C,this.cmp)},E.prototype.heapify=function(){return l(this.nodes,this.cmp)},E.prototype.updateItem=function(C){return y(this.nodes,C,this.cmp)},E.prototype.clear=function(){return this.nodes=[]},E.prototype.empty=function(){return this.nodes.length===0},E.prototype.size=function(){return this.nodes.length},E.prototype.clone=function(){var C;return C=new E,C.nodes=this.nodes.slice(0),C},E.prototype.toArray=function(){return this.nodes.slice(0)},E.prototype.insert=E.prototype.push,E.prototype.top=E.prototype.peek,E.prototype.front=E.prototype.peek,E.prototype.has=E.prototype.contains,E.prototype.copy=E.prototype.clone,E})(),(function(E,C){return t.exports=C()})(this,function(){return n})}).call(Fk)})(xf)),xf.exports}var Gv,ox;function zk(){return ox||(ox=1,Gv=Ik()),Gv}var Pk=zk(),_u=Cu(Pk),Uk=ir({root:null,weight:function(e){return 1},directed:!1}),qk={dijkstra:function(e){if(!Ut(e)){var n=arguments;e={root:n[0],weight:n[1],directed:n[2]}}var r=Uk(e),i=r.root,l=r.weight,s=r.directed,u=this,f=l,c=ct(i)?this.filter(i)[0]:i[0],h={},v={},p={},m=this.byGroup(),y=m.nodes,S=m.edges;S.unmergeBy(function($){return $.isLoop()});for(var w=function(B){return h[B.id()]},E=function(B,H){h[B.id()]=H,C.updateItem(B)},C=new _u(function($,B){return w($)-w(B)}),T=0;T<y.length;T++){var A=y[T];h[A.id()]=A.same(c)?0:1/0,C.push(A)}for(var k=function(B,H){for(var Y=(s?B.edgesTo(H):B.edgesWith(H)).intersect(S),Q=1/0,z,F=0;F<Y.length;F++){var q=Y[F],L=f(q);(L<Q||!z)&&(Q=L,z=q)}return{edge:z,dist:Q}};C.size()>0;){var N=C.pop(),_=w(N),O=N.id();if(p[O]=_,_!==1/0)for(var U=N.neighborhood().intersect(y),M=0;M<U.length;M++){var I=U[M],P=I.id(),j=k(N,I),K=_+j.dist;K<w(I)&&(E(I,K),v[P]={node:N,edge:j.edge})}}return{distanceTo:function(B){var H=ct(B)?y.filter(B)[0]:B[0];return p[H.id()]},pathTo:function(B){var H=ct(B)?y.filter(B)[0]:B[0],Y=[],Q=H,z=Q.id();if(H.length>0)for(Y.unshift(H);v[z];){var F=v[z];Y.unshift(F.edge),Y.unshift(F.node),Q=F.node,z=Q.id()}return u.spawn(Y)}}}},jk={kruskal:function(e){e=e||function(T){return 1};for(var n=this.byGroup(),r=n.nodes,i=n.edges,l=r.length,s=new Array(l),u=r,f=function(A){for(var k=0;k<s.length;k++){var N=s[k];if(N.has(A))return k}},c=0;c<l;c++)s[c]=this.spawn(r[c]);for(var h=i.sort(function(T,A){return e(T)-e(A)}),v=0;v<h.length;v++){var p=h[v],m=p.source()[0],y=p.target()[0],S=f(m),w=f(y),E=s[S],C=s[w];S!==w&&(u.merge(p),E.merge(C),s.splice(w,1))}return u}},Hk=ir({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Gk={aStar:function(e){var n=this.cy(),r=Hk(e),i=r.root,l=r.goal,s=r.heuristic,u=r.directed,f=r.weight;i=n.collection(i)[0],l=n.collection(l)[0];var c=i.id(),h=l.id(),v={},p={},m={},y=new _u(function(z,F){return p[z.id()]-p[F.id()]}),S=new Us,w={},E={},C=function(F,q){y.push(F),S.add(q)},T,A,k=function(){T=y.pop(),A=T.id(),S.delete(A)},N=function(F){return S.has(F)};C(i,c),v[c]=0,p[c]=s(i);for(var _=0;y.size()>0;){if(k(),_++,A===h){for(var O=[],U=l,M=h,I=E[M];O.unshift(U),I!=null&&O.unshift(I),U=w[M],U!=null;)M=U.id(),I=E[M];return{found:!0,distance:v[A],path:this.spawn(O),steps:_}}m[A]=!0;for(var P=T._private.edges,j=0;j<P.length;j++){var K=P[j];if(this.hasElementWithId(K.id())&&!(u&&K.data("source")!==A)){var $=K.source(),B=K.target(),H=$.id()!==A?$:B,Y=H.id();if(this.hasElementWithId(Y)&&!m[Y]){var Q=v[A]+f(K);if(!N(Y)){v[Y]=Q,p[Y]=Q+s(H),C(H,Y),w[Y]=T,E[Y]=K;continue}Q<v[Y]&&(v[Y]=Q,p[Y]=Q+s(H),w[Y]=T,E[Y]=K)}}}}return{found:!1,distance:void 0,path:void 0,steps:_}}},Vk=ir({weight:function(e){return 1},directed:!1}),$k={floydWarshall:function(e){for(var n=this.cy(),r=Vk(e),i=r.weight,l=r.directed,s=i,u=this.byGroup(),f=u.nodes,c=u.edges,h=f.length,v=h*h,p=function(L){return f.indexOf(L)},m=function(L){return f[L]},y=new Array(v),S=0;S<v;S++){var w=S%h,E=(S-w)/h;E===w?y[S]=0:y[S]=1/0}for(var C=new Array(v),T=new Array(v),A=0;A<c.length;A++){var k=c[A],N=k.source()[0],_=k.target()[0];if(N!==_){var O=p(N),U=p(_),M=O*h+U,I=s(k);if(y[M]>I&&(y[M]=I,C[M]=U,T[M]=k),!l){var P=U*h+O;!l&&y[P]>I&&(y[P]=I,C[P]=O,T[P]=k)}}}for(var j=0;j<h;j++)for(var K=0;K<h;K++)for(var $=K*h+j,B=0;B<h;B++){var H=K*h+B,Y=j*h+B;y[$]+y[Y]<y[H]&&(y[H]=y[$]+y[Y],C[H]=C[$])}var Q=function(L){return(ct(L)?n.filter(L):L)[0]},z=function(L){return p(Q(L))},F={distance:function(L,W){var ae=z(L),se=z(W);return y[ae*h+se]},path:function(L,W){var ae=z(L),se=z(W),me=m(ae);if(ae===se)return me.collection();if(C[ae*h+se]==null)return n.collection();var Ne=n.collection(),pe=ae,ee;for(Ne.merge(me);ae!==se;)pe=ae,ae=C[ae*h+se],ee=T[pe*h+ae],Ne.merge(ee),Ne.merge(m(ae));return Ne}};return F}},Kk=ir({weight:function(e){return 1},directed:!1,root:null}),Yk={bellmanFord:function(e){var n=this,r=Kk(e),i=r.weight,l=r.directed,s=r.root,u=i,f=this,c=this.cy(),h=this.byGroup(),v=h.edges,p=h.nodes,m=p.length,y=new Ya,S=!1,w=[];s=c.collection(s)[0],v.unmergeBy(function(ot){return ot.isLoop()});for(var E=v.length,C=function(et){var We=y.get(et.id());return We||(We={},y.set(et.id(),We)),We},T=function(et){return(ct(et)?c.$(et):et)[0]},A=function(et){return C(T(et)).dist},k=function(et){for(var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,ze=T(et),Je=[],Ye=ze;;){if(Ye==null)return n.spawn();var ut=C(Ye),je=ut.edge,gt=ut.pred;if(Je.unshift(Ye[0]),Ye.same(We)&&Je.length>0)break;je!=null&&Je.unshift(je),Ye=gt}return f.spawn(Je)},N=0;N<m;N++){var _=p[N],O=C(_);_.same(s)?O.dist=0:O.dist=1/0,O.pred=null,O.edge=null}for(var U=!1,M=function(et,We,ze,Je,Ye,ut){var je=Je.dist+ut;je<Ye.dist&&!ze.same(Je.edge)&&(Ye.dist=je,Ye.pred=et,Ye.edge=ze,U=!0)},I=1;I<m;I++){U=!1;for(var P=0;P<E;P++){var j=v[P],K=j.source(),$=j.target(),B=u(j),H=C(K),Y=C($);M(K,$,j,H,Y,B),l||M($,K,j,Y,H,B)}if(!U)break}if(U)for(var Q=[],z=0;z<E;z++){var F=v[z],q=F.source(),L=F.target(),W=u(F),ae=C(q).dist,se=C(L).dist;if(ae+W<se||!l&&se+W<ae)if(S||($t("Graph contains a negative weight cycle for Bellman-Ford"),S=!0),e.findNegativeWeightCycles!==!1){var me=[];ae+W<se&&me.push(q),!l&&se+W<ae&&me.push(L);for(var Ne=me.length,pe=0;pe<Ne;pe++){var ee=me[pe],le=[ee];le.push(C(ee).edge);for(var fe=C(ee).pred;le.indexOf(fe)===-1;)le.push(fe),le.push(C(fe).edge),fe=C(fe).pred;le=le.slice(le.indexOf(fe));for(var xe=le[0].id(),Re=0,Xe=2;Xe<le.length;Xe+=2)le[Xe].id()<xe&&(xe=le[Xe].id(),Re=Xe);le=le.slice(Re).concat(le.slice(0,Re)),le.push(le[0]);var Ke=le.map(function(ot){return ot.id()}).join(",");Q.indexOf(Ke)===-1&&(w.push(f.spawn(le)),Q.push(Ke))}}else break}return{distanceTo:A,pathTo:k,hasNegativeWeightCycle:S,negativeWeightCycles:w}}},Xk=Math.sqrt(2),Zk=function(e,n,r){r.length===0&&gn("Karger-Stein must be run on a connected (sub)graph");for(var i=r[e],l=i[1],s=i[2],u=n[l],f=n[s],c=r,h=c.length-1;h>=0;h--){var v=c[h],p=v[1],m=v[2];(n[p]===u&&n[m]===f||n[p]===f&&n[m]===u)&&c.splice(h,1)}for(var y=0;y<c.length;y++){var S=c[y];S[1]===f?(c[y]=S.slice(),c[y][1]=u):S[2]===f&&(c[y]=S.slice(),c[y][2]=u)}for(var w=0;w<n.length;w++)n[w]===f&&(n[w]=u);return c},Vv=function(e,n,r,i){for(;r>i;){var l=Math.floor(Math.random()*n.length);n=Zk(l,e,n),r--}return n},Qk={kargerStein:function(){var e=this,n=this.byGroup(),r=n.nodes,i=n.edges;i.unmergeBy(function(Y){return Y.isLoop()});var l=r.length,s=i.length,u=Math.ceil(Math.pow(Math.log(l)/Math.LN2,2)),f=Math.floor(l/Xk);if(l<2){gn("At least 2 nodes are required for Karger-Stein algorithm");return}for(var c=[],h=0;h<s;h++){var v=i[h];c.push([h,r.indexOf(v.source()),r.indexOf(v.target())])}for(var p=1/0,m=[],y=new Array(l),S=new Array(l),w=new Array(l),E=function(Q,z){for(var F=0;F<l;F++)z[F]=Q[F]},C=0;C<=u;C++){for(var T=0;T<l;T++)S[T]=T;var A=Vv(S,c.slice(),l,f),k=A.slice();E(S,w);var N=Vv(S,A,f,2),_=Vv(w,k,f,2);N.length<=_.length&&N.length<p?(p=N.length,m=N,E(S,y)):_.length<=N.length&&_.length<p&&(p=_.length,m=_,E(w,y))}for(var O=this.spawn(m.map(function(Y){return i[Y[0]]})),U=this.spawn(),M=this.spawn(),I=y[0],P=0;P<y.length;P++){var j=y[P],K=r[P];j===I?U.merge(K):M.merge(K)}var $=function(Q){var z=e.spawn();return Q.forEach(function(F){z.merge(F),F.connectedEdges().forEach(function(q){e.contains(q)&&!O.contains(q)&&z.merge(q)})}),z},B=[$(U),$(M)],H={cut:O,components:B,partition1:U,partition2:M};return H}},$v,Wk=function(e){return{x:e.x,y:e.y}},nd=function(e,n,r){return{x:e.x*n+r.x,y:e.y*n+r.y}},GS=function(e,n,r){return{x:(e.x-r.x)/n,y:(e.y-r.y)/n}},_s=function(e){return{x:e[0],y:e[1]}},Jk=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,l=n;l<r;l++){var s=e[l];isFinite(s)&&(i=Math.min(s,i))}return i},e2=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,l=n;l<r;l++){var s=e[l];isFinite(s)&&(i=Math.max(s,i))}return i},t2=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,l=0,s=n;s<r;s++){var u=e[s];isFinite(u)&&(i+=u,l++)}return i/l},n2=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(n,r):(r<e.length&&e.splice(r,e.length-r),n>0&&e.splice(0,n));for(var u=0,f=e.length-1;f>=0;f--){var c=e[f];s?isFinite(c)||(e[f]=-1/0,u++):e.splice(f,1)}l&&e.sort(function(p,m){return p-m});var h=e.length,v=Math.floor(h/2);return h%2!==0?e[v+1+u]:(e[v-1+u]+e[v+u])/2},r2=function(e){return Math.PI*e/180},Jc=function(e,n){return Math.atan2(n,e)-Math.PI/2},dm=Math.log2||function(t){return Math.log(t)/Math.log(2)},hm=function(e){return e>0?1:e<0?-1:0},Sl=function(e,n){return Math.sqrt(ml(e,n))},ml=function(e,n){var r=n.x-e.x,i=n.y-e.y;return r*r+i*i},a2=function(e){for(var n=e.length,r=0,i=0;i<n;i++)r+=e[i];for(var l=0;l<n;l++)e[l]=e[l]/r;return e},Yn=function(e,n,r,i){return(1-i)*(1-i)*e+2*(1-i)*i*n+i*i*r},Rs=function(e,n,r,i){return{x:Yn(e.x,n.x,r.x,i),y:Yn(e.y,n.y,r.y,i)}},i2=function(e,n,r,i){var l={x:n.x-e.x,y:n.y-e.y},s=Sl(e,n),u={x:l.x/s,y:l.y/s};return r=r??0,i=i??r*s,{x:e.x+u.x*i,y:e.y+u.y*i}},du=function(e,n,r){return Math.max(e,Math.min(r,n))},br=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},l2=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},s2=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},o2=function(e,n){e.x1=Math.min(e.x1,n.x1),e.x2=Math.max(e.x2,n.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n.y1),e.y2=Math.max(e.y2,n.y2),e.h=e.y2-e.y1},VS=function(e,n,r){e.x1=Math.min(e.x1,n),e.x2=Math.max(e.x2,n),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r),e.y2=Math.max(e.y2,r),e.h=e.y2-e.y1},wf=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=n,e.x2+=n,e.y1-=n,e.y2+=n,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Sf=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],r,i,l,s;if(n.length===1)r=i=l=s=n[0];else if(n.length===2)r=l=n[0],s=i=n[1];else if(n.length===4){var u=Pn(n,4);r=u[0],i=u[1],l=u[2],s=u[3]}return e.x1-=s,e.x2+=i,e.y1-=r,e.y2+=l,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},ux=function(e,n){e.x1=n.x1,e.y1=n.y1,e.x2=n.x2,e.y2=n.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},vm=function(e,n){return!(e.x1>n.x2||n.x1>e.x2||e.x2<n.x1||n.x2<e.x1||e.y2<n.y1||n.y2<e.y1||e.y1>n.y2||n.y1>e.y2)},Mi=function(e,n,r){return e.x1<=n&&n<=e.x2&&e.y1<=r&&r<=e.y2},cx=function(e,n){return Mi(e,n.x,n.y)},$S=function(e,n){return Mi(e,n.x1,n.y1)&&Mi(e,n.x2,n.y2)},u2=($v=Math.hypot)!==null&&$v!==void 0?$v:function(t,e){return Math.sqrt(t*t+e*e)};function c2(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var n=function(O,U){return{x:O.x+U.x,y:O.y+U.y}},r=function(O,U){return{x:O.x-U.x,y:O.y-U.y}},i=function(O,U){return{x:O.x*U,y:O.y*U}},l=function(O,U){return O.x*U.y-O.y*U.x},s=function(O){var U=u2(O.x,O.y);return U===0?{x:0,y:0}:{x:O.x/U,y:O.y/U}},u=function(O){for(var U=0,M=0;M<O.length;M++){var I=O[M],P=O[(M+1)%O.length];U+=I.x*P.y-P.x*I.y}return U/2},f=function(O,U,M,I){var P=r(U,O),j=r(I,M),K=l(P,j);if(Math.abs(K)<1e-9)return n(O,i(P,.5));var $=l(r(M,O),j)/K;return n(O,i(P,$))},c=t.map(function(_){return{x:_.x,y:_.y}});u(c)<0&&c.reverse();for(var h=c.length,v=[],p=0;p<h;p++){var m=c[p],y=c[(p+1)%h],S=r(y,m),w=s({x:S.y,y:-S.x});v.push(w)}for(var E=v.map(function(_,O){var U=n(c[O],i(_,e)),M=n(c[(O+1)%h],i(_,e));return{p1:U,p2:M}}),C=[],T=0;T<h;T++){var A=E[(T-1+h)%h],k=E[T],N=f(A.p1,A.p2,k.p1,k.p2);C.push(N)}return C}function f2(t,e,n,r,i,l){var s=E2(t,e,n,r,i),u=c2(s,l),f=br();return u.forEach(function(c){return VS(f,c.x,c.y)}),f}var KS=function(e,n,r,i,l,s,u){var f=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",c=f==="auto"?zi(l,s):f,h=l/2,v=s/2;c=Math.min(c,h,v);var p=c!==h,m=c!==v,y;if(p){var S=r-h+c-u,w=i-v-u,E=r+h-c+u,C=w;if(y=Oi(e,n,r,i,S,w,E,C,!1),y.length>0)return y}if(m){var T=r+h+u,A=i-v+c-u,k=T,N=i+v-c+u;if(y=Oi(e,n,r,i,T,A,k,N,!1),y.length>0)return y}if(p){var _=r-h+c-u,O=i+v+u,U=r+h-c+u,M=O;if(y=Oi(e,n,r,i,_,O,U,M,!1),y.length>0)return y}if(m){var I=r-h-u,P=i-v+c-u,j=I,K=i+v-c+u;if(y=Oi(e,n,r,i,I,P,j,K,!1),y.length>0)return y}var $;{var B=r-h+c,H=i-v+c;if($=eu(e,n,r,i,B,H,c+u),$.length>0&&$[0]<=B&&$[1]<=H)return[$[0],$[1]]}{var Y=r+h-c,Q=i-v+c;if($=eu(e,n,r,i,Y,Q,c+u),$.length>0&&$[0]>=Y&&$[1]<=Q)return[$[0],$[1]]}{var z=r+h-c,F=i+v-c;if($=eu(e,n,r,i,z,F,c+u),$.length>0&&$[0]>=z&&$[1]>=F)return[$[0],$[1]]}{var q=r-h+c,L=i+v-c;if($=eu(e,n,r,i,q,L,c+u),$.length>0&&$[0]<=q&&$[1]>=L)return[$[0],$[1]]}return[]},d2=function(e,n,r,i,l,s,u){var f=u,c=Math.min(r,l),h=Math.max(r,l),v=Math.min(i,s),p=Math.max(i,s);return c-f<=e&&e<=h+f&&v-f<=n&&n<=p+f},h2=function(e,n,r,i,l,s,u,f,c){var h={x1:Math.min(r,u,l)-c,x2:Math.max(r,u,l)+c,y1:Math.min(i,f,s)-c,y2:Math.max(i,f,s)+c};return!(e<h.x1||e>h.x2||n<h.y1||n>h.y2)},v2=function(e,n,r,i){r-=i;var l=n*n-4*e*r;if(l<0)return[];var s=Math.sqrt(l),u=2*e,f=(-n+s)/u,c=(-n-s)/u;return[f,c]},g2=function(e,n,r,i,l){var s=1e-5;e===0&&(e=s),n/=e,r/=e,i/=e;var u,f,c,h,v,p,m,y;if(f=(3*r-n*n)/9,c=-(27*i)+n*(9*r-2*(n*n)),c/=54,u=f*f*f+c*c,l[1]=0,m=n/3,u>0){v=c+Math.sqrt(u),v=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),p=c-Math.sqrt(u),p=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),l[0]=-m+v+p,m+=(v+p)/2,l[4]=l[2]=-m,m=Math.sqrt(3)*(-p+v)/2,l[3]=m,l[5]=-m;return}if(l[5]=l[3]=0,u===0){y=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),l[0]=-m+2*y,l[4]=l[2]=-(y+m);return}f=-f,h=f*f*f,h=Math.acos(c/Math.sqrt(h)),y=2*Math.sqrt(f),l[0]=-m+y*Math.cos(h/3),l[2]=-m+y*Math.cos((h+2*Math.PI)/3),l[4]=-m+y*Math.cos((h+4*Math.PI)/3)},p2=function(e,n,r,i,l,s,u,f){var c=1*r*r-4*r*l+2*r*u+4*l*l-4*l*u+u*u+i*i-4*i*s+2*i*f+4*s*s-4*s*f+f*f,h=9*r*l-3*r*r-3*r*u-6*l*l+3*l*u+9*i*s-3*i*i-3*i*f-6*s*s+3*s*f,v=3*r*r-6*r*l+r*u-r*e+2*l*l+2*l*e-u*e+3*i*i-6*i*s+i*f-i*n+2*s*s+2*s*n-f*n,p=1*r*l-r*r+r*e-l*e+i*s-i*i+i*n-s*n,m=[];g2(c,h,v,p,m);for(var y=1e-7,S=[],w=0;w<6;w+=2)Math.abs(m[w+1])<y&&m[w]>=0&&m[w]<=1&&S.push(m[w]);S.push(1),S.push(0);for(var E=-1,C,T,A,k=0;k<S.length;k++)C=Math.pow(1-S[k],2)*r+2*(1-S[k])*S[k]*l+S[k]*S[k]*u,T=Math.pow(1-S[k],2)*i+2*(1-S[k])*S[k]*s+S[k]*S[k]*f,A=Math.pow(C-e,2)+Math.pow(T-n,2),E>=0?A<E&&(E=A):E=A;return E},m2=function(e,n,r,i,l,s){var u=[e-r,n-i],f=[l-r,s-i],c=f[0]*f[0]+f[1]*f[1],h=u[0]*u[0]+u[1]*u[1],v=u[0]*f[0]+u[1]*f[1],p=v*v/c;return v<0?h:p>c?(e-l)*(e-l)+(n-s)*(n-s):h-p},Mr=function(e,n,r){for(var i,l,s,u,f,c=0,h=0;h<r.length/2;h++)if(i=r[h*2],l=r[h*2+1],h+1<r.length/2?(s=r[(h+1)*2],u=r[(h+1)*2+1]):(s=r[(h+1-r.length/2)*2],u=r[(h+1-r.length/2)*2+1]),!(i==e&&s==e))if(i>=e&&e>=s||i<=e&&e<=s)f=(e-i)/(s-i)*(u-l)+l,f>n&&c++;else continue;return c%2!==0},Za=function(e,n,r,i,l,s,u,f,c){var h=new Array(r.length),v;f[0]!=null?(v=Math.atan(f[1]/f[0]),f[0]<0?v=v+Math.PI/2:v=-v-Math.PI/2):v=f;for(var p=Math.cos(-v),m=Math.sin(-v),y=0;y<h.length/2;y++)h[y*2]=s/2*(r[y*2]*p-r[y*2+1]*m),h[y*2+1]=u/2*(r[y*2+1]*p+r[y*2]*m),h[y*2]+=i,h[y*2+1]+=l;var S;if(c>0){var w=zf(h,-c);S=If(w)}else S=h;return Mr(e,n,S)},y2=function(e,n,r,i,l,s,u,f){for(var c=new Array(r.length*2),h=0;h<f.length;h++){var v=f[h];c[h*4+0]=v.startX,c[h*4+1]=v.startY,c[h*4+2]=v.stopX,c[h*4+3]=v.stopY;var p=Math.pow(v.cx-e,2)+Math.pow(v.cy-n,2);if(p<=Math.pow(v.radius,2))return!0}return Mr(e,n,c)},If=function(e){for(var n=new Array(e.length/2),r,i,l,s,u,f,c,h,v=0;v<e.length/4;v++){r=e[v*4],i=e[v*4+1],l=e[v*4+2],s=e[v*4+3],v<e.length/4-1?(u=e[(v+1)*4],f=e[(v+1)*4+1],c=e[(v+1)*4+2],h=e[(v+1)*4+3]):(u=e[0],f=e[1],c=e[2],h=e[3]);var p=Oi(r,i,l,s,u,f,c,h,!0);n[v*2]=p[0],n[v*2+1]=p[1]}return n},zf=function(e,n){for(var r=new Array(e.length*2),i,l,s,u,f=0;f<e.length/2;f++){i=e[f*2],l=e[f*2+1],f<e.length/2-1?(s=e[(f+1)*2],u=e[(f+1)*2+1]):(s=e[0],u=e[1]);var c=u-l,h=-(s-i),v=Math.sqrt(c*c+h*h),p=c/v,m=h/v;r[f*4]=i+p*n,r[f*4+1]=l+m*n,r[f*4+2]=s+p*n,r[f*4+3]=u+m*n}return r},b2=function(e,n,r,i,l,s){var u=r-e,f=i-n;u/=l,f/=s;var c=Math.sqrt(u*u+f*f),h=c-1;if(h<0)return[];var v=h/c;return[(r-e)*v+e,(i-n)*v+n]},xl=function(e,n,r,i,l,s,u){return e-=l,n-=s,e/=r/2+u,n/=i/2+u,e*e+n*n<=1},eu=function(e,n,r,i,l,s,u){var f=[r-e,i-n],c=[e-l,n-s],h=f[0]*f[0]+f[1]*f[1],v=2*(c[0]*f[0]+c[1]*f[1]),p=c[0]*c[0]+c[1]*c[1]-u*u,m=v*v-4*h*p;if(m<0)return[];var y=(-v+Math.sqrt(m))/(2*h),S=(-v-Math.sqrt(m))/(2*h),w=Math.min(y,S),E=Math.max(y,S),C=[];if(w>=0&&w<=1&&C.push(w),E>=0&&E<=1&&C.push(E),C.length===0)return[];var T=C[0]*f[0]+e,A=C[0]*f[1]+n;if(C.length>1){if(C[0]==C[1])return[T,A];var k=C[1]*f[0]+e,N=C[1]*f[1]+n;return[T,A,k,N]}else return[T,A]},Kv=function(e,n,r){return n<=e&&e<=r||r<=e&&e<=n?e:e<=n&&n<=r||r<=n&&n<=e?n:r},Oi=function(e,n,r,i,l,s,u,f,c){var h=e-l,v=r-e,p=u-l,m=n-s,y=i-n,S=f-s,w=p*m-S*h,E=v*m-y*h,C=S*v-p*y;if(C!==0){var T=w/C,A=E/C,k=.001,N=0-k,_=1+k;return N<=T&&T<=_&&N<=A&&A<=_?[e+T*v,n+T*y]:c?[e+T*v,n+T*y]:[]}else return w===0||E===0?Kv(e,r,u)===u?[u,f]:Kv(e,r,l)===l?[l,s]:Kv(l,u,r)===r?[r,i]:[]:[]},E2=function(e,n,r,i,l){var s=[],u=i/2,f=l/2,c=n,h=r;s.push({x:c+u*e[0],y:h+f*e[1]});for(var v=1;v<e.length/2;v++)s.push({x:c+u*e[v*2],y:h+f*e[v*2+1]});return s},hu=function(e,n,r,i,l,s,u,f){var c=[],h,v=new Array(r.length),p=!0;s==null&&(p=!1);var m;if(p){for(var y=0;y<v.length/2;y++)v[y*2]=r[y*2]*s+i,v[y*2+1]=r[y*2+1]*u+l;if(f>0){var S=zf(v,-f);m=If(S)}else m=v}else m=r;for(var w,E,C,T,A=0;A<m.length/2;A++)w=m[A*2],E=m[A*2+1],A<m.length/2-1?(C=m[(A+1)*2],T=m[(A+1)*2+1]):(C=m[0],T=m[1]),h=Oi(e,n,i,l,w,E,C,T),h.length!==0&&c.push(h[0],h[1]);return c},x2=function(e,n,r,i,l,s,u,f,c){var h=[],v,p=new Array(r.length*2);c.forEach(function(C,T){T===0?(p[p.length-2]=C.startX,p[p.length-1]=C.startY):(p[T*4-2]=C.startX,p[T*4-1]=C.startY),p[T*4]=C.stopX,p[T*4+1]=C.stopY,v=eu(e,n,i,l,C.cx,C.cy,C.radius),v.length!==0&&h.push(v[0],v[1])});for(var m=0;m<p.length/4;m++)v=Oi(e,n,i,l,p[m*4],p[m*4+1],p[m*4+2],p[m*4+3],!1),v.length!==0&&h.push(v[0],v[1]);if(h.length>2){for(var y=[h[0],h[1]],S=Math.pow(y[0]-e,2)+Math.pow(y[1]-n,2),w=1;w<h.length/2;w++){var E=Math.pow(h[w*2]-e,2)+Math.pow(h[w*2+1]-n,2);E<=S&&(y[0]=h[w*2],y[1]=h[w*2+1],S=E)}return y}return h},ef=function(e,n,r){var i=[e[0]-n[0],e[1]-n[1]],l=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=(l-r)/l;return s<0&&(s=1e-5),[n[0]+s*i[0],n[1]+s*i[1]]},pr=function(e,n){var r=Ap(e,n);return r=YS(r),r},YS=function(e){for(var n,r,i=e.length/2,l=1/0,s=1/0,u=-1/0,f=-1/0,c=0;c<i;c++)n=e[2*c],r=e[2*c+1],l=Math.min(l,n),u=Math.max(u,n),s=Math.min(s,r),f=Math.max(f,r);for(var h=2/(u-l),v=2/(f-s),p=0;p<i;p++)n=e[2*p]=e[2*p]*h,r=e[2*p+1]=e[2*p+1]*v,l=Math.min(l,n),u=Math.max(u,n),s=Math.min(s,r),f=Math.max(f,r);if(s<-1)for(var m=0;m<i;m++)r=e[2*m+1]=e[2*m+1]+(-1-s);return e},Ap=function(e,n){var r=1/e*2*Math.PI,i=e%2===0?Math.PI/2+r/2:Math.PI/2;i+=n;for(var l=new Array(e*2),s,u=0;u<e;u++)s=u*r+i,l[2*u]=Math.cos(s),l[2*u+1]=Math.sin(-s);return l},zi=function(e,n){return Math.min(e/4,n/4,8)},XS=function(e,n){return Math.min(e/10,n/10,8)},gm=function(){return 8},w2=function(e,n,r){return[e-2*n+r,2*(n-e),e]},_p=function(e,n){return{heightOffset:Math.min(15,.05*n),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function Yv(t,e){function n(v){for(var p=[],m=0;m<v.length;m++){var y=v[m],S=v[(m+1)%v.length],w={x:S.x-y.x,y:S.y-y.y},E={x:-w.y,y:w.x},C=Math.sqrt(E.x*E.x+E.y*E.y);p.push({x:E.x/C,y:E.y/C})}return p}function r(v,p){var m=1/0,y=-1/0,S=Or(v),w;try{for(S.s();!(w=S.n()).done;){var E=w.value,C=E.x*p.x+E.y*p.y;m=Math.min(m,C),y=Math.max(y,C)}}catch(T){S.e(T)}finally{S.f()}return{min:m,max:y}}function i(v,p){return!(v.max<p.min||p.max<v.min)}var l=[].concat(Of(n(t)),Of(n(e))),s=Or(l),u;try{for(s.s();!(u=s.n()).done;){var f=u.value,c=r(t,f),h=r(e,f);if(!i(c,h))return!1}}catch(v){s.e(v)}finally{s.f()}return!0}var S2=ir({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),C2={pageRank:function(e){for(var n=S2(e),r=n.dampingFactor,i=n.precision,l=n.iterations,s=n.weight,u=this._private.cy,f=this.byGroup(),c=f.nodes,h=f.edges,v=c.length,p=v*v,m=h.length,y=new Array(p),S=new Array(v),w=(1-r)/v,E=0;E<v;E++){for(var C=0;C<v;C++){var T=E*v+C;y[T]=0}S[E]=0}for(var A=0;A<m;A++){var k=h[A],N=k.data("source"),_=k.data("target");if(N!==_){var O=c.indexOfId(N),U=c.indexOfId(_),M=s(k),I=U*v+O;y[I]+=M,S[O]+=M}}for(var P=1/v+w,j=0;j<v;j++)if(S[j]===0)for(var K=0;K<v;K++){var $=K*v+j;y[$]=P}else for(var B=0;B<v;B++){var H=B*v+j;y[H]=y[H]/S[j]+w}for(var Y=new Array(v),Q=new Array(v),z,F=0;F<v;F++)Y[F]=1;for(var q=0;q<l;q++){for(var L=0;L<v;L++)Q[L]=0;for(var W=0;W<v;W++)for(var ae=0;ae<v;ae++){var se=W*v+ae;Q[W]+=y[se]*Y[ae]}a2(Q),z=Y,Y=Q,Q=z;for(var me=0,Ne=0;Ne<v;Ne++){var pe=z[Ne]-Y[Ne];me+=pe*pe}if(me<i)break}var ee={rank:function(fe){return fe=u.collection(fe)[0],Y[c.indexOf(fe)]}};return ee}},fx=ir({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Ms={degreeCentralityNormalized:function(e){e=fx(e);var n=this.cy(),r=this.nodes(),i=r.length;if(e.directed){for(var h={},v={},p=0,m=0,y=0;y<i;y++){var S=r[y],w=S.id();e.root=S;var E=this.degreeCentrality(e);p<E.indegree&&(p=E.indegree),m<E.outdegree&&(m=E.outdegree),h[w]=E.indegree,v[w]=E.outdegree}return{indegree:function(T){return p==0?0:(ct(T)&&(T=n.filter(T)),h[T.id()]/p)},outdegree:function(T){return m===0?0:(ct(T)&&(T=n.filter(T)),v[T.id()]/m)}}}else{for(var l={},s=0,u=0;u<i;u++){var f=r[u];e.root=f;var c=this.degreeCentrality(e);s<c.degree&&(s=c.degree),l[f.id()]=c.degree}return{degree:function(T){return s===0?0:(ct(T)&&(T=n.filter(T)),l[T.id()]/s)}}}},degreeCentrality:function(e){e=fx(e);var n=this.cy(),r=this,i=e,l=i.root,s=i.weight,u=i.directed,f=i.alpha;if(l=n.collection(l)[0],u){for(var m=l.connectedEdges(),y=m.filter(function(N){return N.target().same(l)&&r.has(N)}),S=m.filter(function(N){return N.source().same(l)&&r.has(N)}),w=y.length,E=S.length,C=0,T=0,A=0;A<y.length;A++)C+=s(y[A]);for(var k=0;k<S.length;k++)T+=s(S[k]);return{indegree:Math.pow(w,1-f)*Math.pow(C,f),outdegree:Math.pow(E,1-f)*Math.pow(T,f)}}else{for(var c=l.connectedEdges().intersection(r),h=c.length,v=0,p=0;p<c.length;p++)v+=s(c[p]);return{degree:Math.pow(h,1-f)*Math.pow(v,f)}}}};Ms.dc=Ms.degreeCentrality;Ms.dcn=Ms.degreeCentralityNormalised=Ms.degreeCentralityNormalized;var dx=ir({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Os={closenessCentralityNormalized:function(e){for(var n=dx(e),r=n.harmonic,i=n.weight,l=n.directed,s=this.cy(),u={},f=0,c=this.nodes(),h=this.floydWarshall({weight:i,directed:l}),v=0;v<c.length;v++){for(var p=0,m=c[v],y=0;y<c.length;y++)if(v!==y){var S=h.distance(m,c[y]);r?p+=1/S:p+=S}r||(p=1/p),f<p&&(f=p),u[m.id()]=p}return{closeness:function(E){return f==0?0:(ct(E)?E=s.filter(E)[0].id():E=E.id(),u[E]/f)}}},closenessCentrality:function(e){var n=dx(e),r=n.root,i=n.weight,l=n.directed,s=n.harmonic;r=this.filter(r)[0];for(var u=this.dijkstra({root:r,weight:i,directed:l}),f=0,c=this.nodes(),h=0;h<c.length;h++){var v=c[h];if(!v.same(r)){var p=u.distanceTo(v);s?f+=1/p:f+=p}}return s?f:1/f}};Os.cc=Os.closenessCentrality;Os.ccn=Os.closenessCentralityNormalised=Os.closenessCentralityNormalized;var T2=ir({weight:null,directed:!1}),Np={betweennessCentrality:function(e){for(var n=T2(e),r=n.directed,i=n.weight,l=i!=null,s=this.cy(),u=this.nodes(),f={},c={},h=0,v={set:function(T,A){c[T]=A,A>h&&(h=A)},get:function(T){return c[T]}},p=0;p<u.length;p++){var m=u[p],y=m.id();r?f[y]=m.outgoers().nodes():f[y]=m.openNeighborhood().nodes(),v.set(y,0)}for(var S=function(){for(var T=u[w].id(),A=[],k={},N={},_={},O=new _u(function(W,ae){return _[W]-_[ae]}),U=0;U<u.length;U++){var M=u[U].id();k[M]=[],N[M]=0,_[M]=1/0}for(N[T]=1,_[T]=0,O.push(T);!O.empty();){var I=O.pop();if(A.push(I),l)for(var P=0;P<f[I].length;P++){var j=f[I][P],K=s.getElementById(I),$=void 0;K.edgesTo(j).length>0?$=K.edgesTo(j)[0]:$=j.edgesTo(K)[0];var B=i($);j=j.id(),_[j]>_[I]+B&&(_[j]=_[I]+B,O.nodes.indexOf(j)<0?O.push(j):O.updateItem(j),N[j]=0,k[j]=[]),_[j]==_[I]+B&&(N[j]=N[j]+N[I],k[j].push(I))}else for(var H=0;H<f[I].length;H++){var Y=f[I][H].id();_[Y]==1/0&&(O.push(Y),_[Y]=_[I]+1),_[Y]==_[I]+1&&(N[Y]=N[Y]+N[I],k[Y].push(I))}}for(var Q={},z=0;z<u.length;z++)Q[u[z].id()]=0;for(;A.length>0;){for(var F=A.pop(),q=0;q<k[F].length;q++){var L=k[F][q];Q[L]=Q[L]+N[L]/N[F]*(1+Q[F])}F!=u[w].id()&&v.set(F,v.get(F)+Q[F])}},w=0;w<u.length;w++)S();var E={betweenness:function(T){var A=s.collection(T).id();return v.get(A)},betweennessNormalized:function(T){if(h==0)return 0;var A=s.collection(T).id();return v.get(A)/h}};return E.betweennessNormalised=E.betweennessNormalized,E}};Np.bc=Np.betweennessCentrality;var D2=ir({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),A2=function(e){return D2(e)},_2=function(e,n){for(var r=0,i=0;i<n.length;i++)r+=n[i](e);return r},N2=function(e,n,r){for(var i=0;i<n;i++)e[i*n+i]=r},ZS=function(e,n){for(var r,i=0;i<n;i++){r=0;for(var l=0;l<n;l++)r+=e[l*n+i];for(var s=0;s<n;s++)e[s*n+i]=e[s*n+i]/r}},k2=function(e,n,r){for(var i=new Array(r*r),l=0;l<r;l++){for(var s=0;s<r;s++)i[l*r+s]=0;for(var u=0;u<r;u++)for(var f=0;f<r;f++)i[l*r+f]+=e[l*r+u]*n[u*r+f]}return i},R2=function(e,n,r){for(var i=e.slice(0),l=1;l<r;l++)e=k2(e,i,n);return e},M2=function(e,n,r){for(var i=new Array(n*n),l=0;l<n*n;l++)i[l]=Math.pow(e[l],r);return ZS(i,n),i},O2=function(e,n,r,i){for(var l=0;l<r;l++){var s=Math.round(e[l]*Math.pow(10,i))/Math.pow(10,i),u=Math.round(n[l]*Math.pow(10,i))/Math.pow(10,i);if(s!==u)return!1}return!0},B2=function(e,n,r,i){for(var l=[],s=0;s<n;s++){for(var u=[],f=0;f<n;f++)Math.round(e[s*n+f]*1e3)/1e3>0&&u.push(r[f]);u.length!==0&&l.push(i.collection(u))}return l},L2=function(e,n){for(var r=0;r<e.length;r++)if(!n[r]||e[r].id()!==n[r].id())return!1;return!0},F2=function(e){for(var n=0;n<e.length;n++)for(var r=0;r<e.length;r++)n!=r&&L2(e[n],e[r])&&e.splice(r,1);return e},hx=function(e){for(var n=this.nodes(),r=this.edges(),i=this.cy(),l=A2(e),s={},u=0;u<n.length;u++)s[n[u].id()]=u;for(var f=n.length,c=f*f,h=new Array(c),v,p=0;p<c;p++)h[p]=0;for(var m=0;m<r.length;m++){var y=r[m],S=s[y.source().id()],w=s[y.target().id()],E=_2(y,l.attributes);h[S*f+w]+=E,h[w*f+S]+=E}N2(h,f,l.multFactor),ZS(h,f);for(var C=!0,T=0;C&&T<l.maxIterations;)C=!1,v=R2(h,f,l.expandFactor),h=M2(v,f,l.inflateFactor),O2(h,v,c,4)||(C=!0),T++;var A=B2(h,f,n,i);return A=F2(A),A},I2={markovClustering:hx,mcl:hx},z2=function(e){return e},QS=function(e,n){return Math.abs(n-e)},vx=function(e,n,r){return e+QS(n,r)},gx=function(e,n,r){return e+Math.pow(r-n,2)},P2=function(e){return Math.sqrt(e)},U2=function(e,n,r){return Math.max(e,QS(n,r))},qo=function(e,n,r,i,l){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:z2,u=i,f,c,h=0;h<e;h++)f=n(h),c=r(h),u=l(u,f,c);return s(u)},Is={euclidean:function(e,n,r){return e>=2?qo(e,n,r,0,gx,P2):qo(e,n,r,0,vx)},squaredEuclidean:function(e,n,r){return qo(e,n,r,0,gx)},manhattan:function(e,n,r){return qo(e,n,r,0,vx)},max:function(e,n,r){return qo(e,n,r,-1/0,U2)}};Is["squared-euclidean"]=Is.squaredEuclidean;Is.squaredeuclidean=Is.squaredEuclidean;function rd(t,e,n,r,i,l){var s;return xn(t)?s=t:s=Is[t]||Is.euclidean,e===0&&xn(t)?s(i,l):s(e,n,r,i,l)}var q2=ir({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),pm=function(e){return q2(e)},Pf=function(e,n,r,i,l){var s=l!=="kMedoids",u=s?function(v){return r[v]}:function(v){return i[v](r)},f=function(p){return i[p](n)},c=r,h=n;return rd(e,i.length,u,f,c,h)},Xv=function(e,n,r){for(var i=r.length,l=new Array(i),s=new Array(i),u=new Array(n),f=null,c=0;c<i;c++)l[c]=e.min(r[c]).value,s[c]=e.max(r[c]).value;for(var h=0;h<n;h++){f=[];for(var v=0;v<i;v++)f[v]=Math.random()*(s[v]-l[v])+l[v];u[h]=f}return u},WS=function(e,n,r,i,l){for(var s=1/0,u=0,f=0;f<n.length;f++){var c=Pf(r,e,n[f],i,l);c<s&&(s=c,u=f)}return u},JS=function(e,n,r){for(var i=[],l=null,s=0;s<n.length;s++)l=n[s],r[l.id()]===e&&i.push(l);return i},j2=function(e,n,r){return Math.abs(n-e)<=r},H2=function(e,n,r){for(var i=0;i<e.length;i++)for(var l=0;l<e[i].length;l++){var s=Math.abs(e[i][l]-n[i][l]);if(s>r)return!1}return!0},G2=function(e,n,r){for(var i=0;i<r;i++)if(e===n[i])return!0;return!1},px=function(e,n){var r=new Array(n);if(e.length<50)for(var i=0;i<n;i++){for(var l=e[Math.floor(Math.random()*e.length)];G2(l,r,i);)l=e[Math.floor(Math.random()*e.length)];r[i]=l}else for(var s=0;s<n;s++)r[s]=e[Math.floor(Math.random()*e.length)];return r},mx=function(e,n,r){for(var i=0,l=0;l<n.length;l++)i+=Pf("manhattan",n[l],e,r,"kMedoids");return i},V2=function(e){var n=this.cy(),r=this.nodes(),i=null,l=pm(e),s=new Array(l.k),u={},f;l.testMode?typeof l.testCentroids=="number"?(l.testCentroids,f=Xv(r,l.k,l.attributes)):Gn(l.testCentroids)==="object"?f=l.testCentroids:f=Xv(r,l.k,l.attributes):f=Xv(r,l.k,l.attributes);for(var c=!0,h=0;c&&h<l.maxIterations;){for(var v=0;v<r.length;v++)i=r[v],u[i.id()]=WS(i,f,l.distance,l.attributes,"kMeans");c=!1;for(var p=0;p<l.k;p++){var m=JS(p,r,u);if(m.length!==0){for(var y=l.attributes.length,S=f[p],w=new Array(y),E=new Array(y),C=0;C<y;C++){E[C]=0;for(var T=0;T<m.length;T++)i=m[T],E[C]+=l.attributes[C](i);w[C]=E[C]/m.length,j2(w[C],S[C],l.sensitivityThreshold)||(c=!0)}f[p]=w,s[p]=n.collection(m)}}h++}return s},$2=function(e){var n=this.cy(),r=this.nodes(),i=null,l=pm(e),s=new Array(l.k),u,f={},c,h=new Array(l.k);l.testMode?typeof l.testCentroids=="number"||(Gn(l.testCentroids)==="object"?u=l.testCentroids:u=px(r,l.k)):u=px(r,l.k);for(var v=!0,p=0;v&&p<l.maxIterations;){for(var m=0;m<r.length;m++)i=r[m],f[i.id()]=WS(i,u,l.distance,l.attributes,"kMedoids");v=!1;for(var y=0;y<u.length;y++){var S=JS(y,r,f);if(S.length!==0){h[y]=mx(u[y],S,l.attributes);for(var w=0;w<S.length;w++)c=mx(S[w],S,l.attributes),c<h[y]&&(h[y]=c,u[y]=S[w],v=!0);s[y]=n.collection(S)}}p++}return s},K2=function(e,n,r,i,l){for(var s,u,f=0;f<n.length;f++)for(var c=0;c<e.length;c++)i[f][c]=Math.pow(r[f][c],l.m);for(var h=0;h<e.length;h++)for(var v=0;v<l.attributes.length;v++){s=0,u=0;for(var p=0;p<n.length;p++)s+=i[p][h]*l.attributes[v](n[p]),u+=i[p][h];e[h][v]=s/u}},Y2=function(e,n,r,i,l){for(var s=0;s<e.length;s++)n[s]=e[s].slice();for(var u,f,c,h=2/(l.m-1),v=0;v<r.length;v++)for(var p=0;p<i.length;p++){u=0;for(var m=0;m<r.length;m++)f=Pf(l.distance,i[p],r[v],l.attributes,"cmeans"),c=Pf(l.distance,i[p],r[m],l.attributes,"cmeans"),u+=Math.pow(f/c,h);e[p][v]=1/u}},X2=function(e,n,r,i){for(var l=new Array(r.k),s=0;s<l.length;s++)l[s]=[];for(var u,f,c=0;c<n.length;c++){u=-1/0,f=-1;for(var h=0;h<n[0].length;h++)n[c][h]>u&&(u=n[c][h],f=h);l[f].push(e[c])}for(var v=0;v<l.length;v++)l[v]=i.collection(l[v]);return l},yx=function(e){var n=this.cy(),r=this.nodes(),i=pm(e),l,s,u,f,c;f=new Array(r.length);for(var h=0;h<r.length;h++)f[h]=new Array(i.k);u=new Array(r.length);for(var v=0;v<r.length;v++)u[v]=new Array(i.k);for(var p=0;p<r.length;p++){for(var m=0,y=0;y<i.k;y++)u[p][y]=Math.random(),m+=u[p][y];for(var S=0;S<i.k;S++)u[p][S]=u[p][S]/m}s=new Array(i.k);for(var w=0;w<i.k;w++)s[w]=new Array(i.attributes.length);c=new Array(r.length);for(var E=0;E<r.length;E++)c[E]=new Array(i.k);for(var C=!0,T=0;C&&T<i.maxIterations;)C=!1,K2(s,r,u,c,i),Y2(u,f,s,r,i),H2(u,f,i.sensitivityThreshold)||(C=!0),T++;return l=X2(r,u,i,n),{clusters:l,degreeOfMembership:u}},Z2={kMeans:V2,kMedoids:$2,fuzzyCMeans:yx,fcm:yx},Q2=ir({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),W2={single:"min",complete:"max"},J2=function(e){var n=Q2(e),r=W2[n.linkage];return r!=null&&(n.linkage=r),n},bx=function(e,n,r,i,l){for(var s=0,u=1/0,f,c=l.attributes,h=function(U,M){return rd(l.distance,c.length,function(I){return c[I](U)},function(I){return c[I](M)},U,M)},v=0;v<e.length;v++){var p=e[v].key,m=r[p][i[p]];m<u&&(s=p,u=m)}if(l.mode==="threshold"&&u>=l.threshold||l.mode==="dendrogram"&&e.length===1)return!1;var y=n[s],S=n[i[s]],w;l.mode==="dendrogram"?w={left:y,right:S,key:y.key}:w={value:y.value.concat(S.value),key:y.key},e[y.index]=w,e.splice(S.index,1),n[y.key]=w;for(var E=0;E<e.length;E++){var C=e[E];y.key===C.key?f=1/0:l.linkage==="min"?(f=r[y.key][C.key],r[y.key][C.key]>r[S.key][C.key]&&(f=r[S.key][C.key])):l.linkage==="max"?(f=r[y.key][C.key],r[y.key][C.key]<r[S.key][C.key]&&(f=r[S.key][C.key])):l.linkage==="mean"?f=(r[y.key][C.key]*y.size+r[S.key][C.key]*S.size)/(y.size+S.size):l.mode==="dendrogram"?f=h(C.value,y.value):f=h(C.value[0],y.value[0]),r[y.key][C.key]=r[C.key][y.key]=f}for(var T=0;T<e.length;T++){var A=e[T].key;if(i[A]===y.key||i[A]===S.key){for(var k=A,N=0;N<e.length;N++){var _=e[N].key;r[A][_]<r[A][k]&&(k=_)}i[A]=k}e[T].index=T}return y.key=S.key=y.index=S.index=null,!0},Ns=function(e,n,r){e&&(e.value?n.push(e.value):(e.left&&Ns(e.left,n),e.right&&Ns(e.right,n)))},kp=function(e,n){if(!e)return"";if(e.left&&e.right){var r=kp(e.left,n),i=kp(e.right,n),l=n.add({group:"nodes",data:{id:r+","+i}});return n.add({group:"edges",data:{source:r,target:l.id()}}),n.add({group:"edges",data:{source:i,target:l.id()}}),l.id()}else if(e.value)return e.value.id()},Rp=function(e,n,r){if(!e)return[];var i=[],l=[],s=[];return n===0?(e.left&&Ns(e.left,i),e.right&&Ns(e.right,l),s=i.concat(l),[r.collection(s)]):n===1?e.value?[r.collection(e.value)]:(e.left&&Ns(e.left,i),e.right&&Ns(e.right,l),[r.collection(i),r.collection(l)]):e.value?[r.collection(e.value)]:(e.left&&(i=Rp(e.left,n-1,r)),e.right&&(l=Rp(e.right,n-1,r)),i.concat(l))},Ex=function(e){for(var n=this.cy(),r=this.nodes(),i=J2(e),l=i.attributes,s=function(T,A){return rd(i.distance,l.length,function(k){return l[k](T)},function(k){return l[k](A)},T,A)},u=[],f=[],c=[],h=[],v=0;v<r.length;v++){var p={value:i.mode==="dendrogram"?r[v]:[r[v]],key:v,index:v};u[v]=p,h[v]=p,f[v]=[],c[v]=0}for(var m=0;m<u.length;m++)for(var y=0;y<=m;y++){var S=void 0;i.mode==="dendrogram"?S=m===y?1/0:s(u[m].value,u[y].value):S=m===y?1/0:s(u[m].value[0],u[y].value[0]),f[m][y]=S,f[y][m]=S,S<f[m][c[m]]&&(c[m]=y)}for(var w=bx(u,h,f,c,i);w;)w=bx(u,h,f,c,i);var E;return i.mode==="dendrogram"?(E=Rp(u[0],i.dendrogramDepth,n),i.addDendrogram&&kp(u[0],n)):(E=new Array(u.length),u.forEach(function(C,T){C.key=C.index=null,E[T]=n.collection(C.value)})),E},eR={hierarchicalClustering:Ex,hca:Ex},tR=ir({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),nR=function(e){var n=e.damping,r=e.preference;.5<=n&&n<1||gn("Damping must range on [0.5, 1). Got: ".concat(n));var i=["median","mean","min","max"];return i.some(function(l){return l===r})||Ge(r)||gn("Preference must be one of [".concat(i.map(function(l){return"'".concat(l,"'")}).join(", "),"] or a number. Got: ").concat(r)),tR(e)},rR=function(e,n,r,i){var l=function(u,f){return i[f](u)};return-rd(e,i.length,function(s){return l(n,s)},function(s){return l(r,s)},n,r)},aR=function(e,n){var r=null;return n==="median"?r=n2(e):n==="mean"?r=t2(e):n==="min"?r=Jk(e):n==="max"?r=e2(e):r=n,r},iR=function(e,n,r){for(var i=[],l=0;l<e;l++)n[l*e+l]+r[l*e+l]>0&&i.push(l);return i},xx=function(e,n,r){for(var i=[],l=0;l<e;l++){for(var s=-1,u=-1/0,f=0;f<r.length;f++){var c=r[f];n[l*e+c]>u&&(s=c,u=n[l*e+c])}s>0&&i.push(s)}for(var h=0;h<r.length;h++)i[r[h]]=r[h];return i},lR=function(e,n,r){for(var i=xx(e,n,r),l=0;l<r.length;l++){for(var s=[],u=0;u<i.length;u++)i[u]===r[l]&&s.push(u);for(var f=-1,c=-1/0,h=0;h<s.length;h++){for(var v=0,p=0;p<s.length;p++)v+=n[s[p]*e+s[h]];v>c&&(f=h,c=v)}r[l]=s[f]}return i=xx(e,n,r),i},wx=function(e){for(var n=this.cy(),r=this.nodes(),i=nR(e),l={},s=0;s<r.length;s++)l[r[s].id()]=s;var u,f,c,h,v,p;u=r.length,f=u*u,c=new Array(f);for(var m=0;m<f;m++)c[m]=-1/0;for(var y=0;y<u;y++)for(var S=0;S<u;S++)y!==S&&(c[y*u+S]=rR(i.distance,r[y],r[S],i.attributes));h=aR(c,i.preference);for(var w=0;w<u;w++)c[w*u+w]=h;v=new Array(f);for(var E=0;E<f;E++)v[E]=0;p=new Array(f);for(var C=0;C<f;C++)p[C]=0;for(var T=new Array(u),A=new Array(u),k=new Array(u),N=0;N<u;N++)T[N]=0,A[N]=0,k[N]=0;for(var _=new Array(u*i.minIterations),O=0;O<_.length;O++)_[O]=0;var U;for(U=0;U<i.maxIterations;U++){for(var M=0;M<u;M++){for(var I=-1/0,P=-1/0,j=-1,K=0,$=0;$<u;$++)T[$]=v[M*u+$],K=p[M*u+$]+c[M*u+$],K>=I?(P=I,I=K,j=$):K>P&&(P=K);for(var B=0;B<u;B++)v[M*u+B]=(1-i.damping)*(c[M*u+B]-I)+i.damping*T[B];v[M*u+j]=(1-i.damping)*(c[M*u+j]-P)+i.damping*T[j]}for(var H=0;H<u;H++){for(var Y=0,Q=0;Q<u;Q++)T[Q]=p[Q*u+H],A[Q]=Math.max(0,v[Q*u+H]),Y+=A[Q];Y-=A[H],A[H]=v[H*u+H],Y+=A[H];for(var z=0;z<u;z++)p[z*u+H]=(1-i.damping)*Math.min(0,Y-A[z])+i.damping*T[z];p[H*u+H]=(1-i.damping)*(Y-A[H])+i.damping*T[H]}for(var F=0,q=0;q<u;q++){var L=p[q*u+q]+v[q*u+q]>0?1:0;_[U%i.minIterations*u+q]=L,F+=L}if(F>0&&(U>=i.minIterations-1||U==i.maxIterations-1)){for(var W=0,ae=0;ae<u;ae++){k[ae]=0;for(var se=0;se<i.minIterations;se++)k[ae]+=_[se*u+ae];(k[ae]===0||k[ae]===i.minIterations)&&W++}if(W===u)break}}for(var me=iR(u,v,p),Ne=lR(u,c,me),pe={},ee=0;ee<me.length;ee++)pe[me[ee]]=[];for(var le=0;le<r.length;le++){var fe=l[r[le].id()],xe=Ne[fe];xe!=null&&pe[xe].push(r[le])}for(var Re=new Array(me.length),Xe=0;Xe<me.length;Xe++)Re[Xe]=n.collection(pe[me[Xe]]);return Re},sR={affinityPropagation:wx,ap:wx},oR=ir({root:void 0,directed:!1}),uR={hierholzer:function(e){if(!Ut(e)){var n=arguments;e={root:n[0],directed:n[1]}}var r=oR(e),i=r.root,l=r.directed,s=this,u=!1,f,c,h;i&&(h=ct(i)?this.filter(i)[0].id():i[0].id());var v={},p={};l?s.forEach(function(C){var T=C.id();if(C.isNode()){var A=C.indegree(!0),k=C.outdegree(!0),N=A-k,_=k-A;N==1?f?u=!0:f=T:_==1?c?u=!0:c=T:(_>1||N>1)&&(u=!0),v[T]=[],C.outgoers().forEach(function(O){O.isEdge()&&v[T].push(O.id())})}else p[T]=[void 0,C.target().id()]}):s.forEach(function(C){var T=C.id();if(C.isNode()){var A=C.degree(!0);A%2&&(f?c?u=!0:c=T:f=T),v[T]=[],C.connectedEdges().forEach(function(k){return v[T].push(k.id())})}else p[T]=[C.source().id(),C.target().id()]});var m={found:!1,trail:void 0};if(u)return m;if(c&&f)if(l){if(h&&c!=h)return m;h=c}else{if(h&&c!=h&&f!=h)return m;h||(h=c)}else h||(h=s[0].id());var y=function(T){for(var A=T,k=[T],N,_,O;v[A].length;)N=v[A].shift(),_=p[N][0],O=p[N][1],A!=O?(v[O]=v[O].filter(function(U){return U!=N}),A=O):!l&&A!=_&&(v[_]=v[_].filter(function(U){return U!=N}),A=_),k.unshift(N),k.unshift(A);return k},S=[],w=[];for(w=y(h);w.length!=1;)v[w[0]].length==0?(S.unshift(s.getElementById(w.shift())),S.unshift(s.getElementById(w.shift()))):w=y(w.shift()).concat(w);S.unshift(s.getElementById(w.shift()));for(var E in v)if(v[E].length)return m;return m.found=!0,m.trail=this.spawn(S,!0),m}},tf=function(){var e=this,n={},r=0,i=0,l=[],s=[],u={},f=function(p,m){for(var y=s.length-1,S=[],w=e.spawn();s[y].x!=p||s[y].y!=m;)S.push(s.pop().edge),y--;S.push(s.pop().edge),S.forEach(function(E){var C=E.connectedNodes().intersection(e);w.merge(E),C.forEach(function(T){var A=T.id(),k=T.connectedEdges().intersection(e);w.merge(T),n[A].cutVertex?w.merge(k.filter(function(N){return N.isLoop()})):w.merge(k)})}),l.push(w)},c=function(p,m,y){p===y&&(i+=1),n[m]={id:r,low:r++,cutVertex:!1};var S=e.getElementById(m).connectedEdges().intersection(e);if(S.size()===0)l.push(e.spawn(e.getElementById(m)));else{var w,E,C,T;S.forEach(function(A){w=A.source().id(),E=A.target().id(),C=w===m?E:w,C!==y&&(T=A.id(),u[T]||(u[T]=!0,s.push({x:m,y:C,edge:A})),C in n?n[m].low=Math.min(n[m].low,n[C].id):(c(p,C,m),n[m].low=Math.min(n[m].low,n[C].low),n[m].id<=n[C].low&&(n[m].cutVertex=!0,f(m,C))))})}};e.forEach(function(v){if(v.isNode()){var p=v.id();p in n||(i=0,c(p,p),n[p].cutVertex=i>1)}});var h=Object.keys(n).filter(function(v){return n[v].cutVertex}).map(function(v){return e.getElementById(v)});return{cut:e.spawn(h),components:l}},cR={hopcroftTarjanBiconnected:tf,htbc:tf,htb:tf,hopcroftTarjanBiconnectedComponents:tf},nf=function(){var e=this,n={},r=0,i=[],l=[],s=e.spawn(e),u=function(c){l.push(c),n[c]={index:r,low:r++,explored:!1};var h=e.getElementById(c).connectedEdges().intersection(e);if(h.forEach(function(S){var w=S.target().id();w!==c&&(w in n||u(w),n[w].explored||(n[c].low=Math.min(n[c].low,n[w].low)))}),n[c].index===n[c].low){for(var v=e.spawn();;){var p=l.pop();if(v.merge(e.getElementById(p)),n[p].low=n[c].index,n[p].explored=!0,p===c)break}var m=v.edgesWith(v),y=v.merge(m);i.push(y),s=s.difference(y)}};return e.forEach(function(f){if(f.isNode()){var c=f.id();c in n||u(c)}}),{cut:s,components:i}},fR={tarjanStronglyConnected:nf,tsc:nf,tscc:nf,tarjanStronglyConnectedComponents:nf},eC={};[fu,qk,jk,Gk,$k,Yk,Qk,C2,Ms,Os,Np,I2,Z2,eR,sR,uR,cR,fR].forEach(function(t){vt(eC,t)});var tC=0,nC=1,rC=2,va=function(e){if(!(this instanceof va))return new va(e);this.id="Thenable/1.0.7",this.state=tC,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};va.prototype={fulfill:function(e){return Sx(this,nC,"fulfillValue",e)},reject:function(e){return Sx(this,rC,"rejectReason",e)},then:function(e,n){var r=this,i=new va;return r.onFulfilled.push(Tx(e,i,"fulfill")),r.onRejected.push(Tx(n,i,"reject")),aC(r),i.proxy}};var Sx=function(e,n,r,i){return e.state===tC&&(e.state=n,e[r]=i,aC(e)),e},aC=function(e){e.state===nC?Cx(e,"onFulfilled",e.fulfillValue):e.state===rC&&Cx(e,"onRejected",e.rejectReason)},Cx=function(e,n,r){if(e[n].length!==0){var i=e[n];e[n]=[];var l=function(){for(var u=0;u<i.length;u++)i[u](r)};typeof setImmediate=="function"?setImmediate(l):setTimeout(l,0)}},Tx=function(e,n,r){return function(i){if(typeof e!="function")n[r].call(n,i);else{var l;try{l=e(i)}catch(s){n.reject(s);return}iC(n,l)}}},iC=function(e,n){if(e===n||e.proxy===n){e.reject(new TypeError("cannot resolve promise with itself"));return}var r;if(Gn(n)==="object"&&n!==null||typeof n=="function")try{r=n.then}catch(l){e.reject(l);return}if(typeof r=="function"){var i=!1;try{r.call(n,function(l){i||(i=!0,l===n?e.reject(new TypeError("circular thenable chain")):iC(e,l))},function(l){i||(i=!0,e.reject(l))})}catch(l){i||e.reject(l)}return}e.fulfill(n)};va.all=function(t){return new va(function(e,n){for(var r=new Array(t.length),i=0,l=function(f,c){r[f]=c,i++,i===t.length&&e(r)},s=0;s<t.length;s++)(function(u){var f=t[u],c=f!=null&&f.then!=null;if(c)f.then(function(v){l(u,v)},function(v){n(v)});else{var h=f;l(u,h)}})(s)})};va.resolve=function(t){return new va(function(e,n){e(t)})};va.reject=function(t){return new va(function(e,n){n(t)})};var qs=typeof Promise<"u"?Promise:va,Mp=function(e,n,r){var i=lm(e),l=!i,s=this._private=vt({duration:1e3},n,r);if(s.target=e,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&&xn(s.complete)&&s.completes.push(s.complete),l){var u=e.position();s.startPosition=s.startPosition||{x:u.x,y:u.y},s.startStyle=s.startStyle||e.cy().style().getAnimationStartStyle(e,s.style)}if(i){var f=e.pan();s.startPan={x:f.x,y:f.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},Cl=Mp.prototype;vt(Cl,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var n,r=e.target._private.animation;e.queue?n=r.queue:n=r.current,n.push(this),Hr(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var n=this._private;return e===void 0?n.progress*n.duration:this.progress(e/n.duration)},progress:function(e){var n=this._private,r=n.playing;return e===void 0?n.progress:(r&&this.pause(),n.progress=e,n.started=!1,r&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,n=e.playing;n&&this.pause(),e.progress=1-e.progress,e.started=!1;var r=function(c,h){var v=e[c];v!=null&&(e[c]=e[h],e[h]=v)};if(r("zoom","startZoom"),r("pan","startPan"),r("position","startPosition"),e.style)for(var i=0;i<e.style.length;i++){var l=e.style[i],s=l.name,u=e.startStyle[s];e.startStyle[s]=l,e.style[i]=u}return n&&this.play(),this},promise:function(e){var n=this._private,r;switch(e){case"frame":r=n.frames;break;default:case"complete":case"completed":r=n.completes}return new qs(function(i,l){r.push(function(){i()})})}});Cl.complete=Cl.completed;Cl.run=Cl.play;Cl.running=Cl.playing;var dR={animated:function(){return function(){var n=this,r=n.length!==void 0,i=r?n:[n],l=this._private.cy||this;if(!l.styleEnabled())return!1;var s=i[0];if(s)return s._private.animation.current.length>0}},clearQueue:function(){return function(){var n=this,r=n.length!==void 0,i=r?n:[n],l=this._private.cy||this;if(!l.styleEnabled())return this;for(var s=0;s<i.length;s++){var u=i[s];u._private.animation.queue=[]}return this}},delay:function(){return function(n,r){var i=this._private.cy||this;return i.styleEnabled()?this.animate({delay:n,duration:n,complete:r}):this}},delayAnimation:function(){return function(n,r){var i=this._private.cy||this;return i.styleEnabled()?this.animation({delay:n,duration:n,complete:r}):this}},animation:function(){return function(n,r){var i=this,l=i.length!==void 0,s=l?i:[i],u=this._private.cy||this,f=!l,c=!f;if(!u.styleEnabled())return this;var h=u.style();n=vt({},n,r);var v=Object.keys(n).length===0;if(v)return new Mp(s[0],n);switch(n.duration===void 0&&(n.duration=400),n.duration){case"slow":n.duration=600;break;case"fast":n.duration=200;break}if(c&&(n.style=h.getPropsList(n.style||n.css),n.css=void 0),c&&n.renderedPosition!=null){var p=n.renderedPosition,m=u.pan(),y=u.zoom();n.position=GS(p,y,m)}if(f&&n.panBy!=null){var S=n.panBy,w=u.pan();n.pan={x:w.x+S.x,y:w.y+S.y}}var E=n.center||n.centre;if(f&&E!=null){var C=u.getCenterPan(E.eles,n.zoom);C!=null&&(n.pan=C)}if(f&&n.fit!=null){var T=n.fit,A=u.getFitViewport(T.eles||T.boundingBox,T.padding);A!=null&&(n.pan=A.pan,n.zoom=A.zoom)}if(f&&Ut(n.zoom)){var k=u.getZoomedViewport(n.zoom);k!=null?(k.zoomed&&(n.zoom=k.zoom),k.panned&&(n.pan=k.pan)):n.zoom=null}return new Mp(s[0],n)}},animate:function(){return function(n,r){var i=this,l=i.length!==void 0,s=l?i:[i],u=this._private.cy||this;if(!u.styleEnabled())return this;r&&(n=vt({},n,r));for(var f=0;f<s.length;f++){var c=s[f],h=c.animated()&&(n.queue===void 0||n.queue),v=c.animation(n,h?{queue:!0}:void 0);v.play()}return this}},stop:function(){return function(n,r){var i=this,l=i.length!==void 0,s=l?i:[i],u=this._private.cy||this;if(!u.styleEnabled())return this;for(var f=0;f<s.length;f++){for(var c=s[f],h=c._private,v=h.animation.current,p=0;p<v.length;p++){var m=v[p],y=m._private;r&&(y.duration=0)}n&&(h.animation.queue=[]),r||(h.animation.current=[])}return u.notify("draw"),this}}},Zv,Dx;function ad(){if(Dx)return Zv;Dx=1;var t=Array.isArray;return Zv=t,Zv}var Qv,Ax;function hR(){if(Ax)return Qv;Ax=1;var t=ad(),e=Du(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(l,s){if(t(l))return!1;var u=typeof l;return u=="number"||u=="symbol"||u=="boolean"||l==null||e(l)?!0:r.test(l)||!n.test(l)||s!=null&&l in Object(s)}return Qv=i,Qv}var Wv,_x;function vR(){if(_x)return Wv;_x=1;var t=LS(),e=Tu(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",l="[object Proxy]";function s(u){if(!e(u))return!1;var f=t(u);return f==r||f==i||f==n||f==l}return Wv=s,Wv}var Jv,Nx;function gR(){if(Nx)return Jv;Nx=1;var t=ed(),e=t["__core-js_shared__"];return Jv=e,Jv}var eg,kx;function pR(){if(kx)return eg;kx=1;var t=gR(),e=(function(){var r=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!e&&e in r}return eg=n,eg}var tg,Rx;function mR(){if(Rx)return tg;Rx=1;var t=Function.prototype,e=t.toString;function n(r){if(r!=null){try{return e.call(r)}catch{}try{return r+""}catch{}}return""}return tg=n,tg}var ng,Mx;function yR(){if(Mx)return ng;Mx=1;var t=vR(),e=pR(),n=Tu(),r=mR(),i=/[\\^$.*+?()[\]{}|]/g,l=/^\[object .+?Constructor\]$/,s=Function.prototype,u=Object.prototype,f=s.toString,c=u.hasOwnProperty,h=RegExp("^"+f.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(p){if(!n(p)||e(p))return!1;var m=t(p)?h:l;return m.test(r(p))}return ng=v,ng}var rg,Ox;function bR(){if(Ox)return rg;Ox=1;function t(e,n){return e?.[n]}return rg=t,rg}var ag,Bx;function mm(){if(Bx)return ag;Bx=1;var t=yR(),e=bR();function n(r,i){var l=e(r,i);return t(l)?l:void 0}return ag=n,ag}var ig,Lx;function id(){if(Lx)return ig;Lx=1;var t=mm(),e=t(Object,"create");return ig=e,ig}var lg,Fx;function ER(){if(Fx)return lg;Fx=1;var t=id();function e(){this.__data__=t?t(null):{},this.size=0}return lg=e,lg}var sg,Ix;function xR(){if(Ix)return sg;Ix=1;function t(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}return sg=t,sg}var og,zx;function wR(){if(zx)return og;zx=1;var t=id(),e="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(l){var s=this.__data__;if(t){var u=s[l];return u===e?void 0:u}return r.call(s,l)?s[l]:void 0}return og=i,og}var ug,Px;function SR(){if(Px)return ug;Px=1;var t=id(),e=Object.prototype,n=e.hasOwnProperty;function r(i){var l=this.__data__;return t?l[i]!==void 0:n.call(l,i)}return ug=r,ug}var cg,Ux;function CR(){if(Ux)return cg;Ux=1;var t=id(),e="__lodash_hash_undefined__";function n(r,i){var l=this.__data__;return this.size+=this.has(r)?0:1,l[r]=t&&i===void 0?e:i,this}return cg=n,cg}var fg,qx;function TR(){if(qx)return fg;qx=1;var t=ER(),e=xR(),n=wR(),r=SR(),i=CR();function l(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u<f;){var c=s[u];this.set(c[0],c[1])}}return l.prototype.clear=t,l.prototype.delete=e,l.prototype.get=n,l.prototype.has=r,l.prototype.set=i,fg=l,fg}var dg,jx;function DR(){if(jx)return dg;jx=1;function t(){this.__data__=[],this.size=0}return dg=t,dg}var hg,Hx;function lC(){if(Hx)return hg;Hx=1;function t(e,n){return e===n||e!==e&&n!==n}return hg=t,hg}var vg,Gx;function ld(){if(Gx)return vg;Gx=1;var t=lC();function e(n,r){for(var i=n.length;i--;)if(t(n[i][0],r))return i;return-1}return vg=e,vg}var gg,Vx;function AR(){if(Vx)return gg;Vx=1;var t=ld(),e=Array.prototype,n=e.splice;function r(i){var l=this.__data__,s=t(l,i);if(s<0)return!1;var u=l.length-1;return s==u?l.pop():n.call(l,s,1),--this.size,!0}return gg=r,gg}var pg,$x;function _R(){if($x)return pg;$x=1;var t=ld();function e(n){var r=this.__data__,i=t(r,n);return i<0?void 0:r[i][1]}return pg=e,pg}var mg,Kx;function NR(){if(Kx)return mg;Kx=1;var t=ld();function e(n){return t(this.__data__,n)>-1}return mg=e,mg}var yg,Yx;function kR(){if(Yx)return yg;Yx=1;var t=ld();function e(n,r){var i=this.__data__,l=t(i,n);return l<0?(++this.size,i.push([n,r])):i[l][1]=r,this}return yg=e,yg}var bg,Xx;function RR(){if(Xx)return bg;Xx=1;var t=DR(),e=AR(),n=_R(),r=NR(),i=kR();function l(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u<f;){var c=s[u];this.set(c[0],c[1])}}return l.prototype.clear=t,l.prototype.delete=e,l.prototype.get=n,l.prototype.has=r,l.prototype.set=i,bg=l,bg}var Eg,Zx;function MR(){if(Zx)return Eg;Zx=1;var t=mm(),e=ed(),n=t(e,"Map");return Eg=n,Eg}var xg,Qx;function OR(){if(Qx)return xg;Qx=1;var t=TR(),e=RR(),n=MR();function r(){this.size=0,this.__data__={hash:new t,map:new(n||e),string:new t}}return xg=r,xg}var wg,Wx;function BR(){if(Wx)return wg;Wx=1;function t(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}return wg=t,wg}var Sg,Jx;function sd(){if(Jx)return Sg;Jx=1;var t=BR();function e(n,r){var i=n.__data__;return t(r)?i[typeof r=="string"?"string":"hash"]:i.map}return Sg=e,Sg}var Cg,e1;function LR(){if(e1)return Cg;e1=1;var t=sd();function e(n){var r=t(this,n).delete(n);return this.size-=r?1:0,r}return Cg=e,Cg}var Tg,t1;function FR(){if(t1)return Tg;t1=1;var t=sd();function e(n){return t(this,n).get(n)}return Tg=e,Tg}var Dg,n1;function IR(){if(n1)return Dg;n1=1;var t=sd();function e(n){return t(this,n).has(n)}return Dg=e,Dg}var Ag,r1;function zR(){if(r1)return Ag;r1=1;var t=sd();function e(n,r){var i=t(this,n),l=i.size;return i.set(n,r),this.size+=i.size==l?0:1,this}return Ag=e,Ag}var _g,a1;function PR(){if(a1)return _g;a1=1;var t=OR(),e=LR(),n=FR(),r=IR(),i=zR();function l(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u<f;){var c=s[u];this.set(c[0],c[1])}}return l.prototype.clear=t,l.prototype.delete=e,l.prototype.get=n,l.prototype.has=r,l.prototype.set=i,_g=l,_g}var Ng,i1;function UR(){if(i1)return Ng;i1=1;var t=PR(),e="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var l=function(){var s=arguments,u=i?i.apply(this,s):s[0],f=l.cache;if(f.has(u))return f.get(u);var c=r.apply(this,s);return l.cache=f.set(u,c)||f,c};return l.cache=new(n.Cache||t),l}return n.Cache=t,Ng=n,Ng}var kg,l1;function qR(){if(l1)return kg;l1=1;var t=UR(),e=500;function n(r){var i=t(r,function(s){return l.size===e&&l.clear(),s}),l=i.cache;return i}return kg=n,kg}var Rg,s1;function sC(){if(s1)return Rg;s1=1;var t=qR(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=t(function(i){var l=[];return i.charCodeAt(0)===46&&l.push(""),i.replace(e,function(s,u,f,c){l.push(f?c.replace(n,"$1"):u||s)}),l});return Rg=r,Rg}var Mg,o1;function oC(){if(o1)return Mg;o1=1;function t(e,n){for(var r=-1,i=e==null?0:e.length,l=Array(i);++r<i;)l[r]=n(e[r],r,e);return l}return Mg=t,Mg}var Og,u1;function jR(){if(u1)return Og;u1=1;var t=om(),e=oC(),n=ad(),r=Du(),i=t?t.prototype:void 0,l=i?i.toString:void 0;function s(u){if(typeof u=="string")return u;if(n(u))return e(u,s)+"";if(r(u))return l?l.call(u):"";var f=u+"";return f=="0"&&1/u==-1/0?"-0":f}return Og=s,Og}var Bg,c1;function uC(){if(c1)return Bg;c1=1;var t=jR();function e(n){return n==null?"":t(n)}return Bg=e,Bg}var Lg,f1;function cC(){if(f1)return Lg;f1=1;var t=ad(),e=hR(),n=sC(),r=uC();function i(l,s){return t(l)?l:e(l,s)?[l]:n(r(l))}return Lg=i,Lg}var Fg,d1;function ym(){if(d1)return Fg;d1=1;var t=Du();function e(n){if(typeof n=="string"||t(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Fg=e,Fg}var Ig,h1;function HR(){if(h1)return Ig;h1=1;var t=cC(),e=ym();function n(r,i){i=t(i,r);for(var l=0,s=i.length;r!=null&&l<s;)r=r[e(i[l++])];return l&&l==s?r:void 0}return Ig=n,Ig}var zg,v1;function GR(){if(v1)return zg;v1=1;var t=HR();function e(n,r,i){var l=n==null?void 0:t(n,r);return l===void 0?i:l}return zg=e,zg}var VR=GR(),$R=Cu(VR),Pg,g1;function KR(){if(g1)return Pg;g1=1;var t=mm(),e=(function(){try{var n=t(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Pg=e,Pg}var Ug,p1;function YR(){if(p1)return Ug;p1=1;var t=KR();function e(n,r,i){r=="__proto__"&&t?t(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return Ug=e,Ug}var qg,m1;function XR(){if(m1)return qg;m1=1;var t=YR(),e=lC(),n=Object.prototype,r=n.hasOwnProperty;function i(l,s,u){var f=l[s];(!(r.call(l,s)&&e(f,u))||u===void 0&&!(s in l))&&t(l,s,u)}return qg=i,qg}var jg,y1;function ZR(){if(y1)return jg;y1=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function n(r,i){var l=typeof r;return i=i??t,!!i&&(l=="number"||l!="symbol"&&e.test(r))&&r>-1&&r%1==0&&r<i}return jg=n,jg}var Hg,b1;function QR(){if(b1)return Hg;b1=1;var t=XR(),e=cC(),n=ZR(),r=Tu(),i=ym();function l(s,u,f,c){if(!r(s))return s;u=e(u,s);for(var h=-1,v=u.length,p=v-1,m=s;m!=null&&++h<v;){var y=i(u[h]),S=f;if(y==="__proto__"||y==="constructor"||y==="prototype")return s;if(h!=p){var w=m[y];S=c?c(w,y,m):void 0,S===void 0&&(S=r(w)?w:n(u[h+1])?[]:{})}t(m,y,S),m=m[y]}return s}return Hg=l,Hg}var Gg,E1;function WR(){if(E1)return Gg;E1=1;var t=QR();function e(n,r,i){return n==null?n:t(n,r,i)}return Gg=e,Gg}var JR=WR(),eM=Cu(JR),Vg,x1;function tM(){if(x1)return Vg;x1=1;function t(e,n){var r=-1,i=e.length;for(n||(n=Array(i));++r<i;)n[r]=e[r];return n}return Vg=t,Vg}var $g,w1;function nM(){if(w1)return $g;w1=1;var t=oC(),e=tM(),n=ad(),r=Du(),i=sC(),l=ym(),s=uC();function u(f){return n(f)?t(f,l):r(f)?[f]:e(i(s(f)))}return $g=u,$g}var rM=nM(),aM=Cu(rM),iM={data:function(e){var n={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(i){},beforeSet:function(i,l){},onSet:function(i){},canSet:function(i){return!0}};return e=vt({},n,e),function(i,l){var s=e,u=this,f=u.length!==void 0,c=f?u:[u],h=f?u[0]:u;if(ct(i)){var v=i.indexOf(".")!==-1,p=v&&aM(i);if(s.allowGetting&&l===void 0){var m;return h&&(s.beforeGet(h),p&&h._private[s.field][i]===void 0?m=$R(h._private[s.field],p):m=h._private[s.field][i]),m}else if(s.allowSetting&&l!==void 0){var y=!s.immutableKeys[i];if(y){var S=TS({},i,l);s.beforeSet(u,S);for(var w=0,E=c.length;w<E;w++){var C=c[w];s.canSet(C)&&(p&&h._private[s.field][i]===void 0?eM(C._private[s.field],p,l):C._private[s.field][i]=l)}s.updateStyle&&u.updateStyle(),s.onSet(u),s.settingTriggersEvent&&u[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&Ut(i)){var T=i,A,k,N=Object.keys(T);s.beforeSet(u,T);for(var _=0;_<N.length;_++){A=N[_],k=T[A];var O=!s.immutableKeys[A];if(O)for(var U=0;U<c.length;U++){var M=c[U];s.canSet(M)&&(M._private[s.field][A]=k)}}s.updateStyle&&u.updateStyle(),s.onSet(u),s.settingTriggersEvent&&u[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&xn(i)){var I=i;u.on(s.bindingEvent,I)}else if(s.allowGetting&&i===void 0){var P;return h&&(s.beforeGet(h),P=h._private[s.field]),P}return u}},removeData:function(e){var n={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=vt({},n,e),function(i){var l=e,s=this,u=s.length!==void 0,f=u?s:[s];if(ct(i)){for(var c=i.split(/\s+/),h=c.length,v=0;v<h;v++){var p=c[v];if(!Fi(p)){var m=!l.immutableKeys[p];if(m)for(var y=0,S=f.length;y<S;y++)f[y]._private[l.field][p]=void 0}}l.triggerEvent&&s[l.triggerFnName](l.event)}else if(i===void 0){for(var w=0,E=f.length;w<E;w++)for(var C=f[w]._private[l.field],T=Object.keys(C),A=0;A<T.length;A++){var k=T[A],N=!l.immutableKeys[k];N&&(C[k]=void 0)}l.triggerEvent&&s[l.triggerFnName](l.event)}return s}}},lM={eventAliasesOn:function(e){var n=e;n.addListener=n.listen=n.bind=n.on,n.unlisten=n.unbind=n.off=n.removeListener,n.trigger=n.emit,n.pon=n.promiseOn=function(r,i){var l=this,s=Array.prototype.slice.call(arguments,0);return new qs(function(u,f){var c=function(m){l.off.apply(l,v),u(m)},h=s.concat([c]),v=h.concat([]);l.on.apply(l,h)})}}},Vt={};[dR,iM,lM].forEach(function(t){vt(Vt,t)});var sM={animate:Vt.animate(),animation:Vt.animation(),animated:Vt.animated(),clearQueue:Vt.clearQueue(),delay:Vt.delay(),delayAnimation:Vt.delayAnimation(),stop:Vt.stop()},Cf={classes:function(e){var n=this;if(e===void 0){var r=[];return n[0]._private.classes.forEach(function(y){return r.push(y)}),r}else an(e)||(e=(e||"").match(/\S+/g)||[]);for(var i=[],l=new Us(e),s=0;s<n.length;s++){for(var u=n[s],f=u._private,c=f.classes,h=!1,v=0;v<e.length;v++){var p=e[v],m=c.has(p);if(!m){h=!0;break}}h||(h=c.size!==e.length),h&&(f.classes=l,i.push(u))}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var n=this[0];return n!=null&&n._private.classes.has(e)},toggleClass:function(e,n){an(e)||(e=e.match(/\S+/g)||[]);for(var r=this,i=n===void 0,l=[],s=0,u=r.length;s<u;s++)for(var f=r[s],c=f._private.classes,h=!1,v=0;v<e.length;v++){var p=e[v],m=c.has(p),y=!1;n||i&&!m?(c.add(p),y=!0):(!n||i&&m)&&(c.delete(p),y=!0),!h&&y&&(l.push(f),h=!0)}return l.length>0&&this.spawn(l).updateStyle().emit("class"),r},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,n){var r=this;if(n==null)n=250;else if(n===0)return r;return r.addClass(e),setTimeout(function(){r.removeClass(e)},n),r}};Cf.className=Cf.classNames=Cf.classes;var Pt={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Hn,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Pt.variable="(?:[\\w-.]|(?:\\\\"+Pt.metaChar+"))+";Pt.className="(?:[\\w-]|(?:\\\\"+Pt.metaChar+"))+";Pt.value=Pt.string+"|"+Pt.number;Pt.id=Pt.variable;(function(){var t,e,n;for(t=Pt.comparatorOp.split("|"),n=0;n<t.length;n++)e=t[n],Pt.comparatorOp+="|@"+e;for(t=Pt.comparatorOp.split("|"),n=0;n<t.length;n++)e=t[n],!(e.indexOf("!")>=0)&&e!=="="&&(Pt.comparatorOp+="|\\!"+e)})();var en=function(){return{checks:[]}},tt={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},Op=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return ik(t.selector,e.selector)}),oM=(function(){for(var t={},e,n=0;n<Op.length;n++)e=Op[n],t[e.selector]=e.matches;return t})(),uM=function(e,n){return oM[e](n)},cM="("+Op.map(function(t){return t.selector}).join("|")+")",hs=function(e){return e.replace(new RegExp("\\\\("+Pt.metaChar+")","g"),function(n,r){return r})},Di=function(e,n,r){e[e.length-1]=r},Bp=[{name:"group",query:!0,regex:"("+Pt.group+")",populate:function(e,n,r){var i=Pn(r,1),l=i[0];n.checks.push({type:tt.GROUP,value:l==="*"?l:l+"s"})}},{name:"state",query:!0,regex:cM,populate:function(e,n,r){var i=Pn(r,1),l=i[0];n.checks.push({type:tt.STATE,value:l})}},{name:"id",query:!0,regex:"\\#("+Pt.id+")",populate:function(e,n,r){var i=Pn(r,1),l=i[0];n.checks.push({type:tt.ID,value:hs(l)})}},{name:"className",query:!0,regex:"\\.("+Pt.className+")",populate:function(e,n,r){var i=Pn(r,1),l=i[0];n.checks.push({type:tt.CLASS,value:hs(l)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Pt.variable+")\\s*\\]",populate:function(e,n,r){var i=Pn(r,1),l=i[0];n.checks.push({type:tt.DATA_EXIST,field:hs(l)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Pt.variable+")\\s*("+Pt.comparatorOp+")\\s*("+Pt.value+")\\s*\\]",populate:function(e,n,r){var i=Pn(r,3),l=i[0],s=i[1],u=i[2],f=new RegExp("^"+Pt.string+"$").exec(u)!=null;f?u=u.substring(1,u.length-1):u=parseFloat(u),n.checks.push({type:tt.DATA_COMPARE,field:hs(l),operator:s,value:u})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Pt.boolOp+")\\s*("+Pt.variable+")\\s*\\]",populate:function(e,n,r){var i=Pn(r,2),l=i[0],s=i[1];n.checks.push({type:tt.DATA_BOOL,field:hs(s),operator:l})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Pt.meta+")\\s*("+Pt.comparatorOp+")\\s*("+Pt.number+")\\s*\\]\\]",populate:function(e,n,r){var i=Pn(r,3),l=i[0],s=i[1],u=i[2];n.checks.push({type:tt.META_COMPARE,field:hs(l),operator:s,value:parseFloat(u)})}},{name:"nextQuery",separator:!0,regex:Pt.separator,populate:function(e,n){var r=e.currentSubject,i=e.edgeCount,l=e.compoundCount,s=e[e.length-1];r!=null&&(s.subject=r,e.currentSubject=null),s.edgeCount=i,s.compoundCount=l,e.edgeCount=0,e.compoundCount=0;var u=e[e.length++]=en();return u}},{name:"directedEdge",separator:!0,regex:Pt.directedEdge,populate:function(e,n){if(e.currentSubject==null){var r=en(),i=n,l=en();return r.checks.push({type:tt.DIRECTED_EDGE,source:i,target:l}),Di(e,n,r),e.edgeCount++,l}else{var s=en(),u=n,f=en();return s.checks.push({type:tt.NODE_SOURCE,source:u,target:f}),Di(e,n,s),e.edgeCount++,f}}},{name:"undirectedEdge",separator:!0,regex:Pt.undirectedEdge,populate:function(e,n){if(e.currentSubject==null){var r=en(),i=n,l=en();return r.checks.push({type:tt.UNDIRECTED_EDGE,nodes:[i,l]}),Di(e,n,r),e.edgeCount++,l}else{var s=en(),u=n,f=en();return s.checks.push({type:tt.NODE_NEIGHBOR,node:u,neighbor:f}),Di(e,n,s),f}}},{name:"child",separator:!0,regex:Pt.child,populate:function(e,n){if(e.currentSubject==null){var r=en(),i=en(),l=e[e.length-1];return r.checks.push({type:tt.CHILD,parent:l,child:i}),Di(e,n,r),e.compoundCount++,i}else if(e.currentSubject===n){var s=en(),u=e[e.length-1],f=en(),c=en(),h=en(),v=en();return s.checks.push({type:tt.COMPOUND_SPLIT,left:u,right:f,subject:c}),c.checks=n.checks,n.checks=[{type:tt.TRUE}],v.checks.push({type:tt.TRUE}),f.checks.push({type:tt.PARENT,parent:v,child:h}),Di(e,u,s),e.currentSubject=c,e.compoundCount++,h}else{var p=en(),m=en(),y=[{type:tt.PARENT,parent:p,child:m}];return p.checks=n.checks,n.checks=y,e.compoundCount++,m}}},{name:"descendant",separator:!0,regex:Pt.descendant,populate:function(e,n){if(e.currentSubject==null){var r=en(),i=en(),l=e[e.length-1];return r.checks.push({type:tt.DESCENDANT,ancestor:l,descendant:i}),Di(e,n,r),e.compoundCount++,i}else if(e.currentSubject===n){var s=en(),u=e[e.length-1],f=en(),c=en(),h=en(),v=en();return s.checks.push({type:tt.COMPOUND_SPLIT,left:u,right:f,subject:c}),c.checks=n.checks,n.checks=[{type:tt.TRUE}],v.checks.push({type:tt.TRUE}),f.checks.push({type:tt.ANCESTOR,ancestor:v,descendant:h}),Di(e,u,s),e.currentSubject=c,e.compoundCount++,h}else{var p=en(),m=en(),y=[{type:tt.ANCESTOR,ancestor:p,descendant:m}];return p.checks=n.checks,n.checks=y,e.compoundCount++,m}}},{name:"subject",modifier:!0,regex:Pt.subject,populate:function(e,n){if(e.currentSubject!=null&&e.currentSubject!==n)return $t("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=n;var r=e[e.length-1],i=r.checks[0],l=i==null?null:i.type;l===tt.DIRECTED_EDGE?i.type=tt.NODE_TARGET:l===tt.UNDIRECTED_EDGE&&(i.type=tt.NODE_NEIGHBOR,i.node=i.nodes[1],i.neighbor=i.nodes[0],i.nodes=null)}}];Bp.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var fM=function(e){for(var n,r,i,l=0;l<Bp.length;l++){var s=Bp[l],u=s.name,f=e.match(s.regexObj);if(f!=null){r=f,n=s,i=u;var c=f[0];e=e.substring(c.length);break}}return{expr:n,match:r,name:i,remaining:e}},dM=function(e){var n=e.match(/^\s+/);if(n){var r=n[0];e=e.substring(r.length)}return e},hM=function(e){var n=this,r=n.inputText=e,i=n[0]=en();for(n.length=1,r=dM(r);;){var l=fM(r);if(l.expr==null)return $t("The selector `"+e+"`is invalid"),!1;var s=l.match.slice(1),u=l.expr.populate(n,i,s);if(u===!1)return!1;if(u!=null&&(i=u),r=l.remaining,r.match(/^\s*$/))break}var f=n[n.length-1];n.currentSubject!=null&&(f.subject=n.currentSubject),f.edgeCount=n.edgeCount,f.compoundCount=n.compoundCount;for(var c=0;c<n.length;c++){var h=n[c];if(h.compoundCount>0&&h.edgeCount>0)return $t("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return $t("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&$t("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},vM=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},n=function(h){return ct(h)?'"'+h+'"':e(h)},r=function(h){return" "+h+" "},i=function(h,v){var p=h.type,m=h.value;switch(p){case tt.GROUP:{var y=e(m);return y.substring(0,y.length-1)}case tt.DATA_COMPARE:{var S=h.field,w=h.operator;return"["+S+r(e(w))+n(m)+"]"}case tt.DATA_BOOL:{var E=h.operator,C=h.field;return"["+e(E)+C+"]"}case tt.DATA_EXIST:{var T=h.field;return"["+T+"]"}case tt.META_COMPARE:{var A=h.operator,k=h.field;return"[["+k+r(e(A))+n(m)+"]]"}case tt.STATE:return m;case tt.ID:return"#"+m;case tt.CLASS:return"."+m;case tt.PARENT:case tt.CHILD:return l(h.parent,v)+r(">")+l(h.child,v);case tt.ANCESTOR:case tt.DESCENDANT:return l(h.ancestor,v)+" "+l(h.descendant,v);case tt.COMPOUND_SPLIT:{var N=l(h.left,v),_=l(h.subject,v),O=l(h.right,v);return N+(N.length>0?" ":"")+_+O}case tt.TRUE:return""}},l=function(h,v){return h.checks.reduce(function(p,m,y){return p+(v===h&&y===0?"$":"")+i(m,v)},"")},s="",u=0;u<this.length;u++){var f=this[u];s+=l(f,f.subject),this.length>1&&u<this.length-1&&(s+=", ")}return this.toStringCache=s,s},gM={parse:hM,toString:vM},fC=function(e,n,r){var i,l=ct(e),s=Ge(e),u=ct(r),f,c,h=!1,v=!1,p=!1;switch(n.indexOf("!")>=0&&(n=n.replace("!",""),v=!0),n.indexOf("@")>=0&&(n=n.replace("@",""),h=!0),(l||u||h)&&(f=!l&&!s?"":""+e,c=""+r),h&&(e=f=f.toLowerCase(),r=c=c.toLowerCase()),n){case"*=":i=f.indexOf(c)>=0;break;case"$=":i=f.indexOf(c,f.length-c.length)>=0;break;case"^=":i=f.indexOf(c)===0;break;case"=":i=e===r;break;case">":p=!0,i=e>r;break;case">=":p=!0,i=e>=r;break;case"<":p=!0,i=e<r;break;case"<=":p=!0,i=e<=r;break;default:i=!1;break}return v&&(e!=null||!p)&&(i=!i),i},pM=function(e,n){switch(n){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},mM=function(e){return e!==void 0},bm=function(e,n){return e.data(n)},yM=function(e,n){return e[n]()},_n=[],hn=function(e,n){return e.checks.every(function(r){return _n[r.type](r,n)})};_n[tt.GROUP]=function(t,e){var n=t.value;return n==="*"||n===e.group()};_n[tt.STATE]=function(t,e){var n=t.value;return uM(n,e)};_n[tt.ID]=function(t,e){var n=t.value;return e.id()===n};_n[tt.CLASS]=function(t,e){var n=t.value;return e.hasClass(n)};_n[tt.META_COMPARE]=function(t,e){var n=t.field,r=t.operator,i=t.value;return fC(yM(e,n),r,i)};_n[tt.DATA_COMPARE]=function(t,e){var n=t.field,r=t.operator,i=t.value;return fC(bm(e,n),r,i)};_n[tt.DATA_BOOL]=function(t,e){var n=t.field,r=t.operator;return pM(bm(e,n),r)};_n[tt.DATA_EXIST]=function(t,e){var n=t.field;return t.operator,mM(bm(e,n))};_n[tt.UNDIRECTED_EDGE]=function(t,e){var n=t.nodes[0],r=t.nodes[1],i=e.source(),l=e.target();return hn(n,i)&&hn(r,l)||hn(r,i)&&hn(n,l)};_n[tt.NODE_NEIGHBOR]=function(t,e){return hn(t.node,e)&&e.neighborhood().some(function(n){return n.isNode()&&hn(t.neighbor,n)})};_n[tt.DIRECTED_EDGE]=function(t,e){return hn(t.source,e.source())&&hn(t.target,e.target())};_n[tt.NODE_SOURCE]=function(t,e){return hn(t.source,e)&&e.outgoers().some(function(n){return n.isNode()&&hn(t.target,n)})};_n[tt.NODE_TARGET]=function(t,e){return hn(t.target,e)&&e.incomers().some(function(n){return n.isNode()&&hn(t.source,n)})};_n[tt.CHILD]=function(t,e){return hn(t.child,e)&&hn(t.parent,e.parent())};_n[tt.PARENT]=function(t,e){return hn(t.parent,e)&&e.children().some(function(n){return hn(t.child,n)})};_n[tt.DESCENDANT]=function(t,e){return hn(t.descendant,e)&&e.ancestors().some(function(n){return hn(t.ancestor,n)})};_n[tt.ANCESTOR]=function(t,e){return hn(t.ancestor,e)&&e.descendants().some(function(n){return hn(t.descendant,n)})};_n[tt.COMPOUND_SPLIT]=function(t,e){return hn(t.subject,e)&&hn(t.left,e)&&hn(t.right,e)};_n[tt.TRUE]=function(){return!0};_n[tt.COLLECTION]=function(t,e){var n=t.value;return n.has(e)};_n[tt.FILTER]=function(t,e){var n=t.value;return n(e)};var bM=function(e){var n=this;if(n.length===1&&n[0].checks.length===1&&n[0].checks[0].type===tt.ID)return e.getElementById(n[0].checks[0].value).collection();var r=function(l){for(var s=0;s<n.length;s++){var u=n[s];if(hn(u,l))return!0}return!1};return n.text()==null&&(r=function(){return!0}),e.filter(r)},EM=function(e){for(var n=this,r=0;r<n.length;r++){var i=n[r];if(hn(i,e))return!0}return!1},xM={matches:EM,filter:bM},Pi=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||ct(e)&&e.match(/^\s*$/)||(Hr(e)?this.addQuery({checks:[{type:tt.COLLECTION,value:e.collection()}]}):xn(e)?this.addQuery({checks:[{type:tt.FILTER,value:e}]}):ct(e)?this.parse(e)||(this.invalid=!0):gn("A selector must be created from a string; found "))},Ui=Pi.prototype;[gM,xM].forEach(function(t){return vt(Ui,t)});Ui.text=function(){return this.inputText};Ui.size=function(){return this.length};Ui.eq=function(t){return this[t]};Ui.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};Ui.addQuery=function(t){this[this.length++]=t};Ui.selector=Ui.toString;var Bi={allAre:function(e){var n=new Pi(e);return this.every(function(r){return n.matches(r)})},is:function(e){var n=new Pi(e);return this.some(function(r){return n.matches(r)})},some:function(e,n){for(var r=0;r<this.length;r++){var i=n?e.apply(n,[this[r],r,this]):e(this[r],r,this);if(i)return!0}return!1},every:function(e,n){for(var r=0;r<this.length;r++){var i=n?e.apply(n,[this[r],r,this]):e(this[r],r,this);if(!i)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var n=this.length,r=e.length;return n!==r?!1:n===1?this[0]===e[0]:this.every(function(i){return e.hasElementWithId(i.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(n){return e.hasElementWithId(n.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var n=this.neighborhood();return e.every(function(r){return n.hasElementWithId(r.id())})},contains:function(e){e=this.cy().collection(e);var n=this;return e.every(function(r){return n.hasElementWithId(r.id())})}};Bi.allAreNeighbours=Bi.allAreNeighbors;Bi.has=Bi.contains;Bi.equal=Bi.equals=Bi.same;var la=function(e,n){return function(i,l,s,u){var f=i,c=this,h;if(f==null?h="":Hr(f)&&f.length===1&&(h=f.id()),c.length===1&&h){var v=c[0]._private,p=v.traversalCache=v.traversalCache||{},m=p[n]=p[n]||[],y=wl(h),S=m[y];return S||(m[y]=e.call(c,i,l,s,u))}else return e.call(c,i,l,s,u)}},zs={parent:function(e){var n=[];if(this.length===1){var r=this[0]._private.parent;if(r)return r}for(var i=0;i<this.length;i++){var l=this[i],s=l._private.parent;s&&n.push(s)}return this.spawn(n,!0).filter(e)},parents:function(e){for(var n=[],r=this.parent();r.nonempty();){for(var i=0;i<r.length;i++){var l=r[i];n.push(l)}r=r.parent()}return this.spawn(n,!0).filter(e)},commonAncestors:function(e){for(var n,r=0;r<this.length;r++){var i=this[r],l=i.parents();n=n||l,n=n.intersect(l)}return n.filter(e)},orphans:function(e){return this.stdFilter(function(n){return n.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(n){return n.isChild()}).filter(e)},children:la(function(t){for(var e=[],n=0;n<this.length;n++)for(var r=this[n],i=r._private.children,l=0;l<i.length;l++)e.push(i[l]);return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var n=[];function r(i){for(var l=0;l<i.length;l++){var s=i[l];n.push(s),s.children().nonempty()&&r(s.children())}}return r(this.children()),this.spawn(n,!0).filter(e)}};function Em(t,e,n,r){for(var i=[],l=new Us,s=t.cy(),u=s.hasCompoundNodes(),f=0;f<t.length;f++){var c=t[f];n?i.push(c):u&&r(i,l,c)}for(;i.length>0;){var h=i.shift();e(h),l.add(h.id()),u&&r(i,l,h)}return t}function dC(t,e,n){if(n.isParent())for(var r=n._private.children,i=0;i<r.length;i++){var l=r[i];e.has(l.id())||t.push(l)}}zs.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Em(this,t,e,dC)};function hC(t,e,n){if(n.isChild()){var r=n._private.parent;e.has(r.id())||t.push(r)}}zs.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Em(this,t,e,hC)};function wM(t,e,n){hC(t,e,n),dC(t,e,n)}zs.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Em(this,t,e,wM)};zs.ancestors=zs.parents;var vu,vC;vu=vC={data:Vt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Vt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Vt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Vt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Vt.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Vt.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};vu.attr=vu.data;vu.removeAttr=vu.removeData;var SM=vC,od={};function Kg(t){return function(e){var n=this;if(e===void 0&&(e=!0),n.length!==0)if(n.isNode()&&!n.removed()){for(var r=0,i=n[0],l=i._private.edges,s=0;s<l.length;s++){var u=l[s];!e&&u.isLoop()||(r+=t(i,u))}return r}else return}}vt(od,{degree:Kg(function(t,e){return e.source().same(e.target())?2:1}),indegree:Kg(function(t,e){return e.target().same(t)?1:0}),outdegree:Kg(function(t,e){return e.source().same(t)?1:0})});function vs(t,e){return function(n){for(var r,i=this.nodes(),l=0;l<i.length;l++){var s=i[l],u=s[t](n);u!==void 0&&(r===void 0||e(u,r))&&(r=u)}return r}}vt(od,{minDegree:vs("degree",function(t,e){return t<e}),maxDegree:vs("degree",function(t,e){return t>e}),minIndegree:vs("indegree",function(t,e){return t<e}),maxIndegree:vs("indegree",function(t,e){return t>e}),minOutdegree:vs("outdegree",function(t,e){return t<e}),maxOutdegree:vs("outdegree",function(t,e){return t>e})});vt(od,{totalDegree:function(e){for(var n=0,r=this.nodes(),i=0;i<r.length;i++)n+=r[i].degree(e);return n}});var da,gC,pC=function(e,n,r){for(var i=0;i<e.length;i++){var l=e[i];if(!l.locked()){var s=l._private.position,u={x:n.x!=null?n.x-s.x:0,y:n.y!=null?n.y-s.y:0};l.isParent()&&!(u.x===0&&u.y===0)&&l.children().shift(u,r),l.dirtyBoundingBoxCache()}}},S1={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,n){pC(e,n,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};da=gC={position:Vt.data(S1),silentPosition:Vt.data(vt({},S1,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,n){pC(e,n,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,n){if(Ut(e))n?this.silentPosition(e):this.position(e);else if(xn(e)){var r=e,i=this.cy();i.startBatch();for(var l=0;l<this.length;l++){var s=this[l],u=void 0;(u=r(s,l))&&(n?s.silentPosition(u):s.position(u))}i.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,n,r){var i;if(Ut(e)?(i={x:Ge(e.x)?e.x:0,y:Ge(e.y)?e.y:0},r=n):ct(e)&&Ge(n)&&(i={x:0,y:0},i[e]=n),i!=null){var l=this.cy();l.startBatch();for(var s=0;s<this.length;s++){var u=this[s];if(!(l.hasCompoundNodes()&&u.isChild()&&u.ancestors().anySame(this))){var f=u.position(),c={x:f.x+i.x,y:f.y+i.y};r?u.silentPosition(c):u.position(c)}}l.endBatch()}return this},silentShift:function(e,n){return Ut(e)?this.shift(e,!0):ct(e)&&Ge(n)&&this.shift(e,n,!0),this},renderedPosition:function(e,n){var r=this[0],i=this.cy(),l=i.zoom(),s=i.pan(),u=Ut(e)?e:void 0,f=u!==void 0||n!==void 0&&ct(e);if(r&&r.isNode())if(f)for(var c=0;c<this.length;c++){var h=this[c];n!==void 0?h.position(e,(n-s[e])/l):u!==void 0&&h.position(GS(u,l,s))}else{var v=r.position();return u=nd(v,l,s),e===void 0?u:u[e]}else if(!f)return;return this},relativePosition:function(e,n){var r=this[0],i=this.cy(),l=Ut(e)?e:void 0,s=l!==void 0||n!==void 0&&ct(e),u=i.hasCompoundNodes();if(r&&r.isNode())if(s)for(var f=0;f<this.length;f++){var c=this[f],h=u?c.parent():null,v=h&&h.length>0,p=v;v&&(h=h[0]);var m=p?h.position():{x:0,y:0};n!==void 0?c.position(e,n+m[e]):l!==void 0&&c.position({x:l.x+m.x,y:l.y+m.y})}else{var y=r.position(),S=u?r.parent():null,w=S&&S.length>0,E=w;w&&(S=S[0]);var C=E?S.position():{x:0,y:0};return l={x:y.x-C.x,y:y.y-C.y},e===void 0?l:l[e]}else if(!s)return;return this}};da.modelPosition=da.point=da.position;da.modelPositions=da.points=da.positions;da.renderedPoint=da.renderedPosition;da.relativePoint=da.relativePosition;var CM=gC,Bs,Gi;Bs=Gi={};Gi.renderedBoundingBox=function(t){var e=this.boundingBox(t),n=this.cy(),r=n.zoom(),i=n.pan(),l=e.x1*r+i.x,s=e.x2*r+i.x,u=e.y1*r+i.y,f=e.y2*r+i.y;return{x1:l,x2:s,y1:u,y2:f,w:s-l,h:f-u}};Gi.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(n){if(n.isParent()){var r=n._private;r.compoundBoundsClean=!1,r.bbCache=null,t||n.emitAndNotify("bounds")}}),this)};Gi.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function n(s){if(!s.isParent())return;var u=s._private,f=s.children(),c=s.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},v=f.boundingBox({includeLabels:c,includeOverlays:!1,useCache:!1}),p=u.position;(v.w===0||v.h===0)&&(v={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},v.x1=p.x-v.w/2,v.x2=p.x+v.w/2,v.y1=p.y-v.h/2,v.y2=p.y+v.h/2);function m(U,M,I){var P=0,j=0,K=M+I;return U>0&&K>0&&(P=M/K*U,j=I/K*U),{biasDiff:P,biasComplementDiff:j}}function y(U,M,I,P){if(I.units==="%")switch(P){case"width":return U>0?I.pfValue*U:0;case"height":return M>0?I.pfValue*M:0;case"average":return U>0&&M>0?I.pfValue*(U+M)/2:0;case"min":return U>0&&M>0?U>M?I.pfValue*M:I.pfValue*U:0;case"max":return U>0&&M>0?U>M?I.pfValue*U:I.pfValue*M:0;default:return 0}else return I.units==="px"?I.pfValue:0}var S=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(S=S*100/h.width.val);var w=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(w=w*100/h.width.val);var E=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(E=E*100/h.height.val);var C=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(C=C*100/h.height.val);var T=m(h.width.val-v.w,S,w),A=T.biasDiff,k=T.biasComplementDiff,N=m(h.height.val-v.h,E,C),_=N.biasDiff,O=N.biasComplementDiff;u.autoPadding=y(v.w,v.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),u.autoWidth=Math.max(v.w,h.width.val),p.x=(-A+v.x1+v.x2+k)/2,u.autoHeight=Math.max(v.h,h.height.val),p.y=(-_+v.y1+v.y2+O)/2}for(var r=0;r<this.length;r++){var i=this[r],l=i._private;(!l.compoundBoundsClean||t)&&(n(i),e.batching()||(l.compoundBoundsClean=!0))}return this};var aa=function(e){return e===1/0||e===-1/0?0:e},fa=function(e,n,r,i,l){i-n===0||l-r===0||n==null||r==null||i==null||l==null||(e.x1=n<e.x1?n:e.x1,e.x2=i>e.x2?i:e.x2,e.y1=r<e.y1?r:e.y1,e.y2=l>e.y2?l:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},ki=function(e,n){return n==null?e:fa(e,n.x1,n.y1,n.x2,n.y2)},jo=function(e,n,r){return Rr(e,n,r)},rf=function(e,n,r){if(!n.cy().headless()){var i=n._private,l=i.rstyle,s=l.arrowWidth/2,u=n.pstyle(r+"-arrow-shape").value,f,c;if(u!=="none"){r==="source"?(f=l.srcX,c=l.srcY):r==="target"?(f=l.tgtX,c=l.tgtY):(f=l.midX,c=l.midY);var h=i.arrowBounds=i.arrowBounds||{},v=h[r]=h[r]||{};v.x1=f-s,v.y1=c-s,v.x2=f+s,v.y2=c+s,v.w=v.x2-v.x1,v.h=v.y2-v.y1,wf(v,1),fa(e,v.x1,v.y1,v.x2,v.y2)}}},Yg=function(e,n,r){if(!n.cy().headless()){var i;r?i=r+"-":i="";var l=n._private,s=l.rstyle,u=n.pstyle(i+"label").strValue;if(u){var f=n.pstyle("text-halign"),c=n.pstyle("text-valign"),h=jo(s,"labelWidth",r),v=jo(s,"labelHeight",r),p=jo(s,"labelX",r),m=jo(s,"labelY",r),y=n.pstyle(i+"text-margin-x").pfValue,S=n.pstyle(i+"text-margin-y").pfValue,w=n.isEdge(),E=n.pstyle(i+"text-rotation"),C=n.pstyle("text-outline-width").pfValue,T=n.pstyle("text-border-width").pfValue,A=T/2,k=n.pstyle("text-background-padding").pfValue,N=2,_=v,O=h,U=O/2,M=_/2,I,P,j,K;if(w)I=p-U,P=p+U,j=m-M,K=m+M;else{switch(f.value){case"left":I=p-O,P=p;break;case"center":I=p-U,P=p+U;break;case"right":I=p,P=p+O;break}switch(c.value){case"top":j=m-_,K=m;break;case"center":j=m-M,K=m+M;break;case"bottom":j=m,K=m+_;break}}var $=y-Math.max(C,A)-k-N,B=y+Math.max(C,A)+k+N,H=S-Math.max(C,A)-k-N,Y=S+Math.max(C,A)+k+N;I+=$,P+=B,j+=H,K+=Y;var Q=r||"main",z=l.labelBounds,F=z[Q]=z[Q]||{};F.x1=I,F.y1=j,F.x2=P,F.y2=K,F.w=P-I,F.h=K-j,F.leftPad=$,F.rightPad=B,F.topPad=H,F.botPad=Y;var q=w&&E.strValue==="autorotate",L=E.pfValue!=null&&E.pfValue!==0;if(q||L){var W=q?jo(l.rstyle,"labelAngle",r):E.pfValue,ae=Math.cos(W),se=Math.sin(W),me=(I+P)/2,Ne=(j+K)/2;if(!w){switch(f.value){case"left":me=P;break;case"right":me=I;break}switch(c.value){case"top":Ne=K;break;case"bottom":Ne=j;break}}var pe=function(ot,et){return ot=ot-me,et=et-Ne,{x:ot*ae-et*se+me,y:ot*se+et*ae+Ne}},ee=pe(I,j),le=pe(I,K),fe=pe(P,j),xe=pe(P,K);I=Math.min(ee.x,le.x,fe.x,xe.x),P=Math.max(ee.x,le.x,fe.x,xe.x),j=Math.min(ee.y,le.y,fe.y,xe.y),K=Math.max(ee.y,le.y,fe.y,xe.y)}var Re=Q+"Rot",Xe=z[Re]=z[Re]||{};Xe.x1=I,Xe.y1=j,Xe.x2=P,Xe.y2=K,Xe.w=P-I,Xe.h=K-j,fa(e,I,j,P,K),fa(l.labelBounds.all,I,j,P,K)}return e}},C1=function(e,n){if(!n.cy().headless()){var r=n.pstyle("outline-opacity").value,i=n.pstyle("outline-width").value,l=n.pstyle("outline-offset").value,s=i+l;mC(e,n,r,s,"outside",s/2)}},mC=function(e,n,r,i,l,s){if(!(r===0||i<=0||l==="inside")){var u=n.cy(),f=u.renderer(),c=f.nodeShapes[f.getNodeShape(n)];if(c){var h=n.position(),v=h.x,p=h.y,m=n.width(),y=n.height();if(c.hasMiterBounds){l==="center"&&(i/=2);var S=c.miterBounds(v,p,m,y,i);ki(e,S)}else s!=null&&s>0&&Sf(e,[s,s,s,s])}}},TM=function(e,n){if(!n.cy().headless()){var r=n.pstyle("border-opacity").value,i=n.pstyle("border-width").pfValue,l=n.pstyle("border-position").value;mC(e,n,r,i,l)}},DM=function(e,n){var r=e._private.cy,i=r.styleEnabled(),l=r.headless(),s=br(),u=e._private,f=e.isNode(),c=e.isEdge(),h,v,p,m,y,S,w=u.rstyle,E=f&&i?e.pstyle("bounds-expansion").pfValue:[0],C=function(Ke){return Ke.pstyle("display").value!=="none"},T=!i||C(e)&&(!c||C(e.source())&&C(e.target()));if(T){var A=0,k=0;i&&n.includeOverlays&&(A=e.pstyle("overlay-opacity").value,A!==0&&(k=e.pstyle("overlay-padding").value));var N=0,_=0;i&&n.includeUnderlays&&(N=e.pstyle("underlay-opacity").value,N!==0&&(_=e.pstyle("underlay-padding").value));var O=Math.max(k,_),U=0,M=0;if(i&&(U=e.pstyle("width").pfValue,M=U/2),f&&n.includeNodes){var I=e.position();y=I.x,S=I.y;var P=e.outerWidth(),j=P/2,K=e.outerHeight(),$=K/2;h=y-j,v=y+j,p=S-$,m=S+$,fa(s,h,p,v,m),i&&C1(s,e),i&&n.includeOutlines&&!l&&C1(s,e),i&&TM(s,e)}else if(c&&n.includeEdges)if(i&&!l){var B=e.pstyle("curve-style").strValue;if(h=Math.min(w.srcX,w.midX,w.tgtX),v=Math.max(w.srcX,w.midX,w.tgtX),p=Math.min(w.srcY,w.midY,w.tgtY),m=Math.max(w.srcY,w.midY,w.tgtY),h-=M,v+=M,p-=M,m+=M,fa(s,h,p,v,m),B==="haystack"){var H=w.haystackPts;if(H&&H.length===2){if(h=H[0].x,p=H[0].y,v=H[1].x,m=H[1].y,h>v){var Y=h;h=v,v=Y}if(p>m){var Q=p;p=m,m=Q}fa(s,h-M,p-M,v+M,m+M)}}else if(B==="bezier"||B==="unbundled-bezier"||Ri(B,"segments")||Ri(B,"taxi")){var z;switch(B){case"bezier":case"unbundled-bezier":z=w.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":z=w.linePts;break}if(z!=null)for(var F=0;F<z.length;F++){var q=z[F];h=q.x-M,v=q.x+M,p=q.y-M,m=q.y+M,fa(s,h,p,v,m)}}}else{var L=e.source(),W=L.position(),ae=e.target(),se=ae.position();if(h=W.x,v=se.x,p=W.y,m=se.y,h>v){var me=h;h=v,v=me}if(p>m){var Ne=p;p=m,m=Ne}h-=M,v+=M,p-=M,m+=M,fa(s,h,p,v,m)}if(i&&n.includeEdges&&c&&(rf(s,e,"mid-source"),rf(s,e,"mid-target"),rf(s,e,"source"),rf(s,e,"target")),i){var pe=e.pstyle("ghost").value==="yes";if(pe){var ee=e.pstyle("ghost-offset-x").pfValue,le=e.pstyle("ghost-offset-y").pfValue;fa(s,s.x1+ee,s.y1+le,s.x2+ee,s.y2+le)}}var fe=u.bodyBounds=u.bodyBounds||{};ux(fe,s),Sf(fe,E),wf(fe,1),i&&(h=s.x1,v=s.x2,p=s.y1,m=s.y2,fa(s,h-O,p-O,v+O,m+O));var xe=u.overlayBounds=u.overlayBounds||{};ux(xe,s),Sf(xe,E),wf(xe,1);var Re=u.labelBounds=u.labelBounds||{};Re.all!=null?s2(Re.all):Re.all=br(),i&&n.includeLabels&&(n.includeMainLabels&&Yg(s,e,null),c&&(n.includeSourceLabels&&Yg(s,e,"source"),n.includeTargetLabels&&Yg(s,e,"target")))}return s.x1=aa(s.x1),s.y1=aa(s.y1),s.x2=aa(s.x2),s.y2=aa(s.y2),s.w=aa(s.x2-s.x1),s.h=aa(s.y2-s.y1),s.w>0&&s.h>0&&T&&(Sf(s,E),wf(s,1)),s},yC=function(e){var n=0,r=function(s){return(s?1:0)<<n++},i=0;return i+=r(e.incudeNodes),i+=r(e.includeEdges),i+=r(e.includeLabels),i+=r(e.includeMainLabels),i+=r(e.includeSourceLabels),i+=r(e.includeTargetLabels),i+=r(e.includeOverlays),i+=r(e.includeOutlines),i},bC=function(e){var n=function(u){return Math.round(u)};if(e.isEdge()){var r=e.source().position(),i=e.target().position();return rx([n(r.x),n(r.y),n(i.x),n(i.y)])}else{var l=e.position();return rx([n(l.x),n(l.y)])}},T1=function(e,n){var r=e._private,i,l=e.isEdge(),s=n==null?D1:yC(n),u=s===D1;if(r.bbCache==null?(i=DM(e,gu),r.bbCache=i,r.bbCachePosKey=bC(e)):i=r.bbCache,!u){var f=e.isNode();i=br(),(n.includeNodes&&f||n.includeEdges&&!f)&&(n.includeOverlays?ki(i,r.overlayBounds):ki(i,r.bodyBounds)),n.includeLabels&&(n.includeMainLabels&&(!l||n.includeSourceLabels&&n.includeTargetLabels)?ki(i,r.labelBounds.all):(n.includeMainLabels&&ki(i,r.labelBounds.mainRot),n.includeSourceLabels&&ki(i,r.labelBounds.sourceRot),n.includeTargetLabels&&ki(i,r.labelBounds.targetRot))),i.w=i.x2-i.x1,i.h=i.y2-i.y1}return i},gu={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},D1=yC(gu),A1=ir(gu);Gi.boundingBox=function(t){var e,n=t===void 0||t.useCache===void 0||t.useCache===!0,r=Fs(function(h){var v=h._private;return v.bbCache==null||v.styleDirty||v.bbCachePosKey!==bC(h)},function(h){return h.id()});if(n&&this.length===1&&!r(this[0]))t===void 0?t=gu:t=A1(t),e=T1(this[0],t);else{e=br(),t=t||gu;var i=A1(t),l=this,s=l.cy(),u=s.styleEnabled();this.edges().forEach(r),this.nodes().forEach(r),u&&this.recalculateRenderedStyle(n),this.updateCompoundBounds(!n);for(var f=0;f<l.length;f++){var c=l[f];r(c)&&c.dirtyBoundingBoxCache(),ki(e,T1(c,i))}}return e.x1=aa(e.x1),e.y1=aa(e.y1),e.x2=aa(e.x2),e.y2=aa(e.y2),e.w=aa(e.x2-e.x1),e.h=aa(e.y2-e.y1),e};Gi.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};Gi.boundingBoxAt=function(t){var e=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),i=n.collection();if(r&&(i=e.filter(function(c){return c.isParent()}),e=e.not(i)),Ut(t)){var l=t;t=function(){return l}}var s=function(h,v){return h._private.bbAtOldPos=t(h,v)},u=function(h){return h._private.bbAtOldPos};n.startBatch(),e.forEach(s).silentPositions(t),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var f=l2(this.boundingBox({useCache:!1}));return e.silentPositions(u),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),n.endBatch(),f};Bs.boundingbox=Bs.bb=Bs.boundingBox;Bs.renderedBoundingbox=Bs.renderedBoundingBox;var AM=Gi,tu,Nu;tu=Nu={};var EC=function(e){e.uppercaseName=jE(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=jE(e.outerName),tu[e.name]=function(){var r=this[0],i=r._private,l=i.cy,s=l._private.styleEnabled;if(r)if(s){if(r.isParent())return r.updateCompoundBounds(),i[e.autoName]||0;var u=r.pstyle(e.name);return u.strValue==="label"?(r.recalculateRenderedStyle(),i.rstyle[e.labelName]||0):u.pfValue}else return 1},tu["outer"+e.uppercaseName]=function(){var r=this[0],i=r._private,l=i.cy,s=l._private.styleEnabled;if(r)if(s){var u=r[e.name](),f=r.pstyle("border-position").value,c;f==="center"?c=r.pstyle("border-width").pfValue:f==="outside"?c=2*r.pstyle("border-width").pfValue:c=0;var h=2*r.padding();return u+c+h}else return 1},tu["rendered"+e.uppercaseName]=function(){var r=this[0];if(r){var i=r[e.name]();return i*this.cy().zoom()}},tu["rendered"+e.uppercaseOuterName]=function(){var r=this[0];if(r){var i=r[e.outerName]();return i*this.cy().zoom()}}};EC({name:"width"});EC({name:"height"});Nu.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue};Nu.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};Nu.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var _M=Nu,NM=function(e,n){if(e.isEdge()&&e.takesUpSpace())return n(e)},kM=function(e,n){if(e.isEdge()&&e.takesUpSpace()){var r=e.cy();return nd(n(e),r.zoom(),r.pan())}},RM=function(e,n){if(e.isEdge()&&e.takesUpSpace()){var r=e.cy(),i=r.pan(),l=r.zoom();return n(e).map(function(s){return nd(s,l,i)})}},MM=function(e){return e.renderer().getControlPoints(e)},OM=function(e){return e.renderer().getSegmentPoints(e)},BM=function(e){return e.renderer().getSourceEndpoint(e)},LM=function(e){return e.renderer().getTargetEndpoint(e)},FM=function(e){return e.renderer().getEdgeMidpoint(e)},_1={controlPoints:{get:MM,mult:!0},segmentPoints:{get:OM,mult:!0},sourceEndpoint:{get:BM},targetEndpoint:{get:LM},midpoint:{get:FM}},IM=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},zM=Object.keys(_1).reduce(function(t,e){var n=_1[e],r=IM(e);return t[e]=function(){return NM(this,n.get)},n.mult?t[r]=function(){return RM(this,n.get)}:t[r]=function(){return kM(this,n.get)},t},{}),PM=vt({},CM,AM,_M,zM);var xC=function(e,n){this.recycle(e,n)};function Ho(){return!1}function af(){return!0}xC.prototype={instanceString:function(){return"event"},recycle:function(e,n){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Ho,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?af:Ho):e!=null&&e.type?n=e:this.type=e,n!=null&&(this.originalEvent=n.originalEvent,this.type=n.type!=null?n.type:this.type,this.cy=n.cy,this.target=n.target,this.position=n.position,this.renderedPosition=n.renderedPosition,this.namespace=n.namespace,this.layout=n.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var r=this.position,i=this.cy.zoom(),l=this.cy.pan();this.renderedPosition={x:r.x*i+l.x,y:r.y*i+l.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=af;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=af;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=af,this.stopPropagation()},isDefaultPrevented:Ho,isPropagationStopped:Ho,isImmediatePropagationStopped:Ho};var wC=/^([^.]+)(\.(?:[^.]+))?$/,UM=".*",SC={qualifierCompare:function(e,n){return e===n},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},N1=Object.keys(SC),qM={};function ud(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qM,e=arguments.length>1?arguments[1]:void 0,n=0;n<N1.length;n++){var r=N1[n];this[r]=t[r]||SC[r]}this.context=e||this.context,this.listeners=[],this.emitting=0}var qi=ud.prototype,CC=function(e,n,r,i,l,s,u){xn(i)&&(l=i,i=null),u&&(s==null?s=u:s=vt({},s,u));for(var f=an(r)?r:r.split(/\s+/),c=0;c<f.length;c++){var h=f[c];if(!Fi(h)){var v=h.match(wC);if(v){var p=v[1],m=v[2]?v[2]:null,y=n(e,h,p,m,i,l,s);if(y===!1)break}}}},k1=function(e,n){return e.addEventFields(e.context,n),new xC(n.type,n)},jM=function(e,n,r){if(YN(r)){n(e,r);return}else if(Ut(r)){n(e,k1(e,r));return}for(var i=an(r)?r:r.split(/\s+/),l=0;l<i.length;l++){var s=i[l];if(!Fi(s)){var u=s.match(wC);if(u){var f=u[1],c=u[2]?u[2]:null,h=k1(e,{type:f,namespace:c,target:e.context});n(e,h)}}}};qi.on=qi.addListener=function(t,e,n,r,i){return CC(this,function(l,s,u,f,c,h,v){xn(h)&&l.listeners.push({event:s,callback:h,type:u,namespace:f,qualifier:c,conf:v})},t,e,n,r,i),this};qi.one=function(t,e,n,r){return this.on(t,e,n,r,{one:!0})};qi.removeListener=qi.off=function(t,e,n,r){var i=this;this.emitting!==0&&(this.listeners=kk(this.listeners));for(var l=this.listeners,s=function(c){var h=l[c];CC(i,function(v,p,m,y,S,w){if((h.type===m||t==="*")&&(!y&&h.namespace!==".*"||h.namespace===y)&&(!S||v.qualifierCompare(h.qualifier,S))&&(!w||h.callback===w))return l.splice(c,1),!1},t,e,n,r)},u=l.length-1;u>=0;u--)s(u);return this};qi.removeAllListeners=function(){return this.removeListener("*")};qi.emit=qi.trigger=function(t,e,n){var r=this.listeners,i=r.length;return this.emitting++,an(e)||(e=[e]),jM(this,function(l,s){n!=null&&(r=[{event:s.event,type:s.type,namespace:s.namespace,callback:n}],i=r.length);for(var u=function(){var h=r[f];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===UM)&&l.eventMatches(l.context,h,s)){var v=[s];e!=null&&Mk(v,e),l.beforeEmit(l.context,h,s),h.conf&&h.conf.one&&(l.listeners=l.listeners.filter(function(y){return y!==h}));var p=l.callbackContext(l.context,h,s),m=h.callback.apply(p,v);l.afterEmit(l.context,h,s),m===!1&&(s.stopPropagation(),s.preventDefault())}},f=0;f<i;f++)u();l.bubble(l.context)&&!s.isPropagationStopped()&&l.parent(l.context).emit(s,e)},t),this.emitting--,this};var HM={qualifierCompare:function(e,n){return e==null||n==null?e==null&&n==null:e.sameText(n)},eventMatches:function(e,n,r){var i=n.qualifier;return i!=null?e!==r.target&&Su(r.target)&&i.matches(r.target):!0},addEventFields:function(e,n){n.cy=e.cy(),n.target=e},callbackContext:function(e,n,r){return n.qualifier!=null?r.target:e},beforeEmit:function(e,n){n.conf&&n.conf.once&&n.conf.onceCollection.removeListener(n.event,n.qualifier,n.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},lf=function(e){return ct(e)?new Pi(e):e},TC={createEmitter:function(){for(var e=0;e<this.length;e++){var n=this[e],r=n._private;r.emitter||(r.emitter=new ud(HM,n))}return this},emitter:function(){return this._private.emitter},on:function(e,n,r){for(var i=lf(n),l=0;l<this.length;l++){var s=this[l];s.emitter().on(e,i,r)}return this},removeListener:function(e,n,r){for(var i=lf(n),l=0;l<this.length;l++){var s=this[l];s.emitter().removeListener(e,i,r)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var n=this[e];n.emitter().removeAllListeners()}return this},one:function(e,n,r){for(var i=lf(n),l=0;l<this.length;l++){var s=this[l];s.emitter().one(e,i,r)}return this},once:function(e,n,r){for(var i=lf(n),l=0;l<this.length;l++){var s=this[l];s.emitter().on(e,i,r,{once:!0,onceCollection:this})}},emit:function(e,n){for(var r=0;r<this.length;r++){var i=this[r];i.emitter().emit(e,n)}return this},emitAndNotify:function(e,n){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,n),this}};Vt.eventAliasesOn(TC);var DC={nodes:function(e){return this.filter(function(n){return n.isNode()}).filter(e)},edges:function(e){return this.filter(function(n){return n.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),n=this.spawn(),r=0;r<this.length;r++){var i=this[r];i.isNode()?e.push(i):n.push(i)}return{nodes:e,edges:n}},filter:function(e,n){if(e===void 0)return this;if(ct(e)||Hr(e))return new Pi(e).filter(this);if(xn(e)){for(var r=this.spawn(),i=this,l=0;l<i.length;l++){var s=i[l],u=n?e.apply(n,[s,l,i]):e(s,l,i);u&&r.push(s)}return r}return this.spawn()},not:function(e){if(e){ct(e)&&(e=this.filter(e));for(var n=this.spawn(),r=0;r<this.length;r++){var i=this[r],l=e.has(i);l||n.push(i)}return n}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(ct(e)){var n=e;return this.filter(n)}for(var r=this.spawn(),i=this,l=e,s=this.length<e.length,u=s?i:l,f=s?l:i,c=0;c<u.length;c++){var h=u[c];f.has(h)&&r.push(h)}return r},xor:function(e){var n=this._private.cy;ct(e)&&(e=n.$(e));var r=this.spawn(),i=this,l=e,s=function(f,c){for(var h=0;h<f.length;h++){var v=f[h],p=v._private.data.id,m=c.hasElementWithId(p);m||r.push(v)}};return s(i,l),s(l,i),r},diff:function(e){var n=this._private.cy;ct(e)&&(e=n.$(e));var r=this.spawn(),i=this.spawn(),l=this.spawn(),s=this,u=e,f=function(h,v,p){for(var m=0;m<h.length;m++){var y=h[m],S=y._private.data.id,w=v.hasElementWithId(S);w?l.merge(y):p.push(y)}};return f(s,u,r),f(u,s,i),{left:r,right:i,both:l}},add:function(e){var n=this._private.cy;if(!e)return this;if(ct(e)){var r=e;e=n.mutableElements().filter(r)}for(var i=this.spawnSelf(),l=0;l<e.length;l++){var s=e[l],u=!this.has(s);u&&i.push(s)}return i},merge:function(e){var n=this._private,r=n.cy;if(!e)return this;if(e&&ct(e)){var i=e;e=r.mutableElements().filter(i)}for(var l=n.map,s=0;s<e.length;s++){var u=e[s],f=u._private.data.id,c=!l.has(f);if(c){var h=this.length++;this[h]=u,l.set(f,{ele:u,index:h})}}return this},unmergeAt:function(e){var n=this[e],r=n.id(),i=this._private,l=i.map;this[e]=void 0,l.delete(r);var s=e===this.length-1;if(this.length>1&&!s){var u=this.length-1,f=this[u],c=f._private.data.id;this[u]=void 0,this[e]=f,l.set(c,{ele:f,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var n=this._private,r=e._private.data.id,i=n.map,l=i.get(r);if(!l)return this;var s=l.index;return this.unmergeAt(s),this},unmerge:function(e){var n=this._private.cy;if(!e)return this;if(e&&ct(e)){var r=e;e=n.mutableElements().filter(r)}for(var i=0;i<e.length;i++)this.unmergeOne(e[i]);return this},unmergeBy:function(e){for(var n=this.length-1;n>=0;n--){var r=this[n];e(r)&&this.unmergeAt(n)}return this},map:function(e,n){for(var r=[],i=this,l=0;l<i.length;l++){var s=i[l],u=n?e.apply(n,[s,l,i]):e(s,l,i);r.push(u)}return r},reduce:function(e,n){for(var r=n,i=this,l=0;l<i.length;l++)r=e(r,i[l],l,i);return r},max:function(e,n){for(var r=-1/0,i,l=this,s=0;s<l.length;s++){var u=l[s],f=n?e.apply(n,[u,s,l]):e(u,s,l);f>r&&(r=f,i=u)}return{value:r,ele:i}},min:function(e,n){for(var r=1/0,i,l=this,s=0;s<l.length;s++){var u=l[s],f=n?e.apply(n,[u,s,l]):e(u,s,l);f<r&&(r=f,i=u)}return{value:r,ele:i}}},Ht=DC;Ht.u=Ht["|"]=Ht["+"]=Ht.union=Ht.or=Ht.add;Ht["\\"]=Ht["!"]=Ht["-"]=Ht.difference=Ht.relativeComplement=Ht.subtract=Ht.not;Ht.n=Ht["&"]=Ht["."]=Ht.and=Ht.intersection=Ht.intersect;Ht["^"]=Ht["(+)"]=Ht["(-)"]=Ht.symmetricDifference=Ht.symdiff=Ht.xor;Ht.fnFilter=Ht.filterFn=Ht.stdFilter=Ht.filter;Ht.complement=Ht.abscomp=Ht.absoluteComplement;var GM={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},AC=function(e,n){var r=e.cy(),i=r.hasCompoundNodes();function l(h){var v=h.pstyle("z-compound-depth");return v.value==="auto"?i?h.zDepth():0:v.value==="bottom"?-1:v.value==="top"?um:0}var s=l(e)-l(n);if(s!==0)return s;function u(h){var v=h.pstyle("z-index-compare");return v.value==="auto"&&h.isNode()?1:0}var f=u(e)-u(n);if(f!==0)return f;var c=e.pstyle("z-index").value-n.pstyle("z-index").value;return c!==0?c:e.poolIndex()-n.poolIndex()},Uf={forEach:function(e,n){if(xn(e))for(var r=this.length,i=0;i<r;i++){var l=this[i],s=n?e.apply(n,[l,i,this]):e(l,i,this);if(s===!1)break}return this},toArray:function(){for(var e=[],n=0;n<this.length;n++)e.push(this[n]);return e},slice:function(e,n){var r=[],i=this.length;n==null&&(n=i),e==null&&(e=0),e<0&&(e=i+e),n<0&&(n=i+n);for(var l=e;l>=0&&l<n&&l<i;l++)r.push(this[l]);return this.spawn(r)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!xn(e))return this;var n=this.toArray().sort(e);return this.spawn(n)},sortByZIndex:function(){return this.sort(AC)},zDepth:function(){var e=this[0];if(e){var n=e._private,r=n.group;if(r==="nodes"){var i=n.data.parent?e.parents().size():0;return e.isParent()?i:um-1}else{var l=n.source,s=n.target,u=l.zDepth(),f=s.zDepth();return Math.max(u,f,0)}}}};Uf.each=Uf.forEach;var VM=function(){var e="undefined",n=(typeof Symbol>"u"?"undefined":Gn(Symbol))!=e&&Gn(Symbol.iterator)!=e;n&&(Uf[Symbol.iterator]=function(){var r=this,i={value:void 0,done:!1},l=0,s=this.length;return TS({next:function(){return l<s?i.value=r[l++]:(i.value=void 0,i.done=!0),i}},Symbol.iterator,function(){return this})})};VM();var $M=ir({nodeDimensionsIncludeLabels:!1}),Tf={layoutDimensions:function(e){e=$M(e);var n;if(!this.takesUpSpace())n={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var r=this.boundingBox();n={w:r.w,h:r.h}}else n={w:this.outerWidth(),h:this.outerHeight()};return(n.w===0||n.h===0)&&(n.w=n.h=1),n},layoutPositions:function(e,n,r){var i=this.nodes().filter(function(k){return!k.isParent()}),l=this.cy(),s=n.eles,u=function(N){return N.id()},f=Fs(r,u);e.emit({type:"layoutstart",layout:e}),e.animations=[];var c=function(N,_,O){var U={x:_.x1+_.w/2,y:_.y1+_.h/2},M={x:(O.x-U.x)*N,y:(O.y-U.y)*N};return{x:U.x+M.x,y:U.y+M.y}},h=n.spacingFactor&&n.spacingFactor!==1,v=function(){if(!h)return null;for(var N=br(),_=0;_<i.length;_++){var O=i[_],U=f(O,_);VS(N,U.x,U.y)}return N},p=v(),m=Fs(function(k,N){var _=f(k,N);if(h){var O=Math.abs(n.spacingFactor);_=c(O,p,_)}return n.transform!=null&&(_=n.transform(k,_)),_},u);if(n.animate){for(var y=0;y<i.length;y++){var S=i[y],w=m(S,y),E=n.animateFilter==null||n.animateFilter(S,y);if(E){var C=S.animation({position:w,duration:n.animationDuration,easing:n.animationEasing});e.animations.push(C)}else S.position(w)}if(n.fit){var T=l.animation({fit:{boundingBox:s.boundingBoxAt(m),padding:n.padding},duration:n.animationDuration,easing:n.animationEasing});e.animations.push(T)}else if(n.zoom!==void 0&&n.pan!==void 0){var A=l.animation({zoom:n.zoom,pan:n.pan,duration:n.animationDuration,easing:n.animationEasing});e.animations.push(A)}e.animations.forEach(function(k){return k.play()}),e.one("layoutready",n.ready),e.emit({type:"layoutready",layout:e}),qs.all(e.animations.map(function(k){return k.promise()})).then(function(){e.one("layoutstop",n.stop),e.emit({type:"layoutstop",layout:e})})}else i.positions(m),n.fit&&l.fit(n.eles,n.padding),n.zoom!=null&&l.zoom(n.zoom),n.pan&&l.pan(n.pan),e.one("layoutready",n.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",n.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var n=this.cy();return n.makeLayout(vt({},e,{eles:this}))}};Tf.createLayout=Tf.makeLayout=Tf.layout;function _C(t,e,n){var r=n._private,i=r.styleCache=r.styleCache||[],l;return(l=i[t])!=null||(l=i[t]=e(n)),l}function cd(t,e){return t=wl(t),function(r){return _C(t,e,r)}}function fd(t,e){t=wl(t);var n=function(i){return e.call(i)};return function(){var i=this[0];if(i)return _C(t,n,i)}}var rr={recalculateRenderedStyle:function(e){var n=this.cy(),r=n.renderer(),i=n.styleEnabled();return r&&i&&r.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),n=function(l){return l._private.styleCache=null};if(e.hasCompoundNodes()){var r;r=this.spawnSelf().merge(this.descendants()).merge(this.parents()),r.merge(r.connectedEdges()),r.forEach(n)}else this.forEach(function(i){n(i),i.connectedEdges().forEach(n)});return this},updateStyle:function(e){var n=this._private.cy;if(!n.styleEnabled())return this;if(n.batching()){var r=n._private.batchStyleEles;return r.merge(this),this}var i=n.hasCompoundNodes(),l=this;e=!!(e||e===void 0),i&&(l=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var s=l;return e?s.emitAndNotify("style"):s.emit("style"),l.forEach(function(u){return u._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var n=0;n<this.length;n++){var r=this[n];r._private.styleDirty&&(r._private.styleDirty=!1,e.style().apply(r))}},parsedStyle:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this[0],i=r.cy();if(i.styleEnabled()&&r){r._private.styleDirty&&(r._private.styleDirty=!1,i.style().apply(r));var l=r._private.style[e];return l??(n?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var n=this[0];if(n.cy().styleEnabled()&&n){var r=n.pstyle(e);return r.pfValue!==void 0?r.pfValue:r.value}},numericStyleUnits:function(e){var n=this[0];if(n.cy().styleEnabled()&&n)return n.pstyle(e).units},renderedStyle:function(e){var n=this.cy();if(!n.styleEnabled())return this;var r=this[0];if(r)return n.style().getRenderedStyle(r,e)},style:function(e,n){var r=this.cy();if(!r.styleEnabled())return this;var i=!1,l=r.style();if(Ut(e)){var s=e;l.applyBypass(this,s,i),this.emitAndNotify("style")}else if(ct(e))if(n===void 0){var u=this[0];return u?l.getStylePropertyValue(u,e):void 0}else l.applyBypass(this,e,n,i),this.emitAndNotify("style");else if(e===void 0){var f=this[0];return f?l.getRawStyle(f):void 0}return this},removeStyle:function(e){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,i=n.style(),l=this;if(e===void 0)for(var s=0;s<l.length;s++){var u=l[s];i.removeAllBypasses(u,r)}else{e=e.split(/\s+/);for(var f=0;f<l.length;f++){var c=l[f];i.removeBypasses(c,e,r)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var n=e.hasCompoundNodes(),r=this[0];if(r){var i=r._private,l=r.pstyle("opacity").value;if(!n)return l;var s=i.data.parent?r.parents():null;if(s)for(var u=0;u<s.length;u++){var f=s[u],c=f.pstyle("opacity").value;l=c*l}return l}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var n=this[0],r=n.cy().hasCompoundNodes();if(n)return r?n.effectiveOpacity()===0:n.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var n=this[0];return!!n._private.backgrounding}};function Xg(t,e){var n=t._private,r=n.data.parent?t.parents():null;if(r)for(var i=0;i<r.length;i++){var l=r[i];if(!e(l))return!1}return!0}function xm(t){var e=t.ok,n=t.edgeOkViaNode||t.ok,r=t.parentOk||t.ok;return function(){var i=this.cy();if(!i.styleEnabled())return!0;var l=this[0],s=i.hasCompoundNodes();if(l){var u=l._private;if(!e(l))return!1;if(l.isNode())return!s||Xg(l,r);var f=u.source,c=u.target;return n(f)&&(!s||Xg(f,n))&&(f===c||n(c)&&(!s||Xg(c,n)))}}}var js=cd("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});rr.takesUpSpace=fd("takesUpSpace",xm({ok:js}));var KM=cd("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&js(t)}),YM=cd("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&js(t)});rr.interactive=fd("interactive",xm({ok:KM,parentOk:YM,edgeOkViaNode:js}));rr.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var XM=cd("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&js(t)}),ZM=js;rr.visible=fd("visible",xm({ok:XM,edgeOkViaNode:ZM}));rr.hidden=function(){var t=this[0];if(t)return!t.visible()};rr.isBundledBezier=fd("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});rr.bypass=rr.css=rr.style;rr.renderedCss=rr.renderedStyle;rr.removeBypass=rr.removeCss=rr.removeStyle;rr.pstyle=rr.parsedStyle;var Li={};function R1(t){return function(){var e=arguments,n=[];if(e.length===2){var r=e[0],i=e[1];this.on(t.event,r,i)}else if(e.length===1&&xn(e[0])){var l=e[0];this.on(t.event,l)}else if(e.length===0||e.length===1&&an(e[0])){for(var s=e.length===1?e[0]:null,u=0;u<this.length;u++){var f=this[u],c=!t.ableField||f._private[t.ableField],h=f._private[t.field]!=t.value;if(t.overrideAble){var v=t.overrideAble(f);if(v!==void 0&&(c=v,!v))return this}c&&(f._private[t.field]=t.value,h&&n.push(f))}var p=this.spawn(n);p.updateStyle(),p.emit(t.event),s&&p.emit(s)}return this}}function Hs(t){Li[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var n=t.overrideField(e);if(n!==void 0)return n}return e._private[t.field]}},Li[t.on]=R1({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Li[t.off]=R1({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Hs({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});Hs({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});Hs({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});Hs({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});Li.deselect=Li.unselect;Li.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};Hs({field:"active",on:"activate",off:"unactivate"});Hs({field:"pannable",on:"panify",off:"unpanify"});Li.inactive=function(){var t=this[0];if(t)return!t._private.active};var fr={},M1=function(e){return function(r){for(var i=this,l=[],s=0;s<i.length;s++){var u=i[s];if(u.isNode()){for(var f=!1,c=u.connectedEdges(),h=0;h<c.length;h++){var v=c[h],p=v.source(),m=v.target();if(e.noIncomingEdges&&m===u&&p!==u||e.noOutgoingEdges&&p===u&&m!==u){f=!0;break}}f||l.push(u)}}return this.spawn(l,!0).filter(r)}},O1=function(e){return function(n){for(var r=this,i=[],l=0;l<r.length;l++){var s=r[l];if(s.isNode())for(var u=s.connectedEdges(),f=0;f<u.length;f++){var c=u[f],h=c.source(),v=c.target();e.outgoing&&h===s?(i.push(c),i.push(v)):e.incoming&&v===s&&(i.push(c),i.push(h))}}return this.spawn(i,!0).filter(n)}},B1=function(e){return function(n){for(var r=this,i=[],l={};;){var s=e.outgoing?r.outgoers():r.incomers();if(s.length===0)break;for(var u=!1,f=0;f<s.length;f++){var c=s[f],h=c.id();l[h]||(l[h]=!0,i.push(c),u=!0)}if(!u)break;r=s}return this.spawn(i,!0).filter(n)}};fr.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};vt(fr,{roots:M1({noIncomingEdges:!0}),leaves:M1({noOutgoingEdges:!0}),outgoers:la(O1({outgoing:!0}),"outgoers"),successors:B1({outgoing:!0}),incomers:la(O1({incoming:!0}),"incomers"),predecessors:B1({})});vt(fr,{neighborhood:la(function(t){for(var e=[],n=this.nodes(),r=0;r<n.length;r++)for(var i=n[r],l=i.connectedEdges(),s=0;s<l.length;s++){var u=l[s],f=u.source(),c=u.target(),h=i===f?c:f;h.length>0&&e.push(h[0]),e.push(u[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});fr.neighbourhood=fr.neighborhood;fr.closedNeighbourhood=fr.closedNeighborhood;fr.openNeighbourhood=fr.openNeighborhood;vt(fr,{source:la(function(e){var n=this[0],r;return n&&(r=n._private.source||n.cy().collection()),r&&e?r.filter(e):r},"source"),target:la(function(e){var n=this[0],r;return n&&(r=n._private.target||n.cy().collection()),r&&e?r.filter(e):r},"target"),sources:L1({attr:"source"}),targets:L1({attr:"target"})});function L1(t){return function(n){for(var r=[],i=0;i<this.length;i++){var l=this[i],s=l._private[t.attr];s&&r.push(s)}return this.spawn(r,!0).filter(n)}}vt(fr,{edgesWith:la(F1(),"edgesWith"),edgesTo:la(F1({thisIsSrc:!0}),"edgesTo")});function F1(t){return function(n){var r=[],i=this._private.cy,l=t||{};ct(n)&&(n=i.$(n));for(var s=0;s<n.length;s++)for(var u=n[s]._private.edges,f=0;f<u.length;f++){var c=u[f],h=c._private.data,v=this.hasElementWithId(h.source)&&n.hasElementWithId(h.target),p=n.hasElementWithId(h.source)&&this.hasElementWithId(h.target),m=v||p;m&&((l.thisIsSrc||l.thisIsTgt)&&(l.thisIsSrc&&!v||l.thisIsTgt&&!p)||r.push(c))}return this.spawn(r,!0)}}vt(fr,{connectedEdges:la(function(t){for(var e=[],n=this,r=0;r<n.length;r++){var i=n[r];if(i.isNode())for(var l=i._private.edges,s=0;s<l.length;s++){var u=l[s];e.push(u)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:la(function(t){for(var e=[],n=this,r=0;r<n.length;r++){var i=n[r];i.isEdge()&&(e.push(i.source()[0]),e.push(i.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:la(I1(),"parallelEdges"),codirectedEdges:la(I1({codirected:!0}),"codirectedEdges")});function I1(t){var e={codirected:!1};return t=vt({},e,t),function(r){for(var i=[],l=this.edges(),s=t,u=0;u<l.length;u++)for(var f=l[u],c=f._private,h=c.source,v=h._private.data.id,p=c.data.target,m=h._private.edges,y=0;y<m.length;y++){var S=m[y],w=S._private.data,E=w.target,C=w.source,T=E===p&&C===v,A=v===E&&p===C;(s.codirected&&T||!s.codirected&&(T||A))&&i.push(S)}return this.spawn(i,!0).filter(r)}}vt(fr,{components:function(e){var n=this,r=n.cy(),i=r.collection(),l=e==null?n.nodes():e.nodes(),s=[];e!=null&&l.empty()&&(l=e.sources());var u=function(h,v){i.merge(h),l.unmerge(h),v.merge(h)};if(l.empty())return n.spawn();var f=function(){var h=r.collection();s.push(h);var v=l[0];u(v,h),n.bfs({directed:!1,roots:v,visit:function(m){return u(m,h)}}),h.forEach(function(p){p.connectedEdges().forEach(function(m){n.has(m)&&h.has(m.source())&&h.has(m.target())&&h.merge(m)})})};do f();while(l.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});fr.componentsOf=fr.components;var ar=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){gn("A collection must have a reference to the core");return}var l=new Ya,s=!1;if(!n)n=[];else if(n.length>0&&Ut(n[0])&&!Su(n[0])){s=!0;for(var u=[],f=new Us,c=0,h=n.length;c<h;c++){var v=n[c];v.data==null&&(v.data={});var p=v.data;if(p.id==null)p.id=jS();else if(e.hasElementWithId(p.id)||f.has(p.id))continue;var m=new td(e,v,!1);u.push(m),f.add(p.id)}n=u}this.length=0;for(var y=0,S=n.length;y<S;y++){var w=n[y][0];if(w!=null){var E=w._private.data.id;(!r||!l.has(E))&&(r&&l.set(E,{index:this.length,ele:w}),this[this.length]=w,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(C){this.lazyMap=C},rebuildMap:function(){for(var T=this.lazyMap=new Ya,A=this.eles,k=0;k<A.length;k++){var N=A[k];T.set(N.id(),{index:k,ele:N})}}},r&&(this._private.map=l),s&&!i&&this.restore()},un=td.prototype=ar.prototype=Object.create(Array.prototype);un.instanceString=function(){return"collection"};un.spawn=function(t,e){return new ar(this.cy(),t,e)};un.spawnSelf=function(){return this.spawn(this)};un.cy=function(){return this._private.cy};un.renderer=function(){return this._private.cy.renderer()};un.element=function(){return this[0]};un.collection=function(){return _S(this)?this:new ar(this._private.cy,[this])};un.unique=function(){return new ar(this._private.cy,this,!0)};un.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};un.getElementById=function(t){t=""+t;var e=this._private.cy,n=this._private.map.get(t);return n?n.ele:new ar(e)};un.$id=un.getElementById;un.poolIndex=function(){var t=this._private.cy,e=t._private.elements,n=this[0]._private.data.id;return e._private.map.get(n).index};un.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};un.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};un.json=function(t){var e=this.element(),n=this.cy();if(e==null&&t)return this;if(e!=null){var r=e._private;if(Ut(t)){if(n.startBatch(),t.data){e.data(t.data);var i=r.data;if(e.isEdge()){var l=!1,s={},u=t.data.source,f=t.data.target;u!=null&&u!=i.source&&(s.source=""+u,l=!0),f!=null&&f!=i.target&&(s.target=""+f,l=!0),l&&(e=e.move(s))}else{var c="parent"in t.data,h=t.data.parent;c&&(h!=null||i.parent!=null)&&h!=i.parent&&(h===void 0&&(h=null),h!=null&&(h=""+h),e=e.move({parent:h}))}}t.position&&e.position(t.position);var v=function(S,w,E){var C=t[S];C!=null&&C!==r[S]&&(C?e[w]():e[E]())};return v("removed","remove","restore"),v("selected","select","unselect"),v("selectable","selectify","unselectify"),v("locked","lock","unlock"),v("grabbable","grabify","ungrabify"),v("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),n.endBatch(),this}else if(t===void 0){var p={data:Ca(r.data),position:Ca(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:null};p.classes="";var m=0;return r.classes.forEach(function(y){return p.classes+=m++===0?y:" "+y}),p}}};un.jsons=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e],r=n.json();t.push(r)}return t};un.clone=function(){for(var t=this.cy(),e=[],n=0;n<this.length;n++){var r=this[n],i=r.json(),l=new td(t,i,!1);e.push(l)}return new ar(t,e)};un.copy=un.clone;un.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=n.cy(),i=r._private,l=[],s=[],u,f=0,c=n.length;f<c;f++){var h=n[f];e&&!h.removed()||(h.isNode()?l.push(h):s.push(h))}u=l.concat(s);var v,p=function(){u.splice(v,1),v--};for(v=0;v<u.length;v++){var m=u[v],y=m._private,S=y.data;if(m.clearTraversalCache(),!(!e&&!y.removed)){if(S.id===void 0)S.id=jS();else if(Ge(S.id))S.id=""+S.id;else if(Fi(S.id)||!ct(S.id)){gn("Can not create element with invalid string ID `"+S.id+"`"),p();continue}else if(r.hasElementWithId(S.id)){gn("Can not create second element with ID `"+S.id+"`"),p();continue}}var w=S.id;if(m.isNode()){var E=y.position;E.x==null&&(E.x=0),E.y==null&&(E.y=0)}if(m.isEdge()){for(var C=m,T=["source","target"],A=T.length,k=!1,N=0;N<A;N++){var _=T[N],O=S[_];Ge(O)&&(O=S[_]=""+S[_]),O==null||O===""?(gn("Can not create edge `"+w+"` with unspecified "+_),k=!0):r.hasElementWithId(O)||(gn("Can not create edge `"+w+"` with nonexistent "+_+" `"+O+"`"),k=!0)}if(k){p();continue}var U=r.getElementById(S.source),M=r.getElementById(S.target);U.same(M)?U._private.edges.push(C):(U._private.edges.push(C),M._private.edges.push(C)),C._private.source=U,C._private.target=M}y.map=new Ya,y.map.set(w,{ele:m,index:0}),y.removed=!1,e&&r.addToPool(m)}for(var I=0;I<l.length;I++){var P=l[I],j=P._private.data;Ge(j.parent)&&(j.parent=""+j.parent);var K=j.parent,$=K!=null;if($||P._private.parent){var B=P._private.parent?r.collection().merge(P._private.parent):r.getElementById(K);if(B.empty())j.parent=void 0;else if(B[0].removed())$t("Node added with missing parent, reference to parent removed"),j.parent=void 0,P._private.parent=null;else{for(var H=!1,Y=B;!Y.empty();){if(P.same(Y)){H=!0,j.parent=void 0;break}Y=Y.parent()}H||(B[0]._private.children.push(P),P._private.parent=B[0],i.hasCompoundNodes=!0)}}}if(u.length>0){for(var Q=u.length===n.length?n:new ar(r,u),z=0;z<Q.length;z++){var F=Q[z];F.isNode()||(F.parallelEdges().clearTraversalCache(),F.source().clearTraversalCache(),F.target().clearTraversalCache())}var q;i.hasCompoundNodes?q=r.collection().merge(Q).merge(Q.connectedNodes()).merge(Q.parent()):q=Q,q.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?Q.emitAndNotify("add"):e&&Q.emit("add")}return n};un.removed=function(){var t=this[0];return t&&t._private.removed};un.inside=function(){var t=this[0];return t&&!t._private.removed};un.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=[],i={},l=n._private.cy;function s(K){for(var $=K._private.edges,B=0;B<$.length;B++)f($[B])}function u(K){for(var $=K._private.children,B=0;B<$.length;B++)f($[B])}function f(K){var $=i[K.id()];e&&K.removed()||$||(i[K.id()]=!0,K.isNode()?(r.push(K),s(K),u(K)):r.unshift(K))}for(var c=0,h=n.length;c<h;c++){var v=n[c];f(v)}function p(K,$){var B=K._private.edges;Ii(B,$),K.clearTraversalCache()}function m(K){K.clearTraversalCache()}var y=[];y.ids={};function S(K,$){$=$[0],K=K[0];var B=K._private.children,H=K.id();Ii(B,$),$._private.parent=null,y.ids[H]||(y.ids[H]=!0,y.push(K))}n.dirtyCompoundBoundsCache(),e&&l.removeFromPool(r);for(var w=0;w<r.length;w++){var E=r[w];if(E.isEdge()){var C=E.source()[0],T=E.target()[0];p(C,E),p(T,E);for(var A=E.parallelEdges(),k=0;k<A.length;k++){var N=A[k];m(N),N.isBundledBezier()&&N.dirtyBoundingBoxCache()}}else{var _=E.parent();_.length!==0&&S(_,E)}e&&(E._private.removed=!0)}var O=l._private.elements;l._private.hasCompoundNodes=!1;for(var U=0;U<O.length;U++){var M=O[U];if(M.isParent()){l._private.hasCompoundNodes=!0;break}}var I=new ar(this.cy(),r);I.size()>0&&(t?I.emitAndNotify("remove"):e&&I.emit("remove"));for(var P=0;P<y.length;P++){var j=y[P];(!e||!j.removed())&&j.updateStyle()}return I};un.move=function(t){var e=this._private.cy,n=this,r=!1,i=!1,l=function(y){return y==null?y:""+y};if(t.source!==void 0||t.target!==void 0){var s=l(t.source),u=l(t.target),f=s!=null&&e.hasElementWithId(s),c=u!=null&&e.hasElementWithId(u);(f||c)&&(e.batch(function(){n.remove(r,i),n.emitAndNotify("moveout");for(var m=0;m<n.length;m++){var y=n[m],S=y._private.data;y.isEdge()&&(f&&(S.source=s),c&&(S.target=u))}n.restore(r,i)}),n.emitAndNotify("move"))}else if(t.parent!==void 0){var h=l(t.parent),v=h===null||e.hasElementWithId(h);if(v){var p=h===null?void 0:h;e.batch(function(){var m=n.remove(r,i);m.emitAndNotify("moveout");for(var y=0;y<n.length;y++){var S=n[y],w=S._private.data;S.isNode()&&(w.parent=p)}m.restore(r,i)}),n.emitAndNotify("move")}}return this};[eC,sM,Cf,Bi,zs,SM,od,PM,TC,DC,GM,Uf,Tf,rr,Li,fr].forEach(function(t){vt(un,t)});var QM={add:function(e){var n,r=this;if(Hr(e)){var i=e;if(i._private.cy===r)n=i.restore();else{for(var l=[],s=0;s<i.length;s++){var u=i[s];l.push(u.json())}n=new ar(r,l)}}else if(an(e)){var f=e;n=new ar(r,f)}else if(Ut(e)&&(an(e.nodes)||an(e.edges))){for(var c=e,h=[],v=["nodes","edges"],p=0,m=v.length;p<m;p++){var y=v[p],S=c[y];if(an(S))for(var w=0,E=S.length;w<E;w++){var C=vt({group:y},S[w]);h.push(C)}}n=new ar(r,h)}else{var T=e;n=new td(r,T).collection()}return n},remove:function(e){if(!Hr(e)){if(ct(e)){var n=e;e=this.$(n)}}return e.remove()}};function WM(t,e,n,r){var i=4,l=.001,s=1e-7,u=10,f=11,c=1/(f-1),h=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var v=0;v<4;++v)if(typeof arguments[v]!="number"||isNaN(arguments[v])||!isFinite(arguments[v]))return!1;t=Math.min(t,1),n=Math.min(n,1),t=Math.max(t,0),n=Math.max(n,0);var p=h?new Float32Array(f):new Array(f);function m(M,I){return 1-3*I+3*M}function y(M,I){return 3*I-6*M}function S(M){return 3*M}function w(M,I,P){return((m(I,P)*M+y(I,P))*M+S(I))*M}function E(M,I,P){return 3*m(I,P)*M*M+2*y(I,P)*M+S(I)}function C(M,I){for(var P=0;P<i;++P){var j=E(I,t,n);if(j===0)return I;var K=w(I,t,n)-M;I-=K/j}return I}function T(){for(var M=0;M<f;++M)p[M]=w(M*c,t,n)}function A(M,I,P){var j,K,$=0;do K=I+(P-I)/2,j=w(K,t,n)-M,j>0?P=K:I=K;while(Math.abs(j)>s&&++$<u);return K}function k(M){for(var I=0,P=1,j=f-1;P!==j&&p[P]<=M;++P)I+=c;--P;var K=(M-p[P])/(p[P+1]-p[P]),$=I+K*c,B=E($,t,n);return B>=l?C(M,$):B===0?$:A(M,I,I+c)}var N=!1;function _(){N=!0,(t!==e||n!==r)&&T()}var O=function(I){return N||_(),t===e&&n===r?I:I===0?0:I===1?1:w(k(I),e,r)};O.getControlPoints=function(){return[{x:t,y:e},{x:n,y:r}]};var U="generateBezier("+[t,e,n,r]+")";return O.toString=function(){return U},O}var JM=(function(){function t(r){return-r.tension*r.x-r.friction*r.v}function e(r,i,l){var s={x:r.x+l.dx*i,v:r.v+l.dv*i,tension:r.tension,friction:r.friction};return{dx:s.v,dv:t(s)}}function n(r,i){var l={dx:r.v,dv:t(r)},s=e(r,i*.5,l),u=e(r,i*.5,s),f=e(r,i,u),c=1/6*(l.dx+2*(s.dx+u.dx)+f.dx),h=1/6*(l.dv+2*(s.dv+u.dv)+f.dv);return r.x=r.x+c*i,r.v=r.v+h*i,r}return function r(i,l,s){var u={x:-1,v:0,tension:null,friction:null},f=[0],c=0,h=1/1e4,v=16/1e3,p,m,y;for(i=parseFloat(i)||500,l=parseFloat(l)||20,s=s||null,u.tension=i,u.friction=l,p=s!==null,p?(c=r(i,l),m=c/s*v):m=v;y=n(y||u,m),f.push(1+y.x),c+=16,Math.abs(y.x)>h&&Math.abs(y.v)>h;);return p?function(S){return f[S*(f.length-1)|0]}:c}})(),sn=function(e,n,r,i){var l=WM(e,n,r,i);return function(s,u,f){return s+(u-s)*l(f)}},Df={linear:function(e,n,r){return e+(n-e)*r},ease:sn(.25,.1,.25,1),"ease-in":sn(.42,0,1,1),"ease-out":sn(0,0,.58,1),"ease-in-out":sn(.42,0,.58,1),"ease-in-sine":sn(.47,0,.745,.715),"ease-out-sine":sn(.39,.575,.565,1),"ease-in-out-sine":sn(.445,.05,.55,.95),"ease-in-quad":sn(.55,.085,.68,.53),"ease-out-quad":sn(.25,.46,.45,.94),"ease-in-out-quad":sn(.455,.03,.515,.955),"ease-in-cubic":sn(.55,.055,.675,.19),"ease-out-cubic":sn(.215,.61,.355,1),"ease-in-out-cubic":sn(.645,.045,.355,1),"ease-in-quart":sn(.895,.03,.685,.22),"ease-out-quart":sn(.165,.84,.44,1),"ease-in-out-quart":sn(.77,0,.175,1),"ease-in-quint":sn(.755,.05,.855,.06),"ease-out-quint":sn(.23,1,.32,1),"ease-in-out-quint":sn(.86,0,.07,1),"ease-in-expo":sn(.95,.05,.795,.035),"ease-out-expo":sn(.19,1,.22,1),"ease-in-out-expo":sn(1,0,0,1),"ease-in-circ":sn(.6,.04,.98,.335),"ease-out-circ":sn(.075,.82,.165,1),"ease-in-out-circ":sn(.785,.135,.15,.86),spring:function(e,n,r){if(r===0)return Df.linear;var i=JM(e,n,r);return function(l,s,u){return l+(s-l)*i(u)}},"cubic-bezier":sn};function z1(t,e,n,r,i){if(r===1||e===n)return n;var l=i(e,n,r);return t==null||((t.roundValue||t.color)&&(l=Math.round(l)),t.min!==void 0&&(l=Math.max(l,t.min)),t.max!==void 0&&(l=Math.min(l,t.max))),l}function P1(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function gs(t,e,n,r,i){var l=i!=null?i.type:null;n<0?n=0:n>1&&(n=1);var s=P1(t,i),u=P1(e,i);if(Ge(s)&&Ge(u))return z1(l,s,u,n,r);if(an(s)&&an(u)){for(var f=[],c=0;c<u.length;c++){var h=s[c],v=u[c];if(h!=null&&v!=null){var p=z1(l,h,v,n,r);f.push(p)}else f.push(v)}return f}}function eO(t,e,n,r){var i=!r,l=t._private,s=e._private,u=s.easing,f=s.startTime,c=r?t:t.cy(),h=c.style();if(!s.easingImpl)if(u==null)s.easingImpl=Df.linear;else{var v;if(ct(u)){var p=h.parse("transition-timing-function",u);v=p.value}else v=u;var m,y;ct(v)?(m=v,y=[]):(m=v[1],y=v.slice(2).map(function(Q){return+Q})),y.length>0?(m==="spring"&&y.push(s.duration),s.easingImpl=Df[m].apply(null,y)):s.easingImpl=Df[m]}var S=s.easingImpl,w;if(s.duration===0?w=1:w=(n-f)/s.duration,s.applying&&(w=s.progress),w<0?w=0:w>1&&(w=1),s.delay==null){var E=s.startPosition,C=s.position;if(C&&i&&!t.locked()){var T={};Go(E.x,C.x)&&(T.x=gs(E.x,C.x,w,S)),Go(E.y,C.y)&&(T.y=gs(E.y,C.y,w,S)),t.position(T)}var A=s.startPan,k=s.pan,N=l.pan,_=k!=null&&r;_&&(Go(A.x,k.x)&&(N.x=gs(A.x,k.x,w,S)),Go(A.y,k.y)&&(N.y=gs(A.y,k.y,w,S)),t.emit("pan"));var O=s.startZoom,U=s.zoom,M=U!=null&&r;M&&(Go(O,U)&&(l.zoom=du(l.minZoom,gs(O,U,w,S),l.maxZoom)),t.emit("zoom")),(_||M)&&t.emit("viewport");var I=s.style;if(I&&I.length>0&&i){for(var P=0;P<I.length;P++){var j=I[P],K=j.name,$=j,B=s.startStyle[K],H=h.properties[B.name],Y=gs(B,$,w,S,H);h.overrideBypass(t,K,Y)}t.emit("style")}}return s.progress=w,w}function Go(t,e){return t==null||e==null?!1:Ge(t)&&Ge(e)?!0:!!(t&&e)}function tO(t,e,n,r){var i=e._private;i.started=!0,i.startTime=n-i.progress*i.duration}function U1(t,e){var n=e._private.aniEles,r=[];function i(h,v){var p=h._private,m=p.animation.current,y=p.animation.queue,S=!1;if(m.length===0){var w=y.shift();w&&m.push(w)}for(var E=function(N){for(var _=N.length-1;_>=0;_--){var O=N[_];O()}N.splice(0,N.length)},C=m.length-1;C>=0;C--){var T=m[C],A=T._private;if(A.stopped){m.splice(C,1),A.hooked=!1,A.playing=!1,A.started=!1,E(A.frames);continue}!A.playing&&!A.applying||(A.playing&&A.applying&&(A.applying=!1),A.started||tO(h,T,t),eO(h,T,t,v),A.applying&&(A.applying=!1),E(A.frames),A.step!=null&&A.step(t),T.completed()&&(m.splice(C,1),A.hooked=!1,A.playing=!1,A.started=!1,E(A.completes)),S=!0)}return!v&&m.length===0&&y.length===0&&r.push(h),S}for(var l=!1,s=0;s<n.length;s++){var u=n[s],f=i(u);l=l||f}var c=i(e,!0);(l||c)&&(n.length>0?e.notify("draw",n):e.notify("draw")),n.unmerge(r),e.emit("step")}var nO={animate:Vt.animate(),animation:Vt.animation(),animated:Vt.animated(),clearQueue:Vt.clearQueue(),delay:Vt.delay(),delayAnimation:Vt.delayAnimation(),stop:Vt.stop(),addToAnimationPool:function(e){var n=this;n.styleEnabled()&&n._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function n(){e._private.animationsRunning&&Lf(function(l){U1(l,e),n()})}var r=e.renderer();r&&r.beforeRender?r.beforeRender(function(l,s){U1(s,e)},r.beforeRenderPriorities.animations):n()}},rO={qualifierCompare:function(e,n){return e==null||n==null?e==null&&n==null:e.sameText(n)},eventMatches:function(e,n,r){var i=n.qualifier;return i!=null?e!==r.target&&Su(r.target)&&i.matches(r.target):!0},addEventFields:function(e,n){n.cy=e,n.target=e},callbackContext:function(e,n,r){return n.qualifier!=null?r.target:e}},sf=function(e){return ct(e)?new Pi(e):e},NC={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new ud(rO,this)),this},emitter:function(){return this._private.emitter},on:function(e,n,r){return this.emitter().on(e,sf(n),r),this},removeListener:function(e,n,r){return this.emitter().removeListener(e,sf(n),r),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,n,r){return this.emitter().one(e,sf(n),r),this},once:function(e,n,r){return this.emitter().one(e,sf(n),r),this},emit:function(e,n){return this.emitter().emit(e,n),this},emitAndNotify:function(e,n){return this.emit(e),this.notify(e,n),this}};Vt.eventAliasesOn(NC);var Lp={png:function(e){var n=this._private.renderer;return e=e||{},n.png(e)},jpg:function(e){var n=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",n.jpg(e)}};Lp.jpeg=Lp.jpg;var Af={layout:function(e){var n=this;if(e==null){gn("Layout options must be specified to make a layout");return}if(e.name==null){gn("A `name` must be specified to make a layout");return}var r=e.name,i=n.extension("layout",r);if(i==null){gn("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var l;ct(e.eles)?l=n.$(e.eles):l=e.eles!=null?e.eles:n.$();var s=new i(vt({},e,{cy:n,eles:l}));return s}};Af.createLayout=Af.makeLayout=Af.layout;var aO={notify:function(e,n){var r=this._private;if(this.batching()){r.batchNotifications=r.batchNotifications||{};var i=r.batchNotifications[e]=r.batchNotifications[e]||this.collection();n!=null&&i.merge(n);return}if(r.notificationsEnabled){var l=this.renderer();this.destroyed()||!l||l.notify(e,n)}},notifications:function(e){var n=this._private;return e===void 0?n.notificationsEnabled:(n.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var n=this.renderer();Object.keys(e.batchNotifications).forEach(function(r){var i=e.batchNotifications[r];i.empty()?n.notify(r):n.notify(r,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var n=this;return this.batch(function(){for(var r=Object.keys(e),i=0;i<r.length;i++){var l=r[i],s=e[l],u=n.getElementById(l);u.data(s)}})}},iO=ir({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),Fp={renderTo:function(e,n,r,i){var l=this._private.renderer;return l.renderTo(e,n,r,i),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var n=this,r=n.extension("renderer",e.name);if(r==null){gn("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&$t("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var i=iO(e);i.cy=n,n._private.renderer=new r(i),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var n=e.container();if(n)for(n._cyreg=null;n.childNodes.length>0;)n.removeChild(n.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(r){var i=r._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Fp.invalidateDimensions=Fp.resize;var _f={collection:function(e,n){return ct(e)?this.$(e):Hr(e)?e.collection():an(e)?(n||(n={}),new ar(this,e,n.unique,n.removed)):new ar(this)},nodes:function(e){var n=this.$(function(r){return r.isNode()});return e?n.filter(e):n},edges:function(e){var n=this.$(function(r){return r.isEdge()});return e?n.filter(e):n},$:function(e){var n=this._private.elements;return e?n.filter(e):n.spawnSelf()},mutableElements:function(){return this._private.elements}};_f.elements=_f.filter=_f.$;var Zn={},ru="t",lO="f";Zn.apply=function(t){for(var e=this,n=e._private,r=n.cy,i=r.collection(),l=0;l<t.length;l++){var s=t[l],u=e.getContextMeta(s);if(!u.empty){var f=e.getContextStyle(u),c=e.applyContextStyle(u,f,s);s._private.appliedInitStyle?e.updateTransitions(s,c.diffProps):s._private.appliedInitStyle=!0;var h=e.updateStyleHints(s);h&&i.push(s)}}return i};Zn.getPropertiesDiff=function(t,e){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},i=t+"-"+e,l=r[i];if(l)return l;for(var s=[],u={},f=0;f<n.length;f++){var c=n[f],h=t[f]===ru,v=e[f]===ru,p=h!==v,m=c.mappedProperties.length>0;if(p||v&&m){var y=void 0;p&&m||p?y=c.properties:m&&(y=c.mappedProperties);for(var S=0;S<y.length;S++){for(var w=y[S],E=w.name,C=!1,T=f+1;T<n.length;T++){var A=n[T],k=e[T]===ru;if(k&&(C=A.properties[w.name]!=null,C))break}!u[E]&&!C&&(u[E]=!0,s.push(E))}}}return r[i]=s,s};Zn.getContextMeta=function(t){for(var e=this,n="",r,i=t._private.styleCxtKey||"",l=0;l<e.length;l++){var s=e[l],u=s.selector&&s.selector.matches(t);u?n+=ru:n+=lO}return r=e.getPropertiesDiff(i,n),t._private.styleCxtKey=n,{key:n,diffPropNames:r,empty:r.length===0}};Zn.getContextStyle=function(t){var e=t.key,n=this,r=this._private.contextStyles=this._private.contextStyles||{};if(r[e])return r[e];for(var i={_private:{key:e}},l=0;l<n.length;l++){var s=n[l],u=e[l]===ru;if(u)for(var f=0;f<s.properties.length;f++){var c=s.properties[f];i[c.name]=c}}return r[e]=i,i};Zn.applyContextStyle=function(t,e,n){for(var r=this,i=t.diffPropNames,l={},s=r.types,u=0;u<i.length;u++){var f=i[u],c=e[f],h=n.pstyle(f);if(!c)if(h)h.bypass?c={name:f,deleteBypassed:!0}:c={name:f,delete:!0};else continue;if(h!==c){if(c.mapped===s.fn&&h!=null&&h.mapping!=null&&h.mapping.value===c.value){var v=h.mapping,p=v.fnValue=c.value(n);if(p===v.prevFnValue)continue}var m=l[f]={prev:h};r.applyParsedProperty(n,c),m.next=n.pstyle(f),m.next&&m.next.bypass&&(m.next=m.next.bypassed)}}return{diffProps:l}};Zn.updateStyleHints=function(t){var e=t._private,n=this,r=n.propertyGroupNames,i=n.propertyGroupKeys,l=function(fe,xe,Re){return n.getPropertiesHash(fe,xe,Re)},s=e.styleKey;if(t.removed())return!1;var u=e.group==="nodes",f=t._private.style;r=Object.keys(f);for(var c=0;c<i.length;c++){var h=i[c];e.styleKeys[h]=[bl,Cs]}for(var v=function(fe,xe){return e.styleKeys[xe][0]=uu(fe,e.styleKeys[xe][0])},p=function(fe,xe){return e.styleKeys[xe][1]=cu(fe,e.styleKeys[xe][1])},m=function(fe,xe){v(fe,xe),p(fe,xe)},y=function(fe,xe){for(var Re=0;Re<fe.length;Re++){var Xe=fe.charCodeAt(Re);v(Xe,xe),p(Xe,xe)}},S=2e9,w=function(fe){return-128<fe&&fe<128&&Math.floor(fe)!==fe?S-(fe*1024|0):fe},E=0;E<r.length;E++){var C=r[E],T=f[C];if(T!=null){var A=this.properties[C],k=A.type,N=A.groupKey,_=void 0;A.hashOverride!=null?_=A.hashOverride(t,T):T.pfValue!=null&&(_=T.pfValue);var O=A.enums==null?T.value:null,U=_!=null,M=O!=null,I=U||M,P=T.units;if(k.number&&I&&!k.multiple){var j=U?_:O;m(w(j),N),!U&&P!=null&&y(P,N)}else y(T.strValue,N)}}for(var K=[bl,Cs],$=0;$<i.length;$++){var B=i[$],H=e.styleKeys[B];K[0]=uu(H[0],K[0]),K[1]=cu(H[1],K[1])}e.styleKey=wk(K[0],K[1]);var Y=e.styleKeys;e.labelDimsKey=Ti(Y.labelDimensions);var Q=l(t,["label"],Y.labelDimensions);if(e.labelKey=Ti(Q),e.labelStyleKey=Ti(Wc(Y.commonLabel,Q)),!u){var z=l(t,["source-label"],Y.labelDimensions);e.sourceLabelKey=Ti(z),e.sourceLabelStyleKey=Ti(Wc(Y.commonLabel,z));var F=l(t,["target-label"],Y.labelDimensions);e.targetLabelKey=Ti(F),e.targetLabelStyleKey=Ti(Wc(Y.commonLabel,F))}if(u){var q=e.styleKeys,L=q.nodeBody,W=q.nodeBorder,ae=q.nodeOutline,se=q.backgroundImage,me=q.compound,Ne=q.pie,pe=q.stripe,ee=[L,W,ae,se,me,Ne,pe].filter(function(le){return le!=null}).reduce(Wc,[bl,Cs]);e.nodeKey=Ti(ee),e.hasPie=Ne!=null&&Ne[0]!==bl&&Ne[1]!==Cs,e.hasStripe=pe!=null&&pe[0]!==bl&&pe[1]!==Cs}return s!==e.styleKey};Zn.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null,e.hasStripe=null};Zn.applyParsedProperty=function(t,e){var n=this,r=e,i=t._private.style,l,s=n.types,u=n.properties[r.name].type,f=r.bypass,c=i[r.name],h=c&&c.bypass,v=t._private,p="mapping",m=function(L){return L==null?null:L.pfValue!=null?L.pfValue:L.value},y=function(){var L=m(c),W=m(r);n.checkTriggers(t,r.name,L,W)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(r=e=this.parse(e.name,"bezier",f)),r.delete)return i[r.name]=void 0,y(),!0;if(r.deleteBypassed)return c?c.bypass?(c.bypassed=void 0,y(),!0):!1:(y(),!0);if(r.deleteBypass)return c?c.bypass?(i[r.name]=c.bypassed,y(),!0):!1:(y(),!0);var S=function(){$t("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+r.name+"` with data field `"+r.field+"`); try a `["+r.field+"]` selector to limit scope to elements with `"+r.field+"` defined")};switch(r.mapped){case s.mapData:{for(var w=r.field.split("."),E=v.data,C=0;C<w.length&&E;C++){var T=w[C];E=E[T]}if(E==null)return S(),!1;var A;if(Ge(E)){var k=r.fieldMax-r.fieldMin;k===0?A=0:A=(E-r.fieldMin)/k}else return $t("Do not use continuous mappers without specifying numeric data (i.e. `"+r.field+": "+E+"` for `"+t.id()+"` is non-numeric)"),!1;if(A<0?A=0:A>1&&(A=1),u.color){var N=r.valueMin[0],_=r.valueMax[0],O=r.valueMin[1],U=r.valueMax[1],M=r.valueMin[2],I=r.valueMax[2],P=r.valueMin[3]==null?1:r.valueMin[3],j=r.valueMax[3]==null?1:r.valueMax[3],K=[Math.round(N+(_-N)*A),Math.round(O+(U-O)*A),Math.round(M+(I-M)*A),Math.round(P+(j-P)*A)];l={bypass:r.bypass,name:r.name,value:K,strValue:"rgb("+K[0]+", "+K[1]+", "+K[2]+")"}}else if(u.number){var $=r.valueMin+(r.valueMax-r.valueMin)*A;l=this.parse(r.name,$,r.bypass,p)}else return!1;if(!l)return S(),!1;l.mapping=r,r=l;break}case s.data:{for(var B=r.field.split("."),H=v.data,Y=0;Y<B.length&&H;Y++){var Q=B[Y];H=H[Q]}if(H!=null&&(l=this.parse(r.name,H,r.bypass,p)),!l)return S(),!1;l.mapping=r,r=l;break}case s.fn:{var z=r.value,F=r.fnValue!=null?r.fnValue:z(t);if(r.prevFnValue=F,F==null)return $t("Custom function mappers may not return null (i.e. `"+r.name+"` for ele `"+t.id()+"` is null)"),!1;if(l=this.parse(r.name,F,r.bypass,p),!l)return $t("Custom function mappers may not return invalid values for the property type (i.e. `"+r.name+"` for ele `"+t.id()+"` is invalid)"),!1;l.mapping=Ca(r),r=l;break}case void 0:break;default:return!1}return f?(h?r.bypassed=c.bypassed:r.bypassed=c,i[r.name]=r):h?c.bypassed=r:i[r.name]=r,y(),!0};Zn.cleanElements=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),!e)r._private.style={};else for(var i=r._private.style,l=Object.keys(i),s=0;s<l.length;s++){var u=l[s],f=i[u];f!=null&&(f.bypass?f.bypassed=null:i[u]=null)}}};Zn.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};Zn.updateTransitions=function(t,e){var n=this,r=t._private,i=t.pstyle("transition-property").value,l=t.pstyle("transition-duration").pfValue,s=t.pstyle("transition-delay").pfValue;if(i.length>0&&l>0){for(var u={},f=!1,c=0;c<i.length;c++){var h=i[c],v=t.pstyle(h),p=e[h];if(p){var m=p.prev,y=m,S=p.next!=null?p.next:v,w=!1,E=void 0,C=1e-6;y&&(Ge(y.pfValue)&&Ge(S.pfValue)?(w=S.pfValue-y.pfValue,E=y.pfValue+C*w):Ge(y.value)&&Ge(S.value)?(w=S.value-y.value,E=y.value+C*w):an(y.value)&&an(S.value)&&(w=y.value[0]!==S.value[0]||y.value[1]!==S.value[1]||y.value[2]!==S.value[2],E=y.strValue),w&&(u[h]=S.strValue,this.applyBypass(t,h,E),f=!0))}}if(!f)return;r.transitioning=!0,new qs(function(T){s>0?t.delayAnimation(s).play().promise().then(T):T()}).then(function(){return t.animation({style:u,duration:l,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(t,i),t.emitAndNotify("style"),r.transitioning=!1})}else r.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),r.transitioning=!1)};Zn.checkTrigger=function(t,e,n,r,i,l){var s=this.properties[e],u=i(s);t.removed()||u!=null&&u(n,r,t)&&l(s)};Zn.checkZOrderTrigger=function(t,e,n,r){var i=this;this.checkTrigger(t,e,n,r,function(l){return l.triggersZOrder},function(){i._private.cy.notify("zorder",t)})};Zn.checkBoundsTrigger=function(t,e,n,r){this.checkTrigger(t,e,n,r,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};Zn.checkConnectedEdgesBoundsTrigger=function(t,e,n,r){this.checkTrigger(t,e,n,r,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(l){l.dirtyBoundingBoxCache()})})};Zn.checkParallelEdgesBoundsTrigger=function(t,e,n,r){this.checkTrigger(t,e,n,r,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(l){l.dirtyBoundingBoxCache()})})};Zn.checkTriggers=function(t,e,n,r){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,n,r),this.checkBoundsTrigger(t,e,n,r),this.checkConnectedEdgesBoundsTrigger(t,e,n,r),this.checkParallelEdgesBoundsTrigger(t,e,n,r)};var ku={};ku.applyBypass=function(t,e,n,r){var i=this,l=[],s=!0;if(e==="*"||e==="**"){if(n!==void 0)for(var u=0;u<i.properties.length;u++){var f=i.properties[u],c=f.name,h=this.parse(c,n,!0);h&&l.push(h)}}else if(ct(e)){var v=this.parse(e,n,!0);v&&l.push(v)}else if(Ut(e)){var p=e;r=n;for(var m=Object.keys(p),y=0;y<m.length;y++){var S=m[y],w=p[S];if(w===void 0&&(w=p[Jf(S)]),w!==void 0){var E=this.parse(S,w,!0);E&&l.push(E)}}}else return!1;if(l.length===0)return!1;for(var C=!1,T=0;T<t.length;T++){for(var A=t[T],k={},N=void 0,_=0;_<l.length;_++){var O=l[_];if(r){var U=A.pstyle(O.name);N=k[O.name]={prev:U}}C=this.applyParsedProperty(A,Ca(O))||C,r&&(N.next=A.pstyle(O.name))}C&&this.updateStyleHints(A),r&&this.updateTransitions(A,k,s)}return C};ku.overrideBypass=function(t,e,n){e=sm(e);for(var r=0;r<t.length;r++){var i=t[r],l=i._private.style[e],s=this.properties[e].type,u=s.color,f=s.mutiple,c=l?l.pfValue!=null?l.pfValue:l.value:null;!l||!l.bypass?this.applyBypass(i,e,n):(l.value=n,l.pfValue!=null&&(l.pfValue=n),u?l.strValue="rgb("+n.join(",")+")":f?l.strValue=n.join(" "):l.strValue=""+n,this.updateStyleHints(i)),this.checkTriggers(i,e,c,n)}};ku.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};ku.removeBypasses=function(t,e,n){for(var r=!0,i=0;i<t.length;i++){for(var l=t[i],s={},u=0;u<e.length;u++){var f=e[u],c=this.properties[f],h=l.pstyle(c.name);if(!(!h||!h.bypass)){var v="",p=this.parse(f,v,!0),m=s[c.name]={prev:h};this.applyParsedProperty(l,p),m.next=l.pstyle(c.name)}}this.updateStyleHints(l),n&&this.updateTransitions(l,s,r)}};var wm={};wm.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};wm.containerCss=function(t){var e=this._private.cy,n=e.container(),r=e.window();if(r&&n&&r.getComputedStyle)return r.getComputedStyle(n).getPropertyValue(t)};var Ta={};Ta.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)};Ta.getRawStyle=function(t,e){var n=this;if(t=t[0],t){for(var r={},i=0;i<n.properties.length;i++){var l=n.properties[i],s=n.getStylePropertyValue(t,l.name,e);s!=null&&(r[l.name]=s,r[Jf(l.name)]=s)}return r}};Ta.getIndexedStyle=function(t,e,n,r){var i=t.pstyle(e)[n][r];return i??t.cy().style().getDefaultProperty(e)[n][0]};Ta.getStylePropertyValue=function(t,e,n){var r=this;if(t=t[0],t){var i=r.properties[e];i.alias&&(i=i.pointsTo);var l=i.type,s=t.pstyle(i.name);if(s){var u=s.value,f=s.units,c=s.strValue;if(n&&l.number&&u!=null&&Ge(u)){var h=t.cy().zoom(),v=function(w){return w*h},p=function(w,E){return v(w)+E},m=an(u),y=m?f.every(function(S){return S!=null}):f!=null;return y?m?u.map(function(S,w){return p(S,f[w])}).join(" "):p(u,f):m?u.map(function(S){return ct(S)?S:""+v(S)}).join(" "):""+v(u)}else if(c!=null)return c}return null}};Ta.getAnimationStartStyle=function(t,e){for(var n={},r=0;r<e.length;r++){var i=e[r],l=i.name,s=t.pstyle(l);s!==void 0&&(Ut(s)?s=this.parse(l,s.strValue):s=this.parse(l,s)),s&&(n[l]=s)}return n};Ta.getPropsList=function(t){var e=this,n=[],r=t,i=e.properties;if(r)for(var l=Object.keys(r),s=0;s<l.length;s++){var u=l[s],f=r[u],c=i[u]||i[sm(u)],h=this.parse(c.name,f);h&&n.push(h)}return n};Ta.getNonDefaultPropertiesHash=function(t,e,n){var r=n.slice(),i,l,s,u,f,c;for(f=0;f<e.length;f++)if(i=e[f],l=t.pstyle(i,!1),l!=null)if(l.pfValue!=null)r[0]=uu(u,r[0]),r[1]=cu(u,r[1]);else for(s=l.strValue,c=0;c<s.length;c++)u=s.charCodeAt(c),r[0]=uu(u,r[0]),r[1]=cu(u,r[1]);return r};Ta.getPropertiesHash=Ta.getNonDefaultPropertiesHash;var dd={};dd.appendFromJson=function(t){for(var e=this,n=0;n<t.length;n++){var r=t[n],i=r.selector,l=r.style||r.css,s=Object.keys(l);e.selector(i);for(var u=0;u<s.length;u++){var f=s[u],c=l[f];e.css(f,c)}}return e};dd.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};dd.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var n=this[e],r=n.selector,i=n.properties,l={},s=0;s<i.length;s++){var u=i[s];l[u.name]=u.strValue}t.push({selector:r?r.toString():"core",style:l})}return t};var Sm={};Sm.appendFromString=function(t){var e=this,n=this,r=""+t,i,l,s;r=r.replace(/[/][*](\s|.)+?[*][/]/g,"");function u(){r.length>i.length?r=r.substr(i.length):r=""}function f(){l.length>s.length?l=l.substr(s.length):l=""}for(;;){var c=r.match(/^\s*$/);if(c)break;var h=r.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){$t("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+r);break}i=h[0];var v=h[1];if(v!=="core"){var p=new Pi(v);if(p.invalid){$t("Skipping parsing of block: Invalid selector found in string stylesheet: "+v),u();continue}}var m=h[2],y=!1;l=m;for(var S=[];;){var w=l.match(/^\s*$/);if(w)break;var E=l.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!E){$t("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+m),y=!0;break}s=E[0];var C=E[1],T=E[2],A=e.properties[C];if(!A){$t("Skipping property: Invalid property name in: "+s),f();continue}var k=n.parse(C,T);if(!k){$t("Skipping property: Invalid property definition in: "+s),f();continue}S.push({name:C,val:T}),f()}if(y){u();break}n.selector(v);for(var N=0;N<S.length;N++){var _=S[N];n.css(_.name,_.val)}u()}return n};Sm.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var zn={};(function(){var t=Hn,e=ek,n=nk,r=rk,i=ak,l=function(le){return"^"+le+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(le){var fe=t+"|\\w+|"+e+"|"+n+"|"+r+"|"+i;return"^"+le+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+fe+")\\s*\\,\\s*("+fe+")\\)$"},u=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];zn.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle","circle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:l("data")},layoutData:{mapping:!0,regex:l("layoutData")},scratch:{mapping:!0,regex:l("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:u,singleRegexMatchValue:!0},urls:{regexes:u,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(le,fe){switch(le.length){case 2:return fe[0]!=="deg"&&fe[0]!=="rad"&&fe[1]!=="deg"&&fe[1]!=="rad";case 1:return ct(le[0])||fe[0]==="deg"||fe[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(le){var fe=le.length;return fe===1||fe===2||fe===4}}};var f={zeroNonZero:function(le,fe){return(le==null||fe==null)&&le!==fe||le==0&&fe!=0?!0:le!=0&&fe==0},any:function(le,fe){return le!=fe},emptyNonEmpty:function(le,fe){var xe=Fi(le),Re=Fi(fe);return xe&&!Re||!xe&&Re}},c=zn.types,h=[{name:"label",type:c.text,triggersBounds:f.any,triggersZOrder:f.emptyNonEmpty},{name:"text-rotation",type:c.textRotation,triggersBounds:f.any},{name:"text-margin-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"text-margin-y",type:c.bidirectionalSize,triggersBounds:f.any}],v=[{name:"source-label",type:c.text,triggersBounds:f.any},{name:"source-text-rotation",type:c.textRotation,triggersBounds:f.any},{name:"source-text-margin-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"source-text-margin-y",type:c.bidirectionalSize,triggersBounds:f.any},{name:"source-text-offset",type:c.size,triggersBounds:f.any}],p=[{name:"target-label",type:c.text,triggersBounds:f.any},{name:"target-text-rotation",type:c.textRotation,triggersBounds:f.any},{name:"target-text-margin-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"target-text-margin-y",type:c.bidirectionalSize,triggersBounds:f.any},{name:"target-text-offset",type:c.size,triggersBounds:f.any}],m=[{name:"font-family",type:c.fontFamily,triggersBounds:f.any},{name:"font-style",type:c.fontStyle,triggersBounds:f.any},{name:"font-weight",type:c.fontWeight,triggersBounds:f.any},{name:"font-size",type:c.size,triggersBounds:f.any},{name:"text-transform",type:c.textTransform,triggersBounds:f.any},{name:"text-wrap",type:c.textWrap,triggersBounds:f.any},{name:"text-overflow-wrap",type:c.textOverflowWrap,triggersBounds:f.any},{name:"text-max-width",type:c.size,triggersBounds:f.any},{name:"text-outline-width",type:c.size,triggersBounds:f.any},{name:"line-height",type:c.positiveNumber,triggersBounds:f.any}],y=[{name:"text-valign",type:c.valign,triggersBounds:f.any},{name:"text-halign",type:c.halign,triggersBounds:f.any},{name:"color",type:c.color},{name:"text-outline-color",type:c.color},{name:"text-outline-opacity",type:c.zeroOneNumber},{name:"text-background-color",type:c.color},{name:"text-background-opacity",type:c.zeroOneNumber},{name:"text-background-padding",type:c.size,triggersBounds:f.any},{name:"text-border-opacity",type:c.zeroOneNumber},{name:"text-border-color",type:c.color},{name:"text-border-width",type:c.size,triggersBounds:f.any},{name:"text-border-style",type:c.borderStyle,triggersBounds:f.any},{name:"text-background-shape",type:c.textBackgroundShape,triggersBounds:f.any},{name:"text-justification",type:c.justification},{name:"box-select-labels",type:c.bool,triggersBounds:f.any}],S=[{name:"events",type:c.bool,triggersZOrder:f.any},{name:"text-events",type:c.bool,triggersZOrder:f.any},{name:"box-selection",type:c.boxSelection,triggersZOrder:f.any}],w=[{name:"display",type:c.display,triggersZOrder:f.any,triggersBounds:f.any,triggersBoundsOfConnectedEdges:f.any,triggersBoundsOfParallelEdges:function(le,fe,xe){return le===fe?!1:xe.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:c.visibility,triggersZOrder:f.any},{name:"opacity",type:c.zeroOneNumber,triggersZOrder:f.zeroNonZero},{name:"text-opacity",type:c.zeroOneNumber},{name:"min-zoomed-font-size",type:c.size},{name:"z-compound-depth",type:c.zCompoundDepth,triggersZOrder:f.any},{name:"z-index-compare",type:c.zIndexCompare,triggersZOrder:f.any},{name:"z-index",type:c.number,triggersZOrder:f.any}],E=[{name:"overlay-padding",type:c.size,triggersBounds:f.any},{name:"overlay-color",type:c.color},{name:"overlay-opacity",type:c.zeroOneNumber,triggersBounds:f.zeroNonZero},{name:"overlay-shape",type:c.overlayShape,triggersBounds:f.any},{name:"overlay-corner-radius",type:c.cornerRadius}],C=[{name:"underlay-padding",type:c.size,triggersBounds:f.any},{name:"underlay-color",type:c.color},{name:"underlay-opacity",type:c.zeroOneNumber,triggersBounds:f.zeroNonZero},{name:"underlay-shape",type:c.overlayShape,triggersBounds:f.any},{name:"underlay-corner-radius",type:c.cornerRadius}],T=[{name:"transition-property",type:c.propList},{name:"transition-duration",type:c.time},{name:"transition-delay",type:c.time},{name:"transition-timing-function",type:c.easing}],A=function(le,fe){return fe.value==="label"?-le.poolIndex():fe.pfValue},k=[{name:"height",type:c.nodeSize,triggersBounds:f.any,hashOverride:A},{name:"width",type:c.nodeSize,triggersBounds:f.any,hashOverride:A},{name:"shape",type:c.nodeShape,triggersBounds:f.any},{name:"shape-polygon-points",type:c.polygonPointList,triggersBounds:f.any},{name:"corner-radius",type:c.cornerRadius},{name:"background-color",type:c.color},{name:"background-fill",type:c.fill},{name:"background-opacity",type:c.zeroOneNumber},{name:"background-blacken",type:c.nOneOneNumber},{name:"background-gradient-stop-colors",type:c.colors},{name:"background-gradient-stop-positions",type:c.percentages},{name:"background-gradient-direction",type:c.gradientDirection},{name:"padding",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"padding-relative-to",type:c.paddingRelativeTo,triggersBounds:f.any},{name:"bounds-expansion",type:c.boundsExpansion,triggersBounds:f.any}],N=[{name:"border-color",type:c.color},{name:"border-opacity",type:c.zeroOneNumber},{name:"border-width",type:c.size,triggersBounds:f.any},{name:"border-style",type:c.borderStyle},{name:"border-cap",type:c.lineCap},{name:"border-join",type:c.lineJoin},{name:"border-dash-pattern",type:c.numbers},{name:"border-dash-offset",type:c.number},{name:"border-position",type:c.linePosition}],_=[{name:"outline-color",type:c.color},{name:"outline-opacity",type:c.zeroOneNumber},{name:"outline-width",type:c.size,triggersBounds:f.any},{name:"outline-style",type:c.borderStyle},{name:"outline-offset",type:c.size,triggersBounds:f.any}],O=[{name:"background-image",type:c.urls},{name:"background-image-crossorigin",type:c.bgCrossOrigin},{name:"background-image-opacity",type:c.zeroOneNumbers},{name:"background-image-containment",type:c.bgContainment},{name:"background-image-smoothing",type:c.bools},{name:"background-position-x",type:c.bgPos},{name:"background-position-y",type:c.bgPos},{name:"background-width-relative-to",type:c.bgRelativeTo},{name:"background-height-relative-to",type:c.bgRelativeTo},{name:"background-repeat",type:c.bgRepeat},{name:"background-fit",type:c.bgFit},{name:"background-clip",type:c.bgClip},{name:"background-width",type:c.bgWH},{name:"background-height",type:c.bgWH},{name:"background-offset-x",type:c.bgPos},{name:"background-offset-y",type:c.bgPos}],U=[{name:"position",type:c.position,triggersBounds:f.any},{name:"compound-sizing-wrt-labels",type:c.compoundIncludeLabels,triggersBounds:f.any},{name:"min-width",type:c.size,triggersBounds:f.any},{name:"min-width-bias-left",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"min-width-bias-right",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"min-height",type:c.size,triggersBounds:f.any},{name:"min-height-bias-top",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"min-height-bias-bottom",type:c.sizeMaybePercent,triggersBounds:f.any}],M=[{name:"line-style",type:c.lineStyle},{name:"line-color",type:c.color},{name:"line-fill",type:c.fill},{name:"line-cap",type:c.lineCap},{name:"line-opacity",type:c.zeroOneNumber},{name:"line-dash-pattern",type:c.numbers},{name:"line-dash-offset",type:c.number},{name:"line-outline-width",type:c.size},{name:"line-outline-color",type:c.color},{name:"line-gradient-stop-colors",type:c.colors},{name:"line-gradient-stop-positions",type:c.percentages},{name:"curve-style",type:c.curveStyle,triggersBounds:f.any,triggersBoundsOfParallelEdges:function(le,fe){return le===fe?!1:le==="bezier"||fe==="bezier"}},{name:"haystack-radius",type:c.zeroOneNumber,triggersBounds:f.any},{name:"source-endpoint",type:c.edgeEndpoint,triggersBounds:f.any},{name:"target-endpoint",type:c.edgeEndpoint,triggersBounds:f.any},{name:"control-point-step-size",type:c.size,triggersBounds:f.any},{name:"control-point-distances",type:c.bidirectionalSizes,triggersBounds:f.any},{name:"control-point-weights",type:c.numbers,triggersBounds:f.any},{name:"segment-distances",type:c.bidirectionalSizes,triggersBounds:f.any},{name:"segment-weights",type:c.numbers,triggersBounds:f.any},{name:"segment-radii",type:c.numbers,triggersBounds:f.any},{name:"radius-type",type:c.radiusType,triggersBounds:f.any},{name:"taxi-turn",type:c.bidirectionalSizeMaybePercent,triggersBounds:f.any},{name:"taxi-turn-min-distance",type:c.size,triggersBounds:f.any},{name:"taxi-direction",type:c.axisDirection,triggersBounds:f.any},{name:"taxi-radius",type:c.number,triggersBounds:f.any},{name:"edge-distances",type:c.edgeDistances,triggersBounds:f.any},{name:"arrow-scale",type:c.positiveNumber,triggersBounds:f.any},{name:"loop-direction",type:c.angle,triggersBounds:f.any},{name:"loop-sweep",type:c.angle,triggersBounds:f.any},{name:"source-distance-from-node",type:c.size,triggersBounds:f.any},{name:"target-distance-from-node",type:c.size,triggersBounds:f.any}],I=[{name:"ghost",type:c.bool,triggersBounds:f.any},{name:"ghost-offset-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"ghost-offset-y",type:c.bidirectionalSize,triggersBounds:f.any},{name:"ghost-opacity",type:c.zeroOneNumber}],P=[{name:"selection-box-color",type:c.color},{name:"selection-box-opacity",type:c.zeroOneNumber},{name:"selection-box-border-color",type:c.color},{name:"selection-box-border-width",type:c.size},{name:"active-bg-color",type:c.color},{name:"active-bg-opacity",type:c.zeroOneNumber},{name:"active-bg-size",type:c.size},{name:"outside-texture-bg-color",type:c.color},{name:"outside-texture-bg-opacity",type:c.zeroOneNumber}],j=[];zn.pieBackgroundN=16,j.push({name:"pie-size",type:c.sizeMaybePercent}),j.push({name:"pie-hole",type:c.sizeMaybePercent}),j.push({name:"pie-start-angle",type:c.angle});for(var K=1;K<=zn.pieBackgroundN;K++)j.push({name:"pie-"+K+"-background-color",type:c.color}),j.push({name:"pie-"+K+"-background-size",type:c.percent}),j.push({name:"pie-"+K+"-background-opacity",type:c.zeroOneNumber});var $=[];zn.stripeBackgroundN=16,$.push({name:"stripe-size",type:c.sizeMaybePercent}),$.push({name:"stripe-direction",type:c.axisDirectionPrimary});for(var B=1;B<=zn.stripeBackgroundN;B++)$.push({name:"stripe-"+B+"-background-color",type:c.color}),$.push({name:"stripe-"+B+"-background-size",type:c.percent}),$.push({name:"stripe-"+B+"-background-opacity",type:c.zeroOneNumber});var H=[],Y=zn.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:c.arrowShape,triggersBounds:f.any},{name:"arrow-color",type:c.color},{name:"arrow-fill",type:c.arrowFill},{name:"arrow-width",type:c.arrowWidth}].forEach(function(ee){Y.forEach(function(le){var fe=le+"-"+ee.name,xe=ee.type,Re=ee.triggersBounds;H.push({name:fe,type:xe,triggersBounds:Re})})},{});var Q=zn.properties=[].concat(S,T,w,E,C,I,y,m,h,v,p,k,N,_,O,j,$,U,M,H,P),z=zn.propertyGroups={behavior:S,transition:T,visibility:w,overlay:E,underlay:C,ghost:I,commonLabel:y,labelDimensions:m,mainLabel:h,sourceLabel:v,targetLabel:p,nodeBody:k,nodeBorder:N,nodeOutline:_,backgroundImage:O,pie:j,stripe:$,compound:U,edgeLine:M,edgeArrow:H,core:P},F=zn.propertyGroupNames={},q=zn.propertyGroupKeys=Object.keys(z);q.forEach(function(ee){F[ee]=z[ee].map(function(le){return le.name}),z[ee].forEach(function(le){return le.groupKey=ee})});var L=zn.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];zn.propertyNames=Q.map(function(ee){return ee.name});for(var W=0;W<Q.length;W++){var ae=Q[W];Q[ae.name]=ae}for(var se=0;se<L.length;se++){var me=L[se],Ne=Q[me.pointsTo],pe={name:me.name,alias:!0,pointsTo:Ne};Q.push(pe),Q[me.name]=pe}})();zn.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};zn.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=vt({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","box-selection":"contain","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(f,c){for(var h=1;h<=zn.pieBackgroundN;h++){var v=c.name.replace("{{i}}",h),p=c.value;f[v]=p}return f},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(f,c){for(var h=1;h<=zn.stripeBackgroundN;h++){var v=c.name.replace("{{i}}",h),p=c.value;f[v]=p}return f},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(f,c){return zn.arrowPrefixes.forEach(function(h){var v=h+"-"+c.name,p=c.value;f[v]=p}),f},{})),n={},r=0;r<this.properties.length;r++){var i=this.properties[r];if(!i.pointsTo){var l=i.name,s=e[l],u=this.parse(l,s);n[l]=u}}return t.defaultProperties=n,t.defaultProperties};zn.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var hd={};hd.parse=function(t,e,n,r){var i=this;if(xn(e))return i.parseImplWarn(t,e,n,r);var l=r==="mapping"||r===!0||r===!1||r==null?"dontcare":r,s=n?"t":"f",u=""+e,f=PS(t,u,s,l),c=i.propCache=i.propCache||[],h;return(h=c[f])||(h=c[f]=i.parseImplWarn(t,e,n,r)),(n||r==="mapping")&&(h=Ca(h),h&&(h.value=Ca(h.value))),h};hd.parseImplWarn=function(t,e,n,r){var i=this.parseImpl(t,e,n,r);return!i&&e!=null&&$t("The style property `".concat(t,": ").concat(e,"` is invalid")),i&&(i.name==="width"||i.name==="height")&&e==="label"&&$t("The style value of `label` is deprecated for `"+i.name+"`"),i};hd.parseImpl=function(t,e,n,r){var i=this;t=sm(t);var l=i.properties[t],s=e,u=i.types;if(!l||e===void 0)return null;l.alias&&(l=l.pointsTo,t=l.name);var f=ct(e);f&&(e=e.trim());var c=l.type;if(!c)return null;if(n&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(xn(e))return{name:t,value:e,strValue:"fn",mapped:u.fn,bypass:n};var h,v;if(!(!f||r||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(h=new RegExp(u.data.regex).exec(e))){if(n)return!1;var p=u.data;return{name:t,value:h,strValue:""+e,mapped:p,field:h[1],bypass:n}}else if(e.length>=10&&e[0]==="m"&&(v=new RegExp(u.mapData.regex).exec(e))){if(n||c.multiple)return!1;var m=u.mapData;if(!(c.color||c.number))return!1;var y=this.parse(t,v[4]);if(!y||y.mapped)return!1;var S=this.parse(t,v[5]);if(!S||S.mapped)return!1;if(y.pfValue===S.pfValue||y.strValue===S.strValue)return $t("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+y.strValue+"`"),this.parse(t,y.strValue);if(c.color){var w=y.value,E=S.value,C=w[0]===E[0]&&w[1]===E[1]&&w[2]===E[2]&&(w[3]===E[3]||(w[3]==null||w[3]===1)&&(E[3]==null||E[3]===1));if(C)return!1}return{name:t,value:v,strValue:""+e,mapped:m,field:v[1],fieldMin:parseFloat(v[2]),fieldMax:parseFloat(v[3]),valueMin:y.value,valueMax:S.value,bypass:n}}}if(c.multiple&&r!=="multiple"){var T;if(f?T=e.split(/\s+/):an(e)?T=e:T=[e],c.evenMultiple&&T.length%2!==0)return null;for(var A=[],k=[],N=[],_="",O=!1,U=0;U<T.length;U++){var M=i.parse(t,T[U],n,"multiple");O=O||ct(M.value),A.push(M.value),N.push(M.pfValue!=null?M.pfValue:M.value),k.push(M.units),_+=(U>0?" ":"")+M.strValue}return c.validate&&!c.validate(A,k)?null:c.singleEnum&&O?A.length===1&&ct(A[0])?{name:t,value:A[0],strValue:A[0],bypass:n}:null:{name:t,value:A,pfValue:N,strValue:_,bypass:n,units:k}}var I=function(){for(var pe=0;pe<c.enums.length;pe++){var ee=c.enums[pe];if(ee===e)return{name:t,value:e,strValue:""+e,bypass:n}}return null};if(c.number){var P,j="px";if(c.units&&(P=c.units),c.implicitUnits&&(j=c.implicitUnits),!c.unitless)if(f){var K="px|em"+(c.allowPercent?"|\\%":"");P&&(K=P);var $=e.match("^("+Hn+")("+K+")?$");$&&(e=$[1],P=$[2]||j)}else(!P||c.implicitUnits)&&(P=j);if(e=parseFloat(e),isNaN(e)&&c.enums===void 0)return null;if(isNaN(e)&&c.enums!==void 0)return e=s,I();if(c.integer&&!KN(e)||c.min!==void 0&&(e<c.min||c.strictMin&&e===c.min)||c.max!==void 0&&(e>c.max||c.strictMax&&e===c.max))return null;var B={name:t,value:e,strValue:""+e+(P||""),units:P,bypass:n};return c.unitless||P!=="px"&&P!=="em"?B.pfValue=e:B.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&(B.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&(B.pfValue=P==="rad"?e:r2(e)),P==="%"&&(B.pfValue=e/100),B}else if(c.propList){var H=[],Y=""+e;if(Y!=="none"){for(var Q=Y.split(/\s*,\s*|\s+/),z=0;z<Q.length;z++){var F=Q[z].trim();i.properties[F]?H.push(F):$t("`"+F+"` is not a valid property name")}if(H.length===0)return null}return{name:t,value:H,strValue:H.length===0?"none":H.join(" "),bypass:n}}else if(c.color){var q=MS(e);return q?{name:t,value:q,pfValue:q,strValue:"rgb("+q[0]+","+q[1]+","+q[2]+")",bypass:n}:null}else if(c.regex||c.regexes){if(c.enums){var L=I();if(L)return L}for(var W=c.regexes?c.regexes:[c.regex],ae=0;ae<W.length;ae++){var se=new RegExp(W[ae]),me=se.exec(e);if(me)return{name:t,value:c.singleRegexMatchValue?me[1]:me,strValue:""+e,bypass:n}}return null}else return c.string?{name:t,value:""+e,strValue:""+e,bypass:n}:c.enums?I():null};var Xn=function(e){if(!(this instanceof Xn))return new Xn(e);if(!lm(e)){gn("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},dr=Xn.prototype;dr.instanceString=function(){return"style"};dr.clear=function(){for(var t=this._private,e=t.cy,n=e.elements(),r=0;r<this.length;r++)this[r]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(n,!0),n.forEach(function(i){var l=i[0]._private;l.styleDirty=!0,l.appliedInitStyle=!1}),this};dr.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};dr.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};dr.selector=function(t){var e=t==="core"?null:new Pi(t),n=this.length++;return this[n]={selector:e,properties:[],mappedProperties:[],index:n},this};dr.css=function(){var t=this,e=arguments;if(e.length===1)for(var n=e[0],r=0;r<t.properties.length;r++){var i=t.properties[r],l=n[i.name];l===void 0&&(l=n[Jf(i.name)]),l!==void 0&&this.cssRule(i.name,l)}else e.length===2&&this.cssRule(e[0],e[1]);return this};dr.style=dr.css;dr.cssRule=function(t,e){var n=this.parse(t,e);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.name.match(/stripe-(\d+)-background-size/)&&n.value&&(this._private.hasStripe=!0),n.mapped&&this[r].mappedProperties.push(n);var i=!this[r].selector;i&&(this._private.coreStyle[n.name]=n)}return this};dr.append=function(t){return NS(t)?t.appendToStyle(this):an(t)?this.appendFromJson(t):ct(t)&&this.appendFromString(t),this};Xn.fromJson=function(t,e){var n=new Xn(t);return n.fromJson(e),n};Xn.fromString=function(t,e){return new Xn(t).fromString(e)};[Zn,ku,wm,Ta,dd,Sm,zn,hd].forEach(function(t){vt(dr,t)});Xn.types=dr.types;Xn.properties=dr.properties;Xn.propertyGroups=dr.propertyGroups;Xn.propertyGroupNames=dr.propertyGroupNames;Xn.propertyGroupKeys=dr.propertyGroupKeys;var sO={style:function(e){if(e){var n=this.setStyle(e);n.update()}return this._private.style},setStyle:function(e){var n=this._private;return NS(e)?n.style=e.generateStyle(this):an(e)?n.style=Xn.fromJson(this,e):ct(e)?n.style=Xn.fromString(this,e):n.style=Xn(this),n.style},updateStyle:function(){this.mutableElements().updateStyle()}},oO="single",Tl={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var n=this._private;if(n.selectionType==null&&(n.selectionType=oO),e!==void 0)(e==="additive"||e==="single")&&(n.selectionType=e);else return n.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,n=this._private.pan,r,i,l,s,u;switch(e.length){case 0:return n;case 1:if(ct(e[0]))return r=e[0],n[r];if(Ut(e[0])){if(!this._private.panningEnabled)return this;l=e[0],s=l.x,u=l.y,Ge(s)&&(n.x=s),Ge(u)&&(n.y=u),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;r=e[0],i=e[1],(r==="x"||r==="y")&&Ge(i)&&(n[r]=i),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,n){var r=arguments,i=this._private.pan,l,s,u,f,c;if(!this._private.panningEnabled)return this;switch(r.length){case 1:Ut(e)&&(u=r[0],f=u.x,c=u.y,Ge(f)&&(i.x+=f),Ge(c)&&(i.y+=c),this.emit("pan viewport"));break;case 2:l=e,s=n,(l==="x"||l==="y")&&Ge(s)&&(i[l]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,n){var r=this.getFitViewport(e,n);if(r){var i=this._private;i.zoom=r.zoom,i.pan=r.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,n){if(Ge(e)&&n===void 0&&(n=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var r;if(ct(e)){var i=e;e=this.$(i)}else if(ZN(e)){var l=e;r={x1:l.x1,y1:l.y1,x2:l.x2,y2:l.y2},r.w=r.x2-r.x1,r.h=r.y2-r.y1}else Hr(e)||(e=this.mutableElements());if(!(Hr(e)&&e.empty())){r=r||e.boundingBox();var s=this.width(),u=this.height(),f;if(n=Ge(n)?n:0,!isNaN(s)&&!isNaN(u)&&s>0&&u>0&&!isNaN(r.w)&&!isNaN(r.h)&&r.w>0&&r.h>0){f=Math.min((s-2*n)/r.w,(u-2*n)/r.h),f=f>this._private.maxZoom?this._private.maxZoom:f,f=f<this._private.minZoom?this._private.minZoom:f;var c={x:(s-f*(r.x1+r.x2))/2,y:(u-f*(r.y1+r.y2))/2};return{zoom:f,pan:c}}}}},zoomRange:function(e,n){var r=this._private;if(n==null){var i=e;e=i.min,n=i.max}return Ge(e)&&Ge(n)&&e<=n?(r.minZoom=e,r.maxZoom=n):Ge(e)&&n===void 0&&e<=r.maxZoom?r.minZoom=e:Ge(n)&&e===void 0&&n>=r.minZoom&&(r.maxZoom=n),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var n=this._private,r=n.pan,i=n.zoom,l,s,u=!1;if(n.zoomingEnabled||(u=!0),Ge(e)?s=e:Ut(e)&&(s=e.level,e.position!=null?l=nd(e.position,i,r):e.renderedPosition!=null&&(l=e.renderedPosition),l!=null&&!n.panningEnabled&&(u=!0)),s=s>n.maxZoom?n.maxZoom:s,s=s<n.minZoom?n.minZoom:s,u||!Ge(s)||s===i||l!=null&&(!Ge(l.x)||!Ge(l.y)))return null;if(l!=null){var f=r,c=i,h=s,v={x:-h/c*(l.x-f.x)+l.x,y:-h/c*(l.y-f.y)+l.y};return{zoomed:!0,panned:!0,zoom:h,pan:v}}else return{zoomed:!0,panned:!1,zoom:s,pan:r}},zoom:function(e){if(e===void 0)return this._private.zoom;var n=this.getZoomedViewport(e),r=this._private;return n==null||!n.zoomed?this:(r.zoom=n.zoom,n.panned&&(r.pan.x=n.pan.x,r.pan.y=n.pan.y),this.emit("zoom"+(n.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var n=this._private,r=!0,i=!0,l=[],s=!1,u=!1;if(!e)return this;if(Ge(e.zoom)||(r=!1),Ut(e.pan)||(i=!1),!r&&!i)return this;if(r){var f=e.zoom;f<n.minZoom||f>n.maxZoom||!n.zoomingEnabled?s=!0:(n.zoom=f,l.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&n.panningEnabled){var c=e.pan;Ge(c.x)&&(n.pan.x=c.x,u=!1),Ge(c.y)&&(n.pan.y=c.y,u=!1),u||l.push("pan")}return l.length>0&&(l.push("viewport"),this.emit(l.join(" ")),this.notify("viewport")),this},center:function(e){var n=this.getCenterPan(e);return n&&(this._private.pan=n,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,n){if(this._private.panningEnabled){if(ct(e)){var r=e;e=this.mutableElements().filter(r)}else Hr(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),l=this.width(),s=this.height();n=n===void 0?this._private.zoom:n;var u={x:(l-n*(i.x1+i.x2))/2,y:(s-n*(i.y1+i.y2))/2};return u}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,n=e.container,r=this;return e.sizeCache=e.sizeCache||(n?(function(){var i=r.window().getComputedStyle(n),l=function(u){return parseFloat(i.getPropertyValue(u))};return{width:n.clientWidth-l("padding-left")-l("padding-right"),height:n.clientHeight-l("padding-top")-l("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,n=this._private.zoom,r=this.renderedExtent(),i={x1:(r.x1-e.x)/n,x2:(r.x2-e.x)/n,y1:(r.y1-e.y)/n,y2:(r.y2-e.y)/n};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),n=this.height();return{x1:0,y1:0,x2:e,y2:n,w:e,h:n}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Tl.centre=Tl.center;Tl.autolockNodes=Tl.autolock;Tl.autoungrabifyNodes=Tl.autoungrabify;var pu={data:Vt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Vt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Vt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Vt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};pu.attr=pu.data;pu.removeAttr=pu.removeData;var mu=function(e){var n=this;e=vt({},e);var r=e.container;r&&!Bf(r)&&Bf(r[0])&&(r=r[0]);var i=r?r._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var l=i.readies=i.readies||[];r&&(r._cyreg=i),i.cy=n;var s=jn!==void 0&&r!==void 0&&!e.headless,u=e;u.layout=vt({name:s?"grid":"null"},u.layout),u.renderer=vt({name:s?"canvas":"null"},u.renderer);var f=function(y,S,w){return S!==void 0?S:w!==void 0?w:y},c=this._private={container:r,ready:!1,options:u,elements:new ar(this),listeners:[],aniEles:new ar(this),data:u.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:f(!0,u.zoomingEnabled),userZoomingEnabled:f(!0,u.userZoomingEnabled),panningEnabled:f(!0,u.panningEnabled),userPanningEnabled:f(!0,u.userPanningEnabled),boxSelectionEnabled:f(!0,u.boxSelectionEnabled),autolock:f(!1,u.autolock,u.autolockNodes),autoungrabify:f(!1,u.autoungrabify,u.autoungrabifyNodes),autounselectify:f(!1,u.autounselectify),styleEnabled:u.styleEnabled===void 0?s:u.styleEnabled,zoom:Ge(u.zoom)?u.zoom:1,pan:{x:Ut(u.pan)&&Ge(u.pan.x)?u.pan.x:0,y:Ut(u.pan)&&Ge(u.pan.y)?u.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:f(250,u.multiClickDebounceTime)};this.createEmitter(),this.selectionType(u.selectionType),this.zoomRange({min:u.minZoom,max:u.maxZoom});var h=function(y,S){var w=y.some(QN);if(w)return qs.all(y).then(S);S(y)};c.styleEnabled&&n.setStyle([]);var v=vt({},u,u.renderer);n.initRenderer(v);var p=function(y,S,w){n.notifications(!1);var E=n.mutableElements();E.length>0&&E.remove(),y!=null&&(Ut(y)||an(y))&&n.add(y),n.one("layoutready",function(T){n.notifications(!0),n.emit(T),n.one("load",S),n.emitAndNotify("load")}).one("layoutstop",function(){n.one("done",w),n.emit("done")});var C=vt({},n._private.options.layout);C.eles=n.elements(),n.layout(C).run()};h([u.style,u.elements],function(m){var y=m[0],S=m[1];c.styleEnabled&&n.style().append(y),p(S,function(){n.startAnimationLoop(),c.ready=!0,xn(u.ready)&&n.on("ready",u.ready);for(var w=0;w<l.length;w++){var E=l[w];n.on("ready",E)}i&&(i.readies=[]),n.emit("ready")},u.done)})},qf=mu.prototype;vt(qf,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return jn;var n=this._private.container.ownerDocument;return n===void 0||n==null?jn:n.defaultView||jn},mount:function(e){if(e!=null){var n=this,r=n._private,i=r.options;return!Bf(e)&&Bf(e[0])&&(e=e[0]),n.stopAnimationLoop(),n.destroyRenderer(),r.container=e,r.styleEnabled=!0,n.invalidateSize(),n.initRenderer(vt({},i,i.renderer,{name:i.renderer.name==="null"?"canvas":i.renderer.name})),n.startAnimationLoop(),n.style(i.style),n.emit("mount"),n}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Ca(this._private.options)},json:function(e){var n=this,r=n._private,i=n.mutableElements(),l=function(A){return n.getElementById(A.id())};if(Ut(e)){if(n.startBatch(),e.elements){var s={},u=function(A,k){for(var N=[],_=[],O=0;O<A.length;O++){var U=A[O];if(!U.data.id){$t("cy.json() cannot handle elements without an ID attribute");continue}var M=""+U.data.id,I=n.getElementById(M);s[M]=!0,I.length!==0?_.push({ele:I,json:U}):(k&&(U.group=k),N.push(U))}n.add(N);for(var P=0;P<_.length;P++){var j=_[P],K=j.ele,$=j.json;K.json($)}};if(an(e.elements))u(e.elements);else for(var f=["nodes","edges"],c=0;c<f.length;c++){var h=f[c],v=e.elements[h];an(v)&&u(v,h)}var p=n.collection();i.filter(function(T){return!s[T.id()]}).forEach(function(T){T.isParent()?p.merge(T):T.remove()}),p.forEach(function(T){return T.children().move({parent:null})}),p.forEach(function(T){return l(T).remove()})}e.style&&n.style(e.style),e.zoom!=null&&e.zoom!==r.zoom&&n.zoom(e.zoom),e.pan&&(e.pan.x!==r.pan.x||e.pan.y!==r.pan.y)&&n.pan(e.pan),e.data&&n.data(e.data);for(var m=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],y=0;y<m.length;y++){var S=m[y];e[S]!=null&&n[S](e[S])}return n.endBatch(),this}else{var w=!!e,E={};w?E.elements=this.elements().map(function(T){return T.json()}):(E.elements={},i.forEach(function(T){var A=T.group();E.elements[A]||(E.elements[A]=[]),E.elements[A].push(T.json())})),this._private.styleEnabled&&(E.style=n.style().json()),E.data=Ca(n.data());var C=r.options;return E.zoomingEnabled=r.zoomingEnabled,E.userZoomingEnabled=r.userZoomingEnabled,E.zoom=r.zoom,E.minZoom=r.minZoom,E.maxZoom=r.maxZoom,E.panningEnabled=r.panningEnabled,E.userPanningEnabled=r.userPanningEnabled,E.pan=Ca(r.pan),E.boxSelectionEnabled=r.boxSelectionEnabled,E.renderer=Ca(C.renderer),E.hideEdgesOnViewport=C.hideEdgesOnViewport,E.textureOnViewport=C.textureOnViewport,E.wheelSensitivity=C.wheelSensitivity,E.motionBlur=C.motionBlur,E.multiClickDebounceTime=C.multiClickDebounceTime,E}}});qf.$id=qf.getElementById;[QM,nO,NC,Lp,Af,aO,Fp,_f,sO,Tl,pu].forEach(function(t){vt(qf,t)});var uO={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}},cO={maximal:!1,acyclic:!1},ps=function(e){return e.scratch("breadthfirst")},q1=function(e,n){return e.scratch("breadthfirst",n)};function kC(t){this.options=vt({},uO,cO,t)}kC.prototype.run=function(){var t=this.options,e=t.cy,n=t.eles,r=n.nodes().filter(function(We){return We.isChildless()}),i=n,l=t.directed,s=t.acyclic||t.maximal||t.maximalAdjustments>0,u=!!t.boundingBox,f=br(u?t.boundingBox:structuredClone(e.extent())),c;if(Hr(t.roots))c=t.roots;else if(an(t.roots)){for(var h=[],v=0;v<t.roots.length;v++){var p=t.roots[v],m=e.getElementById(p);h.push(m)}c=e.collection(h)}else if(ct(t.roots))c=e.$(t.roots);else if(l)c=r.roots();else{var y=n.components();c=e.collection();for(var S=function(){var ze=y[w],Je=ze.maxDegree(!1),Ye=ze.filter(function(ut){return ut.degree(!1)===Je});c=c.add(Ye)},w=0;w<y.length;w++)S()}var E=[],C={},T=function(ze,Je){E[Je]==null&&(E[Je]=[]);var Ye=E[Je].length;E[Je].push(ze),q1(ze,{index:Ye,depth:Je})},A=function(ze,Je){var Ye=ps(ze),ut=Ye.depth,je=Ye.index;E[ut][je]=null,ze.isChildless()&&T(ze,Je)};i.bfs({roots:c,directed:t.directed,visit:function(ze,Je,Ye,ut,je){var gt=ze[0],ue=gt.id();gt.isChildless()&&T(gt,je),C[ue]=!0}});for(var k=[],N=0;N<r.length;N++){var _=r[N];C[_.id()]||k.push(_)}var O=function(ze){for(var Je=E[ze],Ye=0;Ye<Je.length;Ye++){var ut=Je[Ye];if(ut==null){Je.splice(Ye,1),Ye--;continue}q1(ut,{depth:ze,index:Ye})}},U=function(ze,Je){for(var Ye=ps(ze),ut=ze.incomers().filter(function(qe){return qe.isNode()&&n.has(qe)}),je=-1,gt=ze.id(),ue=0;ue<ut.length;ue++){var Se=ut[ue],Ie=ps(Se);je=Math.max(je,Ie.depth)}if(Ye.depth<=je){if(!t.acyclic&&Je[gt])return null;var Ve=je+1;return A(ze,Ve),Je[gt]=Ve,!0}return!1};if(l&&s){var M=[],I={},P=function(ze){return M.push(ze)},j=function(){return M.shift()};for(r.forEach(function(We){return M.push(We)});M.length>0;){var K=j(),$=U(K,I);if($)K.outgoers().filter(function(We){return We.isNode()&&n.has(We)}).forEach(P);else if($===null){$t("Detected double maximal shift for node `"+K.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var B=0;if(t.avoidOverlap)for(var H=0;H<r.length;H++){var Y=r[H],Q=Y.layoutDimensions(t),z=Q.w,F=Q.h;B=Math.max(B,z,F)}var q={},L=function(ze){if(q[ze.id()])return q[ze.id()];for(var Je=ps(ze).depth,Ye=ze.neighborhood(),ut=0,je=0,gt=0;gt<Ye.length;gt++){var ue=Ye[gt];if(!(ue.isEdge()||ue.isParent()||!r.has(ue))){var Se=ps(ue);if(Se!=null){var Ie=Se.index,Ve=Se.depth;if(!(Ie==null||Ve==null)){var qe=E[Ve].length;Ve<Je&&(ut+=Ie/qe,je++)}}}}return je=Math.max(1,je),ut=ut/je,je===0&&(ut=0),q[ze.id()]=ut,ut},W=function(ze,Je){var Ye=L(ze),ut=L(Je),je=Ye-ut;return je===0?RS(ze.id(),Je.id()):je};t.depthSort!==void 0&&(W=t.depthSort);for(var ae=E.length,se=0;se<ae;se++)E[se].sort(W),O(se);for(var me=[],Ne=0;Ne<k.length;Ne++)me.push(k[Ne]);var pe=function(){for(var ze=0;ze<ae;ze++)O(ze)};me.length&&(E.unshift(me),ae=E.length,pe());for(var ee=0,le=0;le<ae;le++)ee=Math.max(E[le].length,ee);var fe={x:f.x1+f.w/2,y:f.y1+f.h/2},xe=r.reduce(function(We,ze){return(function(Je){return{w:We.w===-1?Je.w:(We.w+Je.w)/2,h:We.h===-1?Je.h:(We.h+Je.h)/2}})(ze.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),Re=Math.max(ae===1?0:u?(f.h-t.padding*2-xe.h)/(ae-1):(f.h-t.padding*2-xe.h)/(ae+1),B),Xe=E.reduce(function(We,ze){return Math.max(We,ze.length)},0),Ke=function(ze){var Je=ps(ze),Ye=Je.depth,ut=Je.index;if(t.circle){var je=Math.min(f.w/2/ae,f.h/2/ae);je=Math.max(je,B);var gt=je*Ye+je-(ae>0&&E[0].length<=3?je/2:0),ue=2*Math.PI/E[Ye].length*ut;return Ye===0&&E[0].length===1&&(gt=1),{x:fe.x+gt*Math.cos(ue),y:fe.y+gt*Math.sin(ue)}}else{var Se=E[Ye].length,Ie=Math.max(Se===1?0:u?(f.w-t.padding*2-xe.w)/((t.grid?Xe:Se)-1):(f.w-t.padding*2-xe.w)/((t.grid?Xe:Se)+1),B),Ve={x:fe.x+(ut+1-(Se+1)/2)*Ie,y:fe.y+(Ye+1-(ae+1)/2)*Re};return Ve}},ot={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(ot).indexOf(t.direction)===-1&&gn("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(ot).join(", ")));var et=function(ze){return Dk(Ke(ze),f,ot[t.direction])};return n.nodes().layoutPositions(this,t,et),this};var fO={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function RC(t){this.options=vt({},fO,t)}RC.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,l=r.nodes().not(":parent");e.sort&&(l=l.sort(e.sort));for(var s=br(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),u={x:s.x1+s.w/2,y:s.y1+s.h/2},f=e.sweep===void 0?2*Math.PI-2*Math.PI/l.length:e.sweep,c=f/Math.max(1,l.length-1),h,v=0,p=0;p<l.length;p++){var m=l[p],y=m.layoutDimensions(e),S=y.w,w=y.h;v=Math.max(v,S,w)}if(Ge(e.radius)?h=e.radius:l.length<=1?h=0:h=Math.min(s.h,s.w)/2-v,l.length>1&&e.avoidOverlap){v*=1.75;var E=Math.cos(c)-Math.cos(0),C=Math.sin(c)-Math.sin(0),T=Math.sqrt(v*v/(E*E+C*C));h=Math.max(T,h)}var A=function(N,_){var O=e.startAngle+_*c*(i?1:-1),U=h*Math.cos(O),M=h*Math.sin(O),I={x:u.x+U,y:u.y+M};return I};return r.nodes().layoutPositions(this,e,A),this};var dO={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function MC(t){this.options=vt({},dO,t)}MC.prototype.run=function(){for(var t=this.options,e=t,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,r=t.cy,i=e.eles,l=i.nodes().not(":parent"),s=br(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),u={x:s.x1+s.w/2,y:s.y1+s.h/2},f=[],c=0,h=0;h<l.length;h++){var v=l[h],p=void 0;p=e.concentric(v),f.push({value:p,node:v}),v._private.scratch.concentric=p}l.updateStyle();for(var m=0;m<l.length;m++){var y=l[m],S=y.layoutDimensions(e);c=Math.max(c,S.w,S.h)}f.sort(function(Re,Xe){return Xe.value-Re.value});for(var w=e.levelWidth(l),E=[[]],C=E[0],T=0;T<f.length;T++){var A=f[T];if(C.length>0){var k=Math.abs(C[0].value-A.value);k>=w&&(C=[],E.push(C))}C.push(A)}var N=c+e.minNodeSpacing;if(!e.avoidOverlap){var _=E.length>0&&E[0].length>1,O=Math.min(s.w,s.h)/2-N,U=O/(E.length+_?1:0);N=Math.min(N,U)}for(var M=0,I=0;I<E.length;I++){var P=E[I],j=e.sweep===void 0?2*Math.PI-2*Math.PI/P.length:e.sweep,K=P.dTheta=j/Math.max(1,P.length-1);if(P.length>1&&e.avoidOverlap){var $=Math.cos(K)-Math.cos(0),B=Math.sin(K)-Math.sin(0),H=Math.sqrt(N*N/($*$+B*B));M=Math.max(H,M)}P.r=M,M+=N}if(e.equidistant){for(var Y=0,Q=0,z=0;z<E.length;z++){var F=E[z],q=F.r-Q;Y=Math.max(Y,q)}Q=0;for(var L=0;L<E.length;L++){var W=E[L];L===0&&(Q=W.r),W.r=Q,Q+=Y}}for(var ae={},se=0;se<E.length;se++)for(var me=E[se],Ne=me.dTheta,pe=me.r,ee=0;ee<me.length;ee++){var le=me[ee],fe=e.startAngle+(n?1:-1)*Ne*ee,xe={x:u.x+pe*Math.cos(fe),y:u.y+pe*Math.sin(fe)};ae[le.node.id()]=xe}return i.nodes().layoutPositions(this,e,function(Re){var Xe=Re.id();return ae[Xe]}),this};var Zg,hO={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,n){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function vd(t){this.options=vt({},hO,t),this.options.layout=this;var e=this.options.eles.nodes(),n=this.options.eles.edges(),r=n.filter(function(i){var l=i.source().data("id"),s=i.target().data("id"),u=e.some(function(c){return c.data("id")===l}),f=e.some(function(c){return c.data("id")===s});return!u||!f});this.options.eles=this.options.eles.not(r)}vd.prototype.run=function(){var t=this.options,e=t.cy,n=this;n.stopped=!1,(t.animate===!0||t.animate===!1)&&n.emit({type:"layoutstart",layout:n}),t.debug===!0?Zg=!0:Zg=!1;var r=vO(e,n,t);Zg&&pO(r),t.randomize&&mO(r);var i=Xa(),l=function(){yO(r,e,t),t.fit===!0&&e.fit(t.padding)},s=function(p){return!(n.stopped||p>=t.numIter||(bO(r,t),r.temperature=r.temperature*t.coolingFactor,r.temperature<t.minTemp))},u=function(){if(t.animate===!0||t.animate===!1)l(),n.one("layoutstop",t.stop),n.emit({type:"layoutstop",layout:n});else{var p=t.eles.nodes(),m=BC(r,t,p);p.layoutPositions(n,t,m)}},f=0,c=!0;if(t.animate===!0){var h=function(){for(var p=0;c&&p<t.refresh;)c=s(f),f++,p++;if(!c)H1(r,t),u();else{var m=Xa();m-i>=t.animationThreshold&&l(),Lf(h)}};h()}else{for(;c;)c=s(f),f++;H1(r,t),u()}return this};vd.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};vd.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var vO=function(e,n,r){for(var i=r.eles.edges(),l=r.eles.nodes(),s=br(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),u={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:l.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:r.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},f=r.eles.components(),c={},h=0;h<f.length;h++)for(var v=f[h],p=0;p<v.length;p++){var m=v[p];c[m.id()]=h}for(var h=0;h<u.nodeSize;h++){var y=l[h],S=y.layoutDimensions(r),w={};w.isLocked=y.locked(),w.id=y.data("id"),w.parentId=y.data("parent"),w.cmptId=c[y.id()],w.children=[],w.positionX=y.position("x"),w.positionY=y.position("y"),w.offsetX=0,w.offsetY=0,w.height=S.w,w.width=S.h,w.maxX=w.positionX+w.width/2,w.minX=w.positionX-w.width/2,w.maxY=w.positionY+w.height/2,w.minY=w.positionY-w.height/2,w.padLeft=parseFloat(y.style("padding")),w.padRight=parseFloat(y.style("padding")),w.padTop=parseFloat(y.style("padding")),w.padBottom=parseFloat(y.style("padding")),w.nodeRepulsion=xn(r.nodeRepulsion)?r.nodeRepulsion(y):r.nodeRepulsion,u.layoutNodes.push(w),u.idToIndex[w.id]=h}for(var E=[],C=0,T=-1,A=[],h=0;h<u.nodeSize;h++){var y=u.layoutNodes[h],k=y.parentId;k!=null?u.layoutNodes[u.idToIndex[k]].children.push(y.id):(E[++T]=y.id,A.push(y.id))}for(u.graphSet.push(A);C<=T;){var N=E[C++],_=u.idToIndex[N],m=u.layoutNodes[_],O=m.children;if(O.length>0){u.graphSet.push(O);for(var h=0;h<O.length;h++)E[++T]=O[h]}}for(var h=0;h<u.graphSet.length;h++)for(var U=u.graphSet[h],p=0;p<U.length;p++){var M=u.idToIndex[U[p]];u.indexToGraph[M]=h}for(var h=0;h<u.edgeSize;h++){var I=i[h],P={};P.id=I.data("id"),P.sourceId=I.data("source"),P.targetId=I.data("target");var j=xn(r.idealEdgeLength)?r.idealEdgeLength(I):r.idealEdgeLength,K=xn(r.edgeElasticity)?r.edgeElasticity(I):r.edgeElasticity,$=u.idToIndex[P.sourceId],B=u.idToIndex[P.targetId],H=u.indexToGraph[$],Y=u.indexToGraph[B];if(H!=Y){for(var Q=gO(P.sourceId,P.targetId,u),z=u.graphSet[Q],F=0,w=u.layoutNodes[$];z.indexOf(w.id)===-1;)w=u.layoutNodes[u.idToIndex[w.parentId]],F++;for(w=u.layoutNodes[B];z.indexOf(w.id)===-1;)w=u.layoutNodes[u.idToIndex[w.parentId]],F++;j*=F*r.nestingFactor}P.idealLength=j,P.elasticity=K,u.layoutEdges.push(P)}return u},gO=function(e,n,r){var i=OC(e,n,0,r);return 2>i.count?0:i.graph},OC=function(e,n,r,i){var l=i.graphSet[r];if(-1<l.indexOf(e)&&-1<l.indexOf(n))return{count:2,graph:r};for(var s=0,u=0;u<l.length;u++){var f=l[u],c=i.idToIndex[f],h=i.layoutNodes[c].children;if(h.length!==0){var v=i.indexToGraph[i.idToIndex[h[0]]],p=OC(e,n,v,i);if(p.count!==0)if(p.count===1){if(s++,s===2)break}else return p}}return{count:s,graph:r}},pO,mO=function(e,n){for(var r=e.clientWidth,i=e.clientHeight,l=0;l<e.nodeSize;l++){var s=e.layoutNodes[l];s.children.length===0&&!s.isLocked&&(s.positionX=Math.random()*r,s.positionY=Math.random()*i)}},BC=function(e,n,r){var i=e.boundingBox,l={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return n.boundingBox&&(r.forEach(function(s){var u=e.layoutNodes[e.idToIndex[s.data("id")]];l.x1=Math.min(l.x1,u.positionX),l.x2=Math.max(l.x2,u.positionX),l.y1=Math.min(l.y1,u.positionY),l.y2=Math.max(l.y2,u.positionY)}),l.w=l.x2-l.x1,l.h=l.y2-l.y1),function(s,u){var f=e.layoutNodes[e.idToIndex[s.data("id")]];if(n.boundingBox){var c=l.w===0?.5:(f.positionX-l.x1)/l.w,h=l.h===0?.5:(f.positionY-l.y1)/l.h;return{x:i.x1+c*i.w,y:i.y1+h*i.h}}else return{x:f.positionX,y:f.positionY}}},yO=function(e,n,r){var i=r.layout,l=r.eles.nodes(),s=BC(e,r,l);l.positions(s),e.ready!==!0&&(e.ready=!0,i.one("layoutready",r.ready),i.emit({type:"layoutready",layout:this}))},bO=function(e,n,r){EO(e,n),SO(e),CO(e,n),TO(e),DO(e)},EO=function(e,n){for(var r=0;r<e.graphSet.length;r++)for(var i=e.graphSet[r],l=i.length,s=0;s<l;s++)for(var u=e.layoutNodes[e.idToIndex[i[s]]],f=s+1;f<l;f++){var c=e.layoutNodes[e.idToIndex[i[f]]];xO(u,c,e,n)}},j1=function(e){return-1+2*e*Math.random()},xO=function(e,n,r,i){var l=e.cmptId,s=n.cmptId;if(!(l!==s&&!r.isCompound)){var u=n.positionX-e.positionX,f=n.positionY-e.positionY,c=1;u===0&&f===0&&(u=j1(c),f=j1(c));var h=wO(e,n,u,f);if(h>0)var v=i.nodeOverlap*h,p=Math.sqrt(u*u+f*f),m=v*u/p,y=v*f/p;else var S=jf(e,u,f),w=jf(n,-1*u,-1*f),E=w.x-S.x,C=w.y-S.y,T=E*E+C*C,p=Math.sqrt(T),v=(e.nodeRepulsion+n.nodeRepulsion)/T,m=v*E/p,y=v*C/p;e.isLocked||(e.offsetX-=m,e.offsetY-=y),n.isLocked||(n.offsetX+=m,n.offsetY+=y)}},wO=function(e,n,r,i){if(r>0)var l=e.maxX-n.minX;else var l=n.maxX-e.minX;if(i>0)var s=e.maxY-n.minY;else var s=n.maxY-e.minY;return l>=0&&s>=0?Math.sqrt(l*l+s*s):0},jf=function(e,n,r){var i=e.positionX,l=e.positionY,s=e.height||1,u=e.width||1,f=r/n,c=s/u,h={};return n===0&&0<r||n===0&&0>r?(h.x=i,h.y=l+s/2,h):0<n&&-1*c<=f&&f<=c?(h.x=i+u/2,h.y=l+u*r/2/n,h):0>n&&-1*c<=f&&f<=c?(h.x=i-u/2,h.y=l-u*r/2/n,h):0<r&&(f<=-1*c||f>=c)?(h.x=i+s*n/2/r,h.y=l+s/2,h):(0>r&&(f<=-1*c||f>=c)&&(h.x=i-s*n/2/r,h.y=l-s/2),h)},SO=function(e,n){for(var r=0;r<e.edgeSize;r++){var i=e.layoutEdges[r],l=e.idToIndex[i.sourceId],s=e.layoutNodes[l],u=e.idToIndex[i.targetId],f=e.layoutNodes[u],c=f.positionX-s.positionX,h=f.positionY-s.positionY;if(!(c===0&&h===0)){var v=jf(s,c,h),p=jf(f,-1*c,-1*h),m=p.x-v.x,y=p.y-v.y,S=Math.sqrt(m*m+y*y),w=Math.pow(i.idealLength-S,2)/i.elasticity;if(S!==0)var E=w*m/S,C=w*y/S;else var E=0,C=0;s.isLocked||(s.offsetX+=E,s.offsetY+=C),f.isLocked||(f.offsetX-=E,f.offsetY-=C)}}},CO=function(e,n){if(n.gravity!==0)for(var r=1,i=0;i<e.graphSet.length;i++){var l=e.graphSet[i],s=l.length;if(i===0)var u=e.clientHeight/2,f=e.clientWidth/2;else var c=e.layoutNodes[e.idToIndex[l[0]]],h=e.layoutNodes[e.idToIndex[c.parentId]],u=h.positionX,f=h.positionY;for(var v=0;v<s;v++){var p=e.layoutNodes[e.idToIndex[l[v]]];if(!p.isLocked){var m=u-p.positionX,y=f-p.positionY,S=Math.sqrt(m*m+y*y);if(S>r){var w=n.gravity*m/S,E=n.gravity*y/S;p.offsetX+=w,p.offsetY+=E}}}}},TO=function(e,n){var r=[],i=0,l=-1;for(r.push.apply(r,e.graphSet[0]),l+=e.graphSet[0].length;i<=l;){var s=r[i++],u=e.idToIndex[s],f=e.layoutNodes[u],c=f.children;if(0<c.length&&!f.isLocked){for(var h=f.offsetX,v=f.offsetY,p=0;p<c.length;p++){var m=e.layoutNodes[e.idToIndex[c[p]]];m.offsetX+=h,m.offsetY+=v,r[++l]=c[p]}f.offsetX=0,f.offsetY=0}}},DO=function(e,n){for(var r=0;r<e.nodeSize;r++){var i=e.layoutNodes[r];0<i.children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0)}for(var r=0;r<e.nodeSize;r++){var i=e.layoutNodes[r];if(!(0<i.children.length||i.isLocked)){var l=AO(i.offsetX,i.offsetY,e.temperature);i.positionX+=l.x,i.positionY+=l.y,i.offsetX=0,i.offsetY=0,i.minX=i.positionX-i.width,i.maxX=i.positionX+i.width,i.minY=i.positionY-i.height,i.maxY=i.positionY+i.height,LC(i,e)}}for(var r=0;r<e.nodeSize;r++){var i=e.layoutNodes[r];0<i.children.length&&!i.isLocked&&(i.positionX=(i.maxX+i.minX)/2,i.positionY=(i.maxY+i.minY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY)}},AO=function(e,n,r){var i=Math.sqrt(e*e+n*n);if(i>r)var l={x:r*e/i,y:r*n/i};else var l={x:e,y:n};return l},LC=function(e,n){var r=e.parentId;if(r!=null){var i=n.layoutNodes[n.idToIndex[r]],l=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,l=!0),(i.minX==null||e.minX-i.padLeft<i.minX)&&(i.minX=e.minX-i.padLeft,l=!0),(i.maxY==null||e.maxY+i.padBottom>i.maxY)&&(i.maxY=e.maxY+i.padBottom,l=!0),(i.minY==null||e.minY-i.padTop<i.minY)&&(i.minY=e.minY-i.padTop,l=!0),l)return LC(i,n)}},H1=function(e,n){for(var r=e.layoutNodes,i=[],l=0;l<r.length;l++){var s=r[l],u=s.cmptId,f=i[u]=i[u]||[];f.push(s)}for(var c=0,l=0;l<i.length;l++){var h=i[l];if(h){h.x1=1/0,h.x2=-1/0,h.y1=1/0,h.y2=-1/0;for(var v=0;v<h.length;v++){var p=h[v];h.x1=Math.min(h.x1,p.positionX-p.width/2),h.x2=Math.max(h.x2,p.positionX+p.width/2),h.y1=Math.min(h.y1,p.positionY-p.height/2),h.y2=Math.max(h.y2,p.positionY+p.height/2)}h.w=h.x2-h.x1,h.h=h.y2-h.y1,c+=h.w*h.h}}i.sort(function(C,T){return T.w*T.h-C.w*C.h});for(var m=0,y=0,S=0,w=0,E=Math.sqrt(c)*e.clientWidth/e.clientHeight,l=0;l<i.length;l++){var h=i[l];if(h){for(var v=0;v<h.length;v++){var p=h[v];p.isLocked||(p.positionX+=m-h.x1,p.positionY+=y-h.y1)}m+=h.w+n.componentSpacing,S+=h.w+n.componentSpacing,w=Math.max(w,h.h),S>E&&(y+=w+n.componentSpacing,m=0,S=0,w=0)}}},_O={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function FC(t){this.options=vt({},_O,t)}FC.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,i=r.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var l=br(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(l.h===0||l.w===0)r.nodes().layoutPositions(this,e,function(L){return{x:l.x1,y:l.y1}});else{var s=i.size(),u=Math.sqrt(s*l.h/l.w),f=Math.round(u),c=Math.round(l.w/l.h*u),h=function(W){if(W==null)return Math.min(f,c);var ae=Math.min(f,c);ae==f?f=W:c=W},v=function(W){if(W==null)return Math.max(f,c);var ae=Math.max(f,c);ae==f?f=W:c=W},p=e.rows,m=e.cols!=null?e.cols:e.columns;if(p!=null&&m!=null)f=p,c=m;else if(p!=null&&m==null)f=p,c=Math.ceil(s/f);else if(p==null&&m!=null)c=m,f=Math.ceil(s/c);else if(c*f>s){var y=h(),S=v();(y-1)*S>=s?h(y-1):(S-1)*y>=s&&v(S-1)}else for(;c*f<s;){var w=h(),E=v();(E+1)*w>=s?v(E+1):h(w+1)}var C=l.w/c,T=l.h/f;if(e.condense&&(C=0,T=0),e.avoidOverlap)for(var A=0;A<i.length;A++){var k=i[A],N=k._private.position;(N.x==null||N.y==null)&&(N.x=0,N.y=0);var _=k.layoutDimensions(e),O=e.avoidOverlapPadding,U=_.w+O,M=_.h+O;C=Math.max(C,U),T=Math.max(T,M)}for(var I={},P=function(W,ae){return!!I["c-"+W+"-"+ae]},j=function(W,ae){I["c-"+W+"-"+ae]=!0},K=0,$=0,B=function(){$++,$>=c&&($=0,K++)},H={},Y=0;Y<i.length;Y++){var Q=i[Y],z=e.position(Q);if(z&&(z.row!==void 0||z.col!==void 0)){var F={row:z.row,col:z.col};if(F.col===void 0)for(F.col=0;P(F.row,F.col);)F.col++;else if(F.row===void 0)for(F.row=0;P(F.row,F.col);)F.row++;H[Q.id()]=F,j(F.row,F.col)}}var q=function(W,ae){var se,me;if(W.locked()||W.isParent())return!1;var Ne=H[W.id()];if(Ne)se=Ne.col*C+C/2+l.x1,me=Ne.row*T+T/2+l.y1;else{for(;P(K,$);)B();se=$*C+C/2+l.x1,me=K*T+T/2+l.y1,j(K,$),B()}return{x:se,y:me}};i.layoutPositions(this,e,q)}return this};var NO={ready:function(){},stop:function(){}};function Cm(t){this.options=vt({},NO,t)}Cm.prototype.run=function(){var t=this.options,e=t.eles,n=this;return t.cy,n.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),n.one("layoutready",t.ready),n.emit("layoutready"),n.one("layoutstop",t.stop),n.emit("layoutstop"),this};Cm.prototype.stop=function(){return this};var kO={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function IC(t){this.options=vt({},kO,t)}IC.prototype.run=function(){var t=this.options,e=t.eles,n=e.nodes(),r=xn(t.positions);function i(l){if(t.positions==null)return Wk(l.position());if(r)return t.positions(l);var s=t.positions[l._private.data.id];return s??null}return n.layoutPositions(this,t,function(l,s){var u=i(l);return l.locked()||u==null?!1:u}),this};var RO={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function zC(t){this.options=vt({},RO,t)}zC.prototype.run=function(){var t=this.options,e=t.cy,n=t.eles,r=br(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),i=function(s,u){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}};return n.nodes().layoutPositions(this,t,i),this};var MO=[{name:"breadthfirst",impl:kC},{name:"circle",impl:RC},{name:"concentric",impl:MC},{name:"cose",impl:vd},{name:"grid",impl:FC},{name:"null",impl:Cm},{name:"preset",impl:IC},{name:"random",impl:zC}];function PC(t){this.options=t,this.notifications=0}var G1=function(){},V1=function(){throw new Error("A headless instance can not render images")};PC.prototype={recalculateRenderedStyle:G1,notify:function(){this.notifications++},init:G1,isHeadless:function(){return!0},png:V1,jpg:V1};var Tm={};Tm.arrowShapeWidth=.3;Tm.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,n=function(c,h,v,p,m,y,S){var w=m.x-v/2-S,E=m.x+v/2+S,C=m.y-v/2-S,T=m.y+v/2+S,A=w<=c&&c<=E&&C<=h&&h<=T;return A},r=function(c,h,v,p,m){var y=c*Math.cos(p)-h*Math.sin(p),S=c*Math.sin(p)+h*Math.cos(p),w=y*v,E=S*v,C=w+m.x,T=E+m.y;return{x:C,y:T}},i=function(c,h,v,p){for(var m=[],y=0;y<c.length;y+=2){var S=c[y],w=c[y+1];m.push(r(S,w,h,v,p))}return m},l=function(c){for(var h=[],v=0;v<c.length;v++){var p=c[v];h.push(p.x,p.y)}return h},s=function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").pfValue*2},u=function(c,h){ct(h)&&(h=t[h]),t[c]=vt({name:c,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(p,m,y,S,w,E){var C=l(i(this.points,y+2*E,S,w)),T=Mr(p,m,C);return T},roughCollide:n,draw:function(p,m,y,S){var w=i(this.points,m,y,S);e.arrowShapeImpl("polygon")(p,w)},spacing:function(p){return 0},gap:s},h)};u("none",{collide:Ff,roughCollide:Ff,draw:cm,spacing:ix,gap:ix}),u("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),u("arrow","triangle"),u("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(c,h,v,p,m){var y=i(this.points,h,v,p),S=this.controlPoint,w=r(S[0],S[1],h,v,p);e.arrowShapeImpl(this.name)(c,y,w)},gap:function(c){return s(c)*.8}}),u("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(c,h,v,p,m,y,S){var w=l(i(this.points,v+2*S,p,m)),E=l(i(this.pointsTee,v+2*S,p,m)),C=Mr(c,h,w)||Mr(c,h,E);return C},draw:function(c,h,v,p,m){var y=i(this.points,h,v,p),S=i(this.pointsTee,h,v,p);e.arrowShapeImpl(this.name)(c,y,S)}}),u("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(c,h,v,p,m,y,S){var w=m,E=Math.pow(w.x-c,2)+Math.pow(w.y-h,2)<=Math.pow((v+2*S)*this.radius,2),C=l(i(this.points,v+2*S,p,m));return Mr(c,h,C)||E},draw:function(c,h,v,p,m){var y=i(this.pointsTr,h,v,p);e.arrowShapeImpl(this.name)(c,y,p.x,p.y,this.radius*h)},spacing:function(c){return e.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),u("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(c,h){var v=this.baseCrossLinePts.slice(),p=h/c,m=3,y=5;return v[m]=v[m]-p,v[y]=v[y]-p,v},collide:function(c,h,v,p,m,y,S){var w=l(i(this.points,v+2*S,p,m)),E=l(i(this.crossLinePts(v,y),v+2*S,p,m)),C=Mr(c,h,w)||Mr(c,h,E);return C},draw:function(c,h,v,p,m){var y=i(this.points,h,v,p),S=i(this.crossLinePts(h,m),h,v,p);e.arrowShapeImpl(this.name)(c,y,S)}}),u("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(c){return s(c)*.525}}),u("circle",{radius:.15,collide:function(c,h,v,p,m,y,S){var w=m,E=Math.pow(w.x-c,2)+Math.pow(w.y-h,2)<=Math.pow((v+2*S)*this.radius,2);return E},draw:function(c,h,v,p,m){e.arrowShapeImpl(this.name)(c,p.x,p.y,this.radius*h)},spacing:function(c){return e.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),u("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(c){return 1},gap:function(c){return 1}}),u("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),u("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}}),u("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(c){return .95*c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}})};var Nl={};Nl.projectIntoViewport=function(t,e){var n=this.cy,r=this.findContainerClientCoords(),i=r[0],l=r[1],s=r[4],u=n.pan(),f=n.zoom(),c=((t-i)/s-u.x)/f,h=((e-l)/s-u.y)/f;return[c,h]};Nl.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),n=this.cy.window().getComputedStyle(t),r=function(E){return parseFloat(n.getPropertyValue(E))},i={left:r("padding-left"),right:r("padding-right"),top:r("padding-top"),bottom:r("padding-bottom")},l={left:r("border-left-width"),right:r("border-right-width"),top:r("border-top-width"),bottom:r("border-bottom-width")},s=t.clientWidth,u=t.clientHeight,f=i.left+i.right,c=i.top+i.bottom,h=l.left+l.right,v=e.width/(s+h),p=s-f,m=u-c,y=e.left+i.left+l.left,S=e.top+i.top+l.top;return this.containerBB=[y,S,p,m,v]};Nl.invalidateContainerClientCoordsCache=function(){this.containerBB=null};Nl.findNearestElement=function(t,e,n,r){return this.findNearestElements(t,e,n,r)[0]};Nl.findNearestElements=function(t,e,n,r){var i=this,l=this,s=l.getCachedZSortedEles(),u=[],f=l.cy.zoom(),c=l.cy.hasCompoundNodes(),h=(r?24:8)/f,v=(r?8:2)/f,p=(r?8:2)/f,m=1/0,y,S;n&&(s=s.interactive);function w(_,O){if(_.isNode()){if(S)return;S=_,u.push(_)}if(_.isEdge()&&(O==null||O<m))if(y){if(y.pstyle("z-compound-depth").value===_.pstyle("z-compound-depth").value&&y.pstyle("z-compound-depth").value===_.pstyle("z-compound-depth").value){for(var U=0;U<u.length;U++)if(u[U].isEdge()){u[U]=_,y=_,m=O??m;break}}}else u.push(_),y=_,m=O??m}function E(_){var O=_.outerWidth()+2*v,U=_.outerHeight()+2*v,M=O/2,I=U/2,P=_.position(),j=_.pstyle("corner-radius").value==="auto"?"auto":_.pstyle("corner-radius").pfValue,K=_._private.rscratch;if(P.x-M<=t&&t<=P.x+M&&P.y-I<=e&&e<=P.y+I){var $=l.nodeShapes[i.getNodeShape(_)];if($.checkPoint(t,e,0,O,U,P.x,P.y,j,K))return w(_,0),!0}}function C(_){var O=_._private,U=O.rscratch,M=_.pstyle("width").pfValue,I=_.pstyle("arrow-scale").value,P=M/2+h,j=P*P,K=P*2,Y=O.source,Q=O.target,$;if(U.edgeType==="segments"||U.edgeType==="straight"||U.edgeType==="haystack"){for(var B=U.allpts,H=0;H+3<B.length;H+=2)if(d2(t,e,B[H],B[H+1],B[H+2],B[H+3],K)&&j>($=m2(t,e,B[H],B[H+1],B[H+2],B[H+3])))return w(_,$),!0}else if(U.edgeType==="bezier"||U.edgeType==="multibezier"||U.edgeType==="self"||U.edgeType==="compound"){for(var B=U.allpts,H=0;H+5<U.allpts.length;H+=4)if(h2(t,e,B[H],B[H+1],B[H+2],B[H+3],B[H+4],B[H+5],K)&&j>($=p2(t,e,B[H],B[H+1],B[H+2],B[H+3],B[H+4],B[H+5])))return w(_,$),!0}for(var Y=Y||O.source,Q=Q||O.target,z=i.getArrowWidth(M,I),F=[{name:"source",x:U.arrowStartX,y:U.arrowStartY,angle:U.srcArrowAngle},{name:"target",x:U.arrowEndX,y:U.arrowEndY,angle:U.tgtArrowAngle},{name:"mid-source",x:U.midX,y:U.midY,angle:U.midsrcArrowAngle},{name:"mid-target",x:U.midX,y:U.midY,angle:U.midtgtArrowAngle}],H=0;H<F.length;H++){var q=F[H],L=l.arrowShapes[_.pstyle(q.name+"-arrow-shape").value],W=_.pstyle("width").pfValue;if(L.roughCollide(t,e,z,q.angle,{x:q.x,y:q.y},W,h)&&L.collide(t,e,z,q.angle,{x:q.x,y:q.y},W,h))return w(_),!0}c&&u.length>0&&(E(Y),E(Q))}function T(_,O,U){return Rr(_,O,U)}function A(_,O){var U=_._private,M=p,I;O?I=O+"-":I="",_.boundingBox();var P=U.labelBounds[O||"main"],j=_.pstyle(I+"label").value,K=_.pstyle("text-events").strValue==="yes";if(!(!K||!j)){var $=T(U.rscratch,"labelX",O),B=T(U.rscratch,"labelY",O),H=T(U.rscratch,"labelAngle",O),Y=_.pstyle(I+"text-margin-x").pfValue,Q=_.pstyle(I+"text-margin-y").pfValue,z=P.x1-M-Y,F=P.x2+M-Y,q=P.y1-M-Q,L=P.y2+M-Q;if(H){var W=Math.cos(H),ae=Math.sin(H),se=function(xe,Re){return xe=xe-$,Re=Re-B,{x:xe*W-Re*ae+$,y:xe*ae+Re*W+B}},me=se(z,q),Ne=se(z,L),pe=se(F,q),ee=se(F,L),le=[me.x+Y,me.y+Q,pe.x+Y,pe.y+Q,ee.x+Y,ee.y+Q,Ne.x+Y,Ne.y+Q];if(Mr(t,e,le))return w(_),!0}else if(Mi(P,t,e))return w(_),!0}}for(var k=s.length-1;k>=0;k--){var N=s[k];N.isNode()?E(N)||A(N):C(N)||A(N)||A(N,"source")||A(N,"target")}return u};Nl.getAllInBox=function(t,e,n,r){var i=this.getCachedZSortedEles().interactive,l=this.cy.zoom(),s=2/l,u=[],f=Math.min(t,n),c=Math.max(t,n),h=Math.min(e,r),v=Math.max(e,r);t=f,n=c,e=h,r=v;var p=br({x1:t,y1:e,x2:n,y2:r}),m=[{x:p.x1,y:p.y1},{x:p.x2,y:p.y1},{x:p.x2,y:p.y2},{x:p.x1,y:p.y2}],y=[[m[0],m[1]],[m[1],m[2]],[m[2],m[3]],[m[3],m[0]]];function S(xe,Re,Xe){return Rr(xe,Re,Xe)}function w(xe,Re){var Xe=xe._private,Ke=s,ot="";xe.boundingBox();var et=Xe.labelBounds.main;if(!et)return null;var We=S(Xe.rscratch,"labelX",Re),ze=S(Xe.rscratch,"labelY",Re),Je=S(Xe.rscratch,"labelAngle",Re),Ye=xe.pstyle(ot+"text-margin-x").pfValue,ut=xe.pstyle(ot+"text-margin-y").pfValue,je=et.x1-Ke-Ye,gt=et.x2+Ke-Ye,ue=et.y1-Ke-ut,Se=et.y2+Ke-ut;if(Je){var Ie=Math.cos(Je),Ve=Math.sin(Je),qe=function(be,G){return be=be-We,G=G-ze,{x:be*Ie-G*Ve+We,y:be*Ve+G*Ie+ze}};return[qe(je,ue),qe(gt,ue),qe(gt,Se),qe(je,Se)]}else return[{x:je,y:ue},{x:gt,y:ue},{x:gt,y:Se},{x:je,y:Se}]}function E(xe,Re,Xe,Ke){function ot(et,We,ze){return(ze.y-et.y)*(We.x-et.x)>(We.y-et.y)*(ze.x-et.x)}return ot(xe,Xe,Ke)!==ot(Re,Xe,Ke)&&ot(xe,Re,Xe)!==ot(xe,Re,Ke)}for(var C=0;C<i.length;C++){var T=i[C];if(T.isNode()){var A=T,k=A.pstyle("text-events").strValue==="yes",N=A.pstyle("box-selection").strValue,_=A.pstyle("box-select-labels").strValue==="yes";if(N==="none")continue;var O=(N==="overlap"||_)&&k,U=A.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:O});if(N==="contain"){var M=!1;if(_&&k){var I=w(A);I&&Yv(I,m)&&(u.push(A),M=!0)}!M&&$S(p,U)&&u.push(A)}else if(N==="overlap"&&vm(p,U)){var P=A.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),j=[{x:P.x1,y:P.y1},{x:P.x2,y:P.y1},{x:P.x2,y:P.y2},{x:P.x1,y:P.y2}];if(Yv(j,m))u.push(A);else{var K=w(A);K&&Yv(K,m)&&u.push(A)}}}else{var $=T,B=$._private,H=B.rscratch,Y=$.pstyle("box-selection").strValue;if(Y==="none")continue;if(Y==="contain"){if(H.startX!=null&&H.startY!=null&&!Mi(p,H.startX,H.startY)||H.endX!=null&&H.endY!=null&&!Mi(p,H.endX,H.endY))continue;if(H.edgeType==="bezier"||H.edgeType==="multibezier"||H.edgeType==="self"||H.edgeType==="compound"||H.edgeType==="segments"||H.edgeType==="haystack"){for(var Q=B.rstyle.bezierPts||B.rstyle.linePts||B.rstyle.haystackPts,z=!0,F=0;F<Q.length;F++)if(!cx(p,Q[F])){z=!1;break}z&&u.push($)}else H.edgeType==="straight"&&u.push($)}else if(Y==="overlap"){var q=!1;if(H.startX!=null&&H.startY!=null&&H.endX!=null&&H.endY!=null&&(Mi(p,H.startX,H.startY)||Mi(p,H.endX,H.endY)))u.push($),q=!0;else if(!q&&H.edgeType==="haystack"){for(var L=B.rstyle.haystackPts,W=0;W<L.length;W++)if(cx(p,L[W])){u.push($),q=!0;break}}if(!q){var ae=B.rstyle.bezierPts||B.rstyle.linePts||B.rstyle.haystackPts;if((!ae||ae.length<2)&&H.edgeType==="straight"&&H.startX!=null&&H.startY!=null&&H.endX!=null&&H.endY!=null&&(ae=[{x:H.startX,y:H.startY},{x:H.endX,y:H.endY}]),!ae||ae.length<2)continue;for(var se=0;se<ae.length-1;se++){for(var me=ae[se],Ne=ae[se+1],pe=0;pe<y.length;pe++){var ee=Pn(y[pe],2),le=ee[0],fe=ee[1];if(E(me,Ne,le,fe)){u.push($),q=!0;break}}if(q)break}}}}}return u};var Hf={};Hf.calculateArrowAngles=function(t){var e=t._private.rscratch,n=e.edgeType==="haystack",r=e.edgeType==="bezier",i=e.edgeType==="multibezier",l=e.edgeType==="segments",s=e.edgeType==="compound",u=e.edgeType==="self",f,c,h,v,p,m,E,C;if(n?(h=e.haystackPts[0],v=e.haystackPts[1],p=e.haystackPts[2],m=e.haystackPts[3]):(h=e.arrowStartX,v=e.arrowStartY,p=e.arrowEndX,m=e.arrowEndY),E=e.midX,C=e.midY,l)f=h-e.segpts[0],c=v-e.segpts[1];else if(i||s||u||r){var y=e.allpts,S=Yn(y[0],y[2],y[4],.1),w=Yn(y[1],y[3],y[5],.1);f=h-S,c=v-w}else f=h-E,c=v-C;e.srcArrowAngle=Jc(f,c);var E=e.midX,C=e.midY;if(n&&(E=(h+p)/2,C=(v+m)/2),f=p-h,c=m-v,l){var y=e.allpts;if(y.length/2%2===0){var T=y.length/2,A=T-2;f=y[T]-y[A],c=y[T+1]-y[A+1]}else if(e.isRound)f=e.midVector[1],c=-e.midVector[0];else{var T=y.length/2-1,A=T-2;f=y[T]-y[A],c=y[T+1]-y[A+1]}}else if(i||s||u){var y=e.allpts,k=e.ctrlpts,N,_,O,U;if(k.length/2%2===0){var M=y.length/2-1,I=M+2,P=I+2;N=Yn(y[M],y[I],y[P],0),_=Yn(y[M+1],y[I+1],y[P+1],0),O=Yn(y[M],y[I],y[P],1e-4),U=Yn(y[M+1],y[I+1],y[P+1],1e-4)}else{var I=y.length/2-1,M=I-2,P=I+2;N=Yn(y[M],y[I],y[P],.4999),_=Yn(y[M+1],y[I+1],y[P+1],.4999),O=Yn(y[M],y[I],y[P],.5),U=Yn(y[M+1],y[I+1],y[P+1],.5)}f=O-N,c=U-_}if(e.midtgtArrowAngle=Jc(f,c),e.midDispX=f,e.midDispY=c,f*=-1,c*=-1,l){var y=e.allpts;if(y.length/2%2!==0){if(!e.isRound){var T=y.length/2-1,j=T+2;f=-(y[j]-y[T]),c=-(y[j+1]-y[T+1])}}}if(e.midsrcArrowAngle=Jc(f,c),l)f=p-e.segpts[e.segpts.length-2],c=m-e.segpts[e.segpts.length-1];else if(i||s||u||r){var y=e.allpts,K=y.length,S=Yn(y[K-6],y[K-4],y[K-2],.9),w=Yn(y[K-5],y[K-3],y[K-1],.9);f=p-S,c=m-w}else f=p-E,c=m-C;e.tgtArrowAngle=Jc(f,c)};Hf.getArrowWidth=Hf.getArrowHeight=function(t,e){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[t+", "+e];return r||(r=Math.max(Math.pow(t*13.37,.9),29)*e,n[t+", "+e]=r,r)};var Ip,zp,xa={},ra={},$1,K1,El,Nf,$a,vl,yl,ba,ms,of,UC,qC,Pp,Up,Y1,X1=function(e,n,r){r.x=n.x-e.x,r.y=n.y-e.y,r.len=Math.sqrt(r.x*r.x+r.y*r.y),r.nx=r.x/r.len,r.ny=r.y/r.len,r.ang=Math.atan2(r.ny,r.nx)},OO=function(e,n){n.x=e.x*-1,n.y=e.y*-1,n.nx=e.nx*-1,n.ny=e.ny*-1,n.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},BO=function(e,n,r,i,l){if(e!==Y1?X1(n,e,xa):OO(ra,xa),X1(n,r,ra),$1=xa.nx*ra.ny-xa.ny*ra.nx,K1=xa.nx*ra.nx-xa.ny*-ra.ny,$a=Math.asin(Math.max(-1,Math.min(1,$1))),Math.abs($a)<1e-6){Ip=n.x,zp=n.y,yl=ms=0;return}El=1,Nf=!1,K1<0?$a<0?$a=Math.PI+$a:($a=Math.PI-$a,El=-1,Nf=!0):$a>0&&(El=-1,Nf=!0),n.radius!==void 0?ms=n.radius:ms=i,vl=$a/2,of=Math.min(xa.len/2,ra.len/2),l?(ba=Math.abs(Math.cos(vl)*ms/Math.sin(vl)),ba>of?(ba=of,yl=Math.abs(ba*Math.sin(vl)/Math.cos(vl))):yl=ms):(ba=Math.min(of,ms),yl=Math.abs(ba*Math.sin(vl)/Math.cos(vl))),Pp=n.x+ra.nx*ba,Up=n.y+ra.ny*ba,Ip=Pp-ra.ny*yl*El,zp=Up+ra.nx*yl*El,UC=n.x+xa.nx*ba,qC=n.y+xa.ny*ba,Y1=n};function jC(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function Dm(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return r===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(BO(t,e,n,r,i),{cx:Ip,cy:zp,radius:yl,startX:UC,startY:qC,stopX:Pp,stopY:Up,startAngle:xa.ang+Math.PI/2*El,endAngle:ra.ang-Math.PI/2*El,counterClockwise:Nf})}var yu=.01,LO=Math.sqrt(2*yu),hr={};hr.findMidptPtsEtc=function(t,e){var n=e.posPts,r=e.intersectionPts,i=e.vectorNormInverse,l,s=t.pstyle("source-endpoint"),u=t.pstyle("target-endpoint"),f=s.units!=null&&u.units!=null,c=function(k,N,_,O){var U=O-N,M=_-k,I=Math.sqrt(M*M+U*U);return{x:-U/I,y:M/I}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":l=n;break;case"intersection":l=r;break;case"endpoints":{if(f){var v=this.manualEndptToPx(t.source()[0],s),p=Pn(v,2),m=p[0],y=p[1],S=this.manualEndptToPx(t.target()[0],u),w=Pn(S,2),E=w[0],C=w[1],T={x1:m,y1:y,x2:E,y2:C};i=c(m,y,E,C),l=T}else $t("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),l=r;break}}return{midptPts:l,vectorNormInverse:i}};hr.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=n._private,i=r.rscratch;if(!i.haystack){var l=Math.random()*2*Math.PI;i.source={x:Math.cos(l),y:Math.sin(l)},l=Math.random()*2*Math.PI,i.target={x:Math.cos(l),y:Math.sin(l)}}var s=r.source,u=r.target,f=s.position(),c=u.position(),h=s.width(),v=u.width(),p=s.height(),m=u.height(),y=n.pstyle("haystack-radius").value,S=y/2;i.haystackPts=i.allpts=[i.source.x*h*S+f.x,i.source.y*p*S+f.y,i.target.x*v*S+c.x,i.target.y*m*S+c.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType="haystack",i.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}};hr.findSegmentsPoints=function(t,e){var n=t._private.rscratch,r=t.pstyle("segment-weights"),i=t.pstyle("segment-distances"),l=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),u=Math.min(r.pfValue.length,i.pfValue.length),f=l.pfValue[l.pfValue.length-1],c=s.pfValue[s.pfValue.length-1];n.edgeType="segments",n.segpts=[],n.radii=[],n.isArcRadius=[];for(var h=0;h<u;h++){var v=r.pfValue[h],p=i.pfValue[h],m=1-v,y=v,S=this.findMidptPtsEtc(t,e),w=S.midptPts,E=S.vectorNormInverse,C={x:w.x1*m+w.x2*y,y:w.y1*m+w.y2*y};n.segpts.push(C.x+E.x*p,C.y+E.y*p),n.radii.push(l.pfValue[h]!==void 0?l.pfValue[h]:f),n.isArcRadius.push((s.pfValue[h]!==void 0?s.pfValue[h]:c)==="arc-radius")}};hr.findLoopPoints=function(t,e,n,r){var i=t._private.rscratch,l=e.dirCounts,s=e.srcPos,u=t.pstyle("control-point-distances"),f=u?u.pfValue[0]:void 0,c=t.pstyle("loop-direction").pfValue,h=t.pstyle("loop-sweep").pfValue,v=t.pstyle("control-point-step-size").pfValue;i.edgeType="self";var p=n,m=v;r&&(p=0,m=f);var y=c-Math.PI/2,S=y-h/2,w=y+h/2,E=c+"_"+h;p=l[E]===void 0?l[E]=0:++l[E],i.ctrlpts=[s.x+Math.cos(S)*1.4*m*(p/3+1),s.y+Math.sin(S)*1.4*m*(p/3+1),s.x+Math.cos(w)*1.4*m*(p/3+1),s.y+Math.sin(w)*1.4*m*(p/3+1)]};hr.findCompoundLoopPoints=function(t,e,n,r){var i=t._private.rscratch;i.edgeType="compound";var l=e.srcPos,s=e.tgtPos,u=e.srcW,f=e.srcH,c=e.tgtW,h=e.tgtH,v=t.pstyle("control-point-step-size").pfValue,p=t.pstyle("control-point-distances"),m=p?p.pfValue[0]:void 0,y=n,S=v;r&&(y=0,S=m);var w=50,E={x:l.x-u/2,y:l.y-f/2},C={x:s.x-c/2,y:s.y-h/2},T={x:Math.min(E.x,C.x),y:Math.min(E.y,C.y)},A=.5,k=Math.max(A,Math.log(u*yu)),N=Math.max(A,Math.log(c*yu));i.ctrlpts=[T.x,T.y-(1+Math.pow(w,1.12)/100)*S*(y/3+1)*k,T.x-(1+Math.pow(w,1.12)/100)*S*(y/3+1)*N,T.y]};hr.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};hr.findBezierPoints=function(t,e,n,r,i){var l=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,u=t.pstyle("control-point-distances"),f=t.pstyle("control-point-weights"),c=u&&f?Math.min(u.value.length,f.value.length):1,h=u?u.pfValue[0]:void 0,v=f.value[0],p=r;l.edgeType=p?"multibezier":"bezier",l.ctrlpts=[];for(var m=0;m<c;m++){var y=(.5-e.eles.length/2+n)*s*(i?-1:1),S=void 0,w=hm(y);p&&(h=u?u.pfValue[m]:s,v=f.value[m]),r?S=h:S=h!==void 0?w*h:void 0;var E=S!==void 0?S:y,C=1-v,T=v,A=this.findMidptPtsEtc(t,e),k=A.midptPts,N=A.vectorNormInverse,_={x:k.x1*C+k.x2*T,y:k.y1*C+k.y2*T};l.ctrlpts.push(_.x+N.x*E,_.y+N.y*E)}};hr.findTaxiPoints=function(t,e){var n=t._private.rscratch;n.edgeType="segments";var r="vertical",i="horizontal",l="leftward",s="rightward",u="downward",f="upward",c="auto",h=e.posPts,v=e.srcW,p=e.srcH,m=e.tgtW,y=e.tgtH,S=t.pstyle("edge-distances").value,w=S!=="node-position",E=t.pstyle("taxi-direction").value,C=E,T=t.pstyle("taxi-turn"),A=T.units==="%",k=T.pfValue,N=k<0,_=t.pstyle("taxi-turn-min-distance").pfValue,O=w?(v+m)/2:0,U=w?(p+y)/2:0,M=h.x2-h.x1,I=h.y2-h.y1,P=function(G,ne){return G>0?Math.max(G-ne,0):Math.min(G+ne,0)},j=P(M,O),K=P(I,U),$=!1;C===c?E=Math.abs(j)>Math.abs(K)?i:r:C===f||C===u?(E=r,$=!0):(C===l||C===s)&&(E=i,$=!0);var B=E===r,H=B?K:j,Y=B?I:M,Q=hm(Y),z=!1;!($&&(A||N))&&(C===u&&Y<0||C===f&&Y>0||C===l&&Y>0||C===s&&Y<0)&&(Q*=-1,H=Q*Math.abs(H),z=!0);var F;if(A){var q=k<0?1+k:k;F=q*H}else{var L=k<0?H:0;F=L+k*Q}var W=function(G){return Math.abs(G)<_||Math.abs(G)>=Math.abs(H)},ae=W(F),se=W(Math.abs(H)-Math.abs(F)),me=ae||se;if(me&&!z)if(B){var Ne=Math.abs(Y)<=p/2,pe=Math.abs(M)<=m/2;if(Ne){var ee=(h.x1+h.x2)/2,le=h.y1,fe=h.y2;n.segpts=[ee,le,ee,fe]}else if(pe){var xe=(h.y1+h.y2)/2,Re=h.x1,Xe=h.x2;n.segpts=[Re,xe,Xe,xe]}else n.segpts=[h.x1,h.y2]}else{var Ke=Math.abs(Y)<=v/2,ot=Math.abs(I)<=y/2;if(Ke){var et=(h.y1+h.y2)/2,We=h.x1,ze=h.x2;n.segpts=[We,et,ze,et]}else if(ot){var Je=(h.x1+h.x2)/2,Ye=h.y1,ut=h.y2;n.segpts=[Je,Ye,Je,ut]}else n.segpts=[h.x2,h.y1]}else if(B){var je=h.y1+F+(w?p/2*Q:0),gt=h.x1,ue=h.x2;n.segpts=[gt,je,ue,je]}else{var Se=h.x1+F+(w?v/2*Q:0),Ie=h.y1,Ve=h.y2;n.segpts=[Se,Ie,Se,Ve]}if(n.isRound){var qe=t.pstyle("taxi-radius").value,Fe=t.pstyle("radius-type").value[0]==="arc-radius";n.radii=new Array(n.segpts.length/2).fill(qe),n.isArcRadius=new Array(n.segpts.length/2).fill(Fe)}};hr.tryToCorrectInvalidPoints=function(t,e){var n=t._private.rscratch;if(n.edgeType==="bezier"){var r=e.srcPos,i=e.tgtPos,l=e.srcW,s=e.srcH,u=e.tgtW,f=e.tgtH,c=e.srcShape,h=e.tgtShape,v=e.srcCornerRadius,p=e.tgtCornerRadius,m=e.srcRs,y=e.tgtRs,S=!Ge(n.startX)||!Ge(n.startY),w=!Ge(n.arrowStartX)||!Ge(n.arrowStartY),E=!Ge(n.endX)||!Ge(n.endY),C=!Ge(n.arrowEndX)||!Ge(n.arrowEndY),T=3,A=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,k=T*A,N=Sl({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),_=N<k,O=Sl({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),U=O<k,M=!1;if(S||w||_){M=!0;var I={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},P=Math.sqrt(I.x*I.x+I.y*I.y),j={x:I.x/P,y:I.y/P},K=Math.max(l,s),$={x:n.ctrlpts[0]+j.x*2*K,y:n.ctrlpts[1]+j.y*2*K},B=c.intersectLine(r.x,r.y,l,s,$.x,$.y,0,v,m);_?(n.ctrlpts[0]=n.ctrlpts[0]+j.x*(k-N),n.ctrlpts[1]=n.ctrlpts[1]+j.y*(k-N)):(n.ctrlpts[0]=B[0]+j.x*k,n.ctrlpts[1]=B[1]+j.y*k)}if(E||C||U){M=!0;var H={x:n.ctrlpts[0]-i.x,y:n.ctrlpts[1]-i.y},Y=Math.sqrt(H.x*H.x+H.y*H.y),Q={x:H.x/Y,y:H.y/Y},z=Math.max(l,s),F={x:n.ctrlpts[0]+Q.x*2*z,y:n.ctrlpts[1]+Q.y*2*z},q=h.intersectLine(i.x,i.y,u,f,F.x,F.y,0,p,y);U?(n.ctrlpts[0]=n.ctrlpts[0]+Q.x*(k-O),n.ctrlpts[1]=n.ctrlpts[1]+Q.y*(k-O)):(n.ctrlpts[0]=q[0]+Q.x*k,n.ctrlpts[1]=q[1]+Q.y*k)}M&&this.findEndpoints(t)}};hr.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var n=0;n+1<e.ctrlpts.length;n+=2)e.allpts.push(e.ctrlpts[n],e.ctrlpts[n+1]),n+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[n]+e.ctrlpts[n+2])/2,(e.ctrlpts[n+1]+e.ctrlpts[n+3])/2);e.allpts.push(e.endX,e.endY);var r,i;e.ctrlpts.length/2%2===0?(r=e.allpts.length/2-1,e.midX=e.allpts[r],e.midY=e.allpts[r+1]):(r=e.allpts.length/2-3,i=.5,e.midX=Yn(e.allpts[r],e.allpts[r+2],e.allpts[r+4],i),e.midY=Yn(e.allpts[r+1],e.allpts[r+3],e.allpts[r+5],i))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var l=2;l+3<e.allpts.length;l+=2){var s=e.radii[l/2-1],u=e.isArcRadius[l/2-1];e.roundCorners.push(Dm({x:e.allpts[l-2],y:e.allpts[l-1]},{x:e.allpts[l],y:e.allpts[l+1],radius:s},{x:e.allpts[l+2],y:e.allpts[l+3]},s,u))}}if(e.segpts.length%4===0){var f=e.segpts.length/2,c=f-2;e.midX=(e.segpts[c]+e.segpts[f])/2,e.midY=(e.segpts[c+1]+e.segpts[f+1])/2}else{var h=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[h],e.midY=e.segpts[h+1];else{var v={x:e.segpts[h],y:e.segpts[h+1]},p=e.roundCorners[h/2];if(p.radius===0){var m={x:e.segpts[h+2],y:e.segpts[h+3]};e.midX=v.x,e.midY=v.y,e.midVector=[v.y-m.y,m.x-v.x]}else{var y=[v.x-p.cx,v.y-p.cy],S=p.radius/Math.sqrt(Math.pow(y[0],2)+Math.pow(y[1],2));y=y.map(function(w){return w*S}),e.midX=p.cx+y[0],e.midY=p.cy+y[1],e.midVector=y}}}}};hr.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||Ge(e.startX)&&Ge(e.startY)&&Ge(e.endX)&&Ge(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,$t("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))};hr.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var n=this,r=n.cy,i=r.hasCompoundNodes(),l=new Ya,s=function(U,M){return[].concat(Of(U),[M?1:0]).join("-")},u=[],f=[],c=0;c<t.length;c++){var h=t[c],v=h._private,p=h.pstyle("curve-style").value;if(!(h.removed()||!h.takesUpSpace())){if(p==="haystack"){f.push(h);continue}var m=p==="unbundled-bezier"||Ri(p,"segments")||p==="straight"||p==="straight-triangle"||Ri(p,"taxi"),y=p==="unbundled-bezier"||p==="bezier",S=v.source,w=v.target,E=S.poolIndex(),C=w.poolIndex(),T=[E,C].sort(),A=s(T,m),k=l.get(A);k==null&&(k={eles:[]},u.push({pairId:T,edgeIsUnbundled:m}),l.set(A,k)),k.eles.push(h),m&&(k.hasUnbundled=!0),y&&(k.hasBezier=!0)}}for(var N=function(){var U=u[_],M=U.pairId,I=U.edgeIsUnbundled,P=s(M,I),j=l.get(P),K;if(!j.hasUnbundled){var $=j.eles[0].parallelEdges().filter(function(Fe){return Fe.isBundledBezier()});fm(j.eles),$.forEach(function(Fe){return j.eles.push(Fe)}),j.eles.sort(function(Fe,be){return Fe.poolIndex()-be.poolIndex()})}var B=j.eles[0],H=B.source(),Y=B.target();if(H.poolIndex()>Y.poolIndex()){var Q=H;H=Y,Y=Q}var z=j.srcPos=H.position(),F=j.tgtPos=Y.position(),q=j.srcW=H.outerWidth(),L=j.srcH=H.outerHeight(),W=j.tgtW=Y.outerWidth(),ae=j.tgtH=Y.outerHeight(),se=j.srcShape=n.nodeShapes[e.getNodeShape(H)],me=j.tgtShape=n.nodeShapes[e.getNodeShape(Y)],Ne=j.srcCornerRadius=H.pstyle("corner-radius").value==="auto"?"auto":H.pstyle("corner-radius").pfValue,pe=j.tgtCornerRadius=Y.pstyle("corner-radius").value==="auto"?"auto":Y.pstyle("corner-radius").pfValue,ee=j.tgtRs=Y._private.rscratch,le=j.srcRs=H._private.rscratch;j.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var fe=0;fe<j.eles.length;fe++){var xe=j.eles[fe],Re=xe[0]._private.rscratch,Xe=xe.pstyle("curve-style").value,Ke=Xe==="unbundled-bezier"||Ri(Xe,"segments")||Ri(Xe,"taxi"),ot=!H.same(xe.source());if(!j.calculatedIntersection&&H!==Y&&(j.hasBezier||j.hasUnbundled)){j.calculatedIntersection=!0;var et=se.intersectLine(z.x,z.y,q,L,F.x,F.y,0,Ne,le),We=j.srcIntn=et,ze=me.intersectLine(F.x,F.y,W,ae,z.x,z.y,0,pe,ee),Je=j.tgtIntn=ze,Ye=j.intersectionPts={x1:et[0],x2:ze[0],y1:et[1],y2:ze[1]},ut=j.posPts={x1:z.x,x2:F.x,y1:z.y,y2:F.y},je=ze[1]-et[1],gt=ze[0]-et[0],ue=Math.sqrt(gt*gt+je*je);Ge(ue)&&ue>=LO||(ue=Math.sqrt(Math.max(gt*gt,yu)+Math.max(je*je,yu)));var Se=j.vector={x:gt,y:je},Ie=j.vectorNorm={x:Se.x/ue,y:Se.y/ue},Ve={x:-Ie.y,y:Ie.x};j.nodesOverlap=!Ge(ue)||me.checkPoint(et[0],et[1],0,W,ae,F.x,F.y,pe,ee)||se.checkPoint(ze[0],ze[1],0,q,L,z.x,z.y,Ne,le),j.vectorNormInverse=Ve,K={nodesOverlap:j.nodesOverlap,dirCounts:j.dirCounts,calculatedIntersection:!0,hasBezier:j.hasBezier,hasUnbundled:j.hasUnbundled,eles:j.eles,srcPos:F,srcRs:ee,tgtPos:z,tgtRs:le,srcW:W,srcH:ae,tgtW:q,tgtH:L,srcIntn:Je,tgtIntn:We,srcShape:me,tgtShape:se,posPts:{x1:ut.x2,y1:ut.y2,x2:ut.x1,y2:ut.y1},intersectionPts:{x1:Ye.x2,y1:Ye.y2,x2:Ye.x1,y2:Ye.y1},vector:{x:-Se.x,y:-Se.y},vectorNorm:{x:-Ie.x,y:-Ie.y},vectorNormInverse:{x:-Ve.x,y:-Ve.y}}}var qe=ot?K:j;Re.nodesOverlap=qe.nodesOverlap,Re.srcIntn=qe.srcIntn,Re.tgtIntn=qe.tgtIntn,Re.isRound=Xe.startsWith("round"),i&&(H.isParent()||H.isChild()||Y.isParent()||Y.isChild())&&(H.parents().anySame(Y)||Y.parents().anySame(H)||H.same(Y)&&H.isParent())?e.findCompoundLoopPoints(xe,qe,fe,Ke):H===Y?e.findLoopPoints(xe,qe,fe,Ke):Xe.endsWith("segments")?e.findSegmentsPoints(xe,qe):Xe.endsWith("taxi")?e.findTaxiPoints(xe,qe):Xe==="straight"||!Ke&&j.eles.length%2===1&&fe===Math.floor(j.eles.length/2)?e.findStraightEdgePoints(xe):e.findBezierPoints(xe,qe,fe,Ke,ot),e.findEndpoints(xe),e.tryToCorrectInvalidPoints(xe,qe),e.checkForInvalidEdgeWarning(xe),e.storeAllpts(xe),e.storeEdgeProjections(xe),e.calculateArrowAngles(xe),e.recalculateEdgeLabelProjections(xe),e.calculateLabelAngles(xe)}},_=0;_<u.length;_++)N();this.findHaystackPoints(f)}};function HC(t){var e=[];if(t!=null){for(var n=0;n<t.length;n+=2){var r=t[n],i=t[n+1];e.push({x:r,y:i})}return e}}hr.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var n=e.edgeType;if(n==="segments")return HC(e.segpts)};hr.getControlPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var n=e.edgeType;if(n==="bezier"||n==="multibezier"||n==="self"||n==="compound")return HC(e.ctrlpts)};hr.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var Ru={};Ru.manualEndptToPx=function(t,e){var n=this,r=t.position(),i=t.outerWidth(),l=t.outerHeight(),s=t._private.rscratch;if(e.value.length===2){var u=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(u[0]=u[0]*i),e.units[1]==="%"&&(u[1]=u[1]*l),u[0]+=r.x,u[1]+=r.y,u}else{var f=e.pfValue[0];f=-Math.PI/2+f;var c=2*Math.max(i,l),h=[r.x+Math.cos(f)*c,r.y+Math.sin(f)*c];return n.nodeShapes[this.getNodeShape(t)].intersectLine(r.x,r.y,i,l,h[0],h[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,s)}};Ru.findEndpoints=function(t){var e,n,r,i,l=this,s,u=t.source()[0],f=t.target()[0],c=u.position(),h=f.position(),v=t.pstyle("target-arrow-shape").value,p=t.pstyle("source-arrow-shape").value,m=t.pstyle("target-distance-from-node").pfValue,y=t.pstyle("source-distance-from-node").pfValue,S=u._private.rscratch,w=f._private.rscratch,E=t.pstyle("curve-style").value,C=t._private.rscratch,T=C.edgeType,A=Ri(E,"taxi"),k=T==="self"||T==="compound",N=T==="bezier"||T==="multibezier"||k,_=T!=="bezier",O=T==="straight"||T==="segments",U=T==="segments",M=N||_||O,I=k||A,P=t.pstyle("source-endpoint"),j=I?"outside-to-node":P.value,K=u.pstyle("corner-radius").value==="auto"?"auto":u.pstyle("corner-radius").pfValue,$=t.pstyle("target-endpoint"),B=I?"outside-to-node":$.value,H=f.pstyle("corner-radius").value==="auto"?"auto":f.pstyle("corner-radius").pfValue;C.srcManEndpt=P,C.tgtManEndpt=$;var Y,Q,z,F,q=(e=($==null||(n=$.pfValue)===null||n===void 0?void 0:n.length)===2?$.pfValue:null)!==null&&e!==void 0?e:[0,0],L=(r=(P==null||(i=P.pfValue)===null||i===void 0?void 0:i.length)===2?P.pfValue:null)!==null&&r!==void 0?r:[0,0];if(N){var W=[C.ctrlpts[0],C.ctrlpts[1]],ae=_?[C.ctrlpts[C.ctrlpts.length-2],C.ctrlpts[C.ctrlpts.length-1]]:W;Y=ae,Q=W}else if(O){var se=U?C.segpts.slice(0,2):[h.x+q[0],h.y+q[1]],me=U?C.segpts.slice(C.segpts.length-2):[c.x+L[0],c.y+L[1]];Y=me,Q=se}if(B==="inside-to-node")s=[h.x,h.y];else if($.units)s=this.manualEndptToPx(f,$);else if(B==="outside-to-line")s=C.tgtIntn;else if(B==="outside-to-node"||B==="outside-to-node-or-label"?z=Y:(B==="outside-to-line"||B==="outside-to-line-or-label")&&(z=[c.x,c.y]),s=l.nodeShapes[this.getNodeShape(f)].intersectLine(h.x,h.y,f.outerWidth(),f.outerHeight(),z[0],z[1],0,H,w),B==="outside-to-node-or-label"||B==="outside-to-line-or-label"){var Ne=f._private.rscratch,pe=Ne.labelWidth,ee=Ne.labelHeight,le=Ne.labelX,fe=Ne.labelY,xe=pe/2,Re=ee/2,Xe=f.pstyle("text-valign").value;Xe==="top"?fe-=Re:Xe==="bottom"&&(fe+=Re);var Ke=f.pstyle("text-halign").value;Ke==="left"?le-=xe:Ke==="right"&&(le+=xe);var ot=hu(z[0],z[1],[le-xe,fe-Re,le+xe,fe-Re,le+xe,fe+Re,le-xe,fe+Re],h.x,h.y);if(ot.length>0){var et=c,We=ml(et,_s(s)),ze=ml(et,_s(ot)),Je=We;if(ze<We&&(s=ot,Je=ze),ot.length>2){var Ye=ml(et,{x:ot[2],y:ot[3]});Ye<Je&&(s=[ot[2],ot[3]])}}}var ut=ef(s,Y,l.arrowShapes[v].spacing(t)+m),je=ef(s,Y,l.arrowShapes[v].gap(t)+m);if(C.endX=je[0],C.endY=je[1],C.arrowEndX=ut[0],C.arrowEndY=ut[1],j==="inside-to-node")s=[c.x,c.y];else if(P.units)s=this.manualEndptToPx(u,P);else if(j==="outside-to-line")s=C.srcIntn;else if(j==="outside-to-node"||j==="outside-to-node-or-label"?F=Q:(j==="outside-to-line"||j==="outside-to-line-or-label")&&(F=[h.x,h.y]),s=l.nodeShapes[this.getNodeShape(u)].intersectLine(c.x,c.y,u.outerWidth(),u.outerHeight(),F[0],F[1],0,K,S),j==="outside-to-node-or-label"||j==="outside-to-line-or-label"){var gt=u._private.rscratch,ue=gt.labelWidth,Se=gt.labelHeight,Ie=gt.labelX,Ve=gt.labelY,qe=ue/2,Fe=Se/2,be=u.pstyle("text-valign").value;be==="top"?Ve-=Fe:be==="bottom"&&(Ve+=Fe);var G=u.pstyle("text-halign").value;G==="left"?Ie-=qe:G==="right"&&(Ie+=qe);var ne=hu(F[0],F[1],[Ie-qe,Ve-Fe,Ie+qe,Ve-Fe,Ie+qe,Ve+Fe,Ie-qe,Ve+Fe],c.x,c.y);if(ne.length>0){var de=h,oe=ml(de,_s(s)),Ee=ml(de,_s(ne)),Pe=oe;if(Ee<oe&&(s=[ne[0],ne[1]],Pe=Ee),ne.length>2){var De=ml(de,{x:ne[2],y:ne[3]});De<Pe&&(s=[ne[2],ne[3]])}}}var Qe=ef(s,Q,l.arrowShapes[p].spacing(t)+y),$e=ef(s,Q,l.arrowShapes[p].gap(t)+y);C.startX=$e[0],C.startY=$e[1],C.arrowStartX=Qe[0],C.arrowStartY=Qe[1],M&&(!Ge(C.startX)||!Ge(C.startY)||!Ge(C.endX)||!Ge(C.endY)?C.badLine=!0:C.badLine=!1)};Ru.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),e.edgeType==="haystack"?{x:e.haystackPts[0],y:e.haystackPts[1]}:{x:e.arrowStartX,y:e.arrowStartY}};Ru.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),e.edgeType==="haystack"?{x:e.haystackPts[2],y:e.haystackPts[3]}:{x:e.arrowEndX,y:e.arrowEndY}};var Am={};function FO(t,e,n){for(var r=function(c,h,v,p){return Yn(c,h,v,p)},i=e._private,l=i.rstyle.bezierPts,s=0;s<t.bezierProjPcts.length;s++){var u=t.bezierProjPcts[s];l.push({x:r(n[0],n[2],n[4],u),y:r(n[1],n[3],n[5],u)})}}Am.storeEdgeProjections=function(t){var e=t._private,n=e.rscratch,r=n.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,r==="multibezier"||r==="bezier"||r==="self"||r==="compound"){e.rstyle.bezierPts=[];for(var i=0;i+5<n.allpts.length;i+=4)FO(this,t,n.allpts.slice(i,i+6))}else if(r==="segments")for(var l=e.rstyle.linePts=[],i=0;i+1<n.allpts.length;i+=2)l.push({x:n.allpts[i],y:n.allpts[i+1]});else if(r==="haystack"){var s=n.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth};Am.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var Da={};Da.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!Fi(e)){var n,r,i=t._private,l=t.width(),s=t.height(),u=t.padding(),f=t.position(),c=t.pstyle("text-halign").strValue,h=t.pstyle("text-valign").strValue,v=i.rscratch,p=i.rstyle;switch(c){case"left":n=f.x-l/2-u;break;case"right":n=f.x+l/2+u;break;default:n=f.x}switch(h){case"top":r=f.y-s/2-u;break;case"bottom":r=f.y+s/2+u;break;default:r=f.y}v.labelX=n,v.labelY=r,p.labelX=n,p.labelY=r,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var GC=function(e,n){var r=Math.atan(n/e);return e===0&&r<0&&(r=r*-1),r},VC=function(e,n){var r=n.x-e.x,i=n.y-e.y;return GC(r,i)},IO=function(e,n,r,i){var l=du(0,i-.001,1),s=du(0,i+.001,1),u=Rs(e,n,r,l),f=Rs(e,n,r,s);return VC(u,f)};Da.recalculateEdgeLabelProjections=function(t){var e,n=t._private,r=n.rscratch,i=this,l={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(l.mid||l.source||l.target){e={x:r.midX,y:r.midY};var s=function(v,p,m){Ka(n.rscratch,v,p,m),Ka(n.rstyle,v,p,m)};s("labelX",null,e.x),s("labelY",null,e.y);var u=GC(r.midDispX,r.midDispY);s("labelAutoAngle",null,u);var f=function(){if(f.cache)return f.cache;for(var v=[],p=0;p+5<r.allpts.length;p+=4){var m={x:r.allpts[p],y:r.allpts[p+1]},y={x:r.allpts[p+2],y:r.allpts[p+3]},S={x:r.allpts[p+4],y:r.allpts[p+5]};v.push({p0:m,p1:y,p2:S,startDist:0,length:0,segments:[]})}var w=n.rstyle.bezierPts,E=i.bezierProjPcts.length;function C(_,O,U,M,I){var P=Sl(O,U),j=_.segments[_.segments.length-1],K={p0:O,p1:U,t0:M,t1:I,startDist:j?j.startDist+j.length:0,length:P};_.segments.push(K),_.length+=P}for(var T=0;T<v.length;T++){var A=v[T],k=v[T-1];k&&(A.startDist=k.startDist+k.length),C(A,A.p0,w[T*E],0,i.bezierProjPcts[0]);for(var N=0;N<E-1;N++)C(A,w[T*E+N],w[T*E+N+1],i.bezierProjPcts[N],i.bezierProjPcts[N+1]);C(A,w[T*E+E-1],A.p2,i.bezierProjPcts[E-1],1)}return f.cache=v},c=function(v){var p,m=v==="source";if(l[v]){var y=t.pstyle(v+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var S=f(),w,E=0,C=0,T=0;T<S.length;T++){for(var A=S[m?T:S.length-1-T],k=0;k<A.segments.length;k++){var N=A.segments[m?k:A.segments.length-1-k],_=T===S.length-1&&k===A.segments.length-1;if(E=C,C+=N.length,C>=y||_){w={cp:A,segment:N};break}}if(w)break}var O=w.cp,U=w.segment,M=(y-E)/U.length,I=U.t1-U.t0,P=m?U.t0+I*M:U.t1-I*M;P=du(0,P,1),e=Rs(O.p0,O.p1,O.p2,P),p=IO(O.p0,O.p1,O.p2,P);break}case"straight":case"segments":case"haystack":{for(var j=0,K,$,B,H,Y=r.allpts.length,Q=0;Q+3<Y&&(m?(B={x:r.allpts[Q],y:r.allpts[Q+1]},H={x:r.allpts[Q+2],y:r.allpts[Q+3]}):(B={x:r.allpts[Y-2-Q],y:r.allpts[Y-1-Q]},H={x:r.allpts[Y-4-Q],y:r.allpts[Y-3-Q]}),K=Sl(B,H),$=j,j+=K,!(j>=y));Q+=2);var z=y-$,F=z/K;F=du(0,F,1),e=i2(B,H,F),p=VC(B,H);break}}s("labelX",v,e.x),s("labelY",v,e.y),s("labelAutoAngle",v,p)}};c("source"),c("target"),this.applyLabelDimensions(t)}};Da.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};Da.applyPrefixedLabelDimensions=function(t,e){var n=t._private,r=this.getLabelText(t,e),i=wl(r,t._private.labelDimsKey);if(Rr(n.rscratch,"prefixedLabelDimsKey",e)!==i){Ka(n.rscratch,"prefixedLabelDimsKey",e,i);var l=this.calculateLabelDimensions(t,r),s=t.pstyle("line-height").pfValue,u=t.pstyle("text-wrap").strValue,f=Rr(n.rscratch,"labelWrapCachedLines",e)||[],c=u!=="wrap"?1:Math.max(f.length,1),h=l.height/c,v=h*s,p=l.width,m=l.height+(c-1)*(s-1)*h;Ka(n.rstyle,"labelWidth",e,p),Ka(n.rscratch,"labelWidth",e,p),Ka(n.rstyle,"labelHeight",e,m),Ka(n.rscratch,"labelHeight",e,m),Ka(n.rscratch,"labelLineHeight",e,v)}};Da.getLabelText=function(t,e){var n=t._private,r=e?e+"-":"",i=t.pstyle(r+"label").strValue,l=t.pstyle("text-transform").value,s=function(L,W){return W?(Ka(n.rscratch,L,e,W),W):Rr(n.rscratch,L,e)};if(!i)return"";l=="none"||(l=="uppercase"?i=i.toUpperCase():l=="lowercase"&&(i=i.toLowerCase()));var u=t.pstyle("text-wrap").value;if(u==="wrap"){var f=s("labelKey");if(f!=null&&s("labelWrapKey")===f)return s("labelWrapCachedText");for(var c="β",h=i.split(`
|
|
18
|
-
`),v=t.pstyle("text-max-width").pfValue,p=t.pstyle("text-overflow-wrap").value,m=p==="anywhere",y=[],S=/[\s\u200b]+|$/g,w=0;w<h.length;w++){var E=h[w],C=this.calculateLabelDimensions(t,E),T=C.width;if(m){var A=E.split("").join(c);E=A}if(T>v){var k=E.matchAll(S),N="",_=0,O=Or(k),U;try{for(O.s();!(U=O.n()).done;){var M=U.value,I=M[0],P=E.substring(_,M.index);_=M.index+I.length;var j=N.length===0?P:N+P+I,K=this.calculateLabelDimensions(t,j),$=K.width;$<=v?N+=P+I:(N&&y.push(N),N=P+I)}}catch(q){O.e(q)}finally{O.f()}N.match(/^[\s\u200b]+$/)||y.push(N)}else y.push(E)}s("labelWrapCachedLines",y),i=s("labelWrapCachedText",y.join(`
|
|
19
|
-
`)),s("labelWrapKey",f)}else if(u==="ellipsis"){var B=t.pstyle("text-max-width").pfValue,H="",Y="β¦",Q=!1;if(this.calculateLabelDimensions(t,i).width<B)return i;for(var z=0;z<i.length;z++){var F=this.calculateLabelDimensions(t,H+i[z]+Y).width;if(F>B)break;H+=i[z],z===i.length-1&&(Q=!0)}return Q||(H+=Y),H}return i};Da.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,n=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(n){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};Da.calculateLabelDimensions=function(t,e){var n=this,r=n.cy.window(),i=r.document,l=0,s=t.pstyle("font-style").strValue,u=t.pstyle("font-size").pfValue,f=t.pstyle("font-family").strValue,c=t.pstyle("font-weight").strValue,h=this.labelCalcCanvas,v=this.labelCalcCanvasContext;if(!h){h=this.labelCalcCanvas=i.createElement("canvas"),v=this.labelCalcCanvasContext=h.getContext("2d");var p=h.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}v.font="".concat(s," ").concat(c," ").concat(u,"px ").concat(f);for(var m=0,y=0,S=e.split(`
|
|
20
|
-
`),w=0;w<S.length;w++){var E=S[w],C=v.measureText(E),T=Math.ceil(C.width),A=u;m=Math.max(T,m),y+=A}return m+=l,y+=l,{width:m,height:y}};Da.calculateLabelAngle=function(t,e){var n=t._private,r=n.rscratch,i=t.isEdge(),l=e?e+"-":"",s=t.pstyle(l+"text-rotation"),u=s.strValue;return u==="none"?0:i&&u==="autorotate"?r.labelAutoAngle:u==="autorotate"?0:s.pfValue};Da.calculateLabelAngles=function(t){var e=this,n=t.isEdge(),r=t._private,i=r.rscratch;i.labelAngle=e.calculateLabelAngle(t),n&&(i.sourceLabelAngle=e.calculateLabelAngle(t,"source"),i.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var $C={},Z1=28,Q1=!1;$C.getNodeShape=function(t){var e=this,n=t.pstyle("shape").value;if(n==="cutrectangle"&&(t.width()<Z1||t.height()<Z1))return Q1||($t("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Q1=!0),"rectangle";if(t.isParent())return n==="rectangle"||n==="roundrectangle"||n==="round-rectangle"||n==="cutrectangle"||n==="cut-rectangle"||n==="barrel"?n:"rectangle";if(n==="polygon"){var r=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(r).name}return n};var gd={};gd.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),n=this,r=function(s){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),u)for(var f=0;f<s.length;f++){var c=s[f],h=c._private,v=h.rstyle;v.clean=!1,v.cleanConnected=!1}};n.binder(t).on("bounds.* dirty.*",function(s){var u=s.target;r(u)}).on("style.* background.*",function(s){var u=s.target;r(u,!1)});var i=function(s){if(s){var u=n.onUpdateEleCalcsFns;e.cleanStyle();for(var f=0;f<e.length;f++){var c=e[f],h=c._private.rstyle;c.isNode()&&!h.cleanConnected&&(r(c.connectedEdges()),h.cleanConnected=!0)}if(u)for(var v=0;v<u.length;v++){var p=u[v];p(s,e)}n.recalculateRenderedStyle(e),e=t.collection()}};n.flushRenderedStyleQueue=function(){i(!0)},n.beforeRender(i,n.beforeRenderPriorities.eleCalcs)};gd.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};gd.recalculateRenderedStyle=function(t,e){var n=function(A){return A._private.rstyle.cleanConnected};if(t.length!==0){var r=[],i=[];if(!this.destroyed){e===void 0&&(e=!0);for(var l=0;l<t.length;l++){var s=t[l],u=s._private,f=u.rstyle;s.isEdge()&&(!n(s.source())||!n(s.target()))&&(f.clean=!1),s.isEdge()&&s.isBundledBezier()&&s.parallelEdges().some(function(T){return!T._private.rstyle.clean&&T.isBundledBezier()})&&(f.clean=!1),!(e&&f.clean||s.removed())&&s.pstyle("display").value!=="none"&&(u.group==="nodes"?i.push(s):r.push(s),f.clean=!0)}for(var c=0;c<i.length;c++){var h=i[c],v=h._private,p=v.rstyle,m=h.position();this.recalculateNodeLabelProjection(h),p.nodeX=m.x,p.nodeY=m.y,p.nodeW=h.pstyle("width").pfValue,p.nodeH=h.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var y=0;y<r.length;y++){var S=r[y],w=S._private,E=w.rstyle,C=w.rscratch;E.srcX=C.arrowStartX,E.srcY=C.arrowStartY,E.tgtX=C.arrowEndX,E.tgtY=C.arrowEndY,E.midX=C.midX,E.midY=C.midY,E.labelAngle=C.labelAngle,E.sourceLabelAngle=C.sourceLabelAngle,E.targetLabelAngle=C.targetLabelAngle}}}};var pd={};pd.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],n=0;n<t.length;n++){var r=t[n],i=r._private.rscratch;r.grabbed()&&!r.isParent()?e.push(r):i.inDragLayer?t.drag.push(r):t.nondrag.push(r)}for(var n=0;n<e.length;n++){var r=e[n];t.drag.push(r)}}};pd.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};pd.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(AC),e.interactive=e.filter(function(n){return n.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var KC={};[Nl,Hf,hr,Ru,Am,Da,$C,gd,pd].forEach(function(t){vt(KC,t)});var YC={};YC.getCachedImage=function(t,e,n){var r=this,i=r.imageCache=r.imageCache||{},l=i[t];if(l)return l.image.complete||l.image.addEventListener("load",n),l.image;l=i[t]=i[t]||{};var s=l.image=new Image;s.addEventListener("load",n),s.addEventListener("error",function(){s.error=!0});var u="data:",f=t.substring(0,u.length).toLowerCase()===u;return f||(e=e==="null"?null:e,s.crossOrigin=e),s.src=t,s};var Gs={};Gs.registerBinding=function(t,e,n,r){var i=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(t)){for(var l=[],s=0;s<t.length;s++){var u=t[s];if(u!==void 0){var f=this.binder(u);l.push(f.on.apply(f,i))}}return l}var f=this.binder(t);return f.on.apply(f,i)};Gs.binder=function(t){var e=this,n=e.cy.window(),r=t===n||t===n.document||t===n.document.body||XN(t);if(e.supportsPassiveEvents==null){var i=!1;try{var l=Object.defineProperty({},"passive",{get:function(){return i=!0,!0}});n.addEventListener("test",null,l)}catch{}e.supportsPassiveEvents=i}var s=function(f,c,h){var v=Array.prototype.slice.call(arguments);return r&&e.supportsPassiveEvents&&(v[2]={capture:h??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:v}),(t.addEventListener||t.on).apply(t,v),this};return{on:s,addEventListener:s,addListener:s,bind:s}};Gs.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};Gs.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};Gs.load=function(){var t=this,e=t.cy.window(),n=function(G){return G.selected()},r=function(G){var ne=G.getRootNode();if(ne&&ne.nodeType===11&&ne.host!==void 0)return ne},i=function(G,ne,de,oe){G==null&&(G=t.cy);for(var Ee=0;Ee<ne.length;Ee++){var Pe=ne[Ee];G.emit({originalEvent:de,type:Pe,position:oe})}},l=function(G){return G.shiftKey||G.metaKey||G.ctrlKey},s=function(G,ne){var de=!0;if(t.cy.hasCompoundNodes()&&G&&G.pannable())for(var oe=0;ne&&oe<ne.length;oe++){var G=ne[oe];if(G.isNode()&&G.isParent()&&!G.pannable()){de=!1;break}}else de=!0;return de},u=function(G){G[0]._private.grabbed=!0},f=function(G){G[0]._private.grabbed=!1},c=function(G){G[0]._private.rscratch.inDragLayer=!0},h=function(G){G[0]._private.rscratch.inDragLayer=!1},v=function(G){G[0]._private.rscratch.isGrabTarget=!0},p=function(G){G[0]._private.rscratch.isGrabTarget=!1},m=function(G,ne){var de=ne.addToList,oe=de.has(G);!oe&&G.grabbable()&&!G.locked()&&(de.merge(G),u(G))},y=function(G,ne){if(G.cy().hasCompoundNodes()&&!(ne.inDragLayer==null&&ne.addToList==null)){var de=G.descendants();ne.inDragLayer&&(de.forEach(c),de.connectedEdges().forEach(c)),ne.addToList&&m(de,ne)}},S=function(G,ne){ne=ne||{};var de=G.cy().hasCompoundNodes();ne.inDragLayer&&(G.forEach(c),G.neighborhood().stdFilter(function(oe){return!de||oe.isEdge()}).forEach(c)),ne.addToList&&G.forEach(function(oe){m(oe,ne)}),y(G,ne),C(G,{inDragLayer:ne.inDragLayer}),t.updateCachedGrabbedEles()},w=S,E=function(G){G&&(t.getCachedZSortedEles().forEach(function(ne){f(ne),h(ne),p(ne)}),t.updateCachedGrabbedEles())},C=function(G,ne){if(!(ne.inDragLayer==null&&ne.addToList==null)&&G.cy().hasCompoundNodes()){var de=G.ancestors().orphans();if(!de.same(G)){var oe=de.descendants().spawnSelf().merge(de).unmerge(G).unmerge(G.descendants()),Ee=oe.connectedEdges();ne.inDragLayer&&(Ee.forEach(c),oe.forEach(c)),ne.addToList&&oe.forEach(function(Pe){m(Pe,ne)})}}},T=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},A=typeof MutationObserver<"u",k=typeof ResizeObserver<"u";A?(t.removeObserver=new MutationObserver(function(be){for(var G=0;G<be.length;G++){var ne=be[G],de=ne.removedNodes;if(de)for(var oe=0;oe<de.length;oe++){var Ee=de[oe];if(Ee===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(be){t.destroy()});var N=Au(function(){t.cy.resize()},100);A&&(t.styleObserver=new MutationObserver(N),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",N),k&&(t.resizeObserver=new ResizeObserver(N),t.resizeObserver.observe(t.container));var _=function(G,ne){for(;G!=null;)ne(G),G=G.parentNode},O=function(){t.invalidateContainerClientCoordsCache()};_(t.container,function(be){t.registerBinding(be,"transitionend",O),t.registerBinding(be,"animationend",O),t.registerBinding(be,"scroll",O)}),t.registerBinding(t.container,"contextmenu",function(be){be.preventDefault()});var U=function(){return t.selection[4]!==0},M=function(G){for(var ne=t.findContainerClientCoords(),de=ne[0],oe=ne[1],Ee=ne[2],Pe=ne[3],De=G.touches?G.touches:[G],Qe=!1,$e=0;$e<De.length;$e++){var rt=De[$e];if(de<=rt.clientX&&rt.clientX<=de+Ee&&oe<=rt.clientY&&rt.clientY<=oe+Pe){Qe=!0;break}}if(!Qe)return!1;for(var it=t.container,X=G.target,re=X.parentNode,Ce=!1;re;){if(re===it){Ce=!0;break}re=re.parentNode}return!!Ce};t.registerBinding(t.container,"mousedown",function(G){if(M(G)&&!(t.hoverData.which===1&&G.which!==1)){G.preventDefault(),T(),t.hoverData.capture=!0,t.hoverData.which=G.which;var ne=t.cy,de=[G.clientX,G.clientY],oe=t.projectIntoViewport(de[0],de[1]),Ee=t.selection,Pe=t.findNearestElements(oe[0],oe[1],!0,!1),De=Pe[0],Qe=t.dragData.possibleDragElements;t.hoverData.mdownPos=oe,t.hoverData.mdownGPos=de;var $e=function(Oe){return{originalEvent:G,type:Oe,position:{x:oe[0],y:oe[1]}}},rt=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var Oe=t.hoverData.down;Oe?Oe.emit($e("taphold")):ne.emit($e("taphold"))}},t.tapholdDuration)};if(G.which==3){t.hoverData.cxtStarted=!0;var it={originalEvent:G,type:"cxttapstart",position:{x:oe[0],y:oe[1]}};De?(De.activate(),De.emit(it),t.hoverData.down=De):ne.emit(it),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(G.which==1){De&&De.activate();{if(De!=null&&t.nodeIsGrabbable(De)){var X=function(Oe){Oe.emit($e("grab"))};if(v(De),!De.selected())Qe=t.dragData.possibleDragElements=ne.collection(),w(De,{addToList:Qe}),De.emit($e("grabon")).emit($e("grab"));else{Qe=t.dragData.possibleDragElements=ne.collection();var re=ne.$(function(Ce){return Ce.isNode()&&Ce.selected()&&t.nodeIsGrabbable(Ce)});S(re,{addToList:Qe}),De.emit($e("grabon")),re.forEach(X)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=De,t.hoverData.downs=Pe,t.hoverData.downTime=new Date().getTime()}i(De,["mousedown","tapstart","vmousedown"],G,{x:oe[0],y:oe[1]}),De==null?(Ee[4]=1,t.data.bgActivePosistion={x:oe[0],y:oe[1]},t.redrawHint("select",!0),t.redraw()):De.pannable()&&(Ee[4]=1),rt()}Ee[0]=Ee[2]=oe[0],Ee[1]=Ee[3]=oe[1]}},!1);var I=r(t.container);t.registerBinding([e,I],"mousemove",function(G){var ne=t.hoverData.capture;if(!(!ne&&!M(G))){var de=!1,oe=t.cy,Ee=oe.zoom(),Pe=[G.clientX,G.clientY],De=t.projectIntoViewport(Pe[0],Pe[1]),Qe=t.hoverData.mdownPos,$e=t.hoverData.mdownGPos,rt=t.selection,it=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(it=t.findNearestElement(De[0],De[1],!0,!1));var X=t.hoverData.last,re=t.hoverData.down,Ce=[De[0]-rt[2],De[1]-rt[3]],Oe=t.dragData.possibleDragElements,yt;if($e){var dt=Pe[0]-$e[0],He=dt*dt,Be=Pe[1]-$e[1],Ze=Be*Be,Et=He+Ze;t.hoverData.isOverThresholdDrag=yt=Et>=t.desktopTapThreshold2}var xt=l(G);yt&&(t.hoverData.tapholdCancelled=!0);var Rn=function(){var Cn=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Cn.length===0?(Cn.push(Ce[0]),Cn.push(Ce[1])):(Cn[0]+=Ce[0],Cn[1]+=Ce[1])};de=!0,i(it,["mousemove","vmousemove","tapdrag"],G,{x:De[0],y:De[1]});var Kt=function(Cn){return{originalEvent:G,type:Cn,position:{x:De[0],y:De[1]}}},pn=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||oe.emit(Kt("boxstart")),rt[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(yt){var wn=Kt("cxtdrag");re?re.emit(wn):oe.emit(wn),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||it!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(Kt("cxtdragout")),t.hoverData.cxtOver=it,it&&it.emit(Kt("cxtdragover")))}}else if(t.hoverData.dragging){if(de=!0,oe.panningEnabled()&&oe.userPanningEnabled()){var Tt;if(t.hoverData.justStartedPan){var mn=t.hoverData.mdownPos;Tt={x:(De[0]-mn[0])*Ee,y:(De[1]-mn[1])*Ee},t.hoverData.justStartedPan=!1}else Tt={x:Ce[0]*Ee,y:Ce[1]*Ee};oe.panBy(Tt),oe.emit(Kt("dragpan")),t.hoverData.dragged=!0}De=t.projectIntoViewport(G.clientX,G.clientY)}else if(rt[4]==1&&(re==null||re.pannable())){if(yt){if(!t.hoverData.dragging&&oe.boxSelectionEnabled()&&(xt||!oe.panningEnabled()||!oe.userPanningEnabled()))pn();else if(!t.hoverData.selecting&&oe.panningEnabled()&&oe.userPanningEnabled()){var $n=s(re,t.hoverData.downs);$n&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,rt[4]=0,t.data.bgActivePosistion=_s(Qe),t.redrawHint("select",!0),t.redraw())}re&&re.pannable()&&re.active()&&re.unactivate()}}else{if(re&&re.pannable()&&re.active()&&re.unactivate(),(!re||!re.grabbed())&&it!=X&&(X&&i(X,["mouseout","tapdragout"],G,{x:De[0],y:De[1]}),it&&i(it,["mouseover","tapdragover"],G,{x:De[0],y:De[1]}),t.hoverData.last=it),re)if(yt){if(oe.boxSelectionEnabled()&&xt)re&&re.grabbed()&&(E(Oe),re.emit(Kt("freeon")),Oe.emit(Kt("free")),t.dragData.didDrag&&(re.emit(Kt("dragfreeon")),Oe.emit(Kt("dragfree")))),pn();else if(re&&re.grabbed()&&t.nodeIsDraggable(re)){var Sn=!t.dragData.didDrag;Sn&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||S(Oe,{inDragLayer:!0});var yn={x:0,y:0};if(Ge(Ce[0])&&Ge(Ce[1])&&(yn.x+=Ce[0],yn.y+=Ce[1],Sn)){var bn=t.hoverData.dragDelta;bn&&Ge(bn[0])&&Ge(bn[1])&&(yn.x+=bn[0],yn.y+=bn[1])}t.hoverData.draggingEles=!0,Oe.silentShift(yn).emit(Kt("position")).emit(Kt("drag")),t.redrawHint("drag",!0),t.redraw()}}else Rn();de=!0}if(rt[2]=De[0],rt[3]=De[1],de)return G.stopPropagation&&G.stopPropagation(),G.preventDefault&&G.preventDefault(),!1}},!1);var P,j,K;t.registerBinding(e,"mouseup",function(G){if(!(t.hoverData.which===1&&G.which!==1&&t.hoverData.capture)){var ne=t.hoverData.capture;if(ne){t.hoverData.capture=!1;var de=t.cy,oe=t.projectIntoViewport(G.clientX,G.clientY),Ee=t.selection,Pe=t.findNearestElement(oe[0],oe[1],!0,!1),De=t.dragData.possibleDragElements,Qe=t.hoverData.down,$e=l(G);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Qe&&Qe.unactivate();var rt=function(dt){return{originalEvent:G,type:dt,position:{x:oe[0],y:oe[1]}}};if(t.hoverData.which===3){var it=rt("cxttapend");if(Qe?Qe.emit(it):de.emit(it),!t.hoverData.cxtDragged){var X=rt("cxttap");Qe?Qe.emit(X):de.emit(X)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(Pe,["mouseup","tapend","vmouseup"],G,{x:oe[0],y:oe[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Qe,["click","tap","vclick"],G,{x:oe[0],y:oe[1]}),j=!1,G.timeStamp-K<=de.multiClickDebounceTime()?(P&&clearTimeout(P),j=!0,K=null,i(Qe,["dblclick","dbltap","vdblclick"],G,{x:oe[0],y:oe[1]})):(P=setTimeout(function(){j||i(Qe,["oneclick","onetap","voneclick"],G,{x:oe[0],y:oe[1]})},de.multiClickDebounceTime()),K=G.timeStamp)),Qe==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!l(G)&&(de.$(n).unselect(["tapunselect"]),De.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=De=de.collection()),Pe==Qe&&!t.dragData.didDrag&&!t.hoverData.selecting&&Pe!=null&&Pe._private.selectable&&(t.hoverData.dragging||(de.selectionType()==="additive"||$e?Pe.selected()?Pe.unselect(["tapunselect"]):Pe.select(["tapselect"]):$e||(de.$(n).unmerge(Pe).unselect(["tapunselect"]),Pe.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var re=de.collection(t.getAllInBox(Ee[0],Ee[1],Ee[2],Ee[3]));t.redrawHint("select",!0),re.length>0&&t.redrawHint("eles",!0),de.emit(rt("boxend"));var Ce=function(dt){return dt.selectable()&&!dt.selected()};de.selectionType()==="additive"||$e||de.$(n).unmerge(re).unselect(),re.emit(rt("box")).stdFilter(Ce).select().emit(rt("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!Ee[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Oe=Qe&&Qe.grabbed();E(De),Oe&&(Qe.emit(rt("freeon")),De.emit(rt("free")),t.dragData.didDrag&&(Qe.emit(rt("dragfreeon")),De.emit(rt("dragfree"))))}}Ee[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var $=[],B=4,H,Y=1e5,Q=function(G,ne){for(var de=0;de<G.length;de++)if(G[de]%ne!==0)return!1;return!0},z=function(G){for(var ne=Math.abs(G[0]),de=1;de<G.length;de++)if(Math.abs(G[de])!==ne)return!1;return!0},F=function(G){var ne=!1,de=G.deltaY;if(de==null&&(G.wheelDeltaY!=null?de=G.wheelDeltaY/4:G.wheelDelta!=null&&(de=G.wheelDelta/4)),de!==0){if(H==null)if($.length>=B){var oe=$;if(H=Q(oe,5),!H){var Ee=Math.abs(oe[0]);H=z(oe)&&Ee>5}if(H)for(var Pe=0;Pe<oe.length;Pe++)Y=Math.min(Math.abs(oe[Pe]),Y)}else $.push(de),ne=!0;else H&&(Y=Math.min(Math.abs(de),Y));if(!t.scrollingPage){var De=t.cy,Qe=De.zoom(),$e=De.pan(),rt=t.projectIntoViewport(G.clientX,G.clientY),it=[rt[0]*Qe+$e.x,rt[1]*Qe+$e.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||U()){G.preventDefault();return}if(De.panningEnabled()&&De.userPanningEnabled()&&De.zoomingEnabled()&&De.userZoomingEnabled()){G.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var X;ne&&Math.abs(de)>5&&(de=hm(de)*5),X=de/-250,H&&(X/=Y,X*=3),X=X*t.wheelSensitivity;var re=G.deltaMode===1;re&&(X*=33);var Ce=De.zoom()*Math.pow(10,X);G.type==="gesturechange"&&(Ce=t.gestureStartZoom*G.scale),De.zoom({level:Ce,renderedPosition:{x:it[0],y:it[1]}}),De.emit({type:G.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:G,position:{x:rt[0],y:rt[1]}})}}}};t.registerBinding(t.container,"wheel",F,!0),t.registerBinding(e,"scroll",function(G){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(G){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||G.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(be){t.hasTouchStarted||F(be)},!0),t.registerBinding(t.container,"mouseout",function(G){var ne=t.projectIntoViewport(G.clientX,G.clientY);t.cy.emit({originalEvent:G,type:"mouseout",position:{x:ne[0],y:ne[1]}})},!1),t.registerBinding(t.container,"mouseover",function(G){var ne=t.projectIntoViewport(G.clientX,G.clientY);t.cy.emit({originalEvent:G,type:"mouseover",position:{x:ne[0],y:ne[1]}})},!1);var q,L,W,ae,se,me,Ne,pe,ee,le,fe,xe,Re,Xe=function(G,ne,de,oe){return Math.sqrt((de-G)*(de-G)+(oe-ne)*(oe-ne))},Ke=function(G,ne,de,oe){return(de-G)*(de-G)+(oe-ne)*(oe-ne)},ot;t.registerBinding(t.container,"touchstart",ot=function(G){if(t.hasTouchStarted=!0,!!M(G)){T(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var ne=t.cy,de=t.touchData.now,oe=t.touchData.earlier;if(G.touches[0]){var Ee=t.projectIntoViewport(G.touches[0].clientX,G.touches[0].clientY);de[0]=Ee[0],de[1]=Ee[1]}if(G.touches[1]){var Ee=t.projectIntoViewport(G.touches[1].clientX,G.touches[1].clientY);de[2]=Ee[0],de[3]=Ee[1]}if(G.touches[2]){var Ee=t.projectIntoViewport(G.touches[2].clientX,G.touches[2].clientY);de[4]=Ee[0],de[5]=Ee[1]}var Pe=function(xt){return{originalEvent:G,type:xt,position:{x:de[0],y:de[1]}}};if(G.touches[1]){t.touchData.singleTouchMoved=!0,E(t.dragData.touchDragEles);var De=t.findContainerClientCoords();ee=De[0],le=De[1],fe=De[2],xe=De[3],q=G.touches[0].clientX-ee,L=G.touches[0].clientY-le,W=G.touches[1].clientX-ee,ae=G.touches[1].clientY-le,Re=0<=q&&q<=fe&&0<=W&&W<=fe&&0<=L&&L<=xe&&0<=ae&&ae<=xe;var Qe=ne.pan(),$e=ne.zoom();se=Xe(q,L,W,ae),me=Ke(q,L,W,ae),Ne=[(q+W)/2,(L+ae)/2],pe=[(Ne[0]-Qe.x)/$e,(Ne[1]-Qe.y)/$e];var rt=200,it=rt*rt;if(me<it&&!G.touches[2]){var X=t.findNearestElement(de[0],de[1],!0,!0),re=t.findNearestElement(de[2],de[3],!0,!0);X&&X.isNode()?(X.activate().emit(Pe("cxttapstart")),t.touchData.start=X):re&&re.isNode()?(re.activate().emit(Pe("cxttapstart")),t.touchData.start=re):ne.emit(Pe("cxttapstart")),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(G.touches[2])ne.boxSelectionEnabled()&&G.preventDefault();else if(!G.touches[1]){if(G.touches[0]){var Ce=t.findNearestElements(de[0],de[1],!0,!0),Oe=Ce[0];if(Oe!=null&&(Oe.activate(),t.touchData.start=Oe,t.touchData.starts=Ce,t.nodeIsGrabbable(Oe))){var yt=t.dragData.touchDragEles=ne.collection(),dt=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),Oe.selected()?(dt=ne.$(function(Et){return Et.selected()&&t.nodeIsGrabbable(Et)}),S(dt,{addToList:yt})):w(Oe,{addToList:yt}),v(Oe),Oe.emit(Pe("grabon")),dt?dt.forEach(function(Et){Et.emit(Pe("grab"))}):Oe.emit(Pe("grab"))}i(Oe,["touchstart","tapstart","vmousedown"],G,{x:de[0],y:de[1]}),Oe==null&&(t.data.bgActivePosistion={x:Ee[0],y:Ee[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&i(t.touchData.start,["taphold"],G,{x:de[0],y:de[1]})},t.tapholdDuration)}}if(G.touches.length>=1){for(var He=t.touchData.startPosition=[null,null,null,null,null,null],Be=0;Be<de.length;Be++)He[Be]=oe[Be]=de[Be];var Ze=G.touches[0];t.touchData.startGPosition=[Ze.clientX,Ze.clientY]}}},!1);var et;t.registerBinding(e,"touchmove",et=function(G){var ne=t.touchData.capture;if(!(!ne&&!M(G))){var de=t.selection,oe=t.cy,Ee=t.touchData.now,Pe=t.touchData.earlier,De=oe.zoom();if(G.touches[0]){var Qe=t.projectIntoViewport(G.touches[0].clientX,G.touches[0].clientY);Ee[0]=Qe[0],Ee[1]=Qe[1]}if(G.touches[1]){var Qe=t.projectIntoViewport(G.touches[1].clientX,G.touches[1].clientY);Ee[2]=Qe[0],Ee[3]=Qe[1]}if(G.touches[2]){var Qe=t.projectIntoViewport(G.touches[2].clientX,G.touches[2].clientY);Ee[4]=Qe[0],Ee[5]=Qe[1]}var $e=function(Xi){return{originalEvent:G,type:Xi,position:{x:Ee[0],y:Ee[1]}}},rt=t.touchData.startGPosition,it;if(ne&&G.touches[0]&&rt){for(var X=[],re=0;re<Ee.length;re++)X[re]=Ee[re]-Pe[re];var Ce=G.touches[0].clientX-rt[0],Oe=Ce*Ce,yt=G.touches[0].clientY-rt[1],dt=yt*yt,He=Oe+dt;it=He>=t.touchTapThreshold2}if(ne&&t.touchData.cxt){G.preventDefault();var Be=G.touches[0].clientX-ee,Ze=G.touches[0].clientY-le,Et=G.touches[1].clientX-ee,xt=G.touches[1].clientY-le,Rn=Ke(Be,Ze,Et,xt),Kt=Rn/me,pn=150,wn=pn*pn,Tt=1.5,mn=Tt*Tt;if(Kt>=mn||Rn>=wn){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var $n=$e("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit($n),t.touchData.start=null):oe.emit($n)}}if(ne&&t.touchData.cxt){var $n=$e("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit($n):oe.emit($n),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Sn=t.findNearestElement(Ee[0],Ee[1],!0,!0);(!t.touchData.cxtOver||Sn!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit($e("cxtdragout")),t.touchData.cxtOver=Sn,Sn&&Sn.emit($e("cxtdragover")))}else if(ne&&G.touches[2]&&oe.boxSelectionEnabled())G.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||oe.emit($e("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,de[4]=1,!de||de.length===0||de[0]===void 0?(de[0]=(Ee[0]+Ee[2]+Ee[4])/3,de[1]=(Ee[1]+Ee[3]+Ee[5])/3,de[2]=(Ee[0]+Ee[2]+Ee[4])/3+1,de[3]=(Ee[1]+Ee[3]+Ee[5])/3+1):(de[2]=(Ee[0]+Ee[2]+Ee[4])/3,de[3]=(Ee[1]+Ee[3]+Ee[5])/3),t.redrawHint("select",!0),t.redraw();else if(ne&&G.touches[1]&&!t.touchData.didSelect&&oe.zoomingEnabled()&&oe.panningEnabled()&&oe.userZoomingEnabled()&&oe.userPanningEnabled()){G.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var yn=t.dragData.touchDragEles;if(yn){t.redrawHint("drag",!0);for(var bn=0;bn<yn.length;bn++){var Vr=yn[bn]._private;Vr.grabbed=!1,Vr.rscratch.inDragLayer=!1}}var Cn=t.touchData.start,Be=G.touches[0].clientX-ee,Ze=G.touches[0].clientY-le,Et=G.touches[1].clientX-ee,xt=G.touches[1].clientY-le,sr=Xe(Be,Ze,Et,xt),Un=sr/se;if(Re){var or=Be-q,$r=Ze-L,Kr=Et-W,nn=xt-ae,sa=(or+Kr)/2,wr=($r+nn)/2,Qn=oe.zoom(),ke=Qn*Un,at=oe.pan(),St=pe[0]*Qn+at.x,te=pe[1]*Qn+at.y,_e={x:-ke/Qn*(St-at.x-sa)+St,y:-ke/Qn*(te-at.y-wr)+te};if(Cn&&Cn.active()){var yn=t.dragData.touchDragEles;E(yn),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Cn.unactivate().emit($e("freeon")),yn.emit($e("free")),t.dragData.didDrag&&(Cn.emit($e("dragfreeon")),yn.emit($e("dragfree")))}oe.viewport({zoom:ke,pan:_e,cancelOnFailedZoom:!0}),oe.emit($e("pinchzoom")),se=sr,q=Be,L=Ze,W=Et,ae=xt,t.pinching=!0}if(G.touches[0]){var Qe=t.projectIntoViewport(G.touches[0].clientX,G.touches[0].clientY);Ee[0]=Qe[0],Ee[1]=Qe[1]}if(G.touches[1]){var Qe=t.projectIntoViewport(G.touches[1].clientX,G.touches[1].clientY);Ee[2]=Qe[0],Ee[3]=Qe[1]}if(G.touches[2]){var Qe=t.projectIntoViewport(G.touches[2].clientX,G.touches[2].clientY);Ee[4]=Qe[0],Ee[5]=Qe[1]}}else if(G.touches[0]&&!t.touchData.didSelect){var Me=t.touchData.start,bt=t.touchData.last,Sn;if(!t.hoverData.draggingEles&&!t.swipePanning&&(Sn=t.findNearestElement(Ee[0],Ee[1],!0,!0)),ne&&Me!=null&&G.preventDefault(),ne&&Me!=null&&t.nodeIsDraggable(Me))if(it){var yn=t.dragData.touchDragEles,Tn=!t.dragData.didDrag;Tn&&S(yn,{inDragLayer:!0}),t.dragData.didDrag=!0;var At={x:0,y:0};if(Ge(X[0])&&Ge(X[1])&&(At.x+=X[0],At.y+=X[1],Tn)){t.redrawHint("eles",!0);var cn=t.touchData.dragDelta;cn&&Ge(cn[0])&&Ge(cn[1])&&(At.x+=cn[0],At.y+=cn[1])}t.hoverData.draggingEles=!0,yn.silentShift(At).emit($e("position")).emit($e("drag")),t.redrawHint("drag",!0),t.touchData.startPosition[0]==Pe[0]&&t.touchData.startPosition[1]==Pe[1]&&t.redrawHint("eles",!0),t.redraw()}else{var cn=t.touchData.dragDelta=t.touchData.dragDelta||[];cn.length===0?(cn.push(X[0]),cn.push(X[1])):(cn[0]+=X[0],cn[1]+=X[1])}if(i(Me||Sn,["touchmove","tapdrag","vmousemove"],G,{x:Ee[0],y:Ee[1]}),(!Me||!Me.grabbed())&&Sn!=bt&&(bt&&bt.emit($e("tapdragout")),Sn&&Sn.emit($e("tapdragover"))),t.touchData.last=Sn,ne)for(var bn=0;bn<Ee.length;bn++)Ee[bn]&&t.touchData.startPosition[bn]&&it&&(t.touchData.singleTouchMoved=!0);if(ne&&(Me==null||Me.pannable())&&oe.panningEnabled()&&oe.userPanningEnabled()){var Ol=s(Me,t.touchData.starts);Ol&&(G.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=_s(t.touchData.startPosition)),t.swipePanning?(oe.panBy({x:X[0]*De,y:X[1]*De}),oe.emit($e("dragpan"))):it&&(t.swipePanning=!0,oe.panBy({x:Ce*De,y:yt*De}),oe.emit($e("dragpan")),Me&&(Me.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var Qe=t.projectIntoViewport(G.touches[0].clientX,G.touches[0].clientY);Ee[0]=Qe[0],Ee[1]=Qe[1]}}for(var re=0;re<Ee.length;re++)Pe[re]=Ee[re];ne&&G.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var We;t.registerBinding(e,"touchcancel",We=function(G){var ne=t.touchData.start;t.touchData.capture=!1,ne&&ne.unactivate()});var ze,Je,Ye,ut;if(t.registerBinding(e,"touchend",ze=function(G){var ne=t.touchData.start,de=t.touchData.capture;if(de)G.touches.length===0&&(t.touchData.capture=!1),G.preventDefault();else return;var oe=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var Ee=t.cy,Pe=Ee.zoom(),De=t.touchData.now,Qe=t.touchData.earlier;if(G.touches[0]){var $e=t.projectIntoViewport(G.touches[0].clientX,G.touches[0].clientY);De[0]=$e[0],De[1]=$e[1]}if(G.touches[1]){var $e=t.projectIntoViewport(G.touches[1].clientX,G.touches[1].clientY);De[2]=$e[0],De[3]=$e[1]}if(G.touches[2]){var $e=t.projectIntoViewport(G.touches[2].clientX,G.touches[2].clientY);De[4]=$e[0],De[5]=$e[1]}var rt=function(wn){return{originalEvent:G,type:wn,position:{x:De[0],y:De[1]}}};ne&&ne.unactivate();var it;if(t.touchData.cxt){if(it=rt("cxttapend"),ne?ne.emit(it):Ee.emit(it),!t.touchData.cxtDragged){var X=rt("cxttap");ne?ne.emit(X):Ee.emit(X)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!G.touches[2]&&Ee.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var re=Ee.collection(t.getAllInBox(oe[0],oe[1],oe[2],oe[3]));oe[0]=void 0,oe[1]=void 0,oe[2]=void 0,oe[3]=void 0,oe[4]=0,t.redrawHint("select",!0),Ee.emit(rt("boxend"));var Ce=function(wn){return wn.selectable()&&!wn.selected()};re.emit(rt("box")).stdFilter(Ce).select().emit(rt("boxselect")),re.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(ne?.unactivate(),G.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!G.touches[1]){if(!G.touches[0]){if(!G.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Oe=t.dragData.touchDragEles;if(ne!=null){var yt=ne._private.grabbed;E(Oe),t.redrawHint("drag",!0),t.redrawHint("eles",!0),yt&&(ne.emit(rt("freeon")),Oe.emit(rt("free")),t.dragData.didDrag&&(ne.emit(rt("dragfreeon")),Oe.emit(rt("dragfree")))),i(ne,["touchend","tapend","vmouseup","tapdragout"],G,{x:De[0],y:De[1]}),ne.unactivate(),t.touchData.start=null}else{var dt=t.findNearestElement(De[0],De[1],!0,!0);i(dt,["touchend","tapend","vmouseup","tapdragout"],G,{x:De[0],y:De[1]})}var He=t.touchData.startPosition[0]-De[0],Be=He*He,Ze=t.touchData.startPosition[1]-De[1],Et=Ze*Ze,xt=Be+Et,Rn=xt*Pe*Pe;t.touchData.singleTouchMoved||(ne||Ee.$(":selected").unselect(["tapunselect"]),i(ne,["tap","vclick"],G,{x:De[0],y:De[1]}),Je=!1,G.timeStamp-ut<=Ee.multiClickDebounceTime()?(Ye&&clearTimeout(Ye),Je=!0,ut=null,i(ne,["dbltap","vdblclick"],G,{x:De[0],y:De[1]})):(Ye=setTimeout(function(){Je||i(ne,["onetap","voneclick"],G,{x:De[0],y:De[1]})},Ee.multiClickDebounceTime()),ut=G.timeStamp)),ne!=null&&!t.dragData.didDrag&&ne._private.selectable&&Rn<t.touchTapThreshold2&&!t.pinching&&(Ee.selectionType()==="single"?(Ee.$(n).unmerge(ne).unselect(["tapunselect"]),ne.select(["tapselect"])):ne.selected()?ne.unselect(["tapunselect"]):ne.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var Kt=0;Kt<De.length;Kt++)Qe[Kt]=De[Kt];t.dragData.didDrag=!1,G.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),G.touches.length<2&&(G.touches.length===1&&(t.touchData.startGPosition=[G.touches[0].clientX,G.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var je=[],gt=function(G){return{clientX:G.clientX,clientY:G.clientY,force:1,identifier:G.pointerId,pageX:G.pageX,pageY:G.pageY,radiusX:G.width/2,radiusY:G.height/2,screenX:G.screenX,screenY:G.screenY,target:G.target}},ue=function(G){return{event:G,touch:gt(G)}},Se=function(G){je.push(ue(G))},Ie=function(G){for(var ne=0;ne<je.length;ne++){var de=je[ne];if(de.event.pointerId===G.pointerId){je.splice(ne,1);return}}},Ve=function(G){var ne=je.filter(function(de){return de.event.pointerId===G.pointerId})[0];ne.event=G,ne.touch=gt(G)},qe=function(G){G.touches=je.map(function(ne){return ne.touch})},Fe=function(G){return G.pointerType==="mouse"||G.pointerType===4};t.registerBinding(t.container,"pointerdown",function(be){Fe(be)||(be.preventDefault(),Se(be),qe(be),ot(be))}),t.registerBinding(t.container,"pointerup",function(be){Fe(be)||(Ie(be),qe(be),ze(be))}),t.registerBinding(t.container,"pointercancel",function(be){Fe(be)||(Ie(be),qe(be),We(be))}),t.registerBinding(t.container,"pointermove",function(be){Fe(be)||(be.preventDefault(),Ve(be),qe(be),et(be))})}};var Qa={};Qa.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(r,i,l,s,u,f){this.renderer.nodeShapeImpl("polygon",r,i,l,s,u,this.points)},intersectLine:function(r,i,l,s,u,f,c,h){return hu(u,f,this.points,r,i,l/2,s/2,c)},checkPoint:function(r,i,l,s,u,f,c,h){return Za(r,i,this.points,f,c,s,u,[0,-1],l)},hasMiterBounds:t!=="rectangle",miterBounds:function(r,i,l,s,u,f){return f2(this.points,r,i,l,s,u)}}};Qa.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,n,r,i,l,s){this.renderer.nodeShapeImpl(this.name,e,n,r,i,l)},intersectLine:function(e,n,r,i,l,s,u,f){return b2(l,s,e,n,r/2+u,i/2+u)},checkPoint:function(e,n,r,i,l,s,u,f){return xl(e,n,i,l,s,u,r)}}};Qa.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(r,i,l,s,u,f,c){if(f[c]!==void 0&&f[c+"-cx"]===r&&f[c+"-cy"]===i)return f[c];f[c]=new Array(e.length/2),f[c+"-cx"]=r,f[c+"-cy"]=i;var h=l/2,v=s/2;u=u==="auto"?XS(l,s):u;for(var p=new Array(e.length/2),m=0;m<e.length/2;m++)p[m]={x:r+h*e[m*2],y:i+v*e[m*2+1]};var y,S,w,E,C=p.length;for(S=p[C-1],y=0;y<C;y++)w=p[y%C],E=p[(y+1)%C],f[c][y]=Dm(S,w,E,u),S=w,w=E;return f[c]},draw:function(r,i,l,s,u,f,c){this.renderer.nodeShapeImpl("round-polygon",r,i,l,s,u,this.points,this.getOrCreateCorners(i,l,s,u,f,c,"drawCorners"))},intersectLine:function(r,i,l,s,u,f,c,h,v){return x2(u,f,this.points,r,i,l,s,c,this.getOrCreateCorners(r,i,l,s,h,v,"corners"))},checkPoint:function(r,i,l,s,u,f,c,h,v){return y2(r,i,this.points,f,c,s,u,this.getOrCreateCorners(f,c,s,u,h,v,"corners"))}}};Qa.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:pr(4,0),draw:function(e,n,r,i,l,s){this.renderer.nodeShapeImpl(this.name,e,n,r,i,l,this.points,s)},intersectLine:function(e,n,r,i,l,s,u,f){return KS(l,s,e,n,r,i,u,f)},checkPoint:function(e,n,r,i,l,s,u,f){var c=i/2,h=l/2;f=f==="auto"?zi(i,l):f,f=Math.min(c,h,f);var v=f*2;return!!(Za(e,n,this.points,s,u,i,l-v,[0,-1],r)||Za(e,n,this.points,s,u,i-v,l,[0,-1],r)||xl(e,n,v,v,s-c+f,u-h+f,r)||xl(e,n,v,v,s+c-f,u-h+f,r)||xl(e,n,v,v,s+c-f,u+h-f,r)||xl(e,n,v,v,s-c+f,u+h-f,r))}}};Qa.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:gm(),points:pr(4,0),draw:function(e,n,r,i,l,s){this.renderer.nodeShapeImpl(this.name,e,n,r,i,l,null,s)},generateCutTrianglePts:function(e,n,r,i,l){var s=l==="auto"?this.cornerLength:l,u=n/2,f=e/2,c=r-f,h=r+f,v=i-u,p=i+u;return{topLeft:[c,v+s,c+s,v,c+s,v+s],topRight:[h-s,v,h,v+s,h-s,v+s],bottomRight:[h,p-s,h-s,p,h-s,p-s],bottomLeft:[c+s,p,c,p-s,c+s,p-s]}},intersectLine:function(e,n,r,i,l,s,u,f){var c=this.generateCutTrianglePts(r+2*u,i+2*u,e,n,f),h=[].concat.apply([],[c.topLeft.splice(0,4),c.topRight.splice(0,4),c.bottomRight.splice(0,4),c.bottomLeft.splice(0,4)]);return hu(l,s,h,e,n)},checkPoint:function(e,n,r,i,l,s,u,f){var c=f==="auto"?this.cornerLength:f;if(Za(e,n,this.points,s,u,i,l-2*c,[0,-1],r)||Za(e,n,this.points,s,u,i-2*c,l,[0,-1],r))return!0;var h=this.generateCutTrianglePts(i,l,s,u);return Mr(e,n,h.topLeft)||Mr(e,n,h.topRight)||Mr(e,n,h.bottomRight)||Mr(e,n,h.bottomLeft)}}};Qa.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:pr(4,0),draw:function(e,n,r,i,l,s){this.renderer.nodeShapeImpl(this.name,e,n,r,i,l)},intersectLine:function(e,n,r,i,l,s,u,f){var c=.15,h=.5,v=.85,p=this.generateBarrelBezierPts(r+2*u,i+2*u,e,n),m=function(w){var E=Rs({x:w[0],y:w[1]},{x:w[2],y:w[3]},{x:w[4],y:w[5]},c),C=Rs({x:w[0],y:w[1]},{x:w[2],y:w[3]},{x:w[4],y:w[5]},h),T=Rs({x:w[0],y:w[1]},{x:w[2],y:w[3]},{x:w[4],y:w[5]},v);return[w[0],w[1],E.x,E.y,C.x,C.y,T.x,T.y,w[4],w[5]]},y=[].concat(m(p.topLeft),m(p.topRight),m(p.bottomRight),m(p.bottomLeft));return hu(l,s,y,e,n)},generateBarrelBezierPts:function(e,n,r,i){var l=n/2,s=e/2,u=r-s,f=r+s,c=i-l,h=i+l,v=_p(e,n),p=v.heightOffset,m=v.widthOffset,y=v.ctrlPtOffsetPct*e,S={topLeft:[u,c+p,u+y,c,u+m,c],topRight:[f-m,c,f-y,c,f,c+p],bottomRight:[f,h-p,f-y,h,f-m,h],bottomLeft:[u+m,h,u+y,h,u,h-p]};return S.topLeft.isTop=!0,S.topRight.isTop=!0,S.bottomLeft.isBottom=!0,S.bottomRight.isBottom=!0,S},checkPoint:function(e,n,r,i,l,s,u,f){var c=_p(i,l),h=c.heightOffset,v=c.widthOffset;if(Za(e,n,this.points,s,u,i,l-2*h,[0,-1],r)||Za(e,n,this.points,s,u,i-2*v,l,[0,-1],r))return!0;for(var p=this.generateBarrelBezierPts(i,l,s,u),m=function(O,U,M){var I=M[4],P=M[2],j=M[0],K=M[5],$=M[1],B=Math.min(I,j),H=Math.max(I,j),Y=Math.min(K,$),Q=Math.max(K,$);if(B<=O&&O<=H&&Y<=U&&U<=Q){var z=w2(I,P,j),F=v2(z[0],z[1],z[2],O),q=F.filter(function(L){return 0<=L&&L<=1});if(q.length>0)return q[0]}return null},y=Object.keys(p),S=0;S<y.length;S++){var w=y[S],E=p[w],C=m(e,n,E);if(C!=null){var T=E[5],A=E[3],k=E[1],N=Yn(T,A,k,C);if(E.isTop&&N<=n||E.isBottom&&n<=N)return!0}}return!1}}};Qa.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:pr(4,0),draw:function(e,n,r,i,l,s){this.renderer.nodeShapeImpl(this.name,e,n,r,i,l,this.points,s)},intersectLine:function(e,n,r,i,l,s,u,f){var c=e-(r/2+u),h=n-(i/2+u),v=h,p=e+(r/2+u),m=Oi(l,s,e,n,c,h,p,v,!1);return m.length>0?m:KS(l,s,e,n,r,i,u,f)},checkPoint:function(e,n,r,i,l,s,u,f){f=f==="auto"?zi(i,l):f;var c=2*f;if(Za(e,n,this.points,s,u,i,l-c,[0,-1],r)||Za(e,n,this.points,s,u,i-c,l,[0,-1],r))return!0;var h=i/2+2*r,v=l/2+2*r,p=[s-h,u-v,s-h,u,s+h,u,s+h,u-v];return!!(Mr(e,n,p)||xl(e,n,c,c,s+i/2-f,u+l/2-f,r)||xl(e,n,c,c,s-i/2+f,u+l/2-f,r))}}};Qa.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",pr(3,0)),this.generateRoundPolygon("round-triangle",pr(3,0)),this.generatePolygon("rectangle",pr(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n)}this.generatePolygon("pentagon",pr(5,0)),this.generateRoundPolygon("round-pentagon",pr(5,0)),this.generatePolygon("hexagon",pr(6,0)),this.generateRoundPolygon("round-hexagon",pr(6,0)),this.generatePolygon("heptagon",pr(7,0)),this.generateRoundPolygon("round-heptagon",pr(7,0)),this.generatePolygon("octagon",pr(8,0)),this.generateRoundPolygon("round-octagon",pr(8,0));var r=new Array(20);{var i=Ap(5,0),l=Ap(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var u=0;u<l.length/2;u++)l[u*2]*=s,l[u*2+1]*=s;for(var u=0;u<20/4;u++)r[u*4]=i[u*2],r[u*4+1]=i[u*2+1],r[u*4+2]=l[u*2],r[u*4+3]=l[u*2+1]}r=YS(r),this.generatePolygon("star",r),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var f=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",f),this.generateRoundPolygon("round-tag",f)}t.makePolygon=function(c){var h=c.join("$"),v="polygon-"+h,p;return(p=this[v])?p:e.generatePolygon(v,c)}};var Mu={};Mu.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Mu.redraw=function(t){t=t||HS();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t};Mu.beforeRender=function(t,e){if(!this.destroyed){e==null&&gn("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:t,priority:e}),n.sort(function(r,i){return i.priority-r.priority})}};var W1=function(e,n,r){for(var i=e.beforeRenderCallbacks,l=0;l<i.length;l++)i[l].fn(n,r)};Mu.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var n=function(i){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){W1(t,!0,i);var l=Xa();t.render(t.renderOptions);var s=t.lastDrawTime=Xa();t.averageRedrawTime===void 0&&(t.averageRedrawTime=s-l),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var u=s-l;t.redrawTotalTime+=u,t.lastRedrawTime=u,t.averageRedrawTime=t.averageRedrawTime/2+u/2,t.requestedFrame=!1}else W1(t,!1,i);t.skipFrame=!1,Lf(n)}};Lf(n)}};var zO=function(e){this.init(e)},XC=zO,Vs=XC.prototype;Vs.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];Vs.init=function(t){var e=this;e.options=t,e.cy=t.cy;var n=e.container=t.cy.container(),r=e.cy.window();if(r){var i=r.document,l=i.head,s="__________cytoscape_stylesheet",u="__________cytoscape_container",f=i.getElementById(s)!=null;if(n.className.indexOf(u)<0&&(n.className=(n.className||"")+" "+u),!f){var c=i.createElement("style");c.id=s,c.textContent="."+u+" { position: relative; }",l.insertBefore(c,l.children[0])}var h=r.getComputedStyle(n),v=h.getPropertyValue("position");v==="static"&&$t("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.webgl=t.webgl,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=Ge(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};Vs.notify=function(t,e){var n=this,r=n.cy;if(!this.destroyed){if(t==="init"){n.load();return}if(t==="destroy"){n.destroy();return}(t==="add"||t==="remove"||t==="move"&&r.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&n.invalidateCachedZSortedEles(),t==="viewport"&&n.redrawHint("select",!0),t==="gc"&&n.redrawHint("gc",!0),(t==="load"||t==="resize"||t==="mount")&&(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};Vs.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var n=t.bindings[e],r=n,i=r.target;(i.off||i.removeEventListener).apply(i,r.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}};Vs.isHeadless=function(){return!1};[Tm,KC,YC,Gs,Qa,Mu].forEach(function(t){vt(Vs,t)});var Qg=1e3/60,ZC={setupDequeueing:function(e){return function(){var r=this,i=this.renderer;if(!r.dequeueingSetup){r.dequeueingSetup=!0;var l=Au(function(){i.redrawHint("eles",!0),i.redrawHint("drag",!0),i.redraw()},e.deqRedrawThreshold),s=function(c,h){var v=Xa(),p=i.averageRedrawTime,m=i.lastRedrawTime,y=[],S=i.cy.extent(),w=i.getPixelRatio();for(c||i.flushRenderedStyleQueue();;){var E=Xa(),C=E-v,T=E-h;if(m<Qg){var A=Qg-(c?p:0);if(T>=e.deqFastCost*A)break}else if(c){if(C>=e.deqCost*m||C>=e.deqAvgCost*p)break}else if(T>=e.deqNoDrawCost*Qg)break;var k=e.deq(r,w,S);if(k.length>0)for(var N=0;N<k.length;N++)y.push(k[N]);else break}y.length>0&&(e.onDeqd(r,y),!c&&e.shouldRedraw(r,y,w,S)&&l())},u=e.priority||cm;i.beforeRender(s,u(r))}}}},PO=(function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ff;ji(this,t),this.idsByKey=new Ya,this.keyForId=new Ya,this.cachesByLvl=new Ya,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=n}return Hi(t,[{key:"getIdsFor",value:function(n){n==null&&gn("Can not get id list for null key");var r=this.idsByKey,i=this.idsByKey.get(n);return i||(i=new Us,r.set(n,i)),i}},{key:"addIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).add(r)}},{key:"deleteIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).delete(r)}},{key:"getNumberOfIdsForKey",value:function(n){return n==null?0:this.getIdsFor(n).size}},{key:"updateKeyMappingFor",value:function(n){var r=n.id(),i=this.keyForId.get(r),l=this.getKey(n);this.deleteIdForKey(i,r),this.addIdForKey(l,r),this.keyForId.set(r,l)}},{key:"deleteKeyMappingFor",value:function(n){var r=n.id(),i=this.keyForId.get(r);this.deleteIdForKey(i,r),this.keyForId.delete(r)}},{key:"keyHasChangedFor",value:function(n){var r=n.id(),i=this.keyForId.get(r),l=this.getKey(n);return i!==l}},{key:"isInvalid",value:function(n){return this.keyHasChangedFor(n)||this.doesEleInvalidateKey(n)}},{key:"getCachesAt",value:function(n){var r=this.cachesByLvl,i=this.lvls,l=r.get(n);return l||(l=new Ya,r.set(n,l),i.push(n)),l}},{key:"getCache",value:function(n,r){return this.getCachesAt(r).get(n)}},{key:"get",value:function(n,r){var i=this.getKey(n),l=this.getCache(i,r);return l!=null&&this.updateKeyMappingFor(n),l}},{key:"getForCachedKey",value:function(n,r){var i=this.keyForId.get(n.id()),l=this.getCache(i,r);return l}},{key:"hasCache",value:function(n,r){return this.getCachesAt(r).has(n)}},{key:"has",value:function(n,r){var i=this.getKey(n);return this.hasCache(i,r)}},{key:"setCache",value:function(n,r,i){i.key=n,this.getCachesAt(r).set(n,i)}},{key:"set",value:function(n,r,i){var l=this.getKey(n);this.setCache(l,r,i),this.updateKeyMappingFor(n)}},{key:"deleteCache",value:function(n,r){this.getCachesAt(r).delete(n)}},{key:"delete",value:function(n,r){var i=this.getKey(n);this.deleteCache(i,r)}},{key:"invalidateKey",value:function(n){var r=this;this.lvls.forEach(function(i){return r.deleteCache(n,i)})}},{key:"invalidate",value:function(n){var r=n.id(),i=this.keyForId.get(r);this.deleteKeyMappingFor(n);var l=this.doesEleInvalidateKey(n);return l&&this.invalidateKey(i),l||this.getNumberOfIdsForKey(i)===0}}])})(),J1=25,uf=50,kf=-4,qp=3,QC=7.99,UO=8,qO=1024,jO=1024,HO=1024,GO=.2,VO=.8,$O=10,KO=.15,YO=.1,XO=.9,ZO=.9,QO=100,WO=1,ks={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},JO=ir({getKey:null,doesEleInvalidateKey:Ff,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:US,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),nu=function(e,n){var r=this;r.renderer=e,r.onDequeues=[];var i=JO(n);vt(r,i),r.lookup=new PO(i.getKey,i.doesEleInvalidateKey),r.setupDequeueing()},Vn=nu.prototype;Vn.reasons=ks;Vn.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};Vn.getRetiredTextureQueue=function(t){var e=this,n=e.eleImgCaches.retired=e.eleImgCaches.retired||{},r=n[t]=n[t]||[];return r};Vn.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new _u(function(n,r){return r.reqs-n.reqs});return e};Vn.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};Vn.getElement=function(t,e,n,r,i){var l=this,s=this.renderer,u=s.cy.zoom(),f=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!l.allowEdgeTxrCaching&&t.isEdge()||!l.allowParentTxrCaching&&t.isParent())return null;if(r==null&&(r=Math.ceil(dm(u*n))),r<kf)r=kf;else if(u>=QC||r>qp)return null;var c=Math.pow(2,r),h=e.h*c,v=e.w*c,p=s.eleTextBiggerThanMin(t,c);if(!this.isVisible(t,p))return null;var m=f.get(t,r);if(m&&m.invalidated&&(m.invalidated=!1,m.texture.invalidatedWidth-=m.width),m)return m;var y;if(h<=J1?y=J1:h<=uf?y=uf:y=Math.ceil(h/uf)*uf,h>HO||v>jO)return null;var S=l.getTextureQueue(y),w=S[S.length-2],E=function(){return l.recycleTexture(y,v)||l.addTexture(y,v)};w||(w=S[S.length-1]),w||(w=E()),w.width-w.usedWidth<v&&(w=E());for(var C=function(B){return B&&B.scaledLabelShown===p},T=i&&i===ks.dequeue,A=i&&i===ks.highQuality,k=i&&i===ks.downscale,N,_=r+1;_<=qp;_++){var O=f.get(t,_);if(O){N=O;break}}var U=N&&N.level===r+1?N:null,M=function(){w.context.drawImage(U.texture.canvas,U.x,0,U.width,U.height,w.usedWidth,0,v,h)};if(w.context.setTransform(1,0,0,1,0,0),w.context.clearRect(w.usedWidth,0,v,y),C(U))M();else if(C(N))if(A){for(var I=N.level;I>r;I--)U=l.getElement(t,e,n,I,ks.downscale);M()}else return l.queueElement(t,N.level-1),N;else{var P;if(!T&&!A&&!k)for(var j=r-1;j>=kf;j--){var K=f.get(t,j);if(K){P=K;break}}if(C(P))return l.queueElement(t,r),P;w.context.translate(w.usedWidth,0),w.context.scale(c,c),this.drawElement(w.context,t,e,p,!1),w.context.scale(1/c,1/c),w.context.translate(-w.usedWidth,0)}return m={x:w.usedWidth,texture:w,level:r,scale:c,width:v,height:h,scaledLabelShown:p},w.usedWidth+=Math.ceil(v+UO),w.eleCaches.push(m),f.set(t,r,m),l.checkTextureFullness(w),m};Vn.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};Vn.invalidateElement=function(t){var e=this,n=e.lookup,r=[],i=n.isInvalid(t);if(i){for(var l=kf;l<=qp;l++){var s=n.getForCachedKey(t,l);s&&r.push(s)}var u=n.invalidate(t);if(u)for(var f=0;f<r.length;f++){var c=r[f],h=c.texture;h.invalidatedWidth+=c.width,c.invalidated=!0,e.checkTextureUtility(h)}e.removeFromQueue(t)}};Vn.checkTextureUtility=function(t){t.invalidatedWidth>=GO*t.width&&this.retireTexture(t)};Vn.checkTextureFullness=function(t){var e=this,n=e.getTextureQueue(t.height);t.usedWidth/t.width>VO&&t.fullnessChecks>=$O?Ii(n,t):t.fullnessChecks++};Vn.retireTexture=function(t){var e=this,n=t.height,r=e.getTextureQueue(n),i=this.lookup;Ii(r,t),t.retired=!0;for(var l=t.eleCaches,s=0;s<l.length;s++){var u=l[s];i.deleteCache(u.key,u.level)}fm(l);var f=e.getRetiredTextureQueue(n);f.push(t)};Vn.addTexture=function(t,e){var n=this,r=n.getTextureQueue(t),i={};return r.push(i),i.eleCaches=[],i.height=t,i.width=Math.max(qO,e),i.usedWidth=0,i.invalidatedWidth=0,i.fullnessChecks=0,i.canvas=n.renderer.makeOffscreenCanvas(i.width,i.height),i.context=i.canvas.getContext("2d"),i};Vn.recycleTexture=function(t,e){for(var n=this,r=n.getTextureQueue(t),i=n.getRetiredTextureQueue(t),l=0;l<i.length;l++){var s=i[l];if(s.width>=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,fm(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Ii(i,s),r.push(s),s}};Vn.queueElement=function(t,e){var n=this,r=n.getElementQueue(),i=n.getElementKeyToQueue(),l=this.getKey(t),s=i[l];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,r.updateItem(s);else{var u={eles:t.spawn().merge(t),level:e,reqs:1,key:l};r.push(u),i[l]=u}};Vn.dequeue=function(t){for(var e=this,n=e.getElementQueue(),r=e.getElementKeyToQueue(),i=[],l=e.lookup,s=0;s<WO&&n.size()>0;s++){var u=n.pop(),f=u.key,c=u.eles[0],h=l.hasCache(c,u.level);if(r[f]=null,h)continue;i.push(u);var v=e.getBoundingBox(c);e.getElement(c,v,t,u.level,ks.dequeue)}return i};Vn.removeFromQueue=function(t){var e=this,n=e.getElementQueue(),r=e.getElementKeyToQueue(),i=this.getKey(t),l=r[i];l!=null&&(l.eles.length===1?(l.reqs=um,n.updateItem(l),n.pop(),r[i]=null):l.eles.unmerge(t))};Vn.onDequeue=function(t){this.onDequeues.push(t)};Vn.offDequeue=function(t){Ii(this.onDequeues,t)};Vn.setupDequeueing=ZC.setupDequeueing({deqRedrawThreshold:QO,deqCost:KO,deqAvgCost:YO,deqNoDrawCost:XO,deqFastCost:ZO,deq:function(e,n,r){return e.dequeue(n,r)},onDeqd:function(e,n){for(var r=0;r<e.onDequeues.length;r++){var i=e.onDequeues[r];i(n)}},shouldRedraw:function(e,n,r,i){for(var l=0;l<n.length;l++)for(var s=n[l].eles,u=0;u<s.length;u++){var f=s[u].boundingBox();if(vm(f,i))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var eB=1,au=-4,Gf=2,tB=3.99,nB=50,rB=50,aB=.15,iB=.1,lB=.9,sB=.9,oB=1,ew=250,uB=4e3*4e3,tw=32767,cB=!0,WC=function(e){var n=this,r=n.renderer=e,i=r.cy;n.layersByLevel={},n.firstGet=!0,n.lastInvalidationTime=Xa()-2*ew,n.skipping=!1,n.eleTxrDeqs=i.collection(),n.scheduleElementRefinement=Au(function(){n.refineElementTextures(n.eleTxrDeqs),n.eleTxrDeqs.unmerge(n.eleTxrDeqs)},rB),r.beforeRender(function(s,u){u-n.lastInvalidationTime<=ew?n.skipping=!0:n.skipping=!1},r.beforeRenderPriorities.lyrTxrSkip);var l=function(u,f){return f.reqs-u.reqs};n.layersQueue=new _u(l),n.setupDequeueing()},lr=WC.prototype,nw=0,fB=Math.pow(2,53)-1;lr.makeLayer=function(t,e){var n=Math.pow(2,e),r=Math.ceil(t.w*n),i=Math.ceil(t.h*n),l=this.renderer.makeOffscreenCanvas(r,i),s={id:nw=++nw%fB,bb:t,level:e,width:r,height:i,canvas:l,context:l.getContext("2d"),eles:[],elesQueue:[],reqs:0},u=s.context,f=-s.bb.x1,c=-s.bb.y1;return u.scale(n,n),u.translate(f,c),s};lr.getLayers=function(t,e,n){var r=this,i=r.renderer,l=i.cy,s=l.zoom(),u=r.firstGet;if(r.firstGet=!1,n==null){if(n=Math.ceil(dm(s*e)),n<au)n=au;else if(s>=tB||n>Gf)return null}r.validateLayersElesOrdering(n,t);var f=r.layersByLevel,c=Math.pow(2,n),h=f[n]=f[n]||[],v,p=r.levelIsComplete(n,t),m,y=function(){var M=function($){if(r.validateLayersElesOrdering($,t),r.levelIsComplete($,t))return m=f[$],!0},I=function($){if(!m)for(var B=n+$;au<=B&&B<=Gf&&!M(B);B+=$);};I(1),I(-1);for(var P=h.length-1;P>=0;P--){var j=h[P];j.invalid&&Ii(h,j)}};if(!p)y();else return h;var S=function(){if(!v){v=br();for(var M=0;M<t.length;M++)o2(v,t[M].boundingBox())}return v},w=function(M){M=M||{};var I=M.after;S();var P=Math.ceil(v.w*c),j=Math.ceil(v.h*c);if(P>tw||j>tw)return null;var K=P*j;if(K>uB)return null;var $=r.makeLayer(v,n);if(I!=null){var B=h.indexOf(I)+1;h.splice(B,0,$)}else(M.insert===void 0||M.insert)&&h.unshift($);return $};if(r.skipping&&!u)return null;for(var E=null,C=t.length/eB,T=!u,A=0;A<t.length;A++){var k=t[A],N=k._private.rscratch,_=N.imgLayerCaches=N.imgLayerCaches||{},O=_[n];if(O){E=O;continue}if((!E||E.eles.length>=C||!$S(E.bb,k.boundingBox()))&&(E=w({insert:!0,after:E}),!E))return null;m||T?r.queueLayer(E,k):r.drawEleInLayer(E,k,n,e),E.eles.push(k),_[n]=E}return m||(T?null:h)};lr.getEleLevelForLayerLevel=function(t,e){return t};lr.drawEleInLayer=function(t,e,n,r){var i=this,l=this.renderer,s=t.context,u=e.boundingBox();u.w===0||u.h===0||!e.visible()||(n=i.getEleLevelForLayerLevel(n,r),l.setImgSmoothing(s,!1),l.drawCachedElement(s,e,null,null,n,cB),l.setImgSmoothing(s,!0))};lr.levelIsComplete=function(t,e){var n=this,r=n.layersByLevel[t];if(!r||r.length===0)return!1;for(var i=0,l=0;l<r.length;l++){var s=r[l];if(s.reqs>0||s.invalid)return!1;i+=s.eles.length}return i===e.length};lr.validateLayersElesOrdering=function(t,e){var n=this.layersByLevel[t];if(n)for(var r=0;r<n.length;r++){for(var i=n[r],l=-1,s=0;s<e.length;s++)if(i.eles[0]===e[s]){l=s;break}if(l<0){this.invalidateLayer(i);continue}for(var u=l,s=0;s<i.eles.length;s++)if(i.eles[s]!==e[u+s]){this.invalidateLayer(i);break}}};lr.updateElementsInLayers=function(t,e){for(var n=this,r=Su(t[0]),i=0;i<t.length;i++)for(var l=r?null:t[i],s=r?t[i]:t[i].ele,u=s._private.rscratch,f=u.imgLayerCaches=u.imgLayerCaches||{},c=au;c<=Gf;c++){var h=f[c];h&&(l&&n.getEleLevelForLayerLevel(h.level)!==l.level||e(h,s,l))}};lr.haveLayers=function(){for(var t=this,e=!1,n=au;n<=Gf;n++){var r=t.layersByLevel[n];if(r&&r.length>0){e=!0;break}}return e};lr.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Xa(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(r,i,l){e.invalidateLayer(r)}))};lr.invalidateLayer=function(t){if(this.lastInvalidationTime=Xa(),!t.invalid){var e=t.level,n=t.eles,r=this.layersByLevel[e];Ii(r,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i<n.length;i++){var l=n[i]._private.rscratch.imgLayerCaches;l&&(l[e]=null)}}};lr.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(r,i,l){var s=r.replacement;if(s||(s=r.replacement=e.makeLayer(r.bb,r.level),s.replaces=r,s.eles=r.eles),!s.reqs)for(var u=0;u<s.eles.length;u++)e.queueLayer(s,s.eles[u])})};lr.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};lr.queueLayer=function(t,e){var n=this,r=n.layersQueue,i=t.elesQueue,l=i.hasId=i.hasId||{};if(!t.replacement){if(e){if(l[e.id()])return;i.push(e),l[e.id()]=!0}t.reqs?(t.reqs++,r.updateItem(t)):(t.reqs=1,r.push(t))}};lr.dequeue=function(t){for(var e=this,n=e.layersQueue,r=[],i=0;i<oB&&n.size()!==0;){var l=n.peek();if(l.replacement){n.pop();continue}if(l.replaces&&l!==l.replaces.replacement){n.pop();continue}if(l.invalid){n.pop();continue}var s=l.elesQueue.shift();s&&(e.drawEleInLayer(l,s,l.level,t),i++),r.length===0&&r.push(!0),l.elesQueue.length===0&&(n.pop(),l.reqs=0,l.replaces&&e.applyLayerReplacement(l),e.requestRedraw())}return r};lr.applyLayerReplacement=function(t){var e=this,n=e.layersByLevel[t.level],r=t.replaces,i=n.indexOf(r);if(!(i<0||r.invalid)){n[i]=t;for(var l=0;l<t.eles.length;l++){var s=t.eles[l]._private,u=s.imgLayerCaches=s.imgLayerCaches||{};u&&(u[t.level]=t)}e.requestRedraw()}};lr.requestRedraw=Au(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);lr.setupDequeueing=ZC.setupDequeueing({deqRedrawThreshold:nB,deqCost:aB,deqAvgCost:iB,deqNoDrawCost:lB,deqFastCost:sB,deq:function(e,n){return e.dequeue(n)},onDeqd:cm,shouldRedraw:US,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var JC={},rw;function dB(t,e){for(var n=0;n<e.length;n++){var r=e[n];t.lineTo(r.x,r.y)}}function hB(t,e,n){for(var r,i=0;i<e.length;i++){var l=e[i];i===0&&(r=l),t.lineTo(l.x,l.y)}t.quadraticCurveTo(n.x,n.y,r.x,r.y)}function aw(t,e,n){t.beginPath&&t.beginPath();for(var r=e,i=0;i<r.length;i++){var l=r[i];t.lineTo(l.x,l.y)}var s=n,u=n[0];t.moveTo(u.x,u.y);for(var i=1;i<s.length;i++){var l=s[i];t.lineTo(l.x,l.y)}t.closePath&&t.closePath()}function vB(t,e,n,r,i){t.beginPath&&t.beginPath(),t.arc(n,r,i,0,Math.PI*2,!1);var l=e,s=l[0];t.moveTo(s.x,s.y);for(var u=0;u<l.length;u++){var f=l[u];t.lineTo(f.x,f.y)}t.closePath&&t.closePath()}function gB(t,e,n,r){t.arc(e,n,r,0,Math.PI*2,!1)}JC.arrowShapeImpl=function(t){return(rw||(rw={polygon:dB,"triangle-backcurve":hB,"triangle-tee":aw,"circle-triangle":vB,"triangle-cross":aw,circle:gB}))[t]};var Aa={};Aa.drawElement=function(t,e,n,r,i,l){var s=this;e.isNode()?s.drawNode(t,e,n,r,i,l):s.drawEdge(t,e,n,r,i,l)};Aa.drawElementOverlay=function(t,e){var n=this;e.isNode()?n.drawNodeOverlay(t,e):n.drawEdgeOverlay(t,e)};Aa.drawElementUnderlay=function(t,e){var n=this;e.isNode()?n.drawNodeUnderlay(t,e):n.drawEdgeUnderlay(t,e)};Aa.drawCachedElementPortion=function(t,e,n,r,i,l,s,u){var f=this,c=n.getBoundingBox(e);if(!(c.w===0||c.h===0)){var h=n.getElement(e,c,r,i,l);if(h!=null){var v=u(f,e);if(v===0)return;var p=s(f,e),m=c.x1,y=c.y1,S=c.w,w=c.h,E,C,T,A,k;if(p!==0){var N=n.getRotationPoint(e);T=N.x,A=N.y,t.translate(T,A),t.rotate(p),k=f.getImgSmoothing(t),k||f.setImgSmoothing(t,!0);var _=n.getRotationOffset(e);E=_.x,C=_.y}else E=m,C=y;var O;v!==1&&(O=t.globalAlpha,t.globalAlpha=O*v),t.drawImage(h.texture.canvas,h.x,0,h.width,h.height,E,C,S,w),v!==1&&(t.globalAlpha=O),p!==0&&(t.rotate(-p),t.translate(-T,-A),k||f.setImgSmoothing(t,!1))}else n.drawElement(t,e)}};var pB=function(){return 0},mB=function(e,n){return e.getTextAngle(n,null)},yB=function(e,n){return e.getTextAngle(n,"source")},bB=function(e,n){return e.getTextAngle(n,"target")},EB=function(e,n){return n.effectiveOpacity()},Wg=function(e,n){return n.pstyle("text-opacity").pfValue*n.effectiveOpacity()};Aa.drawCachedElement=function(t,e,n,r,i,l){var s=this,u=s.data,f=u.eleTxrCache,c=u.lblTxrCache,h=u.slbTxrCache,v=u.tlbTxrCache,p=e.boundingBox(),m=l===!0?f.reasons.highQuality:null;if(!(p.w===0||p.h===0||!e.visible())&&(!r||vm(p,r))){var y=e.isEdge(),S=e.element()._private.rscratch.badLine;s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,f,n,i,m,pB,EB),(!y||!S)&&s.drawCachedElementPortion(t,e,c,n,i,m,mB,Wg),y&&!S&&(s.drawCachedElementPortion(t,e,h,n,i,m,yB,Wg),s.drawCachedElementPortion(t,e,v,n,i,m,bB,Wg)),s.drawElementOverlay(t,e)}};Aa.drawElements=function(t,e){for(var n=this,r=0;r<e.length;r++){var i=e[r];n.drawElement(t,i)}};Aa.drawCachedElements=function(t,e,n,r){for(var i=this,l=0;l<e.length;l++){var s=e[l];i.drawCachedElement(t,s,n,r)}};Aa.drawCachedNodes=function(t,e,n,r){for(var i=this,l=0;l<e.length;l++){var s=e[l];s.isNode()&&i.drawCachedElement(t,s,n,r)}};Aa.drawLayeredElements=function(t,e,n,r){var i=this,l=i.data.lyrTxrCache.getLayers(e,n);if(l)for(var s=0;s<l.length;s++){var u=l[s],f=u.bb;f.w===0||f.h===0||t.drawImage(u.canvas,f.x1,f.y1,f.w,f.h)}else i.drawCachedElements(t,e,n,r)};var Wa={};Wa.drawEdge=function(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,u=e._private.rscratch;if(!(l&&!e.visible())&&!(u.badLine||u.allpts==null||isNaN(u.allpts[0]))){var f;n&&(f=n,t.translate(-f.x1,-f.y1));var c=l?e.pstyle("opacity").value:1,h=l?e.pstyle("line-opacity").value:1,v=e.pstyle("curve-style").value,p=e.pstyle("line-style").value,m=e.pstyle("width").pfValue,y=e.pstyle("line-cap").value,S=e.pstyle("line-outline-width").value,w=e.pstyle("line-outline-color").value,E=c*h,C=c*h,T=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:E;v==="straight-triangle"?(s.eleStrokeStyle(t,e,$),s.drawEdgeTrianglePath(e,t,u.allpts)):(t.lineWidth=m,t.lineCap=y,s.eleStrokeStyle(t,e,$),s.drawEdgePath(e,t,u.allpts,p),t.lineCap="butt")},A=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:E;if(t.lineWidth=m+S,t.lineCap=y,S>0)s.colorStrokeStyle(t,w[0],w[1],w[2],$);else{t.lineCap="butt";return}v==="straight-triangle"?s.drawEdgeTrianglePath(e,t,u.allpts):(s.drawEdgePath(e,t,u.allpts,p),t.lineCap="butt")},k=function(){i&&s.drawEdgeOverlay(t,e)},N=function(){i&&s.drawEdgeUnderlay(t,e)},_=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:C;s.drawArrowheads(t,e,$)},O=function(){s.drawElementText(t,e,null,r)};t.lineJoin="round";var U=e.pstyle("ghost").value==="yes";if(U){var M=e.pstyle("ghost-offset-x").pfValue,I=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,j=E*P;t.translate(M,I),T(j),_(j),t.translate(-M,-I)}else A();N(),T(),_(),k(),O(),n&&t.translate(f.x1,f.y1)}};var eT=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(n,r){if(r.visible()){var i=r.pstyle("".concat(e,"-opacity")).value;if(i!==0){var l=this,s=l.usePaths(),u=r._private.rscratch,f=r.pstyle("".concat(e,"-padding")).pfValue,c=2*f,h=r.pstyle("".concat(e,"-color")).value;n.lineWidth=c,u.edgeType==="self"&&!s?n.lineCap="butt":n.lineCap="round",l.colorStrokeStyle(n,h[0],h[1],h[2],i),l.drawEdgePath(r,n,u.allpts,"solid")}}}};Wa.drawEdgeOverlay=eT("overlay");Wa.drawEdgeUnderlay=eT("underlay");Wa.drawEdgePath=function(t,e,n,r){var i=t._private.rscratch,l=e,s,u=!1,f=this.usePaths(),c=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(f){var v=n.join("$"),p=i.pathCacheKey&&i.pathCacheKey===v;p?(s=e=i.pathCache,u=!0):(s=e=new Path2D,i.pathCacheKey=v,i.pathCache=s)}if(l.setLineDash)switch(r){case"dotted":l.setLineDash([1,1]);break;case"dashed":l.setLineDash(c),l.lineDashOffset=h;break;case"solid":l.setLineDash([]);break}if(!u&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(n[0],n[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var m=2;m+3<n.length;m+=4)e.quadraticCurveTo(n[m],n[m+1],n[m+2],n[m+3]);break;case"straight":case"haystack":for(var y=2;y+1<n.length;y+=2)e.lineTo(n[y],n[y+1]);break;case"segments":if(i.isRound){var S=Or(i.roundCorners),w;try{for(S.s();!(w=S.n()).done;){var E=w.value;jC(e,E)}}catch(T){S.e(T)}finally{S.f()}e.lineTo(n[n.length-2],n[n.length-1])}else for(var C=2;C+1<n.length;C+=2)e.lineTo(n[C],n[C+1]);break}e=l,f?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])};Wa.drawEdgeTrianglePath=function(t,e,n){e.fillStyle=e.strokeStyle;for(var r=t.pstyle("width").pfValue,i=0;i+1<n.length;i+=2){var l=[n[i+2]-n[i],n[i+3]-n[i+1]],s=Math.sqrt(l[0]*l[0]+l[1]*l[1]),u=[l[1]/s,-l[0]/s],f=[u[0]*r/2,u[1]*r/2];e.beginPath(),e.moveTo(n[i]-f[0],n[i+1]-f[1]),e.lineTo(n[i]+f[0],n[i+1]+f[1]),e.lineTo(n[i+2],n[i+3]),e.closePath(),e.fill()}};Wa.drawArrowheads=function(t,e,n){var r=e._private.rscratch,i=r.edgeType==="haystack";i||this.drawArrowhead(t,e,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(t,e,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(t,e,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),i||this.drawArrowhead(t,e,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)};Wa.drawArrowhead=function(t,e,n,r,i,l,s){if(!(isNaN(r)||r==null||isNaN(i)||i==null||isNaN(l)||l==null)){var u=this,f=e.pstyle(n+"-arrow-shape").value;if(f!=="none"){var c=e.pstyle(n+"-arrow-fill").value==="hollow"?"both":"filled",h=e.pstyle(n+"-arrow-fill").value,v=e.pstyle("width").pfValue,p=e.pstyle(n+"-arrow-width"),m=p.value==="match-line"?v:p.pfValue;p.units==="%"&&(m*=v);var y=e.pstyle("opacity").value;s===void 0&&(s=y);var S=t.globalCompositeOperation;(s!==1||h==="hollow")&&(t.globalCompositeOperation="destination-out",u.colorFillStyle(t,255,255,255,1),u.colorStrokeStyle(t,255,255,255,1),u.drawArrowShape(e,t,c,v,f,m,r,i,l),t.globalCompositeOperation=S);var w=e.pstyle(n+"-arrow-color").value;u.colorFillStyle(t,w[0],w[1],w[2],s),u.colorStrokeStyle(t,w[0],w[1],w[2],s),u.drawArrowShape(e,t,h,v,f,m,r,i,l)}}};Wa.drawArrowShape=function(t,e,n,r,i,l,s,u,f){var c=this,h=this.usePaths()&&i!=="triangle-cross",v=!1,p,m=e,y={x:s,y:u},S=t.pstyle("arrow-scale").value,w=this.getArrowWidth(r,S),E=c.arrowShapes[i];if(h){var C=c.arrowPathCache=c.arrowPathCache||[],T=wl(i),A=C[T];A!=null?(p=e=A,v=!0):(p=e=new Path2D,C[T]=p)}v||(e.beginPath&&e.beginPath(),h?E.draw(e,1,0,{x:0,y:0},1):E.draw(e,w,f,y,r),e.closePath&&e.closePath()),e=m,h&&(e.translate(s,u),e.rotate(f),e.scale(w,w)),(n==="filled"||n==="both")&&(h?e.fill(p):e.fill()),(n==="hollow"||n==="both")&&(e.lineWidth=l/(h?w:1),e.lineJoin="miter",h?e.stroke(p):e.stroke()),h&&(e.scale(1/w,1/w),e.rotate(-f),e.translate(-s,-u))};var _m={};_m.safeDrawImage=function(t,e,n,r,i,l,s,u,f,c){if(!(i<=0||l<=0||f<=0||c<=0))try{t.drawImage(e,n,r,i,l,s,u,f,c)}catch(h){$t(h)}};_m.drawInscribedImage=function(t,e,n,r,i){var l=this,s=n.position(),u=s.x,f=s.y,c=n.cy().style(),h=c.getIndexedStyle.bind(c),v=h(n,"background-fit","value",r),p=h(n,"background-repeat","value",r),m=n.width(),y=n.height(),S=n.padding()*2,w=m+(h(n,"background-width-relative-to","value",r)==="inner"?0:S),E=y+(h(n,"background-height-relative-to","value",r)==="inner"?0:S),C=n._private.rscratch,T=h(n,"background-clip","value",r),A=T==="node",k=h(n,"background-image-opacity","value",r)*i,N=h(n,"background-image-smoothing","value",r),_=n.pstyle("corner-radius").value;_!=="auto"&&(_=n.pstyle("corner-radius").pfValue);var O=e.width||e.cachedW,U=e.height||e.cachedH;(O==null||U==null)&&(document.body.appendChild(e),O=e.cachedW=e.width||e.offsetWidth,U=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var M=O,I=U;if(h(n,"background-width","value",r)!=="auto"&&(h(n,"background-width","units",r)==="%"?M=h(n,"background-width","pfValue",r)*w:M=h(n,"background-width","pfValue",r)),h(n,"background-height","value",r)!=="auto"&&(h(n,"background-height","units",r)==="%"?I=h(n,"background-height","pfValue",r)*E:I=h(n,"background-height","pfValue",r)),!(M===0||I===0)){if(v==="contain"){var P=Math.min(w/M,E/I);M*=P,I*=P}else if(v==="cover"){var P=Math.max(w/M,E/I);M*=P,I*=P}var j=u-w/2,K=h(n,"background-position-x","units",r),$=h(n,"background-position-x","pfValue",r);K==="%"?j+=(w-M)*$:j+=$;var B=h(n,"background-offset-x","units",r),H=h(n,"background-offset-x","pfValue",r);B==="%"?j+=(w-M)*H:j+=H;var Y=f-E/2,Q=h(n,"background-position-y","units",r),z=h(n,"background-position-y","pfValue",r);Q==="%"?Y+=(E-I)*z:Y+=z;var F=h(n,"background-offset-y","units",r),q=h(n,"background-offset-y","pfValue",r);F==="%"?Y+=(E-I)*q:Y+=q,C.pathCache&&(j-=u,Y-=f,u=0,f=0);var L=t.globalAlpha;t.globalAlpha=k;var W=l.getImgSmoothing(t),ae=!1;if(N==="no"&&W?(l.setImgSmoothing(t,!1),ae=!0):N==="yes"&&!W&&(l.setImgSmoothing(t,!0),ae=!0),p==="no-repeat")A&&(t.save(),C.pathCache?t.clip(C.pathCache):(l.nodeShapes[l.getNodeShape(n)].draw(t,u,f,w,E,_,C),t.clip())),l.safeDrawImage(t,e,0,0,O,U,j,Y,M,I),A&&t.restore();else{var se=t.createPattern(e,p);t.fillStyle=se,l.nodeShapes[l.getNodeShape(n)].draw(t,u,f,w,E,_,C),t.translate(j,Y),t.fill(),t.translate(-j,-Y)}t.globalAlpha=L,ae&&l.setImgSmoothing(t,W)}};var kl={};kl.eleTextBiggerThanMin=function(t,e){if(!e){var n=t.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(dm(n*r));e=Math.pow(2,i)}var l=t.pstyle("font-size").pfValue*e,s=t.pstyle("min-zoomed-font-size").pfValue;return!(l<s)};kl.drawElementText=function(t,e,n,r,i){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(r==null){if(l&&!s.eleTextBiggerThanMin(e))return}else if(r===!1)return;if(e.isNode()){var u=e.pstyle("label");if(!u||!u.value)return;var f=s.getLabelJustification(e);t.textAlign=f,t.textBaseline="bottom"}else{var c=e.element()._private.rscratch.badLine,h=e.pstyle("label"),v=e.pstyle("source-label"),p=e.pstyle("target-label");if(c||(!h||!h.value)&&(!v||!v.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var m=!n,y;n&&(y=n,t.translate(-y.x1,-y.y1)),i==null?(s.drawText(t,e,null,m,l),e.isEdge()&&(s.drawText(t,e,"source",m,l),s.drawText(t,e,"target",m,l))):s.drawText(t,e,i,m,l),n&&t.translate(y.x1,y.y1)};kl.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if(e=this.fontCaches[n],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e};kl.setupTextStyle=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",l=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,u=n?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,f=e.pstyle("text-outline-opacity").value*u,c=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=r+" "+s+" "+i+" "+l,t.lineJoin="round",this.colorFillStyle(t,c[0],c[1],c[2],u),this.colorStrokeStyle(t,h[0],h[1],h[2],f)};function xB(t,e,n,r,i){var l=Math.min(r,i),s=l/2,u=e+r/2,f=n+i/2;t.beginPath(),t.arc(u,f,s,0,Math.PI*2),t.closePath()}function iw(t,e,n,r,i){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(l,r/2,i/2);t.beginPath(),t.moveTo(e+s,n),t.lineTo(e+r-s,n),t.quadraticCurveTo(e+r,n,e+r,n+s),t.lineTo(e+r,n+i-s),t.quadraticCurveTo(e+r,n+i,e+r-s,n+i),t.lineTo(e+s,n+i),t.quadraticCurveTo(e,n+i,e,n+i-s),t.lineTo(e,n+s),t.quadraticCurveTo(e,n,e+s,n),t.closePath()}kl.getTextAngle=function(t,e){var n,r=t._private,i=r.rscratch,l=e?e+"-":"",s=t.pstyle(l+"text-rotation");if(s.strValue==="autorotate"){var u=Rr(i,"labelAngle",e);n=t.isEdge()?u:0}else s.strValue==="none"?n=0:n=s.pfValue;return n};kl.drawText=function(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,l=e._private,s=l.rscratch,u=i?e.effectiveOpacity():1;if(!(i&&(u===0||e.pstyle("text-opacity").value===0))){n==="main"&&(n=null);var f=Rr(s,"labelX",n),c=Rr(s,"labelY",n),h,v,p=this.getLabelText(e,n);if(p!=null&&p!==""&&!isNaN(f)&&!isNaN(c)){this.setupTextStyle(t,e,i);var m=n?n+"-":"",y=Rr(s,"labelWidth",n),S=Rr(s,"labelHeight",n),w=e.pstyle(m+"text-margin-x").pfValue,E=e.pstyle(m+"text-margin-y").pfValue,C=e.isEdge(),T=e.pstyle("text-halign").value,A=e.pstyle("text-valign").value;C&&(T="center",A="center"),f+=w,c+=E;var k;switch(r?k=this.getTextAngle(e,n):k=0,k!==0&&(h=f,v=c,t.translate(h,v),t.rotate(k),f=0,c=0),A){case"top":break;case"center":c+=S/2;break;case"bottom":c+=S;break}var N=e.pstyle("text-background-opacity").value,_=e.pstyle("text-border-opacity").value,O=e.pstyle("text-border-width").pfValue,U=e.pstyle("text-background-padding").pfValue,M=e.pstyle("text-background-shape").strValue,I=M==="round-rectangle"||M==="roundrectangle",P=M==="circle",j=2;if(N>0||O>0&&_>0){var K=t.fillStyle,$=t.strokeStyle,B=t.lineWidth,H=e.pstyle("text-background-color").value,Y=e.pstyle("text-border-color").value,Q=e.pstyle("text-border-style").value,z=N>0,F=O>0&&_>0,q=f-U;switch(T){case"left":q-=y;break;case"center":q-=y/2;break}var L=c-S-U,W=y+2*U,ae=S+2*U;if(z&&(t.fillStyle="rgba(".concat(H[0],",").concat(H[1],",").concat(H[2],",").concat(N*u,")")),F&&(t.strokeStyle="rgba(".concat(Y[0],",").concat(Y[1],",").concat(Y[2],",").concat(_*u,")"),t.lineWidth=O,t.setLineDash))switch(Q){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=O/4,t.setLineDash([]);break;default:t.setLineDash([]);break}if(I?(t.beginPath(),iw(t,q,L,W,ae,j)):P?(t.beginPath(),xB(t,q,L,W,ae)):(t.beginPath(),t.rect(q,L,W,ae)),z&&t.fill(),F&&t.stroke(),F&&Q==="double"){var se=O/2;t.beginPath(),I?iw(t,q+se,L+se,W-2*se,ae-2*se,j):t.rect(q+se,L+se,W-2*se,ae-2*se),t.stroke()}t.fillStyle=K,t.strokeStyle=$,t.lineWidth=B,t.setLineDash&&t.setLineDash([])}var me=2*e.pstyle("text-outline-width").pfValue;if(me>0&&(t.lineWidth=me),e.pstyle("text-wrap").value==="wrap"){var Ne=Rr(s,"labelWrapCachedLines",n),pe=Rr(s,"labelLineHeight",n),ee=y/2,le=this.getLabelJustification(e);switch(le==="auto"||(T==="left"?le==="left"?f+=-y:le==="center"&&(f+=-ee):T==="center"?le==="left"?f+=-ee:le==="right"&&(f+=ee):T==="right"&&(le==="center"?f+=ee:le==="right"&&(f+=y))),A){case"top":c-=(Ne.length-1)*pe;break;case"center":case"bottom":c-=(Ne.length-1)*pe;break}for(var fe=0;fe<Ne.length;fe++)me>0&&t.strokeText(Ne[fe],f,c),t.fillText(Ne[fe],f,c),c+=pe}else me>0&&t.strokeText(p,f,c),t.fillText(p,f,c);k!==0&&(t.rotate(-k),t.translate(-h,-v))}}};var Vi={};Vi.drawNode=function(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,u,f,c=e._private,h=c.rscratch,v=e.position();if(!(!Ge(v.x)||!Ge(v.y))&&!(l&&!e.visible())){var p=l?e.effectiveOpacity():1,m=s.usePaths(),y,S=!1,w=e.padding();u=e.width()+2*w,f=e.height()+2*w;var E;n&&(E=n,t.translate(-E.x1,-E.y1));for(var C=e.pstyle("background-image"),T=C.value,A=new Array(T.length),k=new Array(T.length),N=0,_=0;_<T.length;_++){var O=T[_],U=A[_]=O!=null&&O!=="none";if(U){var M=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",_);N++,k[_]=s.getCachedImage(O,M,function(){c.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var I=e.pstyle("background-blacken").value,P=e.pstyle("border-width").pfValue,j=e.pstyle("background-opacity").value*p,K=e.pstyle("border-color").value,$=e.pstyle("border-style").value,B=e.pstyle("border-join").value,H=e.pstyle("border-cap").value,Y=e.pstyle("border-position").value,Q=e.pstyle("border-dash-pattern").pfValue,z=e.pstyle("border-dash-offset").pfValue,F=e.pstyle("border-opacity").value*p,q=e.pstyle("outline-width").pfValue,L=e.pstyle("outline-color").value,W=e.pstyle("outline-style").value,ae=e.pstyle("outline-opacity").value*p,se=e.pstyle("outline-offset").value,me=e.pstyle("corner-radius").value;me!=="auto"&&(me=e.pstyle("corner-radius").pfValue);var Ne=function(){var Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:j;s.eleFillStyle(t,e,Fe)},pe=function(){var Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:F;s.colorStrokeStyle(t,K[0],K[1],K[2],Fe)},ee=function(){var Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ae;s.colorStrokeStyle(t,L[0],L[1],L[2],Fe)},le=function(Fe,be,G,ne){var de=s.nodePathCache=s.nodePathCache||[],oe=PS(G==="polygon"?G+","+ne.join(","):G,""+be,""+Fe,""+me),Ee=de[oe],Pe,De=!1;return Ee!=null?(Pe=Ee,De=!0,h.pathCache=Pe):(Pe=new Path2D,de[oe]=h.pathCache=Pe),{path:Pe,cacheHit:De}},fe=e.pstyle("shape").strValue,xe=e.pstyle("shape-polygon-points").pfValue;if(m){t.translate(v.x,v.y);var Re=le(u,f,fe,xe);y=Re.path,S=Re.cacheHit}var Xe=function(){if(!S){var Fe=v;m&&(Fe={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(y||t,Fe.x,Fe.y,u,f,me,h)}m?t.fill(y):t.fill()},Ke=function(){for(var Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,G=c.backgrounding,ne=0,de=0;de<k.length;de++){var oe=e.cy().style().getIndexedStyle(e,"background-image-containment","value",de);if(be&&oe==="over"||!be&&oe==="inside"){ne++;continue}A[de]&&k[de].complete&&!k[de].error&&(ne++,s.drawInscribedImage(t,k[de],e,de,Fe))}c.backgrounding=ne!==N,G!==c.backgrounding&&e.updateStyle(!1)},ot=function(){var Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p;s.hasPie(e)&&(s.drawPie(t,e,be),Fe&&(m||s.nodeShapes[s.getNodeShape(e)].draw(t,v.x,v.y,u,f,me,h)))},et=function(){var Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p;s.hasStripe(e)&&(t.save(),m?t.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,v.x,v.y,u,f,me,h),t.clip()),s.drawStripe(t,e,be),t.restore(),Fe&&(m||s.nodeShapes[s.getNodeShape(e)].draw(t,v.x,v.y,u,f,me,h)))},We=function(){var Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,be=(I>0?I:-I)*Fe,G=I>0?0:255;I!==0&&(s.colorFillStyle(t,G,G,G,be),m?t.fill(y):t.fill())},ze=function(){if(P>0){if(t.lineWidth=P,t.lineCap=H,t.lineJoin=B,t.setLineDash)switch($){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(Q),t.lineDashOffset=z;break;case"solid":case"double":t.setLineDash([]);break}if(Y!=="center"){if(t.save(),t.lineWidth*=2,Y==="inside")m?t.clip(y):t.clip();else{var Fe=new Path2D;Fe.rect(-u/2-P,-f/2-P,u+2*P,f+2*P),Fe.addPath(y),t.clip(Fe,"evenodd")}m?t.stroke(y):t.stroke(),t.restore()}else m?t.stroke(y):t.stroke();if($==="double"){t.lineWidth=P/3;var be=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",m?t.stroke(y):t.stroke(),t.globalCompositeOperation=be}t.setLineDash&&t.setLineDash([])}},Je=function(){if(q>0){if(t.lineWidth=q,t.lineCap="butt",t.setLineDash)switch(W){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var Fe=v;m&&(Fe={x:0,y:0});var be=s.getNodeShape(e),G=P;Y==="inside"&&(G=0),Y==="outside"&&(G*=2);var ne=(u+G+(q+se))/u,de=(f+G+(q+se))/f,oe=u*ne,Ee=f*de,Pe=s.nodeShapes[be].points,De;if(m){var Qe=le(oe,Ee,be,Pe);De=Qe.path}if(be==="ellipse")s.drawEllipsePath(De||t,Fe.x,Fe.y,oe,Ee);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(be)){var $e=0,rt=0,it=0;be==="round-diamond"?$e=(G+se+q)*1.4:be==="round-heptagon"?($e=(G+se+q)*1.075,it=-(G/2+se+q)/35):be==="round-hexagon"?$e=(G+se+q)*1.12:be==="round-pentagon"?($e=(G+se+q)*1.13,it=-(G/2+se+q)/15):be==="round-tag"?($e=(G+se+q)*1.12,rt=(G/2+q+se)*.07):be==="round-triangle"&&($e=(G+se+q)*(Math.PI/2),it=-(G+se/2+q)/Math.PI),$e!==0&&(ne=(u+$e)/u,oe=u*ne,["round-hexagon","round-tag"].includes(be)||(de=(f+$e)/f,Ee=f*de)),me=me==="auto"?XS(oe,Ee):me;for(var X=oe/2,re=Ee/2,Ce=me+(G+q+se)/2,Oe=new Array(Pe.length/2),yt=new Array(Pe.length/2),dt=0;dt<Pe.length/2;dt++)Oe[dt]={x:Fe.x+rt+X*Pe[dt*2],y:Fe.y+it+re*Pe[dt*2+1]};var He,Be,Ze,Et,xt=Oe.length;for(Be=Oe[xt-1],He=0;He<xt;He++)Ze=Oe[He%xt],Et=Oe[(He+1)%xt],yt[He]=Dm(Be,Ze,Et,Ce),Be=Ze,Ze=Et;s.drawRoundPolygonPath(De||t,Fe.x+rt,Fe.y+it,u*ne,f*de,Pe,yt)}else if(["roundrectangle","round-rectangle"].includes(be))me=me==="auto"?zi(oe,Ee):me,s.drawRoundRectanglePath(De||t,Fe.x,Fe.y,oe,Ee,me+(G+q+se)/2);else if(["cutrectangle","cut-rectangle"].includes(be))me=me==="auto"?gm():me,s.drawCutRectanglePath(De||t,Fe.x,Fe.y,oe,Ee,null,me+(G+q+se)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(be))me=me==="auto"?zi(oe,Ee):me,s.drawBottomRoundRectanglePath(De||t,Fe.x,Fe.y,oe,Ee,me+(G+q+se)/2);else if(be==="barrel")s.drawBarrelPath(De||t,Fe.x,Fe.y,oe,Ee);else if(be.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(be)){var Rn=(G+q+se)/u;Pe=If(zf(Pe,Rn)),s.drawPolygonPath(De||t,Fe.x,Fe.y,u,f,Pe)}else{var Kt=(G+q+se)/u;Pe=If(zf(Pe,-Kt)),s.drawPolygonPath(De||t,Fe.x,Fe.y,u,f,Pe)}if(m?t.stroke(De):t.stroke(),W==="double"){t.lineWidth=G/3;var pn=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",m?t.stroke(De):t.stroke(),t.globalCompositeOperation=pn}t.setLineDash&&t.setLineDash([])}},Ye=function(){i&&s.drawNodeOverlay(t,e,v,u,f)},ut=function(){i&&s.drawNodeUnderlay(t,e,v,u,f)},je=function(){s.drawElementText(t,e,null,r)},gt=e.pstyle("ghost").value==="yes";if(gt){var ue=e.pstyle("ghost-offset-x").pfValue,Se=e.pstyle("ghost-offset-y").pfValue,Ie=e.pstyle("ghost-opacity").value,Ve=Ie*p;t.translate(ue,Se),ee(),Je(),Ne(Ie*j),Xe(),Ke(Ve,!0),pe(Ie*F),ze(),ot(I!==0||P!==0),et(I!==0||P!==0),Ke(Ve,!1),We(Ve),t.translate(-ue,-Se)}m&&t.translate(-v.x,-v.y),ut(),m&&t.translate(v.x,v.y),ee(),Je(),Ne(),Xe(),Ke(p,!0),pe(),ze(),ot(I!==0||P!==0),et(I!==0||P!==0),Ke(p,!1),We(),m&&t.translate(-v.x,-v.y),je(),Ye(),n&&t.translate(E.x1,E.y1)}};var tT=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(n,r,i,l,s){var u=this;if(r.visible()){var f=r.pstyle("".concat(e,"-padding")).pfValue,c=r.pstyle("".concat(e,"-opacity")).value,h=r.pstyle("".concat(e,"-color")).value,v=r.pstyle("".concat(e,"-shape")).value,p=r.pstyle("".concat(e,"-corner-radius")).value;if(c>0){if(i=i||r.position(),l==null||s==null){var m=r.padding();l=r.width()+2*m,s=r.height()+2*m}u.colorFillStyle(n,h[0],h[1],h[2],c),u.nodeShapes[v].draw(n,i.x,i.y,l+f*2,s+f*2,p),n.fill()}}}};Vi.drawNodeOverlay=tT("overlay");Vi.drawNodeUnderlay=tT("underlay");Vi.hasPie=function(t){return t=t[0],t._private.hasPie};Vi.hasStripe=function(t){return t=t[0],t._private.hasStripe};Vi.drawPie=function(t,e,n,r){e=e[0],r=r||e.position();var i=e.cy().style(),l=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),u=e.pstyle("pie-start-angle").pfValue,f=r.x,c=r.y,h=e.width(),v=e.height(),p=Math.min(h,v)/2,m,y=0,S=this.usePaths();if(S&&(f=0,c=0),l.units==="%"?p=p*l.pfValue:l.pfValue!==void 0&&(p=l.pfValue/2),s.units==="%"?m=p*s.pfValue:s.pfValue!==void 0&&(m=s.pfValue/2),!(m>=p))for(var w=1;w<=i.pieBackgroundN;w++){var E=e.pstyle("pie-"+w+"-background-size").value,C=e.pstyle("pie-"+w+"-background-color").value,T=e.pstyle("pie-"+w+"-background-opacity").value*n,A=E/100;A+y>1&&(A=1-y);var k=1.5*Math.PI+2*Math.PI*y;k+=u;var N=2*Math.PI*A,_=k+N;E===0||y>=1||y+A>1||(m===0?(t.beginPath(),t.moveTo(f,c),t.arc(f,c,p,k,_),t.closePath()):(t.beginPath(),t.arc(f,c,p,k,_),t.arc(f,c,m,_,k,!0),t.closePath()),this.colorFillStyle(t,C[0],C[1],C[2],T),t.fill(),y+=A)}};Vi.drawStripe=function(t,e,n,r){e=e[0],r=r||e.position();var i=e.cy().style(),l=r.x,s=r.y,u=e.width(),f=e.height(),c=0,h=this.usePaths();t.save();var v=e.pstyle("stripe-direction").value,p=e.pstyle("stripe-size");switch(v){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var m=u,y=f;p.units==="%"?(m=m*p.pfValue,y=y*p.pfValue):p.pfValue!==void 0&&(m=p.pfValue,y=p.pfValue),h&&(l=0,s=0),s-=m/2,l-=y/2;for(var S=1;S<=i.stripeBackgroundN;S++){var w=e.pstyle("stripe-"+S+"-background-size").value,E=e.pstyle("stripe-"+S+"-background-color").value,C=e.pstyle("stripe-"+S+"-background-opacity").value*n,T=w/100;T+c>1&&(T=1-c),!(w===0||c>=1||c+T>1)&&(t.beginPath(),t.rect(l,s+y*c,m,y*T),t.closePath(),this.colorFillStyle(t,E[0],E[1],E[2],C),t.fill(),c+=T)}t.restore()};var xr={},wB=100;xr.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),n=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/n};xr.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],n=!0,r,i=0;i<e.length;i++)if(r=e[i],r.context===t){n=!1;break}return n&&(r={context:t},e.push(r)),r};xr.createGradientStyleFor=function(t,e,n,r,i){var l,s=this.usePaths(),u=n.pstyle(e+"-gradient-stop-colors").value,f=n.pstyle(e+"-gradient-stop-positions").pfValue;if(r==="radial-gradient")if(n.isEdge()){var c=n.sourceEndpoint(),h=n.targetEndpoint(),v=n.midpoint(),p=Sl(c,v),m=Sl(h,v);l=t.createRadialGradient(v.x,v.y,0,v.x,v.y,Math.max(p,m))}else{var y=s?{x:0,y:0}:n.position(),S=n.paddedWidth(),w=n.paddedHeight();l=t.createRadialGradient(y.x,y.y,0,y.x,y.y,Math.max(S,w))}else if(n.isEdge()){var E=n.sourceEndpoint(),C=n.targetEndpoint();l=t.createLinearGradient(E.x,E.y,C.x,C.y)}else{var T=s?{x:0,y:0}:n.position(),A=n.paddedWidth(),k=n.paddedHeight(),N=A/2,_=k/2,O=n.pstyle("background-gradient-direction").value;switch(O){case"to-bottom":l=t.createLinearGradient(T.x,T.y-_,T.x,T.y+_);break;case"to-top":l=t.createLinearGradient(T.x,T.y+_,T.x,T.y-_);break;case"to-left":l=t.createLinearGradient(T.x+N,T.y,T.x-N,T.y);break;case"to-right":l=t.createLinearGradient(T.x-N,T.y,T.x+N,T.y);break;case"to-bottom-right":case"to-right-bottom":l=t.createLinearGradient(T.x-N,T.y-_,T.x+N,T.y+_);break;case"to-top-right":case"to-right-top":l=t.createLinearGradient(T.x-N,T.y+_,T.x+N,T.y-_);break;case"to-bottom-left":case"to-left-bottom":l=t.createLinearGradient(T.x+N,T.y-_,T.x-N,T.y+_);break;case"to-top-left":case"to-left-top":l=t.createLinearGradient(T.x+N,T.y+_,T.x-N,T.y-_);break}}if(!l)return null;for(var U=f.length===u.length,M=u.length,I=0;I<M;I++)l.addColorStop(U?f[I]:I/(M-1),"rgba("+u[I][0]+","+u[I][1]+","+u[I][2]+","+i+")");return l};xr.gradientFillStyle=function(t,e,n,r){var i=this.createGradientStyleFor(t,"background",e,n,r);if(!i)return null;t.fillStyle=i};xr.colorFillStyle=function(t,e,n,r,i){t.fillStyle="rgba("+e+","+n+","+r+","+i+")"};xr.eleFillStyle=function(t,e,n){var r=e.pstyle("background-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientFillStyle(t,e,r,n);else{var i=e.pstyle("background-color").value;this.colorFillStyle(t,i[0],i[1],i[2],n)}};xr.gradientStrokeStyle=function(t,e,n,r){var i=this.createGradientStyleFor(t,"line",e,n,r);if(!i)return null;t.strokeStyle=i};xr.colorStrokeStyle=function(t,e,n,r,i){t.strokeStyle="rgba("+e+","+n+","+r+","+i+")"};xr.eleStrokeStyle=function(t,e,n){var r=e.pstyle("line-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientStrokeStyle(t,e,r,n);else{var i=e.pstyle("line-color").value;this.colorStrokeStyle(t,i[0],i[1],i[2],n)}};xr.matchCanvasSize=function(t){var e=this,n=e.data,r=e.findContainerClientCoords(),i=r[2],l=r[3],s=e.getPixelRatio(),u=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(s=u);var f=i*s,c=l*s,h;if(!(f===e.canvasWidth&&c===e.canvasHeight)){e.fontCaches=null;var v=n.canvasContainer;v.style.width=i+"px",v.style.height=l+"px";for(var p=0;p<e.CANVAS_LAYERS;p++)h=n.canvases[p],h.width=f,h.height=c,h.style.width=i+"px",h.style.height=l+"px";for(var p=0;p<e.BUFFER_COUNT;p++)h=n.bufferCanvases[p],h.width=f,h.height=c,h.style.width=i+"px",h.style.height=l+"px";e.textureMult=1,s<=1&&(h=n.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,h.width=f*e.textureMult,h.height=c*e.textureMult),e.canvasWidth=f,e.canvasHeight=c,e.pixelRatio=s}};xr.renderTo=function(t,e,n,r){this.render({forcedContext:t,forcedZoom:e,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})};xr.clearCanvas=function(){var t=this,e=t.data;function n(r){r.clearRect(0,0,t.canvasWidth,t.canvasHeight)}n(e.contexts[t.NODE]),n(e.contexts[t.DRAG])};xr.render=function(t){var e=this;t=t||HS();var n=e.cy,r=t.forcedContext,i=t.drawAllLayers,l=t.drawOnlyNodeLayer,s=t.forcedZoom,u=t.forcedPan,f=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,c=e.data,h=c.canvasNeedsRedraw,v=e.textureOnViewport&&!r&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),p=t.motionBlur!==void 0?t.motionBlur:e.motionBlur,m=e.motionBlurPxRatio,y=n.hasCompoundNodes(),S=e.hoverData.draggingEles,w=!!(e.hoverData.selecting||e.touchData.selecting);p=p&&!r&&e.motionBlurEnabled&&!w;var E=p;r||(e.prevPxRatio!==f&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=f),!r&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),p&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(E=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!v&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var C=n.style(),T=n.zoom(),A=s!==void 0?s:T,k=n.pan(),N={x:k.x,y:k.y},_={zoom:T,pan:{x:k.x,y:k.y}},O=e.prevViewport,U=O===void 0||_.zoom!==O.zoom||_.pan.x!==O.pan.x||_.pan.y!==O.pan.y;!U&&!(S&&!y)&&(e.motionBlurPxRatio=1),u&&(N=u),A*=f,N.x*=f,N.y*=f;var M=e.getCachedZSortedEles();function I(pe,ee,le,fe,xe){var Re=pe.globalCompositeOperation;pe.globalCompositeOperation="destination-out",e.colorFillStyle(pe,255,255,255,e.motionBlurTransparency),pe.fillRect(ee,le,fe,xe),pe.globalCompositeOperation=Re}function P(pe,ee){var le,fe,xe,Re;!e.clearingMotionBlur&&(pe===c.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||pe===c.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(le={x:k.x*m,y:k.y*m},fe=T*m,xe=e.canvasWidth*m,Re=e.canvasHeight*m):(le=N,fe=A,xe=e.canvasWidth,Re=e.canvasHeight),pe.setTransform(1,0,0,1,0,0),ee==="motionBlur"?I(pe,0,0,xe,Re):!r&&(ee===void 0||ee)&&pe.clearRect(0,0,xe,Re),i||(pe.translate(le.x,le.y),pe.scale(fe,fe)),u&&pe.translate(u.x,u.y),s&&pe.scale(s,s)}if(v||(e.textureDrawLastFrame=!1),v){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=n.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var j=e.data.bufferContexts[e.TEXTURE_BUFFER];j.setTransform(1,0,0,1,0,0),j.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:j,drawOnlyNodeLayer:!0,forcedPxRatio:f*e.textureMult});var _=e.textureCache.viewport={zoom:n.zoom(),pan:n.pan(),width:e.canvasWidth,height:e.canvasHeight};_.mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var K=c.contexts[e.NODE],$=e.textureCache.texture,_=e.textureCache.viewport;K.setTransform(1,0,0,1,0,0),p?I(K,0,0,_.width,_.height):K.clearRect(0,0,_.width,_.height);var B=C.core("outside-texture-bg-color").value,H=C.core("outside-texture-bg-opacity").value;e.colorFillStyle(K,B[0],B[1],B[2],H),K.fillRect(0,0,_.width,_.height);var T=n.zoom();P(K,!1),K.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/f,_.height/_.zoom/f),K.drawImage($,_.mpan.x,_.mpan.y,_.width/_.zoom/f,_.height/_.zoom/f)}else e.textureOnViewport&&!r&&(e.textureCache=null);var Y=n.extent(),Q=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),z=e.hideEdgesOnViewport&&Q,F=[];if(F[e.NODE]=!h[e.NODE]&&p&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,F[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),F[e.DRAG]=!h[e.DRAG]&&p&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,F[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||l||F[e.NODE]){var q=p&&!F[e.NODE]&&m!==1,K=r||(q?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:c.contexts[e.NODE]),L=p&&!q?"motionBlur":void 0;P(K,L),z?e.drawCachedNodes(K,M.nondrag,f,Y):e.drawLayeredElements(K,M.nondrag,f,Y),e.debug&&e.drawDebugPoints(K,M.nondrag),!i&&!p&&(h[e.NODE]=!1)}if(!l&&(h[e.DRAG]||i||F[e.DRAG])){var q=p&&!F[e.DRAG]&&m!==1,K=r||(q?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:c.contexts[e.DRAG]);P(K,p&&!q?"motionBlur":void 0),z?e.drawCachedNodes(K,M.drag,f,Y):e.drawCachedElements(K,M.drag,f,Y),e.debug&&e.drawDebugPoints(K,M.drag),!i&&!p&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,P),p&&m!==1){var W=c.contexts[e.NODE],ae=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],se=c.contexts[e.DRAG],me=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],Ne=function(ee,le,fe){ee.setTransform(1,0,0,1,0,0),fe||!E?ee.clearRect(0,0,e.canvasWidth,e.canvasHeight):I(ee,0,0,e.canvasWidth,e.canvasHeight);var xe=m;ee.drawImage(le,0,0,e.canvasWidth*xe,e.canvasHeight*xe,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||F[e.NODE])&&(Ne(W,ae,F[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||F[e.DRAG])&&(Ne(se,me,F[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=_,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),p&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!v,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},wB)),r||n.emit("render")};var Vo;xr.drawSelectionRectangle=function(t,e){var n=this,r=n.cy,i=n.data,l=r.style(),s=t.drawOnlyNodeLayer,u=t.drawAllLayers,f=i.canvasNeedsRedraw,c=t.forcedContext;if(n.showFps||!s&&f[n.SELECT_BOX]&&!u){var h=c||i.contexts[n.SELECT_BOX];if(e(h),n.selection[4]==1&&(n.hoverData.selecting||n.touchData.selecting)){var v=n.cy.zoom(),p=l.core("selection-box-border-width").value/v;h.lineWidth=p,h.fillStyle="rgba("+l.core("selection-box-color").value[0]+","+l.core("selection-box-color").value[1]+","+l.core("selection-box-color").value[2]+","+l.core("selection-box-opacity").value+")",h.fillRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]),p>0&&(h.strokeStyle="rgba("+l.core("selection-box-border-color").value[0]+","+l.core("selection-box-border-color").value[1]+","+l.core("selection-box-border-color").value[2]+","+l.core("selection-box-opacity").value+")",h.strokeRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]))}if(i.bgActivePosistion&&!n.hoverData.selecting){var v=n.cy.zoom(),m=i.bgActivePosistion;h.fillStyle="rgba("+l.core("active-bg-color").value[0]+","+l.core("active-bg-color").value[1]+","+l.core("active-bg-color").value[2]+","+l.core("active-bg-opacity").value+")",h.beginPath(),h.arc(m.x,m.y,l.core("active-bg-size").pfValue/v,0,2*Math.PI),h.fill()}var y=n.lastRedrawTime;if(n.showFps&&y){y=Math.round(y);var S=Math.round(1e3/y),w="1 frame = "+y+" ms = "+S+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!Vo){var E=h.measureText(w);Vo=E.actualBoundingBoxAscent}h.fillText(w,0,Vo);var C=60;h.strokeRect(0,Vo+10,250,20),h.fillRect(0,Vo+10,250*Math.min(S/C,1),20)}u||(f[n.SELECT_BOX]=!1)}};function lw(t,e,n){var r=t.createShader(e);if(t.shaderSource(r,n),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(r));return r}function SB(t,e,n){var r=lw(t,t.VERTEX_SHADER,e),i=lw(t,t.FRAGMENT_SHADER,n),l=t.createProgram();if(t.attachShader(l,r),t.attachShader(l,i),t.linkProgram(l),!t.getProgramParameter(l,t.LINK_STATUS))throw new Error("Could not initialize shaders");return l}function CB(t,e,n){n===void 0&&(n=e);var r=t.makeOffscreenCanvas(e,n),i=r.context=r.getContext("2d");return r.clear=function(){return i.clearRect(0,0,r.width,r.height)},r.clear(),r}function Nm(t){var e=t.pixelRatio,n=t.cy.zoom(),r=t.cy.pan();return{zoom:n*e,pan:{x:r.x*e,y:r.y*e}}}function TB(t){var e=t.pixelRatio,n=t.cy.zoom();return n*e}function DB(t,e,n,r,i){var l=r*n+e.x,s=i*n+e.y;return s=Math.round(t.canvasHeight-s),[l,s]}function AB(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function _B(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function gl(t,e,n){var r=t[0]/255,i=t[1]/255,l=t[2]/255,s=e,u=n||new Array(4);return u[0]=r*s,u[1]=i*s,u[2]=l*s,u[3]=s,u}function ys(t,e){var n=e||new Array(4);return n[0]=(t>>0&255)/255,n[1]=(t>>8&255)/255,n[2]=(t>>16&255)/255,n[3]=(t>>24&255)/255,n}function NB(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function kB(t,e){var n=t.createTexture();return n.buffer=function(r){t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},n.deleteTexture=function(){t.deleteTexture(n)},n}function nT(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function rT(t,e,n){switch(e){case t.FLOAT:return new Float32Array(n);case t.INT:return new Int32Array(n)}}function RB(t,e,n,r,i,l){switch(e){case t.FLOAT:return new Float32Array(n.buffer,l*r,i);case t.INT:return new Int32Array(n.buffer,l*r,i)}}function MB(t,e,n,r){var i=nT(t,e),l=Pn(i,2),s=l[0],u=l[1],f=rT(t,u,r),c=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,c),t.bufferData(t.ARRAY_BUFFER,f,t.STATIC_DRAW),u===t.FLOAT?t.vertexAttribPointer(n,s,u,!1,0,0):u===t.INT&&t.vertexAttribIPointer(n,s,u,0,0),t.enableVertexAttribArray(n),t.bindBuffer(t.ARRAY_BUFFER,null),c}function Ea(t,e,n,r){var i=nT(t,n),l=Pn(i,3),s=l[0],u=l[1],f=l[2],c=rT(t,u,e*s),h=s*f,v=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,v),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(r),u===t.FLOAT?t.vertexAttribPointer(r,s,u,!1,h,0):u===t.INT&&t.vertexAttribIPointer(r,s,u,h,0),t.vertexAttribDivisor(r,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var p=new Array(e),m=0;m<e;m++)p[m]=RB(t,u,c,h,s,m);return v.dataArray=c,v.stride=h,v.size=s,v.getView=function(y){return p[y]},v.setPoint=function(y,S,w){var E=p[y];E[0]=S,E[1]=w},v.bufferSubData=function(y){t.bindBuffer(t.ARRAY_BUFFER,v),y?t.bufferSubData(t.ARRAY_BUFFER,0,c,0,y*s):t.bufferSubData(t.ARRAY_BUFFER,0,c)},v}function OB(t,e,n){for(var r=9,i=new Float32Array(e*r),l=new Array(e),s=0;s<e;s++){var u=s*r*4;l[s]=new Float32Array(i.buffer,u,r)}var f=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,f),t.bufferData(t.ARRAY_BUFFER,i.byteLength,t.DYNAMIC_DRAW);for(var c=0;c<3;c++){var h=n+c;t.enableVertexAttribArray(h),t.vertexAttribPointer(h,3,t.FLOAT,!1,36,c*12),t.vertexAttribDivisor(h,1)}return t.bindBuffer(t.ARRAY_BUFFER,null),f.getMatrixView=function(v){return l[v]},f.setData=function(v,p){l[p].set(v,0)},f.bufferSubData=function(){t.bindBuffer(t.ARRAY_BUFFER,f),t.bufferSubData(t.ARRAY_BUFFER,0,i)},f}function BB(t){var e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var n=t.createTexture();return t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0),t.bindFramebuffer(t.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(r,i){t.bindTexture(t.TEXTURE_2D,n),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,r,i,0,t.RGBA,t.UNSIGNED_BYTE,null)},e}var sw=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function Jg(){var t=new sw(9);return sw!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function ow(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function LB(t,e,n){var r=e[0],i=e[1],l=e[2],s=e[3],u=e[4],f=e[5],c=e[6],h=e[7],v=e[8],p=n[0],m=n[1],y=n[2],S=n[3],w=n[4],E=n[5],C=n[6],T=n[7],A=n[8];return t[0]=p*r+m*s+y*c,t[1]=p*i+m*u+y*h,t[2]=p*l+m*f+y*v,t[3]=S*r+w*s+E*c,t[4]=S*i+w*u+E*h,t[5]=S*l+w*f+E*v,t[6]=C*r+T*s+A*c,t[7]=C*i+T*u+A*h,t[8]=C*l+T*f+A*v,t}function Rf(t,e,n){var r=e[0],i=e[1],l=e[2],s=e[3],u=e[4],f=e[5],c=e[6],h=e[7],v=e[8],p=n[0],m=n[1];return t[0]=r,t[1]=i,t[2]=l,t[3]=s,t[4]=u,t[5]=f,t[6]=p*r+m*s+c,t[7]=p*i+m*u+h,t[8]=p*l+m*f+v,t}function uw(t,e,n){var r=e[0],i=e[1],l=e[2],s=e[3],u=e[4],f=e[5],c=e[6],h=e[7],v=e[8],p=Math.sin(n),m=Math.cos(n);return t[0]=m*r+p*s,t[1]=m*i+p*u,t[2]=m*l+p*f,t[3]=m*s-p*r,t[4]=m*u-p*i,t[5]=m*f-p*l,t[6]=c,t[7]=h,t[8]=v,t}function jp(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function FB(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}var IB=(function(){function t(e,n,r,i){ji(this,t),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=n,this.texRows=r,this.texHeight=Math.floor(n/r),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=i(e,n,n),this.scratch=i(e,n,this.texHeight,"scratch")}return Hi(t,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(n){var r=n.w,i=n.h,l=this.texHeight,s=this.texSize,u=l/i,f=r*u,c=i*u;return f>s&&(u=s/r,f=r*u,c=i*u),{scale:u,texW:f,texH:c}}},{key:"draw",value:function(n,r,i){var l=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,u=this.texRows,f=this.texHeight,c=this.getScale(r),h=c.scale,v=c.texW,p=c.texH,m=function(T,A){if(i&&A){var k=A.context,N=T.x,_=T.row,O=N,U=f*_;k.save(),k.translate(O,U),k.scale(h,h),i(k,r),k.restore()}},y=[null,null],S=function(){m(l.freePointer,l.canvas),y[0]={x:l.freePointer.x,y:l.freePointer.row*f,w:v,h:p},y[1]={x:l.freePointer.x+v,y:l.freePointer.row*f,w:0,h:p},l.freePointer.x+=v,l.freePointer.x==s&&(l.freePointer.x=0,l.freePointer.row++)},w=function(){var T=l.scratch,A=l.canvas;T.clear(),m({x:0,row:0},T);var k=s-l.freePointer.x,N=v-k,_=f;{var O=l.freePointer.x,U=l.freePointer.row*f,M=k;A.context.drawImage(T,0,0,M,_,O,U,M,_),y[0]={x:O,y:U,w:M,h:p}}{var I=k,P=(l.freePointer.row+1)*f,j=N;A&&A.context.drawImage(T,I,0,j,_,0,P,j,_),y[1]={x:0,y:P,w:j,h:p}}l.freePointer.x=N,l.freePointer.row++},E=function(){l.freePointer.x=0,l.freePointer.row++};if(this.freePointer.x+v<=s)S();else{if(this.freePointer.row>=u-1)return!1;this.freePointer.x===s?(E(),S()):this.enableWrapping?w():(E(),S())}return this.keyToLocation.set(n,y),this.needsBuffer=!0,y}},{key:"getOffsets",value:function(n){return this.keyToLocation.get(n)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(n){if(this.locked)return!1;var r=this.texSize,i=this.texRows,l=this.getScale(n),s=l.texW;return this.freePointer.x+s>r?this.freePointer.row<i-1:!0}},{key:"bufferIfNeeded",value:function(n){this.texture||(this.texture=kB(n,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])})(),zB=(function(){function t(e,n,r,i){ji(this,t),this.r=e,this.texSize=n,this.texRows=r,this.createTextureCanvas=i,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return Hi(t,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var n=this.r,r=this.texSize,i=this.texRows,l=this.createTextureCanvas;return new IB(n,r,i,l)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var n=this.r,r=this.texSize,i=this.texRows,l=this.createTextureCanvas,s=Math.floor(r/i);this.scratch=l(n,r,s,"scratch")}return this.scratch}},{key:"draw",value:function(n,r,i){var l=this.styleKeyToAtlas.get(n);return l||(l=this.atlases[this.atlases.length-1],(!l||!l.canFit(r))&&(l&&l.lock(),l=this._createAtlas(),this.atlases.push(l)),l.draw(n,r,i),this.styleKeyToAtlas.set(n,l)),l}},{key:"getAtlas",value:function(n){return this.styleKeyToAtlas.get(n)}},{key:"hasAtlas",value:function(n){return this.styleKeyToAtlas.has(n)}},{key:"markKeyForGC",value:function(n){this.markedKeys.add(n)}},{key:"gc",value:function(){var n=this,r=this.markedKeys;if(r.size===0){console.log("nothing to garbage collect");return}var i=[],l=new Map,s=null,u=Or(this.atlases),f;try{var c=function(){var v=f.value,p=v.getKeys(),m=PB(r,p);if(m.size===0)return i.push(v),p.forEach(function(k){return l.set(k,v)}),1;s||(s=n._createAtlas(),i.push(s));var y=Or(p),S;try{for(y.s();!(S=y.n()).done;){var w=S.value;if(!m.has(w)){var E=v.getOffsets(w),C=Pn(E,2),T=C[0],A=C[1];s.canFit({w:T.w+A.w,h:T.h})||(s.lock(),s=n._createAtlas(),i.push(s)),v.canvas&&(n._copyTextureToNewAtlas(w,v,s),l.set(w,s))}}}catch(k){y.e(k)}finally{y.f()}v.dispose()};for(u.s();!(f=u.n()).done;)c()}catch(h){u.e(h)}finally{u.f()}this.atlases=i,this.styleKeyToAtlas=l,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(n,r,i){var l=r.getOffsets(n),s=Pn(l,2),u=s[0],f=s[1];if(f.w===0)i.draw(n,u,function(p){p.drawImage(r.canvas,u.x,u.y,u.w,u.h,0,0,u.w,u.h)});else{var c=this._getScratchCanvas();c.clear(),c.context.drawImage(r.canvas,u.x,u.y,u.w,u.h,0,0,u.w,u.h),c.context.drawImage(r.canvas,f.x,f.y,f.w,f.h,u.w,0,f.w,f.h);var h=u.w+f.w,v=u.h;i.draw(n,{w:h,h:v},function(p){p.drawImage(c,0,0,h,v,0,0,h,v)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])})();function PB(t,e){return t.intersection?t.intersection(e):new Set(Of(t).filter(function(n){return e.has(n)}))}var UB=(function(){function t(e,n){ji(this,t),this.r=e,this.globalOptions=n,this.atlasSize=n.webglTexSize,this.maxAtlasesPerBatch=n.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return Hi(t,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(n,r){var i=this.globalOptions,l=i.webglTexSize,s=i.createTextureCanvas,u=r.texRows,f=this._cacheScratchCanvas(s),c=new zB(this.r,l,u,f);this.collections.set(n,c)}},{key:"addRenderType",value:function(n,r){var i=r.collection;if(!this.collections.has(i))throw new Error("invalid atlas collection name '".concat(i,"'"));var l=this.collections.get(i),s=vt({type:n,atlasCollection:l},r);this.renderTypes.set(n,s)}},{key:"getRenderTypeOpts",value:function(n){return this.renderTypes.get(n)}},{key:"getAtlasCollection",value:function(n){return this.collections.get(n)}},{key:"_cacheScratchCanvas",value:function(n){var r=-1,i=-1,l=null;return function(s,u,f,c){return c?((!l||u!=r||f!=i)&&(r=u,i=f,l=n(s,u,f)),l):n(s,u,f)}}},{key:"_key",value:function(n,r){return"".concat(n,"-").concat(r)}},{key:"invalidate",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=i.forceRedraw,s=l===void 0?!1:l,u=i.filterEle,f=u===void 0?function(){return!0}:u,c=i.filterType,h=c===void 0?function(){return!0}:c,v=!1,p=!1,m=Or(n),y;try{for(m.s();!(y=m.n()).done;){var S=y.value;if(f(S)){var w=Or(this.renderTypes.values()),E;try{var C=function(){var A=E.value,k=A.type;if(h(k)){var N=r.collections.get(A.collection),_=A.getKey(S),O=Array.isArray(_)?_:[_];if(s)O.forEach(function(P){return N.markKeyForGC(P)}),p=!0;else{var U=A.getID?A.getID(S):S.id(),M=r._key(k,U),I=r.typeAndIdToKey.get(M);I!==void 0&&!_B(O,I)&&(v=!0,r.typeAndIdToKey.delete(M),I.forEach(function(P){return N.markKeyForGC(P)}))}}};for(w.s();!(E=w.n()).done;)C()}catch(T){w.e(T)}finally{w.f()}}}}catch(T){m.e(T)}finally{m.f()}return p&&(this.gc(),v=!1),v}},{key:"gc",value:function(){var n=Or(this.collections.values()),r;try{for(n.s();!(r=n.n()).done;){var i=r.value;i.gc()}}catch(l){n.e(l)}finally{n.f()}}},{key:"getOrCreateAtlas",value:function(n,r,i,l){var s=this.renderTypes.get(r),u=this.collections.get(s.collection),f=!1,c=u.draw(l,i,function(p){s.drawClipped?(p.save(),p.beginPath(),p.rect(0,0,i.w,i.h),p.clip(),s.drawElement(p,n,i,!0,!0),p.restore()):s.drawElement(p,n,i,!0,!0),f=!0});if(f){var h=s.getID?s.getID(n):n.id(),v=this._key(r,h);this.typeAndIdToKey.has(v)?this.typeAndIdToKey.get(v).push(l):this.typeAndIdToKey.set(v,[l])}return c}},{key:"getAtlasInfo",value:function(n,r){var i=this,l=this.renderTypes.get(r),s=l.getKey(n),u=Array.isArray(s)?s:[s];return u.map(function(f){var c=l.getBoundingBox(n,f),h=i.getOrCreateAtlas(n,r,c,f),v=h.getOffsets(f),p=Pn(v,2),m=p[0],y=p[1];return{atlas:h,tex:m,tex1:m,tex2:y,bb:c}})}},{key:"getDebugInfo",value:function(){var n=[],r=Or(this.collections),i;try{for(r.s();!(i=r.n()).done;){var l=Pn(i.value,2),s=l[0],u=l[1],f=u.getCounts(),c=f.keyCount,h=f.atlasCount;n.push({type:s,keyCount:c,atlasCount:h})}}catch(v){r.e(v)}finally{r.f()}return n}}])})(),qB=(function(){function t(e){ji(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Hi(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(n,r){return r})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(n){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(n):!0}},{key:"getAtlasIndexForBatch",value:function(n){var r=this.batchAtlases.indexOf(n);if(r<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(n),r=this.batchAtlases.length-1}return r}}])})(),jB=`
|
|
21
|
-
float circleSD(vec2 p, float r) {
|
|
22
|
-
return distance(vec2(0), p) - r; // signed distance
|
|
23
|
-
}
|
|
24
|
-
`,HB=`
|
|
25
|
-
float rectangleSD(vec2 p, vec2 b) {
|
|
26
|
-
vec2 d = abs(p)-b;
|
|
27
|
-
return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
|
|
28
|
-
}
|
|
29
|
-
`,GB=`
|
|
30
|
-
float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
|
|
31
|
-
cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
|
|
32
|
-
cr.x = (p.y > 0.0) ? cr.x : cr.y;
|
|
33
|
-
vec2 q = abs(p) - b + cr.x;
|
|
34
|
-
return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
|
|
35
|
-
}
|
|
36
|
-
`,VB=`
|
|
37
|
-
float ellipseSD(vec2 p, vec2 ab) {
|
|
38
|
-
p = abs( p ); // symmetry
|
|
39
|
-
|
|
40
|
-
// find root with Newton solver
|
|
41
|
-
vec2 q = ab*(p-ab);
|
|
42
|
-
float w = (q.x<q.y)? 1.570796327 : 0.0;
|
|
43
|
-
for( int i=0; i<5; i++ ) {
|
|
44
|
-
vec2 cs = vec2(cos(w),sin(w));
|
|
45
|
-
vec2 u = ab*vec2( cs.x,cs.y);
|
|
46
|
-
vec2 v = ab*vec2(-cs.y,cs.x);
|
|
47
|
-
w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// compute final point and distance
|
|
51
|
-
float d = length(p-ab*vec2(cos(w),sin(w)));
|
|
52
|
-
|
|
53
|
-
// return signed distance
|
|
54
|
-
return (dot(p/ab,p/ab)>1.0) ? d : -d;
|
|
55
|
-
}
|
|
56
|
-
`,iu={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},Vf={IGNORE:1,USE_BB:2},ep=0,cw=1,fw=2,tp=3,bs=4,cf=5,$o=6,Ko=7,$B=(function(){function t(e,n,r){ji(this,t),this.r=e,this.gl=n,this.maxInstances=r.webglBatchSize,this.atlasSize=r.webglTexSize,this.bgColor=r.bgColor,this.debug=r.webglDebug,this.batchDebugInfo=[],r.enableWrapping=!0,r.createTextureCanvas=CB,this.atlasManager=new UB(e,r),this.batchManager=new qB(r),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(iu.SCREEN),this.pickingProgram=this._createShaderProgram(iu.PICKING),this.vao=this._createVAO()}return Hi(t,[{key:"addAtlasCollection",value:function(n,r){this.atlasManager.addAtlasCollection(n,r)}},{key:"addTextureAtlasRenderType",value:function(n,r){this.atlasManager.addRenderType(n,r)}},{key:"addSimpleShapeRenderType",value:function(n,r){this.simpleShapeOptions.set(n,r)}},{key:"invalidate",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.type,l=this.atlasManager;return i?l.invalidate(n,{filterType:function(u){return u===i},forceRedraw:!0}):l.invalidate(n)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(n){var r=this.gl,i=`#version 300 es
|
|
57
|
-
precision highp float;
|
|
58
|
-
|
|
59
|
-
uniform mat3 uPanZoomMatrix;
|
|
60
|
-
uniform int uAtlasSize;
|
|
61
|
-
|
|
62
|
-
// instanced
|
|
63
|
-
in vec2 aPosition; // a vertex from the unit square
|
|
64
|
-
|
|
65
|
-
in mat3 aTransform; // used to transform verticies, eg into a bounding box
|
|
66
|
-
in int aVertType; // the type of thing we are rendering
|
|
67
|
-
|
|
68
|
-
// the z-index that is output when using picking mode
|
|
69
|
-
in vec4 aIndex;
|
|
70
|
-
|
|
71
|
-
// For textures
|
|
72
|
-
in int aAtlasId; // which shader unit/atlas to use
|
|
73
|
-
in vec4 aTex; // x/y/w/h of texture in atlas
|
|
74
|
-
|
|
75
|
-
// for edges
|
|
76
|
-
in vec4 aPointAPointB;
|
|
77
|
-
in vec4 aPointCPointD;
|
|
78
|
-
in vec2 aLineWidth; // also used for node border width
|
|
79
|
-
|
|
80
|
-
// simple shapes
|
|
81
|
-
in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
|
|
82
|
-
in vec4 aColor; // also used for edges
|
|
83
|
-
in vec4 aBorderColor; // aLineWidth is used for border width
|
|
84
|
-
|
|
85
|
-
// output values passed to the fragment shader
|
|
86
|
-
out vec2 vTexCoord;
|
|
87
|
-
out vec4 vColor;
|
|
88
|
-
out vec2 vPosition;
|
|
89
|
-
// flat values are not interpolated
|
|
90
|
-
flat out int vAtlasId;
|
|
91
|
-
flat out int vVertType;
|
|
92
|
-
flat out vec2 vTopRight;
|
|
93
|
-
flat out vec2 vBotLeft;
|
|
94
|
-
flat out vec4 vCornerRadius;
|
|
95
|
-
flat out vec4 vBorderColor;
|
|
96
|
-
flat out vec2 vBorderWidth;
|
|
97
|
-
flat out vec4 vIndex;
|
|
98
|
-
|
|
99
|
-
void main(void) {
|
|
100
|
-
int vid = gl_VertexID;
|
|
101
|
-
vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
|
|
102
|
-
|
|
103
|
-
if(aVertType == `.concat(ep,`) {
|
|
104
|
-
float texX = aTex.x; // texture coordinates
|
|
105
|
-
float texY = aTex.y;
|
|
106
|
-
float texW = aTex.z;
|
|
107
|
-
float texH = aTex.w;
|
|
108
|
-
|
|
109
|
-
if(vid == 1 || vid == 2 || vid == 4) {
|
|
110
|
-
texX += texW;
|
|
111
|
-
}
|
|
112
|
-
if(vid == 2 || vid == 4 || vid == 5) {
|
|
113
|
-
texY += texH;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
float d = float(uAtlasSize);
|
|
117
|
-
vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1
|
|
118
|
-
|
|
119
|
-
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
120
|
-
}
|
|
121
|
-
else if(aVertType == `).concat(bs," || aVertType == ").concat(Ko,`
|
|
122
|
-
|| aVertType == `).concat(cf," || aVertType == ").concat($o,`) { // simple shapes
|
|
123
|
-
|
|
124
|
-
// the bounding box is needed by the fragment shader
|
|
125
|
-
vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
|
|
126
|
-
vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
|
|
127
|
-
vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated
|
|
128
|
-
|
|
129
|
-
// calculations are done in the fragment shader, just pass these along
|
|
130
|
-
vColor = aColor;
|
|
131
|
-
vCornerRadius = aCornerRadius;
|
|
132
|
-
vBorderColor = aBorderColor;
|
|
133
|
-
vBorderWidth = aLineWidth;
|
|
134
|
-
|
|
135
|
-
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
136
|
-
}
|
|
137
|
-
else if(aVertType == `).concat(cw,`) {
|
|
138
|
-
vec2 source = aPointAPointB.xy;
|
|
139
|
-
vec2 target = aPointAPointB.zw;
|
|
140
|
-
|
|
141
|
-
// adjust the geometry so that the line is centered on the edge
|
|
142
|
-
position.y = position.y - 0.5;
|
|
143
|
-
|
|
144
|
-
// stretch the unit square into a long skinny rectangle
|
|
145
|
-
vec2 xBasis = target - source;
|
|
146
|
-
vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
|
|
147
|
-
vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;
|
|
148
|
-
|
|
149
|
-
gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
|
|
150
|
-
vColor = aColor;
|
|
151
|
-
}
|
|
152
|
-
else if(aVertType == `).concat(fw,`) {
|
|
153
|
-
vec2 pointA = aPointAPointB.xy;
|
|
154
|
-
vec2 pointB = aPointAPointB.zw;
|
|
155
|
-
vec2 pointC = aPointCPointD.xy;
|
|
156
|
-
vec2 pointD = aPointCPointD.zw;
|
|
157
|
-
|
|
158
|
-
// adjust the geometry so that the line is centered on the edge
|
|
159
|
-
position.y = position.y - 0.5;
|
|
160
|
-
|
|
161
|
-
vec2 p0, p1, p2, pos;
|
|
162
|
-
if(position.x == 0.0) { // The left side of the unit square
|
|
163
|
-
p0 = pointA;
|
|
164
|
-
p1 = pointB;
|
|
165
|
-
p2 = pointC;
|
|
166
|
-
pos = position;
|
|
167
|
-
} else { // The right side of the unit square, use same approach but flip the geometry upside down
|
|
168
|
-
p0 = pointD;
|
|
169
|
-
p1 = pointC;
|
|
170
|
-
p2 = pointB;
|
|
171
|
-
pos = vec2(0.0, -position.y);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
vec2 p01 = p1 - p0;
|
|
175
|
-
vec2 p12 = p2 - p1;
|
|
176
|
-
vec2 p21 = p1 - p2;
|
|
177
|
-
|
|
178
|
-
// Find the normal vector.
|
|
179
|
-
vec2 tangent = normalize(normalize(p12) + normalize(p01));
|
|
180
|
-
vec2 normal = vec2(-tangent.y, tangent.x);
|
|
181
|
-
|
|
182
|
-
// Find the vector perpendicular to p0 -> p1.
|
|
183
|
-
vec2 p01Norm = normalize(vec2(-p01.y, p01.x));
|
|
184
|
-
|
|
185
|
-
// Determine the bend direction.
|
|
186
|
-
float sigma = sign(dot(p01 + p21, normal));
|
|
187
|
-
float width = aLineWidth[0];
|
|
188
|
-
|
|
189
|
-
if(sign(pos.y) == -sigma) {
|
|
190
|
-
// This is an intersecting vertex. Adjust the position so that there's no overlap.
|
|
191
|
-
vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
|
|
192
|
-
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
193
|
-
} else {
|
|
194
|
-
// This is a non-intersecting vertex. Treat it like a mitre join.
|
|
195
|
-
vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
|
|
196
|
-
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
vColor = aColor;
|
|
200
|
-
}
|
|
201
|
-
else if(aVertType == `).concat(tp,` && vid < 3) {
|
|
202
|
-
// massage the first triangle into an edge arrow
|
|
203
|
-
if(vid == 0)
|
|
204
|
-
position = vec2(-0.15, -0.3);
|
|
205
|
-
if(vid == 1)
|
|
206
|
-
position = vec2( 0.0, 0.0);
|
|
207
|
-
if(vid == 2)
|
|
208
|
-
position = vec2( 0.15, -0.3);
|
|
209
|
-
|
|
210
|
-
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
211
|
-
vColor = aColor;
|
|
212
|
-
}
|
|
213
|
-
else {
|
|
214
|
-
gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
vAtlasId = aAtlasId;
|
|
218
|
-
vVertType = aVertType;
|
|
219
|
-
vIndex = aIndex;
|
|
220
|
-
}
|
|
221
|
-
`),l=this.batchManager.getIndexArray(),s=`#version 300 es
|
|
222
|
-
precision highp float;
|
|
223
|
-
|
|
224
|
-
// declare texture unit for each texture atlas in the batch
|
|
225
|
-
`.concat(l.map(function(c){return"uniform sampler2D uTexture".concat(c,";")}).join(`
|
|
226
|
-
`),`
|
|
227
|
-
|
|
228
|
-
uniform vec4 uBGColor;
|
|
229
|
-
uniform float uZoom;
|
|
230
|
-
|
|
231
|
-
in vec2 vTexCoord;
|
|
232
|
-
in vec4 vColor;
|
|
233
|
-
in vec2 vPosition; // model coordinates
|
|
234
|
-
|
|
235
|
-
flat in int vAtlasId;
|
|
236
|
-
flat in vec4 vIndex;
|
|
237
|
-
flat in int vVertType;
|
|
238
|
-
flat in vec2 vTopRight;
|
|
239
|
-
flat in vec2 vBotLeft;
|
|
240
|
-
flat in vec4 vCornerRadius;
|
|
241
|
-
flat in vec4 vBorderColor;
|
|
242
|
-
flat in vec2 vBorderWidth;
|
|
243
|
-
|
|
244
|
-
out vec4 outColor;
|
|
245
|
-
|
|
246
|
-
`).concat(jB,`
|
|
247
|
-
`).concat(HB,`
|
|
248
|
-
`).concat(GB,`
|
|
249
|
-
`).concat(VB,`
|
|
250
|
-
|
|
251
|
-
vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
|
|
252
|
-
return vec4(
|
|
253
|
-
top.rgb + (bot.rgb * (1.0 - top.a)),
|
|
254
|
-
top.a + (bot.a * (1.0 - top.a))
|
|
255
|
-
);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
|
|
259
|
-
// scale to the zoom level so that borders don't look blurry when zoomed in
|
|
260
|
-
// note 1.5 is an aribitrary value chosen because it looks good
|
|
261
|
-
return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
void main(void) {
|
|
265
|
-
if(vVertType == `).concat(ep,`) {
|
|
266
|
-
// look up the texel from the texture unit
|
|
267
|
-
`).concat(l.map(function(c){return"if(vAtlasId == ".concat(c,") outColor = texture(uTexture").concat(c,", vTexCoord);")}).join(`
|
|
268
|
-
else `),`
|
|
269
|
-
}
|
|
270
|
-
else if(vVertType == `).concat(tp,`) {
|
|
271
|
-
// mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
|
|
272
|
-
outColor = blend(vColor, uBGColor);
|
|
273
|
-
outColor.a = 1.0; // make opaque, masks out line under arrow
|
|
274
|
-
}
|
|
275
|
-
else if(vVertType == `).concat(bs,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
|
|
276
|
-
outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
|
|
277
|
-
}
|
|
278
|
-
else if(vVertType == `).concat(bs," || vVertType == ").concat(Ko,`
|
|
279
|
-
|| vVertType == `).concat(cf," || vVertType == ").concat($o,`) { // use SDF
|
|
280
|
-
|
|
281
|
-
float outerBorder = vBorderWidth[0];
|
|
282
|
-
float innerBorder = vBorderWidth[1];
|
|
283
|
-
float borderPadding = outerBorder * 2.0;
|
|
284
|
-
float w = vTopRight.x - vBotLeft.x - borderPadding;
|
|
285
|
-
float h = vTopRight.y - vBotLeft.y - borderPadding;
|
|
286
|
-
vec2 b = vec2(w/2.0, h/2.0); // half width, half height
|
|
287
|
-
vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
|
|
288
|
-
|
|
289
|
-
float d; // signed distance
|
|
290
|
-
if(vVertType == `).concat(bs,`) {
|
|
291
|
-
d = rectangleSD(p, b);
|
|
292
|
-
} else if(vVertType == `).concat(Ko,` && w == h) {
|
|
293
|
-
d = circleSD(p, b.x); // faster than ellipse
|
|
294
|
-
} else if(vVertType == `).concat(Ko,`) {
|
|
295
|
-
d = ellipseSD(p, b);
|
|
296
|
-
} else {
|
|
297
|
-
d = roundRectangleSD(p, b, vCornerRadius.wzyx);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
// use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
|
|
301
|
-
// we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
|
|
302
|
-
if(d > 0.0) {
|
|
303
|
-
if(d > outerBorder) {
|
|
304
|
-
discard;
|
|
305
|
-
} else {
|
|
306
|
-
outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
|
|
307
|
-
}
|
|
308
|
-
} else {
|
|
309
|
-
if(d > innerBorder) {
|
|
310
|
-
vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
|
|
311
|
-
vec4 innerBorderColor = blend(vBorderColor, vColor);
|
|
312
|
-
outColor = distInterp(innerBorderColor, outerColor, d);
|
|
313
|
-
}
|
|
314
|
-
else {
|
|
315
|
-
vec4 outerColor;
|
|
316
|
-
if(innerBorder == 0.0 && outerBorder == 0.0) {
|
|
317
|
-
outerColor = vec4(0);
|
|
318
|
-
} else if(innerBorder == 0.0) {
|
|
319
|
-
outerColor = vBorderColor;
|
|
320
|
-
} else {
|
|
321
|
-
outerColor = blend(vBorderColor, vColor);
|
|
322
|
-
}
|
|
323
|
-
outColor = distInterp(vColor, outerColor, d - innerBorder);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
outColor = vColor;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
`).concat(n.picking?`if(outColor.a == 0.0) discard;
|
|
332
|
-
else outColor = vIndex;`:"",`
|
|
333
|
-
}
|
|
334
|
-
`),u=SB(r,i,s);u.aPosition=r.getAttribLocation(u,"aPosition"),u.aIndex=r.getAttribLocation(u,"aIndex"),u.aVertType=r.getAttribLocation(u,"aVertType"),u.aTransform=r.getAttribLocation(u,"aTransform"),u.aAtlasId=r.getAttribLocation(u,"aAtlasId"),u.aTex=r.getAttribLocation(u,"aTex"),u.aPointAPointB=r.getAttribLocation(u,"aPointAPointB"),u.aPointCPointD=r.getAttribLocation(u,"aPointCPointD"),u.aLineWidth=r.getAttribLocation(u,"aLineWidth"),u.aColor=r.getAttribLocation(u,"aColor"),u.aCornerRadius=r.getAttribLocation(u,"aCornerRadius"),u.aBorderColor=r.getAttribLocation(u,"aBorderColor"),u.uPanZoomMatrix=r.getUniformLocation(u,"uPanZoomMatrix"),u.uAtlasSize=r.getUniformLocation(u,"uAtlasSize"),u.uBGColor=r.getUniformLocation(u,"uBGColor"),u.uZoom=r.getUniformLocation(u,"uZoom"),u.uTextures=[];for(var f=0;f<this.batchManager.getMaxAtlasesPerBatch();f++)u.uTextures.push(r.getUniformLocation(u,"uTexture".concat(f)));return u}},{key:"_createVAO",value:function(){var n=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=n.length/2;var r=this.maxInstances,i=this.gl,l=this.program,s=i.createVertexArray();return i.bindVertexArray(s),MB(i,"vec2",l.aPosition,n),this.transformBuffer=OB(i,r,l.aTransform),this.indexBuffer=Ea(i,r,"vec4",l.aIndex),this.vertTypeBuffer=Ea(i,r,"int",l.aVertType),this.atlasIdBuffer=Ea(i,r,"int",l.aAtlasId),this.texBuffer=Ea(i,r,"vec4",l.aTex),this.pointAPointBBuffer=Ea(i,r,"vec4",l.aPointAPointB),this.pointCPointDBuffer=Ea(i,r,"vec4",l.aPointCPointD),this.lineWidthBuffer=Ea(i,r,"vec2",l.aLineWidth),this.colorBuffer=Ea(i,r,"vec4",l.aColor),this.cornerRadiusBuffer=Ea(i,r,"vec4",l.aCornerRadius),this.borderColorBuffer=Ea(i,r,"vec4",l.aBorderColor),i.bindVertexArray(null),s}},{key:"buffers",get:function(){var n=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(r){return Ri(r,"Buffer")}).map(function(r){return n[r]})),this._buffers}},{key:"startFrame",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:iu.SCREEN;this.panZoomMatrix=n,this.renderTarget=r,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(n,r){return n.visible()?r&&r.isVisible?r.isVisible(n):!0:!1}},{key:"drawTexture",value:function(n,r,i){var l=this.atlasManager,s=this.batchManager,u=l.getRenderTypeOpts(i);if(this._isVisible(n,u)&&!(n.isEdge()&&!this._isValidEdge(n))){if(this.renderTarget.picking&&u.getTexPickingMode){var f=u.getTexPickingMode(n);if(f===Vf.IGNORE)return;if(f==Vf.USE_BB){this.drawPickingRectangle(n,r,i);return}}var c=l.getAtlasInfo(n,i),h=Or(c),v;try{for(h.s();!(v=h.n()).done;){var p=v.value,m=p.atlas,y=p.tex1,S=p.tex2;s.canAddToCurrentBatch(m)||this.endBatch();for(var w=s.getAtlasIndexForBatch(m),E=0,C=[[y,!0],[S,!1]];E<C.length;E++){var T=Pn(C[E],2),A=T[0],k=T[1];if(A.w!=0){var N=this.instanceCount;this.vertTypeBuffer.getView(N)[0]=ep;var _=this.indexBuffer.getView(N);ys(r,_);var O=this.atlasIdBuffer.getView(N);O[0]=w;var U=this.texBuffer.getView(N);U[0]=A.x,U[1]=A.y,U[2]=A.w,U[3]=A.h;var M=this.transformBuffer.getMatrixView(N);this.setTransformMatrix(n,M,u,p,k),this.instanceCount++,k||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(I){h.e(I)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(n,r,i,l){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,u=0;if(i.shapeProps&&i.shapeProps.padding&&(u=n.pstyle(i.shapeProps.padding).pfValue),l){var f=l.bb,c=l.tex1,h=l.tex2,v=c.w/(c.w+h.w);s||(v=1-v);var p=this._getAdjustedBB(f,u,s,v);this._applyTransformMatrix(r,p,i,n)}else{var m=i.getBoundingBox(n),y=this._getAdjustedBB(m,u,!0,1);this._applyTransformMatrix(r,y,i,n)}}},{key:"_applyTransformMatrix",value:function(n,r,i,l){var s,u;ow(n);var f=i.getRotation?i.getRotation(l):0;if(f!==0){var c=i.getRotationPoint(l),h=c.x,v=c.y;Rf(n,n,[h,v]),uw(n,n,f);var p=i.getRotationOffset(l);s=p.x+(r.xOffset||0),u=p.y+(r.yOffset||0)}else s=r.x1,u=r.y1;Rf(n,n,[s,u]),jp(n,n,[r.w,r.h])}},{key:"_getAdjustedBB",value:function(n,r,i,l){var s=n.x1,u=n.y1,f=n.w,c=n.h,h=n.yOffset;r&&(s-=r,u-=r,f+=2*r,c+=2*r);var v=0,p=f*l;return i&&l<1?f=p:!i&&l<1&&(v=f-p,s+=v,f=p),{x1:s,y1:u,w:f,h:c,xOffset:v,yOffset:h}}},{key:"drawPickingRectangle",value:function(n,r,i){var l=this.atlasManager.getRenderTypeOpts(i),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=bs;var u=this.indexBuffer.getView(s);ys(r,u);var f=this.colorBuffer.getView(s);gl([0,0,0],1,f);var c=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(n,c,l),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(n,r,i){var l=this.simpleShapeOptions.get(i);if(this._isVisible(n,l)){var s=l.shapeProps,u=this._getVertTypeForShape(n,s.shape);if(u===void 0||l.isSimple&&!l.isSimple(n,this.renderTarget)){this.drawTexture(n,r,i);return}var f=this.instanceCount;if(this.vertTypeBuffer.getView(f)[0]=u,u===cf||u===$o){var c=l.getBoundingBox(n),h=this._getCornerRadius(n,s.radius,c),v=this.cornerRadiusBuffer.getView(f);v[0]=h,v[1]=h,v[2]=h,v[3]=h,u===$o&&(v[0]=0,v[2]=0)}var p=this.indexBuffer.getView(f);ys(r,p);var m=this.renderTarget.picking?1:n.pstyle(s.opacity).value,y=n.pstyle(s.color).value,S=this.colorBuffer.getView(f);gl(y,m,S);var w=this.lineWidthBuffer.getView(f);if(w[0]=0,w[1]=0,s.border){var E=n.pstyle("border-width").value;if(E>0){var C=n.pstyle("border-color").value,T=n.pstyle("border-opacity").value,A=this.borderColorBuffer.getView(f);gl(C,T,A);var k=n.pstyle("border-position").value;if(k==="inside")w[0]=0,w[1]=-E;else if(k==="outside")w[0]=E,w[1]=0;else{var N=E/2;w[0]=N,w[1]=-N}}}var _=this.transformBuffer.getMatrixView(f);this.setTransformMatrix(n,_,l),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(n,r){var i=n.pstyle(r).value;switch(i){case"rectangle":return bs;case"ellipse":return Ko;case"roundrectangle":case"round-rectangle":return cf;case"bottom-round-rectangle":return $o;default:return}}},{key:"_getCornerRadius",value:function(n,r,i){var l=i.w,s=i.h;if(n.pstyle(r).value==="auto")return zi(l,s);var u=n.pstyle(r).pfValue,f=l/2,c=s/2;return Math.min(u,c,f)}},{key:"drawEdgeArrow",value:function(n,r,i){if(n.visible()){var l=n._private.rscratch,s,u,f;if(i==="source"?(s=l.arrowStartX,u=l.arrowStartY,f=l.srcArrowAngle):(s=l.arrowEndX,u=l.arrowEndY,f=l.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(u)||u==null||isNaN(f)||f==null)){var c=n.pstyle(i+"-arrow-shape").value;if(c!=="none"){var h=n.pstyle(i+"-arrow-color").value,v=n.pstyle("opacity").value,p=n.pstyle("line-opacity").value,m=v*p,y=n.pstyle("width").pfValue,S=n.pstyle("arrow-scale").value,w=this.r.getArrowWidth(y,S),E=this.instanceCount,C=this.transformBuffer.getMatrixView(E);ow(C),Rf(C,C,[s,u]),jp(C,C,[w,w]),uw(C,C,f),this.vertTypeBuffer.getView(E)[0]=tp;var T=this.indexBuffer.getView(E);ys(r,T);var A=this.colorBuffer.getView(E);gl(h,m,A),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(n,r){if(n.visible()){var i=this._getEdgePoints(n);if(i){var l=n.pstyle("opacity").value,s=n.pstyle("line-opacity").value,u=n.pstyle("width").pfValue,f=n.pstyle("line-color").value,c=l*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=cw;var v=this.indexBuffer.getView(h);ys(r,v);var p=this.colorBuffer.getView(h);gl(f,c,p);var m=this.lineWidthBuffer.getView(h);m[0]=u;var y=this.pointAPointBBuffer.getView(h);y[0]=i[0],y[1]=i[1],y[2]=i[2],y[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var S=0;S<i.length-2;S+=2){var w=this.instanceCount;this.vertTypeBuffer.getView(w)[0]=fw;var E=this.indexBuffer.getView(w);ys(r,E);var C=this.colorBuffer.getView(w);gl(f,c,C);var T=this.lineWidthBuffer.getView(w);T[0]=u;var A=i[S-2],k=i[S-1],N=i[S],_=i[S+1],O=i[S+2],U=i[S+3],M=i[S+4],I=i[S+5];S==0&&(A=2*N-O+.001,k=2*_-U+.001),S==i.length-4&&(M=2*O-N+.001,I=2*U-_+.001);var P=this.pointAPointBBuffer.getView(w);P[0]=A,P[1]=k,P[2]=N,P[3]=_;var j=this.pointCPointDBuffer.getView(w);j[0]=O,j[1]=U,j[2]=M,j[3]=I,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(n){var r=n._private.rscratch;return!(r.badLine||r.allpts==null||isNaN(r.allpts[0]))}},{key:"_getEdgePoints",value:function(n){var r=n._private.rscratch;if(this._isValidEdge(n)){var i=r.allpts;if(i.length==4)return i;var l=this._getNumSegments(n);return this._getCurveSegmentPoints(i,l)}}},{key:"_getNumSegments",value:function(n){var r=15;return Math.min(Math.max(r,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(n,r){if(n.length==4)return n;for(var i=Array((r+1)*2),l=0;l<=r;l++)if(l==0)i[0]=n[0],i[1]=n[1];else if(l==r)i[l*2]=n[n.length-2],i[l*2+1]=n[n.length-1];else{var s=l/r;this._setCurvePoint(n,s,i,l*2)}return i}},{key:"_setCurvePoint",value:function(n,r,i,l){if(n.length<=2)i[l]=n[0],i[l+1]=n[1];else{for(var s=Array(n.length-2),u=0;u<s.length;u+=2){var f=(1-r)*n[u]+r*n[u+2],c=(1-r)*n[u+1]+r*n[u+3];s[u]=f,s[u+1]=c}return this._setCurvePoint(s,r,i,l)}}},{key:"endBatch",value:function(){var n=this.gl,r=this.vao,i=this.vertexCount,l=this.instanceCount;if(l!==0){var s=this.renderTarget.picking?this.pickingProgram:this.program;n.useProgram(s),n.bindVertexArray(r);var u=Or(this.buffers),f;try{for(u.s();!(f=u.n()).done;){var c=f.value;c.bufferSubData(l)}}catch(y){u.e(y)}finally{u.f()}for(var h=this.batchManager.getAtlases(),v=0;v<h.length;v++)h[v].bufferIfNeeded(n);for(var p=0;p<h.length;p++)n.activeTexture(n.TEXTURE0+p),n.bindTexture(n.TEXTURE_2D,h[p].texture),n.uniform1i(s.uTextures[p],p);n.uniform1f(s.uZoom,TB(this.r)),n.uniformMatrix3fv(s.uPanZoomMatrix,!1,this.panZoomMatrix),n.uniform1i(s.uAtlasSize,this.batchManager.getAtlasSize());var m=gl(this.bgColor,1);n.uniform4fv(s.uBGColor,m),n.drawArraysInstanced(n.TRIANGLES,0,i,l),n.bindVertexArray(null),n.bindTexture(n.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:l,atlasCount:h.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var n=this.atlasManager.getDebugInfo(),r=n.reduce(function(s,u){return s+u.atlasCount},0),i=this.batchDebugInfo,l=i.reduce(function(s,u){return s+u.count},0);return{atlasInfo:n,totalAtlases:r,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:i.length,batchInfo:i,totalInstances:l}}}])})(),aT={};aT.initWebgl=function(t,e){var n=this,r=n.data.contexts[n.WEBGL];t.bgColor=KB(n),t.webglTexSize=Math.min(t.webglTexSize,r.getParameter(r.MAX_TEXTURE_SIZE)),t.webglTexRows=Math.min(t.webglTexRows,54),t.webglTexRowsNodes=Math.min(t.webglTexRowsNodes,54),t.webglBatchSize=Math.min(t.webglBatchSize,16384),t.webglTexPerBatch=Math.min(t.webglTexPerBatch,r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS)),n.webglDebug=t.webglDebug,n.webglDebugShowAtlases=t.webglDebugShowAtlases,n.pickingFrameBuffer=BB(r),n.pickingFrameBuffer.needsDraw=!0,n.drawing=new $B(n,r,t);var i=function(v){return function(p){return n.getTextAngle(p,v)}},l=function(v){return function(p){var m=p.pstyle(v);return m&&m.value}},s=function(v){return function(p){return p.pstyle("".concat(v,"-opacity")).value>0}},u=function(v){var p=v.pstyle("text-events").strValue==="yes";return p?Vf.USE_BB:Vf.IGNORE},f=function(v){var p=v.position(),m=p.x,y=p.y,S=v.outerWidth(),w=v.outerHeight();return{w:S,h:w,x1:m-S/2,y1:y-w/2}};n.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),n.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),n.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),n.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:f,isSimple:AB,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),n.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:f,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),n.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:f,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),n.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:u,getKey:np(e.getLabelKey,null),getBoundingBox:rp(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:l("label")}),n.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:u,getKey:np(e.getSourceLabelKey,"source"),getBoundingBox:rp(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:l("source-label")}),n.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:u,getKey:np(e.getTargetLabelKey,"target"),getBoundingBox:rp(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:l("target-label")});var c=Au(function(){console.log("garbage collect flag set"),n.data.gc=!0},1e4);n.onUpdateEleCalcs(function(h,v){var p=!1;v&&v.length>0&&(p|=n.drawing.invalidate(v)),p&&c()}),YB(n)};function KB(t){var e=t.cy.container(),n=e&&e.style&&e.style.backgroundColor||"white";return MS(n)}function iT(t,e){var n=t._private.rscratch;return Rr(n,"labelWrapCachedLines",e)||[]}var np=function(e,n){return function(r){var i=e(r),l=iT(r,n);return l.length>1?l.map(function(s,u){return"".concat(i,"_").concat(u)}):i}},rp=function(e,n){return function(r,i){var l=e(r);if(typeof i=="string"){var s=i.indexOf("_");if(s>0){var u=Number(i.substring(s+1)),f=iT(r,n),c=l.h/f.length,h=c*u,v=l.y1+h;return{x1:l.x1,w:l.w,y1:v,h:c,yOffset:h}}}return l}};function YB(t){{var e=t.render;t.render=function(l){l=l||{};var s=t.cy;t.webgl&&(s.zoom()>QC?(XB(t),e.call(t,l)):(ZB(t),sT(t,l,iu.SCREEN)))}}{var n=t.matchCanvasSize;t.matchCanvasSize=function(l){n.call(t,l),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(l,s,u,f){return nL(t,l,s)};{var r=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){r.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(l,s){i.call(t,l,s),l==="viewport"||l==="bounds"?t.pickingFrameBuffer.needsDraw=!0:l==="background"&&t.drawing.invalidate(s,{type:"node-body"})}}}function XB(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function ZB(t){var e=function(r){r.save(),r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,t.canvasWidth,t.canvasHeight),r.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function QB(t){var e=t.canvasWidth,n=t.canvasHeight,r=Nm(t),i=r.pan,l=r.zoom,s=Jg();Rf(s,s,[i.x,i.y]),jp(s,s,[l,l]);var u=Jg();FB(u,e,n);var f=Jg();return LB(f,u,s),f}function lT(t,e){var n=t.canvasWidth,r=t.canvasHeight,i=Nm(t),l=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,n,r),e.translate(l.x,l.y),e.scale(s,s)}function WB(t,e){t.drawSelectionRectangle(e,function(n){return lT(t,n)})}function JB(t){var e=t.data.contexts[t.NODE];e.save(),lT(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function eL(t){var e=function(i,l,s){for(var u=i.atlasManager.getAtlasCollection(l),f=t.data.contexts[t.NODE],c=u.atlases,h=0;h<c.length;h++){var v=c[h],p=v.canvas;if(p){var m=p.width,y=p.height,S=m*h,w=p.height*s,E=.4;f.save(),f.scale(E,E),f.drawImage(p,S,w),f.strokeStyle="black",f.rect(S,w,m,y),f.stroke(),f.restore()}}},n=0;e(t.drawing,"node",n++),e(t.drawing,"label",n++)}function tL(t,e,n,r,i){var l,s,u,f,c=Nm(t),h=c.pan,v=c.zoom;{var p=DB(t,h,v,e,n),m=Pn(p,2),y=m[0],S=m[1],w=6;l=y-w/2,s=S-w/2,u=w,f=w}if(u===0||f===0)return[];var E=t.data.contexts[t.WEBGL];E.bindFramebuffer(E.FRAMEBUFFER,t.pickingFrameBuffer),t.pickingFrameBuffer.needsDraw&&(E.viewport(0,0,E.canvas.width,E.canvas.height),sT(t,null,iu.PICKING),t.pickingFrameBuffer.needsDraw=!1);var C=u*f,T=new Uint8Array(C*4);E.readPixels(l,s,u,f,E.RGBA,E.UNSIGNED_BYTE,T),E.bindFramebuffer(E.FRAMEBUFFER,null);for(var A=new Set,k=0;k<C;k++){var N=T.slice(k*4,k*4+4),_=NB(N)-1;_>=0&&A.add(_)}return A}function nL(t,e,n){var r=tL(t,e,n),i=t.getCachedZSortedEles(),l,s,u=Or(r),f;try{for(u.s();!(f=u.n()).done;){var c=f.value,h=i[c];if(!l&&h.isNode()&&(l=h),!s&&h.isEdge()&&(s=h),l&&s)break}}catch(v){u.e(v)}finally{u.f()}return[l,s].filter(Boolean)}function ap(t,e,n){var r=t.drawing;e+=1,n.isNode()?(r.drawNode(n,e,"node-underlay"),r.drawNode(n,e,"node-body"),r.drawTexture(n,e,"label"),r.drawNode(n,e,"node-overlay")):(r.drawEdgeLine(n,e),r.drawEdgeArrow(n,e,"source"),r.drawEdgeArrow(n,e,"target"),r.drawTexture(n,e,"label"),r.drawTexture(n,e,"edge-source-label"),r.drawTexture(n,e,"edge-target-label"))}function sT(t,e,n){var r;t.webglDebug&&(r=performance.now());var i=t.drawing,l=0;if(n.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&WB(t,e),t.data.canvasNeedsRedraw[t.NODE]||n.picking){var s=t.data.contexts[t.WEBGL];n.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var u=QB(t),f=t.getCachedZSortedEles();if(l=f.length,i.startFrame(u,n),n.screen){for(var c=0;c<f.nondrag.length;c++)ap(t,c,f.nondrag[c]);for(var h=0;h<f.drag.length;h++)ap(t,h,f.drag[h])}else if(n.picking)for(var v=0;v<f.length;v++)ap(t,v,f[v]);i.endFrame(),n.screen&&t.webglDebugShowAtlases&&(JB(t),eL(t)),t.data.canvasNeedsRedraw[t.NODE]=!1,t.data.canvasNeedsRedraw[t.DRAG]=!1}if(t.webglDebug){var p=performance.now(),m=!1,y=Math.ceil(p-r),S=i.getDebugInfo(),w=["".concat(l," elements"),"".concat(S.totalInstances," instances"),"".concat(S.batchCount," batches"),"".concat(S.totalAtlases," atlases"),"".concat(S.wrappedCount," wrapped textures"),"".concat(S.simpleCount," simple shapes")].join(", ");if(m)console.log("WebGL (".concat(n.name,") - time ").concat(y,"ms, ").concat(w));else{console.log("WebGL (".concat(n.name,") - frame time ").concat(y,"ms")),console.log("Totals:"),console.log(" ".concat(w)),console.log("Texture Atlases Used:");var E=S.atlasInfo,C=Or(E),T;try{for(C.s();!(T=C.n()).done;){var A=T.value;console.log(" ".concat(A.type,": ").concat(A.keyCount," keys, ").concat(A.atlasCount," atlases"))}}catch(k){C.e(k)}finally{C.f()}console.log("")}}t.data.gc&&(console.log("Garbage Collect!"),t.data.gc=!1,i.gc())}var $i={};$i.drawPolygonPath=function(t,e,n,r,i,l){var s=r/2,u=i/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*l[0],n+u*l[1]);for(var f=1;f<l.length/2;f++)t.lineTo(e+s*l[f*2],n+u*l[f*2+1]);t.closePath()};$i.drawRoundPolygonPath=function(t,e,n,r,i,l,s){s.forEach(function(u){return jC(t,u)}),t.closePath()};$i.drawRoundRectanglePath=function(t,e,n,r,i,l){var s=r/2,u=i/2,f=l==="auto"?zi(r,i):Math.min(l,u,s);t.beginPath&&t.beginPath(),t.moveTo(e,n-u),t.arcTo(e+s,n-u,e+s,n,f),t.arcTo(e+s,n+u,e,n+u,f),t.arcTo(e-s,n+u,e-s,n,f),t.arcTo(e-s,n-u,e,n-u,f),t.lineTo(e,n-u),t.closePath()};$i.drawBottomRoundRectanglePath=function(t,e,n,r,i,l){var s=r/2,u=i/2,f=l==="auto"?zi(r,i):l;t.beginPath&&t.beginPath(),t.moveTo(e,n-u),t.lineTo(e+s,n-u),t.lineTo(e+s,n),t.arcTo(e+s,n+u,e,n+u,f),t.arcTo(e-s,n+u,e-s,n,f),t.lineTo(e-s,n-u),t.lineTo(e,n-u),t.closePath()};$i.drawCutRectanglePath=function(t,e,n,r,i,l,s){var u=r/2,f=i/2,c=s==="auto"?gm():s;t.beginPath&&t.beginPath(),t.moveTo(e-u+c,n-f),t.lineTo(e+u-c,n-f),t.lineTo(e+u,n-f+c),t.lineTo(e+u,n+f-c),t.lineTo(e+u-c,n+f),t.lineTo(e-u+c,n+f),t.lineTo(e-u,n+f-c),t.lineTo(e-u,n-f+c),t.closePath()};$i.drawBarrelPath=function(t,e,n,r,i){var l=r/2,s=i/2,u=e-l,f=e+l,c=n-s,h=n+s,v=_p(r,i),p=v.widthOffset,m=v.heightOffset,y=v.ctrlPtOffsetPct*p;t.beginPath&&t.beginPath(),t.moveTo(u,c+m),t.lineTo(u,h-m),t.quadraticCurveTo(u+y,h,u+p,h),t.lineTo(f-p,h),t.quadraticCurveTo(f-y,h,f,h-m),t.lineTo(f,c+m),t.quadraticCurveTo(f-y,c,f-p,c),t.lineTo(u+p,c),t.quadraticCurveTo(u+y,c,u,c+m),t.closePath()};var dw=Math.sin(0),hw=Math.cos(0),Hp={},Gp={},oT=Math.PI/40;for(var Es=0*Math.PI;Es<2*Math.PI;Es+=oT)Hp[Es]=Math.sin(Es),Gp[Es]=Math.cos(Es);$i.drawEllipsePath=function(t,e,n,r,i){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,n,r/2,i/2,0,0,2*Math.PI);else for(var l,s,u=r/2,f=i/2,c=0*Math.PI;c<2*Math.PI;c+=oT)l=e-u*Hp[c]*dw+u*Gp[c]*hw,s=n+f*Gp[c]*dw+f*Hp[c]*hw,c===0?t.moveTo(l,s):t.lineTo(l,s);t.closePath()};var Ou={};Ou.createBuffer=function(t,e){var n=document.createElement("canvas");return n.width=t,n.height=e,[n,n.getContext("2d")]};Ou.bufferCanvasImage=function(t){var e=this.cy,n=e.mutableElements(),r=n.boundingBox(),i=this.findContainerClientCoords(),l=t.full?Math.ceil(r.w):i[2],s=t.full?Math.ceil(r.h):i[3],u=Ge(t.maxWidth)||Ge(t.maxHeight),f=this.getPixelRatio(),c=1;if(t.scale!==void 0)l*=t.scale,s*=t.scale,c=t.scale;else if(u){var h=1/0,v=1/0;Ge(t.maxWidth)&&(h=c*t.maxWidth/l),Ge(t.maxHeight)&&(v=c*t.maxHeight/s),c=Math.min(h,v),l*=c,s*=c}u||(l*=f,s*=f,c*=f);var p=document.createElement("canvas");p.width=l,p.height=s,p.style.width=l+"px",p.style.height=s+"px";var m=p.getContext("2d");if(l>0&&s>0){m.clearRect(0,0,l,s),m.globalCompositeOperation="source-over";var y=this.getCachedZSortedEles();if(t.full)m.translate(-r.x1*c,-r.y1*c),m.scale(c,c),this.drawElements(m,y),m.scale(1/c,1/c),m.translate(r.x1*c,r.y1*c);else{var S=e.pan(),w={x:S.x*c,y:S.y*c};c*=e.zoom(),m.translate(w.x,w.y),m.scale(c,c),this.drawElements(m,y),m.scale(1/c,1/c),m.translate(-w.x,-w.y)}t.bg&&(m.globalCompositeOperation="destination-over",m.fillStyle=t.bg,m.rect(0,0,l,s),m.fill())}return p};function rL(t,e){for(var n=atob(t),r=new ArrayBuffer(n.length),i=new Uint8Array(r),l=0;l<n.length;l++)i[l]=n.charCodeAt(l);return new Blob([r],{type:e})}function vw(t){var e=t.indexOf(",");return t.substr(e+1)}function uT(t,e,n){var r=function(){return e.toDataURL(n,t.quality)};switch(t.output){case"blob-promise":return new qs(function(i,l){try{e.toBlob(function(s){s!=null?i(s):l(new Error("`canvas.toBlob()` sent a null value in its callback"))},n,t.quality)}catch(s){l(s)}});case"blob":return rL(vw(r()),n);case"base64":return vw(r());default:return r()}}Ou.png=function(t){return uT(t,this.bufferCanvasImage(t),"image/png")};Ou.jpg=function(t){return uT(t,this.bufferCanvasImage(t),"image/jpeg")};var cT={};cT.nodeShapeImpl=function(t,e,n,r,i,l,s,u){switch(t){case"ellipse":return this.drawEllipsePath(e,n,r,i,l);case"polygon":return this.drawPolygonPath(e,n,r,i,l,s);case"round-polygon":return this.drawRoundPolygonPath(e,n,r,i,l,s,u);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,n,r,i,l,u);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,n,r,i,l,s,u);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,n,r,i,l,u);case"barrel":return this.drawBarrelPath(e,n,r,i,l)}};var aL=fT,kt=fT.prototype;kt.CANVAS_LAYERS=3;kt.SELECT_BOX=0;kt.DRAG=1;kt.NODE=2;kt.WEBGL=3;kt.CANVAS_TYPES=["2d","2d","2d","webgl2"];kt.BUFFER_COUNT=3;kt.TEXTURE_BUFFER=0;kt.MOTIONBLUR_BUFFER_NODE=1;kt.MOTIONBLUR_BUFFER_DRAG=2;function fT(t){var e=this,n=e.cy.window(),r=n.document;t.webgl&&(kt.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(kt.CANVAS_LAYERS),contexts:new Array(kt.CANVAS_LAYERS),canvasNeedsRedraw:new Array(kt.CANVAS_LAYERS),bufferCanvases:new Array(kt.BUFFER_COUNT),bufferContexts:new Array(kt.CANVAS_LAYERS)};var i="-webkit-tap-highlight-color",l="rgba(0,0,0,0)";e.data.canvasContainer=r.createElement("div");var s=e.data.canvasContainer.style;e.data.canvasContainer.style[i]=l,s.position="relative",s.zIndex="0",s.overflow="hidden";var u=t.cy.container();u.appendChild(e.data.canvasContainer),u.style[i]=l;var f={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};WN()&&(f["-ms-touch-action"]="none",f["touch-action"]="none");for(var c=0;c<kt.CANVAS_LAYERS;c++){var h=e.data.canvases[c]=r.createElement("canvas"),v=kt.CANVAS_TYPES[c];e.data.contexts[c]=h.getContext(v),e.data.contexts[c]||gn("Could not create canvas of type "+v),Object.keys(f).forEach(function(pe){h.style[pe]=f[pe]}),h.style.position="absolute",h.setAttribute("data-id","layer"+c),h.style.zIndex=String(kt.CANVAS_LAYERS-c),e.data.canvasContainer.appendChild(h),e.data.canvasNeedsRedraw[c]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[kt.NODE].setAttribute("data-id","layer"+kt.NODE+"-node"),e.data.canvases[kt.SELECT_BOX].setAttribute("data-id","layer"+kt.SELECT_BOX+"-selectbox"),e.data.canvases[kt.DRAG].setAttribute("data-id","layer"+kt.DRAG+"-drag"),e.data.canvases[kt.WEBGL]&&e.data.canvases[kt.WEBGL].setAttribute("data-id","layer"+kt.WEBGL+"-webgl");for(var c=0;c<kt.BUFFER_COUNT;c++)e.data.bufferCanvases[c]=r.createElement("canvas"),e.data.bufferContexts[c]=e.data.bufferCanvases[c].getContext("2d"),e.data.bufferCanvases[c].style.position="absolute",e.data.bufferCanvases[c].setAttribute("data-id","buffer"+c),e.data.bufferCanvases[c].style.zIndex=String(-c-1),e.data.bufferCanvases[c].style.visibility="hidden";e.pathsEnabled=!0;var p=br(),m=function(ee){return{x:(ee.x1+ee.x2)/2,y:(ee.y1+ee.y2)/2}},y=function(ee){return{x:-ee.w/2,y:-ee.h/2}},S=function(ee){var le=ee[0]._private,fe=le.oldBackgroundTimestamp===le.backgroundTimestamp;return!fe},w=function(ee){return ee[0]._private.nodeKey},E=function(ee){return ee[0]._private.labelStyleKey},C=function(ee){return ee[0]._private.sourceLabelStyleKey},T=function(ee){return ee[0]._private.targetLabelStyleKey},A=function(ee,le,fe,xe,Re){return e.drawElement(ee,le,fe,!1,!1,Re)},k=function(ee,le,fe,xe,Re){return e.drawElementText(ee,le,fe,xe,"main",Re)},N=function(ee,le,fe,xe,Re){return e.drawElementText(ee,le,fe,xe,"source",Re)},_=function(ee,le,fe,xe,Re){return e.drawElementText(ee,le,fe,xe,"target",Re)},O=function(ee){return ee.boundingBox(),ee[0]._private.bodyBounds},U=function(ee){return ee.boundingBox(),ee[0]._private.labelBounds.main||p},M=function(ee){return ee.boundingBox(),ee[0]._private.labelBounds.source||p},I=function(ee){return ee.boundingBox(),ee[0]._private.labelBounds.target||p},P=function(ee,le){return le},j=function(ee){return m(O(ee))},K=function(ee,le,fe){var xe=ee?ee+"-":"";return{x:le.x+fe.pstyle(xe+"text-margin-x").pfValue,y:le.y+fe.pstyle(xe+"text-margin-y").pfValue}},$=function(ee,le,fe){var xe=ee[0]._private.rscratch;return{x:xe[le],y:xe[fe]}},B=function(ee){return K("",$(ee,"labelX","labelY"),ee)},H=function(ee){return K("source",$(ee,"sourceLabelX","sourceLabelY"),ee)},Y=function(ee){return K("target",$(ee,"targetLabelX","targetLabelY"),ee)},Q=function(ee){return y(O(ee))},z=function(ee){return y(M(ee))},F=function(ee){return y(I(ee))},q=function(ee){var le=U(ee),fe=y(U(ee));if(ee.isNode()){switch(ee.pstyle("text-halign").value){case"left":fe.x=-le.w-(le.leftPad||0);break;case"right":fe.x=-(le.rightPad||0);break}switch(ee.pstyle("text-valign").value){case"top":fe.y=-le.h-(le.topPad||0);break;case"bottom":fe.y=-(le.botPad||0);break}}return fe},L=e.data.eleTxrCache=new nu(e,{getKey:w,doesEleInvalidateKey:S,drawElement:A,getBoundingBox:O,getRotationPoint:j,getRotationOffset:Q,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),W=e.data.lblTxrCache=new nu(e,{getKey:E,drawElement:k,getBoundingBox:U,getRotationPoint:B,getRotationOffset:q,isVisible:P}),ae=e.data.slbTxrCache=new nu(e,{getKey:C,drawElement:N,getBoundingBox:M,getRotationPoint:H,getRotationOffset:z,isVisible:P}),se=e.data.tlbTxrCache=new nu(e,{getKey:T,drawElement:_,getBoundingBox:I,getRotationPoint:Y,getRotationOffset:F,isVisible:P}),me=e.data.lyrTxrCache=new WC(e);e.onUpdateEleCalcs(function(ee,le){L.invalidateElements(le),W.invalidateElements(le),ae.invalidateElements(le),se.invalidateElements(le),me.invalidateElements(le);for(var fe=0;fe<le.length;fe++){var xe=le[fe]._private;xe.oldBackgroundTimestamp=xe.backgroundTimestamp}});var Ne=function(ee){for(var le=0;le<ee.length;le++)me.enqueueElementRefinement(ee[le].ele)};L.onDequeue(Ne),W.onDequeue(Ne),ae.onDequeue(Ne),se.onDequeue(Ne),t.webgl&&e.initWebgl(t,{getStyleKey:w,getLabelKey:E,getSourceLabelKey:C,getTargetLabelKey:T,drawElement:A,drawLabel:k,drawSourceLabel:N,drawTargetLabel:_,getElementBox:O,getLabelBox:U,getSourceLabelBox:M,getTargetLabelBox:I,getElementRotationPoint:j,getElementRotationOffset:Q,getLabelRotationPoint:B,getSourceLabelRotationPoint:H,getTargetLabelRotationPoint:Y,getLabelRotationOffset:q,getSourceLabelRotationOffset:z,getTargetLabelRotationOffset:F})}kt.redrawHint=function(t,e){var n=this;switch(t){case"eles":n.data.canvasNeedsRedraw[kt.NODE]=e;break;case"drag":n.data.canvasNeedsRedraw[kt.DRAG]=e;break;case"select":n.data.canvasNeedsRedraw[kt.SELECT_BOX]=e;break;case"gc":n.data.gc=!0;break}};var iL=typeof Path2D<"u";kt.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};kt.usePaths=function(){return iL&&this.pathsEnabled};kt.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)};kt.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};kt.makeOffscreenCanvas=function(t,e){var n;if((typeof OffscreenCanvas>"u"?"undefined":Gn(OffscreenCanvas))!=="undefined")n=new OffscreenCanvas(t,e);else{var r=this.cy.window(),i=r.document;n=i.createElement("canvas"),n.width=t,n.height=e}return n};[JC,Aa,Wa,_m,kl,Vi,xr,aT,$i,Ou,cT].forEach(function(t){vt(kt,t)});var lL=[{name:"null",impl:PC},{name:"base",impl:XC},{name:"canvas",impl:aL}],sL=[{type:"layout",extensions:MO},{type:"renderer",extensions:lL}],dT={},hT={};function vT(t,e,n){var r=n,i=function(O){$t("Can not register `"+e+"` for `"+t+"` since `"+O+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(mu.prototype[e])return i(e);mu.prototype[e]=n}else if(t==="collection"){if(ar.prototype[e])return i(e);ar.prototype[e]=n}else if(t==="layout"){for(var l=function(O){this.options=O,n.call(this,O),Ut(this._private)||(this._private={}),this._private.cy=O.cy,this._private.listeners=[],this.createEmitter()},s=l.prototype=Object.create(n.prototype),u=[],f=0;f<u.length;f++){var c=u[f];s[c]=s[c]||function(){return this}}s.start&&!s.run?s.run=function(){return this.start(),this}:!s.start&&s.run&&(s.start=function(){return this.run(),this});var h=n.prototype.stop;s.stop=function(){var _=this.options;if(_&&_.animate){var O=this.animations;if(O)for(var U=0;U<O.length;U++)O[U].stop()}return h?h.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var v=function(O){return O._private.cy},p={addEventFields:function(O,U){U.layout=O,U.cy=v(O),U.target=O},bubble:function(){return!0},parent:function(O){return v(O)}};vt(s,{createEmitter:function(){return this._private.emitter=new ud(p,this),this},emitter:function(){return this._private.emitter},on:function(O,U){return this.emitter().on(O,U),this},one:function(O,U){return this.emitter().one(O,U),this},once:function(O,U){return this.emitter().one(O,U),this},removeListener:function(O,U){return this.emitter().removeListener(O,U),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(O,U){return this.emitter().emit(O,U),this}}),Vt.eventAliasesOn(s),r=l}else if(t==="renderer"&&e!=="null"&&e!=="base"){var m=gT("renderer","base"),y=m.prototype,S=n,w=n.prototype,E=function(){m.apply(this,arguments),S.apply(this,arguments)},C=E.prototype;for(var T in y){var A=y[T],k=w[T]!=null;if(k)return i(T);C[T]=A}for(var N in w)C[N]=w[N];y.clientFunctions.forEach(function(_){C[_]=C[_]||function(){gn("Renderer does not implement `renderer."+_+"()` on its prototype")}}),r=E}else if(t==="__proto__"||t==="constructor"||t==="prototype")return gn(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return OS({map:dT,keys:[t,e],value:r})}function gT(t,e){return BS({map:dT,keys:[t,e]})}function oL(t,e,n,r,i){return OS({map:hT,keys:[t,e,n,r],value:i})}function uL(t,e,n,r){return BS({map:hT,keys:[t,e,n,r]})}var Vp=function(){if(arguments.length===2)return gT.apply(null,arguments);if(arguments.length===3)return vT.apply(null,arguments);if(arguments.length===4)return uL.apply(null,arguments);if(arguments.length===5)return oL.apply(null,arguments);gn("Invalid extension access syntax")};mu.prototype.extension=Vp;sL.forEach(function(t){t.extensions.forEach(function(e){vT(t.type,e.name,e.impl)})});var $f=function(){if(!(this instanceof $f))return new $f;this.length=0},Dl=$f.prototype;Dl.instanceString=function(){return"stylesheet"};Dl.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this};Dl.css=function(t,e){var n=this.length-1;if(ct(t))this[n].properties.push({name:t,value:e});else if(Ut(t))for(var r=t,i=Object.keys(r),l=0;l<i.length;l++){var s=i[l],u=r[s];if(u!=null){var f=Xn.properties[s]||Xn.properties[Jf(s)];if(f!=null){var c=f.name,h=u;this[n].properties.push({name:c,value:h})}}}return this};Dl.style=Dl.css;Dl.generateStyle=function(t){var e=new Xn(t);return this.appendToStyle(e)};Dl.appendToStyle=function(t){for(var e=0;e<this.length;e++){var n=this[e],r=n.selector,i=n.properties;t.selector(r);for(var l=0;l<i.length;l++){var s=i[l];t.css(s.name,s.value)}}return t};var cL="3.33.2",Al=function(e){if(e===void 0&&(e={}),Ut(e))return new mu(e);if(ct(e))return Vp.apply(Vp,arguments)};Al.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Al),t.apply(null,e),this};Al.warnings=function(t){return qS(t)};Al.version=cL;Al.stylesheet=Al.Stylesheet=$f;const fL=[{id:"source",label:"Source",color:"#f59e0b",shape:"shape-round"},{id:"module",label:"Module",color:"#fb7185",shape:""},{id:"symbol",label:"Symbol",color:"#8b5cf6",shape:"shape-diamond"},{id:"rationale",label:"Rationale",color:"#14b8a6",shape:"shape-hex"},{id:"concept",label:"Concept",color:"#0ea5e9",shape:""},{id:"entity",label:"Entity",color:"#22c55e",shape:"shape-round"}],dL=[{label:"Structural (extracted)",color:"rgba(148, 163, 184, 0.7)",style:"line-solid"},{label:"Inferred",color:"rgba(56, 189, 248, 0.7)",style:"line-solid"},{label:"Conflicted",color:"var(--c-text-error)",style:"line-solid"},{label:"Similarity",color:"rgba(249, 115, 22, 0.7)",style:"line-dashed"}];function hL(){const[t,e]=ge.useState(!0);return t?D.jsxs("aside",{className:"canvas-legend","aria-label":"Graph legend",children:[D.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[D.jsx("span",{className:"canvas-legend-heading",children:"Legend"}),D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>e(!1),"aria-label":"Hide legend",title:"Hide legend",children:"Γ"})]}),D.jsxs("div",{className:"canvas-legend-group",children:[D.jsx("span",{className:"label",children:"Nodes"}),fL.map(n=>D.jsxs("div",{className:"legend-row",children:[D.jsx("span",{className:`legend-swatch ${n.shape}`,style:{background:n.color},"aria-hidden":"true"}),D.jsx("span",{children:n.label})]},n.id))]}),D.jsxs("div",{className:"canvas-legend-group",style:{marginTop:"var(--sp-2)"},children:[D.jsx("span",{className:"label",children:"Edges"}),dL.map(n=>D.jsxs("div",{className:"legend-row",children:[D.jsx("span",{className:`legend-swatch ${n.style}`,style:{color:n.color},"aria-hidden":"true"}),D.jsx("span",{children:n.label})]},n.label))]})]}):D.jsx("button",{type:"button",className:"btn legend-toggle",onClick:()=>e(!0),title:"Show legend","aria-label":"Show legend",children:"Legend"})}const Ai=180,_i=120;function vL({cyRef:t}){const e=ge.useRef(null),n=ge.useRef(null),[r,i]=ge.useState(null);ge.useEffect(()=>{const s=t.current;if(!s)return;const u=()=>{const c=n.current?.getContext("2d");if(!c)return;c.clearRect(0,0,Ai,_i);const h=s.nodes();if(h.empty())return;const v=h.boundingBox({includeNodes:!0,includeEdges:!1}),p=v.w===0?1:v.w,m=v.h===0?1:v.h,y=Math.min((Ai-8)/p,(_i-8)/m),S=(Ai-p*y)/2,w=(_i-m*y)/2;c.fillStyle="rgba(125, 211, 252, 0.7)",h.forEach(N=>{const _=N.position(),O=(_.x-v.x1)*y+S,U=(_.y-v.y1)*y+w;c.beginPath(),c.arc(O,U,1.4,0,Math.PI*2),c.fill()});const E=s.extent(),C=(E.x1-v.x1)*y+S,T=(E.y1-v.y1)*y+w,A=(E.x2-E.x1)*y,k=(E.y2-E.y1)*y;i({x:Math.max(0,Math.min(Ai,C)),y:Math.max(0,Math.min(_i,T)),w:Math.max(2,Math.min(Ai,A)),h:Math.max(2,Math.min(_i,k))})};u();const f=()=>requestAnimationFrame(u);return s.on("pan zoom add remove position layoutstop",f),()=>{s.off("pan zoom add remove position layoutstop",f)}},[t]);const l=s=>{const u=t.current;if(!u||!e.current)return;const f=e.current.getBoundingClientRect(),c=s.clientX-f.left,h=s.clientY-f.top,v=u.nodes();if(v.empty())return;const p=v.boundingBox({includeNodes:!0,includeEdges:!1}),m=Math.min((Ai-8)/Math.max(1,p.w),(_i-8)/Math.max(1,p.h)),y=(Ai-p.w*m)/2,S=(_i-p.h*m)/2,w=(c-y)/m+p.x1,E=(h-S)/m+p.y1;u.center({position:()=>({x:w,y:E})})};return D.jsxs("div",{ref:e,className:"canvas-minimap",role:"presentation",onClick:l,"aria-hidden":"true",children:[D.jsx("canvas",{ref:n,width:Ai,height:_i,style:{width:"100%",height:"100%"}}),r?D.jsx("div",{className:"canvas-minimap-viewport",style:{left:r.x,top:r.y,width:r.w,height:r.h}}):null]})}function gL(t,e){const n=[],r=[];for(const i of t.hyperedges??[]){const l=i.nodeIds.filter(u=>e.has(u));if(l.length<2)continue;const s=`hyper:${i.id}`;n.push({data:{id:s,label:i.relation,hyperedgeId:i.id,relation:i.relation,isHub:!0,color:"#a78bfa"},classes:"hyper"});for(const u of l)r.push({data:{id:`hyper-edge:${i.id}:${u}`,source:s,target:u,relation:i.relation,hyperedgeId:i.id,isHubEdge:!0},classes:"hyperEdge"})}return{hubNodes:n,hubEdges:r}}function pL(t){typeof window>"u"||(window.__SWARMVAULT_TEST__={getNodeIds:()=>t.nodes().map(e=>e.id()),getConnectedNodePair:()=>{const e=t.edges()[0];return!e||e.empty()?null:{from:e.source().id(),to:e.target().id()}},getRenderedNodePosition:e=>{const n=t.getElementById(e);if(!n||n.empty())return null;const r=n.renderedPosition();return{x:r.x,y:r.y}},clearSelection:()=>{t.elements(":selected").unselect()},hasClass:(e,n)=>{const r=t.getElementById(e);return!r.empty()&&r.hasClass(n)}})}function mL(t,e){typeof window>"u"||!window.__SWARMVAULT_TEST__||e===t&&delete window.__SWARMVAULT_TEST__}const yL={source:"#f59e0b",module:"#fb7185",symbol:"#8b5cf6",rationale:"#14b8a6",concept:"#0ea5e9",entity:"#22c55e"},bL={cose:"Force (cose)",concentric:"Concentric",circle:"Circle",breadthfirst:"Hierarchy",grid:"Grid"},EL={cose:{name:"cose",animate:!1,idealEdgeLength:280,nodeRepulsion:12e4,nodeOverlap:60,gravity:.08,nestingFactor:1.2,edgeElasticity:100,numIter:3e3},concentric:{name:"concentric",animate:!1,minNodeSpacing:30,levelWidth:()=>1},circle:{name:"circle",animate:!1,radius:320},breadthfirst:{name:"breadthfirst",animate:!1,spacingFactor:1.4,directed:!0},grid:{name:"grid",animate:!1,padding:40}};function xL({graph:t,edgeStatusFilter:e,communityFilter:n,sourceClassFilter:r,selectedTags:i=[],pathResult:l,onNodeSelect:s,cyRef:u,fitTrigger:f,pageTags:c,onLayoutChange:h}){const v=ge.useRef(null),[p,m]=ge.useState("cose"),[y,S]=ge.useState("auto"),[w,E]=ge.useState(!0),C=ge.useEffectEvent(M=>{s(M)}),T=ge.useEffectEvent(M=>{u.current?.destroy(),u.current=M}),A=ge.useEffectEvent(M=>{u.current===M&&(u.current=null),M.destroy()}),k=ge.useEffectEvent(M=>{const I=u.current;if(I&&(I.elements().removeClass("path-node path-edge"),M)){for(const P of M.nodeIds)I.getElementById(P).addClass("path-node");for(const P of M.edgeIds)I.getElementById(P).addClass("path-edge")}}),N=ge.useEffectEvent(()=>{u.current?.resize()}),_=(()=>{if(!t||i.length===0||!c)return null;const M=new Set;for(const I of t.nodes){if(!I.pageId)continue;const P=c[I.pageId]??[];i.every(j=>P.includes(j))&&M.add(I.id)}return M})();ge.useEffect(()=>{if(!v.current||!t)return;const M=new Set(t.nodes.filter(B=>n==="all"||B.communityId===n).filter(B=>r==="all"||(B.sourceClass??"")===r).filter(B=>!_||_.has(B.id)).map(B=>B.id)),I=y==="always"?"data(label)":y==="never"?"":"data(label)",P=y==="always"?0:y==="never"?999:.5,{hubNodes:j,hubEdges:K}=w?gL(t,M):{hubNodes:[],hubEdges:[]},$=Al({container:v.current,elements:[...t.nodes.filter(B=>M.has(B.id)).map(B=>({data:{...B,color:yL[B.type]??"#94a3b8"}})),...j,...t.edges.filter(B=>M.has(B.source)&&M.has(B.target)).filter(B=>e==="all"||B.status===e).map(B=>({data:B,classes:[B.relation==="semantically_similar_to"?"similarity-edge":"",B.status==="conflicted"?"conflicted-edge":"",B.status==="inferred"?"inferred-edge":""].filter(Boolean).join(" ")})),...K],layout:EL[p],style:[{selector:"node",style:{label:I,"background-color":"data(color)","background-opacity":.85,color:"var(--c-text-primary)","font-family":'"Inter", "Segoe UI", system-ui, sans-serif',"font-size":11,"font-weight":"normal","text-halign":"center","text-valign":"bottom","text-margin-y":7,"text-max-width":"100px","text-wrap":"ellipsis","min-zoomed-font-size":P,"text-background-opacity":.55,"text-background-color":"var(--c-bg-base)","text-background-padding":"2px","text-background-shape":"roundrectangle","border-width":0,"overlay-padding":4}},{selector:"node[?isGodNode]",style:{width:56,height:56,"border-width":1.5,"border-color":"rgba(254, 240, 138, 0.65)","border-opacity":1,"background-opacity":1,"font-size":12,"font-weight":"bold","text-max-width":"140px","z-index":12}},{selector:'node[type = "module"]',style:{shape:"round-rectangle",width:44,height:28,"z-index":8}},{selector:'node[type = "symbol"]',style:{shape:"diamond",width:20,height:20,"background-opacity":.6}},{selector:'node[type = "rationale"]',style:{shape:"hexagon",width:28,height:28,"background-opacity":.75}},{selector:'node[type = "source"]',style:{shape:"ellipse",width:32,height:32,"background-opacity":.95,"z-index":10}},{selector:'node[type = "concept"]',style:{shape:"round-rectangle",width:34,height:22,"background-opacity":.7}},{selector:'node[type = "entity"]',style:{shape:"ellipse",width:26,height:26,"background-opacity":.7}},{selector:"edge",style:{width:.8,"line-color":"rgba(71, 85, 105, 0.45)","target-arrow-shape":"triangle-backcurve","target-arrow-color":"rgba(71, 85, 105, 0.45)","arrow-scale":.6,"curve-style":"bezier","font-size":8,"text-background-opacity":0,"text-background-color":"var(--c-bg-base)","text-background-padding":"2px","text-background-shape":"roundrectangle","text-rotation":"autorotate","text-margin-y":-8}},{selector:"edge:selected",style:{label:"data(relation)",width:2,"text-background-opacity":.7}},{selector:".similarity-edge",style:{"line-style":"dashed","line-color":"rgba(249, 115, 22, 0.5)","target-arrow-color":"rgba(249, 115, 22, 0.5)","line-dash-pattern":[6,4]}},{selector:".inferred-edge",style:{"line-color":"rgba(56, 189, 248, 0.6)","target-arrow-color":"rgba(56, 189, 248, 0.6)"}},{selector:".conflicted-edge",style:{"line-color":"rgba(248, 113, 113, 0.7)","target-arrow-color":"rgba(248, 113, 113, 0.7)",width:1.5}},{selector:".path-node",style:{"border-width":3,"border-color":"#38bdf8","background-opacity":1,"z-index":100}},{selector:".path-edge",style:{width:2.5,"line-color":"#38bdf8","target-arrow-color":"#38bdf8",label:"data(relation)","text-background-opacity":.7,"z-index":100}},{selector:":selected",style:{"border-width":2,"border-color":"#e2e8f0"}},{selector:"node:active",style:{"overlay-color":"#38bdf8","overlay-opacity":.12}},{selector:"node.hyper",style:{shape:"round-rectangle",width:18,height:14,"background-color":"#0f172a","background-opacity":.85,"border-width":1.5,"border-color":"#a78bfa","border-style":"dashed",color:"#c4b5fd","font-size":9,"font-weight":"normal","text-max-width":"120px","z-index":4}},{selector:"edge.hyperEdge",style:{width:.8,"line-color":"rgba(167, 139, 250, 0.55)","line-style":"dashed","line-dash-pattern":[4,3],"target-arrow-shape":"none","curve-style":"straight"}}]});return $.on("select","node",B=>C(B.target.data())),$.on("unselect","node",()=>C(null)),$.on("tap",B=>{B.target===$&&($.elements(":selected").unselect(),C(null))}),$.on("mouseover","edge",B=>{B.target.style("label",B.target.data("relation")??""),B.target.style("width",1.8),B.target.style("z-index",999)}),$.on("mouseout","edge",B=>{!B.target.selected()&&!B.target.hasClass("path-edge")&&(B.target.removeStyle("label"),B.target.removeStyle("width"),B.target.removeStyle("z-index"))}),$.on("mouseover","node",B=>{B.target.style("text-max-width","200px"),B.target.style("text-wrap","wrap"),B.target.style("z-index",999)}),$.on("mouseout","node",B=>{B.target.selected()||(B.target.removeStyle("text-max-width"),B.target.removeStyle("text-wrap"),B.target.removeStyle("z-index"))}),T($),pL($),()=>{mL($,u.current),A($)}},[n,e,t,r,p,y,_,u,w]),ge.useEffect(()=>{k(l)},[l]),ge.useEffect(()=>{const M=v.current;if(!M)return;const I=new ResizeObserver(()=>N());return I.observe(M),()=>I.disconnect()},[]),ge.useEffect(()=>{f!=null&&u.current?.fit(void 0,30)},[f,u.current?.fit]);const O=()=>u.current?.fit(void 0,30),U=()=>u.current?.reset();return D.jsxs("div",{className:"canvas-wrap",children:[D.jsxs("div",{className:"canvas-toolbar",role:"toolbar","aria-label":"Graph view controls",children:[D.jsxs("div",{className:"canvas-toolbar-group",children:[D.jsx("label",{htmlFor:"layout-select",className:"label",children:"Layout"}),D.jsx("select",{id:"layout-select",className:"input",value:p,onChange:M=>{const I=M.target.value;m(I),h?.(I)},children:Object.entries(bL).map(([M,I])=>D.jsx("option",{value:M,children:I},M))})]}),D.jsxs("div",{className:"canvas-toolbar-group",children:[D.jsx("label",{htmlFor:"label-mode",className:"label",children:"Labels"}),D.jsxs("select",{id:"label-mode",className:"input",value:y,onChange:M=>S(M.target.value),children:[D.jsx("option",{value:"auto",children:"Auto"}),D.jsx("option",{value:"always",children:"Always"}),D.jsx("option",{value:"never",children:"Never"})]})]}),D.jsx("div",{className:"canvas-toolbar-group",children:D.jsxs("label",{className:"label",htmlFor:"hyperedge-toggle",children:[D.jsx("input",{id:"hyperedge-toggle",type:"checkbox","data-testid":"hyperedge-toggle","aria-label":"Show hyperedges",checked:w,onChange:M=>E(M.target.checked)})," ","Show hyperedges"]})}),D.jsxs("div",{className:"canvas-toolbar-group",children:[D.jsx("button",{type:"button",className:"btn",onClick:O,title:"Fit to viewport (F)",children:"Fit"}),D.jsx("button",{type:"button",className:"btn",onClick:U,title:"Reset zoom",children:"Reset"})]})]}),D.jsx("div",{className:"canvas","data-testid":"graph-canvas",ref:v}),D.jsx(hL,{}),D.jsx(vL,{cyRef:u})]})}function wL({graphQueryInput:t,onGraphQueryInputChange:e,onRunQuery:n,graphQueryResult:r,pathFrom:i,onPathFromChange:l,pathTo:s,onPathToChange:u,onHighlightPath:f,pathResult:c,graphError:h,graph:v,onOpenPage:p,onNavigateNode:m}){return D.jsxs("section",{className:"panel","data-testid":"graph-tools",children:[D.jsx("h3",{className:"panel-heading",children:"Graph Tools"}),h?D.jsx("p",{className:"text-error",children:h}):null,D.jsxs("div",{className:"card-list",children:[D.jsxs("article",{className:"card",children:[D.jsx("span",{className:"label",children:"query"}),D.jsx("input",{type:"search",className:"input","data-testid":"graph-query-input","aria-label":"Graph query",value:t,onChange:y=>e(y.target.value),placeholder:"Ask a question about the graph\\u2026"}),D.jsx("button",{type:"button",className:"btn btn-primary","data-testid":"graph-query-run",onClick:n,children:"Run"}),r?D.jsxs(D.Fragment,{children:[D.jsx("p",{className:"text-secondary text-sm",children:r.summary}),D.jsxs("div",{className:"chip-row",children:[r.hyperedgeIds.map(y=>v?.hyperedges?.find(S=>S.id===y)).filter(y=>!!y).slice(0,2).map(y=>D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{const S=y.nodeIds[0];S&&m(S)},children:y.label},y.id)),r.pageIds.map(y=>v?.pages?.find(S=>S.id===y)).filter(y=>!!y).slice(0,4).map(y=>D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{p(y.path,y.id)},children:y.title},y.id))]})]}):null]}),D.jsxs("article",{className:"card",children:[D.jsx("span",{className:"label",children:"path"}),D.jsx("input",{type:"text",className:"input","data-testid":"graph-path-from","aria-label":"Path from node",value:i,onChange:y=>l(y.target.value),placeholder:"From node ID or label\\u2026"}),D.jsx("input",{type:"text",className:"input","data-testid":"graph-path-to","aria-label":"Path to node",value:s,onChange:y=>u(y.target.value),placeholder:"To node ID or label\\u2026"}),D.jsx("button",{type:"button",className:"btn btn-primary","data-testid":"graph-path-highlight",onClick:f,children:"Highlight"}),c?D.jsx("p",{className:"text-secondary text-sm","data-testid":"graph-path-summary",children:c.summary}):null]})]})]})}const SL={error:"is-error",warning:"is-warning",info:"is-info"};function CL({findings:t,error:e,onOpenPage:n}){if(e)return D.jsxs("section",{className:"panel","aria-label":"Lint findings",children:[D.jsx("h3",{className:"panel-heading",children:"Lint Findings"}),D.jsx("p",{className:"text-error",children:e})]});if(!t.length)return D.jsxs("section",{className:"panel","aria-label":"Lint findings",children:[D.jsx("h3",{className:"panel-heading",children:"Lint Findings"}),D.jsxs("p",{className:"text-muted text-sm",children:["No lint findings. Run ",D.jsx("code",{children:"swarmvault lint --deep"})," for a fresh sweep."]})]});const r=t.reduce((i,l)=>{const s=i[l.category]??[];return s.push(l),i[l.category]=s,i},{});return D.jsxs("section",{className:"panel","aria-label":"Lint findings",children:[D.jsxs("h3",{className:"panel-heading",children:["Lint Findings ",D.jsxs("span",{className:"panel-meta",children:[t.length," total"]})]}),D.jsx("div",{className:"card-list",children:Object.entries(r).map(([i,l])=>D.jsxs("div",{children:[D.jsxs("p",{className:"label",style:{marginBottom:4},children:[i," Β· ",l.length]}),D.jsxs("div",{className:"card-list",children:[l.slice(0,12).map(s=>D.jsxs("article",{className:`lint-finding ${SL[s.severity]}`,children:[D.jsx("strong",{className:"text-sm",children:s.message}),s.pagePath?D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{n(s.pagePath??"",s.pageId)},children:"Open page"}):null]},s.id)),l.length>12?D.jsxs("p",{className:"text-muted text-sm",children:["+",l.length-12," more"]}):null]})]},i))})]})}function TL(t){const e="/wiki/",n=t.lastIndexOf(e);return n>=0?t.slice(n+e.length):t}function DL(t){const e=new Date(t);return Number.isNaN(e.getTime())?t:e.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}const gw={active:0,blocked:1,completed:2,archived:3};function AL(t){return t==="completed"?"chip chip-success":t==="blocked"?"chip chip-warning":t==="archived"?"chip":"chip chip-tag"}function _L({tasks:t,memoryError:e,onOpenPage:n,onNavigateNode:r}){const[i,l]=ge.useState("all"),[s,u]=ge.useState(""),f=ge.useMemo(()=>({active:t.filter(h=>h.status==="active").length,blocked:t.filter(h=>h.status==="blocked").length,completed:t.filter(h=>h.status==="completed").length,archived:t.filter(h=>h.status==="archived").length}),[t]),c=ge.useMemo(()=>{const h=s.trim().toLowerCase();return[...t].filter(v=>i==="all"?!0:v.status===i).filter(v=>h?[v.title,v.goal,v.target,v.agent,...v.changedPaths].filter(Boolean).join(" ").toLowerCase().includes(h):!0).sort((v,p)=>gw[v.status]-gw[p.status]||p.updatedAt.localeCompare(v.updatedAt)||v.title.localeCompare(p.title))},[s,i,t]);return D.jsxs("div",{children:[e?D.jsx("p",{className:"text-error",children:e}):null,D.jsxs("div",{className:"chip-row",children:[D.jsxs("span",{className:"chip chip-tag",children:[f.active," active"]}),D.jsxs("span",{className:"chip chip-warning",children:[f.blocked," blocked"]}),D.jsxs("span",{className:"chip chip-success",children:[f.completed," completed"]}),D.jsxs("span",{className:"chip",children:[f.archived," archived"]})]}),t.length?D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:"list-filter-bar",style:{marginTop:8},children:[D.jsx("input",{type:"search",className:"input",placeholder:"Filter memory tasks...",value:s,onChange:h=>u(h.target.value),"aria-label":"Filter memory tasks"}),D.jsxs("select",{className:"input",value:i,onChange:h=>l(h.target.value),"aria-label":"Filter memory tasks by status",style:{width:"auto"},children:[D.jsx("option",{value:"all",children:"All statuses"}),D.jsx("option",{value:"active",children:"Active"}),D.jsx("option",{value:"blocked",children:"Blocked"}),D.jsx("option",{value:"completed",children:"Completed"}),D.jsx("option",{value:"archived",children:"Archived"})]})]}),D.jsxs("div",{className:"card-list",children:[c.map(h=>{const v=TL(h.markdownPath);return D.jsxs("article",{className:"card",children:[D.jsxs("div",{className:"card-row",children:[D.jsx("span",{className:AL(h.status),children:h.status}),D.jsxs("span",{className:"label",children:["updated ",DL(h.updatedAt)]})]}),D.jsx("strong",{className:"card-title",children:h.title}),D.jsx("p",{className:"text-sm",children:h.goal}),D.jsxs("div",{className:"chip-row",children:[h.target?D.jsxs("span",{className:"chip",children:["target ",h.target]}):null,h.agent?D.jsxs("span",{className:"chip",children:["agent ",h.agent]}):null,D.jsxs("span",{className:"chip",children:[h.contextPackIds.length," packs"]}),D.jsxs("span",{className:"chip",children:[h.decisionCount," decisions"]}),D.jsxs("span",{className:"chip",children:[h.followUpCount," follow-ups"]})]}),h.changedPaths.length?D.jsx("p",{className:"text-mono text-sm",children:h.changedPaths.slice(0,3).join(", ")}):D.jsx("p",{className:"text-muted text-sm",children:"No changed paths recorded."}),D.jsxs("div",{className:"action-row",children:[D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{n(v,`memory:${h.id}`)},children:"Open page"}),D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>r(`memory:${h.id}`),children:"Related graph"})]})]},h.id)}),c.length===0?D.jsx("p",{className:"text-muted text-sm",children:"No memory tasks match the current filter."}):null]})]}):D.jsx("p",{className:"text-muted text-sm",style:{marginTop:8},children:"No memory tasks have been recorded yet."})]})}function NL(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const kL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,RL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ML={};function pw(t,e){return(ML.jsx?RL:kL).test(t)}const OL=/[ \t\n\f\r]/g;function BL(t){return typeof t=="object"?t.type==="text"?mw(t.value):!1:mw(t)}function mw(t){return t.replace(OL,"")===""}class Bu{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}Bu.prototype.normal={};Bu.prototype.property={};Bu.prototype.space=void 0;function pT(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new Bu(n,r,e)}function $p(t){return t.toLowerCase()}class Br{constructor(e,n){this.attribute=n,this.property=e}}Br.prototype.attribute="";Br.prototype.booleanish=!1;Br.prototype.boolean=!1;Br.prototype.commaOrSpaceSeparated=!1;Br.prototype.commaSeparated=!1;Br.prototype.defined=!1;Br.prototype.mustUseProperty=!1;Br.prototype.number=!1;Br.prototype.overloadedBoolean=!1;Br.prototype.property="";Br.prototype.spaceSeparated=!1;Br.prototype.space=void 0;let LL=0;const Nt=Rl(),In=Rl(),Kp=Rl(),Le=Rl(),on=Rl(),Ls=Rl(),jr=Rl();function Rl(){return 2**++LL}const Yp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Nt,booleanish:In,commaOrSpaceSeparated:jr,commaSeparated:Ls,number:Le,overloadedBoolean:Kp,spaceSeparated:on},Symbol.toStringTag,{value:"Module"})),ip=Object.keys(Yp);class km extends Br{constructor(e,n,r,i){let l=-1;if(super(e,n),yw(this,"space",i),typeof r=="number")for(;++l<ip.length;){const s=ip[l];yw(this,ip[l],(r&Yp[s])===Yp[s])}}}km.prototype.defined=!0;function yw(t,e,n){n&&(t[e]=n)}function $s(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const l=new km(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),e[r]=l,n[$p(r)]=r,n[$p(l.attribute)]=r}return new Bu(e,n,t.space)}const mT=$s({properties:{ariaActiveDescendant:null,ariaAtomic:In,ariaAutoComplete:null,ariaBusy:In,ariaChecked:In,ariaColCount:Le,ariaColIndex:Le,ariaColSpan:Le,ariaControls:on,ariaCurrent:null,ariaDescribedBy:on,ariaDetails:null,ariaDisabled:In,ariaDropEffect:on,ariaErrorMessage:null,ariaExpanded:In,ariaFlowTo:on,ariaGrabbed:In,ariaHasPopup:null,ariaHidden:In,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:on,ariaLevel:Le,ariaLive:null,ariaModal:In,ariaMultiLine:In,ariaMultiSelectable:In,ariaOrientation:null,ariaOwns:on,ariaPlaceholder:null,ariaPosInSet:Le,ariaPressed:In,ariaReadOnly:In,ariaRelevant:null,ariaRequired:In,ariaRoleDescription:on,ariaRowCount:Le,ariaRowIndex:Le,ariaRowSpan:Le,ariaSelected:In,ariaSetSize:Le,ariaSort:null,ariaValueMax:Le,ariaValueMin:Le,ariaValueNow:Le,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function yT(t,e){return e in t?t[e]:e}function bT(t,e){return yT(t,e.toLowerCase())}const FL=$s({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ls,acceptCharset:on,accessKey:on,action:null,allow:null,allowFullScreen:Nt,allowPaymentRequest:Nt,allowUserMedia:Nt,alt:null,as:null,async:Nt,autoCapitalize:null,autoComplete:on,autoFocus:Nt,autoPlay:Nt,blocking:on,capture:null,charSet:null,checked:Nt,cite:null,className:on,cols:Le,colSpan:null,content:null,contentEditable:In,controls:Nt,controlsList:on,coords:Le|Ls,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Nt,defer:Nt,dir:null,dirName:null,disabled:Nt,download:Kp,draggable:In,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Nt,formTarget:null,headers:on,height:Le,hidden:Kp,high:Le,href:null,hrefLang:null,htmlFor:on,httpEquiv:on,id:null,imageSizes:null,imageSrcSet:null,inert:Nt,inputMode:null,integrity:null,is:null,isMap:Nt,itemId:null,itemProp:on,itemRef:on,itemScope:Nt,itemType:on,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Nt,low:Le,manifest:null,max:null,maxLength:Le,media:null,method:null,min:null,minLength:Le,multiple:Nt,muted:Nt,name:null,nonce:null,noModule:Nt,noValidate:Nt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Nt,optimum:Le,pattern:null,ping:on,placeholder:null,playsInline:Nt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Nt,referrerPolicy:null,rel:on,required:Nt,reversed:Nt,rows:Le,rowSpan:Le,sandbox:on,scope:null,scoped:Nt,seamless:Nt,selected:Nt,shadowRootClonable:Nt,shadowRootDelegatesFocus:Nt,shadowRootMode:null,shape:null,size:Le,sizes:null,slot:null,span:Le,spellCheck:In,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Le,step:null,style:null,tabIndex:Le,target:null,title:null,translate:null,type:null,typeMustMatch:Nt,useMap:null,value:In,width:Le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:on,axis:null,background:null,bgColor:null,border:Le,borderColor:null,bottomMargin:Le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Nt,declare:Nt,event:null,face:null,frame:null,frameBorder:null,hSpace:Le,leftMargin:Le,link:null,longDesc:null,lowSrc:null,marginHeight:Le,marginWidth:Le,noResize:Nt,noHref:Nt,noShade:Nt,noWrap:Nt,object:null,profile:null,prompt:null,rev:null,rightMargin:Le,rules:null,scheme:null,scrolling:In,standby:null,summary:null,text:null,topMargin:Le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Le,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Nt,disableRemotePlayback:Nt,prefix:null,property:null,results:Le,security:null,unselectable:null},space:"html",transform:bT}),IL=$s({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:jr,accentHeight:Le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Le,amplitude:Le,arabicForm:null,ascent:Le,attributeName:null,attributeType:null,azimuth:Le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Le,by:null,calcMode:null,capHeight:Le,className:on,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Le,diffuseConstant:Le,direction:null,display:null,dur:null,divisor:Le,dominantBaseline:null,download:Nt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Le,enableBackground:null,end:null,event:null,exponent:Le,externalResourcesRequired:null,fill:null,fillOpacity:Le,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ls,g2:Ls,glyphName:Ls,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Le,horizOriginX:Le,horizOriginY:Le,id:null,ideographic:Le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Le,k:Le,k1:Le,k2:Le,k3:Le,k4:Le,kernelMatrix:jr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Le,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Le,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Le,overlineThickness:Le,paintOrder:null,panose1:null,path:null,pathLength:Le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:on,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Le,pointsAtY:Le,pointsAtZ:Le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:jr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:jr,rev:jr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:jr,requiredFeatures:jr,requiredFonts:jr,requiredFormats:jr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Le,specularExponent:Le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Le,strikethroughThickness:Le,string:null,stroke:null,strokeDashArray:jr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Le,strokeOpacity:Le,strokeWidth:null,style:null,surfaceScale:Le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:jr,tabIndex:Le,tableValues:null,target:null,targetX:Le,targetY:Le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:jr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Le,underlineThickness:Le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Le,values:null,vAlphabetic:Le,vMathematical:Le,vectorEffect:null,vHanging:Le,vIdeographic:Le,version:null,vertAdvY:Le,vertOriginX:Le,vertOriginY:Le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:yT}),ET=$s({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),xT=$s({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:bT}),wT=$s({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),zL={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},PL=/[A-Z]/g,bw=/-[a-z]/g,UL=/^data[-\w.:]+$/i;function qL(t,e){const n=$p(e);let r=e,i=Br;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&UL.test(e)){if(e.charAt(4)==="-"){const l=e.slice(5).replace(bw,HL);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=e.slice(4);if(!bw.test(l)){let s=l.replace(PL,jL);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=km}return new i(r,e)}function jL(t){return"-"+t.toLowerCase()}function HL(t){return t.charAt(1).toUpperCase()}const GL=pT([mT,FL,ET,xT,wT],"html"),Rm=pT([mT,IL,ET,xT,wT],"svg");function VL(t){return t.join(" ").trim()}var xs={},lp,Ew;function $L(){if(Ew)return lp;Ew=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,u=/^\s+|\s+$/g,f=`
|
|
335
|
-
`,c="/",h="*",v="",p="comment",m="declaration";function y(w,E){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];E=E||{};var C=1,T=1;function A(K){var $=K.match(e);$&&(C+=$.length);var B=K.lastIndexOf(f);T=~B?K.length-B:T+K.length}function k(){var K={line:C,column:T};return function($){return $.position=new N(K),U(),$}}function N(K){this.start=K,this.end={line:C,column:T},this.source=E.source}N.prototype.content=w;function _(K){var $=new Error(E.source+":"+C+":"+T+": "+K);if($.reason=K,$.filename=E.source,$.line=C,$.column=T,$.source=w,!E.silent)throw $}function O(K){var $=K.exec(w);if($){var B=$[0];return A(B),w=w.slice(B.length),$}}function U(){O(n)}function M(K){var $;for(K=K||[];$=I();)$!==!1&&K.push($);return K}function I(){var K=k();if(!(c!=w.charAt(0)||h!=w.charAt(1))){for(var $=2;v!=w.charAt($)&&(h!=w.charAt($)||c!=w.charAt($+1));)++$;if($+=2,v===w.charAt($-1))return _("End of comment missing");var B=w.slice(2,$-2);return T+=2,A(B),w=w.slice($),T+=2,K({type:p,comment:B})}}function P(){var K=k(),$=O(r);if($){if(I(),!O(i))return _("property missing ':'");var B=O(l),H=K({type:m,property:S($[0].replace(t,v)),value:B?S(B[0].replace(t,v)):v});return O(s),H}}function j(){var K=[];M(K);for(var $;$=P();)$!==!1&&(K.push($),M(K));return K}return U(),j()}function S(w){return w?w.replace(u,v):v}return lp=y,lp}var xw;function KL(){if(xw)return xs;xw=1;var t=xs&&xs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xs,"__esModule",{value:!0}),xs.default=n;const e=t($L());function n(r,i){let l=null;if(!r||typeof r!="string")return l;const s=(0,e.default)(r),u=typeof i=="function";return s.forEach(f=>{if(f.type!=="declaration")return;const{property:c,value:h}=f;u?i(c,h,f):h&&(l=l||{},l[c]=h)}),l}return xs}var Yo={},ww;function YL(){if(ww)return Yo;ww=1,Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(c){return!c||n.test(c)||t.test(c)},s=function(c,h){return h.toUpperCase()},u=function(c,h){return"".concat(h,"-")},f=function(c,h){return h===void 0&&(h={}),l(c)?c:(c=c.toLowerCase(),h.reactCompat?c=c.replace(i,u):c=c.replace(r,u),c.replace(e,s))};return Yo.camelCase=f,Yo}var Xo,Sw;function XL(){if(Sw)return Xo;Sw=1;var t=Xo&&Xo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(KL()),n=YL();function r(i,l){var s={};return!i||typeof i!="string"||(0,e.default)(i,function(u,f){u&&f&&(s[(0,n.camelCase)(u,l)]=f)}),s}return r.default=r,Xo=r,Xo}var ZL=XL();const QL=xu(ZL),ST=CT("end"),Mm=CT("start");function CT(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function WL(t){const e=Mm(t),n=ST(t);if(e&&n)return{start:e,end:n}}function lu(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Cw(t.position):"start"in t||"end"in t?Cw(t):"line"in t||"column"in t?Xp(t):""}function Xp(t){return Tw(t&&t.line)+":"+Tw(t&&t.column)}function Cw(t){return Xp(t&&t.start)+"-"+Xp(t&&t.end)}function Tw(t){return t&&typeof t=="number"?t:1}class vr extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},s=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof e=="string"?i=e:!l.cause&&e&&(s=!0,i=e.message,l.cause=e),!l.ruleId&&!l.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?l.ruleId=r:(l.source=r.slice(0,f),l.ruleId=r.slice(f+1))}if(!l.place&&l.ancestors&&l.ancestors){const f=l.ancestors[l.ancestors.length-1];f&&(l.place=f.position)}const u=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=lu(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=s&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vr.prototype.file="";vr.prototype.name="";vr.prototype.reason="";vr.prototype.message="";vr.prototype.stack="";vr.prototype.column=void 0;vr.prototype.line=void 0;vr.prototype.ancestors=void 0;vr.prototype.cause=void 0;vr.prototype.fatal=void 0;vr.prototype.place=void 0;vr.prototype.ruleId=void 0;vr.prototype.source=void 0;const Om={}.hasOwnProperty,JL=new Map,eF=/[A-Z]/g,tF=new Set(["table","tbody","thead","tfoot","tr"]),nF=new Set(["td","th"]),TT="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function rF(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=fF(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=cF(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Rm:GL,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},l=DT(i,t,void 0);return l&&typeof l!="string"?l:i.create(t,i.Fragment,{children:l||void 0},void 0)}function DT(t,e,n){if(e.type==="element")return aF(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return iF(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return sF(t,e,n);if(e.type==="mdxjsEsm")return lF(t,e);if(e.type==="root")return oF(t,e,n);if(e.type==="text")return uF(t,e)}function aF(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Rm,t.schema=i),t.ancestors.push(e);const l=_T(t,e.tagName,!1),s=dF(t,e);let u=Lm(t,e);return tF.has(e.tagName)&&(u=u.filter(function(f){return typeof f=="string"?!BL(f):!0})),AT(t,s,l,e),Bm(s,u),t.ancestors.pop(),t.schema=r,t.create(e,l,s,n)}function iF(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}bu(t,e.position)}function lF(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);bu(t,e.position)}function sF(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=Rm,t.schema=i),t.ancestors.push(e);const l=e.name===null?t.Fragment:_T(t,e.name,!0),s=hF(t,e),u=Lm(t,e);return AT(t,s,l,e),Bm(s,u),t.ancestors.pop(),t.schema=r,t.create(e,l,s,n)}function oF(t,e,n){const r={};return Bm(r,Lm(t,e)),t.create(e,t.Fragment,r,n)}function uF(t,e){return e.value}function AT(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function Bm(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function cF(t,e,n){return r;function r(i,l,s,u){const c=Array.isArray(s.children)?n:e;return u?c(l,s,u):c(l,s)}}function fF(t,e){return n;function n(r,i,l,s){const u=Array.isArray(l.children),f=Mm(r);return e(i,l,s,u,{columnNumber:f?f.column-1:void 0,fileName:t,lineNumber:f?f.line:void 0},void 0)}}function dF(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&Om.call(e.properties,i)){const l=vF(t,i,e.properties[i]);if(l){const[s,u]=l;t.tableCellAlignToStyle&&s==="align"&&typeof u=="string"&&nF.has(e.tagName)?r=u:n[s]=u}}if(r){const l=n.style||(n.style={});l[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function hF(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const l=r.data.estree.body[0];l.type;const s=l.expression;s.type;const u=s.properties[0];u.type,Object.assign(n,t.evaluater.evaluateExpression(u.argument))}else bu(t,e.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const u=r.value.data.estree.body[0];u.type,l=t.evaluater.evaluateExpression(u.expression)}else bu(t,e.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function Lm(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:JL;for(;++r<e.children.length;){const l=e.children[r];let s;if(t.passKeys){const f=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(f){const c=i.get(f)||0;s=f+"-"+c,i.set(f,c+1)}}const u=DT(t,l,s);u!==void 0&&n.push(u)}return n}function vF(t,e,n){const r=qL(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?NL(n):VL(n)),r.property==="style"){let i=typeof n=="object"?n:gF(t,String(n));return t.stylePropertyNameCase==="css"&&(i=pF(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?zL[r.property]||r.property:r.attribute,n]}}function gF(t,e){try{return QL(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new vr("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=TT+"#cannot-parse-style-attribute",i}}function _T(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let l=-1,s;for(;++l<i.length;){const u=pw(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};s=s?{type:"MemberExpression",object:s,property:u,computed:!!(l&&u.type==="Literal"),optional:!1}:u}r=s}else r=pw(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return Om.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);bu(t)}function bu(t,e){const n=new vr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=TT+"#cannot-handle-mdx-estrees-without-createevaluater",n}function pF(t){const e={};let n;for(n in t)Om.call(t,n)&&(e[mF(n)]=t[n]);return e}function mF(t){let e=t.replace(eF,yF);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function yF(t){return"-"+t.toLowerCase()}const sp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},bF={};function Fm(t,e){const n=bF,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return NT(t,r,i)}function NT(t,e,n){if(EF(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Dw(t.children,e,n)}return Array.isArray(t)?Dw(t,e,n):""}function Dw(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=NT(t[i],e,n);return r.join("")}function EF(t){return!!(t&&typeof t=="object")}const Aw=document.createElement("i");function Im(t){const e="&"+t+";";Aw.innerHTML=e;const n=Aw.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function Gr(t,e,n,r){const i=t.length;let l=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);l<r.length;)s=r.slice(l,l+1e4),s.unshift(e,0),t.splice(...s),l+=1e4,e+=1e4}function ia(t,e){return t.length>0?(Gr(t,t.length,0,e),t):e}const _w={}.hasOwnProperty;function kT(t){const e={};let n=-1;for(;++n<t.length;)xF(e,t[n]);return e}function xF(t,e){let n;for(n in e){const i=(_w.call(t,n)?t[n]:void 0)||(t[n]={}),l=e[n];let s;if(l)for(s in l){_w.call(i,s)||(i[s]=[]);const u=l[s];wF(i[s],Array.isArray(u)?u:u?[u]:[])}}}function wF(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);Gr(t,0,0,r)}function RT(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"οΏ½":String.fromCodePoint(n)}function ha(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const yr=Ki(/[A-Za-z]/),cr=Ki(/[\dA-Za-z]/),SF=Ki(/[#-'*+\--9=?A-Z^-~]/);function Kf(t){return t!==null&&(t<32||t===127)}const Zp=Ki(/\d/),CF=Ki(/[\dA-Fa-f]/),TF=Ki(/[!-/:-@[-`{-~]/);function ht(t){return t!==null&&t<-2}function ln(t){return t!==null&&(t<0||t===32)}function Ot(t){return t===-2||t===-1||t===32}const md=Ki(new RegExp("\\p{P}|\\p{S}","u")),_l=Ki(/\s/);function Ki(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Ks(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const l=t.charCodeAt(n);let s="";if(l===37&&cr(t.charCodeAt(n+1))&&cr(t.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(s=String.fromCharCode(l));else if(l>55295&&l<57344){const u=t.charCodeAt(n+1);l<56320&&u>56319&&u<57344?(s=String.fromCharCode(l,u),i=1):s="οΏ½"}else s=String.fromCharCode(l);s&&(e.push(t.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function zt(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return s;function s(f){return Ot(f)?(t.enter(n),u(f)):e(f)}function u(f){return Ot(f)&&l++<i?(t.consume(f),u):(t.exit(n),e(f))}}const DF={tokenize:AF};function AF(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(u){if(u===null){t.consume(u);return}return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),zt(t,e,"linePrefix")}function i(u){return t.enter("paragraph"),l(u)}function l(u){const f=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,s(u)}function s(u){if(u===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(u);return}return ht(u)?(t.consume(u),t.exit("chunkText"),l):(t.consume(u),s)}}const _F={tokenize:NF},Nw={tokenize:kF};function NF(t){const e=this,n=[];let r=0,i,l,s;return u;function u(T){if(r<n.length){const A=n[r];return e.containerState=A[1],t.attempt(A[0].continuation,f,c)(T)}return c(T)}function f(T){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&C();const A=e.events.length;let k=A,N;for(;k--;)if(e.events[k][0]==="exit"&&e.events[k][1].type==="chunkFlow"){N=e.events[k][1].end;break}E(r);let _=A;for(;_<e.events.length;)e.events[_][1].end={...N},_++;return Gr(e.events,k+1,0,e.events.slice(A)),e.events.length=_,c(T)}return u(T)}function c(T){if(r===n.length){if(!i)return p(T);if(i.currentConstruct&&i.currentConstruct.concrete)return y(T);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Nw,h,v)(T)}function h(T){return i&&C(),E(r),p(T)}function v(T){return e.parser.lazy[e.now().line]=r!==n.length,s=e.now().offset,y(T)}function p(T){return e.containerState={},t.attempt(Nw,m,y)(T)}function m(T){return r++,n.push([e.currentConstruct,e.containerState]),p(T)}function y(T){if(T===null){i&&C(),E(0),t.consume(T);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),S(T)}function S(T){if(T===null){w(t.exit("chunkFlow"),!0),E(0),t.consume(T);return}return ht(T)?(t.consume(T),w(t.exit("chunkFlow")),r=0,e.interrupt=void 0,u):(t.consume(T),S)}function w(T,A){const k=e.sliceStream(T);if(A&&k.push(null),T.previous=l,l&&(l.next=T),l=T,i.defineSkip(T.start),i.write(k),e.parser.lazy[T.start.line]){let N=i.events.length;for(;N--;)if(i.events[N][1].start.offset<s&&(!i.events[N][1].end||i.events[N][1].end.offset>s))return;const _=e.events.length;let O=_,U,M;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){if(U){M=e.events[O][1].end;break}U=!0}for(E(r),N=_;N<e.events.length;)e.events[N][1].end={...M},N++;Gr(e.events,O+1,0,e.events.slice(_)),e.events.length=N}}function E(T){let A=n.length;for(;A-- >T;){const k=n[A];e.containerState=k[1],k[0].exit.call(e,t)}n.length=T}function C(){i.write([null]),l=void 0,i=void 0,e.containerState._closeFlow=void 0}}function kF(t,e,n){return zt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ps(t){if(t===null||ln(t)||_l(t))return 1;if(md(t))return 2}function yd(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const l=t[i].resolveAll;l&&!r.includes(l)&&(e=l(e,n),r.push(l))}return e}const Qp={name:"attention",resolveAll:RF,tokenize:MF};function RF(t,e){let n=-1,r,i,l,s,u,f,c,h;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;f=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const v={...t[r][1].end},p={...t[n][1].start};kw(v,-f),kw(p,f),s={type:f>1?"strongSequence":"emphasisSequence",start:v,end:{...t[r][1].end}},u={type:f>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},l={type:f>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:f>1?"strong":"emphasis",start:{...s.start},end:{...u.end}},t[r][1].end={...s.start},t[n][1].start={...u.end},c=[],t[r][1].end.offset-t[r][1].start.offset&&(c=ia(c,[["enter",t[r][1],e],["exit",t[r][1],e]])),c=ia(c,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",l,e]]),c=ia(c,yd(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),c=ia(c,[["exit",l,e],["enter",u,e],["exit",u,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(h=2,c=ia(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):h=0,Gr(t,r-1,n-r+3,c),n=r+c.length-h-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function MF(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ps(r);let l;return s;function s(f){return l=f,t.enter("attentionSequence"),u(f)}function u(f){if(f===l)return t.consume(f),u;const c=t.exit("attentionSequence"),h=Ps(f),v=!h||h===2&&i||n.includes(f),p=!i||i===2&&h||n.includes(r);return c._open=!!(l===42?v:v&&(i||!p)),c._close=!!(l===42?p:p&&(h||!v)),e(f)}}function kw(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const OF={name:"autolink",tokenize:BF};function BF(t,e,n){let r=0;return i;function i(m){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),l}function l(m){return yr(m)?(t.consume(m),s):m===64?n(m):c(m)}function s(m){return m===43||m===45||m===46||cr(m)?(r=1,u(m)):c(m)}function u(m){return m===58?(t.consume(m),r=0,f):(m===43||m===45||m===46||cr(m))&&r++<32?(t.consume(m),u):(r=0,c(m))}function f(m){return m===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):m===null||m===32||m===60||Kf(m)?n(m):(t.consume(m),f)}function c(m){return m===64?(t.consume(m),h):SF(m)?(t.consume(m),c):n(m)}function h(m){return cr(m)?v(m):n(m)}function v(m){return m===46?(t.consume(m),r=0,h):m===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):p(m)}function p(m){if((m===45||cr(m))&&r++<63){const y=m===45?p:v;return t.consume(m),y}return n(m)}}const Lu={partial:!0,tokenize:LF};function LF(t,e,n){return r;function r(l){return Ot(l)?zt(t,i,"linePrefix")(l):i(l)}function i(l){return l===null||ht(l)?e(l):n(l)}}const MT={continuation:{tokenize:IF},exit:zF,name:"blockQuote",tokenize:FF};function FF(t,e,n){const r=this;return i;function i(s){if(s===62){const u=r.containerState;return u.open||(t.enter("blockQuote",{_container:!0}),u.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),l}return n(s)}function l(s){return Ot(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function IF(t,e,n){const r=this;return i;function i(s){return Ot(s)?zt(t,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):l(s)}function l(s){return t.attempt(MT,e,n)(s)}}function zF(t){t.exit("blockQuote")}const OT={name:"characterEscape",tokenize:PF};function PF(t,e,n){return r;function r(l){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(l),t.exit("escapeMarker"),i}function i(l){return TF(l)?(t.enter("characterEscapeValue"),t.consume(l),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(l)}}const BT={name:"characterReference",tokenize:UF};function UF(t,e,n){const r=this;let i=0,l,s;return u;function u(v){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(v),t.exit("characterReferenceMarker"),f}function f(v){return v===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(v),t.exit("characterReferenceMarkerNumeric"),c):(t.enter("characterReferenceValue"),l=31,s=cr,h(v))}function c(v){return v===88||v===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(v),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),l=6,s=CF,h):(t.enter("characterReferenceValue"),l=7,s=Zp,h(v))}function h(v){if(v===59&&i){const p=t.exit("characterReferenceValue");return s===cr&&!Im(r.sliceSerialize(p))?n(v):(t.enter("characterReferenceMarker"),t.consume(v),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return s(v)&&i++<l?(t.consume(v),h):n(v)}}const Rw={partial:!0,tokenize:jF},Mw={concrete:!0,name:"codeFenced",tokenize:qF};function qF(t,e,n){const r=this,i={partial:!0,tokenize:k};let l=0,s=0,u;return f;function f(N){return c(N)}function c(N){const _=r.events[r.events.length-1];return l=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,u=N,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),h(N)}function h(N){return N===u?(s++,t.consume(N),h):s<3?n(N):(t.exit("codeFencedFenceSequence"),Ot(N)?zt(t,v,"whitespace")(N):v(N))}function v(N){return N===null||ht(N)?(t.exit("codeFencedFence"),r.interrupt?e(N):t.check(Rw,S,A)(N)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(N))}function p(N){return N===null||ht(N)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),v(N)):Ot(N)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),zt(t,m,"whitespace")(N)):N===96&&N===u?n(N):(t.consume(N),p)}function m(N){return N===null||ht(N)?v(N):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),y(N))}function y(N){return N===null||ht(N)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),v(N)):N===96&&N===u?n(N):(t.consume(N),y)}function S(N){return t.attempt(i,A,w)(N)}function w(N){return t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),E}function E(N){return l>0&&Ot(N)?zt(t,C,"linePrefix",l+1)(N):C(N)}function C(N){return N===null||ht(N)?t.check(Rw,S,A)(N):(t.enter("codeFlowValue"),T(N))}function T(N){return N===null||ht(N)?(t.exit("codeFlowValue"),C(N)):(t.consume(N),T)}function A(N){return t.exit("codeFenced"),e(N)}function k(N,_,O){let U=0;return M;function M($){return N.enter("lineEnding"),N.consume($),N.exit("lineEnding"),I}function I($){return N.enter("codeFencedFence"),Ot($)?zt(N,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):P($)}function P($){return $===u?(N.enter("codeFencedFenceSequence"),j($)):O($)}function j($){return $===u?(U++,N.consume($),j):U>=s?(N.exit("codeFencedFenceSequence"),Ot($)?zt(N,K,"whitespace")($):K($)):O($)}function K($){return $===null||ht($)?(N.exit("codeFencedFence"),_($)):O($)}}}function jF(t,e,n){const r=this;return i;function i(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),l)}function l(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}const op={name:"codeIndented",tokenize:GF},HF={partial:!0,tokenize:VF};function GF(t,e,n){const r=this;return i;function i(c){return t.enter("codeIndented"),zt(t,l,"linePrefix",5)(c)}function l(c){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?f(c):ht(c)?t.attempt(HF,s,f)(c):(t.enter("codeFlowValue"),u(c))}function u(c){return c===null||ht(c)?(t.exit("codeFlowValue"),s(c)):(t.consume(c),u)}function f(c){return t.exit("codeIndented"),e(c)}}function VF(t,e,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ht(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):zt(t,l,"linePrefix",5)(s)}function l(s){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(s):ht(s)?i(s):n(s)}}const $F={name:"codeText",previous:YF,resolve:KF,tokenize:XF};function KF(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function YF(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function XF(t,e,n){let r=0,i,l;return s;function s(v){return t.enter("codeText"),t.enter("codeTextSequence"),u(v)}function u(v){return v===96?(t.consume(v),r++,u):(t.exit("codeTextSequence"),f(v))}function f(v){return v===null?n(v):v===32?(t.enter("space"),t.consume(v),t.exit("space"),f):v===96?(l=t.enter("codeTextSequence"),i=0,h(v)):ht(v)?(t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),f):(t.enter("codeTextData"),c(v))}function c(v){return v===null||v===32||v===96||ht(v)?(t.exit("codeTextData"),f(v)):(t.consume(v),c)}function h(v){return v===96?(t.consume(v),i++,h):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(v)):(l.type="codeTextData",c(v))}}class ZF{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Zo(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Zo(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Zo(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);Zo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Zo(this.left,n.reverse())}}}function Zo(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function LT(t){const e={};let n=-1,r,i,l,s,u,f,c;const h=new ZF(t);for(;++n<h.length;){for(;n in e;)n=e[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,l=0,l<f.length&&f[l][1].type==="lineEndingBlank"&&(l+=2),l<f.length&&f[l][1].type==="content"))for(;++l<f.length&&f[l][1].type!=="content";)f[l][1].type==="chunkText"&&(f[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,QF(h,n)),n=e[n],c=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(s=h.get(l),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=l);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},u=h.slice(i,n),u.unshift(r),h.splice(i,n-i+1,u))}}return Gr(t,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function QF(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const l=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const u=s.events,f=[],c={};let h,v,p=-1,m=n,y=0,S=0;const w=[S];for(;m;){for(;t.get(++i)[1]!==m;);l.push(i),m._tokenizer||(h=r.sliceStream(m),m.next||h.push(null),v&&s.defineSkip(m.start),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(h),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),v=m,m=m.next}for(m=n;++p<u.length;)u[p][0]==="exit"&&u[p-1][0]==="enter"&&u[p][1].type===u[p-1][1].type&&u[p][1].start.line!==u[p][1].end.line&&(S=p+1,w.push(S),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(s.events=[],m?(m._tokenizer=void 0,m.previous=void 0):w.pop(),p=w.length;p--;){const E=u.slice(w[p],w[p+1]),C=l.pop();f.push([C,C+E.length-1]),t.splice(C,2,E)}for(f.reverse(),p=-1;++p<f.length;)c[y+f[p][0]]=y+f[p][1],y+=f[p][1]-f[p][0]-1;return c}const WF={resolve:eI,tokenize:tI},JF={partial:!0,tokenize:nI};function eI(t){return LT(t),t}function tI(t,e){let n;return r;function r(u){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?l(u):ht(u)?t.check(JF,s,l)(u):(t.consume(u),i)}function l(u){return t.exit("chunkContent"),t.exit("content"),e(u)}function s(u){return t.consume(u),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function nI(t,e,n){const r=this;return i;function i(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),zt(t,l,"linePrefix")}function l(s){if(s===null||ht(s))return n(s);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(s):t.interrupt(r.parser.constructs.flow,n,e)(s)}}function FT(t,e,n,r,i,l,s,u,f){const c=f||Number.POSITIVE_INFINITY;let h=0;return v;function v(E){return E===60?(t.enter(r),t.enter(i),t.enter(l),t.consume(E),t.exit(l),p):E===null||E===32||E===41||Kf(E)?n(E):(t.enter(r),t.enter(s),t.enter(u),t.enter("chunkString",{contentType:"string"}),S(E))}function p(E){return E===62?(t.enter(l),t.consume(E),t.exit(l),t.exit(i),t.exit(r),e):(t.enter(u),t.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===62?(t.exit("chunkString"),t.exit(u),p(E)):E===null||E===60||ht(E)?n(E):(t.consume(E),E===92?y:m)}function y(E){return E===60||E===62||E===92?(t.consume(E),m):m(E)}function S(E){return!h&&(E===null||E===41||ln(E))?(t.exit("chunkString"),t.exit(u),t.exit(s),t.exit(r),e(E)):h<c&&E===40?(t.consume(E),h++,S):E===41?(t.consume(E),h--,S):E===null||E===32||E===40||Kf(E)?n(E):(t.consume(E),E===92?w:S)}function w(E){return E===40||E===41||E===92?(t.consume(E),S):S(E)}}function IT(t,e,n,r,i,l){const s=this;let u=0,f;return c;function c(m){return t.enter(r),t.enter(i),t.consume(m),t.exit(i),t.enter(l),h}function h(m){return u>999||m===null||m===91||m===93&&!f||m===94&&!u&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(t.exit(l),t.enter(i),t.consume(m),t.exit(i),t.exit(r),e):ht(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),h):(t.enter("chunkString",{contentType:"string"}),v(m))}function v(m){return m===null||m===91||m===93||ht(m)||u++>999?(t.exit("chunkString"),h(m)):(t.consume(m),f||(f=!Ot(m)),m===92?p:v)}function p(m){return m===91||m===92||m===93?(t.consume(m),u++,v):v(m)}}function zT(t,e,n,r,i,l){let s;return u;function u(p){return p===34||p===39||p===40?(t.enter(r),t.enter(i),t.consume(p),t.exit(i),s=p===40?41:p,f):n(p)}function f(p){return p===s?(t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):(t.enter(l),c(p))}function c(p){return p===s?(t.exit(l),f(s)):p===null?n(p):ht(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),zt(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===s||p===null||ht(p)?(t.exit("chunkString"),c(p)):(t.consume(p),p===92?v:h)}function v(p){return p===s||p===92?(t.consume(p),h):h(p)}}function su(t,e){let n;return r;function r(i){return ht(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):Ot(i)?zt(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const rI={name:"definition",tokenize:iI},aI={partial:!0,tokenize:lI};function iI(t,e,n){const r=this;let i;return l;function l(m){return t.enter("definition"),s(m)}function s(m){return IT.call(r,t,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function u(m){return i=ha(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),f):n(m)}function f(m){return ln(m)?su(t,c)(m):c(m)}function c(m){return FT(t,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function h(m){return t.attempt(aI,v,v)(m)}function v(m){return Ot(m)?zt(t,p,"whitespace")(m):p(m)}function p(m){return m===null||ht(m)?(t.exit("definition"),r.parser.defined.push(i),e(m)):n(m)}}function lI(t,e,n){return r;function r(u){return ln(u)?su(t,i)(u):n(u)}function i(u){return zT(t,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function l(u){return Ot(u)?zt(t,s,"whitespace")(u):s(u)}function s(u){return u===null||ht(u)?e(u):n(u)}}const sI={name:"hardBreakEscape",tokenize:oI};function oI(t,e,n){return r;function r(l){return t.enter("hardBreakEscape"),t.consume(l),i}function i(l){return ht(l)?(t.exit("hardBreakEscape"),e(l)):n(l)}}const uI={name:"headingAtx",resolve:cI,tokenize:fI};function cI(t,e){let n=t.length-2,r=3,i,l;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},l={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Gr(t,r,n-r+1,[["enter",i,e],["enter",l,e],["exit",l,e],["exit",i,e]])),t}function fI(t,e,n){let r=0;return i;function i(h){return t.enter("atxHeading"),l(h)}function l(h){return t.enter("atxHeadingSequence"),s(h)}function s(h){return h===35&&r++<6?(t.consume(h),s):h===null||ln(h)?(t.exit("atxHeadingSequence"),u(h)):n(h)}function u(h){return h===35?(t.enter("atxHeadingSequence"),f(h)):h===null||ht(h)?(t.exit("atxHeading"),e(h)):Ot(h)?zt(t,u,"whitespace")(h):(t.enter("atxHeadingText"),c(h))}function f(h){return h===35?(t.consume(h),f):(t.exit("atxHeadingSequence"),u(h))}function c(h){return h===null||h===35||ln(h)?(t.exit("atxHeadingText"),u(h)):(t.consume(h),c)}}const dI=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ow=["pre","script","style","textarea"],hI={concrete:!0,name:"htmlFlow",resolveTo:pI,tokenize:mI},vI={partial:!0,tokenize:bI},gI={partial:!0,tokenize:yI};function pI(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function mI(t,e,n){const r=this;let i,l,s,u,f;return c;function c(L){return h(L)}function h(L){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(L),v}function v(L){return L===33?(t.consume(L),p):L===47?(t.consume(L),l=!0,S):L===63?(t.consume(L),i=3,r.interrupt?e:z):yr(L)?(t.consume(L),s=String.fromCharCode(L),w):n(L)}function p(L){return L===45?(t.consume(L),i=2,m):L===91?(t.consume(L),i=5,u=0,y):yr(L)?(t.consume(L),i=4,r.interrupt?e:z):n(L)}function m(L){return L===45?(t.consume(L),r.interrupt?e:z):n(L)}function y(L){const W="CDATA[";return L===W.charCodeAt(u++)?(t.consume(L),u===W.length?r.interrupt?e:P:y):n(L)}function S(L){return yr(L)?(t.consume(L),s=String.fromCharCode(L),w):n(L)}function w(L){if(L===null||L===47||L===62||ln(L)){const W=L===47,ae=s.toLowerCase();return!W&&!l&&Ow.includes(ae)?(i=1,r.interrupt?e(L):P(L)):dI.includes(s.toLowerCase())?(i=6,W?(t.consume(L),E):r.interrupt?e(L):P(L)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(L):l?C(L):T(L))}return L===45||cr(L)?(t.consume(L),s+=String.fromCharCode(L),w):n(L)}function E(L){return L===62?(t.consume(L),r.interrupt?e:P):n(L)}function C(L){return Ot(L)?(t.consume(L),C):M(L)}function T(L){return L===47?(t.consume(L),M):L===58||L===95||yr(L)?(t.consume(L),A):Ot(L)?(t.consume(L),T):M(L)}function A(L){return L===45||L===46||L===58||L===95||cr(L)?(t.consume(L),A):k(L)}function k(L){return L===61?(t.consume(L),N):Ot(L)?(t.consume(L),k):T(L)}function N(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(t.consume(L),f=L,_):Ot(L)?(t.consume(L),N):O(L)}function _(L){return L===f?(t.consume(L),f=null,U):L===null||ht(L)?n(L):(t.consume(L),_)}function O(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||ln(L)?k(L):(t.consume(L),O)}function U(L){return L===47||L===62||Ot(L)?T(L):n(L)}function M(L){return L===62?(t.consume(L),I):n(L)}function I(L){return L===null||ht(L)?P(L):Ot(L)?(t.consume(L),I):n(L)}function P(L){return L===45&&i===2?(t.consume(L),B):L===60&&i===1?(t.consume(L),H):L===62&&i===4?(t.consume(L),F):L===63&&i===3?(t.consume(L),z):L===93&&i===5?(t.consume(L),Q):ht(L)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(vI,q,j)(L)):L===null||ht(L)?(t.exit("htmlFlowData"),j(L)):(t.consume(L),P)}function j(L){return t.check(gI,K,q)(L)}function K(L){return t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),$}function $(L){return L===null||ht(L)?j(L):(t.enter("htmlFlowData"),P(L))}function B(L){return L===45?(t.consume(L),z):P(L)}function H(L){return L===47?(t.consume(L),s="",Y):P(L)}function Y(L){if(L===62){const W=s.toLowerCase();return Ow.includes(W)?(t.consume(L),F):P(L)}return yr(L)&&s.length<8?(t.consume(L),s+=String.fromCharCode(L),Y):P(L)}function Q(L){return L===93?(t.consume(L),z):P(L)}function z(L){return L===62?(t.consume(L),F):L===45&&i===2?(t.consume(L),z):P(L)}function F(L){return L===null||ht(L)?(t.exit("htmlFlowData"),q(L)):(t.consume(L),F)}function q(L){return t.exit("htmlFlow"),e(L)}}function yI(t,e,n){const r=this;return i;function i(s){return ht(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),l):n(s)}function l(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}function bI(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Lu,e,n)}}const EI={name:"htmlText",tokenize:xI};function xI(t,e,n){const r=this;let i,l,s;return u;function u(z){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(z),f}function f(z){return z===33?(t.consume(z),c):z===47?(t.consume(z),k):z===63?(t.consume(z),T):yr(z)?(t.consume(z),O):n(z)}function c(z){return z===45?(t.consume(z),h):z===91?(t.consume(z),l=0,y):yr(z)?(t.consume(z),C):n(z)}function h(z){return z===45?(t.consume(z),m):n(z)}function v(z){return z===null?n(z):z===45?(t.consume(z),p):ht(z)?(s=v,H(z)):(t.consume(z),v)}function p(z){return z===45?(t.consume(z),m):v(z)}function m(z){return z===62?B(z):z===45?p(z):v(z)}function y(z){const F="CDATA[";return z===F.charCodeAt(l++)?(t.consume(z),l===F.length?S:y):n(z)}function S(z){return z===null?n(z):z===93?(t.consume(z),w):ht(z)?(s=S,H(z)):(t.consume(z),S)}function w(z){return z===93?(t.consume(z),E):S(z)}function E(z){return z===62?B(z):z===93?(t.consume(z),E):S(z)}function C(z){return z===null||z===62?B(z):ht(z)?(s=C,H(z)):(t.consume(z),C)}function T(z){return z===null?n(z):z===63?(t.consume(z),A):ht(z)?(s=T,H(z)):(t.consume(z),T)}function A(z){return z===62?B(z):T(z)}function k(z){return yr(z)?(t.consume(z),N):n(z)}function N(z){return z===45||cr(z)?(t.consume(z),N):_(z)}function _(z){return ht(z)?(s=_,H(z)):Ot(z)?(t.consume(z),_):B(z)}function O(z){return z===45||cr(z)?(t.consume(z),O):z===47||z===62||ln(z)?U(z):n(z)}function U(z){return z===47?(t.consume(z),B):z===58||z===95||yr(z)?(t.consume(z),M):ht(z)?(s=U,H(z)):Ot(z)?(t.consume(z),U):B(z)}function M(z){return z===45||z===46||z===58||z===95||cr(z)?(t.consume(z),M):I(z)}function I(z){return z===61?(t.consume(z),P):ht(z)?(s=I,H(z)):Ot(z)?(t.consume(z),I):U(z)}function P(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(t.consume(z),i=z,j):ht(z)?(s=P,H(z)):Ot(z)?(t.consume(z),P):(t.consume(z),K)}function j(z){return z===i?(t.consume(z),i=void 0,$):z===null?n(z):ht(z)?(s=j,H(z)):(t.consume(z),j)}function K(z){return z===null||z===34||z===39||z===60||z===61||z===96?n(z):z===47||z===62||ln(z)?U(z):(t.consume(z),K)}function $(z){return z===47||z===62||ln(z)?U(z):n(z)}function B(z){return z===62?(t.consume(z),t.exit("htmlTextData"),t.exit("htmlText"),e):n(z)}function H(z){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(z),t.exit("lineEnding"),Y}function Y(z){return Ot(z)?zt(t,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):Q(z)}function Q(z){return t.enter("htmlTextData"),s(z)}}const zm={name:"labelEnd",resolveAll:TI,resolveTo:DI,tokenize:AI},wI={tokenize:_I},SI={tokenize:NI},CI={tokenize:kI};function TI(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&Gr(t,0,t.length,n),t}function DI(t,e){let n=t.length,r=0,i,l,s,u;for(;n--;)if(i=t[n][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const f={type:t[l][1].type==="labelLink"?"link":"image",start:{...t[l][1].start},end:{...t[t.length-1][1].end}},c={type:"label",start:{...t[l][1].start},end:{...t[s][1].end}},h={type:"labelText",start:{...t[l+r+2][1].end},end:{...t[s-2][1].start}};return u=[["enter",f,e],["enter",c,e]],u=ia(u,t.slice(l+1,l+r+3)),u=ia(u,[["enter",h,e]]),u=ia(u,yd(e.parser.constructs.insideSpan.null,t.slice(l+r+4,s-3),e)),u=ia(u,[["exit",h,e],t[s-2],t[s-1],["exit",c,e]]),u=ia(u,t.slice(s+1)),u=ia(u,[["exit",f,e]]),Gr(t,l,t.length,u),t}function AI(t,e,n){const r=this;let i=r.events.length,l,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return u;function u(p){return l?l._inactive?v(p):(s=r.parser.defined.includes(ha(r.sliceSerialize({start:l.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),f):n(p)}function f(p){return p===40?t.attempt(wI,h,s?h:v)(p):p===91?t.attempt(SI,h,s?c:v)(p):s?h(p):v(p)}function c(p){return t.attempt(CI,h,v)(p)}function h(p){return e(p)}function v(p){return l._balanced=!0,n(p)}}function _I(t,e,n){return r;function r(v){return t.enter("resource"),t.enter("resourceMarker"),t.consume(v),t.exit("resourceMarker"),i}function i(v){return ln(v)?su(t,l)(v):l(v)}function l(v){return v===41?h(v):FT(t,s,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(v)}function s(v){return ln(v)?su(t,f)(v):h(v)}function u(v){return n(v)}function f(v){return v===34||v===39||v===40?zT(t,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(v):h(v)}function c(v){return ln(v)?su(t,h)(v):h(v)}function h(v){return v===41?(t.enter("resourceMarker"),t.consume(v),t.exit("resourceMarker"),t.exit("resource"),e):n(v)}}function NI(t,e,n){const r=this;return i;function i(u){return IT.call(r,t,l,s,"reference","referenceMarker","referenceString")(u)}function l(u){return r.parser.defined.includes(ha(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(u):n(u)}function s(u){return n(u)}}function kI(t,e,n){return r;function r(l){return t.enter("reference"),t.enter("referenceMarker"),t.consume(l),t.exit("referenceMarker"),i}function i(l){return l===93?(t.enter("referenceMarker"),t.consume(l),t.exit("referenceMarker"),t.exit("reference"),e):n(l)}}const RI={name:"labelStartImage",resolveAll:zm.resolveAll,tokenize:MI};function MI(t,e,n){const r=this;return i;function i(u){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(u),t.exit("labelImageMarker"),l}function l(u){return u===91?(t.enter("labelMarker"),t.consume(u),t.exit("labelMarker"),t.exit("labelImage"),s):n(u)}function s(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):e(u)}}const OI={name:"labelStartLink",resolveAll:zm.resolveAll,tokenize:BI};function BI(t,e,n){const r=this;return i;function i(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),l}function l(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):e(s)}}const up={name:"lineEnding",tokenize:LI};function LI(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),zt(t,e,"linePrefix")}}const Mf={name:"thematicBreak",tokenize:FI};function FI(t,e,n){let r=0,i;return l;function l(c){return t.enter("thematicBreak"),s(c)}function s(c){return i=c,u(c)}function u(c){return c===i?(t.enter("thematicBreakSequence"),f(c)):r>=3&&(c===null||ht(c))?(t.exit("thematicBreak"),e(c)):n(c)}function f(c){return c===i?(t.consume(c),r++,f):(t.exit("thematicBreakSequence"),Ot(c)?zt(t,u,"whitespace")(c):u(c))}}const kr={continuation:{tokenize:UI},exit:jI,name:"list",tokenize:PI},II={partial:!0,tokenize:HI},zI={partial:!0,tokenize:qI};function PI(t,e,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return u;function u(m){const y=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Zp(m)){if(r.containerState.type||(r.containerState.type=y,t.enter(y,{_container:!0})),y==="listUnordered")return t.enter("listItemPrefix"),m===42||m===45?t.check(Mf,n,c)(m):c(m);if(!r.interrupt||m===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),f(m)}return n(m)}function f(m){return Zp(m)&&++s<10?(t.consume(m),f):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(t.exit("listItemValue"),c(m)):n(m)}function c(m){return t.enter("listItemMarker"),t.consume(m),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,t.check(Lu,r.interrupt?n:h,t.attempt(II,p,v))}function h(m){return r.containerState.initialBlankLine=!0,l++,p(m)}function v(m){return Ot(m)?(t.enter("listItemPrefixWhitespace"),t.consume(m),t.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=l+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(m)}}function UI(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Lu,i,l);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,zt(t,e,"listItemIndent",r.containerState.size+1)(u)}function l(u){return r.containerState.furtherBlankLines||!Ot(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(zI,e,s)(u))}function s(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,zt(t,t.attempt(kr,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function qI(t,e,n){const r=this;return zt(t,i,"listItemIndent",r.containerState.size+1);function i(l){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?e(l):n(l)}}function jI(t){t.exit(this.containerState.type)}function HI(t,e,n){const r=this;return zt(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const s=r.events[r.events.length-1];return!Ot(l)&&s&&s[1].type==="listItemPrefixWhitespace"?e(l):n(l)}}const Bw={name:"setextUnderline",resolveTo:GI,tokenize:VI};function GI(t,e){let n=t.length,r,i,l;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!l&&t[n][1].type==="definition"&&(l=n);const s={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",l?(t.splice(i,0,["enter",s,e]),t.splice(l+1,0,["exit",t[r][1],e]),t[r][1].end={...t[l][1].end}):t[r][1]=s,t.push(["exit",s,e]),t}function VI(t,e,n){const r=this;let i;return l;function l(c){let h=r.events.length,v;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){v=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||v)?(t.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return t.enter("setextHeadingLineSequence"),u(c)}function u(c){return c===i?(t.consume(c),u):(t.exit("setextHeadingLineSequence"),Ot(c)?zt(t,f,"lineSuffix")(c):f(c))}function f(c){return c===null||ht(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const $I={tokenize:KI};function KI(t){const e=this,n=t.attempt(Lu,r,t.attempt(this.parser.constructs.flowInitial,i,zt(t,t.attempt(this.parser.constructs.flow,i,t.attempt(WF,i)),"linePrefix")));return n;function r(l){if(l===null){t.consume(l);return}return t.enter("lineEndingBlank"),t.consume(l),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(l){if(l===null){t.consume(l);return}return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const YI={resolveAll:UT()},XI=PT("string"),ZI=PT("text");function PT(t){return{resolveAll:UT(t==="text"?QI:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],l=n.attempt(i,s,u);return s;function s(h){return c(h)?l(h):u(h)}function u(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),f}function f(h){return c(h)?(n.exit("data"),l(h)):(n.consume(h),f)}function c(h){if(h===null)return!0;const v=i[h];let p=-1;if(v)for(;++p<v.length;){const m=v[p];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function UT(t){return e;function e(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return t?t(n,r):n}}function QI(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let l=i.length,s=-1,u=0,f;for(;l--;){const c=i[l];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)u++,s--;if(s)break;s=-1}else if(c===-2)f=!0,u++;else if(c!==-1){l++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(u=0),u){const c={type:n===t.length||f||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?s:r.start._bufferIndex+s,_index:r.start._index+l,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(t.splice(n,0,["enter",c,e],["exit",c,e]),n+=2)}n++}return t}const WI={42:kr,43:kr,45:kr,48:kr,49:kr,50:kr,51:kr,52:kr,53:kr,54:kr,55:kr,56:kr,57:kr,62:MT},JI={91:rI},ez={[-2]:op,[-1]:op,32:op},tz={35:uI,42:Mf,45:[Bw,Mf],60:hI,61:Bw,95:Mf,96:Mw,126:Mw},nz={38:BT,92:OT},rz={[-5]:up,[-4]:up,[-3]:up,33:RI,38:BT,42:Qp,60:[OF,EI],91:OI,92:[sI,OT],93:zm,95:Qp,96:$F},az={null:[Qp,YI]},iz={null:[42,95]},lz={null:[]},sz=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:iz,contentInitial:JI,disable:lz,document:WI,flow:tz,flowInitial:ez,insideSpan:az,string:nz,text:rz},Symbol.toStringTag,{value:"Module"}));function oz(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let s=[],u=[];const f={attempt:_(k),check:_(N),consume:C,enter:T,exit:A,interrupt:_(N,{interrupt:!0})},c={code:null,containerState:{},defineSkip:S,events:[],now:y,parser:t,previous:null,sliceSerialize:p,sliceStream:m,write:v};let h=e.tokenize.call(c,f);return e.resolveAll&&l.push(e),c;function v(I){return s=ia(s,I),w(),s[s.length-1]!==null?[]:(O(e,0),c.events=yd(l,c.events,c),c.events)}function p(I,P){return cz(m(I),P)}function m(I){return uz(s,I)}function y(){const{_bufferIndex:I,_index:P,line:j,column:K,offset:$}=r;return{_bufferIndex:I,_index:P,line:j,column:K,offset:$}}function S(I){i[I.line]=I.column,M()}function w(){let I;for(;r._index<s.length;){const P=s[r._index];if(typeof P=="string")for(I=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===I&&r._bufferIndex<P.length;)E(P.charCodeAt(r._bufferIndex));else E(P)}}function E(I){h=h(I)}function C(I){ht(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,M()):I!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=I}function T(I,P){const j=P||{};return j.type=I,j.start=y(),c.events.push(["enter",j,c]),u.push(j),j}function A(I){const P=u.pop();return P.end=y(),c.events.push(["exit",P,c]),P}function k(I,P){O(I,P.from)}function N(I,P){P.restore()}function _(I,P){return j;function j(K,$,B){let H,Y,Q,z;return Array.isArray(K)?q(K):"tokenize"in K?q([K]):F(K);function F(se){return me;function me(Ne){const pe=Ne!==null&&se[Ne],ee=Ne!==null&&se.null,le=[...Array.isArray(pe)?pe:pe?[pe]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return q(le)(Ne)}}function q(se){return H=se,Y=0,se.length===0?B:L(se[Y])}function L(se){return me;function me(Ne){return z=U(),Q=se,se.partial||(c.currentConstruct=se),se.name&&c.parser.constructs.disable.null.includes(se.name)?ae():se.tokenize.call(P?Object.assign(Object.create(c),P):c,f,W,ae)(Ne)}}function W(se){return I(Q,z),$}function ae(se){return z.restore(),++Y<H.length?L(H[Y]):B}}}function O(I,P){I.resolveAll&&!l.includes(I)&&l.push(I),I.resolve&&Gr(c.events,P,c.events.length-P,I.resolve(c.events.slice(P),c)),I.resolveTo&&(c.events=I.resolveTo(c.events,c))}function U(){const I=y(),P=c.previous,j=c.currentConstruct,K=c.events.length,$=Array.from(u);return{from:K,restore:B};function B(){r=I,c.previous=P,c.currentConstruct=j,c.events.length=K,u=$,M()}}function M(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function uz(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,l=e.end._bufferIndex;let s;if(n===i)s=[t[n].slice(r,l)];else{if(s=t.slice(n,i),r>-1){const u=s[0];typeof u=="string"?s[0]=u.slice(r):s.shift()}l>0&&s.push(t[i].slice(0,l))}return s}function cz(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const l=t[n];let s;if(typeof l=="string")s=l;else switch(l){case-5:{s="\r";break}case-4:{s=`
|
|
336
|
-
`;break}case-3:{s=`\r
|
|
337
|
-
`;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(l)}i=l===-2,r.push(s)}return r.join("")}function fz(t){const r={constructs:kT([sz,...(t||{}).extensions||[]]),content:i(DF),defined:[],document:i(_F),flow:i($I),lazy:{},string:i(XI),text:i(ZI)};return r;function i(l){return s;function s(u){return oz(r,l,u)}}}function dz(t){for(;!LT(t););return t}const Lw=/[\0\t\n\r]/g;function hz(){let t=1,e="",n=!0,r;return i;function i(l,s,u){const f=[];let c,h,v,p,m;for(l=e+(typeof l=="string"?l.toString():new TextDecoder(s||void 0).decode(l)),v=0,e="",n&&(l.charCodeAt(0)===65279&&v++,n=void 0);v<l.length;){if(Lw.lastIndex=v,c=Lw.exec(l),p=c&&c.index!==void 0?c.index:l.length,m=l.charCodeAt(p),!c){e=l.slice(v);break}if(m===10&&v===p&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),v<p&&(f.push(l.slice(v,p)),t+=p-v),m){case 0:{f.push(65533),t++;break}case 9:{for(h=Math.ceil(t/4)*4,f.push(-2);t++<h;)f.push(-1);break}case 10:{f.push(-4),t=1;break}default:r=!0,t=1}v=p+1}return u&&(r&&f.push(-5),e&&f.push(e),f.push(null)),f}}const vz=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function gz(t){return t.replace(vz,pz)}function pz(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return RT(n.slice(l?2:1),l?16:10)}return Im(n)||t}const qT={}.hasOwnProperty;function mz(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),yz(n)(dz(fz(n).document().write(hz()(t,e,!0))))}function yz(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(We),autolinkProtocol:U,autolinkEmail:U,atxHeading:l(Xe),blockQuote:l(ee),characterEscape:U,characterReference:U,codeFenced:l(le),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:l(le,s),codeText:l(fe,s),codeTextData:U,data:U,codeFlowValue:U,definition:l(xe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:l(Re),hardBreakEscape:l(Ke),hardBreakTrailing:l(Ke),htmlFlow:l(ot,s),htmlFlowData:U,htmlText:l(ot,s),htmlTextData:U,image:l(et),label:s,link:l(We),listItem:l(Je),listItemValue:p,listOrdered:l(ze,v),listUnordered:l(ze),paragraph:l(Ye),reference:L,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:l(Xe),strong:l(ut),thematicBreak:l(gt)},exit:{atxHeading:f(),atxHeadingSequence:k,autolink:f(),autolinkEmail:pe,autolinkProtocol:Ne,blockQuote:f(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:se,characterReference:me,codeFenced:f(w),codeFencedFence:S,codeFencedFenceInfo:m,codeFencedFenceMeta:y,codeFlowValue:M,codeIndented:f(E),codeText:f($),codeTextData:M,data:M,definition:f(),definitionDestinationString:A,definitionLabelString:C,definitionTitleString:T,emphasis:f(),hardBreakEscape:f(P),hardBreakTrailing:f(P),htmlFlow:f(j),htmlFlowData:M,htmlText:f(K),htmlTextData:M,image:f(H),label:Q,labelText:Y,lineEnding:I,link:f(B),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:W,resourceDestinationString:z,resourceTitleString:F,resource:q,setextHeading:f(O),setextHeadingLineSequence:_,setextHeadingText:N,strong:f(),thematicBreak:f()}};jT(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(ue){let Se={type:"root",children:[]};const Ie={stack:[Se],tokenStack:[],config:e,enter:u,exit:c,buffer:s,resume:h,data:n},Ve=[];let qe=-1;for(;++qe<ue.length;)if(ue[qe][1].type==="listOrdered"||ue[qe][1].type==="listUnordered")if(ue[qe][0]==="enter")Ve.push(qe);else{const Fe=Ve.pop();qe=i(ue,Fe,qe)}for(qe=-1;++qe<ue.length;){const Fe=e[ue[qe][0]];qT.call(Fe,ue[qe][1].type)&&Fe[ue[qe][1].type].call(Object.assign({sliceSerialize:ue[qe][2].sliceSerialize},Ie),ue[qe][1])}if(Ie.tokenStack.length>0){const Fe=Ie.tokenStack[Ie.tokenStack.length-1];(Fe[1]||Fw).call(Ie,void 0,Fe[0])}for(Se.position={start:Ni(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Ni(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe<e.transforms.length;)Se=e.transforms[qe](Se)||Se;return Se}function i(ue,Se,Ie){let Ve=Se-1,qe=-1,Fe=!1,be,G,ne,de;for(;++Ve<=Ie;){const oe=ue[Ve];switch(oe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{oe[0]==="enter"?qe++:qe--,de=void 0;break}case"lineEndingBlank":{oe[0]==="enter"&&(be&&!de&&!qe&&!ne&&(ne=Ve),de=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:de=void 0}if(!qe&&oe[0]==="enter"&&oe[1].type==="listItemPrefix"||qe===-1&&oe[0]==="exit"&&(oe[1].type==="listUnordered"||oe[1].type==="listOrdered")){if(be){let Ee=Ve;for(G=void 0;Ee--;){const Pe=ue[Ee];if(Pe[1].type==="lineEnding"||Pe[1].type==="lineEndingBlank"){if(Pe[0]==="exit")continue;G&&(ue[G][1].type="lineEndingBlank",Fe=!0),Pe[1].type="lineEnding",G=Ee}else if(!(Pe[1].type==="linePrefix"||Pe[1].type==="blockQuotePrefix"||Pe[1].type==="blockQuotePrefixWhitespace"||Pe[1].type==="blockQuoteMarker"||Pe[1].type==="listItemIndent"))break}ne&&(!G||ne<G)&&(be._spread=!0),be.end=Object.assign({},G?ue[G][1].start:oe[1].end),ue.splice(G||Ve,0,["exit",be,oe[2]]),Ve++,Ie++}if(oe[1].type==="listItemPrefix"){const Ee={type:"listItem",_spread:!1,start:Object.assign({},oe[1].start),end:void 0};be=Ee,ue.splice(Ve,0,["enter",Ee,oe[2]]),Ve++,Ie++,ne=void 0,de=!0}}}return ue[Se][1]._spread=Fe,Ie}function l(ue,Se){return Ie;function Ie(Ve){u.call(this,ue(Ve),Ve),Se&&Se.call(this,Ve)}}function s(){this.stack.push({type:"fragment",children:[]})}function u(ue,Se,Ie){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([Se,Ie||void 0]),ue.position={start:Ni(Se.start),end:void 0}}function f(ue){return Se;function Se(Ie){ue&&ue.call(this,Ie),c.call(this,Ie)}}function c(ue,Se){const Ie=this.stack.pop(),Ve=this.tokenStack.pop();if(Ve)Ve[0].type!==ue.type&&(Se?Se.call(this,ue,Ve[0]):(Ve[1]||Fw).call(this,ue,Ve[0]));else throw new Error("Cannot close `"+ue.type+"` ("+lu({start:ue.start,end:ue.end})+"): itβs not open");Ie.position.end=Ni(ue.end)}function h(){return Fm(this.stack.pop())}function v(){this.data.expectingFirstListItemValue=!0}function p(ue){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function m(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=ue}function y(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=ue}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue.replace(/(\r?\n|\r)$/g,"")}function C(ue){const Se=this.resume(),Ie=this.stack[this.stack.length-1];Ie.label=Se,Ie.identifier=ha(this.sliceSerialize(ue)).toLowerCase()}function T(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ue}function A(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ue}function k(ue){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Ie=this.sliceSerialize(ue).length;Se.depth=Ie}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function _(ue){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function U(ue){const Ie=this.stack[this.stack.length-1].children;let Ve=Ie[Ie.length-1];(!Ve||Ve.type!=="text")&&(Ve=je(),Ve.position={start:Ni(ue.start),end:void 0},Ie.push(Ve)),this.stack.push(Ve)}function M(ue){const Se=this.stack.pop();Se.value+=this.sliceSerialize(ue),Se.position.end=Ni(ue.end)}function I(ue){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ie=Se.children[Se.children.length-1];Ie.position.end=Ni(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Se.type)&&(U.call(this,ue),M.call(this,ue))}function P(){this.data.atHardBreak=!0}function j(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue}function K(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue}function $(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue}function B(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Se,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function H(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Se,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function Y(ue){const Se=this.sliceSerialize(ue),Ie=this.stack[this.stack.length-2];Ie.label=gz(Se),Ie.identifier=ha(Se).toLowerCase()}function Q(){const ue=this.stack[this.stack.length-1],Se=this.resume(),Ie=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ie.type==="link"){const Ve=ue.children;Ie.children=Ve}else Ie.alt=Se}function z(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ue}function F(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ue}function q(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function W(ue){const Se=this.resume(),Ie=this.stack[this.stack.length-1];Ie.label=Se,Ie.identifier=ha(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function ae(ue){this.data.characterReferenceType=ue.type}function se(ue){const Se=this.sliceSerialize(ue),Ie=this.data.characterReferenceType;let Ve;Ie?(Ve=RT(Se,Ie==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ve=Im(Se);const qe=this.stack[this.stack.length-1];qe.value+=Ve}function me(ue){const Se=this.stack.pop();Se.position.end=Ni(ue.end)}function Ne(ue){M.call(this,ue);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(ue)}function pe(ue){M.call(this,ue);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(ue)}function ee(){return{type:"blockquote",children:[]}}function le(){return{type:"code",lang:null,meta:null,value:""}}function fe(){return{type:"inlineCode",value:""}}function xe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Re(){return{type:"emphasis",children:[]}}function Xe(){return{type:"heading",depth:0,children:[]}}function Ke(){return{type:"break"}}function ot(){return{type:"html",value:""}}function et(){return{type:"image",title:null,url:"",alt:null}}function We(){return{type:"link",title:null,url:"",children:[]}}function ze(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function Je(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function Ye(){return{type:"paragraph",children:[]}}function ut(){return{type:"strong",children:[]}}function je(){return{type:"text",value:""}}function gt(){return{type:"thematicBreak"}}}function Ni(t){return{line:t.line,column:t.column,offset:t.offset}}function jT(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?jT(t,r):bz(t,r)}}function bz(t,e){let n;for(n in e)if(qT.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function Fw(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+lu({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+lu({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+lu({start:e.start,end:e.end})+") is still open")}function Ez(t){const e=this;e.parser=n;function n(r){return mz(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function xz(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function wz(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
338
|
-
`}]}function Sz(t,e){const n=e.value?e.value+`
|
|
339
|
-
`:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(l.data={meta:e.meta}),t.patch(e,l),l=t.applyData(e,l),l={type:"element",tagName:"pre",properties:{},children:[l]},t.patch(e,l),l}function Cz(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Tz(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Dz(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=Ks(r.toLowerCase()),l=t.footnoteOrder.indexOf(r);let s,u=t.footnoteCounts.get(r);u===void 0?(u=0,t.footnoteOrder.push(r),s=t.footnoteOrder.length):s=l+1,u+=1,t.footnoteCounts.set(r,u);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};t.patch(e,f);const c={type:"element",tagName:"sup",properties:{},children:[f]};return t.patch(e,c),t.applyData(e,c)}function Az(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function _z(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function HT(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function Nz(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return HT(t,e);const i={src:Ks(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,l),t.applyData(e,l)}function kz(t,e){const n={src:Ks(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function Rz(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function Mz(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return HT(t,e);const i={href:Ks(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,l),t.applyData(e,l)}function Oz(t,e){const n={href:Ks(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function Bz(t,e,n){const r=t.all(e),i=n?Lz(n):GT(e),l={},s=[];if(typeof e.checked=="boolean"){const h=r[0];let v;h&&h.type==="element"&&h.tagName==="p"?v=h:(v={type:"element",tagName:"p",properties:{},children:[]},r.unshift(v)),v.children.length>0&&v.children.unshift({type:"text",value:" "}),v.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const h=r[u];(i||u!==0||h.type!=="element"||h.tagName!=="p")&&s.push({type:"text",value:`
|
|
340
|
-
`}),h.type==="element"&&h.tagName==="p"&&!i?s.push(...h.children):s.push(h)}const f=r[r.length-1];f&&(i||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
|
|
341
|
-
`});const c={type:"element",tagName:"li",properties:l,children:s};return t.patch(e,c),t.applyData(e,c)}function Lz(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=GT(n[r])}return e}function GT(t){const e=t.spread;return e??t.children.length>1}function Fz(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,l),t.applyData(e,l)}function Iz(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function zz(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function Pz(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Uz(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},u=Mm(e.children[1]),f=ST(e.children[e.children.length-1]);u&&f&&(s.position={start:u,end:f}),i.push(s)}const l={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,l),t.applyData(e,l)}function qz(t,e,n){const r=n?n.children:void 0,l=(r?r.indexOf(e):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,u=s?s.length:e.children.length;let f=-1;const c=[];for(;++f<u;){const v=e.children[f],p={},m=s?s[f]:void 0;m&&(p.align=m);let y={type:"element",tagName:l,properties:p,children:[]};v&&(y.children=t.all(v),t.patch(v,y),y=t.applyData(v,y)),c.push(y)}const h={type:"element",tagName:"tr",properties:{},children:t.wrap(c,!0)};return t.patch(e,h),t.applyData(e,h)}function jz(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const Iw=9,zw=32;function Hz(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const l=[];for(;r;)l.push(Pw(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return l.push(Pw(e.slice(i),i>0,!1)),l.join("")}function Pw(t,e,n){let r=0,i=t.length;if(e){let l=t.codePointAt(r);for(;l===Iw||l===zw;)r++,l=t.codePointAt(r)}if(n){let l=t.codePointAt(i-1);for(;l===Iw||l===zw;)i--,l=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function Gz(t,e){const n={type:"text",value:Hz(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Vz(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const $z={blockquote:xz,break:wz,code:Sz,delete:Cz,emphasis:Tz,footnoteReference:Dz,heading:Az,html:_z,imageReference:Nz,image:kz,inlineCode:Rz,linkReference:Mz,link:Oz,listItem:Bz,list:Fz,paragraph:Iz,root:zz,strong:Pz,table:Uz,tableCell:jz,tableRow:qz,text:Gz,thematicBreak:Vz,toml:ff,yaml:ff,definition:ff,footnoteDefinition:ff};function ff(){}const VT=-1,bd=0,ou=1,Yf=2,Pm=3,Um=4,qm=5,jm=6,$T=7,KT=8,Uw=typeof self=="object"?self:globalThis,Kz=(t,e)=>{const n=(i,l)=>(t.set(l,i),i),r=i=>{if(t.has(i))return t.get(i);const[l,s]=e[i];switch(l){case bd:case VT:return n(s,i);case ou:{const u=n([],i);for(const f of s)u.push(r(f));return u}case Yf:{const u=n({},i);for(const[f,c]of s)u[r(f)]=r(c);return u}case Pm:return n(new Date(s),i);case Um:{const{source:u,flags:f}=s;return n(new RegExp(u,f),i)}case qm:{const u=n(new Map,i);for(const[f,c]of s)u.set(r(f),r(c));return u}case jm:{const u=n(new Set,i);for(const f of s)u.add(r(f));return u}case $T:{const{name:u,message:f}=s;return n(new Uw[u](f),i)}case KT:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:u}=new Uint8Array(s);return n(new DataView(u),s)}}return n(new Uw[l](s),i)};return r},qw=t=>Kz(new Map,t)(0),ws="",{toString:Yz}={},{keys:Xz}=Object,Qo=t=>{const e=typeof t;if(e!=="object"||!t)return[bd,e];const n=Yz.call(t).slice(8,-1);switch(n){case"Array":return[ou,ws];case"Object":return[Yf,ws];case"Date":return[Pm,ws];case"RegExp":return[Um,ws];case"Map":return[qm,ws];case"Set":return[jm,ws];case"DataView":return[ou,n]}return n.includes("Array")?[ou,n]:n.includes("Error")?[$T,n]:[Yf,n]},df=([t,e])=>t===bd&&(e==="function"||e==="symbol"),Zz=(t,e,n,r)=>{const i=(s,u)=>{const f=r.push(s)-1;return n.set(u,f),f},l=s=>{if(n.has(s))return n.get(s);let[u,f]=Qo(s);switch(u){case bd:{let h=s;switch(f){case"bigint":u=KT,h=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+f);h=null;break;case"undefined":return i([VT],s)}return i([u,h],s)}case ou:{if(f){let p=s;return f==="DataView"?p=new Uint8Array(s.buffer):f==="ArrayBuffer"&&(p=new Uint8Array(s)),i([f,[...p]],s)}const h=[],v=i([u,h],s);for(const p of s)h.push(l(p));return v}case Yf:{if(f)switch(f){case"BigInt":return i([f,s.toString()],s);case"Boolean":case"Number":case"String":return i([f,s.valueOf()],s)}if(e&&"toJSON"in s)return l(s.toJSON());const h=[],v=i([u,h],s);for(const p of Xz(s))(t||!df(Qo(s[p])))&&h.push([l(p),l(s[p])]);return v}case Pm:return i([u,s.toISOString()],s);case Um:{const{source:h,flags:v}=s;return i([u,{source:h,flags:v}],s)}case qm:{const h=[],v=i([u,h],s);for(const[p,m]of s)(t||!(df(Qo(p))||df(Qo(m))))&&h.push([l(p),l(m)]);return v}case jm:{const h=[],v=i([u,h],s);for(const p of s)(t||!df(Qo(p)))&&h.push(l(p));return v}}const{message:c}=s;return i([u,{name:f,message:c}],s)};return l},jw=(t,{json:e,lossy:n}={})=>{const r=[];return Zz(!(e||n),!!e,new Map,r)(t),r},Xf=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?qw(jw(t,e)):structuredClone(t):(t,e)=>qw(jw(t,e));function Qz(t,e){const n=[{type:"text",value:"β©"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function Wz(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Jz(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||Qz,r=t.options.footnoteBackLabel||Wz,i=t.options.footnoteLabel||"Footnotes",l=t.options.footnoteLabelTagName||"h2",s=t.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let f=-1;for(;++f<t.footnoteOrder.length;){const c=t.footnoteById.get(t.footnoteOrder[f]);if(!c)continue;const h=t.all(c),v=String(c.identifier).toUpperCase(),p=Ks(v.toLowerCase());let m=0;const y=[],S=t.footnoteCounts.get(v);for(;S!==void 0&&++m<=S;){y.length>0&&y.push({type:"text",value:" "});let C=typeof n=="string"?n:n(f,m);typeof C=="string"&&(C={type:"text",value:C}),y.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,m),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const w=h[h.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const C=w.children[w.children.length-1];C&&C.type==="text"?C.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...y)}else h.push(...y);const E={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(h,!0)};t.patch(c,E),u.push(E)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Xf(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
342
|
-
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(u,!0)},{type:"text",value:`
|
|
343
|
-
`}]}}const Fu=(function(t){if(t==null)return r3;if(typeof t=="function")return Ed(t);if(typeof t=="object")return Array.isArray(t)?e3(t):t3(t);if(typeof t=="string")return n3(t);throw new Error("Expected function, string, or object as test")});function e3(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Fu(t[n]);return Ed(r);function r(...i){let l=-1;for(;++l<e.length;)if(e[l].apply(this,i))return!0;return!1}}function t3(t){const e=t;return Ed(n);function n(r){const i=r;let l;for(l in t)if(i[l]!==e[l])return!1;return!0}}function n3(t){return Ed(e);function e(n){return n&&n.type===t}}function Ed(t){return e;function e(n,r,i){return!!(a3(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function r3(){return!0}function a3(t){return t!==null&&typeof t=="object"&&"type"in t}const YT=[],i3=!0,Wp=!1,l3="skip";function XT(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const l=Fu(i),s=r?-1:1;u(t,void 0,[])();function u(f,c,h){const v=f&&typeof f=="object"?f:{};if(typeof v.type=="string"){const m=typeof v.tagName=="string"?v.tagName:typeof v.name=="string"?v.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(f.type+(m?"<"+m+">":""))+")"})}return p;function p(){let m=YT,y,S,w;if((!e||l(f,c,h[h.length-1]||void 0))&&(m=s3(n(f,h)),m[0]===Wp))return m;if("children"in f&&f.children){const E=f;if(E.children&&m[0]!==l3)for(S=(r?E.children.length:-1)+s,w=h.concat(E);S>-1&&S<E.children.length;){const C=E.children[S];if(y=u(C,S,w)(),y[0]===Wp)return y;S=typeof y[1]=="number"?y[1]:S+s}}return m}}}function s3(t){return Array.isArray(t)?t:typeof t=="number"?[i3,t]:t==null?YT:[t]}function Iu(t,e,n,r){let i,l,s;typeof e=="function"&&typeof n!="function"?(l=void 0,s=e,i=n):(l=e,s=n,i=r),XT(t,l,u,i);function u(f,c){const h=c[c.length-1],v=h?h.children.indexOf(f):void 0;return s(f,v,h)}}const Jp={}.hasOwnProperty,o3={};function u3(t,e){const n=e||o3,r=new Map,i=new Map,l=new Map,s={...$z,...n.handlers},u={all:c,applyData:f3,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:s,one:f,options:n,patch:c3,wrap:h3};return Iu(t,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const v=h.type==="definition"?r:i,p=String(h.identifier).toUpperCase();v.has(p)||v.set(p,h)}}),u;function f(h,v){const p=h.type,m=u.handlers[p];if(Jp.call(u.handlers,p)&&m)return m(u,h,v);if(u.options.passThrough&&u.options.passThrough.includes(p)){if("children"in h){const{children:S,...w}=h,E=Xf(w);return E.children=u.all(h),E}return Xf(h)}return(u.options.unknownHandler||d3)(u,h,v)}function c(h){const v=[];if("children"in h){const p=h.children;let m=-1;for(;++m<p.length;){const y=u.one(p[m],h);if(y){if(m&&p[m-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=Hw(y.value)),!Array.isArray(y)&&y.type==="element")){const S=y.children[0];S&&S.type==="text"&&(S.value=Hw(S.value))}Array.isArray(y)?v.push(...y):v.push(y)}}}return v}}function c3(t,e){t.position&&(e.position=WL(t))}function f3(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,l=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&l&&Object.assign(n.properties,Xf(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function d3(t,e){const n=e.data||{},r="value"in e&&!(Jp.call(n,"hProperties")||Jp.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function h3(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
|
|
344
|
-
`});++r<t.length;)r&&n.push({type:"text",value:`
|
|
345
|
-
`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
|
|
346
|
-
`}),n}function Hw(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function Gw(t,e){const n=u3(t,e),r=n.one(t,void 0),i=Jz(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
|
|
347
|
-
`},i),l}function v3(t,e){return t&&"run"in t?async function(n,r){const i=Gw(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Gw(n,{file:r,...t||e})}}function Vw(t){if(t)throw t}var cp,$w;function g3(){if($w)return cp;$w=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):e.call(c)==="[object Array]"},l=function(c){if(!c||e.call(c)!=="[object Object]")return!1;var h=t.call(c,"constructor"),v=c.constructor&&c.constructor.prototype&&t.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!h&&!v)return!1;var p;for(p in c);return typeof p>"u"||t.call(c,p)},s=function(c,h){n&&h.name==="__proto__"?n(c,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):c[h.name]=h.newValue},u=function(c,h){if(h==="__proto__")if(t.call(c,h)){if(r)return r(c,h).value}else return;return c[h]};return cp=function f(){var c,h,v,p,m,y,S=arguments[0],w=1,E=arguments.length,C=!1;for(typeof S=="boolean"&&(C=S,S=arguments[1]||{},w=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});w<E;++w)if(c=arguments[w],c!=null)for(h in c)v=u(S,h),p=u(c,h),S!==p&&(C&&p&&(l(p)||(m=i(p)))?(m?(m=!1,y=v&&i(v)?v:[]):y=v&&l(v)?v:{},s(S,{name:h,newValue:f(C,y,p)})):typeof p<"u"&&s(S,{name:h,newValue:p}));return S},cp}var p3=g3();const fp=xu(p3);function em(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function m3(){const t=[],e={run:n,use:r};return e;function n(...i){let l=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);u(null,...i);function u(f,...c){const h=t[++l];let v=-1;if(f){s(f);return}for(;++v<i.length;)(c[v]===null||c[v]===void 0)&&(c[v]=i[v]);i=c,h?y3(h,u)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function y3(t,e){let n;return r;function r(...s){const u=t.length>s.length;let f;u&&s.push(i);try{f=t.apply(this,s)}catch(c){const h=c;if(u&&n)throw h;return i(h)}u||(f&&f.then&&typeof f.then=="function"?f.then(l,i):f instanceof Error?i(f):l(f))}function i(s,...u){n||(n=!0,e(s,...u))}function l(s){i(null,s)}}const Sa={basename:b3,dirname:E3,extname:x3,join:w3,sep:"/"};function b3(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');zu(t);let n=0,r=-1,i=t.length,l;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let s=-1,u=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(l){n=i+1;break}}else s<0&&(l=!0,s=i+1),u>-1&&(t.codePointAt(i)===e.codePointAt(u--)?u<0&&(r=i):(u=-1,r=s));return n===r?r=s:r<0&&(r=t.length),t.slice(n,r)}function E3(t){if(zu(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function x3(t){zu(t);let e=t.length,n=-1,r=0,i=-1,l=0,s;for(;e--;){const u=t.codePointAt(e);if(u===47){if(s){r=e+1;break}continue}n<0&&(s=!0,n=e+1),u===46?i<0?i=e:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function w3(...t){let e=-1,n;for(;++e<t.length;)zu(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":S3(n)}function S3(t){zu(t);const e=t.codePointAt(0)===47;let n=C3(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function C3(t,e){let n="",r=0,i=-1,l=0,s=-1,u,f;for(;++s<=t.length;){if(s<t.length)u=t.codePointAt(s);else{if(u===47)break;u=47}if(u===47){if(!(i===s-1||l===1))if(i!==s-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),i=s,l=0;continue}}else if(n.length>0){n="",r=0,i=s,l=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),r=s-i-1;i=s,l=0}else u===46&&l>-1?l++:l=-1}return n}function zu(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const T3={cwd:D3};function D3(){return"/"}function tm(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function A3(t){if(typeof t=="string")t=new URL(t);else if(!tm(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return _3(t)}function _3(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const dp=["history","path","basename","stem","extname","dirname"];class ZT{constructor(e){let n;e?tm(e)?n={path:e}:typeof e=="string"||N3(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":T3.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<dp.length;){const l=dp[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)dp.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Sa.basename(this.path):void 0}set basename(e){vp(e,"basename"),hp(e,"basename"),this.path=Sa.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Sa.dirname(this.path):void 0}set dirname(e){Kw(this.basename,"dirname"),this.path=Sa.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Sa.extname(this.path):void 0}set extname(e){if(hp(e,"extname"),Kw(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Sa.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){tm(e)&&(e=A3(e)),vp(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Sa.basename(this.path,this.extname):void 0}set stem(e){vp(e,"stem"),hp(e,"stem"),this.path=Sa.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new vr(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function hp(t,e){if(t&&t.includes(Sa.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Sa.sep+"`")}function vp(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function Kw(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function N3(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const k3=(function(t){const r=this.constructor.prototype,i=r[t],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),R3={}.hasOwnProperty;class Hm extends k3{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=m3()}copy(){const e=new Hm;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(fp(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(mp("data",this.frozen),this.namespace[e]=n,this):R3.call(this.namespace,e)&&this.namespace[e]||void 0:e?(mp("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=hf(e),r=this.parser||this.Parser;return gp("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),gp("process",this.parser||this.Parser),pp("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,s){const u=hf(e),f=r.parse(u);r.run(f,u,function(h,v,p){if(h||!v||!p)return c(h);const m=v,y=r.stringify(m,p);B3(y)?p.value=y:p.result=y,c(h,p)});function c(h,v){h||!v?s(h):l?l(v):n(void 0,v)}}}processSync(e){let n=!1,r;return this.freeze(),gp("processSync",this.parser||this.Parser),pp("processSync",this.compiler||this.Compiler),this.process(e,i),Xw("processSync","process",n),r;function i(l,s){n=!0,Vw(l),r=s}}run(e,n,r){Yw(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(s,u){const f=hf(n);i.run(e,f,c);function c(h,v,p){const m=v||e;h?u(h):s?s(m):r(void 0,m,p)}}}runSync(e,n){let r=!1,i;return this.run(e,n,l),Xw("runSync","run",r),i;function l(s,u){Vw(s),i=u,r=!0}}stringify(e,n){this.freeze();const r=hf(n),i=this.compiler||this.Compiler;return pp("stringify",i),Yw(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(mp("use",this.frozen),e!=null)if(typeof e=="function")f(e,n);else if(typeof e=="object")Array.isArray(e)?u(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function l(c){if(typeof c=="function")f(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[h,...v]=c;f(h,v)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(c.plugins),c.settings&&(i.settings=fp(!0,i.settings,c.settings))}function u(c){let h=-1;if(c!=null)if(Array.isArray(c))for(;++h<c.length;){const v=c[h];l(v)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function f(c,h){let v=-1,p=-1;for(;++v<r.length;)if(r[v][0]===c){p=v;break}if(p===-1)r.push([c,...h]);else if(h.length>0){let[m,...y]=h;const S=r[p][1];em(S)&&em(m)&&(m=fp(!0,S,m)),r[p]=[c,m,...y]}}}}const M3=new Hm().freeze();function gp(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function pp(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function mp(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Yw(t){if(!em(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Xw(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function hf(t){return O3(t)?t:new ZT(t)}function O3(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function B3(t){return typeof t=="string"||L3(t)}function L3(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const F3="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Zw=[],Qw={allowDangerousHtml:!0},I3=/^(https?|ircs?|mailto|xmpp)$/i,z3=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function P3(t){const e=U3(t),n=q3(t);return j3(e.runSync(e.parse(n),n),t)}function U3(t){const e=t.rehypePlugins||Zw,n=t.remarkPlugins||Zw,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Qw}:Qw;return M3().use(Ez).use(n).use(v3,r).use(e)}function q3(t){const e=t.children||"",n=new ZT;return typeof e=="string"&&(n.value=e),n}function j3(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,l=e.disallowedElements,s=e.skipHtml,u=e.unwrapDisallowed,f=e.urlTransform||H3;for(const h of z3)Object.hasOwn(e,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+F3+h.id,void 0);return e.className&&(t={type:"element",tagName:"div",properties:{className:e.className},children:t.type==="root"?t.children:[t]}),Iu(t,c),rF(t,{Fragment:D.Fragment,components:i,ignoreInvalidStyle:!0,jsx:D.jsx,jsxs:D.jsxs,passKeys:!0,passNode:!0});function c(h,v,p){if(h.type==="raw"&&p&&typeof v=="number")return s?p.children.splice(v,1):p.children[v]={type:"text",value:h.value},v;if(h.type==="element"){let m;for(m in sp)if(Object.hasOwn(sp,m)&&Object.hasOwn(h.properties,m)){const y=h.properties[m],S=sp[m];(S===null||S.includes(h.tagName))&&(h.properties[m]=f(String(y||""),m,h))}}if(h.type==="element"){let m=n?!n.includes(h.tagName):l?l.includes(h.tagName):!1;if(!m&&r&&typeof v=="number"&&(m=!r(h,v,p)),m&&p&&typeof v=="number")return u&&h.children?p.children.splice(v,1,...h.children):p.children.splice(v,1),v}}}function H3(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||I3.test(t.slice(0,e))?t:""}const Ww=(function(t,e,n){const r=Fu(n);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<t.children.length;)if(r(t.children[e],e,t))return t.children[e]}),Ml=(function(t){if(t==null)return $3;if(typeof t=="string")return V3(t);if(typeof t=="object")return G3(t);if(typeof t=="function")return Gm(t);throw new Error("Expected function, string, or array as `test`")});function G3(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Ml(t[n]);return Gm(r);function r(...i){let l=-1;for(;++l<e.length;)if(e[l].apply(this,i))return!0;return!1}}function V3(t){return Gm(e);function e(n){return n.tagName===t}}function Gm(t){return e;function e(n,r,i){return!!(K3(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function $3(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="element"&&"tagName"in t&&typeof t.tagName=="string")}function K3(t){return t!==null&&typeof t=="object"&&"type"in t&&"tagName"in t}const Jw=/\n/g,eS=/[\t ]+/g,nm=Ml("br"),tS=Ml(t5),Y3=Ml("p"),nS=Ml("tr"),X3=Ml(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",e5,n5]),QT=Ml(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function Z3(t,e){const n=e||{},r="children"in t?t.children:[],i=QT(t),l=eD(t,{whitespace:n.whitespace||"normal"}),s=[];(t.type==="text"||t.type==="comment")&&s.push(...JT(t,{breakBefore:!0,breakAfter:!0}));let u=-1;for(;++u<r.length;)s.push(...WT(r[u],t,{whitespace:l,breakBefore:u?void 0:i,breakAfter:u<r.length-1?nm(r[u+1]):i}));const f=[];let c;for(u=-1;++u<s.length;){const h=s[u];typeof h=="number"?c!==void 0&&h>c&&(c=h):h&&(c!==void 0&&c>-1&&f.push(`
|
|
348
|
-
`.repeat(c)||" "),c=-1,f.push(h))}return f.join("")}function WT(t,e,n){return t.type==="element"?Q3(t,e,n):t.type==="text"?n.whitespace==="normal"?JT(t,n):W3(t):[]}function Q3(t,e,n){const r=eD(t,n),i=t.children||[];let l=-1,s=[];if(X3(t))return s;let u,f;for(nm(t)||nS(t)&&Ww(e,t,nS)?f=`
|
|
349
|
-
`:Y3(t)?(u=2,f=2):QT(t)&&(u=1,f=1);++l<i.length;)s=s.concat(WT(i[l],t,{whitespace:r,breakBefore:l?void 0:u,breakAfter:l<i.length-1?nm(i[l+1]):f}));return tS(t)&&Ww(e,t,tS)&&s.push(" "),u&&s.unshift(u),f&&s.push(f),s}function JT(t,e){const n=String(t.value),r=[],i=[];let l=0;for(;l<=n.length;){Jw.lastIndex=l;const f=Jw.exec(n),c=f&&"index"in f?f.index:n.length;r.push(J3(n.slice(l,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),l===0?e.breakBefore:!0,c===n.length?e.breakAfter:!0)),l=c+1}let s=-1,u;for(;++s<r.length;)r[s].charCodeAt(r[s].length-1)===8203||s<r.length-1&&r[s+1].charCodeAt(0)===8203?(i.push(r[s]),u=void 0):r[s]?(typeof u=="number"&&i.push(u),i.push(r[s]),u=0):(s===0||s===r.length-1)&&i.push(0);return i}function W3(t){return[String(t.value)]}function J3(t,e,n){const r=[];let i=0,l;for(;i<t.length;){eS.lastIndex=i;const s=eS.exec(t);l=s?s.index:t.length,!i&&!l&&s&&!e&&r.push(""),i!==l&&r.push(t.slice(i,l)),i=s?l+s[0].length:l}return i!==l&&!n&&r.push(""),r.join(" ")}function eD(t,e){if(t.type==="element"){const n=t.properties||{};switch(t.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function e5(t){return!!(t.properties||{}).hidden}function t5(t){return t.tagName==="td"||t.tagName==="th"}function n5(t){return t.tagName==="dialog"&&!(t.properties||{}).open}function r5(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",u={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},v={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},m=e.optional(i)+t.IDENT_RE+"\\s*\\(",y=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],S=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],E=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],A={type:S,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:E},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},N=[k,v,u,n,t.C_BLOCK_COMMENT_MODE,h,c],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:N.concat([{begin:/\(/,end:/\)/,keywords:A,contains:N.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+s+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:A,relevance:0},{begin:m,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,h]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,h,u,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,h,u]}]},u,n,t.C_BLOCK_COMMENT_MODE,v]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(_,O,k,N,[v,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:A,contains:["self",u]},{begin:t.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function a5(t){const e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=r5(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function i5(t){const e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},l=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(u);const f={match:/\\"/},c={className:"string",begin:/'/,end:/'/},h={match:/\\'/},v={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],m=t.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),y={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},S=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],w=["true","false"],E={match:/(\/[a-z._-]+)+/},C=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],T=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],A=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:S,literal:w,built_in:[...C,...T,"set","shopt",...A,...k]},contains:[m,t.SHEBANG(),y,v,l,s,E,u,f,c,h,n]}}function l5(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",u={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},v={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},m=e.optional(i)+t.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},E=[v,u,n,t.C_BLOCK_COMMENT_MODE,h,c],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:E.concat([{begin:/\(/,end:/\)/,keywords:w,contains:E.concat(["self"]),relevance:0}]),relevance:0},T={begin:"("+s+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:m,returnBegin:!0,contains:[t.inherit(p,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,h,u,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,h,u]}]},u,n,t.C_BLOCK_COMMENT_MODE,v]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"</",contains:[].concat(C,T,E,[v,{begin:t.IDENT_RE+"::",keywords:w},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:v,strings:c,keywords:w}}}function s5(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",u={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},v={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},m=e.optional(i)+t.IDENT_RE+"\\s*\\(",y=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],S=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],E=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],A={type:S,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:E},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},N=[k,v,u,n,t.C_BLOCK_COMMENT_MODE,h,c],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:N.concat([{begin:/\(/,end:/\)/,keywords:A,contains:N.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+s+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:A,relevance:0},{begin:m,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,h]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,h,u,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,h,u]}]},u,n,t.C_BLOCK_COMMENT_MODE,v]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(_,O,k,N,[v,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:A,contains:["self",u]},{begin:t.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function o5(t){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],l=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(l),built_in:e,literal:r},u=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},h={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},v=t.inherit(h,{illegal:/\n/}),p={className:"subst",begin:/\{/,end:/\}/,keywords:s},m=t.inherit(p,{illegal:/\n/}),y={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,m]},S={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]},w=t.inherit(S,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});p.contains=[S,y,h,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,t.C_BLOCK_COMMENT_MODE],m.contains=[w,y,v,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const E={variants:[c,S,y,h,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},C={begin:"<",end:">",contains:[{beginKeywords:"in out"},u]},T=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",A={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},E,f,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},u,C,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[u,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[u,C,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+T+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,C],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[E,f,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},A]}}const u5=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),c5=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],f5=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],d5=[...c5,...f5],h5=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),v5=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),g5=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),p5=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function m5(t){const e=t.regex,n=u5(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",l=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",u=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+v5.join("|")+")"},{begin:":(:)?("+g5.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+p5.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:l},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:h5.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+d5.join("|")+")\\b"}]}}function y5(t){const e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function b5(t){const l={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:l,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:l,illegal:/["']/}]}]}}function E5(t){const e=t.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(n,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function x5(t){const e=t.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},r=t.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},l={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},u={begin:/\[/,end:/\]/,contains:[r,l,i,s,n,"self"],relevance:0},f=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,h=/'[^']*'/,v=e.either(f,c,h),p=e.concat(v,"(\\s*\\.\\s*",v,")*",e.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:p,className:"attr",starts:{end:/$/,contains:[r,u,l,i,s,n]}}]}}var Ts="[0-9](_*[0-9])*",vf=`\\.(${Ts})`,gf="[0-9a-fA-F](_*[0-9a-fA-F])*",rS={className:"number",variants:[{begin:`(\\b(${Ts})((${vf})|\\.)?|(${vf}))[eE][+-]?(${Ts})[fFdD]?\\b`},{begin:`\\b(${Ts})((${vf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${vf})[fFdD]?\\b`},{begin:`\\b(${Ts})[fFdD]\\b`},{begin:`\\b0[xX]((${gf})\\.?|(${gf})?\\.(${gf}))[pP][+-]?(${Ts})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${gf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function tD(t,e,n){return n===-1?"":t.replace(e,r=>tD(t,e,n-1))}function w5(t){const e=t.regex,n="[Γ-ΚΈa-zA-Z_$][Γ-ΚΈa-zA-Z_$0-9]*",r=n+tD("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),f={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},h={className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:f,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:f,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,rS,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},rS,c]}}const aS="[A-Za-z$_][0-9A-Za-z$_]*",S5=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],C5=["true","false","null","undefined","NaN","Infinity"],nD=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],rD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],aD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],T5=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],D5=[].concat(aD,nD,rD);function A5(t){const e=t.regex,n=(Y,{after:Q})=>{const z="</"+Y[0].slice(1);return Y.input.indexOf(z,Q)!==-1},r=aS,i={begin:"<>",end:"</>"},l=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Y,Q)=>{const z=Y[0].length+Y.index,F=Y.input[z];if(F==="<"||F===","){Q.ignoreMatch();return}F===">"&&(n(Y,{after:z})||Q.ignoreMatch());let q;const L=Y.input.substring(z);if(q=L.match(/^\s*=/)){Q.ignoreMatch();return}if((q=L.match(/^\s+extends\s+/))&&q.index===0){Q.ignoreMatch();return}}},u={$pattern:aS,keyword:S5,literal:C5,built_in:D5,"variable.language":T5},f="[0-9](_?[0-9])*",c=`\\.(${f})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",v={className:"number",variants:[{begin:`(\\b(${h})((${c})|\\.)?|(${c}))[eE][+-]?(${f})\\b`},{begin:`\\b(${h})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,p]},C={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},T=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,y,S,w,{match:/\$\d+/},v];p.contains=T.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(T)});const A=[].concat(C,p.contains),k=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:k},_={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},O={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...nD,...rD]}},U={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},M={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function P(Y){return e.concat("(?!",Y.join("|"),")")}const j={match:e.concat(/\b/,P([...aD,"super","import"].map(Y=>`${Y}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},$={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},B="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(B)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),U,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,y,S,w,C,{match:/\$\d+/},v,O,{scope:"attr",match:r+e.lookahead(":"),relevance:0},H,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,t.REGEXP_MODE,{className:"function",begin:B,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:l},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},M,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},j,I,_,$,{match:/\$[(.]/}]}}function _5(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[e,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Ds="[0-9](_*[0-9])*",pf=`\\.(${Ds})`,mf="[0-9a-fA-F](_*[0-9a-fA-F])*",N5={className:"number",variants:[{begin:`(\\b(${Ds})((${pf})|\\.)?|(${pf}))[eE][+-]?(${Ds})[fFdD]?\\b`},{begin:`\\b(${Ds})((${pf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${pf})[fFdD]?\\b`},{begin:`\\b(${Ds})[fFdD]\\b`},{begin:`\\b0[xX]((${mf})\\.?|(${mf})?\\.(${mf}))[pP][+-]?(${Ds})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${mf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function k5(t){const e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},l={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[l,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,l,i]}]};i.contains.push(s);const u={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},f={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(s,{className:"string"}),"self"]}]},c=N5,h=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),v={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},p=v;return p.variants[1].contains=[v],v.variants[1].contains=[p],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,h,n,r,u,f,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[v,t.C_LINE_COMMENT_MODE,h],relevance:0},t.C_LINE_COMMENT_MODE,h,u,f,s,t.C_NUMBER_MODE]},h]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},u,f]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
350
|
-
`},c]}}const R5=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),M5=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],O5=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],B5=[...M5,...O5],L5=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),iD=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),lD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),F5=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),I5=iD.concat(lD).sort().reverse();function z5(t){const e=R5(t),n=I5,r="and or not only",i="[\\w-]+",l="("+i+"|@\\{"+i+"\\})",s=[],u=[],f=function(T){return{className:"string",begin:"~?"+T+".*?"+T}},c=function(T,A,k){return{className:T,begin:A,relevance:k}},h={$pattern:/[a-z-]+/,keyword:r,attribute:L5.join(" ")},v={begin:"\\(",end:"\\)",contains:u,keywords:h,relevance:0};u.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,f("'"),f('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,v,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const p=u.concat({begin:/\{/,end:/\}/,contains:s}),m={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(u)},y={begin:l+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+F5.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:u}}]},S={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:h,returnEnd:!0,contains:u,relevance:0}},w={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:p}},E={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:l,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,m,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+B5.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,c("selector-tag",l,0),c("selector-id","#"+l),c("selector-class","\\."+l,0),c("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+iD.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+lD.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:p},{begin:"!important"},e.FUNCTION_DISPATCH]},C={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[E]};return s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,S,w,C,y,E,m,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function P5(t){const e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function U5(t){const e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,n]},i={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},l={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},s={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,e,n,r,i,l,s]}}function q5(t){const e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},l={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,f={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},v=t.inherit(c,{contains:[]}),p=t.inherit(h,{contains:[]});c.contains.push(p),h.contains.push(v);let m=[n,f];return[c,h,v,p].forEach(E=>{E.contains=E.contains.concat(m)}),m=m.concat(c,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:m},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:m}]}]},n,l,c,h,{className:"quote",begin:"^>\\s+",contains:m,end:"$"},i,r,f,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function j5(t){const e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,u={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},f={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:u,illegal:"</",contains:[e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+f.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:f,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function H5(t){const e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},l={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},u={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},f={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[u]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},h=[t.BACKSLASH_ESCAPE,l,f],v=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],p=(S,w,E="\\1")=>{const C=E==="\\1"?E:e.concat(E,w);return e.concat(e.concat("(?:",S,")"),w,/(?:\\.|[^\\\/])*?/,C,/(?:\\.|[^\\\/])*?/,E,r)},m=(S,w,E)=>e.concat(e.concat("(?:",S,")"),w,/(?:\\.|[^\\\/])*?/,E,r),y=[f,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:h,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:p("s|tr|y",e.either(...v,{capture:!0}))},{begin:p("s|tr|y","\\(","\\)")},{begin:p("s|tr|y","\\[","\\]")},{begin:p("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:m("(?:m|qr)?",/\//,/\//)},{begin:m("m|qr",e.either(...v,{capture:!0}),/\1/)},{begin:m("m|qr",/\(/,/\)/)},{begin:m("m|qr",/\[/,/\]/)},{begin:m("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,u]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,u,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return l.contains=y,s.contains=y,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:y}}function G5(t){const e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),l=e.concat(/[A-Z]+/,n),s={scope:"variable",match:"\\$+"+r},u={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},f={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=t.inherit(t.APOS_STRING_MODE,{illegal:null}),h=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(f)}),v={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(f),"on:begin":(K,$)=>{$.data._beginMatch=K[1]||K[2]},"on:end":(K,$)=>{$.data._beginMatch!==K[1]&&$.ignoreMatch()}},p=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[
|
|
351
|
-
]`,y={scope:"string",variants:[h,c,v,p]},S={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},w=["false","null","true"],E=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],C=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],A={keyword:E,literal:(K=>{const $=[];return K.forEach(B=>{$.push(B),B.toLowerCase()===B?$.push(B.toUpperCase()):$.push(B.toLowerCase())}),$})(w),built_in:C},k=K=>K.map($=>$.replace(/\|\d+$/,"")),N={variants:[{match:[/new/,e.concat(m,"+"),e.concat("(?!",k(C).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},_=e.concat(r,"\\b(?!\\()"),O={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),_],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),_],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},U={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},M={relevance:0,begin:/\(/,end:/\)/,keywords:A,contains:[U,s,O,t.C_BLOCK_COMMENT_MODE,y,S,N]},I={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",k(E).join("\\b|"),"|",k(C).join("\\b|"),"\\b)"),r,e.concat(m,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[M]};M.contains.push(I);const P=[U,O,t.C_BLOCK_COMMENT_MODE,y,S,N],j={begin:e.concat(/#\[\s*\\?/,e.either(i,l)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...P]},...P,{scope:"meta",variants:[{match:i},{match:l}]}]};return{case_insensitive:!1,keywords:A,contains:[j,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},u,{scope:"variable.language",match:/\$this\b/},s,I,O,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},N,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:A,contains:["self",j,s,O,t.C_BLOCK_COMMENT_MODE,y,S]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},y,S]}}function V5(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function $5(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function K5(t){const e=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},f={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},h={begin:/\{\{/,relevance:0},v={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,f,h,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,f,h,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,h,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,h,c]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",m=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,y=`\\b|${r.join("|")}`,S={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${m}))[eE][+-]?(${p})[jJ]?(?=${y})`},{begin:`(${m})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${y})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${y})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${y})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${y})`},{begin:`\\b(${p})[jJ](?=${y})`}]},w={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},E={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",f,S,v,t.HASH_COMMENT_MODE]}]};return c.contains=[v,S,f],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[f,S,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},v,w,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[E]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[S,E,v]}]}}function Y5(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function X5(t){const e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,l=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[l,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:l},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Z5(t){const e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},u={className:"doctag",begin:"@[A-Za-z]+"},f={begin:"#<",end:">"},c=[t.COMMENT("#","$",{contains:[u]}),t.COMMENT("^=begin","^=end",{contains:[u],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],h={className:"subst",begin:/#\{/,end:/\}/,keywords:s},v={className:"string",contains:[t.BACKSLASH_ESCAPE,h],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,h]})]}]},p="[1-9](_?[0-9])*|0",m="[0-9](_?[0-9])*",y={className:"number",relevance:0,variants:[{begin:`\\b(${p})(\\.(${m}))?([eE][+-]?(${m})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},S={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},N=[v,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[S]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[v,{begin:n}],relevance:0},y,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,h],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(f,c),relevance:0}].concat(f,c);h.contains=N,S.contains=N;const M=[{begin:/^\s*=>/,starts:{end:"$",contains:N}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:N}}];return c.unshift(f),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(M).concat(c).concat(N)}}function Q5(t){const e=t.regex,n=/(r#)?/,r=e.concat(n,t.UNDERSCORE_IDENT_RE),i=e.concat(n,t.IDENT_RE),l={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,e.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",u=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],f=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],h=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:h,keyword:u,literal:f,built_in:c},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:h}},{className:"punctuation",begin:"->"},l]}}const W5=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),J5=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],e4=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],t4=[...J5,...e4],n4=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),r4=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),a4=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),i4=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function l4(t){const e=W5(t),n=a4,r=r4,i="@[a-z-]+",l="and or not only",u={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+t4.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},u,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+i4.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,u,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:n4.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},u,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function s4(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function o4(t){const e=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},l=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],u=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],f=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],h=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],v=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],p=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],m=h,y=[...c,...f].filter(k=>!h.includes(k)),S={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},E={match:e.concat(/\b/,e.either(...m),/\s*\(/),relevance:0,keywords:{built_in:m}};function C(k){return e.concat(/\b/,e.either(...k.map(N=>N.replace(/\s+/,"\\s+"))),/\b/)}const T={scope:"keyword",match:C(p),relevance:0};function A(k,{exceptions:N,when:_}={}){const O=_;return N=N||[],k.map(U=>U.match(/\|\d+$/)||N.includes(U)?U:O(U)?`${U}|0`:U)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(y,{when:k=>k.length<3}),literal:l,type:u,built_in:v},contains:[{scope:"type",match:C(s)},T,E,S,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,w]}}function sD(t){return t?typeof t=="string"?t:t.source:null}function Wo(t){return tn("(?=",t,")")}function tn(...t){return t.map(n=>sD(n)).join("")}function u4(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function mr(...t){return"("+(u4(t).capture?"":"?:")+t.map(r=>sD(r)).join("|")+")"}const Vm=t=>tn(/\b/,t,/\w$/.test(t)?/\b/:/\B/),c4=["Protocol","Type"].map(Vm),iS=["init","self"].map(Vm),f4=["Any","Self"],yp=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],lS=["false","nil","true"],d4=["assignment","associativity","higherThan","left","lowerThan","none","right"],h4=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],sS=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],oD=mr(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),uD=mr(oD,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),bp=tn(oD,uD,"*"),cD=mr(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Zf=mr(cD,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),wa=tn(cD,Zf,"*"),yf=tn(/[A-Z]/,Zf,"*"),v4=["attached","autoclosure",tn(/convention\(/,mr("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",tn(/objc\(/,wa,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],g4=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function p4(t){const e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,mr(...c4,...iS)],className:{2:"keyword"}},l={match:tn(/\./,mr(...yp)),relevance:0},s=yp.filter(Ke=>typeof Ke=="string").concat(["_|0"]),u=yp.filter(Ke=>typeof Ke!="string").concat(f4).map(Vm),f={variants:[{className:"keyword",match:mr(...u,...iS)}]},c={$pattern:mr(/\b\w+/,/#\w+/),keyword:s.concat(h4),literal:lS},h=[i,l,f],v={match:tn(/\./,mr(...sS)),relevance:0},p={className:"built_in",match:tn(/\b/,mr(...sS),/(?=\()/)},m=[v,p],y={match:/->/,relevance:0},S={className:"operator",relevance:0,variants:[{match:bp},{match:`\\.(\\.|${uD})+`}]},w=[y,S],E="([0-9]_*)+",C="([0-9a-fA-F]_*)+",T={className:"number",relevance:0,variants:[{match:`\\b(${E})(\\.(${E}))?([eE][+-]?(${E}))?\\b`},{match:`\\b0x(${C})(\\.(${C}))?([pP][+-]?(${E}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},A=(Ke="")=>({className:"subst",variants:[{match:tn(/\\/,Ke,/[0\\tnr"']/)},{match:tn(/\\/,Ke,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(Ke="")=>({className:"subst",match:tn(/\\/,Ke,/[\t ]*(?:[\r\n]|\r\n)/)}),N=(Ke="")=>({className:"subst",label:"interpol",begin:tn(/\\/,Ke,/\(/),end:/\)/}),_=(Ke="")=>({begin:tn(Ke,/"""/),end:tn(/"""/,Ke),contains:[A(Ke),k(Ke),N(Ke)]}),O=(Ke="")=>({begin:tn(Ke,/"/),end:tn(/"/,Ke),contains:[A(Ke),N(Ke)]}),U={className:"string",variants:[_(),_("#"),_("##"),_("###"),O(),O("#"),O("##"),O("###")]},M=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],I={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:M},P=Ke=>{const ot=tn(Ke,/\//),et=tn(/\//,Ke);return{begin:ot,end:et,contains:[...M,{scope:"comment",begin:`#(?!.*${et})`,end:/$/}]}},j={scope:"regexp",variants:[P("###"),P("##"),P("#"),I]},K={match:tn(/`/,wa,/`/)},$={className:"variable",match:/\$\d+/},B={className:"variable",match:`\\$${Zf}+`},H=[K,$,B],Y={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:g4,contains:[...w,T,U]}]}},Q={scope:"keyword",match:tn(/@/,mr(...v4),Wo(mr(/\(/,/\s+/)))},z={scope:"meta",match:tn(/@/,wa)},F=[Y,Q,z],q={match:Wo(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:tn(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Zf,"+")},{className:"type",match:yf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:tn(/\s+&\s+/,Wo(yf)),relevance:0}]},L={begin:/</,end:/>/,keywords:c,contains:[...r,...h,...F,y,q]};q.contains.push(L);const W={match:tn(wa,/\s*:/),keywords:"_|0",relevance:0},ae={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",W,...r,j,...h,...m,...w,T,U,...H,...F,q]},se={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,q]},me={begin:mr(Wo(tn(wa,/\s*:/)),Wo(tn(wa,/\s+/,wa,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:wa}]},Ne={begin:/\(/,end:/\)/,keywords:c,contains:[me,...r,...h,...w,T,U,...F,q,ae],endsParent:!0,illegal:/["']/},pe={match:[/(func|macro)/,/\s+/,mr(K.match,wa,bp)],className:{1:"keyword",3:"title.function"},contains:[se,Ne,e],illegal:[/\[/,/%/]},ee={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[se,Ne,e],illegal:/\[|%/},le={match:[/operator/,/\s+/,bp],className:{1:"keyword",3:"title"}},fe={begin:[/precedencegroup/,/\s+/,yf],className:{1:"keyword",3:"title"},contains:[q],keywords:[...d4,...lS],end:/}/},xe={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Re={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Xe={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,wa,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[se,...h,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:yf},...h],relevance:0}]};for(const Ke of U.variants){const ot=Ke.contains.find(We=>We.label==="interpol");ot.keywords=c;const et=[...h,...m,...w,T,U,...H];ot.contains=[...et,{begin:/\(/,end:/\)/,contains:["self",...et]}]}return{name:"Swift",keywords:c,contains:[...r,pe,ee,xe,Re,Xe,le,fe,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},j,...h,...m,...w,T,U,...H,...F,q,ae]}}const Qf="[A-Za-z$_][0-9A-Za-z$_]*",fD=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],dD=["true","false","null","undefined","NaN","Infinity"],hD=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],vD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],gD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],pD=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],mD=[].concat(gD,hD,vD);function m4(t){const e=t.regex,n=(Y,{after:Q})=>{const z="</"+Y[0].slice(1);return Y.input.indexOf(z,Q)!==-1},r=Qf,i={begin:"<>",end:"</>"},l=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Y,Q)=>{const z=Y[0].length+Y.index,F=Y.input[z];if(F==="<"||F===","){Q.ignoreMatch();return}F===">"&&(n(Y,{after:z})||Q.ignoreMatch());let q;const L=Y.input.substring(z);if(q=L.match(/^\s*=/)){Q.ignoreMatch();return}if((q=L.match(/^\s+extends\s+/))&&q.index===0){Q.ignoreMatch();return}}},u={$pattern:Qf,keyword:fD,literal:dD,built_in:mD,"variable.language":pD},f="[0-9](_?[0-9])*",c=`\\.(${f})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",v={className:"number",variants:[{begin:`(\\b(${h})((${c})|\\.)?|(${c}))[eE][+-]?(${f})\\b`},{begin:`\\b(${h})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,p]},C={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},T=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,y,S,w,{match:/\$\d+/},v];p.contains=T.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(T)});const A=[].concat(C,p.contains),k=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:k},_={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},O={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...hD,...vD]}},U={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},M={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function P(Y){return e.concat("(?!",Y.join("|"),")")}const j={match:e.concat(/\b/,P([...gD,"super","import"].map(Y=>`${Y}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},$={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},B="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(B)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),U,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,y,S,w,C,{match:/\$\d+/},v,O,{scope:"attr",match:r+e.lookahead(":"),relevance:0},H,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,t.REGEXP_MODE,{className:"function",begin:B,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:l},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},M,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},j,I,_,$,{match:/\$[(.]/}]}}function y4(t){const e=t.regex,n=m4(t),r=Qf,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],l={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},f=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:Qf,keyword:fD.concat(f),literal:dD,built_in:mD.concat(i),"variable.language":pD},h={className:"meta",begin:"@"+r},v=(S,w,E)=>{const C=S.contains.findIndex(T=>T.label===w);if(C===-1)throw new Error("can not find mode to replace");S.contains.splice(C,1,E)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(h);const p=n.contains.find(S=>S.scope==="attr"),m=Object.assign({},p,{match:e.concat(r,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,p,m]),n.contains=n.contains.concat([h,l,s,m]),v(n,"shebang",t.SHEBANG()),v(n,"use_strict",u);const y=n.contains.find(S=>S.label==="func.def");return y.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function b4(t){const e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,l=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,u=/\d{1,2}(:\d{1,2}){1,2}/,f={className:"literal",variants:[{begin:e.concat(/# */,e.either(l,i),/ *#/)},{begin:e.concat(/# */,u,/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,e.either(l,i),/ +/,e.either(s,u),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},h={className:"label",begin:/^\w+:/},v=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),p=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,f,c,h,v,p,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[p]}]}}function E4(t){t.regex;const e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");const n=t.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},l={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},u={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},f={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},l,s,i,t.QUOTE_STRING_MODE,f,c,u]}}function x4(t){const e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},l={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(l,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),f=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[l,f,u,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[l,s,f,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[f]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function w4(t){const e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},l={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},u=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},y={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},S={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},w=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},p,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},y,S,l,s],E=[...w];return E.pop(),E.push(u),m.contains=E,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}const S4={arduino:a5,bash:i5,c:l5,cpp:s5,csharp:o5,css:m5,diff:y5,go:b5,graphql:E5,ini:x5,java:w5,javascript:A5,json:_5,kotlin:k5,less:z5,lua:P5,makefile:U5,markdown:q5,objectivec:j5,perl:H5,php:G5,"php-template":V5,plaintext:$5,python:K5,"python-repl":Y5,r:X5,ruby:Z5,rust:Q5,scss:l4,shell:s4,sql:o4,swift:p4,typescript:y4,vbnet:b4,wasm:E4,xml:x4,yaml:w4};var Ep,oS;function C4(){if(oS)return Ep;oS=1;function t(X){return X instanceof Map?X.clear=X.delete=X.set=function(){throw new Error("map is read-only")}:X instanceof Set&&(X.add=X.clear=X.delete=function(){throw new Error("set is read-only")}),Object.freeze(X),Object.getOwnPropertyNames(X).forEach(re=>{const Ce=X[re],Oe=typeof Ce;(Oe==="object"||Oe==="function")&&!Object.isFrozen(Ce)&&t(Ce)}),X}class e{constructor(re){re.data===void 0&&(re.data={}),this.data=re.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(X){return X.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(X,...re){const Ce=Object.create(null);for(const Oe in X)Ce[Oe]=X[Oe];return re.forEach(function(Oe){for(const yt in Oe)Ce[yt]=Oe[yt]}),Ce}const i="</span>",l=X=>!!X.scope,s=(X,{prefix:re})=>{if(X.startsWith("language:"))return X.replace("language:","language-");if(X.includes(".")){const Ce=X.split(".");return[`${re}${Ce.shift()}`,...Ce.map((Oe,yt)=>`${Oe}${"_".repeat(yt+1)}`)].join(" ")}return`${re}${X}`};class u{constructor(re,Ce){this.buffer="",this.classPrefix=Ce.classPrefix,re.walk(this)}addText(re){this.buffer+=n(re)}openNode(re){if(!l(re))return;const Ce=s(re.scope,{prefix:this.classPrefix});this.span(Ce)}closeNode(re){l(re)&&(this.buffer+=i)}value(){return this.buffer}span(re){this.buffer+=`<span class="${re}">`}}const f=(X={})=>{const re={children:[]};return Object.assign(re,X),re};class c{constructor(){this.rootNode=f(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(re){this.top.children.push(re)}openNode(re){const Ce=f({scope:re});this.add(Ce),this.stack.push(Ce)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(re){return this.constructor._walk(re,this.rootNode)}static _walk(re,Ce){return typeof Ce=="string"?re.addText(Ce):Ce.children&&(re.openNode(Ce),Ce.children.forEach(Oe=>this._walk(re,Oe)),re.closeNode(Ce)),re}static _collapse(re){typeof re!="string"&&re.children&&(re.children.every(Ce=>typeof Ce=="string")?re.children=[re.children.join("")]:re.children.forEach(Ce=>{c._collapse(Ce)}))}}class h extends c{constructor(re){super(),this.options=re}addText(re){re!==""&&this.add(re)}startScope(re){this.openNode(re)}endScope(){this.closeNode()}__addSublanguage(re,Ce){const Oe=re.root;Ce&&(Oe.scope=`language:${Ce}`),this.add(Oe)}toHTML(){return new u(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function v(X){return X?typeof X=="string"?X:X.source:null}function p(X){return S("(?=",X,")")}function m(X){return S("(?:",X,")*")}function y(X){return S("(?:",X,")?")}function S(...X){return X.map(Ce=>v(Ce)).join("")}function w(X){const re=X[X.length-1];return typeof re=="object"&&re.constructor===Object?(X.splice(X.length-1,1),re):{}}function E(...X){return"("+(w(X).capture?"":"?:")+X.map(Oe=>v(Oe)).join("|")+")"}function C(X){return new RegExp(X.toString()+"|").exec("").length-1}function T(X,re){const Ce=X&&X.exec(re);return Ce&&Ce.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function k(X,{joinWith:re}){let Ce=0;return X.map(Oe=>{Ce+=1;const yt=Ce;let dt=v(Oe),He="";for(;dt.length>0;){const Be=A.exec(dt);if(!Be){He+=dt;break}He+=dt.substring(0,Be.index),dt=dt.substring(Be.index+Be[0].length),Be[0][0]==="\\"&&Be[1]?He+="\\"+String(Number(Be[1])+yt):(He+=Be[0],Be[0]==="("&&Ce++)}return He}).map(Oe=>`(${Oe})`).join(re)}const N=/\b\B/,_="[a-zA-Z]\\w*",O="[a-zA-Z_]\\w*",U="\\b\\d+(\\.\\d+)?",M="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",I="\\b(0b[01]+)",P="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",j=(X={})=>{const re=/^#![ ]*\//;return X.binary&&(X.begin=S(re,/.*\b/,X.binary,/\b.*/)),r({scope:"meta",begin:re,end:/$/,relevance:0,"on:begin":(Ce,Oe)=>{Ce.index!==0&&Oe.ignoreMatch()}},X)},K={begin:"\\\\[\\s\\S]",relevance:0},$={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[K]},B={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[K]},H={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Y=function(X,re,Ce={}){const Oe=r({scope:"comment",begin:X,end:re,contains:[]},Ce);Oe.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const yt=E("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Oe.contains.push({begin:S(/[ ]+/,"(",yt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Oe},Q=Y("//","$"),z=Y("/\\*","\\*/"),F=Y("#","$"),q={scope:"number",begin:U,relevance:0},L={scope:"number",begin:M,relevance:0},W={scope:"number",begin:I,relevance:0},ae={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[K,{begin:/\[/,end:/\]/,relevance:0,contains:[K]}]},se={scope:"title",begin:_,relevance:0},me={scope:"title",begin:O,relevance:0},Ne={begin:"\\.\\s*"+O,relevance:0};var ee=Object.freeze({__proto__:null,APOS_STRING_MODE:$,BACKSLASH_ESCAPE:K,BINARY_NUMBER_MODE:W,BINARY_NUMBER_RE:I,COMMENT:Y,C_BLOCK_COMMENT_MODE:z,C_LINE_COMMENT_MODE:Q,C_NUMBER_MODE:L,C_NUMBER_RE:M,END_SAME_AS_BEGIN:function(X){return Object.assign(X,{"on:begin":(re,Ce)=>{Ce.data._beginMatch=re[1]},"on:end":(re,Ce)=>{Ce.data._beginMatch!==re[1]&&Ce.ignoreMatch()}})},HASH_COMMENT_MODE:F,IDENT_RE:_,MATCH_NOTHING_RE:N,METHOD_GUARD:Ne,NUMBER_MODE:q,NUMBER_RE:U,PHRASAL_WORDS_MODE:H,QUOTE_STRING_MODE:B,REGEXP_MODE:ae,RE_STARTERS_RE:P,SHEBANG:j,TITLE_MODE:se,UNDERSCORE_IDENT_RE:O,UNDERSCORE_TITLE_MODE:me});function le(X,re){X.input[X.index-1]==="."&&re.ignoreMatch()}function fe(X,re){X.className!==void 0&&(X.scope=X.className,delete X.className)}function xe(X,re){re&&X.beginKeywords&&(X.begin="\\b("+X.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",X.__beforeBegin=le,X.keywords=X.keywords||X.beginKeywords,delete X.beginKeywords,X.relevance===void 0&&(X.relevance=0))}function Re(X,re){Array.isArray(X.illegal)&&(X.illegal=E(...X.illegal))}function Xe(X,re){if(X.match){if(X.begin||X.end)throw new Error("begin & end are not supported with match");X.begin=X.match,delete X.match}}function Ke(X,re){X.relevance===void 0&&(X.relevance=1)}const ot=(X,re)=>{if(!X.beforeMatch)return;if(X.starts)throw new Error("beforeMatch cannot be used with starts");const Ce=Object.assign({},X);Object.keys(X).forEach(Oe=>{delete X[Oe]}),X.keywords=Ce.keywords,X.begin=S(Ce.beforeMatch,p(Ce.begin)),X.starts={relevance:0,contains:[Object.assign(Ce,{endsParent:!0})]},X.relevance=0,delete Ce.beforeMatch},et=["of","and","for","in","not","or","if","then","parent","list","value"],We="keyword";function ze(X,re,Ce=We){const Oe=Object.create(null);return typeof X=="string"?yt(Ce,X.split(" ")):Array.isArray(X)?yt(Ce,X):Object.keys(X).forEach(function(dt){Object.assign(Oe,ze(X[dt],re,dt))}),Oe;function yt(dt,He){re&&(He=He.map(Be=>Be.toLowerCase())),He.forEach(function(Be){const Ze=Be.split("|");Oe[Ze[0]]=[dt,Je(Ze[0],Ze[1])]})}}function Je(X,re){return re?Number(re):Ye(X)?0:1}function Ye(X){return et.includes(X.toLowerCase())}const ut={},je=X=>{console.error(X)},gt=(X,...re)=>{console.log(`WARN: ${X}`,...re)},ue=(X,re)=>{ut[`${X}/${re}`]||(console.log(`Deprecated as of ${X}. ${re}`),ut[`${X}/${re}`]=!0)},Se=new Error;function Ie(X,re,{key:Ce}){let Oe=0;const yt=X[Ce],dt={},He={};for(let Be=1;Be<=re.length;Be++)He[Be+Oe]=yt[Be],dt[Be+Oe]=!0,Oe+=C(re[Be-1]);X[Ce]=He,X[Ce]._emit=dt,X[Ce]._multi=!0}function Ve(X){if(Array.isArray(X.begin)){if(X.skip||X.excludeBegin||X.returnBegin)throw je("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Se;if(typeof X.beginScope!="object"||X.beginScope===null)throw je("beginScope must be object"),Se;Ie(X,X.begin,{key:"beginScope"}),X.begin=k(X.begin,{joinWith:""})}}function qe(X){if(Array.isArray(X.end)){if(X.skip||X.excludeEnd||X.returnEnd)throw je("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Se;if(typeof X.endScope!="object"||X.endScope===null)throw je("endScope must be object"),Se;Ie(X,X.end,{key:"endScope"}),X.end=k(X.end,{joinWith:""})}}function Fe(X){X.scope&&typeof X.scope=="object"&&X.scope!==null&&(X.beginScope=X.scope,delete X.scope)}function be(X){Fe(X),typeof X.beginScope=="string"&&(X.beginScope={_wrap:X.beginScope}),typeof X.endScope=="string"&&(X.endScope={_wrap:X.endScope}),Ve(X),qe(X)}function G(X){function re(He,Be){return new RegExp(v(He),"m"+(X.case_insensitive?"i":"")+(X.unicodeRegex?"u":"")+(Be?"g":""))}class Ce{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Be,Ze){Ze.position=this.position++,this.matchIndexes[this.matchAt]=Ze,this.regexes.push([Ze,Be]),this.matchAt+=C(Be)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Be=this.regexes.map(Ze=>Ze[1]);this.matcherRe=re(k(Be,{joinWith:"|"}),!0),this.lastIndex=0}exec(Be){this.matcherRe.lastIndex=this.lastIndex;const Ze=this.matcherRe.exec(Be);if(!Ze)return null;const Et=Ze.findIndex((Rn,Kt)=>Kt>0&&Rn!==void 0),xt=this.matchIndexes[Et];return Ze.splice(0,Et),Object.assign(Ze,xt)}}class Oe{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Be){if(this.multiRegexes[Be])return this.multiRegexes[Be];const Ze=new Ce;return this.rules.slice(Be).forEach(([Et,xt])=>Ze.addRule(Et,xt)),Ze.compile(),this.multiRegexes[Be]=Ze,Ze}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Be,Ze){this.rules.push([Be,Ze]),Ze.type==="begin"&&this.count++}exec(Be){const Ze=this.getMatcher(this.regexIndex);Ze.lastIndex=this.lastIndex;let Et=Ze.exec(Be);if(this.resumingScanAtSamePosition()&&!(Et&&Et.index===this.lastIndex)){const xt=this.getMatcher(0);xt.lastIndex=this.lastIndex+1,Et=xt.exec(Be)}return Et&&(this.regexIndex+=Et.position+1,this.regexIndex===this.count&&this.considerAll()),Et}}function yt(He){const Be=new Oe;return He.contains.forEach(Ze=>Be.addRule(Ze.begin,{rule:Ze,type:"begin"})),He.terminatorEnd&&Be.addRule(He.terminatorEnd,{type:"end"}),He.illegal&&Be.addRule(He.illegal,{type:"illegal"}),Be}function dt(He,Be){const Ze=He;if(He.isCompiled)return Ze;[fe,Xe,be,ot].forEach(xt=>xt(He,Be)),X.compilerExtensions.forEach(xt=>xt(He,Be)),He.__beforeBegin=null,[xe,Re,Ke].forEach(xt=>xt(He,Be)),He.isCompiled=!0;let Et=null;return typeof He.keywords=="object"&&He.keywords.$pattern&&(He.keywords=Object.assign({},He.keywords),Et=He.keywords.$pattern,delete He.keywords.$pattern),Et=Et||/\w+/,He.keywords&&(He.keywords=ze(He.keywords,X.case_insensitive)),Ze.keywordPatternRe=re(Et,!0),Be&&(He.begin||(He.begin=/\B|\b/),Ze.beginRe=re(Ze.begin),!He.end&&!He.endsWithParent&&(He.end=/\B|\b/),He.end&&(Ze.endRe=re(Ze.end)),Ze.terminatorEnd=v(Ze.end)||"",He.endsWithParent&&Be.terminatorEnd&&(Ze.terminatorEnd+=(He.end?"|":"")+Be.terminatorEnd)),He.illegal&&(Ze.illegalRe=re(He.illegal)),He.contains||(He.contains=[]),He.contains=[].concat(...He.contains.map(function(xt){return de(xt==="self"?He:xt)})),He.contains.forEach(function(xt){dt(xt,Ze)}),He.starts&&dt(He.starts,Be),Ze.matcher=yt(Ze),Ze}if(X.compilerExtensions||(X.compilerExtensions=[]),X.contains&&X.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return X.classNameAliases=r(X.classNameAliases||{}),dt(X)}function ne(X){return X?X.endsWithParent||ne(X.starts):!1}function de(X){return X.variants&&!X.cachedVariants&&(X.cachedVariants=X.variants.map(function(re){return r(X,{variants:null},re)})),X.cachedVariants?X.cachedVariants:ne(X)?r(X,{starts:X.starts?r(X.starts):null}):Object.isFrozen(X)?r(X):X}var oe="11.11.1";class Ee extends Error{constructor(re,Ce){super(re),this.name="HTMLInjectionError",this.html=Ce}}const Pe=n,De=r,Qe=Symbol("nomatch"),$e=7,rt=function(X){const re=Object.create(null),Ce=Object.create(null),Oe=[];let yt=!0;const dt="Could not find the language '{}', did you forget to load/include a language module?",He={disableAutodetect:!0,name:"Plain text",contains:[]};let Be={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:h};function Ze(ke){return Be.noHighlightRe.test(ke)}function Et(ke){let at=ke.className+" ";at+=ke.parentNode?ke.parentNode.className:"";const St=Be.languageDetectRe.exec(at);if(St){const te=Un(St[1]);return te||(gt(dt.replace("{}",St[1])),gt("Falling back to no-highlight mode for this block.",ke)),te?St[1]:"no-highlight"}return at.split(/\s+/).find(te=>Ze(te)||Un(te))}function xt(ke,at,St){let te="",_e="";typeof at=="object"?(te=ke,St=at.ignoreIllegals,_e=at.language):(ue("10.7.0","highlight(lang, code, ...args) has been deprecated."),ue("10.7.0",`Please use highlight(code, options) instead.
|
|
352
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),_e=ke,te=at),St===void 0&&(St=!0);const Me={code:te,language:_e};wr("before:highlight",Me);const bt=Me.result?Me.result:Rn(Me.language,Me.code,St);return bt.code=Me.code,wr("after:highlight",bt),bt}function Rn(ke,at,St,te){const _e=Object.create(null);function Me(Ue,lt){return Ue.keywords[lt]}function bt(){if(!mt.keywords){Mn.addText(Yt);return}let Ue=0;mt.keywordPatternRe.lastIndex=0;let lt=mt.keywordPatternRe.exec(Yt),Ct="";for(;lt;){Ct+=Yt.substring(Ue,lt.index);const Bt=Wn.case_insensitive?lt[0].toLowerCase():lt[0],En=Me(mt,Bt);if(En){const[Yr,Zs]=En;if(Mn.addText(Ct),Ct="",_e[Bt]=(_e[Bt]||0)+1,_e[Bt]<=$e&&(ei+=Zs),Yr.startsWith("_"))Ct+=lt[0];else{const qu=Wn.classNameAliases[Yr]||Yr;cn(lt[0],qu)}}else Ct+=lt[0];Ue=mt.keywordPatternRe.lastIndex,lt=mt.keywordPatternRe.exec(Yt)}Ct+=Yt.substring(Ue),Mn.addText(Ct)}function Tn(){if(Yt==="")return;let Ue=null;if(typeof mt.subLanguage=="string"){if(!re[mt.subLanguage]){Mn.addText(Yt);return}Ue=Rn(mt.subLanguage,Yt,!0,Uu[mt.subLanguage]),Uu[mt.subLanguage]=Ue._top}else Ue=pn(Yt,mt.subLanguage.length?mt.subLanguage:null);mt.relevance>0&&(ei+=Ue.relevance),Mn.__addSublanguage(Ue._emitter,Ue.language)}function At(){mt.subLanguage!=null?Tn():bt(),Yt=""}function cn(Ue,lt){Ue!==""&&(Mn.startScope(lt),Mn.addText(Ue),Mn.endScope())}function Ol(Ue,lt){let Ct=1;const Bt=lt.length-1;for(;Ct<=Bt;){if(!Ue._emit[Ct]){Ct++;continue}const En=Wn.classNameAliases[Ue[Ct]]||Ue[Ct],Yr=lt[Ct];En?cn(Yr,En):(Yt=Yr,bt(),Yt=""),Ct++}}function Yi(Ue,lt){return Ue.scope&&typeof Ue.scope=="string"&&Mn.openNode(Wn.classNameAliases[Ue.scope]||Ue.scope),Ue.beginScope&&(Ue.beginScope._wrap?(cn(Yt,Wn.classNameAliases[Ue.beginScope._wrap]||Ue.beginScope._wrap),Yt=""):Ue.beginScope._multi&&(Ol(Ue.beginScope,lt),Yt="")),mt=Object.create(Ue,{parent:{value:mt}}),mt}function Xi(Ue,lt,Ct){let Bt=T(Ue.endRe,Ct);if(Bt){if(Ue["on:end"]){const En=new e(Ue);Ue["on:end"](lt,En),En.isMatchIgnored&&(Bt=!1)}if(Bt){for(;Ue.endsParent&&Ue.parent;)Ue=Ue.parent;return Ue}}if(Ue.endsWithParent)return Xi(Ue.parent,lt,Ct)}function Bl(Ue){return mt.matcher.regexIndex===0?(Yt+=Ue[0],1):(ti=!0,0)}function xd(Ue){const lt=Ue[0],Ct=Ue.rule,Bt=new e(Ct),En=[Ct.__beforeBegin,Ct["on:begin"]];for(const Yr of En)if(Yr&&(Yr(Ue,Bt),Bt.isMatchIgnored))return Bl(lt);return Ct.skip?Yt+=lt:(Ct.excludeBegin&&(Yt+=lt),At(),!Ct.returnBegin&&!Ct.excludeBegin&&(Yt=lt)),Yi(Ct,Ue),Ct.returnBegin?0:lt.length}function Sr(Ue){const lt=Ue[0],Ct=at.substring(Ue.index),Bt=Xi(mt,Ue,Ct);if(!Bt)return Qe;const En=mt;mt.endScope&&mt.endScope._wrap?(At(),cn(lt,mt.endScope._wrap)):mt.endScope&&mt.endScope._multi?(At(),Ol(mt.endScope,Ue)):En.skip?Yt+=lt:(En.returnEnd||En.excludeEnd||(Yt+=lt),At(),En.excludeEnd&&(Yt=lt));do mt.scope&&Mn.closeNode(),!mt.skip&&!mt.subLanguage&&(ei+=mt.relevance),mt=mt.parent;while(mt!==Bt.parent);return Bt.starts&&Yi(Bt.starts,Ue),En.returnEnd?0:lt.length}function Ys(){const Ue=[];for(let lt=mt;lt!==Wn;lt=lt.parent)lt.scope&&Ue.unshift(lt.scope);Ue.forEach(lt=>Mn.openNode(lt))}let Zi={};function Ll(Ue,lt){const Ct=lt&<[0];if(Yt+=Ue,Ct==null)return At(),0;if(Zi.type==="begin"&<.type==="end"&&Zi.index===lt.index&&Ct===""){if(Yt+=at.slice(lt.index,lt.index+1),!yt){const Bt=new Error(`0 width match regex (${ke})`);throw Bt.languageName=ke,Bt.badRule=Zi.rule,Bt}return 1}if(Zi=lt,lt.type==="begin")return xd(lt);if(lt.type==="illegal"&&!St){const Bt=new Error('Illegal lexeme "'+Ct+'" for mode "'+(mt.scope||"<unnamed>")+'"');throw Bt.mode=mt,Bt}else if(lt.type==="end"){const Bt=Sr(lt);if(Bt!==Qe)return Bt}if(lt.type==="illegal"&&Ct==="")return Yt+=`
|
|
353
|
-
`,1;if(Xs>1e5&&Xs>lt.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Yt+=Ct,Ct.length}const Wn=Un(ke);if(!Wn)throw je(dt.replace("{}",ke)),new Error('Unknown language: "'+ke+'"');const Pu=G(Wn);let Fl="",mt=te||Pu;const Uu={},Mn=new Be.__emitter(Be);Ys();let Yt="",ei=0,Na=0,Xs=0,ti=!1;try{if(Wn.__emitTokens)Wn.__emitTokens(at,Mn);else{for(mt.matcher.considerAll();;){Xs++,ti?ti=!1:mt.matcher.considerAll(),mt.matcher.lastIndex=Na;const Ue=mt.matcher.exec(at);if(!Ue)break;const lt=at.substring(Na,Ue.index),Ct=Ll(lt,Ue);Na=Ue.index+Ct}Ll(at.substring(Na))}return Mn.finalize(),Fl=Mn.toHTML(),{language:ke,value:Fl,relevance:ei,illegal:!1,_emitter:Mn,_top:mt}}catch(Ue){if(Ue.message&&Ue.message.includes("Illegal"))return{language:ke,value:Pe(at),illegal:!0,relevance:0,_illegalBy:{message:Ue.message,index:Na,context:at.slice(Na-100,Na+100),mode:Ue.mode,resultSoFar:Fl},_emitter:Mn};if(yt)return{language:ke,value:Pe(at),illegal:!1,relevance:0,errorRaised:Ue,_emitter:Mn,_top:mt};throw Ue}}function Kt(ke){const at={value:Pe(ke),illegal:!1,relevance:0,_top:He,_emitter:new Be.__emitter(Be)};return at._emitter.addText(ke),at}function pn(ke,at){at=at||Be.languages||Object.keys(re);const St=Kt(ke),te=at.filter(Un).filter($r).map(At=>Rn(At,ke,!1));te.unshift(St);const _e=te.sort((At,cn)=>{if(At.relevance!==cn.relevance)return cn.relevance-At.relevance;if(At.language&&cn.language){if(Un(At.language).supersetOf===cn.language)return 1;if(Un(cn.language).supersetOf===At.language)return-1}return 0}),[Me,bt]=_e,Tn=Me;return Tn.secondBest=bt,Tn}function wn(ke,at,St){const te=at&&Ce[at]||St;ke.classList.add("hljs"),ke.classList.add(`language-${te}`)}function Tt(ke){let at=null;const St=Et(ke);if(Ze(St))return;if(wr("before:highlightElement",{el:ke,language:St}),ke.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ke);return}if(ke.children.length>0&&(Be.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ke)),Be.throwUnescapedHTML))throw new Ee("One of your code blocks includes unescaped HTML.",ke.innerHTML);at=ke;const te=at.textContent,_e=St?xt(te,{language:St,ignoreIllegals:!0}):pn(te);ke.innerHTML=_e.value,ke.dataset.highlighted="yes",wn(ke,St,_e.language),ke.result={language:_e.language,re:_e.relevance,relevance:_e.relevance},_e.secondBest&&(ke.secondBest={language:_e.secondBest.language,relevance:_e.secondBest.relevance}),wr("after:highlightElement",{el:ke,result:_e,text:te})}function mn(ke){Be=De(Be,ke)}const $n=()=>{bn(),ue("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Sn(){bn(),ue("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let yn=!1;function bn(){function ke(){bn()}if(document.readyState==="loading"){yn||window.addEventListener("DOMContentLoaded",ke,!1),yn=!0;return}document.querySelectorAll(Be.cssSelector).forEach(Tt)}function Vr(ke,at){let St=null;try{St=at(X)}catch(te){if(je("Language definition for '{}' could not be registered.".replace("{}",ke)),yt)je(te);else throw te;St=He}St.name||(St.name=ke),re[ke]=St,St.rawDefinition=at.bind(null,X),St.aliases&&or(St.aliases,{languageName:ke})}function Cn(ke){delete re[ke];for(const at of Object.keys(Ce))Ce[at]===ke&&delete Ce[at]}function sr(){return Object.keys(re)}function Un(ke){return ke=(ke||"").toLowerCase(),re[ke]||re[Ce[ke]]}function or(ke,{languageName:at}){typeof ke=="string"&&(ke=[ke]),ke.forEach(St=>{Ce[St.toLowerCase()]=at})}function $r(ke){const at=Un(ke);return at&&!at.disableAutodetect}function Kr(ke){ke["before:highlightBlock"]&&!ke["before:highlightElement"]&&(ke["before:highlightElement"]=at=>{ke["before:highlightBlock"](Object.assign({block:at.el},at))}),ke["after:highlightBlock"]&&!ke["after:highlightElement"]&&(ke["after:highlightElement"]=at=>{ke["after:highlightBlock"](Object.assign({block:at.el},at))})}function nn(ke){Kr(ke),Oe.push(ke)}function sa(ke){const at=Oe.indexOf(ke);at!==-1&&Oe.splice(at,1)}function wr(ke,at){const St=ke;Oe.forEach(function(te){te[St]&&te[St](at)})}function Qn(ke){return ue("10.7.0","highlightBlock will be removed entirely in v12.0"),ue("10.7.0","Please use highlightElement now."),Tt(ke)}Object.assign(X,{highlight:xt,highlightAuto:pn,highlightAll:bn,highlightElement:Tt,highlightBlock:Qn,configure:mn,initHighlighting:$n,initHighlightingOnLoad:Sn,registerLanguage:Vr,unregisterLanguage:Cn,listLanguages:sr,getLanguage:Un,registerAliases:or,autoDetection:$r,inherit:De,addPlugin:nn,removePlugin:sa}),X.debugMode=function(){yt=!1},X.safeMode=function(){yt=!0},X.versionString=oe,X.regex={concat:S,lookahead:p,either:E,optional:y,anyNumberOfTimes:m};for(const ke in ee)typeof ee[ke]=="object"&&t(ee[ke]);return Object.assign(X,ee),X},it=rt({});return it.newInstance=()=>rt({}),Ep=it,it.HighlightJS=it,it.default=it,Ep}var T4=C4();const D4=xu(T4),uS={},A4="hljs-";function _4(t){const e=D4.newInstance();return t&&l(t),{highlight:n,highlightAuto:r,listLanguages:i,register:l,registerAlias:s,registered:u};function n(f,c,h){const v=h||uS,p=typeof v.prefix=="string"?v.prefix:A4;if(!e.getLanguage(f))throw new Error("Unknown language: `"+f+"` is not registered");e.configure({__emitter:N4,classPrefix:p});const m=e.highlight(c,{ignoreIllegals:!0,language:f});if(m.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:m.errorRaised});const y=m._emitter.root,S=y.data;return S.language=m.language,S.relevance=m.relevance,y}function r(f,c){const v=(c||uS).subset||i();let p=-1,m=0,y;for(;++p<v.length;){const S=v[p];if(!e.getLanguage(S))continue;const w=n(S,f,c);w.data&&w.data.relevance!==void 0&&w.data.relevance>m&&(m=w.data.relevance,y=w)}return y||{type:"root",children:[],data:{language:void 0,relevance:m}}}function i(){return e.listLanguages()}function l(f,c){if(typeof f=="string")e.registerLanguage(f,c);else{let h;for(h in f)Object.hasOwn(f,h)&&e.registerLanguage(h,f[h])}}function s(f,c){if(typeof f=="string")e.registerAliases(typeof c=="string"?c:[...c],{languageName:f});else{let h;for(h in f)if(Object.hasOwn(f,h)){const v=f[h];e.registerAliases(typeof v=="string"?v:[...v],{languageName:h})}}}function u(f){return!!e.getLanguage(f)}}class N4{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){const r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){const n=this,r=e.split(".").map(function(s,u){return u?s+"_".repeat(u):n.options.classPrefix+s}),i=this.stack[this.stack.length-1],l={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(l),this.stack.push(l)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const k4={};function R4(t){const e=t||k4,n=e.aliases,r=e.detect||!1,i=e.languages||S4,l=e.plainText,s=e.prefix,u=e.subset;let f="hljs";const c=_4(i);if(n&&c.registerAlias(n),s){const h=s.indexOf("-");f=h===-1?s:s.slice(0,h)}return function(h,v){Iu(h,"element",function(p,m,y){if(p.tagName!=="code"||!y||y.type!=="element"||y.tagName!=="pre")return;const S=M4(p);if(S===!1||!S&&!r||S&&l&&l.includes(S))return;Array.isArray(p.properties.className)||(p.properties.className=[]),p.properties.className.includes(f)||p.properties.className.unshift(f);const w=Z3(p,{whitespace:"pre"});let E;try{E=S?c.highlight(S,w,{prefix:s}):c.highlightAuto(w,{prefix:s,subset:u})}catch(C){const T=C;if(S&&/Unknown language/.test(T.message)){v.message("Cannot highlight as `"+S+"`, itβs not registered",{ancestors:[y,p],cause:T,place:p.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw T}!S&&E.data&&E.data.language&&p.properties.className.push("language-"+E.data.language),E.children.length>0&&(p.children=E.children)})}}function M4(t){const e=t.properties.className;let n=-1;if(!Array.isArray(e))return;let r;for(;++n<e.length;){const i=String(e[n]);if(i==="no-highlight"||i==="nohighlight")return!1;!r&&i.slice(0,5)==="lang-"&&(r=i.slice(5)),!r&&i.slice(0,9)==="language-"&&(r=i.slice(9))}return r}const O4=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g,B4=Object.hasOwnProperty;class L4{constructor(){this.occurrences,this.reset()}slug(e,n){const r=this;let i=F4(e,n===!0);const l=i;for(;B4.call(r.occurrences,i);)r.occurrences[l]++,i=l+"-"+r.occurrences[l];return r.occurrences[i]=0,i}reset(){this.occurrences=Object.create(null)}}function F4(t,e){return typeof t!="string"?"":(e||(t=t.toLowerCase()),t.replace(O4,"").replace(/ /g,"-"))}function I4(t){const e=t.type==="element"?t.tagName.toLowerCase():"",n=e.length===2&&e.charCodeAt(0)===104?e.charCodeAt(1):0;return n>48&&n<55?n-48:void 0}function z4(t){return"children"in t?yD(t):"value"in t?t.value:""}function P4(t){return t.type==="text"?t.value:"children"in t?yD(t):""}function yD(t){let e=-1;const n=[];for(;++e<t.children.length;)n[e]=P4(t.children[e]);return n.join("")}const U4={},cS=new L4;function q4(t){const n=(t||U4).prefix||"";return function(r){cS.reset(),Iu(r,"element",function(i){I4(i)&&!i.properties.id&&(i.properties.id=n+cS.slug(z4(i)))})}}function fS(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function j4(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function H4(t,e,n){const i=Fu((n||{}).ignore||[]),l=G4(e);let s=-1;for(;++s<l.length;)XT(t,"text",u);function u(c,h){let v=-1,p;for(;++v<h.length;){const m=h[v],y=p?p.children:void 0;if(i(m,y?y.indexOf(m):void 0,p))return;p=m}if(p)return f(c,h)}function f(c,h){const v=h[h.length-1],p=l[s][0],m=l[s][1];let y=0;const w=v.children.indexOf(c);let E=!1,C=[];p.lastIndex=0;let T=p.exec(c.value);for(;T;){const A=T.index,k={index:T.index,input:T.input,stack:[...h,c]};let N=m(...T,k);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?p.lastIndex=A+1:(y!==A&&C.push({type:"text",value:c.value.slice(y,A)}),Array.isArray(N)?C.push(...N):N&&C.push(N),y=A+T[0].length,E=!0),!p.global)break;T=p.exec(c.value)}return E?(y<c.value.length&&C.push({type:"text",value:c.value.slice(y)}),v.children.splice(w,1,...C)):C=[c],w+C.length}}function G4(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const i=n[r];e.push([V4(i[0]),$4(i[1])])}return e}function V4(t){return typeof t=="string"?new RegExp(j4(t),"g"):t}function $4(t){return typeof t=="function"?t:function(){return t}}const xp="phrasing",wp=["autolink","link","image","label"];function K4(){return{transforms:[eP],enter:{literalAutolink:X4,literalAutolinkEmail:Sp,literalAutolinkHttp:Sp,literalAutolinkWww:Sp},exit:{literalAutolink:J4,literalAutolinkEmail:W4,literalAutolinkHttp:Z4,literalAutolinkWww:Q4}}}function Y4(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:xp,notInConstruct:wp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:xp,notInConstruct:wp},{character:":",before:"[ps]",after:"\\/",inConstruct:xp,notInConstruct:wp}]}}function X4(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Sp(t){this.config.enter.autolinkProtocol.call(this,t)}function Z4(t){this.config.exit.autolinkProtocol.call(this,t)}function Q4(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function W4(t){this.config.exit.autolinkEmail.call(this,t)}function J4(t){this.exit(t)}function eP(t){H4(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,tP],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),nP]],{ignore:["link","linkReference"]})}function tP(t,e,n,r,i){let l="";if(!bD(i)||(/^w/i.test(e)&&(n=e+n,e="",l="http://"),!rP(n)))return!1;const s=aP(n+r);if(!s[0])return!1;const u={type:"link",title:null,url:l+e+s[0],children:[{type:"text",value:e+s[0]}]};return s[1]?[u,{type:"text",value:s[1]}]:u}function nP(t,e,n,r){return!bD(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function rP(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function aP(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const i=fS(t,"(");let l=fS(t,")");for(;r!==-1&&i>l;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[t,n]}function bD(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||_l(n)||md(n))&&(!e||n!==47)}ED.peek=hP;function iP(){this.buffer()}function lP(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function sP(){this.buffer()}function oP(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function uP(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ha(this.sliceSerialize(t)).toLowerCase(),n.label=e}function cP(t){this.exit(t)}function fP(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ha(this.sliceSerialize(t)).toLowerCase(),n.label=e}function dP(t){this.exit(t)}function hP(){return"["}function ED(t,e,n,r){const i=n.createTracker(r);let l=i.move("[^");const s=n.enter("footnoteReference"),u=n.enter("reference");return l+=i.move(n.safe(n.associationId(t),{after:"]",before:l})),u(),s(),l+=i.move("]"),l}function vP(){return{enter:{gfmFootnoteCallString:iP,gfmFootnoteCall:lP,gfmFootnoteDefinitionLabelString:sP,gfmFootnoteDefinition:oP},exit:{gfmFootnoteCallString:uP,gfmFootnoteCall:cP,gfmFootnoteDefinitionLabelString:fP,gfmFootnoteDefinition:dP}}}function gP(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:ED},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,s){const u=l.createTracker(s);let f=u.move("[^");const c=l.enter("footnoteDefinition"),h=l.enter("label");return f+=u.move(l.safe(l.associationId(r),{before:f,after:"]"})),h(),f+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),f+=u.move((e?`
|
|
354
|
-
`:" ")+l.indentLines(l.containerFlow(r,u.current()),e?xD:pP))),c(),f}}function pP(t,e,n){return e===0?t:xD(t,e,n)}function xD(t,e,n){return(n?"":" ")+t}const mP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];wD.peek=wP;function yP(){return{canContainEols:["delete"],enter:{strikethrough:EP},exit:{strikethrough:xP}}}function bP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:mP}],handlers:{delete:wD}}}function EP(t){this.enter({type:"delete",children:[]},t)}function xP(t){this.exit(t)}function wD(t,e,n,r){const i=n.createTracker(r),l=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(t,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),l(),s}function wP(){return"~"}function SP(t){return t.length}function CP(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||SP,l=[],s=[],u=[],f=[];let c=0,h=-1;for(;++h<t.length;){const S=[],w=[];let E=-1;for(t[h].length>c&&(c=t[h].length);++E<t[h].length;){const C=TP(t[h][E]);if(n.alignDelimiters!==!1){const T=i(C);w[E]=T,(f[E]===void 0||T>f[E])&&(f[E]=T)}S.push(C)}s[h]=S,u[h]=w}let v=-1;if(typeof r=="object"&&"length"in r)for(;++v<c;)l[v]=dS(r[v]);else{const S=dS(r);for(;++v<c;)l[v]=S}v=-1;const p=[],m=[];for(;++v<c;){const S=l[v];let w="",E="";S===99?(w=":",E=":"):S===108?w=":":S===114&&(E=":");let C=n.alignDelimiters===!1?1:Math.max(1,f[v]-w.length-E.length);const T=w+"-".repeat(C)+E;n.alignDelimiters!==!1&&(C=w.length+C+E.length,C>f[v]&&(f[v]=C),m[v]=C),p[v]=T}s.splice(1,0,p),u.splice(1,0,m),h=-1;const y=[];for(;++h<s.length;){const S=s[h],w=u[h];v=-1;const E=[];for(;++v<c;){const C=S[v]||"";let T="",A="";if(n.alignDelimiters!==!1){const k=f[v]-(w[v]||0),N=l[v];N===114?T=" ".repeat(k):N===99?k%2?(T=" ".repeat(k/2+.5),A=" ".repeat(k/2-.5)):(T=" ".repeat(k/2),A=T):A=" ".repeat(k)}n.delimiterStart!==!1&&!v&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||v)&&E.push(" "),n.alignDelimiters!==!1&&E.push(T),E.push(C),n.alignDelimiters!==!1&&E.push(A),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||v!==c-1)&&E.push("|")}y.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return y.join(`
|
|
355
|
-
`)}function TP(t){return t==null?"":String(t)}function dS(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function DP(t,e,n,r){const i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const s=n.indentLines(n.containerFlow(t,l.current()),AP);return i(),s}function AP(t,e,n){return">"+(n?"":" ")+t}function _P(t,e){return hS(t,e.inConstruct,!0)&&!hS(t,e.notInConstruct,!1)}function hS(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function vS(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
356
|
-
`&&_P(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
357
|
-
`}function NP(t,e){const n=String(t);let r=n.indexOf(e),i=r,l=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>s&&(s=l):l=1,i=r+e.length,r=n.indexOf(e,i);return s}function kP(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function RP(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function MP(t,e,n,r){const i=RP(n),l=t.value||"",s=i==="`"?"GraveAccent":"Tilde";if(kP(t,n)){const v=n.enter("codeIndented"),p=n.indentLines(l,OP);return v(),p}const u=n.createTracker(r),f=i.repeat(Math.max(NP(l,i)+1,3)),c=n.enter("codeFenced");let h=u.move(f);if(t.lang){const v=n.enter(`codeFencedLang${s}`);h+=u.move(n.safe(t.lang,{before:h,after:" ",encode:["`"],...u.current()})),v()}if(t.lang&&t.meta){const v=n.enter(`codeFencedMeta${s}`);h+=u.move(" "),h+=u.move(n.safe(t.meta,{before:h,after:`
|
|
358
|
-
`,encode:["`"],...u.current()})),v()}return h+=u.move(`
|
|
359
|
-
`),l&&(h+=u.move(l+`
|
|
360
|
-
`)),h+=u.move(f),c(),h}function OP(t,e,n){return(n?"":" ")+t}function $m(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function BP(t,e,n,r){const i=$m(n),l=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let u=n.enter("label");const f=n.createTracker(r);let c=f.move("[");return c+=f.move(n.safe(n.associationId(t),{before:c,after:"]",...f.current()})),c+=f.move("]: "),u(),!t.url||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),c+=f.move("<"),c+=f.move(n.safe(t.url,{before:c,after:">",...f.current()})),c+=f.move(">")):(u=n.enter("destinationRaw"),c+=f.move(n.safe(t.url,{before:c,after:t.title?" ":`
|
|
361
|
-
`,...f.current()}))),u(),t.title&&(u=n.enter(`title${l}`),c+=f.move(" "+i),c+=f.move(n.safe(t.title,{before:c,after:i,...f.current()})),c+=f.move(i),u()),s(),c}function LP(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Eu(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Wf(t,e,n){const r=Ps(t),i=Ps(e);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}SD.peek=FP;function SD(t,e,n,r){const i=LP(n),l=n.enter("emphasis"),s=n.createTracker(r),u=s.move(i);let f=s.move(n.containerPhrasing(t,{after:i,before:u,...s.current()}));const c=f.charCodeAt(0),h=Wf(r.before.charCodeAt(r.before.length-1),c,i);h.inside&&(f=Eu(c)+f.slice(1));const v=f.charCodeAt(f.length-1),p=Wf(r.after.charCodeAt(0),v,i);p.inside&&(f=f.slice(0,-1)+Eu(v));const m=s.move(i);return l(),n.attentionEncodeSurroundingInfo={after:p.outside,before:h.outside},u+f+m}function FP(t,e,n){return n.options.emphasis||"*"}function IP(t,e){let n=!1;return Iu(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Wp}),!!((!t.depth||t.depth<3)&&Fm(t)&&(e.options.setext||n))}function zP(t,e,n,r){const i=Math.max(Math.min(6,t.depth||1),1),l=n.createTracker(r);if(IP(t,n)){const h=n.enter("headingSetext"),v=n.enter("phrasing"),p=n.containerPhrasing(t,{...l.current(),before:`
|
|
362
|
-
`,after:`
|
|
363
|
-
`});return v(),h(),p+`
|
|
364
|
-
`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
365
|
-
`))+1))}const s="#".repeat(i),u=n.enter("headingAtx"),f=n.enter("phrasing");l.move(s+" ");let c=n.containerPhrasing(t,{before:"# ",after:`
|
|
366
|
-
`,...l.current()});return/^[\t ]/.test(c)&&(c=Eu(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),f(),u(),c}CD.peek=PP;function CD(t){return t.value||""}function PP(){return"<"}TD.peek=UP;function TD(t,e,n,r){const i=$m(n),l=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let u=n.enter("label");const f=n.createTracker(r);let c=f.move("![");return c+=f.move(n.safe(t.alt,{before:c,after:"]",...f.current()})),c+=f.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),c+=f.move("<"),c+=f.move(n.safe(t.url,{before:c,after:">",...f.current()})),c+=f.move(">")):(u=n.enter("destinationRaw"),c+=f.move(n.safe(t.url,{before:c,after:t.title?" ":")",...f.current()}))),u(),t.title&&(u=n.enter(`title${l}`),c+=f.move(" "+i),c+=f.move(n.safe(t.title,{before:c,after:i,...f.current()})),c+=f.move(i),u()),c+=f.move(")"),s(),c}function UP(){return"!"}DD.peek=qP;function DD(t,e,n,r){const i=t.referenceType,l=n.enter("imageReference");let s=n.enter("label");const u=n.createTracker(r);let f=u.move("![");const c=n.safe(t.alt,{before:f,after:"]",...u.current()});f+=u.move(c+"]["),s();const h=n.stack;n.stack=[],s=n.enter("reference");const v=n.safe(n.associationId(t),{before:f,after:"]",...u.current()});return s(),n.stack=h,l(),i==="full"||!c||c!==v?f+=u.move(v+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function qP(){return"!"}AD.peek=jP;function AD(t,e,n){let r=t.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const s=n.unsafe[l],u=n.compilePattern(s);let f;if(s.atBreak)for(;f=u.exec(r);){let c=f.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(f.index+1)}}return i+r+i}function jP(){return"`"}function _D(t,e){const n=Fm(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}ND.peek=HP;function ND(t,e,n,r){const i=$m(n),l=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let u,f;if(_D(t,n)){const h=n.stack;n.stack=[],u=n.enter("autolink");let v=s.move("<");return v+=s.move(n.containerPhrasing(t,{before:v,after:">",...s.current()})),v+=s.move(">"),u(),n.stack=h,v}u=n.enter("link"),f=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(t,{before:c,after:"](",...s.current()})),c+=s.move("]("),f(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(f=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(t.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(f=n.enter("destinationRaw"),c+=s.move(n.safe(t.url,{before:c,after:t.title?" ":")",...s.current()}))),f(),t.title&&(f=n.enter(`title${l}`),c+=s.move(" "+i),c+=s.move(n.safe(t.title,{before:c,after:i,...s.current()})),c+=s.move(i),f()),c+=s.move(")"),u(),c}function HP(t,e,n){return _D(t,n)?"<":"["}kD.peek=GP;function kD(t,e,n,r){const i=t.referenceType,l=n.enter("linkReference");let s=n.enter("label");const u=n.createTracker(r);let f=u.move("[");const c=n.containerPhrasing(t,{before:f,after:"]",...u.current()});f+=u.move(c+"]["),s();const h=n.stack;n.stack=[],s=n.enter("reference");const v=n.safe(n.associationId(t),{before:f,after:"]",...u.current()});return s(),n.stack=h,l(),i==="full"||!c||c!==v?f+=u.move(v+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function GP(){return"["}function Km(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function VP(t){const e=Km(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function $P(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function RD(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function KP(t,e,n,r){const i=n.enter("list"),l=n.bulletCurrent;let s=t.ordered?$P(n):Km(n);const u=t.ordered?s==="."?")":".":VP(n);let f=e&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!t.ordered){const h=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),RD(n)===s&&h){let v=-1;for(;++v<t.children.length;){const p=t.children[v];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(s=u),n.bulletCurrent=s;const c=n.containerFlow(t,r);return n.bulletLastUsed=s,n.bulletCurrent=l,i(),c}function YP(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function XP(t,e,n,r){const i=YP(n);let l=n.bulletCurrent||Km(n);e&&e.type==="list"&&e.ordered&&(l=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+l);let s=l.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(s=Math.ceil(s/4)*4);const u=n.createTracker(r);u.move(l+" ".repeat(s-l.length)),u.shift(s);const f=n.enter("listItem"),c=n.indentLines(n.containerFlow(t,u.current()),h);return f(),c;function h(v,p,m){return p?(m?"":" ".repeat(s))+v:(m?l:l+" ".repeat(s-l.length))+v}}function ZP(t,e,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),s=n.containerPhrasing(t,r);return l(),i(),s}const QP=Fu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function WP(t,e,n,r){return(t.children.some(function(s){return QP(s)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function JP(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}MD.peek=eU;function MD(t,e,n,r){const i=JP(n),l=n.enter("strong"),s=n.createTracker(r),u=s.move(i+i);let f=s.move(n.containerPhrasing(t,{after:i,before:u,...s.current()}));const c=f.charCodeAt(0),h=Wf(r.before.charCodeAt(r.before.length-1),c,i);h.inside&&(f=Eu(c)+f.slice(1));const v=f.charCodeAt(f.length-1),p=Wf(r.after.charCodeAt(0),v,i);p.inside&&(f=f.slice(0,-1)+Eu(v));const m=s.move(i+i);return l(),n.attentionEncodeSurroundingInfo={after:p.outside,before:h.outside},u+f+m}function eU(t,e,n){return n.options.strong||"*"}function tU(t,e,n,r){return n.safe(t.value,r)}function nU(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function rU(t,e,n){const r=(RD(n)+(n.options.ruleSpaces?" ":"")).repeat(nU(n));return n.options.ruleSpaces?r.slice(0,-1):r}const OD={blockquote:DP,break:vS,code:MP,definition:BP,emphasis:SD,hardBreak:vS,heading:zP,html:CD,image:TD,imageReference:DD,inlineCode:AD,link:ND,linkReference:kD,list:KP,listItem:XP,paragraph:ZP,root:WP,strong:MD,text:tU,thematicBreak:rU};function aU(){return{enter:{table:iU,tableData:gS,tableHeader:gS,tableRow:sU},exit:{codeText:oU,table:lU,tableData:Cp,tableHeader:Cp,tableRow:Cp}}}function iU(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function lU(t){this.exit(t),this.data.inTable=void 0}function sU(t){this.enter({type:"tableRow",children:[]},t)}function Cp(t){this.exit(t)}function gS(t){this.enter({type:"tableCell",children:[]},t)}function oU(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,uU));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function uU(t,e){return e==="|"?e:t}function cU(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
367
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:f,tableRow:u}};function s(m,y,S,w){return c(h(m,S,w),m.align)}function u(m,y,S,w){const E=v(m,S,w),C=c([E]);return C.slice(0,C.indexOf(`
|
|
368
|
-
`))}function f(m,y,S,w){const E=S.enter("tableCell"),C=S.enter("phrasing"),T=S.containerPhrasing(m,{...w,before:l,after:l});return C(),E(),T}function c(m,y){return CP(m,{align:y,alignDelimiters:r,padding:n,stringLength:i})}function h(m,y,S){const w=m.children;let E=-1;const C=[],T=y.enter("table");for(;++E<w.length;)C[E]=v(w[E],y,S);return T(),C}function v(m,y,S){const w=m.children;let E=-1;const C=[],T=y.enter("tableRow");for(;++E<w.length;)C[E]=f(w[E],m,y,S);return T(),C}function p(m,y,S){let w=OD.inlineCode(m,y,S);return S.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function fU(){return{exit:{taskListCheckValueChecked:pS,taskListCheckValueUnchecked:pS,paragraph:hU}}}function dU(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:vU}}}function pS(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function hU(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let l=-1,s;for(;++l<i.length;){const u=i[l];if(u.type==="paragraph"){s=u;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function vU(t,e,n,r){const i=t.children[0],l=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);l&&u.move(s);let f=OD.listItem(t,e,n,{...r,...u.current()});return l&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),f;function c(h){return h+s}}function gU(){return[K4(),vP(),yP(),aU(),fU()]}function pU(t){return{extensions:[Y4(),gP(t),bP(),cU(t),dU()]}}const mU={tokenize:SU,partial:!0},BD={tokenize:CU,partial:!0},LD={tokenize:TU,partial:!0},FD={tokenize:DU,partial:!0},yU={tokenize:AU,partial:!0},ID={name:"wwwAutolink",tokenize:xU,previous:PD},zD={name:"protocolAutolink",tokenize:wU,previous:UD},Ja={name:"emailAutolink",tokenize:EU,previous:qD},_a={};function bU(){return{text:_a}}let pl=48;for(;pl<123;)_a[pl]=Ja,pl++,pl===58?pl=65:pl===91&&(pl=97);_a[43]=Ja;_a[45]=Ja;_a[46]=Ja;_a[95]=Ja;_a[72]=[Ja,zD];_a[104]=[Ja,zD];_a[87]=[Ja,ID];_a[119]=[Ja,ID];function EU(t,e,n){const r=this;let i,l;return s;function s(v){return!rm(v)||!qD.call(r,r.previous)||Ym(r.events)?n(v):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(v))}function u(v){return rm(v)?(t.consume(v),u):v===64?(t.consume(v),f):n(v)}function f(v){return v===46?t.check(yU,h,c)(v):v===45||v===95||cr(v)?(l=!0,t.consume(v),f):h(v)}function c(v){return t.consume(v),i=!0,f}function h(v){return l&&i&&yr(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(v)):n(v)}}function xU(t,e,n){const r=this;return i;function i(s){return s!==87&&s!==119||!PD.call(r,r.previous)||Ym(r.events)?n(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(mU,t.attempt(BD,t.attempt(LD,l),n),n)(s))}function l(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function wU(t,e,n){const r=this;let i="",l=!1;return s;function s(v){return(v===72||v===104)&&UD.call(r,r.previous)&&!Ym(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(v),t.consume(v),u):n(v)}function u(v){if(yr(v)&&i.length<5)return i+=String.fromCodePoint(v),t.consume(v),u;if(v===58){const p=i.toLowerCase();if(p==="http"||p==="https")return t.consume(v),f}return n(v)}function f(v){return v===47?(t.consume(v),l?c:(l=!0,f)):n(v)}function c(v){return v===null||Kf(v)||ln(v)||_l(v)||md(v)?n(v):t.attempt(BD,t.attempt(LD,h),n)(v)}function h(v){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(v)}}function SU(t,e,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,t.consume(s),i):s===46&&r===3?(t.consume(s),l):n(s)}function l(s){return s===null?n(s):e(s)}}function CU(t,e,n){let r,i,l;return s;function s(c){return c===46||c===95?t.check(FD,f,u)(c):c===null||ln(c)||_l(c)||c!==45&&md(c)?f(c):(l=!0,t.consume(c),s)}function u(c){return c===95?r=!0:(i=r,r=void 0),t.consume(c),s}function f(c){return i||r||!l?n(c):e(c)}}function TU(t,e){let n=0,r=0;return i;function i(s){return s===40?(n++,t.consume(s),i):s===41&&r<n?l(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(FD,e,l)(s):s===null||ln(s)||_l(s)?e(s):(t.consume(s),i)}function l(s){return s===41&&r++,t.consume(s),i}}function DU(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),l):u===93?(t.consume(u),i):u===60||u===null||ln(u)||_l(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||ln(u)||_l(u)?e(u):r(u)}function l(u){return yr(u)?s(u):n(u)}function s(u){return u===59?(t.consume(u),r):yr(u)?(t.consume(u),s):n(u)}}function AU(t,e,n){return r;function r(l){return t.consume(l),i}function i(l){return cr(l)?n(l):e(l)}}function PD(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||ln(t)}function UD(t){return!yr(t)}function qD(t){return!(t===47||rm(t))}function rm(t){return t===43||t===45||t===46||t===95||cr(t)}function Ym(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const _U={tokenize:FU,partial:!0};function NU(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:OU,continuation:{tokenize:BU},exit:LU}},text:{91:{name:"gfmFootnoteCall",tokenize:MU},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:kU,resolveTo:RU}}}}function kU(t,e,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const f=r.events[i][1];if(f.type==="labelImage"){s=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return u;function u(f){if(!s||!s._balanced)return n(f);const c=ha(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!l.includes(c.slice(1))?n(f):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),e(f))}}function RU(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",l,e],["enter",s,e],["exit",s,e],["exit",l,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function MU(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,s;return u;function u(v){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(v),t.exit("gfmFootnoteCallLabelMarker"),f}function f(v){return v!==94?n(v):(t.enter("gfmFootnoteCallMarker"),t.consume(v),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",c)}function c(v){if(l>999||v===93&&!s||v===null||v===91||ln(v))return n(v);if(v===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return i.includes(ha(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(v),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(v)}return ln(v)||(s=!0),l++,t.consume(v),v===92?h:c}function h(v){return v===91||v===92||v===93?(t.consume(v),l++,c):c(v)}}function OU(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,s=0,u;return f;function f(y){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(y){return y===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",h):n(y)}function h(y){if(s>999||y===93&&!u||y===null||y===91||ln(y))return n(y);if(y===93){t.exit("chunkString");const S=t.exit("gfmFootnoteDefinitionLabelString");return l=ha(r.sliceSerialize(S)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return ln(y)||(u=!0),s++,t.consume(y),y===92?v:h}function v(y){return y===91||y===92||y===93?(t.consume(y),s++,h):h(y)}function p(y){return y===58?(t.enter("definitionMarker"),t.consume(y),t.exit("definitionMarker"),i.includes(l)||i.push(l),zt(t,m,"gfmFootnoteDefinitionWhitespace")):n(y)}function m(y){return e(y)}}function BU(t,e,n){return t.check(Lu,e,t.attempt(_U,e,n))}function LU(t){t.exit("gfmFootnoteDefinition")}function FU(t,e,n){const r=this;return zt(t,i,"gfmFootnoteDefinitionIndent",5);function i(l){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(l):n(l)}}function IU(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,u){let f=-1;for(;++f<s.length;)if(s[f][0]==="enter"&&s[f][1].type==="strikethroughSequenceTemporary"&&s[f][1]._close){let c=f;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[f][1].end.offset-s[f][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[f][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[f][1].end)},v={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[f][1].start)},p=[["enter",h,u],["enter",s[c][1],u],["exit",s[c][1],u],["enter",v,u]],m=u.parser.constructs.insideSpan.null;m&&Gr(p,p.length,0,yd(m,s.slice(c+1,f),u)),Gr(p,p.length,0,[["exit",v,u],["enter",s[f][1],u],["exit",s[f][1],u],["exit",h,u]]),Gr(s,c-1,f-c+3,p),f=c+p.length-2;break}}for(f=-1;++f<s.length;)s[f][1].type==="strikethroughSequenceTemporary"&&(s[f][1].type="data");return s}function l(s,u,f){const c=this.previous,h=this.events;let v=0;return p;function p(y){return c===126&&h[h.length-1][1].type!=="characterEscape"?f(y):(s.enter("strikethroughSequenceTemporary"),m(y))}function m(y){const S=Ps(c);if(y===126)return v>1?f(y):(s.consume(y),v++,m);if(v<2&&!n)return f(y);const w=s.exit("strikethroughSequenceTemporary"),E=Ps(y);return w._open=!E||E===2&&!!S,w._close=!S||S===2&&!!E,u(y)}}}class zU{constructor(){this.map=[]}add(e,n,r){PU(this,e,n,r)}consume(e){if(this.map.sort(function(l,s){return l[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const l of i)e.push(l);i=r.pop()}this.map.length=0}}function PU(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function UU(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function qU(){return{flow:{null:{name:"table",tokenize:jU,resolveAll:HU}}}}function jU(t,e,n){const r=this;let i=0,l=0,s;return u;function u(M){let I=r.events.length-1;for(;I>-1;){const K=r.events[I][1].type;if(K==="lineEnding"||K==="linePrefix")I--;else break}const P=I>-1?r.events[I][1].type:null,j=P==="tableHead"||P==="tableRow"?N:f;return j===N&&r.parser.lazy[r.now().line]?n(M):j(M)}function f(M){return t.enter("tableHead"),t.enter("tableRow"),c(M)}function c(M){return M===124||(s=!0,l+=1),h(M)}function h(M){return M===null?n(M):ht(M)?l>1?(l=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(M),t.exit("lineEnding"),m):n(M):Ot(M)?zt(t,h,"whitespace")(M):(l+=1,s&&(s=!1,i+=1),M===124?(t.enter("tableCellDivider"),t.consume(M),t.exit("tableCellDivider"),s=!0,h):(t.enter("data"),v(M)))}function v(M){return M===null||M===124||ln(M)?(t.exit("data"),h(M)):(t.consume(M),M===92?p:v)}function p(M){return M===92||M===124?(t.consume(M),v):v(M)}function m(M){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(M):(t.enter("tableDelimiterRow"),s=!1,Ot(M)?zt(t,y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):y(M))}function y(M){return M===45||M===58?w(M):M===124?(s=!0,t.enter("tableCellDivider"),t.consume(M),t.exit("tableCellDivider"),S):k(M)}function S(M){return Ot(M)?zt(t,w,"whitespace")(M):w(M)}function w(M){return M===58?(l+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(M),t.exit("tableDelimiterMarker"),E):M===45?(l+=1,E(M)):M===null||ht(M)?A(M):k(M)}function E(M){return M===45?(t.enter("tableDelimiterFiller"),C(M)):k(M)}function C(M){return M===45?(t.consume(M),C):M===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(M),t.exit("tableDelimiterMarker"),T):(t.exit("tableDelimiterFiller"),T(M))}function T(M){return Ot(M)?zt(t,A,"whitespace")(M):A(M)}function A(M){return M===124?y(M):M===null||ht(M)?!s||i!==l?k(M):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(M)):k(M)}function k(M){return n(M)}function N(M){return t.enter("tableRow"),_(M)}function _(M){return M===124?(t.enter("tableCellDivider"),t.consume(M),t.exit("tableCellDivider"),_):M===null||ht(M)?(t.exit("tableRow"),e(M)):Ot(M)?zt(t,_,"whitespace")(M):(t.enter("data"),O(M))}function O(M){return M===null||M===124||ln(M)?(t.exit("data"),_(M)):(t.consume(M),M===92?U:O)}function U(M){return M===92||M===124?(t.consume(M),O):O(M)}}function HU(t,e){let n=-1,r=!0,i=0,l=[0,0,0,0],s=[0,0,0,0],u=!1,f=0,c,h,v;const p=new zU;for(;++n<t.length;){const m=t[n],y=m[1];m[0]==="enter"?y.type==="tableHead"?(u=!1,f!==0&&(mS(p,e,f,c,h),h=void 0,f=0),c={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},p.add(n,0,[["enter",c,e]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(r=!0,v=void 0,l=[0,0,0,0],s=[0,n+1,0,0],u&&(u=!1,h={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},p.add(n,0,[["enter",h,e]])),i=y.type==="tableDelimiterRow"?2:h?3:1):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(l[1]!==0&&(s[0]=s[1],v=bf(p,e,l,i,void 0,v),l=[0,0,0,0]),s[2]=n)):y.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(s[0]=s[1],v=bf(p,e,l,i,void 0,v)),l=s,s=[l[1],n,0,0])):y.type==="tableHead"?(u=!0,f=n):y.type==="tableRow"||y.type==="tableDelimiterRow"?(f=n,l[1]!==0?(s[0]=s[1],v=bf(p,e,l,i,n,v)):s[1]!==0&&(v=bf(p,e,s,i,n,v)),i=0):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(s[3]=n)}for(f!==0&&mS(p,e,f,c,h),p.consume(e.events),n=-1;++n<e.events.length;){const m=e.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=UU(e.events,n))}return t}function bf(t,e,n,r,i,l){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(l.end=Object.assign({},As(e.events,n[0])),t.add(n[0],0,[["exit",l,e]]));const f=As(e.events,n[1]);if(l={type:s,start:Object.assign({},f),end:Object.assign({},f)},t.add(n[1],0,[["enter",l,e]]),n[2]!==0){const c=As(e.events,n[2]),h=As(e.events,n[3]),v={type:u,start:Object.assign({},c),end:Object.assign({},h)};if(t.add(n[2],0,[["enter",v,e]]),r!==2){const p=e.events[n[2]],m=e.events[n[3]];if(p[1].end=Object.assign({},m[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const y=n[2]+1,S=n[3]-n[2]-1;t.add(y,S,[])}}t.add(n[3]+1,0,[["exit",v,e]])}return i!==void 0&&(l.end=Object.assign({},As(e.events,i)),t.add(i,0,[["exit",l,e]]),l=void 0),l}function mS(t,e,n,r,i){const l=[],s=As(e.events,n);i&&(i.end=Object.assign({},s),l.push(["exit",i,e])),r.end=Object.assign({},s),l.push(["exit",r,e]),t.add(n+1,0,l)}function As(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const GU={name:"tasklistCheck",tokenize:$U};function VU(){return{text:{91:GU}}}function $U(t,e,n){const r=this;return i;function i(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(f),t.exit("taskListCheckMarker"),l)}function l(f){return ln(f)?(t.enter("taskListCheckValueUnchecked"),t.consume(f),t.exit("taskListCheckValueUnchecked"),s):f===88||f===120?(t.enter("taskListCheckValueChecked"),t.consume(f),t.exit("taskListCheckValueChecked"),s):n(f)}function s(f){return f===93?(t.enter("taskListCheckMarker"),t.consume(f),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(f)}function u(f){return ht(f)?e(f):Ot(f)?t.check({tokenize:KU},e,n)(f):n(f)}}function KU(t,e,n){return zt(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function YU(t){return kT([bU(),NU(),IU(t),qU(),VU()])}const XU={};function ZU(t){const e=this,n=t||XU,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(YU(n)),l.push(gU()),s.push(pU(n))}function yS(t){return t.dataUrl??`/api/asset?path=${encodeURIComponent(t.path)}`}const bS=1200;function Ef(t){return Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function Jo(t){return typeof t=="string"&&t.length?t:null}function QU(t){return Array.isArray(t)?t.filter(e=>typeof e=="string").join(", "):""}function WU({activePage:t,pageError:e,backlinkPages:n,relatedPages:r,graphPageLinks:i,onOpenPage:l,onNavigateNode:s}){const[u,f]=ge.useState(!1),c=t?.frontmatter??{},h=Ef(c.source_ids),v=Ef(c.node_ids),p=[...Ef(c.tags),...Ef(c.semantic_tags)],m=Jo(c.kind)??"page",y=Jo(c.status)??"active",S=Jo(c.source_type),w=QU(c.project_ids)||"Global",E=Jo(c.page_id),C=Jo(c.freshness),T=t?t.content.length>bS:!1,A=ge.useMemo(()=>t?u||!T?t.content:`${t.content.slice(0,bS)}β¦`:"",[t,u,T]);return D.jsxs("section",{className:"panel page-panel","data-testid":"page-preview",children:[D.jsx("h3",{className:"panel-heading",children:"Page Preview"}),e?D.jsx("p",{className:"text-error",children:e}):null,t?D.jsxs(D.Fragment,{children:[D.jsx("span",{className:"label",children:t.path}),D.jsx("h4",{className:"card-title",style:{margin:"4px 0 8px"},children:t.title}),D.jsxs("div",{className:"meta-grid",children:[D.jsx("span",{className:"meta-label",children:"Kind"}),D.jsxs("span",{className:"meta-value",children:[m," / ",y]}),S?D.jsxs(D.Fragment,{children:[D.jsx("span",{className:"meta-label",children:"Source"}),D.jsx("span",{className:"meta-value",children:S})]}):null,D.jsx("span",{className:"meta-label",children:"Projects"}),D.jsx("span",{className:"meta-value",children:w}),E?D.jsxs(D.Fragment,{children:[D.jsx("span",{className:"meta-label",children:"Page ID"}),D.jsx("code",{className:"meta-value mono meta-value-truncate",title:E,children:E})]}):null,C?D.jsxs(D.Fragment,{children:[D.jsx("span",{className:"meta-label",children:"Freshness"}),D.jsx("span",{className:"meta-value mono",children:C})]}):null]}),h.length?D.jsxs("div",{className:"linked-section",children:[D.jsx("span",{className:"label",children:"Sources"}),D.jsxs("div",{className:"chip-row",children:[h.slice(0,8).map(k=>D.jsx("code",{className:"chip chip-static",title:k,children:k},k)),h.length>8?D.jsxs("span",{className:"text-muted text-sm",children:["+",h.length-8," more"]}):null]})]}):null,v.length&&s?D.jsxs("div",{className:"linked-section",children:[D.jsx("span",{className:"label",children:"Graph Nodes"}),D.jsxs("div",{className:"chip-row",children:[v.slice(0,8).map(k=>D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>s(k),title:`Select ${k}`,children:k},k)),v.length>8?D.jsxs("span",{className:"text-muted text-sm",children:["+",v.length-8," more"]}):null]})]}):null,p.length?D.jsxs("div",{className:"linked-section",children:[D.jsx("span",{className:"label",children:"Tags"}),D.jsx("div",{className:"chip-row",children:p.map(k=>D.jsx("span",{className:"chip chip-tag",children:k},k))})]}):null,t.assets.length?D.jsx("div",{className:"asset-preview",children:t.assets.map(k=>k.mimeType.startsWith("image/")?D.jsxs("figure",{className:"asset-card",children:[D.jsx("img",{src:yS(k),alt:t.title}),D.jsxs("figcaption",{children:[k.role," / ",k.mimeType]})]},k.id):D.jsxs("a",{className:"btn btn-ghost",href:yS(k),target:"_blank",rel:"noreferrer",children:["Open ",k.role]},k.id))}):null,n.length?D.jsxs("div",{className:"linked-section",children:[D.jsx("span",{className:"label",children:"Backlinks"}),D.jsx("div",{className:"chip-row",children:n.map(k=>D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{l(k.path,k.id)},children:k.title},k.id))})]}):null,r.length?D.jsxs("div",{className:"linked-section",children:[D.jsx("span",{className:"label",children:"Related Pages"}),D.jsx("div",{className:"chip-row",children:r.map(k=>D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{l(k.path,k.id)},children:k.title},k.id))})]}):null,i.length?D.jsxs("div",{className:"linked-section",children:[D.jsx("span",{className:"label",children:"Graph Reports"}),D.jsx("div",{className:"chip-row",children:i.slice(0,6).map(k=>D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{l(k.path,k.id)},children:k.title},k.id))})]}):null,D.jsx("article",{className:"markdown-content",children:D.jsx(P3,{remarkPlugins:[ZU],rehypePlugins:[q4,[R4,{detect:!0,ignoreMissing:!0}]],children:A})}),T?D.jsx("div",{className:"action-row",children:D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>f(k=>!k),children:u?"Collapse":`Show all ${t.content.length.toLocaleString()} characters`})}):null]}):D.jsxs("div",{className:"empty-state",children:[D.jsx("span",{className:"empty-state-icon",children:"π"}),D.jsx("p",{className:"text-muted text-sm",children:"Open a search result, review entry, candidate, or graph node page."})]})]})}function JU({watchStatus:t,watchError:e}){return t?.pendingSemanticRefresh.length?D.jsxs("div",{children:[D.jsxs("p",{className:"text-muted text-sm",children:["Watched roots: ",t.watchedRepoRoots.length?t.watchedRepoRoots.join(", "):"none",t.lastRun?.finishedAt?` Β· Last run: ${new Date(t.lastRun.finishedAt).toLocaleString()}`:""]}),e?D.jsx("p",{className:"text-error",children:e}):null,D.jsx("div",{className:"card-list",children:t.pendingSemanticRefresh.slice(0,8).map(n=>D.jsxs("article",{className:"card",children:[D.jsx("span",{className:"label",children:n.changeType}),D.jsx("strong",{className:"card-title",children:n.path}),D.jsx("p",{className:"text-muted text-sm",children:n.sourceKind?`Kind: ${n.sourceKind}`:"Awaiting semantic refresh."})]},n.id))})]}):D.jsx("p",{className:"text-muted text-sm",children:"No files are pending semantic refresh."})}function jD({tabs:t,activeTab:e,onTabChange:n,children:r}){const i=(l,s)=>{let u=s;if(l.key==="ArrowRight")u=(s+1)%t.length;else if(l.key==="ArrowLeft")u=(s-1+t.length)%t.length;else return;l.preventDefault(),n(t[u].id),l.currentTarget.parentElement?.children[u]?.focus()};return D.jsxs("div",{className:"tabs",children:[D.jsx("div",{className:"tab-bar",role:"tablist",children:t.map((l,s)=>D.jsxs("button",{id:`tab-${l.id}`,type:"button",role:"tab","aria-selected":e===l.id,"aria-controls":`tabpanel-${l.id}`,tabIndex:e===l.id?0:-1,className:`tab-btn${e===l.id?" is-active":""}`,onClick:()=>n(l.id),onKeyDown:u=>i(u,s),children:[l.label,l.count!=null&&l.count>0?D.jsx("span",{className:"tab-count",children:l.count}):null]},l.id))}),D.jsx("div",{id:`tabpanel-${e}`,className:"tab-panel",role:"tabpanel","aria-labelledby":`tab-${e}`,children:r})]})}function e9({graphReport:t,onOpenPage:e,onNavigateNode:n,onHighlightSurprise:r}){const[i,l]=ge.useState("overview");return t?D.jsx("div",{className:"report-tabs",children:D.jsxs(jD,{tabs:[{id:"overview",label:"Overview"},{id:"surprising",label:"Surprising",count:t.surprisingConnections.length},{id:"patterns",label:"Patterns",count:t.groupPatterns.length},{id:"benchmark",label:"Benchmark"},{id:"sources",label:"Sources",count:t.recentResearchSources.length}],activeTab:i,onTabChange:l,children:[i==="overview"&&D.jsxs("div",{children:[D.jsxs("div",{className:"report-stats",children:[D.jsxs("span",{children:["Nodes ",D.jsx("strong",{children:t.overview.nodes})]}),D.jsxs("span",{children:["Edges ",D.jsx("strong",{children:t.overview.edges})]}),D.jsxs("span",{children:["Communities ",D.jsx("strong",{children:t.overview.communities})]})]}),D.jsx("div",{className:"report-stats",style:{marginTop:6},children:D.jsxs("span",{className:"text-muted",children:["1st-party: ",t.firstPartyOverview.nodes," nodes \\u00b7 ",t.firstPartyOverview.edges," edges \\u00b7"," ",t.firstPartyOverview.communities," communities"]})}),t.warnings.length?D.jsxs("div",{className:"linked-section",children:[D.jsx("span",{className:"label",children:"Warnings"}),D.jsx("div",{className:"card-list",children:t.warnings.map(s=>D.jsx("article",{className:"card card-warning",children:D.jsxs("p",{className:"text-sm",children:["β "," ",s]})},s))})]}):null]}),i==="surprising"&&D.jsx("div",{children:t.surprisingConnections.length?D.jsx("div",{className:"card-list",children:t.surprisingConnections.map(s=>D.jsxs("article",{className:"card",children:[D.jsxs("div",{className:"surprise-row",children:[D.jsxs("button",{type:"button",className:"btn btn-ghost",onClick:()=>r(s.sourceNodeId,s.targetNodeId),children:[s.sourceLabel," β ",s.targetLabel]}),D.jsx("span",{className:"text-mono text-sm",children:s.relation})]}),s.explanation?D.jsx("p",{className:"text-secondary text-sm",children:s.explanation}):null,s.confidence!=null?D.jsxs("span",{className:"text-muted text-sm",children:["confidence: ",s.confidence.toFixed(2)]}):null]},s.id))}):D.jsx("p",{className:"text-muted text-sm",children:"No surprising connections detected."})}),i==="patterns"&&D.jsxs("div",{children:[t.groupPatterns.length?D.jsx("div",{className:"card-list",children:t.groupPatterns.map(s=>D.jsxs("article",{className:"card",children:[D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{const u=s.nodeIds[0];u&&n(u)},children:s.label}),s.why?D.jsx("p",{className:"text-secondary text-sm",children:s.why}):null,D.jsxs("span",{className:"text-muted text-sm",children:[s.nodeIds.length," nodes \\u00b7 ",s.relation]})]},s.id))}):D.jsx("p",{className:"text-muted text-sm",children:"No group patterns detected."}),t.suggestedQuestions?.length?D.jsxs("div",{className:"linked-section",children:[D.jsx("span",{className:"label",children:"Suggested Questions"}),D.jsx("div",{className:"card-list",children:t.suggestedQuestions.map(s=>D.jsx("p",{className:"text-secondary text-sm",children:s},s))})]}):null]}),i==="benchmark"&&D.jsx("div",{children:t.benchmark?D.jsxs("div",{className:"meta-grid",children:[D.jsx("span",{className:"meta-label",children:"Status"}),D.jsx("span",{className:"meta-value",children:t.benchmark.stale?"Stale":"Fresh"}),D.jsx("span",{className:"meta-label",children:"Questions"}),D.jsx("span",{className:"meta-value mono",children:t.benchmark.summary.questionCount}),D.jsx("span",{className:"meta-label",children:"Context tokens"}),D.jsx("span",{className:"meta-value mono",children:t.benchmark.summary.finalContextTokens.toLocaleString()}),D.jsx("span",{className:"meta-label",children:"Naive corpus"}),D.jsx("span",{className:"meta-value mono",children:t.benchmark.summary.naiveCorpusTokens.toLocaleString()}),D.jsx("span",{className:"meta-label",children:"Reduction"}),D.jsxs("span",{className:"meta-value mono",children:[(t.benchmark.summary.reductionRatio*100).toFixed(1),"%"]}),D.jsx("span",{className:"meta-label",children:"Unique visited"}),D.jsx("span",{className:"meta-value mono",children:t.benchmark.summary.uniqueVisitedNodes})]}):D.jsx("p",{className:"text-muted text-sm",children:"No benchmark summary is available yet."})}),i==="sources"&&D.jsx("div",{children:t.recentResearchSources.length?D.jsx("div",{className:"card-list",children:t.recentResearchSources.map(s=>D.jsxs("article",{className:"card",children:[D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{e(s.path,s.pageId)},children:s.title}),D.jsxs("span",{className:"text-muted text-sm",children:[s.sourceType," \\u00b7 ",s.updatedAt?new Date(s.updatedAt).toLocaleDateString():""]})]},s.pageId))}):D.jsx("p",{className:"text-muted text-sm",children:"No recent research sources."})})]})}):D.jsx("div",{className:"report-tabs",children:D.jsx("div",{className:"report-tabs-empty",children:"Loading graph report..."})})}function t9(t,e){const n=e.trim();if(!n||n.length<2)return t;const r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`(${r})`,"gi"),l=t.split(i);if(l.length===1)return t;const s=n.toLowerCase();let u=0;return l.map(f=>{const c=`${u}:${f}`;return u+=f.length,f.toLowerCase()===s?D.jsx("mark",{children:f},c):D.jsx(ge.Fragment,{children:f},c)})}function n9({results:t,searchError:e,query:n,onOpenResult:r,recentQueries:i=[],onSelectRecent:l,sort:s="relevance",onSortChange:u,pageSize:f=10}){const[c,h]=ge.useState(f),[v,p]=ge.useState(!1),m=[...t].sort((y,S)=>s==="title"?y.title.localeCompare(S.title):s==="updated"?(S.pageId??"").localeCompare(y.pageId??""):0);return D.jsxs("section",{className:"panel","aria-label":"Search results",children:[D.jsxs("h3",{className:"panel-heading",children:["Search Results",t.length>0?D.jsxs("span",{className:"panel-meta",children:[t.length," match",t.length===1?"":"es"]}):null]}),D.jsxs("div",{className:"search-controls",children:[D.jsxs("label",{className:"filter-group",style:{flex:1,minWidth:120},children:[D.jsx("span",{className:"filter-label",children:"Sort"}),D.jsxs("select",{className:"input",value:s,onChange:y=>u?.(y.target.value),"aria-label":"Sort search results",children:[D.jsx("option",{value:"relevance",children:"Relevance"}),D.jsx("option",{value:"title",children:"Title"}),D.jsx("option",{value:"updated",children:"Recent"})]})]}),D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>p(y=>!y),"aria-expanded":v,children:v?"Hide help":"Search help"})]}),v?D.jsx("div",{className:"search-syntax-help",children:D.jsxs("p",{children:["Use ",D.jsx("code",{children:"kind:source"}),", ",D.jsx("code",{children:"status:active"}),", or ",D.jsx("code",{children:"project:foo"})," filters in the sidebar to scope. Type at least ",D.jsx("code",{children:"2"})," characters; matches are highlighted in snippets. Combine with the tag filter for domain-scoped results."]})}):null,e?D.jsx("p",{className:"text-error",children:e}):null,m.length?D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"card-list",children:m.slice(0,c).map(y=>D.jsxs("button",{type:"button",className:"result-card",onClick:()=>{r(y)},children:[D.jsxs("span",{className:"label",children:[y.kind??"page"," / ",y.status??"active"]}),D.jsx("strong",{className:"card-title",children:y.title}),y.sourceType?D.jsxs("p",{className:"text-muted text-sm",children:["Source: ",y.sourceType]}):null,y.sourceClass?D.jsxs("p",{className:"text-muted text-sm",children:["Class: ",y.sourceClass]}):null,D.jsx("p",{className:"text-muted text-sm",children:y.projectIds.length?y.projectIds.join(", "):"global"}),D.jsx("p",{className:"text-secondary text-sm",children:t9(y.snippet,n)})]},`${y.pageId}:${y.path}`))}),m.length>c?D.jsxs("div",{className:"action-row",children:[D.jsxs("button",{type:"button",className:"btn",onClick:()=>h(y=>y+f),children:["Show ",Math.min(f,m.length-c)," more"]}),D.jsxs("span",{className:"text-muted text-sm action-row-end",children:["Showing ",Math.min(c,m.length)," of ",m.length]})]}):null]}):D.jsx("div",{className:"empty-state",children:D.jsx("p",{className:"text-muted text-sm",children:n.trim().length>=2?"No pages matched this query.":"Search the wiki, outputs, or candidate pages."})}),i.length&&l?D.jsxs("div",{className:"recent-searches",children:[D.jsx("span",{className:"label",children:"Recent"}),i.slice(0,6).map(y=>D.jsx("button",{type:"button",className:"chip chip-tag",onClick:()=>l(y),children:y},y))]}):null]})}function r9({selected:t,graphExplain:e,graphError:n,onNavigateNode:r}){if(!t)return D.jsxs("section",{className:"panel","data-selected-node-id":"","data-testid":"selection-panel",children:[D.jsx("h3",{className:"panel-heading",children:"Selection"}),D.jsxs("div",{className:"empty-state",children:[D.jsx("span",{className:"empty-state-icon",children:"β"}),D.jsx("p",{className:"text-muted text-sm",children:"Select a node to inspect graph metrics and linked pages."})]})]});const i=t.sourceIds.length>3?`${t.sourceIds.slice(0,3).join(", ")} +${t.sourceIds.length-3} more`:t.sourceIds.join(", ")||"None";return D.jsxs("section",{className:"panel","data-selected-node-id":t.id,"data-testid":"selection-panel",children:[D.jsx("h3",{className:"panel-heading",children:"Selection"}),n?D.jsx("p",{className:"text-error",children:n}):null,D.jsx("span",{className:"label",children:t.type}),D.jsx("h4",{className:"card-title",style:{margin:"4px 0 8px"},children:t.label}),D.jsxs("div",{className:"meta-grid",children:[D.jsx("span",{className:"meta-label",children:"ID"}),D.jsx("code",{className:"meta-value meta-value-truncate",title:t.id,children:t.id}),t.language?D.jsxs(D.Fragment,{children:[D.jsx("span",{className:"meta-label",children:"Language"}),D.jsx("span",{className:"meta-value",title:t.language,children:t.language})]}):null,t.symbolKind?D.jsxs(D.Fragment,{children:[D.jsx("span",{className:"meta-label",children:"Symbol"}),D.jsx("span",{className:"meta-value",title:t.symbolKind,children:t.symbolKind})]}):null,t.moduleId?D.jsxs(D.Fragment,{children:[D.jsx("span",{className:"meta-label",children:"Module"}),D.jsx("code",{className:"meta-value meta-value-truncate",title:t.moduleId,children:t.moduleId})]}):null,D.jsx("span",{className:"meta-label",children:"Sources"}),D.jsx("span",{className:"meta-value",title:t.sourceIds.join(", ")||"None",children:i}),D.jsx("span",{className:"meta-label",children:"Projects"}),D.jsx("span",{className:"meta-value",title:t.projectIds.join(", ")||"Global",children:t.projectIds.join(", ")||"Global"}),D.jsx("span",{className:"meta-label",children:"Community"}),D.jsx("span",{className:"meta-value",title:t.communityId??"Unassigned",children:t.communityId??"Unassigned"}),D.jsx("span",{className:"meta-label",children:"Degree"}),D.jsx("span",{className:"meta-value mono",children:t.degree??0}),D.jsx("span",{className:"meta-label",children:"Bridge"}),D.jsx("span",{className:"meta-value mono",children:t.bridgeScore??0}),D.jsx("span",{className:"meta-label",children:"God node"}),D.jsx("span",{className:"meta-value",children:t.isGodNode?"Yes":"No"})]}),e?.hyperedges.length?D.jsxs("div",{className:"linked-section",children:[D.jsx("span",{className:"label",children:"Group Patterns"}),D.jsx("div",{className:"chip-row",children:e.hyperedges.slice(0,6).map(l=>D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{const s=l.nodeIds.find(u=>u!==t.id)??l.nodeIds[0];s&&r(s)},children:l.label},l.id))}),e.hyperedges[0]?.why?D.jsx("p",{className:"text-secondary text-sm",children:e.hyperedges[0].why}):null]}):null,e?.neighbors.length?D.jsxs("div",{className:"linked-section",children:[D.jsx("span",{className:"label",children:"Neighbors"}),D.jsx("div",{className:"chip-row",children:e.neighbors.slice(0,8).map(l=>D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>r(l.nodeId),children:l.label},`${l.direction}:${l.nodeId}:${l.relation}`))})]}):null]})}function a9({nodeCount:t,edgeCount:e,communityCount:n,approvalCount:r,candidateCount:i,pendingRefreshCount:l,benchmarkRatio:s}){const u=r+i+l;return D.jsxs("div",{className:"stats-strip",children:[D.jsxs("div",{className:"stats-group",children:[D.jsxs("div",{className:"stat",children:[D.jsx("span",{className:"stat-label",children:"Nodes"}),D.jsx("span",{className:"stat-value",children:t.toLocaleString()})]}),D.jsxs("div",{className:"stat",children:[D.jsx("span",{className:"stat-label",children:"Edges"}),D.jsx("span",{className:"stat-value",children:e.toLocaleString()})]}),D.jsxs("div",{className:"stat",children:[D.jsx("span",{className:"stat-label",children:"Communities"}),D.jsx("span",{className:"stat-value",children:n})]}),D.jsxs("div",{className:"stat",children:[D.jsx("span",{className:"stat-label",children:"Benchmark"}),D.jsx("span",{className:"stat-value",children:s!=null?`${(s*100).toFixed(1)}%`:"β"})]})]}),u>0?D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"stats-divider"}),D.jsxs("div",{className:"stats-group",children:[r>0?D.jsxs("div",{className:"stat",children:[D.jsx("span",{className:"stat-label",children:"Approvals"}),D.jsx("span",{className:"stat-value",children:r})]}):null,i>0?D.jsxs("div",{className:"stat",children:[D.jsx("span",{className:"stat-label",children:"Candidates"}),D.jsx("span",{className:"stat-value",children:i})]}):null,l>0?D.jsxs("div",{className:"stat",children:[D.jsx("span",{className:"stat-label",children:"Refresh"}),D.jsx("span",{className:"stat-value",children:l})]}):null]})]}):null]})}const i9=[{value:"light",label:"L",aria:"Use light theme"},{value:"system",label:"A",aria:"Match system theme"},{value:"dark",label:"D",aria:"Use dark theme"}];function l9({theme:t,onChange:e}){return D.jsx("fieldset",{className:"theme-toggle-options","aria-label":"Theme selector",children:i9.map(n=>D.jsx("button",{type:"button","aria-label":n.aria,"aria-pressed":t===n.value,className:t===n.value?"is-active":"",onClick:()=>e(n.value),title:n.aria,children:n.label},n.value))})}function s9({entry:t,onUndo:e,onDismiss:n}){return t?D.jsxs("div",{className:"undo-toast",role:"status","aria-live":"polite",children:[D.jsx("span",{children:t.label}),D.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>{e()},children:"Undo"}),D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:n,"aria-label":"Dismiss",children:"Γ"})]}):null}const o9=50;function u9(t="/api/events"){const[e,n]=ge.useState({events:[],connected:!1,error:null});return ge.useEffect(()=>{if(typeof window>"u"||typeof EventSource>"u")return;let r=!1,i=null,l=null,s=0;const u=()=>{try{i=new EventSource(t)}catch(f){if(r)return;n(c=>({...c,error:f instanceof Error?f.message:String(f),connected:!1}));return}i.onopen=()=>{r||(s=0,n(f=>({...f,connected:!0,error:null})))},i.onerror=()=>{if(r)return;n(c=>({...c,connected:!1})),i?.close(),s+=1;const f=Math.min(15e3,500*2**Math.min(s,5));l=setTimeout(u,f)},i.onmessage=f=>{if(!r)try{const c=JSON.parse(f.data);n(h=>({...h,events:[c,...h.events].slice(0,o9)}))}catch{}}};return u(),()=>{r=!0,l&&clearTimeout(l),i?.close()}},[t]),e}function ES(t){const e=t.startsWith("#")?t.slice(1):t;if(!e)return{view:"",params:{}};const[n,r=""]=e.split("?"),i={};if(r)for(const l of r.split("&")){const[s,u]=l.split("=");s&&(i[decodeURIComponent(s)]=u?decodeURIComponent(u):"")}return{view:decodeURIComponent(n??""),params:i}}function c9(t){const e=t.view?encodeURIComponent(t.view):"",n=Object.entries(t.params).filter(([,i])=>i!=null&&i!=="");if(!n.length)return e?`#${e}`:"";const r=n.map(([i,l])=>`${encodeURIComponent(i)}=${encodeURIComponent(l)}`).join("&");return`#${e}?${r}`}function f9(){const[t,e]=ge.useState(()=>typeof window>"u"?{view:"",params:{}}:ES(window.location.hash));ge.useEffect(()=>{if(typeof window>"u")return;const r=()=>e(ES(window.location.hash));return window.addEventListener("hashchange",r),()=>window.removeEventListener("hashchange",r)},[]);const n=ge.useCallback(r=>{if(typeof window>"u")return;const i=c9(r);i!==window.location.hash&&(window.location.hash=i),e(r)},[]);return{route:t,navigate:n}}function d9(t){if(!(t instanceof HTMLElement))return!1;const e=t.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"||t.isContentEditable}function h9(t,e){if(t.key.toLowerCase()!==e.key.toLowerCase())return!1;const n=t.metaKey||t.ctrlKey;return!(!!e.meta!==n||!!e.shift!==t.shiftKey||!!e.alt!==t.altKey)}function v9(t){ge.useEffect(()=>{if(typeof window>"u")return;const e=n=>{const r=d9(n.target);for(const i of t)if(h9(n,i)&&!(r&&!i.allowInInput)){n.preventDefault(),i.handler(n);return}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t])}const HD="swarmvault.viewer.theme";function g9(){if(typeof window>"u")return"system";try{const t=window.localStorage.getItem(HD);if(t==="light"||t==="dark"||t==="system")return t}catch{}return"system"}function p9(t){if(typeof document>"u")return;const e=document.documentElement;t==="system"?e.removeAttribute("data-theme"):e.setAttribute("data-theme",t)}function m9(){const[t,e]=ge.useState(()=>g9());ge.useEffect(()=>{p9(t)},[t]);const n=ge.useCallback(r=>{e(r);try{window.localStorage.setItem(HD,r)}catch{}},[]);return{theme:t,setTheme:n}}const y9=6e3;function b9(t=y9){const[e,n]=ge.useState(null),r=ge.useRef(null),i=ge.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),n(null)},[]),l=ge.useCallback((u,f)=>{r.current&&clearTimeout(r.current);const c=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,h=Date.now()+t;n({id:c,label:u,expiresAt:h,undo:f}),r.current=setTimeout(()=>{n(v=>v?.id===c?null:v)},t)},[t]),s=ge.useCallback(async()=>{e&&(await e.undo(),i())},[i,e]);return ge.useEffect(()=>()=>i(),[i]),{entry:e,push:l,performUndo:s,dismiss:i}}const E9=()=>({generatedAt:"",nodes:[],edges:[],hyperedges:[],communities:[],pages:[]}),x9={graph:null,graphReport:null,approvals:[],approvalDetail:null,candidates:[],memoryTasks:[],watchStatus:null,lintFindings:[],loading:!0,errors:{}};function w9(t,e){switch(e.type){case"snapshot":return{...t,...e.payload,errors:{...t.errors,...e.payload.errors??{}},loading:!1};case"approvalDetail":return{...t,approvalDetail:e.payload.detail,errors:{...t.errors,approval:e.payload.error}};case"error":return{...t,errors:{...t.errors,[e.key]:e.message}};case"loading":return{...t,loading:e.value};default:return t}}function S9(){const[t,e]=ge.useReducer(w9,x9),n=ge.useRef(!1),r=ge.useCallback(async()=>{if(!n.current){n.current=!0;try{const l={},[s,u,f,c,h,v]=await Promise.all([EN().catch(()=>E9()),CN().catch(m=>(l.approval=m instanceof Error?m.message:String(m),[])),DN().catch(m=>(l.candidate=m instanceof Error?m.message:String(m),[])),AN().catch(m=>(l.memory=m instanceof Error?m.message:String(m),[])),_N().catch(m=>(l.watch=m instanceof Error?m.message:String(m),{generatedAt:"",watchedRepoRoots:[],pendingSemanticRefresh:[]})),NN().catch(m=>(l.lint=m instanceof Error?m.message:String(m),[]))]),p=await wN().catch(()=>null);ge.startTransition(()=>{e({type:"snapshot",payload:{graph:s,graphReport:p,approvals:u,candidates:f,memoryTasks:c,watchStatus:h,lintFindings:v,errors:l}})})}finally{n.current=!1}}},[]);ge.useEffect(()=>{r()},[r]);const i=ge.useCallback(async l=>{if(!l){e({type:"approvalDetail",payload:{detail:null}});return}try{const s=await TN(l);e({type:"approvalDetail",payload:{detail:s}})}catch(s){e({type:"approvalDetail",payload:{detail:null,error:s instanceof Error?s.message:String(s)}})}},[]);return{state:t,refresh:r,loadApprovalDetail:i,dispatch:e}}const GD="swarmvault.viewer.recentSearches",C9=6;function Ss(t){return[...new Set(t.filter(Boolean))]}function T9(){if(typeof window>"u")return[];try{const t=window.localStorage.getItem(GD);if(!t)return[];const e=JSON.parse(t);return Array.isArray(e)?e.filter(n=>typeof n=="string"):[]}catch{return[]}}function D9(t){if(!(typeof window>"u"))try{window.localStorage.setItem(GD,JSON.stringify(t))}catch{}}function A9(){const t=ge.useRef(null),{state:e,refresh:n,loadApprovalDetail:r}=S9(),{graph:i,graphReport:l,approvals:s,approvalDetail:u,candidates:f,memoryTasks:c,watchStatus:h,lintFindings:v,loading:p,errors:m}=e,{theme:y,setTheme:S}=m9(),{route:w,navigate:E}=f9(),C=b9(),T=u9(),[A,k]=ge.useState(null),[N,_]=ge.useState("all"),[O,U]=ge.useState("all"),[M,I]=ge.useState("all"),[P,j]=ge.useState("all"),[K,$]=ge.useState("all"),[B,H]=ge.useState("all"),[Y,Q]=ge.useState("all"),[z,F]=ge.useState([]),[q,L]=ge.useState(""),[W,ae]=ge.useState([]),[se,me]=ge.useState("relevance"),[Ne,pe]=ge.useState(()=>T9()),[ee,le]=ge.useState(""),[fe,xe]=ge.useState(null),[Re,Xe]=ge.useState(""),[Ke,ot]=ge.useState(""),[et,We]=ge.useState(null),[ze,Je]=ge.useState(null),[Ye,ut]=ge.useState(null),[je,gt]=ge.useState(null),[ue,Se]=ge.useState(null),[Ie,Ve]=ge.useState(null),[qe,Fe]=ge.useState(null),[be,G]=ge.useState(""),[ne,de]=ge.useState("approvals"),[oe,Ee]=ge.useState(""),[Pe,De]=ge.useState(!1),[Qe,$e]=ge.useState(!1),[rt,it]=ge.useState("none"),[X,re]=ge.useState(0),Ce=ge.useDeferredValue(q),Oe=ge.useMemo(()=>!Ye||!i?null:i.pages?.find(te=>te.path===Ye.path||te.id===(typeof Ye.frontmatter.page_id=="string"?Ye.frontmatter.page_id:""))??null,[Ye,i]),yt=ge.useMemo(()=>Ss(i?.pages?.flatMap(te=>te.projectIds??[])??[]).sort((te,_e)=>te.localeCompare(_e)),[i]),dt=ge.useMemo(()=>Ss(i?.pages?.flatMap(te=>te.kind==="source"&&te.sourceType?[te.sourceType]:[]).sort((te,_e)=>te.localeCompare(_e))??[]),[i]),He=ge.useMemo(()=>Ss(i?.pages?.flatMap(te=>te.sourceClass?[te.sourceClass]:[]).sort((te,_e)=>te.localeCompare(_e))??[]),[i]),Be=ge.useMemo(()=>Ss((i?.communities??[]).map(te=>te.id)).sort((te,_e)=>te.localeCompare(_e)),[i]),Ze=ge.useMemo(()=>{const te={};for(const _e of i?.pages??[]){const Me=_e.tags??_e.semantic_tags;Array.isArray(Me)&&(te[_e.id]=Me.filter(bt=>typeof bt=="string"))}return te},[i]),Et=ge.useMemo(()=>{const te=new Map;for(const _e of i?.pages??[]){const Me=Ze[_e.id]??[];for(const bt of Me)te.set(bt,(te.get(bt)??0)+1)}return[...te.entries()].map(([_e,Me])=>({tag:_e,count:Me})).sort((_e,Me)=>Me.count-_e.count||_e.tag.localeCompare(Me.tag))},[i,Ze]),xt=ge.useMemo(()=>Oe?Ss(Oe.backlinks).map(te=>i?.pages?.find(_e=>_e.id===te)??null).filter(te=>!!te):[],[Oe,i]),Rn=ge.useMemo(()=>Oe?Ss(Oe.relatedPageIds).map(te=>i?.pages?.find(_e=>_e.id===te)??null).filter(te=>!!te):[],[Oe,i]),Kt=ge.useMemo(()=>i?.pages?.filter(te=>te.kind==="graph_report"||te.kind==="community_summary")??[],[i]),pn=i?.presentation,wn=pn?.mode==="overview";ge.useEffect(()=>{D9(Ne)},[Ne]),ge.useEffect(()=>{if(!s.length){Ee("");return}(!oe||!s.some(te=>te.approvalId===oe))&&Ee(s[0]?.approvalId??"")},[s,oe]),ge.useEffect(()=>{r(oe||void 0)},[oe,r]),ge.useEffect(()=>{if(!T.events.length)return;const te=T.events[0];te&&["compile","ingest","watch","approval","candidate","memory","lint"].includes(te.type)&&n()},[T.events,n]),ge.useEffect(()=>{if(!A){Je(null);return}let te=!1;return SN(A.id).then(_e=>{te||(Je(_e),Ve(null))}).catch(_e=>{te||Ve(_e instanceof Error?_e.message:String(_e))}),()=>{te=!0}},[A]),ge.useEffect(()=>{const te=Ce.trim();if(te.length<2){ae([]),Se(null);return}let _e=!1;return SS(te,{limit:50,kind:O,status:M,project:P,sourceType:B,sourceClass:Y}).then(Me=>{_e||ge.startTransition(()=>{ae(Me),Se(null),pe(bt=>te?[te,...bt.filter(At=>At!==te)].slice(0,C9):bt)})}).catch(Me=>{_e||Se(Me instanceof Error?Me.message:String(Me))}),()=>{_e=!0}},[Ce,O,M,P,B,Y]),ge.useEffect(()=>{if(!A?.pageId)return;const te=i?.pages?.find(Me=>Me.id===A.pageId);if(!te)return;let _e=!1;return IE(te.path).then(Me=>{_e||(ut(Me),gt(null))}).catch(Me=>{_e||gt(Me instanceof Error?Me.message:String(Me))}),()=>{_e=!0}},[i,A]);const Tt=ge.useCallback(async(te,_e)=>{try{const Me=await IE(te);if(ut(Me),gt(null),E({view:"page",params:{path:te,id:_e??""}}),i&&t.current){const bt=i.pages?.find(At=>At.path===te||(_e?At.id===_e:!1)),Tn=(_e?i.nodes.find(At=>At.pageId===_e):void 0)??i.nodes.find(At=>bt?.nodeIds?.includes(At.id));Tn&&(t.current.elements().unselect(),t.current.getElementById(Tn.id).select(),t.current.center(t.current.getElementById(Tn.id)))}}catch(Me){gt(Me instanceof Error?Me.message:String(Me))}},[i,E]),mn=ge.useCallback(async te=>{await Tt(te.path,te.pageId)},[Tt]),$n=ge.useCallback(async(te,_e)=>{if(!oe)return;const Me=oe;G(`${_e}:${te}`),Fe(null);try{await Zc(Me,_e,[te]),await n(),await r(Me),C.push(`${_e==="accept"?"Accepted":"Rejected"} 1 entry`,async()=>{await Zc(Me,_e==="accept"?"reject":"accept",[te]),await n(),await r(Me)})}catch(bt){Fe(bt instanceof Error?bt.message:String(bt))}finally{G("")}},[r,n,oe,C]),Sn=ge.useCallback(async(te,_e)=>{if(!oe||!te.length)return;const Me=oe;G(`bulk:${_e}`),Fe(null);try{await Zc(Me,_e,te),await n(),await r(Me),C.push(`${_e==="accept"?"Accepted":"Rejected"} ${te.length} entries`,async()=>{await Zc(Me,_e==="accept"?"reject":"accept",te),await n(),await r(Me)})}catch(bt){Fe(bt instanceof Error?bt.message:String(bt))}finally{G("")}},[r,n,oe,C]),yn=ge.useCallback(async(te,_e,Me)=>{G(`${_e}:${te}`),Fe(null);try{const bt=await PE(te,_e);await n(),_e==="promote"?await Tt(bt.path,bt.pageId):Me&&ut(null)}catch(bt){Fe(bt instanceof Error?bt.message:String(bt))}finally{G("")}},[Tt,n]),bn=ge.useCallback(async(te,_e)=>{if(te.length){G(`bulk-candidate:${_e}`),Fe(null);try{for(const Me of te)await PE(Me,_e);await n()}catch(Me){Fe(Me instanceof Error?Me.message:String(Me))}finally{G("")}}},[n]),Vr=ge.useCallback(async()=>{if(!ee.trim()){xe(null);return}try{const te=await xN(ee,{budget:12});xe(te),Ve(null)}catch(te){Ve(te instanceof Error?te.message:String(te))}},[ee]),Cn=ge.useCallback(async()=>{if(!Re.trim()||!Ke.trim()){We(null);return}try{const te=await zE(Re,Ke);We(te),Ve(null)}catch(te){Ve(te instanceof Error?te.message:String(te))}},[Re,Ke]),sr=ge.useCallback(te=>{const _e=t.current?.getElementById(te);_e&&(t.current?.elements().unselect(),_e.select(),t.current?.center(_e)),E({view:"node",params:{id:te}})},[E]);ge.useEffect(()=>{if(w.view==="page"&&w.params.path&&w.params.path!==Ye?.path&&Tt(w.params.path,w.params.id),w.view==="node"&&w.params.id&&sr(w.params.id),w.view==="tag"&&w.params.tag&&F([w.params.tag]),w.view==="tags"){const _e=(w.params.selected??"").split(",").map(Me=>Me.trim()).filter(Me=>Me.length>0);F(_e)}w.view==="approval"&&w.params.id&&(de("approvals"),Ee(w.params.id)),w.view==="memory"&&de("memory")},[w,Tt,sr,Ye?.path]);const Un=ge.useCallback(async(te,_e)=>{Xe(te),ot(_e);try{const Me=await zE(te,_e);We(Me),Ve(null)}catch(Me){Ve(Me instanceof Error?Me.message:String(Me))}},[]),or=ge.useCallback(te=>{const _e=[...new Set(te.filter(Me=>Me.length>0))];if(F(_e),_e.length===0){(w.view==="tag"||w.view==="tags")&&E({view:"",params:{}});return}E({view:"tags",params:{selected:_e.join(",")}})},[E,w.view]),$r=ge.useCallback(te=>{F(_e=>{const Me=_e.includes(te)?_e.filter(bt=>bt!==te):[..._e,te];return Me.length===0?E({view:"",params:{}}):E({view:"tags",params:{selected:Me.join(",")}}),Me})},[E]),Kr=ge.useCallback(()=>{or([])},[or]),nn=ge.useCallback(()=>{document.querySelector('input[aria-label="Search pages"]')?.focus()},[]),sa=ge.useCallback(()=>{document.querySelector('[data-testid="graph-query-input"]')?.focus()},[]),wr=ge.useCallback(()=>{document.querySelector('[data-testid="graph-path-from"]')?.focus()},[]),Qn=ge.useMemo(()=>[{id:"refresh",label:"Refresh workspace",section:"View",shortcut:"R",run:()=>{n()}},{id:"fit",label:"Fit graph to viewport",section:"Graph",shortcut:"F",run:()=>re(te=>te+1)},{id:"search",label:"Focus search",section:"Search",shortcut:"/",run:nn},{id:"graph-query",label:"Focus graph query",section:"Graph",shortcut:"Q",run:sa},{id:"graph-path",label:"Focus graph path",section:"Graph",shortcut:"P",run:wr},{id:"open-approvals",label:"Open approvals tab",section:"Workflow",run:()=>de("approvals")},{id:"open-candidates",label:"Open candidates tab",section:"Workflow",run:()=>de("candidates")},{id:"open-memory",label:"Open memory tab",section:"Workflow",run:()=>de("memory")},{id:"open-refresh",label:"Open refresh tab",section:"Workflow",run:()=>de("refresh")},{id:"open-activity",label:"Open activity tab",section:"Workflow",run:()=>de("activity")},{id:"open-lint",label:"Open lint tab",section:"Workflow",run:()=>de("lint")},{id:"theme-light",label:"Theme: light",section:"Theme",run:()=>S("light")},{id:"theme-dark",label:"Theme: dark",section:"Theme",run:()=>S("dark")},{id:"theme-system",label:"Theme: system",section:"Theme",run:()=>S("system")},{id:"drawer-sidebar",label:"Toggle filter sidebar",section:"Layout",run:()=>it(te=>te==="sidebar"?"none":"sidebar")},{id:"drawer-rail",label:"Toggle detail rail",section:"Layout",run:()=>it(te=>te==="rail"?"none":"rail")},{id:"help",label:"Show keyboard shortcuts",section:"Help",shortcut:"?",run:()=>$e(!0)},...Et.slice(0,12).map(te=>({id:`tag-${te.tag}`,label:`Filter by tag: ${te.tag}`,section:"Tags",keywords:["tag",te.tag],run:()=>{or([te.tag])}}))],[nn,sa,wr,n,S,Et,or]),ke=ge.useMemo(()=>[{key:"k",meta:!0,description:"Open command palette",handler:()=>De(!0),allowInInput:!0},{key:"?",shift:!0,description:"Show shortcut help",handler:()=>$e(!0)},{key:"/",description:"Focus search",handler:nn},{key:"f",description:"Fit graph",handler:()=>re(te=>te+1)},{key:"q",description:"Focus graph query",handler:sa},{key:"p",description:"Focus path-from",handler:wr},{key:"r",description:"Refresh workspace",handler:()=>{n()}},{key:"Escape",description:"Close overlays",handler:()=>{De(!1),$e(!1),it("none")},allowInInput:!0},{key:"[",description:"Toggle sidebar drawer",handler:()=>it(te=>te==="sidebar"?"none":"sidebar")},{key:"]",description:"Toggle rail drawer",handler:()=>it(te=>te==="rail"?"none":"rail")}],[nn,sa,wr,n]);v9(ke);const at=ge.useMemo(()=>Ye?{title:Ye.title,content:Ye.content}:null,[Ye]),St=A?[A.id]:[];return D.jsxs("div",{className:"app-shell",children:[D.jsxs("header",{className:"app-bar",children:[D.jsx("button",{type:"button",className:"app-bar-icon-btn drawer-trigger","aria-label":"Toggle filter sidebar",onClick:()=>it(te=>te==="sidebar"?"none":"sidebar"),children:"β°"}),D.jsx("span",{className:"app-bar-title",children:"SwarmVault"}),D.jsx("span",{className:"app-bar-subtitle",children:"Graph Viewer"}),D.jsx("span",{className:"app-bar-spacer"}),D.jsxs("div",{className:"app-bar-actions",children:[D.jsx(ON,{cyRef:t,graph:i,selectedNodeIds:St,pageMarkdown:at}),D.jsx("button",{type:"button",className:"app-bar-icon-btn",onClick:()=>De(!0),title:"Command palette (βK)","aria-label":"Open command palette",children:"βK"}),D.jsx("button",{type:"button",className:"app-bar-icon-btn",onClick:()=>$e(!0),title:"Keyboard shortcuts (?)","aria-label":"Show keyboard shortcuts",children:"?"}),D.jsx(l9,{theme:y,onChange:S}),D.jsx("button",{type:"button",className:"app-bar-icon-btn drawer-trigger","aria-label":"Toggle detail rail",onClick:()=>it(te=>te==="rail"?"none":"rail"),children:"β§"})]})]}),D.jsx("div",{className:`drawer-backdrop${rt!=="none"?" is-open":""}`,onClick:()=>it("none"),"aria-hidden":"true"}),D.jsx("div",{className:`sidebar${rt==="sidebar"?" is-open":""}`,children:D.jsx(BN,{edgeStatusFilter:N,onEdgeStatusChange:_,kindFilter:O,onKindChange:U,pageStatusFilter:M,onPageStatusChange:I,projectFilter:P,onProjectChange:j,projectOptions:yt,sourceTypeFilter:B,onSourceTypeChange:H,sourceTypeOptions:dt,sourceClassFilter:Y,onSourceClassChange:Q,sourceClassOptions:He,communityFilter:K,onCommunityChange:$,communityOptions:Be,selectedTags:z,onToggleTag:$r,onClearTags:Kr,tagOptions:Et,query:q,onQueryChange:L})}),D.jsxs("div",{className:"center-area",children:[D.jsx(a9,{generatedAt:i?.generatedAt??null,nodeCount:pn?.totalNodes??i?.nodes.length??0,edgeCount:pn?.totalEdges??i?.edges.length??0,communityCount:pn?.totalCommunities??i?.communities?.length??0,approvalCount:s.reduce((te,_e)=>te+_e.pendingCount,0),candidateCount:f.length,pendingRefreshCount:h?.pendingSemanticRefresh.length??0,benchmarkRatio:l?.benchmark?.summary.reductionRatio??null}),wn?D.jsxs("div",{className:"overview-banner","data-testid":"graph-overview-banner",children:["Overview mode: showing ",pn?.displayedNodes.toLocaleString()," of ",pn?.totalNodes.toLocaleString()," ","nodes. Use ",D.jsx("code",{children:"--full"})," to render the entire graph."]}):null,p&&!i?D.jsx("div",{className:"canvas canvas-loading",children:D.jsx("span",{className:"loading-text",children:"Loading graph dataβ¦"})}):!p&&i&&i.nodes.length===0?D.jsxs("div",{className:"canvas canvas-loading canvas-empty",children:[D.jsx("span",{className:"canvas-empty-icon",children:"β"}),D.jsx("span",{className:"text-muted",children:"No nodes in the current graph view."})]}):D.jsx(xL,{graph:i,edgeStatusFilter:N,communityFilter:K,sourceClassFilter:Y,selectedTags:z,pageTags:Ze,pathResult:et,onNodeSelect:k,cyRef:t,fitTrigger:X}),D.jsx(e9,{graphReport:l,onOpenPage:Tt,onNavigateNode:sr,onHighlightSurprise:Un})]}),D.jsxs("aside",{className:`detail-rail${rt==="rail"?" is-open":""}`,children:[D.jsx(wL,{graphQueryInput:ee,onGraphQueryInputChange:le,onRunQuery:()=>{Vr()},graphQueryResult:fe,pathFrom:Re,onPathFromChange:Xe,pathTo:Ke,onPathToChange:ot,onHighlightPath:()=>{Cn()},pathResult:et,graphError:Ie,graph:i,onOpenPage:Tt,onNavigateNode:sr}),D.jsx(r9,{selected:A,graphExplain:ze,graphError:Ie,onNavigateNode:sr}),D.jsx(n9,{results:W,searchError:ue,query:q,onOpenResult:mn,recentQueries:Ne,onSelectRecent:te=>L(te),sort:se,onSortChange:me}),D.jsxs(jD,{tabs:[{id:"approvals",label:"Approvals",count:s.reduce((te,_e)=>te+_e.pendingCount,0)},{id:"candidates",label:"Candidates",count:f.length},{id:"memory",label:"Memory",count:c.length},{id:"refresh",label:"Refresh",count:h?.pendingSemanticRefresh.length??0},{id:"activity",label:"Activity",count:T.events.length},{id:"lint",label:"Lint",count:v.length}],activeTab:ne,onTabChange:de,children:[ne==="approvals"&&D.jsx(cN,{approvals:s,selectedApprovalId:oe,onSelectApproval:te=>{Ee(te),E({view:"approval",params:{id:te}})},approvalDetail:u,approvalError:m.approval??null,actionError:qe,busyAction:be,onReviewAction:(te,_e)=>{$n(te,_e)},onBulkReview:(te,_e)=>{Sn(te,_e)},onOpenPage:Tt}),ne==="candidates"&&D.jsx(dN,{candidates:f,candidateError:m.candidate??null,busyAction:be,onCandidateAction:(te,_e,Me)=>{yn(te,_e,Me)},onBulkCandidateAction:(te,_e)=>{bn(te,_e)},onOpenPage:Tt}),ne==="memory"&&D.jsx(_L,{tasks:c,memoryError:m.memory??null,onOpenPage:Tt,onNavigateNode:sr}),ne==="refresh"&&D.jsx(JU,{watchStatus:h,watchError:m.watch??null}),ne==="activity"&&D.jsx(lN,{events:T.events,connected:T.connected,error:T.error}),ne==="lint"&&D.jsx(CL,{findings:v,error:m.lint,onOpenPage:Tt})]}),D.jsx(WU,{activePage:Ye,pageError:je,backlinkPages:xt,relatedPages:Rn,graphPageLinks:Kt,onOpenPage:Tt,onNavigateNode:sr})]}),D.jsx(vN,{open:Pe,onClose:()=>De(!1),commands:Qn}),Qe?D.jsx("div",{className:"palette-overlay",role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",onClick:te=>{te.target===te.currentTarget&&$e(!1)},onKeyDown:te=>{te.key==="Escape"&&$e(!1)},children:D.jsxs("div",{className:"help-modal",children:[D.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[D.jsx("h3",{className:"panel-heading",children:"Keyboard Shortcuts"}),D.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>$e(!1),children:"Γ"})]}),D.jsx("div",{className:"shortcut-grid",children:ke.map(te=>D.jsxs("div",{className:"shortcut-row",children:[D.jsx("span",{children:te.description}),D.jsxs("span",{className:"kbd",children:[te.meta?"β":"",te.shift?"β§":"",te.alt?"β₯":"",te.key.toUpperCase()]})]},te.description))})]})}):null,D.jsx(s9,{entry:C.entry,onUndo:C.performUndo,onDismiss:C.dismiss})]})}aN.createRoot(document.getElementById("root")).render(D.jsx(Z_.StrictMode,{children:D.jsx(A9,{})}));
|