expxagents 0.17.13 → 0.17.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,611 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ThreeBackground-DfKi4-Pv.js","assets/three-BZk_I9Ly.js","assets/browserAll-CaCsM_3V.js","assets/webworkerAll-V-D0VIF_.js","assets/WebGPURenderer-CLajcSm_.js","assets/BufferResource-CTVeZItq.js","assets/RenderTargetSystem-CsjSzl7Q.js","assets/WebGLRenderer-DYyy3oKv.js","assets/CanvasRenderer-CMQl28Sx.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 $O="modulepreload",QO=function(e){return"/"+e},tE={},mu=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=QO(p),p in tE)return;tE[p]=!0;const m=p.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":$O,m||(b.as="script"),b.crossOrigin="",b.href=p,f&&b.setAttribute("nonce",f),document.head.appendChild(b),m)return new Promise((_,S)=>{b.addEventListener("load",_),b.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 xu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pb={exports:{}},em={};/**
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 nE;function ZO(){if(nE)return em;nE=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 em.Fragment=t,em.jsx=n,em.jsxs=n,em}var iE;function JO(){return iE||(iE=1,pb.exports=ZO()),pb.exports}var x=JO(),mb={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 rE;function e3(){if(rE)return _t;rE=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"),b=Symbol.iterator;function _(I){return I===null||typeof I!="object"?null:(I=b&&I[b]||I["@@iterator"],typeof I=="function"?I:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,T={};function C(I,J,q){this.props=I,this.context=J,this.refs=T,this.updater=q||S}C.prototype.isReactComponent={},C.prototype.setState=function(I,J){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,J,"setState")},C.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function N(){}N.prototype=C.prototype;function R(I,J,q){this.props=I,this.context=J,this.refs=T,this.updater=q||S}var z=R.prototype=new N;z.constructor=R,A(z,C.prototype),z.isPureReactComponent=!0;var L=Array.isArray;function D(){}var F={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function K(I,J,q){var oe=q.ref;return{$$typeof:e,type:I,key:J,ref:oe!==void 0?oe:null,props:q}}function V(I,J){return K(I.type,J,I.props)}function P(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function G(I){var J={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(q){return J[q]})}var ne=/\/+/g;function X(I,J){return typeof I=="object"&&I!==null&&I.key!=null?G(""+I.key):J.toString(36)}function W(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(D,D):(I.status="pending",I.then(function(J){I.status==="pending"&&(I.status="fulfilled",I.value=J)},function(J){I.status==="pending"&&(I.status="rejected",I.reason=J)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function O(I,J,q,oe,ie){var de=typeof I;(de==="undefined"||de==="boolean")&&(I=null);var me=!1;if(I===null)me=!0;else switch(de){case"bigint":case"string":case"number":me=!0;break;case"object":switch(I.$$typeof){case e:case t:me=!0;break;case m:return me=I._init,O(me(I._payload),J,q,oe,ie)}}if(me)return ie=ie(I),me=oe===""?"."+X(I,0):oe,L(ie)?(q="",me!=null&&(q=me.replace(ne,"$&/")+"/"),O(ie,J,q,"",function(Re){return Re})):ie!=null&&(P(ie)&&(ie=V(ie,q+(ie.key==null||I&&I.key===ie.key?"":(""+ie.key).replace(ne,"$&/")+"/")+me)),J.push(ie)),1;me=0;var ge=oe===""?".":oe+":";if(L(I))for(var le=0;le<I.length;le++)oe=I[le],de=ge+X(oe,le),me+=O(oe,J,q,de,ie);else if(le=_(I),typeof le=="function")for(I=le.call(I),le=0;!(oe=I.next()).done;)oe=oe.value,de=ge+X(oe,le++),me+=O(oe,J,q,de,ie);else if(de==="object"){if(typeof I.then=="function")return O(W(I),J,q,oe,ie);throw J=String(I),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.")}return me}function Y(I,J,q){if(I==null)return I;var oe=[],ie=0;return O(I,oe,"","",function(de){return J.call(q,de,ie++)}),oe}function $(I){if(I._status===-1){var J=I._result;J=J(),J.then(function(q){(I._status===0||I._status===-1)&&(I._status=1,I._result=q)},function(q){(I._status===0||I._status===-1)&&(I._status=2,I._result=q)}),I._status===-1&&(I._status=0,I._result=J)}if(I._status===1)return I._result.default;throw I._result}var Q=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var J=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(J))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},H={map:Y,forEach:function(I,J,q){Y(I,function(){J.apply(this,arguments)},q)},count:function(I){var J=0;return Y(I,function(){J++}),J},toArray:function(I){return Y(I,function(J){return J})||[]},only:function(I){if(!P(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return _t.Activity=g,_t.Children=H,_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=F,_t.__COMPILER_RUNTIME={__proto__:null,c:function(I){return F.H.useMemoCache(I)}},_t.cache=function(I){return function(){return I.apply(null,arguments)}},_t.cacheSignal=function(){return null},_t.cloneElement=function(I,J,q){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var oe=A({},I.props),ie=I.key;if(J!=null)for(de in J.key!==void 0&&(ie=""+J.key),J)!Z.call(J,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&J.ref===void 0||(oe[de]=J[de]);var de=arguments.length-2;if(de===1)oe.children=q;else if(1<de){for(var me=Array(de),ge=0;ge<de;ge++)me[ge]=arguments[ge+2];oe.children=me}return K(I.type,ie,oe)},_t.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:s,_context:I},I},_t.createElement=function(I,J,q){var oe,ie={},de=null;if(J!=null)for(oe in J.key!==void 0&&(de=""+J.key),J)Z.call(J,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(ie[oe]=J[oe]);var me=arguments.length-2;if(me===1)ie.children=q;else if(1<me){for(var ge=Array(me),le=0;le<me;le++)ge[le]=arguments[le+2];ie.children=ge}if(I&&I.defaultProps)for(oe in me=I.defaultProps,me)ie[oe]===void 0&&(ie[oe]=me[oe]);return K(I,de,ie)},_t.createRef=function(){return{current:null}},_t.forwardRef=function(I){return{$$typeof:c,render:I}},_t.isValidElement=P,_t.lazy=function(I){return{$$typeof:m,_payload:{_status:-1,_result:I},_init:$}},_t.memo=function(I,J){return{$$typeof:p,type:I,compare:J===void 0?null:J}},_t.startTransition=function(I){var J=F.T,q={};F.T=q;try{var oe=I(),ie=F.S;ie!==null&&ie(q,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(D,Q)}catch(de){Q(de)}finally{J!==null&&q.types!==null&&(J.types=q.types),F.T=J}},_t.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},_t.use=function(I){return F.H.use(I)},_t.useActionState=function(I,J,q){return F.H.useActionState(I,J,q)},_t.useCallback=function(I,J){return F.H.useCallback(I,J)},_t.useContext=function(I){return F.H.useContext(I)},_t.useDebugValue=function(){},_t.useDeferredValue=function(I,J){return F.H.useDeferredValue(I,J)},_t.useEffect=function(I,J){return F.H.useEffect(I,J)},_t.useEffectEvent=function(I){return F.H.useEffectEvent(I)},_t.useId=function(){return F.H.useId()},_t.useImperativeHandle=function(I,J,q){return F.H.useImperativeHandle(I,J,q)},_t.useInsertionEffect=function(I,J){return F.H.useInsertionEffect(I,J)},_t.useLayoutEffect=function(I,J){return F.H.useLayoutEffect(I,J)},_t.useMemo=function(I,J){return F.H.useMemo(I,J)},_t.useOptimistic=function(I,J){return F.H.useOptimistic(I,J)},_t.useReducer=function(I,J,q){return F.H.useReducer(I,J,q)},_t.useRef=function(I){return F.H.useRef(I)},_t.useState=function(I){return F.H.useState(I)},_t.useSyncExternalStore=function(I,J,q){return F.H.useSyncExternalStore(I,J,q)},_t.useTransition=function(){return F.H.useTransition()},_t.version="19.2.4",_t}var aE;function Ah(){return aE||(aE=1,mb.exports=e3()),mb.exports}var B=Ah();const vm=xu(B);var gb={exports:{}},tm={},yb={exports:{}},xb={};/**
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 sE;function t3(){return sE||(sE=1,(function(e){function t(O,Y){var $=O.length;O.push(Y);e:for(;0<$;){var Q=$-1>>>1,H=O[Q];if(0<r(H,Y))O[Q]=Y,O[$]=H,$=Q;else break e}}function n(O){return O.length===0?null:O[0]}function i(O){if(O.length===0)return null;var Y=O[0],$=O.pop();if($!==Y){O[0]=$;e:for(var Q=0,H=O.length,I=H>>>1;Q<I;){var J=2*(Q+1)-1,q=O[J],oe=J+1,ie=O[oe];if(0>r(q,$))oe<H&&0>r(ie,q)?(O[Q]=ie,O[oe]=$,Q=oe):(O[Q]=q,O[J]=$,Q=J);else if(oe<H&&0>r(ie,$))O[Q]=ie,O[oe]=$,Q=oe;else break e}}return Y}function r(O,Y){var $=O.sortIndex-Y.sortIndex;return $!==0?$:O.id-Y.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,b=3,_=!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 z(O){for(var Y=n(p);Y!==null;){if(Y.callback===null)i(p);else if(Y.startTime<=O)i(p),Y.sortIndex=Y.expirationTime,t(f,Y);else break;Y=n(p)}}function L(O){if(A=!1,z(O),!S)if(n(f)!==null)S=!0,D||(D=!0,G());else{var Y=n(p);Y!==null&&W(L,Y.startTime-O)}}var D=!1,F=-1,Z=5,K=-1;function V(){return T?!0:!(e.unstable_now()-K<Z)}function P(){if(T=!1,D){var O=e.unstable_now();K=O;var Y=!0;try{e:{S=!1,A&&(A=!1,N(F),F=-1),_=!0;var $=b;try{t:{for(z(O),g=n(f);g!==null&&!(g.expirationTime>O&&V());){var Q=g.callback;if(typeof Q=="function"){g.callback=null,b=g.priorityLevel;var H=Q(g.expirationTime<=O);if(O=e.unstable_now(),typeof H=="function"){g.callback=H,z(O),Y=!0;break t}g===n(f)&&i(f),z(O)}else i(f);g=n(f)}if(g!==null)Y=!0;else{var I=n(p);I!==null&&W(L,I.startTime-O),Y=!1}}break e}finally{g=null,b=$,_=!1}Y=void 0}}finally{Y?G():D=!1}}}var G;if(typeof R=="function")G=function(){R(P)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,X=ne.port2;ne.port1.onmessage=P,G=function(){X.postMessage(null)}}else G=function(){C(P,0)};function W(O,Y){F=C(function(){O(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(O){switch(b){case 1:case 2:case 3:var Y=3;break;default:Y=b}var $=b;b=Y;try{return O()}finally{b=$}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(O,Y){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var $=b;b=O;try{return Y()}finally{b=$}},e.unstable_scheduleCallback=function(O,Y,$){var Q=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?Q+$:Q):$=Q,O){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=$+H,O={id:m++,callback:Y,priorityLevel:O,startTime:$,expirationTime:H,sortIndex:-1},$>Q?(O.sortIndex=$,t(p,O),n(f)===null&&O===n(p)&&(A?(N(F),F=-1):A=!0,W(L,$-Q))):(O.sortIndex=H,t(f,O),S||_||(S=!0,D||(D=!0,G()))),O},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(O){var Y=b;return function(){var $=b;b=Y;try{return O.apply(this,arguments)}finally{b=$}}}})(xb)),xb}var lE;function n3(){return lE||(lE=1,yb.exports=t3()),yb.exports}var bb={exports:{}},Ir={};/**
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 oE;function i3(){if(oE)return Ir;oE=1;var e=Ah();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 Ir.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Ir.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)},Ir.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()}},Ir.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))},Ir.prefetchDNS=function(f){typeof f=="string"&&i.d.D(f)},Ir.preinit=function(f,p){if(typeof f=="string"&&p&&typeof p.as=="string"){var m=p.as,g=c(m,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,_=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:b,fetchPriority:_}):m==="script"&&i.d.X(f,{crossOrigin:g,integrity:b,fetchPriority:_,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Ir.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)},Ir.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})}},Ir.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)},Ir.requestFormReset=function(f){i.d.r(f)},Ir.unstable_batchedUpdates=function(f,p){return f(p)},Ir.useFormState=function(f,p,m){return l.H.useFormState(f,p,m)},Ir.useFormStatus=function(){return l.H.useHostTransitionStatus()},Ir.version="19.2.4",Ir}var cE;function jC(){if(cE)return bb.exports;cE=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(),bb.exports=i3(),bb.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 uE;function r3(){if(uE)return tm;uE=1;var e=n3(),t=Ah(),n=jC();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,ee=E.child;ee;){if(ee===h){U=!0,h=E,y=M;break}if(ee===y){U=!0,y=E,h=M;break}ee=ee.sibling}if(!U){for(ee=M.child;ee;){if(ee===h){U=!0,h=M,y=E;break}if(ee===y){U=!0,y=M,h=E;break}ee=ee.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,b=Symbol.for("react.element"),_=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"),z=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function G(a){return a===null||typeof a!="object"?null:(a=P&&a[P]||a["@@iterator"],typeof a=="function"?a:null)}var ne=Symbol.for("react.client.reference");function X(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===ne?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 L:return"Suspense";case D:return"SuspenseList";case K: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 z:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case F:return o=a.displayName||null,o!==null?o:X(a.type)||"Memo";case Z:o=a._payload,a=a._init;try{return X(a(o))}catch{}}return null}var W=Array.isArray,O=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},Q=[],H=-1;function I(a){return{current:a}}function J(a){0>H||(a.current=Q[H],Q[H]=null,H--)}function q(a,o){H++,Q[H]=a.current,a.current=o}var oe=I(null),ie=I(null),de=I(null),me=I(null);function ge(a,o){switch(q(de,o),q(ie,a),q(oe,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?wS(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=wS(o),a=TS(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}J(oe),q(oe,a)}function le(){J(oe),J(ie),J(de)}function Re(a){a.memoizedState!==null&&q(me,a);var o=oe.current,h=TS(o,a.type);o!==h&&(q(ie,a),q(oe,h))}function Le(a){ie.current===a&&(J(oe),J(ie)),me.current===a&&(J(me),$p._currentValue=$)}var Be,He;function Qe(a){if(Be===void 0)try{throw Error()}catch(h){var o=h.stack.trim().match(/\n( *(at )?)/);Be=o&&o[1]||"",He=-1<h.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+Be+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],ee=M[1];if(U&&ee){var ae=U.split(`
45
+ `),xe=ee.split(`
46
+ `);for(E=y=0;y<ae.length&&!ae[y].includes("DetermineComponentFrameRoot");)y++;for(;E<xe.length&&!xe[E].includes("DetermineComponentFrameRoot");)E++;if(y===ae.length||E===xe.length)for(y=ae.length-1,E=xe.length-1;1<=y&&0<=E&&ae[y]!==xe[E];)E--;for(;1<=y&&0<=E;y--,E--)if(ae[y]!==xe[E]){if(y!==1||E!==1)do if(y--,E--,0>E||ae[y]!==xe[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 Sn(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 En=Object.prototype.hasOwnProperty,pn=e.unstable_scheduleCallback,ui=e.unstable_cancelCallback,Yr=e.unstable_shouldYield,ki=e.unstable_requestPaint,Qt=e.unstable_now,ur=e.unstable_getCurrentPriorityLevel,Ee=e.unstable_ImmediatePriority,ke=e.unstable_UserBlockingPriority,ce=e.unstable_NormalPriority,Pe=e.unstable_LowPriority,ct=e.unstable_IdlePriority,nn=e.log,di=e.unstable_setDisableYieldValue,Zt=null,Jt=null;function Gn(a){if(typeof nn=="function"&&di(a),Jt&&typeof Jt.setStrictMode=="function")try{Jt.setStrictMode(Zt,a)}catch{}}var Ft=Math.clz32?Math.clz32:Ao,Wi=Math.log,ti=Math.LN2;function Ao(a){return a>>>=0,a===0?32:31-(Wi(a)/ti|0)|0}var hs=256,Ha=262144,ps=4194304;function Ei(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 ee=y&134217727;return ee!==0?(y=ee&~M,y!==0?E=Ei(y):(U&=ee,U!==0?E=Ei(U):h||(h=ee&~a,h!==0&&(E=Ei(h))))):(ee=y&~M,ee!==0?E=Ei(ee):U!==0?E=Ei(U):h||(h=y&~a,h!==0&&(E=Ei(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 Ie(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=ps;return ps<<=1,(ps&62914560)===0&&(ps=4194304),a}function rn(a){for(var o=[],h=0;31>h;h++)o.push(a);return o}function an(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 ee=a.entanglements,ae=a.expirationTimes,xe=a.hiddenUpdates;for(h=U&~h;0<h;){var we=31-Ft(h),Me=1<<we;ee[we]=0,ae[we]=-1;var ve=xe[we];if(ve!==null)for(xe[we]=null,we=0;we<ve.length;we++){var Se=ve[we];Se!==null&&(Se.lane&=-536870913)}h&=~Me}y!==0&&qe(a,y,0),M!==0&&E===0&&a.tag!==0&&(a.suspendedLanes|=M&~(U&~o))}function qe(a,o,h){a.pendingLanes|=o,a.suspendedLanes&=~o;var y=31-Ft(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-Ft(h),E=1<<y;E&o|a[y]&o&&(a[y]|=o),h&=~E}}function kn(a,o){var h=o&-o;return h=(h&42)!==0?1:qt(h),(h&(a.suspendedLanes|o))!==0?0:h}function qt(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 _a(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function dr(){var a=Y.p;return a!==0?a:(a=window.event,a===void 0?32:KS(a.type))}function $i(a,o){var h=Y.p;try{return Y.p=a,o()}finally{Y.p=h}}var fr=Math.random().toString(36).slice(2),bt="__reactFiber$"+fr,fi="__reactProps$"+fr,Vr="__reactContainer$"+fr,Ys="__reactEvents$"+fr,Dl="__reactListeners$"+fr,zl="__reactHandles$"+fr,jl="__reactResources$"+fr,Pa="__reactMarker$"+fr;function Vs(a){delete a[bt],delete a[fi],delete a[Ys],delete a[Dl],delete a[zl]}function sn(a){var o=a[bt];if(o)return o;for(var h=a.parentNode;h;){if(o=h[Vr]||h[bt]){if(h=o.alternate,o.child!==null||h!==null&&h.child!==null)for(a=OS(a);a!==null;){if(h=a[bt])return h;a=OS(a)}return o}a=h,h=a.parentNode}return null}function ln(a){if(a=a[bt]||a[Vr]){var o=a.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return a}return null}function hr(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a.stateNode;throw Error(i(33))}function Xr(a){var o=a[jl];return o||(o=a[jl]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function In(a){a[Pa]=!0}var Cr=new Set,Sa={};function Kr(a,o){Ne(a,o),Ne(a+"Capture",o)}function Ne(a,o){for(Sa[a]=o,a=0;a<o.length;a++)Cr.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={},Kt={};function Un(a){return En.call(Kt,a)?!0:En.call(vt,a)?!1:Ke.test(a)?Kt[a]=!0:(vt[a]=!0,!1)}function wi(a,o,h){if(Un(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 Qi(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 Ni(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 mn(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function pr(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Mo(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 Ea(a){if(!a._valueTracker){var o=pr(a)?"checked":"value";a._valueTracker=Mo(a,o,""+a[o])}}function Ll(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var h=o.getValue(),y="";return a&&(y=pr(a)?a.checked?"true":"false":a.value),a=y,a!==h?(o.setValue(a),!0):!1}function Fa(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 bc=/[\n"\\]/g;function Ui(a){return a.replace(bc,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function ms(a,o,h,y,E,M,U,ee){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=""+mn(o)):a.value!==""+mn(o)&&(a.value=""+mn(o)):U!=="submit"&&U!=="reset"||a.removeAttribute("value"),o!=null?Xs(a,U,mn(o)):h!=null?Xs(a,U,mn(h)):y!=null&&a.removeAttribute("value"),E==null&&M!=null&&(a.defaultChecked=!!M),E!=null&&(a.checked=E&&typeof E!="function"&&typeof E!="symbol"),ee!=null&&typeof ee!="function"&&typeof ee!="symbol"&&typeof ee!="boolean"?a.name=""+mn(ee):a.removeAttribute("name")}function gs(a,o,h,y,E,M,U,ee){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)){Ea(a);return}h=h!=null?""+mn(h):"",o=o!=null?""+mn(o):h,ee||o===a.value||(a.value=o),a.defaultValue=o}y=y??E,y=typeof y!="function"&&typeof y!="symbol"&&!!y,a.checked=ee?a.checked:!!y,a.defaultChecked=!!y,U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"&&(a.name=U),Ea(a)}function Xs(a,o,h){o==="number"&&Fa(a.ownerDocument)===a||a.defaultValue===""+h||(a.defaultValue=""+h)}function hi(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=""+mn(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 _u(a,o,h){if(o!=null&&(o=""+mn(o),o!==a.value&&(a.value=o),h==null)){a.defaultValue!==o&&(a.defaultValue=o);return}a.defaultValue=h!=null?""+mn(h):""}function qa(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=mn(o),a.defaultValue=h,y=a.textContent,y===h&&y!==""&&y!==null&&(a.value=y),Ea(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 Ro=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 Pn(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||Ro.has(o)?o==="float"?a.cssFloat=h:a[o]=(""+h).trim():a[o]=h+"px"}function on(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&&Pn(a,E,y)}else for(var M in o)o.hasOwnProperty(M)&&Pn(a,M,o[M])}function ys(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 xs=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"]]),vc=/^[\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 Ks(a){return vc.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function je(){}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,Nn=null;function Wr(a){var o=ln(a);if(o&&(a=o.stateNode)){var h=a[fi]||null;e:switch(a=o.stateNode,o.type){case"input":if(ms(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="'+Ui(""+o)+'"][type="radio"]'),o=0;o<h.length;o++){var y=h[o];if(y!==a&&y.form===a.form){var E=y[fi]||null;if(!E)throw Error(i(90));ms(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&&Ll(y)}break e;case"textarea":_u(a,h.value,h.defaultValue);break e;case"select":o=h.value,o!=null&&hi(a,!!h.multiple,o,!1)}}}var _c=!1;function Su(a,o,h){if(_c)return a(o,h);_c=!0;try{var y=a(o);return y}finally{if(_c=!1,(Nt!==null||Nn!==null)&&(te(),Nt&&(o=Nt,a=Nn,Nn=Nt=null,Wr(o),a)))for(o=0;o<a.length;o++)Wr(a[o])}}function ko(a,o){var h=a.stateNode;if(h===null)return null;var y=h[fi]||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 bs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bd=!1;if(bs)try{var Eu={};Object.defineProperty(Eu,"passive",{get:function(){Bd=!0}}),window.addEventListener("test",Eu,Eu),window.removeEventListener("test",Eu,Eu)}catch{Bd=!1}var Bl=null,Id=null,Il=null;function Ud(){if(Il)return Il;var a,o=Id,h=o.length,y,E="value"in Bl?Bl.value:Bl.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 Il=E.slice(a,1<y?1-y:void 0)}function No(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 wu(){return!0}function Dh(){return!1}function Zi(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 ee in a)a.hasOwnProperty(ee)&&(h=a[ee],this[ee]=h?h(M):M[ee]);return this.isDefaultPrevented=(M.defaultPrevented!=null?M.defaultPrevented:M.returnValue===!1)?wu:Dh,this.isPropagationStopped=Dh,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=wu)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=wu)},persist:function(){},isPersistent:wu}),o}var Ul={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tu=Zi(Ul),Ga=g({},Ul,{view:0,detail:0}),Hd=Zi(Ga),Pd,Cu,Sc,Au=g({},Ga,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ru,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!==Sc&&(Sc&&a.type==="mousemove"?(Pd=a.screenX-Sc.screenX,Cu=a.screenY-Sc.screenY):Cu=Pd=0,Sc=a),Pd)},movementY:function(a){return"movementY"in a?a.movementY:Cu}}),xg=Zi(Au),Hi=g({},Au,{dataTransfer:0}),bg=Zi(Hi),vg=g({},Ga,{relatedTarget:0}),Fd=Zi(vg),_g=g({},Ul,{animationName:0,elapsedTime:0,pseudoElement:0}),Sg=Zi(_g),Mu=g({},Ul,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),zh=Zi(Mu),Eg=g({},Ul,{data:0}),jh=Zi(Eg),wg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Lh={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"},Bh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tg(a){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(a):(a=Bh[a])?!!o[a]:!1}function Ru(){return Tg}var Ih=g({},Ga,{key:function(a){if(a.key){var o=wg[a.key]||a.key;if(o!=="Unidentified")return o}return a.type==="keypress"?(a=No(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Lh[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ru,charCode:function(a){return a.type==="keypress"?No(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?No(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),Uh=Zi(Ih),Cg=g({},Au,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qd=Zi(Cg),Ag=g({},Ga,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ru}),Ws=Zi(Ag),Hh=g({},Ul,{propertyName:0,elapsedTime:0,pseudoElement:0}),Dx=Zi(Hh),Mg=g({},Au,{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}),Hl=Zi(Mg),$s=g({},Ul,{newState:0,oldState:0}),Ph=Zi($s),Fh=[9,13,27,32],Oo=bs&&"CompositionEvent"in window,Pl=null;bs&&"documentMode"in document&&(Pl=document.documentMode);var Do=bs&&"TextEvent"in window&&!Pl,Pi=bs&&(!Oo||Pl&&8<Pl&&11>=Pl),ku=" ",qh=!1;function Gd(a,o){switch(a){case"keyup":return Fh.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ec(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Fl=!1;function Yd(a,o){switch(a){case"compositionend":return Ec(o);case"keypress":return o.which!==32?null:(qh=!0,ku);case"textInput":return a=o.data,a===ku&&qh?null:a;default:return null}}function Rg(a,o){if(Fl)return a==="compositionend"||!Oo&&Gd(a,o)?(a=Ud(),Il=Id=Bl=null,Fl=!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 Pi&&o.locale!=="ko"?null:o.data;default:return null}}var $r={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 Gh(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o==="input"?!!$r[a.type]:o==="textarea"}function Vd(a,o,h,y){Nt?Nn?Nn.push(y):Nn=[y]:Nt=y,o=vy(o,"onChange"),0<o.length&&(h=new Tu("onChange","change",null,h,y),a.push({event:h,listeners:o}))}var wc=null,Tc=null;function Yh(a){xS(a,0)}function Cc(a){var o=hr(a);if(Ll(o))return a}function Vh(a,o){if(a==="change")return o}var Nu=!1;if(bs){var zo;if(bs){var On="oninput"in document;if(!On){var kg=document.createElement("div");kg.setAttribute("oninput","return;"),On=typeof kg.oninput=="function"}zo=On}else zo=!1;Nu=zo&&(!document.documentMode||9<document.documentMode)}function Ng(){wc&&(wc.detachEvent("onpropertychange",Xh),Tc=wc=null)}function Xh(a){if(a.propertyName==="value"&&Cc(Tc)){var o=[];Vd(o,Tc,a,yt(a)),Su(Yh,o)}}function Ou(a,o,h){a==="focusin"?(Ng(),wc=o,Tc=h,wc.attachEvent("onpropertychange",Xh)):a==="focusout"&&Ng()}function ql(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Cc(Tc)}function Og(a,o){if(a==="click")return Cc(o)}function Dg(a,o){if(a==="input"||a==="change")return Cc(o)}function jo(a,o){return a===o&&(a!==0||1/a===1/o)||a!==a&&o!==o}var Dn=typeof Object.is=="function"?Object.is:jo;function Ac(a,o){if(Dn(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(!En.call(o,E)||!Dn(a[E],o[E]))return!1}return!0}function Kh(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Wh(a,o){var h=Kh(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=Kh(h)}}function Xd(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?Xd(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function Kd(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=Fa(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=Fa(a.document)}return o}function Mc(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 zg=bs&&"documentMode"in document&&11>=document.documentMode,Rc=null,Wd=null,kc=null,Qr=!1;function $d(a,o,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Qr||Rc==null||Rc!==Fa(y)||(y=Rc,"selectionStart"in y&&Mc(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}),kc&&Ac(kc,y)||(kc=y,y=vy(Wd,"onSelect"),0<y.length&&(o=new Tu("onSelect","select",null,o,h),a.push({event:o,listeners:y}),o.target=Rc)))}function Gl(a,o){var h={};return h[a.toLowerCase()]=o.toLowerCase(),h["Webkit"+a]="webkit"+o,h["Moz"+a]="moz"+o,h}var Nc={animationend:Gl("Animation","AnimationEnd"),animationiteration:Gl("Animation","AnimationIteration"),animationstart:Gl("Animation","AnimationStart"),transitionrun:Gl("Transition","TransitionRun"),transitionstart:Gl("Transition","TransitionStart"),transitioncancel:Gl("Transition","TransitionCancel"),transitionend:Gl("Transition","TransitionEnd")},Du={},mr={};bs&&(mr=document.createElement("div").style,"AnimationEvent"in window||(delete Nc.animationend.animation,delete Nc.animationiteration.animation,delete Nc.animationstart.animation),"TransitionEvent"in window||delete Nc.transitionend.transition);function Yl(a){if(Du[a])return Du[a];if(!Nc[a])return a;var o=Nc[a],h;for(h in o)if(o.hasOwnProperty(h)&&h in mr)return Du[a]=o[h];return a}var Ar=Yl("animationend"),$h=Yl("animationiteration"),vs=Yl("animationstart"),Oc=Yl("transitionrun"),Vl=Yl("transitionstart"),Qh=Yl("transitioncancel"),Qd=Yl("transitionend"),Qs=new Map,Zd="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(" ");Zd.push("scrollEnd");function Ji(a,o){Qs.set(a,o),Kr(o,[a])}var Xl=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)},Oi=[],Lo=0,Jd=0;function Kl(){for(var a=Lo,o=Jd=Lo=0;o<a;){var h=Oi[o];Oi[o++]=null;var y=Oi[o];Oi[o++]=null;var E=Oi[o];Oi[o++]=null;var M=Oi[o];if(Oi[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&&ef(h,E,M)}}function zu(a,o,h,y){Oi[Lo++]=a,Oi[Lo++]=o,Oi[Lo++]=h,Oi[Lo++]=y,Jd|=y,a.lanes|=y,a=a.alternate,a!==null&&(a.lanes|=y)}function Dc(a,o,h,y){return zu(a,o,h,y),zc(a)}function Wl(a,o){return zu(a,null,null,o),zc(a)}function ef(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-Ft(h),a=M.hiddenUpdates,y=a[E],y===null?a[E]=[o]:y.push(o),o.lane=h|536870912),M):null}function zc(a){if(50<Jo)throw Jo=0,ec=null,Error(i(185));for(var o=a.return;o!==null;)a=o,o=a.return;return a.tag===3?a.stateNode:null}var $l={};function jg(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 gr(a,o,h,y){return new jg(a,o,h,y)}function yr(a){return a=a.prototype,!(!a||!a.isReactComponent)}function _s(a,o){var h=a.alternate;return h===null?(h=gr(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 er(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 ju(a,o,h,y,E,M){var U=0;if(y=a,typeof a=="function")yr(a)&&(U=1);else if(typeof a=="string")U=IO(a,h,oe.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case K:return a=gr(31,h,o,E),a.elementType=K,a.lanes=M,a;case A:return Zs(h.children,E,M,o);case T:U=8,E|=24;break;case C:return a=gr(12,h,o,E|2),a.elementType=C,a.lanes=M,a;case L:return a=gr(13,h,o,E),a.elementType=L,a.lanes=M,a;case D:return a=gr(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 z:U=11;break e;case F: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=gr(U,h,o,E),o.elementType=a,o.type=y,o.lanes=M,o}function Zs(a,o,h,y){return a=gr(7,a,y,o),a.lanes=h,a}function tf(a,o,h){return a=gr(6,a,null,o),a.lanes=h,a}function Lg(a){var o=gr(18,null,null,0);return o.stateNode=a,o}function Ya(a,o,h){return o=gr(4,a.children!==null?a.children:[],a.key,o),o.lanes=h,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}var Zh=new WeakMap;function Mr(a,o){if(typeof a=="object"&&a!==null){var h=Zh.get(a);return h!==void 0?h:(o={value:a,source:o,stack:Sn(o)},Zh.set(a,o),o)}return{value:a,source:o,stack:Sn(o)}}var Va=[],Bo=0,Lu=null,jc=0,Zr=[],Rr=0,Ss=null,Es=1,ws="";function Js(a,o){Va[Bo++]=jc,Va[Bo++]=Lu,Lu=a,jc=o}function Jh(a,o,h){Zr[Rr++]=Es,Zr[Rr++]=ws,Zr[Rr++]=Ss,Ss=a;var y=Es;a=ws;var E=32-Ft(y)-1;y&=~(1<<E),h+=1;var M=32-Ft(o)+E;if(30<M){var U=E-E%5;M=(y&(1<<U)-1).toString(32),y>>=U,E-=U,Es=1<<32-Ft(o)+E|h<<E|y,ws=M+a}else Es=1<<M|h<<E|y,ws=a}function nf(a){a.return!==null&&(Js(a,1),Jh(a,1,0))}function Ql(a){for(;a===Lu;)Lu=Va[--Bo],Va[Bo]=null,jc=Va[--Bo],Va[Bo]=null;for(;a===Ss;)Ss=Zr[--Rr],Zr[Rr]=null,ws=Zr[--Rr],Zr[Rr]=null,Es=Zr[--Rr],Zr[Rr]=null}function Bu(a,o){Zr[Rr++]=Es,Zr[Rr++]=ws,Zr[Rr++]=Ss,Es=o.id,ws=o.overflow,Ss=a}var Di=null,wn=null,zt=!1,el=null,zi=!1,rf=Error(i(519));function Ot(a){var o=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Iu(Mr(o,a)),rf}function af(a){var o=a.stateNode,h=a.type,y=a.memoizedProps;switch(o[bt]=a,o[fi]=y,h){case"dialog":jt("cancel",o),jt("close",o);break;case"iframe":case"object":case"embed":jt("load",o);break;case"video":case"audio":for(h=0;h<Yp.length;h++)jt(Yp[h],o);break;case"source":jt("error",o);break;case"img":case"image":case"link":jt("error",o),jt("load",o);break;case"details":jt("toggle",o);break;case"input":jt("invalid",o),gs(o,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0);break;case"select":jt("invalid",o);break;case"textarea":jt("invalid",o),qa(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||SS(o.textContent,h)?(y.popover!=null&&(jt("beforetoggle",o),jt("toggle",o)),y.onScroll!=null&&jt("scroll",o),y.onScrollEnd!=null&&jt("scrollend",o),y.onClick!=null&&(o.onclick=je),o=!0):o=!1,o||Ot(a,!0)}function Bg(a){for(Di=a.return;Di;)switch(Di.tag){case 5:case 31:case 13:zi=!1;return;case 27:case 3:zi=!0;return;default:Di=Di.return}}function Io(a){if(a!==Di)return!1;if(!zt)return Bg(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")||Jx(a.type,a.memoizedProps)),h=!h),h&&wn&&Ot(a),Bg(a),o===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));wn=NS(a)}else if(o===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));wn=NS(a)}else o===27?(o=wn,eu(a.type)?(a=rb,rb=null,wn=a):wn=o):wn=Di?js(a.stateNode.nextSibling):null;return!0}function Uo(){wn=Di=null,zt=!1}function ep(){var a=el;return a!==null&&(sr===null?sr=a:sr.push.apply(sr,a),el=null),a}function Iu(a){el===null?el=[a]:el.push(a)}var tp=I(null),tl=null,tr=null;function nl(a,o,h){q(tp,o._currentValue),o._currentValue=h}function wa(a){a._currentValue=tp.current,J(tp)}function il(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 sf(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 ee=M;M=E;for(var ae=0;ae<o.length;ae++)if(ee.context===o[ae]){M.lanes|=h,ee=M.alternate,ee!==null&&(ee.lanes|=h),il(M.return,h,a),y||(U=null);break e}M=ee.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),il(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 Zl(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 ee=E.type;Dn(E.pendingProps.value,U.value)||(a!==null?a.push(ee):a=[ee])}}else if(E===me.current){if(U=E.alternate,U===null)throw Error(i(387));U.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(a!==null?a.push($p):a=[$p])}E=E.return}a!==null&&sf(o,a,h,y),o.flags|=262144}function Lc(a){for(a=a.firstContext;a!==null;){if(!Dn(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Ho(a){tl=a,tr=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function ji(a){return np(tl,a)}function Uu(a,o){return tl===null&&Ho(a),np(a,o)}function np(a,o){var h=o._currentValue;if(o={context:o,memoizedValue:h,next:null},tr===null){if(a===null)throw Error(i(308));tr=o,a.dependencies={lanes:0,firstContext:o},a.flags|=524288}else tr=tr.next=o;return h}var Ig=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()})}},Ug=e.unstable_scheduleCallback,ip=e.unstable_NormalPriority,Je={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function rp(){return{controller:new Ig,data:new Map,refCount:0}}function Fi(a){a.refCount--,a.refCount===0&&Ug(ip,function(){a.controller.abort()})}var Po=null,ap=0,rl=0,Xa=null;function Bc(a,o){if(Po===null){var h=Po=[];ap=0,rl=Gx(),Xa={status:"pending",value:void 0,then:function(y){h.push(y)}}}return ap++,o.then(sp,sp),o}function sp(){if(--ap===0&&Po!==null){Xa!==null&&(Xa.status="fulfilled");var a=Po;Po=null,rl=0,Xa=null;for(var o=0;o<a.length;o++)(0,a[o])()}}function lp(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 Hg=O.S;O.S=function(a,o){Qc=Qt(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&Bc(a,o),Hg!==null&&Hg(a,o)};var Jl=I(null);function Ts(){var a=Jl.current;return a!==null?a:un.pooledCache}function Ic(a,o){o===null?q(Jl,Jl.current):q(Jl,o.pool)}function lf(){var a=Ts();return a===null?null:{parent:Je._currentValue,pool:a}}var eo=Error(i(460)),Hu=Error(i(474)),Ka=Error(i(542)),Pu={then:function(){}};function Pg(a){return a=a.status,a==="fulfilled"||a==="rejected"}function op(a,o,h){switch(h=a[h],h===void 0?a.push(o):h!==o&&(o.then(je,je),o=h),o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,cp(a),a;default:if(typeof o.status=="string")o.then(je,je);else{if(a=un,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,cp(a),a}throw at=o,eo}}function Fo(a){try{var o=a._init;return o(a._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(at=h,eo):h}}var at=null;function of(){if(at===null)throw Error(i(459));var a=at;return at=null,a}function cp(a){if(a===eo||a===Ka)throw Error(i(483))}var to=null,no=0;function cf(a){var o=no;return no+=1,to===null&&(to=[]),op(to,a,o)}function Fu(a,o){o=o.props.ref,a.ref=o!==void 0?o:null}function qu(a,o){throw o.$$typeof===b?Error(i(525)):(a=Object.prototype.toString.call(o),Error(i(31,a==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":a)))}function Uc(a){function o(he,ue){if(a){var ye=he.deletions;ye===null?(he.deletions=[ue],he.flags|=16):ye.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=_s(he,ue),he.index=0,he.sibling=null,he}function M(he,ue,ye){return he.index=ye,a?(ye=he.alternate,ye!==null?(ye=ye.index,ye<ue?(he.flags|=67108866,ue):ye):(he.flags|=67108866,ue)):(he.flags|=1048576,ue)}function U(he){return a&&he.alternate===null&&(he.flags|=67108866),he}function ee(he,ue,ye,Ae){return ue===null||ue.tag!==6?(ue=tf(ye,he.mode,Ae),ue.return=he,ue):(ue=E(ue,ye),ue.return=he,ue)}function ae(he,ue,ye,Ae){var it=ye.type;return it===A?we(he,ue,ye.props.children,Ae,ye.key):ue!==null&&(ue.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===Z&&Fo(it)===ue.type)?(ue=E(ue,ye.props),Fu(ue,ye),ue.return=he,ue):(ue=ju(ye.type,ye.key,ye.props,null,he.mode,Ae),Fu(ue,ye),ue.return=he,ue)}function xe(he,ue,ye,Ae){return ue===null||ue.tag!==4||ue.stateNode.containerInfo!==ye.containerInfo||ue.stateNode.implementation!==ye.implementation?(ue=Ya(ye,he.mode,Ae),ue.return=he,ue):(ue=E(ue,ye.children||[]),ue.return=he,ue)}function we(he,ue,ye,Ae,it){return ue===null||ue.tag!==7?(ue=Zs(ye,he.mode,Ae,it),ue.return=he,ue):(ue=E(ue,ye),ue.return=he,ue)}function Me(he,ue,ye){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return ue=tf(""+ue,he.mode,ye),ue.return=he,ue;if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case _:return ye=ju(ue.type,ue.key,ue.props,null,he.mode,ye),Fu(ye,ue),ye.return=he,ye;case S:return ue=Ya(ue,he.mode,ye),ue.return=he,ue;case Z:return ue=Fo(ue),Me(he,ue,ye)}if(W(ue)||G(ue))return ue=Zs(ue,he.mode,ye,null),ue.return=he,ue;if(typeof ue.then=="function")return Me(he,cf(ue),ye);if(ue.$$typeof===R)return Me(he,Uu(he,ue),ye);qu(he,ue)}return null}function ve(he,ue,ye,Ae){var it=ue!==null?ue.key:null;if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return it!==null?null:ee(he,ue,""+ye,Ae);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case _:return ye.key===it?ae(he,ue,ye,Ae):null;case S:return ye.key===it?xe(he,ue,ye,Ae):null;case Z:return ye=Fo(ye),ve(he,ue,ye,Ae)}if(W(ye)||G(ye))return it!==null?null:we(he,ue,ye,Ae,null);if(typeof ye.then=="function")return ve(he,ue,cf(ye),Ae);if(ye.$$typeof===R)return ve(he,ue,Uu(he,ye),Ae);qu(he,ye)}return null}function Se(he,ue,ye,Ae,it){if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number"||typeof Ae=="bigint")return he=he.get(ye)||null,ee(ue,he,""+Ae,it);if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case _:return he=he.get(Ae.key===null?ye:Ae.key)||null,ae(ue,he,Ae,it);case S:return he=he.get(Ae.key===null?ye:Ae.key)||null,xe(ue,he,Ae,it);case Z:return Ae=Fo(Ae),Se(he,ue,ye,Ae,it)}if(W(Ae)||G(Ae))return he=he.get(ye)||null,we(ue,he,Ae,it,null);if(typeof Ae.then=="function")return Se(he,ue,ye,cf(Ae),it);if(Ae.$$typeof===R)return Se(he,ue,ye,Uu(ue,Ae),it);qu(ue,Ae)}return null}function Xe(he,ue,ye,Ae){for(var it=null,fn=null,We=ue,Ct=ue=0,Ut=null;We!==null&&Ct<ye.length;Ct++){We.index>Ct?(Ut=We,We=null):Ut=We.sibling;var hn=ve(he,We,ye[Ct],Ae);if(hn===null){We===null&&(We=Ut);break}a&&We&&hn.alternate===null&&o(he,We),ue=M(hn,ue,Ct),fn===null?it=hn:fn.sibling=hn,fn=hn,We=Ut}if(Ct===ye.length)return h(he,We),zt&&Js(he,Ct),it;if(We===null){for(;Ct<ye.length;Ct++)We=Me(he,ye[Ct],Ae),We!==null&&(ue=M(We,ue,Ct),fn===null?it=We:fn.sibling=We,fn=We);return zt&&Js(he,Ct),it}for(We=y(We);Ct<ye.length;Ct++)Ut=Se(We,he,Ct,ye[Ct],Ae),Ut!==null&&(a&&Ut.alternate!==null&&We.delete(Ut.key===null?Ct:Ut.key),ue=M(Ut,ue,Ct),fn===null?it=Ut:fn.sibling=Ut,fn=Ut);return a&&We.forEach(function(au){return o(he,au)}),zt&&Js(he,Ct),it}function ut(he,ue,ye,Ae){if(ye==null)throw Error(i(151));for(var it=null,fn=null,We=ue,Ct=ue=0,Ut=null,hn=ye.next();We!==null&&!hn.done;Ct++,hn=ye.next()){We.index>Ct?(Ut=We,We=null):Ut=We.sibling;var au=ve(he,We,hn.value,Ae);if(au===null){We===null&&(We=Ut);break}a&&We&&au.alternate===null&&o(he,We),ue=M(au,ue,Ct),fn===null?it=au:fn.sibling=au,fn=au,We=Ut}if(hn.done)return h(he,We),zt&&Js(he,Ct),it;if(We===null){for(;!hn.done;Ct++,hn=ye.next())hn=Me(he,hn.value,Ae),hn!==null&&(ue=M(hn,ue,Ct),fn===null?it=hn:fn.sibling=hn,fn=hn);return zt&&Js(he,Ct),it}for(We=y(We);!hn.done;Ct++,hn=ye.next())hn=Se(We,he,Ct,hn.value,Ae),hn!==null&&(a&&hn.alternate!==null&&We.delete(hn.key===null?Ct:hn.key),ue=M(hn,ue,Ct),fn===null?it=hn:fn.sibling=hn,fn=hn);return a&&We.forEach(function(WO){return o(he,WO)}),zt&&Js(he,Ct),it}function An(he,ue,ye,Ae){if(typeof ye=="object"&&ye!==null&&ye.type===A&&ye.key===null&&(ye=ye.props.children),typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case _:e:{for(var it=ye.key;ue!==null;){if(ue.key===it){if(it=ye.type,it===A){if(ue.tag===7){h(he,ue.sibling),Ae=E(ue,ye.props.children),Ae.return=he,he=Ae;break e}}else if(ue.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===Z&&Fo(it)===ue.type){h(he,ue.sibling),Ae=E(ue,ye.props),Fu(Ae,ye),Ae.return=he,he=Ae;break e}h(he,ue);break}else o(he,ue);ue=ue.sibling}ye.type===A?(Ae=Zs(ye.props.children,he.mode,Ae,ye.key),Ae.return=he,he=Ae):(Ae=ju(ye.type,ye.key,ye.props,null,he.mode,Ae),Fu(Ae,ye),Ae.return=he,he=Ae)}return U(he);case S:e:{for(it=ye.key;ue!==null;){if(ue.key===it)if(ue.tag===4&&ue.stateNode.containerInfo===ye.containerInfo&&ue.stateNode.implementation===ye.implementation){h(he,ue.sibling),Ae=E(ue,ye.children||[]),Ae.return=he,he=Ae;break e}else{h(he,ue);break}else o(he,ue);ue=ue.sibling}Ae=Ya(ye,he.mode,Ae),Ae.return=he,he=Ae}return U(he);case Z:return ye=Fo(ye),An(he,ue,ye,Ae)}if(W(ye))return Xe(he,ue,ye,Ae);if(G(ye)){if(it=G(ye),typeof it!="function")throw Error(i(150));return ye=it.call(ye),ut(he,ue,ye,Ae)}if(typeof ye.then=="function")return An(he,ue,cf(ye),Ae);if(ye.$$typeof===R)return An(he,ue,Uu(he,ye),Ae);qu(he,ye)}return typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint"?(ye=""+ye,ue!==null&&ue.tag===6?(h(he,ue.sibling),Ae=E(ue,ye),Ae.return=he,he=Ae):(h(he,ue),Ae=tf(ye,he.mode,Ae),Ae.return=he,he=Ae),U(he)):h(he,ue)}return function(he,ue,ye,Ae){try{no=0;var it=An(he,ue,ye,Ae);return to=null,it}catch(We){if(We===eo||We===Ka)throw We;var fn=gr(29,We,null,he.mode);return fn.lanes=Ae,fn.return=he,fn}finally{}}}var qo=Uc(!0),Fg=Uc(!1),io=!1;function up(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dp(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 Cs(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function al(a,o,h){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(Bt&2)!==0){var E=y.pending;return E===null?o.next=o:(o.next=E.next,E.next=o),y.pending=o,o=zc(a),ef(a,null,h),o}return zu(a,y,o,h),zc(a)}function ro(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 uf(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 fp=!1;function Gu(){if(fp){var a=Xa;if(a!==null)throw a}}function Go(a,o,h,y){fp=!1;var E=a.updateQueue;io=!1;var M=E.firstBaseUpdate,U=E.lastBaseUpdate,ee=E.shared.pending;if(ee!==null){E.shared.pending=null;var ae=ee,xe=ae.next;ae.next=null,U===null?M=xe:U.next=xe,U=ae;var we=a.alternate;we!==null&&(we=we.updateQueue,ee=we.lastBaseUpdate,ee!==U&&(ee===null?we.firstBaseUpdate=xe:ee.next=xe,we.lastBaseUpdate=ae))}if(M!==null){var Me=E.baseState;U=0,we=xe=ae=null,ee=M;do{var ve=ee.lane&-536870913,Se=ve!==ee.lane;if(Se?(Dt&ve)===ve:(y&ve)===ve){ve!==0&&ve===rl&&(fp=!0),we!==null&&(we=we.next={lane:0,tag:ee.tag,payload:ee.payload,callback:null,next:null});e:{var Xe=a,ut=ee;ve=o;var An=h;switch(ut.tag){case 1:if(Xe=ut.payload,typeof Xe=="function"){Me=Xe.call(An,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(An,Me,ve):Xe,ve==null)break e;Me=g({},Me,ve);break e;case 2:io=!0}}ve=ee.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:ee.tag,payload:ee.payload,callback:ee.callback,next:null},we===null?(xe=we=Se,ae=Me):we=we.next=Se,U|=ve;if(ee=ee.next,ee===null){if(ee=E.shared.pending,ee===null)break;Se=ee,ee=Se.next,Se.next=null,E.lastBaseUpdate=Se,E.shared.pending=null}}while(!0);we===null&&(ae=Me),E.baseState=ae,E.firstBaseUpdate=xe,E.lastBaseUpdate=we,M===null&&(E.shared.lanes=0),ca|=U,a.lanes=U,a.memoizedState=Me}}function As(a,o){if(typeof a!="function")throw Error(i(191,a));a.call(o)}function qi(a,o){var h=a.callbacks;if(h!==null)for(a.callbacks=null,a=0;a<h.length;a++)As(h[a],o)}var Jr=I(null),xr=I(0);function hp(a,o){a=si,q(xr,a),q(Jr,o),si=a|o.baseLanes}function pp(){q(xr,si),q(Jr,Jr.current)}function nr(){si=xr.current,J(Jr),J(xr)}var Ti=I(null),Ta=null;function ao(a){var o=a.alternate;q(Yn,Yn.current&1),q(Ti,a),Ta===null&&(o===null||Jr.current!==null||o.memoizedState!==null)&&(Ta=a)}function mp(a){q(Yn,Yn.current),q(Ti,a),Ta===null&&(Ta=a)}function qg(a){a.tag===22?(q(Yn,Yn.current),q(Ti,a),Ta===null&&(Ta=a)):sl()}function sl(){q(Yn,Yn.current),q(Ti,Ti.current)}function ea(a){J(Ti),Ta===a&&(Ta=null),J(Yn)}var Yn=I(0);function df(a){for(var o=a;o!==null;){if(o.tag===13){var h=o.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||nb(h)||ib(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 kr=0,dt=null,xn=null,pi=null,ff=!1,Ms=!1,Yo=!1,hf=0,Yu=0,Rs=null,zx=0;function Vn(){throw Error(i(321))}function gp(a,o){if(o===null)return!1;for(var h=0;h<o.length&&h<a.length;h++)if(!Dn(a[h],o[h]))return!1;return!0}function yp(a,o,h,y,E,M){return kr=M,dt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,O.H=a===null||a.memoizedState===null?cy:Fc,Yo=!1,M=h(y,E),Yo=!1,Ms&&(M=Yg(o,h,y,E)),Gg(a),M}function Gg(a){O.H=$u;var o=xn!==null&&xn.next!==null;if(kr=0,pi=xn=dt=null,ff=!1,Yu=0,Rs=null,o)throw Error(i(300));a===null||zn||(a=a.dependencies,a!==null&&Lc(a)&&(zn=!0))}function Yg(a,o,h,y){dt=a;var E=0;do{if(Ms&&(Rs=null),Yu=0,Ms=!1,25<=E)throw Error(i(301));if(E+=1,pi=xn=null,a.updateQueue!=null){var M=a.updateQueue;M.lastEffect=null,M.events=null,M.stores=null,M.memoCache!=null&&(M.memoCache.index=0)}O.H=Qu,M=o(h,y)}while(Ms);return M}function jx(){var a=O.H,o=a.useState()[0];return o=typeof o.then=="function"?Xu(o):o,a=a.useState()[0],(xn!==null?xn.memoizedState:null)!==a&&(dt.flags|=1024),o}function xp(){var a=hf!==0;return hf=0,a}function bp(a,o,h){o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~h}function vp(a){if(ff){for(a=a.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}ff=!1}kr=0,pi=xn=dt=null,Ms=!1,Yu=hf=0,Rs=null}function br(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pi===null?dt.memoizedState=pi=a:pi=pi.next=a,pi}function ni(){if(xn===null){var a=dt.alternate;a=a!==null?a.memoizedState:null}else a=xn.next;var o=pi===null?dt.memoizedState:pi.next;if(o!==null)pi=o,xn=a;else{if(a===null)throw dt.alternate===null?Error(i(467)):Error(i(310));xn=a,a={memoizedState:xn.memoizedState,baseState:xn.baseState,baseQueue:xn.baseQueue,queue:xn.queue,next:null},pi===null?dt.memoizedState=pi=a:pi=pi.next=a}return pi}function Vu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xu(a){var o=Yu;return Yu+=1,Rs===null&&(Rs=[]),a=op(Rs,a,o),o=dt,(pi===null?o.memoizedState:pi.next)===null&&(o=o.alternate,O.H=o===null||o.memoizedState===null?cy:Fc),a}function pf(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Xu(a);if(a.$$typeof===R)return ji(a)}throw Error(i(438,String(a)))}function _p(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=Vu(),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]=V;return o.index++,h}function ll(a,o){return typeof o=="function"?o(a):o}function mf(a){var o=ni();return Sp(o,xn,a)}function Sp(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 ee=U=null,ae=null,xe=o,we=!1;do{var Me=xe.lane&-536870913;if(Me!==xe.lane?(Dt&Me)===Me:(kr&Me)===Me){var ve=xe.revertLane;if(ve===0)ae!==null&&(ae=ae.next={lane:0,revertLane:0,gesture:null,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null}),Me===rl&&(we=!0);else if((kr&ve)===ve){xe=xe.next,ve===rl&&(we=!0);continue}else Me={lane:0,revertLane:xe.revertLane,gesture:null,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null},ae===null?(ee=ae=Me,U=M):ae=ae.next=Me,dt.lanes|=ve,ca|=ve;Me=xe.action,Yo&&h(M,Me),M=xe.hasEagerState?xe.eagerState:h(M,Me)}else ve={lane:Me,revertLane:xe.revertLane,gesture:xe.gesture,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null},ae===null?(ee=ae=ve,U=M):ae=ae.next=ve,dt.lanes|=Me,ca|=Me;xe=xe.next}while(xe!==null&&xe!==o);if(ae===null?U=M:ae.next=ee,!Dn(M,a.memoizedState)&&(zn=!0,we&&(h=Xa,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 gf(a){var o=ni(),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);Dn(M,o.memoizedState)||(zn=!0),o.memoizedState=M,o.baseQueue===null&&(o.baseState=M),h.lastRenderedState=M}return[M,y]}function Ep(a,o,h){var y=dt,E=ni(),M=zt;if(M){if(h===void 0)throw Error(i(407));h=h()}else h=o();var U=!Dn((xn||E).memoizedState,h);if(U&&(E.memoizedState=h,zn=!0),E=E.queue,Mp(Tp.bind(null,y,E,a),[a]),E.getSnapshot!==o||U||pi!==null&&pi.memoizedState.tag&1){if(y.flags|=2048,Hc(9,{destroy:void 0},wp.bind(null,y,E,h,o),null),un===null)throw Error(i(349));M||(kr&127)!==0||Vg(y,o,h)}return h}function Vg(a,o,h){a.flags|=16384,a={getSnapshot:o,value:h},o=dt.updateQueue,o===null?(o=Vu(),dt.updateQueue=o,o.stores=[a]):(h=o.stores,h===null?o.stores=[a]:h.push(a))}function wp(a,o,h,y){o.value=h,o.getSnapshot=y,Cp(o)&&yf(a)}function Tp(a,o,h){return h(function(){Cp(o)&&yf(a)})}function Cp(a){var o=a.getSnapshot;a=a.value;try{var h=o();return!Dn(a,h)}catch{return!0}}function yf(a){var o=Wl(a,2);o!==null&&d(o,a,2)}function Ku(a){var o=br();if(typeof a=="function"){var h=a;if(a=h(),Yo){Gn(!0);try{h()}finally{Gn(!1)}}}return o.memoizedState=o.baseState=a,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ll,lastRenderedState:a},o}function Xg(a,o,h,y){return a.baseState=h,Sp(a,xn,typeof y=="function"?y:ll)}function Lx(a,o,h,y,E){if(ol(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)}};O.T!==null?h(!0):M.isTransition=!1,y(M),h=o.pending,h===null?(M.next=o.pending=M,Kg(o,M)):(M.next=h.next,o.pending=h.next=M)}}function Kg(a,o){var h=o.action,y=o.payload,E=a.state;if(o.isTransition){var M=O.T,U={};O.T=U;try{var ee=h(E,y),ae=O.S;ae!==null&&ae(U,ee),Wg(a,o,ee)}catch(xe){xf(a,o,xe)}finally{M!==null&&U.types!==null&&(M.types=U.types),O.T=M}}else try{M=h(E,y),Wg(a,o,M)}catch(xe){xf(a,o,xe)}}function Wg(a,o,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(y){Ap(a,o,y)},function(y){return xf(a,o,y)}):Ap(a,o,h)}function Ap(a,o,h){o.status="fulfilled",o.value=h,$g(o),a.state=h,o=a.pending,o!==null&&(h=o.next,h===o?a.pending=null:(h=h.next,o.next=h,Kg(a,h)))}function xf(a,o,h){var y=a.pending;if(a.pending=null,y!==null){y=y.next;do o.status="rejected",o.reason=h,$g(o),o=o.next;while(o!==y)}a.action=null}function $g(a){a=a.listeners;for(var o=0;o<a.length;o++)(0,a[o])()}function Qg(a,o){return o}function Zg(a,o){if(zt){var h=un.formState;if(h!==null){e:{var y=dt;if(zt){if(wn){t:{for(var E=wn,M=zi;E.nodeType!==8;){if(!M){E=null;break t}if(E=js(E.nextSibling),E===null){E=null;break t}}M=E.data,E=M==="F!"||M==="F"?E:null}if(E){wn=js(E.nextSibling),y=E.data==="F!";break e}}Ot(y)}y=!1}y&&(o=h[0])}}return h=br(),h.memoizedState=h.baseState=o,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qg,lastRenderedState:o},h.queue=y,h=oy.bind(null,dt,y),y.dispatch=h,y=Ku(!1),M=Wu.bind(null,dt,!1,y.queue),y=br(),E={state:o,dispatch:null,action:a,pending:null},y.queue=E,h=Lx.bind(null,dt,E,M,h),E.dispatch=h,y.memoizedState=a,[o,h,!1]}function Jg(a){var o=ni();return ey(o,xn,a)}function ey(a,o,h){if(o=Sp(a,o,Qg)[0],a=mf(ll)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var y=Xu(o)}catch(U){throw U===eo?Ka:U}else y=o;o=ni();var E=o.queue,M=E.dispatch;return h!==o.memoizedState&&(dt.flags|=2048,Hc(9,{destroy:void 0},Bx.bind(null,E,h),null)),[y,M,a]}function Bx(a,o){a.action=o}function ty(a){var o=ni(),h=xn;if(h!==null)return ey(o,h,a);ni(),o=o.memoizedState,h=ni();var y=h.queue.dispatch;return h.memoizedState=a,[o,y,!1]}function Hc(a,o,h,y){return a={tag:a,create:h,deps:y,inst:o,next:null},o=dt.updateQueue,o===null&&(o=Vu(),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 ny(){return ni().memoizedState}function bf(a,o,h,y){var E=br();dt.flags|=a,E.memoizedState=Hc(1|o,{destroy:void 0},h,y===void 0?null:y)}function vf(a,o,h,y){var E=ni();y=y===void 0?null:y;var M=E.memoizedState.inst;xn!==null&&y!==null&&gp(y,xn.memoizedState.deps)?E.memoizedState=Hc(o,M,h,y):(dt.flags|=a,E.memoizedState=Hc(1|o,M,h,y))}function iy(a,o){bf(8390656,8,a,o)}function Mp(a,o){vf(2048,8,a,o)}function ry(a){dt.flags|=4;var o=dt.updateQueue;if(o===null)o=Vu(),dt.updateQueue=o,o.events=[a];else{var h=o.events;h===null?o.events=[a]:h.push(a)}}function ay(a){var o=ni().memoizedState;return ry({ref:o,nextImpl:a}),function(){if((Bt&2)!==0)throw Error(i(440));return o.impl.apply(void 0,arguments)}}function sy(a,o){return vf(4,2,a,o)}function ta(a,o){return vf(4,4,a,o)}function Rp(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 _f(a,o,h){h=h!=null?h.concat([a]):null,vf(4,4,Rp.bind(null,o,a),h)}function Sf(){}function kp(a,o){var h=ni();o=o===void 0?null:o;var y=h.memoizedState;return o!==null&&gp(o,y[1])?y[0]:(h.memoizedState=[a,o],a)}function Np(a,o){var h=ni();o=o===void 0?null:o;var y=h.memoizedState;if(o!==null&&gp(o,y[1]))return y[0];if(y=a(),Yo){Gn(!0);try{a()}finally{Gn(!1)}}return h.memoizedState=[y,o],y}function Op(a,o,h){return h===void 0||(kr&1073741824)!==0&&(Dt&261930)===0?a.memoizedState=o:(a.memoizedState=h,a=u(),dt.lanes|=a,ca|=a,h)}function Dp(a,o,h,y){return Dn(h,o)?h:Jr.current!==null?(a=Op(a,h,y),Dn(a,o)||(zn=!0),a):(kr&42)===0||(kr&1073741824)!==0&&(Dt&261930)===0?(zn=!0,a.memoizedState=h):(a=u(),dt.lanes|=a,ca|=a,o)}function zp(a,o,h,y,E){var M=Y.p;Y.p=M!==0&&8>M?M:8;var U=O.T,ee={};O.T=ee,Wu(a,!1,o,h);try{var ae=E(),xe=O.S;if(xe!==null&&xe(ee,ae),ae!==null&&typeof ae=="object"&&typeof ae.then=="function"){var we=lp(ae,y);Pc(a,o,we,_r(a))}else Pc(a,o,y,_r(a))}catch(Me){Pc(a,o,{then:function(){},status:"rejected",reason:Me},_r())}finally{Y.p=M,U!==null&&ee.types!==null&&(U.types=ee.types),O.T=U}}function Ix(){}function jp(a,o,h,y){if(a.tag!==5)throw Error(i(476));var E=ly(a).queue;zp(a,E,o,$,h===null?Ix:function(){return Lp(a),h(y)})}function ly(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ll,lastRenderedState:$},next:null};var h={};return o.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ll,lastRenderedState:h},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function Lp(a){var o=ly(a);o.next===null&&(o=a.alternate.memoizedState),Pc(a,o.next.queue,{},_r())}function Bp(){return ji($p)}function Gi(){return ni().memoizedState}function Ip(){return ni().memoizedState}function Ux(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var h=_r();a=Cs(h);var y=al(o,a,h);y!==null&&(d(y,o,h),ro(y,o,h)),o={cache:rp()},a.payload=o;return}o=o.return}}function Hx(a,o,h){var y=_r();h={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},ol(a)?Vo(o,h):(h=Dc(a,o,h,y),h!==null&&(d(h,a,y),Nr(h,o,y)))}function oy(a,o,h){var y=_r();Pc(a,o,h,y)}function Pc(a,o,h,y){var E={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(ol(a))Vo(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,ee=M(U,h);if(E.hasEagerState=!0,E.eagerState=ee,Dn(ee,U))return zu(a,o,E,0),un===null&&Kl(),!1}catch{}finally{}if(h=Dc(a,o,E,y),h!==null)return d(h,a,y),Nr(h,o,y),!0}return!1}function Wu(a,o,h,y){if(y={lane:2,revertLane:Gx(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},ol(a)){if(o)throw Error(i(479))}else o=Dc(a,h,y,2),o!==null&&d(o,a,2)}function ol(a){var o=a.alternate;return a===dt||o!==null&&o===dt}function Vo(a,o){Ms=ff=!0;var h=a.pending;h===null?o.next=o:(o.next=h.next,h.next=o),a.pending=o}function Nr(a,o,h){if((h&4194048)!==0){var y=o.lanes;y&=a.pendingLanes,h|=y,o.lanes=h,nt(a,h)}}var $u={readContext:ji,use:pf,useCallback:Vn,useContext:Vn,useEffect:Vn,useImperativeHandle:Vn,useLayoutEffect:Vn,useInsertionEffect:Vn,useMemo:Vn,useReducer:Vn,useRef:Vn,useState:Vn,useDebugValue:Vn,useDeferredValue:Vn,useTransition:Vn,useSyncExternalStore:Vn,useId:Vn,useHostTransitionStatus:Vn,useFormState:Vn,useActionState:Vn,useOptimistic:Vn,useMemoCache:Vn,useCacheRefresh:Vn};$u.useEffectEvent=Vn;var cy={readContext:ji,use:pf,useCallback:function(a,o){return br().memoizedState=[a,o===void 0?null:o],a},useContext:ji,useEffect:iy,useImperativeHandle:function(a,o,h){h=h!=null?h.concat([a]):null,bf(4194308,4,Rp.bind(null,o,a),h)},useLayoutEffect:function(a,o){return bf(4194308,4,a,o)},useInsertionEffect:function(a,o){bf(4,2,a,o)},useMemo:function(a,o){var h=br();o=o===void 0?null:o;var y=a();if(Yo){Gn(!0);try{a()}finally{Gn(!1)}}return h.memoizedState=[y,o],y},useReducer:function(a,o,h){var y=br();if(h!==void 0){var E=h(o);if(Yo){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=Hx.bind(null,dt,a),[y.memoizedState,a]},useRef:function(a){var o=br();return a={current:a},o.memoizedState=a},useState:function(a){a=Ku(a);var o=a.queue,h=oy.bind(null,dt,o);return o.dispatch=h,[a.memoizedState,h]},useDebugValue:Sf,useDeferredValue:function(a,o){var h=br();return Op(h,a,o)},useTransition:function(){var a=Ku(!1);return a=zp.bind(null,dt,a.queue,!0,!1),br().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,h){var y=dt,E=br();if(zt){if(h===void 0)throw Error(i(407));h=h()}else{if(h=o(),un===null)throw Error(i(349));(Dt&127)!==0||Vg(y,o,h)}E.memoizedState=h;var M={value:h,getSnapshot:o};return E.queue=M,iy(Tp.bind(null,y,M,a),[a]),y.flags|=2048,Hc(9,{destroy:void 0},wp.bind(null,y,M,h,o),null),h},useId:function(){var a=br(),o=un.identifierPrefix;if(zt){var h=ws,y=Es;h=(y&~(1<<32-Ft(y)-1)).toString(32)+h,o="_"+o+"R_"+h,h=hf++,0<h&&(o+="H"+h.toString(32)),o+="_"}else h=zx++,o="_"+o+"r_"+h.toString(32)+"_";return a.memoizedState=o},useHostTransitionStatus:Bp,useFormState:Zg,useActionState:Zg,useOptimistic:function(a){var o=br();o.memoizedState=o.baseState=a;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=h,o=Wu.bind(null,dt,!0,h),h.dispatch=o,[a,o]},useMemoCache:_p,useCacheRefresh:function(){return br().memoizedState=Ux.bind(null,dt)},useEffectEvent:function(a){var o=br(),h={impl:a};return o.memoizedState=h,function(){if((Bt&2)!==0)throw Error(i(440));return h.impl.apply(void 0,arguments)}}},Fc={readContext:ji,use:pf,useCallback:kp,useContext:ji,useEffect:Mp,useImperativeHandle:_f,useInsertionEffect:sy,useLayoutEffect:ta,useMemo:Np,useReducer:mf,useRef:ny,useState:function(){return mf(ll)},useDebugValue:Sf,useDeferredValue:function(a,o){var h=ni();return Dp(h,xn.memoizedState,a,o)},useTransition:function(){var a=mf(ll)[0],o=ni().memoizedState;return[typeof a=="boolean"?a:Xu(a),o]},useSyncExternalStore:Ep,useId:Gi,useHostTransitionStatus:Bp,useFormState:Jg,useActionState:Jg,useOptimistic:function(a,o){var h=ni();return Xg(h,xn,a,o)},useMemoCache:_p,useCacheRefresh:Ip};Fc.useEffectEvent=ay;var Qu={readContext:ji,use:pf,useCallback:kp,useContext:ji,useEffect:Mp,useImperativeHandle:_f,useInsertionEffect:sy,useLayoutEffect:ta,useMemo:Np,useReducer:gf,useRef:ny,useState:function(){return gf(ll)},useDebugValue:Sf,useDeferredValue:function(a,o){var h=ni();return xn===null?Op(h,a,o):Dp(h,xn.memoizedState,a,o)},useTransition:function(){var a=gf(ll)[0],o=ni().memoizedState;return[typeof a=="boolean"?a:Xu(a),o]},useSyncExternalStore:Ep,useId:Gi,useHostTransitionStatus:Bp,useFormState:ty,useActionState:ty,useOptimistic:function(a,o){var h=ni();return xn!==null?Xg(h,xn,a,o):(h.baseState=a,[a,h.queue.dispatch])},useMemoCache:_p,useCacheRefresh:Ip};Qu.useEffectEvent=ay;function qc(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 Zu={enqueueSetState:function(a,o,h){a=a._reactInternals;var y=_r(),E=Cs(y);E.payload=o,h!=null&&(E.callback=h),o=al(a,E,y),o!==null&&(d(o,a,y),ro(o,a,y))},enqueueReplaceState:function(a,o,h){a=a._reactInternals;var y=_r(),E=Cs(y);E.tag=1,E.payload=o,h!=null&&(E.callback=h),o=al(a,E,y),o!==null&&(d(o,a,y),ro(o,a,y))},enqueueForceUpdate:function(a,o){a=a._reactInternals;var h=_r(),y=Cs(h);y.tag=2,o!=null&&(y.callback=o),o=al(a,y,h),o!==null&&(d(o,a,h),ro(o,a,h))}};function uy(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?!Ac(h,y)||!Ac(E,M):!0}function dy(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&&Zu.enqueueReplaceState(o,o.state,null)}function Yi(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 Up(a){Xl(a)}function fy(a){console.error(a)}function Ef(a){Xl(a)}function wf(a,o){try{var h=a.onUncaughtError;h(o.value,{componentStack:o.stack})}catch(y){setTimeout(function(){throw y})}}function hy(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 Hp(a,o,h){return h=Cs(h),h.tag=3,h.payload={element:null},h.callback=function(){wf(a,o)},h}function Gc(a){return a=Cs(a),a.tag=3,a}function Or(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(){hy(o,h,y)}}var U=h.stateNode;U!==null&&typeof U.componentDidCatch=="function"&&(a.callback=function(){hy(o,h,y),typeof E!="function"&&(zs===null?zs=new Set([this]):zs.add(this));var ee=y.stack;this.componentDidCatch(y.value,{componentStack:ee!==null?ee:""})})}function na(a,o,h,y,E){if(h.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(o=h.alternate,o!==null&&Zl(o,h,E,!0),h=Ti.current,h!==null){switch(h.tag){case 31:case 13:return Ta===null?mt():h.alternate===null&&dn===0&&(dn=3),h.flags&=-257,h.flags|=65536,h.lanes=E,y===Pu?h.flags|=16384:(o=h.updateQueue,o===null?h.updateQueue=new Set([y]):o.add(y),Px(a,y,E)),!1;case 22:return h.flags|=65536,y===Pu?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)),Px(a,y,E)),!1}throw Error(i(435,h.tag))}return Px(a,y,E),mt(),!1}if(zt)return o=Ti.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=E,y!==rf&&(a=Error(i(422),{cause:y}),Iu(Mr(a,h)))):(y!==rf&&(o=Error(i(423),{cause:y}),Iu(Mr(o,h))),a=a.current.alternate,a.flags|=65536,E&=-E,a.lanes|=E,y=Mr(y,h),E=Hp(a.stateNode,y,E),uf(a,E),dn!==4&&(dn=2)),!1;var M=Error(i(520),{cause:y});if(M=Mr(M,h),Ja===null?Ja=[M]:Ja.push(M),dn!==4&&(dn=2),o===null)return!0;y=Mr(y,h),h=o;do{switch(h.tag){case 3:return h.flags|=65536,a=E&-E,h.lanes|=a,a=Hp(h.stateNode,y,a),uf(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"&&(zs===null||!zs.has(M))))return h.flags|=65536,E&=-E,h.lanes|=E,E=Gc(E),Or(E,a,h,y),uf(h,E),!1}h=h.return}while(h!==null);return!1}var Tf=Error(i(461)),zn=!1;function Xn(a,o,h,y){o.child=a===null?Fg(o,null,h,y):qo(o,a.child,h,y)}function Ju(a,o,h,y,E){h=h.render;var M=o.ref;if("ref"in y){var U={};for(var ee in y)ee!=="ref"&&(U[ee]=y[ee])}else U=y;return Ho(o),y=yp(a,o,h,U,M,E),ee=xp(),a!==null&&!zn?(bp(a,o,E),Qa(a,o,E)):(zt&&ee&&nf(o),o.flags|=1,Xn(a,o,y,E),o.child)}function ed(a,o,h,y,E){if(a===null){var M=h.type;return typeof M=="function"&&!yr(M)&&M.defaultProps===void 0&&h.compare===null?(o.tag=15,o.type=M,ia(a,o,M,y,E)):(a=ju(h.type,null,y,o,o.mode,E),a.ref=o.ref,a.return=o,o.child=a)}if(M=a.child,!lo(a,E)){var U=M.memoizedProps;if(h=h.compare,h=h!==null?h:Ac,h(U,y)&&a.ref===o.ref)return Qa(a,o,E)}return o.flags|=1,a=_s(M,y),a.ref=o.ref,a.return=o,o.child=a}function ia(a,o,h,y,E){if(a!==null){var M=a.memoizedProps;if(Ac(M,y)&&a.ref===o.ref)if(zn=!1,o.pendingProps=y=M,lo(a,E))(a.flags&131072)!==0&&(zn=!0);else return o.lanes=a.lanes,Qa(a,o,E)}return Yc(a,o,h,y,E)}function ra(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 ks(a,o,M,h,y)}if((h&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},a!==null&&Ic(o,M!==null?M.cachePool:null),M!==null?hp(o,M):pp(),qg(o);else return y=o.lanes=536870912,ks(a,o,M!==null?M.baseLanes|h:h,h,y)}else M!==null?(Ic(o,M.cachePool),hp(o,M),sl(),o.memoizedState=null):(a!==null&&Ic(o,null),pp(),sl());return Xn(a,o,E,h),o.child}function Wa(a,o){return a!==null&&a.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function ks(a,o,h,y,E){var M=Ts();return M=M===null?null:{parent:Je._currentValue,pool:M},o.memoizedState={baseLanes:h,cachePool:M},a!==null&&Ic(o,null),pp(),qg(o),a!==null&&Zl(a,o,y,!0),o.childLanes=E,null}function Ca(a,o){return o=Vc({mode:o.mode,children:o.children},a.mode),o.ref=a.ref,a.child=o,o.return=a,o}function Li(a,o,h){return qo(o,a.child,null,h),a=Ca(o,o.pendingProps),a.flags|=2,ea(o),o.memoizedState=null,a}function td(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=Ca(o,y),o.lanes=536870912,Wa(null,a);if(mp(o),(a=wn)?(a=kS(a,zi),a=a!==null&&a.data==="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:Ss!==null?{id:Es,overflow:ws}:null,retryLane:536870912,hydrationErrors:null},h=Lg(a),h.return=o,o.child=h,Di=o,wn=null)):a=null,a===null)throw Ot(o);return o.lanes=536870912,null}return Ca(o,y)}var M=a.memoizedState;if(M!==null){var U=M.dehydrated;if(mp(o),E)if(o.flags&256)o.flags&=-257,o=Li(a,o,h);else if(o.memoizedState!==null)o.child=a.child,o.flags|=128,o=null;else throw Error(i(558));else if(zn||Zl(a,o,h,!1),E=(h&a.childLanes)!==0,zn||E){if(y=un,y!==null&&(U=kn(y,h),U!==0&&U!==M.retryLane))throw M.retryLane=U,Wl(a,U),d(y,a,U),Tf;mt(),o=Li(a,o,h)}else a=M.treeContext,wn=js(U.nextSibling),Di=o,zt=!0,el=null,zi=!1,a!==null&&Bu(o,a),o=Ca(o,y),o.flags|=4096;return o}return a=_s(a.child,{mode:y.mode,children:y.children}),a.ref=o.ref,o.child=a,a.return=o,a}function $a(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 Yc(a,o,h,y,E){return Ho(o),h=yp(a,o,h,y,void 0,E),y=xp(),a!==null&&!zn?(bp(a,o,E),Qa(a,o,E)):(zt&&y&&nf(o),o.flags|=1,Xn(a,o,h,E),o.child)}function ir(a,o,h,y,E,M){return Ho(o),o.updateQueue=null,h=Yg(o,y,h,E),Gg(a),y=xp(),a!==null&&!zn?(bp(a,o,M),Qa(a,o,M)):(zt&&y&&nf(o),o.flags|=1,Xn(a,o,h,M),o.child)}function Vi(a,o,h,y,E){if(Ho(o),o.stateNode===null){var M=$l,U=h.contextType;typeof U=="object"&&U!==null&&(M=ji(U)),M=new h(y,M),o.memoizedState=M.state!==null&&M.state!==void 0?M.state:null,M.updater=Zu,o.stateNode=M,M._reactInternals=o,M=o.stateNode,M.props=y,M.state=o.memoizedState,M.refs={},up(o),U=h.contextType,M.context=typeof U=="object"&&U!==null?ji(U):$l,M.state=o.memoizedState,U=h.getDerivedStateFromProps,typeof U=="function"&&(qc(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&&Zu.enqueueReplaceState(M,M.state,null),Go(o,y,M,E),Gu(),M.state=o.memoizedState),typeof M.componentDidMount=="function"&&(o.flags|=4194308),y=!0}else if(a===null){M=o.stateNode;var ee=o.memoizedProps,ae=Yi(h,ee);M.props=ae;var xe=M.context,we=h.contextType;U=$l,typeof we=="object"&&we!==null&&(U=ji(we));var Me=h.getDerivedStateFromProps;we=typeof Me=="function"||typeof M.getSnapshotBeforeUpdate=="function",ee=o.pendingProps!==ee,we||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(ee||xe!==U)&&dy(o,M,y,U),io=!1;var ve=o.memoizedState;M.state=ve,Go(o,y,M,E),Gu(),xe=o.memoizedState,ee||ve!==xe||io?(typeof Me=="function"&&(qc(o,h,Me,y),xe=o.memoizedState),(ae=io||uy(o,h,ae,y,ve,xe,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=xe),M.props=y,M.state=xe,M.context=U,y=ae):(typeof M.componentDidMount=="function"&&(o.flags|=4194308),y=!1)}else{M=o.stateNode,dp(a,o),U=o.memoizedProps,we=Yi(h,U),M.props=we,Me=o.pendingProps,ve=M.context,xe=h.contextType,ae=$l,typeof xe=="object"&&xe!==null&&(ae=ji(xe)),ee=h.getDerivedStateFromProps,(xe=typeof ee=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(U!==Me||ve!==ae)&&dy(o,M,y,ae),io=!1,ve=o.memoizedState,M.state=ve,Go(o,y,M,E),Gu();var Se=o.memoizedState;U!==Me||ve!==Se||io||a!==null&&a.dependencies!==null&&Lc(a.dependencies)?(typeof ee=="function"&&(qc(o,h,ee,y),Se=o.memoizedState),(we=io||uy(o,h,we,y,ve,Se,ae)||a!==null&&a.dependencies!==null&&Lc(a.dependencies))?(xe||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,$a(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=qo(o,a.child,null,E),o.child=qo(o,null,h,E)):Xn(a,o,h,E),o.memoizedState=M.state,a=o.child):a=Qa(a,o,E),a}function Gt(a,o,h,y){return Uo(),o.flags|=256,Xn(a,o,h,y),o.child}var aa={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Aa(a){return{baseLanes:a,cachePool:lf()}}function nd(a,o,h){return a=a!==null?a.childLanes&~h:0,o&&(a|=It),a}function sa(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:(Yn.current&2)!==0),U&&(E=!0,o.flags&=-129),U=(o.flags&32)!==0,o.flags&=-33,a===null){if(zt){if(E?ao(o):sl(),(a=wn)?(a=kS(a,zi),a=a!==null&&a.data!=="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:Ss!==null?{id:Es,overflow:ws}:null,retryLane:536870912,hydrationErrors:null},h=Lg(a),h.return=o,o.child=h,Di=o,wn=null)):a=null,a===null)throw Ot(o);return ib(a)?o.lanes=32:o.lanes=536870912,null}var ee=y.children;return y=y.fallback,E?(sl(),E=o.mode,ee=Vc({mode:"hidden",children:ee},E),y=Zs(y,E,h,null),ee.return=o,y.return=o,ee.sibling=y,o.child=ee,y=o.child,y.memoizedState=Aa(h),y.childLanes=nd(a,U,h),o.memoizedState=aa,Wa(null,y)):(ao(o),so(o,ee))}var ae=a.memoizedState;if(ae!==null&&(ee=ae.dehydrated,ee!==null)){if(M)o.flags&256?(ao(o),o.flags&=-257,o=Xc(a,o,h)):o.memoizedState!==null?(sl(),o.child=a.child,o.flags|=128,o=null):(sl(),ee=y.fallback,E=o.mode,y=Vc({mode:"visible",children:y.children},E),ee=Zs(ee,E,h,null),ee.flags|=2,y.return=o,ee.return=o,y.sibling=ee,o.child=y,qo(o,a.child,null,h),y=o.child,y.memoizedState=Aa(h),y.childLanes=nd(a,U,h),o.memoizedState=aa,o=Wa(null,y));else if(ao(o),ib(ee)){if(U=ee.nextSibling&&ee.nextSibling.dataset,U)var xe=U.dgst;U=xe,y=Error(i(419)),y.stack="",y.digest=U,Iu({value:y,source:null,stack:null}),o=Xc(a,o,h)}else if(zn||Zl(a,o,h,!1),U=(h&a.childLanes)!==0,zn||U){if(U=un,U!==null&&(y=kn(U,h),y!==0&&y!==ae.retryLane))throw ae.retryLane=y,Wl(a,y),d(U,a,y),Tf;nb(ee)||mt(),o=Xc(a,o,h)}else nb(ee)?(o.flags|=192,o.child=a.child,o=null):(a=ae.treeContext,wn=js(ee.nextSibling),Di=o,zt=!0,el=null,zi=!1,a!==null&&Bu(o,a),o=so(o,y.children),o.flags|=4096);return o}return E?(sl(),ee=y.fallback,E=o.mode,ae=a.child,xe=ae.sibling,y=_s(ae,{mode:"hidden",children:y.children}),y.subtreeFlags=ae.subtreeFlags&65011712,xe!==null?ee=_s(xe,ee):(ee=Zs(ee,E,h,null),ee.flags|=2),ee.return=o,y.return=o,y.sibling=ee,o.child=y,Wa(null,y),y=o.child,ee=a.child.memoizedState,ee===null?ee=Aa(h):(E=ee.cachePool,E!==null?(ae=Je._currentValue,E=E.parent!==ae?{parent:ae,pool:ae}:E):E=lf(),ee={baseLanes:ee.baseLanes|h,cachePool:E}),y.memoizedState=ee,y.childLanes=nd(a,U,h),o.memoizedState=aa,Wa(a.child,y)):(ao(o),h=a.child,a=h.sibling,h=_s(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 so(a,o){return o=Vc({mode:"visible",children:o},a.mode),o.return=a,a.child=o}function Vc(a,o){return a=gr(22,a,null,o),a.lanes=0,a}function Xc(a,o,h){return qo(o,a.child,null,h),a=so(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function Xo(a,o,h){a.lanes|=o;var y=a.alternate;y!==null&&(y.lanes|=o),il(a.return,o,h)}function id(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 rd(a,o,h){var y=o.pendingProps,E=y.revealOrder,M=y.tail;y=y.children;var U=Yn.current,ee=(U&2)!==0;if(ee?(U=U&1|2,o.flags|=128):U&=1,q(Yn,U),Xn(a,o,y,h),y=zt?jc:0,!ee&&a!==null&&(a.flags&128)!==0)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Xo(a,h,o);else if(a.tag===19)Xo(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&&df(a)===null&&(E=h),h=h.sibling;h=E,h===null?(E=o.child,o.child=null):(E=h.sibling,h.sibling=null),id(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&&df(a)===null){o.child=E;break}a=E.sibling,E.sibling=h,h=E,E=a}id(o,!0,h,null,M,y);break;case"together":id(o,!1,null,null,void 0,y);break;default:o.memoizedState=null}return o.child}function Qa(a,o,h){if(a!==null&&(o.dependencies=a.dependencies),ca|=o.lanes,(h&o.childLanes)===0)if(a!==null){if(Zl(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=_s(a,a.pendingProps),o.child=h,h.return=o;a.sibling!==null;)a=a.sibling,h=h.sibling=_s(a,a.pendingProps),h.return=o;h.sibling=null}return o.child}function lo(a,o){return(a.lanes&o)!==0?!0:(a=a.dependencies,!!(a!==null&&Lc(a)))}function ad(a,o,h){switch(o.tag){case 3:ge(o,o.stateNode.containerInfo),nl(o,Je,a.memoizedState.cache),Uo();break;case 27:case 5:Re(o);break;case 4:ge(o,o.stateNode.containerInfo);break;case 10:nl(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,mp(o),null;break;case 13:var y=o.memoizedState;if(y!==null)return y.dehydrated!==null?(ao(o),o.flags|=128,null):(h&o.child.childLanes)!==0?sa(a,o,h):(ao(o),a=Qa(a,o,h),a!==null?a.sibling:null);ao(o);break;case 19:var E=(a.flags&128)!==0;if(y=(h&o.childLanes)!==0,y||(Zl(a,o,h,!1),y=(h&o.childLanes)!==0),E){if(y)return rd(a,o,h);o.flags|=128}if(E=o.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),q(Yn,Yn.current),y)break;return null;case 22:return o.lanes=0,ra(a,o,h,o.pendingProps);case 24:nl(o,Je,a.memoizedState.cache)}return Qa(a,o,h)}function Cf(a,o,h){if(a!==null)if(a.memoizedProps!==o.pendingProps)zn=!0;else{if(!lo(a,h)&&(o.flags&128)===0)return zn=!1,ad(a,o,h);zn=(a.flags&131072)!==0}else zn=!1,zt&&(o.flags&1048576)!==0&&Jh(o,jc,o.index);switch(o.lanes=0,o.tag){case 16:e:{var y=o.pendingProps;if(a=Fo(o.elementType),o.type=a,typeof a=="function")yr(a)?(y=Yi(a,y),o.tag=1,o=Vi(null,o,a,y,h)):(o.tag=0,o=Yc(null,o,a,y,h));else{if(a!=null){var E=a.$$typeof;if(E===z){o.tag=11,o=Ju(null,o,a,y,h);break e}else if(E===F){o.tag=14,o=ed(null,o,a,y,h);break e}}throw o=X(a)||a,Error(i(306,o,""))}}return o;case 0:return Yc(a,o,o.type,o.pendingProps,h);case 1:return y=o.type,E=Yi(y,o.pendingProps),Vi(a,o,y,E,h);case 3:e:{if(ge(o,o.stateNode.containerInfo),a===null)throw Error(i(387));y=o.pendingProps;var M=o.memoizedState;E=M.element,dp(a,o),Go(o,y,null,h);var U=o.memoizedState;if(y=U.cache,nl(o,Je,y),y!==M.cache&&sf(o,[Je],h,!0),Gu(),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=Mr(Error(i(424)),o),Iu(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(wn=js(a.firstChild),Di=o,zt=!0,el=null,zi=!0,h=Fg(o,null,y,h),o.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(Uo(),y===E){o=Qa(a,o,h);break e}Xn(a,o,y,h)}o=o.child}return o;case 26:return $a(a,o),a===null?(h=LS(o.type,null,o.pendingProps,null))?o.memoizedState=h:zt||(h=o.type,a=o.pendingProps,y=_y(de.current).createElement(h),y[bt]=o,y[fi]=a,Sr(y,h,a),In(y),o.stateNode=y):o.memoizedState=LS(o.type,a.memoizedProps,o.pendingProps,a.memoizedState),null;case 27:return Re(o),a===null&&zt&&(y=o.stateNode=DS(o.type,o.pendingProps,de.current),Di=o,zi=!0,E=wn,eu(o.type)?(rb=E,wn=js(y.firstChild)):wn=E),Xn(a,o,o.pendingProps.children,h),$a(a,o),a===null&&(o.flags|=4194304),o.child;case 5:return a===null&&zt&&((E=y=wn)&&(y=TO(y,o.type,o.pendingProps,zi),y!==null?(o.stateNode=y,Di=o,wn=js(y.firstChild),zi=!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,Jx(E,M)?y=null:U!==null&&Jx(E,U)&&(o.flags|=32),o.memoizedState!==null&&(E=yp(a,o,jx,null,null,h),$p._currentValue=E),$a(a,o),Xn(a,o,y,h),o.child;case 6:return a===null&&zt&&((a=h=wn)&&(h=CO(h,o.pendingProps,zi),h!==null?(o.stateNode=h,Di=o,wn=null,a=!0):a=!1),a||Ot(o)),null;case 13:return sa(a,o,h);case 4:return ge(o,o.stateNode.containerInfo),y=o.pendingProps,a===null?o.child=qo(o,null,y,h):Xn(a,o,y,h),o.child;case 11:return Ju(a,o,o.type,o.pendingProps,h);case 7:return Xn(a,o,o.pendingProps,h),o.child;case 8:return Xn(a,o,o.pendingProps.children,h),o.child;case 12:return Xn(a,o,o.pendingProps.children,h),o.child;case 10:return y=o.pendingProps,nl(o,o.type,y.value),Xn(a,o,y.children,h),o.child;case 9:return E=o.type._context,y=o.pendingProps.children,Ho(o),E=ji(E),y=y(E),o.flags|=1,Xn(a,o,y,h),o.child;case 14:return ed(a,o,o.type,o.pendingProps,h);case 15:return ia(a,o,o.type,o.pendingProps,h);case 19:return rd(a,o,h);case 31:return td(a,o,h);case 22:return ra(a,o,h,o.pendingProps);case 24:return Ho(o),y=ji(Je),a===null?(E=Ts(),E===null&&(E=un,M=rp(),E.pooledCache=M,M.refCount++,M!==null&&(E.pooledCacheLanes|=h),E=M),o.memoizedState={parent:y,cache:E},up(o),nl(o,Je,E)):((a.lanes&h)!==0&&(dp(a,o),Go(o,null,null,h),Gu()),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),nl(o,Je,y)):(y=M.cache,nl(o,Je,y),y!==E.cache&&sf(o,[Je],h,!0))),Xn(a,o,o.pendingProps.children,h),o.child;case 29:throw o.pendingProps}throw Error(i(156,o.tag))}function Dr(a){a.flags|=4}function oo(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=Pu,Hu}else a.flags&=-16777217}function cl(a,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!PS(o))if(De())a.flags|=8192;else throw at=Pu,Hu}function Kc(a,o){o!==null&&(a.flags|=4),a.flags&16384&&(o=a.tag!==22?tt():536870912,a.lanes|=o,ua|=o)}function sd(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 gn(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 Pp(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 gn(o),null;case 1:return gn(o),null;case 3:return h=o.stateNode,y=null,a!==null&&(y=a.memoizedState.cache),o.memoizedState.cache!==y&&(o.flags|=2048),wa(Je),le(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(a===null||a.child===null)&&(Io(o)?Dr(o):a===null||a.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,ep())),gn(o),null;case 26:var E=o.type,M=o.memoizedState;return a===null?(Dr(o),M!==null?(gn(o),cl(o,M)):(gn(o),oo(o,E,null,y,h))):M?M!==a.memoizedState?(Dr(o),gn(o),cl(o,M)):(gn(o),o.flags&=-16777217):(a=a.memoizedProps,a!==y&&Dr(o),gn(o),oo(o,E,a,y,h)),null;case 27:if(Le(o),h=de.current,E=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==y&&Dr(o);else{if(!y){if(o.stateNode===null)throw Error(i(166));return gn(o),null}a=oe.current,Io(o)?af(o):(a=DS(E,y,h),o.stateNode=a,Dr(o))}return gn(o),null;case 5:if(Le(o),E=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==y&&Dr(o);else{if(!y){if(o.stateNode===null)throw Error(i(166));return gn(o),null}if(M=oe.current,Io(o))af(o);else{var U=_y(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[fi]=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(Sr(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&&Dr(o)}}return gn(o),oo(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,h),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==y&&Dr(o);else{if(typeof y!="string"&&o.stateNode===null)throw Error(i(166));if(a=de.current,Io(o)){if(a=o.stateNode,h=o.memoizedProps,y=null,E=Di,E!==null)switch(E.tag){case 27:case 5:y=E.memoizedProps}a[bt]=o,a=!!(a.nodeValue===h||y!==null&&y.suppressHydrationWarning===!0||SS(a.nodeValue,h)),a||Ot(o,!0)}else a=_y(a).createTextNode(y),a[bt]=o,o.stateNode=a}return gn(o),null;case 31:if(h=o.memoizedState,a===null||a.memoizedState!==null){if(y=Io(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 Uo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;gn(o),a=!1}else h=ep(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=h),a=!0;if(!a)return o.flags&256?(ea(o),o):(ea(o),null);if((o.flags&128)!==0)throw Error(i(558))}return gn(o),null;case 13:if(y=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(E=Io(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 Uo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;gn(o),E=!1}else E=ep(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=E),E=!0;if(!E)return o.flags&256?(ea(o),o):(ea(o),null)}return ea(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),Kc(o,o.updateQueue),gn(o),null);case 4:return le(),a===null&&Kx(o.stateNode.containerInfo),gn(o),null;case 10:return wa(o.type),gn(o),null;case 19:if(J(Yn),y=o.memoizedState,y===null)return gn(o),null;if(E=(o.flags&128)!==0,M=y.rendering,M===null)if(E)sd(y,!1);else{if(dn!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(M=df(a),M!==null){for(o.flags|=128,sd(y,!1),a=M.updateQueue,o.updateQueue=a,Kc(o,a),o.subtreeFlags=0,a=h,h=o.child;h!==null;)er(h,a),h=h.sibling;return q(Yn,Yn.current&1|2),zt&&Js(o,y.treeForkCount),o.child}a=a.sibling}y.tail!==null&&Qt()>da&&(o.flags|=128,E=!0,sd(y,!1),o.lanes=4194304)}else{if(!E)if(a=df(M),a!==null){if(o.flags|=128,E=!0,a=a.updateQueue,o.updateQueue=a,Kc(o,a),sd(y,!0),y.tail===null&&y.tailMode==="hidden"&&!M.alternate&&!zt)return gn(o),null}else 2*Qt()-y.renderingStartTime>da&&h!==536870912&&(o.flags|=128,E=!0,sd(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=Qt(),a.sibling=null,h=Yn.current,q(Yn,E?h&1|2:h&1),zt&&Js(o,y.treeForkCount),a):(gn(o),null);case 22:case 23:return ea(o),nr(),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&&(gn(o),o.subtreeFlags&6&&(o.flags|=8192)):gn(o),h=o.updateQueue,h!==null&&Kc(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&&J(Jl),null;case 24:return h=null,a!==null&&(h=a.memoizedState.cache),o.memoizedState.cache!==h&&(o.flags|=2048),wa(Je),gn(o),null;case 25:return null;case 30:return null}throw Error(i(156,o.tag))}function Af(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 wa(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 Le(o),null;case 31:if(o.memoizedState!==null){if(ea(o),o.alternate===null)throw Error(i(340));Uo()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(ea(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(i(340));Uo()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return J(Yn),null;case 4:return le(),null;case 10:return wa(o.type),null;case 22:case 23:return ea(o),nr(),a!==null&&J(Jl),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return wa(Je),null;case 25:return null;default:return null}}function Ko(a,o){switch(Ql(o),o.tag){case 3:wa(Je),le();break;case 26:case 27:case 5:Le(o);break;case 4:le();break;case 31:o.memoizedState!==null&&ea(o);break;case 13:ea(o);break;case 19:J(Yn);break;case 10:wa(o.type);break;case 22:case 23:ea(o),nr(),a!==null&&J(Jl);break;case 24:wa(Je)}}function Ns(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(ee){_n(o,o.return,ee)}}function Ma(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,ee=U.destroy;if(ee!==void 0){U.destroy=void 0,E=o;var ae=h,xe=ee;try{xe()}catch(we){_n(E,ae,we)}}}y=y.next}while(y!==M)}}catch(we){_n(o,o.return,we)}}function co(a){var o=a.updateQueue;if(o!==null){var h=a.stateNode;try{qi(o,h)}catch(y){_n(a,a.return,y)}}}function Fp(a,o,h){h.props=Yi(a.type,a.memoizedProps),h.state=a.memoizedState;try{h.componentWillUnmount()}catch(y){_n(a,o,y)}}function Os(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){_n(a,o,E)}}function la(a,o){var h=a.ref,y=a.refCleanup;if(h!==null)if(typeof y=="function")try{y()}catch(E){_n(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){_n(a,o,E)}else h.current=null}function oa(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){_n(a,a.return,E)}}function Ra(a,o,h){try{var y=a.stateNode;bO(y,a.type,h,o),y[fi]=o}catch(E){_n(a,a.return,E)}}function mi(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&eu(a.type)||a.tag===4}function Ds(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||mi(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&&eu(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=je));else if(y!==4&&(y===27&&eu(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 en(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&&eu(a.type)&&(h=a.stateNode),a=a.child,a!==null))for(en(a,o,h),a=a.sibling;a!==null;)en(a,o,h),a=a.sibling}function ii(a){var o=a.stateNode,h=a.memoizedProps;try{for(var y=a.type,E=o.attributes;E.length;)o.removeAttributeNode(E[0]);Sr(o,y,h),o[bt]=a,o[fi]=h}catch(M){_n(a,a.return,M)}}var ka=!1,jn=!1,ul=!1,ld=typeof WeakSet=="function"?WeakSet:Set,Kn=null;function Wc(a,o){if(a=a.containerInfo,Qx=My,a=Kd(a),Mc(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,ee=-1,ae=-1,xe=0,we=0,Me=a,ve=null;t:for(;;){for(var Se;Me!==h||E!==0&&Me.nodeType!==3||(ee=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&&++xe===E&&(ee=U),ve===M&&++we===y&&(ae=U),(Se=Me.nextSibling)!==null)break;Me=ve,ve=Me.parentNode}Me=Se}h=ee===-1||ae===-1?null:{start:ee,end:ae}}else h=null}h=h||{start:0,end:0}}else h=null;for(Zx={focusedElem:a,selectionRange:h},My=!1,Kn=o;Kn!==null;)if(o=Kn,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,Kn=a;else for(;Kn!==null;){switch(o=Kn,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=Yi(h.type,E);a=y.getSnapshotBeforeUpdate(Xe,M),y.__reactInternalSnapshotBeforeUpdate=a}catch(ut){_n(h,h.return,ut)}}break;case 3:if((a&1024)!==0){if(a=o.stateNode.containerInfo,h=a.nodeType,h===9)tb(a);else if(h===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":tb(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,Kn=a;break}Kn=o.return}}function py(a,o,h){var y=h.flags;switch(h.tag){case 0:case 11:case 15:dl(a,h),y&4&&Ns(5,h);break;case 1:if(dl(a,h),y&4)if(a=h.stateNode,o===null)try{a.componentDidMount()}catch(U){_n(h,h.return,U)}else{var E=Yi(h.type,o.memoizedProps);o=o.memoizedState;try{a.componentDidUpdate(E,o,a.__reactInternalSnapshotBeforeUpdate)}catch(U){_n(h,h.return,U)}}y&64&&co(h),y&512&&Os(h,h.return);break;case 3:if(dl(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{qi(a,o)}catch(U){_n(h,h.return,U)}}break;case 27:o===null&&y&4&&ii(h);case 26:case 5:dl(a,h),o===null&&y&4&&oa(h),y&512&&Os(h,h.return);break;case 12:dl(a,h);break;case 31:dl(a,h),y&4&&Rf(a,h);break;case 13:dl(a,h),y&4&&qp(a,h),y&64&&(a=h.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(h=lO.bind(null,h),AO(a,h))));break;case 22:if(y=h.memoizedState!==null||ka,!y){o=o!==null&&o.memoizedState!==null||jn,E=ka;var M=jn;ka=y,(jn=o)&&!M?cn(a,h,(h.subtreeFlags&8772)!==0):dl(a,h),ka=E,jn=M}break;case 30:break;default:dl(a,h)}}function Mf(a){var o=a.alternate;o!==null&&(a.alternate=null,Mf(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&Vs(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 Yt=null,gi=!1;function rr(a,o,h){for(h=h.child;h!==null;)uo(a,o,h),h=h.sibling}function uo(a,o,h){if(Jt&&typeof Jt.onCommitFiberUnmount=="function")try{Jt.onCommitFiberUnmount(Zt,h)}catch{}switch(h.tag){case 26:jn||la(h,o),rr(a,o,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:jn||la(h,o);var y=Yt,E=gi;eu(h.type)&&(Yt=h.stateNode,gi=!1),rr(a,o,h),Xp(h.stateNode),Yt=y,gi=E;break;case 5:jn||la(h,o);case 6:if(y=Yt,E=gi,Yt=null,rr(a,o,h),Yt=y,gi=E,Yt!==null)if(gi)try{(Yt.nodeType===9?Yt.body:Yt.nodeName==="HTML"?Yt.ownerDocument.body:Yt).removeChild(h.stateNode)}catch(M){_n(h,o,M)}else try{Yt.removeChild(h.stateNode)}catch(M){_n(h,o,M)}break;case 18:Yt!==null&&(gi?(a=Yt,MS(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,h.stateNode),Hf(a)):MS(Yt,h.stateNode));break;case 4:y=Yt,E=gi,Yt=h.stateNode.containerInfo,gi=!0,rr(a,o,h),Yt=y,gi=E;break;case 0:case 11:case 14:case 15:Ma(2,h,o),jn||Ma(4,h,o),rr(a,o,h);break;case 1:jn||(la(h,o),y=h.stateNode,typeof y.componentWillUnmount=="function"&&Fp(h,o,y)),rr(a,o,h);break;case 21:rr(a,o,h);break;case 22:jn=(y=jn)||h.memoizedState!==null,rr(a,o,h),jn=y;break;default:rr(a,o,h)}}function Rf(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Hf(a)}catch(h){_n(o,o.return,h)}}}function qp(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Hf(a)}catch(h){_n(o,o.return,h)}}function my(a){switch(a.tag){case 31:case 13:case 19:var o=a.stateNode;return o===null&&(o=a.stateNode=new ld),o;case 22:return a=a.stateNode,o=a._retryCache,o===null&&(o=a._retryCache=new ld),o;default:throw Error(i(435,a.tag))}}function ri(a,o){var h=my(a);o.forEach(function(y){if(!h.has(y)){h.add(y);var E=oO.bind(null,a,y);y.then(E,E)}})}function ar(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,ee=U;e:for(;ee!==null;){switch(ee.tag){case 27:if(eu(ee.type)){Yt=ee.stateNode,gi=!1;break e}break;case 5:Yt=ee.stateNode,gi=!1;break e;case 3:case 4:Yt=ee.stateNode.containerInfo,gi=!0;break e}ee=ee.return}if(Yt===null)throw Error(i(160));uo(M,U,E),Yt=null,gi=!1,M=E.alternate,M!==null&&(M.return=null),E.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)fo(o,a),o=o.sibling}var zr=null;function fo(a,o){var h=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:ar(o,a),Wn(a),y&4&&(Ma(3,a,a.return),Ns(3,a),Ma(5,a,a.return));break;case 1:ar(o,a),Wn(a),y&512&&(jn||h===null||la(h,h.return)),y&64&&ka&&(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=zr;if(ar(o,a),Wn(a),y&512&&(jn||h===null||la(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[Pa]||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"))),Sr(M,y,h),M[bt]=a,In(M),y=M;break e;case"link":var U=US("link","href",E).get(y+(h.href||""));if(U){for(var ee=0;ee<U.length;ee++)if(M=U[ee],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(ee,1);break t}}M=E.createElement(y),Sr(M,y,h),E.head.appendChild(M);break;case"meta":if(U=US("meta","content",E).get(y+(h.content||""))){for(ee=0;ee<U.length;ee++)if(M=U[ee],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(ee,1);break t}}M=E.createElement(y),Sr(M,y,h),E.head.appendChild(M);break;default:throw Error(i(468,y))}M[bt]=a,In(M),y=M}a.stateNode=y}else HS(E,a.type,a.stateNode);else a.stateNode=IS(E,y,a.memoizedProps);else M!==y?(M===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):M.count--,y===null?HS(E,a.type,a.stateNode):IS(E,y,a.memoizedProps)):y===null&&a.stateNode!==null&&Ra(a,a.memoizedProps,h.memoizedProps)}break;case 27:ar(o,a),Wn(a),y&512&&(jn||h===null||la(h,h.return)),h!==null&&y&4&&Ra(a,a.memoizedProps,h.memoizedProps);break;case 5:if(ar(o,a),Wn(a),y&512&&(jn||h===null||la(h,h.return)),a.flags&32){E=a.stateNode;try{rt(E,"")}catch(Xe){_n(a,a.return,Xe)}}y&4&&a.stateNode!=null&&(E=a.memoizedProps,Ra(a,E,h!==null?h.memoizedProps:E)),y&1024&&(ul=!0);break;case 6:if(ar(o,a),Wn(a),y&4){if(a.stateNode===null)throw Error(i(162));y=a.memoizedProps,h=a.stateNode;try{h.nodeValue=y}catch(Xe){_n(a,a.return,Xe)}}break;case 3:if(wy=null,E=zr,zr=Sy(o.containerInfo),ar(o,a),zr=E,Wn(a),y&4&&h!==null&&h.memoizedState.isDehydrated)try{Hf(o.containerInfo)}catch(Xe){_n(a,a.return,Xe)}ul&&(ul=!1,gy(a));break;case 4:y=zr,zr=Sy(a.stateNode.containerInfo),ar(o,a),Wn(a),zr=y;break;case 12:ar(o,a),Wn(a);break;case 31:ar(o,a),Wn(a),y&4&&(y=a.updateQueue,y!==null&&(a.updateQueue=null,ri(a,y)));break;case 13:ar(o,a),Wn(a),a.child.flags&8192&&a.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(pl=Qt()),y&4&&(y=a.updateQueue,y!==null&&(a.updateQueue=null,ri(a,y)));break;case 22:E=a.memoizedState!==null;var ae=h!==null&&h.memoizedState!==null,xe=ka,we=jn;if(ka=xe||E,jn=we||ae,ar(o,a),jn=we,ka=xe,Wn(a),y&8192)e:for(o=a.stateNode,o._visibility=E?o._visibility&-2:o._visibility|1,E&&(h===null||ae||ka||jn||Wo(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{ee=ae.stateNode;var Me=ae.memoizedProps.style,ve=Me!=null&&Me.hasOwnProperty("display")?Me.display:null;ee.style.display=ve==null||typeof ve=="boolean"?"":(""+ve).trim()}}catch(Xe){_n(ae,ae.return,Xe)}}}else if(o.tag===6){if(h===null){ae=o;try{ae.stateNode.nodeValue=E?"":ae.memoizedProps}catch(Xe){_n(ae,ae.return,Xe)}}}else if(o.tag===18){if(h===null){ae=o;try{var Se=ae.stateNode;E?RS(Se,!0):RS(ae.stateNode,!1)}catch(Xe){_n(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,ri(a,h))));break;case 19:ar(o,a),Wn(a),y&4&&(y=a.updateQueue,y!==null&&(a.updateQueue=null,ri(a,y)));break;case 30:break;case 21:break;default:ar(o,a),Wn(a)}}function Wn(a){var o=a.flags;if(o&2){try{for(var h,y=a.return;y!==null;){if(mi(y)){h=y;break}y=y.return}if(h==null)throw Error(i(160));switch(h.tag){case 27:var E=h.stateNode,M=Ds(a);en(a,M,E);break;case 5:var U=h.stateNode;h.flags&32&&(rt(U,""),h.flags&=-33);var ee=Ds(a);en(a,ee,U);break;case 3:case 4:var ae=h.stateNode.containerInfo,xe=Ds(a);St(a,xe,ae);break;default:throw Error(i(161))}}catch(we){_n(a,a.return,we)}a.flags&=-3}o&4096&&(a.flags&=-4097)}function gy(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var o=a;gy(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),a=a.sibling}}function dl(a,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)py(a,o.alternate,o),o=o.sibling}function Wo(a){for(a=a.child;a!==null;){var o=a;switch(o.tag){case 0:case 11:case 14:case 15:Ma(4,o,o.return),Wo(o);break;case 1:la(o,o.return);var h=o.stateNode;typeof h.componentWillUnmount=="function"&&Fp(o,o.return,h),Wo(o);break;case 27:Xp(o.stateNode);case 26:case 5:la(o,o.return),Wo(o);break;case 22:o.memoizedState===null&&Wo(o);break;case 30:Wo(o);break;default:Wo(o)}a=a.sibling}}function cn(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:cn(E,M,h),Ns(4,M);break;case 1:if(cn(E,M,h),y=M,E=y.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(xe){_n(y,y.return,xe)}if(y=M,E=y.updateQueue,E!==null){var ee=y.stateNode;try{var ae=E.shared.hiddenCallbacks;if(ae!==null)for(E.shared.hiddenCallbacks=null,E=0;E<ae.length;E++)As(ae[E],ee)}catch(xe){_n(y,y.return,xe)}}h&&U&64&&co(M),Os(M,M.return);break;case 27:ii(M);case 26:case 5:cn(E,M,h),h&&y===null&&U&4&&oa(M),Os(M,M.return);break;case 12:cn(E,M,h);break;case 31:cn(E,M,h),h&&U&4&&Rf(E,M);break;case 13:cn(E,M,h),h&&U&4&&qp(E,M);break;case 22:M.memoizedState===null&&cn(E,M,h),Os(M,M.return);break;case 30:break;default:cn(E,M,h)}o=o.sibling}}function kf(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&&Fi(h))}function fl(a,o){a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Fi(a))}function Ci(a,o,h,y){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Fn(a,o,h,y),o=o.sibling}function Fn(a,o,h,y){var E=o.flags;switch(o.tag){case 0:case 11:case 15:Ci(a,o,h,y),E&2048&&Ns(9,o);break;case 1:Ci(a,o,h,y);break;case 3:Ci(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&&Fi(a)));break;case 12:if(E&2048){Ci(a,o,h,y),a=o.stateNode;try{var M=o.memoizedProps,U=M.id,ee=M.onPostCommit;typeof ee=="function"&&ee(U,o.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(ae){_n(o,o.return,ae)}}else Ci(a,o,h,y);break;case 31:Ci(a,o,h,y);break;case 13:Ci(a,o,h,y);break;case 23:break;case 22:M=o.stateNode,U=o.alternate,o.memoizedState!==null?M._visibility&2?Ci(a,o,h,y):$c(a,o):M._visibility&2?Ci(a,o,h,y):(M._visibility|=2,ho(a,o,h,y,(o.subtreeFlags&10256)!==0||!1)),E&2048&&kf(U,o);break;case 24:Ci(a,o,h,y),E&2048&&fl(o.alternate,o);break;default:Ci(a,o,h,y)}}function ho(a,o,h,y,E){for(E=E&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var M=a,U=o,ee=h,ae=y,xe=U.flags;switch(U.tag){case 0:case 11:case 15:ho(M,U,ee,ae,E),Ns(8,U);break;case 23:break;case 22:var we=U.stateNode;U.memoizedState!==null?we._visibility&2?ho(M,U,ee,ae,E):$c(M,U):(we._visibility|=2,ho(M,U,ee,ae,E)),E&&xe&2048&&kf(U.alternate,U);break;case 24:ho(M,U,ee,ae,E),E&&xe&2048&&fl(U.alternate,U);break;default:ho(M,U,ee,ae,E)}o=o.sibling}}function $c(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:$c(h,y),E&2048&&kf(y.alternate,y);break;case 24:$c(h,y),E&2048&&fl(y.alternate,y);break;default:$c(h,y)}o=o.sibling}}var $n=8192;function $o(a,o,h){if(a.subtreeFlags&$n)for(a=a.child;a!==null;)ai(a,o,h),a=a.sibling}function ai(a,o,h){switch(a.tag){case 26:$o(a,o,h),a.flags&$n&&a.memoizedState!==null&&UO(h,zr,a.memoizedState,a.memoizedProps);break;case 5:$o(a,o,h);break;case 3:case 4:var y=zr;zr=Sy(a.stateNode.containerInfo),$o(a,o,h),zr=y;break;case 22:a.memoizedState===null&&(y=a.alternate,y!==null&&y.memoizedState!==null?(y=$n,$n=16777216,$o(a,o,h),$n=y):$o(a,o,h));break;default:$o(a,o,h)}}function jr(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 vr(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];Kn=y,od(y,a)}jr(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:vr(a),a.flags&2048&&Ma(9,a,a.return);break;case 3:vr(a);break;case 12:vr(a);break;case 22:var o=a.stateNode;a.memoizedState!==null&&o._visibility&2&&(a.return===null||a.return.tag!==13)?(o._visibility&=-3,Nf(a)):vr(a);break;default:vr(a)}}function Nf(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];Kn=y,od(y,a)}jr(a)}for(a=a.child;a!==null;){switch(o=a,o.tag){case 0:case 11:case 15:Ma(8,o,o.return),Nf(o);break;case 22:h=o.stateNode,h._visibility&2&&(h._visibility&=-3,Nf(o));break;default:Nf(o)}a=a.sibling}}function od(a,o){for(;Kn!==null;){var h=Kn;switch(h.tag){case 0:case 11:case 15:Ma(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:Fi(h.memoizedState.cache)}if(y=h.child,y!==null)y.return=h,Kn=y;else e:for(h=a;Kn!==null;){y=Kn;var E=y.sibling,M=y.return;if(Mf(y),y===h){Kn=null;break e}if(E!==null){E.return=M,Kn=E;break e}Kn=M}}}var Of={getCacheForType:function(a){var o=ji(Je),h=o.data.get(a);return h===void 0&&(h=a(),o.data.set(a,h)),h},cacheSignal:function(){return ji(Je).controller.signal}},Df=typeof WeakMap=="function"?WeakMap:Map,Bt=0,un=null,Et=null,Dt=0,et=0,Rt=null,xt=!1,Tt=!1,bn=!1,si=0,dn=0,ca=0,hl=0,Za=0,It=0,ua=0,Ja=null,sr=null,Lr=!1,pl=0,Qc=0,da=1/0,Zc=null,zs=null,qn=0,es=null,fa=null,Na=0,ml=0,Zo=null,zf=null,Jo=0,ec=null;function _r(){return(Bt&2)!==0&&Dt!==0?Dt&-Dt:O.T!==null?Gx():dr()}function u(){if(It===0)if((Dt&536870912)===0||zt){var a=Ha;Ha<<=1,(Ha&3932160)===0&&(Ha=262144),It=a}else It=536870912;return a=Ti.current,a!==null&&(a.flags|=32),It}function d(a,o,h){(a===un&&(et===2||et===9)||a.cancelPendingCommit!==null)&&(pe(a,0),j(a,Dt,It,!1)),an(a,h),((Bt&2)===0||a!==un)&&(a===un&&((Bt&2)===0&&(hl|=h),dn===4&&j(a,Dt,It,!1)),po(a))}function v(a,o,h){if((Bt&6)!==0)throw Error(i(327));var y=!h&&(o&127)===0&&(o&a.expiredLanes)===0||Te(a,o),E=y?tc(a,o):Br(a,o,!0),M=y;do{if(E===0){Tt&&!y&&j(a,o,0,!1);break}else{if(h=a.current.alternate,M&&!k(h)){E=Br(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 ee=a;E=Ja;var ae=ee.current.memoizedState.isDehydrated;if(ae&&(pe(ee,U).flags|=256),U=Br(ee,U,!1),U!==2){if(bn&&!ae){ee.errorRecoveryDisabledLanes|=M,hl|=M,E=4;break e}M=sr,sr=E,M!==null&&(sr===null?sr=M:sr.push.apply(sr,M))}E=U}if(M=!1,E!==2)continue}}if(E===1){pe(a,0),j(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:j(y,o,It,!xt);break e;case 2:sr=null;break;case 3:case 5:break;default:throw Error(i(329))}if((o&62914560)===o&&(E=pl+300-Qt(),10<E)){if(j(y,o,It,!xt),se(y,0,!0)!==0)break e;Na=o,y.timeoutHandle=CS(w.bind(null,y,h,sr,Zc,Lr,o,It,hl,ua,xt,M,"Throttled",-0,0),E);break e}w(y,h,sr,Zc,Lr,o,It,hl,ua,xt,M,null,-0,0)}}break}while(!0);po(a)}function w(a,o,h,y,E,M,U,ee,ae,xe,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:je},ai(o,M,Me);var Xe=(M&62914560)===M?pl-Qt():(M&4194048)===M?Qc-Qt():0;if(Xe=HO(Me,Xe),Xe!==null){Na=M,a.cancelPendingCommit=Xe(ft.bind(null,a,o,M,h,y,E,U,ee,ae,we,Me,null,ve,Se)),j(a,M,U,!xe);return}}ft(a,o,M,h,y,E,U,ee,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(!Dn(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 j(a,o,h,y){o&=~Za,o&=~hl,a.suspendedLanes|=o,a.pingedLanes&=~o,y&&(a.warmLanes|=o),y=a.expirationTimes;for(var E=o;0<E;){var M=31-Ft(E),U=1<<M;y[M]=-1,E&=~U}h!==0&&qe(a,h,o)}function te(){return(Bt&6)===0?(Gp(0),!1):!0}function re(){if(Et!==null){if(et===0)var a=Et.return;else a=Et,tr=tl=null,vp(a),to=null,no=0,a=Et;for(;a!==null;)Ko(a.alternate,a),a=a.return;Et=null}}function pe(a,o){var h=a.timeoutHandle;h!==-1&&(a.timeoutHandle=-1,SO(h)),h=a.cancelPendingCommit,h!==null&&(a.cancelPendingCommit=null,h()),Na=0,re(),un=a,Et=h=_s(a.current,null),Dt=o,et=0,Rt=null,xt=!1,Tt=Te(a,o),bn=!1,ua=It=Za=hl=ca=dn=0,sr=Ja=null,Lr=!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-Ft(y),M=1<<E;o|=a[E],y&=~M}return si=o,Kl(),h}function Ce(a,o){dt=null,O.H=$u,o===eo||o===Ka?(o=of(),et=3):o===Hu?(o=of(),et=4):et=o===Tf?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Rt=o,Et===null&&(dn=1,wf(a,Mr(o,a.current)))}function De(){var a=Ti.current;return a===null?!0:(Dt&4194048)===Dt?Ta===null:(Dt&62914560)===Dt||(Dt&536870912)!==0?a===Ta:!1}function Fe(){var a=O.H;return O.H=$u,a===null?$u:a}function Ge(){var a=O.A;return O.A=Of,a}function mt(){dn=4,xt||(Dt&4194048)!==Dt&&Ti.current!==null||(Tt=!0),(ca&134217727)===0&&(hl&134217727)===0||un===null||j(un,Dt,It,!1)}function Br(a,o,h){var y=Bt;Bt|=2;var E=Fe(),M=Ge();(un!==a||Dt!==o)&&(Zc=null,pe(a,o)),o=!1;var U=dn;e:do try{if(et!==0&&Et!==null){var ee=Et,ae=Rt;switch(et){case 8:re(),U=6;break e;case 3:case 2:case 9:case 6:Ti.current===null&&(o=!0);var xe=et;if(et=0,Rt=null,Oe(a,ee,ae,xe),h&&Tt){U=0;break e}break;default:xe=et,et=0,Rt=null,Oe(a,ee,ae,xe)}}cd(),U=dn;break}catch(we){Ce(a,we)}while(!0);return o&&a.shellSuspendCounter++,tr=tl=null,Bt=y,O.H=E,O.A=M,Et===null&&(un=null,Dt=0,Kl()),U}function cd(){for(;Et!==null;)fe(Et)}function tc(a,o){var h=Bt;Bt|=2;var y=Fe(),E=Ge();un!==a||Dt!==o?(Zc=null,da=Qt()+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(Pg(M)){et=0,Rt=null,_e(o);break}o=function(){et!==2&&et!==9||un!==a||(et=7),po(a)},M.then(o,o);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Pg(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 ee=Et;if(U?PS(U):ee.stateNode.complete){et=0,Rt=null;var ae=ee.sibling;if(ae!==null)Et=ae;else{var xe=ee.return;xe!==null?(Et=xe,Ze(xe)):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(),dn=6;break e;default:throw Error(i(462))}}be();break}catch(we){Ce(a,we)}while(!0);return tr=tl=null,O.H=y,O.A=E,Bt=h,Et!==null?0:(un=null,Dt=0,Kl(),dn)}function be(){for(;Et!==null&&!Yr();)fe(Et)}function fe(a){var o=Cf(a.alternate,a,si);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=ir(h,o,o.pendingProps,o.type,void 0,Dt);break;case 11:o=ir(h,o,o.pendingProps,o.type.render,o.ref,Dt);break;case 5:vp(o);default:Ko(h,o),o=Et=er(o,si),o=Cf(h,o,si)}a.memoizedProps=a.pendingProps,o===null?Ze(a):Et=o}function Oe(a,o,h,y){tr=tl=null,vp(o),to=null,no=0;var E=o.return;try{if(na(a,E,o,h,Dt)){dn=1,wf(a,Mr(h,a.current)),Et=null;return}}catch(M){if(E!==null)throw Et=E,M;dn=1,wf(a,Mr(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=Ti.current,y!==null&&y.tag===13&&(y.flags|=16384))),Tn(o,a)):Ze(o)}function Ze(a){var o=a;do{if((o.flags&32768)!==0){Tn(o,xt);return}a=o.return;var h=Pp(o.alternate,o,si);if(h!==null){Et=h;return}if(o=o.sibling,o!==null){Et=o;return}Et=o=a}while(o!==null);dn===0&&(dn=5)}function Tn(a,o){do{var h=Af(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);dn=6,Et=null}function ft(a,o,h,y,E,M,U,ee,ae){a.cancelPendingCommit=null;do jf();while(qn!==0);if((Bt&6)!==0)throw Error(i(327));if(o!==null){if(o===a.current)throw Error(i(177));if(M=o.lanes|o.childLanes,M|=Jd,Ye(a,h,M,U,ee,ae),a===un&&(Et=un=null,Dt=0),fa=o,es=a,Na=h,ml=M,Zo=E,zf=y,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,cO(ce,function(){return cS(),null})):(a.callbackNode=null,a.callbackPriority=0),y=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||y){y=O.T,O.T=null,E=Y.p,Y.p=2,U=Bt,Bt|=4;try{Wc(a,o,h)}finally{Bt=U,Y.p=E,O.T=y}}qn=1,Vt(),Ai(),Xt()}}function Vt(){if(qn===1){qn=0;var a=es,o=fa,h=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||h){h=O.T,O.T=null;var y=Y.p;Y.p=2;var E=Bt;Bt|=4;try{fo(o,a);var M=Zx,U=Kd(a.containerInfo),ee=M.focusedElem,ae=M.selectionRange;if(U!==ee&&ee&&ee.ownerDocument&&Xd(ee.ownerDocument.documentElement,ee)){if(ae!==null&&Mc(ee)){var xe=ae.start,we=ae.end;if(we===void 0&&(we=xe),"selectionStart"in ee)ee.selectionStart=xe,ee.selectionEnd=Math.min(we,ee.value.length);else{var Me=ee.ownerDocument||document,ve=Me&&Me.defaultView||window;if(ve.getSelection){var Se=ve.getSelection(),Xe=ee.textContent.length,ut=Math.min(ae.start,Xe),An=ae.end===void 0?ut:Math.min(ae.end,Xe);!Se.extend&&ut>An&&(U=An,An=ut,ut=U);var he=Wh(ee,ut),ue=Wh(ee,An);if(he&&ue&&(Se.rangeCount!==1||Se.anchorNode!==he.node||Se.anchorOffset!==he.offset||Se.focusNode!==ue.node||Se.focusOffset!==ue.offset)){var ye=Me.createRange();ye.setStart(he.node,he.offset),Se.removeAllRanges(),ut>An?(Se.addRange(ye),Se.extend(ue.node,ue.offset)):(ye.setEnd(ue.node,ue.offset),Se.addRange(ye))}}}}for(Me=[],Se=ee;Se=Se.parentNode;)Se.nodeType===1&&Me.push({element:Se,left:Se.scrollLeft,top:Se.scrollTop});for(typeof ee.focus=="function"&&ee.focus(),ee=0;ee<Me.length;ee++){var Ae=Me[ee];Ae.element.scrollLeft=Ae.left,Ae.element.scrollTop=Ae.top}}My=!!Qx,Zx=Qx=null}finally{Bt=E,Y.p=y,O.T=h}}a.current=o,qn=2}}function Ai(){if(qn===2){qn=0;var a=es,o=fa,h=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||h){h=O.T,O.T=null;var y=Y.p;Y.p=2;var E=Bt;Bt|=4;try{py(a,o.alternate,o)}finally{Bt=E,Y.p=y,O.T=h}}qn=3}}function Xt(){if(qn===4||qn===3){qn=0,ki();var a=es,o=fa,h=Na,y=zf;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?qn=5:(qn=0,fa=es=null,gl(a,a.pendingLanes));var E=a.pendingLanes;if(E===0&&(zs=null),_a(h),o=o.stateNode,Jt&&typeof Jt.onCommitFiberRoot=="function")try{Jt.onCommitFiberRoot(Zt,o,void 0,(o.current.flags&128)===128)}catch{}if(y!==null){o=O.T,E=Y.p,Y.p=2,O.T=null;try{for(var M=a.onRecoverableError,U=0;U<y.length;U++){var ee=y[U];M(ee.value,{componentStack:ee.stack})}}finally{O.T=o,Y.p=E}}(Na&3)!==0&&jf(),po(a),E=a.pendingLanes,(h&261930)!==0&&(E&42)!==0?a===ec?Jo++:(Jo=0,ec=a):Jo=0,Gp(0)}}function gl(a,o){(a.pooledCacheLanes&=o)===0&&(o=a.pooledCache,o!=null&&(a.pooledCache=null,Fi(o)))}function jf(){return Vt(),Ai(),Xt(),cS()}function cS(){if(qn!==5)return!1;var a=es,o=ml;ml=0;var h=_a(Na),y=O.T,E=Y.p;try{Y.p=32>h?32:h,O.T=null,h=Zo,Zo=null;var M=es,U=Na;if(qn=0,fa=es=null,Na=0,(Bt&6)!==0)throw Error(i(331));var ee=Bt;if(Bt|=4,Qo(M.current),Fn(M,M.current,U,h),Bt=ee,Gp(0,!1),Jt&&typeof Jt.onPostCommitFiberRoot=="function")try{Jt.onPostCommitFiberRoot(Zt,M)}catch{}return!0}finally{Y.p=E,O.T=y,gl(a,o)}}function uS(a,o,h){o=Mr(h,o),o=Hp(a.stateNode,o,2),a=al(a,o,2),a!==null&&(an(a,2),po(a))}function _n(a,o,h){if(a.tag===3)uS(a,a,h);else for(;o!==null;){if(o.tag===3){uS(o,a,h);break}else if(o.tag===1){var y=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(zs===null||!zs.has(y))){a=Mr(h,a),h=Gc(2),y=al(o,h,2),y!==null&&(Or(h,y,o,a),an(y,2),po(y));break}}o=o.return}}function Px(a,o,h){var y=a.pingCache;if(y===null){y=a.pingCache=new Df;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)||(bn=!0,E.add(h),a=sO.bind(null,a,o,h),o.then(a,a))}function sO(a,o,h){var y=a.pingCache;y!==null&&y.delete(o),a.pingedLanes|=a.suspendedLanes&h,a.warmLanes&=~h,un===a&&(Dt&h)===h&&(dn===4||dn===3&&(Dt&62914560)===Dt&&300>Qt()-pl?(Bt&2)===0&&pe(a,0):Za|=h,ua===Dt&&(ua=0)),po(a)}function dS(a,o){o===0&&(o=tt()),a=Wl(a,o),a!==null&&(an(a,o),po(a))}function lO(a){var o=a.memoizedState,h=0;o!==null&&(h=o.retryLane),dS(a,h)}function oO(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),dS(a,h)}function cO(a,o){return pn(a,o)}var yy=null,Lf=null,Fx=!1,xy=!1,qx=!1,Jc=0;function po(a){a!==Lf&&a.next===null&&(Lf===null?yy=Lf=a:Lf=Lf.next=a),xy=!0,Fx||(Fx=!0,dO())}function Gp(a,o){if(!qx&&xy){qx=!0;do for(var h=!1,y=yy;y!==null;){if(a!==0){var E=y.pendingLanes;if(E===0)var M=0;else{var U=y.suspendedLanes,ee=y.pingedLanes;M=(1<<31-Ft(42|a)+1)-1,M&=E&~(U&~ee),M=M&201326741?M&201326741|1:M?M|2:0}M!==0&&(h=!0,mS(y,M))}else M=Dt,M=se(y,y===un?M:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(M&3)===0||Te(y,M)||(h=!0,mS(y,M));y=y.next}while(h);qx=!1}}function uO(){fS()}function fS(){xy=Fx=!1;var a=0;Jc!==0&&_O()&&(a=Jc);for(var o=Qt(),h=null,y=yy;y!==null;){var E=y.next,M=hS(y,o);M===0?(y.next=null,h===null?yy=E:h.next=E,E===null&&(Lf=h)):(h=y,(a!==0||(M&3)!==0)&&(xy=!0)),y=E}qn!==0&&qn!==5||Gp(a),Jc!==0&&(Jc=0)}function hS(a,o){for(var h=a.suspendedLanes,y=a.pingedLanes,E=a.expirationTimes,M=a.pendingLanes&-62914561;0<M;){var U=31-Ft(M),ee=1<<U,ae=E[U];ae===-1?((ee&h)===0||(ee&y)!==0)&&(E[U]=Ie(ee,o)):ae<=o&&(a.expiredLanes|=ee),M&=~ee}if(o=un,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&&ui(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&&ui(y),_a(h)){case 2:case 8:h=ke;break;case 32:h=ce;break;case 268435456:h=ct;break;default:h=ce}return y=pS.bind(null,a),h=pn(h,y),a.callbackPriority=o,a.callbackNode=h,o}return y!==null&&y!==null&&ui(y),a.callbackPriority=2,a.callbackNode=null,2}function pS(a,o){if(qn!==0&&qn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var h=a.callbackNode;if(jf()&&a.callbackNode!==h)return null;var y=Dt;return y=se(a,a===un?y:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),y===0?null:(v(a,y,o),hS(a,Qt()),a.callbackNode!=null&&a.callbackNode===h?pS.bind(null,a):null)}function mS(a,o){if(jf())return null;v(a,o,!0)}function dO(){EO(function(){(Bt&6)!==0?pn(Ee,uO):fS()})}function Gx(){if(Jc===0){var a=rl;a===0&&(a=hs,hs<<=1,(hs&261888)===0&&(hs=256)),Jc=a}return Jc}function gS(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Ks(""+a)}function yS(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 fO(a,o,h,y,E){if(o==="submit"&&h&&h.stateNode===E){var M=gS((E[fi]||null).action),U=y.submitter;U&&(o=(o=U[fi]||null)?gS(o.formAction):U.getAttribute("formAction"),o!==null&&(M=o,U=null));var ee=new Tu("action","action",null,y,E);a.push({event:ee,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(Jc!==0){var ae=U?yS(E,U):new FormData(E);jp(h,{pending:!0,data:ae,method:E.method,action:M},null,ae)}}else typeof M=="function"&&(ee.preventDefault(),ae=U?yS(E,U):new FormData(E),jp(h,{pending:!0,data:ae,method:E.method,action:M},M,ae))},currentTarget:E}]})}}for(var Yx=0;Yx<Zd.length;Yx++){var Vx=Zd[Yx],hO=Vx.toLowerCase(),pO=Vx[0].toUpperCase()+Vx.slice(1);Ji(hO,"on"+pO)}Ji(Ar,"onAnimationEnd"),Ji($h,"onAnimationIteration"),Ji(vs,"onAnimationStart"),Ji("dblclick","onDoubleClick"),Ji("focusin","onFocus"),Ji("focusout","onBlur"),Ji(Oc,"onTransitionRun"),Ji(Vl,"onTransitionStart"),Ji(Qh,"onTransitionCancel"),Ji(Qd,"onTransitionEnd"),Ne("onMouseEnter",["mouseout","mouseover"]),Ne("onMouseLeave",["mouseout","mouseover"]),Ne("onPointerEnter",["pointerout","pointerover"]),Ne("onPointerLeave",["pointerout","pointerover"]),Kr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Kr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Kr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Kr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Kr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Kr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yp="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(" "),mO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yp));function xS(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 ee=y[U],ae=ee.instance,xe=ee.currentTarget;if(ee=ee.listener,ae!==M&&E.isPropagationStopped())break e;M=ee,E.currentTarget=xe;try{M(E)}catch(we){Xl(we)}E.currentTarget=null,M=ae}else for(U=0;U<y.length;U++){if(ee=y[U],ae=ee.instance,xe=ee.currentTarget,ee=ee.listener,ae!==M&&E.isPropagationStopped())break e;M=ee,E.currentTarget=xe;try{M(E)}catch(we){Xl(we)}E.currentTarget=null,M=ae}}}}function jt(a,o){var h=o[Ys];h===void 0&&(h=o[Ys]=new Set);var y=a+"__bubble";h.has(y)||(bS(o,a,2,!1),h.add(y))}function Xx(a,o,h){var y=0;o&&(y|=4),bS(h,a,y,o)}var by="_reactListening"+Math.random().toString(36).slice(2);function Kx(a){if(!a[by]){a[by]=!0,Cr.forEach(function(h){h!=="selectionchange"&&(mO.has(h)||Xx(h,!1,a),Xx(h,!0,a))});var o=a.nodeType===9?a:a.ownerDocument;o===null||o[by]||(o[by]=!0,Xx("selectionchange",!1,o))}}function bS(a,o,h,y){switch(KS(o)){case 2:var E=qO;break;case 8:E=GO;break;default:E=cb}h=E.bind(null,o,h,a),E=void 0,!Bd||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 Wx(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 ee=y.stateNode.containerInfo;if(ee===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(;ee!==null;){if(U=sn(ee),U===null)return;if(ae=U.tag,ae===5||ae===6||ae===26||ae===27){y=M=U;continue e}ee=ee.parentNode}}y=y.return}Su(function(){var xe=M,we=yt(h),Me=[];e:{var ve=Qs.get(a);if(ve!==void 0){var Se=Tu,Xe=a;switch(a){case"keypress":if(No(h)===0)break e;case"keydown":case"keyup":Se=Uh;break;case"focusin":Xe="focus",Se=Fd;break;case"focusout":Xe="blur",Se=Fd;break;case"beforeblur":case"afterblur":Se=Fd;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=xg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Se=bg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Se=Ws;break;case Ar:case $h:case vs:Se=Sg;break;case Qd:Se=Dx;break;case"scroll":case"scrollend":Se=Hd;break;case"wheel":Se=Hl;break;case"copy":case"cut":case"paste":Se=zh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Se=qd;break;case"toggle":case"beforetoggle":Se=Ph}var ut=(o&4)!==0,An=!ut&&(a==="scroll"||a==="scrollend"),he=ut?ve!==null?ve+"Capture":null:ve;ut=[];for(var ue=xe,ye;ue!==null;){var Ae=ue;if(ye=Ae.stateNode,Ae=Ae.tag,Ae!==5&&Ae!==26&&Ae!==27||ye===null||he===null||(Ae=ko(ue,he),Ae!=null&&ut.push(Vp(ue,Ae,ye))),An)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)&&(sn(Xe)||Xe[Vr]))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=xe,Xe=Xe?sn(Xe):null,Xe!==null&&(An=s(Xe),ut=Xe.tag,Xe!==An||ut!==5&&ut!==27&&ut!==6)&&(Xe=null)):(Se=null,Xe=xe),Se!==Xe)){if(ut=xg,Ae="onMouseLeave",he="onMouseEnter",ue="mouse",(a==="pointerout"||a==="pointerover")&&(ut=qd,Ae="onPointerLeave",he="onPointerEnter",ue="pointer"),An=Se==null?ve:hr(Se),ye=Xe==null?ve:hr(Xe),ve=new ut(Ae,ue+"leave",Se,h,we),ve.target=An,ve.relatedTarget=ye,Ae=null,sn(we)===xe&&(ut=new ut(he,ue+"enter",Xe,h,we),ut.target=ye,ut.relatedTarget=An,Ae=ut),An=Ae,Se&&Xe)t:{for(ut=gO,he=Se,ue=Xe,ye=0,Ae=he;Ae;Ae=ut(Ae))ye++;Ae=0;for(var it=ue;it;it=ut(it))Ae++;for(;0<ye-Ae;)he=ut(he),ye--;for(;0<Ae-ye;)ue=ut(ue),Ae--;for(;ye--;){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&&vS(Me,ve,Se,ut,!1),Xe!==null&&An!==null&&vS(Me,An,Xe,ut,!0)}}e:{if(ve=xe?hr(xe):window,Se=ve.nodeName&&ve.nodeName.toLowerCase(),Se==="select"||Se==="input"&&ve.type==="file")var fn=Vh;else if(Gh(ve))if(Nu)fn=Dg;else{fn=ql;var We=Ou}else Se=ve.nodeName,!Se||Se.toLowerCase()!=="input"||ve.type!=="checkbox"&&ve.type!=="radio"?xe&&ys(xe.elementType)&&(fn=Vh):fn=Og;if(fn&&(fn=fn(a,xe))){Vd(Me,fn,h,we);break e}We&&We(a,ve,xe),a==="focusout"&&xe&&ve.type==="number"&&xe.memoizedProps.value!=null&&Xs(ve,"number",ve.value)}switch(We=xe?hr(xe):window,a){case"focusin":(Gh(We)||We.contentEditable==="true")&&(Rc=We,Wd=xe,kc=null);break;case"focusout":kc=Wd=Rc=null;break;case"mousedown":Qr=!0;break;case"contextmenu":case"mouseup":case"dragend":Qr=!1,$d(Me,h,we);break;case"selectionchange":if(zg)break;case"keydown":case"keyup":$d(Me,h,we)}var Ct;if(Oo)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 Fl?Gd(a,h)&&(Ut="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(Ut="onCompositionStart");Ut&&(Pi&&h.locale!=="ko"&&(Fl||Ut!=="onCompositionStart"?Ut==="onCompositionEnd"&&Fl&&(Ct=Ud()):(Bl=we,Id="value"in Bl?Bl.value:Bl.textContent,Fl=!0)),We=vy(xe,Ut),0<We.length&&(Ut=new jh(Ut,a,null,h,we),Me.push({event:Ut,listeners:We}),Ct?Ut.data=Ct:(Ct=Ec(h),Ct!==null&&(Ut.data=Ct)))),(Ct=Do?Yd(a,h):Rg(a,h))&&(Ut=vy(xe,"onBeforeInput"),0<Ut.length&&(We=new jh("onBeforeInput","beforeinput",null,h,we),Me.push({event:We,listeners:Ut}),We.data=Ct)),fO(Me,a,xe,h,we)}xS(Me,o)})}function Vp(a,o,h){return{instance:a,listener:o,currentTarget:h}}function vy(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=ko(a,h),E!=null&&y.unshift(Vp(a,E,M)),E=ko(a,o),E!=null&&y.push(Vp(a,E,M))),a.tag===3)return y;a=a.return}return[]}function gO(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function vS(a,o,h,y,E){for(var M=o._reactName,U=[];h!==null&&h!==y;){var ee=h,ae=ee.alternate,xe=ee.stateNode;if(ee=ee.tag,ae!==null&&ae===y)break;ee!==5&&ee!==26&&ee!==27||xe===null||(ae=xe,E?(xe=ko(h,M),xe!=null&&U.unshift(Vp(h,xe,ae))):E||(xe=ko(h,M),xe!=null&&U.push(Vp(h,xe,ae)))),h=h.return}U.length!==0&&a.push({event:o,listeners:U})}var yO=/\r\n?/g,xO=/\u0000|\uFFFD/g;function _S(a){return(typeof a=="string"?a:""+a).replace(yO,`
50
+ `).replace(xO,"")}function SS(a,o){return o=_S(o),_S(a)===o}function Cn(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":Qi(a,"class",y);break;case"tabIndex":Qi(a,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":Qi(a,h,y);break;case"style":on(a,y,M);break;case"data":if(o!=="object"){Qi(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=Ks(""+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"&&Cn(a,o,"name",E.name,E,null),Cn(a,o,"formEncType",E.formEncType,E,null),Cn(a,o,"formMethod",E.formMethod,E,null),Cn(a,o,"formTarget",E.formTarget,E,null)):(Cn(a,o,"encType",E.encType,E,null),Cn(a,o,"method",E.method,E,null),Cn(a,o,"target",E.target,E,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){a.removeAttribute(h);break}y=Ks(""+y),a.setAttribute(h,y);break;case"onClick":y!=null&&(a.onclick=je);break;case"onScroll":y!=null&&jt("scroll",a);break;case"onScrollEnd":y!=null&&jt("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=Ks(""+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":jt("beforetoggle",a),jt("toggle",a),wi(a,"popover",y);break;case"xlinkActuate":Ni(a,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":Ni(a,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":Ni(a,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":Ni(a,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":Ni(a,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":Ni(a,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":Ni(a,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":Ni(a,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":Ni(a,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":wi(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=xs.get(h)||h,wi(a,h,y))}}function $x(a,o,h,y,E,M){switch(h){case"style":on(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&&jt("scroll",a);break;case"onScrollEnd":y!=null&&jt("scrollend",a);break;case"onClick":y!=null&&(a.onclick=je);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Sa.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[fi]||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,""):wi(a,h,y)}}}function Sr(a,o,h){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":jt("error",a),jt("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:Cn(a,o,M,U,h,null)}}E&&Cn(a,o,"srcSet",h.srcSet,h,null),y&&Cn(a,o,"src",h.src,h,null);return;case"input":jt("invalid",a);var ee=M=U=E=null,ae=null,xe=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":xe=we;break;case"value":M=we;break;case"defaultValue":ee=we;break;case"children":case"dangerouslySetInnerHTML":if(we!=null)throw Error(i(137,o));break;default:Cn(a,o,y,we,h,null)}}gs(a,M,ee,ae,xe,U,E,!1);return;case"select":jt("invalid",a),y=U=M=null;for(E in h)if(h.hasOwnProperty(E)&&(ee=h[E],ee!=null))switch(E){case"value":M=ee;break;case"defaultValue":U=ee;break;case"multiple":y=ee;default:Cn(a,o,E,ee,h,null)}o=M,h=U,a.multiple=!!y,o!=null?hi(a,!!y,o,!1):h!=null&&hi(a,!!y,h,!0);return;case"textarea":jt("invalid",a),M=E=y=null;for(U in h)if(h.hasOwnProperty(U)&&(ee=h[U],ee!=null))switch(U){case"value":y=ee;break;case"defaultValue":E=ee;break;case"children":M=ee;break;case"dangerouslySetInnerHTML":if(ee!=null)throw Error(i(91));break;default:Cn(a,o,U,ee,h,null)}qa(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:Cn(a,o,ae,y,h,null)}return;case"dialog":jt("beforetoggle",a),jt("toggle",a),jt("cancel",a),jt("close",a);break;case"iframe":case"object":jt("load",a);break;case"video":case"audio":for(y=0;y<Yp.length;y++)jt(Yp[y],a);break;case"image":jt("error",a),jt("load",a);break;case"details":jt("toggle",a);break;case"embed":case"source":case"link":jt("error",a),jt("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(xe in h)if(h.hasOwnProperty(xe)&&(y=h[xe],y!=null))switch(xe){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:Cn(a,o,xe,y,h,null)}return;default:if(ys(o)){for(we in h)h.hasOwnProperty(we)&&(y=h[we],y!==void 0&&$x(a,o,we,y,h,void 0));return}}for(ee in h)h.hasOwnProperty(ee)&&(y=h[ee],y!=null&&Cn(a,o,ee,y,h,null))}function bO(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,ee=null,ae=null,xe=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)||Cn(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":xe=Se;break;case"defaultChecked":we=Se;break;case"value":U=Se;break;case"defaultValue":ee=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(i(137,o));break;default:Se!==Me&&Cn(a,o,ve,Se,y,Me)}}ms(a,U,ee,ae,xe,we,M,E);return;case"select":Se=U=ee=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)||Cn(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":ee=M;break;case"multiple":U=M;default:M!==ae&&Cn(a,o,E,M,y,ae)}o=ee,h=U,y=Se,ve!=null?hi(a,!!h,ve,!1):!!y!=!!h&&(o!=null?hi(a,!!h,o,!0):hi(a,!!h,h?[]:"",!1));return;case"textarea":Se=ve=null;for(ee in h)if(E=h[ee],h.hasOwnProperty(ee)&&E!=null&&!y.hasOwnProperty(ee))switch(ee){case"value":break;case"children":break;default:Cn(a,o,ee,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&&Cn(a,o,U,E,y,M)}_u(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:Cn(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:Cn(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)&&Cn(a,o,ut,null,y,ve);for(xe in y)if(ve=y[xe],Se=h[xe],y.hasOwnProperty(xe)&&ve!==Se&&(ve!=null||Se!=null))switch(xe){case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(i(137,o));break;default:Cn(a,o,xe,ve,y,Se)}return;default:if(ys(o)){for(var An in h)ve=h[An],h.hasOwnProperty(An)&&ve!==void 0&&!y.hasOwnProperty(An)&&$x(a,o,An,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||$x(a,o,we,ve,y,Se);return}}for(var he in h)ve=h[he],h.hasOwnProperty(he)&&ve!=null&&!y.hasOwnProperty(he)&&Cn(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||Cn(a,o,Me,ve,y,Se)}function ES(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function vO(){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,ee=E.duration;if(M&&ee&&ES(U)){for(U=0,ee=E.responseEnd,y+=1;y<h.length;y++){var ae=h[y],xe=ae.startTime;if(xe>ee)break;var we=ae.transferSize,Me=ae.initiatorType;we&&ES(Me)&&(ae=ae.responseEnd,U+=we*(ae<ee?1:(ee-xe)/(ae-xe)))}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 Qx=null,Zx=null;function _y(a){return a.nodeType===9?a:a.ownerDocument}function wS(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 TS(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 Jx(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 eb=null;function _O(){var a=window.event;return a&&a.type==="popstate"?a===eb?!1:(eb=a,!0):(eb=null,!1)}var CS=typeof setTimeout=="function"?setTimeout:void 0,SO=typeof clearTimeout=="function"?clearTimeout:void 0,AS=typeof Promise=="function"?Promise:void 0,EO=typeof queueMicrotask=="function"?queueMicrotask:typeof AS<"u"?function(a){return AS.resolve(null).then(a).catch(wO)}:CS;function wO(a){setTimeout(function(){throw a})}function eu(a){return a==="head"}function MS(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),Hf(o);return}y--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")y++;else if(h==="html")Xp(a.ownerDocument.documentElement);else if(h==="head"){h=a.ownerDocument.head,Xp(h);for(var M=h.firstChild;M;){var U=M.nextSibling,ee=M.nodeName;M[Pa]||ee==="SCRIPT"||ee==="STYLE"||ee==="LINK"&&M.rel.toLowerCase()==="stylesheet"||h.removeChild(M),M=U}}else h==="body"&&Xp(a.ownerDocument.body);h=E}while(h);Hf(o)}function RS(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 tb(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":tb(h),Vs(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}a.removeChild(h)}}function TO(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[Pa])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=js(a.nextSibling),a===null)break}return null}function CO(a,o,h){if(o==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!h||(a=js(a.nextSibling),a===null))return null;return a}function kS(a,o){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!o||(a=js(a.nextSibling),a===null))return null;return a}function nb(a){return a.data==="$?"||a.data==="$~"}function ib(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function AO(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 js(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 rb=null;function NS(a){a=a.nextSibling;for(var o=0;a;){if(a.nodeType===8){var h=a.data;if(h==="/$"||h==="/&"){if(o===0)return js(a.nextSibling);o--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||o++}a=a.nextSibling}return null}function OS(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 DS(a,o,h){switch(o=_y(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 Xp(a){for(var o=a.attributes;o.length;)a.removeAttributeNode(o[0]);Vs(a)}var Ls=new Map,zS=new Set;function Sy(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var nc=Y.d;Y.d={f:MO,r:RO,D:kO,C:NO,L:OO,m:DO,X:jO,S:zO,M:LO};function MO(){var a=nc.f(),o=te();return a||o}function RO(a){var o=ln(a);o!==null&&o.tag===5&&o.type==="form"?Lp(o):nc.r(a)}var Bf=typeof document>"u"?null:document;function jS(a,o,h){var y=Bf;if(y&&typeof o=="string"&&o){var E=Ui(o);E='link[rel="'+a+'"][href="'+E+'"]',typeof h=="string"&&(E+='[crossorigin="'+h+'"]'),zS.has(E)||(zS.add(E),a={rel:a,crossOrigin:h,href:o},y.querySelector(E)===null&&(o=y.createElement("link"),Sr(o,"link",a),In(o),y.head.appendChild(o)))}}function kO(a){nc.D(a),jS("dns-prefetch",a,null)}function NO(a,o){nc.C(a,o),jS("preconnect",a,o)}function OO(a,o,h){nc.L(a,o,h);var y=Bf;if(y&&a&&o){var E='link[rel="preload"][as="'+Ui(o)+'"]';o==="image"&&h&&h.imageSrcSet?(E+='[imagesrcset="'+Ui(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(E+='[imagesizes="'+Ui(h.imageSizes)+'"]')):E+='[href="'+Ui(a)+'"]';var M=E;switch(o){case"style":M=If(a);break;case"script":M=Uf(a)}Ls.has(M)||(a=g({rel:"preload",href:o==="image"&&h&&h.imageSrcSet?void 0:a,as:o},h),Ls.set(M,a),y.querySelector(E)!==null||o==="style"&&y.querySelector(Kp(M))||o==="script"&&y.querySelector(Wp(M))||(o=y.createElement("link"),Sr(o,"link",a),In(o),y.head.appendChild(o)))}}function DO(a,o){nc.m(a,o);var h=Bf;if(h&&a){var y=o&&typeof o.as=="string"?o.as:"script",E='link[rel="modulepreload"][as="'+Ui(y)+'"][href="'+Ui(a)+'"]',M=E;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":M=Uf(a)}if(!Ls.has(M)&&(a=g({rel:"modulepreload",href:a},o),Ls.set(M,a),h.querySelector(E)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Wp(M)))return}y=h.createElement("link"),Sr(y,"link",a),In(y),h.head.appendChild(y)}}}function zO(a,o,h){nc.S(a,o,h);var y=Bf;if(y&&a){var E=Xr(y).hoistableStyles,M=If(a);o=o||"default";var U=E.get(M);if(!U){var ee={loading:0,preload:null};if(U=y.querySelector(Kp(M)))ee.loading=5;else{a=g({rel:"stylesheet",href:a,"data-precedence":o},h),(h=Ls.get(M))&&ab(a,h);var ae=U=y.createElement("link");In(ae),Sr(ae,"link",a),ae._p=new Promise(function(xe,we){ae.onload=xe,ae.onerror=we}),ae.addEventListener("load",function(){ee.loading|=1}),ae.addEventListener("error",function(){ee.loading|=2}),ee.loading|=4,Ey(U,o,y)}U={type:"stylesheet",instance:U,count:1,state:ee},E.set(M,U)}}}function jO(a,o){nc.X(a,o);var h=Bf;if(h&&a){var y=Xr(h).hoistableScripts,E=Uf(a),M=y.get(E);M||(M=h.querySelector(Wp(E)),M||(a=g({src:a,async:!0},o),(o=Ls.get(E))&&sb(a,o),M=h.createElement("script"),In(M),Sr(M,"link",a),h.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},y.set(E,M))}}function LO(a,o){nc.M(a,o);var h=Bf;if(h&&a){var y=Xr(h).hoistableScripts,E=Uf(a),M=y.get(E);M||(M=h.querySelector(Wp(E)),M||(a=g({src:a,async:!0,type:"module"},o),(o=Ls.get(E))&&sb(a,o),M=h.createElement("script"),In(M),Sr(M,"link",a),h.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},y.set(E,M))}}function LS(a,o,h,y){var E=(E=de.current)?Sy(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=If(h.href),h=Xr(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=If(h.href);var M=Xr(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(Kp(a)))&&!M._p&&(U.instance=M,U.state.loading=5),Ls.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},Ls.set(a,h),M||BO(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=Uf(h),h=Xr(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 If(a){return'href="'+Ui(a)+'"'}function Kp(a){return'link[rel="stylesheet"]['+a+"]"}function BS(a){return g({},a,{"data-precedence":a.precedence,precedence:null})}function BO(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}),Sr(o,"link",h),In(o),a.head.appendChild(o))}function Uf(a){return'[src="'+Ui(a)+'"]'}function Wp(a){return"script[async]"+a}function IS(a,o,h){if(o.count++,o.instance===null)switch(o.type){case"style":var y=a.querySelector('style[data-href~="'+Ui(h.href)+'"]');if(y)return o.instance=y,In(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"),In(y),Sr(y,"style",E),Ey(y,h.precedence,a),o.instance=y;case"stylesheet":E=If(h.href);var M=a.querySelector(Kp(E));if(M)return o.state.loading|=4,o.instance=M,In(M),M;y=BS(h),(E=Ls.get(E))&&ab(y,E),M=(a.ownerDocument||a).createElement("link"),In(M);var U=M;return U._p=new Promise(function(ee,ae){U.onload=ee,U.onerror=ae}),Sr(M,"link",y),o.state.loading|=4,Ey(M,h.precedence,a),o.instance=M;case"script":return M=Uf(h.src),(E=a.querySelector(Wp(M)))?(o.instance=E,In(E),E):(y=h,(E=Ls.get(M))&&(y=g({},h),sb(y,E)),a=a.ownerDocument||a,E=a.createElement("script"),In(E),Sr(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,Ey(y,h.precedence,a));return o.instance}function Ey(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 ee=y[U];if(ee.dataset.precedence===o)M=ee;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 ab(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.title==null&&(a.title=o.title)}function sb(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.integrity==null&&(a.integrity=o.integrity)}var wy=null;function US(a,o,h){if(wy===null){var y=new Map,E=wy=new Map;E.set(h,y)}else E=wy,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[Pa]||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 ee=y.get(U);ee?ee.push(M):y.set(U,[M])}}return y}function HS(a,o,h){a=a.ownerDocument||a,a.head.insertBefore(h,o==="title"?a.querySelector("head > title"):null)}function IO(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 PS(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function UO(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=If(y.href),M=o.querySelector(Kp(E));if(M){o=M._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=Ty.bind(a),o.then(a,a)),h.state.loading|=4,h.instance=M,In(M);return}M=o.ownerDocument||o,y=BS(y),(E=Ls.get(E))&&ab(y,E),M=M.createElement("link"),In(M);var U=M;U._p=new Promise(function(ee,ae){U.onload=ee,U.onerror=ae}),Sr(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=Ty.bind(a),o.addEventListener("load",h),o.addEventListener("error",h))}}var lb=0;function HO(a,o){return a.stylesheets&&a.count===0&&Ay(a,a.stylesheets),0<a.count||0<a.imgCount?function(h){var y=setTimeout(function(){if(a.stylesheets&&Ay(a,a.stylesheets),a.unsuspend){var M=a.unsuspend;a.unsuspend=null,M()}},6e4+o);0<a.imgBytes&&lb===0&&(lb=62500*vO());var E=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Ay(a,a.stylesheets),a.unsuspend)){var M=a.unsuspend;a.unsuspend=null,M()}},(a.imgBytes>lb?50:800)+o);return a.unsuspend=h,function(){a.unsuspend=null,clearTimeout(y),clearTimeout(E)}}:null}function Ty(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ay(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Cy=null;function Ay(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Cy=new Map,o.forEach(PO,a),Cy=null,Ty.call(a))}function PO(a,o){if(!(o.state.loading&4)){var h=Cy.get(a);if(h)var y=h.get(null);else{h=new Map,Cy.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=Ty.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 $p={$$typeof:R,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function FO(a,o,h,y,E,M,U,ee,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=rn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rn(0),this.hiddenUpdates=rn(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 FS(a,o,h,y,E,M,U,ee,ae,xe,we,Me){return a=new FO(a,o,h,U,ae,xe,we,Me,ee),o=1,M===!0&&(o|=24),M=gr(3,null,null,o),a.current=M,M.stateNode=a,o=rp(),o.refCount++,a.pooledCache=o,o.refCount++,M.memoizedState={element:y,isDehydrated:h,cache:o},up(M),a}function qS(a){return a?(a=$l,a):$l}function GS(a,o,h,y,E,M){E=qS(E),y.context===null?y.context=E:y.pendingContext=E,y=Cs(o),y.payload={element:h},M=M===void 0?null:M,M!==null&&(y.callback=M),h=al(a,y,o),h!==null&&(d(h,a,o),ro(h,a,o))}function YS(a,o){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<o?h:o}}function ob(a,o){YS(a,o),(a=a.alternate)&&YS(a,o)}function VS(a){if(a.tag===13||a.tag===31){var o=Wl(a,67108864);o!==null&&d(o,a,67108864),ob(a,67108864)}}function XS(a){if(a.tag===13||a.tag===31){var o=_r();o=qt(o);var h=Wl(a,o);h!==null&&d(h,a,o),ob(a,o)}}var My=!0;function qO(a,o,h,y){var E=O.T;O.T=null;var M=Y.p;try{Y.p=2,cb(a,o,h,y)}finally{Y.p=M,O.T=E}}function GO(a,o,h,y){var E=O.T;O.T=null;var M=Y.p;try{Y.p=8,cb(a,o,h,y)}finally{Y.p=M,O.T=E}}function cb(a,o,h,y){if(My){var E=ub(y);if(E===null)Wx(a,o,y,Ry,h),WS(a,y);else if(VO(E,a,o,h,y))y.stopPropagation();else if(WS(a,y),o&4&&-1<YO.indexOf(a)){for(;E!==null;){var M=ln(E);if(M!==null)switch(M.tag){case 3:if(M=M.stateNode,M.current.memoizedState.isDehydrated){var U=Ei(M.pendingLanes);if(U!==0){var ee=M;for(ee.pendingLanes|=2,ee.entangledLanes|=2;U;){var ae=1<<31-Ft(U);ee.entanglements[1]|=ae,U&=~ae}po(M),(Bt&6)===0&&(da=Qt()+500,Gp(0))}}break;case 31:case 13:ee=Wl(M,2),ee!==null&&d(ee,M,2),te(),ob(M,2)}if(M=ub(y),M===null&&Wx(a,o,y,Ry,h),M===E)break;E=M}E!==null&&y.stopPropagation()}else Wx(a,o,y,null,h)}}function ub(a){return a=yt(a),db(a)}var Ry=null;function db(a){if(Ry=null,a=sn(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 Ry=a,null}function KS(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(ur()){case Ee:return 2;case ke:return 8;case ce:case Pe:return 32;case ct:return 268435456;default:return 32}default:return 32}}var fb=!1,tu=null,nu=null,iu=null,Qp=new Map,Zp=new Map,ru=[],YO="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 WS(a,o){switch(a){case"focusin":case"focusout":tu=null;break;case"dragenter":case"dragleave":nu=null;break;case"mouseover":case"mouseout":iu=null;break;case"pointerover":case"pointerout":Qp.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zp.delete(o.pointerId)}}function Jp(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=ln(o),o!==null&&VS(o)),a):(a.eventSystemFlags|=y,o=a.targetContainers,E!==null&&o.indexOf(E)===-1&&o.push(E),a)}function VO(a,o,h,y,E){switch(o){case"focusin":return tu=Jp(tu,a,o,h,y,E),!0;case"dragenter":return nu=Jp(nu,a,o,h,y,E),!0;case"mouseover":return iu=Jp(iu,a,o,h,y,E),!0;case"pointerover":var M=E.pointerId;return Qp.set(M,Jp(Qp.get(M)||null,a,o,h,y,E)),!0;case"gotpointercapture":return M=E.pointerId,Zp.set(M,Jp(Zp.get(M)||null,a,o,h,y,E)),!0}return!1}function $S(a){var o=sn(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,$i(a.priority,function(){XS(h)});return}}else if(o===31){if(o=c(h),o!==null){a.blockedOn=o,$i(a.priority,function(){XS(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 ky(a){if(a.blockedOn!==null)return!1;for(var o=a.targetContainers;0<o.length;){var h=ub(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=ln(h),o!==null&&VS(o),a.blockedOn=h,!1;o.shift()}return!0}function QS(a,o,h){ky(a)&&h.delete(o)}function XO(){fb=!1,tu!==null&&ky(tu)&&(tu=null),nu!==null&&ky(nu)&&(nu=null),iu!==null&&ky(iu)&&(iu=null),Qp.forEach(QS),Zp.forEach(QS)}function Ny(a,o){a.blockedOn===o&&(a.blockedOn=null,fb||(fb=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,XO)))}var Oy=null;function ZS(a){Oy!==a&&(Oy=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Oy===a&&(Oy=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(db(y||h)===null)continue;break}var M=ln(h);M!==null&&(a.splice(o,3),o-=3,jp(M,{pending:!0,data:E,method:h.method,action:y},y,E))}}))}function Hf(a){function o(ae){return Ny(ae,a)}tu!==null&&Ny(tu,a),nu!==null&&Ny(nu,a),iu!==null&&Ny(iu,a),Qp.forEach(o),Zp.forEach(o);for(var h=0;h<ru.length;h++){var y=ru[h];y.blockedOn===a&&(y.blockedOn=null)}for(;0<ru.length&&(h=ru[0],h.blockedOn===null);)$S(h),h.blockedOn===null&&ru.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[fi]||null;if(typeof M=="function")U||ZS(h);else if(U){var ee=null;if(M&&M.hasAttribute("formAction")){if(E=M,U=M[fi]||null)ee=U.formAction;else if(db(E)!==null)continue}else ee=U.action;typeof ee=="function"?h[y+1]=ee:(h.splice(y,3),y-=3),ZS(h)}}}function JS(){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 hb(a){this._internalRoot=a}Dy.prototype.render=hb.prototype.render=function(a){var o=this._internalRoot;if(o===null)throw Error(i(409));var h=o.current,y=_r();GS(h,y,a,o,null,null)},Dy.prototype.unmount=hb.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var o=a.containerInfo;GS(a.current,2,null,a,null,null),te(),o[Vr]=null}};function Dy(a){this._internalRoot=a}Dy.prototype.unstable_scheduleHydration=function(a){if(a){var o=dr();a={blockedOn:null,target:a,priority:o};for(var h=0;h<ru.length&&o!==0&&o<ru[h].priority;h++);ru.splice(h,0,a),h===0&&$S(a)}};var eE=t.version;if(eE!=="19.2.4")throw Error(i(527,eE,"19.2.4"));Y.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 KO={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zy=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zy.isDisabled&&zy.supportsFiber)try{Zt=zy.inject(KO),Jt=zy}catch{}}return tm.createRoot=function(a,o){if(!r(a))throw Error(i(299));var h=!1,y="",E=Up,M=fy,U=Ef;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=FS(a,1,!1,null,null,h,y,null,E,M,U,JS),a[Vr]=o.current,Kx(a),new hb(o)},tm.hydrateRoot=function(a,o,h){if(!r(a))throw Error(i(299));var y=!1,E="",M=Up,U=fy,ee=Ef,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&&(ee=h.onRecoverableError),h.formState!==void 0&&(ae=h.formState)),o=FS(a,1,!0,o,h??null,y,E,ae,M,U,ee,JS),o.context=qS(null),h=o.current,y=_r(),y=qt(y),E=Cs(y),E.callback=null,al(h,E,y),h=y,o.current.lanes=h,an(o,h),po(o),a[Vr]=o.current,Kx(a),new Dy(o)},tm.version="19.2.4",tm}var dE;function a3(){if(dE)return gb.exports;dE=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(),gb.exports=r3(),gb.exports}var s3=a3();/**
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 fE="popstate";function hE(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function l3(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 Kv("",{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:Im(r)}return c3(t,n,null,e)}function Zn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ml(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function o3(){return Math.random().toString(36).substring(2,10)}function pE(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 Kv(e,t,n=null,i,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Mh(t):t,state:n,key:t&&t.key||i||o3(),unstable_mask:r}}function Im({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 Mh(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 c3(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 b(T,C){c="PUSH";let N=hE(T)?T:Kv(A.location,T,C);p=m()+1;let R=pE(N,p),z=A.createHref(N.unstable_mask||N);try{l.pushState(R,"",z)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;r.location.assign(z)}s&&f&&f({action:c,location:A.location,delta:1})}function _(T,C){c="REPLACE";let N=hE(T)?T:Kv(A.location,T,C);p=m();let R=pE(N,p),z=A.createHref(N.unstable_mask||N);l.replaceState(R,"",z),s&&f&&f({action:c,location:A.location,delta:0})}function S(T){return u3(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(fE,g),f=T,()=>{r.removeEventListener(fE,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:b,replace:_,go(T){return l.go(T)}};return A}function u3(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Zn(n,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:Im(e);return i=i.replace(/ $/,"%20"),!t&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function LC(e,t,n="/"){return d3(e,t,n,!1)}function d3(e,t,n,i){let r=typeof t=="string"?Mh(t):t,s=hc(r.pathname||"/",n);if(s==null)return null;let l=BC(e);f3(l);let c=null;for(let f=0;c==null&&f<l.length;++f){let p=E3(s);c=_3(l[f],p,i)}return c}function BC(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;Zn(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=_o([i,m.relativePath]),b=n.concat(m);l.children&&l.children.length>0&&(Zn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),BC(l.children,t,b,g,f)),!(l.path==null&&!l.index)&&t.push({path:g,score:b3(g,l.index),routesMeta:b})};return e.forEach((l,c)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))s(l,c);else for(let p of IC(l.path))s(l,c,!0,p)}),t}function IC(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=IC(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 f3(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:v3(t.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var h3=/^:[\w-]+$/,p3=3,m3=2,g3=1,y3=10,x3=-2,mE=e=>e==="*";function b3(e,t){let n=e.split("/"),i=n.length;return n.some(mE)&&(i+=x3),t&&(i+=m3),n.filter(r=>!mE(r)).reduce((r,s)=>r+(h3.test(s)?p3:s===""?g3:y3),i)}function v3(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 _3(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=O0({path:f.relativePath,caseSensitive:f.caseSensitive,end:p},m),b=f.route;if(!g&&p&&n&&!i[i.length-1].route.index&&(g=O0({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(r,g.params),l.push({params:r,pathname:_o([s,g.pathname]),pathnameBase:A3(_o([s,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(s=_o([s,g.pathnameBase]))}return l}function O0(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,i]=S3(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},b)=>{if(m==="*"){let S=c[b]||"";l=s.slice(0,s.length-S.length).replace(/(.)\/+$/,"$1")}const _=c[b];return g&&!_?p[m]=void 0:p[m]=(_||"").replace(/%2F/g,"/"),p},{}),pathname:s,pathnameBase:l,pattern:e}}function S3(e,t=!1,n=!0){Ml(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 E3(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ml(!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 hc(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 w3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function T3(e,t="/"){let{pathname:n,search:i="",hash:r=""}=typeof e=="string"?Mh(e):e,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=gE(n.substring(1),"/"):s=gE(n,t)):s=t,{pathname:s,search:M3(i),hash:R3(r)}}function gE(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 vb(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 C3(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function e_(e){let t=C3(e);return t.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase)}function rx(e,t,n,i=!1){let r;typeof e=="string"?r=Mh(e):(r={...e},Zn(!r.pathname||!r.pathname.includes("?"),vb("?","pathname","search",r)),Zn(!r.pathname||!r.pathname.includes("#"),vb("#","pathname","hash",r)),Zn(!r.search||!r.search.includes("#"),vb("#","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 b=l.split("/");for(;b[0]==="..";)b.shift(),g-=1;r.pathname=b.join("/")}c=g>=0?t[g]:"/"}let f=T3(r,c),p=l&&l!=="/"&&l.endsWith("/"),m=(s||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(p||m)&&(f.pathname+="/"),f}var _o=e=>e.join("/").replace(/\/\/+/g,"/"),A3=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),M3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,R3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,k3=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 N3(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function O3(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var UC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function HC(e,t){let n=e;if(typeof n!="string"||!w3.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let i=n,r=!1;if(UC)try{let s=new URL(window.location.href),l=n.startsWith("//")?new URL(s.protocol+n):new URL(n),c=hc(l.pathname,t);l.origin===s.origin&&c!=null?n=c+l.search+l.hash:r=!0}catch{Ml(!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 PC=["POST","PUT","PATCH","DELETE"];new Set(PC);var D3=["GET",...PC];new Set(D3);var Rh=B.createContext(null);Rh.displayName="DataRouter";var ax=B.createContext(null);ax.displayName="DataRouterState";var z3=B.createContext(!1),FC=B.createContext({isTransitioning:!1});FC.displayName="ViewTransition";var j3=B.createContext(new Map);j3.displayName="Fetchers";var L3=B.createContext(null);L3.displayName="Await";var fs=B.createContext(null);fs.displayName="Navigation";var ig=B.createContext(null);ig.displayName="Location";var kl=B.createContext({outlet:null,matches:[],isDataRoute:!1});kl.displayName="Route";var t_=B.createContext(null);t_.displayName="RouteError";var qC="REACT_ROUTER_ERROR",B3="REDIRECT",I3="ROUTE_ERROR_RESPONSE";function U3(e){if(e.startsWith(`${qC}:${B3}:{`))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 H3(e){if(e.startsWith(`${qC}:${I3}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new k3(t.status,t.statusText,t.data)}catch{}}function P3(e,{relative:t}={}){Zn(kh(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=B.useContext(fs),{hash:r,pathname:s,search:l}=rg(e,{relative:t}),c=s;return n!=="/"&&(c=s==="/"?n:_o([n,s])),i.createHref({pathname:c,search:l,hash:r})}function kh(){return B.useContext(ig)!=null}function Nl(){return Zn(kh(),"useLocation() may be used only in the context of a <Router> component."),B.useContext(ig).location}var GC="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function YC(e){B.useContext(fs).static||B.useLayoutEffect(e)}function sx(){let{isDataRoute:e}=B.useContext(kl);return e?n4():F3()}function F3(){Zn(kh(),"useNavigate() may be used only in the context of a <Router> component.");let e=B.useContext(Rh),{basename:t,navigator:n}=B.useContext(fs),{matches:i}=B.useContext(kl),{pathname:r}=Nl(),s=JSON.stringify(e_(i)),l=B.useRef(!1);return YC(()=>{l.current=!0}),B.useCallback((f,p={})=>{if(Ml(l.current,GC),!l.current)return;if(typeof f=="number"){n.go(f);return}let m=rx(f,JSON.parse(s),r,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:_o([t,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[t,n,s,r,e])}var q3=B.createContext(null);function G3(e){let t=B.useContext(kl).outlet;return B.useMemo(()=>t&&B.createElement(q3.Provider,{value:e},t),[t,e])}function rg(e,{relative:t}={}){let{matches:n}=B.useContext(kl),{pathname:i}=Nl(),r=JSON.stringify(e_(n));return B.useMemo(()=>rx(e,JSON.parse(r),i,t==="path"),[e,r,i,t])}function Y3(e,t){return VC(e,t)}function VC(e,t,n){var T;Zn(kh(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=B.useContext(fs),{matches:r}=B.useContext(kl),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||"";KC(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=Nl(),g;if(t){let C=typeof t=="string"?Mh(t):t;Zn(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 b=g.pathname||"/",_=b;if(f!=="/"){let C=f.replace(/^\//,"").split("/");_="/"+b.replace(/^\//,"").split("/").slice(C.length).join("/")}let S=LC(e,{pathname:_});Ml(p||S!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Ml(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=$3(S&&S.map(C=>Object.assign({},C,{params:Object.assign({},l,C.params),pathname:_o([f,i.encodeLocation?i.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?f:_o([f,i.encodeLocation?i.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),r,n);return t&&A?B.createElement(ig.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},A):A}function V3(){let e=t4(),t=N3(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=B.createElement(B.Fragment,null,B.createElement("p",null,"💿 Hey developer 👋"),B.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",B.createElement("code",{style:s},"ErrorBoundary")," or"," ",B.createElement("code",{style:s},"errorElement")," prop on your route.")),B.createElement(B.Fragment,null,B.createElement("h2",null,"Unexpected Application Error!"),B.createElement("h3",{style:{fontStyle:"italic"}},t),n?B.createElement("pre",{style:r},n):null,l)}var X3=B.createElement(V3,null),XC=class extends B.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=H3(e.digest);n&&(e=n)}let t=e!==void 0?B.createElement(kl.Provider,{value:this.props.routeContext},B.createElement(t_.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?B.createElement(K3,{error:e},t):t}};XC.contextType=z3;var _b=new WeakMap;function K3({children:e,error:t}){let{basename:n}=B.useContext(fs);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let i=U3(t.digest);if(i){let r=_b.get(t);if(r)throw r;let s=HC(i.location,n);if(UC&&!_b.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 _b.set(t,l),l}return B.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function W3({routeContext:e,match:t,children:n}){let i=B.useContext(Rh);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),B.createElement(kl.Provider,{value:e},n)}function $3(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);Zn(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:b,errors:_}=i,S=g.route.loader&&!b.hasOwnProperty(g.route.id)&&(!_||_[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 b,_;f(m,{location:i.location,params:((_=(b=i.matches)==null?void 0:b[0])==null?void 0:_.params)??{},unstable_pattern:O3(i.matches),errorInfo:g})}:void 0;return r.reduceRight((m,g,b)=>{let _,S=!1,A=null,T=null;i&&(_=s&&g.route.id?s[g.route.id]:void 0,A=g.route.errorElement||X3,l&&(c<0&&b===0?(KC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,T=null):c===b&&(S=!0,T=g.route.hydrateFallbackElement||null)));let C=t.concat(r.slice(0,b+1)),N=()=>{let R;return _?R=A:S?R=T:g.route.Component?R=B.createElement(g.route.Component,null):g.route.element?R=g.route.element:R=m,B.createElement(W3,{match:g,routeContext:{outlet:m,matches:C,isDataRoute:i!=null},children:R})};return i&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?B.createElement(XC,{location:i.location,revalidation:i.revalidation,component:A,error:_,children:N(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:p}):N()},null)}function n_(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Q3(e){let t=B.useContext(Rh);return Zn(t,n_(e)),t}function Z3(e){let t=B.useContext(ax);return Zn(t,n_(e)),t}function J3(e){let t=B.useContext(kl);return Zn(t,n_(e)),t}function i_(e){let t=J3(e),n=t.matches[t.matches.length-1];return Zn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function e4(){return i_("useRouteId")}function t4(){var i;let e=B.useContext(t_),t=Z3("useRouteError"),n=i_("useRouteError");return e!==void 0?e:(i=t.errors)==null?void 0:i[n]}function n4(){let{router:e}=Q3("useNavigate"),t=i_("useNavigate"),n=B.useRef(!1);return YC(()=>{n.current=!0}),B.useCallback(async(r,s={})=>{Ml(n.current,GC),n.current&&(typeof r=="number"?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...s}))},[e,t])}var yE={};function KC(e,t,n){!t&&!yE[e]&&(yE[e]=!0,Ml(!1,n))}B.memo(i4);function i4({routes:e,future:t,state:n,isStatic:i,onError:r}){return VC(e,void 0,{state:n,isStatic:i,onError:r})}function r4({to:e,replace:t,state:n,relative:i}){Zn(kh(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=B.useContext(fs);Ml(!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}=B.useContext(kl),{pathname:l}=Nl(),c=sx(),f=rx(e,e_(s),l,i==="path"),p=JSON.stringify(f);return B.useEffect(()=>{c(JSON.parse(p),{replace:t,state:n,relative:i})},[c,p,i,t,n]),null}function xE(e){return G3(e.context)}function Pr(e){Zn(!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 a4({basename:e="/",children:t=null,location:n,navigationType:i="POP",navigator:r,static:s=!1,unstable_useTransitions:l}){Zn(!kh(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),f=B.useMemo(()=>({basename:c,navigator:r,static:s,unstable_useTransitions:l,future:{}}),[c,r,s,l]);typeof n=="string"&&(n=Mh(n));let{pathname:p="/",search:m="",hash:g="",state:b=null,key:_="default",unstable_mask:S}=n,A=B.useMemo(()=>{let T=hc(p,c);return T==null?null:{location:{pathname:T,search:m,hash:g,state:b,key:_,unstable_mask:S},navigationType:i}},[c,p,m,g,b,_,i,S]);return Ml(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:B.createElement(fs.Provider,{value:f},B.createElement(ig.Provider,{children:t,value:A}))}function s4({children:e,location:t}){return Y3(Wv(e),t)}function Wv(e,t=[]){let n=[];return B.Children.forEach(e,(i,r)=>{if(!B.isValidElement(i))return;let s=[...t,r];if(i.type===B.Fragment){n.push.apply(n,Wv(i.props.children,s));return}Zn(i.type===Pr,`[${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>`),Zn(!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=Wv(i.props.children,s)),n.push(l)}),n}var _0="get",S0="application/x-www-form-urlencoded";function lx(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function l4(e){return lx(e)&&e.tagName.toLowerCase()==="button"}function o4(e){return lx(e)&&e.tagName.toLowerCase()==="form"}function c4(e){return lx(e)&&e.tagName.toLowerCase()==="input"}function u4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function d4(e,t){return e.button===0&&(!t||t==="_self")&&!u4(e)}var jy=null;function f4(){if(jy===null)try{new FormData(document.createElement("form"),0),jy=!1}catch{jy=!0}return jy}var h4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Sb(e){return e!=null&&!h4.has(e)?(Ml(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${S0}"`),null):e}function p4(e,t){let n,i,r,s,l;if(o4(e)){let c=e.getAttribute("action");i=c?hc(c,t):null,n=e.getAttribute("method")||_0,r=Sb(e.getAttribute("enctype"))||S0,s=new FormData(e)}else if(l4(e)||c4(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?hc(f,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||_0,r=Sb(e.getAttribute("formenctype"))||Sb(c.getAttribute("enctype"))||S0,s=new FormData(c,e),!f4()){let{name:p,type:m,value:g}=e;if(m==="image"){let b=p?`${p}.`:"";s.append(`${b}x`,"0"),s.append(`${b}y`,"0")}else p&&s.append(p,g)}}else{if(lx(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=_0,i=null,r=S0,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 r_(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function m4(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&&hc(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${i}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${i}`,r}async function g4(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 y4(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 x4(e,t,n){let i=await Promise.all(e.map(async r=>{let s=t.routes[r.route.id];if(s){let l=await g4(s,n);return l.links?l.links():[]}return[]}));return S4(i.flat(1).filter(y4).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function bE(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 b=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 b=="boolean")return b}return!0}):[]}function b4(e,t,{includeHydrateFallback:n}={}){return v4(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 v4(e){return[...new Set(e)]}function _4(e){let t={},n=Object.keys(e).sort();for(let i of n)t[i]=e[i];return t}function S4(e,t){let n=new Set;return new Set(t),e.reduce((i,r)=>{let s=JSON.stringify(_4(r));return n.has(s)||(n.add(s),i.push({key:s,link:r})),i},[])}function WC(){let e=B.useContext(Rh);return r_(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function E4(){let e=B.useContext(ax);return r_(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var a_=B.createContext(void 0);a_.displayName="FrameworkContext";function $C(){let e=B.useContext(a_);return r_(e,"You must render this element inside a <HydratedRouter> element"),e}function w4(e,t){let n=B.useContext(a_),[i,r]=B.useState(!1),[s,l]=B.useState(!1),{onFocus:c,onBlur:f,onMouseEnter:p,onMouseLeave:m,onTouchStart:g}=t,b=B.useRef(null);B.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let A=C=>{C.forEach(N=>{l(N.isIntersecting)})},T=new IntersectionObserver(A,{threshold:.5});return b.current&&T.observe(b.current),()=>{T.disconnect()}}},[e]),B.useEffect(()=>{if(i){let A=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(A)}}},[i]);let _=()=>{r(!0)},S=()=>{r(!1),l(!1)};return n?e!=="intent"?[s,b,{}]:[s,b,{onFocus:nm(c,_),onBlur:nm(f,S),onMouseEnter:nm(p,_),onMouseLeave:nm(m,S),onTouchStart:nm(g,_)}]:[!1,b,{}]}function nm(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function T4({page:e,...t}){let{router:n}=WC(),i=B.useMemo(()=>LC(n.routes,e,n.basename),[n.routes,e,n.basename]);return i?B.createElement(A4,{page:e,matches:i,...t}):null}function C4(e){let{manifest:t,routeModules:n}=$C(),[i,r]=B.useState([]);return B.useEffect(()=>{let s=!1;return x4(e,t,n).then(l=>{s||r(l)}),()=>{s=!0}},[e,t,n]),i}function A4({page:e,matches:t,...n}){let i=Nl(),{future:r,manifest:s,routeModules:l}=$C(),{basename:c}=WC(),{loaderData:f,matches:p}=E4(),m=B.useMemo(()=>bE(e,t,p,s,i,"data"),[e,t,p,s,i]),g=B.useMemo(()=>bE(e,t,p,s,i,"assets"),[e,t,p,s,i]),b=B.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let A=new Set,T=!1;if(t.forEach(N=>{var z;let R=s.routes[N.route.id];!R||!R.hasLoader||(!m.some(L=>L.route.id===N.route.id)&&N.route.id in f&&((z=l[N.route.id])!=null&&z.shouldRevalidate)||R.hasClientLoader?T=!0:A.add(N.route.id))}),A.size===0)return[];let C=m4(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]),_=B.useMemo(()=>b4(g,s),[g,s]),S=C4(g);return B.createElement(B.Fragment,null,b.map(A=>B.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...n})),_.map(A=>B.createElement("link",{key:A,rel:"modulepreload",href:A,...n})),S.map(({key:A,link:T})=>B.createElement("link",{key:A,nonce:n.nonce,...T,crossOrigin:T.crossOrigin??n.crossOrigin})))}function M4(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var R4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{R4&&(window.__reactRouterVersion="7.13.1")}catch{}function k4({basename:e,children:t,unstable_useTransitions:n,window:i}){let r=B.useRef();r.current==null&&(r.current=l3({window:i,v5Compat:!0}));let s=r.current,[l,c]=B.useState({action:s.action,location:s.location}),f=B.useCallback(p=>{n===!1?c(p):B.startTransition(()=>c(p))},[n]);return B.useLayoutEffect(()=>s.listen(f),[s,f]),B.createElement(a4,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:s,unstable_useTransitions:n})}var QC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ZC=B.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:b,unstable_defaultShouldRevalidate:_,...S},A){let{basename:T,navigator:C,unstable_useTransitions:N}=B.useContext(fs),R=typeof m=="string"&&QC.test(m),z=HC(m,T);m=z.to;let L=P3(m,{relative:r}),D=Nl(),F=null;if(c){let W=rx(c,[],D.unstable_mask?D.unstable_mask.pathname:"/",!0);T!=="/"&&(W.pathname=W.pathname==="/"?T:_o([T,W.pathname])),F=C.createHref(W)}let[Z,K,V]=w4(i,S),P=D4(m,{replace:l,unstable_mask:c,state:f,target:p,preventScrollReset:g,relative:r,viewTransition:b,unstable_defaultShouldRevalidate:_,unstable_useTransitions:N});function G(W){t&&t(W),W.defaultPrevented||P(W)}let ne=!(z.isExternal||s),X=B.createElement("a",{...S,...V,href:(ne?F:void 0)||z.absoluteURL||L,onClick:ne?G:t,ref:M4(A,K),target:p,"data-discover":!R&&n==="render"?"true":void 0});return Z&&!R?B.createElement(B.Fragment,null,X,B.createElement(T4,{page:L})):X});ZC.displayName="Link";var JC=B.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=rg(l,{relative:p.relative}),b=Nl(),_=B.useContext(ax),{navigator:S,basename:A}=B.useContext(fs),T=_!=null&&I4(g)&&c===!0,C=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,N=b.pathname,R=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;n||(N=N.toLowerCase(),R=R?R.toLowerCase():null,C=C.toLowerCase()),R&&A&&(R=hc(R,A)||R);const z=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let L=N===C||!r&&N.startsWith(C)&&N.charAt(z)==="/",D=R!=null&&(R===C||!r&&R.startsWith(C)&&R.charAt(C.length)==="/"),F={isActive:L,isPending:D,isTransitioning:T},Z=L?t:void 0,K;typeof i=="function"?K=i(F):K=[i,L?"active":null,D?"pending":null,T?"transitioning":null].filter(Boolean).join(" ");let V=typeof s=="function"?s(F):s;return B.createElement(ZC,{...p,"aria-current":Z,className:K,ref:m,style:V,to:l,viewTransition:c},typeof f=="function"?f(F):f)});JC.displayName="NavLink";var N4=B.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:i,replace:r,state:s,method:l=_0,action:c,onSubmit:f,relative:p,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:b,..._},S)=>{let{unstable_useTransitions:A}=B.useContext(fs),T=L4(),C=B4(c,{relative:p}),N=l.toLowerCase()==="get"?"get":"post",R=typeof c=="string"&&QC.test(c),z=L=>{if(f&&f(L),L.defaultPrevented)return;L.preventDefault();let D=L.nativeEvent.submitter,F=(D==null?void 0:D.getAttribute("formmethod"))||l,Z=()=>T(D||L.currentTarget,{fetcherKey:t,method:F,navigate:n,replace:r,state:s,relative:p,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:b});A&&n!==!1?B.startTransition(()=>Z()):Z()};return B.createElement("form",{ref:S,method:N,action:C,onSubmit:i?f:z,..._,"data-discover":!R&&e==="render"?"true":void 0})});N4.displayName="Form";function O4(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function eA(e){let t=B.useContext(Rh);return Zn(t,O4(e)),t}function D4(e,{target:t,replace:n,unstable_mask:i,state:r,preventScrollReset:s,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:f,unstable_useTransitions:p}={}){let m=sx(),g=Nl(),b=rg(e,{relative:l});return B.useCallback(_=>{if(d4(_,t)){_.preventDefault();let S=n!==void 0?n:Im(g)===Im(b),A=()=>m(e,{replace:S,unstable_mask:i,state:r,preventScrollReset:s,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:f});p?B.startTransition(()=>A()):A()}},[g,m,b,n,i,r,t,e,s,l,c,f,p])}var z4=0,j4=()=>`__${String(++z4)}__`;function L4(){let{router:e}=eA("useSubmit"),{basename:t}=B.useContext(fs),n=e4(),i=e.fetch,r=e.navigate;return B.useCallback(async(s,l={})=>{let{action:c,method:f,encType:p,formData:m,body:g}=p4(s,t);if(l.navigate===!1){let b=l.fetcherKey||j4();await i(b,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 B4(e,{relative:t}={}){let{basename:n}=B.useContext(fs),i=B.useContext(kl);Zn(i,"useFormAction must be used inside a RouteContext");let[r]=i.matches.slice(-1),s={...rg(e||".",{relative:t})},l=Nl();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:_o([n,s.pathname])),Im(s)}function I4(e,{relative:t}={}){let n=B.useContext(FC);Zn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=eA("useViewTransitionState"),r=rg(e,{relative:t});if(!n.isTransitioning)return!1;let s=hc(n.currentLocation.pathname,i)||n.currentLocation.pathname,l=hc(n.nextLocation.pathname,i)||n.nextLocation.pathname;return O0(r.pathname,l)!=null||O0(r.pathname,s)!=null}jC();const vE=e=>{let t;const n=new Set,i=(p,m)=>{const g=typeof p=="function"?p(t):p;if(!Object.is(g,t)){const b=t;t=m??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(_=>_(t,b))}},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},U4=(e=>e?vE(e):vE),H4=e=>e;function P4(e,t=H4){const n=vm.useSyncExternalStore(e.subscribe,vm.useCallback(()=>t(e.getState()),[e,t]),vm.useCallback(()=>t(e.getInitialState()),[e,t]));return vm.useDebugValue(n),n}const _E=e=>{const t=U4(e),n=i=>P4(t,i);return Object.assign(n,t),n},bu=(e=>e?_E(e):_E),El=bu(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})})),wr=bu((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 F4=0;function SE(){return`local-${Date.now()}-${++F4}`}const or=bu((e,t)=>({conversations:[],messages:[],conversationId:null,streaming:!1,streamingText:"",activity:null,error:null,addUserMessage:n=>{const i={id:SE(),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:SE(),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(b=>b.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 b=await fetch(`/api/conversations/${g.id}/messages?limit=1`,{credentials:"include"});if(b.ok){const S=((await b.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 q4(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,b,_,S,A,T,C,N,R,z,L,D,F,Z,K,V;try{const P=JSON.parse(c.data),G=e.current;switch(P.type){case"squad:state":(f=G.onSquadState)==null||f.call(G,P.squadName,P.state);break;case"squad:inactive":(p=G.onSquadInactive)==null||p.call(G,P.squadName,P.reason);break;case"chat:chunk":(m=G.onChatChunk)==null||m.call(G,P.squadName,P.conversationId,P.delta);break;case"chat:activity":(g=G.onChatActivity)==null||g.call(G,P.squadName,P.tool,P.summary);break;case"chat:done":(b=G.onChatDone)==null||b.call(G,P.squadName,P.conversationId,P.messageId);break;case"chat:error":(_=G.onChatError)==null||_.call(G,P.squadName,P.error);break;case"chat:agent_dm":(S=G.onChatAgentDm)==null||S.call(G,P.squadName,P.conversationId,P.agentId,P.agentName,P.message);break;case"chat:conversation_created":(A=G.onChatConversationCreated)==null||A.call(G,P.squadName,P.conversationId);break;case"agent:output_chunk":(T=G.onAgentOutputChunk)==null||T.call(G,P.squadName,P.agentId,P.agentName,P.delta);break;case"agent:step_start":(C=G.onAgentStepStart)==null||C.call(G,P.squadName,P.agentId,P.agentName,P.stepIndex,P.stepLabel);break;case"agent:step_complete":(N=G.onAgentStepComplete)==null||N.call(G,P.squadName,P.agentId,P.agentName,P.stepIndex,P.stepLabel);break;case"squad:checkpoint":(R=G.onSquadCheckpoint)==null||R.call(G,P.squadName,P.agentId,P.agentName,P.question);break;case"schedule:started":(z=G.onScheduleStarted)==null||z.call(G,P.squadName,P.jobId,P.attempt);break;case"schedule:chunk":(L=G.onScheduleChunk)==null||L.call(G,P.squadName,P.jobId,P.delta);break;case"schedule:done":(D=G.onScheduleDone)==null||D.call(G,P.squadName,P.jobId,P.summary,P.attempt);break;case"schedule:error":(F=G.onScheduleError)==null||F.call(G,P.squadName,P.jobId,P.error,P.attempt,P.willRetry);break;case"schedule:status_changed":(Z=G.onScheduleStatusChanged)==null||Z.call(G,P.squadName,P.status);break;case"kanban:task_updated":(K=G.onKanbanTaskUpdated)==null||K.call(G,P);break;case"a2ui:update":(V=G.onA2uiUpdate)==null||V.call(G,P.squadName,P.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 G4(e={}){const t=B.useRef(null),n=B.useRef(e),i=B.useRef(new Set);n.current=e,B.useEffect(()=>{const p=q4(n);t.current=p;for(const m of i.current)p.subscribe(m);return()=>{p.disconnect()}},[]);const r=B.useCallback(p=>{var m;i.current.add(p),(m=t.current)==null||m.subscribe(p)},[]),s=B.useCallback(p=>{var m;i.current.delete(p),(m=t.current)==null||m.unsubscribe(p)},[]),l=B.useCallback((p,m,g)=>{var b;(b=t.current)==null||b.sendChat(p,m,g)},[]),c=B.useCallback(p=>{var m;(m=t.current)==null||m.newConversation(p)},[]),f=B.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 Y4(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 V4({state:e}){const[t,n]=B.useState(0);return B.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]),x.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?x.jsxs(x.Fragment,{children:[x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[x.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"}}),x.jsxs("span",{style:{color:"var(--text-secondary)"},children:["Step ",e.step.current,"/",e.step.total]}),x.jsx("span",{style:{color:"var(--border-strong)"},children:"│"}),x.jsx("span",{children:e.step.label})]}),x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[e.handoff&&x.jsxs("span",{style:{color:"var(--accent)"},children:[e.handoff.from," → ",e.handoff.to]}),e.status==="running"&&x.jsx("span",{style:{color:"var(--text-secondary)"},children:Y4(t)})]})]}):x.jsxs(x.Fragment,{children:[x.jsx("span",{children:"Ready"}),x.jsx("span",{children:"ExpxAgents Mission Control"})]})})}let $v=null;function X4(e){$v=e}function tA(e,t,n){$v&&$v(e,t,n)}let Qv=null;function K4(e){Qv=e}function W4(e){Qv&&Qv(e)}let Zv=null;function $4(e){Zv=e}function Q4(e,t){Zv&&Zv(e,t)}const E0=32,bl=96,uu=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},Jv=[5227511,5025616,16750592,15022389,9315498,16771899],Z4={idle:8947848,working:5025616,delivering:5227511,done:5025616,checkpoint:16750592},Ur={counter:4073251,counterTop:6111287,machine:3622735,machineTop:4545124,machineLight:5025616,cup:14142664,cupShadow:12364452,saucer:14735052,sink:7901340,faucet:11583173,menu:5125166},ts={table:6111287,tableTop:7162945,tableEdge:5125166,tableLeg:4073251,chair:3622735,chairSeat:4545124,chairBack:5533306,carpet:2503224,carpetPattern:3030340,whiteboard:15527921,whiteboardFrame:7901340},Sd={background:1713022,backgroundGlow:2635155,statusRunning:5025616,statusIdle:8947848,statusCheckpoint:16750592,statusCompleted:5025616},fu={floor:11579568,tile:11053224,grout:10066329,stripe:12632256},ha={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},Oa={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},fh={wall:7901340,wallHighlight:10795204,doorFrame:6111287},lr={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},Da={floor:14142664,carpet:6323595,carpetBorder:4545124,sofa:5533306,sofaCushion:6323595,sofaArm:4545124,tv:2171169,tvScreen:2503224,tvStand:4342338,sideTable:7951688,magazine:15684432,magazineAlt:4367861},lc=480,rs=360,ud=400,Xi=60,ns=120,Eb=120,EE=160,wE=120,TE=160,J4=64,eD=80,tD=bl+32,nD=uu+48,CE=2,nA=10,ic=80;function Ly(e,t,n){const i=Math.max(0,Math.min(1,n));return e+(t-e)*i}function iD(e){return e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2}const rD=["nw","ne","sw","se"],aD={nw:"right",ne:"left",sw:"top",se:"top"};function D0(e){const t=nA,n=Math.max(1,e),i={nw:0,ne:0,sw:0,se:0},r=[];for(let Q=0;Q<n;Q++){const H=rD[Q%4];r.push({quadrant:H,slot:i[H]}),i[H]++}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(ud,ns),m=s*(rs+t),g=l*(rs+t),b=Math.max(m+p,g+ns),_=c*(rs+t),S=f*(rs+t),A=Math.max(EE,TE),T=Math.max(_+A+t,S+A+t),C=Math.max(lc,ns+t+ud),N=Math.max(lc,ns),R=Math.max(lc,Eb),z=Math.max(lc,wE),L=Math.max(C,R),D=Math.max(N,z),F=t+L+t+Xi+t+D+t,Z=t+b+t+Xi+t+T+t,K={x:t+L+t,y:t,width:Xi,height:Z-2*t},V={x:t,y:t+b+t,width:F-2*t,height:Xi},P={x:K.x+K.width/2,y:V.y+V.height/2},G={x:K.x-t-ud,y:V.y-t-ud,width:ud,height:ud},ne={x:G.x-t-ns,y:V.y-t-ns,width:ns,height:ns},X={x:K.x+Xi+t,y:V.y-t-ns,width:ns,height:ns},W={x:K.x-t-Eb,y:V.y+Xi+t+c*(rs+t),width:Eb,height:EE},O={x:K.x+Xi+t,y:V.y+Xi+t+f*(rs+t),width:wE,height:TE},Y=[],$={};for(let Q=0;Q<n;Q++){const{quadrant:H,slot:I}=r[Q],J=aD[H];let q;H==="nw"?q={x:K.x-t-lc,y:G.y-t-(I+1)*rs-I*t}:H==="ne"?q={x:K.x+Xi+t,y:X.y-t-(I+1)*rs-I*t}:H==="sw"?q={x:K.x-t-lc,y:V.y+Xi+t+I*(rs+t)}:q={x:K.x+Xi+t,y:V.y+Xi+t+I*(rs+t)},Y.push({origin:q,width:lc,height:rs,quadrant:H,doorSide:J}),J==="right"||J==="left"?$[`squad-${Q}`]={x:K.x+Xi/2,y:q.y+rs/2}:$[`squad-${Q}`]={x:q.x+lc/2,y:V.y+Xi/2}}return $.ceo={x:K.x+Xi/2,y:G.y+ud/2},$["bathroom-male"]={x:ne.x+ns/2,y:V.y+Xi/2},$["bathroom-female"]={x:X.x+ns/2,y:V.y+Xi/2},$.kitchen={x:K.x+Xi/2,y:W.y+W.height/2},$["rest-area"]={x:K.x+Xi/2,y:O.y+O.height/2},{totalWidth:F,totalHeight:Z,squadOrigins:Y,ceoOffice:G,corridorH:V,corridorV:K,bathroomMale:ne,bathroomFemale:X,kitchen:W,restArea:O,doorPoints:$,corridorHub:P}}function oh(e,t,n,i){const r=e%CE,s=Math.floor(e/CE);return{x:t.x+J4+r*tD,y:t.y+eD+s*nD}}function Am(e,t,n){return{x:e.x+t-80,y:e.y+n-80}}function iA(e,t,n){return{x:e.x+t-160,y:e.y+Math.floor(n/2)}}function sD(e,t){const n=t==="male"?e.bathroomMale:e.bathroomFemale;return{x:n.x+n.width/2,y:n.y+n.height/2}}function lD(e){return{x:e.kitchen.x+e.kitchen.width/2,y:e.kitchen.y+e.kitchen.height/2}}function oD(e){return{x:e.restArea.x+e.restArea.width/2,y:e.restArea.y+e.restArea.height/2}}function cD(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 AE(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 ME(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 uD(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 Mm(e,t,n,i){const r=i.doorPoints[t],s=i.doorPoints[n];if(!r||!s)return[e];const l=i.corridorHub,c=uD(n,i),f=AE(r,i)&&AE(s,i),p=ME(r,i)&&ME(s,i);return f||p?[e,r,s,c]:[e,r,l,s,c]}function By(e,t){const n=e.x-t.x,i=e.y-t.y;return Math.sqrt(n*n+i*i)}const RE=500,kE=50;let NE=0;function OE(e){return{idle:"idle",working:"working",delivering:"walking",done:"idle",checkpoint:"checkpoint"}[e]??"idle"}const li=bu(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>RE&&(c=c.slice(c.length-RE)),{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:++NE,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>kE?f.slice(f.length-kE):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(_=>[_.id,_])),l={x:0,y:0},c=D0(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,b=n.map((_,S)=>{const A=s.get(_.id);if(A){const N=_.status?OE(_.status):A.status,R=N!==A.status;let z=A.targetPosition;return R&&(N==="working"||N==="checkpoint"?z=oh(S,l):z=Am(l,m,g)),{...A,name:_.name,avatar:_.avatar,deskIndex:S,status:N,targetPosition:z}}const T=_.status?OE(_.status):"idle",C=T==="working"||T==="checkpoint"?oh(S,l):Am(l,m,g);return{id:_.id,name:_.name,avatar:_.avatar,colorIndex:S%6,status:T,deskIndex:S,position:C,targetPosition:null}});return{agentVisuals:{...i.agentVisuals,[t]:b}}}),setAgentStatus:(t,n,i)=>e(r=>{const s=r.agentVisuals[t];if(!s)return r;const l={x:0,y:0},c=D0(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,b=s.map(_=>{if(_.id!==n)return _;let S;return i==="working"||i==="checkpoint"?S=oh(_.deskIndex,l):S=Am(l,m,g),{..._,status:i,targetPosition:S}});return{agentVisuals:{...r.agentVisuals,[t]:b}}}),reset:()=>{NE=0,e({rooms:[],activeRoom:null,bubbles:{},activityLog:{},checkpoints:{},agentVisuals:{}})}})),mQ={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"},dD={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 rA=0;function fD(){return`jarvis-${Date.now()}-${++rA}`}let mo=null;const wb=bu((e,t)=>({mode:"STANDBY",messages:[],streamingText:"",selectedSquad:null,userName:"",setMode:n=>e({mode:n}),addMessage:(n,i)=>{const r={id:fD(),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:()=>{mo&&clearTimeout(mo),mo=setTimeout(()=>{e({mode:"STANDBY"}),mo=null},dD.standbyTimeoutMs)},resetStandbyTimer:()=>{t().startStandbyTimer()},clearStandbyTimer:()=>{mo&&(clearTimeout(mo),mo=null)},reset:()=>{mo&&(clearTimeout(mo),mo=null),rA=0,e({mode:"STANDBY",messages:[],streamingText:"",selectedSquad:null,userName:""})}})),ma=bu((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}}))}}})),hD=600*1e3;function pD(){const[e,t]=B.useState(null),[n,i]=B.useState(!1),[r,s]=B.useState(!1),l=B.useCallback(async()=>{try{const f=await fetch("/api/system/version",{credentials:"include"});if(f.ok){const p=await f.json();t(p)}}catch{}},[]);B.useEffect(()=>{l();const f=setInterval(l,hD);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:x.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?x.jsxs("span",{style:{color:"var(--accent)"},children:["Updating to v",e.latest,"... Server will restart automatically."]}):x.jsxs(x.Fragment,{children:[x.jsxs("span",{children:["New version available: ",x.jsxs("strong",{style:{color:"var(--accent)"},children:["v",e.latest]}),x.jsxs("span",{style:{color:"var(--text-muted)",marginLeft:6},children:["(current: v",e.current,")"]})]}),x.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"}),x.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 mD(){if(typeof window>"u")return"dark";const e=localStorage.getItem("expx-theme");return e==="light"||e==="dark"?e:"dark"}function DE(e){document.documentElement.setAttribute("data-theme",e),localStorage.setItem("expx-theme",e)}const z0=bu((e,t)=>({theme:mD(),toggle:()=>{const n=t().theme==="dark"?"light":"dark";DE(n),e({theme:n})},setTheme:n=>{DE(n),e({theme:n})}})),gD=B.lazy(()=>mu(()=>import("./ThreeBackground-DfKi4-Pv.js"),__vite__mapDeps([0,1])).then(e=>({default:e.ThreeBackground}))),yD=[{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 xD(){const e=El(ie=>ie.user),t=El(ie=>ie.isAuthenticated),n=El(ie=>ie.loading),i=El(ie=>ie.logout),r=El(ie=>ie.checkAuth),s=sx(),l=Nl();l.pathname==="/office"||l.pathname;const c=l.pathname==="/jarvis",f=z0(ie=>ie.theme),p=z0(ie=>ie.toggle),m=wr(ie=>ie.squads),g=wr(ie=>ie.selectedSquad),b=wr(ie=>g?ie.activeStates[g]:null),_=wr(ie=>ie.fetchSquads),S=wr(ie=>ie.setSquadState),A=wr(ie=>ie.clearSquadState),T=B.useCallback((ie,de)=>{S(ie,de);const me=li.getState();me.rooms.includes(ie)||me.syncRooms([...me.rooms,ie]),de.status!=="checkpoint"&&me.clearCheckpoint(ie),de.agents&&me.setAgents(ie,de.agents.map(ge=>({id:ge.id,name:ge.name,status:ge.status})))},[S]),C=B.useCallback(ie=>{A(ie);const de=li.getState(),me=de.agentVisuals[ie];if(me)for(const ge of me)de.setAgentStatus(ie,ge.id,"idle")},[A]),N=B.useCallback((ie,de)=>{or.setState(me=>({conversationId:de,messages:[],conversations:[{id:de,createdAt:new Date().toISOString(),preview:""},...me.conversations.filter(ge=>ge.id!==de)]}))},[]),R=B.useCallback((ie,de,me)=>{if(ie==="_jarvis"){wb.getState().appendChunk(me);return}const ge=or.getState();ge.streaming||ge.startStreaming(),ge.appendChunk(me)},[]),z=B.useCallback((ie,de,me)=>{if(ie==="_jarvis"){wb.getState().finalizeMessage(me);return}or.getState().finishStreaming(me)},[]),L=B.useCallback((ie,de)=>{if(ie==="_jarvis"){wb.getState().setMode("LISTENING");return}or.getState().setError(de)},[]),D=B.useCallback((ie,de,me)=>{ie!=="_jarvis"&&or.getState().setActivity(`${de}${me?" "+me:""}`)},[]),F=B.useCallback((ie,de,me,ge,le)=>{or.getState().addAgentDm({agentId:me,agentName:ge,content:le})},[]),Z=B.useCallback((ie,de,me,ge)=>{li.getState().appendBubble(ie,de,ge)},[]),K=B.useCallback((ie,de,me,ge,le)=>{li.getState().addActivity(ie,me,`started "${le}"`),li.getState().setAgentStatus(ie,de,"working")},[]),V=B.useCallback((ie,de,me,ge,le)=>{li.getState().addActivity(ie,me,`completed "${le}"`),li.getState().setAgentStatus(ie,de,"idle")},[]),P=B.useCallback((ie,de,me,ge)=>{li.getState().setCheckpoint(ie,de,me,ge),li.getState().setAgentStatus(ie,de,"checkpoint")},[]),G=B.useCallback(()=>{li.getState().clearAllBubbles()},[]),ne=B.useCallback((ie,de,me)=>{ma.getState().fetchJobs()},[]),X=B.useCallback((ie,de,me,ge)=>{ma.getState().fetchJobs()},[]),W=B.useCallback((ie,de,me,ge,le)=>{ma.getState().fetchJobs()},[]),O=B.useCallback((ie,de)=>{ma.getState().updateJobStatus(ie,de)},[]),Y=B.useCallback(ie=>{window.dispatchEvent(new CustomEvent("kanban:task_updated",{detail:ie}))},[]),$=B.useCallback((ie,de)=>{wr.getState().setUiComponents(ie,de)},[]),{subscribe:Q,unsubscribe:H,sendChat:I,newConversation:J,sendCheckpointResponse:q}=G4({onSquadState:T,onSquadInactive:C,onChatConversationCreated:N,onChatChunk:R,onChatActivity:D,onChatDone:z,onChatError:L,onChatAgentDm:F,onAgentOutputChunk:Z,onAgentStepStart:K,onAgentStepComplete:V,onSquadCheckpoint:P,onReconnect:G,onScheduleStarted:ne,onScheduleDone:X,onScheduleError:W,onScheduleStatusChanged:O,onKanbanTaskUpdated:Y,onA2uiUpdate:$});B.useEffect(()=>{X4(I)},[I]),B.useEffect(()=>{K4(J)},[J]),B.useEffect(()=>{$4(q)},[q]),B.useEffect(()=>{_().then(()=>{const{squads:ie}=wr.getState();if(ie.length>0){const de=li.getState(),me=ie.map(Re=>Re.code),ge=de.rooms,le=[...new Set([...ge,...me])];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(Le=>({id:Le.id,name:Le.name,avatar:Le.avatar,status:"idle"})))}})},[_]);const oe=li(ie=>ie.rooms);return B.useEffect(()=>{for(const ie of oe)Q(ie);return()=>{for(const ie of oe)H(ie)}},[oe,Q,H]),B.useEffect(()=>(Q("_expxagents"),()=>H("_expxagents")),[Q,H]),B.useEffect(()=>{if(c)return Q("_jarvis"),()=>H("_jarvis")},[c,Q,H]),B.useEffect(()=>{t||r()},[]),B.useEffect(()=>{!n&&!t&&s("/login",{state:{from:l.pathname}})},[n,t,s,l.pathname]),c?x.jsx(xE,{}):x.jsxs("div",{className:"noise-bg",style:{display:"flex",flexDirection:"column",height:"100vh",background:"var(--surface-0)",color:"var(--text-primary)"},children:[x.jsxs("header",{"data-layout":"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:[x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[x.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"}),x.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",letterSpacing:"-0.02em"},children:"ExpxAgents"}),x.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"})]}),x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-4)"},children:[x.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"}),x.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"?"☀":"☽"}),x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:[x.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"}}),x.jsx("span",{children:e==null?void 0:e.username})]}),x.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"})]})]}),x.jsx(pD,{}),x.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[x.jsxs("aside",{"data-layout":"sidebar",style:{width:"var(--sidebar-width)",background:"var(--surface-1)",borderRight:"1px solid var(--border-subtle)",display:"flex",flexDirection:"column",overflowY:"auto"},children:[x.jsxs("nav",{style:{padding:"var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-1)",flex:1},children:[x.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"}),yD.map(ie=>x.jsxs(JC,{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:[x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:ie.icon}),ie.label]},ie.to)),x.jsx("div",{style:{height:1,margin:"var(--sp-2) var(--sp-2)",background:"var(--border-subtle)"}}),x.jsxs("a",{href:"/docs",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:400,color:"var(--text-secondary)",background:"transparent",border:"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)"},onMouseEnter:ie=>{ie.currentTarget.style.color="var(--accent)",ie.currentTarget.style.background="var(--accent-glow)",ie.currentTarget.style.borderColor="var(--accent-glow)"},onMouseLeave:ie=>{ie.currentTarget.style.color="var(--text-secondary)",ie.currentTarget.style.background="transparent",ie.currentTarget.style.borderColor="transparent"},children:[x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:"≡"}),"Docs",x.jsx("span",{style:{marginLeft:"auto",fontFamily:"var(--font-mono)",fontSize:"0.55rem",opacity:.6},children:"↗"})]}),x.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:[x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:"◉"}),"Jarvis",x.jsx("span",{style:{marginLeft:"auto",fontFamily:"var(--font-mono)",fontSize:"0.55rem",opacity:.6},children:"↗"})]})]}),x.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:[x.jsxs("span",{children:[m.length," squad",m.length!==1?"s":""]}),x.jsx("span",{children:"v0.1.0"})]})]}),x.jsxs("main",{className:"grid-bg",style:{flex:1,overflow:"hidden",position:"relative"},children:[x.jsx(B.Suspense,{fallback:null,children:x.jsx(gD,{opacity:.4})}),x.jsx("div",{style:{position:"relative",zIndex:1,height:"100%",overflow:"auto"},children:x.jsx(xE,{})})]})]}),x.jsx("div",{"data-layout":"statusbar",children:x.jsx(V4,{state:b})})]})}const bD=B.lazy(()=>mu(()=>import("./ThreeBackground-DfKi4-Pv.js"),__vite__mapDeps([0,1])).then(e=>({default:e.ThreeBackground})));function vD(){var S;const[e,t]=B.useState(""),[n,i]=B.useState(""),r=El(A=>A.login),s=El(A=>A.loading),l=El(A=>A.error),c=El(A=>A.isAuthenticated),f=sx(),m=((S=Nl().state)==null?void 0:S.from)||"/";B.useEffect(()=>{c&&f(m,{replace:!0})},[c,f,m]);const g=A=>{A.preventDefault(),r(e,n)},b=z0(A=>A.theme),_=z0(A=>A.toggle);return x.jsxs("div",{className:"noise-bg",style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",background:"var(--surface-0)",position:"relative",overflow:"hidden"},children:[x.jsx(B.Suspense,{fallback:null,children:x.jsx(bD,{opacity:.6})}),x.jsx("button",{onClick:_,title:`Switch to ${b==="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:b==="dark"?"☀":"☽"}),x.jsxs("div",{style:{animation:"fadeInUp 0.6s var(--ease-out) both",width:360,position:"relative",zIndex:1},children:[x.jsxs("div",{style:{textAlign:"center",marginBottom:"var(--sp-8)"},children:[x.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"}),x.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"}),x.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.15em"},children:"Mission Control"})]}),x.jsxs("form",{onSubmit:g,className:"glass",style:{padding:"var(--sp-6)",borderRadius:"var(--radius-lg)",boxShadow:"var(--shadow-lg)"},children:[l&&x.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}),x.jsxs("div",{style:{marginBottom:"var(--sp-3)"},children:[x.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"}),x.jsx("input",{type:"text",className:"input",placeholder:"Enter username",value:e,onChange:A=>t(A.target.value),autoFocus:!0})]}),x.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[x.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"}),x.jsx("input",{type:"password",className:"input",placeholder:"Enter password",value:n,onChange:A=>i(A.target.value)})]}),x.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"})]}),x.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 aA(e,t,n){if(!e)return;if(n(e)===!0)return e;let i=e.child;for(;i;){const r=aA(i,t,n);if(r)return r;i=i.sibling}}function sA(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const s_=sA(B.createContext(null));let lA=class extends B.Component{render(){return B.createElement(s_.Provider,{value:this._reactInternals},this.props.children)}};function _D(){const e=B.useContext(s_);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=B.useId();return B.useMemo(()=>{for(const n of[e,e==null?void 0:e.alternate]){if(!n)continue;const i=aA(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 SD=Symbol.for("react.context"),ED=e=>e!==null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===SD;function wD(){const e=_D(),[t]=B.useState(()=>new Map);t.clear();let n=e;for(;n;){const i=n.type;ED(i)&&i!==s_&&!t.has(i)&&t.set(i,B.use(sA(i))),n=n.return}return t}function TD(){const e=wD();return B.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>i=>B.createElement(t,null,B.createElement(n.Provider,{...i,value:e.get(n)})),t=>B.createElement(lA,{...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 e1=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},Iy=(e,t)=>e1(e).priority??t,ci={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(e1).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(e1).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)=>Iy(l.value,n)-Iy(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)=>Iy(s,n)-Iy(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))}},CD={extension:{type:kt.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await mu(()=>import("./browserAll-CaCsM_3V.js"),__vite__mapDeps([2,3]))}},AD={extension:{type:kt.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await mu(()=>import("./webworkerAll-V-D0VIF_.js"),[])}};class Er{constructor(t,n,i){this._x=n||0,this._y=i||0,this._observer=t}clone(t){return new Er(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 Tb={exports:{}},zE;function MD(){return zE||(zE=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,b){if(typeof m!="function")throw new TypeError("The listener must be a function");var _=new r(m,g||f,b),S=n?n+p:p;return f._events[S]?f._events[S].fn?f._events[S]=[f._events[S],_]:f._events[S].push(_):(f._events[S]=_,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 b=0,_=g.length,S=new Array(_);b<_;b++)S[b]=g[b].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,b,_,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,b),!0;case 5:return T.fn.call(T.context,m,g,b,_),!0;case 6:return T.fn.call(T.context,m,g,b,_,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 z=T.length,L;for(R=0;R<z;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,b);break;default:if(!N)for(L=1,N=new Array(C-1);L<C;L++)N[L-1]=arguments[L];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,b){var _=n?n+p:p;if(!this._events[_])return this;if(!m)return l(this,_),this;var S=this._events[_];if(S.fn)S.fn===m&&(!b||S.once)&&(!g||S.context===g)&&l(this,_);else{for(var A=0,T=[],C=S.length;A<C;A++)(S[A].fn!==m||b&&!S[A].once||g&&S[A].context!==g)&&T.push(S[A]);T.length?this._events[_]=T.length===1?T[0]:T:l(this,_)}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})(Tb)),Tb.exports}var RD=MD();const wo=xu(RD),kD=Math.PI*2,ND=180/Math.PI,OD=Math.PI/180;class Fr{constructor(t=0,n=0){this.x=0,this.y=0,this.x=t,this.y=n}clone(){return new Fr(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 Cb.x=0,Cb.y=0,Cb}}const Cb=new Fr;class Pt{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 Fr;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 Fr;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,b=n.d;return this.a=i*p+r*g,this.b=i*m+r*b,this.c=s*p+l*g,this.d=s*m+l*b,this.tx=c*p+f*g+n.tx,this.ty=c*m+f*b+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(kD-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 Pt;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 zD.identity()}static get shared(){return DD.identity()}}const DD=new Pt,zD=new Pt,md=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],gd=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],yd=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],xd=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],t1=[],oA=[],Uy=Math.sign;function jD(){for(let e=0;e<16;e++){const t=[];t1.push(t);for(let n=0;n<16;n++){const i=Uy(md[e]*md[n]+yd[e]*gd[n]),r=Uy(gd[e]*md[n]+xd[e]*gd[n]),s=Uy(md[e]*yd[n]+yd[e]*xd[n]),l=Uy(gd[e]*yd[n]+xd[e]*xd[n]);for(let c=0;c<16;c++)if(md[c]===i&&gd[c]===r&&yd[c]===s&&xd[c]===l){t.push(c);break}}}for(let e=0;e<16;e++){const t=new Pt;t.set(md[e],gd[e],yd[e],xd[e],0,0),oA.push(t)}}jD();const Ln={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=>md[e],uY:e=>gd[e],vX:e=>yd[e],vY:e=>xd[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>t1[e][t],sub:(e,t)=>t1[e][Ln.inv(t)],rotate180:e=>e^4,isVertical:e=>(e&3)===2,byDirection:(e,t)=>Math.abs(e)*2<=Math.abs(t)?t>=0?Ln.S:Ln.N:Math.abs(t)*2<=Math.abs(e)?e>0?Ln.E:Ln.W:t>0?e>0?Ln.SE:Ln.SW:e>0?Ln.NE:Ln.NW,matrixAppendRotationInv:(e,t,n=0,i=0,r=0,s=0)=>{const l=oA[Ln.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),b=i-Math.min(0,f*r,m*s,f*r+m*s),_=e.a,S=e.b,A=e.c,T=e.d;e.a=c*_+f*A,e.b=c*S+f*T,e.c=p*_+m*A,e.d=p*S+m*T,e.tx=g*_+b*A+e.tx,e.ty=g*S+b*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===Ln.E?(i.set(r+f,s+p,l,c),i):n===Ln.S?i.set(m-s-c+f,r+p,c,l):n===Ln.W?i.set(m-r-l+f,g-s-c+p,l,c):n===Ln.N?i.set(s+f,g-r-l+p,c,l):i.set(r+f,s+p,l,c)}},Hy=[new Fr,new Fr,new Fr,new Fr];class Ri{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 Ri(0,0,0,0)}clone(){return new Ri(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,b=c+s+p,_=f-p,S=f+l+p,A=c+m,T=c+s-m,C=f+m,N=f+l-m;return t>=g&&t<=b&&n>=_&&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 V=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>V}const i=this.left,r=this.right,s=this.top,l=this.bottom;if(r<=i||l<=s)return!1;const c=Hy[0].set(t.left,t.top),f=Hy[1].set(t.left,t.bottom),p=Hy[2].set(t.right,t.top),m=Hy[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 b=g*(f.y-c.y),_=g*(c.x-f.x),S=b*i+_*s,A=b*r+_*s,T=b*i+_*l,C=b*r+_*l;if(Math.max(S,A,T,C)<=b*c.x+_*c.y||Math.min(S,A,T,C)>=b*m.x+_*m.y)return!1;const N=g*(c.y-p.y),R=g*(p.x-c.x),z=N*i+R*s,L=N*r+R*s,D=N*i+R*l,F=N*r+R*l;return!(Math.max(z,L,D,F)<=N*c.x+R*c.y||Math.min(z,L,D,F)>=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 Ri),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 Ab={default:-1};function Si(e="default"){return Ab[e]===void 0&&(Ab[e]=-1),++Ab[e]}const jE=new Set,_i="8.0.0",LD="8.3.4",nh={quiet:!1,noColor:!1},tn=((e,t,n=3)=>{if(nh.quiet||jE.has(t))return;let i=new Error().stack;const r=`${t}
62
+ Deprecated since v${e}`,s=typeof console.groupCollapsed=="function"&&!nh.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))),jE.add(t)});Object.defineProperties(tn,{quiet:{get:()=>nh.quiet,set:e=>{nh.quiet=e},enumerable:!0,configurable:!1},noColor:{get:()=>nh.noColor,set:e=>{nh.noColor=e},enumerable:!0,configurable:!1}});const cA=()=>{};function hh(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 LE(e){return!(e&e-1)&&!!e}function uA(e){const t={};for(const n in e)e[n]!==void 0&&(t[n]=e[n]);return t}const BE=Object.create(null);function BD(e){const t=BE[e];return t===void 0&&(BE[e]=Si("resource")),t}const dA=class fA extends wo{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...fA.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){tn(_i,"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=BD(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};dA.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let ph=dA;const hA=class pA extends wo{constructor(t={}){super(),this.options=t,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=Si("textureSource"),this._resourceType="textureSource",this._resourceId=Si("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={...pA.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 ph(uA(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=Si("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=Si("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=LE(this.pixelWidth)&&LE(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};hA.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 Gs=hA;class l_ extends Gs{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}}l_.extension=kt.TextureSource;const IE=new Pt;class ID{constructor(t,n){this.mapCoord=new Pt,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&&(IE.set(i.width/r.width,0,0,i.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(IE));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 Rn extends wo{constructor({source:t,label:n,frame:i,orig:r,trim:s,defaultAnchor:l,defaultBorders:c,rotate:f,dynamic:p}={}){if(super(),this.uid=Si("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new Ri,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=n,this.source=(t==null?void 0:t.source)??new Gs,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 ID(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,b=s+m,_=l+g;p=Ln.add(p,Ln.NW),t.x0=b+m*Ln.uX(p),t.y0=_+g*Ln.uY(p),p=Ln.add(p,2),t.x1=b+m*Ln.uX(p),t.y1=_+g*Ln.uY(p),p=Ln.add(p,2),t.x2=b+m*Ln.uX(p),t.y2=_+g*Ln.uY(p),p=Ln.add(p,2),t.x3=b+m*Ln.uX(p),t.y3=_+g*Ln.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 tn(_i,"Texture.baseTexture is now Texture.source"),this._source}}Rn.EMPTY=new Rn({label:"EMPTY",source:new Gs({label:"EMPTY"})});Rn.EMPTY.destroy=cA;Rn.WHITE=new Rn({source:new l_({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});Rn.WHITE.destroy=cA;function mA(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 UE=new Pt;class qs{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=UE,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 Ri);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=UE,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 b=this.minX,_=this.minY,S=this.maxX,A=this.maxY,T=l*t+f*n+m,C=c*t+p*n+g;T<b&&(b=T),C<_&&(_=C),T>S&&(S=T),C>A&&(A=C),T=l*i+f*n+m,C=c*i+p*n+g,T<b&&(b=T),C<_&&(_=C),T>S&&(S=T),C>A&&(A=C),T=l*t+f*r+m,C=c*t+p*r+g,T<b&&(b=T),C<_&&(_=C),T>S&&(S=T),C>A&&(A=C),T=l*i+f*r+m,C=c*i+p*r+g,T<b&&(b=T),C<_&&(_=C),T>S&&(S=T),C>A&&(A=C),this.minX=b,this.minY=_,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 b=l*n+f*i+m,_=c*n+p*i+g;this.minX=b,this.minY=_,this.maxX=b,this.maxY=_,b=l*r+f*i+m,_=c*r+p*i+g,this.minX=b<this.minX?b:this.minX,this.minY=_<this.minY?_:this.minY,this.maxX=b>this.maxX?b:this.maxX,this.maxY=_>this.maxY?_:this.maxY,b=l*n+f*s+m,_=c*n+p*s+g,this.minX=b<this.minX?b:this.minX,this.minY=_<this.minY?_:this.minY,this.maxX=b>this.maxX?b:this.maxX,this.maxY=_>this.maxY?_:this.maxY,b=l*r+f*s+m,_=c*r+p*s+g,this.minX=b<this.minX?b:this.minX,this.minY=_<this.minY?_:this.minY,this.maxX=b>this.maxX?b:this.maxX,this.maxY=_>this.maxY?_: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 qs(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,b=r.d,_=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+_,R=m*T+b*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 UD={grad:.9,turn:360,rad:360/(2*Math.PI)},rc=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},cr=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Ps=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},gA=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},HE=function(e){return{r:Ps(e.r,0,255),g:Ps(e.g,0,255),b:Ps(e.b,0,255),a:Ps(e.a)}},Mb=function(e){return{r:cr(e.r),g:cr(e.g),b:cr(e.b),a:cr(e.a,3)}},HD=/^#([0-9a-f]{3,8})$/i,Py=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},yA=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}},xA=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}},PE=function(e){return{h:gA(e.h),s:Ps(e.s,0,100),l:Ps(e.l,0,100),a:Ps(e.a)}},FE=function(e){return{h:cr(e.h),s:cr(e.s),l:cr(e.l),a:cr(e.a,3)}},qE=function(e){return xA((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},Rm=function(e){return{h:(t=yA(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},PD=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,FD=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,qD=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,GD=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,n1={string:[[function(e){var t=HD.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?cr(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?cr(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=qD.exec(e)||GD.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:HE({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=PD.exec(e)||FD.exec(e);if(!t)return null;var n,i,r=PE({h:(n=t[1],i=t[2],i===void 0&&(i="deg"),Number(n)*(UD[i]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return qE(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 rc(t)&&rc(n)&&rc(i)?HE({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(!rc(t)||!rc(n)||!rc(i))return null;var l=PE({h:Number(t),s:Number(n),l:Number(i),a:Number(s)});return qE(l)},"hsl"],[function(e){var t=e.h,n=e.s,i=e.v,r=e.a,s=r===void 0?1:r;if(!rc(t)||!rc(n)||!rc(i))return null;var l=(function(c){return{h:gA(c.h),s:Ps(c.s,0,100),v:Ps(c.v,0,100),a:Ps(c.a)}})({h:Number(t),s:Number(n),v:Number(i),a:Number(s)});return xA(l)},"hsv"]]},GE=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]},YD=function(e){return typeof e=="string"?GE(e.trim(),n1.string):typeof e=="object"&&e!==null?GE(e,n1.object):[null,void 0]},Rb=function(e,t){var n=Rm(e);return{h:n.h,s:Ps(n.s+100*t,0,100),l:n.l,a:n.a}},kb=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},YE=function(e,t){var n=Rm(e);return{h:n.h,s:n.s,l:Ps(n.l+100*t,0,100),a:n.a}},i1=(function(){function e(t){this.parsed=YD(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 cr(kb(this.rgba),2)},e.prototype.isDark=function(){return kb(this.rgba)<.5},e.prototype.isLight=function(){return kb(this.rgba)>=.5},e.prototype.toHex=function(){return t=Mb(this.rgba),n=t.r,i=t.g,r=t.b,l=(s=t.a)<1?Py(cr(255*s)):"","#"+Py(n)+Py(i)+Py(r)+l;var t,n,i,r,s,l},e.prototype.toRgb=function(){return Mb(this.rgba)},e.prototype.toRgbString=function(){return t=Mb(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 FE(Rm(this.rgba))},e.prototype.toHslString=function(){return t=FE(Rm(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=yA(this.rgba),{h:cr(t.h),s:cr(t.s),v:cr(t.v),a:cr(t.a,3)};var t},e.prototype.invert=function(){return go({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),go(Rb(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),go(Rb(this.rgba,-t))},e.prototype.grayscale=function(){return go(Rb(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),go(YE(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),go(YE(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"?go({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):cr(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=Rm(this.rgba);return typeof t=="number"?go({h:t,s:n.s,l:n.l,a:n.a}):cr(n.h)},e.prototype.isEqual=function(t){return this.toHex()===go(t).toHex()},e})(),go=function(e){return e instanceof i1?e:new i1(e)},VE=[],VD=function(e){e.forEach(function(t){VE.indexOf(t)<0&&(t(i1,n1),VE.push(t))})};function XD(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,b="black";if(!s.length)for(var _ in n)s[_]=new e(n[_]).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,b=S)}return b}},t.string.push([function(l){var c=l.toLowerCase(),f=c==="transparent"?"#0000":n[c];return f?new e(f).toRgb():null},"name"])}VD([XD]);const mh=class _m{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 _m)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]=_m._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=_m.HEX_PATTERN.exec(t);c&&(t=`#${c[2]}`)}const l=go(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 _m||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}};mh.shared=new mh;mh._temp=new mh;mh.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Ki=mh;const KD={cullArea:null,cullable:!1,cullableChildren:!0};let Nb=0;const XE=500;function va(...e){Nb!==XE&&(Nb++,Nb===XE?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...e))}const ag={_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 WD{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 $D{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 WD(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 Ia=new $D;ag.register(Ia);const QD={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){tn("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(e)}};function ZD(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 JD={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)}ZD(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||tn(_i,"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)}},ez={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 KE{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 tz{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 Ia.get(i.maskClass,t)}return t}returnMaskEffect(t){Ia.return(t)}}const r1=new tz;ci.handleByList(kt.MaskEffect,r1._effectClasses);const nz={_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),r1.returnMaskEffect(t),this._maskEffect=null),e!=null&&(this._maskEffect=r1.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 KE);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 KE),this._filterEffect.filterArea=e},get filterArea(){var e;return(e=this._filterEffect)==null?void 0:e.filterArea}},iz={label:null,get name(){return tn(_i,"Container.name property has been removed, use Container.label instead"),this.label},set name(e){tn(_i,"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}},ba=Ia.getPool(Pt),dc=Ia.getPool(qs),rz=new Pt,az={getFastGlobalBounds(e,t){t||(t=new qs),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=dc.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(rz).invert()),t.addBounds(i),dc.return(i)}else this.renderGroup&&(t.addBounds(i,this.relativeGroupTransform),dc.return(i))}};function bA(e,t,n){n.clear();let i,r;return e.parent?t?i=e.parent.worldTransform:(r=ba.get().identity(),i=o_(e,r)):i=Pt.IDENTITY,vA(e,n,i,t),r&&ba.return(r),n.isValid||n.set(0,0,0,0),n}function vA(e,t,n,i){var c,f;if(!e.visible||!e.measurable)return;let r;i?r=e.worldTransform:(e.updateLocalTransform(),r=ba.get(),r.appendFrom(e.localTransform,n));const s=t,l=!!e.effects.length;if(l&&(t=dc.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++)vA(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,Pt.IDENTITY),dc.return(t)}i||ba.return(r)}function o_(e,t){const n=e.parent;return n&&(o_(n,t),n.updateLocalTransform(),t.append(n.localTransform)),t}function _A(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 WE=16777215;function $E(e,t){return e===WE?t:t===WE?e:_A(e,t)}function w0(e){return((e&255)<<16)+(e&65280)+(e>>16&255)}const sz={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 Pt,t){if(t)return e.copyFrom(this.worldTransform);this.updateLocalTransform();const n=o_(this,ba.get().identity());return e.appendFrom(this.localTransform,n),ba.return(n),e},getGlobalTint(e){if(e)return this.renderGroup?w0(this.renderGroup.worldColor):this.parentRenderGroup?w0($E(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,n=this.parent;for(;n;)t=$E(t,n.localColor),n=n.parent;return w0(t)}};function SA(e,t,n){return t.clear(),n||(n=Pt.IDENTITY),EA(e,t,n,e,!0),t.isValid||t.set(0,0,0,0),t}function EA(e,t,n,i,r){var f,p;let s;if(r)s=ba.get(),s=n.copyTo(s);else{if(!e.visible||!e.measurable)return;e.updateLocalTransform();const m=e.localTransform;s=ba.get(),s.appendFrom(m,n)}const l=t,c=!!e.effects.length;if(c&&(t=dc.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++)EA(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,Pt.IDENTITY),dc.return(t)}ba.return(s)}function wA(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&&wA(r,t)}return t.didChange}const lz=new Pt,oz={_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 qs});const e=this._localBoundsCacheData;return e.index=1,e.didChange=!1,e.data[0]!==this._didViewChangeTick&&(e.didChange=!0,e.data[0]=this._didViewChangeTick),wA(this,e),e.didChange&&SA(this,e.localBounds,lz),e.localBounds},getBounds(e,t){return bA(this,e,t||new qs)}},cz={_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}},uz={_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(dz))}};function dz(e,t){return e._zIndex-t._zIndex}const fz={getGlobalPosition(e=new Fr,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(ba.get(),n);return t=i.apply(e,t),ba.return(i),t},toLocal(e,t,n,i){t&&(e=t.toGlobal(e,n,i));const r=this.getGlobalTransform(ba.get(),i);return n=r.applyInverse(e,n),ba.return(r),n}};class c_{constructor(){this.uid=Si("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 hz=0;class pz{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this.textureStyle=new ph(this.textureOptions)}createTexture(t,n,i,r){const s=new Gs({...this.textureOptions,width:t,height:n,resolution:1,antialias:i,autoGarbageCollect:!1,autoGenerateMipmaps:r});return new Rn({source:s,label:`texturePool_${hz++}`})}getOptimalTexture(t,n,i=1,r,s=!1){let l=Math.ceil(t*i-1e-6),c=Math.ceil(n*i-1e-6);l=hh(l),c=hh(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 ox=new pz;ag.register(ox);class mz{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new Pt,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 c_,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&&(ox.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 Pt),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new Pt),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 Pt),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 gz(e,t,n={}){for(const i in t)!n[i]&&t[i]!==void 0&&(e[i]=t[i])}const Ob=new Er(null),Fy=new Er(null),Db=new Er(null,1,1),qy=new Er(null),QE=1,yz=2,zb=4;class Tr extends wo{constructor(t={}){var n,i;super(),this.uid=Si("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 Pt,this.relativeGroupTransform=new Pt,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new Er(this,0,0),this._scale=Db,this._pivot=Fy,this._origin=qy,this._skew=Ob,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=[],gz(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){tn("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),ci.mixin(Tr,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||tn(_i,"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=Ia.get(mz,this),this.groupTransform=Pt.IDENTITY,t==null||t.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t==null||t.removeChild(this),Ia.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 Pt),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*ND}set angle(t){this.rotation=t*OD}get pivot(){return this._pivot===Fy&&(this._pivot=new Er(this,0,0)),this._pivot}set pivot(t){this._pivot===Fy&&(this._pivot=new Er(this,0,0),this._origin!==qy&&va("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===Ob&&(this._skew=new Er(this,0,0)),this._skew}set skew(t){this._skew===Ob&&(this._skew=new Er(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===Db&&(this._scale=new Er(this,1,1)),this._scale}set scale(t){this._scale===Db&&(this._scale=new Er(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===qy&&(this._origin=new Er(this,0,0)),this._origin}set origin(t){this._origin===qy&&(this._origin=new Er(this,0,0),this._pivot!==Fy&&va("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,b=-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+b*n.c)-g,n.ty=l._y-(p*n.b+m*n.d)+(g*n.b+b*n.d)-b}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=QE,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const i=Ki.shared.setValue(t??16777215).toBgrNumber();i!==this.localColor&&(this.localColor=i,this._updateFlags|=QE,this._onUpdate())}get tint(){return w0(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=yz,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|=zb,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|=zb,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|=zb,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}}ci.mixin(Tr,JD,az,fz,cz,oz,nz,iz,uz,KD,QD,sz,ez);class u_ extends Tr{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 qs(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 gh extends u_{constructor(t=Rn.EMPTY){t instanceof Rn&&(t={texture:t});const{texture:n=Rn.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 Er({_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 Rn?new gh(t):new gh(Rn.from(t,n))}set texture(t){t||(t=Rn.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 mA(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return tn("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 xz=new qs;function TA(e,t,n){const i=xz;e.measurable=!0,bA(e,n,i),t.addBoundsMask(i),e.measurable=!1}function CA(e,t,n){const i=dc.get();e.measurable=!0;const r=ba.get().identity(),s=AA(e,n,r);SA(e,i,s),e.measurable=!1,t.addBoundsMask(i),ba.return(r),dc.return(i)}function AA(e,t,n){return e?(e!==t&&(AA(e.parent,t,n),e.updateLocalTransform(),n.append(e.localTransform)),n):(va("Mask bounds, renderable is not inside the root container"),n)}class MA{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 gh),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||TA(this.mask,t,n)}addLocalBounds(t,n){CA(this.mask,t,n)}containsPoint(t,n){const i=this.mask;return n(i,t)}destroy(){this.reset()}static test(t){return t instanceof gh}}MA.extension=kt.MaskEffect;class RA{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"}}RA.extension=kt.MaskEffect;class kA{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){TA(this.mask,t,n)}addLocalBounds(t,n){CA(this.mask,t,n)}containsPoint(t,n){const i=this.mask;return n(i,t)}destroy(){this.reset()}static test(t){return t instanceof Tr}}kA.extension=kt.MaskEffect;const bz={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 ZE=bz;const cs={get(){return ZE},set(e){ZE=e}};class NA extends Gs{constructor(t){t.resource||(t.resource=cs.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"))}}NA.extension=kt.TextureSource;class j0 extends Gs{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}}j0.extension=kt.TextureSource;var L0=(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))(L0||{});class jb{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 OA=class as{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 jb(null,null,1/0),this.deltaMS=1/as.targetFPMS,this.elapsedMS=1/as.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=L0.NORMAL){return this._addListener(new jb(t,n,i))}addOnce(t,n,i=L0.NORMAL){return this._addListener(new jb(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*as.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,as.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(!as._shared){const t=as._shared=new as;t.autoStart=!0,t._protected=!0}return as._shared}static get system(){if(!as._system){const t=as._system=new as;t.autoStart=!0,t._protected=!0}return as._system}};OA.targetFPMS=.06;let ih=OA,Lb;async function vz(){return Lb??(Lb=(async()=>{var l;const t=cs.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"})()),Lb}const cx=class DA extends Gs{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...DA.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=ih.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 vz(),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&&(ih.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||(ih.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(ih.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};cx.extension=kt.TextureSource;cx.defaultOptions={...Gs.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};cx.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let _z=cx;const $f=(e,t,n=!1)=>(Array.isArray(e)||(e=[e]),t?e.map(i=>typeof i=="string"||n?t(i):i):e);class Sz{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||va(`[Assets] Asset id ${t} was not found in the Cache`),n}set(t,n){const i=$f(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&&va("[Cache] already has key:",f),this._cache.set(f,s.get(f))})}remove(t){if(!this._cacheMap.has(t)){va(`[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 Sz,a1=[];ci.handleByList(kt.TextureSource,a1);function zA(e={}){const t=e&&e.resource,n=t?e.resource:e,i=t?e:{resource:e};for(let r=0;r<a1.length;r++){const s=a1[r];if(s.test(n))return new s(i)}throw new Error(`Could not find a source type for resource: ${i.resource}`)}function Ez(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 Rn({source:zA(r)});return s.on("destroy",()=>{Qf.has(i)&&Qf.remove(i)}),t||Qf.set(i,s),s}function wz(e,t=!1){return typeof e=="string"?Qf.get(e):e instanceof Gs?new Rn({source:e}):Ez(e,t)}Rn.from=wz;Gs.from=zA;ci.add(MA,RA,kA,_z,j0,NA,l_);var jA=(e=>(e[e.Low=0]="Low",e[e.Normal=1]="Normal",e[e.High=2]="High",e))(jA||{});function yl(e){if(typeof e!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(e)}`)}function im(e){return e.split("?")[0].split("#")[0]}function Tz(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Cz(e,t,n){return e.replace(new RegExp(Tz(t),"g"),n)}function Az(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 Um={toPosix(e){return Cz(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){yl(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(yl(e),this.isDataUrl(e)||this.isBlobUrl(e))return e;const i=im(this.toPosix(t??cs.get().getBaseUrl())),r=im(this.toPosix(n??this.rootname(i)));return e=this.toPosix(e),e.startsWith("/")?Um.join(r,e.slice(1)):this.isAbsolute(e)?e:this.join(i,e)},normalize(e){if(yl(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=Az(e),e.length>0&&i&&(e+="/"),n?`/${e}`:t+e},isAbsolute(e){return yl(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(yl(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(yl(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){yl(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){yl(e),t&&yl(t),e=im(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){yl(e),e=im(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){yl(e);const t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;e=im(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 LA(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?LA(e.replace(i[n],c),t,n+1,i,r):r.push(e.replace(i[n],c))}}function Mz(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)}),LA(e,r,0,n,i)}else i.push(e);return i}const JE=e=>!Array.isArray(e);class BA{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 $f(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&&va("[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)&&va(`[Resolver] already has key: ${s} overwriting`)},$f(n).forEach(s=>{const{src:l}=s;let{data:c,format:f,loadParser:p,parser:m}=s;const g=$f(l).map(A=>typeof A=="string"?Mz(A):Array.isArray(A)?A:[A]),b=this.getAlias(s);Array.isArray(b)?b.forEach(i):i(b);const _=[],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}),!b)throw new Error(`[Resolver] alias is undefined for this asset: ${C.src}`);C=this._buildResolvedAsset(C,{aliases:b,data:c,format:f,loadParser:p,parser:m,progressSize:s.progressSize}),_.push(C)})}),b.forEach(A=>{this._assetMap[A]=_})})}resolveBundle(t){const n=JE(t);t=$f(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=JE(t);t=$f(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=Um.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??Rz(t.src),f!==void 0&&(t.progressSize=f),t}}BA.RETINA_PREFIX=/@([0-9\.]+)x/;function Rz(e){return e.split(".").pop().split("?").shift().split("#").shift()}const ew=(e,t)=>{const n=t.split("?")[1];return n&&(e+=`?${n}`),e},IA=class Sm{constructor(t,n){this.linkedSheets=[];let i=t;(t==null?void 0:t.source)instanceof Gs&&(i={texture:t,data:n});const{texture:r,data:s,cachePrefix:l=""}=i;this.cachePrefix=l,this._texture=r instanceof Rn?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<=Sm.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:Sm.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 Ri(0,0,Math.floor(m.w)/this.resolution,Math.floor(m.h)/this.resolution);l.rotated?f=new Ri(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 Ri(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 Ri(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 Rn({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*Sm.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*Sm.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=[]}};IA.BATCH_SIZE=1e3;let tw=IA;const kz=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function UA(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=Um.dirname(e[0]);t.linkedSheets.forEach((s,l)=>{const c=UA([`${r}/${t.data.meta.related_multi_packs[l]}`],s,!0);Object.assign(i,c)})}return i}const Nz={extension:kt.Asset,cache:{test:e=>e instanceof tw,getCacheableAssets:(e,t)=>UA(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"&&kz.includes(r)},parse:e=>{var n;const t=e.split(".");return{resolution:parseFloat(((n=BA.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:jA.Normal,name:"spritesheetLoader"},async testParse(e,t){return Um.extname(t.src).toLowerCase()===".json"&&!!e.frames},async parse(e,t,n){var g,b;const{texture:i,imageFilename:r,textureOptions:s,cachePrefix:l}=(t==null?void 0:t.data)??{};let c=Um.dirname(t.src);c&&c.lastIndexOf("/")!==c.length-1&&(c+="/");let f;if(i instanceof Rn)f=i;else{const _=ew(c+(r??e.meta.image),t.src);f=(await n.load([{src:_,data:s}]))[_]}const p=new tw({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 _=[];for(const A of m){if(typeof A!="string")continue;let T=c+A;(b=t.data)!=null&&b.ignoreMultiPack||(T=ew(T,t.src),_.push(n.load({src:T,data:{textureOptions:s,ignoreMultiPack:!0}})))}const S=await Promise.all(_);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)}}};ci.add(Nz);const Bb=Object.create(null),nw=Object.create(null);function d_(e,t){let n=nw[e];return n===void 0&&(Bb[t]===void 0&&(Bb[t]=1),nw[e]=n=Bb[t]++),n}let Pf;function HA(){return(!Pf||Pf!=null&&Pf.isContextLost())&&(Pf=cs.get().createCanvas().getContext("webgl",{})),Pf}let Gy;function Oz(){if(!Gy){Gy="mediump";const e=HA();e&&e.getShaderPrecisionFormat&&(Gy=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision?"highp":"mediump")}return Gy}function Dz(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 zz(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 jz(e,t){return t?`#version 300 es
81
+ ${e}`:e}const Lz={},Bz={};function Iz(e,{name:t="pixi-program"},n=!0){t=t.replace(/\s+/g,"-"),t+=n?"-fragment":"-vertex";const i=n?Lz:Bz;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 Uz(e,t){return t?e.replace("#version 300 es",""):e}const Ib={stripVersion:Uz,ensurePrecision:zz,addProgramDefines:Dz,setProgramName:Iz,insertVersion:jz},rm=Object.create(null),PA=class s1{constructor(t){t={...s1.defaultOptions,...t};const n=t.fragment.indexOf("#version 300 es")!==-1,i={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:Oz()},setProgramName:{name:t.name},addProgramDefines:n,insertVersion:n};let r=t.fragment,s=t.vertex;Object.keys(Ib).forEach(l=>{const c=i[l];r=Ib[l](r,c,!0),s=Ib[l](s,c,!1)}),this.fragment=r,this.vertex=s,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=d_(`${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,rm[this._cacheKey]=null}static from(t){const n=`${t.vertex}:${t.fragment}`;return rm[n]||(rm[n]=new s1(t),rm[n]._cacheKey=n),rm[n]}};PA.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let f_=PA;const iw={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 Hz(e){return iw[e]??iw.float32}const Pz={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"},rw=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function aw(e,t){let n;for(;(n=rw.exec(e))!==null;){const i=Pz[n[3]]??"float32";t[n[2]]={location:parseInt(n[1],10),format:i,stride:Hz(i).stride,offset:0,instance:!1,start:0}}rw.lastIndex=0}function Fz(e){return e.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function qz({source:e,entryPoint:t}){const n={},i=Fz(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(aw(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&&aw(m[1],n)}}return n}function Ub(e){var g,b;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(_=>({group:parseInt(_.match(n)[1],10),binding:parseInt(_.match(i)[1],10),name:_.match(r)[2],isUniform:_.match(r)[1]==="<uniform>",type:_.match(s)[1]}));if(!p)return{groups:[],structs:[]};const m=((b=e.match(l))==null?void 0:b.map(_=>{const S=_.match(f)[1],A=_.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:_})=>p.some(S=>S.type===_||S.type.includes(`<${_}>`))))??[];return{groups:p,structs:m}}var bd=(e=>(e[e.VERTEX=1]="VERTEX",e[e.FRAGMENT=2]="FRAGMENT",e[e.COMPUTE=4]="COMPUTE",e))(bd||{});function Gz({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:bd.VERTEX|bd.FRAGMENT,buffer:{type:"uniform"}}):i.type==="sampler"?t[i.group].push({binding:i.binding,visibility:bd.FRAGMENT,sampler:{type:"filtering"}}):i.type==="texture_2d"||i.type.startsWith("texture_2d<")?t[i.group].push({binding:i.binding,visibility:bd.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:bd.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:bd.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let n=0;n<t.length;n++)t[n]||(t[n]=[]);return t}function Yz({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 Vz(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 am=Object.create(null);class sg{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=Ub(n.source);this.structsAndGroups=p}else{const p=Ub(i.source),m=Ub(n.source);this.structsAndGroups=Vz(p,m)}this.layout=r??Yz(this.structsAndGroups),this.gpuLayout=s??Gz(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=d_(i,"program")}get attributeData(){return this._attributeData??(this._attributeData=qz(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,am[this._cacheKey]=null}static from(t){const n=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return am[n]||(am[n]=new sg(t),am[n]._cacheKey=n),am[n]}}const FA=["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>"],Xz=FA.reduce((e,t)=>(e[t]=!0,e),{});function Kz(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 qA=class GA{constructor(t,n){this._touched=0,this.uid=Si("uniform"),this._resourceType="uniformGroup",this._resourceId=Si("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...GA.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,!Xz[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: ${FA.join(", ")}`)}s.value??(s.value=Kz(s.type,s.size)),i[r]=s.value}this.uniforms=i,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=d_(Object.keys(i).map(r=>`${r}-${t[r].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};qA.defaultOptions={ubo:!1,isStatic:!1};let YA=qA;class T0{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 l1=(e=>(e[e.WEBGL=1]="WEBGL",e[e.WEBGPU=2]="WEBGPU",e[e.CANVAS=4]="CANVAS",e[e.BOTH=3]="BOTH",e))(l1||{});class ux extends wo{constructor(t){super(),this.uid=Si("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|=l1.WEBGPU),i&&(l|=l1.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 T0,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 b=s[m];!b.source&&!b._resourceType&&(b=new YA(b));const _=f[g];_&&(r[_.group]||(r[_.group]=new T0,this._ownedBindGroups.push(r[_.group])),r[_.group].setResource(b,_.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 T0,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=sg.from(n)),i&&(l=f_.from(i)),new ux({gpuProgram:s,glProgram:l,...r})}}const Wz={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},Hb=0,Pb=1,Fb=2,qb=3,Gb=4,Yb=5,o1=class VA{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Hb)}set blend(t){!!(this.data&1<<Hb)!==t&&(this.data^=1<<Hb)}get offsets(){return!!(this.data&1<<Pb)}set offsets(t){!!(this.data&1<<Pb)!==t&&(this.data^=1<<Pb)}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<<Fb)}set culling(t){!!(this.data&1<<Fb)!==t&&(this.data^=1<<Fb)}get depthTest(){return!!(this.data&1<<qb)}set depthTest(t){!!(this.data&1<<qb)!==t&&(this.data^=1<<qb)}get depthMask(){return!!(this.data&1<<Yb)}set depthMask(t){!!(this.data&1<<Yb)!==t&&(this.data^=1<<Yb)}get clockwiseFrontFace(){return!!(this.data&1<<Gb)}set clockwiseFrontFace(t){!!(this.data&1<<Gb)!==t&&(this.data^=1<<Gb)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=Wz[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 VA;return t.depthTest=!1,t.blend=!0,t}};o1.default2d=o1.for2d();let h_=o1;const XA=class c1 extends ux{constructor(t){t={...c1.defaultOptions,...t},super(t),this.enabled=!0,this._state=h_.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=sg.from(n)),i&&(l=f_.from(i)),new c1({gpuProgram:s,glProgram:l,...r})}};XA.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let zd=XA;const u1=[];ci.handleByNamedList(kt.Environment,u1);async function $z(e){if(!e)for(let t=0;t<u1.length;t++){const n=u1[t];if(n.value.test()){await n.value.load();return}}}let sm;function Qz(){if(typeof sm=="boolean")return sm;try{sm=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{sm=!1}return sm}function sw(e,t,n=2){const i=t&&t.length,r=i?t[0]*n:e.length;let s=KA(e,0,r,n,!0);const l=[];if(!s||s.next===s.prev)return l;let c,f,p;if(i&&(s=n5(e,t,s,n)),e.length>80*n){c=e[0],f=e[1];let m=c,g=f;for(let b=n;b<r;b+=n){const _=e[b],S=e[b+1];_<c&&(c=_),S<f&&(f=S),_>m&&(m=_),S>g&&(g=S)}p=Math.max(m-c,g-f),p=p!==0?32767/p:0}return Hm(s,l,n,c,f,p,0),l}function KA(e,t,n,i,r){let s;if(r===h5(e,t,n,i)>0)for(let l=t;l<n;l+=i)s=lw(l/i|0,e[l],e[l+1],s);else for(let l=n-i;l>=t;l-=i)s=lw(l/i|0,e[l],e[l+1],s);return s&&yh(s,s.next)&&(Fm(s),s=s.next),s}function Ad(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(yh(n,n.next)||oi(n.prev,n,n.next)===0)){if(Fm(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function Hm(e,t,n,i,r,s,l){if(!e)return;!l&&s&&l5(e,i,r,s);let c=e;for(;e.prev!==e.next;){const f=e.prev,p=e.next;if(s?Jz(e,i,r,s):Zz(e)){t.push(f.i,e.i,p.i),Fm(e),e=p.next,c=p.next;continue}if(e=p,e===c){l?l===1?(e=e5(Ad(e),t),Hm(e,t,n,i,r,s,2)):l===2&&t5(e,t,n,i,r,s):Hm(Ad(e),t,n,i,r,s,1);break}}}function Zz(e){const t=e.prev,n=e,i=e.next;if(oi(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),b=Math.max(r,s,l),_=Math.max(c,f,p);let S=i.next;for(;S!==t;){if(S.x>=m&&S.x<=b&&S.y>=g&&S.y<=_&&Em(r,c,s,f,l,p,S.x,S.y)&&oi(S.prev,S,S.next)>=0)return!1;S=S.next}return!0}function Jz(e,t,n,i){const r=e.prev,s=e,l=e.next;if(oi(r,s,l)>=0)return!1;const c=r.x,f=s.x,p=l.x,m=r.y,g=s.y,b=l.y,_=Math.min(c,f,p),S=Math.min(m,g,b),A=Math.max(c,f,p),T=Math.max(m,g,b),C=d1(_,S,t,n,i),N=d1(A,T,t,n,i);let R=e.prevZ,z=e.nextZ;for(;R&&R.z>=C&&z&&z.z<=N;){if(R.x>=_&&R.x<=A&&R.y>=S&&R.y<=T&&R!==r&&R!==l&&Em(c,m,f,g,p,b,R.x,R.y)&&oi(R.prev,R,R.next)>=0||(R=R.prevZ,z.x>=_&&z.x<=A&&z.y>=S&&z.y<=T&&z!==r&&z!==l&&Em(c,m,f,g,p,b,z.x,z.y)&&oi(z.prev,z,z.next)>=0))return!1;z=z.nextZ}for(;R&&R.z>=C;){if(R.x>=_&&R.x<=A&&R.y>=S&&R.y<=T&&R!==r&&R!==l&&Em(c,m,f,g,p,b,R.x,R.y)&&oi(R.prev,R,R.next)>=0)return!1;R=R.prevZ}for(;z&&z.z<=N;){if(z.x>=_&&z.x<=A&&z.y>=S&&z.y<=T&&z!==r&&z!==l&&Em(c,m,f,g,p,b,z.x,z.y)&&oi(z.prev,z,z.next)>=0)return!1;z=z.nextZ}return!0}function e5(e,t){let n=e;do{const i=n.prev,r=n.next.next;!yh(i,r)&&$A(i,n,n.next,r)&&Pm(i,r)&&Pm(r,i)&&(t.push(i.i,n.i,r.i),Fm(n),Fm(n.next),n=e=r),n=n.next}while(n!==e);return Ad(n)}function t5(e,t,n,i,r,s){let l=e;do{let c=l.next.next;for(;c!==l.prev;){if(l.i!==c.i&&u5(l,c)){let f=QA(l,c);l=Ad(l,l.next),f=Ad(f,f.next),Hm(l,t,n,i,r,s,0),Hm(f,t,n,i,r,s,0);return}c=c.next}l=l.next}while(l!==e)}function n5(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=KA(e,c,f,i,!1);p===p.next&&(p.steiner=!0),r.push(c5(p))}r.sort(i5);for(let s=0;s<r.length;s++)n=r5(r[s],n);return n}function i5(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 r5(e,t){const n=a5(e,t);if(!n)return t;const i=QA(n,e);return Ad(i,i.next),Ad(n,n.next)}function a5(e,t){let n=t;const i=e.x,r=e.y;let s=-1/0,l;if(yh(e,n))return n;do{if(yh(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&&WA(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);Pm(n,e)&&(g<m||g===m&&(n.x>l.x||n.x===l.x&&s5(l,n)))&&(l=n,m=g)}n=n.next}while(n!==c);return l}function s5(e,t){return oi(e.prev,e,t.prev)<0&&oi(t.next,e,e.next)<0}function l5(e,t,n,i){let r=e;do r.z===0&&(r.z=d1(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,o5(r)}function o5(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 d1(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 c5(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 WA(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 Em(e,t,n,i,r,s,l,c){return!(e===l&&t===c)&&WA(e,t,n,i,r,s,l,c)}function u5(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!d5(e,t)&&(Pm(e,t)&&Pm(t,e)&&f5(e,t)&&(oi(e.prev,e,t.prev)||oi(e,t.prev,t))||yh(e,t)&&oi(e.prev,e,e.next)>0&&oi(t.prev,t,t.next)>0)}function oi(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function yh(e,t){return e.x===t.x&&e.y===t.y}function $A(e,t,n,i){const r=Vy(oi(e,t,n)),s=Vy(oi(e,t,i)),l=Vy(oi(n,i,e)),c=Vy(oi(n,i,t));return!!(r!==s&&l!==c||r===0&&Yy(e,n,t)||s===0&&Yy(e,i,t)||l===0&&Yy(n,e,i)||c===0&&Yy(n,t,i))}function Yy(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 Vy(e){return e>0?1:e<0?-1:0}function d5(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&&$A(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Pm(e,t){return oi(e.prev,e,e.next)<0?oi(e,t,e.next)>=0&&oi(e,e.prev,t)>=0:oi(e,t,e.prev)<0||oi(e,e.next,t)<0}function f5(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 QA(e,t){const n=f1(e.i,e.x,e.y),i=f1(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 lw(e,t,n,i){const r=f1(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 Fm(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 f1(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function h5(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 p5=sw.default||sw;var ZA=(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))(ZA||{});class m5{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,b=m.length;g<b;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 g5=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],JA=class eM extends wo{constructor(t){super(),this.tick=0,this.uid=Si("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=[...g5,...this.config.runners??[]];this._addRunners(...n),this._unsafeEvalCheck()}async init(t={}){const n=t.skipExtensionImports===!0?!0:t.manageImports===!1;await $z(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={...eM.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 Tr&&(i={container:i},n&&(tn(_i,"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:Ki.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=ZA.ALL);const{clear:i,clearColor:r,target:s,mipLevel:l,layer:c}=t;Ki.shared.setValue(r??this.background.colorRgba),n.renderTarget.clear(s,i,Ki.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 m5(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)&&ag.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(!Qz())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()}};JA.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let tM=JA,Xy;function y5(e){return Xy!==void 0||(Xy=(()=>{var n;const t={stencil:!0,failIfMajorPerformanceCaveat:e??tM.defaultOptions.failIfMajorPerformanceCaveat};try{if(!cs.get().getWebGLRenderingContext())return!1;let r=cs.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}})()),Xy}let Ky;async function x5(e={}){return Ky!==void 0||(Ky=await(async()=>{const t=cs.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(e)).requestDevice(),!0}catch{return!1}})()),Ky}const ow=["webgl","webgpu","canvas"];async function b5(e){let t=[];e.preference?(t.push(e.preference),ow.forEach(s=>{s!==e.preference&&t.push(s)})):t=ow.slice();let n,i={};for(let s=0;s<t.length;s++){const l=t[s];if(l==="webgpu"&&await x5()){const{WebGPURenderer:c}=await mu(async()=>{const{WebGPURenderer:f}=await import("./WebGPURenderer-CLajcSm_.js");return{WebGPURenderer:f}},__vite__mapDeps([4,5,6]));n=c,i={...e,...e.webgpu};break}else if(l==="webgl"&&y5(e.failIfMajorPerformanceCaveat??tM.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:c}=await mu(async()=>{const{WebGLRenderer:f}=await import("./WebGLRenderer-DYyy3oKv.js");return{WebGLRenderer:f}},__vite__mapDeps([7,5,6]));n=c,i={...e,...e.webgl};break}else if(l==="canvas"){const{CanvasRenderer:c}=await mu(async()=>{const{CanvasRenderer:f}=await import("./CanvasRenderer-CMQl28Sx.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 nM="8.17.0";class iM{static init(){var t;(t=globalThis.__PIXI_APP_INIT__)==null||t.call(globalThis,this,nM)}static destroy(){}}iM.extension=kt.Application;class v5{constructor(t){this._renderer=t}init(){var t;(t=globalThis.__PIXI_RENDERER_INIT__)==null||t.call(globalThis,this._renderer,nM)}destroy(){this._renderer=null}}v5.extension={type:[kt.WebGLSystem,kt.WebGPUSystem],name:"initHook",priority:-10};class rM{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}}rM.extension=kt.Application;class aM{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,L0.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?ih.shared:new ih,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}aM.extension=kt.Application;ci.add(rM);ci.add(aM);const sM=class h1{constructor(...t){this.stage=new Tr,t[0]!==void 0&&tn(_i,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.stage||(this.stage=new Tr),this.renderer=await b5(t),h1._plugins.forEach(n=>{n.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return tn(_i,"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=h1._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}};sM._plugins=[];let p_=sM;ci.handleByList(kt.Application,p_._plugins);ci.add(iM);var Vb,cw;function _5(){if(cw)return Vb;cw=1,Vb=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 Vb}var S5=_5();const E5=xu(S5);function w5(e,t){const n=E5(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:va(`Unknown SVG path command: ${p}`)}p!=="Z"&&p!=="z"&&r===null&&(r={startX:s,startY:l},i.push(r))}return t}class m_{constructor(t=0,n=0,i=0){this.type="circle",this.x=t,this.y=n,this.radius=i}clone(){return new m_(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 Ri),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 g_{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 g_(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,b=l+c,_=t-this.x,S=n-this.y,A=_*_/(p*p)+S*S/(m*m),T=_*_/(g*g)+S*S/(b*b);return A>1&&T<=1}getBounds(t){return t||(t=new Ri),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 T5(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 b=-1;g!==0&&(b=m/g);let _,S;b<0?(_=n,S=i):b>1?(_=r,S=s):(_=n+b*f,S=i+b*p);const A=e-_,T=t-S;return A*A+T*T}let C5,A5;class km{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(C5),i=t.getBounds(A5);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 km(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],b=f[m+1],_=f[(m+2)%f.length],S=f[(m+3)%f.length],A=T5(t,n,g,b,_,S),T=Math.sign((_-g)*(n-b)-(S-b)*(t-g));if(A<=(T<0?c:l))return!0}return!1}getBounds(t){t||(t=new Ri);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 tn("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return tn("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 Wy=(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 y_{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 Ri),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new y_(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,b=s+p,_=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>=_&&n<=_+A||(n>=l-m&&n<=l+g||n>=C-g&&n<=C+m)&&t>=b&&t<=b+S?!0:t<b&&n<_&&Wy(t,n,b,_,p,g,m)||t>T-p&&n<_&&Wy(t,n,T-p,_,p,g,m)||t>T-p&&n>C-p&&Wy(t,n,T-p,C-p,p,g,m)||t<b&&n>C-p&&Wy(t,n,b,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 lM={};function M5(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 lM[i]||R5(e,t,i,n)}function R5(e,t,n,i){const r={};let s=0;for(let c=0;c<i;c++){const f=c<t?e[c]:Rn.EMPTY.source;r[s++]=f.source,r[s++]=f.style}const l=new T0(r);return lM[n]=l,l}class uw{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 dw(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 k5={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var N5=(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))(N5||{});function fw(e,t){return t.alphaMode==="no-premultiply-alpha"&&k5[e]||e}const O5=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
83
+ `);function D5(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 z5(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=O5.replace(/%forloop%/gi,D5(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 Ff=null;function j5(){var t;if(Ff)return Ff;const e=HA();return Ff=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),Ff=z5(Ff,e),(t=e.getExtension("WEBGL_lose_context"))==null||t.loseContext(),Ff}class L5{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 B5{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new L5,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 Nm=[];let B0=0;ag.register({clear:()=>{if(Nm.length>0)for(const e of Nm)e&&e.destroy();Nm.length=0,B0=0}});function hw(){return B0>0?Nm[--B0]:new B5}function pw(e){e.elements=null,Nm[B0++]=e}let lm=0;const oM=class cM{constructor(t){this.uid=Si("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],t={...cM.defaultOptions,...t},t.maxTextures||(tn("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),t.maxTextures=j5());const{maxTextures:n,attributesInitialSize:i,indicesInitialSize:r}=t;this.attributeBuffer=new uw(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++)pw(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=hw(),r=i.textures;r.clear();const s=n[this.elementStart];let l=fw(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,b=this._batchIndexStart,_="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,z=fw(C.blendMode,R),L=l!==z||c!==C.topology;if(R._batchTick===lm&&!L){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=lm,(r.count>=A||L)&&(this._finishBatch(i,b,g-b,r,l,c,t,_,S),_="renderBatch",b=g,l=z,c=C.topology,i=hw(),r=i.textures,r.clear(),S=[],++lm),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,b,g-b,r,l,c,t,_,S),b=g,++lm),this.elementStart=this.elementSize,this._batchIndexStart=b,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,++lm,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 uw(n);dw(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 dw(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++)pw(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}}};oM.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let I5=oM;var ja=(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))(ja||{});class qm extends wo{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=Si("buffer"),this._resourceType="buffer",this._resourceId=Si("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&ja.STATIC)}set static(t){t?this.descriptor.usage|=ja.STATIC:this.descriptor.usage&=~ja.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=Si("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 uM(e,t){if(!(e instanceof qm)){let n=t?ja.INDEX:ja.VERTEX;e instanceof Array&&(t?(e=new Uint32Array(e),n=ja.INDEX|ja.COPY_DST):(e=new Float32Array(e),n=ja.VERTEX|ja.COPY_DST)),e=new qm({data:e,label:t?"index-mesh-buffer":"vertex-mesh-buffer",usage:n})}return e}function U5(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 b=m;b<r.length;b+=g){const _=r[b],S=r[b+1];_>c&&(c=_),S>f&&(f=S),_<s&&(s=_),S<l&&(l=S)}return n.minX=s,n.minY=l,n.maxX=c,n.maxY=f,n}function H5(e){return(e instanceof qm||Array.isArray(e)||e.BYTES_PER_ELEMENT)&&(e={buffer:e}),e.buffer=uM(e.buffer,!1),e}class P5 extends wo{constructor(t={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=Si("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new qs,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=H5(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=uM(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,U5(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 F5=new Float32Array(1),q5=new Uint32Array(1);class G5 extends P5{constructor(){const n=new qm({data:F5,label:"attribute-batch-buffer",usage:ja.VERTEX|ja.COPY_DST,shrinkToFit:!1}),i=new qm({data:q5,label:"index-batch-buffer",usage:ja.INDEX|ja.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 mw(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 va(`${i} placement hook does not exist in shader`)}}const Y5=/\{\{(.*?)\}\}/g;function gw(e){var i;const t={};return(((i=e.match(Y5))==null?void 0:i.map(r=>r.replace(/[{()}]/g,"")))??[]).forEach(r=>{t[r]=[]}),t}function yw(e,t){let n;const i=/@in\s+([^;]+);/g;for(;(n=i.exec(e))!==null;)t.push(n[1])}function xw(e,t,n=!1){const i=[];yw(t,i),e.forEach(c=>{c.header&&yw(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 bw(e,t){let n;const i=/@out\s+([^;]+);/g;for(;(n=i.exec(e))!==null;)t.push(n[1])}function V5(e){const n=/\b(\w+)\s*:/g.exec(e);return n?n[1]:""}function X5(e){const t=/@.*?\s+/g;return e.replace(t,"")}function K5(e,t){const n=[];bw(t,n),e.forEach(f=>{f.header&&bw(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 ${X5(f)};`).join(`
89
+ `),l=`return VSOutput(
90
+ ${n.sort().map(f=>` ${V5(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 vw(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 pu=Object.create(null),Xb=new Map;let W5=0;function $5({template:e,bits:t}){const n=dM(e,t);if(pu[n])return pu[n];const{vertex:i,fragment:r}=Z5(e,t);return pu[n]=fM(i,r,t),pu[n]}function Q5({template:e,bits:t}){const n=dM(e,t);return pu[n]||(pu[n]=fM(e.vertex,e.fragment,t)),pu[n]}function Z5(e,t){const n=t.map(l=>l.vertex).filter(l=>!!l),i=t.map(l=>l.fragment).filter(l=>!!l);let r=xw(n,e.vertex,!0);r=K5(n,r);const s=xw(i,e.fragment,!0);return{vertex:r,fragment:s}}function dM(e,t){return t.map(n=>(Xb.has(n)||Xb.set(n,W5++),Xb.get(n))).sort((n,i)=>n-i).join("-")+e.vertex+e.fragment}function fM(e,t,n){const i=gw(e),r=gw(t);return n.forEach(s=>{mw(s.vertex,i,s.name),mw(s.fragment,r,s.name)}),{vertex:vw(e,i),fragment:vw(t,r)}}const J5=`
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
+ `,e6=`
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
+ `,t6=`
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
+ `,n6=`
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
+ `,i6={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
+ `}},r6={name:"global-uniforms-bit",vertex:{header:`
235
+ uniform mat3 uProjectionMatrix;
236
+ uniform mat3 uWorldTransformMatrix;
237
+ uniform vec4 uWorldColorAlpha;
238
+ uniform vec2 uResolution;
239
+ `}};function a6({bits:e,name:t}){const n=$5({template:{fragment:e6,vertex:J5},bits:[i6,...e]});return sg.from({name:t,vertex:{source:n.vertex,entryPoint:"main"},fragment:{source:n.fragment,entryPoint:"main"}})}function s6({bits:e,name:t}){return new f_({name:t,...Q5({template:{vertex:t6,fragment:n6},bits:[r6,...e]})})}const l6={name:"color-bit",vertex:{header:`
240
+ @in aColor: vec4<f32>;
241
+ `,main:`
242
+ vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
243
+ `}},o6={name:"color-bit",vertex:{header:`
244
+ in vec4 aColor;
245
+ `,main:`
246
+ vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
247
+ `}},Kb={};function c6(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 u6(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 d6(e){return Kb[e]||(Kb[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
+ ${c6(e)}
263
+ `,main:`
264
+ var uvDx = dpdx(vUV);
265
+ var uvDy = dpdy(vUV);
266
+
267
+ ${u6(e)}
268
+ `}}),Kb[e]}const Wb={};function f6(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 h6(e){return Wb[e]||(Wb[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
+ ${f6(e)}
288
+ `}}),Wb[e]}const p6={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
+ `}},m6={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
+ `}},_w={};function g6(e){let t=_w[e];if(t)return t;const n=new Int32Array(e);for(let i=0;i<e;i++)n[i]=i;return t=_w[e]=new YA({uTextures:{value:n,type:"i32",size:e}},{isStatic:!0}),t}class Sw extends ux{constructor(t){const n=s6({name:"batch",bits:[o6,h6(t),m6]}),i=a6({name:"batch",bits:[l6,d6(t),p6]});super({glProgram:n,gpuProgram:i,resources:{batchSamplers:g6(t)}}),this.maxTextures=t}}let om=null;const hM=class pM extends I5{constructor(t){super(t),this.geometry=new G5,this.name=pM.extension.name,this.vertexSize=6,om??(om=new Sw(t.maxTextures)),this.shader=om}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,b=c.tx,_=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 z=R*2,L=S[z],D=S[z+1];n[r++]=f*L+m*D+b,n[r++]=g*D+p*L+_,n[r++]=A[z],n[r++]=A[z+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,b=c.tx,_=c.ty,S=t.bounds,A=S.maxX,T=S.minX,C=S.maxY,N=S.minY,R=l.uvs,z=t.color,L=s<<16|t.roundPixels&65535;n[r+0]=f*T+m*N+b,n[r+1]=g*N+p*T+_,n[r+2]=R.x0,n[r+3]=R.y0,i[r+4]=z,i[r+5]=L,n[r+6]=f*A+m*N+b,n[r+7]=g*N+p*A+_,n[r+8]=R.x1,n[r+9]=R.y1,i[r+10]=z,i[r+11]=L,n[r+12]=f*A+m*C+b,n[r+13]=g*C+p*A+_,n[r+14]=R.x2,n[r+15]=R.y2,i[r+16]=z,i[r+17]=L,n[r+18]=f*T+m*C+b,n[r+19]=g*C+p*T+_,n[r+20]=R.x3,n[r+21]=R.y3,i[r+22]=z,i[r+23]=L}_updateMaxTextures(t){this.shader.maxTextures!==t&&(om=new Sw(t),this.shader=om)}destroy(){this.shader=null,super.destroy()}};hM.extension={type:[kt.Batcher],name:"default"};let y6=hM;class lg{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 x6(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,b=c.d,_=c.tx,S=c.ty;for(;f<l;){const A=e[n],T=e[n+1];i[r]=p*A+g*T+_,i[r+1]=m*A+b*T+S,r+=s,n+=t,f++}}function b6(e,t,n,i){let r=0;for(t*=n;r<i;)e[t]=0,e[t+1]=0,t+=n,r++}function mM(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 b=0;b<r;b++){const _=e[g],S=e[g+1];e[g]=s*_+c*S+p,e[g+1]=l*_+f*S+m,g+=i}}const v6=new Pt;class x_{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?_A(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)||v6}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 Gm={extension:{type:kt.ShapeBuilder,name:"circle"},build(e,t){let n,i,r,s,l,c;if(e.type==="circle"){const z=e;if(l=c=z.radius,l<=0)return!1;n=z.x,i=z.y,r=s=0}else if(e.type==="ellipse"){const z=e;if(l=z.halfWidth,c=z.halfHeight,l<=0||c<=0)return!1;n=z.x,i=z.y,r=s=0}else{const z=e,L=z.width/2,D=z.height/2;n=z.x+L,i=z.y+D,l=c=Math.max(0,Math.min(z.radius,Math.min(L,D))),r=L-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,b=g,_=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 z=i-A;t[b++]=C,t[b++]=z,t[--_]=z,t[--_]=T}for(let z=1;z<f;z++){const L=Math.PI/2*(z/f),D=r+Math.cos(L)*l,F=s+Math.sin(L)*c,Z=n+D,K=n-D,V=i+F,P=i-F;t[m++]=Z,t[m++]=V,t[--g]=V,t[--g]=K,t[b++]=K,t[b++]=P,t[--_]=P,t[--_]=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[--_]=R,t[--_]=T,r&&(t[m++]=C,t[m++]=N,t[--_]=R,t[--_]=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}},_6={...Gm,extension:{...Gm.extension,name:"ellipse"}},S6={...Gm,extension:{...Gm.extension,name:"roundedRectangle"}},gM=1e-4,Ew=1e-4;function E6(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 ww(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 b,_;l?(b=i,_=-n):(b=-i,_=n);const S=f+b,A=p+_,T=m+b,C=g+_;return c.push(S,A),c.push(T,C),2}function dd(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 b=m;const _=g-m,S=Math.abs(_),A=Math.sqrt(f*f+p*p),T=(15*S*Math.sqrt(A)/Math.PI>>0)+1,C=_/T;if(b+=C,c){l.push(e,t),l.push(n,i);for(let N=1,R=b;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=b;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 w6(e,t,n,i,r,s){const l=gM;if(e.length===0)return;const c=t;let f=c.alignment;if(t.alignment!==.5){let Q=E6(e);f=(f-.5)*Q+.5}const p=new Fr(e[0],e[1]),m=new Fr(e[e.length-2],e[e.length-1]),g=i,b=Math.abs(p.x-m.x)<l&&Math.abs(p.y-m.y)<l;if(g){e=e.slice(),b&&(e.pop(),e.pop(),m.set(e[e.length-2],e[e.length-1]));const Q=(p.x+m.x)*.5,H=(m.y+p.y)*.5;e.unshift(Q,H),e.push(Q,H)}const _=r,S=e.length/2;let A=e.length;const T=_.length/2,C=c.width/2,N=C*C,R=c.miterLimit*c.miterLimit;let z=e[0],L=e[1],D=e[2],F=e[3],Z=0,K=0,V=-(L-F),P=z-D,G=0,ne=0,X=Math.sqrt(V*V+P*P);V/=X,P/=X,V*=C,P*=C;const W=f,O=(1-W)*2,Y=W*2;g||(c.cap==="round"?A+=dd(z-V*(O-Y)*.5,L-P*(O-Y)*.5,z-V*O,L-P*O,z+V*Y,L+P*Y,_,!0)+2:c.cap==="square"&&(A+=ww(z,L,V,P,O,Y,!0,_))),_.push(z-V*O,L-P*O),_.push(z+V*Y,L+P*Y);for(let Q=1;Q<S-1;++Q){z=e[(Q-1)*2],L=e[(Q-1)*2+1],D=e[Q*2],F=e[Q*2+1],Z=e[(Q+1)*2],K=e[(Q+1)*2+1],V=-(L-F),P=z-D,X=Math.sqrt(V*V+P*P),V/=X,P/=X,V*=C,P*=C,G=-(F-K),ne=D-Z,X=Math.sqrt(G*G+ne*ne),G/=X,ne/=X,G*=C,ne*=C;const H=D-z,I=L-F,J=D-Z,q=K-F,oe=H*J+I*q,ie=I*J-q*H,de=ie<0;if(Math.abs(ie)<.001*Math.abs(oe)){_.push(D-V*O,F-P*O),_.push(D+V*Y,F+P*Y),oe>=0&&(c.join==="round"?A+=dd(D,F,D-V*O,F-P*O,D-G*O,F-ne*O,_,!1)+4:A+=2,_.push(D-G*Y,F-ne*Y),_.push(D+G*O,F+ne*O));continue}const me=(-V+z)*(-P+F)-(-V+D)*(-P+L),ge=(-G+Z)*(-ne+F)-(-G+D)*(-ne+K),le=(H*ge-J*me)/ie,Re=(q*me-I*ge)/ie,Le=(le-D)*(le-D)+(Re-F)*(Re-F),Be=D+(le-D)*O,He=F+(Re-F)*O,Qe=D-(le-D)*Y,ot=F-(Re-F)*Y,Ue=Math.min(H*H+I*I,J*J+q*q),wt=de?O:Y,Sn=Ue+wt*wt*N;Le<=Sn?c.join==="bevel"||Le/N>R?(de?(_.push(Be,He),_.push(D+V*Y,F+P*Y),_.push(Be,He),_.push(D+G*Y,F+ne*Y)):(_.push(D-V*O,F-P*O),_.push(Qe,ot),_.push(D-G*O,F-ne*O),_.push(Qe,ot)),A+=2):c.join==="round"?de?(_.push(Be,He),_.push(D+V*Y,F+P*Y),A+=dd(D,F,D+V*Y,F+P*Y,D+G*Y,F+ne*Y,_,!0)+4,_.push(Be,He),_.push(D+G*Y,F+ne*Y)):(_.push(D-V*O,F-P*O),_.push(Qe,ot),A+=dd(D,F,D-V*O,F-P*O,D-G*O,F-ne*O,_,!1)+4,_.push(D-G*O,F-ne*O),_.push(Qe,ot)):(_.push(Be,He),_.push(Qe,ot)):(_.push(D-V*O,F-P*O),_.push(D+V*Y,F+P*Y),c.join==="round"?de?A+=dd(D,F,D+V*Y,F+P*Y,D+G*Y,F+ne*Y,_,!0)+2:A+=dd(D,F,D-V*O,F-P*O,D-G*O,F-ne*O,_,!1)+2:c.join==="miter"&&Le/N<=R&&(de?(_.push(Qe,ot),_.push(Qe,ot)):(_.push(Be,He),_.push(Be,He)),A+=2),_.push(D-G*O,F-ne*O),_.push(D+G*Y,F+ne*Y),A+=2)}z=e[(S-2)*2],L=e[(S-2)*2+1],D=e[(S-1)*2],F=e[(S-1)*2+1],V=-(L-F),P=z-D,X=Math.sqrt(V*V+P*P),V/=X,P/=X,V*=C,P*=C,_.push(D-V*O,F-P*O),_.push(D+V*Y,F+P*Y),g||(c.cap==="round"?A+=dd(D-V*(O-Y)*.5,F-P*(O-Y)*.5,D-V*O,F-P*O,D+V*Y,F+P*Y,_,!1)+2:c.cap==="square"&&(A+=ww(D,F,V,P,O,Y,!1,_)));const $=Ew*Ew;for(let Q=T;Q<A+T-2;++Q)z=_[Q*2],L=_[Q*2+1],D=_[(Q+1)*2],F=_[(Q+1)*2+1],Z=_[(Q+2)*2],K=_[(Q+2)*2+1],!(Math.abs(z*(F-K)+D*(K-L)+Z*(L-F))<$)&&s.push(Q,Q+1,Q+2)}function T6(e,t,n,i){const r=gM;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,b=m.length/2;for(let _=0;_<g;_++)m.push(e[_*2]),m.push(e[_*2+1]);for(let _=0;_<g-1;_++)i.push(b+_,b+_+1);p&&i.push(b+g-1,b)}function yM(e,t,n,i,r,s,l){const c=p5(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 C6=[],A6={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){yM(e,C6,t,n,i,r,s)}},M6={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}},R6={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}},Tw=[{offset:0,color:"white"},{offset:1,color:"black"}],b_=class p1{constructor(...t){this.uid=Si("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let n=k6(t);n={...n.type==="radial"?p1.defaultRadialOptions:p1.defaultLinearOptions,...uA(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:Ki.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:Tw,p=this._textureSize,{canvas:m,context:g}=Aw(p,1),b=c?g.createLinearGradient(this._textureSize,0,0,0):g.createLinearGradient(0,0,this._textureSize,0);Cw(b,f),g.fillStyle=b,g.fillRect(0,0,p,1),this.texture=new Rn({source:new j0({resource:m,addressMode:this._wrapMode})});const _=Math.sqrt(s*s+l*l),S=Math.atan2(l,s),A=new Pt;A.scale(_/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:Tw,n=this._textureSize,{canvas:i,context:r}=Aw(n,n),{x:s,y:l}=this.center,{x:c,y:f}=this.outerCenter,p=this.innerRadius,m=this.outerRadius,g=c-m,b=f-m,_=n/(m*2),S=(s-g)*_,A=(l-b)*_,T=r.createRadialGradient(S,A,p*_,(c-g)*_,(f-b)*_,m*_);Cw(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 Rn({source:new j0({resource:i,addressMode:this._wrapMode})});const C=new Pt;C.scale(1/_,1/_),C.translate(g,b),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}`}};b_.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};b_.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let pc=b_;function Cw(e,t){for(let n=0;n<t.length;n++){const i=t[n];e.addColorStop(i.offset,i.color)}}function Aw(e,t){const n=cs.get().createCanvas(e,t),i=n.getContext("2d");return{canvas:n,context:i}}function k6(e){let t=e[0]??{};return(typeof t=="number"||e[1])&&(tn("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]??pc.defaultLinearOptions.textureSize}),t}const N6=new Pt,O6=new Ri;function D6(e,t,n,i){const r=t.matrix?e.copyFrom(t.matrix).invert():e.identity();if(t.textureSpace==="local"){const l=n.getBounds(O6);t.width&&l.pad(t.width);const{x:c,y:f}=l,p=1/l.width,m=1/l.height,g=-c*p,b=-f*m,_=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*_+b*A+r.tx,r.ty=g*S+b*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 pc)&&s.addressMode==="clamp-to-edge"&&(s.addressMode="repeat",s.update()),i&&r.append(N6.copyFrom(i).invert()),r}const dx={};ci.handleByMap(kt.ShapeBuilder,dx);ci.add(M6,A6,R6,Gm,_6,S6);const z6=new Ri,j6=new Pt;function L6(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")B6(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&&Mw(p.shapePath,f,!0,i,n),p&&(c.shapePrimitives[c.shapePrimitives.length-1].holes=p.shapePath.shapePrimitives),Mw(c,f,l,i,n)}}}function B6(e,t,n){const i=[],r=dx.rectangle,s=z6;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&&mM(i,l),r.triangulate(i,c,2,g,p,m);const b=e.image,_=b.uvs;f.push(_.x0,_.y0,_.x1,_.y1,_.x3,_.y3,_.x2,_.y2);const S=Ia.get(x_);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=b,S.geometryData=n,t.push(S)}function Mw(e,t,n,i,r){const{vertices:s,uvs:l,indices:c}=r;e.shapePrimitives.forEach(({shape:f,transform:p,holes:m})=>{const g=[],b=dx[f.type];if(!b.build(f,g))return;const _=c.length,S=s.length/2;let A="triangle-list";if(p&&mM(g,p),n){const R=f.closePath??!0,z=t;z.pixelLine?(T6(g,R,s,c),A="line-list"):w6(g,z,!1,R,s,c)}else if(m){const R=[],z=g.slice();I6(m).forEach(D=>{R.push(z.length/2),z.push(...D)}),yM(z,R,s,2,S,c,_)}else b.triangulate(g,s,2,S,c,_);const T=l.length/2,C=t.texture;if(C!==Rn.WHITE){const R=D6(j6,t,f,p);x6(s,2,S,l,T,2,s.length/2-S,R)}else b6(l,T,2,s.length/2-S);const N=Ia.get(x_);N.indexOffset=_,N.indexSize=c.length-_,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 I6(e){const t=[];for(let n=0;n<e.length;n++){const i=e[n].shape,r=[];dx[i.type].build(i,r)&&t.push(r)}return t}class U6{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(t=>{Ia.return(t)}),this.graphicsData&&Ia.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 H6{constructor(){this.instructions=new c_}init(t){const n=t.maxTextures;this.batcher?this.batcher._updateMaxTextures(n):this.batcher=new y6({maxTextures:n}),this.instructions.reset()}get geometry(){return tn(LD,"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 v_=class m1{constructor(t){this._renderer=t,this._managedContexts=new lg({renderer:t,type:"resource",name:"graphicsContext"})}init(t){m1.defaultOptions.bezierSmoothness=(t==null?void 0:t.bezierSmoothness)??m1.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(),L6(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=Ia.get(H6,{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 b=r[g];f.add(b)}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 b=m[g];b.bindGroup=M5(b.textures.textures,b.textures.count,this._renderer.limits.maxBatchableTextures)}return n}_initContext(t){const n=new U6;return n.context=t,t._gpuData[this._renderer.uid]=n,this._managedContexts.add(t),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};v_.extension={type:[kt.WebGLSystem,kt.WebGPUSystem],name:"graphicsContext"};v_.defaultOptions={bezierSmoothness:.5};let __=v_;const P6=8,$y=11920929e-14,F6=1;function xM(e,t,n,i,r,s,l,c,f,p){const g=Math.min(.99,Math.max(0,p??__.defaultOptions.bezierSmoothness));let b=(F6-g)/1;return b*=b,q6(t,n,i,r,s,l,c,f,e,b),e}function q6(e,t,n,i,r,s,l,c,f,p){g1(e,t,n,i,r,s,l,c,f,p,0),f.push(l,c)}function g1(e,t,n,i,r,s,l,c,f,p,m){if(m>P6)return;const g=(e+n)/2,b=(t+i)/2,_=(n+r)/2,S=(i+s)/2,A=(r+l)/2,T=(s+c)/2,C=(g+_)/2,N=(b+S)/2,R=(_+A)/2,z=(S+T)/2,L=(C+R)/2,D=(N+z)/2;if(m>0){let F=l-e,Z=c-t;const K=Math.abs((n-l)*Z-(i-c)*F),V=Math.abs((r-l)*Z-(s-c)*F);if(K>$y&&V>$y){if((K+V)*(K+V)<=p*(F*F+Z*Z)){f.push(L,D);return}}else if(K>$y){if(K*K<=p*(F*F+Z*Z)){f.push(L,D);return}}else if(V>$y){if(V*V<=p*(F*F+Z*Z)){f.push(L,D);return}}else if(F=L-(e+l)/2,Z=D-(t+c)/2,F*F+Z*Z<=p){f.push(L,D);return}}g1(e,t,g,b,C,N,L,D,f,p,m+1),g1(L,D,R,z,A,T,l,c,f,p,m+1)}const G6=8,Y6=11920929e-14,V6=1;function X6(e,t,n,i,r,s,l,c){const p=Math.min(.99,Math.max(0,c??__.defaultOptions.bezierSmoothness));let m=(V6-p)/1;return m*=m,K6(t,n,i,r,s,l,e,m),e}function K6(e,t,n,i,r,s,l,c){y1(l,e,t,n,i,r,s,c,0),l.push(r,s)}function y1(e,t,n,i,r,s,l,c,f){if(f>G6)return;const p=(t+i)/2,m=(n+r)/2,g=(i+s)/2,b=(r+l)/2,_=(p+g)/2,S=(m+b)/2;let A=s-t,T=l-n;const C=Math.abs((i-s)*T-(r-l)*A);if(C>Y6){if(C*C<=c*(A*A+T*T)){e.push(_,S);return}}else if(A=_-(t+s)/2,T=S-(n+l)/2,A*A+T*T<=c){e.push(_,S);return}y1(e,t,n,p,m,_,S,c,f+1),y1(e,_,S,g,b,s,l,c,f+1)}function bM(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 b=Math.cos(m),_=Math.sin(m),S=t+b*i,A=n+_*i;e.push(S,A),m+=p}}function W6(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,b=Math.abs(f*g-p*m);if(b<1e-8||s===0){(e[e.length-2]!==t||e[e.length-1]!==n)&&e.push(t,n);return}const _=f*f+p*p,S=m*m+g*g,A=f*m+p*g,T=s*Math.sqrt(_)/b,C=s*Math.sqrt(S)/b,N=T*A/_,R=C*A/S,z=T*g+C*p,L=T*m+C*f,D=p*(C+N),F=f*(C+N),Z=g*(T+R),K=m*(T+R),V=Math.atan2(F-L,D-z),P=Math.atan2(K-L,Z-z);bM(e,z+t,L+n,s,V,P,p*m>g*f)}const Om=Math.PI*2,$b={centerX:0,centerY:0,ang1:0,ang2:0},Qb=({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 $6(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 Rw=(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)},Q6=(e,t,n,i,r,s,l,c,f,p,m,g,b)=>{const _=Math.pow(r,2),S=Math.pow(s,2),A=Math.pow(m,2),T=Math.pow(g,2);let C=_*S-_*T-S*A;C<0&&(C=0),C/=_*T+S*A,C=Math.sqrt(C)*(l===c?-1:1);const N=C*r/s*g,R=C*-s/r*m,z=p*N-f*R+(e+n)/2,L=f*N+p*R+(t+i)/2,D=(m-N)/r,F=(g-R)/s,Z=(-m-N)/r,K=(-g-R)/s,V=Rw(1,0,D,F);let P=Rw(D,F,Z,K);c===0&&P>0&&(P-=Om),c===1&&P<0&&(P+=Om),b.centerX=z,b.centerY=L,b.ang1=V,b.ang2=P};function Z6(e,t,n,i,r,s,l,c=0,f=0,p=0){if(s===0||l===0)return;const m=Math.sin(c*Om/360),g=Math.cos(c*Om/360),b=g*(t-i)/2+m*(n-r)/2,_=-m*(t-i)/2+g*(n-r)/2;if(b===0&&_===0)return;s=Math.abs(s),l=Math.abs(l);const S=Math.pow(b,2)/Math.pow(s,2)+Math.pow(_,2)/Math.pow(l,2);S>1&&(s*=Math.sqrt(S),l*=Math.sqrt(S)),Q6(t,n,i,r,s,l,f,p,m,g,b,_,$b);let{ang1:A,ang2:T}=$b;const{centerX:C,centerY:N}=$b;let R=Math.abs(T)/(Om/4);Math.abs(1-R)<1e-7&&(R=1);const z=Math.max(Math.ceil(R),1);T/=z;let L=e[e.length-2],D=e[e.length-1];const F={x:0,y:0};for(let Z=0;Z<z;Z++){const K=$6(A,T),{x:V,y:P}=Qb(K[0],s,l,g,m,C,N,F),{x:G,y:ne}=Qb(K[1],s,l,g,m,C,N,F),{x:X,y:W}=Qb(K[2],s,l,g,m,C,N,F);xM(e,L,D,V,P,G,ne,X,W),L=X,D=W,A+=T}}function J6(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,b=p/m;return{len:m,nx:g,ny:b}},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 b=Math.asin(m.nx*g.ny-m.ny*g.nx),_=1,S=!1;m.nx*g.nx-m.ny*-g.ny<0?b<0?b=Math.PI+b:(b=Math.PI-b,_=-1,S=!0):b>0&&(_=-1,S=!0);const A=b/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*_,R=c.y+g.ny*C+g.nx*T*_,z=Math.atan2(m.ny,m.nx)+Math.PI/2*_,L=Math.atan2(g.ny,g.nx)-Math.PI/2*_;l===0&&e.moveTo(N+Math.cos(z)*T,R+Math.sin(z)*T),e.arc(N,R,T,z,L,S),s=c}}function ej(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],b=r(m,f);let _;if(b<1e-4)_=f;else{const T=Math.min(b/2,p);_=s(f,m,T/b)}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(_.x,_.y):e.lineTo(_.x,_.y),e.quadraticCurveTo(f.x,f.y,A.x,A.y,i)}}const tj=new Ri;class nj{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new qs,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 bM(c,t,n,i,r,s,l),this}arcTo(t,n,i,r,s){this._ensurePoly();const l=this._currentPoly.points;return W6(l,t,n,i,r,s),this}arcToSvg(t,n,i,r,s,l,c){const f=this._currentPoly.points;return Z6(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 xM(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 X6(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 Ri(t,n,i,r),s),this}circle(t,n,i,r){return this.drawShape(new m_(t,n,i),r),this}poly(t,n,i){const r=new km(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 b=0;b<r;b++){const _=b*m+p,S=t+i*Math.cos(_),A=n+i*Math.sin(_),T=_+Math.PI+g,C=_-Math.PI-g,N=S+s*Math.cos(T),R=A+s*Math.sin(T),z=S+s*Math.cos(C),L=A+s*Math.sin(C);b===0?this.moveTo(N,R):this.lineTo(N,R),this.quadraticCurveTo(S,A,z,L,c)}return this.closePath()}roundShape(t,n,i=!1,r){return t.length<3?this:(i?ej(this,t,n,r):J6(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 g_(t,n,i,r),s),this}roundRect(t,n,i,r,s,l){return this.drawShape(new y_(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 km,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 km,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(tj);r.transform?t.addRect(s,r.transform):t.addRect(s)}return t}}class fc{constructor(t,n=!1){this.instructions=[],this.uid=Si("graphicsPath"),this._dirty=!0,this.checkForHoles=n,typeof t=="string"?w5(t,this):this.instructions=(t==null?void 0:t.slice())??[]}get shapePath(){return this._shapePath||(this._shapePath=new nj(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(Fr.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(Fr.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 b=0;b<p;b++){const _=b%2?s:r,S=b*m+f;g.push(t+_*Math.cos(S),n+_*Math.sin(S))}return this.poly(g,!0,c),this}clone(t=!1){const n=new fc;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,b=0,_=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],b=N[2],_=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*b+r*_+l,N[3]=i*b+s*_+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]=cm(N[3],t);break;case"rect":N[4]=cm(N[4],t);break;case"ellipse":N[8]=cm(N[8],t);break;case"roundRect":N[5]=cm(N[5],t);break;case"addPath":N[0].transform(t);break;case"poly":N[2]=cm(N[2],t);break;default:va("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 cm(e,t){return e?e.prepend(t):t.clone()}function vi(e,t,n){const i=e.getAttribute(t);return i?Number(i):n}function ij(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]=rj(l);break;case"radialgradient":t.defs[l.id]=aj();break}}}}function rj(e){const t=vi(e,"x1",0),n=vi(e,"y1",0),i=vi(e,"x2",1),r=vi(e,"y2",0),s=e.getAttribute("gradientUnits")||"objectBoundingBox",l=new pc(t,n,i,r,s==="objectBoundingBox"?"local":"global");for(let c=0;c<e.children.length;c++){const f=e.children[c],p=vi(f,"offset",0),m=Ki.shared.setValue(f.getAttribute("stop-color")).toNumber();l.addColorStop(p,m)}return l}function aj(e){return va("[SVG Parser] Radial gradients are not yet supported"),new pc(0,0,1,0)}function kw(e){const t=e.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return t?t[1]:""}const Nw={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 vM(e,t){const n=e.getAttribute("style"),i={},r={},s={strokeStyle:i,fillStyle:r,useFill:!1,useStroke:!1};for(const l in Nw){const c=e.getAttribute(l);c&&Ow(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(":");Nw[p]&&Ow(t,s,p,m.trim())}}return{strokeStyle:s.useStroke?i:null,fillStyle:s.useFill?r:null,useFill:s.useFill,useStroke:s.useStroke}}function Ow(e,t,n,i){switch(n){case"stroke":if(i!=="none"){if(i.startsWith("url(")){const r=kw(i);t.strokeStyle.fill=e.defs[r]}else t.strokeStyle.color=Ki.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=kw(i);t.fillStyle.fill=e.defs[r]}else t.fillStyle.color=Ki.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 sj(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 lj(e){return e.split(/(?=[Mm])/).filter(i=>i.trim().length>0)}function oj(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 Dw(e,t){const n=new fc(e,!1);for(const i of n.instructions)t.instructions.push(i)}function cj(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 fc};ij(e,n);const i=e.children,{fillStyle:r,strokeStyle:s}=vM(e,n);for(let l=0;l<i.length;l++){const c=i[l];c.nodeName.toLowerCase()!=="defs"&&_M(c,n,r,s)}return t}function _M(e,t,n,i){const r=e.children,{fillStyle:s,strokeStyle:l}=vM(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,b,_,S,A,T,C,N,R,z,L,D,F,Z;switch(e.nodeName.toLowerCase()){case"path":{L=e.getAttribute("d");const K=e.getAttribute("fill-rule"),V=lj(L),P=K==="evenodd",G=V.length>1;if(P&&G){const X=V.map(O=>({path:O,area:oj(O)}));if(X.sort((O,Y)=>Y.area-O.area),V.length>3||!sj(X))for(let O=0;O<X.length;O++){const Y=X[O],$=O===0;t.context.beginPath();const Q=new fc(void 0,!0);Dw(Y.path,Q),t.context.path(Q),$?(n&&t.context.fill(n),i&&t.context.stroke(i)):t.context.cut()}else for(let O=0;O<X.length;O++){const Y=X[O],$=O%2===1;t.context.beginPath();const Q=new fc(void 0,!0);Dw(Y.path,Q),t.context.path(Q),$?t.context.cut():(n&&t.context.fill(n),i&&t.context.stroke(i))}}else{const X=K?K==="evenodd":!0;D=new fc(L,X),t.context.path(D),n&&t.context.fill(n),i&&t.context.stroke(i)}break}case"circle":S=vi(e,"cx",0),A=vi(e,"cy",0),T=vi(e,"r",0),t.context.ellipse(S,A,T,T),n&&t.context.fill(n),i&&t.context.stroke(i);break;case"rect":f=vi(e,"x",0),p=vi(e,"y",0),F=vi(e,"width",0),Z=vi(e,"height",0),C=vi(e,"rx",0),N=vi(e,"ry",0),C||N?t.context.roundRect(f,p,F,Z,C||N):t.context.rect(f,p,F,Z),n&&t.context.fill(n),i&&t.context.stroke(i);break;case"ellipse":S=vi(e,"cx",0),A=vi(e,"cy",0),C=vi(e,"rx",0),N=vi(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=vi(e,"x1",0),g=vi(e,"y1",0),b=vi(e,"x2",0),_=vi(e,"y2",0),t.context.beginPath(),t.context.moveTo(m,g),t.context.lineTo(b,_),i&&t.context.stroke(i);break;case"polygon":z=e.getAttribute("points"),R=z.match(/-?\d+/g).map(K=>parseInt(K,10)),t.context.poly(R,!0),n&&t.context.fill(n),i&&t.context.stroke(i);break;case"polyline":z=e.getAttribute("points"),R=z.match(/-?\d+/g).map(K=>parseInt(K,10)),t.context.poly(R,!1),i&&t.context.stroke(i);break;case"g":case"svg":break;default:{va(`[SVG parser] <${e.nodeName}> elements unsupported`);break}}c&&(n=null);for(let K=0;K<r.length;K++)_M(r[K],t,n,i)}const zw={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 fx{constructor(t,n){this.uid=Si("fillPattern"),this._tick=0,this.transform=new Pt,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),n&&(t.source.style.addressModeU=zw[n].addressModeU,t.source.style.addressModeV=zw[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 uj(e){return Ki.isColorLike(e)}function jw(e){return e instanceof fx}function Lw(e){return e instanceof pc}function dj(e){return e instanceof Rn}function fj(e,t,n){const i=Ki.shared.setValue(t??0);return e.color=i.toNumber(),e.alpha=i.alpha===1?n.alpha:i.alpha,e.texture=Rn.WHITE,{...n,...e}}function hj(e,t,n){return e.texture=t,{...n,...e}}function Bw(e,t,n){return e.fill=t,e.color=16777215,e.texture=t.texture,e.matrix=t.transform,{...n,...e}}function Iw(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 pj(e,t){const n={...t,...e},i=Ki.shared.setValue(n.color);return n.alpha*=i.alpha,n.color=i.toNumber(),n}function Ed(e,t){if(e==null)return null;const n={},i=e;return uj(e)?fj(n,e,t):dj(e)?hj(n,e,t):jw(e)?Bw(n,e,t):Lw(e)?Iw(n,e,t):i.fill&&jw(i.fill)?Bw(i,i.fill,t):i.fill&&Lw(i.fill)?Iw(i,i.fill,t):pj(i,t)}function I0(e,t){const{width:n,alignment:i,miterLimit:r,cap:s,join:l,pixelLine:c,...f}=t,p=Ed(e,f);return p?{width:n,alignment:i,miterLimit:r,cap:s,join:l,pixelLine:c,...p}:null}function mj(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,b=l[m],_=l[m+1],S=l[p],A=l[p+1],T=l[g],C=l[g+1],N=b-S,R=_-A,z=T-S,L=C-A,D=N*N+R*R,F=z*z+L*L;if(D<1e-12||F<1e-12)continue;let V=(N*z+R*L)/Math.sqrt(D*F);V<-1?V=-1:V>1&&(V=1);const P=Math.sqrt((1-V)*.5);if(P<1e-6)continue;const G=Math.min(1/P,t);G>n&&(n=G)}}return n}const gj=new Fr,Uw=new Pt,S_=class yo extends wo{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=Si("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new fc,this._transform=new Pt,this._fillStyle={...yo.defaultFillStyle},this._strokeStyle={...yo.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new qs,this._boundsDirty=!0}clone(){const t=new yo;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=Ed(t,yo.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=I0(t,yo.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=Ed(t,yo.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=Ed(t,yo.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?Ki.shared.setValue(n).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new fc,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"&&(tn(_i,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),t={color:t,alpha:n}),this._fillStyle=Ed(t,yo.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(Fr.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=I0(t,yo.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++,cj(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 Pt?(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 Pt?(this._transform.append(t),this):(Uw.set(t,n,i,r,s,l),this._transform.append(Uw),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*=mj(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 b=m[g].shape;if(!p||!b)continue;const _=m[g].transform,S=_?_.applyInverse(t,gj):t;if(l.action==="fill")i=b.contains(S.x,S.y);else{const T=p;i=b.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}};S_.defaultFillStyle={color:16777215,alpha:1,texture:Rn.WHITE,matrix:null,fill:null,textureSpace:"local"};S_.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:Rn.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let Sl=S_;class yj{constructor(){this.isBatchable=!1}reset(){this.isBatchable=!1,this.context=null,this.graphicsData&&(this.graphicsData.destroy(),this.graphicsData=null)}destroy(){this.reset()}}class xj{constructor(){this.instructions=new c_}init(){this.instructions.reset()}destroy(){this.instructions.destroy(),this.instructions=null}}const E_=class x1{constructor(t){this._renderer=t,this._managedContexts=new lg({renderer:t,type:"resource",name:"graphicsContext"})}init(t){x1.defaultOptions.bezierSmoothness=(t==null?void 0:t.bezierSmoothness)??x1.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 xj,i=this.getGpuContext(t);return i.graphicsData=n,n.init(),n}_initContext(t){const n=new yj;return n.context=t,t._gpuData[this._renderer.uid]=n,this._managedContexts.add(t),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};E_.extension={type:[kt.CanvasSystem],name:"graphicsContext"};E_.defaultOptions={bezierSmoothness:.5};let bj=E_;class SM{constructor(t,n){this.state=h_.for2d(),this.renderer=t,this._adaptor=n,this.renderer.runners.contextChange.add(this),this._managedGraphics=new lg({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}}SM.extension={type:[kt.CanvasPipes],name:"graphics"};function vj(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 _j{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(t=>{Ia.return(t)}),this.batches.length=0}}class EM{constructor(t,n){this.state=h_.for2d(),this.renderer=t,this._adaptor=n,this.renderer.runners.contextChange.add(this),this._managedGraphics=new lg({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,vj(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 _j;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=Ia.get(x_);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}}EM.extension={type:[kt.WebGLPipes,kt.WebGPUPipes],name:"graphics"};ci.add(SM);ci.add(EM);ci.add(bj);ci.add(__);class La extends u_{constructor(t){t instanceof Sl&&(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 Sl,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 La(this._context.clone()):(this._ownedContext=null,new La(this._context))}lineStyle(t,n,i){tn(_i,"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){tn(_i,"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(){tn(_i,"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!==Sl.defaultStrokeStyle.width||t.color!==Sl.defaultStrokeStyle.color||t.alpha!==Sl.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...t){return tn(_i,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return tn(_i,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return tn(_i,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return tn(_i,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return tn(_i,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return tn(_i,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}class Sj extends u_{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 Er({_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 Ej(e,t){let n=e[0]??{};return(typeof n=="string"||e[1])&&(tn(_i,`use new ${t}({ text: "hi!", style }) instead`),n={text:n,style:e[1]}),n}class wj{constructor(t){this._canvasPool=Object.create(null),this.canvasOptions=t||{},this.enableFullScreen=!1}_createCanvasAndContext(t,n){const i=cs.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=hh(t),n=hh(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 b1=new wj;ag.register(b1);let fd=null,cc=null;function Tj(e,t){fd||(fd=cs.get().createCanvas(256,128),cc=fd.getContext("2d",{willReadFrequently:!0}),cc.globalCompositeOperation="copy",cc.globalAlpha=1),(fd.width<e||fd.height<t)&&(fd.width=hh(e),fd.height=hh(t))}function Hw(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 Pw(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 Cj(...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(Tj(r,s),!cc)throw new TypeError("Failed to get canvas 2D context");cc.drawImage(n,0,0,r,s,0,0,r*i,s*i);const f=cc.getImageData(0,0,r,s).data;let p=0,m=0,g=r-1,b=s-1;for(;m<s&&Hw(f,r,m);)++m;if(m===s)return Ri.EMPTY;for(;Hw(f,r,b);)--b;for(;Pw(f,r,p,m,b);)++p;for(;Pw(f,r,g,m,b);)--g;return++g,++b,cc.globalCompositeOperation="source-over",cc.strokeRect(p,m,g-p,b-m),cc.globalCompositeOperation="copy",l??(l=new Ri),l.set(p/i,m/i,(g-p)/i,(b-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 Aj{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 Mj(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 Aj(e,t,n)}function wM(e){return!!e.tagStyles&&Object.keys(e.tagStyles).length>0}function TM(e){return e.includes("<")}function Rj(e,t){return e.clone().assign(t)}function kj(e,t){const n=[],i=t.tagStyles;if(!wM(t)||!TM(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 b=r[r.length-1],_=Rj(b,i[g]);r.push(_),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 Nj=[10,13],Oj=new Set(Nj),Dj=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288],zj=new Set(Dj),jj=[9,32];new Set(jj);const Lj=[45,8208,8211,8212,173],Bj=new Set(Lj),Ij=/(\r\n|\r|\n)/,Uj=/(?:\r\n|\r|\n)/;function U0(e){return typeof e!="string"?!1:Oj.has(e.charCodeAt(0))}function Fs(e,t){return typeof e!="string"?!1:zj.has(e.charCodeAt(0))}function Hj(e){return typeof e!="string"?!1:Bj.has(e.charCodeAt(0))}function CM(e){return e==="normal"||e==="pre-line"}function AM(e){return e==="normal"}function oc(e){if(typeof e!="string")return"";let t=e.length-1;for(;t>=0&&Fs(e[t]);)t--;return t<e.length-1?e.slice(0,t+1):e}function MM(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(Fs(r)||U0(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),Hj(r)&&s&&!Fs(s)&&!U0(s)&&(t.push(n.join("")),n.length=0)}return n.length>0&&t.push(n.join("")),t}function RM(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 Pj=/\r\n|\r|\n/g;function Fj(e,t,n,i,r,s,l,c){var W,O;const f=kj(e,t);if(AM(t.whiteSpace))for(let Y=0;Y<f.length;Y++){const $=f[Y];f[Y]={text:$.text.replace(Pj," "),style:$.style}}const m=[];let g=[];for(const Y of f){const $=Y.text.split(Ij);for(let Q=0;Q<$.length;Q++){const H=$[Q];H===`\r
307
+ `||H==="\r"||H===`
308
+ `?(m.push(g),g=[]):H.length>0&&g.push({text:H,style:Y.style})}}(g.length>0||m.length===0)&&m.push(g);const b=n?qj(m,t,i,r,l,c):m,_=[],S=[],A=[],T=[],C=[];let N=0;const R=t._fontString,z=s(R);z.fontSize===0&&(z.fontSize=t.fontSize,z.ascent=t.fontSize);let L="",D=!!t.dropShadow,F=((W=t._stroke)==null?void 0:W.width)||0;for(const Y of b){let $=0,Q=z.ascent,H=z.descent,I="";for(const q of Y){const oe=q.style._fontString,ie=s(oe);oe!==L&&(i.font=oe,L=oe);const de=r(q.text,q.style.letterSpacing,i);$+=de,Q=Math.max(Q,ie.ascent),H=Math.max(H,ie.descent),I+=q.text;const me=((O=q.style._stroke)==null?void 0:O.width)||0;me>F&&(F=me),!D&&q.style.dropShadow&&(D=!0)}Y.length===0&&(Q=z.ascent,H=z.descent),_.push($),S.push(Q),A.push(H),C.push(I);const J=t.lineHeight||Q+H;T.push(J+t.leading),N=Math.max(N,$)}const Z=F,P=(n&&t.align!=="left"?Math.max(N,t.wordWrapWidth):N)+Z+(t.dropShadow?t.dropShadow.distance:0);let G=0;for(let Y=0;Y<T.length;Y++)G+=T[Y];G=Math.max(G,T[0]+Z);const ne=G+(t.dropShadow?t.dropShadow.distance:0),X=t.lineHeight||z.fontSize;return{width:P,height:ne,lines:C,lineWidths:_,lineHeight:X+t.leading,maxLineWidth:N,fontProperties:z,runsByLine:b,lineAscents:S,lineDescents:A,lineHeights:T,hasDropShadow:D}}function qj(e,t,n,i,r,s){var T;const{letterSpacing:l,whiteSpace:c,wordWrapWidth:f,breakWords:p}=t,m=CM(c),g=f+l,b={};let _="";const S=(C,N)=>{const R=`${C}|${N.styleKey}`;let z=b[R];if(z===void 0){const L=N._fontString;L!==_&&(n.font=L,_=L),z=i(C,N.letterSpacing,n)+N.letterSpacing,b[R]=z}return z},A=[];for(const C of e){const N=Gj(C),R=A.length,z=G=>{let ne=0,X=G;do{const{token:W,style:O}=N[X];ne+=S(W,O),X++}while(X<N.length&&N[X].continuesFromPrevious);return ne},L=G=>{const ne=[];let X=G;do ne.push({token:N[X].token,style:N[X].style}),X++;while(X<N.length&&N[X].continuesFromPrevious);return ne};let D=[],F=0,Z=!m,K=null;const V=()=>{K&&K.text.length>0&&D.push(K),K=null},P=()=>{if(V(),D.length>0){const G=D[D.length-1];G.text=oc(G.text),G.text.length===0&&D.pop()}A.push(D),D=[],F=0,Z=!1};for(let G=0;G<N.length;G++){const{token:ne,style:X,continuesFromPrevious:W}=N[G],O=S(ne,X);if(m){const Q=Fs(ne),H=(K==null?void 0:K.text[K.text.length-1])??((T=D[D.length-1])==null?void 0:T.text.slice(-1))??"",I=H?Fs(H):!1;if(Q&&I)continue}const Y=!W,$=Y?z(G):O;if($>g&&Y)if(F>0&&P(),p){const Q=L(G);for(let H=0;H<Q.length;H++){const I=Q[H].token,J=Q[H].style,q=RM(I,p,s,r);for(const oe of q){const ie=S(oe,J);ie+F>g&&P(),!K||K.style!==J?(V(),K={text:oe,style:J}):K.text+=oe,F+=ie}}G+=Q.length-1}else{const Q=L(G);V(),A.push(Q.map(H=>({text:H.token,style:H.style}))),Z=!1,G+=Q.length-1}else if($+F>g&&Y){if(Fs(ne)){Z=!1;continue}P(),K={text:ne,style:X},F=O}else if(W&&!p)!K||K.style!==X?(V(),K={text:ne,style:X}):K.text+=ne,F+=O;else{const Q=Fs(ne);if(F===0&&Q&&!Z)continue;!K||K.style!==X?(V(),K={text:ne,style:X}):K.text+=ne,F+=O}}if(V(),D.length>0){const G=D[D.length-1];G.text=oc(G.text),G.text.length===0&&D.pop()}(D.length>0||A.length===R)&&A.push(D)}return A}function Gj(e){const t=[];let n=!1;for(const i of e){const r=MM(i.text);let s=!0;for(const l of r){const c=Fs(l)||U0(l),f=s&&n&&!c;t.push({token:l,style:i.style,continuesFromPrevious:f}),n=!c,s=!1}}return t}const Yj={willReadFrequently:!0};function Fw(e,t,n,i,r){let s=n[e];return typeof s!="number"&&(s=r(e,t,i)+t,n[e]=s),s}function Vj(e,t,n,i,r,s,l){const c=n.getContext("2d",Yj);c.font=t._fontString;let f=0,p="";const m=[],g=Object.create(null),{letterSpacing:b,whiteSpace:_}=t,S=CM(_),A=AM(_);let T=!S;const C=t.wordWrapWidth+b,N=MM(e);for(let z=0;z<N.length;z++){let L=N[z];if(U0(L)){if(!A){m.push(oc(p)),T=!S,p="",f=0;continue}L=" "}if(S){const F=Fs(L),Z=Fs(p[p.length-1]);if(F&&Z)continue}const D=Fw(L,b,g,c,i);if(D>C)if(p!==""&&(m.push(oc(p)),p="",f=0),r(L,t.breakWords)){const F=RM(L,t.breakWords,l,s);for(const Z of F){const K=Fw(Z,b,g,c,i);K+f>C&&(m.push(oc(p)),T=!1,p="",f=0),p+=Z,f+=K}}else p.length>0&&(m.push(oc(p)),p="",f=0),m.push(oc(L)),T=!1,p="",f=0;else D+f>C&&(T=!1,m.push(oc(p)),p="",f=0),(p.length>0||!Fs(L)||T)&&(p+=L,f+=D)}const R=oc(p);return R.length>0&&m.push(R),m.join(`
309
+ `)}const qw={willReadFrequently:!0},gc=class gt{static get experimentalLetterSpacingSupported(){let t=gt._experimentalLetterSpacingSupported;if(t===void 0){const n=cs.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 L;const s=`${t}-${n.styleKey}-wordWrap-${r}`;if(gt._measurementCache.has(s))return gt._measurementCache.get(s);if(wM(n)&&TM(t)){const D=Fj(t,n,r,gt._context,gt._measureText,gt.measureFont,gt.canBreakChars,gt.wordWrapSplit),F=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,F),F}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(Uj),b=new Array(g.length);let _=0;for(let D=0;D<g.length;D++){const F=gt._measureText(g[D],n.letterSpacing,p);b[D]=F,_=Math.max(_,F)}const S=((L=n._stroke)==null?void 0:L.width)??0,A=n.lineHeight||f.fontSize,T=gt._getAlignWidth(_,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),z=new gt(t,n,C,R,g,b,A+n.leading,_,f);return gt._measurementCache.set(s,z),z}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 Vj(t,n,i,gt._measureText,gt.canBreakWords,gt.canBreakChars,gt.wordWrapSplit)}static isBreakingSpace(t,n){return Fs(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",qw);if(i!=null&&i.measureText)return gt.__canvas=n,n;t=cs.get().createCanvas()}catch{t=cs.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",qw)),gt.__context}};gc.METRICS_STRING="|ÉqÅ";gc.BASELINE_SYMBOL="M";gc.BASELINE_MULTIPLIER=1.4;gc.HEIGHT_MULTIPLIER=2;gc.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]})();gc.experimentalLetterSpacing=!1;gc._fonts={};gc._measurementCache=Mj(1e3);let du=gc;const Xj=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function v1(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)&&!Xj.includes(r)&&(r=`"${r}"`),n[i]=r}return`${e.fontStyle} ${e.fontVariant} ${e.fontWeight} ${t} ${n.join(",")}`}const Gw=1e5;function Qy(e,t,n,i=0,r=0,s=0){if(e.texture===Rn.WHITE&&!e.fill)return Ki.shared.setValue(e.color).setAlpha(e.alpha??1).toHexa();if(e.fill){if(e.fill instanceof fx){const l=e.fill,c=t.createPattern(l.texture.source.resource,"repeat"),f=l.transform.copyTo(Pt.shared);return f.scale(l.texture.source.pixelWidth,l.texture.source.pixelHeight),c.setTransform(f),c}else if(e.fill instanceof pc){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,b=!1;if(c){const{start:_,end:S}=l;g=t.createLinearGradient(_.x*p+r,_.y*m+s,S.x*p+r,S.y*m+s),b=Math.abs(S.x-_.x)<Math.abs((S.y-_.y)*.1)}else{const{center:_,innerRadius:S,outerCenter:A,outerRadius:T}=l;g=t.createRadialGradient(_.x*p+r,_.y*m+s,S*p,A.x*p+r,A.y*m+s,T*p)}if(b&&f&&n){const _=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*_;C=Math.max(0,Math.min(1,C)),g.addColorStop(Math.floor(C*Gw)/Gw,Ki.shared.setValue(T.color).toHex())})}}else l.colorStops.forEach(_=>{g.addColorStop(_.offset,Ki.shared.setValue(_.color).toHex())});return g}}else{const l=t.createPattern(e.texture.source.resource,"repeat"),c=e.matrix.copyTo(Pt.shared);return c.scale(e.texture.source.pixelWidth,e.texture.source.pixelHeight),l.setTransform(c),l}return va("FillStyle not recognised",e),"red"}const Yw=new Ri;function qf(e){let t=0;for(let n=0;n<e.length;n++)e.charCodeAt(n)===32&&t++;return t}class Kj{getCanvasAndContext(t){const{text:n,style:i,resolution:r=1}=t,s=i._getFinalPadding(),l=du.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=b1.getOptimalCanvasAndContext(c,f);this._renderTextToCanvas(i,s,r,p,l);const m=i.trim?Cj({canvas:p.canvas,width:c,height:f,resolution:1,output:Yw}):Yw.set(0,0,c,f);return{canvasAndContext:p,frame:m}}returnCanvasAndContext(t){b1.returnCanvasAndContext(t)}_renderTextToCanvas(t,n,i,r,s){var D,F,Z;if(s.runsByLine&&s.runsByLine.length>0){this._renderTaggedTextToCanvas(s,t,n,i,r);return}const{canvas:l,context:c}=r,f=v1(t),p=s.lines,m=s.lineHeight,g=s.lineWidths,b=s.maxLineWidth,_=s.fontProperties,S=l.height;if(c.resetTransform(),c.scale(i,i),c.textBaseline=t.textBaseline,(D=t._stroke)!=null&&D.width){const K=t._stroke;c.lineWidth=K.width,c.miterLimit=K.miterLimit,c.lineJoin=K.join,c.lineCap=K.cap}c.font=f;let A,T;const C=t.dropShadow?2:1,N=t.wordWrap?t.wordWrapWidth:b,z=(((F=t._stroke)==null?void 0:F.width)??0)/2;let L=(m-_.fontSize)/2;m-_.fontSize<0&&(L=0);for(let K=0;K<C;++K){const V=t.dropShadow&&K===0,P=V?Math.ceil(Math.max(1,S)+n*2):0,G=P*i;if(V)this._setupDropShadow(c,t,i,G);else{const ne=t._gradientBounds,X=t._gradientOffset;if(ne){const W={width:ne.width,height:ne.height,lineHeight:ne.height,lines:s.lines};this._setFillAndStrokeStyles(c,t,W,n,z,(X==null?void 0:X.x)??0,(X==null?void 0:X.y)??0)}else X?this._setFillAndStrokeStyles(c,t,s,n,z,X.x,X.y):this._setFillAndStrokeStyles(c,t,s,n,z);c.shadowColor="rgba(0,0,0,0)"}for(let ne=0;ne<p.length;ne++){A=z,T=z+ne*m+_.ascent+L,A+=this._getAlignmentOffset(g[ne],N,t.align);let X=0;if(t.align==="justify"&&t.wordWrap&&ne<p.length-1){const W=qf(p[ne]);W>0&&(X=(N-g[ne])/W)}(Z=t._stroke)!=null&&Z.width&&this._drawLetterSpacing(p[ne],t,r,A+n,T+n-P,!0,X),t._fill!==void 0&&this._drawLetterSpacing(p[ne],t,r,A+n,T+n-P,!1,X)}}}_renderTaggedTextToCanvas(t,n,i,r,s){var z,L,D;const{canvas:l,context:c}=s,{runsByLine:f,lineWidths:p,maxLineWidth:m,lineAscents:g,lineHeights:b,hasDropShadow:_}=t,S=l.height;c.resetTransform(),c.scale(r,r),c.textBaseline=n.textBaseline;const A=_?2:1,T=n.wordWrap?n.wordWrapWidth:m;let C=((z=n._stroke)==null?void 0:z.width)??0;for(const F of f)for(const Z of F){const K=((L=Z.style._stroke)==null?void 0:L.width)??0;K>C&&(C=K)}const N=C/2,R=[];for(let F=0;F<f.length;F++){const Z=f[F],K=[];for(const V of Z){const P=v1(V.style);c.font=P,K.push({width:du._measureText(V.text,V.style.letterSpacing,c),font:P})}R.push(K)}for(let F=0;F<A;++F){const Z=_&&F===0,K=Z?Math.ceil(Math.max(1,S)+i*2):0,V=K*r;Z||(c.shadowColor="rgba(0,0,0,0)");let P=N;for(let G=0;G<f.length;G++){const ne=f[G],X=p[G],W=g[G],O=b[G],Y=R[G];let $=N;$+=this._getAlignmentOffset(X,T,n.align);let Q=0;if(n.align==="justify"&&n.wordWrap&&G<f.length-1){let J=0;for(const q of ne)J+=qf(q.text);J>0&&(Q=(T-X)/J)}const H=P+W;let I=$+i;for(let J=0;J<ne.length;J++){const q=ne[J],{width:oe,font:ie}=Y[J];if(c.font=ie,c.textBaseline=q.style.textBaseline,(D=q.style._stroke)!=null&&D.width){const me=q.style._stroke;if(c.lineWidth=me.width,c.miterLimit=me.miterLimit,c.lineJoin=me.join,c.lineCap=me.cap,Z)if(q.style.dropShadow)this._setupDropShadow(c,q.style,r,V);else{const ge=qf(q.text);I+=oe+ge*Q;continue}else{const ge=du.measureFont(ie),le=q.style.lineHeight||ge.fontSize,Re={width:oe,height:le,lineHeight:le,lines:[q.text]};c.strokeStyle=Qy(me,c,Re,i*2,I-i,P)}this._drawLetterSpacing(q.text,q.style,s,I,H+i-K,!0,Q)}const de=qf(q.text);I+=oe+de*Q}I=$+i;for(let J=0;J<ne.length;J++){const q=ne[J],{width:oe,font:ie}=Y[J];if(c.font=ie,c.textBaseline=q.style.textBaseline,q.style._fill!==void 0){if(Z)if(q.style.dropShadow)this._setupDropShadow(c,q.style,r,V);else{const me=qf(q.text);I+=oe+me*Q;continue}else{const me=du.measureFont(ie),ge=q.style.lineHeight||me.fontSize,le={width:oe,height:ge,lineHeight:ge,lines:[q.text]};c.fillStyle=Qy(q.style._fill,c,le,i*2,I-i,P)}this._drawLetterSpacing(q.text,q.style,s,I,H+i-K,!1,Q)}const de=qf(q.text);I+=oe+de*Q}P+=O}}}_setFillAndStrokeStyles(t,n,i,r,s,l=0,c=0){var f;if(t.fillStyle=n._fill?Qy(n._fill,t,i,r*2,l,c):null,(f=n._stroke)!=null&&f.width){const p=s+r*2;t.strokeStyle=Qy(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=Ki.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(du.experimentalLetterSpacingSupported&&(du.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 b=du.graphemeSegmenter(t);let _=f.measureText(t).width,S=0;for(let A=0;A<b.length;++A){const T=b[A];l?f.strokeText(T,g,s):f.fillText(T,g,s);let C="";for(let N=A+1;N<b.length;++N)C+=b[N];S=f.measureText(C).width,g+=_-S+p,T===" "&&(g+=c),_=S}}}const rh=new Kj,w_=class vd extends wo{constructor(t={}){super(),this.uid=Si("textStyle"),this._tick=0,this._cachedFontString=null,Wj(t),t instanceof vd&&(t=t._toObject());const r={...vd.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({...vd.defaultDropShadow,...t}):this._dropShadow=t?this._createProxy({...vd.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({...Sl.defaultFillStyle,...t},()=>{this._fill=Ed({...this._originalFill},Sl.defaultFillStyle)})),this._fill=Ed(t===0?"black":t,Sl.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(t){t!==this._originalStroke&&(this._originalStroke=t,this._isFillStyle(t)&&(this._originalStroke=this._createProxy({...Sl.defaultStrokeStyle,...t},()=>{this._stroke=I0({...this._originalStroke},Sl.defaultStrokeStyle)})),this._stroke=I0(t,Sl.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=vd.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=v1(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 vd(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&&!(Ki.isColorLike(t)||t instanceof pc||t instanceof fx)}};w_.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};w_.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 Md=w_;function Wj(e){const t=e;if(typeof t.dropShadow=="boolean"&&t.dropShadow){const n=Md.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){tn(_i,"strokeThickness is now a part of stroke");const n=t.stroke;let i={};if(Ki.isColorLike(n))i.color=n;else if(n instanceof pc||n instanceof fx)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(tn(_i,"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&&va("The number of fill colors must match the number of fill gradient stops.");const n=new pc({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),i=t.fillGradientStops.slice(),r=t.fill.map(s=>Ki.shared.setValue(s).toNumber());i.forEach((s,l)=>{n.addColorStop(s,r[l])}),e.fill={fill:n}}}function $j(e,t){const{texture:n,bounds:i}=e,r=t._style._getFinalPadding();mA(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 Qj{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 Zj extends Qj{}class kM{constructor(t){this._renderer=t,t.runners.resolutionChange.add(this),this._managedTexts=new lg({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,$j(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 Zj;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}}kM.extension={type:[kt.WebGLPipes,kt.WebGPUPipes,kt.CanvasPipes],name:"text"};const Jj=new qs;function eL(e,t,n,i,r=!1){const s=Jj;s.minX=0,s.minY=0,s.maxX=e.width/i|0,s.maxY=e.height/i|0;const l=ox.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 NM{constructor(t,n){this._activeTextures={},this._renderer=t,this._retainCanvasContext=n}getTexture(t,n,i,r){typeof t=="string"&&(tn("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),t={text:t,style:i,resolution:n}),t.style instanceof Md||(t.style=new Md(t.style)),t.textureStyle instanceof ph||(t.textureStyle=new ph(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}=rh.getCanvasAndContext({text:s,style:l,resolution:p}),b=eL(g.canvas,m.width,m.height,p,f);if(c&&(b.source.style=c),l.trim&&(m.pad(l.padding),b.frame.copyFrom(m),b.frame.scale(1/p),b.updateUvs()),l.filters){const _=this._applyFilters(b,l.filters);return this.returnTexture(b),rh.returnCanvasAndContext(g),_}return this._renderer.texture.initSource(b._source),this._retainCanvasContext||rh.returnCanvasAndContext(g),b}returnTexture(t){const n=t.source,i=n.resource;if(this._retainCanvasContext&&(i!=null&&i.getContext)){const r=i.getContext("2d");r&&rh.returnCanvasAndContext({canvas:i,context:r})}n.resource=null,n.uploadMethodId="unknown",n.alphaMode="no-premultiply-alpha",ox.returnTexture(t,!0)}renderTextToCanvas(){tn("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 OM extends NM{constructor(t){super(t,!0)}}OM.extension={type:[kt.CanvasSystem],name:"canvasText"};class DM extends NM{constructor(t){super(t,!1)}}DM.extension={type:[kt.WebGLSystem,kt.WebGPUSystem],name:"canvasText"};ci.add(OM);ci.add(DM);ci.add(kM);class hx extends Sj{constructor(...t){const n=Ej(t,"Text");super(n,Md),this.renderPipeId="text",n.textureStyle&&(this.textureStyle=n.textureStyle instanceof ph?n.textureStyle:new ph(n.textureStyle)),this.autoGenerateMipmaps=n.autoGenerateMipmaps??Gs.defaultOptions.autoGenerateMipmaps}updateBounds(){const t=this._bounds,n=this._anchor;let i=0,r=0;if(this._style.trim){const{frame:s,canvasAndContext:l}=rh.getCanvasAndContext({text:this.text,style:this._style,resolution:1});rh.returnCanvasAndContext(l),i=s.width,r=s.height}else{const s=du.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}}ci.add(CD,AD);var Zb={exports:{}},ac={};/**
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 Vw;function tL(){return Vw||(Vw=1,ac.ConcurrentRoot=1,ac.ContinuousEventPriority=8,ac.DefaultEventPriority=32,ac.DiscreteEventPriority=2,ac.IdleEventPriority=268435456,ac.LegacyRoot=0,ac.NoEventPriority=0),ac}var Xw;function nL(){return Xw||(Xw=1,Zb.exports=tL()),Zb.exports}var ah=nL();const T_=B.createContext({}),iL=T_.Provider;T_.Consumer;function zM(e,t){const n=Object.getPrototypeOf(e),i=Object.getOwnPropertyDescriptor(n,t);return!(typeof i>"u"||i.writable||i.set)}const yu={currentUpdatePriority:ah.DefaultEventPriority,unmountQueue:new Set};function Kw(e,...t){}function jM(e,t={}){const n=e;return n.__pixireact=Object.assign({filters:[],parent:null,root:null,type:""},t),n}var rL="0.0.0-development",aL={version:rL};function sL(){}function LM(e,t,n){t instanceof zd&&(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 Jb(e,t){t&&(t instanceof Tr?e.addChild(t):t instanceof zd&&LM(e,t))}function lL(){}function oL(){return!1}const _1=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"}),H0=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 BM(e){return Array.isArray(e)}function IM(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(fL(e)||uL(e))return e===t;const l=dL(e);if(l&&r==="reference")return e===t;const c=BM(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(!IM(e[f],t[f],{strict:s,objects:"reference"}))return!1}else for(f in p)if(e[f]!==t[f])return!1;if(UM(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 cL(e){return e===null}function uL(e){return typeof e=="number"}function dL(e){return!(e!==Object(e)||BM(e)||typeof e=="function")}function fL(e){return typeof e=="string"}function UM(e){return e===void 0}const hL=Object.freeze(["children","key","ref"]);function pL(e,t=[]){const n={};return Object.entries(e).reduce((i,[r,s])=>(t.includes(r)||(i[r]=s),i),n)}function S1(e,t=[]){return pL(e,hL.concat(t))}const mL="__default";function HM(e,t={},n=!1){const i=S1(e),r=S1(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,`${mL}remove`]),f+=1}}return s.forEach(([c,f])=>{if(IM(f,r[c]))return;if(c in H0){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 gL(e){const t=e;return!(!t||!t.changes)}const yL="__default",Ww=new Map,$w={};function Qw(e,t){if(e){const n=e[t];if(!UM(n)&&!cL(n))return n}return e}function PM(e,t){const{__pixireact:n={},...i}=e;let r;gL(t)?r=t:r=HM(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],b=c[3];let _=e,S=_[p];if(p==="draw"&&typeof m=="function"&&(e instanceof La?m(e):(f=!0,Kw("warn",`The \`draw\` prop was used on a \`${n.type}\` component, but it's only valid on \`graphics\` components.`))),p in _1){const A=p;f=!0,$w[p]||($w[p]=!0,Kw("warn",`Event names must be pascal case; instead of \`${p}\`, you probably want \`${_1[A]}\`.`))}if(!f){if(b.length&&(S=b.reduce(Qw,_),!(S&&S.set))){const[A,...T]=b.reverse();_=T.reverse().reduce(Qw,_),p=A}if(m===`${yL}remove`)if(_ instanceof Tr){let A=Ww.get(_.constructor);A||(A=_.constructor,A=new A,Ww.set(_.constructor,A)),m=A[p]}else m=0;if(g&&n){const T=H0[p];m?_[T]=m:delete _[T]}else zM(_,p)||(_[p]=m)}l+=1}return e}function xL(e,t,n,i){const{children:r,...s}=i,{children:l,...c}=n,f=HM(s,c,!0);return f.changes.length?f:null}function bL(e,t,n,i){const r=xL(e,t,n,i);r&&PM(e,r)}const vL=Object.freeze([...Object.keys(_1),"draw"]),E1={};function _L(e){const t=e.charAt(0),n=e.substring(1);return`${t.toUpperCase()}${n}`}function SL(e,t){return t.toLowerCase()}function EL(e){let t=e;return e.startsWith("pixi")&&(t=e.replace(/^pixi([A-Z])/,SL)),t}function wL(e,t,n){const i=EL(e),r=_L(i);if(!(r in E1))throw new Error(`${r} is not part of the PIXI namespace! Did you forget to extend?`);const s=E1[r],l=S1(t,vL);Object.entries(t).forEach(([f,p])=>{if(f in H0){const m=H0[f];l[m]=p}});const c=jM(new s(l),{root:n,type:i});return PM(c,t),c}var ev={exports:{}},tv={exports:{}},nv={exports:{}},iv={};/**
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 Zw;function TL(){return Zw||(Zw=1,(function(e){function t(O,Y){var $=O.length;O.push(Y);e:for(;0<$;){var Q=$-1>>>1,H=O[Q];if(0<r(H,Y))O[Q]=Y,O[$]=H,$=Q;else break e}}function n(O){return O.length===0?null:O[0]}function i(O){if(O.length===0)return null;var Y=O[0],$=O.pop();if($!==Y){O[0]=$;e:for(var Q=0,H=O.length,I=H>>>1;Q<I;){var J=2*(Q+1)-1,q=O[J],oe=J+1,ie=O[oe];if(0>r(q,$))oe<H&&0>r(ie,q)?(O[Q]=ie,O[oe]=$,Q=oe):(O[Q]=q,O[J]=$,Q=J);else if(oe<H&&0>r(ie,$))O[Q]=ie,O[oe]=$,Q=oe;else break e}}return Y}function r(O,Y){var $=O.sortIndex-Y.sortIndex;return $!==0?$:O.id-Y.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,b=3,_=!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(O){for(var Y=n(p);Y!==null;){if(Y.callback===null)i(p);else if(Y.startTime<=O)i(p),Y.sortIndex=Y.expirationTime,t(f,Y);else break;Y=n(p)}}function z(O){if(A=!1,R(O),!S)if(n(f)!==null)S=!0,X();else{var Y=n(p);Y!==null&&W(z,Y.startTime-O)}}var L=!1,D=-1,F=5,Z=-1;function K(){return!(e.unstable_now()-Z<F)}function V(){if(L){var O=e.unstable_now();Z=O;var Y=!0;try{e:{S=!1,A&&(A=!1,C(D),D=-1),_=!0;var $=b;try{t:{for(R(O),g=n(f);g!==null&&!(g.expirationTime>O&&K());){var Q=g.callback;if(typeof Q=="function"){g.callback=null,b=g.priorityLevel;var H=Q(g.expirationTime<=O);if(O=e.unstable_now(),typeof H=="function"){g.callback=H,R(O),Y=!0;break t}g===n(f)&&i(f),R(O)}else i(f);g=n(f)}if(g!==null)Y=!0;else{var I=n(p);I!==null&&W(z,I.startTime-O),Y=!1}}break e}finally{g=null,b=$,_=!1}Y=void 0}}finally{Y?P():L=!1}}}var P;if(typeof N=="function")P=function(){N(V)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,ne=G.port2;G.port1.onmessage=V,P=function(){ne.postMessage(null)}}else P=function(){T(V,0)};function X(){L||(L=!0,P())}function W(O,Y){D=T(function(){O(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_continueExecution=function(){S||_||(S=!0,X())},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(O){switch(b){case 1:case 2:case 3:var Y=3;break;default:Y=b}var $=b;b=Y;try{return O()}finally{b=$}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,Y){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var $=b;b=O;try{return Y()}finally{b=$}},e.unstable_scheduleCallback=function(O,Y,$){var Q=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?Q+$:Q):$=Q,O){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=$+H,O={id:m++,callback:Y,priorityLevel:O,startTime:$,expirationTime:H,sortIndex:-1},$>Q?(O.sortIndex=$,t(p,O),n(f)===null&&O===n(p)&&(A?(C(D),D=-1):A=!0,W(z,$-Q))):(O.sortIndex=H,t(f,O),S||_||(S=!0,X())),O},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(O){var Y=b;return function(){var $=b;b=Y;try{return O.apply(this,arguments)}finally{b=$}}}})(iv)),iv}var Jw;function CL(){return Jw||(Jw=1,nv.exports=TL()),nv.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 e2;function AL(){return e2||(e2=1,(function(e){e.exports=function(t){function n(u,d,v,w){return new tp(u,d,v,w)}function i(){}function r(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)d+="&args[]="+encodeURIComponent(arguments[v])}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=op&&u[op]||u["@@iterator"],typeof u=="function"?u:null)}function l(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===Fo?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case Bc:return"Fragment";case Xa:return"Portal";case lp:return"Profiler";case sp:return"StrictMode";case lf:return"Suspense";case eo:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case Ts:return(u.displayName||"Context")+".Provider";case Jl:return(u._context.displayName||"Context")+".Consumer";case Ic:var d=u.render;return u=u.displayName,u||(u=d.displayName||d.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case Hu:return d=u.displayName||null,d!==null?d:l(u.type)||"Memo";case Ka:d=u._payload,u=u._init;try{return l(u(d))}catch{}}return null}function c(u){if(of===void 0)try{throw Error()}catch(v){var d=v.stack.trim().match(/\n( *(at )?)/);of=d&&d[1]||"",cp=-1<v.stack.indexOf(`
334
+ at`)?" (<anonymous>)":-1<v.stack.indexOf("@")?"@unknown:0:0":""}return`
335
+ `+of+u+cp}function f(u,d){if(!u||to)return"";to=!0;var v=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 Ge=mt}Reflect.construct(u,[],Fe)}else{try{Fe.call()}catch(mt){Ge=mt}u.call(Fe.prototype)}}else{try{throw Error()}catch(mt){Ge=mt}(Fe=u())&&typeof Fe.catch=="function"&&Fe.catch(function(){})}}catch(mt){if(mt&&Ge&&typeof mt.stack=="string")return[mt.stack,Ge.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 j=w.DetermineComponentFrameRoot(),te=j[0],re=j[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{to=!1,Error.prepareStackTrace=v}return(v=u?u.displayName||u.name:"")?c(v):""}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(v){return`
339
+ Error generating stack: `+v.message+`
340
+ `+v.stack}}function g(u){var d=u,v=u;if(u.alternate)for(;d.return;)d=d.return;else{u=d;do d=u,(d.flags&4098)!==0&&(v=d.return),u=d.return;while(u)}return d.tag===3?v:null}function b(u){if(g(u)!==u)throw Error(r(188))}function _(u){var d=u.alternate;if(!d){if(d=g(u),d===null)throw Error(r(188));return d!==u?null:u}for(var v=u,w=d;;){var k=v.return;if(k===null)break;var j=k.alternate;if(j===null){if(w=k.return,w!==null){v=w;continue}break}if(k.child===j.child){for(j=k.child;j;){if(j===v)return b(k),u;if(j===w)return b(k),d;j=j.sibling}throw Error(r(188))}if(v.return!==w.return)v=k,w=j;else{for(var te=!1,re=k.child;re;){if(re===v){te=!0,v=k,w=j;break}if(re===w){te=!0,w=k,v=j;break}re=re.sibling}if(!te){for(re=j.child;re;){if(re===v){te=!0,v=j,w=k;break}if(re===w){te=!0,w=j,v=k;break}re=re.sibling}if(!te)throw Error(r(189))}}if(v.alternate!==w)throw Error(r(190))}if(v.tag!==3)throw Error(r(188));return v.stateNode.current===v?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>ol||(u.current=Wu[ol],Wu[ol]=null,ol--)}function N(u,d){ol++,Wu[ol]=u.current,u.current=d}function R(u){return u>>>=0,u===0?32:31-($u(u)/cy|0)|0}function z(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 L(u,d){var v=u.pendingLanes;if(v===0)return 0;var w=0,k=u.suspendedLanes,j=u.pingedLanes,te=u.warmLanes;u=u.finishedLanes!==0;var re=v&134217727;return re!==0?(v=re&~k,v!==0?w=z(v):(j&=re,j!==0?w=z(j):u||(te=re&~te,te!==0&&(w=z(te))))):(re=v&~k,re!==0?w=z(re):j!==0?w=z(j):u||(te=v&~te,te!==0&&(w=z(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 F(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=Fc;return Fc<<=1,(Fc&4194176)===0&&(Fc=128),u}function K(){var u=Qu;return Qu<<=1,(Qu&62914560)===0&&(Qu=4194304),u}function V(u){for(var d=[],v=0;31>v;v++)d.push(u);return d}function P(u,d){u.pendingLanes|=d,d!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function G(u,d,v,w,k,j){var te=u.pendingLanes;u.pendingLanes=v,u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0,u.expiredLanes&=v,u.entangledLanes&=v,u.errorRecoveryDisabledLanes&=v,u.shellSuspendCounter=0;var re=u.entanglements,pe=u.expirationTimes,Ce=u.hiddenUpdates;for(v=te&~v;0<v;){var De=31-Nr(v),Fe=1<<De;re[De]=0,pe[De]=-1;var Ge=Ce[De];if(Ge!==null)for(Ce[De]=null,De=0;De<Ge.length;De++){var mt=Ge[De];mt!==null&&(mt.lane&=-536870913)}v&=~Fe}w!==0&&ne(u,w,0),j!==0&&k===0&&u.tag!==0&&(u.suspendedLanes|=j&~(te&~d))}function ne(u,d,v){u.pendingLanes|=d,u.suspendedLanes&=~d;var w=31-Nr(d);u.entangledLanes|=d,u.entanglements[w]=u.entanglements[w]|1073741824|v&4194218}function X(u,d){var v=u.entangledLanes|=d;for(u=u.entanglements;v;){var w=31-Nr(v),k=1<<w;k&d|u[w]&d&&(u[w]|=d),v&=~k}}function W(u){return u&=-u,2<u?8<u?(u&134217727)!==0?32:268435456:8:2}function O(u){if(Or&&typeof Or.onCommitFiberRoot=="function")try{Or.onCommitFiberRoot(Gc,u,void 0,(u.current.flags&128)===128)}catch{}}function Y(u){if(typeof hy=="function"&&Hp(u),Or&&typeof Or.setStrictMode=="function")try{Or.setStrictMode(Gc,u)}catch{}}function $(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 v=Tf.get(u);return v!==void 0?v:(d={value:u,source:d,stack:m(d)},Tf.set(u,d),d)}return{value:u,source:d,stack:m(d)}}function H(u,d){zn[Xn++]=ed,zn[Xn++]=Ju,Ju=u,ed=d}function I(u,d,v){ia[ra++]=ks,ia[ra++]=Ca,ia[ra++]=Wa,Wa=u;var w=ks;u=Ca;var k=32-Nr(w)-1;w&=~(1<<k),v+=1;var j=32-Nr(d)+k;if(30<j){var te=k-k%5;j=(w&(1<<te)-1).toString(32),w>>=te,k-=te,ks=1<<32-Nr(d)+k|v<<k|w,Ca=j+u}else ks=1<<j|v<<k|w,Ca=u}function J(u){u.return!==null&&(H(u,1),I(u,1,0))}function q(u){for(;u===Ju;)Ju=zn[--Xn],zn[Xn]=null,ed=zn[--Xn],zn[Xn]=null;for(;u===Wa;)Wa=ia[--ra],ia[ra]=null,Ca=ia[--ra],ia[ra]=null,ks=ia[--ra],ia[ra]=null}function oe(u,d){N($a,d),N(td,u),N(Li,null),u=qo(d),C(Li),N(Li,u)}function ie(){C(Li),C(td),C($a)}function de(u){u.memoizedState!==null&&N(Yc,u);var d=Li.current,v=Fg(d,u.type);d!==v&&(N(td,u),N(Li,v))}function me(u){td.current===u&&(C(Li),C(td)),Yc.current===u&&(C(Yc),As?dt._currentValue=kr:dt._currentValue2=kr)}function ge(u){var d=Error(r(418,""));throw He(Q(d,u)),nd}function le(u,d){if(!xr)throw Error(r(175));Bx(u.stateNode,u.type,u.memoizedProps,d,u)||ge(u)}function Re(u){for(ir=u.return;ir;)switch(ir.tag){case 3:case 27:Aa=!0;return;case 5:case 13:Aa=!1;return;default:ir=ir.return}}function Le(u){if(!xr||u!==ir)return!1;if(!Gt)return Re(u),Gt=!0,!1;var d=!1;if(Gi?u.tag!==3&&u.tag!==27&&(u.tag!==5||ry(u.type)&&!ro(u.type,u.memoizedProps))&&(d=!0):u.tag!==3&&(u.tag!==5||ry(u.type)&&!ro(u.type,u.memoizedProps))&&(d=!0),d&&Vi&&ge(u),Re(u),u.tag===13){if(!xr)throw Error(r(316));if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));Vi=ny(u)}else Vi=ir?Ap(u.stateNode):null;return!0}function Be(){xr&&(Vi=ir=null,Gt=!1)}function He(u){aa===null?aa=[u]:aa.push(u)}function Qe(){for(var u=so,d=Vc=so=0;d<u;){var v=sa[d];sa[d++]=null;var w=sa[d];sa[d++]=null;var k=sa[d];sa[d++]=null;var j=sa[d];if(sa[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}j!==0&&Sn(v,k,j)}}function ot(u,d,v,w){sa[so++]=u,sa[so++]=d,sa[so++]=v,sa[so++]=w,Vc|=w,u.lanes|=w,u=u.alternate,u!==null&&(u.lanes|=w)}function Ue(u,d,v,w){return ot(u,d,v,w),En(u)}function wt(u,d){return ot(u,null,null,d),En(u)}function Sn(u,d,v){u.lanes|=v;var w=u.alternate;w!==null&&(w.lanes|=v);for(var k=!1,j=u.return;j!==null;)j.childLanes|=v,w=j.alternate,w!==null&&(w.childLanes|=v),j.tag===22&&(u=j.stateNode,u===null||u._visibility&1||(k=!0)),u=j,j=j.return;k&&d!==null&&u.tag===3&&(j=u.stateNode,k=31-Nr(v),j=j.hiddenUpdates,u=j[k],u===null?j[k]=[d]:u.push(d),d.lane=v|536870912)}function En(u){if(50<ec)throw ec=0,_r=null,Error(r(185));for(var d=u.return;d!==null;)u=d,d=u.return;return u.tag===3?u.stateNode:null}function pn(u){u!==Xo&&u.next===null&&(Xo===null?Xc=Xo=u:Xo=Xo.next=u),rd=!0,id||(id=!0,Ee(Yr))}function ui(u,d){if(!Qa&&rd){Qa=!0;do for(var v=!1,w=Xc;w!==null;){if(u!==0){var k=w.pendingLanes;if(k===0)var j=0;else{var te=w.suspendedLanes,re=w.pingedLanes;j=(1<<31-Nr(42|u)+1)-1,j&=k&~(te&~re),j=j&201326677?j&201326677|1:j?j|2:0}j!==0&&(v=!0,ur(w,j))}else j=Tt,j=L(w,w===Rt?j:0),(j&3)===0||D(w,j)||(v=!0,ur(w,j));w=w.next}while(v);Qa=!1}}function Yr(){rd=id=!1;var u=0;lo!==0&&(ao()&&(u=lo),lo=0);for(var d=Yi(),v=null,w=Xc;w!==null;){var k=w.next,j=ki(w,d);j===0?(w.next=null,v===null?Xc=k:v.next=k,k===null&&(Xo=v)):(v=w,(u!==0||(j&3)!==0)&&(rd=!0)),w=k}ui(u)}function ki(u,d){for(var v=u.suspendedLanes,w=u.pingedLanes,k=u.expirationTimes,j=u.pendingLanes&-62914561;0<j;){var te=31-Nr(j),re=1<<te,pe=k[te];pe===-1?((re&v)===0||(re&w)!==0)&&(k[te]=F(re,d)):pe<=d&&(u.expiredLanes|=re),j&=~re}if(d=Rt,v=Tt,v=L(u,u===d?v:0),w=u.callbackNode,v===0||u===d&&bn===2||u.cancelPendingCommit!==null)return w!==null&&w!==null&&Zu(w),u.callbackNode=null,u.callbackPriority=0;if((v&3)===0||D(u,v)){if(d=v&-v,d===u.callbackPriority)return d;switch(w!==null&&Zu(w),W(v)){case 2:case 8:v=fy;break;case 32:v=Ef;break;case 268435456:v=wf;break;default:v=Ef}return w=Qt.bind(null,u),v=qc(v,w),u.callbackPriority=d,u.callbackNode=v,d}return w!==null&&w!==null&&Zu(w),u.callbackPriority=2,u.callbackNode=null,2}function Qt(u,d){var v=u.callbackNode;if(zi()&&u.callbackNode!==v)return null;var w=Tt;return w=L(u,u===Rt?w:0),w===0?null:(ju(u,w,d),ki(u,Yi()),u.callbackNode!=null&&u.callbackNode===v?Qt.bind(null,u):null)}function ur(u,d){if(zi())return null;ju(u,d,!0)}function Ee(u){pi?ff(function(){(et&6)!==0?qc(Up,u):u()}):qc(Up,u)}function ke(){return lo===0&&(lo=Z()),lo}function ce(u,d){if(ad===null){var v=ad=[];Cf=0,Dr=ke(),oo={status:"pending",value:void 0,then:function(w){v.push(w)}}}return Cf++,d.then(Pe,Pe),d}function Pe(){if(--Cf===0&&ad!==null){oo!==null&&(oo.status="fulfilled");var u=ad;ad=null,Dr=0,oo=null;for(var d=0;d<u.length;d++)(0,u[d])()}}function ct(u,d){var v=[],w={status:"pending",value:null,reason:null,then:function(k){v.push(k)}};return u.then(function(){w.status="fulfilled",w.value=d;for(var k=0;k<v.length;k++)(0,v[k])(d)},function(k){for(w.status="rejected",w.reason=k,k=0;k<v.length;k++)(0,v[k])(void 0)}),w}function nn(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function di(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 Zt(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function Jt(u,d,v){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=En(u),Sn(u,null,v),d}return ot(u,w,d,v),En(u)}function Gn(u,d,v){if(d=d.updateQueue,d!==null&&(d=d.shared,(v&4194176)!==0)){var w=d.lanes;w&=u.pendingLanes,v|=w,d.lanes=v,X(u,v)}}function Ft(u,d){var v=u.updateQueue,w=u.alternate;if(w!==null&&(w=w.updateQueue,v===w)){var k=null,j=null;if(v=v.firstBaseUpdate,v!==null){do{var te={lane:v.lane,tag:v.tag,payload:v.payload,callback:null,next:null};j===null?k=j=te:j=j.next=te,v=v.next}while(v!==null);j===null?k=j=d:j=j.next=d}else k=j=d;v={baseState:w.baseState,firstBaseUpdate:k,lastBaseUpdate:j,shared:w.shared,callbacks:w.callbacks},u.updateQueue=v;return}u=v.lastBaseUpdate,u===null?v.firstBaseUpdate=d:u.next=d,v.lastBaseUpdate=d}function Wi(){if(Kc){var u=oo;if(u!==null)throw u}}function ti(u,d,v,w){Kc=!1;var k=u.updateQueue;cl=!1;var j=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?j=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(j!==null){var Fe=k.baseState;te=0,De=Ce=pe=null,re=j;do{var Ge=re.lane&-536870913,mt=Ge!==re.lane;if(mt?(Tt&Ge)===Ge:(w&Ge)===Ge){Ge!==0&&Ge===Dr&&(Kc=!0),De!==null&&(De=De.next={lane:0,tag:re.tag,payload:re.payload,callback:null,next:null});e:{var Br=u,cd=re;Ge=d;var tc=v;switch(cd.tag){case 1:if(Br=cd.payload,typeof Br=="function"){Fe=Br.call(tc,Fe,Ge);break e}Fe=Br;break e;case 3:Br.flags=Br.flags&-65537|128;case 0:if(Br=cd.payload,Ge=typeof Br=="function"?Br.call(tc,Fe,Ge):Br,Ge==null)break e;Fe=Po({},Fe,Ge);break e;case 2:cl=!0}}Ge=re.callback,Ge!==null&&(u.flags|=64,mt&&(u.flags|=8192),mt=k.callbacks,mt===null?k.callbacks=[Ge]:mt.push(Ge))}else mt={lane:Ge,tag:re.tag,payload:re.payload,callback:re.callback,next:null},De===null?(Ce=De=mt,pe=Fe):De=De.next=mt,te|=Ge;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,j===null&&(k.shared.lanes=0),ua|=te,u.lanes=te,u.memoizedState=Fe}}function Ao(u,d){if(typeof u!="function")throw Error(r(191,u));u.call(d)}function hs(u,d){var v=u.callbacks;if(v!==null)for(u.callbacks=null,u=0;u<v.length;u++)Ao(v[u],d)}function Ha(u,d){if(na(u,d))return!0;if(typeof u!="object"||u===null||typeof d!="object"||d===null)return!1;var v=Object.keys(u),w=Object.keys(d);if(v.length!==w.length)return!1;for(w=0;w<v.length;w++){var k=v[w];if(!sd.call(d,k)||!na(u[k],d[k]))return!1}return!0}function ps(u){return u=u.status,u==="fulfilled"||u==="rejected"}function Ei(){}function se(u,d,v){switch(v=u[v],v===void 0?u.push(d):v!==d&&(d.then(Ei,Ei),d=v),d.status){case"fulfilled":return d.value;case"rejected":throw u=d.reason,u===gn?Error(r(483)):u;default:if(typeof d.status=="string")d.then(Ei,Ei);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===gn?Error(r(483)):u}throw Ko=d,gn}}function Te(){if(Ko===null)throw Error(r(459));var u=Ko;return Ko=null,u}function Ie(u){var d=Ma;return Ma+=1,Ns===null&&(Ns=[]),se(Ns,u,d)}function tt(u,d){d=d.props.ref,u.ref=d!==void 0?d:null}function rn(u,d){throw d.$$typeof===ap?Error(r(525)):(u=Object.prototype.toString.call(d),Error(r(31,u==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":u)))}function an(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 v(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=tr(be,fe),be.index=0,be.sibling=null,be}function j(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=Zl(_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===Bc?De(be,fe,_e.props.children,Oe,_e.key):fe!==null&&(fe.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===Ka&&an(Ze)===fe.type)?(fe=k(fe,_e.props),tt(fe,_e),fe.return=be,fe):(fe=wa(_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=Lc(_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=il(_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=Zl(""+fe,be.mode,_e),fe.return=be,fe;if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case rl:return _e=wa(fe.type,fe.key,fe.props,null,be.mode,_e),tt(_e,fe),_e.return=be,_e;case Xa:return fe=Lc(fe,be.mode,_e),fe.return=be,fe;case Ka:var Oe=fe._init;return fe=Oe(fe._payload),Fe(be,fe,_e)}if(no(fe)||s(fe))return fe=il(fe,be.mode,_e,null),fe.return=be,fe;if(typeof fe.then=="function")return Fe(be,Ie(fe),_e);if(fe.$$typeof===Ts)return Fe(be,ku(be,fe),_e);rn(be,fe)}return null}function Ge(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 rl:return _e.key===Ze?pe(be,fe,_e,Oe):null;case Xa:return _e.key===Ze?Ce(be,fe,_e,Oe):null;case Ka:return Ze=_e._init,_e=Ze(_e._payload),Ge(be,fe,_e,Oe)}if(no(_e)||s(_e))return Ze!==null?null:De(be,fe,_e,Oe,null);if(typeof _e.then=="function")return Ge(be,fe,Ie(_e),Oe);if(_e.$$typeof===Ts)return Ge(be,fe,ku(be,_e),Oe);rn(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 rl:return be=be.get(Oe.key===null?_e:Oe.key)||null,pe(fe,be,Oe,Ze);case Xa:return be=be.get(Oe.key===null?_e:Oe.key)||null,Ce(fe,be,Oe,Ze);case Ka:var Tn=Oe._init;return Oe=Tn(Oe._payload),mt(be,fe,_e,Oe,Ze)}if(no(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,Ie(Oe),Ze);if(Oe.$$typeof===Ts)return mt(be,fe,_e,ku(fe,Oe),Ze);rn(fe,Oe)}return null}function Br(be,fe,_e,Oe){for(var Ze=null,Tn=null,ft=fe,Vt=fe=0,Ai=null;ft!==null&&Vt<_e.length;Vt++){ft.index>Vt?(Ai=ft,ft=null):Ai=ft.sibling;var Xt=Ge(be,ft,_e[Vt],Oe);if(Xt===null){ft===null&&(ft=Ai);break}u&&ft&&Xt.alternate===null&&d(be,ft),fe=j(Xt,fe,Vt),Tn===null?Ze=Xt:Tn.sibling=Xt,Tn=Xt,ft=Ai}if(Vt===_e.length)return v(be,ft),Gt&&H(be,Vt),Ze;if(ft===null){for(;Vt<_e.length;Vt++)ft=Fe(be,_e[Vt],Oe),ft!==null&&(fe=j(ft,fe,Vt),Tn===null?Ze=ft:Tn.sibling=ft,Tn=ft);return Gt&&H(be,Vt),Ze}for(ft=w(ft);Vt<_e.length;Vt++)Ai=mt(ft,be,Vt,_e[Vt],Oe),Ai!==null&&(u&&Ai.alternate!==null&&ft.delete(Ai.key===null?Vt:Ai.key),fe=j(Ai,fe,Vt),Tn===null?Ze=Ai:Tn.sibling=Ai,Tn=Ai);return u&&ft.forEach(function(gl){return d(be,gl)}),Gt&&H(be,Vt),Ze}function cd(be,fe,_e,Oe){if(_e==null)throw Error(r(151));for(var Ze=null,Tn=null,ft=fe,Vt=fe=0,Ai=null,Xt=_e.next();ft!==null&&!Xt.done;Vt++,Xt=_e.next()){ft.index>Vt?(Ai=ft,ft=null):Ai=ft.sibling;var gl=Ge(be,ft,Xt.value,Oe);if(gl===null){ft===null&&(ft=Ai);break}u&&ft&&gl.alternate===null&&d(be,ft),fe=j(gl,fe,Vt),Tn===null?Ze=gl:Tn.sibling=gl,Tn=gl,ft=Ai}if(Xt.done)return v(be,ft),Gt&&H(be,Vt),Ze;if(ft===null){for(;!Xt.done;Vt++,Xt=_e.next())Xt=Fe(be,Xt.value,Oe),Xt!==null&&(fe=j(Xt,fe,Vt),Tn===null?Ze=Xt:Tn.sibling=Xt,Tn=Xt);return Gt&&H(be,Vt),Ze}for(ft=w(ft);!Xt.done;Vt++,Xt=_e.next())Xt=mt(ft,be,Vt,Xt.value,Oe),Xt!==null&&(u&&Xt.alternate!==null&&ft.delete(Xt.key===null?Vt:Xt.key),fe=j(Xt,fe,Vt),Tn===null?Ze=Xt:Tn.sibling=Xt,Tn=Xt);return u&&ft.forEach(function(jf){return d(be,jf)}),Gt&&H(be,Vt),Ze}function tc(be,fe,_e,Oe){if(typeof _e=="object"&&_e!==null&&_e.type===Bc&&_e.key===null&&(_e=_e.props.children),typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case rl:e:{for(var Ze=_e.key;fe!==null;){if(fe.key===Ze){if(Ze=_e.type,Ze===Bc){if(fe.tag===7){v(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===Ka&&an(Ze)===fe.type){v(be,fe.sibling),Oe=k(fe,_e.props),tt(Oe,_e),Oe.return=be,be=Oe;break e}v(be,fe);break}else d(be,fe);fe=fe.sibling}_e.type===Bc?(Oe=il(_e.props.children,be.mode,Oe,_e.key),Oe.return=be,be=Oe):(Oe=wa(_e.type,_e.key,_e.props,null,be.mode,Oe),tt(Oe,_e),Oe.return=be,be=Oe)}return te(be);case Xa: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){v(be,fe.sibling),Oe=k(fe,_e.children||[]),Oe.return=be,be=Oe;break e}else{v(be,fe);break}else d(be,fe);fe=fe.sibling}Oe=Lc(_e,be.mode,Oe),Oe.return=be,be=Oe}return te(be);case Ka:return Ze=_e._init,_e=Ze(_e._payload),tc(be,fe,_e,Oe)}if(no(_e))return Br(be,fe,_e,Oe);if(s(_e)){if(Ze=s(_e),typeof Ze!="function")throw Error(r(150));return _e=Ze.call(_e),cd(be,fe,_e,Oe)}if(typeof _e.then=="function")return tc(be,fe,Ie(_e),Oe);if(_e.$$typeof===Ts)return tc(be,fe,ku(be,_e),Oe);rn(be,_e)}return typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint"?(_e=""+_e,fe!==null&&fe.tag===6?(v(be,fe.sibling),Oe=k(fe,_e),Oe.return=be,be=Oe):(v(be,fe),Oe=Zl(_e,be.mode,Oe),Oe.return=be,be=Oe),te(be)):v(be,fe)}return function(be,fe,_e,Oe){try{Ma=0;var Ze=tc(be,fe,_e,Oe);return Ns=null,Ze}catch(ft){if(ft===gn)throw ft;var Tn=n(29,ft,null,be.mode);return Tn.lanes=Oe,Tn.return=be,Tn}finally{}}}function qe(u,d){u=Za,N(la,u),N(Os,d),Za=u|d.baseLanes}function nt(){N(la,Za),N(Os,Os.current)}function kn(){Za=la.current,C(Os),C(la)}function qt(u){var d=u.alternate;N(mi,mi.current&1),N(oa,u),Ra===null&&(d===null||Os.current!==null||d.memoizedState!==null)&&(Ra=u)}function _a(u){if(u.tag===22){if(N(mi,mi.current),N(oa,u),Ra===null){var d=u.alternate;d!==null&&d.memoizedState!==null&&(Ra=u)}}else dr()}function dr(){N(mi,mi.current),N(oa,oa.current)}function $i(u){C(oa),Ra===u&&(Ra=null),C(mi)}function fr(u){for(var d=u;d!==null;){if(d.tag===13){var v=d.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||yf(v)||Ku(v)))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 fi(u,d){if(d===null)return!1;for(var v=0;v<d.length&&v<u.length;v++)if(!na(u[v],d[v]))return!1;return!0}function Vr(u,d,v,w,k,j){return Ds=j,St=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,at.H=u===null||u.memoizedState===null?gi:rr,ul=!1,j=v(w,k),ul=!1,jn&&(j=Dl(d,v,w,k)),Ys(u),j}function Ys(u){at.H=Yt;var d=en!==null&&en.next!==null;if(Ds=0,ii=en=St=null,ka=!1,Kn=0,Wc=null,d)throw Error(r(300));u===null||ri||(u=u.dependencies,u!==null&&Pl(u)&&(ri=!0))}function Dl(u,d,v,w){St=u;var k=0;do{if(jn&&(Wc=null),Kn=0,jn=!1,25<=k)throw Error(r(301));if(k+=1,ii=en=null,u.updateQueue!=null){var j=u.updateQueue;j.lastEffect=null,j.events=null,j.stores=null,j.memoCache!=null&&(j.memoCache.index=0)}at.H=uo,j=d(v,w)}while(jn);return j}function zl(){var u=at.H,d=u.useState()[0];return d=typeof d.then=="function"?hr(d):d,u=u.useState()[0],(en!==null?en.memoizedState:null)!==u&&(St.flags|=1024),d}function jl(){var u=ld!==0;return ld=0,u}function Pa(u,d,v){d.updateQueue=u.updateQueue,d.flags&=-2053,u.lanes&=~v}function Vs(u){if(ka){for(u=u.memoizedState;u!==null;){var d=u.queue;d!==null&&(d.pending=null),u=u.next}ka=!1}Ds=0,ii=en=St=null,jn=!1,Kn=ld=0,Wc=null}function sn(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ii===null?St.memoizedState=ii=u:ii=ii.next=u,ii}function ln(){if(en===null){var u=St.alternate;u=u!==null?u.memoizedState:null}else u=en.next;var d=ii===null?St.memoizedState:ii.next;if(d!==null)ii=d,en=u;else{if(u===null)throw St.alternate===null?Error(r(467)):Error(r(310));en=u,u={memoizedState:en.memoizedState,baseState:en.baseState,baseQueue:en.baseQueue,queue:en.queue,next:null},ii===null?St.memoizedState=ii=u:ii=ii.next=u}return ii}function hr(u){var d=Kn;return Kn+=1,Wc===null&&(Wc=[]),u=se(Wc,u,d),d=St,(ii===null?d.memoizedState:ii.next)===null&&(d=d.alternate,at.H=d===null||d.memoizedState===null?gi:rr),u}function Xr(u){if(u!==null&&typeof u=="object"){if(typeof u.then=="function")return hr(u);if(u.$$typeof===Ts)return Pi(u)}throw Error(r(438,String(u)))}function In(u){var d=null,v=St.updateQueue;if(v!==null&&(d=v.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}),v===null&&(v=Mf(),St.updateQueue=v),v.memoCache=d,v=d.data[d.index],v===void 0)for(v=d.data[d.index]=Array(u),w=0;w<u;w++)v[w]=Pg;return d.index++,v}function Cr(u,d){return typeof d=="function"?d(u):d}function Sa(u){var d=ln();return Kr(d,en,u)}function Kr(u,d,v){var w=u.queue;if(w===null)throw Error(r(311));w.lastRenderedReducer=v;var k=u.baseQueue,j=w.pending;if(j!==null){if(k!==null){var te=k.next;k.next=j.next,j.next=te}d.baseQueue=k=j,w.pending=null}if(j=u.baseState,k===null)u.memoizedState=j;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:(Ds&Fe)===Fe){var Ge=Ce.revertLane;if(Ge===0)pe!==null&&(pe=pe.next={lane:0,revertLane:0,action:Ce.action,hasEagerState:Ce.hasEagerState,eagerState:Ce.eagerState,next:null}),Fe===Dr&&(De=!0);else if((Ds&Ge)===Ge){Ce=Ce.next,Ge===Dr&&(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=j):pe=pe.next=Fe,St.lanes|=Ge,ua|=Ge;Fe=Ce.action,ul&&v(j,Fe),j=Ce.hasEagerState?Ce.eagerState:v(j,Fe)}else Ge={lane:Fe,revertLane:Ce.revertLane,action:Ce.action,hasEagerState:Ce.hasEagerState,eagerState:Ce.eagerState,next:null},pe===null?(re=pe=Ge,te=j):pe=pe.next=Ge,St.lanes|=Fe,ua|=Fe;Ce=Ce.next}while(Ce!==null&&Ce!==d);if(pe===null?te=j:pe.next=re,!na(j,u.memoizedState)&&(ri=!0,De&&(v=oo,v!==null)))throw v;u.memoizedState=j,u.baseState=te,u.baseQueue=pe,w.lastRenderedState=j}return k===null&&(w.lanes=0),[u.memoizedState,w.dispatch]}function Ne(u){var d=ln(),v=d.queue;if(v===null)throw Error(r(311));v.lastRenderedReducer=u;var w=v.dispatch,k=v.pending,j=d.memoizedState;if(k!==null){v.pending=null;var te=k=k.next;do j=u(j,te.action),te=te.next;while(te!==k);na(j,d.memoizedState)||(ri=!0),d.memoizedState=j,d.baseQueue===null&&(d.baseState=j),v.lastRenderedState=j}return[j,w]}function Ke(u,d,v){var w=St,k=ln(),j=Gt;if(j){if(v===void 0)throw Error(r(407));v=v()}else v=d();var te=!na((en||k).memoizedState,v);if(te&&(k.memoizedState=v,ri=!0),k=k.queue,ys(Un.bind(null,w,k,u),[u]),k.getSnapshot!==d||te||ii!==null&&ii.memoizedState.tag&1){if(w.flags|=2048,qa(9,Kt.bind(null,w,k,v,d),{destroy:void 0},null),Rt===null)throw Error(r(349));j||(Ds&60)!==0||vt(w,d,v)}return v}function vt(u,d,v){u.flags|=16384,u={getSnapshot:d,value:v},d=St.updateQueue,d===null?(d=Mf(),St.updateQueue=d,d.stores=[u]):(v=d.stores,v===null?d.stores=[u]:v.push(u))}function Kt(u,d,v,w){d.value=v,d.getSnapshot=w,wi(d)&&Qi(u)}function Un(u,d,v){return v(function(){wi(d)&&Qi(u)})}function wi(u){var d=u.getSnapshot;u=u.value;try{var v=d();return!na(u,v)}catch{return!0}}function Qi(u){var d=wt(u,2);d!==null&&er(d,u,2)}function Ni(u){var d=sn();if(typeof u=="function"){var v=u;if(u=v(),ul){Y(!0);try{v()}finally{Y(!1)}}}return d.memoizedState=d.baseState=u,d.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cr,lastRenderedState:u},d}function mn(u,d,v,w){return u.baseState=v,Kr(u,en,typeof w=="function"?w:Cr)}function pr(u,d,v,w,k){if(No(u))throw Error(r(485));if(u=d.action,u!==null){var j={payload:k,action:u,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(te){j.listeners.push(te)}};at.T!==null?v(!0):j.isTransition=!1,w(j),v=d.pending,v===null?(j.next=d.pending=j,Mo(d,j)):(j.next=v.next,d.pending=v.next=j)}}function Mo(u,d){var v=d.action,w=d.payload,k=u.state;if(d.isTransition){var j=at.T,te={};at.T=te;try{var re=v(k,w),pe=at.S;pe!==null&&pe(te,re),Ea(u,d,re)}catch(Ce){Fa(u,d,Ce)}finally{at.T=j}}else try{j=v(k,w),Ea(u,d,j)}catch(Ce){Fa(u,d,Ce)}}function Ea(u,d,v){v!==null&&typeof v=="object"&&typeof v.then=="function"?v.then(function(w){Ll(u,d,w)},function(w){return Fa(u,d,w)}):Ll(u,d,v)}function Ll(u,d,v){d.status="fulfilled",d.value=v,bc(d),u.state=v,d=u.pending,d!==null&&(v=d.next,v===d?u.pending=null:(v=v.next,d.next=v,Mo(u,v)))}function Fa(u,d,v){var w=u.pending;if(u.pending=null,w!==null){w=w.next;do d.status="rejected",d.reason=v,bc(d),d=d.next;while(d!==w)}u.action=null}function bc(u){u=u.listeners;for(var d=0;d<u.length;d++)(0,u[d])()}function Ui(u,d){return d}function ms(u,d){if(Gt){var v=Rt.formState;if(v!==null){e:{var w=St;if(Gt){if(Vi){var k=Kg(Vi,Aa);if(k){Vi=Ap(k),w=Wg(k);break e}}ge(w)}w=!1}w&&(d=v[0])}}v=sn(),v.memoizedState=v.baseState=d,w={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ui,lastRenderedState:d},v.queue=w,v=Id.bind(null,St,w),w.dispatch=v,w=Ni(!1);var j=Ud.bind(null,St,!1,w.queue);return w=sn(),k={state:d,dispatch:null,action:u,pending:null},w.queue=k,v=pr.bind(null,St,k,j,v),k.dispatch=v,w.memoizedState=u,[d,v,!1]}function gs(u){var d=ln();return Xs(d,en,u)}function Xs(u,d,v){d=Kr(u,d,Ui)[0],u=Sa(Cr)[0],d=typeof d=="object"&&d!==null&&typeof d.then=="function"?hr(d):d;var w=ln(),k=w.queue,j=k.dispatch;return v!==w.memoizedState&&(St.flags|=2048,qa(9,hi.bind(null,k,v),{destroy:void 0},null)),[d,j,u]}function hi(u,d){u.action=d}function _u(u){var d=ln(),v=en;if(v!==null)return Xs(d,v,u);ln(),d=d.memoizedState,v=ln();var w=v.queue.dispatch;return v.memoizedState=u,[d,w,!1]}function qa(u,d,v,w){return u={tag:u,create:d,inst:v,deps:w,next:null},d=St.updateQueue,d===null&&(d=Mf(),St.updateQueue=d),v=d.lastEffect,v===null?d.lastEffect=u.next=u:(w=v.next,v.next=u,u.next=w,d.lastEffect=u),u}function rt(){return ln().memoizedState}function Ro(u,d,v,w){var k=sn();St.flags|=u,k.memoizedState=qa(1|d,v,{destroy:void 0},w===void 0?null:w)}function Pn(u,d,v,w){var k=ln();w=w===void 0?null:w;var j=k.memoizedState.inst;en!==null&&w!==null&&fi(w,en.memoizedState.deps)?k.memoizedState=qa(d,v,j,w):(St.flags|=u,k.memoizedState=qa(1|d,v,j,w))}function on(u,d){Ro(8390656,8,u,d)}function ys(u,d){Pn(2048,8,u,d)}function xs(u,d){return Pn(4,2,u,d)}function vc(u,d){return Pn(4,4,u,d)}function Ks(u,d){if(typeof d=="function"){u=u();var v=d(u);return function(){typeof v=="function"?v():d(null)}}if(d!=null)return u=u(),d.current=u,function(){d.current=null}}function je(u,d,v){v=v!=null?v.concat([u]):null,Pn(4,4,Ks.bind(null,d,u),v)}function Ve(){}function yt(u,d){var v=ln();d=d===void 0?null:d;var w=v.memoizedState;return d!==null&&fi(d,w[1])?w[0]:(v.memoizedState=[u,d],u)}function Nt(u,d){var v=ln();d=d===void 0?null:d;var w=v.memoizedState;if(d!==null&&fi(d,w[1]))return w[0];if(w=u(),ul){Y(!0);try{u()}finally{Y(!1)}}return v.memoizedState=[w,d],w}function Nn(u,d,v){return v===void 0||(Ds&1073741824)!==0?u.memoizedState=d:(u.memoizedState=v,u=_s(),St.lanes|=u,ua|=u,v)}function Wr(u,d,v,w){return na(v,d)?v:Os.current!==null?(u=Nn(u,v,w),na(u,d)||(ri=!0),u):(Ds&42)===0?(ri=!0,u.memoizedState=v):(u=_s(),St.lanes|=u,ua|=u,d)}function _c(u,d,v,w,k){var j=Ti();nr(j!==0&&8>j?j:8);var te=at.T,re={};at.T=re,Ud(u,!1,d,v);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);Il(u,d,De,yr(u))}else Il(u,d,w,yr(u))}catch(Fe){Il(u,d,{then:function(){},status:"rejected",reason:Fe},yr())}finally{nr(j),at.T=te}}function Su(u){var d=u.memoizedState;if(d!==null)return d;d={memoizedState:kr,baseState:kr,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cr,lastRenderedState:kr},next:null};var v={};return d.next={memoizedState:v,baseState:v,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cr,lastRenderedState:v},next:null},u.memoizedState=d,u=u.alternate,u!==null&&(u.memoizedState=d),d}function ko(){return Pi(dt)}function bs(){return ln().memoizedState}function Bd(){return ln().memoizedState}function Eu(u){for(var d=u.return;d!==null;){switch(d.tag){case 24:case 3:var v=yr();u=Zt(v);var w=Jt(d,u,v);w!==null&&(er(w,d,v),Gn(w,d,v)),d={cache:Gd()},u.payload=d;return}d=d.return}}function Bl(u,d,v){var w=yr();v={lane:w,revertLane:0,action:v,hasEagerState:!1,eagerState:null,next:null},No(u)?wu(d,v):(v=Ue(u,d,v,w),v!==null&&(er(v,u,w),Dh(v,d,w)))}function Id(u,d,v){var w=yr();Il(u,d,v,w)}function Il(u,d,v,w){var k={lane:w,revertLane:0,action:v,hasEagerState:!1,eagerState:null,next:null};if(No(u))wu(d,k);else{var j=u.alternate;if(u.lanes===0&&(j===null||j.lanes===0)&&(j=d.lastRenderedReducer,j!==null))try{var te=d.lastRenderedState,re=j(te,v);if(k.hasEagerState=!0,k.eagerState=re,na(re,te))return ot(u,d,k,0),Rt===null&&Qe(),!1}catch{}finally{}if(v=Ue(u,d,k,w),v!==null)return er(v,u,w),Dh(v,d,w),!0}return!1}function Ud(u,d,v,w){if(w={lane:2,revertLane:ke(),action:w,hasEagerState:!1,eagerState:null,next:null},No(u)){if(d)throw Error(r(479))}else d=Ue(u,v,w,2),d!==null&&er(d,u,2)}function No(u){var d=u.alternate;return u===St||d!==null&&d===St}function wu(u,d){jn=ka=!0;var v=u.pending;v===null?d.next=d:(d.next=v.next,v.next=d),u.pending=d}function Dh(u,d,v){if((v&4194176)!==0){var w=d.lanes;w&=u.pendingLanes,v|=w,d.lanes=v,X(u,v)}}function Zi(u,d,v,w){d=u.memoizedState,v=v(w,d),v=v==null?d:Po({},d,v),u.memoizedState=v,u.lanes===0&&(u.updateQueue.baseState=v)}function Ul(u,d,v,w,k,j,te){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(w,j,te):d.prototype&&d.prototype.isPureReactComponent?!Ha(v,w)||!Ha(k,j):!0}function Tu(u,d,v,w){u=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(v,w),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(v,w),d.state!==u&&Rf.enqueueReplaceState(d,d.state,null)}function Ga(u,d){var v=d;if("ref"in d){v={};for(var w in d)w!=="ref"&&(v[w]=d[w])}if(u=u.defaultProps){v===d&&(v=Po({},v));for(var k in u)v[k]===void 0&&(v[k]=u[k])}return v}function Hd(u,d){try{var v=u.onUncaughtError;v(d.value,{componentStack:d.stack})}catch(w){setTimeout(function(){throw w})}}function Pd(u,d,v){try{var w=u.onCaughtError;w(v.value,{componentStack:v.stack,errorBoundary:d.tag===1?d.stateNode:null})}catch(k){setTimeout(function(){throw k})}}function Cu(u,d,v){return v=Zt(v),v.tag=3,v.payload={element:null},v.callback=function(){Hd(u,d)},v}function Sc(u){return u=Zt(u),u.tag=3,u}function Au(u,d,v,w){var k=v.type.getDerivedStateFromError;if(typeof k=="function"){var j=w.value;u.payload=function(){return k(j)},u.callback=function(){Pd(d,v,w)}}var te=v.stateNode;te!==null&&typeof te.componentDidCatch=="function"&&(u.callback=function(){Pd(d,v,w),typeof k!="function"&&(fa===null?fa=new Set([this]):fa.add(this));var re=w.stack;this.componentDidCatch(w.value,{componentStack:re!==null?re:""})})}function xg(u,d,v,w,k){if(v.flags|=32768,w!==null&&typeof w=="object"&&typeof w.then=="function"){if(d=v.alternate,d!==null&&Oo(d,v,k,!0),v=oa.current,v!==null){switch(v.tag){case 13:return Ra===null?Rr():v.alternate===null&&It===0&&(It=3),v.flags&=-257,v.flags|=65536,v.lanes=k,w===Af?v.flags|=16384:(d=v.updateQueue,d===null?v.updateQueue=new Set([w]):d.add(w),af(u,w,k)),!1;case 22:return v.flags|=65536,w===Af?v.flags|=16384:(d=v.updateQueue,d===null?(d={transitions:null,markerInstances:null,retryQueue:new Set([w])},v.updateQueue=d):(v=d.retryQueue,v===null?d.retryQueue=new Set([w]):v.add(w)),af(u,w,k)),!1}throw Error(r(435,v.tag))}return af(u,w,k),Rr(),!1}if(Gt)return d=oa.current,d!==null?((d.flags&65536)===0&&(d.flags|=256),d.flags|=65536,d.lanes=k,w!==nd&&(u=Error(r(422),{cause:w}),He(Q(u,v)))):(w!==nd&&(d=Error(r(423),{cause:w}),He(Q(d,v))),u=u.current.alternate,u.flags|=65536,k&=-k,u.lanes|=k,w=Q(w,v),k=Cu(u.stateNode,w,k),Ft(u,k),It!==4&&(It=2)),!1;var j=Error(r(520),{cause:w});if(j=Q(j,v),Qc===null?Qc=[j]:Qc.push(j),It!==4&&(It=2),d===null)return!0;w=Q(w,v),v=d;do{switch(v.tag){case 3:return v.flags|=65536,u=k&-k,v.lanes|=u,u=Cu(v.stateNode,w,u),Ft(v,u),!1;case 1:if(d=v.type,j=v.stateNode,(v.flags&128)===0&&(typeof d.getDerivedStateFromError=="function"||j!==null&&typeof j.componentDidCatch=="function"&&(fa===null||!fa.has(j))))return v.flags|=65536,k&=-k,v.lanes|=k,k=Sc(k),Au(k,u,v,w),Ft(v,k),!1}v=v.return}while(v!==null);return!1}function Hi(u,d,v,w){d.child=u===null?Fp(d,null,v,w):co(d,u.child,v,w)}function bg(u,d,v,w,k){v=v.render;var j=d.ref;if("ref"in w){var te={};for(var re in w)re!=="ref"&&(te[re]=w[re])}else te=w;return Do(d),w=Vr(u,d,v,te,j,k),re=jl(),u!==null&&!ri?(Pa(u,d,k),Ws(u,d,k)):(Gt&&re&&J(d),d.flags|=1,Hi(u,d,w,k),d.child)}function vg(u,d,v,w,k){if(u===null){var j=v.type;return typeof j=="function"&&!tl(j)&&j.defaultProps===void 0&&v.compare===null?(d.tag=15,d.type=j,Fd(u,d,j,w,k)):(u=wa(v.type,null,w,d,d.mode,k),u.ref=d.ref,u.return=d,d.child=u)}if(j=u.child,!Hh(u,k)){var te=j.memoizedProps;if(v=v.compare,v=v!==null?v:Ha,v(te,w)&&u.ref===d.ref)return Ws(u,d,k)}return d.flags|=1,u=tr(j,w),u.ref=d.ref,u.return=d,d.child=u}function Fd(u,d,v,w,k){if(u!==null){var j=u.memoizedProps;if(Ha(j,w)&&u.ref===d.ref)if(ri=!1,d.pendingProps=w=j,Hh(u,k))(u.flags&131072)!==0&&(ri=!0);else return d.lanes=u.lanes,Ws(u,d,k)}return zh(u,d,v,w,k)}function _g(u,d,v){var w=d.pendingProps,k=w.children,j=(d.stateNode._pendingVisibility&2)!==0,te=u!==null?u.memoizedState:null;if(Mu(u,d),w.mode==="hidden"||j){if((d.flags&128)!==0){if(w=te!==null?te.baseLanes|v:v,u!==null){for(k=d.child=u.child,j=0;k!==null;)j=j|k.lanes|k.childLanes,k=k.sibling;d.childLanes=j&~w}else d.childLanes=0,d.child=null;return Sg(u,d,w,v)}if((v&536870912)!==0)d.memoizedState={baseLanes:0,cachePool:null},u!==null&&Yd(d,te!==null?te.cachePool:null),te!==null?qe(d,te):nt(),_a(d);else return d.lanes=d.childLanes=536870912,Sg(u,d,te!==null?te.baseLanes|v:v,v)}else te!==null?(Yd(d,te.cachePool),qe(d,te),dr(),d.memoizedState=null):(u!==null&&Yd(d,null),nt(),dr());return Hi(u,d,k,v),d.child}function Sg(u,d,v,w){var k=Fl();return k=k===null?null:{parent:As?cn._currentValue:cn._currentValue2,pool:k},d.memoizedState={baseLanes:v,cachePool:k},u!==null&&Yd(d,null),nt(),_a(d),u!==null&&Oo(u,d,w,!0),null}function Mu(u,d){var v=d.ref;if(v===null)u!==null&&u.ref!==null&&(d.flags|=2097664);else{if(typeof v!="function"&&typeof v!="object")throw Error(r(284));(u===null||u.ref!==v)&&(d.flags|=2097664)}}function zh(u,d,v,w,k){return Do(d),v=Vr(u,d,v,w,void 0,k),w=jl(),u!==null&&!ri?(Pa(u,d,k),Ws(u,d,k)):(Gt&&w&&J(d),d.flags|=1,Hi(u,d,v,k),d.child)}function Eg(u,d,v,w,k,j){return Do(d),d.updateQueue=null,v=Dl(d,w,v,k),Ys(u),w=jl(),u!==null&&!ri?(Pa(u,d,j),Ws(u,d,j)):(Gt&&w&&J(d),d.flags|=1,Hi(u,d,v,j),d.child)}function jh(u,d,v,w,k){if(Do(d),d.stateNode===null){var j=Vo,te=v.contextType;typeof te=="object"&&te!==null&&(j=Pi(te)),j=new v(w,j),d.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,j.updater=Rf,d.stateNode=j,j._reactInternals=d,j=d.stateNode,j.props=w,j.state=d.memoizedState,j.refs={},nn(d),te=v.contextType,j.context=typeof te=="object"&&te!==null?Pi(te):Vo,j.state=d.memoizedState,te=v.getDerivedStateFromProps,typeof te=="function"&&(Zi(d,v,te,w),j.state=d.memoizedState),typeof v.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(te=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),te!==j.state&&Rf.enqueueReplaceState(j,j.state,null),ti(d,w,j,k),Wi(),j.state=d.memoizedState),typeof j.componentDidMount=="function"&&(d.flags|=4194308),w=!0}else if(u===null){j=d.stateNode;var re=d.memoizedProps,pe=Ga(v,re);j.props=pe;var Ce=j.context,De=v.contextType;te=Vo,typeof De=="object"&&De!==null&&(te=Pi(De));var Fe=v.getDerivedStateFromProps;De=typeof Fe=="function"||typeof j.getSnapshotBeforeUpdate=="function",re=d.pendingProps!==re,De||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(re||Ce!==te)&&Tu(d,j,w,te),cl=!1;var Ge=d.memoizedState;j.state=Ge,ti(d,w,j,k),Wi(),Ce=d.memoizedState,re||Ge!==Ce||cl?(typeof Fe=="function"&&(Zi(d,v,Fe,w),Ce=d.memoizedState),(pe=cl||Ul(d,v,pe,w,Ge,Ce,te))?(De||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount()),typeof j.componentDidMount=="function"&&(d.flags|=4194308)):(typeof j.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=w,d.memoizedState=Ce),j.props=w,j.state=Ce,j.context=te,w=pe):(typeof j.componentDidMount=="function"&&(d.flags|=4194308),w=!1)}else{j=d.stateNode,di(u,d),te=d.memoizedProps,De=Ga(v,te),j.props=De,Fe=d.pendingProps,Ge=j.context,Ce=v.contextType,pe=Vo,typeof Ce=="object"&&Ce!==null&&(pe=Pi(Ce)),re=v.getDerivedStateFromProps,(Ce=typeof re=="function"||typeof j.getSnapshotBeforeUpdate=="function")||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(te!==Fe||Ge!==pe)&&Tu(d,j,w,pe),cl=!1,Ge=d.memoizedState,j.state=Ge,ti(d,w,j,k),Wi();var mt=d.memoizedState;te!==Fe||Ge!==mt||cl||u!==null&&u.dependencies!==null&&Pl(u.dependencies)?(typeof re=="function"&&(Zi(d,v,re,w),mt=d.memoizedState),(De=cl||Ul(d,v,De,w,Ge,mt,pe)||u!==null&&u.dependencies!==null&&Pl(u.dependencies))?(Ce||typeof j.UNSAFE_componentWillUpdate!="function"&&typeof j.componentWillUpdate!="function"||(typeof j.componentWillUpdate=="function"&&j.componentWillUpdate(w,mt,pe),typeof j.UNSAFE_componentWillUpdate=="function"&&j.UNSAFE_componentWillUpdate(w,mt,pe)),typeof j.componentDidUpdate=="function"&&(d.flags|=4),typeof j.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof j.componentDidUpdate!="function"||te===u.memoizedProps&&Ge===u.memoizedState||(d.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||te===u.memoizedProps&&Ge===u.memoizedState||(d.flags|=1024),d.memoizedProps=w,d.memoizedState=mt),j.props=w,j.state=mt,j.context=pe,w=De):(typeof j.componentDidUpdate!="function"||te===u.memoizedProps&&Ge===u.memoizedState||(d.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||te===u.memoizedProps&&Ge===u.memoizedState||(d.flags|=1024),w=!1)}return j=w,Mu(u,d),w=(d.flags&128)!==0,j||w?(j=d.stateNode,v=w&&typeof v.getDerivedStateFromError!="function"?null:j.render(),d.flags|=1,u!==null&&w?(d.child=co(d,u.child,null,k),d.child=co(d,null,v,k)):Hi(u,d,v,k),d.memoizedState=j.state,u=d.child):u=Ws(u,d,k),u}function wg(u,d,v,w){return Be(),d.flags|=256,Hi(u,d,v,w),d.child}function Lh(u){return{baseLanes:u,cachePool:Rg()}}function Bh(u,d,v){return u=u!==null?u.childLanes&~v:0,d&&(u|=Lr),u}function Tg(u,d,v){var w=d.pendingProps,k=!1,j=(d.flags&128)!==0,te;if((te=j)||(te=u!==null&&u.memoizedState===null?!1:(mi.current&2)!==0),te&&(k=!0,d.flags&=-129),te=(d.flags&32)!==0,d.flags&=-33,u===null){if(Gt){if(k?qt(d):dr(),Gt){var re=Vi,pe;(pe=re)&&(re=ey(re,Aa),re!==null?(d.memoizedState={dehydrated:re,treeContext:Wa!==null?{id:ks,overflow:Ca}:null,retryLane:536870912},pe=n(18,null,null,0),pe.stateNode=re,pe.return=d,d.child=pe,ir=d,Vi=null,pe=!0):pe=!1),pe||ge(d)}if(re=d.memoizedState,re!==null&&(re=re.dehydrated,re!==null))return Ku(re)?d.lanes=16:d.lanes=536870912,null;$i(d)}return re=w.children,w=w.fallback,k?(dr(),k=d.mode,re=Ih({mode:"hidden",children:re},k),w=il(w,k,v,null),re.return=d,w.return=d,re.sibling=w,d.child=re,k=d.child,k.memoizedState=Lh(v),k.childLanes=Bh(u,te,v),d.memoizedState=ar,w):(qt(d),Ru(d,re))}if(pe=u.memoizedState,pe!==null&&(re=pe.dehydrated,re!==null)){if(j)d.flags&256?(qt(d),d.flags&=-257,d=Uh(u,d,v)):d.memoizedState!==null?(dr(),d.child=u.child,d.flags|=128,d=null):(dr(),k=w.fallback,re=d.mode,w=Ih({mode:"visible",children:w.children},re),k=il(k,re,v,null),k.flags|=2,w.return=d,k.return=d,w.sibling=k,d.child=w,co(d,u.child,null,v),w=d.child,w.memoizedState=Lh(v),w.childLanes=Bh(u,te,v),d.memoizedState=ar,d=k);else if(qt(d),Ku(re))te=Xg(re).digest,w=Error(r(419)),w.stack="",w.digest=te,He({value:w,source:null,stack:null}),d=Uh(u,d,v);else if(ri||Oo(u,d,v,!1),te=(v&u.childLanes)!==0,ri||te){if(te=Rt,te!==null){if(w=v&-v,(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|v))!==0?0:w,w!==0&&w!==pe.retryLane)throw pe.retryLane=w,wt(u,w),er(te,u,w),my}yf(re)||Rr(),d=Uh(u,d,v)}else yf(re)?(d.flags|=128,d.child=u.child,d=Uo.bind(null,u),Lx(re,d),d=null):(u=pe.treeContext,xr&&(Vi=Qg(re),ir=d,Gt=!0,aa=null,Aa=!1,u!==null&&(ia[ra++]=ks,ia[ra++]=Ca,ia[ra++]=Wa,ks=u.id,Ca=u.overflow,Wa=d)),d=Ru(d,w.children),d.flags|=4096);return d}return k?(dr(),k=w.fallback,re=d.mode,pe=u.child,j=pe.sibling,w=tr(pe,{mode:"hidden",children:w.children}),w.subtreeFlags=pe.subtreeFlags&31457280,j!==null?k=tr(j,k):(k=il(k,re,v,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=Lh(v):(pe=re.cachePool,pe!==null?(j=As?cn._currentValue:cn._currentValue2,pe=pe.parent!==j?{parent:j,pool:j}:pe):pe=Rg(),re={baseLanes:re.baseLanes|v,cachePool:pe}),k.memoizedState=re,k.childLanes=Bh(u,te,v),d.memoizedState=ar,w):(qt(d),v=u.child,u=v.sibling,v=tr(v,{mode:"visible",children:w.children}),v.return=d,v.sibling=null,u!==null&&(te=d.deletions,te===null?(d.deletions=[u],d.flags|=16):te.push(u)),d.child=v,d.memoizedState=null,v)}function Ru(u,d){return d=Ih({mode:"visible",children:d},u.mode),d.return=u,u.child=d}function Ih(u,d){return sf(u,d,0,null)}function Uh(u,d,v){return co(d,u.child,null,v),u=Ru(d,d.pendingProps.children),u.flags|=2,d.memoizedState=null,u}function Cg(u,d,v){u.lanes|=d;var w=u.alternate;w!==null&&(w.lanes|=d),Ph(u.return,d,v)}function qd(u,d,v,w,k){var j=u.memoizedState;j===null?u.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:w,tail:v,tailMode:k}:(j.isBackwards=d,j.rendering=null,j.renderingStartTime=0,j.last=w,j.tail=v,j.tailMode=k)}function Ag(u,d,v){var w=d.pendingProps,k=w.revealOrder,j=w.tail;if(Hi(u,d,w.children,v),w=mi.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&&Cg(u,v,d);else if(u.tag===19)Cg(u,v,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(mi,w),k){case"forwards":for(v=d.child,k=null;v!==null;)u=v.alternate,u!==null&&fr(u)===null&&(k=v),v=v.sibling;v=k,v===null?(k=d.child,d.child=null):(k=v.sibling,v.sibling=null),qd(d,!1,k,v,j);break;case"backwards":for(v=null,k=d.child,d.child=null;k!==null;){if(u=k.alternate,u!==null&&fr(u)===null){d.child=k;break}u=k.sibling,k.sibling=v,v=k,k=u}qd(d,!0,v,null,j);break;case"together":qd(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function Ws(u,d,v){if(u!==null&&(d.dependencies=u.dependencies),ua|=d.lanes,(v&d.childLanes)===0)if(u!==null){if(Oo(u,d,v,!1),(v&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,v=tr(u,u.pendingProps),d.child=v,v.return=d;u.sibling!==null;)u=u.sibling,v=v.sibling=tr(u,u.pendingProps),v.return=d;v.sibling=null}return d.child}function Hh(u,d){return(u.lanes&d)!==0?!0:(u=u.dependencies,!!(u!==null&&Pl(u)))}function Dx(u,d,v){switch(d.tag){case 3:oe(d,d.stateNode.containerInfo),Hl(d,cn,u.memoizedState.cache),Be();break;case 27:case 5:de(d);break;case 4:oe(d,d.stateNode.containerInfo);break;case 10:Hl(d,d.type,d.memoizedProps.value);break;case 13:var w=d.memoizedState;if(w!==null)return w.dehydrated!==null?(qt(d),d.flags|=128,null):(v&d.child.childLanes)!==0?Tg(u,d,v):(qt(d),u=Ws(u,d,v),u!==null?u.sibling:null);qt(d);break;case 19:var k=(u.flags&128)!==0;if(w=(v&d.childLanes)!==0,w||(Oo(u,d,v,!1),w=(v&d.childLanes)!==0),k){if(w)return Ag(u,d,v);d.flags|=128}if(k=d.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),N(mi,mi.current),w)break;return null;case 22:case 23:return d.lanes=0,_g(u,d,v);case 24:Hl(d,cn,u.memoizedState.cache)}return Ws(u,d,v)}function Mg(u,d,v){if(u!==null)if(u.memoizedProps!==d.pendingProps)ri=!0;else{if(!Hh(u,v)&&(d.flags&128)===0)return ri=!1,Dx(u,d,v);ri=(u.flags&131072)!==0}else ri=!1,Gt&&(d.flags&1048576)!==0&&I(d,ed,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")tl(w)?(u=Ga(w,u),d.tag=1,d=jh(null,d,w,u,v)):(d.tag=0,d=zh(null,d,w,u,v));else{if(w!=null){if(k=w.$$typeof,k===Ic){d.tag=11,d=bg(null,d,w,u,v);break e}else if(k===Hu){d.tag=14,d=vg(null,d,w,u,v);break e}}throw d=l(w)||w,Error(r(306,d,""))}}return d;case 0:return zh(u,d,d.type,d.pendingProps,v);case 1:return w=d.type,k=Ga(w,d.pendingProps),jh(u,d,w,k,v);case 3:e:{if(oe(d,d.stateNode.containerInfo),u===null)throw Error(r(387));var j=d.pendingProps;k=d.memoizedState,w=k.element,di(u,d),ti(d,j,null,v);var te=d.memoizedState;if(j=te.cache,Hl(d,cn,j),j!==k.cache&&Fh(d,[cn],v,!0),Wi(),j=te.element,xr&&k.isDehydrated)if(k={element:j,isDehydrated:!1,cache:te.cache},d.updateQueue.baseState=k,d.memoizedState=k,d.flags&256){d=wg(u,d,j,v);break e}else if(j!==w){w=Q(Error(r(424)),d),He(w),d=wg(u,d,j,v);break e}else for(xr&&(Vi=$g(d.stateNode.containerInfo),ir=d,Gt=!0,aa=null,Aa=!0),v=Fp(d,null,j,v),d.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(Be(),j===w){d=Ws(u,d,v);break e}Hi(u,d,j,v)}d=d.child}return d;case 26:if(ta)return Mu(u,d),u===null?(v=Sf(d.type,null,d.pendingProps,null))?d.memoizedState=v:Gt||(d.stateNode=Ix(d.type,d.pendingProps,$a.current,d)):d.memoizedState=Sf(d.type,u.memoizedProps,d.pendingProps,u.memoizedState),null;case 27:if(Gi)return de(d),u===null&&Gi&&Gt&&(w=d.stateNode=Ip(d.type,d.pendingProps,$a.current,Li.current,!1),ir=d,Aa=!0,Vi=xf(w)),w=d.pendingProps.children,u!==null||Gt?Hi(u,d,w,v):d.child=co(d,null,w,v),Mu(u,d),d.child;case 5:return u===null&&Gt&&(ay(d.type,d.pendingProps,Li.current),(k=w=Vi)&&(w=Zg(w,d.type,d.pendingProps,Aa),w!==null?(d.stateNode=w,ir=d,Vi=xf(w),Aa=!1,k=!0):k=!1),k||ge(d)),de(d),k=d.type,j=d.pendingProps,te=u!==null?u.memoizedProps:null,w=j.children,ro(k,j)?w=null:te!==null&&ro(k,te)&&(d.flags|=32),d.memoizedState!==null&&(k=Vr(u,d,zl,null,null,v),As?dt._currentValue=k:dt._currentValue2=k),Mu(u,d),Hi(u,d,w,v),d.child;case 6:return u===null&&Gt&&(sy(d.pendingProps,Li.current),(u=v=Vi)&&(v=Jg(v,d.pendingProps,Aa),v!==null?(d.stateNode=v,ir=d,Vi=null,u=!0):u=!1),u||ge(d)),null;case 13:return Tg(u,d,v);case 4:return oe(d,d.stateNode.containerInfo),w=d.pendingProps,u===null?d.child=co(d,null,w,v):Hi(u,d,w,v),d.child;case 11:return bg(u,d,d.type,d.pendingProps,v);case 7:return Hi(u,d,d.pendingProps,v),d.child;case 8:return Hi(u,d,d.pendingProps.children,v),d.child;case 12:return Hi(u,d,d.pendingProps.children,v),d.child;case 10:return w=d.pendingProps,Hl(d,d.type,w.value),Hi(u,d,w.children,v),d.child;case 9:return k=d.type._context,w=d.pendingProps.children,Do(d),k=Pi(k),w=w(k),d.flags|=1,Hi(u,d,w,v),d.child;case 14:return vg(u,d,d.type,d.pendingProps,v);case 15:return Fd(u,d,d.type,d.pendingProps,v);case 19:return Ag(u,d,v);case 22:return _g(u,d,v);case 24:return Do(d),w=Pi(cn),u===null?(k=Fl(),k===null&&(k=Rt,j=Gd(),k.pooledCache=j,j.refCount++,j!==null&&(k.pooledCacheLanes|=v),k=j),d.memoizedState={parent:w,cache:k},nn(d),Hl(d,cn,k)):((u.lanes&v)!==0&&(di(u,d),ti(d,null,null,v),Wi()),k=u.memoizedState,j=d.memoizedState,k.parent!==w?(k={parent:w,cache:w},d.memoizedState=k,d.lanes===0&&(d.memoizedState=d.updateQueue.baseState=k),Hl(d,cn,w)):(w=j.cache,Hl(d,cn,w),w!==k.cache&&Fh(d,[cn],v,!0))),Hi(u,d,d.pendingProps.children,v),d.child;case 29:throw d.pendingProps}throw Error(r(156,d.tag))}function Hl(u,d,v){As?(N(zr,d._currentValue),d._currentValue=v):(N(zr,d._currentValue2),d._currentValue2=v)}function $s(u){var d=zr.current;As?u._currentValue=d:u._currentValue2=d,C(zr)}function Ph(u,d,v){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===v)break;u=u.return}}function Fh(u,d,v,w){var k=u.child;for(k!==null&&(k.return=u);k!==null;){var j=k.dependencies;if(j!==null){var te=k.child;j=j.firstContext;e:for(;j!==null;){var re=j;j=k;for(var pe=0;pe<d.length;pe++)if(re.context===d[pe]){j.lanes|=v,re=j.alternate,re!==null&&(re.lanes|=v),Ph(j.return,v,u),w||(te=null);break e}j=re.next}}else if(k.tag===18){if(te=k.return,te===null)throw Error(r(341));te.lanes|=v,j=te.alternate,j!==null&&(j.lanes|=v),Ph(te,v,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 Oo(u,d,v,w){u=null;for(var k=d,j=!1;k!==null;){if(!j){if((k.flags&524288)!==0)j=!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;na(k.pendingProps.value,te.value)||(u!==null?u.push(re):u=[re])}}else if(k===Yc.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&&Fh(d,u,v,w),d.flags|=262144}function Pl(u){for(u=u.firstContext;u!==null;){var d=u.context;if(!na(As?d._currentValue:d._currentValue2,u.memoizedValue))return!0;u=u.next}return!1}function Do(u){fo=u,Wn=null,u=u.dependencies,u!==null&&(u.firstContext=null)}function Pi(u){return qh(fo,u)}function ku(u,d){return fo===null&&Do(u),qh(u,d)}function qh(u,d){var v=As?d._currentValue:d._currentValue2;if(d={context:d,memoizedValue:v,next:null},Wn===null){if(u===null)throw Error(r(308));Wn=d,u.dependencies={lanes:0,firstContext:d},u.flags|=524288}else Wn=Wn.next=d;return v}function Gd(){return{controller:new gy,data:new Map,refCount:0}}function Ec(u){u.refCount--,u.refCount===0&&dl(Wo,function(){u.controller.abort()})}function Fl(){var u=fl.current;return u!==null?u:Rt.pooledCache}function Yd(u,d){d===null?N(fl,fl.current):N(fl,d.pool)}function Rg(){var u=Fl();return u===null?null:{parent:As?cn._currentValue:cn._currentValue2,pool:u}}function $r(u){u.flags|=4}function Gh(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 Vd(u,d,v,w){if(qi)for(v=d.child;v!==null;){if(v.tag===5||v.tag===6)Cs(u,v.stateNode);else if(!(v.tag===4||Gi&&v.tag===27)&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===d)break;for(;v.sibling===null;){if(v.return===null||v.return===d)return;v=v.return}v.sibling.return=v.return,v=v.sibling}else if(Jr)for(var k=d.child;k!==null;){if(k.tag===5){var j=k.stateNode;v&&w&&(j=Tp(j,k.type,k.memoizedProps)),Cs(u,j)}else if(k.tag===6)j=k.stateNode,v&&w&&(j=Cp(j,k.memoizedProps)),Cs(u,j);else if(k.tag!==4){if(k.tag===22&&k.memoizedState!==null)j=k.child,j!==null&&(j.return=k),Vd(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 wc(u,d,v,w){if(Jr)for(var k=d.child;k!==null;){if(k.tag===5){var j=k.stateNode;v&&w&&(j=Tp(j,k.type,k.memoizedProps)),Ep(u,j)}else if(k.tag===6)j=k.stateNode,v&&w&&(j=Cp(j,k.memoizedProps)),Ep(u,j);else if(k.tag!==4){if(k.tag===22&&k.memoizedState!==null)j=k.child,j!==null&&(j.return=k),wc(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 Tc(u,d){if(Jr&&Gh(u,d)){u=d.stateNode;var v=u.containerInfo,w=gf();wc(w,d,!1,!1),u.pendingChildren=w,$r(d),Vg(v,w)}}function Yh(u,d,v,w){if(qi)u.memoizedProps!==w&&$r(d);else if(Jr){var k=u.stateNode,j=u.memoizedProps;if((u=Gh(u,d))||j!==w){var te=Li.current;j=Sp(k,v,j,w,!u,null),j===k?d.stateNode=k:(al(j,v,w,te)&&$r(d),d.stateNode=j,u?Vd(j,d,!1,!1):$r(d))}else d.stateNode=k}}function Cc(u,d,v){if(qg(d,v)){if(u.flags|=16777216,!sl(d,v))if(Lu())u.flags|=8192;else throw Ko=Af,Pp}else u.flags&=-16777217}function Vh(u,d){if(ly(d)){if(u.flags|=16777216,!Lp(d))if(Lu())u.flags|=8192;else throw Ko=Af,Pp}else u.flags&=-16777217}function Nu(u,d){d!==null&&(u.flags|=4),u.flags&16384&&(d=u.tag!==22?K():536870912,u.lanes|=d,pl|=d)}function zo(u,d){if(!Gt)switch(u.tailMode){case"hidden":d=u.tail;for(var v=null;d!==null;)d.alternate!==null&&(v=d),d=d.sibling;v===null?u.tail=null:v.sibling=null;break;case"collapsed":v=u.tail;for(var w=null;v!==null;)v.alternate!==null&&(w=v),v=v.sibling;w===null?d||u.tail===null?u.tail=null:u.tail.sibling=null:w.sibling=null}}function On(u){var d=u.alternate!==null&&u.alternate.child===u.child,v=0,w=0;if(d)for(var k=u.child;k!==null;)v|=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;)v|=k.lanes|k.childLanes,w|=k.subtreeFlags,w|=k.flags,k.return=u,k=k.sibling;return u.subtreeFlags|=w,u.childLanes=v,d}function kg(u,d,v){var w=d.pendingProps;switch(q(d),d.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return On(d),null;case 1:return On(d),null;case 3:return v=d.stateNode,w=null,u!==null&&(w=u.memoizedState.cache),d.memoizedState.cache!==w&&(d.flags|=2048),$s(cn),ie(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(u===null||u.child===null)&&(Le(d)?$r(d):u===null||u.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,aa!==null&&(Zs(aa),aa=null))),Tc(u,d),On(d),null;case 26:if(ta){v=d.type;var k=d.memoizedState;return u===null?($r(d),k!==null?(On(d),Vh(d,k)):(On(d),Cc(d,v,w))):k?k!==u.memoizedState?($r(d),On(d),Vh(d,k)):(On(d),d.flags&=-16777217):(qi?u.memoizedProps!==w&&$r(d):Yh(u,d,v,w),On(d),Cc(d,v,w)),null}case 27:if(Gi){if(me(d),v=$a.current,k=d.type,u!==null&&d.stateNode!=null)qi?u.memoizedProps!==w&&$r(d):Yh(u,d,k,w);else{if(!w){if(d.stateNode===null)throw Error(r(166));return On(d),null}u=Li.current,Le(d)?le(d,u):(u=Ip(k,w,v,u,!0),d.stateNode=u,$r(d))}return On(d),null}case 5:if(me(d),v=d.type,u!==null&&d.stateNode!=null)Yh(u,d,v,w);else{if(!w){if(d.stateNode===null)throw Error(r(166));return On(d),null}u=Li.current,Le(d)?le(d,u):(k=dp(v,w,$a.current,u,d),Vd(k,d,!1,!1),d.stateNode=k,al(k,v,w,u)&&$r(d))}return On(d),Cc(d,d.type,d.pendingProps),null;case 6:if(u&&d.stateNode!=null)v=u.memoizedProps,qi?v!==w&&$r(d):Jr&&(v!==w?(d.stateNode=uf(w,$a.current,Li.current,d),$r(d)):d.stateNode=u.stateNode);else{if(typeof w!="string"&&d.stateNode===null)throw Error(r(166));if(u=$a.current,v=Li.current,Le(d)){if(!xr)throw Error(r(176));if(u=d.stateNode,v=d.memoizedProps,w=null,k=ir,k!==null)switch(k.tag){case 27:case 5:w=k.memoizedProps}ty(u,v,d,w)||ge(d)}else d.stateNode=uf(w,u,v,d)}return On(d),null;case 13:if(w=d.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(k=Le(d),w!==null&&w.dehydrated!==null){if(u===null){if(!k)throw Error(r(318));if(!xr)throw Error(r(344));if(k=d.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(r(317));Hc(k,d)}else Be(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;On(d),k=!1}else aa!==null&&(Zs(aa),aa=null),k=!0;if(!k)return d.flags&256?($i(d),d):($i(d),null)}if($i(d),(d.flags&128)!==0)return d.lanes=v,d;if(v=w!==null,u=u!==null&&u.memoizedState!==null,v){w=d.child,k=null,w.alternate!==null&&w.alternate.memoizedState!==null&&w.alternate.memoizedState.cachePool!==null&&(k=w.alternate.memoizedState.cachePool.pool);var j=null;w.memoizedState!==null&&w.memoizedState.cachePool!==null&&(j=w.memoizedState.cachePool.pool),j!==k&&(w.flags|=2048)}return v!==u&&v&&(d.child.flags|=8192),Nu(d,d.updateQueue),On(d),null;case 4:return ie(),Tc(u,d),u===null&&pp(d.stateNode.containerInfo),On(d),null;case 10:return $s(d.type),On(d),null;case 19:if(C(mi),k=d.memoizedState,k===null)return On(d),null;if(w=(d.flags&128)!==0,j=k.rendering,j===null)if(w)zo(k,!1);else{if(It!==0||u!==null&&(u.flags&128)!==0)for(u=d.child;u!==null;){if(j=fr(u),j!==null){for(d.flags|=128,zo(k,!1),u=j.updateQueue,d.updateQueue=u,Nu(d,u),d.subtreeFlags=0,u=v,v=d.child;v!==null;)nl(v,u),v=v.sibling;return N(mi,mi.current&1|2),d.child}u=u.sibling}k.tail!==null&&Yi()>qn&&(d.flags|=128,w=!0,zo(k,!1),d.lanes=4194304)}else{if(!w)if(u=fr(j),u!==null){if(d.flags|=128,w=!0,u=u.updateQueue,d.updateQueue=u,Nu(d,u),zo(k,!0),k.tail===null&&k.tailMode==="hidden"&&!j.alternate&&!Gt)return On(d),null}else 2*Yi()-k.renderingStartTime>qn&&v!==536870912&&(d.flags|=128,w=!0,zo(k,!1),d.lanes=4194304);k.isBackwards?(j.sibling=d.child,d.child=j):(u=k.last,u!==null?u.sibling=j:d.child=j,k.last=j)}return k.tail!==null?(d=k.tail,k.rendering=d,k.tail=d.sibling,k.renderingStartTime=Yi(),d.sibling=null,u=mi.current,N(mi,w?u&1|2:u&1),d):(On(d),null);case 22:case 23:return $i(d),kn(),w=d.memoizedState!==null,u!==null?u.memoizedState!==null!==w&&(d.flags|=8192):w&&(d.flags|=8192),w?(v&536870912)!==0&&(d.flags&128)===0&&(On(d),d.subtreeFlags&6&&(d.flags|=8192)):On(d),v=d.updateQueue,v!==null&&Nu(d,v.retryQueue),v=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),w=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(w=d.memoizedState.cachePool.pool),w!==v&&(d.flags|=2048),u!==null&&C(fl),null;case 24:return v=null,u!==null&&(v=u.memoizedState.cache),d.memoizedState.cache!==v&&(d.flags|=2048),$s(cn),On(d),null;case 25:return null}throw Error(r(156,d.tag))}function Ng(u,d){switch(q(d),d.tag){case 1:return u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 3:return $s(cn),ie(),u=d.flags,(u&65536)!==0&&(u&128)===0?(d.flags=u&-65537|128,d):null;case 26:case 27:case 5:return me(d),null;case 13:if($i(d),u=d.memoizedState,u!==null&&u.dehydrated!==null){if(d.alternate===null)throw Error(r(340));Be()}return u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 19:return C(mi),null;case 4:return ie(),null;case 10:return $s(d.type),null;case 22:case 23:return $i(d),kn(),u!==null&&C(fl),u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 24:return $s(cn),null;case 25:return null;default:return null}}function Xh(u,d){switch(q(d),d.tag){case 3:$s(cn),ie();break;case 26:case 27:case 5:me(d);break;case 4:ie();break;case 13:$i(d);break;case 19:C(mi);break;case 10:$s(d.type);break;case 22:case 23:$i(d),kn(),u!==null&&C(fl);break;case 24:$s(cn)}}function Ou(u,d){try{var v=d.updateQueue,w=v!==null?v.lastEffect:null;if(w!==null){var k=w.next;v=k;do{if((v.tag&u)===u){w=void 0;var j=v.create,te=v.inst;w=j(),te.destroy=w}v=v.next}while(v!==k)}}catch(re){Ot(d,d.return,re)}}function ql(u,d,v){try{var w=d.updateQueue,k=w!==null?w.lastEffect:null;if(k!==null){var j=k.next;w=j;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=v;try{re()}catch(Ce){Ot(k,pe,Ce)}}}w=w.next}while(w!==j)}}catch(Ce){Ot(d,d.return,Ce)}}function Og(u){var d=u.updateQueue;if(d!==null){var v=u.stateNode;try{hs(d,v)}catch(w){Ot(u,u.return,w)}}}function Dg(u,d,v){v.props=Ga(u.type,u.memoizedProps),v.state=u.memoizedState;try{v.componentWillUnmount()}catch(w){Ot(u,d,w)}}function jo(u,d){try{var v=u.ref;if(v!==null){var w=u.stateNode;switch(u.tag){case 26:case 27:case 5:var k=Uc(w);break;default:k=w}typeof v=="function"?u.refCleanup=v(k):v.current=k}}catch(j){Ot(u,d,j)}}function Dn(u,d){var v=u.ref,w=u.refCleanup;if(v!==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 v=="function")try{v(null)}catch(k){Ot(u,d,k)}else v.current=null}function Ac(u){var d=u.type,v=u.memoizedProps,w=u.stateNode;try{jx(w,d,v,u)}catch(k){Ot(u,u.return,k)}}function Kh(u,d,v){try{xp(u.stateNode,u.type,v,d,u)}catch(w){Ot(u,u.return,w)}}function Wh(u){return u.tag===5||u.tag===3||(ta?u.tag===26:!1)||(Gi?u.tag===27:!1)||u.tag===4}function Xd(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||Wh(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&(!Gi||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 Kd(u,d,v){var w=u.tag;if(w===5||w===6)u=u.stateNode,d?vp(v,u,d):Gg(v,u);else if(!(w===4||Gi&&w===27)&&(u=u.child,u!==null))for(Kd(u,d,v),u=u.sibling;u!==null;)Kd(u,d,v),u=u.sibling}function Mc(u,d,v){var w=u.tag;if(w===5||w===6)u=u.stateNode,d?bp(v,u,d):yp(v,u);else if(!(w===4||Gi&&w===27)&&(u=u.child,u!==null))for(Mc(u,d,v),u=u.sibling;u!==null;)Mc(u,d,v),u=u.sibling}function zg(u,d,v){u=u.containerInfo;try{wp(u,v)}catch(w){Ot(d,d.return,w)}}function Rc(u,d){for(io(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 v=u.alternate;switch(d=u.flags,u.tag){case 0:break;case 11:case 15:break;case 1:if((d&1024)!==0&&v!==null){d=void 0;var w=u,k=v.memoizedProps;v=v.memoizedState;var j=w.stateNode;try{var te=Ga(w.type,k,w.elementType===w.type);d=j.getSnapshotBeforeUpdate(te,v),j.__reactInternalSnapshotBeforeUpdate=d}catch(re){Ot(w,w.return,re)}}break;case 3:(d&1024)!==0&&qi&&mf(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=$o,$o=!1,te}function Wd(u,d,v){var w=v.flags;switch(v.tag){case 0:case 11:case 15:vs(u,v),w&4&&Ou(5,v);break;case 1:if(vs(u,v),w&4)if(u=v.stateNode,d===null)try{u.componentDidMount()}catch(re){Ot(v,v.return,re)}else{var k=Ga(v.type,d.memoizedProps);d=d.memoizedState;try{u.componentDidUpdate(k,d,u.__reactInternalSnapshotBeforeUpdate)}catch(re){Ot(v,v.return,re)}}w&64&&Og(v),w&512&&jo(v,v.return);break;case 3:if(vs(u,v),w&64&&(w=v.updateQueue,w!==null)){if(u=null,v.child!==null)switch(v.child.tag){case 27:case 5:u=Uc(v.child.stateNode);break;case 1:u=v.child.stateNode}try{hs(w,u)}catch(re){Ot(v,v.return,re)}}break;case 26:if(ta){vs(u,v),w&512&&jo(v,v.return);break}case 27:case 5:vs(u,v),d===null&&w&4&&Ac(v),w&512&&jo(v,v.return);break;case 12:vs(u,v);break;case 13:vs(u,v),w&4&&Gl(u,v);break;case 22:if(k=v.memoizedState!==null||Ci,!k){d=d!==null&&d.memoizedState!==null||Fn;var j=Ci,te=Fn;Ci=k,(Fn=d)&&!te?Vl(u,v,(v.subtreeFlags&8772)!==0):vs(u,v),Ci=j,Fn=te}w&512&&(v.memoizedProps.mode==="manual"?jo(v,v.return):Dn(v,v.return));break;default:vs(u,v)}}function kc(u){var d=u.alternate;d!==null&&(u.alternate=null,kc(d)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(d=u.stateNode,d!==null&&mp(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 Qr(u,d,v){for(v=v.child;v!==null;)$d(u,d,v),v=v.sibling}function $d(u,d,v){if(Or&&typeof Or.onCommitFiberUnmount=="function")try{Or.onCommitFiberUnmount(Gc,v)}catch{}switch(v.tag){case 26:if(ta){Fn||Dn(v,d),Qr(u,d,v),v.memoizedState?Np(v.memoizedState):v.stateNode&&zp(v.stateNode);break}case 27:if(Gi){Fn||Dn(v,d);var w=ai,k=jr;ai=v.stateNode,Qr(u,d,v),oy(v.stateNode),ai=w,jr=k;break}case 5:Fn||Dn(v,d);case 6:if(qi){if(w=ai,k=jr,ai=null,Qr(u,d,v),ai=w,jr=k,ai!==null)if(jr)try{ni(ai,v.stateNode)}catch(j){Ot(v,d,j)}else try{br(ai,v.stateNode)}catch(j){Ot(v,d,j)}}else Qr(u,d,v);break;case 18:qi&&ai!==null&&(jr?Mp(ai,v.stateNode):iy(ai,v.stateNode));break;case 4:qi?(w=ai,k=jr,ai=v.stateNode.containerInfo,jr=!0,Qr(u,d,v),ai=w,jr=k):(Jr&&zg(v.stateNode,v,gf()),Qr(u,d,v));break;case 0:case 11:case 14:case 15:Fn||ql(2,v,d),Fn||ql(4,v,d),Qr(u,d,v);break;case 1:Fn||(Dn(v,d),w=v.stateNode,typeof w.componentWillUnmount=="function"&&Dg(v,d,w)),Qr(u,d,v);break;case 21:Qr(u,d,v);break;case 22:Fn||Dn(v,d),Fn=(w=Fn)||v.memoizedState!==null,Qr(u,d,v),Fn=w;break;default:Qr(u,d,v)}}function Gl(u,d){if(xr&&d.memoizedState===null&&(u=d.alternate,u!==null&&(u=u.memoizedState,u!==null&&(u=u.dehydrated,u!==null))))try{vf(u)}catch(v){Ot(d,d.return,v)}}function Nc(u){switch(u.tag){case 13:case 19:var d=u.stateNode;return d===null&&(d=u.stateNode=new $c),d;case 22:return u=u.stateNode,d=u._retryCache,d===null&&(d=u._retryCache=new $c),d;default:throw Error(r(435,u.tag))}}function Du(u,d){var v=Nc(u);d.forEach(function(w){var k=ep.bind(null,u,w);v.has(w)||(v.add(w),w.then(k,k))})}function mr(u,d){var v=d.deletions;if(v!==null)for(var w=0;w<v.length;w++){var k=v[w],j=u,te=d;if(qi){var re=te;e:for(;re!==null;){switch(re.tag){case 27:case 5:ai=re.stateNode,jr=!1;break e;case 3:ai=re.stateNode.containerInfo,jr=!0;break e;case 4:ai=re.stateNode.containerInfo,jr=!0;break e}re=re.return}if(ai===null)throw Error(r(160));$d(j,te,k),ai=null,jr=!1}else $d(j,te,k);j=k.alternate,j!==null&&(j.return=null),k.return=null}if(d.subtreeFlags&13878)for(d=d.child;d!==null;)Yl(d,u),d=d.sibling}function Yl(u,d){var v=u.alternate,w=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:mr(d,u),Ar(u),w&4&&(ql(3,u,u.return),Ou(3,u),ql(5,u,u.return));break;case 1:mr(d,u),Ar(u),w&512&&(Fn||v===null||Dn(v,v.return)),w&64&&Ci&&(u=u.updateQueue,u!==null&&(w=u.callbacks,w!==null&&(v=u.shared.hiddenCallbacks,u.shared.hiddenCallbacks=v===null?w:v.concat(w))));break;case 26:if(ta){var k=vr;mr(d,u),Ar(u),w&512&&(Fn||v===null||Dn(v,v.return)),w&4&&(w=v!==null?v.memoizedState:null,d=u.memoizedState,v===null?d===null?u.stateNode===null?u.stateNode=Op(k,u.type,u.memoizedProps,u):Dp(k,u.type,u.stateNode):u.stateNode=kp(k,d,u.memoizedProps):w!==d?(w===null?v.stateNode!==null&&zp(v.stateNode):Np(w),d===null?Dp(k,u.type,u.stateNode):kp(k,d,u.memoizedProps)):d===null&&u.stateNode!==null&&Kh(u,u.memoizedProps,v.memoizedProps));break}case 27:if(Gi&&w&4&&u.alternate===null){k=u.stateNode;var j=u.memoizedProps;try{Ux(k),Hx(u.type,j,k,u)}catch(De){Ot(u,u.return,De)}}case 5:if(mr(d,u),Ar(u),w&512&&(Fn||v===null||Dn(v,v.return)),qi){if(u.flags&32){d=u.stateNode;try{Vu(d)}catch(De){Ot(u,u.return,De)}}w&4&&u.stateNode!=null&&(d=u.memoizedProps,Kh(u,d,v!==null?v.memoizedProps:d)),w&1024&&(ho=!0)}break;case 6:if(mr(d,u),Ar(u),w&4&&qi){if(u.stateNode===null)throw Error(r(162));w=u.memoizedProps,v=v!==null?v.memoizedProps:w,d=u.stateNode;try{Yg(d,v,w)}catch(De){Ot(u,u.return,De)}}break;case 3:if(ta?(jp(),k=vr,vr=_f(d.containerInfo),mr(d,u),vr=k):mr(d,u),Ar(u),w&4){if(qi&&xr&&v!==null&&v.memoizedState.isDehydrated)try{bf(d.containerInfo)}catch(De){Ot(u,u.return,De)}if(Jr){w=d.containerInfo,v=d.pendingChildren;try{wp(w,v)}catch(De){Ot(u,u.return,De)}}}ho&&(ho=!1,$h(u));break;case 4:ta?(v=vr,vr=_f(u.stateNode.containerInfo),mr(d,u),Ar(u),vr=v):(mr(d,u),Ar(u)),w&4&&Jr&&zg(u.stateNode,u,u.stateNode.pendingChildren);break;case 12:mr(d,u),Ar(u);break;case 13:mr(d,u),Ar(u),u.child.flags&8192&&u.memoizedState!==null!=(v!==null&&v.memoizedState!==null)&&(zs=Yi()),w&4&&(w=u.updateQueue,w!==null&&(u.updateQueue=null,Du(u,w)));break;case 22:w&512&&(Fn||v===null||Dn(v,v.return)),k=u.memoizedState!==null;var te=v!==null&&v.memoizedState!==null,re=Ci,pe=Fn;if(Ci=re||k,Fn=pe||te,mr(d,u),Fn=pe,Ci=re,Ar(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=Ci||Fn,v===null||te||d||Oc(u)),qi&&(u.memoizedProps===null||u.memoizedProps.mode!=="manual"))){e:if(v=null,qi)for(d=u;;){if(d.tag===5||ta&&d.tag===26||Gi&&d.tag===27){if(v===null){te=v=d;try{j=te.stateNode,k?Xu(j):_p(te.stateNode,te.memoizedProps)}catch(De){Ot(te,te.return,De)}}}else if(d.tag===6){if(v===null){te=d;try{var Ce=te.stateNode;k?pf(Ce):ll(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;v===d&&(v=null),d=d.return}v===d&&(v=null),d.sibling.return=d.return,d=d.sibling}}w&4&&(w=u.updateQueue,w!==null&&(v=w.retryQueue,v!==null&&(w.retryQueue=null,Du(u,v))));break;case 19:mr(d,u),Ar(u),w&4&&(w=u.updateQueue,w!==null&&(u.updateQueue=null,Du(u,w)));break;case 21:break;default:mr(d,u),Ar(u)}}function Ar(u){var d=u.flags;if(d&2){try{if(qi&&(!Gi||u.tag!==27)){e:{for(var v=u.return;v!==null;){if(Wh(v)){var w=v;break e}v=v.return}throw Error(r(160))}switch(w.tag){case 27:if(Gi){var k=w.stateNode,j=Xd(u);Mc(u,j,k);break}case 5:var te=w.stateNode;w.flags&32&&(Vu(te),w.flags&=-33);var re=Xd(u);Mc(u,re,te);break;case 3:case 4:var pe=w.stateNode.containerInfo,Ce=Xd(u);Kd(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 $h(u){if(u.subtreeFlags&1024)for(u=u.child;u!==null;){var d=u;$h(d),d.tag===5&&d.flags&1024&&xn(d.stateNode),u=u.sibling}}function vs(u,d){if(d.subtreeFlags&8772)for(d=d.child;d!==null;)Wd(u,d.alternate,d),d=d.sibling}function Oc(u){for(u=u.child;u!==null;){var d=u;switch(d.tag){case 0:case 11:case 14:case 15:ql(4,d,d.return),Oc(d);break;case 1:Dn(d,d.return);var v=d.stateNode;typeof v.componentWillUnmount=="function"&&Dg(d,d.return,v),Oc(d);break;case 26:case 27:case 5:Dn(d,d.return),Oc(d);break;case 22:Dn(d,d.return),d.memoizedState===null&&Oc(d);break;default:Oc(d)}u=u.sibling}}function Vl(u,d,v){for(v=v&&(d.subtreeFlags&8772)!==0,d=d.child;d!==null;){var w=d.alternate,k=u,j=d,te=j.flags;switch(j.tag){case 0:case 11:case 15:Vl(k,j,v),Ou(4,j);break;case 1:if(Vl(k,j,v),w=j,k=w.stateNode,typeof k.componentDidMount=="function")try{k.componentDidMount()}catch(Ce){Ot(w,w.return,Ce)}if(w=j,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++)Ao(pe[k],re)}catch(Ce){Ot(w,w.return,Ce)}}v&&te&64&&Og(j),jo(j,j.return);break;case 26:case 27:case 5:Vl(k,j,v),v&&w===null&&te&4&&Ac(j),jo(j,j.return);break;case 12:Vl(k,j,v);break;case 13:Vl(k,j,v),v&&te&4&&Gl(k,j);break;case 22:j.memoizedState===null&&Vl(k,j,v),jo(j,j.return);break;default:Vl(k,j,v)}d=d.sibling}}function Qh(u,d){var v=null;u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),u=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(u=d.memoizedState.cachePool.pool),u!==v&&(u!=null&&u.refCount++,v!=null&&Ec(v))}function Qd(u,d){u=null,d.alternate!==null&&(u=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==u&&(d.refCount++,u!=null&&Ec(u))}function Qs(u,d,v,w){if(d.subtreeFlags&10256)for(d=d.child;d!==null;)Zd(u,d,v,w),d=d.sibling}function Zd(u,d,v,w){var k=d.flags;switch(d.tag){case 0:case 11:case 15:Qs(u,d,v,w),k&2048&&Ou(9,d);break;case 3:Qs(u,d,v,w),k&2048&&(u=null,d.alternate!==null&&(u=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==u&&(d.refCount++,u!=null&&Ec(u)));break;case 12:if(k&2048){Qs(u,d,v,w),u=d.stateNode;try{var j=d.memoizedProps,te=j.id,re=j.onPostCommit;typeof re=="function"&&re(te,d.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(pe){Ot(d,d.return,pe)}}else Qs(u,d,v,w);break;case 23:break;case 22:j=d.stateNode,d.memoizedState!==null?j._visibility&4?Qs(u,d,v,w):Xl(u,d):j._visibility&4?Qs(u,d,v,w):(j._visibility|=4,Ji(u,d,v,w,(d.subtreeFlags&10256)!==0)),k&2048&&Qh(d.alternate,d);break;case 24:Qs(u,d,v,w),k&2048&&Qd(d.alternate,d);break;default:Qs(u,d,v,w)}}function Ji(u,d,v,w,k){for(k=k&&(d.subtreeFlags&10256)!==0,d=d.child;d!==null;){var j=u,te=d,re=v,pe=w,Ce=te.flags;switch(te.tag){case 0:case 11:case 15:Ji(j,te,re,pe,k),Ou(8,te);break;case 23:break;case 22:var De=te.stateNode;te.memoizedState!==null?De._visibility&4?Ji(j,te,re,pe,k):Xl(j,te):(De._visibility|=4,Ji(j,te,re,pe,k)),k&&Ce&2048&&Qh(te.alternate,te);break;case 24:Ji(j,te,re,pe,k),k&&Ce&2048&&Qd(te.alternate,te);break;default:Ji(j,te,re,pe,k)}d=d.sibling}}function Xl(u,d){if(d.subtreeFlags&10256)for(d=d.child;d!==null;){var v=u,w=d,k=w.flags;switch(w.tag){case 22:Xl(v,w),k&2048&&Qh(w.alternate,w);break;case 24:Xl(v,w),k&2048&&Qd(w.alternate,w);break;default:Xl(v,w)}d=d.sibling}}function Oi(u){if(u.subtreeFlags&Qo)for(u=u.child;u!==null;)Lo(u),u=u.sibling}function Lo(u){switch(u.tag){case 26:Oi(u),u.flags&Qo&&(u.memoizedState!==null?Bp(vr,u.memoizedState,u.memoizedProps):Yn(u.type,u.memoizedProps));break;case 5:Oi(u),u.flags&Qo&&Yn(u.type,u.memoizedProps);break;case 3:case 4:if(ta){var d=vr;vr=_f(u.stateNode.containerInfo),Oi(u),vr=d}else Oi(u);break;case 22:u.memoizedState===null&&(d=u.alternate,d!==null&&d.memoizedState!==null?(d=Qo,Qo=16777216,Oi(u),Qo=d):Oi(u));break;default:Oi(u)}}function Jd(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 Kl(u){var d=u.deletions;if((u.flags&16)!==0){if(d!==null)for(var v=0;v<d.length;v++){var w=d[v];$n=w,Wl(w,u)}Jd(u)}if(u.subtreeFlags&10256)for(u=u.child;u!==null;)zu(u),u=u.sibling}function zu(u){switch(u.tag){case 0:case 11:case 15:Kl(u),u.flags&2048&&ql(9,u,u.return);break;case 3:Kl(u);break;case 12:Kl(u);break;case 22:var d=u.stateNode;u.memoizedState!==null&&d._visibility&4&&(u.return===null||u.return.tag!==13)?(d._visibility&=-5,Dc(u)):Kl(u);break;default:Kl(u)}}function Dc(u){var d=u.deletions;if((u.flags&16)!==0){if(d!==null)for(var v=0;v<d.length;v++){var w=d[v];$n=w,Wl(w,u)}Jd(u)}for(u=u.child;u!==null;){switch(d=u,d.tag){case 0:case 11:case 15:ql(8,d,d.return),Dc(d);break;case 22:v=d.stateNode,v._visibility&4&&(v._visibility&=-5,Dc(d));break;default:Dc(d)}u=u.sibling}}function Wl(u,d){for(;$n!==null;){var v=$n;switch(v.tag){case 0:case 11:case 15:ql(8,v,d);break;case 23:case 22:if(v.memoizedState!==null&&v.memoizedState.cachePool!==null){var w=v.memoizedState.cachePool.pool;w!=null&&w.refCount++}break;case 24:Ec(v.memoizedState.cache)}if(w=v.child,w!==null)w.return=v,$n=w;else e:for(v=u;$n!==null;){w=$n;var k=w.sibling,j=w.return;if(kc(w),w===v){$n=null;break e}if(k!==null){k.return=j,$n=k;break e}$n=j}}}function ef(u){var d=hp(u);if(d!=null){if(typeof d.memoizedProps["data-testname"]!="string")throw Error(r(364));return d}if(u=Yo(u),u===null)throw Error(r(362));return u.stateNode.current}function zc(u,d){var v=u.tag;switch(d.$$typeof){case od:if(u.type===d.value)return!0;break;case Of:e:{for(d=d.value,u=[u,0],v=0;v<u.length;){var w=u[v++],k=w.tag,j=u[v++],te=d[j];if(k!==5&&k!==26&&k!==27||!Rs(w)){for(;te!=null&&zc(w,te);)j++,te=d[j];if(j===d.length){d=!0;break e}else for(w=w.child;w!==null;)u.push(w,j),w=w.sibling}}d=!1}return d;case Df:if((v===5||v===26||v===27)&&zx(u.stateNode,d.value))return!0;break;case un:if((v===5||v===6||v===26||v===27)&&(u=Yu(u),u!==null&&0<=u.indexOf(d.value)))return!0;break;case Bt:if((v===5||v===26||v===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 $l(u){switch(u.$$typeof){case od:return"<"+(l(u.value)||"Unknown")+">";case Of:return":has("+($l(u)||"")+")";case Df:return'[role="'+u.value+'"]';case un:return'"'+u.value+'"';case Bt:return'[data-testname="'+u.value+'"]';default:throw Error(r(365))}}function jg(u,d){var v=[];u=[u,0];for(var w=0;w<u.length;){var k=u[w++],j=k.tag,te=u[w++],re=d[te];if(j!==5&&j!==26&&j!==27||!Rs(k)){for(;re!=null&&zc(k,re);)te++,re=d[te];if(te===d.length)v.push(k);else for(k=k.child;k!==null;)u.push(k,te),k=k.sibling}}return v}function gr(u,d){if(!Ms)throw Error(r(363));u=ef(u),u=jg(u,d),d=[],u=Array.from(u);for(var v=0;v<u.length;){var w=u[v++],k=w.tag;if(k===5||k===26||k===27)Rs(w)||d.push(w.stateNode);else for(w=w.child;w!==null;)u.push(w),w=w.sibling}return d}function yr(){if((et&2)!==0&&Tt!==0)return Tt&-Tt;if(at.T!==null){var u=Dr;return u!==0?u:ke()}return Ta()}function _s(){Lr===0&&(Lr=(Tt&536870912)===0||Gt?Z():536870912);var u=oa.current;return u!==null&&(u.flags|=32),Lr}function er(u,d,v){(u===Rt&&bn===2||u.cancelPendingCommit!==null)&&(Va(u,0),Ya(u,Tt,Lr,!1)),P(u,v),((et&2)===0||u!==Rt)&&(u===Rt&&((et&2)===0&&(Ja|=v),It===4&&Ya(u,Tt,Lr,!1)),pn(u))}function ju(u,d,v){if((et&6)!==0)throw Error(r(327));var w=!v&&(d&60)===0&&(d&u.expiredLanes)===0||D(u,d),k=w?ws(u,d):Ss(u,d,!0),j=w;do{if(k===0){ca&&!w&&Ya(u,d,0,!1);break}else if(k===6)Ya(u,d,0,!dn);else{if(v=u.current.alternate,j&&!Lg(v)){k=Ss(u,d,!1),j=!1;continue}if(k===2){if(j=d,u.errorRecoveryDisabledLanes&j)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=xr&&re.current.memoizedState.isDehydrated;if(pe&&(Va(re,te).flags|=256),te=Ss(re,te,!1),te!==2){if(hl&&!pe){re.errorRecoveryDisabledLanes|=j,Ja|=j,k=4;break e}j=da,da=k,j!==null&&Zs(j)}k=te}if(j=!1,k!==2)continue}}if(k===1){Va(u,0),Ya(u,d,0,!0);break}e:{switch(w=u,k){case 0:case 1:throw Error(r(345));case 4:if((d&4194176)===d){Ya(w,d,Lr,!dn);break e}break;case 2:da=null;break;case 3:case 5:break;default:throw Error(r(329))}if(w.finishedWork=v,w.finishedLanes=d,(d&62914560)===d&&(j=zs+300-Yi(),10<j)){if(Ya(w,d,Lr,!dn),L(w,0)!==0)break e;w.timeoutHandle=fp(tf.bind(null,w,v,da,es,Zc,d,Lr,Ja,pl,dn,2,-0,0),j);break e}tf(w,v,da,es,Zc,d,Lr,Ja,pl,dn,0,-0,0)}}break}while(!0);pn(u)}function Zs(u){da===null?da=u:da.push.apply(da,u)}function tf(u,d,v,w,k,j,te,re,pe,Ce,De,Fe,Ge){var mt=d.subtreeFlags;if((mt&8192||(mt&16785408)===16785408)&&(ea(),Lo(d),d=df(),d!==null)){u.cancelPendingCommit=d(wn.bind(null,u,v,w,k,te,re,pe,1,Fe,Ge)),Ya(u,j,te,!Ce);return}wn(u,v,w,k,te,re,pe,De,Fe,Ge)}function Lg(u){for(var d=u;;){var v=d.tag;if((v===0||v===11||v===15)&&d.flags&16384&&(v=d.updateQueue,v!==null&&(v=v.stores,v!==null)))for(var w=0;w<v.length;w++){var k=v[w],j=k.getSnapshot;k=k.value;try{if(!na(j(),k))return!1}catch{return!1}}if(v=d.child,d.subtreeFlags&16384&&v!==null)v.return=d,d=v;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 Ya(u,d,v,w){d&=~sr,d&=~Ja,u.suspendedLanes|=d,u.pingedLanes&=~d,w&&(u.warmLanes|=d),w=u.expirationTimes;for(var k=d;0<k;){var j=31-Nr(k),te=1<<j;w[j]=-1,k&=~te}v!==0&&ne(u,v,d)}function Zh(){return(et&6)===0?(ui(0),!1):!0}function Mr(){if(xt!==null){if(bn===0)var u=xt.return;else u=xt,Wn=fo=null,Vs(u),Ns=null,Ma=0,u=xt;for(;u!==null;)Xh(u.alternate,u),u=u.return;xt=null}}function Va(u,d){u.finishedWork=null,u.finishedLanes=0;var v=u.timeoutHandle;v!==Go&&(u.timeoutHandle=Go,Gu(v)),v=u.cancelPendingCommit,v!==null&&(u.cancelPendingCommit=null,v()),Mr(),Rt=u,xt=v=tr(u.current,null),Tt=d,bn=0,si=null,dn=!1,ca=D(u,d),hl=!1,pl=Lr=sr=Ja=ua=It=0,da=Qc=null,Zc=!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-Nr(w),j=1<<k;d|=u[k],w&=~j}return Za=d,Qe(),v}function Bo(u,d){St=null,at.H=Yt,d===gn?(d=Te(),bn=3):d===Pp?(d=Te(),bn=4):bn=d===my?8:d!==null&&typeof d=="object"&&typeof d.then=="function"?6:1,si=d,xt===null&&(It=1,Hd(u,Q(d,u.current)))}function Lu(){var u=oa.current;return u===null?!0:(Tt&4194176)===Tt?Ra===null:(Tt&62914560)===Tt||(Tt&536870912)!==0?u===Ra:!1}function jc(){var u=at.H;return at.H=Yt,u===null?Yt:u}function Zr(){var u=at.A;return at.A=Nf,u}function Rr(){It=4,dn||(Tt&4194176)!==Tt&&oa.current!==null||(ca=!0),(ua&134217727)===0&&(Ja&134217727)===0||Rt===null||Ya(Rt,Tt,Lr,!1)}function Ss(u,d,v){var w=et;et|=2;var k=jc(),j=Zr();(Rt!==u||Tt!==d)&&(es=null,Va(u,d)),d=!1;var te=It;e:do try{if(bn!==0&&xt!==null){var re=xt,pe=si;switch(bn){case 8:Mr(),te=6;break e;case 3:case 2:case 6:oa.current===null&&(d=!0);var Ce=bn;if(bn=0,si=null,Ql(u,re,pe,Ce),v&&ca){te=0;break e}break;default:Ce=bn,bn=0,si=null,Ql(u,re,pe,Ce)}}Es(),te=It;break}catch(De){Bo(u,De)}while(!0);return d&&u.shellSuspendCounter++,Wn=fo=null,et=w,at.H=k,at.A=j,xt===null&&(Rt=null,Tt=0,Qe()),te}function Es(){for(;xt!==null;)Jh(xt)}function ws(u,d){var v=et;et|=2;var w=jc(),k=Zr();Rt!==u||Tt!==d?(es=null,qn=Yi()+500,Va(u,d)):ca=D(u,d);e:do try{if(bn!==0&&xt!==null){d=xt;var j=si;t:switch(bn){case 1:bn=0,si=null,Ql(u,d,j,1);break;case 2:if(ps(j)){bn=0,si=null,nf(d);break}d=function(){bn===2&&Rt===u&&(bn=7),pn(u)},j.then(d,d);break e;case 3:bn=7;break e;case 4:bn=5;break e;case 7:ps(j)?(bn=0,si=null,nf(d)):(bn=0,si=null,Ql(u,d,j,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?Lp(te):sl(pe,Ce)){bn=0,si=null;var De=re.sibling;if(De!==null)xt=De;else{var Fe=re.return;Fe!==null?(xt=Fe,Bu(Fe)):xt=null}break t}}bn=0,si=null,Ql(u,d,j,5);break;case 6:bn=0,si=null,Ql(u,d,j,6);break;case 8:Mr(),It=6;break e;default:throw Error(r(462))}}Js();break}catch(Ge){Bo(u,Ge)}while(!0);return Wn=fo=null,at.H=w,at.A=k,et=v,xt!==null?0:(Rt=null,Tt=0,Qe(),It)}function Js(){for(;xt!==null&&!uy();)Jh(xt)}function Jh(u){var d=Mg(u.alternate,u,Za);u.memoizedProps=u.pendingProps,d===null?Bu(u):xt=d}function nf(u){var d=u,v=d.alternate;switch(d.tag){case 15:case 0:d=Eg(v,d,d.pendingProps,d.type,void 0,Tt);break;case 11:d=Eg(v,d,d.pendingProps,d.type.render,d.ref,Tt);break;case 5:Vs(d);default:Xh(v,d),d=xt=nl(d,Za),d=Mg(v,d,Za)}u.memoizedProps=u.pendingProps,d===null?Bu(u):xt=d}function Ql(u,d,v,w){Wn=fo=null,Vs(d),Ns=null,Ma=0;var k=d.return;try{if(xg(u,k,d,v,Tt)){It=1,Hd(u,Q(v,u.current)),xt=null;return}}catch(j){if(k!==null)throw xt=k,j;It=1,Hd(u,Q(v,u.current)),xt=null;return}d.flags&32768?(Gt||w===1?u=!0:ca||(Tt&536870912)!==0?u=!1:(dn=u=!0,(w===2||w===3||w===6)&&(w=oa.current,w!==null&&w.tag===13&&(w.flags|=16384))),Di(d,u)):Bu(d)}function Bu(u){var d=u;do{if((d.flags&32768)!==0){Di(d,dn);return}u=d.return;var v=kg(d.alternate,d,Za);if(v!==null){xt=v;return}if(d=d.sibling,d!==null){xt=d;return}xt=d=u}while(d!==null);It===0&&(It=5)}function Di(u,d){do{var v=Ng(u.alternate,u);if(v!==null){v.flags&=32767,xt=v;return}if(v=u.return,v!==null&&(v.flags|=32768,v.subtreeFlags=0,v.deletions=null),!d&&(u=u.sibling,u!==null)){xt=u;return}xt=u=v}while(u!==null);It=6,xt=null}function wn(u,d,v,w,k,j,te,re,pe,Ce){var De=at.T,Fe=Ti();try{nr(2),at.T=null,zt(u,d,v,w,Fe,k,j,te,re,pe,Ce)}finally{at.T=De,nr(Fe)}}function zt(u,d,v,w,k,j,te,re){do zi();while(ml!==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|=Vc,G(u,w,Ce,j,te,re),u===Rt&&(xt=Rt=null,Tt=0),(pe.subtreeFlags&10256)===0&&(pe.flags&10256)===0||Na||(Na=!0,zf=Ce,Jo=v,Iu(Ef,function(){return zi(),null})),v=(pe.flags&15990)!==0,(pe.subtreeFlags&15990)!==0||v?(v=at.T,at.T=null,j=Ti(),nr(2),te=et,et|=4,Rc(u,pe),Yl(pe,u),up(u.containerInfo),u.current=pe,Wd(u,pe.alternate,pe),dy(),et=te,nr(j),at.T=v):u.current=pe,Na?(Na=!1,ml=u,Zo=w):el(u,Ce),Ce=u.pendingLanes,Ce===0&&(fa=null),O(pe.stateNode),pn(u),d!==null)for(k=u.onRecoverableError,pe=0;pe<d.length;pe++)Ce=d[pe],k(Ce.value,{componentStack:Ce.stack});return(Zo&3)!==0&&zi(),Ce=u.pendingLanes,(w&4194218)!==0&&(Ce&42)!==0?u===_r?ec++:(ec=0,_r=u):ec=0,ui(0),null}function el(u,d){(u.pooledCacheLanes&=d)===0&&(d=u.pooledCache,d!=null&&(u.pooledCache=null,Ec(d)))}function zi(){if(ml!==null){var u=ml,d=zf;zf=0;var v=W(Zo),w=32>v?32:v;v=at.T;var k=Ti();try{if(nr(w),at.T=null,ml===null)var j=!1;else{w=Jo,Jo=null;var te=ml,re=Zo;if(ml=null,Zo=0,(et&6)!==0)throw Error(r(331));var pe=et;if(et|=4,zu(te.current),Zd(te,te.current,re,w),et=pe,ui(0,!1),Or&&typeof Or.onPostCommitFiberRoot=="function")try{Or.onPostCommitFiberRoot(Gc,te)}catch{}j=!0}return j}finally{nr(k),at.T=v,el(u,d)}}return!1}function rf(u,d,v){d=Q(v,d),d=Cu(u.stateNode,d,2),u=Jt(u,d,2),u!==null&&(P(u,2),pn(u))}function Ot(u,d,v){if(u.tag===3)rf(u,u,v);else for(;d!==null;){if(d.tag===3){rf(d,u,v);break}else if(d.tag===1){var w=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(fa===null||!fa.has(w))){u=Q(v,u),v=Sc(2),w=Jt(d,v,2),w!==null&&(Au(v,w,d,u),P(w,2),pn(w));break}}d=d.return}}function af(u,d,v){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(v)||(hl=!0,k.add(v),u=Bg.bind(null,u,d,v),d.then(u,u))}function Bg(u,d,v){var w=u.pingCache;w!==null&&w.delete(d),u.pingedLanes|=u.suspendedLanes&v,u.warmLanes&=~v,Rt===u&&(Tt&v)===v&&(It===4||It===3&&(Tt&62914560)===Tt&&300>Yi()-zs?(et&2)===0&&Va(u,0):sr|=v,pl===Tt&&(pl=0)),pn(u)}function Io(u,d){d===0&&(d=K()),u=wt(u,d),u!==null&&(P(u,d),pn(u))}function Uo(u){var d=u.memoizedState,v=0;d!==null&&(v=d.retryLane),Io(u,v)}function ep(u,d){var v=0;switch(u.tag){case 13:var w=u.stateNode,k=u.memoizedState;k!==null&&(v=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),Io(u,v)}function Iu(u,d){return qc(u,d)}function tp(u,d,v,w){this.tag=u,this.key=v,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 tl(u){return u=u.prototype,!(!u||!u.isReactComponent)}function tr(u,d){var v=u.alternate;return v===null?(v=n(u.tag,d,u.key,u.mode),v.elementType=u.elementType,v.type=u.type,v.stateNode=u.stateNode,v.alternate=u,u.alternate=v):(v.pendingProps=d,v.type=u.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=u.flags&31457280,v.childLanes=u.childLanes,v.lanes=u.lanes,v.child=u.child,v.memoizedProps=u.memoizedProps,v.memoizedState=u.memoizedState,v.updateQueue=u.updateQueue,d=u.dependencies,v.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},v.sibling=u.sibling,v.index=u.index,v.ref=u.ref,v.refCleanup=u.refCleanup,v}function nl(u,d){u.flags&=31457282;var v=u.alternate;return v===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=v.childLanes,u.lanes=v.lanes,u.child=v.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=v.memoizedProps,u.memoizedState=v.memoizedState,u.updateQueue=v.updateQueue,u.type=v.type,d=v.dependencies,u.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),u}function wa(u,d,v,w,k,j){var te=0;if(w=u,typeof u=="function")tl(u)&&(te=1);else if(typeof u=="string")te=ta&&Gi?Rp(u,v,Li.current)?26:Pc(u)?27:5:ta?Rp(u,v,Li.current)?26:5:Gi&&Pc(u)?27:5;else e:switch(u){case Bc:return il(v.children,k,j,d);case sp:te=8,k|=24;break;case lp:return u=n(12,v,d,k|2),u.elementType=lp,u.lanes=j,u;case lf:return u=n(13,v,d,k),u.elementType=lf,u.lanes=j,u;case eo:return u=n(19,v,d,k),u.elementType=eo,u.lanes=j,u;case Pu:return sf(v,k,j,d);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case Hg:case Ts:te=10;break e;case Jl:te=9;break e;case Ic:te=11;break e;case Hu:te=14;break e;case Ka:te=16,w=null;break e}te=29,v=Error(r(130,u===null?"null":typeof u,"")),w=null}return d=n(te,v,d,k),d.elementType=u,d.type=w,d.lanes=j,d}function il(u,d,v,w){return u=n(7,u,w,d),u.lanes=v,u}function sf(u,d,v,w){u=n(22,u,w,d),u.elementType=Pu,u.lanes=v;var k={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var j=k._current;if(j===null)throw Error(r(456));if((k._pendingVisibility&2)===0){var te=wt(j,2);te!==null&&(k._pendingVisibility|=2,er(te,j,2))}},attach:function(){var j=k._current;if(j===null)throw Error(r(456));if((k._pendingVisibility&2)!==0){var te=wt(j,2);te!==null&&(k._pendingVisibility&=-3,er(te,j,2))}}};return u.stateNode=k,u}function Zl(u,d,v){return u=n(6,u,null,d),u.lanes=v,u}function Lc(u,d,v){return d=n(4,u.children!==null?u.children:[],u.key,d),d.lanes=v,d.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},d}function Ho(u,d,v,w,k,j,te,re){this.tag=1,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Go,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=V(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=V(0),this.hiddenUpdates=V(null),this.identifierPrefix=w,this.onUncaughtError=k,this.onCaughtError=j,this.onRecoverableError=te,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=re,this.incompleteTransitions=new Map}function ji(u,d,v,w,k,j,te,re,pe,Ce,De,Fe){return u=new Ho(u,d,v,te,re,pe,Ce,Fe),d=1,j===!0&&(d|=24),j=n(3,null,null,d),u.current=j,j.stateNode=u,d=Gd(),d.refCount++,u.pooledCache=d,d.refCount++,j.memoizedState={element:w,isDehydrated:v,cache:d},nn(j),u}function Uu(u){return u?(u=Vo,u):Vo}function np(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=_(d),u=u!==null?S(u):null,u===null?null:Uc(u.stateNode)}function Ig(u,d,v,w,k,j){k=Uu(k),w.context===null?w.context=k:w.pendingContext=k,w=Zt(d),w.payload={element:v},j=j===void 0?null:j,j!==null&&(w.callback=j),v=Jt(u,w,d),v!==null&&(er(v,u,d),Gn(v,u,d))}function Ug(u,d){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var v=u.retryLane;u.retryLane=v!==0&&v<d?v:d}}function ip(u,d){Ug(u,d),(u=u.alternate)&&Ug(u,d)}var Je={},rp=Ah(),Fi=CL(),Po=Object.assign,ap=Symbol.for("react.element"),rl=Symbol.for("react.transitional.element"),Xa=Symbol.for("react.portal"),Bc=Symbol.for("react.fragment"),sp=Symbol.for("react.strict_mode"),lp=Symbol.for("react.profiler"),Hg=Symbol.for("react.provider"),Jl=Symbol.for("react.consumer"),Ts=Symbol.for("react.context"),Ic=Symbol.for("react.forward_ref"),lf=Symbol.for("react.suspense"),eo=Symbol.for("react.suspense_list"),Hu=Symbol.for("react.memo"),Ka=Symbol.for("react.lazy"),Pu=Symbol.for("react.offscreen"),Pg=Symbol.for("react.memo_cache_sentinel"),op=Symbol.iterator,Fo=Symbol.for("react.client.reference"),at=rp.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,of,cp,to=!1,no=Array.isArray,cf=t.rendererVersion,Fu=t.rendererPackageName,qu=t.extraDevToolsConfig,Uc=t.getPublicInstance,qo=t.getRootHostContext,Fg=t.getChildHostContext,io=t.prepareForCommit,up=t.resetAfterCommit,dp=t.createInstance,Cs=t.appendInitialChild,al=t.finalizeInitialChildren,ro=t.shouldSetTextContent,uf=t.createTextInstance,fp=t.scheduleTimeout,Gu=t.cancelTimeout,Go=t.noTimeout,As=t.isPrimaryRenderer;t.warnsIfNotActing;var qi=t.supportsMutation,Jr=t.supportsPersistence,xr=t.supportsHydration,hp=t.getInstanceFromNode;t.beforeActiveInstanceBlur,t.afterActiveInstanceBlur;var pp=t.preparePortalMount;t.prepareScopeUpdate,t.getInstanceFromScope;var nr=t.setCurrentUpdatePriority,Ti=t.getCurrentUpdatePriority,Ta=t.resolveUpdatePriority;t.resolveEventType,t.resolveEventTimeStamp;var ao=t.shouldAttemptEagerTransition,mp=t.detachDeletedInstance;t.requestPostPaintCallback;var qg=t.maySuspendCommit,sl=t.preloadInstance,ea=t.startSuspendingCommit,Yn=t.suspendInstance,df=t.waitForCommitToBeReady,kr=t.NotPendingTransition,dt=t.HostTransitionContext,xn=t.resetFormInstance;t.bindToConsole;var pi=t.supportsMicrotasks,ff=t.scheduleMicrotask,Ms=t.supportsTestSelectors,Yo=t.findFiberRoot,hf=t.getBoundingRect,Yu=t.getTextContent,Rs=t.isHiddenSubtree,zx=t.matchAccessibilityRole,Vn=t.setFocusIfFocusable,gp=t.setupIntersectionObserver,yp=t.appendChild,Gg=t.appendChildToContainer,Yg=t.commitTextUpdate,jx=t.commitMount,xp=t.commitUpdate,bp=t.insertBefore,vp=t.insertInContainerBefore,br=t.removeChild,ni=t.removeChildFromContainer,Vu=t.resetTextContent,Xu=t.hideInstance,pf=t.hideTextInstance,_p=t.unhideInstance,ll=t.unhideTextInstance,mf=t.clearContainer,Sp=t.cloneInstance,gf=t.createContainerChildSet,Ep=t.appendChildToContainerChildSet,Vg=t.finalizeContainerChildren,wp=t.replaceContainerChildren,Tp=t.cloneHiddenInstance,Cp=t.cloneHiddenTextInstance,yf=t.isSuspenseInstancePending,Ku=t.isSuspenseInstanceFallback,Xg=t.getSuspenseInstanceFallbackErrorDetails,Lx=t.registerSuspenseInstanceRetry,Kg=t.canHydrateFormStateMarker,Wg=t.isFormStateMarkerMatching,Ap=t.getNextHydratableSibling,xf=t.getFirstHydratableChild,$g=t.getFirstHydratableChildWithinContainer,Qg=t.getFirstHydratableChildWithinSuspenseInstance,Zg=t.canHydrateInstance,Jg=t.canHydrateTextInstance,ey=t.canHydrateSuspenseInstance,Bx=t.hydrateInstance,ty=t.hydrateTextInstance,Hc=t.hydrateSuspenseInstance,ny=t.getNextHydratableInstanceAfterSuspenseInstance,bf=t.commitHydratedContainer,vf=t.commitHydratedSuspenseInstance,iy=t.clearSuspenseBoundary,Mp=t.clearSuspenseBoundaryFromContainer,ry=t.shouldDeleteUnhydratedTailInstances;t.diffHydratedPropsForDevWarnings,t.diffHydratedTextForDevWarnings,t.describeHydratableInstanceForDevWarnings;var ay=t.validateHydratableInstance,sy=t.validateHydratableTextInstance,ta=t.supportsResources,Rp=t.isHostHoistableType,_f=t.getHoistableRoot,Sf=t.getResource,kp=t.acquireResource,Np=t.releaseResource,Op=t.hydrateHoistable,Dp=t.mountHoistable,zp=t.unmountHoistable,Ix=t.createHoistableInstance,jp=t.prepareToCommitHoistables,ly=t.mayResourceSuspendCommit,Lp=t.preloadResource,Bp=t.suspendResource,Gi=t.supportsSingletons,Ip=t.resolveSingletonInstance,Ux=t.clearSingleton,Hx=t.acquireSingletonInstance,oy=t.releaseSingletonInstance,Pc=t.isHostSingletonType,Wu=[],ol=-1,Vo={},Nr=Math.clz32?Math.clz32:R,$u=Math.log,cy=Math.LN2,Fc=128,Qu=4194304,qc=Fi.unstable_scheduleCallback,Zu=Fi.unstable_cancelCallback,uy=Fi.unstable_shouldYield,dy=Fi.unstable_requestPaint,Yi=Fi.unstable_now,Up=Fi.unstable_ImmediatePriority,fy=Fi.unstable_UserBlockingPriority,Ef=Fi.unstable_NormalPriority,wf=Fi.unstable_IdlePriority,hy=Fi.log,Hp=Fi.unstable_setDisableYieldValue,Gc=null,Or=null,na=typeof Object.is=="function"?Object.is:$,Tf=new WeakMap,zn=[],Xn=0,Ju=null,ed=0,ia=[],ra=0,Wa=null,ks=1,Ca="",Li=T(null),td=T(null),$a=T(null),Yc=T(null),ir=null,Vi=null,Gt=!1,aa=null,Aa=!1,nd=Error(r(519)),sa=[],so=0,Vc=0,Xc=null,Xo=null,id=!1,rd=!1,Qa=!1,lo=0,ad=null,Cf=0,Dr=0,oo=null,cl=!1,Kc=!1,sd=Object.prototype.hasOwnProperty,gn=Error(r(460)),Pp=Error(r(474)),Af={then:function(){}},Ko=null,Ns=null,Ma=0,co=Ye(!0),Fp=Ye(!1),Os=T(null),la=T(0),oa=T(null),Ra=null,mi=T(0),Ds=0,St=null,en=null,ii=null,ka=!1,jn=!1,ul=!1,ld=0,Kn=0,Wc=null,py=0,Mf=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},Yt={readContext:Pi,use:Xr,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};Yt.useCacheRefresh=bt,Yt.useMemoCache=bt,Yt.useHostTransitionStatus=bt,Yt.useFormState=bt,Yt.useActionState=bt,Yt.useOptimistic=bt;var gi={readContext:Pi,use:Xr,useCallback:function(u,d){return sn().memoizedState=[u,d===void 0?null:d],u},useContext:Pi,useEffect:on,useImperativeHandle:function(u,d,v){v=v!=null?v.concat([u]):null,Ro(4194308,4,Ks.bind(null,d,u),v)},useLayoutEffect:function(u,d){return Ro(4194308,4,u,d)},useInsertionEffect:function(u,d){Ro(4,2,u,d)},useMemo:function(u,d){var v=sn();d=d===void 0?null:d;var w=u();if(ul){Y(!0);try{u()}finally{Y(!1)}}return v.memoizedState=[w,d],w},useReducer:function(u,d,v){var w=sn();if(v!==void 0){var k=v(d);if(ul){Y(!0);try{v(d)}finally{Y(!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=Bl.bind(null,St,u),[w.memoizedState,u]},useRef:function(u){var d=sn();return u={current:u},d.memoizedState=u},useState:function(u){u=Ni(u);var d=u.queue,v=Id.bind(null,St,d);return d.dispatch=v,[u.memoizedState,v]},useDebugValue:Ve,useDeferredValue:function(u,d){var v=sn();return Nn(v,u,d)},useTransition:function(){var u=Ni(!1);return u=_c.bind(null,St,u.queue,!0,!1),sn().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,d,v){var w=St,k=sn();if(Gt){if(v===void 0)throw Error(r(407));v=v()}else{if(v=d(),Rt===null)throw Error(r(349));(Tt&60)!==0||vt(w,d,v)}k.memoizedState=v;var j={value:v,getSnapshot:d};return k.queue=j,on(Un.bind(null,w,j,u),[u]),w.flags|=2048,qa(9,Kt.bind(null,w,j,v,d),{destroy:void 0},null),v},useId:function(){var u=sn(),d=Rt.identifierPrefix;if(Gt){var v=Ca,w=ks;v=(w&~(1<<32-Nr(w)-1)).toString(32)+v,d=":"+d+"R"+v,v=ld++,0<v&&(d+="H"+v.toString(32)),d+=":"}else v=py++,d=":"+d+"r"+v.toString(32)+":";return u.memoizedState=d},useCacheRefresh:function(){return sn().memoizedState=Eu.bind(null,St)}};gi.useMemoCache=In,gi.useHostTransitionStatus=ko,gi.useFormState=ms,gi.useActionState=ms,gi.useOptimistic=function(u){var d=sn();d.memoizedState=d.baseState=u;var v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return d.queue=v,d=Ud.bind(null,St,!0,v),v.dispatch=d,[u,d]};var rr={readContext:Pi,use:Xr,useCallback:yt,useContext:Pi,useEffect:ys,useImperativeHandle:je,useInsertionEffect:xs,useLayoutEffect:vc,useMemo:Nt,useReducer:Sa,useRef:rt,useState:function(){return Sa(Cr)},useDebugValue:Ve,useDeferredValue:function(u,d){var v=ln();return Wr(v,en.memoizedState,u,d)},useTransition:function(){var u=Sa(Cr)[0],d=ln().memoizedState;return[typeof u=="boolean"?u:hr(u),d]},useSyncExternalStore:Ke,useId:bs};rr.useCacheRefresh=Bd,rr.useMemoCache=In,rr.useHostTransitionStatus=ko,rr.useFormState=gs,rr.useActionState=gs,rr.useOptimistic=function(u,d){var v=ln();return mn(v,en,u,d)};var uo={readContext:Pi,use:Xr,useCallback:yt,useContext:Pi,useEffect:ys,useImperativeHandle:je,useInsertionEffect:xs,useLayoutEffect:vc,useMemo:Nt,useReducer:Ne,useRef:rt,useState:function(){return Ne(Cr)},useDebugValue:Ve,useDeferredValue:function(u,d){var v=ln();return en===null?Nn(v,u,d):Wr(v,en.memoizedState,u,d)},useTransition:function(){var u=Ne(Cr)[0],d=ln().memoizedState;return[typeof u=="boolean"?u:hr(u),d]},useSyncExternalStore:Ke,useId:bs};uo.useCacheRefresh=Bd,uo.useMemoCache=In,uo.useHostTransitionStatus=ko,uo.useFormState=_u,uo.useActionState=_u,uo.useOptimistic=function(u,d){var v=ln();return en!==null?mn(v,en,u,d):(v.baseState=u,[u,v.queue.dispatch])};var Rf={isMounted:function(u){return(u=u._reactInternals)?g(u)===u:!1},enqueueSetState:function(u,d,v){u=u._reactInternals;var w=yr(),k=Zt(w);k.payload=d,v!=null&&(k.callback=v),d=Jt(u,k,w),d!==null&&(er(d,u,w),Gn(d,u,w))},enqueueReplaceState:function(u,d,v){u=u._reactInternals;var w=yr(),k=Zt(w);k.tag=1,k.payload=d,v!=null&&(k.callback=v),d=Jt(u,k,w),d!==null&&(er(d,u,w),Gn(d,u,w))},enqueueForceUpdate:function(u,d){u=u._reactInternals;var v=yr(),w=Zt(v);w.tag=2,d!=null&&(w.callback=d),d=Jt(u,w,v),d!==null&&(er(d,u,v),Gn(d,u,v))}},qp=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)},my=Error(r(461)),ri=!1,ar={dehydrated:null,treeContext:null,retryLane:0},zr=T(null),fo=null,Wn=null,gy=typeof AbortController<"u"?AbortController:function(){var u=[],d=this.signal={aborted:!1,addEventListener:function(v,w){u.push(w)}};this.abort=function(){d.aborted=!0,u.forEach(function(v){return v()})}},dl=Fi.unstable_scheduleCallback,Wo=Fi.unstable_NormalPriority,cn={$$typeof:Ts,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},kf=at.S;at.S=function(u,d){typeof d=="object"&&d!==null&&typeof d.then=="function"&&ce(u,d),kf!==null&&kf(u,d)};var fl=T(null),Ci=!1,Fn=!1,ho=!1,$c=typeof WeakSet=="function"?WeakSet:Set,$n=null,$o=!1,ai=null,jr=!1,vr=null,Qo=8192,Nf={getCacheForType:function(u){var d=Pi(cn),v=d.data.get(u);return v===void 0&&(v=u(),d.data.set(u,v)),v}},od=0,Of=1,Df=2,Bt=3,un=4;if(typeof Symbol=="function"&&Symbol.for){var Et=Symbol.for;od=Et("selector.component"),Of=Et("selector.has_pseudo_class"),Df=Et("selector.role"),Bt=Et("selector.test_id"),un=Et("selector.text")}var Dt=typeof WeakMap=="function"?WeakMap:Map,et=0,Rt=null,xt=null,Tt=0,bn=0,si=null,dn=!1,ca=!1,hl=!1,Za=0,It=0,ua=0,Ja=0,sr=0,Lr=0,pl=0,Qc=null,da=null,Zc=!1,zs=0,qn=1/0,es=null,fa=null,Na=!1,ml=null,Zo=0,zf=0,Jo=null,ec=0,_r=null;return Je.attemptContinuousHydration=function(u){if(u.tag===13){var d=wt(u,67108864);d!==null&&er(d,u,67108864),ip(u,67108864)}},Je.attemptHydrationAtCurrentPriority=function(u){if(u.tag===13){var d=yr(),v=wt(u,d);v!==null&&er(v,u,d),ip(u,d)}},Je.attemptSynchronousHydration=function(u){switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var d=z(u.pendingLanes);if(d!==0){for(u.pendingLanes|=2,u.entangledLanes|=2;d;){var v=1<<31-Nr(d);u.entanglements[1]|=v,d&=~v}pn(u),(et&6)===0&&(qn=Yi()+500,ui(0))}}break;case 13:d=wt(u,2),d!==null&&er(d,u,2),Zh(),ip(u,2)}},Je.batchedUpdates=function(u,d){return u(d)},Je.createComponentSelector=function(u){return{$$typeof:od,value:u}},Je.createContainer=function(u,d,v,w,k,j,te,re,pe,Ce){return ji(u,d,!1,null,v,w,j,te,re,pe,Ce,null)},Je.createHasPseudoClassSelector=function(u){return{$$typeof:Of,value:u}},Je.createHydrationContainer=function(u,d,v,w,k,j,te,re,pe,Ce,De,Fe,Ge){return u=ji(v,w,!0,u,k,j,re,pe,Ce,De,Fe,Ge),u.context=Uu(null),v=u.current,w=yr(),k=Zt(w),k.callback=d??null,Jt(v,k,w),u.current.lanes=w,P(u,w),pn(u),u},Je.createPortal=function(u,d,v){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Xa,key:w==null?null:""+w,children:u,containerInfo:d,implementation:v}},Je.createRoleSelector=function(u){return{$$typeof:Df,value:u}},Je.createTestNameSelector=function(u){return{$$typeof:Bt,value:u}},Je.createTextSelector=function(u){return{$$typeof:un,value:u}},Je.defaultOnCaughtError=function(u){console.error(u)},Je.defaultOnRecoverableError=function(u){qp(u)},Je.defaultOnUncaughtError=function(u){qp(u)},Je.deferredUpdates=function(u){var d=at.T,v=Ti();try{return nr(32),at.T=null,u()}finally{nr(v),at.T=d}},Je.discreteUpdates=function(u,d,v,w,k){var j=at.T,te=Ti();try{return nr(2),at.T=null,u(d,v,w,k)}finally{nr(te),at.T=j,et===0&&(qn=Yi()+500)}},Je.findAllNodes=gr,Je.findBoundingRects=function(u,d){if(!Ms)throw Error(r(363));d=gr(u,d),u=[];for(var v=0;v<d.length;v++)u.push(hf(d[v]));for(d=u.length-1;0<d;d--){v=u[d];for(var w=v.x,k=w+v.width,j=v.y,te=j+v.height,re=d-1;0<=re;re--)if(d!==re){var pe=u[re],Ce=pe.x,De=Ce+pe.width,Fe=pe.y,Ge=Fe+pe.height;if(w>=Ce&&j>=Fe&&k<=De&&te<=Ge){u.splice(d,1);break}else if(w!==Ce||v.width!==pe.width||Ge<j||Fe>te){if(!(j!==Fe||v.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>j&&(pe.height+=Fe-j,pe.y=j),Ge<te&&(pe.height=te-Fe),u.splice(d,1);break}}}return u},Je.findHostInstance=np,Je.findHostInstanceWithNoPortals=function(u){return u=_(u),u=u!==null?A(u):null,u===null?null:Uc(u.stateNode)},Je.findHostInstanceWithWarning=function(u){return np(u)},Je.flushPassiveEffects=zi,Je.flushSyncFromReconciler=function(u){var d=et;et|=1;var v=at.T,w=Ti();try{if(nr(2),at.T=null,u)return u()}finally{nr(w),at.T=v,et=d,(et&6)===0&&ui(0)}},Je.flushSyncWork=Zh,Je.focusWithin=function(u,d){if(!Ms)throw Error(r(363));for(u=ef(u),d=jg(u,d),d=Array.from(d),u=0;u<d.length;){var v=d[u++],w=v.tag;if(!Rs(v)){if((w===5||w===26||w===27)&&Vn(v.stateNode))return!0;for(v=v.child;v!==null;)d.push(v),v=v.sibling}}return!1},Je.getFindAllNodesFailureDescription=function(u,d){if(!Ms)throw Error(r(363));var v=0,w=[];u=[ef(u),0];for(var k=0;k<u.length;){var j=u[k++],te=j.tag,re=u[k++],pe=d[re];if((te!==5&&te!==26&&te!==27||!Rs(j))&&(zc(j,pe)&&(w.push($l(pe)),re++,re>v&&(v=re)),re<d.length))for(j=j.child;j!==null;)u.push(j,re),j=j.sibling}if(v<d.length){for(u=[];v<d.length;v++)u.push($l(d[v]));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 Uc(u.child.stateNode);default:return u.child.stateNode}},Je.injectIntoDevTools=function(){var u={bundleType:0,version:cf,rendererPackageName:Fu,currentDispatcherRef:at,findFiberByHostInstance:hp,reconcilerVersion:"19.0.0"};if(qu!==null&&(u.rendererConfig=qu),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(d.isDisabled||!d.supportsFiber)u=!0;else{try{Gc=d.inject(u),Or=d}catch{}u=!!d.checkDCE}}return u},Je.isAlreadyRendering=function(){return!1},Je.observeVisibleRects=function(u,d,v,w){if(!Ms)throw Error(r(363));u=gr(u,d);var k=gp(u,v,w).disconnect;return{disconnect:function(){k()}}},Je.shouldError=function(){return null},Je.shouldSuspend=function(){return!1},Je.startHostTransition=function(u,d,v,w){if(u.tag!==5)throw Error(r(476));var k=Su(u).queue;_c(u,k,d,kr,v===null?i:function(){var j=Su(u).next.queue;return Il(u,j,{},yr()),v(w)})},Je.updateContainer=function(u,d,v,w){var k=d.current,j=yr();return Ig(k,j,u,d,v,w),j},Je.updateContainerSync=function(u,d,v,w){return d.tag===0&&zi(),Ig(d.current,2,u,d,v,w),2},Je},e.exports.default=e.exports,Object.defineProperty(e.exports,"__esModule",{value:!0})})(tv)),tv.exports}var t2;function ML(){return t2||(t2=1,ev.exports=AL()),ev.exports}var RL=ML();const kL=xu(RL),NL=kL;function OL(e,t,n,i){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function DL(){}function zL(){return!1}const FM={};function jL(e){return e??FM}function LL(){return yu.currentUpdatePriority}function BL(){return null}function IL(e){throw new Error("Not yet implemented.")}function UL(e){return e}function HL(){return FM}function PL(e){e instanceof Tr?e.visible=!1:e instanceof zd&&(e.enabled=!1)}function FL(e){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function qM(e){if(e instanceof zd){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 GM(e,t,...n){}function n2(e,t,n){if(GM(),t instanceof Tr){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 zd){const s=t.__pixireact.filters.indexOf(n);qM(t),LM(e,t,s)}}function qL(){return!1}function GL(){return!0}function YL(){return null}function VL(){}function XL(){}function i2(e,t){t instanceof zd&&qM(t),t.destroy()}function KL(e){}function WL(){}function $L(){}function QL(){return-1.1}function ZL(){return null}function JL(){var n;if(yu.currentUpdatePriority)return yu.currentUpdatePriority;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return ah.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return ah.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return ah.ContinuousEventPriority;default:return ah.DefaultEventPriority}}function eB(e){yu.currentUpdatePriority=e}function tB(){return!1}function nB(){return!1}function iB(){}function rB(){}function aB(){}function sB(e){e instanceof Tr?e.visible=!0:e instanceof zd&&(e.enabled=!0)}function lB(e){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function oB(){return null}const cB={isPrimaryRenderer:!1,noTimeout:-1,NotPendingTransition:null,supportsHydration:!1,supportsMutation:!0,supportsPersistence:!1,warnsIfNotActing:!1,afterActiveInstanceBlur:sL,appendChild:Jb,appendChildToContainer:Jb,appendInitialChild:Jb,beforeActiveInstanceBlur:lL,cancelTimeout:clearTimeout,clearContainer:oL,commitUpdate:bL,createInstance:wL,createTextInstance:OL,hideTextInstance:FL,unhideTextInstance:lB,detachDeletedInstance:DL,finalizeInitialChildren:zL,getChildHostContext:jL,getCurrentUpdatePriority:LL,getInstanceFromNode:BL,getInstanceFromScope:IL,getPublicInstance:UL,getRootHostContext:HL,hideInstance:PL,insertBefore:n2,insertInContainerBefore:n2,maySuspendCommit:qL,preloadInstance:GL,prepareForCommit:YL,preparePortalMount:VL,prepareScopeUpdate:XL,removeChild:i2,removeChildFromContainer:i2,requestPostPaintCallback:KL,resetAfterCommit:WL,resetFormInstance:$L,resolveEventTimeStamp:QL,resolveEventType:ZL,resolveUpdatePriority:JL,scheduleTimeout:setTimeout,shouldAttemptEagerTransition:tB,setCurrentUpdatePriority:eB,shouldSetTextContent:nB,startSuspendingCommit:iB,suspendInstance:rB,trackSchedulerEvent:aB,unhideInstance:sB,waitForCommitToBeReady:oB,rendererPackageName:"@pixi/react",rendererVersion:aL.version},P0=NL(cB);P0.injectIntoDevTools();const xh=new Map;function uB(e,t={}){let n=xh.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 p_,r.rootContainer=jM(i.app.stage));const s=(n==null?void 0:n.fiber)??P0.createContainer(r.rootContainer,ah.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,b])=>{const _=g;zM(p,_)||(i.app[_]=b)}),P0.updateContainer(x.jsx(iL,{value:i,children:f}),s,null,()=>{}),i.app}},xh.set(l,n)}return n}function YM(e){yu.unmountQueue.delete(e);const t=e.fiber;t&&P0.updateContainer(null,t,null,()=>{e.applicationState.app&&e.applicationState.app.destroy(),xh.delete(e.internalState.canvas)})}function dB(){for(const e of yu.unmountQueue)YM(e)}function fB(e){const t=xh.get(e);t&&(t.applicationState.isInitialised?YM(t):yu.unmountQueue.add(t))}function hB(e){const t=xh.get(e);t&&yu.unmountQueue.delete(t)}var DC,zC;const Zy=typeof window<"u"&&((DC=window.document)!=null&&DC.createElement||((zC=window.navigator)==null?void 0:zC.product)==="ReactNative")?B.useLayoutEffect:B.useEffect,pB={...Md.defaultTextStyle},mB=B.forwardRef(function(t,n){const{children:i,className:r,defaultTextStyle:s,extensions:l,onInit:c,resizeTo:f,...p}=t,m=TD(),g=B.useRef(null),b=B.useRef(null),_=B.useRef(new Set);B.useImperativeHandle(n,()=>({getApplication(){return g.current},getCanvas(){return b.current}}));const S=B.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=B.useCallback(T=>{dB(),g.current=T,S(),c==null||c(T)},[c]);return Zy(()=>{if(l){const T=[...l],C=_.current;for(const N of C.values()){const R=T.indexOf(N);R===-1&&(ci.remove(N),C.delete(N)),T.splice(R,1)}for(const N of T)ci.add(N),C.add(N)}},[l]),Zy(()=>{const T=b.current;if(T){let C=xh.get(T);C||(C=uB(T,{onInit:A})),C.render(x.jsx(m,{children:i}),p)}},[p,i,A,f]),Zy(()=>{S()},[f]),Zy(()=>{s?Object.assign(Md.defaultTextStyle,s):Object.assign(Md.defaultTextStyle,pB)},[s]),B.useEffect(()=>{const T=b.current;if(T)return hB(T),()=>{fB(T)}},[]),x.jsx("canvas",{ref:b,className:r})}),gB=B.forwardRef(function(t,n){return x.jsx(lA,{children:x.jsx(mB,{ref:n,...t})})});function px(e){Object.assign(E1,e)}function yB(){const e=B.useContext(T_);return GM(e.app instanceof p_,"No Context found with `%s`. Make sure to wrap component with `%s`","Application","AppProvider"),e}function xB({agentName:e,question:t,onRespond:n}){const[i,r]=B.useState(""),s=()=>{const c=i.trim();c&&(n(c),r(""))},l=c=>{c.key==="Enter"&&s()};return x.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:x.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:[x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",marginBottom:"var(--sp-4)"},children:[x.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:"◆"}),x.jsxs("h2",{style:{fontFamily:"var(--font-mono)",fontSize:"0.78rem",fontWeight:700,color:"var(--status-warning)",textTransform:"uppercase",letterSpacing:"0.08em"},children:["Checkpoint — ",e]})]}),x.jsx("p",{style:{color:"var(--text-primary)",fontSize:"0.85rem",lineHeight:1.6,marginBottom:"var(--sp-5)"},children:t}),x.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[x.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}}),x.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 r2=[16109737,15251594,13935988,13012574,10515018,9133628],a2=[2890510,4861722,9136404,12886874,1710618,9118976],bB=E0,st=bB/2,ht=7,yn=14,yi=12,xi=5,Bs=10,vn=4,Is=9,At=8;function Gf(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 Yf(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:vB(s,.15)})}function s2(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 l2(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 vB(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 _B(e){const t=new Map;for(let n=0;n<Jv.length;n++){const i=Jv[n],r=r2[n%r2.length],s=a2[n%a2.length],l=new La;Gf(l,st,At,r,s),Yf(l,st,At+ht,yn,yi,i),l.roundRect(st-yn/2-vn,At+ht+1,vn,Is,2),l.fill(i),l.roundRect(st+yn/2,At+ht+1,vn,Is,2),l.fill(i),l.circle(st-yn/2-vn/2,At+ht+Is+1,2),l.fill(r),l.circle(st+yn/2+vn/2,At+ht+Is+1,2),l.fill(r),s2(l,st,At+ht+yi,xi,Bs),l2(l,st,At+ht+yi+Bs,xi),t.set(`agent-${n}-standing`,e.renderer.generateTexture(l));const c=new La,f=At+4;Gf(c,st,f,r,s),Yf(c,st,f+ht,yn,yi-2,i),c.roundRect(st-yn/2-vn+1,f+ht+2,vn,Is-3,2),c.fill(i),c.roundRect(st+yn/2-1,f+ht+2,vn,Is-3,2),c.fill(i);const p=6;c.roundRect(st-xi-1,f+ht+yi-2,xi+1,p,2),c.fill(2899536),c.roundRect(st,f+ht+yi-2,xi+1,p,2),c.fill(2899536),t.set(`agent-${n}-seated`,e.renderer.generateTexture(c));const m=new La,g=At+4;Gf(m,st+2,g,r,s),Yf(m,st+1,g+ht,yn,yi-2,i),m.roundRect(st+yn/2,g+ht+2,vn+4,4,2),m.fill(i),m.roundRect(st+yn/2-2,g+ht+2,vn+4,4,2),m.fill(i),m.circle(st+yn/2+vn+3,g+ht+4,2),m.fill(r),m.circle(st+yn/2+vn+1,g+ht+4,2),m.fill(r),c.roundRect(st-xi-1,g+ht+yi-2,xi+1,p,2),c.fill(2899536),m.roundRect(st,g+ht+yi-2,xi+1,p,2),m.fill(2899536),t.set(`agent-${n}-typing`,e.renderer.generateTexture(m));const b=new La;Gf(b,st,At,r,s),Yf(b,st,At+ht,yn,yi,i),b.roundRect(st-yn/2-vn,At+ht-1,vn,Is+2,2),b.fill(i),b.roundRect(st+yn/2,At+ht+3,vn,Is-2,2),b.fill(i),b.roundRect(st+1,At+ht+yi,xi,Bs+2,2),b.fill(2899536),b.roundRect(st-xi-1,At+ht+yi-2,xi,Bs,2),b.fill(2899536),b.roundRect(st,At+ht+yi+Bs+1,xi+2,3,1),b.fill(1710618),b.roundRect(st-xi-2,At+ht+yi+Bs-3,xi+1,3,1),b.fill(1710618),t.set(`agent-${n}-walk-right`,e.renderer.generateTexture(b));const _=new La;Gf(_,st,At,r,s),Yf(_,st,At+ht,yn,yi,i),_.roundRect(st+yn/2,At+ht-1,vn,Is+2,2),_.fill(i),_.roundRect(st-yn/2-vn,At+ht+3,vn,Is-2,2),_.fill(i),_.roundRect(st-xi-1,At+ht+yi,xi,Bs+2,2),_.fill(2899536),_.roundRect(st+1,At+ht+yi-2,xi,Bs,2),_.fill(2899536),_.roundRect(st-xi-2,At+ht+yi+Bs+1,xi+2,3,1),_.fill(1710618),_.roundRect(st,At+ht+yi+Bs-3,xi+1,3,1),_.fill(1710618),t.set(`agent-${n}-walk-left`,e.renderer.generateTexture(_));const S=new La;Gf(S,st,At,r,s),Yf(S,st,At+ht,yn,yi,i),S.roundRect(st-yn/2-vn,At+ht+1,vn,Is,2),S.fill(i),S.circle(st-yn/2-vn/2,At+ht+Is+1,2),S.fill(r),S.roundRect(st+yn/2,At+ht,vn,6,2),S.fill(i),S.circle(st+yn/2+vn/2+1,At+ht,2),S.fill(r),S.roundRect(st+yn/2+vn/2-1,At+ht-6,6,7,1),S.fill(14142664),S.moveTo(st+yn/2+vn/2,At+ht-7),S.quadraticCurveTo(st+yn/2+vn/2+2,At+ht-11,st+yn/2+vn/2,At+ht-14),S.stroke({width:1,color:16777215,alpha:.4}),S.moveTo(st+yn/2+vn/2+3,At+ht-7),S.quadraticCurveTo(st+yn/2+vn/2+5,At+ht-10,st+yn/2+vn/2+3,At+ht-13),S.stroke({width:1,color:16777215,alpha:.3}),s2(S,st,At+ht+yi,xi,Bs),l2(S,st,At+ht+yi+Bs,xi),t.set(`agent-${n}-coffee`,e.renderer.generateTexture(S))}return t}function SB(e,t){const n=e%Jv.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 EB(e,t){const n=nA;e.roundRect(0,0,t.totalWidth,t.totalHeight,4),e.fill(fh.wall),e.rect(0,0,t.totalWidth,3),e.fill({color:fh.wallHighlight,alpha:.5}),c2(e,t.corridorH.x,t.corridorH.y,t.corridorH.width,t.corridorH.height,"horizontal"),c2(e,t.corridorV.x,t.corridorV.y,t.corridorV.width,t.corridorV.height,"vertical");for(const b of t.squadOrigins){const{origin:_,width:S,height:A,doorSide:T}=b;T==="right"?dm(e,_.x+S,_.y+A/2-ic/2,n,ic):T==="left"?dm(e,_.x-n,_.y+A/2-ic/2,n,ic):T==="top"?um(e,_.x+S/2-ic/2,_.y-n,ic,n):um(e,_.x+S/2-ic/2,_.y+A,ic,n)}const i=t.ceoOffice,r=Math.min(ic,60);dm(e,i.x+i.width,i.y+i.height/2-r/2,n,r),um(e,i.x+i.width/2-r/2,i.y+i.height,r,n);const s=t.bathroomMale;um(e,s.x+s.width/2-30,s.y+s.height,60,n);const l=t.bathroomFemale;um(e,l.x+l.width/2-30,l.y+l.height,60,n);const c=t.kitchen;dm(e,c.x+c.width,c.y+c.height/2-30,n,60);const f=t.restArea;dm(e,f.x-n,f.y+f.height/2-30,n,60);const p=t.corridorV;if(p.height>100){const b=p.x+p.width/2;for(let _=p.y+60;_<p.y+p.height-40;_+=200)o2(e,b,_)}const m=t.corridorH,g=m.y+m.height/2;for(let b=m.x+80;b<m.x+m.width-80;b+=220)o2(e,b,g);e.roundRect(0,0,t.totalWidth,t.totalHeight,4),e.stroke({width:2,color:5533306,alpha:.6})}function um(e,t,n,i,r){e.rect(t,n,i,r),e.fill(fu.floor),e.rect(t-2,n,2,r),e.fill(fh.doorFrame),e.rect(t+i,n,2,r),e.fill(fh.doorFrame)}function dm(e,t,n,i,r){e.rect(t,n,i,r),e.fill(fu.floor),e.rect(t,n-2,i,2),e.fill(fh.doorFrame),e.rect(t,n+r,i,2),e.fill(fh.doorFrame)}function o2(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 c2(e,t,n,i,r,s){e.rect(t,n,i,r),e.fill(fu.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:fu.tile,alpha:.5})),e.moveTo(p,n),e.lineTo(p,n+r),e.stroke({width:.5,color:fu.grout,alpha:.3})}e.moveTo(t,n+c*l),e.lineTo(t+i,n+c*l),e.stroke({width:.5,color:fu.grout,alpha:.3})}s==="horizontal"?(e.rect(t+10,n+r/2-2,i-20,4),e.fill({color:fu.stripe,alpha:.3})):(e.rect(t+i/2-2,n+10,4,r-20),e.fill({color:fu.stripe,alpha:.3}))}function u2(e,t,n,i,r,s){e.rect(t,n,i,r),e.fill(ha.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:ha.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:ha.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:ha.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(ha.stall),e.rect(C+f-3,m,3,p),e.fill(ha.stall),e.roundRect(C+6,m,f-12,p-4,2),e.fill({color:ha.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(ha.toilet),e.roundRect(N-6,R+2,12,14,3),e.fill(ha.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))),b=i/(g+1),_=n+30;e.rect(t+4,n+4,i-8,60),e.fill({color:ha.wall,alpha:.3});for(let T=0;T<g;T++){const C=t+b*(T+1);e.roundRect(C-12,n+8,24,20,3),e.fill(ha.mirrorFrame),e.roundRect(C-10,n+10,20,16,2),e.fill(ha.mirror),e.roundRect(C-6,n+12,6,10,1),e.fill({color:16777215,alpha:.15}),e.roundRect(C-14,_,28,16,3),e.fill(ha.sink),e.ellipse(C,_+8,8,5),e.fill(ha.sinkBowl),e.ellipse(C,_+8,8,5),e.stroke({width:.5,color:12434877,alpha:.4}),e.roundRect(C-2,_+1,4,6,1),e.fill(ha.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 wB(e,t,n,i,r){e.rect(t,n,i,r),e.fill(lr.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:lr.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:lr.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:lr.tileGrout,alpha:.3});e.roundRect(t+6,n+10,24,r-20,3),e.fill(lr.counter),e.roundRect(t+7,n+11,22,r-22,2),e.fill(lr.counterTop),e.roundRect(t+6,n+10,24,40,3),e.fill(lr.fridge),e.roundRect(t+8,n+12,20,18,2),e.fill(lr.fridgeDoor),e.roundRect(t+8,n+32,20,16,2),e.fill(lr.fridgeDoor),e.roundRect(t+26,n+20,2,8,1),e.fill(lr.fridgeHandle),e.roundRect(t+26,n+36,2,8,1),e.fill(lr.fridgeHandle),e.roundRect(t+10,n+60,16,20,2),e.fill(lr.coffeeMaker),e.circle(t+18,n+64,2),e.fill({color:lr.coffeeMakerLight,alpha:.9});const l=t+i/2-16,c=n+r/2-12;e.roundRect(l,c,32,24,4),e.fill(lr.table),e.roundRect(l+2,c+2,28,20,3),e.fill(lr.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(lr.chair);e.circle(t+i/2,n+8,4),e.fill({color:lr.lamp,alpha:.6}),e.circle(t+i/2,n+8,8),e.fill({color:lr.lamp,alpha:.1}),e.rect(t,n,i,r),e.stroke({width:1,color:0,alpha:.08})}function TB(e,t,n,i,r){e.rect(t,n,i,r),e.fill(Da.floor),e.roundRect(t+8,n+8,i-16,r-16,6),e.fill({color:Da.carpet,alpha:.2}),e.roundRect(t+12,n+12,i-24,r-24,4),e.stroke({width:1,color:Da.carpetBorder,alpha:.15});const s=t+10,l=n+10,c=i-20,f=28;e.roundRect(s,l,c,10,3),e.fill(Da.sofaArm),e.roundRect(s,l+8,c,f-8,4),e.fill(Da.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(Da.sofaCushion);e.roundRect(s-2,l+6,6,f-4,2),e.fill(Da.sofaArm),e.roundRect(s+c-4,l+6,6,f-4,2),e.fill(Da.sofaArm);const m=t+i/2,g=n+r-20;e.roundRect(m-12,g+8,24,10,2),e.fill(Da.tvStand),e.roundRect(m-20,g-12,40,22,2),e.fill(Da.tv),e.roundRect(m-18,g-10,36,18,1),e.fill(Da.tvScreen),e.roundRect(m-14,g-8,10,6,1),e.fill({color:16777215,alpha:.05});const b=t+i-30,_=n+r/2-8;e.roundRect(b,_,20,16,3),e.fill(Da.sideTable),e.rect(b+3,_+2,8,11),e.fill({color:Da.magazine,alpha:.7}),e.rect(b+8,_+4,8,10),e.fill({color:Da.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 CB(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 b=g%2*(r/2),_=g*i;e.moveTo(0,_),e.lineTo(t,_),e.stroke({width:1,color:pt.floorGrout,alpha:.4});for(let S=0;S<Math.ceil(t/r)+1;S++){const A=S*r-b;A>0&&A<t&&(e.moveTo(A,_),e.lineTo(A,_+i),e.stroke({width:1,color:pt.floorGrout,alpha:.25}))}g%3===0&&(e.rect(0,_+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 AB(e,t,n){const i=t+bl/2,r=n+uu+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,bl,uu,4),e.fill({color:0,alpha:.12}),e.roundRect(t,n,bl,uu,4),e.fill(pt.desk),e.roundRect(t+2,n+2,bl-4,uu-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+bl-6,T),e.stroke({width:.5,color:pt.deskShadow,alpha:.2})}e.rect(t+2,n+uu-6,bl-4,4),e.fill(pt.deskEdge);const s=4,l=8;e.rect(t+4,n+uu,s,l),e.fill(pt.deskLeg),e.rect(t+bl-4-s,n+uu,s,l),e.fill(pt.deskLeg);const c=32,f=22,p=t+(bl-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,b=8,_=p+(c-g)/2,S=m+f+10;e.roundRect(_,S,g,b,2),e.fill(pt.keyboard);for(let A=0;A<3;A++)for(let T=0;T<6;T++)e.rect(_+2+T*3.5,S+1.5+A*2.5,2.5,1.5),e.fill(pt.keyboardKey);e.roundRect(t+bl-18,n+14,7,8,2),e.fill(14142664),e.roundRect(t+bl-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 MB(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 d2(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 RB(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(Ur.counter),e.roundRect(t+1,n+1,78,8,3),e.fill(Ur.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(Ur.machine),e.roundRect(t+5,n-14,26,6,2),e.fill(Ur.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(Ur.machineTop),e.rect(t+20,n+8,3,8),e.fill(Ur.machineTop),e.circle(t+18,n-8,2.5),e.fill({color:Ur.machineLight,alpha:.9}),e.circle(t+18,n-8,5),e.fill({color:Ur.machineLight,alpha:.15}),e.roundRect(t+38,n+8,8,10,2),e.fill(Ur.cup),e.roundRect(t+46,n+10,3,5,1),e.fill(Ur.cup),e.roundRect(t+48,n+6,8,10,2),e.fill(Ur.cupShadow),e.ellipse(t+42,n+20,10,3),e.fill(Ur.saucer),e.roundRect(t+60,n+6,16,14,3),e.fill(Ur.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(Ur.faucet),e.roundRect(t+65,n-4,8,3,1),e.fill(Ur.faucet),e.roundRect(t+10,n-30,30,14,2),e.fill(Ur.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 kB(e,t,n){e.roundRect(t-16,n-24,128,96,6),e.fill({color:ts.carpet,alpha:.25}),e.roundRect(t-12,n-20,120,88,4),e.stroke({width:1,color:ts.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(ts.whiteboardFrame),e.roundRect(i+2,r+2,72,12,1),e.fill(ts.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(ts.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(ts.table),e.roundRect(t+2,n+2,92,44,5),e.fill(ts.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:ts.tableEdge,alpha:.4});const s=4,l=6;e.rect(t+8,n+48,s,l),e.fill(ts.tableLeg),e.rect(t+84,n+48,s,l),e.fill(ts.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(ts.chairBack),e.roundRect(f.cx-7,f.cy-4,14,8,3),e.fill(ts.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(ts.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 NB={running:Sd.statusRunning,idle:Sd.statusIdle,completed:Sd.statusCompleted,checkpoint:Sd.statusCheckpoint};function OB(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:Sd.background,alpha:.85}),e.roundRect(s+2,l+1,r-4,8,6),e.fill({color:Sd.backgroundGlow,alpha:.4}),e.roundRect(s,l,r,c,8),e.stroke({width:1,color:16777215,alpha:.08});const f=NB[i]??Sd.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})}px({Container:Tr,Graphics:La,Sprite:gh,Text:hx});function C_({agent:e,textures:t,bubbleText:n,animX:i,animY:r,animPose:s}){const l=SB(e.colorIndex,s),c=t.get(l),f=Z4[e.status==="walking"?"idle":e.status]??8947848,p=e.status==="checkpoint",m=B.useCallback(b=>{b.clear(),b.circle(0,0,E0/2+6),b.fill({color:f,alpha:p?.4:.15})},[f,p]),g=B.useCallback(b=>{if(b.clear(),!n)return;const _=Math.min(n.length*5+16,160);b.roundRect(-_/2,-42,_,22,6),b.fill({color:1710638,alpha:.9}),b.moveTo(-4,-20),b.lineTo(4,-20),b.lineTo(0,-15),b.closePath(),b.fill({color:1710638,alpha:.9})},[n]);return x.jsxs("container",{x:i,y:r,children:[x.jsx("graphics",{draw:m}),c&&x.jsx("sprite",{texture:c,anchor:.5}),x.jsx("text",{text:e.name,y:E0/2+4,anchor:{x:.5,y:0},style:{fontSize:9,fill:"#cccccc",fontFamily:"sans-serif"}}),p&&x.jsx("text",{text:"⚠",y:-E0/2-12,anchor:.5,style:{fontSize:14,fill:"#ff9800",fontFamily:"sans-serif"}}),n&&x.jsxs(x.Fragment,{children:[x.jsx("graphics",{draw:g}),x.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}})]})]})}px({Container:Tr,Graphics:La,Text:hx});function DB({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=Am(m,f,p),b=iA(m,f,p),_=B.useCallback(S=>{S.clear(),CB(S,f,p),OB(S,0,f,t);for(let A=0;A<n.length;A++){const T=oh(A,m);AB(S,T.x-48,T.y-32)}RB(S,g.x,g.y),kB(S,b.x,b.y),MB(S,f-60,44),d2(S,10,p-50),d2(S,f-40,50)},[n.length,t,f,p]);return x.jsxs("container",{x:l,y:c,children:[x.jsx("graphics",{draw:_}),x.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:x.jsx(C_,{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 zB(e,t,n,i,r){e.rect(t,n,i,r),e.fill(Oa.floor);const s=16,l=60;for(let P=0;P<Math.ceil(r/s);P++){const G=P%2*(l/2),ne=n+P*s;e.moveTo(t,ne),e.lineTo(t+i,ne),e.stroke({width:.5,color:4861984,alpha:.3});for(let X=0;X<Math.ceil(i/l)+1;X++){const W=t+X*l-G;W>t&&W<t+i&&(e.moveTo(W,ne),e.lineTo(W,ne+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:Oa.carpet,alpha:.6}),e.roundRect(m+6,g+6,f-12,p-12,4),e.stroke({width:1.5,color:Oa.carpetBorder,alpha:.4}),e.roundRect(m+14,g+14,f-28,p-28,3),e.stroke({width:1,color:16766287,alpha:.15});const b=t+8,_=n+40,S=6,A=80;e.roundRect(b-2,_-2,S+4,A+4,2),e.fill(Oa.windowFrame),e.roundRect(b,_,S,A,1),e.fill(Oa.window),e.rect(b+1,_+4,2,A/3),e.fill({color:16777215,alpha:.2}),e.roundRect(b-4,_+A+2,S+8,3,1),e.fill(Oa.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(Oa.desk),e.roundRect(N+3,R+3,T-6,C-6,3),e.fill(Oa.deskTop),e.roundRect(N+1,R+1,T-2,C-2,4),e.stroke({width:1,color:Oa.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 z=N+T/2,L=R+C+16;e.roundRect(z-14,L-4,28,16,6),e.fill(Oa.chair),e.roundRect(z-12,L-8,24,12,4),e.fill(Oa.chairSeat),e.roundRect(z-8,L-6,16,4,2),e.fill({color:16777215,alpha:.06}),e.circle(z,L+14,3),e.fill(4473924);for(const P of[-8,0,8])e.circle(z+P,L+18,1.5),e.fill(3355443);const D=t+i-54,F=n+20;e.roundRect(D,F,44,80,3),e.fill(Oa.bookshelf);const Z=[15022389,2001125,4431943,16750592,9315498,35195];for(let P=0;P<3;P++){const G=F+8+P*26;e.rect(D+3,G+18,38,3),e.fill(9139029);for(let ne=0;ne<5;ne++){const X=D+5+ne*7,W=12+(ne*3+P*2)%6;e.rect(X,G+18-W,5,W),e.fill(Z[(ne+P*2)%Z.length])}}const K=t+i-54,V=n+r-60;e.roundRect(K,V+10,24,16,2),e.fill(6111287),e.rect(K+10,V+4,4,8),e.fill(7901340),e.circle(K+12,V,10),e.fill(Oa.globe),e.circle(K+12,V,10),e.stroke({width:.5,color:2001125,alpha:.4}),e.circle(K+9,V-3,3),e.fill({color:16777215,alpha:.15}),e.roundRect(N+44,R+38,36,10,2),e.fill(Oa.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})}px({Container:Tr,Graphics:La,Text:hx});const f2=["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."],Jy=900,h2=2400,jB=6e3,LB={id:"ceo",name:"CEO",colorIndex:3,status:"working",deskIndex:0,position:{x:0,y:0},targetPosition:null};function BB({x:e,y:t,width:n,height:i,textures:r,ticker:s}){const[l,c]=B.useState(null),[f,p]=B.useState("seated"),m=B.useRef(0),g=B.useRef(Jy+Math.floor(Math.random()*(h2-Jy))),b=B.useRef(null),_=n/2,S=i/2+10,A=B.useCallback(T=>{T.clear(),zB(T,0,0,n,i)},[n,i]);return B.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=f2[Math.floor(Math.random()*f2.length)];c(R),p("standing"),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{c(null)},jB),g.current=Jy+Math.floor(Math.random()*(h2-Jy))}};return s.add(T),()=>{s.remove(T),b.current&&clearTimeout(b.current)}},[s]),x.jsxs("container",{x:e,y:t,children:[x.jsx("graphics",{draw:A}),x.jsx("text",{text:"CEO",x:n/2,y:12,anchor:.5,style:{fontSize:13,fill:"#ffd700",fontFamily:"sans-serif",fontWeight:"bold"}}),x.jsx(C_,{agent:LB,textures:r,bubbleText:l,animX:_,animY:S,animPose:f})]})}const rv=150,IB=48,av=30,e0=3,UB=4e3,t0=600,sv=1800,HB=60,p2=900,m2=5e3,g2=[["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 PB(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=Mm(f,`squad-${i}`,"kitchen",n),m=lD(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=Mm(f,`squad-${i}`,"rest-area",n),m=oD(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=Mm(p,`squad-${i}`,m,n),b=sD(n,f);return{x:b.x,y:b.y,destination:m,waypoints:g,isExternal:!0}}else if(c<.6){const f=iA(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=Am(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=cD(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=oh(f,l,t.width,t.height);return{x:p.x+(Math.random()-.5)*40,y:p.y+(Math.random()-.5)*20,destination:"neighbor"}}}function FB(e){const[t,n]=B.useState({}),i=B.useRef({}),r=B.useRef({}),s=B.useRef({}),l=B.useRef({}),c=B.useRef(0),f=B.useRef({}),p=B.useRef({});B.useEffect(()=>{const g=li.subscribe((b,_)=>{var T,C;const S=b.bubbles,A=_.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,z]=N.split(":");f.current[N]=setTimeout(()=>{li.getState().clearBubble(R,z),delete f.current[N]},UB)}});return()=>{g();for(const b of Object.values(f.current))clearTimeout(b);f.current={}}},[]);const m=B.useCallback(()=>{c.current++;const g=c.current,b=li.getState(),_={},S=D0(b.rooms.length);for(const[A,T]of Object.entries(b.agentVisuals)){i.current[A]||(i.current[A]={}),r.current[A]||(r.current[A]={}),_[A]={};const C=b.rooms.indexOf(A),N=S.squadOrigins[C],R=(N==null?void 0:N.origin)??{x:0,y:0},z=[];for(const L of T){const D=i.current[A],F=r.current[A],Z=`${A}:${L.id}`;F[L.id]||(F[L.id]={x:L.position.x,y:L.position.y,baseY:L.position.y},s.current[Z]=Math.floor(Math.random()*sv));const K=F[L.id];if(L.targetPosition&&(!D[L.id]||D[L.id].progress>=1)){const P=D[L.id];if(P!=null&&P.isExternalTransit){const G=P.globalX??K.x+R.x,ne=P.globalY??K.y+R.y,X={x:G,y:ne},W={x:L.targetPosition.x+R.x,y:L.targetPosition.y+R.y},O=l.current[Z],Y=O==="kitchen"?"kitchen":O==="restArea"?"rest-area":O==="bathroom-male"?"bathroom-male":O==="bathroom-female"?"bathroom-female":`squad-${C}`,$=Mm(X,Y,`squad-${C}`,S);$[$.length-1]=W;const Q=$.shift(),H=$.length>0?$.shift():Q,I=By(Q,H);D[L.id]={startX:Q.x,startY:Q.y,targetX:H.x,targetY:H.y,progress:0,duration:Math.max(30,Math.ceil(I/e0)),baseY:L.targetPosition.y,waypointQueue:$,isExternalTransit:!0,globalX:G,globalY:ne}}else D[L.id]={startX:K.x,startY:K.baseY,targetX:L.targetPosition.x,targetY:L.targetPosition.y,progress:0,duration:rv,baseY:L.targetPosition.y,waypointQueue:[],isExternalTransit:!1}}if(L.status==="idle"&&(!D[L.id]||D[L.id].progress>=1)){const P=D[L.id];if(P!=null&&P.isExternalTransit&&P.waypointQueue.length===0&&P.progress>=1&&(P.globalX!==void 0&&P.globalY!==void 0&&(K.x=P.globalX-R.x,K.y=P.globalY-R.y,K.baseY=K.y),P.isExternalTransit=!1,P.globalX=void 0,P.globalY=void 0),s.current[Z]===void 0&&(s.current[Z]=t0+Math.floor(Math.random()*(sv-t0))),s.current[Z]--,s.current[Z]<=0){const G=D[L.id];if(G!=null&&G.isExternalTransit){const ne=G.globalX??K.x+R.x,X=G.globalY??K.y+R.y,W={x:ne,y:X},O=oh(L.deskIndex,{x:0,y:0}),Y={x:O.x+R.x,y:O.y+R.y},$=l.current[Z],Q=$==="kitchen"?"kitchen":$==="restArea"?"rest-area":$==="bathroom-male"?"bathroom-male":$==="bathroom-female"?"bathroom-female":`squad-${C}`,H=Mm(W,Q,`squad-${C}`,S);H[H.length-1]=Y;const I=H.shift(),J=H.length>0?H.shift():I,q=By(I,J);l.current[Z]="neighbor",D[L.id]={startX:I.x,startY:I.y,targetX:J.x,targetY:J.y,progress:0,duration:Math.max(30,Math.ceil(q/e0)),baseY:O.y,waypointQueue:H,isExternalTransit:!0,globalX:ne,globalY:X}}else{const X=PB(R,N??{width:lc,height:rs},S,C,K.x,K.baseY);if(l.current[Z]=X.destination,X.isExternal&&X.waypoints&&X.waypoints.length>1){const W=[...X.waypoints],O=W.shift(),Y=W.length>0?W.shift():O,$=By(O,Y);D[L.id]={startX:O.x,startY:O.y,targetX:Y.x,targetY:Y.y,progress:0,duration:Math.max(30,Math.ceil($/e0)),baseY:X.y-R.y,waypointQueue:W,isExternalTransit:!0,globalX:O.x,globalY:O.y}}else D[L.id]={startX:K.x,startY:K.baseY,targetX:X.x,targetY:X.y,progress:0,duration:rv+Math.floor(Math.random()*30),baseY:X.y,waypointQueue:[],isExternalTransit:!1}}s.current[Z]=t0+Math.floor(Math.random()*(sv-t0))}}const V=D[L.id];if(V&&V.progress<1){V.progress=Math.min(1,V.progress+1/V.duration);const P=iD(V.progress);if(V.isExternalTransit){const G=Ly(V.startX,V.targetX,P),ne=Ly(V.startY,V.targetY,P);V.globalX=G,V.globalY=ne,K.x=G-R.x,K.y=ne-R.y;const X=Math.floor(g/av)%2===0?"walk-right":"walk-left";_[A][L.id]={x:K.x,y:K.y,pose:X,isExternalTransit:!0,globalX:G,globalY:ne}}else{K.x=Ly(V.startX,V.targetX,P),K.y=Ly(V.startY,V.targetY,P),K.baseY=V.baseY;const G=Math.floor(g/av)%2===0?"walk-right":"walk-left";_[A][L.id]={x:K.x,y:K.y,pose:G}}}else if(V&&V.progress>=1&&V.waypointQueue.length>0){const P=V.waypointQueue.shift(),G={x:V.targetX,y:V.targetY},ne=By(G,P);V.startX=V.targetX,V.startY=V.targetY,V.targetX=P.x,V.targetY=P.y,V.progress=0,V.duration=V.isExternalTransit?Math.max(30,Math.ceil(ne/e0)):rv,V.isExternalTransit&&(V.globalX=V.startX,V.globalY=V.startY);const X=Math.floor(g/av)%2===0?"walk-right":"walk-left";V.isExternalTransit?_[A][L.id]={x:K.x,y:K.y,pose:X,isExternalTransit:!0,globalX:V.startX,globalY:V.startY}:_[A][L.id]={x:K.x,y:K.y,pose:X}}else if(L.status==="working"){const P=Math.floor(g/IB)%2===0?"typing":"seated";_[A][L.id]={x:K.x,y:K.baseY,pose:P}}else if(L.status==="idle"){const P=l.current[Z]??"coffee",G=D[L.id];if((G==null?void 0:G.isExternalTransit)??!1)_[A][L.id]={x:K.x,y:K.y,pose:"standing",isExternalTransit:!0,globalX:(G==null?void 0:G.globalX)??K.x+R.x,globalY:(G==null?void 0:G.globalY)??K.y+R.y};else{const X=Math.sin(g*.07+L.deskIndex*1.5)*2;let W;P==="coffee"||P==="kitchen"?W="coffee":P==="meeting"||P==="neighbor"?W=Math.floor(g/90)%2===0?"standing":"coffee":P==="restArea"?W="seated":(P.startsWith("bathroom"),W="standing"),_[A][L.id]={x:K.x,y:K.baseY+X,pose:W},z.push({agentKey:Z,agentId:L.id,agentName:L.name,x:K.x,y:K.baseY})}}else L.status==="checkpoint"?_[A][L.id]={x:K.x,y:K.baseY,pose:"seated"}:_[A][L.id]={x:K.x,y:K.baseY,pose:"seated"}}if(g%60===0&&z.length>=2)for(let L=0;L<z.length;L++){const D=z[L];if(!(p.current[D.agentKey]&&g-p.current[D.agentKey]<p2)&&!b.bubbles[D.agentKey])for(let F=L+1;F<z.length;F++){const Z=z[F];if(p.current[Z.agentKey]&&g-p.current[Z.agentKey]<p2||b.bubbles[Z.agentKey])continue;const K=D.x-Z.x,V=D.y-Z.y;if(Math.sqrt(K*K+V*V)<HB){const[G,ne]=g2[Math.floor(Math.random()*g2.length)];b.appendBubble(A,D.agentId,G),setTimeout(()=>{li.getState().appendBubble(A,Z.agentId,ne)},1500),p.current[D.agentKey]=g,p.current[Z.agentKey]=g;const X=`${A}:${D.agentId}`,W=`${A}:${Z.agentId}`;f.current[X]&&clearTimeout(f.current[X]),f.current[W]&&clearTimeout(f.current[W]),f.current[X]=setTimeout(()=>{li.getState().clearBubble(A,D.agentId),delete f.current[X]},m2),f.current[W]=setTimeout(()=>{li.getState().clearBubble(A,Z.agentId),delete f.current[W]},m2+1500);break}}}}n(_)},[]);return B.useEffect(()=>{if(e)return e.add(m),()=>{e.remove(m)}},[e,m]),t}px({Container:Tr,Graphics:La,Text:hx});const qB=.3,GB=2;function YB(){const{app:e}=yB(),t=B.useRef(null),[n,i]=B.useState(new Map),r=B.useRef(null),s=li(b=>b.rooms),l=li(b=>b.agentVisuals),c=li(b=>b.bubbles),f=wr(b=>b.activeStates),p=FB((e==null?void 0:e.ticker)??null),m=B.useMemo(()=>D0(s.length),[s.length]);B.useEffect(()=>{e!=null&&e.renderer&&i(_B(e))},[e]);const g=B.useCallback(b=>{b.clear(),EB(b,m),u2(b,m.bathroomMale.x,m.bathroomMale.y,m.bathroomMale.width,m.bathroomMale.height,"male"),u2(b,m.bathroomFemale.x,m.bathroomFemale.y,m.bathroomFemale.width,m.bathroomFemale.height,"female"),wB(b,m.kitchen.x,m.kitchen.y,m.kitchen.width,m.kitchen.height),TB(b,m.restArea.x,m.restArea.y,m.restArea.width,m.restArea.height)},[m]);return B.useEffect(()=>{const b=e==null?void 0:e.canvas;if(!b)return;const _=C=>{const N=t.current;N&&(r.current={startX:C.clientX,startY:C.clientY,pivotX:N.position.x,pivotY:N.position.y},b.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,b.releasePointerCapture(C.pointerId)},T=C=>{C.preventDefault();const N=t.current;if(!N)return;const R=N.scale.x,z=C.deltaY>0?.9:1.1,L=Math.max(qB,Math.min(GB,R*z)),D=b.getBoundingClientRect(),F=C.clientX-D.left,Z=C.clientY-D.top,K=L/R;N.position.x=F-(F-N.position.x)*K,N.position.y=Z-(Z-N.position.y)*K,N.scale.set(L)};return b.addEventListener("pointerdown",_),b.addEventListener("pointermove",S),b.addEventListener("pointerup",A),b.addEventListener("pointerleave",A),b.addEventListener("wheel",T,{passive:!1}),()=>{b.removeEventListener("pointerdown",_),b.removeEventListener("pointermove",S),b.removeEventListener("pointerup",A),b.removeEventListener("pointerleave",A),b.removeEventListener("wheel",T)}},[e]),x.jsxs("container",{ref:t,children:[x.jsx("graphics",{draw:g}),m.corridorV.height>0&&x.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"}}),x.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"}}),x.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"}}),x.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"}}),x.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"}}),x.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((b,_)=>{var N;const S=m.squadOrigins[_];if(!S)return null;const A=l[b]??[],T=((N=f[b])==null?void 0:N.status)??"idle",C=p[b]??{};return x.jsx(DB,{squadName:b,status:T,agents:A,textures:n,bubbles:c,animStates:C,originX:S.origin.x,originY:S.origin.y,roomWidth:S.width,roomHeight:S.height},b)}),s.map((b,_)=>{const S=l[b]??[],A=p[b]??{};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=`${b}:${T.id}`,R=c[N];return x.jsx(C_,{agent:T,textures:n,bubbleText:(R==null?void 0:R.text)??null,animX:C.globalX,animY:C.globalY,animPose:C.pose},`transit-${T.id}`)})}),x.jsx(BB,{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 VB(){const e=li(i=>i.activeRoom),t=li(i=>i.checkpoints),n=e?t[e]:void 0;return x.jsx("div",{style:{display:"flex",height:"100%"},children:x.jsxs("div",{style:{flex:1,position:"relative",overflow:"hidden"},children:[x.jsx(gB,{background:13158600,antialias:!0,resizeTo:window,style:{width:"100%",height:"100%"},children:x.jsx(YB,{})}),n&&x.jsx(xB,{agentName:n.agentName,question:n.question,onRespond:i=>Q4(e,i)})]})})}function XB(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const KB=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,WB=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$B={};function y2(e,t){return($B.jsx?WB:KB).test(e)}const QB=/[ \t\n\f\r]/g;function ZB(e){return typeof e=="object"?e.type==="text"?x2(e.value):!1:x2(e)}function x2(e){return e.replace(QB,"")===""}class og{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}og.prototype.normal={};og.prototype.property={};og.prototype.space=void 0;function VM(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new og(n,i,t)}function w1(e){return e.toLowerCase()}class Ua{constructor(t,n){this.attribute=n,this.property=t}}Ua.prototype.attribute="";Ua.prototype.booleanish=!1;Ua.prototype.boolean=!1;Ua.prototype.commaOrSpaceSeparated=!1;Ua.prototype.commaSeparated=!1;Ua.prototype.defined=!1;Ua.prototype.mustUseProperty=!1;Ua.prototype.number=!1;Ua.prototype.overloadedBoolean=!1;Ua.prototype.property="";Ua.prototype.spaceSeparated=!1;Ua.prototype.space=void 0;let JB=0;const Mt=jd(),Bi=jd(),T1=jd(),ze=jd(),Hn=jd(),ch=jd(),ss=jd();function jd(){return 2**++JB}const C1=Object.freeze(Object.defineProperty({__proto__:null,boolean:Mt,booleanish:Bi,commaOrSpaceSeparated:ss,commaSeparated:ch,number:ze,overloadedBoolean:T1,spaceSeparated:Hn},Symbol.toStringTag,{value:"Module"})),lv=Object.keys(C1);class A_ extends Ua{constructor(t,n,i,r){let s=-1;if(super(t,n),b2(this,"space",r),typeof i=="number")for(;++s<lv.length;){const l=lv[s];b2(this,lv[s],(i&C1[l])===C1[l])}}}A_.prototype.defined=!0;function b2(e,t,n){n&&(e[t]=n)}function Nh(e){const t={},n={};for(const[i,r]of Object.entries(e.properties)){const s=new A_(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),t[i]=s,n[w1(i)]=i,n[w1(s.attribute)]=i}return new og(t,n,e.space)}const XM=Nh({properties:{ariaActiveDescendant:null,ariaAtomic:Bi,ariaAutoComplete:null,ariaBusy:Bi,ariaChecked:Bi,ariaColCount:ze,ariaColIndex:ze,ariaColSpan:ze,ariaControls:Hn,ariaCurrent:null,ariaDescribedBy:Hn,ariaDetails:null,ariaDisabled:Bi,ariaDropEffect:Hn,ariaErrorMessage:null,ariaExpanded:Bi,ariaFlowTo:Hn,ariaGrabbed:Bi,ariaHasPopup:null,ariaHidden:Bi,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Hn,ariaLevel:ze,ariaLive:null,ariaModal:Bi,ariaMultiLine:Bi,ariaMultiSelectable:Bi,ariaOrientation:null,ariaOwns:Hn,ariaPlaceholder:null,ariaPosInSet:ze,ariaPressed:Bi,ariaReadOnly:Bi,ariaRelevant:null,ariaRequired:Bi,ariaRoleDescription:Hn,ariaRowCount:ze,ariaRowIndex:ze,ariaRowSpan:ze,ariaSelected:Bi,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 KM(e,t){return t in e?e[t]:t}function WM(e,t){return KM(e,t.toLowerCase())}const e8=Nh({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ch,acceptCharset:Hn,accessKey:Hn,action:null,allow:null,allowFullScreen:Mt,allowPaymentRequest:Mt,allowUserMedia:Mt,alt:null,as:null,async:Mt,autoCapitalize:null,autoComplete:Hn,autoFocus:Mt,autoPlay:Mt,blocking:Hn,capture:null,charSet:null,checked:Mt,cite:null,className:Hn,cols:ze,colSpan:null,content:null,contentEditable:Bi,controls:Mt,controlsList:Hn,coords:ze|ch,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Mt,defer:Mt,dir:null,dirName:null,disabled:Mt,download:T1,draggable:Bi,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Mt,formTarget:null,headers:Hn,height:ze,hidden:T1,high:ze,href:null,hrefLang:null,htmlFor:Hn,httpEquiv:Hn,id:null,imageSizes:null,imageSrcSet:null,inert:Mt,inputMode:null,integrity:null,is:null,isMap:Mt,itemId:null,itemProp:Hn,itemRef:Hn,itemScope:Mt,itemType:Hn,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:Hn,placeholder:null,playsInline:Mt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Mt,referrerPolicy:null,rel:Hn,required:Mt,reversed:Mt,rows:ze,rowSpan:ze,sandbox:Hn,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:Bi,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:Bi,width:ze,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Hn,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:Bi,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:WM}),t8=Nh({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:ss,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:Hn,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:ch,g2:ch,glyphName:ch,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:ss,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:Hn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ze,pointsAtY:ze,pointsAtZ:ze,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ss,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ss,rev:ss,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ss,requiredFeatures:ss,requiredFonts:ss,requiredFormats:ss,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:ss,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:ss,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:ss,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:KM}),$M=Nh({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()}}),QM=Nh({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:WM}),ZM=Nh({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),n8={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"},i8=/[A-Z]/g,v2=/-[a-z]/g,r8=/^data[-\w.:]+$/i;function a8(e,t){const n=w1(t);let i=t,r=Ua;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&r8.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(v2,l8);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!v2.test(s)){let l=s.replace(i8,s8);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}r=A_}return new r(i,t)}function s8(e){return"-"+e.toLowerCase()}function l8(e){return e.charAt(1).toUpperCase()}const o8=VM([XM,e8,$M,QM,ZM],"html"),M_=VM([XM,t8,$M,QM,ZM],"svg");function c8(e){return e.join(" ").trim()}var Vf={},ov,_2;function u8(){if(_2)return ov;_2=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="",b="comment",_="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 z(X){var W=X.match(t);W&&(N+=W.length);var O=X.lastIndexOf(f);R=~O?X.length-O:R+X.length}function L(){var X={line:N,column:R};return function(W){return W.position=new D(X),K(),W}}function D(X){this.start=X,this.end={line:N,column:R},this.source=C.source}D.prototype.content=T;function F(X){var W=new Error(C.source+":"+N+":"+R+": "+X);if(W.reason=X,W.filename=C.source,W.line=N,W.column=R,W.source=T,!C.silent)throw W}function Z(X){var W=X.exec(T);if(W){var O=W[0];return z(O),T=T.slice(O.length),W}}function K(){Z(n)}function V(X){var W;for(X=X||[];W=P();)W!==!1&&X.push(W);return X}function P(){var X=L();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 F("End of comment missing");var O=T.slice(2,W-2);return R+=2,z(O),T=T.slice(W),R+=2,X({type:b,comment:O})}}function G(){var X=L(),W=Z(i);if(W){if(P(),!Z(r))return F("property missing ':'");var O=Z(s),Y=X({type:_,property:A(W[0].replace(e,g)),value:O?A(O[0].replace(e,g)):g});return Z(l),Y}}function ne(){var X=[];V(X);for(var W;W=G();)W!==!1&&(X.push(W),V(X));return X}return K(),ne()}function A(T){return T?T.replace(c,g):g}return ov=S,ov}var S2;function d8(){if(S2)return Vf;S2=1;var e=Vf&&Vf.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Vf,"__esModule",{value:!0}),Vf.default=n;const t=e(u8());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 Vf}var fm={},E2;function f8(){if(E2)return fm;E2=1,Object.defineProperty(fm,"__esModule",{value:!0}),fm.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 fm.camelCase=f,fm}var hm,w2;function h8(){if(w2)return hm;w2=1;var e=hm&&hm.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},t=e(d8()),n=f8();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,hm=i,hm}var p8=h8();const m8=xu(p8),JM=eR("end"),R_=eR("start");function eR(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 g8(e){const t=R_(e),n=JM(e);if(t&&n)return{start:t,end:n}}function Dm(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?T2(e.position):"start"in e||"end"in e?T2(e):"line"in e||"column"in e?A1(e):""}function A1(e){return C2(e&&e.line)+":"+C2(e&&e.column)}function T2(e){return A1(e&&e.start)+"-"+A1(e&&e.end)}function C2(e){return e&&typeof e=="number"?e:1}class Gr 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=Dm(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}}Gr.prototype.file="";Gr.prototype.name="";Gr.prototype.reason="";Gr.prototype.message="";Gr.prototype.stack="";Gr.prototype.column=void 0;Gr.prototype.line=void 0;Gr.prototype.ancestors=void 0;Gr.prototype.cause=void 0;Gr.prototype.fatal=void 0;Gr.prototype.place=void 0;Gr.prototype.ruleId=void 0;Gr.prototype.source=void 0;const k_={}.hasOwnProperty,y8=new Map,x8=/[A-Z]/g,b8=new Set(["table","tbody","thead","tfoot","tr"]),v8=new Set(["td","th"]),tR="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _8(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=R8(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=M8(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"?M_:o8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=nR(r,e,void 0);return s&&typeof s!="string"?s:r.create(e,r.Fragment,{children:s||void 0},void 0)}function nR(e,t,n){if(t.type==="element")return S8(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return E8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return T8(e,t,n);if(t.type==="mdxjsEsm")return w8(e,t);if(t.type==="root")return C8(e,t,n);if(t.type==="text")return A8(e,t)}function S8(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=M_,e.schema=r),e.ancestors.push(t);const s=rR(e,t.tagName,!1),l=k8(e,t);let c=O_(e,t);return b8.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!ZB(f):!0})),iR(e,l,s,t),N_(l,c),e.ancestors.pop(),e.schema=i,e.create(t,s,l,n)}function E8(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)}Ym(e,t.position)}function w8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ym(e,t.position)}function T8(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=M_,e.schema=r),e.ancestors.push(t);const s=t.name===null?e.Fragment:rR(e,t.name,!0),l=N8(e,t),c=O_(e,t);return iR(e,l,s,t),N_(l,c),e.ancestors.pop(),e.schema=i,e.create(t,s,l,n)}function C8(e,t,n){const i={};return N_(i,O_(e,t)),e.create(t,e.Fragment,i,n)}function A8(e,t){return t.value}function iR(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function N_(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function M8(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 R8(e,t){return n;function n(i,r,s,l){const c=Array.isArray(s.children),f=R_(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 k8(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&k_.call(t.properties,r)){const s=O8(e,r,t.properties[r]);if(s){const[l,c]=s;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&v8.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 N8(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 Ym(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 Ym(e,t.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function O_(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:y8;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=nR(e,s,l);c!==void 0&&n.push(c)}return n}function O8(e,t,n){const i=a8(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?XB(n):c8(n)),i.property==="style"){let r=typeof n=="object"?n:D8(e,String(n));return e.stylePropertyNameCase==="css"&&(r=z8(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&i.space?n8[i.property]||i.property:i.attribute,n]}}function D8(e,t){try{return m8(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,r=new Gr("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=tR+"#cannot-parse-style-attribute",r}}function rR(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=y2(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=y2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const r=i.value;return k_.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(i);Ym(e)}function Ym(e,t){const n=new Gr("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=tR+"#cannot-handle-mdx-estrees-without-createevaluater",n}function z8(e){const t={};let n;for(n in e)k_.call(e,n)&&(t[j8(n)]=e[n]);return t}function j8(e){let t=e.replace(x8,L8);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function L8(e){return"-"+e.toLowerCase()}const cv={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"]},B8={};function D_(e,t){const n=B8,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return aR(e,i,r)}function aR(e,t,n){if(I8(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 A2(e.children,t,n)}return Array.isArray(e)?A2(e,t,n):""}function A2(e,t,n){const i=[];let r=-1;for(;++r<e.length;)i[r]=aR(e[r],t,n);return i.join("")}function I8(e){return!!(e&&typeof e=="object")}const M2=document.createElement("i");function z_(e){const t="&"+e+";";M2.innerHTML=t;const n=M2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function us(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 Hs(e,t){return e.length>0?(us(e,e.length,0,t),e):t}const R2={}.hasOwnProperty;function sR(e){const t={};let n=-1;for(;++n<e.length;)U8(t,e[n]);return t}function U8(e,t){let n;for(n in t){const r=(R2.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let l;if(s)for(l in s){R2.call(r,l)||(r[l]=[]);const c=s[l];H8(r[l],Array.isArray(c)?c:c?[c]:[])}}}function H8(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);us(e,0,0,i)}function lR(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 Al(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const xa=vu(/[A-Za-z]/),qr=vu(/[\dA-Za-z]/),P8=vu(/[#-'*+\--9=?A-Z^-~]/);function F0(e){return e!==null&&(e<32||e===127)}const M1=vu(/\d/),F8=vu(/[\dA-Fa-f]/),q8=vu(/[!-/:-@[-`{-~]/);function lt(e){return e!==null&&e<-2}function Bn(e){return e!==null&&(e<0||e===32)}function Lt(e){return e===-2||e===-1||e===32}const mx=vu(new RegExp("\\p{P}|\\p{S}","u")),Rd=vu(/\s/);function vu(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Oh(e){const t=[];let n=-1,i=0,r=0;for(;++n<e.length;){const s=e.charCodeAt(n);let l="";if(s===37&&qr(e.charCodeAt(n+1))&&qr(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 Wt(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 G8={tokenize:Y8};function Y8(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"),Wt(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 V8={tokenize:X8},k2={tokenize:K8};function X8(e){const t=this,n=[];let i=0,r,s,l;return c;function c(R){if(i<n.length){const z=n[i];return t.containerState=z[1],e.attempt(z[0].continuation,f,p)(R)}return p(R)}function f(R){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&N();const z=t.events.length;let L=z,D;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){D=t.events[L][1].end;break}C(i);let F=z;for(;F<t.events.length;)t.events[F][1].end={...D},F++;return us(t.events,L+1,0,t.events.slice(z)),t.events.length=F,p(R)}return c(R)}function p(R){if(i===n.length){if(!r)return b(R);if(r.currentConstruct&&r.currentConstruct.concrete)return S(R);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(k2,m,g)(R)}function m(R){return r&&N(),C(i),b(R)}function g(R){return t.parser.lazy[t.now().line]=i!==n.length,l=t.now().offset,S(R)}function b(R){return t.containerState={},e.attempt(k2,_,S)(R)}function _(R){return i++,n.push([t.currentConstruct,t.containerState]),b(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,z){const L=t.sliceStream(R);if(z&&L.push(null),R.previous=s,s&&(s.next=R),s=R,r.defineSkip(R.start),r.write(L),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 F=t.events.length;let Z=F,K,V;for(;Z--;)if(t.events[Z][0]==="exit"&&t.events[Z][1].type==="chunkFlow"){if(K){V=t.events[Z][1].end;break}K=!0}for(C(i),D=F;D<t.events.length;)t.events[D][1].end={...V},D++;us(t.events,Z+1,0,t.events.slice(F)),t.events.length=D}}function C(R){let z=n.length;for(;z-- >R;){const L=n[z];t.containerState=L[1],L[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 K8(e,t,n){return Wt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function bh(e){if(e===null||Bn(e)||Rd(e))return 1;if(mx(e))return 2}function gx(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 R1={name:"attention",resolveAll:W8,tokenize:$8};function W8(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},b={...e[n][1].start};N2(g,-f),N2(b,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:b},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=Hs(p,[["enter",e[i][1],t],["exit",e[i][1],t]])),p=Hs(p,[["enter",r,t],["enter",l,t],["exit",l,t],["enter",s,t]]),p=Hs(p,gx(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),p=Hs(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=Hs(p,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,us(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 $8(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=bh(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=bh(f),g=!m||m===2&&r||n.includes(f),b=!r||r===2&&m||n.includes(i);return p._open=!!(s===42?g:g&&(r||!b)),p._close=!!(s===42?b:b&&(m||!g)),t(f)}}function N2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Q8={name:"autolink",tokenize:Z8};function Z8(e,t,n){let i=0;return r;function r(_){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(_),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(_){return xa(_)?(e.consume(_),l):_===64?n(_):p(_)}function l(_){return _===43||_===45||_===46||qr(_)?(i=1,c(_)):p(_)}function c(_){return _===58?(e.consume(_),i=0,f):(_===43||_===45||_===46||qr(_))&&i++<32?(e.consume(_),c):(i=0,p(_))}function f(_){return _===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(_),e.exit("autolinkMarker"),e.exit("autolink"),t):_===null||_===32||_===60||F0(_)?n(_):(e.consume(_),f)}function p(_){return _===64?(e.consume(_),m):P8(_)?(e.consume(_),p):n(_)}function m(_){return qr(_)?g(_):n(_)}function g(_){return _===46?(e.consume(_),i=0,m):_===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(_),e.exit("autolinkMarker"),e.exit("autolink"),t):b(_)}function b(_){if((_===45||qr(_))&&i++<63){const S=_===45?b:g;return e.consume(_),S}return n(_)}}const cg={partial:!0,tokenize:J8};function J8(e,t,n){return i;function i(s){return Lt(s)?Wt(e,r,"linePrefix")(s):r(s)}function r(s){return s===null||lt(s)?t(s):n(s)}}const oR={continuation:{tokenize:tI},exit:nI,name:"blockQuote",tokenize:eI};function eI(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 tI(e,t,n){const i=this;return r;function r(l){return Lt(l)?Wt(e,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return e.attempt(oR,t,n)(l)}}function nI(e){e.exit("blockQuote")}const cR={name:"characterEscape",tokenize:iI};function iI(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 q8(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const uR={name:"characterReference",tokenize:rI};function rI(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=qr,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=F8,m):(e.enter("characterReferenceValue"),s=7,l=M1,m(g))}function m(g){if(g===59&&r){const b=e.exit("characterReferenceValue");return l===qr&&!z_(i.sliceSerialize(b))?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 O2={partial:!0,tokenize:sI},D2={concrete:!0,name:"codeFenced",tokenize:aI};function aI(e,t,n){const i=this,r={partial:!0,tokenize:L};let s=0,l=0,c;return f;function f(D){return p(D)}function p(D){const F=i.events[i.events.length-1];return s=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[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)?Wt(e,g,"whitespace")(D):g(D))}function g(D){return D===null||lt(D)?(e.exit("codeFencedFence"),i.interrupt?t(D):e.check(O2,A,z)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(D))}function b(D){return D===null||lt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(D)):Lt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Wt(e,_,"whitespace")(D)):D===96&&D===c?n(D):(e.consume(D),b)}function _(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,z,T)(D)}function T(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),C}function C(D){return s>0&&Lt(D)?Wt(e,N,"linePrefix",s+1)(D):N(D)}function N(D){return D===null||lt(D)?e.check(O2,A,z)(D):(e.enter("codeFlowValue"),R(D))}function R(D){return D===null||lt(D)?(e.exit("codeFlowValue"),N(D)):(e.consume(D),R)}function z(D){return e.exit("codeFenced"),t(D)}function L(D,F,Z){let K=0;return V;function V(W){return D.enter("lineEnding"),D.consume(W),D.exit("lineEnding"),P}function P(W){return D.enter("codeFencedFence"),Lt(W)?Wt(D,G,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):G(W)}function G(W){return W===c?(D.enter("codeFencedFenceSequence"),ne(W)):Z(W)}function ne(W){return W===c?(K++,D.consume(W),ne):K>=l?(D.exit("codeFencedFenceSequence"),Lt(W)?Wt(D,X,"whitespace")(W):X(W)):Z(W)}function X(W){return W===null||lt(W)?(D.exit("codeFencedFence"),F(W)):Z(W)}}}function sI(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 uv={name:"codeIndented",tokenize:oI},lI={partial:!0,tokenize:cI};function oI(e,t,n){const i=this;return r;function r(p){return e.enter("codeIndented"),Wt(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(lI,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 cI(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):Wt(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 uI={name:"codeText",previous:fI,resolve:dI,tokenize:hI};function dI(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 fI(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function hI(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 pI{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&&pm(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),pm(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),pm(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);pm(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);pm(this.left,n.reverse())}}}function pm(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 dR(e){const t={};let n=-1,i,r,s,l,c,f,p;const m=new pI(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,mI(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 us(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!p}function mI(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,b=-1,_=n,S=0,A=0;const T=[A];for(;_;){for(;e.get(++r)[1]!==_;);s.push(r),_._tokenizer||(m=i.sliceStream(_),_.next||m.push(null),g&&l.defineSkip(_.start),_._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),_._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),g=_,_=_.next}for(_=n;++b<c.length;)c[b][0]==="exit"&&c[b-1][0]==="enter"&&c[b][1].type===c[b-1][1].type&&c[b][1].start.line!==c[b][1].end.line&&(A=b+1,T.push(A),_._tokenizer=void 0,_.previous=void 0,_=_.next);for(l.events=[],_?(_._tokenizer=void 0,_.previous=void 0):T.pop(),b=T.length;b--;){const C=c.slice(T[b],T[b+1]),N=s.pop();f.push([N,N+C.length-1]),e.splice(N,2,C)}for(f.reverse(),b=-1;++b<f.length;)p[S+f[b][0]]=S+f[b][1],S+=f[b][1]-f[b][0]-1;return p}const gI={resolve:xI,tokenize:bI},yI={partial:!0,tokenize:vI};function xI(e){return dR(e),e}function bI(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(yI,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 vI(e,t,n){const i=this;return r;function r(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Wt(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 fR(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),b):C===null||C===32||C===41||F0(C)?n(C):(e.enter(i),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),A(C))}function b(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"}),_(C))}function _(C){return C===62?(e.exit("chunkString"),e.exit(c),b(C)):C===null||C===60||lt(C)?n(C):(e.consume(C),C===92?S:_)}function S(C){return C===60||C===62||C===92?(e.consume(C),_):_(C)}function A(C){return!m&&(C===null||C===41||Bn(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||F0(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 hR(e,t,n,i,r,s){const l=this;let c=0,f;return p;function p(_){return e.enter(i),e.enter(r),e.consume(_),e.exit(r),e.enter(s),m}function m(_){return c>999||_===null||_===91||_===93&&!f||_===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(_):_===93?(e.exit(s),e.enter(r),e.consume(_),e.exit(r),e.exit(i),t):lt(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),g(_))}function g(_){return _===null||_===91||_===93||lt(_)||c++>999?(e.exit("chunkString"),m(_)):(e.consume(_),f||(f=!Lt(_)),_===92?b:g)}function b(_){return _===91||_===92||_===93?(e.consume(_),c++,g):g(_)}}function pR(e,t,n,i,r,s){let l;return c;function c(b){return b===34||b===39||b===40?(e.enter(i),e.enter(r),e.consume(b),e.exit(r),l=b===40?41:b,f):n(b)}function f(b){return b===l?(e.enter(r),e.consume(b),e.exit(r),e.exit(i),t):(e.enter(s),p(b))}function p(b){return b===l?(e.exit(s),f(l)):b===null?n(b):lt(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Wt(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===l||b===null||lt(b)?(e.exit("chunkString"),p(b)):(e.consume(b),b===92?g:m)}function g(b){return b===l||b===92?(e.consume(b),m):m(b)}}function zm(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)?Wt(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const _I={name:"definition",tokenize:EI},SI={partial:!0,tokenize:wI};function EI(e,t,n){const i=this;let r;return s;function s(_){return e.enter("definition"),l(_)}function l(_){return hR.call(i,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(_)}function c(_){return r=Al(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),_===58?(e.enter("definitionMarker"),e.consume(_),e.exit("definitionMarker"),f):n(_)}function f(_){return Bn(_)?zm(e,p)(_):p(_)}function p(_){return fR(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(_)}function m(_){return e.attempt(SI,g,g)(_)}function g(_){return Lt(_)?Wt(e,b,"whitespace")(_):b(_)}function b(_){return _===null||lt(_)?(e.exit("definition"),i.parser.defined.push(r),t(_)):n(_)}}function wI(e,t,n){return i;function i(c){return Bn(c)?zm(e,r)(c):n(c)}function r(c){return pR(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return Lt(c)?Wt(e,l,"whitespace")(c):l(c)}function l(c){return c===null||lt(c)?t(c):n(c)}}const TI={name:"hardBreakEscape",tokenize:CI};function CI(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 AI={name:"headingAtx",resolve:MI,tokenize:RI};function MI(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"},us(e,i,n-i+1,[["enter",r,t],["enter",s,t],["exit",s,t],["exit",r,t]])),e}function RI(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||Bn(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)?Wt(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||Bn(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),p)}}const kI=["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"],z2=["pre","script","style","textarea"],NI={concrete:!0,name:"htmlFlow",resolveTo:zI,tokenize:jI},OI={partial:!0,tokenize:BI},DI={partial:!0,tokenize:LI};function zI(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 jI(e,t,n){const i=this;let r,s,l,c,f;return p;function p(q){return m(q)}function m(q){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(q),g}function g(q){return q===33?(e.consume(q),b):q===47?(e.consume(q),s=!0,A):q===63?(e.consume(q),r=3,i.interrupt?t:H):xa(q)?(e.consume(q),l=String.fromCharCode(q),T):n(q)}function b(q){return q===45?(e.consume(q),r=2,_):q===91?(e.consume(q),r=5,c=0,S):xa(q)?(e.consume(q),r=4,i.interrupt?t:H):n(q)}function _(q){return q===45?(e.consume(q),i.interrupt?t:H):n(q)}function S(q){const oe="CDATA[";return q===oe.charCodeAt(c++)?(e.consume(q),c===oe.length?i.interrupt?t:G:S):n(q)}function A(q){return xa(q)?(e.consume(q),l=String.fromCharCode(q),T):n(q)}function T(q){if(q===null||q===47||q===62||Bn(q)){const oe=q===47,ie=l.toLowerCase();return!oe&&!s&&z2.includes(ie)?(r=1,i.interrupt?t(q):G(q)):kI.includes(l.toLowerCase())?(r=6,oe?(e.consume(q),C):i.interrupt?t(q):G(q)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(q):s?N(q):R(q))}return q===45||qr(q)?(e.consume(q),l+=String.fromCharCode(q),T):n(q)}function C(q){return q===62?(e.consume(q),i.interrupt?t:G):n(q)}function N(q){return Lt(q)?(e.consume(q),N):V(q)}function R(q){return q===47?(e.consume(q),V):q===58||q===95||xa(q)?(e.consume(q),z):Lt(q)?(e.consume(q),R):V(q)}function z(q){return q===45||q===46||q===58||q===95||qr(q)?(e.consume(q),z):L(q)}function L(q){return q===61?(e.consume(q),D):Lt(q)?(e.consume(q),L):R(q)}function D(q){return q===null||q===60||q===61||q===62||q===96?n(q):q===34||q===39?(e.consume(q),f=q,F):Lt(q)?(e.consume(q),D):Z(q)}function F(q){return q===f?(e.consume(q),f=null,K):q===null||lt(q)?n(q):(e.consume(q),F)}function Z(q){return q===null||q===34||q===39||q===47||q===60||q===61||q===62||q===96||Bn(q)?L(q):(e.consume(q),Z)}function K(q){return q===47||q===62||Lt(q)?R(q):n(q)}function V(q){return q===62?(e.consume(q),P):n(q)}function P(q){return q===null||lt(q)?G(q):Lt(q)?(e.consume(q),P):n(q)}function G(q){return q===45&&r===2?(e.consume(q),O):q===60&&r===1?(e.consume(q),Y):q===62&&r===4?(e.consume(q),I):q===63&&r===3?(e.consume(q),H):q===93&&r===5?(e.consume(q),Q):lt(q)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(OI,J,ne)(q)):q===null||lt(q)?(e.exit("htmlFlowData"),ne(q)):(e.consume(q),G)}function ne(q){return e.check(DI,X,J)(q)}function X(q){return e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),W}function W(q){return q===null||lt(q)?ne(q):(e.enter("htmlFlowData"),G(q))}function O(q){return q===45?(e.consume(q),H):G(q)}function Y(q){return q===47?(e.consume(q),l="",$):G(q)}function $(q){if(q===62){const oe=l.toLowerCase();return z2.includes(oe)?(e.consume(q),I):G(q)}return xa(q)&&l.length<8?(e.consume(q),l+=String.fromCharCode(q),$):G(q)}function Q(q){return q===93?(e.consume(q),H):G(q)}function H(q){return q===62?(e.consume(q),I):q===45&&r===2?(e.consume(q),H):G(q)}function I(q){return q===null||lt(q)?(e.exit("htmlFlowData"),J(q)):(e.consume(q),I)}function J(q){return e.exit("htmlFlow"),t(q)}}function LI(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 BI(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(cg,t,n)}}const II={name:"htmlText",tokenize:UI};function UI(e,t,n){const i=this;let r,s,l;return c;function c(H){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(H),f}function f(H){return H===33?(e.consume(H),p):H===47?(e.consume(H),L):H===63?(e.consume(H),R):xa(H)?(e.consume(H),Z):n(H)}function p(H){return H===45?(e.consume(H),m):H===91?(e.consume(H),s=0,S):xa(H)?(e.consume(H),N):n(H)}function m(H){return H===45?(e.consume(H),_):n(H)}function g(H){return H===null?n(H):H===45?(e.consume(H),b):lt(H)?(l=g,Y(H)):(e.consume(H),g)}function b(H){return H===45?(e.consume(H),_):g(H)}function _(H){return H===62?O(H):H===45?b(H):g(H)}function S(H){const I="CDATA[";return H===I.charCodeAt(s++)?(e.consume(H),s===I.length?A:S):n(H)}function A(H){return H===null?n(H):H===93?(e.consume(H),T):lt(H)?(l=A,Y(H)):(e.consume(H),A)}function T(H){return H===93?(e.consume(H),C):A(H)}function C(H){return H===62?O(H):H===93?(e.consume(H),C):A(H)}function N(H){return H===null||H===62?O(H):lt(H)?(l=N,Y(H)):(e.consume(H),N)}function R(H){return H===null?n(H):H===63?(e.consume(H),z):lt(H)?(l=R,Y(H)):(e.consume(H),R)}function z(H){return H===62?O(H):R(H)}function L(H){return xa(H)?(e.consume(H),D):n(H)}function D(H){return H===45||qr(H)?(e.consume(H),D):F(H)}function F(H){return lt(H)?(l=F,Y(H)):Lt(H)?(e.consume(H),F):O(H)}function Z(H){return H===45||qr(H)?(e.consume(H),Z):H===47||H===62||Bn(H)?K(H):n(H)}function K(H){return H===47?(e.consume(H),O):H===58||H===95||xa(H)?(e.consume(H),V):lt(H)?(l=K,Y(H)):Lt(H)?(e.consume(H),K):O(H)}function V(H){return H===45||H===46||H===58||H===95||qr(H)?(e.consume(H),V):P(H)}function P(H){return H===61?(e.consume(H),G):lt(H)?(l=P,Y(H)):Lt(H)?(e.consume(H),P):K(H)}function G(H){return H===null||H===60||H===61||H===62||H===96?n(H):H===34||H===39?(e.consume(H),r=H,ne):lt(H)?(l=G,Y(H)):Lt(H)?(e.consume(H),G):(e.consume(H),X)}function ne(H){return H===r?(e.consume(H),r=void 0,W):H===null?n(H):lt(H)?(l=ne,Y(H)):(e.consume(H),ne)}function X(H){return H===null||H===34||H===39||H===60||H===61||H===96?n(H):H===47||H===62||Bn(H)?K(H):(e.consume(H),X)}function W(H){return H===47||H===62||Bn(H)?K(H):n(H)}function O(H){return H===62?(e.consume(H),e.exit("htmlTextData"),e.exit("htmlText"),t):n(H)}function Y(H){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),$}function $(H){return Lt(H)?Wt(e,Q,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):Q(H)}function Q(H){return e.enter("htmlTextData"),l(H)}}const j_={name:"labelEnd",resolveAll:qI,resolveTo:GI,tokenize:YI},HI={tokenize:VI},PI={tokenize:XI},FI={tokenize:KI};function qI(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&&us(e,0,e.length,n),e}function GI(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=Hs(c,e.slice(s+1,s+i+3)),c=Hs(c,[["enter",m,t]]),c=Hs(c,gx(t.parser.constructs.insideSpan.null,e.slice(s+i+4,l-3),t)),c=Hs(c,[["exit",m,t],e[l-2],e[l-1],["exit",p,t]]),c=Hs(c,e.slice(l+1)),c=Hs(c,[["exit",f,t]]),us(e,s,e.length,c),e}function YI(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(b){return s?s._inactive?g(b):(l=i.parser.defined.includes(Al(i.sliceSerialize({start:s.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),f):n(b)}function f(b){return b===40?e.attempt(HI,m,l?m:g)(b):b===91?e.attempt(PI,m,l?p:g)(b):l?m(b):g(b)}function p(b){return e.attempt(FI,m,g)(b)}function m(b){return t(b)}function g(b){return s._balanced=!0,n(b)}}function VI(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 Bn(g)?zm(e,s)(g):s(g)}function s(g){return g===41?m(g):fR(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function l(g){return Bn(g)?zm(e,f)(g):m(g)}function c(g){return n(g)}function f(g){return g===34||g===39||g===40?pR(e,p,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):m(g)}function p(g){return Bn(g)?zm(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 XI(e,t,n){const i=this;return r;function r(c){return hR.call(i,e,s,l,"reference","referenceMarker","referenceString")(c)}function s(c){return i.parser.defined.includes(Al(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function KI(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 WI={name:"labelStartImage",resolveAll:j_.resolveAll,tokenize:$I};function $I(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 QI={name:"labelStartLink",resolveAll:j_.resolveAll,tokenize:ZI};function ZI(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 dv={name:"lineEnding",tokenize:JI};function JI(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Wt(e,t,"linePrefix")}}const C0={name:"thematicBreak",tokenize:eU};function eU(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)?Wt(e,c,"whitespace")(p):c(p))}}const za={continuation:{tokenize:rU},exit:sU,name:"list",tokenize:iU},tU={partial:!0,tokenize:lU},nU={partial:!0,tokenize:aU};function iU(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(_){const S=i.containerState.type||(_===42||_===43||_===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!i.containerState.marker||_===i.containerState.marker:M1(_)){if(i.containerState.type||(i.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),_===42||_===45?e.check(C0,n,p)(_):p(_);if(!i.interrupt||_===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(_)}return n(_)}function f(_){return M1(_)&&++l<10?(e.consume(_),f):(!i.interrupt||l<2)&&(i.containerState.marker?_===i.containerState.marker:_===41||_===46)?(e.exit("listItemValue"),p(_)):n(_)}function p(_){return e.enter("listItemMarker"),e.consume(_),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||_,e.check(cg,i.interrupt?n:m,e.attempt(tU,b,g))}function m(_){return i.containerState.initialBlankLine=!0,s++,b(_)}function g(_){return Lt(_)?(e.enter("listItemPrefixWhitespace"),e.consume(_),e.exit("listItemPrefixWhitespace"),b):n(_)}function b(_){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(_)}}function rU(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(cg,r,s);function r(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Wt(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(nU,t,l)(c))}function l(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,Wt(e,e.attempt(za,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function aU(e,t,n){const i=this;return Wt(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 sU(e){e.exit(this.containerState.type)}function lU(e,t,n){const i=this;return Wt(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 j2={name:"setextUnderline",resolveTo:oU,tokenize:cU};function oU(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 cU(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)?Wt(e,f,"lineSuffix")(p):f(p))}function f(p){return p===null||lt(p)?(e.exit("setextHeadingLine"),t(p)):n(p)}}const uU={tokenize:dU};function dU(e){const t=this,n=e.attempt(cg,i,e.attempt(this.parser.constructs.flowInitial,r,Wt(e,e.attempt(this.parser.constructs.flow,r,e.attempt(gI,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 fU={resolveAll:gR()},hU=mR("string"),pU=mR("text");function mR(e){return{resolveAll:gR(e==="text"?mU: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 b=-1;if(g)for(;++b<g.length;){const _=g[b];if(!_.previous||_.previous.call(i,i.previous))return!0}return!1}}}function gR(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 mU(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 gU={42:za,43:za,45:za,48:za,49:za,50:za,51:za,52:za,53:za,54:za,55:za,56:za,57:za,62:oR},yU={91:_I},xU={[-2]:uv,[-1]:uv,32:uv},bU={35:AI,42:C0,45:[j2,C0],60:NI,61:j2,95:C0,96:D2,126:D2},vU={38:uR,92:cR},_U={[-5]:dv,[-4]:dv,[-3]:dv,33:WI,38:uR,42:R1,60:[Q8,II],91:QI,92:[TI,cR],93:j_,95:R1,96:uI},SU={null:[R1,fU]},EU={null:[42,95]},wU={null:[]},TU=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:EU,contentInitial:yU,disable:wU,document:gU,flow:bU,flowInitial:xU,insideSpan:SU,string:vU,text:_U},Symbol.toStringTag,{value:"Module"}));function CU(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:F(L),check:F(D),consume:N,enter:R,exit:z,interrupt:F(D,{interrupt:!0})},p={code:null,containerState:{},defineSkip:A,events:[],now:S,parser:e,previous:null,sliceSerialize:b,sliceStream:_,write:g};let m=t.tokenize.call(p,f);return t.resolveAll&&s.push(t),p;function g(P){return l=Hs(l,P),T(),l[l.length-1]!==null?[]:(Z(t,0),p.events=gx(s,p.events,p),p.events)}function b(P,G){return MU(_(P),G)}function _(P){return AU(l,P)}function S(){const{_bufferIndex:P,_index:G,line:ne,column:X,offset:W}=i;return{_bufferIndex:P,_index:G,line:ne,column:X,offset:W}}function A(P){r[P.line]=P.column,V()}function T(){let P;for(;i._index<l.length;){const G=l[i._index];if(typeof G=="string")for(P=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===P&&i._bufferIndex<G.length;)C(G.charCodeAt(i._bufferIndex));else C(G)}}function C(P){m=m(P)}function N(P){lt(P)?(i.line++,i.column=1,i.offset+=P===-3?2:1,V()):P!==-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=P}function R(P,G){const ne=G||{};return ne.type=P,ne.start=S(),p.events.push(["enter",ne,p]),c.push(ne),ne}function z(P){const G=c.pop();return G.end=S(),p.events.push(["exit",G,p]),G}function L(P,G){Z(P,G.from)}function D(P,G){G.restore()}function F(P,G){return ne;function ne(X,W,O){let Y,$,Q,H;return Array.isArray(X)?J(X):"tokenize"in X?J([X]):I(X);function I(de){return me;function me(ge){const le=ge!==null&&de[ge],Re=ge!==null&&de.null,Le=[...Array.isArray(le)?le:le?[le]:[],...Array.isArray(Re)?Re:Re?[Re]:[]];return J(Le)(ge)}}function J(de){return Y=de,$=0,de.length===0?O:q(de[$])}function q(de){return me;function me(ge){return H=K(),Q=de,de.partial||(p.currentConstruct=de),de.name&&p.parser.constructs.disable.null.includes(de.name)?ie():de.tokenize.call(G?Object.assign(Object.create(p),G):p,f,oe,ie)(ge)}}function oe(de){return P(Q,H),W}function ie(de){return H.restore(),++$<Y.length?q(Y[$]):O}}}function Z(P,G){P.resolveAll&&!s.includes(P)&&s.push(P),P.resolve&&us(p.events,G,p.events.length-G,P.resolve(p.events.slice(G),p)),P.resolveTo&&(p.events=P.resolveTo(p.events,p))}function K(){const P=S(),G=p.previous,ne=p.currentConstruct,X=p.events.length,W=Array.from(c);return{from:X,restore:O};function O(){i=P,p.previous=G,p.currentConstruct=ne,p.events.length=X,c=W,V()}}function V(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function AU(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 MU(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 RU(e){const i={constructs:sR([TU,...(e||{}).extensions||[]]),content:r(G8),defined:[],document:r(V8),flow:r(uU),lazy:{},string:r(hU),text:r(pU)};return i;function r(s){return l;function l(c){return CU(i,s,c)}}}function kU(e){for(;!dR(e););return e}const L2=/[\0\t\n\r]/g;function NU(){let e=1,t="",n=!0,i;return r;function r(s,l,c){const f=[];let p,m,g,b,_;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(L2.lastIndex=g,p=L2.exec(s),b=p&&p.index!==void 0?p.index:s.length,_=s.charCodeAt(b),!p){t=s.slice(g);break}if(_===10&&g===b&&i)f.push(-3),i=void 0;else switch(i&&(f.push(-5),i=void 0),g<b&&(f.push(s.slice(g,b)),e+=b-g),_){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=b+1}return c&&(i&&f.push(-5),t&&f.push(t),f.push(null)),f}}const OU=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function DU(e){return e.replace(OU,zU)}function zU(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),s=r===120||r===88;return lR(n.slice(s?2:1),s?16:10)}return z_(n)||e}const yR={}.hasOwnProperty;function jU(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),LU(n)(kU(RU(n).document().write(NU()(e,t,!0))))}function LU(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(En),autolinkProtocol:K,autolinkEmail:K,atxHeading:s(ot),blockQuote:s(Re),characterEscape:K,characterReference:K,codeFenced:s(Le),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(Le,l),codeText:s(Be,l),codeTextData:K,data:K,codeFlowValue:K,definition:s(He),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(Qe),hardBreakEscape:s(Ue),hardBreakTrailing:s(Ue),htmlFlow:s(wt,l),htmlFlowData:K,htmlText:s(wt,l),htmlTextData:K,image:s(Sn),label:l,link:s(En),listItem:s(ui),listItemValue:b,listOrdered:s(pn,g),listUnordered:s(pn),paragraph:s(Yr),reference:q,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(ot),strong:s(ki),thematicBreak:s(ur)},exit:{atxHeading:f(),atxHeadingSequence:L,autolink:f(),autolinkEmail:le,autolinkProtocol:ge,blockQuote:f(),characterEscapeValue:V,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:de,characterReference:me,codeFenced:f(T),codeFencedFence:A,codeFencedFenceInfo:_,codeFencedFenceMeta:S,codeFlowValue:V,codeIndented:f(C),codeText:f(W),codeTextData:V,data:V,definition:f(),definitionDestinationString:z,definitionLabelString:N,definitionTitleString:R,emphasis:f(),hardBreakEscape:f(G),hardBreakTrailing:f(G),htmlFlow:f(ne),htmlFlowData:V,htmlText:f(X),htmlTextData:V,image:f(Y),label:Q,labelText:$,lineEnding:P,link:f(O),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:oe,resourceDestinationString:H,resourceTitleString:I,resource:J,setextHeading:f(Z),setextHeadingLineSequence:F,setextHeadingText:D,strong:f(),thematicBreak:f()}};xR(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(Ee){let ke={type:"root",children:[]};const ce={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 nn=Pe.pop();ct=r(Ee,nn,ct)}for(ct=-1;++ct<Ee.length;){const nn=t[Ee[ct][0]];yR.call(nn,Ee[ct][1].type)&&nn[Ee[ct][1].type].call(Object.assign({sliceSerialize:Ee[ct][2].sliceSerialize},ce),Ee[ct][1])}if(ce.tokenStack.length>0){const nn=ce.tokenStack[ce.tokenStack.length-1];(nn[1]||B2).call(ce,void 0,nn[0])}for(ke.position={start:su(Ee.length>0?Ee[0][1].start:{line:1,column:1,offset:0}),end:su(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,ce){let Pe=ke-1,ct=-1,nn=!1,di,Zt,Jt,Gn;for(;++Pe<=ce;){const Ft=Ee[Pe];switch(Ft[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ft[0]==="enter"?ct++:ct--,Gn=void 0;break}case"lineEndingBlank":{Ft[0]==="enter"&&(di&&!Gn&&!ct&&!Jt&&(Jt=Pe),Gn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Gn=void 0}if(!ct&&Ft[0]==="enter"&&Ft[1].type==="listItemPrefix"||ct===-1&&Ft[0]==="exit"&&(Ft[1].type==="listUnordered"||Ft[1].type==="listOrdered")){if(di){let Wi=Pe;for(Zt=void 0;Wi--;){const ti=Ee[Wi];if(ti[1].type==="lineEnding"||ti[1].type==="lineEndingBlank"){if(ti[0]==="exit")continue;Zt&&(Ee[Zt][1].type="lineEndingBlank",nn=!0),ti[1].type="lineEnding",Zt=Wi}else if(!(ti[1].type==="linePrefix"||ti[1].type==="blockQuotePrefix"||ti[1].type==="blockQuotePrefixWhitespace"||ti[1].type==="blockQuoteMarker"||ti[1].type==="listItemIndent"))break}Jt&&(!Zt||Jt<Zt)&&(di._spread=!0),di.end=Object.assign({},Zt?Ee[Zt][1].start:Ft[1].end),Ee.splice(Zt||Pe,0,["exit",di,Ft[2]]),Pe++,ce++}if(Ft[1].type==="listItemPrefix"){const Wi={type:"listItem",_spread:!1,start:Object.assign({},Ft[1].start),end:void 0};di=Wi,Ee.splice(Pe,0,["enter",Wi,Ft[2]]),Pe++,ce++,Jt=void 0,Gn=!0}}}return Ee[ke][1]._spread=nn,ce}function s(Ee,ke){return ce;function ce(Pe){c.call(this,Ee(Pe),Pe),ke&&ke.call(this,Pe)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(Ee,ke,ce){this.stack[this.stack.length-1].children.push(Ee),this.stack.push(Ee),this.tokenStack.push([ke,ce||void 0]),Ee.position={start:su(ke.start),end:void 0}}function f(Ee){return ke;function ke(ce){Ee&&Ee.call(this,ce),p.call(this,ce)}}function p(Ee,ke){const ce=this.stack.pop(),Pe=this.tokenStack.pop();if(Pe)Pe[0].type!==Ee.type&&(ke?ke.call(this,Ee,Pe[0]):(Pe[1]||B2).call(this,Ee,Pe[0]));else throw new Error("Cannot close `"+Ee.type+"` ("+Dm({start:Ee.start,end:Ee.end})+"): it’s not open");ce.position.end=su(Ee.end)}function m(){return D_(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function b(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 _(){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(),ce=this.stack[this.stack.length-1];ce.label=ke,ce.identifier=Al(this.sliceSerialize(Ee)).toLowerCase()}function R(){const Ee=this.resume(),ke=this.stack[this.stack.length-1];ke.title=Ee}function z(){const Ee=this.resume(),ke=this.stack[this.stack.length-1];ke.url=Ee}function L(Ee){const ke=this.stack[this.stack.length-1];if(!ke.depth){const ce=this.sliceSerialize(Ee).length;ke.depth=ce}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function F(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 K(Ee){const ce=this.stack[this.stack.length-1].children;let Pe=ce[ce.length-1];(!Pe||Pe.type!=="text")&&(Pe=Qt(),Pe.position={start:su(Ee.start),end:void 0},ce.push(Pe)),this.stack.push(Pe)}function V(Ee){const ke=this.stack.pop();ke.value+=this.sliceSerialize(Ee),ke.position.end=su(Ee.end)}function P(Ee){const ke=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ce=ke.children[ke.children.length-1];ce.position.end=su(Ee.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ke.type)&&(K.call(this,Ee),V.call(this,Ee))}function G(){this.data.atHardBreak=!0}function ne(){const Ee=this.resume(),ke=this.stack[this.stack.length-1];ke.value=Ee}function X(){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 O(){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 Y(){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 $(Ee){const ke=this.sliceSerialize(Ee),ce=this.stack[this.stack.length-2];ce.label=DU(ke),ce.identifier=Al(ke).toLowerCase()}function Q(){const Ee=this.stack[this.stack.length-1],ke=this.resume(),ce=this.stack[this.stack.length-1];if(this.data.inReference=!0,ce.type==="link"){const Pe=Ee.children;ce.children=Pe}else ce.alt=ke}function H(){const Ee=this.resume(),ke=this.stack[this.stack.length-1];ke.url=Ee}function I(){const Ee=this.resume(),ke=this.stack[this.stack.length-1];ke.title=Ee}function J(){this.data.inReference=void 0}function q(){this.data.referenceType="collapsed"}function oe(Ee){const ke=this.resume(),ce=this.stack[this.stack.length-1];ce.label=ke,ce.identifier=Al(this.sliceSerialize(Ee)).toLowerCase(),this.data.referenceType="full"}function ie(Ee){this.data.characterReferenceType=Ee.type}function de(Ee){const ke=this.sliceSerialize(Ee),ce=this.data.characterReferenceType;let Pe;ce?(Pe=lR(ke,ce==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Pe=z_(ke);const ct=this.stack[this.stack.length-1];ct.value+=Pe}function me(Ee){const ke=this.stack.pop();ke.position.end=su(Ee.end)}function ge(Ee){V.call(this,Ee);const ke=this.stack[this.stack.length-1];ke.url=this.sliceSerialize(Ee)}function le(Ee){V.call(this,Ee);const ke=this.stack[this.stack.length-1];ke.url="mailto:"+this.sliceSerialize(Ee)}function Re(){return{type:"blockquote",children:[]}}function Le(){return{type:"code",lang:null,meta:null,value:""}}function Be(){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 Sn(){return{type:"image",title:null,url:"",alt:null}}function En(){return{type:"link",title:null,url:"",children:[]}}function pn(Ee){return{type:"list",ordered:Ee.type==="listOrdered",start:null,spread:Ee._spread,children:[]}}function ui(Ee){return{type:"listItem",spread:Ee._spread,checked:null,children:[]}}function Yr(){return{type:"paragraph",children:[]}}function ki(){return{type:"strong",children:[]}}function Qt(){return{type:"text",value:""}}function ur(){return{type:"thematicBreak"}}}function su(e){return{line:e.line,column:e.column,offset:e.offset}}function xR(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?xR(e,i):BU(e,i)}}function BU(e,t){let n;for(n in t)if(yR.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 B2(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Dm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Dm({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Dm({start:t.start,end:t.end})+") is still open")}function IU(e){const t=this;t.parser=n;function n(i){return jU(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function UU(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 HU(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
348
+ `}]}function PU(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 FU(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qU(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GU(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=Oh(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 YU(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 VU(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function bR(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 XU(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return bR(e,t);const r={src:Oh(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 KU(e,t){const n={src:Oh(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 WU(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 $U(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return bR(e,t);const r={href:Oh(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 QU(e,t){const n={href:Oh(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 ZU(e,t,n){const i=e.all(t),r=n?JU(n):vR(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 JU(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=vR(n[i])}return t}function vR(e){const t=e.spread;return t??e.children.length>1}function eH(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 tH(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nH(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function iH(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rH(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=R_(t.children[1]),f=JM(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 aH(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],b={},_=l?l[f]:void 0;_&&(b.align=_);let S={type:"element",tagName:s,properties:b,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 sH(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const I2=9,U2=32;function lH(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),r=0;const s=[];for(;i;)s.push(H2(t.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return s.push(H2(t.slice(r),r>0,!1)),s.join("")}function H2(e,t,n){let i=0,r=e.length;if(t){let s=e.codePointAt(i);for(;s===I2||s===U2;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(r-1);for(;s===I2||s===U2;)r--,s=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function oH(e,t){const n={type:"text",value:lH(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function cH(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const uH={blockquote:UU,break:HU,code:PU,delete:FU,emphasis:qU,footnoteReference:GU,heading:YU,html:VU,imageReference:XU,image:KU,inlineCode:WU,linkReference:$U,link:QU,listItem:ZU,list:eH,paragraph:tH,root:nH,strong:iH,table:rH,tableCell:sH,tableRow:aH,text:oH,thematicBreak:cH,toml:n0,yaml:n0,definition:n0,footnoteDefinition:n0};function n0(){}const _R=-1,yx=0,jm=1,q0=2,L_=3,B_=4,I_=5,U_=6,SR=7,ER=8,P2=typeof self=="object"?self:globalThis,dH=(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 yx:case _R:return n(l,r);case jm:{const c=n([],r);for(const f of l)c.push(i(f));return c}case q0:{const c=n({},r);for(const[f,p]of l)c[i(f)]=i(p);return c}case L_:return n(new Date(l),r);case B_:{const{source:c,flags:f}=l;return n(new RegExp(c,f),r)}case I_:{const c=n(new Map,r);for(const[f,p]of l)c.set(i(f),i(p));return c}case U_:{const c=n(new Set,r);for(const f of l)c.add(i(f));return c}case SR:{const{name:c,message:f}=l;return n(new P2[c](f),r)}case ER: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 P2[s](l),r)};return i},F2=e=>dH(new Map,e)(0),Xf="",{toString:fH}={},{keys:hH}=Object,mm=e=>{const t=typeof e;if(t!=="object"||!e)return[yx,t];const n=fH.call(e).slice(8,-1);switch(n){case"Array":return[jm,Xf];case"Object":return[q0,Xf];case"Date":return[L_,Xf];case"RegExp":return[B_,Xf];case"Map":return[I_,Xf];case"Set":return[U_,Xf];case"DataView":return[jm,n]}return n.includes("Array")?[jm,n]:n.includes("Error")?[SR,n]:[q0,n]},i0=([e,t])=>e===yx&&(t==="function"||t==="symbol"),pH=(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]=mm(l);switch(c){case yx:{let m=l;switch(f){case"bigint":c=ER,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);m=null;break;case"undefined":return r([_R],l)}return r([c,m],l)}case jm:{if(f){let b=l;return f==="DataView"?b=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(b=new Uint8Array(l)),r([f,[...b]],l)}const m=[],g=r([c,m],l);for(const b of l)m.push(s(b));return g}case q0:{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 b of hH(l))(e||!i0(mm(l[b])))&&m.push([s(b),s(l[b])]);return g}case L_:return r([c,l.toISOString()],l);case B_:{const{source:m,flags:g}=l;return r([c,{source:m,flags:g}],l)}case I_:{const m=[],g=r([c,m],l);for(const[b,_]of l)(e||!(i0(mm(b))||i0(mm(_))))&&m.push([s(b),s(_)]);return g}case U_:{const m=[],g=r([c,m],l);for(const b of l)(e||!i0(mm(b)))&&m.push(s(b));return g}}const{message:p}=l;return r([c,{name:f,message:p}],l)};return s},q2=(e,{json:t,lossy:n}={})=>{const i=[];return pH(!(t||n),!!t,new Map,i)(e),i},G0=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?F2(q2(e,t)):structuredClone(e):(e,t)=>F2(q2(e,t));function mH(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 gH(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function yH(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||mH,i=e.options.footnoteBackLabel||gH,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(),b=Oh(g.toLowerCase());let _=0;const S=[],A=e.footnoteCounts.get(g);for(;A!==void 0&&++_<=A;){S.length>0&&S.push({type:"text",value:" "});let N=typeof n=="string"?n:n(f,_);typeof N=="string"&&(N={type:"text",value:N}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(_>1?"-"+_:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(f,_),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-"+b},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:{...G0(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 ug=(function(e){if(e==null)return _H;if(typeof e=="function")return xx(e);if(typeof e=="object")return Array.isArray(e)?xH(e):bH(e);if(typeof e=="string")return vH(e);throw new Error("Expected function, string, or object as test")});function xH(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ug(e[n]);return xx(i);function i(...r){let s=-1;for(;++s<t.length;)if(t[s].apply(this,r))return!0;return!1}}function bH(e){const t=e;return xx(n);function n(i){const r=i;let s;for(s in e)if(r[s]!==t[s])return!1;return!0}}function vH(e){return xx(t);function t(n){return n&&n.type===e}}function xx(e){return t;function t(n,i,r){return!!(SH(n)&&e.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function _H(){return!0}function SH(e){return e!==null&&typeof e=="object"&&"type"in e}const wR=[],EH=!0,k1=!1,wH="skip";function TR(e,t,n,i){let r;typeof t=="function"&&typeof n!="function"?(i=n,n=t):r=t;const s=ug(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 _=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(f.type+(_?"<"+_+">":""))+")"})}return b;function b(){let _=wR,S,A,T;if((!t||s(f,p,m[m.length-1]||void 0))&&(_=TH(n(f,m)),_[0]===k1))return _;if("children"in f&&f.children){const C=f;if(C.children&&_[0]!==wH)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]===k1)return S;A=typeof S[1]=="number"?S[1]:A+l}}return _}}}function TH(e){return Array.isArray(e)?e:typeof e=="number"?[EH,e]:e==null?wR:[e]}function bx(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),TR(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 N1={}.hasOwnProperty,CH={};function AH(e,t){const n=t||CH,i=new Map,r=new Map,s=new Map,l={...uH,...n.handlers},c={all:p,applyData:RH,definitionById:i,footnoteById:r,footnoteCounts:s,footnoteOrder:[],handlers:l,one:f,options:n,patch:MH,wrap:NH};return bx(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const g=m.type==="definition"?i:r,b=String(m.identifier).toUpperCase();g.has(b)||g.set(b,m)}}),c;function f(m,g){const b=m.type,_=c.handlers[b];if(N1.call(c.handlers,b)&&_)return _(c,m,g);if(c.options.passThrough&&c.options.passThrough.includes(b)){if("children"in m){const{children:A,...T}=m,C=G0(T);return C.children=c.all(m),C}return G0(m)}return(c.options.unknownHandler||kH)(c,m,g)}function p(m){const g=[];if("children"in m){const b=m.children;let _=-1;for(;++_<b.length;){const S=c.one(b[_],m);if(S){if(_&&b[_-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=G2(S.value)),!Array.isArray(S)&&S.type==="element")){const A=S.children[0];A&&A.type==="text"&&(A.value=G2(A.value))}Array.isArray(S)?g.push(...S):g.push(S)}}}return g}}function MH(e,t){e.position&&(t.position=g8(e))}function RH(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,G0(s)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function kH(e,t){const n=t.data||{},i="value"in t&&!(N1.call(n,"hProperties")||N1.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 NH(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 G2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Y2(e,t){const n=AH(e,t),i=n.one(e,void 0),r=yH(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 OH(e,t){return e&&"run"in e?async function(n,i){const r=Y2(n,{file:i,...t});await e.run(r,i)}:function(n,i){return Y2(n,{file:i,...e||t})}}function V2(e){if(e)throw e}var fv,X2;function DH(){if(X2)return fv;X2=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 b;for(b in p);return typeof b>"u"||e.call(p,b)},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 fv=function f(){var p,m,g,b,_,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),b=c(p,m),A!==b&&(N&&b&&(s(b)||(_=r(b)))?(_?(_=!1,S=g&&r(g)?g:[]):S=g&&s(g)?g:{},l(A,{name:m,newValue:f(N,S,b)})):typeof b<"u"&&l(A,{name:m,newValue:b}));return A},fv}var zH=DH();const hv=xu(zH);function O1(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 jH(){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?LH(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 LH(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 bo={basename:BH,dirname:IH,extname:UH,join:HH,sep:"/"};function BH(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');dg(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 IH(e){if(dg(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 UH(e){dg(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 HH(...e){let t=-1,n;for(;++t<e.length;)dg(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":PH(n)}function PH(e){dg(e);const t=e.codePointAt(0)===47;let n=FH(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function FH(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 dg(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const qH={cwd:GH};function GH(){return"/"}function D1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function YH(e){if(typeof e=="string")e=new URL(e);else if(!D1(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 VH(e)}function VH(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 pv=["history","path","basename","stem","extname","dirname"];class CR{constructor(t){let n;t?D1(t)?n={path:t}:typeof t=="string"||XH(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":qH.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<pv.length;){const s=pv[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)pv.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?bo.basename(this.path):void 0}set basename(t){gv(t,"basename"),mv(t,"basename"),this.path=bo.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?bo.dirname(this.path):void 0}set dirname(t){K2(this.basename,"dirname"),this.path=bo.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?bo.extname(this.path):void 0}set extname(t){if(mv(t,"extname"),K2(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=bo.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){D1(t)&&(t=YH(t)),gv(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?bo.basename(this.path,this.extname):void 0}set stem(t){gv(t,"stem"),mv(t,"stem"),this.path=bo.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 Gr(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 mv(e,t){if(e&&e.includes(bo.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+bo.sep+"`")}function gv(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function K2(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function XH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const KH=(function(e){const i=this.constructor.prototype,r=i[e],s=function(){return r.apply(s,arguments)};return Object.setPrototypeOf(s,i),s}),WH={}.hasOwnProperty;class H_ extends KH{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=jH()}copy(){const t=new H_;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(hv(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(bv("data",this.frozen),this.namespace[t]=n,this):WH.call(this.namespace,t)&&this.namespace[t]||void 0:t?(bv("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=r0(t),i=this.parser||this.Parser;return yv("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),yv("process",this.parser||this.Parser),xv("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(s,l){const c=r0(t),f=i.parse(c);i.run(f,c,function(m,g,b){if(m||!g||!b)return p(m);const _=g,S=i.stringify(_,b);ZH(S)?b.value=S:b.result=S,p(m,b)});function p(m,g){m||!g?l(m):s?s(g):n(void 0,g)}}}processSync(t){let n=!1,i;return this.freeze(),yv("processSync",this.parser||this.Parser),xv("processSync",this.compiler||this.Compiler),this.process(t,r),$2("processSync","process",n),i;function r(s,l){n=!0,V2(s),i=l}}run(t,n,i){W2(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=r0(n);r.run(t,f,p);function p(m,g,b){const _=g||t;m?c(m):l?l(_):i(void 0,_,b)}}}runSync(t,n){let i=!1,r;return this.run(t,n,s),$2("runSync","run",i),r;function s(l,c){V2(l),r=c,i=!0}}stringify(t,n){this.freeze();const i=r0(n),r=this.compiler||this.Compiler;return xv("stringify",r),W2(t),r(t,i)}use(t,...n){const i=this.attachers,r=this.namespace;if(bv("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=hv(!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,b=-1;for(;++g<i.length;)if(i[g][0]===p){b=g;break}if(b===-1)i.push([p,...m]);else if(m.length>0){let[_,...S]=m;const A=i[b][1];O1(A)&&O1(_)&&(_=hv(!0,A,_)),i[b]=[p,_,...S]}}}}const $H=new H_().freeze();function yv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function xv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function bv(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 W2(e){if(!O1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function $2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function r0(e){return QH(e)?e:new CR(e)}function QH(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ZH(e){return typeof e=="string"||JH(e)}function JH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const e7="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Q2=[],Z2={allowDangerousHtml:!0},t7=/^(https?|ircs?|mailto|xmpp)$/i,n7=[{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 i7(e){const t=r7(e),n=a7(e);return s7(t.runSync(t.parse(n),n),e)}function r7(e){const t=e.rehypePlugins||Q2,n=e.remarkPlugins||Q2,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Z2}:Z2;return $H().use(IU).use(n).use(OH,i).use(t)}function a7(e){const t=e.children||"",n=new CR;return typeof t=="string"&&(n.value=t),n}function s7(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,s=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||l7;for(const m of n7)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+e7+m.id,void 0);return bx(e,p),_8(e,{Fragment:x.Fragment,components:r,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function p(m,g,b){if(m.type==="raw"&&b&&typeof g=="number")return l?b.children.splice(g,1):b.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let _;for(_ in cv)if(Object.hasOwn(cv,_)&&Object.hasOwn(m.properties,_)){const S=m.properties[_],A=cv[_];(A===null||A.includes(m.tagName))&&(m.properties[_]=f(String(S||""),_,m))}}if(m.type==="element"){let _=n?!n.includes(m.tagName):s?s.includes(m.tagName):!1;if(!_&&i&&typeof g=="number"&&(_=!i(m,g,b)),_&&b&&typeof g=="number")return c&&m.children?b.children.splice(g,1,...m.children):b.children.splice(g,1),g}}}function l7(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||t7.test(e.slice(0,t))?e:""}function J2(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 o7(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function c7(e,t,n){const r=ug((n||{}).ignore||[]),s=u7(t);let l=-1;for(;++l<s.length;)TR(e,"text",c);function c(p,m){let g=-1,b;for(;++g<m.length;){const _=m[g],S=b?b.children:void 0;if(r(_,S?S.indexOf(_):void 0,b))return;b=_}if(b)return f(p,m)}function f(p,m){const g=m[m.length-1],b=s[l][0],_=s[l][1];let S=0;const T=g.children.indexOf(p);let C=!1,N=[];b.lastIndex=0;let R=b.exec(p.value);for(;R;){const z=R.index,L={index:R.index,input:R.input,stack:[...m,p]};let D=_(...R,L);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?b.lastIndex=z+1:(S!==z&&N.push({type:"text",value:p.value.slice(S,z)}),Array.isArray(D)?N.push(...D):D&&N.push(D),S=z+R[0].length,C=!0),!b.global)break;R=b.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 u7(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([d7(r[0]),f7(r[1])])}return t}function d7(e){return typeof e=="string"?new RegExp(o7(e),"g"):e}function f7(e){return typeof e=="function"?e:function(){return e}}const vv="phrasing",_v=["autolink","link","image","label"];function h7(){return{transforms:[v7],enter:{literalAutolink:m7,literalAutolinkEmail:Sv,literalAutolinkHttp:Sv,literalAutolinkWww:Sv},exit:{literalAutolink:b7,literalAutolinkEmail:x7,literalAutolinkHttp:g7,literalAutolinkWww:y7}}}function p7(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:vv,notInConstruct:_v},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:vv,notInConstruct:_v},{character:":",before:"[ps]",after:"\\/",inConstruct:vv,notInConstruct:_v}]}}function m7(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Sv(e){this.config.enter.autolinkProtocol.call(this,e)}function g7(e){this.config.exit.autolinkProtocol.call(this,e)}function y7(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 x7(e){this.config.exit.autolinkEmail.call(this,e)}function b7(e){this.exit(e)}function v7(e){c7(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,_7],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),S7]],{ignore:["link","linkReference"]})}function _7(e,t,n,i,r){let s="";if(!AR(r)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!E7(n)))return!1;const l=w7(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 S7(e,t,n,i){return!AR(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function E7(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 w7(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=J2(e,"(");let s=J2(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 AR(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Rd(n)||mx(n))&&(!t||n!==47)}MR.peek=D7;function T7(){this.buffer()}function C7(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function A7(){this.buffer()}function M7(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function R7(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Al(this.sliceSerialize(e)).toLowerCase(),n.label=t}function k7(e){this.exit(e)}function N7(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Al(this.sliceSerialize(e)).toLowerCase(),n.label=t}function O7(e){this.exit(e)}function D7(){return"["}function MR(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 z7(){return{enter:{gfmFootnoteCallString:T7,gfmFootnoteCall:C7,gfmFootnoteDefinitionLabelString:A7,gfmFootnoteDefinition:M7},exit:{gfmFootnoteCallString:R7,gfmFootnoteCall:k7,gfmFootnoteDefinitionLabelString:N7,gfmFootnoteDefinition:O7}}}function j7(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:MR},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?RR:L7))),p(),f}}function L7(e,t,n){return t===0?e:RR(e,t,n)}function RR(e,t,n){return(n?"":" ")+e}const B7=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];kR.peek=F7;function I7(){return{canContainEols:["delete"],enter:{strikethrough:H7},exit:{strikethrough:P7}}}function U7(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:B7}],handlers:{delete:kR}}}function H7(e){this.enter({type:"delete",children:[]},e)}function P7(e){this.exit(e)}function kR(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 F7(){return"~"}function q7(e){return e.length}function G7(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||q7,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=Y7(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]=eT(i[g]);else{const A=eT(i);for(;++g<p;)s[g]=A}g=-1;const b=[],_=[];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),_[g]=N),b[g]=R}l.splice(1,0,b),c.splice(1,0,_),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="",z="";if(n.alignDelimiters!==!1){const L=f[g]-(T[g]||0),D=s[g];D===114?R=" ".repeat(L):D===99?L%2?(R=" ".repeat(L/2+.5),z=" ".repeat(L/2-.5)):(R=" ".repeat(L/2),z=R):z=" ".repeat(L)}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(z),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 Y7(e){return e==null?"":String(e)}function eT(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 V7(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()),X7);return r(),l}function X7(e,t,n){return">"+(n?"":" ")+e}function K7(e,t){return tT(e,t.inConstruct,!0)&&!tT(e,t.notInConstruct,!1)}function tT(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 nT(e,t,n,i){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
360
+ `&&K7(n.stack,n.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return`\\
361
+ `}function W7(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 $7(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 Q7(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 Z7(e,t,n,i){const r=Q7(n),s=e.value||"",l=r==="`"?"GraveAccent":"Tilde";if($7(e,n)){const g=n.enter("codeIndented"),b=n.indentLines(s,J7);return g(),b}const c=n.createTracker(i),f=r.repeat(Math.max(W7(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 J7(e,t,n){return(n?"":" ")+e}function P_(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 eP(e,t,n,i){const r=P_(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 tP(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 Vm(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Y0(e,t,n){const i=bh(e),r=bh(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}}NR.peek=nP;function NR(e,t,n,i){const r=tP(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=Y0(i.before.charCodeAt(i.before.length-1),p,r);m.inside&&(f=Vm(p)+f.slice(1));const g=f.charCodeAt(f.length-1),b=Y0(i.after.charCodeAt(0),g,r);b.inside&&(f=f.slice(0,-1)+Vm(g));const _=l.move(r);return s(),n.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},c+f+_}function nP(e,t,n){return n.options.emphasis||"*"}function iP(e,t){let n=!1;return bx(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,k1}),!!((!e.depth||e.depth<3)&&D_(e)&&(t.options.setext||n))}function rP(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(iP(e,n)){const m=n.enter("headingSetext"),g=n.enter("phrasing"),b=n.containerPhrasing(e,{...s.current(),before:`
366
+ `,after:`
367
+ `});return g(),m(),b+`
368
+ `+(r===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.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=Vm(p.charCodeAt(0))+p.slice(1)),p=p?l+" "+p:l,n.options.closeAtx&&(p+=" "+l),f(),c(),p}OR.peek=aP;function OR(e){return e.value||""}function aP(){return"<"}DR.peek=sP;function DR(e,t,n,i){const r=P_(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 sP(){return"!"}zR.peek=lP;function zR(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 lP(){return"!"}jR.peek=oP;function jR(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 oP(){return"`"}function LR(e,t){const n=D_(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))}BR.peek=cP;function BR(e,t,n,i){const r=P_(n),s=r==='"'?"Quote":"Apostrophe",l=n.createTracker(i);let c,f;if(LR(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 cP(e,t,n){return LR(e,n)?"<":"["}IR.peek=uP;function IR(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 uP(){return"["}function F_(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 dP(e){const t=F_(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 fP(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 UR(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 hP(e,t,n,i){const r=n.enter("list"),s=n.bulletCurrent;let l=e.ordered?fP(n):F_(n);const c=e.ordered?l==="."?")":".":dP(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),UR(n)===l&&m){let g=-1;for(;++g<e.children.length;){const b=e.children[g];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.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 pP(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 mP(e,t,n,i){const r=pP(n);let s=n.bulletCurrent||F_(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,b,_){return b?(_?"":" ".repeat(l))+g:(_?s:s+" ".repeat(l-s.length))+g}}function gP(e,t,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),l=n.containerPhrasing(e,i);return s(),r(),l}const yP=ug(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function xP(e,t,n,i){return(e.children.some(function(l){return yP(l)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function bP(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}HR.peek=vP;function HR(e,t,n,i){const r=bP(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=Y0(i.before.charCodeAt(i.before.length-1),p,r);m.inside&&(f=Vm(p)+f.slice(1));const g=f.charCodeAt(f.length-1),b=Y0(i.after.charCodeAt(0),g,r);b.inside&&(f=f.slice(0,-1)+Vm(g));const _=l.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},c+f+_}function vP(e,t,n){return n.options.strong||"*"}function _P(e,t,n,i){return n.safe(e.value,i)}function SP(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 EP(e,t,n){const i=(UR(n)+(n.options.ruleSpaces?" ":"")).repeat(SP(n));return n.options.ruleSpaces?i.slice(0,-1):i}const PR={blockquote:V7,break:nT,code:Z7,definition:eP,emphasis:NR,hardBreak:nT,heading:rP,html:OR,image:DR,imageReference:zR,inlineCode:jR,link:BR,linkReference:IR,list:hP,listItem:mP,paragraph:gP,root:xP,strong:HR,text:_P,thematicBreak:EP};function wP(){return{enter:{table:TP,tableData:iT,tableHeader:iT,tableRow:AP},exit:{codeText:MP,table:CP,tableData:Ev,tableHeader:Ev,tableRow:Ev}}}function TP(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 CP(e){this.exit(e),this.data.inTable=void 0}function AP(e){this.enter({type:"tableRow",children:[]},e)}function Ev(e){this.exit(e)}function iT(e){this.enter({type:"tableCell",children:[]},e)}function MP(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,RP));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function RP(e,t){return t==="|"?t:e}function kP(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:b,table:l,tableCell:f,tableRow:c}};function l(_,S,A,T){return p(m(_,A,T),_.align)}function c(_,S,A,T){const C=g(_,A,T),N=p([C]);return N.slice(0,N.indexOf(`
372
+ `))}function f(_,S,A,T){const C=A.enter("tableCell"),N=A.enter("phrasing"),R=A.containerPhrasing(_,{...T,before:s,after:s});return N(),C(),R}function p(_,S){return G7(_,{align:S,alignDelimiters:i,padding:n,stringLength:r})}function m(_,S,A){const T=_.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(_,S,A){const T=_.children;let C=-1;const N=[],R=S.enter("tableRow");for(;++C<T.length;)N[C]=f(T[C],_,S,A);return R(),N}function b(_,S,A){let T=PR.inlineCode(_,S,A);return A.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function NP(){return{exit:{taskListCheckValueChecked:rT,taskListCheckValueUnchecked:rT,paragraph:DP}}}function OP(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:zP}}}function rT(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function DP(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 zP(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=PR.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 jP(){return[h7(),z7(),I7(),wP(),NP()]}function LP(e){return{extensions:[p7(),j7(e),U7(),kP(e),OP()]}}const BP={tokenize:qP,partial:!0},FR={tokenize:GP,partial:!0},qR={tokenize:YP,partial:!0},GR={tokenize:VP,partial:!0},IP={tokenize:XP,partial:!0},YR={name:"wwwAutolink",tokenize:PP,previous:XR},VR={name:"protocolAutolink",tokenize:FP,previous:KR},yc={name:"emailAutolink",tokenize:HP,previous:WR},To={};function UP(){return{text:To}}let hd=48;for(;hd<123;)To[hd]=yc,hd++,hd===58?hd=65:hd===91&&(hd=97);To[43]=yc;To[45]=yc;To[46]=yc;To[95]=yc;To[72]=[yc,VR];To[104]=[yc,VR];To[87]=[yc,YR];To[119]=[yc,YR];function HP(e,t,n){const i=this;let r,s;return l;function l(g){return!z1(g)||!WR.call(i,i.previous)||q_(i.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(g))}function c(g){return z1(g)?(e.consume(g),c):g===64?(e.consume(g),f):n(g)}function f(g){return g===46?e.check(IP,m,p)(g):g===45||g===95||qr(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&&xa(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function PP(e,t,n){const i=this;return r;function r(l){return l!==87&&l!==119||!XR.call(i,i.previous)||q_(i.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(BP,e.attempt(FR,e.attempt(qR,s),n),n)(l))}function s(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function FP(e,t,n){const i=this;let r="",s=!1;return l;function l(g){return(g===72||g===104)&&KR.call(i,i.previous)&&!q_(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(g),e.consume(g),c):n(g)}function c(g){if(xa(g)&&r.length<5)return r+=String.fromCodePoint(g),e.consume(g),c;if(g===58){const b=r.toLowerCase();if(b==="http"||b==="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||F0(g)||Bn(g)||Rd(g)||mx(g)?n(g):e.attempt(FR,e.attempt(qR,m),n)(g)}function m(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function qP(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 GP(e,t,n){let i,r,s;return l;function l(p){return p===46||p===95?e.check(GR,f,c)(p):p===null||Bn(p)||Rd(p)||p!==45&&mx(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 YP(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(GR,t,s)(l):l===null||Bn(l)||Rd(l)?t(l):(e.consume(l),r)}function s(l){return l===41&&i++,e.consume(l),r}}function VP(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||Bn(c)||Rd(c)?t(c):n(c)}function r(c){return c===null||c===40||c===91||Bn(c)||Rd(c)?t(c):i(c)}function s(c){return xa(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),i):xa(c)?(e.consume(c),l):n(c)}}function XP(e,t,n){return i;function i(s){return e.consume(s),r}function r(s){return qr(s)?n(s):t(s)}}function XR(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Bn(e)}function KR(e){return!xa(e)}function WR(e){return!(e===47||z1(e))}function z1(e){return e===43||e===45||e===46||e===95||qr(e)}function q_(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 KP={tokenize:n9,partial:!0};function WP(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:JP,continuation:{tokenize:e9},exit:t9}},text:{91:{name:"gfmFootnoteCall",tokenize:ZP},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:$P,resolveTo:QP}}}}function $P(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=Al(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 QP(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 ZP(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||Bn(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return r.includes(Al(i.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return Bn(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 JP(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||Bn(S))return n(S);if(S===93){e.exit("chunkString");const A=e.exit("gfmFootnoteDefinitionLabelString");return s=Al(i.sliceSerialize(A)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return Bn(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 b(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),r.includes(s)||r.push(s),Wt(e,_,"gfmFootnoteDefinitionWhitespace")):n(S)}function _(S){return t(S)}}function e9(e,t,n){return e.check(cg,t,e.attempt(KP,t,n))}function t9(e){e.exit("gfmFootnoteDefinition")}function n9(e,t,n){const i=this;return Wt(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 i9(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)},b=[["enter",m,c],["enter",l[p][1],c],["exit",l[p][1],c],["enter",g,c]],_=c.parser.constructs.insideSpan.null;_&&us(b,b.length,0,gx(_,l.slice(p+1,f),c)),us(b,b.length,0,[["exit",g,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",m,c]]),us(l,p-1,f-p+3,b),f=p+b.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 b;function b(S){return p===126&&m[m.length-1][1].type!=="characterEscape"?f(S):(l.enter("strikethroughSequenceTemporary"),_(S))}function _(S){const A=bh(p);if(S===126)return g>1?f(S):(l.consume(S),g++,_);if(g<2&&!n)return f(S);const T=l.exit("strikethroughSequenceTemporary"),C=bh(S);return T._open=!C||C===2&&!!A,T._close=!A||A===2&&!!C,c(S)}}}class r9{constructor(){this.map=[]}add(t,n,i){a9(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 a9(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 s9(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 l9(){return{flow:{null:{name:"table",tokenize:o9,resolveAll:c9}}}}function o9(e,t,n){const i=this;let r=0,s=0,l;return c;function c(V){let P=i.events.length-1;for(;P>-1;){const X=i.events[P][1].type;if(X==="lineEnding"||X==="linePrefix")P--;else break}const G=P>-1?i.events[P][1].type:null,ne=G==="tableHead"||G==="tableRow"?D:f;return ne===D&&i.parser.lazy[i.now().line]?n(V):ne(V)}function f(V){return e.enter("tableHead"),e.enter("tableRow"),p(V)}function p(V){return V===124||(l=!0,s+=1),m(V)}function m(V){return V===null?n(V):lt(V)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(V),e.exit("lineEnding"),_):n(V):Lt(V)?Wt(e,m,"whitespace")(V):(s+=1,l&&(l=!1,r+=1),V===124?(e.enter("tableCellDivider"),e.consume(V),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),g(V)))}function g(V){return V===null||V===124||Bn(V)?(e.exit("data"),m(V)):(e.consume(V),V===92?b:g)}function b(V){return V===92||V===124?(e.consume(V),g):g(V)}function _(V){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(V):(e.enter("tableDelimiterRow"),l=!1,Lt(V)?Wt(e,S,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):S(V))}function S(V){return V===45||V===58?T(V):V===124?(l=!0,e.enter("tableCellDivider"),e.consume(V),e.exit("tableCellDivider"),A):L(V)}function A(V){return Lt(V)?Wt(e,T,"whitespace")(V):T(V)}function T(V){return V===58?(s+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(V),e.exit("tableDelimiterMarker"),C):V===45?(s+=1,C(V)):V===null||lt(V)?z(V):L(V)}function C(V){return V===45?(e.enter("tableDelimiterFiller"),N(V)):L(V)}function N(V){return V===45?(e.consume(V),N):V===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(V),e.exit("tableDelimiterMarker"),R):(e.exit("tableDelimiterFiller"),R(V))}function R(V){return Lt(V)?Wt(e,z,"whitespace")(V):z(V)}function z(V){return V===124?S(V):V===null||lt(V)?!l||r!==s?L(V):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(V)):L(V)}function L(V){return n(V)}function D(V){return e.enter("tableRow"),F(V)}function F(V){return V===124?(e.enter("tableCellDivider"),e.consume(V),e.exit("tableCellDivider"),F):V===null||lt(V)?(e.exit("tableRow"),t(V)):Lt(V)?Wt(e,F,"whitespace")(V):(e.enter("data"),Z(V))}function Z(V){return V===null||V===124||Bn(V)?(e.exit("data"),F(V)):(e.consume(V),V===92?K:Z)}function K(V){return V===92||V===124?(e.consume(V),Z):Z(V)}}function c9(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 b=new r9;for(;++n<e.length;){const _=e[n],S=_[1];_[0]==="enter"?S.type==="tableHead"?(c=!1,f!==0&&(aT(b,t,f,p,m),m=void 0,f=0),p={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},b.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)},b.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=a0(b,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=a0(b,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=a0(b,t,s,r,n,g)):l[1]!==0&&(g=a0(b,t,l,r,n,g)),r=0):r&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&aT(b,t,f,p,m),b.consume(t.events),n=-1;++n<t.events.length;){const _=t.events[n];_[0]==="enter"&&_[1].type==="table"&&(_[1]._align=s9(t.events,n))}return e}function a0(e,t,n,i,r,s){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(s.end=Object.assign({},Zf(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const f=Zf(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=Zf(t.events,n[2]),m=Zf(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 b=t.events[n[2]],_=t.events[n[3]];if(b[1].end=Object.assign({},_[1].end),b[1].type="chunkText",b[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({},Zf(t.events,r)),e.add(r,0,[["exit",s,t]]),s=void 0),s}function aT(e,t,n,i,r){const s=[],l=Zf(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 Zf(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const u9={name:"tasklistCheck",tokenize:f9};function d9(){return{text:{91:u9}}}function f9(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 Bn(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:h9},t,n)(f):n(f)}}function h9(e,t,n){return Wt(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function p9(e){return sR([UP(),WP(),i9(e),l9(),d9()])}const m9={};function g9(e){const t=this,n=e||m9,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(p9(n)),s.push(jP()),l.push(LP(n))}const sT=(function(e,t,n){const i=ug(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]}),Ld=(function(e){if(e==null)return b9;if(typeof e=="string")return x9(e);if(typeof e=="object")return y9(e);if(typeof e=="function")return G_(e);throw new Error("Expected function, string, or array as `test`")});function y9(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ld(e[n]);return G_(i);function i(...r){let s=-1;for(;++s<t.length;)if(t[s].apply(this,r))return!0;return!1}}function x9(e){return G_(t);function t(n){return n.tagName===e}}function G_(e){return t;function t(n,i,r){return!!(v9(n)&&e.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function b9(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function v9(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const lT=/\n/g,oT=/[\t ]+/g,j1=Ld("br"),cT=Ld(M9),_9=Ld("p"),uT=Ld("tr"),S9=Ld(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",A9,R9]),$R=Ld(["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 E9(e,t){const n=t||{},i="children"in e?e.children:[],r=$R(e),s=JR(e,{whitespace:n.whitespace||"normal"}),l=[];(e.type==="text"||e.type==="comment")&&l.push(...ZR(e,{breakBefore:!0,breakAfter:!0}));let c=-1;for(;++c<i.length;)l.push(...QR(i[c],e,{whitespace:s,breakBefore:c?void 0:r,breakAfter:c<i.length-1?j1(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 QR(e,t,n){return e.type==="element"?w9(e,t,n):e.type==="text"?n.whitespace==="normal"?ZR(e,n):T9(e):[]}function w9(e,t,n){const i=JR(e,n),r=e.children||[];let s=-1,l=[];if(S9(e))return l;let c,f;for(j1(e)||uT(e)&&sT(t,e,uT)?f=`
374
+ `:_9(e)?(c=2,f=2):$R(e)&&(c=1,f=1);++s<r.length;)l=l.concat(QR(r[s],e,{whitespace:i,breakBefore:s?void 0:c,breakAfter:s<r.length-1?j1(r[s+1]):f}));return cT(e)&&sT(t,e,cT)&&l.push(" "),c&&l.unshift(c),f&&l.push(f),l}function ZR(e,t){const n=String(e.value),i=[],r=[];let s=0;for(;s<=n.length;){lT.lastIndex=s;const f=lT.exec(n),p=f&&"index"in f?f.index:n.length;i.push(C9(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 T9(e){return[String(e.value)]}function C9(e,t,n){const i=[];let r=0,s;for(;r<e.length;){oT.lastIndex=r;const l=oT.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 JR(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 A9(e){return!!(e.properties||{}).hidden}function M9(e){return e.tagName==="td"||e.tagName==="th"}function R9(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function k9(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]},b={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},_=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"],z={type:A,keyword:S,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:T},L={className:"function.dispatch",relevance:0,keywords:{_hint:C},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},D=[L,g,c,n,e.C_BLOCK_COMMENT_MODE,m,p],F={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:z,contains:D.concat([{begin:/\(/,end:/\)/,keywords:z,contains:D.concat(["self"]),relevance:0}]),relevance:0},Z={className:"function",begin:"("+l+"[\\*&\\s]+)+"+_,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:z,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:z,relevance:0},{begin:_,returnBegin:!0,contains:[b],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,m]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,p,m,c,{begin:/\(/,end:/\)/,keywords:z,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:z,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(F,Z,L,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:z,contains:["self",c]},{begin:e.IDENT_RE+"::",keywords:z},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function N9(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=k9(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 O9(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]},b=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],_=e.SHEBANG({binary:`(${b.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"],z=["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"],L=["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",...z,...L]},contains:[_,e.SHEBANG(),S,g,s,l,C,c,f,p,m,n]}}function D9(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]},b={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},_=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]+)+"+_,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:T,relevance:0},{begin:_,returnBegin:!0,contains:[e.inherit(b,{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 z9(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]},b={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},_=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"],z={type:A,keyword:S,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:T},L={className:"function.dispatch",relevance:0,keywords:{_hint:C},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},D=[L,g,c,n,e.C_BLOCK_COMMENT_MODE,m,p],F={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:z,contains:D.concat([{begin:/\(/,end:/\)/,keywords:z,contains:D.concat(["self"]),relevance:0}]),relevance:0},Z={className:"function",begin:"("+l+"[\\*&\\s]+)+"+_,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:z,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:z,relevance:0},{begin:_,returnBegin:!0,contains:[b],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,m]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,p,m,c,{begin:/\(/,end:/\)/,keywords:z,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:z,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(F,Z,L,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:z,contains:["self",c]},{begin:e.IDENT_RE+"::",keywords:z},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function j9(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/}),b={className:"subst",begin:/\{/,end:/\}/,keywords:l},_=e.inherit(b,{illegal:/\n/}),S={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,_]},A={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},b]},T=e.inherit(A,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},_]});b.contains=[A,S,m,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,e.C_BLOCK_COMMENT_MODE],_.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+")*>)?(\\[\\])?",z={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]},z]}}const L9=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_-]*/}}),B9=["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"],I9=["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"],U9=[...B9,...I9],H9=["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(),P9=["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(),F9=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),q9=["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 G9(e){const t=e.regex,n=L9(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:":("+P9.join("|")+")"},{begin:":(:)?("+F9.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+q9.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:H9.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...c,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+U9.join("|")+")\\b"}]}}function Y9(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 V9(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 X9(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 K9(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),b=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:b,className:"attr",starts:{end:/$/,contains:[i,c,s,r,l,n]}}]}}var Jf="[0-9](_*[0-9])*",s0=`\\.(${Jf})`,l0="[0-9a-fA-F](_*[0-9a-fA-F])*",dT={className:"number",variants:[{begin:`(\\b(${Jf})((${s0})|\\.)?|(${s0}))[eE][+-]?(${Jf})[fFdD]?\\b`},{begin:`\\b(${Jf})((${s0})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${s0})[fFdD]?\\b`},{begin:`\\b(${Jf})[fFdD]\\b`},{begin:`\\b0[xX]((${l0})\\.?|(${l0})?\\.(${l0}))[pP][+-]?(${Jf})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${l0})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function ek(e,t,n){return n===-1?"":e.replace(t,i=>ek(e,t,n-1))}function W9(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+ek("(?:<"+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,dT,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},dT,p]}}const fT="[A-Za-z$_][0-9A-Za-z$_]*",$9=["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"],Q9=["true","false","null","undefined","NaN","Infinity"],tk=["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"],nk=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ik=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Z9=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],J9=[].concat(ik,tk,nk);function eF(e){const t=e.regex,n=($,{after:Q})=>{const H="</"+$[0].slice(1);return $.input.indexOf(H,Q)!==-1},i=fT,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:($,Q)=>{const H=$[0].length+$.index,I=$.input[H];if(I==="<"||I===","){Q.ignoreMatch();return}I===">"&&(n($,{after:H})||Q.ignoreMatch());let J;const q=$.input.substring(H);if(J=q.match(/^\s*=/)){Q.ignoreMatch();return}if((J=q.match(/^\s+extends\s+/))&&J.index===0){Q.ignoreMatch();return}}},c={$pattern:fT,keyword:$9,literal:Q9,built_in:J9,"variable.language":Z9},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},b={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},_={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"css"}},A={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"graphql"}},T={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,b]},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,_,S,A,T,{match:/\$\d+/},g];b.contains=R.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(R)});const z=[].concat(N,b.contains),L=z.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(z)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L},F={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:{_:[...tk,...nk]}},K={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},V={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G($){return t.concat("(?!",$.join("|"),")")}const ne={match:t.concat(/\b/,G([...ik,"super","import"].map($=>`${$}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},X={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]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",Y={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:Z},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),K,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,_,S,A,T,N,{match:/\$\d+/},g,Z,{scope:"attr",match:i+t.lookahead(":"),relevance:0},Y,{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:O,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:L}]}]},{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"]}]}]},V,{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},X,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},ne,P,F,W,{match:/\$[(.]/}]}}function tF(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 eh="[0-9](_*[0-9])*",o0=`\\.(${eh})`,c0="[0-9a-fA-F](_*[0-9a-fA-F])*",nF={className:"number",variants:[{begin:`(\\b(${eh})((${o0})|\\.)?|(${o0}))[eE][+-]?(${eh})[fFdD]?\\b`},{begin:`\\b(${eh})((${o0})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${o0})[fFdD]?\\b`},{begin:`\\b(${eh})[fFdD]\\b`},{begin:`\\b0[xX]((${c0})\\.?|(${c0})?\\.(${c0}))[pP][+-]?(${eh})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${c0})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function iF(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=nF,m=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),g={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},b=g;return b.variants[1].contains=[g],g.variants[1].contains=[b],{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 rF=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_-]*/}}),aF=["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"],sF=["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"],lF=[...aF,...sF],oF=["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(),rk=["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(),ak=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),cF=["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(),uF=rk.concat(ak).sort().reverse();function dF(e){const t=rF(e),n=uF,i="and or not only",r="[\\w-]+",s="("+r+"|@\\{"+r+"\\})",l=[],c=[],f=function(R){return{className:"string",begin:"~?"+R+".*?"+R}},p=function(R,z,L){return{className:R,begin:z,relevance:L}},m={$pattern:/[a-z-]+/,keyword:i,attribute:oF.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 b=c.concat({begin:/\{/,end:/\}/,contains:l}),_={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("+cF.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:b}},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,_,p("keyword","all\\b"),p("variable","@\\{"+r+"\\}"),{begin:"\\b("+lF.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:":("+rk.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+ak.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:b},{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,_,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:l}}function fF(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 hF(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 pF(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:[]}),b=e.inherit(m,{contains:[]});p.contains.push(b),m.contains.push(g);let _=[n,f];return[p,m,g,b].forEach(C=>{C.contains=C.contains.concat(_)}),_=_.concat(p,m),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:_},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:_}]}]},n,s,p,m,{className:"quote",begin:"^>\\s+",contains:_,end:"$"},r,i,f,l,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function mF(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 gF(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=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],b=(A,T,C="\\1")=>{const N=C==="\\1"?C:t.concat(C,T);return t.concat(t.concat("(?:",A,")"),T,/(?:\\.|[^\\\/])*?/,N,/(?:\\.|[^\\\/])*?/,C,i)},_=(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:b("s|tr|y",t.either(...g,{capture:!0}))},{begin:b("s|tr|y","\\(","\\)")},{begin:b("s|tr|y","\\[","\\]")},{begin:b("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:_("(?:m|qr)?",/\//,/\//)},{begin:_("m|qr",t.either(...g,{capture:!0}),/\1/)},{begin:_("m|qr",/\(/,/\)/)},{begin:_("m|qr",/\[/,/\]/)},{begin:_("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 yF(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":(X,W)=>{W.data._beginMatch=X[1]||X[2]},"on:end":(X,W)=>{W.data._beginMatch!==X[1]&&W.ignoreMatch()}},b=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),_=`[
376
+ ]`,S={scope:"string",variants:[m,p,g,b]},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"],z={keyword:C,literal:(X=>{const W=[];return X.forEach(O=>{W.push(O),O.toLowerCase()===O?W.push(O.toUpperCase()):W.push(O.toLowerCase())}),W})(T),built_in:N},L=X=>X.map(W=>W.replace(/\|\d+$/,"")),D={variants:[{match:[/new/,t.concat(_,"+"),t.concat("(?!",L(N).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},F=t.concat(i,"\\b(?!\\()"),Z={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),F],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),F],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"}}]},K={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},V={relevance:0,begin:/\(/,end:/\)/,keywords:z,contains:[K,l,Z,e.C_BLOCK_COMMENT_MODE,S,A,D]},P={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",L(C).join("\\b|"),"|",L(N).join("\\b|"),"\\b)"),i,t.concat(_,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[V]};V.contains.push(P);const G=[K,Z,e.C_BLOCK_COMMENT_MODE,S,A,D],ne={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",...G]},...G,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:z,contains:[ne,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,P,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:z,contains:["self",ne,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 xF(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 bF(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function vF(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]},b="[0-9](_?[0-9])*",_=`(\\b(${b}))?\\.(${b})|\\b(${b})\\.`,S=`\\b|${i.join("|")}`,A={className:"number",relevance:0,variants:[{begin:`(\\b(${b})|(${_}))[eE][+-]?(${b})[jJ]?(?=${S})`},{begin:`(${_})[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(${b})[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 _F(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function SF(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 EF(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]})]}]},b="[1-9](_?[0-9])*|0",_="[0-9](_?[0-9])*",S={className:"number",relevance:0,variants:[{begin:`\\b(${b})(\\.(${_}))?([eE][+-]?(${_})|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 V=[{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(V).concat(p).concat(D)}}function wF(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 TF=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_-]*/}}),CF=["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"],AF=["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"],MF=[...CF,...AF],RF=["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(),kF=["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(),NF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),OF=["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 DF(e){const t=TF(e),n=NF,i=kF,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("+MF.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("+OF.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:RF.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 zF(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function jF(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"],b=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],_=m,S=[...p,...f].filter(L=>!m.includes(L)),A={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},T={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},C={match:t.concat(/\b/,t.either(..._),/\s*\(/),relevance:0,keywords:{built_in:_}};function N(L){return t.concat(/\b/,t.either(...L.map(D=>D.replace(/\s+/,"\\s+"))),/\b/)}const R={scope:"keyword",match:N(b),relevance:0};function z(L,{exceptions:D,when:F}={}){const Z=F;return D=D||[],L.map(K=>K.match(/\|\d+$/)||D.includes(K)?K:Z(K)?`${K}|0`:K)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:z(S,{when:L=>L.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 sk(e){return e?typeof e=="string"?e:e.source:null}function gm(e){return Mn("(?=",e,")")}function Mn(...e){return e.map(n=>sk(n)).join("")}function LF(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ga(...e){return"("+(LF(e).capture?"":"?:")+e.map(i=>sk(i)).join("|")+")"}const Y_=e=>Mn(/\b/,e,/\w$/.test(e)?/\b/:/\B/),BF=["Protocol","Type"].map(Y_),hT=["init","self"].map(Y_),IF=["Any","Self"],wv=["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"],pT=["false","nil","true"],UF=["assignment","associativity","higherThan","left","lowerThan","none","right"],HF=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],mT=["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"],lk=ga(/[/=\-+!*%<>&|^~?]/,/[\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]/),ok=ga(lk,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Tv=Mn(lk,ok,"*"),ck=ga(/[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]/),V0=ga(ck,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),xo=Mn(ck,V0,"*"),u0=Mn(/[A-Z]/,V0,"*"),PF=["attached","autoclosure",Mn(/convention\(/,ga("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Mn(/objc\(/,xo,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],FF=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function qF(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,ga(...BF,...hT)],className:{2:"keyword"}},s={match:Mn(/\./,ga(...wv)),relevance:0},l=wv.filter(Ue=>typeof Ue=="string").concat(["_|0"]),c=wv.filter(Ue=>typeof Ue!="string").concat(IF).map(Y_),f={variants:[{className:"keyword",match:ga(...c,...hT)}]},p={$pattern:ga(/\b\w+/,/#\w+/),keyword:l.concat(HF),literal:pT},m=[r,s,f],g={match:Mn(/\./,ga(...mT)),relevance:0},b={className:"built_in",match:Mn(/\b/,ga(...mT),/(?=\()/)},_=[g,b],S={match:/->/,relevance:0},A={className:"operator",relevance:0,variants:[{match:Tv},{match:`\\.(\\.|${ok})+`}]},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/}]},z=(Ue="")=>({className:"subst",variants:[{match:Mn(/\\/,Ue,/[0\\tnr"']/)},{match:Mn(/\\/,Ue,/u\{[0-9a-fA-F]{1,8}\}/)}]}),L=(Ue="")=>({className:"subst",match:Mn(/\\/,Ue,/[\t ]*(?:[\r\n]|\r\n)/)}),D=(Ue="")=>({className:"subst",label:"interpol",begin:Mn(/\\/,Ue,/\(/),end:/\)/}),F=(Ue="")=>({begin:Mn(Ue,/"""/),end:Mn(/"""/,Ue),contains:[z(Ue),L(Ue),D(Ue)]}),Z=(Ue="")=>({begin:Mn(Ue,/"/),end:Mn(/"/,Ue),contains:[z(Ue),D(Ue)]}),K={className:"string",variants:[F(),F("#"),F("##"),F("###"),Z(),Z("#"),Z("##"),Z("###")]},V=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],P={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:V},G=Ue=>{const wt=Mn(Ue,/\//),Sn=Mn(/\//,Ue);return{begin:wt,end:Sn,contains:[...V,{scope:"comment",begin:`#(?!.*${Sn})`,end:/$/}]}},ne={scope:"regexp",variants:[G("###"),G("##"),G("#"),P]},X={match:Mn(/`/,xo,/`/)},W={className:"variable",match:/\$\d+/},O={className:"variable",match:`\\$${V0}+`},Y=[X,W,O],$={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:FF,contains:[...T,R,K]}]}},Q={scope:"keyword",match:Mn(/@/,ga(...PF),gm(ga(/\(/,/\s+/)))},H={scope:"meta",match:Mn(/@/,xo)},I=[$,Q,H],J={match:gm(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Mn(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,V0,"+")},{className:"type",match:u0,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Mn(/\s+&\s+/,gm(u0)),relevance:0}]},q={begin:/</,end:/>/,keywords:p,contains:[...i,...m,...I,S,J]};J.contains.push(q);const oe={match:Mn(xo,/\s*:/),keywords:"_|0",relevance:0},ie={begin:/\(/,end:/\)/,relevance:0,keywords:p,contains:["self",oe,...i,ne,...m,..._,...T,R,K,...Y,...I,J]},de={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,J]},me={begin:ga(gm(Mn(xo,/\s*:/)),gm(Mn(xo,/\s+/,xo,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:xo}]},ge={begin:/\(/,end:/\)/,keywords:p,contains:[me,...i,...m,...T,R,K,...I,J,ie],endsParent:!0,illegal:/["']/},le={match:[/(func|macro)/,/\s+/,ga(X.match,xo,Tv)],className:{1:"keyword",3:"title.function"},contains:[de,ge,t],illegal:[/\[/,/%/]},Re={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[de,ge,t],illegal:/\[|%/},Le={match:[/operator/,/\s+/,Tv],className:{1:"keyword",3:"title"}},Be={begin:[/precedencegroup/,/\s+/,u0],className:{1:"keyword",3:"title"},contains:[J],keywords:[...UF,...pT],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+/,xo,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:p,contains:[de,...m,{begin:/:/,end:/\{/,keywords:p,contains:[{scope:"title.class.inherited",match:u0},...m],relevance:0}]};for(const Ue of K.variants){const wt=Ue.contains.find(En=>En.label==="interpol");wt.keywords=p;const Sn=[...m,..._,...T,R,K,...Y];wt.contains=[...Sn,{begin:/\(/,end:/\)/,contains:["self",...Sn]}]}return{name:"Swift",keywords:p,contains:[...i,le,Re,He,Qe,ot,Le,Be,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},ne,...m,..._,...T,R,K,...Y,...I,J,ie]}}const X0="[A-Za-z$_][0-9A-Za-z$_]*",uk=["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"],dk=["true","false","null","undefined","NaN","Infinity"],fk=["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"],hk=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],pk=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],mk=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],gk=[].concat(pk,fk,hk);function GF(e){const t=e.regex,n=($,{after:Q})=>{const H="</"+$[0].slice(1);return $.input.indexOf(H,Q)!==-1},i=X0,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:($,Q)=>{const H=$[0].length+$.index,I=$.input[H];if(I==="<"||I===","){Q.ignoreMatch();return}I===">"&&(n($,{after:H})||Q.ignoreMatch());let J;const q=$.input.substring(H);if(J=q.match(/^\s*=/)){Q.ignoreMatch();return}if((J=q.match(/^\s+extends\s+/))&&J.index===0){Q.ignoreMatch();return}}},c={$pattern:X0,keyword:uk,literal:dk,built_in:gk,"variable.language":mk},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},b={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},_={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"css"}},A={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"graphql"}},T={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,b]},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,_,S,A,T,{match:/\$\d+/},g];b.contains=R.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(R)});const z=[].concat(N,b.contains),L=z.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(z)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L},F={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:{_:[...fk,...hk]}},K={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},V={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G($){return t.concat("(?!",$.join("|"),")")}const ne={match:t.concat(/\b/,G([...pk,"super","import"].map($=>`${$}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},X={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]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",Y={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:Z},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),K,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,_,S,A,T,N,{match:/\$\d+/},g,Z,{scope:"attr",match:i+t.lookahead(":"),relevance:0},Y,{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:O,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:L}]}]},{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"]}]}]},V,{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},X,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},ne,P,F,W,{match:/\$[(.]/}]}}function YF(e){const t=e.regex,n=GF(e),i=X0,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:X0,keyword:uk.concat(f),literal:dk,built_in:gk.concat(r),"variable.language":mk},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 b=n.contains.find(A=>A.scope==="attr"),_=Object.assign({},b,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,b,_]),n.contains=n.contains.concat([m,s,l,_]),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 VF(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:/>/}]}),b=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,b,{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:[b]}]}}function XF(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 KF(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 WF(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,{}[\]]+/}]}),b={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"},_={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},S={begin:/\{/,end:/\}/,contains:[_],illegal:"\\n",relevance:0},A={begin:"\\[",end:"\\]",contains:[_],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}},b,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},S,A,s,l],C=[...T];return C.pop(),C.push(c),_.contains=C,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:T}}const $F={arduino:N9,bash:O9,c:D9,cpp:z9,csharp:j9,css:G9,diff:Y9,go:V9,graphql:X9,ini:K9,java:W9,javascript:eF,json:tF,kotlin:iF,less:dF,lua:fF,makefile:hF,markdown:pF,objectivec:mF,perl:gF,php:yF,"php-template":xF,plaintext:bF,python:vF,"python-repl":_F,r:SF,ruby:EF,rust:wF,scss:DF,shell:zF,sql:jF,swift:qF,typescript:YF,vbnet:VF,wasm:XF,xml:KF,yaml:WF};var Cv,gT;function QF(){if(gT)return Cv;gT=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 Ie=se[Te],tt=typeof Ie;(tt==="object"||tt==="function")&&!Object.isFrozen(Ie)&&e(Ie)}),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 Ie=Object.create(null);for(const tt in se)Ie[tt]=se[tt];return Te.forEach(function(tt){for(const rn in tt)Ie[rn]=tt[rn]}),Ie}const r="</span>",s=se=>!!se.scope,l=(se,{prefix:Te})=>{if(se.startsWith("language:"))return se.replace("language:","language-");if(se.includes(".")){const Ie=se.split(".");return[`${Te}${Ie.shift()}`,...Ie.map((tt,rn)=>`${tt}${"_".repeat(rn+1)}`)].join(" ")}return`${Te}${se}`};class c{constructor(Te,Ie){this.buffer="",this.classPrefix=Ie.classPrefix,Te.walk(this)}addText(Te){this.buffer+=n(Te)}openNode(Te){if(!s(Te))return;const Ie=l(Te.scope,{prefix:this.classPrefix});this.span(Ie)}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 Ie=f({scope:Te});this.add(Ie),this.stack.push(Ie)}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,Ie){return typeof Ie=="string"?Te.addText(Ie):Ie.children&&(Te.openNode(Ie),Ie.children.forEach(tt=>this._walk(Te,tt)),Te.closeNode(Ie)),Te}static _collapse(Te){typeof Te!="string"&&Te.children&&(Te.children.every(Ie=>typeof Ie=="string")?Te.children=[Te.children.join("")]:Te.children.forEach(Ie=>{p._collapse(Ie)}))}}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,Ie){const tt=Te.root;Ie&&(tt.scope=`language:${Ie}`),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 b(se){return A("(?=",se,")")}function _(se){return A("(?:",se,")*")}function S(se){return A("(?:",se,")?")}function A(...se){return se.map(Ie=>g(Ie)).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 Ie=se&&se.exec(Te);return Ie&&Ie.index===0}const z=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(se,{joinWith:Te}){let Ie=0;return se.map(tt=>{Ie+=1;const rn=Ie;let an=g(tt),Ye="";for(;an.length>0;){const qe=z.exec(an);if(!qe){Ye+=an;break}Ye+=an.substring(0,qe.index),an=an.substring(qe.index+qe[0].length),qe[0][0]==="\\"&&qe[1]?Ye+="\\"+String(Number(qe[1])+rn):(Ye+=qe[0],qe[0]==="("&&Ie++)}return Ye}).map(tt=>`(${tt})`).join(Te)}const D=/\b\B/,F="[a-zA-Z]\\w*",Z="[a-zA-Z_]\\w*",K="\\b\\d+(\\.\\d+)?",V="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",P="\\b(0b[01]+)",G="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ne=(se={})=>{const Te=/^#![ ]*\//;return se.binary&&(se.begin=A(Te,/.*\b/,se.binary,/\b.*/)),i({scope:"meta",begin:Te,end:/$/,relevance:0,"on:begin":(Ie,tt)=>{Ie.index!==0&&tt.ignoreMatch()}},se)},X={begin:"\\\\[\\s\\S]",relevance:0},W={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[X]},O={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[X]},Y={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/},$=function(se,Te,Ie={}){const tt=i({scope:"comment",begin:se,end:Te,contains:[]},Ie);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 rn=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(/[ ]+/,"(",rn,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),tt},Q=$("//","$"),H=$("/\\*","\\*/"),I=$("#","$"),J={scope:"number",begin:K,relevance:0},q={scope:"number",begin:V,relevance:0},oe={scope:"number",begin:P,relevance:0},ie={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[X,{begin:/\[/,end:/\]/,relevance:0,contains:[X]}]},de={scope:"title",begin:F,relevance:0},me={scope:"title",begin:Z,relevance:0},ge={begin:"\\.\\s*"+Z,relevance:0};var Re=Object.freeze({__proto__:null,APOS_STRING_MODE:W,BACKSLASH_ESCAPE:X,BINARY_NUMBER_MODE:oe,BINARY_NUMBER_RE:P,COMMENT:$,C_BLOCK_COMMENT_MODE:H,C_LINE_COMMENT_MODE:Q,C_NUMBER_MODE:q,C_NUMBER_RE:V,END_SAME_AS_BEGIN:function(se){return Object.assign(se,{"on:begin":(Te,Ie)=>{Ie.data._beginMatch=Te[1]},"on:end":(Te,Ie)=>{Ie.data._beginMatch!==Te[1]&&Ie.ignoreMatch()}})},HASH_COMMENT_MODE:I,IDENT_RE:F,MATCH_NOTHING_RE:D,METHOD_GUARD:ge,NUMBER_MODE:J,NUMBER_RE:K,PHRASAL_WORDS_MODE:Y,QUOTE_STRING_MODE:O,REGEXP_MODE:ie,RE_STARTERS_RE:G,SHEBANG:ne,TITLE_MODE:de,UNDERSCORE_IDENT_RE:Z,UNDERSCORE_TITLE_MODE:me});function Le(se,Te){se.input[se.index-1]==="."&&Te.ignoreMatch()}function Be(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=Le,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 Ie=Object.assign({},se);Object.keys(se).forEach(tt=>{delete se[tt]}),se.keywords=Ie.keywords,se.begin=A(Ie.beforeMatch,b(Ie.begin)),se.starts={relevance:0,contains:[Object.assign(Ie,{endsParent:!0})]},se.relevance=0,delete Ie.beforeMatch},Sn=["of","and","for","in","not","or","if","then","parent","list","value"],En="keyword";function pn(se,Te,Ie=En){const tt=Object.create(null);return typeof se=="string"?rn(Ie,se.split(" ")):Array.isArray(se)?rn(Ie,se):Object.keys(se).forEach(function(an){Object.assign(tt,pn(se[an],Te,an))}),tt;function rn(an,Ye){Te&&(Ye=Ye.map(qe=>qe.toLowerCase())),Ye.forEach(function(qe){const nt=qe.split("|");tt[nt[0]]=[an,ui(nt[0],nt[1])]})}}function ui(se,Te){return Te?Number(Te):Yr(se)?0:1}function Yr(se){return Sn.includes(se.toLowerCase())}const ki={},Qt=se=>{console.error(se)},ur=(se,...Te)=>{console.log(`WARN: ${se}`,...Te)},Ee=(se,Te)=>{ki[`${se}/${Te}`]||(console.log(`Deprecated as of ${se}. ${Te}`),ki[`${se}/${Te}`]=!0)},ke=new Error;function ce(se,Te,{key:Ie}){let tt=0;const rn=se[Ie],an={},Ye={};for(let qe=1;qe<=Te.length;qe++)Ye[qe+tt]=rn[qe],an[qe+tt]=!0,tt+=N(Te[qe-1]);se[Ie]=Ye,se[Ie]._emit=an,se[Ie]._multi=!0}function Pe(se){if(Array.isArray(se.begin)){if(se.skip||se.excludeBegin||se.returnBegin)throw Qt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ke;if(typeof se.beginScope!="object"||se.beginScope===null)throw Qt("beginScope must be object"),ke;ce(se,se.begin,{key:"beginScope"}),se.begin=L(se.begin,{joinWith:""})}}function ct(se){if(Array.isArray(se.end)){if(se.skip||se.excludeEnd||se.returnEnd)throw Qt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ke;if(typeof se.endScope!="object"||se.endScope===null)throw Qt("endScope must be object"),ke;ce(se,se.end,{key:"endScope"}),se.end=L(se.end,{joinWith:""})}}function nn(se){se.scope&&typeof se.scope=="object"&&se.scope!==null&&(se.beginScope=se.scope,delete se.scope)}function di(se){nn(se),typeof se.beginScope=="string"&&(se.beginScope={_wrap:se.beginScope}),typeof se.endScope=="string"&&(se.endScope={_wrap:se.endScope}),Pe(se),ct(se)}function Zt(se){function Te(Ye,qe){return new RegExp(g(Ye),"m"+(se.case_insensitive?"i":"")+(se.unicodeRegex?"u":"")+(qe?"g":""))}class Ie{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(qe,nt){nt.position=this.position++,this.matchIndexes[this.matchAt]=nt,this.regexes.push([nt,qe]),this.matchAt+=N(qe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const qe=this.regexes.map(nt=>nt[1]);this.matcherRe=Te(L(qe,{joinWith:"|"}),!0),this.lastIndex=0}exec(qe){this.matcherRe.lastIndex=this.lastIndex;const nt=this.matcherRe.exec(qe);if(!nt)return null;const kn=nt.findIndex((_a,dr)=>dr>0&&_a!==void 0),qt=this.matchIndexes[kn];return nt.splice(0,kn),Object.assign(nt,qt)}}class tt{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(qe){if(this.multiRegexes[qe])return this.multiRegexes[qe];const nt=new Ie;return this.rules.slice(qe).forEach(([kn,qt])=>nt.addRule(kn,qt)),nt.compile(),this.multiRegexes[qe]=nt,nt}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(qe,nt){this.rules.push([qe,nt]),nt.type==="begin"&&this.count++}exec(qe){const nt=this.getMatcher(this.regexIndex);nt.lastIndex=this.lastIndex;let kn=nt.exec(qe);if(this.resumingScanAtSamePosition()&&!(kn&&kn.index===this.lastIndex)){const qt=this.getMatcher(0);qt.lastIndex=this.lastIndex+1,kn=qt.exec(qe)}return kn&&(this.regexIndex+=kn.position+1,this.regexIndex===this.count&&this.considerAll()),kn}}function rn(Ye){const qe=new tt;return Ye.contains.forEach(nt=>qe.addRule(nt.begin,{rule:nt,type:"begin"})),Ye.terminatorEnd&&qe.addRule(Ye.terminatorEnd,{type:"end"}),Ye.illegal&&qe.addRule(Ye.illegal,{type:"illegal"}),qe}function an(Ye,qe){const nt=Ye;if(Ye.isCompiled)return nt;[Be,ot,di,wt].forEach(qt=>qt(Ye,qe)),se.compilerExtensions.forEach(qt=>qt(Ye,qe)),Ye.__beforeBegin=null,[He,Qe,Ue].forEach(qt=>qt(Ye,qe)),Ye.isCompiled=!0;let kn=null;return typeof Ye.keywords=="object"&&Ye.keywords.$pattern&&(Ye.keywords=Object.assign({},Ye.keywords),kn=Ye.keywords.$pattern,delete Ye.keywords.$pattern),kn=kn||/\w+/,Ye.keywords&&(Ye.keywords=pn(Ye.keywords,se.case_insensitive)),nt.keywordPatternRe=Te(kn,!0),qe&&(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&&qe.terminatorEnd&&(nt.terminatorEnd+=(Ye.end?"|":"")+qe.terminatorEnd)),Ye.illegal&&(nt.illegalRe=Te(Ye.illegal)),Ye.contains||(Ye.contains=[]),Ye.contains=[].concat(...Ye.contains.map(function(qt){return Gn(qt==="self"?Ye:qt)})),Ye.contains.forEach(function(qt){an(qt,nt)}),Ye.starts&&an(Ye.starts,qe),nt.matcher=rn(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||{}),an(se)}function Jt(se){return se?se.endsWithParent||Jt(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:Jt(se)?i(se,{starts:se.starts?i(se.starts):null}):Object.isFrozen(se)?i(se):se}var Ft="11.11.1";class Wi extends Error{constructor(Te,Ie){super(Te),this.name="HTMLInjectionError",this.html=Ie}}const ti=n,Ao=i,hs=Symbol("nomatch"),Ha=7,ps=function(se){const Te=Object.create(null),Ie=Object.create(null),tt=[];let rn=!0;const an="Could not find the language '{}', did you forget to load/include a language module?",Ye={disableAutodetect:!0,name:"Plain text",contains:[]};let qe={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 qe.noHighlightRe.test(Ne)}function kn(Ne){let Ke=Ne.className+" ";Ke+=Ne.parentNode?Ne.parentNode.className:"";const vt=qe.languageDetectRe.exec(Ke);if(vt){const Kt=sn(vt[1]);return Kt||(ur(an.replace("{}",vt[1])),ur("Falling back to no-highlight mode for this block.",Ne)),Kt?vt[1]:"no-highlight"}return Ke.split(/\s+/).find(Kt=>nt(Kt)||sn(Kt))}function qt(Ne,Ke,vt){let Kt="",Un="";typeof Ke=="object"?(Kt=Ne,vt=Ke.ignoreIllegals,Un=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`),Un=Ne,Kt=Ke),vt===void 0&&(vt=!0);const wi={code:Kt,language:Un};Sa("before:highlight",wi);const Qi=wi.result?wi.result:_a(wi.language,wi.code,vt);return Qi.code=wi.code,Sa("after:highlight",Qi),Qi}function _a(Ne,Ke,vt,Kt){const Un=Object.create(null);function wi(je,Ve){return je.keywords[Ve]}function Qi(){if(!rt.keywords){Pn.addText(on);return}let je=0;rt.keywordPatternRe.lastIndex=0;let Ve=rt.keywordPatternRe.exec(on),yt="";for(;Ve;){yt+=on.substring(je,Ve.index);const Nt=hi.case_insensitive?Ve[0].toLowerCase():Ve[0],Nn=wi(rt,Nt);if(Nn){const[Wr,_c]=Nn;if(Pn.addText(yt),yt="",Un[Nt]=(Un[Nt]||0)+1,Un[Nt]<=Ha&&(ys+=_c),Wr.startsWith("_"))yt+=Ve[0];else{const Su=hi.classNameAliases[Wr]||Wr;pr(Ve[0],Su)}}else yt+=Ve[0];je=rt.keywordPatternRe.lastIndex,Ve=rt.keywordPatternRe.exec(on)}yt+=on.substring(je),Pn.addText(yt)}function Ni(){if(on==="")return;let je=null;if(typeof rt.subLanguage=="string"){if(!Te[rt.subLanguage]){Pn.addText(on);return}je=_a(rt.subLanguage,on,!0,Ro[rt.subLanguage]),Ro[rt.subLanguage]=je._top}else je=$i(on,rt.subLanguage.length?rt.subLanguage:null);rt.relevance>0&&(ys+=je.relevance),Pn.__addSublanguage(je._emitter,je.language)}function mn(){rt.subLanguage!=null?Ni():Qi(),on=""}function pr(je,Ve){je!==""&&(Pn.startScope(Ve),Pn.addText(je),Pn.endScope())}function Mo(je,Ve){let yt=1;const Nt=Ve.length-1;for(;yt<=Nt;){if(!je._emit[yt]){yt++;continue}const Nn=hi.classNameAliases[je[yt]]||je[yt],Wr=Ve[yt];Nn?pr(Wr,Nn):(on=Wr,Qi(),on=""),yt++}}function Ea(je,Ve){return je.scope&&typeof je.scope=="string"&&Pn.openNode(hi.classNameAliases[je.scope]||je.scope),je.beginScope&&(je.beginScope._wrap?(pr(on,hi.classNameAliases[je.beginScope._wrap]||je.beginScope._wrap),on=""):je.beginScope._multi&&(Mo(je.beginScope,Ve),on="")),rt=Object.create(je,{parent:{value:rt}}),rt}function Ll(je,Ve,yt){let Nt=R(je.endRe,yt);if(Nt){if(je["on:end"]){const Nn=new t(je);je["on:end"](Ve,Nn),Nn.isMatchIgnored&&(Nt=!1)}if(Nt){for(;je.endsParent&&je.parent;)je=je.parent;return je}}if(je.endsWithParent)return Ll(je.parent,Ve,yt)}function Fa(je){return rt.matcher.regexIndex===0?(on+=je[0],1):(Ks=!0,0)}function bc(je){const Ve=je[0],yt=je.rule,Nt=new t(yt),Nn=[yt.__beforeBegin,yt["on:begin"]];for(const Wr of Nn)if(Wr&&(Wr(je,Nt),Nt.isMatchIgnored))return Fa(Ve);return yt.skip?on+=Ve:(yt.excludeBegin&&(on+=Ve),mn(),!yt.returnBegin&&!yt.excludeBegin&&(on=Ve)),Ea(yt,je),yt.returnBegin?0:Ve.length}function Ui(je){const Ve=je[0],yt=Ke.substring(je.index),Nt=Ll(rt,je,yt);if(!Nt)return hs;const Nn=rt;rt.endScope&&rt.endScope._wrap?(mn(),pr(Ve,rt.endScope._wrap)):rt.endScope&&rt.endScope._multi?(mn(),Mo(rt.endScope,je)):Nn.skip?on+=Ve:(Nn.returnEnd||Nn.excludeEnd||(on+=Ve),mn(),Nn.excludeEnd&&(on=Ve));do rt.scope&&Pn.closeNode(),!rt.skip&&!rt.subLanguage&&(ys+=rt.relevance),rt=rt.parent;while(rt!==Nt.parent);return Nt.starts&&Ea(Nt.starts,je),Nn.returnEnd?0:Ve.length}function ms(){const je=[];for(let Ve=rt;Ve!==hi;Ve=Ve.parent)Ve.scope&&je.unshift(Ve.scope);je.forEach(Ve=>Pn.openNode(Ve))}let gs={};function Xs(je,Ve){const yt=Ve&&Ve[0];if(on+=je,yt==null)return mn(),0;if(gs.type==="begin"&&Ve.type==="end"&&gs.index===Ve.index&&yt===""){if(on+=Ke.slice(Ve.index,Ve.index+1),!rn){const Nt=new Error(`0 width match regex (${Ne})`);throw Nt.languageName=Ne,Nt.badRule=gs.rule,Nt}return 1}if(gs=Ve,Ve.type==="begin")return bc(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=Ui(Ve);if(Nt!==hs)return Nt}if(Ve.type==="illegal"&&yt==="")return on+=`
378
+ `,1;if(vc>1e5&&vc>Ve.index*3)throw new Error("potential infinite loop, way more iterations than matches");return on+=yt,yt.length}const hi=sn(Ne);if(!hi)throw Qt(an.replace("{}",Ne)),new Error('Unknown language: "'+Ne+'"');const _u=Zt(hi);let qa="",rt=Kt||_u;const Ro={},Pn=new qe.__emitter(qe);ms();let on="",ys=0,xs=0,vc=0,Ks=!1;try{if(hi.__emitTokens)hi.__emitTokens(Ke,Pn);else{for(rt.matcher.considerAll();;){vc++,Ks?Ks=!1:rt.matcher.considerAll(),rt.matcher.lastIndex=xs;const je=rt.matcher.exec(Ke);if(!je)break;const Ve=Ke.substring(xs,je.index),yt=Xs(Ve,je);xs=je.index+yt}Xs(Ke.substring(xs))}return Pn.finalize(),qa=Pn.toHTML(),{language:Ne,value:qa,relevance:ys,illegal:!1,_emitter:Pn,_top:rt}}catch(je){if(je.message&&je.message.includes("Illegal"))return{language:Ne,value:ti(Ke),illegal:!0,relevance:0,_illegalBy:{message:je.message,index:xs,context:Ke.slice(xs-100,xs+100),mode:je.mode,resultSoFar:qa},_emitter:Pn};if(rn)return{language:Ne,value:ti(Ke),illegal:!1,relevance:0,errorRaised:je,_emitter:Pn,_top:rt};throw je}}function dr(Ne){const Ke={value:ti(Ne),illegal:!1,relevance:0,_top:Ye,_emitter:new qe.__emitter(qe)};return Ke._emitter.addText(Ne),Ke}function $i(Ne,Ke){Ke=Ke||qe.languages||Object.keys(Te);const vt=dr(Ne),Kt=Ke.filter(sn).filter(hr).map(mn=>_a(mn,Ne,!1));Kt.unshift(vt);const Un=Kt.sort((mn,pr)=>{if(mn.relevance!==pr.relevance)return pr.relevance-mn.relevance;if(mn.language&&pr.language){if(sn(mn.language).supersetOf===pr.language)return 1;if(sn(pr.language).supersetOf===mn.language)return-1}return 0}),[wi,Qi]=Un,Ni=wi;return Ni.secondBest=Qi,Ni}function fr(Ne,Ke,vt){const Kt=Ke&&Ie[Ke]||vt;Ne.classList.add("hljs"),Ne.classList.add(`language-${Kt}`)}function bt(Ne){let Ke=null;const vt=kn(Ne);if(nt(vt))return;if(Sa("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&&(qe.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)),qe.throwUnescapedHTML))throw new Wi("One of your code blocks includes unescaped HTML.",Ne.innerHTML);Ke=Ne;const Kt=Ke.textContent,Un=vt?qt(Kt,{language:vt,ignoreIllegals:!0}):$i(Kt);Ne.innerHTML=Un.value,Ne.dataset.highlighted="yes",fr(Ne,vt,Un.language),Ne.result={language:Un.language,re:Un.relevance,relevance:Un.relevance},Un.secondBest&&(Ne.secondBest={language:Un.secondBest.language,relevance:Un.secondBest.relevance}),Sa("after:highlightElement",{el:Ne,result:Un,text:Kt})}function fi(Ne){qe=Ao(qe,Ne)}const Vr=()=>{zl(),Ee("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ys(){zl(),Ee("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Dl=!1;function zl(){function Ne(){zl()}if(document.readyState==="loading"){Dl||window.addEventListener("DOMContentLoaded",Ne,!1),Dl=!0;return}document.querySelectorAll(qe.cssSelector).forEach(bt)}function jl(Ne,Ke){let vt=null;try{vt=Ke(se)}catch(Kt){if(Qt("Language definition for '{}' could not be registered.".replace("{}",Ne)),rn)Qt(Kt);else throw Kt;vt=Ye}vt.name||(vt.name=Ne),Te[Ne]=vt,vt.rawDefinition=Ke.bind(null,se),vt.aliases&&ln(vt.aliases,{languageName:Ne})}function Pa(Ne){delete Te[Ne];for(const Ke of Object.keys(Ie))Ie[Ke]===Ne&&delete Ie[Ke]}function Vs(){return Object.keys(Te)}function sn(Ne){return Ne=(Ne||"").toLowerCase(),Te[Ne]||Te[Ie[Ne]]}function ln(Ne,{languageName:Ke}){typeof Ne=="string"&&(Ne=[Ne]),Ne.forEach(vt=>{Ie[vt.toLowerCase()]=Ke})}function hr(Ne){const Ke=sn(Ne);return Ke&&!Ke.disableAutodetect}function Xr(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 In(Ne){Xr(Ne),tt.push(Ne)}function Cr(Ne){const Ke=tt.indexOf(Ne);Ke!==-1&&tt.splice(Ke,1)}function Sa(Ne,Ke){const vt=Ne;tt.forEach(function(Kt){Kt[vt]&&Kt[vt](Ke)})}function Kr(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:qt,highlightAuto:$i,highlightAll:zl,highlightElement:bt,highlightBlock:Kr,configure:fi,initHighlighting:Vr,initHighlightingOnLoad:Ys,registerLanguage:jl,unregisterLanguage:Pa,listLanguages:Vs,getLanguage:sn,registerAliases:ln,autoDetection:hr,inherit:Ao,addPlugin:In,removePlugin:Cr}),se.debugMode=function(){rn=!1},se.safeMode=function(){rn=!0},se.versionString=Ft,se.regex={concat:A,lookahead:b,either:C,optional:S,anyNumberOfTimes:_};for(const Ne in Re)typeof Re[Ne]=="object"&&e(Re[Ne]);return Object.assign(se,Re),se},Ei=ps({});return Ei.newInstance=()=>ps({}),Cv=Ei,Ei.HighlightJS=Ei,Ei.default=Ei,Cv}var ZF=QF();const JF=xu(ZF),yT={},eq="hljs-";function tq(e){const t=JF.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||yT,b=typeof g.prefix=="string"?g.prefix:eq;if(!t.getLanguage(f))throw new Error("Unknown language: `"+f+"` is not registered");t.configure({__emitter:nq,classPrefix:b});const _=t.highlight(p,{ignoreIllegals:!0,language:f});if(_.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:_.errorRaised});const S=_._emitter.root,A=S.data;return A.language=_.language,A.relevance=_.relevance,S}function i(f,p){const g=(p||yT).subset||r();let b=-1,_=0,S;for(;++b<g.length;){const A=g[b];if(!t.getLanguage(A))continue;const T=n(A,f,p);T.data&&T.data.relevance!==void 0&&T.data.relevance>_&&(_=T.data.relevance,S=T)}return S||{type:"root",children:[],data:{language:void 0,relevance:_}}}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 nq{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 iq={};function rq(e){const t=e||iq,n=t.aliases,i=t.detect||!1,r=t.languages||$F,s=t.plainText,l=t.prefix,c=t.subset;let f="hljs";const p=tq(r);if(n&&p.registerAlias(n),l){const m=l.indexOf("-");f=m===-1?l:l.slice(0,m)}return function(m,g){bx(m,"element",function(b,_,S){if(b.tagName!=="code"||!S||S.type!=="element"||S.tagName!=="pre")return;const A=aq(b);if(A===!1||!A&&!i||A&&s&&s.includes(A))return;Array.isArray(b.properties.className)||(b.properties.className=[]),b.properties.className.includes(f)||b.properties.className.unshift(f);const T=E9(b,{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,b],cause:R,place:b.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw R}!A&&C.data&&C.data.language&&b.properties.className.push("language-"+C.data.language),C.children.length>0&&(b.children=C.children)})}}function aq(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 sq({text:e}){const[t,n]=B.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})};return x.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 L1({content:e}){return x.jsx("div",{className:"markdown-message",children:x.jsx(i7,{remarkPlugins:[g9],rehypePlugins:[rq],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?B1(i.props.children):"";return x.jsxs("div",{style:{position:"relative"},children:[x.jsx(sq,{text:r}),x.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?x.jsx("code",{className:t,...i,children:n}):x.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 x.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent)",textDecoration:"none"},...i,children:n})},table({children:t,...n}){return x.jsx("div",{style:{overflowX:"auto",margin:"8px 0"},children:x.jsx("table",{...n,style:{borderCollapse:"collapse",width:"100%",fontSize:"0.82rem"},children:t})})},th({children:t,...n}){return x.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 x.jsx("td",{...n,style:{borderBottom:"1px solid var(--border-subtle)",padding:"5px 10px",color:"var(--text-secondary)"},children:t})},blockquote({children:t,...n}){return x.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 x.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--border-default)",margin:"12px 0"}})},ul({children:t,...n}){return x.jsx("ul",{...n,style:{paddingLeft:20,margin:"4px 0"},children:t})},ol({children:t,...n}){return x.jsx("ol",{...n,style:{paddingLeft:20,margin:"4px 0"},children:t})},li({children:t,...n}){return x.jsx("li",{...n,style:{marginBottom:2},children:t})},h1({children:t,...n}){return x.jsx("h1",{...n,style:{fontSize:"1.3em",fontWeight:700,margin:"12px 0 6px"},children:t})},h2({children:t,...n}){return x.jsx("h2",{...n,style:{fontSize:"1.15em",fontWeight:600,margin:"10px 0 4px"},children:t})},h3({children:t,...n}){return x.jsx("h3",{...n,style:{fontSize:"1.05em",fontWeight:600,margin:"8px 0 4px"},children:t})},p({children:t,...n}){return x.jsx("p",{...n,style:{margin:"4px 0",lineHeight:1.6},children:t})}},children:e})})}function B1(e){var t;return typeof e=="string"?e:Array.isArray(e)?e.map(B1).join(""):(t=e==null?void 0:e.props)!=null&&t.children?B1(e.props.children):""}function lq({commands:e,filter:t,selectedIndex:n,onSelect:i,visible:r}){const s=B.useRef(null),l=B.useRef(null),c=e.filter(f=>f.command.toLowerCase().includes(t.toLowerCase())||f.description.toLowerCase().includes(t.toLowerCase()));return B.useEffect(()=>{var f;(f=l.current)==null||f.scrollIntoView({block:"nearest"})},[n]),!r||c.length===0?null:x.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:[x.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 x.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:[x.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&&x.jsxs("span",{style:{color:"var(--text-muted)",fontWeight:400},children:[" ",f.args]})]}),x.jsx("span",{style:{fontSize:"0.75rem",color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.description})]},f.command)})]})}const xT=[{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 oq({c:e}){return x.jsxs("div",{style:{padding:"12px",background:"#1e1e2e",borderRadius:"8px",minWidth:"120px"},children:[x.jsxs("div",{style:{fontSize:"24px",fontWeight:"bold",color:"#cdd6f4"},children:[e.value,e.unit?` ${e.unit}`:""]}),x.jsx("div",{style:{fontSize:"12px",color:"#a6adc8",marginTop:"4px"},children:e.label})]})}function cq({c:e}){const t=Math.round(e.value*100);return x.jsxs("div",{style:{width:"100%"},children:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"4px"},children:[x.jsx("span",{style:{fontSize:"12px",color:"#a6adc8"},children:e.label}),x.jsxs("span",{style:{fontSize:"12px",color:"#cdd6f4"},children:[t,"%"]})]}),x.jsx("div",{style:{height:"6px",background:"#313244",borderRadius:"3px"},children:x.jsx("div",{style:{height:"100%",width:`${t}%`,background:"#89b4fa",borderRadius:"3px",transition:"width 0.3s"}})})]})}function uq({c:e}){return x.jsxs("div",{children:[e.title&&x.jsx("div",{style:{fontSize:"13px",fontWeight:600,color:"#cdd6f4",marginBottom:"8px"},children:e.title}),x.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"12px"},children:[x.jsx("thead",{children:x.jsx("tr",{children:e.columns.map((t,n)=>x.jsx("th",{style:{textAlign:"left",padding:"4px 8px",color:"#a6adc8",borderBottom:"1px solid #313244"},children:t},n))})}),x.jsx("tbody",{children:e.rows.map((t,n)=>x.jsx("tr",{children:t.map((i,r)=>x.jsx("td",{style:{padding:"4px 8px",color:"#cdd6f4",borderBottom:"1px solid #1e1e2e"},children:i},r))},n))})]})]})}function dq({c:e}){return x.jsxs("div",{style:{padding:"12px",background:"#1e1e2e",borderRadius:"8px"},children:[x.jsx("div",{style:{fontWeight:600,color:"#cdd6f4",marginBottom:"6px"},children:e.title}),x.jsx("div",{style:{fontSize:"13px",color:"#a6adc8"},children:e.body})]})}const fq={green:"#a6e3a1",yellow:"#f9e2af",red:"#f38ba8",blue:"#89b4fa"};function hq({c:e}){return x.jsx("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"12px",fontSize:"11px",fontWeight:600,color:"#1e1e2e",background:fq[e.color]??"#a6adc8"},children:e.label})}function pq({components:e}){return e.length===0?null:x.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px",padding:"12px"},children:e.map((t,n)=>{switch(t.type){case"metric":return x.jsx(oq,{c:t},n);case"progress":return x.jsx(cq,{c:t},n);case"table":return x.jsx(uq,{c:t},n);case"card":return x.jsx(dq,{c:t},n);case"badge":return x.jsx(hq,{c:t},n)}})})}const d0="_expxagents",lu=[.72,.78,.85,.95,1.08,1.2],mq=2;function gq({file:e,onRemove:t}){return x.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:[x.jsx("span",{style:{opacity:.6},children:"📎"}),x.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),x.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 yq({message:e,fontSize:t}){if(e.role==="agent_dm")return x.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:[x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--accent)",fontWeight:600,marginBottom:4,letterSpacing:"0.02em"},children:e.agentName}),x.jsx("div",{style:{color:"var(--text-primary)",fontSize:`${t}rem`,lineHeight:1.55},children:x.jsx(L1,{content:e.content})})]});const n=e.role==="user";return x.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:x.jsx("div",{style:{color:"var(--text-primary)",fontSize:`${t}rem`,lineHeight:1.55},children:n?x.jsx("span",{style:{whiteSpace:"pre-wrap"},children:e.content}):x.jsx(L1,{content:e.content})})})}function xq({conv:e,isActive:t,onSelect:n,onDelete:i}){const[r,s]=B.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 x.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:[x.jsxs("div",{style:{flex:1,minWidth:0},children:[x.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"}),x.jsxs("div",{style:{fontSize:"0.6rem",fontFamily:"var(--font-mono)",color:"var(--text-muted)",marginTop:2},children:[f," ",c]})]}),r&&x.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 bq(){const[e,t]=B.useState(""),[n,i]=B.useState([]),[r,s]=B.useState(mq),[l,c]=B.useState(!1),[f,p]=B.useState(""),[m,g]=B.useState(0),b=B.useRef(null),_=B.useRef(null),S=B.useRef(null),A=B.useRef(null),T=wr(le=>le.selectedSquad),C=wr(le=>le.uiComponents[T??""]),N=or(le=>le.conversations),R=or(le=>le.conversationId),z=or(le=>le.messages),L=or(le=>le.streaming),D=or(le=>le.streamingText),F=or(le=>le.activity),Z=or(le=>le.error),K=or(le=>le.addUserMessage),V=or(le=>le.startStreaming),P=or(le=>le.loadHistory),G=or(le=>le.selectConversation),ne=or(le=>le.deleteConversation);B.useEffect(()=>{P(d0)},[P]),B.useEffect(()=>{var le,Re;(Re=(le=b.current)==null?void 0:le.scrollIntoView)==null||Re.call(le,{behavior:"smooth"})},[z,D]);const X=B.useCallback(()=>{const le=_.current;le&&(le.style.height="auto",le.style.height=Math.min(le.scrollHeight,200)+"px")},[]);B.useEffect(()=>{X()},[e,X]);const W=B.useCallback(le=>{if(le.startsWith("/")){const Re=le.slice(1);p(Re),c(!0),g(0)}else c(!1)},[]),O=B.useCallback(()=>xT.filter(le=>le.command.toLowerCase().includes(f.toLowerCase())||le.description.toLowerCase().includes(f.toLowerCase())),[f]),Y=B.useCallback(le=>{var Re;t("/"+le.command+(le.args?" ":"")),c(!1),(Re=_.current)==null||Re.focus()},[]),$=B.useCallback(()=>{L||W4(d0)},[L]),Q=B.useCallback(le=>{L||ne(le,d0)},[L,ne]),H=B.useCallback(le=>{L||le===R||G(le)},[L,R,G]),I=B.useCallback(()=>{const le=e.trim();!le||L||(K(le),V(),tA(d0,le,n.length>0?n:void 0),t(""),i([]),c(!1),_.current&&(_.current.style.height="auto"))},[e,L,n,K,V]),J=B.useCallback(le=>{if(l){const Re=O();if(le.key==="ArrowDown"){le.preventDefault(),g(Le=>Math.min(Le+1,Re.length-1));return}if(le.key==="ArrowUp"){le.preventDefault(),g(Le=>Math.max(Le-1,0));return}if(le.key==="Enter"&&!le.shiftKey){le.preventDefault(),Re[m]&&Y(Re[m]);return}if(le.key==="Escape"){le.preventDefault(),c(!1);return}if(le.key==="Tab"){le.preventDefault(),Re[m]&&Y(Re[m]);return}}le.key==="Enter"&&!le.shiftKey&&(le.preventDefault(),I())},[l,O,m,Y,I]),q=B.useCallback(le=>{const Re=le.target.value;t(Re),W(Re)},[W]),oe=B.useCallback(async le=>{var Le;if(!le)return;const Re=[];for(const Be of Array.from(le))if(!(Be.size>512e3))try{const He=await Be.text();Re.push({name:Be.name,content:He})}catch{}i(Be=>[...Be,...Re]),(Le=_.current)==null||Le.focus()},[]),ie=B.useCallback(le=>{le.preventDefault(),le.stopPropagation(),oe(le.dataTransfer.files)},[oe]),de=B.useCallback(le=>{le.preventDefault(),le.stopPropagation()},[]),me=B.useCallback(le=>{i(Re=>Re.filter((Le,Be)=>Be!==le))},[]),ge=e.trim()&&!L;return x.jsxs("div",{style:{display:"flex",height:"100%"},onDrop:ie,onDragOver:de,children:[x.jsxs("div",{style:{width:220,borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",flexShrink:0},children:[x.jsx("div",{style:{padding:"var(--sp-2)"},children:x.jsx("button",{onClick:$,disabled:L,"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:L?"not-allowed":"pointer",fontFamily:"var(--font-mono)",fontSize:"0.72rem",fontWeight:600,letterSpacing:"0.02em",opacity:L?.5:1,transition:"all var(--duration-fast) var(--ease-out)"},children:"+ New Chat"})}),x.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&&x.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=>x.jsx(xq,{conv:le,isActive:le.id===R,onSelect:()=>H(le.id),onDelete:()=>Q(le.id)},le.id))]})]}),x.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[x.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:[x.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-"}),x.jsx("button",{onClick:()=>s(le=>Math.min(le+1,lu.length-1)),disabled:r===lu.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===lu.length-1?"var(--text-muted)":"var(--text-secondary)",cursor:r===lu.length-1?"not-allowed":"pointer",padding:"2px 7px",fontFamily:"var(--font-mono)",fontSize:"0.8rem",fontWeight:700,lineHeight:1.4,opacity:r===lu.length-1?.35:.7},children:"A+"})]}),x.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"var(--sp-4)",display:"flex",flexDirection:"column"},children:[z.length===0&&!L&&x.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flex:1,gap:"var(--sp-3)",opacity:.6},children:[x.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"}),x.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.82rem",fontFamily:"var(--font-display)"},children:"ExpxAgents Terminal"}),x.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.7rem",fontFamily:"var(--font-mono)"},children:"Type / to see available commands"})]}),z.map(le=>x.jsx(yq,{message:le,fontSize:lu[r]},le.id)),L&&D&&x.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:x.jsxs("div",{style:{color:"var(--text-primary)",fontSize:`${lu[r]}rem`,lineHeight:1.55},children:[x.jsx(L1,{content:D}),x.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"}})]})}),L&&!D&&x.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:x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[x.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"var(--accent)",animation:"pulse 1s ease-in-out infinite"}}),F||"Thinking..."]})}),Z&&x.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}),x.jsx("div",{ref:b}),C&&C.length>0&&x.jsx("div",{style:{borderTop:"1px solid #313244",marginTop:"8px"},children:x.jsx(pq,{components:C})})]}),x.jsxs("div",{ref:A,style:{borderTop:"1px solid var(--border-subtle)",background:"var(--surface-1)",position:"relative"},children:[x.jsx("div",{style:{position:"relative",padding:"0 var(--sp-4)"},children:x.jsx(lq,{commands:xT,filter:f,selectedIndex:m,onSelect:Y,visible:l})}),n.length>0&&x.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,padding:"var(--sp-2) var(--sp-4) 0"},children:n.map((le,Re)=>x.jsx(gq,{file:le,onRemove:()=>me(Re)},`${le.name}-${Re}`))}),x.jsxs("div",{style:{display:"flex",padding:"var(--sp-3) var(--sp-4)",gap:"var(--sp-2)",alignItems:"flex-end"},children:[x.jsx("button",{onClick:()=>{var le;return(le=S.current)==null?void 0:le.click()},disabled:L,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:L?"not-allowed":"pointer",padding:"6px 8px",fontSize:"1rem",lineHeight:1,opacity:L?.4:.7,transition:"opacity var(--duration-fast) var(--ease-out)",flexShrink:0},"aria-label":"Attach file",children:"📎"}),x.jsx("input",{ref:S,type:"file",multiple:!0,style:{display:"none"},onChange:le=>oe(le.target.files)}),x.jsx("textarea",{ref:_,className:"input",value:e,onChange:q,onKeyDown:J,placeholder:"Type a message... (/ for commands)",disabled:L,rows:1,style:{flex:1,resize:"none",overflow:"hidden",minHeight:36,maxHeight:200,lineHeight:1.5,fontFamily:"var(--font-mono)",fontSize:`${lu[r]}rem`}}),x.jsx("button",{onClick:I,disabled:!ge,"aria-label":"Send",className:ge?"btn btn-accent":"btn",style:{padding:"0 var(--sp-5)",cursor:ge?"pointer":"not-allowed",opacity:ge?1:.4,flexShrink:0,height:36},children:"Send"})]})]})]})]})}const vq={planned:"var(--status-idle)",executing:"var(--accent)",done:"var(--status-active)",failed:"var(--status-error)"},_q={planned:"planejado",executing:"executando",done:"finalizado",failed:"falhou"};function Sq({task:e,selected:t,onClick:n,onDelete:i}){const r=vq[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 x.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:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6},children:[x.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:_q[e.status]}),i&&x.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:"✕"})]}),x.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&&x.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&&x.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",color:"var(--text-muted)",marginTop:2,display:"flex",alignItems:"center",gap:4},children:[x.jsx("span",{children:"🤖"}),e.agent_name]}),e.step_id&&!e.agent_name&&x.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"&&x.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&&x.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&&x.jsxs("div",{style:{marginTop:6,fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--status-active)",display:"flex",alignItems:"center",gap:4},children:[x.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:"var(--status-active)",display:"inline-block"}}),"has output"]})]})}const yk=[{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 Av(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 Mv(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 Eq(){const e=wr(W=>W.squads),t=wr(W=>W.activeStates),[n,i]=B.useState(null),[r,s]=B.useState(""),[l,c]=B.useState([]),[f,p]=B.useState(null),[m,g]=B.useState(""),[b,_]=B.useState(""),[S,A]=B.useState(null),[T,C]=B.useState(null),[N,R]=B.useState(!1),z=B.useRef(null);B.useEffect(()=>{var W;if(N){const O=document.createElement("style");O.textContent='[data-layout="header"],[data-layout="sidebar"],[data-layout="statusbar"]{display:none!important}',document.head.appendChild(O),z.current=O}else(W=z.current)==null||W.remove(),z.current=null;return()=>{var O;(O=z.current)==null||O.remove(),z.current=null}},[N]);const L=n;B.useEffect(()=>{if(!L){c([]),C(null);return}const W=L==="__all__"?"/api/kanban/tasks":`/api/kanban/${L}/tasks`;fetch(W,{credentials:"include"}).then(O=>O.json()).then(O=>c(Array.isArray(O)?O:[])).catch(()=>c([]))},[L]),B.useEffect(()=>{const W=O=>{const Y=O.detail;if(!(Y!=null&&Y.activityId)||!L)return;const $=L==="__all__"?"/api/kanban/tasks":`/api/kanban/${L}/tasks`;fetch($,{credentials:"include"}).then(Q=>Q.json()).then(Q=>{const H=Array.isArray(Q)?Q:[];c(H),C(I=>I?H.find(q=>q.id===I.id)??null:null)}).catch(()=>{})};return window.addEventListener("kanban:task_updated",W),()=>window.removeEventListener("kanban:task_updated",W)},[L]);const D=B.useMemo(()=>yk.map(W=>({...W,tasks:l.filter(O=>O.status===W.key).sort((O,Y)=>O.position-Y.position)})),[l]),F=e.filter(W=>{if(!r)return!0;const O=r.toLowerCase();return W.name.toLowerCase().includes(O)||W.code.toLowerCase().includes(O)}),Z=B.useCallback(async W=>{if(!L||!m.trim())return;const O=await fetch(`/api/kanban/${L}/tasks`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:m.trim(),description:b.trim()||void 0,status:W})});if(O.ok){const Y=await O.json();c($=>[...$,Y]),g(""),_(""),p(null)}},[L,m,b]),K=B.useCallback(async W=>{if(!L)return;(await fetch(`/api/kanban/${L}/tasks/${W}`,{method:"DELETE",credentials:"include"})).ok&&(c(Y=>Y.filter($=>$.id!==W)),(T==null?void 0:T.id)===W&&C(null))},[L,T]),V=B.useCallback(async(W,O)=>{if(!L)return;const Y=l.find(Q=>Q.id===W);if(!Y||Y.status===O)return;c(Q=>Q.map(H=>H.id===W?{...H,status:O}:H));const $=await fetch(`/api/kanban/${L}/tasks/${W}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:O})});if($.ok){const Q=await $.json();c(H=>H.map(I=>I.id===W?Q:I)),(T==null?void 0:T.id)===W&&C(Q),O==="executing"&&tA(L,`Execute a seguinte tarefa do kanban: ${Y.title}${Y.description?" — "+Y.description:""}`)}else c(Q=>Q.map(H=>H.id===W?Y:H))},[L,l,T]),P=B.useCallback(async(W,O)=>{if(!L)return;const Y=await fetch(`/api/kanban/${L}/tasks/${W}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({result:O})});if(Y.ok){const $=await Y.json();c(Q=>Q.map(H=>H.id===W?$:H)),C($)}},[L]),G=B.useCallback((W,O)=>{W.preventDefault(),W.dataTransfer.dropEffect="move",A(O)},[]),ne=B.useCallback(()=>{A(null)},[]),X=B.useCallback((W,O)=>{W.preventDefault(),A(null);const Y=W.dataTransfer.getData("text/plain");if(!Y.startsWith("task:"))return;const $=Y.replace("task:","");V($,O)},[V]);return x.jsxs("div",{style:{display:"flex",height:"100%",overflow:"hidden"},children:[x.jsxs("div",{style:{width:240,minWidth:240,borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[x.jsxs("div",{style:{padding:"8px 14px",borderBottom:"1px solid var(--border-subtle)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em"},children:"Squads"}),x.jsx("button",{onClick:()=>R(W=>!W),title:N?"Voltar ao modo normal":"Modo foco — tela cheia",style:{background:N?"rgba(0,200,255,0.1)":"transparent",border:`1px solid ${N?"var(--accent)":"var(--border-subtle)"}`,color:N?"var(--accent)":"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.58rem",padding:"2px 7px",borderRadius:3},children:N?"← Normal":"⛶ Foco"})]}),x.jsx("div",{style:{padding:"8px 10px",borderBottom:"1px solid var(--border-subtle)"},children:x.jsx("input",{type:"text",placeholder:"Search squads...",value:r,onChange:W=>s(W.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"}})}),x.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"6px 8px"},children:[x.jsxs("button",{onClick:()=>{i("__all__"),C(null)},style:{width:"100%",background:L==="__all__"?"var(--accent-glow)":"none",border:L==="__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:[x.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",flexShrink:0}}),x.jsxs("div",{style:{overflow:"hidden"},children:[x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:L==="__all__"?600:400,color:L==="__all__"?"var(--accent)":"var(--text-primary)"},children:"Todos"}),x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:"all squads"})]})]}),x.jsx("div",{style:{borderBottom:"1px solid var(--border-subtle)",margin:"4px 0 6px"}}),F.map(W=>{var $;const O=W.code===L,Y=!!t[W.code];return x.jsxs("button",{onClick:()=>{i(W.code),C(null)},style:{width:"100%",background:O?"var(--accent-glow)":"none",border:O?"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:[x.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:Y?"var(--status-active)":"var(--status-idle)",flexShrink:0}}),x.jsxs("div",{style:{overflow:"hidden"},children:[x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:O?600:400,color:O?"var(--accent)":"var(--text-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:W.name}),x.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:[(($=W.agents)==null?void 0:$.length)||0," agents"]})]})]},W.code)}),F.length===0&&x.jsx("div",{style:{padding:"16px 10px",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)",textAlign:"center"},children:"No squads found"})]})]}),x.jsx("div",{style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:L?x.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[x.jsx("div",{style:{display:"flex",gap:"var(--sp-4)",padding:"var(--sp-5)",flex:1,overflow:"auto"},children:D.map((W,O)=>{const Y=S===W.key;return x.jsxs("div",{"data-testid":`column-${W.key}`,onDragOver:$=>G($,W.key),onDragLeave:ne,onDrop:$=>X($,W.key),style:{flex:1,background:Y?"rgba(0, 200, 255, 0.04)":"var(--surface-2)",border:Y?"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) ${O*80}ms both`,transition:"background 0.15s ease, border-color 0.15s ease"},children:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-4)",paddingBottom:"var(--sp-3)",borderBottom:`2px solid ${W.color}`},children:[x.jsx("span",{style:{fontWeight:600,fontSize:"0.82rem",color:"var(--text-primary)"},children:W.label}),x.jsx("span",{"data-testid":`count-${W.key}`,style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:700,color:W.color,background:W.glow,width:22,height:22,borderRadius:"var(--radius-full)",display:"flex",alignItems:"center",justifyContent:"center",border:`1px solid ${W.color}`},children:W.tasks.length})]}),x.jsx("div",{style:{flex:1,overflowY:"auto"},children:W.tasks.map($=>x.jsx(Sq,{task:$,selected:(T==null?void 0:T.id)===$.id,onClick:C,onDelete:$.activity_id?void 0:K},$.id))}),f===W.key?x.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:[x.jsx("input",{type:"text",placeholder:"Title",value:m,onChange:$=>g($.target.value),autoFocus:!0,onKeyDown:$=>{$.key==="Enter"&&m.trim()&&Z(W.key),$.key==="Escape"&&(p(null),g(""),_(""))},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}}),x.jsx("textarea",{placeholder:"Description (optional)",value:b,onChange:$=>_($.target.value),onKeyDown:$=>{$.key==="Escape"&&(p(null),g(""),_(""))},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}}),x.jsxs("div",{style:{display:"flex",gap:6},children:[x.jsx("button",{onClick:()=>Z(W.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"}),x.jsx("button",{onClick:()=>{p(null),g(""),_("")},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"})]})]}):x.jsx("button",{"data-testid":`add-task-${W.key}`,onClick:()=>{p(W.key),g(""),_("")},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:$=>{$.currentTarget.style.borderColor="var(--accent-dim)",$.currentTarget.style.color="var(--accent)"},onMouseLeave:$=>{$.currentTarget.style.borderColor="var(--border-default)",$.currentTarget.style.color="var(--text-muted)"},children:"+ New Task"})]},W.key)})}),T&&x.jsx(wq,{task:T,onClose:()=>C(null),onMove:V,onUpdateResult:P})]}):x.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:[x.jsx("span",{style:{fontSize:"1.5rem",color:"var(--text-muted)",opacity:.4},children:"▦"}),x.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.85rem"},children:"Select a squad to view the kanban"})]})})]})}function wq({task:e,onClose:t,onMove:n,onUpdateResult:i}){const[r,s]=B.useState(!1),[l,c]=B.useState(e.result||"");B.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 x.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:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)"},children:[x.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"}),x.jsx("button",{onClick:t,style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:"1rem",padding:"0 4px"},children:"✕"})]}),x.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"16px"},children:[x.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&&x.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.78rem",color:"var(--text-secondary)",lineHeight:1.5,marginBottom:16},children:e.description}),x.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,marginBottom:20,padding:"12px",background:"var(--surface-2)",borderRadius:"var(--radius-sm)"},children:[x.jsxs("div",{children:[x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Created"}),x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:Av(e.created_at)})]}),x.jsxs("div",{children:[x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Started"}),x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:Av(e.started_at)})]}),x.jsxs("div",{children:[x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Finished"}),x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:Av(e.finished_at)})]}),x.jsxs("div",{children:[x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Duration"}),x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:Mv(e.started_at,e.finished_at)?"var(--accent)":"var(--text-secondary)",fontWeight:Mv(e.started_at,e.finished_at)?600:400},children:Mv(e.started_at,e.finished_at)??"—"})]})]}),x.jsxs("div",{style:{marginBottom:20},children:[x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:8},children:"Move to"}),x.jsx("div",{style:{display:"flex",gap:6},children:yk.filter(m=>m.key!==e.status).map(m=>x.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))})]}),x.jsxs("div",{children:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em"},children:"Output / Result"}),!r&&x.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?x.jsxs("div",{children:[x.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}}),x.jsxs("div",{style:{display:"flex",gap:6},children:[x.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"}),x.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?x.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}):x.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 Tq(){const e=El(R=>R.user),[t,n]=B.useState([]),[i,r]=B.useState(!0),[s,l]=B.useState(""),[c,f]=B.useState(""),[p,m]=B.useState("viewer"),[g,b]=B.useState(null),[_,S]=B.useState(null),A=B.useCallback(async()=>{try{const R=await fetch("/api/users",{credentials:"include"});if(R.ok){const z=await R.json();n(z.users)}}catch{b("Failed to load users")}finally{r(!1)}},[]);B.useEffect(()=>{A()},[A]);const T=async()=>{if(!(!s.trim()||!c.trim())){b(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 z=await R.json();b(z.error||"Failed to create user");return}l(""),f(""),m("viewer"),await A()}catch{b("Network error")}}},C=async(R,z)=>{try{(await fetch(`/api/users/${R}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:z}),credentials:"include"})).ok&&await A()}catch{b("Failed to update role")}},N=async R=>{try{(await fetch(`/api/users/${R}`,{method:"DELETE",credentials:"include"})).ok&&(S(null),await A())}catch{b("Failed to delete user")}};return i?x.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..."}):x.jsxs("div",{children:[x.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"User Management"}),g&&x.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}),x.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-5)",flexWrap:"wrap",alignItems:"center"},children:[x.jsx("input",{className:"input",placeholder:"Username",value:s,onChange:R=>l(R.target.value),style:{flex:1,minWidth:120}}),x.jsx("input",{className:"input",placeholder:"Password",type:"password",value:c,onChange:R=>f(R.target.value),style:{flex:1,minWidth:120}}),x.jsxs("select",{className:"input",value:p,onChange:R=>m(R.target.value),style:{minWidth:100},children:[x.jsx("option",{value:"viewer",children:"viewer"}),x.jsx("option",{value:"operator",children:"operator"}),x.jsx("option",{value:"admin",children:"admin"})]}),x.jsx("button",{onClick:T,className:"btn btn-accent",children:"Create User"})]}),x.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[x.jsx("thead",{children:x.jsx("tr",{style:{borderBottom:"1px solid var(--border-default)"},children:["Username","Email","Role","Last Login","Actions"].map((R,z)=>x.jsx("th",{style:{textAlign:z===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))})}),x.jsx("tbody",{children:t.map(R=>x.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[x.jsx("td",{style:{padding:"10px 12px",color:"var(--text-primary)",fontSize:"0.82rem"},children:R.username}),x.jsx("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:R.email||"—"}),x.jsx("td",{style:{padding:"10px 12px"},children:R.id===(e==null?void 0:e.id)?x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:R.role}):x.jsxs("select",{className:"input",value:R.role,onChange:z=>C(R.id,z.target.value),style:{padding:"4px 8px",fontSize:"0.75rem"},children:[x.jsx("option",{value:"viewer",children:"viewer"}),x.jsx("option",{value:"operator",children:"operator"}),x.jsx("option",{value:"admin",children:"admin"})]})}),x.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():"—"}),x.jsx("td",{style:{padding:"10px 12px",textAlign:"right"},children:R.id!==(e==null?void 0:e.id)&&(_===R.id?x.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-2)",alignItems:"center"},children:[x.jsx("span",{style:{color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:"Confirm?"}),x.jsx("button",{onClick:()=>N(R.id),className:"btn btn-sm btn-danger",children:"Yes"}),x.jsx("button",{onClick:()=>S(null),className:"btn btn-sm",children:"No"})]}):x.jsx("button",{onClick:()=>S(R.id),className:"btn btn-sm btn-danger",children:"Delete"}))})]},R.id))})]})]})}function Cq(){const e=wr(f=>f.selectedSquad),t=wr(f=>f.activeStates),[n,i]=B.useState(null),[r,s]=B.useState(!1),l=e?t[e]:null;if(B.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 x.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontSize:"0.85rem"},children:"Select a squad to view details"});if(r)return x.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 x.jsxs("div",{children:[x.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"Squad Info"}),n&&x.jsxs(x.Fragment,{children:[x.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[x.jsx("div",{style:c,children:"Name"}),x.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.9rem",fontWeight:600},children:n.name})]}),x.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[x.jsx("div",{style:c,children:"Description"}),x.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.85rem",lineHeight:1.5},children:n.description})]}),x.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[x.jsx("div",{style:c,children:"Agents"}),x.jsx("div",{style:{display:"flex",gap:"var(--sp-2)",flexWrap:"wrap"},children:n.agents.map(f=>x.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))})]}),x.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[x.jsx("div",{style:c,children:"Pipeline Steps"}),x.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:n.pipeline.steps.map((f,p)=>x.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:[x.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}),x.jsx("span",{style:{color:"var(--text-primary)"},children:f.label}),x.jsx("span",{style:{fontFamily:"var(--font-mono)",color:"var(--text-muted)",fontSize:"0.68rem",marginLeft:"auto"},children:f.agent})]},f.id))})]})]}),l&&x.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[x.jsx("div",{style:c,children:"Current State"}),x.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 Aq(){const[e,t]=B.useState(null),[n,i]=B.useState(null),[r,s]=B.useState(!0),[l,c]=B.useState(null),f=B.useCallback(async()=>{s(!0);try{const g=await fetch("/api/health",{credentials:"include"});if(g.ok){const b=await g.json();t(b),i(b.status==="ok")}else i(!1)}catch{i(!1)}finally{s(!1),c(new Date().toLocaleTimeString())}},[]);B.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 x.jsxs("div",{children:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-4)"},children:[x.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)"},children:"Server Info"}),x.jsx("button",{onClick:f,className:"btn btn-sm",children:"Refresh"})]}),x.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[x.jsx("div",{style:p,children:"Health Status"}),x.jsxs("div",{style:m,children:[x.jsx("span",{style:{color:"var(--text-primary)"},children:"API Server"}),r?x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)",animation:"pulse 1.5s ease-in-out infinite"},children:"Checking..."}):x.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:[x.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"]})]})]}),x.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[x.jsx("div",{style:p,children:"Environment"}),x.jsxs("div",{style:m,children:[x.jsx("span",{style:{color:"var(--text-primary)"},children:"API Port"}),x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:"3001"})]}),x.jsxs("div",{style:m,children:[x.jsx("span",{style:{color:"var(--text-primary)"},children:"Dashboard Port (dev)"}),x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:"5173"})]})]}),l&&x.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textAlign:"right"},children:["Last checked: ",l]})]})}const Mq=[{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 Rq(){const[e,t]=B.useState({}),[n,i]=B.useState(!0),[r,s]=B.useState(!1),[l,c]=B.useState(null),[f,p]=B.useState(new Set);B.useEffect(()=>{fetch("/api/settings/env").then(b=>b.json()).then(b=>{t(b.settings||{}),i(!1)}).catch(()=>i(!1))},[]);const m=(b,_)=>{t(S=>({...S,[b]:_})),p(S=>new Set(S).add(b)),c(null)},g=async()=>{if(f.size===0)return;s(!0),c(null);const b={};for(const _ of f)b[_]=e[_]||"";try{const _=await fetch("/api/settings/env",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)});if(_.ok){const S=await _.json();t(S.settings),p(new Set),c({type:"success",text:"Settings saved successfully"})}else{const S=await _.json();c({type:"error",text:S.error||"Failed to save"})}}catch{c({type:"error",text:"Network error"})}finally{s(!1)}};return n?x.jsx("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."}):x.jsxs("div",{style:{maxWidth:640},children:[x.jsx("div",{style:{marginBottom:"var(--sp-4)"},children:x.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."})}),x.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:Mq.map(b=>x.jsxs("div",{children:[x.jsx("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-secondary)",fontWeight:600,letterSpacing:"0.04em",marginBottom:4},children:b.label}),x.jsx("input",{type:b.type,value:e[b.key]||"",onChange:_=>m(b.key,_.target.value),placeholder:b.hint,style:{width:"100%",padding:"8px 12px",background:"var(--surface-2)",border:f.has(b.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"}}),x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:b.hint})]},b.key))}),x.jsxs("div",{style:{marginTop:"var(--sp-4)",display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[x.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&&x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:l.type==="success"?"var(--status-active)":"var(--status-error)"},children:l.text})]})]})}function kq(){const[e,t]=B.useState([]),[n,i]=B.useState(!0),[r,s]=B.useState(null),[l,c]=B.useState(null),[f,p]=B.useState(""),[m,g]=B.useState(""),[b,_]=B.useState(""),[S,A]=B.useState(""),[T,C]=B.useState(null),[N,R]=B.useState(""),[z,L]=B.useState(""),[D,F]=B.useState(""),[Z,K]=B.useState(""),V=B.useCallback(async()=>{try{const O=await fetch("/api/team",{credentials:"include"});if(O.ok){const Y=await O.json();t(Y.members)}}catch{s("Failed to load team members")}finally{i(!1)}},[]);B.useEffect(()=>{V()},[V]);const P=async()=>{if(!(!f.trim()||!m.trim())){s(null);try{const O=await fetch("/api/team",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:f.trim(),role:m.trim(),email:b.trim()||void 0,phone:S.trim()||void 0}),credentials:"include"});if(!O.ok){const Y=await O.json();s(Y.error||"Failed to create team member");return}p(""),g(""),_(""),A(""),await V()}catch{s("Network error")}}},G=O=>{C(O.id),R(O.name),L(O.role),F(O.email||""),K(O.phone||"")},ne=()=>{C(null)},X=async()=>{if(!(!T||!N.trim()||!z.trim())){s(null);try{(await fetch(`/api/team/${T}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:N.trim(),role:z.trim(),email:D.trim()||void 0,phone:Z.trim()||void 0}),credentials:"include"})).ok&&(C(null),await V())}catch{s("Failed to update member")}}},W=async O=>{try{(await fetch(`/api/team/${O}`,{method:"DELETE",credentials:"include"})).ok&&(c(null),await V())}catch{s("Failed to delete member")}};return n?x.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..."}):x.jsxs("div",{children:[x.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"Team Members"}),r&&x.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}),x.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-5)",flexWrap:"wrap",alignItems:"center"},children:[x.jsx("input",{className:"input",placeholder:"Name *",value:f,onChange:O=>p(O.target.value),style:{flex:1,minWidth:120}}),x.jsx("input",{className:"input",placeholder:"Role *",value:m,onChange:O=>g(O.target.value),style:{flex:1,minWidth:120}}),x.jsx("input",{className:"input",placeholder:"Email",type:"email",value:b,onChange:O=>_(O.target.value),style:{flex:1,minWidth:150}}),x.jsx("input",{className:"input",placeholder:"Phone",type:"tel",value:S,onChange:O=>A(O.target.value),style:{flex:1,minWidth:130}}),x.jsx("button",{onClick:P,className:"btn btn-accent",children:"Add Member"})]}),x.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[x.jsx("thead",{children:x.jsx("tr",{style:{borderBottom:"1px solid var(--border-default)"},children:["Name","Role","Email","Phone","Actions"].map((O,Y)=>x.jsx("th",{style:{textAlign:Y===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:O},O))})}),x.jsxs("tbody",{children:[e.length===0&&x.jsx("tr",{children:x.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(O=>T===O.id?x.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-3)"},children:[x.jsx("td",{style:{padding:"6px 12px"},children:x.jsx("input",{className:"input",value:N,onChange:Y=>R(Y.target.value),style:{width:"100%",fontSize:"0.82rem"}})}),x.jsx("td",{style:{padding:"6px 12px"},children:x.jsx("input",{className:"input",value:z,onChange:Y=>L(Y.target.value),style:{width:"100%",fontSize:"0.82rem"}})}),x.jsx("td",{style:{padding:"6px 12px"},children:x.jsx("input",{className:"input",value:D,onChange:Y=>F(Y.target.value),style:{width:"100%",fontSize:"0.82rem"}})}),x.jsx("td",{style:{padding:"6px 12px"},children:x.jsx("input",{className:"input",value:Z,onChange:Y=>K(Y.target.value),style:{width:"100%",fontSize:"0.82rem"}})}),x.jsx("td",{style:{padding:"6px 12px",textAlign:"right"},children:x.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-2)"},children:[x.jsx("button",{onClick:X,className:"btn btn-sm btn-accent",children:"Save"}),x.jsx("button",{onClick:ne,className:"btn btn-sm",children:"Cancel"})]})})]},O.id):x.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[x.jsx("td",{style:{padding:"10px 12px",color:"var(--text-primary)",fontSize:"0.82rem"},children:O.name}),x.jsx("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:O.role}),x.jsx("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:O.email||"—"}),x.jsx("td",{style:{padding:"10px 12px",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)"},children:O.phone||"—"}),x.jsx("td",{style:{padding:"10px 12px",textAlign:"right"},children:l===O.id?x.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-2)",alignItems:"center"},children:[x.jsx("span",{style:{color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:"Confirm?"}),x.jsx("button",{onClick:()=>W(O.id),className:"btn btn-sm btn-danger",children:"Yes"}),x.jsx("button",{onClick:()=>c(null),className:"btn btn-sm",children:"No"})]}):x.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-2)"},children:[x.jsx("button",{onClick:()=>G(O),className:"btn btn-sm",children:"Edit"}),x.jsx("button",{onClick:()=>c(O.id),className:"btn btn-sm btn-danger",children:"Delete"})]})})]},O.id))]})]})]})}const Nq={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"},Oq={dev:"⌨",messaging:"💬",ads:"📢",crm:"📊",support:"🎧",email:"✉",sales:"💰",pm:"📋",monitoring:"🔍",cloud:"☁",design:"🎨"};function Dq(){const[e,t]=B.useState([]),[n,i]=B.useState([]),[r,s]=B.useState(!0),[l,c]=B.useState(null),[f,p]=B.useState(null),[m,g]=B.useState(!1),[b,_]=B.useState({}),[S,A]=B.useState(!1),[T,C]=B.useState(null),[N,R]=B.useState(""),z=B.useCallback(async()=>{try{const[G,ne]=await Promise.all([fetch("/api/integrations/catalog",{credentials:"include"}),fetch("/api/integrations",{credentials:"include"})]);if(G.ok){const X=await G.json();t(X.providers)}if(ne.ok){const X=await ne.json();i(X.integrations)}}catch{c("Failed to load integrations")}finally{s(!1)}},[]);B.useEffect(()=>{z()},[z]);const L=G=>n.find(ne=>ne.provider===G),D=G=>{const ne=L(G.key),X={};for(const W of G.fields)X[W.key]=(ne==null?void 0:ne.config[W.key])||"";_(X),A((ne==null?void 0:ne.enabled)??!1),p(G.key),c(null)},F=async()=>{if(f){g(!0),c(null);try{const G=await fetch(`/api/integrations/${f}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:S,config:b}),credentials:"include"});if(!G.ok){const ne=await G.json();c(ne.error||"Failed to save");return}await z(),p(null)}catch{c("Network error")}finally{g(!1)}}},Z=async G=>{try{(await fetch(`/api/integrations/${G}`,{method:"DELETE",credentials:"include"})).ok&&(await z(),f===G&&p(null))}catch{c("Failed to disconnect")}},K=Array.from(new Set(e.map(G=>G.category))),V=N.toLowerCase(),P=e.filter(G=>!(T&&G.category!==T||N&&!G.name.toLowerCase().includes(V)&&!G.description.toLowerCase().includes(V)));return r?x.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..."}):x.jsxs("div",{children:[x.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-2)"},children:"Integrations"}),x.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"}),x.jsx("input",{className:"input",type:"text",placeholder:"Search integrations...",value:N,onChange:G=>R(G.target.value),style:{width:"100%",fontSize:"0.8rem",marginBottom:"var(--sp-3)"}}),l&&x.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}),x.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[x.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"}),K.map(G=>x.jsxs("button",{onClick:()=>C(G),style:{padding:"4px 12px",border:"1px solid",borderColor:T===G?"var(--accent)":"var(--border-subtle)",borderRadius:"var(--radius-sm)",background:T===G?"var(--accent)":"transparent",color:T===G?"#fff":"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",cursor:"pointer"},children:[Oq[G]||""," ",Nq[G]||G]},G))]}),x.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(260px, 1fr))",gap:"var(--sp-3)"},children:P.map(G=>{const ne=L(G.key),X=f===G.key;return x.jsxs("div",{style:{background:"var(--surface-3)",border:"1px solid",borderColor:ne!=null&&ne.enabled?"var(--status-running)":"var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-3)",transition:"all var(--duration-fast) var(--ease-out)",gridColumn:X?"1 / -1":void 0},children:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:X?"var(--sp-3)":0},children:[x.jsxs("div",{children:[x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[x.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:600,fontSize:"0.85rem",color:"var(--text-primary)"},children:G.name}),(ne==null?void 0:ne.enabled)&&x.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--status-running)",boxShadow:"0 0 4px var(--status-running)",display:"inline-block"}})]}),x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.68rem",color:"var(--text-muted)"},children:G.description})]}),x.jsx("button",{onClick:()=>X?p(null):D(G),className:"btn btn-sm",style:{flexShrink:0},children:X?"Close":ne?"Edit":"Configure"})]}),X&&x.jsxs("div",{style:{borderTop:"1px solid var(--border-subtle)",paddingTop:"var(--sp-3)"},children:[x.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:[x.jsx("input",{type:"checkbox",checked:S,onChange:W=>A(W.target.checked)}),"Enabled"]}),x.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:G.fields.map(W=>x.jsxs("div",{children:[x.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&&"*"]}),x.jsx("input",{className:"input",type:W.type==="password"?"password":"text",placeholder:W.placeholder||"",value:b[W.key]||"",onChange:O=>_(Y=>({...Y,[W.key]:O.target.value})),style:{width:"100%",fontSize:"0.8rem"}})]},W.key))}),x.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginTop:"var(--sp-3)",justifyContent:"flex-end"},children:[ne&&x.jsx("button",{onClick:()=>Z(G.key),className:"btn btn-sm btn-danger",children:"Disconnect"}),x.jsx("button",{onClick:()=>p(null),className:"btn btn-sm",children:"Cancel"}),x.jsx("button",{onClick:F,className:"btn btn-sm btn-accent",disabled:m,children:m?"Saving...":"Save"})]})]})]},G.key)})})]})}function zq(){const e=El(l=>l.user),t=(e==null?void 0:e.role)==="admin",[n,i]=B.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 x.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",padding:"var(--sp-5)",animation:"fadeIn 0.4s var(--ease-out) both"},children:[x.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[x.jsx("h2",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.1rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Settings"}),x.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Configuration and management"})]}),x.jsx("div",{style:{display:"flex",gap:"var(--sp-1)",marginBottom:"var(--sp-5)",borderBottom:"1px solid var(--border-subtle)"},children:s.map(l=>x.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:[x.jsx("span",{style:{fontSize:"0.75rem",opacity:.7},children:l.icon}),l.label]},l.key))}),x.jsxs("div",{style:{flex:1,overflow:"auto"},children:[n==="users"&&t&&x.jsx(Tq,{}),n==="team"&&x.jsx(kq,{}),n==="integrations"&&x.jsx(Dq,{}),n==="squad"&&x.jsx(Cq,{}),n==="server"&&x.jsx(Aq,{}),n==="env"&&t&&x.jsx(Rq,{})]})]})}const xk=[{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 jq(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 Rv(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=xk.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 Lq(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 bT(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 Bq(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 th={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"},Us={...th,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"},pa={fontFamily:"var(--font-mono)",fontSize:"0.62rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:4,display:"block"},ls={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 vT({children:e,onClose:t,title:n,wide:i}){return x.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:x.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:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)",flexShrink:0},children:[x.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.9rem",color:"var(--text-primary)"},children:n}),x.jsx("button",{onClick:t,style:{...ls,padding:"4px 8px",fontSize:"0.7rem",background:"none",border:"none",color:"var(--text-muted)"},children:"✕"})]}),x.jsx("div",{style:{overflow:"auto",flex:1},children:e})]})})}function Iq(){var ur,Ee,ke;const e=ma(ce=>ce.jobs),t=ma(ce=>ce.loading),n=ma(ce=>ce.fetchJobs),i=ma(ce=>ce.createJob),r=ma(ce=>ce.deleteJob),s=ma(ce=>ce.pauseJob),l=ma(ce=>ce.resumeJob),c=ma(ce=>ce.triggerJob),f=ma(ce=>ce.history),p=ma(ce=>ce.historyLoading),m=ma(ce=>ce.fetchHistory),g=wr(ce=>ce.squads),[b,_]=B.useState(!1),[S,A]=B.useState(null),[T,C]=B.useState(null),[N,R]=B.useState(null),[z,L]=B.useState(""),[D,F]=B.useState(""),[Z,K]=B.useState("daily"),[V,P]=B.useState("0"),[G,ne]=B.useState("9"),[X,W]=B.useState("1"),[O,Y]=B.useState("1"),[$,Q]=B.useState("30"),[H,I]=B.useState("2"),[J,q]=B.useState(""),[oe,ie]=B.useState(""),[de,me]=B.useState("America/Sao_Paulo"),[ge,le]=B.useState("30"),[Re,Le]=B.useState("0");B.useEffect(()=>{n()},[n]);const Be=B.useCallback(()=>{F(""),K("daily"),P("0"),ne("9"),W("1"),Y("1"),Q("30"),I("2"),q(""),ie(""),me("America/Sao_Paulo"),le("30"),Le("0"),A(null)},[]),He=()=>{_(!1),Be()},Qe=()=>{Be(),_(!0)},ot=ce=>{F(ce.squad_name),ie(ce.prompt||""),me(ce.timezone||"America/Sao_Paulo"),le(String(ce.timeout_minutes||30)),Le(String(ce.retry_on_failure||0)),A(ce.squad_name);const Pe=ce.cron_expression.split(" ");if(Pe.length===5){const[ct,nn,di,,Zt]=Pe;ct.startsWith("*/")?(K("every_n_minutes"),Q(ct.replace("*/",""))):nn.startsWith("*/")?(K("every_n_hours"),I(nn.replace("*/","")),P(ct)):nn==="*"?(K("hourly"),P(ct)):di==="*"&&Zt==="*"?(K("daily"),P(ct),ne(nn)):di==="*"&&Zt!=="*"?(K("weekly"),P(ct),ne(nn),W(Zt)):Zt==="*"&&di!=="*"?(K("monthly"),P(ct),ne(nn),Y(di)):(K("custom"),q(ce.cron_expression))}else K("custom"),q(ce.cron_expression);_(!0)},Ue=Z==="custom"?J:jq(Z,{minute:V,hour:G,dayOfMonth:O,dayOfWeek:X,everyNMinutes:$,everyNHours:H}),wt=async()=>{if(!D||!Ue||!oe.trim())return;const ce={squad_name:D,cron_expression:Ue,prompt:oe.trim(),timezone:de||void 0,timeout_minutes:parseInt(ge)||30,retry_on_failure:parseInt(Re)||0};await i(ce)&&He()},Sn=ce=>{C(ce),R(null),m(ce)},En=()=>{C(null),R(null)},pn=ce=>ce==="active"?"var(--status-active)":ce==="paused"?"var(--status-warning)":"var(--status-error)",ui=ce=>ce==="active"?"var(--status-active-glow)":ce==="paused"?"var(--status-warning-glow)":"var(--status-error-glow)",Yr=g.filter(ce=>!e.some(Pe=>Pe.squad_name===ce.code)),ki=z.toLowerCase(),Qt=z?e.filter(ce=>{var Pe;return ce.squad_name.toLowerCase().includes(ki)||((Pe=ce.prompt)==null?void 0:Pe.toLowerCase().includes(ki))||ce.status.toLowerCase().includes(ki)||Rv(ce.cron_expression).toLowerCase().includes(ki)}):e;return x.jsxs("div",{style:{padding:"var(--sp-6)",animation:"fadeIn 0.4s var(--ease-out) both",width:"100%",boxSizing:"border-box"},children:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"var(--sp-4)"},children:[x.jsxs("div",{children:[x.jsx("h2",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.1rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Scheduler"}),x.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Autonomous job execution and monitoring"})]}),x.jsx("button",{"data-testid":"btn-new-schedule",onClick:Qe,style:{...ls,background:"var(--accent)",color:"var(--text-inverse)"},children:"+ New Schedule"})]}),e.length>0&&x.jsx("div",{style:{marginBottom:"var(--sp-4)"},children:x.jsx("input",{"data-testid":"search-jobs",type:"text",placeholder:"Search by name, prompt, status...",value:z,onChange:ce=>L(ce.target.value),style:{...th,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&&x.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&&!b&&x.jsxs("div",{style:{padding:"var(--sp-8)",textAlign:"center",color:"var(--text-muted)"},children:[x.jsx("div",{style:{fontSize:"1.5rem",marginBottom:"var(--sp-3)"},children:"⏣"}),x.jsx("p",{style:{fontSize:"0.85rem",marginBottom:"var(--sp-2)"},children:"No scheduled jobs"}),x.jsxs("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:["Click ",x.jsx("strong",{children:"+ New Schedule"})," to create your first automated job."]})]}),x.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"var(--sp-3)",width:"100%"},children:Qt.map((ce,Pe)=>x.jsxs("div",{"data-testid":`job-${ce.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:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[x.jsx("span",{style:{fontWeight:600,fontSize:"0.82rem",color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},children:ce.squad_name}),x.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:pn(ce.status),flexShrink:0,marginLeft:"var(--sp-2)"},children:[x.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:pn(ce.status),boxShadow:`0 0 8px ${ui(ce.status)}`,display:"inline-block",animation:ce.status==="active"?"statusPulse 2s ease-in-out infinite":"none"}}),ce.status]})]}),x.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-secondary)",display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[x.jsx("code",{style:{background:"var(--surface-3)",padding:"1px 5px",borderRadius:"var(--radius-xs)",fontSize:"0.6rem",flexShrink:0},children:ce.cron_expression}),x.jsx("span",{style:{color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Rv(ce.cron_expression)})]}),ce.prompt&&x.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:ce.prompt}),ce.last_run_at&&x.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:["Last: ",new Date(ce.last_run_at).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"}),ce.last_result&&x.jsxs("span",{children:[" — ",ce.last_result]})]}),x.jsxs("div",{style:{display:"flex",gap:"var(--sp-1)",flexWrap:"wrap",marginTop:"auto"},children:[x.jsx("button",{onClick:()=>ot(ce),style:{...ls,padding:"3px 8px",fontSize:"0.62rem",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)"},children:"Edit"}),ce.status==="active"?x.jsx("button",{onClick:()=>s(ce.squad_name),style:{...ls,padding:"3px 8px",fontSize:"0.62rem",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",color:"var(--status-warning)"},children:"Pause"}):x.jsx("button",{onClick:()=>l(ce.squad_name),style:{...ls,padding:"3px 8px",fontSize:"0.62rem",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",color:"var(--status-active)"},children:"Resume"}),x.jsx("button",{onClick:()=>c(ce.squad_name),style:{...ls,padding:"3px 8px",fontSize:"0.62rem",background:"var(--accent)",color:"var(--text-inverse)"},children:"Trigger"}),x.jsx("button",{"data-testid":`btn-history-${ce.squad_name}`,onClick:()=>Sn(ce.squad_name),style:{...ls,padding:"3px 8px",fontSize:"0.62rem",background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-muted)"},children:"Log"}),x.jsx("button",{onClick:()=>{confirm(`Delete schedule for ${ce.squad_name}?`)&&r(ce.squad_name)},style:{...ls,padding:"3px 6px",fontSize:"0.62rem",background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-muted)",marginLeft:"auto"},title:"Delete schedule",children:"✕"})]})]},ce.squad_name))}),!t&&z&&Qt.length===0&&e.length>0&&x.jsxs("div",{style:{padding:"var(--sp-6)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)"},children:['No jobs matching "',z,'"']}),b&&x.jsx(vT,{title:S?"Edit Schedule":"New Schedule",onClose:He,children:x.jsxs("div",{"data-testid":"schedule-form",style:{padding:"var(--sp-4)"},children:[x.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[x.jsx("label",{style:pa,children:"Squad"}),S?x.jsx("div",{style:{...th,background:"var(--surface-3)",color:"var(--text-secondary)"},children:S}):x.jsxs("select",{"data-testid":"select-squad",value:D,onChange:ce=>F(ce.target.value),style:Us,children:[x.jsx("option",{value:"",children:"Select a squad..."}),Yr.map(ce=>x.jsxs("option",{value:ce.code,children:[ce.name," (",ce.code,")"]},ce.code)),e.length===0&&g.length===0&&x.jsx("option",{disabled:!0,children:"No squads available"})]})]}),x.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[x.jsx("label",{style:pa,children:"Frequency"}),x.jsxs("select",{"data-testid":"select-frequency",value:Z,onChange:ce=>K(ce.target.value),style:Us,children:[x.jsx("option",{value:"every_n_minutes",children:"Every N minutes"}),x.jsx("option",{value:"every_n_hours",children:"Every N hours"}),x.jsx("option",{value:"hourly",children:"Hourly"}),x.jsx("option",{value:"daily",children:"Daily"}),x.jsx("option",{value:"weekly",children:"Weekly"}),x.jsx("option",{value:"monthly",children:"Monthly"}),x.jsx("option",{value:"custom",children:"Custom cron"})]})]}),x.jsxs("div",{style:{display:"flex",gap:"var(--sp-3)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[Z==="every_n_minutes"&&x.jsxs("div",{style:{flex:1,minWidth:120},children:[x.jsx("label",{style:pa,children:"Every (minutes)"}),x.jsx("select",{value:$,onChange:ce=>Q(ce.target.value),style:Us,children:[1,2,5,10,15,20,30].map(ce=>x.jsx("option",{value:String(ce),children:ce},ce))})]}),Z==="every_n_hours"&&x.jsxs(x.Fragment,{children:[x.jsxs("div",{style:{flex:1,minWidth:120},children:[x.jsx("label",{style:pa,children:"Every (hours)"}),x.jsx("select",{value:H,onChange:ce=>I(ce.target.value),style:Us,children:[2,3,4,6,8,12].map(ce=>x.jsx("option",{value:String(ce),children:ce},ce))})]}),x.jsxs("div",{style:{flex:1,minWidth:100},children:[x.jsx("label",{style:pa,children:"At minute"}),x.jsx("select",{value:V,onChange:ce=>P(ce.target.value),style:Us,children:Array.from({length:60},(ce,Pe)=>x.jsx("option",{value:String(Pe),children:String(Pe).padStart(2,"0")},Pe))})]})]}),Z==="hourly"&&x.jsxs("div",{style:{flex:1,minWidth:120},children:[x.jsx("label",{style:pa,children:"At minute"}),x.jsx("select",{value:V,onChange:ce=>P(ce.target.value),style:Us,children:Array.from({length:60},(ce,Pe)=>x.jsx("option",{value:String(Pe),children:String(Pe).padStart(2,"0")},Pe))})]}),(Z==="daily"||Z==="weekly"||Z==="monthly")&&x.jsxs(x.Fragment,{children:[x.jsxs("div",{style:{flex:1,minWidth:100},children:[x.jsx("label",{style:pa,children:"Hour"}),x.jsx("select",{value:G,onChange:ce=>ne(ce.target.value),style:Us,children:Array.from({length:24},(ce,Pe)=>x.jsx("option",{value:String(Pe),children:String(Pe).padStart(2,"0")},Pe))})]}),x.jsxs("div",{style:{flex:1,minWidth:100},children:[x.jsx("label",{style:pa,children:"Minute"}),x.jsx("select",{value:V,onChange:ce=>P(ce.target.value),style:Us,children:Array.from({length:60},(ce,Pe)=>x.jsx("option",{value:String(Pe),children:String(Pe).padStart(2,"0")},Pe))})]})]}),Z==="weekly"&&x.jsxs("div",{style:{flex:1,minWidth:140},children:[x.jsx("label",{style:pa,children:"Day of week"}),x.jsx("select",{value:X,onChange:ce=>W(ce.target.value),style:Us,children:xk.map(ce=>x.jsx("option",{value:ce.value,children:ce.label},ce.value))})]}),Z==="monthly"&&x.jsxs("div",{style:{flex:1,minWidth:120},children:[x.jsx("label",{style:pa,children:"Day of month"}),x.jsx("select",{value:O,onChange:ce=>Y(ce.target.value),style:Us,children:Array.from({length:31},(ce,Pe)=>x.jsx("option",{value:String(Pe+1),children:Pe+1},Pe+1))})]}),Z==="custom"&&x.jsxs("div",{style:{flex:1,minWidth:200},children:[x.jsx("label",{style:pa,children:"Cron expression"}),x.jsx("input",{type:"text",placeholder:"* * * * *",value:J,onChange:ce=>q(ce.target.value),style:th})]})]}),Ue&&x.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:[x.jsx("code",{style:{color:"var(--accent)",fontWeight:600},children:Ue}),x.jsx("span",{style:{color:"var(--text-muted)"},children:"—"}),x.jsx("span",{"data-testid":"cron-preview",style:{color:"var(--text-secondary)"},children:Rv(Ue)})]}),x.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[x.jsx("label",{style:pa,children:"Instruction for the agent"}),x.jsx("textarea",{"data-testid":"input-prompt",placeholder:"What should the squad do on each execution?",value:oe,onChange:ce=>ie(ce.target.value),rows:3,style:{...th,resize:"vertical",lineHeight:1.5}})]}),x.jsxs("div",{style:{display:"flex",gap:"var(--sp-3)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[x.jsxs("div",{style:{flex:2,minWidth:180},children:[x.jsx("label",{style:pa,children:"Timezone"}),x.jsxs("select",{value:de,onChange:ce=>me(ce.target.value),style:Us,children:[x.jsx("option",{value:"America/Sao_Paulo",children:"America/Sao_Paulo"}),x.jsx("option",{value:"America/New_York",children:"America/New_York"}),x.jsx("option",{value:"America/Chicago",children:"America/Chicago"}),x.jsx("option",{value:"America/Los_Angeles",children:"America/Los_Angeles"}),x.jsx("option",{value:"Europe/London",children:"Europe/London"}),x.jsx("option",{value:"Europe/Berlin",children:"Europe/Berlin"}),x.jsx("option",{value:"Asia/Tokyo",children:"Asia/Tokyo"}),x.jsx("option",{value:"UTC",children:"UTC"})]})]}),x.jsxs("div",{style:{flex:1,minWidth:100},children:[x.jsx("label",{style:pa,children:"Timeout (min)"}),x.jsx("input",{type:"number",min:1,max:480,value:ge,onChange:ce=>le(ce.target.value),style:th})]}),x.jsxs("div",{style:{flex:1,minWidth:100},children:[x.jsx("label",{style:pa,children:"Retries"}),x.jsx("select",{value:Re,onChange:ce=>Le(ce.target.value),style:Us,children:[0,1,2,3,4,5].map(ce=>x.jsx("option",{value:String(ce),children:ce},ce))})]})]}),x.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[x.jsx("button",{"data-testid":"btn-save-schedule",onClick:wt,disabled:!D||!Ue||!oe.trim(),style:{...ls,background:D&&Ue&&oe.trim()?"var(--accent)":"var(--surface-4)",color:D&&Ue&&oe.trim()?"var(--text-inverse)":"var(--text-muted)"},children:S?"Update":"Create"}),x.jsx("button",{onClick:He,style:{...ls,background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)"},children:"Cancel"})]})]})}),T&&x.jsx(vT,{title:`Execution Log — ${T}`,onClose:En,wide:!0,children:x.jsxs("div",{"data-testid":`history-${T}`,children:[x.jsx("div",{style:{display:"flex",justifyContent:"flex-end",padding:"6px 12px",borderBottom:"1px solid var(--border-subtle)"},children:x.jsxs("button",{"data-testid":`btn-refresh-${T}`,onClick:()=>m(T),disabled:p[T],style:{...ls,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:[x.jsx("span",{style:{display:"inline-block",animation:p[T]?"spin 1s linear infinite":"none"},children:"↻"}),"Refresh"]})}),p[T]&&x.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)&&x.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]&&((ur=f[T])==null?void 0:ur.length)>0&&x.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontFamily:"var(--font-mono)",fontSize:"0.68rem"},children:[x.jsx("thead",{children:x.jsx("tr",{style:{background:"var(--surface-3)"},children:["Status","Started","Finished","Duration","Attempt","Output"].map(ce=>x.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:ce},ce))})}),x.jsx("tbody",{children:f[T].map(ce=>{const Pe=Bq(ce.status),ct=N===ce.id;return x.jsxs("tr",{"data-testid":`activity-${ce.id}`,style:{borderBottom:"1px solid var(--border-subtle)",transition:"background 0.1s"},onMouseEnter:nn=>{nn.currentTarget.style.background="var(--surface-3)"},onMouseLeave:nn=>{nn.currentTarget.style.background="transparent"},children:[x.jsx("td",{style:{padding:"6px 8px"},children:x.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,color:Pe.color,fontWeight:600},children:[x.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:Pe.color,display:"inline-block",animation:ce.status==="running"?"statusPulse 2s ease-in-out infinite":"none"}}),Pe.label]})}),x.jsx("td",{style:{padding:"6px 8px",color:"var(--text-secondary)"},children:bT(ce.started_at)}),x.jsx("td",{style:{padding:"6px 8px",color:"var(--text-secondary)"},children:bT(ce.finished_at)}),x.jsx("td",{style:{padding:"6px 8px",color:"var(--text-secondary)",fontVariantNumeric:"tabular-nums"},children:Lq(ce.duration_ms)}),x.jsx("td",{style:{padding:"6px 8px",color:"var(--text-muted)",textAlign:"center"},children:ce.attempt??1}),x.jsx("td",{style:{padding:"6px 8px"},children:ce.result_summary?x.jsx("button",{"data-testid":`btn-output-${ce.id}`,onClick:()=>R(ct?null:ce.id),style:{...ls,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"}):x.jsx("span",{style:{color:"var(--text-muted)"},children:"—"})})]},ce.id)})})]}),N&&((Ee=f[T])==null?void 0:Ee.find(ce=>ce.id===N))&&x.jsxs("div",{"data-testid":`output-panel-${N}`,style:{padding:"var(--sp-3)",background:"var(--surface-0)",borderTop:"1px solid var(--border-subtle)"},children:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-2)"},children:[x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-muted)"},children:"Output"}),x.jsx("button",{onClick:()=>R(null),style:{...ls,padding:"2px 6px",fontSize:"0.6rem",background:"none",border:"none",color:"var(--text-muted)"},children:"✕"})]}),x.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(ce=>ce.id===N))==null?void 0:ke.result_summary})]})]})})]})}const vl=bu(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 Uq(){const e=vl(g=>g.leads),t=vl(g=>g.total),n=vl(g=>g.lists),i=vl(g=>g.tags),r=vl(g=>g.loading),s=vl(g=>g.fetchLeads),l=vl(g=>g.fetchLists),c=vl(g=>g.fetchTags),[f,p]=B.useState("");B.useEffect(()=>{s(),l(),c()},[s,l,c]);const m=()=>{s(f?{search:f}:{})};return x.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:[x.jsxs("div",{style:{display:"flex",gap:"var(--sp-3)"},children:[x.jsx(kv,{label:"Total Leads",value:t}),x.jsx(kv,{label:"Lists",value:n.length}),x.jsx(kv,{label:"Tags",value:i.length})]}),x.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[x.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"}}),x.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?x.jsx("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."}):x.jsx("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",overflow:"hidden"},children:x.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[x.jsx("thead",{children:x.jsx("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["Email","Name","Company","Status","Source","Created"].map(g=>x.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))})}),x.jsxs("tbody",{children:[e.map(g=>x.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[x.jsx("td",{style:ya,children:g.email}),x.jsx("td",{style:ya,children:g.name||"—"}),x.jsx("td",{style:ya,children:g.company||"—"}),x.jsx("td",{style:ya,children:x.jsx(bk,{status:g.status})}),x.jsx("td",{style:ya,children:g.source||"—"}),x.jsx("td",{style:{...ya,fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:new Date(g.created_at).toLocaleDateString()})]},g.id)),e.length===0&&x.jsx("tr",{children:x.jsx("td",{colSpan:6,style:{...ya,textAlign:"center",color:"var(--text-muted)"},children:"No leads found"})})]})]})})]})}function Hq(){const e=vl(i=>i.campaigns),t=vl(i=>i.loading),n=vl(i=>i.fetchCampaigns);return B.useEffect(()=>{n()},[n]),x.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:t?x.jsx("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."}):x.jsx("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",overflow:"hidden"},children:x.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[x.jsx("thead",{children:x.jsx("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["Name","Subject","Status","Recipients","Sent","Bounced","Created"].map(i=>x.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))})}),x.jsxs("tbody",{children:[e.map(i=>x.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[x.jsx("td",{style:ya,children:i.name}),x.jsx("td",{style:ya,children:i.subject}),x.jsx("td",{style:ya,children:x.jsx(bk,{status:i.status})}),x.jsx("td",{style:{...ya,fontFamily:"var(--font-mono)"},children:i.total_recipients}),x.jsx("td",{style:{...ya,fontFamily:"var(--font-mono)"},children:i.sent_count}),x.jsx("td",{style:{...ya,fontFamily:"var(--font-mono)"},children:i.bounce_count}),x.jsx("td",{style:{...ya,fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:new Date(i.created_at).toLocaleDateString()})]},i.id)),e.length===0&&x.jsx("tr",{children:x.jsx("td",{colSpan:7,style:{...ya,textAlign:"center",color:"var(--text-muted)"},children:"No campaigns yet"})})]})]})})})}function Pq(){return x.jsxs("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-4)"},children:[x.jsx("h3",{style:{fontFamily:"var(--font-display)",fontSize:"0.9rem",color:"var(--text-primary)",marginBottom:"var(--sp-3)"},children:"Amazon SES Configuration"}),x.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)",lineHeight:1.8},children:[x.jsx("p",{children:"Configure these environment variables on the server:"}),x.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:[x.jsx("code",{children:"AWS_ACCESS_KEY_ID=..."}),x.jsx("br",{}),x.jsx("code",{children:"AWS_SECRET_ACCESS_KEY=..."}),x.jsx("br",{}),x.jsx("code",{children:"AWS_REGION=us-east-1"}),x.jsx("br",{}),x.jsx("code",{children:"SES_FROM_EMAIL=noreply@yourdomain.com"}),x.jsx("br",{}),x.jsx("code",{children:"SES_RATE_LIMIT=14"}),x.jsx("br",{}),x.jsx("code",{children:"SERVER_URL=https://yourdomain.com"})]})]})]})}function kv({label:e,value:t}){return x.jsxs("div",{style:{flex:1,background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-3)"},children:[x.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}),x.jsx("div",{style:{fontFamily:"var(--font-display)",fontSize:"1.4rem",fontWeight:700,color:"var(--accent)"},children:t})]})}function bk({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 x.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 ya={padding:"10px 14px",fontSize:"0.82rem",color:"var(--text-secondary)"};function Fq(){const[e,t]=B.useState("leads"),n=[{key:"leads",label:"Leads"},{key:"campaigns",label:"Campaigns"},{key:"settings",label:"Settings"}];return x.jsxs("div",{style:{padding:"var(--sp-4)",maxWidth:1100,margin:"0 auto"},children:[x.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[x.jsx("h2",{style:{fontFamily:"var(--font-display)",fontSize:"1.1rem",fontWeight:700,color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Email Engine"}),x.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Lead management, campaigns, and Amazon SES integration"})]}),x.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=>x.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"&&x.jsx(Uq,{}),e==="campaigns"&&x.jsx(Hq,{}),e==="settings"&&x.jsx(Pq,{})]})}function Ii(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=Ii(e[n]))!==""&&(t+=(t&&" ")+i);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var qq={value:()=>{}};function vx(){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 A0(n)}function A0(e){this._=e}function Gq(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}})}A0.prototype=vx.prototype={constructor:A0,on:function(e,t){var n=this._,i=Gq(e+"",n),r,s=-1,l=i.length;if(arguments.length<2){for(;++s<l;)if((r=(e=i[s]).type)&&(r=Yq(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]=_T(n[r],e.name,t);else if(t==null)for(r in n)n[r]=_T(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 A0(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 Yq(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function _T(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=qq,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var I1="http://www.w3.org/1999/xhtml";const ST={svg:"http://www.w3.org/2000/svg",xhtml:I1,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _x(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ST.hasOwnProperty(t)?{space:ST[t],local:e}:e}function Vq(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===I1&&t.documentElement.namespaceURI===I1?t.createElement(e):t.createElementNS(n,e)}}function Xq(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function vk(e){var t=_x(e);return(t.local?Xq:Vq)(t)}function Kq(){}function V_(e){return e==null?Kq:function(){return this.querySelector(e)}}function Wq(e){typeof e!="function"&&(e=V_(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 ds(i,this._parents)}function $q(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Qq(){return[]}function _k(e){return e==null?Qq:function(){return this.querySelectorAll(e)}}function Zq(e){return function(){return $q(e.apply(this,arguments))}}function Jq(e){typeof e=="function"?e=Zq(e):e=_k(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 ds(i,r)}function Sk(e){return function(){return this.matches(e)}}function Ek(e){return function(t){return t.matches(e)}}var eG=Array.prototype.find;function tG(e){return function(){return eG.call(this.children,e)}}function nG(){return this.firstElementChild}function iG(e){return this.select(e==null?nG:tG(typeof e=="function"?e:Ek(e)))}var rG=Array.prototype.filter;function aG(){return Array.from(this.children)}function sG(e){return function(){return rG.call(this.children,e)}}function lG(e){return this.selectAll(e==null?aG:sG(typeof e=="function"?e:Ek(e)))}function oG(e){typeof e!="function"&&(e=Sk(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 ds(i,this._parents)}function wk(e){return new Array(e.length)}function cG(){return new ds(this._enter||this._groups.map(wk),this._parents)}function K0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}K0.prototype={constructor:K0,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 uG(e){return function(){return e}}function dG(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 K0(e,s[l]);for(;l<f;++l)(c=t[l])&&(r[l]=c)}function fG(e,t,n,i,r,s,l){var c,f,p=new Map,m=t.length,g=s.length,b=new Array(m),_;for(c=0;c<m;++c)(f=t[c])&&(b[c]=_=l.call(f,f.__data__,c,t)+"",p.has(_)?r[c]=f:p.set(_,f));for(c=0;c<g;++c)_=l.call(e,s[c],c,s)+"",(f=p.get(_))?(i[c]=f,f.__data__=s[c],p.delete(_)):n[c]=new K0(e,s[c]);for(c=0;c<m;++c)(f=t[c])&&p.get(b[c])===f&&(r[c]=f)}function hG(e){return e.__data__}function pG(e,t){if(!arguments.length)return Array.from(this,hG);var n=t?fG:dG,i=this._parents,r=this._groups;typeof e!="function"&&(e=uG(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],b=g.length,_=mG(e.call(m,m&&m.__data__,p,i)),S=_.length,A=c[p]=new Array(S),T=l[p]=new Array(S),C=f[p]=new Array(b);n(m,g,A,T,C,_,t);for(var N=0,R=0,z,L;N<S;++N)if(z=A[N]){for(N>=R&&(R=N+1);!(L=T[R])&&++R<S;);z._next=L||null}}return l=new ds(l,i),l._enter=c,l._exit=f,l}function mG(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function gG(){return new ds(this._exit||this._groups.map(wk),this._parents)}function yG(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 xG(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,b=c[f]=new Array(g),_,S=0;S<g;++S)(_=p[S]||m[S])&&(b[S]=_);for(;f<r;++f)c[f]=n[f];return new ds(c,this._parents)}function bG(){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 vG(e){e||(e=_G);function t(g,b){return g&&b?e(g.__data__,b.__data__):!g-!b}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 ds(r,this._parents).order()}function _G(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function SG(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function EG(){return Array.from(this)}function wG(){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 TG(){let e=0;for(const t of this)++e;return e}function CG(){return!this.node()}function AG(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 MG(e){return function(){this.removeAttribute(e)}}function RG(e){return function(){this.removeAttributeNS(e.space,e.local)}}function kG(e,t){return function(){this.setAttribute(e,t)}}function NG(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function OG(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function DG(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 zG(e,t){var n=_x(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?RG:MG:typeof t=="function"?n.local?DG:OG:n.local?NG:kG)(n,t))}function Tk(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function jG(e){return function(){this.style.removeProperty(e)}}function LG(e,t,n){return function(){this.style.setProperty(e,t,n)}}function BG(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function IG(e,t,n){return arguments.length>1?this.each((t==null?jG:typeof t=="function"?BG:LG)(e,t,n??"")):vh(this.node(),e)}function vh(e,t){return e.style.getPropertyValue(t)||Tk(e).getComputedStyle(e,null).getPropertyValue(t)}function UG(e){return function(){delete this[e]}}function HG(e,t){return function(){this[e]=t}}function PG(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function FG(e,t){return arguments.length>1?this.each((t==null?UG:typeof t=="function"?PG:HG)(e,t)):this.node()[e]}function Ck(e){return e.trim().split(/^|\s+/)}function X_(e){return e.classList||new Ak(e)}function Ak(e){this._node=e,this._names=Ck(e.getAttribute("class")||"")}Ak.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 Mk(e,t){for(var n=X_(e),i=-1,r=t.length;++i<r;)n.add(t[i])}function Rk(e,t){for(var n=X_(e),i=-1,r=t.length;++i<r;)n.remove(t[i])}function qG(e){return function(){Mk(this,e)}}function GG(e){return function(){Rk(this,e)}}function YG(e,t){return function(){(t.apply(this,arguments)?Mk:Rk)(this,e)}}function VG(e,t){var n=Ck(e+"");if(arguments.length<2){for(var i=X_(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?YG:t?qG:GG)(n,t))}function XG(){this.textContent=""}function KG(e){return function(){this.textContent=e}}function WG(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function $G(e){return arguments.length?this.each(e==null?XG:(typeof e=="function"?WG:KG)(e)):this.node().textContent}function QG(){this.innerHTML=""}function ZG(e){return function(){this.innerHTML=e}}function JG(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function eY(e){return arguments.length?this.each(e==null?QG:(typeof e=="function"?JG:ZG)(e)):this.node().innerHTML}function tY(){this.nextSibling&&this.parentNode.appendChild(this)}function nY(){return this.each(tY)}function iY(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function rY(){return this.each(iY)}function aY(e){var t=typeof e=="function"?e:vk(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function sY(){return null}function lY(e,t){var n=typeof e=="function"?e:vk(e),i=t==null?sY:typeof t=="function"?t:V_(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function oY(){var e=this.parentNode;e&&e.removeChild(this)}function cY(){return this.each(oY)}function uY(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function dY(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function fY(e){return this.select(e?dY:uY)}function hY(e){return arguments.length?this.property("__data__",e):this.node().__data__}function pY(e){return function(t){e.call(this,t,this.__data__)}}function mY(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 gY(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 yY(e,t,n){return function(){var i=this.__on,r,s=pY(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 xY(e,t,n){var i=mY(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?yY:gY,r=0;r<s;++r)this.each(c(i[r],t,n));return this}function kk(e,t,n){var i=Tk(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 bY(e,t){return function(){return kk(this,e,t)}}function vY(e,t){return function(){return kk(this,e,t.apply(this,arguments))}}function _Y(e,t){return this.each((typeof t=="function"?vY:bY)(e,t))}function*SY(){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 Nk=[null];function ds(e,t){this._groups=e,this._parents=t}function fg(){return new ds([[document.documentElement]],Nk)}function EY(){return this}ds.prototype=fg.prototype={constructor:ds,select:Wq,selectAll:Jq,selectChild:iG,selectChildren:lG,filter:oG,data:pG,enter:cG,exit:gG,join:yG,merge:xG,selection:EY,order:bG,sort:vG,call:SG,nodes:EG,node:wG,size:TG,empty:CG,each:AG,attr:zG,style:IG,property:FG,classed:VG,text:$G,html:eY,raise:nY,lower:rY,append:aY,insert:lY,remove:cY,clone:fY,datum:hY,on:xY,dispatch:_Y,[Symbol.iterator]:SY};function os(e){return typeof e=="string"?new ds([[document.querySelector(e)]],[document.documentElement]):new ds([[e]],Nk)}function wY(e){let t;for(;t=e.sourceEvent;)e=t;return e}function _l(e,t){if(e=wY(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 TY={passive:!1},Xm={capture:!0,passive:!1};function Nv(e){e.stopImmediatePropagation()}function uh(e){e.preventDefault(),e.stopImmediatePropagation()}function Ok(e){var t=e.document.documentElement,n=os(e).on("dragstart.drag",uh,Xm);"onselectstart"in t?n.on("selectstart.drag",uh,Xm):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Dk(e,t){var n=e.document.documentElement,i=os(e).on("dragstart.drag",null);t&&(i.on("click.drag",uh,Xm),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 f0=e=>()=>e;function U1(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}})}U1.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function CY(e){return!e.ctrlKey&&!e.button}function AY(){return this.parentNode}function MY(e,t){return t??{x:e.x,y:e.y}}function RY(){return navigator.maxTouchPoints||"ontouchstart"in this}function zk(){var e=CY,t=AY,n=MY,i=RY,r={},s=vx("start","drag","end"),l=0,c,f,p,m,g=0;function b(z){z.on("mousedown.drag",_).filter(i).on("touchstart.drag",T).on("touchmove.drag",C,TY).on("touchend.drag touchcancel.drag",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(z,L){if(!(m||!e.call(this,z,L))){var D=R(this,t.call(this,z,L),z,L,"mouse");D&&(os(z.view).on("mousemove.drag",S,Xm).on("mouseup.drag",A,Xm),Ok(z.view),Nv(z),p=!1,c=z.clientX,f=z.clientY,D("start",z))}}function S(z){if(uh(z),!p){var L=z.clientX-c,D=z.clientY-f;p=L*L+D*D>g}r.mouse("drag",z)}function A(z){os(z.view).on("mousemove.drag mouseup.drag",null),Dk(z.view,p),uh(z),r.mouse("end",z)}function T(z,L){if(e.call(this,z,L)){var D=z.changedTouches,F=t.call(this,z,L),Z=D.length,K,V;for(K=0;K<Z;++K)(V=R(this,F,z,L,D[K].identifier,D[K]))&&(Nv(z),V("start",z,D[K]))}}function C(z){var L=z.changedTouches,D=L.length,F,Z;for(F=0;F<D;++F)(Z=r[L[F].identifier])&&(uh(z),Z("drag",z,L[F]))}function N(z){var L=z.changedTouches,D=L.length,F,Z;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),F=0;F<D;++F)(Z=r[L[F].identifier])&&(Nv(z),Z("end",z,L[F]))}function R(z,L,D,F,Z,K){var V=s.copy(),P=_l(K||D,L),G,ne,X;if((X=n.call(z,new U1("beforestart",{sourceEvent:D,target:b,identifier:Z,active:l,x:P[0],y:P[1],dx:0,dy:0,dispatch:V}),F))!=null)return G=X.x-P[0]||0,ne=X.y-P[1]||0,function W(O,Y,$){var Q=P,H;switch(O){case"start":r[Z]=W,H=l++;break;case"end":delete r[Z],--l;case"drag":P=_l($||Y,L),H=l;break}V.call(O,z,new U1(O,{sourceEvent:Y,subject:X,target:b,identifier:Z,active:H,x:P[0]+G,y:P[1]+ne,dx:P[0]-Q[0],dy:P[1]-Q[1],dispatch:V}),F)}}return b.filter=function(z){return arguments.length?(e=typeof z=="function"?z:f0(!!z),b):e},b.container=function(z){return arguments.length?(t=typeof z=="function"?z:f0(z),b):t},b.subject=function(z){return arguments.length?(n=typeof z=="function"?z:f0(z),b):n},b.touchable=function(z){return arguments.length?(i=typeof z=="function"?z:f0(!!z),b):i},b.on=function(){var z=s.on.apply(s,arguments);return z===s?b:z},b.clickDistance=function(z){return arguments.length?(g=(z=+z)*z,b):Math.sqrt(g)},b}function K_(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function jk(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function hg(){}var Km=.7,W0=1/Km,dh="\\s*([+-]?\\d+)\\s*",Wm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",So="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",kY=/^#([0-9a-f]{3,8})$/,NY=new RegExp(`^rgb\\(${dh},${dh},${dh}\\)$`),OY=new RegExp(`^rgb\\(${So},${So},${So}\\)$`),DY=new RegExp(`^rgba\\(${dh},${dh},${dh},${Wm}\\)$`),zY=new RegExp(`^rgba\\(${So},${So},${So},${Wm}\\)$`),jY=new RegExp(`^hsl\\(${Wm},${So},${So}\\)$`),LY=new RegExp(`^hsla\\(${Wm},${So},${So},${Wm}\\)$`),ET={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};K_(hg,kd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:wT,formatHex:wT,formatHex8:BY,formatHsl:IY,formatRgb:TT,toString:TT});function wT(){return this.rgb().formatHex()}function BY(){return this.rgb().formatHex8()}function IY(){return Lk(this).formatHsl()}function TT(){return this.rgb().formatRgb()}function kd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=kY.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?CT(t):n===3?new Ba(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?h0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?h0(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=NY.exec(e))?new Ba(t[1],t[2],t[3],1):(t=OY.exec(e))?new Ba(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=DY.exec(e))?h0(t[1],t[2],t[3],t[4]):(t=zY.exec(e))?h0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=jY.exec(e))?RT(t[1],t[2]/100,t[3]/100,1):(t=LY.exec(e))?RT(t[1],t[2]/100,t[3]/100,t[4]):ET.hasOwnProperty(e)?CT(ET[e]):e==="transparent"?new Ba(NaN,NaN,NaN,0):null}function CT(e){return new Ba(e>>16&255,e>>8&255,e&255,1)}function h0(e,t,n,i){return i<=0&&(e=t=n=NaN),new Ba(e,t,n,i)}function UY(e){return e instanceof hg||(e=kd(e)),e?(e=e.rgb(),new Ba(e.r,e.g,e.b,e.opacity)):new Ba}function H1(e,t,n,i){return arguments.length===1?UY(e):new Ba(e,t,n,i??1)}function Ba(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}K_(Ba,H1,jk(hg,{brighter(e){return e=e==null?W0:Math.pow(W0,e),new Ba(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Km:Math.pow(Km,e),new Ba(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ba(Td(this.r),Td(this.g),Td(this.b),$0(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:AT,formatHex:AT,formatHex8:HY,formatRgb:MT,toString:MT}));function AT(){return`#${wd(this.r)}${wd(this.g)}${wd(this.b)}`}function HY(){return`#${wd(this.r)}${wd(this.g)}${wd(this.b)}${wd((isNaN(this.opacity)?1:this.opacity)*255)}`}function MT(){const e=$0(this.opacity);return`${e===1?"rgb(":"rgba("}${Td(this.r)}, ${Td(this.g)}, ${Td(this.b)}${e===1?")":`, ${e})`}`}function $0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Td(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function wd(e){return e=Td(e),(e<16?"0":"")+e.toString(16)}function RT(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new wl(e,t,n,i)}function Lk(e){if(e instanceof wl)return new wl(e.h,e.s,e.l,e.opacity);if(e instanceof hg||(e=kd(e)),!e)return new wl;if(e instanceof wl)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 wl(l,c,f,e.opacity)}function PY(e,t,n,i){return arguments.length===1?Lk(e):new wl(e,t,n,i??1)}function wl(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}K_(wl,PY,jk(hg,{brighter(e){return e=e==null?W0:Math.pow(W0,e),new wl(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Km:Math.pow(Km,e),new wl(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 Ba(Ov(e>=240?e-240:e+120,r,i),Ov(e,r,i),Ov(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new wl(kT(this.h),p0(this.s),p0(this.l),$0(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=$0(this.opacity);return`${e===1?"hsl(":"hsla("}${kT(this.h)}, ${p0(this.s)*100}%, ${p0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kT(e){return e=(e||0)%360,e<0?e+360:e}function p0(e){return Math.max(0,Math.min(1,e||0))}function Ov(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 W_=e=>()=>e;function FY(e,t){return function(n){return e+n*t}}function qY(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 GY(e){return(e=+e)==1?Bk:function(t,n){return n-t?qY(t,n,e):W_(isNaN(t)?n:t)}}function Bk(e,t){var n=t-e;return n?FY(e,n):W_(isNaN(e)?t:e)}const Q0=(function e(t){var n=GY(t);function i(r,s){var l=n((r=H1(r)).r,(s=H1(s)).r),c=n(r.g,s.g),f=n(r.b,s.b),p=Bk(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 YY(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 VY(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function XY(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]=Lm(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 KY(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function vo(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function WY(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]=Lm(e[r],t[r]):i[r]=t[r];return function(s){for(r in n)i[r]=n[r](s);return i}}var P1=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Dv=new RegExp(P1.source,"g");function $Y(e){return function(){return e}}function QY(e){return function(t){return e(t)+""}}function Ik(e,t){var n=P1.lastIndex=Dv.lastIndex=0,i,r,s,l=-1,c=[],f=[];for(e=e+"",t=t+"";(i=P1.exec(e))&&(r=Dv.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:vo(i,r)})),n=Dv.lastIndex;return n<t.length&&(s=t.slice(n),c[l]?c[l]+=s:c[++l]=s),c.length<2?f[0]?QY(f[0].x):$Y(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 Lm(e,t){var n=typeof t,i;return t==null||n==="boolean"?W_(t):(n==="number"?vo:n==="string"?(i=kd(t))?(t=i,Q0):Ik:t instanceof kd?Q0:t instanceof Date?KY:VY(t)?YY:Array.isArray(t)?XY:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?WY:vo)(e,t)}var NT=180/Math.PI,F1={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Uk(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)*NT,skewX:Math.atan(f)*NT,scaleX:l,scaleY:c}}var m0;function ZY(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?F1:Uk(t.a,t.b,t.c,t.d,t.e,t.f)}function JY(e){return e==null||(m0||(m0=document.createElementNS("http://www.w3.org/2000/svg","g")),m0.setAttribute("transform",e),!(e=m0.transform.baseVal.consolidate()))?F1:(e=e.matrix,Uk(e.a,e.b,e.c,e.d,e.e,e.f))}function Hk(e,t,n,i){function r(p){return p.length?p.pop()+" ":""}function s(p,m,g,b,_,S){if(p!==g||m!==b){var A=_.push("translate(",null,t,null,n);S.push({i:A-4,x:vo(p,g)},{i:A-2,x:vo(m,b)})}else(g||b)&&_.push("translate("+g+t+b+n)}function l(p,m,g,b){p!==m?(p-m>180?m+=360:m-p>180&&(p+=360),b.push({i:g.push(r(g)+"rotate(",null,i)-2,x:vo(p,m)})):m&&g.push(r(g)+"rotate("+m+i)}function c(p,m,g,b){p!==m?b.push({i:g.push(r(g)+"skewX(",null,i)-2,x:vo(p,m)}):m&&g.push(r(g)+"skewX("+m+i)}function f(p,m,g,b,_,S){if(p!==g||m!==b){var A=_.push(r(_)+"scale(",null,",",null,")");S.push({i:A-4,x:vo(p,g)},{i:A-2,x:vo(m,b)})}else(g!==1||b!==1)&&_.push(r(_)+"scale("+g+","+b+")")}return function(p,m){var g=[],b=[];return p=e(p),m=e(m),s(p.translateX,p.translateY,m.translateX,m.translateY,g,b),l(p.rotate,m.rotate,g,b),c(p.skewX,m.skewX,g,b),f(p.scaleX,p.scaleY,m.scaleX,m.scaleY,g,b),p=m=null,function(_){for(var S=-1,A=b.length,T;++S<A;)g[(T=b[S]).i]=T.x(_);return g.join("")}}}var eV=Hk(ZY,"px, ","px)","deg)"),tV=Hk(JY,", ",")",")"),nV=1e-12;function OT(e){return((e=Math.exp(e))+1/e)/2}function iV(e){return((e=Math.exp(e))-1/e)/2}function rV(e){return((e=Math.exp(2*e))-1)/(e+1)}const M0=(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],b=l[2],_=m-c,S=g-f,A=_*_+S*S,T,C;if(A<nV)C=Math.log(b/p)/t,T=function(F){return[c+F*_,f+F*S,p*Math.exp(t*F*C)]};else{var N=Math.sqrt(A),R=(b*b-p*p+i*A)/(2*p*n*N),z=(b*b-p*p-i*A)/(2*b*n*N),L=Math.log(Math.sqrt(R*R+1)-R),D=Math.log(Math.sqrt(z*z+1)-z);C=(D-L)/t,T=function(F){var Z=F*C,K=OT(L),V=p/(n*N)*(K*rV(t*Z+L)-iV(L));return[c+V*_,f+V*S,p*K/OT(t*Z+L)]}}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 _h=0,wm=0,ym=0,Pk=1e3,Z0,Tm,J0=0,Nd=0,Sx=0,$m=typeof performance=="object"&&performance.now?performance:Date,Fk=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $_(){return Nd||(Fk(aV),Nd=$m.now()+Sx)}function aV(){Nd=0}function ex(){this._call=this._time=this._next=null}ex.prototype=qk.prototype={constructor:ex,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?$_():+n)+(t==null?0:+t),!this._next&&Tm!==this&&(Tm?Tm._next=this:Z0=this,Tm=this),this._call=e,this._time=n,q1()},stop:function(){this._call&&(this._call=null,this._time=1/0,q1())}};function qk(e,t,n){var i=new ex;return i.restart(e,t,n),i}function sV(){$_(),++_h;for(var e=Z0,t;e;)(t=Nd-e._time)>=0&&e._call.call(void 0,t),e=e._next;--_h}function DT(){Nd=(J0=$m.now())+Sx,_h=wm=0;try{sV()}finally{_h=0,oV(),Nd=0}}function lV(){var e=$m.now(),t=e-J0;t>Pk&&(Sx-=t,J0=e)}function oV(){for(var e,t=Z0,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:Z0=n);Tm=e,q1(i)}function q1(e){if(!_h){wm&&(wm=clearTimeout(wm));var t=e-Nd;t>24?(e<1/0&&(wm=setTimeout(DT,e-$m.now()-Sx)),ym&&(ym=clearInterval(ym))):(ym||(J0=$m.now(),ym=setInterval(lV,Pk)),_h=1,Fk(DT))}}function zT(e,t,n){var i=new ex;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var cV=vx("start","end","cancel","interrupt"),uV=[],Gk=0,jT=1,G1=2,R0=3,LT=4,Y1=5,k0=6;function Ex(e,t,n,i,r,s){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;dV(e,n,{name:t,index:i,group:r,on:cV,tween:uV,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Gk})}function Q_(e,t){var n=Ol(e,t);if(n.state>Gk)throw new Error("too late; already scheduled");return n}function Co(e,t){var n=Ol(e,t);if(n.state>R0)throw new Error("too late; already running");return n}function Ol(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function dV(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=qk(s,0,n.time);function s(p){n.state=jT,n.timer.restart(l,n.delay,n.time),n.delay<=p&&l(p-n.delay)}function l(p){var m,g,b,_;if(n.state!==jT)return f();for(m in i)if(_=i[m],_.name===n.name){if(_.state===R0)return zT(l);_.state===LT?(_.state=k0,_.timer.stop(),_.on.call("interrupt",e,e.__data__,_.index,_.group),delete i[m]):+m<t&&(_.state=k0,_.timer.stop(),_.on.call("cancel",e,e.__data__,_.index,_.group),delete i[m])}if(zT(function(){n.state===R0&&(n.state=LT,n.timer.restart(c,n.delay,n.time),c(p))}),n.state=G1,n.on.call("start",e,e.__data__,n.index,n.group),n.state===G1){for(n.state=R0,r=new Array(b=n.tween.length),m=0,g=-1;m<b;++m)(_=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(r[++g]=_);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=Y1,1),g=-1,b=r.length;++g<b;)r[g].call(e,m);n.state===Y1&&(n.on.call("end",e,e.__data__,n.index,n.group),f())}function f(){n.state=k0,n.timer.stop(),delete i[t];for(var p in i)return;delete e.__transition}}function N0(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>G1&&i.state<Y1,i.state=k0,i.timer.stop(),i.on.call(r?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[l]}s&&delete e.__transition}}function fV(e){return this.each(function(){N0(this,e)})}function hV(e,t){var n,i;return function(){var r=Co(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 pV(e,t,n){var i,r;if(typeof n!="function")throw new Error;return function(){var s=Co(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 mV(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=Ol(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?hV:pV)(n,e,t))}function Z_(e,t,n){var i=e._id;return e.each(function(){var r=Co(this,i);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Ol(r,i).value[t]}}function Yk(e,t){var n;return(typeof t=="number"?vo:t instanceof kd?Q0:(n=kd(t))?(t=n,Q0):Ik)(e,t)}function gV(e){return function(){this.removeAttribute(e)}}function yV(e){return function(){this.removeAttributeNS(e.space,e.local)}}function xV(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 bV(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 vV(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 _V(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 SV(e,t){var n=_x(e),i=n==="transform"?tV:Yk;return this.attrTween(e,typeof t=="function"?(n.local?_V:vV)(n,i,Z_(this,"attr."+e,t)):t==null?(n.local?yV:gV)(n):(n.local?bV:xV)(n,i,t))}function EV(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function wV(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function TV(e,t){var n,i;function r(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&wV(e,s)),n}return r._value=t,r}function CV(e,t){var n,i;function r(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&EV(e,s)),n}return r._value=t,r}function AV(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=_x(e);return this.tween(n,(i.local?TV:CV)(i,t))}function MV(e,t){return function(){Q_(this,e).delay=+t.apply(this,arguments)}}function RV(e,t){return t=+t,function(){Q_(this,e).delay=t}}function kV(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?MV:RV)(t,e)):Ol(this.node(),t).delay}function NV(e,t){return function(){Co(this,e).duration=+t.apply(this,arguments)}}function OV(e,t){return t=+t,function(){Co(this,e).duration=t}}function DV(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?NV:OV)(t,e)):Ol(this.node(),t).duration}function zV(e,t){if(typeof t!="function")throw new Error;return function(){Co(this,e).ease=t}}function jV(e){var t=this._id;return arguments.length?this.each(zV(t,e)):Ol(this.node(),t).ease}function LV(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Co(this,e).ease=n}}function BV(e){if(typeof e!="function")throw new Error;return this.each(LV(this._id,e))}function IV(e){typeof e!="function"&&(e=Sk(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 mc(i,this._parents,this._name,this._id)}function UV(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),b,_=0;_<m;++_)(b=f[_]||p[_])&&(g[_]=b);for(;c<i;++c)l[c]=t[c];return new mc(l,this._parents,this._name,this._id)}function HV(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 PV(e,t,n){var i,r,s=HV(t)?Q_:Co;return function(){var l=s(this,e),c=l.on;c!==i&&(r=(i=c).copy()).on(t,n),l.on=r}}function FV(e,t){var n=this._id;return arguments.length<2?Ol(this.node(),n).on.on(e):this.each(PV(n,e,t))}function qV(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function GV(){return this.on("end.remove",qV(this._id))}function YV(e){var t=this._name,n=this._id;typeof e!="function"&&(e=V_(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,b=0;b<f;++b)(m=c[b])&&(g=e.call(m,m.__data__,b,c))&&("__data__"in m&&(g.__data__=m.__data__),p[b]=g,Ex(p[b],t,n,b,p,Ol(m,n)));return new mc(s,this._parents,t,n)}function VV(e){var t=this._name,n=this._id;typeof e!="function"&&(e=_k(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 b=e.call(m,m.__data__,g,f),_,S=Ol(m,n),A=0,T=b.length;A<T;++A)(_=b[A])&&Ex(_,t,n,A,b,S);s.push(b),l.push(m)}return new mc(s,l,t,n)}var XV=fg.prototype.constructor;function KV(){return new XV(this._groups,this._parents)}function WV(e,t){var n,i,r;return function(){var s=vh(this,e),l=(this.style.removeProperty(e),vh(this,e));return s===l?null:s===n&&l===i?r:r=t(n=s,i=l)}}function Vk(e){return function(){this.style.removeProperty(e)}}function $V(e,t,n){var i,r=n+"",s;return function(){var l=vh(this,e);return l===r?null:l===i?s:s=t(i=l,n)}}function QV(e,t,n){var i,r,s;return function(){var l=vh(this,e),c=n(this),f=c+"";return c==null&&(f=c=(this.style.removeProperty(e),vh(this,e))),l===f?null:l===i&&f===r?s:(r=f,s=t(i=l,c))}}function ZV(e,t){var n,i,r,s="style."+t,l="end."+s,c;return function(){var f=Co(this,e),p=f.on,m=f.value[s]==null?c||(c=Vk(t)):void 0;(p!==n||r!==m)&&(i=(n=p).copy()).on(l,r=m),f.on=i}}function JV(e,t,n){var i=(e+="")=="transform"?eV:Yk;return t==null?this.styleTween(e,WV(e,i)).on("end.style."+e,Vk(e)):typeof t=="function"?this.styleTween(e,QV(e,i,Z_(this,"style."+e,t))).each(ZV(this._id,e)):this.styleTween(e,$V(e,i,t),n).on("end.style."+e,null)}function eX(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function tX(e,t,n){var i,r;function s(){var l=t.apply(this,arguments);return l!==r&&(i=(r=l)&&eX(e,l,n)),i}return s._value=t,s}function nX(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,tX(e,t,n??""))}function iX(e){return function(){this.textContent=e}}function rX(e){return function(){var t=e(this);this.textContent=t??""}}function aX(e){return this.tween("text",typeof e=="function"?rX(Z_(this,"text",e)):iX(e==null?"":e+""))}function sX(e){return function(t){this.textContent=e.call(this,t)}}function lX(e){var t,n;function i(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&sX(r)),t}return i._value=e,i}function oX(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,lX(e))}function cX(){for(var e=this._name,t=this._id,n=Xk(),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=Ol(f,t);Ex(f,e,n,p,l,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new mc(i,this._parents,e,n)}function uX(){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=Co(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 dX=0;function mc(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function Xk(){return++dX}var sc=fg.prototype;mc.prototype={constructor:mc,select:YV,selectAll:VV,selectChild:sc.selectChild,selectChildren:sc.selectChildren,filter:IV,merge:UV,selection:KV,transition:cX,call:sc.call,nodes:sc.nodes,node:sc.node,size:sc.size,empty:sc.empty,each:sc.each,on:FV,attr:SV,attrTween:AV,style:JV,styleTween:nX,text:aX,textTween:oX,remove:GV,tween:mV,delay:kV,duration:DV,ease:jV,easeVarying:BV,end:uX,[Symbol.iterator]:sc[Symbol.iterator]};function fX(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var hX={time:null,delay:0,duration:250,ease:fX};function pX(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 mX(e){var t,n;e instanceof mc?(t=e._id,e=e._name):(t=Xk(),(n=hX).time=$_(),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])&&Ex(f,e,t,p,l,n||pX(f,t));return new mc(i,this._parents,e,t)}fg.prototype.interrupt=fV;fg.prototype.transition=mX;const g0=e=>()=>e;function gX(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 uc(e,t,n){this.k=e,this.x=t,this.y=n}uc.prototype={constructor:uc,scale:function(e){return e===1?this:new uc(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new uc(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 wx=new uc(1,0,0);Kk.prototype=uc.prototype;function Kk(e){for(;!e.__zoom;)if(!(e=e.parentNode))return wx;return e.__zoom}function zv(e){e.stopImmediatePropagation()}function xm(e){e.preventDefault(),e.stopImmediatePropagation()}function yX(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function xX(){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 BT(){return this.__zoom||wx}function bX(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function vX(){return navigator.maxTouchPoints||"ontouchstart"in this}function _X(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 Wk(){var e=yX,t=xX,n=_X,i=bX,r=vX,s=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,f=M0,p=vx("start","zoom","end"),m,g,b,_=500,S=150,A=0,T=10;function C(X){X.property("__zoom",BT).on("wheel.zoom",Z,{passive:!1}).on("mousedown.zoom",K).on("dblclick.zoom",V).filter(r).on("touchstart.zoom",P).on("touchmove.zoom",G).on("touchend.zoom touchcancel.zoom",ne).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(X,W,O,Y){var $=X.selection?X.selection():X;$.property("__zoom",BT),X!==$?L(X,W,O,Y):$.interrupt().each(function(){D(this,arguments).event(Y).start().zoom(null,typeof W=="function"?W.apply(this,arguments):W).end()})},C.scaleBy=function(X,W,O,Y){C.scaleTo(X,function(){var $=this.__zoom.k,Q=typeof W=="function"?W.apply(this,arguments):W;return $*Q},O,Y)},C.scaleTo=function(X,W,O,Y){C.transform(X,function(){var $=t.apply(this,arguments),Q=this.__zoom,H=O==null?z($):typeof O=="function"?O.apply(this,arguments):O,I=Q.invert(H),J=typeof W=="function"?W.apply(this,arguments):W;return n(R(N(Q,J),H,I),$,l)},O,Y)},C.translateBy=function(X,W,O,Y){C.transform(X,function(){return n(this.__zoom.translate(typeof W=="function"?W.apply(this,arguments):W,typeof O=="function"?O.apply(this,arguments):O),t.apply(this,arguments),l)},null,Y)},C.translateTo=function(X,W,O,Y,$){C.transform(X,function(){var Q=t.apply(this,arguments),H=this.__zoom,I=Y==null?z(Q):typeof Y=="function"?Y.apply(this,arguments):Y;return n(wx.translate(I[0],I[1]).scale(H.k).translate(typeof W=="function"?-W.apply(this,arguments):-W,typeof O=="function"?-O.apply(this,arguments):-O),Q,l)},Y,$)};function N(X,W){return W=Math.max(s[0],Math.min(s[1],W)),W===X.k?X:new uc(W,X.x,X.y)}function R(X,W,O){var Y=W[0]-O[0]*X.k,$=W[1]-O[1]*X.k;return Y===X.x&&$===X.y?X:new uc(X.k,Y,$)}function z(X){return[(+X[0][0]+ +X[1][0])/2,(+X[0][1]+ +X[1][1])/2]}function L(X,W,O,Y){X.on("start.zoom",function(){D(this,arguments).event(Y).start()}).on("interrupt.zoom end.zoom",function(){D(this,arguments).event(Y).end()}).tween("zoom",function(){var $=this,Q=arguments,H=D($,Q).event(Y),I=t.apply($,Q),J=O==null?z(I):typeof O=="function"?O.apply($,Q):O,q=Math.max(I[1][0]-I[0][0],I[1][1]-I[0][1]),oe=$.__zoom,ie=typeof W=="function"?W.apply($,Q):W,de=f(oe.invert(J).concat(q/oe.k),ie.invert(J).concat(q/ie.k));return function(me){if(me===1)me=ie;else{var ge=de(me),le=q/ge[2];me=new uc(le,J[0]-ge[0]*le,J[1]-ge[1]*le)}H.zoom(null,me)}})}function D(X,W,O){return!O&&X.__zooming||new F(X,W)}function F(X,W){this.that=X,this.args=W,this.active=0,this.sourceEvent=null,this.extent=t.apply(X,W),this.taps=0}F.prototype={event:function(X){return X&&(this.sourceEvent=X),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(X,W){return this.mouse&&X!=="mouse"&&(this.mouse[1]=W.invert(this.mouse[0])),this.touch0&&X!=="touch"&&(this.touch0[1]=W.invert(this.touch0[0])),this.touch1&&X!=="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(X){var W=os(this.that).datum();p.call(X,this.that,new gX(X,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:p}),W)}};function Z(X,...W){if(!e.apply(this,arguments))return;var O=D(this,W).event(X),Y=this.__zoom,$=Math.max(s[0],Math.min(s[1],Y.k*Math.pow(2,i.apply(this,arguments)))),Q=_l(X);if(O.wheel)(O.mouse[0][0]!==Q[0]||O.mouse[0][1]!==Q[1])&&(O.mouse[1]=Y.invert(O.mouse[0]=Q)),clearTimeout(O.wheel);else{if(Y.k===$)return;O.mouse=[Q,Y.invert(Q)],N0(this),O.start()}xm(X),O.wheel=setTimeout(H,S),O.zoom("mouse",n(R(N(Y,$),O.mouse[0],O.mouse[1]),O.extent,l));function H(){O.wheel=null,O.end()}}function K(X,...W){if(b||!e.apply(this,arguments))return;var O=X.currentTarget,Y=D(this,W,!0).event(X),$=os(X.view).on("mousemove.zoom",J,!0).on("mouseup.zoom",q,!0),Q=_l(X,O),H=X.clientX,I=X.clientY;Ok(X.view),zv(X),Y.mouse=[Q,this.__zoom.invert(Q)],N0(this),Y.start();function J(oe){if(xm(oe),!Y.moved){var ie=oe.clientX-H,de=oe.clientY-I;Y.moved=ie*ie+de*de>A}Y.event(oe).zoom("mouse",n(R(Y.that.__zoom,Y.mouse[0]=_l(oe,O),Y.mouse[1]),Y.extent,l))}function q(oe){$.on("mousemove.zoom mouseup.zoom",null),Dk(oe.view,Y.moved),xm(oe),Y.event(oe).end()}}function V(X,...W){if(e.apply(this,arguments)){var O=this.__zoom,Y=_l(X.changedTouches?X.changedTouches[0]:X,this),$=O.invert(Y),Q=O.k*(X.shiftKey?.5:2),H=n(R(N(O,Q),Y,$),t.apply(this,W),l);xm(X),c>0?os(this).transition().duration(c).call(L,H,Y,X):os(this).call(C.transform,H,Y,X)}}function P(X,...W){if(e.apply(this,arguments)){var O=X.touches,Y=O.length,$=D(this,W,X.changedTouches.length===Y).event(X),Q,H,I,J;for(zv(X),H=0;H<Y;++H)I=O[H],J=_l(I,this),J=[J,this.__zoom.invert(J),I.identifier],$.touch0?!$.touch1&&$.touch0[2]!==J[2]&&($.touch1=J,$.taps=0):($.touch0=J,Q=!0,$.taps=1+!!m);m&&(m=clearTimeout(m)),Q&&($.taps<2&&(g=J[0],m=setTimeout(function(){m=null},_)),N0(this),$.start())}}function G(X,...W){if(this.__zooming){var O=D(this,W).event(X),Y=X.changedTouches,$=Y.length,Q,H,I,J;for(xm(X),Q=0;Q<$;++Q)H=Y[Q],I=_l(H,this),O.touch0&&O.touch0[2]===H.identifier?O.touch0[0]=I:O.touch1&&O.touch1[2]===H.identifier&&(O.touch1[0]=I);if(H=O.that.__zoom,O.touch1){var q=O.touch0[0],oe=O.touch0[1],ie=O.touch1[0],de=O.touch1[1],me=(me=ie[0]-q[0])*me+(me=ie[1]-q[1])*me,ge=(ge=de[0]-oe[0])*ge+(ge=de[1]-oe[1])*ge;H=N(H,Math.sqrt(me/ge)),I=[(q[0]+ie[0])/2,(q[1]+ie[1])/2],J=[(oe[0]+de[0])/2,(oe[1]+de[1])/2]}else if(O.touch0)I=O.touch0[0],J=O.touch0[1];else return;O.zoom("touch",n(R(H,I,J),O.extent,l))}}function ne(X,...W){if(this.__zooming){var O=D(this,W).event(X),Y=X.changedTouches,$=Y.length,Q,H;for(zv(X),b&&clearTimeout(b),b=setTimeout(function(){b=null},_),Q=0;Q<$;++Q)H=Y[Q],O.touch0&&O.touch0[2]===H.identifier?delete O.touch0:O.touch1&&O.touch1[2]===H.identifier&&delete O.touch1;if(O.touch1&&!O.touch0&&(O.touch0=O.touch1,delete O.touch1),O.touch0)O.touch0[1]=this.__zoom.invert(O.touch0[0]);else if(O.end(),O.taps===2&&(H=_l(H,this),Math.hypot(g[0]-H[0],g[1]-H[1])<T)){var I=os(this).on("dblclick.zoom");I&&I.apply(this,arguments)}}}return C.wheelDelta=function(X){return arguments.length?(i=typeof X=="function"?X:g0(+X),C):i},C.filter=function(X){return arguments.length?(e=typeof X=="function"?X:g0(!!X),C):e},C.touchable=function(X){return arguments.length?(r=typeof X=="function"?X:g0(!!X),C):r},C.extent=function(X){return arguments.length?(t=typeof X=="function"?X:g0([[+X[0][0],+X[0][1]],[+X[1][0],+X[1][1]]]),C):t},C.scaleExtent=function(X){return arguments.length?(s[0]=+X[0],s[1]=+X[1],C):[s[0],s[1]]},C.translateExtent=function(X){return arguments.length?(l[0][0]=+X[0][0],l[1][0]=+X[1][0],l[0][1]=+X[0][1],l[1][1]=+X[1][1],C):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},C.constrain=function(X){return arguments.length?(n=X,C):n},C.duration=function(X){return arguments.length?(c=+X,C):c},C.interpolate=function(X){return arguments.length?(f=X,C):f},C.on=function(){var X=p.on.apply(p,arguments);return X===p?C:X},C.clickDistance=function(X){return arguments.length?(A=(X=+X)*X,C):Math.sqrt(A)},C.tapDistance=function(X){return arguments.length?(T=+X,C):T},C}const Eo={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."},Qm=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],$k=["Enter"," ","Escape"],Qk={"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 Sh;(function(e){e.Strict="strict",e.Loose="loose"})(Sh||(Sh={}));var Cd;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Cd||(Cd={}));var Zm;(function(e){e.Partial="partial",e.Full="full"})(Zm||(Zm={}));const Zk={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var hu;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(hu||(hu={}));var Jm;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Jm||(Jm={}));var $e;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})($e||($e={}));const IT={[$e.Left]:$e.Right,[$e.Right]:$e.Left,[$e.Top]:$e.Bottom,[$e.Bottom]:$e.Top};function Jk(e){return e===null?null:e?"valid":"invalid"}const eN=e=>"id"in e&&"source"in e&&"target"in e,SX=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),J_=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),pg=(e,t=[0,0])=>{const{width:n,height:i}=xc(e),r=e.origin??t,s=n*r[0],l=i*r[1];return{x:e.position.x-s,y:e.position.y-l}},EX=(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):J_(r)?r:t.nodeLookup.get(r.id));const c=l?tx(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Tx(i,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Cx(n)},mg=(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=Tx(n,tx(r)),i=!0)}),i?Cx(n):{x:0,y:0,width:0,height:0}},eS=(e,t,[n,i,r]=[0,0,1],s=!1,l=!1)=>{const c={...yg(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:b=!1}=p;if(l&&!g||b)continue;const _=m.width??p.width??p.initialWidth??null,S=m.height??p.height??p.initialHeight??null,A=eg(c,wh(p)),T=(_??0)*(S??0),C=s&&A>0;(!p.internals.handleBounds||C||A>=T||p.dragging)&&f.push(p)}return f},wX=(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 TX(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 CX({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:s},l){if(e.size===0)return Promise.resolve(!0);const c=TX(e,l),f=mg(c),p=tS(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 tN({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",Eo.error005());else{const _=c.measured.width,S=c.measured.height;_&&S&&(g=[[f,p],[f+_,p+S]])}else c&&Th(l.extent)&&(g=[[l.extent[0][0]+f,l.extent[0][1]+p],[l.extent[1][0]+f,l.extent[1][1]+p]]);const b=Th(g)?Od(t,g,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&(s==null||s("015",Eo.error015())),{position:{x:b.x-f+(l.measured.width??0)*m[0],y:b.y-p+(l.measured.height??0)*m[1]},positionAbsolute:b}}async function AX({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:r}){const s=new Set(e.map(b=>b.id)),l=[];for(const b of n){if(b.deletable===!1)continue;const _=s.has(b.id),S=!_&&b.parentId&&l.find(A=>A.id===b.parentId);(_||S)&&l.push(b)}const c=new Set(t.map(b=>b.id)),f=i.filter(b=>b.deletable!==!1),m=wX(l,f);for(const b of f)c.has(b.id)&&!m.find(S=>S.id===b.id)&&m.push(b);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 Eh=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Od=(e={x:0,y:0},t,n)=>({x:Eh(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Eh(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function nN(e,t,n){const{width:i,height:r}=xc(n),{x:s,y:l}=n.internals.positionAbsolute;return Od(e,[[s,l],[s+i,l+r]],t)}const UT=(e,t,n)=>e<t?Eh(Math.abs(e-t),1,t)/t:e>n?-Eh(Math.abs(e-n),1,t)/t:0,iN=(e,t,n=15,i=40)=>{const r=UT(e.x,i,t.width-i)*n,s=UT(e.y,i,t.height-i)*n;return[r,s]},Tx=(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)}),V1=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),Cx=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),wh=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=J_(e)?e.internals.positionAbsolute:pg(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}},tx=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=J_(e)?e.internals.positionAbsolute:pg(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)}},rN=(e,t)=>Cx(Tx(V1(e),V1(t))),eg=(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)},HT=e=>Tl(e.width)&&Tl(e.height)&&Tl(e.x)&&Tl(e.y),Tl=e=>!isNaN(e)&&isFinite(e),MX=(e,t)=>{},gg=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),yg=({x:e,y:t},[n,i,r],s=!1,l=[1,1])=>{const c={x:(e-n)/r,y:(t-i)/r};return s?gg(c,l):c},nx=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function Kf(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 RX(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=Kf(e,n),r=Kf(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=Kf(e.top??e.y??0,n),r=Kf(e.bottom??e.y??0,n),s=Kf(e.left??e.x??0,t),l=Kf(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 kX(e,t,n,i,r,s){const{x:l,y:c}=nx(e,[t,n,i]),{x:f,y:p}=nx({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 tS=(e,t,n,i,r,s)=>{const l=RX(s,t,n),c=(t-l.x)/e.width,f=(n-l.y)/e.height,p=Math.min(c,f),m=Eh(p,i,r),g=e.x+e.width/2,b=e.y+e.height/2,_=t/2-g*m,S=n/2-b*m,A=kX(e,_,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:_-T.left+T.right,y:S-T.top+T.bottom,zoom:m}},tg=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Th(e){return e!=null&&e!=="parent"}function xc(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 aN(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 sN(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 PT(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function NX(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function OX(e){return{...Qk,...e||{}}}function Bm(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:l}=Cl(e),c=yg({x:s-((r==null?void 0:r.left)??0),y:l-((r==null?void 0:r.top)??0)},i),{x:f,y:p}=n?gg(c,t):c;return{xSnapped:f,ySnapped:p,...c}}const nS=e=>({width:e.offsetWidth,height:e.offsetHeight}),lN=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},DX=["INPUT","SELECT","TEXTAREA"];function oN(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:DX.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const cN=e=>"clientX"in e,Cl=(e,t)=>{var s,l;const n=cN(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)}},FT=(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,...nS(l)}})};function uN({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 y0(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function qT({pos:e,x1:t,y1:n,x2:i,y2:r,c:s}){switch(e){case $e.Left:return[t-y0(t-i,s),n];case $e.Right:return[t+y0(i-t,s),n];case $e.Top:return[t,n-y0(n-r,s)];case $e.Bottom:return[t,n+y0(r-n,s)]}}function dN({sourceX:e,sourceY:t,sourcePosition:n=$e.Bottom,targetX:i,targetY:r,targetPosition:s=$e.Top,curvature:l=.25}){const[c,f]=qT({pos:n,x1:e,y1:t,x2:i,y2:r,c:l}),[p,m]=qT({pos:s,x1:i,y1:r,x2:e,y2:t,c:l}),[g,b,_,S]=uN({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,b,_,S]}function fN({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 zX({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 jX({sourceNode:e,targetNode:t,width:n,height:i,transform:r}){const s=Tx(tx(e),tx(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 eg(l,Cx(s))>0}const LX=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,BX=(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)),IX=(e,t,n={})=>{if(!e.source||!e.target)return t;const i=n.getEdgeId||LX;let r;return eN(e)?r={...e}:r={...e,id:i(e)},BX(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function hN({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,s,l,c]=fN({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,s,l,c]}const GT={[$e.Left]:{x:-1,y:0},[$e.Right]:{x:1,y:0},[$e.Top]:{x:0,y:-1},[$e.Bottom]:{x:0,y:1}},UX=({source:e,sourcePosition:t=$e.Bottom,target:n})=>t===$e.Left||t===$e.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},YT=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function HX({source:e,sourcePosition:t=$e.Bottom,target:n,targetPosition:i=$e.Top,center:r,offset:s,stepPosition:l}){const c=GT[t],f=GT[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=UX({source:p,sourcePosition:t,target:m}),b=g.x!==0?"x":"y",_=g[b];let S=[],A,T;const C={x:0,y:0},N={x:0,y:0},[,,R,z]=fN({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[b]*f[b]===-1){b==="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}],F=[{x:p.x,y:T},{x:m.x,y:T}];c[b]===_?S=b==="x"?D:F:S=b==="x"?F:D}else{const D=[{x:p.x,y:m.y}],F=[{x:m.x,y:p.y}];if(b==="x"?S=c.x===_?F:D:S=c.y===_?D:F,t===i){const G=Math.abs(e[b]-n[b]);if(G<=s){const ne=Math.min(s-1,s-G);c[b]===_?C[b]=(p[b]>e[b]?-1:1)*ne:N[b]=(m[b]>n[b]?-1:1)*ne}}if(t!==i){const G=b==="x"?"y":"x",ne=c[b]===f[G],X=p[G]>m[G],W=p[G]<m[G];(c[b]===1&&(!ne&&X||ne&&W)||c[b]!==1&&(!ne&&W||ne&&X))&&(S=b==="x"?D:F)}const Z={x:p.x+C.x,y:p.y+C.y},K={x:m.x+N.x,y:m.y+N.y},V=Math.max(Math.abs(Z.x-S[0].x),Math.abs(K.x-S[0].x)),P=Math.max(Math.abs(Z.y-S[0].y),Math.abs(K.y-S[0].y));V>=P?(A=(Z.x+K.x)/2,T=S[0].y):(A=S[0].x,T=(Z.y+K.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,z]}function PX(e,t,n,i){const r=Math.min(YT(e,t)/2,YT(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 X1({sourceX:e,sourceY:t,sourcePosition:n=$e.Bottom,targetX:i,targetY:r,targetPosition:s=$e.Top,borderRadius:l=5,centerX:c,centerY:f,offset:p=20,stepPosition:m=.5}){const[g,b,_,S,A]=HX({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 z="";return R>0&&R<g.length-1?z=PX(g[R-1],N,g[R+1],l):z=`${R===0?"M":"L"}${N.x} ${N.y}`,C+=z,C},""),b,_,S,A]}function VT(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function FX(e){var g;const{sourceNode:t,targetNode:n}=e;if(!VT(t)||!VT(n))return null;const i=t.internals.handleBounds||XT(t.handles),r=n.internals.handleBounds||XT(n.handles),s=KT((i==null?void 0:i.source)??[],e.sourceHandle),l=KT(e.connectionMode===Sh.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",Eo.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(s==null?void 0:s.position)||$e.Bottom,f=(l==null?void 0:l.position)||$e.Top,p=Dd(t,s,c),m=Dd(n,l,f);return{sourceX:p.x,sourceY:p.y,targetX:m.x,targetY:m.y,sourcePosition:c,targetPosition:f}}function XT(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 Dd(e,t,n=$e.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??xc(e);if(i)return{x:r+l/2,y:s+c/2};switch((t==null?void 0:t.position)??n){case $e.Top:return{x:r+l/2,y:s};case $e.Right:return{x:r+l,y:s+c/2};case $e.Bottom:return{x:r+l/2,y:s+c};case $e.Left:return{x:r,y:s+c/2}}}function KT(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function K1(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function qX(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=K1(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 pN=1e3,GX=10,iS={nodeOrigin:[0,0],nodeExtent:Qm,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},YX={...iS,checkEquality:!0};function rS(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function VX(e,t,n){const i=rS(iS,n);for(const r of e.values())if(r.parentId)sS(r,e,t,i);else{const s=pg(r,i.nodeOrigin),l=Th(r.extent)?r.extent:i.nodeExtent,c=Od(s,l,xc(r));r.internals.positionAbsolute=c}}function XX(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 aS(e){return e==="manual"}function W1(e,t,n,i={}){var p,m;const r=rS(YX,i),s={i:0},l=new Map(t),c=r!=null&&r.elevateNodesOnSelect&&!aS(r.zIndexMode)?pN:0;let f=e.length>0;t.clear(),n.clear();for(const g of e){let b=l.get(g.id);if(r.checkEquality&&g===(b==null?void 0:b.internals.userNode))t.set(g.id,b);else{const _=pg(g,r.nodeOrigin),S=Th(g.extent)?g.extent:r.nodeExtent,A=Od(_,S,xc(g));b={...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:XX(g,b),z:mN(g,c,r.zIndexMode),userNode:g}},t.set(g.id,b)}(b.measured===void 0||b.measured.width===void 0||b.measured.height===void 0)&&!b.hidden&&(f=!1),g.parentId&&sS(b,t,n,i,s)}return f}function KX(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 sS(e,t,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:l,nodeExtent:c,zIndexMode:f}=rS(iS,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}KX(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*GX),r&&m.internals.rootParentIndex!==void 0&&(r.i=m.internals.rootParentIndex);const g=s&&!aS(f)?pN:0,{x:b,y:_,z:S}=WX(e,m,l,c,g,f),{positionAbsolute:A}=e.internals,T=b!==A.x||_!==A.y;(T||S!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:T?{x:b,y:_}:A,z:S}})}function mN(e,t,n){const i=Tl(e.zIndex)?e.zIndex:0;return aS(n)?i:i+(e.selected?t:0)}function WX(e,t,n,i,r,s){const{x:l,y:c}=t.internals.positionAbsolute,f=xc(e),p=pg(e,n),m=Th(e.extent)?Od(p,e.extent,f):p;let g=Od({x:l+m.x,y:c+m.y},i,f);e.extent==="parent"&&(g=nN(g,f,t));const b=mN(e,r,s),_=t.internals.z??0;return{x:g.x,y:g.y,z:_>=b?_+1:b}}function lS(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)??wh(f),m=rN(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=xc(f),b=f.origin??i,_=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)*b[0],N=(T-g.height)*b[1];(_>0||S>0||C||N)&&(r.push({id:p,type:"position",position:{x:f.position.x-_+C,y:f.position.y-S+N}}),(R=n.get(p))==null||R.forEach(z=>{e.some(L=>L.id===z.id)||r.push({id:z.id,type:"position",position:{x:z.position.x+_,y:z.position.y+S}})})),(g.width<c.width||g.height<c.height||_||S)&&r.push({id:p,type:"dimensions",setAttributes:!0,dimensions:{width:A+(_?b[0]*_-C:0),height:T+(S?b[1]*S-N:0)}})}),r}function $X(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),b=[];for(const _ of e.values()){const S=t.get(_.id);if(!S)continue;if(S.hidden){t.set(S.id,{...S,internals:{...S.internals,handleBounds:void 0}}),f=!0;continue}const A=nS(_.nodeElement),T=S.measured.width!==A.width||S.measured.height!==A.height;if(!!(A.width&&A.height&&(T||!S.internals.handleBounds||_.force))){const N=_.nodeElement.getBoundingClientRect(),R=Th(S.extent)?S.extent:s;let{positionAbsolute:z}=S.internals;S.parentId&&S.extent==="parent"?z=nN(z,A,t.get(S.parentId)):R&&(z=Od(z,R,A));const L={...S,measured:A,internals:{...S.internals,positionAbsolute:z,handleBounds:{source:FT("source",_.nodeElement,N,g,S.id),target:FT("target",_.nodeElement,N,g,S.id)}}};t.set(S.id,L),S.parentId&&sS(L,t,n,{nodeOrigin:r,zIndexMode:l}),f=!0,T&&(p.push({id:S.id,type:"dimensions",dimensions:A}),S.expandParent&&S.parentId&&b.push({id:S.id,parentId:S.parentId,rect:wh(L,r)}))}}if(b.length>0){const _=lS(b,t,n,r);p.push(..._)}return{changes:p,updatedInternals:f}}async function QX({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 WT(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 gN(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}`;WT("source",f,m,e,r,l),WT("target",f,p,e,s,c),t.set(i.id,i)}}function yN(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:yN(n,t):!1}function $T(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 ZX(e,t,n,i){const r=new Map;for(const[s,l]of e)if((l.selected||l.id===i)&&(!l.parentId||!yN(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 jv({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 JX({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=gg(s,t);return{x:l.x-s.x,y:l.y-s.y}}function eK({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,b=null,_=!1,S=!1,A=null;function T({noDragClassName:N,handleSelector:R,domNode:z,isSelectable:L,nodeId:D,nodeClickDistance:F=0}){b=os(z);function Z({x:G,y:ne}){const{nodeLookup:X,nodeExtent:W,snapGrid:O,snapToGrid:Y,nodeOrigin:$,onNodeDrag:Q,onSelectionDrag:H,onError:I,updateNodePositions:J}=t();s={x:G,y:ne};let q=!1;const oe=c.size>1,ie=oe&&W?V1(mg(c)):null,de=oe&&Y?JX({dragItems:c,snapGrid:O,x:G,y:ne}):null;for(const[me,ge]of c){if(!X.has(me))continue;let le={x:G-ge.distance.x,y:ne-ge.distance.y};Y&&(le=de?{x:Math.round(le.x+de.x),y:Math.round(le.y+de.y)}:gg(le,O));let Re=null;if(oe&&W&&!ge.extent&&ie){const{positionAbsolute:He}=ge.internals,Qe=He.x-ie.x+W[0][0],ot=He.x+ge.measured.width-ie.x2+W[1][0],Ue=He.y-ie.y+W[0][1],wt=He.y+ge.measured.height-ie.y2+W[1][1];Re=[[Qe,Ue],[ot,wt]]}const{position:Le,positionAbsolute:Be}=tN({nodeId:me,nextPosition:le,nodeLookup:X,nodeExtent:Re||W,nodeOrigin:$,onError:I});q=q||ge.position.x!==Le.x||ge.position.y!==Le.y,ge.position=Le,ge.internals.positionAbsolute=Be}if(S=S||q,!!q&&(J(c,!0),A&&(i||Q||!D&&H))){const[me,ge]=jv({nodeId:D,dragItems:c,nodeLookup:X});i==null||i(A,c,me,ge),Q==null||Q(A,me,ge),D||H==null||H(A,ge)}}async function K(){if(!m)return;const{transform:G,panBy:ne,autoPanSpeed:X,autoPanOnNodeDrag:W}=t();if(!W){f=!1,cancelAnimationFrame(l);return}const[O,Y]=iN(p,m,X);(O!==0||Y!==0)&&(s.x=(s.x??0)-O/G[2],s.y=(s.y??0)-Y/G[2],await ne({x:O,y:Y})&&Z(s)),l=requestAnimationFrame(K)}function V(G){var oe;const{nodeLookup:ne,multiSelectionActive:X,nodesDraggable:W,transform:O,snapGrid:Y,snapToGrid:$,selectNodesOnDrag:Q,onNodeDragStart:H,onSelectionDragStart:I,unselectNodesAndEdges:J}=t();g=!0,(!Q||!L)&&!X&&D&&((oe=ne.get(D))!=null&&oe.selected||J()),L&&Q&&D&&(e==null||e(D));const q=Bm(G.sourceEvent,{transform:O,snapGrid:Y,snapToGrid:$,containerBounds:m});if(s=q,c=ZX(ne,W,q,D),c.size>0&&(n||H||!D&&I)){const[ie,de]=jv({nodeId:D,dragItems:c,nodeLookup:ne});n==null||n(G.sourceEvent,c,ie,de),H==null||H(G.sourceEvent,ie,de),D||I==null||I(G.sourceEvent,de)}}const P=zk().clickDistance(F).on("start",G=>{const{domNode:ne,nodeDragThreshold:X,transform:W,snapGrid:O,snapToGrid:Y}=t();m=(ne==null?void 0:ne.getBoundingClientRect())||null,_=!1,S=!1,A=G.sourceEvent,X===0&&V(G),s=Bm(G.sourceEvent,{transform:W,snapGrid:O,snapToGrid:Y,containerBounds:m}),p=Cl(G.sourceEvent,m)}).on("drag",G=>{const{autoPanOnNodeDrag:ne,transform:X,snapGrid:W,snapToGrid:O,nodeDragThreshold:Y,nodeLookup:$}=t(),Q=Bm(G.sourceEvent,{transform:X,snapGrid:W,snapToGrid:O,containerBounds:m});if(A=G.sourceEvent,(G.sourceEvent.type==="touchmove"&&G.sourceEvent.touches.length>1||D&&!$.has(D))&&(_=!0),!_){if(!f&&ne&&g&&(f=!0,K()),!g){const H=Cl(G.sourceEvent,m),I=H.x-p.x,J=H.y-p.y;Math.sqrt(I*I+J*J)>Y&&V(G)}(s.x!==Q.xSnapped||s.y!==Q.ySnapped)&&c&&g&&(p=Cl(G.sourceEvent,m),Z(Q))}}).on("end",G=>{if(!(!g||_)&&(f=!1,g=!1,cancelAnimationFrame(l),c.size>0)){const{nodeLookup:ne,updateNodePositions:X,onNodeDragStop:W,onSelectionDragStop:O}=t();if(S&&(X(c,!1),S=!1),r||W||!D&&O){const[Y,$]=jv({nodeId:D,dragItems:c,nodeLookup:ne,dragging:!1});r==null||r(G.sourceEvent,c,Y,$),W==null||W(G.sourceEvent,Y,$),D||O==null||O(G.sourceEvent,$)}}}).filter(G=>{const ne=G.target;return!G.button&&(!N||!$T(ne,`.${N}`,z))&&(!R||$T(ne,R,z))});b.call(P)}function C(){b==null||b.on(".drag",null)}return{update:T,destroy:C}}function tK(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())eg(r,wh(s))>0&&i.push(s);return i}const nK=250;function iK(e,t,n,i){var c,f;let r=[],s=1/0;const l=tK(e,n,t+nK);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:b,y:_}=Dd(p,g,g.position,!0),S=Math.sqrt(Math.pow(b-e.x,2)+Math.pow(_-e.y,2));S>t||(S<s?(r=[{...g,x:b,y:_}],s=S):S===s&&r.push({...g,x:b,y:_}))}}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 xN(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(b=>b.id===n):c==null?void 0:c[0])??null;return f&&s?{...f,...Dd(l,f,f.position,!0)}:f}function bN(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function rK(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const vN=()=>!0;function aK(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:s,isTarget:l,domNode:c,nodeLookup:f,lib:p,autoPanOnConnect:m,flowId:g,panBy:b,cancelConnection:_,onConnectStart:S,onConnect:A,onConnectEnd:T,isValidConnection:C=vN,onReconnectEnd:N,updateConnection:R,getTransform:z,getFromHandle:L,autoPanSpeed:D,dragThreshold:F=1,handleDomNode:Z}){const K=lN(e.target);let V=0,P;const{x:G,y:ne}=Cl(e),X=bN(s,Z),W=c==null?void 0:c.getBoundingClientRect();let O=!1;if(!W||!X)return;const Y=xN(r,X,i,f,t);if(!Y)return;let $=Cl(e,W),Q=!1,H=null,I=!1,J=null;function q(){if(!m||!W)return;const[Le,Be]=iN($,W,D);b({x:Le,y:Be}),V=requestAnimationFrame(q)}const oe={...Y,nodeId:r,type:X,position:Y.position},ie=f.get(r);let me={inProgress:!0,isValid:null,from:Dd(ie,oe,$e.Left,!0),fromHandle:oe,fromPosition:oe.position,fromNode:ie,to:$,toHandle:null,toPosition:IT[oe.position],toNode:null,pointer:$};function ge(){O=!0,R(me),S==null||S(e,{nodeId:r,handleId:i,handleType:X})}F===0&&ge();function le(Le){if(!O){const{x:wt,y:Sn}=Cl(Le),En=wt-G,pn=Sn-ne;if(!(En*En+pn*pn>F*F))return;ge()}if(!L()||!oe){Re(Le);return}const Be=z();$=Cl(Le,W),P=iK(yg($,Be,!1,[1,1]),n,f,oe),Q||(q(),Q=!0);const He=_N(Le,{handle:P,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:l?"target":"source",isValidConnection:C,doc:K,lib:p,flowId:g,nodeLookup:f});J=He.handleDomNode,H=He.connection,I=rK(!!P,He.isValid);const Qe=f.get(r),ot=Qe?Dd(Qe,oe,$e.Left,!0):me.from,Ue={...me,from:ot,isValid:I,to:He.toHandle&&I?nx({x:He.toHandle.x,y:He.toHandle.y},Be):$,toHandle:He.toHandle,toPosition:I&&He.toHandle?He.toHandle.position:IT[oe.position],toNode:He.toHandle?f.get(He.toHandle.nodeId):null,pointer:$};R(Ue),me=Ue}function Re(Le){if(!("touches"in Le&&Le.touches.length>0)){if(O){(P||J)&&H&&I&&(A==null||A(H));const{inProgress:Be,...He}=me,Qe={...He,toPosition:me.toHandle?me.toPosition:null};T==null||T(Le,Qe),s&&(N==null||N(Le,Qe))}_(),cancelAnimationFrame(V),Q=!1,I=!1,H=null,J=null,K.removeEventListener("mousemove",le),K.removeEventListener("mouseup",Re),K.removeEventListener("touchmove",le),K.removeEventListener("touchend",Re)}}K.addEventListener("mousemove",le),K.addEventListener("mouseup",Re),K.addEventListener("touchmove",le),K.addEventListener("touchend",Re)}function _N(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:l,lib:c,flowId:f,isValidConnection:p=vN,nodeLookup:m}){const g=s==="target",b=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:_,y:S}=Cl(e),A=l.elementFromPoint(_,S),T=A!=null&&A.classList.contains(`${c}-flow__handle`)?A:b,C={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){const N=bN(void 0,T),R=T.getAttribute("data-nodeid"),z=T.getAttribute("data-handleid"),L=T.classList.contains("connectable"),D=T.classList.contains("connectableend");if(!R||!N)return C;const F={source:g?R:i,sourceHandle:g?z:r,target:g?i:R,targetHandle:g?r:z};C.connection=F;const K=L&&D&&(n===Sh.Strict?g&&N==="source"||!g&&N==="target":R!==i||z!==r);C.isValid=K&&p(F),C.toHandle=xN(R,N,z,m,n,!0)}return C}const $1={onPointerDown:aK,isValid:_N};function sK({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=os(e);function s({translateExtent:c,width:f,height:p,zoomStep:m=1,pannable:g=!0,zoomable:b=!0,inversePan:_=!1}){const S=R=>{if(R.sourceEvent.type!=="wheel"||!t)return;const z=n(),L=R.sourceEvent.ctrlKey&&tg()?10:1,D=-R.sourceEvent.deltaY*(R.sourceEvent.deltaMode===1?.05:R.sourceEvent.deltaMode?1:.002)*m,F=z[2]*Math.pow(2,D*L);t.scaleTo(F)};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 z=n();if(R.sourceEvent.type!=="mousemove"&&R.sourceEvent.type!=="touchmove"||!t)return;const L=[R.sourceEvent.clientX??R.sourceEvent.touches[0].clientX,R.sourceEvent.clientY??R.sourceEvent.touches[0].clientY],D=[L[0]-A[0],L[1]-A[1]];A=L;const F=i()*Math.max(z[2],Math.log(z[2]))*(_?-1:1),Z={x:z[0]-D[0]*F,y:z[1]-D[1]*F},K=[[0,0],[f,p]];t.setViewportConstrained({x:Z.x,y:Z.y,zoom:z[2]},K,c)},N=Wk().on("start",T).on("zoom",g?C:null).on("zoom.wheel",b?S:null);r.call(N,{})}function l(){r.on("zoom",null)}return{update:s,destroy:l,pointer:_l}}const Ax=e=>({x:e.x,y:e.y,zoom:e.k}),Lv=({x:e,y:t,zoom:n})=>wx.translate(e,t).scale(n),sh=(e,t)=>e.target.closest(`.${t}`),SN=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),lK=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Bv=(e,t=0,n=lK,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},EN=e=>{const t=e.ctrlKey&&tg()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function oK({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:f,onPanZoomEnd:p}){return m=>{if(sh(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=_l(m),C=EN(m),N=g*Math.pow(2,C);i.scaleTo(n,N,T,m);return}const b=m.deltaMode===1?20:1;let _=r===Cd.Vertical?0:m.deltaX*b,S=r===Cd.Horizontal?0:m.deltaY*b;!tg()&&m.shiftKey&&r!==Cd.Vertical&&(_=m.deltaY*b,S=0),i.translateBy(n,-(_/g)*s,-(S/g)*s,{internal:!0});const A=Ax(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 cK({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",l=!t&&s&&!i.ctrlKey,c=sh(i,e);if(i.ctrlKey&&s&&c&&i.preventDefault(),l||c)return null;i.preventDefault(),n.call(this,i,r)}}function uK({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,l,c;if((s=i.sourceEvent)!=null&&s.internal)return;const r=Ax(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 dK({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var l,c;e.usedRightMouseButton=!!(n&&SN(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,Ax(s.transform)))}}function fK({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&&SN(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&s(l.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const f=Ax(l.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(l.sourceEvent,f)},n?150:0)}}}function hK({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 b=e||t,_=n&&g.ctrlKey,S=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(sh(g,`${p}-flow__node`)||sh(g,`${p}-flow__edge`)))return!0;if(!i&&!b&&!r&&!s&&!n||l||m&&!S||sh(g,c)&&S||sh(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(!b&&!r&&!_&&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 pK({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=Wk().scaleExtent([t,n]).translateExtent(i),b=os(e).call(g);N({x:r.x,y:r.y,zoom:Eh(r.zoom,t,n)},[[0,0],[m.width,m.height]],i);const _=b.on("wheel.zoom"),S=b.on("dblclick.zoom");g.wheelDelta(EN);function A(P,G){return b?new Promise(ne=>{g==null||g.interpolate((G==null?void 0:G.interpolate)==="linear"?Lm:M0).transform(Bv(b,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>ne(!0)),P)}):Promise.resolve(!1)}function T({noWheelClassName:P,noPanClassName:G,onPaneContextMenu:ne,userSelectionActive:X,panOnScroll:W,panOnDrag:O,panOnScrollMode:Y,panOnScrollSpeed:$,preventScrolling:Q,zoomOnPinch:H,zoomOnScroll:I,zoomOnDoubleClick:J,zoomActivationKeyPressed:q,lib:oe,onTransformChange:ie,connectionInProgress:de,paneClickDistance:me,selectionOnDrag:ge}){X&&!p.isZoomingOrPanning&&C();const le=W&&!q&&!X;g.clickDistance(ge?1/0:!Tl(me)||me<0?0:me);const Re=le?oK({zoomPanValues:p,noWheelClassName:P,d3Selection:b,d3Zoom:g,panOnScrollMode:Y,panOnScrollSpeed:$,zoomOnPinch:H,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:c}):cK({noWheelClassName:P,preventScrolling:Q,d3ZoomHandler:_});if(b.on("wheel.zoom",Re,{passive:!1}),!X){const Be=uK({zoomPanValues:p,onDraggingChange:f,onPanZoomStart:l});g.on("start",Be);const He=dK({zoomPanValues:p,panOnDrag:O,onPaneContextMenu:!!ne,onPanZoom:s,onTransformChange:ie});g.on("zoom",He);const Qe=fK({zoomPanValues:p,panOnDrag:O,panOnScroll:W,onPaneContextMenu:ne,onPanZoomEnd:c,onDraggingChange:f});g.on("end",Qe)}const Le=hK({zoomActivationKeyPressed:q,panOnDrag:O,zoomOnScroll:I,panOnScroll:W,zoomOnDoubleClick:J,zoomOnPinch:H,userSelectionActive:X,noPanClassName:G,noWheelClassName:P,lib:oe,connectionInProgress:de});g.filter(Le),J?b.on("dblclick.zoom",S):b.on("dblclick.zoom",null)}function C(){g.on("zoom",null)}async function N(P,G,ne){const X=Lv(P),W=g==null?void 0:g.constrain()(X,G,ne);return W&&await A(W),new Promise(O=>O(W))}async function R(P,G){const ne=Lv(P);return await A(ne,G),new Promise(X=>X(ne))}function z(P){if(b){const G=Lv(P),ne=b.property("__zoom");(ne.k!==P.zoom||ne.x!==P.x||ne.y!==P.y)&&(g==null||g.transform(b,G,null,{sync:!0}))}}function L(){const P=b?Kk(b.node()):{x:0,y:0,k:1};return{x:P.x,y:P.y,zoom:P.k}}function D(P,G){return b?new Promise(ne=>{g==null||g.interpolate((G==null?void 0:G.interpolate)==="linear"?Lm:M0).scaleTo(Bv(b,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>ne(!0)),P)}):Promise.resolve(!1)}function F(P,G){return b?new Promise(ne=>{g==null||g.interpolate((G==null?void 0:G.interpolate)==="linear"?Lm:M0).scaleBy(Bv(b,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>ne(!0)),P)}):Promise.resolve(!1)}function Z(P){g==null||g.scaleExtent(P)}function K(P){g==null||g.translateExtent(P)}function V(P){const G=!Tl(P)||P<0?0:P;g==null||g.clickDistance(G)}return{update:T,destroy:C,setViewport:R,setViewportConstrained:N,getViewport:L,scaleTo:D,scaleBy:F,setScaleExtent:Z,setTranslateExtent:K,syncViewport:z,setClickDistance:V}}var Ch;(function(e){e.Line="line",e.Handle="handle"})(Ch||(Ch={}));function mK({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 QT(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 ou(e,t){return Math.max(0,t-e)}function cu(e,t){return Math.max(0,e-t)}function x0(e,t,n){return Math.max(0,t-e,e-n)}function ZT(e,t){return e?!t:t}function gK(e,t,n,i,r,s,l,c){let{affectsX:f,affectsY:p}=t;const{isHorizontal:m,isVertical:g}=t,b=m&&g,{xSnapped:_,ySnapped:S}=n,{minWidth:A,maxWidth:T,minHeight:C,maxHeight:N}=i,{x:R,y:z,width:L,height:D,aspectRatio:F}=e;let Z=Math.floor(m?_-e.pointerX:0),K=Math.floor(g?S-e.pointerY:0);const V=L+(f?-Z:Z),P=D+(p?-K:K),G=-s[0]*L,ne=-s[1]*D;let X=x0(V,A,T),W=x0(P,C,N);if(l){let $=0,Q=0;f&&Z<0?$=ou(R+Z+G,l[0][0]):!f&&Z>0&&($=cu(R+V+G,l[1][0])),p&&K<0?Q=ou(z+K+ne,l[0][1]):!p&&K>0&&(Q=cu(z+P+ne,l[1][1])),X=Math.max(X,$),W=Math.max(W,Q)}if(c){let $=0,Q=0;f&&Z>0?$=cu(R+Z,c[0][0]):!f&&Z<0&&($=ou(R+V,c[1][0])),p&&K>0?Q=cu(z+K,c[0][1]):!p&&K<0&&(Q=ou(z+P,c[1][1])),X=Math.max(X,$),W=Math.max(W,Q)}if(r){if(m){const $=x0(V/F,C,N)*F;if(X=Math.max(X,$),l){let Q=0;!f&&!p||f&&!p&&b?Q=cu(z+ne+V/F,l[1][1])*F:Q=ou(z+ne+(f?Z:-Z)/F,l[0][1])*F,X=Math.max(X,Q)}if(c){let Q=0;!f&&!p||f&&!p&&b?Q=ou(z+V/F,c[1][1])*F:Q=cu(z+(f?Z:-Z)/F,c[0][1])*F,X=Math.max(X,Q)}}if(g){const $=x0(P*F,A,T)/F;if(W=Math.max(W,$),l){let Q=0;!f&&!p||p&&!f&&b?Q=cu(R+P*F+G,l[1][0])/F:Q=ou(R+(p?K:-K)*F+G,l[0][0])/F,W=Math.max(W,Q)}if(c){let Q=0;!f&&!p||p&&!f&&b?Q=ou(R+P*F,c[1][0])/F:Q=cu(R+(p?K:-K)*F,c[0][0])/F,W=Math.max(W,Q)}}}K=K+(K<0?W:-W),Z=Z+(Z<0?X:-X),r&&(b?V>P*F?K=(ZT(f,p)?-Z:Z)/F:Z=(ZT(f,p)?-K:K)*F:m?(K=Z/F,p=f):(Z=K*F,f=p));const O=f?R+Z:R,Y=p?z+K:z;return{width:L+(f?-Z:Z),height:D+(p?-K:K),x:s[0]*Z*(f?-1:1)+O,y:s[1]*K*(p?-1:1)+Y}}const wN={width:0,height:0,x:0,y:0},yK={...wN,pointerX:0,pointerY:0,aspectRatio:1};function xK(e){return[[0,0],[e.measured.width,e.measured.height]]}function bK(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 vK({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const s=os(e);let l={controlDirection:QT("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:b,onResizeStart:_,onResize:S,onResizeEnd:A,shouldResize:T}){let C={...wN},N={...yK};l={boundaries:m,resizeDirection:b,keepAspectRatio:g,controlDirection:QT(p)};let R,z=null,L=[],D,F,Z,K=!1;const V=zk().on("start",P=>{const{nodeLookup:G,transform:ne,snapGrid:X,snapToGrid:W,nodeOrigin:O,paneDomNode:Y}=n();if(R=G.get(t),!R)return;z=(Y==null?void 0:Y.getBoundingClientRect())??null;const{xSnapped:$,ySnapped:Q}=Bm(P.sourceEvent,{transform:ne,snapGrid:X,snapToGrid:W,containerBounds:z});C={width:R.measured.width??0,height:R.measured.height??0,x:R.position.x??0,y:R.position.y??0},N={...C,pointerX:$,pointerY:Q,aspectRatio:C.width/C.height},D=void 0,R.parentId&&(R.extent==="parent"||R.expandParent)&&(D=G.get(R.parentId),F=D&&R.extent==="parent"?xK(D):void 0),L=[],Z=void 0;for(const[H,I]of G)if(I.parentId===t&&(L.push({id:H,position:{...I.position},extent:I.extent}),I.extent==="parent"||I.expandParent)){const J=bK(I,R,I.origin??O);Z?Z=[[Math.min(J[0][0],Z[0][0]),Math.min(J[0][1],Z[0][1])],[Math.max(J[1][0],Z[1][0]),Math.max(J[1][1],Z[1][1])]]:Z=J}_==null||_(P,{...C})}).on("drag",P=>{const{transform:G,snapGrid:ne,snapToGrid:X,nodeOrigin:W}=n(),O=Bm(P.sourceEvent,{transform:G,snapGrid:ne,snapToGrid:X,containerBounds:z}),Y=[];if(!R)return;const{x:$,y:Q,width:H,height:I}=C,J={},q=R.origin??W,{width:oe,height:ie,x:de,y:me}=gK(N,l.controlDirection,O,l.boundaries,l.keepAspectRatio,q,F,Z),ge=oe!==H,le=ie!==I,Re=de!==$&&ge,Le=me!==Q&&le;if(!Re&&!Le&&!ge&&!le)return;if((Re||Le||q[0]===1||q[1]===1)&&(J.x=Re?de:C.x,J.y=Le?me:C.y,C.x=J.x,C.y=J.y,L.length>0)){const ot=de-$,Ue=me-Q;for(const wt of L)wt.position={x:wt.position.x-ot+q[0]*(oe-H),y:wt.position.y-Ue+q[1]*(ie-I)},Y.push(wt)}if((ge||le)&&(J.width=ge&&(!l.resizeDirection||l.resizeDirection==="horizontal")?oe:C.width,J.height=le&&(!l.resizeDirection||l.resizeDirection==="vertical")?ie:C.height,C.width=J.width,C.height=J.height),D&&R.expandParent){const ot=q[0]*(J.width??0);J.x&&J.x<ot&&(C.x=ot,N.x=N.x-(J.x-ot));const Ue=q[1]*(J.height??0);J.y&&J.y<Ue&&(C.y=Ue,N.y=N.y-(J.y-Ue))}const Be=mK({width:C.width,prevWidth:H,height:C.height,prevHeight:I,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),He={...C,direction:Be};(T==null?void 0:T(P,He))!==!1&&(K=!0,S==null||S(P,He),i(J,Y))}).on("end",P=>{K&&(A==null||A(P,{...C}),r==null||r({...C}),K=!1)});s.call(V)}function f(){s.on(".drag",null)}return{update:c,destroy:f}}var Iv={exports:{}},Uv={},Hv={exports:{}},Pv={};/**
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 JT;function _K(){if(JT)return Pv;JT=1;var e=Ah();function t(g,b){return g===b&&(g!==0||1/g===1/b)||g!==g&&b!==b}var n=typeof Object.is=="function"?Object.is:t,i=e.useState,r=e.useEffect,s=e.useLayoutEffect,l=e.useDebugValue;function c(g,b){var _=b(),S=i({inst:{value:_,getSnapshot:b}}),A=S[0].inst,T=S[1];return s(function(){A.value=_,A.getSnapshot=b,f(A)&&T({inst:A})},[g,_,b]),r(function(){return f(A)&&T({inst:A}),g(function(){f(A)&&T({inst:A})})},[g]),l(_),_}function f(g){var b=g.getSnapshot;g=g.value;try{var _=b();return!n(g,_)}catch{return!0}}function p(g,b){return b()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:c;return Pv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Pv}var eC;function SK(){return eC||(eC=1,Hv.exports=_K()),Hv.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 tC;function EK(){if(tC)return Uv;tC=1;var e=Ah(),t=SK();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 Uv.useSyncExternalStoreWithSelector=function(p,m,g,b,_){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=b(D),_!==void 0&&A.hasValue){var F=A.value;if(_(F,D))return z=F}return z=D}if(F=z,i(R,D))return F;var Z=b(D);return _!==void 0&&_(F,Z)?(R=D,F):(R=D,z=Z)}var N=!1,R,z,L=g===void 0?null:g;return[function(){return C(m())},L===null?void 0:function(){return C(L())}]},[m,g,b,_]);var T=r(p,S[0],S[1]);return l(function(){A.hasValue=!0,A.value=T},[T]),f(T),T},Uv}var nC;function wK(){return nC||(nC=1,Iv.exports=EK()),Iv.exports}var TK=wK();const CK=xu(TK),AK={},iC=e=>{let t;const n=new Set,i=(m,g)=>{const b=typeof m=="function"?m(t):m;if(!Object.is(b,t)){const _=t;t=g??(typeof b!="object"||b===null)?b:Object.assign({},t,b),n.forEach(S=>S(t,_))}},r=()=>t,f={setState:i,getState:r,getInitialState:()=>p,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(AK?"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},MK=e=>e?iC(e):iC,{useDebugValue:RK}=vm,{useSyncExternalStoreWithSelector:kK}=CK,NK=e=>e;function TN(e,t=NK,n){const i=kK(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return RK(i),i}const rC=(e,t)=>{const n=MK(e),i=(r,s=t)=>TN(n,r,s);return Object.assign(i,n),i},OK=(e,t)=>e?rC(e,t):rC;function Jn(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 Mx=B.createContext(null),DK=Mx.Provider,CN=Eo.error001();function $t(e,t){const n=B.useContext(Mx);if(n===null)throw new Error(CN);return TN(n,e,t)}function ei(){const e=B.useContext(Mx);if(e===null)throw new Error(CN);return B.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const aC={display:"none"},zK={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},AN="react-flow__node-desc",MN="react-flow__edge-desc",jK="react-flow__aria-live",LK=e=>e.ariaLiveMessage,BK=e=>e.ariaLabelConfig;function IK({rfId:e}){const t=$t(LK);return x.jsx("div",{id:`${jK}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:zK,children:t})}function UK({rfId:e,disableKeyboardA11y:t}){const n=$t(BK);return x.jsxs(x.Fragment,{children:[x.jsx("div",{id:`${AN}-${e}`,style:aC,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),x.jsx("div",{id:`${MN}-${e}`,style:aC,children:n["edge.a11yDescription.default"]}),!t&&x.jsx(IK,{rfId:e})]})}const Rx=B.forwardRef(({position:e="top-left",children:t,className:n,style:i,...r},s)=>{const l=`${e}`.split("-");return x.jsx("div",{className:Ii(["react-flow__panel",n,...l]),style:i,ref:s,...r,children:t})});Rx.displayName="Panel";function HK({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:x.jsx(Rx,{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:x.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const PK=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}},b0=e=>e.id;function FK(e,t){return Jn(e.selectedNodes.map(b0),t.selectedNodes.map(b0))&&Jn(e.selectedEdges.map(b0),t.selectedEdges.map(b0))}function qK({onSelectionChange:e}){const t=ei(),{selectedNodes:n,selectedEdges:i}=$t(PK,FK);return B.useEffect(()=>{const r={nodes:n,edges:i};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(s=>s(r))},[n,i,e]),null}const GK=e=>!!e.onSelectionChangeHandlers;function YK({onSelectionChange:e}){const t=$t(GK);return e||t?x.jsx(qK,{onSelectionChange:e}):null}const RN=[0,0],VK={x:0,y:0,zoom:1},XK=["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"],sC=[...XK,"rfId"],KK=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}),lC={translateExtent:Qm,nodeOrigin:RN,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function WK(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:f}=$t(KK,Jn),p=ei();B.useEffect(()=>(f(e.defaultNodes,e.defaultEdges),()=>{m.current=lC,c()}),[]);const m=B.useRef(lC);return B.useEffect(()=>{for(const g of sC){const b=e[g],_=m.current[g];b!==_&&(typeof e[g]>"u"||(g==="nodes"?t(b):g==="edges"?n(b):g==="minZoom"?i(b):g==="maxZoom"?r(b):g==="translateExtent"?s(b):g==="nodeExtent"?l(b):g==="ariaLabelConfig"?p.setState({ariaLabelConfig:OX(b)}):g==="fitView"?p.setState({fitViewQueued:b}):g==="fitViewOptions"?p.setState({fitViewOptions:b}):p.setState({[g]:b})))}m.current=e},sC.map(g=>e[g])),null}function oC(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function $K(e){var i;const[t,n]=B.useState(e==="system"?null:e);return B.useEffect(()=>{if(e!=="system"){n(e);return}const r=oC(),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=oC())!=null&&i.matches?"dark":"light"}const cC=typeof document<"u"?document:null;function ng(e=null,t={target:cC,actInsideInputWithModifier:!0}){const[n,i]=B.useState(!1),r=B.useRef(!1),s=B.useRef(new Set([])),[l,c]=B.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,b)=>g.concat(...b),[]);return[p,m]}return[[],[]]},[e]);return B.useEffect(()=>{const f=(t==null?void 0:t.target)??cC,p=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=_=>{var T,C;if(r.current=_.ctrlKey||_.metaKey||_.shiftKey||_.altKey,(!r.current||r.current&&!p)&&oN(_))return!1;const A=dC(_.code,c);if(s.current.add(_[A]),uC(l,s.current,!1)){const N=((C=(T=_.composedPath)==null?void 0:T.call(_))==null?void 0:C[0])||_.target,R=(N==null?void 0:N.nodeName)==="BUTTON"||(N==null?void 0:N.nodeName)==="A";t.preventDefault!==!1&&(r.current||!R)&&_.preventDefault(),i(!0)}},g=_=>{const S=dC(_.code,c);uC(l,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(_[S]),_.key==="Meta"&&s.current.clear(),r.current=!1},b=()=>{s.current.clear(),i(!1)};return f==null||f.addEventListener("keydown",m),f==null||f.addEventListener("keyup",g),window.addEventListener("blur",b),window.addEventListener("contextmenu",b),()=>{f==null||f.removeEventListener("keydown",m),f==null||f.removeEventListener("keyup",g),window.removeEventListener("blur",b),window.removeEventListener("contextmenu",b)}}},[e,i]),n}function uC(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function dC(e,t){return t.includes(e)?"code":"key"}const QK=()=>{const e=ei();return B.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=tS(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 yg(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=nx(t,n);return{x:l.x+r,y:l.y+s}}}),[])};function kN(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)ZK(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 ZK(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 JK(e,t){return kN(e,t)}function eW(e,t){return kN(e,t)}function _d(e,t){return{id:e,type:"select",selected:t}}function lh(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(_d(s.id,l)))}return i}function fC({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 hC(e){return{id:e.id,type:"remove"}}const pC=e=>SX(e),tW=e=>eN(e);function NN(e){return B.forwardRef(e)}const nW=typeof window<"u"?B.useLayoutEffect:B.useEffect;function mC(e){const[t,n]=B.useState(BigInt(0)),[i]=B.useState(()=>iW(()=>n(r=>r+BigInt(1))));return nW(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function iW(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const ON=B.createContext(null);function rW({children:e}){const t=ei(),n=B.useCallback(c=>{const{nodes:f=[],setNodes:p,hasDefaultNodes:m,onNodesChange:g,nodeLookup:b,fitViewQueued:_,onNodesChangeMiddlewareMap:S}=t.getState();let A=f;for(const C of c)A=typeof C=="function"?C(A):C;let T=fC({items:A,lookup:b});for(const C of S.values())T=C(T);m&&p(A),T.length>0?g==null||g(T):_&&window.requestAnimationFrame(()=>{const{fitViewQueued:C,nodes:N,setNodes:R}=t.getState();C&&R(N)})},[]),i=mC(n),r=B.useCallback(c=>{const{edges:f=[],setEdges:p,hasDefaultEdges:m,onEdgesChange:g,edgeLookup:b}=t.getState();let _=f;for(const S of c)_=typeof S=="function"?S(_):S;m?p(_):g&&g(fC({items:_,lookup:b}))},[]),s=mC(r),l=B.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return x.jsx(ON.Provider,{value:l,children:e})}function aW(){const e=B.useContext(ON);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const sW=e=>!!e.panZoom;function kx(){const e=QK(),t=ei(),n=aW(),i=$t(sW),r=B.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:b,nodeOrigin:_}=t.getState(),S=pC(g)?g:b.get(g.id),A=S.parentId?sN(S.position,S.measured,S.parentId,b,_):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 wh(T)},p=(g,b,_={replace:!1})=>{l(S=>S.map(A=>{if(A.id===g){const T=typeof b=="function"?b(A):b;return _.replace&&pC(T)?T:{...A,...T}}return A}))},m=(g,b,_={replace:!1})=>{c(S=>S.map(A=>{if(A.id===g){const T=typeof b=="function"?b(A):b;return _.replace&&tW(T)?T:{...A,...T}}return A}))};return{getNodes:()=>t.getState().nodes.map(g=>({...g})),getNode:g=>{var b;return(b=s(g))==null?void 0:b.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:g=[]}=t.getState();return g.map(b=>({...b}))},getEdge:g=>t.getState().edgeLookup.get(g),setNodes:l,setEdges:c,addNodes:g=>{const b=Array.isArray(g)?g:[g];n.nodeQueue.push(_=>[..._,...b])},addEdges:g=>{const b=Array.isArray(g)?g:[g];n.edgeQueue.push(_=>[..._,...b])},toObject:()=>{const{nodes:g=[],edges:b=[],transform:_}=t.getState(),[S,A,T]=_;return{nodes:g.map(C=>({...C})),edges:b.map(C=>({...C})),viewport:{x:S,y:A,zoom:T}}},deleteElements:async({nodes:g=[],edges:b=[]})=>{const{nodes:_,edges:S,onNodesDelete:A,onEdgesDelete:T,triggerNodeChanges:C,triggerEdgeChanges:N,onDelete:R,onBeforeDelete:z}=t.getState(),{nodes:L,edges:D}=await AX({nodesToRemove:g,edgesToRemove:b,nodes:_,edges:S,onBeforeDelete:z}),F=D.length>0,Z=L.length>0;if(F){const K=D.map(hC);T==null||T(D),N(K)}if(Z){const K=L.map(hC);A==null||A(L),C(K)}return(Z||F)&&(R==null||R({nodes:L,edges:D})),{deletedNodes:L,deletedEdges:D}},getIntersectingNodes:(g,b=!0,_)=>{const S=HT(g),A=S?g:f(g),T=_!==void 0;return A?(_||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=wh(T?C:N),z=eg(R,A);return b&&z>0||z>=R.width*R.height||z>=A.width*A.height}):[]},isNodeIntersecting:(g,b,_=!0)=>{const A=HT(g)?g:f(g);if(!A)return!1;const T=eg(A,b);return _&&T>0||T>=b.width*b.height||T>=A.width*A.height},updateNode:p,updateNodeData:(g,b,_={replace:!1})=>{p(g,S=>{const A=typeof b=="function"?b(S):b;return _.replace?{...S,data:A}:{...S,data:{...S.data,...A}}},_)},updateEdge:m,updateEdgeData:(g,b,_={replace:!1})=>{m(g,S=>{const A=typeof b=="function"?b(S):b;return _.replace?{...S,data:A}:{...S,data:{...S.data,...A}}},_)},getNodesBounds:g=>{const{nodeLookup:b,nodeOrigin:_}=t.getState();return EX(g,{nodeLookup:b,nodeOrigin:_})},getHandleConnections:({type:g,id:b,nodeId:_})=>{var S;return Array.from(((S=t.getState().connectionLookup.get(`${_}-${g}${b?`-${b}`:""}`))==null?void 0:S.values())??[])},getNodeConnections:({type:g,handleId:b,nodeId:_})=>{var S;return Array.from(((S=t.getState().connectionLookup.get(`${_}${g?b?`-${g}-${b}`:`-${g}`:""}`))==null?void 0:S.values())??[])},fitView:async g=>{const b=t.getState().fitViewResolver??NX();return t.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:b}),n.nodeQueue.push(_=>[..._]),b.promise}}},[]);return B.useMemo(()=>({...r,...e,viewportInitialized:i}),[i])}const gC=e=>e.selected,lW=typeof window<"u"?window:void 0;function oW({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ei(),{deleteElements:i}=kx(),r=ng(e,{actInsideInputWithModifier:!1}),s=ng(t,{target:lW});B.useEffect(()=>{if(r){const{edges:l,nodes:c}=n.getState();i({nodes:c.filter(gC),edges:l.filter(gC)}),n.setState({nodesSelectionActive:!1})}},[r]),B.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function cW(e){const t=ei();B.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=nS(e.current);(i.height===0||i.width===0)&&((c=(l=t.getState()).onError)==null||c.call(l,"004",Eo.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 Nx={position:"absolute",width:"100%",height:"100%",top:0,left:0},uW=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function dW({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=Cd.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:f,translateExtent:p,minZoom:m,maxZoom:g,zoomActivationKeyCode:b,preventScrolling:_=!0,children:S,noWheelClassName:A,noPanClassName:T,onViewportChange:C,isControlledViewport:N,paneClickDistance:R,selectionOnDrag:z}){const L=ei(),D=B.useRef(null),{userSelectionActive:F,lib:Z,connectionInProgress:K}=$t(uW,Jn),V=ng(b),P=B.useRef();cW(D);const G=B.useCallback(ne=>{C==null||C({x:ne[0],y:ne[1],zoom:ne[2]}),N||L.setState({transform:ne})},[C,N]);return B.useEffect(()=>{if(D.current){P.current=pK({domNode:D.current,minZoom:m,maxZoom:g,translateExtent:p,viewport:f,onDraggingChange:O=>L.setState(Y=>Y.paneDragging===O?Y:{paneDragging:O}),onPanZoomStart:(O,Y)=>{const{onViewportChangeStart:$,onMoveStart:Q}=L.getState();Q==null||Q(O,Y),$==null||$(Y)},onPanZoom:(O,Y)=>{const{onViewportChange:$,onMove:Q}=L.getState();Q==null||Q(O,Y),$==null||$(Y)},onPanZoomEnd:(O,Y)=>{const{onViewportChangeEnd:$,onMoveEnd:Q}=L.getState();Q==null||Q(O,Y),$==null||$(Y)}});const{x:ne,y:X,zoom:W}=P.current.getViewport();return L.setState({panZoom:P.current,transform:[ne,X,W],domNode:D.current.closest(".react-flow")}),()=>{var O;(O=P.current)==null||O.destroy()}}},[]),B.useEffect(()=>{var ne;(ne=P.current)==null||ne.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:V,preventScrolling:_,noPanClassName:T,userSelectionActive:F,noWheelClassName:A,lib:Z,onTransformChange:G,connectionInProgress:K,selectionOnDrag:z,paneClickDistance:R})},[e,t,n,i,r,s,l,c,V,_,T,F,A,Z,G,K,z,R]),x.jsx("div",{className:"react-flow__renderer",ref:D,style:Nx,children:S})}const fW=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function hW(){const{userSelectionActive:e,userSelectionRect:t}=$t(fW,Jn);return e&&t?x.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 Fv=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},pW=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function mW({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Zm.Full,panOnDrag:i,paneClickDistance:r,selectionOnDrag:s,onSelectionStart:l,onSelectionEnd:c,onPaneClick:f,onPaneContextMenu:p,onPaneScroll:m,onPaneMouseEnter:g,onPaneMouseMove:b,onPaneMouseLeave:_,children:S}){const A=ei(),{userSelectionActive:T,elementsSelectable:C,dragging:N,connectionInProgress:R}=$t(pW,Jn),z=C&&(e||T),L=B.useRef(null),D=B.useRef(),F=B.useRef(new Set),Z=B.useRef(new Set),K=B.useRef(!1),V=$=>{if(K.current||R){K.current=!1;return}f==null||f($),A.getState().resetSelectedElements(),A.setState({nodesSelectionActive:!1})},P=$=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){$.preventDefault();return}p==null||p($)},G=m?$=>m($):void 0,ne=$=>{K.current&&($.stopPropagation(),K.current=!1)},X=$=>{var ie,de;const{domNode:Q}=A.getState();if(D.current=Q==null?void 0:Q.getBoundingClientRect(),!D.current)return;const H=$.target===L.current;if(!H&&!!$.target.closest(".nokey")||!e||!(s&&H||t)||$.button!==0||!$.isPrimary)return;(de=(ie=$.target)==null?void 0:ie.setPointerCapture)==null||de.call(ie,$.pointerId),K.current=!1;const{x:q,y:oe}=Cl($.nativeEvent,D.current);A.setState({userSelectionRect:{width:0,height:0,startX:q,startY:oe,x:q,y:oe}}),H||($.stopPropagation(),$.preventDefault())},W=$=>{const{userSelectionRect:Q,transform:H,nodeLookup:I,edgeLookup:J,connectionLookup:q,triggerNodeChanges:oe,triggerEdgeChanges:ie,defaultEdgeOptions:de,resetSelectedElements:me}=A.getState();if(!D.current||!Q)return;const{x:ge,y:le}=Cl($.nativeEvent,D.current),{startX:Re,startY:Le}=Q;if(!K.current){const Ue=t?0:r;if(Math.hypot(ge-Re,le-Le)<=Ue)return;me(),l==null||l($)}K.current=!0;const Be={startX:Re,startY:Le,x:ge<Re?ge:Re,y:le<Le?le:Le,width:Math.abs(ge-Re),height:Math.abs(le-Le)},He=F.current,Qe=Z.current;F.current=new Set(eS(I,Be,H,n===Zm.Partial,!0).map(Ue=>Ue.id)),Z.current=new Set;const ot=(de==null?void 0:de.selectable)??!0;for(const Ue of F.current){const wt=q.get(Ue);if(wt)for(const{edgeId:Sn}of wt.values()){const En=J.get(Sn);En&&(En.selectable??ot)&&Z.current.add(Sn)}}if(!PT(He,F.current)){const Ue=lh(I,F.current,!0);oe(Ue)}if(!PT(Qe,Z.current)){const Ue=lh(J,Z.current);ie(Ue)}A.setState({userSelectionRect:Be,userSelectionActive:!0,nodesSelectionActive:!1})},O=$=>{var Q,H;$.button===0&&((H=(Q=$.target)==null?void 0:Q.releasePointerCapture)==null||H.call(Q,$.pointerId),!T&&$.target===L.current&&A.getState().userSelectionRect&&(V==null||V($)),A.setState({userSelectionActive:!1,userSelectionRect:null}),K.current&&(c==null||c($),A.setState({nodesSelectionActive:F.current.size>0})))},Y=i===!0||Array.isArray(i)&&i.includes(0);return x.jsxs("div",{className:Ii(["react-flow__pane",{draggable:Y,dragging:N,selection:e}]),onClick:z?void 0:Fv(V,L),onContextMenu:Fv(P,L),onWheel:Fv(G,L),onPointerEnter:z?void 0:g,onPointerMove:z?W:b,onPointerUp:z?O:void 0,onPointerDownCapture:z?X:void 0,onClickCapture:z?ne:void 0,onPointerLeave:_,ref:L,style:Nx,children:[S,x.jsx(hW,{})]})}function Q1({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",Eo.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 DN({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:l}){const c=ei(),[f,p]=B.useState(!1),m=B.useRef();return B.useEffect(()=>{m.current=eK({getStoreItems:()=>c.getState(),onNodeMouseDown:g=>{Q1({id:g,store:c,nodeRef:e})},onDragStart:()=>{p(!0)},onDragStop:()=>{p(!1)}})},[]),B.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 gW=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function zN(){const e=ei();return B.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:l,onError:c,updateNodePositions:f,nodeLookup:p,nodeOrigin:m}=e.getState(),g=new Map,b=gW(l),_=r?s[0]:5,S=r?s[1]:5,A=n.direction.x*_*n.factor,T=n.direction.y*S*n.factor;for(const[,C]of p){if(!b(C))continue;let N={x:C.internals.positionAbsolute.x+A,y:C.internals.positionAbsolute.y+T};r&&(N=gg(N,s));const{position:R,positionAbsolute:z}=tN({nodeId:C.id,nextPosition:N,nodeLookup:p,nodeExtent:i,nodeOrigin:m,onError:c});C.position=R,C.internals.positionAbsolute=z,g.set(C.id,C)}f(g)},[])}const oS=B.createContext(null),yW=oS.Provider;oS.Consumer;const jN=()=>B.useContext(oS),xW=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),bW=(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===Sh.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 vW({type:e="source",position:t=$e.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:l,onConnect:c,children:f,className:p,onMouseDown:m,onTouchStart:g,...b},_){var W,O;const S=l||null,A=e==="target",T=ei(),C=jN(),{connectOnClick:N,noPanClassName:R,rfId:z}=$t(xW,Jn),{connectingFrom:L,connectingTo:D,clickConnecting:F,isPossibleEndHandle:Z,connectionInProcess:K,clickConnectionInProcess:V,valid:P}=$t(bW(C,S,e),Jn);C||(O=(W=T.getState()).onError)==null||O.call(W,"010",Eo.error010());const G=Y=>{const{defaultEdgeOptions:$,onConnect:Q,hasDefaultEdges:H}=T.getState(),I={...$,...Y};if(H){const{edges:J,setEdges:q}=T.getState();q(IX(I,J))}Q==null||Q(I),c==null||c(I)},ne=Y=>{if(!C)return;const $=cN(Y.nativeEvent);if(r&&($&&Y.button===0||!$)){const Q=T.getState();$1.onPointerDown(Y.nativeEvent,{handleDomNode:Y.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:(...H)=>{var I,J;return(J=(I=T.getState()).onConnectEnd)==null?void 0:J.call(I,...H)},updateConnection:Q.updateConnection,onConnect:G,isValidConnection:n||((...H)=>{var I,J;return((J=(I=T.getState()).isValidConnection)==null?void 0:J.call(I,...H))??!0}),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:Q.autoPanSpeed,dragThreshold:Q.connectionDragThreshold})}$?m==null||m(Y):g==null||g(Y)},X=Y=>{const{onClickConnectStart:$,onClickConnectEnd:Q,connectionClickStartHandle:H,connectionMode:I,isValidConnection:J,lib:q,rfId:oe,nodeLookup:ie,connection:de}=T.getState();if(!C||!H&&!r)return;if(!H){$==null||$(Y.nativeEvent,{nodeId:C,handleId:S,handleType:e}),T.setState({connectionClickStartHandle:{nodeId:C,type:e,id:S}});return}const me=lN(Y.target),ge=n||J,{connection:le,isValid:Re}=$1.isValid(Y.nativeEvent,{handle:{nodeId:C,id:S,type:e},connectionMode:I,fromNodeId:H.nodeId,fromHandleId:H.id||null,fromType:H.type,isValidConnection:ge,flowId:oe,doc:me,lib:q,nodeLookup:ie});Re&&le&&G(le);const Le=structuredClone(de);delete Le.inProgress,Le.toPosition=Le.toHandle?Le.toHandle.position:null,Q==null||Q(Y,Le),T.setState({connectionClickStartHandle:null})};return x.jsx("div",{"data-handleid":S,"data-nodeid":C,"data-handlepos":t,"data-id":`${z}-${C}-${S}-${e}`,className:Ii(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",R,p,{source:!A,target:A,connectable:i,connectablestart:r,connectableend:s,clickconnecting:F,connectingfrom:L,connectingto:D,valid:P,connectionindicator:i&&(!K||Z)&&(K||V?s:r)}]),onMouseDown:ne,onTouchStart:ne,onClick:N?X:void 0,ref:_,...b,children:f})}const Rl=B.memo(NN(vW));function _W({data:e,isConnectable:t,sourcePosition:n=$e.Bottom}){return x.jsxs(x.Fragment,{children:[e==null?void 0:e.label,x.jsx(Rl,{type:"source",position:n,isConnectable:t})]})}function SW({data:e,isConnectable:t,targetPosition:n=$e.Top,sourcePosition:i=$e.Bottom}){return x.jsxs(x.Fragment,{children:[x.jsx(Rl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,x.jsx(Rl,{type:"source",position:i,isConnectable:t})]})}function EW(){return null}function wW({data:e,isConnectable:t,targetPosition:n=$e.Top}){return x.jsxs(x.Fragment,{children:[x.jsx(Rl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ix={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},yC={input:_W,default:SW,output:wW,group:EW};function TW(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 CW=e=>{const{width:t,height:n,x:i,y:r}=mg(e.nodeLookup,{filter:s=>!!s.selected});return{width:Tl(t)?t:null,height:Tl(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 AW({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=ei(),{width:r,height:s,transformString:l,userSelectionActive:c}=$t(CW,Jn),f=zN(),p=B.useRef(null);B.useEffect(()=>{var _;n||(_=p.current)==null||_.focus({preventScroll:!0})},[n]);const m=!c&&r!==null&&s!==null;if(DN({nodeRef:p,disabled:!m}),!m)return null;const g=e?_=>{const S=i.getState().nodes.filter(A=>A.selected);e(_,S)}:void 0,b=_=>{Object.prototype.hasOwnProperty.call(ix,_.key)&&(_.preventDefault(),f({direction:ix[_.key],factor:_.shiftKey?4:1}))};return x.jsx("div",{className:Ii(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:x.jsx("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:b,style:{width:r,height:s}})})}const xC=typeof window<"u"?window:void 0,MW=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function LN({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:b,onSelectionEnd:_,multiSelectionKeyCode:S,panActivationKeyCode:A,zoomActivationKeyCode:T,elementsSelectable:C,zoomOnScroll:N,zoomOnPinch:R,panOnScroll:z,panOnScrollSpeed:L,panOnScrollMode:D,zoomOnDoubleClick:F,panOnDrag:Z,defaultViewport:K,translateExtent:V,minZoom:P,maxZoom:G,preventScrolling:ne,onSelectionContextMenu:X,noWheelClassName:W,noPanClassName:O,disableKeyboardA11y:Y,onViewportChange:$,isControlledViewport:Q}){const{nodesSelectionActive:H,userSelectionActive:I}=$t(MW,Jn),J=ng(p,{target:xC}),q=ng(A,{target:xC}),oe=q||Z,ie=q||z,de=m&&oe!==!0,me=J||I||de;return oW({deleteKeyCode:f,multiSelectionKeyCode:S}),x.jsx(dW,{onPaneContextMenu:s,elementsSelectable:C,zoomOnScroll:N,zoomOnPinch:R,panOnScroll:ie,panOnScrollSpeed:L,panOnScrollMode:D,zoomOnDoubleClick:F,panOnDrag:!J&&oe,defaultViewport:K,translateExtent:V,minZoom:P,maxZoom:G,zoomActivationKeyCode:T,preventScrolling:ne,noWheelClassName:W,noPanClassName:O,onViewportChange:$,isControlledViewport:Q,paneClickDistance:c,selectionOnDrag:de,children:x.jsxs(mW,{onSelectionStart:b,onSelectionEnd:_,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:l,panOnDrag:oe,isSelecting:!!me,selectionMode:g,selectionKeyPressed:J,paneClickDistance:c,selectionOnDrag:de,children:[e,H&&x.jsx(AW,{onSelectionContextMenu:X,noPanClassName:O,disableKeyboardA11y:Y})]})})}LN.displayName="FlowRenderer";const RW=B.memo(LN),kW=e=>t=>e?eS(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 NW(e){return $t(B.useCallback(kW(e),[e]),Jn)}const OW=e=>e.updateNodeInternals;function DW(){const e=$t(OW),[t]=B.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 B.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function zW({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=ei(),s=B.useRef(null),l=B.useRef(null),c=B.useRef(e.sourcePosition),f=B.useRef(e.targetPosition),p=B.useRef(t),m=n&&!!e.internals.handleBounds;return B.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]),B.useEffect(()=>()=>{l.current&&(i==null||i.unobserve(l.current),l.current=null)},[]),B.useEffect(()=>{if(s.current){const g=p.current!==t,b=c.current!==e.sourcePosition,_=f.current!==e.targetPosition;(g||b||_)&&(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 jW({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:b,noPanClassName:_,disableKeyboardA11y:S,rfId:A,nodeTypes:T,nodeClickDistance:C,onError:N}){const{node:R,internals:z,isParent:L}=$t(ge=>{const le=ge.nodeLookup.get(e),Re=ge.parentLookup.has(e);return{node:le,internals:le.internals,isParent:Re}},Jn);let D=R.type||"default",F=(T==null?void 0:T[D])||yC[D];F===void 0&&(N==null||N("003",Eo.error003(D)),D="default",F=(T==null?void 0:T.default)||yC.default);const Z=!!(R.draggable||c&&typeof R.draggable>"u"),K=!!(R.selectable||f&&typeof R.selectable>"u"),V=!!(R.connectable||p&&typeof R.connectable>"u"),P=!!(R.focusable||m&&typeof R.focusable>"u"),G=ei(),ne=aN(R),X=zW({node:R,nodeType:D,hasDimensions:ne,resizeObserver:g}),W=DN({nodeRef:X,disabled:R.hidden||!Z,noDragClassName:b,handleSelector:R.dragHandle,nodeId:e,isSelectable:K,nodeClickDistance:C}),O=zN();if(R.hidden)return null;const Y=xc(R),$=TW(R),Q=K||Z||t||n||i||r,H=n?ge=>n(ge,{...z.userNode}):void 0,I=i?ge=>i(ge,{...z.userNode}):void 0,J=r?ge=>r(ge,{...z.userNode}):void 0,q=s?ge=>s(ge,{...z.userNode}):void 0,oe=l?ge=>l(ge,{...z.userNode}):void 0,ie=ge=>{const{selectNodesOnDrag:le,nodeDragThreshold:Re}=G.getState();K&&(!le||!Z||Re>0)&&Q1({id:e,store:G,nodeRef:X}),t&&t(ge,{...z.userNode})},de=ge=>{if(!(oN(ge.nativeEvent)||S)){if($k.includes(ge.key)&&K){const le=ge.key==="Escape";Q1({id:e,store:G,unselect:le,nodeRef:X})}else if(Z&&R.selected&&Object.prototype.hasOwnProperty.call(ix,ge.key)){ge.preventDefault();const{ariaLabelConfig:le}=G.getState();G.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:ge.key.replace("Arrow","").toLowerCase(),x:~~z.positionAbsolute.x,y:~~z.positionAbsolute.y})}),O({direction:ix[ge.key],factor:ge.shiftKey?4:1})}}},me=()=>{var Qe;if(S||!((Qe=X.current)!=null&&Qe.matches(":focus-visible")))return;const{transform:ge,width:le,height:Re,autoPanOnNodeFocus:Le,setCenter:Be}=G.getState();if(!Le)return;eS(new Map([[e,R]]),{x:0,y:0,width:le,height:Re},ge,!0).length>0||Be(R.position.x+Y.width/2,R.position.y+Y.height/2,{zoom:ge[2]})};return x.jsx("div",{className:Ii(["react-flow__node",`react-flow__node-${D}`,{[_]:Z},R.className,{selected:R.selected,selectable:K,parent:L,draggable:Z,dragging:W}]),ref:X,style:{zIndex:z.z,transform:`translate(${z.positionAbsolute.x}px,${z.positionAbsolute.y}px)`,pointerEvents:Q?"all":"none",visibility:ne?"visible":"hidden",...R.style,...$},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:H,onMouseMove:I,onMouseLeave:J,onContextMenu:q,onClick:ie,onDoubleClick:oe,onKeyDown:P?de:void 0,tabIndex:P?0:void 0,onFocus:P?me:void 0,role:R.ariaRole??(P?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${AN}-${A}`,"aria-label":R.ariaLabel,...R.domAttributes,children:x.jsx(yW,{value:e,children:x.jsx(F,{id:e,data:R.data,type:D,positionAbsoluteX:z.positionAbsolute.x,positionAbsoluteY:z.positionAbsolute.y,selected:R.selected??!1,selectable:K,draggable:Z,deletable:R.deletable??!0,isConnectable:V,sourcePosition:R.sourcePosition,targetPosition:R.targetPosition,dragging:W,dragHandle:R.dragHandle,zIndex:z.z,parentId:R.parentId,...Y})})})}var LW=B.memo(jW);const BW=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function BN(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=$t(BW,Jn),l=NW(e.onlyRenderVisibleElements),c=DW();return x.jsx("div",{className:"react-flow__nodes",style:Nx,children:l.map(f=>x.jsx(LW,{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))})}BN.displayName="NodeRenderer";const IW=B.memo(BN);function UW(e){return $t(B.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&&jX({sourceNode:s,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),Jn)}const HW=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return x.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},PW=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return x.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},bC={[Jm.Arrow]:HW,[Jm.ArrowClosed]:PW};function FW(e){const t=ei();return B.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(bC,e)?bC[e]:((s=(r=t.getState()).onError)==null||s.call(r,"009",Eo.error009(e)),null)},[e])}const qW=({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=FW(t);return f?x.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:x.jsx(f,{color:n,strokeWidth:l})}):null},IN=({defaultColor:e,rfId:t})=>{const n=$t(s=>s.edges),i=$t(s=>s.defaultEdgeOptions),r=B.useMemo(()=>qX(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?x.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:x.jsx("defs",{children:r.map(s=>x.jsx(qW,{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};IN.displayName="MarkerDefinitions";var GW=B.memo(IN);function UN({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,b]=B.useState({x:1,y:0,width:0,height:0}),_=Ii(["react-flow__edge-textwrapper",p]),S=B.useRef(null);return B.useEffect(()=>{if(S.current){const A=S.current.getBBox();b({x:A.x,y:A.y,width:A.width,height:A.height})}},[n]),n?x.jsxs("g",{transform:`translate(${e-g.width/2} ${t-g.height/2})`,className:_,visibility:g.width?"visible":"hidden",...m,children:[r&&x.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}),x.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:S,style:i,children:n}),f]}):null}UN.displayName="EdgeText";const YW=B.memo(UN);function Ox({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:f,interactionWidth:p=20,...m}){return x.jsxs(x.Fragment,{children:[x.jsx("path",{...m,d:e,fill:"none",className:Ii(["react-flow__edge-path",m.className])}),p?x.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}):null,i&&Tl(t)&&Tl(n)?x.jsx(YW,{x:t,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:f}):null]})}function vC({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===$e.Left||e===$e.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function HN({sourceX:e,sourceY:t,sourcePosition:n=$e.Bottom,targetX:i,targetY:r,targetPosition:s=$e.Top}){const[l,c]=vC({pos:n,x1:e,y1:t,x2:i,y2:r}),[f,p]=vC({pos:s,x1:i,y1:r,x2:e,y2:t}),[m,g,b,_]=uN({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,b,_]}function PN(e){return B.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:l,targetPosition:c,label:f,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:b,labelBgBorderRadius:_,style:S,markerEnd:A,markerStart:T,interactionWidth:C})=>{const[N,R,z]=HN({sourceX:n,sourceY:i,sourcePosition:l,targetX:r,targetY:s,targetPosition:c}),L=e.isInternal?void 0:t;return x.jsx(Ox,{id:L,path:N,labelX:R,labelY:z,label:f,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:b,labelBgBorderRadius:_,style:S,markerEnd:A,markerStart:T,interactionWidth:C})})}const VW=PN({isInternal:!1}),FN=PN({isInternal:!0});VW.displayName="SimpleBezierEdge";FN.displayName="SimpleBezierEdgeInternal";function qN(e){return B.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:b,sourcePosition:_=$e.Bottom,targetPosition:S=$e.Top,markerEnd:A,markerStart:T,pathOptions:C,interactionWidth:N})=>{const[R,z,L]=X1({sourceX:n,sourceY:i,sourcePosition:_,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 x.jsx(Ox,{id:D,path:R,labelX:z,labelY:L,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:b,markerEnd:A,markerStart:T,interactionWidth:N})})}const GN=qN({isInternal:!1}),YN=qN({isInternal:!0});GN.displayName="SmoothStepEdge";YN.displayName="SmoothStepEdgeInternal";function VN(e){return B.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return x.jsx(GN,{...n,id:i,pathOptions:B.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const XW=VN({isInternal:!1}),XN=VN({isInternal:!0});XW.displayName="StepEdge";XN.displayName="StepEdgeInternal";function KN(e){return B.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:b,markerEnd:_,markerStart:S,interactionWidth:A})=>{const[T,C,N]=hN({sourceX:n,sourceY:i,targetX:r,targetY:s}),R=e.isInternal?void 0:t;return x.jsx(Ox,{id:R,path:T,labelX:C,labelY:N,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:b,markerEnd:_,markerStart:S,interactionWidth:A})})}const KW=KN({isInternal:!1}),WN=KN({isInternal:!0});KW.displayName="StraightEdge";WN.displayName="StraightEdgeInternal";function $N(e){return B.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:l=$e.Bottom,targetPosition:c=$e.Top,label:f,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:b,labelBgBorderRadius:_,style:S,markerEnd:A,markerStart:T,pathOptions:C,interactionWidth:N})=>{const[R,z,L]=dN({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 x.jsx(Ox,{id:D,path:R,labelX:z,labelY:L,label:f,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:b,labelBgBorderRadius:_,style:S,markerEnd:A,markerStart:T,interactionWidth:N})})}const WW=$N({isInternal:!1}),QN=$N({isInternal:!0});WW.displayName="BezierEdge";QN.displayName="BezierEdgeInternal";const _C={default:QN,straight:WN,step:XN,smoothstep:YN,simplebezier:FN},SC={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},$W=(e,t,n)=>n===$e.Left?e-t:n===$e.Right?e+t:e,QW=(e,t,n)=>n===$e.Top?e-t:n===$e.Bottom?e+t:e,EC="react-flow__edgeupdater";function wC({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:l,type:c}){return x.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:l,className:Ii([EC,`${EC}-${c}`]),cx:$W(t,i,e),cy:QW(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function ZW({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:b,setUpdateHover:_}){const S=ei(),A=(z,L)=>{if(z.button!==0)return;const{autoPanOnConnect:D,domNode:F,connectionMode:Z,connectionRadius:K,lib:V,onConnectStart:P,cancelConnection:G,nodeLookup:ne,rfId:X,panBy:W,updateConnection:O}=S.getState(),Y=L.type==="target",$=(I,J)=>{b(!1),g==null||g(I,n,L.type,J)},Q=I=>p==null?void 0:p(n,I),H=(I,J)=>{b(!0),m==null||m(z,n,L.type),P==null||P(I,J)};$1.onPointerDown(z.nativeEvent,{autoPanOnConnect:D,connectionMode:Z,connectionRadius:K,domNode:F,handleId:L.id,nodeId:L.nodeId,nodeLookup:ne,isTarget:Y,edgeUpdaterType:L.type,lib:V,flowId:X,cancelConnection:G,panBy:W,isValidConnection:(...I)=>{var J,q;return((q=(J=S.getState()).isValidConnection)==null?void 0:q.call(J,...I))??!0},onConnect:Q,onConnectStart:H,onConnectEnd:(...I)=>{var J,q;return(q=(J=S.getState()).onConnectEnd)==null?void 0:q.call(J,...I)},onReconnectEnd:$,updateConnection:O,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.getState().connectionDragThreshold,handleDomNode:z.currentTarget})},T=z=>A(z,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),C=z=>A(z,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),N=()=>_(!0),R=()=>_(!1);return x.jsxs(x.Fragment,{children:[(e===!0||e==="source")&&x.jsx(wC,{position:c,centerX:i,centerY:r,radius:t,onMouseDown:T,onMouseEnter:N,onMouseOut:R,type:"source"}),(e===!0||e==="target")&&x.jsx(wC,{position:f,centerX:s,centerY:l,radius:t,onMouseDown:C,onMouseEnter:N,onMouseOut:R,type:"target"})]})}function JW({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:b,onReconnectEnd:_,rfId:S,edgeTypes:A,noPanClassName:T,onError:C,disableKeyboardA11y:N}){let R=$t(Be=>Be.edgeLookup.get(e));const z=$t(Be=>Be.defaultEdgeOptions);R=z?{...z,...R}:R;let L=R.type||"default",D=(A==null?void 0:A[L])||_C[L];D===void 0&&(C==null||C("011",Eo.error011(L)),L="default",D=(A==null?void 0:A.default)||_C.default);const F=!!(R.focusable||t&&typeof R.focusable>"u"),Z=typeof g<"u"&&(R.reconnectable||n&&typeof R.reconnectable>"u"),K=!!(R.selectable||i&&typeof R.selectable>"u"),V=B.useRef(null),[P,G]=B.useState(!1),[ne,X]=B.useState(!1),W=ei(),{zIndex:O,sourceX:Y,sourceY:$,targetX:Q,targetY:H,sourcePosition:I,targetPosition:J}=$t(B.useCallback(Be=>{const He=Be.nodeLookup.get(R.source),Qe=Be.nodeLookup.get(R.target);if(!He||!Qe)return{zIndex:R.zIndex,...SC};const ot=FX({id:e,sourceNode:He,targetNode:Qe,sourceHandle:R.sourceHandle||null,targetHandle:R.targetHandle||null,connectionMode:Be.connectionMode,onError:C});return{zIndex:zX({selected:R.selected,zIndex:R.zIndex,sourceNode:He,targetNode:Qe,elevateOnSelect:Be.elevateEdgesOnSelect,zIndexMode:Be.zIndexMode}),...ot||SC}},[R.source,R.target,R.sourceHandle,R.targetHandle,R.selected,R.zIndex]),Jn),q=B.useMemo(()=>R.markerStart?`url('#${K1(R.markerStart,S)}')`:void 0,[R.markerStart,S]),oe=B.useMemo(()=>R.markerEnd?`url('#${K1(R.markerEnd,S)}')`:void 0,[R.markerEnd,S]);if(R.hidden||Y===null||$===null||Q===null||H===null)return null;const ie=Be=>{var Ue;const{addSelectedEdges:He,unselectNodesAndEdges:Qe,multiSelectionActive:ot}=W.getState();K&&(W.setState({nodesSelectionActive:!1}),R.selected&&ot?(Qe({nodes:[],edges:[R]}),(Ue=V.current)==null||Ue.blur()):He([e])),r&&r(Be,R)},de=s?Be=>{s(Be,{...R})}:void 0,me=l?Be=>{l(Be,{...R})}:void 0,ge=c?Be=>{c(Be,{...R})}:void 0,le=f?Be=>{f(Be,{...R})}:void 0,Re=p?Be=>{p(Be,{...R})}:void 0,Le=Be=>{var He;if(!N&&$k.includes(Be.key)&&K){const{unselectNodesAndEdges:Qe,addSelectedEdges:ot}=W.getState();Be.key==="Escape"?((He=V.current)==null||He.blur(),Qe({edges:[R]})):ot([e])}};return x.jsx("svg",{style:{zIndex:O},children:x.jsxs("g",{className:Ii(["react-flow__edge",`react-flow__edge-${L}`,R.className,T,{selected:R.selected,animated:R.animated,inactive:!K&&!r,updating:P,selectable:K}]),onClick:ie,onDoubleClick:de,onContextMenu:me,onMouseEnter:ge,onMouseMove:le,onMouseLeave:Re,onKeyDown:F?Le:void 0,tabIndex:F?0:void 0,role:R.ariaRole??(F?"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":F?`${MN}-${S}`:void 0,ref:V,...R.domAttributes,children:[!ne&&x.jsx(D,{id:e,source:R.source,target:R.target,type:R.type,selected:R.selected,animated:R.animated,selectable:K,deletable:R.deletable??!0,label:R.label,labelStyle:R.labelStyle,labelShowBg:R.labelShowBg,labelBgStyle:R.labelBgStyle,labelBgPadding:R.labelBgPadding,labelBgBorderRadius:R.labelBgBorderRadius,sourceX:Y,sourceY:$,targetX:Q,targetY:H,sourcePosition:I,targetPosition:J,data:R.data,style:R.style,sourceHandleId:R.sourceHandle,targetHandleId:R.targetHandle,markerStart:q,markerEnd:oe,pathOptions:"pathOptions"in R?R.pathOptions:void 0,interactionWidth:R.interactionWidth}),Z&&x.jsx(ZW,{edge:R,isReconnectable:Z,reconnectRadius:m,onReconnect:g,onReconnectStart:b,onReconnectEnd:_,sourceX:Y,sourceY:$,targetX:Q,targetY:H,sourcePosition:I,targetPosition:J,setUpdateHover:G,setReconnecting:X})]})})}var e$=B.memo(JW);const t$=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function ZN({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:b,onReconnectStart:_,onReconnectEnd:S,disableKeyboardA11y:A}){const{edgesFocusable:T,edgesReconnectable:C,elementsSelectable:N,onError:R}=$t(t$,Jn),z=UW(t);return x.jsxs("div",{className:"react-flow__edges",children:[x.jsx(GW,{defaultColor:e,rfId:n}),z.map(L=>x.jsx(e$,{id:L,edgesFocusable:T,edgesReconnectable:C,elementsSelectable:N,noPanClassName:r,onReconnect:s,onContextMenu:l,onMouseEnter:c,onMouseMove:f,onMouseLeave:p,onClick:m,reconnectRadius:g,onDoubleClick:b,onReconnectStart:_,onReconnectEnd:S,rfId:n,onError:R,edgeTypes:i,disableKeyboardA11y:A},L))]})}ZN.displayName="EdgeRenderer";const n$=B.memo(ZN),i$=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function r$({children:e}){const t=$t(i$);return x.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function a$(e){const t=kx(),n=B.useRef(!1);B.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const s$=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function l$(e){const t=$t(s$),n=ei();return B.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function o$(e){return e.connection.inProgress?{...e.connection,to:yg(e.connection.to,e.transform)}:{...e.connection}}function c$(e){return o$}function u$(e){const t=c$();return $t(t,Jn)}const d$=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function f$({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:s,height:l,isValid:c,inProgress:f}=$t(d$,Jn);return!(s&&r&&f)?null:x.jsx("svg",{style:e,width:s,height:l,className:"react-flow__connectionline react-flow__container",children:x.jsx("g",{className:Ii(["react-flow__connection",Jk(c)]),children:x.jsx(JN,{style:t,type:n,CustomComponent:i,isValid:c})})})}const JN=({style:e,type:t=hu.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:l,fromHandle:c,fromPosition:f,to:p,toNode:m,toHandle:g,toPosition:b,pointer:_}=u$();if(!r)return;if(n)return x.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:b,connectionStatus:Jk(i),toNode:m,toHandle:g,pointer:_});let S="";const A={sourceX:s.x,sourceY:s.y,sourcePosition:f,targetX:p.x,targetY:p.y,targetPosition:b};switch(t){case hu.Bezier:[S]=dN(A);break;case hu.SimpleBezier:[S]=HN(A);break;case hu.Step:[S]=X1({...A,borderRadius:0});break;case hu.SmoothStep:[S]=X1(A);break;default:[S]=hN(A)}return x.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:e})};JN.displayName="ConnectionLine";const h$={};function TC(e=h$){B.useRef(e),ei(),B.useEffect(()=>{},[e])}function p$(){ei(),B.useRef(!1),B.useEffect(()=>{},[])}function eO({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:b,onSelectionEnd:_,connectionLineType:S,connectionLineStyle:A,connectionLineComponent:T,connectionLineContainerStyle:C,selectionKeyCode:N,selectionOnDrag:R,selectionMode:z,multiSelectionKeyCode:L,panActivationKeyCode:D,zoomActivationKeyCode:F,deleteKeyCode:Z,onlyRenderVisibleElements:K,elementsSelectable:V,defaultViewport:P,translateExtent:G,minZoom:ne,maxZoom:X,preventScrolling:W,defaultMarkerColor:O,zoomOnScroll:Y,zoomOnPinch:$,panOnScroll:Q,panOnScrollSpeed:H,panOnScrollMode:I,zoomOnDoubleClick:J,panOnDrag:q,onPaneClick:oe,onPaneMouseEnter:ie,onPaneMouseMove:de,onPaneMouseLeave:me,onPaneScroll:ge,onPaneContextMenu:le,paneClickDistance:Re,nodeClickDistance:Le,onEdgeContextMenu:Be,onEdgeMouseEnter:He,onEdgeMouseMove:Qe,onEdgeMouseLeave:ot,reconnectRadius:Ue,onReconnect:wt,onReconnectStart:Sn,onReconnectEnd:En,noDragClassName:pn,noWheelClassName:ui,noPanClassName:Yr,disableKeyboardA11y:ki,nodeExtent:Qt,rfId:ur,viewport:Ee,onViewportChange:ke}){return TC(e),TC(t),p$(),a$(n),l$(Ee),x.jsx(RW,{onPaneClick:oe,onPaneMouseEnter:ie,onPaneMouseMove:de,onPaneMouseLeave:me,onPaneContextMenu:le,onPaneScroll:ge,paneClickDistance:Re,deleteKeyCode:Z,selectionKeyCode:N,selectionOnDrag:R,selectionMode:z,onSelectionStart:b,onSelectionEnd:_,multiSelectionKeyCode:L,panActivationKeyCode:D,zoomActivationKeyCode:F,elementsSelectable:V,zoomOnScroll:Y,zoomOnPinch:$,zoomOnDoubleClick:J,panOnScroll:Q,panOnScrollSpeed:H,panOnScrollMode:I,panOnDrag:q,defaultViewport:P,translateExtent:G,minZoom:ne,maxZoom:X,onSelectionContextMenu:g,preventScrolling:W,noDragClassName:pn,noWheelClassName:ui,noPanClassName:Yr,disableKeyboardA11y:ki,onViewportChange:ke,isControlledViewport:!!Ee,children:x.jsxs(r$,{children:[x.jsx(n$,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:l,onReconnect:wt,onReconnectStart:Sn,onReconnectEnd:En,onlyRenderVisibleElements:K,onEdgeContextMenu:Be,onEdgeMouseEnter:He,onEdgeMouseMove:Qe,onEdgeMouseLeave:ot,reconnectRadius:Ue,defaultMarkerColor:O,noPanClassName:Yr,disableKeyboardA11y:ki,rfId:ur}),x.jsx(f$,{style:A,type:S,component:T,containerStyle:C}),x.jsx("div",{className:"react-flow__edgelabel-renderer"}),x.jsx(IW,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:m,nodeClickDistance:Le,onlyRenderVisibleElements:K,noPanClassName:Yr,noDragClassName:pn,disableKeyboardA11y:ki,nodeExtent:Qt,rfId:ur}),x.jsx("div",{className:"react-flow__viewport-portal"})]})})}eO.displayName="GraphView";const m$=B.memo(eO),CC=({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:b="basic"}={})=>{const _=new Map,S=new Map,A=new Map,T=new Map,C=i??t??[],N=n??e??[],R=m??[0,0],z=g??Qm;gN(A,T,C);const L=W1(N,_,S,{nodeOrigin:R,nodeExtent:z,zIndexMode:b});let D=[0,0,1];if(l&&r&&s){const F=mg(_,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))}),{x:Z,y:K,zoom:V}=tS(F,r,s,f,p,(c==null?void 0:c.padding)??.1);D=[Z,K,V]}return{rfId:"1",width:r??0,height:s??0,transform:D,nodes:N,nodesInitialized:L,nodeLookup:_,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:Qm,nodeExtent:z,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Sh.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:{...Zk},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:MX,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Qk,zIndexMode:b,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},g$=({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:b})=>OK((_,S)=>{async function A(){const{nodeLookup:T,panZoom:C,fitViewOptions:N,fitViewResolver:R,width:z,height:L,minZoom:D,maxZoom:F}=S();C&&(await CX({nodes:T,width:z,height:L,panZoom:C,minZoom:D,maxZoom:F},N),R==null||R.resolve(!0),_({fitViewResolver:null}))}return{...CC({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:b}),setNodes:T=>{const{nodeLookup:C,parentLookup:N,nodeOrigin:R,elevateNodesOnSelect:z,fitViewQueued:L,zIndexMode:D}=S(),F=W1(T,C,N,{nodeOrigin:R,nodeExtent:g,elevateNodesOnSelect:z,checkEquality:!0,zIndexMode:D});L&&F?(A(),_({nodes:T,nodesInitialized:F,fitViewQueued:!1,fitViewOptions:void 0})):_({nodes:T,nodesInitialized:F})},setEdges:T=>{const{connectionLookup:C,edgeLookup:N}=S();gN(C,N,T),_({edges:T})},setDefaultNodesAndEdges:(T,C)=>{if(T){const{setNodes:N}=S();N(T),_({hasDefaultNodes:!0})}if(C){const{setEdges:N}=S();N(C),_({hasDefaultEdges:!0})}},updateNodeInternals:T=>{const{triggerNodeChanges:C,nodeLookup:N,parentLookup:R,domNode:z,nodeOrigin:L,nodeExtent:D,debug:F,fitViewQueued:Z,zIndexMode:K}=S(),{changes:V,updatedInternals:P}=$X(T,N,R,z,L,D,K);P&&(VX(N,R,{nodeOrigin:L,nodeExtent:D,zIndexMode:K}),Z?(A(),_({fitViewQueued:!1,fitViewOptions:void 0})):_({}),(V==null?void 0:V.length)>0&&(F&&console.log("React Flow: trigger node changes",V),C==null||C(V)))},updateNodePositions:(T,C=!1)=>{const N=[];let R=[];const{nodeLookup:z,triggerNodeChanges:L,connection:D,updateConnection:F,onNodesChangeMiddlewareMap:Z}=S();for(const[K,V]of T){const P=z.get(K),G=!!(P!=null&&P.expandParent&&(P!=null&&P.parentId)&&(V!=null&&V.position)),ne={id:K,type:"position",position:G?{x:Math.max(0,V.position.x),y:Math.max(0,V.position.y)}:V.position,dragging:C};if(P&&D.inProgress&&D.fromNode.id===P.id){const X=Dd(P,D.fromHandle,$e.Left,!0);F({...D,from:X})}G&&P.parentId&&N.push({id:K,parentId:P.parentId,rect:{...V.internals.positionAbsolute,width:V.measured.width??0,height:V.measured.height??0}}),R.push(ne)}if(N.length>0){const{parentLookup:K,nodeOrigin:V}=S(),P=lS(N,z,K,V);R.push(...P)}for(const K of Z.values())R=K(R);L(R)},triggerNodeChanges:T=>{const{onNodesChange:C,setNodes:N,nodes:R,hasDefaultNodes:z,debug:L}=S();if(T!=null&&T.length){if(z){const D=JK(T,R);N(D)}L&&console.log("React Flow: trigger node changes",T),C==null||C(T)}},triggerEdgeChanges:T=>{const{onEdgesChange:C,setEdges:N,edges:R,hasDefaultEdges:z,debug:L}=S();if(T!=null&&T.length){if(z){const D=eW(T,R);N(D)}L&&console.log("React Flow: trigger edge changes",T),C==null||C(T)}},addSelectedNodes:T=>{const{multiSelectionActive:C,edgeLookup:N,nodeLookup:R,triggerNodeChanges:z,triggerEdgeChanges:L}=S();if(C){const D=T.map(F=>_d(F,!0));z(D);return}z(lh(R,new Set([...T]),!0)),L(lh(N))},addSelectedEdges:T=>{const{multiSelectionActive:C,edgeLookup:N,nodeLookup:R,triggerNodeChanges:z,triggerEdgeChanges:L}=S();if(C){const D=T.map(F=>_d(F,!0));L(D);return}L(lh(N,new Set([...T]))),z(lh(R,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:C}={})=>{const{edges:N,nodes:R,nodeLookup:z,triggerNodeChanges:L,triggerEdgeChanges:D}=S(),F=T||R,Z=C||N,K=[];for(const P of F){if(!P.selected)continue;const G=z.get(P.id);G&&(G.selected=!1),K.push(_d(P.id,!1))}const V=[];for(const P of Z)P.selected&&V.push(_d(P.id,!1));L(K),D(V)},setMinZoom:T=>{const{panZoom:C,maxZoom:N}=S();C==null||C.setScaleExtent([T,N]),_({minZoom:T})},setMaxZoom:T=>{const{panZoom:C,minZoom:N}=S();C==null||C.setScaleExtent([N,T]),_({maxZoom:T})},setTranslateExtent:T=>{var C;(C=S().panZoom)==null||C.setTranslateExtent(T),_({translateExtent:T})},resetSelectedElements:()=>{const{edges:T,nodes:C,triggerNodeChanges:N,triggerEdgeChanges:R,elementsSelectable:z}=S();if(!z)return;const L=C.reduce((F,Z)=>Z.selected?[...F,_d(Z.id,!1)]:F,[]),D=T.reduce((F,Z)=>Z.selected?[...F,_d(Z.id,!1)]:F,[]);N(L),R(D)},setNodeExtent:T=>{const{nodes:C,nodeLookup:N,parentLookup:R,nodeOrigin:z,elevateNodesOnSelect:L,nodeExtent:D,zIndexMode:F}=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]||(W1(C,N,R,{nodeOrigin:z,nodeExtent:T,elevateNodesOnSelect:L,checkEquality:!1,zIndexMode:F}),_({nodeExtent:T}))},panBy:T=>{const{transform:C,width:N,height:R,panZoom:z,translateExtent:L}=S();return QX({delta:T,panZoom:z,transform:C,translateExtent:L,width:N,height:R})},setCenter:async(T,C,N)=>{const{width:R,height:z,maxZoom:L,panZoom:D}=S();if(!D)return Promise.resolve(!1);const F=typeof(N==null?void 0:N.zoom)<"u"?N.zoom:L;return await D.setViewport({x:R/2-T*F,y:z/2-C*F,zoom: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)},cancelConnection:()=>{_({connection:{...Zk}})},updateConnection:T=>{_({connection:T})},reset:()=>_({...CC()})}},Object.is);function tO({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:b,children:_}){const[S]=B.useState(()=>g$({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:b}));return x.jsx(DK,{value:S,children:x.jsx(rW,{children:_})})}function y$({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:b,zIndexMode:_}){return B.useContext(Mx)?x.jsx(x.Fragment,{children:e}):x.jsx(tO,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:l,fitView:c,initialFitViewOptions:f,initialMinZoom:p,initialMaxZoom:m,nodeOrigin:g,nodeExtent:b,zIndexMode:_,children:e})}const x$={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function b$({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:b,onConnect:_,onConnectStart:S,onConnectEnd:A,onClickConnectStart:T,onClickConnectEnd:C,onNodeMouseEnter:N,onNodeMouseMove:R,onNodeMouseLeave:z,onNodeContextMenu:L,onNodeDoubleClick:D,onNodeDragStart:F,onNodeDrag:Z,onNodeDragStop:K,onNodesDelete:V,onEdgesDelete:P,onDelete:G,onSelectionChange:ne,onSelectionDragStart:X,onSelectionDrag:W,onSelectionDragStop:O,onSelectionContextMenu:Y,onSelectionStart:$,onSelectionEnd:Q,onBeforeDelete:H,connectionMode:I,connectionLineType:J=hu.Bezier,connectionLineStyle:q,connectionLineComponent:oe,connectionLineContainerStyle:ie,deleteKeyCode:de="Backspace",selectionKeyCode:me="Shift",selectionOnDrag:ge=!1,selectionMode:le=Zm.Full,panActivationKeyCode:Re="Space",multiSelectionKeyCode:Le=tg()?"Meta":"Control",zoomActivationKeyCode:Be=tg()?"Meta":"Control",snapToGrid:He,snapGrid:Qe,onlyRenderVisibleElements:ot=!1,selectNodesOnDrag:Ue,nodesDraggable:wt,autoPanOnNodeFocus:Sn,nodesConnectable:En,nodesFocusable:pn,nodeOrigin:ui=RN,edgesFocusable:Yr,edgesReconnectable:ki,elementsSelectable:Qt=!0,defaultViewport:ur=VK,minZoom:Ee=.5,maxZoom:ke=2,translateExtent:ce=Qm,preventScrolling:Pe=!0,nodeExtent:ct,defaultMarkerColor:nn="#b1b1b7",zoomOnScroll:di=!0,zoomOnPinch:Zt=!0,panOnScroll:Jt=!1,panOnScrollSpeed:Gn=.5,panOnScrollMode:Ft=Cd.Free,zoomOnDoubleClick:Wi=!0,panOnDrag:ti=!0,onPaneClick:Ao,onPaneMouseEnter:hs,onPaneMouseMove:Ha,onPaneMouseLeave:ps,onPaneScroll:Ei,onPaneContextMenu:se,paneClickDistance:Te=1,nodeClickDistance:Ie=0,children:tt,onReconnect:rn,onReconnectStart:an,onReconnectEnd:Ye,onEdgeContextMenu:qe,onEdgeDoubleClick:nt,onEdgeMouseEnter:kn,onEdgeMouseMove:qt,onEdgeMouseLeave:_a,reconnectRadius:dr=10,onNodesChange:$i,onEdgesChange:fr,noDragClassName:bt="nodrag",noWheelClassName:fi="nowheel",noPanClassName:Vr="nopan",fitView:Ys,fitViewOptions:Dl,connectOnClick:zl,attributionPosition:jl,proOptions:Pa,defaultEdgeOptions:Vs,elevateNodesOnSelect:sn=!0,elevateEdgesOnSelect:ln=!1,disableKeyboardA11y:hr=!1,autoPanOnConnect:Xr,autoPanOnNodeDrag:In,autoPanSpeed:Cr,connectionRadius:Sa,isValidConnection:Kr,onError:Ne,style:Ke,id:vt,nodeDragThreshold:Kt,connectionDragThreshold:Un,viewport:wi,onViewportChange:Qi,width:Ni,height:mn,colorMode:pr="light",debug:Mo,onScroll:Ea,ariaLabelConfig:Ll,zIndexMode:Fa="basic",...bc},Ui){const ms=vt||"1",gs=$K(pr),Xs=B.useCallback(hi=>{hi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ea==null||Ea(hi)},[Ea]);return x.jsx("div",{"data-testid":"rf__wrapper",...bc,onScroll:Xs,style:{...Ke,...x$},ref:Ui,className:Ii(["react-flow",r,gs]),id:vt,role:"application",children:x.jsxs(y$,{nodes:e,edges:t,width:Ni,height:mn,fitView:Ys,fitViewOptions:Dl,minZoom:Ee,maxZoom:ke,nodeOrigin:ui,nodeExtent:ct,zIndexMode:Fa,children:[x.jsx(m$,{onInit:p,onNodeClick:c,onEdgeClick:f,onNodeMouseEnter:N,onNodeMouseMove:R,onNodeMouseLeave:z,onNodeContextMenu:L,onNodeDoubleClick:D,nodeTypes:s,edgeTypes:l,connectionLineType:J,connectionLineStyle:q,connectionLineComponent:oe,connectionLineContainerStyle:ie,selectionKeyCode:me,selectionOnDrag:ge,selectionMode:le,deleteKeyCode:de,multiSelectionKeyCode:Le,panActivationKeyCode:Re,zoomActivationKeyCode:Be,onlyRenderVisibleElements:ot,defaultViewport:ur,translateExtent:ce,minZoom:Ee,maxZoom:ke,preventScrolling:Pe,zoomOnScroll:di,zoomOnPinch:Zt,zoomOnDoubleClick:Wi,panOnScroll:Jt,panOnScrollSpeed:Gn,panOnScrollMode:Ft,panOnDrag:ti,onPaneClick:Ao,onPaneMouseEnter:hs,onPaneMouseMove:Ha,onPaneMouseLeave:ps,onPaneScroll:Ei,onPaneContextMenu:se,paneClickDistance:Te,nodeClickDistance:Ie,onSelectionContextMenu:Y,onSelectionStart:$,onSelectionEnd:Q,onReconnect:rn,onReconnectStart:an,onReconnectEnd:Ye,onEdgeContextMenu:qe,onEdgeDoubleClick:nt,onEdgeMouseEnter:kn,onEdgeMouseMove:qt,onEdgeMouseLeave:_a,reconnectRadius:dr,defaultMarkerColor:nn,noDragClassName:bt,noWheelClassName:fi,noPanClassName:Vr,rfId:ms,disableKeyboardA11y:hr,nodeExtent:ct,viewport:wi,onViewportChange:Qi}),x.jsx(WK,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:_,onConnectStart:S,onConnectEnd:A,onClickConnectStart:T,onClickConnectEnd:C,nodesDraggable:wt,autoPanOnNodeFocus:Sn,nodesConnectable:En,nodesFocusable:pn,edgesFocusable:Yr,edgesReconnectable:ki,elementsSelectable:Qt,elevateNodesOnSelect:sn,elevateEdgesOnSelect:ln,minZoom:Ee,maxZoom:ke,nodeExtent:ct,onNodesChange:$i,onEdgesChange:fr,snapToGrid:He,snapGrid:Qe,connectionMode:I,translateExtent:ce,connectOnClick:zl,defaultEdgeOptions:Vs,fitView:Ys,fitViewOptions:Dl,onNodesDelete:V,onEdgesDelete:P,onDelete:G,onNodeDragStart:F,onNodeDrag:Z,onNodeDragStop:K,onSelectionDrag:W,onSelectionDragStart:X,onSelectionDragStop:O,onMove:m,onMoveStart:g,onMoveEnd:b,noPanClassName:Vr,nodeOrigin:ui,rfId:ms,autoPanOnConnect:Xr,autoPanOnNodeDrag:In,autoPanSpeed:Cr,onError:Ne,connectionRadius:Sa,isValidConnection:Kr,selectNodesOnDrag:Ue,nodeDragThreshold:Kt,connectionDragThreshold:Un,onBeforeDelete:H,debug:Mo,ariaLabelConfig:Ll,zIndexMode:Fa}),x.jsx(YK,{onSelectionChange:ne}),tt,x.jsx(HK,{proOptions:Pa,position:jl}),x.jsx(UK,{rfId:ms,disableKeyboardA11y:hr})]})})}var v$=NN(b$);function _$({dimensions:e,lineWidth:t,variant:n,className:i}){return x.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ii(["react-flow__background-pattern",n,i])})}function S$({radius:e,className:t}){return x.jsx("circle",{cx:e,cy:e,r:e,className:Ii(["react-flow__background-pattern","dots",t])})}var gu;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(gu||(gu={}));const E$={[gu.Dots]:1,[gu.Lines]:1,[gu.Cross]:6},w$=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function nO({id:e,variant:t=gu.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:l,bgColor:c,style:f,className:p,patternClassName:m}){const g=B.useRef(null),{transform:b,patternId:_}=$t(w$,Jn),S=i||E$[t],A=t===gu.Dots,T=t===gu.Cross,C=Array.isArray(n)?n:[n,n],N=[C[0]*b[2]||1,C[1]*b[2]||1],R=S*b[2],z=Array.isArray(s)?s:[s,s],L=T?[R,R]:N,D=[z[0]*b[2]||1+L[0]/2,z[1]*b[2]||1+L[1]/2],F=`${_}${e||""}`;return x.jsxs("svg",{className:Ii(["react-flow__background",p]),style:{...f,...Nx,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:g,"data-testid":"rf__background",children:[x.jsx("pattern",{id:F,x:b[0]%N[0],y:b[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${D[0]},-${D[1]})`,children:A?x.jsx(S$,{radius:R/2,className:m}):x.jsx(_$,{dimensions:L,lineWidth:r,variant:t,className:m})}),x.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${F})`})]})}nO.displayName="Background";const T$=B.memo(nO);function C$(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:x.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function A$(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:x.jsx("path",{d:"M0 0h32v4.2H0z"})})}function M$(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:x.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function R$(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function k$(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function v0({children:e,className:t,...n}){return x.jsx("button",{type:"button",className:Ii(["react-flow__controls-button",t]),...n,children:e})}const N$=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function iO({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:b="vertical","aria-label":_}){const S=ei(),{isInteractive:A,minZoomReached:T,maxZoomReached:C,ariaLabelConfig:N}=$t(N$,Jn),{zoomIn:R,zoomOut:z,fitView:L}=kx(),D=()=>{R(),s==null||s()},F=()=>{z(),l==null||l()},Z=()=>{L(r),c==null||c()},K=()=>{S.setState({nodesDraggable:!A,nodesConnectable:!A,elementsSelectable:!A}),f==null||f(!A)},V=b==="horizontal"?"horizontal":"vertical";return x.jsxs(Rx,{className:Ii(["react-flow__controls",V,p]),position:g,style:e,"data-testid":"rf__controls","aria-label":_??N["controls.ariaLabel"],children:[t&&x.jsxs(x.Fragment,{children:[x.jsx(v0,{onClick:D,className:"react-flow__controls-zoomin",title:N["controls.zoomIn.ariaLabel"],"aria-label":N["controls.zoomIn.ariaLabel"],disabled:C,children:x.jsx(C$,{})}),x.jsx(v0,{onClick:F,className:"react-flow__controls-zoomout",title:N["controls.zoomOut.ariaLabel"],"aria-label":N["controls.zoomOut.ariaLabel"],disabled:T,children:x.jsx(A$,{})})]}),n&&x.jsx(v0,{className:"react-flow__controls-fitview",onClick:Z,title:N["controls.fitView.ariaLabel"],"aria-label":N["controls.fitView.ariaLabel"],children:x.jsx(M$,{})}),i&&x.jsx(v0,{className:"react-flow__controls-interactive",onClick:K,title:N["controls.interactive.ariaLabel"],"aria-label":N["controls.interactive.ariaLabel"],children:A?x.jsx(k$,{}):x.jsx(R$,{})}),m]})}iO.displayName="Controls";const O$=B.memo(iO);function D$({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:b,onClick:_}){const{background:S,backgroundColor:A}=s||{},T=l||S||A;return x.jsx("rect",{className:Ii(["react-flow__minimap-node",{selected:b},p]),x:t,y:n,rx:m,ry:m,width:i,height:r,style:{fill:T,stroke:c,strokeWidth:f},shapeRendering:g,onClick:_?C=>_(C,e):void 0})}const z$=B.memo(D$),j$=e=>e.nodes.map(t=>t.id),qv=e=>e instanceof Function?e:()=>e;function L$({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=z$,onClick:l}){const c=$t(j$,Jn),f=qv(t),p=qv(e),m=qv(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return x.jsx(x.Fragment,{children:c.map(b=>x.jsx(I$,{id:b,nodeColorFunc:f,nodeStrokeColorFunc:p,nodeClassNameFunc:m,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:l,shapeRendering:g},b))})}function B$({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:b,height:_}=$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:z}=xc(T);return{node:T,x:C,y:N,width:R,height:z}},Jn);return!p||p.hidden||!aN(p)?null:x.jsx(c,{x:m,y:g,width:b,height:_,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 I$=B.memo(B$);var U$=B.memo(L$);const H$=200,P$=150,F$=e=>!e.hidden,q$=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?rN(mg(e.nodeLookup,{filter:F$}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},G$="react-flow__minimap-desc";function rO({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:b="bottom-right",onClick:_,onNodeClick:S,pannable:A=!1,zoomable:T=!1,ariaLabel:C,inversePan:N,zoomStep:R=1,offsetScale:z=5}){const L=ei(),D=B.useRef(null),{boundingRect:F,viewBB:Z,rfId:K,panZoom:V,translateExtent:P,flowWidth:G,flowHeight:ne,ariaLabelConfig:X}=$t(q$,Jn),W=(e==null?void 0:e.width)??H$,O=(e==null?void 0:e.height)??P$,Y=F.width/W,$=F.height/O,Q=Math.max(Y,$),H=Q*W,I=Q*O,J=z*Q,q=F.x-(H-F.width)/2-J,oe=F.y-(I-F.height)/2-J,ie=H+J*2,de=I+J*2,me=`${G$}-${K}`,ge=B.useRef(0),le=B.useRef();ge.current=Q,B.useEffect(()=>{if(D.current&&V)return le.current=sK({domNode:D.current,panZoom:V,getTransform:()=>L.getState().transform,getViewScale:()=>ge.current}),()=>{var He;(He=le.current)==null||He.destroy()}},[V]),B.useEffect(()=>{var He;(He=le.current)==null||He.update({translateExtent:P,width:G,height:ne,inversePan:N,pannable:A,zoomStep:R,zoomable:T})},[A,T,N,R,P,G,ne]);const Re=_?He=>{var Ue;const[Qe,ot]=((Ue=le.current)==null?void 0:Ue.pointer(He))||[0,0];_(He,{x:Qe,y:ot})}:void 0,Le=S?B.useCallback((He,Qe)=>{const ot=L.getState().nodeLookup.get(Qe).internals.userNode;S(He,ot)},[]):void 0,Be=C??X["minimap.ariaLabel"];return x.jsx(Rx,{position:b,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:Ii(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:x.jsxs("svg",{width:W,height:O,viewBox:`${q} ${oe} ${ie} ${de}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":me,ref:D,onClick:Re,children:[Be&&x.jsx("title",{id:me,children:Be}),x.jsx(U$,{onClick:Le,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:l,nodeComponent:c}),x.jsx("path",{className:"react-flow__minimap-mask",d:`M${q-J},${oe-J}h${ie+J*2}v${de+J*2}h${-ie-J*2}z
400
+ M${Z.x},${Z.y}h${Z.width}v${Z.height}h${-Z.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}rO.displayName="MiniMap";const Y$=B.memo(rO),V$=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,X$={[Ch.Line]:"right",[Ch.Handle]:"bottom-right"};function K$({nodeId:e,position:t,variant:n=Ch.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:b,autoScale:_=!0,shouldResize:S,onResizeStart:A,onResize:T,onResizeEnd:C}){const N=jN(),R=typeof e=="string"?e:N,z=ei(),L=B.useRef(null),D=n===Ch.Handle,F=$t(B.useCallback(V$(D&&_),[D,_]),Jn),Z=B.useRef(null),K=t??X$[n];B.useEffect(()=>{if(!(!L.current||!R))return Z.current||(Z.current=vK({domNode:L.current,nodeId:R,getStoreItems:()=>{const{nodeLookup:P,transform:G,snapGrid:ne,snapToGrid:X,nodeOrigin:W,domNode:O}=z.getState();return{nodeLookup:P,transform:G,snapGrid:ne,snapToGrid:X,nodeOrigin:W,paneDomNode:O}},onChange:(P,G)=>{const{triggerNodeChanges:ne,nodeLookup:X,parentLookup:W,nodeOrigin:O}=z.getState(),Y=[],$={x:P.x,y:P.y},Q=X.get(R);if(Q&&Q.expandParent&&Q.parentId){const H=Q.origin??O,I=P.width??Q.measured.width??0,J=P.height??Q.measured.height??0,q={id:Q.id,parentId:Q.parentId,rect:{width:I,height:J,...sN({x:P.x??Q.position.x,y:P.y??Q.position.y},{width:I,height:J},Q.parentId,X,H)}},oe=lS([q],X,W,O);Y.push(...oe),$.x=P.x?Math.max(H[0]*I,P.x):void 0,$.y=P.y?Math.max(H[1]*J,P.y):void 0}if($.x!==void 0&&$.y!==void 0){const H={id:R,type:"position",position:{...$}};Y.push(H)}if(P.width!==void 0&&P.height!==void 0){const I={id:R,type:"dimensions",resizing:!0,setAttributes:b?b==="horizontal"?"width":"height":!0,dimensions:{width:P.width,height:P.height}};Y.push(I)}for(const H of G){const I={...H,type:"position"};Y.push(I)}ne(Y)},onEnd:({width:P,height:G})=>{const ne={id:R,type:"dimensions",resizing:!1,dimensions:{width:P,height:G}};z.getState().triggerNodeChanges([ne])}})),Z.current.update({controlPosition:K,boundaries:{minWidth:c,minHeight:f,maxWidth:p,maxHeight:m},keepAspectRatio:g,resizeDirection:b,onResizeStart:A,onResize:T,onResizeEnd:C,shouldResize:S}),()=>{var P;(P=Z.current)==null||P.destroy()}},[K,c,f,p,m,g,A,T,C,S]);const V=K.split("-");return x.jsx("div",{className:Ii(["react-flow__resize-control","nodrag",...V,n,i]),ref:L,style:{...r,scale:F,...l&&{[D?"backgroundColor":"borderColor"]:l}},children:s})}B.memo(K$);const Z1={background:"rgba(0, 200, 255, 0.4)",width:6,height:6,border:"none"},AC={background:"rgba(0, 230, 138, 0.4)",width:6,height:6,border:"none"},MC={background:"rgba(255, 171, 64, 0.4)",width:6,height:6,border:"none"};function W$({data:e}){return x.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:[x.jsx(Rl,{type:"source",position:$e.Bottom,style:Z1}),x.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()}),x.jsx("div",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1rem",color:"var(--text-primary)"},children:e.label}),x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",marginTop:3},children:"CEO"})]})}function $$({data:e}){const t=e.agents;return x.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:[x.jsx(Rl,{type:"target",position:$e.Top,style:AC}),x.jsx(Rl,{type:"source",position:$e.Bottom,style:AC}),x.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,marginBottom:4},children:[x.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()}),x.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:600,fontSize:"0.82rem",color:"var(--status-active)"},children:e.label})]}),e.description?x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--text-muted)",marginBottom:4,maxWidth:180},children:String(e.description)}):null,x.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--text-muted)"},children:[t.length," agent",t.length!==1?"s":""]})]})}function Q$({data:e}){return x.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:[x.jsx(Rl,{type:"target",position:$e.Top,style:Z1}),x.jsx(Rl,{type:"source",position:$e.Bottom,style:Z1}),x.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:6},children:[x.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:"var(--status-active)",boxShadow:"0 0 6px var(--status-active-glow)",flexShrink:0}}),x.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:500,fontSize:"0.72rem",color:"var(--text-secondary)"},children:e.label})]}),e.stepLabel?x.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 Z$({data:e}){return x.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:[x.jsx(Rl,{type:"target",position:$e.Top,style:MC}),x.jsx(Rl,{type:"source",position:$e.Bottom,style:MC}),x.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:5},children:[x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--status-warning)"},children:"⏸"}),x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontWeight:500,fontSize:"0.6rem",color:"var(--status-warning)"},children:e.label})]})]})}const J$={company:W$,squad:$$,agent:Q$,checkpoint:Z$},RC=300,Gv=60;function eQ(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*RC/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*RC,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 b=c.pipeline||[];if(b.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*Gv},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 _=p;b.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*Gv},data:{label:S.label},draggable:!0}):i.push({id:N,type:"agent",position:{x:m+25,y:340+A*Gv},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}-${_}-${N}`,source:_,target:N,style:R,markerEnd:T?void 0:{type:Jm.ArrowClosed,color:"rgba(0, 200, 255, 0.35)",width:12,height:12},animated:!T}),_=N})}),{nodes:i,edges:r}}function tQ({data:e}){const{fitView:t}=kx(),{nodes:n,edges:i}=B.useMemo(()=>eQ(e),[e]);B.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 x.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",animation:"fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both"},children:[x.jsxs("div",{style:{padding:"16px 20px 12px",flexShrink:0},children:[x.jsxs("h2",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.1rem",color:"var(--text-primary)",marginBottom:2},children:[e.tree.name," — Org Chart"]}),x.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"]})]}),x.jsx("div",{style:{flex:1,minHeight:0},children:x.jsxs(v$,{nodes:n,edges:i,nodeTypes:J$,fitView:!0,fitViewOptions:{padding:.12},minZoom:.1,maxZoom:2,proOptions:{hideAttribution:!0},style:{background:"var(--surface-0)"},nodesDraggable:!0,nodesConnectable:!1,children:[x.jsx(T$,{color:"rgba(100, 120, 200, 0.04)",gap:24,size:1}),x.jsx(O$,{showInteractive:!1,style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:8}}),x.jsx(Y$,{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 nQ(){const[e,t]=B.useState(null),[n,i]=B.useState(!0),[r,s]=B.useState(null);return B.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?x.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?x.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"}):x.jsx(tO,{children:x.jsx(tQ,{data:e})})}const aO={squad:"#00c8ff",agent:"#00e68a",memory:"#b388ff",skill:"#ffab40"},J1={squad:18,agent:12,memory:8,skill:8},kC={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 iQ(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 b=0;b<e.length;b++){let _=0,S=0;for(let A=0;A<e.length;A++){if(b===A)continue;const T=e[b].x-e[A].x,C=e[b].y-e[A].y,N=T*T+C*C+1,R=c/N,z=Math.sqrt(N);_+=T/z*R,S+=C/z*R}_+=(s-e[b].x)*p,S+=(l-e[b].y)*p,e[b].vx=(e[b].vx+_)*m,e[b].vy=(e[b].vy+S)*m}for(const b of t){const _=e.findIndex(L=>L.id===b.source),S=e.findIndex(L=>L.id===b.target);if(_===-1||S===-1)continue;const A=e[S].x-e[_].x,T=e[S].y-e[_].y,C=Math.sqrt(A*A+T*T)+1,N=(C-100)*f,R=A/C*N,z=T/C*N;e[_].vx+=R,e[_].vy+=z,e[S].vx-=R,e[S].vy-=z}let g=0;for(const b of e)b.x+=b.vx,b.y+=b.vy,g+=b.vx*b.vx+b.vy*b.vy;return g}function rQ(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 aQ(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(_=>[_.id,_]));let g=null;if(s){g=rQ(s.id,n);for(const _ of g.values());}const b=_=>{if(!s||!g||_===s.id)return 1;const S=g.get(_);return S===void 0?.06:Math.max(.08,1-S*.28)};for(const _ of n){const S=m.get(_.source),A=m.get(_.target);if(!S||!A)continue;const T=Math.min(b(_.source),b(_.target)),C=s&&(_.source===s.id||_.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)":kC[_.type]||"rgba(255,255,255,0.06)",e.lineWidth=C?1.8:_.type==="delivers"||_.type==="pipeline"?1.2:.5,e.stroke(),_.type==="delivers"||_.type==="pipeline"){const N=Math.atan2(A.y-S.y,A.x-S.x),R=J1[A.type]||10,z=A.x-Math.cos(N)*(R+4),L=A.y-Math.sin(N)*(R+4);e.beginPath(),e.moveTo(z,L),e.lineTo(z-Math.cos(N-.4)*6,L-Math.sin(N-.4)*6),e.lineTo(z-Math.cos(N+.4)*6,L-Math.sin(N+.4)*6),e.closePath(),e.fillStyle=kC[_.type],e.fill()}}e.globalAlpha=1;for(const _ of t){const S=J1[_.type]||10,A=aO[_.type]||"#888",T=(s==null?void 0:s.id)===_.id,C=b(_.id);e.globalAlpha=C,e.beginPath(),e.arc(_.x,_.y,S,0,Math.PI*2),T&&(e.shadowColor=A,e.shadowBlur=24),e.fillStyle=A,e.fill(),e.shadowBlur=0;const N=_.type==="squad"?11:9;e.font=`${_.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(_.label,_.x,_.y+S+4)}e.globalAlpha=1,e.restore()}function sQ(){const e=B.useRef(null),[t,n]=B.useState([]),[i,r]=B.useState([]),[s,l]=B.useState(!0),[c,f]=B.useState(null),p=B.useRef(null),m=B.useRef(null),g=B.useRef(null),b=B.useRef(!1),_=B.useRef({x:0,y:0}),S=B.useRef(1),A=B.useRef(!1),T=B.useRef({x:0,y:0}),C=B.useRef([]),N=B.useRef([]),R=B.useRef(0),z=B.useRef(1),L=B.useRef(!0),D=B.useRef(null);B.useEffect(()=>{fetch("/api/graph",{credentials:"include"}).then(K=>K.json()).then(K=>{const V=window.innerWidth,P=window.innerHeight,G=K.nodes.map((ne,X)=>({...ne,x:V/2+(Math.random()-.5)*400,y:P/2+(Math.random()-.5)*400,vx:0,vy:0}));C.current=G,N.current=K.edges,n(G),r(K.edges),l(!1)}).catch(()=>{f("Failed to load graph data"),l(!1)})},[]);const F=B.useCallback((K,V)=>{const P=_.current,G=S.current,ne=(K-P.x)/G,X=(V-P.y)/G;for(let W=C.current.length-1;W>=0;W--){const O=C.current[W],Y=J1[O.type]||10,$=ne-O.x,Q=X-O.y;if($*$+Q*Q<(Y+4)*(Y+4))return O}return null},[]);B.useEffect(()=>{const K=e.current;if(!K)return;const V=W=>{const O=K.getBoundingClientRect(),Y=W.clientX-O.left,$=W.clientY-O.top;if(g.current){b.current=!0;const J=S.current,q=_.current;g.current.x=(Y-q.x)/J,g.current.y=($-q.y)/J,g.current.vx=0,g.current.vy=0,z.current=.3,L.current=!0;return}if(A.current){_.current.x+=Y-T.current.x,_.current.y+=$-T.current.y,T.current={x:Y,y:$};return}const Q=S.current,H=_.current;D.current={x:(Y-H.x)/Q,y:($-H.y)/Q};const I=F(Y,$);p.current=I,K.style.cursor=I?"grab":"default"},P=W=>{const O=K.getBoundingClientRect(),Y=W.clientX-O.left,$=W.clientY-O.top;b.current=!1;const Q=F(Y,$);Q?(g.current=Q,K.style.cursor="grabbing"):(A.current=!0,T.current={x:Y,y:$},K.style.cursor="move")},G=W=>{var Y;g.current;const O=A.current;if(g.current=null,A.current=!1,K.style.cursor="default",!b.current){const $=K.getBoundingClientRect(),Q=W.clientX-$.left,H=W.clientY-$.top,I=F(Q,H);I?m.current=((Y=m.current)==null?void 0:Y.id)===I.id?null:I:O||(m.current=null)}},ne=W=>{W.preventDefault();const O=K.getBoundingClientRect(),Y=W.clientX-O.left,$=W.clientY-O.top,Q=W.deltaY>0?.92:1.08,H=Math.max(.2,Math.min(5,S.current*Q)),I=H/S.current;_.current.x=Y-(Y-_.current.x)*I,_.current.y=$-($-_.current.y)*I,S.current=H},X=()=>{g.current=null,A.current=!1,D.current=null,K.style.cursor="default"};return K.addEventListener("mousemove",V),K.addEventListener("mousedown",P),K.addEventListener("mouseup",G),K.addEventListener("mouseleave",X),K.addEventListener("wheel",ne,{passive:!1}),()=>{K.removeEventListener("mousemove",V),K.removeEventListener("mousedown",P),K.removeEventListener("mouseup",G),K.removeEventListener("mouseleave",X),K.removeEventListener("wheel",ne)}},[F,s]),B.useEffect(()=>{if(s||C.current.length===0)return;const K=e.current;if(!K)return;const V=()=>{const X=K.parentElement;X&&(K.width=X.clientWidth*window.devicePixelRatio,K.height=X.clientHeight*window.devicePixelRatio,K.style.width=X.clientWidth+"px",K.style.height=X.clientHeight+"px")};V(),window.addEventListener("resize",V);const P=K.getContext("2d");let G=!0;const ne=()=>{if(!G)return;const X=K.width/window.devicePixelRatio,W=K.height/window.devicePixelRatio;P.setTransform(window.devicePixelRatio,0,0,window.devicePixelRatio,0,0),L.current&&(iQ(C.current,N.current,X,W,z.current),z.current*=.98,z.current<.001&&(L.current=!1,z.current=0));const O=D.current;if(O&&!g.current&&!A.current)for(const Q of C.current){const H=Q.x-O.x,I=Q.y-O.y,J=H*H+I*I;if(J<14400&&J>1){const q=Math.sqrt(J),oe=.8*(1-q/120);Q.x+=H/q*oe,Q.y+=I/q*oe}}aQ(P,C.current,N.current,X,W,m.current,_.current.x,_.current.y,S.current),R.current=requestAnimationFrame(ne)};return R.current=requestAnimationFrame(ne),()=>{G=!1,cancelAnimationFrame(R.current),window.removeEventListener("resize",V)}},[s]);const Z=B.useCallback(K=>{const V=e.current;if(!V)return;const P=K==="in"?1.25:.8,G=V.clientWidth/2,ne=V.clientHeight/2,X=Math.max(.2,Math.min(5,S.current*P)),W=X/S.current;_.current.x=G-(G-_.current.x)*W,_.current.y=ne-(ne-_.current.y)*W,S.current=X},[]);return s?x.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?x.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.8rem"},children:c}):x.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",background:"var(--surface-0)"},children:[x.jsx("canvas",{ref:e,style:{display:"block",touchAction:"none"}}),x.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(aO).map(([K,V])=>x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[x.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:V,display:"inline-block"}}),x.jsx("span",{style:{textTransform:"capitalize"},children:K})]},K))}),x.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:[x.jsxs("span",{children:[t.length," nodes"]}),x.jsxs("span",{children:[i.length," edges"]})]}),x.jsx("div",{style:{position:"absolute",bottom:16,right:16,display:"flex",flexDirection:"column",gap:4},children:[{label:"+",action:"in"},{label:"−",action:"out"}].map(({label:K,action:V})=>x.jsx("button",{onClick:()=>Z(V),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:K},V))})]})}function lQ(){const[e,t]=B.useState([]),[n,i]=B.useState(null),[r,s]=B.useState(""),[l,c]=B.useState(""),[f,p]=B.useState(!1),[m,g]=B.useState(!1),[b,_]=B.useState(new Set),[S,A]=B.useState(""),T=B.useRef(null);B.useEffect(()=>{fetch("/api/files",{credentials:"include"}).then(D=>D.json()).then(D=>{const F=new Map;for(const K of D)F.has(K.squad)||F.set(K.squad,{squad:K.squad,squadName:K.squadName,files:[]}),F.get(K.squad).files.push(K);const Z=[...F.values()];t(Z)})},[]);const C=B.useCallback(D=>{i(D),g(!0),fetch(`/api/files/${D.squad}/${D.path}`,{credentials:"include"}).then(F=>F.json()).then(F=>{s(F.content),c(F.content),g(!1)}).catch(()=>{s(""),c(""),g(!1)})},[]),N=B.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=B.useCallback(D=>{_(F=>{const Z=new Set(F);return Z.has(D)?Z.delete(D):Z.add(D),Z})},[]),z=r!==l;B.useEffect(()=>{const D=F=>{(F.metaKey||F.ctrlKey)&&F.key==="s"&&(F.preventDefault(),z&&n&&N())};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[z,n,N]);const L=D=>D==="squad.yaml"?"⚙":D==="memories.md"?"◆":"◇";return x.jsxs("div",{style:{display:"flex",height:"100%",overflow:"hidden"},children:[x.jsxs("div",{style:{width:260,minWidth:260,borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[x.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"}),x.jsx("div",{style:{padding:"8px 10px",borderBottom:"1px solid var(--border-subtle)"},children:x.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"}})}),x.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"8px 0"},children:[e.filter(D=>{if(!S)return!0;const F=S.toLowerCase();return D.squadName.toLowerCase().includes(F)||D.squad.toLowerCase().includes(F)}).map(D=>x.jsxs("div",{children:[x.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:[x.jsx("span",{style:{fontSize:"0.6rem",transition:"transform 0.15s ease",transform:b.has(D.squad)?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"}),D.squadName]}),b.has(D.squad)&&x.jsx("div",{style:{paddingLeft:14},children:D.files.map(F=>{const Z=(n==null?void 0:n.squad)===F.squad&&(n==null?void 0:n.path)===F.path;return x.jsxs("button",{onClick:()=>C(F),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:[x.jsx("span",{style:{opacity:.6},children:L(F.file)}),F.file]},`${F.squad}/${F.path}`)})})]},D.squad)),e.length===0&&x.jsx("div",{style:{padding:"20px 14px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",textAlign:"center"},children:"No squads found"})]})]}),x.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:n?x.jsxs(x.Fragment,{children:[x.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[x.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)",display:"flex",alignItems:"center",gap:8},children:[x.jsx("span",{style:{color:"var(--text-muted)"},children:n.squadName}),x.jsx("span",{style:{color:"var(--text-muted)",opacity:.4},children:"/"}),x.jsx("span",{children:n.file}),z&&x.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",display:"inline-block"}})]}),x.jsxs("button",{onClick:N,disabled:!z||f,style:{background:z?"var(--accent)":"var(--surface-3)",border:"none",borderRadius:"var(--radius-xs)",padding:"4px 14px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:z?"var(--text-inverse)":"var(--text-muted)",cursor:z?"pointer":"default",opacity:z?1:.5,transition:"all 0.15s ease"},children:[f?"Saving...":"Save",x.jsx("span",{style:{marginLeft:6,fontSize:"0.6rem",opacity:.7},children:"⌘S"})]})]}),m?x.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.8rem"},children:"Loading..."}):x.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"}})]}):x.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,color:"var(--text-muted)",fontFamily:"var(--font-mono)"},children:[x.jsx("span",{style:{fontSize:"2rem",opacity:.3},children:"◇"}),x.jsx("span",{style:{fontSize:"0.8rem"},children:"Select a file to edit"})]})})]})}function Cm(e){return e>=70?"#4ade80":e>=40?"#f59e0b":"#f44747"}function Wf(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 NC(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 Yv(e,t){return t[e]??e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function oQ({name:e,size:t=28}){const n=[...e].reduce((i,r)=>i+r.charCodeAt(0),0)%360;return x.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 cQ({rank:e}){const t=["#FFD700","#C0C0C0","#CD7F32"],n=e<=3?t[e-1]:"var(--text-muted)";return x.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 pd({label:e,value:t,sub:n,color:i,icon:r}){return x.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:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[x.jsx("span",{style:{fontSize:"0.58rem",color:"var(--text-muted)",fontFamily:"var(--font-mono)",textTransform:"uppercase",letterSpacing:"0.08em"},children:e}),r&&x.jsx("span",{style:{fontSize:"0.75rem",opacity:.5},children:r})]}),x.jsx("div",{style:{fontSize:"1.9rem",fontWeight:800,fontFamily:"var(--font-display)",color:i??"var(--text-bright)",lineHeight:1},children:t}),x.jsx("div",{style:{fontSize:"0.58rem",color:"var(--text-muted)",fontFamily:"var(--font-mono)"},children:n})]})}function Vv({label:e,value:t,description:n}){const i=Cm(t);return x.jsxs("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:8,padding:16},children:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:10},children:[x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",fontWeight:700,color:"var(--text-secondary)",textTransform:"uppercase",letterSpacing:"0.08em"},children:e}),x.jsxs("span",{style:{fontFamily:"var(--font-display)",fontSize:"1.15rem",fontWeight:800,color:i},children:[t,"%"]})]}),x.jsx("div",{style:{height:5,background:"var(--surface-3)",borderRadius:3,overflow:"hidden"},children:x.jsx("div",{style:{height:"100%",width:`${t}%`,background:i,borderRadius:3,transition:"width 0.6s ease"}})}),x.jsx("p",{style:{fontSize:"0.58rem",color:"var(--text-muted)",fontFamily:"var(--font-mono)",marginTop:8,lineHeight:1.6},children:n})]})}function OC({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 x.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:2,height:t},children:e.map((s,l)=>x.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[x.jsxs("div",{style:{display:"flex",gap:1,alignItems:"flex-end",width:"100%",height:r},children:[n&&s.secondary!==void 0&&x.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"}}),x.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"}})]}),x.jsx("span",{style:{fontSize:"0.42rem",color:"var(--text-muted)",whiteSpace:"nowrap",fontFamily:"var(--font-mono)"},children:s.label})]},l))})}function Xv({rank:e,name:t,score:n,sub:i,barColor:r}){return x.jsxs("div",{children:[x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,marginBottom:3},children:[x.jsx(cQ,{rank:e}),x.jsx(oQ,{name:t,size:26}),x.jsxs("div",{style:{flex:1,minWidth:0},children:[x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.63rem",fontWeight:600,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t}),x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.48rem",color:"var(--text-muted)"},children:i})]}),x.jsxs("span",{style:{fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:800,color:r,flexShrink:0},children:[n,"%"]})]}),x.jsx("div",{style:{height:2,background:"var(--surface-3)",borderRadius:1,marginLeft:55},children:x.jsx("div",{style:{height:"100%",width:`${n}%`,background:r,borderRadius:1}})})]})}function uQ(){var H;const[e,t]=B.useState(null),[n,i]=B.useState(Date.now()),[r,s]=B.useState(null),[l,c]=B.useState(!1),[f,p]=B.useState(!1),[m,g]=B.useState(!1),b=B.useRef(null);B.useEffect(()=>{var I;if(m){const J=document.createElement("style");J.textContent='[data-layout="header"],[data-layout="sidebar"],[data-layout="statusbar"]{display:none!important}',document.head.appendChild(J),b.current=J}else(I=b.current)==null||I.remove(),b.current=null;return()=>{var J;(J=b.current)==null||J.remove(),b.current=null}},[m]);const _=wr(I=>I.squads),S=Object.fromEntries(_.map(I=>[I.code,I.name]));B.useEffect(()=>{const I=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(I)},[]);const A=async()=>{try{const I=await fetch("/api/dashboard/stats",{credentials:"include"});I.ok&&t(await I.json())}catch{}};B.useEffect(()=>{A();const I=setInterval(A,3e4);return()=>clearInterval(I)},[]);const T=async I=>{p(!0);try{(await fetch(`/api/dashboard/sessions/${I}/kill`,{method:"POST",credentials:"include"})).ok&&(s(null),c(!1),await A())}catch{}finally{p(!1)}},C=I=>{s(I),c(!1)},N=new Date(n),R=N.toLocaleTimeString("pt-BR",{hour12:!1}),z=N.toLocaleDateString("pt-BR",{weekday:"long",day:"numeric",month:"long"}).toUpperCase(),L=e==null?void 0:e.kpis,D=e==null?void 0:e.metrics,F=(L==null?void 0:L.weekChange)??0,Z=(()=>{const I=Object.fromEntries(((e==null?void 0:e.rhythm14)??[]).map(J=>[J.day,J.count]));return Array.from({length:14},(J,q)=>{const oe=new Date(n);oe.setDate(oe.getDate()-(13-q));const ie=oe.toISOString().slice(0,10);return{label:`${oe.getDate().toString().padStart(2,"0")}/${(oe.getMonth()+1).toString().padStart(2,"0")}`,primary:I[ie]??0}})})(),K=(()=>{const I=Object.fromEntries(((e==null?void 0:e.hourlyToday)??[]).map(q=>[q.hour,q.count])),J=Object.fromEntries(((e==null?void 0:e.hourlyLastWeek)??[]).map(q=>[q.hour,Math.round(q.avg_count)]));return Array.from({length:14},(q,oe)=>{const ie=oe+7;return{label:`${ie.toString().padStart(2,"0")}h`,primary:I[ie]??0,secondary:J[ie]??0}})})(),V=Z.reduce((I,J)=>I+J.primary,0),P=N.getHours(),G=((H=((e==null?void 0:e.hourlyToday)??[]).find(I=>I.hour===P))==null?void 0:H.count)??0,ne=(e==null?void 0:e.agentPerf)??[],X=[...ne].sort((I,J)=>{const{e:q}=Wf(I.done,I.failed,I.total),{e:oe}=Wf(J.done,J.failed,J.total);return oe-q}),W=[...ne].sort((I,J)=>{const q=I.total>0?I.done/I.total:0;return(J.total>0?J.done/J.total:0)-q}),O=[...ne].sort((I,J)=>{const{e:q}=Wf(I.done,I.failed,I.total),{e:oe}=Wf(J.done,J.failed,J.total);return oe-q}),Y={background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:8,padding:16,overflow:"hidden"},$={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},Q=x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",color:"var(--text-muted)"},children:"Nenhum dado ainda"});return x.jsxs("div",{style:{height:"100%",overflowY:"auto",background:"var(--surface-0)"},children:[x.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:[x.jsxs("div",{children:[x.jsx("div",{style:{fontFamily:"var(--font-display)",fontSize:"1rem",fontWeight:700,color:"var(--text-bright)"},children:"Painel de Operações"}),x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginTop:2},children:[x.jsx("span",{style:{fontSize:"0.55rem",fontFamily:"var(--font-mono)",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em"},children:"em tempo real"}),x.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[x.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"}}),x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"#4ade80"},children:"Ao vivo"})]})]})]}),x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[x.jsx("button",{onClick:()=>g(I=>!I),title:m?"Voltar ao modo normal":"Modo foco — tela cheia",style:{background:m?"rgba(0,200,255,0.1)":"transparent",border:`1px solid ${m?"var(--accent)":"var(--border-subtle)"}`,color:m?"var(--accent)":"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.6rem",padding:"4px 10px",borderRadius:4,whiteSpace:"nowrap"},children:m?"← Normal":"⛶ Foco"}),x.jsxs("div",{style:{textAlign:"right"},children:[x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"1.5rem",fontWeight:700,color:"var(--text-bright)",lineHeight:1,letterSpacing:"0.04em"},children:R}),x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.52rem",color:"var(--text-muted)",marginTop:3,letterSpacing:"0.06em"},children:z})]})]})]}),!e&&x.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"calc(100% - 64px)"},children:x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)"},children:"Carregando dados..."})}),e&&x.jsxs("div",{style:{padding:"16px 24px 40px",display:"flex",flexDirection:"column",gap:12},children:[x.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:10},children:[x.jsx(pd,{label:"Em Aberto",value:L.open,sub:"Tarefas planejadas",icon:"○"}),x.jsx(pd,{label:"Falhas",value:L.delayed,sub:"Tarefas com erro ou falha",color:L.delayed>0?"#f44747":void 0,icon:"△"}),x.jsx(pd,{label:"Concluídas Hoje",value:L.doneToday,sub:`Finalizadas em ${N.toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit"})}`,color:"#4ade80",icon:"✓"}),x.jsx(pd,{label:"Squads Rodando",value:L.activeSquads,sub:"Squads com pipeline ativo",color:L.activeSquads>0?"#f59e0b":void 0,icon:"◈"}),x.jsx(pd,{label:"Pipelines Ativos",value:L.runningNow,sub:"Instâncias Claude em execução",color:L.runningNow>0?"#4ade80":void 0,icon:"▶"}),x.jsx(pd,{label:"Horas Rastreadas (7d)",value:`${L.hoursTracked}h`,sub:"Últimos 7 dias",icon:"⏱"}),x.jsx(pd,{label:"Sem. vs Anterior",value:`${F>0?"+":""}${F}%`,sub:"Entregas vs período anterior",color:F>0?"#4ade80":F<0?"#f44747":void 0,icon:F>=0?"↑":"↓"})]}),x.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:10},children:[x.jsx(Vv,{label:"Regularidade",value:D.regularidade,description:"Taxa de tarefas concluídas em relação ao total de tarefas registradas."}),x.jsx(Vv,{label:"Qualidade",value:D.qualidade,description:"Taxa de sucesso entre tarefas finalizadas — concluídas vs. falhas."}),x.jsx(Vv,{label:"Eficiência",value:D.eficiencia,description:"Combina regularidade e qualidade para medir o desempenho geral."})]}),x.jsxs("div",{style:{display:"grid",gridTemplateColumns:"55fr 45fr",gap:10},children:[x.jsxs("div",{style:Y,children:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:14},children:[x.jsxs("div",{style:$,children:[x.jsx("span",{children:"📈"}),x.jsx("span",{children:"Ritmo de Conclusão"}),x.jsx("span",{style:{fontWeight:400,color:"var(--text-muted)",fontSize:"0.52rem",textTransform:"none"},children:"últimos 14 dias"})]}),x.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)"},children:["Total: ",V," tarefas"]})]}),x.jsx(OC,{bars:Z,height:120})]}),x.jsxs("div",{style:Y,children:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:14},children:[x.jsxs("div",{children:[x.jsxs("div",{style:{...$,marginBottom:6},children:[x.jsx("span",{children:"⏰"}),x.jsx("span",{children:"Ritmo por Hora"}),x.jsx("span",{style:{fontWeight:400,color:"var(--text-muted)",fontSize:"0.52rem",textTransform:"none"},children:"hoje vs média semana anterior"})]}),x.jsxs("div",{style:{display:"flex",gap:10,marginBottom:8},children:[x.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:"0.52rem",color:"#4ade80"},children:[x.jsx("span",{style:{width:8,height:8,borderRadius:2,background:"#4ade80",display:"inline-block"}}),"Hoje"]}),x.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:"0.52rem",color:"var(--text-muted)"},children:[x.jsx("span",{style:{width:8,height:8,borderRadius:2,background:"rgba(255,255,255,0.12)",display:"inline-block"}}),"Média sem. anterior"]})]})]}),x.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--text-muted)",textAlign:"right",whiteSpace:"nowrap"},children:[G," nesta hora",x.jsx("br",{}),"Total: ",L.doneToday]})]}),x.jsx(OC,{bars:K,height:100,showSecondary:!0})]})]}),e.runningSessions.length>0&&x.jsxs("div",{style:Y,children:[x.jsxs("div",{style:$,children:[x.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"]}),x.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:10},children:e.runningSessions.map(I=>{const J=Yv(I.squad_code,S),q=[...I.squad_code].reduce((de,me)=>de+me.charCodeAt(0),0)%360,oe=I.steps_total>0?Math.round(I.steps_done/I.steps_total*100):0,ie=(e.sessionAgents??[]).filter(de=>de.activity_id===I.id);return x.jsxs("div",{onClick:()=>C(I),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:de=>de.currentTarget.style.borderColor="rgba(74,222,128,0.4)",onMouseLeave:de=>de.currentTarget.style.borderColor="rgba(74,222,128,0.15)",children:[x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[x.jsx("div",{style:{width:34,height:34,borderRadius:"50%",flexShrink:0,background:`hsl(${q},45%,18%)`,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:"0.82rem",fontFamily:"var(--font-mono)",color:`hsl(${q},55%,65%)`},children:J.slice(0,1).toUpperCase()}),x.jsxs("div",{style:{flex:1,minWidth:0},children:[x.jsx("div",{style:{fontFamily:"var(--font-display)",fontSize:"0.76rem",fontWeight:600,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:J}),x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.52rem",color:"var(--text-muted)",marginTop:1},children:I.squad_code})]}),x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5,flexShrink:0},children:[x.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"#4ade80",display:"inline-block",boxShadow:"0 0 4px #4ade80"}}),x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",fontWeight:700,color:"#4ade80"},children:NC(I.started_at,n)})]})]}),I.steps_total>0&&x.jsxs("div",{children:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:4},children:[x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.5rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.06em"},children:"Progresso"}),x.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",fontWeight:700,color:I.current_task?"#f59e0b":"#4ade80"},children:[I.steps_done,"/",I.steps_total," etapas · ",oe,"%"]})]}),x.jsx("div",{style:{height:5,background:"var(--surface-3)",borderRadius:3,overflow:"hidden"},children:x.jsx("div",{style:{height:"100%",width:`${oe}%`,background:I.current_task?"#f59e0b":"#4ade80",borderRadius:3,transition:"width 0.4s ease"}})})]}),x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:I.current_task?"var(--text-secondary)":"var(--text-muted)",display:"flex",alignItems:"center",gap:5,overflow:"hidden"},children:I.current_task?x.jsxs(x.Fragment,{children:[x.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:"#f59e0b",display:"inline-block",flexShrink:0,animation:"statusPulse 1.5s ease-in-out infinite"}}),x.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:I.current_task})]}):x.jsx("span",{style:{color:"var(--text-muted)"},children:"⏳ Aguardando próxima etapa..."})}),ie.length>0&&x.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:ie.map(de=>{const me=de.executing_count>0,ge=de.done_count===de.total&&de.executing_count===0,le=de.failed_count>0&&de.executing_count===0&&de.done_count<de.total,Re=me?"#f59e0b":ge?"#4ade80":le?"#f44747":"var(--text-muted)",Le=me?"#f59e0b":ge?"#4ade80":le?"#f44747":"var(--text-muted)",Be=me?"rgba(245,158,11,0.1)":ge?"rgba(74,222,128,0.08)":le?"rgba(244,71,71,0.08)":"rgba(255,255,255,0.04)",He=de.agent_name.split(/[\s_-]/)[0];return x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,background:Be,border:`1px solid ${Re}33`,borderRadius:20,padding:"2px 7px"},children:[x.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:Re,display:"inline-block",flexShrink:0,...me?{animation:"statusPulse 1.5s ease-in-out infinite"}:{}}}),x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.52rem",fontWeight:600,color:Le,whiteSpace:"nowrap"},children:He})]},de.agent_name)})})]},I.id)})})]}),x.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:10},children:[x.jsxs("div",{style:Y,children:[x.jsxs("div",{style:$,children:[x.jsx("span",{children:"👥"})," Performance por Squad"]}),x.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[e.squadPerf.length===0&&Q,[...e.squadPerf].sort((I,J)=>{const q=I.total>0?I.done/I.total:0;return(J.total>0?J.done/J.total:0)-q}).slice(0,6).map((I,J)=>{const q=I.total>0?Math.round(I.done/I.total*100):0,oe=Yv(I.squad_code,S),ie=Cm(q);return x.jsxs("div",{children:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:4},children:[x.jsxs("div",{style:{display:"flex",gap:5,alignItems:"flex-start",flex:1,minWidth:0},children:[x.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.52rem",color:"var(--text-muted)",paddingTop:1,width:16,flexShrink:0},children:["#",J+1]}),x.jsxs("div",{style:{minWidth:0},children:[x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.63rem",fontWeight:600,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:oe}),x.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.52rem",color:"var(--text-muted)",marginTop:1},children:[I.done,"/",I.total," concluídas",I.failed>0&&x.jsxs("span",{style:{color:"#f44747",marginLeft:4},children:[I.failed," falhas"]})]})]})]}),x.jsx("span",{style:{fontFamily:"var(--font-display)",fontSize:"0.9rem",fontWeight:800,color:ie,flexShrink:0,marginLeft:6},children:q})]}),x.jsx("div",{style:{height:3,background:"var(--surface-3)",borderRadius:2},children:x.jsx("div",{style:{height:"100%",width:`${q}%`,background:ie,borderRadius:2}})})]},I.squad_code)})]})]}),x.jsxs("div",{style:Y,children:[x.jsxs("div",{style:$,children:[x.jsx("span",{children:"🏆"})," Top Performers",x.jsx("span",{style:{fontWeight:400,color:"var(--text-muted)",fontSize:"0.52rem",textTransform:"none"},children:"score combinado"})]}),x.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:9},children:[X.length===0&&Q,X.slice(0,5).map((I,J)=>{const q=Wf(I.done,I.failed,I.total);return x.jsx(Xv,{rank:J+1,name:I.agent_name,score:q.e,barColor:Cm(q.e),sub:`R: ${q.r}% · Q: ${q.q}% · E: ${q.e}%`},I.agent_name)})]})]}),x.jsxs("div",{style:Y,children:[x.jsxs("div",{style:$,children:[x.jsx("span",{children:"⭐"})," Top Regularidade",x.jsx("span",{style:{fontWeight:400,color:"var(--text-muted)",fontSize:"0.52rem",textTransform:"none"},children:"tarefas entregues"})]}),x.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:9},children:[W.length===0&&Q,W.slice(0,5).map((I,J)=>{const q=I.total>0?Math.round(I.done/I.total*100):0;return x.jsx(Xv,{rank:J+1,name:I.agent_name,score:q,barColor:Cm(q),sub:`${I.done} de ${I.total} concluídas`},I.agent_name)})]})]}),x.jsxs("div",{style:Y,children:[x.jsxs("div",{style:$,children:[x.jsx("span",{children:"📊"})," Top Eficiência",x.jsx("span",{style:{fontWeight:400,color:"var(--text-muted)",fontSize:"0.52rem",textTransform:"none"},children:"conclusão vs. andamento"})]}),x.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:9},children:[O.length===0&&Q,O.slice(0,5).map((I,J)=>{const{r:q,q:oe,e:ie}=Wf(I.done,I.failed,I.total);return x.jsx(Xv,{rank:J+1,name:I.agent_name,score:ie,barColor:Cm(ie),sub:`R: ${q}% · Q: ${oe}% · E: ${ie}%`},I.agent_name)})]})]})]})]}),r&&(()=>{const I=r,J=Yv(I.squad_code,S),q=[...I.squad_code].reduce((me,ge)=>me+ge.charCodeAt(0),0)%360,oe=I.steps_total>0?Math.round(I.steps_done/I.steps_total*100):0,ie=new Date(I.started_at).toLocaleTimeString("pt-BR",{hour12:!1}),de=new Date(I.started_at).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit"});return x.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:x.jsxs("div",{onClick:me=>me.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:[x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[x.jsx("div",{style:{width:42,height:42,borderRadius:"50%",flexShrink:0,background:`hsl(${q},45%,18%)`,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:"1rem",fontFamily:"var(--font-mono)",color:`hsl(${q},55%,65%)`},children:J.slice(0,1).toUpperCase()}),x.jsxs("div",{style:{flex:1,minWidth:0},children:[x.jsx("div",{style:{fontFamily:"var(--font-display)",fontSize:"0.9rem",fontWeight:700,color:"var(--text-bright)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:J}),x.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--text-muted)",marginTop:2},children:[I.squad_code," · Iniciado em ",de," às ",ie]})]}),x.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:"×"})]}),x.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:[x.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"}}),x.jsxs("div",{style:{flex:1},children:[x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.07em"},children:"Em execução há"}),x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"1.1rem",fontWeight:700,color:"#4ade80",letterSpacing:"0.04em"},children:NC(I.started_at,n)})]})]}),x.jsxs("div",{style:{background:"var(--surface-2)",borderRadius:6,padding:"12px 14px",border:"1px solid var(--border-subtle)"},children:[x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.07em",marginBottom:8},children:"Etapa atual"}),I.current_task?x.jsxs(x.Fragment,{children:[x.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:6},children:[x.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"}}),x.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:"var(--text-primary)",lineHeight:1.4},children:I.current_task})]}),I.current_agent&&x.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--text-muted)",marginTop:6,marginLeft:12},children:["Agente: ",I.current_agent,I.current_step&&x.jsxs("span",{style:{marginLeft:8,opacity:.6},children:["· ",I.current_step]})]})]}):x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)"},children:"⏳ Aguardando próxima etapa..."})]}),I.steps_total>0&&x.jsxs("div",{children:[x.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:6},children:[x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.07em"},children:"Progresso"}),x.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:700,color:"var(--text-secondary)"},children:[I.steps_done," / ",I.steps_total," passos (",oe,"%)"]})]}),x.jsx("div",{style:{height:6,background:"var(--surface-3)",borderRadius:3,overflow:"hidden"},children:x.jsx("div",{style:{height:"100%",width:`${oe}%`,background:I.current_task?"#f59e0b":"#4ade80",borderRadius:3,transition:"width 0.4s ease"}})})]}),x.jsx("div",{style:{borderTop:"1px solid var(--border-subtle)",paddingTop:14,display:"flex",flexDirection:"column",gap:8},children:l?x.jsxs(x.Fragment,{children:[x.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."}),x.jsxs("div",{style:{display:"flex",gap:8},children:[x.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"}),x.jsx("button",{onClick:()=>T(I.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"})]})]}):x.jsxs("div",{style:{display:"flex",gap:8},children:[x.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"}),x.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 dQ=[{id:"intro",label:"Introdução"},{id:"quickstart",label:"Quick Start",children:[{id:"qs-install",label:"Instalação"},{id:"qs-init",label:"Primeiro projeto"},{id:"qs-run",label:"Rodando o servidor"}]},{id:"architecture",label:"Arquitetura"},{id:"cli",label:"CLI Reference",children:[{id:"cli-init",label:"init"},{id:"cli-create",label:"create"},{id:"cli-run",label:"run / stop"},{id:"cli-list",label:"list"},{id:"cli-server",label:"server"},{id:"cli-reorganize",label:"reorganize"},{id:"cli-other",label:"Outros"}]},{id:"squads",label:"Configuração de Squads",children:[{id:"squad-yaml",label:"squad.yaml"},{id:"squad-agents",label:"Agentes"},{id:"squad-providers",label:"Providers"}]},{id:"hierarchy",label:"Hierarquia de Squads"},{id:"skills",label:"Skills (SKILL.md)"},{id:"pipeline",label:"Pipeline & Kanban"},{id:"scheduler",label:"Scheduler"},{id:"webhooks",label:"Webhooks"},{id:"a2ui",label:"A2UI — UI via Agentes"},{id:"email",label:"Email Engine"},{id:"dashboard",label:"Painel de Operações",children:[{id:"dash-kpis",label:"KPIs"},{id:"dash-pipelines",label:"Pipelines Ativos"},{id:"dash-focus",label:"Modo Foco"}]},{id:"env",label:"Variáveis de Ambiente"},{id:"api",label:"API Reference"},{id:"releases",label:"Releases"}];function Qn({children:e,lang:t}){return x.jsxs("pre",{style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:6,padding:"12px 14px",overflowX:"auto",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-primary)",lineHeight:1.6,margin:"10px 0 16px"},children:[t&&x.jsx("span",{style:{display:"block",fontSize:"0.55rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:8},children:t}),x.jsx("code",{children:e})]})}function Mi({children:e}){return x.jsx("code",{style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:3,padding:"1px 5px",fontFamily:"var(--font-mono)",fontSize:"0.78em",color:"var(--accent)"},children:e})}function Hr({id:e,children:t}){return x.jsx("h1",{id:e,style:{fontFamily:"var(--font-display)",fontSize:"1.5rem",fontWeight:800,color:"var(--text-bright)",marginBottom:12,marginTop:40,paddingBottom:10,borderBottom:"2px solid var(--border-subtle)",scrollMarginTop:24},children:t})}function bi({id:e,children:t}){return x.jsx("h2",{id:e,style:{fontFamily:"var(--font-display)",fontSize:"1.05rem",fontWeight:700,color:"var(--text-primary)",marginBottom:8,marginTop:28,scrollMarginTop:24},children:t})}function Ht({children:e}){return x.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.78rem",color:"var(--text-secondary)",lineHeight:1.75,marginBottom:12},children:e})}function bm({items:e}){return x.jsx("ul",{style:{margin:"8px 0 16px 18px",listStyle:"none",padding:0},children:e.map((t,n)=>x.jsxs("li",{style:{display:"flex",gap:8,alignItems:"flex-start",fontFamily:"var(--font-mono)",fontSize:"0.78rem",color:"var(--text-secondary)",lineHeight:1.6,marginBottom:4},children:[x.jsx("span",{style:{color:"var(--accent)",flexShrink:0,marginTop:2},children:"▸"}),x.jsx("span",{children:t})]},n))})}function xl({headers:e,rows:t}){return x.jsx("div",{style:{overflowX:"auto",margin:"10px 0 20px"},children:x.jsxs("table",{style:{borderCollapse:"collapse",width:"100%",fontFamily:"var(--font-mono)",fontSize:"0.73rem"},children:[x.jsx("thead",{children:x.jsx("tr",{children:e.map((n,i)=>x.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:700,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.07em",fontSize:"0.6rem",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-2)"},children:n},i))})}),x.jsx("tbody",{children:t.map((n,i)=>x.jsx("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:n.map((r,s)=>x.jsx("td",{style:{padding:"7px 12px",color:s===0?"var(--accent)":"var(--text-secondary)",fontWeight:s===0?600:400},children:r},s))},i))})]})})}function is({version:e,date:t,type:n,items:i}){const r=n==="feat"?"#4ade80":n==="fix"?"#f59e0b":"var(--text-muted)",s=n==="feat"?"Feature":n==="fix"?"Fix":"Chore";return x.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:8,padding:"14px 16px",marginBottom:12},children:[x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10},children:[x.jsxs("span",{style:{fontFamily:"var(--font-display)",fontSize:"1rem",fontWeight:800,color:"var(--text-bright)"},children:["v",e]}),x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",fontWeight:700,color:r,background:`${r}18`,border:`1px solid ${r}44`,borderRadius:20,padding:"1px 7px"},children:s}),x.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",marginLeft:"auto"},children:t})]}),x.jsx("ul",{style:{margin:0,padding:0,listStyle:"none"},children:i.map((l,c)=>x.jsxs("li",{style:{display:"flex",gap:7,fontFamily:"var(--font-mono)",fontSize:"0.73rem",color:"var(--text-secondary)",lineHeight:1.6,marginBottom:3},children:[x.jsx("span",{style:{color:r,flexShrink:0},children:"·"}),x.jsx("span",{children:l})]},c))})]})}function fQ(){const[e,t]=B.useState("intro"),n=B.useRef(null);B.useEffect(()=>{const r=n.current;if(!r)return;const s=new IntersectionObserver(l=>{for(const c of l)c.isIntersecting&&t(c.target.id)},{root:r,rootMargin:"-10% 0px -80% 0px",threshold:0});return r.querySelectorAll("[id]").forEach(l=>s.observe(l)),()=>s.disconnect()},[]);const i=r=>{var s;(s=document.getElementById(r))==null||s.scrollIntoView({behavior:"smooth",block:"start"})};return x.jsxs("div",{style:{display:"flex",height:"100%",overflow:"hidden",background:"var(--surface-0)"},children:[x.jsxs("div",{style:{width:220,minWidth:220,borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[x.jsx("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)",fontFamily:"var(--font-display)",fontSize:"0.85rem",fontWeight:700,color:"var(--text-bright)"},children:"📚 Documentação"}),x.jsx("div",{style:{flex:1,overflowY:"auto",padding:"8px 0"},children:dQ.map(r=>{var s;return x.jsxs("div",{children:[x.jsx("button",{onClick:()=>i(r.id),style:{width:"100%",background:e===r.id?"var(--accent-glow)":"transparent",border:"none",cursor:"pointer",textAlign:"left",padding:"6px 16px",color:e===r.id?"var(--accent)":"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",fontWeight:e===r.id?700:400,transition:"all 0.1s"},children:r.label}),(s=r.children)==null?void 0:s.map(l=>x.jsx("button",{onClick:()=>i(l.id),style:{width:"100%",background:e===l.id?"var(--accent-glow)":"transparent",border:"none",cursor:"pointer",textAlign:"left",padding:"4px 16px 4px 28px",color:e===l.id?"var(--accent)":"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:e===l.id?600:400},children:l.label},l.id))]},r.id)})})]}),x.jsxs("div",{ref:n,style:{flex:1,overflowY:"auto",padding:"24px 48px 80px",maxWidth:860,margin:"0 auto"},children:[x.jsx(Hr,{id:"intro",children:"ExpxAgents"}),x.jsxs(Ht,{children:[x.jsx("strong",{style:{color:"var(--text-bright)"},children:"ExpxAgents"})," é uma plataforma de orquestração de múltiplos agentes de IA. Permite criar squads de agentes especializados que executam pipelines, se comunicam entre si, agendam tarefas e geram resultados de forma autônoma — tudo gerenciado via uma interface web e CLI."]}),x.jsx(bm,{items:["Squads de agentes em YAML — configuração simples, execução poderosa","Hierarquia Setor → Grupo → Sessão → Squad para organização empresarial","Pipeline com checkpoints, kanban automático e rastreamento de steps","Scheduler integrado com cron jobs por squad","Dashboard de operações em tempo real (KPIs, gráficos, agentes)","Webhooks para integração com sistemas externos","Engine de Email (SES) com campanhas e rastreamento","Suporte a Claude (Anthropic), OpenAI e providers customizados"]}),x.jsx(Hr,{id:"quickstart",children:"Quick Start"}),x.jsx(bi,{id:"qs-install",children:"Instalação"}),x.jsx(Ht,{children:"Requisito: Node.js ≥ 20 e Claude Code instalado globalmente."}),x.jsx(Qn,{lang:"bash",children:"npm install -g expxagents"}),x.jsx(Ht,{children:"Verifique a instalação:"}),x.jsx(Qn,{lang:"bash",children:`expxagents --version
401
+ expxagents doctor`}),x.jsx(bi,{id:"qs-init",children:"Primeiro projeto"}),x.jsx(Qn,{lang:"bash",children:`# Criar novo projeto ExpxAgents
402
+ expxagents init meu-projeto
403
+ cd meu-projeto
404
+
405
+ # Criar sua primeira squad
406
+ expxagents create minha-squad
407
+
408
+ # Instalar a skill de onboarding
409
+ expxagents install`}),x.jsx(bi,{id:"qs-run",children:"Rodando o servidor"}),x.jsx(Qn,{lang:"bash",children:`# Modo desenvolvimento (server + dashboard)
410
+ npm run dev
411
+
412
+ # Modo produção
413
+ npm start
414
+
415
+ # Com tunnel para acesso remoto
416
+ expxagents server --tunnel
417
+
418
+ # Acesse: http://localhost:3001`}),x.jsxs(Ht,{children:["Na primeira execução, o sistema cria um usuário ",x.jsx(Mi,{children:"admin"})," com senha ",x.jsx(Mi,{children:"admin123"}),". Altere imediatamente em Settings → Security."]}),x.jsx(Hr,{id:"architecture",children:"Arquitetura"}),x.jsx(Ht,{children:"ExpxAgents é um monorepo com 4 pacotes independentes:"}),x.jsx(Qn,{lang:"text",children:`expxagents/
419
+ ├── server/ # API REST + WebSocket (Fastify 5, SQLite)
420
+ ├── dashboard/ # SPA React (React 19, Vite, Zustand, Pixi.js)
421
+ ├── core/ # Engine TypeScript (squad-loader, state-manager)
422
+ ├── cli/ # CLI Commander.js (expxagents command)
423
+ └── squads/ # Configurações de squads (YAML)`}),x.jsx(bm,{items:[x.jsxs(x.Fragment,{children:[x.jsx("strong",{style:{color:"var(--text-primary)"},children:"server"})," — Fastify 5 com SQLite (better-sqlite3). Gerencia autenticação JWT, WebSocket, file-watcher (chokidar), scheduler (node-cron), engine de email (AWS SES) e bridge com Claude Code."]}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{style:{color:"var(--text-primary)"},children:"dashboard"})," — SPA React 19 com React Router 7, Zustand 5 para estado global, Pixi.js 8 para o Office View e comunicação via WebSocket."]}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{style:{color:"var(--text-primary)"},children:"core"})," — Biblioteca pura TypeScript. Parse de squad.yaml, gerenciamento de estado do pipeline e carregamento de skills."]}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{style:{color:"var(--text-primary)"},children:"cli"})," — Pacote publicado no npm (",x.jsx(Mi,{children:"expxagents"}),"). Contém todos os comandos do usuário final."]})]}),x.jsx(Hr,{id:"cli",children:"CLI Reference"}),x.jsxs(Ht,{children:["Todos os comandos do CLI ",x.jsx(Mi,{children:"expxagents"}),":"]}),x.jsx(bi,{id:"cli-init",children:"init"}),x.jsx(Ht,{children:"Inicializa um novo projeto ExpxAgents no diretório atual."}),x.jsx(Qn,{lang:"bash",children:"expxagents init [nome-do-projeto]"}),x.jsx(Ht,{children:"Cria a estrutura de diretórios, arquivos de configuração base e instala dependências Python necessárias."}),x.jsx(bi,{id:"cli-create",children:"create"}),x.jsx(Ht,{children:"Cria uma nova squad dentro do projeto."}),x.jsx(Qn,{lang:"bash",children:`expxagents create <nome-da-squad>
424
+
425
+ # Com hierarquia
426
+ expxagents create comercial/vendas/prospeccao/hunter-squad`}),x.jsxs(Ht,{children:["Gera o diretório da squad com ",x.jsx(Mi,{children:"squad.yaml"})," padrão e estrutura inicial de agentes."]}),x.jsx(bi,{id:"cli-run",children:"run / stop"}),x.jsx(Qn,{lang:"bash",children:`# Executar uma squad
427
+ expxagents run <nome-da-squad>
428
+
429
+ # Parar uma squad em execução
430
+ expxagents stop <nome-da-squad>
431
+
432
+ # Suporta squads em hierarquia (busca recursiva)
433
+ expxagents run hunter-squad # encontra em qualquer nível`}),x.jsx(bi,{id:"cli-list",children:"list"}),x.jsx(Ht,{children:"Lista todas as squads do projeto, agrupadas pela hierarquia."}),x.jsx(Qn,{lang:"bash",children:`expxagents list
434
+
435
+ # Saída exemplo:
436
+ # ▸ Comercial
437
+ # ▸ Vendas
438
+ # ▸ Prospecção
439
+ # · hunter-squad (2 agents)
440
+ # · closer-squad (3 agents)`}),x.jsx(bi,{id:"cli-server",children:"server"}),x.jsx(Qn,{lang:"bash",children:`# Iniciar servidor
441
+ expxagents server
442
+
443
+ # Com acesso remoto via localtunnel
444
+ expxagents server --tunnel
445
+
446
+ # Porta customizada
447
+ PORT=4000 expxagents server`}),x.jsx(bi,{id:"cli-reorganize",children:"reorganize"}),x.jsx(Ht,{children:"Migra squads existentes para a estrutura de hierarquia (Setor → Grupo → Sessão → Squad) usando a API da Anthropic para classificação automática."}),x.jsx(Qn,{lang:"bash",children:`expxagents reorganize
448
+
449
+ # Classifica squads não organizadas usando Claude Haiku
450
+ # Requer ANTHROPIC_API_KEY no ambiente`}),x.jsx(bi,{id:"cli-other",children:"Outros comandos"}),x.jsx(xl,{headers:["Comando","Descrição"],rows:[["expxagents install","Instala skills e configura o ambiente"],["expxagents uninstall","Remove a instalação do ExpxAgents"],["expxagents doctor","Verifica pré-requisitos (Node, Claude Code, etc.)"],["expxagents onboarding","Fluxo guiado de configuração inicial"]]}),x.jsx(Hr,{id:"squads",children:"Configuração de Squads"}),x.jsx(bi,{id:"squad-yaml",children:"squad.yaml"}),x.jsxs(Ht,{children:["Cada squad é definida por um arquivo ",x.jsx(Mi,{children:"squad.yaml"})," no seu diretório:"]}),x.jsx(Qn,{lang:"yaml",children:`name: Hunter Squad
451
+ description: Prospecta leads qualificados via LinkedIn e cold email
452
+ version: "1.0"
453
+
454
+ # Agendamento (opcional)
455
+ schedule:
456
+ cron: "0 9 * * 1-5" # Segunda a sexta às 9h
457
+ enabled: true
458
+ max_retries: 2
459
+
460
+ # Configurações de provider (opcional)
461
+ provider: anthropic # anthropic | openai | custom
462
+ model: claude-opus-4-6 # modelo padrão para agentes sem provider próprio
463
+
464
+ # Webhook (opcional)
465
+ webhooks:
466
+ secret: "meu-webhook-secret"
467
+
468
+ # Agentes da squad
469
+ agents:
470
+ - id: researcher
471
+ name: Ana Costa
472
+ role: Pesquisadora de Mercado
473
+ model: claude-sonnet-4-6
474
+ avatar: Ana
475
+ instructions: |
476
+ Você é uma especialista em pesquisa de mercado.
477
+ Identifique prospects ideais baseado no ICP definido.
478
+ skills:
479
+ - web-search
480
+ - data-analysis
481
+
482
+ - id: writer
483
+ name: Bruno Lima
484
+ role: Copywriter
485
+ avatar: Bruno
486
+ instructions: |
487
+ Você escreve mensagens de cold outreach personalizadas.
488
+ Tom: profissional, direto, sem jargões.`}),x.jsx(bi,{id:"squad-agents",children:"Agentes"}),x.jsx(Ht,{children:"Cada agente dentro de uma squad pode ter suas próprias configurações:"}),x.jsx(xl,{headers:["Campo","Tipo","Descrição"],rows:[["id","string","Identificador único do agente (usado em logs e kanban)"],["name","string","Nome humano do agente (exibido no dashboard e Office)"],["role","string","Função/cargo do agente"],["avatar","string","Seed para avatar DiceBear (geralmente o primeiro nome)"],["model","string","Modelo de IA (sobrescreve o model da squad)"],["provider","string","Provider de IA (anthropic | openai)"],["instructions","string","System prompt do agente"],["skills","string[]","Lista de skills disponíveis para o agente"]]}),x.jsx(bi,{id:"squad-providers",children:"Providers de IA"}),x.jsx(Ht,{children:"ExpxAgents suporta múltiplos providers de IA por squad ou por agente:"}),x.jsx(Qn,{lang:"yaml",children:`# Provider Anthropic (padrão)
489
+ provider: anthropic
490
+ model: claude-opus-4-6
491
+
492
+ # Provider OpenAI
493
+ provider: openai
494
+ model: gpt-4o
495
+
496
+ # Agente com provider próprio (sobrescreve o da squad)
497
+ agents:
498
+ - id: analyst
499
+ name: Carlos Neves
500
+ provider: openai
501
+ model: gpt-4o-mini
502
+ instructions: "..."
503
+
504
+ - id: writer
505
+ name: Daniela Cruz
506
+ provider: anthropic
507
+ model: claude-haiku-4-5-20251001
508
+ instructions: "..."`}),x.jsx(Hr,{id:"hierarchy",children:"Hierarquia de Squads"}),x.jsx(Ht,{children:"ExpxAgents organiza squads em uma hierarquia de 4 níveis para refletir a estrutura empresarial:"}),x.jsx(Qn,{lang:"text",children:`squads/
509
+ └── comercial/ # Setor
510
+ └── vendas/ # Grupo
511
+ └── prospeccao/ # Sessão
512
+ ├── hunter-squad/ # Squad
513
+ │ └── squad.yaml
514
+ └── closer-squad/
515
+ └── squad.yaml`}),x.jsx(bm,{items:[x.jsxs(x.Fragment,{children:[x.jsx("strong",{style:{color:"var(--text-primary)"},children:"Setor"})," — Área macro da empresa (comercial, financeiro, rh, marketing...)"]}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{style:{color:"var(--text-primary)"},children:"Grupo"})," — Subárea do setor (vendas, pós-venda, recrutamento...)"]}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{style:{color:"var(--text-primary)"},children:"Sessão"})," — Processo específico (prospecção, onboarding, folha...)"]}),x.jsxs(x.Fragment,{children:[x.jsx("strong",{style:{color:"var(--text-primary)"},children:"Squad"})," — Time de agentes que executa o processo"]})]}),x.jsx(Ht,{children:"O CLI e a API suportam busca recursiva — você pode referenciar uma squad pelo nome sem precisar especificar o caminho completo."}),x.jsx(Qn,{lang:"bash",children:`# Todos esses comandos encontram a mesma squad
516
+ expxagents run hunter-squad
517
+ expxagents run prospeccao/hunter-squad
518
+ expxagents run comercial/vendas/prospeccao/hunter-squad`}),x.jsx(Hr,{id:"skills",children:"Skills (SKILL.md)"}),x.jsxs(Ht,{children:["Skills são capacidades instaláveis nos agentes. Cada skill é um arquivo ",x.jsx(Mi,{children:"SKILL.md"}),"com frontmatter YAML que define metadados e conteúdo de instruções."]}),x.jsx(Qn,{lang:"markdown",children:`---
519
+ name: web-search
520
+ description: Capacidade de buscar informações na web em tempo real
521
+ version: "1.0"
522
+ author: ExpxAgents
523
+ ---
524
+
525
+ # Web Search Skill
526
+
527
+ Você tem acesso à ferramenta de busca na web via WebSearch.
528
+
529
+ ## Como usar
530
+ - Use WebSearch para encontrar informações atualizadas
531
+ - Cite sempre as fontes encontradas
532
+ - Valide informações em múltiplas fontes quando possível`}),x.jsxs(Ht,{children:["Skills ficam em ",x.jsx(Mi,{children:"_expxagents/skills/"})," e são referenciadas pelo ",x.jsx(Mi,{children:"id"})," no ",x.jsx(Mi,{children:"squad.yaml"}),":"]}),x.jsx(Qn,{lang:"yaml",children:`agents:
533
+ - id: researcher
534
+ skills:
535
+ - web-search
536
+ - data-analysis
537
+ - code-runner`}),x.jsx(Hr,{id:"pipeline",children:"Pipeline & Kanban"}),x.jsx(Ht,{children:"Quando uma squad executa, o sistema cria automaticamente tarefas no Kanban rastreando cada step do pipeline. As tarefas transitam entre estados em tempo real:"}),x.jsx(xl,{headers:["Status","Descrição"],rows:[["planned","Tarefa aguardando execução"],["executing","Agente está trabalhando nesta tarefa agora"],["done","Tarefa concluída com sucesso"],["failed","Tarefa falhou ou foi interrompida"]]}),x.jsxs(Ht,{children:["O arquivo ",x.jsx(Mi,{children:"state.json"})," na pasta da squad é atualizado em tempo real pelo runner:"]}),x.jsx(Qn,{lang:"json",children:`{
538
+ "status": "running",
539
+ "step": 2,
540
+ "totalSteps": 5,
541
+ "currentAgent": "researcher",
542
+ "startedAt": "2026-03-18T14:00:00Z",
543
+ "agents": [
544
+ { "id": "researcher", "name": "Ana Costa", "status": "working" },
545
+ { "id": "writer", "name": "Bruno Lima", "status": "idle" }
546
+ ]
547
+ }`}),x.jsxs(Ht,{children:[x.jsx("strong",{style:{color:"var(--text-primary)"},children:"Checkpoints"})," — O runner pode pausar e solicitar input humano via checkpoint. O usuário pode responder via Chat ou Dashboard."]}),x.jsx(Hr,{id:"scheduler",children:"Scheduler"}),x.jsxs(Ht,{children:["Cada squad pode ter um agendamento definido em ",x.jsx(Mi,{children:"squad.yaml"})," usando sintaxe cron. O scheduler é gerenciado pelo servidor e sobrevive a restarts."]}),x.jsx(Qn,{lang:"yaml",children:`schedule:
548
+ cron: "0 9 * * 1-5" # Seg-Sex às 9h (horário do servidor)
549
+ enabled: true
550
+ max_retries: 2 # Tentativas em caso de falha
551
+ timeout_ms: 1800000 # Timeout de 30 minutos (padrão)`}),x.jsx(xl,{headers:["Exemplo de Cron","Descrição"],rows:[["0 9 * * 1-5","Segunda a sexta às 9h00"],["0 */2 * * *","A cada 2 horas"],["30 8 * * 1","Toda segunda às 8h30"],["0 18 * * 5","Toda sexta às 18h00"],["0 8,12,18 * * *","Às 8h, 12h e 18h todo dia"]]}),x.jsxs(Ht,{children:["A view ",x.jsx("strong",{style:{color:"var(--text-primary)"},children:"Scheduler"})," no dashboard permite gerenciar os jobs: ativar/desativar, ver histórico de execuções e status de próxima execução."]}),x.jsx(Hr,{id:"webhooks",children:"Webhooks"}),x.jsxs(Ht,{children:["Squads podem ser acionadas por sistemas externos via POST sem autenticação JWT, usando um secret configurado no ",x.jsx(Mi,{children:"squad.yaml"}),"."]}),x.jsx(Qn,{lang:"bash",children:`# Disparar squad via webhook
552
+ curl -X POST https://seu-servidor.com/api/webhooks/nome-da-squad \\
553
+ -H "Content-Type: application/json" \\
554
+ -d '{
555
+ "secret": "meu-webhook-secret",
556
+ "prompt": "Prospectar 10 leads no setor de tecnologia",
557
+ "context": { "region": "São Paulo" }
558
+ }'`}),x.jsxs(Ht,{children:["Configuração no ",x.jsx(Mi,{children:"squad.yaml"}),":"]}),x.jsx(Qn,{lang:"yaml",children:`webhooks:
559
+ secret: "seu-secret-aqui" # Mínimo 16 caracteres recomendado`}),x.jsxs(Ht,{children:[x.jsx("strong",{style:{color:"var(--text-primary)"},children:"Deduplicação"})," — O sistema detecta payloads idênticos e evita execuções duplicadas dentro de uma janela de tempo. Cada squad também pode ter um orçamento de gastos (",x.jsx(Mi,{children:"spend_limit_usd"}),") para controle de custos com a API de IA."]}),x.jsx(Hr,{id:"a2ui",children:"A2UI — UI via Agentes"}),x.jsxs(Ht,{children:["A2UI (Agent-to-UI) permite que agentes atualizem dinamicamente a interface do dashboard escrevendo um arquivo ",x.jsx(Mi,{children:"ui.json"})," na pasta da squad."]}),x.jsx(Qn,{lang:"json",children:`// squads/minha-squad/ui.json
560
+ [
561
+ {
562
+ "type": "stat",
563
+ "label": "Leads Encontrados",
564
+ "value": "47",
565
+ "color": "#4ade80"
566
+ },
567
+ {
568
+ "type": "progress",
569
+ "label": "Análise de Perfis",
570
+ "value": 73,
571
+ "max": 100
572
+ },
573
+ {
574
+ "type": "table",
575
+ "label": "Top Leads",
576
+ "columns": ["Empresa", "Score", "Status"],
577
+ "rows": [
578
+ ["Acme Corp", "92", "Qualificado"],
579
+ ["TechStart", "87", "Em análise"]
580
+ ]
581
+ }
582
+ ]`}),x.jsxs(Ht,{children:["O file-watcher detecta mudanças no ",x.jsx(Mi,{children:"ui.json"})," e faz broadcast via WebSocket para todos os clientes conectados. A view é exibida em tempo real no Dashboard."]}),x.jsx(Hr,{id:"email",children:"Email Engine"}),x.jsx(Ht,{children:"ExpxAgents possui um engine de email integrado com AWS SES para campanhas e comunicações automatizadas pelos agentes."}),x.jsx(Ht,{children:"Configure as variáveis de ambiente:"}),x.jsx(Qn,{lang:"env",children:`AWS_REGION=us-east-1
583
+ AWS_ACCESS_KEY_ID=sua-chave
584
+ AWS_SECRET_ACCESS_KEY=seu-secret
585
+ SES_RATE_LIMIT=14 # Emails por segundo (padrão: 14)
586
+ SERVER_URL=https://seu-servidor.com`}),x.jsx(bm,{items:["Leads — cadastro e gerenciamento de contatos com tags e segmentação","Campanhas — sequências de email com tracking de abertura e cliques (via SNS webhook)","Fila de envio — worker com rate limiting respeita os limites do SES","SNS Webhook — recebe notificações de bounce, complaint e entrega"]}),x.jsx(Hr,{id:"dashboard",children:"Painel de Operações"}),x.jsxs(Ht,{children:["O dashboard ",x.jsx("strong",{style:{color:"var(--text-primary)"},children:"▣ Dashboard"})," oferece uma visão operacional em tempo real com atualização automática a cada 30 segundos."]}),x.jsx(bi,{id:"dash-kpis",children:"KPIs"}),x.jsx(xl,{headers:["KPI","Descrição"],rows:[["Em Aberto",'Tarefas kanban com status "planned"'],["Falhas",'Tarefas com status "failed"'],["Concluídas Hoje","Tarefas finalizadas no dia atual (horário local)"],["Squads Rodando","Squads distintas com pipeline ativo"],["Pipelines Ativos","Instâncias Claude em execução simultânea"],["Horas Rastreadas (7d)","Soma do tempo de execução dos últimos 7 dias"],["Sem. vs Anterior","Variação % de entregas semana atual vs anterior"]]}),x.jsx(bi,{id:"dash-pipelines",children:"Pipelines Ativos"}),x.jsx(Ht,{children:"Cada card de pipeline ativo mostra em tempo real: squad, timer de execução, barra de progresso de etapas e chips de agentes com status colorido:"}),x.jsx(bm,{items:["🟡 Âmbar pulsando — agente trabalhando agora","🟢 Verde — agente concluiu todas as suas tarefas","🔴 Vermelho — agente com falha","⚫ Cinza — agente aguardando sua vez"]}),x.jsxs(Ht,{children:["Clique em qualquer card para abrir o modal de detalhes com opção de",x.jsx("strong",{style:{color:"#f44747"},children:" Encerrar Pipeline"})," (com confirmação em duas etapas)."]}),x.jsx(bi,{id:"dash-focus",children:"Modo Foco"}),x.jsxs(Ht,{children:["Clique no botão ",x.jsx(Mi,{children:"⛶ Foco"})," no cabeçalho do dashboard (ou na sidebar do Kanban) para ocultar toda a navegação e ter a view em tela cheia. Ideal para monitores de operações. Clique ",x.jsx(Mi,{children:"← Normal"})," para voltar."]}),x.jsx(Hr,{id:"env",children:"Variáveis de Ambiente"}),x.jsx(Qn,{lang:"env",children:`# Servidor
587
+ PORT=3001
588
+ NODE_ENV=production # development | production
589
+ JWT_SECRET=seu-hex-string # Mínimo 32 chars, use: openssl rand -hex 32
590
+ CORS_ORIGIN=http://localhost:3001
591
+
592
+ # Diretórios (opcional)
593
+ DATA_DIR=./data # Onde fica o SQLite
594
+ SQUADS_DIR=./squads # Onde ficam as squads
595
+
596
+ # Claude Bridge
597
+ BRIDGE_TIMEOUT_MS=300000 # Timeout de execução de chat (5 min)
598
+ SCHEDULER_TIMEOUT_MS=1800000 # Timeout do scheduler (30 min)
599
+
600
+ # Versão (injetada no build)
601
+ EXPXAGENTS_VERSION=0.17.14
602
+
603
+ # AWS SES (opcional — habilita o email engine)
604
+ AWS_REGION=us-east-1
605
+ AWS_ACCESS_KEY_ID=...
606
+ AWS_SECRET_ACCESS_KEY=...
607
+ SES_RATE_LIMIT=14
608
+ SERVER_URL=https://meu-servidor.com
609
+
610
+ # Dashboard (produção)
611
+ DASHBOARD_DIST=../dashboard/dist # Path para os assets do dashboard`}),x.jsx(Hr,{id:"api",children:"API Reference"}),x.jsxs(Ht,{children:["Todas as rotas (exceto ",x.jsx(Mi,{children:"/health"})," e ",x.jsx(Mi,{children:"/api/webhooks/*"}),") requerem autenticação JWT via cookie."]}),x.jsx(bi,{id:"api-auth",children:"Autenticação"}),x.jsx(xl,{headers:["Método","Rota","Descrição"],rows:[["POST","/api/auth/login","Login — retorna JWT no cookie"],["POST","/api/auth/logout","Logout — limpa o cookie"],["GET","/api/auth/me","Dados do usuário autenticado"]]}),x.jsx(bi,{id:"api-squads",children:"Squads"}),x.jsx(xl,{headers:["Método","Rota","Descrição"],rows:[["GET","/api/squads","Lista todas as squads"],["GET","/api/squads/:code","Detalhes de uma squad"],["GET","/api/squads/:code/state","Estado atual do pipeline"]]}),x.jsx(bi,{id:"api-kanban",children:"Kanban"}),x.jsx(xl,{headers:["Método","Rota","Descrição"],rows:[["GET","/api/kanban/tasks","Todas as tarefas (todos as squads)"],["GET","/api/kanban/:squad/tasks","Tarefas de uma squad"],["POST","/api/kanban/:squad/tasks","Criar tarefa manual"],["PATCH","/api/kanban/:squad/tasks/:id","Atualizar status/resultado"],["DELETE","/api/kanban/:squad/tasks/:id","Remover tarefa"]]}),x.jsx(bi,{id:"api-scheduler",children:"Scheduler"}),x.jsx(xl,{headers:["Método","Rota","Descrição"],rows:[["GET","/api/scheduler/jobs","Lista todos os jobs agendados"],["POST","/api/scheduler/jobs/:squad/enable","Ativar agendamento"],["POST","/api/scheduler/jobs/:squad/disable","Desativar agendamento"],["POST","/api/scheduler/jobs/:squad/run","Executar job manualmente"]]}),x.jsx(bi,{id:"api-dashboard",children:"Dashboard"}),x.jsx(xl,{headers:["Método","Rota","Descrição"],rows:[["GET","/api/dashboard/stats","Todos os dados do painel de operações"],["POST","/api/dashboard/sessions/:id/kill","Encerrar pipeline em execução"]]}),x.jsx(bi,{id:"api-webhook",children:"Webhooks"}),x.jsx(xl,{headers:["Método","Rota","Descrição"],rows:[["POST","/api/webhooks/:squad","Disparar squad via webhook externo"]]}),x.jsx(Hr,{id:"releases",children:"Releases"}),x.jsx(is,{version:"0.17.14",date:"2026-03-19",type:"fix",items:["Fix: modo foco agora oculta corretamente o header, sidebar e status bar via data-layout attributes","Fix: queries SQLite do dashboard agora usam localtime para correta exibição por fuso horário",'Fix: gráfico "Ritmo por Hora" exibe dados no horário local do servidor (não UTC)']}),x.jsx(is,{version:"0.17.13",date:"2026-03-19",type:"fix",items:['Fix: botão "Todos" restaurado no Kanban — disponível mas não pré-selecionado por padrão']}),x.jsx(is,{version:"0.17.12",date:"2026-03-19",type:"feat",items:["Botão ⛶ Foco em Kanban e Dashboard — oculta toda a navegação para modo tela cheia",'Kanban: "Todos" não é mais selecionado por padrão ao entrar na página']}),x.jsx(is,{version:"0.17.11",date:"2026-03-19",type:"feat",items:["Pipeline cards no dashboard agora mostram barra de progresso (N/total etapas)","Chips de agentes por sessão com status: trabalhando (âmbar), concluído (verde), falha (vermelho), aguardando (cinza)","Novo endpoint GET /api/dashboard/stats inclui sessionAgents por atividade em execução"]}),x.jsx(is,{version:"0.17.10",date:"2026-03-19",type:"feat",items:["Modal de pipeline: clique em qualquer card de pipeline ativo para ver detalhes","Opção de encerrar pipeline com confirmação em 2 etapas","Kill registry conecta bridge de chat e bridge do scheduler"]}),x.jsx(is,{version:"0.17.9",date:"2026-03-18",type:"fix",items:['Dashboard: labels corretos — "Falhas" (não "Em Atraso"), "Squads Rodando", "Pipelines Ativos"',"Ranking de squads corrigido para ordenar por score (done/total) em vez de count absoluto","Kanban task info dentro de cada card de pipeline ativo"]}),x.jsx(is,{version:"0.17.7",date:"2026-03-18",type:"feat",items:["Painel de Operações completo: KPIs, métricas (Regularidade/Qualidade/Eficiência), gráficos de ritmo","Performance por Squad, Top Performers, Top Regularidade, Top Eficiência","Sessões ativas em tempo real com timer de execução"]}),x.jsx(is,{version:"0.17.6",date:"2026-03-18",type:"fix",items:["CLI reorganize: substituído spawn do claude por chamadas diretas à API Anthropic (fix do hang)","Classificação em batches de 10 com fallback heurístico baseado em keywords"]}),x.jsx(is,{version:"0.17.0",date:"2026-03-17",type:"feat",items:["Hierarquia de squads: Setor → Grupo → Sessão → Squad com descoberta recursiva","Comando reorganize para migrar squads existentes para a hierarquia","CLI list agrupa squads pela hierarquia","run/stop usam findSquadDir() para localizar squads em qualquer nível"]}),x.jsx(is,{version:"0.16.2",date:"2026-03-14",type:"feat",items:["Sincronização do painel de detalhes do kanban com updates em tempo real","Exibição de duração e output nas tarefas","Step-by-step kanban transitions via watcher events"]}),x.jsx(is,{version:"0.16.0",date:"2026-03-12",type:"feat",items:["Integração pipeline → kanban: tasks criadas automaticamente por step","Webhook deduplicação e spend control por squad","Session journal para rastreamento histórico","Avatar e nomes humanos para agentes"]}),x.jsx(is,{version:"0.15.0",date:"2026-03-05",type:"feat",items:["A2UI: agentes podem atualizar o dashboard escrevendo ui.json","Anthropic runner, OpenAI runner e factory de providers","POST /api/webhooks/:squad para triggers externos sem JWT","--tunnel flag no comando server (localtunnel)"]}),x.jsx(is,{version:"0.14.0",date:"2026-02-28",type:"feat",items:["Scheduler integrado com node-cron por squad","View Scheduler no dashboard","Email engine com AWS SES, leads, campanhas e SNS webhook"]}),x.jsx("div",{style:{height:60}})]})]})}const hQ=localStorage.getItem("expx-theme")||"dark";document.documentElement.setAttribute("data-theme",hQ);const pQ=B.lazy(()=>mu(()=>import("./JarvisView-fk7wpaPG.js"),[]).then(e=>({default:e.JarvisView})));s3.createRoot(document.getElementById("root")).render(x.jsx(B.StrictMode,{children:x.jsx(k4,{children:x.jsxs(s4,{children:[x.jsx(Pr,{path:"/login",element:x.jsx(vD,{})}),x.jsxs(Pr,{path:"/",element:x.jsx(xD,{}),children:[x.jsx(Pr,{index:!0,element:x.jsx(r4,{to:"/office",replace:!0})}),x.jsx(Pr,{path:"office",element:x.jsx(VB,{})}),x.jsx(Pr,{path:"chat",element:x.jsx(bq,{})}),x.jsx(Pr,{path:"kanban",element:x.jsx(Eq,{})}),x.jsx(Pr,{path:"settings",element:x.jsx(zq,{})}),x.jsx(Pr,{path:"scheduler",element:x.jsx(Iq,{})}),x.jsx(Pr,{path:"email",element:x.jsx(Fq,{})}),x.jsx(Pr,{path:"orgchart",element:x.jsx(nQ,{})}),x.jsx(Pr,{path:"graph",element:x.jsx(sQ,{})}),x.jsx(Pr,{path:"files",element:x.jsx(lQ,{})}),x.jsx(Pr,{path:"dashboard",element:x.jsx(uQ,{})}),x.jsx(Pr,{path:"docs",element:x.jsx(fQ,{})}),x.jsx(Pr,{path:"jarvis",element:x.jsx(B.Suspense,{fallback:null,children:x.jsx(pQ,{})})})]})]})})}));export{d6 as $,tM as A,qm as B,Ki as C,cs as D,wo as E,pc as F,La as G,M5 as H,h_ as I,dD as J,lg as K,dw as L,Pt as M,T0 as N,d_ as O,Fr as P,ZA as Q,l1 as R,N5 as S,Rn as T,L0 as U,Gs as V,YA as W,b1 as X,a6 as Y,l6 as Z,p6 as _,mQ as a,ux as a0,zd as a1,ID as a2,sg as a3,f_ as a4,y6 as a5,Ia as a6,bA as a7,qs as a8,ox as a9,KE as aa,gh as ab,Qj as ac,mz as ad,$E as ae,zb as af,QE as ag,yz as ah,ph as ai,Ri as aj,SA as ak,vj as al,nM as am,tn as an,ag as ao,_i as ap,v5 as aq,m5 as ar,P5 as as,z5 as at,s6 as au,o6 as av,m6 as aw,h6 as ax,g6 as ay,wb as b,El as c,wr as d,Qz as e,ja as f,Hz as g,Si as h,Ln as i,x as j,w0 as k,kt as l,_A as m,D6 as n,dx as o,w6 as p,fx as q,B as r,tA as s,NA as t,z0 as u,ci as v,va as w,ih as x,ZD as y,Tr as z};