expxagents 0.17.11 → 0.17.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,400 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ThreeBackground-CptTZ2RL.js","assets/three-BZk_I9Ly.js","assets/browserAll-qdXfu7ne.js","assets/webworkerAll-CZHbXKvf.js","assets/WebGPURenderer-BLRy1Ehh.js","assets/BufferResource-Bze8p-_k.js","assets/RenderTargetSystem-Bc1DiL47.js","assets/WebGLRenderer-DQLmNcFd.js","assets/CanvasRenderer-C2gIPS0M.js"])))=>i.map(i=>d[i]);
2
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();const F3="modulepreload",G3=function(e){return"/"+e},XS={},ou=function(t,n,i){let r=Promise.resolve();if(n&&n.length>0){let l=function(p){return Promise.all(p.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));r=l(n.map(p=>{if(p=G3(p),p in XS)return;XS[p]=!0;const m=p.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const x=document.createElement("link");if(x.rel=m?"stylesheet":F3,m||(x.as="script"),x.crossOrigin="",x.href=p,f&&x.setAttribute("nonce",f),document.head.appendChild(x),m)return new Promise((v,S)=>{x.addEventListener("load",v),x.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${p}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return r.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};function du(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var sb={exports:{}},Xp={};/**
3
- * @license React
4
- * react-jsx-runtime.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var KS;function q3(){if(KS)return Xp;KS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,r,s){var l=null;if(s!==void 0&&(l=""+s),r.key!==void 0&&(l=""+r.key),"key"in r){s={};for(var c in r)c!=="key"&&(s[c]=r[c])}else s=r;return r=s.ref,{$$typeof:e,type:i,key:l,ref:r!==void 0?r:null,props:s}}return Xp.Fragment=t,Xp.jsx=n,Xp.jsxs=n,Xp}var $S;function Y3(){return $S||($S=1,sb.exports=q3()),sb.exports}var _=Y3(),lb={exports:{}},_t={};/**
11
- * @license React
12
- * react.production.js
13
- *
14
- * Copyright (c) Meta Platforms, Inc. and affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var WS;function V3(){if(WS)return _t;WS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function v($){return $===null||typeof $!="object"?null:($=x&&$[x]||$["@@iterator"],typeof $=="function"?$:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,T={};function C($,ne,X){this.props=$,this.context=ne,this.refs=T,this.updater=X||S}C.prototype.isReactComponent={},C.prototype.setState=function($,ne){if(typeof $!="object"&&typeof $!="function"&&$!=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,$,ne,"setState")},C.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function N(){}N.prototype=C.prototype;function R($,ne,X){this.props=$,this.context=ne,this.refs=T,this.updater=X||S}var O=R.prototype=new N;O.constructor=R,A(O,C.prototype),O.isPureReactComponent=!0;var H=Array.isArray;function D(){}var q={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function V($,ne,X){var ce=X.ref;return{$$typeof:e,type:$,key:ne,ref:ce!==void 0?ce:null,props:X}}function Y($,ne){return V($.type,ne,$.props)}function F($){return typeof $=="object"&&$!==null&&$.$$typeof===e}function j($){var ne={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(X){return ne[X]})}var ee=/\/+/g;function P($,ne){return typeof $=="object"&&$!==null&&$.key!=null?j(""+$.key):ne.toString(36)}function W($){switch($.status){case"fulfilled":return $.value;case"rejected":throw $.reason;default:switch(typeof $.status=="string"?$.then(D,D):($.status="pending",$.then(function(ne){$.status==="pending"&&($.status="fulfilled",$.value=ne)},function(ne){$.status==="pending"&&($.status="rejected",$.reason=ne)})),$.status){case"fulfilled":return $.value;case"rejected":throw $.reason}}throw $}function z($,ne,X,ce,ie){var de=typeof $;(de==="undefined"||de==="boolean")&&($=null);var xe=!1;if($===null)xe=!0;else switch(de){case"bigint":case"string":case"number":xe=!0;break;case"object":switch($.$$typeof){case e:case t:xe=!0;break;case m:return xe=$._init,z(xe($._payload),ne,X,ce,ie)}}if(xe)return ie=ie($),xe=ce===""?"."+P($,0):ce,H(ie)?(X="",xe!=null&&(X=xe.replace(ee,"$&/")+"/"),z(ie,ne,X,"",function(Re){return Re})):ie!=null&&(F(ie)&&(ie=Y(ie,X+(ie.key==null||$&&$.key===ie.key?"":(""+ie.key).replace(ee,"$&/")+"/")+xe)),ne.push(ie)),1;xe=0;var me=ce===""?".":ce+":";if(H($))for(var le=0;le<$.length;le++)ce=$[le],de=me+P(ce,le),xe+=z(ce,ne,X,de,ie);else if(le=v($),typeof le=="function")for($=le.call($),le=0;!(ce=$.next()).done;)ce=ce.value,de=me+P(ce,le++),xe+=z(ce,ne,X,de,ie);else if(de==="object"){if(typeof $.then=="function")return z(W($),ne,X,ce,ie);throw ne=String($),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return xe}function K($,ne,X){if($==null)return $;var ce=[],ie=0;return z($,ce,"","",function(de){return ne.call(X,de,ie++)}),ce}function G($){if($._status===-1){var ne=$._result;ne=ne(),ne.then(function(X){($._status===0||$._status===-1)&&($._status=1,$._result=X)},function(X){($._status===0||$._status===-1)&&($._status=2,$._result=X)}),$._status===-1&&($._status=0,$._result=ne)}if($._status===1)return $._result.default;throw $._result}var Q=typeof reportError=="function"?reportError:function($){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ne=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof $=="object"&&$!==null&&typeof $.message=="string"?String($.message):String($),error:$});if(!window.dispatchEvent(ne))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",$);return}console.error($)},I={map:K,forEach:function($,ne,X){K($,function(){ne.apply(this,arguments)},X)},count:function($){var ne=0;return K($,function(){ne++}),ne},toArray:function($){return K($,function(ne){return ne})||[]},only:function($){if(!F($))throw Error("React.Children.only expected to receive a single React element child.");return $}};return _t.Activity=g,_t.Children=I,_t.Component=C,_t.Fragment=n,_t.Profiler=r,_t.PureComponent=R,_t.StrictMode=i,_t.Suspense=f,_t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=q,_t.__COMPILER_RUNTIME={__proto__:null,c:function($){return q.H.useMemoCache($)}},_t.cache=function($){return function(){return $.apply(null,arguments)}},_t.cacheSignal=function(){return null},_t.cloneElement=function($,ne,X){if($==null)throw Error("The argument must be a React element, but you passed "+$+".");var ce=A({},$.props),ie=$.key;if(ne!=null)for(de in ne.key!==void 0&&(ie=""+ne.key),ne)!Z.call(ne,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&ne.ref===void 0||(ce[de]=ne[de]);var de=arguments.length-2;if(de===1)ce.children=X;else if(1<de){for(var xe=Array(de),me=0;me<de;me++)xe[me]=arguments[me+2];ce.children=xe}return V($.type,ie,ce)},_t.createContext=function($){return $={$$typeof:l,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null},$.Provider=$,$.Consumer={$$typeof:s,_context:$},$},_t.createElement=function($,ne,X){var ce,ie={},de=null;if(ne!=null)for(ce in ne.key!==void 0&&(de=""+ne.key),ne)Z.call(ne,ce)&&ce!=="key"&&ce!=="__self"&&ce!=="__source"&&(ie[ce]=ne[ce]);var xe=arguments.length-2;if(xe===1)ie.children=X;else if(1<xe){for(var me=Array(xe),le=0;le<xe;le++)me[le]=arguments[le+2];ie.children=me}if($&&$.defaultProps)for(ce in xe=$.defaultProps,xe)ie[ce]===void 0&&(ie[ce]=xe[ce]);return V($,de,ie)},_t.createRef=function(){return{current:null}},_t.forwardRef=function($){return{$$typeof:c,render:$}},_t.isValidElement=F,_t.lazy=function($){return{$$typeof:m,_payload:{_status:-1,_result:$},_init:G}},_t.memo=function($,ne){return{$$typeof:p,type:$,compare:ne===void 0?null:ne}},_t.startTransition=function($){var ne=q.T,X={};q.T=X;try{var ce=$(),ie=q.S;ie!==null&&ie(X,ce),typeof ce=="object"&&ce!==null&&typeof ce.then=="function"&&ce.then(D,Q)}catch(de){Q(de)}finally{ne!==null&&X.types!==null&&(ne.types=X.types),q.T=ne}},_t.unstable_useCacheRefresh=function(){return q.H.useCacheRefresh()},_t.use=function($){return q.H.use($)},_t.useActionState=function($,ne,X){return q.H.useActionState($,ne,X)},_t.useCallback=function($,ne){return q.H.useCallback($,ne)},_t.useContext=function($){return q.H.useContext($)},_t.useDebugValue=function(){},_t.useDeferredValue=function($,ne){return q.H.useDeferredValue($,ne)},_t.useEffect=function($,ne){return q.H.useEffect($,ne)},_t.useEffectEvent=function($){return q.H.useEffectEvent($)},_t.useId=function(){return q.H.useId()},_t.useImperativeHandle=function($,ne,X){return q.H.useImperativeHandle($,ne,X)},_t.useInsertionEffect=function($,ne){return q.H.useInsertionEffect($,ne)},_t.useLayoutEffect=function($,ne){return q.H.useLayoutEffect($,ne)},_t.useMemo=function($,ne){return q.H.useMemo($,ne)},_t.useOptimistic=function($,ne){return q.H.useOptimistic($,ne)},_t.useReducer=function($,ne,X){return q.H.useReducer($,ne,X)},_t.useRef=function($){return q.H.useRef($)},_t.useState=function($){return q.H.useState($)},_t.useSyncExternalStore=function($,ne,X){return q.H.useSyncExternalStore($,ne,X)},_t.useTransition=function(){return q.H.useTransition()},_t.version="19.2.4",_t}var QS;function vh(){return QS||(QS=1,lb.exports=V3()),lb.exports}var L=vh();const fm=du(L);var ob={exports:{}},Kp={},cb={exports:{}},ub={};/**
19
- * @license React
20
- * scheduler.production.js
21
- *
22
- * Copyright (c) Meta Platforms, Inc. and affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var ZS;function X3(){return ZS||(ZS=1,(function(e){function t(z,K){var G=z.length;z.push(K);e:for(;0<G;){var Q=G-1>>>1,I=z[Q];if(0<r(I,K))z[Q]=K,z[G]=I,G=Q;else break e}}function n(z){return z.length===0?null:z[0]}function i(z){if(z.length===0)return null;var K=z[0],G=z.pop();if(G!==K){z[0]=G;e:for(var Q=0,I=z.length,$=I>>>1;Q<$;){var ne=2*(Q+1)-1,X=z[ne],ce=ne+1,ie=z[ce];if(0>r(X,G))ce<I&&0>r(ie,X)?(z[Q]=ie,z[ce]=G,Q=ce):(z[Q]=X,z[ne]=G,Q=ne);else if(ce<I&&0>r(ie,G))z[Q]=ie,z[ce]=G,Q=ce;else break e}}return K}function r(z,K){var G=z.sortIndex-K.sortIndex;return G!==0?G:z.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],p=[],m=1,g=null,x=3,v=!1,S=!1,A=!1,T=!1,C=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function O(z){for(var K=n(p);K!==null;){if(K.callback===null)i(p);else if(K.startTime<=z)i(p),K.sortIndex=K.expirationTime,t(f,K);else break;K=n(p)}}function H(z){if(A=!1,O(z),!S)if(n(f)!==null)S=!0,D||(D=!0,j());else{var K=n(p);K!==null&&W(H,K.startTime-z)}}var D=!1,q=-1,Z=5,V=-1;function Y(){return T?!0:!(e.unstable_now()-V<Z)}function F(){if(T=!1,D){var z=e.unstable_now();V=z;var K=!0;try{e:{S=!1,A&&(A=!1,N(q),q=-1),v=!0;var G=x;try{t:{for(O(z),g=n(f);g!==null&&!(g.expirationTime>z&&Y());){var Q=g.callback;if(typeof Q=="function"){g.callback=null,x=g.priorityLevel;var I=Q(g.expirationTime<=z);if(z=e.unstable_now(),typeof I=="function"){g.callback=I,O(z),K=!0;break t}g===n(f)&&i(f),O(z)}else i(f);g=n(f)}if(g!==null)K=!0;else{var $=n(p);$!==null&&W(H,$.startTime-z),K=!1}}break e}finally{g=null,x=G,v=!1}K=void 0}}finally{K?j():D=!1}}}var j;if(typeof R=="function")j=function(){R(F)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,P=ee.port2;ee.port1.onmessage=F,j=function(){P.postMessage(null)}}else j=function(){C(F,0)};function W(z,K){q=C(function(){z(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(z){switch(x){case 1:case 2:case 3:var K=3;break;default:K=x}var G=x;x=K;try{return z()}finally{x=G}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(z,K){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var G=x;x=z;try{return K()}finally{x=G}},e.unstable_scheduleCallback=function(z,K,G){var Q=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?Q+G:Q):G=Q,z){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=G+I,z={id:m++,callback:K,priorityLevel:z,startTime:G,expirationTime:I,sortIndex:-1},G>Q?(z.sortIndex=G,t(p,z),n(f)===null&&z===n(p)&&(A?(N(q),q=-1):A=!0,W(H,G-Q))):(z.sortIndex=I,t(f,z),S||v||(S=!0,D||(D=!0,j()))),z},e.unstable_shouldYield=Y,e.unstable_wrapCallback=function(z){var K=x;return function(){var G=x;x=K;try{return z.apply(this,arguments)}finally{x=G}}}})(ub)),ub}var JS;function K3(){return JS||(JS=1,cb.exports=X3()),cb.exports}var db={exports:{}},zr={};/**
27
- * @license React
28
- * react-dom.production.js
29
- *
30
- * Copyright (c) Meta Platforms, Inc. and affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var eE;function $3(){if(eE)return zr;eE=1;var e=vh();function t(f){var p="https://react.dev/errors/"+f;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)p+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},r=Symbol.for("react.portal");function s(f,p,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:g==null?null:""+g,children:f,containerInfo:p,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,p){if(f==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return zr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,zr.createPortal=function(f,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return s(f,p,null,m)},zr.flushSync=function(f){var p=l.T,m=i.p;try{if(l.T=null,i.p=2,f)return f()}finally{l.T=p,i.p=m,i.d.f()}},zr.preconnect=function(f,p){typeof f=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,i.d.C(f,p))},zr.prefetchDNS=function(f){typeof f=="string"&&i.d.D(f)},zr.preinit=function(f,p){if(typeof f=="string"&&p&&typeof p.as=="string"){var m=p.as,g=c(m,p.crossOrigin),x=typeof p.integrity=="string"?p.integrity:void 0,v=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;m==="style"?i.d.S(f,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:v}):m==="script"&&i.d.X(f,{crossOrigin:g,integrity:x,fetchPriority:v,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},zr.preinitModule=function(f,p){if(typeof f=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var m=c(p.as,p.crossOrigin);i.d.M(f,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&i.d.M(f)},zr.preload=function(f,p){if(typeof f=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var m=p.as,g=c(m,p.crossOrigin);i.d.L(f,m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},zr.preloadModule=function(f,p){if(typeof f=="string")if(p){var m=c(p.as,p.crossOrigin);i.d.m(f,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else i.d.m(f)},zr.requestFormReset=function(f){i.d.r(f)},zr.unstable_batchedUpdates=function(f,p){return f(p)},zr.useFormState=function(f,p,m){return l.H.useFormState(f,p,m)},zr.useFormStatus=function(){return l.H.useHostTransitionStatus()},zr.version="19.2.4",zr}var tE;function AC(){if(tE)return db.exports;tE=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),db.exports=$3(),db.exports}/**
35
- * @license React
36
- * react-dom-client.production.js
37
- *
38
- * Copyright (c) Meta Platforms, Inc. and affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- */var nE;function W3(){if(nE)return Kp;nE=1;var e=K3(),t=vh(),n=AC();function i(a){var o="https://react.dev/errors/"+a;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)o+="&args[]="+encodeURIComponent(arguments[h])}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 r(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var o=a,h=a;if(a.alternate)for(;o.return;)o=o.return;else{a=o;do o=a,(o.flags&4098)!==0&&(h=o.return),a=o.return;while(a)}return o.tag===3?h:null}function l(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 c(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(s(a)!==a)throw Error(i(188))}function p(a){var o=a.alternate;if(!o){if(o=s(a),o===null)throw Error(i(188));return o!==a?null:a}for(var h=a,y=o;;){var E=h.return;if(E===null)break;var M=E.alternate;if(M===null){if(y=E.return,y!==null){h=y;continue}break}if(E.child===M.child){for(M=E.child;M;){if(M===h)return f(E),a;if(M===y)return f(E),o;M=M.sibling}throw Error(i(188))}if(h.return!==y.return)h=E,y=M;else{for(var U=!1,J=E.child;J;){if(J===h){U=!0,h=E,y=M;break}if(J===y){U=!0,y=E,h=M;break}J=J.sibling}if(!U){for(J=M.child;J;){if(J===h){U=!0,h=M,y=E;break}if(J===y){U=!0,y=M,h=E;break}J=J.sibling}if(!U)throw Error(i(189))}}if(h.alternate!==y)throw Error(i(190))}if(h.tag!==3)throw Error(i(188));return h.stateNode.current===h?a:o}function m(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a;for(a=a.child;a!==null;){if(o=m(a),o!==null)return o;a=a.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),R=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),Y=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function j(a){return a===null||typeof a!="object"?null:(a=F&&a[F]||a["@@iterator"],typeof a=="function"?a:null)}var ee=Symbol.for("react.client.reference");function P(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===ee?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case A:return"Fragment";case C:return"Profiler";case T:return"StrictMode";case H:return"Suspense";case D:return"SuspenseList";case V:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case S:return"Portal";case R:return a.displayName||"Context";case N:return(a._context.displayName||"Context")+".Consumer";case O:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case q:return o=a.displayName||null,o!==null?o:P(a.type)||"Memo";case Z:o=a._payload,a=a._init;try{return P(a(o))}catch{}}return null}var W=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},Q=[],I=-1;function $(a){return{current:a}}function ne(a){0>I||(a.current=Q[I],Q[I]=null,I--)}function X(a,o){I++,Q[I]=a.current,a.current=o}var ce=$(null),ie=$(null),de=$(null),xe=$(null);function me(a,o){switch(X(de,o),X(ie,a),X(ce,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?gS(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=gS(o),a=yS(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}ne(ce),X(ce,a)}function le(){ne(ce),ne(ie),ne(de)}function Re(a){a.memoizedState!==null&&X(xe,a);var o=ce.current,h=yS(o,a.type);o!==h&&(X(ie,a),X(ce,h))}function je(a){ie.current===a&&(ne(ce),ne(ie)),xe.current===a&&(ne(xe),Gp._currentValue=G)}var Ie,He;function Qe(a){if(Ie===void 0)try{throw Error()}catch(h){var o=h.stack.trim().match(/\n( *(at )?)/);Ie=o&&o[1]||"",He=-1<h.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+Ie+a+He}var ot=!1;function Ue(a,o){if(!a||ot)return"";ot=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var y={DetermineComponentFrameRoot:function(){try{if(o){var Me=function(){throw Error()};if(Object.defineProperty(Me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Me,[])}catch(Se){var ve=Se}Reflect.construct(a,[],Me)}else{try{Me.call()}catch(Se){ve=Se}a.call(Me.prototype)}}else{try{throw Error()}catch(Se){ve=Se}(Me=a())&&typeof Me.catch=="function"&&Me.catch(function(){})}}catch(Se){if(Se&&ve&&typeof Se.stack=="string")return[Se.stack,ve.stack]}return[null,null]}};y.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(y.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(y.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var M=y.DetermineComponentFrameRoot(),U=M[0],J=M[1];if(U&&J){var ae=U.split(`
45
- `),ye=J.split(`
46
- `);for(E=y=0;y<ae.length&&!ae[y].includes("DetermineComponentFrameRoot");)y++;for(;E<ye.length&&!ye[E].includes("DetermineComponentFrameRoot");)E++;if(y===ae.length||E===ye.length)for(y=ae.length-1,E=ye.length-1;1<=y&&0<=E&&ae[y]!==ye[E];)E--;for(;1<=y&&0<=E;y--,E--)if(ae[y]!==ye[E]){if(y!==1||E!==1)do if(y--,E--,0>E||ae[y]!==ye[E]){var we=`
47
- `+ae[y].replace(" at new "," at ");return a.displayName&&we.includes("<anonymous>")&&(we=we.replace("<anonymous>",a.displayName)),we}while(1<=y&&0<=E);break}}}finally{ot=!1,Error.prepareStackTrace=h}return(h=a?a.displayName||a.name:"")?Qe(h):""}function wt(a,o){switch(a.tag){case 26:case 27:case 5:return Qe(a.type);case 16:return Qe("Lazy");case 13:return a.child!==o&&o!==null?Qe("Suspense Fallback"):Qe("Suspense");case 19:return Qe("SuspenseList");case 0:case 15:return Ue(a.type,!1);case 11:return Ue(a.type.render,!1);case 1:return Ue(a.type,!0);case 31:return Qe("Activity");default:return""}}function _n(a){try{var o="",h=null;do o+=wt(a,h),h=a,a=a.return;while(a);return o}catch(y){return`
48
- Error generating stack: `+y.message+`
49
- `+y.stack}}var Sn=Object.prototype.hasOwnProperty,hn=e.unstable_scheduleCallback,oi=e.unstable_cancelCallback,Ur=e.unstable_shouldYield,Ci=e.unstable_requestPaint,Wt=e.unstable_now,sr=e.unstable_getCurrentPriorityLevel,Ee=e.unstable_ImmediatePriority,ke=e.unstable_UserBlockingPriority,oe=e.unstable_NormalPriority,Pe=e.unstable_LowPriority,ct=e.unstable_IdlePriority,tn=e.log,ci=e.unstable_setDisableYieldValue,Qt=null,Zt=null;function Gn(a){if(typeof tn=="function"&&ci(a),Zt&&typeof Zt.setStrictMode=="function")try{Zt.setStrictMode(Qt,a)}catch{}}var Pt=Math.clz32?Math.clz32:vo,Yi=Math.log,Jn=Math.LN2;function vo(a){return a>>>=0,a===0?32:31-(Yi(a)/Jn|0)|0}var ls=256,Ba=262144,os=4194304;function vi(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 se(a,o,h){var y=a.pendingLanes;if(y===0)return 0;var E=0,M=a.suspendedLanes,U=a.pingedLanes;a=a.warmLanes;var J=y&134217727;return J!==0?(y=J&~M,y!==0?E=vi(y):(U&=J,U!==0?E=vi(U):h||(h=J&~a,h!==0&&(E=vi(h))))):(J=y&~M,J!==0?E=vi(J):U!==0?E=vi(U):h||(h=y&~a,h!==0&&(E=vi(h)))),E===0?0:o!==0&&o!==E&&(o&M)===0&&(M=E&-E,h=o&-o,M>=h||M===32&&(h&4194048)!==0)?o:E}function Te(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function Le(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 tt(){var a=os;return os<<=1,(os&62914560)===0&&(os=4194304),a}function nn(a){for(var o=[],h=0;31>h;h++)o.push(a);return o}function rn(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Ye(a,o,h,y,E,M){var U=a.pendingLanes;a.pendingLanes=h,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=h,a.entangledLanes&=h,a.errorRecoveryDisabledLanes&=h,a.shellSuspendCounter=0;var J=a.entanglements,ae=a.expirationTimes,ye=a.hiddenUpdates;for(h=U&~h;0<h;){var we=31-Pt(h),Me=1<<we;J[we]=0,ae[we]=-1;var ve=ye[we];if(ve!==null)for(ye[we]=null,we=0;we<ve.length;we++){var Se=ve[we];Se!==null&&(Se.lane&=-536870913)}h&=~Me}y!==0&&Ge(a,y,0),M!==0&&E===0&&a.tag!==0&&(a.suspendedLanes|=M&~(U&~o))}function Ge(a,o,h){a.pendingLanes|=o,a.suspendedLanes&=~o;var y=31-Pt(o);a.entangledLanes|=o,a.entanglements[y]=a.entanglements[y]|1073741824|h&261930}function nt(a,o){var h=a.entangledLanes|=o;for(a=a.entanglements;h;){var y=31-Pt(h),E=1<<y;E&o|a[y]&o&&(a[y]|=o),h&=~E}}function Rn(a,o){var h=o&-o;return h=(h&42)!==0?1:Ft(h),(h&(a.suspendedLanes|o))!==0?0:h}function Ft(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 ga(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function lr(){var a=K.p;return a!==0?a:(a=window.event,a===void 0?32:HS(a.type))}function Vi(a,o){var h=K.p;try{return K.p=a,o()}finally{K.p=h}}var or=Math.random().toString(36).slice(2),bt="__reactFiber$"+or,ui="__reactProps$"+or,Hr="__reactContainer$"+or,Us="__reactEvents$"+or,Cl="__reactListeners$"+or,Al="__reactHandles$"+or,Ml="__reactResources$"+or,La="__reactMarker$"+or;function Hs(a){delete a[bt],delete a[ui],delete a[Us],delete a[Cl],delete a[Al]}function an(a){var o=a[bt];if(o)return o;for(var h=a.parentNode;h;){if(o=h[Hr]||h[bt]){if(h=o.alternate,o.child!==null||h!==null&&h.child!==null)for(a=wS(a);a!==null;){if(h=a[bt])return h;a=wS(a)}return o}a=h,h=a.parentNode}return null}function sn(a){if(a=a[bt]||a[Hr]){var o=a.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return a}return null}function cr(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a.stateNode;throw Error(i(33))}function Pr(a){var o=a[Ml];return o||(o=a[Ml]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function jn(a){a[La]=!0}var Sr=new Set,ya={};function Fr(a,o){Ne(a,o),Ne(a+"Capture",o)}function Ne(a,o){for(ya[a]=o,a=0;a<o.length;a++)Sr.add(o[a])}var Ke=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]*$"),vt={},Xt={};function In(a){return Sn.call(Xt,a)?!0:Sn.call(vt,a)?!1:Ke.test(a)?Xt[a]=!0:(vt[a]=!0,!1)}function _i(a,o,h){if(In(o))if(h===null)a.removeAttribute(o);else{switch(typeof h){case"undefined":case"function":case"symbol":a.removeAttribute(o);return;case"boolean":var y=o.toLowerCase().slice(0,5);if(y!=="data-"&&y!=="aria-"){a.removeAttribute(o);return}}a.setAttribute(o,""+h)}}function Xi(a,o,h){if(h===null)a.removeAttribute(o);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(o);return}a.setAttribute(o,""+h)}}function Ai(a,o,h,y){if(y===null)a.removeAttribute(h);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(h);return}a.setAttributeNS(o,h,""+y)}}function pn(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function ur(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function _o(a,o,h){var y=Object.getOwnPropertyDescriptor(a.constructor.prototype,o);if(!a.hasOwnProperty(o)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var E=y.get,M=y.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return E.call(this)},set:function(U){h=""+U,M.call(this,U)}}),Object.defineProperty(a,o,{enumerable:y.enumerable}),{getValue:function(){return h},setValue:function(U){h=""+U},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function xa(a){if(!a._valueTracker){var o=ur(a)?"checked":"value";a._valueTracker=_o(a,o,""+a[o])}}function Rl(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var h=o.getValue(),y="";return a&&(y=ur(a)?a.checked?"true":"false":a.value),a=y,a!==h?(o.setValue(a),!0):!1}function ja(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 fc=/[\n"\\]/g;function Bi(a){return a.replace(fc,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function cs(a,o,h,y,E,M,U,J){a.name="",U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?a.type=U:a.removeAttribute("type"),o!=null?U==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+pn(o)):a.value!==""+pn(o)&&(a.value=""+pn(o)):U!=="submit"&&U!=="reset"||a.removeAttribute("value"),o!=null?Ps(a,U,pn(o)):h!=null?Ps(a,U,pn(h)):y!=null&&a.removeAttribute("value"),E==null&&M!=null&&(a.defaultChecked=!!M),E!=null&&(a.checked=E&&typeof E!="function"&&typeof E!="symbol"),J!=null&&typeof J!="function"&&typeof J!="symbol"&&typeof J!="boolean"?a.name=""+pn(J):a.removeAttribute("name")}function us(a,o,h,y,E,M,U,J){if(M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(a.type=M),o!=null||h!=null){if(!(M!=="submit"&&M!=="reset"||o!=null)){xa(a);return}h=h!=null?""+pn(h):"",o=o!=null?""+pn(o):h,J||o===a.value||(a.value=o),a.defaultValue=o}y=y??E,y=typeof y!="function"&&typeof y!="symbol"&&!!y,a.checked=J?a.checked:!!y,a.defaultChecked=!!y,U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"&&(a.name=U),xa(a)}function Ps(a,o,h){o==="number"&&ja(a.ownerDocument)===a||a.defaultValue===""+h||(a.defaultValue=""+h)}function di(a,o,h,y){if(a=a.options,o){o={};for(var E=0;E<h.length;E++)o["$"+h[E]]=!0;for(h=0;h<a.length;h++)E=o.hasOwnProperty("$"+a[h].value),a[h].selected!==E&&(a[h].selected=E),E&&y&&(a[h].defaultSelected=!0)}else{for(h=""+pn(h),o=null,E=0;E<a.length;E++){if(a[E].value===h){a[E].selected=!0,y&&(a[E].defaultSelected=!0);return}o!==null||a[E].disabled||(o=a[E])}o!==null&&(o.selected=!0)}}function pu(a,o,h){if(o!=null&&(o=""+pn(o),o!==a.value&&(a.value=o),h==null)){a.defaultValue!==o&&(a.defaultValue=o);return}a.defaultValue=h!=null?""+pn(h):""}function Ia(a,o,h,y){if(o==null){if(y!=null){if(h!=null)throw Error(i(92));if(W(y)){if(1<y.length)throw Error(i(93));y=y[0]}h=y}h==null&&(h=""),o=h}h=pn(o),a.defaultValue=h,y=a.textContent,y===h&&y!==""&&y!==null&&(a.value=y),xa(a)}function rt(a,o){if(o){var h=a.firstChild;if(h&&h===a.lastChild&&h.nodeType===3){h.nodeValue=o;return}}a.textContent=o}var So=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 Hn(a,o,h){var y=o.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?y?a.setProperty(o,""):o==="float"?a.cssFloat="":a[o]="":y?a.setProperty(o,h):typeof h!="number"||h===0||So.has(o)?o==="float"?a.cssFloat=h:a[o]=(""+h).trim():a[o]=h+"px"}function ln(a,o,h){if(o!=null&&typeof o!="object")throw Error(i(62));if(a=a.style,h!=null){for(var y in h)!h.hasOwnProperty(y)||o!=null&&o.hasOwnProperty(y)||(y.indexOf("--")===0?a.setProperty(y,""):y==="float"?a.cssFloat="":a[y]="");for(var E in o)y=o[E],o.hasOwnProperty(E)&&h[E]!==y&&Hn(a,E,y)}else for(var M in o)o.hasOwnProperty(M)&&Hn(a,M,o[M])}function ds(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 fs=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"]]),hc=/^[\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 Fs(a){return hc.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Be(){}var Ve=null;function yt(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Nt=null,kn=null;function Gr(a){var o=sn(a);if(o&&(a=o.stateNode)){var h=a[ui]||null;e:switch(a=o.stateNode,o.type){case"input":if(cs(a,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),o=h.name,h.type==="radio"&&o!=null){for(h=a;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+Bi(""+o)+'"][type="radio"]'),o=0;o<h.length;o++){var y=h[o];if(y!==a&&y.form===a.form){var E=y[ui]||null;if(!E)throw Error(i(90));cs(y,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(o=0;o<h.length;o++)y=h[o],y.form===a.form&&Rl(y)}break e;case"textarea":pu(a,h.value,h.defaultValue);break e;case"select":o=h.value,o!=null&&di(a,!!h.multiple,o,!1)}}}var pc=!1;function mu(a,o,h){if(pc)return a(o,h);pc=!0;try{var y=a(o);return y}finally{if(pc=!1,(Nt!==null||kn!==null)&&(te(),Nt&&(o=Nt,a=kn,kn=Nt=null,Gr(o),a)))for(o=0;o<a.length;o++)Gr(a[o])}}function Eo(a,o){var h=a.stateNode;if(h===null)return null;var y=h[ui]||null;if(y===null)return null;h=y[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":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(h&&typeof h!="function")throw Error(i(231,o,typeof h));return h}var hs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kd=!1;if(hs)try{var gu={};Object.defineProperty(gu,"passive",{get:function(){kd=!0}}),window.addEventListener("test",gu,gu),window.removeEventListener("test",gu,gu)}catch{kd=!1}var kl=null,Nd=null,Nl=null;function Od(){if(Nl)return Nl;var a,o=Nd,h=o.length,y,E="value"in kl?kl.value:kl.textContent,M=E.length;for(a=0;a<h&&o[a]===E[a];a++);var U=h-a;for(y=1;y<=U&&o[h-y]===E[M-y];y++);return Nl=E.slice(a,1<y?1-y:void 0)}function wo(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 yu(){return!0}function Ch(){return!1}function Ki(a){function o(h,y,E,M,U){this._reactName=h,this._targetInst=E,this.type=y,this.nativeEvent=M,this.target=U,this.currentTarget=null;for(var J in a)a.hasOwnProperty(J)&&(h=a[J],this[J]=h?h(M):M[J]);return this.isDefaultPrevented=(M.defaultPrevented!=null?M.defaultPrevented:M.returnValue===!1)?yu:Ch,this.isPropagationStopped=Ch,this}return g(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=yu)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=yu)},persist:function(){},isPersistent:yu}),o}var Ol={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xu=Ki(Ol),Ua=g({},Ol,{view:0,detail:0}),Dd=Ki(Ua),zd,bu,mc,vu=g({},Ua,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Su,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!==mc&&(mc&&a.type==="mousemove"?(zd=a.screenX-mc.screenX,bu=a.screenY-mc.screenY):bu=zd=0,mc=a),zd)},movementY:function(a){return"movementY"in a?a.movementY:bu}}),ug=Ki(vu),Li=g({},vu,{dataTransfer:0}),dg=Ki(Li),fg=g({},Ua,{relatedTarget:0}),Bd=Ki(fg),hg=g({},Ol,{animationName:0,elapsedTime:0,pseudoElement:0}),pg=Ki(hg),_u=g({},Ol,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Ah=Ki(_u),mg=g({},Ol,{data:0}),Mh=Ki(mg),gg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Rh={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"},kh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yg(a){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(a):(a=kh[a])?!!o[a]:!1}function Su(){return yg}var Nh=g({},Ua,{key:function(a){if(a.key){var o=gg[a.key]||a.key;if(o!=="Unidentified")return o}return a.type==="keypress"?(a=wo(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Rh[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Su,charCode:function(a){return a.type==="keypress"?wo(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?wo(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),Oh=Ki(Nh),xg=g({},vu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ld=Ki(xg),bg=g({},Ua,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Su}),Gs=Ki(bg),Dh=g({},Ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),Tx=Ki(Dh),vg=g({},vu,{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}),Dl=Ki(vg),qs=g({},Ol,{newState:0,oldState:0}),zh=Ki(qs),Bh=[9,13,27,32],To=hs&&"CompositionEvent"in window,zl=null;hs&&"documentMode"in document&&(zl=document.documentMode);var Co=hs&&"TextEvent"in window&&!zl,ji=hs&&(!To||zl&&8<zl&&11>=zl),Eu=" ",Lh=!1;function jd(a,o){switch(a){case"keyup":return Bh.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gc(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Bl=!1;function Id(a,o){switch(a){case"compositionend":return gc(o);case"keypress":return o.which!==32?null:(Lh=!0,Eu);case"textInput":return a=o.data,a===Eu&&Lh?null:a;default:return null}}function _g(a,o){if(Bl)return a==="compositionend"||!To&&jd(a,o)?(a=Od(),Nl=Nd=kl=null,Bl=!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 ji&&o.locale!=="ko"?null:o.data;default:return null}}var qr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function jh(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o==="input"?!!qr[a.type]:o==="textarea"}function Ud(a,o,h,y){Nt?kn?kn.push(y):kn=[y]:Nt=y,o=fy(o,"onChange"),0<o.length&&(h=new xu("onChange","change",null,h,y),a.push({event:h,listeners:o}))}var yc=null,xc=null;function Ih(a){uS(a,0)}function bc(a){var o=cr(a);if(Rl(o))return a}function Uh(a,o){if(a==="change")return o}var wu=!1;if(hs){var Ao;if(hs){var Nn="oninput"in document;if(!Nn){var Sg=document.createElement("div");Sg.setAttribute("oninput","return;"),Nn=typeof Sg.oninput=="function"}Ao=Nn}else Ao=!1;wu=Ao&&(!document.documentMode||9<document.documentMode)}function Eg(){yc&&(yc.detachEvent("onpropertychange",Hh),xc=yc=null)}function Hh(a){if(a.propertyName==="value"&&bc(xc)){var o=[];Ud(o,xc,a,yt(a)),mu(Ih,o)}}function Tu(a,o,h){a==="focusin"?(Eg(),yc=o,xc=h,yc.attachEvent("onpropertychange",Hh)):a==="focusout"&&Eg()}function Ll(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return bc(xc)}function wg(a,o){if(a==="click")return bc(o)}function Tg(a,o){if(a==="input"||a==="change")return bc(o)}function Mo(a,o){return a===o&&(a!==0||1/a===1/o)||a!==a&&o!==o}var On=typeof Object.is=="function"?Object.is:Mo;function vc(a,o){if(On(a,o))return!0;if(typeof a!="object"||a===null||typeof o!="object"||o===null)return!1;var h=Object.keys(a),y=Object.keys(o);if(h.length!==y.length)return!1;for(y=0;y<h.length;y++){var E=h[y];if(!Sn.call(o,E)||!On(a[E],o[E]))return!1}return!0}function Ph(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Fh(a,o){var h=Ph(a);a=0;for(var y;h;){if(h.nodeType===3){if(y=a+h.textContent.length,a<=o&&y>=o)return{node:h,offset:o-a};a=y}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=Ph(h)}}function Hd(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?Hd(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function Pd(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=ja(a.document);o instanceof a.HTMLIFrameElement;){try{var h=typeof o.contentWindow.location.href=="string"}catch{h=!1}if(h)a=o.contentWindow;else break;o=ja(a.document)}return o}function _c(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 Cg=hs&&"documentMode"in document&&11>=document.documentMode,Sc=null,Fd=null,Ec=null,Yr=!1;function Gd(a,o,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Yr||Sc==null||Sc!==ja(y)||(y=Sc,"selectionStart"in y&&_c(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Ec&&vc(Ec,y)||(Ec=y,y=fy(Fd,"onSelect"),0<y.length&&(o=new xu("onSelect","select",null,o,h),a.push({event:o,listeners:y}),o.target=Sc)))}function jl(a,o){var h={};return h[a.toLowerCase()]=o.toLowerCase(),h["Webkit"+a]="webkit"+o,h["Moz"+a]="moz"+o,h}var wc={animationend:jl("Animation","AnimationEnd"),animationiteration:jl("Animation","AnimationIteration"),animationstart:jl("Animation","AnimationStart"),transitionrun:jl("Transition","TransitionRun"),transitionstart:jl("Transition","TransitionStart"),transitioncancel:jl("Transition","TransitionCancel"),transitionend:jl("Transition","TransitionEnd")},Cu={},dr={};hs&&(dr=document.createElement("div").style,"AnimationEvent"in window||(delete wc.animationend.animation,delete wc.animationiteration.animation,delete wc.animationstart.animation),"TransitionEvent"in window||delete wc.transitionend.transition);function Il(a){if(Cu[a])return Cu[a];if(!wc[a])return a;var o=wc[a],h;for(h in o)if(o.hasOwnProperty(h)&&h in dr)return Cu[a]=o[h];return a}var Er=Il("animationend"),Gh=Il("animationiteration"),ps=Il("animationstart"),Tc=Il("transitionrun"),Ul=Il("transitionstart"),qh=Il("transitioncancel"),qd=Il("transitionend"),Ys=new Map,Yd="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(" ");Yd.push("scrollEnd");function $i(a,o){Ys.set(a,o),Fr(o,[a])}var Hl=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)},Mi=[],Ro=0,Vd=0;function Pl(){for(var a=Ro,o=Vd=Ro=0;o<a;){var h=Mi[o];Mi[o++]=null;var y=Mi[o];Mi[o++]=null;var E=Mi[o];Mi[o++]=null;var M=Mi[o];if(Mi[o++]=null,y!==null&&E!==null){var U=y.pending;U===null?E.next=E:(E.next=U.next,U.next=E),y.pending=E}M!==0&&Xd(h,E,M)}}function Au(a,o,h,y){Mi[Ro++]=a,Mi[Ro++]=o,Mi[Ro++]=h,Mi[Ro++]=y,Vd|=y,a.lanes|=y,a=a.alternate,a!==null&&(a.lanes|=y)}function Cc(a,o,h,y){return Au(a,o,h,y),Ac(a)}function Fl(a,o){return Au(a,null,null,o),Ac(a)}function Xd(a,o,h){a.lanes|=h;var y=a.alternate;y!==null&&(y.lanes|=h);for(var E=!1,M=a.return;M!==null;)M.childLanes|=h,y=M.alternate,y!==null&&(y.childLanes|=h),M.tag===22&&(a=M.stateNode,a===null||a._visibility&1||(E=!0)),a=M,M=M.return;return a.tag===3?(M=a.stateNode,E&&o!==null&&(E=31-Pt(h),a=M.hiddenUpdates,y=a[E],y===null?a[E]=[o]:y.push(o),o.lane=h|536870912),M):null}function Ac(a){if(50<Vo)throw Vo=0,Xo=null,Error(i(185));for(var o=a.return;o!==null;)a=o,o=a.return;return a.tag===3?a.stateNode:null}var Gl={};function Ag(a,o,h,y){this.tag=a,this.key=h,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=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fr(a,o,h,y){return new Ag(a,o,h,y)}function hr(a){return a=a.prototype,!(!a||!a.isReactComponent)}function ms(a,o){var h=a.alternate;return h===null?(h=fr(a.tag,o,a.key,a.mode),h.elementType=a.elementType,h.type=a.type,h.stateNode=a.stateNode,h.alternate=a,a.alternate=h):(h.pendingProps=o,h.type=a.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=a.flags&65011712,h.childLanes=a.childLanes,h.lanes=a.lanes,h.child=a.child,h.memoizedProps=a.memoizedProps,h.memoizedState=a.memoizedState,h.updateQueue=a.updateQueue,o=a.dependencies,h.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},h.sibling=a.sibling,h.index=a.index,h.ref=a.ref,h.refCleanup=a.refCleanup,h}function Wi(a,o){a.flags&=65011714;var h=a.alternate;return h===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=h.childLanes,a.lanes=h.lanes,a.child=h.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=h.memoizedProps,a.memoizedState=h.memoizedState,a.updateQueue=h.updateQueue,a.type=h.type,o=h.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),a}function Mu(a,o,h,y,E,M){var U=0;if(y=a,typeof a=="function")hr(a)&&(U=1);else if(typeof a=="string")U=k3(a,h,ce.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case V:return a=fr(31,h,o,E),a.elementType=V,a.lanes=M,a;case A:return Vs(h.children,E,M,o);case T:U=8,E|=24;break;case C:return a=fr(12,h,o,E|2),a.elementType=C,a.lanes=M,a;case H:return a=fr(13,h,o,E),a.elementType=H,a.lanes=M,a;case D:return a=fr(19,h,o,E),a.elementType=D,a.lanes=M,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case R:U=10;break e;case N:U=9;break e;case O:U=11;break e;case q:U=14;break e;case Z:U=16,y=null;break e}U=29,h=Error(i(130,a===null?"null":typeof a,"")),y=null}return o=fr(U,h,o,E),o.elementType=a,o.type=y,o.lanes=M,o}function Vs(a,o,h,y){return a=fr(7,a,y,o),a.lanes=h,a}function Kd(a,o,h){return a=fr(6,a,null,o),a.lanes=h,a}function Mg(a){var o=fr(18,null,null,0);return o.stateNode=a,o}function Ha(a,o,h){return o=fr(4,a.children!==null?a.children:[],a.key,o),o.lanes=h,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}var Yh=new WeakMap;function wr(a,o){if(typeof a=="object"&&a!==null){var h=Yh.get(a);return h!==void 0?h:(o={value:a,source:o,stack:_n(o)},Yh.set(a,o),o)}return{value:a,source:o,stack:_n(o)}}var Pa=[],ko=0,Ru=null,Mc=0,Vr=[],Tr=0,gs=null,ys=1,xs="";function Xs(a,o){Pa[ko++]=Mc,Pa[ko++]=Ru,Ru=a,Mc=o}function Vh(a,o,h){Vr[Tr++]=ys,Vr[Tr++]=xs,Vr[Tr++]=gs,gs=a;var y=ys;a=xs;var E=32-Pt(y)-1;y&=~(1<<E),h+=1;var M=32-Pt(o)+E;if(30<M){var U=E-E%5;M=(y&(1<<U)-1).toString(32),y>>=U,E-=U,ys=1<<32-Pt(o)+E|h<<E|y,xs=M+a}else ys=1<<M|h<<E|y,xs=a}function $d(a){a.return!==null&&(Xs(a,1),Vh(a,1,0))}function ql(a){for(;a===Ru;)Ru=Pa[--ko],Pa[ko]=null,Mc=Pa[--ko],Pa[ko]=null;for(;a===gs;)gs=Vr[--Tr],Vr[Tr]=null,xs=Vr[--Tr],Vr[Tr]=null,ys=Vr[--Tr],Vr[Tr]=null}function ku(a,o){Vr[Tr++]=ys,Vr[Tr++]=xs,Vr[Tr++]=gs,ys=o.id,xs=o.overflow,gs=a}var Ri=null,En=null,zt=!1,Ks=null,ki=!1,Wd=Error(i(519));function Ot(a){var o=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Nu(wr(o,a)),Wd}function Qd(a){var o=a.stateNode,h=a.type,y=a.memoizedProps;switch(o[bt]=a,o[ui]=y,h){case"dialog":Bt("cancel",o),Bt("close",o);break;case"iframe":case"object":case"embed":Bt("load",o);break;case"video":case"audio":for(h=0;h<Ip.length;h++)Bt(Ip[h],o);break;case"source":Bt("error",o);break;case"img":case"image":case"link":Bt("error",o),Bt("load",o);break;case"details":Bt("toggle",o);break;case"input":Bt("invalid",o),us(o,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0);break;case"select":Bt("invalid",o);break;case"textarea":Bt("invalid",o),Ia(o,y.value,y.defaultValue,y.children)}h=y.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||o.textContent===""+h||y.suppressHydrationWarning===!0||pS(o.textContent,h)?(y.popover!=null&&(Bt("beforetoggle",o),Bt("toggle",o)),y.onScroll!=null&&Bt("scroll",o),y.onScrollEnd!=null&&Bt("scrollend",o),y.onClick!=null&&(o.onclick=Be),o=!0):o=!1,o||Ot(a,!0)}function Rg(a){for(Ri=a.return;Ri;)switch(Ri.tag){case 5:case 31:case 13:ki=!1;return;case 27:case 3:ki=!0;return;default:Ri=Ri.return}}function No(a){if(a!==Ri)return!1;if(!zt)return Rg(a),zt=!0,!1;var o=a.tag,h;if((h=o!==3&&o!==27)&&((h=o===5)&&(h=a.type,h=!(h!=="form"&&h!=="button")||Yx(a.type,a.memoizedProps)),h=!h),h&&En&&Ot(a),Rg(a),o===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));En=ES(a)}else if(o===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));En=ES(a)}else o===27?(o=En,Xc(a.type)?(a=Wx,Wx=null,En=a):En=o):En=Ri?Rs(a.stateNode.nextSibling):null;return!0}function Oo(){En=Ri=null,zt=!1}function Xh(){var a=Ks;return a!==null&&(nr===null?nr=a:nr.push.apply(nr,a),Ks=null),a}function Nu(a){Ks===null?Ks=[a]:Ks.push(a)}var Kh=$(null),$s=null,Qi=null;function Ws(a,o,h){X(Kh,o._currentValue),o._currentValue=h}function ba(a){a._currentValue=Kh.current,ne(Kh)}function Qs(a,o,h){for(;a!==null;){var y=a.alternate;if((a.childLanes&o)!==o?(a.childLanes|=o,y!==null&&(y.childLanes|=o)):y!==null&&(y.childLanes&o)!==o&&(y.childLanes|=o),a===h)break;a=a.return}}function Zd(a,o,h,y){var E=a.child;for(E!==null&&(E.return=a);E!==null;){var M=E.dependencies;if(M!==null){var U=E.child;M=M.firstContext;e:for(;M!==null;){var J=M;M=E;for(var ae=0;ae<o.length;ae++)if(J.context===o[ae]){M.lanes|=h,J=M.alternate,J!==null&&(J.lanes|=h),Qs(M.return,h,a),y||(U=null);break e}M=J.next}}else if(E.tag===18){if(U=E.return,U===null)throw Error(i(341));U.lanes|=h,M=U.alternate,M!==null&&(M.lanes|=h),Qs(U,h,a),U=null}else U=E.child;if(U!==null)U.return=E;else for(U=E;U!==null;){if(U===a){U=null;break}if(E=U.sibling,E!==null){E.return=U.return,U=E;break}U=U.return}E=U}}function Yl(a,o,h,y){a=null;for(var E=o,M=!1;E!==null;){if(!M){if((E.flags&524288)!==0)M=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var U=E.alternate;if(U===null)throw Error(i(387));if(U=U.memoizedProps,U!==null){var J=E.type;On(E.pendingProps.value,U.value)||(a!==null?a.push(J):a=[J])}}else if(E===xe.current){if(U=E.alternate,U===null)throw Error(i(387));U.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(a!==null?a.push(Gp):a=[Gp])}E=E.return}a!==null&&Zd(o,a,h,y),o.flags|=262144}function Rc(a){for(a=a.firstContext;a!==null;){if(!On(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Do(a){$s=a,Qi=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function Ni(a){return $h($s,a)}function Ou(a,o){return $s===null&&Do(a),$h(a,o)}function $h(a,o){var h=o._currentValue;if(o={context:o,memoizedValue:h,next:null},Qi===null){if(a===null)throw Error(i(308));Qi=o,a.dependencies={lanes:0,firstContext:o},a.flags|=524288}else Qi=Qi.next=o;return h}var kg=typeof AbortController<"u"?AbortController:function(){var a=[],o=this.signal={aborted:!1,addEventListener:function(h,y){a.push(y)}};this.abort=function(){o.aborted=!0,a.forEach(function(h){return h()})}},Ng=e.unstable_scheduleCallback,Wh=e.unstable_NormalPriority,Je={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qh(){return{controller:new kg,data:new Map,refCount:0}}function Ii(a){a.refCount--,a.refCount===0&&Ng(Wh,function(){a.controller.abort()})}var zo=null,Zh=0,Zs=0,Fa=null;function kc(a,o){if(zo===null){var h=zo=[];Zh=0,Zs=Lx(),Fa={status:"pending",value:void 0,then:function(y){h.push(y)}}}return Zh++,o.then(Jh,Jh),o}function Jh(){if(--Zh===0&&zo!==null){Fa!==null&&(Fa.status="fulfilled");var a=zo;zo=null,Zs=0,Fa=null;for(var o=0;o<a.length;o++)(0,a[o])()}}function ep(a,o){var h=[],y={status:"pending",value:null,reason:null,then:function(E){h.push(E)}};return a.then(function(){y.status="fulfilled",y.value=o;for(var E=0;E<h.length;E++)(0,h[E])(o)},function(E){for(y.status="rejected",y.reason=E,E=0;E<h.length;E++)(0,h[E])(void 0)}),y}var Og=z.S;z.S=function(a,o){qc=Wt(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&kc(a,o),Og!==null&&Og(a,o)};var Vl=$(null);function bs(){var a=Vl.current;return a!==null?a:cn.pooledCache}function Nc(a,o){o===null?X(Vl,Vl.current):X(Vl,o.pool)}function Jd(){var a=bs();return a===null?null:{parent:Je._currentValue,pool:a}}var Xl=Error(i(460)),Du=Error(i(474)),Ga=Error(i(542)),zu={then:function(){}};function Dg(a){return a=a.status,a==="fulfilled"||a==="rejected"}function tp(a,o,h){switch(h=a[h],h===void 0?a.push(o):h!==o&&(o.then(Be,Be),o=h),o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,np(a),a;default:if(typeof o.status=="string")o.then(Be,Be);else{if(a=cn,a!==null&&100<a.shellSuspendCounter)throw Error(i(482));a=o,a.status="pending",a.then(function(y){if(o.status==="pending"){var E=o;E.status="fulfilled",E.value=y}},function(y){if(o.status==="pending"){var E=o;E.status="rejected",E.reason=y}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,np(a),a}throw at=o,Xl}}function Bo(a){try{var o=a._init;return o(a._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(at=h,Xl):h}}var at=null;function ef(){if(at===null)throw Error(i(459));var a=at;return at=null,a}function np(a){if(a===Xl||a===Ga)throw Error(i(483))}var Kl=null,$l=0;function tf(a){var o=$l;return $l+=1,Kl===null&&(Kl=[]),tp(Kl,a,o)}function Bu(a,o){o=o.props.ref,a.ref=o!==void 0?o:null}function Lu(a,o){throw o.$$typeof===x?Error(i(525)):(a=Object.prototype.toString.call(o),Error(i(31,a==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":a)))}function Oc(a){function o(he,ue){if(a){var ge=he.deletions;ge===null?(he.deletions=[ue],he.flags|=16):ge.push(ue)}}function h(he,ue){if(!a)return null;for(;ue!==null;)o(he,ue),ue=ue.sibling;return null}function y(he){for(var ue=new Map;he!==null;)he.key!==null?ue.set(he.key,he):ue.set(he.index,he),he=he.sibling;return ue}function E(he,ue){return he=ms(he,ue),he.index=0,he.sibling=null,he}function M(he,ue,ge){return he.index=ge,a?(ge=he.alternate,ge!==null?(ge=ge.index,ge<ue?(he.flags|=67108866,ue):ge):(he.flags|=67108866,ue)):(he.flags|=1048576,ue)}function U(he){return a&&he.alternate===null&&(he.flags|=67108866),he}function J(he,ue,ge,Ae){return ue===null||ue.tag!==6?(ue=Kd(ge,he.mode,Ae),ue.return=he,ue):(ue=E(ue,ge),ue.return=he,ue)}function ae(he,ue,ge,Ae){var it=ge.type;return it===A?we(he,ue,ge.props.children,Ae,ge.key):ue!==null&&(ue.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===Z&&Bo(it)===ue.type)?(ue=E(ue,ge.props),Bu(ue,ge),ue.return=he,ue):(ue=Mu(ge.type,ge.key,ge.props,null,he.mode,Ae),Bu(ue,ge),ue.return=he,ue)}function ye(he,ue,ge,Ae){return ue===null||ue.tag!==4||ue.stateNode.containerInfo!==ge.containerInfo||ue.stateNode.implementation!==ge.implementation?(ue=Ha(ge,he.mode,Ae),ue.return=he,ue):(ue=E(ue,ge.children||[]),ue.return=he,ue)}function we(he,ue,ge,Ae,it){return ue===null||ue.tag!==7?(ue=Vs(ge,he.mode,Ae,it),ue.return=he,ue):(ue=E(ue,ge),ue.return=he,ue)}function Me(he,ue,ge){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return ue=Kd(""+ue,he.mode,ge),ue.return=he,ue;if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:return ge=Mu(ue.type,ue.key,ue.props,null,he.mode,ge),Bu(ge,ue),ge.return=he,ge;case S:return ue=Ha(ue,he.mode,ge),ue.return=he,ue;case Z:return ue=Bo(ue),Me(he,ue,ge)}if(W(ue)||j(ue))return ue=Vs(ue,he.mode,ge,null),ue.return=he,ue;if(typeof ue.then=="function")return Me(he,tf(ue),ge);if(ue.$$typeof===R)return Me(he,Ou(he,ue),ge);Lu(he,ue)}return null}function ve(he,ue,ge,Ae){var it=ue!==null?ue.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return it!==null?null:J(he,ue,""+ge,Ae);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case v:return ge.key===it?ae(he,ue,ge,Ae):null;case S:return ge.key===it?ye(he,ue,ge,Ae):null;case Z:return ge=Bo(ge),ve(he,ue,ge,Ae)}if(W(ge)||j(ge))return it!==null?null:we(he,ue,ge,Ae,null);if(typeof ge.then=="function")return ve(he,ue,tf(ge),Ae);if(ge.$$typeof===R)return ve(he,ue,Ou(he,ge),Ae);Lu(he,ge)}return null}function Se(he,ue,ge,Ae,it){if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number"||typeof Ae=="bigint")return he=he.get(ge)||null,J(ue,he,""+Ae,it);if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case v:return he=he.get(Ae.key===null?ge:Ae.key)||null,ae(ue,he,Ae,it);case S:return he=he.get(Ae.key===null?ge:Ae.key)||null,ye(ue,he,Ae,it);case Z:return Ae=Bo(Ae),Se(he,ue,ge,Ae,it)}if(W(Ae)||j(Ae))return he=he.get(ge)||null,we(ue,he,Ae,it,null);if(typeof Ae.then=="function")return Se(he,ue,ge,tf(Ae),it);if(Ae.$$typeof===R)return Se(he,ue,ge,Ou(ue,Ae),it);Lu(ue,Ae)}return null}function Xe(he,ue,ge,Ae){for(var it=null,dn=null,$e=ue,Ct=ue=0,Ut=null;$e!==null&&Ct<ge.length;Ct++){$e.index>Ct?(Ut=$e,$e=null):Ut=$e.sibling;var fn=ve(he,$e,ge[Ct],Ae);if(fn===null){$e===null&&($e=Ut);break}a&&$e&&fn.alternate===null&&o(he,$e),ue=M(fn,ue,Ct),dn===null?it=fn:dn.sibling=fn,dn=fn,$e=Ut}if(Ct===ge.length)return h(he,$e),zt&&Xs(he,Ct),it;if($e===null){for(;Ct<ge.length;Ct++)$e=Me(he,ge[Ct],Ae),$e!==null&&(ue=M($e,ue,Ct),dn===null?it=$e:dn.sibling=$e,dn=$e);return zt&&Xs(he,Ct),it}for($e=y($e);Ct<ge.length;Ct++)Ut=Se($e,he,Ct,ge[Ct],Ae),Ut!==null&&(a&&Ut.alternate!==null&&$e.delete(Ut.key===null?Ct:Ut.key),ue=M(Ut,ue,Ct),dn===null?it=Ut:dn.sibling=Ut,dn=Ut);return a&&$e.forEach(function(Zc){return o(he,Zc)}),zt&&Xs(he,Ct),it}function ut(he,ue,ge,Ae){if(ge==null)throw Error(i(151));for(var it=null,dn=null,$e=ue,Ct=ue=0,Ut=null,fn=ge.next();$e!==null&&!fn.done;Ct++,fn=ge.next()){$e.index>Ct?(Ut=$e,$e=null):Ut=$e.sibling;var Zc=ve(he,$e,fn.value,Ae);if(Zc===null){$e===null&&($e=Ut);break}a&&$e&&Zc.alternate===null&&o(he,$e),ue=M(Zc,ue,Ct),dn===null?it=Zc:dn.sibling=Zc,dn=Zc,$e=Ut}if(fn.done)return h(he,$e),zt&&Xs(he,Ct),it;if($e===null){for(;!fn.done;Ct++,fn=ge.next())fn=Me(he,fn.value,Ae),fn!==null&&(ue=M(fn,ue,Ct),dn===null?it=fn:dn.sibling=fn,dn=fn);return zt&&Xs(he,Ct),it}for($e=y($e);!fn.done;Ct++,fn=ge.next())fn=Se($e,he,Ct,fn.value,Ae),fn!==null&&(a&&fn.alternate!==null&&$e.delete(fn.key===null?Ct:fn.key),ue=M(fn,ue,Ct),dn===null?it=fn:dn.sibling=fn,dn=fn);return a&&$e.forEach(function(P3){return o(he,P3)}),zt&&Xs(he,Ct),it}function Cn(he,ue,ge,Ae){if(typeof ge=="object"&&ge!==null&&ge.type===A&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case v:e:{for(var it=ge.key;ue!==null;){if(ue.key===it){if(it=ge.type,it===A){if(ue.tag===7){h(he,ue.sibling),Ae=E(ue,ge.props.children),Ae.return=he,he=Ae;break e}}else if(ue.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===Z&&Bo(it)===ue.type){h(he,ue.sibling),Ae=E(ue,ge.props),Bu(Ae,ge),Ae.return=he,he=Ae;break e}h(he,ue);break}else o(he,ue);ue=ue.sibling}ge.type===A?(Ae=Vs(ge.props.children,he.mode,Ae,ge.key),Ae.return=he,he=Ae):(Ae=Mu(ge.type,ge.key,ge.props,null,he.mode,Ae),Bu(Ae,ge),Ae.return=he,he=Ae)}return U(he);case S:e:{for(it=ge.key;ue!==null;){if(ue.key===it)if(ue.tag===4&&ue.stateNode.containerInfo===ge.containerInfo&&ue.stateNode.implementation===ge.implementation){h(he,ue.sibling),Ae=E(ue,ge.children||[]),Ae.return=he,he=Ae;break e}else{h(he,ue);break}else o(he,ue);ue=ue.sibling}Ae=Ha(ge,he.mode,Ae),Ae.return=he,he=Ae}return U(he);case Z:return ge=Bo(ge),Cn(he,ue,ge,Ae)}if(W(ge))return Xe(he,ue,ge,Ae);if(j(ge)){if(it=j(ge),typeof it!="function")throw Error(i(150));return ge=it.call(ge),ut(he,ue,ge,Ae)}if(typeof ge.then=="function")return Cn(he,ue,tf(ge),Ae);if(ge.$$typeof===R)return Cn(he,ue,Ou(he,ge),Ae);Lu(he,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint"?(ge=""+ge,ue!==null&&ue.tag===6?(h(he,ue.sibling),Ae=E(ue,ge),Ae.return=he,he=Ae):(h(he,ue),Ae=Kd(ge,he.mode,Ae),Ae.return=he,he=Ae),U(he)):h(he,ue)}return function(he,ue,ge,Ae){try{$l=0;var it=Cn(he,ue,ge,Ae);return Kl=null,it}catch($e){if($e===Xl||$e===Ga)throw $e;var dn=fr(29,$e,null,he.mode);return dn.lanes=Ae,dn.return=he,dn}finally{}}}var Lo=Oc(!0),zg=Oc(!1),Wl=!1;function ip(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rp(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 vs(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Js(a,o,h){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(jt&2)!==0){var E=y.pending;return E===null?o.next=o:(o.next=E.next,E.next=o),y.pending=o,o=Ac(a),Xd(a,null,h),o}return Au(a,y,o,h),Ac(a)}function Ql(a,o,h){if(o=o.updateQueue,o!==null&&(o=o.shared,(h&4194048)!==0)){var y=o.lanes;y&=a.pendingLanes,h|=y,o.lanes=h,nt(a,h)}}function nf(a,o){var h=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,h===y)){var E=null,M=null;if(h=h.firstBaseUpdate,h!==null){do{var U={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};M===null?E=M=U:M=M.next=U,h=h.next}while(h!==null);M===null?E=M=o:M=M.next=o}else E=M=o;h={baseState:y.baseState,firstBaseUpdate:E,lastBaseUpdate:M,shared:y.shared,callbacks:y.callbacks},a.updateQueue=h;return}a=h.lastBaseUpdate,a===null?h.firstBaseUpdate=o:a.next=o,h.lastBaseUpdate=o}var ap=!1;function ju(){if(ap){var a=Fa;if(a!==null)throw a}}function jo(a,o,h,y){ap=!1;var E=a.updateQueue;Wl=!1;var M=E.firstBaseUpdate,U=E.lastBaseUpdate,J=E.shared.pending;if(J!==null){E.shared.pending=null;var ae=J,ye=ae.next;ae.next=null,U===null?M=ye:U.next=ye,U=ae;var we=a.alternate;we!==null&&(we=we.updateQueue,J=we.lastBaseUpdate,J!==U&&(J===null?we.firstBaseUpdate=ye:J.next=ye,we.lastBaseUpdate=ae))}if(M!==null){var Me=E.baseState;U=0,we=ye=ae=null,J=M;do{var ve=J.lane&-536870913,Se=ve!==J.lane;if(Se?(Dt&ve)===ve:(y&ve)===ve){ve!==0&&ve===Zs&&(ap=!0),we!==null&&(we=we.next={lane:0,tag:J.tag,payload:J.payload,callback:null,next:null});e:{var Xe=a,ut=J;ve=o;var Cn=h;switch(ut.tag){case 1:if(Xe=ut.payload,typeof Xe=="function"){Me=Xe.call(Cn,Me,ve);break e}Me=Xe;break e;case 3:Xe.flags=Xe.flags&-65537|128;case 0:if(Xe=ut.payload,ve=typeof Xe=="function"?Xe.call(Cn,Me,ve):Xe,ve==null)break e;Me=g({},Me,ve);break e;case 2:Wl=!0}}ve=J.callback,ve!==null&&(a.flags|=64,Se&&(a.flags|=8192),Se=E.callbacks,Se===null?E.callbacks=[ve]:Se.push(ve))}else Se={lane:ve,tag:J.tag,payload:J.payload,callback:J.callback,next:null},we===null?(ye=we=Se,ae=Me):we=we.next=Se,U|=ve;if(J=J.next,J===null){if(J=E.shared.pending,J===null)break;Se=J,J=Se.next,Se.next=null,E.lastBaseUpdate=Se,E.shared.pending=null}}while(!0);we===null&&(ae=Me),E.baseState=ae,E.firstBaseUpdate=ye,E.lastBaseUpdate=we,M===null&&(E.shared.lanes=0),ia|=U,a.lanes=U,a.memoizedState=Me}}function _s(a,o){if(typeof a!="function")throw Error(i(191,a));a.call(o)}function Ui(a,o){var h=a.callbacks;if(h!==null)for(a.callbacks=null,a=0;a<h.length;a++)_s(h[a],o)}var Xr=$(null),pr=$(0);function sp(a,o){a=ri,X(pr,a),X(Xr,o),ri=a|o.baseLanes}function lp(){X(pr,ri),X(Xr,Xr.current)}function Zi(){ri=pr.current,ne(Xr),ne(pr)}var Si=$(null),va=null;function Zl(a){var o=a.alternate;X(qn,qn.current&1),X(Si,a),va===null&&(o===null||Xr.current!==null||o.memoizedState!==null)&&(va=a)}function op(a){X(qn,qn.current),X(Si,a),va===null&&(va=a)}function Bg(a){a.tag===22?(X(qn,qn.current),X(Si,a),va===null&&(va=a)):el()}function el(){X(qn,qn.current),X(Si,Si.current)}function Kr(a){ne(Si),va===a&&(va=null),ne(qn)}var qn=$(0);function rf(a){for(var o=a;o!==null;){if(o.tag===13){var h=o.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Kx(h)||$x(h)))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 Cr=0,dt=null,yn=null,fi=null,af=!1,Ss=!1,Io=!1,sf=0,Iu=0,Es=null,Cx=0;function Yn(){throw Error(i(321))}function cp(a,o){if(o===null)return!1;for(var h=0;h<o.length&&h<a.length;h++)if(!On(a[h],o[h]))return!1;return!0}function up(a,o,h,y,E,M){return Cr=M,dt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,z.H=a===null||a.memoizedState===null?ty:Bc,Io=!1,M=h(y,E),Io=!1,Ss&&(M=jg(o,h,y,E)),Lg(a),M}function Lg(a){z.H=Gu;var o=yn!==null&&yn.next!==null;if(Cr=0,fi=yn=dt=null,af=!1,Iu=0,Es=null,o)throw Error(i(300));a===null||Dn||(a=a.dependencies,a!==null&&Rc(a)&&(Dn=!0))}function jg(a,o,h,y){dt=a;var E=0;do{if(Ss&&(Es=null),Iu=0,Ss=!1,25<=E)throw Error(i(301));if(E+=1,fi=yn=null,a.updateQueue!=null){var M=a.updateQueue;M.lastEffect=null,M.events=null,M.stores=null,M.memoCache!=null&&(M.memoCache.index=0)}z.H=qu,M=o(h,y)}while(Ss);return M}function Ax(){var a=z.H,o=a.useState()[0];return o=typeof o.then=="function"?Hu(o):o,a=a.useState()[0],(yn!==null?yn.memoizedState:null)!==a&&(dt.flags|=1024),o}function dp(){var a=sf!==0;return sf=0,a}function fp(a,o,h){o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~h}function hp(a){if(af){for(a=a.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}af=!1}Cr=0,fi=yn=dt=null,Ss=!1,Iu=sf=0,Es=null}function mr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fi===null?dt.memoizedState=fi=a:fi=fi.next=a,fi}function ei(){if(yn===null){var a=dt.alternate;a=a!==null?a.memoizedState:null}else a=yn.next;var o=fi===null?dt.memoizedState:fi.next;if(o!==null)fi=o,yn=a;else{if(a===null)throw dt.alternate===null?Error(i(467)):Error(i(310));yn=a,a={memoizedState:yn.memoizedState,baseState:yn.baseState,baseQueue:yn.baseQueue,queue:yn.queue,next:null},fi===null?dt.memoizedState=fi=a:fi=fi.next=a}return fi}function Uu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hu(a){var o=Iu;return Iu+=1,Es===null&&(Es=[]),a=tp(Es,a,o),o=dt,(fi===null?o.memoizedState:fi.next)===null&&(o=o.alternate,z.H=o===null||o.memoizedState===null?ty:Bc),a}function lf(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Hu(a);if(a.$$typeof===R)return Ni(a)}throw Error(i(438,String(a)))}function pp(a){var o=null,h=dt.updateQueue;if(h!==null&&(o=h.memoCache),o==null){var y=dt.alternate;y!==null&&(y=y.updateQueue,y!==null&&(y=y.memoCache,y!=null&&(o={data:y.data.map(function(E){return E.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),h===null&&(h=Uu(),dt.updateQueue=h),h.memoCache=o,h=o.data[o.index],h===void 0)for(h=o.data[o.index]=Array(a),y=0;y<a;y++)h[y]=Y;return o.index++,h}function tl(a,o){return typeof o=="function"?o(a):o}function of(a){var o=ei();return mp(o,yn,a)}function mp(a,o,h){var y=a.queue;if(y===null)throw Error(i(311));y.lastRenderedReducer=h;var E=a.baseQueue,M=y.pending;if(M!==null){if(E!==null){var U=E.next;E.next=M.next,M.next=U}o.baseQueue=E=M,y.pending=null}if(M=a.baseState,E===null)a.memoizedState=M;else{o=E.next;var J=U=null,ae=null,ye=o,we=!1;do{var Me=ye.lane&-536870913;if(Me!==ye.lane?(Dt&Me)===Me:(Cr&Me)===Me){var ve=ye.revertLane;if(ve===0)ae!==null&&(ae=ae.next={lane:0,revertLane:0,gesture:null,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null}),Me===Zs&&(we=!0);else if((Cr&ve)===ve){ye=ye.next,ve===Zs&&(we=!0);continue}else Me={lane:0,revertLane:ye.revertLane,gesture:null,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null},ae===null?(J=ae=Me,U=M):ae=ae.next=Me,dt.lanes|=ve,ia|=ve;Me=ye.action,Io&&h(M,Me),M=ye.hasEagerState?ye.eagerState:h(M,Me)}else ve={lane:Me,revertLane:ye.revertLane,gesture:ye.gesture,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null},ae===null?(J=ae=ve,U=M):ae=ae.next=ve,dt.lanes|=Me,ia|=Me;ye=ye.next}while(ye!==null&&ye!==o);if(ae===null?U=M:ae.next=J,!On(M,a.memoizedState)&&(Dn=!0,we&&(h=Fa,h!==null)))throw h;a.memoizedState=M,a.baseState=U,a.baseQueue=ae,y.lastRenderedState=M}return E===null&&(y.lanes=0),[a.memoizedState,y.dispatch]}function cf(a){var o=ei(),h=o.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=a;var y=h.dispatch,E=h.pending,M=o.memoizedState;if(E!==null){h.pending=null;var U=E=E.next;do M=a(M,U.action),U=U.next;while(U!==E);On(M,o.memoizedState)||(Dn=!0),o.memoizedState=M,o.baseQueue===null&&(o.baseState=M),h.lastRenderedState=M}return[M,y]}function gp(a,o,h){var y=dt,E=ei(),M=zt;if(M){if(h===void 0)throw Error(i(407));h=h()}else h=o();var U=!On((yn||E).memoizedState,h);if(U&&(E.memoizedState=h,Dn=!0),E=E.queue,_p(xp.bind(null,y,E,a),[a]),E.getSnapshot!==o||U||fi!==null&&fi.memoizedState.tag&1){if(y.flags|=2048,Dc(9,{destroy:void 0},yp.bind(null,y,E,h,o),null),cn===null)throw Error(i(349));M||(Cr&127)!==0||Ig(y,o,h)}return h}function Ig(a,o,h){a.flags|=16384,a={getSnapshot:o,value:h},o=dt.updateQueue,o===null?(o=Uu(),dt.updateQueue=o,o.stores=[a]):(h=o.stores,h===null?o.stores=[a]:h.push(a))}function yp(a,o,h,y){o.value=h,o.getSnapshot=y,bp(o)&&uf(a)}function xp(a,o,h){return h(function(){bp(o)&&uf(a)})}function bp(a){var o=a.getSnapshot;a=a.value;try{var h=o();return!On(a,h)}catch{return!0}}function uf(a){var o=Fl(a,2);o!==null&&d(o,a,2)}function Pu(a){var o=mr();if(typeof a=="function"){var h=a;if(a=h(),Io){Gn(!0);try{h()}finally{Gn(!1)}}}return o.memoizedState=o.baseState=a,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:tl,lastRenderedState:a},o}function Ug(a,o,h,y){return a.baseState=h,mp(a,yn,typeof y=="function"?y:tl)}function Mx(a,o,h,y,E){if(nl(a))throw Error(i(485));if(a=o.action,a!==null){var M={payload:E,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(U){M.listeners.push(U)}};z.T!==null?h(!0):M.isTransition=!1,y(M),h=o.pending,h===null?(M.next=o.pending=M,Hg(o,M)):(M.next=h.next,o.pending=h.next=M)}}function Hg(a,o){var h=o.action,y=o.payload,E=a.state;if(o.isTransition){var M=z.T,U={};z.T=U;try{var J=h(E,y),ae=z.S;ae!==null&&ae(U,J),Pg(a,o,J)}catch(ye){df(a,o,ye)}finally{M!==null&&U.types!==null&&(M.types=U.types),z.T=M}}else try{M=h(E,y),Pg(a,o,M)}catch(ye){df(a,o,ye)}}function Pg(a,o,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(y){vp(a,o,y)},function(y){return df(a,o,y)}):vp(a,o,h)}function vp(a,o,h){o.status="fulfilled",o.value=h,Fg(o),a.state=h,o=a.pending,o!==null&&(h=o.next,h===o?a.pending=null:(h=h.next,o.next=h,Hg(a,h)))}function df(a,o,h){var y=a.pending;if(a.pending=null,y!==null){y=y.next;do o.status="rejected",o.reason=h,Fg(o),o=o.next;while(o!==y)}a.action=null}function Fg(a){a=a.listeners;for(var o=0;o<a.length;o++)(0,a[o])()}function Gg(a,o){return o}function qg(a,o){if(zt){var h=cn.formState;if(h!==null){e:{var y=dt;if(zt){if(En){t:{for(var E=En,M=ki;E.nodeType!==8;){if(!M){E=null;break t}if(E=Rs(E.nextSibling),E===null){E=null;break t}}M=E.data,E=M==="F!"||M==="F"?E:null}if(E){En=Rs(E.nextSibling),y=E.data==="F!";break e}}Ot(y)}y=!1}y&&(o=h[0])}}return h=mr(),h.memoizedState=h.baseState=o,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gg,lastRenderedState:o},h.queue=y,h=ey.bind(null,dt,y),y.dispatch=h,y=Pu(!1),M=Fu.bind(null,dt,!1,y.queue),y=mr(),E={state:o,dispatch:null,action:a,pending:null},y.queue=E,h=Mx.bind(null,dt,E,M,h),E.dispatch=h,y.memoizedState=a,[o,h,!1]}function Yg(a){var o=ei();return Vg(o,yn,a)}function Vg(a,o,h){if(o=mp(a,o,Gg)[0],a=of(tl)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var y=Hu(o)}catch(U){throw U===Xl?Ga:U}else y=o;o=ei();var E=o.queue,M=E.dispatch;return h!==o.memoizedState&&(dt.flags|=2048,Dc(9,{destroy:void 0},Rx.bind(null,E,h),null)),[y,M,a]}function Rx(a,o){a.action=o}function Xg(a){var o=ei(),h=yn;if(h!==null)return Vg(o,h,a);ei(),o=o.memoizedState,h=ei();var y=h.queue.dispatch;return h.memoizedState=a,[o,y,!1]}function Dc(a,o,h,y){return a={tag:a,create:h,deps:y,inst:o,next:null},o=dt.updateQueue,o===null&&(o=Uu(),dt.updateQueue=o),h=o.lastEffect,h===null?o.lastEffect=a.next=a:(y=h.next,h.next=a,a.next=y,o.lastEffect=a),a}function Kg(){return ei().memoizedState}function ff(a,o,h,y){var E=mr();dt.flags|=a,E.memoizedState=Dc(1|o,{destroy:void 0},h,y===void 0?null:y)}function hf(a,o,h,y){var E=ei();y=y===void 0?null:y;var M=E.memoizedState.inst;yn!==null&&y!==null&&cp(y,yn.memoizedState.deps)?E.memoizedState=Dc(o,M,h,y):(dt.flags|=a,E.memoizedState=Dc(1|o,M,h,y))}function $g(a,o){ff(8390656,8,a,o)}function _p(a,o){hf(2048,8,a,o)}function Wg(a){dt.flags|=4;var o=dt.updateQueue;if(o===null)o=Uu(),dt.updateQueue=o,o.events=[a];else{var h=o.events;h===null?o.events=[a]:h.push(a)}}function Qg(a){var o=ei().memoizedState;return Wg({ref:o,nextImpl:a}),function(){if((jt&2)!==0)throw Error(i(440));return o.impl.apply(void 0,arguments)}}function Zg(a,o){return hf(4,2,a,o)}function $r(a,o){return hf(4,4,a,o)}function Sp(a,o){if(typeof o=="function"){a=a();var h=o(a);return function(){typeof h=="function"?h():o(null)}}if(o!=null)return a=a(),o.current=a,function(){o.current=null}}function pf(a,o,h){h=h!=null?h.concat([a]):null,hf(4,4,Sp.bind(null,o,a),h)}function mf(){}function Ep(a,o){var h=ei();o=o===void 0?null:o;var y=h.memoizedState;return o!==null&&cp(o,y[1])?y[0]:(h.memoizedState=[a,o],a)}function wp(a,o){var h=ei();o=o===void 0?null:o;var y=h.memoizedState;if(o!==null&&cp(o,y[1]))return y[0];if(y=a(),Io){Gn(!0);try{a()}finally{Gn(!1)}}return h.memoizedState=[y,o],y}function Tp(a,o,h){return h===void 0||(Cr&1073741824)!==0&&(Dt&261930)===0?a.memoizedState=o:(a.memoizedState=h,a=u(),dt.lanes|=a,ia|=a,h)}function Cp(a,o,h,y){return On(h,o)?h:Xr.current!==null?(a=Tp(a,h,y),On(a,o)||(Dn=!0),a):(Cr&42)===0||(Cr&1073741824)!==0&&(Dt&261930)===0?(Dn=!0,a.memoizedState=h):(a=u(),dt.lanes|=a,ia|=a,o)}function Ap(a,o,h,y,E){var M=K.p;K.p=M!==0&&8>M?M:8;var U=z.T,J={};z.T=J,Fu(a,!1,o,h);try{var ae=E(),ye=z.S;if(ye!==null&&ye(J,ae),ae!==null&&typeof ae=="object"&&typeof ae.then=="function"){var we=ep(ae,y);zc(a,o,we,yr(a))}else zc(a,o,y,yr(a))}catch(Me){zc(a,o,{then:function(){},status:"rejected",reason:Me},yr())}finally{K.p=M,U!==null&&J.types!==null&&(U.types=J.types),z.T=U}}function kx(){}function Mp(a,o,h,y){if(a.tag!==5)throw Error(i(476));var E=Jg(a).queue;Ap(a,E,o,G,h===null?kx:function(){return Rp(a),h(y)})}function Jg(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tl,lastRenderedState:G},next:null};var h={};return o.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tl,lastRenderedState:h},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function Rp(a){var o=Jg(a);o.next===null&&(o=a.alternate.memoizedState),zc(a,o.next.queue,{},yr())}function kp(){return Ni(Gp)}function Hi(){return ei().memoizedState}function Np(){return ei().memoizedState}function Nx(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var h=yr();a=vs(h);var y=Js(o,a,h);y!==null&&(d(y,o,h),Ql(y,o,h)),o={cache:Qh()},a.payload=o;return}o=o.return}}function Ox(a,o,h){var y=yr();h={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},nl(a)?Uo(o,h):(h=Cc(a,o,h,y),h!==null&&(d(h,a,y),Ar(h,o,y)))}function ey(a,o,h){var y=yr();zc(a,o,h,y)}function zc(a,o,h,y){var E={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(nl(a))Uo(o,E);else{var M=a.alternate;if(a.lanes===0&&(M===null||M.lanes===0)&&(M=o.lastRenderedReducer,M!==null))try{var U=o.lastRenderedState,J=M(U,h);if(E.hasEagerState=!0,E.eagerState=J,On(J,U))return Au(a,o,E,0),cn===null&&Pl(),!1}catch{}finally{}if(h=Cc(a,o,E,y),h!==null)return d(h,a,y),Ar(h,o,y),!0}return!1}function Fu(a,o,h,y){if(y={lane:2,revertLane:Lx(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},nl(a)){if(o)throw Error(i(479))}else o=Cc(a,h,y,2),o!==null&&d(o,a,2)}function nl(a){var o=a.alternate;return a===dt||o!==null&&o===dt}function Uo(a,o){Ss=af=!0;var h=a.pending;h===null?o.next=o:(o.next=h.next,h.next=o),a.pending=o}function Ar(a,o,h){if((h&4194048)!==0){var y=o.lanes;y&=a.pendingLanes,h|=y,o.lanes=h,nt(a,h)}}var Gu={readContext:Ni,use:lf,useCallback:Yn,useContext:Yn,useEffect:Yn,useImperativeHandle:Yn,useLayoutEffect:Yn,useInsertionEffect:Yn,useMemo:Yn,useReducer:Yn,useRef:Yn,useState:Yn,useDebugValue:Yn,useDeferredValue:Yn,useTransition:Yn,useSyncExternalStore:Yn,useId:Yn,useHostTransitionStatus:Yn,useFormState:Yn,useActionState:Yn,useOptimistic:Yn,useMemoCache:Yn,useCacheRefresh:Yn};Gu.useEffectEvent=Yn;var ty={readContext:Ni,use:lf,useCallback:function(a,o){return mr().memoizedState=[a,o===void 0?null:o],a},useContext:Ni,useEffect:$g,useImperativeHandle:function(a,o,h){h=h!=null?h.concat([a]):null,ff(4194308,4,Sp.bind(null,o,a),h)},useLayoutEffect:function(a,o){return ff(4194308,4,a,o)},useInsertionEffect:function(a,o){ff(4,2,a,o)},useMemo:function(a,o){var h=mr();o=o===void 0?null:o;var y=a();if(Io){Gn(!0);try{a()}finally{Gn(!1)}}return h.memoizedState=[y,o],y},useReducer:function(a,o,h){var y=mr();if(h!==void 0){var E=h(o);if(Io){Gn(!0);try{h(o)}finally{Gn(!1)}}}else E=o;return y.memoizedState=y.baseState=E,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:E},y.queue=a,a=a.dispatch=Ox.bind(null,dt,a),[y.memoizedState,a]},useRef:function(a){var o=mr();return a={current:a},o.memoizedState=a},useState:function(a){a=Pu(a);var o=a.queue,h=ey.bind(null,dt,o);return o.dispatch=h,[a.memoizedState,h]},useDebugValue:mf,useDeferredValue:function(a,o){var h=mr();return Tp(h,a,o)},useTransition:function(){var a=Pu(!1);return a=Ap.bind(null,dt,a.queue,!0,!1),mr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,h){var y=dt,E=mr();if(zt){if(h===void 0)throw Error(i(407));h=h()}else{if(h=o(),cn===null)throw Error(i(349));(Dt&127)!==0||Ig(y,o,h)}E.memoizedState=h;var M={value:h,getSnapshot:o};return E.queue=M,$g(xp.bind(null,y,M,a),[a]),y.flags|=2048,Dc(9,{destroy:void 0},yp.bind(null,y,M,h,o),null),h},useId:function(){var a=mr(),o=cn.identifierPrefix;if(zt){var h=xs,y=ys;h=(y&~(1<<32-Pt(y)-1)).toString(32)+h,o="_"+o+"R_"+h,h=sf++,0<h&&(o+="H"+h.toString(32)),o+="_"}else h=Cx++,o="_"+o+"r_"+h.toString(32)+"_";return a.memoizedState=o},useHostTransitionStatus:kp,useFormState:qg,useActionState:qg,useOptimistic:function(a){var o=mr();o.memoizedState=o.baseState=a;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=h,o=Fu.bind(null,dt,!0,h),h.dispatch=o,[a,o]},useMemoCache:pp,useCacheRefresh:function(){return mr().memoizedState=Nx.bind(null,dt)},useEffectEvent:function(a){var o=mr(),h={impl:a};return o.memoizedState=h,function(){if((jt&2)!==0)throw Error(i(440));return h.impl.apply(void 0,arguments)}}},Bc={readContext:Ni,use:lf,useCallback:Ep,useContext:Ni,useEffect:_p,useImperativeHandle:pf,useInsertionEffect:Zg,useLayoutEffect:$r,useMemo:wp,useReducer:of,useRef:Kg,useState:function(){return of(tl)},useDebugValue:mf,useDeferredValue:function(a,o){var h=ei();return Cp(h,yn.memoizedState,a,o)},useTransition:function(){var a=of(tl)[0],o=ei().memoizedState;return[typeof a=="boolean"?a:Hu(a),o]},useSyncExternalStore:gp,useId:Hi,useHostTransitionStatus:kp,useFormState:Yg,useActionState:Yg,useOptimistic:function(a,o){var h=ei();return Ug(h,yn,a,o)},useMemoCache:pp,useCacheRefresh:Np};Bc.useEffectEvent=Qg;var qu={readContext:Ni,use:lf,useCallback:Ep,useContext:Ni,useEffect:_p,useImperativeHandle:pf,useInsertionEffect:Zg,useLayoutEffect:$r,useMemo:wp,useReducer:cf,useRef:Kg,useState:function(){return cf(tl)},useDebugValue:mf,useDeferredValue:function(a,o){var h=ei();return yn===null?Tp(h,a,o):Cp(h,yn.memoizedState,a,o)},useTransition:function(){var a=cf(tl)[0],o=ei().memoizedState;return[typeof a=="boolean"?a:Hu(a),o]},useSyncExternalStore:gp,useId:Hi,useHostTransitionStatus:kp,useFormState:Xg,useActionState:Xg,useOptimistic:function(a,o){var h=ei();return yn!==null?Ug(h,yn,a,o):(h.baseState=a,[a,h.queue.dispatch])},useMemoCache:pp,useCacheRefresh:Np};qu.useEffectEvent=Qg;function Lc(a,o,h,y){o=a.memoizedState,h=h(y,o),h=h==null?o:g({},o,h),a.memoizedState=h,a.lanes===0&&(a.updateQueue.baseState=h)}var Yu={enqueueSetState:function(a,o,h){a=a._reactInternals;var y=yr(),E=vs(y);E.payload=o,h!=null&&(E.callback=h),o=Js(a,E,y),o!==null&&(d(o,a,y),Ql(o,a,y))},enqueueReplaceState:function(a,o,h){a=a._reactInternals;var y=yr(),E=vs(y);E.tag=1,E.payload=o,h!=null&&(E.callback=h),o=Js(a,E,y),o!==null&&(d(o,a,y),Ql(o,a,y))},enqueueForceUpdate:function(a,o){a=a._reactInternals;var h=yr(),y=vs(h);y.tag=2,o!=null&&(y.callback=o),o=Js(a,y,h),o!==null&&(d(o,a,h),Ql(o,a,h))}};function ny(a,o,h,y,E,M,U){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,M,U):o.prototype&&o.prototype.isPureReactComponent?!vc(h,y)||!vc(E,M):!0}function iy(a,o,h,y){a=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(h,y),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(h,y),o.state!==a&&Yu.enqueueReplaceState(o,o.state,null)}function Pi(a,o){var h=o;if("ref"in o){h={};for(var y in o)y!=="ref"&&(h[y]=o[y])}if(a=a.defaultProps){h===o&&(h=g({},h));for(var E in a)h[E]===void 0&&(h[E]=a[E])}return h}function Op(a){Hl(a)}function ry(a){console.error(a)}function gf(a){Hl(a)}function yf(a,o){try{var h=a.onUncaughtError;h(o.value,{componentStack:o.stack})}catch(y){setTimeout(function(){throw y})}}function ay(a,o,h){try{var y=a.onCaughtError;y(h.value,{componentStack:h.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function Dp(a,o,h){return h=vs(h),h.tag=3,h.payload={element:null},h.callback=function(){yf(a,o)},h}function jc(a){return a=vs(a),a.tag=3,a}function Mr(a,o,h,y){var E=h.type.getDerivedStateFromError;if(typeof E=="function"){var M=y.value;a.payload=function(){return E(M)},a.callback=function(){ay(o,h,y)}}var U=h.stateNode;U!==null&&typeof U.componentDidCatch=="function"&&(a.callback=function(){ay(o,h,y),typeof E!="function"&&(Ms===null?Ms=new Set([this]):Ms.add(this));var J=y.stack;this.componentDidCatch(y.value,{componentStack:J!==null?J:""})})}function Wr(a,o,h,y,E){if(h.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(o=h.alternate,o!==null&&Yl(o,h,E,!0),h=Si.current,h!==null){switch(h.tag){case 31:case 13:return va===null?mt():h.alternate===null&&un===0&&(un=3),h.flags&=-257,h.flags|=65536,h.lanes=E,y===zu?h.flags|=16384:(o=h.updateQueue,o===null?h.updateQueue=new Set([y]):o.add(y),Dx(a,y,E)),!1;case 22:return h.flags|=65536,y===zu?h.flags|=16384:(o=h.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([y])},h.updateQueue=o):(h=o.retryQueue,h===null?o.retryQueue=new Set([y]):h.add(y)),Dx(a,y,E)),!1}throw Error(i(435,h.tag))}return Dx(a,y,E),mt(),!1}if(zt)return o=Si.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=E,y!==Wd&&(a=Error(i(422),{cause:y}),Nu(wr(a,h)))):(y!==Wd&&(o=Error(i(423),{cause:y}),Nu(wr(o,h))),a=a.current.alternate,a.flags|=65536,E&=-E,a.lanes|=E,y=wr(y,h),E=Dp(a.stateNode,y,E),nf(a,E),un!==4&&(un=2)),!1;var M=Error(i(520),{cause:y});if(M=wr(M,h),Ka===null?Ka=[M]:Ka.push(M),un!==4&&(un=2),o===null)return!0;y=wr(y,h),h=o;do{switch(h.tag){case 3:return h.flags|=65536,a=E&-E,h.lanes|=a,a=Dp(h.stateNode,y,a),nf(h,a),!1;case 1:if(o=h.type,M=h.stateNode,(h.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||M!==null&&typeof M.componentDidCatch=="function"&&(Ms===null||!Ms.has(M))))return h.flags|=65536,E&=-E,h.lanes|=E,E=jc(E),Mr(E,a,h,y),nf(h,E),!1}h=h.return}while(h!==null);return!1}var xf=Error(i(461)),Dn=!1;function Vn(a,o,h,y){o.child=a===null?zg(o,null,h,y):Lo(o,a.child,h,y)}function Vu(a,o,h,y,E){h=h.render;var M=o.ref;if("ref"in y){var U={};for(var J in y)J!=="ref"&&(U[J]=y[J])}else U=y;return Do(o),y=up(a,o,h,U,M,E),J=dp(),a!==null&&!Dn?(fp(a,o,E),Va(a,o,E)):(zt&&J&&$d(o),o.flags|=1,Vn(a,o,y,E),o.child)}function Xu(a,o,h,y,E){if(a===null){var M=h.type;return typeof M=="function"&&!hr(M)&&M.defaultProps===void 0&&h.compare===null?(o.tag=15,o.type=M,Qr(a,o,M,y,E)):(a=Mu(h.type,null,y,o,o.mode,E),a.ref=o.ref,a.return=o,o.child=a)}if(M=a.child,!eo(a,E)){var U=M.memoizedProps;if(h=h.compare,h=h!==null?h:vc,h(U,y)&&a.ref===o.ref)return Va(a,o,E)}return o.flags|=1,a=ms(M,y),a.ref=o.ref,a.return=o,o.child=a}function Qr(a,o,h,y,E){if(a!==null){var M=a.memoizedProps;if(vc(M,y)&&a.ref===o.ref)if(Dn=!1,o.pendingProps=y=M,eo(a,E))(a.flags&131072)!==0&&(Dn=!0);else return o.lanes=a.lanes,Va(a,o,E)}return Ic(a,o,h,y,E)}function Zr(a,o,h,y){var E=y.children,M=a!==null?a.memoizedState:null;if(a===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),y.mode==="hidden"){if((o.flags&128)!==0){if(M=M!==null?M.baseLanes|h:h,a!==null){for(y=o.child=a.child,E=0;y!==null;)E=E|y.lanes|y.childLanes,y=y.sibling;y=E&~M}else y=0,o.child=null;return ws(a,o,M,h,y)}if((h&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},a!==null&&Nc(o,M!==null?M.cachePool:null),M!==null?sp(o,M):lp(),Bg(o);else return y=o.lanes=536870912,ws(a,o,M!==null?M.baseLanes|h:h,h,y)}else M!==null?(Nc(o,M.cachePool),sp(o,M),el(),o.memoizedState=null):(a!==null&&Nc(o,null),lp(),el());return Vn(a,o,E,h),o.child}function qa(a,o){return a!==null&&a.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function ws(a,o,h,y,E){var M=bs();return M=M===null?null:{parent:Je._currentValue,pool:M},o.memoizedState={baseLanes:h,cachePool:M},a!==null&&Nc(o,null),lp(),Bg(o),a!==null&&Yl(a,o,y,!0),o.childLanes=E,null}function _a(a,o){return o=Uc({mode:o.mode,children:o.children},a.mode),o.ref=a.ref,a.child=o,o.return=a,o}function Oi(a,o,h){return Lo(o,a.child,null,h),a=_a(o,o.pendingProps),a.flags|=2,Kr(o),o.memoizedState=null,a}function Ku(a,o,h){var y=o.pendingProps,E=(o.flags&128)!==0;if(o.flags&=-129,a===null){if(zt){if(y.mode==="hidden")return a=_a(o,y),o.lanes=536870912,qa(null,a);if(op(o),(a=En)?(a=SS(a,ki),a=a!==null&&a.data==="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:gs!==null?{id:ys,overflow:xs}:null,retryLane:536870912,hydrationErrors:null},h=Mg(a),h.return=o,o.child=h,Ri=o,En=null)):a=null,a===null)throw Ot(o);return o.lanes=536870912,null}return _a(o,y)}var M=a.memoizedState;if(M!==null){var U=M.dehydrated;if(op(o),E)if(o.flags&256)o.flags&=-257,o=Oi(a,o,h);else if(o.memoizedState!==null)o.child=a.child,o.flags|=128,o=null;else throw Error(i(558));else if(Dn||Yl(a,o,h,!1),E=(h&a.childLanes)!==0,Dn||E){if(y=cn,y!==null&&(U=Rn(y,h),U!==0&&U!==M.retryLane))throw M.retryLane=U,Fl(a,U),d(y,a,U),xf;mt(),o=Oi(a,o,h)}else a=M.treeContext,En=Rs(U.nextSibling),Ri=o,zt=!0,Ks=null,ki=!1,a!==null&&ku(o,a),o=_a(o,y),o.flags|=4096;return o}return a=ms(a.child,{mode:y.mode,children:y.children}),a.ref=o.ref,o.child=a,a.return=o,a}function Ya(a,o){var h=o.ref;if(h===null)a!==null&&a.ref!==null&&(o.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(i(284));(a===null||a.ref!==h)&&(o.flags|=4194816)}}function Ic(a,o,h,y,E){return Do(o),h=up(a,o,h,y,void 0,E),y=dp(),a!==null&&!Dn?(fp(a,o,E),Va(a,o,E)):(zt&&y&&$d(o),o.flags|=1,Vn(a,o,h,E),o.child)}function Ji(a,o,h,y,E,M){return Do(o),o.updateQueue=null,h=jg(o,y,h,E),Lg(a),y=dp(),a!==null&&!Dn?(fp(a,o,M),Va(a,o,M)):(zt&&y&&$d(o),o.flags|=1,Vn(a,o,h,M),o.child)}function Fi(a,o,h,y,E){if(Do(o),o.stateNode===null){var M=Gl,U=h.contextType;typeof U=="object"&&U!==null&&(M=Ni(U)),M=new h(y,M),o.memoizedState=M.state!==null&&M.state!==void 0?M.state:null,M.updater=Yu,o.stateNode=M,M._reactInternals=o,M=o.stateNode,M.props=y,M.state=o.memoizedState,M.refs={},ip(o),U=h.contextType,M.context=typeof U=="object"&&U!==null?Ni(U):Gl,M.state=o.memoizedState,U=h.getDerivedStateFromProps,typeof U=="function"&&(Lc(o,h,U,y),M.state=o.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof M.getSnapshotBeforeUpdate=="function"||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(U=M.state,typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount(),U!==M.state&&Yu.enqueueReplaceState(M,M.state,null),jo(o,y,M,E),ju(),M.state=o.memoizedState),typeof M.componentDidMount=="function"&&(o.flags|=4194308),y=!0}else if(a===null){M=o.stateNode;var J=o.memoizedProps,ae=Pi(h,J);M.props=ae;var ye=M.context,we=h.contextType;U=Gl,typeof we=="object"&&we!==null&&(U=Ni(we));var Me=h.getDerivedStateFromProps;we=typeof Me=="function"||typeof M.getSnapshotBeforeUpdate=="function",J=o.pendingProps!==J,we||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(J||ye!==U)&&iy(o,M,y,U),Wl=!1;var ve=o.memoizedState;M.state=ve,jo(o,y,M,E),ju(),ye=o.memoizedState,J||ve!==ye||Wl?(typeof Me=="function"&&(Lc(o,h,Me,y),ye=o.memoizedState),(ae=Wl||ny(o,h,ae,y,ve,ye,U))?(we||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(o.flags|=4194308)):(typeof M.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=y,o.memoizedState=ye),M.props=y,M.state=ye,M.context=U,y=ae):(typeof M.componentDidMount=="function"&&(o.flags|=4194308),y=!1)}else{M=o.stateNode,rp(a,o),U=o.memoizedProps,we=Pi(h,U),M.props=we,Me=o.pendingProps,ve=M.context,ye=h.contextType,ae=Gl,typeof ye=="object"&&ye!==null&&(ae=Ni(ye)),J=h.getDerivedStateFromProps,(ye=typeof J=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(U!==Me||ve!==ae)&&iy(o,M,y,ae),Wl=!1,ve=o.memoizedState,M.state=ve,jo(o,y,M,E),ju();var Se=o.memoizedState;U!==Me||ve!==Se||Wl||a!==null&&a.dependencies!==null&&Rc(a.dependencies)?(typeof J=="function"&&(Lc(o,h,J,y),Se=o.memoizedState),(we=Wl||ny(o,h,we,y,ve,Se,ae)||a!==null&&a.dependencies!==null&&Rc(a.dependencies))?(ye||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(y,Se,ae),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(y,Se,ae)),typeof M.componentDidUpdate=="function"&&(o.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof M.componentDidUpdate!="function"||U===a.memoizedProps&&ve===a.memoizedState||(o.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||U===a.memoizedProps&&ve===a.memoizedState||(o.flags|=1024),o.memoizedProps=y,o.memoizedState=Se),M.props=y,M.state=Se,M.context=ae,y=we):(typeof M.componentDidUpdate!="function"||U===a.memoizedProps&&ve===a.memoizedState||(o.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||U===a.memoizedProps&&ve===a.memoizedState||(o.flags|=1024),y=!1)}return M=y,Ya(a,o),y=(o.flags&128)!==0,M||y?(M=o.stateNode,h=y&&typeof h.getDerivedStateFromError!="function"?null:M.render(),o.flags|=1,a!==null&&y?(o.child=Lo(o,a.child,null,E),o.child=Lo(o,null,h,E)):Vn(a,o,h,E),o.memoizedState=M.state,a=o.child):a=Va(a,o,E),a}function Gt(a,o,h,y){return Oo(),o.flags|=256,Vn(a,o,h,y),o.child}var Jr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sa(a){return{baseLanes:a,cachePool:Jd()}}function $u(a,o,h){return a=a!==null?a.childLanes&~h:0,o&&(a|=It),a}function ea(a,o,h){var y=o.pendingProps,E=!1,M=(o.flags&128)!==0,U;if((U=M)||(U=a!==null&&a.memoizedState===null?!1:(qn.current&2)!==0),U&&(E=!0,o.flags&=-129),U=(o.flags&32)!==0,o.flags&=-33,a===null){if(zt){if(E?Zl(o):el(),(a=En)?(a=SS(a,ki),a=a!==null&&a.data!=="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:gs!==null?{id:ys,overflow:xs}:null,retryLane:536870912,hydrationErrors:null},h=Mg(a),h.return=o,o.child=h,Ri=o,En=null)):a=null,a===null)throw Ot(o);return $x(a)?o.lanes=32:o.lanes=536870912,null}var J=y.children;return y=y.fallback,E?(el(),E=o.mode,J=Uc({mode:"hidden",children:J},E),y=Vs(y,E,h,null),J.return=o,y.return=o,J.sibling=y,o.child=J,y=o.child,y.memoizedState=Sa(h),y.childLanes=$u(a,U,h),o.memoizedState=Jr,qa(null,y)):(Zl(o),Jl(o,J))}var ae=a.memoizedState;if(ae!==null&&(J=ae.dehydrated,J!==null)){if(M)o.flags&256?(Zl(o),o.flags&=-257,o=Hc(a,o,h)):o.memoizedState!==null?(el(),o.child=a.child,o.flags|=128,o=null):(el(),J=y.fallback,E=o.mode,y=Uc({mode:"visible",children:y.children},E),J=Vs(J,E,h,null),J.flags|=2,y.return=o,J.return=o,y.sibling=J,o.child=y,Lo(o,a.child,null,h),y=o.child,y.memoizedState=Sa(h),y.childLanes=$u(a,U,h),o.memoizedState=Jr,o=qa(null,y));else if(Zl(o),$x(J)){if(U=J.nextSibling&&J.nextSibling.dataset,U)var ye=U.dgst;U=ye,y=Error(i(419)),y.stack="",y.digest=U,Nu({value:y,source:null,stack:null}),o=Hc(a,o,h)}else if(Dn||Yl(a,o,h,!1),U=(h&a.childLanes)!==0,Dn||U){if(U=cn,U!==null&&(y=Rn(U,h),y!==0&&y!==ae.retryLane))throw ae.retryLane=y,Fl(a,y),d(U,a,y),xf;Kx(J)||mt(),o=Hc(a,o,h)}else Kx(J)?(o.flags|=192,o.child=a.child,o=null):(a=ae.treeContext,En=Rs(J.nextSibling),Ri=o,zt=!0,Ks=null,ki=!1,a!==null&&ku(o,a),o=Jl(o,y.children),o.flags|=4096);return o}return E?(el(),J=y.fallback,E=o.mode,ae=a.child,ye=ae.sibling,y=ms(ae,{mode:"hidden",children:y.children}),y.subtreeFlags=ae.subtreeFlags&65011712,ye!==null?J=ms(ye,J):(J=Vs(J,E,h,null),J.flags|=2),J.return=o,y.return=o,y.sibling=J,o.child=y,qa(null,y),y=o.child,J=a.child.memoizedState,J===null?J=Sa(h):(E=J.cachePool,E!==null?(ae=Je._currentValue,E=E.parent!==ae?{parent:ae,pool:ae}:E):E=Jd(),J={baseLanes:J.baseLanes|h,cachePool:E}),y.memoizedState=J,y.childLanes=$u(a,U,h),o.memoizedState=Jr,qa(a.child,y)):(Zl(o),h=a.child,a=h.sibling,h=ms(h,{mode:"visible",children:y.children}),h.return=o,h.sibling=null,a!==null&&(U=o.deletions,U===null?(o.deletions=[a],o.flags|=16):U.push(a)),o.child=h,o.memoizedState=null,h)}function Jl(a,o){return o=Uc({mode:"visible",children:o},a.mode),o.return=a,a.child=o}function Uc(a,o){return a=fr(22,a,null,o),a.lanes=0,a}function Hc(a,o,h){return Lo(o,a.child,null,h),a=Jl(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function Ho(a,o,h){a.lanes|=o;var y=a.alternate;y!==null&&(y.lanes|=o),Qs(a.return,o,h)}function Wu(a,o,h,y,E,M){var U=a.memoizedState;U===null?a.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:y,tail:h,tailMode:E,treeForkCount:M}:(U.isBackwards=o,U.rendering=null,U.renderingStartTime=0,U.last=y,U.tail=h,U.tailMode=E,U.treeForkCount=M)}function Qu(a,o,h){var y=o.pendingProps,E=y.revealOrder,M=y.tail;y=y.children;var U=qn.current,J=(U&2)!==0;if(J?(U=U&1|2,o.flags|=128):U&=1,X(qn,U),Vn(a,o,y,h),y=zt?Mc:0,!J&&a!==null&&(a.flags&128)!==0)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Ho(a,h,o);else if(a.tag===19)Ho(a,h,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(E){case"forwards":for(h=o.child,E=null;h!==null;)a=h.alternate,a!==null&&rf(a)===null&&(E=h),h=h.sibling;h=E,h===null?(E=o.child,o.child=null):(E=h.sibling,h.sibling=null),Wu(o,!1,E,h,M,y);break;case"backwards":case"unstable_legacy-backwards":for(h=null,E=o.child,o.child=null;E!==null;){if(a=E.alternate,a!==null&&rf(a)===null){o.child=E;break}a=E.sibling,E.sibling=h,h=E,E=a}Wu(o,!0,h,null,M,y);break;case"together":Wu(o,!1,null,null,void 0,y);break;default:o.memoizedState=null}return o.child}function Va(a,o,h){if(a!==null&&(o.dependencies=a.dependencies),ia|=o.lanes,(h&o.childLanes)===0)if(a!==null){if(Yl(a,o,h,!1),(h&o.childLanes)===0)return null}else return null;if(a!==null&&o.child!==a.child)throw Error(i(153));if(o.child!==null){for(a=o.child,h=ms(a,a.pendingProps),o.child=h,h.return=o;a.sibling!==null;)a=a.sibling,h=h.sibling=ms(a,a.pendingProps),h.return=o;h.sibling=null}return o.child}function eo(a,o){return(a.lanes&o)!==0?!0:(a=a.dependencies,!!(a!==null&&Rc(a)))}function Zu(a,o,h){switch(o.tag){case 3:me(o,o.stateNode.containerInfo),Ws(o,Je,a.memoizedState.cache),Oo();break;case 27:case 5:Re(o);break;case 4:me(o,o.stateNode.containerInfo);break;case 10:Ws(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,op(o),null;break;case 13:var y=o.memoizedState;if(y!==null)return y.dehydrated!==null?(Zl(o),o.flags|=128,null):(h&o.child.childLanes)!==0?ea(a,o,h):(Zl(o),a=Va(a,o,h),a!==null?a.sibling:null);Zl(o);break;case 19:var E=(a.flags&128)!==0;if(y=(h&o.childLanes)!==0,y||(Yl(a,o,h,!1),y=(h&o.childLanes)!==0),E){if(y)return Qu(a,o,h);o.flags|=128}if(E=o.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),X(qn,qn.current),y)break;return null;case 22:return o.lanes=0,Zr(a,o,h,o.pendingProps);case 24:Ws(o,Je,a.memoizedState.cache)}return Va(a,o,h)}function bf(a,o,h){if(a!==null)if(a.memoizedProps!==o.pendingProps)Dn=!0;else{if(!eo(a,h)&&(o.flags&128)===0)return Dn=!1,Zu(a,o,h);Dn=(a.flags&131072)!==0}else Dn=!1,zt&&(o.flags&1048576)!==0&&Vh(o,Mc,o.index);switch(o.lanes=0,o.tag){case 16:e:{var y=o.pendingProps;if(a=Bo(o.elementType),o.type=a,typeof a=="function")hr(a)?(y=Pi(a,y),o.tag=1,o=Fi(null,o,a,y,h)):(o.tag=0,o=Ic(null,o,a,y,h));else{if(a!=null){var E=a.$$typeof;if(E===O){o.tag=11,o=Vu(null,o,a,y,h);break e}else if(E===q){o.tag=14,o=Xu(null,o,a,y,h);break e}}throw o=P(a)||a,Error(i(306,o,""))}}return o;case 0:return Ic(a,o,o.type,o.pendingProps,h);case 1:return y=o.type,E=Pi(y,o.pendingProps),Fi(a,o,y,E,h);case 3:e:{if(me(o,o.stateNode.containerInfo),a===null)throw Error(i(387));y=o.pendingProps;var M=o.memoizedState;E=M.element,rp(a,o),jo(o,y,null,h);var U=o.memoizedState;if(y=U.cache,Ws(o,Je,y),y!==M.cache&&Zd(o,[Je],h,!0),ju(),y=U.element,M.isDehydrated)if(M={element:y,isDehydrated:!1,cache:U.cache},o.updateQueue.baseState=M,o.memoizedState=M,o.flags&256){o=Gt(a,o,y,h);break e}else if(y!==E){E=wr(Error(i(424)),o),Nu(E),o=Gt(a,o,y,h);break e}else{switch(a=o.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(En=Rs(a.firstChild),Ri=o,zt=!0,Ks=null,ki=!0,h=zg(o,null,y,h),o.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(Oo(),y===E){o=Va(a,o,h);break e}Vn(a,o,y,h)}o=o.child}return o;case 26:return Ya(a,o),a===null?(h=MS(o.type,null,o.pendingProps,null))?o.memoizedState=h:zt||(h=o.type,a=o.pendingProps,y=hy(de.current).createElement(h),y[bt]=o,y[ui]=a,xr(y,h,a),jn(y),o.stateNode=y):o.memoizedState=MS(o.type,a.memoizedProps,o.pendingProps,a.memoizedState),null;case 27:return Re(o),a===null&&zt&&(y=o.stateNode=TS(o.type,o.pendingProps,de.current),Ri=o,ki=!0,E=En,Xc(o.type)?(Wx=E,En=Rs(y.firstChild)):En=E),Vn(a,o,o.pendingProps.children,h),Ya(a,o),a===null&&(o.flags|=4194304),o.child;case 5:return a===null&&zt&&((E=y=En)&&(y=y3(y,o.type,o.pendingProps,ki),y!==null?(o.stateNode=y,Ri=o,En=Rs(y.firstChild),ki=!1,E=!0):E=!1),E||Ot(o)),Re(o),E=o.type,M=o.pendingProps,U=a!==null?a.memoizedProps:null,y=M.children,Yx(E,M)?y=null:U!==null&&Yx(E,U)&&(o.flags|=32),o.memoizedState!==null&&(E=up(a,o,Ax,null,null,h),Gp._currentValue=E),Ya(a,o),Vn(a,o,y,h),o.child;case 6:return a===null&&zt&&((a=h=En)&&(h=x3(h,o.pendingProps,ki),h!==null?(o.stateNode=h,Ri=o,En=null,a=!0):a=!1),a||Ot(o)),null;case 13:return ea(a,o,h);case 4:return me(o,o.stateNode.containerInfo),y=o.pendingProps,a===null?o.child=Lo(o,null,y,h):Vn(a,o,y,h),o.child;case 11:return Vu(a,o,o.type,o.pendingProps,h);case 7:return Vn(a,o,o.pendingProps,h),o.child;case 8:return Vn(a,o,o.pendingProps.children,h),o.child;case 12:return Vn(a,o,o.pendingProps.children,h),o.child;case 10:return y=o.pendingProps,Ws(o,o.type,y.value),Vn(a,o,y.children,h),o.child;case 9:return E=o.type._context,y=o.pendingProps.children,Do(o),E=Ni(E),y=y(E),o.flags|=1,Vn(a,o,y,h),o.child;case 14:return Xu(a,o,o.type,o.pendingProps,h);case 15:return Qr(a,o,o.type,o.pendingProps,h);case 19:return Qu(a,o,h);case 31:return Ku(a,o,h);case 22:return Zr(a,o,h,o.pendingProps);case 24:return Do(o),y=Ni(Je),a===null?(E=bs(),E===null&&(E=cn,M=Qh(),E.pooledCache=M,M.refCount++,M!==null&&(E.pooledCacheLanes|=h),E=M),o.memoizedState={parent:y,cache:E},ip(o),Ws(o,Je,E)):((a.lanes&h)!==0&&(rp(a,o),jo(o,null,null,h),ju()),E=a.memoizedState,M=o.memoizedState,E.parent!==y?(E={parent:y,cache:y},o.memoizedState=E,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=E),Ws(o,Je,y)):(y=M.cache,Ws(o,Je,y),y!==E.cache&&Zd(o,[Je],h,!0))),Vn(a,o,o.pendingProps.children,h),o.child;case 29:throw o.pendingProps}throw Error(i(156,o.tag))}function Rr(a){a.flags|=4}function to(a,o,h,y,E){if((o=(a.mode&32)!==0)&&(o=!1),o){if(a.flags|=16777216,(E&335544128)===E)if(a.stateNode.complete)a.flags|=8192;else if(De())a.flags|=8192;else throw at=zu,Du}else a.flags&=-16777217}function il(a,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!DS(o))if(De())a.flags|=8192;else throw at=zu,Du}function Pc(a,o){o!==null&&(a.flags|=4),a.flags&16384&&(o=a.tag!==22?tt():536870912,a.lanes|=o,ra|=o)}function Ju(a,o){if(!zt)switch(a.tailMode){case"hidden":o=a.tail;for(var h=null;o!==null;)o.alternate!==null&&(h=o),o=o.sibling;h===null?a.tail=null:h.sibling=null;break;case"collapsed":h=a.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?o||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function mn(a){var o=a.alternate!==null&&a.alternate.child===a.child,h=0,y=0;if(o)for(var E=a.child;E!==null;)h|=E.lanes|E.childLanes,y|=E.subtreeFlags&65011712,y|=E.flags&65011712,E.return=a,E=E.sibling;else for(E=a.child;E!==null;)h|=E.lanes|E.childLanes,y|=E.subtreeFlags,y|=E.flags,E.return=a,E=E.sibling;return a.subtreeFlags|=y,a.childLanes=h,o}function zp(a,o,h){var y=o.pendingProps;switch(ql(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mn(o),null;case 1:return mn(o),null;case 3:return h=o.stateNode,y=null,a!==null&&(y=a.memoizedState.cache),o.memoizedState.cache!==y&&(o.flags|=2048),ba(Je),le(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(a===null||a.child===null)&&(No(o)?Rr(o):a===null||a.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Xh())),mn(o),null;case 26:var E=o.type,M=o.memoizedState;return a===null?(Rr(o),M!==null?(mn(o),il(o,M)):(mn(o),to(o,E,null,y,h))):M?M!==a.memoizedState?(Rr(o),mn(o),il(o,M)):(mn(o),o.flags&=-16777217):(a=a.memoizedProps,a!==y&&Rr(o),mn(o),to(o,E,a,y,h)),null;case 27:if(je(o),h=de.current,E=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==y&&Rr(o);else{if(!y){if(o.stateNode===null)throw Error(i(166));return mn(o),null}a=ce.current,No(o)?Qd(o):(a=TS(E,y,h),o.stateNode=a,Rr(o))}return mn(o),null;case 5:if(je(o),E=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==y&&Rr(o);else{if(!y){if(o.stateNode===null)throw Error(i(166));return mn(o),null}if(M=ce.current,No(o))Qd(o);else{var U=hy(de.current);switch(M){case 1:M=U.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:M=U.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":M=U.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":M=U.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":M=U.createElement("div"),M.innerHTML="<script><\/script>",M=M.removeChild(M.firstChild);break;case"select":M=typeof y.is=="string"?U.createElement("select",{is:y.is}):U.createElement("select"),y.multiple?M.multiple=!0:y.size&&(M.size=y.size);break;default:M=typeof y.is=="string"?U.createElement(E,{is:y.is}):U.createElement(E)}}M[bt]=o,M[ui]=y;e:for(U=o.child;U!==null;){if(U.tag===5||U.tag===6)M.appendChild(U.stateNode);else if(U.tag!==4&&U.tag!==27&&U.child!==null){U.child.return=U,U=U.child;continue}if(U===o)break e;for(;U.sibling===null;){if(U.return===null||U.return===o)break e;U=U.return}U.sibling.return=U.return,U=U.sibling}o.stateNode=M;e:switch(xr(M,E,y),E){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&Rr(o)}}return mn(o),to(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,h),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==y&&Rr(o);else{if(typeof y!="string"&&o.stateNode===null)throw Error(i(166));if(a=de.current,No(o)){if(a=o.stateNode,h=o.memoizedProps,y=null,E=Ri,E!==null)switch(E.tag){case 27:case 5:y=E.memoizedProps}a[bt]=o,a=!!(a.nodeValue===h||y!==null&&y.suppressHydrationWarning===!0||pS(a.nodeValue,h)),a||Ot(o,!0)}else a=hy(a).createTextNode(y),a[bt]=o,o.stateNode=a}return mn(o),null;case 31:if(h=o.memoizedState,a===null||a.memoizedState!==null){if(y=No(o),h!==null){if(a===null){if(!y)throw Error(i(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(557));a[bt]=o}else Oo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;mn(o),a=!1}else h=Xh(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=h),a=!0;if(!a)return o.flags&256?(Kr(o),o):(Kr(o),null);if((o.flags&128)!==0)throw Error(i(558))}return mn(o),null;case 13:if(y=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(E=No(o),y!==null&&y.dehydrated!==null){if(a===null){if(!E)throw Error(i(318));if(E=o.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(i(317));E[bt]=o}else Oo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;mn(o),E=!1}else E=Xh(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=E),E=!0;if(!E)return o.flags&256?(Kr(o),o):(Kr(o),null)}return Kr(o),(o.flags&128)!==0?(o.lanes=h,o):(h=y!==null,a=a!==null&&a.memoizedState!==null,h&&(y=o.child,E=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(E=y.alternate.memoizedState.cachePool.pool),M=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(M=y.memoizedState.cachePool.pool),M!==E&&(y.flags|=2048)),h!==a&&h&&(o.child.flags|=8192),Pc(o,o.updateQueue),mn(o),null);case 4:return le(),a===null&&Hx(o.stateNode.containerInfo),mn(o),null;case 10:return ba(o.type),mn(o),null;case 19:if(ne(qn),y=o.memoizedState,y===null)return mn(o),null;if(E=(o.flags&128)!==0,M=y.rendering,M===null)if(E)Ju(y,!1);else{if(un!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(M=rf(a),M!==null){for(o.flags|=128,Ju(y,!1),a=M.updateQueue,o.updateQueue=a,Pc(o,a),o.subtreeFlags=0,a=h,h=o.child;h!==null;)Wi(h,a),h=h.sibling;return X(qn,qn.current&1|2),zt&&Xs(o,y.treeForkCount),o.child}a=a.sibling}y.tail!==null&&Wt()>aa&&(o.flags|=128,E=!0,Ju(y,!1),o.lanes=4194304)}else{if(!E)if(a=rf(M),a!==null){if(o.flags|=128,E=!0,a=a.updateQueue,o.updateQueue=a,Pc(o,a),Ju(y,!0),y.tail===null&&y.tailMode==="hidden"&&!M.alternate&&!zt)return mn(o),null}else 2*Wt()-y.renderingStartTime>aa&&h!==536870912&&(o.flags|=128,E=!0,Ju(y,!1),o.lanes=4194304);y.isBackwards?(M.sibling=o.child,o.child=M):(a=y.last,a!==null?a.sibling=M:o.child=M,y.last=M)}return y.tail!==null?(a=y.tail,y.rendering=a,y.tail=a.sibling,y.renderingStartTime=Wt(),a.sibling=null,h=qn.current,X(qn,E?h&1|2:h&1),zt&&Xs(o,y.treeForkCount),a):(mn(o),null);case 22:case 23:return Kr(o),Zi(),y=o.memoizedState!==null,a!==null?a.memoizedState!==null!==y&&(o.flags|=8192):y&&(o.flags|=8192),y?(h&536870912)!==0&&(o.flags&128)===0&&(mn(o),o.subtreeFlags&6&&(o.flags|=8192)):mn(o),h=o.updateQueue,h!==null&&Pc(o,h.retryQueue),h=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),y=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(y=o.memoizedState.cachePool.pool),y!==h&&(o.flags|=2048),a!==null&&ne(Vl),null;case 24:return h=null,a!==null&&(h=a.memoizedState.cache),o.memoizedState.cache!==h&&(o.flags|=2048),ba(Je),mn(o),null;case 25:return null;case 30:return null}throw Error(i(156,o.tag))}function vf(a,o){switch(ql(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return ba(Je),le(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return je(o),null;case 31:if(o.memoizedState!==null){if(Kr(o),o.alternate===null)throw Error(i(340));Oo()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(Kr(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(i(340));Oo()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return ne(qn),null;case 4:return le(),null;case 10:return ba(o.type),null;case 22:case 23:return Kr(o),Zi(),a!==null&&ne(Vl),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return ba(Je),null;case 25:return null;default:return null}}function Po(a,o){switch(ql(o),o.tag){case 3:ba(Je),le();break;case 26:case 27:case 5:je(o);break;case 4:le();break;case 31:o.memoizedState!==null&&Kr(o);break;case 13:Kr(o);break;case 19:ne(qn);break;case 10:ba(o.type);break;case 22:case 23:Kr(o),Zi(),a!==null&&ne(Vl);break;case 24:ba(Je)}}function Ts(a,o){try{var h=o.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var E=y.next;h=E;do{if((h.tag&a)===a){y=void 0;var M=h.create,U=h.inst;y=M(),U.destroy=y}h=h.next}while(h!==E)}}catch(J){vn(o,o.return,J)}}function Ea(a,o,h){try{var y=o.updateQueue,E=y!==null?y.lastEffect:null;if(E!==null){var M=E.next;y=M;do{if((y.tag&a)===a){var U=y.inst,J=U.destroy;if(J!==void 0){U.destroy=void 0,E=o;var ae=h,ye=J;try{ye()}catch(we){vn(E,ae,we)}}}y=y.next}while(y!==M)}}catch(we){vn(o,o.return,we)}}function no(a){var o=a.updateQueue;if(o!==null){var h=a.stateNode;try{Ui(o,h)}catch(y){vn(a,a.return,y)}}}function Bp(a,o,h){h.props=Pi(a.type,a.memoizedProps),h.state=a.memoizedState;try{h.componentWillUnmount()}catch(y){vn(a,o,y)}}function Cs(a,o){try{var h=a.ref;if(h!==null){switch(a.tag){case 26:case 27:case 5:var y=a.stateNode;break;case 30:y=a.stateNode;break;default:y=a.stateNode}typeof h=="function"?a.refCleanup=h(y):h.current=y}}catch(E){vn(a,o,E)}}function ta(a,o){var h=a.ref,y=a.refCleanup;if(h!==null)if(typeof y=="function")try{y()}catch(E){vn(a,o,E)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(E){vn(a,o,E)}else h.current=null}function na(a){var o=a.type,h=a.memoizedProps,y=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":h.autoFocus&&y.focus();break e;case"img":h.src?y.src=h.src:h.srcSet&&(y.srcset=h.srcSet)}}catch(E){vn(a,a.return,E)}}function wa(a,o,h){try{var y=a.stateNode;d3(y,a.type,h,o),y[ui]=o}catch(E){vn(a,a.return,E)}}function hi(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Xc(a.type)||a.tag===4}function As(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||hi(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&&Xc(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 St(a,o,h){var y=a.tag;if(y===5||y===6)a=a.stateNode,o?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(a,o):(o=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,o.appendChild(a),h=h._reactRootContainer,h!=null||o.onclick!==null||(o.onclick=Be));else if(y!==4&&(y===27&&Xc(a.type)&&(h=a.stateNode,o=null),a=a.child,a!==null))for(St(a,o,h),a=a.sibling;a!==null;)St(a,o,h),a=a.sibling}function Jt(a,o,h){var y=a.tag;if(y===5||y===6)a=a.stateNode,o?h.insertBefore(a,o):h.appendChild(a);else if(y!==4&&(y===27&&Xc(a.type)&&(h=a.stateNode),a=a.child,a!==null))for(Jt(a,o,h),a=a.sibling;a!==null;)Jt(a,o,h),a=a.sibling}function ti(a){var o=a.stateNode,h=a.memoizedProps;try{for(var y=a.type,E=o.attributes;E.length;)o.removeAttributeNode(E[0]);xr(o,y,h),o[bt]=a,o[ui]=h}catch(M){vn(a,a.return,M)}}var Ta=!1,zn=!1,rl=!1,ed=typeof WeakSet=="function"?WeakSet:Set,Xn=null;function Fc(a,o){if(a=a.containerInfo,Gx=vy,a=Pd(a),_c(a)){if("selectionStart"in a)var h={start:a.selectionStart,end:a.selectionEnd};else e:{h=(h=a.ownerDocument)&&h.defaultView||window;var y=h.getSelection&&h.getSelection();if(y&&y.rangeCount!==0){h=y.anchorNode;var E=y.anchorOffset,M=y.focusNode;y=y.focusOffset;try{h.nodeType,M.nodeType}catch{h=null;break e}var U=0,J=-1,ae=-1,ye=0,we=0,Me=a,ve=null;t:for(;;){for(var Se;Me!==h||E!==0&&Me.nodeType!==3||(J=U+E),Me!==M||y!==0&&Me.nodeType!==3||(ae=U+y),Me.nodeType===3&&(U+=Me.nodeValue.length),(Se=Me.firstChild)!==null;)ve=Me,Me=Se;for(;;){if(Me===a)break t;if(ve===h&&++ye===E&&(J=U),ve===M&&++we===y&&(ae=U),(Se=Me.nextSibling)!==null)break;Me=ve,ve=Me.parentNode}Me=Se}h=J===-1||ae===-1?null:{start:J,end:ae}}else h=null}h=h||{start:0,end:0}}else h=null;for(qx={focusedElem:a,selectionRange:h},vy=!1,Xn=o;Xn!==null;)if(o=Xn,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,Xn=a;else for(;Xn!==null;){switch(o=Xn,M=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(h=0;h<a.length;h++)E=a[h],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&M!==null){a=void 0,h=o,E=M.memoizedProps,M=M.memoizedState,y=h.stateNode;try{var Xe=Pi(h.type,E);a=y.getSnapshotBeforeUpdate(Xe,M),y.__reactInternalSnapshotBeforeUpdate=a}catch(ut){vn(h,h.return,ut)}}break;case 3:if((a&1024)!==0){if(a=o.stateNode.containerInfo,h=a.nodeType,h===9)Xx(a);else if(h===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Xx(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(i(163))}if(a=o.sibling,a!==null){a.return=o.return,Xn=a;break}Xn=o.return}}function sy(a,o,h){var y=h.flags;switch(h.tag){case 0:case 11:case 15:al(a,h),y&4&&Ts(5,h);break;case 1:if(al(a,h),y&4)if(a=h.stateNode,o===null)try{a.componentDidMount()}catch(U){vn(h,h.return,U)}else{var E=Pi(h.type,o.memoizedProps);o=o.memoizedState;try{a.componentDidUpdate(E,o,a.__reactInternalSnapshotBeforeUpdate)}catch(U){vn(h,h.return,U)}}y&64&&no(h),y&512&&Cs(h,h.return);break;case 3:if(al(a,h),y&64&&(a=h.updateQueue,a!==null)){if(o=null,h.child!==null)switch(h.child.tag){case 27:case 5:o=h.child.stateNode;break;case 1:o=h.child.stateNode}try{Ui(a,o)}catch(U){vn(h,h.return,U)}}break;case 27:o===null&&y&4&&ti(h);case 26:case 5:al(a,h),o===null&&y&4&&na(h),y&512&&Cs(h,h.return);break;case 12:al(a,h);break;case 31:al(a,h),y&4&&Sf(a,h);break;case 13:al(a,h),y&4&&Lp(a,h),y&64&&(a=h.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(h=JN.bind(null,h),b3(a,h))));break;case 22:if(y=h.memoizedState!==null||Ta,!y){o=o!==null&&o.memoizedState!==null||zn,E=Ta;var M=zn;Ta=y,(zn=o)&&!M?on(a,h,(h.subtreeFlags&8772)!==0):al(a,h),Ta=E,zn=M}break;case 30:break;default:al(a,h)}}function _f(a){var o=a.alternate;o!==null&&(a.alternate=null,_f(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&Hs(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 qt=null,pi=!1;function er(a,o,h){for(h=h.child;h!==null;)io(a,o,h),h=h.sibling}function io(a,o,h){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(Qt,h)}catch{}switch(h.tag){case 26:zn||ta(h,o),er(a,o,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:zn||ta(h,o);var y=qt,E=pi;Xc(h.type)&&(qt=h.stateNode,pi=!1),er(a,o,h),Hp(h.stateNode),qt=y,pi=E;break;case 5:zn||ta(h,o);case 6:if(y=qt,E=pi,qt=null,er(a,o,h),qt=y,pi=E,qt!==null)if(pi)try{(qt.nodeType===9?qt.body:qt.nodeName==="HTML"?qt.ownerDocument.body:qt).removeChild(h.stateNode)}catch(M){vn(h,o,M)}else try{qt.removeChild(h.stateNode)}catch(M){vn(h,o,M)}break;case 18:qt!==null&&(pi?(a=qt,vS(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,h.stateNode),Df(a)):vS(qt,h.stateNode));break;case 4:y=qt,E=pi,qt=h.stateNode.containerInfo,pi=!0,er(a,o,h),qt=y,pi=E;break;case 0:case 11:case 14:case 15:Ea(2,h,o),zn||Ea(4,h,o),er(a,o,h);break;case 1:zn||(ta(h,o),y=h.stateNode,typeof y.componentWillUnmount=="function"&&Bp(h,o,y)),er(a,o,h);break;case 21:er(a,o,h);break;case 22:zn=(y=zn)||h.memoizedState!==null,er(a,o,h),zn=y;break;default:er(a,o,h)}}function Sf(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Df(a)}catch(h){vn(o,o.return,h)}}}function Lp(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Df(a)}catch(h){vn(o,o.return,h)}}function ly(a){switch(a.tag){case 31:case 13:case 19:var o=a.stateNode;return o===null&&(o=a.stateNode=new ed),o;case 22:return a=a.stateNode,o=a._retryCache,o===null&&(o=a._retryCache=new ed),o;default:throw Error(i(435,a.tag))}}function ni(a,o){var h=ly(a);o.forEach(function(y){if(!h.has(y)){h.add(y);var E=e3.bind(null,a,y);y.then(E,E)}})}function tr(a,o){var h=o.deletions;if(h!==null)for(var y=0;y<h.length;y++){var E=h[y],M=a,U=o,J=U;e:for(;J!==null;){switch(J.tag){case 27:if(Xc(J.type)){qt=J.stateNode,pi=!1;break e}break;case 5:qt=J.stateNode,pi=!1;break e;case 3:case 4:qt=J.stateNode.containerInfo,pi=!0;break e}J=J.return}if(qt===null)throw Error(i(160));io(M,U,E),qt=null,pi=!1,M=E.alternate,M!==null&&(M.return=null),E.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)ro(o,a),o=o.sibling}var kr=null;function ro(a,o){var h=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:tr(o,a),Kn(a),y&4&&(Ea(3,a,a.return),Ts(3,a),Ea(5,a,a.return));break;case 1:tr(o,a),Kn(a),y&512&&(zn||h===null||ta(h,h.return)),y&64&&Ta&&(a=a.updateQueue,a!==null&&(y=a.callbacks,y!==null&&(h=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=h===null?y:h.concat(y))));break;case 26:var E=kr;if(tr(o,a),Kn(a),y&512&&(zn||h===null||ta(h,h.return)),y&4){var M=h!==null?h.memoizedState:null;if(y=a.memoizedState,h===null)if(y===null)if(a.stateNode===null){e:{y=a.type,h=a.memoizedProps,E=E.ownerDocument||E;t:switch(y){case"title":M=E.getElementsByTagName("title")[0],(!M||M[La]||M[bt]||M.namespaceURI==="http://www.w3.org/2000/svg"||M.hasAttribute("itemprop"))&&(M=E.createElement(y),E.head.insertBefore(M,E.querySelector("head > title"))),xr(M,y,h),M[bt]=a,jn(M),y=M;break e;case"link":var U=NS("link","href",E).get(y+(h.href||""));if(U){for(var J=0;J<U.length;J++)if(M=U[J],M.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&M.getAttribute("rel")===(h.rel==null?null:h.rel)&&M.getAttribute("title")===(h.title==null?null:h.title)&&M.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){U.splice(J,1);break t}}M=E.createElement(y),xr(M,y,h),E.head.appendChild(M);break;case"meta":if(U=NS("meta","content",E).get(y+(h.content||""))){for(J=0;J<U.length;J++)if(M=U[J],M.getAttribute("content")===(h.content==null?null:""+h.content)&&M.getAttribute("name")===(h.name==null?null:h.name)&&M.getAttribute("property")===(h.property==null?null:h.property)&&M.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&M.getAttribute("charset")===(h.charSet==null?null:h.charSet)){U.splice(J,1);break t}}M=E.createElement(y),xr(M,y,h),E.head.appendChild(M);break;default:throw Error(i(468,y))}M[bt]=a,jn(M),y=M}a.stateNode=y}else OS(E,a.type,a.stateNode);else a.stateNode=kS(E,y,a.memoizedProps);else M!==y?(M===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):M.count--,y===null?OS(E,a.type,a.stateNode):kS(E,y,a.memoizedProps)):y===null&&a.stateNode!==null&&wa(a,a.memoizedProps,h.memoizedProps)}break;case 27:tr(o,a),Kn(a),y&512&&(zn||h===null||ta(h,h.return)),h!==null&&y&4&&wa(a,a.memoizedProps,h.memoizedProps);break;case 5:if(tr(o,a),Kn(a),y&512&&(zn||h===null||ta(h,h.return)),a.flags&32){E=a.stateNode;try{rt(E,"")}catch(Xe){vn(a,a.return,Xe)}}y&4&&a.stateNode!=null&&(E=a.memoizedProps,wa(a,E,h!==null?h.memoizedProps:E)),y&1024&&(rl=!0);break;case 6:if(tr(o,a),Kn(a),y&4){if(a.stateNode===null)throw Error(i(162));y=a.memoizedProps,h=a.stateNode;try{h.nodeValue=y}catch(Xe){vn(a,a.return,Xe)}}break;case 3:if(gy=null,E=kr,kr=py(o.containerInfo),tr(o,a),kr=E,Kn(a),y&4&&h!==null&&h.memoizedState.isDehydrated)try{Df(o.containerInfo)}catch(Xe){vn(a,a.return,Xe)}rl&&(rl=!1,oy(a));break;case 4:y=kr,kr=py(a.stateNode.containerInfo),tr(o,a),Kn(a),kr=y;break;case 12:tr(o,a),Kn(a);break;case 31:tr(o,a),Kn(a),y&4&&(y=a.updateQueue,y!==null&&(a.updateQueue=null,ni(a,y)));break;case 13:tr(o,a),Kn(a),a.child.flags&8192&&a.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(ol=Wt()),y&4&&(y=a.updateQueue,y!==null&&(a.updateQueue=null,ni(a,y)));break;case 22:E=a.memoizedState!==null;var ae=h!==null&&h.memoizedState!==null,ye=Ta,we=zn;if(Ta=ye||E,zn=we||ae,tr(o,a),zn=we,Ta=ye,Kn(a),y&8192)e:for(o=a.stateNode,o._visibility=E?o._visibility&-2:o._visibility|1,E&&(h===null||ae||Ta||zn||Fo(a)),h=null,o=a;;){if(o.tag===5||o.tag===26){if(h===null){ae=h=o;try{if(M=ae.stateNode,E)U=M.style,typeof U.setProperty=="function"?U.setProperty("display","none","important"):U.display="none";else{J=ae.stateNode;var Me=ae.memoizedProps.style,ve=Me!=null&&Me.hasOwnProperty("display")?Me.display:null;J.style.display=ve==null||typeof ve=="boolean"?"":(""+ve).trim()}}catch(Xe){vn(ae,ae.return,Xe)}}}else if(o.tag===6){if(h===null){ae=o;try{ae.stateNode.nodeValue=E?"":ae.memoizedProps}catch(Xe){vn(ae,ae.return,Xe)}}}else if(o.tag===18){if(h===null){ae=o;try{var Se=ae.stateNode;E?_S(Se,!0):_S(ae.stateNode,!1)}catch(Xe){vn(ae,ae.return,Xe)}}}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;h===o&&(h=null),o=o.return}h===o&&(h=null),o.sibling.return=o.return,o=o.sibling}y&4&&(y=a.updateQueue,y!==null&&(h=y.retryQueue,h!==null&&(y.retryQueue=null,ni(a,h))));break;case 19:tr(o,a),Kn(a),y&4&&(y=a.updateQueue,y!==null&&(a.updateQueue=null,ni(a,y)));break;case 30:break;case 21:break;default:tr(o,a),Kn(a)}}function Kn(a){var o=a.flags;if(o&2){try{for(var h,y=a.return;y!==null;){if(hi(y)){h=y;break}y=y.return}if(h==null)throw Error(i(160));switch(h.tag){case 27:var E=h.stateNode,M=As(a);Jt(a,M,E);break;case 5:var U=h.stateNode;h.flags&32&&(rt(U,""),h.flags&=-33);var J=As(a);Jt(a,J,U);break;case 3:case 4:var ae=h.stateNode.containerInfo,ye=As(a);St(a,ye,ae);break;default:throw Error(i(161))}}catch(we){vn(a,a.return,we)}a.flags&=-3}o&4096&&(a.flags&=-4097)}function oy(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var o=a;oy(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),a=a.sibling}}function al(a,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)sy(a,o.alternate,o),o=o.sibling}function Fo(a){for(a=a.child;a!==null;){var o=a;switch(o.tag){case 0:case 11:case 14:case 15:Ea(4,o,o.return),Fo(o);break;case 1:ta(o,o.return);var h=o.stateNode;typeof h.componentWillUnmount=="function"&&Bp(o,o.return,h),Fo(o);break;case 27:Hp(o.stateNode);case 26:case 5:ta(o,o.return),Fo(o);break;case 22:o.memoizedState===null&&Fo(o);break;case 30:Fo(o);break;default:Fo(o)}a=a.sibling}}function on(a,o,h){for(h=h&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var y=o.alternate,E=a,M=o,U=M.flags;switch(M.tag){case 0:case 11:case 15:on(E,M,h),Ts(4,M);break;case 1:if(on(E,M,h),y=M,E=y.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(ye){vn(y,y.return,ye)}if(y=M,E=y.updateQueue,E!==null){var J=y.stateNode;try{var ae=E.shared.hiddenCallbacks;if(ae!==null)for(E.shared.hiddenCallbacks=null,E=0;E<ae.length;E++)_s(ae[E],J)}catch(ye){vn(y,y.return,ye)}}h&&U&64&&no(M),Cs(M,M.return);break;case 27:ti(M);case 26:case 5:on(E,M,h),h&&y===null&&U&4&&na(M),Cs(M,M.return);break;case 12:on(E,M,h);break;case 31:on(E,M,h),h&&U&4&&Sf(E,M);break;case 13:on(E,M,h),h&&U&4&&Lp(E,M);break;case 22:M.memoizedState===null&&on(E,M,h),Cs(M,M.return);break;case 30:break;default:on(E,M,h)}o=o.sibling}}function Ef(a,o){var h=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),a=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(a=o.memoizedState.cachePool.pool),a!==h&&(a!=null&&a.refCount++,h!=null&&Ii(h))}function sl(a,o){a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Ii(a))}function Ei(a,o,h,y){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Pn(a,o,h,y),o=o.sibling}function Pn(a,o,h,y){var E=o.flags;switch(o.tag){case 0:case 11:case 15:Ei(a,o,h,y),E&2048&&Ts(9,o);break;case 1:Ei(a,o,h,y);break;case 3:Ei(a,o,h,y),E&2048&&(a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Ii(a)));break;case 12:if(E&2048){Ei(a,o,h,y),a=o.stateNode;try{var M=o.memoizedProps,U=M.id,J=M.onPostCommit;typeof J=="function"&&J(U,o.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(ae){vn(o,o.return,ae)}}else Ei(a,o,h,y);break;case 31:Ei(a,o,h,y);break;case 13:Ei(a,o,h,y);break;case 23:break;case 22:M=o.stateNode,U=o.alternate,o.memoizedState!==null?M._visibility&2?Ei(a,o,h,y):Gc(a,o):M._visibility&2?Ei(a,o,h,y):(M._visibility|=2,ao(a,o,h,y,(o.subtreeFlags&10256)!==0||!1)),E&2048&&Ef(U,o);break;case 24:Ei(a,o,h,y),E&2048&&sl(o.alternate,o);break;default:Ei(a,o,h,y)}}function ao(a,o,h,y,E){for(E=E&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var M=a,U=o,J=h,ae=y,ye=U.flags;switch(U.tag){case 0:case 11:case 15:ao(M,U,J,ae,E),Ts(8,U);break;case 23:break;case 22:var we=U.stateNode;U.memoizedState!==null?we._visibility&2?ao(M,U,J,ae,E):Gc(M,U):(we._visibility|=2,ao(M,U,J,ae,E)),E&&ye&2048&&Ef(U.alternate,U);break;case 24:ao(M,U,J,ae,E),E&&ye&2048&&sl(U.alternate,U);break;default:ao(M,U,J,ae,E)}o=o.sibling}}function Gc(a,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var h=a,y=o,E=y.flags;switch(y.tag){case 22:Gc(h,y),E&2048&&Ef(y.alternate,y);break;case 24:Gc(h,y),E&2048&&sl(y.alternate,y);break;default:Gc(h,y)}o=o.sibling}}var $n=8192;function Go(a,o,h){if(a.subtreeFlags&$n)for(a=a.child;a!==null;)ii(a,o,h),a=a.sibling}function ii(a,o,h){switch(a.tag){case 26:Go(a,o,h),a.flags&$n&&a.memoizedState!==null&&N3(h,kr,a.memoizedState,a.memoizedProps);break;case 5:Go(a,o,h);break;case 3:case 4:var y=kr;kr=py(a.stateNode.containerInfo),Go(a,o,h),kr=y;break;case 22:a.memoizedState===null&&(y=a.alternate,y!==null&&y.memoizedState!==null?(y=$n,$n=16777216,Go(a,o,h),$n=y):Go(a,o,h));break;default:Go(a,o,h)}}function Nr(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 gr(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var h=0;h<o.length;h++){var y=o[h];Xn=y,td(y,a)}Nr(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)qo(a),a=a.sibling}function qo(a){switch(a.tag){case 0:case 11:case 15:gr(a),a.flags&2048&&Ea(9,a,a.return);break;case 3:gr(a);break;case 12:gr(a);break;case 22:var o=a.stateNode;a.memoizedState!==null&&o._visibility&2&&(a.return===null||a.return.tag!==13)?(o._visibility&=-3,wf(a)):gr(a);break;default:gr(a)}}function wf(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var h=0;h<o.length;h++){var y=o[h];Xn=y,td(y,a)}Nr(a)}for(a=a.child;a!==null;){switch(o=a,o.tag){case 0:case 11:case 15:Ea(8,o,o.return),wf(o);break;case 22:h=o.stateNode,h._visibility&2&&(h._visibility&=-3,wf(o));break;default:wf(o)}a=a.sibling}}function td(a,o){for(;Xn!==null;){var h=Xn;switch(h.tag){case 0:case 11:case 15:Ea(8,h,o);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var y=h.memoizedState.cachePool.pool;y!=null&&y.refCount++}break;case 24:Ii(h.memoizedState.cache)}if(y=h.child,y!==null)y.return=h,Xn=y;else e:for(h=a;Xn!==null;){y=Xn;var E=y.sibling,M=y.return;if(_f(y),y===h){Xn=null;break e}if(E!==null){E.return=M,Xn=E;break e}Xn=M}}}var Tf={getCacheForType:function(a){var o=Ni(Je),h=o.data.get(a);return h===void 0&&(h=a(),o.data.set(a,h)),h},cacheSignal:function(){return Ni(Je).controller.signal}},Cf=typeof WeakMap=="function"?WeakMap:Map,jt=0,cn=null,Et=null,Dt=0,et=0,Rt=null,xt=!1,Tt=!1,xn=!1,ri=0,un=0,ia=0,ll=0,Xa=0,It=0,ra=0,Ka=null,nr=null,Or=!1,ol=0,qc=0,aa=1/0,Yc=null,Ms=null,Fn=0,$a=null,sa=null,Ca=0,cl=0,Yo=null,Af=null,Vo=0,Xo=null;function yr(){return(jt&2)!==0&&Dt!==0?Dt&-Dt:z.T!==null?Lx():lr()}function u(){if(It===0)if((Dt&536870912)===0||zt){var a=Ba;Ba<<=1,(Ba&3932160)===0&&(Ba=262144),It=a}else It=536870912;return a=Si.current,a!==null&&(a.flags|=32),It}function d(a,o,h){(a===cn&&(et===2||et===9)||a.cancelPendingCommit!==null)&&(pe(a,0),B(a,Dt,It,!1)),rn(a,h),((jt&2)===0||a!==cn)&&(a===cn&&((jt&2)===0&&(ll|=h),un===4&&B(a,Dt,It,!1)),so(a))}function b(a,o,h){if((jt&6)!==0)throw Error(i(327));var y=!h&&(o&127)===0&&(o&a.expiredLanes)===0||Te(a,o),E=y?Ko(a,o):Dr(a,o,!0),M=y;do{if(E===0){Tt&&!y&&B(a,o,0,!1);break}else{if(h=a.current.alternate,M&&!k(h)){E=Dr(a,o,!1),M=!1;continue}if(E===2){if(M=o,a.errorRecoveryDisabledLanes&M)var U=0;else U=a.pendingLanes&-536870913,U=U!==0?U:U&536870912?536870912:0;if(U!==0){o=U;e:{var J=a;E=Ka;var ae=J.current.memoizedState.isDehydrated;if(ae&&(pe(J,U).flags|=256),U=Dr(J,U,!1),U!==2){if(xn&&!ae){J.errorRecoveryDisabledLanes|=M,ll|=M,E=4;break e}M=nr,nr=E,M!==null&&(nr===null?nr=M:nr.push.apply(nr,M))}E=U}if(M=!1,E!==2)continue}}if(E===1){pe(a,0),B(a,o,0,!0);break}e:{switch(y=a,M=E,M){case 0:case 1:throw Error(i(345));case 4:if((o&4194048)!==o)break;case 6:B(y,o,It,!xt);break e;case 2:nr=null;break;case 3:case 5:break;default:throw Error(i(329))}if((o&62914560)===o&&(E=ol+300-Wt(),10<E)){if(B(y,o,It,!xt),se(y,0,!0)!==0)break e;Ca=o,y.timeoutHandle=xS(w.bind(null,y,h,nr,Yc,Or,o,It,ll,ra,xt,M,"Throttled",-0,0),E);break e}w(y,h,nr,Yc,Or,o,It,ll,ra,xt,M,null,-0,0)}}break}while(!0);so(a)}function w(a,o,h,y,E,M,U,J,ae,ye,we,Me,ve,Se){if(a.timeoutHandle=-1,Me=o.subtreeFlags,Me&8192||(Me&16785408)===16785408){Me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Be},ii(o,M,Me);var Xe=(M&62914560)===M?ol-Wt():(M&4194048)===M?qc-Wt():0;if(Xe=O3(Me,Xe),Xe!==null){Ca=M,a.cancelPendingCommit=Xe(ft.bind(null,a,o,M,h,y,E,U,J,ae,we,Me,null,ve,Se)),B(a,M,U,!ye);return}}ft(a,o,M,h,y,E,U,J,ae)}function k(a){for(var o=a;;){var h=o.tag;if((h===0||h===11||h===15)&&o.flags&16384&&(h=o.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var y=0;y<h.length;y++){var E=h[y],M=E.getSnapshot;E=E.value;try{if(!On(M(),E))return!1}catch{return!1}}if(h=o.child,o.subtreeFlags&16384&&h!==null)h.return=o,o=h;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 B(a,o,h,y){o&=~Xa,o&=~ll,a.suspendedLanes|=o,a.pingedLanes&=~o,y&&(a.warmLanes|=o),y=a.expirationTimes;for(var E=o;0<E;){var M=31-Pt(E),U=1<<M;y[M]=-1,E&=~U}h!==0&&Ge(a,h,o)}function te(){return(jt&6)===0?(jp(0),!1):!0}function re(){if(Et!==null){if(et===0)var a=Et.return;else a=Et,Qi=$s=null,hp(a),Kl=null,$l=0,a=Et;for(;a!==null;)Po(a.alternate,a),a=a.return;Et=null}}function pe(a,o){var h=a.timeoutHandle;h!==-1&&(a.timeoutHandle=-1,p3(h)),h=a.cancelPendingCommit,h!==null&&(a.cancelPendingCommit=null,h()),Ca=0,re(),cn=a,Et=h=ms(a.current,null),Dt=o,et=0,Rt=null,xt=!1,Tt=Te(a,o),xn=!1,ra=It=Xa=ll=ia=un=0,nr=Ka=null,Or=!1,(o&8)!==0&&(o|=o&32);var y=a.entangledLanes;if(y!==0)for(a=a.entanglements,y&=o;0<y;){var E=31-Pt(y),M=1<<E;o|=a[E],y&=~M}return ri=o,Pl(),h}function Ce(a,o){dt=null,z.H=Gu,o===Xl||o===Ga?(o=ef(),et=3):o===Du?(o=ef(),et=4):et=o===xf?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Rt=o,Et===null&&(un=1,yf(a,wr(o,a.current)))}function De(){var a=Si.current;return a===null?!0:(Dt&4194048)===Dt?va===null:(Dt&62914560)===Dt||(Dt&536870912)!==0?a===va:!1}function Fe(){var a=z.H;return z.H=Gu,a===null?Gu:a}function qe(){var a=z.A;return z.A=Tf,a}function mt(){un=4,xt||(Dt&4194048)!==Dt&&Si.current!==null||(Tt=!0),(ia&134217727)===0&&(ll&134217727)===0||cn===null||B(cn,Dt,It,!1)}function Dr(a,o,h){var y=jt;jt|=2;var E=Fe(),M=qe();(cn!==a||Dt!==o)&&(Yc=null,pe(a,o)),o=!1;var U=un;e:do try{if(et!==0&&Et!==null){var J=Et,ae=Rt;switch(et){case 8:re(),U=6;break e;case 3:case 2:case 9:case 6:Si.current===null&&(o=!0);var ye=et;if(et=0,Rt=null,Oe(a,J,ae,ye),h&&Tt){U=0;break e}break;default:ye=et,et=0,Rt=null,Oe(a,J,ae,ye)}}nd(),U=un;break}catch(we){Ce(a,we)}while(!0);return o&&a.shellSuspendCounter++,Qi=$s=null,jt=y,z.H=E,z.A=M,Et===null&&(cn=null,Dt=0,Pl()),U}function nd(){for(;Et!==null;)fe(Et)}function Ko(a,o){var h=jt;jt|=2;var y=Fe(),E=qe();cn!==a||Dt!==o?(Yc=null,aa=Wt()+500,pe(a,o)):Tt=Te(a,o);e:do try{if(et!==0&&Et!==null){o=Et;var M=Rt;t:switch(et){case 1:et=0,Rt=null,Oe(a,o,M,1);break;case 2:case 9:if(Dg(M)){et=0,Rt=null,_e(o);break}o=function(){et!==2&&et!==9||cn!==a||(et=7),so(a)},M.then(o,o);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Dg(M)?(et=0,Rt=null,_e(o)):(et=0,Rt=null,Oe(a,o,M,7));break;case 5:var U=null;switch(Et.tag){case 26:U=Et.memoizedState;case 5:case 27:var J=Et;if(U?DS(U):J.stateNode.complete){et=0,Rt=null;var ae=J.sibling;if(ae!==null)Et=ae;else{var ye=J.return;ye!==null?(Et=ye,Ze(ye)):Et=null}break t}}et=0,Rt=null,Oe(a,o,M,5);break;case 6:et=0,Rt=null,Oe(a,o,M,6);break;case 8:re(),un=6;break e;default:throw Error(i(462))}}be();break}catch(we){Ce(a,we)}while(!0);return Qi=$s=null,z.H=y,z.A=E,jt=h,Et!==null?0:(cn=null,Dt=0,Pl(),un)}function be(){for(;Et!==null&&!Ur();)fe(Et)}function fe(a){var o=bf(a.alternate,a,ri);a.memoizedProps=a.pendingProps,o===null?Ze(a):Et=o}function _e(a){var o=a,h=o.alternate;switch(o.tag){case 15:case 0:o=Ji(h,o,o.pendingProps,o.type,void 0,Dt);break;case 11:o=Ji(h,o,o.pendingProps,o.type.render,o.ref,Dt);break;case 5:hp(o);default:Po(h,o),o=Et=Wi(o,ri),o=bf(h,o,ri)}a.memoizedProps=a.pendingProps,o===null?Ze(a):Et=o}function Oe(a,o,h,y){Qi=$s=null,hp(o),Kl=null,$l=0;var E=o.return;try{if(Wr(a,E,o,h,Dt)){un=1,yf(a,wr(h,a.current)),Et=null;return}}catch(M){if(E!==null)throw Et=E,M;un=1,yf(a,wr(h,a.current)),Et=null;return}o.flags&32768?(zt||y===1?a=!0:Tt||(Dt&536870912)!==0?a=!1:(xt=a=!0,(y===2||y===9||y===3||y===6)&&(y=Si.current,y!==null&&y.tag===13&&(y.flags|=16384))),wn(o,a)):Ze(o)}function Ze(a){var o=a;do{if((o.flags&32768)!==0){wn(o,xt);return}a=o.return;var h=zp(o.alternate,o,ri);if(h!==null){Et=h;return}if(o=o.sibling,o!==null){Et=o;return}Et=o=a}while(o!==null);un===0&&(un=5)}function wn(a,o){do{var h=vf(a.alternate,a);if(h!==null){h.flags&=32767,Et=h;return}if(h=a.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!o&&(a=a.sibling,a!==null)){Et=a;return}Et=a=h}while(a!==null);un=6,Et=null}function ft(a,o,h,y,E,M,U,J,ae){a.cancelPendingCommit=null;do Mf();while(Fn!==0);if((jt&6)!==0)throw Error(i(327));if(o!==null){if(o===a.current)throw Error(i(177));if(M=o.lanes|o.childLanes,M|=Vd,Ye(a,h,M,U,J,ae),a===cn&&(Et=cn=null,Dt=0),sa=o,$a=a,Ca=h,cl=M,Yo=E,Af=y,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,t3(oe,function(){return tS(),null})):(a.callbackNode=null,a.callbackPriority=0),y=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||y){y=z.T,z.T=null,E=K.p,K.p=2,U=jt,jt|=4;try{Fc(a,o,h)}finally{jt=U,K.p=E,z.T=y}}Fn=1,Yt(),wi(),Vt()}}function Yt(){if(Fn===1){Fn=0;var a=$a,o=sa,h=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||h){h=z.T,z.T=null;var y=K.p;K.p=2;var E=jt;jt|=4;try{ro(o,a);var M=qx,U=Pd(a.containerInfo),J=M.focusedElem,ae=M.selectionRange;if(U!==J&&J&&J.ownerDocument&&Hd(J.ownerDocument.documentElement,J)){if(ae!==null&&_c(J)){var ye=ae.start,we=ae.end;if(we===void 0&&(we=ye),"selectionStart"in J)J.selectionStart=ye,J.selectionEnd=Math.min(we,J.value.length);else{var Me=J.ownerDocument||document,ve=Me&&Me.defaultView||window;if(ve.getSelection){var Se=ve.getSelection(),Xe=J.textContent.length,ut=Math.min(ae.start,Xe),Cn=ae.end===void 0?ut:Math.min(ae.end,Xe);!Se.extend&&ut>Cn&&(U=Cn,Cn=ut,ut=U);var he=Fh(J,ut),ue=Fh(J,Cn);if(he&&ue&&(Se.rangeCount!==1||Se.anchorNode!==he.node||Se.anchorOffset!==he.offset||Se.focusNode!==ue.node||Se.focusOffset!==ue.offset)){var ge=Me.createRange();ge.setStart(he.node,he.offset),Se.removeAllRanges(),ut>Cn?(Se.addRange(ge),Se.extend(ue.node,ue.offset)):(ge.setEnd(ue.node,ue.offset),Se.addRange(ge))}}}}for(Me=[],Se=J;Se=Se.parentNode;)Se.nodeType===1&&Me.push({element:Se,left:Se.scrollLeft,top:Se.scrollTop});for(typeof J.focus=="function"&&J.focus(),J=0;J<Me.length;J++){var Ae=Me[J];Ae.element.scrollLeft=Ae.left,Ae.element.scrollTop=Ae.top}}vy=!!Gx,qx=Gx=null}finally{jt=E,K.p=y,z.T=h}}a.current=o,Fn=2}}function wi(){if(Fn===2){Fn=0;var a=$a,o=sa,h=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||h){h=z.T,z.T=null;var y=K.p;K.p=2;var E=jt;jt|=4;try{sy(a,o.alternate,o)}finally{jt=E,K.p=y,z.T=h}}Fn=3}}function Vt(){if(Fn===4||Fn===3){Fn=0,Ci();var a=$a,o=sa,h=Ca,y=Af;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Fn=5:(Fn=0,sa=$a=null,ul(a,a.pendingLanes));var E=a.pendingLanes;if(E===0&&(Ms=null),ga(h),o=o.stateNode,Zt&&typeof Zt.onCommitFiberRoot=="function")try{Zt.onCommitFiberRoot(Qt,o,void 0,(o.current.flags&128)===128)}catch{}if(y!==null){o=z.T,E=K.p,K.p=2,z.T=null;try{for(var M=a.onRecoverableError,U=0;U<y.length;U++){var J=y[U];M(J.value,{componentStack:J.stack})}}finally{z.T=o,K.p=E}}(Ca&3)!==0&&Mf(),so(a),E=a.pendingLanes,(h&261930)!==0&&(E&42)!==0?a===Xo?Vo++:(Vo=0,Xo=a):Vo=0,jp(0)}}function ul(a,o){(a.pooledCacheLanes&=o)===0&&(o=a.pooledCache,o!=null&&(a.pooledCache=null,Ii(o)))}function Mf(){return Yt(),wi(),Vt(),tS()}function tS(){if(Fn!==5)return!1;var a=$a,o=cl;cl=0;var h=ga(Ca),y=z.T,E=K.p;try{K.p=32>h?32:h,z.T=null,h=Yo,Yo=null;var M=$a,U=Ca;if(Fn=0,sa=$a=null,Ca=0,(jt&6)!==0)throw Error(i(331));var J=jt;if(jt|=4,qo(M.current),Pn(M,M.current,U,h),jt=J,jp(0,!1),Zt&&typeof Zt.onPostCommitFiberRoot=="function")try{Zt.onPostCommitFiberRoot(Qt,M)}catch{}return!0}finally{K.p=E,z.T=y,ul(a,o)}}function nS(a,o,h){o=wr(h,o),o=Dp(a.stateNode,o,2),a=Js(a,o,2),a!==null&&(rn(a,2),so(a))}function vn(a,o,h){if(a.tag===3)nS(a,a,h);else for(;o!==null;){if(o.tag===3){nS(o,a,h);break}else if(o.tag===1){var y=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Ms===null||!Ms.has(y))){a=wr(h,a),h=jc(2),y=Js(o,h,2),y!==null&&(Mr(h,y,o,a),rn(y,2),so(y));break}}o=o.return}}function Dx(a,o,h){var y=a.pingCache;if(y===null){y=a.pingCache=new Cf;var E=new Set;y.set(o,E)}else E=y.get(o),E===void 0&&(E=new Set,y.set(o,E));E.has(h)||(xn=!0,E.add(h),a=ZN.bind(null,a,o,h),o.then(a,a))}function ZN(a,o,h){var y=a.pingCache;y!==null&&y.delete(o),a.pingedLanes|=a.suspendedLanes&h,a.warmLanes&=~h,cn===a&&(Dt&h)===h&&(un===4||un===3&&(Dt&62914560)===Dt&&300>Wt()-ol?(jt&2)===0&&pe(a,0):Xa|=h,ra===Dt&&(ra=0)),so(a)}function iS(a,o){o===0&&(o=tt()),a=Fl(a,o),a!==null&&(rn(a,o),so(a))}function JN(a){var o=a.memoizedState,h=0;o!==null&&(h=o.retryLane),iS(a,h)}function e3(a,o){var h=0;switch(a.tag){case 31:case 13:var y=a.stateNode,E=a.memoizedState;E!==null&&(h=E.retryLane);break;case 19:y=a.stateNode;break;case 22:y=a.stateNode._retryCache;break;default:throw Error(i(314))}y!==null&&y.delete(o),iS(a,h)}function t3(a,o){return hn(a,o)}var cy=null,Rf=null,zx=!1,uy=!1,Bx=!1,Vc=0;function so(a){a!==Rf&&a.next===null&&(Rf===null?cy=Rf=a:Rf=Rf.next=a),uy=!0,zx||(zx=!0,i3())}function jp(a,o){if(!Bx&&uy){Bx=!0;do for(var h=!1,y=cy;y!==null;){if(a!==0){var E=y.pendingLanes;if(E===0)var M=0;else{var U=y.suspendedLanes,J=y.pingedLanes;M=(1<<31-Pt(42|a)+1)-1,M&=E&~(U&~J),M=M&201326741?M&201326741|1:M?M|2:0}M!==0&&(h=!0,lS(y,M))}else M=Dt,M=se(y,y===cn?M:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(M&3)===0||Te(y,M)||(h=!0,lS(y,M));y=y.next}while(h);Bx=!1}}function n3(){rS()}function rS(){uy=zx=!1;var a=0;Vc!==0&&h3()&&(a=Vc);for(var o=Wt(),h=null,y=cy;y!==null;){var E=y.next,M=aS(y,o);M===0?(y.next=null,h===null?cy=E:h.next=E,E===null&&(Rf=h)):(h=y,(a!==0||(M&3)!==0)&&(uy=!0)),y=E}Fn!==0&&Fn!==5||jp(a),Vc!==0&&(Vc=0)}function aS(a,o){for(var h=a.suspendedLanes,y=a.pingedLanes,E=a.expirationTimes,M=a.pendingLanes&-62914561;0<M;){var U=31-Pt(M),J=1<<U,ae=E[U];ae===-1?((J&h)===0||(J&y)!==0)&&(E[U]=Le(J,o)):ae<=o&&(a.expiredLanes|=J),M&=~J}if(o=cn,h=Dt,h=se(a,a===o?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),y=a.callbackNode,h===0||a===o&&(et===2||et===9)||a.cancelPendingCommit!==null)return y!==null&&y!==null&&oi(y),a.callbackNode=null,a.callbackPriority=0;if((h&3)===0||Te(a,h)){if(o=h&-h,o===a.callbackPriority)return o;switch(y!==null&&oi(y),ga(h)){case 2:case 8:h=ke;break;case 32:h=oe;break;case 268435456:h=ct;break;default:h=oe}return y=sS.bind(null,a),h=hn(h,y),a.callbackPriority=o,a.callbackNode=h,o}return y!==null&&y!==null&&oi(y),a.callbackPriority=2,a.callbackNode=null,2}function sS(a,o){if(Fn!==0&&Fn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var h=a.callbackNode;if(Mf()&&a.callbackNode!==h)return null;var y=Dt;return y=se(a,a===cn?y:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),y===0?null:(b(a,y,o),aS(a,Wt()),a.callbackNode!=null&&a.callbackNode===h?sS.bind(null,a):null)}function lS(a,o){if(Mf())return null;b(a,o,!0)}function i3(){m3(function(){(jt&6)!==0?hn(Ee,n3):rS()})}function Lx(){if(Vc===0){var a=Zs;a===0&&(a=ls,ls<<=1,(ls&261888)===0&&(ls=256)),Vc=a}return Vc}function oS(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Fs(""+a)}function cS(a,o){var h=o.ownerDocument.createElement("input");return h.name=o.name,h.value=o.value,a.id&&h.setAttribute("form",a.id),o.parentNode.insertBefore(h,o),a=new FormData(a),h.parentNode.removeChild(h),a}function r3(a,o,h,y,E){if(o==="submit"&&h&&h.stateNode===E){var M=oS((E[ui]||null).action),U=y.submitter;U&&(o=(o=U[ui]||null)?oS(o.formAction):U.getAttribute("formAction"),o!==null&&(M=o,U=null));var J=new xu("action","action",null,y,E);a.push({event:J,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(Vc!==0){var ae=U?cS(E,U):new FormData(E);Mp(h,{pending:!0,data:ae,method:E.method,action:M},null,ae)}}else typeof M=="function"&&(J.preventDefault(),ae=U?cS(E,U):new FormData(E),Mp(h,{pending:!0,data:ae,method:E.method,action:M},M,ae))},currentTarget:E}]})}}for(var jx=0;jx<Yd.length;jx++){var Ix=Yd[jx],a3=Ix.toLowerCase(),s3=Ix[0].toUpperCase()+Ix.slice(1);$i(a3,"on"+s3)}$i(Er,"onAnimationEnd"),$i(Gh,"onAnimationIteration"),$i(ps,"onAnimationStart"),$i("dblclick","onDoubleClick"),$i("focusin","onFocus"),$i("focusout","onBlur"),$i(Tc,"onTransitionRun"),$i(Ul,"onTransitionStart"),$i(qh,"onTransitionCancel"),$i(qd,"onTransitionEnd"),Ne("onMouseEnter",["mouseout","mouseover"]),Ne("onMouseLeave",["mouseout","mouseover"]),Ne("onPointerEnter",["pointerout","pointerover"]),Ne("onPointerLeave",["pointerout","pointerover"]),Fr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Fr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Fr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Fr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Fr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Fr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ip="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(" "),l3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ip));function uS(a,o){o=(o&4)!==0;for(var h=0;h<a.length;h++){var y=a[h],E=y.event;y=y.listeners;e:{var M=void 0;if(o)for(var U=y.length-1;0<=U;U--){var J=y[U],ae=J.instance,ye=J.currentTarget;if(J=J.listener,ae!==M&&E.isPropagationStopped())break e;M=J,E.currentTarget=ye;try{M(E)}catch(we){Hl(we)}E.currentTarget=null,M=ae}else for(U=0;U<y.length;U++){if(J=y[U],ae=J.instance,ye=J.currentTarget,J=J.listener,ae!==M&&E.isPropagationStopped())break e;M=J,E.currentTarget=ye;try{M(E)}catch(we){Hl(we)}E.currentTarget=null,M=ae}}}}function Bt(a,o){var h=o[Us];h===void 0&&(h=o[Us]=new Set);var y=a+"__bubble";h.has(y)||(dS(o,a,2,!1),h.add(y))}function Ux(a,o,h){var y=0;o&&(y|=4),dS(h,a,y,o)}var dy="_reactListening"+Math.random().toString(36).slice(2);function Hx(a){if(!a[dy]){a[dy]=!0,Sr.forEach(function(h){h!=="selectionchange"&&(l3.has(h)||Ux(h,!1,a),Ux(h,!0,a))});var o=a.nodeType===9?a:a.ownerDocument;o===null||o[dy]||(o[dy]=!0,Ux("selectionchange",!1,o))}}function dS(a,o,h,y){switch(HS(o)){case 2:var E=B3;break;case 8:E=L3;break;default:E=tb}h=E.bind(null,o,h,a),E=void 0,!kd||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(E=!0),y?E!==void 0?a.addEventListener(o,h,{capture:!0,passive:E}):a.addEventListener(o,h,!0):E!==void 0?a.addEventListener(o,h,{passive:E}):a.addEventListener(o,h,!1)}function Px(a,o,h,y,E){var M=y;if((o&1)===0&&(o&2)===0&&y!==null)e:for(;;){if(y===null)return;var U=y.tag;if(U===3||U===4){var J=y.stateNode.containerInfo;if(J===E)break;if(U===4)for(U=y.return;U!==null;){var ae=U.tag;if((ae===3||ae===4)&&U.stateNode.containerInfo===E)return;U=U.return}for(;J!==null;){if(U=an(J),U===null)return;if(ae=U.tag,ae===5||ae===6||ae===26||ae===27){y=M=U;continue e}J=J.parentNode}}y=y.return}mu(function(){var ye=M,we=yt(h),Me=[];e:{var ve=Ys.get(a);if(ve!==void 0){var Se=xu,Xe=a;switch(a){case"keypress":if(wo(h)===0)break e;case"keydown":case"keyup":Se=Oh;break;case"focusin":Xe="focus",Se=Bd;break;case"focusout":Xe="blur",Se=Bd;break;case"beforeblur":case"afterblur":Se=Bd;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Se=ug;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Se=dg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Se=Gs;break;case Er:case Gh:case ps:Se=pg;break;case qd:Se=Tx;break;case"scroll":case"scrollend":Se=Dd;break;case"wheel":Se=Dl;break;case"copy":case"cut":case"paste":Se=Ah;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Se=Ld;break;case"toggle":case"beforetoggle":Se=zh}var ut=(o&4)!==0,Cn=!ut&&(a==="scroll"||a==="scrollend"),he=ut?ve!==null?ve+"Capture":null:ve;ut=[];for(var ue=ye,ge;ue!==null;){var Ae=ue;if(ge=Ae.stateNode,Ae=Ae.tag,Ae!==5&&Ae!==26&&Ae!==27||ge===null||he===null||(Ae=Eo(ue,he),Ae!=null&&ut.push(Up(ue,Ae,ge))),Cn)break;ue=ue.return}0<ut.length&&(ve=new Se(ve,Xe,null,h,we),Me.push({event:ve,listeners:ut}))}}if((o&7)===0){e:{if(ve=a==="mouseover"||a==="pointerover",Se=a==="mouseout"||a==="pointerout",ve&&h!==Ve&&(Xe=h.relatedTarget||h.fromElement)&&(an(Xe)||Xe[Hr]))break e;if((Se||ve)&&(ve=we.window===we?we:(ve=we.ownerDocument)?ve.defaultView||ve.parentWindow:window,Se?(Xe=h.relatedTarget||h.toElement,Se=ye,Xe=Xe?an(Xe):null,Xe!==null&&(Cn=s(Xe),ut=Xe.tag,Xe!==Cn||ut!==5&&ut!==27&&ut!==6)&&(Xe=null)):(Se=null,Xe=ye),Se!==Xe)){if(ut=ug,Ae="onMouseLeave",he="onMouseEnter",ue="mouse",(a==="pointerout"||a==="pointerover")&&(ut=Ld,Ae="onPointerLeave",he="onPointerEnter",ue="pointer"),Cn=Se==null?ve:cr(Se),ge=Xe==null?ve:cr(Xe),ve=new ut(Ae,ue+"leave",Se,h,we),ve.target=Cn,ve.relatedTarget=ge,Ae=null,an(we)===ye&&(ut=new ut(he,ue+"enter",Xe,h,we),ut.target=ge,ut.relatedTarget=Cn,Ae=ut),Cn=Ae,Se&&Xe)t:{for(ut=o3,he=Se,ue=Xe,ge=0,Ae=he;Ae;Ae=ut(Ae))ge++;Ae=0;for(var it=ue;it;it=ut(it))Ae++;for(;0<ge-Ae;)he=ut(he),ge--;for(;0<Ae-ge;)ue=ut(ue),Ae--;for(;ge--;){if(he===ue||ue!==null&&he===ue.alternate){ut=he;break t}he=ut(he),ue=ut(ue)}ut=null}else ut=null;Se!==null&&fS(Me,ve,Se,ut,!1),Xe!==null&&Cn!==null&&fS(Me,Cn,Xe,ut,!0)}}e:{if(ve=ye?cr(ye):window,Se=ve.nodeName&&ve.nodeName.toLowerCase(),Se==="select"||Se==="input"&&ve.type==="file")var dn=Uh;else if(jh(ve))if(wu)dn=Tg;else{dn=Ll;var $e=Tu}else Se=ve.nodeName,!Se||Se.toLowerCase()!=="input"||ve.type!=="checkbox"&&ve.type!=="radio"?ye&&ds(ye.elementType)&&(dn=Uh):dn=wg;if(dn&&(dn=dn(a,ye))){Ud(Me,dn,h,we);break e}$e&&$e(a,ve,ye),a==="focusout"&&ye&&ve.type==="number"&&ye.memoizedProps.value!=null&&Ps(ve,"number",ve.value)}switch($e=ye?cr(ye):window,a){case"focusin":(jh($e)||$e.contentEditable==="true")&&(Sc=$e,Fd=ye,Ec=null);break;case"focusout":Ec=Fd=Sc=null;break;case"mousedown":Yr=!0;break;case"contextmenu":case"mouseup":case"dragend":Yr=!1,Gd(Me,h,we);break;case"selectionchange":if(Cg)break;case"keydown":case"keyup":Gd(Me,h,we)}var Ct;if(To)e:{switch(a){case"compositionstart":var Ut="onCompositionStart";break e;case"compositionend":Ut="onCompositionEnd";break e;case"compositionupdate":Ut="onCompositionUpdate";break e}Ut=void 0}else Bl?jd(a,h)&&(Ut="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(Ut="onCompositionStart");Ut&&(ji&&h.locale!=="ko"&&(Bl||Ut!=="onCompositionStart"?Ut==="onCompositionEnd"&&Bl&&(Ct=Od()):(kl=we,Nd="value"in kl?kl.value:kl.textContent,Bl=!0)),$e=fy(ye,Ut),0<$e.length&&(Ut=new Mh(Ut,a,null,h,we),Me.push({event:Ut,listeners:$e}),Ct?Ut.data=Ct:(Ct=gc(h),Ct!==null&&(Ut.data=Ct)))),(Ct=Co?Id(a,h):_g(a,h))&&(Ut=fy(ye,"onBeforeInput"),0<Ut.length&&($e=new Mh("onBeforeInput","beforeinput",null,h,we),Me.push({event:$e,listeners:Ut}),$e.data=Ct)),r3(Me,a,ye,h,we)}uS(Me,o)})}function Up(a,o,h){return{instance:a,listener:o,currentTarget:h}}function fy(a,o){for(var h=o+"Capture",y=[];a!==null;){var E=a,M=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||M===null||(E=Eo(a,h),E!=null&&y.unshift(Up(a,E,M)),E=Eo(a,o),E!=null&&y.push(Up(a,E,M))),a.tag===3)return y;a=a.return}return[]}function o3(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function fS(a,o,h,y,E){for(var M=o._reactName,U=[];h!==null&&h!==y;){var J=h,ae=J.alternate,ye=J.stateNode;if(J=J.tag,ae!==null&&ae===y)break;J!==5&&J!==26&&J!==27||ye===null||(ae=ye,E?(ye=Eo(h,M),ye!=null&&U.unshift(Up(h,ye,ae))):E||(ye=Eo(h,M),ye!=null&&U.push(Up(h,ye,ae)))),h=h.return}U.length!==0&&a.push({event:o,listeners:U})}var c3=/\r\n?/g,u3=/\u0000|\uFFFD/g;function hS(a){return(typeof a=="string"?a:""+a).replace(c3,`
50
- `).replace(u3,"")}function pS(a,o){return o=hS(o),hS(a)===o}function Tn(a,o,h,y,E,M){switch(h){case"children":typeof y=="string"?o==="body"||o==="textarea"&&y===""||rt(a,y):(typeof y=="number"||typeof y=="bigint")&&o!=="body"&&rt(a,""+y);break;case"className":Xi(a,"class",y);break;case"tabIndex":Xi(a,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":Xi(a,h,y);break;case"style":ln(a,y,M);break;case"data":if(o!=="object"){Xi(a,"data",y);break}case"src":case"href":if(y===""&&(o!=="a"||h!=="href")){a.removeAttribute(h);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){a.removeAttribute(h);break}y=Fs(""+y),a.setAttribute(h,y);break;case"action":case"formAction":if(typeof y=="function"){a.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof M=="function"&&(h==="formAction"?(o!=="input"&&Tn(a,o,"name",E.name,E,null),Tn(a,o,"formEncType",E.formEncType,E,null),Tn(a,o,"formMethod",E.formMethod,E,null),Tn(a,o,"formTarget",E.formTarget,E,null)):(Tn(a,o,"encType",E.encType,E,null),Tn(a,o,"method",E.method,E,null),Tn(a,o,"target",E.target,E,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){a.removeAttribute(h);break}y=Fs(""+y),a.setAttribute(h,y);break;case"onClick":y!=null&&(a.onclick=Be);break;case"onScroll":y!=null&&Bt("scroll",a);break;case"onScrollEnd":y!=null&&Bt("scrollend",a);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(i(61));if(h=y.__html,h!=null){if(E.children!=null)throw Error(i(60));a.innerHTML=h}}break;case"multiple":a.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":a.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){a.removeAttribute("xlink:href");break}h=Fs(""+y),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":y!=null&&typeof y!="function"&&typeof y!="symbol"?a.setAttribute(h,""+y):a.removeAttribute(h);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":y&&typeof y!="function"&&typeof y!="symbol"?a.setAttribute(h,""):a.removeAttribute(h);break;case"capture":case"download":y===!0?a.setAttribute(h,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?a.setAttribute(h,y):a.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?a.setAttribute(h,y):a.removeAttribute(h);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?a.removeAttribute(h):a.setAttribute(h,y);break;case"popover":Bt("beforetoggle",a),Bt("toggle",a),_i(a,"popover",y);break;case"xlinkActuate":Ai(a,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":Ai(a,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":Ai(a,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":Ai(a,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":Ai(a,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":Ai(a,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":Ai(a,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":Ai(a,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":Ai(a,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":_i(a,"is",y);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=fs.get(h)||h,_i(a,h,y))}}function Fx(a,o,h,y,E,M){switch(h){case"style":ln(a,y,M);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(i(61));if(h=y.__html,h!=null){if(E.children!=null)throw Error(i(60));a.innerHTML=h}}break;case"children":typeof y=="string"?rt(a,y):(typeof y=="number"||typeof y=="bigint")&&rt(a,""+y);break;case"onScroll":y!=null&&Bt("scroll",a);break;case"onScrollEnd":y!=null&&Bt("scrollend",a);break;case"onClick":y!=null&&(a.onclick=Be);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ya.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(E=h.endsWith("Capture"),o=h.slice(2,E?h.length-7:void 0),M=a[ui]||null,M=M!=null?M[h]:null,typeof M=="function"&&a.removeEventListener(o,M,E),typeof y=="function")){typeof M!="function"&&M!==null&&(h in a?a[h]=null:a.hasAttribute(h)&&a.removeAttribute(h)),a.addEventListener(o,y,E);break e}h in a?a[h]=y:y===!0?a.setAttribute(h,""):_i(a,h,y)}}}function xr(a,o,h){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Bt("error",a),Bt("load",a);var y=!1,E=!1,M;for(M in h)if(h.hasOwnProperty(M)){var U=h[M];if(U!=null)switch(M){case"src":y=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:Tn(a,o,M,U,h,null)}}E&&Tn(a,o,"srcSet",h.srcSet,h,null),y&&Tn(a,o,"src",h.src,h,null);return;case"input":Bt("invalid",a);var J=M=U=E=null,ae=null,ye=null;for(y in h)if(h.hasOwnProperty(y)){var we=h[y];if(we!=null)switch(y){case"name":E=we;break;case"type":U=we;break;case"checked":ae=we;break;case"defaultChecked":ye=we;break;case"value":M=we;break;case"defaultValue":J=we;break;case"children":case"dangerouslySetInnerHTML":if(we!=null)throw Error(i(137,o));break;default:Tn(a,o,y,we,h,null)}}us(a,M,J,ae,ye,U,E,!1);return;case"select":Bt("invalid",a),y=U=M=null;for(E in h)if(h.hasOwnProperty(E)&&(J=h[E],J!=null))switch(E){case"value":M=J;break;case"defaultValue":U=J;break;case"multiple":y=J;default:Tn(a,o,E,J,h,null)}o=M,h=U,a.multiple=!!y,o!=null?di(a,!!y,o,!1):h!=null&&di(a,!!y,h,!0);return;case"textarea":Bt("invalid",a),M=E=y=null;for(U in h)if(h.hasOwnProperty(U)&&(J=h[U],J!=null))switch(U){case"value":y=J;break;case"defaultValue":E=J;break;case"children":M=J;break;case"dangerouslySetInnerHTML":if(J!=null)throw Error(i(91));break;default:Tn(a,o,U,J,h,null)}Ia(a,y,E,M);return;case"option":for(ae in h)if(h.hasOwnProperty(ae)&&(y=h[ae],y!=null))switch(ae){case"selected":a.selected=y&&typeof y!="function"&&typeof y!="symbol";break;default:Tn(a,o,ae,y,h,null)}return;case"dialog":Bt("beforetoggle",a),Bt("toggle",a),Bt("cancel",a),Bt("close",a);break;case"iframe":case"object":Bt("load",a);break;case"video":case"audio":for(y=0;y<Ip.length;y++)Bt(Ip[y],a);break;case"image":Bt("error",a),Bt("load",a);break;case"details":Bt("toggle",a);break;case"embed":case"source":case"link":Bt("error",a),Bt("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(ye in h)if(h.hasOwnProperty(ye)&&(y=h[ye],y!=null))switch(ye){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:Tn(a,o,ye,y,h,null)}return;default:if(ds(o)){for(we in h)h.hasOwnProperty(we)&&(y=h[we],y!==void 0&&Fx(a,o,we,y,h,void 0));return}}for(J in h)h.hasOwnProperty(J)&&(y=h[J],y!=null&&Tn(a,o,J,y,h,null))}function d3(a,o,h,y){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,M=null,U=null,J=null,ae=null,ye=null,we=null;for(Se in h){var Me=h[Se];if(h.hasOwnProperty(Se)&&Me!=null)switch(Se){case"checked":break;case"value":break;case"defaultValue":ae=Me;default:y.hasOwnProperty(Se)||Tn(a,o,Se,null,y,Me)}}for(var ve in y){var Se=y[ve];if(Me=h[ve],y.hasOwnProperty(ve)&&(Se!=null||Me!=null))switch(ve){case"type":M=Se;break;case"name":E=Se;break;case"checked":ye=Se;break;case"defaultChecked":we=Se;break;case"value":U=Se;break;case"defaultValue":J=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(i(137,o));break;default:Se!==Me&&Tn(a,o,ve,Se,y,Me)}}cs(a,U,J,ae,ye,we,M,E);return;case"select":Se=U=J=ve=null;for(M in h)if(ae=h[M],h.hasOwnProperty(M)&&ae!=null)switch(M){case"value":break;case"multiple":Se=ae;default:y.hasOwnProperty(M)||Tn(a,o,M,null,y,ae)}for(E in y)if(M=y[E],ae=h[E],y.hasOwnProperty(E)&&(M!=null||ae!=null))switch(E){case"value":ve=M;break;case"defaultValue":J=M;break;case"multiple":U=M;default:M!==ae&&Tn(a,o,E,M,y,ae)}o=J,h=U,y=Se,ve!=null?di(a,!!h,ve,!1):!!y!=!!h&&(o!=null?di(a,!!h,o,!0):di(a,!!h,h?[]:"",!1));return;case"textarea":Se=ve=null;for(J in h)if(E=h[J],h.hasOwnProperty(J)&&E!=null&&!y.hasOwnProperty(J))switch(J){case"value":break;case"children":break;default:Tn(a,o,J,null,y,E)}for(U in y)if(E=y[U],M=h[U],y.hasOwnProperty(U)&&(E!=null||M!=null))switch(U){case"value":ve=E;break;case"defaultValue":Se=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(i(91));break;default:E!==M&&Tn(a,o,U,E,y,M)}pu(a,ve,Se);return;case"option":for(var Xe in h)if(ve=h[Xe],h.hasOwnProperty(Xe)&&ve!=null&&!y.hasOwnProperty(Xe))switch(Xe){case"selected":a.selected=!1;break;default:Tn(a,o,Xe,null,y,ve)}for(ae in y)if(ve=y[ae],Se=h[ae],y.hasOwnProperty(ae)&&ve!==Se&&(ve!=null||Se!=null))switch(ae){case"selected":a.selected=ve&&typeof ve!="function"&&typeof ve!="symbol";break;default:Tn(a,o,ae,ve,y,Se)}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 ut in h)ve=h[ut],h.hasOwnProperty(ut)&&ve!=null&&!y.hasOwnProperty(ut)&&Tn(a,o,ut,null,y,ve);for(ye in y)if(ve=y[ye],Se=h[ye],y.hasOwnProperty(ye)&&ve!==Se&&(ve!=null||Se!=null))switch(ye){case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(i(137,o));break;default:Tn(a,o,ye,ve,y,Se)}return;default:if(ds(o)){for(var Cn in h)ve=h[Cn],h.hasOwnProperty(Cn)&&ve!==void 0&&!y.hasOwnProperty(Cn)&&Fx(a,o,Cn,void 0,y,ve);for(we in y)ve=y[we],Se=h[we],!y.hasOwnProperty(we)||ve===Se||ve===void 0&&Se===void 0||Fx(a,o,we,ve,y,Se);return}}for(var he in h)ve=h[he],h.hasOwnProperty(he)&&ve!=null&&!y.hasOwnProperty(he)&&Tn(a,o,he,null,y,ve);for(Me in y)ve=y[Me],Se=h[Me],!y.hasOwnProperty(Me)||ve===Se||ve==null&&Se==null||Tn(a,o,Me,ve,y,Se)}function mS(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function f3(){if(typeof performance.getEntriesByType=="function"){for(var a=0,o=0,h=performance.getEntriesByType("resource"),y=0;y<h.length;y++){var E=h[y],M=E.transferSize,U=E.initiatorType,J=E.duration;if(M&&J&&mS(U)){for(U=0,J=E.responseEnd,y+=1;y<h.length;y++){var ae=h[y],ye=ae.startTime;if(ye>J)break;var we=ae.transferSize,Me=ae.initiatorType;we&&mS(Me)&&(ae=ae.responseEnd,U+=we*(ae<J?1:(J-ye)/(ae-ye)))}if(--y,o+=8*(M+U)/(E.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 Gx=null,qx=null;function hy(a){return a.nodeType===9?a:a.ownerDocument}function gS(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 yS(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 Yx(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 Vx=null;function h3(){var a=window.event;return a&&a.type==="popstate"?a===Vx?!1:(Vx=a,!0):(Vx=null,!1)}var xS=typeof setTimeout=="function"?setTimeout:void 0,p3=typeof clearTimeout=="function"?clearTimeout:void 0,bS=typeof Promise=="function"?Promise:void 0,m3=typeof queueMicrotask=="function"?queueMicrotask:typeof bS<"u"?function(a){return bS.resolve(null).then(a).catch(g3)}:xS;function g3(a){setTimeout(function(){throw a})}function Xc(a){return a==="head"}function vS(a,o){var h=o,y=0;do{var E=h.nextSibling;if(a.removeChild(h),E&&E.nodeType===8)if(h=E.data,h==="/$"||h==="/&"){if(y===0){a.removeChild(E),Df(o);return}y--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")y++;else if(h==="html")Hp(a.ownerDocument.documentElement);else if(h==="head"){h=a.ownerDocument.head,Hp(h);for(var M=h.firstChild;M;){var U=M.nextSibling,J=M.nodeName;M[La]||J==="SCRIPT"||J==="STYLE"||J==="LINK"&&M.rel.toLowerCase()==="stylesheet"||h.removeChild(M),M=U}}else h==="body"&&Hp(a.ownerDocument.body);h=E}while(h);Df(o)}function _S(a,o){var h=a;a=0;do{var y=h.nextSibling;if(h.nodeType===1?o?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(o?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),y&&y.nodeType===8)if(h=y.data,h==="/$"){if(a===0)break;a--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||a++;h=y}while(h)}function Xx(a){var o=a.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var h=o;switch(o=o.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Xx(h),Hs(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}a.removeChild(h)}}function y3(a,o,h,y){for(;a.nodeType===1;){var E=h;if(a.nodeName.toLowerCase()!==o.toLowerCase()){if(!y&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(y){if(!a[La])switch(o){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(M=a.getAttribute("rel"),M==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(M!==E.rel||a.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||a.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||a.getAttribute("title")!==(E.title==null?null:E.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(M=a.getAttribute("src"),(M!==(E.src==null?null:E.src)||a.getAttribute("type")!==(E.type==null?null:E.type)||a.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&M&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(o==="input"&&a.type==="hidden"){var M=E.name==null?null:""+E.name;if(E.type==="hidden"&&a.getAttribute("name")===M)return a}else return a;if(a=Rs(a.nextSibling),a===null)break}return null}function x3(a,o,h){if(o==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!h||(a=Rs(a.nextSibling),a===null))return null;return a}function SS(a,o){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!o||(a=Rs(a.nextSibling),a===null))return null;return a}function Kx(a){return a.data==="$?"||a.data==="$~"}function $x(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function b3(a,o){var h=a.ownerDocument;if(a.data==="$~")a._reactRetry=o;else if(a.data!=="$?"||h.readyState!=="loading")o();else{var y=function(){o(),h.removeEventListener("DOMContentLoaded",y)};h.addEventListener("DOMContentLoaded",y),a._reactRetry=y}}function Rs(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 Wx=null;function ES(a){a=a.nextSibling;for(var o=0;a;){if(a.nodeType===8){var h=a.data;if(h==="/$"||h==="/&"){if(o===0)return Rs(a.nextSibling);o--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||o++}a=a.nextSibling}return null}function wS(a){a=a.previousSibling;for(var o=0;a;){if(a.nodeType===8){var h=a.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(o===0)return a;o--}else h!=="/$"&&h!=="/&"||o++}a=a.previousSibling}return null}function TS(a,o,h){switch(o=hy(h),a){case"html":if(a=o.documentElement,!a)throw Error(i(452));return a;case"head":if(a=o.head,!a)throw Error(i(453));return a;case"body":if(a=o.body,!a)throw Error(i(454));return a;default:throw Error(i(451))}}function Hp(a){for(var o=a.attributes;o.length;)a.removeAttributeNode(o[0]);Hs(a)}var ks=new Map,CS=new Set;function py(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var $o=K.d;K.d={f:v3,r:_3,D:S3,C:E3,L:w3,m:T3,X:A3,S:C3,M:M3};function v3(){var a=$o.f(),o=te();return a||o}function _3(a){var o=sn(a);o!==null&&o.tag===5&&o.type==="form"?Rp(o):$o.r(a)}var kf=typeof document>"u"?null:document;function AS(a,o,h){var y=kf;if(y&&typeof o=="string"&&o){var E=Bi(o);E='link[rel="'+a+'"][href="'+E+'"]',typeof h=="string"&&(E+='[crossorigin="'+h+'"]'),CS.has(E)||(CS.add(E),a={rel:a,crossOrigin:h,href:o},y.querySelector(E)===null&&(o=y.createElement("link"),xr(o,"link",a),jn(o),y.head.appendChild(o)))}}function S3(a){$o.D(a),AS("dns-prefetch",a,null)}function E3(a,o){$o.C(a,o),AS("preconnect",a,o)}function w3(a,o,h){$o.L(a,o,h);var y=kf;if(y&&a&&o){var E='link[rel="preload"][as="'+Bi(o)+'"]';o==="image"&&h&&h.imageSrcSet?(E+='[imagesrcset="'+Bi(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(E+='[imagesizes="'+Bi(h.imageSizes)+'"]')):E+='[href="'+Bi(a)+'"]';var M=E;switch(o){case"style":M=Nf(a);break;case"script":M=Of(a)}ks.has(M)||(a=g({rel:"preload",href:o==="image"&&h&&h.imageSrcSet?void 0:a,as:o},h),ks.set(M,a),y.querySelector(E)!==null||o==="style"&&y.querySelector(Pp(M))||o==="script"&&y.querySelector(Fp(M))||(o=y.createElement("link"),xr(o,"link",a),jn(o),y.head.appendChild(o)))}}function T3(a,o){$o.m(a,o);var h=kf;if(h&&a){var y=o&&typeof o.as=="string"?o.as:"script",E='link[rel="modulepreload"][as="'+Bi(y)+'"][href="'+Bi(a)+'"]',M=E;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":M=Of(a)}if(!ks.has(M)&&(a=g({rel:"modulepreload",href:a},o),ks.set(M,a),h.querySelector(E)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Fp(M)))return}y=h.createElement("link"),xr(y,"link",a),jn(y),h.head.appendChild(y)}}}function C3(a,o,h){$o.S(a,o,h);var y=kf;if(y&&a){var E=Pr(y).hoistableStyles,M=Nf(a);o=o||"default";var U=E.get(M);if(!U){var J={loading:0,preload:null};if(U=y.querySelector(Pp(M)))J.loading=5;else{a=g({rel:"stylesheet",href:a,"data-precedence":o},h),(h=ks.get(M))&&Qx(a,h);var ae=U=y.createElement("link");jn(ae),xr(ae,"link",a),ae._p=new Promise(function(ye,we){ae.onload=ye,ae.onerror=we}),ae.addEventListener("load",function(){J.loading|=1}),ae.addEventListener("error",function(){J.loading|=2}),J.loading|=4,my(U,o,y)}U={type:"stylesheet",instance:U,count:1,state:J},E.set(M,U)}}}function A3(a,o){$o.X(a,o);var h=kf;if(h&&a){var y=Pr(h).hoistableScripts,E=Of(a),M=y.get(E);M||(M=h.querySelector(Fp(E)),M||(a=g({src:a,async:!0},o),(o=ks.get(E))&&Zx(a,o),M=h.createElement("script"),jn(M),xr(M,"link",a),h.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},y.set(E,M))}}function M3(a,o){$o.M(a,o);var h=kf;if(h&&a){var y=Pr(h).hoistableScripts,E=Of(a),M=y.get(E);M||(M=h.querySelector(Fp(E)),M||(a=g({src:a,async:!0,type:"module"},o),(o=ks.get(E))&&Zx(a,o),M=h.createElement("script"),jn(M),xr(M,"link",a),h.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},y.set(E,M))}}function MS(a,o,h,y){var E=(E=de.current)?py(E):null;if(!E)throw Error(i(446));switch(a){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(o=Nf(h.href),h=Pr(E).hoistableStyles,y=h.get(o),y||(y={type:"style",instance:null,count:0,state:null},h.set(o,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){a=Nf(h.href);var M=Pr(E).hoistableStyles,U=M.get(a);if(U||(E=E.ownerDocument||E,U={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},M.set(a,U),(M=E.querySelector(Pp(a)))&&!M._p&&(U.instance=M,U.state.loading=5),ks.has(a)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},ks.set(a,h),M||R3(E,a,h,U.state))),o&&y===null)throw Error(i(528,""));return U}if(o&&y!==null)throw Error(i(529,""));return null;case"script":return o=h.async,h=h.src,typeof h=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Of(h),h=Pr(E).hoistableScripts,y=h.get(o),y||(y={type:"script",instance:null,count:0,state:null},h.set(o,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,a))}}function Nf(a){return'href="'+Bi(a)+'"'}function Pp(a){return'link[rel="stylesheet"]['+a+"]"}function RS(a){return g({},a,{"data-precedence":a.precedence,precedence:null})}function R3(a,o,h,y){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?y.loading=1:(o=a.createElement("link"),y.preload=o,o.addEventListener("load",function(){return y.loading|=1}),o.addEventListener("error",function(){return y.loading|=2}),xr(o,"link",h),jn(o),a.head.appendChild(o))}function Of(a){return'[src="'+Bi(a)+'"]'}function Fp(a){return"script[async]"+a}function kS(a,o,h){if(o.count++,o.instance===null)switch(o.type){case"style":var y=a.querySelector('style[data-href~="'+Bi(h.href)+'"]');if(y)return o.instance=y,jn(y),y;var E=g({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return y=(a.ownerDocument||a).createElement("style"),jn(y),xr(y,"style",E),my(y,h.precedence,a),o.instance=y;case"stylesheet":E=Nf(h.href);var M=a.querySelector(Pp(E));if(M)return o.state.loading|=4,o.instance=M,jn(M),M;y=RS(h),(E=ks.get(E))&&Qx(y,E),M=(a.ownerDocument||a).createElement("link"),jn(M);var U=M;return U._p=new Promise(function(J,ae){U.onload=J,U.onerror=ae}),xr(M,"link",y),o.state.loading|=4,my(M,h.precedence,a),o.instance=M;case"script":return M=Of(h.src),(E=a.querySelector(Fp(M)))?(o.instance=E,jn(E),E):(y=h,(E=ks.get(M))&&(y=g({},h),Zx(y,E)),a=a.ownerDocument||a,E=a.createElement("script"),jn(E),xr(E,"link",y),a.head.appendChild(E),o.instance=E);case"void":return null;default:throw Error(i(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(y=o.instance,o.state.loading|=4,my(y,h.precedence,a));return o.instance}function my(a,o,h){for(var y=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=y.length?y[y.length-1]:null,M=E,U=0;U<y.length;U++){var J=y[U];if(J.dataset.precedence===o)M=J;else if(M!==E)break}M?M.parentNode.insertBefore(a,M.nextSibling):(o=h.nodeType===9?h.head:h,o.insertBefore(a,o.firstChild))}function Qx(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.title==null&&(a.title=o.title)}function Zx(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.integrity==null&&(a.integrity=o.integrity)}var gy=null;function NS(a,o,h){if(gy===null){var y=new Map,E=gy=new Map;E.set(h,y)}else E=gy,y=E.get(h),y||(y=new Map,E.set(h,y));if(y.has(a))return y;for(y.set(a,null),h=h.getElementsByTagName(a),E=0;E<h.length;E++){var M=h[E];if(!(M[La]||M[bt]||a==="link"&&M.getAttribute("rel")==="stylesheet")&&M.namespaceURI!=="http://www.w3.org/2000/svg"){var U=M.getAttribute(o)||"";U=a+U;var J=y.get(U);J?J.push(M):y.set(U,[M])}}return y}function OS(a,o,h){a=a.ownerDocument||a,a.head.insertBefore(h,o==="title"?a.querySelector("head > title"):null)}function k3(a,o,h){if(h===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;switch(o.rel){case"stylesheet":return a=o.disabled,typeof o.precedence=="string"&&a==null;default:return!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 DS(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function N3(a,o,h,y){if(h.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var E=Nf(y.href),M=o.querySelector(Pp(E));if(M){o=M._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=yy.bind(a),o.then(a,a)),h.state.loading|=4,h.instance=M,jn(M);return}M=o.ownerDocument||o,y=RS(y),(E=ks.get(E))&&Qx(y,E),M=M.createElement("link"),jn(M);var U=M;U._p=new Promise(function(J,ae){U.onload=J,U.onerror=ae}),xr(M,"link",y),h.instance=M}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(h,o),(o=h.state.preload)&&(h.state.loading&3)===0&&(a.count++,h=yy.bind(a),o.addEventListener("load",h),o.addEventListener("error",h))}}var Jx=0;function O3(a,o){return a.stylesheets&&a.count===0&&by(a,a.stylesheets),0<a.count||0<a.imgCount?function(h){var y=setTimeout(function(){if(a.stylesheets&&by(a,a.stylesheets),a.unsuspend){var M=a.unsuspend;a.unsuspend=null,M()}},6e4+o);0<a.imgBytes&&Jx===0&&(Jx=62500*f3());var E=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&by(a,a.stylesheets),a.unsuspend)){var M=a.unsuspend;a.unsuspend=null,M()}},(a.imgBytes>Jx?50:800)+o);return a.unsuspend=h,function(){a.unsuspend=null,clearTimeout(y),clearTimeout(E)}}:null}function yy(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)by(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var xy=null;function by(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,xy=new Map,o.forEach(D3,a),xy=null,yy.call(a))}function D3(a,o){if(!(o.state.loading&4)){var h=xy.get(a);if(h)var y=h.get(null);else{h=new Map,xy.set(a,h);for(var E=a.querySelectorAll("link[data-precedence],style[data-precedence]"),M=0;M<E.length;M++){var U=E[M];(U.nodeName==="LINK"||U.getAttribute("media")!=="not all")&&(h.set(U.dataset.precedence,U),y=U)}y&&h.set(null,y)}E=o.instance,U=E.getAttribute("data-precedence"),M=h.get(U)||y,M===y&&h.set(null,E),h.set(U,E),this.count++,y=yy.bind(this),E.addEventListener("load",y),E.addEventListener("error",y),M?M.parentNode.insertBefore(E,M.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(E,a.firstChild)),o.state.loading|=4}}var Gp={$$typeof:R,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function z3(a,o,h,y,E,M,U,J,ae){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=nn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nn(0),this.hiddenUpdates=nn(null),this.identifierPrefix=y,this.onUncaughtError=E,this.onCaughtError=M,this.onRecoverableError=U,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ae,this.incompleteTransitions=new Map}function zS(a,o,h,y,E,M,U,J,ae,ye,we,Me){return a=new z3(a,o,h,U,ae,ye,we,Me,J),o=1,M===!0&&(o|=24),M=fr(3,null,null,o),a.current=M,M.stateNode=a,o=Qh(),o.refCount++,a.pooledCache=o,o.refCount++,M.memoizedState={element:y,isDehydrated:h,cache:o},ip(M),a}function BS(a){return a?(a=Gl,a):Gl}function LS(a,o,h,y,E,M){E=BS(E),y.context===null?y.context=E:y.pendingContext=E,y=vs(o),y.payload={element:h},M=M===void 0?null:M,M!==null&&(y.callback=M),h=Js(a,y,o),h!==null&&(d(h,a,o),Ql(h,a,o))}function jS(a,o){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<o?h:o}}function eb(a,o){jS(a,o),(a=a.alternate)&&jS(a,o)}function IS(a){if(a.tag===13||a.tag===31){var o=Fl(a,67108864);o!==null&&d(o,a,67108864),eb(a,67108864)}}function US(a){if(a.tag===13||a.tag===31){var o=yr();o=Ft(o);var h=Fl(a,o);h!==null&&d(h,a,o),eb(a,o)}}var vy=!0;function B3(a,o,h,y){var E=z.T;z.T=null;var M=K.p;try{K.p=2,tb(a,o,h,y)}finally{K.p=M,z.T=E}}function L3(a,o,h,y){var E=z.T;z.T=null;var M=K.p;try{K.p=8,tb(a,o,h,y)}finally{K.p=M,z.T=E}}function tb(a,o,h,y){if(vy){var E=nb(y);if(E===null)Px(a,o,y,_y,h),PS(a,y);else if(I3(E,a,o,h,y))y.stopPropagation();else if(PS(a,y),o&4&&-1<j3.indexOf(a)){for(;E!==null;){var M=sn(E);if(M!==null)switch(M.tag){case 3:if(M=M.stateNode,M.current.memoizedState.isDehydrated){var U=vi(M.pendingLanes);if(U!==0){var J=M;for(J.pendingLanes|=2,J.entangledLanes|=2;U;){var ae=1<<31-Pt(U);J.entanglements[1]|=ae,U&=~ae}so(M),(jt&6)===0&&(aa=Wt()+500,jp(0))}}break;case 31:case 13:J=Fl(M,2),J!==null&&d(J,M,2),te(),eb(M,2)}if(M=nb(y),M===null&&Px(a,o,y,_y,h),M===E)break;E=M}E!==null&&y.stopPropagation()}else Px(a,o,y,null,h)}}function nb(a){return a=yt(a),ib(a)}var _y=null;function ib(a){if(_y=null,a=an(a),a!==null){var o=s(a);if(o===null)a=null;else{var h=o.tag;if(h===13){if(a=l(o),a!==null)return a;a=null}else if(h===31){if(a=c(o),a!==null)return a;a=null}else if(h===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;a=null}else o!==a&&(a=null)}}return _y=a,null}function HS(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(sr()){case Ee:return 2;case ke:return 8;case oe:case Pe:return 32;case ct:return 268435456;default:return 32}default:return 32}}var rb=!1,Kc=null,$c=null,Wc=null,qp=new Map,Yp=new Map,Qc=[],j3="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 PS(a,o){switch(a){case"focusin":case"focusout":Kc=null;break;case"dragenter":case"dragleave":$c=null;break;case"mouseover":case"mouseout":Wc=null;break;case"pointerover":case"pointerout":qp.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yp.delete(o.pointerId)}}function Vp(a,o,h,y,E,M){return a===null||a.nativeEvent!==M?(a={blockedOn:o,domEventName:h,eventSystemFlags:y,nativeEvent:M,targetContainers:[E]},o!==null&&(o=sn(o),o!==null&&IS(o)),a):(a.eventSystemFlags|=y,o=a.targetContainers,E!==null&&o.indexOf(E)===-1&&o.push(E),a)}function I3(a,o,h,y,E){switch(o){case"focusin":return Kc=Vp(Kc,a,o,h,y,E),!0;case"dragenter":return $c=Vp($c,a,o,h,y,E),!0;case"mouseover":return Wc=Vp(Wc,a,o,h,y,E),!0;case"pointerover":var M=E.pointerId;return qp.set(M,Vp(qp.get(M)||null,a,o,h,y,E)),!0;case"gotpointercapture":return M=E.pointerId,Yp.set(M,Vp(Yp.get(M)||null,a,o,h,y,E)),!0}return!1}function FS(a){var o=an(a.target);if(o!==null){var h=s(o);if(h!==null){if(o=h.tag,o===13){if(o=l(h),o!==null){a.blockedOn=o,Vi(a.priority,function(){US(h)});return}}else if(o===31){if(o=c(h),o!==null){a.blockedOn=o,Vi(a.priority,function(){US(h)});return}}else if(o===3&&h.stateNode.current.memoizedState.isDehydrated){a.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Sy(a){if(a.blockedOn!==null)return!1;for(var o=a.targetContainers;0<o.length;){var h=nb(a.nativeEvent);if(h===null){h=a.nativeEvent;var y=new h.constructor(h.type,h);Ve=y,h.target.dispatchEvent(y),Ve=null}else return o=sn(h),o!==null&&IS(o),a.blockedOn=h,!1;o.shift()}return!0}function GS(a,o,h){Sy(a)&&h.delete(o)}function U3(){rb=!1,Kc!==null&&Sy(Kc)&&(Kc=null),$c!==null&&Sy($c)&&($c=null),Wc!==null&&Sy(Wc)&&(Wc=null),qp.forEach(GS),Yp.forEach(GS)}function Ey(a,o){a.blockedOn===o&&(a.blockedOn=null,rb||(rb=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,U3)))}var wy=null;function qS(a){wy!==a&&(wy=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){wy===a&&(wy=null);for(var o=0;o<a.length;o+=3){var h=a[o],y=a[o+1],E=a[o+2];if(typeof y!="function"){if(ib(y||h)===null)continue;break}var M=sn(h);M!==null&&(a.splice(o,3),o-=3,Mp(M,{pending:!0,data:E,method:h.method,action:y},y,E))}}))}function Df(a){function o(ae){return Ey(ae,a)}Kc!==null&&Ey(Kc,a),$c!==null&&Ey($c,a),Wc!==null&&Ey(Wc,a),qp.forEach(o),Yp.forEach(o);for(var h=0;h<Qc.length;h++){var y=Qc[h];y.blockedOn===a&&(y.blockedOn=null)}for(;0<Qc.length&&(h=Qc[0],h.blockedOn===null);)FS(h),h.blockedOn===null&&Qc.shift();if(h=(a.ownerDocument||a).$$reactFormReplay,h!=null)for(y=0;y<h.length;y+=3){var E=h[y],M=h[y+1],U=E[ui]||null;if(typeof M=="function")U||qS(h);else if(U){var J=null;if(M&&M.hasAttribute("formAction")){if(E=M,U=M[ui]||null)J=U.formAction;else if(ib(E)!==null)continue}else J=U.action;typeof J=="function"?h[y+1]=J:(h.splice(y,3),y-=3),qS(h)}}}function YS(){function a(M){M.canIntercept&&M.info==="react-transition"&&M.intercept({handler:function(){return new Promise(function(U){return E=U})},focusReset:"manual",scroll:"manual"})}function o(){E!==null&&(E(),E=null),y||setTimeout(h,20)}function h(){if(!y&&!navigation.transition){var M=navigation.currentEntry;M&&M.url!=null&&navigation.navigate(M.url,{state:M.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var y=!1,E=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(h,100),function(){y=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),E!==null&&(E(),E=null)}}}function ab(a){this._internalRoot=a}Ty.prototype.render=ab.prototype.render=function(a){var o=this._internalRoot;if(o===null)throw Error(i(409));var h=o.current,y=yr();LS(h,y,a,o,null,null)},Ty.prototype.unmount=ab.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var o=a.containerInfo;LS(a.current,2,null,a,null,null),te(),o[Hr]=null}};function Ty(a){this._internalRoot=a}Ty.prototype.unstable_scheduleHydration=function(a){if(a){var o=lr();a={blockedOn:null,target:a,priority:o};for(var h=0;h<Qc.length&&o!==0&&o<Qc[h].priority;h++);Qc.splice(h,0,a),h===0&&FS(a)}};var VS=t.version;if(VS!=="19.2.4")throw Error(i(527,VS,"19.2.4"));K.findDOMNode=function(a){var o=a._reactInternals;if(o===void 0)throw typeof a.render=="function"?Error(i(188)):(a=Object.keys(a).join(","),Error(i(268,a)));return a=p(o),a=a!==null?m(a):null,a=a===null?null:a.stateNode,a};var H3={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Cy=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cy.isDisabled&&Cy.supportsFiber)try{Qt=Cy.inject(H3),Zt=Cy}catch{}}return Kp.createRoot=function(a,o){if(!r(a))throw Error(i(299));var h=!1,y="",E=Op,M=ry,U=gf;return o!=null&&(o.unstable_strictMode===!0&&(h=!0),o.identifierPrefix!==void 0&&(y=o.identifierPrefix),o.onUncaughtError!==void 0&&(E=o.onUncaughtError),o.onCaughtError!==void 0&&(M=o.onCaughtError),o.onRecoverableError!==void 0&&(U=o.onRecoverableError)),o=zS(a,1,!1,null,null,h,y,null,E,M,U,YS),a[Hr]=o.current,Hx(a),new ab(o)},Kp.hydrateRoot=function(a,o,h){if(!r(a))throw Error(i(299));var y=!1,E="",M=Op,U=ry,J=gf,ae=null;return h!=null&&(h.unstable_strictMode===!0&&(y=!0),h.identifierPrefix!==void 0&&(E=h.identifierPrefix),h.onUncaughtError!==void 0&&(M=h.onUncaughtError),h.onCaughtError!==void 0&&(U=h.onCaughtError),h.onRecoverableError!==void 0&&(J=h.onRecoverableError),h.formState!==void 0&&(ae=h.formState)),o=zS(a,1,!0,o,h??null,y,E,ae,M,U,J,YS),o.context=BS(null),h=o.current,y=yr(),y=Ft(y),E=vs(y),E.callback=null,Js(h,E,y),h=y,o.current.lanes=h,rn(o,h),so(o),a[Hr]=o.current,Hx(a),new Ty(o)},Kp.version="19.2.4",Kp}var iE;function Q3(){if(iE)return ob.exports;iE=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ob.exports=W3(),ob.exports}var Z3=Q3();/**
51
- * react-router v7.13.1
52
- *
53
- * Copyright (c) Remix Software Inc.
54
- *
55
- * This source code is licensed under the MIT license found in the
56
- * LICENSE.md file in the root directory of this source tree.
57
- *
58
- * @license MIT
59
- */var rE="popstate";function aE(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function J3(e={}){function t(i,r){var p;let s=(p=r.state)==null?void 0:p.masked,{pathname:l,search:c,hash:f}=s||i.location;return Hv("",{pathname:l,search:c,hash:f},r.state&&r.state.usr||null,r.state&&r.state.key||"default",s?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function n(i,r){return typeof r=="string"?r:km(r)}return tO(t,n,null,e)}function Wn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _l(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function eO(){return Math.random().toString(36).substring(2,10)}function sE(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Hv(e,t,n=null,i,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?_h(t):t,state:n,key:t&&t.key||i||eO(),unstable_mask:r}}function km({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function _h(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let i=e.indexOf("?");i>=0&&(t.search=e.substring(i),e=e.substring(0,i)),e&&(t.pathname=e)}return t}function tO(e,t,n,i={}){let{window:r=document.defaultView,v5Compat:s=!1}=i,l=r.history,c="POP",f=null,p=m();p==null&&(p=0,l.replaceState({...l.state,idx:p},""));function m(){return(l.state||{idx:null}).idx}function g(){c="POP";let T=m(),C=T==null?null:T-p;p=T,f&&f({action:c,location:A.location,delta:C})}function x(T,C){c="PUSH";let N=aE(T)?T:Hv(A.location,T,C);p=m()+1;let R=sE(N,p),O=A.createHref(N.unstable_mask||N);try{l.pushState(R,"",O)}catch(H){if(H instanceof DOMException&&H.name==="DataCloneError")throw H;r.location.assign(O)}s&&f&&f({action:c,location:A.location,delta:1})}function v(T,C){c="REPLACE";let N=aE(T)?T:Hv(A.location,T,C);p=m();let R=sE(N,p),O=A.createHref(N.unstable_mask||N);l.replaceState(R,"",O),s&&f&&f({action:c,location:A.location,delta:0})}function S(T){return nO(T)}let A={get action(){return c},get location(){return e(r,l)},listen(T){if(f)throw new Error("A history only accepts one active listener");return r.addEventListener(rE,g),f=T,()=>{r.removeEventListener(rE,g),f=null}},createHref(T){return t(r,T)},createURL:S,encodeLocation(T){let C=S(T);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:x,replace:v,go(T){return l.go(T)}};return A}function nO(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Wn(n,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:km(e);return i=i.replace(/ $/,"%20"),!t&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function MC(e,t,n="/"){return iO(e,t,n,!1)}function iO(e,t,n,i){let r=typeof t=="string"?_h(t):t,s=sc(r.pathname||"/",n);if(s==null)return null;let l=RC(e);rO(l);let c=null;for(let f=0;c==null&&f<l.length;++f){let p=mO(s);c=hO(l[f],p,i)}return c}function RC(e,t=[],n=[],i="",r=!1){let s=(l,c,f=r,p)=>{let m={relativePath:p===void 0?l.path||"":p,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(i)&&f)return;Wn(m.relativePath.startsWith(i),`Absolute route path "${m.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(i.length)}let g=po([i,m.relativePath]),x=n.concat(m);l.children&&l.children.length>0&&(Wn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),RC(l.children,t,x,g,f)),!(l.path==null&&!l.index)&&t.push({path:g,score:dO(g,l.index),routesMeta:x})};return e.forEach((l,c)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))s(l,c);else for(let p of kC(l.path))s(l,c,!0,p)}),t}function kC(e){let t=e.split("/");if(t.length===0)return[];let[n,...i]=t,r=n.endsWith("?"),s=n.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let l=kC(i.join("/")),c=[];return c.push(...l.map(f=>f===""?s:[s,f].join("/"))),r&&c.push(...l),c.map(f=>e.startsWith("/")&&f===""?"/":f)}function rO(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:fO(t.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var aO=/^:[\w-]+$/,sO=3,lO=2,oO=1,cO=10,uO=-2,lE=e=>e==="*";function dO(e,t){let n=e.split("/"),i=n.length;return n.some(lE)&&(i+=uO),t&&(i+=lO),n.filter(r=>!lE(r)).reduce((r,s)=>r+(aO.test(s)?sO:s===""?oO:cO),i)}function fO(e,t){return e.length===t.length&&e.slice(0,-1).every((i,r)=>i===t[r])?e[e.length-1]-t[t.length-1]:0}function hO(e,t,n=!1){let{routesMeta:i}=e,r={},s="/",l=[];for(let c=0;c<i.length;++c){let f=i[c],p=c===i.length-1,m=s==="/"?t:t.slice(s.length)||"/",g=w0({path:f.relativePath,caseSensitive:f.caseSensitive,end:p},m),x=f.route;if(!g&&p&&n&&!i[i.length-1].route.index&&(g=w0({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(r,g.params),l.push({params:r,pathname:po([s,g.pathname]),pathnameBase:bO(po([s,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(s=po([s,g.pathnameBase]))}return l}function w0(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,i]=pO(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let s=r[0],l=s.replace(/(.)\/+$/,"$1"),c=r.slice(1);return{params:i.reduce((p,{paramName:m,isOptional:g},x)=>{if(m==="*"){let S=c[x]||"";l=s.slice(0,s.length-S.length).replace(/(.)\/+$/,"$1")}const v=c[x];return g&&!v?p[m]=void 0:p[m]=(v||"").replace(/%2F/g,"/"),p},{}),pathname:s,pathnameBase:l,pattern:e}}function pO(e,t=!1,n=!0){_l(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let i=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,f,p,m)=>{if(i.push({paramName:c,isOptional:f!=null}),f){let g=m.charAt(p+l.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(i.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),i]}function mO(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return _l(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function sc(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,i=e.charAt(n);return i&&i!=="/"?null:e.slice(n)||"/"}var gO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function yO(e,t="/"){let{pathname:n,search:i="",hash:r=""}=typeof e=="string"?_h(e):e,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=oE(n.substring(1),"/"):s=oE(n,t)):s=t,{pathname:s,search:vO(i),hash:_O(r)}}function oE(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function fb(e,t,n,i){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function xO(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function V1(e){let t=xO(e);return t.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase)}function W0(e,t,n,i=!1){let r;typeof e=="string"?r=_h(e):(r={...e},Wn(!r.pathname||!r.pathname.includes("?"),fb("?","pathname","search",r)),Wn(!r.pathname||!r.pathname.includes("#"),fb("#","pathname","hash",r)),Wn(!r.search||!r.search.includes("#"),fb("#","search","hash",r)));let s=e===""||r.pathname==="",l=s?"/":r.pathname,c;if(l==null)c=n;else{let g=t.length-1;if(!i&&l.startsWith("..")){let x=l.split("/");for(;x[0]==="..";)x.shift(),g-=1;r.pathname=x.join("/")}c=g>=0?t[g]:"/"}let f=yO(r,c),p=l&&l!=="/"&&l.endsWith("/"),m=(s||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(p||m)&&(f.pathname+="/"),f}var po=e=>e.join("/").replace(/\/\/+/g,"/"),bO=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),vO=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,_O=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,SO=class{constructor(e,t,n,i=!1){this.status=e,this.statusText=t||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function EO(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function wO(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var NC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function OC(e,t){let n=e;if(typeof n!="string"||!gO.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let i=n,r=!1;if(NC)try{let s=new URL(window.location.href),l=n.startsWith("//")?new URL(s.protocol+n):new URL(n),c=sc(l.pathname,t);l.origin===s.origin&&c!=null?n=c+l.search+l.hash:r=!0}catch{_l(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:r,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var DC=["POST","PUT","PATCH","DELETE"];new Set(DC);var TO=["GET",...DC];new Set(TO);var Sh=L.createContext(null);Sh.displayName="DataRouter";var Q0=L.createContext(null);Q0.displayName="DataRouterState";var CO=L.createContext(!1),zC=L.createContext({isTransitioning:!1});zC.displayName="ViewTransition";var AO=L.createContext(new Map);AO.displayName="Fetchers";var MO=L.createContext(null);MO.displayName="Await";var ss=L.createContext(null);ss.displayName="Navigation";var $m=L.createContext(null);$m.displayName="Location";var El=L.createContext({outlet:null,matches:[],isDataRoute:!1});El.displayName="Route";var X1=L.createContext(null);X1.displayName="RouteError";var BC="REACT_ROUTER_ERROR",RO="REDIRECT",kO="ROUTE_ERROR_RESPONSE";function NO(e){if(e.startsWith(`${BC}:${RO}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function OO(e){if(e.startsWith(`${BC}:${kO}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new SO(t.status,t.statusText,t.data)}catch{}}function DO(e,{relative:t}={}){Wn(Eh(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=L.useContext(ss),{hash:r,pathname:s,search:l}=Wm(e,{relative:t}),c=s;return n!=="/"&&(c=s==="/"?n:po([n,s])),i.createHref({pathname:c,search:l,hash:r})}function Eh(){return L.useContext($m)!=null}function wl(){return Wn(Eh(),"useLocation() may be used only in the context of a <Router> component."),L.useContext($m).location}var LC="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function jC(e){L.useContext(ss).static||L.useLayoutEffect(e)}function Z0(){let{isDataRoute:e}=L.useContext(El);return e?KO():zO()}function zO(){Wn(Eh(),"useNavigate() may be used only in the context of a <Router> component.");let e=L.useContext(Sh),{basename:t,navigator:n}=L.useContext(ss),{matches:i}=L.useContext(El),{pathname:r}=wl(),s=JSON.stringify(V1(i)),l=L.useRef(!1);return jC(()=>{l.current=!0}),L.useCallback((f,p={})=>{if(_l(l.current,LC),!l.current)return;if(typeof f=="number"){n.go(f);return}let m=W0(f,JSON.parse(s),r,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:po([t,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[t,n,s,r,e])}var BO=L.createContext(null);function LO(e){let t=L.useContext(El).outlet;return L.useMemo(()=>t&&L.createElement(BO.Provider,{value:e},t),[t,e])}function Wm(e,{relative:t}={}){let{matches:n}=L.useContext(El),{pathname:i}=wl(),r=JSON.stringify(V1(n));return L.useMemo(()=>W0(e,JSON.parse(r),i,t==="path"),[e,r,i,t])}function jO(e,t){return IC(e,t)}function IC(e,t,n){var T;Wn(Eh(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=L.useContext(ss),{matches:r}=L.useContext(El),s=r[r.length-1],l=s?s.params:{},c=s?s.pathname:"/",f=s?s.pathnameBase:"/",p=s&&s.route;{let C=p&&p.path||"";HC(c,!p||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
-
61
- Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let m=wl(),g;if(t){let C=typeof t=="string"?_h(t):t;Wn(f==="/"||((T=C.pathname)==null?void 0:T.startsWith(f)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${C.pathname}" was given in the \`location\` prop.`),g=C}else g=m;let x=g.pathname||"/",v=x;if(f!=="/"){let C=f.replace(/^\//,"").split("/");v="/"+x.replace(/^\//,"").split("/").slice(C.length).join("/")}let S=MC(e,{pathname:v});_l(p||S!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),_l(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let A=FO(S&&S.map(C=>Object.assign({},C,{params:Object.assign({},l,C.params),pathname:po([f,i.encodeLocation?i.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?f:po([f,i.encodeLocation?i.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),r,n);return t&&A?L.createElement($m.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},A):A}function IO(){let e=XO(),t=EO(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=L.createElement(L.Fragment,null,L.createElement("p",null,"💿 Hey developer 👋"),L.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",L.createElement("code",{style:s},"ErrorBoundary")," or"," ",L.createElement("code",{style:s},"errorElement")," prop on your route.")),L.createElement(L.Fragment,null,L.createElement("h2",null,"Unexpected Application Error!"),L.createElement("h3",{style:{fontStyle:"italic"}},t),n?L.createElement("pre",{style:r},n):null,l)}var UO=L.createElement(IO,null),UC=class extends L.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=OO(e.digest);n&&(e=n)}let t=e!==void 0?L.createElement(El.Provider,{value:this.props.routeContext},L.createElement(X1.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?L.createElement(HO,{error:e},t):t}};UC.contextType=CO;var hb=new WeakMap;function HO({children:e,error:t}){let{basename:n}=L.useContext(ss);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let i=NO(t.digest);if(i){let r=hb.get(t);if(r)throw r;let s=OC(i.location,n);if(NC&&!hb.get(t))if(s.isExternal||i.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:i.replace}));throw hb.set(t,l),l}return L.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function PO({routeContext:e,match:t,children:n}){let i=L.useContext(Sh);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),L.createElement(El.Provider,{value:e},n)}function FO(e,t=[],n){let i=n==null?void 0:n.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let r=e,s=i==null?void 0:i.errors;if(s!=null){let m=r.findIndex(g=>g.route.id&&(s==null?void 0:s[g.route.id])!==void 0);Wn(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),r=r.slice(0,Math.min(r.length,m+1))}let l=!1,c=-1;if(n&&i){l=i.renderFallback;for(let m=0;m<r.length;m++){let g=r[m];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=m),g.route.id){let{loaderData:x,errors:v}=i,S=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!v||v[g.route.id]===void 0);if(g.route.lazy||S){n.isStatic&&(l=!0),c>=0?r=r.slice(0,c+1):r=[r[0]];break}}}}let f=n==null?void 0:n.onError,p=i&&f?(m,g)=>{var x,v;f(m,{location:i.location,params:((v=(x=i.matches)==null?void 0:x[0])==null?void 0:v.params)??{},unstable_pattern:wO(i.matches),errorInfo:g})}:void 0;return r.reduceRight((m,g,x)=>{let v,S=!1,A=null,T=null;i&&(v=s&&g.route.id?s[g.route.id]:void 0,A=g.route.errorElement||UO,l&&(c<0&&x===0?(HC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,T=null):c===x&&(S=!0,T=g.route.hydrateFallbackElement||null)));let C=t.concat(r.slice(0,x+1)),N=()=>{let R;return v?R=A:S?R=T:g.route.Component?R=L.createElement(g.route.Component,null):g.route.element?R=g.route.element:R=m,L.createElement(PO,{match:g,routeContext:{outlet:m,matches:C,isDataRoute:i!=null},children:R})};return i&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?L.createElement(UC,{location:i.location,revalidation:i.revalidation,component:A,error:v,children:N(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:p}):N()},null)}function K1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function GO(e){let t=L.useContext(Sh);return Wn(t,K1(e)),t}function qO(e){let t=L.useContext(Q0);return Wn(t,K1(e)),t}function YO(e){let t=L.useContext(El);return Wn(t,K1(e)),t}function $1(e){let t=YO(e),n=t.matches[t.matches.length-1];return Wn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function VO(){return $1("useRouteId")}function XO(){var i;let e=L.useContext(X1),t=qO("useRouteError"),n=$1("useRouteError");return e!==void 0?e:(i=t.errors)==null?void 0:i[n]}function KO(){let{router:e}=GO("useNavigate"),t=$1("useNavigate"),n=L.useRef(!1);return jC(()=>{n.current=!0}),L.useCallback(async(r,s={})=>{_l(n.current,LC),n.current&&(typeof r=="number"?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...s}))},[e,t])}var cE={};function HC(e,t,n){!t&&!cE[e]&&(cE[e]=!0,_l(!1,n))}L.memo($O);function $O({routes:e,future:t,state:n,isStatic:i,onError:r}){return IC(e,void 0,{state:n,isStatic:i,onError:r})}function WO({to:e,replace:t,state:n,relative:i}){Wn(Eh(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=L.useContext(ss);_l(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=L.useContext(El),{pathname:l}=wl(),c=Z0(),f=W0(e,V1(s),l,i==="path"),p=JSON.stringify(f);return L.useEffect(()=>{c(JSON.parse(p),{replace:t,state:n,relative:i})},[c,p,i,t,n]),null}function uE(e){return LO(e.context)}function ca(e){Wn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function QO({basename:e="/",children:t=null,location:n,navigationType:i="POP",navigator:r,static:s=!1,unstable_useTransitions:l}){Wn(!Eh(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),f=L.useMemo(()=>({basename:c,navigator:r,static:s,unstable_useTransitions:l,future:{}}),[c,r,s,l]);typeof n=="string"&&(n=_h(n));let{pathname:p="/",search:m="",hash:g="",state:x=null,key:v="default",unstable_mask:S}=n,A=L.useMemo(()=>{let T=sc(p,c);return T==null?null:{location:{pathname:T,search:m,hash:g,state:x,key:v,unstable_mask:S},navigationType:i}},[c,p,m,g,x,v,i,S]);return _l(A!=null,`<Router basename="${c}"> is not able to match the URL "${p}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),A==null?null:L.createElement(ss.Provider,{value:f},L.createElement($m.Provider,{children:t,value:A}))}function ZO({children:e,location:t}){return jO(Pv(e),t)}function Pv(e,t=[]){let n=[];return L.Children.forEach(e,(i,r)=>{if(!L.isValidElement(i))return;let s=[...t,r];if(i.type===L.Fragment){n.push.apply(n,Pv(i.props.children,s));return}Wn(i.type===ca,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Wn(!i.props.index||!i.props.children,"An index route cannot have child routes.");let l={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(l.children=Pv(i.props.children,s)),n.push(l)}),n}var h0="get",p0="application/x-www-form-urlencoded";function J0(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function JO(e){return J0(e)&&e.tagName.toLowerCase()==="button"}function e4(e){return J0(e)&&e.tagName.toLowerCase()==="form"}function t4(e){return J0(e)&&e.tagName.toLowerCase()==="input"}function n4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function i4(e,t){return e.button===0&&(!t||t==="_self")&&!n4(e)}var Ay=null;function r4(){if(Ay===null)try{new FormData(document.createElement("form"),0),Ay=!1}catch{Ay=!0}return Ay}var a4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function pb(e){return e!=null&&!a4.has(e)?(_l(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${p0}"`),null):e}function s4(e,t){let n,i,r,s,l;if(e4(e)){let c=e.getAttribute("action");i=c?sc(c,t):null,n=e.getAttribute("method")||h0,r=pb(e.getAttribute("enctype"))||p0,s=new FormData(e)}else if(JO(e)||t4(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||c.getAttribute("action");if(i=f?sc(f,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||h0,r=pb(e.getAttribute("formenctype"))||pb(c.getAttribute("enctype"))||p0,s=new FormData(c,e),!r4()){let{name:p,type:m,value:g}=e;if(m==="image"){let x=p?`${p}.`:"";s.append(`${x}x`,"0"),s.append(`${x}y`,"0")}else p&&s.append(p,g)}}else{if(J0(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=h0,i=null,r=p0,l=e}return s&&r==="text/plain"&&(l=s,s=void 0),{action:i,method:n.toLowerCase(),encType:r,formData:s,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function W1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function l4(e,t,n,i){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${i}`:r.pathname=`${r.pathname}.${i}`:r.pathname==="/"?r.pathname=`_root.${i}`:t&&sc(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${i}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${i}`,r}async function o4(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function c4(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function u4(e,t,n){let i=await Promise.all(e.map(async r=>{let s=t.routes[r.route.id];if(s){let l=await o4(s,n);return l.links?l.links():[]}return[]}));return p4(i.flat(1).filter(c4).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function dE(e,t,n,i,r,s){let l=(f,p)=>n[p]?f.route.id!==n[p].route.id:!0,c=(f,p)=>{var m;return n[p].pathname!==f.pathname||((m=n[p].route.path)==null?void 0:m.endsWith("*"))&&n[p].params["*"]!==f.params["*"]};return s==="assets"?t.filter((f,p)=>l(f,p)||c(f,p)):s==="data"?t.filter((f,p)=>{var g;let m=i.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(l(f,p)||c(f,p))return!0;if(f.route.shouldRevalidate){let x=f.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function d4(e,t,{includeHydrateFallback:n}={}){return f4(e.map(i=>{let r=t.routes[i.route.id];if(!r)return[];let s=[r.module];return r.clientActionModule&&(s=s.concat(r.clientActionModule)),r.clientLoaderModule&&(s=s.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(s=s.concat(r.hydrateFallbackModule)),r.imports&&(s=s.concat(r.imports)),s}).flat(1))}function f4(e){return[...new Set(e)]}function h4(e){let t={},n=Object.keys(e).sort();for(let i of n)t[i]=e[i];return t}function p4(e,t){let n=new Set;return new Set(t),e.reduce((i,r)=>{let s=JSON.stringify(h4(r));return n.has(s)||(n.add(s),i.push({key:s,link:r})),i},[])}function PC(){let e=L.useContext(Sh);return W1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function m4(){let e=L.useContext(Q0);return W1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Q1=L.createContext(void 0);Q1.displayName="FrameworkContext";function FC(){let e=L.useContext(Q1);return W1(e,"You must render this element inside a <HydratedRouter> element"),e}function g4(e,t){let n=L.useContext(Q1),[i,r]=L.useState(!1),[s,l]=L.useState(!1),{onFocus:c,onBlur:f,onMouseEnter:p,onMouseLeave:m,onTouchStart:g}=t,x=L.useRef(null);L.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let A=C=>{C.forEach(N=>{l(N.isIntersecting)})},T=new IntersectionObserver(A,{threshold:.5});return x.current&&T.observe(x.current),()=>{T.disconnect()}}},[e]),L.useEffect(()=>{if(i){let A=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(A)}}},[i]);let v=()=>{r(!0)},S=()=>{r(!1),l(!1)};return n?e!=="intent"?[s,x,{}]:[s,x,{onFocus:$p(c,v),onBlur:$p(f,S),onMouseEnter:$p(p,v),onMouseLeave:$p(m,S),onTouchStart:$p(g,v)}]:[!1,x,{}]}function $p(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function y4({page:e,...t}){let{router:n}=PC(),i=L.useMemo(()=>MC(n.routes,e,n.basename),[n.routes,e,n.basename]);return i?L.createElement(b4,{page:e,matches:i,...t}):null}function x4(e){let{manifest:t,routeModules:n}=FC(),[i,r]=L.useState([]);return L.useEffect(()=>{let s=!1;return u4(e,t,n).then(l=>{s||r(l)}),()=>{s=!0}},[e,t,n]),i}function b4({page:e,matches:t,...n}){let i=wl(),{future:r,manifest:s,routeModules:l}=FC(),{basename:c}=PC(),{loaderData:f,matches:p}=m4(),m=L.useMemo(()=>dE(e,t,p,s,i,"data"),[e,t,p,s,i]),g=L.useMemo(()=>dE(e,t,p,s,i,"assets"),[e,t,p,s,i]),x=L.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let A=new Set,T=!1;if(t.forEach(N=>{var O;let R=s.routes[N.route.id];!R||!R.hasLoader||(!m.some(H=>H.route.id===N.route.id)&&N.route.id in f&&((O=l[N.route.id])!=null&&O.shouldRevalidate)||R.hasClientLoader?T=!0:A.add(N.route.id))}),A.size===0)return[];let C=l4(e,c,r.unstable_trailingSlashAwareDataRequests,"data");return T&&A.size>0&&C.searchParams.set("_routes",t.filter(N=>A.has(N.route.id)).map(N=>N.route.id).join(",")),[C.pathname+C.search]},[c,r.unstable_trailingSlashAwareDataRequests,f,i,s,m,t,e,l]),v=L.useMemo(()=>d4(g,s),[g,s]),S=x4(g);return L.createElement(L.Fragment,null,x.map(A=>L.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...n})),v.map(A=>L.createElement("link",{key:A,rel:"modulepreload",href:A,...n})),S.map(({key:A,link:T})=>L.createElement("link",{key:A,nonce:n.nonce,...T,crossOrigin:T.crossOrigin??n.crossOrigin})))}function v4(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var _4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{_4&&(window.__reactRouterVersion="7.13.1")}catch{}function S4({basename:e,children:t,unstable_useTransitions:n,window:i}){let r=L.useRef();r.current==null&&(r.current=J3({window:i,v5Compat:!0}));let s=r.current,[l,c]=L.useState({action:s.action,location:s.location}),f=L.useCallback(p=>{n===!1?c(p):L.startTransition(()=>c(p))},[n]);return L.useLayoutEffect(()=>s.listen(f),[s,f]),L.createElement(QO,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:s,unstable_useTransitions:n})}var GC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qC=L.forwardRef(function({onClick:t,discover:n="render",prefetch:i="none",relative:r,reloadDocument:s,replace:l,unstable_mask:c,state:f,target:p,to:m,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:v,...S},A){let{basename:T,navigator:C,unstable_useTransitions:N}=L.useContext(ss),R=typeof m=="string"&&GC.test(m),O=OC(m,T);m=O.to;let H=DO(m,{relative:r}),D=wl(),q=null;if(c){let W=W0(c,[],D.unstable_mask?D.unstable_mask.pathname:"/",!0);T!=="/"&&(W.pathname=W.pathname==="/"?T:po([T,W.pathname])),q=C.createHref(W)}let[Z,V,Y]=g4(i,S),F=T4(m,{replace:l,unstable_mask:c,state:f,target:p,preventScrollReset:g,relative:r,viewTransition:x,unstable_defaultShouldRevalidate:v,unstable_useTransitions:N});function j(W){t&&t(W),W.defaultPrevented||F(W)}let ee=!(O.isExternal||s),P=L.createElement("a",{...S,...Y,href:(ee?q:void 0)||O.absoluteURL||H,onClick:ee?j:t,ref:v4(A,V),target:p,"data-discover":!R&&n==="render"?"true":void 0});return Z&&!R?L.createElement(L.Fragment,null,P,L.createElement(y4,{page:H})):P});qC.displayName="Link";var YC=L.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:i="",end:r=!1,style:s,to:l,viewTransition:c,children:f,...p},m){let g=Wm(l,{relative:p.relative}),x=wl(),v=L.useContext(Q0),{navigator:S,basename:A}=L.useContext(ss),T=v!=null&&k4(g)&&c===!0,C=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,N=x.pathname,R=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(N=N.toLowerCase(),R=R?R.toLowerCase():null,C=C.toLowerCase()),R&&A&&(R=sc(R,A)||R);const O=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let H=N===C||!r&&N.startsWith(C)&&N.charAt(O)==="/",D=R!=null&&(R===C||!r&&R.startsWith(C)&&R.charAt(C.length)==="/"),q={isActive:H,isPending:D,isTransitioning:T},Z=H?t:void 0,V;typeof i=="function"?V=i(q):V=[i,H?"active":null,D?"pending":null,T?"transitioning":null].filter(Boolean).join(" ");let Y=typeof s=="function"?s(q):s;return L.createElement(qC,{...p,"aria-current":Z,className:V,ref:m,style:Y,to:l,viewTransition:c},typeof f=="function"?f(q):f)});YC.displayName="NavLink";var E4=L.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:i,replace:r,state:s,method:l=h0,action:c,onSubmit:f,relative:p,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:x,...v},S)=>{let{unstable_useTransitions:A}=L.useContext(ss),T=M4(),C=R4(c,{relative:p}),N=l.toLowerCase()==="get"?"get":"post",R=typeof c=="string"&&GC.test(c),O=H=>{if(f&&f(H),H.defaultPrevented)return;H.preventDefault();let D=H.nativeEvent.submitter,q=(D==null?void 0:D.getAttribute("formmethod"))||l,Z=()=>T(D||H.currentTarget,{fetcherKey:t,method:q,navigate:n,replace:r,state:s,relative:p,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:x});A&&n!==!1?L.startTransition(()=>Z()):Z()};return L.createElement("form",{ref:S,method:N,action:C,onSubmit:i?f:O,...v,"data-discover":!R&&e==="render"?"true":void 0})});E4.displayName="Form";function w4(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function VC(e){let t=L.useContext(Sh);return Wn(t,w4(e)),t}function T4(e,{target:t,replace:n,unstable_mask:i,state:r,preventScrollReset:s,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:f,unstable_useTransitions:p}={}){let m=Z0(),g=wl(),x=Wm(e,{relative:l});return L.useCallback(v=>{if(i4(v,t)){v.preventDefault();let S=n!==void 0?n:km(g)===km(x),A=()=>m(e,{replace:S,unstable_mask:i,state:r,preventScrollReset:s,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:f});p?L.startTransition(()=>A()):A()}},[g,m,x,n,i,r,t,e,s,l,c,f,p])}var C4=0,A4=()=>`__${String(++C4)}__`;function M4(){let{router:e}=VC("useSubmit"),{basename:t}=L.useContext(ss),n=VO(),i=e.fetch,r=e.navigate;return L.useCallback(async(s,l={})=>{let{action:c,method:f,encType:p,formData:m,body:g}=s4(s,t);if(l.navigate===!1){let x=l.fetcherKey||A4();await i(x,n,l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||f,formEncType:l.encType||p,flushSync:l.flushSync})}else await r(l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||f,formEncType:l.encType||p,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[i,r,t,n])}function R4(e,{relative:t}={}){let{basename:n}=L.useContext(ss),i=L.useContext(El);Wn(i,"useFormAction must be used inside a RouteContext");let[r]=i.matches.slice(-1),s={...Wm(e||".",{relative:t})},l=wl();if(e==null){s.search=l.search;let c=new URLSearchParams(s.search),f=c.getAll("index");if(f.some(m=>m==="")){c.delete("index"),f.filter(g=>g).forEach(g=>c.append("index",g));let m=c.toString();s.search=m?`?${m}`:""}}return(!e||e===".")&&r.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:po([n,s.pathname])),km(s)}function k4(e,{relative:t}={}){let n=L.useContext(zC);Wn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=VC("useViewTransitionState"),r=Wm(e,{relative:t});if(!n.isTransitioning)return!1;let s=sc(n.currentLocation.pathname,i)||n.currentLocation.pathname,l=sc(n.nextLocation.pathname,i)||n.nextLocation.pathname;return w0(r.pathname,l)!=null||w0(r.pathname,s)!=null}AC();const fE=e=>{let t;const n=new Set,i=(p,m)=>{const g=typeof p=="function"?p(t):p;if(!Object.is(g,t)){const x=t;t=m??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(v=>v(t,x))}},r=()=>t,c={setState:i,getState:r,getInitialState:()=>f,subscribe:p=>(n.add(p),()=>n.delete(p))},f=t=e(i,r,c);return c},N4=(e=>e?fE(e):fE),O4=e=>e;function D4(e,t=O4){const n=fm.useSyncExternalStore(e.subscribe,fm.useCallback(()=>t(e.getState()),[e,t]),fm.useCallback(()=>t(e.getInitialState()),[e,t]));return fm.useDebugValue(n),n}const hE=e=>{const t=N4(e),n=i=>D4(t,i);return Object.assign(n,t),n},fu=(e=>e?hE(e):hE),gl=fu(e=>({user:null,isAuthenticated:!1,loading:!1,error:null,login:async(t,n)=>{e({loading:!0,error:null});try{const i=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t,password:n}),credentials:"include"}),r=await i.json();if(!i.ok){e({loading:!1,error:r.error||"Login failed"});return}e({user:r.user,isAuthenticated:!0,loading:!1,error:null})}catch{e({loading:!1,error:"Network error"})}},logout:async()=>{try{await fetch("/api/auth/logout",{method:"POST",credentials:"include"})}catch{}e({user:null,isAuthenticated:!1,error:null})},checkAuth:async()=>{e({loading:!0});try{const t=await fetch("/api/auth/me",{credentials:"include"});if(t.ok){const n=await t.json();e({user:n.user,isAuthenticated:!0,loading:!1})}else e({user:null,isAuthenticated:!1,loading:!1})}catch{e({user:null,isAuthenticated:!1,loading:!1})}},reset:()=>e({user:null,isAuthenticated:!1,loading:!1,error:null})})),vr=fu((e,t)=>({squads:[],selectedSquad:null,activeStates:{},uiComponents:{},fetchSquads:async()=>{try{const n=await fetch("/api/squads",{credentials:"include"});if(n.ok){const i=await n.json();e({squads:i.squads})}}catch{}},selectSquad:n=>e({selectedSquad:n}),setSquadState:(n,i)=>e(r=>({activeStates:{...r.activeStates,[n]:i}})),clearSquadState:n=>e(i=>{const{[n]:r,...s}=i.activeStates;return{activeStates:s}}),setUiComponents:(n,i)=>e(r=>({uiComponents:{...r.uiComponents,[n]:i}})),reset:()=>e({squads:[],selectedSquad:null,activeStates:{},uiComponents:{}})}));let z4=0;function pE(){return`local-${Date.now()}-${++z4}`}const rr=fu((e,t)=>({conversations:[],messages:[],conversationId:null,streaming:!1,streamingText:"",activity:null,error:null,addUserMessage:n=>{const i={id:pE(),role:"user",content:n,createdAt:new Date().toISOString()};e(r=>{const s=r.conversationId,l=s&&!r.messages.some(c=>c.role==="user")?r.conversations.map(c=>c.id===s?{...c,preview:n.slice(0,80)}:c):r.conversations;return{messages:[...r.messages,i],error:null,conversations:l}})},setConversationId:n=>{e({conversationId:n})},startStreaming:()=>{e({streaming:!0,streamingText:"",activity:null,error:null})},appendChunk:n=>{e(i=>({streamingText:i.streamingText+n,activity:null}))},setActivity:n=>{e({activity:n})},finishStreaming:n=>{const{streamingText:i}=t(),r={id:n,role:"assistant",content:i,createdAt:new Date().toISOString()};e(s=>({messages:[...s.messages,r],streaming:!1,streamingText:"",activity:null}))},addAgentDm:n=>{const i={id:pE(),role:"agent_dm",content:n.content,agentId:n.agentId,agentName:n.agentName,createdAt:new Date().toISOString()};e(r=>({messages:[...r.messages,i]}))},setError:n=>{e({error:n,streaming:!1,streamingText:"",activity:null})},loadConversations:async n=>{try{const i=await fetch(`/api/squads/${n}/conversations`,{credentials:"include"});if(!i.ok)return;const s=((await i.json()).data||[]).map(l=>({id:l.id,createdAt:l.created_at,preview:""}));for(const l of s)try{const c=await fetch(`/api/conversations/${l.id}/messages?limit=1`,{credentials:"include"});if(c.ok){const p=((await c.json()).data||[])[0];p&&(l.preview=p.content.slice(0,80))}}catch{}e({conversations:s})}catch{}},selectConversation:async n=>{e({conversationId:n,messages:[],streaming:!1,streamingText:"",activity:null,error:null});try{const i=await fetch(`/api/conversations/${n}/messages`,{credentials:"include"});if(!i.ok)return;const s=((await i.json()).data||[]).map(l=>({id:l.id,role:l.role,content:l.content,agentId:l.agent_id??void 0,agentName:l.agent_name??void 0,createdAt:l.created_at}));e({messages:s})}catch{}},deleteConversation:async(n,i)=>{try{if(!(await fetch(`/api/conversations/${n}`,{method:"DELETE",credentials:"include"})).ok)return;const{conversationId:s}=t();e(l=>({conversations:l.conversations.filter(c=>c.id!==n)})),s===n&&e({conversationId:null,messages:[]})}catch{}},loadHistory:async n=>{try{const i=await fetch(`/api/squads/${n}/conversations`,{credentials:"include"});if(!i.ok)return;const r=await i.json();if(!r.data||r.data.length===0){e({conversationId:null,messages:[],conversations:[]});return}const s=(r.data||[]).map(g=>({id:g.id,createdAt:g.created_at,preview:""})),l=r.data[0];e({conversationId:l.id,conversations:s});const c=await fetch(`/api/conversations/${l.id}/messages`,{credentials:"include"});if(!c.ok)return;const p=((await c.json()).data||[]).map(g=>({id:g.id,role:g.role,content:g.content,agentId:g.agent_id??void 0,agentName:g.agent_name??void 0,createdAt:g.created_at})),m=p.find(g=>g.role==="user");if(m){const g=s.findIndex(x=>x.id===l.id);g>=0&&(s[g].preview=m.content.slice(0,80))}e({messages:p,conversations:s});for(const g of s)if(g.id!==l.id)try{const x=await fetch(`/api/conversations/${g.id}/messages?limit=1`,{credentials:"include"});if(x.ok){const S=((await x.json()).data||[])[0];S&&(g.preview=S.content.slice(0,80))}}catch{}e({conversations:[...s]})}catch{}},reset:()=>e({conversations:[],messages:[],conversationId:null,streaming:!1,streamingText:"",error:null})}));function B4(e){const n=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`,i=new WebSocket(n),r=[];let s=!0;function l(c){i.readyState===WebSocket.OPEN?i.send(JSON.stringify(c)):i.readyState===WebSocket.CONNECTING&&r.push(c)}return i.onopen=()=>{var c,f;s||(f=(c=e.current).onReconnect)==null||f.call(c),s=!1;for(const p of r)i.send(JSON.stringify(p));r.length=0},i.onmessage=c=>{var f,p,m,g,x,v,S,A,T,C,N,R,O,H,D,q,Z,V,Y;try{const F=JSON.parse(c.data),j=e.current;switch(F.type){case"squad:state":(f=j.onSquadState)==null||f.call(j,F.squadName,F.state);break;case"squad:inactive":(p=j.onSquadInactive)==null||p.call(j,F.squadName,F.reason);break;case"chat:chunk":(m=j.onChatChunk)==null||m.call(j,F.squadName,F.conversationId,F.delta);break;case"chat:activity":(g=j.onChatActivity)==null||g.call(j,F.squadName,F.tool,F.summary);break;case"chat:done":(x=j.onChatDone)==null||x.call(j,F.squadName,F.conversationId,F.messageId);break;case"chat:error":(v=j.onChatError)==null||v.call(j,F.squadName,F.error);break;case"chat:agent_dm":(S=j.onChatAgentDm)==null||S.call(j,F.squadName,F.conversationId,F.agentId,F.agentName,F.message);break;case"chat:conversation_created":(A=j.onChatConversationCreated)==null||A.call(j,F.squadName,F.conversationId);break;case"agent:output_chunk":(T=j.onAgentOutputChunk)==null||T.call(j,F.squadName,F.agentId,F.agentName,F.delta);break;case"agent:step_start":(C=j.onAgentStepStart)==null||C.call(j,F.squadName,F.agentId,F.agentName,F.stepIndex,F.stepLabel);break;case"agent:step_complete":(N=j.onAgentStepComplete)==null||N.call(j,F.squadName,F.agentId,F.agentName,F.stepIndex,F.stepLabel);break;case"squad:checkpoint":(R=j.onSquadCheckpoint)==null||R.call(j,F.squadName,F.agentId,F.agentName,F.question);break;case"schedule:started":(O=j.onScheduleStarted)==null||O.call(j,F.squadName,F.jobId,F.attempt);break;case"schedule:chunk":(H=j.onScheduleChunk)==null||H.call(j,F.squadName,F.jobId,F.delta);break;case"schedule:done":(D=j.onScheduleDone)==null||D.call(j,F.squadName,F.jobId,F.summary,F.attempt);break;case"schedule:error":(q=j.onScheduleError)==null||q.call(j,F.squadName,F.jobId,F.error,F.attempt,F.willRetry);break;case"schedule:status_changed":(Z=j.onScheduleStatusChanged)==null||Z.call(j,F.squadName,F.status);break;case"kanban:task_updated":(V=j.onKanbanTaskUpdated)==null||V.call(j,F);break;case"a2ui:update":(Y=j.onA2uiUpdate)==null||Y.call(j,F.squadName,F.components);break}}catch{}},{subscribe:c=>{l({type:"squad:subscribe",squadName:c})},unsubscribe:c=>{l({type:"squad:unsubscribe",squadName:c})},sendChat:(c,f,p)=>{const m={type:"chat:send",squadName:c,message:f};p&&p.length>0&&(m.files=p),l(m)},newConversation:c=>{l({type:"chat:new_conversation",squadName:c})},sendCheckpointResponse:(c,f)=>{l({type:"squad:checkpoint_response",squadName:c,answer:f})},disconnect:()=>{i.close()}}}function L4(e={}){const t=L.useRef(null),n=L.useRef(e),i=L.useRef(new Set);n.current=e,L.useEffect(()=>{const p=B4(n);t.current=p;for(const m of i.current)p.subscribe(m);return()=>{p.disconnect()}},[]);const r=L.useCallback(p=>{var m;i.current.add(p),(m=t.current)==null||m.subscribe(p)},[]),s=L.useCallback(p=>{var m;i.current.delete(p),(m=t.current)==null||m.unsubscribe(p)},[]),l=L.useCallback((p,m,g)=>{var x;(x=t.current)==null||x.sendChat(p,m,g)},[]),c=L.useCallback(p=>{var m;(m=t.current)==null||m.newConversation(p)},[]),f=L.useCallback((p,m)=>{var g;(g=t.current)==null||g.sendCheckpointResponse(p,m)},[]);return{subscribe:r,unsubscribe:s,sendChat:l,newConversation:c,sendCheckpointResponse:f}}function j4(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),i=e%60,r=s=>s.toString().padStart(2,"0");return t>0?`${t}h ${r(n)}m ${r(i)}s`:`${n}m ${r(i)}s`}function I4({state:e}){const[t,n]=L.useState(0);return L.useEffect(()=>{if(!(e!=null&&e.startedAt)||e.status!=="running"){n(0);return}const i=new Date(e.startedAt).getTime(),r=()=>n(Math.floor((Date.now()-i)/1e3));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[e==null?void 0:e.startedAt,e==null?void 0:e.status]),_.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"var(--statusbar-height)",padding:"0 var(--sp-4)",background:"var(--surface-1)",borderTop:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:e?_.jsxs(_.Fragment,{children:[_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[_.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:e.status==="running"?"var(--status-active)":e.status==="checkpoint"?"var(--status-warning)":"var(--status-idle)",boxShadow:e.status==="running"?"0 0 8px var(--status-active-glow)":"none",animation:e.status==="running"?"statusPulse 2s ease-in-out infinite":"none"}}),_.jsxs("span",{style:{color:"var(--text-secondary)"},children:["Step ",e.step.current,"/",e.step.total]}),_.jsx("span",{style:{color:"var(--border-strong)"},children:"│"}),_.jsx("span",{children:e.step.label})]}),_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[e.handoff&&_.jsxs("span",{style:{color:"var(--accent)"},children:[e.handoff.from," → ",e.handoff.to]}),e.status==="running"&&_.jsx("span",{style:{color:"var(--text-secondary)"},children:j4(t)})]})]}):_.jsxs(_.Fragment,{children:[_.jsx("span",{children:"Ready"}),_.jsx("span",{children:"ExpxAgents Mission Control"})]})})}let Fv=null;function U4(e){Fv=e}function XC(e,t,n){Fv&&Fv(e,t,n)}let Gv=null;function H4(e){Gv=e}function P4(e){Gv&&Gv(e)}let qv=null;function F4(e){qv=e}function G4(e,t){qv&&qv(e,t)}const m0=32,fl=96,iu=64,pt={floor:13158600,floorHighlight:14211288,floorGrout:12105912,wall:15261904,wallTrim:11577496,baseboard:7035464,desk:15263976,deskTop:16119285,deskShadow:13684944,deskLeg:1710618,deskEdge:14737632,monitor:2236976,monitorScreen:1981020,monitorScreenGlow:2773120,monitorStand:3355456,keyboard:3355456,keyboardKey:4473941,chairSeat:2899536,chairBack:3426654,chairBase:4473924,chairWheel:3355443,plant:5025616,plantDark:3706428,plantLight:6732650,pot:9133628,potRim:10515018,soil:4863264,bookshelf:8020808,bookshelfEdge:9139029,bookColors:[15022389,2001125,4431943,16750592,9315498,35195,16635957],rug:6044974,rugPattern:8016448,rugBorder:4861472},Yv=[5227511,5025616,16750592,15022389,9315498,16771899],q4={idle:8947848,working:5025616,delivering:5227511,done:5025616,checkpoint:16750592},Br={counter:4073251,counterTop:6111287,machine:3622735,machineTop:4545124,machineLight:5025616,cup:14142664,cupShadow:12364452,saucer:14735052,sink:7901340,faucet:11583173,menu:5125166},Wa={table:6111287,tableTop:7162945,tableEdge:5125166,tableLeg:4073251,chair:3622735,chairSeat:4545124,chairBack:5533306,carpet:2503224,carpetPattern:3030340,whiteboard:15527921,whiteboardFrame:7901340},md={background:1713022,backgroundGlow:2635155,statusRunning:5025616,statusIdle:8947848,statusCheckpoint:16750592,statusCompleted:5025616},au={floor:11579568,tile:11053224,grout:10066329,stripe:12632256},la={floor:14477552,tile:12966120,tileGrout:11453652,wall:14740208,stall:11583173,stallDoor:9479342,sink:15527921,sinkBowl:16777215,mirror:11789820,mirrorFrame:7901340,toilet:16448250,toiletSeat:15658734,pipe:9479342},Aa={floor:6111287,carpet:5125166,carpetBorder:4073251,desk:4073251,deskTop:6111287,deskEdge:2890510,chair:1713022,chairSeat:2635155,window:8508666,windowFrame:5533306,windowSill:7901340,bookshelf:7162945,globe:4367861,nameplate:16766720},ah={wall:7901340,wallHighlight:10795204,doorFrame:6111287},ir={floor:16115411,tile:15259072,tileGrout:13942952,counter:6111287,counterTop:7951688,fridge:15527921,fridgeDoor:14737632,fridgeHandle:10395294,table:9268835,tableTop:10586239,chair:7162945,coffeeMaker:3622735,coffeeMakerLight:5025616,lamp:16766287},Ma={floor:14142664,carpet:6323595,carpetBorder:4545124,sofa:5533306,sofaCushion:6323595,sofaArm:4545124,tv:2171169,tvScreen:2503224,tvStand:4342338,sideTable:7951688,magazine:15684432,magazineAlt:4367861},ec=480,Za=360,id=400,Gi=60,Qa=120,mb=120,mE=160,gE=120,yE=160,Y4=64,V4=80,X4=fl+32,K4=iu+48,xE=2,KC=10,Wo=80;function My(e,t,n){const i=Math.max(0,Math.min(1,n));return e+(t-e)*i}function $4(e){return e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2}const W4=["nw","ne","sw","se"],Q4={nw:"right",ne:"left",sw:"top",se:"top"};function T0(e){const t=KC,n=Math.max(1,e),i={nw:0,ne:0,sw:0,se:0},r=[];for(let Q=0;Q<n;Q++){const I=W4[Q%4];r.push({quadrant:I,slot:i[I]}),i[I]++}const s=Math.max(1,i.nw),l=Math.max(1,i.ne),c=Math.max(1,i.sw),f=Math.max(1,i.se),p=Math.max(id,Qa),m=s*(Za+t),g=l*(Za+t),x=Math.max(m+p,g+Qa),v=c*(Za+t),S=f*(Za+t),A=Math.max(mE,yE),T=Math.max(v+A+t,S+A+t),C=Math.max(ec,Qa+t+id),N=Math.max(ec,Qa),R=Math.max(ec,mb),O=Math.max(ec,gE),H=Math.max(C,R),D=Math.max(N,O),q=t+H+t+Gi+t+D+t,Z=t+x+t+Gi+t+T+t,V={x:t+H+t,y:t,width:Gi,height:Z-2*t},Y={x:t,y:t+x+t,width:q-2*t,height:Gi},F={x:V.x+V.width/2,y:Y.y+Y.height/2},j={x:V.x-t-id,y:Y.y-t-id,width:id,height:id},ee={x:j.x-t-Qa,y:Y.y-t-Qa,width:Qa,height:Qa},P={x:V.x+Gi+t,y:Y.y-t-Qa,width:Qa,height:Qa},W={x:V.x-t-mb,y:Y.y+Gi+t+c*(Za+t),width:mb,height:mE},z={x:V.x+Gi+t,y:Y.y+Gi+t+f*(Za+t),width:gE,height:yE},K=[],G={};for(let Q=0;Q<n;Q++){const{quadrant:I,slot:$}=r[Q],ne=Q4[I];let X;I==="nw"?X={x:V.x-t-ec,y:j.y-t-($+1)*Za-$*t}:I==="ne"?X={x:V.x+Gi+t,y:P.y-t-($+1)*Za-$*t}:I==="sw"?X={x:V.x-t-ec,y:Y.y+Gi+t+$*(Za+t)}:X={x:V.x+Gi+t,y:Y.y+Gi+t+$*(Za+t)},K.push({origin:X,width:ec,height:Za,quadrant:I,doorSide:ne}),ne==="right"||ne==="left"?G[`squad-${Q}`]={x:V.x+Gi/2,y:X.y+Za/2}:G[`squad-${Q}`]={x:X.x+ec/2,y:Y.y+Gi/2}}return G.ceo={x:V.x+Gi/2,y:j.y+id/2},G["bathroom-male"]={x:ee.x+Qa/2,y:Y.y+Gi/2},G["bathroom-female"]={x:P.x+Qa/2,y:Y.y+Gi/2},G.kitchen={x:V.x+Gi/2,y:W.y+W.height/2},G["rest-area"]={x:V.x+Gi/2,y:z.y+z.height/2},{totalWidth:q,totalHeight:Z,squadOrigins:K,ceoOffice:j,corridorH:Y,corridorV:V,bathroomMale:ee,bathroomFemale:P,kitchen:W,restArea:z,doorPoints:G,corridorHub:F}}function th(e,t,n,i){const r=e%xE,s=Math.floor(e/xE);return{x:t.x+Y4+r*X4,y:t.y+V4+s*K4}}function bm(e,t,n){return{x:e.x+t-80,y:e.y+n-80}}function $C(e,t,n){return{x:e.x+t-160,y:e.y+Math.floor(n/2)}}function Z4(e,t){const n=t==="male"?e.bathroomMale:e.bathroomFemale;return{x:n.x+n.width/2,y:n.y+n.height/2}}function J4(e){return{x:e.kitchen.x+e.kitchen.width/2,y:e.kitchen.y+e.kitchen.height/2}}function eD(e){return{x:e.restArea.x+e.restArea.width/2,y:e.restArea.y+e.restArea.height/2}}function tD(e){const t=e.corridorV;if(t.height>0&&Math.random()<.5)return{x:t.x+10+Math.random()*Math.max(0,t.width-20),y:t.y+10+Math.random()*Math.max(0,t.height-20)};const n=e.corridorH;return{x:n.x+20+Math.random()*Math.max(0,n.width-40),y:n.y+10+Math.random()*Math.max(0,n.height-20)}}function bE(e,t){const n=t.corridorH;return e.x>=n.x&&e.x<=n.x+n.width&&e.y>=n.y&&e.y<=n.y+n.height}function vE(e,t){const n=t.corridorV;return e.x>=n.x&&e.x<=n.x+n.width&&e.y>=n.y&&e.y<=n.y+n.height}function nD(e,t){if(e==="ceo"){const i=t.ceoOffice;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(e==="bathroom-male"){const i=t.bathroomMale;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(e==="bathroom-female"){const i=t.bathroomFemale;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(e==="kitchen"){const i=t.kitchen;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(e==="rest-area"){const i=t.restArea;return{x:i.x+i.width/2,y:i.y+i.height/2}}const n=e.match(/^squad-(\d+)$/);if(n){const i=parseInt(n[1],10),r=t.squadOrigins[i];if(r)return{x:r.origin.x+r.width/2,y:r.origin.y+r.height/2}}return t.corridorHub}function vm(e,t,n,i){const r=i.doorPoints[t],s=i.doorPoints[n];if(!r||!s)return[e];const l=i.corridorHub,c=nD(n,i),f=bE(r,i)&&bE(s,i),p=vE(r,i)&&vE(s,i);return f||p?[e,r,s,c]:[e,r,l,s,c]}function Ry(e,t){const n=e.x-t.x,i=e.y-t.y;return Math.sqrt(n*n+i*i)}const _E=500,SE=50;let EE=0;function wE(e){return{idle:"idle",working:"working",delivering:"walking",done:"idle",checkpoint:"checkpoint"}[e]??"idle"}const ai=fu(e=>({rooms:[],activeRoom:null,bubbles:{},activityLog:{},checkpoints:{},agentVisuals:{},appendBubble:(t,n,i)=>{const r=`${t}:${n}`;e(s=>{var f;let c=(((f=s.bubbles[r])==null?void 0:f.text)??"")+i;return c.length>_E&&(c=c.slice(c.length-_E)),{bubbles:{...s.bubbles,[r]:{text:c,updatedAt:Date.now()}}}})},clearBubble:(t,n)=>{const i=`${t}:${n}`;e(r=>{const{[i]:s,...l}=r.bubbles;return{bubbles:l}})},clearAllBubbles:()=>e({bubbles:{}}),addActivity:(t,n,i)=>{const s={id:++EE,agentName:n,action:i,timestamp:Date.now()};e(l=>{var m;const f=[...((m=l.activityLog[t])==null?void 0:m.entries)??[],s],p=f.length>SE?f.slice(f.length-SE):f;return{activityLog:{...l.activityLog,[t]:{entries:p}}}})},setCheckpoint:(t,n,i,r)=>e(s=>({checkpoints:{...s.checkpoints,[t]:{agentId:n,agentName:i,question:r}}})),clearCheckpoint:t=>e(n=>{const{[t]:i,...r}=n.checkpoints;return{checkpoints:r}}),setActiveRoom:t=>e({activeRoom:t}),syncRooms:t=>e(n=>{const i=t;let r;return i.length===0?r=null:n.activeRoom===null||!i.includes(n.activeRoom)?r=i[0]:r=n.activeRoom,{rooms:i,activeRoom:r}}),setAgents:(t,n)=>e(i=>{const r=i.agentVisuals[t]??[],s=new Map(r.map(v=>[v.id,v])),l={x:0,y:0},c=T0(i.rooms.length),f=i.rooms.indexOf(t),p=c.squadOrigins[f],m=(p==null?void 0:p.width)??480,g=(p==null?void 0:p.height)??360,x=n.map((v,S)=>{const A=s.get(v.id);if(A){const N=v.status?wE(v.status):A.status,R=N!==A.status;let O=A.targetPosition;return R&&(N==="working"||N==="checkpoint"?O=th(S,l):O=bm(l,m,g)),{...A,name:v.name,avatar:v.avatar,deskIndex:S,status:N,targetPosition:O}}const T=v.status?wE(v.status):"idle",C=T==="working"||T==="checkpoint"?th(S,l):bm(l,m,g);return{id:v.id,name:v.name,avatar:v.avatar,colorIndex:S%6,status:T,deskIndex:S,position:C,targetPosition:null}});return{agentVisuals:{...i.agentVisuals,[t]:x}}}),setAgentStatus:(t,n,i)=>e(r=>{const s=r.agentVisuals[t];if(!s)return r;const l={x:0,y:0},c=T0(r.rooms.length),f=r.rooms.indexOf(t),p=c.squadOrigins[f],m=(p==null?void 0:p.width)??480,g=(p==null?void 0:p.height)??360,x=s.map(v=>{if(v.id!==n)return v;let S;return i==="working"||i==="checkpoint"?S=th(v.deskIndex,l):S=bm(l,m,g),{...v,status:i,targetPosition:S}});return{agentVisuals:{...r.agentVisuals,[t]:x}}}),reset:()=>{EE=0,e({rooms:[],activeRoom:null,bubbles:{},activityLog:{},checkpoints:{},agentVisuals:{}})}})),aQ={background:"#0a0a0f",grid:"rgba(0, 200, 255, 0.06)",orbStandby:"#1a3a5c",orbListening:"#00c8ff",orbProcessing:"#ff8c00",orbSpeaking:"#00ff88",panelBg:"rgba(0, 200, 255, 0.08)",panelBorder:"rgba(0, 200, 255, 0.25)",textPrimary:"#e0e8f0",textAccent:"#00c8ff",textJarvis:"#00ff88",particleStart:"#00c8ff"},iD={orbRadius:60,orbRingWidth:3,gridSpacing:40,particleCount:65,particleMinRadius:1,particleMaxRadius:3,waveformBars:32,waveformMaxHeight:40,panelWidth:180,panelPadding:12,transcriptLineHeight:20,standbyTimeoutMs:15e3,ttsSplitLength:300};let WC=0;function rD(){return`jarvis-${Date.now()}-${++WC}`}let lo=null;const gb=fu((e,t)=>({mode:"STANDBY",messages:[],streamingText:"",selectedSquad:null,userName:"",setMode:n=>e({mode:n}),addMessage:(n,i)=>{const r={id:rD(),role:n,content:i,createdAt:new Date().toISOString()};e(s=>({messages:[...s.messages,r]}))},appendChunk:n=>{e(i=>({streamingText:i.streamingText+n}))},finalizeMessage:n=>{const{streamingText:i}=t(),r={id:n,role:"assistant",content:i,createdAt:new Date().toISOString()};e(s=>({messages:[...s.messages,r],streamingText:""}))},selectSquad:n=>e({selectedSquad:n}),setUserName:n=>e({userName:n}),startStandbyTimer:()=>{lo&&clearTimeout(lo),lo=setTimeout(()=>{e({mode:"STANDBY"}),lo=null},iD.standbyTimeoutMs)},resetStandbyTimer:()=>{t().startStandbyTimer()},clearStandbyTimer:()=>{lo&&(clearTimeout(lo),lo=null)},reset:()=>{lo&&(clearTimeout(lo),lo=null),WC=0,e({mode:"STANDBY",messages:[],streamingText:"",selectedSquad:null,userName:""})}})),ua=fu((e,t)=>({jobs:[],loading:!1,history:{},historyLoading:{},fetchJobs:async()=>{e({loading:!0});try{const n=await fetch("/api/scheduler",{credentials:"include"});if(n.ok){const i=await n.json();e({jobs:i.data,loading:!1})}else e({loading:!1})}catch{e({loading:!1})}},createJob:async n=>(await fetch("/api/scheduler",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok?(t().fetchJobs(),!0):!1,deleteJob:async n=>{await fetch(`/api/scheduler/${n}`,{method:"DELETE",credentials:"include"}),t().fetchJobs()},pauseJob:async n=>{await fetch(`/api/scheduler/${n}/pause`,{method:"POST",credentials:"include"}),t().fetchJobs()},resumeJob:async n=>{await fetch(`/api/scheduler/${n}/resume`,{method:"POST",credentials:"include"}),t().fetchJobs()},triggerJob:async n=>{await fetch(`/api/scheduler/${n}/trigger`,{method:"POST",credentials:"include"})},updateJobStatus:(n,i)=>{e(r=>({jobs:r.jobs.map(s=>s.squad_name===n?{...s,status:i}:s)}))},fetchHistory:async n=>{e(i=>({historyLoading:{...i.historyLoading,[n]:!0}}));try{const i=await fetch(`/api/scheduler/${n}/history?limit=50`,{credentials:"include"});if(i.ok){const r=await i.json();e(s=>({history:{...s.history,[n]:r.data},historyLoading:{...s.historyLoading,[n]:!1}}))}else e(r=>({historyLoading:{...r.historyLoading,[n]:!1}}))}catch{e(i=>({historyLoading:{...i.historyLoading,[n]:!1}}))}}})),aD=600*1e3;function sD(){const[e,t]=L.useState(null),[n,i]=L.useState(!1),[r,s]=L.useState(!1),l=L.useCallback(async()=>{try{const f=await fetch("/api/system/version",{credentials:"include"});if(f.ok){const p=await f.json();t(p)}}catch{}},[]);L.useEffect(()=>{l();const f=setInterval(l,aD);return()=>clearInterval(f)},[l]);const c=async()=>{i(!0);try{await fetch("/api/system/update",{method:"POST",credentials:"include"})}catch{i(!1)}};return!(e!=null&&e.updateAvailable)||r?null:_.jsx("div",{"data-testid":"update-banner",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"var(--sp-3)",padding:"8px var(--sp-4)",background:"var(--surface-2)",borderBottom:"1px solid var(--accent)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)",animation:"fadeIn 0.3s var(--ease-out) both"},children:n?_.jsxs("span",{style:{color:"var(--accent)"},children:["Updating to v",e.latest,"... Server will restart automatically."]}):_.jsxs(_.Fragment,{children:[_.jsxs("span",{children:["New version available: ",_.jsxs("strong",{style:{color:"var(--accent)"},children:["v",e.latest]}),_.jsxs("span",{style:{color:"var(--text-muted)",marginLeft:6},children:["(current: v",e.current,")"]})]}),_.jsx("button",{"data-testid":"btn-update",onClick:c,style:{padding:"3px 12px",borderRadius:"var(--radius-xs)",fontFamily:"var(--font-mono)",fontSize:"0.68rem",fontWeight:600,cursor:"pointer",border:"none",background:"var(--accent)",color:"var(--text-inverse)",transition:"opacity 0.15s ease"},children:"Update"}),_.jsx("button",{"data-testid":"btn-dismiss-update",onClick:()=>s(!0),style:{padding:"2px 6px",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.68rem"},children:"✕"})]})})}function lD(){if(typeof window>"u")return"dark";const e=localStorage.getItem("expx-theme");return e==="light"||e==="dark"?e:"dark"}function TE(e){document.documentElement.setAttribute("data-theme",e),localStorage.setItem("expx-theme",e)}const C0=fu((e,t)=>({theme:lD(),toggle:()=>{const n=t().theme==="dark"?"light":"dark";TE(n),e({theme:n})},setTheme:n=>{TE(n),e({theme:n})}})),oD=L.lazy(()=>ou(()=>import("./ThreeBackground-CptTZ2RL.js"),__vite__mapDeps([0,1])).then(e=>({default:e.ThreeBackground}))),cD=[{to:"/office",label:"Office",icon:"⬡"},{to:"/chat",label:"Chat",icon:"◈"},{to:"/kanban",label:"Kanban",icon:"▦"},{to:"/dashboard",label:"Dashboard",icon:"▣"},{to:"/scheduler",label:"Scheduler",icon:"⏣"},{to:"/email",label:"Email",icon:"✉"},{to:"/orgchart",label:"Org Chart",icon:"◎"},{to:"/graph",label:"Graph",icon:"◇"},{to:"/files",label:"Files",icon:"▤"},{to:"/settings",label:"Settings",icon:"⚙"}];function uD(){const e=gl(ie=>ie.user),t=gl(ie=>ie.isAuthenticated),n=gl(ie=>ie.loading),i=gl(ie=>ie.logout),r=gl(ie=>ie.checkAuth),s=Z0(),l=wl();l.pathname==="/office"||l.pathname;const c=l.pathname==="/jarvis",f=C0(ie=>ie.theme),p=C0(ie=>ie.toggle),m=vr(ie=>ie.squads),g=vr(ie=>ie.selectedSquad),x=vr(ie=>g?ie.activeStates[g]:null),v=vr(ie=>ie.fetchSquads),S=vr(ie=>ie.setSquadState),A=vr(ie=>ie.clearSquadState),T=L.useCallback((ie,de)=>{S(ie,de);const xe=ai.getState();xe.rooms.includes(ie)||xe.syncRooms([...xe.rooms,ie]),de.status!=="checkpoint"&&xe.clearCheckpoint(ie),de.agents&&xe.setAgents(ie,de.agents.map(me=>({id:me.id,name:me.name,status:me.status})))},[S]),C=L.useCallback(ie=>{A(ie);const de=ai.getState(),xe=de.agentVisuals[ie];if(xe)for(const me of xe)de.setAgentStatus(ie,me.id,"idle")},[A]),N=L.useCallback((ie,de)=>{rr.setState(xe=>({conversationId:de,messages:[],conversations:[{id:de,createdAt:new Date().toISOString(),preview:""},...xe.conversations.filter(me=>me.id!==de)]}))},[]),R=L.useCallback((ie,de,xe)=>{if(ie==="_jarvis"){gb.getState().appendChunk(xe);return}const me=rr.getState();me.streaming||me.startStreaming(),me.appendChunk(xe)},[]),O=L.useCallback((ie,de,xe)=>{if(ie==="_jarvis"){gb.getState().finalizeMessage(xe);return}rr.getState().finishStreaming(xe)},[]),H=L.useCallback((ie,de)=>{if(ie==="_jarvis"){gb.getState().setMode("LISTENING");return}rr.getState().setError(de)},[]),D=L.useCallback((ie,de,xe)=>{ie!=="_jarvis"&&rr.getState().setActivity(`${de}${xe?" "+xe:""}`)},[]),q=L.useCallback((ie,de,xe,me,le)=>{rr.getState().addAgentDm({agentId:xe,agentName:me,content:le})},[]),Z=L.useCallback((ie,de,xe,me)=>{ai.getState().appendBubble(ie,de,me)},[]),V=L.useCallback((ie,de,xe,me,le)=>{ai.getState().addActivity(ie,xe,`started "${le}"`),ai.getState().setAgentStatus(ie,de,"working")},[]),Y=L.useCallback((ie,de,xe,me,le)=>{ai.getState().addActivity(ie,xe,`completed "${le}"`),ai.getState().setAgentStatus(ie,de,"idle")},[]),F=L.useCallback((ie,de,xe,me)=>{ai.getState().setCheckpoint(ie,de,xe,me),ai.getState().setAgentStatus(ie,de,"checkpoint")},[]),j=L.useCallback(()=>{ai.getState().clearAllBubbles()},[]),ee=L.useCallback((ie,de,xe)=>{ua.getState().fetchJobs()},[]),P=L.useCallback((ie,de,xe,me)=>{ua.getState().fetchJobs()},[]),W=L.useCallback((ie,de,xe,me,le)=>{ua.getState().fetchJobs()},[]),z=L.useCallback((ie,de)=>{ua.getState().updateJobStatus(ie,de)},[]),K=L.useCallback(ie=>{window.dispatchEvent(new CustomEvent("kanban:task_updated",{detail:ie}))},[]),G=L.useCallback((ie,de)=>{vr.getState().setUiComponents(ie,de)},[]),{subscribe:Q,unsubscribe:I,sendChat:$,newConversation:ne,sendCheckpointResponse:X}=L4({onSquadState:T,onSquadInactive:C,onChatConversationCreated:N,onChatChunk:R,onChatActivity:D,onChatDone:O,onChatError:H,onChatAgentDm:q,onAgentOutputChunk:Z,onAgentStepStart:V,onAgentStepComplete:Y,onSquadCheckpoint:F,onReconnect:j,onScheduleStarted:ee,onScheduleDone:P,onScheduleError:W,onScheduleStatusChanged:z,onKanbanTaskUpdated:K,onA2uiUpdate:G});L.useEffect(()=>{U4($)},[$]),L.useEffect(()=>{H4(ne)},[ne]),L.useEffect(()=>{F4(X)},[X]),L.useEffect(()=>{v().then(()=>{const{squads:ie}=vr.getState();if(ie.length>0){const de=ai.getState(),xe=ie.map(Re=>Re.code),me=de.rooms,le=[...new Set([...me,...xe])];de.syncRooms(le);for(const Re of ie)!de.agentVisuals[Re.code]&&Re.agents&&Re.agents.length>0&&de.setAgents(Re.code,Re.agents.map(je=>({id:je.id,name:je.name,avatar:je.avatar,status:"idle"})))}})},[v]);const ce=ai(ie=>ie.rooms);return L.useEffect(()=>{for(const ie of ce)Q(ie);return()=>{for(const ie of ce)I(ie)}},[ce,Q,I]),L.useEffect(()=>(Q("_expxagents"),()=>I("_expxagents")),[Q,I]),L.useEffect(()=>{if(c)return Q("_jarvis"),()=>I("_jarvis")},[c,Q,I]),L.useEffect(()=>{t||r()},[]),L.useEffect(()=>{!n&&!t&&s("/login",{state:{from:l.pathname}})},[n,t,s,l.pathname]),c?_.jsx(uE,{}):_.jsxs("div",{className:"noise-bg",style:{display:"flex",flexDirection:"column",height:"100vh",background:"var(--surface-0)",color:"var(--text-primary)"},children:[_.jsxs("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"var(--header-height)",padding:"0 var(--sp-4)",background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)",position:"relative",zIndex:10},children:[_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[_.jsx("div",{style:{width:28,height:28,borderRadius:"var(--radius-sm)",background:"linear-gradient(135deg, var(--accent), var(--accent-dim))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.8rem",fontWeight:700,color:"var(--text-inverse)",boxShadow:"0 0 12px var(--accent-glow-strong)"},children:"EX"}),_.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",letterSpacing:"-0.02em"},children:"ExpxAgents"}),_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",background:"var(--surface-3)",padding:"2px 6px",borderRadius:"var(--radius-xs)",letterSpacing:"0.05em"},children:"MISSION CONTROL"})]}),_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-4)"},children:[_.jsx("button",{"data-testid":"btn-restart-server",onClick:async()=>{if(confirm("Restart the server? It will be briefly unavailable."))try{await fetch("/api/system/restart",{method:"POST",credentials:"include"})}catch{}},title:"Restart server",style:{background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.7rem",padding:"3px 8px",borderRadius:"var(--radius-xs)",transition:"all var(--duration-fast) var(--ease-out)",display:"flex",alignItems:"center",gap:4},onMouseEnter:ie=>{ie.currentTarget.style.color="var(--accent)",ie.currentTarget.style.borderColor="var(--accent)"},onMouseLeave:ie=>{ie.currentTarget.style.color="var(--text-muted)",ie.currentTarget.style.borderColor="var(--border-subtle)"},children:"↻ Restart"}),_.jsx("button",{"data-testid":"btn-toggle-theme",onClick:p,title:`Switch to ${f==="dark"?"light":"dark"} mode`,style:{background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.85rem",padding:"3px 8px",borderRadius:"var(--radius-xs)",transition:"all var(--duration-fast) var(--ease-out)",display:"flex",alignItems:"center",gap:4,lineHeight:1},onMouseEnter:ie=>{ie.currentTarget.style.color="var(--accent)",ie.currentTarget.style.borderColor="var(--accent)"},onMouseLeave:ie=>{ie.currentTarget.style.color="var(--text-muted)",ie.currentTarget.style.borderColor="var(--border-subtle)"},children:f==="dark"?"☀":"☽"}),_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:[_.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"var(--status-active)",boxShadow:"0 0 8px var(--status-active-glow)",animation:"statusPulse 2s ease-in-out infinite"}}),_.jsx("span",{children:e==null?void 0:e.username})]}),_.jsx("button",{onClick:i,className:"btn-ghost",style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-display)",fontSize:"0.75rem",padding:"4px 8px",borderRadius:"var(--radius-xs)",transition:"color var(--duration-fast) var(--ease-out)"},onMouseEnter:ie=>ie.currentTarget.style.color="var(--status-error)",onMouseLeave:ie=>ie.currentTarget.style.color="var(--text-muted)",children:"Logout"})]})]}),_.jsx(sD,{}),_.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[_.jsxs("aside",{style:{width:"var(--sidebar-width)",background:"var(--surface-1)",borderRight:"1px solid var(--border-subtle)",display:"flex",flexDirection:"column",overflowY:"auto"},children:[_.jsxs("nav",{style:{padding:"var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-1)",flex:1},children:[_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em",padding:"0 var(--sp-2)",marginBottom:"var(--sp-1)"},children:"Navigation"}),cD.map(ie=>_.jsxs(YC,{to:ie.to,style:({isActive:de})=>({display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",borderRadius:"var(--radius-sm)",textDecoration:"none",fontSize:"0.82rem",fontWeight:de?600:400,color:de?"var(--accent)":"var(--text-secondary)",background:de?"var(--accent-glow)":"transparent",border:de?"1px solid var(--accent-glow)":"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)"}),children:[_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:ie.icon}),ie.label]},ie.to)),_.jsx("div",{style:{height:1,margin:"var(--sp-2) var(--sp-2)",background:"var(--border-subtle)"}}),_.jsxs("a",{href:"/jarvis",target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",borderRadius:"var(--radius-sm)",textDecoration:"none",fontSize:"0.82rem",fontWeight:500,color:"var(--status-active)",background:"var(--status-active-glow)",border:"1px solid var(--status-active-glow)",transition:"all var(--duration-fast) var(--ease-out)"},children:[_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:"◉"}),"Jarvis",_.jsx("span",{style:{marginLeft:"auto",fontFamily:"var(--font-mono)",fontSize:"0.55rem",opacity:.6},children:"↗"})]})]}),_.jsxs("div",{style:{padding:"var(--sp-3)",borderTop:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",display:"flex",justifyContent:"space-between"},children:[_.jsxs("span",{children:[m.length," squad",m.length!==1?"s":""]}),_.jsx("span",{children:"v0.1.0"})]})]}),_.jsxs("main",{className:"grid-bg",style:{flex:1,overflow:"hidden",position:"relative"},children:[_.jsx(L.Suspense,{fallback:null,children:_.jsx(oD,{opacity:.4})}),_.jsx("div",{style:{position:"relative",zIndex:1,height:"100%",overflow:"auto"},children:_.jsx(uE,{})})]})]}),_.jsx(I4,{state:x})]})}const dD=L.lazy(()=>ou(()=>import("./ThreeBackground-CptTZ2RL.js"),__vite__mapDeps([0,1])).then(e=>({default:e.ThreeBackground})));function fD(){var S;const[e,t]=L.useState(""),[n,i]=L.useState(""),r=gl(A=>A.login),s=gl(A=>A.loading),l=gl(A=>A.error),c=gl(A=>A.isAuthenticated),f=Z0(),m=((S=wl().state)==null?void 0:S.from)||"/";L.useEffect(()=>{c&&f(m,{replace:!0})},[c,f,m]);const g=A=>{A.preventDefault(),r(e,n)},x=C0(A=>A.theme),v=C0(A=>A.toggle);return _.jsxs("div",{className:"noise-bg",style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",background:"var(--surface-0)",position:"relative",overflow:"hidden"},children:[_.jsx(L.Suspense,{fallback:null,children:_.jsx(dD,{opacity:.6})}),_.jsx("button",{onClick:v,title:`Switch to ${x==="dark"?"light":"dark"} mode`,style:{position:"absolute",top:16,right:16,zIndex:10,background:"var(--surface-2)",border:"1px solid var(--border-default)",color:"var(--text-secondary)",cursor:"pointer",fontSize:"1rem",padding:"6px 10px",borderRadius:"var(--radius-sm)",transition:"all var(--duration-fast) var(--ease-out)",lineHeight:1},children:x==="dark"?"☀":"☽"}),_.jsxs("div",{style:{animation:"fadeInUp 0.6s var(--ease-out) both",width:360,position:"relative",zIndex:1},children:[_.jsxs("div",{style:{textAlign:"center",marginBottom:"var(--sp-8)"},children:[_.jsx("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:48,height:48,borderRadius:"var(--radius-md)",background:"linear-gradient(135deg, var(--accent), var(--accent-dim))",fontSize:"1.1rem",fontWeight:800,color:"var(--text-inverse)",boxShadow:"var(--shadow-glow-strong)",marginBottom:"var(--sp-4)"},children:"EX"}),_.jsx("h1",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.4rem",color:"var(--text-primary)",letterSpacing:"-0.02em",marginBottom:"var(--sp-1)"},children:"ExpxAgents"}),_.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.15em"},children:"Mission Control"})]}),_.jsxs("form",{onSubmit:g,className:"glass",style:{padding:"var(--sp-6)",borderRadius:"var(--radius-lg)",boxShadow:"var(--shadow-lg)"},children:[l&&_.jsx("div",{style:{padding:"var(--sp-2) var(--sp-3)",marginBottom:"var(--sp-4)",borderRadius:"var(--radius-sm)",background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",fontSize:"0.8rem",fontFamily:"var(--font-mono)"},children:l}),_.jsxs("div",{style:{marginBottom:"var(--sp-3)"},children:[_.jsx("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:"Username"}),_.jsx("input",{type:"text",className:"input",placeholder:"Enter username",value:e,onChange:A=>t(A.target.value),autoFocus:!0})]}),_.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[_.jsx("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:"Password"}),_.jsx("input",{type:"password",className:"input",placeholder:"Enter password",value:n,onChange:A=>i(A.target.value)})]}),_.jsx("button",{type:"submit",disabled:s,className:"btn btn-accent",style:{width:"100%",padding:"var(--sp-3)",fontSize:"0.85rem",cursor:s?"wait":"pointer",opacity:s?.7:1},children:s?"Authenticating...":"Access Mission Control"})]}),_.jsx("p",{style:{textAlign:"center",marginTop:"var(--sp-4)",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:"AI Squad Orchestration Platform"})]})]})}function QC(e,t,n){if(!e)return;if(n(e)===!0)return e;let i=e.child;for(;i;){const r=QC(i,t,n);if(r)return r;i=i.sibling}}function ZC(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const Z1=ZC(L.createContext(null));let JC=class extends L.Component{render(){return L.createElement(Z1.Provider,{value:this._reactInternals},this.props.children)}};function hD(){const e=L.useContext(Z1);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=L.useId();return L.useMemo(()=>{for(const n of[e,e==null?void 0:e.alternate]){if(!n)continue;const i=QC(n,!1,r=>{let s=r.memoizedState;for(;s;){if(s.memoizedState===t)return!0;s=s.next}});if(i)return i}},[e,t])}const pD=Symbol.for("react.context"),mD=e=>e!==null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===pD;function gD(){const e=hD(),[t]=L.useState(()=>new Map);t.clear();let n=e;for(;n;){const i=n.type;mD(i)&&i!==Z1&&!t.has(i)&&t.set(i,L.use(ZC(i))),n=n.return}return t}function yD(){const e=gD();return L.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>i=>L.createElement(t,null,L.createElement(n.Provider,{...i,value:e.get(n)})),t=>L.createElement(JC,{...t})),[e])}var kt=(e=>(e.Application="application",e.WebGLPipes="webgl-pipes",e.WebGLPipesAdaptor="webgl-pipes-adaptor",e.WebGLSystem="webgl-system",e.WebGPUPipes="webgpu-pipes",e.WebGPUPipesAdaptor="webgpu-pipes-adaptor",e.WebGPUSystem="webgpu-system",e.CanvasSystem="canvas-system",e.CanvasPipesAdaptor="canvas-pipes-adaptor",e.CanvasPipes="canvas-pipes",e.Asset="asset",e.LoadParser="load-parser",e.ResolveParser="resolve-parser",e.CacheParser="cache-parser",e.DetectionParser="detection-parser",e.MaskEffect="mask-effect",e.BlendMode="blend-mode",e.TextureSource="texture-source",e.Environment="environment",e.ShapeBuilder="shape-builder",e.Batcher="batcher",e))(kt||{});const Vv=e=>{if(typeof e=="function"||typeof e=="object"&&e.extension){if(!e.extension)throw new Error("Extension class must have an extension object");e={...typeof e.extension!="object"?{type:e.extension}:e.extension,ref:e}}if(typeof e=="object")e={...e};else throw new Error("Invalid extension type");return typeof e.type=="string"&&(e.type=[e.type]),e},ky=(e,t)=>Vv(e).priority??t,li={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(Vv).forEach(t=>{t.type.forEach(n=>{var i,r;return(r=(i=this._removeHandlers)[n])==null?void 0:r.call(i,t)})}),this},add(...e){return e.map(Vv).forEach(t=>{t.type.forEach(n=>{var s,l;const i=this._addHandlers,r=this._queue;i[n]?(l=i[n])==null||l.call(i,t):(r[n]=r[n]||[],(s=r[n])==null||s.push(t))})}),this},handle(e,t,n){var l;const i=this._addHandlers,r=this._removeHandlers;if(i[e]||r[e])throw new Error(`Extension type ${e} already has a handler`);i[e]=t,r[e]=n;const s=this._queue;return s[e]&&((l=s[e])==null||l.forEach(c=>t(c)),delete s[e]),this},handleByMap(e,t){return this.handle(e,n=>{n.name&&(t[n.name]=n.ref)},n=>{n.name&&delete t[n.name]})},handleByNamedList(e,t,n=-1){return this.handle(e,i=>{t.findIndex(s=>s.name===i.name)>=0||(t.push({name:i.name,value:i.ref}),t.sort((s,l)=>ky(l.value,n)-ky(s.value,n)))},i=>{const r=t.findIndex(s=>s.name===i.name);r!==-1&&t.splice(r,1)})},handleByList(e,t,n=-1){return this.handle(e,i=>{t.includes(i.ref)||(t.push(i.ref),t.sort((r,s)=>ky(s,n)-ky(r,n)))},i=>{const r=t.indexOf(i.ref);r!==-1&&t.splice(r,1)})},mixin(e,...t){for(const n of t)Object.defineProperties(e.prototype,Object.getOwnPropertyDescriptors(n))}},xD={extension:{type:kt.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await ou(()=>import("./browserAll-qdXfu7ne.js"),__vite__mapDeps([2,3]))}},bD={extension:{type:kt.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await ou(()=>import("./webworkerAll-CZHbXKvf.js"),[])}};class br{constructor(t,n,i){this._x=n||0,this._y=i||0,this._observer=t}clone(t){return new br(t??this._observer,this._x,this._y)}set(t=0,n=t){return(this._x!==t||this._y!==n)&&(this._x=t,this._y=n,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}var yb={exports:{}},CE;function vD(){return CE||(CE=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(n=!1));function r(f,p,m){this.fn=f,this.context=p,this.once=m||!1}function s(f,p,m,g,x){if(typeof m!="function")throw new TypeError("The listener must be a function");var v=new r(m,g||f,x),S=n?n+p:p;return f._events[S]?f._events[S].fn?f._events[S]=[f._events[S],v]:f._events[S].push(v):(f._events[S]=v,f._eventsCount++),f}function l(f,p){--f._eventsCount===0?f._events=new i:delete f._events[p]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var p=[],m,g;if(this._eventsCount===0)return p;for(g in m=this._events)t.call(m,g)&&p.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(m)):p},c.prototype.listeners=function(p){var m=n?n+p:p,g=this._events[m];if(!g)return[];if(g.fn)return[g.fn];for(var x=0,v=g.length,S=new Array(v);x<v;x++)S[x]=g[x].fn;return S},c.prototype.listenerCount=function(p){var m=n?n+p:p,g=this._events[m];return g?g.fn?1:g.length:0},c.prototype.emit=function(p,m,g,x,v,S){var A=n?n+p:p;if(!this._events[A])return!1;var T=this._events[A],C=arguments.length,N,R;if(T.fn){switch(T.once&&this.removeListener(p,T.fn,void 0,!0),C){case 1:return T.fn.call(T.context),!0;case 2:return T.fn.call(T.context,m),!0;case 3:return T.fn.call(T.context,m,g),!0;case 4:return T.fn.call(T.context,m,g,x),!0;case 5:return T.fn.call(T.context,m,g,x,v),!0;case 6:return T.fn.call(T.context,m,g,x,v,S),!0}for(R=1,N=new Array(C-1);R<C;R++)N[R-1]=arguments[R];T.fn.apply(T.context,N)}else{var O=T.length,H;for(R=0;R<O;R++)switch(T[R].once&&this.removeListener(p,T[R].fn,void 0,!0),C){case 1:T[R].fn.call(T[R].context);break;case 2:T[R].fn.call(T[R].context,m);break;case 3:T[R].fn.call(T[R].context,m,g);break;case 4:T[R].fn.call(T[R].context,m,g,x);break;default:if(!N)for(H=1,N=new Array(C-1);H<C;H++)N[H-1]=arguments[H];T[R].fn.apply(T[R].context,N)}}return!0},c.prototype.on=function(p,m,g){return s(this,p,m,g,!1)},c.prototype.once=function(p,m,g){return s(this,p,m,g,!0)},c.prototype.removeListener=function(p,m,g,x){var v=n?n+p:p;if(!this._events[v])return this;if(!m)return l(this,v),this;var S=this._events[v];if(S.fn)S.fn===m&&(!x||S.once)&&(!g||S.context===g)&&l(this,v);else{for(var A=0,T=[],C=S.length;A<C;A++)(S[A].fn!==m||x&&!S[A].once||g&&S[A].context!==g)&&T.push(S[A]);T.length?this._events[v]=T.length===1?T[0]:T:l(this,v)}return this},c.prototype.removeAllListeners=function(p){var m;return p?(m=n?n+p:p,this._events[m]&&l(this,m)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(yb)),yb.exports}var _D=vD();const yo=du(_D),SD=Math.PI*2,ED=180/Math.PI,wD=Math.PI/180;class Lr{constructor(t=0,n=0){this.x=0,this.y=0,this.x=t,this.y=n}clone(){return new Lr(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,n=t){return this.x=t,this.y=n,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return xb.x=0,xb.y=0,xb}}const xb=new Lr;class Ht{constructor(t=1,n=0,i=0,r=1,s=0,l=0){this.array=null,this.a=t,this.b=n,this.c=i,this.d=r,this.tx=s,this.ty=l}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,n,i,r,s,l){return this.a=t,this.b=n,this.c=i,this.d=r,this.tx=s,this.ty=l,this}toArray(t,n){this.array||(this.array=new Float32Array(9));const i=n||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(t,n){n=n||new Lr;const i=t.x,r=t.y;return n.x=this.a*i+this.c*r+this.tx,n.y=this.b*i+this.d*r+this.ty,n}applyInverse(t,n){n=n||new Lr;const i=this.a,r=this.b,s=this.c,l=this.d,c=this.tx,f=this.ty,p=1/(i*l+s*-r),m=t.x,g=t.y;return n.x=l*p*m+-s*p*g+(f*s-c*l)*p,n.y=i*p*g+-r*p*m+(-f*i+c*r)*p,n}translate(t,n){return this.tx+=t,this.ty+=n,this}scale(t,n){return this.a*=t,this.d*=n,this.c*=t,this.b*=n,this.tx*=t,this.ty*=n,this}rotate(t){const n=Math.cos(t),i=Math.sin(t),r=this.a,s=this.c,l=this.tx;return this.a=r*n-this.b*i,this.b=r*i+this.b*n,this.c=s*n-this.d*i,this.d=s*i+this.d*n,this.tx=l*n-this.ty*i,this.ty=l*i+this.ty*n,this}append(t){const n=this.a,i=this.b,r=this.c,s=this.d;return this.a=t.a*n+t.b*r,this.b=t.a*i+t.b*s,this.c=t.c*n+t.d*r,this.d=t.c*i+t.d*s,this.tx=t.tx*n+t.ty*r+this.tx,this.ty=t.tx*i+t.ty*s+this.ty,this}appendFrom(t,n){const i=t.a,r=t.b,s=t.c,l=t.d,c=t.tx,f=t.ty,p=n.a,m=n.b,g=n.c,x=n.d;return this.a=i*p+r*g,this.b=i*m+r*x,this.c=s*p+l*g,this.d=s*m+l*x,this.tx=c*p+f*g+n.tx,this.ty=c*m+f*x+n.ty,this}setTransform(t,n,i,r,s,l,c,f,p){return this.a=Math.cos(c+p)*s,this.b=Math.sin(c+p)*s,this.c=-Math.sin(c-f)*l,this.d=Math.cos(c-f)*l,this.tx=t-(i*this.a+r*this.c),this.ty=n-(i*this.b+r*this.d),this}prepend(t){const n=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const i=this.a,r=this.c;this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*t.b+this.d*t.d}return this.tx=n*t.a+this.ty*t.c+t.tx,this.ty=n*t.b+this.ty*t.d+t.ty,this}decompose(t){const n=this.a,i=this.b,r=this.c,s=this.d,l=t.pivot,c=-Math.atan2(-r,s),f=Math.atan2(i,n),p=Math.abs(c+f);return p<1e-5||Math.abs(SD-p)<1e-5?(t.rotation=f,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=c,t.skew.y=f),t.scale.x=Math.sqrt(n*n+i*i),t.scale.y=Math.sqrt(r*r+s*s),t.position.x=this.tx+(l.x*n+l.y*r),t.position.y=this.ty+(l.x*i+l.y*s),t}invert(){const t=this.a,n=this.b,i=this.c,r=this.d,s=this.tx,l=t*r-n*i;return this.a=r/l,this.b=-n/l,this.c=-i/l,this.d=t/l,this.tx=(i*this.ty-r*s)/l,this.ty=-(t*this.ty-n*s)/l,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new Ht;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}equals(t){return t.a===this.a&&t.b===this.b&&t.c===this.c&&t.d===this.d&&t.tx===this.tx&&t.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return CD.identity()}static get shared(){return TD.identity()}}const TD=new Ht,CD=new Ht,od=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],cd=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],ud=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],dd=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Xv=[],eA=[],Ny=Math.sign;function AD(){for(let e=0;e<16;e++){const t=[];Xv.push(t);for(let n=0;n<16;n++){const i=Ny(od[e]*od[n]+ud[e]*cd[n]),r=Ny(cd[e]*od[n]+dd[e]*cd[n]),s=Ny(od[e]*ud[n]+ud[e]*dd[n]),l=Ny(cd[e]*ud[n]+dd[e]*dd[n]);for(let c=0;c<16;c++)if(od[c]===i&&cd[c]===r&&ud[c]===s&&dd[c]===l){t.push(c);break}}}for(let e=0;e<16;e++){const t=new Ht;t.set(od[e],cd[e],ud[e],dd[e],0,0),eA.push(t)}}AD();const Bn={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:e=>od[e],uY:e=>cd[e],vX:e=>ud[e],vY:e=>dd[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>Xv[e][t],sub:(e,t)=>Xv[e][Bn.inv(t)],rotate180:e=>e^4,isVertical:e=>(e&3)===2,byDirection:(e,t)=>Math.abs(e)*2<=Math.abs(t)?t>=0?Bn.S:Bn.N:Math.abs(t)*2<=Math.abs(e)?e>0?Bn.E:Bn.W:t>0?e>0?Bn.SE:Bn.SW:e>0?Bn.NE:Bn.NW,matrixAppendRotationInv:(e,t,n=0,i=0,r=0,s=0)=>{const l=eA[Bn.inv(t)],c=l.a,f=l.b,p=l.c,m=l.d,g=n-Math.min(0,c*r,p*s,c*r+p*s),x=i-Math.min(0,f*r,m*s,f*r+m*s),v=e.a,S=e.b,A=e.c,T=e.d;e.a=c*v+f*A,e.b=c*S+f*T,e.c=p*v+m*A,e.d=p*S+m*T,e.tx=g*v+x*A+e.tx,e.ty=g*S+x*T+e.ty},transformRectCoords:(e,t,n,i)=>{const{x:r,y:s,width:l,height:c}=e,{x:f,y:p,width:m,height:g}=t;return n===Bn.E?(i.set(r+f,s+p,l,c),i):n===Bn.S?i.set(m-s-c+f,r+p,c,l):n===Bn.W?i.set(m-r-l+f,g-s-c+p,l,c):n===Bn.N?i.set(s+f,g-r-l+p,c,l):i.set(r+f,s+p,l,c)}},Oy=[new Lr,new Lr,new Lr,new Lr];class Ti{constructor(t=0,n=0,i=0,r=0){this.type="rectangle",this.x=Number(t),this.y=Number(n),this.width=Number(i),this.height=Number(r)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new Ti(0,0,0,0)}clone(){return new Ti(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,n){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&n>=this.y&&n<this.y+this.height}strokeContains(t,n,i,r=.5){const{width:s,height:l}=this;if(s<=0||l<=0)return!1;const c=this.x,f=this.y,p=i*(1-r),m=i-p,g=c-p,x=c+s+p,v=f-p,S=f+l+p,A=c+m,T=c+s-m,C=f+m,N=f+l-m;return t>=g&&t<=x&&n>=v&&n<=S&&!(t>A&&t<T&&n>C&&n<N)}intersects(t,n){if(!n){const Z=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=Z)return!1;const Y=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>Y}const i=this.left,r=this.right,s=this.top,l=this.bottom;if(r<=i||l<=s)return!1;const c=Oy[0].set(t.left,t.top),f=Oy[1].set(t.left,t.bottom),p=Oy[2].set(t.right,t.top),m=Oy[3].set(t.right,t.bottom);if(p.x<=c.x||f.y<=c.y)return!1;const g=Math.sign(n.a*n.d-n.b*n.c);if(g===0||(n.apply(c,c),n.apply(f,f),n.apply(p,p),n.apply(m,m),Math.max(c.x,f.x,p.x,m.x)<=i||Math.min(c.x,f.x,p.x,m.x)>=r||Math.max(c.y,f.y,p.y,m.y)<=s||Math.min(c.y,f.y,p.y,m.y)>=l))return!1;const x=g*(f.y-c.y),v=g*(c.x-f.x),S=x*i+v*s,A=x*r+v*s,T=x*i+v*l,C=x*r+v*l;if(Math.max(S,A,T,C)<=x*c.x+v*c.y||Math.min(S,A,T,C)>=x*m.x+v*m.y)return!1;const N=g*(c.y-p.y),R=g*(p.x-c.x),O=N*i+R*s,H=N*r+R*s,D=N*i+R*l,q=N*r+R*l;return!(Math.max(O,H,D,q)<=N*c.x+R*c.y||Math.min(O,H,D,q)>=N*m.x+R*m.y)}pad(t=0,n=t){return this.x-=t,this.y-=n,this.width+=t*2,this.height+=n*2,this}fit(t){const n=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),s=Math.min(this.y+this.height,t.y+t.height);return this.x=n,this.width=Math.max(i-n,0),this.y=r,this.height=Math.max(s-r,0),this}ceil(t=1,n=.001){const i=Math.ceil((this.x+this.width-n)*t)/t,r=Math.ceil((this.y+this.height-n)*t)/t;return this.x=Math.floor((this.x+n)*t)/t,this.y=Math.floor((this.y+n)*t)/t,this.width=i-this.x,this.height=r-this.y,this}scale(t,n=t){return this.x*=t,this.y*=n,this.width*=t,this.height*=n,this}enlarge(t){const n=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),s=Math.max(this.y+this.height,t.y+t.height);return this.x=n,this.width=i-n,this.y=r,this.height=s-r,this}getBounds(t){return t||(t=new Ti),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const n=t.x,i=t.y,r=t.x+t.width,s=t.y+t.height;return n>=this.x&&n<this.x+this.width&&i>=this.y&&i<this.y+this.height&&r>=this.x&&r<this.x+this.width&&s>=this.y&&s<this.y+this.height}set(t,n,i,r){return this.x=t,this.y=n,this.width=i,this.height=r,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const bb={default:-1};function bi(e="default"){return bb[e]===void 0&&(bb[e]=-1),++bb[e]}const AE=new Set,xi="8.0.0",MD="8.3.4",$f={quiet:!1,noColor:!1},en=((e,t,n=3)=>{if($f.quiet||AE.has(t))return;let i=new Error().stack;const r=`${t}
62
- Deprecated since v${e}`,s=typeof console.groupCollapsed=="function"&&!$f.noColor;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",r):(i=i.split(`
63
- `).splice(n).join(`
64
- `),s?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",r),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",r),console.warn(i))),AE.add(t)});Object.defineProperties(en,{quiet:{get:()=>$f.quiet,set:e=>{$f.quiet=e},enumerable:!0,configurable:!1},noColor:{get:()=>$f.noColor,set:e=>{$f.noColor=e},enumerable:!0,configurable:!1}});const tA=()=>{};function sh(e){return e+=e===0?1:0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1}function ME(e){return!(e&e-1)&&!!e}function nA(e){const t={};for(const n in e)e[n]!==void 0&&(t[n]=e[n]);return t}const RE=Object.create(null);function RD(e){const t=RE[e];return t===void 0&&(RE[e]=bi("resource")),t}const iA=class rA extends yo{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...rA.defaultOptions,...t},this.addressMode=t.addressMode,this.addressModeU=t.addressModeU??this.addressModeU,this.addressModeV=t.addressModeV??this.addressModeV,this.addressModeW=t.addressModeW??this.addressModeW,this.scaleMode=t.scaleMode,this.magFilter=t.magFilter??this.magFilter,this.minFilter=t.minFilter??this.minFilter,this.mipmapFilter=t.mipmapFilter??this.mipmapFilter,this.lodMinClamp=t.lodMinClamp,this.lodMaxClamp=t.lodMaxClamp,this.compare=t.compare,this.maxAnisotropy=t.maxAnisotropy??1}set addressMode(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){en(xi,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=RD(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};iA.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let lh=iA;const aA=class sA extends yo{constructor(t={}){super(),this.options=t,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=bi("textureSource"),this._resourceType="textureSource",this._resourceId=bi("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={...sA.defaultOptions,...t},this.label=t.label??"",this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=t.dimensions,this.viewDimension=t.viewDimension??t.dimensions,this.arrayLayerCount=t.arrayLayerCount,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.alphaMode=t.alphaMode,this.style=new lh(nA(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){var n,i;this.style!==t&&((n=this._style)==null||n.off("change",this._onStyleChange,this),this._style=t,(i=this._style)==null||i.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(t){this._style.maxAnisotropy=t}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){var t,n;this._resourceId=bi("resource"),this.emit("change",this),this.emit("unload",this);for(const i in this._gpuData)(n=(t=this._gpuData[i])==null?void 0:t.destroy)==null||n.call(t);this._gpuData=Object.create(null)}get resourceWidth(){const{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){const{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,n,i){i||(i=this._resolution),t||(t=this.width),n||(n=this.height);const r=Math.round(t*i),s=Math.round(n*i);return this.width=r/i,this.height=s/i,this._resolution=i,this.pixelWidth===r&&this.pixelHeight===s?!1:(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=s,this.emit("resize",this),this._resourceId=bi("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=ME(this.pixelWidth)&&ME(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};aA.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",viewDimension:"2d",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let Is=aA;class J1 extends Is{constructor(t){const n=t.resource||new Float32Array(t.width*t.height*4);let i=t.format;i||(n instanceof Float32Array?i="rgba32float":n instanceof Int32Array||n instanceof Uint32Array?i="rgba32uint":n instanceof Int16Array||n instanceof Uint16Array?i="rgba16uint":(n instanceof Int8Array,i="bgra8unorm")),super({...t,resource:n,format:i}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}J1.extension=kt.TextureSource;const kE=new Ht;class kD{constructor(t,n){this.mapCoord=new Ht,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof n>"u"?this.clampMargin=t.width<10?0:.5:this.clampMargin=n,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){var n;this.texture!==t&&((n=this._texture)==null||n.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,n){n===void 0&&(n=t);const i=this.mapCoord;for(let r=0;r<t.length;r+=2){const s=t[r],l=t[r+1];n[r]=s*i.a+l*i.c+i.tx,n[r+1]=s*i.b+l*i.d+i.ty}return n}update(){const t=this._texture;this._updateID++;const n=t.uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const i=t.orig,r=t.trim;r&&(kE.set(i.width/r.width,0,0,i.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(kE));const s=t.source,l=this.uClampFrame,c=this.clampMargin/s._resolution,f=this.clampOffset/s._resolution;return l[0]=(t.frame.x+c+f)/s.width,l[1]=(t.frame.y+c+f)/s.height,l[2]=(t.frame.x+t.frame.width-c+f)/s.width,l[3]=(t.frame.y+t.frame.height-c+f)/s.height,this.uClampOffset[0]=this.clampOffset/s.pixelWidth,this.uClampOffset[1]=this.clampOffset/s.pixelHeight,this.isSimple=t.frame.width===s.width&&t.frame.height===s.height&&t.rotate===0,!0}}class Mn extends yo{constructor({source:t,label:n,frame:i,orig:r,trim:s,defaultAnchor:l,defaultBorders:c,rotate:f,dynamic:p}={}){if(super(),this.uid=bi("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new Ti,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=n,this.source=(t==null?void 0:t.source)??new Is,this.noFrame=!i,i)this.frame.copyFrom(i);else{const{width:m,height:g}=this._source;this.frame.width=m,this.frame.height=g}this.orig=r||this.frame,this.trim=s,this.rotate=f??0,this.defaultAnchor=l,this.defaultBorders=c,this.destroyed=!1,this.dynamic=p||!1,this.updateUvs()}set source(t){this._source&&this._source.off("resize",this.update,this),this._source=t,t.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new kD(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:t,frame:n}=this,{width:i,height:r}=this._source,s=n.x/i,l=n.y/r,c=n.width/i,f=n.height/r;let p=this.rotate;if(p){const m=c/2,g=f/2,x=s+m,v=l+g;p=Bn.add(p,Bn.NW),t.x0=x+m*Bn.uX(p),t.y0=v+g*Bn.uY(p),p=Bn.add(p,2),t.x1=x+m*Bn.uX(p),t.y1=v+g*Bn.uY(p),p=Bn.add(p,2),t.x2=x+m*Bn.uX(p),t.y2=v+g*Bn.uY(p),p=Bn.add(p,2),t.x3=x+m*Bn.uX(p),t.y3=v+g*Bn.uY(p)}else t.x0=s,t.y0=l,t.x1=s+c,t.y1=l,t.x2=s+c,t.y2=l+f,t.x3=s,t.y3=l+f}destroy(t=!1){this._source&&(this._source.off("resize",this.update,this),t&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return en(xi,"Texture.baseTexture is now Texture.source"),this._source}}Mn.EMPTY=new Mn({label:"EMPTY",source:new Is({label:"EMPTY"})});Mn.EMPTY.destroy=tA;Mn.WHITE=new Mn({source:new J1({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});Mn.WHITE.destroy=tA;function lA(e,t,n){const{width:i,height:r}=n.orig,s=n.trim;if(s){const l=s.width,c=s.height;e.minX=s.x-t._x*i,e.maxX=e.minX+l,e.minY=s.y-t._y*r,e.maxY=e.minY+c}else e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*r,e.maxY=e.minY+r}const NE=new Ht;class js{constructor(t=1/0,n=1/0,i=-1/0,r=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=NE,this.minX=t,this.minY=n,this.maxX=i,this.maxY=r}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new Ti);const t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=NE,this}set(t,n,i,r){this.minX=t,this.minY=n,this.maxX=i,this.maxY=r}addFrame(t,n,i,r,s){s||(s=this.matrix);const l=s.a,c=s.b,f=s.c,p=s.d,m=s.tx,g=s.ty;let x=this.minX,v=this.minY,S=this.maxX,A=this.maxY,T=l*t+f*n+m,C=c*t+p*n+g;T<x&&(x=T),C<v&&(v=C),T>S&&(S=T),C>A&&(A=C),T=l*i+f*n+m,C=c*i+p*n+g,T<x&&(x=T),C<v&&(v=C),T>S&&(S=T),C>A&&(A=C),T=l*t+f*r+m,C=c*t+p*r+g,T<x&&(x=T),C<v&&(v=C),T>S&&(S=T),C>A&&(A=C),T=l*i+f*r+m,C=c*i+p*r+g,T<x&&(x=T),C<v&&(v=C),T>S&&(S=T),C>A&&(A=C),this.minX=x,this.minY=v,this.maxX=S,this.maxY=A}addRect(t,n){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,n)}addBounds(t,n){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,n)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxX<t.maxX?this.maxX:t.maxX,this.maxY=this.maxY<t.maxY?this.maxY:t.maxY}applyMatrix(t){const n=this.minX,i=this.minY,r=this.maxX,s=this.maxY,{a:l,b:c,c:f,d:p,tx:m,ty:g}=t;let x=l*n+f*i+m,v=c*n+p*i+g;this.minX=x,this.minY=v,this.maxX=x,this.maxY=v,x=l*r+f*i+m,v=c*r+p*i+g,this.minX=x<this.minX?x:this.minX,this.minY=v<this.minY?v:this.minY,this.maxX=x>this.maxX?x:this.maxX,this.maxY=v>this.maxY?v:this.maxY,x=l*n+f*s+m,v=c*n+p*s+g,this.minX=x<this.minX?x:this.minX,this.minY=v<this.minY?v:this.minY,this.maxX=x>this.maxX?x:this.maxX,this.maxY=v>this.maxY?v:this.maxY,x=l*r+f*s+m,v=c*r+p*s+g,this.minX=x<this.minX?x:this.minX,this.minY=v<this.minY?v:this.minY,this.maxX=x>this.maxX?x:this.maxX,this.maxY=v>this.maxY?v:this.maxY}fit(t){return this.minX<t.left&&(this.minX=t.left),this.maxX>t.right&&(this.maxX=t.right),this.minY<t.top&&(this.minY=t.top),this.maxY>t.bottom&&(this.maxY=t.bottom),this}fitBounds(t,n,i,r){return this.minX<t&&(this.minX=t),this.maxX>n&&(this.maxX=n),this.minY<i&&(this.minY=i),this.maxY>r&&(this.maxY=r),this}pad(t,n=t){return this.minX-=t,this.maxX+=t,this.minY-=n,this.maxY+=n,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new js(this.minX,this.minY,this.maxX,this.maxY)}scale(t,n=t){return this.minX*=t,this.minY*=n,this.maxX*=t,this.maxY*=n,this}get x(){return this.minX}set x(t){const n=this.maxX-this.minX;this.minX=t,this.maxX=t+n}get y(){return this.minY}set y(t){const n=this.maxY-this.minY;this.minY=t,this.maxY=t+n}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(t,n,i,r){let s=this.minX,l=this.minY,c=this.maxX,f=this.maxY;r||(r=this.matrix);const p=r.a,m=r.b,g=r.c,x=r.d,v=r.tx,S=r.ty;for(let A=n;A<i;A+=2){const T=t[A],C=t[A+1],N=p*T+g*C+v,R=m*T+x*C+S;s=N<s?N:s,l=R<l?R:l,c=N>c?N:c,f=R>f?R:f}this.minX=s,this.minY=l,this.maxX=c,this.maxY=f}containsPoint(t,n){return this.minX<=t&&this.minY<=n&&this.maxX>=t&&this.maxY>=n}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}}var ND={grad:.9,turn:360,rad:360/(2*Math.PI)},Qo=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},ar=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Bs=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},oA=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},OE=function(e){return{r:Bs(e.r,0,255),g:Bs(e.g,0,255),b:Bs(e.b,0,255),a:Bs(e.a)}},vb=function(e){return{r:ar(e.r),g:ar(e.g),b:ar(e.b),a:ar(e.a,3)}},OD=/^#([0-9a-f]{3,8})$/i,Dy=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},cA=function(e){var t=e.r,n=e.g,i=e.b,r=e.a,s=Math.max(t,n,i),l=s-Math.min(t,n,i),c=l?s===t?(n-i)/l:s===n?2+(i-t)/l:4+(t-n)/l:0;return{h:60*(c<0?c+6:c),s:s?l/s*100:0,v:s/255*100,a:r}},uA=function(e){var t=e.h,n=e.s,i=e.v,r=e.a;t=t/360*6,n/=100,i/=100;var s=Math.floor(t),l=i*(1-n),c=i*(1-(t-s)*n),f=i*(1-(1-t+s)*n),p=s%6;return{r:255*[i,c,l,l,f,i][p],g:255*[f,i,i,c,l,l][p],b:255*[l,l,f,i,i,c][p],a:r}},DE=function(e){return{h:oA(e.h),s:Bs(e.s,0,100),l:Bs(e.l,0,100),a:Bs(e.a)}},zE=function(e){return{h:ar(e.h),s:ar(e.s),l:ar(e.l),a:ar(e.a,3)}},BE=function(e){return uA((n=(t=e).s,{h:t.h,s:(n*=((i=t.l)<50?i:100-i)/100)>0?2*n/(i+n)*100:0,v:i+n,a:t.a}));var t,n,i},_m=function(e){return{h:(t=cA(e)).h,s:(r=(200-(n=t.s))*(i=t.v)/100)>0&&r<200?n*i/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,i,r},DD=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,zD=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,BD=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,LD=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Kv={string:[[function(e){var t=OD.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?ar(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?ar(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=BD.exec(e)||LD.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:OE({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=DD.exec(e)||zD.exec(e);if(!t)return null;var n,i,r=DE({h:(n=t[1],i=t[2],i===void 0&&(i="deg"),Number(n)*(ND[i]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return BE(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,i=e.b,r=e.a,s=r===void 0?1:r;return Qo(t)&&Qo(n)&&Qo(i)?OE({r:Number(t),g:Number(n),b:Number(i),a:Number(s)}):null},"rgb"],[function(e){var t=e.h,n=e.s,i=e.l,r=e.a,s=r===void 0?1:r;if(!Qo(t)||!Qo(n)||!Qo(i))return null;var l=DE({h:Number(t),s:Number(n),l:Number(i),a:Number(s)});return BE(l)},"hsl"],[function(e){var t=e.h,n=e.s,i=e.v,r=e.a,s=r===void 0?1:r;if(!Qo(t)||!Qo(n)||!Qo(i))return null;var l=(function(c){return{h:oA(c.h),s:Bs(c.s,0,100),v:Bs(c.v,0,100),a:Bs(c.a)}})({h:Number(t),s:Number(n),v:Number(i),a:Number(s)});return uA(l)},"hsv"]]},LE=function(e,t){for(var n=0;n<t.length;n++){var i=t[n][0](e);if(i)return[i,t[n][1]]}return[null,void 0]},jD=function(e){return typeof e=="string"?LE(e.trim(),Kv.string):typeof e=="object"&&e!==null?LE(e,Kv.object):[null,void 0]},_b=function(e,t){var n=_m(e);return{h:n.h,s:Bs(n.s+100*t,0,100),l:n.l,a:n.a}},Sb=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},jE=function(e,t){var n=_m(e);return{h:n.h,s:n.s,l:Bs(n.l+100*t,0,100),a:n.a}},$v=(function(){function e(t){this.parsed=jD(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return ar(Sb(this.rgba),2)},e.prototype.isDark=function(){return Sb(this.rgba)<.5},e.prototype.isLight=function(){return Sb(this.rgba)>=.5},e.prototype.toHex=function(){return t=vb(this.rgba),n=t.r,i=t.g,r=t.b,l=(s=t.a)<1?Dy(ar(255*s)):"","#"+Dy(n)+Dy(i)+Dy(r)+l;var t,n,i,r,s,l},e.prototype.toRgb=function(){return vb(this.rgba)},e.prototype.toRgbString=function(){return t=vb(this.rgba),n=t.r,i=t.g,r=t.b,(s=t.a)<1?"rgba("+n+", "+i+", "+r+", "+s+")":"rgb("+n+", "+i+", "+r+")";var t,n,i,r,s},e.prototype.toHsl=function(){return zE(_m(this.rgba))},e.prototype.toHslString=function(){return t=zE(_m(this.rgba)),n=t.h,i=t.s,r=t.l,(s=t.a)<1?"hsla("+n+", "+i+"%, "+r+"%, "+s+")":"hsl("+n+", "+i+"%, "+r+"%)";var t,n,i,r,s},e.prototype.toHsv=function(){return t=cA(this.rgba),{h:ar(t.h),s:ar(t.s),v:ar(t.v),a:ar(t.a,3)};var t},e.prototype.invert=function(){return oo({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),oo(_b(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),oo(_b(this.rgba,-t))},e.prototype.grayscale=function(){return oo(_b(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),oo(jE(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),oo(jE(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?oo({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):ar(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=_m(this.rgba);return typeof t=="number"?oo({h:t,s:n.s,l:n.l,a:n.a}):ar(n.h)},e.prototype.isEqual=function(t){return this.toHex()===oo(t).toHex()},e})(),oo=function(e){return e instanceof $v?e:new $v(e)},IE=[],ID=function(e){e.forEach(function(t){IE.indexOf(t)<0&&(t($v,Kv),IE.push(t))})};function UD(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var r in n)i[n[r]]=r;var s={};e.prototype.toName=function(l){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var c,f,p=i[this.toHex()];if(p)return p;if(l!=null&&l.closest){var m=this.toRgb(),g=1/0,x="black";if(!s.length)for(var v in n)s[v]=new e(n[v]).toRgb();for(var S in n){var A=(c=m,f=s[S],Math.pow(c.r-f.r,2)+Math.pow(c.g-f.g,2)+Math.pow(c.b-f.b,2));A<g&&(g=A,x=S)}return x}},t.string.push([function(l){var c=l.toLowerCase(),f=c==="transparent"?"#0000":n[c];return f?new e(f).toRgb():null},"name"])}ID([UD]);const oh=class hm{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(t){if(t instanceof hm)this._value=this._cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,t))&&(this._value=this._cloneSource(t),this._normalize(this._value))}}get value(){return this._value}_cloneSource(t){return typeof t=="string"||typeof t=="number"||t instanceof Number||t===null?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):typeof t=="object"&&t!==null?{...t}:t}_isSourceEqual(t,n){const i=typeof t;if(i!==typeof n)return!1;if(i==="number"||i==="string"||t instanceof Number)return t===n;if(Array.isArray(t)&&Array.isArray(n)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(n))return t.length!==n.length?!1:t.every((s,l)=>s===n[l]);if(t!==null&&n!==null){const s=Object.keys(t),l=Object.keys(n);return s.length!==l.length?!1:s.every(c=>t[c]===n[c])}return t===n}toRgba(){const[t,n,i,r]=this._components;return{r:t,g:n,b:i,a:r}}toRgb(){const[t,n,i]=this._components;return{r:t,g:n,b:i}}toRgbaString(){const[t,n,i]=this.toUint8RgbArray();return`rgba(${t},${n},${i},${this.alpha})`}toUint8RgbArray(t){const[n,i,r]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(n*255),t[1]=Math.round(i*255),t[2]=Math.round(r*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);const[n,i,r,s]=this._components;return t[0]=n,t[1]=i,t[2]=r,t[3]=s,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);const[n,i,r]=this._components;return t[0]=n,t[1]=i,t[2]=r,t}toNumber(){return this._int}toBgrNumber(){const[t,n,i]=this.toUint8RgbArray();return(i<<16)+(n<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[n,i,r,s]=hm._temp.setValue(t)._components;return this._components[0]*=n,this._components[1]*=i,this._components[2]*=r,this._components[3]*=s,this._refreshInt(),this._value=null,this}premultiply(t,n=!0){return n&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,n=!0){if(t===1)return(255<<24)+this._int;if(t===0)return n?0:this._int;let i=this._int>>16&255,r=this._int>>8&255,s=this._int&255;return n&&(i=i*t+.5|0,r=r*t+.5|0,s=s*t+.5|0),(t*255<<24)+(i<<16)+(r<<8)+s}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const n=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-n.length)+n}setAlpha(t){return this._components[3]=this._clamp(t),this._value=null,this}_normalize(t){let n,i,r,s;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const l=t;n=(l>>16&255)/255,i=(l>>8&255)/255,r=(l&255)/255,s=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[n,i,r,s=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[n,i,r,s=255]=t,n/=255,i/=255,r/=255,s/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const c=hm.HEX_PATTERN.exec(t);c&&(t=`#${c[2]}`)}const l=oo(t);l.isValid()&&({r:n,g:i,b:r,a:s}=l.rgba,n/=255,i/=255,r/=255)}if(n!==void 0)this._components[0]=n,this._components[1]=i,this._components[2]=r,this._components[3]=s,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);const[t,n,i]=this._components;this._int=(t*255<<16)+(n*255<<8)+(i*255|0)}_clamp(t,n=0,i=1){return typeof t=="number"?Math.min(Math.max(t,n),i):(t.forEach((r,s)=>{t[s]=Math.min(Math.max(r,n),i)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof hm||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t.r!==void 0&&t.g!==void 0&&t.b!==void 0||t.r!==void 0&&t.g!==void 0&&t.b!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0&&t.a!==void 0}};oh.shared=new oh;oh._temp=new oh;oh.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let qi=oh;const HD={cullArea:null,cullable:!1,cullableChildren:!0};let Eb=0;const UE=500;function ma(...e){Eb!==UE&&(Eb++,Eb===UE?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...e))}const Qm={_registeredResources:new Set,register(e){this._registeredResources.add(e)},unregister(e){this._registeredResources.delete(e)},release(){this._registeredResources.forEach(e=>e.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(e){return this._registeredResources.has(e)},reset(){this._registeredResources.clear()}};class PD{constructor(t,n){this._pool=[],this._count=0,this._index=0,this._classType=t,n&&this.prepopulate(n)}prepopulate(t){for(let n=0;n<t;n++)this._pool[this._index++]=new this._classType;this._count+=t}get(t){var i;let n;return this._index>0?n=this._pool[--this._index]:(n=new this._classType,this._count++),(i=n.init)==null||i.call(n,t),n}return(t){var n;(n=t.reset)==null||n.call(t),this._pool[this._index++]=t}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let t=0;t<this._index;t++)this._pool[t].destroy();this._pool.length=0,this._count=0,this._index=0}}class FD{constructor(){this._poolsByClass=new Map}prepopulate(t,n){this.getPool(t).prepopulate(n)}get(t,n){return this.getPool(t).get(n)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new PD(t)),this._poolsByClass.get(t)}stats(){const t={};return this._poolsByClass.forEach(n=>{const i=t[n._classType.name]?n._classType.name+n._classType.ID:n._classType.name;t[i]={free:n.totalFree,used:n.totalUsed,size:n.totalSize}}),t}clear(){this._poolsByClass.forEach(t=>t.clear()),this._poolsByClass.clear()}}const Da=new FD;Qm.register(Da);const GD={get isCachedAsTexture(){var e;return!!((e=this.renderGroup)!=null&&e.isCachedAsTexture)},cacheAsTexture(e){typeof e=="boolean"&&e===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(e===!0?{}:e))},updateCacheTexture(){var e;(e=this.renderGroup)==null||e.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(e){en("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(e)}};function qD(e,t,n){const i=e.length;let r;if(t>=i||n===0)return;n=t+n>i?i-t:n;const s=i-n;for(r=t;r<s;++r)e[r]=e[r+n];e.length=s}const YD={allowChildren:!0,removeChildren(e=0,t){var s;const n=t??this.children.length,i=n-e,r=[];if(i>0&&i<=n){for(let c=n-1;c>=e;c--){const f=this.children[c];f&&(r.push(f),f.parent=null)}qD(this.children,e,n);const l=this.renderGroup||this.parentRenderGroup;l&&l.removeChildren(r);for(let c=0;c<r.length;++c){const f=r[c];(s=f.parentRenderLayer)==null||s.detach(f),this.emit("childRemoved",f,this,c),r[c].emit("removed",this)}return r.length>0&&this._didViewChangeTick++,r}else if(i===0&&this.children.length===0)return r;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(e){const t=this.getChildAt(e);return this.removeChild(t)},getChildAt(e){if(e<0||e>=this.children.length)throw new Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]},setChildIndex(e,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(e),this.addChildAt(e,t)},getChildIndex(e){const t=this.children.indexOf(e);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(e,t){this.allowChildren||en(xi,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:n}=this;if(t<0||t>n.length)throw new Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${n.length}`);const i=e.parent===this;if(e.parent){const s=e.parent.children.indexOf(e);if(i){if(s===t)return e;e.parent.children.splice(s,1)}else e.removeFromParent()}t===n.length?n.push(e):n.splice(t,0,e),e.parent=this,e.didChange=!0,e._updateFlags=15;const r=this.renderGroup||this.parentRenderGroup;return r&&r.addChild(e),this.sortableChildren&&(this.sortDirty=!0),i||(this.emit("childAdded",e,this,t),e.emit("added",this)),e},swapChildren(e,t){if(e===t)return;const n=this.getChildIndex(e),i=this.getChildIndex(t);this.children[n]=t,this.children[i]=e;const r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){var e;(e=this.parent)==null||e.removeChild(this)},reparentChild(...e){return e.length===1?this.reparentChildAt(e[0],this.children.length):(e.forEach(t=>this.reparentChildAt(t,this.children.length)),e[0])},reparentChildAt(e,t){if(e.parent===this)return this.setChildIndex(e,t),e;const n=e.worldTransform.clone();e.removeFromParent(),this.addChildAt(e,t);const i=this.worldTransform.clone();return i.invert(),n.prepend(i),e.setFromMatrix(n),e},replaceChild(e,t){e.updateLocalTransform(),this.addChildAt(t,this.getChildIndex(e)),t.setFromMatrix(e.localTransform),t.updateLocalTransform(),this.removeChild(e)}},VD={collectRenderables(e,t,n){this.parentRenderLayer&&this.parentRenderLayer!==n||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(e,t,n):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,e):this.collectRenderablesWithEffects(e,t,n))},collectRenderablesSimple(e,t,n){const i=this.children,r=i.length;for(let s=0;s<r;s++)i[s].collectRenderables(e,t,n)},collectRenderablesWithEffects(e,t,n){const{renderPipes:i}=t;for(let r=0;r<this.effects.length;r++){const s=this.effects[r];i[s.pipe].push(s,this,e)}this.collectRenderablesSimple(e,t,n);for(let r=this.effects.length-1;r>=0;r--){const s=this.effects[r];i[s.pipe].pop(s,this,e)}}};class HE{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t<this.filters.length;t++)this.filters[t].destroy();this.filters=null,this.filterArea=null}}class XD{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(t=>{this.add({test:t.test,maskClass:t})}))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let n=0;n<this._tests.length;n++){const i=this._tests[n];if(i.test(t))return Da.get(i.maskClass,t)}return t}returnMaskEffect(t){Da.return(t)}}const Wv=new XD;li.handleByList(kt.MaskEffect,Wv._effectClasses);const KD={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const e=this.renderGroup||this.parentRenderGroup;e&&(e.structureDidChange=!0)},addEffect(e){this.effects.indexOf(e)===-1&&(this.effects.push(e),this.effects.sort((n,i)=>n.priority-i.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(e){const t=this.effects.indexOf(e);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(e){const t=this._maskEffect;(t==null?void 0:t.mask)!==e&&(t&&(this.removeEffect(t),Wv.returnMaskEffect(t),this._maskEffect=null),e!=null&&(this._maskEffect=Wv.getMaskEffect(e),this.addEffect(this._maskEffect)))},get mask(){var e;return(e=this._maskEffect)==null?void 0:e.mask},setMask(e){this._maskOptions={...this._maskOptions,...e},e.mask&&(this.mask=e.mask),this._markStructureAsChanged()},set filters(e){var s;!Array.isArray(e)&&e&&(e=[e]);const t=this._filterEffect||(this._filterEffect=new HE);e=e;const n=(e==null?void 0:e.length)>0,i=((s=t.filters)==null?void 0:s.length)>0,r=n!==i;e=Array.isArray(e)?e.slice(0):e,t.filters=Object.freeze(e),r&&(n?this.addEffect(t):(this.removeEffect(t),t.filters=e??null))},get filters(){var e;return(e=this._filterEffect)==null?void 0:e.filters},set filterArea(e){this._filterEffect||(this._filterEffect=new HE),this._filterEffect.filterArea=e},get filterArea(){var e;return(e=this._filterEffect)==null?void 0:e.filterArea}},$D={label:null,get name(){return en(xi,"Container.name property has been removed, use Container.label instead"),this.label},set name(e){en(xi,"Container.name property has been removed, use Container.label instead"),this.label=e},getChildByName(e,t=!1){return this.getChildByLabel(e,t)},getChildByLabel(e,t=!1){const n=this.children;for(let i=0;i<n.length;i++){const r=n[i];if(r.label===e||e instanceof RegExp&&e.test(r.label))return r}if(t)for(let i=0;i<n.length;i++){const s=n[i].getChildByLabel(e,!0);if(s)return s}return null},getChildrenByLabel(e,t=!1,n=[]){const i=this.children;for(let r=0;r<i.length;r++){const s=i[r];(s.label===e||e instanceof RegExp&&e.test(s.label))&&n.push(s)}if(t)for(let r=0;r<i.length;r++)i[r].getChildrenByLabel(e,!0,n);return n}},pa=Da.getPool(Ht),rc=Da.getPool(js),WD=new Ht,QD={getFastGlobalBounds(e,t){t||(t=new js),t.clear(),this._getGlobalBoundsRecursive(!!e,t,this.parentRenderLayer),t.isValid||t.set(0,0,0,0);const n=this.renderGroup||this.parentRenderGroup;return t.applyMatrix(n.worldTransform),t},_getGlobalBoundsRecursive(e,t,n){let i=t;if(e&&this.parentRenderLayer&&this.parentRenderLayer!==n||this.localDisplayStatus!==7||!this.measurable)return;const r=!!this.effects.length;if((this.renderGroup||r)&&(i=rc.get().clear()),this.boundsArea)t.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const l=this.bounds;i.addFrame(l.minX,l.minY,l.maxX,l.maxY,this.groupTransform)}const s=this.children;for(let l=0;l<s.length;l++)s[l]._getGlobalBoundsRecursive(e,i,n)}if(r){let s=!1;const l=this.renderGroup||this.parentRenderGroup;for(let c=0;c<this.effects.length;c++)this.effects[c].addBounds&&(s||(s=!0,i.applyMatrix(l.worldTransform)),this.effects[c].addBounds(i,!0));s&&i.applyMatrix(l.worldTransform.copyTo(WD).invert()),t.addBounds(i),rc.return(i)}else this.renderGroup&&(t.addBounds(i,this.relativeGroupTransform),rc.return(i))}};function dA(e,t,n){n.clear();let i,r;return e.parent?t?i=e.parent.worldTransform:(r=pa.get().identity(),i=e_(e,r)):i=Ht.IDENTITY,fA(e,n,i,t),r&&pa.return(r),n.isValid||n.set(0,0,0,0),n}function fA(e,t,n,i){var c,f;if(!e.visible||!e.measurable)return;let r;i?r=e.worldTransform:(e.updateLocalTransform(),r=pa.get(),r.appendFrom(e.localTransform,n));const s=t,l=!!e.effects.length;if(l&&(t=rc.get().clear()),e.boundsArea)t.addRect(e.boundsArea,r);else{const p=e.bounds;p&&!p.isEmpty()&&(t.matrix=r,t.addBounds(p));for(let m=0;m<e.children.length;m++)fA(e.children[m],t,r,i)}if(l){for(let p=0;p<e.effects.length;p++)(f=(c=e.effects[p]).addBounds)==null||f.call(c,t);s.addBounds(t,Ht.IDENTITY),rc.return(t)}i||pa.return(r)}function e_(e,t){const n=e.parent;return n&&(e_(n,t),n.updateLocalTransform(),t.append(n.localTransform)),t}function hA(e,t){if(e===16777215||!t)return t;if(t===16777215||!e)return e;const n=e>>16&255,i=e>>8&255,r=e&255,s=t>>16&255,l=t>>8&255,c=t&255,f=n*s/255|0,p=i*l/255|0,m=r*c/255|0;return(f<<16)+(p<<8)+m}const PE=16777215;function FE(e,t){return e===PE?t:t===PE?e:hA(e,t)}function g0(e){return((e&255)<<16)+(e&65280)+(e>>16&255)}const ZD={getGlobalAlpha(e){if(e)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let t=this.alpha,n=this.parent;for(;n;)t*=n.alpha,n=n.parent;return t},getGlobalTransform(e=new Ht,t){if(t)return e.copyFrom(this.worldTransform);this.updateLocalTransform();const n=e_(this,pa.get().identity());return e.appendFrom(this.localTransform,n),pa.return(n),e},getGlobalTint(e){if(e)return this.renderGroup?g0(this.renderGroup.worldColor):this.parentRenderGroup?g0(FE(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,n=this.parent;for(;n;)t=FE(t,n.localColor),n=n.parent;return g0(t)}};function pA(e,t,n){return t.clear(),n||(n=Ht.IDENTITY),mA(e,t,n,e,!0),t.isValid||t.set(0,0,0,0),t}function mA(e,t,n,i,r){var f,p;let s;if(r)s=pa.get(),s=n.copyTo(s);else{if(!e.visible||!e.measurable)return;e.updateLocalTransform();const m=e.localTransform;s=pa.get(),s.appendFrom(m,n)}const l=t,c=!!e.effects.length;if(c&&(t=rc.get().clear()),e.boundsArea)t.addRect(e.boundsArea,s);else{e.renderPipeId&&(t.matrix=s,t.addBounds(e.bounds));const m=e.children;for(let g=0;g<m.length;g++)mA(m[g],t,s,i,!1)}if(c){for(let m=0;m<e.effects.length;m++)(p=(f=e.effects[m]).addLocalBounds)==null||p.call(f,t,i);l.addBounds(t,Ht.IDENTITY),rc.return(t)}pa.return(s)}function gA(e,t){const n=e.children;for(let i=0;i<n.length;i++){const r=n[i],s=r.uid,l=(r._didViewChangeTick&65535)<<16|r._didContainerChangeTick&65535,c=t.index;(t.data[c]!==s||t.data[c+1]!==l)&&(t.data[t.index]=s,t.data[t.index+1]=l,t.didChange=!0),t.index=c+2,r.children.length&&gA(r,t)}return t.didChange}const JD=new Ht,ez={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(e,t){const n=Math.sign(this.scale.x)||1;t!==0?this.scale.x=e/t*n:this.scale.x=n},_setHeight(e,t){const n=Math.sign(this.scale.y)||1;t!==0?this.scale.y=e/t*n:this.scale.y=n},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new js});const e=this._localBoundsCacheData;return e.index=1,e.didChange=!1,e.data[0]!==this._didViewChangeTick&&(e.didChange=!0,e.data[0]=this._didViewChangeTick),gA(this,e),e.didChange&&pA(this,e.localBounds,JD),e.localBounds},getBounds(e,t){return dA(this,e,t||new js)}},tz={_onRender:null,set onRender(e){const t=this.renderGroup||this.parentRenderGroup;if(!e){this._onRender&&(t==null||t.removeOnRender(this)),this._onRender=null;return}this._onRender||t==null||t.addOnRender(this),this._onRender=e},get onRender(){return this._onRender}},nz={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(e){this._zIndex!==e&&(this._zIndex=e,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(iz))}};function iz(e,t){return e._zIndex-t._zIndex}const rz={getGlobalPosition(e=new Lr,t=!1){return this.parent?this.parent.toGlobal(this._position,e,t):(e.x=this._position.x,e.y=this._position.y),e},toGlobal(e,t,n=!1){const i=this.getGlobalTransform(pa.get(),n);return t=i.apply(e,t),pa.return(i),t},toLocal(e,t,n,i){t&&(e=t.toGlobal(e,n,i));const r=this.getGlobalTransform(pa.get(),i);return n=r.applyInverse(e,n),pa.return(r),n}};class t_{constructor(){this.uid=bi("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}let az=0;class sz{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this.textureStyle=new lh(this.textureOptions)}createTexture(t,n,i,r){const s=new Is({...this.textureOptions,width:t,height:n,resolution:1,antialias:i,autoGarbageCollect:!1,autoGenerateMipmaps:r});return new Mn({source:s,label:`texturePool_${az++}`})}getOptimalTexture(t,n,i=1,r,s=!1){let l=Math.ceil(t*i-1e-6),c=Math.ceil(n*i-1e-6);l=sh(l),c=sh(c);const f=r?1:0,p=s?1:0,m=(l<<17)+(c<<2)+(p<<1)+f;this._texturePool[m]||(this._texturePool[m]=[]);let g=this._texturePool[m].pop();return g||(g=this.createTexture(l,c,r,s)),g.source._resolution=i,g.source.width=l/i,g.source.height=c/i,g.source.pixelWidth=l,g.source.pixelHeight=c,g.frame.x=0,g.frame.y=0,g.frame.width=t,g.frame.height=n,g.updateUvs(),this._poolKeyHash[g.uid]=m,g}getSameSizeTexture(t,n=!1){const i=t.source;return this.getOptimalTexture(t.width,t.height,i._resolution,n)}returnTexture(t,n=!1){const i=this._poolKeyHash[t.uid];n&&(t.source.style=this.textureStyle),this._texturePool[i].push(t)}clear(t){if(t=t!==!1,t)for(const n in this._texturePool){const i=this._texturePool[n];if(i)for(let r=0;r<i.length;r++)i[r].destroy(!0)}this._texturePool={}}}const ex=new sz;Qm.register(ex);class lz{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new Ht,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new t_,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(t){this.root=t,t._onRender&&this.addOnRender(t),t.didChange=!0;const n=t.children;for(let i=0;i<n.length;i++){const r=n[i];r._updateFlags=15,this.addChild(r)}}enableCacheAsTexture(t={}){this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(ex.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const t=this._parentCacheAsTextureRenderGroup;t&&!t.textureNeedsUpdate&&t.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const t in this.childrenToUpdate){const n=this.childrenToUpdate[t];n.list.fill(null),n.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){const n=this.renderGroupChildren.indexOf(t);n>-1&&this.renderGroupChildren.splice(n,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup){this.addRenderGroupChild(t.renderGroup);return}t._onRender&&this.addOnRender(t);const n=t.children;for(let i=0;i<n.length;i++)this.addChild(n[i])}removeChild(t){if(this.structureDidChange=!0,t._onRender&&(t.renderGroup||this.removeOnRender(t)),t.parentRenderGroup=null,t.renderGroup){this._removeRenderGroupChild(t.renderGroup);return}const n=t.children;for(let i=0;i<n.length;i++)this.removeChild(n[i])}removeChildren(t){for(let n=0;n<t.length;n++)this.removeChild(t[n])}onChildUpdate(t){let n=this.childrenToUpdate[t.relativeRenderGroupDepth];n||(n=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),n.list[n.index++]=t}updateRenderable(t){t.globalDisplayStatus<7||(this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t),t.didViewUpdate=!1)}onChildViewUpdate(t){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(t){for(let n=0;n<this._onRenderContainers.length;n++)this._onRenderContainers[n]._onRender(t)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(t=[]){const n=this.root.children;for(let i=0;i<n.length;i++)this._getChildren(n[i],t);return t}_getChildren(t,n=[]){if(n.push(t),t.renderGroup)return n;const i=t.children;for(let r=0;r<i.length;r++)this._getChildren(i[r],n);return n}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return(this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new Ht),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new Ht),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;const t=this._parentCacheAsTextureRenderGroup;return t?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new Ht),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(t.inverseWorldTransform).translate(-t._textureBounds.x,-t._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}function oz(e,t,n={}){for(const i in t)!n[i]&&t[i]!==void 0&&(e[i]=t[i])}const wb=new br(null),zy=new br(null),Tb=new br(null,1,1),By=new br(null),GE=1,cz=2,Cb=4;class _r extends yo{constructor(t={}){var n,i;super(),this.uid=bi("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new Ht,this.relativeGroupTransform=new Ht,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new br(this,0,0),this._scale=Tb,this._pivot=zy,this._origin=By,this._skew=wb,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],oz(this,t,{children:!0,parent:!0,effects:!0}),(n=t.children)==null||n.forEach(r=>this.addChild(r)),(i=t.parent)==null||i.addChild(this)}static mixin(t){en("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),li.mixin(_r,t)}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=t&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...t){if(this.allowChildren||en(xi,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let r=0;r<t.length;r++)this.addChild(t[r]);return t[0]}const n=t[0],i=this.renderGroup||this.parentRenderGroup;return n.parent===this?(this.children.splice(this.children.indexOf(n),1),this.children.push(n),i&&(i.structureDidChange=!0),n):(n.parent&&n.parent.removeChild(n),this.children.push(n),this.sortableChildren&&(this.sortDirty=!0),n.parent=this,n.didChange=!0,n._updateFlags=15,i&&i.addChild(n),this.emit("childAdded",n,this,this.children.length-1),n.emit("added",this),this._didViewChangeTick++,n._zIndex!==0&&n.depthOfChildModified(),n)}removeChild(...t){if(t.length>1){for(let r=0;r<t.length;r++)this.removeChild(t[r]);return t[0]}const n=t[0],i=this.children.indexOf(n);return i>-1&&(this._didViewChangeTick++,this.children.splice(i,1),this.renderGroup?this.renderGroup.removeChild(n):this.parentRenderGroup&&this.parentRenderGroup.removeChild(n),n.parentRenderLayer&&n.parentRenderLayer.detach(n),n.parent=null,this.emit("childRemoved",n,this,i),n.emit("removed",this)),n}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const t=this.parentRenderGroup;t==null||t.removeChild(this),this.renderGroup=Da.get(lz,this),this.groupTransform=Ht.IDENTITY,t==null||t.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t==null||t.removeChild(this),Da.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t==null||t.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new Ht),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*ED}set angle(t){this.rotation=t*wD}get pivot(){return this._pivot===zy&&(this._pivot=new br(this,0,0)),this._pivot}set pivot(t){this._pivot===zy&&(this._pivot=new br(this,0,0),this._origin!==By&&ma("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===wb&&(this._skew=new br(this,0,0)),this._skew}set skew(t){this._skew===wb&&(this._skew=new br(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===Tb&&(this._scale=new br(this,1,1)),this._scale}set scale(t){this._scale===Tb&&(this._scale=new br(this,0,0)),typeof t=="string"&&(t=parseFloat(t)),typeof t=="number"?this._scale.set(t):this._scale.copyFrom(t)}get origin(){return this._origin===By&&(this._origin=new br(this,0,0)),this._origin}set origin(t){this._origin===By&&(this._origin=new br(this,0,0),this._pivot!==zy&&ma("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._origin.set(t):this._origin.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){const n=this.getLocalBounds().width;this._setWidth(t,n)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){const n=this.getLocalBounds().height;this._setHeight(t,n)}getSize(t){t||(t={});const n=this.getLocalBounds();return t.width=Math.abs(this.scale.x*n.width),t.height=Math.abs(this.scale.y*n.height),t}setSize(t,n){const i=this.getLocalBounds();typeof t=="object"?(n=t.height??t.width,t=t.width):n??(n=t),t!==void 0&&this._setWidth(t,i.width),n!==void 0&&this._setHeight(n,i.height)}_updateSkew(){const t=this._rotation,n=this._skew;this._cx=Math.cos(t+n._y),this._sx=Math.sin(t+n._y),this._cy=-Math.sin(t-n._x),this._sy=Math.cos(t-n._x)}updateTransform(t){return this.position.set(typeof t.x=="number"?t.x:this.position.x,typeof t.y=="number"?t.y:this.position.y),this.scale.set(typeof t.scaleX=="number"?t.scaleX||1:this.scale.x,typeof t.scaleY=="number"?t.scaleY||1:this.scale.y),this.rotation=typeof t.rotation=="number"?t.rotation:this.rotation,this.skew.set(typeof t.skewX=="number"?t.skewX:this.skew.x,typeof t.skewY=="number"?t.skewY:this.skew.y),this.pivot.set(typeof t.pivotX=="number"?t.pivotX:this.pivot.x,typeof t.pivotY=="number"?t.pivotY:this.pivot.y),this.origin.set(typeof t.originX=="number"?t.originX:this.origin.x,typeof t.originY=="number"?t.originY:this.origin.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){const t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;const n=this.localTransform,i=this._scale,r=this._pivot,s=this._origin,l=this._position,c=i._x,f=i._y,p=r._x,m=r._y,g=-s._x,x=-s._y;n.a=this._cx*c,n.b=this._sx*c,n.c=this._cy*f,n.d=this._sy*f,n.tx=l._x-(p*n.a+m*n.c)+(g*n.a+x*n.c)-g,n.ty=l._y-(p*n.b+m*n.d)+(g*n.b+x*n.d)-x}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=GE,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const i=qi.shared.setValue(t??16777215).toBgrNumber();i!==this.localColor&&(this.localColor=i,this._updateFlags|=GE,this._onUpdate())}get tint(){return g0(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=cz,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(t){const n=t?2:0;(this.localDisplayStatus&2)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Cb,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",t))}get culled(){return!(this.localDisplayStatus&4)}set culled(t){const n=t?0:4;(this.localDisplayStatus&4)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Cb,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(t){const n=t?1:0;(this.localDisplayStatus&1)!==n&&(this._updateFlags|=Cb,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){var r;if(this.destroyed)return;this.destroyed=!0;let n;if(this.children.length&&(n=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof t=="boolean"?t:t==null?void 0:t.children)&&n)for(let s=0;s<n.length;++s)n[s].destroy(t);(r=this.renderGroup)==null||r.destroy(),this.renderGroup=null}}li.mixin(_r,YD,QD,rz,tz,ez,KD,$D,nz,HD,GD,ZD,VD);class n_ extends _r{constructor(t){super(t),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new js(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=t.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}containsPoint(t){const n=this.bounds,{x:i,y:r}=t;return i>=n.minX&&i<=n.maxX&&r>=n.minY&&r<=n.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}unload(){var t;this.emit("unload",this);for(const n in this._gpuData)(t=this._gpuData[n])==null||t.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(t){this.unload(),super.destroy(t),this._bounds=null}collectRenderablesSimple(t,n,i){const{renderPipes:r}=n;r.blendMode.pushBlendMode(this,this.groupBlendMode,t);const l=r[this.renderPipeId];l!=null&&l.addRenderable&&l.addRenderable(this,t),this.didViewUpdate=!1;const c=this.children,f=c.length;for(let p=0;p<f;p++)c[p].collectRenderables(t,n,i);r.blendMode.popBlendMode(t)}}class ch extends n_{constructor(t=Mn.EMPTY){t instanceof Mn&&(t={texture:t});const{texture:n=Mn.EMPTY,anchor:i,roundPixels:r,width:s,height:l,...c}=t;super({label:"Sprite",...c}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new br({_onUpdate:()=>{this.onViewUpdate()}}),i?this.anchor=i:n.defaultAnchor&&(this.anchor=n.defaultAnchor),this.texture=n,this.allowChildren=!1,this.roundPixels=r??!1,s!==void 0&&(this.width=s),l!==void 0&&(this.height=l)}static from(t,n=!1){return t instanceof Mn?new ch(t):new ch(Mn.from(t,n))}set texture(t){t||(t=Mn.EMPTY);const n=this._texture;n!==t&&(n&&n.dynamic&&n.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return lA(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return en("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const t=this._anchor,n=this._texture,i=this._bounds,{width:r,height:s}=n.orig;i.minX=-t._x*r,i.maxX=i.minX+r,i.minY=-t._y*s,i.maxY=i.minY+s}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t==null?void 0:t.texture){const i=typeof t=="boolean"?t:t==null?void 0:t.textureSource;this._texture.destroy(i)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,n){typeof t=="object"?(n=t.height??t.width,t=t.width):n??(n=t),t!==void 0&&this._setWidth(t,this._texture.orig.width),n!==void 0&&this._setHeight(n,this._texture.orig.height)}}const uz=new js;function yA(e,t,n){const i=uz;e.measurable=!0,dA(e,n,i),t.addBoundsMask(i),e.measurable=!1}function xA(e,t,n){const i=rc.get();e.measurable=!0;const r=pa.get().identity(),s=bA(e,n,r);pA(e,i,s),e.measurable=!1,t.addBoundsMask(i),pa.return(r),rc.return(i)}function bA(e,t,n){return e?(e!==t&&(bA(e.parent,t,n),e.updateLocalTransform(),n.append(e.localTransform)),n):(ma("Mask bounds, renderable is not inside the root container"),n)}class vA{constructor(t){this.priority=0,this.inverse=!1,this.pipe="alphaMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof ch),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(t,n){this.inverse||yA(this.mask,t,n)}addLocalBounds(t,n){xA(this.mask,t,n)}containsPoint(t,n){const i=this.mask;return n(i,t)}destroy(){this.reset()}static test(t){return t instanceof ch}}vA.extension=kt.MaskEffect;class _A{constructor(t){this.priority=0,this.pipe="colorMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return typeof t=="number"}}_A.extension=kt.MaskEffect;class SA{constructor(t){this.priority=0,this.pipe="stencilMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(t,n){yA(this.mask,t,n)}addLocalBounds(t,n){xA(this.mask,t,n)}containsPoint(t,n){const i=this.mask;return n(i,t)}destroy(){this.reset()}static test(t){return t instanceof _r}}SA.extension=kt.MaskEffect;const dz={createCanvas:(e,t)=>{const n=document.createElement("canvas");return n.width=e,n.height=t,n},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(e,t)=>fetch(e,t),parseXML:e=>new DOMParser().parseFromString(e,"text/xml")};let qE=dz;const is={get(){return qE},set(e){qE=e}};class EA extends Is{constructor(t){t.resource||(t.resource=is.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(t=this.width,n=this.height,i=this._resolution){const r=super.resize(t,n,i);return r&&this.resizeCanvas(),r}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}EA.extension=kt.TextureSource;class A0 extends Is{constructor(t){super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame}}A0.extension=kt.TextureSource;var M0=(e=>(e[e.INTERACTION=50]="INTERACTION",e[e.HIGH=25]="HIGH",e[e.NORMAL=0]="NORMAL",e[e.LOW=-25]="LOW",e[e.UTILITY=-50]="UTILITY",e))(M0||{});class Ab{constructor(t,n=null,i=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=n,this.priority=i,this._once=r}match(t,n=null){return this._fn===t&&this._context===n}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));const n=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),n}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const n=this.next;return this.next=t?null:n,this.previous=null,n}}const wA=class Ja{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Ab(null,null,1/0),this.deltaMS=1/Ja.targetFPMS,this.elapsedMS=1/Ja.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,n,i=M0.NORMAL){return this._addListener(new Ab(t,n,i))}addOnce(t,n,i=M0.NORMAL){return this._addListener(new Ab(t,n,i,!0))}_addListener(t){let n=this._head.next,i=this._head;if(!n)t.connect(i);else{for(;n;){if(t.priority>n.priority){t.connect(i);break}i=n,n=n.next}t.previous||t.connect(i)}return this._startIfPossible(),this}remove(t,n){let i=this._head.next;for(;i;)i.match(t,n)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,n=this._head;for(;n=n.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let n;if(t>this.lastTime){if(n=this.elapsedMS=t-this.lastTime,n>this._maxElapsedMS&&(n=this._maxElapsedMS),n*=this.speed,this._minElapsedMS){const s=t-this._lastFrame|0;if(s<this._minElapsedMS)return;this._lastFrame=t-s%this._minElapsedMS}this.deltaMS=n,this.deltaTime=this.deltaMS*Ja.targetFPMS;const i=this._head;let r=i.next;for(;r;)r=r.emit(this);i.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){const n=Math.min(Math.max(0,t)/1e3,Ja.targetFPMS);this._maxElapsedMS=1/n,this._minElapsedMS&&t>this.maxFPS&&(this.maxFPS=t)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){t===0?this._minElapsedMS=0:(t<this.minFPS&&(this.minFPS=t),this._minElapsedMS=1/(t/1e3))}static get shared(){if(!Ja._shared){const t=Ja._shared=new Ja;t.autoStart=!0,t._protected=!0}return Ja._shared}static get system(){if(!Ja._system){const t=Ja._system=new Ja;t.autoStart=!0,t._protected=!0}return Ja._system}};wA.targetFPMS=.06;let Wf=wA,Mb;async function fz(){return Mb??(Mb=(async()=>{var l;const t=is.get().createCanvas(1,1).getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const n=await new Promise(c=>{const f=document.createElement("video");f.onloadeddata=()=>c(f),f.onerror=()=>c(null),f.autoplay=!1,f.crossOrigin="anonymous",f.preload="auto",f.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",f.load()});if(!n)return"premultiply-alpha-on-upload";const i=t.createTexture();t.bindTexture(t.TEXTURE_2D,i);const r=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,r),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n);const s=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,s),t.deleteFramebuffer(r),t.deleteTexture(i),(l=t.getExtension("WEBGL_lose_context"))==null||l.loseContext(),s[0]<=s[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),Mb}const tx=class TA extends Is{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...TA.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const t=Wf.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const t=this.resource,n=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(n.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.alphaMode=await fz(),this._load=new Promise((i,r)=>{this.isValid?i(this):(this._resolve=i,this._reject=r,n.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${n.preloadTimeoutMs}ms`))})),t.load())}),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.resource;return!t.paused&&!t.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Wf.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Wf.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Wf.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};tx.extension=kt.TextureSource;tx.defaultOptions={...Is.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};tx.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let hz=tx;const Gf=(e,t,n=!1)=>(Array.isArray(e)||(e=[e]),t?e.map(i=>typeof i=="string"||n?t(i):i):e);class pz{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const n=this._cache.get(t);return n||ma(`[Assets] Asset id ${t} was not found in the Cache`),n}set(t,n){const i=Gf(t);let r;for(let f=0;f<this.parsers.length;f++){const p=this.parsers[f];if(p.test(n)){r=p.getCacheableAssets(i,n);break}}const s=new Map(Object.entries(r||{}));r||i.forEach(f=>{s.set(f,n)});const l=[...s.keys()],c={cacheKeys:l,keys:i};i.forEach(f=>{this._cacheMap.set(f,c)}),l.forEach(f=>{const p=r?r[f]:n;this._cache.has(f)&&this._cache.get(f)!==p&&ma("[Cache] already has key:",f),this._cache.set(f,s.get(f))})}remove(t){if(!this._cacheMap.has(t)){ma(`[Assets] Asset id ${t} was not found in the Cache`);return}const n=this._cacheMap.get(t);n.cacheKeys.forEach(r=>{this._cache.delete(r)}),n.keys.forEach(r=>{this._cacheMap.delete(r)})}get parsers(){return this._parsers}}const qf=new pz,Qv=[];li.handleByList(kt.TextureSource,Qv);function CA(e={}){const t=e&&e.resource,n=t?e.resource:e,i=t?e:{resource:e};for(let r=0;r<Qv.length;r++){const s=Qv[r];if(s.test(n))return new s(i)}throw new Error(`Could not find a source type for resource: ${i.resource}`)}function mz(e={},t=!1){const n=e&&e.resource,i=n?e.resource:e,r=n?e:{resource:e};if(!t&&qf.has(i))return qf.get(i);const s=new Mn({source:CA(r)});return s.on("destroy",()=>{qf.has(i)&&qf.remove(i)}),t||qf.set(i,s),s}function gz(e,t=!1){return typeof e=="string"?qf.get(e):e instanceof Is?new Mn({source:e}):mz(e,t)}Mn.from=gz;Is.from=CA;li.add(vA,_A,SA,hz,A0,EA,J1);var AA=(e=>(e[e.Low=0]="Low",e[e.Normal=1]="Normal",e[e.High=2]="High",e))(AA||{});function dl(e){if(typeof e!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(e)}`)}function Wp(e){return e.split("?")[0].split("#")[0]}function yz(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xz(e,t,n){return e.replace(new RegExp(yz(t),"g"),n)}function bz(e,t){let n="",i=0,r=-1,s=0,l=-1;for(let c=0;c<=e.length;++c){if(c<e.length)l=e.charCodeAt(c);else{if(l===47)break;l=47}if(l===47){if(!(r===c-1||s===1))if(r!==c-1&&s===2){if(n.length<2||i!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){const f=n.lastIndexOf("/");if(f!==n.length-1){f===-1?(n="",i=0):(n=n.slice(0,f),i=n.length-1-n.lastIndexOf("/")),r=c,s=0;continue}}else if(n.length===2||n.length===1){n="",i=0,r=c,s=0;continue}}}else n.length>0?n+=`/${e.slice(r+1,c)}`:n=e.slice(r+1,c),i=c-r-1;r=c,s=0}else l===46&&s!==-1?++s:s=-1}return n}const Nm={toPosix(e){return xz(e,"\\","/")},isUrl(e){return/^https?:/.test(this.toPosix(e))},isDataUrl(e){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(e)},isBlobUrl(e){return e.startsWith("blob:")},hasProtocol(e){return/^[^/:]+:/.test(this.toPosix(e))},getProtocol(e){dl(e),e=this.toPosix(e);const t=/^file:\/\/\//.exec(e);if(t)return t[0];const n=/^[^/:]+:\/{0,2}/.exec(e);return n?n[0]:""},toAbsolute(e,t,n){if(dl(e),this.isDataUrl(e)||this.isBlobUrl(e))return e;const i=Wp(this.toPosix(t??is.get().getBaseUrl())),r=Wp(this.toPosix(n??this.rootname(i)));return e=this.toPosix(e),e.startsWith("/")?Nm.join(r,e.slice(1)):this.isAbsolute(e)?e:this.join(i,e)},normalize(e){if(dl(e),e.length===0)return".";if(this.isDataUrl(e)||this.isBlobUrl(e))return e;e=this.toPosix(e);let t="";const n=e.startsWith("/");this.hasProtocol(e)&&(t=this.rootname(e),e=e.slice(t.length));const i=e.endsWith("/");return e=bz(e),e.length>0&&i&&(e+="/"),n?`/${e}`:t+e},isAbsolute(e){return dl(e),e=this.toPosix(e),this.hasProtocol(e)?!0:e.startsWith("/")},join(...e){if(e.length===0)return".";let t;for(let n=0;n<e.length;++n){const i=e[n];if(dl(i),i.length>0)if(t===void 0)t=i;else{const r=e[n-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?t+=`/../${i}`:t+=`/${i}`}}return t===void 0?".":this.normalize(t)},dirname(e){if(dl(e),e.length===0)return".";e=this.toPosix(e);let t=e.charCodeAt(0);const n=t===47;let i=-1,r=!0;const s=this.getProtocol(e),l=e;e=e.slice(s.length);for(let c=e.length-1;c>=1;--c)if(t=e.charCodeAt(c),t===47){if(!r){i=c;break}}else r=!1;return i===-1?n?"/":this.isUrl(l)?s+e:s:n&&i===1?"//":s+e.slice(0,i)},rootname(e){dl(e),e=this.toPosix(e);let t="";if(e.startsWith("/")?t="/":t=this.getProtocol(e),this.isUrl(e)){const n=e.indexOf("/",t.length);n!==-1?t=e.slice(0,n):t=e,t.endsWith("/")||(t+="/")}return t},basename(e,t){dl(e),t&&dl(t),e=Wp(this.toPosix(e));let n=0,i=-1,r=!0,s;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";let l=t.length-1,c=-1;for(s=e.length-1;s>=0;--s){const f=e.charCodeAt(s);if(f===47){if(!r){n=s+1;break}}else c===-1&&(r=!1,c=s+1),l>=0&&(f===t.charCodeAt(l)?--l===-1&&(i=s):(l=-1,i=c))}return n===i?i=c:i===-1&&(i=e.length),e.slice(n,i)}for(s=e.length-1;s>=0;--s)if(e.charCodeAt(s)===47){if(!r){n=s+1;break}}else i===-1&&(r=!1,i=s+1);return i===-1?"":e.slice(n,i)},extname(e){dl(e),e=Wp(this.toPosix(e));let t=-1,n=0,i=-1,r=!0,s=0;for(let l=e.length-1;l>=0;--l){const c=e.charCodeAt(l);if(c===47){if(!r){n=l+1;break}continue}i===-1&&(r=!1,i=l+1),c===46?t===-1?t=l:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||i===-1||s===0||s===1&&t===i-1&&t===n+1?"":e.slice(t,i)},parse(e){dl(e);const t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;e=Wp(this.toPosix(e));let n=e.charCodeAt(0);const i=this.isAbsolute(e);let r;t.root=this.rootname(e),i||this.hasProtocol(e)?r=1:r=0;let s=-1,l=0,c=-1,f=!0,p=e.length-1,m=0;for(;p>=r;--p){if(n=e.charCodeAt(p),n===47){if(!f){l=p+1;break}continue}c===-1&&(f=!1,c=p+1),n===46?s===-1?s=p:m!==1&&(m=1):s!==-1&&(m=-1)}return s===-1||c===-1||m===0||m===1&&s===c-1&&s===l+1?c!==-1&&(l===0&&i?t.base=t.name=e.slice(1,c):t.base=t.name=e.slice(l,c)):(l===0&&i?(t.name=e.slice(1,s),t.base=e.slice(1,c)):(t.name=e.slice(l,s),t.base=e.slice(l,c)),t.ext=e.slice(s,c)),t.dir=this.dirname(e),t},sep:"/",delimiter:":",joinExtensions:[".html"]};function MA(e,t,n,i,r){const s=t[n];for(let l=0;l<s.length;l++){const c=s[l];n<t.length-1?MA(e.replace(i[n],c),t,n+1,i,r):r.push(e.replace(i[n],c))}}function vz(e){const t=/\{(.*?)\}/g,n=e.match(t),i=[];if(n){const r=[];n.forEach(s=>{const l=s.substring(1,s.length-1).split(",");r.push(l)}),MA(e,r,0,n,i)}else i.push(e);return i}const YE=e=>!Array.isArray(e);class RA{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,n)=>`${t}${this._bundleIdConnector}${n}`,extractAssetIdFromBundle:(t,n)=>n.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(n=>{this._preferredOrder.push(n),n.priority||(n.priority=Object.keys(n.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{const n=t;this._defaultSearchParams=Object.keys(n).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(n[i])}`).join("&")}}getAlias(t){const{alias:n,src:i}=t;return Gf(n||i,s=>typeof s=="string"?s:Array.isArray(s)?s.map(l=>(l==null?void 0:l.src)??l):s!=null&&s.src?s.src:s,!0)}removeAlias(t,n){this._assetMap[t]&&(n&&n!==this._resolverHash[t]||(delete this._resolverHash[t],delete this._assetMap[t]))}addManifest(t){this._manifest&&ma("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(n=>{this.addBundle(n.name,n.assets)})}addBundle(t,n){const i=[];let r=n;Array.isArray(n)||(r=Object.entries(n).map(([s,l])=>typeof l=="string"||Array.isArray(l)?{alias:s,src:l}:{alias:s,...l})),r.forEach(s=>{const l=s.src,c=s.alias;let f;if(typeof c=="string"){const p=this._createBundleAssetId(t,c);i.push(p),f=[c,p]}else{const p=c.map(m=>this._createBundleAssetId(t,m));i.push(...p),f=[...c,...p]}this.add({...s,alias:f,src:l})}),this._bundles[t]=i}add(t){const n=[];Array.isArray(t)?n.push(...t):n.push(t);let i;i=s=>{this.hasKey(s)&&ma(`[Resolver] already has key: ${s} overwriting`)},Gf(n).forEach(s=>{const{src:l}=s;let{data:c,format:f,loadParser:p,parser:m}=s;const g=Gf(l).map(A=>typeof A=="string"?vz(A):Array.isArray(A)?A:[A]),x=this.getAlias(s);Array.isArray(x)?x.forEach(i):i(x);const v=[],S=A=>{const T=this._parsers.find(C=>C.test(A));return{src:A,...T==null?void 0:T.parse(A)}};g.forEach(A=>{A.forEach(T=>{let C={};if(typeof T!="object"?C=S(T):(c=T.data??c,f=T.format??f,(T.loadParser||T.parser)&&(p=T.loadParser??p,m=T.parser??m),C={...S(T.src),...T}),!x)throw new Error(`[Resolver] alias is undefined for this asset: ${C.src}`);C=this._buildResolvedAsset(C,{aliases:x,data:c,format:f,loadParser:p,parser:m,progressSize:s.progressSize}),v.push(C)})}),x.forEach(A=>{this._assetMap[A]=v})})}resolveBundle(t){const n=YE(t);t=Gf(t);const i={};return t.forEach(r=>{const s=this._bundles[r];if(s){const l=this.resolve(s),c={};for(const f in l){const p=l[f];c[this._extractAssetIdFromBundle(r,f)]=p}i[r]=c}}),n?i[t[0]]:i}resolveUrl(t){const n=this.resolve(t);if(typeof t!="string"){const i={};for(const r in n)i[r]=n[r].src;return i}return n.src}resolve(t){const n=YE(t);t=Gf(t);const i={};return t.forEach(r=>{if(!this._resolverHash[r])if(this._assetMap[r]){let s=this._assetMap[r];const l=this._getPreferredOrder(s);l==null||l.priority.forEach(c=>{l.params[c].forEach(f=>{const p=s.filter(m=>m[c]?m[c]===f:!1);p.length&&(s=p)})}),this._resolverHash[r]=s[0]}else this._resolverHash[r]=this._buildResolvedAsset({alias:[r],src:r},{});i[r]=this._resolverHash[r]}),n?i[t[0]]:i}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let n=0;n<t.length;n++){const i=t[n],r=this._preferredOrder.find(s=>s.params.format.includes(i.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const n=/\?/.test(t)?"&":"?";return`${t}${n}${this._defaultSearchParams}`}_buildResolvedAsset(t,n){const{aliases:i,data:r,loadParser:s,parser:l,format:c,progressSize:f}=n;return(this._basePath||this._rootPath)&&(t.src=Nm.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=i??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...r||{},...t.data},t.loadParser=s??t.loadParser,t.parser=l??t.parser,t.format=c??t.format??_z(t.src),f!==void 0&&(t.progressSize=f),t}}RA.RETINA_PREFIX=/@([0-9\.]+)x/;function _z(e){return e.split(".").pop().split("?").shift().split("#").shift()}const VE=(e,t)=>{const n=t.split("?")[1];return n&&(e+=`?${n}`),e},kA=class pm{constructor(t,n){this.linkedSheets=[];let i=t;(t==null?void 0:t.source)instanceof Is&&(i={texture:t,data:n});const{texture:r,data:s,cachePrefix:l=""}=i;this.cachePrefix=l,this._texture=r instanceof Mn?r:null,this.textureSource=r.source,this.textures={},this.animations={},this.data=s;const c=parseFloat(s.meta.scale);c?(this.resolution=c,r.source.resolution=this.resolution):this.resolution=r.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=pm.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(t,n=!1){let i=t;const r=n?1/0:pm.BATCH_SIZE;for(;i-t<r&&i<this._frameKeys.length;){const s=this._frameKeys[i],l=this._frames[s],c=l.frame;if(c){let f=null,p=null;const m=l.trimmed!==!1&&l.sourceSize?l.sourceSize:l.frame,g=new Ti(0,0,Math.floor(m.w)/this.resolution,Math.floor(m.h)/this.resolution);l.rotated?f=new Ti(Math.floor(c.x)/this.resolution,Math.floor(c.y)/this.resolution,Math.floor(c.h)/this.resolution,Math.floor(c.w)/this.resolution):f=new Ti(Math.floor(c.x)/this.resolution,Math.floor(c.y)/this.resolution,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution),l.trimmed!==!1&&l.spriteSourceSize&&(p=new Ti(Math.floor(l.spriteSourceSize.x)/this.resolution,Math.floor(l.spriteSourceSize.y)/this.resolution,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution)),this.textures[s]=new Mn({source:this.textureSource,frame:f,orig:g,trim:p,rotate:l.rotated?2:0,defaultAnchor:l.anchor,defaultBorders:l.borders,label:s.toString()})}i++}}_processAnimations(){const t=this.data.animations||{};for(const n in t){this.animations[n]=[];for(let i=0;i<t[n].length;i++){const r=t[n][i];this.animations[n].push(this.textures[r])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*pm.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*pm.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(t=!1){var n;for(const i in this.textures)this.textures[i].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&((n=this._texture)==null||n.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};kA.BATCH_SIZE=1e3;let XE=kA;const Sz=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function NA(e,t,n){const i={};if(e.forEach(r=>{i[r]=t}),Object.keys(t.textures).forEach(r=>{i[`${t.cachePrefix}${r}`]=t.textures[r]}),!n){const r=Nm.dirname(e[0]);t.linkedSheets.forEach((s,l)=>{const c=NA([`${r}/${t.data.meta.related_multi_packs[l]}`],s,!0);Object.assign(i,c)})}return i}const Ez={extension:kt.Asset,cache:{test:e=>e instanceof XE,getCacheableAssets:(e,t)=>NA(e,t,!1)},resolver:{extension:{type:kt.ResolveParser,name:"resolveSpritesheet"},test:e=>{const n=e.split("?")[0].split("."),i=n.pop(),r=n.pop();return i==="json"&&Sz.includes(r)},parse:e=>{var n;const t=e.split(".");return{resolution:parseFloat(((n=RA.RETINA_PREFIX.exec(e))==null?void 0:n[1])??"1"),format:t[t.length-2],src:e}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:kt.LoadParser,priority:AA.Normal,name:"spritesheetLoader"},async testParse(e,t){return Nm.extname(t.src).toLowerCase()===".json"&&!!e.frames},async parse(e,t,n){var g,x;const{texture:i,imageFilename:r,textureOptions:s,cachePrefix:l}=(t==null?void 0:t.data)??{};let c=Nm.dirname(t.src);c&&c.lastIndexOf("/")!==c.length-1&&(c+="/");let f;if(i instanceof Mn)f=i;else{const v=VE(c+(r??e.meta.image),t.src);f=(await n.load([{src:v,data:s}]))[v]}const p=new XE({texture:f.source,data:e,cachePrefix:l});await p.parse();const m=(g=e==null?void 0:e.meta)==null?void 0:g.related_multi_packs;if(Array.isArray(m)){const v=[];for(const A of m){if(typeof A!="string")continue;let T=c+A;(x=t.data)!=null&&x.ignoreMultiPack||(T=VE(T,t.src),v.push(n.load({src:T,data:{textureOptions:s,ignoreMultiPack:!0}})))}const S=await Promise.all(v);p.linkedSheets=S,S.forEach(A=>{A.linkedSheets=[p].concat(p.linkedSheets.filter(T=>T!==A))})}return p},async unload(e,t,n){await n.unload(e.textureSource._sourceOrigin),e.destroy(!1)}}};li.add(Ez);const Rb=Object.create(null),KE=Object.create(null);function i_(e,t){let n=KE[e];return n===void 0&&(Rb[t]===void 0&&(Rb[t]=1),KE[e]=n=Rb[t]++),n}let zf;function OA(){return(!zf||zf!=null&&zf.isContextLost())&&(zf=is.get().createCanvas().getContext("webgl",{})),zf}let Ly;function wz(){if(!Ly){Ly="mediump";const e=OA();e&&e.getShaderPrecisionFormat&&(Ly=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision?"highp":"mediump")}return Ly}function Tz(e,t,n){return t?e:n?(e=e.replace("out vec4 finalColor;",""),`
65
-
66
- #ifdef GL_ES // This checks if it is WebGL1
67
- #define in varying
68
- #define finalColor gl_FragColor
69
- #define texture texture2D
70
- #endif
71
- ${e}
72
- `):`
73
-
74
- #ifdef GL_ES // This checks if it is WebGL1
75
- #define in attribute
76
- #define out varying
77
- #endif
78
- ${e}
79
- `}function Cz(e,t,n){const i=n?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(e.substring(0,9)!=="precision"){let r=n?t.requestedFragmentPrecision:t.requestedVertexPrecision;return r==="highp"&&i!=="highp"&&(r="mediump"),`precision ${r} float;
80
- ${e}`}else if(i!=="highp"&&e.substring(0,15)==="precision highp")return e.replace("precision highp","precision mediump");return e}function Az(e,t){return t?`#version 300 es
81
- ${e}`:e}const Mz={},Rz={};function kz(e,{name:t="pixi-program"},n=!0){t=t.replace(/\s+/g,"-"),t+=n?"-fragment":"-vertex";const i=n?Mz:Rz;return i[t]?(i[t]++,t+=`-${i[t]}`):i[t]=1,e.indexOf("#define SHADER_NAME")!==-1?e:`${`#define SHADER_NAME ${t}`}
82
- ${e}`}function Nz(e,t){return t?e.replace("#version 300 es",""):e}const kb={stripVersion:Nz,ensurePrecision:Cz,addProgramDefines:Tz,setProgramName:kz,insertVersion:Az},Qp=Object.create(null),DA=class Zv{constructor(t){t={...Zv.defaultOptions,...t};const n=t.fragment.indexOf("#version 300 es")!==-1,i={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:wz()},setProgramName:{name:t.name},addProgramDefines:n,insertVersion:n};let r=t.fragment,s=t.vertex;Object.keys(kb).forEach(l=>{const c=i[l];r=kb[l](r,c,!0),s=kb[l](s,c,!1)}),this.fragment=r,this.vertex=s,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=i_(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,Qp[this._cacheKey]=null}static from(t){const n=`${t.vertex}:${t.fragment}`;return Qp[n]||(Qp[n]=new Zv(t),Qp[n]._cacheKey=n),Qp[n]}};DA.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let r_=DA;const $E={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function Oz(e){return $E[e]??$E.float32}const Dz={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},WE=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function QE(e,t){let n;for(;(n=WE.exec(e))!==null;){const i=Dz[n[3]]??"float32";t[n[2]]={location:parseInt(n[1],10),format:i,stride:Oz(i).stride,offset:0,instance:!1,start:0}}WE.lastIndex=0}function zz(e){return e.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function Bz({source:e,entryPoint:t}){const n={},i=zz(e),r=i.indexOf(`fn ${t}(`);if(r===-1)return n;const s=i.indexOf("->",r);if(s===-1)return n;const l=i.substring(r,s);if(QE(l,n),Object.keys(n).length===0){const c=l.match(/\(\s*\w+\s*:\s*(\w+)/);if(c){const f=c[1],p=new RegExp(`struct\\s+${f}\\s*\\{([^}]+)\\}`,"s"),m=i.match(p);m&&QE(m[1],n)}}return n}function Nb(e){var g,x;const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,i=/@binding\((\d+)\)/,r=/var(<[^>]+>)? (\w+)/,s=/:\s*([\w<>]+)/,l=/struct\s+(\w+)\s*{([^}]+)}/g,c=/(\w+)\s*:\s*([\w\<\>]+)/g,f=/struct\s+(\w+)/,p=(g=e.match(t))==null?void 0:g.map(v=>({group:parseInt(v.match(n)[1],10),binding:parseInt(v.match(i)[1],10),name:v.match(r)[2],isUniform:v.match(r)[1]==="<uniform>",type:v.match(s)[1]}));if(!p)return{groups:[],structs:[]};const m=((x=e.match(l))==null?void 0:x.map(v=>{const S=v.match(f)[1],A=v.match(c).reduce((T,C)=>{const[N,R]=C.split(":");return T[N.trim()]=R.trim(),T},{});return A?{name:S,members:A}:null}).filter(({name:v})=>p.some(S=>S.type===v||S.type.includes(`<${v}>`))))??[];return{groups:p,structs:m}}var fd=(e=>(e[e.VERTEX=1]="VERTEX",e[e.FRAGMENT=2]="FRAGMENT",e[e.COMPUTE=4]="COMPUTE",e))(fd||{});function Lz({groups:e}){const t=[];for(let n=0;n<e.length;n++){const i=e[n];t[i.group]||(t[i.group]=[]),i.isUniform?t[i.group].push({binding:i.binding,visibility:fd.VERTEX|fd.FRAGMENT,buffer:{type:"uniform"}}):i.type==="sampler"?t[i.group].push({binding:i.binding,visibility:fd.FRAGMENT,sampler:{type:"filtering"}}):i.type==="texture_2d"||i.type.startsWith("texture_2d<")?t[i.group].push({binding:i.binding,visibility:fd.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):i.type==="texture_2d_array"||i.type.startsWith("texture_2d_array<")?t[i.group].push({binding:i.binding,visibility:fd.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(i.type==="texture_cube"||i.type.startsWith("texture_cube<"))&&t[i.group].push({binding:i.binding,visibility:fd.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let n=0;n<t.length;n++)t[n]||(t[n]=[]);return t}function jz({groups:e}){const t=[];for(let n=0;n<e.length;n++){const i=e[n];t[i.group]||(t[i.group]={}),t[i.group][i.name]=i.binding}return t}function Iz(e,t){const n=new Set,i=new Set,r=[...e.structs,...t.structs].filter(l=>n.has(l.name)?!1:(n.add(l.name),!0)),s=[...e.groups,...t.groups].filter(l=>{const c=`${l.name}-${l.binding}`;return i.has(c)?!1:(i.add(c),!0)});return{structs:r,groups:s}}const Zp=Object.create(null);class Zm{constructor(t){var c,f;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:i,layout:r,gpuLayout:s,name:l}=t;if(this.name=l,this.fragment=n,this.vertex=i,n.source===i.source){const p=Nb(n.source);this.structsAndGroups=p}else{const p=Nb(i.source),m=Nb(n.source);this.structsAndGroups=Iz(p,m)}this.layout=r??jz(this.structsAndGroups),this.gpuLayout=s??Lz(this.structsAndGroups),this.autoAssignGlobalUniforms=((c=this.layout[0])==null?void 0:c.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((f=this.layout[1])==null?void 0:f.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:n}=this,i=t.source+n.source+t.entryPoint+n.entryPoint;this._layoutKey=i_(i,"program")}get attributeData(){return this._attributeData??(this._attributeData=Bz(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,Zp[this._cacheKey]=null}static from(t){const n=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return Zp[n]||(Zp[n]=new Zm(t),Zp[n]._cacheKey=n),Zp[n]}}const zA=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],Uz=zA.reduce((e,t)=>(e[t]=!0,e),{});function Hz(e,t){switch(e){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*t);case"vec3<f32>":return new Float32Array(3*t);case"vec4<f32>":return new Float32Array(4*t);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const BA=class LA{constructor(t,n){this._touched=0,this.uid=bi("uniform"),this._resourceType="uniformGroup",this._resourceId=bi("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...LA.defaultOptions,...n},this.uniformStructures=t;const i={};for(const r in t){const s=t[r];if(s.name=r,s.size=s.size??1,!Uz[s.type]){const l=s.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(l){const[,c,f]=l;throw new Error(`Uniform type ${s.type} is not supported. Use type: '${c}', size: ${f} instead.`)}throw new Error(`Uniform type ${s.type} is not supported. Supported uniform types are: ${zA.join(", ")}`)}s.value??(s.value=Hz(s.type,s.size)),i[r]=s.value}this.uniforms=i,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=i_(Object.keys(i).map(r=>`${r}-${t[r].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};BA.defaultOptions={ubo:!1,isStatic:!1};let jA=BA;class y0{constructor(t){this.resources=Object.create(null),this._dirty=!0;let n=0;for(const i in t){const r=t[i];this.setResource(r,n++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let n=0;for(const i in this.resources)t[n++]=this.resources[i]._resourceId;this._key=t.join("|")}setResource(t,n){var r,s;const i=this.resources[n];t!==i&&((r=i==null?void 0:i.off)==null||r.call(i,"change",this.onResourceChange,this),(s=t.on)==null||s.call(t,"change",this.onResourceChange,this),this.resources[n]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t,n){const i=this.resources;for(const r in i)i[r]._gcLastUsed=t,i[r]._touched=n}destroy(){var n;const t=this.resources;for(const i in t){const r=t[i];(n=r==null?void 0:r.off)==null||n.call(r,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){this._dirty=!0,t.destroyed?this.destroy():this._updateKey()}}var Jv=(e=>(e[e.WEBGL=1]="WEBGL",e[e.WEBGPU=2]="WEBGPU",e[e.CANVAS=4]="CANVAS",e[e.BOTH=3]="BOTH",e))(Jv||{});class nx extends yo{constructor(t){super(),this.uid=bi("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:n,glProgram:i,groups:r,resources:s,compatibleRenderers:l,groupMap:c}=t;this.gpuProgram=n,this.glProgram=i,l===void 0&&(l=0,n&&(l|=Jv.WEBGPU),i&&(l|=Jv.WEBGL)),this.compatibleRenderers=l;const f={};if(!s&&!r&&(s={}),s&&r)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&r&&!c)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!n&&r&&c)for(const p in c)for(const m in c[p]){const g=c[p][m];f[g]={group:p,binding:m,name:g}}else if(n&&r&&!c){const p=n.structsAndGroups.groups;c={},p.forEach(m=>{c[m.group]=c[m.group]||{},c[m.group][m.binding]=m.name,f[m.name]=m})}else if(s){r={},c={},n&&n.structsAndGroups.groups.forEach(g=>{c[g.group]=c[g.group]||{},c[g.group][g.binding]=g.name,f[g.name]=g});let p=0;for(const m in s)f[m]||(r[99]||(r[99]=new y0,this._ownedBindGroups.push(r[99])),f[m]={group:99,binding:p,name:m},c[99]=c[99]||{},c[99][p]=m,p++);for(const m in s){const g=m;let x=s[m];!x.source&&!x._resourceType&&(x=new jA(x));const v=f[g];v&&(r[v.group]||(r[v.group]=new y0,this._ownedBindGroups.push(r[v.group])),r[v.group].setResource(x,v.binding))}}this.groups=r,this._uniformBindMap=c,this.resources=this._buildResourceAccessor(r,f)}addResource(t,n,i){var r,s;(r=this._uniformBindMap)[n]||(r[n]={}),(s=this._uniformBindMap[n])[i]||(s[i]=t),this.groups[n]||(this.groups[n]=new y0,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(t,n){const i={};for(const r in n){const s=n[r];Object.defineProperty(i,s.name,{get(){return t[s.group].getResource(s.binding)},set(l){t[s.group].setResource(l,s.binding)}})}return i}destroy(t=!1){var n,i;this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&((n=this.gpuProgram)==null||n.destroy(),(i=this.glProgram)==null||i.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(r=>{r.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(t){const{gpu:n,gl:i,...r}=t;let s,l;return n&&(s=Zm.from(n)),i&&(l=r_.from(i)),new nx({gpuProgram:s,glProgram:l,...r})}}const Pz={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},Ob=0,Db=1,zb=2,Bb=3,Lb=4,jb=5,e1=class IA{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Ob)}set blend(t){!!(this.data&1<<Ob)!==t&&(this.data^=1<<Ob)}get offsets(){return!!(this.data&1<<Db)}set offsets(t){!!(this.data&1<<Db)!==t&&(this.data^=1<<Db)}set cullMode(t){if(t==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=t==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<zb)}set culling(t){!!(this.data&1<<zb)!==t&&(this.data^=1<<zb)}get depthTest(){return!!(this.data&1<<Bb)}set depthTest(t){!!(this.data&1<<Bb)!==t&&(this.data^=1<<Bb)}get depthMask(){return!!(this.data&1<<jb)}set depthMask(t){!!(this.data&1<<jb)!==t&&(this.data^=1<<jb)}get clockwiseFrontFace(){return!!(this.data&1<<Lb)}set clockwiseFrontFace(t){!!(this.data&1<<Lb)!==t&&(this.data^=1<<Lb)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=Pz[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const t=new IA;return t.depthTest=!1,t.blend=!0,t}};e1.default2d=e1.for2d();let a_=e1;const UA=class t1 extends nx{constructor(t){t={...t1.defaultOptions,...t},super(t),this.enabled=!0,this._state=a_.for2d(),this.blendMode=t.blendMode,this.padding=t.padding,typeof t.antialias=="boolean"?this.antialias=t.antialias?"on":"off":this.antialias=t.antialias,this.resolution=t.resolution,this.blendRequired=t.blendRequired,this.clipToViewport=t.clipToViewport,this.addResource("uTexture",0,1),t.blendRequired&&this.addResource("uBackTexture",0,3)}apply(t,n,i,r){t.applyFilter(this,n,i,r)}get blendMode(){return this._state.blendMode}set blendMode(t){this._state.blendMode=t}static from(t){const{gpu:n,gl:i,...r}=t;let s,l;return n&&(s=Zm.from(n)),i&&(l=r_.from(i)),new t1({gpuProgram:s,glProgram:l,...r})}};UA.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let Ad=UA;const n1=[];li.handleByNamedList(kt.Environment,n1);async function Fz(e){if(!e)for(let t=0;t<n1.length;t++){const n=n1[t];if(n.value.test()){await n.value.load();return}}}let Jp;function Gz(){if(typeof Jp=="boolean")return Jp;try{Jp=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Jp=!1}return Jp}function ZE(e,t,n=2){const i=t&&t.length,r=i?t[0]*n:e.length;let s=HA(e,0,r,n,!0);const l=[];if(!s||s.next===s.prev)return l;let c,f,p;if(i&&(s=Kz(e,t,s,n)),e.length>80*n){c=e[0],f=e[1];let m=c,g=f;for(let x=n;x<r;x+=n){const v=e[x],S=e[x+1];v<c&&(c=v),S<f&&(f=S),v>m&&(m=v),S>g&&(g=S)}p=Math.max(m-c,g-f),p=p!==0?32767/p:0}return Om(s,l,n,c,f,p,0),l}function HA(e,t,n,i,r){let s;if(r===a5(e,t,n,i)>0)for(let l=t;l<n;l+=i)s=JE(l/i|0,e[l],e[l+1],s);else for(let l=n-i;l>=t;l-=i)s=JE(l/i|0,e[l],e[l+1],s);return s&&uh(s,s.next)&&(zm(s),s=s.next),s}function vd(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(uh(n,n.next)||si(n.prev,n,n.next)===0)){if(zm(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function Om(e,t,n,i,r,s,l){if(!e)return;!l&&s&&Jz(e,i,r,s);let c=e;for(;e.prev!==e.next;){const f=e.prev,p=e.next;if(s?Yz(e,i,r,s):qz(e)){t.push(f.i,e.i,p.i),zm(e),e=p.next,c=p.next;continue}if(e=p,e===c){l?l===1?(e=Vz(vd(e),t),Om(e,t,n,i,r,s,2)):l===2&&Xz(e,t,n,i,r,s):Om(vd(e),t,n,i,r,s,1);break}}}function qz(e){const t=e.prev,n=e,i=e.next;if(si(t,n,i)>=0)return!1;const r=t.x,s=n.x,l=i.x,c=t.y,f=n.y,p=i.y,m=Math.min(r,s,l),g=Math.min(c,f,p),x=Math.max(r,s,l),v=Math.max(c,f,p);let S=i.next;for(;S!==t;){if(S.x>=m&&S.x<=x&&S.y>=g&&S.y<=v&&mm(r,c,s,f,l,p,S.x,S.y)&&si(S.prev,S,S.next)>=0)return!1;S=S.next}return!0}function Yz(e,t,n,i){const r=e.prev,s=e,l=e.next;if(si(r,s,l)>=0)return!1;const c=r.x,f=s.x,p=l.x,m=r.y,g=s.y,x=l.y,v=Math.min(c,f,p),S=Math.min(m,g,x),A=Math.max(c,f,p),T=Math.max(m,g,x),C=i1(v,S,t,n,i),N=i1(A,T,t,n,i);let R=e.prevZ,O=e.nextZ;for(;R&&R.z>=C&&O&&O.z<=N;){if(R.x>=v&&R.x<=A&&R.y>=S&&R.y<=T&&R!==r&&R!==l&&mm(c,m,f,g,p,x,R.x,R.y)&&si(R.prev,R,R.next)>=0||(R=R.prevZ,O.x>=v&&O.x<=A&&O.y>=S&&O.y<=T&&O!==r&&O!==l&&mm(c,m,f,g,p,x,O.x,O.y)&&si(O.prev,O,O.next)>=0))return!1;O=O.nextZ}for(;R&&R.z>=C;){if(R.x>=v&&R.x<=A&&R.y>=S&&R.y<=T&&R!==r&&R!==l&&mm(c,m,f,g,p,x,R.x,R.y)&&si(R.prev,R,R.next)>=0)return!1;R=R.prevZ}for(;O&&O.z<=N;){if(O.x>=v&&O.x<=A&&O.y>=S&&O.y<=T&&O!==r&&O!==l&&mm(c,m,f,g,p,x,O.x,O.y)&&si(O.prev,O,O.next)>=0)return!1;O=O.nextZ}return!0}function Vz(e,t){let n=e;do{const i=n.prev,r=n.next.next;!uh(i,r)&&FA(i,n,n.next,r)&&Dm(i,r)&&Dm(r,i)&&(t.push(i.i,n.i,r.i),zm(n),zm(n.next),n=e=r),n=n.next}while(n!==e);return vd(n)}function Xz(e,t,n,i,r,s){let l=e;do{let c=l.next.next;for(;c!==l.prev;){if(l.i!==c.i&&n5(l,c)){let f=GA(l,c);l=vd(l,l.next),f=vd(f,f.next),Om(l,t,n,i,r,s,0),Om(f,t,n,i,r,s,0);return}c=c.next}l=l.next}while(l!==e)}function Kz(e,t,n,i){const r=[];for(let s=0,l=t.length;s<l;s++){const c=t[s]*i,f=s<l-1?t[s+1]*i:e.length,p=HA(e,c,f,i,!1);p===p.next&&(p.steiner=!0),r.push(t5(p))}r.sort($z);for(let s=0;s<r.length;s++)n=Wz(r[s],n);return n}function $z(e,t){let n=e.x-t.x;if(n===0&&(n=e.y-t.y,n===0)){const i=(e.next.y-e.y)/(e.next.x-e.x),r=(t.next.y-t.y)/(t.next.x-t.x);n=i-r}return n}function Wz(e,t){const n=Qz(e,t);if(!n)return t;const i=GA(n,e);return vd(i,i.next),vd(n,n.next)}function Qz(e,t){let n=t;const i=e.x,r=e.y;let s=-1/0,l;if(uh(e,n))return n;do{if(uh(e,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const g=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(g<=i&&g>s&&(s=g,l=n.x<n.next.x?n:n.next,g===i))return l}n=n.next}while(n!==t);if(!l)return null;const c=l,f=l.x,p=l.y;let m=1/0;n=l;do{if(i>=n.x&&n.x>=f&&i!==n.x&&PA(r<p?i:s,r,f,p,r<p?s:i,r,n.x,n.y)){const g=Math.abs(r-n.y)/(i-n.x);Dm(n,e)&&(g<m||g===m&&(n.x>l.x||n.x===l.x&&Zz(l,n)))&&(l=n,m=g)}n=n.next}while(n!==c);return l}function Zz(e,t){return si(e.prev,e,t.prev)<0&&si(t.next,e,e.next)<0}function Jz(e,t,n,i){let r=e;do r.z===0&&(r.z=i1(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,e5(r)}function e5(e){let t,n=1;do{let i=e,r;e=null;let s=null;for(t=0;i;){t++;let l=i,c=0;for(let p=0;p<n&&(c++,l=l.nextZ,!!l);p++);let f=n;for(;c>0||f>0&&l;)c!==0&&(f===0||!l||i.z<=l.z)?(r=i,i=i.nextZ,c--):(r=l,l=l.nextZ,f--),s?s.nextZ=r:e=r,r.prevZ=s,s=r;i=l}s.nextZ=null,n*=2}while(t>1);return e}function i1(e,t,n,i,r){return e=(e-n)*r|0,t=(t-i)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function t5(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function PA(e,t,n,i,r,s,l,c){return(r-l)*(t-c)>=(e-l)*(s-c)&&(e-l)*(i-c)>=(n-l)*(t-c)&&(n-l)*(s-c)>=(r-l)*(i-c)}function mm(e,t,n,i,r,s,l,c){return!(e===l&&t===c)&&PA(e,t,n,i,r,s,l,c)}function n5(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!i5(e,t)&&(Dm(e,t)&&Dm(t,e)&&r5(e,t)&&(si(e.prev,e,t.prev)||si(e,t.prev,t))||uh(e,t)&&si(e.prev,e,e.next)>0&&si(t.prev,t,t.next)>0)}function si(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function uh(e,t){return e.x===t.x&&e.y===t.y}function FA(e,t,n,i){const r=Iy(si(e,t,n)),s=Iy(si(e,t,i)),l=Iy(si(n,i,e)),c=Iy(si(n,i,t));return!!(r!==s&&l!==c||r===0&&jy(e,n,t)||s===0&&jy(e,i,t)||l===0&&jy(n,e,i)||c===0&&jy(n,t,i))}function jy(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Iy(e){return e>0?1:e<0?-1:0}function i5(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&FA(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Dm(e,t){return si(e.prev,e,e.next)<0?si(e,t,e.next)>=0&&si(e,e.prev,t)>=0:si(e,t,e.prev)<0||si(e,e.next,t)<0}function r5(e,t){let n=e,i=!1;const r=(e.x+t.x)/2,s=(e.y+t.y)/2;do n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function GA(e,t){const n=r1(e.i,e.x,e.y),i=r1(t.i,t.x,t.y),r=e.next,s=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function JE(e,t,n,i){const r=r1(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function zm(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function r1(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function a5(e,t,n,i){let r=0;for(let s=t,l=n-i;s<n;s+=i)r+=(e[l]-e[s])*(e[s+1]+e[l+1]),l=s;return r}const s5=ZE.default||ZE;var qA=(e=>(e[e.NONE=0]="NONE",e[e.COLOR=16384]="COLOR",e[e.STENCIL=1024]="STENCIL",e[e.DEPTH=256]="DEPTH",e[e.COLOR_DEPTH=16640]="COLOR_DEPTH",e[e.COLOR_STENCIL=17408]="COLOR_STENCIL",e[e.DEPTH_STENCIL=1280]="DEPTH_STENCIL",e[e.ALL=17664]="ALL",e))(qA||{});class l5{constructor(t){this.items=[],this._name=t}emit(t,n,i,r,s,l,c,f){const{name:p,items:m}=this;for(let g=0,x=m.length;g<x;g++)m[g][p](t,n,i,r,s,l,c,f);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){const n=this.items.indexOf(t);return n!==-1&&this.items.splice(n,1),this}contains(t){return this.items.indexOf(t)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}const o5=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],YA=class VA extends yo{constructor(t){super(),this.tick=0,this.uid=bi("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name,this.config=t;const n=[...o5,...this.config.runners??[]];this._addRunners(...n),this._unsafeEvalCheck()}async init(t={}){const n=t.skipExtensionImports===!0?!0:t.manageImports===!1;await Fz(n),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const i in this._systemsHash)t={...this._systemsHash[i].constructor.defaultOptions,...t};t={...VA.defaultOptions,...t},this._roundPixels=t.roundPixels?1:0;for(let i=0;i<this.runners.init.items.length;i++)await this.runners.init.items[i].init(t);this._initOptions=t}render(t,n){this.tick++;let i=t;if(i instanceof _r&&(i={container:i},n&&(en(xi,"passing a second argument is deprecated, please use render options instead"),i.target=n.renderTexture)),i.target||(i.target=this.view.renderTarget),i.target===this.view.renderTarget&&(this._lastObjectRendered=i.container,i.clearColor??(i.clearColor=this.background.colorRgba),i.clear??(i.clear=this.background.clearBeforeRender)),i.clearColor){const r=Array.isArray(i.clearColor)&&i.clearColor.length===4;i.clearColor=r?i.clearColor:qi.shared.setValue(i.clearColor).toArray()}i.transform||(i.container.updateLocalTransform(),i.transform=i.container.localTransform),i.container.visible&&(i.container.enableRenderGroup(),this.runners.prerender.emit(i),this.runners.renderStart.emit(i),this.runners.render.emit(i),this.runners.renderEnd.emit(i),this.runners.postrender.emit(i))}resize(t,n,i){const r=this.view.resolution;this.view.resize(t,n,i),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),i!==void 0&&i!==r&&this.runners.resolutionChange.emit(i)}clear(t={}){const n=this;t.target||(t.target=n.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=qA.ALL);const{clear:i,clearColor:r,target:s,mipLevel:l,layer:c}=t;qi.shared.setValue(r??this.background.colorRgba),n.renderTarget.clear(s,i,qi.shared.toArray(),l??0,c??0)}get resolution(){return this.view.resolution}set resolution(t){this.view.resolution=t,this.runners.resolutionChange.emit(t)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...t){t.forEach(n=>{this.runners[n]=new l5(n)})}_addSystems(t){let n;for(n in t){const i=t[n];this._addSystem(i.value,i.name)}}_addSystem(t,n){const i=new t(this);if(this[n])throw new Error(`Whoops! The name "${n}" is already in use`);this[n]=i,this._systemsHash[n]=i;for(const r in this.runners)this.runners[r].add(i);return this}_addPipes(t,n){const i=n.reduce((r,s)=>(r[s.name]=s.value,r),{});t.forEach(r=>{const s=r.value,l=r.name,c=i[l];this.renderPipes[l]=new s(this,c?new c:null),this.runners.destroy.add(this.renderPipes[l])})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),(t===!0||typeof t=="object"&&t.releaseGlobalResources)&&Qm.release(),Object.values(this.runners).forEach(n=>{n.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!Gz())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};YA.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let XA=YA,Uy;function c5(e){return Uy!==void 0||(Uy=(()=>{var n;const t={stencil:!0,failIfMajorPerformanceCaveat:e??XA.defaultOptions.failIfMajorPerformanceCaveat};try{if(!is.get().getWebGLRenderingContext())return!1;let r=is.get().createCanvas().getContext("webgl",t);const s=!!((n=r==null?void 0:r.getContextAttributes())!=null&&n.stencil);if(r){const l=r.getExtension("WEBGL_lose_context");l&&l.loseContext()}return r=null,s}catch{return!1}})()),Uy}let Hy;async function u5(e={}){return Hy!==void 0||(Hy=await(async()=>{const t=is.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(e)).requestDevice(),!0}catch{return!1}})()),Hy}const ew=["webgl","webgpu","canvas"];async function d5(e){let t=[];e.preference?(t.push(e.preference),ew.forEach(s=>{s!==e.preference&&t.push(s)})):t=ew.slice();let n,i={};for(let s=0;s<t.length;s++){const l=t[s];if(l==="webgpu"&&await u5()){const{WebGPURenderer:c}=await ou(async()=>{const{WebGPURenderer:f}=await import("./WebGPURenderer-BLRy1Ehh.js");return{WebGPURenderer:f}},__vite__mapDeps([4,5,6]));n=c,i={...e,...e.webgpu};break}else if(l==="webgl"&&c5(e.failIfMajorPerformanceCaveat??XA.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:c}=await ou(async()=>{const{WebGLRenderer:f}=await import("./WebGLRenderer-DQLmNcFd.js");return{WebGLRenderer:f}},__vite__mapDeps([7,5,6]));n=c,i={...e,...e.webgl};break}else if(l==="canvas"){const{CanvasRenderer:c}=await ou(async()=>{const{CanvasRenderer:f}=await import("./CanvasRenderer-C2gIPS0M.js");return{CanvasRenderer:f}},__vite__mapDeps([8,6]));n=c,i={...e,...e.canvasOptions};break}}if(delete i.webgpu,delete i.webgl,delete i.canvasOptions,!n)throw new Error("No available renderer for the current environment");const r=new n;return await r.init(i),r}const KA="8.17.0";class $A{static init(){var t;(t=globalThis.__PIXI_APP_INIT__)==null||t.call(globalThis,this,KA)}static destroy(){}}$A.extension=kt.Application;class f5{constructor(t){this._renderer=t}init(){var t;(t=globalThis.__PIXI_RENDERER_INIT__)==null||t.call(globalThis,this._renderer,KA)}destroy(){this._renderer=null}}f5.extension={type:[kt.WebGLSystem,kt.WebGPUSystem],name:"initHook",priority:-10};class WA{static init(t){Object.defineProperty(this,"resizeTo",{configurable:!0,set(n){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=n,n&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let n,i;if(this._resizeTo===globalThis.window)n=globalThis.innerWidth,i=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:s}=this._resizeTo;n=r,i=s}this.renderer.resize(n,i),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}WA.extension=kt.Application;class QA{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{configurable:!0,set(n){this._ticker&&this._ticker.remove(this.render,this),this._ticker=n,n&&n.add(this.render,this,M0.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Wf.shared:new Wf,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}QA.extension=kt.Application;li.add(WA);li.add(QA);const ZA=class a1{constructor(...t){this.stage=new _r,t[0]!==void 0&&en(xi,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.stage||(this.stage=new _r),this.renderer=await d5(t),a1._plugins.forEach(n=>{n.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return en(xi,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,n=!1){const i=a1._plugins.slice(0);i.reverse(),i.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(t),this.renderer=null}};ZA._plugins=[];let s_=ZA;li.handleByList(kt.Application,s_._plugins);li.add($A);var Ib,tw;function h5(){if(tw)return Ib;tw=1,Ib=n;var e={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},t=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(s){var l=[];return s.replace(t,function(c,f,p){var m=f.toLowerCase();for(p=r(p),m=="m"&&p.length>2&&(l.push([f].concat(p.splice(0,2))),m="l",f=f=="m"?"l":"L");;){if(p.length==e[m])return p.unshift(f),l.push(p);if(p.length<e[m])throw new Error("malformed path data");l.push([f].concat(p.splice(0,e[m])))}}),l}var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function r(s){var l=s.match(i);return l?l.map(Number):[]}return Ib}var p5=h5();const m5=du(p5);function g5(e,t){const n=m5(e),i=[];let r=null,s=0,l=0;for(let c=0;c<n.length;c++){const f=n[c],p=f[0],m=f;switch(p){case"M":s=m[1],l=m[2],t.moveTo(s,l);break;case"m":s+=m[1],l+=m[2],t.moveTo(s,l);break;case"H":s=m[1],t.lineTo(s,l);break;case"h":s+=m[1],t.lineTo(s,l);break;case"V":l=m[1],t.lineTo(s,l);break;case"v":l+=m[1],t.lineTo(s,l);break;case"L":s=m[1],l=m[2],t.lineTo(s,l);break;case"l":s+=m[1],l+=m[2],t.lineTo(s,l);break;case"C":s=m[5],l=m[6],t.bezierCurveTo(m[1],m[2],m[3],m[4],s,l);break;case"c":t.bezierCurveTo(s+m[1],l+m[2],s+m[3],l+m[4],s+m[5],l+m[6]),s+=m[5],l+=m[6];break;case"S":s=m[3],l=m[4],t.bezierCurveToShort(m[1],m[2],s,l);break;case"s":t.bezierCurveToShort(s+m[1],l+m[2],s+m[3],l+m[4]),s+=m[3],l+=m[4];break;case"Q":s=m[3],l=m[4],t.quadraticCurveTo(m[1],m[2],s,l);break;case"q":t.quadraticCurveTo(s+m[1],l+m[2],s+m[3],l+m[4]),s+=m[3],l+=m[4];break;case"T":s=m[1],l=m[2],t.quadraticCurveToShort(s,l);break;case"t":s+=m[1],l+=m[2],t.quadraticCurveToShort(s,l);break;case"A":s=m[6],l=m[7],t.arcToSvg(m[1],m[2],m[3],m[4],m[5],s,l);break;case"a":s+=m[6],l+=m[7],t.arcToSvg(m[1],m[2],m[3],m[4],m[5],s,l);break;case"Z":case"z":t.closePath(),i.length>0&&(r=i.pop(),r?(s=r.startX,l=r.startY):(s=0,l=0)),r=null;break;default:ma(`Unknown SVG path command: ${p}`)}p!=="Z"&&p!=="z"&&r===null&&(r={startX:s,startY:l},i.push(r))}return t}class l_{constructor(t=0,n=0,i=0){this.type="circle",this.x=t,this.y=n,this.radius=i}clone(){return new l_(this.x,this.y,this.radius)}contains(t,n){if(this.radius<=0)return!1;const i=this.radius*this.radius;let r=this.x-t,s=this.y-n;return r*=r,s*=s,r+s<=i}strokeContains(t,n,i,r=.5){if(this.radius===0)return!1;const s=this.x-t,l=this.y-n,c=this.radius,f=(1-r)*i,p=Math.sqrt(s*s+l*l);return p<=c+f&&p>c-(i-f)}getBounds(t){return t||(t=new Ti),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.height=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class o_{constructor(t=0,n=0,i=0,r=0){this.type="ellipse",this.x=t,this.y=n,this.halfWidth=i,this.halfHeight=r}clone(){return new o_(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,n){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let i=(t-this.x)/this.halfWidth,r=(n-this.y)/this.halfHeight;return i*=i,r*=r,i+r<=1}strokeContains(t,n,i,r=.5){const{halfWidth:s,halfHeight:l}=this;if(s<=0||l<=0)return!1;const c=i*(1-r),f=i-c,p=s-f,m=l-f,g=s+c,x=l+c,v=t-this.x,S=n-this.y,A=v*v/(p*p)+S*S/(m*m),T=v*v/(g*g)+S*S/(x*x);return A>1&&T<=1}getBounds(t){return t||(t=new Ti),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=this.halfWidth*2,t.height=this.halfHeight*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function y5(e,t,n,i,r,s){const l=e-n,c=t-i,f=r-n,p=s-i,m=l*f+c*p,g=f*f+p*p;let x=-1;g!==0&&(x=m/g);let v,S;x<0?(v=n,S=i):x>1?(v=r,S=s):(v=n+x*f,S=i+x*p);const A=e-v,T=t-S;return A*A+T*T}let x5,b5;class Sm{constructor(...t){this.type="polygon";let n=Array.isArray(t[0])?t[0]:t;if(typeof n[0]!="number"){const i=[];for(let r=0,s=n.length;r<s;r++)i.push(n[r].x,n[r].y);n=i}this.points=n,this.closePath=!0}isClockwise(){let t=0;const n=this.points,i=n.length;for(let r=0;r<i;r+=2){const s=n[r],l=n[r+1],c=n[(r+2)%i],f=n[(r+3)%i];t+=(c-s)*(f+l)}return t<0}containsPolygon(t){const n=this.getBounds(x5),i=t.getBounds(b5);if(!n.containsRect(i))return!1;const r=t.points;for(let s=0;s<r.length;s+=2){const l=r[s],c=r[s+1];if(!this.contains(l,c))return!1}return!0}clone(){const t=this.points.slice(),n=new Sm(t);return n.closePath=this.closePath,n}contains(t,n){let i=!1;const r=this.points.length/2;for(let s=0,l=r-1;s<r;l=s++){const c=this.points[s*2],f=this.points[s*2+1],p=this.points[l*2],m=this.points[l*2+1];f>n!=m>n&&t<(p-c)*((n-f)/(m-f))+c&&(i=!i)}return i}strokeContains(t,n,i,r=.5){const s=i*i,l=s*(1-r),c=s-l,{points:f}=this,p=f.length-(this.closePath?0:2);for(let m=0;m<p;m+=2){const g=f[m],x=f[m+1],v=f[(m+2)%f.length],S=f[(m+3)%f.length],A=y5(t,n,g,x,v,S),T=Math.sign((v-g)*(n-x)-(S-x)*(t-g));if(A<=(T<0?c:l))return!0}return!1}getBounds(t){t||(t=new Ti);const n=this.points;let i=1/0,r=-1/0,s=1/0,l=-1/0;for(let c=0,f=n.length;c<f;c+=2){const p=n[c],m=n[c+1];i=p<i?p:i,r=p>r?p:r,s=m<s?m:s,l=m>l?m:l}return t.x=i,t.width=r-i,t.y=s,t.height=l-s,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,n)=>`${t}, ${n}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return en("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return en("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const Py=(e,t,n,i,r,s,l)=>{const c=e-n,f=t-i,p=Math.sqrt(c*c+f*f);return p>=r-s&&p<=r+l};class c_{constructor(t=0,n=0,i=0,r=0,s=20){this.type="roundedRectangle",this.x=t,this.y=n,this.width=i,this.height=r,this.radius=s}getBounds(t){return t||(t=new Ti),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new c_(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,n){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&n>=this.y&&n<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(n>=this.y+i&&n<=this.y+this.height-i||t>=this.x+i&&t<=this.x+this.width-i)return!0;let r=t-(this.x+i),s=n-(this.y+i);const l=i*i;if(r*r+s*s<=l||(r=t-(this.x+this.width-i),r*r+s*s<=l)||(s=n-(this.y+this.height-i),r*r+s*s<=l)||(r=t-(this.x+i),r*r+s*s<=l))return!0}return!1}strokeContains(t,n,i,r=.5){const{x:s,y:l,width:c,height:f,radius:p}=this,m=i*(1-r),g=i-m,x=s+p,v=l+p,S=c-p*2,A=f-p*2,T=s+c,C=l+f;return(t>=s-m&&t<=s+g||t>=T-g&&t<=T+m)&&n>=v&&n<=v+A||(n>=l-m&&n<=l+g||n>=C-g&&n<=C+m)&&t>=x&&t<=x+S?!0:t<x&&n<v&&Py(t,n,x,v,p,g,m)||t>T-p&&n<v&&Py(t,n,T-p,v,p,g,m)||t>T-p&&n>C-p&&Py(t,n,T-p,C-p,p,g,m)||t<x&&n>C-p&&Py(t,n,x,C-p,p,g,m)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const JA={};function v5(e,t,n){let i=2166136261;for(let r=0;r<t;r++)i^=e[r].uid,i=Math.imul(i,16777619),i>>>=0;return JA[i]||_5(e,t,i,n)}function _5(e,t,n,i){const r={};let s=0;for(let c=0;c<i;c++){const f=c<t?e[c]:Mn.EMPTY.source;r[s++]=f.source,r[s++]=f.style}const l=new y0(r);return JA[n]=l,l}class nw{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}function iw(e,t,n,i){if(n??(n=0),i??(i=Math.min(e.byteLength-n,t.byteLength)),!(n&7)&&!(i&7)){const r=i/8;new Float64Array(t,0,r).set(new Float64Array(e,n,r))}else if(!(n&3)&&!(i&3)){const r=i/4;new Float32Array(t,0,r).set(new Float32Array(e,n,r))}else new Uint8Array(t).set(new Uint8Array(e,n,i))}const S5={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var E5=(e=>(e[e.DISABLED=0]="DISABLED",e[e.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",e[e.MASK_ACTIVE=2]="MASK_ACTIVE",e[e.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",e[e.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",e[e.NONE=5]="NONE",e))(E5||{});function rw(e,t){return t.alphaMode==="no-premultiply-alpha"&&S5[e]||e}const w5=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
83
- `);function T5(e){let t="";for(let n=0;n<e;++n)n>0&&(t+=`
84
- else `),n<e-1&&(t+=`if(test == ${n}.0){}`);return t}function C5(e,t){if(e===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const n=t.createShader(t.FRAGMENT_SHADER);try{for(;;){const i=w5.replace(/%forloop%/gi,T5(e));if(t.shaderSource(n,i),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))e=e/2|0;else break}}finally{t.deleteShader(n)}return e}let Bf=null;function A5(){var t;if(Bf)return Bf;const e=OA();return Bf=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),Bf=C5(Bf,e),(t=e.getExtension("WEBGL_lose_context"))==null||t.loseContext(),Bf}class M5{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t<this.count;t++){const n=this.textures[t];this.textures[t]=null,this.ids[n.uid]=null}this.count=0}}class R5{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new M5,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null,this.elements=null}}const Em=[];let R0=0;Qm.register({clear:()=>{if(Em.length>0)for(const e of Em)e&&e.destroy();Em.length=0,R0=0}});function aw(){return R0>0?Em[--R0]:new R5}function sw(e){e.elements=null,Em[R0++]=e}let em=0;const eM=class tM{constructor(t){this.uid=bi("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],t={...tM.defaultOptions,...t},t.maxTextures||(en("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),t.maxTextures=A5());const{maxTextures:n,attributesInitialSize:i,indicesInitialSize:r}=t;this.attributeBuffer=new nw(i*4),this.indexBuffer=new Uint16Array(r),this.maxTextures=n}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;t<this.batchIndex;t++)sw(this.batches[t]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(t){this._elements[this.elementSize++]=t,t._indexStart=this.indexSize,t._attributeStart=this.attributeSize,t._batcher=this,this.indexSize+=t.indexSize,this.attributeSize+=t.attributeSize*this.vertexSize}checkAndUpdateTexture(t,n){const i=t._batch.textures.ids[n._source.uid];return!i&&i!==0?!1:(t._textureId=i,t.texture=n,!0)}updateElement(t){this.dirty=!0;const n=this.attributeBuffer;t.packAsQuad?this.packQuadAttributes(t,n.float32View,n.uint32View,t._attributeStart,t._textureId):this.packAttributes(t,n.float32View,n.uint32View,t._attributeStart,t._textureId)}break(t){const n=this._elements;if(!n[this.elementStart])return;let i=aw(),r=i.textures;r.clear();const s=n[this.elementStart];let l=rw(s.blendMode,s.texture._source),c=s.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const f=this.attributeBuffer.float32View,p=this.attributeBuffer.uint32View,m=this.indexBuffer;let g=this._batchIndexSize,x=this._batchIndexStart,v="startBatch",S=[];const A=this.maxTextures;for(let T=this.elementStart;T<this.elementSize;++T){const C=n[T];n[T]=null;const R=C.texture._source,O=rw(C.blendMode,R),H=l!==O||c!==C.topology;if(R._batchTick===em&&!H){C._textureId=R._textureBindLocation,g+=C.indexSize,C.packAsQuad?(this.packQuadAttributes(C,f,p,C._attributeStart,C._textureId),this.packQuadIndex(m,C._indexStart,C._attributeStart/this.vertexSize)):(this.packAttributes(C,f,p,C._attributeStart,C._textureId),this.packIndex(C,m,C._indexStart,C._attributeStart/this.vertexSize)),C._batch=i,S.push(C);continue}R._batchTick=em,(r.count>=A||H)&&(this._finishBatch(i,x,g-x,r,l,c,t,v,S),v="renderBatch",x=g,l=O,c=C.topology,i=aw(),r=i.textures,r.clear(),S=[],++em),C._textureId=R._textureBindLocation=r.count,r.ids[R.uid]=r.count,r.textures[r.count++]=R,C._batch=i,S.push(C),g+=C.indexSize,C.packAsQuad?(this.packQuadAttributes(C,f,p,C._attributeStart,C._textureId),this.packQuadIndex(m,C._indexStart,C._attributeStart/this.vertexSize)):(this.packAttributes(C,f,p,C._attributeStart,C._textureId),this.packIndex(C,m,C._indexStart,C._attributeStart/this.vertexSize))}r.count>0&&(this._finishBatch(i,x,g-x,r,l,c,t,v,S),x=g,++em),this.elementStart=this.elementSize,this._batchIndexStart=x,this._batchIndexSize=g}_finishBatch(t,n,i,r,s,l,c,f,p){t.gpuBindGroup=null,t.bindGroup=null,t.action=f,t.batcher=this,t.textures=r,t.blendMode=s,t.topology=l,t.start=n,t.size=i,t.elements=p,++em,this.batches[this.batchIndex++]=t,c.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){t*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(t*4)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){const n=Math.max(t,this.attributeBuffer.size*2),i=new nw(n);iw(this.attributeBuffer.rawBinaryData,i.rawBinaryData),this.attributeBuffer=i}_resizeIndexBuffer(t){const n=this.indexBuffer;let i=Math.max(t,n.length*1.5);i+=i%2;const r=i>65535?new Uint32Array(i):new Uint16Array(i);if(r.BYTES_PER_ELEMENT!==n.BYTES_PER_ELEMENT)for(let s=0;s<n.length;s++)r[s]=n[s];else iw(n.buffer,r.buffer);this.indexBuffer=r}packQuadIndex(t,n,i){t[n]=i+0,t[n+1]=i+1,t[n+2]=i+2,t[n+3]=i+0,t[n+4]=i+2,t[n+5]=i+3}packIndex(t,n,i,r){const s=t.indices,l=t.indexSize,c=t.indexOffset,f=t.attributeOffset;for(let p=0;p<l;p++)n[i++]=r+s[p+c]-f}destroy(t={}){var n;if(this.batches!==null){for(let i=0;i<this.batchIndex;i++)sw(this.batches[i]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,t.shader&&((n=this.shader)==null||n.destroy(),this.shader=null);for(let i=0;i<this._elements.length;i++)this._elements[i]&&(this._elements[i]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};eM.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let k5=eM;var ka=(e=>(e[e.MAP_READ=1]="MAP_READ",e[e.MAP_WRITE=2]="MAP_WRITE",e[e.COPY_SRC=4]="COPY_SRC",e[e.COPY_DST=8]="COPY_DST",e[e.INDEX=16]="INDEX",e[e.VERTEX=32]="VERTEX",e[e.UNIFORM=64]="UNIFORM",e[e.STORAGE=128]="STORAGE",e[e.INDIRECT=256]="INDIRECT",e[e.QUERY_RESOLVE=512]="QUERY_RESOLVE",e[e.STATIC=1024]="STATIC",e))(ka||{});class Bm extends yo{constructor(t){let{data:n,size:i}=t;const{usage:r,label:s,shrinkToFit:l}=t;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=bi("buffer"),this._resourceType="buffer",this._resourceId=bi("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,n instanceof Array&&(n=new Float32Array(n)),this._data=n,i??(i=n==null?void 0:n.byteLength);const c=!!n;this.descriptor={size:i,usage:r,mappedAtCreation:c,label:s},this.shrinkToFit=l??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&ka.STATIC)}set static(t){t?this.descriptor.usage|=ka.STATIC:this.descriptor.usage&=~ka.STATIC}setDataWithSize(t,n,i){if(this._updateID++,this._updateSize=n*t.BYTES_PER_ELEMENT,this._data===t){i&&this.emit("update",this);return}const r=this._data;if(this._data=t,this._dataInt32=null,!r||r.length!==t.length){!this.shrinkToFit&&r&&t.byteLength<r.byteLength?i&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=bi("resource"),this.emit("change",this));return}i&&this.emit("update",this)}update(t){this._updateSize=t??this._updateSize,this._updateID++,this.emit("update",this)}unload(){var t;this.emit("unload",this);for(const n in this._gpuData)(t=this._gpuData[n])==null||t.destroy();this._gpuData=Object.create(null)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}function nM(e,t){if(!(e instanceof Bm)){let n=t?ka.INDEX:ka.VERTEX;e instanceof Array&&(t?(e=new Uint32Array(e),n=ka.INDEX|ka.COPY_DST):(e=new Float32Array(e),n=ka.VERTEX|ka.COPY_DST)),e=new Bm({data:e,label:t?"index-mesh-buffer":"vertex-mesh-buffer",usage:n})}return e}function N5(e,t,n){const i=e.getAttribute(t);if(!i)return n.minX=0,n.minY=0,n.maxX=0,n.maxY=0,n;const r=i.buffer.data;let s=1/0,l=1/0,c=-1/0,f=-1/0;const p=r.BYTES_PER_ELEMENT,m=(i.offset||0)/p,g=(i.stride||8)/p;for(let x=m;x<r.length;x+=g){const v=r[x],S=r[x+1];v>c&&(c=v),S>f&&(f=S),v<s&&(s=v),S<l&&(l=S)}return n.minX=s,n.minY=l,n.maxX=c,n.maxY=f,n}function O5(e){return(e instanceof Bm||Array.isArray(e)||e.BYTES_PER_ELEMENT)&&(e={buffer:e}),e.buffer=nM(e.buffer,!1),e}class D5 extends yo{constructor(t={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=bi("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new js,this._boundsDirty=!0;const{attributes:n,indexBuffer:i,topology:r}=t;if(this.buffers=[],this.attributes={},n)for(const s in n)this.addAttribute(s,n[s]);this.instanceCount=t.instanceCount??1,i&&this.addIndex(i),this.topology=r||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(t){return this.attributes[t]}getIndex(){return this.indexBuffer}getBuffer(t){return this.getAttribute(t).buffer}getSize(){for(const t in this.attributes){const n=this.attributes[t];return n.buffer.data.length/(n.stride/4||n.size)}return 0}addAttribute(t,n){const i=O5(n);this.buffers.indexOf(i.buffer)===-1&&(this.buffers.push(i.buffer),i.buffer.on("update",this.onBufferUpdate,this),i.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=i}addIndex(t){this.indexBuffer=nM(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,N5(this,"aPosition",this._bounds)):this._bounds}unload(){var t;this.emit("unload",this);for(const n in this._gpuData)(t=this._gpuData[n])==null||t.destroy();this._gpuData=Object.create(null)}destroy(t=!1){var n;this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach(i=>i.destroy()),this.unload(),(n=this.indexBuffer)==null||n.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const z5=new Float32Array(1),B5=new Uint32Array(1);class L5 extends D5{constructor(){const n=new Bm({data:z5,label:"attribute-batch-buffer",usage:ka.VERTEX|ka.COPY_DST,shrinkToFit:!1}),i=new Bm({data:B5,label:"index-batch-buffer",usage:ka.INDEX|ka.COPY_DST,shrinkToFit:!1}),r=24;super({attributes:{aPosition:{buffer:n,format:"float32x2",stride:r,offset:0},aUV:{buffer:n,format:"float32x2",stride:r,offset:8},aColor:{buffer:n,format:"unorm8x4",stride:r,offset:16},aTextureIdAndRound:{buffer:n,format:"uint16x2",stride:r,offset:20}},indexBuffer:i})}}function lw(e,t,n){if(e)for(const i in e){const r=i.toLocaleLowerCase(),s=t[r];if(s){let l=e[i];i==="header"&&(l=l.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),n&&s.push(`//----${n}----//`),s.push(l)}else ma(`${i} placement hook does not exist in shader`)}}const j5=/\{\{(.*?)\}\}/g;function ow(e){var i;const t={};return(((i=e.match(j5))==null?void 0:i.map(r=>r.replace(/[{()}]/g,"")))??[]).forEach(r=>{t[r]=[]}),t}function cw(e,t){let n;const i=/@in\s+([^;]+);/g;for(;(n=i.exec(e))!==null;)t.push(n[1])}function uw(e,t,n=!1){const i=[];cw(t,i),e.forEach(c=>{c.header&&cw(c.header,i)});const r=i;n&&r.sort();const s=r.map((c,f)=>` @location(${f}) ${c},`).join(`
85
- `);let l=t.replace(/@in\s+[^;]+;\s*/g,"");return l=l.replace("{{in}}",`
86
- ${s}
87
- `),l}function dw(e,t){let n;const i=/@out\s+([^;]+);/g;for(;(n=i.exec(e))!==null;)t.push(n[1])}function I5(e){const n=/\b(\w+)\s*:/g.exec(e);return n?n[1]:""}function U5(e){const t=/@.*?\s+/g;return e.replace(t,"")}function H5(e,t){const n=[];dw(t,n),e.forEach(f=>{f.header&&dw(f.header,n)});let i=0;const r=n.sort().map(f=>f.indexOf("builtin")>-1?f:`@location(${i++}) ${f}`).join(`,
88
- `),s=n.sort().map(f=>` var ${U5(f)};`).join(`
89
- `),l=`return VSOutput(
90
- ${n.sort().map(f=>` ${I5(f)}`).join(`,
91
- `)});`;let c=t.replace(/@out\s+[^;]+;\s*/g,"");return c=c.replace("{{struct}}",`
92
- ${r}
93
- `),c=c.replace("{{start}}",`
94
- ${s}
95
- `),c=c.replace("{{return}}",`
96
- ${l}
97
- `),c}function fw(e,t){let n=e;for(const i in t){const r=t[i];r.join(`
98
- `).length?n=n.replace(`{{${i}}}`,`//-----${i} START-----//
99
- ${r.join(`
100
- `)}
101
- //----${i} FINISH----//`):n=n.replace(`{{${i}}}`,"")}return n}const lu=Object.create(null),Ub=new Map;let P5=0;function F5({template:e,bits:t}){const n=iM(e,t);if(lu[n])return lu[n];const{vertex:i,fragment:r}=q5(e,t);return lu[n]=rM(i,r,t),lu[n]}function G5({template:e,bits:t}){const n=iM(e,t);return lu[n]||(lu[n]=rM(e.vertex,e.fragment,t)),lu[n]}function q5(e,t){const n=t.map(l=>l.vertex).filter(l=>!!l),i=t.map(l=>l.fragment).filter(l=>!!l);let r=uw(n,e.vertex,!0);r=H5(n,r);const s=uw(i,e.fragment,!0);return{vertex:r,fragment:s}}function iM(e,t){return t.map(n=>(Ub.has(n)||Ub.set(n,P5++),Ub.get(n))).sort((n,i)=>n-i).join("-")+e.vertex+e.fragment}function rM(e,t,n){const i=ow(e),r=ow(t);return n.forEach(s=>{lw(s.vertex,i,s.name),lw(s.fragment,r,s.name)}),{vertex:fw(e,i),fragment:fw(t,r)}}const Y5=`
102
- @in aPosition: vec2<f32>;
103
- @in aUV: vec2<f32>;
104
-
105
- @out @builtin(position) vPosition: vec4<f32>;
106
- @out vUV : vec2<f32>;
107
- @out vColor : vec4<f32>;
108
-
109
- {{header}}
110
-
111
- struct VSOutput {
112
- {{struct}}
113
- };
114
-
115
- @vertex
116
- fn main( {{in}} ) -> VSOutput {
117
-
118
- var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;
119
- var modelMatrix = mat3x3<f32>(
120
- 1.0, 0.0, 0.0,
121
- 0.0, 1.0, 0.0,
122
- 0.0, 0.0, 1.0
123
- );
124
- var position = aPosition;
125
- var uv = aUV;
126
-
127
- {{start}}
128
-
129
- vColor = vec4<f32>(1., 1., 1., 1.);
130
-
131
- {{main}}
132
-
133
- vUV = uv;
134
-
135
- var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;
136
-
137
- vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);
138
-
139
- vColor *= globalUniforms.uWorldColorAlpha;
140
-
141
- {{end}}
142
-
143
- {{return}}
144
- };
145
- `,V5=`
146
- @in vUV : vec2<f32>;
147
- @in vColor : vec4<f32>;
148
-
149
- {{header}}
150
-
151
- @fragment
152
- fn main(
153
- {{in}}
154
- ) -> @location(0) vec4<f32> {
155
-
156
- {{start}}
157
-
158
- var outColor:vec4<f32>;
159
-
160
- {{main}}
161
-
162
- var finalColor:vec4<f32> = outColor * vColor;
163
-
164
- {{end}}
165
-
166
- return finalColor;
167
- };
168
- `,X5=`
169
- in vec2 aPosition;
170
- in vec2 aUV;
171
-
172
- out vec4 vColor;
173
- out vec2 vUV;
174
-
175
- {{header}}
176
-
177
- void main(void){
178
-
179
- mat3 worldTransformMatrix = uWorldTransformMatrix;
180
- mat3 modelMatrix = mat3(
181
- 1.0, 0.0, 0.0,
182
- 0.0, 1.0, 0.0,
183
- 0.0, 0.0, 1.0
184
- );
185
- vec2 position = aPosition;
186
- vec2 uv = aUV;
187
-
188
- {{start}}
189
-
190
- vColor = vec4(1.);
191
-
192
- {{main}}
193
-
194
- vUV = uv;
195
-
196
- mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;
197
-
198
- gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
199
-
200
- vColor *= uWorldColorAlpha;
201
-
202
- {{end}}
203
- }
204
- `,K5=`
205
-
206
- in vec4 vColor;
207
- in vec2 vUV;
208
-
209
- out vec4 finalColor;
210
-
211
- {{header}}
212
-
213
- void main(void) {
214
-
215
- {{start}}
216
-
217
- vec4 outColor;
218
-
219
- {{main}}
220
-
221
- finalColor = outColor * vColor;
222
-
223
- {{end}}
224
- }
225
- `,$5={name:"global-uniforms-bit",vertex:{header:`
226
- struct GlobalUniforms {
227
- uProjectionMatrix:mat3x3<f32>,
228
- uWorldTransformMatrix:mat3x3<f32>,
229
- uWorldColorAlpha: vec4<f32>,
230
- uResolution: vec2<f32>,
231
- }
232
-
233
- @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
234
- `}},W5={name:"global-uniforms-bit",vertex:{header:`
235
- uniform mat3 uProjectionMatrix;
236
- uniform mat3 uWorldTransformMatrix;
237
- uniform vec4 uWorldColorAlpha;
238
- uniform vec2 uResolution;
239
- `}};function Q5({bits:e,name:t}){const n=F5({template:{fragment:V5,vertex:Y5},bits:[$5,...e]});return Zm.from({name:t,vertex:{source:n.vertex,entryPoint:"main"},fragment:{source:n.fragment,entryPoint:"main"}})}function Z5({bits:e,name:t}){return new r_({name:t,...G5({template:{vertex:X5,fragment:K5},bits:[W5,...e]})})}const J5={name:"color-bit",vertex:{header:`
240
- @in aColor: vec4<f32>;
241
- `,main:`
242
- vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
243
- `}},e6={name:"color-bit",vertex:{header:`
244
- in vec4 aColor;
245
- `,main:`
246
- vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
247
- `}},Hb={};function t6(e){const t=[];if(e===1)t.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),t.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let n=0;for(let i=0;i<e;i++)t.push(`@group(1) @binding(${n++}) var textureSource${i+1}: texture_2d<f32>;`),t.push(`@group(1) @binding(${n++}) var textureSampler${i+1}: sampler;`)}return t.join(`
248
- `)}function n6(e){const t=[];if(e===1)t.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{t.push("switch vTextureId {");for(let n=0;n<e;n++)n===e-1?t.push(" default:{"):t.push(` case ${n}:{`),t.push(` outColor = textureSampleGrad(textureSource${n+1}, textureSampler${n+1}, vUV, uvDx, uvDy);`),t.push(" break;}");t.push("}")}return t.join(`
249
- `)}function i6(e){return Hb[e]||(Hb[e]={name:"texture-batch-bit",vertex:{header:`
250
- @in aTextureIdAndRound: vec2<u32>;
251
- @out @interpolate(flat) vTextureId : u32;
252
- `,main:`
253
- vTextureId = aTextureIdAndRound.y;
254
- `,end:`
255
- if(aTextureIdAndRound.x == 1)
256
- {
257
- vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
258
- }
259
- `},fragment:{header:`
260
- @in @interpolate(flat) vTextureId: u32;
261
-
262
- ${t6(e)}
263
- `,main:`
264
- var uvDx = dpdx(vUV);
265
- var uvDy = dpdy(vUV);
266
-
267
- ${n6(e)}
268
- `}}),Hb[e]}const Pb={};function r6(e){const t=[];for(let n=0;n<e;n++)n>0&&t.push("else"),n<e-1&&t.push(`if(vTextureId < ${n}.5)`),t.push("{"),t.push(` outColor = texture(uTextures[${n}], vUV);`),t.push("}");return t.join(`
269
- `)}function a6(e){return Pb[e]||(Pb[e]={name:"texture-batch-bit",vertex:{header:`
270
- in vec2 aTextureIdAndRound;
271
- out float vTextureId;
272
-
273
- `,main:`
274
- vTextureId = aTextureIdAndRound.y;
275
- `,end:`
276
- if(aTextureIdAndRound.x == 1.)
277
- {
278
- gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
279
- }
280
- `},fragment:{header:`
281
- in float vTextureId;
282
-
283
- uniform sampler2D uTextures[${e}];
284
-
285
- `,main:`
286
-
287
- ${r6(e)}
288
- `}}),Pb[e]}const s6={name:"round-pixels-bit",vertex:{header:`
289
- fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
290
- {
291
- return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
292
- }
293
- `}},l6={name:"round-pixels-bit",vertex:{header:`
294
- vec2 roundPixels(vec2 position, vec2 targetSize)
295
- {
296
- return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
297
- }
298
- `}},hw={};function o6(e){let t=hw[e];if(t)return t;const n=new Int32Array(e);for(let i=0;i<e;i++)n[i]=i;return t=hw[e]=new jA({uTextures:{value:n,type:"i32",size:e}},{isStatic:!0}),t}class pw extends nx{constructor(t){const n=Z5({name:"batch",bits:[e6,a6(t),l6]}),i=Q5({name:"batch",bits:[J5,i6(t),s6]});super({glProgram:n,gpuProgram:i,resources:{batchSamplers:o6(t)}}),this.maxTextures=t}}let tm=null;const aM=class sM extends k5{constructor(t){super(t),this.geometry=new L5,this.name=sM.extension.name,this.vertexSize=6,tm??(tm=new pw(t.maxTextures)),this.shader=tm}packAttributes(t,n,i,r,s){const l=s<<16|t.roundPixels&65535,c=t.transform,f=c.a,p=c.b,m=c.c,g=c.d,x=c.tx,v=c.ty,{positions:S,uvs:A}=t,T=t.color,C=t.attributeOffset,N=C+t.attributeSize;for(let R=C;R<N;R++){const O=R*2,H=S[O],D=S[O+1];n[r++]=f*H+m*D+x,n[r++]=g*D+p*H+v,n[r++]=A[O],n[r++]=A[O+1],i[r++]=T,i[r++]=l}}packQuadAttributes(t,n,i,r,s){const l=t.texture,c=t.transform,f=c.a,p=c.b,m=c.c,g=c.d,x=c.tx,v=c.ty,S=t.bounds,A=S.maxX,T=S.minX,C=S.maxY,N=S.minY,R=l.uvs,O=t.color,H=s<<16|t.roundPixels&65535;n[r+0]=f*T+m*N+x,n[r+1]=g*N+p*T+v,n[r+2]=R.x0,n[r+3]=R.y0,i[r+4]=O,i[r+5]=H,n[r+6]=f*A+m*N+x,n[r+7]=g*N+p*A+v,n[r+8]=R.x1,n[r+9]=R.y1,i[r+10]=O,i[r+11]=H,n[r+12]=f*A+m*C+x,n[r+13]=g*C+p*A+v,n[r+14]=R.x2,n[r+15]=R.y2,i[r+16]=O,i[r+17]=H,n[r+18]=f*T+m*C+x,n[r+19]=g*C+p*T+v,n[r+20]=R.x3,n[r+21]=R.y3,i[r+22]=O,i[r+23]=H}_updateMaxTextures(t){this.shader.maxTextures!==t&&(tm=new pw(t),this.shader=tm)}destroy(){this.shader=null,super.destroy()}};aM.extension={type:[kt.Batcher],name:"default"};let c6=aM;class Jm{constructor(t){this.items=Object.create(null);const{renderer:n,type:i,onUnload:r,priority:s,name:l}=t;this._renderer=n,n.gc.addResourceHash(this,"items",i,s??0),this._onUnload=r,this.name=l}add(t){return this.items[t.uid]?!1:(this.items[t.uid]=t,t.once("unload",this.remove,this),t._gcLastUsed=this._renderer.gc.now,!0)}remove(t,...n){var r;if(!this.items[t.uid])return;const i=t._gpuData[this._renderer.uid];i&&((r=this._onUnload)==null||r.call(this,t,...n),i.destroy(),t._gpuData[this._renderer.uid]=null,this.items[t.uid]=null)}removeAll(...t){Object.values(this.items).forEach(n=>n&&this.remove(n,...t))}destroy(...t){this.removeAll(...t),this.items=Object.create(null),this._renderer=null,this._onUnload=null}}function u6(e,t,n,i,r,s,l,c=null){let f=0;n*=t,r*=s;const p=c.a,m=c.b,g=c.c,x=c.d,v=c.tx,S=c.ty;for(;f<l;){const A=e[n],T=e[n+1];i[r]=p*A+g*T+v,i[r+1]=m*A+x*T+S,r+=s,n+=t,f++}}function d6(e,t,n,i){let r=0;for(t*=n;r<i;)e[t]=0,e[t+1]=0,t+=n,r++}function lM(e,t,n,i,r){const s=t.a,l=t.b,c=t.c,f=t.d,p=t.tx,m=t.ty;n||(n=0),i||(i=2),r||(r=e.length/i-n);let g=n*i;for(let x=0;x<r;x++){const v=e[g],S=e[g+1];e[g]=s*v+c*S+p,e[g+1]=l*v+f*S+m,g+=i}}const f6=new Ht;class u_{constructor(){this.packAsQuad=!1,this.batcherName="default",this.topology="triangle-list",this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){const t=this.baseColor,n=t>>16|t&65280|(t&255)<<16,i=this.renderable;return i?hA(n,i.groupColor)+(this.alpha*i.groupAlpha*255<<24):n+(this.alpha*255<<24)}get transform(){var t;return((t=this.renderable)==null?void 0:t.groupTransform)||f6}copyTo(t){t.indexOffset=this.indexOffset,t.indexSize=this.indexSize,t.attributeOffset=this.attributeOffset,t.attributeSize=this.attributeSize,t.baseColor=this.baseColor,t.alpha=this.alpha,t.texture=this.texture,t.geometryData=this.geometryData,t.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}}const Lm={extension:{type:kt.ShapeBuilder,name:"circle"},build(e,t){let n,i,r,s,l,c;if(e.type==="circle"){const O=e;if(l=c=O.radius,l<=0)return!1;n=O.x,i=O.y,r=s=0}else if(e.type==="ellipse"){const O=e;if(l=O.halfWidth,c=O.halfHeight,l<=0||c<=0)return!1;n=O.x,i=O.y,r=s=0}else{const O=e,H=O.width/2,D=O.height/2;n=O.x+H,i=O.y+D,l=c=Math.max(0,Math.min(O.radius,Math.min(H,D))),r=H-l,s=D-c}if(r<0||s<0)return!1;const f=Math.ceil(2.3*Math.sqrt(l+c)),p=f*8+(r?4:0)+(s?4:0);if(p===0)return!1;if(f===0)return t[0]=t[6]=n+r,t[1]=t[3]=i+s,t[2]=t[4]=n-r,t[5]=t[7]=i-s,!0;let m=0,g=f*4+(r?2:0)+2,x=g,v=p,S=r+l,A=s,T=n+S,C=n-S,N=i+A;if(t[m++]=T,t[m++]=N,t[--g]=N,t[--g]=C,s){const O=i-A;t[x++]=C,t[x++]=O,t[--v]=O,t[--v]=T}for(let O=1;O<f;O++){const H=Math.PI/2*(O/f),D=r+Math.cos(H)*l,q=s+Math.sin(H)*c,Z=n+D,V=n-D,Y=i+q,F=i-q;t[m++]=Z,t[m++]=Y,t[--g]=Y,t[--g]=V,t[x++]=V,t[x++]=F,t[--v]=F,t[--v]=Z}S=r,A=s+c,T=n+S,C=n-S,N=i+A;const R=i-A;return t[m++]=T,t[m++]=N,t[--v]=R,t[--v]=T,r&&(t[m++]=C,t[m++]=N,t[--v]=R,t[--v]=C),!0},triangulate(e,t,n,i,r,s){if(e.length===0)return;let l=0,c=0;for(let m=0;m<e.length;m+=2)l+=e[m],c+=e[m+1];l/=e.length/2,c/=e.length/2;let f=i;t[f*n]=l,t[f*n+1]=c;const p=f++;for(let m=0;m<e.length;m+=2)t[f*n]=e[m],t[f*n+1]=e[m+1],m>0&&(r[s++]=f,r[s++]=p,r[s++]=f-1),f++;r[s++]=p+1,r[s++]=p,r[s++]=f-1}},h6={...Lm,extension:{...Lm.extension,name:"ellipse"}},p6={...Lm,extension:{...Lm.extension,name:"roundedRectangle"}},oM=1e-4,mw=1e-4;function m6(e){const t=e.length;if(t<6)return 1;let n=0;for(let i=0,r=e[t-2],s=e[t-1];i<t;i+=2){const l=e[i],c=e[i+1];n+=(l-r)*(c+s),r=l,s=c}return n<0?-1:1}function gw(e,t,n,i,r,s,l,c){const f=e-n*r,p=t-i*r,m=e+n*s,g=t+i*s;let x,v;l?(x=i,v=-n):(x=-i,v=n);const S=f+x,A=p+v,T=m+x,C=g+v;return c.push(S,A),c.push(T,C),2}function rd(e,t,n,i,r,s,l,c){const f=n-e,p=i-t;let m=Math.atan2(f,p),g=Math.atan2(r-e,s-t);c&&m<g?m+=Math.PI*2:!c&&m>g&&(g+=Math.PI*2);let x=m;const v=g-m,S=Math.abs(v),A=Math.sqrt(f*f+p*p),T=(15*S*Math.sqrt(A)/Math.PI>>0)+1,C=v/T;if(x+=C,c){l.push(e,t),l.push(n,i);for(let N=1,R=x;N<T;N++,R+=C)l.push(e,t),l.push(e+Math.sin(R)*A,t+Math.cos(R)*A);l.push(e,t),l.push(r,s)}else{l.push(n,i),l.push(e,t);for(let N=1,R=x;N<T;N++,R+=C)l.push(e+Math.sin(R)*A,t+Math.cos(R)*A),l.push(e,t);l.push(r,s),l.push(e,t)}return T*2}function g6(e,t,n,i,r,s){const l=oM;if(e.length===0)return;const c=t;let f=c.alignment;if(t.alignment!==.5){let Q=m6(e);f=(f-.5)*Q+.5}const p=new Lr(e[0],e[1]),m=new Lr(e[e.length-2],e[e.length-1]),g=i,x=Math.abs(p.x-m.x)<l&&Math.abs(p.y-m.y)<l;if(g){e=e.slice(),x&&(e.pop(),e.pop(),m.set(e[e.length-2],e[e.length-1]));const Q=(p.x+m.x)*.5,I=(m.y+p.y)*.5;e.unshift(Q,I),e.push(Q,I)}const v=r,S=e.length/2;let A=e.length;const T=v.length/2,C=c.width/2,N=C*C,R=c.miterLimit*c.miterLimit;let O=e[0],H=e[1],D=e[2],q=e[3],Z=0,V=0,Y=-(H-q),F=O-D,j=0,ee=0,P=Math.sqrt(Y*Y+F*F);Y/=P,F/=P,Y*=C,F*=C;const W=f,z=(1-W)*2,K=W*2;g||(c.cap==="round"?A+=rd(O-Y*(z-K)*.5,H-F*(z-K)*.5,O-Y*z,H-F*z,O+Y*K,H+F*K,v,!0)+2:c.cap==="square"&&(A+=gw(O,H,Y,F,z,K,!0,v))),v.push(O-Y*z,H-F*z),v.push(O+Y*K,H+F*K);for(let Q=1;Q<S-1;++Q){O=e[(Q-1)*2],H=e[(Q-1)*2+1],D=e[Q*2],q=e[Q*2+1],Z=e[(Q+1)*2],V=e[(Q+1)*2+1],Y=-(H-q),F=O-D,P=Math.sqrt(Y*Y+F*F),Y/=P,F/=P,Y*=C,F*=C,j=-(q-V),ee=D-Z,P=Math.sqrt(j*j+ee*ee),j/=P,ee/=P,j*=C,ee*=C;const I=D-O,$=H-q,ne=D-Z,X=V-q,ce=I*ne+$*X,ie=$*ne-X*I,de=ie<0;if(Math.abs(ie)<.001*Math.abs(ce)){v.push(D-Y*z,q-F*z),v.push(D+Y*K,q+F*K),ce>=0&&(c.join==="round"?A+=rd(D,q,D-Y*z,q-F*z,D-j*z,q-ee*z,v,!1)+4:A+=2,v.push(D-j*K,q-ee*K),v.push(D+j*z,q+ee*z));continue}const xe=(-Y+O)*(-F+q)-(-Y+D)*(-F+H),me=(-j+Z)*(-ee+q)-(-j+D)*(-ee+V),le=(I*me-ne*xe)/ie,Re=(X*xe-$*me)/ie,je=(le-D)*(le-D)+(Re-q)*(Re-q),Ie=D+(le-D)*z,He=q+(Re-q)*z,Qe=D-(le-D)*K,ot=q-(Re-q)*K,Ue=Math.min(I*I+$*$,ne*ne+X*X),wt=de?z:K,_n=Ue+wt*wt*N;je<=_n?c.join==="bevel"||je/N>R?(de?(v.push(Ie,He),v.push(D+Y*K,q+F*K),v.push(Ie,He),v.push(D+j*K,q+ee*K)):(v.push(D-Y*z,q-F*z),v.push(Qe,ot),v.push(D-j*z,q-ee*z),v.push(Qe,ot)),A+=2):c.join==="round"?de?(v.push(Ie,He),v.push(D+Y*K,q+F*K),A+=rd(D,q,D+Y*K,q+F*K,D+j*K,q+ee*K,v,!0)+4,v.push(Ie,He),v.push(D+j*K,q+ee*K)):(v.push(D-Y*z,q-F*z),v.push(Qe,ot),A+=rd(D,q,D-Y*z,q-F*z,D-j*z,q-ee*z,v,!1)+4,v.push(D-j*z,q-ee*z),v.push(Qe,ot)):(v.push(Ie,He),v.push(Qe,ot)):(v.push(D-Y*z,q-F*z),v.push(D+Y*K,q+F*K),c.join==="round"?de?A+=rd(D,q,D+Y*K,q+F*K,D+j*K,q+ee*K,v,!0)+2:A+=rd(D,q,D-Y*z,q-F*z,D-j*z,q-ee*z,v,!1)+2:c.join==="miter"&&je/N<=R&&(de?(v.push(Qe,ot),v.push(Qe,ot)):(v.push(Ie,He),v.push(Ie,He)),A+=2),v.push(D-j*z,q-ee*z),v.push(D+j*K,q+ee*K),A+=2)}O=e[(S-2)*2],H=e[(S-2)*2+1],D=e[(S-1)*2],q=e[(S-1)*2+1],Y=-(H-q),F=O-D,P=Math.sqrt(Y*Y+F*F),Y/=P,F/=P,Y*=C,F*=C,v.push(D-Y*z,q-F*z),v.push(D+Y*K,q+F*K),g||(c.cap==="round"?A+=rd(D-Y*(z-K)*.5,q-F*(z-K)*.5,D-Y*z,q-F*z,D+Y*K,q+F*K,v,!1)+2:c.cap==="square"&&(A+=gw(D,q,Y,F,z,K,!1,v)));const G=mw*mw;for(let Q=T;Q<A+T-2;++Q)O=v[Q*2],H=v[Q*2+1],D=v[(Q+1)*2],q=v[(Q+1)*2+1],Z=v[(Q+2)*2],V=v[(Q+2)*2+1],!(Math.abs(O*(q-V)+D*(V-H)+Z*(H-q))<G)&&s.push(Q,Q+1,Q+2)}function y6(e,t,n,i){const r=oM;if(e.length===0)return;const s=e[0],l=e[1],c=e[e.length-2],f=e[e.length-1],p=t||Math.abs(s-c)<r&&Math.abs(l-f)<r,m=n,g=e.length/2,x=m.length/2;for(let v=0;v<g;v++)m.push(e[v*2]),m.push(e[v*2+1]);for(let v=0;v<g-1;v++)i.push(x+v,x+v+1);p&&i.push(x+g-1,x)}function cM(e,t,n,i,r,s,l){const c=s5(e,t,2);if(!c)return;for(let p=0;p<c.length;p+=3)s[l++]=c[p]+r,s[l++]=c[p+1]+r,s[l++]=c[p+2]+r;let f=r*i;for(let p=0;p<e.length;p+=2)n[f]=e[p],n[f+1]=e[p+1],f+=i}const x6=[],b6={extension:{type:kt.ShapeBuilder,name:"polygon"},build(e,t){for(let n=0;n<e.points.length;n++)t[n]=e.points[n];return!0},triangulate(e,t,n,i,r,s){cM(e,x6,t,n,i,r,s)}},v6={extension:{type:kt.ShapeBuilder,name:"rectangle"},build(e,t){const n=e,i=n.x,r=n.y,s=n.width,l=n.height;return s>0&&l>0?(t[0]=i,t[1]=r,t[2]=i+s,t[3]=r,t[4]=i+s,t[5]=r+l,t[6]=i,t[7]=r+l,!0):!1},triangulate(e,t,n,i,r,s){let l=0;i*=n,t[i+l]=e[0],t[i+l+1]=e[1],l+=n,t[i+l]=e[2],t[i+l+1]=e[3],l+=n,t[i+l]=e[6],t[i+l+1]=e[7],l+=n,t[i+l]=e[4],t[i+l+1]=e[5],l+=n;const c=i/n;r[s++]=c,r[s++]=c+1,r[s++]=c+2,r[s++]=c+1,r[s++]=c+3,r[s++]=c+2}},_6={extension:{type:kt.ShapeBuilder,name:"triangle"},build(e,t){return t[0]=e.x,t[1]=e.y,t[2]=e.x2,t[3]=e.y2,t[4]=e.x3,t[5]=e.y3,!0},triangulate(e,t,n,i,r,s){let l=0;i*=n,t[i+l]=e[0],t[i+l+1]=e[1],l+=n,t[i+l]=e[2],t[i+l+1]=e[3],l+=n,t[i+l]=e[4],t[i+l+1]=e[5];const c=i/n;r[s++]=c,r[s++]=c+1,r[s++]=c+2}},yw=[{offset:0,color:"white"},{offset:1,color:"black"}],d_=class s1{constructor(...t){this.uid=bi("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let n=S6(t);n={...n.type==="radial"?s1.defaultRadialOptions:s1.defaultLinearOptions,...nA(n)},this._textureSize=n.textureSize,this._wrapMode=n.wrapMode,n.type==="radial"?(this.center=n.center,this.outerCenter=n.outerCenter??this.center,this.innerRadius=n.innerRadius,this.outerRadius=n.outerRadius,this.scale=n.scale,this.rotation=n.rotation):(this.start=n.start,this.end=n.end),this.textureSpace=n.textureSpace,this.type=n.type,n.colorStops.forEach(r=>{this.addColorStop(r.offset,r.color)})}addColorStop(t,n){return this.colorStops.push({offset:t,color:qi.shared.setValue(n).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:n}=this.start,{x:i,y:r}=this.end,s=i-t,l=r-n;const c=s<0||l<0;if(this._wrapMode==="clamp-to-edge"){if(s<0){const T=t;t=i,i=T,s*=-1}if(l<0){const T=n;n=r,r=T,l*=-1}}const f=this.colorStops.length?this.colorStops:yw,p=this._textureSize,{canvas:m,context:g}=bw(p,1),x=c?g.createLinearGradient(this._textureSize,0,0,0):g.createLinearGradient(0,0,this._textureSize,0);xw(x,f),g.fillStyle=x,g.fillRect(0,0,p,1),this.texture=new Mn({source:new A0({resource:m,addressMode:this._wrapMode})});const v=Math.sqrt(s*s+l*l),S=Math.atan2(l,s),A=new Ht;A.scale(v/p,1),A.rotate(S),A.translate(t,n),this.textureSpace==="local"&&A.scale(p,p),this.transform=A}buildGradient(){this.texture||this._tick++,this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const t=this.colorStops.length?this.colorStops:yw,n=this._textureSize,{canvas:i,context:r}=bw(n,n),{x:s,y:l}=this.center,{x:c,y:f}=this.outerCenter,p=this.innerRadius,m=this.outerRadius,g=c-m,x=f-m,v=n/(m*2),S=(s-g)*v,A=(l-x)*v,T=r.createRadialGradient(S,A,p*v,(c-g)*v,(f-x)*v,m*v);xw(T,t),r.fillStyle=t[t.length-1].color,r.fillRect(0,0,n,n),r.fillStyle=T,r.translate(S,A),r.rotate(this.rotation),r.scale(1,this.scale),r.translate(-S,-A),r.fillRect(0,0,n,n),this.texture=new Mn({source:new A0({resource:i,addressMode:this._wrapMode})});const C=new Ht;C.scale(1/v,1/v),C.translate(g,x),this.textureSpace==="local"&&C.scale(n,n),this.transform=C}destroy(){var t;(t=this.texture)==null||t.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};d_.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};d_.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let lc=d_;function xw(e,t){for(let n=0;n<t.length;n++){const i=t[n];e.addColorStop(i.offset,i.color)}}function bw(e,t){const n=is.get().createCanvas(e,t),i=n.getContext("2d");return{canvas:n,context:i}}function S6(e){let t=e[0]??{};return(typeof t=="number"||e[1])&&(en("8.5.2","use options object instead"),t={type:"linear",start:{x:e[0],y:e[1]},end:{x:e[2],y:e[3]},textureSpace:e[4],textureSize:e[5]??lc.defaultLinearOptions.textureSize}),t}const E6=new Ht,w6=new Ti;function T6(e,t,n,i){const r=t.matrix?e.copyFrom(t.matrix).invert():e.identity();if(t.textureSpace==="local"){const l=n.getBounds(w6);t.width&&l.pad(t.width);const{x:c,y:f}=l,p=1/l.width,m=1/l.height,g=-c*p,x=-f*m,v=r.a,S=r.b,A=r.c,T=r.d;r.a*=p,r.b*=p,r.c*=m,r.d*=m,r.tx=g*v+x*A+r.tx,r.ty=g*S+x*T+r.ty}else r.translate(t.texture.frame.x,t.texture.frame.y),r.scale(1/t.texture.source.width,1/t.texture.source.height);const s=t.texture.source.style;return!(t.fill instanceof lc)&&s.addressMode==="clamp-to-edge"&&(s.addressMode="repeat",s.update()),i&&r.append(E6.copyFrom(i).invert()),r}const ix={};li.handleByMap(kt.ShapeBuilder,ix);li.add(v6,b6,_6,Lm,h6,p6);const C6=new Ti,A6=new Ht;function M6(e,t){const{geometryData:n,batches:i}=t;i.length=0,n.indices.length=0,n.vertices.length=0,n.uvs.length=0;for(let r=0;r<e.instructions.length;r++){const s=e.instructions[r];if(s.action==="texture")R6(s.data,i,n);else if(s.action==="fill"||s.action==="stroke"){const l=s.action==="stroke",c=s.data.path.shapePath,f=s.data.style,p=s.data.hole;l&&p&&vw(p.shapePath,f,!0,i,n),p&&(c.shapePrimitives[c.shapePrimitives.length-1].holes=p.shapePath.shapePrimitives),vw(c,f,l,i,n)}}}function R6(e,t,n){const i=[],r=ix.rectangle,s=C6;s.x=e.dx,s.y=e.dy,s.width=e.dw,s.height=e.dh;const l=e.transform;if(!r.build(s,i))return;const{vertices:c,uvs:f,indices:p}=n,m=p.length,g=c.length/2;l&&lM(i,l),r.triangulate(i,c,2,g,p,m);const x=e.image,v=x.uvs;f.push(v.x0,v.y0,v.x1,v.y1,v.x3,v.y3,v.x2,v.y2);const S=Da.get(u_);S.indexOffset=m,S.indexSize=p.length-m,S.attributeOffset=g,S.attributeSize=c.length/2-g,S.baseColor=e.style,S.alpha=e.alpha,S.texture=x,S.geometryData=n,t.push(S)}function vw(e,t,n,i,r){const{vertices:s,uvs:l,indices:c}=r;e.shapePrimitives.forEach(({shape:f,transform:p,holes:m})=>{const g=[],x=ix[f.type];if(!x.build(f,g))return;const v=c.length,S=s.length/2;let A="triangle-list";if(p&&lM(g,p),n){const R=f.closePath??!0,O=t;O.pixelLine?(y6(g,R,s,c),A="line-list"):g6(g,O,!1,R,s,c)}else if(m){const R=[],O=g.slice();k6(m).forEach(D=>{R.push(O.length/2),O.push(...D)}),cM(O,R,s,2,S,c,v)}else x.triangulate(g,s,2,S,c,v);const T=l.length/2,C=t.texture;if(C!==Mn.WHITE){const R=T6(A6,t,f,p);u6(s,2,S,l,T,2,s.length/2-S,R)}else d6(l,T,2,s.length/2-S);const N=Da.get(u_);N.indexOffset=v,N.indexSize=c.length-v,N.attributeOffset=S,N.attributeSize=s.length/2-S,N.baseColor=t.color,N.alpha=t.alpha,N.texture=C,N.geometryData=r,N.topology=A,i.push(N)})}function k6(e){const t=[];for(let n=0;n<e.length;n++){const i=e[n].shape,r=[];ix[i.type].build(i,r)&&t.push(r)}return t}class N6{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(t=>{Da.return(t)}),this.graphicsData&&Da.return(this.graphicsData),this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null}destroy(){this.reset(),this.batches=null,this.geometryData=null}}class O6{constructor(){this.instructions=new t_}init(t){const n=t.maxTextures;this.batcher?this.batcher._updateMaxTextures(n):this.batcher=new c6({maxTextures:n}),this.instructions.reset()}get geometry(){return en(MD,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}}const f_=class l1{constructor(t){this._renderer=t,this._managedContexts=new Jm({renderer:t,type:"resource",name:"graphicsContext"})}init(t){l1.defaultOptions.bezierSmoothness=(t==null?void 0:t.bezierSmoothness)??l1.defaultOptions.bezierSmoothness}getContextRenderData(t){return t._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const n=!!t._gpuData[this._renderer.uid],i=t._gpuData[this._renderer.uid]||this._initContext(t);if(t.dirty||!n){n&&i.reset(),M6(t,i);const r=t.batchMode;t.customShader||r==="no-batch"?i.isBatchable=!1:r==="auto"?i.isBatchable=i.geometryData.vertices.length<400:i.isBatchable=!0,t.dirty=!1}return i}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const n=Da.get(O6,{maxTextures:this._renderer.limits.maxBatchableTextures}),i=t._gpuData[this._renderer.uid],{batches:r,geometryData:s}=i;i.graphicsData=n;const l=s.vertices.length,c=s.indices.length;for(let g=0;g<r.length;g++)r[g].applyTransform=!1;const f=n.batcher;f.ensureAttributeBuffer(l),f.ensureIndexBuffer(c),f.begin();for(let g=0;g<r.length;g++){const x=r[g];f.add(x)}f.finish(n.instructions);const p=f.geometry;p.indexBuffer.setDataWithSize(f.indexBuffer,f.indexSize,!0),p.buffers[0].setDataWithSize(f.attributeBuffer.float32View,f.attributeSize,!0);const m=f.batches;for(let g=0;g<m.length;g++){const x=m[g];x.bindGroup=v5(x.textures.textures,x.textures.count,this._renderer.limits.maxBatchableTextures)}return n}_initContext(t){const n=new N6;return n.context=t,t._gpuData[this._renderer.uid]=n,this._managedContexts.add(t),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};f_.extension={type:[kt.WebGLSystem,kt.WebGPUSystem],name:"graphicsContext"};f_.defaultOptions={bezierSmoothness:.5};let h_=f_;const D6=8,Fy=11920929e-14,z6=1;function uM(e,t,n,i,r,s,l,c,f,p){const g=Math.min(.99,Math.max(0,p??h_.defaultOptions.bezierSmoothness));let x=(z6-g)/1;return x*=x,B6(t,n,i,r,s,l,c,f,e,x),e}function B6(e,t,n,i,r,s,l,c,f,p){o1(e,t,n,i,r,s,l,c,f,p,0),f.push(l,c)}function o1(e,t,n,i,r,s,l,c,f,p,m){if(m>D6)return;const g=(e+n)/2,x=(t+i)/2,v=(n+r)/2,S=(i+s)/2,A=(r+l)/2,T=(s+c)/2,C=(g+v)/2,N=(x+S)/2,R=(v+A)/2,O=(S+T)/2,H=(C+R)/2,D=(N+O)/2;if(m>0){let q=l-e,Z=c-t;const V=Math.abs((n-l)*Z-(i-c)*q),Y=Math.abs((r-l)*Z-(s-c)*q);if(V>Fy&&Y>Fy){if((V+Y)*(V+Y)<=p*(q*q+Z*Z)){f.push(H,D);return}}else if(V>Fy){if(V*V<=p*(q*q+Z*Z)){f.push(H,D);return}}else if(Y>Fy){if(Y*Y<=p*(q*q+Z*Z)){f.push(H,D);return}}else if(q=H-(e+l)/2,Z=D-(t+c)/2,q*q+Z*Z<=p){f.push(H,D);return}}o1(e,t,g,x,C,N,H,D,f,p,m+1),o1(H,D,R,O,A,T,l,c,f,p,m+1)}const L6=8,j6=11920929e-14,I6=1;function U6(e,t,n,i,r,s,l,c){const p=Math.min(.99,Math.max(0,c??h_.defaultOptions.bezierSmoothness));let m=(I6-p)/1;return m*=m,H6(t,n,i,r,s,l,e,m),e}function H6(e,t,n,i,r,s,l,c){c1(l,e,t,n,i,r,s,c,0),l.push(r,s)}function c1(e,t,n,i,r,s,l,c,f){if(f>L6)return;const p=(t+i)/2,m=(n+r)/2,g=(i+s)/2,x=(r+l)/2,v=(p+g)/2,S=(m+x)/2;let A=s-t,T=l-n;const C=Math.abs((i-s)*T-(r-l)*A);if(C>j6){if(C*C<=c*(A*A+T*T)){e.push(v,S);return}}else if(A=v-(t+s)/2,T=S-(n+l)/2,A*A+T*T<=c){e.push(v,S);return}c1(e,t,n,p,m,v,S,c,f+1),c1(e,v,S,g,x,s,l,c,f+1)}function dM(e,t,n,i,r,s,l,c){let f=Math.abs(r-s);(!l&&r>s||l&&s>r)&&(f=2*Math.PI-f),c||(c=Math.max(6,Math.floor(6*Math.pow(i,1/3)*(f/Math.PI)))),c=Math.max(c,3);let p=f/c,m=r;p*=l?-1:1;for(let g=0;g<c+1;g++){const x=Math.cos(m),v=Math.sin(m),S=t+x*i,A=n+v*i;e.push(S,A),m+=p}}function P6(e,t,n,i,r,s){const l=e[e.length-2],f=e[e.length-1]-n,p=l-t,m=r-n,g=i-t,x=Math.abs(f*g-p*m);if(x<1e-8||s===0){(e[e.length-2]!==t||e[e.length-1]!==n)&&e.push(t,n);return}const v=f*f+p*p,S=m*m+g*g,A=f*m+p*g,T=s*Math.sqrt(v)/x,C=s*Math.sqrt(S)/x,N=T*A/v,R=C*A/S,O=T*g+C*p,H=T*m+C*f,D=p*(C+N),q=f*(C+N),Z=g*(T+R),V=m*(T+R),Y=Math.atan2(q-H,D-O),F=Math.atan2(V-H,Z-O);dM(e,O+t,H+n,s,Y,F,p*m>g*f)}const wm=Math.PI*2,Fb={centerX:0,centerY:0,ang1:0,ang2:0},Gb=({x:e,y:t},n,i,r,s,l,c,f)=>{e*=n,t*=i;const p=r*e-s*t,m=s*e+r*t;return f.x=p+l,f.y=m+c,f};function F6(e,t){const n=t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),i=t===1.5707963267948966?.551915024494:n,r=Math.cos(e),s=Math.sin(e),l=Math.cos(e+t),c=Math.sin(e+t);return[{x:r-s*i,y:s+r*i},{x:l+c*i,y:c-l*i},{x:l,y:c}]}const _w=(e,t,n,i)=>{const r=e*i-t*n<0?-1:1;let s=e*n+t*i;return s>1&&(s=1),s<-1&&(s=-1),r*Math.acos(s)},G6=(e,t,n,i,r,s,l,c,f,p,m,g,x)=>{const v=Math.pow(r,2),S=Math.pow(s,2),A=Math.pow(m,2),T=Math.pow(g,2);let C=v*S-v*T-S*A;C<0&&(C=0),C/=v*T+S*A,C=Math.sqrt(C)*(l===c?-1:1);const N=C*r/s*g,R=C*-s/r*m,O=p*N-f*R+(e+n)/2,H=f*N+p*R+(t+i)/2,D=(m-N)/r,q=(g-R)/s,Z=(-m-N)/r,V=(-g-R)/s,Y=_w(1,0,D,q);let F=_w(D,q,Z,V);c===0&&F>0&&(F-=wm),c===1&&F<0&&(F+=wm),x.centerX=O,x.centerY=H,x.ang1=Y,x.ang2=F};function q6(e,t,n,i,r,s,l,c=0,f=0,p=0){if(s===0||l===0)return;const m=Math.sin(c*wm/360),g=Math.cos(c*wm/360),x=g*(t-i)/2+m*(n-r)/2,v=-m*(t-i)/2+g*(n-r)/2;if(x===0&&v===0)return;s=Math.abs(s),l=Math.abs(l);const S=Math.pow(x,2)/Math.pow(s,2)+Math.pow(v,2)/Math.pow(l,2);S>1&&(s*=Math.sqrt(S),l*=Math.sqrt(S)),G6(t,n,i,r,s,l,f,p,m,g,x,v,Fb);let{ang1:A,ang2:T}=Fb;const{centerX:C,centerY:N}=Fb;let R=Math.abs(T)/(wm/4);Math.abs(1-R)<1e-7&&(R=1);const O=Math.max(Math.ceil(R),1);T/=O;let H=e[e.length-2],D=e[e.length-1];const q={x:0,y:0};for(let Z=0;Z<O;Z++){const V=F6(A,T),{x:Y,y:F}=Gb(V[0],s,l,g,m,C,N,q),{x:j,y:ee}=Gb(V[1],s,l,g,m,C,N,q),{x:P,y:W}=Gb(V[2],s,l,g,m,C,N,q);uM(e,H,D,Y,F,j,ee,P,W),H=P,D=W,A+=T}}function Y6(e,t,n){const i=(l,c)=>{const f=c.x-l.x,p=c.y-l.y,m=Math.sqrt(f*f+p*p),g=f/m,x=p/m;return{len:m,nx:g,ny:x}},r=(l,c)=>{l===0?e.moveTo(c.x,c.y):e.lineTo(c.x,c.y)};let s=t[t.length-1];for(let l=0;l<t.length;l++){const c=t[l%t.length],f=c.radius??n;if(f<=0){r(l,c),s=c;continue}const p=t[(l+1)%t.length],m=i(c,s),g=i(c,p);if(m.len<1e-4||g.len<1e-4){r(l,c),s=c;continue}let x=Math.asin(m.nx*g.ny-m.ny*g.nx),v=1,S=!1;m.nx*g.nx-m.ny*-g.ny<0?x<0?x=Math.PI+x:(x=Math.PI-x,v=-1,S=!0):x>0&&(v=-1,S=!0);const A=x/2;let T,C=Math.abs(Math.cos(A)*f/Math.sin(A));C>Math.min(m.len/2,g.len/2)?(C=Math.min(m.len/2,g.len/2),T=Math.abs(C*Math.sin(A)/Math.cos(A))):T=f;const N=c.x+g.nx*C+-g.ny*T*v,R=c.y+g.ny*C+g.nx*T*v,O=Math.atan2(m.ny,m.nx)+Math.PI/2*v,H=Math.atan2(g.ny,g.nx)-Math.PI/2*v;l===0&&e.moveTo(N+Math.cos(O)*T,R+Math.sin(O)*T),e.arc(N,R,T,O,H,S),s=c}}function V6(e,t,n,i){const r=(c,f)=>Math.sqrt((c.x-f.x)**2+(c.y-f.y)**2),s=(c,f,p)=>({x:c.x+(f.x-c.x)*p,y:c.y+(f.y-c.y)*p}),l=t.length;for(let c=0;c<l;c++){const f=t[(c+1)%l],p=f.radius??n;if(p<=0){c===0?e.moveTo(f.x,f.y):e.lineTo(f.x,f.y);continue}const m=t[c],g=t[(c+2)%l],x=r(m,f);let v;if(x<1e-4)v=f;else{const T=Math.min(x/2,p);v=s(f,m,T/x)}const S=r(g,f);let A;if(S<1e-4)A=f;else{const T=Math.min(S/2,p);A=s(f,g,T/S)}c===0?e.moveTo(v.x,v.y):e.lineTo(v.x,v.y),e.quadraticCurveTo(f.x,f.y,A.x,A.y,i)}}const X6=new Ti;class K6{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new js,this._graphicsPath2D=t,this.signed=t.checkForHoles}moveTo(t,n){return this.startPoly(t,n),this}lineTo(t,n){this._ensurePoly();const i=this._currentPoly.points,r=i[i.length-2],s=i[i.length-1];return(r!==t||s!==n)&&i.push(t,n),this}arc(t,n,i,r,s,l){this._ensurePoly(!1);const c=this._currentPoly.points;return dM(c,t,n,i,r,s,l),this}arcTo(t,n,i,r,s){this._ensurePoly();const l=this._currentPoly.points;return P6(l,t,n,i,r,s),this}arcToSvg(t,n,i,r,s,l,c){const f=this._currentPoly.points;return q6(f,this._currentPoly.lastX,this._currentPoly.lastY,l,c,t,n,i,r,s),this}bezierCurveTo(t,n,i,r,s,l,c){this._ensurePoly();const f=this._currentPoly;return uM(this._currentPoly.points,f.lastX,f.lastY,t,n,i,r,s,l,c),this}quadraticCurveTo(t,n,i,r,s){this._ensurePoly();const l=this._currentPoly;return U6(this._currentPoly.points,l.lastX,l.lastY,t,n,i,r,s),this}closePath(){return this.endPoly(!0),this}addPath(t,n){this.endPoly(),n&&!n.isIdentity()&&(t=t.clone(!0),t.transform(n));const i=this.shapePrimitives,r=i.length;for(let s=0;s<t.instructions.length;s++){const l=t.instructions[s];this[l.action](...l.data)}if(t.checkForHoles&&i.length-r>1){let s=null;for(let l=r;l<i.length;l++){const c=i[l];if(c.shape.type==="polygon"){const f=c.shape,p=s==null?void 0:s.shape;p&&p.containsPolygon(f)?(s.holes||(s.holes=[]),s.holes.push(c),i.copyWithin(l,l+1),i.length--,l--):s=c}}}return this}finish(t=!1){this.endPoly(t)}rect(t,n,i,r,s){return this.drawShape(new Ti(t,n,i,r),s),this}circle(t,n,i,r){return this.drawShape(new l_(t,n,i),r),this}poly(t,n,i){const r=new Sm(t);return r.closePath=n,this.drawShape(r,i),this}regularPoly(t,n,i,r,s=0,l){r=Math.max(r|0,3);const c=-1*Math.PI/2+s,f=Math.PI*2/r,p=[];for(let m=0;m<r;m++){const g=c-m*f;p.push(t+i*Math.cos(g),n+i*Math.sin(g))}return this.poly(p,!0,l),this}roundPoly(t,n,i,r,s,l=0,c){if(r=Math.max(r|0,3),s<=0)return this.regularPoly(t,n,i,r,l);const f=i*Math.sin(Math.PI/r)-.001;s=Math.min(s,f);const p=-1*Math.PI/2+l,m=Math.PI*2/r,g=(r-2)*Math.PI/r/2;for(let x=0;x<r;x++){const v=x*m+p,S=t+i*Math.cos(v),A=n+i*Math.sin(v),T=v+Math.PI+g,C=v-Math.PI-g,N=S+s*Math.cos(T),R=A+s*Math.sin(T),O=S+s*Math.cos(C),H=A+s*Math.sin(C);x===0?this.moveTo(N,R):this.lineTo(N,R),this.quadraticCurveTo(S,A,O,H,c)}return this.closePath()}roundShape(t,n,i=!1,r){return t.length<3?this:(i?V6(this,t,n,r):Y6(this,t,n),this.closePath())}filletRect(t,n,i,r,s){if(s===0)return this.rect(t,n,i,r);const l=Math.min(i,r)/2,c=Math.min(l,Math.max(-l,s)),f=t+i,p=n+r,m=c<0?-c:0,g=Math.abs(c);return this.moveTo(t,n+g).arcTo(t+m,n+m,t+g,n,g).lineTo(f-g,n).arcTo(f-m,n+m,f,n+g,g).lineTo(f,p-g).arcTo(f-m,p-m,t+i-g,p,g).lineTo(t+g,p).arcTo(t+m,p-m,t,p-g,g).closePath()}chamferRect(t,n,i,r,s,l){if(s<=0)return this.rect(t,n,i,r);const c=Math.min(s,Math.min(i,r)/2),f=t+i,p=n+r,m=[t+c,n,f-c,n,f,n+c,f,p-c,f-c,p,t+c,p,t,p-c,t,n+c];for(let g=m.length-1;g>=2;g-=2)m[g]===m[g-2]&&m[g-1]===m[g-3]&&m.splice(g-1,2);return this.poly(m,!0,l)}ellipse(t,n,i,r,s){return this.drawShape(new o_(t,n,i,r),s),this}roundRect(t,n,i,r,s,l){return this.drawShape(new c_(t,n,i,r,s),l),this}drawShape(t,n){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:n}),this}startPoly(t,n){let i=this._currentPoly;return i&&this.endPoly(),i=new Sm,i.points.push(t,n),this._currentPoly=i,this}endPoly(t=!1){const n=this._currentPoly;return n&&n.points.length>2&&(n.closePath=t,this.shapePrimitives.push({shape:n})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new Sm,t)){const n=this.shapePrimitives[this.shapePrimitives.length-1];if(n){let i=n.shape.x,r=n.shape.y;if(n.transform&&!n.transform.isIdentity()){const s=n.transform,l=i;i=s.a*i+s.c*r+s.tx,r=s.b*l+s.d*r+s.ty}this._currentPoly.points.push(i,r)}else this._currentPoly.points.push(0,0)}}buildPath(){const t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let n=0;n<t.instructions.length;n++){const i=t.instructions[n];this[i.action](...i.data)}this.finish()}get bounds(){const t=this._bounds;t.clear();const n=this.shapePrimitives;for(let i=0;i<n.length;i++){const r=n[i],s=r.shape.getBounds(X6);r.transform?t.addRect(s,r.transform):t.addRect(s)}return t}}class ac{constructor(t,n=!1){this.instructions=[],this.uid=bi("graphicsPath"),this._dirty=!0,this.checkForHoles=n,typeof t=="string"?g5(t,this):this.instructions=(t==null?void 0:t.slice())??[]}get shapePath(){return this._shapePath||(this._shapePath=new K6(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(t,n){return t=t.clone(),this.instructions.push({action:"addPath",data:[t,n]}),this._dirty=!0,this}arc(...t){return this.instructions.push({action:"arc",data:t}),this._dirty=!0,this}arcTo(...t){return this.instructions.push({action:"arcTo",data:t}),this._dirty=!0,this}arcToSvg(...t){return this.instructions.push({action:"arcToSvg",data:t}),this._dirty=!0,this}bezierCurveTo(...t){return this.instructions.push({action:"bezierCurveTo",data:t}),this._dirty=!0,this}bezierCurveToShort(t,n,i,r,s){const l=this.instructions[this.instructions.length-1],c=this.getLastPoint(Lr.shared);let f=0,p=0;if(!l||l.action!=="bezierCurveTo")f=c.x,p=c.y;else{f=l.data[2],p=l.data[3];const m=c.x,g=c.y;f=m+(m-f),p=g+(g-p)}return this.instructions.push({action:"bezierCurveTo",data:[f,p,t,n,i,r,s]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...t){return this.instructions.push({action:"ellipse",data:t}),this._dirty=!0,this}lineTo(...t){return this.instructions.push({action:"lineTo",data:t}),this._dirty=!0,this}moveTo(...t){return this.instructions.push({action:"moveTo",data:t}),this}quadraticCurveTo(...t){return this.instructions.push({action:"quadraticCurveTo",data:t}),this._dirty=!0,this}quadraticCurveToShort(t,n,i){const r=this.instructions[this.instructions.length-1],s=this.getLastPoint(Lr.shared);let l=0,c=0;if(!r||r.action!=="quadraticCurveTo")l=s.x,c=s.y;else{l=r.data[0],c=r.data[1];const f=s.x,p=s.y;l=f+(f-l),c=p+(p-c)}return this.instructions.push({action:"quadraticCurveTo",data:[l,c,t,n,i]}),this._dirty=!0,this}rect(t,n,i,r,s){return this.instructions.push({action:"rect",data:[t,n,i,r,s]}),this._dirty=!0,this}circle(t,n,i,r){return this.instructions.push({action:"circle",data:[t,n,i,r]}),this._dirty=!0,this}roundRect(...t){return this.instructions.push({action:"roundRect",data:t}),this._dirty=!0,this}poly(...t){return this.instructions.push({action:"poly",data:t}),this._dirty=!0,this}regularPoly(...t){return this.instructions.push({action:"regularPoly",data:t}),this._dirty=!0,this}roundPoly(...t){return this.instructions.push({action:"roundPoly",data:t}),this._dirty=!0,this}roundShape(...t){return this.instructions.push({action:"roundShape",data:t}),this._dirty=!0,this}filletRect(...t){return this.instructions.push({action:"filletRect",data:t}),this._dirty=!0,this}chamferRect(...t){return this.instructions.push({action:"chamferRect",data:t}),this._dirty=!0,this}star(t,n,i,r,s,l,c){s||(s=r/2);const f=-1*Math.PI/2+l,p=i*2,m=Math.PI*2/p,g=[];for(let x=0;x<p;x++){const v=x%2?s:r,S=x*m+f;g.push(t+v*Math.cos(S),n+v*Math.sin(S))}return this.poly(g,!0,c),this}clone(t=!1){const n=new ac;if(n.checkForHoles=this.checkForHoles,!t)n.instructions=this.instructions.slice();else for(let i=0;i<this.instructions.length;i++){const r=this.instructions[i];n.instructions.push({action:r.action,data:r.data.slice()})}return n}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(t){if(t.isIdentity())return this;const n=t.a,i=t.b,r=t.c,s=t.d,l=t.tx,c=t.ty;let f=0,p=0,m=0,g=0,x=0,v=0,S=0,A=0;for(let T=0;T<this.instructions.length;T++){const C=this.instructions[T],N=C.data;switch(C.action){case"moveTo":case"lineTo":f=N[0],p=N[1],N[0]=n*f+r*p+l,N[1]=i*f+s*p+c;break;case"bezierCurveTo":m=N[0],g=N[1],x=N[2],v=N[3],f=N[4],p=N[5],N[0]=n*m+r*g+l,N[1]=i*m+s*g+c,N[2]=n*x+r*v+l,N[3]=i*x+s*v+c,N[4]=n*f+r*p+l,N[5]=i*f+s*p+c;break;case"quadraticCurveTo":m=N[0],g=N[1],f=N[2],p=N[3],N[0]=n*m+r*g+l,N[1]=i*m+s*g+c,N[2]=n*f+r*p+l,N[3]=i*f+s*p+c;break;case"arcToSvg":f=N[5],p=N[6],S=N[0],A=N[1],N[0]=n*S+r*A,N[1]=i*S+s*A,N[5]=n*f+r*p+l,N[6]=i*f+s*p+c;break;case"circle":N[4]=nm(N[3],t);break;case"rect":N[4]=nm(N[4],t);break;case"ellipse":N[8]=nm(N[8],t);break;case"roundRect":N[5]=nm(N[5],t);break;case"addPath":N[0].transform(t);break;case"poly":N[2]=nm(N[2],t);break;default:ma("unknown transform action",C.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(t){let n=this.instructions.length-1,i=this.instructions[n];if(!i)return t.x=0,t.y=0,t;for(;i.action==="closePath";){if(n--,n<0)return t.x=0,t.y=0,t;i=this.instructions[n]}switch(i.action){case"moveTo":case"lineTo":t.x=i.data[0],t.y=i.data[1];break;case"quadraticCurveTo":t.x=i.data[2],t.y=i.data[3];break;case"bezierCurveTo":t.x=i.data[4],t.y=i.data[5];break;case"arc":case"arcToSvg":t.x=i.data[5],t.y=i.data[6];break;case"addPath":i.data[0].getLastPoint(t);break}return t}}function nm(e,t){return e?e.prepend(t):t.clone()}function yi(e,t,n){const i=e.getAttribute(t);return i?Number(i):n}function $6(e,t){const n=e.querySelectorAll("defs");for(let i=0;i<n.length;i++){const r=n[i];for(let s=0;s<r.children.length;s++){const l=r.children[s];switch(l.nodeName.toLowerCase()){case"lineargradient":t.defs[l.id]=W6(l);break;case"radialgradient":t.defs[l.id]=Q6();break}}}}function W6(e){const t=yi(e,"x1",0),n=yi(e,"y1",0),i=yi(e,"x2",1),r=yi(e,"y2",0),s=e.getAttribute("gradientUnits")||"objectBoundingBox",l=new lc(t,n,i,r,s==="objectBoundingBox"?"local":"global");for(let c=0;c<e.children.length;c++){const f=e.children[c],p=yi(f,"offset",0),m=qi.shared.setValue(f.getAttribute("stop-color")).toNumber();l.addColorStop(p,m)}return l}function Q6(e){return ma("[SVG Parser] Radial gradients are not yet supported"),new lc(0,0,1,0)}function Sw(e){const t=e.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return t?t[1]:""}const Ew={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}};function fM(e,t){const n=e.getAttribute("style"),i={},r={},s={strokeStyle:i,fillStyle:r,useFill:!1,useStroke:!1};for(const l in Ew){const c=e.getAttribute(l);c&&ww(t,s,l,c.trim())}if(n){const l=n.split(";");for(let c=0;c<l.length;c++){const f=l[c].trim(),[p,m]=f.split(":");Ew[p]&&ww(t,s,p,m.trim())}}return{strokeStyle:s.useStroke?i:null,fillStyle:s.useFill?r:null,useFill:s.useFill,useStroke:s.useStroke}}function ww(e,t,n,i){switch(n){case"stroke":if(i!=="none"){if(i.startsWith("url(")){const r=Sw(i);t.strokeStyle.fill=e.defs[r]}else t.strokeStyle.color=qi.shared.setValue(i).toNumber();t.useStroke=!0}break;case"stroke-width":t.strokeStyle.width=Number(i);break;case"fill":if(i!=="none"){if(i.startsWith("url(")){const r=Sw(i);t.fillStyle.fill=e.defs[r]}else t.fillStyle.color=qi.shared.setValue(i).toNumber();t.useFill=!0}break;case"fill-opacity":t.fillStyle.alpha=Number(i);break;case"stroke-opacity":t.strokeStyle.alpha=Number(i);break;case"opacity":t.fillStyle.alpha=Number(i),t.strokeStyle.alpha=Number(i);break}}function Z6(e){if(e.length<=2)return!0;const t=e.map(c=>c.area).sort((c,f)=>f-c),[n,i]=t,r=t[t.length-1],s=n/i,l=i/r;return!(s>3&&l<2)}function J6(e){return e.split(/(?=[Mm])/).filter(i=>i.trim().length>0)}function eB(e){const t=e.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!t||t.length<4)return 0;const n=t.map(Number),i=[],r=[];for(let m=0;m<n.length;m+=2)m+1<n.length&&(i.push(n[m]),r.push(n[m+1]));if(i.length===0||r.length===0)return 0;const s=Math.min(...i),l=Math.max(...i),c=Math.min(...r),f=Math.max(...r);return(l-s)*(f-c)}function Tw(e,t){const n=new ac(e,!1);for(const i of n.instructions)t.instructions.push(i)}function tB(e,t){if(typeof e=="string"){const l=document.createElement("div");l.innerHTML=e.trim(),e=l.querySelector("svg")}const n={context:t,defs:{},path:new ac};$6(e,n);const i=e.children,{fillStyle:r,strokeStyle:s}=fM(e,n);for(let l=0;l<i.length;l++){const c=i[l];c.nodeName.toLowerCase()!=="defs"&&hM(c,n,r,s)}return t}function hM(e,t,n,i){const r=e.children,{fillStyle:s,strokeStyle:l}=fM(e,t);s&&n?n={...n,...s}:s&&(n=s),l&&i?i={...i,...l}:l&&(i=l);const c=!n&&!i;c&&(n={color:0});let f,p,m,g,x,v,S,A,T,C,N,R,O,H,D,q,Z;switch(e.nodeName.toLowerCase()){case"path":{H=e.getAttribute("d");const V=e.getAttribute("fill-rule"),Y=J6(H),F=V==="evenodd",j=Y.length>1;if(F&&j){const P=Y.map(z=>({path:z,area:eB(z)}));if(P.sort((z,K)=>K.area-z.area),Y.length>3||!Z6(P))for(let z=0;z<P.length;z++){const K=P[z],G=z===0;t.context.beginPath();const Q=new ac(void 0,!0);Tw(K.path,Q),t.context.path(Q),G?(n&&t.context.fill(n),i&&t.context.stroke(i)):t.context.cut()}else for(let z=0;z<P.length;z++){const K=P[z],G=z%2===1;t.context.beginPath();const Q=new ac(void 0,!0);Tw(K.path,Q),t.context.path(Q),G?t.context.cut():(n&&t.context.fill(n),i&&t.context.stroke(i))}}else{const P=V?V==="evenodd":!0;D=new ac(H,P),t.context.path(D),n&&t.context.fill(n),i&&t.context.stroke(i)}break}case"circle":S=yi(e,"cx",0),A=yi(e,"cy",0),T=yi(e,"r",0),t.context.ellipse(S,A,T,T),n&&t.context.fill(n),i&&t.context.stroke(i);break;case"rect":f=yi(e,"x",0),p=yi(e,"y",0),q=yi(e,"width",0),Z=yi(e,"height",0),C=yi(e,"rx",0),N=yi(e,"ry",0),C||N?t.context.roundRect(f,p,q,Z,C||N):t.context.rect(f,p,q,Z),n&&t.context.fill(n),i&&t.context.stroke(i);break;case"ellipse":S=yi(e,"cx",0),A=yi(e,"cy",0),C=yi(e,"rx",0),N=yi(e,"ry",0),t.context.beginPath(),t.context.ellipse(S,A,C,N),n&&t.context.fill(n),i&&t.context.stroke(i);break;case"line":m=yi(e,"x1",0),g=yi(e,"y1",0),x=yi(e,"x2",0),v=yi(e,"y2",0),t.context.beginPath(),t.context.moveTo(m,g),t.context.lineTo(x,v),i&&t.context.stroke(i);break;case"polygon":O=e.getAttribute("points"),R=O.match(/-?\d+/g).map(V=>parseInt(V,10)),t.context.poly(R,!0),n&&t.context.fill(n),i&&t.context.stroke(i);break;case"polyline":O=e.getAttribute("points"),R=O.match(/-?\d+/g).map(V=>parseInt(V,10)),t.context.poly(R,!1),i&&t.context.stroke(i);break;case"g":case"svg":break;default:{ma(`[SVG parser] <${e.nodeName}> elements unsupported`);break}}c&&(n=null);for(let V=0;V<r.length;V++)hM(r[V],t,n,i)}const Cw={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};class rx{constructor(t,n){this.uid=bi("fillPattern"),this._tick=0,this.transform=new Ht,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),n&&(t.source.style.addressModeU=Cw[n].addressModeU,t.source.style.addressModeV=Cw[n].addressModeV)}setTransform(t){const n=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/n.frame.width,1/n.frame.height),this._tick++}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture=t,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}}function nB(e){return qi.isColorLike(e)}function Aw(e){return e instanceof rx}function Mw(e){return e instanceof lc}function iB(e){return e instanceof Mn}function rB(e,t,n){const i=qi.shared.setValue(t??0);return e.color=i.toNumber(),e.alpha=i.alpha===1?n.alpha:i.alpha,e.texture=Mn.WHITE,{...n,...e}}function aB(e,t,n){return e.texture=t,{...n,...e}}function Rw(e,t,n){return e.fill=t,e.color=16777215,e.texture=t.texture,e.matrix=t.transform,{...n,...e}}function kw(e,t,n){return t.buildGradient(),e.fill=t,e.color=16777215,e.texture=t.texture,e.matrix=t.transform,e.textureSpace=t.textureSpace,{...n,...e}}function sB(e,t){const n={...t,...e},i=qi.shared.setValue(n.color);return n.alpha*=i.alpha,n.color=i.toNumber(),n}function gd(e,t){if(e==null)return null;const n={},i=e;return nB(e)?rB(n,e,t):iB(e)?aB(n,e,t):Aw(e)?Rw(n,e,t):Mw(e)?kw(n,e,t):i.fill&&Aw(i.fill)?Rw(i,i.fill,t):i.fill&&Mw(i.fill)?kw(i,i.fill,t):sB(i,t)}function k0(e,t){const{width:n,alignment:i,miterLimit:r,cap:s,join:l,pixelLine:c,...f}=t,p=gd(e,f);return p?{width:n,alignment:i,miterLimit:r,cap:s,join:l,pixelLine:c,...p}:null}function lB(e,t){let n=1;const i=e.shapePath.shapePrimitives;for(let r=0;r<i.length;r++){const s=i[r].shape;if(s.type!=="polygon")continue;const l=s.points,c=l.length;if(c<6)continue;const f=s.closePath;for(let p=0;p<c;p+=2){if(!f&&(p===0||p===c-2))continue;const m=(p-2+c)%c,g=(p+2)%c,x=l[m],v=l[m+1],S=l[p],A=l[p+1],T=l[g],C=l[g+1],N=x-S,R=v-A,O=T-S,H=C-A,D=N*N+R*R,q=O*O+H*H;if(D<1e-12||q<1e-12)continue;let Y=(N*O+R*H)/Math.sqrt(D*q);Y<-1?Y=-1:Y>1&&(Y=1);const F=Math.sqrt((1-Y)*.5);if(F<1e-6)continue;const j=Math.min(1/F,t);j>n&&(n=j)}}return n}const oB=new Lr,Nw=new Ht,p_=class co extends yo{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=bi("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new ac,this._transform=new Ht,this._fillStyle={...co.defaultFillStyle},this._strokeStyle={...co.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new js,this._boundsDirty=!0}clone(){const t=new co;return t.batchMode=this.batchMode,t.instructions=this.instructions.slice(),t._activePath=this._activePath.clone(),t._transform=this._transform.clone(),t._fillStyle={...this._fillStyle},t._strokeStyle={...this._strokeStyle},t._stateStack=this._stateStack.slice(),t._bounds=this._bounds.clone(),t._boundsDirty=!0,t}get fillStyle(){return this._fillStyle}set fillStyle(t){this._fillStyle=gd(t,co.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=k0(t,co.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=gd(t,co.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=gd(t,co.defaultStrokeStyle),this}texture(t,n,i,r,s,l){return this.instructions.push({action:"texture",data:{image:t,dx:i||0,dy:r||0,dw:s||t.frame.width,dh:l||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:n||n===0?qi.shared.setValue(n).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new ac,this}fill(t,n){let i;const r=this.instructions[this.instructions.length-1];return this._tick===0&&(r==null?void 0:r.action)==="stroke"?i=r.data.path:i=this._activePath.clone(),i?(t!=null&&(n!==void 0&&typeof t=="number"&&(en(xi,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),t={color:t,alpha:n}),this._fillStyle=gd(t,co.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:i}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:t,y:n}=this._activePath.getLastPoint(Lr.shared);this._activePath.clear(),this._activePath.moveTo(t,n)}stroke(t){let n;const i=this.instructions[this.instructions.length-1];return this._tick===0&&(i==null?void 0:i.action)==="fill"?n=i.data.path:n=this._activePath.clone(),n?(t!=null&&(this._strokeStyle=k0(t,co.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:n}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let t=0;t<2;t++){const n=this.instructions[this.instructions.length-1-t],i=this._activePath.clone();if(n&&(n.action==="stroke"||n.action==="fill"))if(n.data.hole)n.data.hole.addPath(i);else{n.data.hole=i;break}}return this._initNextPathLocation(),this}arc(t,n,i,r,s,l){this._tick++;const c=this._transform;return this._activePath.arc(c.a*t+c.c*n+c.tx,c.b*t+c.d*n+c.ty,i,r,s,l),this}arcTo(t,n,i,r,s){this._tick++;const l=this._transform;return this._activePath.arcTo(l.a*t+l.c*n+l.tx,l.b*t+l.d*n+l.ty,l.a*i+l.c*r+l.tx,l.b*i+l.d*r+l.ty,s),this}arcToSvg(t,n,i,r,s,l,c){this._tick++;const f=this._transform;return this._activePath.arcToSvg(t,n,i,r,s,f.a*l+f.c*c+f.tx,f.b*l+f.d*c+f.ty),this}bezierCurveTo(t,n,i,r,s,l,c){this._tick++;const f=this._transform;return this._activePath.bezierCurveTo(f.a*t+f.c*n+f.tx,f.b*t+f.d*n+f.ty,f.a*i+f.c*r+f.tx,f.b*i+f.d*r+f.ty,f.a*s+f.c*l+f.tx,f.b*s+f.d*l+f.ty,c),this}closePath(){var t;return this._tick++,(t=this._activePath)==null||t.closePath(),this}ellipse(t,n,i,r){return this._tick++,this._activePath.ellipse(t,n,i,r,this._transform.clone()),this}circle(t,n,i){return this._tick++,this._activePath.circle(t,n,i,this._transform.clone()),this}path(t){return this._tick++,this._activePath.addPath(t,this._transform.clone()),this}lineTo(t,n){this._tick++;const i=this._transform;return this._activePath.lineTo(i.a*t+i.c*n+i.tx,i.b*t+i.d*n+i.ty),this}moveTo(t,n){this._tick++;const i=this._transform,r=this._activePath.instructions,s=i.a*t+i.c*n+i.tx,l=i.b*t+i.d*n+i.ty;return r.length===1&&r[0].action==="moveTo"?(r[0].data[0]=s,r[0].data[1]=l,this):(this._activePath.moveTo(s,l),this)}quadraticCurveTo(t,n,i,r,s){this._tick++;const l=this._transform;return this._activePath.quadraticCurveTo(l.a*t+l.c*n+l.tx,l.b*t+l.d*n+l.ty,l.a*i+l.c*r+l.tx,l.b*i+l.d*r+l.ty,s),this}rect(t,n,i,r){return this._tick++,this._activePath.rect(t,n,i,r,this._transform.clone()),this}roundRect(t,n,i,r,s){return this._tick++,this._activePath.roundRect(t,n,i,r,s,this._transform.clone()),this}poly(t,n){return this._tick++,this._activePath.poly(t,n,this._transform.clone()),this}regularPoly(t,n,i,r,s=0,l){return this._tick++,this._activePath.regularPoly(t,n,i,r,s,l),this}roundPoly(t,n,i,r,s,l){return this._tick++,this._activePath.roundPoly(t,n,i,r,s,l),this}roundShape(t,n,i,r){return this._tick++,this._activePath.roundShape(t,n,i,r),this}filletRect(t,n,i,r,s){return this._tick++,this._activePath.filletRect(t,n,i,r,s),this}chamferRect(t,n,i,r,s,l){return this._tick++,this._activePath.chamferRect(t,n,i,r,s,l),this}star(t,n,i,r,s=0,l=0){return this._tick++,this._activePath.star(t,n,i,r,s,l,this._transform.clone()),this}svg(t){return this._tick++,tB(t,this),this}restore(){const t=this._stateStack.pop();return t&&(this._transform=t.transform,this._fillStyle=t.fillStyle,this._strokeStyle=t.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(t){return this._transform.rotate(t),this}scale(t,n=t){return this._transform.scale(t,n),this}setTransform(t,n,i,r,s,l){return t instanceof Ht?(this._transform.set(t.a,t.b,t.c,t.d,t.tx,t.ty),this):(this._transform.set(t,n,i,r,s,l),this)}transform(t,n,i,r,s,l){return t instanceof Ht?(this._transform.append(t),this):(Nw.set(t,n,i,r,s,l),this._transform.append(Nw),this)}translate(t,n=t){return this._transform.translate(t,n),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,this.dirty=!0,this.emit("update",this,16)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;const t=this._bounds;t.clear();for(let n=0;n<this.instructions.length;n++){const i=this.instructions[n],r=i.action;if(r==="fill"){const s=i.data;t.addBounds(s.path.bounds)}else if(r==="texture"){const s=i.data;t.addFrame(s.dx,s.dy,s.dx+s.dw,s.dy+s.dh,s.transform)}if(r==="stroke"){const s=i.data,l=s.style.alignment;let c=s.style.width*(1-l);s.style.join==="miter"&&(c*=lB(s.path,s.style.miterLimit));const f=s.path.bounds;t.addFrame(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c)}}return t.isValid||t.set(0,0,0,0),t}containsPoint(t){var r;if(!this.bounds.containsPoint(t.x,t.y))return!1;const n=this.instructions;let i=!1;for(let s=0;s<n.length;s++){const l=n[s],c=l.data,f=c.path;if(!l.action||!f)continue;const p=c.style,m=f.shapePath.shapePrimitives;for(let g=0;g<m.length;g++){const x=m[g].shape;if(!p||!x)continue;const v=m[g].transform,S=v?v.applyInverse(t,oB):t;if(l.action==="fill")i=x.contains(S.x,S.y);else{const T=p;i=x.strokeContains(S.x,S.y,T.width,T.alignment)}const A=c.hole;if(A){const T=(r=A.shapePath)==null?void 0:r.shapePrimitives;if(T)for(let C=0;C<T.length;C++)T[C].shape.contains(S.x,S.y)&&(i=!1)}if(i)return!0}}return i}unload(){var t;this.emit("unload",this);for(const n in this._gpuData)(t=this._gpuData[n])==null||t.destroy();this._gpuData=Object.create(null)}destroy(t=!1){if(this.destroyed)return;if(this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit("destroy",this),this.removeAllListeners(),typeof t=="boolean"?t:t==null?void 0:t.texture){const i=typeof t=="boolean"?t:t==null?void 0:t.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(i)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(i))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};p_.defaultFillStyle={color:16777215,alpha:1,texture:Mn.WHITE,matrix:null,fill:null,textureSpace:"local"};p_.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:Mn.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let ml=p_;class cB{constructor(){this.isBatchable=!1}reset(){this.isBatchable=!1,this.context=null,this.graphicsData&&(this.graphicsData.destroy(),this.graphicsData=null)}destroy(){this.reset()}}class uB{constructor(){this.instructions=new t_}init(){this.instructions.reset()}destroy(){this.instructions.destroy(),this.instructions=null}}const m_=class u1{constructor(t){this._renderer=t,this._managedContexts=new Jm({renderer:t,type:"resource",name:"graphicsContext"})}init(t){u1.defaultOptions.bezierSmoothness=(t==null?void 0:t.bezierSmoothness)??u1.defaultOptions.bezierSmoothness}getContextRenderData(t){return this.getGpuContext(t).graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const n=t._gpuData,i=!!n[this._renderer.uid],r=n[this._renderer.uid]||this._initContext(t);return(t.dirty||!i)&&(i&&r.reset(),r.isBatchable=!1,t.dirty=!1),r}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const n=new uB,i=this.getGpuContext(t);return i.graphicsData=n,n.init(),n}_initContext(t){const n=new cB;return n.context=t,t._gpuData[this._renderer.uid]=n,this._managedContexts.add(t),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};m_.extension={type:[kt.CanvasSystem],name:"graphicsContext"};m_.defaultOptions={bezierSmoothness:.5};let dB=m_;class pM{constructor(t,n){this.state=a_.for2d(),this.renderer=t,this._adaptor=n,this.renderer.runners.contextChange.add(this),this._managedGraphics=new Jm({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){return!1}addRenderable(t,n){this._managedGraphics.add(t),this.renderer.renderPipes.batch.break(n),n.add(t)}updateRenderable(t){}execute(t){t.isRenderable&&this._adaptor.execute(this,t)}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null}}pM.extension={type:[kt.CanvasPipes],name:"graphics"};function fB(e,t,n){const i=(e>>24&255)/255;t[n++]=(e&255)/255*i,t[n++]=(e>>8&255)/255*i,t[n++]=(e>>16&255)/255*i,t[n++]=i}class hB{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(t=>{Da.return(t)}),this.batches.length=0}}class mM{constructor(t,n){this.state=a_.for2d(),this.renderer=t,this._adaptor=n,this.renderer.runners.contextChange.add(this),this._managedGraphics=new Jm({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){const n=t.context,i=!!t._gpuData,s=this.renderer.graphicsContext.updateGpuContext(n);return!!(s.isBatchable||i!==s.isBatchable)}addRenderable(t,n){const r=this.renderer.graphicsContext.updateGpuContext(t.context);t.didViewUpdate&&this._rebuild(t),r.isBatchable?this._addToBatcher(t,n):(this.renderer.renderPipes.batch.break(n),n.add(t))}updateRenderable(t){const i=this._getGpuDataForRenderable(t).batches;for(let r=0;r<i.length;r++){const s=i[r];s._batcher.updateElement(s)}}execute(t){if(!t.isRenderable)return;const n=this.renderer,i=t.context;if(!n.graphicsContext.getGpuContext(i).batches.length)return;const s=i.customShader||this._adaptor.shader;this.state.blendMode=t.groupBlendMode;const l=s.resources.localUniforms.uniforms;l.uTransformMatrix=t.groupTransform,l.uRound=n._roundPixels|t._roundPixels,fB(t.groupColorAlpha,l.uColor,0),this._adaptor.execute(this,t)}_rebuild(t){const n=this._getGpuDataForRenderable(t),r=this.renderer.graphicsContext.updateGpuContext(t.context);n.destroy(),r.isBatchable&&this._updateBatchesForRenderable(t,n)}_addToBatcher(t,n){const i=this.renderer.renderPipes.batch,r=this._getGpuDataForRenderable(t).batches;for(let s=0;s<r.length;s++){const l=r[s];i.addToBatch(l,n)}}_getGpuDataForRenderable(t){return t._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(t)}_initGpuDataForRenderable(t){const n=new hB;return t._gpuData[this.renderer.uid]=n,this._managedGraphics.add(t),n}_updateBatchesForRenderable(t,n){const i=t.context,s=this.renderer.graphicsContext.getGpuContext(i),l=this.renderer._roundPixels|t._roundPixels;n.batches=s.batches.map(c=>{const f=Da.get(u_);return c.copyTo(f),f.renderable=t,f.roundPixels=l,f})}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}}mM.extension={type:[kt.WebGLPipes,kt.WebGPUPipes],name:"graphics"};li.add(pM);li.add(mM);li.add(dB);li.add(h_);class Na extends n_{constructor(t){t instanceof ml&&(t={context:t});const{context:n,roundPixels:i,...r}=t||{};super({label:"Graphics",...r}),this.renderPipeId="graphics",n?this.context=n:(this.context=this._ownedContext=new ml,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=i??!1}set context(t){t!==this._context&&(this._context&&(this._context.off("update",this.onViewUpdate,this),this._context.off("unload",this.unload,this)),this._context=t,this._context.on("update",this.onViewUpdate,this),this._context.on("unload",this.unload,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(t){return this._context.containsPoint(t)}destroy(t){this._ownedContext&&!t?this._ownedContext.destroy(t):(t===!0||(t==null?void 0:t.context)===!0)&&this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(t)}_onTouch(t){this._gcLastUsed=t,this._context._gcLastUsed=t}_callContextMethod(t,n){return this.context[t](...n),this}setFillStyle(...t){return this._callContextMethod("setFillStyle",t)}setStrokeStyle(...t){return this._callContextMethod("setStrokeStyle",t)}fill(...t){return this._callContextMethod("fill",t)}stroke(...t){return this._callContextMethod("stroke",t)}texture(...t){return this._callContextMethod("texture",t)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...t){return this._callContextMethod("arc",t)}arcTo(...t){return this._callContextMethod("arcTo",t)}arcToSvg(...t){return this._callContextMethod("arcToSvg",t)}bezierCurveTo(...t){return this._callContextMethod("bezierCurveTo",t)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...t){return this._callContextMethod("ellipse",t)}circle(...t){return this._callContextMethod("circle",t)}path(...t){return this._callContextMethod("path",t)}lineTo(...t){return this._callContextMethod("lineTo",t)}moveTo(...t){return this._callContextMethod("moveTo",t)}quadraticCurveTo(...t){return this._callContextMethod("quadraticCurveTo",t)}rect(...t){return this._callContextMethod("rect",t)}roundRect(...t){return this._callContextMethod("roundRect",t)}poly(...t){return this._callContextMethod("poly",t)}regularPoly(...t){return this._callContextMethod("regularPoly",t)}roundPoly(...t){return this._callContextMethod("roundPoly",t)}roundShape(...t){return this._callContextMethod("roundShape",t)}filletRect(...t){return this._callContextMethod("filletRect",t)}chamferRect(...t){return this._callContextMethod("chamferRect",t)}star(...t){return this._callContextMethod("star",t)}svg(...t){return this._callContextMethod("svg",t)}restore(...t){return this._callContextMethod("restore",t)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...t){return this._callContextMethod("rotate",t)}scaleTransform(...t){return this._callContextMethod("scale",t)}setTransform(...t){return this._callContextMethod("setTransform",t)}transform(...t){return this._callContextMethod("transform",t)}translateTransform(...t){return this._callContextMethod("translate",t)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(t){this._context.fillStyle=t}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(t){this._context.strokeStyle=t}clone(t=!1){return t?new Na(this._context.clone()):(this._ownedContext=null,new Na(this._context))}lineStyle(t,n,i){en(xi,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const r={};return t&&(r.width=t),n&&(r.color=n),i&&(r.alpha=i),this.context.strokeStyle=r,this}beginFill(t,n){en(xi,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const i={};return t!==void 0&&(i.color=t),n!==void 0&&(i.alpha=n),this.context.fillStyle=i,this}endFill(){en(xi,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const t=this.context.strokeStyle;return(t.width!==ml.defaultStrokeStyle.width||t.color!==ml.defaultStrokeStyle.color||t.alpha!==ml.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...t){return en(xi,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return en(xi,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return en(xi,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return en(xi,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return en(xi,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return en(xi,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}class pB extends n_{constructor(t,n){const{text:i,resolution:r,style:s,anchor:l,width:c,height:f,roundPixels:p,...m}=t;super({...m}),this.batched=!0,this._resolution=null,this._autoResolution=!0,this._didTextUpdate=!0,this._styleClass=n,this.text=i??"",this.style=s,this.resolution=r??null,this.allowChildren=!1,this._anchor=new br({_onUpdate:()=>{this.onViewUpdate()}}),l&&(this.anchor=l),this.roundPixels=p??!1,c!==void 0&&(this.width=c),f!==void 0&&(this.height=f)}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}set text(t){t=t.toString(),this._text!==t&&(this._text=t,this.onViewUpdate())}get text(){return this._text}set resolution(t){this._autoResolution=t===null,this._resolution=t,this.onViewUpdate()}get resolution(){return this._resolution}get style(){return this._style}set style(t){var n;t||(t={}),(n=this._style)==null||n.off("update",this.onViewUpdate,this),t instanceof this._styleClass?this._style=t:this._style=new this._styleClass(t),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate()}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(t){this._setWidth(t,this.bounds.width)}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(t){this._setHeight(t,this.bounds.height)}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this.bounds.width,t.height=Math.abs(this.scale.y)*this.bounds.height,t}setSize(t,n){typeof t=="object"?(n=t.height??t.width,t=t.width):n??(n=t),t!==void 0&&this._setWidth(t,this.bounds.width),n!==void 0&&this._setHeight(n,this.bounds.height)}containsPoint(t){const n=this.bounds.width,i=this.bounds.height,r=-n*this.anchor.x;let s=0;return t.x>=r&&t.x<=r+n&&(s=-i*this.anchor.y,t.y>=s&&t.y<=s+i)}onViewUpdate(){this.didViewUpdate||(this._didTextUpdate=!0),super.onViewUpdate()}destroy(t=!1){super.destroy(t),this.owner=null,this._bounds=null,this._anchor=null,(typeof t=="boolean"?t:t!=null&&t.style)&&this._style.destroy(t),this._style=null,this._text=null}get styleKey(){return`${this._text}:${this._style.styleKey}:${this._resolution}`}}function mB(e,t){let n=e[0]??{};return(typeof n=="string"||e[1])&&(en(xi,`use new ${t}({ text: "hi!", style }) instead`),n={text:n,style:e[1]}),n}class gB{constructor(t){this._canvasPool=Object.create(null),this.canvasOptions=t||{},this.enableFullScreen=!1}_createCanvasAndContext(t,n){const i=is.get().createCanvas();i.width=t,i.height=n;const r=i.getContext("2d");return{canvas:i,context:r}}getOptimalCanvasAndContext(t,n,i=1){t=Math.ceil(t*i-1e-6),n=Math.ceil(n*i-1e-6),t=sh(t),n=sh(n);const r=(t<<17)+(n<<1);this._canvasPool[r]||(this._canvasPool[r]=[]);let s=this._canvasPool[r].pop();return s||(s=this._createCanvasAndContext(t,n)),s}returnCanvasAndContext(t){const n=t.canvas,{width:i,height:r}=n,s=(i<<17)+(r<<1);t.context.resetTransform(),t.context.clearRect(0,0,i,r),this._canvasPool[s].push(t)}clear(){this._canvasPool={}}}const d1=new gB;Qm.register(d1);let ad=null,nc=null;function yB(e,t){ad||(ad=is.get().createCanvas(256,128),nc=ad.getContext("2d",{willReadFrequently:!0}),nc.globalCompositeOperation="copy",nc.globalAlpha=1),(ad.width<e||ad.height<t)&&(ad.width=sh(e),ad.height=sh(t))}function Ow(e,t,n){for(let i=0,r=4*n*t;i<t;++i,r+=4)if(e[r+3]!==0)return!1;return!0}function Dw(e,t,n,i,r){const s=4*t;for(let l=i,c=i*s+4*n;l<=r;++l,c+=s)if(e[c+3]!==0)return!1;return!0}function xB(...e){let t=e[0];t.canvas||(t={canvas:e[0],resolution:e[1]});const{canvas:n}=t,i=Math.min(t.resolution??1,1),r=t.width??n.width,s=t.height??n.height;let l=t.output;if(yB(r,s),!nc)throw new TypeError("Failed to get canvas 2D context");nc.drawImage(n,0,0,r,s,0,0,r*i,s*i);const f=nc.getImageData(0,0,r,s).data;let p=0,m=0,g=r-1,x=s-1;for(;m<s&&Ow(f,r,m);)++m;if(m===s)return Ti.EMPTY;for(;Ow(f,r,x);)--x;for(;Dw(f,r,p,m,x);)++p;for(;Dw(f,r,g,m,x);)--g;return++g,++x,nc.globalCompositeOperation="source-over",nc.strokeRect(p,m,g-p,x-m),nc.globalCompositeOperation="copy",l??(l=new Ti),l.set(p/i,m/i,(g-p)/i,(x-m)/i),l}/**
299
- * tiny-lru
300
- *
301
- * @copyright 2026 Jason Mulligan <jason.mulligan@avoidwork.com>
302
- * @license BSD-3-Clause
303
- * @version 11.4.7
304
- */class bB{constructor(t=0,n=0,i=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.resetTtl=i,this.size=0,this.ttl=n}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){const n=this.items[t];delete this.items[t],this.size--,n.prev!==null&&(n.prev.next=n.next),n.next!==null&&(n.next.prev=n.prev),this.first===n&&(this.first=n.next),this.last===n&&(this.last=n.prev)}return this}entries(t=this.keys()){const n=new Array(t.length);for(let i=0;i<t.length;i++){const r=t[i];n[i]=[r,this.get(r)]}return n}evict(t=!1){if(t||this.size>0){const n=this.first;delete this.items[n.key],--this.size===0?(this.first=null,this.last=null):(this.first=n.next,this.first.prev=null)}return this}expiresAt(t){let n;return this.has(t)&&(n=this.items[t].expiry),n}get(t){const n=this.items[t];if(n!==void 0){if(this.ttl>0&&n.expiry<=Date.now()){this.delete(t);return}return this.moveToEnd(n),n.value}}has(t){return t in this.items}moveToEnd(t){this.last!==t&&(t.prev!==null&&(t.prev.next=t.next),t.next!==null&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),t.prev=this.last,t.next=null,this.last!==null&&(this.last.next=t),this.last=t,this.first===null&&(this.first=t))}keys(){const t=new Array(this.size);let n=this.first,i=0;for(;n!==null;)t[i++]=n.key,n=n.next;return t}setWithEvicted(t,n,i=this.resetTtl){let r=null;if(this.has(t))this.set(t,n,!0,i);else{this.max>0&&this.size===this.max&&(r={...this.first},this.evict(!0));let s=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:n};++this.size===1?this.first=s:this.last.next=s,this.last=s}return r}set(t,n,i=!1,r=this.resetTtl){let s=this.items[t];return i||s!==void 0?(s.value=n,i===!1&&r&&(s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(s)):(this.max>0&&this.size===this.max&&this.evict(!0),s=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:n},++this.size===1?this.first=s:this.last.next=s,this.last=s),this}values(t=this.keys()){const n=new Array(t.length);for(let i=0;i<t.length;i++)n[i]=this.get(t[i]);return n}}function vB(e=1e3,t=0,n=!1){if(isNaN(e)||e<0)throw new TypeError("Invalid max value");if(isNaN(t)||t<0)throw new TypeError("Invalid ttl value");if(typeof n!="boolean")throw new TypeError("Invalid resetTtl value");return new bB(e,t,n)}function gM(e){return!!e.tagStyles&&Object.keys(e.tagStyles).length>0}function yM(e){return e.includes("<")}function _B(e,t){return e.clone().assign(t)}function SB(e,t){const n=[],i=t.tagStyles;if(!gM(t)||!yM(e))return n.push({text:e,style:t}),n;const r=[t],s=[];let l="",c=0;for(;c<e.length;){const f=e[c];if(f==="<"){const p=e.indexOf(">",c);if(p===-1){l+=f,c++;continue}const m=e.slice(c+1,p);if(m.startsWith("/")){const g=m.slice(1).trim();if(s.length>0&&s[s.length-1]===g){l.length>0&&(n.push({text:l,style:r[r.length-1]}),l=""),r.pop(),s.pop(),c=p+1;continue}else{l+=e.slice(c,p+1),c=p+1;continue}}else{const g=m.trim();if(i[g]){l.length>0&&(n.push({text:l,style:r[r.length-1]}),l="");const x=r[r.length-1],v=_B(x,i[g]);r.push(v),s.push(g),c=p+1;continue}else{l+=e.slice(c,p+1),c=p+1;continue}}}else l+=f,c++}return l.length>0&&n.push({text:l,style:r[r.length-1]}),n}const EB=[10,13],wB=new Set(EB),TB=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288],CB=new Set(TB),AB=[9,32];new Set(AB);const MB=[45,8208,8211,8212,173],RB=new Set(MB),kB=/(\r\n|\r|\n)/,NB=/(?:\r\n|\r|\n)/;function N0(e){return typeof e!="string"?!1:wB.has(e.charCodeAt(0))}function Ls(e,t){return typeof e!="string"?!1:CB.has(e.charCodeAt(0))}function OB(e){return typeof e!="string"?!1:RB.has(e.charCodeAt(0))}function xM(e){return e==="normal"||e==="pre-line"}function bM(e){return e==="normal"}function tc(e){if(typeof e!="string")return"";let t=e.length-1;for(;t>=0&&Ls(e[t]);)t--;return t<e.length-1?e.slice(0,t+1):e}function vM(e){const t=[],n=[];if(typeof e!="string")return t;for(let i=0;i<e.length;i++){const r=e[i],s=e[i+1];if(Ls(r)||N0(r)){n.length>0&&(t.push(n.join("")),n.length=0),r==="\r"&&s===`
305
- `?(t.push(`\r
306
- `),i++):t.push(r);continue}n.push(r),OB(r)&&s&&!Ls(s)&&!N0(s)&&(t.push(n.join("")),n.length=0)}return n.length>0&&t.push(n.join("")),t}function _M(e,t,n,i){const r=n(e),s=[];for(let l=0;l<r.length;l++){let c=r[l],f=c,p=1;for(;r[l+p];){const m=r[l+p];if(!i(f,m,e,l,t))c+=m,f=m,p++;else break}l+=p-1,s.push(c)}return s}const DB=/\r\n|\r|\n/g;function zB(e,t,n,i,r,s,l,c){var W,z;const f=SB(e,t);if(bM(t.whiteSpace))for(let K=0;K<f.length;K++){const G=f[K];f[K]={text:G.text.replace(DB," "),style:G.style}}const m=[];let g=[];for(const K of f){const G=K.text.split(kB);for(let Q=0;Q<G.length;Q++){const I=G[Q];I===`\r
307
- `||I==="\r"||I===`
308
- `?(m.push(g),g=[]):I.length>0&&g.push({text:I,style:K.style})}}(g.length>0||m.length===0)&&m.push(g);const x=n?BB(m,t,i,r,l,c):m,v=[],S=[],A=[],T=[],C=[];let N=0;const R=t._fontString,O=s(R);O.fontSize===0&&(O.fontSize=t.fontSize,O.ascent=t.fontSize);let H="",D=!!t.dropShadow,q=((W=t._stroke)==null?void 0:W.width)||0;for(const K of x){let G=0,Q=O.ascent,I=O.descent,$="";for(const X of K){const ce=X.style._fontString,ie=s(ce);ce!==H&&(i.font=ce,H=ce);const de=r(X.text,X.style.letterSpacing,i);G+=de,Q=Math.max(Q,ie.ascent),I=Math.max(I,ie.descent),$+=X.text;const xe=((z=X.style._stroke)==null?void 0:z.width)||0;xe>q&&(q=xe),!D&&X.style.dropShadow&&(D=!0)}K.length===0&&(Q=O.ascent,I=O.descent),v.push(G),S.push(Q),A.push(I),C.push($);const ne=t.lineHeight||Q+I;T.push(ne+t.leading),N=Math.max(N,G)}const Z=q,F=(n&&t.align!=="left"?Math.max(N,t.wordWrapWidth):N)+Z+(t.dropShadow?t.dropShadow.distance:0);let j=0;for(let K=0;K<T.length;K++)j+=T[K];j=Math.max(j,T[0]+Z);const ee=j+(t.dropShadow?t.dropShadow.distance:0),P=t.lineHeight||O.fontSize;return{width:F,height:ee,lines:C,lineWidths:v,lineHeight:P+t.leading,maxLineWidth:N,fontProperties:O,runsByLine:x,lineAscents:S,lineDescents:A,lineHeights:T,hasDropShadow:D}}function BB(e,t,n,i,r,s){var T;const{letterSpacing:l,whiteSpace:c,wordWrapWidth:f,breakWords:p}=t,m=xM(c),g=f+l,x={};let v="";const S=(C,N)=>{const R=`${C}|${N.styleKey}`;let O=x[R];if(O===void 0){const H=N._fontString;H!==v&&(n.font=H,v=H),O=i(C,N.letterSpacing,n)+N.letterSpacing,x[R]=O}return O},A=[];for(const C of e){const N=LB(C),R=A.length,O=j=>{let ee=0,P=j;do{const{token:W,style:z}=N[P];ee+=S(W,z),P++}while(P<N.length&&N[P].continuesFromPrevious);return ee},H=j=>{const ee=[];let P=j;do ee.push({token:N[P].token,style:N[P].style}),P++;while(P<N.length&&N[P].continuesFromPrevious);return ee};let D=[],q=0,Z=!m,V=null;const Y=()=>{V&&V.text.length>0&&D.push(V),V=null},F=()=>{if(Y(),D.length>0){const j=D[D.length-1];j.text=tc(j.text),j.text.length===0&&D.pop()}A.push(D),D=[],q=0,Z=!1};for(let j=0;j<N.length;j++){const{token:ee,style:P,continuesFromPrevious:W}=N[j],z=S(ee,P);if(m){const Q=Ls(ee),I=(V==null?void 0:V.text[V.text.length-1])??((T=D[D.length-1])==null?void 0:T.text.slice(-1))??"",$=I?Ls(I):!1;if(Q&&$)continue}const K=!W,G=K?O(j):z;if(G>g&&K)if(q>0&&F(),p){const Q=H(j);for(let I=0;I<Q.length;I++){const $=Q[I].token,ne=Q[I].style,X=_M($,p,s,r);for(const ce of X){const ie=S(ce,ne);ie+q>g&&F(),!V||V.style!==ne?(Y(),V={text:ce,style:ne}):V.text+=ce,q+=ie}}j+=Q.length-1}else{const Q=H(j);Y(),A.push(Q.map(I=>({text:I.token,style:I.style}))),Z=!1,j+=Q.length-1}else if(G+q>g&&K){if(Ls(ee)){Z=!1;continue}F(),V={text:ee,style:P},q=z}else if(W&&!p)!V||V.style!==P?(Y(),V={text:ee,style:P}):V.text+=ee,q+=z;else{const Q=Ls(ee);if(q===0&&Q&&!Z)continue;!V||V.style!==P?(Y(),V={text:ee,style:P}):V.text+=ee,q+=z}}if(Y(),D.length>0){const j=D[D.length-1];j.text=tc(j.text),j.text.length===0&&D.pop()}(D.length>0||A.length===R)&&A.push(D)}return A}function LB(e){const t=[];let n=!1;for(const i of e){const r=vM(i.text);let s=!0;for(const l of r){const c=Ls(l)||N0(l),f=s&&n&&!c;t.push({token:l,style:i.style,continuesFromPrevious:f}),n=!c,s=!1}}return t}const jB={willReadFrequently:!0};function zw(e,t,n,i,r){let s=n[e];return typeof s!="number"&&(s=r(e,t,i)+t,n[e]=s),s}function IB(e,t,n,i,r,s,l){const c=n.getContext("2d",jB);c.font=t._fontString;let f=0,p="";const m=[],g=Object.create(null),{letterSpacing:x,whiteSpace:v}=t,S=xM(v),A=bM(v);let T=!S;const C=t.wordWrapWidth+x,N=vM(e);for(let O=0;O<N.length;O++){let H=N[O];if(N0(H)){if(!A){m.push(tc(p)),T=!S,p="",f=0;continue}H=" "}if(S){const q=Ls(H),Z=Ls(p[p.length-1]);if(q&&Z)continue}const D=zw(H,x,g,c,i);if(D>C)if(p!==""&&(m.push(tc(p)),p="",f=0),r(H,t.breakWords)){const q=_M(H,t.breakWords,l,s);for(const Z of q){const V=zw(Z,x,g,c,i);V+f>C&&(m.push(tc(p)),T=!1,p="",f=0),p+=Z,f+=V}}else p.length>0&&(m.push(tc(p)),p="",f=0),m.push(tc(H)),T=!1,p="",f=0;else D+f>C&&(T=!1,m.push(tc(p)),p="",f=0),(p.length>0||!Ls(H)||T)&&(p+=H,f+=D)}const R=tc(p);return R.length>0&&m.push(R),m.join(`
309
- `)}const Bw={willReadFrequently:!0},cc=class gt{static get experimentalLetterSpacingSupported(){let t=gt._experimentalLetterSpacingSupported;if(t===void 0){const n=is.get().getCanvasRenderingContext2D().prototype;t=gt._experimentalLetterSpacingSupported="letterSpacing"in n||"textLetterSpacing"in n}return t}constructor(t,n,i,r,s,l,c,f,p,m){this.text=t,this.style=n,this.width=i,this.height=r,this.lines=s,this.lineWidths=l,this.lineHeight=c,this.maxLineWidth=f,this.fontProperties=p,m&&(this.runsByLine=m.runsByLine,this.lineAscents=m.lineAscents,this.lineDescents=m.lineDescents,this.lineHeights=m.lineHeights,this.hasDropShadow=m.hasDropShadow)}static measureText(t=" ",n,i=gt._canvas,r=n.wordWrap){var H;const s=`${t}-${n.styleKey}-wordWrap-${r}`;if(gt._measurementCache.has(s))return gt._measurementCache.get(s);if(gM(n)&&yM(t)){const D=zB(t,n,r,gt._context,gt._measureText,gt.measureFont,gt.canBreakChars,gt.wordWrapSplit),q=new gt(t,n,D.width,D.height,D.lines,D.lineWidths,D.lineHeight,D.maxLineWidth,D.fontProperties,{runsByLine:D.runsByLine,lineAscents:D.lineAscents,lineDescents:D.lineDescents,lineHeights:D.lineHeights,hasDropShadow:D.hasDropShadow});return gt._measurementCache.set(s,q),q}const c=n._fontString,f=gt.measureFont(c);f.fontSize===0&&(f.fontSize=n.fontSize,f.ascent=n.fontSize,f.descent=0);const p=gt._context;p.font=c;const g=(r?gt._wordWrap(t,n,i):t).split(NB),x=new Array(g.length);let v=0;for(let D=0;D<g.length;D++){const q=gt._measureText(g[D],n.letterSpacing,p);x[D]=q,v=Math.max(v,q)}const S=((H=n._stroke)==null?void 0:H.width)??0,A=n.lineHeight||f.fontSize,T=gt._getAlignWidth(v,n,r),C=gt._adjustWidthForStyle(T,n),N=Math.max(A,f.fontSize+S)+(g.length-1)*(A+n.leading),R=gt._adjustHeightForStyle(N,n),O=new gt(t,n,C,R,g,x,A+n.leading,v,f);return gt._measurementCache.set(s,O),O}static _adjustWidthForStyle(t,n){var s;const i=((s=n._stroke)==null?void 0:s.width)||0;let r=t+i;return n.dropShadow&&(r+=n.dropShadow.distance),r}static _adjustHeightForStyle(t,n){let i=t;return n.dropShadow&&(i+=n.dropShadow.distance),i}static _getAlignWidth(t,n,i){return i&&n.align!=="left"?Math.max(t,n.wordWrapWidth):t}static _measureText(t,n,i){let r=!1;gt.experimentalLetterSpacingSupported&&(gt.experimentalLetterSpacing?(i.letterSpacing=`${n}px`,i.textLetterSpacing=`${n}px`,r=!0):(i.letterSpacing="0px",i.textLetterSpacing="0px"));const s=i.measureText(t);let l=s.width;const c=-(s.actualBoundingBoxLeft??0);let p=(s.actualBoundingBoxRight??0)-c;if(l>0)if(r)l-=n,p-=n;else{const m=(gt.graphemeSegmenter(t).length-1)*n;l+=m,p+=m}return Math.max(l,p)}static _wordWrap(t,n,i=gt._canvas){return IB(t,n,i,gt._measureText,gt.canBreakWords,gt.canBreakChars,gt.wordWrapSplit)}static isBreakingSpace(t,n){return Ls(t)}static canBreakWords(t,n){return n}static canBreakChars(t,n,i,r,s){return!0}static wordWrapSplit(t){return gt.graphemeSegmenter(t)}static measureFont(t){if(gt._fonts[t])return gt._fonts[t];const n=gt._context;n.font=t;const i=n.measureText(gt.METRICS_STRING+gt.BASELINE_SYMBOL),r=i.actualBoundingBoxAscent??0,s=i.actualBoundingBoxDescent??0,l={ascent:r,descent:s,fontSize:r+s};return gt._fonts[t]=l,l}static clearMetrics(t=""){t?delete gt._fonts[t]:gt._fonts={}}static get _canvas(){if(!gt.__canvas){let t;try{const n=new OffscreenCanvas(0,0),i=n.getContext("2d",Bw);if(i!=null&&i.measureText)return gt.__canvas=n,n;t=is.get().createCanvas()}catch{t=is.get().createCanvas()}t.width=t.height=10,gt.__canvas=t}return gt.__canvas}static get _context(){return gt.__context||(gt.__context=gt._canvas.getContext("2d",Bw)),gt.__context}};cc.METRICS_STRING="|ÉqÅ";cc.BASELINE_SYMBOL="M";cc.BASELINE_MULTIPLIER=1.4;cc.HEIGHT_MULTIPLIER=2;cc.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const e=new Intl.Segmenter;return t=>{const n=e.segment(t),i=[];let r=0;for(const s of n)i[r++]=s.segment;return i}}return e=>[...e]})();cc.experimentalLetterSpacing=!1;cc._fonts={};cc._measurementCache=vB(1e3);let ru=cc;const UB=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function f1(e){const t=typeof e.fontSize=="number"?`${e.fontSize}px`:e.fontSize;let n=e.fontFamily;Array.isArray(e.fontFamily)||(n=e.fontFamily.split(","));for(let i=n.length-1;i>=0;i--){let r=n[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!UB.includes(r)&&(r=`"${r}"`),n[i]=r}return`${e.fontStyle} ${e.fontVariant} ${e.fontWeight} ${t} ${n.join(",")}`}const Lw=1e5;function Gy(e,t,n,i=0,r=0,s=0){if(e.texture===Mn.WHITE&&!e.fill)return qi.shared.setValue(e.color).setAlpha(e.alpha??1).toHexa();if(e.fill){if(e.fill instanceof rx){const l=e.fill,c=t.createPattern(l.texture.source.resource,"repeat"),f=l.transform.copyTo(Ht.shared);return f.scale(l.texture.source.pixelWidth,l.texture.source.pixelHeight),c.setTransform(f),c}else if(e.fill instanceof lc){const l=e.fill,c=l.type==="linear",f=l.textureSpace==="local";let p=1,m=1;f&&n&&(p=n.width+i,m=n.height+i);let g,x=!1;if(c){const{start:v,end:S}=l;g=t.createLinearGradient(v.x*p+r,v.y*m+s,S.x*p+r,S.y*m+s),x=Math.abs(S.x-v.x)<Math.abs((S.y-v.y)*.1)}else{const{center:v,innerRadius:S,outerCenter:A,outerRadius:T}=l;g=t.createRadialGradient(v.x*p+r,v.y*m+s,S*p,A.x*p+r,A.y*m+s,T*p)}if(x&&f&&n){const v=n.lineHeight/m;for(let S=0;S<n.lines.length;S++){const A=(S*n.lineHeight+i/2)/m;l.colorStops.forEach(T=>{let C=A+T.offset*v;C=Math.max(0,Math.min(1,C)),g.addColorStop(Math.floor(C*Lw)/Lw,qi.shared.setValue(T.color).toHex())})}}else l.colorStops.forEach(v=>{g.addColorStop(v.offset,qi.shared.setValue(v.color).toHex())});return g}}else{const l=t.createPattern(e.texture.source.resource,"repeat"),c=e.matrix.copyTo(Ht.shared);return c.scale(e.texture.source.pixelWidth,e.texture.source.pixelHeight),l.setTransform(c),l}return ma("FillStyle not recognised",e),"red"}const jw=new Ti;function Lf(e){let t=0;for(let n=0;n<e.length;n++)e.charCodeAt(n)===32&&t++;return t}class HB{getCanvasAndContext(t){const{text:n,style:i,resolution:r=1}=t,s=i._getFinalPadding(),l=ru.measureText(n||" ",i),c=Math.ceil(Math.ceil(Math.max(1,l.width)+s*2)*r),f=Math.ceil(Math.ceil(Math.max(1,l.height)+s*2)*r),p=d1.getOptimalCanvasAndContext(c,f);this._renderTextToCanvas(i,s,r,p,l);const m=i.trim?xB({canvas:p.canvas,width:c,height:f,resolution:1,output:jw}):jw.set(0,0,c,f);return{canvasAndContext:p,frame:m}}returnCanvasAndContext(t){d1.returnCanvasAndContext(t)}_renderTextToCanvas(t,n,i,r,s){var D,q,Z;if(s.runsByLine&&s.runsByLine.length>0){this._renderTaggedTextToCanvas(s,t,n,i,r);return}const{canvas:l,context:c}=r,f=f1(t),p=s.lines,m=s.lineHeight,g=s.lineWidths,x=s.maxLineWidth,v=s.fontProperties,S=l.height;if(c.resetTransform(),c.scale(i,i),c.textBaseline=t.textBaseline,(D=t._stroke)!=null&&D.width){const V=t._stroke;c.lineWidth=V.width,c.miterLimit=V.miterLimit,c.lineJoin=V.join,c.lineCap=V.cap}c.font=f;let A,T;const C=t.dropShadow?2:1,N=t.wordWrap?t.wordWrapWidth:x,O=(((q=t._stroke)==null?void 0:q.width)??0)/2;let H=(m-v.fontSize)/2;m-v.fontSize<0&&(H=0);for(let V=0;V<C;++V){const Y=t.dropShadow&&V===0,F=Y?Math.ceil(Math.max(1,S)+n*2):0,j=F*i;if(Y)this._setupDropShadow(c,t,i,j);else{const ee=t._gradientBounds,P=t._gradientOffset;if(ee){const W={width:ee.width,height:ee.height,lineHeight:ee.height,lines:s.lines};this._setFillAndStrokeStyles(c,t,W,n,O,(P==null?void 0:P.x)??0,(P==null?void 0:P.y)??0)}else P?this._setFillAndStrokeStyles(c,t,s,n,O,P.x,P.y):this._setFillAndStrokeStyles(c,t,s,n,O);c.shadowColor="rgba(0,0,0,0)"}for(let ee=0;ee<p.length;ee++){A=O,T=O+ee*m+v.ascent+H,A+=this._getAlignmentOffset(g[ee],N,t.align);let P=0;if(t.align==="justify"&&t.wordWrap&&ee<p.length-1){const W=Lf(p[ee]);W>0&&(P=(N-g[ee])/W)}(Z=t._stroke)!=null&&Z.width&&this._drawLetterSpacing(p[ee],t,r,A+n,T+n-F,!0,P),t._fill!==void 0&&this._drawLetterSpacing(p[ee],t,r,A+n,T+n-F,!1,P)}}}_renderTaggedTextToCanvas(t,n,i,r,s){var O,H,D;const{canvas:l,context:c}=s,{runsByLine:f,lineWidths:p,maxLineWidth:m,lineAscents:g,lineHeights:x,hasDropShadow:v}=t,S=l.height;c.resetTransform(),c.scale(r,r),c.textBaseline=n.textBaseline;const A=v?2:1,T=n.wordWrap?n.wordWrapWidth:m;let C=((O=n._stroke)==null?void 0:O.width)??0;for(const q of f)for(const Z of q){const V=((H=Z.style._stroke)==null?void 0:H.width)??0;V>C&&(C=V)}const N=C/2,R=[];for(let q=0;q<f.length;q++){const Z=f[q],V=[];for(const Y of Z){const F=f1(Y.style);c.font=F,V.push({width:ru._measureText(Y.text,Y.style.letterSpacing,c),font:F})}R.push(V)}for(let q=0;q<A;++q){const Z=v&&q===0,V=Z?Math.ceil(Math.max(1,S)+i*2):0,Y=V*r;Z||(c.shadowColor="rgba(0,0,0,0)");let F=N;for(let j=0;j<f.length;j++){const ee=f[j],P=p[j],W=g[j],z=x[j],K=R[j];let G=N;G+=this._getAlignmentOffset(P,T,n.align);let Q=0;if(n.align==="justify"&&n.wordWrap&&j<f.length-1){let ne=0;for(const X of ee)ne+=Lf(X.text);ne>0&&(Q=(T-P)/ne)}const I=F+W;let $=G+i;for(let ne=0;ne<ee.length;ne++){const X=ee[ne],{width:ce,font:ie}=K[ne];if(c.font=ie,c.textBaseline=X.style.textBaseline,(D=X.style._stroke)!=null&&D.width){const xe=X.style._stroke;if(c.lineWidth=xe.width,c.miterLimit=xe.miterLimit,c.lineJoin=xe.join,c.lineCap=xe.cap,Z)if(X.style.dropShadow)this._setupDropShadow(c,X.style,r,Y);else{const me=Lf(X.text);$+=ce+me*Q;continue}else{const me=ru.measureFont(ie),le=X.style.lineHeight||me.fontSize,Re={width:ce,height:le,lineHeight:le,lines:[X.text]};c.strokeStyle=Gy(xe,c,Re,i*2,$-i,F)}this._drawLetterSpacing(X.text,X.style,s,$,I+i-V,!0,Q)}const de=Lf(X.text);$+=ce+de*Q}$=G+i;for(let ne=0;ne<ee.length;ne++){const X=ee[ne],{width:ce,font:ie}=K[ne];if(c.font=ie,c.textBaseline=X.style.textBaseline,X.style._fill!==void 0){if(Z)if(X.style.dropShadow)this._setupDropShadow(c,X.style,r,Y);else{const xe=Lf(X.text);$+=ce+xe*Q;continue}else{const xe=ru.measureFont(ie),me=X.style.lineHeight||xe.fontSize,le={width:ce,height:me,lineHeight:me,lines:[X.text]};c.fillStyle=Gy(X.style._fill,c,le,i*2,$-i,F)}this._drawLetterSpacing(X.text,X.style,s,$,I+i-V,!1,Q)}const de=Lf(X.text);$+=ce+de*Q}F+=z}}}_setFillAndStrokeStyles(t,n,i,r,s,l=0,c=0){var f;if(t.fillStyle=n._fill?Gy(n._fill,t,i,r*2,l,c):null,(f=n._stroke)!=null&&f.width){const p=s+r*2;t.strokeStyle=Gy(n._stroke,t,i,p,l,c)}}_setupDropShadow(t,n,i,r){t.fillStyle="black",t.strokeStyle="black";const s=n.dropShadow,l=s.color,c=s.alpha;t.shadowColor=qi.shared.setValue(l).setAlpha(c).toRgbaString();const f=s.blur*i,p=s.distance*i;t.shadowBlur=f,t.shadowOffsetX=Math.cos(s.angle)*p,t.shadowOffsetY=Math.sin(s.angle)*p+r}_getAlignmentOffset(t,n,i){return i==="right"?n-t:i==="center"?(n-t)/2:0}_drawLetterSpacing(t,n,i,r,s,l=!1,c=0){const{context:f}=i,p=n.letterSpacing;let m=!1;if(ru.experimentalLetterSpacingSupported&&(ru.experimentalLetterSpacing?(f.letterSpacing=`${p}px`,f.textLetterSpacing=`${p}px`,m=!0):(f.letterSpacing="0px",f.textLetterSpacing="0px")),(p===0||m)&&c===0){l?f.strokeText(t,r,s):f.fillText(t,r,s);return}if(c!==0&&(p===0||m)){const A=t.split(" ");let T=r;const C=f.measureText(" ").width;for(let N=0;N<A.length;N++)l?f.strokeText(A[N],T,s):f.fillText(A[N],T,s),T+=f.measureText(A[N]).width+C+c;return}let g=r;const x=ru.graphemeSegmenter(t);let v=f.measureText(t).width,S=0;for(let A=0;A<x.length;++A){const T=x[A];l?f.strokeText(T,g,s):f.fillText(T,g,s);let C="";for(let N=A+1;N<x.length;++N)C+=x[N];S=f.measureText(C).width,g+=v-S+p,T===" "&&(g+=c),v=S}}}const Qf=new HB,g_=class hd extends yo{constructor(t={}){super(),this.uid=bi("textStyle"),this._tick=0,this._cachedFontString=null,PB(t),t instanceof hd&&(t=t._toObject());const r={...hd.defaultTextStyle,...t};for(const s in r){const l=s;this[l]=r[s]}this._tagStyles=t.tagStyles??void 0,this.update(),this._tick=0}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.update())}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.update())}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(t!==null&&typeof t=="object"?this._dropShadow=this._createProxy({...hd.defaultDropShadow,...t}):this._dropShadow=t?this._createProxy({...hd.defaultDropShadow}):null,this.update())}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.update())}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(typeof t=="string"?this._fontSize=parseInt(t,10):this._fontSize=t,this.update())}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t.toLowerCase(),this.update())}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.update())}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.update())}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.update())}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.update())}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.update())}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.update())}get filters(){return this._filters}set filters(t){this._filters!==t&&(this._filters=Object.freeze(t),this.update())}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.update())}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.update())}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.update())}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.update())}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.update())}get fill(){return this._originalFill}set fill(t){t!==this._originalFill&&(this._originalFill=t,this._isFillStyle(t)&&(this._originalFill=this._createProxy({...ml.defaultFillStyle,...t},()=>{this._fill=gd({...this._originalFill},ml.defaultFillStyle)})),this._fill=gd(t===0?"black":t,ml.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(t){t!==this._originalStroke&&(this._originalStroke=t,this._isFillStyle(t)&&(this._originalStroke=this._createProxy({...ml.defaultStrokeStyle,...t},()=>{this._stroke=k0({...this._originalStroke},ml.defaultStrokeStyle)})),this._stroke=k0(t,ml.defaultStrokeStyle),this.update())}get tagStyles(){return this._tagStyles}set tagStyles(t){this._tagStyles!==t&&(this._tagStyles=t??void 0,this.update())}update(){this._tick++,this._cachedFontString=null,this.emit("update",this)}reset(){const t=hd.defaultTextStyle;for(const n in t)this[n]=t[n]}assign(t){for(const n in t){const i=n;this[i]=t[n]}return this}get styleKey(){return`${this.uid}-${this._tick}`}get _fontString(){return this._cachedFontString===null&&(this._cachedFontString=f1(this)),this._cachedFontString}_toObject(){return{align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill?{...this._fill}:void 0,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke?{...this._stroke}:void 0,textBaseline:this.textBaseline,trim:this.trim,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0,tagStyles:this._tagStyles?{...this._tagStyles}:void 0}}clone(){return new hd(this._toObject())}_getFinalPadding(){let t=0;if(this._filters)for(let n=0;n<this._filters.length;n++)t+=this._filters[n].padding;return Math.max(this._padding,t)}destroy(t=!1){var i,r,s,l;if(this.removeAllListeners(),typeof t=="boolean"?t:t==null?void 0:t.texture){const c=typeof t=="boolean"?t:t==null?void 0:t.textureSource;(i=this._fill)!=null&&i.texture&&this._fill.texture.destroy(c),(r=this._originalFill)!=null&&r.texture&&this._originalFill.texture.destroy(c),(s=this._stroke)!=null&&s.texture&&this._stroke.texture.destroy(c),(l=this._originalStroke)!=null&&l.texture&&this._originalStroke.texture.destroy(c)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(t,n){return new Proxy(t,{set:(i,r,s)=>(i[r]===s||(i[r]=s,n==null||n(r,s),this.update()),!0)})}_isFillStyle(t){return(t??null)!==null&&!(qi.isColorLike(t)||t instanceof lc||t instanceof rx)}};g_.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};g_.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let _d=g_;function PB(e){const t=e;if(typeof t.dropShadow=="boolean"&&t.dropShadow){const n=_d.defaultDropShadow;e.dropShadow={alpha:t.dropShadowAlpha??n.alpha,angle:t.dropShadowAngle??n.angle,blur:t.dropShadowBlur??n.blur,color:t.dropShadowColor??n.color,distance:t.dropShadowDistance??n.distance}}if(t.strokeThickness!==void 0){en(xi,"strokeThickness is now a part of stroke");const n=t.stroke;let i={};if(qi.isColorLike(n))i.color=n;else if(n instanceof lc||n instanceof rx)i.fill=n;else if(Object.hasOwnProperty.call(n,"color")||Object.hasOwnProperty.call(n,"fill"))i=n;else throw new Error("Invalid stroke value.");e.stroke={...i,width:t.strokeThickness}}if(Array.isArray(t.fillGradientStops)){if(en(xi,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(t.fill)||t.fill.length===0)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");t.fill.length!==t.fillGradientStops.length&&ma("The number of fill colors must match the number of fill gradient stops.");const n=new lc({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),i=t.fillGradientStops.slice(),r=t.fill.map(s=>qi.shared.setValue(s).toNumber());i.forEach((s,l)=>{n.addColorStop(s,r[l])}),e.fill={fill:n}}}function FB(e,t){const{texture:n,bounds:i}=e,r=t._style._getFinalPadding();lA(i,t._anchor,n);const s=t._anchor._x*r*2,l=t._anchor._y*r*2;i.minX-=r-s,i.minY-=r-l,i.maxX-=r-s,i.maxY-=r-l}class GB{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=!0,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null}destroy(){this.reset()}}class qB extends GB{}class SM{constructor(t){this._renderer=t,t.runners.resolutionChange.add(this),this._managedTexts=new Jm({renderer:t,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"canvasText"})}resolutionChange(){for(const t in this._managedTexts.items){const n=this._managedTexts.items[t];n!=null&&n._autoResolution&&n.onViewUpdate()}}validateRenderable(t){const n=this._getGpuText(t),i=t.styleKey;return n.currentKey!==i?!0:t._didTextUpdate}addRenderable(t,n){const i=this._getGpuText(t);if(t._didTextUpdate){const r=t._autoResolution?this._renderer.resolution:t.resolution;(i.currentKey!==t.styleKey||t._resolution!==r)&&this._updateGpuText(t),t._didTextUpdate=!1,FB(i,t)}this._renderer.renderPipes.batch.addToBatch(i,n)}updateRenderable(t){const n=this._getGpuText(t);n._batcher.updateElement(n)}_updateGpuText(t){const n=this._getGpuText(t);n.texture&&this._renderer.canvasText.decreaseReferenceCount(n.currentKey),t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,n.texture=this._renderer.canvasText.getManagedTexture(t),n.currentKey=t.styleKey}_getGpuText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){const n=new qB;return n.currentKey="--",n.renderable=t,n.transform=t.groupTransform,n.bounds={minX:0,maxX:1,minY:0,maxY:0},n.roundPixels=this._renderer._roundPixels|t._roundPixels,t._gpuData[this._renderer.uid]=n,this._managedTexts.add(t),n}onTextUnload(t){const n=t._gpuData[this._renderer.uid];if(!n)return;const{canvasText:i}=this._renderer;i.getReferenceCount(n.currentKey)>0?i.decreaseReferenceCount(n.currentKey):n.texture&&i.returnTexture(n.texture)}destroy(){this._managedTexts.destroy(),this._renderer=null}}SM.extension={type:[kt.WebGLPipes,kt.WebGPUPipes,kt.CanvasPipes],name:"text"};const YB=new js;function VB(e,t,n,i,r=!1){const s=YB;s.minX=0,s.minY=0,s.maxX=e.width/i|0,s.maxY=e.height/i|0;const l=ex.getOptimalTexture(s.width,s.height,i,!1,r);return l.source.uploadMethodId="image",l.source.resource=e,l.source.alphaMode="premultiply-alpha-on-upload",l.frame.width=t/i,l.frame.height=n/i,l.source.emit("update",l.source),l.updateUvs(),l}class EM{constructor(t,n){this._activeTextures={},this._renderer=t,this._retainCanvasContext=n}getTexture(t,n,i,r){typeof t=="string"&&(en("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),t={text:t,style:i,resolution:n}),t.style instanceof _d||(t.style=new _d(t.style)),t.textureStyle instanceof lh||(t.textureStyle=new lh(t.textureStyle)),typeof t.text!="string"&&(t.text=t.text.toString());const{text:s,style:l,textureStyle:c,autoGenerateMipmaps:f}=t,p=t.resolution??this._renderer.resolution,{frame:m,canvasAndContext:g}=Qf.getCanvasAndContext({text:s,style:l,resolution:p}),x=VB(g.canvas,m.width,m.height,p,f);if(c&&(x.source.style=c),l.trim&&(m.pad(l.padding),x.frame.copyFrom(m),x.frame.scale(1/p),x.updateUvs()),l.filters){const v=this._applyFilters(x,l.filters);return this.returnTexture(x),Qf.returnCanvasAndContext(g),v}return this._renderer.texture.initSource(x._source),this._retainCanvasContext||Qf.returnCanvasAndContext(g),x}returnTexture(t){const n=t.source,i=n.resource;if(this._retainCanvasContext&&(i!=null&&i.getContext)){const r=i.getContext("2d");r&&Qf.returnCanvasAndContext({canvas:i,context:r})}n.resource=null,n.uploadMethodId="unknown",n.alphaMode="no-premultiply-alpha",ex.returnTexture(t,!0)}renderTextToCanvas(){en("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")}getManagedTexture(t){t._resolution=t._autoResolution?this._renderer.resolution:t.resolution;const n=t.styleKey;if(this._activeTextures[n])return this._increaseReferenceCount(n),this._activeTextures[n].texture;const i=this.getTexture({text:t.text,style:t.style,resolution:t._resolution,textureStyle:t.textureStyle,autoGenerateMipmaps:t.autoGenerateMipmaps});return this._activeTextures[n]={texture:i,usageCount:1},i}decreaseReferenceCount(t){const n=this._activeTextures[t];n&&(n.usageCount--,n.usageCount===0&&(this.returnTexture(n.texture),this._activeTextures[t]=null))}getReferenceCount(t){var n;return((n=this._activeTextures[t])==null?void 0:n.usageCount)??0}_increaseReferenceCount(t){this._activeTextures[t].usageCount++}_applyFilters(t,n){const i=this._renderer.renderTarget.renderTarget,r=this._renderer.filter.generateFilteredTexture({texture:t,filters:n});return this._renderer.renderTarget.bind(i,!1),r}destroy(){this._renderer=null;for(const t in this._activeTextures)this._activeTextures[t]&&this.returnTexture(this._activeTextures[t].texture);this._activeTextures=null}}class wM extends EM{constructor(t){super(t,!0)}}wM.extension={type:[kt.CanvasSystem],name:"canvasText"};class TM extends EM{constructor(t){super(t,!1)}}TM.extension={type:[kt.WebGLSystem,kt.WebGPUSystem],name:"canvasText"};li.add(wM);li.add(TM);li.add(SM);class ax extends pB{constructor(...t){const n=mB(t,"Text");super(n,_d),this.renderPipeId="text",n.textureStyle&&(this.textureStyle=n.textureStyle instanceof lh?n.textureStyle:new lh(n.textureStyle)),this.autoGenerateMipmaps=n.autoGenerateMipmaps??Is.defaultOptions.autoGenerateMipmaps}updateBounds(){const t=this._bounds,n=this._anchor;let i=0,r=0;if(this._style.trim){const{frame:s,canvasAndContext:l}=Qf.getCanvasAndContext({text:this.text,style:this._style,resolution:1});Qf.returnCanvasAndContext(l),i=s.width,r=s.height}else{const s=ru.measureText(this._text,this._style);i=s.width,r=s.height}t.minX=-n._x*i,t.maxX=t.minX+i,t.minY=-n._y*r,t.maxY=t.minY+r}}li.add(xD,bD);var qb={exports:{}},Zo={};/**
310
- * @license React
311
- * react-reconciler-constants.production.js
312
- *
313
- * Copyright (c) Meta Platforms, Inc. and affiliates.
314
- *
315
- * This source code is licensed under the MIT license found in the
316
- * LICENSE file in the root directory of this source tree.
317
- */var Iw;function XB(){return Iw||(Iw=1,Zo.ConcurrentRoot=1,Zo.ContinuousEventPriority=8,Zo.DefaultEventPriority=32,Zo.DiscreteEventPriority=2,Zo.IdleEventPriority=268435456,Zo.LegacyRoot=0,Zo.NoEventPriority=0),Zo}var Uw;function KB(){return Uw||(Uw=1,qb.exports=XB()),qb.exports}var Zf=KB();const y_=L.createContext({}),$B=y_.Provider;y_.Consumer;function CM(e,t){const n=Object.getPrototypeOf(e),i=Object.getOwnPropertyDescriptor(n,t);return!(typeof i>"u"||i.writable||i.set)}const uu={currentUpdatePriority:Zf.DefaultEventPriority,unmountQueue:new Set};function Hw(e,...t){}function AM(e,t={}){const n=e;return n.__pixireact=Object.assign({filters:[],parent:null,root:null,type:""},t),n}var WB="0.0.0-development",QB={version:WB};function ZB(){}function MM(e,t,n){t instanceof Ad&&(t.__pixireact.parent=e,typeof n=="number"?e.__pixireact.filters.splice(n,0,t):e.__pixireact.filters.push(t),e.filters=e.__pixireact.filters)}function Yb(e,t){t&&(t instanceof _r?e.addChild(t):t instanceof Ad&&MM(e,t))}function JB(){}function eL(){return!1}const h1=Object.freeze({onclick:"onClick",onglobalmousemove:"onGlobalMouseMove",onglobalpointermove:"onGlobalPointerMove",onglobaltouchmove:"onGlobalTouchMove",onmousedown:"onMouseDown",onmouseenter:"onMouseEnter",onmouseleave:"onMouseLeave",onmousemove:"onMouseMove",onmouseout:"onMouseOut",onmouseover:"onMouseOver",onmouseup:"onMouseUp",onmouseupoutside:"onMouseUpOutside",onpointercancel:"onPointerCancel",onpointerdown:"onPointerDown",onpointerenter:"onPointerEnter",onpointerleave:"onPointerLeave",onpointermove:"onPointerMove",onpointerout:"onPointerOut",onpointerover:"onPointerOver",onpointertap:"onPointerTap",onpointerup:"onPointerUp",onpointerupoutside:"onPointerUpOutside",onrightclick:"onRightClick",onrightdown:"onRightDown",onrightup:"onRightUp",onrightupoutside:"onRightUpOutside",ontap:"onTap",ontouchcancel:"onTouchCancel",ontouchend:"onTouchEnd",ontouchendoutside:"onTouchEndOutside",ontouchmove:"onTouchMove",ontouchstart:"onTouchStart",onwheel:"onWheel"}),O0=Object.freeze({onClick:"onclick",onGlobalMouseMove:"onglobalmousemove",onGlobalPointerMove:"onglobalpointermove",onGlobalTouchMove:"onglobaltouchmove",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseUpOutside:"onmouseupoutside",onPointerCancel:"onpointercancel",onPointerDown:"onpointerdown",onPointerEnter:"onpointerenter",onPointerLeave:"onpointerleave",onPointerMove:"onpointermove",onPointerOut:"onpointerout",onPointerOver:"onpointerover",onPointerTap:"onpointertap",onPointerUp:"onpointerup",onPointerUpOutside:"onpointerupoutside",onRightClick:"onrightclick",onRightDown:"onrightdown",onRightUp:"onrightup",onRightUpOutside:"onrightupoutside",onTap:"ontap",onTouchCancel:"ontouchcancel",onTouchEnd:"ontouchend",onTouchEndOutside:"ontouchendoutside",onTouchMove:"ontouchmove",onTouchStart:"ontouchstart",onWheel:"onwheel"});function RM(e){return Array.isArray(e)}function kM(e,t,n={arrays:"reference",objects:"reference",strict:!0}){const{arrays:i,objects:r,strict:s}=n;if(typeof e!=typeof t||!!e!=!!t)return!1;if(rL(e)||nL(e))return e===t;const l=iL(e);if(l&&r==="reference")return e===t;const c=RM(e);if(c&&i==="reference")return e===t;if((c||l)&&e===t)return!0;let f;for(f in e)if(!(f in t))return!1;let p=e;if(s&&(p=t),l&&i==="shallow"&&r==="shallow"){for(f in p)if(!kM(e[f],t[f],{strict:s,objects:"reference"}))return!1}else for(f in p)if(e[f]!==t[f])return!1;if(NM(f)){if(c&&e.length===0&&t.length===0||l&&Object.keys(e).length===0&&Object.keys(t).length===0)return!0;if(e!==t)return!1}return!0}function tL(e){return e===null}function nL(e){return typeof e=="number"}function iL(e){return!(e!==Object(e)||RM(e)||typeof e=="function")}function rL(e){return typeof e=="string"}function NM(e){return e===void 0}const aL=Object.freeze(["children","key","ref"]);function sL(e,t=[]){const n={};return Object.entries(e).reduce((i,[r,s])=>(t.includes(r)||(i[r]=s),i),n)}function p1(e,t=[]){return sL(e,aL.concat(t))}const lL="__default";function OM(e,t={},n=!1){const i=p1(e),r=p1(t),s=Object.entries(i),l=[];if(n){const c=Object.keys(r);let f=0;for(;f<c.length;){const p=c[f];!(p in i)&&s.unshift([p,`${lL}remove`]),f+=1}}return s.forEach(([c,f])=>{if(kM(f,r[c]))return;if(c in O0){l.push([c,f,!0,[]]);return}let p=[];c.includes("-")&&(p=c.split("-")),l.push([c,f,!1,p]);for(const m in i){const g=i[m];m.startsWith(`${c}-`)&&l.push([m,g,!1,m.split("-")])}}),{changes:l}}function oL(e){const t=e;return!(!t||!t.changes)}const cL="__default",Pw=new Map,Fw={};function Gw(e,t){if(e){const n=e[t];if(!NM(n)&&!tL(n))return n}return e}function DM(e,t){const{__pixireact:n={},...i}=e;let r;oL(t)?r=t:r=OM(t,i);const{changes:s}=r;let l=0;for(;l<s.length;){const c=s[l];let f=!1,p=c[0],m=c[1];const g=c[2],x=c[3];let v=e,S=v[p];if(p==="draw"&&typeof m=="function"&&(e instanceof Na?m(e):(f=!0,Hw("warn",`The \`draw\` prop was used on a \`${n.type}\` component, but it's only valid on \`graphics\` components.`))),p in h1){const A=p;f=!0,Fw[p]||(Fw[p]=!0,Hw("warn",`Event names must be pascal case; instead of \`${p}\`, you probably want \`${h1[A]}\`.`))}if(!f){if(x.length&&(S=x.reduce(Gw,v),!(S&&S.set))){const[A,...T]=x.reverse();v=T.reverse().reduce(Gw,v),p=A}if(m===`${cL}remove`)if(v instanceof _r){let A=Pw.get(v.constructor);A||(A=v.constructor,A=new A,Pw.set(v.constructor,A)),m=A[p]}else m=0;if(g&&n){const T=O0[p];m?v[T]=m:delete v[T]}else CM(v,p)||(v[p]=m)}l+=1}return e}function uL(e,t,n,i){const{children:r,...s}=i,{children:l,...c}=n,f=OM(s,c,!0);return f.changes.length?f:null}function dL(e,t,n,i){const r=uL(e,t,n,i);r&&DM(e,r)}const fL=Object.freeze([...Object.keys(h1),"draw"]),m1={};function hL(e){const t=e.charAt(0),n=e.substring(1);return`${t.toUpperCase()}${n}`}function pL(e,t){return t.toLowerCase()}function mL(e){let t=e;return e.startsWith("pixi")&&(t=e.replace(/^pixi([A-Z])/,pL)),t}function gL(e,t,n){const i=mL(e),r=hL(i);if(!(r in m1))throw new Error(`${r} is not part of the PIXI namespace! Did you forget to extend?`);const s=m1[r],l=p1(t,fL);Object.entries(t).forEach(([f,p])=>{if(f in O0){const m=O0[f];l[m]=p}});const c=AM(new s(l),{root:n,type:i});return DM(c,t),c}var Vb={exports:{}},Xb={exports:{}},Kb={exports:{}},$b={};/**
318
- * @license React
319
- * scheduler.production.js
320
- *
321
- * Copyright (c) Meta Platforms, Inc. and affiliates.
322
- *
323
- * This source code is licensed under the MIT license found in the
324
- * LICENSE file in the root directory of this source tree.
325
- */var qw;function yL(){return qw||(qw=1,(function(e){function t(z,K){var G=z.length;z.push(K);e:for(;0<G;){var Q=G-1>>>1,I=z[Q];if(0<r(I,K))z[Q]=K,z[G]=I,G=Q;else break e}}function n(z){return z.length===0?null:z[0]}function i(z){if(z.length===0)return null;var K=z[0],G=z.pop();if(G!==K){z[0]=G;e:for(var Q=0,I=z.length,$=I>>>1;Q<$;){var ne=2*(Q+1)-1,X=z[ne],ce=ne+1,ie=z[ce];if(0>r(X,G))ce<I&&0>r(ie,X)?(z[Q]=ie,z[ce]=G,Q=ce):(z[Q]=X,z[ne]=G,Q=ne);else if(ce<I&&0>r(ie,G))z[Q]=ie,z[ce]=G,Q=ce;else break e}}return K}function r(z,K){var G=z.sortIndex-K.sortIndex;return G!==0?G:z.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],p=[],m=1,g=null,x=3,v=!1,S=!1,A=!1,T=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function R(z){for(var K=n(p);K!==null;){if(K.callback===null)i(p);else if(K.startTime<=z)i(p),K.sortIndex=K.expirationTime,t(f,K);else break;K=n(p)}}function O(z){if(A=!1,R(z),!S)if(n(f)!==null)S=!0,P();else{var K=n(p);K!==null&&W(O,K.startTime-z)}}var H=!1,D=-1,q=5,Z=-1;function V(){return!(e.unstable_now()-Z<q)}function Y(){if(H){var z=e.unstable_now();Z=z;var K=!0;try{e:{S=!1,A&&(A=!1,C(D),D=-1),v=!0;var G=x;try{t:{for(R(z),g=n(f);g!==null&&!(g.expirationTime>z&&V());){var Q=g.callback;if(typeof Q=="function"){g.callback=null,x=g.priorityLevel;var I=Q(g.expirationTime<=z);if(z=e.unstable_now(),typeof I=="function"){g.callback=I,R(z),K=!0;break t}g===n(f)&&i(f),R(z)}else i(f);g=n(f)}if(g!==null)K=!0;else{var $=n(p);$!==null&&W(O,$.startTime-z),K=!1}}break e}finally{g=null,x=G,v=!1}K=void 0}}finally{K?F():H=!1}}}var F;if(typeof N=="function")F=function(){N(Y)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,ee=j.port2;j.port1.onmessage=Y,F=function(){ee.postMessage(null)}}else F=function(){T(Y,0)};function P(){H||(H=!0,F())}function W(z,K){D=T(function(){z(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_continueExecution=function(){S||v||(S=!0,P())},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(z){switch(x){case 1:case 2:case 3:var K=3;break;default:K=x}var G=x;x=K;try{return z()}finally{x=G}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,K){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var G=x;x=z;try{return K()}finally{x=G}},e.unstable_scheduleCallback=function(z,K,G){var Q=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?Q+G:Q):G=Q,z){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=G+I,z={id:m++,callback:K,priorityLevel:z,startTime:G,expirationTime:I,sortIndex:-1},G>Q?(z.sortIndex=G,t(p,z),n(f)===null&&z===n(p)&&(A?(C(D),D=-1):A=!0,W(O,G-Q))):(z.sortIndex=I,t(f,z),S||v||(S=!0,P())),z},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(z){var K=x;return function(){var G=x;x=K;try{return z.apply(this,arguments)}finally{x=G}}}})($b)),$b}var Yw;function xL(){return Yw||(Yw=1,Kb.exports=yL()),Kb.exports}/**
326
- * @license React
327
- * react-reconciler.production.js
328
- *
329
- * Copyright (c) Meta Platforms, Inc. and affiliates.
330
- *
331
- * This source code is licensed under the MIT license found in the
332
- * LICENSE file in the root directory of this source tree.
333
- */var Vw;function bL(){return Vw||(Vw=1,(function(e){e.exports=function(t){function n(u,d,b,w){return new Kh(u,d,b,w)}function i(){}function r(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)d+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(u){return u===null||typeof u!="object"?null:(u=tp&&u[tp]||u["@@iterator"],typeof u=="function"?u:null)}function l(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===Bo?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case kc:return"Fragment";case Fa:return"Portal";case ep:return"Profiler";case Jh:return"StrictMode";case Jd:return"Suspense";case Xl:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case bs:return(u.displayName||"Context")+".Provider";case Vl:return(u._context.displayName||"Context")+".Consumer";case Nc:var d=u.render;return u=u.displayName,u||(u=d.displayName||d.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case Du:return d=u.displayName||null,d!==null?d:l(u.type)||"Memo";case Ga:d=u._payload,u=u._init;try{return l(u(d))}catch{}}return null}function c(u){if(ef===void 0)try{throw Error()}catch(b){var d=b.stack.trim().match(/\n( *(at )?)/);ef=d&&d[1]||"",np=-1<b.stack.indexOf(`
334
- at`)?" (<anonymous>)":-1<b.stack.indexOf("@")?"@unknown:0:0":""}return`
335
- `+ef+u+np}function f(u,d){if(!u||Kl)return"";Kl=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var w={DetermineComponentFrameRoot:function(){try{if(d){var Fe=function(){throw Error()};if(Object.defineProperty(Fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Fe,[])}catch(mt){var qe=mt}Reflect.construct(u,[],Fe)}else{try{Fe.call()}catch(mt){qe=mt}u.call(Fe.prototype)}}else{try{throw Error()}catch(mt){qe=mt}(Fe=u())&&typeof Fe.catch=="function"&&Fe.catch(function(){})}}catch(mt){if(mt&&qe&&typeof mt.stack=="string")return[mt.stack,qe.stack]}return[null,null]}};w.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var k=Object.getOwnPropertyDescriptor(w.DetermineComponentFrameRoot,"name");k&&k.configurable&&Object.defineProperty(w.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var B=w.DetermineComponentFrameRoot(),te=B[0],re=B[1];if(te&&re){var pe=te.split(`
336
- `),Ce=re.split(`
337
- `);for(k=w=0;w<pe.length&&!pe[w].includes("DetermineComponentFrameRoot");)w++;for(;k<Ce.length&&!Ce[k].includes("DetermineComponentFrameRoot");)k++;if(w===pe.length||k===Ce.length)for(w=pe.length-1,k=Ce.length-1;1<=w&&0<=k&&pe[w]!==Ce[k];)k--;for(;1<=w&&0<=k;w--,k--)if(pe[w]!==Ce[k]){if(w!==1||k!==1)do if(w--,k--,0>k||pe[w]!==Ce[k]){var De=`
338
- `+pe[w].replace(" at new "," at ");return u.displayName&&De.includes("<anonymous>")&&(De=De.replace("<anonymous>",u.displayName)),De}while(1<=w&&0<=k);break}}}finally{Kl=!1,Error.prepareStackTrace=b}return(b=u?u.displayName||u.name:"")?c(b):""}function p(u){switch(u.tag){case 26:case 27:case 5:return c(u.type);case 16:return c("Lazy");case 13:return c("Suspense");case 19:return c("SuspenseList");case 0:case 15:return u=f(u.type,!1),u;case 11:return u=f(u.type.render,!1),u;case 1:return u=f(u.type,!0),u;default:return""}}function m(u){try{var d="";do d+=p(u),u=u.return;while(u);return d}catch(b){return`
339
- Error generating stack: `+b.message+`
340
- `+b.stack}}function g(u){var d=u,b=u;if(u.alternate)for(;d.return;)d=d.return;else{u=d;do d=u,(d.flags&4098)!==0&&(b=d.return),u=d.return;while(u)}return d.tag===3?b:null}function x(u){if(g(u)!==u)throw Error(r(188))}function v(u){var d=u.alternate;if(!d){if(d=g(u),d===null)throw Error(r(188));return d!==u?null:u}for(var b=u,w=d;;){var k=b.return;if(k===null)break;var B=k.alternate;if(B===null){if(w=k.return,w!==null){b=w;continue}break}if(k.child===B.child){for(B=k.child;B;){if(B===b)return x(k),u;if(B===w)return x(k),d;B=B.sibling}throw Error(r(188))}if(b.return!==w.return)b=k,w=B;else{for(var te=!1,re=k.child;re;){if(re===b){te=!0,b=k,w=B;break}if(re===w){te=!0,w=k,b=B;break}re=re.sibling}if(!te){for(re=B.child;re;){if(re===b){te=!0,b=B,w=k;break}if(re===w){te=!0,w=B,b=k;break}re=re.sibling}if(!te)throw Error(r(189))}}if(b.alternate!==w)throw Error(r(190))}if(b.tag!==3)throw Error(r(188));return b.stateNode.current===b?u:d}function S(u){var d=u.tag;if(d===5||d===26||d===27||d===6)return u;for(u=u.child;u!==null;){if(d=S(u),d!==null)return d;u=u.sibling}return null}function A(u){var d=u.tag;if(d===5||d===26||d===27||d===6)return u;for(u=u.child;u!==null;){if(u.tag!==4&&(d=A(u),d!==null))return d;u=u.sibling}return null}function T(u){return{current:u}}function C(u){0>nl||(u.current=Fu[nl],Fu[nl]=null,nl--)}function N(u,d){nl++,Fu[nl]=u.current,u.current=d}function R(u){return u>>>=0,u===0?32:31-(Gu(u)/ty|0)|0}function O(u){var d=u&42;if(d!==0)return d;switch(u&-u){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: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 u&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return u&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return u}}function H(u,d){var b=u.pendingLanes;if(b===0)return 0;var w=0,k=u.suspendedLanes,B=u.pingedLanes,te=u.warmLanes;u=u.finishedLanes!==0;var re=b&134217727;return re!==0?(b=re&~k,b!==0?w=O(b):(B&=re,B!==0?w=O(B):u||(te=re&~te,te!==0&&(w=O(te))))):(re=b&~k,re!==0?w=O(re):B!==0?w=O(B):u||(te=b&~te,te!==0&&(w=O(te)))),w===0?0:d!==0&&d!==w&&(d&k)===0&&(k=w&-w,te=d&-d,k>=te||k===32&&(te&4194176)!==0)?d:w}function D(u,d){return(u.pendingLanes&~(u.suspendedLanes&~u.pingedLanes)&d)===0}function q(u,d){switch(u){case 1:case 2:case 4:case 8:return d+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return d+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 Z(){var u=Bc;return Bc<<=1,(Bc&4194176)===0&&(Bc=128),u}function V(){var u=qu;return qu<<=1,(qu&62914560)===0&&(qu=4194304),u}function Y(u){for(var d=[],b=0;31>b;b++)d.push(u);return d}function F(u,d){u.pendingLanes|=d,d!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function j(u,d,b,w,k,B){var te=u.pendingLanes;u.pendingLanes=b,u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0,u.expiredLanes&=b,u.entangledLanes&=b,u.errorRecoveryDisabledLanes&=b,u.shellSuspendCounter=0;var re=u.entanglements,pe=u.expirationTimes,Ce=u.hiddenUpdates;for(b=te&~b;0<b;){var De=31-Ar(b),Fe=1<<De;re[De]=0,pe[De]=-1;var qe=Ce[De];if(qe!==null)for(Ce[De]=null,De=0;De<qe.length;De++){var mt=qe[De];mt!==null&&(mt.lane&=-536870913)}b&=~Fe}w!==0&&ee(u,w,0),B!==0&&k===0&&u.tag!==0&&(u.suspendedLanes|=B&~(te&~d))}function ee(u,d,b){u.pendingLanes|=d,u.suspendedLanes&=~d;var w=31-Ar(d);u.entangledLanes|=d,u.entanglements[w]=u.entanglements[w]|1073741824|b&4194218}function P(u,d){var b=u.entangledLanes|=d;for(u=u.entanglements;b;){var w=31-Ar(b),k=1<<w;k&d|u[w]&d&&(u[w]|=d),b&=~k}}function W(u){return u&=-u,2<u?8<u?(u&134217727)!==0?32:268435456:8:2}function z(u){if(Mr&&typeof Mr.onCommitFiberRoot=="function")try{Mr.onCommitFiberRoot(jc,u,void 0,(u.current.flags&128)===128)}catch{}}function K(u){if(typeof ay=="function"&&Dp(u),Mr&&typeof Mr.setStrictMode=="function")try{Mr.setStrictMode(jc,u)}catch{}}function G(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}function Q(u,d){if(typeof u=="object"&&u!==null){var b=xf.get(u);return b!==void 0?b:(d={value:u,source:d,stack:m(d)},xf.set(u,d),d)}return{value:u,source:d,stack:m(d)}}function I(u,d){Dn[Vn++]=Xu,Dn[Vn++]=Vu,Vu=u,Xu=d}function $(u,d,b){Qr[Zr++]=ws,Qr[Zr++]=_a,Qr[Zr++]=qa,qa=u;var w=ws;u=_a;var k=32-Ar(w)-1;w&=~(1<<k),b+=1;var B=32-Ar(d)+k;if(30<B){var te=k-k%5;B=(w&(1<<te)-1).toString(32),w>>=te,k-=te,ws=1<<32-Ar(d)+k|b<<k|w,_a=B+u}else ws=1<<B|b<<k|w,_a=u}function ne(u){u.return!==null&&(I(u,1),$(u,1,0))}function X(u){for(;u===Vu;)Vu=Dn[--Vn],Dn[Vn]=null,Xu=Dn[--Vn],Dn[Vn]=null;for(;u===qa;)qa=Qr[--Zr],Qr[Zr]=null,_a=Qr[--Zr],Qr[Zr]=null,ws=Qr[--Zr],Qr[Zr]=null}function ce(u,d){N(Ya,d),N(Ku,u),N(Oi,null),u=Lo(d),C(Oi),N(Oi,u)}function ie(){C(Oi),C(Ku),C(Ya)}function de(u){u.memoizedState!==null&&N(Ic,u);var d=Oi.current,b=zg(d,u.type);d!==b&&(N(Ku,u),N(Oi,b))}function xe(u){Ku.current===u&&(C(Oi),C(Ku)),Ic.current===u&&(C(Ic),_s?dt._currentValue=Cr:dt._currentValue2=Cr)}function me(u){var d=Error(r(418,""));throw He(Q(d,u)),$u}function le(u,d){if(!pr)throw Error(r(175));Rx(u.stateNode,u.type,u.memoizedProps,d,u)||me(u)}function Re(u){for(Ji=u.return;Ji;)switch(Ji.tag){case 3:case 27:Sa=!0;return;case 5:case 13:Sa=!1;return;default:Ji=Ji.return}}function je(u){if(!pr||u!==Ji)return!1;if(!Gt)return Re(u),Gt=!0,!1;var d=!1;if(Hi?u.tag!==3&&u.tag!==27&&(u.tag!==5||Wg(u.type)&&!Ql(u.type,u.memoizedProps))&&(d=!0):u.tag!==3&&(u.tag!==5||Wg(u.type)&&!Ql(u.type,u.memoizedProps))&&(d=!0),d&&Fi&&me(u),Re(u),u.tag===13){if(!pr)throw Error(r(316));if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));Fi=Kg(u)}else Fi=Ji?vp(u.stateNode):null;return!0}function Ie(){pr&&(Fi=Ji=null,Gt=!1)}function He(u){Jr===null?Jr=[u]:Jr.push(u)}function Qe(){for(var u=Jl,d=Uc=Jl=0;d<u;){var b=ea[d];ea[d++]=null;var w=ea[d];ea[d++]=null;var k=ea[d];ea[d++]=null;var B=ea[d];if(ea[d++]=null,w!==null&&k!==null){var te=w.pending;te===null?k.next=k:(k.next=te.next,te.next=k),w.pending=k}B!==0&&_n(b,k,B)}}function ot(u,d,b,w){ea[Jl++]=u,ea[Jl++]=d,ea[Jl++]=b,ea[Jl++]=w,Uc|=w,u.lanes|=w,u=u.alternate,u!==null&&(u.lanes|=w)}function Ue(u,d,b,w){return ot(u,d,b,w),Sn(u)}function wt(u,d){return ot(u,null,null,d),Sn(u)}function _n(u,d,b){u.lanes|=b;var w=u.alternate;w!==null&&(w.lanes|=b);for(var k=!1,B=u.return;B!==null;)B.childLanes|=b,w=B.alternate,w!==null&&(w.childLanes|=b),B.tag===22&&(u=B.stateNode,u===null||u._visibility&1||(k=!0)),u=B,B=B.return;k&&d!==null&&u.tag===3&&(B=u.stateNode,k=31-Ar(b),B=B.hiddenUpdates,u=B[k],u===null?B[k]=[d]:u.push(d),d.lane=b|536870912)}function Sn(u){if(50<Xo)throw Xo=0,yr=null,Error(r(185));for(var d=u.return;d!==null;)u=d,d=u.return;return u.tag===3?u.stateNode:null}function hn(u){u!==Ho&&u.next===null&&(Ho===null?Hc=Ho=u:Ho=Ho.next=u),Qu=!0,Wu||(Wu=!0,Ee(Ur))}function oi(u,d){if(!Va&&Qu){Va=!0;do for(var b=!1,w=Hc;w!==null;){if(u!==0){var k=w.pendingLanes;if(k===0)var B=0;else{var te=w.suspendedLanes,re=w.pingedLanes;B=(1<<31-Ar(42|u)+1)-1,B&=k&~(te&~re),B=B&201326677?B&201326677|1:B?B|2:0}B!==0&&(b=!0,sr(w,B))}else B=Tt,B=H(w,w===Rt?B:0),(B&3)===0||D(w,B)||(b=!0,sr(w,B));w=w.next}while(b);Va=!1}}function Ur(){Qu=Wu=!1;var u=0;eo!==0&&(Zl()&&(u=eo),eo=0);for(var d=Pi(),b=null,w=Hc;w!==null;){var k=w.next,B=Ci(w,d);B===0?(w.next=null,b===null?Hc=k:b.next=k,k===null&&(Ho=b)):(b=w,(u!==0||(B&3)!==0)&&(Qu=!0)),w=k}oi(u)}function Ci(u,d){for(var b=u.suspendedLanes,w=u.pingedLanes,k=u.expirationTimes,B=u.pendingLanes&-62914561;0<B;){var te=31-Ar(B),re=1<<te,pe=k[te];pe===-1?((re&b)===0||(re&w)!==0)&&(k[te]=q(re,d)):pe<=d&&(u.expiredLanes|=re),B&=~re}if(d=Rt,b=Tt,b=H(u,u===d?b:0),w=u.callbackNode,b===0||u===d&&xn===2||u.cancelPendingCommit!==null)return w!==null&&w!==null&&Yu(w),u.callbackNode=null,u.callbackPriority=0;if((b&3)===0||D(u,b)){if(d=b&-b,d===u.callbackPriority)return d;switch(w!==null&&Yu(w),W(b)){case 2:case 8:b=ry;break;case 32:b=gf;break;case 268435456:b=yf;break;default:b=gf}return w=Wt.bind(null,u),b=Lc(b,w),u.callbackPriority=d,u.callbackNode=b,d}return w!==null&&w!==null&&Yu(w),u.callbackPriority=2,u.callbackNode=null,2}function Wt(u,d){var b=u.callbackNode;if(ki()&&u.callbackNode!==b)return null;var w=Tt;return w=H(u,u===Rt?w:0),w===0?null:(Mu(u,w,d),Ci(u,Pi()),u.callbackNode!=null&&u.callbackNode===b?Wt.bind(null,u):null)}function sr(u,d){if(ki())return null;Mu(u,d,!0)}function Ee(u){fi?af(function(){(et&6)!==0?Lc(Op,u):u()}):Lc(Op,u)}function ke(){return eo===0&&(eo=Z()),eo}function oe(u,d){if(Zu===null){var b=Zu=[];bf=0,Rr=ke(),to={status:"pending",value:void 0,then:function(w){b.push(w)}}}return bf++,d.then(Pe,Pe),d}function Pe(){if(--bf===0&&Zu!==null){to!==null&&(to.status="fulfilled");var u=Zu;Zu=null,Rr=0,to=null;for(var d=0;d<u.length;d++)(0,u[d])()}}function ct(u,d){var b=[],w={status:"pending",value:null,reason:null,then:function(k){b.push(k)}};return u.then(function(){w.status="fulfilled",w.value=d;for(var k=0;k<b.length;k++)(0,b[k])(d)},function(k){for(w.status="rejected",w.reason=k,k=0;k<b.length;k++)(0,b[k])(void 0)}),w}function tn(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ci(u,d){u=u.updateQueue,d.updateQueue===u&&(d.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,callbacks:null})}function Qt(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function Zt(u,d,b){var w=u.updateQueue;if(w===null)return null;if(w=w.shared,(et&2)!==0){var k=w.pending;return k===null?d.next=d:(d.next=k.next,k.next=d),w.pending=d,d=Sn(u),_n(u,null,b),d}return ot(u,w,d,b),Sn(u)}function Gn(u,d,b){if(d=d.updateQueue,d!==null&&(d=d.shared,(b&4194176)!==0)){var w=d.lanes;w&=u.pendingLanes,b|=w,d.lanes=b,P(u,b)}}function Pt(u,d){var b=u.updateQueue,w=u.alternate;if(w!==null&&(w=w.updateQueue,b===w)){var k=null,B=null;if(b=b.firstBaseUpdate,b!==null){do{var te={lane:b.lane,tag:b.tag,payload:b.payload,callback:null,next:null};B===null?k=B=te:B=B.next=te,b=b.next}while(b!==null);B===null?k=B=d:B=B.next=d}else k=B=d;b={baseState:w.baseState,firstBaseUpdate:k,lastBaseUpdate:B,shared:w.shared,callbacks:w.callbacks},u.updateQueue=b;return}u=b.lastBaseUpdate,u===null?b.firstBaseUpdate=d:u.next=d,b.lastBaseUpdate=d}function Yi(){if(Pc){var u=to;if(u!==null)throw u}}function Jn(u,d,b,w){Pc=!1;var k=u.updateQueue;il=!1;var B=k.firstBaseUpdate,te=k.lastBaseUpdate,re=k.shared.pending;if(re!==null){k.shared.pending=null;var pe=re,Ce=pe.next;pe.next=null,te===null?B=Ce:te.next=Ce,te=pe;var De=u.alternate;De!==null&&(De=De.updateQueue,re=De.lastBaseUpdate,re!==te&&(re===null?De.firstBaseUpdate=Ce:re.next=Ce,De.lastBaseUpdate=pe))}if(B!==null){var Fe=k.baseState;te=0,De=Ce=pe=null,re=B;do{var qe=re.lane&-536870913,mt=qe!==re.lane;if(mt?(Tt&qe)===qe:(w&qe)===qe){qe!==0&&qe===Rr&&(Pc=!0),De!==null&&(De=De.next={lane:0,tag:re.tag,payload:re.payload,callback:null,next:null});e:{var Dr=u,nd=re;qe=d;var Ko=b;switch(nd.tag){case 1:if(Dr=nd.payload,typeof Dr=="function"){Fe=Dr.call(Ko,Fe,qe);break e}Fe=Dr;break e;case 3:Dr.flags=Dr.flags&-65537|128;case 0:if(Dr=nd.payload,qe=typeof Dr=="function"?Dr.call(Ko,Fe,qe):Dr,qe==null)break e;Fe=zo({},Fe,qe);break e;case 2:il=!0}}qe=re.callback,qe!==null&&(u.flags|=64,mt&&(u.flags|=8192),mt=k.callbacks,mt===null?k.callbacks=[qe]:mt.push(qe))}else mt={lane:qe,tag:re.tag,payload:re.payload,callback:re.callback,next:null},De===null?(Ce=De=mt,pe=Fe):De=De.next=mt,te|=qe;if(re=re.next,re===null){if(re=k.shared.pending,re===null)break;mt=re,re=mt.next,mt.next=null,k.lastBaseUpdate=mt,k.shared.pending=null}}while(!0);De===null&&(pe=Fe),k.baseState=pe,k.firstBaseUpdate=Ce,k.lastBaseUpdate=De,B===null&&(k.shared.lanes=0),ra|=te,u.lanes=te,u.memoizedState=Fe}}function vo(u,d){if(typeof u!="function")throw Error(r(191,u));u.call(d)}function ls(u,d){var b=u.callbacks;if(b!==null)for(u.callbacks=null,u=0;u<b.length;u++)vo(b[u],d)}function Ba(u,d){if(Wr(u,d))return!0;if(typeof u!="object"||u===null||typeof d!="object"||d===null)return!1;var b=Object.keys(u),w=Object.keys(d);if(b.length!==w.length)return!1;for(w=0;w<b.length;w++){var k=b[w];if(!Ju.call(d,k)||!Wr(u[k],d[k]))return!1}return!0}function os(u){return u=u.status,u==="fulfilled"||u==="rejected"}function vi(){}function se(u,d,b){switch(b=u[b],b===void 0?u.push(d):b!==d&&(d.then(vi,vi),d=b),d.status){case"fulfilled":return d.value;case"rejected":throw u=d.reason,u===mn?Error(r(483)):u;default:if(typeof d.status=="string")d.then(vi,vi);else{if(u=Rt,u!==null&&100<u.shellSuspendCounter)throw Error(r(482));u=d,u.status="pending",u.then(function(w){if(d.status==="pending"){var k=d;k.status="fulfilled",k.value=w}},function(w){if(d.status==="pending"){var k=d;k.status="rejected",k.reason=w}})}switch(d.status){case"fulfilled":return d.value;case"rejected":throw u=d.reason,u===mn?Error(r(483)):u}throw Po=d,mn}}function Te(){if(Po===null)throw Error(r(459));var u=Po;return Po=null,u}function Le(u){var d=Ea;return Ea+=1,Ts===null&&(Ts=[]),se(Ts,u,d)}function tt(u,d){d=d.props.ref,u.ref=d!==void 0?d:null}function nn(u,d){throw d.$$typeof===Zh?Error(r(525)):(u=Object.prototype.toString.call(d),Error(r(31,u==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":u)))}function rn(u){var d=u._init;return d(u._payload)}function Ye(u){function d(be,fe){if(u){var _e=be.deletions;_e===null?(be.deletions=[fe],be.flags|=16):_e.push(fe)}}function b(be,fe){if(!u)return null;for(;fe!==null;)d(be,fe),fe=fe.sibling;return null}function w(be){for(var fe=new Map;be!==null;)be.key!==null?fe.set(be.key,be):fe.set(be.index,be),be=be.sibling;return fe}function k(be,fe){return be=Qi(be,fe),be.index=0,be.sibling=null,be}function B(be,fe,_e){return be.index=_e,u?(_e=be.alternate,_e!==null?(_e=_e.index,_e<fe?(be.flags|=33554434,fe):_e):(be.flags|=33554434,fe)):(be.flags|=1048576,fe)}function te(be){return u&&be.alternate===null&&(be.flags|=33554434),be}function re(be,fe,_e,Oe){return fe===null||fe.tag!==6?(fe=Yl(_e,be.mode,Oe),fe.return=be,fe):(fe=k(fe,_e),fe.return=be,fe)}function pe(be,fe,_e,Oe){var Ze=_e.type;return Ze===kc?De(be,fe,_e.props.children,Oe,_e.key):fe!==null&&(fe.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===Ga&&rn(Ze)===fe.type)?(fe=k(fe,_e.props),tt(fe,_e),fe.return=be,fe):(fe=ba(_e.type,_e.key,_e.props,null,be.mode,Oe),tt(fe,_e),fe.return=be,fe)}function Ce(be,fe,_e,Oe){return fe===null||fe.tag!==4||fe.stateNode.containerInfo!==_e.containerInfo||fe.stateNode.implementation!==_e.implementation?(fe=Rc(_e,be.mode,Oe),fe.return=be,fe):(fe=k(fe,_e.children||[]),fe.return=be,fe)}function De(be,fe,_e,Oe,Ze){return fe===null||fe.tag!==7?(fe=Qs(_e,be.mode,Oe,Ze),fe.return=be,fe):(fe=k(fe,_e),fe.return=be,fe)}function Fe(be,fe,_e){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return fe=Yl(""+fe,be.mode,_e),fe.return=be,fe;if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case Zs:return _e=ba(fe.type,fe.key,fe.props,null,be.mode,_e),tt(_e,fe),_e.return=be,_e;case Fa:return fe=Rc(fe,be.mode,_e),fe.return=be,fe;case Ga:var Oe=fe._init;return fe=Oe(fe._payload),Fe(be,fe,_e)}if($l(fe)||s(fe))return fe=Qs(fe,be.mode,_e,null),fe.return=be,fe;if(typeof fe.then=="function")return Fe(be,Le(fe),_e);if(fe.$$typeof===bs)return Fe(be,Eu(be,fe),_e);nn(be,fe)}return null}function qe(be,fe,_e,Oe){var Ze=fe!==null?fe.key:null;if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return Ze!==null?null:re(be,fe,""+_e,Oe);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case Zs:return _e.key===Ze?pe(be,fe,_e,Oe):null;case Fa:return _e.key===Ze?Ce(be,fe,_e,Oe):null;case Ga:return Ze=_e._init,_e=Ze(_e._payload),qe(be,fe,_e,Oe)}if($l(_e)||s(_e))return Ze!==null?null:De(be,fe,_e,Oe,null);if(typeof _e.then=="function")return qe(be,fe,Le(_e),Oe);if(_e.$$typeof===bs)return qe(be,fe,Eu(be,_e),Oe);nn(be,_e)}return null}function mt(be,fe,_e,Oe,Ze){if(typeof Oe=="string"&&Oe!==""||typeof Oe=="number"||typeof Oe=="bigint")return be=be.get(_e)||null,re(fe,be,""+Oe,Ze);if(typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case Zs:return be=be.get(Oe.key===null?_e:Oe.key)||null,pe(fe,be,Oe,Ze);case Fa:return be=be.get(Oe.key===null?_e:Oe.key)||null,Ce(fe,be,Oe,Ze);case Ga:var wn=Oe._init;return Oe=wn(Oe._payload),mt(be,fe,_e,Oe,Ze)}if($l(Oe)||s(Oe))return be=be.get(_e)||null,De(fe,be,Oe,Ze,null);if(typeof Oe.then=="function")return mt(be,fe,_e,Le(Oe),Ze);if(Oe.$$typeof===bs)return mt(be,fe,_e,Eu(fe,Oe),Ze);nn(fe,Oe)}return null}function Dr(be,fe,_e,Oe){for(var Ze=null,wn=null,ft=fe,Yt=fe=0,wi=null;ft!==null&&Yt<_e.length;Yt++){ft.index>Yt?(wi=ft,ft=null):wi=ft.sibling;var Vt=qe(be,ft,_e[Yt],Oe);if(Vt===null){ft===null&&(ft=wi);break}u&&ft&&Vt.alternate===null&&d(be,ft),fe=B(Vt,fe,Yt),wn===null?Ze=Vt:wn.sibling=Vt,wn=Vt,ft=wi}if(Yt===_e.length)return b(be,ft),Gt&&I(be,Yt),Ze;if(ft===null){for(;Yt<_e.length;Yt++)ft=Fe(be,_e[Yt],Oe),ft!==null&&(fe=B(ft,fe,Yt),wn===null?Ze=ft:wn.sibling=ft,wn=ft);return Gt&&I(be,Yt),Ze}for(ft=w(ft);Yt<_e.length;Yt++)wi=mt(ft,be,Yt,_e[Yt],Oe),wi!==null&&(u&&wi.alternate!==null&&ft.delete(wi.key===null?Yt:wi.key),fe=B(wi,fe,Yt),wn===null?Ze=wi:wn.sibling=wi,wn=wi);return u&&ft.forEach(function(ul){return d(be,ul)}),Gt&&I(be,Yt),Ze}function nd(be,fe,_e,Oe){if(_e==null)throw Error(r(151));for(var Ze=null,wn=null,ft=fe,Yt=fe=0,wi=null,Vt=_e.next();ft!==null&&!Vt.done;Yt++,Vt=_e.next()){ft.index>Yt?(wi=ft,ft=null):wi=ft.sibling;var ul=qe(be,ft,Vt.value,Oe);if(ul===null){ft===null&&(ft=wi);break}u&&ft&&ul.alternate===null&&d(be,ft),fe=B(ul,fe,Yt),wn===null?Ze=ul:wn.sibling=ul,wn=ul,ft=wi}if(Vt.done)return b(be,ft),Gt&&I(be,Yt),Ze;if(ft===null){for(;!Vt.done;Yt++,Vt=_e.next())Vt=Fe(be,Vt.value,Oe),Vt!==null&&(fe=B(Vt,fe,Yt),wn===null?Ze=Vt:wn.sibling=Vt,wn=Vt);return Gt&&I(be,Yt),Ze}for(ft=w(ft);!Vt.done;Yt++,Vt=_e.next())Vt=mt(ft,be,Yt,Vt.value,Oe),Vt!==null&&(u&&Vt.alternate!==null&&ft.delete(Vt.key===null?Yt:Vt.key),fe=B(Vt,fe,Yt),wn===null?Ze=Vt:wn.sibling=Vt,wn=Vt);return u&&ft.forEach(function(Mf){return d(be,Mf)}),Gt&&I(be,Yt),Ze}function Ko(be,fe,_e,Oe){if(typeof _e=="object"&&_e!==null&&_e.type===kc&&_e.key===null&&(_e=_e.props.children),typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case Zs:e:{for(var Ze=_e.key;fe!==null;){if(fe.key===Ze){if(Ze=_e.type,Ze===kc){if(fe.tag===7){b(be,fe.sibling),Oe=k(fe,_e.props.children),Oe.return=be,be=Oe;break e}}else if(fe.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===Ga&&rn(Ze)===fe.type){b(be,fe.sibling),Oe=k(fe,_e.props),tt(Oe,_e),Oe.return=be,be=Oe;break e}b(be,fe);break}else d(be,fe);fe=fe.sibling}_e.type===kc?(Oe=Qs(_e.props.children,be.mode,Oe,_e.key),Oe.return=be,be=Oe):(Oe=ba(_e.type,_e.key,_e.props,null,be.mode,Oe),tt(Oe,_e),Oe.return=be,be=Oe)}return te(be);case Fa:e:{for(Ze=_e.key;fe!==null;){if(fe.key===Ze)if(fe.tag===4&&fe.stateNode.containerInfo===_e.containerInfo&&fe.stateNode.implementation===_e.implementation){b(be,fe.sibling),Oe=k(fe,_e.children||[]),Oe.return=be,be=Oe;break e}else{b(be,fe);break}else d(be,fe);fe=fe.sibling}Oe=Rc(_e,be.mode,Oe),Oe.return=be,be=Oe}return te(be);case Ga:return Ze=_e._init,_e=Ze(_e._payload),Ko(be,fe,_e,Oe)}if($l(_e))return Dr(be,fe,_e,Oe);if(s(_e)){if(Ze=s(_e),typeof Ze!="function")throw Error(r(150));return _e=Ze.call(_e),nd(be,fe,_e,Oe)}if(typeof _e.then=="function")return Ko(be,fe,Le(_e),Oe);if(_e.$$typeof===bs)return Ko(be,fe,Eu(be,_e),Oe);nn(be,_e)}return typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint"?(_e=""+_e,fe!==null&&fe.tag===6?(b(be,fe.sibling),Oe=k(fe,_e),Oe.return=be,be=Oe):(b(be,fe),Oe=Yl(_e,be.mode,Oe),Oe.return=be,be=Oe),te(be)):b(be,fe)}return function(be,fe,_e,Oe){try{Ea=0;var Ze=Ko(be,fe,_e,Oe);return Ts=null,Ze}catch(ft){if(ft===mn)throw ft;var wn=n(29,ft,null,be.mode);return wn.lanes=Oe,wn.return=be,wn}finally{}}}function Ge(u,d){u=Xa,N(ta,u),N(Cs,d),Xa=u|d.baseLanes}function nt(){N(ta,Xa),N(Cs,Cs.current)}function Rn(){Xa=ta.current,C(Cs),C(ta)}function Ft(u){var d=u.alternate;N(hi,hi.current&1),N(na,u),wa===null&&(d===null||Cs.current!==null||d.memoizedState!==null)&&(wa=u)}function ga(u){if(u.tag===22){if(N(hi,hi.current),N(na,u),wa===null){var d=u.alternate;d!==null&&d.memoizedState!==null&&(wa=u)}}else lr()}function lr(){N(hi,hi.current),N(na,na.current)}function Vi(u){C(na),wa===u&&(wa=null),C(hi)}function or(u){for(var d=u;d!==null;){if(d.tag===13){var b=d.memoizedState;if(b!==null&&(b=b.dehydrated,b===null||uf(b)||Pu(b)))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===u)break;for(;d.sibling===null;){if(d.return===null||d.return===u)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}function bt(){throw Error(r(321))}function ui(u,d){if(d===null)return!1;for(var b=0;b<d.length&&b<u.length;b++)if(!Wr(u[b],d[b]))return!1;return!0}function Hr(u,d,b,w,k,B){return As=B,St=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,at.H=u===null||u.memoizedState===null?pi:er,rl=!1,B=b(w,k),rl=!1,zn&&(B=Cl(d,b,w,k)),Us(u),B}function Us(u){at.H=qt;var d=Jt!==null&&Jt.next!==null;if(As=0,ti=Jt=St=null,Ta=!1,Xn=0,Fc=null,d)throw Error(r(300));u===null||ni||(u=u.dependencies,u!==null&&zl(u)&&(ni=!0))}function Cl(u,d,b,w){St=u;var k=0;do{if(zn&&(Fc=null),Xn=0,zn=!1,25<=k)throw Error(r(301));if(k+=1,ti=Jt=null,u.updateQueue!=null){var B=u.updateQueue;B.lastEffect=null,B.events=null,B.stores=null,B.memoCache!=null&&(B.memoCache.index=0)}at.H=io,B=d(b,w)}while(zn);return B}function Al(){var u=at.H,d=u.useState()[0];return d=typeof d.then=="function"?cr(d):d,u=u.useState()[0],(Jt!==null?Jt.memoizedState:null)!==u&&(St.flags|=1024),d}function Ml(){var u=ed!==0;return ed=0,u}function La(u,d,b){d.updateQueue=u.updateQueue,d.flags&=-2053,u.lanes&=~b}function Hs(u){if(Ta){for(u=u.memoizedState;u!==null;){var d=u.queue;d!==null&&(d.pending=null),u=u.next}Ta=!1}As=0,ti=Jt=St=null,zn=!1,Xn=ed=0,Fc=null}function an(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ti===null?St.memoizedState=ti=u:ti=ti.next=u,ti}function sn(){if(Jt===null){var u=St.alternate;u=u!==null?u.memoizedState:null}else u=Jt.next;var d=ti===null?St.memoizedState:ti.next;if(d!==null)ti=d,Jt=u;else{if(u===null)throw St.alternate===null?Error(r(467)):Error(r(310));Jt=u,u={memoizedState:Jt.memoizedState,baseState:Jt.baseState,baseQueue:Jt.baseQueue,queue:Jt.queue,next:null},ti===null?St.memoizedState=ti=u:ti=ti.next=u}return ti}function cr(u){var d=Xn;return Xn+=1,Fc===null&&(Fc=[]),u=se(Fc,u,d),d=St,(ti===null?d.memoizedState:ti.next)===null&&(d=d.alternate,at.H=d===null||d.memoizedState===null?pi:er),u}function Pr(u){if(u!==null&&typeof u=="object"){if(typeof u.then=="function")return cr(u);if(u.$$typeof===bs)return ji(u)}throw Error(r(438,String(u)))}function jn(u){var d=null,b=St.updateQueue;if(b!==null&&(d=b.memoCache),d==null){var w=St.alternate;w!==null&&(w=w.updateQueue,w!==null&&(w=w.memoCache,w!=null&&(d={data:w.data.map(function(k){return k.slice()}),index:0})))}if(d==null&&(d={data:[],index:0}),b===null&&(b=_f(),St.updateQueue=b),b.memoCache=d,b=d.data[d.index],b===void 0)for(b=d.data[d.index]=Array(u),w=0;w<u;w++)b[w]=Dg;return d.index++,b}function Sr(u,d){return typeof d=="function"?d(u):d}function ya(u){var d=sn();return Fr(d,Jt,u)}function Fr(u,d,b){var w=u.queue;if(w===null)throw Error(r(311));w.lastRenderedReducer=b;var k=u.baseQueue,B=w.pending;if(B!==null){if(k!==null){var te=k.next;k.next=B.next,B.next=te}d.baseQueue=k=B,w.pending=null}if(B=u.baseState,k===null)u.memoizedState=B;else{d=k.next;var re=te=null,pe=null,Ce=d,De=!1;do{var Fe=Ce.lane&-536870913;if(Fe!==Ce.lane?(Tt&Fe)===Fe:(As&Fe)===Fe){var qe=Ce.revertLane;if(qe===0)pe!==null&&(pe=pe.next={lane:0,revertLane:0,action:Ce.action,hasEagerState:Ce.hasEagerState,eagerState:Ce.eagerState,next:null}),Fe===Rr&&(De=!0);else if((As&qe)===qe){Ce=Ce.next,qe===Rr&&(De=!0);continue}else Fe={lane:0,revertLane:Ce.revertLane,action:Ce.action,hasEagerState:Ce.hasEagerState,eagerState:Ce.eagerState,next:null},pe===null?(re=pe=Fe,te=B):pe=pe.next=Fe,St.lanes|=qe,ra|=qe;Fe=Ce.action,rl&&b(B,Fe),B=Ce.hasEagerState?Ce.eagerState:b(B,Fe)}else qe={lane:Fe,revertLane:Ce.revertLane,action:Ce.action,hasEagerState:Ce.hasEagerState,eagerState:Ce.eagerState,next:null},pe===null?(re=pe=qe,te=B):pe=pe.next=qe,St.lanes|=Fe,ra|=Fe;Ce=Ce.next}while(Ce!==null&&Ce!==d);if(pe===null?te=B:pe.next=re,!Wr(B,u.memoizedState)&&(ni=!0,De&&(b=to,b!==null)))throw b;u.memoizedState=B,u.baseState=te,u.baseQueue=pe,w.lastRenderedState=B}return k===null&&(w.lanes=0),[u.memoizedState,w.dispatch]}function Ne(u){var d=sn(),b=d.queue;if(b===null)throw Error(r(311));b.lastRenderedReducer=u;var w=b.dispatch,k=b.pending,B=d.memoizedState;if(k!==null){b.pending=null;var te=k=k.next;do B=u(B,te.action),te=te.next;while(te!==k);Wr(B,d.memoizedState)||(ni=!0),d.memoizedState=B,d.baseQueue===null&&(d.baseState=B),b.lastRenderedState=B}return[B,w]}function Ke(u,d,b){var w=St,k=sn(),B=Gt;if(B){if(b===void 0)throw Error(r(407));b=b()}else b=d();var te=!Wr((Jt||k).memoizedState,b);if(te&&(k.memoizedState=b,ni=!0),k=k.queue,ds(In.bind(null,w,k,u),[u]),k.getSnapshot!==d||te||ti!==null&&ti.memoizedState.tag&1){if(w.flags|=2048,Ia(9,Xt.bind(null,w,k,b,d),{destroy:void 0},null),Rt===null)throw Error(r(349));B||(As&60)!==0||vt(w,d,b)}return b}function vt(u,d,b){u.flags|=16384,u={getSnapshot:d,value:b},d=St.updateQueue,d===null?(d=_f(),St.updateQueue=d,d.stores=[u]):(b=d.stores,b===null?d.stores=[u]:b.push(u))}function Xt(u,d,b,w){d.value=b,d.getSnapshot=w,_i(d)&&Xi(u)}function In(u,d,b){return b(function(){_i(d)&&Xi(u)})}function _i(u){var d=u.getSnapshot;u=u.value;try{var b=d();return!Wr(u,b)}catch{return!0}}function Xi(u){var d=wt(u,2);d!==null&&Wi(d,u,2)}function Ai(u){var d=an();if(typeof u=="function"){var b=u;if(u=b(),rl){K(!0);try{b()}finally{K(!1)}}}return d.memoizedState=d.baseState=u,d.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:u},d}function pn(u,d,b,w){return u.baseState=b,Fr(u,Jt,typeof w=="function"?w:Sr)}function ur(u,d,b,w,k){if(wo(u))throw Error(r(485));if(u=d.action,u!==null){var B={payload:k,action:u,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(te){B.listeners.push(te)}};at.T!==null?b(!0):B.isTransition=!1,w(B),b=d.pending,b===null?(B.next=d.pending=B,_o(d,B)):(B.next=b.next,d.pending=b.next=B)}}function _o(u,d){var b=d.action,w=d.payload,k=u.state;if(d.isTransition){var B=at.T,te={};at.T=te;try{var re=b(k,w),pe=at.S;pe!==null&&pe(te,re),xa(u,d,re)}catch(Ce){ja(u,d,Ce)}finally{at.T=B}}else try{B=b(k,w),xa(u,d,B)}catch(Ce){ja(u,d,Ce)}}function xa(u,d,b){b!==null&&typeof b=="object"&&typeof b.then=="function"?b.then(function(w){Rl(u,d,w)},function(w){return ja(u,d,w)}):Rl(u,d,b)}function Rl(u,d,b){d.status="fulfilled",d.value=b,fc(d),u.state=b,d=u.pending,d!==null&&(b=d.next,b===d?u.pending=null:(b=b.next,d.next=b,_o(u,b)))}function ja(u,d,b){var w=u.pending;if(u.pending=null,w!==null){w=w.next;do d.status="rejected",d.reason=b,fc(d),d=d.next;while(d!==w)}u.action=null}function fc(u){u=u.listeners;for(var d=0;d<u.length;d++)(0,u[d])()}function Bi(u,d){return d}function cs(u,d){if(Gt){var b=Rt.formState;if(b!==null){e:{var w=St;if(Gt){if(Fi){var k=Hg(Fi,Sa);if(k){Fi=vp(k),w=Pg(k);break e}}me(w)}w=!1}w&&(d=b[0])}}b=an(),b.memoizedState=b.baseState=d,w={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:d},b.queue=w,b=Nd.bind(null,St,w),w.dispatch=b,w=Ai(!1);var B=Od.bind(null,St,!1,w.queue);return w=an(),k={state:d,dispatch:null,action:u,pending:null},w.queue=k,b=ur.bind(null,St,k,B,b),k.dispatch=b,w.memoizedState=u,[d,b,!1]}function us(u){var d=sn();return Ps(d,Jt,u)}function Ps(u,d,b){d=Fr(u,d,Bi)[0],u=ya(Sr)[0],d=typeof d=="object"&&d!==null&&typeof d.then=="function"?cr(d):d;var w=sn(),k=w.queue,B=k.dispatch;return b!==w.memoizedState&&(St.flags|=2048,Ia(9,di.bind(null,k,b),{destroy:void 0},null)),[d,B,u]}function di(u,d){u.action=d}function pu(u){var d=sn(),b=Jt;if(b!==null)return Ps(d,b,u);sn(),d=d.memoizedState,b=sn();var w=b.queue.dispatch;return b.memoizedState=u,[d,w,!1]}function Ia(u,d,b,w){return u={tag:u,create:d,inst:b,deps:w,next:null},d=St.updateQueue,d===null&&(d=_f(),St.updateQueue=d),b=d.lastEffect,b===null?d.lastEffect=u.next=u:(w=b.next,b.next=u,u.next=w,d.lastEffect=u),u}function rt(){return sn().memoizedState}function So(u,d,b,w){var k=an();St.flags|=u,k.memoizedState=Ia(1|d,b,{destroy:void 0},w===void 0?null:w)}function Hn(u,d,b,w){var k=sn();w=w===void 0?null:w;var B=k.memoizedState.inst;Jt!==null&&w!==null&&ui(w,Jt.memoizedState.deps)?k.memoizedState=Ia(d,b,B,w):(St.flags|=u,k.memoizedState=Ia(1|d,b,B,w))}function ln(u,d){So(8390656,8,u,d)}function ds(u,d){Hn(2048,8,u,d)}function fs(u,d){return Hn(4,2,u,d)}function hc(u,d){return Hn(4,4,u,d)}function Fs(u,d){if(typeof d=="function"){u=u();var b=d(u);return function(){typeof b=="function"?b():d(null)}}if(d!=null)return u=u(),d.current=u,function(){d.current=null}}function Be(u,d,b){b=b!=null?b.concat([u]):null,Hn(4,4,Fs.bind(null,d,u),b)}function Ve(){}function yt(u,d){var b=sn();d=d===void 0?null:d;var w=b.memoizedState;return d!==null&&ui(d,w[1])?w[0]:(b.memoizedState=[u,d],u)}function Nt(u,d){var b=sn();d=d===void 0?null:d;var w=b.memoizedState;if(d!==null&&ui(d,w[1]))return w[0];if(w=u(),rl){K(!0);try{u()}finally{K(!1)}}return b.memoizedState=[w,d],w}function kn(u,d,b){return b===void 0||(As&1073741824)!==0?u.memoizedState=d:(u.memoizedState=b,u=ms(),St.lanes|=u,ra|=u,b)}function Gr(u,d,b,w){return Wr(b,d)?b:Cs.current!==null?(u=kn(u,b,w),Wr(u,d)||(ni=!0),u):(As&42)===0?(ni=!0,u.memoizedState=b):(u=ms(),St.lanes|=u,ra|=u,d)}function pc(u,d,b,w,k){var B=Si();Zi(B!==0&&8>B?B:8);var te=at.T,re={};at.T=re,Od(u,!1,d,b);try{var pe=k(),Ce=at.S;if(Ce!==null&&Ce(re,pe),pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var De=ct(pe,w);Nl(u,d,De,hr(u))}else Nl(u,d,w,hr(u))}catch(Fe){Nl(u,d,{then:function(){},status:"rejected",reason:Fe},hr())}finally{Zi(B),at.T=te}}function mu(u){var d=u.memoizedState;if(d!==null)return d;d={memoizedState:Cr,baseState:Cr,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:Cr},next:null};var b={};return d.next={memoizedState:b,baseState:b,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:b},next:null},u.memoizedState=d,u=u.alternate,u!==null&&(u.memoizedState=d),d}function Eo(){return ji(dt)}function hs(){return sn().memoizedState}function kd(){return sn().memoizedState}function gu(u){for(var d=u.return;d!==null;){switch(d.tag){case 24:case 3:var b=hr();u=Qt(b);var w=Zt(d,u,b);w!==null&&(Wi(w,d,b),Gn(w,d,b)),d={cache:jd()},u.payload=d;return}d=d.return}}function kl(u,d,b){var w=hr();b={lane:w,revertLane:0,action:b,hasEagerState:!1,eagerState:null,next:null},wo(u)?yu(d,b):(b=Ue(u,d,b,w),b!==null&&(Wi(b,u,w),Ch(b,d,w)))}function Nd(u,d,b){var w=hr();Nl(u,d,b,w)}function Nl(u,d,b,w){var k={lane:w,revertLane:0,action:b,hasEagerState:!1,eagerState:null,next:null};if(wo(u))yu(d,k);else{var B=u.alternate;if(u.lanes===0&&(B===null||B.lanes===0)&&(B=d.lastRenderedReducer,B!==null))try{var te=d.lastRenderedState,re=B(te,b);if(k.hasEagerState=!0,k.eagerState=re,Wr(re,te))return ot(u,d,k,0),Rt===null&&Qe(),!1}catch{}finally{}if(b=Ue(u,d,k,w),b!==null)return Wi(b,u,w),Ch(b,d,w),!0}return!1}function Od(u,d,b,w){if(w={lane:2,revertLane:ke(),action:w,hasEagerState:!1,eagerState:null,next:null},wo(u)){if(d)throw Error(r(479))}else d=Ue(u,b,w,2),d!==null&&Wi(d,u,2)}function wo(u){var d=u.alternate;return u===St||d!==null&&d===St}function yu(u,d){zn=Ta=!0;var b=u.pending;b===null?d.next=d:(d.next=b.next,b.next=d),u.pending=d}function Ch(u,d,b){if((b&4194176)!==0){var w=d.lanes;w&=u.pendingLanes,b|=w,d.lanes=b,P(u,b)}}function Ki(u,d,b,w){d=u.memoizedState,b=b(w,d),b=b==null?d:zo({},d,b),u.memoizedState=b,u.lanes===0&&(u.updateQueue.baseState=b)}function Ol(u,d,b,w,k,B,te){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(w,B,te):d.prototype&&d.prototype.isPureReactComponent?!Ba(b,w)||!Ba(k,B):!0}function xu(u,d,b,w){u=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(b,w),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(b,w),d.state!==u&&Sf.enqueueReplaceState(d,d.state,null)}function Ua(u,d){var b=d;if("ref"in d){b={};for(var w in d)w!=="ref"&&(b[w]=d[w])}if(u=u.defaultProps){b===d&&(b=zo({},b));for(var k in u)b[k]===void 0&&(b[k]=u[k])}return b}function Dd(u,d){try{var b=u.onUncaughtError;b(d.value,{componentStack:d.stack})}catch(w){setTimeout(function(){throw w})}}function zd(u,d,b){try{var w=u.onCaughtError;w(b.value,{componentStack:b.stack,errorBoundary:d.tag===1?d.stateNode:null})}catch(k){setTimeout(function(){throw k})}}function bu(u,d,b){return b=Qt(b),b.tag=3,b.payload={element:null},b.callback=function(){Dd(u,d)},b}function mc(u){return u=Qt(u),u.tag=3,u}function vu(u,d,b,w){var k=b.type.getDerivedStateFromError;if(typeof k=="function"){var B=w.value;u.payload=function(){return k(B)},u.callback=function(){zd(d,b,w)}}var te=b.stateNode;te!==null&&typeof te.componentDidCatch=="function"&&(u.callback=function(){zd(d,b,w),typeof k!="function"&&(sa===null?sa=new Set([this]):sa.add(this));var re=w.stack;this.componentDidCatch(w.value,{componentStack:re!==null?re:""})})}function ug(u,d,b,w,k){if(b.flags|=32768,w!==null&&typeof w=="object"&&typeof w.then=="function"){if(d=b.alternate,d!==null&&To(d,b,k,!0),b=na.current,b!==null){switch(b.tag){case 13:return wa===null?Tr():b.alternate===null&&It===0&&(It=3),b.flags&=-257,b.flags|=65536,b.lanes=k,w===vf?b.flags|=16384:(d=b.updateQueue,d===null?b.updateQueue=new Set([w]):d.add(w),Qd(u,w,k)),!1;case 22:return b.flags|=65536,w===vf?b.flags|=16384:(d=b.updateQueue,d===null?(d={transitions:null,markerInstances:null,retryQueue:new Set([w])},b.updateQueue=d):(b=d.retryQueue,b===null?d.retryQueue=new Set([w]):b.add(w)),Qd(u,w,k)),!1}throw Error(r(435,b.tag))}return Qd(u,w,k),Tr(),!1}if(Gt)return d=na.current,d!==null?((d.flags&65536)===0&&(d.flags|=256),d.flags|=65536,d.lanes=k,w!==$u&&(u=Error(r(422),{cause:w}),He(Q(u,b)))):(w!==$u&&(d=Error(r(423),{cause:w}),He(Q(d,b))),u=u.current.alternate,u.flags|=65536,k&=-k,u.lanes|=k,w=Q(w,b),k=bu(u.stateNode,w,k),Pt(u,k),It!==4&&(It=2)),!1;var B=Error(r(520),{cause:w});if(B=Q(B,b),qc===null?qc=[B]:qc.push(B),It!==4&&(It=2),d===null)return!0;w=Q(w,b),b=d;do{switch(b.tag){case 3:return b.flags|=65536,u=k&-k,b.lanes|=u,u=bu(b.stateNode,w,u),Pt(b,u),!1;case 1:if(d=b.type,B=b.stateNode,(b.flags&128)===0&&(typeof d.getDerivedStateFromError=="function"||B!==null&&typeof B.componentDidCatch=="function"&&(sa===null||!sa.has(B))))return b.flags|=65536,k&=-k,b.lanes|=k,k=mc(k),vu(k,u,b,w),Pt(b,k),!1}b=b.return}while(b!==null);return!1}function Li(u,d,b,w){d.child=u===null?Bp(d,null,b,w):no(d,u.child,b,w)}function dg(u,d,b,w,k){b=b.render;var B=d.ref;if("ref"in w){var te={};for(var re in w)re!=="ref"&&(te[re]=w[re])}else te=w;return Co(d),w=Hr(u,d,b,te,B,k),re=Ml(),u!==null&&!ni?(La(u,d,k),Gs(u,d,k)):(Gt&&re&&ne(d),d.flags|=1,Li(u,d,w,k),d.child)}function fg(u,d,b,w,k){if(u===null){var B=b.type;return typeof B=="function"&&!$s(B)&&B.defaultProps===void 0&&b.compare===null?(d.tag=15,d.type=B,Bd(u,d,B,w,k)):(u=ba(b.type,null,w,d,d.mode,k),u.ref=d.ref,u.return=d,d.child=u)}if(B=u.child,!Dh(u,k)){var te=B.memoizedProps;if(b=b.compare,b=b!==null?b:Ba,b(te,w)&&u.ref===d.ref)return Gs(u,d,k)}return d.flags|=1,u=Qi(B,w),u.ref=d.ref,u.return=d,d.child=u}function Bd(u,d,b,w,k){if(u!==null){var B=u.memoizedProps;if(Ba(B,w)&&u.ref===d.ref)if(ni=!1,d.pendingProps=w=B,Dh(u,k))(u.flags&131072)!==0&&(ni=!0);else return d.lanes=u.lanes,Gs(u,d,k)}return Ah(u,d,b,w,k)}function hg(u,d,b){var w=d.pendingProps,k=w.children,B=(d.stateNode._pendingVisibility&2)!==0,te=u!==null?u.memoizedState:null;if(_u(u,d),w.mode==="hidden"||B){if((d.flags&128)!==0){if(w=te!==null?te.baseLanes|b:b,u!==null){for(k=d.child=u.child,B=0;k!==null;)B=B|k.lanes|k.childLanes,k=k.sibling;d.childLanes=B&~w}else d.childLanes=0,d.child=null;return pg(u,d,w,b)}if((b&536870912)!==0)d.memoizedState={baseLanes:0,cachePool:null},u!==null&&Id(d,te!==null?te.cachePool:null),te!==null?Ge(d,te):nt(),ga(d);else return d.lanes=d.childLanes=536870912,pg(u,d,te!==null?te.baseLanes|b:b,b)}else te!==null?(Id(d,te.cachePool),Ge(d,te),lr(),d.memoizedState=null):(u!==null&&Id(d,null),nt(),lr());return Li(u,d,k,b),d.child}function pg(u,d,b,w){var k=Bl();return k=k===null?null:{parent:_s?on._currentValue:on._currentValue2,pool:k},d.memoizedState={baseLanes:b,cachePool:k},u!==null&&Id(d,null),nt(),ga(d),u!==null&&To(u,d,w,!0),null}function _u(u,d){var b=d.ref;if(b===null)u!==null&&u.ref!==null&&(d.flags|=2097664);else{if(typeof b!="function"&&typeof b!="object")throw Error(r(284));(u===null||u.ref!==b)&&(d.flags|=2097664)}}function Ah(u,d,b,w,k){return Co(d),b=Hr(u,d,b,w,void 0,k),w=Ml(),u!==null&&!ni?(La(u,d,k),Gs(u,d,k)):(Gt&&w&&ne(d),d.flags|=1,Li(u,d,b,k),d.child)}function mg(u,d,b,w,k,B){return Co(d),d.updateQueue=null,b=Cl(d,w,b,k),Us(u),w=Ml(),u!==null&&!ni?(La(u,d,B),Gs(u,d,B)):(Gt&&w&&ne(d),d.flags|=1,Li(u,d,b,B),d.child)}function Mh(u,d,b,w,k){if(Co(d),d.stateNode===null){var B=Uo,te=b.contextType;typeof te=="object"&&te!==null&&(B=ji(te)),B=new b(w,B),d.memoizedState=B.state!==null&&B.state!==void 0?B.state:null,B.updater=Sf,d.stateNode=B,B._reactInternals=d,B=d.stateNode,B.props=w,B.state=d.memoizedState,B.refs={},tn(d),te=b.contextType,B.context=typeof te=="object"&&te!==null?ji(te):Uo,B.state=d.memoizedState,te=b.getDerivedStateFromProps,typeof te=="function"&&(Ki(d,b,te,w),B.state=d.memoizedState),typeof b.getDerivedStateFromProps=="function"||typeof B.getSnapshotBeforeUpdate=="function"||typeof B.UNSAFE_componentWillMount!="function"&&typeof B.componentWillMount!="function"||(te=B.state,typeof B.componentWillMount=="function"&&B.componentWillMount(),typeof B.UNSAFE_componentWillMount=="function"&&B.UNSAFE_componentWillMount(),te!==B.state&&Sf.enqueueReplaceState(B,B.state,null),Jn(d,w,B,k),Yi(),B.state=d.memoizedState),typeof B.componentDidMount=="function"&&(d.flags|=4194308),w=!0}else if(u===null){B=d.stateNode;var re=d.memoizedProps,pe=Ua(b,re);B.props=pe;var Ce=B.context,De=b.contextType;te=Uo,typeof De=="object"&&De!==null&&(te=ji(De));var Fe=b.getDerivedStateFromProps;De=typeof Fe=="function"||typeof B.getSnapshotBeforeUpdate=="function",re=d.pendingProps!==re,De||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||(re||Ce!==te)&&xu(d,B,w,te),il=!1;var qe=d.memoizedState;B.state=qe,Jn(d,w,B,k),Yi(),Ce=d.memoizedState,re||qe!==Ce||il?(typeof Fe=="function"&&(Ki(d,b,Fe,w),Ce=d.memoizedState),(pe=il||Ol(d,b,pe,w,qe,Ce,te))?(De||typeof B.UNSAFE_componentWillMount!="function"&&typeof B.componentWillMount!="function"||(typeof B.componentWillMount=="function"&&B.componentWillMount(),typeof B.UNSAFE_componentWillMount=="function"&&B.UNSAFE_componentWillMount()),typeof B.componentDidMount=="function"&&(d.flags|=4194308)):(typeof B.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=w,d.memoizedState=Ce),B.props=w,B.state=Ce,B.context=te,w=pe):(typeof B.componentDidMount=="function"&&(d.flags|=4194308),w=!1)}else{B=d.stateNode,ci(u,d),te=d.memoizedProps,De=Ua(b,te),B.props=De,Fe=d.pendingProps,qe=B.context,Ce=b.contextType,pe=Uo,typeof Ce=="object"&&Ce!==null&&(pe=ji(Ce)),re=b.getDerivedStateFromProps,(Ce=typeof re=="function"||typeof B.getSnapshotBeforeUpdate=="function")||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||(te!==Fe||qe!==pe)&&xu(d,B,w,pe),il=!1,qe=d.memoizedState,B.state=qe,Jn(d,w,B,k),Yi();var mt=d.memoizedState;te!==Fe||qe!==mt||il||u!==null&&u.dependencies!==null&&zl(u.dependencies)?(typeof re=="function"&&(Ki(d,b,re,w),mt=d.memoizedState),(De=il||Ol(d,b,De,w,qe,mt,pe)||u!==null&&u.dependencies!==null&&zl(u.dependencies))?(Ce||typeof B.UNSAFE_componentWillUpdate!="function"&&typeof B.componentWillUpdate!="function"||(typeof B.componentWillUpdate=="function"&&B.componentWillUpdate(w,mt,pe),typeof B.UNSAFE_componentWillUpdate=="function"&&B.UNSAFE_componentWillUpdate(w,mt,pe)),typeof B.componentDidUpdate=="function"&&(d.flags|=4),typeof B.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof B.componentDidUpdate!="function"||te===u.memoizedProps&&qe===u.memoizedState||(d.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||te===u.memoizedProps&&qe===u.memoizedState||(d.flags|=1024),d.memoizedProps=w,d.memoizedState=mt),B.props=w,B.state=mt,B.context=pe,w=De):(typeof B.componentDidUpdate!="function"||te===u.memoizedProps&&qe===u.memoizedState||(d.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||te===u.memoizedProps&&qe===u.memoizedState||(d.flags|=1024),w=!1)}return B=w,_u(u,d),w=(d.flags&128)!==0,B||w?(B=d.stateNode,b=w&&typeof b.getDerivedStateFromError!="function"?null:B.render(),d.flags|=1,u!==null&&w?(d.child=no(d,u.child,null,k),d.child=no(d,null,b,k)):Li(u,d,b,k),d.memoizedState=B.state,u=d.child):u=Gs(u,d,k),u}function gg(u,d,b,w){return Ie(),d.flags|=256,Li(u,d,b,w),d.child}function Rh(u){return{baseLanes:u,cachePool:_g()}}function kh(u,d,b){return u=u!==null?u.childLanes&~b:0,d&&(u|=Or),u}function yg(u,d,b){var w=d.pendingProps,k=!1,B=(d.flags&128)!==0,te;if((te=B)||(te=u!==null&&u.memoizedState===null?!1:(hi.current&2)!==0),te&&(k=!0,d.flags&=-129),te=(d.flags&32)!==0,d.flags&=-33,u===null){if(Gt){if(k?Ft(d):lr(),Gt){var re=Fi,pe;(pe=re)&&(re=Vg(re,Sa),re!==null?(d.memoizedState={dehydrated:re,treeContext:qa!==null?{id:ws,overflow:_a}:null,retryLane:536870912},pe=n(18,null,null,0),pe.stateNode=re,pe.return=d,d.child=pe,Ji=d,Fi=null,pe=!0):pe=!1),pe||me(d)}if(re=d.memoizedState,re!==null&&(re=re.dehydrated,re!==null))return Pu(re)?d.lanes=16:d.lanes=536870912,null;Vi(d)}return re=w.children,w=w.fallback,k?(lr(),k=d.mode,re=Nh({mode:"hidden",children:re},k),w=Qs(w,k,b,null),re.return=d,w.return=d,re.sibling=w,d.child=re,k=d.child,k.memoizedState=Rh(b),k.childLanes=kh(u,te,b),d.memoizedState=tr,w):(Ft(d),Su(d,re))}if(pe=u.memoizedState,pe!==null&&(re=pe.dehydrated,re!==null)){if(B)d.flags&256?(Ft(d),d.flags&=-257,d=Oh(u,d,b)):d.memoizedState!==null?(lr(),d.child=u.child,d.flags|=128,d=null):(lr(),k=w.fallback,re=d.mode,w=Nh({mode:"visible",children:w.children},re),k=Qs(k,re,b,null),k.flags|=2,w.return=d,k.return=d,w.sibling=k,d.child=w,no(d,u.child,null,b),w=d.child,w.memoizedState=Rh(b),w.childLanes=kh(u,te,b),d.memoizedState=tr,d=k);else if(Ft(d),Pu(re))te=Ug(re).digest,w=Error(r(419)),w.stack="",w.digest=te,He({value:w,source:null,stack:null}),d=Oh(u,d,b);else if(ni||To(u,d,b,!1),te=(b&u.childLanes)!==0,ni||te){if(te=Rt,te!==null){if(w=b&-b,(w&42)!==0)w=1;else switch(w){case 2:w=1;break;case 8:w=4;break;case 32:w=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:w=64;break;case 268435456:w=134217728;break;default:w=0}if(w=(w&(te.suspendedLanes|b))!==0?0:w,w!==0&&w!==pe.retryLane)throw pe.retryLane=w,wt(u,w),Wi(te,u,w),ly}uf(re)||Tr(),d=Oh(u,d,b)}else uf(re)?(d.flags|=128,d.child=u.child,d=Oo.bind(null,u),Mx(re,d),d=null):(u=pe.treeContext,pr&&(Fi=Gg(re),Ji=d,Gt=!0,Jr=null,Sa=!1,u!==null&&(Qr[Zr++]=ws,Qr[Zr++]=_a,Qr[Zr++]=qa,ws=u.id,_a=u.overflow,qa=d)),d=Su(d,w.children),d.flags|=4096);return d}return k?(lr(),k=w.fallback,re=d.mode,pe=u.child,B=pe.sibling,w=Qi(pe,{mode:"hidden",children:w.children}),w.subtreeFlags=pe.subtreeFlags&31457280,B!==null?k=Qi(B,k):(k=Qs(k,re,b,null),k.flags|=2),k.return=d,w.return=d,w.sibling=k,d.child=w,w=k,k=d.child,re=u.child.memoizedState,re===null?re=Rh(b):(pe=re.cachePool,pe!==null?(B=_s?on._currentValue:on._currentValue2,pe=pe.parent!==B?{parent:B,pool:B}:pe):pe=_g(),re={baseLanes:re.baseLanes|b,cachePool:pe}),k.memoizedState=re,k.childLanes=kh(u,te,b),d.memoizedState=tr,w):(Ft(d),b=u.child,u=b.sibling,b=Qi(b,{mode:"visible",children:w.children}),b.return=d,b.sibling=null,u!==null&&(te=d.deletions,te===null?(d.deletions=[u],d.flags|=16):te.push(u)),d.child=b,d.memoizedState=null,b)}function Su(u,d){return d=Nh({mode:"visible",children:d},u.mode),d.return=u,u.child=d}function Nh(u,d){return Zd(u,d,0,null)}function Oh(u,d,b){return no(d,u.child,null,b),u=Su(d,d.pendingProps.children),u.flags|=2,d.memoizedState=null,u}function xg(u,d,b){u.lanes|=d;var w=u.alternate;w!==null&&(w.lanes|=d),zh(u.return,d,b)}function Ld(u,d,b,w,k){var B=u.memoizedState;B===null?u.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:w,tail:b,tailMode:k}:(B.isBackwards=d,B.rendering=null,B.renderingStartTime=0,B.last=w,B.tail=b,B.tailMode=k)}function bg(u,d,b){var w=d.pendingProps,k=w.revealOrder,B=w.tail;if(Li(u,d,w.children,b),w=hi.current,(w&2)!==0)w=w&1|2,d.flags|=128;else{if(u!==null&&(u.flags&128)!==0)e:for(u=d.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&xg(u,b,d);else if(u.tag===19)xg(u,b,d);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===d)break e;for(;u.sibling===null;){if(u.return===null||u.return===d)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}w&=1}switch(N(hi,w),k){case"forwards":for(b=d.child,k=null;b!==null;)u=b.alternate,u!==null&&or(u)===null&&(k=b),b=b.sibling;b=k,b===null?(k=d.child,d.child=null):(k=b.sibling,b.sibling=null),Ld(d,!1,k,b,B);break;case"backwards":for(b=null,k=d.child,d.child=null;k!==null;){if(u=k.alternate,u!==null&&or(u)===null){d.child=k;break}u=k.sibling,k.sibling=b,b=k,k=u}Ld(d,!0,b,null,B);break;case"together":Ld(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function Gs(u,d,b){if(u!==null&&(d.dependencies=u.dependencies),ra|=d.lanes,(b&d.childLanes)===0)if(u!==null){if(To(u,d,b,!1),(b&d.childLanes)===0)return null}else return null;if(u!==null&&d.child!==u.child)throw Error(r(153));if(d.child!==null){for(u=d.child,b=Qi(u,u.pendingProps),d.child=b,b.return=d;u.sibling!==null;)u=u.sibling,b=b.sibling=Qi(u,u.pendingProps),b.return=d;b.sibling=null}return d.child}function Dh(u,d){return(u.lanes&d)!==0?!0:(u=u.dependencies,!!(u!==null&&zl(u)))}function Tx(u,d,b){switch(d.tag){case 3:ce(d,d.stateNode.containerInfo),Dl(d,on,u.memoizedState.cache),Ie();break;case 27:case 5:de(d);break;case 4:ce(d,d.stateNode.containerInfo);break;case 10:Dl(d,d.type,d.memoizedProps.value);break;case 13:var w=d.memoizedState;if(w!==null)return w.dehydrated!==null?(Ft(d),d.flags|=128,null):(b&d.child.childLanes)!==0?yg(u,d,b):(Ft(d),u=Gs(u,d,b),u!==null?u.sibling:null);Ft(d);break;case 19:var k=(u.flags&128)!==0;if(w=(b&d.childLanes)!==0,w||(To(u,d,b,!1),w=(b&d.childLanes)!==0),k){if(w)return bg(u,d,b);d.flags|=128}if(k=d.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),N(hi,hi.current),w)break;return null;case 22:case 23:return d.lanes=0,hg(u,d,b);case 24:Dl(d,on,u.memoizedState.cache)}return Gs(u,d,b)}function vg(u,d,b){if(u!==null)if(u.memoizedProps!==d.pendingProps)ni=!0;else{if(!Dh(u,b)&&(d.flags&128)===0)return ni=!1,Tx(u,d,b);ni=(u.flags&131072)!==0}else ni=!1,Gt&&(d.flags&1048576)!==0&&$(d,Xu,d.index);switch(d.lanes=0,d.tag){case 16:e:{u=d.pendingProps;var w=d.elementType,k=w._init;if(w=k(w._payload),d.type=w,typeof w=="function")$s(w)?(u=Ua(w,u),d.tag=1,d=Mh(null,d,w,u,b)):(d.tag=0,d=Ah(null,d,w,u,b));else{if(w!=null){if(k=w.$$typeof,k===Nc){d.tag=11,d=dg(null,d,w,u,b);break e}else if(k===Du){d.tag=14,d=fg(null,d,w,u,b);break e}}throw d=l(w)||w,Error(r(306,d,""))}}return d;case 0:return Ah(u,d,d.type,d.pendingProps,b);case 1:return w=d.type,k=Ua(w,d.pendingProps),Mh(u,d,w,k,b);case 3:e:{if(ce(d,d.stateNode.containerInfo),u===null)throw Error(r(387));var B=d.pendingProps;k=d.memoizedState,w=k.element,ci(u,d),Jn(d,B,null,b);var te=d.memoizedState;if(B=te.cache,Dl(d,on,B),B!==k.cache&&Bh(d,[on],b,!0),Yi(),B=te.element,pr&&k.isDehydrated)if(k={element:B,isDehydrated:!1,cache:te.cache},d.updateQueue.baseState=k,d.memoizedState=k,d.flags&256){d=gg(u,d,B,b);break e}else if(B!==w){w=Q(Error(r(424)),d),He(w),d=gg(u,d,B,b);break e}else for(pr&&(Fi=Fg(d.stateNode.containerInfo),Ji=d,Gt=!0,Jr=null,Sa=!0),b=Bp(d,null,B,b),d.child=b;b;)b.flags=b.flags&-3|4096,b=b.sibling;else{if(Ie(),B===w){d=Gs(u,d,b);break e}Li(u,d,B,b)}d=d.child}return d;case 26:if($r)return _u(u,d),u===null?(b=mf(d.type,null,d.pendingProps,null))?d.memoizedState=b:Gt||(d.stateNode=kx(d.type,d.pendingProps,Ya.current,d)):d.memoizedState=mf(d.type,u.memoizedProps,d.pendingProps,u.memoizedState),null;case 27:if(Hi)return de(d),u===null&&Hi&&Gt&&(w=d.stateNode=Np(d.type,d.pendingProps,Ya.current,Oi.current,!1),Ji=d,Sa=!0,Fi=df(w)),w=d.pendingProps.children,u!==null||Gt?Li(u,d,w,b):d.child=no(d,null,w,b),_u(u,d),d.child;case 5:return u===null&&Gt&&(Qg(d.type,d.pendingProps,Oi.current),(k=w=Fi)&&(w=qg(w,d.type,d.pendingProps,Sa),w!==null?(d.stateNode=w,Ji=d,Fi=df(w),Sa=!1,k=!0):k=!1),k||me(d)),de(d),k=d.type,B=d.pendingProps,te=u!==null?u.memoizedProps:null,w=B.children,Ql(k,B)?w=null:te!==null&&Ql(k,te)&&(d.flags|=32),d.memoizedState!==null&&(k=Hr(u,d,Al,null,null,b),_s?dt._currentValue=k:dt._currentValue2=k),_u(u,d),Li(u,d,w,b),d.child;case 6:return u===null&&Gt&&(Zg(d.pendingProps,Oi.current),(u=b=Fi)&&(b=Yg(b,d.pendingProps,Sa),b!==null?(d.stateNode=b,Ji=d,Fi=null,u=!0):u=!1),u||me(d)),null;case 13:return yg(u,d,b);case 4:return ce(d,d.stateNode.containerInfo),w=d.pendingProps,u===null?d.child=no(d,null,w,b):Li(u,d,w,b),d.child;case 11:return dg(u,d,d.type,d.pendingProps,b);case 7:return Li(u,d,d.pendingProps,b),d.child;case 8:return Li(u,d,d.pendingProps.children,b),d.child;case 12:return Li(u,d,d.pendingProps.children,b),d.child;case 10:return w=d.pendingProps,Dl(d,d.type,w.value),Li(u,d,w.children,b),d.child;case 9:return k=d.type._context,w=d.pendingProps.children,Co(d),k=ji(k),w=w(k),d.flags|=1,Li(u,d,w,b),d.child;case 14:return fg(u,d,d.type,d.pendingProps,b);case 15:return Bd(u,d,d.type,d.pendingProps,b);case 19:return bg(u,d,b);case 22:return hg(u,d,b);case 24:return Co(d),w=ji(on),u===null?(k=Bl(),k===null&&(k=Rt,B=jd(),k.pooledCache=B,B.refCount++,B!==null&&(k.pooledCacheLanes|=b),k=B),d.memoizedState={parent:w,cache:k},tn(d),Dl(d,on,k)):((u.lanes&b)!==0&&(ci(u,d),Jn(d,null,null,b),Yi()),k=u.memoizedState,B=d.memoizedState,k.parent!==w?(k={parent:w,cache:w},d.memoizedState=k,d.lanes===0&&(d.memoizedState=d.updateQueue.baseState=k),Dl(d,on,w)):(w=B.cache,Dl(d,on,w),w!==k.cache&&Bh(d,[on],b,!0))),Li(u,d,d.pendingProps.children,b),d.child;case 29:throw d.pendingProps}throw Error(r(156,d.tag))}function Dl(u,d,b){_s?(N(kr,d._currentValue),d._currentValue=b):(N(kr,d._currentValue2),d._currentValue2=b)}function qs(u){var d=kr.current;_s?u._currentValue=d:u._currentValue2=d,C(kr)}function zh(u,d,b){for(;u!==null;){var w=u.alternate;if((u.childLanes&d)!==d?(u.childLanes|=d,w!==null&&(w.childLanes|=d)):w!==null&&(w.childLanes&d)!==d&&(w.childLanes|=d),u===b)break;u=u.return}}function Bh(u,d,b,w){var k=u.child;for(k!==null&&(k.return=u);k!==null;){var B=k.dependencies;if(B!==null){var te=k.child;B=B.firstContext;e:for(;B!==null;){var re=B;B=k;for(var pe=0;pe<d.length;pe++)if(re.context===d[pe]){B.lanes|=b,re=B.alternate,re!==null&&(re.lanes|=b),zh(B.return,b,u),w||(te=null);break e}B=re.next}}else if(k.tag===18){if(te=k.return,te===null)throw Error(r(341));te.lanes|=b,B=te.alternate,B!==null&&(B.lanes|=b),zh(te,b,u),te=null}else te=k.child;if(te!==null)te.return=k;else for(te=k;te!==null;){if(te===u){te=null;break}if(k=te.sibling,k!==null){k.return=te.return,te=k;break}te=te.return}k=te}}function To(u,d,b,w){u=null;for(var k=d,B=!1;k!==null;){if(!B){if((k.flags&524288)!==0)B=!0;else if((k.flags&262144)!==0)break}if(k.tag===10){var te=k.alternate;if(te===null)throw Error(r(387));if(te=te.memoizedProps,te!==null){var re=k.type;Wr(k.pendingProps.value,te.value)||(u!==null?u.push(re):u=[re])}}else if(k===Ic.current){if(te=k.alternate,te===null)throw Error(r(387));te.memoizedState.memoizedState!==k.memoizedState.memoizedState&&(u!==null?u.push(dt):u=[dt])}k=k.return}u!==null&&Bh(d,u,b,w),d.flags|=262144}function zl(u){for(u=u.firstContext;u!==null;){var d=u.context;if(!Wr(_s?d._currentValue:d._currentValue2,u.memoizedValue))return!0;u=u.next}return!1}function Co(u){ro=u,Kn=null,u=u.dependencies,u!==null&&(u.firstContext=null)}function ji(u){return Lh(ro,u)}function Eu(u,d){return ro===null&&Co(u),Lh(u,d)}function Lh(u,d){var b=_s?d._currentValue:d._currentValue2;if(d={context:d,memoizedValue:b,next:null},Kn===null){if(u===null)throw Error(r(308));Kn=d,u.dependencies={lanes:0,firstContext:d},u.flags|=524288}else Kn=Kn.next=d;return b}function jd(){return{controller:new oy,data:new Map,refCount:0}}function gc(u){u.refCount--,u.refCount===0&&al(Fo,function(){u.controller.abort()})}function Bl(){var u=sl.current;return u!==null?u:Rt.pooledCache}function Id(u,d){d===null?N(sl,sl.current):N(sl,d.pool)}function _g(){var u=Bl();return u===null?null:{parent:_s?on._currentValue:on._currentValue2,pool:u}}function qr(u){u.flags|=4}function jh(u,d){if(u!==null&&u.child===d.child)return!1;if((d.flags&16)!==0)return!0;for(u=d.child;u!==null;){if((u.flags&13878)!==0||(u.subtreeFlags&13878)!==0)return!0;u=u.sibling}return!1}function Ud(u,d,b,w){if(Ui)for(b=d.child;b!==null;){if(b.tag===5||b.tag===6)vs(u,b.stateNode);else if(!(b.tag===4||Hi&&b.tag===27)&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===d)break;for(;b.sibling===null;){if(b.return===null||b.return===d)return;b=b.return}b.sibling.return=b.return,b=b.sibling}else if(Xr)for(var k=d.child;k!==null;){if(k.tag===5){var B=k.stateNode;b&&w&&(B=xp(B,k.type,k.memoizedProps)),vs(u,B)}else if(k.tag===6)B=k.stateNode,b&&w&&(B=bp(B,k.memoizedProps)),vs(u,B);else if(k.tag!==4){if(k.tag===22&&k.memoizedState!==null)B=k.child,B!==null&&(B.return=k),Ud(u,k,!0,!0);else if(k.child!==null){k.child.return=k,k=k.child;continue}}if(k===d)break;for(;k.sibling===null;){if(k.return===null||k.return===d)return;k=k.return}k.sibling.return=k.return,k=k.sibling}}function yc(u,d,b,w){if(Xr)for(var k=d.child;k!==null;){if(k.tag===5){var B=k.stateNode;b&&w&&(B=xp(B,k.type,k.memoizedProps)),gp(u,B)}else if(k.tag===6)B=k.stateNode,b&&w&&(B=bp(B,k.memoizedProps)),gp(u,B);else if(k.tag!==4){if(k.tag===22&&k.memoizedState!==null)B=k.child,B!==null&&(B.return=k),yc(u,k,!(k.memoizedProps!==null&&k.memoizedProps.mode==="manual"),!0);else if(k.child!==null){k.child.return=k,k=k.child;continue}}if(k===d)break;for(;k.sibling===null;){if(k.return===null||k.return===d)return;k=k.return}k.sibling.return=k.return,k=k.sibling}}function xc(u,d){if(Xr&&jh(u,d)){u=d.stateNode;var b=u.containerInfo,w=cf();yc(w,d,!1,!1),u.pendingChildren=w,qr(d),Ig(b,w)}}function Ih(u,d,b,w){if(Ui)u.memoizedProps!==w&&qr(d);else if(Xr){var k=u.stateNode,B=u.memoizedProps;if((u=jh(u,d))||B!==w){var te=Oi.current;B=mp(k,b,B,w,!u,null),B===k?d.stateNode=k:(Js(B,b,w,te)&&qr(d),d.stateNode=B,u?Ud(B,d,!1,!1):qr(d))}else d.stateNode=k}}function bc(u,d,b){if(Bg(d,b)){if(u.flags|=16777216,!el(d,b))if(Ru())u.flags|=8192;else throw Po=vf,zp}else u.flags&=-16777217}function Uh(u,d){if(Jg(d)){if(u.flags|=16777216,!Rp(d))if(Ru())u.flags|=8192;else throw Po=vf,zp}else u.flags&=-16777217}function wu(u,d){d!==null&&(u.flags|=4),u.flags&16384&&(d=u.tag!==22?V():536870912,u.lanes|=d,ol|=d)}function Ao(u,d){if(!Gt)switch(u.tailMode){case"hidden":d=u.tail;for(var b=null;d!==null;)d.alternate!==null&&(b=d),d=d.sibling;b===null?u.tail=null:b.sibling=null;break;case"collapsed":b=u.tail;for(var w=null;b!==null;)b.alternate!==null&&(w=b),b=b.sibling;w===null?d||u.tail===null?u.tail=null:u.tail.sibling=null:w.sibling=null}}function Nn(u){var d=u.alternate!==null&&u.alternate.child===u.child,b=0,w=0;if(d)for(var k=u.child;k!==null;)b|=k.lanes|k.childLanes,w|=k.subtreeFlags&31457280,w|=k.flags&31457280,k.return=u,k=k.sibling;else for(k=u.child;k!==null;)b|=k.lanes|k.childLanes,w|=k.subtreeFlags,w|=k.flags,k.return=u,k=k.sibling;return u.subtreeFlags|=w,u.childLanes=b,d}function Sg(u,d,b){var w=d.pendingProps;switch(X(d),d.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nn(d),null;case 1:return Nn(d),null;case 3:return b=d.stateNode,w=null,u!==null&&(w=u.memoizedState.cache),d.memoizedState.cache!==w&&(d.flags|=2048),qs(on),ie(),b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),(u===null||u.child===null)&&(je(d)?qr(d):u===null||u.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,Jr!==null&&(Vs(Jr),Jr=null))),xc(u,d),Nn(d),null;case 26:if($r){b=d.type;var k=d.memoizedState;return u===null?(qr(d),k!==null?(Nn(d),Uh(d,k)):(Nn(d),bc(d,b,w))):k?k!==u.memoizedState?(qr(d),Nn(d),Uh(d,k)):(Nn(d),d.flags&=-16777217):(Ui?u.memoizedProps!==w&&qr(d):Ih(u,d,b,w),Nn(d),bc(d,b,w)),null}case 27:if(Hi){if(xe(d),b=Ya.current,k=d.type,u!==null&&d.stateNode!=null)Ui?u.memoizedProps!==w&&qr(d):Ih(u,d,k,w);else{if(!w){if(d.stateNode===null)throw Error(r(166));return Nn(d),null}u=Oi.current,je(d)?le(d,u):(u=Np(k,w,b,u,!0),d.stateNode=u,qr(d))}return Nn(d),null}case 5:if(xe(d),b=d.type,u!==null&&d.stateNode!=null)Ih(u,d,b,w);else{if(!w){if(d.stateNode===null)throw Error(r(166));return Nn(d),null}u=Oi.current,je(d)?le(d,u):(k=rp(b,w,Ya.current,u,d),Ud(k,d,!1,!1),d.stateNode=k,Js(k,b,w,u)&&qr(d))}return Nn(d),bc(d,d.type,d.pendingProps),null;case 6:if(u&&d.stateNode!=null)b=u.memoizedProps,Ui?b!==w&&qr(d):Xr&&(b!==w?(d.stateNode=nf(w,Ya.current,Oi.current,d),qr(d)):d.stateNode=u.stateNode);else{if(typeof w!="string"&&d.stateNode===null)throw Error(r(166));if(u=Ya.current,b=Oi.current,je(d)){if(!pr)throw Error(r(176));if(u=d.stateNode,b=d.memoizedProps,w=null,k=Ji,k!==null)switch(k.tag){case 27:case 5:w=k.memoizedProps}Xg(u,b,d,w)||me(d)}else d.stateNode=nf(w,u,b,d)}return Nn(d),null;case 13:if(w=d.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(k=je(d),w!==null&&w.dehydrated!==null){if(u===null){if(!k)throw Error(r(318));if(!pr)throw Error(r(344));if(k=d.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(r(317));Dc(k,d)}else Ie(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;Nn(d),k=!1}else Jr!==null&&(Vs(Jr),Jr=null),k=!0;if(!k)return d.flags&256?(Vi(d),d):(Vi(d),null)}if(Vi(d),(d.flags&128)!==0)return d.lanes=b,d;if(b=w!==null,u=u!==null&&u.memoizedState!==null,b){w=d.child,k=null,w.alternate!==null&&w.alternate.memoizedState!==null&&w.alternate.memoizedState.cachePool!==null&&(k=w.alternate.memoizedState.cachePool.pool);var B=null;w.memoizedState!==null&&w.memoizedState.cachePool!==null&&(B=w.memoizedState.cachePool.pool),B!==k&&(w.flags|=2048)}return b!==u&&b&&(d.child.flags|=8192),wu(d,d.updateQueue),Nn(d),null;case 4:return ie(),xc(u,d),u===null&&lp(d.stateNode.containerInfo),Nn(d),null;case 10:return qs(d.type),Nn(d),null;case 19:if(C(hi),k=d.memoizedState,k===null)return Nn(d),null;if(w=(d.flags&128)!==0,B=k.rendering,B===null)if(w)Ao(k,!1);else{if(It!==0||u!==null&&(u.flags&128)!==0)for(u=d.child;u!==null;){if(B=or(u),B!==null){for(d.flags|=128,Ao(k,!1),u=B.updateQueue,d.updateQueue=u,wu(d,u),d.subtreeFlags=0,u=b,b=d.child;b!==null;)Ws(b,u),b=b.sibling;return N(hi,hi.current&1|2),d.child}u=u.sibling}k.tail!==null&&Pi()>Fn&&(d.flags|=128,w=!0,Ao(k,!1),d.lanes=4194304)}else{if(!w)if(u=or(B),u!==null){if(d.flags|=128,w=!0,u=u.updateQueue,d.updateQueue=u,wu(d,u),Ao(k,!0),k.tail===null&&k.tailMode==="hidden"&&!B.alternate&&!Gt)return Nn(d),null}else 2*Pi()-k.renderingStartTime>Fn&&b!==536870912&&(d.flags|=128,w=!0,Ao(k,!1),d.lanes=4194304);k.isBackwards?(B.sibling=d.child,d.child=B):(u=k.last,u!==null?u.sibling=B:d.child=B,k.last=B)}return k.tail!==null?(d=k.tail,k.rendering=d,k.tail=d.sibling,k.renderingStartTime=Pi(),d.sibling=null,u=hi.current,N(hi,w?u&1|2:u&1),d):(Nn(d),null);case 22:case 23:return Vi(d),Rn(),w=d.memoizedState!==null,u!==null?u.memoizedState!==null!==w&&(d.flags|=8192):w&&(d.flags|=8192),w?(b&536870912)!==0&&(d.flags&128)===0&&(Nn(d),d.subtreeFlags&6&&(d.flags|=8192)):Nn(d),b=d.updateQueue,b!==null&&wu(d,b.retryQueue),b=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(b=u.memoizedState.cachePool.pool),w=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(w=d.memoizedState.cachePool.pool),w!==b&&(d.flags|=2048),u!==null&&C(sl),null;case 24:return b=null,u!==null&&(b=u.memoizedState.cache),d.memoizedState.cache!==b&&(d.flags|=2048),qs(on),Nn(d),null;case 25:return null}throw Error(r(156,d.tag))}function Eg(u,d){switch(X(d),d.tag){case 1:return u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 3:return qs(on),ie(),u=d.flags,(u&65536)!==0&&(u&128)===0?(d.flags=u&-65537|128,d):null;case 26:case 27:case 5:return xe(d),null;case 13:if(Vi(d),u=d.memoizedState,u!==null&&u.dehydrated!==null){if(d.alternate===null)throw Error(r(340));Ie()}return u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 19:return C(hi),null;case 4:return ie(),null;case 10:return qs(d.type),null;case 22:case 23:return Vi(d),Rn(),u!==null&&C(sl),u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 24:return qs(on),null;case 25:return null;default:return null}}function Hh(u,d){switch(X(d),d.tag){case 3:qs(on),ie();break;case 26:case 27:case 5:xe(d);break;case 4:ie();break;case 13:Vi(d);break;case 19:C(hi);break;case 10:qs(d.type);break;case 22:case 23:Vi(d),Rn(),u!==null&&C(sl);break;case 24:qs(on)}}function Tu(u,d){try{var b=d.updateQueue,w=b!==null?b.lastEffect:null;if(w!==null){var k=w.next;b=k;do{if((b.tag&u)===u){w=void 0;var B=b.create,te=b.inst;w=B(),te.destroy=w}b=b.next}while(b!==k)}}catch(re){Ot(d,d.return,re)}}function Ll(u,d,b){try{var w=d.updateQueue,k=w!==null?w.lastEffect:null;if(k!==null){var B=k.next;w=B;do{if((w.tag&u)===u){var te=w.inst,re=te.destroy;if(re!==void 0){te.destroy=void 0,k=d;var pe=b;try{re()}catch(Ce){Ot(k,pe,Ce)}}}w=w.next}while(w!==B)}}catch(Ce){Ot(d,d.return,Ce)}}function wg(u){var d=u.updateQueue;if(d!==null){var b=u.stateNode;try{ls(d,b)}catch(w){Ot(u,u.return,w)}}}function Tg(u,d,b){b.props=Ua(u.type,u.memoizedProps),b.state=u.memoizedState;try{b.componentWillUnmount()}catch(w){Ot(u,d,w)}}function Mo(u,d){try{var b=u.ref;if(b!==null){var w=u.stateNode;switch(u.tag){case 26:case 27:case 5:var k=Oc(w);break;default:k=w}typeof b=="function"?u.refCleanup=b(k):b.current=k}}catch(B){Ot(u,d,B)}}function On(u,d){var b=u.ref,w=u.refCleanup;if(b!==null)if(typeof w=="function")try{w()}catch(k){Ot(u,d,k)}finally{u.refCleanup=null,u=u.alternate,u!=null&&(u.refCleanup=null)}else if(typeof b=="function")try{b(null)}catch(k){Ot(u,d,k)}else b.current=null}function vc(u){var d=u.type,b=u.memoizedProps,w=u.stateNode;try{Ax(w,d,b,u)}catch(k){Ot(u,u.return,k)}}function Ph(u,d,b){try{dp(u.stateNode,u.type,b,d,u)}catch(w){Ot(u,u.return,w)}}function Fh(u){return u.tag===5||u.tag===3||($r?u.tag===26:!1)||(Hi?u.tag===27:!1)||u.tag===4}function Hd(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||Fh(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&(!Hi||u.tag!==27)&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function Pd(u,d,b){var w=u.tag;if(w===5||w===6)u=u.stateNode,d?hp(b,u,d):Lg(b,u);else if(!(w===4||Hi&&w===27)&&(u=u.child,u!==null))for(Pd(u,d,b),u=u.sibling;u!==null;)Pd(u,d,b),u=u.sibling}function _c(u,d,b){var w=u.tag;if(w===5||w===6)u=u.stateNode,d?fp(b,u,d):up(b,u);else if(!(w===4||Hi&&w===27)&&(u=u.child,u!==null))for(_c(u,d,b),u=u.sibling;u!==null;)_c(u,d,b),u=u.sibling}function Cg(u,d,b){u=u.containerInfo;try{yp(u,b)}catch(w){Ot(d,d.return,w)}}function Sc(u,d){for(Wl(u.containerInfo),$n=d;$n!==null;)if(u=$n,d=u.child,(u.subtreeFlags&1028)!==0&&d!==null)d.return=u,$n=d;else for(;$n!==null;){u=$n;var b=u.alternate;switch(d=u.flags,u.tag){case 0:break;case 11:case 15:break;case 1:if((d&1024)!==0&&b!==null){d=void 0;var w=u,k=b.memoizedProps;b=b.memoizedState;var B=w.stateNode;try{var te=Ua(w.type,k,w.elementType===w.type);d=B.getSnapshotBeforeUpdate(te,b),B.__reactInternalSnapshotBeforeUpdate=d}catch(re){Ot(w,w.return,re)}}break;case 3:(d&1024)!==0&&Ui&&of(u.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((d&1024)!==0)throw Error(r(163))}if(d=u.sibling,d!==null){d.return=u.return,$n=d;break}$n=u.return}return te=Go,Go=!1,te}function Fd(u,d,b){var w=b.flags;switch(b.tag){case 0:case 11:case 15:ps(u,b),w&4&&Tu(5,b);break;case 1:if(ps(u,b),w&4)if(u=b.stateNode,d===null)try{u.componentDidMount()}catch(re){Ot(b,b.return,re)}else{var k=Ua(b.type,d.memoizedProps);d=d.memoizedState;try{u.componentDidUpdate(k,d,u.__reactInternalSnapshotBeforeUpdate)}catch(re){Ot(b,b.return,re)}}w&64&&wg(b),w&512&&Mo(b,b.return);break;case 3:if(ps(u,b),w&64&&(w=b.updateQueue,w!==null)){if(u=null,b.child!==null)switch(b.child.tag){case 27:case 5:u=Oc(b.child.stateNode);break;case 1:u=b.child.stateNode}try{ls(w,u)}catch(re){Ot(b,b.return,re)}}break;case 26:if($r){ps(u,b),w&512&&Mo(b,b.return);break}case 27:case 5:ps(u,b),d===null&&w&4&&vc(b),w&512&&Mo(b,b.return);break;case 12:ps(u,b);break;case 13:ps(u,b),w&4&&jl(u,b);break;case 22:if(k=b.memoizedState!==null||Ei,!k){d=d!==null&&d.memoizedState!==null||Pn;var B=Ei,te=Pn;Ei=k,(Pn=d)&&!te?Ul(u,b,(b.subtreeFlags&8772)!==0):ps(u,b),Ei=B,Pn=te}w&512&&(b.memoizedProps.mode==="manual"?Mo(b,b.return):On(b,b.return));break;default:ps(u,b)}}function Ec(u){var d=u.alternate;d!==null&&(u.alternate=null,Ec(d)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(d=u.stateNode,d!==null&&op(d)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function Yr(u,d,b){for(b=b.child;b!==null;)Gd(u,d,b),b=b.sibling}function Gd(u,d,b){if(Mr&&typeof Mr.onCommitFiberUnmount=="function")try{Mr.onCommitFiberUnmount(jc,b)}catch{}switch(b.tag){case 26:if($r){Pn||On(b,d),Yr(u,d,b),b.memoizedState?wp(b.memoizedState):b.stateNode&&Ap(b.stateNode);break}case 27:if(Hi){Pn||On(b,d);var w=ii,k=Nr;ii=b.stateNode,Yr(u,d,b),ey(b.stateNode),ii=w,Nr=k;break}case 5:Pn||On(b,d);case 6:if(Ui){if(w=ii,k=Nr,ii=null,Yr(u,d,b),ii=w,Nr=k,ii!==null)if(Nr)try{ei(ii,b.stateNode)}catch(B){Ot(b,d,B)}else try{mr(ii,b.stateNode)}catch(B){Ot(b,d,B)}}else Yr(u,d,b);break;case 18:Ui&&ii!==null&&(Nr?_p(ii,b.stateNode):$g(ii,b.stateNode));break;case 4:Ui?(w=ii,k=Nr,ii=b.stateNode.containerInfo,Nr=!0,Yr(u,d,b),ii=w,Nr=k):(Xr&&Cg(b.stateNode,b,cf()),Yr(u,d,b));break;case 0:case 11:case 14:case 15:Pn||Ll(2,b,d),Pn||Ll(4,b,d),Yr(u,d,b);break;case 1:Pn||(On(b,d),w=b.stateNode,typeof w.componentWillUnmount=="function"&&Tg(b,d,w)),Yr(u,d,b);break;case 21:Yr(u,d,b);break;case 22:Pn||On(b,d),Pn=(w=Pn)||b.memoizedState!==null,Yr(u,d,b),Pn=w;break;default:Yr(u,d,b)}}function jl(u,d){if(pr&&d.memoizedState===null&&(u=d.alternate,u!==null&&(u=u.memoizedState,u!==null&&(u=u.dehydrated,u!==null))))try{hf(u)}catch(b){Ot(d,d.return,b)}}function wc(u){switch(u.tag){case 13:case 19:var d=u.stateNode;return d===null&&(d=u.stateNode=new Gc),d;case 22:return u=u.stateNode,d=u._retryCache,d===null&&(d=u._retryCache=new Gc),d;default:throw Error(r(435,u.tag))}}function Cu(u,d){var b=wc(u);d.forEach(function(w){var k=Xh.bind(null,u,w);b.has(w)||(b.add(w),w.then(k,k))})}function dr(u,d){var b=d.deletions;if(b!==null)for(var w=0;w<b.length;w++){var k=b[w],B=u,te=d;if(Ui){var re=te;e:for(;re!==null;){switch(re.tag){case 27:case 5:ii=re.stateNode,Nr=!1;break e;case 3:ii=re.stateNode.containerInfo,Nr=!0;break e;case 4:ii=re.stateNode.containerInfo,Nr=!0;break e}re=re.return}if(ii===null)throw Error(r(160));Gd(B,te,k),ii=null,Nr=!1}else Gd(B,te,k);B=k.alternate,B!==null&&(B.return=null),k.return=null}if(d.subtreeFlags&13878)for(d=d.child;d!==null;)Il(d,u),d=d.sibling}function Il(u,d){var b=u.alternate,w=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:dr(d,u),Er(u),w&4&&(Ll(3,u,u.return),Tu(3,u),Ll(5,u,u.return));break;case 1:dr(d,u),Er(u),w&512&&(Pn||b===null||On(b,b.return)),w&64&&Ei&&(u=u.updateQueue,u!==null&&(w=u.callbacks,w!==null&&(b=u.shared.hiddenCallbacks,u.shared.hiddenCallbacks=b===null?w:b.concat(w))));break;case 26:if($r){var k=gr;dr(d,u),Er(u),w&512&&(Pn||b===null||On(b,b.return)),w&4&&(w=b!==null?b.memoizedState:null,d=u.memoizedState,b===null?d===null?u.stateNode===null?u.stateNode=Tp(k,u.type,u.memoizedProps,u):Cp(k,u.type,u.stateNode):u.stateNode=Ep(k,d,u.memoizedProps):w!==d?(w===null?b.stateNode!==null&&Ap(b.stateNode):wp(w),d===null?Cp(k,u.type,u.stateNode):Ep(k,d,u.memoizedProps)):d===null&&u.stateNode!==null&&Ph(u,u.memoizedProps,b.memoizedProps));break}case 27:if(Hi&&w&4&&u.alternate===null){k=u.stateNode;var B=u.memoizedProps;try{Nx(k),Ox(u.type,B,k,u)}catch(De){Ot(u,u.return,De)}}case 5:if(dr(d,u),Er(u),w&512&&(Pn||b===null||On(b,b.return)),Ui){if(u.flags&32){d=u.stateNode;try{Uu(d)}catch(De){Ot(u,u.return,De)}}w&4&&u.stateNode!=null&&(d=u.memoizedProps,Ph(u,d,b!==null?b.memoizedProps:d)),w&1024&&(ao=!0)}break;case 6:if(dr(d,u),Er(u),w&4&&Ui){if(u.stateNode===null)throw Error(r(162));w=u.memoizedProps,b=b!==null?b.memoizedProps:w,d=u.stateNode;try{jg(d,b,w)}catch(De){Ot(u,u.return,De)}}break;case 3:if($r?(Mp(),k=gr,gr=pf(d.containerInfo),dr(d,u),gr=k):dr(d,u),Er(u),w&4){if(Ui&&pr&&b!==null&&b.memoizedState.isDehydrated)try{ff(d.containerInfo)}catch(De){Ot(u,u.return,De)}if(Xr){w=d.containerInfo,b=d.pendingChildren;try{yp(w,b)}catch(De){Ot(u,u.return,De)}}}ao&&(ao=!1,Gh(u));break;case 4:$r?(b=gr,gr=pf(u.stateNode.containerInfo),dr(d,u),Er(u),gr=b):(dr(d,u),Er(u)),w&4&&Xr&&Cg(u.stateNode,u,u.stateNode.pendingChildren);break;case 12:dr(d,u),Er(u);break;case 13:dr(d,u),Er(u),u.child.flags&8192&&u.memoizedState!==null!=(b!==null&&b.memoizedState!==null)&&(Ms=Pi()),w&4&&(w=u.updateQueue,w!==null&&(u.updateQueue=null,Cu(u,w)));break;case 22:w&512&&(Pn||b===null||On(b,b.return)),k=u.memoizedState!==null;var te=b!==null&&b.memoizedState!==null,re=Ei,pe=Pn;if(Ei=re||k,Pn=pe||te,dr(d,u),Pn=pe,Ei=re,Er(u),d=u.stateNode,d._current=u,d._visibility&=-3,d._visibility|=d._pendingVisibility&2,w&8192&&(d._visibility=k?d._visibility&-2:d._visibility|1,k&&(d=Ei||Pn,b===null||te||d||Tc(u)),Ui&&(u.memoizedProps===null||u.memoizedProps.mode!=="manual"))){e:if(b=null,Ui)for(d=u;;){if(d.tag===5||$r&&d.tag===26||Hi&&d.tag===27){if(b===null){te=b=d;try{B=te.stateNode,k?Hu(B):pp(te.stateNode,te.memoizedProps)}catch(De){Ot(te,te.return,De)}}}else if(d.tag===6){if(b===null){te=d;try{var Ce=te.stateNode;k?lf(Ce):tl(Ce,te.memoizedProps)}catch(De){Ot(te,te.return,De)}}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===u)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===u)break e;for(;d.sibling===null;){if(d.return===null||d.return===u)break e;b===d&&(b=null),d=d.return}b===d&&(b=null),d.sibling.return=d.return,d=d.sibling}}w&4&&(w=u.updateQueue,w!==null&&(b=w.retryQueue,b!==null&&(w.retryQueue=null,Cu(u,b))));break;case 19:dr(d,u),Er(u),w&4&&(w=u.updateQueue,w!==null&&(u.updateQueue=null,Cu(u,w)));break;case 21:break;default:dr(d,u),Er(u)}}function Er(u){var d=u.flags;if(d&2){try{if(Ui&&(!Hi||u.tag!==27)){e:{for(var b=u.return;b!==null;){if(Fh(b)){var w=b;break e}b=b.return}throw Error(r(160))}switch(w.tag){case 27:if(Hi){var k=w.stateNode,B=Hd(u);_c(u,B,k);break}case 5:var te=w.stateNode;w.flags&32&&(Uu(te),w.flags&=-33);var re=Hd(u);_c(u,re,te);break;case 3:case 4:var pe=w.stateNode.containerInfo,Ce=Hd(u);Pd(u,Ce,pe);break;default:throw Error(r(161))}}}catch(De){Ot(u,u.return,De)}u.flags&=-3}d&4096&&(u.flags&=-4097)}function Gh(u){if(u.subtreeFlags&1024)for(u=u.child;u!==null;){var d=u;Gh(d),d.tag===5&&d.flags&1024&&yn(d.stateNode),u=u.sibling}}function ps(u,d){if(d.subtreeFlags&8772)for(d=d.child;d!==null;)Fd(u,d.alternate,d),d=d.sibling}function Tc(u){for(u=u.child;u!==null;){var d=u;switch(d.tag){case 0:case 11:case 14:case 15:Ll(4,d,d.return),Tc(d);break;case 1:On(d,d.return);var b=d.stateNode;typeof b.componentWillUnmount=="function"&&Tg(d,d.return,b),Tc(d);break;case 26:case 27:case 5:On(d,d.return),Tc(d);break;case 22:On(d,d.return),d.memoizedState===null&&Tc(d);break;default:Tc(d)}u=u.sibling}}function Ul(u,d,b){for(b=b&&(d.subtreeFlags&8772)!==0,d=d.child;d!==null;){var w=d.alternate,k=u,B=d,te=B.flags;switch(B.tag){case 0:case 11:case 15:Ul(k,B,b),Tu(4,B);break;case 1:if(Ul(k,B,b),w=B,k=w.stateNode,typeof k.componentDidMount=="function")try{k.componentDidMount()}catch(Ce){Ot(w,w.return,Ce)}if(w=B,k=w.updateQueue,k!==null){var re=w.stateNode;try{var pe=k.shared.hiddenCallbacks;if(pe!==null)for(k.shared.hiddenCallbacks=null,k=0;k<pe.length;k++)vo(pe[k],re)}catch(Ce){Ot(w,w.return,Ce)}}b&&te&64&&wg(B),Mo(B,B.return);break;case 26:case 27:case 5:Ul(k,B,b),b&&w===null&&te&4&&vc(B),Mo(B,B.return);break;case 12:Ul(k,B,b);break;case 13:Ul(k,B,b),b&&te&4&&jl(k,B);break;case 22:B.memoizedState===null&&Ul(k,B,b),Mo(B,B.return);break;default:Ul(k,B,b)}d=d.sibling}}function qh(u,d){var b=null;u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(b=u.memoizedState.cachePool.pool),u=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(u=d.memoizedState.cachePool.pool),u!==b&&(u!=null&&u.refCount++,b!=null&&gc(b))}function qd(u,d){u=null,d.alternate!==null&&(u=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==u&&(d.refCount++,u!=null&&gc(u))}function Ys(u,d,b,w){if(d.subtreeFlags&10256)for(d=d.child;d!==null;)Yd(u,d,b,w),d=d.sibling}function Yd(u,d,b,w){var k=d.flags;switch(d.tag){case 0:case 11:case 15:Ys(u,d,b,w),k&2048&&Tu(9,d);break;case 3:Ys(u,d,b,w),k&2048&&(u=null,d.alternate!==null&&(u=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==u&&(d.refCount++,u!=null&&gc(u)));break;case 12:if(k&2048){Ys(u,d,b,w),u=d.stateNode;try{var B=d.memoizedProps,te=B.id,re=B.onPostCommit;typeof re=="function"&&re(te,d.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(pe){Ot(d,d.return,pe)}}else Ys(u,d,b,w);break;case 23:break;case 22:B=d.stateNode,d.memoizedState!==null?B._visibility&4?Ys(u,d,b,w):Hl(u,d):B._visibility&4?Ys(u,d,b,w):(B._visibility|=4,$i(u,d,b,w,(d.subtreeFlags&10256)!==0)),k&2048&&qh(d.alternate,d);break;case 24:Ys(u,d,b,w),k&2048&&qd(d.alternate,d);break;default:Ys(u,d,b,w)}}function $i(u,d,b,w,k){for(k=k&&(d.subtreeFlags&10256)!==0,d=d.child;d!==null;){var B=u,te=d,re=b,pe=w,Ce=te.flags;switch(te.tag){case 0:case 11:case 15:$i(B,te,re,pe,k),Tu(8,te);break;case 23:break;case 22:var De=te.stateNode;te.memoizedState!==null?De._visibility&4?$i(B,te,re,pe,k):Hl(B,te):(De._visibility|=4,$i(B,te,re,pe,k)),k&&Ce&2048&&qh(te.alternate,te);break;case 24:$i(B,te,re,pe,k),k&&Ce&2048&&qd(te.alternate,te);break;default:$i(B,te,re,pe,k)}d=d.sibling}}function Hl(u,d){if(d.subtreeFlags&10256)for(d=d.child;d!==null;){var b=u,w=d,k=w.flags;switch(w.tag){case 22:Hl(b,w),k&2048&&qh(w.alternate,w);break;case 24:Hl(b,w),k&2048&&qd(w.alternate,w);break;default:Hl(b,w)}d=d.sibling}}function Mi(u){if(u.subtreeFlags&qo)for(u=u.child;u!==null;)Ro(u),u=u.sibling}function Ro(u){switch(u.tag){case 26:Mi(u),u.flags&qo&&(u.memoizedState!==null?kp(gr,u.memoizedState,u.memoizedProps):qn(u.type,u.memoizedProps));break;case 5:Mi(u),u.flags&qo&&qn(u.type,u.memoizedProps);break;case 3:case 4:if($r){var d=gr;gr=pf(u.stateNode.containerInfo),Mi(u),gr=d}else Mi(u);break;case 22:u.memoizedState===null&&(d=u.alternate,d!==null&&d.memoizedState!==null?(d=qo,qo=16777216,Mi(u),qo=d):Mi(u));break;default:Mi(u)}}function Vd(u){var d=u.alternate;if(d!==null&&(u=d.child,u!==null)){d.child=null;do d=u.sibling,u.sibling=null,u=d;while(u!==null)}}function Pl(u){var d=u.deletions;if((u.flags&16)!==0){if(d!==null)for(var b=0;b<d.length;b++){var w=d[b];$n=w,Fl(w,u)}Vd(u)}if(u.subtreeFlags&10256)for(u=u.child;u!==null;)Au(u),u=u.sibling}function Au(u){switch(u.tag){case 0:case 11:case 15:Pl(u),u.flags&2048&&Ll(9,u,u.return);break;case 3:Pl(u);break;case 12:Pl(u);break;case 22:var d=u.stateNode;u.memoizedState!==null&&d._visibility&4&&(u.return===null||u.return.tag!==13)?(d._visibility&=-5,Cc(u)):Pl(u);break;default:Pl(u)}}function Cc(u){var d=u.deletions;if((u.flags&16)!==0){if(d!==null)for(var b=0;b<d.length;b++){var w=d[b];$n=w,Fl(w,u)}Vd(u)}for(u=u.child;u!==null;){switch(d=u,d.tag){case 0:case 11:case 15:Ll(8,d,d.return),Cc(d);break;case 22:b=d.stateNode,b._visibility&4&&(b._visibility&=-5,Cc(d));break;default:Cc(d)}u=u.sibling}}function Fl(u,d){for(;$n!==null;){var b=$n;switch(b.tag){case 0:case 11:case 15:Ll(8,b,d);break;case 23:case 22:if(b.memoizedState!==null&&b.memoizedState.cachePool!==null){var w=b.memoizedState.cachePool.pool;w!=null&&w.refCount++}break;case 24:gc(b.memoizedState.cache)}if(w=b.child,w!==null)w.return=b,$n=w;else e:for(b=u;$n!==null;){w=$n;var k=w.sibling,B=w.return;if(Ec(w),w===b){$n=null;break e}if(k!==null){k.return=B,$n=k;break e}$n=B}}}function Xd(u){var d=sp(u);if(d!=null){if(typeof d.memoizedProps["data-testname"]!="string")throw Error(r(364));return d}if(u=Io(u),u===null)throw Error(r(362));return u.stateNode.current}function Ac(u,d){var b=u.tag;switch(d.$$typeof){case td:if(u.type===d.value)return!0;break;case Tf:e:{for(d=d.value,u=[u,0],b=0;b<u.length;){var w=u[b++],k=w.tag,B=u[b++],te=d[B];if(k!==5&&k!==26&&k!==27||!Es(w)){for(;te!=null&&Ac(w,te);)B++,te=d[B];if(B===d.length){d=!0;break e}else for(w=w.child;w!==null;)u.push(w,B),w=w.sibling}}d=!1}return d;case Cf:if((b===5||b===26||b===27)&&Cx(u.stateNode,d.value))return!0;break;case cn:if((b===5||b===6||b===26||b===27)&&(u=Iu(u),u!==null&&0<=u.indexOf(d.value)))return!0;break;case jt:if((b===5||b===26||b===27)&&(u=u.memoizedProps["data-testname"],typeof u=="string"&&u.toLowerCase()===d.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function Gl(u){switch(u.$$typeof){case td:return"<"+(l(u.value)||"Unknown")+">";case Tf:return":has("+(Gl(u)||"")+")";case Cf:return'[role="'+u.value+'"]';case cn:return'"'+u.value+'"';case jt:return'[data-testname="'+u.value+'"]';default:throw Error(r(365))}}function Ag(u,d){var b=[];u=[u,0];for(var w=0;w<u.length;){var k=u[w++],B=k.tag,te=u[w++],re=d[te];if(B!==5&&B!==26&&B!==27||!Es(k)){for(;re!=null&&Ac(k,re);)te++,re=d[te];if(te===d.length)b.push(k);else for(k=k.child;k!==null;)u.push(k,te),k=k.sibling}}return b}function fr(u,d){if(!Ss)throw Error(r(363));u=Xd(u),u=Ag(u,d),d=[],u=Array.from(u);for(var b=0;b<u.length;){var w=u[b++],k=w.tag;if(k===5||k===26||k===27)Es(w)||d.push(w.stateNode);else for(w=w.child;w!==null;)u.push(w),w=w.sibling}return d}function hr(){if((et&2)!==0&&Tt!==0)return Tt&-Tt;if(at.T!==null){var u=Rr;return u!==0?u:ke()}return va()}function ms(){Or===0&&(Or=(Tt&536870912)===0||Gt?Z():536870912);var u=na.current;return u!==null&&(u.flags|=32),Or}function Wi(u,d,b){(u===Rt&&xn===2||u.cancelPendingCommit!==null)&&(Pa(u,0),Ha(u,Tt,Or,!1)),F(u,b),((et&2)===0||u!==Rt)&&(u===Rt&&((et&2)===0&&(Ka|=b),It===4&&Ha(u,Tt,Or,!1)),hn(u))}function Mu(u,d,b){if((et&6)!==0)throw Error(r(327));var w=!b&&(d&60)===0&&(d&u.expiredLanes)===0||D(u,d),k=w?xs(u,d):gs(u,d,!0),B=w;do{if(k===0){ia&&!w&&Ha(u,d,0,!1);break}else if(k===6)Ha(u,d,0,!un);else{if(b=u.current.alternate,B&&!Mg(b)){k=gs(u,d,!1),B=!1;continue}if(k===2){if(B=d,u.errorRecoveryDisabledLanes&B)var te=0;else te=u.pendingLanes&-536870913,te=te!==0?te:te&536870912?536870912:0;if(te!==0){d=te;e:{var re=u;k=qc;var pe=pr&&re.current.memoizedState.isDehydrated;if(pe&&(Pa(re,te).flags|=256),te=gs(re,te,!1),te!==2){if(ll&&!pe){re.errorRecoveryDisabledLanes|=B,Ka|=B,k=4;break e}B=aa,aa=k,B!==null&&Vs(B)}k=te}if(B=!1,k!==2)continue}}if(k===1){Pa(u,0),Ha(u,d,0,!0);break}e:{switch(w=u,k){case 0:case 1:throw Error(r(345));case 4:if((d&4194176)===d){Ha(w,d,Or,!un);break e}break;case 2:aa=null;break;case 3:case 5:break;default:throw Error(r(329))}if(w.finishedWork=b,w.finishedLanes=d,(d&62914560)===d&&(B=Ms+300-Pi(),10<B)){if(Ha(w,d,Or,!un),H(w,0)!==0)break e;w.timeoutHandle=ap(Kd.bind(null,w,b,aa,$a,Yc,d,Or,Ka,ol,un,2,-0,0),B);break e}Kd(w,b,aa,$a,Yc,d,Or,Ka,ol,un,0,-0,0)}}break}while(!0);hn(u)}function Vs(u){aa===null?aa=u:aa.push.apply(aa,u)}function Kd(u,d,b,w,k,B,te,re,pe,Ce,De,Fe,qe){var mt=d.subtreeFlags;if((mt&8192||(mt&16785408)===16785408)&&(Kr(),Ro(d),d=rf(),d!==null)){u.cancelPendingCommit=d(En.bind(null,u,b,w,k,te,re,pe,1,Fe,qe)),Ha(u,B,te,!Ce);return}En(u,b,w,k,te,re,pe,De,Fe,qe)}function Mg(u){for(var d=u;;){var b=d.tag;if((b===0||b===11||b===15)&&d.flags&16384&&(b=d.updateQueue,b!==null&&(b=b.stores,b!==null)))for(var w=0;w<b.length;w++){var k=b[w],B=k.getSnapshot;k=k.value;try{if(!Wr(B(),k))return!1}catch{return!1}}if(b=d.child,d.subtreeFlags&16384&&b!==null)b.return=d,d=b;else{if(d===u)break;for(;d.sibling===null;){if(d.return===null||d.return===u)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Ha(u,d,b,w){d&=~nr,d&=~Ka,u.suspendedLanes|=d,u.pingedLanes&=~d,w&&(u.warmLanes|=d),w=u.expirationTimes;for(var k=d;0<k;){var B=31-Ar(k),te=1<<B;w[B]=-1,k&=~te}b!==0&&ee(u,b,d)}function Yh(){return(et&6)===0?(oi(0),!1):!0}function wr(){if(xt!==null){if(xn===0)var u=xt.return;else u=xt,Kn=ro=null,Hs(u),Ts=null,Ea=0,u=xt;for(;u!==null;)Hh(u.alternate,u),u=u.return;xt=null}}function Pa(u,d){u.finishedWork=null,u.finishedLanes=0;var b=u.timeoutHandle;b!==jo&&(u.timeoutHandle=jo,ju(b)),b=u.cancelPendingCommit,b!==null&&(u.cancelPendingCommit=null,b()),wr(),Rt=u,xt=b=Qi(u.current,null),Tt=d,xn=0,ri=null,un=!1,ia=D(u,d),ll=!1,ol=Or=nr=Ka=ra=It=0,aa=qc=null,Yc=!1,(d&8)!==0&&(d|=d&32);var w=u.entangledLanes;if(w!==0)for(u=u.entanglements,w&=d;0<w;){var k=31-Ar(w),B=1<<k;d|=u[k],w&=~B}return Xa=d,Qe(),b}function ko(u,d){St=null,at.H=qt,d===mn?(d=Te(),xn=3):d===zp?(d=Te(),xn=4):xn=d===ly?8:d!==null&&typeof d=="object"&&typeof d.then=="function"?6:1,ri=d,xt===null&&(It=1,Dd(u,Q(d,u.current)))}function Ru(){var u=na.current;return u===null?!0:(Tt&4194176)===Tt?wa===null:(Tt&62914560)===Tt||(Tt&536870912)!==0?u===wa:!1}function Mc(){var u=at.H;return at.H=qt,u===null?qt:u}function Vr(){var u=at.A;return at.A=wf,u}function Tr(){It=4,un||(Tt&4194176)!==Tt&&na.current!==null||(ia=!0),(ra&134217727)===0&&(Ka&134217727)===0||Rt===null||Ha(Rt,Tt,Or,!1)}function gs(u,d,b){var w=et;et|=2;var k=Mc(),B=Vr();(Rt!==u||Tt!==d)&&($a=null,Pa(u,d)),d=!1;var te=It;e:do try{if(xn!==0&&xt!==null){var re=xt,pe=ri;switch(xn){case 8:wr(),te=6;break e;case 3:case 2:case 6:na.current===null&&(d=!0);var Ce=xn;if(xn=0,ri=null,ql(u,re,pe,Ce),b&&ia){te=0;break e}break;default:Ce=xn,xn=0,ri=null,ql(u,re,pe,Ce)}}ys(),te=It;break}catch(De){ko(u,De)}while(!0);return d&&u.shellSuspendCounter++,Kn=ro=null,et=w,at.H=k,at.A=B,xt===null&&(Rt=null,Tt=0,Qe()),te}function ys(){for(;xt!==null;)Vh(xt)}function xs(u,d){var b=et;et|=2;var w=Mc(),k=Vr();Rt!==u||Tt!==d?($a=null,Fn=Pi()+500,Pa(u,d)):ia=D(u,d);e:do try{if(xn!==0&&xt!==null){d=xt;var B=ri;t:switch(xn){case 1:xn=0,ri=null,ql(u,d,B,1);break;case 2:if(os(B)){xn=0,ri=null,$d(d);break}d=function(){xn===2&&Rt===u&&(xn=7),hn(u)},B.then(d,d);break e;case 3:xn=7;break e;case 4:xn=5;break e;case 7:os(B)?(xn=0,ri=null,$d(d)):(xn=0,ri=null,ql(u,d,B,7));break;case 5:var te=null;switch(xt.tag){case 26:te=xt.memoizedState;case 5:case 27:var re=xt,pe=re.type,Ce=re.pendingProps;if(te?Rp(te):el(pe,Ce)){xn=0,ri=null;var De=re.sibling;if(De!==null)xt=De;else{var Fe=re.return;Fe!==null?(xt=Fe,ku(Fe)):xt=null}break t}}xn=0,ri=null,ql(u,d,B,5);break;case 6:xn=0,ri=null,ql(u,d,B,6);break;case 8:wr(),It=6;break e;default:throw Error(r(462))}}Xs();break}catch(qe){ko(u,qe)}while(!0);return Kn=ro=null,at.H=w,at.A=k,et=b,xt!==null?0:(Rt=null,Tt=0,Qe(),It)}function Xs(){for(;xt!==null&&!ny();)Vh(xt)}function Vh(u){var d=vg(u.alternate,u,Xa);u.memoizedProps=u.pendingProps,d===null?ku(u):xt=d}function $d(u){var d=u,b=d.alternate;switch(d.tag){case 15:case 0:d=mg(b,d,d.pendingProps,d.type,void 0,Tt);break;case 11:d=mg(b,d,d.pendingProps,d.type.render,d.ref,Tt);break;case 5:Hs(d);default:Hh(b,d),d=xt=Ws(d,Xa),d=vg(b,d,Xa)}u.memoizedProps=u.pendingProps,d===null?ku(u):xt=d}function ql(u,d,b,w){Kn=ro=null,Hs(d),Ts=null,Ea=0;var k=d.return;try{if(ug(u,k,d,b,Tt)){It=1,Dd(u,Q(b,u.current)),xt=null;return}}catch(B){if(k!==null)throw xt=k,B;It=1,Dd(u,Q(b,u.current)),xt=null;return}d.flags&32768?(Gt||w===1?u=!0:ia||(Tt&536870912)!==0?u=!1:(un=u=!0,(w===2||w===3||w===6)&&(w=na.current,w!==null&&w.tag===13&&(w.flags|=16384))),Ri(d,u)):ku(d)}function ku(u){var d=u;do{if((d.flags&32768)!==0){Ri(d,un);return}u=d.return;var b=Sg(d.alternate,d,Xa);if(b!==null){xt=b;return}if(d=d.sibling,d!==null){xt=d;return}xt=d=u}while(d!==null);It===0&&(It=5)}function Ri(u,d){do{var b=Eg(u.alternate,u);if(b!==null){b.flags&=32767,xt=b;return}if(b=u.return,b!==null&&(b.flags|=32768,b.subtreeFlags=0,b.deletions=null),!d&&(u=u.sibling,u!==null)){xt=u;return}xt=u=b}while(u!==null);It=6,xt=null}function En(u,d,b,w,k,B,te,re,pe,Ce){var De=at.T,Fe=Si();try{Zi(2),at.T=null,zt(u,d,b,w,Fe,k,B,te,re,pe,Ce)}finally{at.T=De,Zi(Fe)}}function zt(u,d,b,w,k,B,te,re){do ki();while(cl!==null);if((et&6)!==0)throw Error(r(327));var pe=u.finishedWork;if(w=u.finishedLanes,pe===null)return null;if(u.finishedWork=null,u.finishedLanes=0,pe===u.current)throw Error(r(177));u.callbackNode=null,u.callbackPriority=0,u.cancelPendingCommit=null;var Ce=pe.lanes|pe.childLanes;if(Ce|=Uc,j(u,w,Ce,B,te,re),u===Rt&&(xt=Rt=null,Tt=0),(pe.subtreeFlags&10256)===0&&(pe.flags&10256)===0||Ca||(Ca=!0,Af=Ce,Vo=b,Nu(gf,function(){return ki(),null})),b=(pe.flags&15990)!==0,(pe.subtreeFlags&15990)!==0||b?(b=at.T,at.T=null,B=Si(),Zi(2),te=et,et|=4,Sc(u,pe),Il(pe,u),ip(u.containerInfo),u.current=pe,Fd(u,pe.alternate,pe),iy(),et=te,Zi(B),at.T=b):u.current=pe,Ca?(Ca=!1,cl=u,Yo=w):Ks(u,Ce),Ce=u.pendingLanes,Ce===0&&(sa=null),z(pe.stateNode),hn(u),d!==null)for(k=u.onRecoverableError,pe=0;pe<d.length;pe++)Ce=d[pe],k(Ce.value,{componentStack:Ce.stack});return(Yo&3)!==0&&ki(),Ce=u.pendingLanes,(w&4194218)!==0&&(Ce&42)!==0?u===yr?Xo++:(Xo=0,yr=u):Xo=0,oi(0),null}function Ks(u,d){(u.pooledCacheLanes&=d)===0&&(d=u.pooledCache,d!=null&&(u.pooledCache=null,gc(d)))}function ki(){if(cl!==null){var u=cl,d=Af;Af=0;var b=W(Yo),w=32>b?32:b;b=at.T;var k=Si();try{if(Zi(w),at.T=null,cl===null)var B=!1;else{w=Vo,Vo=null;var te=cl,re=Yo;if(cl=null,Yo=0,(et&6)!==0)throw Error(r(331));var pe=et;if(et|=4,Au(te.current),Yd(te,te.current,re,w),et=pe,oi(0,!1),Mr&&typeof Mr.onPostCommitFiberRoot=="function")try{Mr.onPostCommitFiberRoot(jc,te)}catch{}B=!0}return B}finally{Zi(k),at.T=b,Ks(u,d)}}return!1}function Wd(u,d,b){d=Q(b,d),d=bu(u.stateNode,d,2),u=Zt(u,d,2),u!==null&&(F(u,2),hn(u))}function Ot(u,d,b){if(u.tag===3)Wd(u,u,b);else for(;d!==null;){if(d.tag===3){Wd(d,u,b);break}else if(d.tag===1){var w=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(sa===null||!sa.has(w))){u=Q(b,u),b=mc(2),w=Zt(d,b,2),w!==null&&(vu(b,w,d,u),F(w,2),hn(w));break}}d=d.return}}function Qd(u,d,b){var w=u.pingCache;if(w===null){w=u.pingCache=new Dt;var k=new Set;w.set(d,k)}else k=w.get(d),k===void 0&&(k=new Set,w.set(d,k));k.has(b)||(ll=!0,k.add(b),u=Rg.bind(null,u,d,b),d.then(u,u))}function Rg(u,d,b){var w=u.pingCache;w!==null&&w.delete(d),u.pingedLanes|=u.suspendedLanes&b,u.warmLanes&=~b,Rt===u&&(Tt&b)===b&&(It===4||It===3&&(Tt&62914560)===Tt&&300>Pi()-Ms?(et&2)===0&&Pa(u,0):nr|=b,ol===Tt&&(ol=0)),hn(u)}function No(u,d){d===0&&(d=V()),u=wt(u,d),u!==null&&(F(u,d),hn(u))}function Oo(u){var d=u.memoizedState,b=0;d!==null&&(b=d.retryLane),No(u,b)}function Xh(u,d){var b=0;switch(u.tag){case 13:var w=u.stateNode,k=u.memoizedState;k!==null&&(b=k.retryLane);break;case 19:w=u.stateNode;break;case 22:w=u.stateNode._retryCache;break;default:throw Error(r(314))}w!==null&&w.delete(d),No(u,b)}function Nu(u,d){return Lc(u,d)}function Kh(u,d,b,w){this.tag=u,this.key=b,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $s(u){return u=u.prototype,!(!u||!u.isReactComponent)}function Qi(u,d){var b=u.alternate;return b===null?(b=n(u.tag,d,u.key,u.mode),b.elementType=u.elementType,b.type=u.type,b.stateNode=u.stateNode,b.alternate=u,u.alternate=b):(b.pendingProps=d,b.type=u.type,b.flags=0,b.subtreeFlags=0,b.deletions=null),b.flags=u.flags&31457280,b.childLanes=u.childLanes,b.lanes=u.lanes,b.child=u.child,b.memoizedProps=u.memoizedProps,b.memoizedState=u.memoizedState,b.updateQueue=u.updateQueue,d=u.dependencies,b.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},b.sibling=u.sibling,b.index=u.index,b.ref=u.ref,b.refCleanup=u.refCleanup,b}function Ws(u,d){u.flags&=31457282;var b=u.alternate;return b===null?(u.childLanes=0,u.lanes=d,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=b.childLanes,u.lanes=b.lanes,u.child=b.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=b.memoizedProps,u.memoizedState=b.memoizedState,u.updateQueue=b.updateQueue,u.type=b.type,d=b.dependencies,u.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),u}function ba(u,d,b,w,k,B){var te=0;if(w=u,typeof u=="function")$s(u)&&(te=1);else if(typeof u=="string")te=$r&&Hi?Sp(u,b,Oi.current)?26:zc(u)?27:5:$r?Sp(u,b,Oi.current)?26:5:Hi&&zc(u)?27:5;else e:switch(u){case kc:return Qs(b.children,k,B,d);case Jh:te=8,k|=24;break;case ep:return u=n(12,b,d,k|2),u.elementType=ep,u.lanes=B,u;case Jd:return u=n(13,b,d,k),u.elementType=Jd,u.lanes=B,u;case Xl:return u=n(19,b,d,k),u.elementType=Xl,u.lanes=B,u;case zu:return Zd(b,k,B,d);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case Og:case bs:te=10;break e;case Vl:te=9;break e;case Nc:te=11;break e;case Du:te=14;break e;case Ga:te=16,w=null;break e}te=29,b=Error(r(130,u===null?"null":typeof u,"")),w=null}return d=n(te,b,d,k),d.elementType=u,d.type=w,d.lanes=B,d}function Qs(u,d,b,w){return u=n(7,u,w,d),u.lanes=b,u}function Zd(u,d,b,w){u=n(22,u,w,d),u.elementType=zu,u.lanes=b;var k={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var B=k._current;if(B===null)throw Error(r(456));if((k._pendingVisibility&2)===0){var te=wt(B,2);te!==null&&(k._pendingVisibility|=2,Wi(te,B,2))}},attach:function(){var B=k._current;if(B===null)throw Error(r(456));if((k._pendingVisibility&2)!==0){var te=wt(B,2);te!==null&&(k._pendingVisibility&=-3,Wi(te,B,2))}}};return u.stateNode=k,u}function Yl(u,d,b){return u=n(6,u,null,d),u.lanes=b,u}function Rc(u,d,b){return d=n(4,u.children!==null?u.children:[],u.key,d),d.lanes=b,d.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},d}function Do(u,d,b,w,k,B,te,re){this.tag=1,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=jo,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Y(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Y(0),this.hiddenUpdates=Y(null),this.identifierPrefix=w,this.onUncaughtError=k,this.onCaughtError=B,this.onRecoverableError=te,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=re,this.incompleteTransitions=new Map}function Ni(u,d,b,w,k,B,te,re,pe,Ce,De,Fe){return u=new Do(u,d,b,te,re,pe,Ce,Fe),d=1,B===!0&&(d|=24),B=n(3,null,null,d),u.current=B,B.stateNode=u,d=jd(),d.refCount++,u.pooledCache=d,d.refCount++,B.memoizedState={element:w,isDehydrated:b,cache:d},tn(B),u}function Ou(u){return u?(u=Uo,u):Uo}function $h(u){var d=u._reactInternals;if(d===void 0)throw typeof u.render=="function"?Error(r(188)):(u=Object.keys(u).join(","),Error(r(268,u)));return u=v(d),u=u!==null?S(u):null,u===null?null:Oc(u.stateNode)}function kg(u,d,b,w,k,B){k=Ou(k),w.context===null?w.context=k:w.pendingContext=k,w=Qt(d),w.payload={element:b},B=B===void 0?null:B,B!==null&&(w.callback=B),b=Zt(u,w,d),b!==null&&(Wi(b,u,d),Gn(b,u,d))}function Ng(u,d){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var b=u.retryLane;u.retryLane=b!==0&&b<d?b:d}}function Wh(u,d){Ng(u,d),(u=u.alternate)&&Ng(u,d)}var Je={},Qh=vh(),Ii=xL(),zo=Object.assign,Zh=Symbol.for("react.element"),Zs=Symbol.for("react.transitional.element"),Fa=Symbol.for("react.portal"),kc=Symbol.for("react.fragment"),Jh=Symbol.for("react.strict_mode"),ep=Symbol.for("react.profiler"),Og=Symbol.for("react.provider"),Vl=Symbol.for("react.consumer"),bs=Symbol.for("react.context"),Nc=Symbol.for("react.forward_ref"),Jd=Symbol.for("react.suspense"),Xl=Symbol.for("react.suspense_list"),Du=Symbol.for("react.memo"),Ga=Symbol.for("react.lazy"),zu=Symbol.for("react.offscreen"),Dg=Symbol.for("react.memo_cache_sentinel"),tp=Symbol.iterator,Bo=Symbol.for("react.client.reference"),at=Qh.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ef,np,Kl=!1,$l=Array.isArray,tf=t.rendererVersion,Bu=t.rendererPackageName,Lu=t.extraDevToolsConfig,Oc=t.getPublicInstance,Lo=t.getRootHostContext,zg=t.getChildHostContext,Wl=t.prepareForCommit,ip=t.resetAfterCommit,rp=t.createInstance,vs=t.appendInitialChild,Js=t.finalizeInitialChildren,Ql=t.shouldSetTextContent,nf=t.createTextInstance,ap=t.scheduleTimeout,ju=t.cancelTimeout,jo=t.noTimeout,_s=t.isPrimaryRenderer;t.warnsIfNotActing;var Ui=t.supportsMutation,Xr=t.supportsPersistence,pr=t.supportsHydration,sp=t.getInstanceFromNode;t.beforeActiveInstanceBlur,t.afterActiveInstanceBlur;var lp=t.preparePortalMount;t.prepareScopeUpdate,t.getInstanceFromScope;var Zi=t.setCurrentUpdatePriority,Si=t.getCurrentUpdatePriority,va=t.resolveUpdatePriority;t.resolveEventType,t.resolveEventTimeStamp;var Zl=t.shouldAttemptEagerTransition,op=t.detachDeletedInstance;t.requestPostPaintCallback;var Bg=t.maySuspendCommit,el=t.preloadInstance,Kr=t.startSuspendingCommit,qn=t.suspendInstance,rf=t.waitForCommitToBeReady,Cr=t.NotPendingTransition,dt=t.HostTransitionContext,yn=t.resetFormInstance;t.bindToConsole;var fi=t.supportsMicrotasks,af=t.scheduleMicrotask,Ss=t.supportsTestSelectors,Io=t.findFiberRoot,sf=t.getBoundingRect,Iu=t.getTextContent,Es=t.isHiddenSubtree,Cx=t.matchAccessibilityRole,Yn=t.setFocusIfFocusable,cp=t.setupIntersectionObserver,up=t.appendChild,Lg=t.appendChildToContainer,jg=t.commitTextUpdate,Ax=t.commitMount,dp=t.commitUpdate,fp=t.insertBefore,hp=t.insertInContainerBefore,mr=t.removeChild,ei=t.removeChildFromContainer,Uu=t.resetTextContent,Hu=t.hideInstance,lf=t.hideTextInstance,pp=t.unhideInstance,tl=t.unhideTextInstance,of=t.clearContainer,mp=t.cloneInstance,cf=t.createContainerChildSet,gp=t.appendChildToContainerChildSet,Ig=t.finalizeContainerChildren,yp=t.replaceContainerChildren,xp=t.cloneHiddenInstance,bp=t.cloneHiddenTextInstance,uf=t.isSuspenseInstancePending,Pu=t.isSuspenseInstanceFallback,Ug=t.getSuspenseInstanceFallbackErrorDetails,Mx=t.registerSuspenseInstanceRetry,Hg=t.canHydrateFormStateMarker,Pg=t.isFormStateMarkerMatching,vp=t.getNextHydratableSibling,df=t.getFirstHydratableChild,Fg=t.getFirstHydratableChildWithinContainer,Gg=t.getFirstHydratableChildWithinSuspenseInstance,qg=t.canHydrateInstance,Yg=t.canHydrateTextInstance,Vg=t.canHydrateSuspenseInstance,Rx=t.hydrateInstance,Xg=t.hydrateTextInstance,Dc=t.hydrateSuspenseInstance,Kg=t.getNextHydratableInstanceAfterSuspenseInstance,ff=t.commitHydratedContainer,hf=t.commitHydratedSuspenseInstance,$g=t.clearSuspenseBoundary,_p=t.clearSuspenseBoundaryFromContainer,Wg=t.shouldDeleteUnhydratedTailInstances;t.diffHydratedPropsForDevWarnings,t.diffHydratedTextForDevWarnings,t.describeHydratableInstanceForDevWarnings;var Qg=t.validateHydratableInstance,Zg=t.validateHydratableTextInstance,$r=t.supportsResources,Sp=t.isHostHoistableType,pf=t.getHoistableRoot,mf=t.getResource,Ep=t.acquireResource,wp=t.releaseResource,Tp=t.hydrateHoistable,Cp=t.mountHoistable,Ap=t.unmountHoistable,kx=t.createHoistableInstance,Mp=t.prepareToCommitHoistables,Jg=t.mayResourceSuspendCommit,Rp=t.preloadResource,kp=t.suspendResource,Hi=t.supportsSingletons,Np=t.resolveSingletonInstance,Nx=t.clearSingleton,Ox=t.acquireSingletonInstance,ey=t.releaseSingletonInstance,zc=t.isHostSingletonType,Fu=[],nl=-1,Uo={},Ar=Math.clz32?Math.clz32:R,Gu=Math.log,ty=Math.LN2,Bc=128,qu=4194304,Lc=Ii.unstable_scheduleCallback,Yu=Ii.unstable_cancelCallback,ny=Ii.unstable_shouldYield,iy=Ii.unstable_requestPaint,Pi=Ii.unstable_now,Op=Ii.unstable_ImmediatePriority,ry=Ii.unstable_UserBlockingPriority,gf=Ii.unstable_NormalPriority,yf=Ii.unstable_IdlePriority,ay=Ii.log,Dp=Ii.unstable_setDisableYieldValue,jc=null,Mr=null,Wr=typeof Object.is=="function"?Object.is:G,xf=new WeakMap,Dn=[],Vn=0,Vu=null,Xu=0,Qr=[],Zr=0,qa=null,ws=1,_a="",Oi=T(null),Ku=T(null),Ya=T(null),Ic=T(null),Ji=null,Fi=null,Gt=!1,Jr=null,Sa=!1,$u=Error(r(519)),ea=[],Jl=0,Uc=0,Hc=null,Ho=null,Wu=!1,Qu=!1,Va=!1,eo=0,Zu=null,bf=0,Rr=0,to=null,il=!1,Pc=!1,Ju=Object.prototype.hasOwnProperty,mn=Error(r(460)),zp=Error(r(474)),vf={then:function(){}},Po=null,Ts=null,Ea=0,no=Ye(!0),Bp=Ye(!1),Cs=T(null),ta=T(0),na=T(null),wa=null,hi=T(0),As=0,St=null,Jt=null,ti=null,Ta=!1,zn=!1,rl=!1,ed=0,Xn=0,Fc=null,sy=0,_f=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},qt={readContext:ji,use:Pr,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useLayoutEffect:bt,useInsertionEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useSyncExternalStore:bt,useId:bt};qt.useCacheRefresh=bt,qt.useMemoCache=bt,qt.useHostTransitionStatus=bt,qt.useFormState=bt,qt.useActionState=bt,qt.useOptimistic=bt;var pi={readContext:ji,use:Pr,useCallback:function(u,d){return an().memoizedState=[u,d===void 0?null:d],u},useContext:ji,useEffect:ln,useImperativeHandle:function(u,d,b){b=b!=null?b.concat([u]):null,So(4194308,4,Fs.bind(null,d,u),b)},useLayoutEffect:function(u,d){return So(4194308,4,u,d)},useInsertionEffect:function(u,d){So(4,2,u,d)},useMemo:function(u,d){var b=an();d=d===void 0?null:d;var w=u();if(rl){K(!0);try{u()}finally{K(!1)}}return b.memoizedState=[w,d],w},useReducer:function(u,d,b){var w=an();if(b!==void 0){var k=b(d);if(rl){K(!0);try{b(d)}finally{K(!1)}}}else k=d;return w.memoizedState=w.baseState=k,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:k},w.queue=u,u=u.dispatch=kl.bind(null,St,u),[w.memoizedState,u]},useRef:function(u){var d=an();return u={current:u},d.memoizedState=u},useState:function(u){u=Ai(u);var d=u.queue,b=Nd.bind(null,St,d);return d.dispatch=b,[u.memoizedState,b]},useDebugValue:Ve,useDeferredValue:function(u,d){var b=an();return kn(b,u,d)},useTransition:function(){var u=Ai(!1);return u=pc.bind(null,St,u.queue,!0,!1),an().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,d,b){var w=St,k=an();if(Gt){if(b===void 0)throw Error(r(407));b=b()}else{if(b=d(),Rt===null)throw Error(r(349));(Tt&60)!==0||vt(w,d,b)}k.memoizedState=b;var B={value:b,getSnapshot:d};return k.queue=B,ln(In.bind(null,w,B,u),[u]),w.flags|=2048,Ia(9,Xt.bind(null,w,B,b,d),{destroy:void 0},null),b},useId:function(){var u=an(),d=Rt.identifierPrefix;if(Gt){var b=_a,w=ws;b=(w&~(1<<32-Ar(w)-1)).toString(32)+b,d=":"+d+"R"+b,b=ed++,0<b&&(d+="H"+b.toString(32)),d+=":"}else b=sy++,d=":"+d+"r"+b.toString(32)+":";return u.memoizedState=d},useCacheRefresh:function(){return an().memoizedState=gu.bind(null,St)}};pi.useMemoCache=jn,pi.useHostTransitionStatus=Eo,pi.useFormState=cs,pi.useActionState=cs,pi.useOptimistic=function(u){var d=an();d.memoizedState=d.baseState=u;var b={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return d.queue=b,d=Od.bind(null,St,!0,b),b.dispatch=d,[u,d]};var er={readContext:ji,use:Pr,useCallback:yt,useContext:ji,useEffect:ds,useImperativeHandle:Be,useInsertionEffect:fs,useLayoutEffect:hc,useMemo:Nt,useReducer:ya,useRef:rt,useState:function(){return ya(Sr)},useDebugValue:Ve,useDeferredValue:function(u,d){var b=sn();return Gr(b,Jt.memoizedState,u,d)},useTransition:function(){var u=ya(Sr)[0],d=sn().memoizedState;return[typeof u=="boolean"?u:cr(u),d]},useSyncExternalStore:Ke,useId:hs};er.useCacheRefresh=kd,er.useMemoCache=jn,er.useHostTransitionStatus=Eo,er.useFormState=us,er.useActionState=us,er.useOptimistic=function(u,d){var b=sn();return pn(b,Jt,u,d)};var io={readContext:ji,use:Pr,useCallback:yt,useContext:ji,useEffect:ds,useImperativeHandle:Be,useInsertionEffect:fs,useLayoutEffect:hc,useMemo:Nt,useReducer:Ne,useRef:rt,useState:function(){return Ne(Sr)},useDebugValue:Ve,useDeferredValue:function(u,d){var b=sn();return Jt===null?kn(b,u,d):Gr(b,Jt.memoizedState,u,d)},useTransition:function(){var u=Ne(Sr)[0],d=sn().memoizedState;return[typeof u=="boolean"?u:cr(u),d]},useSyncExternalStore:Ke,useId:hs};io.useCacheRefresh=kd,io.useMemoCache=jn,io.useHostTransitionStatus=Eo,io.useFormState=pu,io.useActionState=pu,io.useOptimistic=function(u,d){var b=sn();return Jt!==null?pn(b,Jt,u,d):(b.baseState=u,[u,b.queue.dispatch])};var Sf={isMounted:function(u){return(u=u._reactInternals)?g(u)===u:!1},enqueueSetState:function(u,d,b){u=u._reactInternals;var w=hr(),k=Qt(w);k.payload=d,b!=null&&(k.callback=b),d=Zt(u,k,w),d!==null&&(Wi(d,u,w),Gn(d,u,w))},enqueueReplaceState:function(u,d,b){u=u._reactInternals;var w=hr(),k=Qt(w);k.tag=1,k.payload=d,b!=null&&(k.callback=b),d=Zt(u,k,w),d!==null&&(Wi(d,u,w),Gn(d,u,w))},enqueueForceUpdate:function(u,d){u=u._reactInternals;var b=hr(),w=Qt(b);w.tag=2,d!=null&&(w.callback=d),d=Zt(u,w,b),d!==null&&(Wi(d,u,b),Gn(d,u,b))}},Lp=typeof reportError=="function"?reportError:function(u){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var d=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof u=="object"&&u!==null&&typeof u.message=="string"?String(u.message):String(u),error:u});if(!window.dispatchEvent(d))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",u);return}console.error(u)},ly=Error(r(461)),ni=!1,tr={dehydrated:null,treeContext:null,retryLane:0},kr=T(null),ro=null,Kn=null,oy=typeof AbortController<"u"?AbortController:function(){var u=[],d=this.signal={aborted:!1,addEventListener:function(b,w){u.push(w)}};this.abort=function(){d.aborted=!0,u.forEach(function(b){return b()})}},al=Ii.unstable_scheduleCallback,Fo=Ii.unstable_NormalPriority,on={$$typeof:bs,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},Ef=at.S;at.S=function(u,d){typeof d=="object"&&d!==null&&typeof d.then=="function"&&oe(u,d),Ef!==null&&Ef(u,d)};var sl=T(null),Ei=!1,Pn=!1,ao=!1,Gc=typeof WeakSet=="function"?WeakSet:Set,$n=null,Go=!1,ii=null,Nr=!1,gr=null,qo=8192,wf={getCacheForType:function(u){var d=ji(on),b=d.data.get(u);return b===void 0&&(b=u(),d.data.set(u,b)),b}},td=0,Tf=1,Cf=2,jt=3,cn=4;if(typeof Symbol=="function"&&Symbol.for){var Et=Symbol.for;td=Et("selector.component"),Tf=Et("selector.has_pseudo_class"),Cf=Et("selector.role"),jt=Et("selector.test_id"),cn=Et("selector.text")}var Dt=typeof WeakMap=="function"?WeakMap:Map,et=0,Rt=null,xt=null,Tt=0,xn=0,ri=null,un=!1,ia=!1,ll=!1,Xa=0,It=0,ra=0,Ka=0,nr=0,Or=0,ol=0,qc=null,aa=null,Yc=!1,Ms=0,Fn=1/0,$a=null,sa=null,Ca=!1,cl=null,Yo=0,Af=0,Vo=null,Xo=0,yr=null;return Je.attemptContinuousHydration=function(u){if(u.tag===13){var d=wt(u,67108864);d!==null&&Wi(d,u,67108864),Wh(u,67108864)}},Je.attemptHydrationAtCurrentPriority=function(u){if(u.tag===13){var d=hr(),b=wt(u,d);b!==null&&Wi(b,u,d),Wh(u,d)}},Je.attemptSynchronousHydration=function(u){switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var d=O(u.pendingLanes);if(d!==0){for(u.pendingLanes|=2,u.entangledLanes|=2;d;){var b=1<<31-Ar(d);u.entanglements[1]|=b,d&=~b}hn(u),(et&6)===0&&(Fn=Pi()+500,oi(0))}}break;case 13:d=wt(u,2),d!==null&&Wi(d,u,2),Yh(),Wh(u,2)}},Je.batchedUpdates=function(u,d){return u(d)},Je.createComponentSelector=function(u){return{$$typeof:td,value:u}},Je.createContainer=function(u,d,b,w,k,B,te,re,pe,Ce){return Ni(u,d,!1,null,b,w,B,te,re,pe,Ce,null)},Je.createHasPseudoClassSelector=function(u){return{$$typeof:Tf,value:u}},Je.createHydrationContainer=function(u,d,b,w,k,B,te,re,pe,Ce,De,Fe,qe){return u=Ni(b,w,!0,u,k,B,re,pe,Ce,De,Fe,qe),u.context=Ou(null),b=u.current,w=hr(),k=Qt(w),k.callback=d??null,Zt(b,k,w),u.current.lanes=w,F(u,w),hn(u),u},Je.createPortal=function(u,d,b){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Fa,key:w==null?null:""+w,children:u,containerInfo:d,implementation:b}},Je.createRoleSelector=function(u){return{$$typeof:Cf,value:u}},Je.createTestNameSelector=function(u){return{$$typeof:jt,value:u}},Je.createTextSelector=function(u){return{$$typeof:cn,value:u}},Je.defaultOnCaughtError=function(u){console.error(u)},Je.defaultOnRecoverableError=function(u){Lp(u)},Je.defaultOnUncaughtError=function(u){Lp(u)},Je.deferredUpdates=function(u){var d=at.T,b=Si();try{return Zi(32),at.T=null,u()}finally{Zi(b),at.T=d}},Je.discreteUpdates=function(u,d,b,w,k){var B=at.T,te=Si();try{return Zi(2),at.T=null,u(d,b,w,k)}finally{Zi(te),at.T=B,et===0&&(Fn=Pi()+500)}},Je.findAllNodes=fr,Je.findBoundingRects=function(u,d){if(!Ss)throw Error(r(363));d=fr(u,d),u=[];for(var b=0;b<d.length;b++)u.push(sf(d[b]));for(d=u.length-1;0<d;d--){b=u[d];for(var w=b.x,k=w+b.width,B=b.y,te=B+b.height,re=d-1;0<=re;re--)if(d!==re){var pe=u[re],Ce=pe.x,De=Ce+pe.width,Fe=pe.y,qe=Fe+pe.height;if(w>=Ce&&B>=Fe&&k<=De&&te<=qe){u.splice(d,1);break}else if(w!==Ce||b.width!==pe.width||qe<B||Fe>te){if(!(B!==Fe||b.height!==pe.height||De<w||Ce>k)){Ce>w&&(pe.width+=Ce-w,pe.x=w),De<k&&(pe.width=k-Ce),u.splice(d,1);break}}else{Fe>B&&(pe.height+=Fe-B,pe.y=B),qe<te&&(pe.height=te-Fe),u.splice(d,1);break}}}return u},Je.findHostInstance=$h,Je.findHostInstanceWithNoPortals=function(u){return u=v(u),u=u!==null?A(u):null,u===null?null:Oc(u.stateNode)},Je.findHostInstanceWithWarning=function(u){return $h(u)},Je.flushPassiveEffects=ki,Je.flushSyncFromReconciler=function(u){var d=et;et|=1;var b=at.T,w=Si();try{if(Zi(2),at.T=null,u)return u()}finally{Zi(w),at.T=b,et=d,(et&6)===0&&oi(0)}},Je.flushSyncWork=Yh,Je.focusWithin=function(u,d){if(!Ss)throw Error(r(363));for(u=Xd(u),d=Ag(u,d),d=Array.from(d),u=0;u<d.length;){var b=d[u++],w=b.tag;if(!Es(b)){if((w===5||w===26||w===27)&&Yn(b.stateNode))return!0;for(b=b.child;b!==null;)d.push(b),b=b.sibling}}return!1},Je.getFindAllNodesFailureDescription=function(u,d){if(!Ss)throw Error(r(363));var b=0,w=[];u=[Xd(u),0];for(var k=0;k<u.length;){var B=u[k++],te=B.tag,re=u[k++],pe=d[re];if((te!==5&&te!==26&&te!==27||!Es(B))&&(Ac(B,pe)&&(w.push(Gl(pe)),re++,re>b&&(b=re)),re<d.length))for(B=B.child;B!==null;)u.push(B,re),B=B.sibling}if(b<d.length){for(u=[];b<d.length;b++)u.push(Gl(d[b]));return`findAllNodes was able to match part of the selector:
341
- `+(w.join(" > ")+`
342
-
343
- No matching component was found for:
344
- `)+u.join(" > ")}return null},Je.getPublicRootInstance=function(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 27:case 5:return Oc(u.child.stateNode);default:return u.child.stateNode}},Je.injectIntoDevTools=function(){var u={bundleType:0,version:tf,rendererPackageName:Bu,currentDispatcherRef:at,findFiberByHostInstance:sp,reconcilerVersion:"19.0.0"};if(Lu!==null&&(u.rendererConfig=Lu),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(d.isDisabled||!d.supportsFiber)u=!0;else{try{jc=d.inject(u),Mr=d}catch{}u=!!d.checkDCE}}return u},Je.isAlreadyRendering=function(){return!1},Je.observeVisibleRects=function(u,d,b,w){if(!Ss)throw Error(r(363));u=fr(u,d);var k=cp(u,b,w).disconnect;return{disconnect:function(){k()}}},Je.shouldError=function(){return null},Je.shouldSuspend=function(){return!1},Je.startHostTransition=function(u,d,b,w){if(u.tag!==5)throw Error(r(476));var k=mu(u).queue;pc(u,k,d,Cr,b===null?i:function(){var B=mu(u).next.queue;return Nl(u,B,{},hr()),b(w)})},Je.updateContainer=function(u,d,b,w){var k=d.current,B=hr();return kg(k,B,u,d,b,w),B},Je.updateContainerSync=function(u,d,b,w){return d.tag===0&&ki(),kg(d.current,2,u,d,b,w),2},Je},e.exports.default=e.exports,Object.defineProperty(e.exports,"__esModule",{value:!0})})(Xb)),Xb.exports}var Xw;function vL(){return Xw||(Xw=1,Vb.exports=bL()),Vb.exports}var _L=vL();const SL=du(_L),EL=SL;function wL(e,t,n,i){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function TL(){}function CL(){return!1}const zM={};function AL(e){return e??zM}function ML(){return uu.currentUpdatePriority}function RL(){return null}function kL(e){throw new Error("Not yet implemented.")}function NL(e){return e}function OL(){return zM}function DL(e){e instanceof _r?e.visible=!1:e instanceof Ad&&(e.enabled=!1)}function zL(e){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function BM(e){if(e instanceof Ad){const t=e.__pixireact.parent;if(t){const n=t.__pixireact.filters.indexOf(e);t.__pixireact.filters.splice(n,1),t.filters=t.__pixireact.filters}e.__pixireact.parent=null}}function LM(e,t,...n){}function Kw(e,t,n){if(LM(),t instanceof _r){const i=t,r=t,s=n;i.parent===e&&e.removeChild(r);const l=e.getChildIndex(s);e.addChildAt(r,l)}else if(t instanceof Ad){const s=t.__pixireact.filters.indexOf(n);BM(t),MM(e,t,s)}}function BL(){return!1}function LL(){return!0}function jL(){return null}function IL(){}function UL(){}function $w(e,t){t instanceof Ad&&BM(t),t.destroy()}function HL(e){}function PL(){}function FL(){}function GL(){return-1.1}function qL(){return null}function YL(){var n;if(uu.currentUpdatePriority)return uu.currentUpdatePriority;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Zf.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Zf.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Zf.ContinuousEventPriority;default:return Zf.DefaultEventPriority}}function VL(e){uu.currentUpdatePriority=e}function XL(){return!1}function KL(){return!1}function $L(){}function WL(){}function QL(){}function ZL(e){e instanceof _r?e.visible=!0:e instanceof Ad&&(e.enabled=!0)}function JL(e){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function e8(){return null}const t8={isPrimaryRenderer:!1,noTimeout:-1,NotPendingTransition:null,supportsHydration:!1,supportsMutation:!0,supportsPersistence:!1,warnsIfNotActing:!1,afterActiveInstanceBlur:ZB,appendChild:Yb,appendChildToContainer:Yb,appendInitialChild:Yb,beforeActiveInstanceBlur:JB,cancelTimeout:clearTimeout,clearContainer:eL,commitUpdate:dL,createInstance:gL,createTextInstance:wL,hideTextInstance:zL,unhideTextInstance:JL,detachDeletedInstance:TL,finalizeInitialChildren:CL,getChildHostContext:AL,getCurrentUpdatePriority:ML,getInstanceFromNode:RL,getInstanceFromScope:kL,getPublicInstance:NL,getRootHostContext:OL,hideInstance:DL,insertBefore:Kw,insertInContainerBefore:Kw,maySuspendCommit:BL,preloadInstance:LL,prepareForCommit:jL,preparePortalMount:IL,prepareScopeUpdate:UL,removeChild:$w,removeChildFromContainer:$w,requestPostPaintCallback:HL,resetAfterCommit:PL,resetFormInstance:FL,resolveEventTimeStamp:GL,resolveEventType:qL,resolveUpdatePriority:YL,scheduleTimeout:setTimeout,shouldAttemptEagerTransition:XL,setCurrentUpdatePriority:VL,shouldSetTextContent:KL,startSuspendingCommit:$L,suspendInstance:WL,trackSchedulerEvent:QL,unhideInstance:ZL,waitForCommitToBeReady:e8,rendererPackageName:"@pixi/react",rendererVersion:QB.version},D0=EL(t8);D0.injectIntoDevTools();const dh=new Map;function n8(e,t={}){let n=dh.get(e),i=(n==null?void 0:n.applicationState)??{isInitialised:!1,isInitialising:!1};const r=(n==null?void 0:n.internalState)??{};n||(i.app=new s_,r.rootContainer=AM(i.app.stage));const s=(n==null?void 0:n.fiber)??D0.createContainer(r.rootContainer,Zf.ConcurrentRoot,null,!1,null,"",console.error,console.error,console.error,null);if(!n){let l;e instanceof HTMLCanvasElement&&(l=e),l||(l=document.createElement("canvas"),e.innerHTML="",e.appendChild(l)),r.canvas=l,n={applicationState:i,fiber:s,internalState:r,render:async(f,p)=>{var m;return!i.app.renderer&&!i.isInitialised&&!i.isInitialising&&(i.isInitialising=!0,await i.app.init({...p,canvas:l}),i.isInitialising=!1,i.isInitialised=!0,i={...i},(m=t.onInit)==null||m.call(t,i.app)),Object.entries(p).forEach(([g,x])=>{const v=g;CM(p,v)||(i.app[v]=x)}),D0.updateContainer(_.jsx($B,{value:i,children:f}),s,null,()=>{}),i.app}},dh.set(l,n)}return n}function jM(e){uu.unmountQueue.delete(e);const t=e.fiber;t&&D0.updateContainer(null,t,null,()=>{e.applicationState.app&&e.applicationState.app.destroy(),dh.delete(e.internalState.canvas)})}function i8(){for(const e of uu.unmountQueue)jM(e)}function r8(e){const t=dh.get(e);t&&(t.applicationState.isInitialised?jM(t):uu.unmountQueue.add(t))}function a8(e){const t=dh.get(e);t&&uu.unmountQueue.delete(t)}var TC,CC;const qy=typeof window<"u"&&((TC=window.document)!=null&&TC.createElement||((CC=window.navigator)==null?void 0:CC.product)==="ReactNative")?L.useLayoutEffect:L.useEffect,s8={..._d.defaultTextStyle},l8=L.forwardRef(function(t,n){const{children:i,className:r,defaultTextStyle:s,extensions:l,onInit:c,resizeTo:f,...p}=t,m=yD(),g=L.useRef(null),x=L.useRef(null),v=L.useRef(new Set);L.useImperativeHandle(n,()=>({getApplication(){return g.current},getCanvas(){return x.current}}));const S=L.useCallback(()=>{const T=g.current;T&&(f?"current"in f?f.current instanceof HTMLElement&&(T.resizeTo=f.current):T.resizeTo=f:T.resizeTo=void 0)},[f]),A=L.useCallback(T=>{i8(),g.current=T,S(),c==null||c(T)},[c]);return qy(()=>{if(l){const T=[...l],C=v.current;for(const N of C.values()){const R=T.indexOf(N);R===-1&&(li.remove(N),C.delete(N)),T.splice(R,1)}for(const N of T)li.add(N),C.add(N)}},[l]),qy(()=>{const T=x.current;if(T){let C=dh.get(T);C||(C=n8(T,{onInit:A})),C.render(_.jsx(m,{children:i}),p)}},[p,i,A,f]),qy(()=>{S()},[f]),qy(()=>{s?Object.assign(_d.defaultTextStyle,s):Object.assign(_d.defaultTextStyle,s8)},[s]),L.useEffect(()=>{const T=x.current;if(T)return a8(T),()=>{r8(T)}},[]),_.jsx("canvas",{ref:x,className:r})}),o8=L.forwardRef(function(t,n){return _.jsx(JC,{children:_.jsx(l8,{ref:n,...t})})});function sx(e){Object.assign(m1,e)}function c8(){const e=L.useContext(y_);return LM(e.app instanceof s_,"No Context found with `%s`. Make sure to wrap component with `%s`","Application","AppProvider"),e}function u8({agentName:e,question:t,onRespond:n}){const[i,r]=L.useState(""),s=()=>{const c=i.trim();c&&(n(c),r(""))},l=c=>{c.key==="Enter"&&s()};return _.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(7, 8, 14, 0.8)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:50,animation:"fadeIn 0.2s var(--ease-out) both"},children:_.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--status-warning)",borderRadius:"var(--radius-lg)",boxShadow:"0 0 40px var(--status-warning-glow), var(--shadow-lg)",padding:"var(--sp-6)",maxWidth:440,width:"100%",margin:"0 var(--sp-4)",animation:"scaleIn 0.3s var(--ease-spring) both"},children:[_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",marginBottom:"var(--sp-4)"},children:[_.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--radius-full)",background:"var(--status-warning-glow)",border:"1px solid var(--status-warning)",color:"var(--status-warning)",fontSize:"0.7rem",fontWeight:700},children:"◆"}),_.jsxs("h2",{style:{fontFamily:"var(--font-mono)",fontSize:"0.78rem",fontWeight:700,color:"var(--status-warning)",textTransform:"uppercase",letterSpacing:"0.08em"},children:["Checkpoint — ",e]})]}),_.jsx("p",{style:{color:"var(--text-primary)",fontSize:"0.85rem",lineHeight:1.6,marginBottom:"var(--sp-5)"},children:t}),_.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[_.jsx("input",{type:"text",className:"input",placeholder:"Type your response...",value:i,onChange:c=>r(c.target.value),onKeyPress:l,autoFocus:!0,style:{flex:1}}),_.jsx("button",{onClick:s,className:"btn",style:{background:"var(--status-warning)",color:"var(--text-inverse)",border:"1px solid var(--status-warning)",fontWeight:600,padding:"0 var(--sp-4)"},children:"Send"})]})]})})}const Ww=[16109737,15251594,13935988,13012574,10515018,9133628],Qw=[2890510,4861722,9136404,12886874,1710618,9118976],d8=m0,st=d8/2,ht=7,gn=14,mi=12,gi=5,Ns=10,bn=4,Os=9,At=8;function jf(e,t,n,i,r){e.circle(t,n-1,ht+1),e.fill(r),e.circle(t,n,ht),e.fill(i),e.circle(t-3,n-1,1.5),e.fill(1710618),e.circle(t+3,n-1,1.5),e.fill(1710618),e.circle(t-2.5,n-1.5,.6),e.fill(16777215),e.circle(t+3.5,n-1.5,.6),e.fill(16777215)}function If(e,t,n,i,r,s){e.roundRect(t-i/2,n,i,r,3),e.fill(s),e.moveTo(t-3,n),e.lineTo(t,n+4),e.lineTo(t+3,n),e.stroke({width:1,color:f8(s,.15)})}function Zw(e,t,n,i,r){e.roundRect(t-i-1,n,i,r,2),e.fill(2899536),e.roundRect(t+1,n,i,r,2),e.fill(2899536)}function Jw(e,t,n,i){e.roundRect(t-i-2,n,i+2,3,1),e.fill(1710618),e.roundRect(t,n,i+2,3,1),e.fill(1710618)}function f8(e,t){const n=Math.max(0,(e>>16&255)*(1-t)),i=Math.max(0,(e>>8&255)*(1-t)),r=Math.max(0,(e&255)*(1-t));return Math.floor(n)<<16|Math.floor(i)<<8|Math.floor(r)}function h8(e){const t=new Map;for(let n=0;n<Yv.length;n++){const i=Yv[n],r=Ww[n%Ww.length],s=Qw[n%Qw.length],l=new Na;jf(l,st,At,r,s),If(l,st,At+ht,gn,mi,i),l.roundRect(st-gn/2-bn,At+ht+1,bn,Os,2),l.fill(i),l.roundRect(st+gn/2,At+ht+1,bn,Os,2),l.fill(i),l.circle(st-gn/2-bn/2,At+ht+Os+1,2),l.fill(r),l.circle(st+gn/2+bn/2,At+ht+Os+1,2),l.fill(r),Zw(l,st,At+ht+mi,gi,Ns),Jw(l,st,At+ht+mi+Ns,gi),t.set(`agent-${n}-standing`,e.renderer.generateTexture(l));const c=new Na,f=At+4;jf(c,st,f,r,s),If(c,st,f+ht,gn,mi-2,i),c.roundRect(st-gn/2-bn+1,f+ht+2,bn,Os-3,2),c.fill(i),c.roundRect(st+gn/2-1,f+ht+2,bn,Os-3,2),c.fill(i);const p=6;c.roundRect(st-gi-1,f+ht+mi-2,gi+1,p,2),c.fill(2899536),c.roundRect(st,f+ht+mi-2,gi+1,p,2),c.fill(2899536),t.set(`agent-${n}-seated`,e.renderer.generateTexture(c));const m=new Na,g=At+4;jf(m,st+2,g,r,s),If(m,st+1,g+ht,gn,mi-2,i),m.roundRect(st+gn/2,g+ht+2,bn+4,4,2),m.fill(i),m.roundRect(st+gn/2-2,g+ht+2,bn+4,4,2),m.fill(i),m.circle(st+gn/2+bn+3,g+ht+4,2),m.fill(r),m.circle(st+gn/2+bn+1,g+ht+4,2),m.fill(r),c.roundRect(st-gi-1,g+ht+mi-2,gi+1,p,2),c.fill(2899536),m.roundRect(st,g+ht+mi-2,gi+1,p,2),m.fill(2899536),t.set(`agent-${n}-typing`,e.renderer.generateTexture(m));const x=new Na;jf(x,st,At,r,s),If(x,st,At+ht,gn,mi,i),x.roundRect(st-gn/2-bn,At+ht-1,bn,Os+2,2),x.fill(i),x.roundRect(st+gn/2,At+ht+3,bn,Os-2,2),x.fill(i),x.roundRect(st+1,At+ht+mi,gi,Ns+2,2),x.fill(2899536),x.roundRect(st-gi-1,At+ht+mi-2,gi,Ns,2),x.fill(2899536),x.roundRect(st,At+ht+mi+Ns+1,gi+2,3,1),x.fill(1710618),x.roundRect(st-gi-2,At+ht+mi+Ns-3,gi+1,3,1),x.fill(1710618),t.set(`agent-${n}-walk-right`,e.renderer.generateTexture(x));const v=new Na;jf(v,st,At,r,s),If(v,st,At+ht,gn,mi,i),v.roundRect(st+gn/2,At+ht-1,bn,Os+2,2),v.fill(i),v.roundRect(st-gn/2-bn,At+ht+3,bn,Os-2,2),v.fill(i),v.roundRect(st-gi-1,At+ht+mi,gi,Ns+2,2),v.fill(2899536),v.roundRect(st+1,At+ht+mi-2,gi,Ns,2),v.fill(2899536),v.roundRect(st-gi-2,At+ht+mi+Ns+1,gi+2,3,1),v.fill(1710618),v.roundRect(st,At+ht+mi+Ns-3,gi+1,3,1),v.fill(1710618),t.set(`agent-${n}-walk-left`,e.renderer.generateTexture(v));const S=new Na;jf(S,st,At,r,s),If(S,st,At+ht,gn,mi,i),S.roundRect(st-gn/2-bn,At+ht+1,bn,Os,2),S.fill(i),S.circle(st-gn/2-bn/2,At+ht+Os+1,2),S.fill(r),S.roundRect(st+gn/2,At+ht,bn,6,2),S.fill(i),S.circle(st+gn/2+bn/2+1,At+ht,2),S.fill(r),S.roundRect(st+gn/2+bn/2-1,At+ht-6,6,7,1),S.fill(14142664),S.moveTo(st+gn/2+bn/2,At+ht-7),S.quadraticCurveTo(st+gn/2+bn/2+2,At+ht-11,st+gn/2+bn/2,At+ht-14),S.stroke({width:1,color:16777215,alpha:.4}),S.moveTo(st+gn/2+bn/2+3,At+ht-7),S.quadraticCurveTo(st+gn/2+bn/2+5,At+ht-10,st+gn/2+bn/2+3,At+ht-13),S.stroke({width:1,color:16777215,alpha:.3}),Zw(S,st,At+ht+mi,gi,Ns),Jw(S,st,At+ht+mi+Ns,gi),t.set(`agent-${n}-coffee`,e.renderer.generateTexture(S))}return t}function p8(e,t){const n=e%Yv.length;let i;switch(t){case"working":i="typing";break;case"typing":i="typing";break;case"standing":i="standing";break;case"coffee":i="coffee";break;case"walk-right":i="walk-right";break;case"walk-left":i="walk-left";break;case"delivering":i="walk-right";break;case"idle":i="standing";break;case"seated":i="seated";break;case"checkpoint":case"done":default:i="seated";break}return`agent-${n}-${i}`}function m8(e,t){const n=KC;e.roundRect(0,0,t.totalWidth,t.totalHeight,4),e.fill(ah.wall),e.rect(0,0,t.totalWidth,3),e.fill({color:ah.wallHighlight,alpha:.5}),t2(e,t.corridorH.x,t.corridorH.y,t.corridorH.width,t.corridorH.height,"horizontal"),t2(e,t.corridorV.x,t.corridorV.y,t.corridorV.width,t.corridorV.height,"vertical");for(const x of t.squadOrigins){const{origin:v,width:S,height:A,doorSide:T}=x;T==="right"?rm(e,v.x+S,v.y+A/2-Wo/2,n,Wo):T==="left"?rm(e,v.x-n,v.y+A/2-Wo/2,n,Wo):T==="top"?im(e,v.x+S/2-Wo/2,v.y-n,Wo,n):im(e,v.x+S/2-Wo/2,v.y+A,Wo,n)}const i=t.ceoOffice,r=Math.min(Wo,60);rm(e,i.x+i.width,i.y+i.height/2-r/2,n,r),im(e,i.x+i.width/2-r/2,i.y+i.height,r,n);const s=t.bathroomMale;im(e,s.x+s.width/2-30,s.y+s.height,60,n);const l=t.bathroomFemale;im(e,l.x+l.width/2-30,l.y+l.height,60,n);const c=t.kitchen;rm(e,c.x+c.width,c.y+c.height/2-30,n,60);const f=t.restArea;rm(e,f.x-n,f.y+f.height/2-30,n,60);const p=t.corridorV;if(p.height>100){const x=p.x+p.width/2;for(let v=p.y+60;v<p.y+p.height-40;v+=200)e2(e,x,v)}const m=t.corridorH,g=m.y+m.height/2;for(let x=m.x+80;x<m.x+m.width-80;x+=220)e2(e,x,g);e.roundRect(0,0,t.totalWidth,t.totalHeight,4),e.stroke({width:2,color:5533306,alpha:.6})}function im(e,t,n,i,r){e.rect(t,n,i,r),e.fill(au.floor),e.rect(t-2,n,2,r),e.fill(ah.doorFrame),e.rect(t+i,n,2,r),e.fill(ah.doorFrame)}function rm(e,t,n,i,r){e.rect(t,n,i,r),e.fill(au.floor),e.rect(t,n-2,i,2),e.fill(ah.doorFrame),e.rect(t,n+r,i,2),e.fill(ah.doorFrame)}function e2(e,t,n){e.roundRect(t-8,n-12,16,12,2),e.fill(9133628),e.circle(t,n-16,8),e.fill(5025616),e.circle(t-4,n-20,5),e.fill(3706428),e.circle(t+4,n-18,6),e.fill(6732650)}function t2(e,t,n,i,r,s){e.rect(t,n,i,r),e.fill(au.floor);const l=40;for(let c=0;c<Math.ceil(r/l);c++){for(let f=0;f<Math.ceil(i/l);f++){const p=t+f*l,m=n+c*l;(c+f)%2===0&&(e.rect(p,m,l,l),e.fill({color:au.tile,alpha:.5})),e.moveTo(p,n),e.lineTo(p,n+r),e.stroke({width:.5,color:au.grout,alpha:.3})}e.moveTo(t,n+c*l),e.lineTo(t+i,n+c*l),e.stroke({width:.5,color:au.grout,alpha:.3})}s==="horizontal"?(e.rect(t+10,n+r/2-2,i-20,4),e.fill({color:au.stripe,alpha:.3})):(e.rect(t+i/2-2,n+10,4,r-20),e.fill({color:au.stripe,alpha:.3}))}function n2(e,t,n,i,r,s){e.rect(t,n,i,r),e.fill(la.floor);const l=20;for(let T=0;T<Math.ceil(r/l);T++)for(let C=0;C<Math.ceil(i/l);C++)if((T+C)%2===0){const N=t+C*l,R=n+T*l;e.rect(N,R,l,l),e.fill({color:la.tile,alpha:.4})}for(let T=0;T<=Math.ceil(r/l);T++)e.moveTo(t,n+T*l),e.lineTo(t+i,n+T*l),e.stroke({width:.5,color:la.tileGrout,alpha:.3});for(let T=0;T<=Math.ceil(i/l);T++)e.moveTo(t+T*l,n),e.lineTo(t+T*l,n+r),e.stroke({width:.5,color:la.tileGrout,alpha:.3});const c=Math.min(6,Math.max(2,Math.floor((i-20)/70))),f=(i-20)/c,p=80,m=n+r-p-10;for(let T=0;T<c;T++){const C=t+10+T*f;e.rect(C,m,3,p),e.fill(la.stall),e.rect(C+f-3,m,3,p),e.fill(la.stall),e.roundRect(C+6,m,f-12,p-4,2),e.fill({color:la.stallDoor,alpha:.6}),e.circle(C+f-16,m+p/2,2),e.fill({color:7901340,alpha:.8});const N=C+f/2,R=m+p-24;e.roundRect(N-8,R,16,20,4),e.fill(la.toilet),e.roundRect(N-6,R+2,12,14,3),e.fill(la.toiletSeat),e.roundRect(N-6,R+2,12,14,3),e.stroke({width:.5,color:12434877,alpha:.5})}const g=Math.min(4,Math.max(2,Math.floor(i/100))),x=i/(g+1),v=n+30;e.rect(t+4,n+4,i-8,60),e.fill({color:la.wall,alpha:.3});for(let T=0;T<g;T++){const C=t+x*(T+1);e.roundRect(C-12,n+8,24,20,3),e.fill(la.mirrorFrame),e.roundRect(C-10,n+10,20,16,2),e.fill(la.mirror),e.roundRect(C-6,n+12,6,10,1),e.fill({color:16777215,alpha:.15}),e.roundRect(C-14,v,28,16,3),e.fill(la.sink),e.ellipse(C,v+8,8,5),e.fill(la.sinkBowl),e.ellipse(C,v+8,8,5),e.stroke({width:.5,color:12434877,alpha:.4}),e.roundRect(C-2,v+1,4,6,1),e.fill(la.pipe)}const S=t+i/2,A=n+r-20;e.roundRect(S-12,A-6,24,14,3),e.fill({color:3622735,alpha:.7}),s==="male"?(e.circle(S,A-2,3),e.fill({color:16777215,alpha:.8}),e.rect(S-3,A+1,6,4),e.fill({color:4367861,alpha:.8})):(e.circle(S,A-2,3),e.fill({color:16777215,alpha:.8}),e.moveTo(S-5,A+5),e.lineTo(S+5,A+5),e.lineTo(S,A+1),e.closePath(),e.fill({color:15684432,alpha:.8})),e.rect(t,n,i,r),e.stroke({width:1,color:0,alpha:.08})}function g8(e,t,n,i,r){e.rect(t,n,i,r),e.fill(ir.floor);const s=24;for(let p=0;p<Math.ceil(r/s);p++)for(let m=0;m<Math.ceil(i/s);m++)(p+m)%2===0&&(e.rect(t+m*s,n+p*s,s,s),e.fill({color:ir.tile,alpha:.4}));for(let p=0;p<=Math.ceil(r/s);p++)e.moveTo(t,n+p*s),e.lineTo(t+i,n+p*s),e.stroke({width:.5,color:ir.tileGrout,alpha:.3});for(let p=0;p<=Math.ceil(i/s);p++)e.moveTo(t+p*s,n),e.lineTo(t+p*s,n+r),e.stroke({width:.5,color:ir.tileGrout,alpha:.3});e.roundRect(t+6,n+10,24,r-20,3),e.fill(ir.counter),e.roundRect(t+7,n+11,22,r-22,2),e.fill(ir.counterTop),e.roundRect(t+6,n+10,24,40,3),e.fill(ir.fridge),e.roundRect(t+8,n+12,20,18,2),e.fill(ir.fridgeDoor),e.roundRect(t+8,n+32,20,16,2),e.fill(ir.fridgeDoor),e.roundRect(t+26,n+20,2,8,1),e.fill(ir.fridgeHandle),e.roundRect(t+26,n+36,2,8,1),e.fill(ir.fridgeHandle),e.roundRect(t+10,n+60,16,20,2),e.fill(ir.coffeeMaker),e.circle(t+18,n+64,2),e.fill({color:ir.coffeeMakerLight,alpha:.9});const l=t+i/2-16,c=n+r/2-12;e.roundRect(l,c,32,24,4),e.fill(ir.table),e.roundRect(l+2,c+2,28,20,3),e.fill(ir.tableTop);const f=[{cx:l-6,cy:c+12},{cx:l+38,cy:c+12},{cx:l+16,cy:c+30}];for(const p of f)e.roundRect(p.cx-5,p.cy-5,10,10,3),e.fill(ir.chair);e.circle(t+i/2,n+8,4),e.fill({color:ir.lamp,alpha:.6}),e.circle(t+i/2,n+8,8),e.fill({color:ir.lamp,alpha:.1}),e.rect(t,n,i,r),e.stroke({width:1,color:0,alpha:.08})}function y8(e,t,n,i,r){e.rect(t,n,i,r),e.fill(Ma.floor),e.roundRect(t+8,n+8,i-16,r-16,6),e.fill({color:Ma.carpet,alpha:.2}),e.roundRect(t+12,n+12,i-24,r-24,4),e.stroke({width:1,color:Ma.carpetBorder,alpha:.15});const s=t+10,l=n+10,c=i-20,f=28;e.roundRect(s,l,c,10,3),e.fill(Ma.sofaArm),e.roundRect(s,l+8,c,f-8,4),e.fill(Ma.sofa);const p=(c-12)/3;for(let S=0;S<3;S++)e.roundRect(s+4+S*(p+2),l+10,p,f-14,3),e.fill(Ma.sofaCushion);e.roundRect(s-2,l+6,6,f-4,2),e.fill(Ma.sofaArm),e.roundRect(s+c-4,l+6,6,f-4,2),e.fill(Ma.sofaArm);const m=t+i/2,g=n+r-20;e.roundRect(m-12,g+8,24,10,2),e.fill(Ma.tvStand),e.roundRect(m-20,g-12,40,22,2),e.fill(Ma.tv),e.roundRect(m-18,g-10,36,18,1),e.fill(Ma.tvScreen),e.roundRect(m-14,g-8,10,6,1),e.fill({color:16777215,alpha:.05});const x=t+i-30,v=n+r/2-8;e.roundRect(x,v,20,16,3),e.fill(Ma.sideTable),e.rect(x+3,v+2,8,11),e.fill({color:Ma.magazine,alpha:.7}),e.rect(x+8,v+4,8,10),e.fill({color:Ma.magazineAlt,alpha:.6}),e.roundRect(t+8,n+r-40,12,10,2),e.fill(9133628),e.circle(t+14,n+r-34,7),e.fill(5025616),e.circle(t+11,n+r-38,4),e.fill(3706428),e.rect(t,n,i,r),e.stroke({width:1,color:0,alpha:.08})}function x8(e,t,n){e.rect(0,0,t,n),e.fill(pt.floor);const i=20,r=80;for(let g=0;g<Math.ceil(n/i);g++){const x=g%2*(r/2),v=g*i;e.moveTo(0,v),e.lineTo(t,v),e.stroke({width:1,color:pt.floorGrout,alpha:.4});for(let S=0;S<Math.ceil(t/r)+1;S++){const A=S*r-x;A>0&&A<t&&(e.moveTo(A,v),e.lineTo(A,v+i),e.stroke({width:1,color:pt.floorGrout,alpha:.25}))}g%3===0&&(e.rect(0,v+2,t,i-4),e.fill({color:pt.floorHighlight,alpha:.08}))}const s=42;e.rect(0,s,t,4),e.fill({color:0,alpha:.1}),e.rect(0,0,t,s),e.fill({color:pt.wall,alpha:.2}),e.rect(0,0,t,3),e.fill({color:pt.wallTrim,alpha:.15}),e.rect(0,s-4,t,4),e.fill({color:pt.baseboard,alpha:.2});const l=120,c=t-l*2,f=n-200,p=l,m=100;c>100&&f>60&&(e.roundRect(p+3,m+3,c,f,6),e.fill({color:0,alpha:.08}),e.roundRect(p,m,c,f,6),e.fill({color:pt.rug,alpha:.15}),e.roundRect(p+4,m+4,c-8,f-8,4),e.stroke({width:1.5,color:pt.rugBorder,alpha:.12}),e.roundRect(p+12,m+12,c-24,f-24,3),e.stroke({width:1,color:pt.rugPattern,alpha:.1}))}function b8(e,t,n){const i=t+fl/2,r=n+iu+8;for(let A=0;A<5;A++){const T=A/5*Math.PI*2-Math.PI/2,C=i+Math.cos(T)*10,N=r+14+Math.sin(T)*5;e.circle(C,N,2),e.fill(pt.chairWheel)}e.rect(i-1.5,r+4,3,12),e.fill(pt.chairBase),e.roundRect(i-14,r,28,10,4),e.fill(pt.chairSeat),e.roundRect(i-12,r+1,24,4,3),e.fill({color:pt.chairBack,alpha:.5}),e.roundRect(i-12,r-16,24,18,5),e.fill(pt.chairBack),e.roundRect(i-10,r-14,20,8,3),e.fill({color:16777215,alpha:.05}),e.roundRect(t+3,n+3,fl,iu,4),e.fill({color:0,alpha:.12}),e.roundRect(t,n,fl,iu,4),e.fill(pt.desk),e.roundRect(t+2,n+2,fl-4,iu-4,3),e.fill(pt.deskTop);for(let A=0;A<3;A++){const T=n+10+A*16;e.moveTo(t+6,T),e.lineTo(t+fl-6,T),e.stroke({width:.5,color:pt.deskShadow,alpha:.2})}e.rect(t+2,n+iu-6,fl-4,4),e.fill(pt.deskEdge);const s=4,l=8;e.rect(t+4,n+iu,s,l),e.fill(pt.deskLeg),e.rect(t+fl-4-s,n+iu,s,l),e.fill(pt.deskLeg);const c=32,f=22,p=t+(fl-c)/2,m=n+8;e.roundRect(p+c/2-10,m+f+4,20,4,2),e.fill(pt.monitorStand),e.rect(p+c/2-2,m+f,4,6),e.fill(pt.monitorStand),e.roundRect(p,m,c,f,2),e.fill(pt.monitor),e.roundRect(p+2,m+2,c-4,f-5,1),e.fill(pt.monitorScreen),e.roundRect(p+3,m+3,c-6,6,1),e.fill({color:pt.monitorScreenGlow,alpha:.3});const g=24,x=8,v=p+(c-g)/2,S=m+f+10;e.roundRect(v,S,g,x,2),e.fill(pt.keyboard);for(let A=0;A<3;A++)for(let T=0;T<6;T++)e.rect(v+2+T*3.5,S+1.5+A*2.5,2.5,1.5),e.fill(pt.keyboardKey);e.roundRect(t+fl-18,n+14,7,8,2),e.fill(14142664),e.roundRect(t+fl-11,n+16,3,4,1),e.fill(14142664),e.rect(t+8,n+20,14,18),e.fill(16775620),e.rect(t+8,n+20,14,2),e.fill(16635957),e.rect(t+10,n+24,10,1.5),e.fill(1402304)}function v8(e,t,n){e.roundRect(t+2,n+2,44,64,3),e.fill({color:0,alpha:.1}),e.roundRect(t,n,44,64,3),e.fill(pt.bookshelf),e.roundRect(t+1,n+1,42,62,2),e.stroke({width:1,color:pt.bookshelfEdge,alpha:.3}),e.rect(t+3,n+3,38,58),e.fill({color:6048310,alpha:.5});for(let i=0;i<3;i++){const r=n+8+i*20;e.rect(t+3,r+14,38,3),e.fill(pt.bookshelfEdge),e.rect(t+3,r+17,38,1),e.fill({color:0,alpha:.1});const s=4+i%2;for(let l=0;l<s;l++){const c=t+5+l*(34/s),f=Math.max(4,34/s-2),p=10+(l*3+i*2)%5,m=(l+i*3)%pt.bookColors.length;e.rect(c,r+14-p,f,p),e.fill(pt.bookColors[m]),e.rect(c+1,r+14-p+2,.8,p-4),e.fill({color:16777215,alpha:.15})}i===1&&(e.circle(t+38,r+8,4),e.fill({color:4367861,alpha:.6}),e.circle(t+38,r+8,4),e.stroke({width:.5,color:2001125,alpha:.4}))}e.roundRect(t+14,n-4,8,6,1),e.fill(pt.pot),e.circle(t+18,n-6,5),e.fill(pt.plantLight),e.circle(t+15,n-8,3),e.fill(pt.plant)}function i2(e,t,n){e.ellipse(t+12,n+34,12,3),e.fill({color:0,alpha:.1}),e.moveTo(t+2,n+16),e.lineTo(t+4,n+32),e.lineTo(t+20,n+32),e.lineTo(t+22,n+16),e.closePath(),e.fill(pt.pot),e.roundRect(t,n+14,24,5,2),e.fill(pt.potRim),e.roundRect(t+2,n+14,20,2,1),e.fill({color:16777215,alpha:.08}),e.ellipse(t+12,n+16,10,3),e.fill(pt.soil),e.rect(t+11,n+2,2,14),e.fill(pt.plantDark),e.ellipse(t+6,n+4,7,5),e.fill(pt.plantDark),e.ellipse(t+18,n+2,6,5),e.fill(pt.plantDark),e.ellipse(t+12,n+1,8,6),e.fill(pt.plant),e.ellipse(t+4,n+8,6,4),e.fill(pt.plant),e.ellipse(t+20,n+8,6,4),e.fill(pt.plant),e.ellipse(t+9,n+5,5,4),e.fill(pt.plantLight),e.ellipse(t+15,n+3,5,4),e.fill(pt.plantLight),e.moveTo(t+12,n-2),e.lineTo(t+12,n+6),e.stroke({width:.5,color:pt.plantDark,alpha:.3})}function _8(e,t,n){e.roundRect(t+2,n+2,80,40,4),e.fill({color:0,alpha:.1}),e.roundRect(t,n,80,40,4),e.fill(Br.counter),e.roundRect(t+1,n+1,78,8,3),e.fill(Br.counterTop),e.roundRect(t+2,n+2,76,3,2),e.fill({color:16777215,alpha:.06}),e.roundRect(t+4,n-14,28,38,3),e.fill(Br.machine),e.roundRect(t+5,n-14,26,6,2),e.fill(Br.machineTop),e.roundRect(t+8,n+16,20,4,1),e.fill({color:2503224,alpha:.8}),e.rect(t+13,n+8,3,8),e.fill(Br.machineTop),e.rect(t+20,n+8,3,8),e.fill(Br.machineTop),e.circle(t+18,n-8,2.5),e.fill({color:Br.machineLight,alpha:.9}),e.circle(t+18,n-8,5),e.fill({color:Br.machineLight,alpha:.15}),e.roundRect(t+38,n+8,8,10,2),e.fill(Br.cup),e.roundRect(t+46,n+10,3,5,1),e.fill(Br.cup),e.roundRect(t+48,n+6,8,10,2),e.fill(Br.cupShadow),e.ellipse(t+42,n+20,10,3),e.fill(Br.saucer),e.roundRect(t+60,n+6,16,14,3),e.fill(Br.sink),e.roundRect(t+62,n+8,12,10,2),e.fill({color:5533306,alpha:.8}),e.rect(t+66,n-2,3,10),e.fill(Br.faucet),e.roundRect(t+65,n-4,8,3,1),e.fill(Br.faucet),e.roundRect(t+10,n-30,30,14,2),e.fill(Br.menu),e.rect(t+14,n-27,22,2),e.fill({color:16777215,alpha:.5}),e.rect(t+14,n-23,16,1.5),e.fill({color:16777215,alpha:.3}),e.rect(t+14,n-20,18,1.5),e.fill({color:16777215,alpha:.3})}function S8(e,t,n){e.roundRect(t-16,n-24,128,96,6),e.fill({color:Wa.carpet,alpha:.25}),e.roundRect(t-12,n-20,120,88,4),e.stroke({width:1,color:Wa.carpetPattern,alpha:.2});const i=t+10,r=n-20;e.roundRect(i+2,r+2,76,16,2),e.fill({color:0,alpha:.1}),e.roundRect(i,r,76,16,2),e.fill(Wa.whiteboardFrame),e.roundRect(i+2,r+2,72,12,1),e.fill(Wa.whiteboard),e.rect(i+6,r+4,18,8),e.fill({color:16775620,alpha:.6}),e.rect(i+28,r+4,18,8),e.fill({color:12312315,alpha:.6}),e.rect(i+50,r+4,18,8),e.fill({color:13166281,alpha:.6}),e.roundRect(i+20,r+14,36,3,1),e.fill(Wa.whiteboardFrame),e.roundRect(t+3,n+3,96,48,6),e.fill({color:0,alpha:.1}),e.roundRect(t,n,96,48,6),e.fill(Wa.table),e.roundRect(t+2,n+2,92,44,5),e.fill(Wa.tableTop),e.roundRect(t+6,n+4,40,10,3),e.fill({color:16777215,alpha:.04}),e.roundRect(t+1,n+1,94,46,5),e.stroke({width:1,color:Wa.tableEdge,alpha:.4});const s=4,l=6;e.rect(t+8,n+48,s,l),e.fill(Wa.tableLeg),e.rect(t+84,n+48,s,l),e.fill(Wa.tableLeg);const c=[{cx:t+16,cy:n-10},{cx:t+48,cy:n-10},{cx:t+80,cy:n-10},{cx:t+16,cy:n+56},{cx:t+48,cy:n+56},{cx:t+80,cy:n+56}];for(const f of c){const m=f.cy<n?f.cy-6:f.cy+6;e.roundRect(f.cx-8,m-4,16,10,3),e.fill(Wa.chairBack),e.roundRect(f.cx-7,f.cy-4,14,8,3),e.fill(Wa.chairSeat),e.roundRect(f.cx-5,f.cy-3,10,3,2),e.fill({color:16777215,alpha:.06}),e.circle(f.cx,f.cy+5,2),e.fill(Wa.chair)}e.roundRect(t+10,n+8,18,12,2),e.fill(3622735),e.roundRect(t+11,n+9,16,8,1),e.fill(4545124),e.rect(t+60,n+12,12,16),e.fill({color:16777215,alpha:.7}),e.rect(t+62,n+14,8,1),e.fill({color:3355443,alpha:.3}),e.rect(t+62,n+17,6,1),e.fill({color:3355443,alpha:.3}),e.roundRect(t+40,n+10,6,14,2),e.fill({color:4367861,alpha:.6}),e.roundRect(t+41,n+7,4,4,1),e.fill({color:9489145,alpha:.5})}const E8={running:md.statusRunning,idle:md.statusIdle,completed:md.statusCompleted,checkpoint:md.statusCheckpoint};function w8(e,t,n,i){const r=n*.85,s=t+(n-r)/2,l=6,c=30;e.roundRect(s+2,l+2,r,c,8),e.fill({color:0,alpha:.15}),e.roundRect(s,l,r,c,8),e.fill({color:md.background,alpha:.85}),e.roundRect(s+2,l+1,r-4,8,6),e.fill({color:md.backgroundGlow,alpha:.4}),e.roundRect(s,l,r,c,8),e.stroke({width:1,color:16777215,alpha:.08});const f=E8[i]??md.statusIdle,p=s+r-18,m=l+c/2;e.circle(p,m,7),e.fill({color:f,alpha:.2}),e.circle(p,m,4),e.fill(f),e.circle(p-1,m-1,1.5),e.fill({color:16777215,alpha:.3}),e.circle(s+14,m,2),e.fill({color:16777215,alpha:.1})}sx({Container:_r,Graphics:Na,Sprite:ch,Text:ax});function x_({agent:e,textures:t,bubbleText:n,animX:i,animY:r,animPose:s}){const l=p8(e.colorIndex,s),c=t.get(l),f=q4[e.status==="walking"?"idle":e.status]??8947848,p=e.status==="checkpoint",m=L.useCallback(x=>{x.clear(),x.circle(0,0,m0/2+6),x.fill({color:f,alpha:p?.4:.15})},[f,p]),g=L.useCallback(x=>{if(x.clear(),!n)return;const v=Math.min(n.length*5+16,160);x.roundRect(-v/2,-42,v,22,6),x.fill({color:1710638,alpha:.9}),x.moveTo(-4,-20),x.lineTo(4,-20),x.lineTo(0,-15),x.closePath(),x.fill({color:1710638,alpha:.9})},[n]);return _.jsxs("container",{x:i,y:r,children:[_.jsx("graphics",{draw:m}),c&&_.jsx("sprite",{texture:c,anchor:.5}),_.jsx("text",{text:e.name,y:m0/2+4,anchor:{x:.5,y:0},style:{fontSize:9,fill:"#cccccc",fontFamily:"sans-serif"}}),p&&_.jsx("text",{text:"⚠",y:-m0/2-12,anchor:.5,style:{fontSize:14,fill:"#ff9800",fontFamily:"sans-serif"}}),n&&_.jsxs(_.Fragment,{children:[_.jsx("graphics",{draw:g}),_.jsx("text",{text:n.length>80?n.slice(-80)+"…":n,y:-31,anchor:{x:.5,y:.5},style:{fontSize:8,fill:"#ffffff",fontFamily:"sans-serif",wordWrap:!0,wordWrapWidth:140}})]})]})}sx({Container:_r,Graphics:Na,Text:ax});function T8({squadName:e,status:t,agents:n,textures:i,bubbles:r,animStates:s,originX:l,originY:c,roomWidth:f,roomHeight:p}){const m={x:0,y:0},g=bm(m,f,p),x=$C(m,f,p),v=L.useCallback(S=>{S.clear(),x8(S,f,p),w8(S,0,f,t);for(let A=0;A<n.length;A++){const T=th(A,m);b8(S,T.x-48,T.y-32)}_8(S,g.x,g.y),S8(S,x.x,x.y),v8(S,f-60,44),i2(S,10,p-50),i2(S,f-40,50)},[n.length,t,f,p]);return _.jsxs("container",{x:l,y:c,children:[_.jsx("graphics",{draw:v}),_.jsx("text",{text:e,x:f/2,y:22,anchor:.5,style:{fontSize:14,fill:"#ffffff",fontFamily:"sans-serif",fontWeight:"bold"}}),n.map(S=>{const A=`${e}:${S.id}`,T=r[A],C=s[S.id];return C!=null&&C.isExternalTransit?null:_.jsx(x_,{agent:S,textures:i,bubbleText:(T==null?void 0:T.text)??null,animX:(C==null?void 0:C.x)??S.position.x,animY:(C==null?void 0:C.y)??S.position.y,animPose:(C==null?void 0:C.pose)??(S.status==="working"?"typing":"seated")},S.id)})]})}function C8(e,t,n,i,r){e.rect(t,n,i,r),e.fill(Aa.floor);const s=16,l=60;for(let F=0;F<Math.ceil(r/s);F++){const j=F%2*(l/2),ee=n+F*s;e.moveTo(t,ee),e.lineTo(t+i,ee),e.stroke({width:.5,color:4861984,alpha:.3});for(let P=0;P<Math.ceil(i/l)+1;P++){const W=t+P*l-j;W>t&&W<t+i&&(e.moveTo(W,ee),e.lineTo(W,ee+s),e.stroke({width:.5,color:4861984,alpha:.2}))}}const c=30,f=i-c*2,p=r-c*2,m=t+c,g=n+c;e.roundRect(m+2,g+2,f,p,6),e.fill({color:0,alpha:.1}),e.roundRect(m,g,f,p,6),e.fill({color:Aa.carpet,alpha:.6}),e.roundRect(m+6,g+6,f-12,p-12,4),e.stroke({width:1.5,color:Aa.carpetBorder,alpha:.4}),e.roundRect(m+14,g+14,f-28,p-28,3),e.stroke({width:1,color:16766287,alpha:.15});const x=t+8,v=n+40,S=6,A=80;e.roundRect(x-2,v-2,S+4,A+4,2),e.fill(Aa.windowFrame),e.roundRect(x,v,S,A,1),e.fill(Aa.window),e.rect(x+1,v+4,2,A/3),e.fill({color:16777215,alpha:.2}),e.roundRect(x-4,v+A+2,S+8,3,1),e.fill(Aa.windowSill);const T=120,C=60,N=t+i/2-T/2,R=n+r/2-C/2-10;e.roundRect(N+3,R+3,T,C,4),e.fill({color:0,alpha:.12}),e.roundRect(N,R,T,C,4),e.fill(Aa.desk),e.roundRect(N+3,R+3,T-6,C-6,3),e.fill(Aa.deskTop),e.roundRect(N+1,R+1,T-2,C-2,4),e.stroke({width:1,color:Aa.deskEdge,alpha:.3}),e.roundRect(N+20,R+8,32,22,2),e.fill(2236976),e.roundRect(N+22,R+10,28,16,1),e.fill(1981020),e.roundRect(N+18,R+34,36,10,2),e.fill(3355456),e.rect(N+70,R+10,16,22),e.fill({color:16777215,alpha:.7}),e.rect(N+72,R+14,10,1),e.fill({color:3355443,alpha:.3}),e.rect(N+72,R+17,8,1),e.fill({color:3355443,alpha:.3}),e.roundRect(N+90,R+12,10,14,2),e.fill(3622735),e.circle(N+100,R+42,5),e.fill(14142664),e.circle(N+100,R+42,3),e.fill(7951688);const O=N+T/2,H=R+C+16;e.roundRect(O-14,H-4,28,16,6),e.fill(Aa.chair),e.roundRect(O-12,H-8,24,12,4),e.fill(Aa.chairSeat),e.roundRect(O-8,H-6,16,4,2),e.fill({color:16777215,alpha:.06}),e.circle(O,H+14,3),e.fill(4473924);for(const F of[-8,0,8])e.circle(O+F,H+18,1.5),e.fill(3355443);const D=t+i-54,q=n+20;e.roundRect(D,q,44,80,3),e.fill(Aa.bookshelf);const Z=[15022389,2001125,4431943,16750592,9315498,35195];for(let F=0;F<3;F++){const j=q+8+F*26;e.rect(D+3,j+18,38,3),e.fill(9139029);for(let ee=0;ee<5;ee++){const P=D+5+ee*7,W=12+(ee*3+F*2)%6;e.rect(P,j+18-W,5,W),e.fill(Z[(ee+F*2)%Z.length])}}const V=t+i-54,Y=n+r-60;e.roundRect(V,Y+10,24,16,2),e.fill(6111287),e.rect(V+10,Y+4,4,8),e.fill(7901340),e.circle(V+12,Y,10),e.fill(Aa.globe),e.circle(V+12,Y,10),e.stroke({width:.5,color:2001125,alpha:.4}),e.circle(V+9,Y-3,3),e.fill({color:16777215,alpha:.15}),e.roundRect(N+44,R+38,36,10,2),e.fill(Aa.nameplate),e.roundRect(N+44,R+38,36,10,2),e.stroke({width:.5,color:13215744,alpha:.5}),e.rect(t,n,i,r),e.stroke({width:1,color:0,alpha:.08})}sx({Container:_r,Graphics:Na,Text:ax});const r2=["Precisamos escalar o time de vendas...","O Q4 vai ser decisivo.","Investir mais em marketing digital.","Meta trimestral no caminho certo.","Revisar budget de R&D...","Nova parceria pode mudar tudo.","Churn rate precisa cair 20%.","Hora de expandir para LATAM.","Reunião com investidores amanhã.","NPS subiu 15 pontos!","Cultura da empresa vem primeiro.","Mais dados antes de decidir.","Vamos automatizar esse processo.","Roadmap do próximo quarter...","Reter talentos é prioridade.","Revenue cresceu 30% no trimestre.","Precisamos de mais diversidade no time.","O mercado está mudando rápido.","Foco no cliente sempre.","Inovação é nosso diferencial."],Yy=900,a2=2400,A8=6e3,M8={id:"ceo",name:"CEO",colorIndex:3,status:"working",deskIndex:0,position:{x:0,y:0},targetPosition:null};function R8({x:e,y:t,width:n,height:i,textures:r,ticker:s}){const[l,c]=L.useState(null),[f,p]=L.useState("seated"),m=L.useRef(0),g=L.useRef(Yy+Math.floor(Math.random()*(a2-Yy))),x=L.useRef(null),v=n/2,S=i/2+10,A=L.useCallback(T=>{T.clear(),C8(T,0,0,n,i)},[n,i]);return L.useEffect(()=>{if(!s)return;const T=()=>{m.current++;const C=m.current,N=Math.floor(C/48)%2===0?"typing":"seated";if(p(N),g.current--,g.current<=0){const R=r2[Math.floor(Math.random()*r2.length)];c(R),p("standing"),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{c(null)},A8),g.current=Yy+Math.floor(Math.random()*(a2-Yy))}};return s.add(T),()=>{s.remove(T),x.current&&clearTimeout(x.current)}},[s]),_.jsxs("container",{x:e,y:t,children:[_.jsx("graphics",{draw:A}),_.jsx("text",{text:"CEO",x:n/2,y:12,anchor:.5,style:{fontSize:13,fill:"#ffd700",fontFamily:"sans-serif",fontWeight:"bold"}}),_.jsx(x_,{agent:M8,textures:r,bubbleText:l,animX:v,animY:S,animPose:f})]})}const Wb=150,k8=48,Qb=30,Vy=3,N8=4e3,Xy=600,Zb=1800,O8=60,s2=900,l2=5e3,o2=[["Cafe novo?","Sim, colombiano!"],["Viu o deploy?","Passou nos testes!"],["Reuniao as 3?","Vou confirmar."],["Bug no login?","Ja corrigi."],["Almoco onde?","Sushi hoje?"],["PR aprovado?","Mergeei agora."],["Ta ocupado?","Pode falar."],["Deadline?","Sexta-feira."],["Novo feature?","Ficou muito bom!"],["Ajuda aqui?","Claro, mostra."],["Sprint review?","Amanha cedo."],["Stand-up?","Ja comecou!"],["Refatorei aquele modulo.","Ficou mais limpo."],["Testes passando?","Todos verdes!"],["Viu o Figma?","Design top!"],["Pipeline rodou?","Em 2 min."],["Code review?","Ja olhei, aprovo."],["Qual branch?","feature/office."],["Bom dia!","Bom dia! Tudo bem?"],["Feriado proximo?","Semana que vem!"]];function D8(e,t,n,i,r,s){const l={x:0,y:0},c=Math.random();if(c<.2){const f={x:r+e.x,y:s+e.y},p=vm(f,`squad-${i}`,"kitchen",n),m=J4(n);return{x:m.x,y:m.y,destination:"kitchen",waypoints:p,isExternal:!0}}else if(c<.35){const f={x:r+e.x,y:s+e.y},p=vm(f,`squad-${i}`,"rest-area",n),m=eD(n);return{x:m.x,y:m.y,destination:"restArea",waypoints:p,isExternal:!0}}else if(c<.45){const f=Math.random()<.5?"male":"female",p={x:r+e.x,y:s+e.y},m=f==="male"?"bathroom-male":"bathroom-female",g=vm(p,`squad-${i}`,m,n),x=Z4(n,f);return{x:x.x,y:x.y,destination:m,waypoints:g,isExternal:!0}}else if(c<.6){const f=$C(l,t.width,t.height);return{x:f.x+(Math.random()-.5)*40,y:f.y+(Math.random()-.5)*30,destination:"meeting"}}else if(c<.75){const f=bm(l,t.width,t.height);return{x:f.x+(Math.random()-.5)*30,y:f.y+(Math.random()-.5)*20,destination:"coffee"}}else if(c<.9){const f={x:r+e.x,y:s+e.y},p=tD(n),m=[f,n.doorPoints[`squad-${i}`],p];return{x:p.x,y:p.y,destination:"corridor",waypoints:m,isExternal:!0}}else{const f=Math.floor(Math.random()*4),p=th(f,l,t.width,t.height);return{x:p.x+(Math.random()-.5)*40,y:p.y+(Math.random()-.5)*20,destination:"neighbor"}}}function z8(e){const[t,n]=L.useState({}),i=L.useRef({}),r=L.useRef({}),s=L.useRef({}),l=L.useRef({}),c=L.useRef(0),f=L.useRef({}),p=L.useRef({});L.useEffect(()=>{const g=ai.subscribe((x,v)=>{var T,C;const S=x.bubbles,A=v.bubbles;for(const N of Object.keys(S))if(((T=S[N])==null?void 0:T.updatedAt)!==((C=A[N])==null?void 0:C.updatedAt)){f.current[N]&&clearTimeout(f.current[N]);const[R,O]=N.split(":");f.current[N]=setTimeout(()=>{ai.getState().clearBubble(R,O),delete f.current[N]},N8)}});return()=>{g();for(const x of Object.values(f.current))clearTimeout(x);f.current={}}},[]);const m=L.useCallback(()=>{c.current++;const g=c.current,x=ai.getState(),v={},S=T0(x.rooms.length);for(const[A,T]of Object.entries(x.agentVisuals)){i.current[A]||(i.current[A]={}),r.current[A]||(r.current[A]={}),v[A]={};const C=x.rooms.indexOf(A),N=S.squadOrigins[C],R=(N==null?void 0:N.origin)??{x:0,y:0},O=[];for(const H of T){const D=i.current[A],q=r.current[A],Z=`${A}:${H.id}`;q[H.id]||(q[H.id]={x:H.position.x,y:H.position.y,baseY:H.position.y},s.current[Z]=Math.floor(Math.random()*Zb));const V=q[H.id];if(H.targetPosition&&(!D[H.id]||D[H.id].progress>=1)){const F=D[H.id];if(F!=null&&F.isExternalTransit){const j=F.globalX??V.x+R.x,ee=F.globalY??V.y+R.y,P={x:j,y:ee},W={x:H.targetPosition.x+R.x,y:H.targetPosition.y+R.y},z=l.current[Z],K=z==="kitchen"?"kitchen":z==="restArea"?"rest-area":z==="bathroom-male"?"bathroom-male":z==="bathroom-female"?"bathroom-female":`squad-${C}`,G=vm(P,K,`squad-${C}`,S);G[G.length-1]=W;const Q=G.shift(),I=G.length>0?G.shift():Q,$=Ry(Q,I);D[H.id]={startX:Q.x,startY:Q.y,targetX:I.x,targetY:I.y,progress:0,duration:Math.max(30,Math.ceil($/Vy)),baseY:H.targetPosition.y,waypointQueue:G,isExternalTransit:!0,globalX:j,globalY:ee}}else D[H.id]={startX:V.x,startY:V.baseY,targetX:H.targetPosition.x,targetY:H.targetPosition.y,progress:0,duration:Wb,baseY:H.targetPosition.y,waypointQueue:[],isExternalTransit:!1}}if(H.status==="idle"&&(!D[H.id]||D[H.id].progress>=1)){const F=D[H.id];if(F!=null&&F.isExternalTransit&&F.waypointQueue.length===0&&F.progress>=1&&(F.globalX!==void 0&&F.globalY!==void 0&&(V.x=F.globalX-R.x,V.y=F.globalY-R.y,V.baseY=V.y),F.isExternalTransit=!1,F.globalX=void 0,F.globalY=void 0),s.current[Z]===void 0&&(s.current[Z]=Xy+Math.floor(Math.random()*(Zb-Xy))),s.current[Z]--,s.current[Z]<=0){const j=D[H.id];if(j!=null&&j.isExternalTransit){const ee=j.globalX??V.x+R.x,P=j.globalY??V.y+R.y,W={x:ee,y:P},z=th(H.deskIndex,{x:0,y:0}),K={x:z.x+R.x,y:z.y+R.y},G=l.current[Z],Q=G==="kitchen"?"kitchen":G==="restArea"?"rest-area":G==="bathroom-male"?"bathroom-male":G==="bathroom-female"?"bathroom-female":`squad-${C}`,I=vm(W,Q,`squad-${C}`,S);I[I.length-1]=K;const $=I.shift(),ne=I.length>0?I.shift():$,X=Ry($,ne);l.current[Z]="neighbor",D[H.id]={startX:$.x,startY:$.y,targetX:ne.x,targetY:ne.y,progress:0,duration:Math.max(30,Math.ceil(X/Vy)),baseY:z.y,waypointQueue:I,isExternalTransit:!0,globalX:ee,globalY:P}}else{const P=D8(R,N??{width:ec,height:Za},S,C,V.x,V.baseY);if(l.current[Z]=P.destination,P.isExternal&&P.waypoints&&P.waypoints.length>1){const W=[...P.waypoints],z=W.shift(),K=W.length>0?W.shift():z,G=Ry(z,K);D[H.id]={startX:z.x,startY:z.y,targetX:K.x,targetY:K.y,progress:0,duration:Math.max(30,Math.ceil(G/Vy)),baseY:P.y-R.y,waypointQueue:W,isExternalTransit:!0,globalX:z.x,globalY:z.y}}else D[H.id]={startX:V.x,startY:V.baseY,targetX:P.x,targetY:P.y,progress:0,duration:Wb+Math.floor(Math.random()*30),baseY:P.y,waypointQueue:[],isExternalTransit:!1}}s.current[Z]=Xy+Math.floor(Math.random()*(Zb-Xy))}}const Y=D[H.id];if(Y&&Y.progress<1){Y.progress=Math.min(1,Y.progress+1/Y.duration);const F=$4(Y.progress);if(Y.isExternalTransit){const j=My(Y.startX,Y.targetX,F),ee=My(Y.startY,Y.targetY,F);Y.globalX=j,Y.globalY=ee,V.x=j-R.x,V.y=ee-R.y;const P=Math.floor(g/Qb)%2===0?"walk-right":"walk-left";v[A][H.id]={x:V.x,y:V.y,pose:P,isExternalTransit:!0,globalX:j,globalY:ee}}else{V.x=My(Y.startX,Y.targetX,F),V.y=My(Y.startY,Y.targetY,F),V.baseY=Y.baseY;const j=Math.floor(g/Qb)%2===0?"walk-right":"walk-left";v[A][H.id]={x:V.x,y:V.y,pose:j}}}else if(Y&&Y.progress>=1&&Y.waypointQueue.length>0){const F=Y.waypointQueue.shift(),j={x:Y.targetX,y:Y.targetY},ee=Ry(j,F);Y.startX=Y.targetX,Y.startY=Y.targetY,Y.targetX=F.x,Y.targetY=F.y,Y.progress=0,Y.duration=Y.isExternalTransit?Math.max(30,Math.ceil(ee/Vy)):Wb,Y.isExternalTransit&&(Y.globalX=Y.startX,Y.globalY=Y.startY);const P=Math.floor(g/Qb)%2===0?"walk-right":"walk-left";Y.isExternalTransit?v[A][H.id]={x:V.x,y:V.y,pose:P,isExternalTransit:!0,globalX:Y.startX,globalY:Y.startY}:v[A][H.id]={x:V.x,y:V.y,pose:P}}else if(H.status==="working"){const F=Math.floor(g/k8)%2===0?"typing":"seated";v[A][H.id]={x:V.x,y:V.baseY,pose:F}}else if(H.status==="idle"){const F=l.current[Z]??"coffee",j=D[H.id];if((j==null?void 0:j.isExternalTransit)??!1)v[A][H.id]={x:V.x,y:V.y,pose:"standing",isExternalTransit:!0,globalX:(j==null?void 0:j.globalX)??V.x+R.x,globalY:(j==null?void 0:j.globalY)??V.y+R.y};else{const P=Math.sin(g*.07+H.deskIndex*1.5)*2;let W;F==="coffee"||F==="kitchen"?W="coffee":F==="meeting"||F==="neighbor"?W=Math.floor(g/90)%2===0?"standing":"coffee":F==="restArea"?W="seated":(F.startsWith("bathroom"),W="standing"),v[A][H.id]={x:V.x,y:V.baseY+P,pose:W},O.push({agentKey:Z,agentId:H.id,agentName:H.name,x:V.x,y:V.baseY})}}else H.status==="checkpoint"?v[A][H.id]={x:V.x,y:V.baseY,pose:"seated"}:v[A][H.id]={x:V.x,y:V.baseY,pose:"seated"}}if(g%60===0&&O.length>=2)for(let H=0;H<O.length;H++){const D=O[H];if(!(p.current[D.agentKey]&&g-p.current[D.agentKey]<s2)&&!x.bubbles[D.agentKey])for(let q=H+1;q<O.length;q++){const Z=O[q];if(p.current[Z.agentKey]&&g-p.current[Z.agentKey]<s2||x.bubbles[Z.agentKey])continue;const V=D.x-Z.x,Y=D.y-Z.y;if(Math.sqrt(V*V+Y*Y)<O8){const[j,ee]=o2[Math.floor(Math.random()*o2.length)];x.appendBubble(A,D.agentId,j),setTimeout(()=>{ai.getState().appendBubble(A,Z.agentId,ee)},1500),p.current[D.agentKey]=g,p.current[Z.agentKey]=g;const P=`${A}:${D.agentId}`,W=`${A}:${Z.agentId}`;f.current[P]&&clearTimeout(f.current[P]),f.current[W]&&clearTimeout(f.current[W]),f.current[P]=setTimeout(()=>{ai.getState().clearBubble(A,D.agentId),delete f.current[P]},l2),f.current[W]=setTimeout(()=>{ai.getState().clearBubble(A,Z.agentId),delete f.current[W]},l2+1500);break}}}}n(v)},[]);return L.useEffect(()=>{if(e)return e.add(m),()=>{e.remove(m)}},[e,m]),t}sx({Container:_r,Graphics:Na,Text:ax});const B8=.3,L8=2;function j8(){const{app:e}=c8(),t=L.useRef(null),[n,i]=L.useState(new Map),r=L.useRef(null),s=ai(x=>x.rooms),l=ai(x=>x.agentVisuals),c=ai(x=>x.bubbles),f=vr(x=>x.activeStates),p=z8((e==null?void 0:e.ticker)??null),m=L.useMemo(()=>T0(s.length),[s.length]);L.useEffect(()=>{e!=null&&e.renderer&&i(h8(e))},[e]);const g=L.useCallback(x=>{x.clear(),m8(x,m),n2(x,m.bathroomMale.x,m.bathroomMale.y,m.bathroomMale.width,m.bathroomMale.height,"male"),n2(x,m.bathroomFemale.x,m.bathroomFemale.y,m.bathroomFemale.width,m.bathroomFemale.height,"female"),g8(x,m.kitchen.x,m.kitchen.y,m.kitchen.width,m.kitchen.height),y8(x,m.restArea.x,m.restArea.y,m.restArea.width,m.restArea.height)},[m]);return L.useEffect(()=>{const x=e==null?void 0:e.canvas;if(!x)return;const v=C=>{const N=t.current;N&&(r.current={startX:C.clientX,startY:C.clientY,pivotX:N.position.x,pivotY:N.position.y},x.setPointerCapture(C.pointerId))},S=C=>{const N=t.current,R=r.current;!N||!R||(N.position.x=R.pivotX+(C.clientX-R.startX),N.position.y=R.pivotY+(C.clientY-R.startY))},A=C=>{r.current=null,x.releasePointerCapture(C.pointerId)},T=C=>{C.preventDefault();const N=t.current;if(!N)return;const R=N.scale.x,O=C.deltaY>0?.9:1.1,H=Math.max(B8,Math.min(L8,R*O)),D=x.getBoundingClientRect(),q=C.clientX-D.left,Z=C.clientY-D.top,V=H/R;N.position.x=q-(q-N.position.x)*V,N.position.y=Z-(Z-N.position.y)*V,N.scale.set(H)};return x.addEventListener("pointerdown",v),x.addEventListener("pointermove",S),x.addEventListener("pointerup",A),x.addEventListener("pointerleave",A),x.addEventListener("wheel",T,{passive:!1}),()=>{x.removeEventListener("pointerdown",v),x.removeEventListener("pointermove",S),x.removeEventListener("pointerup",A),x.removeEventListener("pointerleave",A),x.removeEventListener("wheel",T)}},[e]),_.jsxs("container",{ref:t,children:[_.jsx("graphics",{draw:g}),m.corridorV.height>0&&_.jsx("text",{text:"Corredor",x:m.corridorV.x+m.corridorV.width/2,y:m.corridorV.y+8,anchor:{x:.5,y:0},style:{fontSize:11,fill:"#666666",fontFamily:"sans-serif",fontWeight:"bold"}}),_.jsx("text",{text:"Corredor",x:m.corridorH.x+m.corridorH.width/2,y:m.corridorH.y+8,anchor:{x:.5,y:0},style:{fontSize:11,fill:"#666666",fontFamily:"sans-serif",fontWeight:"bold"}}),_.jsx("text",{text:"WC ♂",x:m.bathroomMale.x+m.bathroomMale.width/2,y:m.bathroomMale.y+m.bathroomMale.height-8,anchor:{x:.5,y:1},style:{fontSize:10,fill:"#546e7a",fontFamily:"sans-serif",fontWeight:"bold"}}),_.jsx("text",{text:"WC ♀",x:m.bathroomFemale.x+m.bathroomFemale.width/2,y:m.bathroomFemale.y+m.bathroomFemale.height-8,anchor:{x:.5,y:1},style:{fontSize:10,fill:"#546e7a",fontFamily:"sans-serif",fontWeight:"bold"}}),_.jsx("text",{text:"Cozinha",x:m.kitchen.x+m.kitchen.width/2,y:m.kitchen.y+12,anchor:{x:.5,y:0},style:{fontSize:10,fill:"#795548",fontFamily:"sans-serif",fontWeight:"bold"}}),_.jsx("text",{text:"Descanso",x:m.restArea.x+m.restArea.width/2,y:m.restArea.y+12,anchor:{x:.5,y:0},style:{fontSize:10,fill:"#546e7a",fontFamily:"sans-serif",fontWeight:"bold"}}),s.map((x,v)=>{var N;const S=m.squadOrigins[v];if(!S)return null;const A=l[x]??[],T=((N=f[x])==null?void 0:N.status)??"idle",C=p[x]??{};return _.jsx(T8,{squadName:x,status:T,agents:A,textures:n,bubbles:c,animStates:C,originX:S.origin.x,originY:S.origin.y,roomWidth:S.width,roomHeight:S.height},x)}),s.map((x,v)=>{const S=l[x]??[],A=p[x]??{};return S.filter(T=>{const C=A[T.id];return(C==null?void 0:C.isExternalTransit)&&C.globalX!==void 0&&C.globalY!==void 0}).map(T=>{const C=A[T.id],N=`${x}:${T.id}`,R=c[N];return _.jsx(x_,{agent:T,textures:n,bubbleText:(R==null?void 0:R.text)??null,animX:C.globalX,animY:C.globalY,animPose:C.pose},`transit-${T.id}`)})}),_.jsx(R8,{x:m.ceoOffice.x,y:m.ceoOffice.y,width:m.ceoOffice.width,height:m.ceoOffice.height,textures:n,ticker:(e==null?void 0:e.ticker)??null})]})}function I8(){const e=ai(i=>i.activeRoom),t=ai(i=>i.checkpoints),n=e?t[e]:void 0;return _.jsx("div",{style:{display:"flex",height:"100%"},children:_.jsxs("div",{style:{flex:1,position:"relative",overflow:"hidden"},children:[_.jsx(o8,{background:13158600,antialias:!0,resizeTo:window,style:{width:"100%",height:"100%"},children:_.jsx(j8,{})}),n&&_.jsx(u8,{agentName:n.agentName,question:n.question,onRespond:i=>G4(e,i)})]})})}function U8(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const H8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,P8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,F8={};function c2(e,t){return(F8.jsx?P8:H8).test(e)}const G8=/[ \t\n\f\r]/g;function q8(e){return typeof e=="object"?e.type==="text"?u2(e.value):!1:u2(e)}function u2(e){return e.replace(G8,"")===""}class eg{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}eg.prototype.normal={};eg.prototype.property={};eg.prototype.space=void 0;function IM(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new eg(n,i,t)}function g1(e){return e.toLowerCase()}class za{constructor(t,n){this.attribute=n,this.property=t}}za.prototype.attribute="";za.prototype.booleanish=!1;za.prototype.boolean=!1;za.prototype.commaOrSpaceSeparated=!1;za.prototype.commaSeparated=!1;za.prototype.defined=!1;za.prototype.mustUseProperty=!1;za.prototype.number=!1;za.prototype.overloadedBoolean=!1;za.prototype.property="";za.prototype.spaceSeparated=!1;za.prototype.space=void 0;let Y8=0;const Mt=Md(),Di=Md(),y1=Md(),ze=Md(),Un=Md(),nh=Md(),es=Md();function Md(){return 2**++Y8}const x1=Object.freeze(Object.defineProperty({__proto__:null,boolean:Mt,booleanish:Di,commaOrSpaceSeparated:es,commaSeparated:nh,number:ze,overloadedBoolean:y1,spaceSeparated:Un},Symbol.toStringTag,{value:"Module"})),Jb=Object.keys(x1);class b_ extends za{constructor(t,n,i,r){let s=-1;if(super(t,n),d2(this,"space",r),typeof i=="number")for(;++s<Jb.length;){const l=Jb[s];d2(this,Jb[s],(i&x1[l])===x1[l])}}}b_.prototype.defined=!0;function d2(e,t,n){n&&(e[t]=n)}function wh(e){const t={},n={};for(const[i,r]of Object.entries(e.properties)){const s=new b_(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),t[i]=s,n[g1(i)]=i,n[g1(s.attribute)]=i}return new eg(t,n,e.space)}const UM=wh({properties:{ariaActiveDescendant:null,ariaAtomic:Di,ariaAutoComplete:null,ariaBusy:Di,ariaChecked:Di,ariaColCount:ze,ariaColIndex:ze,ariaColSpan:ze,ariaControls:Un,ariaCurrent:null,ariaDescribedBy:Un,ariaDetails:null,ariaDisabled:Di,ariaDropEffect:Un,ariaErrorMessage:null,ariaExpanded:Di,ariaFlowTo:Un,ariaGrabbed:Di,ariaHasPopup:null,ariaHidden:Di,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Un,ariaLevel:ze,ariaLive:null,ariaModal:Di,ariaMultiLine:Di,ariaMultiSelectable:Di,ariaOrientation:null,ariaOwns:Un,ariaPlaceholder:null,ariaPosInSet:ze,ariaPressed:Di,ariaReadOnly:Di,ariaRelevant:null,ariaRequired:Di,ariaRoleDescription:Un,ariaRowCount:ze,ariaRowIndex:ze,ariaRowSpan:ze,ariaSelected:Di,ariaSetSize:ze,ariaSort:null,ariaValueMax:ze,ariaValueMin:ze,ariaValueNow:ze,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function HM(e,t){return t in e?e[t]:t}function PM(e,t){return HM(e,t.toLowerCase())}const V8=wh({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:nh,acceptCharset:Un,accessKey:Un,action:null,allow:null,allowFullScreen:Mt,allowPaymentRequest:Mt,allowUserMedia:Mt,alt:null,as:null,async:Mt,autoCapitalize:null,autoComplete:Un,autoFocus:Mt,autoPlay:Mt,blocking:Un,capture:null,charSet:null,checked:Mt,cite:null,className:Un,cols:ze,colSpan:null,content:null,contentEditable:Di,controls:Mt,controlsList:Un,coords:ze|nh,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Mt,defer:Mt,dir:null,dirName:null,disabled:Mt,download:y1,draggable:Di,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Mt,formTarget:null,headers:Un,height:ze,hidden:y1,high:ze,href:null,hrefLang:null,htmlFor:Un,httpEquiv:Un,id:null,imageSizes:null,imageSrcSet:null,inert:Mt,inputMode:null,integrity:null,is:null,isMap:Mt,itemId:null,itemProp:Un,itemRef:Un,itemScope:Mt,itemType:Un,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Mt,low:ze,manifest:null,max:null,maxLength:ze,media:null,method:null,min:null,minLength:ze,multiple:Mt,muted:Mt,name:null,nonce:null,noModule:Mt,noValidate:Mt,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:Mt,optimum:ze,pattern:null,ping:Un,placeholder:null,playsInline:Mt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Mt,referrerPolicy:null,rel:Un,required:Mt,reversed:Mt,rows:ze,rowSpan:ze,sandbox:Un,scope:null,scoped:Mt,seamless:Mt,selected:Mt,shadowRootClonable:Mt,shadowRootDelegatesFocus:Mt,shadowRootMode:null,shape:null,size:ze,sizes:null,slot:null,span:ze,spellCheck:Di,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ze,step:null,style:null,tabIndex:ze,target:null,title:null,translate:null,type:null,typeMustMatch:Mt,useMap:null,value:Di,width:ze,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Un,axis:null,background:null,bgColor:null,border:ze,borderColor:null,bottomMargin:ze,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Mt,declare:Mt,event:null,face:null,frame:null,frameBorder:null,hSpace:ze,leftMargin:ze,link:null,longDesc:null,lowSrc:null,marginHeight:ze,marginWidth:ze,noResize:Mt,noHref:Mt,noShade:Mt,noWrap:Mt,object:null,profile:null,prompt:null,rev:null,rightMargin:ze,rules:null,scheme:null,scrolling:Di,standby:null,summary:null,text:null,topMargin:ze,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ze,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Mt,disableRemotePlayback:Mt,prefix:null,property:null,results:ze,security:null,unselectable:null},space:"html",transform:PM}),X8=wh({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:es,accentHeight:ze,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ze,amplitude:ze,arabicForm:null,ascent:ze,attributeName:null,attributeType:null,azimuth:ze,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ze,by:null,calcMode:null,capHeight:ze,className:Un,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:ze,diffuseConstant:ze,direction:null,display:null,dur:null,divisor:ze,dominantBaseline:null,download:Mt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ze,enableBackground:null,end:null,event:null,exponent:ze,externalResourcesRequired:null,fill:null,fillOpacity:ze,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:nh,g2:nh,glyphName:nh,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ze,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ze,horizOriginX:ze,horizOriginY:ze,id:null,ideographic:ze,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ze,k:ze,k1:ze,k2:ze,k3:ze,k4:ze,kernelMatrix:es,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ze,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:ze,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:ze,overlineThickness:ze,paintOrder:null,panose1:null,path:null,pathLength:ze,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Un,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ze,pointsAtY:ze,pointsAtZ:ze,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:es,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:es,rev:es,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:es,requiredFeatures:es,requiredFonts:es,requiredFormats:es,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:ze,specularExponent:ze,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ze,strikethroughThickness:ze,string:null,stroke:null,strokeDashArray:es,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ze,strokeOpacity:ze,strokeWidth:null,style:null,surfaceScale:ze,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:es,tabIndex:ze,tableValues:null,target:null,targetX:ze,targetY:ze,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:es,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ze,underlineThickness:ze,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ze,values:null,vAlphabetic:ze,vMathematical:ze,vectorEffect:null,vHanging:ze,vIdeographic:ze,version:null,vertAdvY:ze,vertOriginX:ze,vertOriginY:ze,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ze,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:HM}),FM=wh({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),GM=wh({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:PM}),qM=wh({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),K8={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"},$8=/[A-Z]/g,f2=/-[a-z]/g,W8=/^data[-\w.:]+$/i;function Q8(e,t){const n=g1(t);let i=t,r=za;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&W8.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(f2,J8);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!f2.test(s)){let l=s.replace($8,Z8);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}r=b_}return new r(i,t)}function Z8(e){return"-"+e.toLowerCase()}function J8(e){return e.charAt(1).toUpperCase()}const ej=IM([UM,V8,FM,GM,qM],"html"),v_=IM([UM,X8,FM,GM,qM],"svg");function tj(e){return e.join(" ").trim()}var Uf={},ev,h2;function nj(){if(h2)return ev;h2=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
345
- `,p="/",m="*",g="",x="comment",v="declaration";function S(T,C){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];C=C||{};var N=1,R=1;function O(P){var W=P.match(t);W&&(N+=W.length);var z=P.lastIndexOf(f);R=~z?P.length-z:R+P.length}function H(){var P={line:N,column:R};return function(W){return W.position=new D(P),V(),W}}function D(P){this.start=P,this.end={line:N,column:R},this.source=C.source}D.prototype.content=T;function q(P){var W=new Error(C.source+":"+N+":"+R+": "+P);if(W.reason=P,W.filename=C.source,W.line=N,W.column=R,W.source=T,!C.silent)throw W}function Z(P){var W=P.exec(T);if(W){var z=W[0];return O(z),T=T.slice(z.length),W}}function V(){Z(n)}function Y(P){var W;for(P=P||[];W=F();)W!==!1&&P.push(W);return P}function F(){var P=H();if(!(p!=T.charAt(0)||m!=T.charAt(1))){for(var W=2;g!=T.charAt(W)&&(m!=T.charAt(W)||p!=T.charAt(W+1));)++W;if(W+=2,g===T.charAt(W-1))return q("End of comment missing");var z=T.slice(2,W-2);return R+=2,O(z),T=T.slice(W),R+=2,P({type:x,comment:z})}}function j(){var P=H(),W=Z(i);if(W){if(F(),!Z(r))return q("property missing ':'");var z=Z(s),K=P({type:v,property:A(W[0].replace(e,g)),value:z?A(z[0].replace(e,g)):g});return Z(l),K}}function ee(){var P=[];Y(P);for(var W;W=j();)W!==!1&&(P.push(W),Y(P));return P}return V(),ee()}function A(T){return T?T.replace(c,g):g}return ev=S,ev}var p2;function ij(){if(p2)return Uf;p2=1;var e=Uf&&Uf.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Uf,"__esModule",{value:!0}),Uf.default=n;const t=e(nj());function n(i,r){let s=null;if(!i||typeof i!="string")return s;const l=(0,t.default)(i),c=typeof r=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:p,value:m}=f;c?r(p,m,f):m&&(s=s||{},s[p]=m)}),s}return Uf}var am={},m2;function rj(){if(m2)return am;m2=1,Object.defineProperty(am,"__esModule",{value:!0}),am.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,s=function(p){return!p||n.test(p)||e.test(p)},l=function(p,m){return m.toUpperCase()},c=function(p,m){return"".concat(m,"-")},f=function(p,m){return m===void 0&&(m={}),s(p)?p:(p=p.toLowerCase(),m.reactCompat?p=p.replace(r,c):p=p.replace(i,c),p.replace(t,l))};return am.camelCase=f,am}var sm,g2;function aj(){if(g2)return sm;g2=1;var e=sm&&sm.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},t=e(ij()),n=rj();function i(r,s){var l={};return!r||typeof r!="string"||(0,t.default)(r,function(c,f){c&&f&&(l[(0,n.camelCase)(c,s)]=f)}),l}return i.default=i,sm=i,sm}var sj=aj();const lj=du(sj),YM=VM("end"),__=VM("start");function VM(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function oj(e){const t=__(e),n=YM(e);if(t&&n)return{start:t,end:n}}function Tm(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?y2(e.position):"start"in e||"end"in e?y2(e):"line"in e||"column"in e?b1(e):""}function b1(e){return x2(e&&e.line)+":"+x2(e&&e.column)}function y2(e){return b1(e&&e.start)+"-"+b1(e&&e.end)}function x2(e){return e&&typeof e=="number"?e:1}class Ir extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",s={},l=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?r=t:!s.cause&&t&&(l=!0,r=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){const f=i.indexOf(":");f===-1?s.ruleId=i:(s.source=i.slice(0,f),s.ruleId=i.slice(f+1))}if(!s.place&&s.ancestors&&s.ancestors){const f=s.ancestors[s.ancestors.length-1];f&&(s.place=f.position)}const c=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=c?c.line:void 0,this.name=Tm(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=l&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ir.prototype.file="";Ir.prototype.name="";Ir.prototype.reason="";Ir.prototype.message="";Ir.prototype.stack="";Ir.prototype.column=void 0;Ir.prototype.line=void 0;Ir.prototype.ancestors=void 0;Ir.prototype.cause=void 0;Ir.prototype.fatal=void 0;Ir.prototype.place=void 0;Ir.prototype.ruleId=void 0;Ir.prototype.source=void 0;const S_={}.hasOwnProperty,cj=new Map,uj=/[A-Z]/g,dj=new Set(["table","tbody","thead","tfoot","tr"]),fj=new Set(["td","th"]),XM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function hj(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=_j(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=vj(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?v_:ej,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=KM(r,e,void 0);return s&&typeof s!="string"?s:r.create(e,r.Fragment,{children:s||void 0},void 0)}function KM(e,t,n){if(t.type==="element")return pj(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return mj(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return yj(e,t,n);if(t.type==="mdxjsEsm")return gj(e,t);if(t.type==="root")return xj(e,t,n);if(t.type==="text")return bj(e,t)}function pj(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=v_,e.schema=r),e.ancestors.push(t);const s=WM(e,t.tagName,!1),l=Sj(e,t);let c=w_(e,t);return dj.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!q8(f):!0})),$M(e,l,s,t),E_(l,c),e.ancestors.pop(),e.schema=i,e.create(t,s,l,n)}function mj(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}jm(e,t.position)}function gj(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);jm(e,t.position)}function yj(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=v_,e.schema=r),e.ancestors.push(t);const s=t.name===null?e.Fragment:WM(e,t.name,!0),l=Ej(e,t),c=w_(e,t);return $M(e,l,s,t),E_(l,c),e.ancestors.pop(),e.schema=i,e.create(t,s,l,n)}function xj(e,t,n){const i={};return E_(i,w_(e,t)),e.create(t,e.Fragment,i,n)}function bj(e,t){return t.value}function $M(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function E_(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function vj(e,t,n){return i;function i(r,s,l,c){const p=Array.isArray(l.children)?n:t;return c?p(s,l,c):p(s,l)}}function _j(e,t){return n;function n(i,r,s,l){const c=Array.isArray(s.children),f=__(i);return t(r,s,l,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function Sj(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&S_.call(t.properties,r)){const s=wj(e,r,t.properties[r]);if(s){const[l,c]=s;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&fj.has(t.tagName)?i=c:n[l]=c}}if(i){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function Ej(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const l=s.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else jm(e,t.position);else{const r=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const c=i.value.data.estree.body[0];c.type,s=e.evaluater.evaluateExpression(c.expression)}else jm(e,t.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function w_(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:cj;for(;++i<t.children.length;){const s=t.children[i];let l;if(e.passKeys){const f=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(f){const p=r.get(f)||0;l=f+"-"+p,r.set(f,p+1)}}const c=KM(e,s,l);c!==void 0&&n.push(c)}return n}function wj(e,t,n){const i=Q8(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?U8(n):tj(n)),i.property==="style"){let r=typeof n=="object"?n:Tj(e,String(n));return e.stylePropertyNameCase==="css"&&(r=Cj(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&i.space?K8[i.property]||i.property:i.attribute,n]}}function Tj(e,t){try{return lj(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,r=new Ir("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=XM+"#cannot-parse-style-attribute",r}}function WM(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const r=t.split(".");let s=-1,l;for(;++s<r.length;){const c=c2(r[s])?{type:"Identifier",name:r[s]}:{type:"Literal",value:r[s]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(s&&c.type==="Literal"),optional:!1}:c}i=l}else i=c2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const r=i.value;return S_.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(i);jm(e)}function jm(e,t){const n=new Ir("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=XM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Cj(e){const t={};let n;for(n in e)S_.call(e,n)&&(t[Aj(n)]=e[n]);return t}function Aj(e){let t=e.replace(uj,Mj);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Mj(e){return"-"+e.toLowerCase()}const tv={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"]},Rj={};function T_(e,t){const n=Rj,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return QM(e,i,r)}function QM(e,t,n){if(kj(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return b2(e.children,t,n)}return Array.isArray(e)?b2(e,t,n):""}function b2(e,t,n){const i=[];let r=-1;for(;++r<e.length;)i[r]=QM(e[r],t,n);return i.join("")}function kj(e){return!!(e&&typeof e=="object")}const v2=document.createElement("i");function C_(e){const t="&"+e+";";v2.innerHTML=t;const n=v2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function rs(e,t,n,i){const r=e.length;let s=0,l;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)l=Array.from(i),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);s<i.length;)l=i.slice(s,s+1e4),l.unshift(t,0),e.splice(...l),s+=1e4,t+=1e4}function zs(e,t){return e.length>0?(rs(e,e.length,0,t),e):t}const _2={}.hasOwnProperty;function ZM(e){const t={};let n=-1;for(;++n<e.length;)Nj(t,e[n]);return t}function Nj(e,t){let n;for(n in t){const r=(_2.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let l;if(s)for(l in s){_2.call(r,l)||(r[l]=[]);const c=s[l];Oj(r[l],Array.isArray(c)?c:c?[c]:[])}}}function Oj(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);rs(e,0,0,i)}function JM(e,t){const n=Number.parseInt(e,t);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 vl(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ha=hu(/[A-Za-z]/),jr=hu(/[\dA-Za-z]/),Dj=hu(/[#-'*+\--9=?A-Z^-~]/);function z0(e){return e!==null&&(e<32||e===127)}const v1=hu(/\d/),zj=hu(/[\dA-Fa-f]/),Bj=hu(/[!-/:-@[-`{-~]/);function lt(e){return e!==null&&e<-2}function Ln(e){return e!==null&&(e<0||e===32)}function Lt(e){return e===-2||e===-1||e===32}const lx=hu(new RegExp("\\p{P}|\\p{S}","u")),Sd=hu(/\s/);function hu(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Th(e){const t=[];let n=-1,i=0,r=0;for(;++n<e.length;){const s=e.charCodeAt(n);let l="";if(s===37&&jr(e.charCodeAt(n+1))&&jr(e.charCodeAt(n+2)))r=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(l=String.fromCharCode(s));else if(s>55295&&s<57344){const c=e.charCodeAt(n+1);s<56320&&c>56319&&c<57344?(l=String.fromCharCode(s,c),r=1):l="�"}else l=String.fromCharCode(s);l&&(t.push(e.slice(i,n),encodeURIComponent(l)),i=n+r+1,l=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function Kt(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return l;function l(f){return Lt(f)?(e.enter(n),c(f)):t(f)}function c(f){return Lt(f)&&s++<r?(e.consume(f),c):(e.exit(n),t(f))}}const Lj={tokenize:jj};function jj(e){const t=e.attempt(this.parser.constructs.contentInitial,i,r);let n;return t;function i(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Kt(e,t,"linePrefix")}function r(c){return e.enter("paragraph"),s(c)}function s(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return lt(c)?(e.consume(c),e.exit("chunkText"),s):(e.consume(c),l)}}const Ij={tokenize:Uj},S2={tokenize:Hj};function Uj(e){const t=this,n=[];let i=0,r,s,l;return c;function c(R){if(i<n.length){const O=n[i];return t.containerState=O[1],e.attempt(O[0].continuation,f,p)(R)}return p(R)}function f(R){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&N();const O=t.events.length;let H=O,D;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){D=t.events[H][1].end;break}C(i);let q=O;for(;q<t.events.length;)t.events[q][1].end={...D},q++;return rs(t.events,H+1,0,t.events.slice(O)),t.events.length=q,p(R)}return c(R)}function p(R){if(i===n.length){if(!r)return x(R);if(r.currentConstruct&&r.currentConstruct.concrete)return S(R);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(S2,m,g)(R)}function m(R){return r&&N(),C(i),x(R)}function g(R){return t.parser.lazy[t.now().line]=i!==n.length,l=t.now().offset,S(R)}function x(R){return t.containerState={},e.attempt(S2,v,S)(R)}function v(R){return i++,n.push([t.currentConstruct,t.containerState]),x(R)}function S(R){if(R===null){r&&N(),C(0),e.consume(R);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:s}),A(R)}function A(R){if(R===null){T(e.exit("chunkFlow"),!0),C(0),e.consume(R);return}return lt(R)?(e.consume(R),T(e.exit("chunkFlow")),i=0,t.interrupt=void 0,c):(e.consume(R),A)}function T(R,O){const H=t.sliceStream(R);if(O&&H.push(null),R.previous=s,s&&(s.next=R),s=R,r.defineSkip(R.start),r.write(H),t.parser.lazy[R.start.line]){let D=r.events.length;for(;D--;)if(r.events[D][1].start.offset<l&&(!r.events[D][1].end||r.events[D][1].end.offset>l))return;const q=t.events.length;let Z=q,V,Y;for(;Z--;)if(t.events[Z][0]==="exit"&&t.events[Z][1].type==="chunkFlow"){if(V){Y=t.events[Z][1].end;break}V=!0}for(C(i),D=q;D<t.events.length;)t.events[D][1].end={...Y},D++;rs(t.events,Z+1,0,t.events.slice(q)),t.events.length=D}}function C(R){let O=n.length;for(;O-- >R;){const H=n[O];t.containerState=H[1],H[0].exit.call(t,e)}n.length=R}function N(){r.write([null]),s=void 0,r=void 0,t.containerState._closeFlow=void 0}}function Hj(e,t,n){return Kt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function fh(e){if(e===null||Ln(e)||Sd(e))return 1;if(lx(e))return 2}function ox(e,t,n){const i=[];let r=-1;for(;++r<e.length;){const s=e[r].resolveAll;s&&!i.includes(s)&&(t=s(t,n),i.push(s))}return t}const _1={name:"attention",resolveAll:Pj,tokenize:Fj};function Pj(e,t){let n=-1,i,r,s,l,c,f,p,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[i][1].end},x={...e[n][1].start};E2(g,-f),E2(x,f),l={type:f>1?"strongSequence":"emphasisSequence",start:g,end:{...e[i][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},s={type:f>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},r={type:f>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[i][1].end={...l.start},e[n][1].start={...c.end},p=[],e[i][1].end.offset-e[i][1].start.offset&&(p=zs(p,[["enter",e[i][1],t],["exit",e[i][1],t]])),p=zs(p,[["enter",r,t],["enter",l,t],["exit",l,t],["enter",s,t]]),p=zs(p,ox(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),p=zs(p,[["exit",s,t],["enter",c,t],["exit",c,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,p=zs(p,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,rs(e,i-1,n-i+3,p),n=i+p.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Fj(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=fh(i);let s;return l;function l(f){return s=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===s)return e.consume(f),c;const p=e.exit("attentionSequence"),m=fh(f),g=!m||m===2&&r||n.includes(f),x=!r||r===2&&m||n.includes(i);return p._open=!!(s===42?g:g&&(r||!x)),p._close=!!(s===42?x:x&&(m||!g)),t(f)}}function E2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Gj={name:"autolink",tokenize:qj};function qj(e,t,n){let i=0;return r;function r(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(v){return ha(v)?(e.consume(v),l):v===64?n(v):p(v)}function l(v){return v===43||v===45||v===46||jr(v)?(i=1,c(v)):p(v)}function c(v){return v===58?(e.consume(v),i=0,f):(v===43||v===45||v===46||jr(v))&&i++<32?(e.consume(v),c):(i=0,p(v))}function f(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||z0(v)?n(v):(e.consume(v),f)}function p(v){return v===64?(e.consume(v),m):Dj(v)?(e.consume(v),p):n(v)}function m(v){return jr(v)?g(v):n(v)}function g(v){return v===46?(e.consume(v),i=0,m):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):x(v)}function x(v){if((v===45||jr(v))&&i++<63){const S=v===45?x:g;return e.consume(v),S}return n(v)}}const tg={partial:!0,tokenize:Yj};function Yj(e,t,n){return i;function i(s){return Lt(s)?Kt(e,r,"linePrefix")(s):r(s)}function r(s){return s===null||lt(s)?t(s):n(s)}}const eR={continuation:{tokenize:Xj},exit:Kj,name:"blockQuote",tokenize:Vj};function Vj(e,t,n){const i=this;return r;function r(l){if(l===62){const c=i.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),s}return n(l)}function s(l){return Lt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function Xj(e,t,n){const i=this;return r;function r(l){return Lt(l)?Kt(e,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return e.attempt(eR,t,n)(l)}}function Kj(e){e.exit("blockQuote")}const tR={name:"characterEscape",tokenize:$j};function $j(e,t,n){return i;function i(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),r}function r(s){return Bj(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const nR={name:"characterReference",tokenize:Wj};function Wj(e,t,n){const i=this;let r=0,s,l;return c;function c(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),f}function f(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),s=31,l=jr,m(g))}function p(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,l=zj,m):(e.enter("characterReferenceValue"),s=7,l=v1,m(g))}function m(g){if(g===59&&r){const x=e.exit("characterReferenceValue");return l===jr&&!C_(i.sliceSerialize(x))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(g)&&r++<s?(e.consume(g),m):n(g)}}const w2={partial:!0,tokenize:Zj},T2={concrete:!0,name:"codeFenced",tokenize:Qj};function Qj(e,t,n){const i=this,r={partial:!0,tokenize:H};let s=0,l=0,c;return f;function f(D){return p(D)}function p(D){const q=i.events[i.events.length-1];return s=q&&q[1].type==="linePrefix"?q[2].sliceSerialize(q[1],!0).length:0,c=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(D)}function m(D){return D===c?(l++,e.consume(D),m):l<3?n(D):(e.exit("codeFencedFenceSequence"),Lt(D)?Kt(e,g,"whitespace")(D):g(D))}function g(D){return D===null||lt(D)?(e.exit("codeFencedFence"),i.interrupt?t(D):e.check(w2,A,O)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(D))}function x(D){return D===null||lt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(D)):Lt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Kt(e,v,"whitespace")(D)):D===96&&D===c?n(D):(e.consume(D),x)}function v(D){return D===null||lt(D)?g(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(D))}function S(D){return D===null||lt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(D)):D===96&&D===c?n(D):(e.consume(D),S)}function A(D){return e.attempt(r,O,T)(D)}function T(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),C}function C(D){return s>0&&Lt(D)?Kt(e,N,"linePrefix",s+1)(D):N(D)}function N(D){return D===null||lt(D)?e.check(w2,A,O)(D):(e.enter("codeFlowValue"),R(D))}function R(D){return D===null||lt(D)?(e.exit("codeFlowValue"),N(D)):(e.consume(D),R)}function O(D){return e.exit("codeFenced"),t(D)}function H(D,q,Z){let V=0;return Y;function Y(W){return D.enter("lineEnding"),D.consume(W),D.exit("lineEnding"),F}function F(W){return D.enter("codeFencedFence"),Lt(W)?Kt(D,j,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):j(W)}function j(W){return W===c?(D.enter("codeFencedFenceSequence"),ee(W)):Z(W)}function ee(W){return W===c?(V++,D.consume(W),ee):V>=l?(D.exit("codeFencedFenceSequence"),Lt(W)?Kt(D,P,"whitespace")(W):P(W)):Z(W)}function P(W){return W===null||lt(W)?(D.exit("codeFencedFence"),q(W)):Z(W)}}}function Zj(e,t,n){const i=this;return r;function r(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s)}function s(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}const nv={name:"codeIndented",tokenize:eI},Jj={partial:!0,tokenize:tI};function eI(e,t,n){const i=this;return r;function r(p){return e.enter("codeIndented"),Kt(e,s,"linePrefix",5)(p)}function s(p){const m=i.events[i.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(p):n(p)}function l(p){return p===null?f(p):lt(p)?e.attempt(Jj,l,f)(p):(e.enter("codeFlowValue"),c(p))}function c(p){return p===null||lt(p)?(e.exit("codeFlowValue"),l(p)):(e.consume(p),c)}function f(p){return e.exit("codeIndented"),t(p)}}function tI(e,t,n){const i=this;return r;function r(l){return i.parser.lazy[i.now().line]?n(l):lt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),r):Kt(e,s,"linePrefix",5)(l)}function s(l){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):lt(l)?r(l):n(l)}}const nI={name:"codeText",previous:rI,resolve:iI,tokenize:aI};function iI(e){let t=e.length-4,n=3,i,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)r===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(r=i):(i===t||e[i][1].type==="lineEnding")&&(e[r][1].type="codeTextData",i!==r+2&&(e[r][1].end=e[i-1][1].end,e.splice(r+2,i-r-2),t-=i-r-2,i=r+2),r=void 0);return e}function rI(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function aI(e,t,n){let i=0,r,s;return l;function l(g){return e.enter("codeText"),e.enter("codeTextSequence"),c(g)}function c(g){return g===96?(e.consume(g),i++,c):(e.exit("codeTextSequence"),f(g))}function f(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),f):g===96?(s=e.enter("codeTextSequence"),r=0,m(g)):lt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),f):(e.enter("codeTextData"),p(g))}function p(g){return g===null||g===32||g===96||lt(g)?(e.exit("codeTextData"),f(g)):(e.consume(g),p)}function m(g){return g===96?(e.consume(g),r++,m):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(s.type="codeTextData",p(g))}}class sI{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const r=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&lm(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),lm(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),lm(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);lm(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);lm(this.left,n.reverse())}}}function lm(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function iR(e){const t={};let n=-1,i,r,s,l,c,f,p;const m=new sI(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(i=m.get(n),n&&i[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(f=i[1]._tokenizer.events,s=0,s<f.length&&f[s][1].type==="lineEndingBlank"&&(s+=2),s<f.length&&f[s][1].type==="content"))for(;++s<f.length&&f[s][1].type!=="content";)f[s][1].type==="chunkText"&&(f[s][1]._isInFirstContentOfListItem=!0,s++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,lI(m,n)),n=t[n],p=!0);else if(i[1]._container){for(s=n,r=void 0;s--;)if(l=m.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(r&&(m.get(r)[1].type="lineEndingBlank"),l[1].type="lineEnding",r=s);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;r&&(i[1].end={...m.get(r)[1].start},c=m.slice(r,n),c.unshift(i),m.splice(r,n-r+1,c))}}return rs(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!p}function lI(e,t){const n=e.get(t)[1],i=e.get(t)[2];let r=t-1;const s=[];let l=n._tokenizer;l||(l=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,f=[],p={};let m,g,x=-1,v=n,S=0,A=0;const T=[A];for(;v;){for(;e.get(++r)[1]!==v;);s.push(r),v._tokenizer||(m=i.sliceStream(v),v.next||m.push(null),g&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),g=v,v=v.next}for(v=n;++x<c.length;)c[x][0]==="exit"&&c[x-1][0]==="enter"&&c[x][1].type===c[x-1][1].type&&c[x][1].start.line!==c[x][1].end.line&&(A=x+1,T.push(A),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):T.pop(),x=T.length;x--;){const C=c.slice(T[x],T[x+1]),N=s.pop();f.push([N,N+C.length-1]),e.splice(N,2,C)}for(f.reverse(),x=-1;++x<f.length;)p[S+f[x][0]]=S+f[x][1],S+=f[x][1]-f[x][0]-1;return p}const oI={resolve:uI,tokenize:dI},cI={partial:!0,tokenize:fI};function uI(e){return iR(e),e}function dI(e,t){let n;return i;function i(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(c)}function r(c){return c===null?s(c):lt(c)?e.check(cI,l,s)(c):(e.consume(c),r)}function s(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function fI(e,t,n){const i=this;return r;function r(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Kt(e,s,"linePrefix")}function s(l){if(l===null||lt(l))return n(l);const c=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(i.parser.constructs.flow,n,t)(l)}}function rR(e,t,n,i,r,s,l,c,f){const p=f||Number.POSITIVE_INFINITY;let m=0;return g;function g(C){return C===60?(e.enter(i),e.enter(r),e.enter(s),e.consume(C),e.exit(s),x):C===null||C===32||C===41||z0(C)?n(C):(e.enter(i),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),A(C))}function x(C){return C===62?(e.enter(s),e.consume(C),e.exit(s),e.exit(r),e.exit(i),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),v(C))}function v(C){return C===62?(e.exit("chunkString"),e.exit(c),x(C)):C===null||C===60||lt(C)?n(C):(e.consume(C),C===92?S:v)}function S(C){return C===60||C===62||C===92?(e.consume(C),v):v(C)}function A(C){return!m&&(C===null||C===41||Ln(C))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(i),t(C)):m<p&&C===40?(e.consume(C),m++,A):C===41?(e.consume(C),m--,A):C===null||C===32||C===40||z0(C)?n(C):(e.consume(C),C===92?T:A)}function T(C){return C===40||C===41||C===92?(e.consume(C),A):A(C)}}function aR(e,t,n,i,r,s){const l=this;let c=0,f;return p;function p(v){return e.enter(i),e.enter(r),e.consume(v),e.exit(r),e.enter(s),m}function m(v){return c>999||v===null||v===91||v===93&&!f||v===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(s),e.enter(r),e.consume(v),e.exit(r),e.exit(i),t):lt(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||lt(v)||c++>999?(e.exit("chunkString"),m(v)):(e.consume(v),f||(f=!Lt(v)),v===92?x:g)}function x(v){return v===91||v===92||v===93?(e.consume(v),c++,g):g(v)}}function sR(e,t,n,i,r,s){let l;return c;function c(x){return x===34||x===39||x===40?(e.enter(i),e.enter(r),e.consume(x),e.exit(r),l=x===40?41:x,f):n(x)}function f(x){return x===l?(e.enter(r),e.consume(x),e.exit(r),e.exit(i),t):(e.enter(s),p(x))}function p(x){return x===l?(e.exit(s),f(l)):x===null?n(x):lt(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Kt(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===l||x===null||lt(x)?(e.exit("chunkString"),p(x)):(e.consume(x),x===92?g:m)}function g(x){return x===l||x===92?(e.consume(x),m):m(x)}}function Cm(e,t){let n;return i;function i(r){return lt(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):Lt(r)?Kt(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const hI={name:"definition",tokenize:mI},pI={partial:!0,tokenize:gI};function mI(e,t,n){const i=this;let r;return s;function s(v){return e.enter("definition"),l(v)}function l(v){return aR.call(i,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return r=vl(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),f):n(v)}function f(v){return Ln(v)?Cm(e,p)(v):p(v)}function p(v){return rR(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function m(v){return e.attempt(pI,g,g)(v)}function g(v){return Lt(v)?Kt(e,x,"whitespace")(v):x(v)}function x(v){return v===null||lt(v)?(e.exit("definition"),i.parser.defined.push(r),t(v)):n(v)}}function gI(e,t,n){return i;function i(c){return Ln(c)?Cm(e,r)(c):n(c)}function r(c){return sR(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return Lt(c)?Kt(e,l,"whitespace")(c):l(c)}function l(c){return c===null||lt(c)?t(c):n(c)}}const yI={name:"hardBreakEscape",tokenize:xI};function xI(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),r}function r(s){return lt(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const bI={name:"headingAtx",resolve:vI,tokenize:_I};function vI(e,t){let n=e.length-2,i=3,r,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},rs(e,i,n-i+1,[["enter",r,t],["enter",s,t],["exit",s,t],["exit",r,t]])),e}function _I(e,t,n){let i=0;return r;function r(m){return e.enter("atxHeading"),s(m)}function s(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&i++<6?(e.consume(m),l):m===null||Ln(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),f(m)):m===null||lt(m)?(e.exit("atxHeading"),t(m)):Lt(m)?Kt(e,c,"whitespace")(m):(e.enter("atxHeadingText"),p(m))}function f(m){return m===35?(e.consume(m),f):(e.exit("atxHeadingSequence"),c(m))}function p(m){return m===null||m===35||Ln(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),p)}}const SI=["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"],C2=["pre","script","style","textarea"],EI={concrete:!0,name:"htmlFlow",resolveTo:CI,tokenize:AI},wI={partial:!0,tokenize:RI},TI={partial:!0,tokenize:MI};function CI(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function AI(e,t,n){const i=this;let r,s,l,c,f;return p;function p(X){return m(X)}function m(X){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(X),g}function g(X){return X===33?(e.consume(X),x):X===47?(e.consume(X),s=!0,A):X===63?(e.consume(X),r=3,i.interrupt?t:I):ha(X)?(e.consume(X),l=String.fromCharCode(X),T):n(X)}function x(X){return X===45?(e.consume(X),r=2,v):X===91?(e.consume(X),r=5,c=0,S):ha(X)?(e.consume(X),r=4,i.interrupt?t:I):n(X)}function v(X){return X===45?(e.consume(X),i.interrupt?t:I):n(X)}function S(X){const ce="CDATA[";return X===ce.charCodeAt(c++)?(e.consume(X),c===ce.length?i.interrupt?t:j:S):n(X)}function A(X){return ha(X)?(e.consume(X),l=String.fromCharCode(X),T):n(X)}function T(X){if(X===null||X===47||X===62||Ln(X)){const ce=X===47,ie=l.toLowerCase();return!ce&&!s&&C2.includes(ie)?(r=1,i.interrupt?t(X):j(X)):SI.includes(l.toLowerCase())?(r=6,ce?(e.consume(X),C):i.interrupt?t(X):j(X)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(X):s?N(X):R(X))}return X===45||jr(X)?(e.consume(X),l+=String.fromCharCode(X),T):n(X)}function C(X){return X===62?(e.consume(X),i.interrupt?t:j):n(X)}function N(X){return Lt(X)?(e.consume(X),N):Y(X)}function R(X){return X===47?(e.consume(X),Y):X===58||X===95||ha(X)?(e.consume(X),O):Lt(X)?(e.consume(X),R):Y(X)}function O(X){return X===45||X===46||X===58||X===95||jr(X)?(e.consume(X),O):H(X)}function H(X){return X===61?(e.consume(X),D):Lt(X)?(e.consume(X),H):R(X)}function D(X){return X===null||X===60||X===61||X===62||X===96?n(X):X===34||X===39?(e.consume(X),f=X,q):Lt(X)?(e.consume(X),D):Z(X)}function q(X){return X===f?(e.consume(X),f=null,V):X===null||lt(X)?n(X):(e.consume(X),q)}function Z(X){return X===null||X===34||X===39||X===47||X===60||X===61||X===62||X===96||Ln(X)?H(X):(e.consume(X),Z)}function V(X){return X===47||X===62||Lt(X)?R(X):n(X)}function Y(X){return X===62?(e.consume(X),F):n(X)}function F(X){return X===null||lt(X)?j(X):Lt(X)?(e.consume(X),F):n(X)}function j(X){return X===45&&r===2?(e.consume(X),z):X===60&&r===1?(e.consume(X),K):X===62&&r===4?(e.consume(X),$):X===63&&r===3?(e.consume(X),I):X===93&&r===5?(e.consume(X),Q):lt(X)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(wI,ne,ee)(X)):X===null||lt(X)?(e.exit("htmlFlowData"),ee(X)):(e.consume(X),j)}function ee(X){return e.check(TI,P,ne)(X)}function P(X){return e.enter("lineEnding"),e.consume(X),e.exit("lineEnding"),W}function W(X){return X===null||lt(X)?ee(X):(e.enter("htmlFlowData"),j(X))}function z(X){return X===45?(e.consume(X),I):j(X)}function K(X){return X===47?(e.consume(X),l="",G):j(X)}function G(X){if(X===62){const ce=l.toLowerCase();return C2.includes(ce)?(e.consume(X),$):j(X)}return ha(X)&&l.length<8?(e.consume(X),l+=String.fromCharCode(X),G):j(X)}function Q(X){return X===93?(e.consume(X),I):j(X)}function I(X){return X===62?(e.consume(X),$):X===45&&r===2?(e.consume(X),I):j(X)}function $(X){return X===null||lt(X)?(e.exit("htmlFlowData"),ne(X)):(e.consume(X),$)}function ne(X){return e.exit("htmlFlow"),t(X)}}function MI(e,t,n){const i=this;return r;function r(l){return lt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):n(l)}function s(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}function RI(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(tg,t,n)}}const kI={name:"htmlText",tokenize:NI};function NI(e,t,n){const i=this;let r,s,l;return c;function c(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),f}function f(I){return I===33?(e.consume(I),p):I===47?(e.consume(I),H):I===63?(e.consume(I),R):ha(I)?(e.consume(I),Z):n(I)}function p(I){return I===45?(e.consume(I),m):I===91?(e.consume(I),s=0,S):ha(I)?(e.consume(I),N):n(I)}function m(I){return I===45?(e.consume(I),v):n(I)}function g(I){return I===null?n(I):I===45?(e.consume(I),x):lt(I)?(l=g,K(I)):(e.consume(I),g)}function x(I){return I===45?(e.consume(I),v):g(I)}function v(I){return I===62?z(I):I===45?x(I):g(I)}function S(I){const $="CDATA[";return I===$.charCodeAt(s++)?(e.consume(I),s===$.length?A:S):n(I)}function A(I){return I===null?n(I):I===93?(e.consume(I),T):lt(I)?(l=A,K(I)):(e.consume(I),A)}function T(I){return I===93?(e.consume(I),C):A(I)}function C(I){return I===62?z(I):I===93?(e.consume(I),C):A(I)}function N(I){return I===null||I===62?z(I):lt(I)?(l=N,K(I)):(e.consume(I),N)}function R(I){return I===null?n(I):I===63?(e.consume(I),O):lt(I)?(l=R,K(I)):(e.consume(I),R)}function O(I){return I===62?z(I):R(I)}function H(I){return ha(I)?(e.consume(I),D):n(I)}function D(I){return I===45||jr(I)?(e.consume(I),D):q(I)}function q(I){return lt(I)?(l=q,K(I)):Lt(I)?(e.consume(I),q):z(I)}function Z(I){return I===45||jr(I)?(e.consume(I),Z):I===47||I===62||Ln(I)?V(I):n(I)}function V(I){return I===47?(e.consume(I),z):I===58||I===95||ha(I)?(e.consume(I),Y):lt(I)?(l=V,K(I)):Lt(I)?(e.consume(I),V):z(I)}function Y(I){return I===45||I===46||I===58||I===95||jr(I)?(e.consume(I),Y):F(I)}function F(I){return I===61?(e.consume(I),j):lt(I)?(l=F,K(I)):Lt(I)?(e.consume(I),F):V(I)}function j(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),r=I,ee):lt(I)?(l=j,K(I)):Lt(I)?(e.consume(I),j):(e.consume(I),P)}function ee(I){return I===r?(e.consume(I),r=void 0,W):I===null?n(I):lt(I)?(l=ee,K(I)):(e.consume(I),ee)}function P(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||Ln(I)?V(I):(e.consume(I),P)}function W(I){return I===47||I===62||Ln(I)?V(I):n(I)}function z(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function K(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),G}function G(I){return Lt(I)?Kt(e,Q,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):Q(I)}function Q(I){return e.enter("htmlTextData"),l(I)}}const A_={name:"labelEnd",resolveAll:BI,resolveTo:LI,tokenize:jI},OI={tokenize:II},DI={tokenize:UI},zI={tokenize:HI};function BI(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const r=i.type==="labelImage"?4:2;i.type="data",t+=r}}return e.length!==n.length&&rs(e,0,e.length,n),e}function LI(e,t){let n=e.length,i=0,r,s,l,c;for(;n--;)if(r=e[n][1],s){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(s=n,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(l=n);const f={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[s][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[s+i+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",f,t],["enter",p,t]],c=zs(c,e.slice(s+1,s+i+3)),c=zs(c,[["enter",m,t]]),c=zs(c,ox(t.parser.constructs.insideSpan.null,e.slice(s+i+4,l-3),t)),c=zs(c,[["exit",m,t],e[l-2],e[l-1],["exit",p,t]]),c=zs(c,e.slice(l+1)),c=zs(c,[["exit",f,t]]),rs(e,s,e.length,c),e}function jI(e,t,n){const i=this;let r=i.events.length,s,l;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){s=i.events[r][1];break}return c;function c(x){return s?s._inactive?g(x):(l=i.parser.defined.includes(vl(i.sliceSerialize({start:s.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),f):n(x)}function f(x){return x===40?e.attempt(OI,m,l?m:g)(x):x===91?e.attempt(DI,m,l?p:g)(x):l?m(x):g(x)}function p(x){return e.attempt(zI,m,g)(x)}function m(x){return t(x)}function g(x){return s._balanced=!0,n(x)}}function II(e,t,n){return i;function i(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),r}function r(g){return Ln(g)?Cm(e,s)(g):s(g)}function s(g){return g===41?m(g):rR(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function l(g){return Ln(g)?Cm(e,f)(g):m(g)}function c(g){return n(g)}function f(g){return g===34||g===39||g===40?sR(e,p,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):m(g)}function p(g){return Ln(g)?Cm(e,m)(g):m(g)}function m(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function UI(e,t,n){const i=this;return r;function r(c){return aR.call(i,e,s,l,"reference","referenceMarker","referenceString")(c)}function s(c){return i.parser.defined.includes(vl(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function HI(e,t,n){return i;function i(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),r}function r(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const PI={name:"labelStartImage",resolveAll:A_.resolveAll,tokenize:FI};function FI(e,t,n){const i=this;return r;function r(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),s}function s(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(c):t(c)}}const GI={name:"labelStartLink",resolveAll:A_.resolveAll,tokenize:qI};function qI(e,t,n){const i=this;return r;function r(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),s}function s(l){return l===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(l):t(l)}}const iv={name:"lineEnding",tokenize:YI};function YI(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Kt(e,t,"linePrefix")}}const x0={name:"thematicBreak",tokenize:VI};function VI(e,t,n){let i=0,r;return s;function s(p){return e.enter("thematicBreak"),l(p)}function l(p){return r=p,c(p)}function c(p){return p===r?(e.enter("thematicBreakSequence"),f(p)):i>=3&&(p===null||lt(p))?(e.exit("thematicBreak"),t(p)):n(p)}function f(p){return p===r?(e.consume(p),i++,f):(e.exit("thematicBreakSequence"),Lt(p)?Kt(e,c,"whitespace")(p):c(p))}}const Ra={continuation:{tokenize:WI},exit:ZI,name:"list",tokenize:$I},XI={partial:!0,tokenize:JI},KI={partial:!0,tokenize:QI};function $I(e,t,n){const i=this,r=i.events[i.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,l=0;return c;function c(v){const S=i.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!i.containerState.marker||v===i.containerState.marker:v1(v)){if(i.containerState.type||(i.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(x0,n,p)(v):p(v);if(!i.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(v)}return n(v)}function f(v){return v1(v)&&++l<10?(e.consume(v),f):(!i.interrupt||l<2)&&(i.containerState.marker?v===i.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),p(v)):n(v)}function p(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||v,e.check(tg,i.interrupt?n:m,e.attempt(XI,x,g))}function m(v){return i.containerState.initialBlankLine=!0,s++,x(v)}function g(v){return Lt(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),x):n(v)}function x(v){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function WI(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(tg,r,s);function r(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Kt(e,t,"listItemIndent",i.containerState.size+1)(c)}function s(c){return i.containerState.furtherBlankLines||!Lt(c)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,l(c)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(KI,t,l)(c))}function l(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,Kt(e,e.attempt(Ra,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function QI(e,t,n){const i=this;return Kt(e,r,"listItemIndent",i.containerState.size+1);function r(s){const l=i.events[i.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===i.containerState.size?t(s):n(s)}}function ZI(e){e.exit(this.containerState.type)}function JI(e,t,n){const i=this;return Kt(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const l=i.events[i.events.length-1];return!Lt(s)&&l&&l[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const A2={name:"setextUnderline",resolveTo:eU,tokenize:tU};function eU(e,t){let n=e.length,i,r,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const l={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",s?(e.splice(r,0,["enter",l,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=l,e.push(["exit",l,t]),e}function tU(e,t,n){const i=this;let r;return s;function s(p){let m=i.events.length,g;for(;m--;)if(i.events[m][1].type!=="lineEnding"&&i.events[m][1].type!=="linePrefix"&&i.events[m][1].type!=="content"){g=i.events[m][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||g)?(e.enter("setextHeadingLine"),r=p,l(p)):n(p)}function l(p){return e.enter("setextHeadingLineSequence"),c(p)}function c(p){return p===r?(e.consume(p),c):(e.exit("setextHeadingLineSequence"),Lt(p)?Kt(e,f,"lineSuffix")(p):f(p))}function f(p){return p===null||lt(p)?(e.exit("setextHeadingLine"),t(p)):n(p)}}const nU={tokenize:iU};function iU(e){const t=this,n=e.attempt(tg,i,e.attempt(this.parser.constructs.flowInitial,r,Kt(e,e.attempt(this.parser.constructs.flow,r,e.attempt(oI,r)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const rU={resolveAll:oR()},aU=lR("string"),sU=lR("text");function lR(e){return{resolveAll:oR(e==="text"?lU:void 0),tokenize:t};function t(n){const i=this,r=this.parser.constructs[e],s=n.attempt(r,l,c);return l;function l(m){return p(m)?s(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),f}function f(m){return p(m)?(n.exit("data"),s(m)):(n.consume(m),f)}function p(m){if(m===null)return!0;const g=r[m];let x=-1;if(g)for(;++x<g.length;){const v=g[x];if(!v.previous||v.previous.call(i,i.previous))return!0}return!1}}}function oR(e){return t;function t(n,i){let r=-1,s;for(;++r<=n.length;)s===void 0?n[r]&&n[r][1].type==="data"&&(s=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==s+2&&(n[s][1].end=n[r-1][1].end,n.splice(s+2,r-s-2),r=s+2),s=void 0);return e?e(n,i):n}}function lU(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],r=t.sliceStream(i);let s=r.length,l=-1,c=0,f;for(;s--;){const p=r[s];if(typeof p=="string"){for(l=p.length;p.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(p===-2)f=!0,c++;else if(p!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const p={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?l:i.start._bufferIndex+l,_index:i.start._index+s,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...p.start},i.start.offset===i.end.offset?Object.assign(i,p):(e.splice(n,0,["enter",p,t],["exit",p,t]),n+=2)}n++}return e}const oU={42:Ra,43:Ra,45:Ra,48:Ra,49:Ra,50:Ra,51:Ra,52:Ra,53:Ra,54:Ra,55:Ra,56:Ra,57:Ra,62:eR},cU={91:hI},uU={[-2]:nv,[-1]:nv,32:nv},dU={35:bI,42:x0,45:[A2,x0],60:EI,61:A2,95:x0,96:T2,126:T2},fU={38:nR,92:tR},hU={[-5]:iv,[-4]:iv,[-3]:iv,33:PI,38:nR,42:_1,60:[Gj,kI],91:GI,92:[yI,tR],93:A_,95:_1,96:nI},pU={null:[_1,rU]},mU={null:[42,95]},gU={null:[]},yU=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:mU,contentInitial:cU,disable:gU,document:oU,flow:dU,flowInitial:uU,insideSpan:pU,string:fU,text:hU},Symbol.toStringTag,{value:"Module"}));function xU(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},s=[];let l=[],c=[];const f={attempt:q(H),check:q(D),consume:N,enter:R,exit:O,interrupt:q(D,{interrupt:!0})},p={code:null,containerState:{},defineSkip:A,events:[],now:S,parser:e,previous:null,sliceSerialize:x,sliceStream:v,write:g};let m=t.tokenize.call(p,f);return t.resolveAll&&s.push(t),p;function g(F){return l=zs(l,F),T(),l[l.length-1]!==null?[]:(Z(t,0),p.events=ox(s,p.events,p),p.events)}function x(F,j){return vU(v(F),j)}function v(F){return bU(l,F)}function S(){const{_bufferIndex:F,_index:j,line:ee,column:P,offset:W}=i;return{_bufferIndex:F,_index:j,line:ee,column:P,offset:W}}function A(F){r[F.line]=F.column,Y()}function T(){let F;for(;i._index<l.length;){const j=l[i._index];if(typeof j=="string")for(F=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===F&&i._bufferIndex<j.length;)C(j.charCodeAt(i._bufferIndex));else C(j)}}function C(F){m=m(F)}function N(F){lt(F)?(i.line++,i.column=1,i.offset+=F===-3?2:1,Y()):F!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===l[i._index].length&&(i._bufferIndex=-1,i._index++)),p.previous=F}function R(F,j){const ee=j||{};return ee.type=F,ee.start=S(),p.events.push(["enter",ee,p]),c.push(ee),ee}function O(F){const j=c.pop();return j.end=S(),p.events.push(["exit",j,p]),j}function H(F,j){Z(F,j.from)}function D(F,j){j.restore()}function q(F,j){return ee;function ee(P,W,z){let K,G,Q,I;return Array.isArray(P)?ne(P):"tokenize"in P?ne([P]):$(P);function $(de){return xe;function xe(me){const le=me!==null&&de[me],Re=me!==null&&de.null,je=[...Array.isArray(le)?le:le?[le]:[],...Array.isArray(Re)?Re:Re?[Re]:[]];return ne(je)(me)}}function ne(de){return K=de,G=0,de.length===0?z:X(de[G])}function X(de){return xe;function xe(me){return I=V(),Q=de,de.partial||(p.currentConstruct=de),de.name&&p.parser.constructs.disable.null.includes(de.name)?ie():de.tokenize.call(j?Object.assign(Object.create(p),j):p,f,ce,ie)(me)}}function ce(de){return F(Q,I),W}function ie(de){return I.restore(),++G<K.length?X(K[G]):z}}}function Z(F,j){F.resolveAll&&!s.includes(F)&&s.push(F),F.resolve&&rs(p.events,j,p.events.length-j,F.resolve(p.events.slice(j),p)),F.resolveTo&&(p.events=F.resolveTo(p.events,p))}function V(){const F=S(),j=p.previous,ee=p.currentConstruct,P=p.events.length,W=Array.from(c);return{from:P,restore:z};function z(){i=F,p.previous=j,p.currentConstruct=ee,p.events.length=P,c=W,Y()}}function Y(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function bU(e,t){const n=t.start._index,i=t.start._bufferIndex,r=t.end._index,s=t.end._bufferIndex;let l;if(n===r)l=[e[n].slice(i,s)];else{if(l=e.slice(n,r),i>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(i):l.shift()}s>0&&l.push(e[r].slice(0,s))}return l}function vU(e,t){let n=-1;const i=[];let r;for(;++n<e.length;){const s=e[n];let l;if(typeof s=="string")l=s;else switch(s){case-5:{l="\r";break}case-4:{l=`
346
- `;break}case-3:{l=`\r
347
- `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&r)continue;l=" ";break}default:l=String.fromCharCode(s)}r=s===-2,i.push(l)}return i.join("")}function _U(e){const i={constructs:ZM([yU,...(e||{}).extensions||[]]),content:r(Lj),defined:[],document:r(Ij),flow:r(nU),lazy:{},string:r(aU),text:r(sU)};return i;function r(s){return l;function l(c){return xU(i,s,c)}}}function SU(e){for(;!iR(e););return e}const M2=/[\0\t\n\r]/g;function EU(){let e=1,t="",n=!0,i;return r;function r(s,l,c){const f=[];let p,m,g,x,v;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(l||void 0).decode(s)),g=0,t="",n&&(s.charCodeAt(0)===65279&&g++,n=void 0);g<s.length;){if(M2.lastIndex=g,p=M2.exec(s),x=p&&p.index!==void 0?p.index:s.length,v=s.charCodeAt(x),!p){t=s.slice(g);break}if(v===10&&g===x&&i)f.push(-3),i=void 0;else switch(i&&(f.push(-5),i=void 0),g<x&&(f.push(s.slice(g,x)),e+=x-g),v){case 0:{f.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,f.push(-2);e++<m;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:i=!0,e=1}g=x+1}return c&&(i&&f.push(-5),t&&f.push(t),f.push(null)),f}}const wU=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function TU(e){return e.replace(wU,CU)}function CU(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),s=r===120||r===88;return JM(n.slice(s?2:1),s?16:10)}return C_(n)||e}const cR={}.hasOwnProperty;function AU(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),MU(n)(SU(_U(n).document().write(EU()(e,t,!0))))}function MU(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Sn),autolinkProtocol:V,autolinkEmail:V,atxHeading:s(ot),blockQuote:s(Re),characterEscape:V,characterReference:V,codeFenced:s(je),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(je,l),codeText:s(Ie,l),codeTextData:V,data:V,codeFlowValue:V,definition:s(He),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(Qe),hardBreakEscape:s(Ue),hardBreakTrailing:s(Ue),htmlFlow:s(wt,l),htmlFlowData:V,htmlText:s(wt,l),htmlTextData:V,image:s(_n),label:l,link:s(Sn),listItem:s(oi),listItemValue:x,listOrdered:s(hn,g),listUnordered:s(hn),paragraph:s(Ur),reference:X,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(ot),strong:s(Ci),thematicBreak:s(sr)},exit:{atxHeading:f(),atxHeadingSequence:H,autolink:f(),autolinkEmail:le,autolinkProtocol:me,blockQuote:f(),characterEscapeValue:Y,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:de,characterReference:xe,codeFenced:f(T),codeFencedFence:A,codeFencedFenceInfo:v,codeFencedFenceMeta:S,codeFlowValue:Y,codeIndented:f(C),codeText:f(W),codeTextData:Y,data:Y,definition:f(),definitionDestinationString:O,definitionLabelString:N,definitionTitleString:R,emphasis:f(),hardBreakEscape:f(j),hardBreakTrailing:f(j),htmlFlow:f(ee),htmlFlowData:Y,htmlText:f(P),htmlTextData:Y,image:f(K),label:Q,labelText:G,lineEnding:F,link:f(z),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:ce,resourceDestinationString:I,resourceTitleString:$,resource:ne,setextHeading:f(Z),setextHeadingLineSequence:q,setextHeadingText:D,strong:f(),thematicBreak:f()}};uR(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(Ee){let ke={type:"root",children:[]};const oe={stack:[ke],tokenStack:[],config:t,enter:c,exit:p,buffer:l,resume:m,data:n},Pe=[];let ct=-1;for(;++ct<Ee.length;)if(Ee[ct][1].type==="listOrdered"||Ee[ct][1].type==="listUnordered")if(Ee[ct][0]==="enter")Pe.push(ct);else{const tn=Pe.pop();ct=r(Ee,tn,ct)}for(ct=-1;++ct<Ee.length;){const tn=t[Ee[ct][0]];cR.call(tn,Ee[ct][1].type)&&tn[Ee[ct][1].type].call(Object.assign({sliceSerialize:Ee[ct][2].sliceSerialize},oe),Ee[ct][1])}if(oe.tokenStack.length>0){const tn=oe.tokenStack[oe.tokenStack.length-1];(tn[1]||R2).call(oe,void 0,tn[0])}for(ke.position={start:Jc(Ee.length>0?Ee[0][1].start:{line:1,column:1,offset:0}),end:Jc(Ee.length>0?Ee[Ee.length-2][1].end:{line:1,column:1,offset:0})},ct=-1;++ct<t.transforms.length;)ke=t.transforms[ct](ke)||ke;return ke}function r(Ee,ke,oe){let Pe=ke-1,ct=-1,tn=!1,ci,Qt,Zt,Gn;for(;++Pe<=oe;){const Pt=Ee[Pe];switch(Pt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Pt[0]==="enter"?ct++:ct--,Gn=void 0;break}case"lineEndingBlank":{Pt[0]==="enter"&&(ci&&!Gn&&!ct&&!Zt&&(Zt=Pe),Gn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Gn=void 0}if(!ct&&Pt[0]==="enter"&&Pt[1].type==="listItemPrefix"||ct===-1&&Pt[0]==="exit"&&(Pt[1].type==="listUnordered"||Pt[1].type==="listOrdered")){if(ci){let Yi=Pe;for(Qt=void 0;Yi--;){const Jn=Ee[Yi];if(Jn[1].type==="lineEnding"||Jn[1].type==="lineEndingBlank"){if(Jn[0]==="exit")continue;Qt&&(Ee[Qt][1].type="lineEndingBlank",tn=!0),Jn[1].type="lineEnding",Qt=Yi}else if(!(Jn[1].type==="linePrefix"||Jn[1].type==="blockQuotePrefix"||Jn[1].type==="blockQuotePrefixWhitespace"||Jn[1].type==="blockQuoteMarker"||Jn[1].type==="listItemIndent"))break}Zt&&(!Qt||Zt<Qt)&&(ci._spread=!0),ci.end=Object.assign({},Qt?Ee[Qt][1].start:Pt[1].end),Ee.splice(Qt||Pe,0,["exit",ci,Pt[2]]),Pe++,oe++}if(Pt[1].type==="listItemPrefix"){const Yi={type:"listItem",_spread:!1,start:Object.assign({},Pt[1].start),end:void 0};ci=Yi,Ee.splice(Pe,0,["enter",Yi,Pt[2]]),Pe++,oe++,Zt=void 0,Gn=!0}}}return Ee[ke][1]._spread=tn,oe}function s(Ee,ke){return oe;function oe(Pe){c.call(this,Ee(Pe),Pe),ke&&ke.call(this,Pe)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(Ee,ke,oe){this.stack[this.stack.length-1].children.push(Ee),this.stack.push(Ee),this.tokenStack.push([ke,oe||void 0]),Ee.position={start:Jc(ke.start),end:void 0}}function f(Ee){return ke;function ke(oe){Ee&&Ee.call(this,oe),p.call(this,oe)}}function p(Ee,ke){const oe=this.stack.pop(),Pe=this.tokenStack.pop();if(Pe)Pe[0].type!==Ee.type&&(ke?ke.call(this,Ee,Pe[0]):(Pe[1]||R2).call(this,Ee,Pe[0]));else throw new Error("Cannot close `"+Ee.type+"` ("+Tm({start:Ee.start,end:Ee.end})+"): it’s not open");oe.position.end=Jc(Ee.end)}function m(){return T_(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(Ee){if(this.data.expectingFirstListItemValue){const ke=this.stack[this.stack.length-2];ke.start=Number.parseInt(this.sliceSerialize(Ee),10),this.data.expectingFirstListItemValue=void 0}}function v(){const Ee=this.resume(),ke=this.stack[this.stack.length-1];ke.lang=Ee}function S(){const Ee=this.resume(),ke=this.stack[this.stack.length-1];ke.meta=Ee}function A(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const Ee=this.resume(),ke=this.stack[this.stack.length-1];ke.value=Ee.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const Ee=this.resume(),ke=this.stack[this.stack.length-1];ke.value=Ee.replace(/(\r?\n|\r)$/g,"")}function N(Ee){const ke=this.resume(),oe=this.stack[this.stack.length-1];oe.label=ke,oe.identifier=vl(this.sliceSerialize(Ee)).toLowerCase()}function R(){const Ee=this.resume(),ke=this.stack[this.stack.length-1];ke.title=Ee}function O(){const Ee=this.resume(),ke=this.stack[this.stack.length-1];ke.url=Ee}function H(Ee){const ke=this.stack[this.stack.length-1];if(!ke.depth){const oe=this.sliceSerialize(Ee).length;ke.depth=oe}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function q(Ee){const ke=this.stack[this.stack.length-1];ke.depth=this.sliceSerialize(Ee).codePointAt(0)===61?1:2}function Z(){this.data.setextHeadingSlurpLineEnding=void 0}function V(Ee){const oe=this.stack[this.stack.length-1].children;let Pe=oe[oe.length-1];(!Pe||Pe.type!=="text")&&(Pe=Wt(),Pe.position={start:Jc(Ee.start),end:void 0},oe.push(Pe)),this.stack.push(Pe)}function Y(Ee){const ke=this.stack.pop();ke.value+=this.sliceSerialize(Ee),ke.position.end=Jc(Ee.end)}function F(Ee){const ke=this.stack[this.stack.length-1];if(this.data.atHardBreak){const oe=ke.children[ke.children.length-1];oe.position.end=Jc(Ee.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ke.type)&&(V.call(this,Ee),Y.call(this,Ee))}function j(){this.data.atHardBreak=!0}function ee(){const Ee=this.resume(),ke=this.stack[this.stack.length-1];ke.value=Ee}function P(){const Ee=this.resume(),ke=this.stack[this.stack.length-1];ke.value=Ee}function W(){const Ee=this.resume(),ke=this.stack[this.stack.length-1];ke.value=Ee}function z(){const Ee=this.stack[this.stack.length-1];if(this.data.inReference){const ke=this.data.referenceType||"shortcut";Ee.type+="Reference",Ee.referenceType=ke,delete Ee.url,delete Ee.title}else delete Ee.identifier,delete Ee.label;this.data.referenceType=void 0}function K(){const Ee=this.stack[this.stack.length-1];if(this.data.inReference){const ke=this.data.referenceType||"shortcut";Ee.type+="Reference",Ee.referenceType=ke,delete Ee.url,delete Ee.title}else delete Ee.identifier,delete Ee.label;this.data.referenceType=void 0}function G(Ee){const ke=this.sliceSerialize(Ee),oe=this.stack[this.stack.length-2];oe.label=TU(ke),oe.identifier=vl(ke).toLowerCase()}function Q(){const Ee=this.stack[this.stack.length-1],ke=this.resume(),oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,oe.type==="link"){const Pe=Ee.children;oe.children=Pe}else oe.alt=ke}function I(){const Ee=this.resume(),ke=this.stack[this.stack.length-1];ke.url=Ee}function $(){const Ee=this.resume(),ke=this.stack[this.stack.length-1];ke.title=Ee}function ne(){this.data.inReference=void 0}function X(){this.data.referenceType="collapsed"}function ce(Ee){const ke=this.resume(),oe=this.stack[this.stack.length-1];oe.label=ke,oe.identifier=vl(this.sliceSerialize(Ee)).toLowerCase(),this.data.referenceType="full"}function ie(Ee){this.data.characterReferenceType=Ee.type}function de(Ee){const ke=this.sliceSerialize(Ee),oe=this.data.characterReferenceType;let Pe;oe?(Pe=JM(ke,oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Pe=C_(ke);const ct=this.stack[this.stack.length-1];ct.value+=Pe}function xe(Ee){const ke=this.stack.pop();ke.position.end=Jc(Ee.end)}function me(Ee){Y.call(this,Ee);const ke=this.stack[this.stack.length-1];ke.url=this.sliceSerialize(Ee)}function le(Ee){Y.call(this,Ee);const ke=this.stack[this.stack.length-1];ke.url="mailto:"+this.sliceSerialize(Ee)}function Re(){return{type:"blockquote",children:[]}}function je(){return{type:"code",lang:null,meta:null,value:""}}function Ie(){return{type:"inlineCode",value:""}}function He(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Qe(){return{type:"emphasis",children:[]}}function ot(){return{type:"heading",depth:0,children:[]}}function Ue(){return{type:"break"}}function wt(){return{type:"html",value:""}}function _n(){return{type:"image",title:null,url:"",alt:null}}function Sn(){return{type:"link",title:null,url:"",children:[]}}function hn(Ee){return{type:"list",ordered:Ee.type==="listOrdered",start:null,spread:Ee._spread,children:[]}}function oi(Ee){return{type:"listItem",spread:Ee._spread,checked:null,children:[]}}function Ur(){return{type:"paragraph",children:[]}}function Ci(){return{type:"strong",children:[]}}function Wt(){return{type:"text",value:""}}function sr(){return{type:"thematicBreak"}}}function Jc(e){return{line:e.line,column:e.column,offset:e.offset}}function uR(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?uR(e,i):RU(e,i)}}function RU(e,t){let n;for(n in t)if(cR.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function R2(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Tm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Tm({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Tm({start:t.start,end:t.end})+") is still open")}function kU(e){const t=this;t.parser=n;function n(i){return AU(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function NU(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function OU(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
348
- `}]}function DU(e,t){const n=t.value?t.value+`
349
- `:"",i={},r=t.lang?t.lang.split(/\s+/):[];r.length>0&&(i.className=["language-"+r[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function zU(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function BU(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LU(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=Th(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let l,c=e.footnoteCounts.get(i);c===void 0?(c=0,e.footnoteOrder.push(i),l=e.footnoteOrder.length):l=s+1,c+=1,e.footnoteCounts.set(i,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const p={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,p),e.applyData(t,p)}function jU(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function IU(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function dR(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const r=e.all(t),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const l=r[r.length-1];return l&&l.type==="text"?l.value+=i:r.push({type:"text",value:i}),r}function UU(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return dR(e,t);const r={src:Th(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,s),e.applyData(t,s)}function HU(e,t){const n={src:Th(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function PU(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function FU(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return dR(e,t);const r={href:Th(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function GU(e,t){const n={href:Th(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function qU(e,t,n){const i=e.all(t),r=n?YU(n):fR(t),s={},l=[];if(typeof t.checked=="boolean"){const m=i[0];let g;m&&m.type==="element"&&m.tagName==="p"?g=m:(g={type:"element",tagName:"p",properties:{},children:[]},i.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let c=-1;for(;++c<i.length;){const m=i[c];(r||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
350
- `}),m.type==="element"&&m.tagName==="p"&&!r?l.push(...m.children):l.push(m)}const f=i[i.length-1];f&&(r||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
351
- `});const p={type:"element",tagName:"li",properties:s,children:l};return e.patch(t,p),e.applyData(t,p)}function YU(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=fR(n[i])}return t}function fR(e){const t=e.spread;return t??e.children.length>1}function VU(e,t){const n={},i=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r<i.length;){const l=i[r];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function XU(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function KU(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function $U(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function WU(e,t){const n=e.all(t),i=n.shift(),r=[];if(i){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],l),r.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=__(t.children[1]),f=YM(t.children[t.children.length-1]);c&&f&&(l.position={start:c,end:f}),r.push(l)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function QU(e,t,n){const i=n?n.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let f=-1;const p=[];for(;++f<c;){const g=t.children[f],x={},v=l?l[f]:void 0;v&&(x.align=v);let S={type:"element",tagName:s,properties:x,children:[]};g&&(S.children=e.all(g),e.patch(g,S),S=e.applyData(g,S)),p.push(S)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(t,m),e.applyData(t,m)}function ZU(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const k2=9,N2=32;function JU(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),r=0;const s=[];for(;i;)s.push(O2(t.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return s.push(O2(t.slice(r),r>0,!1)),s.join("")}function O2(e,t,n){let i=0,r=e.length;if(t){let s=e.codePointAt(i);for(;s===k2||s===N2;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(r-1);for(;s===k2||s===N2;)r--,s=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function eH(e,t){const n={type:"text",value:JU(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function tH(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const nH={blockquote:NU,break:OU,code:DU,delete:zU,emphasis:BU,footnoteReference:LU,heading:jU,html:IU,imageReference:UU,image:HU,inlineCode:PU,linkReference:FU,link:GU,listItem:qU,list:VU,paragraph:XU,root:KU,strong:$U,table:WU,tableCell:ZU,tableRow:QU,text:eH,thematicBreak:tH,toml:Ky,yaml:Ky,definition:Ky,footnoteDefinition:Ky};function Ky(){}const hR=-1,cx=0,Am=1,B0=2,M_=3,R_=4,k_=5,N_=6,pR=7,mR=8,D2=typeof self=="object"?self:globalThis,iH=(e,t)=>{const n=(r,s)=>(e.set(s,r),r),i=r=>{if(e.has(r))return e.get(r);const[s,l]=t[r];switch(s){case cx:case hR:return n(l,r);case Am:{const c=n([],r);for(const f of l)c.push(i(f));return c}case B0:{const c=n({},r);for(const[f,p]of l)c[i(f)]=i(p);return c}case M_:return n(new Date(l),r);case R_:{const{source:c,flags:f}=l;return n(new RegExp(c,f),r)}case k_:{const c=n(new Map,r);for(const[f,p]of l)c.set(i(f),i(p));return c}case N_:{const c=n(new Set,r);for(const f of l)c.add(i(f));return c}case pR:{const{name:c,message:f}=l;return n(new D2[c](f),r)}case mR:return n(BigInt(l),r);case"BigInt":return n(Object(BigInt(l)),r);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(new D2[s](l),r)};return i},z2=e=>iH(new Map,e)(0),Hf="",{toString:rH}={},{keys:aH}=Object,om=e=>{const t=typeof e;if(t!=="object"||!e)return[cx,t];const n=rH.call(e).slice(8,-1);switch(n){case"Array":return[Am,Hf];case"Object":return[B0,Hf];case"Date":return[M_,Hf];case"RegExp":return[R_,Hf];case"Map":return[k_,Hf];case"Set":return[N_,Hf];case"DataView":return[Am,n]}return n.includes("Array")?[Am,n]:n.includes("Error")?[pR,n]:[B0,n]},$y=([e,t])=>e===cx&&(t==="function"||t==="symbol"),sH=(e,t,n,i)=>{const r=(l,c)=>{const f=i.push(l)-1;return n.set(c,f),f},s=l=>{if(n.has(l))return n.get(l);let[c,f]=om(l);switch(c){case cx:{let m=l;switch(f){case"bigint":c=mR,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);m=null;break;case"undefined":return r([hR],l)}return r([c,m],l)}case Am:{if(f){let x=l;return f==="DataView"?x=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(x=new Uint8Array(l)),r([f,[...x]],l)}const m=[],g=r([c,m],l);for(const x of l)m.push(s(x));return g}case B0:{if(f)switch(f){case"BigInt":return r([f,l.toString()],l);case"Boolean":case"Number":case"String":return r([f,l.valueOf()],l)}if(t&&"toJSON"in l)return s(l.toJSON());const m=[],g=r([c,m],l);for(const x of aH(l))(e||!$y(om(l[x])))&&m.push([s(x),s(l[x])]);return g}case M_:return r([c,l.toISOString()],l);case R_:{const{source:m,flags:g}=l;return r([c,{source:m,flags:g}],l)}case k_:{const m=[],g=r([c,m],l);for(const[x,v]of l)(e||!($y(om(x))||$y(om(v))))&&m.push([s(x),s(v)]);return g}case N_:{const m=[],g=r([c,m],l);for(const x of l)(e||!$y(om(x)))&&m.push(s(x));return g}}const{message:p}=l;return r([c,{name:f,message:p}],l)};return s},B2=(e,{json:t,lossy:n}={})=>{const i=[];return sH(!(t||n),!!t,new Map,i)(e),i},L0=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?z2(B2(e,t)):structuredClone(e):(e,t)=>z2(B2(e,t));function lH(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function oH(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function cH(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||lH,i=e.options.footnoteBackLabel||oH,r=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[f]);if(!p)continue;const m=e.all(p),g=String(p.identifier).toUpperCase(),x=Th(g.toLowerCase());let v=0;const S=[],A=e.footnoteCounts.get(g);for(;A!==void 0&&++v<=A;){S.length>0&&S.push({type:"text",value:" "});let N=typeof n=="string"?n:n(f,v);typeof N=="string"&&(N={type:"text",value:N}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(f,v),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const T=m[m.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const N=T.children[T.children.length-1];N&&N.type==="text"?N.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...S)}else m.push(...S);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(m,!0)};e.patch(p,C),c.push(C)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...L0(l),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
352
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
353
- `}]}}const ng=(function(e){if(e==null)return hH;if(typeof e=="function")return ux(e);if(typeof e=="object")return Array.isArray(e)?uH(e):dH(e);if(typeof e=="string")return fH(e);throw new Error("Expected function, string, or object as test")});function uH(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ng(e[n]);return ux(i);function i(...r){let s=-1;for(;++s<t.length;)if(t[s].apply(this,r))return!0;return!1}}function dH(e){const t=e;return ux(n);function n(i){const r=i;let s;for(s in e)if(r[s]!==t[s])return!1;return!0}}function fH(e){return ux(t);function t(n){return n&&n.type===e}}function ux(e){return t;function t(n,i,r){return!!(pH(n)&&e.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function hH(){return!0}function pH(e){return e!==null&&typeof e=="object"&&"type"in e}const gR=[],mH=!0,S1=!1,gH="skip";function yR(e,t,n,i){let r;typeof t=="function"&&typeof n!="function"?(i=n,n=t):r=t;const s=ng(r),l=i?-1:1;c(e,void 0,[])();function c(f,p,m){const g=f&&typeof f=="object"?f:{};if(typeof g.type=="string"){const v=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(f.type+(v?"<"+v+">":""))+")"})}return x;function x(){let v=gR,S,A,T;if((!t||s(f,p,m[m.length-1]||void 0))&&(v=yH(n(f,m)),v[0]===S1))return v;if("children"in f&&f.children){const C=f;if(C.children&&v[0]!==gH)for(A=(i?C.children.length:-1)+l,T=m.concat(C);A>-1&&A<C.children.length;){const N=C.children[A];if(S=c(N,A,T)(),S[0]===S1)return S;A=typeof S[1]=="number"?S[1]:A+l}}return v}}}function yH(e){return Array.isArray(e)?e:typeof e=="number"?[mH,e]:e==null?gR:[e]}function dx(e,t,n,i){let r,s,l;typeof t=="function"&&typeof n!="function"?(s=void 0,l=t,r=n):(s=t,l=n,r=i),yR(e,s,c,r);function c(f,p){const m=p[p.length-1],g=m?m.children.indexOf(f):void 0;return l(f,g,m)}}const E1={}.hasOwnProperty,xH={};function bH(e,t){const n=t||xH,i=new Map,r=new Map,s=new Map,l={...nH,...n.handlers},c={all:p,applyData:_H,definitionById:i,footnoteById:r,footnoteCounts:s,footnoteOrder:[],handlers:l,one:f,options:n,patch:vH,wrap:EH};return dx(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const g=m.type==="definition"?i:r,x=String(m.identifier).toUpperCase();g.has(x)||g.set(x,m)}}),c;function f(m,g){const x=m.type,v=c.handlers[x];if(E1.call(c.handlers,x)&&v)return v(c,m,g);if(c.options.passThrough&&c.options.passThrough.includes(x)){if("children"in m){const{children:A,...T}=m,C=L0(T);return C.children=c.all(m),C}return L0(m)}return(c.options.unknownHandler||SH)(c,m,g)}function p(m){const g=[];if("children"in m){const x=m.children;let v=-1;for(;++v<x.length;){const S=c.one(x[v],m);if(S){if(v&&x[v-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=L2(S.value)),!Array.isArray(S)&&S.type==="element")){const A=S.children[0];A&&A.type==="text"&&(A.value=L2(A.value))}Array.isArray(S)?g.push(...S):g.push(S)}}}return g}}function vH(e,t){e.position&&(t.position=oj(e))}function _H(e,t){let n=t;if(e&&e.data){const i=e.data.hName,r=e.data.hChildren,s=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const l="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:l}}n.type==="element"&&s&&Object.assign(n.properties,L0(s)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function SH(e,t){const n=t.data||{},i="value"in t&&!(E1.call(n,"hProperties")||E1.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function EH(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
354
- `});++i<e.length;)i&&n.push({type:"text",value:`
355
- `}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
356
- `}),n}function L2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function j2(e,t){const n=bH(e,t),i=n.one(e,void 0),r=cH(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:`
357
- `},r),s}function wH(e,t){return e&&"run"in e?async function(n,i){const r=j2(n,{file:i,...t});await e.run(r,i)}:function(n,i){return j2(n,{file:i,...e||t})}}function I2(e){if(e)throw e}var rv,U2;function TH(){if(U2)return rv;U2=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(p){return typeof Array.isArray=="function"?Array.isArray(p):t.call(p)==="[object Array]"},s=function(p){if(!p||t.call(p)!=="[object Object]")return!1;var m=e.call(p,"constructor"),g=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!m&&!g)return!1;var x;for(x in p);return typeof x>"u"||e.call(p,x)},l=function(p,m){n&&m.name==="__proto__"?n(p,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):p[m.name]=m.newValue},c=function(p,m){if(m==="__proto__")if(e.call(p,m)){if(i)return i(p,m).value}else return;return p[m]};return rv=function f(){var p,m,g,x,v,S,A=arguments[0],T=1,C=arguments.length,N=!1;for(typeof A=="boolean"&&(N=A,A=arguments[1]||{},T=2),(A==null||typeof A!="object"&&typeof A!="function")&&(A={});T<C;++T)if(p=arguments[T],p!=null)for(m in p)g=c(A,m),x=c(p,m),A!==x&&(N&&x&&(s(x)||(v=r(x)))?(v?(v=!1,S=g&&r(g)?g:[]):S=g&&s(g)?g:{},l(A,{name:m,newValue:f(N,S,x)})):typeof x<"u"&&l(A,{name:m,newValue:x}));return A},rv}var CH=TH();const av=du(CH);function w1(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function AH(){const e=[],t={run:n,use:i};return t;function n(...r){let s=-1;const l=r.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...r);function c(f,...p){const m=e[++s];let g=-1;if(f){l(f);return}for(;++g<r.length;)(p[g]===null||p[g]===void 0)&&(p[g]=r[g]);r=p,m?MH(m,c)(...p):l(null,...p)}}function i(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}}function MH(e,t){let n;return i;function i(...l){const c=e.length>l.length;let f;c&&l.push(r);try{f=e.apply(this,l)}catch(p){const m=p;if(c&&n)throw m;return r(m)}c||(f&&f.then&&typeof f.then=="function"?f.then(s,r):f instanceof Error?r(f):s(f))}function r(l,...c){n||(n=!0,t(l,...c))}function s(l){r(null,l)}}const fo={basename:RH,dirname:kH,extname:NH,join:OH,sep:"/"};function RH(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ig(e);let n=0,i=-1,r=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else i<0&&(s=!0,i=r+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let l=-1,c=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else l<0&&(s=!0,l=r+1),c>-1&&(e.codePointAt(r)===t.codePointAt(c--)?c<0&&(i=r):(c=-1,i=l));return n===i?i=l:i<0&&(i=e.length),e.slice(n,i)}function kH(e){if(ig(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function NH(e){ig(e);let t=e.length,n=-1,i=0,r=-1,s=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){i=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?r<0?r=t:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||n<0||s===0||s===1&&r===n-1&&r===i+1?"":e.slice(r,n)}function OH(...e){let t=-1,n;for(;++t<e.length;)ig(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":DH(n)}function DH(e){ig(e);const t=e.codePointAt(0)===47;let n=zH(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function zH(e,t){let n="",i=0,r=-1,s=0,l=-1,c,f;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(r===l-1||s===1))if(r!==l-1&&s===2){if(n.length<2||i!==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="",i=0):(n=n.slice(0,f),i=n.length-1-n.lastIndexOf("/")),r=l,s=0;continue}}else if(n.length>0){n="",i=0,r=l,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,l):n=e.slice(r+1,l),i=l-r-1;r=l,s=0}else c===46&&s>-1?s++:s=-1}return n}function ig(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const BH={cwd:LH};function LH(){return"/"}function T1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function jH(e){if(typeof e=="string")e=new URL(e);else if(!T1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return IH(e)}function IH(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(t)}const sv=["history","path","basename","stem","extname","dirname"];class xR{constructor(t){let n;t?T1(t)?n={path:t}:typeof t=="string"||UH(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":BH.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<sv.length;){const s=sv[i];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let r;for(r in n)sv.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?fo.basename(this.path):void 0}set basename(t){ov(t,"basename"),lv(t,"basename"),this.path=fo.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?fo.dirname(this.path):void 0}set dirname(t){H2(this.basename,"dirname"),this.path=fo.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?fo.extname(this.path):void 0}set extname(t){if(lv(t,"extname"),H2(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=fo.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){T1(t)&&(t=jH(t)),ov(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?fo.basename(this.path,this.extname):void 0}set stem(t){ov(t,"stem"),lv(t,"stem"),this.path=fo.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const r=this.message(t,n,i);throw r.fatal=!0,r}info(t,n,i){const r=this.message(t,n,i);return r.fatal=void 0,r}message(t,n,i){const r=new Ir(t,n,i);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function lv(e,t){if(e&&e.includes(fo.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+fo.sep+"`")}function ov(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function H2(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function UH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const HH=(function(e){const i=this.constructor.prototype,r=i[e],s=function(){return r.apply(s,arguments)};return Object.setPrototypeOf(s,i),s}),PH={}.hasOwnProperty;class O_ extends HH{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=AH()}copy(){const t=new O_;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(av(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(dv("data",this.frozen),this.namespace[t]=n,this):PH.call(this.namespace,t)&&this.namespace[t]||void 0:t?(dv("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const r=n.call(t,...i);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Wy(t),i=this.parser||this.Parser;return cv("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),cv("process",this.parser||this.Parser),uv("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(s,l){const c=Wy(t),f=i.parse(c);i.run(f,c,function(m,g,x){if(m||!g||!x)return p(m);const v=g,S=i.stringify(v,x);qH(S)?x.value=S:x.result=S,p(m,x)});function p(m,g){m||!g?l(m):s?s(g):n(void 0,g)}}}processSync(t){let n=!1,i;return this.freeze(),cv("processSync",this.parser||this.Parser),uv("processSync",this.compiler||this.Compiler),this.process(t,r),F2("processSync","process",n),i;function r(s,l){n=!0,I2(s),i=l}}run(t,n,i){P2(t),this.freeze();const r=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?s(void 0,i):new Promise(s);function s(l,c){const f=Wy(n);r.run(t,f,p);function p(m,g,x){const v=g||t;m?c(m):l?l(v):i(void 0,v,x)}}}runSync(t,n){let i=!1,r;return this.run(t,n,s),F2("runSync","run",i),r;function s(l,c){I2(l),r=c,i=!0}}stringify(t,n){this.freeze();const i=Wy(n),r=this.compiler||this.Compiler;return uv("stringify",r),P2(t),r(t,i)}use(t,...n){const i=this.attachers,r=this.namespace;if(dv("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(p){if(typeof p=="function")f(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[m,...g]=p;f(m,g)}else l(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function l(p){if(!("plugins"in p)&&!("settings"in p))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");c(p.plugins),p.settings&&(r.settings=av(!0,r.settings,p.settings))}function c(p){let m=-1;if(p!=null)if(Array.isArray(p))for(;++m<p.length;){const g=p[m];s(g)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function f(p,m){let g=-1,x=-1;for(;++g<i.length;)if(i[g][0]===p){x=g;break}if(x===-1)i.push([p,...m]);else if(m.length>0){let[v,...S]=m;const A=i[x][1];w1(A)&&w1(v)&&(v=av(!0,A,v)),i[x]=[p,v,...S]}}}}const FH=new O_().freeze();function cv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function uv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function dv(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function P2(e){if(!w1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function F2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Wy(e){return GH(e)?e:new xR(e)}function GH(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function qH(e){return typeof e=="string"||YH(e)}function YH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const VH="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",G2=[],q2={allowDangerousHtml:!0},XH=/^(https?|ircs?|mailto|xmpp)$/i,KH=[{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:"className",id:"remove-classname"},{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 $H(e){const t=WH(e),n=QH(e);return ZH(t.runSync(t.parse(n),n),e)}function WH(e){const t=e.rehypePlugins||G2,n=e.remarkPlugins||G2,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...q2}:q2;return FH().use(kU).use(n).use(wH,i).use(t)}function QH(e){const t=e.children||"",n=new xR;return typeof t=="string"&&(n.value=t),n}function ZH(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,s=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||JH;for(const m of KH)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+VH+m.id,void 0);return dx(e,p),hj(e,{Fragment:_.Fragment,components:r,ignoreInvalidStyle:!0,jsx:_.jsx,jsxs:_.jsxs,passKeys:!0,passNode:!0});function p(m,g,x){if(m.type==="raw"&&x&&typeof g=="number")return l?x.children.splice(g,1):x.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let v;for(v in tv)if(Object.hasOwn(tv,v)&&Object.hasOwn(m.properties,v)){const S=m.properties[v],A=tv[v];(A===null||A.includes(m.tagName))&&(m.properties[v]=f(String(S||""),v,m))}}if(m.type==="element"){let v=n?!n.includes(m.tagName):s?s.includes(m.tagName):!1;if(!v&&i&&typeof g=="number"&&(v=!i(m,g,x)),v&&x&&typeof g=="number")return c&&m.children?x.children.splice(g,1,...m.children):x.children.splice(g,1),g}}}function JH(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||i!==-1&&t>i||XH.test(e.slice(0,t))?e:""}function Y2(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;r!==-1;)i++,r=n.indexOf(t,r+t.length);return i}function e7(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function t7(e,t,n){const r=ng((n||{}).ignore||[]),s=n7(t);let l=-1;for(;++l<s.length;)yR(e,"text",c);function c(p,m){let g=-1,x;for(;++g<m.length;){const v=m[g],S=x?x.children:void 0;if(r(v,S?S.indexOf(v):void 0,x))return;x=v}if(x)return f(p,m)}function f(p,m){const g=m[m.length-1],x=s[l][0],v=s[l][1];let S=0;const T=g.children.indexOf(p);let C=!1,N=[];x.lastIndex=0;let R=x.exec(p.value);for(;R;){const O=R.index,H={index:R.index,input:R.input,stack:[...m,p]};let D=v(...R,H);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?x.lastIndex=O+1:(S!==O&&N.push({type:"text",value:p.value.slice(S,O)}),Array.isArray(D)?N.push(...D):D&&N.push(D),S=O+R[0].length,C=!0),!x.global)break;R=x.exec(p.value)}return C?(S<p.value.length&&N.push({type:"text",value:p.value.slice(S)}),g.children.splice(T,1,...N)):N=[p],T+N.length}}function n7(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<n.length;){const r=n[i];t.push([i7(r[0]),r7(r[1])])}return t}function i7(e){return typeof e=="string"?new RegExp(e7(e),"g"):e}function r7(e){return typeof e=="function"?e:function(){return e}}const fv="phrasing",hv=["autolink","link","image","label"];function a7(){return{transforms:[f7],enter:{literalAutolink:l7,literalAutolinkEmail:pv,literalAutolinkHttp:pv,literalAutolinkWww:pv},exit:{literalAutolink:d7,literalAutolinkEmail:u7,literalAutolinkHttp:o7,literalAutolinkWww:c7}}}function s7(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:fv,notInConstruct:hv},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:fv,notInConstruct:hv},{character:":",before:"[ps]",after:"\\/",inConstruct:fv,notInConstruct:hv}]}}function l7(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function pv(e){this.config.enter.autolinkProtocol.call(this,e)}function o7(e){this.config.exit.autolinkProtocol.call(this,e)}function c7(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function u7(e){this.config.exit.autolinkEmail.call(this,e)}function d7(e){this.exit(e)}function f7(e){t7(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,h7],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),p7]],{ignore:["link","linkReference"]})}function h7(e,t,n,i,r){let s="";if(!bR(r)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!m7(n)))return!1;const l=g7(n+i);if(!l[0])return!1;const c={type:"link",title:null,url:s+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function p7(e,t,n,i){return!bR(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function m7(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function g7(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const r=Y2(e,"(");let s=Y2(e,")");for(;i!==-1&&r>s;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),s++;return[e,n]}function bR(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Sd(n)||lx(n))&&(!t||n!==47)}vR.peek=T7;function y7(){this.buffer()}function x7(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function b7(){this.buffer()}function v7(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function _7(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vl(this.sliceSerialize(e)).toLowerCase(),n.label=t}function S7(e){this.exit(e)}function E7(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vl(this.sliceSerialize(e)).toLowerCase(),n.label=t}function w7(e){this.exit(e)}function T7(){return"["}function vR(e,t,n,i){const r=n.createTracker(i);let s=r.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return s+=r.move(n.safe(n.associationId(e),{after:"]",before:s})),c(),l(),s+=r.move("]"),s}function C7(){return{enter:{gfmFootnoteCallString:y7,gfmFootnoteCall:x7,gfmFootnoteDefinitionLabelString:b7,gfmFootnoteDefinition:v7},exit:{gfmFootnoteCallString:_7,gfmFootnoteCall:S7,gfmFootnoteDefinitionLabelString:E7,gfmFootnoteDefinition:w7}}}function A7(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:vR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,l){const c=s.createTracker(l);let f=c.move("[^");const p=s.enter("footnoteDefinition"),m=s.enter("label");return f+=c.move(s.safe(s.associationId(i),{before:f,after:"]"})),m(),f+=c.move("]:"),i.children&&i.children.length>0&&(c.shift(4),f+=c.move((t?`
358
- `:" ")+s.indentLines(s.containerFlow(i,c.current()),t?_R:M7))),p(),f}}function M7(e,t,n){return t===0?e:_R(e,t,n)}function _R(e,t,n){return(n?"":" ")+e}const R7=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];SR.peek=z7;function k7(){return{canContainEols:["delete"],enter:{strikethrough:O7},exit:{strikethrough:D7}}}function N7(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:R7}],handlers:{delete:SR}}}function O7(e){this.enter({type:"delete",children:[]},e)}function D7(e){this.exit(e)}function SR(e,t,n,i){const r=n.createTracker(i),s=n.enter("strikethrough");let l=r.move("~~");return l+=n.containerPhrasing(e,{...r.current(),before:l,after:"~"}),l+=r.move("~~"),s(),l}function z7(){return"~"}function B7(e){return e.length}function L7(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||B7,s=[],l=[],c=[],f=[];let p=0,m=-1;for(;++m<e.length;){const A=[],T=[];let C=-1;for(e[m].length>p&&(p=e[m].length);++C<e[m].length;){const N=j7(e[m][C]);if(n.alignDelimiters!==!1){const R=r(N);T[C]=R,(f[C]===void 0||R>f[C])&&(f[C]=R)}A.push(N)}l[m]=A,c[m]=T}let g=-1;if(typeof i=="object"&&"length"in i)for(;++g<p;)s[g]=V2(i[g]);else{const A=V2(i);for(;++g<p;)s[g]=A}g=-1;const x=[],v=[];for(;++g<p;){const A=s[g];let T="",C="";A===99?(T=":",C=":"):A===108?T=":":A===114&&(C=":");let N=n.alignDelimiters===!1?1:Math.max(1,f[g]-T.length-C.length);const R=T+"-".repeat(N)+C;n.alignDelimiters!==!1&&(N=T.length+N+C.length,N>f[g]&&(f[g]=N),v[g]=N),x[g]=R}l.splice(1,0,x),c.splice(1,0,v),m=-1;const S=[];for(;++m<l.length;){const A=l[m],T=c[m];g=-1;const C=[];for(;++g<p;){const N=A[g]||"";let R="",O="";if(n.alignDelimiters!==!1){const H=f[g]-(T[g]||0),D=s[g];D===114?R=" ".repeat(H):D===99?H%2?(R=" ".repeat(H/2+.5),O=" ".repeat(H/2-.5)):(R=" ".repeat(H/2),O=R):O=" ".repeat(H)}n.delimiterStart!==!1&&!g&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||g)&&C.push(" "),n.alignDelimiters!==!1&&C.push(R),C.push(N),n.alignDelimiters!==!1&&C.push(O),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||g!==p-1)&&C.push("|")}S.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return S.join(`
359
- `)}function j7(e){return e==null?"":String(e)}function V2(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function I7(e,t,n,i){const r=n.enter("blockquote"),s=n.createTracker(i);s.move("> "),s.shift(2);const l=n.indentLines(n.containerFlow(e,s.current()),U7);return r(),l}function U7(e,t,n){return">"+(n?"":" ")+e}function H7(e,t){return X2(e,t.inConstruct,!0)&&!X2(e,t.notInConstruct,!1)}function X2(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function K2(e,t,n,i){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
360
- `&&H7(n.stack,n.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return`\\
361
- `}function P7(e,t){const n=String(e);let i=n.indexOf(t),r=i,s=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===r?++s>l&&(l=s):s=1,r=i+t.length,i=n.indexOf(t,r);return l}function F7(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function G7(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function q7(e,t,n,i){const r=G7(n),s=e.value||"",l=r==="`"?"GraveAccent":"Tilde";if(F7(e,n)){const g=n.enter("codeIndented"),x=n.indentLines(s,Y7);return g(),x}const c=n.createTracker(i),f=r.repeat(Math.max(P7(s,r)+1,3)),p=n.enter("codeFenced");let m=c.move(f);if(e.lang){const g=n.enter(`codeFencedLang${l}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:`
362
- `,encode:["`"],...c.current()})),g()}return m+=c.move(`
363
- `),s&&(m+=c.move(s+`
364
- `)),m+=c.move(f),p(),m}function Y7(e,t,n){return(n?"":" ")+e}function D_(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function V7(e,t,n,i){const r=D_(n),s=r==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const f=n.createTracker(i);let p=f.move("[");return p+=f.move(n.safe(n.associationId(e),{before:p,after:"]",...f.current()})),p+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),p+=f.move("<"),p+=f.move(n.safe(e.url,{before:p,after:">",...f.current()})),p+=f.move(">")):(c=n.enter("destinationRaw"),p+=f.move(n.safe(e.url,{before:p,after:e.title?" ":`
365
- `,...f.current()}))),c(),e.title&&(c=n.enter(`title${s}`),p+=f.move(" "+r),p+=f.move(n.safe(e.title,{before:p,after:r,...f.current()})),p+=f.move(r),c()),l(),p}function X7(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Im(e){return"&#x"+e.toString(16).toUpperCase()+";"}function j0(e,t,n){const i=fh(e),r=fh(t);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ER.peek=K7;function ER(e,t,n,i){const r=X7(n),s=n.enter("emphasis"),l=n.createTracker(i),c=l.move(r);let f=l.move(n.containerPhrasing(e,{after:r,before:c,...l.current()}));const p=f.charCodeAt(0),m=j0(i.before.charCodeAt(i.before.length-1),p,r);m.inside&&(f=Im(p)+f.slice(1));const g=f.charCodeAt(f.length-1),x=j0(i.after.charCodeAt(0),g,r);x.inside&&(f=f.slice(0,-1)+Im(g));const v=l.move(r);return s(),n.attentionEncodeSurroundingInfo={after:x.outside,before:m.outside},c+f+v}function K7(e,t,n){return n.options.emphasis||"*"}function $7(e,t){let n=!1;return dx(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,S1}),!!((!e.depth||e.depth<3)&&T_(e)&&(t.options.setext||n))}function W7(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if($7(e,n)){const m=n.enter("headingSetext"),g=n.enter("phrasing"),x=n.containerPhrasing(e,{...s.current(),before:`
366
- `,after:`
367
- `});return g(),m(),x+`
368
- `+(r===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
369
- `))+1))}const l="#".repeat(r),c=n.enter("headingAtx"),f=n.enter("phrasing");s.move(l+" ");let p=n.containerPhrasing(e,{before:"# ",after:`
370
- `,...s.current()});return/^[\t ]/.test(p)&&(p=Im(p.charCodeAt(0))+p.slice(1)),p=p?l+" "+p:l,n.options.closeAtx&&(p+=" "+l),f(),c(),p}wR.peek=Q7;function wR(e){return e.value||""}function Q7(){return"<"}TR.peek=Z7;function TR(e,t,n,i){const r=D_(n),s=r==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const f=n.createTracker(i);let p=f.move("![");return p+=f.move(n.safe(e.alt,{before:p,after:"]",...f.current()})),p+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),p+=f.move("<"),p+=f.move(n.safe(e.url,{before:p,after:">",...f.current()})),p+=f.move(">")):(c=n.enter("destinationRaw"),p+=f.move(n.safe(e.url,{before:p,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${s}`),p+=f.move(" "+r),p+=f.move(n.safe(e.title,{before:p,after:r,...f.current()})),p+=f.move(r),c()),p+=f.move(")"),l(),p}function Z7(){return"!"}CR.peek=J7;function CR(e,t,n,i){const r=e.referenceType,s=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(i);let f=c.move("![");const p=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(p+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,s(),r==="full"||!p||p!==g?f+=c.move(g+"]"):r==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function J7(){return"!"}AR.peek=e9;function AR(e,t,n){let i=e.value||"",r="`",s=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s<n.unsafe.length;){const l=n.unsafe[s],c=n.compilePattern(l);let f;if(l.atBreak)for(;f=c.exec(i);){let p=f.index;i.charCodeAt(p)===10&&i.charCodeAt(p-1)===13&&p--,i=i.slice(0,p)+" "+i.slice(f.index+1)}}return r+i+r}function e9(){return"`"}function MR(e,t){const n=T_(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}RR.peek=t9;function RR(e,t,n,i){const r=D_(n),s=r==='"'?"Quote":"Apostrophe",l=n.createTracker(i);let c,f;if(MR(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let g=l.move("<");return g+=l.move(n.containerPhrasing(e,{before:g,after:">",...l.current()})),g+=l.move(">"),c(),n.stack=m,g}c=n.enter("link"),f=n.enter("label");let p=l.move("[");return p+=l.move(n.containerPhrasing(e,{before:p,after:"](",...l.current()})),p+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),p+=l.move("<"),p+=l.move(n.safe(e.url,{before:p,after:">",...l.current()})),p+=l.move(">")):(f=n.enter("destinationRaw"),p+=l.move(n.safe(e.url,{before:p,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${s}`),p+=l.move(" "+r),p+=l.move(n.safe(e.title,{before:p,after:r,...l.current()})),p+=l.move(r),f()),p+=l.move(")"),c(),p}function t9(e,t,n){return MR(e,n)?"<":"["}kR.peek=n9;function kR(e,t,n,i){const r=e.referenceType,s=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(i);let f=c.move("[");const p=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(p+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,s(),r==="full"||!p||p!==g?f+=c.move(g+"]"):r==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function n9(){return"["}function z_(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function i9(e){const t=z_(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function r9(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function NR(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function a9(e,t,n,i){const r=n.enter("list"),s=n.bulletCurrent;let l=e.ordered?r9(n):z_(n);const c=e.ordered?l==="."?")":".":i9(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.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),NR(n)===l&&m){let g=-1;for(;++g<e.children.length;){const x=e.children[g];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=c),n.bulletCurrent=l;const p=n.containerFlow(e,i);return n.bulletLastUsed=l,n.bulletCurrent=s,r(),p}function s9(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function l9(e,t,n,i){const r=s9(n);let s=n.bulletCurrent||z_(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let l=s.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(i);c.move(s+" ".repeat(l-s.length)),c.shift(l);const f=n.enter("listItem"),p=n.indentLines(n.containerFlow(e,c.current()),m);return f(),p;function m(g,x,v){return x?(v?"":" ".repeat(l))+g:(v?s:s+" ".repeat(l-s.length))+g}}function o9(e,t,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),l=n.containerPhrasing(e,i);return s(),r(),l}const c9=ng(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function u9(e,t,n,i){return(e.children.some(function(l){return c9(l)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function d9(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}OR.peek=f9;function OR(e,t,n,i){const r=d9(n),s=n.enter("strong"),l=n.createTracker(i),c=l.move(r+r);let f=l.move(n.containerPhrasing(e,{after:r,before:c,...l.current()}));const p=f.charCodeAt(0),m=j0(i.before.charCodeAt(i.before.length-1),p,r);m.inside&&(f=Im(p)+f.slice(1));const g=f.charCodeAt(f.length-1),x=j0(i.after.charCodeAt(0),g,r);x.inside&&(f=f.slice(0,-1)+Im(g));const v=l.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:x.outside,before:m.outside},c+f+v}function f9(e,t,n){return n.options.strong||"*"}function h9(e,t,n,i){return n.safe(e.value,i)}function p9(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function m9(e,t,n){const i=(NR(n)+(n.options.ruleSpaces?" ":"")).repeat(p9(n));return n.options.ruleSpaces?i.slice(0,-1):i}const DR={blockquote:I7,break:K2,code:q7,definition:V7,emphasis:ER,hardBreak:K2,heading:W7,html:wR,image:TR,imageReference:CR,inlineCode:AR,link:RR,linkReference:kR,list:a9,listItem:l9,paragraph:o9,root:u9,strong:OR,text:h9,thematicBreak:m9};function g9(){return{enter:{table:y9,tableData:$2,tableHeader:$2,tableRow:b9},exit:{codeText:v9,table:x9,tableData:mv,tableHeader:mv,tableRow:mv}}}function y9(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function x9(e){this.exit(e),this.data.inTable=void 0}function b9(e){this.enter({type:"tableRow",children:[]},e)}function mv(e){this.exit(e)}function $2(e){this.enter({type:"tableCell",children:[]},e)}function v9(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,_9));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function _9(e,t){return t==="|"?t:e}function S9(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,r=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
371
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:l,tableCell:f,tableRow:c}};function l(v,S,A,T){return p(m(v,A,T),v.align)}function c(v,S,A,T){const C=g(v,A,T),N=p([C]);return N.slice(0,N.indexOf(`
372
- `))}function f(v,S,A,T){const C=A.enter("tableCell"),N=A.enter("phrasing"),R=A.containerPhrasing(v,{...T,before:s,after:s});return N(),C(),R}function p(v,S){return L7(v,{align:S,alignDelimiters:i,padding:n,stringLength:r})}function m(v,S,A){const T=v.children;let C=-1;const N=[],R=S.enter("table");for(;++C<T.length;)N[C]=g(T[C],S,A);return R(),N}function g(v,S,A){const T=v.children;let C=-1;const N=[],R=S.enter("tableRow");for(;++C<T.length;)N[C]=f(T[C],v,S,A);return R(),N}function x(v,S,A){let T=DR.inlineCode(v,S,A);return A.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function E9(){return{exit:{taskListCheckValueChecked:W2,taskListCheckValueUnchecked:W2,paragraph:T9}}}function w9(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:C9}}}function W2(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function T9(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const r=t.children;let s=-1,l;for(;++s<r.length;){const c=r[s];if(c.type==="paragraph"){l=c;break}}l===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function C9(e,t,n,i){const r=e.children[0],s=typeof e.checked=="boolean"&&r&&r.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(i);s&&c.move(l);let f=DR.listItem(e,t,n,{...i,...c.current()});return s&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),f;function p(m){return m+l}}function A9(){return[a7(),C7(),k7(),g9(),E9()]}function M9(e){return{extensions:[s7(),A7(e),N7(),S9(e),w9()]}}const R9={tokenize:B9,partial:!0},zR={tokenize:L9,partial:!0},BR={tokenize:j9,partial:!0},LR={tokenize:I9,partial:!0},k9={tokenize:U9,partial:!0},jR={name:"wwwAutolink",tokenize:D9,previous:UR},IR={name:"protocolAutolink",tokenize:z9,previous:HR},uc={name:"emailAutolink",tokenize:O9,previous:PR},xo={};function N9(){return{text:xo}}let sd=48;for(;sd<123;)xo[sd]=uc,sd++,sd===58?sd=65:sd===91&&(sd=97);xo[43]=uc;xo[45]=uc;xo[46]=uc;xo[95]=uc;xo[72]=[uc,IR];xo[104]=[uc,IR];xo[87]=[uc,jR];xo[119]=[uc,jR];function O9(e,t,n){const i=this;let r,s;return l;function l(g){return!C1(g)||!PR.call(i,i.previous)||B_(i.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(g))}function c(g){return C1(g)?(e.consume(g),c):g===64?(e.consume(g),f):n(g)}function f(g){return g===46?e.check(k9,m,p)(g):g===45||g===95||jr(g)?(s=!0,e.consume(g),f):m(g)}function p(g){return e.consume(g),r=!0,f}function m(g){return s&&r&&ha(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function D9(e,t,n){const i=this;return r;function r(l){return l!==87&&l!==119||!UR.call(i,i.previous)||B_(i.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(R9,e.attempt(zR,e.attempt(BR,s),n),n)(l))}function s(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function z9(e,t,n){const i=this;let r="",s=!1;return l;function l(g){return(g===72||g===104)&&HR.call(i,i.previous)&&!B_(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(g),e.consume(g),c):n(g)}function c(g){if(ha(g)&&r.length<5)return r+=String.fromCodePoint(g),e.consume(g),c;if(g===58){const x=r.toLowerCase();if(x==="http"||x==="https")return e.consume(g),f}return n(g)}function f(g){return g===47?(e.consume(g),s?p:(s=!0,f)):n(g)}function p(g){return g===null||z0(g)||Ln(g)||Sd(g)||lx(g)?n(g):e.attempt(zR,e.attempt(BR,m),n)(g)}function m(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function B9(e,t,n){let i=0;return r;function r(l){return(l===87||l===119)&&i<3?(i++,e.consume(l),r):l===46&&i===3?(e.consume(l),s):n(l)}function s(l){return l===null?n(l):t(l)}}function L9(e,t,n){let i,r,s;return l;function l(p){return p===46||p===95?e.check(LR,f,c)(p):p===null||Ln(p)||Sd(p)||p!==45&&lx(p)?f(p):(s=!0,e.consume(p),l)}function c(p){return p===95?i=!0:(r=i,i=void 0),e.consume(p),l}function f(p){return r||i||!s?n(p):t(p)}}function j9(e,t){let n=0,i=0;return r;function r(l){return l===40?(n++,e.consume(l),r):l===41&&i<n?s(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(LR,t,s)(l):l===null||Ln(l)||Sd(l)?t(l):(e.consume(l),r)}function s(l){return l===41&&i++,e.consume(l),r}}function I9(e,t,n){return i;function i(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),i):c===38?(e.consume(c),s):c===93?(e.consume(c),r):c===60||c===null||Ln(c)||Sd(c)?t(c):n(c)}function r(c){return c===null||c===40||c===91||Ln(c)||Sd(c)?t(c):i(c)}function s(c){return ha(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),i):ha(c)?(e.consume(c),l):n(c)}}function U9(e,t,n){return i;function i(s){return e.consume(s),r}function r(s){return jr(s)?n(s):t(s)}}function UR(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ln(e)}function HR(e){return!ha(e)}function PR(e){return!(e===47||C1(e))}function C1(e){return e===43||e===45||e===46||e===95||jr(e)}function B_(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const H9={tokenize:K9,partial:!0};function P9(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Y9,continuation:{tokenize:V9},exit:X9}},text:{91:{name:"gfmFootnoteCall",tokenize:q9},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:F9,resolveTo:G9}}}}function F9(e,t,n){const i=this;let r=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l;for(;r--;){const f=i.events[r][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!l||!l._balanced)return n(f);const p=vl(i.sliceSerialize({start:l.end,end:i.now()}));return p.codePointAt(0)!==94||!s.includes(p.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function G9(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},c=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...c),e}function q9(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,l;return c;function c(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),f}function f(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(g){if(s>999||g===93&&!l||g===null||g===91||Ln(g))return n(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return r.includes(vl(i.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return Ln(g)||(l=!0),s++,e.consume(g),g===92?m:p}function m(g){return g===91||g===92||g===93?(e.consume(g),s++,p):p(g)}}function Y9(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,l=0,c;return f;function f(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(S)}function m(S){if(l>999||S===93&&!c||S===null||S===91||Ln(S))return n(S);if(S===93){e.exit("chunkString");const A=e.exit("gfmFootnoteDefinitionLabelString");return s=vl(i.sliceSerialize(A)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return Ln(S)||(c=!0),l++,e.consume(S),S===92?g:m}function g(S){return S===91||S===92||S===93?(e.consume(S),l++,m):m(S)}function x(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),r.includes(s)||r.push(s),Kt(e,v,"gfmFootnoteDefinitionWhitespace")):n(S)}function v(S){return t(S)}}function V9(e,t,n){return e.check(tg,t,e.attempt(H9,t,n))}function X9(e){e.exit("gfmFootnoteDefinition")}function K9(e,t,n){const i=this;return Kt(e,r,"gfmFootnoteDefinitionIndent",5);function r(s){const l=i.events[i.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(s):n(s)}}function $9(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(l,c){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let p=f;for(;p--;)if(l[p][0]==="exit"&&l[p][1].type==="strikethroughSequenceTemporary"&&l[p][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[p][1].end.offset-l[p][1].start.offset){l[f][1].type="strikethroughSequence",l[p][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[p][1].start),end:Object.assign({},l[f][1].end)},g={type:"strikethroughText",start:Object.assign({},l[p][1].end),end:Object.assign({},l[f][1].start)},x=[["enter",m,c],["enter",l[p][1],c],["exit",l[p][1],c],["enter",g,c]],v=c.parser.constructs.insideSpan.null;v&&rs(x,x.length,0,ox(v,l.slice(p+1,f),c)),rs(x,x.length,0,[["exit",g,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",m,c]]),rs(l,p-1,f-p+3,x),f=p+x.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function s(l,c,f){const p=this.previous,m=this.events;let g=0;return x;function x(S){return p===126&&m[m.length-1][1].type!=="characterEscape"?f(S):(l.enter("strikethroughSequenceTemporary"),v(S))}function v(S){const A=fh(p);if(S===126)return g>1?f(S):(l.consume(S),g++,v);if(g<2&&!n)return f(S);const T=l.exit("strikethroughSequenceTemporary"),C=fh(S);return T._open=!C||C===2&&!!A,T._close=!A||A===2&&!!C,c(S)}}}class W9{constructor(){this.map=[]}add(t,n,i){Q9(this,t,n,i)}consume(t){if(this.map.sort(function(s,l){return s[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let r=i.pop();for(;r;){for(const s of r)t.push(s);r=i.pop()}this.map.length=0}}function Q9(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r<e.map.length;){if(e.map[r][0]===t){e.map[r][1]+=n,e.map[r][2].push(...i);return}r+=1}e.map.push([t,n,i])}}function Z9(e,t){let n=!1;const i=[];for(;t<e.length;){const r=e[t];if(n){if(r[0]==="enter")r[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=i.length-1;i[s]=i[s]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function J9(){return{flow:{null:{name:"table",tokenize:eP,resolveAll:tP}}}}function eP(e,t,n){const i=this;let r=0,s=0,l;return c;function c(Y){let F=i.events.length-1;for(;F>-1;){const P=i.events[F][1].type;if(P==="lineEnding"||P==="linePrefix")F--;else break}const j=F>-1?i.events[F][1].type:null,ee=j==="tableHead"||j==="tableRow"?D:f;return ee===D&&i.parser.lazy[i.now().line]?n(Y):ee(Y)}function f(Y){return e.enter("tableHead"),e.enter("tableRow"),p(Y)}function p(Y){return Y===124||(l=!0,s+=1),m(Y)}function m(Y){return Y===null?n(Y):lt(Y)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(Y),e.exit("lineEnding"),v):n(Y):Lt(Y)?Kt(e,m,"whitespace")(Y):(s+=1,l&&(l=!1,r+=1),Y===124?(e.enter("tableCellDivider"),e.consume(Y),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),g(Y)))}function g(Y){return Y===null||Y===124||Ln(Y)?(e.exit("data"),m(Y)):(e.consume(Y),Y===92?x:g)}function x(Y){return Y===92||Y===124?(e.consume(Y),g):g(Y)}function v(Y){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(Y):(e.enter("tableDelimiterRow"),l=!1,Lt(Y)?Kt(e,S,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):S(Y))}function S(Y){return Y===45||Y===58?T(Y):Y===124?(l=!0,e.enter("tableCellDivider"),e.consume(Y),e.exit("tableCellDivider"),A):H(Y)}function A(Y){return Lt(Y)?Kt(e,T,"whitespace")(Y):T(Y)}function T(Y){return Y===58?(s+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(Y),e.exit("tableDelimiterMarker"),C):Y===45?(s+=1,C(Y)):Y===null||lt(Y)?O(Y):H(Y)}function C(Y){return Y===45?(e.enter("tableDelimiterFiller"),N(Y)):H(Y)}function N(Y){return Y===45?(e.consume(Y),N):Y===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(Y),e.exit("tableDelimiterMarker"),R):(e.exit("tableDelimiterFiller"),R(Y))}function R(Y){return Lt(Y)?Kt(e,O,"whitespace")(Y):O(Y)}function O(Y){return Y===124?S(Y):Y===null||lt(Y)?!l||r!==s?H(Y):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(Y)):H(Y)}function H(Y){return n(Y)}function D(Y){return e.enter("tableRow"),q(Y)}function q(Y){return Y===124?(e.enter("tableCellDivider"),e.consume(Y),e.exit("tableCellDivider"),q):Y===null||lt(Y)?(e.exit("tableRow"),t(Y)):Lt(Y)?Kt(e,q,"whitespace")(Y):(e.enter("data"),Z(Y))}function Z(Y){return Y===null||Y===124||Ln(Y)?(e.exit("data"),q(Y)):(e.consume(Y),Y===92?V:Z)}function V(Y){return Y===92||Y===124?(e.consume(Y),Z):Z(Y)}}function tP(e,t){let n=-1,i=!0,r=0,s=[0,0,0,0],l=[0,0,0,0],c=!1,f=0,p,m,g;const x=new W9;for(;++n<e.length;){const v=e[n],S=v[1];v[0]==="enter"?S.type==="tableHead"?(c=!1,f!==0&&(Q2(x,t,f,p,m),m=void 0,f=0),p={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},x.add(n,0,[["enter",p,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(i=!0,g=void 0,s=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},x.add(n,0,[["enter",m,t]])),r=S.type==="tableDelimiterRow"?2:m?3:1):r&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(i=!1,l[2]===0&&(s[1]!==0&&(l[0]=l[1],g=Qy(x,t,s,r,void 0,g),s=[0,0,0,0]),l[2]=n)):S.type==="tableCellDivider"&&(i?i=!1:(s[1]!==0&&(l[0]=l[1],g=Qy(x,t,s,r,void 0,g)),s=l,l=[s[1],n,0,0])):S.type==="tableHead"?(c=!0,f=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(f=n,s[1]!==0?(l[0]=l[1],g=Qy(x,t,s,r,n,g)):l[1]!==0&&(g=Qy(x,t,l,r,n,g)),r=0):r&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&Q2(x,t,f,p,m),x.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=Z9(t.events,n))}return e}function Qy(e,t,n,i,r,s){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(s.end=Object.assign({},Yf(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const f=Yf(t.events,n[1]);if(s={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const p=Yf(t.events,n[2]),m=Yf(t.events,n[3]),g={type:c,start:Object.assign({},p),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",g,t]]),i!==2){const x=t.events[n[2]],v=t.events[n[3]];if(x[1].end=Object.assign({},v[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,A=n[3]-n[2]-1;e.add(S,A,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return r!==void 0&&(s.end=Object.assign({},Yf(t.events,r)),e.add(r,0,[["exit",s,t]]),s=void 0),s}function Q2(e,t,n,i,r){const s=[],l=Yf(t.events,n);r&&(r.end=Object.assign({},l),s.push(["exit",r,t])),i.end=Object.assign({},l),s.push(["exit",i,t]),e.add(n+1,0,s)}function Yf(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const nP={name:"tasklistCheck",tokenize:rP};function iP(){return{text:{91:nP}}}function rP(e,t,n){const i=this;return r;function r(f){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),s)}function s(f){return Ln(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return lt(f)?t(f):Lt(f)?e.check({tokenize:aP},t,n)(f):n(f)}}function aP(e,t,n){return Kt(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function sP(e){return ZM([N9(),P9(),$9(e),J9(),iP()])}const lP={};function oP(e){const t=this,n=e||lP,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(sP(n)),s.push(A9()),l.push(M9(n))}const Z2=(function(e,t,n){const i=ng(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(i(e.children[t],t,e))return e.children[t]}),Rd=(function(e){if(e==null)return dP;if(typeof e=="string")return uP(e);if(typeof e=="object")return cP(e);if(typeof e=="function")return L_(e);throw new Error("Expected function, string, or array as `test`")});function cP(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Rd(e[n]);return L_(i);function i(...r){let s=-1;for(;++s<t.length;)if(t[s].apply(this,r))return!0;return!1}}function uP(e){return L_(t);function t(n){return n.tagName===e}}function L_(e){return t;function t(n,i,r){return!!(fP(n)&&e.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function dP(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function fP(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const J2=/\n/g,eT=/[\t ]+/g,A1=Rd("br"),tT=Rd(vP),hP=Rd("p"),nT=Rd("tr"),pP=Rd(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",bP,_P]),FR=Rd(["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 mP(e,t){const n=t||{},i="children"in e?e.children:[],r=FR(e),s=YR(e,{whitespace:n.whitespace||"normal"}),l=[];(e.type==="text"||e.type==="comment")&&l.push(...qR(e,{breakBefore:!0,breakAfter:!0}));let c=-1;for(;++c<i.length;)l.push(...GR(i[c],e,{whitespace:s,breakBefore:c?void 0:r,breakAfter:c<i.length-1?A1(i[c+1]):r}));const f=[];let p;for(c=-1;++c<l.length;){const m=l[c];typeof m=="number"?p!==void 0&&m>p&&(p=m):m&&(p!==void 0&&p>-1&&f.push(`
373
- `.repeat(p)||" "),p=-1,f.push(m))}return f.join("")}function GR(e,t,n){return e.type==="element"?gP(e,t,n):e.type==="text"?n.whitespace==="normal"?qR(e,n):yP(e):[]}function gP(e,t,n){const i=YR(e,n),r=e.children||[];let s=-1,l=[];if(pP(e))return l;let c,f;for(A1(e)||nT(e)&&Z2(t,e,nT)?f=`
374
- `:hP(e)?(c=2,f=2):FR(e)&&(c=1,f=1);++s<r.length;)l=l.concat(GR(r[s],e,{whitespace:i,breakBefore:s?void 0:c,breakAfter:s<r.length-1?A1(r[s+1]):f}));return tT(e)&&Z2(t,e,tT)&&l.push(" "),c&&l.unshift(c),f&&l.push(f),l}function qR(e,t){const n=String(e.value),i=[],r=[];let s=0;for(;s<=n.length;){J2.lastIndex=s;const f=J2.exec(n),p=f&&"index"in f?f.index:n.length;i.push(xP(n.slice(s,p).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),s===0?t.breakBefore:!0,p===n.length?t.breakAfter:!0)),s=p+1}let l=-1,c;for(;++l<i.length;)i[l].charCodeAt(i[l].length-1)===8203||l<i.length-1&&i[l+1].charCodeAt(0)===8203?(r.push(i[l]),c=void 0):i[l]?(typeof c=="number"&&r.push(c),r.push(i[l]),c=0):(l===0||l===i.length-1)&&r.push(0);return r}function yP(e){return[String(e.value)]}function xP(e,t,n){const i=[];let r=0,s;for(;r<e.length;){eT.lastIndex=r;const l=eT.exec(e);s=l?l.index:e.length,!r&&!s&&l&&!t&&i.push(""),r!==s&&i.push(e.slice(r,s)),r=l?s+l[0].length:s}return r!==s&&!n&&i.push(""),i.join(" ")}function YR(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.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":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function bP(e){return!!(e.properties||{}).hidden}function vP(e){return e.tagName==="td"||e.tagName==="th"}function _P(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function SP(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",l="(?!struct)("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",c={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.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:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},m={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},g={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},e.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},v=t.optional(r)+e.IDENT_RE+"\\s*\\(",S=["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"],A=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],T=["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"],C=["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"],O={type:A,keyword:S,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:T},H={className:"function.dispatch",relevance:0,keywords:{_hint:C},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},D=[H,g,c,n,e.C_BLOCK_COMMENT_MODE,m,p],q={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:D.concat([{begin:/\(/,end:/\)/,keywords:O,contains:D.concat(["self"]),relevance:0}]),relevance:0},Z={className:"function",begin:"("+l+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:O,relevance:0},{begin:v,returnBegin:!0,contains:[x],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,m]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,p,m,c,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,p,m,c]}]},c,n,e.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(q,Z,H,D,[g,{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:O,contains:["self",c]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function EP(e){const t={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=SP(e),i=n.keywords;return i.type=[...i.type,...t.type],i.literal=[...i.literal,...t.literal],i.built_in=[...i.built_in,...t.built_in],i._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function wP(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),l={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(c);const f={match:/\\"/},p={className:"string",begin:/'/,end:/'/},m={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},x=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],v=e.SHEBANG({binary:`(${x.join("|")})`,relevance:10}),S={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},A=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],T=["true","false"],C={match:/(\/[a-z._-]+)+/},N=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],R=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],O=["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"],H=["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:A,literal:T,built_in:[...N,...R,"set","shopt",...O,...H]},contains:[v,e.SHEBANG(),S,g,s,l,C,c,f,p,m,n]}}function TP(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",l="("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",c={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.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:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},m={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},g={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},e.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},v=t.optional(r)+e.IDENT_RE+"\\s*\\(",T={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"},C=[g,c,n,e.C_BLOCK_COMMENT_MODE,m,p],N={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:C.concat([{begin:/\(/,end:/\)/,keywords:T,contains:C.concat(["self"]),relevance:0}]),relevance:0},R={begin:"("+l+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:T,relevance:0},{begin:v,returnBegin:!0,contains:[e.inherit(x,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,p,m,c,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,p,m,c]}]},c,n,e.C_BLOCK_COMMENT_MODE,g]};return{name:"C",aliases:["h"],keywords:T,disableAutodetect:!0,illegal:"</",contains:[].concat(N,R,C,[g,{begin:e.IDENT_RE+"::",keywords:T},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:g,strings:p,keywords:T}}}function CP(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",l="(?!struct)("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",c={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.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:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},m={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},g={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},e.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},v=t.optional(r)+e.IDENT_RE+"\\s*\\(",S=["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"],A=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],T=["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"],C=["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"],O={type:A,keyword:S,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:T},H={className:"function.dispatch",relevance:0,keywords:{_hint:C},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},D=[H,g,c,n,e.C_BLOCK_COMMENT_MODE,m,p],q={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:D.concat([{begin:/\(/,end:/\)/,keywords:O,contains:D.concat(["self"]),relevance:0}]),relevance:0},Z={className:"function",begin:"("+l+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:O,relevance:0},{begin:v,returnBegin:!0,contains:[x],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,m]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,p,m,c,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,p,m,c]}]},c,n,e.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(q,Z,H,D,[g,{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:O,contains:["self",c]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function AP(e){const t=["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"],i=["default","false","null","true"],r=["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"],s=["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"],l={keyword:r.concat(s),built_in:t,literal:i},c=e.inherit(e.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},p={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},m={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},g=e.inherit(m,{illegal:/\n/}),x={className:"subst",begin:/\{/,end:/\}/,keywords:l},v=e.inherit(x,{illegal:/\n/}),S={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,v]},A={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},x]},T=e.inherit(A,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]});x.contains=[A,S,m,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,e.C_BLOCK_COMMENT_MODE],v.contains=[T,S,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const C={variants:[p,A,S,m,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},N={begin:"<",end:">",contains:[{beginKeywords:"in out"},c]},R=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",O={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:l,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},C,f,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},c,N,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[c,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[c,N,e.C_LINE_COMMENT_MODE,e.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:"("+R+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:l,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,N],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,relevance:0,contains:[C,f,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},O]}}const MP=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.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:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.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_-]*/}}),RP=["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"],kP=["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"],NP=[...RP,...kP],OP=["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(),DP=["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(),zP=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),BP=["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 LP(e){const t=e.regex,n=MP(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\w[\w]*(-\w+)*/,l="[a-zA-Z-][a-zA-Z0-9_-]*",c=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+l,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+DP.join("|")+")"},{begin:":(:)?("+zP.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+BP.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...c,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...c,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:OP.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...c,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+NP.join("|")+")\\b"}]}}function jP(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.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 IP(e){const s={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:s,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.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:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}function UP(e){const t=e.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:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.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:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function HP(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},i=e.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const r={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},c={begin:/\[/,end:/\]/,contains:[i,s,r,l,n,"self"],relevance:0},f=/[A-Za-z0-9_-]+/,p=/"(\\"|[^"])*"/,m=/'[^']*'/,g=t.either(f,p,m),x=t.concat(g,"(\\s*\\.\\s*",g,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:x,className:"attr",starts:{end:/$/,contains:[i,c,s,r,l,n]}}]}}var Vf="[0-9](_*[0-9])*",Zy=`\\.(${Vf})`,Jy="[0-9a-fA-F](_*[0-9a-fA-F])*",iT={className:"number",variants:[{begin:`(\\b(${Vf})((${Zy})|\\.)?|(${Zy}))[eE][+-]?(${Vf})[fFdD]?\\b`},{begin:`\\b(${Vf})((${Zy})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Zy})[fFdD]?\\b`},{begin:`\\b(${Vf})[fFdD]\\b`},{begin:`\\b0[xX]((${Jy})\\.?|(${Jy})?\\.(${Jy}))[pP][+-]?(${Vf})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Jy})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function VR(e,t,n){return n===-1?"":e.replace(t,i=>VR(e,t,n-1))}function PP(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+VR("(?:<"+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"]},p={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},m={className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:f,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.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:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[m,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:f,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,iT,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},iT,p]}}const rT="[A-Za-z$_][0-9A-Za-z$_]*",FP=["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"],GP=["true","false","null","undefined","NaN","Infinity"],XR=["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"],KR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],$R=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],qP=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],YP=[].concat($R,XR,KR);function VP(e){const t=e.regex,n=(G,{after:Q})=>{const I="</"+G[0].slice(1);return G.input.indexOf(I,Q)!==-1},i=rT,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,Q)=>{const I=G[0].length+G.index,$=G.input[I];if($==="<"||$===","){Q.ignoreMatch();return}$===">"&&(n(G,{after:I})||Q.ignoreMatch());let ne;const X=G.input.substring(I);if(ne=X.match(/^\s*=/)){Q.ignoreMatch();return}if((ne=X.match(/^\s+extends\s+/))&&ne.index===0){Q.ignoreMatch();return}}},c={$pattern:rT,keyword:FP,literal:GP,built_in:YP,"variable.language":qP},f="[0-9](_?[0-9])*",p=`\\.(${f})`,m="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${m})((${p})|\\.)?|(${p}))[eE][+-]?(${f})\\b`},{begin:`\\b(${m})\\b((${p})\\b|\\.)?|(${p})\\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},x={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"css"}},A={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"graphql"}},T={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,x]},N={className:"comment",variants:[e.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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},R=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,S,A,T,{match:/\$\d+/},g];x.contains=R.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(R)});const O=[].concat(N,x.contains),H=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(O)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:H},q={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},Z={relevance:0,match:t.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:{_:[...XR,...KR]}},V={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Y={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function j(G){return t.concat("(?!",G.join("|"),")")}const ee={match:t.concat(/\b/,j([...$R,"super","import"].map(G=>`${G}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},W={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",K={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:H,CLASS_REFERENCE:Z},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),V,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,S,A,T,N,{match:/\$\d+/},g,Z,{scope:"attr",match:i+t.lookahead(":"),relevance:0},K,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,e.REGEXP_MODE,{className:"function",begin:z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:H}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:l.begin,"on:begin":l.isTrulyOpeningTag,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}]},Y,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[D,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},ee,F,q,W,{match:/\$[(.]/}]}}function XP(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,n,e.QUOTE_STRING_MODE,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Xf="[0-9](_*[0-9])*",e0=`\\.(${Xf})`,t0="[0-9a-fA-F](_*[0-9a-fA-F])*",KP={className:"number",variants:[{begin:`(\\b(${Xf})((${e0})|\\.)?|(${e0}))[eE][+-]?(${Xf})[fFdD]?\\b`},{begin:`\\b(${Xf})((${e0})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${e0})[fFdD]?\\b`},{begin:`\\b(${Xf})[fFdD]\\b`},{begin:`\\b0[xX]((${t0})\\.?|(${t0})?\\.(${t0}))[pP][+-]?(${Xf})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${t0})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function $P(e){const t={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+/}]}},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},l={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,r]}]};r.contains.push(l);const c={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},f={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(l,{className:"string"}),"self"]}]},p=KP,m=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),g={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},x=g;return x.variants[1].contains=[g],g.variants[1].contains=[x],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,m,n,i,c,f,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[g,e.C_LINE_COMMENT_MODE,m],relevance:0},e.C_LINE_COMMENT_MODE,m,c,f,l,e.C_NUMBER_MODE]},m]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},c,f]},l,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
375
- `},p]}}const WP=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.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:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.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_-]*/}}),QP=["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"],ZP=["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"],JP=[...QP,...ZP],eF=["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(),WR=["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(),QR=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),tF=["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(),nF=WR.concat(QR).sort().reverse();function iF(e){const t=WP(e),n=nF,i="and or not only",r="[\\w-]+",s="("+r+"|@\\{"+r+"\\})",l=[],c=[],f=function(R){return{className:"string",begin:"~?"+R+".*?"+R}},p=function(R,O,H){return{className:R,begin:O,relevance:H}},m={$pattern:/[a-z-]+/,keyword:i,attribute:eF.join(" ")},g={begin:"\\(",end:"\\)",contains:c,keywords:m,relevance:0};c.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f("'"),f('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,g,p("variable","@@?"+r,10),p("variable","@\\{"+r+"\\}"),p("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const x=c.concat({begin:/\{/,end:/\}/,contains:l}),v={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(c)},S={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+tF.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:c}}]},A={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:m,returnEnd:!0,contains:c,relevance:0}},T={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:x}},C={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,v,p("keyword","all\\b"),p("variable","@\\{"+r+"\\}"),{begin:"\\b("+JP.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,p("selector-tag",s,0),p("selector-id","#"+s),p("selector-class","\\."+s,0),p("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+WR.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+QR.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:x},{begin:"!important"},t.FUNCTION_DISPATCH]},N={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[C]};return l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,A,T,N,S,C,v,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:l}}function rF(e){const t="\\[=*\\[",n="\\]=*\\]",i={begin:t,end:n,contains:["self"]},r=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[i],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.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:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[i],relevance:5}])}}function aF(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},i={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:[t,n]},r={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},s={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},l={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};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:[e.HASH_COMMENT_MODE,t,n,i,r,s,l]}}function sF(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={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}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},l={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},c=/[A-Za-z][A-Za-z0-9+.-]*/,f={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),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}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},m={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=e.inherit(p,{contains:[]}),x=e.inherit(m,{contains:[]});p.contains.push(x),m.contains.push(g);let v=[n,f];return[p,m,g,x].forEach(C=>{C.contains=C.contains.concat(v)}),v=v.concat(p,m),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:v},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:v}]}]},n,s,p,m,{className:"quote",begin:"^>\\s+",contains:v,end:"$"},r,i,f,l,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function lF(e){const t={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_]*/,c={"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:c,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.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},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+f.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:f,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function oF(e){const t=e.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"],i=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},l={begin:/->\{/,end:/\}/},c={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},f={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[c]},p={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},m=[e.BACKSLASH_ESCAPE,s,f],g=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],x=(A,T,C="\\1")=>{const N=C==="\\1"?C:t.concat(C,T);return t.concat(t.concat("(?:",A,")"),T,/(?:\\.|[^\\\/])*?/,N,/(?:\\.|[^\\\/])*?/,C,i)},v=(A,T,C)=>t.concat(t.concat("(?:",A,")"),T,/(?:\\.|[^\\\/])*?/,C,i),S=[f,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),l,{className:"string",contains:m,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:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},p,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:x("s|tr|y",t.either(...g,{capture:!0}))},{begin:x("s|tr|y","\\(","\\)")},{begin:x("s|tr|y","\\[","\\]")},{begin:x("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:v("(?:m|qr)?",/\//,/\//)},{begin:v("m|qr",t.either(...g,{capture:!0}),/\1/)},{begin:v("m|qr",/\(/,/\)/)},{begin:v("m|qr",/\[/,/\]/)},{begin:v("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,c]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,c,p]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=S,l.contains=S,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:S}}function cF(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=t.concat(/[A-Z]+/,n),l={scope:"variable",match:"\\$+"+i},c={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},f={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},p=e.inherit(e.APOS_STRING_MODE,{illegal:null}),m=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(f)}),g={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(f),"on:begin":(P,W)=>{W.data._beginMatch=P[1]||P[2]},"on:end":(P,W)=>{W.data._beginMatch!==P[1]&&W.ignoreMatch()}},x=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),v=`[
376
- ]`,S={scope:"string",variants:[m,p,g,x]},A={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},T=["false","null","true"],C=["__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"],N=["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"],O={keyword:C,literal:(P=>{const W=[];return P.forEach(z=>{W.push(z),z.toLowerCase()===z?W.push(z.toUpperCase()):W.push(z.toLowerCase())}),W})(T),built_in:N},H=P=>P.map(W=>W.replace(/\|\d+$/,"")),D={variants:[{match:[/new/,t.concat(v,"+"),t.concat("(?!",H(N).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},q=t.concat(i,"\\b(?!\\()"),Z={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),q],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),q],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},V={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},Y={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[V,l,Z,e.C_BLOCK_COMMENT_MODE,S,A,D]},F={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",H(C).join("\\b|"),"|",H(N).join("\\b|"),"\\b)"),i,t.concat(v,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[Y]};Y.contains.push(F);const j=[V,Z,e.C_BLOCK_COMMENT_MODE,S,A,D],ee={begin:t.concat(/#\[\s*\\?/,t.either(r,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:T,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:T,keyword:["new","array"]},contains:["self",...j]},...j,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:O,contains:[ee,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},c,{scope:"variable.language",match:/\$this\b/},l,F,Z,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},D,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:O,contains:["self",ee,l,Z,e.C_BLOCK_COMMENT_MODE,S,A]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},S,A]}}function uF(e){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},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function dF(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function fF(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["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"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,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:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},m={begin:/\{\{/,relevance:0},g={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,f,m,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,f,m,p]},{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:[e.BACKSLASH_ESCAPE,m,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,m,p]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},x="[0-9](_?[0-9])*",v=`(\\b(${x}))?\\.(${x})|\\b(${x})\\.`,S=`\\b|${i.join("|")}`,A={className:"number",relevance:0,variants:[{begin:`(\\b(${x})|(${v}))[eE][+-]?(${x})[jJ]?(?=${S})`},{begin:`(${v})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${S})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${S})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${S})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${S})`},{begin:`\\b(${x})[jJ](?=${S})`}]},T={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},C={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",f,A,g,e.HASH_COMMENT_MODE]}]};return p.contains=[g,A,f],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[f,A,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,T,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[C]},{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:[A,C,g]}]}}function hF(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function pF(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=t.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]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=t.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:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.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]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[s,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function mF(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(i,/(::\w+)*/),l={"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"]},c={className:"doctag",begin:"@[A-Za-z]+"},f={begin:"#<",end:">"},p=[e.COMMENT("#","$",{contains:[c]}),e.COMMENT("^=begin","^=end",{contains:[c],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],m={className:"subst",begin:/#\{/,end:/\}/,keywords:l},g={className:"string",contains:[e.BACKSLASH_ESCAPE,m],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:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,m]})]}]},x="[1-9](_?[0-9])*|0",v="[0-9](_?[0-9])*",S={className:"number",relevance:0,variants:[{begin:`\\b(${x})(\\.(${v}))?([eE][+-]?(${v})|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"}]},A={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:l}]},D=[g,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:l},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:l},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[A]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[g,{begin:n}],relevance:0},S,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:l},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,m],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,p),relevance:0}].concat(f,p);m.contains=D,A.contains=D;const Y=[{begin:/^\s*=>/,starts:{end:"$",contains:D}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:l,contains:D}}];return p.unshift(f),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:l,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(Y).concat(p).concat(D)}}function gF(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,t.lookahead(/\s*\(/))},l="([ui](8|16|32|64|128|size)|f(32|64))?",c=["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"],p=["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!"],m=["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:e.IDENT_RE+"!?",type:m,keyword:c,literal:f,built_in:p},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.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_]+)"+l},{begin:"\\b0o([0-7_]+)"+l},{begin:"\\b0x([A-Fa-f0-9_]+)"+l},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+l}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:m}},{className:"punctuation",begin:"->"},s]}}const yF=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.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:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.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_-]*/}}),xF=["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"],bF=["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"],vF=[...xF,...bF],_F=["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(),SF=["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(),EF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),wF=["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 TF(e){const t=yF(e),n=EF,i=SF,r="@[a-z-]+",s="and or not only",c={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+vF.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},c,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+wF.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:[t.BLOCK_COMMENT,c,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:_F.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},c,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function CF(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function AF(e){const t=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],l=["double precision","large object","with timezone","without timezone"],c=["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"],p=["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"],m=["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"],g=["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"],x=["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"],v=m,S=[...p,...f].filter(H=>!m.includes(H)),A={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},T={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},C={match:t.concat(/\b/,t.either(...v),/\s*\(/),relevance:0,keywords:{built_in:v}};function N(H){return t.concat(/\b/,t.either(...H.map(D=>D.replace(/\s+/,"\\s+"))),/\b/)}const R={scope:"keyword",match:N(x),relevance:0};function O(H,{exceptions:D,when:q}={}){const Z=q;return D=D||[],H.map(V=>V.match(/\|\d+$/)||D.includes(V)?V:Z(V)?`${V}|0`:V)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(S,{when:H=>H.length<3}),literal:s,type:c,built_in:g},contains:[{scope:"type",match:N(l)},R,C,A,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,T]}}function ZR(e){return e?typeof e=="string"?e:e.source:null}function cm(e){return An("(?=",e,")")}function An(...e){return e.map(n=>ZR(n)).join("")}function MF(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function da(...e){return"("+(MF(e).capture?"":"?:")+e.map(i=>ZR(i)).join("|")+")"}const j_=e=>An(/\b/,e,/\w$/.test(e)?/\b/:/\B/),RF=["Protocol","Type"].map(j_),aT=["init","self"].map(j_),kF=["Any","Self"],gv=["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"],sT=["false","nil","true"],NF=["assignment","associativity","higherThan","left","lowerThan","none","right"],OF=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],lT=["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"],JR=da(/[/=\-+!*%<>&|^~?]/,/[\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]/),ek=da(JR,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),yv=An(JR,ek,"*"),tk=da(/[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]/),I0=da(tk,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),uo=An(tk,I0,"*"),n0=An(/[A-Z]/,I0,"*"),DF=["attached","autoclosure",An(/convention\(/,da("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",An(/objc\(/,uo,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],zF=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function BF(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,da(...RF,...aT)],className:{2:"keyword"}},s={match:An(/\./,da(...gv)),relevance:0},l=gv.filter(Ue=>typeof Ue=="string").concat(["_|0"]),c=gv.filter(Ue=>typeof Ue!="string").concat(kF).map(j_),f={variants:[{className:"keyword",match:da(...c,...aT)}]},p={$pattern:da(/\b\w+/,/#\w+/),keyword:l.concat(OF),literal:sT},m=[r,s,f],g={match:An(/\./,da(...lT)),relevance:0},x={className:"built_in",match:An(/\b/,da(...lT),/(?=\()/)},v=[g,x],S={match:/->/,relevance:0},A={className:"operator",relevance:0,variants:[{match:yv},{match:`\\.(\\.|${ek})+`}]},T=[S,A],C="([0-9]_*)+",N="([0-9a-fA-F]_*)+",R={className:"number",relevance:0,variants:[{match:`\\b(${C})(\\.(${C}))?([eE][+-]?(${C}))?\\b`},{match:`\\b0x(${N})(\\.(${N}))?([pP][+-]?(${C}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},O=(Ue="")=>({className:"subst",variants:[{match:An(/\\/,Ue,/[0\\tnr"']/)},{match:An(/\\/,Ue,/u\{[0-9a-fA-F]{1,8}\}/)}]}),H=(Ue="")=>({className:"subst",match:An(/\\/,Ue,/[\t ]*(?:[\r\n]|\r\n)/)}),D=(Ue="")=>({className:"subst",label:"interpol",begin:An(/\\/,Ue,/\(/),end:/\)/}),q=(Ue="")=>({begin:An(Ue,/"""/),end:An(/"""/,Ue),contains:[O(Ue),H(Ue),D(Ue)]}),Z=(Ue="")=>({begin:An(Ue,/"/),end:An(/"/,Ue),contains:[O(Ue),D(Ue)]}),V={className:"string",variants:[q(),q("#"),q("##"),q("###"),Z(),Z("#"),Z("##"),Z("###")]},Y=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],F={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:Y},j=Ue=>{const wt=An(Ue,/\//),_n=An(/\//,Ue);return{begin:wt,end:_n,contains:[...Y,{scope:"comment",begin:`#(?!.*${_n})`,end:/$/}]}},ee={scope:"regexp",variants:[j("###"),j("##"),j("#"),F]},P={match:An(/`/,uo,/`/)},W={className:"variable",match:/\$\d+/},z={className:"variable",match:`\\$${I0}+`},K=[P,W,z],G={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:zF,contains:[...T,R,V]}]}},Q={scope:"keyword",match:An(/@/,da(...DF),cm(da(/\(/,/\s+/)))},I={scope:"meta",match:An(/@/,uo)},$=[G,Q,I],ne={match:cm(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:An(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,I0,"+")},{className:"type",match:n0,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:An(/\s+&\s+/,cm(n0)),relevance:0}]},X={begin:/</,end:/>/,keywords:p,contains:[...i,...m,...$,S,ne]};ne.contains.push(X);const ce={match:An(uo,/\s*:/),keywords:"_|0",relevance:0},ie={begin:/\(/,end:/\)/,relevance:0,keywords:p,contains:["self",ce,...i,ee,...m,...v,...T,R,V,...K,...$,ne]},de={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,ne]},xe={begin:da(cm(An(uo,/\s*:/)),cm(An(uo,/\s+/,uo,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:uo}]},me={begin:/\(/,end:/\)/,keywords:p,contains:[xe,...i,...m,...T,R,V,...$,ne,ie],endsParent:!0,illegal:/["']/},le={match:[/(func|macro)/,/\s+/,da(P.match,uo,yv)],className:{1:"keyword",3:"title.function"},contains:[de,me,t],illegal:[/\[/,/%/]},Re={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[de,me,t],illegal:/\[|%/},je={match:[/operator/,/\s+/,yv],className:{1:"keyword",3:"title"}},Ie={begin:[/precedencegroup/,/\s+/,n0],className:{1:"keyword",3:"title"},contains:[ne],keywords:[...NF,...sT],end:/}/},He={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Qe={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ot={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,uo,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:p,contains:[de,...m,{begin:/:/,end:/\{/,keywords:p,contains:[{scope:"title.class.inherited",match:n0},...m],relevance:0}]};for(const Ue of V.variants){const wt=Ue.contains.find(Sn=>Sn.label==="interpol");wt.keywords=p;const _n=[...m,...v,...T,R,V,...K];wt.contains=[..._n,{begin:/\(/,end:/\)/,contains:["self",..._n]}]}return{name:"Swift",keywords:p,contains:[...i,le,Re,He,Qe,ot,je,Ie,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},ee,...m,...v,...T,R,V,...K,...$,ne,ie]}}const U0="[A-Za-z$_][0-9A-Za-z$_]*",nk=["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"],ik=["true","false","null","undefined","NaN","Infinity"],rk=["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"],ak=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],sk=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],lk=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ok=[].concat(sk,rk,ak);function LF(e){const t=e.regex,n=(G,{after:Q})=>{const I="</"+G[0].slice(1);return G.input.indexOf(I,Q)!==-1},i=U0,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,Q)=>{const I=G[0].length+G.index,$=G.input[I];if($==="<"||$===","){Q.ignoreMatch();return}$===">"&&(n(G,{after:I})||Q.ignoreMatch());let ne;const X=G.input.substring(I);if(ne=X.match(/^\s*=/)){Q.ignoreMatch();return}if((ne=X.match(/^\s+extends\s+/))&&ne.index===0){Q.ignoreMatch();return}}},c={$pattern:U0,keyword:nk,literal:ik,built_in:ok,"variable.language":lk},f="[0-9](_?[0-9])*",p=`\\.(${f})`,m="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${m})((${p})|\\.)?|(${p}))[eE][+-]?(${f})\\b`},{begin:`\\b(${m})\\b((${p})\\b|\\.)?|(${p})\\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},x={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"css"}},A={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"graphql"}},T={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,x]},N={className:"comment",variants:[e.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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},R=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,S,A,T,{match:/\$\d+/},g];x.contains=R.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(R)});const O=[].concat(N,x.contains),H=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(O)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:H},q={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},Z={relevance:0,match:t.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:{_:[...rk,...ak]}},V={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Y={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function j(G){return t.concat("(?!",G.join("|"),")")}const ee={match:t.concat(/\b/,j([...sk,"super","import"].map(G=>`${G}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},W={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",K={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:H,CLASS_REFERENCE:Z},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),V,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,S,A,T,N,{match:/\$\d+/},g,Z,{scope:"attr",match:i+t.lookahead(":"),relevance:0},K,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,e.REGEXP_MODE,{className:"function",begin:z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:H}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:l.begin,"on:begin":l.isTrulyOpeningTag,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}]},Y,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[D,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},ee,F,q,W,{match:/\$[(.]/}]}}function jF(e){const t=e.regex,n=LF(e),i=U0,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},l={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},f=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],p={$pattern:U0,keyword:nk.concat(f),literal:ik,built_in:ok.concat(r),"variable.language":lk},m={className:"meta",begin:"@"+i},g=(A,T,C)=>{const N=A.contains.findIndex(R=>R.label===T);if(N===-1)throw new Error("can not find mode to replace");A.contains.splice(N,1,C)};Object.assign(n.keywords,p),n.exports.PARAMS_CONTAINS.push(m);const x=n.contains.find(A=>A.scope==="attr"),v=Object.assign({},x,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,x,v]),n.contains=n.contains.concat([m,s,l,v]),g(n,"shebang",e.SHEBANG()),g(n,"use_strict",c);const S=n.contains.find(A=>A.label==="func.def");return S.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function IF(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,l=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,c=/\d{1,2}(:\d{1,2}){1,2}/,f={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,r),/ *#/)},{begin:t.concat(/# */,c,/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,t.either(s,r),/ +/,t.either(l,c),/ *#/)}]},p={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])|[%&])?/}]},m={className:"label",begin:/^\w+:/},g=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),x=e.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,i,f,p,m,g,x,{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:[x]}]}}function UF(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),i=["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"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},l={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},c={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"},p={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:i},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,l,r,e.QUOTE_STRING_MODE,f,p,c]}}function HF(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},l=e.inherit(s,{begin:/\(/,end:/\)/}),c=e.inherit(e.APOS_STRING_MODE,{className:"string"}),f=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{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:[s,f,c,l,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,l,f,c]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{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:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:p}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function PF(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},l={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},c=e.inherit(l,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),x={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"},v={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},S={begin:/\{/,end:/\}/,contains:[v],illegal:"\\n",relevance:0},A={begin:"\\[",end:"\\]",contains:[v],illegal:"\\n",relevance:0},T=[i,{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:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},x,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},S,A,s,l],C=[...T];return C.pop(),C.push(c),v.contains=C,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:T}}const FF={arduino:EP,bash:wP,c:TP,cpp:CP,csharp:AP,css:LP,diff:jP,go:IP,graphql:UP,ini:HP,java:PP,javascript:VP,json:XP,kotlin:$P,less:iF,lua:rF,makefile:aF,markdown:sF,objectivec:lF,perl:oF,php:cF,"php-template":uF,plaintext:dF,python:fF,"python-repl":hF,r:pF,ruby:mF,rust:gF,scss:TF,shell:CF,sql:AF,swift:BF,typescript:jF,vbnet:IF,wasm:UF,xml:HF,yaml:PF};var xv,oT;function GF(){if(oT)return xv;oT=1;function e(se){return se instanceof Map?se.clear=se.delete=se.set=function(){throw new Error("map is read-only")}:se instanceof Set&&(se.add=se.clear=se.delete=function(){throw new Error("set is read-only")}),Object.freeze(se),Object.getOwnPropertyNames(se).forEach(Te=>{const Le=se[Te],tt=typeof Le;(tt==="object"||tt==="function")&&!Object.isFrozen(Le)&&e(Le)}),se}class t{constructor(Te){Te.data===void 0&&(Te.data={}),this.data=Te.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(se){return se.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function i(se,...Te){const Le=Object.create(null);for(const tt in se)Le[tt]=se[tt];return Te.forEach(function(tt){for(const nn in tt)Le[nn]=tt[nn]}),Le}const r="</span>",s=se=>!!se.scope,l=(se,{prefix:Te})=>{if(se.startsWith("language:"))return se.replace("language:","language-");if(se.includes(".")){const Le=se.split(".");return[`${Te}${Le.shift()}`,...Le.map((tt,nn)=>`${tt}${"_".repeat(nn+1)}`)].join(" ")}return`${Te}${se}`};class c{constructor(Te,Le){this.buffer="",this.classPrefix=Le.classPrefix,Te.walk(this)}addText(Te){this.buffer+=n(Te)}openNode(Te){if(!s(Te))return;const Le=l(Te.scope,{prefix:this.classPrefix});this.span(Le)}closeNode(Te){s(Te)&&(this.buffer+=r)}value(){return this.buffer}span(Te){this.buffer+=`<span class="${Te}">`}}const f=(se={})=>{const Te={children:[]};return Object.assign(Te,se),Te};class p{constructor(){this.rootNode=f(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Te){this.top.children.push(Te)}openNode(Te){const Le=f({scope:Te});this.add(Le),this.stack.push(Le)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Te){return this.constructor._walk(Te,this.rootNode)}static _walk(Te,Le){return typeof Le=="string"?Te.addText(Le):Le.children&&(Te.openNode(Le),Le.children.forEach(tt=>this._walk(Te,tt)),Te.closeNode(Le)),Te}static _collapse(Te){typeof Te!="string"&&Te.children&&(Te.children.every(Le=>typeof Le=="string")?Te.children=[Te.children.join("")]:Te.children.forEach(Le=>{p._collapse(Le)}))}}class m extends p{constructor(Te){super(),this.options=Te}addText(Te){Te!==""&&this.add(Te)}startScope(Te){this.openNode(Te)}endScope(){this.closeNode()}__addSublanguage(Te,Le){const tt=Te.root;Le&&(tt.scope=`language:${Le}`),this.add(tt)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(se){return se?typeof se=="string"?se:se.source:null}function x(se){return A("(?=",se,")")}function v(se){return A("(?:",se,")*")}function S(se){return A("(?:",se,")?")}function A(...se){return se.map(Le=>g(Le)).join("")}function T(se){const Te=se[se.length-1];return typeof Te=="object"&&Te.constructor===Object?(se.splice(se.length-1,1),Te):{}}function C(...se){return"("+(T(se).capture?"":"?:")+se.map(tt=>g(tt)).join("|")+")"}function N(se){return new RegExp(se.toString()+"|").exec("").length-1}function R(se,Te){const Le=se&&se.exec(Te);return Le&&Le.index===0}const O=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function H(se,{joinWith:Te}){let Le=0;return se.map(tt=>{Le+=1;const nn=Le;let rn=g(tt),Ye="";for(;rn.length>0;){const Ge=O.exec(rn);if(!Ge){Ye+=rn;break}Ye+=rn.substring(0,Ge.index),rn=rn.substring(Ge.index+Ge[0].length),Ge[0][0]==="\\"&&Ge[1]?Ye+="\\"+String(Number(Ge[1])+nn):(Ye+=Ge[0],Ge[0]==="("&&Le++)}return Ye}).map(tt=>`(${tt})`).join(Te)}const D=/\b\B/,q="[a-zA-Z]\\w*",Z="[a-zA-Z_]\\w*",V="\\b\\d+(\\.\\d+)?",Y="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",j="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ee=(se={})=>{const Te=/^#![ ]*\//;return se.binary&&(se.begin=A(Te,/.*\b/,se.binary,/\b.*/)),i({scope:"meta",begin:Te,end:/$/,relevance:0,"on:begin":(Le,tt)=>{Le.index!==0&&tt.ignoreMatch()}},se)},P={begin:"\\\\[\\s\\S]",relevance:0},W={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[P]},z={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[P]},K={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/},G=function(se,Te,Le={}){const tt=i({scope:"comment",begin:se,end:Te,contains:[]},Le);tt.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 nn=C("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 tt.contains.push({begin:A(/[ ]+/,"(",nn,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),tt},Q=G("//","$"),I=G("/\\*","\\*/"),$=G("#","$"),ne={scope:"number",begin:V,relevance:0},X={scope:"number",begin:Y,relevance:0},ce={scope:"number",begin:F,relevance:0},ie={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[P,{begin:/\[/,end:/\]/,relevance:0,contains:[P]}]},de={scope:"title",begin:q,relevance:0},xe={scope:"title",begin:Z,relevance:0},me={begin:"\\.\\s*"+Z,relevance:0};var Re=Object.freeze({__proto__:null,APOS_STRING_MODE:W,BACKSLASH_ESCAPE:P,BINARY_NUMBER_MODE:ce,BINARY_NUMBER_RE:F,COMMENT:G,C_BLOCK_COMMENT_MODE:I,C_LINE_COMMENT_MODE:Q,C_NUMBER_MODE:X,C_NUMBER_RE:Y,END_SAME_AS_BEGIN:function(se){return Object.assign(se,{"on:begin":(Te,Le)=>{Le.data._beginMatch=Te[1]},"on:end":(Te,Le)=>{Le.data._beginMatch!==Te[1]&&Le.ignoreMatch()}})},HASH_COMMENT_MODE:$,IDENT_RE:q,MATCH_NOTHING_RE:D,METHOD_GUARD:me,NUMBER_MODE:ne,NUMBER_RE:V,PHRASAL_WORDS_MODE:K,QUOTE_STRING_MODE:z,REGEXP_MODE:ie,RE_STARTERS_RE:j,SHEBANG:ee,TITLE_MODE:de,UNDERSCORE_IDENT_RE:Z,UNDERSCORE_TITLE_MODE:xe});function je(se,Te){se.input[se.index-1]==="."&&Te.ignoreMatch()}function Ie(se,Te){se.className!==void 0&&(se.scope=se.className,delete se.className)}function He(se,Te){Te&&se.beginKeywords&&(se.begin="\\b("+se.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",se.__beforeBegin=je,se.keywords=se.keywords||se.beginKeywords,delete se.beginKeywords,se.relevance===void 0&&(se.relevance=0))}function Qe(se,Te){Array.isArray(se.illegal)&&(se.illegal=C(...se.illegal))}function ot(se,Te){if(se.match){if(se.begin||se.end)throw new Error("begin & end are not supported with match");se.begin=se.match,delete se.match}}function Ue(se,Te){se.relevance===void 0&&(se.relevance=1)}const wt=(se,Te)=>{if(!se.beforeMatch)return;if(se.starts)throw new Error("beforeMatch cannot be used with starts");const Le=Object.assign({},se);Object.keys(se).forEach(tt=>{delete se[tt]}),se.keywords=Le.keywords,se.begin=A(Le.beforeMatch,x(Le.begin)),se.starts={relevance:0,contains:[Object.assign(Le,{endsParent:!0})]},se.relevance=0,delete Le.beforeMatch},_n=["of","and","for","in","not","or","if","then","parent","list","value"],Sn="keyword";function hn(se,Te,Le=Sn){const tt=Object.create(null);return typeof se=="string"?nn(Le,se.split(" ")):Array.isArray(se)?nn(Le,se):Object.keys(se).forEach(function(rn){Object.assign(tt,hn(se[rn],Te,rn))}),tt;function nn(rn,Ye){Te&&(Ye=Ye.map(Ge=>Ge.toLowerCase())),Ye.forEach(function(Ge){const nt=Ge.split("|");tt[nt[0]]=[rn,oi(nt[0],nt[1])]})}}function oi(se,Te){return Te?Number(Te):Ur(se)?0:1}function Ur(se){return _n.includes(se.toLowerCase())}const Ci={},Wt=se=>{console.error(se)},sr=(se,...Te)=>{console.log(`WARN: ${se}`,...Te)},Ee=(se,Te)=>{Ci[`${se}/${Te}`]||(console.log(`Deprecated as of ${se}. ${Te}`),Ci[`${se}/${Te}`]=!0)},ke=new Error;function oe(se,Te,{key:Le}){let tt=0;const nn=se[Le],rn={},Ye={};for(let Ge=1;Ge<=Te.length;Ge++)Ye[Ge+tt]=nn[Ge],rn[Ge+tt]=!0,tt+=N(Te[Ge-1]);se[Le]=Ye,se[Le]._emit=rn,se[Le]._multi=!0}function Pe(se){if(Array.isArray(se.begin)){if(se.skip||se.excludeBegin||se.returnBegin)throw Wt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ke;if(typeof se.beginScope!="object"||se.beginScope===null)throw Wt("beginScope must be object"),ke;oe(se,se.begin,{key:"beginScope"}),se.begin=H(se.begin,{joinWith:""})}}function ct(se){if(Array.isArray(se.end)){if(se.skip||se.excludeEnd||se.returnEnd)throw Wt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ke;if(typeof se.endScope!="object"||se.endScope===null)throw Wt("endScope must be object"),ke;oe(se,se.end,{key:"endScope"}),se.end=H(se.end,{joinWith:""})}}function tn(se){se.scope&&typeof se.scope=="object"&&se.scope!==null&&(se.beginScope=se.scope,delete se.scope)}function ci(se){tn(se),typeof se.beginScope=="string"&&(se.beginScope={_wrap:se.beginScope}),typeof se.endScope=="string"&&(se.endScope={_wrap:se.endScope}),Pe(se),ct(se)}function Qt(se){function Te(Ye,Ge){return new RegExp(g(Ye),"m"+(se.case_insensitive?"i":"")+(se.unicodeRegex?"u":"")+(Ge?"g":""))}class Le{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ge,nt){nt.position=this.position++,this.matchIndexes[this.matchAt]=nt,this.regexes.push([nt,Ge]),this.matchAt+=N(Ge)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ge=this.regexes.map(nt=>nt[1]);this.matcherRe=Te(H(Ge,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ge){this.matcherRe.lastIndex=this.lastIndex;const nt=this.matcherRe.exec(Ge);if(!nt)return null;const Rn=nt.findIndex((ga,lr)=>lr>0&&ga!==void 0),Ft=this.matchIndexes[Rn];return nt.splice(0,Rn),Object.assign(nt,Ft)}}class tt{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ge){if(this.multiRegexes[Ge])return this.multiRegexes[Ge];const nt=new Le;return this.rules.slice(Ge).forEach(([Rn,Ft])=>nt.addRule(Rn,Ft)),nt.compile(),this.multiRegexes[Ge]=nt,nt}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ge,nt){this.rules.push([Ge,nt]),nt.type==="begin"&&this.count++}exec(Ge){const nt=this.getMatcher(this.regexIndex);nt.lastIndex=this.lastIndex;let Rn=nt.exec(Ge);if(this.resumingScanAtSamePosition()&&!(Rn&&Rn.index===this.lastIndex)){const Ft=this.getMatcher(0);Ft.lastIndex=this.lastIndex+1,Rn=Ft.exec(Ge)}return Rn&&(this.regexIndex+=Rn.position+1,this.regexIndex===this.count&&this.considerAll()),Rn}}function nn(Ye){const Ge=new tt;return Ye.contains.forEach(nt=>Ge.addRule(nt.begin,{rule:nt,type:"begin"})),Ye.terminatorEnd&&Ge.addRule(Ye.terminatorEnd,{type:"end"}),Ye.illegal&&Ge.addRule(Ye.illegal,{type:"illegal"}),Ge}function rn(Ye,Ge){const nt=Ye;if(Ye.isCompiled)return nt;[Ie,ot,ci,wt].forEach(Ft=>Ft(Ye,Ge)),se.compilerExtensions.forEach(Ft=>Ft(Ye,Ge)),Ye.__beforeBegin=null,[He,Qe,Ue].forEach(Ft=>Ft(Ye,Ge)),Ye.isCompiled=!0;let Rn=null;return typeof Ye.keywords=="object"&&Ye.keywords.$pattern&&(Ye.keywords=Object.assign({},Ye.keywords),Rn=Ye.keywords.$pattern,delete Ye.keywords.$pattern),Rn=Rn||/\w+/,Ye.keywords&&(Ye.keywords=hn(Ye.keywords,se.case_insensitive)),nt.keywordPatternRe=Te(Rn,!0),Ge&&(Ye.begin||(Ye.begin=/\B|\b/),nt.beginRe=Te(nt.begin),!Ye.end&&!Ye.endsWithParent&&(Ye.end=/\B|\b/),Ye.end&&(nt.endRe=Te(nt.end)),nt.terminatorEnd=g(nt.end)||"",Ye.endsWithParent&&Ge.terminatorEnd&&(nt.terminatorEnd+=(Ye.end?"|":"")+Ge.terminatorEnd)),Ye.illegal&&(nt.illegalRe=Te(Ye.illegal)),Ye.contains||(Ye.contains=[]),Ye.contains=[].concat(...Ye.contains.map(function(Ft){return Gn(Ft==="self"?Ye:Ft)})),Ye.contains.forEach(function(Ft){rn(Ft,nt)}),Ye.starts&&rn(Ye.starts,Ge),nt.matcher=nn(nt),nt}if(se.compilerExtensions||(se.compilerExtensions=[]),se.contains&&se.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return se.classNameAliases=i(se.classNameAliases||{}),rn(se)}function Zt(se){return se?se.endsWithParent||Zt(se.starts):!1}function Gn(se){return se.variants&&!se.cachedVariants&&(se.cachedVariants=se.variants.map(function(Te){return i(se,{variants:null},Te)})),se.cachedVariants?se.cachedVariants:Zt(se)?i(se,{starts:se.starts?i(se.starts):null}):Object.isFrozen(se)?i(se):se}var Pt="11.11.1";class Yi extends Error{constructor(Te,Le){super(Te),this.name="HTMLInjectionError",this.html=Le}}const Jn=n,vo=i,ls=Symbol("nomatch"),Ba=7,os=function(se){const Te=Object.create(null),Le=Object.create(null),tt=[];let nn=!0;const rn="Could not find the language '{}', did you forget to load/include a language module?",Ye={disableAutodetect:!0,name:"Plain text",contains:[]};let Ge={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:m};function nt(Ne){return Ge.noHighlightRe.test(Ne)}function Rn(Ne){let Ke=Ne.className+" ";Ke+=Ne.parentNode?Ne.parentNode.className:"";const vt=Ge.languageDetectRe.exec(Ke);if(vt){const Xt=an(vt[1]);return Xt||(sr(rn.replace("{}",vt[1])),sr("Falling back to no-highlight mode for this block.",Ne)),Xt?vt[1]:"no-highlight"}return Ke.split(/\s+/).find(Xt=>nt(Xt)||an(Xt))}function Ft(Ne,Ke,vt){let Xt="",In="";typeof Ke=="object"?(Xt=Ne,vt=Ke.ignoreIllegals,In=Ke.language):(Ee("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ee("10.7.0",`Please use highlight(code, options) instead.
377
- https://github.com/highlightjs/highlight.js/issues/2277`),In=Ne,Xt=Ke),vt===void 0&&(vt=!0);const _i={code:Xt,language:In};ya("before:highlight",_i);const Xi=_i.result?_i.result:ga(_i.language,_i.code,vt);return Xi.code=_i.code,ya("after:highlight",Xi),Xi}function ga(Ne,Ke,vt,Xt){const In=Object.create(null);function _i(Be,Ve){return Be.keywords[Ve]}function Xi(){if(!rt.keywords){Hn.addText(ln);return}let Be=0;rt.keywordPatternRe.lastIndex=0;let Ve=rt.keywordPatternRe.exec(ln),yt="";for(;Ve;){yt+=ln.substring(Be,Ve.index);const Nt=di.case_insensitive?Ve[0].toLowerCase():Ve[0],kn=_i(rt,Nt);if(kn){const[Gr,pc]=kn;if(Hn.addText(yt),yt="",In[Nt]=(In[Nt]||0)+1,In[Nt]<=Ba&&(ds+=pc),Gr.startsWith("_"))yt+=Ve[0];else{const mu=di.classNameAliases[Gr]||Gr;ur(Ve[0],mu)}}else yt+=Ve[0];Be=rt.keywordPatternRe.lastIndex,Ve=rt.keywordPatternRe.exec(ln)}yt+=ln.substring(Be),Hn.addText(yt)}function Ai(){if(ln==="")return;let Be=null;if(typeof rt.subLanguage=="string"){if(!Te[rt.subLanguage]){Hn.addText(ln);return}Be=ga(rt.subLanguage,ln,!0,So[rt.subLanguage]),So[rt.subLanguage]=Be._top}else Be=Vi(ln,rt.subLanguage.length?rt.subLanguage:null);rt.relevance>0&&(ds+=Be.relevance),Hn.__addSublanguage(Be._emitter,Be.language)}function pn(){rt.subLanguage!=null?Ai():Xi(),ln=""}function ur(Be,Ve){Be!==""&&(Hn.startScope(Ve),Hn.addText(Be),Hn.endScope())}function _o(Be,Ve){let yt=1;const Nt=Ve.length-1;for(;yt<=Nt;){if(!Be._emit[yt]){yt++;continue}const kn=di.classNameAliases[Be[yt]]||Be[yt],Gr=Ve[yt];kn?ur(Gr,kn):(ln=Gr,Xi(),ln=""),yt++}}function xa(Be,Ve){return Be.scope&&typeof Be.scope=="string"&&Hn.openNode(di.classNameAliases[Be.scope]||Be.scope),Be.beginScope&&(Be.beginScope._wrap?(ur(ln,di.classNameAliases[Be.beginScope._wrap]||Be.beginScope._wrap),ln=""):Be.beginScope._multi&&(_o(Be.beginScope,Ve),ln="")),rt=Object.create(Be,{parent:{value:rt}}),rt}function Rl(Be,Ve,yt){let Nt=R(Be.endRe,yt);if(Nt){if(Be["on:end"]){const kn=new t(Be);Be["on:end"](Ve,kn),kn.isMatchIgnored&&(Nt=!1)}if(Nt){for(;Be.endsParent&&Be.parent;)Be=Be.parent;return Be}}if(Be.endsWithParent)return Rl(Be.parent,Ve,yt)}function ja(Be){return rt.matcher.regexIndex===0?(ln+=Be[0],1):(Fs=!0,0)}function fc(Be){const Ve=Be[0],yt=Be.rule,Nt=new t(yt),kn=[yt.__beforeBegin,yt["on:begin"]];for(const Gr of kn)if(Gr&&(Gr(Be,Nt),Nt.isMatchIgnored))return ja(Ve);return yt.skip?ln+=Ve:(yt.excludeBegin&&(ln+=Ve),pn(),!yt.returnBegin&&!yt.excludeBegin&&(ln=Ve)),xa(yt,Be),yt.returnBegin?0:Ve.length}function Bi(Be){const Ve=Be[0],yt=Ke.substring(Be.index),Nt=Rl(rt,Be,yt);if(!Nt)return ls;const kn=rt;rt.endScope&&rt.endScope._wrap?(pn(),ur(Ve,rt.endScope._wrap)):rt.endScope&&rt.endScope._multi?(pn(),_o(rt.endScope,Be)):kn.skip?ln+=Ve:(kn.returnEnd||kn.excludeEnd||(ln+=Ve),pn(),kn.excludeEnd&&(ln=Ve));do rt.scope&&Hn.closeNode(),!rt.skip&&!rt.subLanguage&&(ds+=rt.relevance),rt=rt.parent;while(rt!==Nt.parent);return Nt.starts&&xa(Nt.starts,Be),kn.returnEnd?0:Ve.length}function cs(){const Be=[];for(let Ve=rt;Ve!==di;Ve=Ve.parent)Ve.scope&&Be.unshift(Ve.scope);Be.forEach(Ve=>Hn.openNode(Ve))}let us={};function Ps(Be,Ve){const yt=Ve&&Ve[0];if(ln+=Be,yt==null)return pn(),0;if(us.type==="begin"&&Ve.type==="end"&&us.index===Ve.index&&yt===""){if(ln+=Ke.slice(Ve.index,Ve.index+1),!nn){const Nt=new Error(`0 width match regex (${Ne})`);throw Nt.languageName=Ne,Nt.badRule=us.rule,Nt}return 1}if(us=Ve,Ve.type==="begin")return fc(Ve);if(Ve.type==="illegal"&&!vt){const Nt=new Error('Illegal lexeme "'+yt+'" for mode "'+(rt.scope||"<unnamed>")+'"');throw Nt.mode=rt,Nt}else if(Ve.type==="end"){const Nt=Bi(Ve);if(Nt!==ls)return Nt}if(Ve.type==="illegal"&&yt==="")return ln+=`
378
- `,1;if(hc>1e5&&hc>Ve.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ln+=yt,yt.length}const di=an(Ne);if(!di)throw Wt(rn.replace("{}",Ne)),new Error('Unknown language: "'+Ne+'"');const pu=Qt(di);let Ia="",rt=Xt||pu;const So={},Hn=new Ge.__emitter(Ge);cs();let ln="",ds=0,fs=0,hc=0,Fs=!1;try{if(di.__emitTokens)di.__emitTokens(Ke,Hn);else{for(rt.matcher.considerAll();;){hc++,Fs?Fs=!1:rt.matcher.considerAll(),rt.matcher.lastIndex=fs;const Be=rt.matcher.exec(Ke);if(!Be)break;const Ve=Ke.substring(fs,Be.index),yt=Ps(Ve,Be);fs=Be.index+yt}Ps(Ke.substring(fs))}return Hn.finalize(),Ia=Hn.toHTML(),{language:Ne,value:Ia,relevance:ds,illegal:!1,_emitter:Hn,_top:rt}}catch(Be){if(Be.message&&Be.message.includes("Illegal"))return{language:Ne,value:Jn(Ke),illegal:!0,relevance:0,_illegalBy:{message:Be.message,index:fs,context:Ke.slice(fs-100,fs+100),mode:Be.mode,resultSoFar:Ia},_emitter:Hn};if(nn)return{language:Ne,value:Jn(Ke),illegal:!1,relevance:0,errorRaised:Be,_emitter:Hn,_top:rt};throw Be}}function lr(Ne){const Ke={value:Jn(Ne),illegal:!1,relevance:0,_top:Ye,_emitter:new Ge.__emitter(Ge)};return Ke._emitter.addText(Ne),Ke}function Vi(Ne,Ke){Ke=Ke||Ge.languages||Object.keys(Te);const vt=lr(Ne),Xt=Ke.filter(an).filter(cr).map(pn=>ga(pn,Ne,!1));Xt.unshift(vt);const In=Xt.sort((pn,ur)=>{if(pn.relevance!==ur.relevance)return ur.relevance-pn.relevance;if(pn.language&&ur.language){if(an(pn.language).supersetOf===ur.language)return 1;if(an(ur.language).supersetOf===pn.language)return-1}return 0}),[_i,Xi]=In,Ai=_i;return Ai.secondBest=Xi,Ai}function or(Ne,Ke,vt){const Xt=Ke&&Le[Ke]||vt;Ne.classList.add("hljs"),Ne.classList.add(`language-${Xt}`)}function bt(Ne){let Ke=null;const vt=Rn(Ne);if(nt(vt))return;if(ya("before:highlightElement",{el:Ne,language:vt}),Ne.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Ne);return}if(Ne.children.length>0&&(Ge.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(Ne)),Ge.throwUnescapedHTML))throw new Yi("One of your code blocks includes unescaped HTML.",Ne.innerHTML);Ke=Ne;const Xt=Ke.textContent,In=vt?Ft(Xt,{language:vt,ignoreIllegals:!0}):Vi(Xt);Ne.innerHTML=In.value,Ne.dataset.highlighted="yes",or(Ne,vt,In.language),Ne.result={language:In.language,re:In.relevance,relevance:In.relevance},In.secondBest&&(Ne.secondBest={language:In.secondBest.language,relevance:In.secondBest.relevance}),ya("after:highlightElement",{el:Ne,result:In,text:Xt})}function ui(Ne){Ge=vo(Ge,Ne)}const Hr=()=>{Al(),Ee("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Us(){Al(),Ee("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Cl=!1;function Al(){function Ne(){Al()}if(document.readyState==="loading"){Cl||window.addEventListener("DOMContentLoaded",Ne,!1),Cl=!0;return}document.querySelectorAll(Ge.cssSelector).forEach(bt)}function Ml(Ne,Ke){let vt=null;try{vt=Ke(se)}catch(Xt){if(Wt("Language definition for '{}' could not be registered.".replace("{}",Ne)),nn)Wt(Xt);else throw Xt;vt=Ye}vt.name||(vt.name=Ne),Te[Ne]=vt,vt.rawDefinition=Ke.bind(null,se),vt.aliases&&sn(vt.aliases,{languageName:Ne})}function La(Ne){delete Te[Ne];for(const Ke of Object.keys(Le))Le[Ke]===Ne&&delete Le[Ke]}function Hs(){return Object.keys(Te)}function an(Ne){return Ne=(Ne||"").toLowerCase(),Te[Ne]||Te[Le[Ne]]}function sn(Ne,{languageName:Ke}){typeof Ne=="string"&&(Ne=[Ne]),Ne.forEach(vt=>{Le[vt.toLowerCase()]=Ke})}function cr(Ne){const Ke=an(Ne);return Ke&&!Ke.disableAutodetect}function Pr(Ne){Ne["before:highlightBlock"]&&!Ne["before:highlightElement"]&&(Ne["before:highlightElement"]=Ke=>{Ne["before:highlightBlock"](Object.assign({block:Ke.el},Ke))}),Ne["after:highlightBlock"]&&!Ne["after:highlightElement"]&&(Ne["after:highlightElement"]=Ke=>{Ne["after:highlightBlock"](Object.assign({block:Ke.el},Ke))})}function jn(Ne){Pr(Ne),tt.push(Ne)}function Sr(Ne){const Ke=tt.indexOf(Ne);Ke!==-1&&tt.splice(Ke,1)}function ya(Ne,Ke){const vt=Ne;tt.forEach(function(Xt){Xt[vt]&&Xt[vt](Ke)})}function Fr(Ne){return Ee("10.7.0","highlightBlock will be removed entirely in v12.0"),Ee("10.7.0","Please use highlightElement now."),bt(Ne)}Object.assign(se,{highlight:Ft,highlightAuto:Vi,highlightAll:Al,highlightElement:bt,highlightBlock:Fr,configure:ui,initHighlighting:Hr,initHighlightingOnLoad:Us,registerLanguage:Ml,unregisterLanguage:La,listLanguages:Hs,getLanguage:an,registerAliases:sn,autoDetection:cr,inherit:vo,addPlugin:jn,removePlugin:Sr}),se.debugMode=function(){nn=!1},se.safeMode=function(){nn=!0},se.versionString=Pt,se.regex={concat:A,lookahead:x,either:C,optional:S,anyNumberOfTimes:v};for(const Ne in Re)typeof Re[Ne]=="object"&&e(Re[Ne]);return Object.assign(se,Re),se},vi=os({});return vi.newInstance=()=>os({}),xv=vi,vi.HighlightJS=vi,vi.default=vi,xv}var qF=GF();const YF=du(qF),cT={},VF="hljs-";function XF(e){const t=YF.newInstance();return e&&s(e),{highlight:n,highlightAuto:i,listLanguages:r,register:s,registerAlias:l,registered:c};function n(f,p,m){const g=m||cT,x=typeof g.prefix=="string"?g.prefix:VF;if(!t.getLanguage(f))throw new Error("Unknown language: `"+f+"` is not registered");t.configure({__emitter:KF,classPrefix:x});const v=t.highlight(p,{ignoreIllegals:!0,language:f});if(v.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:v.errorRaised});const S=v._emitter.root,A=S.data;return A.language=v.language,A.relevance=v.relevance,S}function i(f,p){const g=(p||cT).subset||r();let x=-1,v=0,S;for(;++x<g.length;){const A=g[x];if(!t.getLanguage(A))continue;const T=n(A,f,p);T.data&&T.data.relevance!==void 0&&T.data.relevance>v&&(v=T.data.relevance,S=T)}return S||{type:"root",children:[],data:{language:void 0,relevance:v}}}function r(){return t.listLanguages()}function s(f,p){if(typeof f=="string")t.registerLanguage(f,p);else{let m;for(m in f)Object.hasOwn(f,m)&&t.registerLanguage(m,f[m])}}function l(f,p){if(typeof f=="string")t.registerAliases(typeof p=="string"?p:[...p],{languageName:f});else{let m;for(m in f)if(Object.hasOwn(f,m)){const g=f[m];t.registerAliases(typeof g=="string"?g:[...g],{languageName:m})}}}function c(f){return!!t.getLanguage(f)}}class KF{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],i=n.children[n.children.length-1];i&&i.type==="text"?i.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const i=this.stack[this.stack.length-1],r=t.root.children;n?i.children.push({type:"element",tagName:"span",properties:{className:[n]},children:r}):i.children.push(...r)}openNode(t){const n=this,i=t.split(".").map(function(l,c){return c?l+"_".repeat(c):n.options.classPrefix+l}),r=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:i},children:[]};r.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const $F={};function WF(e){const t=e||$F,n=t.aliases,i=t.detect||!1,r=t.languages||FF,s=t.plainText,l=t.prefix,c=t.subset;let f="hljs";const p=XF(r);if(n&&p.registerAlias(n),l){const m=l.indexOf("-");f=m===-1?l:l.slice(0,m)}return function(m,g){dx(m,"element",function(x,v,S){if(x.tagName!=="code"||!S||S.type!=="element"||S.tagName!=="pre")return;const A=QF(x);if(A===!1||!A&&!i||A&&s&&s.includes(A))return;Array.isArray(x.properties.className)||(x.properties.className=[]),x.properties.className.includes(f)||x.properties.className.unshift(f);const T=mP(x,{whitespace:"pre"});let C;try{C=A?p.highlight(A,T,{prefix:l}):p.highlightAuto(T,{prefix:l,subset:c})}catch(N){const R=N;if(A&&/Unknown language/.test(R.message)){g.message("Cannot highlight as `"+A+"`, it’s not registered",{ancestors:[S,x],cause:R,place:x.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw R}!A&&C.data&&C.data.language&&x.properties.className.push("language-"+C.data.language),C.children.length>0&&(x.children=C.children)})}}function QF(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let i;for(;++n<t.length;){const r=String(t[n]);if(r==="no-highlight"||r==="nohighlight")return!1;!i&&r.slice(0,5)==="lang-"&&(i=r.slice(5)),!i&&r.slice(0,9)==="language-"&&(i=r.slice(9))}return i}function ZF({text:e}){const[t,n]=L.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})};return _.jsx("button",{onClick:i,style:{position:"absolute",top:6,right:6,background:"var(--surface-4)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",color:t?"var(--status-active)":"var(--text-muted)",fontSize:"0.65rem",fontFamily:"var(--font-mono)",padding:"2px 8px",cursor:"pointer",transition:"color var(--duration-fast) var(--ease-out)"},children:t?"Copied!":"Copy"})}function M1({content:e}){return _.jsx("div",{className:"markdown-message",children:_.jsx($H,{remarkPlugins:[oP],rehypePlugins:[WF],components:{pre({children:t,...n}){const i=Array.isArray(t)?t.find(s=>{var l,c;return(s==null?void 0:s.type)==="code"||((c=(l=s==null?void 0:s.props)==null?void 0:l.node)==null?void 0:c.tagName)==="code"}):t,r=typeof i=="object"&&i!==null&&"props"in i?R1(i.props.children):"";return _.jsxs("div",{style:{position:"relative"},children:[_.jsx(ZF,{text:r}),_.jsx("pre",{...n,style:{background:"var(--surface-0)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",padding:"12px 14px",paddingTop:28,margin:"8px 0",overflowX:"auto",fontSize:"0.78rem",lineHeight:1.6,fontFamily:"var(--font-mono)"},children:t})]})},code({className:t,children:n,...i}){return t?_.jsx("code",{className:t,...i,children:n}):_.jsx("code",{...i,style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",padding:"1px 5px",fontSize:"0.82em",fontFamily:"var(--font-mono)",color:"var(--accent)"},children:n})},a({href:t,children:n,...i}){return _.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent)",textDecoration:"none"},...i,children:n})},table({children:t,...n}){return _.jsx("div",{style:{overflowX:"auto",margin:"8px 0"},children:_.jsx("table",{...n,style:{borderCollapse:"collapse",width:"100%",fontSize:"0.82rem"},children:t})})},th({children:t,...n}){return _.jsx("th",{...n,style:{borderBottom:"2px solid var(--border-default)",padding:"6px 10px",textAlign:"left",fontWeight:600,color:"var(--text-primary)"},children:t})},td({children:t,...n}){return _.jsx("td",{...n,style:{borderBottom:"1px solid var(--border-subtle)",padding:"5px 10px",color:"var(--text-secondary)"},children:t})},blockquote({children:t,...n}){return _.jsx("blockquote",{...n,style:{borderLeft:"3px solid var(--accent-dim)",margin:"8px 0",padding:"4px 12px",color:"var(--text-secondary)",background:"rgba(0, 200, 255, 0.04)",borderRadius:"0 var(--radius-xs) var(--radius-xs) 0"},children:t})},hr(){return _.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--border-default)",margin:"12px 0"}})},ul({children:t,...n}){return _.jsx("ul",{...n,style:{paddingLeft:20,margin:"4px 0"},children:t})},ol({children:t,...n}){return _.jsx("ol",{...n,style:{paddingLeft:20,margin:"4px 0"},children:t})},li({children:t,...n}){return _.jsx("li",{...n,style:{marginBottom:2},children:t})},h1({children:t,...n}){return _.jsx("h1",{...n,style:{fontSize:"1.3em",fontWeight:700,margin:"12px 0 6px"},children:t})},h2({children:t,...n}){return _.jsx("h2",{...n,style:{fontSize:"1.15em",fontWeight:600,margin:"10px 0 4px"},children:t})},h3({children:t,...n}){return _.jsx("h3",{...n,style:{fontSize:"1.05em",fontWeight:600,margin:"8px 0 4px"},children:t})},p({children:t,...n}){return _.jsx("p",{...n,style:{margin:"4px 0",lineHeight:1.6},children:t})}},children:e})})}function R1(e){var t;return typeof e=="string"?e:Array.isArray(e)?e.map(R1).join(""):(t=e==null?void 0:e.props)!=null&&t.children?R1(e.props.children):""}function JF({commands:e,filter:t,selectedIndex:n,onSelect:i,visible:r}){const s=L.useRef(null),l=L.useRef(null),c=e.filter(f=>f.command.toLowerCase().includes(t.toLowerCase())||f.description.toLowerCase().includes(t.toLowerCase()));return L.useEffect(()=>{var f;(f=l.current)==null||f.scrollIntoView({block:"nearest"})},[n]),!r||c.length===0?null:_.jsxs("div",{ref:s,style:{position:"absolute",bottom:"100%",left:0,right:0,marginBottom:4,background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-md)",boxShadow:"var(--shadow-lg)",maxHeight:280,overflowY:"auto",zIndex:100,animation:"fadeInUp 0.15s var(--ease-out) both"},children:[_.jsx("div",{style:{padding:"8px 12px 4px",fontSize:"0.65rem",fontFamily:"var(--font-mono)",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Commands"}),c.map((f,p)=>{const m=p===n;return _.jsxs("div",{ref:m?l:void 0,onClick:()=>i(f),style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",cursor:"pointer",background:m?"var(--accent-glow)":"transparent",borderLeft:m?"2px solid var(--accent)":"2px solid transparent",transition:"background var(--duration-fast) var(--ease-out)"},onMouseEnter:g=>{m||(g.currentTarget.style.background="var(--surface-3)")},onMouseLeave:g=>{m||(g.currentTarget.style.background="transparent")},children:[_.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.8rem",fontWeight:600,color:m?"var(--accent)":"var(--text-primary)",whiteSpace:"nowrap"},children:["/",f.command,f.args&&_.jsxs("span",{style:{color:"var(--text-muted)",fontWeight:400},children:[" ",f.args]})]}),_.jsx("span",{style:{fontSize:"0.75rem",color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.description})]},f.command)})]})}const uT=[{command:"expxagents",description:"Show main menu"},{command:"expxagents create",args:"[description]",description:"Design a new squad"},{command:"expxagents run",args:"<name>",description:"Execute a squad pipeline"},{command:"expxagents list",description:"List all squads"},{command:"expxagents edit",args:"<name>",description:"Modify a squad"},{command:"expxagents delete",args:"<name>",description:"Delete a squad"},{command:"expxagents skills",description:"Browse skills"},{command:"expxagents install",args:"<name>",description:"Install a skill"},{command:"expxagents uninstall",args:"<name>",description:"Remove a skill"},{command:"expxagents dashboard",description:"Open virtual office"},{command:"expxagents virtual-office",description:"Open virtual office in browser"},{command:"expxagents jarvis",description:"Open Jarvis voice assistant"},{command:"expxagents help",description:"Show help text"}];function eG({c:e}){return _.jsxs("div",{style:{padding:"12px",background:"#1e1e2e",borderRadius:"8px",minWidth:"120px"},children:[_.jsxs("div",{style:{fontSize:"24px",fontWeight:"bold",color:"#cdd6f4"},children:[e.value,e.unit?` ${e.unit}`:""]}),_.jsx("div",{style:{fontSize:"12px",color:"#a6adc8",marginTop:"4px"},children:e.label})]})}function tG({c:e}){const t=Math.round(e.value*100);return _.jsxs("div",{style:{width:"100%"},children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"4px"},children:[_.jsx("span",{style:{fontSize:"12px",color:"#a6adc8"},children:e.label}),_.jsxs("span",{style:{fontSize:"12px",color:"#cdd6f4"},children:[t,"%"]})]}),_.jsx("div",{style:{height:"6px",background:"#313244",borderRadius:"3px"},children:_.jsx("div",{style:{height:"100%",width:`${t}%`,background:"#89b4fa",borderRadius:"3px",transition:"width 0.3s"}})})]})}function nG({c:e}){return _.jsxs("div",{children:[e.title&&_.jsx("div",{style:{fontSize:"13px",fontWeight:600,color:"#cdd6f4",marginBottom:"8px"},children:e.title}),_.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"12px"},children:[_.jsx("thead",{children:_.jsx("tr",{children:e.columns.map((t,n)=>_.jsx("th",{style:{textAlign:"left",padding:"4px 8px",color:"#a6adc8",borderBottom:"1px solid #313244"},children:t},n))})}),_.jsx("tbody",{children:e.rows.map((t,n)=>_.jsx("tr",{children:t.map((i,r)=>_.jsx("td",{style:{padding:"4px 8px",color:"#cdd6f4",borderBottom:"1px solid #1e1e2e"},children:i},r))},n))})]})]})}function iG({c:e}){return _.jsxs("div",{style:{padding:"12px",background:"#1e1e2e",borderRadius:"8px"},children:[_.jsx("div",{style:{fontWeight:600,color:"#cdd6f4",marginBottom:"6px"},children:e.title}),_.jsx("div",{style:{fontSize:"13px",color:"#a6adc8"},children:e.body})]})}const rG={green:"#a6e3a1",yellow:"#f9e2af",red:"#f38ba8",blue:"#89b4fa"};function aG({c:e}){return _.jsx("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"12px",fontSize:"11px",fontWeight:600,color:"#1e1e2e",background:rG[e.color]??"#a6adc8"},children:e.label})}function sG({components:e}){return e.length===0?null:_.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px",padding:"12px"},children:e.map((t,n)=>{switch(t.type){case"metric":return _.jsx(eG,{c:t},n);case"progress":return _.jsx(tG,{c:t},n);case"table":return _.jsx(nG,{c:t},n);case"card":return _.jsx(iG,{c:t},n);case"badge":return _.jsx(aG,{c:t},n)}})})}const i0="_expxagents",eu=[.72,.78,.85,.95,1.08,1.2],lG=2;function oG({file:e,onRemove:t}){return _.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:4,background:"var(--surface-3)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",padding:"2px 8px",fontSize:"0.72rem",fontFamily:"var(--font-mono)",color:"var(--accent)",maxWidth:180},children:[_.jsx("span",{style:{opacity:.6},children:"📎"}),_.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),_.jsx("button",{onClick:t,style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",padding:0,fontSize:"0.8rem",lineHeight:1},"aria-label":`Remove ${e.name}`,children:"×"})]})}function cG({message:e,fontSize:t}){if(e.role==="agent_dm")return _.jsxs("div",{"data-role":"agent_dm",style:{alignSelf:"flex-start",background:"var(--surface-3)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:"85%",marginBottom:"var(--sp-2)",animation:"fadeInUp 0.3s var(--ease-out) both"},children:[_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--accent)",fontWeight:600,marginBottom:4,letterSpacing:"0.02em"},children:e.agentName}),_.jsx("div",{style:{color:"var(--text-primary)",fontSize:`${t}rem`,lineHeight:1.55},children:_.jsx(M1,{content:e.content})})]});const n=e.role==="user";return _.jsx("div",{"data-role":e.role,style:{alignSelf:n?"flex-end":"flex-start",background:n?"var(--user-bubble)":"var(--agent-bubble)",border:n?"1px solid rgba(100, 160, 255, 0.15)":"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:n?"75%":"85%",marginBottom:"var(--sp-2)",animation:"fadeInUp 0.3s var(--ease-out) both"},children:_.jsx("div",{style:{color:"var(--text-primary)",fontSize:`${t}rem`,lineHeight:1.55},children:n?_.jsx("span",{style:{whiteSpace:"pre-wrap"},children:e.content}):_.jsx(M1,{content:e.content})})})}function uG({conv:e,isActive:t,onSelect:n,onDelete:i}){const[r,s]=L.useState(!1),l=new Date(e.createdAt),c=l.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),f=l.toLocaleDateString([],{day:"2-digit",month:"2-digit"});return _.jsxs("div",{onClick:n,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{padding:"8px 10px",borderRadius:"var(--radius-sm)",cursor:"pointer",background:t?"var(--accent-glow)":r?"var(--surface-3)":"transparent",border:t?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)",display:"flex",alignItems:"center",gap:8},children:[_.jsxs("div",{style:{flex:1,minWidth:0},children:[_.jsx("div",{style:{fontSize:"0.72rem",fontFamily:"var(--font-mono)",color:t?"var(--accent)":"var(--text-secondary)",fontWeight:t?600:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.preview||"New conversation"}),_.jsxs("div",{style:{fontSize:"0.6rem",fontFamily:"var(--font-mono)",color:"var(--text-muted)",marginTop:2},children:[f," ",c]})]}),r&&_.jsx("button",{onClick:p=>{p.stopPropagation(),i()},title:"Delete conversation","aria-label":"Delete conversation",style:{background:"none",border:"none",color:"var(--status-error)",cursor:"pointer",padding:"2px 4px",fontSize:"0.75rem",lineHeight:1,opacity:.7,flexShrink:0},children:"×"})]})}function dG(){const[e,t]=L.useState(""),[n,i]=L.useState([]),[r,s]=L.useState(lG),[l,c]=L.useState(!1),[f,p]=L.useState(""),[m,g]=L.useState(0),x=L.useRef(null),v=L.useRef(null),S=L.useRef(null),A=L.useRef(null),T=vr(le=>le.selectedSquad),C=vr(le=>le.uiComponents[T??""]),N=rr(le=>le.conversations),R=rr(le=>le.conversationId),O=rr(le=>le.messages),H=rr(le=>le.streaming),D=rr(le=>le.streamingText),q=rr(le=>le.activity),Z=rr(le=>le.error),V=rr(le=>le.addUserMessage),Y=rr(le=>le.startStreaming),F=rr(le=>le.loadHistory),j=rr(le=>le.selectConversation),ee=rr(le=>le.deleteConversation);L.useEffect(()=>{F(i0)},[F]),L.useEffect(()=>{var le,Re;(Re=(le=x.current)==null?void 0:le.scrollIntoView)==null||Re.call(le,{behavior:"smooth"})},[O,D]);const P=L.useCallback(()=>{const le=v.current;le&&(le.style.height="auto",le.style.height=Math.min(le.scrollHeight,200)+"px")},[]);L.useEffect(()=>{P()},[e,P]);const W=L.useCallback(le=>{if(le.startsWith("/")){const Re=le.slice(1);p(Re),c(!0),g(0)}else c(!1)},[]),z=L.useCallback(()=>uT.filter(le=>le.command.toLowerCase().includes(f.toLowerCase())||le.description.toLowerCase().includes(f.toLowerCase())),[f]),K=L.useCallback(le=>{var Re;t("/"+le.command+(le.args?" ":"")),c(!1),(Re=v.current)==null||Re.focus()},[]),G=L.useCallback(()=>{H||P4(i0)},[H]),Q=L.useCallback(le=>{H||ee(le,i0)},[H,ee]),I=L.useCallback(le=>{H||le===R||j(le)},[H,R,j]),$=L.useCallback(()=>{const le=e.trim();!le||H||(V(le),Y(),XC(i0,le,n.length>0?n:void 0),t(""),i([]),c(!1),v.current&&(v.current.style.height="auto"))},[e,H,n,V,Y]),ne=L.useCallback(le=>{if(l){const Re=z();if(le.key==="ArrowDown"){le.preventDefault(),g(je=>Math.min(je+1,Re.length-1));return}if(le.key==="ArrowUp"){le.preventDefault(),g(je=>Math.max(je-1,0));return}if(le.key==="Enter"&&!le.shiftKey){le.preventDefault(),Re[m]&&K(Re[m]);return}if(le.key==="Escape"){le.preventDefault(),c(!1);return}if(le.key==="Tab"){le.preventDefault(),Re[m]&&K(Re[m]);return}}le.key==="Enter"&&!le.shiftKey&&(le.preventDefault(),$())},[l,z,m,K,$]),X=L.useCallback(le=>{const Re=le.target.value;t(Re),W(Re)},[W]),ce=L.useCallback(async le=>{var je;if(!le)return;const Re=[];for(const Ie of Array.from(le))if(!(Ie.size>512e3))try{const He=await Ie.text();Re.push({name:Ie.name,content:He})}catch{}i(Ie=>[...Ie,...Re]),(je=v.current)==null||je.focus()},[]),ie=L.useCallback(le=>{le.preventDefault(),le.stopPropagation(),ce(le.dataTransfer.files)},[ce]),de=L.useCallback(le=>{le.preventDefault(),le.stopPropagation()},[]),xe=L.useCallback(le=>{i(Re=>Re.filter((je,Ie)=>Ie!==le))},[]),me=e.trim()&&!H;return _.jsxs("div",{style:{display:"flex",height:"100%"},onDrop:ie,onDragOver:de,children:[_.jsxs("div",{style:{width:220,borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",flexShrink:0},children:[_.jsx("div",{style:{padding:"var(--sp-2)"},children:_.jsx("button",{onClick:G,disabled:H,"aria-label":"New conversation",style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 10px",background:"var(--accent-glow)",border:"1px solid rgba(0, 200, 255, 0.15)",borderRadius:"var(--radius-sm)",color:"var(--accent)",cursor:H?"not-allowed":"pointer",fontFamily:"var(--font-mono)",fontSize:"0.72rem",fontWeight:600,letterSpacing:"0.02em",opacity:H?.5:1,transition:"all var(--duration-fast) var(--ease-out)"},children:"+ New Chat"})}),_.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"0 var(--sp-2) var(--sp-2)",display:"flex",flexDirection:"column",gap:2},children:[N.length===0&&_.jsx("div",{style:{padding:"var(--sp-4) var(--sp-2)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)"},children:"No conversations yet"}),N.map(le=>_.jsx(uG,{conv:le,isActive:le.id===R,onSelect:()=>I(le.id),onDelete:()=>Q(le.id)},le.id))]})]}),_.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[_.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:"4px var(--sp-4)",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)",gap:2},children:[_.jsx("button",{onClick:()=>s(le=>Math.max(le-1,0)),disabled:r===0,title:"Decrease font size","aria-label":"Decrease font size",style:{background:"none",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",color:r===0?"var(--text-muted)":"var(--text-secondary)",cursor:r===0?"not-allowed":"pointer",padding:"2px 7px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:700,lineHeight:1.4,opacity:r===0?.35:.7},children:"A-"}),_.jsx("button",{onClick:()=>s(le=>Math.min(le+1,eu.length-1)),disabled:r===eu.length-1,title:"Increase font size","aria-label":"Increase font size",style:{background:"none",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",color:r===eu.length-1?"var(--text-muted)":"var(--text-secondary)",cursor:r===eu.length-1?"not-allowed":"pointer",padding:"2px 7px",fontFamily:"var(--font-mono)",fontSize:"0.8rem",fontWeight:700,lineHeight:1.4,opacity:r===eu.length-1?.35:.7},children:"A+"})]}),_.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"var(--sp-4)",display:"flex",flexDirection:"column"},children:[O.length===0&&!H&&_.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flex:1,gap:"var(--sp-3)",opacity:.6},children:[_.jsx("div",{style:{width:48,height:48,borderRadius:"var(--radius-md)",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.2rem",color:"var(--accent)"},children:"EX"}),_.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.82rem",fontFamily:"var(--font-display)"},children:"ExpxAgents Terminal"}),_.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.7rem",fontFamily:"var(--font-mono)"},children:"Type / to see available commands"})]}),O.map(le=>_.jsx(cG,{message:le,fontSize:eu[r]},le.id)),H&&D&&_.jsx("div",{"data-role":"assistant",style:{alignSelf:"flex-start",background:"var(--agent-bubble)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:"85%",marginBottom:"var(--sp-2)"},children:_.jsxs("div",{style:{color:"var(--text-primary)",fontSize:`${eu[r]}rem`,lineHeight:1.55},children:[_.jsx(M1,{content:D}),_.jsx("span",{style:{display:"inline-block",width:6,height:14,background:"var(--accent)",marginLeft:2,animation:"pulse 1s ease-in-out infinite",borderRadius:1,verticalAlign:"text-bottom"}})]})}),H&&!D&&_.jsx("div",{style:{alignSelf:"flex-start",display:"flex",flexDirection:"column",gap:4,padding:"10px 14px",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[_.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"var(--accent)",animation:"pulse 1s ease-in-out infinite"}}),q||"Thinking..."]})}),Z&&_.jsx("div",{style:{alignSelf:"center",background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.25)",borderRadius:"var(--radius-sm)",padding:"8px 14px",color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.78rem",marginBottom:"var(--sp-2)"},children:Z}),_.jsx("div",{ref:x}),C&&C.length>0&&_.jsx("div",{style:{borderTop:"1px solid #313244",marginTop:"8px"},children:_.jsx(sG,{components:C})})]}),_.jsxs("div",{ref:A,style:{borderTop:"1px solid var(--border-subtle)",background:"var(--surface-1)",position:"relative"},children:[_.jsx("div",{style:{position:"relative",padding:"0 var(--sp-4)"},children:_.jsx(JF,{commands:uT,filter:f,selectedIndex:m,onSelect:K,visible:l})}),n.length>0&&_.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,padding:"var(--sp-2) var(--sp-4) 0"},children:n.map((le,Re)=>_.jsx(oG,{file:le,onRemove:()=>xe(Re)},`${le.name}-${Re}`))}),_.jsxs("div",{style:{display:"flex",padding:"var(--sp-3) var(--sp-4)",gap:"var(--sp-2)",alignItems:"flex-end"},children:[_.jsx("button",{onClick:()=>{var le;return(le=S.current)==null?void 0:le.click()},disabled:H,title:"Attach files (text only, max 500KB)",style:{background:"none",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",color:"var(--text-muted)",cursor:H?"not-allowed":"pointer",padding:"6px 8px",fontSize:"1rem",lineHeight:1,opacity:H?.4:.7,transition:"opacity var(--duration-fast) var(--ease-out)",flexShrink:0},"aria-label":"Attach file",children:"📎"}),_.jsx("input",{ref:S,type:"file",multiple:!0,style:{display:"none"},onChange:le=>ce(le.target.files)}),_.jsx("textarea",{ref:v,className:"input",value:e,onChange:X,onKeyDown:ne,placeholder:"Type a message... (/ for commands)",disabled:H,rows:1,style:{flex:1,resize:"none",overflow:"hidden",minHeight:36,maxHeight:200,lineHeight:1.5,fontFamily:"var(--font-mono)",fontSize:`${eu[r]}rem`}}),_.jsx("button",{onClick:$,disabled:!me,"aria-label":"Send",className:me?"btn btn-accent":"btn",style:{padding:"0 var(--sp-5)",cursor:me?"pointer":"not-allowed",opacity:me?1:.4,flexShrink:0,height:36},children:"Send"})]})]})]})]})}const fG={planned:"var(--status-idle)",executing:"var(--accent)",done:"var(--status-active)",failed:"var(--status-error)"},hG={planned:"planejado",executing:"executando",done:"finalizado",failed:"falhou"};function pG({task:e,selected:t,onClick:n,onDelete:i}){const r=fG[e.status],s=e.status==="executing",l=f=>{f.dataTransfer.setData("text/plain",`task:${e.id}`),f.dataTransfer.effectAllowed="move",f.currentTarget.style.opacity="0.5"},c=f=>{f.currentTarget.style.opacity="1"};return _.jsxs("div",{draggable:!e.activity_id,onDragStart:l,onDragEnd:c,onClick:()=>n==null?void 0:n(e),"data-testid":`task-card-${e.id}`,style:{background:t?"var(--surface-4)":"var(--surface-3)",borderRadius:"var(--radius-sm)",padding:"12px 14px",marginBottom:"var(--sp-2)",border:"1px solid",borderColor:t?"var(--accent)":s?r:"var(--border-subtle)",transition:"border-color var(--duration-fast) var(--ease-out), opacity 0.15s ease",cursor:"pointer"},children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6},children:[_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",fontWeight:600,color:r,padding:"2px 8px",borderRadius:"var(--radius-full)",border:`1px solid ${r}`,letterSpacing:"0.02em"},children:hG[e.status]}),i&&_.jsx("button",{onClick:f=>{f.stopPropagation(),i(e.id)},style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:"0.7rem",padding:"0 2px",lineHeight:1,opacity:.5,transition:"opacity 0.15s, color 0.15s"},onMouseEnter:f=>{f.currentTarget.style.opacity="1",f.currentTarget.style.color="var(--status-error)"},onMouseLeave:f=>{f.currentTarget.style.opacity="0.5",f.currentTarget.style.color="var(--text-muted)"},title:"Delete task",children:"✕"})]}),_.jsx("div",{style:{fontWeight:600,fontSize:"0.82rem",color:"var(--text-primary)",marginBottom:e.description?6:0,lineHeight:1.4},children:e.title}),e.description&&_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)",lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.description}),e.agent_name&&_.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",color:"var(--text-muted)",marginTop:2,display:"flex",alignItems:"center",gap:4},children:[_.jsx("span",{children:"🤖"}),e.agent_name]}),e.step_id&&!e.agent_name&&_.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",color:"var(--accent-dim)",marginTop:2},children:["◆"," checkpoint"]}),e.triggered_by&&e.triggered_by!=="dashboard"&&_.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--text-muted)",marginTop:4,opacity:.7},children:[e.triggered_by==="chat"?"💬":e.triggered_by==="schedule"?"⏰":e.triggered_by==="chain"?"🔗":""," ",e.triggered_by]}),e.activity_id&&_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--accent-dim)",marginTop:4,padding:"1px 6px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-full)",display:"inline-block"},children:e.squad_code}),e.result&&_.jsxs("div",{style:{marginTop:6,fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--status-active)",display:"flex",alignItems:"center",gap:4},children:[_.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:"var(--status-active)",display:"inline-block"}}),"has output"]})]})}const ck=[{key:"planned",label:"Planejado",color:"var(--status-idle)",glow:"none"},{key:"executing",label:"Executando",color:"var(--accent)",glow:"var(--accent-glow)"},{key:"done",label:"Finalizado",color:"var(--status-active)",glow:"var(--status-active-glow)"},{key:"failed",label:"Falhou",color:"var(--status-error)",glow:"none"}];function bv(e){if(!e)return"—";const t=new Date(e);return t.toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"2-digit"})+" "+t.toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"})}function vv(e,t){if(!e||!t)return null;const n=new Date(t).getTime()-new Date(e).getTime();if(n<0)return null;if(n<1e3)return`${n}ms`;const i=Math.floor(n/1e3);if(i<60)return`${i}s`;const r=Math.floor(i/60),s=i%60;if(r<60)return`${r}m ${s}s`;const l=Math.floor(r/60),c=r%60;return`${l}h ${c}m`}function mG(){const e=vr(j=>j.squads),t=vr(j=>j.activeStates),[n,i]=L.useState(null),[r,s]=L.useState(""),[l,c]=L.useState([]),[f,p]=L.useState(null),[m,g]=L.useState(""),[x,v]=L.useState(""),[S,A]=L.useState(null),[T,C]=L.useState(null),N=n;L.useEffect(()=>{if(!N){c([]),C(null);return}const j=N==="__all__"?"/api/kanban/tasks":`/api/kanban/${N}/tasks`;fetch(j,{credentials:"include"}).then(ee=>ee.json()).then(ee=>c(Array.isArray(ee)?ee:[])).catch(()=>c([]))},[N]),L.useEffect(()=>{const j=ee=>{const P=ee.detail;if(!(P!=null&&P.activityId)||!N)return;const W=N==="__all__"?"/api/kanban/tasks":`/api/kanban/${N}/tasks`;fetch(W,{credentials:"include"}).then(z=>z.json()).then(z=>{const K=Array.isArray(z)?z:[];c(K),C(G=>G?K.find(I=>I.id===G.id)??null:null)}).catch(()=>{})};return window.addEventListener("kanban:task_updated",j),()=>window.removeEventListener("kanban:task_updated",j)},[N]);const R=L.useMemo(()=>ck.map(j=>({...j,tasks:l.filter(ee=>ee.status===j.key).sort((ee,P)=>ee.position-P.position)})),[l]),O=e.filter(j=>{if(!r)return!0;const ee=r.toLowerCase();return j.name.toLowerCase().includes(ee)||j.code.toLowerCase().includes(ee)}),H=L.useCallback(async j=>{if(!N||!m.trim())return;const ee=await fetch(`/api/kanban/${N}/tasks`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:m.trim(),description:x.trim()||void 0,status:j})});if(ee.ok){const P=await ee.json();c(W=>[...W,P]),g(""),v(""),p(null)}},[N,m,x]),D=L.useCallback(async j=>{if(!N)return;(await fetch(`/api/kanban/${N}/tasks/${j}`,{method:"DELETE",credentials:"include"})).ok&&(c(P=>P.filter(W=>W.id!==j)),(T==null?void 0:T.id)===j&&C(null))},[N,T]),q=L.useCallback(async(j,ee)=>{if(!N)return;const P=l.find(z=>z.id===j);if(!P||P.status===ee)return;c(z=>z.map(K=>K.id===j?{...K,status:ee}:K));const W=await fetch(`/api/kanban/${N}/tasks/${j}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:ee})});if(W.ok){const z=await W.json();c(K=>K.map(G=>G.id===j?z:G)),(T==null?void 0:T.id)===j&&C(z),ee==="executing"&&XC(N,`Execute a seguinte tarefa do kanban: ${P.title}${P.description?" — "+P.description:""}`)}else c(z=>z.map(K=>K.id===j?P:K))},[N,l,T]),Z=L.useCallback(async(j,ee)=>{if(!N)return;const P=await fetch(`/api/kanban/${N}/tasks/${j}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({result:ee})});if(P.ok){const W=await P.json();c(z=>z.map(K=>K.id===j?W:K)),C(W)}},[N]),V=L.useCallback((j,ee)=>{j.preventDefault(),j.dataTransfer.dropEffect="move",A(ee)},[]),Y=L.useCallback(()=>{A(null)},[]),F=L.useCallback((j,ee)=>{j.preventDefault(),A(null);const P=j.dataTransfer.getData("text/plain");if(!P.startsWith("task:"))return;const W=P.replace("task:","");q(W,ee)},[q]);return _.jsxs("div",{style:{display:"flex",height:"100%",overflow:"hidden"},children:[_.jsxs("div",{style:{width:240,minWidth:240,borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[_.jsx("div",{style:{padding:"12px 14px",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em",borderBottom:"1px solid var(--border-subtle)"},children:"Squads"}),_.jsx("div",{style:{padding:"8px 10px",borderBottom:"1px solid var(--border-subtle)"},children:_.jsx("input",{type:"text",placeholder:"Search squads...",value:r,onChange:j=>s(j.target.value),style:{width:"100%",padding:"5px 8px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",outline:"none"}})}),_.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"6px 8px"},children:[_.jsxs("button",{onClick:()=>{i("__all__"),C(null)},style:{width:"100%",background:N==="__all__"?"var(--accent-glow)":"none",border:N==="__all__"?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",borderRadius:"var(--radius-sm)",padding:"8px 10px",display:"flex",alignItems:"center",gap:8,cursor:"pointer",textAlign:"left",marginBottom:6},children:[_.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",flexShrink:0}}),_.jsxs("div",{style:{overflow:"hidden"},children:[_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:N==="__all__"?600:400,color:N==="__all__"?"var(--accent)":"var(--text-primary)"},children:"Todos"}),_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:"all squads"})]})]}),_.jsx("div",{style:{borderBottom:"1px solid var(--border-subtle)",margin:"4px 0 6px"}}),O.map(j=>{var W;const ee=j.code===N,P=!!t[j.code];return _.jsxs("button",{onClick:()=>{i(j.code),C(null)},style:{width:"100%",background:ee?"var(--accent-glow)":"none",border:ee?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",borderRadius:"var(--radius-sm)",padding:"8px 10px",display:"flex",alignItems:"center",gap:8,cursor:"pointer",textAlign:"left",marginBottom:2},children:[_.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:P?"var(--status-active)":"var(--status-idle)",flexShrink:0}}),_.jsxs("div",{style:{overflow:"hidden"},children:[_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:ee?600:400,color:ee?"var(--accent)":"var(--text-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:j.name}),_.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:[((W=j.agents)==null?void 0:W.length)||0," agents"]})]})]},j.code)}),O.length===0&&_.jsx("div",{style:{padding:"16px 10px",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)",textAlign:"center"},children:"No squads found"})]})]}),_.jsx("div",{style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:N?_.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[_.jsx("div",{style:{display:"flex",gap:"var(--sp-4)",padding:"var(--sp-5)",flex:1,overflow:"auto"},children:R.map((j,ee)=>{const P=S===j.key;return _.jsxs("div",{"data-testid":`column-${j.key}`,onDragOver:W=>V(W,j.key),onDragLeave:Y,onDrop:W=>F(W,j.key),style:{flex:1,background:P?"rgba(0, 200, 255, 0.04)":"var(--surface-2)",border:P?"1px dashed var(--accent)":"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-4)",display:"flex",flexDirection:"column",minWidth:220,animation:`fadeInUp 0.4s var(--ease-out) ${ee*80}ms both`,transition:"background 0.15s ease, border-color 0.15s ease"},children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-4)",paddingBottom:"var(--sp-3)",borderBottom:`2px solid ${j.color}`},children:[_.jsx("span",{style:{fontWeight:600,fontSize:"0.82rem",color:"var(--text-primary)"},children:j.label}),_.jsx("span",{"data-testid":`count-${j.key}`,style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:700,color:j.color,background:j.glow,width:22,height:22,borderRadius:"var(--radius-full)",display:"flex",alignItems:"center",justifyContent:"center",border:`1px solid ${j.color}`},children:j.tasks.length})]}),_.jsx("div",{style:{flex:1,overflowY:"auto"},children:j.tasks.map(W=>_.jsx(pG,{task:W,selected:(T==null?void 0:T.id)===W.id,onClick:C,onDelete:W.activity_id?void 0:D},W.id))}),f===j.key?_.jsxs("div",{style:{marginTop:"var(--sp-3)",background:"var(--surface-3)",borderRadius:"var(--radius-sm)",padding:"10px 12px",border:"1px solid var(--border-default)"},children:[_.jsx("input",{type:"text",placeholder:"Title",value:m,onChange:W=>g(W.target.value),autoFocus:!0,onKeyDown:W=>{W.key==="Enter"&&m.trim()&&H(j.key),W.key==="Escape"&&(p(null),g(""),v(""))},style:{width:"100%",padding:"5px 8px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:600,outline:"none",marginBottom:6}}),_.jsx("textarea",{placeholder:"Description (optional)",value:x,onChange:W=>v(W.target.value),onKeyDown:W=>{W.key==="Escape"&&(p(null),g(""),v(""))},rows:2,style:{width:"100%",padding:"5px 8px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",outline:"none",resize:"none",marginBottom:8}}),_.jsxs("div",{style:{display:"flex",gap:6},children:[_.jsx("button",{onClick:()=>H(j.key),disabled:!m.trim(),style:{background:m.trim()?"var(--accent)":"var(--surface-4)",border:"none",borderRadius:"var(--radius-xs)",padding:"4px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:m.trim()?"var(--text-inverse)":"var(--text-muted)",cursor:m.trim()?"pointer":"default"},children:"Add"}),_.jsx("button",{onClick:()=>{p(null),g(""),v("")},style:{background:"none",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",padding:"4px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)",cursor:"pointer"},children:"Cancel"})]})]}):_.jsx("button",{"data-testid":`add-task-${j.key}`,onClick:()=>{p(j.key),g(""),v("")},style:{marginTop:"var(--sp-3)",width:"100%",background:"none",border:"1px dashed var(--border-default)",borderRadius:"var(--radius-sm)",padding:"8px",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-muted)",cursor:"pointer",transition:"all 0.15s ease"},onMouseEnter:W=>{W.currentTarget.style.borderColor="var(--accent-dim)",W.currentTarget.style.color="var(--accent)"},onMouseLeave:W=>{W.currentTarget.style.borderColor="var(--border-default)",W.currentTarget.style.color="var(--text-muted)"},children:"+ New Task"})]},j.key)})}),T&&_.jsx(gG,{task:T,onClose:()=>C(null),onMove:q,onUpdateResult:Z})]}):_.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--sp-3)",animation:"fadeIn 0.5s var(--ease-out) both"},children:[_.jsx("span",{style:{fontSize:"1.5rem",color:"var(--text-muted)",opacity:.4},children:"▦"}),_.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.85rem"},children:"Select a squad to view the kanban"})]})})]})}function gG({task:e,onClose:t,onMove:n,onUpdateResult:i}){const[r,s]=L.useState(!1),[l,c]=L.useState(e.result||"");L.useEffect(()=>{c(e.result||""),s(!1)},[e.id,e.result]);const f=()=>{i(e.id,l),s(!1)},p=e.status==="planned"?"var(--status-idle)":e.status==="executing"?"var(--accent)":e.status==="failed"?"var(--status-error)":"var(--status-active)";return _.jsxs("div",{"data-testid":"task-detail-panel",style:{width:360,minWidth:360,borderLeft:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",overflow:"hidden",animation:"slideInRight 0.2s var(--ease-out) both"},children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)"},children:[_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:600,color:p,padding:"2px 10px",borderRadius:"var(--radius-full)",border:`1px solid ${p}`,textTransform:"uppercase"},children:e.status==="planned"?"planejado":e.status==="executing"?"executando":e.status==="failed"?"falhou":"finalizado"}),_.jsx("button",{onClick:t,style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:"1rem",padding:"0 4px"},children:"✕"})]}),_.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"16px"},children:[_.jsx("h3",{style:{fontFamily:"var(--font-display)",fontSize:"1rem",fontWeight:700,color:"var(--text-primary)",marginBottom:8,lineHeight:1.3},children:e.title}),e.description&&_.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.78rem",color:"var(--text-secondary)",lineHeight:1.5,marginBottom:16},children:e.description}),_.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,marginBottom:20,padding:"12px",background:"var(--surface-2)",borderRadius:"var(--radius-sm)"},children:[_.jsxs("div",{children:[_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Created"}),_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:bv(e.created_at)})]}),_.jsxs("div",{children:[_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Started"}),_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:bv(e.started_at)})]}),_.jsxs("div",{children:[_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Finished"}),_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:bv(e.finished_at)})]}),_.jsxs("div",{children:[_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Duration"}),_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:vv(e.started_at,e.finished_at)?"var(--accent)":"var(--text-secondary)",fontWeight:vv(e.started_at,e.finished_at)?600:400},children:vv(e.started_at,e.finished_at)??"—"})]})]}),_.jsxs("div",{style:{marginBottom:20},children:[_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:8},children:"Move to"}),_.jsx("div",{style:{display:"flex",gap:6},children:ck.filter(m=>m.key!==e.status).map(m=>_.jsx("button",{"data-testid":`move-to-${m.key}`,onClick:()=>n(e.id,m.key),style:{flex:1,background:"var(--surface-3)",border:`1px solid ${m.color}`,borderRadius:"var(--radius-xs)",padding:"6px 10px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:m.color,cursor:"pointer",transition:"all 0.15s ease"},onMouseEnter:g=>{g.currentTarget.style.background=m.glow!=="none"?m.glow:"var(--surface-4)"},onMouseLeave:g=>{g.currentTarget.style.background="var(--surface-3)"},children:m.label},m.key))})]}),_.jsxs("div",{children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em"},children:"Output / Result"}),!r&&_.jsx("button",{onClick:()=>{s(!0),c(e.result||"")},style:{background:"none",border:"none",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--accent-dim)",cursor:"pointer"},children:e.result?"edit":"+ add"})]}),r?_.jsxs("div",{children:[_.jsx("textarea",{value:l,onChange:m=>c(m.target.value),autoFocus:!0,rows:8,style:{width:"100%",padding:"10px 12px",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",lineHeight:1.6,outline:"none",resize:"vertical",marginBottom:8}}),_.jsxs("div",{style:{display:"flex",gap:6},children:[_.jsx("button",{onClick:f,style:{background:"var(--accent)",border:"none",borderRadius:"var(--radius-xs)",padding:"4px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:"var(--text-inverse)",cursor:"pointer"},children:"Save"}),_.jsx("button",{onClick:()=>s(!1),style:{background:"none",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",padding:"4px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)",cursor:"pointer"},children:"Cancel"})]})]}):e.result?_.jsx("div",{style:{padding:"12px",background:"var(--surface-2)",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-primary)",lineHeight:1.6,whiteSpace:"pre-wrap",maxHeight:300,overflowY:"auto"},children:e.result}):_.jsx("div",{style:{padding:"20px",background:"var(--surface-2)",borderRadius:"var(--radius-sm)",border:"1px dashed var(--border-default)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-muted)"},children:"No output yet"})]})]})]})}function yG(){const e=gl(R=>R.user),[t,n]=L.useState([]),[i,r]=L.useState(!0),[s,l]=L.useState(""),[c,f]=L.useState(""),[p,m]=L.useState("viewer"),[g,x]=L.useState(null),[v,S]=L.useState(null),A=L.useCallback(async()=>{try{const R=await fetch("/api/users",{credentials:"include"});if(R.ok){const O=await R.json();n(O.users)}}catch{x("Failed to load users")}finally{r(!1)}},[]);L.useEffect(()=>{A()},[A]);const T=async()=>{if(!(!s.trim()||!c.trim())){x(null);try{const R=await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:s,password:c,role:p}),credentials:"include"});if(!R.ok){const O=await R.json();x(O.error||"Failed to create user");return}l(""),f(""),m("viewer"),await A()}catch{x("Network error")}}},C=async(R,O)=>{try{(await fetch(`/api/users/${R}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:O}),credentials:"include"})).ok&&await A()}catch{x("Failed to update role")}},N=async R=>{try{(await fetch(`/api/users/${R}`,{method:"DELETE",credentials:"include"})).ok&&(S(null),await A())}catch{x("Failed to delete user")}};return i?_.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading users..."}):_.jsxs("div",{children:[_.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"User Management"}),g&&_.jsx("div",{style:{background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",padding:"var(--sp-2) var(--sp-3)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:g}),_.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-5)",flexWrap:"wrap",alignItems:"center"},children:[_.jsx("input",{className:"input",placeholder:"Username",value:s,onChange:R=>l(R.target.value),style:{flex:1,minWidth:120}}),_.jsx("input",{className:"input",placeholder:"Password",type:"password",value:c,onChange:R=>f(R.target.value),style:{flex:1,minWidth:120}}),_.jsxs("select",{className:"input",value:p,onChange:R=>m(R.target.value),style:{minWidth:100},children:[_.jsx("option",{value:"viewer",children:"viewer"}),_.jsx("option",{value:"operator",children:"operator"}),_.jsx("option",{value:"admin",children:"admin"})]}),_.jsx("button",{onClick:T,className:"btn btn-accent",children:"Create User"})]}),_.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[_.jsx("thead",{children:_.jsx("tr",{style:{borderBottom:"1px solid var(--border-default)"},children:["Username","Email","Role","Last Login","Actions"].map((R,O)=>_.jsx("th",{style:{textAlign:O===4?"right":"left",padding:"8px 12px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em"},children:R},R))})}),_.jsx("tbody",{children:t.map(R=>_.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[_.jsx("td",{style:{padding:"10px 12px",color:"var(--text-primary)",fontSize:"0.82rem"},children:R.username}),_.jsx("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:R.email||"—"}),_.jsx("td",{style:{padding:"10px 12px"},children:R.id===(e==null?void 0:e.id)?_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:R.role}):_.jsxs("select",{className:"input",value:R.role,onChange:O=>C(R.id,O.target.value),style:{padding:"4px 8px",fontSize:"0.75rem"},children:[_.jsx("option",{value:"viewer",children:"viewer"}),_.jsx("option",{value:"operator",children:"operator"}),_.jsx("option",{value:"admin",children:"admin"})]})}),_.jsx("td",{style:{padding:"10px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:R.last_login?new Date(R.last_login).toLocaleDateString():"—"}),_.jsx("td",{style:{padding:"10px 12px",textAlign:"right"},children:R.id!==(e==null?void 0:e.id)&&(v===R.id?_.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-2)",alignItems:"center"},children:[_.jsx("span",{style:{color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:"Confirm?"}),_.jsx("button",{onClick:()=>N(R.id),className:"btn btn-sm btn-danger",children:"Yes"}),_.jsx("button",{onClick:()=>S(null),className:"btn btn-sm",children:"No"})]}):_.jsx("button",{onClick:()=>S(R.id),className:"btn btn-sm btn-danger",children:"Delete"}))})]},R.id))})]})]})}function xG(){const e=vr(f=>f.selectedSquad),t=vr(f=>f.activeStates),[n,i]=L.useState(null),[r,s]=L.useState(!1),l=e?t[e]:null;if(L.useEffect(()=>{if(!e){i(null);return}s(!0),fetch(`/api/squads/${e}`,{credentials:"include"}).then(f=>f.ok?f.json():null).then(f=>{f&&i(f.data)}).finally(()=>s(!1))},[e]),!e)return _.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontSize:"0.85rem"},children:"Select a squad to view details"});if(r)return _.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading squad details..."});const c={fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,marginBottom:"var(--sp-2)",textTransform:"uppercase",letterSpacing:"0.08em"};return _.jsxs("div",{children:[_.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"Squad Info"}),n&&_.jsxs(_.Fragment,{children:[_.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[_.jsx("div",{style:c,children:"Name"}),_.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.9rem",fontWeight:600},children:n.name})]}),_.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[_.jsx("div",{style:c,children:"Description"}),_.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.85rem",lineHeight:1.5},children:n.description})]}),_.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[_.jsx("div",{style:c,children:"Agents"}),_.jsx("div",{style:{display:"flex",gap:"var(--sp-2)",flexWrap:"wrap"},children:n.agents.map(f=>_.jsx("span",{style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"4px 10px",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-primary)"},children:f.name},f.id))})]}),_.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[_.jsx("div",{style:c,children:"Pipeline Steps"}),_.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:n.pipeline.steps.map((f,p)=>_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"8px 12px",fontSize:"0.82rem"},children:[_.jsx("span",{style:{background:"var(--accent)",color:"var(--text-inverse)",width:22,height:22,borderRadius:"var(--radius-full)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:700,flexShrink:0},children:p+1}),_.jsx("span",{style:{color:"var(--text-primary)"},children:f.label}),_.jsx("span",{style:{fontFamily:"var(--font-mono)",color:"var(--text-muted)",fontSize:"0.68rem",marginLeft:"auto"},children:f.agent})]},f.id))})]})]}),l&&_.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[_.jsx("div",{style:c,children:"Current State"}),_.jsx("pre",{"data-testid":"state-json",style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"var(--sp-4)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--accent)",overflow:"auto",maxHeight:400,lineHeight:1.5},children:JSON.stringify(l,null,2)})]})]})}function bG(){const[e,t]=L.useState(null),[n,i]=L.useState(null),[r,s]=L.useState(!0),[l,c]=L.useState(null),f=L.useCallback(async()=>{s(!0);try{const g=await fetch("/api/health",{credentials:"include"});if(g.ok){const x=await g.json();t(x),i(x.status==="ok")}else i(!1)}catch{i(!1)}finally{s(!1),c(new Date().toLocaleTimeString())}},[]);L.useEffect(()=>{f()},[f]);const p={fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,marginBottom:"var(--sp-2)",textTransform:"uppercase",letterSpacing:"0.08em"},m={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"10px 12px",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-2)",fontSize:"0.82rem"};return _.jsxs("div",{children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-4)"},children:[_.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)"},children:"Server Info"}),_.jsx("button",{onClick:f,className:"btn btn-sm",children:"Refresh"})]}),_.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[_.jsx("div",{style:p,children:"Health Status"}),_.jsxs("div",{style:m,children:[_.jsx("span",{style:{color:"var(--text-primary)"},children:"API Server"}),r?_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)",animation:"pulse 1.5s ease-in-out infinite"},children:"Checking..."}):_.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--sp-1)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:600,color:n?"var(--status-active)":"var(--status-error)"},children:[_.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:n?"var(--status-active)":"var(--status-error)",display:"inline-block",boxShadow:n?"0 0 8px var(--status-active-glow)":"0 0 8px var(--status-error-glow)"}}),n?"Healthy":"Unhealthy"]})]})]}),_.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[_.jsx("div",{style:p,children:"Environment"}),_.jsxs("div",{style:m,children:[_.jsx("span",{style:{color:"var(--text-primary)"},children:"API Port"}),_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:"3001"})]}),_.jsxs("div",{style:m,children:[_.jsx("span",{style:{color:"var(--text-primary)"},children:"Dashboard Port (dev)"}),_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:"5173"})]})]}),l&&_.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textAlign:"right"},children:["Last checked: ",l]})]})}const vG=[{key:"AWS_ACCESS_KEY_ID",label:"AWS Access Key ID",type:"password",hint:"Your AWS IAM access key"},{key:"AWS_SECRET_ACCESS_KEY",label:"AWS Secret Access Key",type:"password",hint:"Your AWS IAM secret key"},{key:"AWS_REGION",label:"AWS Region",type:"text",hint:"e.g. us-east-1, eu-west-1"},{key:"SES_FROM_EMAIL",label:"SES From Email",type:"text",hint:"Verified sender email in SES"},{key:"SES_RATE_LIMIT",label:"SES Rate Limit",type:"text",hint:"Max emails per second (default: 14)"},{key:"SERVER_URL",label:"Server URL",type:"text",hint:"Public URL for unsubscribe links"},{key:"PORT",label:"Port",type:"text",hint:"Server port (requires restart)"},{key:"CORS_ORIGIN",label:"CORS Origin",type:"text",hint:"Allowed origin for CORS"},{key:"NODE_ENV",label:"Node Environment",type:"text",hint:"development or production"}];function _G(){const[e,t]=L.useState({}),[n,i]=L.useState(!0),[r,s]=L.useState(!1),[l,c]=L.useState(null),[f,p]=L.useState(new Set);L.useEffect(()=>{fetch("/api/settings/env").then(x=>x.json()).then(x=>{t(x.settings||{}),i(!1)}).catch(()=>i(!1))},[]);const m=(x,v)=>{t(S=>({...S,[x]:v})),p(S=>new Set(S).add(x)),c(null)},g=async()=>{if(f.size===0)return;s(!0),c(null);const x={};for(const v of f)x[v]=e[v]||"";try{const v=await fetch("/api/settings/env",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)});if(v.ok){const S=await v.json();t(S.settings),p(new Set),c({type:"success",text:"Settings saved successfully"})}else{const S=await v.json();c({type:"error",text:S.error||"Failed to save"})}}catch{c({type:"error",text:"Network error"})}finally{s(!1)}};return n?_.jsx("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."}):_.jsxs("div",{style:{maxWidth:640},children:[_.jsx("div",{style:{marginBottom:"var(--sp-4)"},children:_.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",lineHeight:1.6},children:"Server environment variables. Secret values are masked. Changes to PORT or NODE_ENV require a server restart."})}),_.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:vG.map(x=>_.jsxs("div",{children:[_.jsx("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-secondary)",fontWeight:600,letterSpacing:"0.04em",marginBottom:4},children:x.label}),_.jsx("input",{type:x.type,value:e[x.key]||"",onChange:v=>m(x.key,v.target.value),placeholder:x.hint,style:{width:"100%",padding:"8px 12px",background:"var(--surface-2)",border:f.has(x.key)?"1px solid var(--accent)":"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.78rem",boxSizing:"border-box"}}),_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:x.hint})]},x.key))}),_.jsxs("div",{style:{marginTop:"var(--sp-4)",display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[_.jsx("button",{onClick:g,disabled:f.size===0||r,style:{padding:"8px 24px",background:f.size>0?"var(--accent)":"var(--surface-3)",border:"none",borderRadius:"var(--radius-sm)",color:f.size>0?"var(--text-inverse)":"var(--text-muted)",cursor:f.size>0?"pointer":"default",fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:600,opacity:r?.6:1},children:r?"Saving...":`Save ${f.size>0?`(${f.size})`:""}`}),l&&_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:l.type==="success"?"var(--status-active)":"var(--status-error)"},children:l.text})]})]})}function SG(){const[e,t]=L.useState([]),[n,i]=L.useState(!0),[r,s]=L.useState(null),[l,c]=L.useState(null),[f,p]=L.useState(""),[m,g]=L.useState(""),[x,v]=L.useState(""),[S,A]=L.useState(""),[T,C]=L.useState(null),[N,R]=L.useState(""),[O,H]=L.useState(""),[D,q]=L.useState(""),[Z,V]=L.useState(""),Y=L.useCallback(async()=>{try{const z=await fetch("/api/team",{credentials:"include"});if(z.ok){const K=await z.json();t(K.members)}}catch{s("Failed to load team members")}finally{i(!1)}},[]);L.useEffect(()=>{Y()},[Y]);const F=async()=>{if(!(!f.trim()||!m.trim())){s(null);try{const z=await fetch("/api/team",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:f.trim(),role:m.trim(),email:x.trim()||void 0,phone:S.trim()||void 0}),credentials:"include"});if(!z.ok){const K=await z.json();s(K.error||"Failed to create team member");return}p(""),g(""),v(""),A(""),await Y()}catch{s("Network error")}}},j=z=>{C(z.id),R(z.name),H(z.role),q(z.email||""),V(z.phone||"")},ee=()=>{C(null)},P=async()=>{if(!(!T||!N.trim()||!O.trim())){s(null);try{(await fetch(`/api/team/${T}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:N.trim(),role:O.trim(),email:D.trim()||void 0,phone:Z.trim()||void 0}),credentials:"include"})).ok&&(C(null),await Y())}catch{s("Failed to update member")}}},W=async z=>{try{(await fetch(`/api/team/${z}`,{method:"DELETE",credentials:"include"})).ok&&(c(null),await Y())}catch{s("Failed to delete member")}};return n?_.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading team..."}):_.jsxs("div",{children:[_.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"Team Members"}),r&&_.jsx("div",{style:{background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",padding:"var(--sp-2) var(--sp-3)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:r}),_.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-5)",flexWrap:"wrap",alignItems:"center"},children:[_.jsx("input",{className:"input",placeholder:"Name *",value:f,onChange:z=>p(z.target.value),style:{flex:1,minWidth:120}}),_.jsx("input",{className:"input",placeholder:"Role *",value:m,onChange:z=>g(z.target.value),style:{flex:1,minWidth:120}}),_.jsx("input",{className:"input",placeholder:"Email",type:"email",value:x,onChange:z=>v(z.target.value),style:{flex:1,minWidth:150}}),_.jsx("input",{className:"input",placeholder:"Phone",type:"tel",value:S,onChange:z=>A(z.target.value),style:{flex:1,minWidth:130}}),_.jsx("button",{onClick:F,className:"btn btn-accent",children:"Add Member"})]}),_.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[_.jsx("thead",{children:_.jsx("tr",{style:{borderBottom:"1px solid var(--border-default)"},children:["Name","Role","Email","Phone","Actions"].map((z,K)=>_.jsx("th",{style:{textAlign:K===4?"right":"left",padding:"8px 12px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em"},children:z},z))})}),_.jsxs("tbody",{children:[e.length===0&&_.jsx("tr",{children:_.jsx("td",{colSpan:5,style:{padding:"var(--sp-5)",textAlign:"center",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:"No team members yet"})}),e.map(z=>T===z.id?_.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-3)"},children:[_.jsx("td",{style:{padding:"6px 12px"},children:_.jsx("input",{className:"input",value:N,onChange:K=>R(K.target.value),style:{width:"100%",fontSize:"0.82rem"}})}),_.jsx("td",{style:{padding:"6px 12px"},children:_.jsx("input",{className:"input",value:O,onChange:K=>H(K.target.value),style:{width:"100%",fontSize:"0.82rem"}})}),_.jsx("td",{style:{padding:"6px 12px"},children:_.jsx("input",{className:"input",value:D,onChange:K=>q(K.target.value),style:{width:"100%",fontSize:"0.82rem"}})}),_.jsx("td",{style:{padding:"6px 12px"},children:_.jsx("input",{className:"input",value:Z,onChange:K=>V(K.target.value),style:{width:"100%",fontSize:"0.82rem"}})}),_.jsx("td",{style:{padding:"6px 12px",textAlign:"right"},children:_.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-2)"},children:[_.jsx("button",{onClick:P,className:"btn btn-sm btn-accent",children:"Save"}),_.jsx("button",{onClick:ee,className:"btn btn-sm",children:"Cancel"})]})})]},z.id):_.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[_.jsx("td",{style:{padding:"10px 12px",color:"var(--text-primary)",fontSize:"0.82rem"},children:z.name}),_.jsx("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:z.role}),_.jsx("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:z.email||"—"}),_.jsx("td",{style:{padding:"10px 12px",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)"},children:z.phone||"—"}),_.jsx("td",{style:{padding:"10px 12px",textAlign:"right"},children:l===z.id?_.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-2)",alignItems:"center"},children:[_.jsx("span",{style:{color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:"Confirm?"}),_.jsx("button",{onClick:()=>W(z.id),className:"btn btn-sm btn-danger",children:"Yes"}),_.jsx("button",{onClick:()=>c(null),className:"btn btn-sm",children:"No"})]}):_.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-2)"},children:[_.jsx("button",{onClick:()=>j(z),className:"btn btn-sm",children:"Edit"}),_.jsx("button",{onClick:()=>c(z.id),className:"btn btn-sm btn-danger",children:"Delete"})]})})]},z.id))]})]})]})}const EG={dev:"Development",messaging:"Messaging",ads:"Advertising",crm:"CRM",support:"Support",email:"Email Marketing",sales:"Sales & Payments",pm:"Project Management",monitoring:"Monitoring",cloud:"Cloud & Deploy",design:"Design"},wG={dev:"⌨",messaging:"💬",ads:"📢",crm:"📊",support:"🎧",email:"✉",sales:"💰",pm:"📋",monitoring:"🔍",cloud:"☁",design:"🎨"};function TG(){const[e,t]=L.useState([]),[n,i]=L.useState([]),[r,s]=L.useState(!0),[l,c]=L.useState(null),[f,p]=L.useState(null),[m,g]=L.useState(!1),[x,v]=L.useState({}),[S,A]=L.useState(!1),[T,C]=L.useState(null),[N,R]=L.useState(""),O=L.useCallback(async()=>{try{const[j,ee]=await Promise.all([fetch("/api/integrations/catalog",{credentials:"include"}),fetch("/api/integrations",{credentials:"include"})]);if(j.ok){const P=await j.json();t(P.providers)}if(ee.ok){const P=await ee.json();i(P.integrations)}}catch{c("Failed to load integrations")}finally{s(!1)}},[]);L.useEffect(()=>{O()},[O]);const H=j=>n.find(ee=>ee.provider===j),D=j=>{const ee=H(j.key),P={};for(const W of j.fields)P[W.key]=(ee==null?void 0:ee.config[W.key])||"";v(P),A((ee==null?void 0:ee.enabled)??!1),p(j.key),c(null)},q=async()=>{if(f){g(!0),c(null);try{const j=await fetch(`/api/integrations/${f}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:S,config:x}),credentials:"include"});if(!j.ok){const ee=await j.json();c(ee.error||"Failed to save");return}await O(),p(null)}catch{c("Network error")}finally{g(!1)}}},Z=async j=>{try{(await fetch(`/api/integrations/${j}`,{method:"DELETE",credentials:"include"})).ok&&(await O(),f===j&&p(null))}catch{c("Failed to disconnect")}},V=Array.from(new Set(e.map(j=>j.category))),Y=N.toLowerCase(),F=e.filter(j=>!(T&&j.category!==T||N&&!j.name.toLowerCase().includes(Y)&&!j.description.toLowerCase().includes(Y)));return r?_.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading integrations..."}):_.jsxs("div",{children:[_.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-2)"},children:"Integrations"}),_.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-muted)",marginBottom:"var(--sp-4)"},children:"Configure third-party services for your squads and agents"}),_.jsx("input",{className:"input",type:"text",placeholder:"Search integrations...",value:N,onChange:j=>R(j.target.value),style:{width:"100%",fontSize:"0.8rem",marginBottom:"var(--sp-3)"}}),l&&_.jsx("div",{style:{background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",padding:"var(--sp-2) var(--sp-3)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:l}),_.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[_.jsx("button",{onClick:()=>C(null),style:{padding:"4px 12px",border:"1px solid",borderColor:T?"var(--border-subtle)":"var(--accent)",borderRadius:"var(--radius-sm)",background:T?"transparent":"var(--accent)",color:T?"var(--text-secondary)":"#fff",fontFamily:"var(--font-mono)",fontSize:"0.7rem",cursor:"pointer"},children:"All"}),V.map(j=>_.jsxs("button",{onClick:()=>C(j),style:{padding:"4px 12px",border:"1px solid",borderColor:T===j?"var(--accent)":"var(--border-subtle)",borderRadius:"var(--radius-sm)",background:T===j?"var(--accent)":"transparent",color:T===j?"#fff":"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",cursor:"pointer"},children:[wG[j]||""," ",EG[j]||j]},j))]}),_.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(260px, 1fr))",gap:"var(--sp-3)"},children:F.map(j=>{const ee=H(j.key),P=f===j.key;return _.jsxs("div",{style:{background:"var(--surface-3)",border:"1px solid",borderColor:ee!=null&&ee.enabled?"var(--status-running)":"var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-3)",transition:"all var(--duration-fast) var(--ease-out)",gridColumn:P?"1 / -1":void 0},children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:P?"var(--sp-3)":0},children:[_.jsxs("div",{children:[_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[_.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:600,fontSize:"0.85rem",color:"var(--text-primary)"},children:j.name}),(ee==null?void 0:ee.enabled)&&_.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--status-running)",boxShadow:"0 0 4px var(--status-running)",display:"inline-block"}})]}),_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.68rem",color:"var(--text-muted)"},children:j.description})]}),_.jsx("button",{onClick:()=>P?p(null):D(j),className:"btn btn-sm",style:{flexShrink:0},children:P?"Close":ee?"Edit":"Configure"})]}),P&&_.jsxs("div",{style:{borderTop:"1px solid var(--border-subtle)",paddingTop:"var(--sp-3)"},children:[_.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)",cursor:"pointer"},children:[_.jsx("input",{type:"checkbox",checked:S,onChange:W=>A(W.target.checked)}),"Enabled"]}),_.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:j.fields.map(W=>_.jsxs("div",{children:[_.jsxs("label",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:2,display:"block"},children:[W.label," ",W.required&&"*"]}),_.jsx("input",{className:"input",type:W.type==="password"?"password":"text",placeholder:W.placeholder||"",value:x[W.key]||"",onChange:z=>v(K=>({...K,[W.key]:z.target.value})),style:{width:"100%",fontSize:"0.8rem"}})]},W.key))}),_.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginTop:"var(--sp-3)",justifyContent:"flex-end"},children:[ee&&_.jsx("button",{onClick:()=>Z(j.key),className:"btn btn-sm btn-danger",children:"Disconnect"}),_.jsx("button",{onClick:()=>p(null),className:"btn btn-sm",children:"Cancel"}),_.jsx("button",{onClick:q,className:"btn btn-sm btn-accent",disabled:m,children:m?"Saving...":"Save"})]})]})]},j.key)})})]})}function CG(){const e=gl(l=>l.user),t=(e==null?void 0:e.role)==="admin",[n,i]=L.useState(t?"users":"squad"),s=[{key:"users",label:"Users",icon:"◉",adminOnly:!0},{key:"team",label:"Team",icon:"◎"},{key:"integrations",label:"Integrations",icon:"⬡"},{key:"squad",label:"Squad",icon:"⬢"},{key:"server",label:"Server",icon:"⚙"},{key:"env",label:"Environment",icon:"◆",adminOnly:!0}].filter(l=>!l.adminOnly||t);return _.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",padding:"var(--sp-5)",animation:"fadeIn 0.4s var(--ease-out) both"},children:[_.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[_.jsx("h2",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.1rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Settings"}),_.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Configuration and management"})]}),_.jsx("div",{style:{display:"flex",gap:"var(--sp-1)",marginBottom:"var(--sp-5)",borderBottom:"1px solid var(--border-subtle)"},children:s.map(l=>_.jsxs("button",{onClick:()=>i(l.key),style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"10px 16px",border:"none",borderBottom:n===l.key?"2px solid var(--accent)":"2px solid transparent",background:"transparent",color:n===l.key?"var(--text-primary)":"var(--text-muted)",fontFamily:"var(--font-display)",fontWeight:n===l.key?600:400,fontSize:"0.82rem",cursor:"pointer",transition:"all var(--duration-fast) var(--ease-out)"},children:[_.jsx("span",{style:{fontSize:"0.75rem",opacity:.7},children:l.icon}),l.label]},l.key))}),_.jsxs("div",{style:{flex:1,overflow:"auto"},children:[n==="users"&&t&&_.jsx(yG,{}),n==="team"&&_.jsx(SG,{}),n==="integrations"&&_.jsx(TG,{}),n==="squad"&&_.jsx(xG,{}),n==="server"&&_.jsx(bG,{}),n==="env"&&t&&_.jsx(_G,{})]})]})}const uk=[{value:"0",label:"Domingo"},{value:"1",label:"Segunda"},{value:"2",label:"Terça"},{value:"3",label:"Quarta"},{value:"4",label:"Quinta"},{value:"5",label:"Sexta"},{value:"6",label:"Sábado"}];function AG(e,t){switch(e){case"every_n_minutes":return`*/${t.everyNMinutes||"30"} * * * *`;case"every_n_hours":return`${t.minute||"0"} */${t.everyNHours||"2"} * * *`;case"hourly":return`${t.minute||"0"} * * * *`;case"daily":return`${t.minute||"0"} ${t.hour||"9"} * * *`;case"weekly":return`${t.minute||"0"} ${t.hour||"9"} * * ${t.dayOfWeek||"1"}`;case"monthly":return`${t.minute||"0"} ${t.hour||"9"} ${t.dayOfMonth||"1"} * *`;case"custom":return"";default:return"0 9 * * *"}}function _v(e){var l;if(!e)return"";const t=e.split(" ");if(t.length!==5)return e;const[n,i,r,,s]=t;return n.startsWith("*/")?`A cada ${n.replace("*/","")} minutos`:i.startsWith("*/")?`A cada ${i.replace("*/","")} horas no minuto ${n}`:i==="*"&&r==="*"?`A cada hora no minuto ${n}`:r==="*"&&s==="*"?`Diariamente às ${i.padStart(2,"0")}:${n.padStart(2,"0")}`:r==="*"&&s!=="*"?`Semanalmente, ${((l=uk.find(f=>f.value===s))==null?void 0:l.label)||`dia ${s}`} às ${i.padStart(2,"0")}:${n.padStart(2,"0")}`:s==="*"&&r!=="*"?`Mensalmente, dia ${r} às ${i.padStart(2,"0")}:${n.padStart(2,"0")}`:e}function MG(e){if(e===null)return"—";if(e<1e3)return`${e}ms`;const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),i=t%60;if(n<60)return`${n}m ${i}s`;const r=Math.floor(n/60),s=n%60;return`${r}h ${s}m`}function dT(e){return e?new Date(e).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",year:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"—"}function RG(e){switch(e){case"completed":return{label:"Sucesso",color:"var(--status-active)"};case"failed":return{label:"Falhou",color:"var(--status-error)"};case"running":return{label:"Executando",color:"var(--status-warning)"};default:return{label:e,color:"var(--text-muted)"}}}const Kf={width:"100%",padding:"6px 10px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.78rem",outline:"none"},Ds={...Kf,cursor:"pointer",appearance:"none",backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 8px center",paddingRight:"28px"},oa={fontFamily:"var(--font-mono)",fontSize:"0.62rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:4,display:"block"},ts={padding:"6px 16px",borderRadius:"var(--radius-xs)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:600,cursor:"pointer",border:"none",transition:"all 0.15s ease"};function fT({children:e,onClose:t,title:n,wide:i}){return _.jsx("div",{"data-testid":"modal-overlay",onClick:r=>{r.target===r.currentTarget&&t()},style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"var(--sp-4)",animation:"fadeIn 0.15s var(--ease-out) both"},children:_.jsxs("div",{"data-testid":"modal-content",style:{background:"var(--surface-1)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-md)",width:"100%",maxWidth:i?900:560,maxHeight:"90vh",display:"flex",flexDirection:"column",animation:"fadeInUp 0.2s var(--ease-out) both"},children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)",flexShrink:0},children:[_.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.9rem",color:"var(--text-primary)"},children:n}),_.jsx("button",{onClick:t,style:{...ts,padding:"4px 8px",fontSize:"0.7rem",background:"none",border:"none",color:"var(--text-muted)"},children:"✕"})]}),_.jsx("div",{style:{overflow:"auto",flex:1},children:e})]})})}function kG(){var sr,Ee,ke;const e=ua(oe=>oe.jobs),t=ua(oe=>oe.loading),n=ua(oe=>oe.fetchJobs),i=ua(oe=>oe.createJob),r=ua(oe=>oe.deleteJob),s=ua(oe=>oe.pauseJob),l=ua(oe=>oe.resumeJob),c=ua(oe=>oe.triggerJob),f=ua(oe=>oe.history),p=ua(oe=>oe.historyLoading),m=ua(oe=>oe.fetchHistory),g=vr(oe=>oe.squads),[x,v]=L.useState(!1),[S,A]=L.useState(null),[T,C]=L.useState(null),[N,R]=L.useState(null),[O,H]=L.useState(""),[D,q]=L.useState(""),[Z,V]=L.useState("daily"),[Y,F]=L.useState("0"),[j,ee]=L.useState("9"),[P,W]=L.useState("1"),[z,K]=L.useState("1"),[G,Q]=L.useState("30"),[I,$]=L.useState("2"),[ne,X]=L.useState(""),[ce,ie]=L.useState(""),[de,xe]=L.useState("America/Sao_Paulo"),[me,le]=L.useState("30"),[Re,je]=L.useState("0");L.useEffect(()=>{n()},[n]);const Ie=L.useCallback(()=>{q(""),V("daily"),F("0"),ee("9"),W("1"),K("1"),Q("30"),$("2"),X(""),ie(""),xe("America/Sao_Paulo"),le("30"),je("0"),A(null)},[]),He=()=>{v(!1),Ie()},Qe=()=>{Ie(),v(!0)},ot=oe=>{q(oe.squad_name),ie(oe.prompt||""),xe(oe.timezone||"America/Sao_Paulo"),le(String(oe.timeout_minutes||30)),je(String(oe.retry_on_failure||0)),A(oe.squad_name);const Pe=oe.cron_expression.split(" ");if(Pe.length===5){const[ct,tn,ci,,Qt]=Pe;ct.startsWith("*/")?(V("every_n_minutes"),Q(ct.replace("*/",""))):tn.startsWith("*/")?(V("every_n_hours"),$(tn.replace("*/","")),F(ct)):tn==="*"?(V("hourly"),F(ct)):ci==="*"&&Qt==="*"?(V("daily"),F(ct),ee(tn)):ci==="*"&&Qt!=="*"?(V("weekly"),F(ct),ee(tn),W(Qt)):Qt==="*"&&ci!=="*"?(V("monthly"),F(ct),ee(tn),K(ci)):(V("custom"),X(oe.cron_expression))}else V("custom"),X(oe.cron_expression);v(!0)},Ue=Z==="custom"?ne:AG(Z,{minute:Y,hour:j,dayOfMonth:z,dayOfWeek:P,everyNMinutes:G,everyNHours:I}),wt=async()=>{if(!D||!Ue||!ce.trim())return;const oe={squad_name:D,cron_expression:Ue,prompt:ce.trim(),timezone:de||void 0,timeout_minutes:parseInt(me)||30,retry_on_failure:parseInt(Re)||0};await i(oe)&&He()},_n=oe=>{C(oe),R(null),m(oe)},Sn=()=>{C(null),R(null)},hn=oe=>oe==="active"?"var(--status-active)":oe==="paused"?"var(--status-warning)":"var(--status-error)",oi=oe=>oe==="active"?"var(--status-active-glow)":oe==="paused"?"var(--status-warning-glow)":"var(--status-error-glow)",Ur=g.filter(oe=>!e.some(Pe=>Pe.squad_name===oe.code)),Ci=O.toLowerCase(),Wt=O?e.filter(oe=>{var Pe;return oe.squad_name.toLowerCase().includes(Ci)||((Pe=oe.prompt)==null?void 0:Pe.toLowerCase().includes(Ci))||oe.status.toLowerCase().includes(Ci)||_v(oe.cron_expression).toLowerCase().includes(Ci)}):e;return _.jsxs("div",{style:{padding:"var(--sp-6)",animation:"fadeIn 0.4s var(--ease-out) both",width:"100%",boxSizing:"border-box"},children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"var(--sp-4)"},children:[_.jsxs("div",{children:[_.jsx("h2",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.1rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Scheduler"}),_.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Autonomous job execution and monitoring"})]}),_.jsx("button",{"data-testid":"btn-new-schedule",onClick:Qe,style:{...ts,background:"var(--accent)",color:"var(--text-inverse)"},children:"+ New Schedule"})]}),e.length>0&&_.jsx("div",{style:{marginBottom:"var(--sp-4)"},children:_.jsx("input",{"data-testid":"search-jobs",type:"text",placeholder:"Search by name, prompt, status...",value:O,onChange:oe=>H(oe.target.value),style:{...Kf,maxWidth:400,paddingLeft:32,backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"10px center"}})}),t&&_.jsx("p",{style:{color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading jobs..."}),!t&&e.length===0&&!x&&_.jsxs("div",{style:{padding:"var(--sp-8)",textAlign:"center",color:"var(--text-muted)"},children:[_.jsx("div",{style:{fontSize:"1.5rem",marginBottom:"var(--sp-3)"},children:"⏣"}),_.jsx("p",{style:{fontSize:"0.85rem",marginBottom:"var(--sp-2)"},children:"No scheduled jobs"}),_.jsxs("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:["Click ",_.jsx("strong",{children:"+ New Schedule"})," to create your first automated job."]})]}),_.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"var(--sp-3)",width:"100%"},children:Wt.map((oe,Pe)=>_.jsxs("div",{"data-testid":`job-${oe.squad_name}`,style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-3)",transition:"all var(--duration-fast) var(--ease-out)",animation:`fadeInUp 0.4s var(--ease-out) ${Pe*40}ms both`,display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[_.jsx("span",{style:{fontWeight:600,fontSize:"0.82rem",color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},children:oe.squad_name}),_.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:hn(oe.status),flexShrink:0,marginLeft:"var(--sp-2)"},children:[_.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:hn(oe.status),boxShadow:`0 0 8px ${oi(oe.status)}`,display:"inline-block",animation:oe.status==="active"?"statusPulse 2s ease-in-out infinite":"none"}}),oe.status]})]}),_.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-secondary)",display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[_.jsx("code",{style:{background:"var(--surface-3)",padding:"1px 5px",borderRadius:"var(--radius-xs)",fontSize:"0.6rem",flexShrink:0},children:oe.cron_expression}),_.jsx("span",{style:{color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:_v(oe.cron_expression)})]}),oe.prompt&&_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.63rem",color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4px 8px",background:"var(--surface-3)",borderRadius:"var(--radius-xs)"},children:oe.prompt}),oe.last_run_at&&_.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:["Last: ",new Date(oe.last_run_at).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"}),oe.last_result&&_.jsxs("span",{children:[" — ",oe.last_result]})]}),_.jsxs("div",{style:{display:"flex",gap:"var(--sp-1)",flexWrap:"wrap",marginTop:"auto"},children:[_.jsx("button",{onClick:()=>ot(oe),style:{...ts,padding:"3px 8px",fontSize:"0.62rem",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)"},children:"Edit"}),oe.status==="active"?_.jsx("button",{onClick:()=>s(oe.squad_name),style:{...ts,padding:"3px 8px",fontSize:"0.62rem",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",color:"var(--status-warning)"},children:"Pause"}):_.jsx("button",{onClick:()=>l(oe.squad_name),style:{...ts,padding:"3px 8px",fontSize:"0.62rem",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",color:"var(--status-active)"},children:"Resume"}),_.jsx("button",{onClick:()=>c(oe.squad_name),style:{...ts,padding:"3px 8px",fontSize:"0.62rem",background:"var(--accent)",color:"var(--text-inverse)"},children:"Trigger"}),_.jsx("button",{"data-testid":`btn-history-${oe.squad_name}`,onClick:()=>_n(oe.squad_name),style:{...ts,padding:"3px 8px",fontSize:"0.62rem",background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-muted)"},children:"Log"}),_.jsx("button",{onClick:()=>{confirm(`Delete schedule for ${oe.squad_name}?`)&&r(oe.squad_name)},style:{...ts,padding:"3px 6px",fontSize:"0.62rem",background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-muted)",marginLeft:"auto"},title:"Delete schedule",children:"✕"})]})]},oe.squad_name))}),!t&&O&&Wt.length===0&&e.length>0&&_.jsxs("div",{style:{padding:"var(--sp-6)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)"},children:['No jobs matching "',O,'"']}),x&&_.jsx(fT,{title:S?"Edit Schedule":"New Schedule",onClose:He,children:_.jsxs("div",{"data-testid":"schedule-form",style:{padding:"var(--sp-4)"},children:[_.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[_.jsx("label",{style:oa,children:"Squad"}),S?_.jsx("div",{style:{...Kf,background:"var(--surface-3)",color:"var(--text-secondary)"},children:S}):_.jsxs("select",{"data-testid":"select-squad",value:D,onChange:oe=>q(oe.target.value),style:Ds,children:[_.jsx("option",{value:"",children:"Select a squad..."}),Ur.map(oe=>_.jsxs("option",{value:oe.code,children:[oe.name," (",oe.code,")"]},oe.code)),e.length===0&&g.length===0&&_.jsx("option",{disabled:!0,children:"No squads available"})]})]}),_.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[_.jsx("label",{style:oa,children:"Frequency"}),_.jsxs("select",{"data-testid":"select-frequency",value:Z,onChange:oe=>V(oe.target.value),style:Ds,children:[_.jsx("option",{value:"every_n_minutes",children:"Every N minutes"}),_.jsx("option",{value:"every_n_hours",children:"Every N hours"}),_.jsx("option",{value:"hourly",children:"Hourly"}),_.jsx("option",{value:"daily",children:"Daily"}),_.jsx("option",{value:"weekly",children:"Weekly"}),_.jsx("option",{value:"monthly",children:"Monthly"}),_.jsx("option",{value:"custom",children:"Custom cron"})]})]}),_.jsxs("div",{style:{display:"flex",gap:"var(--sp-3)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[Z==="every_n_minutes"&&_.jsxs("div",{style:{flex:1,minWidth:120},children:[_.jsx("label",{style:oa,children:"Every (minutes)"}),_.jsx("select",{value:G,onChange:oe=>Q(oe.target.value),style:Ds,children:[1,2,5,10,15,20,30].map(oe=>_.jsx("option",{value:String(oe),children:oe},oe))})]}),Z==="every_n_hours"&&_.jsxs(_.Fragment,{children:[_.jsxs("div",{style:{flex:1,minWidth:120},children:[_.jsx("label",{style:oa,children:"Every (hours)"}),_.jsx("select",{value:I,onChange:oe=>$(oe.target.value),style:Ds,children:[2,3,4,6,8,12].map(oe=>_.jsx("option",{value:String(oe),children:oe},oe))})]}),_.jsxs("div",{style:{flex:1,minWidth:100},children:[_.jsx("label",{style:oa,children:"At minute"}),_.jsx("select",{value:Y,onChange:oe=>F(oe.target.value),style:Ds,children:Array.from({length:60},(oe,Pe)=>_.jsx("option",{value:String(Pe),children:String(Pe).padStart(2,"0")},Pe))})]})]}),Z==="hourly"&&_.jsxs("div",{style:{flex:1,minWidth:120},children:[_.jsx("label",{style:oa,children:"At minute"}),_.jsx("select",{value:Y,onChange:oe=>F(oe.target.value),style:Ds,children:Array.from({length:60},(oe,Pe)=>_.jsx("option",{value:String(Pe),children:String(Pe).padStart(2,"0")},Pe))})]}),(Z==="daily"||Z==="weekly"||Z==="monthly")&&_.jsxs(_.Fragment,{children:[_.jsxs("div",{style:{flex:1,minWidth:100},children:[_.jsx("label",{style:oa,children:"Hour"}),_.jsx("select",{value:j,onChange:oe=>ee(oe.target.value),style:Ds,children:Array.from({length:24},(oe,Pe)=>_.jsx("option",{value:String(Pe),children:String(Pe).padStart(2,"0")},Pe))})]}),_.jsxs("div",{style:{flex:1,minWidth:100},children:[_.jsx("label",{style:oa,children:"Minute"}),_.jsx("select",{value:Y,onChange:oe=>F(oe.target.value),style:Ds,children:Array.from({length:60},(oe,Pe)=>_.jsx("option",{value:String(Pe),children:String(Pe).padStart(2,"0")},Pe))})]})]}),Z==="weekly"&&_.jsxs("div",{style:{flex:1,minWidth:140},children:[_.jsx("label",{style:oa,children:"Day of week"}),_.jsx("select",{value:P,onChange:oe=>W(oe.target.value),style:Ds,children:uk.map(oe=>_.jsx("option",{value:oe.value,children:oe.label},oe.value))})]}),Z==="monthly"&&_.jsxs("div",{style:{flex:1,minWidth:120},children:[_.jsx("label",{style:oa,children:"Day of month"}),_.jsx("select",{value:z,onChange:oe=>K(oe.target.value),style:Ds,children:Array.from({length:31},(oe,Pe)=>_.jsx("option",{value:String(Pe+1),children:Pe+1},Pe+1))})]}),Z==="custom"&&_.jsxs("div",{style:{flex:1,minWidth:200},children:[_.jsx("label",{style:oa,children:"Cron expression"}),_.jsx("input",{type:"text",placeholder:"* * * * *",value:ne,onChange:oe=>X(oe.target.value),style:Kf})]})]}),Ue&&_.jsxs("div",{style:{marginBottom:"var(--sp-4)",padding:"8px 12px",background:"var(--surface-3)",borderRadius:"var(--radius-xs)",border:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[_.jsx("code",{style:{color:"var(--accent)",fontWeight:600},children:Ue}),_.jsx("span",{style:{color:"var(--text-muted)"},children:"—"}),_.jsx("span",{"data-testid":"cron-preview",style:{color:"var(--text-secondary)"},children:_v(Ue)})]}),_.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[_.jsx("label",{style:oa,children:"Instruction for the agent"}),_.jsx("textarea",{"data-testid":"input-prompt",placeholder:"What should the squad do on each execution?",value:ce,onChange:oe=>ie(oe.target.value),rows:3,style:{...Kf,resize:"vertical",lineHeight:1.5}})]}),_.jsxs("div",{style:{display:"flex",gap:"var(--sp-3)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[_.jsxs("div",{style:{flex:2,minWidth:180},children:[_.jsx("label",{style:oa,children:"Timezone"}),_.jsxs("select",{value:de,onChange:oe=>xe(oe.target.value),style:Ds,children:[_.jsx("option",{value:"America/Sao_Paulo",children:"America/Sao_Paulo"}),_.jsx("option",{value:"America/New_York",children:"America/New_York"}),_.jsx("option",{value:"America/Chicago",children:"America/Chicago"}),_.jsx("option",{value:"America/Los_Angeles",children:"America/Los_Angeles"}),_.jsx("option",{value:"Europe/London",children:"Europe/London"}),_.jsx("option",{value:"Europe/Berlin",children:"Europe/Berlin"}),_.jsx("option",{value:"Asia/Tokyo",children:"Asia/Tokyo"}),_.jsx("option",{value:"UTC",children:"UTC"})]})]}),_.jsxs("div",{style:{flex:1,minWidth:100},children:[_.jsx("label",{style:oa,children:"Timeout (min)"}),_.jsx("input",{type:"number",min:1,max:480,value:me,onChange:oe=>le(oe.target.value),style:Kf})]}),_.jsxs("div",{style:{flex:1,minWidth:100},children:[_.jsx("label",{style:oa,children:"Retries"}),_.jsx("select",{value:Re,onChange:oe=>je(oe.target.value),style:Ds,children:[0,1,2,3,4,5].map(oe=>_.jsx("option",{value:String(oe),children:oe},oe))})]})]}),_.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[_.jsx("button",{"data-testid":"btn-save-schedule",onClick:wt,disabled:!D||!Ue||!ce.trim(),style:{...ts,background:D&&Ue&&ce.trim()?"var(--accent)":"var(--surface-4)",color:D&&Ue&&ce.trim()?"var(--text-inverse)":"var(--text-muted)"},children:S?"Update":"Create"}),_.jsx("button",{onClick:He,style:{...ts,background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)"},children:"Cancel"})]})]})}),T&&_.jsx(fT,{title:`Execution Log — ${T}`,onClose:Sn,wide:!0,children:_.jsxs("div",{"data-testid":`history-${T}`,children:[_.jsx("div",{style:{display:"flex",justifyContent:"flex-end",padding:"6px 12px",borderBottom:"1px solid var(--border-subtle)"},children:_.jsxs("button",{"data-testid":`btn-refresh-${T}`,onClick:()=>m(T),disabled:p[T],style:{...ts,padding:"3px 10px",fontSize:"0.62rem",background:"none",border:"1px solid var(--border-subtle)",color:p[T]?"var(--text-muted)":"var(--text-secondary)",display:"inline-flex",alignItems:"center",gap:4},children:[_.jsx("span",{style:{display:"inline-block",animation:p[T]?"spin 1s linear infinite":"none"},children:"↻"}),"Refresh"]})}),p[T]&&_.jsx("div",{style:{padding:"var(--sp-3)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Loading..."}),!p[T]&&(!f[T]||f[T].length===0)&&_.jsx("div",{style:{padding:"var(--sp-6)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"No executions recorded yet."}),!p[T]&&((sr=f[T])==null?void 0:sr.length)>0&&_.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontFamily:"var(--font-mono)",fontSize:"0.68rem"},children:[_.jsx("thead",{children:_.jsx("tr",{style:{background:"var(--surface-3)"},children:["Status","Started","Finished","Duration","Attempt","Output"].map(oe=>_.jsx("th",{style:{padding:"6px 8px",textAlign:"left",fontWeight:600,fontSize:"0.6rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-muted)",borderBottom:"1px solid var(--border-subtle)"},children:oe},oe))})}),_.jsx("tbody",{children:f[T].map(oe=>{const Pe=RG(oe.status),ct=N===oe.id;return _.jsxs("tr",{"data-testid":`activity-${oe.id}`,style:{borderBottom:"1px solid var(--border-subtle)",transition:"background 0.1s"},onMouseEnter:tn=>{tn.currentTarget.style.background="var(--surface-3)"},onMouseLeave:tn=>{tn.currentTarget.style.background="transparent"},children:[_.jsx("td",{style:{padding:"6px 8px"},children:_.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,color:Pe.color,fontWeight:600},children:[_.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:Pe.color,display:"inline-block",animation:oe.status==="running"?"statusPulse 2s ease-in-out infinite":"none"}}),Pe.label]})}),_.jsx("td",{style:{padding:"6px 8px",color:"var(--text-secondary)"},children:dT(oe.started_at)}),_.jsx("td",{style:{padding:"6px 8px",color:"var(--text-secondary)"},children:dT(oe.finished_at)}),_.jsx("td",{style:{padding:"6px 8px",color:"var(--text-secondary)",fontVariantNumeric:"tabular-nums"},children:MG(oe.duration_ms)}),_.jsx("td",{style:{padding:"6px 8px",color:"var(--text-muted)",textAlign:"center"},children:oe.attempt??1}),_.jsx("td",{style:{padding:"6px 8px"},children:oe.result_summary?_.jsx("button",{"data-testid":`btn-output-${oe.id}`,onClick:()=>R(ct?null:oe.id),style:{...ts,padding:"2px 8px",fontSize:"0.62rem",background:ct?"var(--accent)":"var(--surface-4)",color:ct?"var(--text-inverse)":"var(--text-secondary)",border:"none"},children:ct?"Hide":"View"}):_.jsx("span",{style:{color:"var(--text-muted)"},children:"—"})})]},oe.id)})})]}),N&&((Ee=f[T])==null?void 0:Ee.find(oe=>oe.id===N))&&_.jsxs("div",{"data-testid":`output-panel-${N}`,style:{padding:"var(--sp-3)",background:"var(--surface-0)",borderTop:"1px solid var(--border-subtle)"},children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-2)"},children:[_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-muted)"},children:"Output"}),_.jsx("button",{onClick:()=>R(null),style:{...ts,padding:"2px 6px",fontSize:"0.6rem",background:"none",border:"none",color:"var(--text-muted)"},children:"✕"})]}),_.jsx("pre",{style:{fontFamily:"var(--font-mono)",fontSize:"0.68rem",color:"var(--text-secondary)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0,lineHeight:1.6,padding:"var(--sp-3)",background:"var(--surface-2)",borderRadius:"var(--radius-xs)",border:"1px solid var(--border-subtle)"},children:(ke=f[T].find(oe=>oe.id===N))==null?void 0:ke.result_summary})]})]})})]})}const hl=fu(e=>({leads:[],campaigns:[],lists:[],tags:[],total:0,loading:!1,fetchLeads:async(t={})=>{e({loading:!0});try{const n=new URLSearchParams(t),i=await fetch(`/api/email/leads?${n}`);if(i.ok){const r=await i.json();e({leads:r.data,total:r.total})}}finally{e({loading:!1})}},fetchCampaigns:async(t={})=>{e({loading:!0});try{const n=new URLSearchParams(t),i=await fetch(`/api/email/campaigns?${n}`);if(i.ok){const r=await i.json();e({campaigns:r.data})}}finally{e({loading:!1})}},fetchLists:async()=>{const t=await fetch("/api/email/leads/lists");if(t.ok){const n=await t.json();e({lists:n.lists})}},fetchTags:async()=>{const t=await fetch("/api/email/leads/tags");if(t.ok){const n=await t.json();e({tags:n.tags})}}}));function NG(){const e=hl(g=>g.leads),t=hl(g=>g.total),n=hl(g=>g.lists),i=hl(g=>g.tags),r=hl(g=>g.loading),s=hl(g=>g.fetchLeads),l=hl(g=>g.fetchLists),c=hl(g=>g.fetchTags),[f,p]=L.useState("");L.useEffect(()=>{s(),l(),c()},[s,l,c]);const m=()=>{s(f?{search:f}:{})};return _.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:[_.jsxs("div",{style:{display:"flex",gap:"var(--sp-3)"},children:[_.jsx(Sv,{label:"Total Leads",value:t}),_.jsx(Sv,{label:"Lists",value:n.length}),_.jsx(Sv,{label:"Tags",value:i.length})]}),_.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[_.jsx("input",{type:"text",placeholder:"Search leads...",value:f,onChange:g=>p(g.target.value),onKeyDown:g=>g.key==="Enter"&&m(),style:{flex:1,padding:"8px 12px",background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",color:"var(--text-primary)",fontFamily:"var(--font-body)",fontSize:"0.82rem"}}),_.jsx("button",{onClick:m,className:"btn-ghost",style:{padding:"8px 16px",background:"var(--accent-glow)",border:"1px solid rgba(0, 200, 255, 0.2)",borderRadius:"var(--radius-sm)",color:"var(--accent)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Search"})]}),r?_.jsx("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."}):_.jsx("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",overflow:"hidden"},children:_.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[_.jsx("thead",{children:_.jsx("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["Email","Name","Company","Status","Source","Created"].map(g=>_.jsx("th",{style:{textAlign:"left",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600},children:g},g))})}),_.jsxs("tbody",{children:[e.map(g=>_.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[_.jsx("td",{style:fa,children:g.email}),_.jsx("td",{style:fa,children:g.name||"—"}),_.jsx("td",{style:fa,children:g.company||"—"}),_.jsx("td",{style:fa,children:_.jsx(dk,{status:g.status})}),_.jsx("td",{style:fa,children:g.source||"—"}),_.jsx("td",{style:{...fa,fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:new Date(g.created_at).toLocaleDateString()})]},g.id)),e.length===0&&_.jsx("tr",{children:_.jsx("td",{colSpan:6,style:{...fa,textAlign:"center",color:"var(--text-muted)"},children:"No leads found"})})]})]})})]})}function OG(){const e=hl(i=>i.campaigns),t=hl(i=>i.loading),n=hl(i=>i.fetchCampaigns);return L.useEffect(()=>{n()},[n]),_.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:t?_.jsx("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."}):_.jsx("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",overflow:"hidden"},children:_.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[_.jsx("thead",{children:_.jsx("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["Name","Subject","Status","Recipients","Sent","Bounced","Created"].map(i=>_.jsx("th",{style:{textAlign:"left",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600},children:i},i))})}),_.jsxs("tbody",{children:[e.map(i=>_.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[_.jsx("td",{style:fa,children:i.name}),_.jsx("td",{style:fa,children:i.subject}),_.jsx("td",{style:fa,children:_.jsx(dk,{status:i.status})}),_.jsx("td",{style:{...fa,fontFamily:"var(--font-mono)"},children:i.total_recipients}),_.jsx("td",{style:{...fa,fontFamily:"var(--font-mono)"},children:i.sent_count}),_.jsx("td",{style:{...fa,fontFamily:"var(--font-mono)"},children:i.bounce_count}),_.jsx("td",{style:{...fa,fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:new Date(i.created_at).toLocaleDateString()})]},i.id)),e.length===0&&_.jsx("tr",{children:_.jsx("td",{colSpan:7,style:{...fa,textAlign:"center",color:"var(--text-muted)"},children:"No campaigns yet"})})]})]})})})}function DG(){return _.jsxs("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-4)"},children:[_.jsx("h3",{style:{fontFamily:"var(--font-display)",fontSize:"0.9rem",color:"var(--text-primary)",marginBottom:"var(--sp-3)"},children:"Amazon SES Configuration"}),_.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)",lineHeight:1.8},children:[_.jsx("p",{children:"Configure these environment variables on the server:"}),_.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",padding:"var(--sp-3)",marginTop:"var(--sp-2)"},children:[_.jsx("code",{children:"AWS_ACCESS_KEY_ID=..."}),_.jsx("br",{}),_.jsx("code",{children:"AWS_SECRET_ACCESS_KEY=..."}),_.jsx("br",{}),_.jsx("code",{children:"AWS_REGION=us-east-1"}),_.jsx("br",{}),_.jsx("code",{children:"SES_FROM_EMAIL=noreply@yourdomain.com"}),_.jsx("br",{}),_.jsx("code",{children:"SES_RATE_LIMIT=14"}),_.jsx("br",{}),_.jsx("code",{children:"SERVER_URL=https://yourdomain.com"})]})]})]})}function Sv({label:e,value:t}){return _.jsxs("div",{style:{flex:1,background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-3)"},children:[_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:e}),_.jsx("div",{style:{fontFamily:"var(--font-display)",fontSize:"1.4rem",fontWeight:700,color:"var(--accent)"},children:t})]})}function dk({status:e}){const n={active:{bg:"rgba(0, 230, 138, 0.1)",text:"var(--status-active)"},unsubscribed:{bg:"rgba(255, 100, 100, 0.1)",text:"var(--status-error)"},draft:{bg:"rgba(150, 150, 150, 0.1)",text:"var(--text-muted)"},queued:{bg:"rgba(0, 200, 255, 0.1)",text:"var(--accent)"},sending:{bg:"rgba(255, 180, 0, 0.1)",text:"var(--status-warning)"},sent:{bg:"rgba(0, 230, 138, 0.1)",text:"var(--status-active)"},paused:{bg:"rgba(255, 180, 0, 0.1)",text:"var(--status-warning)"},cancelled:{bg:"rgba(255, 100, 100, 0.1)",text:"var(--status-error)"}}[e]||{bg:"rgba(150, 150, 150, 0.1)",text:"var(--text-muted)"};return _.jsx("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"var(--radius-xs)",background:n.bg,color:n.text,fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em"},children:e})}const fa={padding:"10px 14px",fontSize:"0.82rem",color:"var(--text-secondary)"};function zG(){const[e,t]=L.useState("leads"),n=[{key:"leads",label:"Leads"},{key:"campaigns",label:"Campaigns"},{key:"settings",label:"Settings"}];return _.jsxs("div",{style:{padding:"var(--sp-4)",maxWidth:1100,margin:"0 auto"},children:[_.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[_.jsx("h2",{style:{fontFamily:"var(--font-display)",fontSize:"1.1rem",fontWeight:700,color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Email Engine"}),_.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Lead management, campaigns, and Amazon SES integration"})]}),_.jsx("div",{style:{display:"flex",gap:"var(--sp-1)",marginBottom:"var(--sp-4)",borderBottom:"1px solid var(--border-subtle)",paddingBottom:"var(--sp-1)"},children:n.map(i=>_.jsx("button",{onClick:()=>t(i.key),style:{padding:"8px 16px",background:e===i.key?"var(--accent-glow)":"transparent",border:e===i.key?"1px solid rgba(0, 200, 255, 0.15)":"1px solid transparent",borderRadius:"var(--radius-sm)",color:e===i.key?"var(--accent)":"var(--text-secondary)",cursor:"pointer",fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:e===i.key?600:400,transition:"all var(--duration-fast) var(--ease-out)"},children:i.label},i.key))}),e==="leads"&&_.jsx(NG,{}),e==="campaigns"&&_.jsx(OG,{}),e==="settings"&&_.jsx(DG,{})]})}function zi(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n<e.length;n++)(i=zi(e[n]))!==""&&(t+=(t&&" ")+i);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var BG={value:()=>{}};function fx(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new b0(n)}function b0(e){this._=e}function LG(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}b0.prototype=fx.prototype={constructor:b0,on:function(e,t){var n=this._,i=LG(e+"",n),r,s=-1,l=i.length;if(arguments.length<2){for(;++s<l;)if((r=(e=i[s]).type)&&(r=jG(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<l;)if(r=(e=i[s]).type)n[r]=hT(n[r],e.name,t);else if(t==null)for(r in n)n[r]=hT(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new b0(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)}};function jG(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function hT(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=BG,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var k1="http://www.w3.org/1999/xhtml";const pT={svg:"http://www.w3.org/2000/svg",xhtml:k1,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function hx(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),pT.hasOwnProperty(t)?{space:pT[t],local:e}:e}function IG(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===k1&&t.documentElement.namespaceURI===k1?t.createElement(e):t.createElementNS(n,e)}}function UG(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function fk(e){var t=hx(e);return(t.local?UG:IG)(t)}function HG(){}function I_(e){return e==null?HG:function(){return this.querySelector(e)}}function PG(e){typeof e!="function"&&(e=I_(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],l=s.length,c=i[r]=new Array(l),f,p,m=0;m<l;++m)(f=s[m])&&(p=e.call(f,f.__data__,m,s))&&("__data__"in f&&(p.__data__=f.__data__),c[m]=p);return new as(i,this._parents)}function FG(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function GG(){return[]}function hk(e){return e==null?GG:function(){return this.querySelectorAll(e)}}function qG(e){return function(){return FG(e.apply(this,arguments))}}function YG(e){typeof e=="function"?e=qG(e):e=hk(e);for(var t=this._groups,n=t.length,i=[],r=[],s=0;s<n;++s)for(var l=t[s],c=l.length,f,p=0;p<c;++p)(f=l[p])&&(i.push(e.call(f,f.__data__,p,l)),r.push(f));return new as(i,r)}function pk(e){return function(){return this.matches(e)}}function mk(e){return function(t){return t.matches(e)}}var VG=Array.prototype.find;function XG(e){return function(){return VG.call(this.children,e)}}function KG(){return this.firstElementChild}function $G(e){return this.select(e==null?KG:XG(typeof e=="function"?e:mk(e)))}var WG=Array.prototype.filter;function QG(){return Array.from(this.children)}function ZG(e){return function(){return WG.call(this.children,e)}}function JG(e){return this.selectAll(e==null?QG:ZG(typeof e=="function"?e:mk(e)))}function eq(e){typeof e!="function"&&(e=pk(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],l=s.length,c=i[r]=[],f,p=0;p<l;++p)(f=s[p])&&e.call(f,f.__data__,p,s)&&c.push(f);return new as(i,this._parents)}function gk(e){return new Array(e.length)}function tq(){return new as(this._enter||this._groups.map(gk),this._parents)}function H0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}H0.prototype={constructor:H0,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function nq(e){return function(){return e}}function iq(e,t,n,i,r,s){for(var l=0,c,f=t.length,p=s.length;l<p;++l)(c=t[l])?(c.__data__=s[l],i[l]=c):n[l]=new H0(e,s[l]);for(;l<f;++l)(c=t[l])&&(r[l]=c)}function rq(e,t,n,i,r,s,l){var c,f,p=new Map,m=t.length,g=s.length,x=new Array(m),v;for(c=0;c<m;++c)(f=t[c])&&(x[c]=v=l.call(f,f.__data__,c,t)+"",p.has(v)?r[c]=f:p.set(v,f));for(c=0;c<g;++c)v=l.call(e,s[c],c,s)+"",(f=p.get(v))?(i[c]=f,f.__data__=s[c],p.delete(v)):n[c]=new H0(e,s[c]);for(c=0;c<m;++c)(f=t[c])&&p.get(x[c])===f&&(r[c]=f)}function aq(e){return e.__data__}function sq(e,t){if(!arguments.length)return Array.from(this,aq);var n=t?rq:iq,i=this._parents,r=this._groups;typeof e!="function"&&(e=nq(e));for(var s=r.length,l=new Array(s),c=new Array(s),f=new Array(s),p=0;p<s;++p){var m=i[p],g=r[p],x=g.length,v=lq(e.call(m,m&&m.__data__,p,i)),S=v.length,A=c[p]=new Array(S),T=l[p]=new Array(S),C=f[p]=new Array(x);n(m,g,A,T,C,v,t);for(var N=0,R=0,O,H;N<S;++N)if(O=A[N]){for(N>=R&&(R=N+1);!(H=T[R])&&++R<S;);O._next=H||null}}return l=new as(l,i),l._enter=c,l._exit=f,l}function lq(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function oq(){return new as(this._exit||this._groups.map(gk),this._parents)}function cq(e,t,n){var i=this.enter(),r=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?s.remove():n(s),i&&r?i.merge(r).order():r}function uq(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,r=n.length,s=i.length,l=Math.min(r,s),c=new Array(r),f=0;f<l;++f)for(var p=n[f],m=i[f],g=p.length,x=c[f]=new Array(g),v,S=0;S<g;++S)(v=p[S]||m[S])&&(x[S]=v);for(;f<r;++f)c[f]=n[f];return new as(c,this._parents)}function dq(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i=e[t],r=i.length-1,s=i[r],l;--r>=0;)(l=i[r])&&(s&&l.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(l,s),s=l);return this}function fq(e){e||(e=hq);function t(g,x){return g&&x?e(g.__data__,x.__data__):!g-!x}for(var n=this._groups,i=n.length,r=new Array(i),s=0;s<i;++s){for(var l=n[s],c=l.length,f=r[s]=new Array(c),p,m=0;m<c;++m)(p=l[m])&&(f[m]=p);f.sort(t)}return new as(r,this._parents).order()}function hq(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function pq(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function mq(){return Array.from(this)}function gq(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,s=i.length;r<s;++r){var l=i[r];if(l)return l}return null}function yq(){let e=0;for(const t of this)++e;return e}function xq(){return!this.node()}function bq(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var r=t[n],s=0,l=r.length,c;s<l;++s)(c=r[s])&&e.call(c,c.__data__,s,r);return this}function vq(e){return function(){this.removeAttribute(e)}}function _q(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Sq(e,t){return function(){this.setAttribute(e,t)}}function Eq(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function wq(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Tq(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Cq(e,t){var n=hx(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((t==null?n.local?_q:vq:typeof t=="function"?n.local?Tq:wq:n.local?Eq:Sq)(n,t))}function yk(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Aq(e){return function(){this.style.removeProperty(e)}}function Mq(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Rq(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function kq(e,t,n){return arguments.length>1?this.each((t==null?Aq:typeof t=="function"?Rq:Mq)(e,t,n??"")):hh(this.node(),e)}function hh(e,t){return e.style.getPropertyValue(t)||yk(e).getComputedStyle(e,null).getPropertyValue(t)}function Nq(e){return function(){delete this[e]}}function Oq(e,t){return function(){this[e]=t}}function Dq(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function zq(e,t){return arguments.length>1?this.each((t==null?Nq:typeof t=="function"?Dq:Oq)(e,t)):this.node()[e]}function xk(e){return e.trim().split(/^|\s+/)}function U_(e){return e.classList||new bk(e)}function bk(e){this._node=e,this._names=xk(e.getAttribute("class")||"")}bk.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function vk(e,t){for(var n=U_(e),i=-1,r=t.length;++i<r;)n.add(t[i])}function _k(e,t){for(var n=U_(e),i=-1,r=t.length;++i<r;)n.remove(t[i])}function Bq(e){return function(){vk(this,e)}}function Lq(e){return function(){_k(this,e)}}function jq(e,t){return function(){(t.apply(this,arguments)?vk:_k)(this,e)}}function Iq(e,t){var n=xk(e+"");if(arguments.length<2){for(var i=U_(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?jq:t?Bq:Lq)(n,t))}function Uq(){this.textContent=""}function Hq(e){return function(){this.textContent=e}}function Pq(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Fq(e){return arguments.length?this.each(e==null?Uq:(typeof e=="function"?Pq:Hq)(e)):this.node().textContent}function Gq(){this.innerHTML=""}function qq(e){return function(){this.innerHTML=e}}function Yq(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Vq(e){return arguments.length?this.each(e==null?Gq:(typeof e=="function"?Yq:qq)(e)):this.node().innerHTML}function Xq(){this.nextSibling&&this.parentNode.appendChild(this)}function Kq(){return this.each(Xq)}function $q(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Wq(){return this.each($q)}function Qq(e){var t=typeof e=="function"?e:fk(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Zq(){return null}function Jq(e,t){var n=typeof e=="function"?e:fk(e),i=t==null?Zq:typeof t=="function"?t:I_(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function eY(){var e=this.parentNode;e&&e.removeChild(this)}function tY(){return this.each(eY)}function nY(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function iY(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function rY(e){return this.select(e?iY:nY)}function aY(e){return arguments.length?this.property("__data__",e):this.node().__data__}function sY(e){return function(t){e.call(this,t,this.__data__)}}function lY(e){return e.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function oY(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n<r;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function cY(e,t,n){return function(){var i=this.__on,r,s=sY(t);if(i){for(var l=0,c=i.length;l<c;++l)if((r=i[l]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=n),r.value=t;return}}this.addEventListener(e.type,s,n),r={type:e.type,name:e.name,value:t,listener:s,options:n},i?i.push(r):this.__on=[r]}}function uY(e,t,n){var i=lY(e+""),r,s=i.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var f=0,p=c.length,m;f<p;++f)for(r=0,m=c[f];r<s;++r)if((l=i[r]).type===m.type&&l.name===m.name)return m.value}return}for(c=t?cY:oY,r=0;r<s;++r)this.each(c(i[r],t,n));return this}function Sk(e,t,n){var i=yk(e),r=i.CustomEvent;typeof r=="function"?r=new r(t,n):(r=i.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function dY(e,t){return function(){return Sk(this,e,t)}}function fY(e,t){return function(){return Sk(this,e,t.apply(this,arguments))}}function hY(e,t){return this.each((typeof t=="function"?fY:dY)(e,t))}function*pY(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,s=i.length,l;r<s;++r)(l=i[r])&&(yield l)}var Ek=[null];function as(e,t){this._groups=e,this._parents=t}function rg(){return new as([[document.documentElement]],Ek)}function mY(){return this}as.prototype=rg.prototype={constructor:as,select:PG,selectAll:YG,selectChild:$G,selectChildren:JG,filter:eq,data:sq,enter:tq,exit:oq,join:cq,merge:uq,selection:mY,order:dq,sort:fq,call:pq,nodes:mq,node:gq,size:yq,empty:xq,each:bq,attr:Cq,style:kq,property:zq,classed:Iq,text:Fq,html:Vq,raise:Kq,lower:Wq,append:Qq,insert:Jq,remove:tY,clone:rY,datum:aY,on:uY,dispatch:hY,[Symbol.iterator]:pY};function ns(e){return typeof e=="string"?new as([[document.querySelector(e)]],[document.documentElement]):new as([[e]],Ek)}function gY(e){let t;for(;t=e.sourceEvent;)e=t;return e}function pl(e,t){if(e=gY(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const yY={passive:!1},Um={capture:!0,passive:!1};function Ev(e){e.stopImmediatePropagation()}function ih(e){e.preventDefault(),e.stopImmediatePropagation()}function wk(e){var t=e.document.documentElement,n=ns(e).on("dragstart.drag",ih,Um);"onselectstart"in t?n.on("selectstart.drag",ih,Um):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Tk(e,t){var n=e.document.documentElement,i=ns(e).on("dragstart.drag",null);t&&(i.on("click.drag",ih,Um),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const r0=e=>()=>e;function N1(e,{sourceEvent:t,subject:n,target:i,identifier:r,active:s,x:l,y:c,dx:f,dy:p,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:m}})}N1.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function xY(e){return!e.ctrlKey&&!e.button}function bY(){return this.parentNode}function vY(e,t){return t??{x:e.x,y:e.y}}function _Y(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ck(){var e=xY,t=bY,n=vY,i=_Y,r={},s=fx("start","drag","end"),l=0,c,f,p,m,g=0;function x(O){O.on("mousedown.drag",v).filter(i).on("touchstart.drag",T).on("touchmove.drag",C,yY).on("touchend.drag touchcancel.drag",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(O,H){if(!(m||!e.call(this,O,H))){var D=R(this,t.call(this,O,H),O,H,"mouse");D&&(ns(O.view).on("mousemove.drag",S,Um).on("mouseup.drag",A,Um),wk(O.view),Ev(O),p=!1,c=O.clientX,f=O.clientY,D("start",O))}}function S(O){if(ih(O),!p){var H=O.clientX-c,D=O.clientY-f;p=H*H+D*D>g}r.mouse("drag",O)}function A(O){ns(O.view).on("mousemove.drag mouseup.drag",null),Tk(O.view,p),ih(O),r.mouse("end",O)}function T(O,H){if(e.call(this,O,H)){var D=O.changedTouches,q=t.call(this,O,H),Z=D.length,V,Y;for(V=0;V<Z;++V)(Y=R(this,q,O,H,D[V].identifier,D[V]))&&(Ev(O),Y("start",O,D[V]))}}function C(O){var H=O.changedTouches,D=H.length,q,Z;for(q=0;q<D;++q)(Z=r[H[q].identifier])&&(ih(O),Z("drag",O,H[q]))}function N(O){var H=O.changedTouches,D=H.length,q,Z;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),q=0;q<D;++q)(Z=r[H[q].identifier])&&(Ev(O),Z("end",O,H[q]))}function R(O,H,D,q,Z,V){var Y=s.copy(),F=pl(V||D,H),j,ee,P;if((P=n.call(O,new N1("beforestart",{sourceEvent:D,target:x,identifier:Z,active:l,x:F[0],y:F[1],dx:0,dy:0,dispatch:Y}),q))!=null)return j=P.x-F[0]||0,ee=P.y-F[1]||0,function W(z,K,G){var Q=F,I;switch(z){case"start":r[Z]=W,I=l++;break;case"end":delete r[Z],--l;case"drag":F=pl(G||K,H),I=l;break}Y.call(z,O,new N1(z,{sourceEvent:K,subject:P,target:x,identifier:Z,active:I,x:F[0]+j,y:F[1]+ee,dx:F[0]-Q[0],dy:F[1]-Q[1],dispatch:Y}),q)}}return x.filter=function(O){return arguments.length?(e=typeof O=="function"?O:r0(!!O),x):e},x.container=function(O){return arguments.length?(t=typeof O=="function"?O:r0(O),x):t},x.subject=function(O){return arguments.length?(n=typeof O=="function"?O:r0(O),x):n},x.touchable=function(O){return arguments.length?(i=typeof O=="function"?O:r0(!!O),x):i},x.on=function(){var O=s.on.apply(s,arguments);return O===s?x:O},x.clickDistance=function(O){return arguments.length?(g=(O=+O)*O,x):Math.sqrt(g)},x}function H_(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ak(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function ag(){}var Hm=.7,P0=1/Hm,rh="\\s*([+-]?\\d+)\\s*",Pm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",SY=/^#([0-9a-f]{3,8})$/,EY=new RegExp(`^rgb\\(${rh},${rh},${rh}\\)$`),wY=new RegExp(`^rgb\\(${mo},${mo},${mo}\\)$`),TY=new RegExp(`^rgba\\(${rh},${rh},${rh},${Pm}\\)$`),CY=new RegExp(`^rgba\\(${mo},${mo},${mo},${Pm}\\)$`),AY=new RegExp(`^hsl\\(${Pm},${mo},${mo}\\)$`),MY=new RegExp(`^hsla\\(${Pm},${mo},${mo},${Pm}\\)$`),mT={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};H_(ag,Ed,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:gT,formatHex:gT,formatHex8:RY,formatHsl:kY,formatRgb:yT,toString:yT});function gT(){return this.rgb().formatHex()}function RY(){return this.rgb().formatHex8()}function kY(){return Mk(this).formatHsl()}function yT(){return this.rgb().formatRgb()}function Ed(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=SY.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?xT(t):n===3?new Oa(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?a0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?a0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=EY.exec(e))?new Oa(t[1],t[2],t[3],1):(t=wY.exec(e))?new Oa(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=TY.exec(e))?a0(t[1],t[2],t[3],t[4]):(t=CY.exec(e))?a0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=AY.exec(e))?_T(t[1],t[2]/100,t[3]/100,1):(t=MY.exec(e))?_T(t[1],t[2]/100,t[3]/100,t[4]):mT.hasOwnProperty(e)?xT(mT[e]):e==="transparent"?new Oa(NaN,NaN,NaN,0):null}function xT(e){return new Oa(e>>16&255,e>>8&255,e&255,1)}function a0(e,t,n,i){return i<=0&&(e=t=n=NaN),new Oa(e,t,n,i)}function NY(e){return e instanceof ag||(e=Ed(e)),e?(e=e.rgb(),new Oa(e.r,e.g,e.b,e.opacity)):new Oa}function O1(e,t,n,i){return arguments.length===1?NY(e):new Oa(e,t,n,i??1)}function Oa(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}H_(Oa,O1,Ak(ag,{brighter(e){return e=e==null?P0:Math.pow(P0,e),new Oa(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Hm:Math.pow(Hm,e),new Oa(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Oa(xd(this.r),xd(this.g),xd(this.b),F0(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:bT,formatHex:bT,formatHex8:OY,formatRgb:vT,toString:vT}));function bT(){return`#${yd(this.r)}${yd(this.g)}${yd(this.b)}`}function OY(){return`#${yd(this.r)}${yd(this.g)}${yd(this.b)}${yd((isNaN(this.opacity)?1:this.opacity)*255)}`}function vT(){const e=F0(this.opacity);return`${e===1?"rgb(":"rgba("}${xd(this.r)}, ${xd(this.g)}, ${xd(this.b)}${e===1?")":`, ${e})`}`}function F0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function xd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function yd(e){return e=xd(e),(e<16?"0":"")+e.toString(16)}function _T(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new yl(e,t,n,i)}function Mk(e){if(e instanceof yl)return new yl(e.h,e.s,e.l,e.opacity);if(e instanceof ag||(e=Ed(e)),!e)return new yl;if(e instanceof yl)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),l=NaN,c=s-r,f=(s+r)/2;return c?(t===s?l=(n-i)/c+(n<i)*6:n===s?l=(i-t)/c+2:l=(t-n)/c+4,c/=f<.5?s+r:2-s-r,l*=60):c=f>0&&f<1?0:l,new yl(l,c,f,e.opacity)}function DY(e,t,n,i){return arguments.length===1?Mk(e):new yl(e,t,n,i??1)}function yl(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}H_(yl,DY,Ak(ag,{brighter(e){return e=e==null?P0:Math.pow(P0,e),new yl(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Hm:Math.pow(Hm,e),new yl(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Oa(wv(e>=240?e-240:e+120,r,i),wv(e,r,i),wv(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new yl(ST(this.h),s0(this.s),s0(this.l),F0(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=F0(this.opacity);return`${e===1?"hsl(":"hsla("}${ST(this.h)}, ${s0(this.s)*100}%, ${s0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ST(e){return e=(e||0)%360,e<0?e+360:e}function s0(e){return Math.max(0,Math.min(1,e||0))}function wv(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const P_=e=>()=>e;function zY(e,t){return function(n){return e+n*t}}function BY(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function LY(e){return(e=+e)==1?Rk:function(t,n){return n-t?BY(t,n,e):P_(isNaN(t)?n:t)}}function Rk(e,t){var n=t-e;return n?zY(e,n):P_(isNaN(e)?t:e)}const G0=(function e(t){var n=LY(t);function i(r,s){var l=n((r=O1(r)).r,(s=O1(s)).r),c=n(r.g,s.g),f=n(r.b,s.b),p=Rk(r.opacity,s.opacity);return function(m){return r.r=l(m),r.g=c(m),r.b=f(m),r.opacity=p(m),r+""}}return i.gamma=e,i})(1);function jY(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(s){for(r=0;r<n;++r)i[r]=e[r]*(1-s)+t[r]*s;return i}}function IY(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function UY(e,t){var n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),s=new Array(n),l;for(l=0;l<i;++l)r[l]=Mm(e[l],t[l]);for(;l<n;++l)s[l]=t[l];return function(c){for(l=0;l<i;++l)s[l]=r[l](c);return s}}function HY(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function ho(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function PY(e,t){var n={},i={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=Mm(e[r],t[r]):i[r]=t[r];return function(s){for(r in n)i[r]=n[r](s);return i}}var D1=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Tv=new RegExp(D1.source,"g");function FY(e){return function(){return e}}function GY(e){return function(t){return e(t)+""}}function kk(e,t){var n=D1.lastIndex=Tv.lastIndex=0,i,r,s,l=-1,c=[],f=[];for(e=e+"",t=t+"";(i=D1.exec(e))&&(r=Tv.exec(t));)(s=r.index)>n&&(s=t.slice(n,s),c[l]?c[l]+=s:c[++l]=s),(i=i[0])===(r=r[0])?c[l]?c[l]+=r:c[++l]=r:(c[++l]=null,f.push({i:l,x:ho(i,r)})),n=Tv.lastIndex;return n<t.length&&(s=t.slice(n),c[l]?c[l]+=s:c[++l]=s),c.length<2?f[0]?GY(f[0].x):FY(t):(t=f.length,function(p){for(var m=0,g;m<t;++m)c[(g=f[m]).i]=g.x(p);return c.join("")})}function Mm(e,t){var n=typeof t,i;return t==null||n==="boolean"?P_(t):(n==="number"?ho:n==="string"?(i=Ed(t))?(t=i,G0):kk:t instanceof Ed?G0:t instanceof Date?HY:IY(t)?jY:Array.isArray(t)?UY:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?PY:ho)(e,t)}var ET=180/Math.PI,z1={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Nk(e,t,n,i,r,s){var l,c,f;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(f=e*n+t*i)&&(n-=e*f,i-=t*f),(c=Math.sqrt(n*n+i*i))&&(n/=c,i/=c,f/=c),e*i<t*n&&(e=-e,t=-t,f=-f,l=-l),{translateX:r,translateY:s,rotate:Math.atan2(t,e)*ET,skewX:Math.atan(f)*ET,scaleX:l,scaleY:c}}var l0;function qY(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?z1:Nk(t.a,t.b,t.c,t.d,t.e,t.f)}function YY(e){return e==null||(l0||(l0=document.createElementNS("http://www.w3.org/2000/svg","g")),l0.setAttribute("transform",e),!(e=l0.transform.baseVal.consolidate()))?z1:(e=e.matrix,Nk(e.a,e.b,e.c,e.d,e.e,e.f))}function Ok(e,t,n,i){function r(p){return p.length?p.pop()+" ":""}function s(p,m,g,x,v,S){if(p!==g||m!==x){var A=v.push("translate(",null,t,null,n);S.push({i:A-4,x:ho(p,g)},{i:A-2,x:ho(m,x)})}else(g||x)&&v.push("translate("+g+t+x+n)}function l(p,m,g,x){p!==m?(p-m>180?m+=360:m-p>180&&(p+=360),x.push({i:g.push(r(g)+"rotate(",null,i)-2,x:ho(p,m)})):m&&g.push(r(g)+"rotate("+m+i)}function c(p,m,g,x){p!==m?x.push({i:g.push(r(g)+"skewX(",null,i)-2,x:ho(p,m)}):m&&g.push(r(g)+"skewX("+m+i)}function f(p,m,g,x,v,S){if(p!==g||m!==x){var A=v.push(r(v)+"scale(",null,",",null,")");S.push({i:A-4,x:ho(p,g)},{i:A-2,x:ho(m,x)})}else(g!==1||x!==1)&&v.push(r(v)+"scale("+g+","+x+")")}return function(p,m){var g=[],x=[];return p=e(p),m=e(m),s(p.translateX,p.translateY,m.translateX,m.translateY,g,x),l(p.rotate,m.rotate,g,x),c(p.skewX,m.skewX,g,x),f(p.scaleX,p.scaleY,m.scaleX,m.scaleY,g,x),p=m=null,function(v){for(var S=-1,A=x.length,T;++S<A;)g[(T=x[S]).i]=T.x(v);return g.join("")}}}var VY=Ok(qY,"px, ","px)","deg)"),XY=Ok(YY,", ",")",")"),KY=1e-12;function wT(e){return((e=Math.exp(e))+1/e)/2}function $Y(e){return((e=Math.exp(e))-1/e)/2}function WY(e){return((e=Math.exp(2*e))-1)/(e+1)}const v0=(function e(t,n,i){function r(s,l){var c=s[0],f=s[1],p=s[2],m=l[0],g=l[1],x=l[2],v=m-c,S=g-f,A=v*v+S*S,T,C;if(A<KY)C=Math.log(x/p)/t,T=function(q){return[c+q*v,f+q*S,p*Math.exp(t*q*C)]};else{var N=Math.sqrt(A),R=(x*x-p*p+i*A)/(2*p*n*N),O=(x*x-p*p-i*A)/(2*x*n*N),H=Math.log(Math.sqrt(R*R+1)-R),D=Math.log(Math.sqrt(O*O+1)-O);C=(D-H)/t,T=function(q){var Z=q*C,V=wT(H),Y=p/(n*N)*(V*WY(t*Z+H)-$Y(H));return[c+Y*v,f+Y*S,p*V/wT(t*Z+H)]}}return T.duration=C*1e3*t/Math.SQRT2,T}return r.rho=function(s){var l=Math.max(.001,+s),c=l*l,f=c*c;return e(l,c,f)},r})(Math.SQRT2,2,4);var ph=0,gm=0,um=0,Dk=1e3,q0,ym,Y0=0,wd=0,px=0,Fm=typeof performance=="object"&&performance.now?performance:Date,zk=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function F_(){return wd||(zk(QY),wd=Fm.now()+px)}function QY(){wd=0}function V0(){this._call=this._time=this._next=null}V0.prototype=Bk.prototype={constructor:V0,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?F_():+n)+(t==null?0:+t),!this._next&&ym!==this&&(ym?ym._next=this:q0=this,ym=this),this._call=e,this._time=n,B1()},stop:function(){this._call&&(this._call=null,this._time=1/0,B1())}};function Bk(e,t,n){var i=new V0;return i.restart(e,t,n),i}function ZY(){F_(),++ph;for(var e=q0,t;e;)(t=wd-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ph}function TT(){wd=(Y0=Fm.now())+px,ph=gm=0;try{ZY()}finally{ph=0,eV(),wd=0}}function JY(){var e=Fm.now(),t=e-Y0;t>Dk&&(px-=t,Y0=e)}function eV(){for(var e,t=q0,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:q0=n);ym=e,B1(i)}function B1(e){if(!ph){gm&&(gm=clearTimeout(gm));var t=e-wd;t>24?(e<1/0&&(gm=setTimeout(TT,e-Fm.now()-px)),um&&(um=clearInterval(um))):(um||(Y0=Fm.now(),um=setInterval(JY,Dk)),ph=1,zk(TT))}}function CT(e,t,n){var i=new V0;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var tV=fx("start","end","cancel","interrupt"),nV=[],Lk=0,AT=1,L1=2,_0=3,MT=4,j1=5,S0=6;function mx(e,t,n,i,r,s){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;iV(e,n,{name:t,index:i,group:r,on:tV,tween:nV,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Lk})}function G_(e,t){var n=Tl(e,t);if(n.state>Lk)throw new Error("too late; already scheduled");return n}function bo(e,t){var n=Tl(e,t);if(n.state>_0)throw new Error("too late; already running");return n}function Tl(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function iV(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=Bk(s,0,n.time);function s(p){n.state=AT,n.timer.restart(l,n.delay,n.time),n.delay<=p&&l(p-n.delay)}function l(p){var m,g,x,v;if(n.state!==AT)return f();for(m in i)if(v=i[m],v.name===n.name){if(v.state===_0)return CT(l);v.state===MT?(v.state=S0,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete i[m]):+m<t&&(v.state=S0,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete i[m])}if(CT(function(){n.state===_0&&(n.state=MT,n.timer.restart(c,n.delay,n.time),c(p))}),n.state=L1,n.on.call("start",e,e.__data__,n.index,n.group),n.state===L1){for(n.state=_0,r=new Array(x=n.tween.length),m=0,g=-1;m<x;++m)(v=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(r[++g]=v);r.length=g+1}}function c(p){for(var m=p<n.duration?n.ease.call(null,p/n.duration):(n.timer.restart(f),n.state=j1,1),g=-1,x=r.length;++g<x;)r[g].call(e,m);n.state===j1&&(n.on.call("end",e,e.__data__,n.index,n.group),f())}function f(){n.state=S0,n.timer.stop(),delete i[t];for(var p in i)return;delete e.__transition}}function E0(e,t){var n=e.__transition,i,r,s=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((i=n[l]).name!==t){s=!1;continue}r=i.state>L1&&i.state<j1,i.state=S0,i.timer.stop(),i.on.call(r?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[l]}s&&delete e.__transition}}function rV(e){return this.each(function(){E0(this,e)})}function aV(e,t){var n,i;return function(){var r=bo(this,e),s=r.tween;if(s!==n){i=n=s;for(var l=0,c=i.length;l<c;++l)if(i[l].name===t){i=i.slice(),i.splice(l,1);break}}r.tween=i}}function sV(e,t,n){var i,r;if(typeof n!="function")throw new Error;return function(){var s=bo(this,e),l=s.tween;if(l!==i){r=(i=l).slice();for(var c={name:t,value:n},f=0,p=r.length;f<p;++f)if(r[f].name===t){r[f]=c;break}f===p&&r.push(c)}s.tween=r}}function lV(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=Tl(this.node(),n).tween,r=0,s=i.length,l;r<s;++r)if((l=i[r]).name===e)return l.value;return null}return this.each((t==null?aV:sV)(n,e,t))}function q_(e,t,n){var i=e._id;return e.each(function(){var r=bo(this,i);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Tl(r,i).value[t]}}function jk(e,t){var n;return(typeof t=="number"?ho:t instanceof Ed?G0:(n=Ed(t))?(t=n,G0):kk)(e,t)}function oV(e){return function(){this.removeAttribute(e)}}function cV(e){return function(){this.removeAttributeNS(e.space,e.local)}}function uV(e,t,n){var i,r=n+"",s;return function(){var l=this.getAttribute(e);return l===r?null:l===i?s:s=t(i=l,n)}}function dV(e,t,n){var i,r=n+"",s;return function(){var l=this.getAttributeNS(e.space,e.local);return l===r?null:l===i?s:s=t(i=l,n)}}function fV(e,t,n){var i,r,s;return function(){var l,c=n(this),f;return c==null?void this.removeAttribute(e):(l=this.getAttribute(e),f=c+"",l===f?null:l===i&&f===r?s:(r=f,s=t(i=l,c)))}}function hV(e,t,n){var i,r,s;return function(){var l,c=n(this),f;return c==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),f=c+"",l===f?null:l===i&&f===r?s:(r=f,s=t(i=l,c)))}}function pV(e,t){var n=hx(e),i=n==="transform"?XY:jk;return this.attrTween(e,typeof t=="function"?(n.local?hV:fV)(n,i,q_(this,"attr."+e,t)):t==null?(n.local?cV:oV)(n):(n.local?dV:uV)(n,i,t))}function mV(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function gV(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function yV(e,t){var n,i;function r(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&gV(e,s)),n}return r._value=t,r}function xV(e,t){var n,i;function r(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&mV(e,s)),n}return r._value=t,r}function bV(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var i=hx(e);return this.tween(n,(i.local?yV:xV)(i,t))}function vV(e,t){return function(){G_(this,e).delay=+t.apply(this,arguments)}}function _V(e,t){return t=+t,function(){G_(this,e).delay=t}}function SV(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?vV:_V)(t,e)):Tl(this.node(),t).delay}function EV(e,t){return function(){bo(this,e).duration=+t.apply(this,arguments)}}function wV(e,t){return t=+t,function(){bo(this,e).duration=t}}function TV(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?EV:wV)(t,e)):Tl(this.node(),t).duration}function CV(e,t){if(typeof t!="function")throw new Error;return function(){bo(this,e).ease=t}}function AV(e){var t=this._id;return arguments.length?this.each(CV(t,e)):Tl(this.node(),t).ease}function MV(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;bo(this,e).ease=n}}function RV(e){if(typeof e!="function")throw new Error;return this.each(MV(this._id,e))}function kV(e){typeof e!="function"&&(e=pk(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],l=s.length,c=i[r]=[],f,p=0;p<l;++p)(f=s[p])&&e.call(f,f.__data__,p,s)&&c.push(f);return new oc(i,this._parents,this._name,this._id)}function NV(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,r=n.length,s=Math.min(i,r),l=new Array(i),c=0;c<s;++c)for(var f=t[c],p=n[c],m=f.length,g=l[c]=new Array(m),x,v=0;v<m;++v)(x=f[v]||p[v])&&(g[v]=x);for(;c<i;++c)l[c]=t[c];return new oc(l,this._parents,this._name,this._id)}function OV(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function DV(e,t,n){var i,r,s=OV(t)?G_:bo;return function(){var l=s(this,e),c=l.on;c!==i&&(r=(i=c).copy()).on(t,n),l.on=r}}function zV(e,t){var n=this._id;return arguments.length<2?Tl(this.node(),n).on.on(e):this.each(DV(n,e,t))}function BV(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function LV(){return this.on("end.remove",BV(this._id))}function jV(e){var t=this._name,n=this._id;typeof e!="function"&&(e=I_(e));for(var i=this._groups,r=i.length,s=new Array(r),l=0;l<r;++l)for(var c=i[l],f=c.length,p=s[l]=new Array(f),m,g,x=0;x<f;++x)(m=c[x])&&(g=e.call(m,m.__data__,x,c))&&("__data__"in m&&(g.__data__=m.__data__),p[x]=g,mx(p[x],t,n,x,p,Tl(m,n)));return new oc(s,this._parents,t,n)}function IV(e){var t=this._name,n=this._id;typeof e!="function"&&(e=hk(e));for(var i=this._groups,r=i.length,s=[],l=[],c=0;c<r;++c)for(var f=i[c],p=f.length,m,g=0;g<p;++g)if(m=f[g]){for(var x=e.call(m,m.__data__,g,f),v,S=Tl(m,n),A=0,T=x.length;A<T;++A)(v=x[A])&&mx(v,t,n,A,x,S);s.push(x),l.push(m)}return new oc(s,l,t,n)}var UV=rg.prototype.constructor;function HV(){return new UV(this._groups,this._parents)}function PV(e,t){var n,i,r;return function(){var s=hh(this,e),l=(this.style.removeProperty(e),hh(this,e));return s===l?null:s===n&&l===i?r:r=t(n=s,i=l)}}function Ik(e){return function(){this.style.removeProperty(e)}}function FV(e,t,n){var i,r=n+"",s;return function(){var l=hh(this,e);return l===r?null:l===i?s:s=t(i=l,n)}}function GV(e,t,n){var i,r,s;return function(){var l=hh(this,e),c=n(this),f=c+"";return c==null&&(f=c=(this.style.removeProperty(e),hh(this,e))),l===f?null:l===i&&f===r?s:(r=f,s=t(i=l,c))}}function qV(e,t){var n,i,r,s="style."+t,l="end."+s,c;return function(){var f=bo(this,e),p=f.on,m=f.value[s]==null?c||(c=Ik(t)):void 0;(p!==n||r!==m)&&(i=(n=p).copy()).on(l,r=m),f.on=i}}function YV(e,t,n){var i=(e+="")=="transform"?VY:jk;return t==null?this.styleTween(e,PV(e,i)).on("end.style."+e,Ik(e)):typeof t=="function"?this.styleTween(e,GV(e,i,q_(this,"style."+e,t))).each(qV(this._id,e)):this.styleTween(e,FV(e,i,t),n).on("end.style."+e,null)}function VV(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function XV(e,t,n){var i,r;function s(){var l=t.apply(this,arguments);return l!==r&&(i=(r=l)&&VV(e,l,n)),i}return s._value=t,s}function KV(e,t,n){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,XV(e,t,n??""))}function $V(e){return function(){this.textContent=e}}function WV(e){return function(){var t=e(this);this.textContent=t??""}}function QV(e){return this.tween("text",typeof e=="function"?WV(q_(this,"text",e)):$V(e==null?"":e+""))}function ZV(e){return function(t){this.textContent=e.call(this,t)}}function JV(e){var t,n;function i(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&ZV(r)),t}return i._value=e,i}function eX(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,JV(e))}function tX(){for(var e=this._name,t=this._id,n=Uk(),i=this._groups,r=i.length,s=0;s<r;++s)for(var l=i[s],c=l.length,f,p=0;p<c;++p)if(f=l[p]){var m=Tl(f,t);mx(f,e,n,p,l,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new oc(i,this._parents,e,n)}function nX(){var e,t,n=this,i=n._id,r=n.size();return new Promise(function(s,l){var c={value:l},f={value:function(){--r===0&&s()}};n.each(function(){var p=bo(this,i),m=p.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(f)),p.on=t}),r===0&&s()})}var iX=0;function oc(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function Uk(){return++iX}var Jo=rg.prototype;oc.prototype={constructor:oc,select:jV,selectAll:IV,selectChild:Jo.selectChild,selectChildren:Jo.selectChildren,filter:kV,merge:NV,selection:HV,transition:tX,call:Jo.call,nodes:Jo.nodes,node:Jo.node,size:Jo.size,empty:Jo.empty,each:Jo.each,on:zV,attr:pV,attrTween:bV,style:YV,styleTween:KV,text:QV,textTween:eX,remove:LV,tween:lV,delay:SV,duration:TV,ease:AV,easeVarying:RV,end:nX,[Symbol.iterator]:Jo[Symbol.iterator]};function rX(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var aX={time:null,delay:0,duration:250,ease:rX};function sX(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function lX(e){var t,n;e instanceof oc?(t=e._id,e=e._name):(t=Uk(),(n=aX).time=F_(),e=e==null?null:e+"");for(var i=this._groups,r=i.length,s=0;s<r;++s)for(var l=i[s],c=l.length,f,p=0;p<c;++p)(f=l[p])&&mx(f,e,t,p,l,n||sX(f,t));return new oc(i,this._parents,e,t)}rg.prototype.interrupt=rV;rg.prototype.transition=lX;const o0=e=>()=>e;function oX(e,{sourceEvent:t,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function ic(e,t,n){this.k=e,this.x=t,this.y=n}ic.prototype={constructor:ic,scale:function(e){return e===1?this:new ic(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ic(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var gx=new ic(1,0,0);Hk.prototype=ic.prototype;function Hk(e){for(;!e.__zoom;)if(!(e=e.parentNode))return gx;return e.__zoom}function Cv(e){e.stopImmediatePropagation()}function dm(e){e.preventDefault(),e.stopImmediatePropagation()}function cX(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function uX(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function RT(){return this.__zoom||gx}function dX(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function fX(){return navigator.maxTouchPoints||"ontouchstart"in this}function hX(e,t,n){var i=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),l>s?(s+l)/2:Math.min(0,s)||Math.max(0,l))}function Pk(){var e=cX,t=uX,n=hX,i=dX,r=fX,s=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,f=v0,p=fx("start","zoom","end"),m,g,x,v=500,S=150,A=0,T=10;function C(P){P.property("__zoom",RT).on("wheel.zoom",Z,{passive:!1}).on("mousedown.zoom",V).on("dblclick.zoom",Y).filter(r).on("touchstart.zoom",F).on("touchmove.zoom",j).on("touchend.zoom touchcancel.zoom",ee).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(P,W,z,K){var G=P.selection?P.selection():P;G.property("__zoom",RT),P!==G?H(P,W,z,K):G.interrupt().each(function(){D(this,arguments).event(K).start().zoom(null,typeof W=="function"?W.apply(this,arguments):W).end()})},C.scaleBy=function(P,W,z,K){C.scaleTo(P,function(){var G=this.__zoom.k,Q=typeof W=="function"?W.apply(this,arguments):W;return G*Q},z,K)},C.scaleTo=function(P,W,z,K){C.transform(P,function(){var G=t.apply(this,arguments),Q=this.__zoom,I=z==null?O(G):typeof z=="function"?z.apply(this,arguments):z,$=Q.invert(I),ne=typeof W=="function"?W.apply(this,arguments):W;return n(R(N(Q,ne),I,$),G,l)},z,K)},C.translateBy=function(P,W,z,K){C.transform(P,function(){return n(this.__zoom.translate(typeof W=="function"?W.apply(this,arguments):W,typeof z=="function"?z.apply(this,arguments):z),t.apply(this,arguments),l)},null,K)},C.translateTo=function(P,W,z,K,G){C.transform(P,function(){var Q=t.apply(this,arguments),I=this.__zoom,$=K==null?O(Q):typeof K=="function"?K.apply(this,arguments):K;return n(gx.translate($[0],$[1]).scale(I.k).translate(typeof W=="function"?-W.apply(this,arguments):-W,typeof z=="function"?-z.apply(this,arguments):-z),Q,l)},K,G)};function N(P,W){return W=Math.max(s[0],Math.min(s[1],W)),W===P.k?P:new ic(W,P.x,P.y)}function R(P,W,z){var K=W[0]-z[0]*P.k,G=W[1]-z[1]*P.k;return K===P.x&&G===P.y?P:new ic(P.k,K,G)}function O(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function H(P,W,z,K){P.on("start.zoom",function(){D(this,arguments).event(K).start()}).on("interrupt.zoom end.zoom",function(){D(this,arguments).event(K).end()}).tween("zoom",function(){var G=this,Q=arguments,I=D(G,Q).event(K),$=t.apply(G,Q),ne=z==null?O($):typeof z=="function"?z.apply(G,Q):z,X=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),ce=G.__zoom,ie=typeof W=="function"?W.apply(G,Q):W,de=f(ce.invert(ne).concat(X/ce.k),ie.invert(ne).concat(X/ie.k));return function(xe){if(xe===1)xe=ie;else{var me=de(xe),le=X/me[2];xe=new ic(le,ne[0]-me[0]*le,ne[1]-me[1]*le)}I.zoom(null,xe)}})}function D(P,W,z){return!z&&P.__zooming||new q(P,W)}function q(P,W){this.that=P,this.args=W,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,W),this.taps=0}q.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,W){return this.mouse&&P!=="mouse"&&(this.mouse[1]=W.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=W.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=W.invert(this.touch1[0])),this.that.__zoom=W,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var W=ns(this.that).datum();p.call(P,this.that,new oX(P,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:p}),W)}};function Z(P,...W){if(!e.apply(this,arguments))return;var z=D(this,W).event(P),K=this.__zoom,G=Math.max(s[0],Math.min(s[1],K.k*Math.pow(2,i.apply(this,arguments)))),Q=pl(P);if(z.wheel)(z.mouse[0][0]!==Q[0]||z.mouse[0][1]!==Q[1])&&(z.mouse[1]=K.invert(z.mouse[0]=Q)),clearTimeout(z.wheel);else{if(K.k===G)return;z.mouse=[Q,K.invert(Q)],E0(this),z.start()}dm(P),z.wheel=setTimeout(I,S),z.zoom("mouse",n(R(N(K,G),z.mouse[0],z.mouse[1]),z.extent,l));function I(){z.wheel=null,z.end()}}function V(P,...W){if(x||!e.apply(this,arguments))return;var z=P.currentTarget,K=D(this,W,!0).event(P),G=ns(P.view).on("mousemove.zoom",ne,!0).on("mouseup.zoom",X,!0),Q=pl(P,z),I=P.clientX,$=P.clientY;wk(P.view),Cv(P),K.mouse=[Q,this.__zoom.invert(Q)],E0(this),K.start();function ne(ce){if(dm(ce),!K.moved){var ie=ce.clientX-I,de=ce.clientY-$;K.moved=ie*ie+de*de>A}K.event(ce).zoom("mouse",n(R(K.that.__zoom,K.mouse[0]=pl(ce,z),K.mouse[1]),K.extent,l))}function X(ce){G.on("mousemove.zoom mouseup.zoom",null),Tk(ce.view,K.moved),dm(ce),K.event(ce).end()}}function Y(P,...W){if(e.apply(this,arguments)){var z=this.__zoom,K=pl(P.changedTouches?P.changedTouches[0]:P,this),G=z.invert(K),Q=z.k*(P.shiftKey?.5:2),I=n(R(N(z,Q),K,G),t.apply(this,W),l);dm(P),c>0?ns(this).transition().duration(c).call(H,I,K,P):ns(this).call(C.transform,I,K,P)}}function F(P,...W){if(e.apply(this,arguments)){var z=P.touches,K=z.length,G=D(this,W,P.changedTouches.length===K).event(P),Q,I,$,ne;for(Cv(P),I=0;I<K;++I)$=z[I],ne=pl($,this),ne=[ne,this.__zoom.invert(ne),$.identifier],G.touch0?!G.touch1&&G.touch0[2]!==ne[2]&&(G.touch1=ne,G.taps=0):(G.touch0=ne,Q=!0,G.taps=1+!!m);m&&(m=clearTimeout(m)),Q&&(G.taps<2&&(g=ne[0],m=setTimeout(function(){m=null},v)),E0(this),G.start())}}function j(P,...W){if(this.__zooming){var z=D(this,W).event(P),K=P.changedTouches,G=K.length,Q,I,$,ne;for(dm(P),Q=0;Q<G;++Q)I=K[Q],$=pl(I,this),z.touch0&&z.touch0[2]===I.identifier?z.touch0[0]=$:z.touch1&&z.touch1[2]===I.identifier&&(z.touch1[0]=$);if(I=z.that.__zoom,z.touch1){var X=z.touch0[0],ce=z.touch0[1],ie=z.touch1[0],de=z.touch1[1],xe=(xe=ie[0]-X[0])*xe+(xe=ie[1]-X[1])*xe,me=(me=de[0]-ce[0])*me+(me=de[1]-ce[1])*me;I=N(I,Math.sqrt(xe/me)),$=[(X[0]+ie[0])/2,(X[1]+ie[1])/2],ne=[(ce[0]+de[0])/2,(ce[1]+de[1])/2]}else if(z.touch0)$=z.touch0[0],ne=z.touch0[1];else return;z.zoom("touch",n(R(I,$,ne),z.extent,l))}}function ee(P,...W){if(this.__zooming){var z=D(this,W).event(P),K=P.changedTouches,G=K.length,Q,I;for(Cv(P),x&&clearTimeout(x),x=setTimeout(function(){x=null},v),Q=0;Q<G;++Q)I=K[Q],z.touch0&&z.touch0[2]===I.identifier?delete z.touch0:z.touch1&&z.touch1[2]===I.identifier&&delete z.touch1;if(z.touch1&&!z.touch0&&(z.touch0=z.touch1,delete z.touch1),z.touch0)z.touch0[1]=this.__zoom.invert(z.touch0[0]);else if(z.end(),z.taps===2&&(I=pl(I,this),Math.hypot(g[0]-I[0],g[1]-I[1])<T)){var $=ns(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return C.wheelDelta=function(P){return arguments.length?(i=typeof P=="function"?P:o0(+P),C):i},C.filter=function(P){return arguments.length?(e=typeof P=="function"?P:o0(!!P),C):e},C.touchable=function(P){return arguments.length?(r=typeof P=="function"?P:o0(!!P),C):r},C.extent=function(P){return arguments.length?(t=typeof P=="function"?P:o0([[+P[0][0],+P[0][1]],[+P[1][0],+P[1][1]]]),C):t},C.scaleExtent=function(P){return arguments.length?(s[0]=+P[0],s[1]=+P[1],C):[s[0],s[1]]},C.translateExtent=function(P){return arguments.length?(l[0][0]=+P[0][0],l[1][0]=+P[1][0],l[0][1]=+P[0][1],l[1][1]=+P[1][1],C):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},C.constrain=function(P){return arguments.length?(n=P,C):n},C.duration=function(P){return arguments.length?(c=+P,C):c},C.interpolate=function(P){return arguments.length?(f=P,C):f},C.on=function(){var P=p.on.apply(p,arguments);return P===p?C:P},C.clickDistance=function(P){return arguments.length?(A=(P=+P)*P,C):Math.sqrt(A)},C.tapDistance=function(P){return arguments.length?(T=+P,C):T},C}const go={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Gm=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Fk=["Enter"," ","Escape"],Gk={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var mh;(function(e){e.Strict="strict",e.Loose="loose"})(mh||(mh={}));var bd;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(bd||(bd={}));var qm;(function(e){e.Partial="partial",e.Full="full"})(qm||(qm={}));const qk={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var su;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(su||(su={}));var Ym;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ym||(Ym={}));var We;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(We||(We={}));const kT={[We.Left]:We.Right,[We.Right]:We.Left,[We.Top]:We.Bottom,[We.Bottom]:We.Top};function Yk(e){return e===null?null:e?"valid":"invalid"}const Vk=e=>"id"in e&&"source"in e&&"target"in e,pX=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Y_=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),sg=(e,t=[0,0])=>{const{width:n,height:i}=dc(e),r=e.origin??t,s=n*r[0],l=i*r[1];return{x:e.position.x-s,y:e.position.y-l}},mX=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,r)=>{const s=typeof r=="string";let l=!t.nodeLookup&&!s?r:void 0;t.nodeLookup&&(l=s?t.nodeLookup.get(r):Y_(r)?r:t.nodeLookup.get(r.id));const c=l?X0(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return yx(i,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return xx(n)},lg=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=yx(n,X0(r)),i=!0)}),i?xx(n):{x:0,y:0,width:0,height:0}},V_=(e,t,[n,i,r]=[0,0,1],s=!1,l=!1)=>{const c={...cg(t,[n,i,r]),width:t.width/r,height:t.height/r},f=[];for(const p of e.values()){const{measured:m,selectable:g=!0,hidden:x=!1}=p;if(l&&!g||x)continue;const v=m.width??p.width??p.initialWidth??null,S=m.height??p.height??p.initialHeight??null,A=Vm(c,yh(p)),T=(v??0)*(S??0),C=s&&A>0;(!p.internals.handleBounds||C||A>=T||p.dragging)&&f.push(p)}return f},gX=(e,t)=>{const n=new Set;return e.forEach(i=>{n.add(i.id)}),t.filter(i=>n.has(i.source)||n.has(i.target))};function yX(e,t){const n=new Map,i=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!i||i.has(r.id))&&n.set(r.id,r)}),n}async function xX({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:s},l){if(e.size===0)return Promise.resolve(!0);const c=yX(e,l),f=lg(c),p=X_(f,t,n,(l==null?void 0:l.minZoom)??r,(l==null?void 0:l.maxZoom)??s,(l==null?void 0:l.padding)??.1);return await i.setViewport(p,{duration:l==null?void 0:l.duration,ease:l==null?void 0:l.ease,interpolate:l==null?void 0:l.interpolate}),Promise.resolve(!0)}function Xk({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:s}){const l=n.get(e),c=l.parentId?n.get(l.parentId):void 0,{x:f,y:p}=c?c.internals.positionAbsolute:{x:0,y:0},m=l.origin??i;let g=l.extent||r;if(l.extent==="parent"&&!l.expandParent)if(!c)s==null||s("005",go.error005());else{const v=c.measured.width,S=c.measured.height;v&&S&&(g=[[f,p],[f+v,p+S]])}else c&&xh(l.extent)&&(g=[[l.extent[0][0]+f,l.extent[0][1]+p],[l.extent[1][0]+f,l.extent[1][1]+p]]);const x=xh(g)?Td(t,g,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&(s==null||s("015",go.error015())),{position:{x:x.x-f+(l.measured.width??0)*m[0],y:x.y-p+(l.measured.height??0)*m[1]},positionAbsolute:x}}async function bX({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:r}){const s=new Set(e.map(x=>x.id)),l=[];for(const x of n){if(x.deletable===!1)continue;const v=s.has(x.id),S=!v&&x.parentId&&l.find(A=>A.id===x.parentId);(v||S)&&l.push(x)}const c=new Set(t.map(x=>x.id)),f=i.filter(x=>x.deletable!==!1),m=gX(l,f);for(const x of f)c.has(x.id)&&!m.find(S=>S.id===x.id)&&m.push(x);if(!r)return{edges:m,nodes:l};const g=await r({nodes:l,edges:m});return typeof g=="boolean"?g?{edges:m,nodes:l}:{edges:[],nodes:[]}:g}const gh=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Td=(e={x:0,y:0},t,n)=>({x:gh(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:gh(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Kk(e,t,n){const{width:i,height:r}=dc(n),{x:s,y:l}=n.internals.positionAbsolute;return Td(e,[[s,l],[s+i,l+r]],t)}const NT=(e,t,n)=>e<t?gh(Math.abs(e-t),1,t)/t:e>n?-gh(Math.abs(e-n),1,t)/t:0,$k=(e,t,n=15,i=40)=>{const r=NT(e.x,i,t.width-i)*n,s=NT(e.y,i,t.height-i)*n;return[r,s]},yx=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),I1=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),xx=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),yh=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=Y_(e)?e.internals.positionAbsolute:sg(e,t);return{x:n,y:i,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},X0=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=Y_(e)?e.internals.positionAbsolute:sg(e,t);return{x:n,y:i,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:i+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},Wk=(e,t)=>xx(yx(I1(e),I1(t))),Vm=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*i)},OT=e=>xl(e.width)&&xl(e.height)&&xl(e.x)&&xl(e.y),xl=e=>!isNaN(e)&&isFinite(e),vX=(e,t)=>{},og=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),cg=({x:e,y:t},[n,i,r],s=!1,l=[1,1])=>{const c={x:(e-n)/r,y:(t-i)/r};return s?og(c,l):c},K0=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function Pf(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function _X(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=Pf(e,n),r=Pf(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=Pf(e.top??e.y??0,n),r=Pf(e.bottom??e.y??0,n),s=Pf(e.left??e.x??0,t),l=Pf(e.right??e.x??0,t);return{top:i,right:l,bottom:r,left:s,x:s+l,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function SX(e,t,n,i,r,s){const{x:l,y:c}=K0(e,[t,n,i]),{x:f,y:p}=K0({x:e.x+e.width,y:e.y+e.height},[t,n,i]),m=r-f,g=s-p;return{left:Math.floor(l),top:Math.floor(c),right:Math.floor(m),bottom:Math.floor(g)}}const X_=(e,t,n,i,r,s)=>{const l=_X(s,t,n),c=(t-l.x)/e.width,f=(n-l.y)/e.height,p=Math.min(c,f),m=gh(p,i,r),g=e.x+e.width/2,x=e.y+e.height/2,v=t/2-g*m,S=n/2-x*m,A=SX(e,v,S,m,t,n),T={left:Math.min(A.left-l.left,0),top:Math.min(A.top-l.top,0),right:Math.min(A.right-l.right,0),bottom:Math.min(A.bottom-l.bottom,0)};return{x:v-T.left+T.right,y:S-T.top+T.bottom,zoom:m}},Xm=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function xh(e){return e!=null&&e!=="parent"}function dc(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Qk(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function Zk(e,t={width:0,height:0},n,i,r){const s={...e},l=i.get(n);if(l){const c=l.origin||r;s.x+=l.internals.positionAbsolute.x-(t.width??0)*c[0],s.y+=l.internals.positionAbsolute.y-(t.height??0)*c[1]}return s}function DT(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function EX(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function wX(e){return{...Gk,...e||{}}}function Rm(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:l}=bl(e),c=cg({x:s-((r==null?void 0:r.left)??0),y:l-((r==null?void 0:r.top)??0)},i),{x:f,y:p}=n?og(c,t):c;return{xSnapped:f,ySnapped:p,...c}}const K_=e=>({width:e.offsetWidth,height:e.offsetHeight}),Jk=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},TX=["INPUT","SELECT","TEXTAREA"];function eN(e){var i,r;const t=((r=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:TX.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const tN=e=>"clientX"in e,bl=(e,t)=>{var s,l;const n=tN(e),i=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,r=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},zT=(e,t,n,i,r)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:r,position:l.getAttribute("data-handlepos"),x:(c.left-n.left)/i,y:(c.top-n.top)/i,...K_(l)}})};function nN({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:r,sourceControlY:s,targetControlX:l,targetControlY:c}){const f=e*.125+r*.375+l*.375+n*.125,p=t*.125+s*.375+c*.375+i*.125,m=Math.abs(f-e),g=Math.abs(p-t);return[f,p,m,g]}function c0(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function BT({pos:e,x1:t,y1:n,x2:i,y2:r,c:s}){switch(e){case We.Left:return[t-c0(t-i,s),n];case We.Right:return[t+c0(i-t,s),n];case We.Top:return[t,n-c0(n-r,s)];case We.Bottom:return[t,n+c0(r-n,s)]}}function iN({sourceX:e,sourceY:t,sourcePosition:n=We.Bottom,targetX:i,targetY:r,targetPosition:s=We.Top,curvature:l=.25}){const[c,f]=BT({pos:n,x1:e,y1:t,x2:i,y2:r,c:l}),[p,m]=BT({pos:s,x1:i,y1:r,x2:e,y2:t,c:l}),[g,x,v,S]=nN({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:c,sourceControlY:f,targetControlX:p,targetControlY:m});return[`M${e},${t} C${c},${f} ${p},${m} ${i},${r}`,g,x,v,S]}function rN({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,s=n<e?n+r:n-r,l=Math.abs(i-t)/2,c=i<t?i+l:i-l;return[s,c,r,l]}function CX({sourceNode:e,targetNode:t,selected:n=!1,zIndex:i=0,elevateOnSelect:r=!1,zIndexMode:s="basic"}){if(s==="manual")return i;const l=r&&n?i+1e3:i,c=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return l+c}function AX({sourceNode:e,targetNode:t,width:n,height:i,transform:r}){const s=yx(X0(e),X0(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const l={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:i/r[2]};return Vm(l,xx(s))>0}const MX=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,RX=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),kX=(e,t,n={})=>{if(!e.source||!e.target)return t;const i=n.getEdgeId||MX;let r;return Vk(e)?r={...e}:r={...e,id:i(e)},RX(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function aN({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,s,l,c]=rN({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,s,l,c]}const LT={[We.Left]:{x:-1,y:0},[We.Right]:{x:1,y:0},[We.Top]:{x:0,y:-1},[We.Bottom]:{x:0,y:1}},NX=({source:e,sourcePosition:t=We.Bottom,target:n})=>t===We.Left||t===We.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},jT=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function OX({source:e,sourcePosition:t=We.Bottom,target:n,targetPosition:i=We.Top,center:r,offset:s,stepPosition:l}){const c=LT[t],f=LT[i],p={x:e.x+c.x*s,y:e.y+c.y*s},m={x:n.x+f.x*s,y:n.y+f.y*s},g=NX({source:p,sourcePosition:t,target:m}),x=g.x!==0?"x":"y",v=g[x];let S=[],A,T;const C={x:0,y:0},N={x:0,y:0},[,,R,O]=rN({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[x]*f[x]===-1){x==="x"?(A=r.x??p.x+(m.x-p.x)*l,T=r.y??(p.y+m.y)/2):(A=r.x??(p.x+m.x)/2,T=r.y??p.y+(m.y-p.y)*l);const D=[{x:A,y:p.y},{x:A,y:m.y}],q=[{x:p.x,y:T},{x:m.x,y:T}];c[x]===v?S=x==="x"?D:q:S=x==="x"?q:D}else{const D=[{x:p.x,y:m.y}],q=[{x:m.x,y:p.y}];if(x==="x"?S=c.x===v?q:D:S=c.y===v?D:q,t===i){const j=Math.abs(e[x]-n[x]);if(j<=s){const ee=Math.min(s-1,s-j);c[x]===v?C[x]=(p[x]>e[x]?-1:1)*ee:N[x]=(m[x]>n[x]?-1:1)*ee}}if(t!==i){const j=x==="x"?"y":"x",ee=c[x]===f[j],P=p[j]>m[j],W=p[j]<m[j];(c[x]===1&&(!ee&&P||ee&&W)||c[x]!==1&&(!ee&&W||ee&&P))&&(S=x==="x"?D:q)}const Z={x:p.x+C.x,y:p.y+C.y},V={x:m.x+N.x,y:m.y+N.y},Y=Math.max(Math.abs(Z.x-S[0].x),Math.abs(V.x-S[0].x)),F=Math.max(Math.abs(Z.y-S[0].y),Math.abs(V.y-S[0].y));Y>=F?(A=(Z.x+V.x)/2,T=S[0].y):(A=S[0].x,T=(Z.y+V.y)/2)}return[[e,{x:p.x+C.x,y:p.y+C.y},...S,{x:m.x+N.x,y:m.y+N.y},n],A,T,R,O]}function DX(e,t,n,i){const r=Math.min(jT(e,t)/2,jT(t,n)/2,i),{x:s,y:l}=t;if(e.x===s&&s===n.x||e.y===l&&l===n.y)return`L${s} ${l}`;if(e.y===l){const p=e.x<n.x?-1:1,m=e.y<n.y?1:-1;return`L ${s+r*p},${l}Q ${s},${l} ${s},${l+r*m}`}const c=e.x<n.x?1:-1,f=e.y<n.y?-1:1;return`L ${s},${l+r*f}Q ${s},${l} ${s+r*c},${l}`}function U1({sourceX:e,sourceY:t,sourcePosition:n=We.Bottom,targetX:i,targetY:r,targetPosition:s=We.Top,borderRadius:l=5,centerX:c,centerY:f,offset:p=20,stepPosition:m=.5}){const[g,x,v,S,A]=OX({source:{x:e,y:t},sourcePosition:n,target:{x:i,y:r},targetPosition:s,center:{x:c,y:f},offset:p,stepPosition:m});return[g.reduce((C,N,R)=>{let O="";return R>0&&R<g.length-1?O=DX(g[R-1],N,g[R+1],l):O=`${R===0?"M":"L"}${N.x} ${N.y}`,C+=O,C},""),x,v,S,A]}function IT(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function zX(e){var g;const{sourceNode:t,targetNode:n}=e;if(!IT(t)||!IT(n))return null;const i=t.internals.handleBounds||UT(t.handles),r=n.internals.handleBounds||UT(n.handles),s=HT((i==null?void 0:i.source)??[],e.sourceHandle),l=HT(e.connectionMode===mh.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),e.targetHandle);if(!s||!l)return(g=e.onError)==null||g.call(e,"008",go.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(s==null?void 0:s.position)||We.Bottom,f=(l==null?void 0:l.position)||We.Top,p=Cd(t,s,c),m=Cd(n,l,f);return{sourceX:p.x,sourceY:p.y,targetX:m.x,targetY:m.y,sourcePosition:c,targetPosition:f}}function UT(e){if(!e)return null;const t=[],n=[];for(const i of e)i.width=i.width??1,i.height=i.height??1,i.type==="source"?t.push(i):i.type==="target"&&n.push(i);return{source:t,target:n}}function Cd(e,t,n=We.Left,i=!1){const r=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,s=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:l,height:c}=t??dc(e);if(i)return{x:r+l/2,y:s+c/2};switch((t==null?void 0:t.position)??n){case We.Top:return{x:r+l/2,y:s};case We.Right:return{x:r+l,y:s+c/2};case We.Bottom:return{x:r+l/2,y:s+c};case We.Left:return{x:r,y:s+c/2}}}function HT(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function H1(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function BX(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const s=new Set;return e.reduce((l,c)=>([c.markerStart||i,c.markerEnd||r].forEach(f=>{if(f&&typeof f=="object"){const p=H1(f,t);s.has(p)||(l.push({id:p,color:f.color||n,...f}),s.add(p))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const sN=1e3,LX=10,$_={nodeOrigin:[0,0],nodeExtent:Gm,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},jX={...$_,checkEquality:!0};function W_(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function IX(e,t,n){const i=W_($_,n);for(const r of e.values())if(r.parentId)Z_(r,e,t,i);else{const s=sg(r,i.nodeOrigin),l=xh(r.extent)?r.extent:i.nodeExtent,c=Td(s,l,dc(r));r.internals.positionAbsolute=c}}function UX(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],i=[];for(const r of e.handles){const s={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(s):r.type==="target"&&i.push(s)}return{source:n,target:i}}function Q_(e){return e==="manual"}function P1(e,t,n,i={}){var p,m;const r=W_(jX,i),s={i:0},l=new Map(t),c=r!=null&&r.elevateNodesOnSelect&&!Q_(r.zIndexMode)?sN:0;let f=e.length>0;t.clear(),n.clear();for(const g of e){let x=l.get(g.id);if(r.checkEquality&&g===(x==null?void 0:x.internals.userNode))t.set(g.id,x);else{const v=sg(g,r.nodeOrigin),S=xh(g.extent)?g.extent:r.nodeExtent,A=Td(v,S,dc(g));x={...r.defaults,...g,measured:{width:(p=g.measured)==null?void 0:p.width,height:(m=g.measured)==null?void 0:m.height},internals:{positionAbsolute:A,handleBounds:UX(g,x),z:lN(g,c,r.zIndexMode),userNode:g}},t.set(g.id,x)}(x.measured===void 0||x.measured.width===void 0||x.measured.height===void 0)&&!x.hidden&&(f=!1),g.parentId&&Z_(x,t,n,i,s)}return f}function HX(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Z_(e,t,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:l,nodeExtent:c,zIndexMode:f}=W_($_,i),p=e.parentId,m=t.get(p);if(!m){console.warn(`Parent node ${p} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}HX(e,n),r&&!m.parentId&&m.internals.rootParentIndex===void 0&&f==="auto"&&(m.internals.rootParentIndex=++r.i,m.internals.z=m.internals.z+r.i*LX),r&&m.internals.rootParentIndex!==void 0&&(r.i=m.internals.rootParentIndex);const g=s&&!Q_(f)?sN:0,{x,y:v,z:S}=PX(e,m,l,c,g,f),{positionAbsolute:A}=e.internals,T=x!==A.x||v!==A.y;(T||S!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:T?{x,y:v}:A,z:S}})}function lN(e,t,n){const i=xl(e.zIndex)?e.zIndex:0;return Q_(n)?i:i+(e.selected?t:0)}function PX(e,t,n,i,r,s){const{x:l,y:c}=t.internals.positionAbsolute,f=dc(e),p=sg(e,n),m=xh(e.extent)?Td(p,e.extent,f):p;let g=Td({x:l+m.x,y:c+m.y},i,f);e.extent==="parent"&&(g=Kk(g,f,t));const x=lN(e,r,s),v=t.internals.z??0;return{x:g.x,y:g.y,z:v>=x?v+1:x}}function J_(e,t,n,i=[0,0]){var l;const r=[],s=new Map;for(const c of e){const f=t.get(c.parentId);if(!f)continue;const p=((l=s.get(c.parentId))==null?void 0:l.expandedRect)??yh(f),m=Wk(p,c.rect);s.set(c.parentId,{expandedRect:m,parent:f})}return s.size>0&&s.forEach(({expandedRect:c,parent:f},p)=>{var R;const m=f.internals.positionAbsolute,g=dc(f),x=f.origin??i,v=c.x<m.x?Math.round(Math.abs(m.x-c.x)):0,S=c.y<m.y?Math.round(Math.abs(m.y-c.y)):0,A=Math.max(g.width,Math.round(c.width)),T=Math.max(g.height,Math.round(c.height)),C=(A-g.width)*x[0],N=(T-g.height)*x[1];(v>0||S>0||C||N)&&(r.push({id:p,type:"position",position:{x:f.position.x-v+C,y:f.position.y-S+N}}),(R=n.get(p))==null||R.forEach(O=>{e.some(H=>H.id===O.id)||r.push({id:O.id,type:"position",position:{x:O.position.x+v,y:O.position.y+S}})})),(g.width<c.width||g.height<c.height||v||S)&&r.push({id:p,type:"dimensions",setAttributes:!0,dimensions:{width:A+(v?x[0]*v-C:0),height:T+(S?x[1]*S-N:0)}})}),r}function FX(e,t,n,i,r,s,l){const c=i==null?void 0:i.querySelector(".xyflow__viewport");let f=!1;if(!c)return{changes:[],updatedInternals:f};const p=[],m=window.getComputedStyle(c),{m22:g}=new window.DOMMatrixReadOnly(m.transform),x=[];for(const v of e.values()){const S=t.get(v.id);if(!S)continue;if(S.hidden){t.set(S.id,{...S,internals:{...S.internals,handleBounds:void 0}}),f=!0;continue}const A=K_(v.nodeElement),T=S.measured.width!==A.width||S.measured.height!==A.height;if(!!(A.width&&A.height&&(T||!S.internals.handleBounds||v.force))){const N=v.nodeElement.getBoundingClientRect(),R=xh(S.extent)?S.extent:s;let{positionAbsolute:O}=S.internals;S.parentId&&S.extent==="parent"?O=Kk(O,A,t.get(S.parentId)):R&&(O=Td(O,R,A));const H={...S,measured:A,internals:{...S.internals,positionAbsolute:O,handleBounds:{source:zT("source",v.nodeElement,N,g,S.id),target:zT("target",v.nodeElement,N,g,S.id)}}};t.set(S.id,H),S.parentId&&Z_(H,t,n,{nodeOrigin:r,zIndexMode:l}),f=!0,T&&(p.push({id:S.id,type:"dimensions",dimensions:A}),S.expandParent&&S.parentId&&x.push({id:S.id,parentId:S.parentId,rect:yh(H,r)}))}}if(x.length>0){const v=J_(x,t,n,r);p.push(...v)}return{changes:p,updatedInternals:f}}async function GX({delta:e,panZoom:t,transform:n,translateExtent:i,width:r,height:s}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,s]],i),c=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(c)}function PT(e,t,n,i,r,s){let l=r;const c=i.get(l)||new Map;i.set(l,c.set(n,t)),l=`${r}-${e}`;const f=i.get(l)||new Map;if(i.set(l,f.set(n,t)),s){l=`${r}-${e}-${s}`;const p=i.get(l)||new Map;i.set(l,p.set(n,t))}}function oN(e,t,n){e.clear(),t.clear();for(const i of n){const{source:r,target:s,sourceHandle:l=null,targetHandle:c=null}=i,f={edgeId:i.id,source:r,target:s,sourceHandle:l,targetHandle:c},p=`${r}-${l}--${s}-${c}`,m=`${s}-${c}--${r}-${l}`;PT("source",f,m,e,r,l),PT("target",f,p,e,s,c),t.set(i.id,i)}}function cN(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:cN(n,t):!1}function FT(e,t,n){var r;let i=e;do{if((r=i==null?void 0:i.matches)!=null&&r.call(i,t))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function qX(e,t,n,i){const r=new Map;for(const[s,l]of e)if((l.selected||l.id===i)&&(!l.parentId||!cN(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const c=e.get(s);c&&r.set(s,{id:s,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return r}function Av({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var l,c,f;const r=[];for(const[p,m]of t){const g=(l=n.get(p))==null?void 0:l.internals.userNode;g&&r.push({...g,position:m.position,dragging:i})}if(!e)return[r[0],r];const s=(c=n.get(e))==null?void 0:c.internals.userNode;return[s?{...s,position:((f=t.get(e))==null?void 0:f.position)||s.position,dragging:i}:r[0],r]}function YX({dragItems:e,snapGrid:t,x:n,y:i}){const r=e.values().next().value;if(!r)return null;const s={x:n-r.distance.x,y:i-r.distance.y},l=og(s,t);return{x:l.x-s.x,y:l.y-s.y}}function VX({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:r}){let s={x:null,y:null},l=0,c=new Map,f=!1,p={x:0,y:0},m=null,g=!1,x=null,v=!1,S=!1,A=null;function T({noDragClassName:N,handleSelector:R,domNode:O,isSelectable:H,nodeId:D,nodeClickDistance:q=0}){x=ns(O);function Z({x:j,y:ee}){const{nodeLookup:P,nodeExtent:W,snapGrid:z,snapToGrid:K,nodeOrigin:G,onNodeDrag:Q,onSelectionDrag:I,onError:$,updateNodePositions:ne}=t();s={x:j,y:ee};let X=!1;const ce=c.size>1,ie=ce&&W?I1(lg(c)):null,de=ce&&K?YX({dragItems:c,snapGrid:z,x:j,y:ee}):null;for(const[xe,me]of c){if(!P.has(xe))continue;let le={x:j-me.distance.x,y:ee-me.distance.y};K&&(le=de?{x:Math.round(le.x+de.x),y:Math.round(le.y+de.y)}:og(le,z));let Re=null;if(ce&&W&&!me.extent&&ie){const{positionAbsolute:He}=me.internals,Qe=He.x-ie.x+W[0][0],ot=He.x+me.measured.width-ie.x2+W[1][0],Ue=He.y-ie.y+W[0][1],wt=He.y+me.measured.height-ie.y2+W[1][1];Re=[[Qe,Ue],[ot,wt]]}const{position:je,positionAbsolute:Ie}=Xk({nodeId:xe,nextPosition:le,nodeLookup:P,nodeExtent:Re||W,nodeOrigin:G,onError:$});X=X||me.position.x!==je.x||me.position.y!==je.y,me.position=je,me.internals.positionAbsolute=Ie}if(S=S||X,!!X&&(ne(c,!0),A&&(i||Q||!D&&I))){const[xe,me]=Av({nodeId:D,dragItems:c,nodeLookup:P});i==null||i(A,c,xe,me),Q==null||Q(A,xe,me),D||I==null||I(A,me)}}async function V(){if(!m)return;const{transform:j,panBy:ee,autoPanSpeed:P,autoPanOnNodeDrag:W}=t();if(!W){f=!1,cancelAnimationFrame(l);return}const[z,K]=$k(p,m,P);(z!==0||K!==0)&&(s.x=(s.x??0)-z/j[2],s.y=(s.y??0)-K/j[2],await ee({x:z,y:K})&&Z(s)),l=requestAnimationFrame(V)}function Y(j){var ce;const{nodeLookup:ee,multiSelectionActive:P,nodesDraggable:W,transform:z,snapGrid:K,snapToGrid:G,selectNodesOnDrag:Q,onNodeDragStart:I,onSelectionDragStart:$,unselectNodesAndEdges:ne}=t();g=!0,(!Q||!H)&&!P&&D&&((ce=ee.get(D))!=null&&ce.selected||ne()),H&&Q&&D&&(e==null||e(D));const X=Rm(j.sourceEvent,{transform:z,snapGrid:K,snapToGrid:G,containerBounds:m});if(s=X,c=qX(ee,W,X,D),c.size>0&&(n||I||!D&&$)){const[ie,de]=Av({nodeId:D,dragItems:c,nodeLookup:ee});n==null||n(j.sourceEvent,c,ie,de),I==null||I(j.sourceEvent,ie,de),D||$==null||$(j.sourceEvent,de)}}const F=Ck().clickDistance(q).on("start",j=>{const{domNode:ee,nodeDragThreshold:P,transform:W,snapGrid:z,snapToGrid:K}=t();m=(ee==null?void 0:ee.getBoundingClientRect())||null,v=!1,S=!1,A=j.sourceEvent,P===0&&Y(j),s=Rm(j.sourceEvent,{transform:W,snapGrid:z,snapToGrid:K,containerBounds:m}),p=bl(j.sourceEvent,m)}).on("drag",j=>{const{autoPanOnNodeDrag:ee,transform:P,snapGrid:W,snapToGrid:z,nodeDragThreshold:K,nodeLookup:G}=t(),Q=Rm(j.sourceEvent,{transform:P,snapGrid:W,snapToGrid:z,containerBounds:m});if(A=j.sourceEvent,(j.sourceEvent.type==="touchmove"&&j.sourceEvent.touches.length>1||D&&!G.has(D))&&(v=!0),!v){if(!f&&ee&&g&&(f=!0,V()),!g){const I=bl(j.sourceEvent,m),$=I.x-p.x,ne=I.y-p.y;Math.sqrt($*$+ne*ne)>K&&Y(j)}(s.x!==Q.xSnapped||s.y!==Q.ySnapped)&&c&&g&&(p=bl(j.sourceEvent,m),Z(Q))}}).on("end",j=>{if(!(!g||v)&&(f=!1,g=!1,cancelAnimationFrame(l),c.size>0)){const{nodeLookup:ee,updateNodePositions:P,onNodeDragStop:W,onSelectionDragStop:z}=t();if(S&&(P(c,!1),S=!1),r||W||!D&&z){const[K,G]=Av({nodeId:D,dragItems:c,nodeLookup:ee,dragging:!1});r==null||r(j.sourceEvent,c,K,G),W==null||W(j.sourceEvent,K,G),D||z==null||z(j.sourceEvent,G)}}}).filter(j=>{const ee=j.target;return!j.button&&(!N||!FT(ee,`.${N}`,O))&&(!R||FT(ee,R,O))});x.call(F)}function C(){x==null||x.on(".drag",null)}return{update:T,destroy:C}}function XX(e,t,n){const i=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())Vm(r,yh(s))>0&&i.push(s);return i}const KX=250;function $X(e,t,n,i){var c,f;let r=[],s=1/0;const l=XX(e,n,t+KX);for(const p of l){const m=[...((c=p.internals.handleBounds)==null?void 0:c.source)??[],...((f=p.internals.handleBounds)==null?void 0:f.target)??[]];for(const g of m){if(i.nodeId===g.nodeId&&i.type===g.type&&i.id===g.id)continue;const{x,y:v}=Cd(p,g,g.position,!0),S=Math.sqrt(Math.pow(x-e.x,2)+Math.pow(v-e.y,2));S>t||(S<s?(r=[{...g,x,y:v}],s=S):S===s&&r.push({...g,x,y:v}))}}if(!r.length)return null;if(r.length>1){const p=i.type==="source"?"target":"source";return r.find(m=>m.type===p)??r[0]}return r[0]}function uN(e,t,n,i,r,s=!1){var p,m,g;const l=i.get(e);if(!l)return null;const c=r==="strict"?(p=l.internals.handleBounds)==null?void 0:p[t]:[...((m=l.internals.handleBounds)==null?void 0:m.source)??[],...((g=l.internals.handleBounds)==null?void 0:g.target)??[]],f=(n?c==null?void 0:c.find(x=>x.id===n):c==null?void 0:c[0])??null;return f&&s?{...f,...Cd(l,f,f.position,!0)}:f}function dN(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function WX(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const fN=()=>!0;function QX(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:s,isTarget:l,domNode:c,nodeLookup:f,lib:p,autoPanOnConnect:m,flowId:g,panBy:x,cancelConnection:v,onConnectStart:S,onConnect:A,onConnectEnd:T,isValidConnection:C=fN,onReconnectEnd:N,updateConnection:R,getTransform:O,getFromHandle:H,autoPanSpeed:D,dragThreshold:q=1,handleDomNode:Z}){const V=Jk(e.target);let Y=0,F;const{x:j,y:ee}=bl(e),P=dN(s,Z),W=c==null?void 0:c.getBoundingClientRect();let z=!1;if(!W||!P)return;const K=uN(r,P,i,f,t);if(!K)return;let G=bl(e,W),Q=!1,I=null,$=!1,ne=null;function X(){if(!m||!W)return;const[je,Ie]=$k(G,W,D);x({x:je,y:Ie}),Y=requestAnimationFrame(X)}const ce={...K,nodeId:r,type:P,position:K.position},ie=f.get(r);let xe={inProgress:!0,isValid:null,from:Cd(ie,ce,We.Left,!0),fromHandle:ce,fromPosition:ce.position,fromNode:ie,to:G,toHandle:null,toPosition:kT[ce.position],toNode:null,pointer:G};function me(){z=!0,R(xe),S==null||S(e,{nodeId:r,handleId:i,handleType:P})}q===0&&me();function le(je){if(!z){const{x:wt,y:_n}=bl(je),Sn=wt-j,hn=_n-ee;if(!(Sn*Sn+hn*hn>q*q))return;me()}if(!H()||!ce){Re(je);return}const Ie=O();G=bl(je,W),F=$X(cg(G,Ie,!1,[1,1]),n,f,ce),Q||(X(),Q=!0);const He=hN(je,{handle:F,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:l?"target":"source",isValidConnection:C,doc:V,lib:p,flowId:g,nodeLookup:f});ne=He.handleDomNode,I=He.connection,$=WX(!!F,He.isValid);const Qe=f.get(r),ot=Qe?Cd(Qe,ce,We.Left,!0):xe.from,Ue={...xe,from:ot,isValid:$,to:He.toHandle&&$?K0({x:He.toHandle.x,y:He.toHandle.y},Ie):G,toHandle:He.toHandle,toPosition:$&&He.toHandle?He.toHandle.position:kT[ce.position],toNode:He.toHandle?f.get(He.toHandle.nodeId):null,pointer:G};R(Ue),xe=Ue}function Re(je){if(!("touches"in je&&je.touches.length>0)){if(z){(F||ne)&&I&&$&&(A==null||A(I));const{inProgress:Ie,...He}=xe,Qe={...He,toPosition:xe.toHandle?xe.toPosition:null};T==null||T(je,Qe),s&&(N==null||N(je,Qe))}v(),cancelAnimationFrame(Y),Q=!1,$=!1,I=null,ne=null,V.removeEventListener("mousemove",le),V.removeEventListener("mouseup",Re),V.removeEventListener("touchmove",le),V.removeEventListener("touchend",Re)}}V.addEventListener("mousemove",le),V.addEventListener("mouseup",Re),V.addEventListener("touchmove",le),V.addEventListener("touchend",Re)}function hN(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:l,lib:c,flowId:f,isValidConnection:p=fN,nodeLookup:m}){const g=s==="target",x=t?l.querySelector(`.${c}-flow__handle[data-id="${f}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:S}=bl(e),A=l.elementFromPoint(v,S),T=A!=null&&A.classList.contains(`${c}-flow__handle`)?A:x,C={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){const N=dN(void 0,T),R=T.getAttribute("data-nodeid"),O=T.getAttribute("data-handleid"),H=T.classList.contains("connectable"),D=T.classList.contains("connectableend");if(!R||!N)return C;const q={source:g?R:i,sourceHandle:g?O:r,target:g?i:R,targetHandle:g?r:O};C.connection=q;const V=H&&D&&(n===mh.Strict?g&&N==="source"||!g&&N==="target":R!==i||O!==r);C.isValid=V&&p(q),C.toHandle=uN(R,N,O,m,n,!0)}return C}const F1={onPointerDown:QX,isValid:hN};function ZX({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=ns(e);function s({translateExtent:c,width:f,height:p,zoomStep:m=1,pannable:g=!0,zoomable:x=!0,inversePan:v=!1}){const S=R=>{if(R.sourceEvent.type!=="wheel"||!t)return;const O=n(),H=R.sourceEvent.ctrlKey&&Xm()?10:1,D=-R.sourceEvent.deltaY*(R.sourceEvent.deltaMode===1?.05:R.sourceEvent.deltaMode?1:.002)*m,q=O[2]*Math.pow(2,D*H);t.scaleTo(q)};let A=[0,0];const T=R=>{(R.sourceEvent.type==="mousedown"||R.sourceEvent.type==="touchstart")&&(A=[R.sourceEvent.clientX??R.sourceEvent.touches[0].clientX,R.sourceEvent.clientY??R.sourceEvent.touches[0].clientY])},C=R=>{const O=n();if(R.sourceEvent.type!=="mousemove"&&R.sourceEvent.type!=="touchmove"||!t)return;const H=[R.sourceEvent.clientX??R.sourceEvent.touches[0].clientX,R.sourceEvent.clientY??R.sourceEvent.touches[0].clientY],D=[H[0]-A[0],H[1]-A[1]];A=H;const q=i()*Math.max(O[2],Math.log(O[2]))*(v?-1:1),Z={x:O[0]-D[0]*q,y:O[1]-D[1]*q},V=[[0,0],[f,p]];t.setViewportConstrained({x:Z.x,y:Z.y,zoom:O[2]},V,c)},N=Pk().on("start",T).on("zoom",g?C:null).on("zoom.wheel",x?S:null);r.call(N,{})}function l(){r.on("zoom",null)}return{update:s,destroy:l,pointer:pl}}const bx=e=>({x:e.x,y:e.y,zoom:e.k}),Mv=({x:e,y:t,zoom:n})=>gx.translate(e,t).scale(n),Jf=(e,t)=>e.target.closest(`.${t}`),pN=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),JX=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Rv=(e,t=0,n=JX,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},mN=e=>{const t=e.ctrlKey&&Xm()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function eK({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:f,onPanZoomEnd:p}){return m=>{if(Jf(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const g=n.property("__zoom").k||1;if(m.ctrlKey&&l){const T=pl(m),C=mN(m),N=g*Math.pow(2,C);i.scaleTo(n,N,T,m);return}const x=m.deltaMode===1?20:1;let v=r===bd.Vertical?0:m.deltaX*x,S=r===bd.Horizontal?0:m.deltaY*x;!Xm()&&m.shiftKey&&r!==bd.Vertical&&(v=m.deltaY*x,S=0),i.translateBy(n,-(v/g)*s,-(S/g)*s,{internal:!0});const A=bx(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(f==null||f(m,A),e.panScrollTimeout=setTimeout(()=>{p==null||p(m,A),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(m,A))}}function tK({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",l=!t&&s&&!i.ctrlKey,c=Jf(i,e);if(i.ctrlKey&&s&&c&&i.preventDefault(),l||c)return null;i.preventDefault(),n.call(this,i,r)}}function nK({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,l,c;if((s=i.sourceEvent)!=null&&s.internal)return;const r=bx(i.transform);e.mouseButton=((l=i.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((c=i.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,r))}}function iK({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var l,c;e.usedRightMouseButton=!!(n&&pN(t,e.mouseButton??0)),(l=s.sourceEvent)!=null&&l.sync||i([s.transform.x,s.transform.y,s.transform.k]),r&&!((c=s.sourceEvent)!=null&&c.internal)&&(r==null||r(s.sourceEvent,bx(s.transform)))}}function rK({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:s}){return l=>{var c;if(!((c=l.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,s&&pN(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&s(l.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const f=bx(l.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(l.sourceEvent,f)},n?150:0)}}}function aK({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:l,noWheelClassName:c,noPanClassName:f,lib:p,connectionInProgress:m}){return g=>{var T;const x=e||t,v=n&&g.ctrlKey,S=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Jf(g,`${p}-flow__node`)||Jf(g,`${p}-flow__edge`)))return!0;if(!i&&!x&&!r&&!s&&!n||l||m&&!S||Jf(g,c)&&S||Jf(g,f)&&(!S||r&&S&&!e)||!n&&g.ctrlKey&&S)return!1;if(!n&&g.type==="touchstart"&&((T=g.touches)==null?void 0:T.length)>1)return g.preventDefault(),!1;if(!x&&!r&&!v&&S||!i&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(i)&&!i.includes(g.button)&&g.type==="mousedown")return!1;const A=Array.isArray(i)&&i.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||S)&&A}}function sK({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:s,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:f}){const p={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),g=Pk().scaleExtent([t,n]).translateExtent(i),x=ns(e).call(g);N({x:r.x,y:r.y,zoom:gh(r.zoom,t,n)},[[0,0],[m.width,m.height]],i);const v=x.on("wheel.zoom"),S=x.on("dblclick.zoom");g.wheelDelta(mN);function A(F,j){return x?new Promise(ee=>{g==null||g.interpolate((j==null?void 0:j.interpolate)==="linear"?Mm:v0).transform(Rv(x,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>ee(!0)),F)}):Promise.resolve(!1)}function T({noWheelClassName:F,noPanClassName:j,onPaneContextMenu:ee,userSelectionActive:P,panOnScroll:W,panOnDrag:z,panOnScrollMode:K,panOnScrollSpeed:G,preventScrolling:Q,zoomOnPinch:I,zoomOnScroll:$,zoomOnDoubleClick:ne,zoomActivationKeyPressed:X,lib:ce,onTransformChange:ie,connectionInProgress:de,paneClickDistance:xe,selectionOnDrag:me}){P&&!p.isZoomingOrPanning&&C();const le=W&&!X&&!P;g.clickDistance(me?1/0:!xl(xe)||xe<0?0:xe);const Re=le?eK({zoomPanValues:p,noWheelClassName:F,d3Selection:x,d3Zoom:g,panOnScrollMode:K,panOnScrollSpeed:G,zoomOnPinch:I,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:c}):tK({noWheelClassName:F,preventScrolling:Q,d3ZoomHandler:v});if(x.on("wheel.zoom",Re,{passive:!1}),!P){const Ie=nK({zoomPanValues:p,onDraggingChange:f,onPanZoomStart:l});g.on("start",Ie);const He=iK({zoomPanValues:p,panOnDrag:z,onPaneContextMenu:!!ee,onPanZoom:s,onTransformChange:ie});g.on("zoom",He);const Qe=rK({zoomPanValues:p,panOnDrag:z,panOnScroll:W,onPaneContextMenu:ee,onPanZoomEnd:c,onDraggingChange:f});g.on("end",Qe)}const je=aK({zoomActivationKeyPressed:X,panOnDrag:z,zoomOnScroll:$,panOnScroll:W,zoomOnDoubleClick:ne,zoomOnPinch:I,userSelectionActive:P,noPanClassName:j,noWheelClassName:F,lib:ce,connectionInProgress:de});g.filter(je),ne?x.on("dblclick.zoom",S):x.on("dblclick.zoom",null)}function C(){g.on("zoom",null)}async function N(F,j,ee){const P=Mv(F),W=g==null?void 0:g.constrain()(P,j,ee);return W&&await A(W),new Promise(z=>z(W))}async function R(F,j){const ee=Mv(F);return await A(ee,j),new Promise(P=>P(ee))}function O(F){if(x){const j=Mv(F),ee=x.property("__zoom");(ee.k!==F.zoom||ee.x!==F.x||ee.y!==F.y)&&(g==null||g.transform(x,j,null,{sync:!0}))}}function H(){const F=x?Hk(x.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}function D(F,j){return x?new Promise(ee=>{g==null||g.interpolate((j==null?void 0:j.interpolate)==="linear"?Mm:v0).scaleTo(Rv(x,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>ee(!0)),F)}):Promise.resolve(!1)}function q(F,j){return x?new Promise(ee=>{g==null||g.interpolate((j==null?void 0:j.interpolate)==="linear"?Mm:v0).scaleBy(Rv(x,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>ee(!0)),F)}):Promise.resolve(!1)}function Z(F){g==null||g.scaleExtent(F)}function V(F){g==null||g.translateExtent(F)}function Y(F){const j=!xl(F)||F<0?0:F;g==null||g.clickDistance(j)}return{update:T,destroy:C,setViewport:R,setViewportConstrained:N,getViewport:H,scaleTo:D,scaleBy:q,setScaleExtent:Z,setTranslateExtent:V,syncViewport:O,setClickDistance:Y}}var bh;(function(e){e.Line="line",e.Handle="handle"})(bh||(bh={}));function lK({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:r,affectsY:s}){const l=e-t,c=n-i,f=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&r&&(f[0]=f[0]*-1),c&&s&&(f[1]=f[1]*-1),f}function GT(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:r}}function tu(e,t){return Math.max(0,t-e)}function nu(e,t){return Math.max(0,e-t)}function u0(e,t,n){return Math.max(0,t-e,e-n)}function qT(e,t){return e?!t:t}function oK(e,t,n,i,r,s,l,c){let{affectsX:f,affectsY:p}=t;const{isHorizontal:m,isVertical:g}=t,x=m&&g,{xSnapped:v,ySnapped:S}=n,{minWidth:A,maxWidth:T,minHeight:C,maxHeight:N}=i,{x:R,y:O,width:H,height:D,aspectRatio:q}=e;let Z=Math.floor(m?v-e.pointerX:0),V=Math.floor(g?S-e.pointerY:0);const Y=H+(f?-Z:Z),F=D+(p?-V:V),j=-s[0]*H,ee=-s[1]*D;let P=u0(Y,A,T),W=u0(F,C,N);if(l){let G=0,Q=0;f&&Z<0?G=tu(R+Z+j,l[0][0]):!f&&Z>0&&(G=nu(R+Y+j,l[1][0])),p&&V<0?Q=tu(O+V+ee,l[0][1]):!p&&V>0&&(Q=nu(O+F+ee,l[1][1])),P=Math.max(P,G),W=Math.max(W,Q)}if(c){let G=0,Q=0;f&&Z>0?G=nu(R+Z,c[0][0]):!f&&Z<0&&(G=tu(R+Y,c[1][0])),p&&V>0?Q=nu(O+V,c[0][1]):!p&&V<0&&(Q=tu(O+F,c[1][1])),P=Math.max(P,G),W=Math.max(W,Q)}if(r){if(m){const G=u0(Y/q,C,N)*q;if(P=Math.max(P,G),l){let Q=0;!f&&!p||f&&!p&&x?Q=nu(O+ee+Y/q,l[1][1])*q:Q=tu(O+ee+(f?Z:-Z)/q,l[0][1])*q,P=Math.max(P,Q)}if(c){let Q=0;!f&&!p||f&&!p&&x?Q=tu(O+Y/q,c[1][1])*q:Q=nu(O+(f?Z:-Z)/q,c[0][1])*q,P=Math.max(P,Q)}}if(g){const G=u0(F*q,A,T)/q;if(W=Math.max(W,G),l){let Q=0;!f&&!p||p&&!f&&x?Q=nu(R+F*q+j,l[1][0])/q:Q=tu(R+(p?V:-V)*q+j,l[0][0])/q,W=Math.max(W,Q)}if(c){let Q=0;!f&&!p||p&&!f&&x?Q=tu(R+F*q,c[1][0])/q:Q=nu(R+(p?V:-V)*q,c[0][0])/q,W=Math.max(W,Q)}}}V=V+(V<0?W:-W),Z=Z+(Z<0?P:-P),r&&(x?Y>F*q?V=(qT(f,p)?-Z:Z)/q:Z=(qT(f,p)?-V:V)*q:m?(V=Z/q,p=f):(Z=V*q,f=p));const z=f?R+Z:R,K=p?O+V:O;return{width:H+(f?-Z:Z),height:D+(p?-V:V),x:s[0]*Z*(f?-1:1)+z,y:s[1]*V*(p?-1:1)+K}}const gN={width:0,height:0,x:0,y:0},cK={...gN,pointerX:0,pointerY:0,aspectRatio:1};function uK(e){return[[0,0],[e.measured.width,e.measured.height]]}function dK(e,t,n){const i=t.position.x+e.position.x,r=t.position.y+e.position.y,s=e.measured.width??0,l=e.measured.height??0,c=n[0]*s,f=n[1]*l;return[[i-c,r-f],[i+s-c,r+l-f]]}function fK({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const s=ns(e);let l={controlDirection:GT("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:p,boundaries:m,keepAspectRatio:g,resizeDirection:x,onResizeStart:v,onResize:S,onResizeEnd:A,shouldResize:T}){let C={...gN},N={...cK};l={boundaries:m,resizeDirection:x,keepAspectRatio:g,controlDirection:GT(p)};let R,O=null,H=[],D,q,Z,V=!1;const Y=Ck().on("start",F=>{const{nodeLookup:j,transform:ee,snapGrid:P,snapToGrid:W,nodeOrigin:z,paneDomNode:K}=n();if(R=j.get(t),!R)return;O=(K==null?void 0:K.getBoundingClientRect())??null;const{xSnapped:G,ySnapped:Q}=Rm(F.sourceEvent,{transform:ee,snapGrid:P,snapToGrid:W,containerBounds:O});C={width:R.measured.width??0,height:R.measured.height??0,x:R.position.x??0,y:R.position.y??0},N={...C,pointerX:G,pointerY:Q,aspectRatio:C.width/C.height},D=void 0,R.parentId&&(R.extent==="parent"||R.expandParent)&&(D=j.get(R.parentId),q=D&&R.extent==="parent"?uK(D):void 0),H=[],Z=void 0;for(const[I,$]of j)if($.parentId===t&&(H.push({id:I,position:{...$.position},extent:$.extent}),$.extent==="parent"||$.expandParent)){const ne=dK($,R,$.origin??z);Z?Z=[[Math.min(ne[0][0],Z[0][0]),Math.min(ne[0][1],Z[0][1])],[Math.max(ne[1][0],Z[1][0]),Math.max(ne[1][1],Z[1][1])]]:Z=ne}v==null||v(F,{...C})}).on("drag",F=>{const{transform:j,snapGrid:ee,snapToGrid:P,nodeOrigin:W}=n(),z=Rm(F.sourceEvent,{transform:j,snapGrid:ee,snapToGrid:P,containerBounds:O}),K=[];if(!R)return;const{x:G,y:Q,width:I,height:$}=C,ne={},X=R.origin??W,{width:ce,height:ie,x:de,y:xe}=oK(N,l.controlDirection,z,l.boundaries,l.keepAspectRatio,X,q,Z),me=ce!==I,le=ie!==$,Re=de!==G&&me,je=xe!==Q&&le;if(!Re&&!je&&!me&&!le)return;if((Re||je||X[0]===1||X[1]===1)&&(ne.x=Re?de:C.x,ne.y=je?xe:C.y,C.x=ne.x,C.y=ne.y,H.length>0)){const ot=de-G,Ue=xe-Q;for(const wt of H)wt.position={x:wt.position.x-ot+X[0]*(ce-I),y:wt.position.y-Ue+X[1]*(ie-$)},K.push(wt)}if((me||le)&&(ne.width=me&&(!l.resizeDirection||l.resizeDirection==="horizontal")?ce:C.width,ne.height=le&&(!l.resizeDirection||l.resizeDirection==="vertical")?ie:C.height,C.width=ne.width,C.height=ne.height),D&&R.expandParent){const ot=X[0]*(ne.width??0);ne.x&&ne.x<ot&&(C.x=ot,N.x=N.x-(ne.x-ot));const Ue=X[1]*(ne.height??0);ne.y&&ne.y<Ue&&(C.y=Ue,N.y=N.y-(ne.y-Ue))}const Ie=lK({width:C.width,prevWidth:I,height:C.height,prevHeight:$,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),He={...C,direction:Ie};(T==null?void 0:T(F,He))!==!1&&(V=!0,S==null||S(F,He),i(ne,K))}).on("end",F=>{V&&(A==null||A(F,{...C}),r==null||r({...C}),V=!1)});s.call(Y)}function f(){s.on(".drag",null)}return{update:c,destroy:f}}var kv={exports:{}},Nv={},Ov={exports:{}},Dv={};/**
379
- * @license React
380
- * use-sync-external-store-shim.production.js
381
- *
382
- * Copyright (c) Meta Platforms, Inc. and affiliates.
383
- *
384
- * This source code is licensed under the MIT license found in the
385
- * LICENSE file in the root directory of this source tree.
386
- */var YT;function hK(){if(YT)return Dv;YT=1;var e=vh();function t(g,x){return g===x&&(g!==0||1/g===1/x)||g!==g&&x!==x}var n=typeof Object.is=="function"?Object.is:t,i=e.useState,r=e.useEffect,s=e.useLayoutEffect,l=e.useDebugValue;function c(g,x){var v=x(),S=i({inst:{value:v,getSnapshot:x}}),A=S[0].inst,T=S[1];return s(function(){A.value=v,A.getSnapshot=x,f(A)&&T({inst:A})},[g,v,x]),r(function(){return f(A)&&T({inst:A}),g(function(){f(A)&&T({inst:A})})},[g]),l(v),v}function f(g){var x=g.getSnapshot;g=g.value;try{var v=x();return!n(g,v)}catch{return!0}}function p(g,x){return x()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:c;return Dv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Dv}var VT;function pK(){return VT||(VT=1,Ov.exports=hK()),Ov.exports}/**
387
- * @license React
388
- * use-sync-external-store-shim/with-selector.production.js
389
- *
390
- * Copyright (c) Meta Platforms, Inc. and affiliates.
391
- *
392
- * This source code is licensed under the MIT license found in the
393
- * LICENSE file in the root directory of this source tree.
394
- */var XT;function mK(){if(XT)return Nv;XT=1;var e=vh(),t=pK();function n(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var i=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,s=e.useRef,l=e.useEffect,c=e.useMemo,f=e.useDebugValue;return Nv.useSyncExternalStoreWithSelector=function(p,m,g,x,v){var S=s(null);if(S.current===null){var A={hasValue:!1,value:null};S.current=A}else A=S.current;S=c(function(){function C(D){if(!N){if(N=!0,R=D,D=x(D),v!==void 0&&A.hasValue){var q=A.value;if(v(q,D))return O=q}return O=D}if(q=O,i(R,D))return q;var Z=x(D);return v!==void 0&&v(q,Z)?(R=D,q):(R=D,O=Z)}var N=!1,R,O,H=g===void 0?null:g;return[function(){return C(m())},H===null?void 0:function(){return C(H())}]},[m,g,x,v]);var T=r(p,S[0],S[1]);return l(function(){A.hasValue=!0,A.value=T},[T]),f(T),T},Nv}var KT;function gK(){return KT||(KT=1,kv.exports=mK()),kv.exports}var yK=gK();const xK=du(yK),bK={},$T=e=>{let t;const n=new Set,i=(m,g)=>{const x=typeof m=="function"?m(t):m;if(!Object.is(x,t)){const v=t;t=g??(typeof x!="object"||x===null)?x:Object.assign({},t,x),n.forEach(S=>S(t,v))}},r=()=>t,f={setState:i,getState:r,getInitialState:()=>p,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(bK?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},p=t=e(i,r,f);return f},vK=e=>e?$T(e):$T,{useDebugValue:_K}=fm,{useSyncExternalStoreWithSelector:SK}=xK,EK=e=>e;function yN(e,t=EK,n){const i=SK(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return _K(i),i}const WT=(e,t)=>{const n=vK(e),i=(r,s=t)=>yN(n,r,s);return Object.assign(i,n),i},wK=(e,t)=>e?WT(e,t):WT;function Qn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!Object.is(r,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}const vx=L.createContext(null),TK=vx.Provider,xN=go.error001();function $t(e,t){const n=L.useContext(vx);if(n===null)throw new Error(xN);return yN(n,e,t)}function Zn(){const e=L.useContext(vx);if(e===null)throw new Error(xN);return L.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const QT={display:"none"},CK={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},bN="react-flow__node-desc",vN="react-flow__edge-desc",AK="react-flow__aria-live",MK=e=>e.ariaLiveMessage,RK=e=>e.ariaLabelConfig;function kK({rfId:e}){const t=$t(MK);return _.jsx("div",{id:`${AK}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:CK,children:t})}function NK({rfId:e,disableKeyboardA11y:t}){const n=$t(RK);return _.jsxs(_.Fragment,{children:[_.jsx("div",{id:`${bN}-${e}`,style:QT,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),_.jsx("div",{id:`${vN}-${e}`,style:QT,children:n["edge.a11yDescription.default"]}),!t&&_.jsx(kK,{rfId:e})]})}const _x=L.forwardRef(({position:e="top-left",children:t,className:n,style:i,...r},s)=>{const l=`${e}`.split("-");return _.jsx("div",{className:zi(["react-flow__panel",n,...l]),style:i,ref:s,...r,children:t})});_x.displayName="Panel";function OK({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:_.jsx(_x,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:_.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const DK=e=>{const t=[],n=[];for(const[,i]of e.nodeLookup)i.selected&&t.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&n.push(i);return{selectedNodes:t,selectedEdges:n}},d0=e=>e.id;function zK(e,t){return Qn(e.selectedNodes.map(d0),t.selectedNodes.map(d0))&&Qn(e.selectedEdges.map(d0),t.selectedEdges.map(d0))}function BK({onSelectionChange:e}){const t=Zn(),{selectedNodes:n,selectedEdges:i}=$t(DK,zK);return L.useEffect(()=>{const r={nodes:n,edges:i};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(s=>s(r))},[n,i,e]),null}const LK=e=>!!e.onSelectionChangeHandlers;function jK({onSelectionChange:e}){const t=$t(LK);return e||t?_.jsx(BK,{onSelectionChange:e}):null}const _N=[0,0],IK={x:0,y:0,zoom:1},UK=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],ZT=[...UK,"rfId"],HK=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),JT={translateExtent:Gm,nodeOrigin:_N,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function PK(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:f}=$t(HK,Qn),p=Zn();L.useEffect(()=>(f(e.defaultNodes,e.defaultEdges),()=>{m.current=JT,c()}),[]);const m=L.useRef(JT);return L.useEffect(()=>{for(const g of ZT){const x=e[g],v=m.current[g];x!==v&&(typeof e[g]>"u"||(g==="nodes"?t(x):g==="edges"?n(x):g==="minZoom"?i(x):g==="maxZoom"?r(x):g==="translateExtent"?s(x):g==="nodeExtent"?l(x):g==="ariaLabelConfig"?p.setState({ariaLabelConfig:wX(x)}):g==="fitView"?p.setState({fitViewQueued:x}):g==="fitViewOptions"?p.setState({fitViewOptions:x}):p.setState({[g]:x})))}m.current=e},ZT.map(g=>e[g])),null}function eC(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function FK(e){var i;const[t,n]=L.useState(e==="system"?null:e);return L.useEffect(()=>{if(e!=="system"){n(e);return}const r=eC(),s=()=>n(r!=null&&r.matches?"dark":"light");return s(),r==null||r.addEventListener("change",s),()=>{r==null||r.removeEventListener("change",s)}},[e]),t!==null?t:(i=eC())!=null&&i.matches?"dark":"light"}const tC=typeof document<"u"?document:null;function Km(e=null,t={target:tC,actInsideInputWithModifier:!0}){const[n,i]=L.useState(!1),r=L.useRef(!1),s=L.useRef(new Set([])),[l,c]=L.useMemo(()=>{if(e!==null){const p=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
395
- `).replace(`
396
-
397
- `,`
398
- +`).split(`
399
- `)),m=p.reduce((g,x)=>g.concat(...x),[]);return[p,m]}return[[],[]]},[e]);return L.useEffect(()=>{const f=(t==null?void 0:t.target)??tC,p=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=v=>{var T,C;if(r.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!r.current||r.current&&!p)&&eN(v))return!1;const A=iC(v.code,c);if(s.current.add(v[A]),nC(l,s.current,!1)){const N=((C=(T=v.composedPath)==null?void 0:T.call(v))==null?void 0:C[0])||v.target,R=(N==null?void 0:N.nodeName)==="BUTTON"||(N==null?void 0:N.nodeName)==="A";t.preventDefault!==!1&&(r.current||!R)&&v.preventDefault(),i(!0)}},g=v=>{const S=iC(v.code,c);nC(l,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(v[S]),v.key==="Meta"&&s.current.clear(),r.current=!1},x=()=>{s.current.clear(),i(!1)};return f==null||f.addEventListener("keydown",m),f==null||f.addEventListener("keyup",g),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{f==null||f.removeEventListener("keydown",m),f==null||f.removeEventListener("keyup",g),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,i]),n}function nC(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function iC(e,t){return t.includes(e)?"code":"key"}const GK=()=>{const e=Zn();return L.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,r,s],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??i,y:t.y??r,zoom:t.zoom??s},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:r,minZoom:s,maxZoom:l,panZoom:c}=e.getState(),f=X_(t,i,r,s,l,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(f,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:r,snapToGrid:s,domNode:l}=e.getState();if(!l)return t;const{x:c,y:f}=l.getBoundingClientRect(),p={x:t.x-c,y:t.y-f},m=n.snapGrid??r,g=n.snapToGrid??s;return cg(p,i,g,m)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:r,y:s}=i.getBoundingClientRect(),l=K0(t,n);return{x:l.x+r,y:l.y+s}}}),[])};function SN(e,t){const n=[],i=new Map,r=[];for(const s of e)if(s.type==="add"){r.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const l=i.get(s.id);l?l.push(s):i.set(s.id,[s])}for(const s of t){const l=i.get(s.id);if(!l){n.push(s);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...s};for(const f of l)qK(f,c);n.push(c)}return r.length&&r.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function qK(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function YK(e,t){return SN(e,t)}function VK(e,t){return SN(e,t)}function pd(e,t){return{id:e,type:"select",selected:t}}function eh(e,t=new Set,n=!1){const i=[];for(const[r,s]of e){const l=t.has(r);!(s.selected===void 0&&!l)&&s.selected!==l&&(n&&(s.selected=l),i.push(pd(s.id,l)))}return i}function rC({items:e=[],lookup:t}){var r;const n=[],i=new Map(e.map(s=>[s.id,s]));for(const[s,l]of e.entries()){const c=t.get(l.id),f=((r=c==null?void 0:c.internals)==null?void 0:r.userNode)??c;f!==void 0&&f!==l&&n.push({id:l.id,item:l,type:"replace"}),f===void 0&&n.push({item:l,type:"add",index:s})}for(const[s]of t)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function aC(e){return{id:e.id,type:"remove"}}const sC=e=>pX(e),XK=e=>Vk(e);function EN(e){return L.forwardRef(e)}const KK=typeof window<"u"?L.useLayoutEffect:L.useEffect;function lC(e){const[t,n]=L.useState(BigInt(0)),[i]=L.useState(()=>$K(()=>n(r=>r+BigInt(1))));return KK(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function $K(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const wN=L.createContext(null);function WK({children:e}){const t=Zn(),n=L.useCallback(c=>{const{nodes:f=[],setNodes:p,hasDefaultNodes:m,onNodesChange:g,nodeLookup:x,fitViewQueued:v,onNodesChangeMiddlewareMap:S}=t.getState();let A=f;for(const C of c)A=typeof C=="function"?C(A):C;let T=rC({items:A,lookup:x});for(const C of S.values())T=C(T);m&&p(A),T.length>0?g==null||g(T):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:C,nodes:N,setNodes:R}=t.getState();C&&R(N)})},[]),i=lC(n),r=L.useCallback(c=>{const{edges:f=[],setEdges:p,hasDefaultEdges:m,onEdgesChange:g,edgeLookup:x}=t.getState();let v=f;for(const S of c)v=typeof S=="function"?S(v):S;m?p(v):g&&g(rC({items:v,lookup:x}))},[]),s=lC(r),l=L.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return _.jsx(wN.Provider,{value:l,children:e})}function QK(){const e=L.useContext(wN);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const ZK=e=>!!e.panZoom;function Sx(){const e=GK(),t=Zn(),n=QK(),i=$t(ZK),r=L.useMemo(()=>{const s=g=>t.getState().nodeLookup.get(g),l=g=>{n.nodeQueue.push(g)},c=g=>{n.edgeQueue.push(g)},f=g=>{var C,N;const{nodeLookup:x,nodeOrigin:v}=t.getState(),S=sC(g)?g:x.get(g.id),A=S.parentId?Zk(S.position,S.measured,S.parentId,x,v):S.position,T={...S,position:A,width:((C=S.measured)==null?void 0:C.width)??S.width,height:((N=S.measured)==null?void 0:N.height)??S.height};return yh(T)},p=(g,x,v={replace:!1})=>{l(S=>S.map(A=>{if(A.id===g){const T=typeof x=="function"?x(A):x;return v.replace&&sC(T)?T:{...A,...T}}return A}))},m=(g,x,v={replace:!1})=>{c(S=>S.map(A=>{if(A.id===g){const T=typeof x=="function"?x(A):x;return v.replace&&XK(T)?T:{...A,...T}}return A}))};return{getNodes:()=>t.getState().nodes.map(g=>({...g})),getNode:g=>{var x;return(x=s(g))==null?void 0:x.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:g=[]}=t.getState();return g.map(x=>({...x}))},getEdge:g=>t.getState().edgeLookup.get(g),setNodes:l,setEdges:c,addNodes:g=>{const x=Array.isArray(g)?g:[g];n.nodeQueue.push(v=>[...v,...x])},addEdges:g=>{const x=Array.isArray(g)?g:[g];n.edgeQueue.push(v=>[...v,...x])},toObject:()=>{const{nodes:g=[],edges:x=[],transform:v}=t.getState(),[S,A,T]=v;return{nodes:g.map(C=>({...C})),edges:x.map(C=>({...C})),viewport:{x:S,y:A,zoom:T}}},deleteElements:async({nodes:g=[],edges:x=[]})=>{const{nodes:v,edges:S,onNodesDelete:A,onEdgesDelete:T,triggerNodeChanges:C,triggerEdgeChanges:N,onDelete:R,onBeforeDelete:O}=t.getState(),{nodes:H,edges:D}=await bX({nodesToRemove:g,edgesToRemove:x,nodes:v,edges:S,onBeforeDelete:O}),q=D.length>0,Z=H.length>0;if(q){const V=D.map(aC);T==null||T(D),N(V)}if(Z){const V=H.map(aC);A==null||A(H),C(V)}return(Z||q)&&(R==null||R({nodes:H,edges:D})),{deletedNodes:H,deletedEdges:D}},getIntersectingNodes:(g,x=!0,v)=>{const S=OT(g),A=S?g:f(g),T=v!==void 0;return A?(v||t.getState().nodes).filter(C=>{const N=t.getState().nodeLookup.get(C.id);if(N&&!S&&(C.id===g.id||!N.internals.positionAbsolute))return!1;const R=yh(T?C:N),O=Vm(R,A);return x&&O>0||O>=R.width*R.height||O>=A.width*A.height}):[]},isNodeIntersecting:(g,x,v=!0)=>{const A=OT(g)?g:f(g);if(!A)return!1;const T=Vm(A,x);return v&&T>0||T>=x.width*x.height||T>=A.width*A.height},updateNode:p,updateNodeData:(g,x,v={replace:!1})=>{p(g,S=>{const A=typeof x=="function"?x(S):x;return v.replace?{...S,data:A}:{...S,data:{...S.data,...A}}},v)},updateEdge:m,updateEdgeData:(g,x,v={replace:!1})=>{m(g,S=>{const A=typeof x=="function"?x(S):x;return v.replace?{...S,data:A}:{...S,data:{...S.data,...A}}},v)},getNodesBounds:g=>{const{nodeLookup:x,nodeOrigin:v}=t.getState();return mX(g,{nodeLookup:x,nodeOrigin:v})},getHandleConnections:({type:g,id:x,nodeId:v})=>{var S;return Array.from(((S=t.getState().connectionLookup.get(`${v}-${g}${x?`-${x}`:""}`))==null?void 0:S.values())??[])},getNodeConnections:({type:g,handleId:x,nodeId:v})=>{var S;return Array.from(((S=t.getState().connectionLookup.get(`${v}${g?x?`-${g}-${x}`:`-${g}`:""}`))==null?void 0:S.values())??[])},fitView:async g=>{const x=t.getState().fitViewResolver??EX();return t.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:x}),n.nodeQueue.push(v=>[...v]),x.promise}}},[]);return L.useMemo(()=>({...r,...e,viewportInitialized:i}),[i])}const oC=e=>e.selected,JK=typeof window<"u"?window:void 0;function e$({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Zn(),{deleteElements:i}=Sx(),r=Km(e,{actInsideInputWithModifier:!1}),s=Km(t,{target:JK});L.useEffect(()=>{if(r){const{edges:l,nodes:c}=n.getState();i({nodes:c.filter(oC),edges:l.filter(oC)}),n.setState({nodesSelectionActive:!1})}},[r]),L.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function t$(e){const t=Zn();L.useEffect(()=>{const n=()=>{var r,s,l,c;if(!e.current||!(((s=(r=e.current).checkVisibility)==null?void 0:s.call(r))??!0))return!1;const i=K_(e.current);(i.height===0||i.width===0)&&((c=(l=t.getState()).onError)==null||c.call(l,"004",go.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const Ex={position:"absolute",width:"100%",height:"100%",top:0,left:0},n$=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function i$({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=bd.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:f,translateExtent:p,minZoom:m,maxZoom:g,zoomActivationKeyCode:x,preventScrolling:v=!0,children:S,noWheelClassName:A,noPanClassName:T,onViewportChange:C,isControlledViewport:N,paneClickDistance:R,selectionOnDrag:O}){const H=Zn(),D=L.useRef(null),{userSelectionActive:q,lib:Z,connectionInProgress:V}=$t(n$,Qn),Y=Km(x),F=L.useRef();t$(D);const j=L.useCallback(ee=>{C==null||C({x:ee[0],y:ee[1],zoom:ee[2]}),N||H.setState({transform:ee})},[C,N]);return L.useEffect(()=>{if(D.current){F.current=sK({domNode:D.current,minZoom:m,maxZoom:g,translateExtent:p,viewport:f,onDraggingChange:z=>H.setState(K=>K.paneDragging===z?K:{paneDragging:z}),onPanZoomStart:(z,K)=>{const{onViewportChangeStart:G,onMoveStart:Q}=H.getState();Q==null||Q(z,K),G==null||G(K)},onPanZoom:(z,K)=>{const{onViewportChange:G,onMove:Q}=H.getState();Q==null||Q(z,K),G==null||G(K)},onPanZoomEnd:(z,K)=>{const{onViewportChangeEnd:G,onMoveEnd:Q}=H.getState();Q==null||Q(z,K),G==null||G(K)}});const{x:ee,y:P,zoom:W}=F.current.getViewport();return H.setState({panZoom:F.current,transform:[ee,P,W],domNode:D.current.closest(".react-flow")}),()=>{var z;(z=F.current)==null||z.destroy()}}},[]),L.useEffect(()=>{var ee;(ee=F.current)==null||ee.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:Y,preventScrolling:v,noPanClassName:T,userSelectionActive:q,noWheelClassName:A,lib:Z,onTransformChange:j,connectionInProgress:V,selectionOnDrag:O,paneClickDistance:R})},[e,t,n,i,r,s,l,c,Y,v,T,q,A,Z,j,V,O,R]),_.jsx("div",{className:"react-flow__renderer",ref:D,style:Ex,children:S})}const r$=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function a$(){const{userSelectionActive:e,userSelectionRect:t}=$t(r$,Qn);return e&&t?_.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const zv=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},s$=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function l$({isSelecting:e,selectionKeyPressed:t,selectionMode:n=qm.Full,panOnDrag:i,paneClickDistance:r,selectionOnDrag:s,onSelectionStart:l,onSelectionEnd:c,onPaneClick:f,onPaneContextMenu:p,onPaneScroll:m,onPaneMouseEnter:g,onPaneMouseMove:x,onPaneMouseLeave:v,children:S}){const A=Zn(),{userSelectionActive:T,elementsSelectable:C,dragging:N,connectionInProgress:R}=$t(s$,Qn),O=C&&(e||T),H=L.useRef(null),D=L.useRef(),q=L.useRef(new Set),Z=L.useRef(new Set),V=L.useRef(!1),Y=G=>{if(V.current||R){V.current=!1;return}f==null||f(G),A.getState().resetSelectedElements(),A.setState({nodesSelectionActive:!1})},F=G=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){G.preventDefault();return}p==null||p(G)},j=m?G=>m(G):void 0,ee=G=>{V.current&&(G.stopPropagation(),V.current=!1)},P=G=>{var ie,de;const{domNode:Q}=A.getState();if(D.current=Q==null?void 0:Q.getBoundingClientRect(),!D.current)return;const I=G.target===H.current;if(!I&&!!G.target.closest(".nokey")||!e||!(s&&I||t)||G.button!==0||!G.isPrimary)return;(de=(ie=G.target)==null?void 0:ie.setPointerCapture)==null||de.call(ie,G.pointerId),V.current=!1;const{x:X,y:ce}=bl(G.nativeEvent,D.current);A.setState({userSelectionRect:{width:0,height:0,startX:X,startY:ce,x:X,y:ce}}),I||(G.stopPropagation(),G.preventDefault())},W=G=>{const{userSelectionRect:Q,transform:I,nodeLookup:$,edgeLookup:ne,connectionLookup:X,triggerNodeChanges:ce,triggerEdgeChanges:ie,defaultEdgeOptions:de,resetSelectedElements:xe}=A.getState();if(!D.current||!Q)return;const{x:me,y:le}=bl(G.nativeEvent,D.current),{startX:Re,startY:je}=Q;if(!V.current){const Ue=t?0:r;if(Math.hypot(me-Re,le-je)<=Ue)return;xe(),l==null||l(G)}V.current=!0;const Ie={startX:Re,startY:je,x:me<Re?me:Re,y:le<je?le:je,width:Math.abs(me-Re),height:Math.abs(le-je)},He=q.current,Qe=Z.current;q.current=new Set(V_($,Ie,I,n===qm.Partial,!0).map(Ue=>Ue.id)),Z.current=new Set;const ot=(de==null?void 0:de.selectable)??!0;for(const Ue of q.current){const wt=X.get(Ue);if(wt)for(const{edgeId:_n}of wt.values()){const Sn=ne.get(_n);Sn&&(Sn.selectable??ot)&&Z.current.add(_n)}}if(!DT(He,q.current)){const Ue=eh($,q.current,!0);ce(Ue)}if(!DT(Qe,Z.current)){const Ue=eh(ne,Z.current);ie(Ue)}A.setState({userSelectionRect:Ie,userSelectionActive:!0,nodesSelectionActive:!1})},z=G=>{var Q,I;G.button===0&&((I=(Q=G.target)==null?void 0:Q.releasePointerCapture)==null||I.call(Q,G.pointerId),!T&&G.target===H.current&&A.getState().userSelectionRect&&(Y==null||Y(G)),A.setState({userSelectionActive:!1,userSelectionRect:null}),V.current&&(c==null||c(G),A.setState({nodesSelectionActive:q.current.size>0})))},K=i===!0||Array.isArray(i)&&i.includes(0);return _.jsxs("div",{className:zi(["react-flow__pane",{draggable:K,dragging:N,selection:e}]),onClick:O?void 0:zv(Y,H),onContextMenu:zv(F,H),onWheel:zv(j,H),onPointerEnter:O?void 0:g,onPointerMove:O?W:x,onPointerUp:O?z:void 0,onPointerDownCapture:O?P:void 0,onClickCapture:O?ee:void 0,onPointerLeave:v,ref:H,style:Ex,children:[S,_.jsx(a$,{})]})}function G1({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:l,nodeLookup:c,onError:f}=t.getState(),p=c.get(e);if(!p){f==null||f("012",go.error012(e));return}t.setState({nodesSelectionActive:!1}),p.selected?(n||p.selected&&l)&&(s({nodes:[p],edges:[]}),requestAnimationFrame(()=>{var m;return(m=i==null?void 0:i.current)==null?void 0:m.blur()})):r([e])}function TN({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:l}){const c=Zn(),[f,p]=L.useState(!1),m=L.useRef();return L.useEffect(()=>{m.current=VX({getStoreItems:()=>c.getState(),onNodeMouseDown:g=>{G1({id:g,store:c,nodeRef:e})},onDragStart:()=>{p(!0)},onDragStop:()=>{p(!1)}})},[]),L.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:s,nodeId:r,nodeClickDistance:l}),()=>{var g;(g=m.current)==null||g.destroy()}},[n,i,t,s,e,r,l]),f}const o$=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function CN(){const e=Zn();return L.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:l,onError:c,updateNodePositions:f,nodeLookup:p,nodeOrigin:m}=e.getState(),g=new Map,x=o$(l),v=r?s[0]:5,S=r?s[1]:5,A=n.direction.x*v*n.factor,T=n.direction.y*S*n.factor;for(const[,C]of p){if(!x(C))continue;let N={x:C.internals.positionAbsolute.x+A,y:C.internals.positionAbsolute.y+T};r&&(N=og(N,s));const{position:R,positionAbsolute:O}=Xk({nodeId:C.id,nextPosition:N,nodeLookup:p,nodeExtent:i,nodeOrigin:m,onError:c});C.position=R,C.internals.positionAbsolute=O,g.set(C.id,C)}f(g)},[])}const eS=L.createContext(null),c$=eS.Provider;eS.Consumer;const AN=()=>L.useContext(eS),u$=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),d$=(e,t,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:s,connection:l}=i,{fromHandle:c,toHandle:f,isValid:p}=l,m=(f==null?void 0:f.nodeId)===e&&(f==null?void 0:f.id)===t&&(f==null?void 0:f.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:m,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:s===mh.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!r,valid:m&&p}};function f$({type:e="source",position:t=We.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:l,onConnect:c,children:f,className:p,onMouseDown:m,onTouchStart:g,...x},v){var W,z;const S=l||null,A=e==="target",T=Zn(),C=AN(),{connectOnClick:N,noPanClassName:R,rfId:O}=$t(u$,Qn),{connectingFrom:H,connectingTo:D,clickConnecting:q,isPossibleEndHandle:Z,connectionInProcess:V,clickConnectionInProcess:Y,valid:F}=$t(d$(C,S,e),Qn);C||(z=(W=T.getState()).onError)==null||z.call(W,"010",go.error010());const j=K=>{const{defaultEdgeOptions:G,onConnect:Q,hasDefaultEdges:I}=T.getState(),$={...G,...K};if(I){const{edges:ne,setEdges:X}=T.getState();X(kX($,ne))}Q==null||Q($),c==null||c($)},ee=K=>{if(!C)return;const G=tN(K.nativeEvent);if(r&&(G&&K.button===0||!G)){const Q=T.getState();F1.onPointerDown(K.nativeEvent,{handleDomNode:K.currentTarget,autoPanOnConnect:Q.autoPanOnConnect,connectionMode:Q.connectionMode,connectionRadius:Q.connectionRadius,domNode:Q.domNode,nodeLookup:Q.nodeLookup,lib:Q.lib,isTarget:A,handleId:S,nodeId:C,flowId:Q.rfId,panBy:Q.panBy,cancelConnection:Q.cancelConnection,onConnectStart:Q.onConnectStart,onConnectEnd:(...I)=>{var $,ne;return(ne=($=T.getState()).onConnectEnd)==null?void 0:ne.call($,...I)},updateConnection:Q.updateConnection,onConnect:j,isValidConnection:n||((...I)=>{var $,ne;return((ne=($=T.getState()).isValidConnection)==null?void 0:ne.call($,...I))??!0}),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:Q.autoPanSpeed,dragThreshold:Q.connectionDragThreshold})}G?m==null||m(K):g==null||g(K)},P=K=>{const{onClickConnectStart:G,onClickConnectEnd:Q,connectionClickStartHandle:I,connectionMode:$,isValidConnection:ne,lib:X,rfId:ce,nodeLookup:ie,connection:de}=T.getState();if(!C||!I&&!r)return;if(!I){G==null||G(K.nativeEvent,{nodeId:C,handleId:S,handleType:e}),T.setState({connectionClickStartHandle:{nodeId:C,type:e,id:S}});return}const xe=Jk(K.target),me=n||ne,{connection:le,isValid:Re}=F1.isValid(K.nativeEvent,{handle:{nodeId:C,id:S,type:e},connectionMode:$,fromNodeId:I.nodeId,fromHandleId:I.id||null,fromType:I.type,isValidConnection:me,flowId:ce,doc:xe,lib:X,nodeLookup:ie});Re&&le&&j(le);const je=structuredClone(de);delete je.inProgress,je.toPosition=je.toHandle?je.toHandle.position:null,Q==null||Q(K,je),T.setState({connectionClickStartHandle:null})};return _.jsx("div",{"data-handleid":S,"data-nodeid":C,"data-handlepos":t,"data-id":`${O}-${C}-${S}-${e}`,className:zi(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",R,p,{source:!A,target:A,connectable:i,connectablestart:r,connectableend:s,clickconnecting:q,connectingfrom:H,connectingto:D,valid:F,connectionindicator:i&&(!V||Z)&&(V||Y?s:r)}]),onMouseDown:ee,onTouchStart:ee,onClick:N?P:void 0,ref:v,...x,children:f})}const Sl=L.memo(EN(f$));function h$({data:e,isConnectable:t,sourcePosition:n=We.Bottom}){return _.jsxs(_.Fragment,{children:[e==null?void 0:e.label,_.jsx(Sl,{type:"source",position:n,isConnectable:t})]})}function p$({data:e,isConnectable:t,targetPosition:n=We.Top,sourcePosition:i=We.Bottom}){return _.jsxs(_.Fragment,{children:[_.jsx(Sl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,_.jsx(Sl,{type:"source",position:i,isConnectable:t})]})}function m$(){return null}function g$({data:e,isConnectable:t,targetPosition:n=We.Top}){return _.jsxs(_.Fragment,{children:[_.jsx(Sl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const $0={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},cC={input:h$,default:p$,output:g$,group:m$};function y$(e){var t,n,i,r;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((i=e.style)==null?void 0:i.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const x$=e=>{const{width:t,height:n,x:i,y:r}=lg(e.nodeLookup,{filter:s=>!!s.selected});return{width:xl(t)?t:null,height:xl(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${r}px)`}};function b$({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=Zn(),{width:r,height:s,transformString:l,userSelectionActive:c}=$t(x$,Qn),f=CN(),p=L.useRef(null);L.useEffect(()=>{var v;n||(v=p.current)==null||v.focus({preventScroll:!0})},[n]);const m=!c&&r!==null&&s!==null;if(TN({nodeRef:p,disabled:!m}),!m)return null;const g=e?v=>{const S=i.getState().nodes.filter(A=>A.selected);e(v,S)}:void 0,x=v=>{Object.prototype.hasOwnProperty.call($0,v.key)&&(v.preventDefault(),f({direction:$0[v.key],factor:v.shiftKey?4:1}))};return _.jsx("div",{className:zi(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:_.jsx("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:x,style:{width:r,height:s}})})}const uC=typeof window<"u"?window:void 0,v$=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function MN({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:f,selectionKeyCode:p,selectionOnDrag:m,selectionMode:g,onSelectionStart:x,onSelectionEnd:v,multiSelectionKeyCode:S,panActivationKeyCode:A,zoomActivationKeyCode:T,elementsSelectable:C,zoomOnScroll:N,zoomOnPinch:R,panOnScroll:O,panOnScrollSpeed:H,panOnScrollMode:D,zoomOnDoubleClick:q,panOnDrag:Z,defaultViewport:V,translateExtent:Y,minZoom:F,maxZoom:j,preventScrolling:ee,onSelectionContextMenu:P,noWheelClassName:W,noPanClassName:z,disableKeyboardA11y:K,onViewportChange:G,isControlledViewport:Q}){const{nodesSelectionActive:I,userSelectionActive:$}=$t(v$,Qn),ne=Km(p,{target:uC}),X=Km(A,{target:uC}),ce=X||Z,ie=X||O,de=m&&ce!==!0,xe=ne||$||de;return e$({deleteKeyCode:f,multiSelectionKeyCode:S}),_.jsx(i$,{onPaneContextMenu:s,elementsSelectable:C,zoomOnScroll:N,zoomOnPinch:R,panOnScroll:ie,panOnScrollSpeed:H,panOnScrollMode:D,zoomOnDoubleClick:q,panOnDrag:!ne&&ce,defaultViewport:V,translateExtent:Y,minZoom:F,maxZoom:j,zoomActivationKeyCode:T,preventScrolling:ee,noWheelClassName:W,noPanClassName:z,onViewportChange:G,isControlledViewport:Q,paneClickDistance:c,selectionOnDrag:de,children:_.jsxs(l$,{onSelectionStart:x,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:l,panOnDrag:ce,isSelecting:!!xe,selectionMode:g,selectionKeyPressed:ne,paneClickDistance:c,selectionOnDrag:de,children:[e,I&&_.jsx(b$,{onSelectionContextMenu:P,noPanClassName:z,disableKeyboardA11y:K})]})})}MN.displayName="FlowRenderer";const _$=L.memo(MN),S$=e=>t=>e?V_(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function E$(e){return $t(L.useCallback(S$(e),[e]),Qn)}const w$=e=>e.updateNodeInternals;function T$(){const e=$t(w$),[t]=L.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(r=>{const s=r.target.getAttribute("data-id");i.set(s,{id:s,nodeElement:r.target,force:!0})}),e(i)}));return L.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function C$({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=Zn(),s=L.useRef(null),l=L.useRef(null),c=L.useRef(e.sourcePosition),f=L.useRef(e.targetPosition),p=L.useRef(t),m=n&&!!e.internals.handleBounds;return L.useEffect(()=>{s.current&&!e.hidden&&(!m||l.current!==s.current)&&(l.current&&(i==null||i.unobserve(l.current)),i==null||i.observe(s.current),l.current=s.current)},[m,e.hidden]),L.useEffect(()=>()=>{l.current&&(i==null||i.unobserve(l.current),l.current=null)},[]),L.useEffect(()=>{if(s.current){const g=p.current!==t,x=c.current!==e.sourcePosition,v=f.current!==e.targetPosition;(g||x||v)&&(p.current=t,c.current=e.sourcePosition,f.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function A$({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:s,onDoubleClick:l,nodesDraggable:c,elementsSelectable:f,nodesConnectable:p,nodesFocusable:m,resizeObserver:g,noDragClassName:x,noPanClassName:v,disableKeyboardA11y:S,rfId:A,nodeTypes:T,nodeClickDistance:C,onError:N}){const{node:R,internals:O,isParent:H}=$t(me=>{const le=me.nodeLookup.get(e),Re=me.parentLookup.has(e);return{node:le,internals:le.internals,isParent:Re}},Qn);let D=R.type||"default",q=(T==null?void 0:T[D])||cC[D];q===void 0&&(N==null||N("003",go.error003(D)),D="default",q=(T==null?void 0:T.default)||cC.default);const Z=!!(R.draggable||c&&typeof R.draggable>"u"),V=!!(R.selectable||f&&typeof R.selectable>"u"),Y=!!(R.connectable||p&&typeof R.connectable>"u"),F=!!(R.focusable||m&&typeof R.focusable>"u"),j=Zn(),ee=Qk(R),P=C$({node:R,nodeType:D,hasDimensions:ee,resizeObserver:g}),W=TN({nodeRef:P,disabled:R.hidden||!Z,noDragClassName:x,handleSelector:R.dragHandle,nodeId:e,isSelectable:V,nodeClickDistance:C}),z=CN();if(R.hidden)return null;const K=dc(R),G=y$(R),Q=V||Z||t||n||i||r,I=n?me=>n(me,{...O.userNode}):void 0,$=i?me=>i(me,{...O.userNode}):void 0,ne=r?me=>r(me,{...O.userNode}):void 0,X=s?me=>s(me,{...O.userNode}):void 0,ce=l?me=>l(me,{...O.userNode}):void 0,ie=me=>{const{selectNodesOnDrag:le,nodeDragThreshold:Re}=j.getState();V&&(!le||!Z||Re>0)&&G1({id:e,store:j,nodeRef:P}),t&&t(me,{...O.userNode})},de=me=>{if(!(eN(me.nativeEvent)||S)){if(Fk.includes(me.key)&&V){const le=me.key==="Escape";G1({id:e,store:j,unselect:le,nodeRef:P})}else if(Z&&R.selected&&Object.prototype.hasOwnProperty.call($0,me.key)){me.preventDefault();const{ariaLabelConfig:le}=j.getState();j.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:me.key.replace("Arrow","").toLowerCase(),x:~~O.positionAbsolute.x,y:~~O.positionAbsolute.y})}),z({direction:$0[me.key],factor:me.shiftKey?4:1})}}},xe=()=>{var Qe;if(S||!((Qe=P.current)!=null&&Qe.matches(":focus-visible")))return;const{transform:me,width:le,height:Re,autoPanOnNodeFocus:je,setCenter:Ie}=j.getState();if(!je)return;V_(new Map([[e,R]]),{x:0,y:0,width:le,height:Re},me,!0).length>0||Ie(R.position.x+K.width/2,R.position.y+K.height/2,{zoom:me[2]})};return _.jsx("div",{className:zi(["react-flow__node",`react-flow__node-${D}`,{[v]:Z},R.className,{selected:R.selected,selectable:V,parent:H,draggable:Z,dragging:W}]),ref:P,style:{zIndex:O.z,transform:`translate(${O.positionAbsolute.x}px,${O.positionAbsolute.y}px)`,pointerEvents:Q?"all":"none",visibility:ee?"visible":"hidden",...R.style,...G},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:$,onMouseLeave:ne,onContextMenu:X,onClick:ie,onDoubleClick:ce,onKeyDown:F?de:void 0,tabIndex:F?0:void 0,onFocus:F?xe:void 0,role:R.ariaRole??(F?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${bN}-${A}`,"aria-label":R.ariaLabel,...R.domAttributes,children:_.jsx(c$,{value:e,children:_.jsx(q,{id:e,data:R.data,type:D,positionAbsoluteX:O.positionAbsolute.x,positionAbsoluteY:O.positionAbsolute.y,selected:R.selected??!1,selectable:V,draggable:Z,deletable:R.deletable??!0,isConnectable:Y,sourcePosition:R.sourcePosition,targetPosition:R.targetPosition,dragging:W,dragHandle:R.dragHandle,zIndex:O.z,parentId:R.parentId,...K})})})}var M$=L.memo(A$);const R$=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function RN(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=$t(R$,Qn),l=E$(e.onlyRenderVisibleElements),c=T$();return _.jsx("div",{className:"react-flow__nodes",style:Ex,children:l.map(f=>_.jsx(M$,{id:f,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:s},f))})}RN.displayName="NodeRenderer";const k$=L.memo(RN);function N$(e){return $t(L.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const s=n.nodeLookup.get(r.source),l=n.nodeLookup.get(r.target);s&&l&&AX({sourceNode:s,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),Qn)}const O$=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return _.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},D$=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return _.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},dC={[Ym.Arrow]:O$,[Ym.ArrowClosed]:D$};function z$(e){const t=Zn();return L.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(dC,e)?dC[e]:((s=(r=t.getState()).onError)==null||s.call(r,"009",go.error009(e)),null)},[e])}const B$=({id:e,type:t,color:n,width:i=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const f=z$(t);return f?_.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:c,refX:"0",refY:"0",children:_.jsx(f,{color:n,strokeWidth:l})}):null},kN=({defaultColor:e,rfId:t})=>{const n=$t(s=>s.edges),i=$t(s=>s.defaultEdgeOptions),r=L.useMemo(()=>BX(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return r.length?_.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:_.jsx("defs",{children:r.map(s=>_.jsx(B$,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};kN.displayName="MarkerDefinitions";var L$=L.memo(kN);function NN({x:e,y:t,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:f,className:p,...m}){const[g,x]=L.useState({x:1,y:0,width:0,height:0}),v=zi(["react-flow__edge-textwrapper",p]),S=L.useRef(null);return L.useEffect(()=>{if(S.current){const A=S.current.getBBox();x({x:A.x,y:A.y,width:A.width,height:A.height})}},[n]),n?_.jsxs("g",{transform:`translate(${e-g.width/2} ${t-g.height/2})`,className:v,visibility:g.width?"visible":"hidden",...m,children:[r&&_.jsx("rect",{width:g.width+2*l[0],x:-l[0],y:-l[1],height:g.height+2*l[1],className:"react-flow__edge-textbg",style:s,rx:c,ry:c}),_.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:S,style:i,children:n}),f]}):null}NN.displayName="EdgeText";const j$=L.memo(NN);function wx({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:f,interactionWidth:p=20,...m}){return _.jsxs(_.Fragment,{children:[_.jsx("path",{...m,d:e,fill:"none",className:zi(["react-flow__edge-path",m.className])}),p?_.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}):null,i&&xl(t)&&xl(n)?_.jsx(j$,{x:t,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:f}):null]})}function fC({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===We.Left||e===We.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function ON({sourceX:e,sourceY:t,sourcePosition:n=We.Bottom,targetX:i,targetY:r,targetPosition:s=We.Top}){const[l,c]=fC({pos:n,x1:e,y1:t,x2:i,y2:r}),[f,p]=fC({pos:s,x1:i,y1:r,x2:e,y2:t}),[m,g,x,v]=nN({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:f,targetControlY:p});return[`M${e},${t} C${l},${c} ${f},${p} ${i},${r}`,m,g,x,v]}function DN(e){return L.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:l,targetPosition:c,label:f,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:v,style:S,markerEnd:A,markerStart:T,interactionWidth:C})=>{const[N,R,O]=ON({sourceX:n,sourceY:i,sourcePosition:l,targetX:r,targetY:s,targetPosition:c}),H=e.isInternal?void 0:t;return _.jsx(wx,{id:H,path:N,labelX:R,labelY:O,label:f,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:v,style:S,markerEnd:A,markerStart:T,interactionWidth:C})})}const I$=DN({isInternal:!1}),zN=DN({isInternal:!0});I$.displayName="SimpleBezierEdge";zN.displayName="SimpleBezierEdgeInternal";function BN(e){return L.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:x,sourcePosition:v=We.Bottom,targetPosition:S=We.Top,markerEnd:A,markerStart:T,pathOptions:C,interactionWidth:N})=>{const[R,O,H]=U1({sourceX:n,sourceY:i,sourcePosition:v,targetX:r,targetY:s,targetPosition:S,borderRadius:C==null?void 0:C.borderRadius,offset:C==null?void 0:C.offset,stepPosition:C==null?void 0:C.stepPosition}),D=e.isInternal?void 0:t;return _.jsx(wx,{id:D,path:R,labelX:O,labelY:H,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:x,markerEnd:A,markerStart:T,interactionWidth:N})})}const LN=BN({isInternal:!1}),jN=BN({isInternal:!0});LN.displayName="SmoothStepEdge";jN.displayName="SmoothStepEdgeInternal";function IN(e){return L.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return _.jsx(LN,{...n,id:i,pathOptions:L.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const U$=IN({isInternal:!1}),UN=IN({isInternal:!0});U$.displayName="StepEdge";UN.displayName="StepEdgeInternal";function HN(e){return L.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:x,markerEnd:v,markerStart:S,interactionWidth:A})=>{const[T,C,N]=aN({sourceX:n,sourceY:i,targetX:r,targetY:s}),R=e.isInternal?void 0:t;return _.jsx(wx,{id:R,path:T,labelX:C,labelY:N,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:x,markerEnd:v,markerStart:S,interactionWidth:A})})}const H$=HN({isInternal:!1}),PN=HN({isInternal:!0});H$.displayName="StraightEdge";PN.displayName="StraightEdgeInternal";function FN(e){return L.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:l=We.Bottom,targetPosition:c=We.Top,label:f,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:v,style:S,markerEnd:A,markerStart:T,pathOptions:C,interactionWidth:N})=>{const[R,O,H]=iN({sourceX:n,sourceY:i,sourcePosition:l,targetX:r,targetY:s,targetPosition:c,curvature:C==null?void 0:C.curvature}),D=e.isInternal?void 0:t;return _.jsx(wx,{id:D,path:R,labelX:O,labelY:H,label:f,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:v,style:S,markerEnd:A,markerStart:T,interactionWidth:N})})}const P$=FN({isInternal:!1}),GN=FN({isInternal:!0});P$.displayName="BezierEdge";GN.displayName="BezierEdgeInternal";const hC={default:GN,straight:PN,step:UN,smoothstep:jN,simplebezier:zN},pC={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},F$=(e,t,n)=>n===We.Left?e-t:n===We.Right?e+t:e,G$=(e,t,n)=>n===We.Top?e-t:n===We.Bottom?e+t:e,mC="react-flow__edgeupdater";function gC({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:l,type:c}){return _.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:l,className:zi([mC,`${mC}-${c}`]),cx:F$(t,i,e),cy:G$(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function q$({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:r,targetX:s,targetY:l,sourcePosition:c,targetPosition:f,onReconnect:p,onReconnectStart:m,onReconnectEnd:g,setReconnecting:x,setUpdateHover:v}){const S=Zn(),A=(O,H)=>{if(O.button!==0)return;const{autoPanOnConnect:D,domNode:q,connectionMode:Z,connectionRadius:V,lib:Y,onConnectStart:F,cancelConnection:j,nodeLookup:ee,rfId:P,panBy:W,updateConnection:z}=S.getState(),K=H.type==="target",G=($,ne)=>{x(!1),g==null||g($,n,H.type,ne)},Q=$=>p==null?void 0:p(n,$),I=($,ne)=>{x(!0),m==null||m(O,n,H.type),F==null||F($,ne)};F1.onPointerDown(O.nativeEvent,{autoPanOnConnect:D,connectionMode:Z,connectionRadius:V,domNode:q,handleId:H.id,nodeId:H.nodeId,nodeLookup:ee,isTarget:K,edgeUpdaterType:H.type,lib:Y,flowId:P,cancelConnection:j,panBy:W,isValidConnection:(...$)=>{var ne,X;return((X=(ne=S.getState()).isValidConnection)==null?void 0:X.call(ne,...$))??!0},onConnect:Q,onConnectStart:I,onConnectEnd:(...$)=>{var ne,X;return(X=(ne=S.getState()).onConnectEnd)==null?void 0:X.call(ne,...$)},onReconnectEnd:G,updateConnection:z,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.getState().connectionDragThreshold,handleDomNode:O.currentTarget})},T=O=>A(O,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),C=O=>A(O,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),N=()=>v(!0),R=()=>v(!1);return _.jsxs(_.Fragment,{children:[(e===!0||e==="source")&&_.jsx(gC,{position:c,centerX:i,centerY:r,radius:t,onMouseDown:T,onMouseEnter:N,onMouseOut:R,type:"source"}),(e===!0||e==="target")&&_.jsx(gC,{position:f,centerX:s,centerY:l,radius:t,onMouseDown:C,onMouseEnter:N,onMouseOut:R,type:"target"})]})}function Y$({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:s,onContextMenu:l,onMouseEnter:c,onMouseMove:f,onMouseLeave:p,reconnectRadius:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:v,rfId:S,edgeTypes:A,noPanClassName:T,onError:C,disableKeyboardA11y:N}){let R=$t(Ie=>Ie.edgeLookup.get(e));const O=$t(Ie=>Ie.defaultEdgeOptions);R=O?{...O,...R}:R;let H=R.type||"default",D=(A==null?void 0:A[H])||hC[H];D===void 0&&(C==null||C("011",go.error011(H)),H="default",D=(A==null?void 0:A.default)||hC.default);const q=!!(R.focusable||t&&typeof R.focusable>"u"),Z=typeof g<"u"&&(R.reconnectable||n&&typeof R.reconnectable>"u"),V=!!(R.selectable||i&&typeof R.selectable>"u"),Y=L.useRef(null),[F,j]=L.useState(!1),[ee,P]=L.useState(!1),W=Zn(),{zIndex:z,sourceX:K,sourceY:G,targetX:Q,targetY:I,sourcePosition:$,targetPosition:ne}=$t(L.useCallback(Ie=>{const He=Ie.nodeLookup.get(R.source),Qe=Ie.nodeLookup.get(R.target);if(!He||!Qe)return{zIndex:R.zIndex,...pC};const ot=zX({id:e,sourceNode:He,targetNode:Qe,sourceHandle:R.sourceHandle||null,targetHandle:R.targetHandle||null,connectionMode:Ie.connectionMode,onError:C});return{zIndex:CX({selected:R.selected,zIndex:R.zIndex,sourceNode:He,targetNode:Qe,elevateOnSelect:Ie.elevateEdgesOnSelect,zIndexMode:Ie.zIndexMode}),...ot||pC}},[R.source,R.target,R.sourceHandle,R.targetHandle,R.selected,R.zIndex]),Qn),X=L.useMemo(()=>R.markerStart?`url('#${H1(R.markerStart,S)}')`:void 0,[R.markerStart,S]),ce=L.useMemo(()=>R.markerEnd?`url('#${H1(R.markerEnd,S)}')`:void 0,[R.markerEnd,S]);if(R.hidden||K===null||G===null||Q===null||I===null)return null;const ie=Ie=>{var Ue;const{addSelectedEdges:He,unselectNodesAndEdges:Qe,multiSelectionActive:ot}=W.getState();V&&(W.setState({nodesSelectionActive:!1}),R.selected&&ot?(Qe({nodes:[],edges:[R]}),(Ue=Y.current)==null||Ue.blur()):He([e])),r&&r(Ie,R)},de=s?Ie=>{s(Ie,{...R})}:void 0,xe=l?Ie=>{l(Ie,{...R})}:void 0,me=c?Ie=>{c(Ie,{...R})}:void 0,le=f?Ie=>{f(Ie,{...R})}:void 0,Re=p?Ie=>{p(Ie,{...R})}:void 0,je=Ie=>{var He;if(!N&&Fk.includes(Ie.key)&&V){const{unselectNodesAndEdges:Qe,addSelectedEdges:ot}=W.getState();Ie.key==="Escape"?((He=Y.current)==null||He.blur(),Qe({edges:[R]})):ot([e])}};return _.jsx("svg",{style:{zIndex:z},children:_.jsxs("g",{className:zi(["react-flow__edge",`react-flow__edge-${H}`,R.className,T,{selected:R.selected,animated:R.animated,inactive:!V&&!r,updating:F,selectable:V}]),onClick:ie,onDoubleClick:de,onContextMenu:xe,onMouseEnter:me,onMouseMove:le,onMouseLeave:Re,onKeyDown:q?je:void 0,tabIndex:q?0:void 0,role:R.ariaRole??(q?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":R.ariaLabel===null?void 0:R.ariaLabel||`Edge from ${R.source} to ${R.target}`,"aria-describedby":q?`${vN}-${S}`:void 0,ref:Y,...R.domAttributes,children:[!ee&&_.jsx(D,{id:e,source:R.source,target:R.target,type:R.type,selected:R.selected,animated:R.animated,selectable:V,deletable:R.deletable??!0,label:R.label,labelStyle:R.labelStyle,labelShowBg:R.labelShowBg,labelBgStyle:R.labelBgStyle,labelBgPadding:R.labelBgPadding,labelBgBorderRadius:R.labelBgBorderRadius,sourceX:K,sourceY:G,targetX:Q,targetY:I,sourcePosition:$,targetPosition:ne,data:R.data,style:R.style,sourceHandleId:R.sourceHandle,targetHandleId:R.targetHandle,markerStart:X,markerEnd:ce,pathOptions:"pathOptions"in R?R.pathOptions:void 0,interactionWidth:R.interactionWidth}),Z&&_.jsx(q$,{edge:R,isReconnectable:Z,reconnectRadius:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:v,sourceX:K,sourceY:G,targetX:Q,targetY:I,sourcePosition:$,targetPosition:ne,setUpdateHover:j,setReconnecting:P})]})})}var V$=L.memo(Y$);const X$=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function qN({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:s,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:f,onEdgeMouseLeave:p,onEdgeClick:m,reconnectRadius:g,onEdgeDoubleClick:x,onReconnectStart:v,onReconnectEnd:S,disableKeyboardA11y:A}){const{edgesFocusable:T,edgesReconnectable:C,elementsSelectable:N,onError:R}=$t(X$,Qn),O=N$(t);return _.jsxs("div",{className:"react-flow__edges",children:[_.jsx(L$,{defaultColor:e,rfId:n}),O.map(H=>_.jsx(V$,{id:H,edgesFocusable:T,edgesReconnectable:C,elementsSelectable:N,noPanClassName:r,onReconnect:s,onContextMenu:l,onMouseEnter:c,onMouseMove:f,onMouseLeave:p,onClick:m,reconnectRadius:g,onDoubleClick:x,onReconnectStart:v,onReconnectEnd:S,rfId:n,onError:R,edgeTypes:i,disableKeyboardA11y:A},H))]})}qN.displayName="EdgeRenderer";const K$=L.memo(qN),$$=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function W$({children:e}){const t=$t($$);return _.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Q$(e){const t=Sx(),n=L.useRef(!1);L.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Z$=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function J$(e){const t=$t(Z$),n=Zn();return L.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function eW(e){return e.connection.inProgress?{...e.connection,to:cg(e.connection.to,e.transform)}:{...e.connection}}function tW(e){return eW}function nW(e){const t=tW();return $t(t,Qn)}const iW=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function rW({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:s,height:l,isValid:c,inProgress:f}=$t(iW,Qn);return!(s&&r&&f)?null:_.jsx("svg",{style:e,width:s,height:l,className:"react-flow__connectionline react-flow__container",children:_.jsx("g",{className:zi(["react-flow__connection",Yk(c)]),children:_.jsx(YN,{style:t,type:n,CustomComponent:i,isValid:c})})})}const YN=({style:e,type:t=su.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:l,fromHandle:c,fromPosition:f,to:p,toNode:m,toHandle:g,toPosition:x,pointer:v}=nW();if(!r)return;if(n)return _.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:c,fromX:s.x,fromY:s.y,toX:p.x,toY:p.y,fromPosition:f,toPosition:x,connectionStatus:Yk(i),toNode:m,toHandle:g,pointer:v});let S="";const A={sourceX:s.x,sourceY:s.y,sourcePosition:f,targetX:p.x,targetY:p.y,targetPosition:x};switch(t){case su.Bezier:[S]=iN(A);break;case su.SimpleBezier:[S]=ON(A);break;case su.Step:[S]=U1({...A,borderRadius:0});break;case su.SmoothStep:[S]=U1(A);break;default:[S]=aN(A)}return _.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:e})};YN.displayName="ConnectionLine";const aW={};function yC(e=aW){L.useRef(e),Zn(),L.useEffect(()=>{},[e])}function sW(){Zn(),L.useRef(!1),L.useEffect(()=>{},[])}function VN({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:s,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:m,onSelectionContextMenu:g,onSelectionStart:x,onSelectionEnd:v,connectionLineType:S,connectionLineStyle:A,connectionLineComponent:T,connectionLineContainerStyle:C,selectionKeyCode:N,selectionOnDrag:R,selectionMode:O,multiSelectionKeyCode:H,panActivationKeyCode:D,zoomActivationKeyCode:q,deleteKeyCode:Z,onlyRenderVisibleElements:V,elementsSelectable:Y,defaultViewport:F,translateExtent:j,minZoom:ee,maxZoom:P,preventScrolling:W,defaultMarkerColor:z,zoomOnScroll:K,zoomOnPinch:G,panOnScroll:Q,panOnScrollSpeed:I,panOnScrollMode:$,zoomOnDoubleClick:ne,panOnDrag:X,onPaneClick:ce,onPaneMouseEnter:ie,onPaneMouseMove:de,onPaneMouseLeave:xe,onPaneScroll:me,onPaneContextMenu:le,paneClickDistance:Re,nodeClickDistance:je,onEdgeContextMenu:Ie,onEdgeMouseEnter:He,onEdgeMouseMove:Qe,onEdgeMouseLeave:ot,reconnectRadius:Ue,onReconnect:wt,onReconnectStart:_n,onReconnectEnd:Sn,noDragClassName:hn,noWheelClassName:oi,noPanClassName:Ur,disableKeyboardA11y:Ci,nodeExtent:Wt,rfId:sr,viewport:Ee,onViewportChange:ke}){return yC(e),yC(t),sW(),Q$(n),J$(Ee),_.jsx(_$,{onPaneClick:ce,onPaneMouseEnter:ie,onPaneMouseMove:de,onPaneMouseLeave:xe,onPaneContextMenu:le,onPaneScroll:me,paneClickDistance:Re,deleteKeyCode:Z,selectionKeyCode:N,selectionOnDrag:R,selectionMode:O,onSelectionStart:x,onSelectionEnd:v,multiSelectionKeyCode:H,panActivationKeyCode:D,zoomActivationKeyCode:q,elementsSelectable:Y,zoomOnScroll:K,zoomOnPinch:G,zoomOnDoubleClick:ne,panOnScroll:Q,panOnScrollSpeed:I,panOnScrollMode:$,panOnDrag:X,defaultViewport:F,translateExtent:j,minZoom:ee,maxZoom:P,onSelectionContextMenu:g,preventScrolling:W,noDragClassName:hn,noWheelClassName:oi,noPanClassName:Ur,disableKeyboardA11y:Ci,onViewportChange:ke,isControlledViewport:!!Ee,children:_.jsxs(W$,{children:[_.jsx(K$,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:l,onReconnect:wt,onReconnectStart:_n,onReconnectEnd:Sn,onlyRenderVisibleElements:V,onEdgeContextMenu:Ie,onEdgeMouseEnter:He,onEdgeMouseMove:Qe,onEdgeMouseLeave:ot,reconnectRadius:Ue,defaultMarkerColor:z,noPanClassName:Ur,disableKeyboardA11y:Ci,rfId:sr}),_.jsx(rW,{style:A,type:S,component:T,containerStyle:C}),_.jsx("div",{className:"react-flow__edgelabel-renderer"}),_.jsx(k$,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:m,nodeClickDistance:je,onlyRenderVisibleElements:V,noPanClassName:Ur,noDragClassName:hn,disableKeyboardA11y:Ci,nodeExtent:Wt,rfId:sr}),_.jsx("div",{className:"react-flow__viewport-portal"})]})})}VN.displayName="GraphView";const lW=L.memo(VN),xC=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:l,fitViewOptions:c,minZoom:f=.5,maxZoom:p=2,nodeOrigin:m,nodeExtent:g,zIndexMode:x="basic"}={})=>{const v=new Map,S=new Map,A=new Map,T=new Map,C=i??t??[],N=n??e??[],R=m??[0,0],O=g??Gm;oN(A,T,C);const H=P1(N,v,S,{nodeOrigin:R,nodeExtent:O,zIndexMode:x});let D=[0,0,1];if(l&&r&&s){const q=lg(v,{filter:F=>!!((F.width||F.initialWidth)&&(F.height||F.initialHeight))}),{x:Z,y:V,zoom:Y}=X_(q,r,s,f,p,(c==null?void 0:c.padding)??.1);D=[Z,V,Y]}return{rfId:"1",width:r??0,height:s??0,transform:D,nodes:N,nodesInitialized:H,nodeLookup:v,parentLookup:S,edges:C,edgeLookup:T,connectionLookup:A,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:f,maxZoom:p,translateExtent:Gm,nodeExtent:O,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:mh.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:R,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:c,fitViewResolver:null,connection:{...qk},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:vX,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Gk,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},oW=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:l,fitViewOptions:c,minZoom:f,maxZoom:p,nodeOrigin:m,nodeExtent:g,zIndexMode:x})=>wK((v,S)=>{async function A(){const{nodeLookup:T,panZoom:C,fitViewOptions:N,fitViewResolver:R,width:O,height:H,minZoom:D,maxZoom:q}=S();C&&(await xX({nodes:T,width:O,height:H,panZoom:C,minZoom:D,maxZoom:q},N),R==null||R.resolve(!0),v({fitViewResolver:null}))}return{...xC({nodes:e,edges:t,width:r,height:s,fitView:l,fitViewOptions:c,minZoom:f,maxZoom:p,nodeOrigin:m,nodeExtent:g,defaultNodes:n,defaultEdges:i,zIndexMode:x}),setNodes:T=>{const{nodeLookup:C,parentLookup:N,nodeOrigin:R,elevateNodesOnSelect:O,fitViewQueued:H,zIndexMode:D}=S(),q=P1(T,C,N,{nodeOrigin:R,nodeExtent:g,elevateNodesOnSelect:O,checkEquality:!0,zIndexMode:D});H&&q?(A(),v({nodes:T,nodesInitialized:q,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:T,nodesInitialized:q})},setEdges:T=>{const{connectionLookup:C,edgeLookup:N}=S();oN(C,N,T),v({edges:T})},setDefaultNodesAndEdges:(T,C)=>{if(T){const{setNodes:N}=S();N(T),v({hasDefaultNodes:!0})}if(C){const{setEdges:N}=S();N(C),v({hasDefaultEdges:!0})}},updateNodeInternals:T=>{const{triggerNodeChanges:C,nodeLookup:N,parentLookup:R,domNode:O,nodeOrigin:H,nodeExtent:D,debug:q,fitViewQueued:Z,zIndexMode:V}=S(),{changes:Y,updatedInternals:F}=FX(T,N,R,O,H,D,V);F&&(IX(N,R,{nodeOrigin:H,nodeExtent:D,zIndexMode:V}),Z?(A(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(Y==null?void 0:Y.length)>0&&(q&&console.log("React Flow: trigger node changes",Y),C==null||C(Y)))},updateNodePositions:(T,C=!1)=>{const N=[];let R=[];const{nodeLookup:O,triggerNodeChanges:H,connection:D,updateConnection:q,onNodesChangeMiddlewareMap:Z}=S();for(const[V,Y]of T){const F=O.get(V),j=!!(F!=null&&F.expandParent&&(F!=null&&F.parentId)&&(Y!=null&&Y.position)),ee={id:V,type:"position",position:j?{x:Math.max(0,Y.position.x),y:Math.max(0,Y.position.y)}:Y.position,dragging:C};if(F&&D.inProgress&&D.fromNode.id===F.id){const P=Cd(F,D.fromHandle,We.Left,!0);q({...D,from:P})}j&&F.parentId&&N.push({id:V,parentId:F.parentId,rect:{...Y.internals.positionAbsolute,width:Y.measured.width??0,height:Y.measured.height??0}}),R.push(ee)}if(N.length>0){const{parentLookup:V,nodeOrigin:Y}=S(),F=J_(N,O,V,Y);R.push(...F)}for(const V of Z.values())R=V(R);H(R)},triggerNodeChanges:T=>{const{onNodesChange:C,setNodes:N,nodes:R,hasDefaultNodes:O,debug:H}=S();if(T!=null&&T.length){if(O){const D=YK(T,R);N(D)}H&&console.log("React Flow: trigger node changes",T),C==null||C(T)}},triggerEdgeChanges:T=>{const{onEdgesChange:C,setEdges:N,edges:R,hasDefaultEdges:O,debug:H}=S();if(T!=null&&T.length){if(O){const D=VK(T,R);N(D)}H&&console.log("React Flow: trigger edge changes",T),C==null||C(T)}},addSelectedNodes:T=>{const{multiSelectionActive:C,edgeLookup:N,nodeLookup:R,triggerNodeChanges:O,triggerEdgeChanges:H}=S();if(C){const D=T.map(q=>pd(q,!0));O(D);return}O(eh(R,new Set([...T]),!0)),H(eh(N))},addSelectedEdges:T=>{const{multiSelectionActive:C,edgeLookup:N,nodeLookup:R,triggerNodeChanges:O,triggerEdgeChanges:H}=S();if(C){const D=T.map(q=>pd(q,!0));H(D);return}H(eh(N,new Set([...T]))),O(eh(R,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:C}={})=>{const{edges:N,nodes:R,nodeLookup:O,triggerNodeChanges:H,triggerEdgeChanges:D}=S(),q=T||R,Z=C||N,V=[];for(const F of q){if(!F.selected)continue;const j=O.get(F.id);j&&(j.selected=!1),V.push(pd(F.id,!1))}const Y=[];for(const F of Z)F.selected&&Y.push(pd(F.id,!1));H(V),D(Y)},setMinZoom:T=>{const{panZoom:C,maxZoom:N}=S();C==null||C.setScaleExtent([T,N]),v({minZoom:T})},setMaxZoom:T=>{const{panZoom:C,minZoom:N}=S();C==null||C.setScaleExtent([N,T]),v({maxZoom:T})},setTranslateExtent:T=>{var C;(C=S().panZoom)==null||C.setTranslateExtent(T),v({translateExtent:T})},resetSelectedElements:()=>{const{edges:T,nodes:C,triggerNodeChanges:N,triggerEdgeChanges:R,elementsSelectable:O}=S();if(!O)return;const H=C.reduce((q,Z)=>Z.selected?[...q,pd(Z.id,!1)]:q,[]),D=T.reduce((q,Z)=>Z.selected?[...q,pd(Z.id,!1)]:q,[]);N(H),R(D)},setNodeExtent:T=>{const{nodes:C,nodeLookup:N,parentLookup:R,nodeOrigin:O,elevateNodesOnSelect:H,nodeExtent:D,zIndexMode:q}=S();T[0][0]===D[0][0]&&T[0][1]===D[0][1]&&T[1][0]===D[1][0]&&T[1][1]===D[1][1]||(P1(C,N,R,{nodeOrigin:O,nodeExtent:T,elevateNodesOnSelect:H,checkEquality:!1,zIndexMode:q}),v({nodeExtent:T}))},panBy:T=>{const{transform:C,width:N,height:R,panZoom:O,translateExtent:H}=S();return GX({delta:T,panZoom:O,transform:C,translateExtent:H,width:N,height:R})},setCenter:async(T,C,N)=>{const{width:R,height:O,maxZoom:H,panZoom:D}=S();if(!D)return Promise.resolve(!1);const q=typeof(N==null?void 0:N.zoom)<"u"?N.zoom:H;return await D.setViewport({x:R/2-T*q,y:O/2-C*q,zoom:q},{duration:N==null?void 0:N.duration,ease:N==null?void 0:N.ease,interpolate:N==null?void 0:N.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...qk}})},updateConnection:T=>{v({connection:T})},reset:()=>v({...xC()})}},Object.is);function XN({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:s,initialMinZoom:l,initialMaxZoom:c,initialFitViewOptions:f,fitView:p,nodeOrigin:m,nodeExtent:g,zIndexMode:x,children:v}){const[S]=L.useState(()=>oW({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:p,minZoom:l,maxZoom:c,fitViewOptions:f,nodeOrigin:m,nodeExtent:g,zIndexMode:x}));return _.jsx(TK,{value:S,children:_.jsx(WK,{children:v})})}function cW({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:r,width:s,height:l,fitView:c,fitViewOptions:f,minZoom:p,maxZoom:m,nodeOrigin:g,nodeExtent:x,zIndexMode:v}){return L.useContext(vx)?_.jsx(_.Fragment,{children:e}):_.jsx(XN,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:l,fitView:c,initialFitViewOptions:f,initialMinZoom:p,initialMaxZoom:m,nodeOrigin:g,nodeExtent:x,zIndexMode:v,children:e})}const uW={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function dW({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:s,edgeTypes:l,onNodeClick:c,onEdgeClick:f,onInit:p,onMove:m,onMoveStart:g,onMoveEnd:x,onConnect:v,onConnectStart:S,onConnectEnd:A,onClickConnectStart:T,onClickConnectEnd:C,onNodeMouseEnter:N,onNodeMouseMove:R,onNodeMouseLeave:O,onNodeContextMenu:H,onNodeDoubleClick:D,onNodeDragStart:q,onNodeDrag:Z,onNodeDragStop:V,onNodesDelete:Y,onEdgesDelete:F,onDelete:j,onSelectionChange:ee,onSelectionDragStart:P,onSelectionDrag:W,onSelectionDragStop:z,onSelectionContextMenu:K,onSelectionStart:G,onSelectionEnd:Q,onBeforeDelete:I,connectionMode:$,connectionLineType:ne=su.Bezier,connectionLineStyle:X,connectionLineComponent:ce,connectionLineContainerStyle:ie,deleteKeyCode:de="Backspace",selectionKeyCode:xe="Shift",selectionOnDrag:me=!1,selectionMode:le=qm.Full,panActivationKeyCode:Re="Space",multiSelectionKeyCode:je=Xm()?"Meta":"Control",zoomActivationKeyCode:Ie=Xm()?"Meta":"Control",snapToGrid:He,snapGrid:Qe,onlyRenderVisibleElements:ot=!1,selectNodesOnDrag:Ue,nodesDraggable:wt,autoPanOnNodeFocus:_n,nodesConnectable:Sn,nodesFocusable:hn,nodeOrigin:oi=_N,edgesFocusable:Ur,edgesReconnectable:Ci,elementsSelectable:Wt=!0,defaultViewport:sr=IK,minZoom:Ee=.5,maxZoom:ke=2,translateExtent:oe=Gm,preventScrolling:Pe=!0,nodeExtent:ct,defaultMarkerColor:tn="#b1b1b7",zoomOnScroll:ci=!0,zoomOnPinch:Qt=!0,panOnScroll:Zt=!1,panOnScrollSpeed:Gn=.5,panOnScrollMode:Pt=bd.Free,zoomOnDoubleClick:Yi=!0,panOnDrag:Jn=!0,onPaneClick:vo,onPaneMouseEnter:ls,onPaneMouseMove:Ba,onPaneMouseLeave:os,onPaneScroll:vi,onPaneContextMenu:se,paneClickDistance:Te=1,nodeClickDistance:Le=0,children:tt,onReconnect:nn,onReconnectStart:rn,onReconnectEnd:Ye,onEdgeContextMenu:Ge,onEdgeDoubleClick:nt,onEdgeMouseEnter:Rn,onEdgeMouseMove:Ft,onEdgeMouseLeave:ga,reconnectRadius:lr=10,onNodesChange:Vi,onEdgesChange:or,noDragClassName:bt="nodrag",noWheelClassName:ui="nowheel",noPanClassName:Hr="nopan",fitView:Us,fitViewOptions:Cl,connectOnClick:Al,attributionPosition:Ml,proOptions:La,defaultEdgeOptions:Hs,elevateNodesOnSelect:an=!0,elevateEdgesOnSelect:sn=!1,disableKeyboardA11y:cr=!1,autoPanOnConnect:Pr,autoPanOnNodeDrag:jn,autoPanSpeed:Sr,connectionRadius:ya,isValidConnection:Fr,onError:Ne,style:Ke,id:vt,nodeDragThreshold:Xt,connectionDragThreshold:In,viewport:_i,onViewportChange:Xi,width:Ai,height:pn,colorMode:ur="light",debug:_o,onScroll:xa,ariaLabelConfig:Rl,zIndexMode:ja="basic",...fc},Bi){const cs=vt||"1",us=FK(ur),Ps=L.useCallback(di=>{di.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),xa==null||xa(di)},[xa]);return _.jsx("div",{"data-testid":"rf__wrapper",...fc,onScroll:Ps,style:{...Ke,...uW},ref:Bi,className:zi(["react-flow",r,us]),id:vt,role:"application",children:_.jsxs(cW,{nodes:e,edges:t,width:Ai,height:pn,fitView:Us,fitViewOptions:Cl,minZoom:Ee,maxZoom:ke,nodeOrigin:oi,nodeExtent:ct,zIndexMode:ja,children:[_.jsx(lW,{onInit:p,onNodeClick:c,onEdgeClick:f,onNodeMouseEnter:N,onNodeMouseMove:R,onNodeMouseLeave:O,onNodeContextMenu:H,onNodeDoubleClick:D,nodeTypes:s,edgeTypes:l,connectionLineType:ne,connectionLineStyle:X,connectionLineComponent:ce,connectionLineContainerStyle:ie,selectionKeyCode:xe,selectionOnDrag:me,selectionMode:le,deleteKeyCode:de,multiSelectionKeyCode:je,panActivationKeyCode:Re,zoomActivationKeyCode:Ie,onlyRenderVisibleElements:ot,defaultViewport:sr,translateExtent:oe,minZoom:Ee,maxZoom:ke,preventScrolling:Pe,zoomOnScroll:ci,zoomOnPinch:Qt,zoomOnDoubleClick:Yi,panOnScroll:Zt,panOnScrollSpeed:Gn,panOnScrollMode:Pt,panOnDrag:Jn,onPaneClick:vo,onPaneMouseEnter:ls,onPaneMouseMove:Ba,onPaneMouseLeave:os,onPaneScroll:vi,onPaneContextMenu:se,paneClickDistance:Te,nodeClickDistance:Le,onSelectionContextMenu:K,onSelectionStart:G,onSelectionEnd:Q,onReconnect:nn,onReconnectStart:rn,onReconnectEnd:Ye,onEdgeContextMenu:Ge,onEdgeDoubleClick:nt,onEdgeMouseEnter:Rn,onEdgeMouseMove:Ft,onEdgeMouseLeave:ga,reconnectRadius:lr,defaultMarkerColor:tn,noDragClassName:bt,noWheelClassName:ui,noPanClassName:Hr,rfId:cs,disableKeyboardA11y:cr,nodeExtent:ct,viewport:_i,onViewportChange:Xi}),_.jsx(PK,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:v,onConnectStart:S,onConnectEnd:A,onClickConnectStart:T,onClickConnectEnd:C,nodesDraggable:wt,autoPanOnNodeFocus:_n,nodesConnectable:Sn,nodesFocusable:hn,edgesFocusable:Ur,edgesReconnectable:Ci,elementsSelectable:Wt,elevateNodesOnSelect:an,elevateEdgesOnSelect:sn,minZoom:Ee,maxZoom:ke,nodeExtent:ct,onNodesChange:Vi,onEdgesChange:or,snapToGrid:He,snapGrid:Qe,connectionMode:$,translateExtent:oe,connectOnClick:Al,defaultEdgeOptions:Hs,fitView:Us,fitViewOptions:Cl,onNodesDelete:Y,onEdgesDelete:F,onDelete:j,onNodeDragStart:q,onNodeDrag:Z,onNodeDragStop:V,onSelectionDrag:W,onSelectionDragStart:P,onSelectionDragStop:z,onMove:m,onMoveStart:g,onMoveEnd:x,noPanClassName:Hr,nodeOrigin:oi,rfId:cs,autoPanOnConnect:Pr,autoPanOnNodeDrag:jn,autoPanSpeed:Sr,onError:Ne,connectionRadius:ya,isValidConnection:Fr,selectNodesOnDrag:Ue,nodeDragThreshold:Xt,connectionDragThreshold:In,onBeforeDelete:I,debug:_o,ariaLabelConfig:Rl,zIndexMode:ja}),_.jsx(jK,{onSelectionChange:ee}),tt,_.jsx(OK,{proOptions:La,position:Ml}),_.jsx(NK,{rfId:cs,disableKeyboardA11y:cr})]})})}var fW=EN(dW);function hW({dimensions:e,lineWidth:t,variant:n,className:i}){return _.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:zi(["react-flow__background-pattern",n,i])})}function pW({radius:e,className:t}){return _.jsx("circle",{cx:e,cy:e,r:e,className:zi(["react-flow__background-pattern","dots",t])})}var cu;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(cu||(cu={}));const mW={[cu.Dots]:1,[cu.Lines]:1,[cu.Cross]:6},gW=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function KN({id:e,variant:t=cu.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:l,bgColor:c,style:f,className:p,patternClassName:m}){const g=L.useRef(null),{transform:x,patternId:v}=$t(gW,Qn),S=i||mW[t],A=t===cu.Dots,T=t===cu.Cross,C=Array.isArray(n)?n:[n,n],N=[C[0]*x[2]||1,C[1]*x[2]||1],R=S*x[2],O=Array.isArray(s)?s:[s,s],H=T?[R,R]:N,D=[O[0]*x[2]||1+H[0]/2,O[1]*x[2]||1+H[1]/2],q=`${v}${e||""}`;return _.jsxs("svg",{className:zi(["react-flow__background",p]),style:{...f,...Ex,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:g,"data-testid":"rf__background",children:[_.jsx("pattern",{id:q,x:x[0]%N[0],y:x[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${D[0]},-${D[1]})`,children:A?_.jsx(pW,{radius:R/2,className:m}):_.jsx(hW,{dimensions:H,lineWidth:r,variant:t,className:m})}),_.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${q})`})]})}KN.displayName="Background";const yW=L.memo(KN);function xW(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:_.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function bW(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:_.jsx("path",{d:"M0 0h32v4.2H0z"})})}function vW(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:_.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function _W(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:_.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function SW(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:_.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function f0({children:e,className:t,...n}){return _.jsx("button",{type:"button",className:zi(["react-flow__controls-button",t]),...n,children:e})}const EW=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function $N({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:l,onFitView:c,onInteractiveChange:f,className:p,children:m,position:g="bottom-left",orientation:x="vertical","aria-label":v}){const S=Zn(),{isInteractive:A,minZoomReached:T,maxZoomReached:C,ariaLabelConfig:N}=$t(EW,Qn),{zoomIn:R,zoomOut:O,fitView:H}=Sx(),D=()=>{R(),s==null||s()},q=()=>{O(),l==null||l()},Z=()=>{H(r),c==null||c()},V=()=>{S.setState({nodesDraggable:!A,nodesConnectable:!A,elementsSelectable:!A}),f==null||f(!A)},Y=x==="horizontal"?"horizontal":"vertical";return _.jsxs(_x,{className:zi(["react-flow__controls",Y,p]),position:g,style:e,"data-testid":"rf__controls","aria-label":v??N["controls.ariaLabel"],children:[t&&_.jsxs(_.Fragment,{children:[_.jsx(f0,{onClick:D,className:"react-flow__controls-zoomin",title:N["controls.zoomIn.ariaLabel"],"aria-label":N["controls.zoomIn.ariaLabel"],disabled:C,children:_.jsx(xW,{})}),_.jsx(f0,{onClick:q,className:"react-flow__controls-zoomout",title:N["controls.zoomOut.ariaLabel"],"aria-label":N["controls.zoomOut.ariaLabel"],disabled:T,children:_.jsx(bW,{})})]}),n&&_.jsx(f0,{className:"react-flow__controls-fitview",onClick:Z,title:N["controls.fitView.ariaLabel"],"aria-label":N["controls.fitView.ariaLabel"],children:_.jsx(vW,{})}),i&&_.jsx(f0,{className:"react-flow__controls-interactive",onClick:V,title:N["controls.interactive.ariaLabel"],"aria-label":N["controls.interactive.ariaLabel"],children:A?_.jsx(SW,{}):_.jsx(_W,{})}),m]})}$N.displayName="Controls";const wW=L.memo($N);function TW({id:e,x:t,y:n,width:i,height:r,style:s,color:l,strokeColor:c,strokeWidth:f,className:p,borderRadius:m,shapeRendering:g,selected:x,onClick:v}){const{background:S,backgroundColor:A}=s||{},T=l||S||A;return _.jsx("rect",{className:zi(["react-flow__minimap-node",{selected:x},p]),x:t,y:n,rx:m,ry:m,width:i,height:r,style:{fill:T,stroke:c,strokeWidth:f},shapeRendering:g,onClick:v?C=>v(C,e):void 0})}const CW=L.memo(TW),AW=e=>e.nodes.map(t=>t.id),Bv=e=>e instanceof Function?e:()=>e;function MW({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=CW,onClick:l}){const c=$t(AW,Qn),f=Bv(t),p=Bv(e),m=Bv(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return _.jsx(_.Fragment,{children:c.map(x=>_.jsx(kW,{id:x,nodeColorFunc:f,nodeStrokeColorFunc:p,nodeClassNameFunc:m,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:l,shapeRendering:g},x))})}function RW({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:s,shapeRendering:l,NodeComponent:c,onClick:f}){const{node:p,x:m,y:g,width:x,height:v}=$t(S=>{const A=S.nodeLookup.get(e);if(!A)return{node:void 0,x:0,y:0,width:0,height:0};const T=A.internals.userNode,{x:C,y:N}=A.internals.positionAbsolute,{width:R,height:O}=dc(T);return{node:T,x:C,y:N,width:R,height:O}},Qn);return!p||p.hidden||!Qk(p)?null:_.jsx(c,{x:m,y:g,width:x,height:v,style:p.style,selected:!!p.selected,className:i(p),color:t(p),borderRadius:r,strokeColor:n(p),strokeWidth:s,shapeRendering:l,onClick:f,id:p.id})}const kW=L.memo(RW);var NW=L.memo(MW);const OW=200,DW=150,zW=e=>!e.hidden,BW=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Wk(lg(e.nodeLookup,{filter:zW}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},LW="react-flow__minimap-desc";function WN({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:f,maskColor:p,maskStrokeColor:m,maskStrokeWidth:g,position:x="bottom-right",onClick:v,onNodeClick:S,pannable:A=!1,zoomable:T=!1,ariaLabel:C,inversePan:N,zoomStep:R=1,offsetScale:O=5}){const H=Zn(),D=L.useRef(null),{boundingRect:q,viewBB:Z,rfId:V,panZoom:Y,translateExtent:F,flowWidth:j,flowHeight:ee,ariaLabelConfig:P}=$t(BW,Qn),W=(e==null?void 0:e.width)??OW,z=(e==null?void 0:e.height)??DW,K=q.width/W,G=q.height/z,Q=Math.max(K,G),I=Q*W,$=Q*z,ne=O*Q,X=q.x-(I-q.width)/2-ne,ce=q.y-($-q.height)/2-ne,ie=I+ne*2,de=$+ne*2,xe=`${LW}-${V}`,me=L.useRef(0),le=L.useRef();me.current=Q,L.useEffect(()=>{if(D.current&&Y)return le.current=ZX({domNode:D.current,panZoom:Y,getTransform:()=>H.getState().transform,getViewScale:()=>me.current}),()=>{var He;(He=le.current)==null||He.destroy()}},[Y]),L.useEffect(()=>{var He;(He=le.current)==null||He.update({translateExtent:F,width:j,height:ee,inversePan:N,pannable:A,zoomStep:R,zoomable:T})},[A,T,N,R,F,j,ee]);const Re=v?He=>{var Ue;const[Qe,ot]=((Ue=le.current)==null?void 0:Ue.pointer(He))||[0,0];v(He,{x:Qe,y:ot})}:void 0,je=S?L.useCallback((He,Qe)=>{const ot=H.getState().nodeLookup.get(Qe).internals.userNode;S(He,ot)},[]):void 0,Ie=C??P["minimap.ariaLabel"];return _.jsx(_x,{position:x,style:{...e,"--xy-minimap-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-background-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*Q:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:zi(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:_.jsxs("svg",{width:W,height:z,viewBox:`${X} ${ce} ${ie} ${de}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":xe,ref:D,onClick:Re,children:[Ie&&_.jsx("title",{id:xe,children:Ie}),_.jsx(NW,{onClick:je,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:l,nodeComponent:c}),_.jsx("path",{className:"react-flow__minimap-mask",d:`M${X-ne},${ce-ne}h${ie+ne*2}v${de+ne*2}h${-ie-ne*2}z
400
- M${Z.x},${Z.y}h${Z.width}v${Z.height}h${-Z.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}WN.displayName="MiniMap";const jW=L.memo(WN),IW=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,UW={[bh.Line]:"right",[bh.Handle]:"bottom-right"};function HW({nodeId:e,position:t,variant:n=bh.Handle,className:i,style:r=void 0,children:s,color:l,minWidth:c=10,minHeight:f=10,maxWidth:p=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:x,autoScale:v=!0,shouldResize:S,onResizeStart:A,onResize:T,onResizeEnd:C}){const N=AN(),R=typeof e=="string"?e:N,O=Zn(),H=L.useRef(null),D=n===bh.Handle,q=$t(L.useCallback(IW(D&&v),[D,v]),Qn),Z=L.useRef(null),V=t??UW[n];L.useEffect(()=>{if(!(!H.current||!R))return Z.current||(Z.current=fK({domNode:H.current,nodeId:R,getStoreItems:()=>{const{nodeLookup:F,transform:j,snapGrid:ee,snapToGrid:P,nodeOrigin:W,domNode:z}=O.getState();return{nodeLookup:F,transform:j,snapGrid:ee,snapToGrid:P,nodeOrigin:W,paneDomNode:z}},onChange:(F,j)=>{const{triggerNodeChanges:ee,nodeLookup:P,parentLookup:W,nodeOrigin:z}=O.getState(),K=[],G={x:F.x,y:F.y},Q=P.get(R);if(Q&&Q.expandParent&&Q.parentId){const I=Q.origin??z,$=F.width??Q.measured.width??0,ne=F.height??Q.measured.height??0,X={id:Q.id,parentId:Q.parentId,rect:{width:$,height:ne,...Zk({x:F.x??Q.position.x,y:F.y??Q.position.y},{width:$,height:ne},Q.parentId,P,I)}},ce=J_([X],P,W,z);K.push(...ce),G.x=F.x?Math.max(I[0]*$,F.x):void 0,G.y=F.y?Math.max(I[1]*ne,F.y):void 0}if(G.x!==void 0&&G.y!==void 0){const I={id:R,type:"position",position:{...G}};K.push(I)}if(F.width!==void 0&&F.height!==void 0){const $={id:R,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:F.width,height:F.height}};K.push($)}for(const I of j){const $={...I,type:"position"};K.push($)}ee(K)},onEnd:({width:F,height:j})=>{const ee={id:R,type:"dimensions",resizing:!1,dimensions:{width:F,height:j}};O.getState().triggerNodeChanges([ee])}})),Z.current.update({controlPosition:V,boundaries:{minWidth:c,minHeight:f,maxWidth:p,maxHeight:m},keepAspectRatio:g,resizeDirection:x,onResizeStart:A,onResize:T,onResizeEnd:C,shouldResize:S}),()=>{var F;(F=Z.current)==null||F.destroy()}},[V,c,f,p,m,g,A,T,C,S]);const Y=V.split("-");return _.jsx("div",{className:zi(["react-flow__resize-control","nodrag",...Y,n,i]),ref:H,style:{...r,scale:q,...l&&{[D?"backgroundColor":"borderColor"]:l}},children:s})}L.memo(HW);const q1={background:"rgba(0, 200, 255, 0.4)",width:6,height:6,border:"none"},bC={background:"rgba(0, 230, 138, 0.4)",width:6,height:6,border:"none"},vC={background:"rgba(255, 171, 64, 0.4)",width:6,height:6,border:"none"};function PW({data:e}){return _.jsxs("div",{style:{padding:"16px 32px",border:"2px solid rgba(0, 200, 255, 0.4)",borderRadius:12,background:"var(--surface-2)",boxShadow:"0 0 30px rgba(0, 200, 255, 0.15), 0 4px 16px rgba(0,0,0,0.2)",textAlign:"center",minWidth:200},children:[_.jsx(Sl,{type:"source",position:We.Bottom,style:q1}),_.jsx("div",{style:{width:44,height:44,borderRadius:8,background:"linear-gradient(135deg, var(--accent), var(--accent-dim))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem",fontWeight:700,color:"var(--text-inverse)",margin:"0 auto 8px",boxShadow:"var(--shadow-glow-strong)"},children:e.label.slice(0,2).toUpperCase()}),_.jsx("div",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1rem",color:"var(--text-primary)"},children:e.label}),_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",marginTop:3},children:"CEO"})]})}function FW({data:e}){const t=e.agents;return _.jsxs("div",{style:{padding:"14px 20px",border:"1px solid var(--status-active-glow)",borderRadius:10,background:"var(--surface-2)",boxShadow:"0 0 16px rgba(0, 230, 138, 0.08), 0 2px 8px rgba(0,0,0,0.15)",textAlign:"center",minWidth:160},children:[_.jsx(Sl,{type:"target",position:We.Top,style:bC}),_.jsx(Sl,{type:"source",position:We.Bottom,style:bC}),_.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,marginBottom:4},children:[_.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:5,background:"rgba(0, 230, 138, 0.15)",border:"1px solid rgba(0, 230, 138, 0.25)",fontSize:"0.6rem",color:"var(--status-active)",fontWeight:700},children:e.label.slice(0,1).toUpperCase()}),_.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:600,fontSize:"0.82rem",color:"var(--status-active)"},children:e.label})]}),e.description?_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--text-muted)",marginBottom:4,maxWidth:180},children:String(e.description)}):null,_.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--text-muted)"},children:[t.length," agent",t.length!==1?"s":""]})]})}function GW({data:e}){return _.jsxs("div",{style:{padding:"8px 16px",border:"1px solid var(--border-subtle)",borderRadius:6,background:"var(--surface-1)",boxShadow:"0 1px 4px rgba(0,0,0,0.15)",textAlign:"center",minWidth:110},children:[_.jsx(Sl,{type:"target",position:We.Top,style:q1}),_.jsx(Sl,{type:"source",position:We.Bottom,style:q1}),_.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:6},children:[_.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:"var(--status-active)",boxShadow:"0 0 6px var(--status-active-glow)",flexShrink:0}}),_.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:500,fontSize:"0.72rem",color:"var(--text-secondary)"},children:e.label})]}),e.stepLabel?_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.5rem",color:"var(--text-muted)",marginTop:3,maxWidth:160,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:String(e.stepLabel)}):null]})}function qW({data:e}){return _.jsxs("div",{style:{padding:"5px 12px",border:"1px solid rgba(255, 171, 64, 0.3)",borderRadius:4,background:"var(--surface-2)",textAlign:"center",minWidth:80},children:[_.jsx(Sl,{type:"target",position:We.Top,style:vC}),_.jsx(Sl,{type:"source",position:We.Bottom,style:vC}),_.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:5},children:[_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--status-warning)"},children:"⏸"}),_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontWeight:500,fontSize:"0.6rem",color:"var(--status-warning)"},children:e.label})]})]})}const YW={company:PW,squad:FW,agent:GW,checkpoint:qW},_C=300,Lv=60;function VW(e){const{tree:t,squads:n}=e,i=[],r=[];if(n.length===0)return i.push({id:"company",type:"company",position:{x:0,y:0},data:{label:t.name},draggable:!0}),{nodes:i,edges:r};const l=n.length*_C/2-100;return i.push({id:"company",type:"company",position:{x:l,y:0},data:{label:t.name},draggable:!0}),n.forEach((c,f)=>{const p=`squad-${c.code}`,m=f*_C,g=new Map(c.agents.map(S=>[S.id,S]));i.push({id:p,type:"squad",position:{x:m,y:200},data:{label:c.name,description:c.description,agents:c.agents},draggable:!0}),r.push({id:`company-${p}`,source:"company",target:p,style:{stroke:"rgba(0, 230, 138, 0.3)",strokeWidth:2},animated:!1});const x=c.pipeline||[];if(x.length===0){c.agents.forEach((S,A)=>{const T=`agent-${c.code}-${S.id}`;i.push({id:T,type:"agent",position:{x:m+25,y:340+A*Lv},data:{label:S.name},draggable:!0}),r.push({id:`${p}-${T}`,source:p,target:T,style:{stroke:"rgba(100, 120, 200, 0.15)",strokeWidth:1}})});return}let v=p;x.forEach((S,A)=>{const T=S.type==="checkpoint",C=S.agent?g.get(S.agent):null,N=`step-${c.code}-${S.id}`;T?i.push({id:N,type:"checkpoint",position:{x:m+40,y:340+A*Lv},data:{label:S.label},draggable:!0}):i.push({id:N,type:"agent",position:{x:m+25,y:340+A*Lv},data:{label:(C==null?void 0:C.name)||S.agent||S.id,stepLabel:S.label},draggable:!0});const R=T?{stroke:"rgba(255, 171, 64, 0.3)",strokeWidth:1}:{stroke:"rgba(0, 200, 255, 0.25)",strokeWidth:1.5};r.push({id:`chain-${c.code}-${v}-${N}`,source:v,target:N,style:R,markerEnd:T?void 0:{type:Ym.ArrowClosed,color:"rgba(0, 200, 255, 0.35)",width:12,height:12},animated:!T}),v=N})}),{nodes:i,edges:r}}function XW({data:e}){const{fitView:t}=Sx(),{nodes:n,edges:i}=L.useMemo(()=>VW(e),[e]);L.useEffect(()=>{const s=setTimeout(()=>t({padding:.12,duration:400}),50);return()=>clearTimeout(s)},[n.length,t]);const r=e.squads.reduce((s,l)=>s+l.agents.length,0);return _.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",animation:"fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both"},children:[_.jsxs("div",{style:{padding:"16px 20px 12px",flexShrink:0},children:[_.jsxs("h2",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.1rem",color:"var(--text-primary)",marginBottom:2},children:[e.tree.name," — Org Chart"]}),_.jsxs("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)"},children:[e.squads.length," active squad",e.squads.length!==1?"s":""," / ",r," agents"]})]}),_.jsx("div",{style:{flex:1,minHeight:0},children:_.jsxs(fW,{nodes:n,edges:i,nodeTypes:YW,fitView:!0,fitViewOptions:{padding:.12},minZoom:.1,maxZoom:2,proOptions:{hideAttribution:!0},style:{background:"var(--surface-0)"},nodesDraggable:!0,nodesConnectable:!1,children:[_.jsx(yW,{color:"rgba(100, 120, 200, 0.04)",gap:24,size:1}),_.jsx(wW,{showInteractive:!1,style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:8}}),_.jsx(jW,{nodeColor:s=>s.type==="company"?"#007acc":s.type==="squad"?"#00e68a":s.type==="checkpoint"?"#ffab40":"#888",maskColor:"var(--glass-bg)",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:8}})]})})]})}function KW(){const[e,t]=L.useState(null),[n,i]=L.useState(!0),[r,s]=L.useState(null);return L.useEffect(()=>{fetch("/api/orgchart",{credentials:"include"}).then(l=>{if(!l.ok)throw new Error(`HTTP ${l.status}`);return l.json()}).then(l=>{t(l),i(!1)}).catch(l=>{s(l.message),i(!1)})},[]),n?_.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)"},children:"Loading org chart..."}):r||!e?_.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--status-error)"},children:r||"Failed to load org chart"}):_.jsx(XN,{children:_.jsx(XW,{data:e})})}const QN={squad:"#00c8ff",agent:"#00e68a",memory:"#b388ff",skill:"#ffab40"},Y1={squad:18,agent:12,memory:8,skill:8},SC={contains:"rgba(255,255,255,0.08)",pipeline:"rgba(0,200,255,0.4)",delivers:"rgba(0,230,138,0.5)",uses_skill:"rgba(255,171,64,0.15)",has_memory:"rgba(179,136,255,0.15)",shared_skill:"rgba(255,171,64,0.3)",shared_memory:"rgba(179,136,255,0.3)"};function $W(e,t,n,i,r){const s=n/2,l=i/2,c=3e3*r,f=.008*r,p=.01*r,m=.85;for(let x=0;x<e.length;x++){let v=0,S=0;for(let A=0;A<e.length;A++){if(x===A)continue;const T=e[x].x-e[A].x,C=e[x].y-e[A].y,N=T*T+C*C+1,R=c/N,O=Math.sqrt(N);v+=T/O*R,S+=C/O*R}v+=(s-e[x].x)*p,S+=(l-e[x].y)*p,e[x].vx=(e[x].vx+v)*m,e[x].vy=(e[x].vy+S)*m}for(const x of t){const v=e.findIndex(H=>H.id===x.source),S=e.findIndex(H=>H.id===x.target);if(v===-1||S===-1)continue;const A=e[S].x-e[v].x,T=e[S].y-e[v].y,C=Math.sqrt(A*A+T*T)+1,N=(C-100)*f,R=A/C*N,O=T/C*N;e[v].vx+=R,e[v].vy+=O,e[S].vx-=R,e[S].vy-=O}let g=0;for(const x of e)x.x+=x.vx,x.y+=x.vy,g+=x.vx*x.vx+x.vy*x.vy;return g}function WW(e,t){const n=new Map;for(const l of t)n.has(l.source)||n.set(l.source,[]),n.has(l.target)||n.set(l.target,[]),n.get(l.source).push(l.target),n.get(l.target).push(l.source);const i=new Map;i.set(e,0);const r=[e];let s=0;for(;s<r.length;){const l=r[s++],c=i.get(l);for(const f of n.get(l)||[])i.has(f)||(i.set(f,c+1),r.push(f))}return i}function QW(e,t,n,i,r,s,l,c,f){const p=getComputedStyle(document.documentElement).getPropertyValue("--surface-0").trim()||"#1e1e1e";e.fillStyle=p,e.fillRect(0,0,i,r),e.save(),e.translate(l,c),e.scale(f,f);const m=new Map(t.map(v=>[v.id,v]));let g=null;if(s){g=WW(s.id,n);for(const v of g.values());}const x=v=>{if(!s||!g||v===s.id)return 1;const S=g.get(v);return S===void 0?.06:Math.max(.08,1-S*.28)};for(const v of n){const S=m.get(v.source),A=m.get(v.target);if(!S||!A)continue;const T=Math.min(x(v.source),x(v.target)),C=s&&(v.source===s.id||v.target===s.id);if(e.globalAlpha=T,e.beginPath(),e.moveTo(S.x,S.y),e.lineTo(A.x,A.y),e.strokeStyle=C?"rgba(255,255,255,0.6)":SC[v.type]||"rgba(255,255,255,0.06)",e.lineWidth=C?1.8:v.type==="delivers"||v.type==="pipeline"?1.2:.5,e.stroke(),v.type==="delivers"||v.type==="pipeline"){const N=Math.atan2(A.y-S.y,A.x-S.x),R=Y1[A.type]||10,O=A.x-Math.cos(N)*(R+4),H=A.y-Math.sin(N)*(R+4);e.beginPath(),e.moveTo(O,H),e.lineTo(O-Math.cos(N-.4)*6,H-Math.sin(N-.4)*6),e.lineTo(O-Math.cos(N+.4)*6,H-Math.sin(N+.4)*6),e.closePath(),e.fillStyle=SC[v.type],e.fill()}}e.globalAlpha=1;for(const v of t){const S=Y1[v.type]||10,A=QN[v.type]||"#888",T=(s==null?void 0:s.id)===v.id,C=x(v.id);e.globalAlpha=C,e.beginPath(),e.arc(v.x,v.y,S,0,Math.PI*2),T&&(e.shadowColor=A,e.shadowBlur=24),e.fillStyle=A,e.fill(),e.shadowBlur=0;const N=v.type==="squad"?11:9;e.font=`${v.type==="squad"?"600":"400"} ${N}px "JetBrains Mono", monospace`,e.textAlign="center",e.textBaseline="top";const R=getComputedStyle(document.documentElement).getPropertyValue("--text-primary").trim()||"#fff";e.fillStyle=R,e.fillText(v.label,v.x,v.y+S+4)}e.globalAlpha=1,e.restore()}function ZW(){const e=L.useRef(null),[t,n]=L.useState([]),[i,r]=L.useState([]),[s,l]=L.useState(!0),[c,f]=L.useState(null),p=L.useRef(null),m=L.useRef(null),g=L.useRef(null),x=L.useRef(!1),v=L.useRef({x:0,y:0}),S=L.useRef(1),A=L.useRef(!1),T=L.useRef({x:0,y:0}),C=L.useRef([]),N=L.useRef([]),R=L.useRef(0),O=L.useRef(1),H=L.useRef(!0),D=L.useRef(null);L.useEffect(()=>{fetch("/api/graph",{credentials:"include"}).then(V=>V.json()).then(V=>{const Y=window.innerWidth,F=window.innerHeight,j=V.nodes.map((ee,P)=>({...ee,x:Y/2+(Math.random()-.5)*400,y:F/2+(Math.random()-.5)*400,vx:0,vy:0}));C.current=j,N.current=V.edges,n(j),r(V.edges),l(!1)}).catch(()=>{f("Failed to load graph data"),l(!1)})},[]);const q=L.useCallback((V,Y)=>{const F=v.current,j=S.current,ee=(V-F.x)/j,P=(Y-F.y)/j;for(let W=C.current.length-1;W>=0;W--){const z=C.current[W],K=Y1[z.type]||10,G=ee-z.x,Q=P-z.y;if(G*G+Q*Q<(K+4)*(K+4))return z}return null},[]);L.useEffect(()=>{const V=e.current;if(!V)return;const Y=W=>{const z=V.getBoundingClientRect(),K=W.clientX-z.left,G=W.clientY-z.top;if(g.current){x.current=!0;const ne=S.current,X=v.current;g.current.x=(K-X.x)/ne,g.current.y=(G-X.y)/ne,g.current.vx=0,g.current.vy=0,O.current=.3,H.current=!0;return}if(A.current){v.current.x+=K-T.current.x,v.current.y+=G-T.current.y,T.current={x:K,y:G};return}const Q=S.current,I=v.current;D.current={x:(K-I.x)/Q,y:(G-I.y)/Q};const $=q(K,G);p.current=$,V.style.cursor=$?"grab":"default"},F=W=>{const z=V.getBoundingClientRect(),K=W.clientX-z.left,G=W.clientY-z.top;x.current=!1;const Q=q(K,G);Q?(g.current=Q,V.style.cursor="grabbing"):(A.current=!0,T.current={x:K,y:G},V.style.cursor="move")},j=W=>{var K;g.current;const z=A.current;if(g.current=null,A.current=!1,V.style.cursor="default",!x.current){const G=V.getBoundingClientRect(),Q=W.clientX-G.left,I=W.clientY-G.top,$=q(Q,I);$?m.current=((K=m.current)==null?void 0:K.id)===$.id?null:$:z||(m.current=null)}},ee=W=>{W.preventDefault();const z=V.getBoundingClientRect(),K=W.clientX-z.left,G=W.clientY-z.top,Q=W.deltaY>0?.92:1.08,I=Math.max(.2,Math.min(5,S.current*Q)),$=I/S.current;v.current.x=K-(K-v.current.x)*$,v.current.y=G-(G-v.current.y)*$,S.current=I},P=()=>{g.current=null,A.current=!1,D.current=null,V.style.cursor="default"};return V.addEventListener("mousemove",Y),V.addEventListener("mousedown",F),V.addEventListener("mouseup",j),V.addEventListener("mouseleave",P),V.addEventListener("wheel",ee,{passive:!1}),()=>{V.removeEventListener("mousemove",Y),V.removeEventListener("mousedown",F),V.removeEventListener("mouseup",j),V.removeEventListener("mouseleave",P),V.removeEventListener("wheel",ee)}},[q,s]),L.useEffect(()=>{if(s||C.current.length===0)return;const V=e.current;if(!V)return;const Y=()=>{const P=V.parentElement;P&&(V.width=P.clientWidth*window.devicePixelRatio,V.height=P.clientHeight*window.devicePixelRatio,V.style.width=P.clientWidth+"px",V.style.height=P.clientHeight+"px")};Y(),window.addEventListener("resize",Y);const F=V.getContext("2d");let j=!0;const ee=()=>{if(!j)return;const P=V.width/window.devicePixelRatio,W=V.height/window.devicePixelRatio;F.setTransform(window.devicePixelRatio,0,0,window.devicePixelRatio,0,0),H.current&&($W(C.current,N.current,P,W,O.current),O.current*=.98,O.current<.001&&(H.current=!1,O.current=0));const z=D.current;if(z&&!g.current&&!A.current)for(const Q of C.current){const I=Q.x-z.x,$=Q.y-z.y,ne=I*I+$*$;if(ne<14400&&ne>1){const X=Math.sqrt(ne),ce=.8*(1-X/120);Q.x+=I/X*ce,Q.y+=$/X*ce}}QW(F,C.current,N.current,P,W,m.current,v.current.x,v.current.y,S.current),R.current=requestAnimationFrame(ee)};return R.current=requestAnimationFrame(ee),()=>{j=!1,cancelAnimationFrame(R.current),window.removeEventListener("resize",Y)}},[s]);const Z=L.useCallback(V=>{const Y=e.current;if(!Y)return;const F=V==="in"?1.25:.8,j=Y.clientWidth/2,ee=Y.clientHeight/2,P=Math.max(.2,Math.min(5,S.current*F)),W=P/S.current;v.current.x=j-(j-v.current.x)*W,v.current.y=ee-(ee-v.current.y)*W,S.current=P},[]);return s?_.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.8rem"},children:"Loading graph..."}):c?_.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.8rem"},children:c}):_.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",background:"var(--surface-0)"},children:[_.jsx("canvas",{ref:e,style:{display:"block",touchAction:"none"}}),_.jsx("div",{style:{position:"absolute",bottom:16,left:16,background:"rgba(10, 12, 16, 0.85)",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",display:"flex",flexDirection:"column",gap:6},children:Object.entries(QN).map(([V,Y])=>_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[_.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:Y,display:"inline-block"}}),_.jsx("span",{style:{textTransform:"capitalize"},children:V})]},V))}),_.jsxs("div",{style:{position:"absolute",top:16,right:16,background:"rgba(10, 12, 16, 0.85)",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",display:"flex",gap:16},children:[_.jsxs("span",{children:[t.length," nodes"]}),_.jsxs("span",{children:[i.length," edges"]})]}),_.jsx("div",{style:{position:"absolute",bottom:16,right:16,display:"flex",flexDirection:"column",gap:4},children:[{label:"+",action:"in"},{label:"−",action:"out"}].map(({label:V,action:Y})=>_.jsx("button",{onClick:()=>Z(Y),style:{width:32,height:32,background:"rgba(10, 12, 16, 0.85)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"1rem",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:V},Y))})]})}function JW(){const[e,t]=L.useState([]),[n,i]=L.useState(null),[r,s]=L.useState(""),[l,c]=L.useState(""),[f,p]=L.useState(!1),[m,g]=L.useState(!1),[x,v]=L.useState(new Set),[S,A]=L.useState(""),T=L.useRef(null);L.useEffect(()=>{fetch("/api/files",{credentials:"include"}).then(D=>D.json()).then(D=>{const q=new Map;for(const V of D)q.has(V.squad)||q.set(V.squad,{squad:V.squad,squadName:V.squadName,files:[]}),q.get(V.squad).files.push(V);const Z=[...q.values()];t(Z)})},[]);const C=L.useCallback(D=>{i(D),g(!0),fetch(`/api/files/${D.squad}/${D.path}`,{credentials:"include"}).then(q=>q.json()).then(q=>{s(q.content),c(q.content),g(!1)}).catch(()=>{s(""),c(""),g(!1)})},[]),N=L.useCallback(async()=>{n&&(p(!0),await fetch(`/api/files/${n.squad}/${n.path}`,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:r})}),c(r),p(!1))},[n,r]),R=L.useCallback(D=>{v(q=>{const Z=new Set(q);return Z.has(D)?Z.delete(D):Z.add(D),Z})},[]),O=r!==l;L.useEffect(()=>{const D=q=>{(q.metaKey||q.ctrlKey)&&q.key==="s"&&(q.preventDefault(),O&&n&&N())};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[O,n,N]);const H=D=>D==="squad.yaml"?"⚙":D==="memories.md"?"◆":"◇";return _.jsxs("div",{style:{display:"flex",height:"100%",overflow:"hidden"},children:[_.jsxs("div",{style:{width:260,minWidth:260,borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[_.jsx("div",{style:{padding:"12px 14px",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em",borderBottom:"1px solid var(--border-subtle)"},children:"Squad Files"}),_.jsx("div",{style:{padding:"8px 10px",borderBottom:"1px solid var(--border-subtle)"},children:_.jsx("input",{type:"text",placeholder:"Search squads...",value:S,onChange:D=>A(D.target.value),style:{width:"100%",padding:"5px 8px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",outline:"none"}})}),_.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"8px 0"},children:[e.filter(D=>{if(!S)return!0;const q=S.toLowerCase();return D.squadName.toLowerCase().includes(q)||D.squad.toLowerCase().includes(q)}).map(D=>_.jsxs("div",{children:[_.jsxs("button",{onClick:()=>R(D.squad),style:{width:"100%",background:"none",border:"none",padding:"6px 14px",display:"flex",alignItems:"center",gap:8,cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:600,color:"var(--text-primary)",textAlign:"left"},children:[_.jsx("span",{style:{fontSize:"0.6rem",transition:"transform 0.15s ease",transform:x.has(D.squad)?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"}),D.squadName]}),x.has(D.squad)&&_.jsx("div",{style:{paddingLeft:14},children:D.files.map(q=>{const Z=(n==null?void 0:n.squad)===q.squad&&(n==null?void 0:n.path)===q.path;return _.jsxs("button",{onClick:()=>C(q),style:{width:"100%",background:Z?"var(--accent-glow)":"none",border:Z?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",borderRadius:"var(--radius-xs)",padding:"5px 10px",display:"flex",alignItems:"center",gap:6,cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:Z?"var(--accent)":"var(--text-secondary)",textAlign:"left"},children:[_.jsx("span",{style:{opacity:.6},children:H(q.file)}),q.file]},`${q.squad}/${q.path}`)})})]},D.squad)),e.length===0&&_.jsx("div",{style:{padding:"20px 14px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",textAlign:"center"},children:"No squads found"})]})]}),_.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:n?_.jsxs(_.Fragment,{children:[_.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[_.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)",display:"flex",alignItems:"center",gap:8},children:[_.jsx("span",{style:{color:"var(--text-muted)"},children:n.squadName}),_.jsx("span",{style:{color:"var(--text-muted)",opacity:.4},children:"/"}),_.jsx("span",{children:n.file}),O&&_.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",display:"inline-block"}})]}),_.jsxs("button",{onClick:N,disabled:!O||f,style:{background:O?"var(--accent)":"var(--surface-3)",border:"none",borderRadius:"var(--radius-xs)",padding:"4px 14px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:O?"var(--text-inverse)":"var(--text-muted)",cursor:O?"pointer":"default",opacity:O?1:.5,transition:"all 0.15s ease"},children:[f?"Saving...":"Save",_.jsx("span",{style:{marginLeft:6,fontSize:"0.6rem",opacity:.7},children:"⌘S"})]})]}),m?_.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.8rem"},children:"Loading..."}):_.jsx("textarea",{ref:T,value:r,onChange:D=>s(D.target.value),spellCheck:!1,style:{flex:1,width:"100%",padding:"16px 20px",border:"none",outline:"none",resize:"none",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:'"JetBrains Mono", "Fira Code", monospace',fontSize:"0.8rem",lineHeight:1.7,tabSize:2,whiteSpace:"pre",overflowWrap:"normal",overflowX:"auto"}})]}):_.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,color:"var(--text-muted)",fontFamily:"var(--font-mono)"},children:[_.jsx("span",{style:{fontSize:"2rem",opacity:.3},children:"◇"}),_.jsx("span",{style:{fontSize:"0.8rem"},children:"Select a file to edit"})]})})]})}function xm(e){return e>=70?"#4ade80":e>=40?"#f59e0b":"#f44747"}function Ff(e,t,n){const i=n>0?Math.round(e/n*100):0,r=e+t>0?Math.round(e/(e+t)*100):0,s=Math.round((i+r)/2);return{r:i,q:r,e:s}}function EC(e,t){const n=Math.max(0,Math.floor((t-new Date(e).getTime())/1e3)),i=Math.floor(n/3600).toString().padStart(2,"0"),r=Math.floor(n%3600/60).toString().padStart(2,"0"),s=(n%60).toString().padStart(2,"0");return`${i}:${r}:${s}`}function jv(e,t){return t[e]??e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function eQ({name:e,size:t=28}){const n=[...e].reduce((i,r)=>i+r.charCodeAt(0),0)%360;return _.jsx("div",{style:{width:t,height:t,borderRadius:"50%",flexShrink:0,background:`hsl(${n},45%,20%)`,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)",fontWeight:700,fontSize:Math.round(t*.38),color:`hsl(${n},55%,68%)`},children:e.slice(0,1).toUpperCase()})}function tQ({rank:e}){const t=["#FFD700","#C0C0C0","#CD7F32"],n=e<=3?t[e-1]:"var(--text-muted)";return _.jsx("div",{style:{width:20,height:20,borderRadius:"50%",flexShrink:0,background:e<=3?`${n}22`:"transparent",border:`1.5px solid ${n}`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.55rem",fontWeight:700,color:n},children:e})}function ld({label:e,value:t,sub:n,color:i,icon:r}){return _.jsxs("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:8,padding:"14px 14px 12px",display:"flex",flexDirection:"column",gap:6},children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[_.jsx("span",{style:{fontSize:"0.58rem",color:"var(--text-muted)",fontFamily:"var(--font-mono)",textTransform:"uppercase",letterSpacing:"0.08em"},children:e}),r&&_.jsx("span",{style:{fontSize:"0.75rem",opacity:.5},children:r})]}),_.jsx("div",{style:{fontSize:"1.9rem",fontWeight:800,fontFamily:"var(--font-display)",color:i??"var(--text-bright)",lineHeight:1},children:t}),_.jsx("div",{style:{fontSize:"0.58rem",color:"var(--text-muted)",fontFamily:"var(--font-mono)"},children:n})]})}function Iv({label:e,value:t,description:n}){const i=xm(t);return _.jsxs("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:8,padding:16},children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:10},children:[_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",fontWeight:700,color:"var(--text-secondary)",textTransform:"uppercase",letterSpacing:"0.08em"},children:e}),_.jsxs("span",{style:{fontFamily:"var(--font-display)",fontSize:"1.15rem",fontWeight:800,color:i},children:[t,"%"]})]}),_.jsx("div",{style:{height:5,background:"var(--surface-3)",borderRadius:3,overflow:"hidden"},children:_.jsx("div",{style:{height:"100%",width:`${t}%`,background:i,borderRadius:3,transition:"width 0.6s ease"}})}),_.jsx("p",{style:{fontSize:"0.58rem",color:"var(--text-muted)",fontFamily:"var(--font-mono)",marginTop:8,lineHeight:1.6},children:n})]})}function wC({bars:e,height:t=100,showSecondary:n=!1}){const i=Math.max(...e.flatMap(s=>[s.primary,s.secondary??0]),1),r=t-16;return _.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:2,height:t},children:e.map((s,l)=>_.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[_.jsxs("div",{style:{display:"flex",gap:1,alignItems:"flex-end",width:"100%",height:r},children:[n&&s.secondary!==void 0&&_.jsx("div",{style:{flex:1,alignSelf:"flex-end",height:Math.max(s.secondary>0?2:0,Math.round(s.secondary/i*r)),background:"rgba(255,255,255,0.1)",borderRadius:"2px 2px 0 0"}}),_.jsx("div",{style:{flex:1,alignSelf:"flex-end",height:Math.max(s.primary>0?2:0,Math.round(s.primary/i*r)),background:"#4ade80",borderRadius:"2px 2px 0 0"}})]}),_.jsx("span",{style:{fontSize:"0.42rem",color:"var(--text-muted)",whiteSpace:"nowrap",fontFamily:"var(--font-mono)"},children:s.label})]},l))})}function Uv({rank:e,name:t,score:n,sub:i,barColor:r}){return _.jsxs("div",{children:[_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,marginBottom:3},children:[_.jsx(tQ,{rank:e}),_.jsx(eQ,{name:t,size:26}),_.jsxs("div",{style:{flex:1,minWidth:0},children:[_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.63rem",fontWeight:600,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t}),_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.48rem",color:"var(--text-muted)"},children:i})]}),_.jsxs("span",{style:{fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:800,color:r,flexShrink:0},children:[n,"%"]})]}),_.jsx("div",{style:{height:2,background:"var(--surface-3)",borderRadius:1,marginLeft:55},children:_.jsx("div",{style:{height:"100%",width:`${n}%`,background:r,borderRadius:1}})})]})}function nQ(){var K;const[e,t]=L.useState(null),[n,i]=L.useState(Date.now()),[r,s]=L.useState(null),[l,c]=L.useState(!1),[f,p]=L.useState(!1),m=vr(G=>G.squads),g=Object.fromEntries(m.map(G=>[G.code,G.name]));L.useEffect(()=>{const G=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(G)},[]);const x=async()=>{try{const G=await fetch("/api/dashboard/stats",{credentials:"include"});G.ok&&t(await G.json())}catch{}};L.useEffect(()=>{x();const G=setInterval(x,3e4);return()=>clearInterval(G)},[]);const v=async G=>{p(!0);try{(await fetch(`/api/dashboard/sessions/${G}/kill`,{method:"POST",credentials:"include"})).ok&&(s(null),c(!1),await x())}catch{}finally{p(!1)}},S=G=>{s(G),c(!1)},A=new Date(n),T=A.toLocaleTimeString("pt-BR",{hour12:!1}),C=A.toLocaleDateString("pt-BR",{weekday:"long",day:"numeric",month:"long"}).toUpperCase(),N=e==null?void 0:e.kpis,R=e==null?void 0:e.metrics,O=(N==null?void 0:N.weekChange)??0,H=(()=>{const G=Object.fromEntries(((e==null?void 0:e.rhythm14)??[]).map(Q=>[Q.day,Q.count]));return Array.from({length:14},(Q,I)=>{const $=new Date(n);$.setDate($.getDate()-(13-I));const ne=$.toISOString().slice(0,10);return{label:`${$.getDate().toString().padStart(2,"0")}/${($.getMonth()+1).toString().padStart(2,"0")}`,primary:G[ne]??0}})})(),D=(()=>{const G=Object.fromEntries(((e==null?void 0:e.hourlyToday)??[]).map(I=>[I.hour,I.count])),Q=Object.fromEntries(((e==null?void 0:e.hourlyLastWeek)??[]).map(I=>[I.hour,Math.round(I.avg_count)]));return Array.from({length:14},(I,$)=>{const ne=$+7;return{label:`${ne.toString().padStart(2,"0")}h`,primary:G[ne]??0,secondary:Q[ne]??0}})})(),q=H.reduce((G,Q)=>G+Q.primary,0),Z=A.getHours(),V=((K=((e==null?void 0:e.hourlyToday)??[]).find(G=>G.hour===Z))==null?void 0:K.count)??0,Y=(e==null?void 0:e.agentPerf)??[],F=[...Y].sort((G,Q)=>{const{e:I}=Ff(G.done,G.failed,G.total),{e:$}=Ff(Q.done,Q.failed,Q.total);return $-I}),j=[...Y].sort((G,Q)=>{const I=G.total>0?G.done/G.total:0;return(Q.total>0?Q.done/Q.total:0)-I}),ee=[...Y].sort((G,Q)=>{const{e:I}=Ff(G.done,G.failed,G.total),{e:$}=Ff(Q.done,Q.failed,Q.total);return $-I}),P={background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:8,padding:16,overflow:"hidden"},W={display:"flex",alignItems:"center",gap:6,fontFamily:"var(--font-mono)",fontSize:"0.62rem",fontWeight:700,color:"var(--text-secondary)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:14},z=_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",color:"var(--text-muted)"},children:"Nenhum dado ainda"});return _.jsxs("div",{style:{height:"100%",overflowY:"auto",background:"var(--surface-0)"},children:[_.jsxs("div",{style:{padding:"12px 24px",borderBottom:"1px solid var(--border-subtle)",display:"flex",justifyContent:"space-between",alignItems:"flex-start",position:"sticky",top:0,zIndex:10,background:"var(--surface-0)"},children:[_.jsxs("div",{children:[_.jsx("div",{style:{fontFamily:"var(--font-display)",fontSize:"1rem",fontWeight:700,color:"var(--text-bright)"},children:"Painel de Operações"}),_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginTop:2},children:[_.jsx("span",{style:{fontSize:"0.55rem",fontFamily:"var(--font-mono)",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em"},children:"em tempo real"}),_.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[_.jsx("span",{style:{width:6,height:6,borderRadius:"50%",display:"inline-block",background:"#4ade80",boxShadow:"0 0 5px #4ade80",animation:"statusPulse 2s ease-in-out infinite"}}),_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"#4ade80"},children:"Ao vivo"})]})]})]}),_.jsxs("div",{style:{textAlign:"right"},children:[_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"1.5rem",fontWeight:700,color:"var(--text-bright)",lineHeight:1,letterSpacing:"0.04em"},children:T}),_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.52rem",color:"var(--text-muted)",marginTop:3,letterSpacing:"0.06em"},children:C})]})]}),!e&&_.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"calc(100% - 64px)"},children:_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)"},children:"Carregando dados..."})}),e&&_.jsxs("div",{style:{padding:"16px 24px 40px",display:"flex",flexDirection:"column",gap:12},children:[_.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:10},children:[_.jsx(ld,{label:"Em Aberto",value:N.open,sub:"Tarefas planejadas",icon:"○"}),_.jsx(ld,{label:"Falhas",value:N.delayed,sub:"Tarefas com erro ou falha",color:N.delayed>0?"#f44747":void 0,icon:"△"}),_.jsx(ld,{label:"Concluídas Hoje",value:N.doneToday,sub:`Finalizadas em ${A.toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit"})}`,color:"#4ade80",icon:"✓"}),_.jsx(ld,{label:"Squads Rodando",value:N.activeSquads,sub:"Squads com pipeline ativo",color:N.activeSquads>0?"#f59e0b":void 0,icon:"◈"}),_.jsx(ld,{label:"Pipelines Ativos",value:N.runningNow,sub:"Instâncias Claude em execução",color:N.runningNow>0?"#4ade80":void 0,icon:"▶"}),_.jsx(ld,{label:"Horas Rastreadas (7d)",value:`${N.hoursTracked}h`,sub:"Últimos 7 dias",icon:"⏱"}),_.jsx(ld,{label:"Sem. vs Anterior",value:`${O>0?"+":""}${O}%`,sub:"Entregas vs período anterior",color:O>0?"#4ade80":O<0?"#f44747":void 0,icon:O>=0?"↑":"↓"})]}),_.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:10},children:[_.jsx(Iv,{label:"Regularidade",value:R.regularidade,description:"Taxa de tarefas concluídas em relação ao total de tarefas registradas."}),_.jsx(Iv,{label:"Qualidade",value:R.qualidade,description:"Taxa de sucesso entre tarefas finalizadas — concluídas vs. falhas."}),_.jsx(Iv,{label:"Eficiência",value:R.eficiencia,description:"Combina regularidade e qualidade para medir o desempenho geral."})]}),_.jsxs("div",{style:{display:"grid",gridTemplateColumns:"55fr 45fr",gap:10},children:[_.jsxs("div",{style:P,children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:14},children:[_.jsxs("div",{style:W,children:[_.jsx("span",{children:"📈"}),_.jsx("span",{children:"Ritmo de Conclusão"}),_.jsx("span",{style:{fontWeight:400,color:"var(--text-muted)",fontSize:"0.52rem",textTransform:"none"},children:"últimos 14 dias"})]}),_.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)"},children:["Total: ",q," tarefas"]})]}),_.jsx(wC,{bars:H,height:120})]}),_.jsxs("div",{style:P,children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:14},children:[_.jsxs("div",{children:[_.jsxs("div",{style:{...W,marginBottom:6},children:[_.jsx("span",{children:"⏰"}),_.jsx("span",{children:"Ritmo por Hora"}),_.jsx("span",{style:{fontWeight:400,color:"var(--text-muted)",fontSize:"0.52rem",textTransform:"none"},children:"hoje vs média semana anterior"})]}),_.jsxs("div",{style:{display:"flex",gap:10,marginBottom:8},children:[_.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:"0.52rem",color:"#4ade80"},children:[_.jsx("span",{style:{width:8,height:8,borderRadius:2,background:"#4ade80",display:"inline-block"}}),"Hoje"]}),_.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:"0.52rem",color:"var(--text-muted)"},children:[_.jsx("span",{style:{width:8,height:8,borderRadius:2,background:"rgba(255,255,255,0.12)",display:"inline-block"}}),"Média sem. anterior"]})]})]}),_.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--text-muted)",textAlign:"right",whiteSpace:"nowrap"},children:[V," nesta hora",_.jsx("br",{}),"Total: ",N.doneToday]})]}),_.jsx(wC,{bars:D,height:100,showSecondary:!0})]})]}),e.runningSessions.length>0&&_.jsxs("div",{style:P,children:[_.jsxs("div",{style:W,children:[_.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"#4ade80",boxShadow:"0 0 6px #4ade80",display:"inline-block",animation:"statusPulse 2s ease-in-out infinite"}}),"Pipelines Ativos — ",e.runningSessions.length," instância",e.runningSessions.length!==1?"s":""," Claude em execução"]}),_.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:10},children:e.runningSessions.map(G=>{const Q=jv(G.squad_code,g),I=[...G.squad_code].reduce((X,ce)=>X+ce.charCodeAt(0),0)%360,$=G.steps_total>0?Math.round(G.steps_done/G.steps_total*100):0,ne=(e.sessionAgents??[]).filter(X=>X.activity_id===G.id);return _.jsxs("div",{onClick:()=>S(G),style:{background:"var(--surface-2)",border:"1px solid rgba(74,222,128,0.15)",borderRadius:6,padding:"10px 12px",display:"flex",flexDirection:"column",gap:8,cursor:"pointer",transition:"border-color 0.15s"},onMouseEnter:X=>X.currentTarget.style.borderColor="rgba(74,222,128,0.4)",onMouseLeave:X=>X.currentTarget.style.borderColor="rgba(74,222,128,0.15)",children:[_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[_.jsx("div",{style:{width:34,height:34,borderRadius:"50%",flexShrink:0,background:`hsl(${I},45%,18%)`,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:"0.82rem",fontFamily:"var(--font-mono)",color:`hsl(${I},55%,65%)`},children:Q.slice(0,1).toUpperCase()}),_.jsxs("div",{style:{flex:1,minWidth:0},children:[_.jsx("div",{style:{fontFamily:"var(--font-display)",fontSize:"0.76rem",fontWeight:600,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Q}),_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.52rem",color:"var(--text-muted)",marginTop:1},children:G.squad_code})]}),_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5,flexShrink:0},children:[_.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"#4ade80",display:"inline-block",boxShadow:"0 0 4px #4ade80"}}),_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",fontWeight:700,color:"#4ade80"},children:EC(G.started_at,n)})]})]}),G.steps_total>0&&_.jsxs("div",{children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:4},children:[_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.5rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.06em"},children:"Progresso"}),_.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",fontWeight:700,color:G.current_task?"#f59e0b":"#4ade80"},children:[G.steps_done,"/",G.steps_total," etapas · ",$,"%"]})]}),_.jsx("div",{style:{height:5,background:"var(--surface-3)",borderRadius:3,overflow:"hidden"},children:_.jsx("div",{style:{height:"100%",width:`${$}%`,background:G.current_task?"#f59e0b":"#4ade80",borderRadius:3,transition:"width 0.4s ease"}})})]}),_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:G.current_task?"var(--text-secondary)":"var(--text-muted)",display:"flex",alignItems:"center",gap:5,overflow:"hidden"},children:G.current_task?_.jsxs(_.Fragment,{children:[_.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:"#f59e0b",display:"inline-block",flexShrink:0,animation:"statusPulse 1.5s ease-in-out infinite"}}),_.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:G.current_task})]}):_.jsx("span",{style:{color:"var(--text-muted)"},children:"⏳ Aguardando próxima etapa..."})}),ne.length>0&&_.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:ne.map(X=>{const ce=X.executing_count>0,ie=X.done_count===X.total&&X.executing_count===0,de=X.failed_count>0&&X.executing_count===0&&X.done_count<X.total,xe=ce?"#f59e0b":ie?"#4ade80":de?"#f44747":"var(--text-muted)",me=ce?"#f59e0b":ie?"#4ade80":de?"#f44747":"var(--text-muted)",le=ce?"rgba(245,158,11,0.1)":ie?"rgba(74,222,128,0.08)":de?"rgba(244,71,71,0.08)":"rgba(255,255,255,0.04)",Re=X.agent_name.split(/[\s_-]/)[0];return _.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,background:le,border:`1px solid ${xe}33`,borderRadius:20,padding:"2px 7px"},children:[_.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:xe,display:"inline-block",flexShrink:0,...ce?{animation:"statusPulse 1.5s ease-in-out infinite"}:{}}}),_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.52rem",fontWeight:600,color:me,whiteSpace:"nowrap"},children:Re})]},X.agent_name)})})]},G.id)})})]}),_.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:10},children:[_.jsxs("div",{style:P,children:[_.jsxs("div",{style:W,children:[_.jsx("span",{children:"👥"})," Performance por Squad"]}),_.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[e.squadPerf.length===0&&z,[...e.squadPerf].sort((G,Q)=>{const I=G.total>0?G.done/G.total:0;return(Q.total>0?Q.done/Q.total:0)-I}).slice(0,6).map((G,Q)=>{const I=G.total>0?Math.round(G.done/G.total*100):0,$=jv(G.squad_code,g),ne=xm(I);return _.jsxs("div",{children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:4},children:[_.jsxs("div",{style:{display:"flex",gap:5,alignItems:"flex-start",flex:1,minWidth:0},children:[_.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.52rem",color:"var(--text-muted)",paddingTop:1,width:16,flexShrink:0},children:["#",Q+1]}),_.jsxs("div",{style:{minWidth:0},children:[_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.63rem",fontWeight:600,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:$}),_.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.52rem",color:"var(--text-muted)",marginTop:1},children:[G.done,"/",G.total," concluídas",G.failed>0&&_.jsxs("span",{style:{color:"#f44747",marginLeft:4},children:[G.failed," falhas"]})]})]})]}),_.jsx("span",{style:{fontFamily:"var(--font-display)",fontSize:"0.9rem",fontWeight:800,color:ne,flexShrink:0,marginLeft:6},children:I})]}),_.jsx("div",{style:{height:3,background:"var(--surface-3)",borderRadius:2},children:_.jsx("div",{style:{height:"100%",width:`${I}%`,background:ne,borderRadius:2}})})]},G.squad_code)})]})]}),_.jsxs("div",{style:P,children:[_.jsxs("div",{style:W,children:[_.jsx("span",{children:"🏆"})," Top Performers",_.jsx("span",{style:{fontWeight:400,color:"var(--text-muted)",fontSize:"0.52rem",textTransform:"none"},children:"score combinado"})]}),_.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:9},children:[F.length===0&&z,F.slice(0,5).map((G,Q)=>{const I=Ff(G.done,G.failed,G.total);return _.jsx(Uv,{rank:Q+1,name:G.agent_name,score:I.e,barColor:xm(I.e),sub:`R: ${I.r}% · Q: ${I.q}% · E: ${I.e}%`},G.agent_name)})]})]}),_.jsxs("div",{style:P,children:[_.jsxs("div",{style:W,children:[_.jsx("span",{children:"⭐"})," Top Regularidade",_.jsx("span",{style:{fontWeight:400,color:"var(--text-muted)",fontSize:"0.52rem",textTransform:"none"},children:"tarefas entregues"})]}),_.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:9},children:[j.length===0&&z,j.slice(0,5).map((G,Q)=>{const I=G.total>0?Math.round(G.done/G.total*100):0;return _.jsx(Uv,{rank:Q+1,name:G.agent_name,score:I,barColor:xm(I),sub:`${G.done} de ${G.total} concluídas`},G.agent_name)})]})]}),_.jsxs("div",{style:P,children:[_.jsxs("div",{style:W,children:[_.jsx("span",{children:"📊"})," Top Eficiência",_.jsx("span",{style:{fontWeight:400,color:"var(--text-muted)",fontSize:"0.52rem",textTransform:"none"},children:"conclusão vs. andamento"})]}),_.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:9},children:[ee.length===0&&z,ee.slice(0,5).map((G,Q)=>{const{r:I,q:$,e:ne}=Ff(G.done,G.failed,G.total);return _.jsx(Uv,{rank:Q+1,name:G.agent_name,score:ne,barColor:xm(ne),sub:`R: ${I}% · Q: ${$}% · E: ${ne}%`},G.agent_name)})]})]})]})]}),r&&(()=>{const G=r,Q=jv(G.squad_code,g),I=[...G.squad_code].reduce((ce,ie)=>ce+ie.charCodeAt(0),0)%360,$=G.steps_total>0?Math.round(G.steps_done/G.steps_total*100):0,ne=new Date(G.started_at).toLocaleTimeString("pt-BR",{hour12:!1}),X=new Date(G.started_at).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit"});return _.jsx("div",{onClick:()=>{s(null),c(!1)},style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.65)",backdropFilter:"blur(3px)",display:"flex",alignItems:"center",justifyContent:"center"},children:_.jsxs("div",{onClick:ce=>ce.stopPropagation(),style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:12,padding:24,width:440,maxWidth:"calc(100vw - 32px)",display:"flex",flexDirection:"column",gap:16,boxShadow:"0 24px 64px rgba(0,0,0,0.5)"},children:[_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[_.jsx("div",{style:{width:42,height:42,borderRadius:"50%",flexShrink:0,background:`hsl(${I},45%,18%)`,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:"1rem",fontFamily:"var(--font-mono)",color:`hsl(${I},55%,65%)`},children:Q.slice(0,1).toUpperCase()}),_.jsxs("div",{style:{flex:1,minWidth:0},children:[_.jsx("div",{style:{fontFamily:"var(--font-display)",fontSize:"0.9rem",fontWeight:700,color:"var(--text-bright)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Q}),_.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--text-muted)",marginTop:2},children:[G.squad_code," · Iniciado em ",X," às ",ne]})]}),_.jsx("button",{onClick:()=>{s(null),c(!1)},style:{background:"transparent",border:"none",cursor:"pointer",color:"var(--text-muted)",fontSize:"1.1rem",padding:"2px 6px",lineHeight:1,borderRadius:4},children:"×"})]}),_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,background:"var(--surface-2)",borderRadius:6,padding:"10px 14px",border:"1px solid rgba(74,222,128,0.2)"},children:[_.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"#4ade80",display:"inline-block",boxShadow:"0 0 6px #4ade80",flexShrink:0,animation:"statusPulse 2s ease-in-out infinite"}}),_.jsxs("div",{style:{flex:1},children:[_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.07em"},children:"Em execução há"}),_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"1.1rem",fontWeight:700,color:"#4ade80",letterSpacing:"0.04em"},children:EC(G.started_at,n)})]})]}),_.jsxs("div",{style:{background:"var(--surface-2)",borderRadius:6,padding:"12px 14px",border:"1px solid var(--border-subtle)"},children:[_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.07em",marginBottom:8},children:"Etapa atual"}),G.current_task?_.jsxs(_.Fragment,{children:[_.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:6},children:[_.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"#f59e0b",display:"inline-block",flexShrink:0,marginTop:3,animation:"statusPulse 1.5s ease-in-out infinite"}}),_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:"var(--text-primary)",lineHeight:1.4},children:G.current_task})]}),G.current_agent&&_.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--text-muted)",marginTop:6,marginLeft:12},children:["Agente: ",G.current_agent,G.current_step&&_.jsxs("span",{style:{marginLeft:8,opacity:.6},children:["· ",G.current_step]})]})]}):_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)"},children:"⏳ Aguardando próxima etapa..."})]}),G.steps_total>0&&_.jsxs("div",{children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:6},children:[_.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.07em"},children:"Progresso"}),_.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:700,color:"var(--text-secondary)"},children:[G.steps_done," / ",G.steps_total," passos (",$,"%)"]})]}),_.jsx("div",{style:{height:6,background:"var(--surface-3)",borderRadius:3,overflow:"hidden"},children:_.jsx("div",{style:{height:"100%",width:`${$}%`,background:G.current_task?"#f59e0b":"#4ade80",borderRadius:3,transition:"width 0.4s ease"}})})]}),_.jsx("div",{style:{borderTop:"1px solid var(--border-subtle)",paddingTop:14,display:"flex",flexDirection:"column",gap:8},children:l?_.jsxs(_.Fragment,{children:[_.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",color:"#f44747",background:"rgba(244,71,71,0.08)",border:"1px solid rgba(244,71,71,0.25)",borderRadius:6,padding:"8px 12px",lineHeight:1.5},children:"Tem certeza? O pipeline será encerrado e as tarefas em execução serão marcadas como falha."}),_.jsxs("div",{style:{display:"flex",gap:8},children:[_.jsx("button",{onClick:()=>c(!1),disabled:f,style:{flex:1,padding:"8px 14px",borderRadius:6,cursor:"pointer",background:"transparent",border:"1px solid var(--border-subtle)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.65rem",opacity:f?.5:1},children:"Cancelar"}),_.jsx("button",{onClick:()=>v(G.id),disabled:f,style:{flex:1,padding:"8px 14px",borderRadius:6,cursor:f?"not-allowed":"pointer",background:"#f44747",border:"none",color:"#fff",fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:700,opacity:f?.6:1},children:f?"Encerrando...":"Confirmar Encerramento"})]})]}):_.jsxs("div",{style:{display:"flex",gap:8},children:[_.jsx("button",{onClick:()=>{s(null),c(!1)},style:{flex:1,padding:"8px 14px",borderRadius:6,cursor:"pointer",background:"transparent",border:"1px solid var(--border-subtle)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.65rem"},children:"Fechar"}),_.jsx("button",{onClick:()=>c(!0),style:{flex:1,padding:"8px 14px",borderRadius:6,cursor:"pointer",background:"rgba(244,71,71,0.1)",border:"1px solid rgba(244,71,71,0.4)",color:"#f44747",fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:600},children:"Encerrar Pipeline"})]})})]})})})()]})}const iQ=localStorage.getItem("expx-theme")||"dark";document.documentElement.setAttribute("data-theme",iQ);const rQ=L.lazy(()=>ou(()=>import("./JarvisView-CWiMwENP.js"),[]).then(e=>({default:e.JarvisView})));Z3.createRoot(document.getElementById("root")).render(_.jsx(L.StrictMode,{children:_.jsx(S4,{children:_.jsxs(ZO,{children:[_.jsx(ca,{path:"/login",element:_.jsx(fD,{})}),_.jsxs(ca,{path:"/",element:_.jsx(uD,{}),children:[_.jsx(ca,{index:!0,element:_.jsx(WO,{to:"/office",replace:!0})}),_.jsx(ca,{path:"office",element:_.jsx(I8,{})}),_.jsx(ca,{path:"chat",element:_.jsx(dG,{})}),_.jsx(ca,{path:"kanban",element:_.jsx(mG,{})}),_.jsx(ca,{path:"settings",element:_.jsx(CG,{})}),_.jsx(ca,{path:"scheduler",element:_.jsx(kG,{})}),_.jsx(ca,{path:"email",element:_.jsx(zG,{})}),_.jsx(ca,{path:"orgchart",element:_.jsx(KW,{})}),_.jsx(ca,{path:"graph",element:_.jsx(ZW,{})}),_.jsx(ca,{path:"files",element:_.jsx(JW,{})}),_.jsx(ca,{path:"dashboard",element:_.jsx(nQ,{})}),_.jsx(ca,{path:"jarvis",element:_.jsx(L.Suspense,{fallback:null,children:_.jsx(rQ,{})})})]})]})})}));export{i6 as $,XA as A,Bm as B,qi as C,is as D,yo as E,lc as F,Na as G,v5 as H,a_ as I,iD as J,Jm as K,iw as L,Ht as M,y0 as N,i_ as O,Lr as P,qA as Q,Jv as R,E5 as S,Mn as T,M0 as U,Is as V,jA as W,d1 as X,Q5 as Y,J5 as Z,s6 as _,aQ as a,nx as a0,Ad as a1,kD as a2,Zm as a3,r_ as a4,c6 as a5,Da as a6,dA as a7,js as a8,ex as a9,HE as aa,ch as ab,GB as ac,lz as ad,FE as ae,Cb as af,GE as ag,cz as ah,lh as ai,Ti as aj,pA as ak,fB as al,KA as am,en as an,Qm as ao,xi as ap,f5 as aq,l5 as ar,D5 as as,C5 as at,Z5 as au,e6 as av,l6 as aw,a6 as ax,o6 as ay,gb as b,gl as c,vr as d,Gz as e,ka as f,Oz as g,bi as h,Bn as i,_ as j,g0 as k,kt as l,hA as m,T6 as n,ix as o,g6 as p,rx as q,L as r,XC as s,EA as t,C0 as u,li as v,ma as w,Wf as x,qD as y,_r as z};